import{GLTFLoader as l}from"./glTFLoader-Bx351I09.js";import{aN as m,aO as i}from"./index-6jOCfdig.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_svelte.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_client.js";import"./svelte/svelte_internal_flags_async.js";import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_store.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";import"./bone-DdTyU8i_.js";import"./skeleton-C0c5yg7x.js";import"./rawTexture-CpjOe2U7.js";import"./assetContainer-Drc86vic.js";import"./objectModelMapping-DT0r674A.js";const c="KHR_materials_clearcoat";class u{constructor(r){this.name=c,this.order=190,this._loader=r,this.enabled=this._loader.isExtensionUsed(c)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,e,t){return l.LoadExtensionAsync(r,e,this.name,async(o,s)=>{const a=new Array;a.push(this._loader.loadMaterialPropertiesAsync(r,e,t)),a.push(this._loadClearCoatPropertiesAsync(o,s,t)),await Promise.all(a)})}_loadClearCoatPropertiesAsync(r,e,t){const o=this._loader._getOrCreateMaterialAdapter(t),s=new Array;return o.configureCoat(),o.coatWeight=e.clearcoatFactor!==void 0?e.clearcoatFactor:0,o.coatRoughness=e.clearcoatRoughnessFactor!==void 0?e.clearcoatRoughnessFactor:0,e.clearcoatTexture&&s.push(this._loader.loadTextureInfoAsync(`${r}/clearcoatTexture`,e.clearcoatTexture,a=>{a.name=`${t.name} (ClearCoat)`,o.coatWeightTexture=a})),e.clearcoatRoughnessTexture&&(e.clearcoatRoughnessTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${r}/clearcoatRoughnessTexture`,e.clearcoatRoughnessTexture,a=>{a.name=`${t.name} (ClearCoat Roughness)`,o.coatRoughnessTexture=a}))),e.clearcoatNormalTexture&&(e.clearcoatNormalTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${r}/clearcoatNormalTexture`,e.clearcoatNormalTexture,a=>{a.name=`${t.name} (ClearCoat Normal)`,o.geometryCoatNormalTexture=a,e.clearcoatNormalTexture?.scale!=null&&(o.geometryCoatNormalTextureScale=e.clearcoatNormalTexture.scale)})),o.setNormalMapInversions(!t.getScene().useRightHandedSystem,t.getScene().useRightHandedSystem)),Promise.all(s).then(()=>{})}}m(c);i(c,!0,n=>new u(n));export{u as KHR_materials_clearcoat};
