@needle-tools/engine 4.8.4-next.5c03fe1 → 4.8.4-next.b63dc2f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +5 -0
  2. package/dist/{gltf-progressive-PB_58h1b.umd.cjs → gltf-progressive-C-U_onhf.umd.cjs} +1 -1
  3. package/dist/{gltf-progressive-DorC035H.min.js → gltf-progressive-DViD_J_l.min.js} +1 -1
  4. package/dist/{gltf-progressive-B3JW4cAu.js → gltf-progressive-DXRy9EQz.js} +35 -35
  5. package/dist/loader.worker-CiTwpNPW.js +27 -0
  6. package/dist/{needle-engine.bundle-BecMzBfA.js → needle-engine.bundle-BR8P4m1O.js} +6363 -6394
  7. package/dist/{needle-engine.bundle-BDQm33td.umd.cjs → needle-engine.bundle-CuQtpPTN.umd.cjs} +134 -135
  8. package/dist/{needle-engine.bundle-C3oFZgvW.min.js → needle-engine.bundle-DA6dZylq.min.js} +138 -139
  9. package/dist/needle-engine.js +4 -4
  10. package/dist/needle-engine.min.js +1 -1
  11. package/dist/needle-engine.umd.cjs +1 -1
  12. package/dist/{postprocessing-BgC7XZwK.umd.cjs → postprocessing-61aXdqNz.umd.cjs} +1 -1
  13. package/dist/{postprocessing-ChsrvDkI.min.js → postprocessing-Be9Ds4NK.min.js} +1 -1
  14. package/dist/{postprocessing-DddlM3CK.js → postprocessing-D9jDHD0U.js} +2 -2
  15. package/dist/{three-DrqIzZTH.js → three-BRSLmpyi.js} +2966 -2958
  16. package/dist/{three-DuDKwKB8.min.js → three-CsmWHVn7.min.js} +172 -172
  17. package/dist/{three-B_hneGZr.umd.cjs → three-Dceyffus.umd.cjs} +176 -176
  18. package/dist/{three-examples-BIuXQPSf.js → three-examples-BihZ_R96.js} +2761 -2623
  19. package/dist/{three-examples-CNRuT27G.umd.cjs → three-examples-Ce6Th3bv.umd.cjs} +17 -17
  20. package/dist/three-examples-DKY9Nfge.min.js +501 -0
  21. package/dist/{three-mesh-ui-DWcMuyQ_.min.js → three-mesh-ui-Bwy12Qvg.min.js} +1 -1
  22. package/dist/{three-mesh-ui-tt0buEDC.umd.cjs → three-mesh-ui-Cdh2iW8b.umd.cjs} +1 -1
  23. package/dist/{three-mesh-ui-D6Mz5Yl7.js → three-mesh-ui-gqAXlGNB.js} +1 -1
  24. package/dist/{vendor-C31T0mYm.min.js → vendor-BRpzuoJE.min.js} +1 -1
  25. package/dist/{vendor-D51IT5ns.umd.cjs → vendor-Ja-vKV-a.umd.cjs} +1 -1
  26. package/dist/{vendor-B_ytQUuR.js → vendor-p_xp9KuJ.js} +1 -1
  27. package/lib/engine/debug/debug_console.js +3 -33
  28. package/lib/engine/debug/debug_console.js.map +1 -1
  29. package/lib/engine/engine_pmrem.d.ts +2 -0
  30. package/lib/engine/engine_pmrem.js +100 -0
  31. package/lib/engine/engine_pmrem.js.map +1 -0
  32. package/lib/engine-components/Camera.js +1 -1
  33. package/lib/engine-components/Camera.js.map +1 -1
  34. package/lib/engine-components/DragControls.js +0 -1
  35. package/lib/engine-components/DragControls.js.map +1 -1
  36. package/lib/engine-components/Duplicatable.js +5 -2
  37. package/lib/engine-components/Duplicatable.js.map +1 -1
  38. package/lib/engine-components/Skybox.d.ts +0 -2
  39. package/lib/engine-components/Skybox.js +26 -110
  40. package/lib/engine-components/Skybox.js.map +1 -1
  41. package/lib/engine-components/TransformGizmo.js +10 -2
  42. package/lib/engine-components/TransformGizmo.js.map +1 -1
  43. package/package.json +3 -3
  44. package/src/engine/debug/debug_console.ts +3 -33
  45. package/src/engine/engine_pmrem.ts +118 -0
  46. package/src/engine-components/Camera.ts +1 -1
  47. package/src/engine-components/DragControls.ts +0 -1
  48. package/src/engine-components/Duplicatable.ts +3 -2
  49. package/src/engine-components/Skybox.ts +30 -102
  50. package/src/engine-components/TransformGizmo.ts +11 -2
  51. package/src/include/ktx2/basis_transcoder.js +8 -10
  52. package/src/include/ktx2/basis_transcoder.wasm +0 -0
  53. package/dist/loader.worker-CrU5fNbR.js +0 -27
  54. package/dist/three-examples-D2zemuAM.min.js +0 -501
@@ -1,11 +1,11 @@
1
- "use strict";const a=require("./three-B_hneGZr.umd.cjs");class Qo extends a.Mesh{constructor(e,t,s,n=128){if(t<=0||s<=0||n<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const i=new a.SphereGeometry(s,2*n,n);i.scale(1,1,-1);const o=i.getAttribute("position"),r=new a.Vector3;for(let A=0;A<o.count;++A)if(r.fromBufferAttribute(o,A),r.y<0){const l=-t*3/2,h=r.y<l?-t/r.y:1-r.y*r.y/(3*l*l);r.multiplyScalar(h),r.toArray(o.array,3*A)}o.needsUpdate=!0,super(i,new a.MeshBasicMaterial({map:e,depthWrite:!1}))}}class Ie extends a.Node{constructor(e){super(e.nodeType),this.node=null,this.source=null,this.target=null,this.inclusionType="replace",Object.assign(this,e)}generate(e){return this.node.build(e,this.getNodeType(e))}}const Ue=new a.NodeFrame;Ue.camera=new a.PerspectiveCamera;const ds={LineBasicNodeMaterial:a.ShaderLib.basic,MeshBasicNodeMaterial:a.ShaderLib.basic,PointsNodeMaterial:a.ShaderLib.points,MeshStandardNodeMaterial:a.ShaderLib.standard,MeshPhysicalNodeMaterial:a.ShaderLib.physical,MeshPhongNodeMaterial:a.ShaderLib.phong},xo={atan2:"atan"},So={low:"lowp",medium:"mediump",high:"highp"};function dt(c){return`#include <${c}>`}function kt(c){return`${c}Shader`}class To extends a.NodeBuilder{constructor(e,t,s,n=null){super(e,t,new a.GLSLNodeParser,null,n),this.shader=s,this.slots={vertex:[],fragment:[]},this._parseShaderLib(),this._parseInclude("fragment","lights_physical_fragment","clearcoat_normal_fragment_begin","transmission_fragment"),this._parseObject(),this._sortSlotsToFlow(),this.useComparisonMethod=!0}getMethod(e){return xo[e]||e}addSlot(e,t){this.slots[e].push(t)}_parseShaderLib(){const e=this.material;let t=e.type;if(e.isMeshPhysicalNodeMaterial?t="MeshPhysicalNodeMaterial":e.isMeshStandardNodeMaterial?t="MeshStandardNodeMaterial":e.isMeshPhongNodeMaterial?t="MeshPhongNodeMaterial":e.isMeshBasicNodeMaterial?t="MeshBasicNodeMaterial":e.isPointsNodeMaterial?t="PointsNodeMaterial":e.isLineBasicNodeMaterial&&(t="LineBasicNodeMaterial"),ds[t]!==void 0){const s=ds[t],n=this.shader;n.vertexShader=s.vertexShader,n.fragmentShader=s.fragmentShader,n.uniforms=a.UniformsUtils.merge([s.uniforms,a.UniformsLib.lights])}}_parseObject(){const{material:e,renderer:t}=this;this.addSlot("fragment",new Ie({node:a.normalView,nodeType:"vec3",source:"void main() {",target:"vec3 TransformedNormalView = %RESULT%;",inclusionType:"append"})),t.toneMappingNode&&t.toneMappingNode.isNode===!0&&this.addSlot("fragment",new Ie({node:e.colorNode,nodeType:"vec4",source:dt("tonemapping_fragment"),target:""})),e.colorNode&&e.colorNode.isNode&&this.addSlot("fragment",new Ie({node:e.colorNode,nodeType:"vec4",source:"vec4 diffuseColor = vec4( diffuse, opacity );",target:"vec4 diffuseColor = %RESULT%; diffuseColor.a *= opacity;"})),e.opacityNode&&e.opacityNode.isNode&&this.addSlot("fragment",new Ie({node:e.opacityNode,nodeType:"float",source:dt("alphatest_fragment"),target:"diffuseColor.a = %RESULT%;",inclusionType:"append"})),e.normalNode&&e.normalNode.isNode&&this.addSlot("fragment",new Ie({node:e.normalNode,nodeType:"vec3",source:dt("normal_fragment_begin"),target:"normal = %RESULT%;",inclusionType:"append"})),e.emissiveNode&&e.emissiveNode.isNode&&this.addSlot("fragment",new Ie({node:e.emissiveNode,nodeType:"vec3",source:dt("emissivemap_fragment"),target:"totalEmissiveRadiance = %RESULT%;",inclusionType:"append"})),e.isMeshStandardNodeMaterial&&(e.metalnessNode&&e.metalnessNode.isNode&&this.addSlot("fragment",new Ie({node:e.metalnessNode,nodeType:"float",source:dt("metalnessmap_fragment"),target:"metalnessFactor = %RESULT%;",inclusionType:"append"})),e.roughnessNode&&e.roughnessNode.isNode&&this.addSlot("fragment",new Ie({node:e.roughnessNode,nodeType:"float",source:dt("roughnessmap_fragment"),target:"roughnessFactor = %RESULT%;",inclusionType:"append"})),e.isMeshPhysicalNodeMaterial&&(e.clearcoatNode&&e.clearcoatNode.isNode?(this.addSlot("fragment",new Ie({node:e.clearcoatNode,nodeType:"float",source:"material.clearcoat = clearcoat;",target:"material.clearcoat = %RESULT%;"})),e.clearcoatRoughnessNode&&e.clearcoatRoughnessNode.isNode&&this.addSlot("fragment",new Ie({node:e.clearcoatRoughnessNode,nodeType:"float",source:"material.clearcoatRoughness = clearcoatRoughness;",target:"material.clearcoatRoughness = %RESULT%;"})),e.clearcoatNormalNode&&e.clearcoatNormalNode.isNode&&this.addSlot("fragment",new Ie({node:e.clearcoatNormalNode,nodeType:"vec3",source:"vec3 clearcoatNormal = nonPerturbedNormal;",target:"vec3 clearcoatNormal = %RESULT%;"})),e.defines.USE_CLEARCOAT=""):delete e.defines.USE_CLEARCOAT,e.sheenNode&&e.sheenNode.isNode?(this.addSlot("fragment",new Ie({node:e.sheenNode,nodeType:"vec3",source:"material.sheenColor = sheenColor;",target:"material.sheenColor = %RESULT%;"})),e.sheenRoughnessNode&&e.sheenRoughnessNode.isNode&&this.addSlot("fragment",new Ie({node:e.sheenRoughnessNode,nodeType:"float",source:"material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );",target:"material.sheenRoughness = clamp( %RESULT%, 0.07, 1.0 );"})),e.defines.USE_SHEEN=""):delete e.defines.USE_SHEEN,e.iridescenceNode&&e.iridescenceNode.isNode?(this.addSlot("fragment",new Ie({node:e.iridescenceNode,nodeType:"float",source:"material.iridescence = iridescence;",target:"material.iridescence = %RESULT%;"})),e.iridescenceIORNode&&e.iridescenceIORNode.isNode&&this.addSlot("fragment",new Ie({node:e.iridescenceIORNode,nodeType:"float",source:"material.iridescenceIOR = iridescenceIOR;",target:"material.iridescenceIOR = %RESULT%;"})),e.iridescenceThicknessNode&&e.iridescenceThicknessNode.isNode&&this.addSlot("fragment",new Ie({node:e.iridescenceThicknessNode,nodeType:"float",source:"material.iridescenceThickness = iridescenceThicknessMaximum;",target:"material.iridescenceThickness = %RESULT%;"})),e.defines.USE_IRIDESCENCE=""):delete e.defines.USE_IRIDESCENCE,e.iorNode&&e.iorNode.isNode&&this.addSlot("fragment",new Ie({node:e.iorNode,nodeType:"float",source:"material.ior = ior;",target:"material.ior = %RESULT%;"})),e.specularColorNode&&e.specularColorNode.isNode&&this.addSlot("fragment",new Ie({node:e.specularColorNode,nodeType:"vec3",source:"vec3 specularColorFactor = specularColor;",target:"vec3 specularColorFactor = %RESULT%;"})),e.specularIntensityNode&&e.specularIntensityNode.isNode&&this.addSlot("fragment",new Ie({node:e.specularIntensityNode,nodeType:"float",source:"float specularIntensityFactor = specularIntensity;",target:"float specularIntensityFactor = %RESULT%;"})),e.transmissionNode&&e.transmissionNode.isNode?(this.addSlot("fragment",new Ie({node:e.transmissionNode,nodeType:"float",source:"material.transmission = transmission;",target:"material.transmission = %RESULT%;"})),e.thicknessNode&&e.thicknessNode.isNode&&this.addSlot("fragment",new Ie({node:e.thicknessNode,nodeType:"float",source:"material.thickness = thickness;",target:"material.thickness = %RESULT%;"})),e.attenuationDistanceNode&&e.attenuationDistanceNode.isNode&&this.addSlot("fragment",new Ie({node:e.attenuationDistanceNode,nodeType:"float",source:"material.attenuationDistance = attenuationDistance;",target:"material.attenuationDistance = %RESULT%;"})),e.attenuationColorNode&&e.attenuationColorNode.isNode&&this.addSlot("fragment",new Ie({node:e.attenuationColorNode,nodeType:"vec3",source:"material.attenuationColor = attenuationColor;",target:"material.attenuationColor = %RESULT%;"})),e.transmission=1,e.defines.USE_TRANSMISSION=""):(e.transmission=0,delete e.defines.USE_TRANSMISSION))),e.positionNode&&e.positionNode.isNode&&this.addSlot("vertex",new Ie({node:e.positionNode,nodeType:"vec3",source:dt("begin_vertex"),target:"transformed = %RESULT%;",inclusionType:"append"})),e.sizeNode&&e.sizeNode.isNode&&this.addSlot("vertex",new Ie({node:e.sizeNode,nodeType:"float",source:"gl_PointSize = size;",target:"gl_PointSize = %RESULT%;"}))}generateTexture(e,t,s){return e.isTextureCube?`textureCube( ${t}, ${s} )`:`texture2D( ${t}, ${s} )`}generateTextureLevel(e,t,s,n){return`textureLod( ${t}, ${s}, ${n} )`}buildFunctionCode(e){const t=e.layout,s=this.flowShaderNode(e),n=[];for(const o of t.inputs)n.push(this.getType(o.type)+" "+o.name);return`${this.getType(t.type)} ${t.name}( ${n.join(", ")} ) {
1
+ "use strict";const a=require("./three-Dceyffus.umd.cjs");class vo extends a.Mesh{constructor(e,t,s,n=128){if(t<=0||s<=0||n<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const i=new a.SphereGeometry(s,2*n,n);i.scale(1,1,-1);const o=i.getAttribute("position"),r=new a.Vector3;for(let A=0;A<o.count;++A)if(r.fromBufferAttribute(o,A),r.y<0){const l=-t*3/2,h=r.y<l?-t/r.y:1-r.y*r.y/(3*l*l);r.multiplyScalar(h),r.toArray(o.array,3*A)}o.needsUpdate=!0,super(i,new a.MeshBasicMaterial({map:e,depthWrite:!1}))}}class be extends a.Node{constructor(e){super(e.nodeType),this.node=null,this.source=null,this.target=null,this.inclusionType="replace",Object.assign(this,e)}generate(e){return this.node.build(e,this.getNodeType(e))}}const Ue=new a.NodeFrame;Ue.camera=new a.PerspectiveCamera;const ps={LineBasicNodeMaterial:a.ShaderLib.basic,MeshBasicNodeMaterial:a.ShaderLib.basic,PointsNodeMaterial:a.ShaderLib.points,MeshStandardNodeMaterial:a.ShaderLib.standard,MeshPhysicalNodeMaterial:a.ShaderLib.physical,MeshPhongNodeMaterial:a.ShaderLib.phong},Mo={atan2:"atan"},Ro={low:"lowp",medium:"mediump",high:"highp"};function dt(c){return`#include <${c}>`}function kt(c){return`${c}Shader`}class _o extends a.NodeBuilder{constructor(e,t,s,n=null){super(e,t,new a.GLSLNodeParser,null,n),this.shader=s,this.slots={vertex:[],fragment:[]},this._parseShaderLib(),this._parseInclude("fragment","lights_physical_fragment","clearcoat_normal_fragment_begin","transmission_fragment"),this._parseObject(),this._sortSlotsToFlow(),this.useComparisonMethod=!0}getMethod(e){return Mo[e]||e}addSlot(e,t){this.slots[e].push(t)}_parseShaderLib(){const e=this.material;let t=e.type;if(e.isMeshPhysicalNodeMaterial?t="MeshPhysicalNodeMaterial":e.isMeshStandardNodeMaterial?t="MeshStandardNodeMaterial":e.isMeshPhongNodeMaterial?t="MeshPhongNodeMaterial":e.isMeshBasicNodeMaterial?t="MeshBasicNodeMaterial":e.isPointsNodeMaterial?t="PointsNodeMaterial":e.isLineBasicNodeMaterial&&(t="LineBasicNodeMaterial"),ps[t]!==void 0){const s=ps[t],n=this.shader;n.vertexShader=s.vertexShader,n.fragmentShader=s.fragmentShader,n.uniforms=a.UniformsUtils.merge([s.uniforms,a.UniformsLib.lights])}}_parseObject(){const{material:e,renderer:t}=this;this.addSlot("fragment",new be({node:a.normalView,nodeType:"vec3",source:"void main() {",target:"vec3 TransformedNormalView = %RESULT%;",inclusionType:"append"})),t.toneMappingNode&&t.toneMappingNode.isNode===!0&&this.addSlot("fragment",new be({node:e.colorNode,nodeType:"vec4",source:dt("tonemapping_fragment"),target:""})),e.colorNode&&e.colorNode.isNode&&this.addSlot("fragment",new be({node:e.colorNode,nodeType:"vec4",source:"vec4 diffuseColor = vec4( diffuse, opacity );",target:"vec4 diffuseColor = %RESULT%; diffuseColor.a *= opacity;"})),e.opacityNode&&e.opacityNode.isNode&&this.addSlot("fragment",new be({node:e.opacityNode,nodeType:"float",source:dt("alphatest_fragment"),target:"diffuseColor.a = %RESULT%;",inclusionType:"append"})),e.normalNode&&e.normalNode.isNode&&this.addSlot("fragment",new be({node:e.normalNode,nodeType:"vec3",source:dt("normal_fragment_begin"),target:"normal = %RESULT%;",inclusionType:"append"})),e.emissiveNode&&e.emissiveNode.isNode&&this.addSlot("fragment",new be({node:e.emissiveNode,nodeType:"vec3",source:dt("emissivemap_fragment"),target:"totalEmissiveRadiance = %RESULT%;",inclusionType:"append"})),e.isMeshStandardNodeMaterial&&(e.metalnessNode&&e.metalnessNode.isNode&&this.addSlot("fragment",new be({node:e.metalnessNode,nodeType:"float",source:dt("metalnessmap_fragment"),target:"metalnessFactor = %RESULT%;",inclusionType:"append"})),e.roughnessNode&&e.roughnessNode.isNode&&this.addSlot("fragment",new be({node:e.roughnessNode,nodeType:"float",source:dt("roughnessmap_fragment"),target:"roughnessFactor = %RESULT%;",inclusionType:"append"})),e.isMeshPhysicalNodeMaterial&&(e.clearcoatNode&&e.clearcoatNode.isNode?(this.addSlot("fragment",new be({node:e.clearcoatNode,nodeType:"float",source:"material.clearcoat = clearcoat;",target:"material.clearcoat = %RESULT%;"})),e.clearcoatRoughnessNode&&e.clearcoatRoughnessNode.isNode&&this.addSlot("fragment",new be({node:e.clearcoatRoughnessNode,nodeType:"float",source:"material.clearcoatRoughness = clearcoatRoughness;",target:"material.clearcoatRoughness = %RESULT%;"})),e.clearcoatNormalNode&&e.clearcoatNormalNode.isNode&&this.addSlot("fragment",new be({node:e.clearcoatNormalNode,nodeType:"vec3",source:"vec3 clearcoatNormal = nonPerturbedNormal;",target:"vec3 clearcoatNormal = %RESULT%;"})),e.defines.USE_CLEARCOAT=""):delete e.defines.USE_CLEARCOAT,e.sheenNode&&e.sheenNode.isNode?(this.addSlot("fragment",new be({node:e.sheenNode,nodeType:"vec3",source:"material.sheenColor = sheenColor;",target:"material.sheenColor = %RESULT%;"})),e.sheenRoughnessNode&&e.sheenRoughnessNode.isNode&&this.addSlot("fragment",new be({node:e.sheenRoughnessNode,nodeType:"float",source:"material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );",target:"material.sheenRoughness = clamp( %RESULT%, 0.07, 1.0 );"})),e.defines.USE_SHEEN=""):delete e.defines.USE_SHEEN,e.iridescenceNode&&e.iridescenceNode.isNode?(this.addSlot("fragment",new be({node:e.iridescenceNode,nodeType:"float",source:"material.iridescence = iridescence;",target:"material.iridescence = %RESULT%;"})),e.iridescenceIORNode&&e.iridescenceIORNode.isNode&&this.addSlot("fragment",new be({node:e.iridescenceIORNode,nodeType:"float",source:"material.iridescenceIOR = iridescenceIOR;",target:"material.iridescenceIOR = %RESULT%;"})),e.iridescenceThicknessNode&&e.iridescenceThicknessNode.isNode&&this.addSlot("fragment",new be({node:e.iridescenceThicknessNode,nodeType:"float",source:"material.iridescenceThickness = iridescenceThicknessMaximum;",target:"material.iridescenceThickness = %RESULT%;"})),e.defines.USE_IRIDESCENCE=""):delete e.defines.USE_IRIDESCENCE,e.iorNode&&e.iorNode.isNode&&this.addSlot("fragment",new be({node:e.iorNode,nodeType:"float",source:"material.ior = ior;",target:"material.ior = %RESULT%;"})),e.specularColorNode&&e.specularColorNode.isNode&&this.addSlot("fragment",new be({node:e.specularColorNode,nodeType:"vec3",source:"vec3 specularColorFactor = specularColor;",target:"vec3 specularColorFactor = %RESULT%;"})),e.specularIntensityNode&&e.specularIntensityNode.isNode&&this.addSlot("fragment",new be({node:e.specularIntensityNode,nodeType:"float",source:"float specularIntensityFactor = specularIntensity;",target:"float specularIntensityFactor = %RESULT%;"})),e.transmissionNode&&e.transmissionNode.isNode?(this.addSlot("fragment",new be({node:e.transmissionNode,nodeType:"float",source:"material.transmission = transmission;",target:"material.transmission = %RESULT%;"})),e.thicknessNode&&e.thicknessNode.isNode&&this.addSlot("fragment",new be({node:e.thicknessNode,nodeType:"float",source:"material.thickness = thickness;",target:"material.thickness = %RESULT%;"})),e.attenuationDistanceNode&&e.attenuationDistanceNode.isNode&&this.addSlot("fragment",new be({node:e.attenuationDistanceNode,nodeType:"float",source:"material.attenuationDistance = attenuationDistance;",target:"material.attenuationDistance = %RESULT%;"})),e.attenuationColorNode&&e.attenuationColorNode.isNode&&this.addSlot("fragment",new be({node:e.attenuationColorNode,nodeType:"vec3",source:"material.attenuationColor = attenuationColor;",target:"material.attenuationColor = %RESULT%;"})),e.transmission=1,e.defines.USE_TRANSMISSION=""):(e.transmission=0,delete e.defines.USE_TRANSMISSION))),e.positionNode&&e.positionNode.isNode&&this.addSlot("vertex",new be({node:e.positionNode,nodeType:"vec3",source:dt("begin_vertex"),target:"transformed = %RESULT%;",inclusionType:"append"})),e.sizeNode&&e.sizeNode.isNode&&this.addSlot("vertex",new be({node:e.sizeNode,nodeType:"float",source:"gl_PointSize = size;",target:"gl_PointSize = %RESULT%;"}))}generateTexture(e,t,s){return e.isTextureCube?`textureCube( ${t}, ${s} )`:`texture2D( ${t}, ${s} )`}generateTextureLevel(e,t,s,n){return`textureLod( ${t}, ${s}, ${n} )`}buildFunctionCode(e){const t=e.layout,s=this.flowShaderNode(e),n=[];for(const o of t.inputs)n.push(this.getType(o.type)+" "+o.name);return`${this.getType(t.type)} ${t.name}( ${n.join(", ")} ) {
2
2
 
3
3
  ${s.vars}
4
4
 
5
5
  ${s.code}
6
6
  return ${s.result};
7
7
 
8
- }`}getUniforms(e){const t=this.uniforms[e];let s="";for(const n of t){if(/^(modelViewMatrix|projectionMatrix)$/.test(n.name))continue;let i=null;n.type==="texture"?i=`sampler2D ${n.name}; `:n.type==="cubeTexture"?i=`samplerCube ${n.name}; `:i=`${this.getVectorType(n.type)} ${n.name}; `;const o=n.node.precision;o!==null?i="uniform "+So[o]+" "+i:i="uniform "+i,s+=i}return s}getAttributes(e){let t="";if(e==="vertex"){const s=this.attributes;for(const n of s)/^(position|normal|uv[1-3]?)$/.test(n.name)||(t+=`attribute ${n.type} ${n.name}; `)}return t}getVaryings(e){let t="";const s=this.varyings;if(e==="vertex")for(const n of s)t+=`${n.needsInterpolation?"varying":"/*varying*/"} ${n.type} ${n.name}; `;else if(e==="fragment")for(const n of s)n.needsInterpolation&&(t+=`varying ${n.type} ${n.name}; `);return t}addCode(e,t,s,n=this){const i=kt(e);let o=n[i];const r=o.indexOf(t);if(r!==-1){const A=o.substring(0,r+t.length),l=o.substring(r+t.length);o=`${A}
8
+ }`}getUniforms(e){const t=this.uniforms[e];let s="";for(const n of t){if(/^(modelViewMatrix|projectionMatrix)$/.test(n.name))continue;let i=null;n.type==="texture"?i=`sampler2D ${n.name}; `:n.type==="cubeTexture"?i=`samplerCube ${n.name}; `:i=`${this.getVectorType(n.type)} ${n.name}; `;const o=n.node.precision;o!==null?i="uniform "+Ro[o]+" "+i:i="uniform "+i,s+=i}return s}getAttributes(e){let t="";if(e==="vertex"){const s=this.attributes;for(const n of s)/^(position|normal|uv[1-3]?)$/.test(n.name)||(t+=`attribute ${n.type} ${n.name}; `)}return t}getVaryings(e){let t="";const s=this.varyings;if(e==="vertex")for(const n of s)t+=`${n.needsInterpolation?"varying":"/*varying*/"} ${n.type} ${n.name}; `;else if(e==="fragment")for(const n of s)n.needsInterpolation&&(t+=`varying ${n.type} ${n.name}; `);return t}addCode(e,t,s,n=this){const i=kt(e);let o=n[i];const r=o.indexOf(t);if(r!==-1){const A=o.substring(0,r+t.length),l=o.substring(r+t.length);o=`${A}
9
9
  ${s}
10
10
  ${l}`}n[i]=o}replaceCode(e,t,s,n=this){const i=kt(e);n[i]=n[i].replaceAll(t,s)}getVertexIndex(){return"gl_VertexID"}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord"}isFlipY(){return!0}buildCode(){const e={};for(const t of a.defaultShaderStages){const s=this.getUniforms(t),n=this.getAttributes(t),i=this.getVaryings(t),o=this.getVars(t),r=this.getCodes(t);e[t]=`${this.getSignature()}
11
11
  // <node_builder>
@@ -30,24 +30,24 @@ ${r}
30
30
  ${this.shader[kt(t)]}
31
31
  `}this.vertexShader=e.vertex,this.fragmentShader=e.fragment}build(){return super.build(!1),this._addSnippets(),this._addUniforms(),this._updateUniforms(),this.shader.vertexShader=this.vertexShader,this.shader.fragmentShader=this.fragmentShader,this}_parseInclude(e,...t){for(const s of t){const n=dt(s),i=a.ShaderChunk[s],o=kt(e);this.shader[o]=this.shader[o].replaceAll(n,i)}}_sortSlotsToFlow(){for(const e of a.defaultShaderStages){const t=this.shader[kt(e)],s=this.slots[e].sort((n,i)=>t.indexOf(n.source)>t.indexOf(i.source)?1:-1);for(const n of s)this.addFlow(e,n)}}_addSnippets(){for(const e of a.defaultShaderStages){for(const t of this.slots[e]){const s=this.getFlowData(t),n=t.inclusionType,i=t.source,o=s.code+`
32
32
  `+t.target.replace("%RESULT%",s.result);n==="append"?this.addCode(e,i,o):n==="replace"?this.replaceCode(e,i,o):console.warn(`Inclusion type "${n}" not compatible.`)}this.addCode(e,"main() {",`
33
- `+this.flowCode[e])}}_addUniforms(){for(const e of a.defaultShaderStages)for(const t of this.uniforms[e])this.shader.uniforms[t.name]=t}_updateUniforms(){Ue.object=this.object,Ue.renderer=this.renderer,Ue.material=this.material,Ue.scene=this.scene;for(const e of this.updateNodes)Ue.updateNode(e)}}const ri=new WeakMap;a.Material.prototype.onBuild=function(c,e,t){const s=this;if(s.isNodeMaterial===!0){let n;try{n=new To(c,t,e,s).build(),ri.set(s,n)}catch(i){console.error("Material.prototype.onBuild: ",i)}}};a.Material.prototype.onBeforeRender=function(c,e,t,s,n){const i=ri.get(this);if(i!==void 0){Ue.material=this,Ue.camera=t,Ue.object=n,Ue.renderer=c,Ue.scene=e,Ue.geometry=s;const o=i.updateNodes;if(o.length>0){c.state.useProgram(null);for(const r of o)Ue.updateNode(r)}}};var Wt=function(){var c=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(h){h.preventDefault(),s(++c%e.children.length)},!1);function t(h){return e.appendChild(h.dom),h}function s(h){for(var u=0;u<e.children.length;u++)e.children[u].style.display=u===h?"block":"none";c=h}var n=(performance||Date).now(),i=n,o=0,r=t(new Wt.Panel("FPS","#0ff","#002")),A=t(new Wt.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var l=t(new Wt.Panel("MB","#f08","#201"));return s(0),{REVISION:16,dom:e,addPanel:t,showPanel:s,begin:function(){n=(performance||Date).now()},end:function(){o++;var h=(performance||Date).now();if(A.update(h-n,200),h>=i+1e3&&(r.update(o*1e3/(h-i),100),i=h,o=0,l)){var u=performance.memory;l.update(u.usedJSHeapSize/1048576,u.jsHeapSizeLimit/1048576)}return h},update:function(){n=this.end()},domElement:e,setMode:s}};Wt.Panel=function(c,e,t){var s=1/0,n=0,i=Math.round,o=i(window.devicePixelRatio||1),r=80*o,A=48*o,l=3*o,h=2*o,u=3*o,p=15*o,g=74*o,f=30*o,I=document.createElement("canvas");I.width=r,I.height=A,I.style.cssText="width:80px;height:48px";var b=I.getContext("2d");return b.font="bold "+9*o+"px Helvetica,Arial,sans-serif",b.textBaseline="top",b.fillStyle=t,b.fillRect(0,0,r,A),b.fillStyle=e,b.fillText(c,l,h),b.fillRect(u,p,g,f),b.fillStyle=t,b.globalAlpha=.9,b.fillRect(u,p,g,f),{dom:I,update:function(E,y){s=Math.min(s,E),n=Math.max(n,E),b.fillStyle=t,b.globalAlpha=1,b.fillRect(0,0,r,p),b.fillStyle=e,b.fillText(i(E)+" "+c+" ("+i(s)+"-"+i(n)+")",l,h),b.drawImage(I,u+o,p,g-o,f,u,p,g-o,f),b.fillRect(u+g-o,p,o,f),b.fillStyle=t,b.globalAlpha=.9,b.fillRect(u+g-o,p,o,i((1-E/y)*f))}}};function vo(c,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},s=c.getIndex(),n=c.getAttribute("position"),i=s?s.count:n.count;let o=0;const r=Object.keys(c.attributes),A={},l={},h=[],u=["getX","getY","getZ","getW"],p=["setX","setY","setZ","setW"];for(let y=0,C=r.length;y<C;y++){const w=r[y],x=c.attributes[w];A[w]=new x.constructor(new x.array.constructor(x.count*x.itemSize),x.itemSize,x.normalized);const R=c.morphAttributes[w];R&&(l[w]||(l[w]=[]),R.forEach((D,S)=>{const v=new D.array.constructor(D.count*D.itemSize);l[w][S]=new D.constructor(v,D.itemSize,D.normalized)}))}const g=e*.5,f=Math.log10(1/e),I=Math.pow(10,f),b=g*I;for(let y=0;y<i;y++){const C=s?s.getX(y):y;let w="";for(let x=0,R=r.length;x<R;x++){const D=r[x],S=c.getAttribute(D),v=S.itemSize;for(let N=0;N<v;N++)w+=`${~~(S[u[N]](C)*I+b)},`}if(w in t)h.push(t[w]);else{for(let x=0,R=r.length;x<R;x++){const D=r[x],S=c.getAttribute(D),v=c.morphAttributes[D],N=S.itemSize,G=A[D],O=l[D];for(let X=0;X<N;X++){const U=u[X],q=p[X];if(G[q](o,S[U](C)),v)for(let H=0,z=v.length;H<z;H++)O[H][q](o,v[H][U](C))}}t[w]=o,h.push(o),o++}}const E=c.clone();for(const y in c.attributes){const C=A[y];if(E.setAttribute(y,new C.constructor(C.array.slice(0,o*C.itemSize),C.itemSize,C.normalized)),y in l)for(let w=0;w<l[y].length;w++){const x=l[y][w];E.morphAttributes[y][w]=new x.constructor(x.array.slice(0,o*x.itemSize),x.itemSize,x.normalized)}}return E.setIndex(h),E}function ps(c,e){if(e===a.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),c;if(e===a.TriangleFanDrawMode||e===a.TriangleStripDrawMode){let t=c.getIndex();if(t===null){const o=[],r=c.getAttribute("position");if(r!==void 0){for(let A=0;A<r.count;A++)o.push(A);c.setIndex(o),t=c.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),c}const s=t.count-2,n=[];if(e===a.TriangleFanDrawMode)for(let o=1;o<=s;o++)n.push(t.getX(0)),n.push(t.getX(o)),n.push(t.getX(o+1));else for(let o=0;o<s;o++)o%2===0?(n.push(t.getX(o)),n.push(t.getX(o+1)),n.push(t.getX(o+2))):(n.push(t.getX(o+2)),n.push(t.getX(o+1)),n.push(t.getX(o)));n.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const i=c.clone();return i.setIndex(n),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),c}class es extends a.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Fo(t)}),this.register(function(t){return new Lo(t)}),this.register(function(t){return new qo(t)}),this.register(function(t){return new zo(t)}),this.register(function(t){return new Ko(t)}),this.register(function(t){return new No(t)}),this.register(function(t){return new Go(t)}),this.register(function(t){return new Uo(t)}),this.register(function(t){return new Po(t)}),this.register(function(t){return new _o(t)}),this.register(function(t){return new Oo(t)}),this.register(function(t){return new ko(t)}),this.register(function(t){return new jo(t)}),this.register(function(t){return new Ho(t)}),this.register(function(t){return new Ro(t)}),this.register(function(t){return new Yo(t)}),this.register(function(t){return new Vo(t)})}load(e,t,s,n){const i=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const l=a.LoaderUtils.extractUrlBase(e);o=a.LoaderUtils.resolveURL(l,this.path)}else o=a.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const r=function(l){n?n(l):console.error(l),i.manager.itemError(e),i.manager.itemEnd(e)},A=new a.FileLoader(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(l){try{i.parse(l,o,function(h){t(h),i.manager.itemEnd(e)},r)}catch(h){r(h)}},s,r)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,n){let i,o;const r={},A={},l=new TextDecoder;if(typeof e=="string")try{i=JSON.parse(e)}catch(u){o=e,n&&n(u);return}else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===ai){try{r[ie.KHR_BINARY_GLTF]=new Jo(e)}catch(p){n&&n(p);return}try{i=JSON.parse(r[ie.KHR_BINARY_GLTF].content)}catch(p){o=r[ie.KHR_BINARY_GLTF].content,n&&n(p);return}}else try{i=JSON.parse(l.decode(e))}catch(p){o=l.decode(e),n&&n(p);return}else i=e;if(i.asset===void 0||i.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=i,this.jsonErrorData=o;const h=new Ar(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const p=this.pluginCallbacks[u](h);p.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),A[p.name]=p,r[p.name]=!0}if(i.extensionsUsed)for(let u=0;u<i.extensionsUsed.length;++u){const p=i.extensionsUsed[u],g=i.extensionsRequired||[];switch(p){case ie.KHR_MATERIALS_UNLIT:r[p]=new Do;break;case ie.KHR_DRACO_MESH_COMPRESSION:r[p]=new Wo(i,this.dracoLoader);break;case ie.KHR_TEXTURE_TRANSFORM:r[p]=new Xo;break;case ie.KHR_MESH_QUANTIZATION:r[p]=new Zo;break;default:g.indexOf(p)>=0&&A[p]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+p+'".')}}h.setExtensions(r),h.setPlugins(A),h.parse(s,n)}parseAsync(e,t){const s=this;return new Promise(function(n,i){s.parse(e,t,n,i)})}}function Mo(){let c={};return{get:function(e){return c[e]},add:function(e,t){c[e]=t},remove:function(e){delete c[e]},removeAll:function(){c={}}}}const ie={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Ro{constructor(e){this.parser=e,this.name=ie.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,n=t.length;s<n;s++){const i=t[s];i.extensions&&i.extensions[this.name]&&i.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,i.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let n=t.cache.get(s);if(n)return n;const i=t.json,A=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let l;const h=new a.Color(16777215);A.color!==void 0&&h.setRGB(A.color[0],A.color[1],A.color[2],a.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":l=new a.DirectionalLight(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new a.PointLight(h),l.distance=u;break;case"spot":l=new a.SpotLight(h),l.distance=u,A.spot=A.spot||{},A.spot.innerConeAngle=A.spot.innerConeAngle!==void 0?A.spot.innerConeAngle:0,A.spot.outerConeAngle=A.spot.outerConeAngle!==void 0?A.spot.outerConeAngle:Math.PI/4,l.angle=A.spot.outerConeAngle,l.penumbra=1-A.spot.innerConeAngle/A.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+A.type)}return l.position.set(0,0,0),l.decay=2,lt(l,A),A.intensity!==void 0&&(l.intensity=A.intensity),l.name=t.createUniqueName(A.name||"light_"+e),n=Promise.resolve(l),t.cache.add(s,n),n}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,s=this.parser,i=s.json.nodes[e],r=(i.extensions&&i.extensions[this.name]||{}).light;return r===void 0?null:this._loadLight(r).then(function(A){return s._getNodeRef(t.cache,r,A)})}}let Do=class{constructor(){this.name=ie.KHR_MATERIALS_UNLIT}getMaterialType(){return a.MeshBasicMaterial}extendParams(e,t,s){const n=[];e.color=new a.Color(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const o=i.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],a.LinearSRGBColorSpace),e.opacity=o[3]}i.baseColorTexture!==void 0&&n.push(s.assignTexture(e,"map",i.baseColorTexture,a.SRGBColorSpace))}return Promise.all(n)}},_o=class{constructor(e){this.parser=e,this.name=ie.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return i!==void 0&&(t.emissiveIntensity=i),Promise.resolve()}},Fo=class{constructor(e){this.parser=e,this.name=ie.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&i.push(s.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&i.push(s.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(i.push(s.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const r=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new a.Vector2(r,r)}return Promise.all(i)}},Lo=class{constructor(e){this.parser=e,this.name=ie.KHR_MATERIALS_DISPERSION}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.dispersion=i.dispersion!==void 0?i.dispersion:0,Promise.resolve()}},ko=class{constructor(e){this.parser=e,this.name=ie.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&i.push(s.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&i.push(s.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(i)}},No=class{constructor(e){this.parser=e,this.name=ie.KHR_MATERIALS_SHEEN}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new a.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=n.extensions[this.name];if(o.sheenColorFactor!==void 0){const r=o.sheenColorFactor;t.sheenColor.setRGB(r[0],r[1],r[2],a.LinearSRGBColorSpace)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&i.push(s.assignTexture(t,"sheenColorMap",o.sheenColorTexture,a.SRGBColorSpace)),o.sheenRoughnessTexture!==void 0&&i.push(s.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(i)}},Go=class{constructor(e){this.parser=e,this.name=ie.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&i.push(s.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(i)}},Uo=class{constructor(e){this.parser=e,this.name=ie.KHR_MATERIALS_VOLUME}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&i.push(s.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const r=o.attenuationColor||[1,1,1];return t.attenuationColor=new a.Color().setRGB(r[0],r[1],r[2],a.LinearSRGBColorSpace),Promise.all(i)}},Po=class{constructor(e){this.parser=e,this.name=ie.KHR_MATERIALS_IOR}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}},Oo=class{constructor(e){this.parser=e,this.name=ie.KHR_MATERIALS_SPECULAR}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&i.push(s.assignTexture(t,"specularIntensityMap",o.specularTexture));const r=o.specularColorFactor||[1,1,1];return t.specularColor=new a.Color().setRGB(r[0],r[1],r[2],a.LinearSRGBColorSpace),o.specularColorTexture!==void 0&&i.push(s.assignTexture(t,"specularColorMap",o.specularColorTexture,a.SRGBColorSpace)),Promise.all(i)}},Ho=class{constructor(e){this.parser=e,this.name=ie.EXT_MATERIALS_BUMP}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&i.push(s.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(i)}},jo=class{constructor(e){this.parser=e,this.name=ie.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&i.push(s.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(i)}};class qo{constructor(e){this.parser=e,this.name=ie.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,s=t.json,n=s.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const i=n.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,o)}}class zo{constructor(e){this.parser=e,this.name=ie.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],r=n.images[o.source];let A=s.textureLoader;if(r.uri){const l=s.options.manager.getHandler(r.uri);l!==null&&(A=l)}return this.detectSupport().then(function(l){if(l)return s.loadTextureImage(e,o.source,A);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Ko{constructor(e){this.parser=e,this.name=ie.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],r=n.images[o.source];let A=s.textureLoader;if(r.uri){const l=s.options.manager.getHandler(r.uri);l!==null&&(A=l)}return this.detectSupport().then(function(l){if(l)return s.loadTextureImage(e,o.source,A);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Yo{constructor(e){this.name=ie.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const n=s.extensions[this.name],i=this.parser.getDependency("buffer",n.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then(function(r){const A=n.byteOffset||0,l=n.byteLength||0,h=n.count,u=n.byteStride,p=new Uint8Array(r,A,l);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,u,p,n.mode,n.filter).then(function(g){return g.buffer}):o.ready.then(function(){const g=new ArrayBuffer(h*u);return o.decodeGltfBuffer(new Uint8Array(g),h,u,p,n.mode,n.filter),g})})}else return null}}let Vo=class{constructor(e){this.name=ie.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const n=t.meshes[s.mesh];for(const l of n.primitives)if(l.mode!==Xe.TRIANGLES&&l.mode!==Xe.TRIANGLE_STRIP&&l.mode!==Xe.TRIANGLE_FAN&&l.mode!==void 0)return null;const o=s.extensions[this.name].attributes,r=[],A={};for(const l in o)r.push(this.parser.getDependency("accessor",o[l]).then(h=>(A[l]=h,A[l])));return r.length<1?null:(r.push(this.parser.createNodeMesh(e)),Promise.all(r).then(l=>{const h=l.pop(),u=h.isGroup?h.children:[h],p=l[0].count,g=[];for(const f of u){const I=new a.Matrix4,b=new a.Vector3,E=new a.Quaternion,y=new a.Vector3(1,1,1),C=new a.InstancedMesh(f.geometry,f.material,p);for(let w=0;w<p;w++)A.TRANSLATION&&b.fromBufferAttribute(A.TRANSLATION,w),A.ROTATION&&E.fromBufferAttribute(A.ROTATION,w),A.SCALE&&y.fromBufferAttribute(A.SCALE,w),C.setMatrixAt(w,I.compose(b,E,y));for(const w in A)if(w==="_COLOR_0"){const x=A[w];C.instanceColor=new a.InstancedBufferAttribute(x.array,x.itemSize,x.normalized)}else w!=="TRANSLATION"&&w!=="ROTATION"&&w!=="SCALE"&&f.geometry.setAttribute(w,A[w]);a.Object3D.prototype.copy.call(C,f),this.parser.assignFinalMaterial(C),g.push(C)}return h.isGroup?(h.clear(),h.add(...g),h):g[0]}))}};const ai="glTF",Nt=12,gs={JSON:1313821514,BIN:5130562};class Jo{constructor(e){this.name=ie.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Nt),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ai)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-Nt,i=new DataView(e,Nt);let o=0;for(;o<n;){const r=i.getUint32(o,!0);o+=4;const A=i.getUint32(o,!0);if(o+=4,A===gs.JSON){const l=new Uint8Array(e,Nt+o,r);this.content=s.decode(l)}else if(A===gs.BIN){const l=Nt+o;this.body=e.slice(l,l+r)}o+=r}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Wo{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ie.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const s=this.json,n=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,r={},A={},l={};for(const h in o){const u=qn[h]||h.toLowerCase();r[u]=o[h]}for(const h in e.attributes){const u=qn[h]||h.toLowerCase();if(o[h]!==void 0){const p=s.accessors[e.attributes[h]],g=_t[p.componentType];l[u]=g.name,A[u]=p.normalized===!0}}return t.getDependency("bufferView",i).then(function(h){return new Promise(function(u,p){n.decodeDracoFile(h,function(g){for(const f in g.attributes){const I=g.attributes[f],b=A[f];b!==void 0&&(I.normalized=b)}u(g)},r,l,a.LinearSRGBColorSpace,p)})})}}class Xo{constructor(){this.name=ie.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class Zo{constructor(){this.name=ie.KHR_MESH_QUANTIZATION}}class Ai extends a.Interpolant{constructor(e,t,s,n){super(e,t,s,n)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,n=this.valueSize,i=e*n*3+n;for(let o=0;o!==n;o++)t[o]=s[i+o];return t}interpolate_(e,t,s,n){const i=this.resultBuffer,o=this.sampleValues,r=this.valueSize,A=r*2,l=r*3,h=n-t,u=(s-t)/h,p=u*u,g=p*u,f=e*l,I=f-l,b=-2*g+3*p,E=g-p,y=1-b,C=E-p+u;for(let w=0;w!==r;w++){const x=o[I+w+r],R=o[I+w+A]*h,D=o[f+w+r],S=o[f+w]*h;i[w]=y*x+C*R+b*D+E*S}return i}}const $o=new a.Quaternion;class er extends Ai{interpolate_(e,t,s,n){const i=super.interpolate_(e,t,s,n);return $o.fromArray(i).normalize().toArray(i),i}}const Xe={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},_t={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},fs={9728:a.NearestFilter,9729:a.LinearFilter,9984:a.NearestMipmapNearestFilter,9985:a.LinearMipmapNearestFilter,9986:a.NearestMipmapLinearFilter,9987:a.LinearMipmapLinearFilter},ms={33071:a.ClampToEdgeWrapping,33648:a.MirroredRepeatWrapping,10497:a.RepeatWrapping},In={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},qn={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},pt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},tr={CUBICSPLINE:void 0,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},bn={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function nr(c){return c.DefaultMaterial===void 0&&(c.DefaultMaterial=new a.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:a.FrontSide})),c.DefaultMaterial}function Et(c,e,t){for(const s in t.extensions)c[s]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[s]=t.extensions[s])}function lt(c,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(c.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function sr(c,e,t){let s=!1,n=!1,i=!1;for(let l=0,h=e.length;l<h;l++){const u=e[l];if(u.POSITION!==void 0&&(s=!0),u.NORMAL!==void 0&&(n=!0),u.COLOR_0!==void 0&&(i=!0),s&&n&&i)break}if(!s&&!n&&!i)return Promise.resolve(c);const o=[],r=[],A=[];for(let l=0,h=e.length;l<h;l++){const u=e[l];if(s){const p=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):c.attributes.position;o.push(p)}if(n){const p=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):c.attributes.normal;r.push(p)}if(i){const p=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):c.attributes.color;A.push(p)}}return Promise.all([Promise.all(o),Promise.all(r),Promise.all(A)]).then(function(l){const h=l[0],u=l[1],p=l[2];return s&&(c.morphAttributes.position=h),n&&(c.morphAttributes.normal=u),i&&(c.morphAttributes.color=p),c.morphTargetsRelative=!0,c})}function ir(c,e){if(c.updateMorphTargets(),e.weights!==void 0)for(let t=0,s=e.weights.length;t<s;t++)c.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(c.morphTargetInfluences.length===t.length){c.morphTargetDictionary={};for(let s=0,n=t.length;s<n;s++)c.morphTargetDictionary[t[s]]=s}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function or(c){let e;const t=c.extensions&&c.extensions[ie.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+En(t.attributes):e=c.indices+":"+En(c.attributes)+":"+c.mode,c.targets!==void 0)for(let s=0,n=c.targets.length;s<n;s++)e+=":"+En(c.targets[s]);return e}function En(c){let e="";const t=Object.keys(c).sort();for(let s=0,n=t.length;s<n;s++)e+=t[s]+":"+c[t[s]]+";";return e}function zn(c){switch(c){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function rr(c){return c.search(/\.jpe?g($|\?)/i)>0||c.search(/^data\:image\/jpeg/)===0?"image/jpeg":c.search(/\.webp($|\?)/i)>0||c.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const ar=new a.Matrix4;class Ar{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Mo,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,n=-1,i=!1,o=-1;if(typeof navigator<"u"){const r=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(r)===!0;const A=r.match(/Version\/(\d+)/);n=s&&A?parseInt(A[1],10):-1,i=r.indexOf("Firefox")>-1,o=i?r.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&n<17||i&&o<98?this.textureLoader=new a.TextureLoader(this.options.manager):this.textureLoader=new a.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const r={scene:o[0][n.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:n.asset,parser:s,userData:{}};return Et(i,r,n),lt(r,n),Promise.all(s._invokeAll(function(A){return A.afterRoot&&A.afterRoot(r)})).then(function(){for(const A of r.scenes)A.updateMatrixWorld();e(r)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let n=0,i=t.length;n<i;n++){const o=t[n].joints;for(let r=0,A=o.length;r<A;r++)e[o[r]].isBone=!0}for(let n=0,i=e.length;n<i;n++){const o=e[n];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(s[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,s){if(e.refs[t]<=1)return s;const n=s.clone(),i=(o,r)=>{const A=this.associations.get(o);A!=null&&this.associations.set(r,A);for(const[l,h]of o.children.entries())i(h,r.children[l])};return i(s,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s<t.length;s++){const n=e(t[s]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const s=[];for(let n=0;n<t.length;n++){const i=e(t[n]);i&&s.push(i)}return s}getDependency(e,t){const s=e+":"+t;let n=this.cache.get(s);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(i){return i.loadNode&&i.loadNode(t)});break;case"mesh":n=this._invokeOne(function(i){return i.loadMesh&&i.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(i){return i.loadBufferView&&i.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(i){return i.loadMaterial&&i.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(i){return i.loadTexture&&i.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(i){return i.loadAnimation&&i.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne(function(i){return i!=this&&i.getDependency&&i.getDependency(e,t)}),!n)throw new Error("Unknown type: "+e);break}this.cache.add(s,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const s=this,n=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(n.map(function(i,o){return s.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],s=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[ie.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(i,o){s.load(a.LoaderUtils.resolveURL(t.uri,n.path),i,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(s){const n=t.byteLength||0,i=t.byteOffset||0;return s.slice(i,i+n)})}loadAccessor(e){const t=this,s=this.json,n=this.json.accessors[e];if(n.bufferView===void 0&&n.sparse===void 0){const o=In[n.type],r=_t[n.componentType],A=n.normalized===!0,l=new r(n.count*o);return Promise.resolve(new a.BufferAttribute(l,o,A))}const i=[];return n.bufferView!==void 0?i.push(this.getDependency("bufferView",n.bufferView)):i.push(null),n.sparse!==void 0&&(i.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(i).then(function(o){const r=o[0],A=In[n.type],l=_t[n.componentType],h=l.BYTES_PER_ELEMENT,u=h*A,p=n.byteOffset||0,g=n.bufferView!==void 0?s.bufferViews[n.bufferView].byteStride:void 0,f=n.normalized===!0;let I,b;if(g&&g!==u){const E=Math.floor(p/g),y="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+E+":"+n.count;let C=t.cache.get(y);C||(I=new l(r,E*g,n.count*g/h),C=new a.InterleavedBuffer(I,g/h),t.cache.add(y,C)),b=new a.InterleavedBufferAttribute(C,A,p%g/h,f)}else r===null?I=new l(n.count*A):I=new l(r,p,n.count*A),b=new a.BufferAttribute(I,A,f);if(n.sparse!==void 0){const E=In.SCALAR,y=_t[n.sparse.indices.componentType],C=n.sparse.indices.byteOffset||0,w=n.sparse.values.byteOffset||0,x=new y(o[1],C,n.sparse.count*E),R=new l(o[2],w,n.sparse.count*A);r!==null&&(b=new a.BufferAttribute(b.array.slice(),b.itemSize,b.normalized)),b.normalized=!1;for(let D=0,S=x.length;D<S;D++){const v=x[D];if(b.setX(v,R[D*A]),A>=2&&b.setY(v,R[D*A+1]),A>=3&&b.setZ(v,R[D*A+2]),A>=4&&b.setW(v,R[D*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}b.normalized=f}return b})}loadTexture(e){const t=this.json,s=this.options,i=t.textures[e].source,o=t.images[i];let r=this.textureLoader;if(o.uri){const A=s.manager.getHandler(o.uri);A!==null&&(r=A)}return this.loadTextureImage(e,i,r)}loadTextureImage(e,t,s){const n=this,i=this.json,o=i.textures[e],r=i.images[t],A=(r.uri||r.bufferView)+":"+o.sampler;if(this.textureCache[A])return this.textureCache[A];const l=this.loadImageSource(t,s).then(function(h){h.flipY=!1,h.name=o.name||r.name||"",h.name===""&&typeof r.uri=="string"&&r.uri.startsWith("data:image/")===!1&&(h.name=r.uri);const p=(i.samplers||{})[o.sampler]||{};return h.magFilter=fs[p.magFilter]||a.LinearFilter,h.minFilter=fs[p.minFilter]||a.LinearMipmapLinearFilter,h.wrapS=ms[p.wrapS]||a.RepeatWrapping,h.wrapT=ms[p.wrapT]||a.RepeatWrapping,h.anisotropy=4,n.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[A]=l,l}loadImageSource(e,t){const s=this,n=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const o=n.images[e],r=self.URL||self.webkitURL;let A=o.uri||"",l=!1;if(o.bufferView!==void 0)A=s.getDependency("bufferView",o.bufferView).then(function(u){l=!0;const p=new Blob([u],{type:o.mimeType});return A=r.createObjectURL(p),A});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(A).then(function(u){return new Promise(function(p,g){let f=p;t.isImageBitmapLoader===!0&&(f=function(I){const b=new a.Texture(I);b.needsUpdate=!0,p(b)}),t.load(a.LoaderUtils.resolveURL(u,i.path),f,void 0,g)})}).then(function(u){return l===!0&&r.revokeObjectURL(A),lt(u,o),u.userData.mimeType=o.mimeType||rr(o.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=h,h}assignTexture(e,t,s,n){const i=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),i.extensions[ie.KHR_TEXTURE_TRANSFORM]){const r=s.extensions!==void 0?s.extensions[ie.KHR_TEXTURE_TRANSFORM]:void 0;if(r){const A=i.associations.get(o);o=i.extensions[ie.KHR_TEXTURE_TRANSFORM].extendTexture(o,r),i.associations.set(o,A)}}return n!==void 0&&(o.colorSpace=n),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const n=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const r="PointsMaterial:"+s.uuid;let A=this.cache.get(r);A||(A=new a.PointsMaterial,a.Material.prototype.copy.call(A,s),A.color.copy(s.color),A.map=s.map,A.sizeAttenuation=!1,this.cache.add(r,A)),s=A}else if(e.isLine){const r="LineBasicMaterial:"+s.uuid;let A=this.cache.get(r);A||(A=new a.LineBasicMaterial,a.Material.prototype.copy.call(A,s),A.color.copy(s.color),A.map=s.map,this.cache.add(r,A)),s=A}if(n||i||o){let r="ClonedMaterial:"+s.uuid+":";n&&(r+="derivative-tangents:"),i&&(r+="vertex-colors:"),o&&(r+="flat-shading:");let A=this.cache.get(r);A||(A=s.clone(),i&&(A.vertexColors=!0),o&&(A.flatShading=!0),n&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(r,A),this.associations.set(A,this.associations.get(s))),s=A}e.material=s}getMaterialType(){return a.MeshStandardMaterial}loadMaterial(e){const t=this,s=this.json,n=this.extensions,i=s.materials[e];let o;const r={},A=i.extensions||{},l=[];if(A[ie.KHR_MATERIALS_UNLIT]){const u=n[ie.KHR_MATERIALS_UNLIT];o=u.getMaterialType(),l.push(u.extendParams(r,i,t))}else{const u=i.pbrMetallicRoughness||{};if(r.color=new a.Color(1,1,1),r.opacity=1,Array.isArray(u.baseColorFactor)){const p=u.baseColorFactor;r.color.setRGB(p[0],p[1],p[2],a.LinearSRGBColorSpace),r.opacity=p[3]}u.baseColorTexture!==void 0&&l.push(t.assignTexture(r,"map",u.baseColorTexture,a.SRGBColorSpace)),r.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,r.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(r,"metalnessMap",u.metallicRoughnessTexture)),l.push(t.assignTexture(r,"roughnessMap",u.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,r)})))}i.doubleSided===!0&&(r.side=a.DoubleSide);const h=i.alphaMode||bn.OPAQUE;if(h===bn.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,h===bn.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&o!==a.MeshBasicMaterial&&(l.push(t.assignTexture(r,"normalMap",i.normalTexture)),r.normalScale=new a.Vector2(1,1),i.normalTexture.scale!==void 0)){const u=i.normalTexture.scale;r.normalScale.set(u,u)}if(i.occlusionTexture!==void 0&&o!==a.MeshBasicMaterial&&(l.push(t.assignTexture(r,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(r.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&o!==a.MeshBasicMaterial){const u=i.emissiveFactor;r.emissive=new a.Color().setRGB(u[0],u[1],u[2],a.LinearSRGBColorSpace)}return i.emissiveTexture!==void 0&&o!==a.MeshBasicMaterial&&l.push(t.assignTexture(r,"emissiveMap",i.emissiveTexture,a.SRGBColorSpace)),Promise.all(l).then(function(){const u=new o(r);return i.name&&(u.name=i.name),lt(u,i),t.associations.set(u,{materials:e}),i.extensions&&Et(n,u,i),u})}createUniqueName(e){const t=a.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,n=this.primitiveCache;function i(r){return s[ie.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(r,t).then(function(A){return Is(A,r,t)})}const o=[];for(let r=0,A=e.length;r<A;r++){const l=e[r],h=or(l),u=n[h];if(u)o.push(u.promise);else{let p;l.extensions&&l.extensions[ie.KHR_DRACO_MESH_COMPRESSION]?p=i(l):p=Is(new a.BufferGeometry,l,t),n[h]={primitive:l,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,s=this.json,n=this.extensions,i=s.meshes[e],o=i.primitives,r=[];for(let A=0,l=o.length;A<l;A++){const h=o[A].material===void 0?nr(this.cache):this.getDependency("material",o[A].material);r.push(h)}return r.push(t.loadGeometries(o)),Promise.all(r).then(function(A){const l=A.slice(0,A.length-1),h=A[A.length-1],u=[];for(let g=0,f=h.length;g<f;g++){const I=h[g],b=o[g];let E;const y=l[g];if(b.mode===Xe.TRIANGLES||b.mode===Xe.TRIANGLE_STRIP||b.mode===Xe.TRIANGLE_FAN||b.mode===void 0)E=i.isSkinnedMesh===!0?new a.SkinnedMesh(I,y):new a.Mesh(I,y),E.isSkinnedMesh===!0&&E.normalizeSkinWeights(),b.mode===Xe.TRIANGLE_STRIP?E.geometry=ps(E.geometry,a.TriangleStripDrawMode):b.mode===Xe.TRIANGLE_FAN&&(E.geometry=ps(E.geometry,a.TriangleFanDrawMode));else if(b.mode===Xe.LINES)E=new a.LineSegments(I,y);else if(b.mode===Xe.LINE_STRIP)E=new a.Line(I,y);else if(b.mode===Xe.LINE_LOOP)E=new a.LineLoop(I,y);else if(b.mode===Xe.POINTS)E=new a.Points(I,y);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(E.geometry.morphAttributes).length>0&&ir(E,i),E.name=t.createUniqueName(i.name||"mesh_"+e),lt(E,i),b.extensions&&Et(n,E,b),t.assignFinalMaterial(E),u.push(E)}for(let g=0,f=u.length;g<f;g++)t.associations.set(u[g],{meshes:e,primitives:g});if(u.length===1)return i.extensions&&Et(n,u[0],i),u[0];const p=new a.Group;i.extensions&&Et(n,p,i),t.associations.set(p,{meshes:e});for(let g=0,f=u.length;g<f;g++)p.add(u[g]);return p})}loadCamera(e){let t;const s=this.json.cameras[e],n=s[s.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return s.type==="perspective"?t=new a.PerspectiveCamera(a.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):s.type==="orthographic"&&(t=new a.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),lt(t,s),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],s=[];for(let n=0,i=t.joints.length;n<i;n++)s.push(this._loadNodeShallow(t.joints[n]));return t.inverseBindMatrices!==void 0?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(n){const i=n.pop(),o=n,r=[],A=[];for(let l=0,h=o.length;l<h;l++){const u=o[l];if(u){r.push(u);const p=new a.Matrix4;i!==null&&p.fromArray(i.array,l*16),A.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new a.Skeleton(r,A)})}loadAnimation(e){const t=this.json,s=this,n=t.animations[e],i=n.name?n.name:"animation_"+e,o=[],r=[],A=[],l=[],h=[];let u=0,p=n.channels.length;for(u=0,p=n.channels.length;u<p;u++){const g=n.channels[u],f=n.samplers[g.sampler],I=g.target,b=I.node,E=n.parameters!==void 0?n.parameters[f.input]:f.input,y=n.parameters!==void 0?n.parameters[f.output]:f.output;I.node!==void 0&&(o.push(this.getDependency("node",b)),r.push(this.getDependency("accessor",E)),A.push(this.getDependency("accessor",y)),l.push(f),h.push(I))}return Promise.all([Promise.all(o),Promise.all(r),Promise.all(A),Promise.all(l),Promise.all(h)]).then(function(g){const f=g[0],I=g[1],b=g[2],E=g[3],y=g[4],C=[];for(u=0,p=f.length;u<p;u++){const w=f[u],x=I[u],R=b[u],D=E[u],S=y[u];if(w===void 0)continue;w.updateMatrix&&w.updateMatrix();const v=s._createAnimationTracks(w,x,R,D,S);if(v)for(let N=0;N<v.length;N++)C.push(v[N])}return new a.AnimationClip(i,void 0,C)})}createNodeMesh(e){const t=this.json,s=this,n=t.nodes[e];return n.mesh===void 0?null:s.getDependency("mesh",n.mesh).then(function(i){const o=s._getNodeRef(s.meshCache,n.mesh,i);return n.weights!==void 0&&o.traverse(function(r){if(r.isMesh)for(let A=0,l=n.weights.length;A<l;A++)r.morphTargetInfluences[A]=n.weights[A]}),o})}loadNode(e){const t=this.json,s=this,n=t.nodes[e],i=s._loadNodeShallow(e),o=[],r=n.children||[];for(let l=0,h=r.length;l<h;l++)o.push(s.getDependency("node",r[l]));const A=n.skin===void 0?Promise.resolve(null):s.getDependency("skin",n.skin);return Promise.all([i,Promise.all(o),A]).then(function(l){const h=l[0],u=l[1],p=l[2];p!==null&&h.traverse(function(g){g.isSkinnedMesh&&g.bind(p,ar)});for(let g=0,f=u.length;g<f;g++)h.add(u[g]);return h})}_loadNodeShallow(e){const t=this.json,s=this.extensions,n=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const i=t.nodes[e],o=i.name?n.createUniqueName(i.name):"",r=[],A=n._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return A&&r.push(A),i.camera!==void 0&&r.push(n.getDependency("camera",i.camera).then(function(l){return n._getNodeRef(n.cameraCache,i.camera,l)})),n._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){r.push(l)}),this.nodeCache[e]=Promise.all(r).then(function(l){let h;if(i.isBone===!0?h=new a.Bone:l.length>1?h=new a.Group:l.length===1?h=l[0]:h=new a.Object3D,h!==l[0])for(let u=0,p=l.length;u<p;u++)h.add(l[u]);if(i.name&&(h.userData.name=i.name,h.name=o),lt(h,i),i.extensions&&Et(s,h,i),i.matrix!==void 0){const u=new a.Matrix4;u.fromArray(i.matrix),h.applyMatrix4(u)}else i.translation!==void 0&&h.position.fromArray(i.translation),i.rotation!==void 0&&h.quaternion.fromArray(i.rotation),i.scale!==void 0&&h.scale.fromArray(i.scale);return n.associations.has(h)||n.associations.set(h,{}),n.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,s=this.json.scenes[e],n=this,i=new a.Group;s.name&&(i.name=n.createUniqueName(s.name)),lt(i,s),s.extensions&&Et(t,i,s);const o=s.nodes||[],r=[];for(let A=0,l=o.length;A<l;A++)r.push(n.getDependency("node",o[A]));return Promise.all(r).then(function(A){for(let h=0,u=A.length;h<u;h++)i.add(A[h]);const l=h=>{const u=new Map;for(const[p,g]of n.associations)(p instanceof a.Material||p instanceof a.Texture)&&u.set(p,g);return h.traverse(p=>{const g=n.associations.get(p);g!=null&&u.set(p,g)}),u};return n.associations=l(i),i})}_createAnimationTracks(e,t,s,n,i){const o=[],r=e.name?e.name:e.uuid,A=[];pt[i.path]===pt.weights?e.traverse(function(p){p.morphTargetInfluences&&A.push(p.name?p.name:p.uuid)}):A.push(r);let l;switch(pt[i.path]){case pt.weights:l=a.NumberKeyframeTrack;break;case pt.rotation:l=a.QuaternionKeyframeTrack;break;case pt.position:case pt.scale:l=a.VectorKeyframeTrack;break;default:switch(s.itemSize){case 1:l=a.NumberKeyframeTrack;break;case 2:case 3:default:l=a.VectorKeyframeTrack;break}break}const h=n.interpolation!==void 0?tr[n.interpolation]:a.InterpolateLinear,u=this._getArrayFromAccessor(s);for(let p=0,g=A.length;p<g;p++){const f=new l(A[p]+"."+pt[i.path],t.array,u,h);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(f),o.push(f)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const s=zn(t.constructor),n=new Float32Array(t.length);for(let i=0,o=t.length;i<o;i++)n[i]=t[i]*s;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(s){const n=this instanceof a.QuaternionKeyframeTrack?er:Ai;return new n(this.times,this.values,this.getValueSize()/3,s)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function cr(c,e,t){const s=e.attributes,n=new a.Box3;if(s.POSITION!==void 0){const r=t.json.accessors[s.POSITION],A=r.min,l=r.max;if(A!==void 0&&l!==void 0){if(n.set(new a.Vector3(A[0],A[1],A[2]),new a.Vector3(l[0],l[1],l[2])),r.normalized){const h=zn(_t[r.componentType]);n.min.multiplyScalar(h),n.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const i=e.targets;if(i!==void 0){const r=new a.Vector3,A=new a.Vector3;for(let l=0,h=i.length;l<h;l++){const u=i[l];if(u.POSITION!==void 0){const p=t.json.accessors[u.POSITION],g=p.min,f=p.max;if(g!==void 0&&f!==void 0){if(A.setX(Math.max(Math.abs(g[0]),Math.abs(f[0]))),A.setY(Math.max(Math.abs(g[1]),Math.abs(f[1]))),A.setZ(Math.max(Math.abs(g[2]),Math.abs(f[2]))),p.normalized){const I=zn(_t[p.componentType]);A.multiplyScalar(I)}r.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(r)}c.boundingBox=n;const o=new a.Sphere;n.getCenter(o.center),o.radius=n.min.distanceTo(n.max)/2,c.boundingSphere=o}function Is(c,e,t){const s=e.attributes,n=[];function i(o,r){return t.getDependency("accessor",o).then(function(A){c.setAttribute(r,A)})}for(const o in s){const r=qn[o]||o.toLowerCase();r in c.attributes||n.push(i(s[o],r))}if(e.indices!==void 0&&!c.index){const o=t.getDependency("accessor",e.indices).then(function(r){c.setIndex(r)});n.push(o)}return a.ColorManagement.workingColorSpace!==a.LinearSRGBColorSpace&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${a.ColorManagement.workingColorSpace}" not supported.`),lt(c,e),cr(c,e,t),Promise.all(n).then(function(){return e.targets!==void 0?sr(c,e.targets,t):c})}var lr=(function(){var c="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),s=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n=WebAssembly.validate(t)?e:c,i,o=WebAssembly.instantiate(r(n),{}).then(function(E){i=E.instance,i.exports.__wasm_call_ctors()});function r(E){for(var y=new Uint8Array(E.length),C=0;C<E.length;++C){var w=E.charCodeAt(C);y[C]=w>96?w-97:w>64?w-39:w+4}for(var x=0,C=0;C<E.length;++C)y[x++]=y[C]<60?s[y[C]]:(y[C]-60)*64+y[++C];return y.buffer.slice(0,x)}function A(E,y,C,w,x,R){var D=i.exports.sbrk,S=C+3&-4,v=D(S*w),N=D(x.length),G=new Uint8Array(i.exports.memory.buffer);G.set(x,N);var O=E(v,C,w,N,x.length);if(O==0&&R&&R(v,S,w),y.set(G.subarray(v,v+C*w)),D(v-D(0)),O!=0)throw new Error("Malformed buffer data: "+O)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],p=0;function g(E){var y={object:new Worker(E),pending:0,requests:{}};return y.object.onmessage=function(C){var w=C.data;y.pending-=w.count,y.requests[w.id][w.action](w.value),delete y.requests[w.id]},y}function f(E){for(var y="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r(n))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+A.toString()+b.toString(),C=new Blob([y],{type:"text/javascript"}),w=URL.createObjectURL(C),x=0;x<E;++x)u[x]=g(w);URL.revokeObjectURL(w)}function I(E,y,C,w,x){for(var R=u[0],D=1;D<u.length;++D)u[D].pending<R.pending&&(R=u[D]);return new Promise(function(S,v){var N=new Uint8Array(C),G=p++;R.pending+=E,R.requests[G]={resolve:S,reject:v},R.object.postMessage({id:G,count:E,size:y,source:N,mode:w,filter:x},[N.buffer])})}function b(E){o.then(function(){var y=E.data;try{var C=new Uint8Array(y.count*y.size);A(i.exports[y.mode],C,y.count,y.size,y.source,i.exports[y.filter]),self.postMessage({id:y.id,count:y.count,action:"resolve",value:C},[C.buffer])}catch(w){self.postMessage({id:y.id,count:y.count,action:"reject",value:w})}})}return{ready:o,supported:!0,useWorkers:function(E){f(E)},decodeVertexBuffer:function(E,y,C,w,x){A(i.exports.meshopt_decodeVertexBuffer,E,y,C,w,i.exports[l[x]])},decodeIndexBuffer:function(E,y,C,w){A(i.exports.meshopt_decodeIndexBuffer,E,y,C,w)},decodeIndexSequence:function(E,y,C,w){A(i.exports.meshopt_decodeIndexSequence,E,y,C,w)},decodeGltfBuffer:function(E,y,C,w,x,R){A(i.exports[h[x]],E,y,C,w,i.exports[l[R]])},decodeGltfBufferAsync:function(E,y,C,w,x){return u.length>0?I(E,y,C,h[w],l[x]):o.then(function(){var R=new Uint8Array(E*y);return A(i.exports[h[w]],R,E,y,C,i.exports[l[x]]),R})}}})();const Cn=new WeakMap;class hr extends a.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,s,n){const i=new a.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,o=>{this.parse(o,t,n)},s,n)}parse(e,t,s=()=>{}){this.decodeDracoFile(e,t,null,null,a.SRGBColorSpace,s).catch(s)}decodeDracoFile(e,t,s,n,i=a.LinearSRGBColorSpace,o=()=>{}){const r={attributeIDs:s||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!s,vertexColorSpace:i};return this.decodeGeometry(e,r).then(t).catch(o)}decodeGeometry(e,t){const s=JSON.stringify(t);if(Cn.has(e)){const A=Cn.get(e);if(A.key===s)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const i=this.workerNextTaskID++,o=e.byteLength,r=this._getWorker(i,o).then(A=>(n=A,new Promise((l,h)=>{n._callbacks[i]={resolve:l,reject:h},n.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return r.catch(()=>!0).then(()=>{n&&i&&this._releaseTask(n,i)}),Cn.set(e,{key:s,promise:r}),r}_createGeometry(e){const t=new a.BufferGeometry;e.index&&t.setIndex(new a.BufferAttribute(e.index.array,1));for(let s=0;s<e.attributes.length;s++){const n=e.attributes[s],i=n.name,o=n.array,r=n.itemSize,A=new a.BufferAttribute(o,r);i==="color"&&(this._assignVertexColorSpace(A,n.vertexColorSpace),A.normalized=!(o instanceof Float32Array)),t.setAttribute(i,A)}return t}_assignVertexColorSpace(e,t){if(t!==a.SRGBColorSpace)return;const s=new a.Color;for(let n=0,i=e.count;n<i;n++)s.fromBufferAttribute(e,n),a.ColorManagement.toWorkingColorSpace(s,a.SRGBColorSpace),e.setXYZ(n,s.r,s.g,s.b)}_loadLibrary(e,t){const s=new a.FileLoader(this.manager);return s.setPath(this.decoderPath),s.setResponseType(t),s.setWithCredentials(this.withCredentials),new Promise((n,i)=>{s.load(e,n,void 0,i)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(s=>{const n=s[0];e||(this.decoderConfig.wasmBinary=s[1]);const i=ur.toString(),o=["/* draco decoder */",n,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join(`
34
- `);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(i){const o=i.data;switch(o.type){case"decode":n._callbacks[o.id].resolve(o);break;case"error":n._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,i){return n._taskLoad>i._taskLoad?-1:1});const s=this.workerPool[this.workerPool.length-1];return s._taskCosts[e]=t,s._taskLoad+=t,s})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function ur(){let c,e;onmessage=function(o){const r=o.data;switch(r.type){case"init":c=r.decoderConfig,e=new Promise(function(h){c.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(c)});break;case"decode":const A=r.buffer,l=r.taskConfig;e.then(h=>{const u=h.draco,p=new u.Decoder;try{const g=t(u,p,new Int8Array(A),l),f=g.attributes.map(I=>I.array.buffer);g.index&&f.push(g.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:g},f)}catch(g){console.error(g),self.postMessage({type:"error",id:r.id,error:g.message})}finally{u.destroy(p)}});break}};function t(o,r,A,l){const h=l.attributeIDs,u=l.attributeTypes;let p,g;const f=r.GetEncodedGeometryType(A);if(f===o.TRIANGULAR_MESH)p=new o.Mesh,g=r.DecodeArrayToMesh(A,A.byteLength,p);else if(f===o.POINT_CLOUD)p=new o.PointCloud,g=r.DecodeArrayToPointCloud(A,A.byteLength,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!g.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+g.error_msg());const I={index:null,attributes:[]};for(const b in h){const E=self[u[b]];let y,C;if(l.useUniqueIDs)C=h[b],y=r.GetAttributeByUniqueId(p,C);else{if(C=r.GetAttributeId(p,o[h[b]]),C===-1)continue;y=r.GetAttribute(p,C)}const w=n(o,r,p,b,E,y);b==="color"&&(w.vertexColorSpace=l.vertexColorSpace),I.attributes.push(w)}return f===o.TRIANGULAR_MESH&&(I.index=s(o,r,p)),o.destroy(p),I}function s(o,r,A){const h=A.num_faces()*3,u=h*4,p=o._malloc(u);r.GetTrianglesUInt32Array(A,u,p);const g=new Uint32Array(o.HEAPF32.buffer,p,h).slice();return o._free(p),{array:g,itemSize:1}}function n(o,r,A,l,h,u){const p=u.num_components(),f=A.num_points()*p,I=f*h.BYTES_PER_ELEMENT,b=i(o,h),E=o._malloc(I);r.GetAttributeDataArrayForAllPoints(A,u,b,I,E);const y=new h(o.HEAPF32.buffer,E,f).slice();return o._free(E),{name:l,array:y,itemSize:p}}function i(o,r){switch(r){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}class dr{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const s=this.workersResolve[e];if(s&&s(t),this.queue.length){const{resolve:n,msg:i,transfer:o}=this.queue.shift();this.workersResolve[e]=n,this.workers[e].postMessage(i,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(s=>{const n=this._getIdleWorker();n!==-1?(this._initWorker(n),this.workerStatus|=1<<n,this.workersResolve[n]=s,this.workers[n].postMessage(e,t)):this.queue.push({resolve:s,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const pr=0,bs=2,gr=1,Es=2,fr=0,mr=1,Ir=10,br=0,ci=9,li=15,hi=16,ui=22,di=37,pi=43,gi=76,fi=83,mi=97,Ii=100,bi=103,Ei=109,Ci=165,Bi=166,yi=1000066e3;class Er{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Gt{constructor(e,t,s,n){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,s),this._littleEndian=n,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t){t===void 0&&(t=0);const s=this._offset;let n=0;for(;this._dataView.getUint8(this._offset)!==t&&n<e;)n++,this._offset++;return n<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+s,n)}}const Le=[171,75,84,88,32,50,48,187,13,10,26,10];function Cs(c){return new TextDecoder().decode(c)}function Cr(c){const e=new Uint8Array(c.buffer,c.byteOffset,Le.length);if(e[0]!==Le[0]||e[1]!==Le[1]||e[2]!==Le[2]||e[3]!==Le[3]||e[4]!==Le[4]||e[5]!==Le[5]||e[6]!==Le[6]||e[7]!==Le[7]||e[8]!==Le[8]||e[9]!==Le[9]||e[10]!==Le[10]||e[11]!==Le[11])throw new Error("Missing KTX 2.0 identifier.");const t=new Er,s=17*Uint32Array.BYTES_PER_ELEMENT,n=new Gt(c,Le.length,s,!0);t.vkFormat=n._nextUint32(),t.typeSize=n._nextUint32(),t.pixelWidth=n._nextUint32(),t.pixelHeight=n._nextUint32(),t.pixelDepth=n._nextUint32(),t.layerCount=n._nextUint32(),t.faceCount=n._nextUint32();const i=n._nextUint32();t.supercompressionScheme=n._nextUint32();const o=n._nextUint32(),r=n._nextUint32(),A=n._nextUint32(),l=n._nextUint32(),h=n._nextUint64(),u=n._nextUint64(),p=new Gt(c,Le.length+s,3*i*8,!0);for(let z=0;z<i;z++)t.levels.push({levelData:new Uint8Array(c.buffer,c.byteOffset+p._nextUint64(),p._nextUint64()),uncompressedByteLength:p._nextUint64()});const g=new Gt(c,o,r,!0),f={vendorId:g._skip(4)._nextUint16(),descriptorType:g._nextUint16(),versionNumber:g._nextUint16(),descriptorBlockSize:g._nextUint16(),colorModel:g._nextUint8(),colorPrimaries:g._nextUint8(),transferFunction:g._nextUint8(),flags:g._nextUint8(),texelBlockDimension:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],bytesPlane:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],samples:[]},I=(f.descriptorBlockSize/4-6)/4;for(let z=0;z<I;z++){const $={bitOffset:g._nextUint16(),bitLength:g._nextUint8(),channelType:g._nextUint8(),samplePosition:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&$.channelType?($.sampleLower=g._nextInt32(),$.sampleUpper=g._nextInt32()):($.sampleLower=g._nextUint32(),$.sampleUpper=g._nextUint32()),f.samples[z]=$}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(f);const b=new Gt(c,A,l,!0);for(;b._offset<l;){const z=b._nextUint32(),$=b._scan(z),ee=Cs($);if(t.keyValue[ee]=b._nextUint8Array(z-$.byteLength-1),ee.match(/^ktx/i)){const se=Cs(t.keyValue[ee]);t.keyValue[ee]=se.substring(0,se.lastIndexOf("\0"))}b._skip(z%4?4-z%4:0)}if(u<=0)return t;const E=new Gt(c,h,u,!0),y=E._nextUint16(),C=E._nextUint16(),w=E._nextUint32(),x=E._nextUint32(),R=E._nextUint32(),D=E._nextUint32(),S=[];for(let z=0;z<i;z++)S.push({imageFlags:E._nextUint32(),rgbSliceByteOffset:E._nextUint32(),rgbSliceByteLength:E._nextUint32(),alphaSliceByteOffset:E._nextUint32(),alphaSliceByteLength:E._nextUint32()});const v=h+E._offset,N=v+w,G=N+x,O=G+R,X=new Uint8Array(c.buffer,c.byteOffset+v,w),U=new Uint8Array(c.buffer,c.byteOffset+N,x),q=new Uint8Array(c.buffer,c.byteOffset+G,R),H=new Uint8Array(c.buffer,c.byteOffset+O,D);return t.globalData={endpointCount:y,selectorCount:C,imageDescs:S,endpointsData:X,selectorsData:U,tablesData:q,extendedData:H},t}let Bn,ct,Kn;const yn={env:{emscripten_notify_memory_growth:function(c){Kn=new Uint8Array(ct.exports.memory.buffer)}}};class Br{init(){return Bn||(Bn=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Bs).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,yn)).then(this._init):WebAssembly.instantiate(Buffer.from(Bs,"base64"),yn).then(this._init),Bn)}_init(e){ct=e.instance,yn.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!ct)throw new Error("ZSTDDecoder: Await .init() before decoding.");const s=e.byteLength,n=ct.exports.malloc(s);Kn.set(e,n),t=t||Number(ct.exports.ZSTD_findDecompressedSize(n,s));const i=ct.exports.malloc(t),o=ct.exports.ZSTD_decompress(i,t,n,s),r=Kn.slice(i,i+o);return ct.exports.free(n),ct.exports.free(i),r}}const Bs="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNz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QEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQA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QDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgH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QsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgA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AoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDI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4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",wn=new WeakMap;let Qn=0,xn;class it extends a.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new dr,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new a.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),s=new a.FileLoader(this.manager);s.setPath(this.transcoderPath),s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials);const n=s.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,n]).then(([i,o])=>{const r=it.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(it.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(it.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(it.BasisFormat),"/* basis_transcoder.js */",i,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
35
- `);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{const l=new Worker(this.workerSourceURL),h=this.transcoderBinary.slice(0);return l.postMessage({type:"init",config:this.workerConfig,transcoderBinary:h},[h]),l})}),Qn>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Qn++}return this.transcoderPending}load(e,t,s,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const i=new a.FileLoader(this.manager);i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials),i.load(e,o=>{this.parse(o,t,n)},s,n)}parse(e,t,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(wn.has(e))return wn.get(e).promise.then(t).catch(s);this._createTexture(e).then(n=>t?t(n):null).catch(s)}_createTextureFrom(e,t){const{faces:s,width:n,height:i,format:o,type:r,error:A,dfdFlags:l}=e;if(r==="error")return Promise.reject(A);let h;if(t.faceCount===6)h=new a.CompressedCubeTexture(s,o,a.UnsignedByteType);else{const u=s[0].mipmaps;h=t.layerCount>1?new a.CompressedArrayTexture(u,n,i,t.layerCount,o,a.UnsignedByteType):new a.CompressedTexture(u,n,i,o,a.UnsignedByteType)}return h.minFilter=s[0].mipmaps.length===1?a.LinearFilter:a.LinearMipmapLinearFilter,h.magFilter=a.LinearFilter,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=wi(t),h.premultiplyAlpha=!!(l&gr),h}async _createTexture(e,t={}){const s=Cr(new Uint8Array(e));if(s.vkFormat!==br)return wr(s);const n=t,i=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:n},[e])).then(o=>this._createTextureFrom(o.data,s));return wn.set(e,{promise:i}),i}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Qn--,this}}it.BasisFormat={ETC1S:0,UASTC_4x4:1};it.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16};it.EngineFormat={RGBAFormat:a.RGBAFormat,RGBA_ASTC_4x4_Format:a.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:a.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:a.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:a.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:a.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:a.RGB_ETC1_Format,RGB_ETC2_Format:a.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:a.RGBA_S3TC_DXT1_Format};it.BasisWorker=function(){let c,e,t;const s=_EngineFormat,n=_TranscoderFormat,i=_BasisFormat;self.addEventListener("message",function(f){const I=f.data;switch(I.type){case"init":c=I.config,o(I.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:b,buffers:E,width:y,height:C,hasAlpha:w,format:x,dfdFlags:R}=r(I.buffer);self.postMessage({type:"transcode",id:I.id,faces:b,width:y,height:C,hasAlpha:w,format:x,dfdFlags:R},E)}catch(b){console.error(b),self.postMessage({type:"error",id:I.id,error:b.message})}});break}});function o(f){e=new Promise(I=>{t={wasmBinary:f,onRuntimeInitialized:I},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function r(f){const I=new t.KTX2File(new Uint8Array(f));function b(){I.close(),I.delete()}if(!I.isValid())throw b(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");const E=I.isUASTC()?i.UASTC_4x4:i.ETC1S,y=I.getWidth(),C=I.getHeight(),w=I.getLayers()||1,x=I.getLevels(),R=I.getFaces(),D=I.getHasAlpha(),S=I.getDFDFlags(),{transcoderFormat:v,engineFormat:N}=u(E,y,C,D);if(!y||!C||!x)throw b(),new Error("THREE.KTX2Loader: Invalid texture");if(!I.startTranscoding())throw b(),new Error("THREE.KTX2Loader: .startTranscoding failed");const G=[],O=[];for(let X=0;X<R;X++){const U=[];for(let q=0;q<x;q++){const H=[];let z,$;for(let se=0;se<w;se++){const ce=I.getImageLevelInfo(q,se,X);X===0&&q===0&&se===0&&(ce.origWidth%4!==0||ce.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),x>1?(z=ce.origWidth,$=ce.origHeight):(z=ce.width,$=ce.height);const re=new Uint8Array(I.getImageTranscodedSizeInBytes(q,se,0,v));if(!I.transcodeImage(re,q,se,X,v,0,-1,-1))throw b(),new Error("THREE.KTX2Loader: .transcodeImage failed.");H.push(re)}const ee=g(H);U.push({data:ee,width:z,height:$}),O.push(ee.buffer)}G.push({mipmaps:U,width:y,height:C,format:N})}return b(),{faces:G,buffers:O,width:y,height:C,hasAlpha:D,format:N,dfdFlags:S}}const A=[{if:"astcSupported",basisFormat:[i.UASTC_4x4],transcoderFormat:[n.ASTC_4x4,n.ASTC_4x4],engineFormat:[s.RGBA_ASTC_4x4_Format,s.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[i.ETC1S,i.UASTC_4x4],transcoderFormat:[n.BC7_M5,n.BC7_M5],engineFormat:[s.RGBA_BPTC_Format,s.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[i.ETC1S,i.UASTC_4x4],transcoderFormat:[n.BC1,n.BC3],engineFormat:[s.RGBA_S3TC_DXT1_Format,s.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[i.ETC1S,i.UASTC_4x4],transcoderFormat:[n.ETC1,n.ETC2],engineFormat:[s.RGB_ETC2_Format,s.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[i.ETC1S,i.UASTC_4x4],transcoderFormat:[n.ETC1],engineFormat:[s.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[i.ETC1S,i.UASTC_4x4],transcoderFormat:[n.PVRTC1_4_RGB,n.PVRTC1_4_RGBA],engineFormat:[s.RGB_PVRTC_4BPPV1_Format,s.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],l=A.sort(function(f,I){return f.priorityETC1S-I.priorityETC1S}),h=A.sort(function(f,I){return f.priorityUASTC-I.priorityUASTC});function u(f,I,b,E){let y,C;const w=f===i.ETC1S?l:h;for(let x=0;x<w.length;x++){const R=w[x];if(c[R.if]&&R.basisFormat.includes(f)&&!(E&&R.transcoderFormat.length<2)&&!(R.needsPowerOfTwo&&!(p(I)&&p(b))))return y=R.transcoderFormat[E?1:0],C=R.engineFormat[E?1:0],{transcoderFormat:y,engineFormat:C}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),y=n.RGBA32,C=s.RGBAFormat,{transcoderFormat:y,engineFormat:C}}function p(f){return f<=2?!0:(f&f-1)===0&&f!==0}function g(f){if(f.length===1)return f[0];let I=0;for(let y=0;y<f.length;y++){const C=f[y];I+=C.byteLength}const b=new Uint8Array(I);let E=0;for(let y=0;y<f.length;y++){const C=f[y];b.set(C,E),E+=C.byteLength}return b}};const yr=new Set([a.RGBAFormat,a.RGFormat,a.RedFormat]),Sn={[Ei]:a.RGBAFormat,[mi]:a.RGBAFormat,[di]:a.RGBAFormat,[pi]:a.RGBAFormat,[bi]:a.RGFormat,[fi]:a.RGFormat,[hi]:a.RGFormat,[ui]:a.RGFormat,[Ii]:a.RedFormat,[gi]:a.RedFormat,[li]:a.RedFormat,[ci]:a.RedFormat,[yi]:a.RGBA_ASTC_4x4_Format,[Bi]:a.RGBA_ASTC_6x6_Format,[Ci]:a.RGBA_ASTC_6x6_Format},Tn={[Ei]:a.FloatType,[mi]:a.HalfFloatType,[di]:a.UnsignedByteType,[pi]:a.UnsignedByteType,[bi]:a.FloatType,[fi]:a.HalfFloatType,[hi]:a.UnsignedByteType,[ui]:a.UnsignedByteType,[Ii]:a.FloatType,[gi]:a.HalfFloatType,[li]:a.UnsignedByteType,[ci]:a.UnsignedByteType,[yi]:a.HalfFloatType,[Bi]:a.UnsignedByteType,[Ci]:a.UnsignedByteType};async function wr(c){const{vkFormat:e}=c;if(Sn[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;c.supercompressionScheme===bs&&(xn||(xn=new Promise(async i=>{const o=new Br;await o.init(),i(o)})),t=await xn);const s=[];for(let i=0;i<c.levels.length;i++){const o=Math.max(1,c.pixelWidth>>i),r=Math.max(1,c.pixelHeight>>i),A=c.pixelDepth?Math.max(1,c.pixelDepth>>i):0,l=c.levels[i];let h;if(c.supercompressionScheme===pr)h=l.levelData;else if(c.supercompressionScheme===bs)h=t.decode(l.levelData,l.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let u;Tn[e]===a.FloatType?u=new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):Tn[e]===a.HalfFloatType?u=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):u=h,s.push({data:u,width:o,height:r,depth:A})}let n;if(yr.has(Sn[e]))n=c.pixelDepth===0?new a.DataTexture(s[0].data,c.pixelWidth,c.pixelHeight):new a.Data3DTexture(s[0].data,c.pixelWidth,c.pixelHeight,c.pixelDepth);else{if(c.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");n=new a.CompressedTexture(s,c.pixelWidth,c.pixelHeight)}return n.mipmaps=s,n.type=Tn[e],n.format=Sn[e],n.colorSpace=wi(c),n.needsUpdate=!0,Promise.resolve(n)}function wi(c){const e=c.dataFormatDescriptor[0];return e.colorPrimaries===mr?e.transferFunction===Es?a.SRGBColorSpace:a.LinearSRGBColorSpace:e.colorPrimaries===Ir?e.transferFunction===Es?a.DisplayP3ColorSpace:a.LinearDisplayP3ColorSpace:(e.colorPrimaries===fr||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),a.NoColorSpace)}class Qr extends a.ExtrudeGeometry{constructor(e,t={}){const s=t.font;if(s===void 0)super();else{const n=s.generateShapes(e,t.size);t.depth===void 0&&t.height!==void 0&&console.warn("THREE.TextGeometry: .height is now depreciated. Please use .depth instead"),t.depth=t.depth!==void 0?t.depth:t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(n,t)}this.type="TextGeometry"}}class xr extends a.Loader{constructor(e){super(e)}load(e,t,s,n){const i=this,o=new a.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(r){const A=i.parse(JSON.parse(r));t&&t(A)},s,n)}parse(e){return new Qi(e)}}class Qi{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const s=[],n=Sr(e,t,this.data);for(let i=0,o=n.length;i<o;i++)s.push(...n[i].toShapes());return s}}function Sr(c,e,t){const s=Array.from(c),n=e/t.resolution,i=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*n,o=[];let r=0,A=0;for(let l=0;l<s.length;l++){const h=s[l];if(h===`
36
- `)r=0,A-=i;else{const u=Tr(h,n,r,A,t);r+=u.offsetX,o.push(u.path)}}return o}function Tr(c,e,t,s,n){const i=n.glyphs[c]||n.glyphs["?"];if(!i){console.error('THREE.Font: character "'+c+'" does not exists in font family '+n.familyName+".");return}const o=new a.ShapePath;let r,A,l,h,u,p,g,f;if(i.o){const I=i._cachedOutline||(i._cachedOutline=i.o.split(" "));for(let b=0,E=I.length;b<E;)switch(I[b++]){case"m":r=I[b++]*e+t,A=I[b++]*e+s,o.moveTo(r,A);break;case"l":r=I[b++]*e+t,A=I[b++]*e+s,o.lineTo(r,A);break;case"q":l=I[b++]*e+t,h=I[b++]*e+s,u=I[b++]*e+t,p=I[b++]*e+s,o.quadraticCurveTo(u,p,l,h);break;case"b":l=I[b++]*e+t,h=I[b++]*e+s,u=I[b++]*e+t,p=I[b++]*e+s,g=I[b++]*e+t,f=I[b++]*e+s,o.bezierCurveTo(u,p,g,f,l,h);break}}return{offsetX:i.ha*e,path:o}}const Ct=new a.Raycaster,Fe=new a.Vector3,gt=new a.Vector3,Ee=new a.Quaternion,ys={X:new a.Vector3(1,0,0),Y:new a.Vector3(0,1,0),Z:new a.Vector3(0,0,1)},vn={type:"change"},ws={type:"mouseDown",mode:null},Qs={type:"mouseUp",mode:null},xs={type:"objectChange"};class vr extends a.Controls{constructor(e,t=null){super(void 0,t);const s=new Lr(this);this._root=s;const n=new xi;this._gizmo=n,s.add(n);const i=new kr;this._plane=i,s.add(i);const o=this;function r(C,w){let x=w;Object.defineProperty(o,C,{get:function(){return x!==void 0?x:w},set:function(R){x!==R&&(x=R,i[C]=R,n[C]=R,o.dispatchEvent({type:C+"-changed",value:R}),o.dispatchEvent(vn))}}),o[C]=w,i[C]=w,n[C]=w}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const A=new a.Vector3,l=new a.Vector3,h=new a.Quaternion,u=new a.Quaternion,p=new a.Vector3,g=new a.Quaternion,f=new a.Vector3,I=new a.Vector3,b=new a.Vector3,E=0,y=new a.Vector3;r("worldPosition",A),r("worldPositionStart",l),r("worldQuaternion",h),r("worldQuaternionStart",u),r("cameraPosition",p),r("cameraQuaternion",g),r("pointStart",f),r("pointEnd",I),r("rotationAxis",b),r("rotationAngle",E),r("eye",y),this._offset=new a.Vector3,this._startNorm=new a.Vector3,this._endNorm=new a.Vector3,this._cameraScale=new a.Vector3,this._parentPosition=new a.Vector3,this._parentQuaternion=new a.Quaternion,this._parentQuaternionInv=new a.Quaternion,this._parentScale=new a.Vector3,this._worldScaleStart=new a.Vector3,this._worldQuaternionInv=new a.Quaternion,this._worldScale=new a.Vector3,this._positionStart=new a.Vector3,this._quaternionStart=new a.Quaternion,this._scaleStart=new a.Vector3,this._getPointer=Mr.bind(this),this._onPointerDown=Dr.bind(this),this._onPointerHover=Rr.bind(this),this._onPointerMove=_r.bind(this),this._onPointerUp=Fr.bind(this),t!==null&&this.connect()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&Ct.setFromCamera(e,this.camera);const t=Mn(this._gizmo.picker[this.mode],Ct);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&Ct.setFromCamera(e,this.camera);const t=Mn(this._plane,Ct,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,ws.mode=this.mode,this.dispatchEvent(ws)}}pointerMove(e){const t=this.axis,s=this.mode,n=this.object;let i=this.space;if(s==="scale"?i="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(i="world"),n===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&Ct.setFromCamera(e,this.camera);const o=Mn(this._plane,Ct,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),i==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),i==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),n.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i==="local"&&(n.position.applyQuaternion(Ee.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.position.applyQuaternion(this._quaternionStart)),i==="world"&&(n.parent&&n.position.add(Fe.setFromMatrixPosition(n.parent.matrixWorld)),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.parent&&n.position.sub(Fe.setFromMatrixPosition(n.parent.matrixWorld))));else if(s==="scale"){if(t.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),gt.set(r,r,r)}else Fe.copy(this.pointStart),gt.copy(this.pointEnd),Fe.applyQuaternion(this._worldQuaternionInv),gt.applyQuaternion(this._worldQuaternionInv),gt.divide(Fe),t.search("X")===-1&&(gt.x=1),t.search("Y")===-1&&(gt.y=1),t.search("Z")===-1&&(gt.z=1);n.scale.copy(this._scaleStart).multiply(gt),this.scaleSnap&&(t.search("X")!==-1&&(n.scale.x=Math.round(n.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(n.scale.y=Math.round(n.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(n.scale.z=Math.round(n.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(Fe.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Fe.copy(this.rotationAxis).cross(this.eye))*r):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(ys[t]),Fe.copy(ys[t]),i==="local"&&Fe.applyQuaternion(this.worldQuaternion),Fe.cross(this.eye),Fe.length()===0?A=!0:this.rotationAngle=this._offset.dot(Fe.normalize())*r),(t==="E"||A)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i==="local"&&t!=="E"&&t!=="XYZE"?(n.quaternion.copy(this._quaternionStart),n.quaternion.multiply(Ee.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),n.quaternion.copy(Ee.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),n.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(vn),this.dispatchEvent(xs)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Qs.mode=this.mode,this.dispatchEvent(Qs)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(vn),this.dispatchEvent(xs),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Ct}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function Mr(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const e=this.domElement.getBoundingClientRect();return{x:(c.clientX-e.left)/e.width*2-1,y:-(c.clientY-e.top)/e.height*2+1,button:c.button}}}function Rr(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function Dr(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function _r(c){this.enabled&&this.pointerMove(this._getPointer(c))}function Fr(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function Mn(c,e,t){const s=e.intersectObject(c,!0);for(let n=0;n<s.length;n++)if(s[n].object.visible||t)return s[n];return!1}const tn=new a.Euler,pe=new a.Vector3(0,1,0),Ss=new a.Vector3(0,0,0),Ts=new a.Matrix4,nn=new a.Quaternion,un=new a.Quaternion,et=new a.Vector3,vs=new a.Matrix4,Kt=new a.Vector3(1,0,0),wt=new a.Vector3(0,1,0),Yt=new a.Vector3(0,0,1),sn=new a.Vector3,Ut=new a.Vector3,Pt=new a.Vector3;class Lr extends a.Object3D{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){const t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),super.updateMatrixWorld(e)}}class xi extends a.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new a.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new a.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),s=e.clone();s.opacity=.15;const n=t.clone();n.opacity=.5;const i=e.clone();i.color.setHex(16711680);const o=e.clone();o.color.setHex(65280);const r=e.clone();r.color.setHex(255);const A=e.clone();A.color.setHex(16711680),A.opacity=.5;const l=e.clone();l.color.setHex(65280),l.opacity=.5;const h=e.clone();h.color.setHex(255),h.opacity=.5;const u=e.clone();u.opacity=.25;const p=e.clone();p.color.setHex(16776960),p.opacity=.25,e.clone().color.setHex(16776960);const f=e.clone();f.color.setHex(7895160);const I=new a.CylinderGeometry(0,.04,.1,12);I.translate(0,.05,0);const b=new a.BoxGeometry(.08,.08,.08);b.translate(0,.04,0);const E=new a.BufferGeometry;E.setAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));const y=new a.CylinderGeometry(.0075,.0075,.5,3);y.translate(0,.25,0);function C(q,H){const z=new a.TorusGeometry(q,.0075,3,64,H*Math.PI*2);return z.rotateY(Math.PI/2),z.rotateX(Math.PI/2),z}function w(){const q=new a.BufferGeometry;return q.setAttribute("position",new a.Float32BufferAttribute([0,0,0,1,1,1],3)),q}const x={X:[[new a.Mesh(I,i),[.5,0,0],[0,0,-Math.PI/2]],[new a.Mesh(I,i),[-.5,0,0],[0,0,Math.PI/2]],[new a.Mesh(y,i),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(I,o),[0,.5,0]],[new a.Mesh(I,o),[0,-.5,0],[Math.PI,0,0]],[new a.Mesh(y,o)]],Z:[[new a.Mesh(I,r),[0,0,.5],[Math.PI/2,0,0]],[new a.Mesh(I,r),[0,0,-.5],[-Math.PI/2,0,0]],[new a.Mesh(y,r),null,[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),u.clone()),[0,0,0]]],XY:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),h.clone()),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),A.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},R={X:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,.3,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),s)]],XY:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]]},D={START:[[new a.Mesh(new a.OctahedronGeometry(.01,2),n),null,null,null,"helper"]],END:[[new a.Mesh(new a.OctahedronGeometry(.01,2),n),null,null,null,"helper"]],DELTA:[[new a.Line(w(),n),null,null,null,"helper"]],X:[[new a.Line(E,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a.Line(E,n.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a.Line(E,n.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},S={XYZE:[[new a.Mesh(C(.5,1),f),null,[0,Math.PI/2,0]]],X:[[new a.Mesh(C(.5,.5),i)]],Y:[[new a.Mesh(C(.5,.5),o),null,[0,0,-Math.PI/2]]],Z:[[new a.Mesh(C(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new a.Mesh(C(.75,1),p),null,[0,Math.PI/2,0]]]},v={AXIS:[[new a.Line(E,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},N={XYZE:[[new a.Mesh(new a.SphereGeometry(.25,10,8),s)]],X:[[new a.Mesh(new a.TorusGeometry(.5,.1,4,24),s),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusGeometry(.5,.1,4,24),s),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusGeometry(.5,.1,4,24),s),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusGeometry(.75,.1,2,24),s)]]},G={X:[[new a.Mesh(b,i),[.5,0,0],[0,0,-Math.PI/2]],[new a.Mesh(y,i),[0,0,0],[0,0,-Math.PI/2]],[new a.Mesh(b,i),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new a.Mesh(b,o),[0,.5,0]],[new a.Mesh(y,o)],[new a.Mesh(b,o),[0,-.5,0],[0,0,Math.PI]]],Z:[[new a.Mesh(b,r),[0,0,.5],[Math.PI/2,0,0]],[new a.Mesh(y,r),[0,0,0],[Math.PI/2,0,0]],[new a.Mesh(b,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxGeometry(.1,.1,.1),u.clone())]]},O={X:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,.3,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.2),s),[0,0,0]]]},X={X:[[new a.Line(E,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a.Line(E,n.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a.Line(E,n.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function U(q){const H=new a.Object3D;for(const z in q)for(let $=q[z].length;$--;){const ee=q[z][$][0].clone(),se=q[z][$][1],ce=q[z][$][2],re=q[z][$][3],le=q[z][$][4];ee.name=z,ee.tag=le,se&&ee.position.set(se[0],se[1],se[2]),ce&&ee.rotation.set(ce[0],ce[1],ce[2]),re&&ee.scale.set(re[0],re[1],re[2]),ee.updateMatrix();const Ce=ee.geometry.clone();Ce.applyMatrix4(ee.matrix),ee.geometry=Ce,ee.renderOrder=1/0,ee.position.set(0,0,0),ee.rotation.set(0,0,0),ee.scale.set(1,1,1),H.add(ee)}return H}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=U(x)),this.add(this.gizmo.rotate=U(S)),this.add(this.gizmo.scale=U(G)),this.add(this.picker.translate=U(R)),this.add(this.picker.rotate=U(N)),this.add(this.picker.scale=U(O)),this.add(this.helper.translate=U(D)),this.add(this.helper.rotate=U(v)),this.add(this.helper.scale=U(X)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const s=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:un;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let i=0;i<n.length;i++){const o=n[i];o.visible=!0,o.rotation.set(0,0,0),o.position.copy(this.worldPosition);let r;if(this.camera.isOrthographicCamera?r=(this.camera.top-this.camera.bottom)/this.camera.zoom:r=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),o.scale.set(1,1,1).multiplyScalar(r*this.size/4),o.tag==="helper"){o.visible=!1,o.name==="AXIS"?(o.visible=!!this.axis,this.axis==="X"&&(Ee.setFromEuler(tn.set(0,0,0)),o.quaternion.copy(s).multiply(Ee),Math.abs(pe.copy(Kt).applyQuaternion(s).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Y"&&(Ee.setFromEuler(tn.set(0,0,Math.PI/2)),o.quaternion.copy(s).multiply(Ee),Math.abs(pe.copy(wt).applyQuaternion(s).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(Ee.setFromEuler(tn.set(0,Math.PI/2,0)),o.quaternion.copy(s).multiply(Ee),Math.abs(pe.copy(Yt).applyQuaternion(s).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(Ee.setFromEuler(tn.set(0,Math.PI/2,0)),pe.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(Ts.lookAt(Ss,pe,wt)),o.quaternion.multiply(Ee),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),Fe.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Fe.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(Fe),o.visible=this.dragging):(o.quaternion.copy(s),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(s),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(pe.copy(Kt).applyQuaternion(s).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(pe.copy(wt).applyQuaternion(s).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(pe.copy(Yt).applyQuaternion(s).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(pe.copy(Yt).applyQuaternion(s).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(pe.copy(Kt).applyQuaternion(s).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(pe.copy(wt).applyQuaternion(s).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(nn.copy(s),pe.copy(this.eye).applyQuaternion(Ee.copy(s).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(Ts.lookAt(this.eye,Ss,wt)),o.name==="X"&&(Ee.setFromAxisAngle(Kt,Math.atan2(-pe.y,pe.z)),Ee.multiplyQuaternions(nn,Ee),o.quaternion.copy(Ee)),o.name==="Y"&&(Ee.setFromAxisAngle(wt,Math.atan2(pe.x,pe.z)),Ee.multiplyQuaternions(nn,Ee),o.quaternion.copy(Ee)),o.name==="Z"&&(Ee.setFromAxisAngle(Yt,Math.atan2(pe.y,pe.x)),Ee.multiplyQuaternions(nn,Ee),o.quaternion.copy(Ee))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis||this.axis.split("").some(function(A){return o.name===A}))&&(o.material.color.setHex(16776960),o.material.opacity=1)}super.updateMatrixWorld(e)}}class kr extends a.Mesh{constructor(){super(new a.PlaneGeometry(1e5,1e5,2,2),new a.MeshBasicMaterial({visible:!1,wireframe:!0,side:a.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),sn.copy(Kt).applyQuaternion(t==="local"?this.worldQuaternion:un),Ut.copy(wt).applyQuaternion(t==="local"?this.worldQuaternion:un),Pt.copy(Yt).applyQuaternion(t==="local"?this.worldQuaternion:un),pe.copy(Ut),this.mode){case"translate":case"scale":switch(this.axis){case"X":pe.copy(this.eye).cross(sn),et.copy(sn).cross(pe);break;case"Y":pe.copy(this.eye).cross(Ut),et.copy(Ut).cross(pe);break;case"Z":pe.copy(this.eye).cross(Pt),et.copy(Pt).cross(pe);break;case"XY":et.copy(Pt);break;case"YZ":et.copy(sn);break;case"XZ":pe.copy(Pt),et.copy(Ut);break;case"XYZ":case"E":et.set(0,0,0);break}break;case"rotate":default:et.set(0,0,0)}et.length()===0?this.quaternion.copy(this.cameraQuaternion):(vs.lookAt(Fe.set(0,0,0),et,pe),this.quaternion.setFromRotationMatrix(vs)),super.updateMatrixWorld(e)}}/*!
33
+ `+this.flowCode[e])}}_addUniforms(){for(const e of a.defaultShaderStages)for(const t of this.uniforms[e])this.shader.uniforms[t.name]=t}_updateUniforms(){Ue.object=this.object,Ue.renderer=this.renderer,Ue.material=this.material,Ue.scene=this.scene;for(const e of this.updateNodes)Ue.updateNode(e)}}const ai=new WeakMap;a.Material.prototype.onBuild=function(c,e,t){const s=this;if(s.isNodeMaterial===!0){let n;try{n=new _o(c,t,e,s).build(),ai.set(s,n)}catch(i){console.error("Material.prototype.onBuild: ",i)}}};a.Material.prototype.onBeforeRender=function(c,e,t,s,n){const i=ai.get(this);if(i!==void 0){Ue.material=this,Ue.camera=t,Ue.object=n,Ue.renderer=c,Ue.scene=e,Ue.geometry=s;const o=i.updateNodes;if(o.length>0){c.state.useProgram(null);for(const r of o)Ue.updateNode(r)}}};var Xt=function(){var c=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(h){h.preventDefault(),s(++c%e.children.length)},!1);function t(h){return e.appendChild(h.dom),h}function s(h){for(var u=0;u<e.children.length;u++)e.children[u].style.display=u===h?"block":"none";c=h}var n=(performance||Date).now(),i=n,o=0,r=t(new Xt.Panel("FPS","#0ff","#002")),A=t(new Xt.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var l=t(new Xt.Panel("MB","#f08","#201"));return s(0),{REVISION:16,dom:e,addPanel:t,showPanel:s,begin:function(){n=(performance||Date).now()},end:function(){o++;var h=(performance||Date).now();if(A.update(h-n,200),h>=i+1e3&&(r.update(o*1e3/(h-i),100),i=h,o=0,l)){var u=performance.memory;l.update(u.usedJSHeapSize/1048576,u.jsHeapSizeLimit/1048576)}return h},update:function(){n=this.end()},domElement:e,setMode:s}};Xt.Panel=function(c,e,t){var s=1/0,n=0,i=Math.round,o=i(window.devicePixelRatio||1),r=80*o,A=48*o,l=3*o,h=2*o,u=3*o,d=15*o,g=74*o,f=30*o,I=document.createElement("canvas");I.width=r,I.height=A,I.style.cssText="width:80px;height:48px";var b=I.getContext("2d");return b.font="bold "+9*o+"px Helvetica,Arial,sans-serif",b.textBaseline="top",b.fillStyle=t,b.fillRect(0,0,r,A),b.fillStyle=e,b.fillText(c,l,h),b.fillRect(u,d,g,f),b.fillStyle=t,b.globalAlpha=.9,b.fillRect(u,d,g,f),{dom:I,update:function(C,w){s=Math.min(s,C),n=Math.max(n,C),b.fillStyle=t,b.globalAlpha=1,b.fillRect(0,0,r,d),b.fillStyle=e,b.fillText(i(C)+" "+c+" ("+i(s)+"-"+i(n)+")",l,h),b.drawImage(I,u+o,d,g-o,f,u,d,g-o,f),b.fillRect(u+g-o,d,o,f),b.fillStyle=t,b.globalAlpha=.9,b.fillRect(u+g-o,d,o,i((1-C/w)*f))}}};function Do(c,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},s=c.getIndex(),n=c.getAttribute("position"),i=s?s.count:n.count;let o=0;const r=Object.keys(c.attributes),A={},l={},h=[],u=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"];for(let w=0,E=r.length;w<E;w++){const y=r[w],Q=c.attributes[y];A[y]=new Q.constructor(new Q.array.constructor(Q.count*Q.itemSize),Q.itemSize,Q.normalized);const R=c.morphAttributes[y];R&&(l[y]||(l[y]=[]),R.forEach((_,S)=>{const v=new _.array.constructor(_.count*_.itemSize);l[y][S]=new _.constructor(v,_.itemSize,_.normalized)}))}const g=e*.5,f=Math.log10(1/e),I=Math.pow(10,f),b=g*I;for(let w=0;w<i;w++){const E=s?s.getX(w):w;let y="";for(let Q=0,R=r.length;Q<R;Q++){const _=r[Q],S=c.getAttribute(_),v=S.itemSize;for(let G=0;G<v;G++)y+=`${~~(S[u[G]](E)*I+b)},`}if(y in t)h.push(t[y]);else{for(let Q=0,R=r.length;Q<R;Q++){const _=r[Q],S=c.getAttribute(_),v=c.morphAttributes[_],G=S.itemSize,N=A[_],H=l[_];for(let X=0;X<G;X++){const U=u[X],K=d[X];if(N[K](o,S[U](E)),v)for(let O=0,Z=v.length;O<Z;O++)H[O][K](o,v[O][U](E))}}t[y]=o,h.push(o),o++}}const C=c.clone();for(const w in c.attributes){const E=A[w];if(C.setAttribute(w,new E.constructor(E.array.slice(0,o*E.itemSize),E.itemSize,E.normalized)),w in l)for(let y=0;y<l[w].length;y++){const Q=l[w][y];C.morphAttributes[w][y]=new Q.constructor(Q.array.slice(0,o*Q.itemSize),Q.itemSize,Q.normalized)}}return C.setIndex(h),C}function gs(c,e){if(e===a.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),c;if(e===a.TriangleFanDrawMode||e===a.TriangleStripDrawMode){let t=c.getIndex();if(t===null){const o=[],r=c.getAttribute("position");if(r!==void 0){for(let A=0;A<r.count;A++)o.push(A);c.setIndex(o),t=c.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),c}const s=t.count-2,n=[];if(e===a.TriangleFanDrawMode)for(let o=1;o<=s;o++)n.push(t.getX(0)),n.push(t.getX(o)),n.push(t.getX(o+1));else for(let o=0;o<s;o++)o%2===0?(n.push(t.getX(o)),n.push(t.getX(o+1)),n.push(t.getX(o+2))):(n.push(t.getX(o+2)),n.push(t.getX(o+1)),n.push(t.getX(o)));n.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const i=c.clone();return i.setIndex(n),i.clearGroups(),i}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),c}class es extends a.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new No(t)}),this.register(function(t){return new Uo(t)}),this.register(function(t){return new Vo(t)}),this.register(function(t){return new Jo(t)}),this.register(function(t){return new Wo(t)}),this.register(function(t){return new Oo(t)}),this.register(function(t){return new Ho(t)}),this.register(function(t){return new jo(t)}),this.register(function(t){return new qo(t)}),this.register(function(t){return new Go(t)}),this.register(function(t){return new zo(t)}),this.register(function(t){return new Po(t)}),this.register(function(t){return new Yo(t)}),this.register(function(t){return new Ko(t)}),this.register(function(t){return new Lo(t)}),this.register(function(t){return new Xo(t)}),this.register(function(t){return new Zo(t)})}load(e,t,s,n){const i=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const l=a.LoaderUtils.extractUrlBase(e);o=a.LoaderUtils.resolveURL(l,this.path)}else o=a.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const r=function(l){n?n(l):console.error(l),i.manager.itemError(e),i.manager.itemEnd(e)},A=new a.FileLoader(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(l){try{i.parse(l,o,function(h){t(h),i.manager.itemEnd(e)},r)}catch(h){r(h)}},s,r)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,n){let i,o;const r={},A={},l=new TextDecoder;if(typeof e=="string")try{i=JSON.parse(e)}catch(u){o=e,n&&n(u);return}else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===Ai){try{r[re.KHR_BINARY_GLTF]=new $o(e)}catch(d){n&&n(d);return}try{i=JSON.parse(r[re.KHR_BINARY_GLTF].content)}catch(d){o=r[re.KHR_BINARY_GLTF].content,n&&n(d);return}}else try{i=JSON.parse(l.decode(e))}catch(d){o=l.decode(e),n&&n(d);return}else i=e;if(i.asset===void 0||i.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=i,this.jsonErrorData=o;const h=new ur(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u<this.pluginCallbacks.length;u++){const d=this.pluginCallbacks[u](h);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),A[d.name]=d,r[d.name]=!0}if(i.extensionsUsed)for(let u=0;u<i.extensionsUsed.length;++u){const d=i.extensionsUsed[u],g=i.extensionsRequired||[];switch(d){case re.KHR_MATERIALS_UNLIT:r[d]=new ko;break;case re.KHR_DRACO_MESH_COMPRESSION:r[d]=new er(i,this.dracoLoader);break;case re.KHR_TEXTURE_TRANSFORM:r[d]=new tr;break;case re.KHR_MESH_QUANTIZATION:r[d]=new nr;break;default:g.indexOf(d)>=0&&A[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}h.setExtensions(r),h.setPlugins(A),h.parse(s,n)}parseAsync(e,t){const s=this;return new Promise(function(n,i){s.parse(e,t,n,i)})}}function Fo(){let c={};return{get:function(e){return c[e]},add:function(e,t){c[e]=t},remove:function(e){delete c[e]},removeAll:function(){c={}}}}const re={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Lo{constructor(e){this.parser=e,this.name=re.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,n=t.length;s<n;s++){const i=t[s];i.extensions&&i.extensions[this.name]&&i.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,i.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let n=t.cache.get(s);if(n)return n;const i=t.json,A=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let l;const h=new a.Color(16777215);A.color!==void 0&&h.setRGB(A.color[0],A.color[1],A.color[2],a.LinearSRGBColorSpace);const u=A.range!==void 0?A.range:0;switch(A.type){case"directional":l=new a.DirectionalLight(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new a.PointLight(h),l.distance=u;break;case"spot":l=new a.SpotLight(h),l.distance=u,A.spot=A.spot||{},A.spot.innerConeAngle=A.spot.innerConeAngle!==void 0?A.spot.innerConeAngle:0,A.spot.outerConeAngle=A.spot.outerConeAngle!==void 0?A.spot.outerConeAngle:Math.PI/4,l.angle=A.spot.outerConeAngle,l.penumbra=1-A.spot.innerConeAngle/A.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+A.type)}return l.position.set(0,0,0),l.decay=2,lt(l,A),A.intensity!==void 0&&(l.intensity=A.intensity),l.name=t.createUniqueName(A.name||"light_"+e),n=Promise.resolve(l),t.cache.add(s,n),n}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,s=this.parser,i=s.json.nodes[e],r=(i.extensions&&i.extensions[this.name]||{}).light;return r===void 0?null:this._loadLight(r).then(function(A){return s._getNodeRef(t.cache,r,A)})}}let ko=class{constructor(){this.name=re.KHR_MATERIALS_UNLIT}getMaterialType(){return a.MeshBasicMaterial}extendParams(e,t,s){const n=[];e.color=new a.Color(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const o=i.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],a.LinearSRGBColorSpace),e.opacity=o[3]}i.baseColorTexture!==void 0&&n.push(s.assignTexture(e,"map",i.baseColorTexture,a.SRGBColorSpace))}return Promise.all(n)}},Go=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return i!==void 0&&(t.emissiveIntensity=i),Promise.resolve()}},No=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&i.push(s.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&i.push(s.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(i.push(s.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const r=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new a.Vector2(r,r)}return Promise.all(i)}},Uo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_DISPERSION}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.dispersion=i.dispersion!==void 0?i.dispersion:0,Promise.resolve()}},Po=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&i.push(s.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&i.push(s.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(i)}},Oo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_SHEEN}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new a.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=n.extensions[this.name];if(o.sheenColorFactor!==void 0){const r=o.sheenColorFactor;t.sheenColor.setRGB(r[0],r[1],r[2],a.LinearSRGBColorSpace)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&i.push(s.assignTexture(t,"sheenColorMap",o.sheenColorTexture,a.SRGBColorSpace)),o.sheenRoughnessTexture!==void 0&&i.push(s.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(i)}},Ho=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&i.push(s.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(i)}},jo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_VOLUME}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&i.push(s.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const r=o.attenuationColor||[1,1,1];return t.attenuationColor=new a.Color().setRGB(r[0],r[1],r[2],a.LinearSRGBColorSpace),Promise.all(i)}},qo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_IOR}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}},zo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_SPECULAR}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&i.push(s.assignTexture(t,"specularIntensityMap",o.specularTexture));const r=o.specularColorFactor||[1,1,1];return t.specularColor=new a.Color().setRGB(r[0],r[1],r[2],a.LinearSRGBColorSpace),o.specularColorTexture!==void 0&&i.push(s.assignTexture(t,"specularColorMap",o.specularColorTexture,a.SRGBColorSpace)),Promise.all(i)}},Ko=class{constructor(e){this.parser=e,this.name=re.EXT_MATERIALS_BUMP}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&i.push(s.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(i)}},Yo=class{constructor(e){this.parser=e,this.name=re.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const s=this.parser.json.materials[e];return!s.extensions||!s.extensions[this.name]?null:a.MeshPhysicalMaterial}extendMaterialParams(e,t){const s=this.parser,n=s.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=[],o=n.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&i.push(s.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(i)}};class Vo{constructor(e){this.parser=e,this.name=re.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,s=t.json,n=s.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const i=n.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(s.extensionsRequired&&s.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,o)}}class Jo{constructor(e){this.parser=e,this.name=re.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],r=n.images[o.source];let A=s.textureLoader;if(r.uri){const l=s.options.manager.getHandler(r.uri);l!==null&&(A=l)}return this.detectSupport().then(function(l){if(l)return s.loadTextureImage(e,o.source,A);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Wo{constructor(e){this.parser=e,this.name=re.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,n=s.json,i=n.textures[e];if(!i.extensions||!i.extensions[t])return null;const o=i.extensions[t],r=n.images[o.source];let A=s.textureLoader;if(r.uri){const l=s.options.manager.getHandler(r.uri);l!==null&&(A=l)}return this.detectSupport().then(function(l){if(l)return s.loadTextureImage(e,o.source,A);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Xo{constructor(e){this.name=re.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,s=t.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const n=s.extensions[this.name],i=this.parser.getDependency("buffer",n.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then(function(r){const A=n.byteOffset||0,l=n.byteLength||0,h=n.count,u=n.byteStride,d=new Uint8Array(r,A,l);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,u,d,n.mode,n.filter).then(function(g){return g.buffer}):o.ready.then(function(){const g=new ArrayBuffer(h*u);return o.decodeGltfBuffer(new Uint8Array(g),h,u,d,n.mode,n.filter),g})})}else return null}}let Zo=class{constructor(e){this.name=re.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,s=t.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const n=t.meshes[s.mesh];for(const l of n.primitives)if(l.mode!==Xe.TRIANGLES&&l.mode!==Xe.TRIANGLE_STRIP&&l.mode!==Xe.TRIANGLE_FAN&&l.mode!==void 0)return null;const o=s.extensions[this.name].attributes,r=[],A={};for(const l in o)r.push(this.parser.getDependency("accessor",o[l]).then(h=>(A[l]=h,A[l])));return r.length<1?null:(r.push(this.parser.createNodeMesh(e)),Promise.all(r).then(l=>{const h=l.pop(),u=h.isGroup?h.children:[h],d=l[0].count,g=[];for(const f of u){const I=new a.Matrix4,b=new a.Vector3,C=new a.Quaternion,w=new a.Vector3(1,1,1),E=new a.InstancedMesh(f.geometry,f.material,d);for(let y=0;y<d;y++)A.TRANSLATION&&b.fromBufferAttribute(A.TRANSLATION,y),A.ROTATION&&C.fromBufferAttribute(A.ROTATION,y),A.SCALE&&w.fromBufferAttribute(A.SCALE,y),E.setMatrixAt(y,I.compose(b,C,w));for(const y in A)if(y==="_COLOR_0"){const Q=A[y];E.instanceColor=new a.InstancedBufferAttribute(Q.array,Q.itemSize,Q.normalized)}else y!=="TRANSLATION"&&y!=="ROTATION"&&y!=="SCALE"&&f.geometry.setAttribute(y,A[y]);a.Object3D.prototype.copy.call(E,f),this.parser.assignFinalMaterial(E),g.push(E)}return h.isGroup?(h.clear(),h.add(...g),h):g[0]}))}};const Ai="glTF",Gt=12,fs={JSON:1313821514,BIN:5130562};class $o{constructor(e){this.name=re.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Gt),s=new TextDecoder;if(this.header={magic:s.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Ai)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-Gt,i=new DataView(e,Gt);let o=0;for(;o<n;){const r=i.getUint32(o,!0);o+=4;const A=i.getUint32(o,!0);if(o+=4,A===fs.JSON){const l=new Uint8Array(e,Gt+o,r);this.content=s.decode(l)}else if(A===fs.BIN){const l=Gt+o;this.body=e.slice(l,l+r)}o+=r}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class er{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=re.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const s=this.json,n=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,r={},A={},l={};for(const h in o){const u=qn[h]||h.toLowerCase();r[u]=o[h]}for(const h in e.attributes){const u=qn[h]||h.toLowerCase();if(o[h]!==void 0){const d=s.accessors[e.attributes[h]],g=Dt[d.componentType];l[u]=g.name,A[u]=d.normalized===!0}}return t.getDependency("bufferView",i).then(function(h){return new Promise(function(u,d){n.decodeDracoFile(h,function(g){for(const f in g.attributes){const I=g.attributes[f],b=A[f];b!==void 0&&(I.normalized=b)}u(g)},r,l,a.LinearSRGBColorSpace,d)})})}}class tr{constructor(){this.name=re.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class nr{constructor(){this.name=re.KHR_MESH_QUANTIZATION}}class ci extends a.Interpolant{constructor(e,t,s,n){super(e,t,s,n)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,n=this.valueSize,i=e*n*3+n;for(let o=0;o!==n;o++)t[o]=s[i+o];return t}interpolate_(e,t,s,n){const i=this.resultBuffer,o=this.sampleValues,r=this.valueSize,A=r*2,l=r*3,h=n-t,u=(s-t)/h,d=u*u,g=d*u,f=e*l,I=f-l,b=-2*g+3*d,C=g-d,w=1-b,E=C-d+u;for(let y=0;y!==r;y++){const Q=o[I+y+r],R=o[I+y+A]*h,_=o[f+y+r],S=o[f+y]*h;i[y]=w*Q+E*R+b*_+C*S}return i}}const sr=new a.Quaternion;class ir extends ci{interpolate_(e,t,s,n){const i=super.interpolate_(e,t,s,n);return sr.fromArray(i).normalize().toArray(i),i}}const Xe={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Dt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ms={9728:a.NearestFilter,9729:a.LinearFilter,9984:a.NearestMipmapNearestFilter,9985:a.LinearMipmapNearestFilter,9986:a.NearestMipmapLinearFilter,9987:a.LinearMipmapLinearFilter},Is={33071:a.ClampToEdgeWrapping,33648:a.MirroredRepeatWrapping,10497:a.RepeatWrapping},bn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},qn={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},pt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},or={CUBICSPLINE:void 0,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},En={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function rr(c){return c.DefaultMaterial===void 0&&(c.DefaultMaterial=new a.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:a.FrontSide})),c.DefaultMaterial}function Et(c,e,t){for(const s in t.extensions)c[s]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[s]=t.extensions[s])}function lt(c,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(c.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function ar(c,e,t){let s=!1,n=!1,i=!1;for(let l=0,h=e.length;l<h;l++){const u=e[l];if(u.POSITION!==void 0&&(s=!0),u.NORMAL!==void 0&&(n=!0),u.COLOR_0!==void 0&&(i=!0),s&&n&&i)break}if(!s&&!n&&!i)return Promise.resolve(c);const o=[],r=[],A=[];for(let l=0,h=e.length;l<h;l++){const u=e[l];if(s){const d=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):c.attributes.position;o.push(d)}if(n){const d=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):c.attributes.normal;r.push(d)}if(i){const d=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):c.attributes.color;A.push(d)}}return Promise.all([Promise.all(o),Promise.all(r),Promise.all(A)]).then(function(l){const h=l[0],u=l[1],d=l[2];return s&&(c.morphAttributes.position=h),n&&(c.morphAttributes.normal=u),i&&(c.morphAttributes.color=d),c.morphTargetsRelative=!0,c})}function Ar(c,e){if(c.updateMorphTargets(),e.weights!==void 0)for(let t=0,s=e.weights.length;t<s;t++)c.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(c.morphTargetInfluences.length===t.length){c.morphTargetDictionary={};for(let s=0,n=t.length;s<n;s++)c.morphTargetDictionary[t[s]]=s}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function cr(c){let e;const t=c.extensions&&c.extensions[re.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Cn(t.attributes):e=c.indices+":"+Cn(c.attributes)+":"+c.mode,c.targets!==void 0)for(let s=0,n=c.targets.length;s<n;s++)e+=":"+Cn(c.targets[s]);return e}function Cn(c){let e="";const t=Object.keys(c).sort();for(let s=0,n=t.length;s<n;s++)e+=t[s]+":"+c[t[s]]+";";return e}function zn(c){switch(c){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function lr(c){return c.search(/\.jpe?g($|\?)/i)>0||c.search(/^data\:image\/jpeg/)===0?"image/jpeg":c.search(/\.webp($|\?)/i)>0||c.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const hr=new a.Matrix4;class ur{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Fo,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,n=-1,i=!1,o=-1;if(typeof navigator<"u"){const r=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(r)===!0;const A=r.match(/Version\/(\d+)/);n=s&&A?parseInt(A[1],10):-1,i=r.indexOf("Firefox")>-1,o=i?r.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&n<17||i&&o<98?this.textureLoader=new a.TextureLoader(this.options.manager):this.textureLoader=new a.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const s=this,n=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const r={scene:o[0][n.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:n.asset,parser:s,userData:{}};return Et(i,r,n),lt(r,n),Promise.all(s._invokeAll(function(A){return A.afterRoot&&A.afterRoot(r)})).then(function(){for(const A of r.scenes)A.updateMatrixWorld();e(r)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],s=this.json.meshes||[];for(let n=0,i=t.length;n<i;n++){const o=t[n].joints;for(let r=0,A=o.length;r<A;r++)e[o[r]].isBone=!0}for(let n=0,i=e.length;n<i;n++){const o=e[n];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(s[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,s){if(e.refs[t]<=1)return s;const n=s.clone(),i=(o,r)=>{const A=this.associations.get(o);A!=null&&this.associations.set(r,A);for(const[l,h]of o.children.entries())i(h,r.children[l])};return i(s,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s<t.length;s++){const n=e(t[s]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const s=[];for(let n=0;n<t.length;n++){const i=e(t[n]);i&&s.push(i)}return s}getDependency(e,t){const s=e+":"+t;let n=this.cache.get(s);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(i){return i.loadNode&&i.loadNode(t)});break;case"mesh":n=this._invokeOne(function(i){return i.loadMesh&&i.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(i){return i.loadBufferView&&i.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(i){return i.loadMaterial&&i.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(i){return i.loadTexture&&i.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(i){return i.loadAnimation&&i.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne(function(i){return i!=this&&i.getDependency&&i.getDependency(e,t)}),!n)throw new Error("Unknown type: "+e);break}this.cache.add(s,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const s=this,n=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(n.map(function(i,o){return s.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],s=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[re.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(i,o){s.load(a.LoaderUtils.resolveURL(t.uri,n.path),i,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(s){const n=t.byteLength||0,i=t.byteOffset||0;return s.slice(i,i+n)})}loadAccessor(e){const t=this,s=this.json,n=this.json.accessors[e];if(n.bufferView===void 0&&n.sparse===void 0){const o=bn[n.type],r=Dt[n.componentType],A=n.normalized===!0,l=new r(n.count*o);return Promise.resolve(new a.BufferAttribute(l,o,A))}const i=[];return n.bufferView!==void 0?i.push(this.getDependency("bufferView",n.bufferView)):i.push(null),n.sparse!==void 0&&(i.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(i).then(function(o){const r=o[0],A=bn[n.type],l=Dt[n.componentType],h=l.BYTES_PER_ELEMENT,u=h*A,d=n.byteOffset||0,g=n.bufferView!==void 0?s.bufferViews[n.bufferView].byteStride:void 0,f=n.normalized===!0;let I,b;if(g&&g!==u){const C=Math.floor(d/g),w="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+C+":"+n.count;let E=t.cache.get(w);E||(I=new l(r,C*g,n.count*g/h),E=new a.InterleavedBuffer(I,g/h),t.cache.add(w,E)),b=new a.InterleavedBufferAttribute(E,A,d%g/h,f)}else r===null?I=new l(n.count*A):I=new l(r,d,n.count*A),b=new a.BufferAttribute(I,A,f);if(n.sparse!==void 0){const C=bn.SCALAR,w=Dt[n.sparse.indices.componentType],E=n.sparse.indices.byteOffset||0,y=n.sparse.values.byteOffset||0,Q=new w(o[1],E,n.sparse.count*C),R=new l(o[2],y,n.sparse.count*A);r!==null&&(b=new a.BufferAttribute(b.array.slice(),b.itemSize,b.normalized)),b.normalized=!1;for(let _=0,S=Q.length;_<S;_++){const v=Q[_];if(b.setX(v,R[_*A]),A>=2&&b.setY(v,R[_*A+1]),A>=3&&b.setZ(v,R[_*A+2]),A>=4&&b.setW(v,R[_*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}b.normalized=f}return b})}loadTexture(e){const t=this.json,s=this.options,i=t.textures[e].source,o=t.images[i];let r=this.textureLoader;if(o.uri){const A=s.manager.getHandler(o.uri);A!==null&&(r=A)}return this.loadTextureImage(e,i,r)}loadTextureImage(e,t,s){const n=this,i=this.json,o=i.textures[e],r=i.images[t],A=(r.uri||r.bufferView)+":"+o.sampler;if(this.textureCache[A])return this.textureCache[A];const l=this.loadImageSource(t,s).then(function(h){h.flipY=!1,h.name=o.name||r.name||"",h.name===""&&typeof r.uri=="string"&&r.uri.startsWith("data:image/")===!1&&(h.name=r.uri);const d=(i.samplers||{})[o.sampler]||{};return h.magFilter=ms[d.magFilter]||a.LinearFilter,h.minFilter=ms[d.minFilter]||a.LinearMipmapLinearFilter,h.wrapS=Is[d.wrapS]||a.RepeatWrapping,h.wrapT=Is[d.wrapT]||a.RepeatWrapping,h.anisotropy=4,n.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[A]=l,l}loadImageSource(e,t){const s=this,n=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const o=n.images[e],r=self.URL||self.webkitURL;let A=o.uri||"",l=!1;if(o.bufferView!==void 0)A=s.getDependency("bufferView",o.bufferView).then(function(u){l=!0;const d=new Blob([u],{type:o.mimeType});return A=r.createObjectURL(d),A});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(A).then(function(u){return new Promise(function(d,g){let f=d;t.isImageBitmapLoader===!0&&(f=function(I){const b=new a.Texture(I);b.needsUpdate=!0,d(b)}),t.load(a.LoaderUtils.resolveURL(u,i.path),f,void 0,g)})}).then(function(u){return l===!0&&r.revokeObjectURL(A),lt(u,o),u.userData.mimeType=o.mimeType||lr(o.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),u});return this.sourceCache[e]=h,h}assignTexture(e,t,s,n){const i=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),i.extensions[re.KHR_TEXTURE_TRANSFORM]){const r=s.extensions!==void 0?s.extensions[re.KHR_TEXTURE_TRANSFORM]:void 0;if(r){const A=i.associations.get(o);o=i.extensions[re.KHR_TEXTURE_TRANSFORM].extendTexture(o,r),i.associations.set(o,A)}}return n!==void 0&&(o.colorSpace=n),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const n=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const r="PointsMaterial:"+s.uuid;let A=this.cache.get(r);A||(A=new a.PointsMaterial,a.Material.prototype.copy.call(A,s),A.color.copy(s.color),A.map=s.map,A.sizeAttenuation=!1,this.cache.add(r,A)),s=A}else if(e.isLine){const r="LineBasicMaterial:"+s.uuid;let A=this.cache.get(r);A||(A=new a.LineBasicMaterial,a.Material.prototype.copy.call(A,s),A.color.copy(s.color),A.map=s.map,this.cache.add(r,A)),s=A}if(n||i||o){let r="ClonedMaterial:"+s.uuid+":";n&&(r+="derivative-tangents:"),i&&(r+="vertex-colors:"),o&&(r+="flat-shading:");let A=this.cache.get(r);A||(A=s.clone(),i&&(A.vertexColors=!0),o&&(A.flatShading=!0),n&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(r,A),this.associations.set(A,this.associations.get(s))),s=A}e.material=s}getMaterialType(){return a.MeshStandardMaterial}loadMaterial(e){const t=this,s=this.json,n=this.extensions,i=s.materials[e];let o;const r={},A=i.extensions||{},l=[];if(A[re.KHR_MATERIALS_UNLIT]){const u=n[re.KHR_MATERIALS_UNLIT];o=u.getMaterialType(),l.push(u.extendParams(r,i,t))}else{const u=i.pbrMetallicRoughness||{};if(r.color=new a.Color(1,1,1),r.opacity=1,Array.isArray(u.baseColorFactor)){const d=u.baseColorFactor;r.color.setRGB(d[0],d[1],d[2],a.LinearSRGBColorSpace),r.opacity=d[3]}u.baseColorTexture!==void 0&&l.push(t.assignTexture(r,"map",u.baseColorTexture,a.SRGBColorSpace)),r.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,r.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(l.push(t.assignTexture(r,"metalnessMap",u.metallicRoughnessTexture)),l.push(t.assignTexture(r,"roughnessMap",u.metallicRoughnessTexture))),o=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,r)})))}i.doubleSided===!0&&(r.side=a.DoubleSide);const h=i.alphaMode||En.OPAQUE;if(h===En.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,h===En.MASK&&(r.alphaTest=i.alphaCutoff!==void 0?i.alphaCutoff:.5)),i.normalTexture!==void 0&&o!==a.MeshBasicMaterial&&(l.push(t.assignTexture(r,"normalMap",i.normalTexture)),r.normalScale=new a.Vector2(1,1),i.normalTexture.scale!==void 0)){const u=i.normalTexture.scale;r.normalScale.set(u,u)}if(i.occlusionTexture!==void 0&&o!==a.MeshBasicMaterial&&(l.push(t.assignTexture(r,"aoMap",i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(r.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&o!==a.MeshBasicMaterial){const u=i.emissiveFactor;r.emissive=new a.Color().setRGB(u[0],u[1],u[2],a.LinearSRGBColorSpace)}return i.emissiveTexture!==void 0&&o!==a.MeshBasicMaterial&&l.push(t.assignTexture(r,"emissiveMap",i.emissiveTexture,a.SRGBColorSpace)),Promise.all(l).then(function(){const u=new o(r);return i.name&&(u.name=i.name),lt(u,i),t.associations.set(u,{materials:e}),i.extensions&&Et(n,u,i),u})}createUniqueName(e){const t=a.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,n=this.primitiveCache;function i(r){return s[re.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(r,t).then(function(A){return bs(A,r,t)})}const o=[];for(let r=0,A=e.length;r<A;r++){const l=e[r],h=cr(l),u=n[h];if(u)o.push(u.promise);else{let d;l.extensions&&l.extensions[re.KHR_DRACO_MESH_COMPRESSION]?d=i(l):d=bs(new a.BufferGeometry,l,t),n[h]={primitive:l,promise:d},o.push(d)}}return Promise.all(o)}loadMesh(e){const t=this,s=this.json,n=this.extensions,i=s.meshes[e],o=i.primitives,r=[];for(let A=0,l=o.length;A<l;A++){const h=o[A].material===void 0?rr(this.cache):this.getDependency("material",o[A].material);r.push(h)}return r.push(t.loadGeometries(o)),Promise.all(r).then(function(A){const l=A.slice(0,A.length-1),h=A[A.length-1],u=[];for(let g=0,f=h.length;g<f;g++){const I=h[g],b=o[g];let C;const w=l[g];if(b.mode===Xe.TRIANGLES||b.mode===Xe.TRIANGLE_STRIP||b.mode===Xe.TRIANGLE_FAN||b.mode===void 0)C=i.isSkinnedMesh===!0?new a.SkinnedMesh(I,w):new a.Mesh(I,w),C.isSkinnedMesh===!0&&C.normalizeSkinWeights(),b.mode===Xe.TRIANGLE_STRIP?C.geometry=gs(C.geometry,a.TriangleStripDrawMode):b.mode===Xe.TRIANGLE_FAN&&(C.geometry=gs(C.geometry,a.TriangleFanDrawMode));else if(b.mode===Xe.LINES)C=new a.LineSegments(I,w);else if(b.mode===Xe.LINE_STRIP)C=new a.Line(I,w);else if(b.mode===Xe.LINE_LOOP)C=new a.LineLoop(I,w);else if(b.mode===Xe.POINTS)C=new a.Points(I,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(C.geometry.morphAttributes).length>0&&Ar(C,i),C.name=t.createUniqueName(i.name||"mesh_"+e),lt(C,i),b.extensions&&Et(n,C,b),t.assignFinalMaterial(C),u.push(C)}for(let g=0,f=u.length;g<f;g++)t.associations.set(u[g],{meshes:e,primitives:g});if(u.length===1)return i.extensions&&Et(n,u[0],i),u[0];const d=new a.Group;i.extensions&&Et(n,d,i),t.associations.set(d,{meshes:e});for(let g=0,f=u.length;g<f;g++)d.add(u[g]);return d})}loadCamera(e){let t;const s=this.json.cameras[e],n=s[s.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return s.type==="perspective"?t=new a.PerspectiveCamera(a.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):s.type==="orthographic"&&(t=new a.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),lt(t,s),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],s=[];for(let n=0,i=t.joints.length;n<i;n++)s.push(this._loadNodeShallow(t.joints[n]));return t.inverseBindMatrices!==void 0?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(n){const i=n.pop(),o=n,r=[],A=[];for(let l=0,h=o.length;l<h;l++){const u=o[l];if(u){r.push(u);const d=new a.Matrix4;i!==null&&d.fromArray(i.array,l*16),A.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[l])}return new a.Skeleton(r,A)})}loadAnimation(e){const t=this.json,s=this,n=t.animations[e],i=n.name?n.name:"animation_"+e,o=[],r=[],A=[],l=[],h=[];let u=0,d=n.channels.length;for(u=0,d=n.channels.length;u<d;u++){const g=n.channels[u],f=n.samplers[g.sampler],I=g.target,b=I.node,C=n.parameters!==void 0?n.parameters[f.input]:f.input,w=n.parameters!==void 0?n.parameters[f.output]:f.output;I.node!==void 0&&(o.push(this.getDependency("node",b)),r.push(this.getDependency("accessor",C)),A.push(this.getDependency("accessor",w)),l.push(f),h.push(I))}return Promise.all([Promise.all(o),Promise.all(r),Promise.all(A),Promise.all(l),Promise.all(h)]).then(function(g){const f=g[0],I=g[1],b=g[2],C=g[3],w=g[4],E=[];for(u=0,d=f.length;u<d;u++){const y=f[u],Q=I[u],R=b[u],_=C[u],S=w[u];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const v=s._createAnimationTracks(y,Q,R,_,S);if(v)for(let G=0;G<v.length;G++)E.push(v[G])}return new a.AnimationClip(i,void 0,E)})}createNodeMesh(e){const t=this.json,s=this,n=t.nodes[e];return n.mesh===void 0?null:s.getDependency("mesh",n.mesh).then(function(i){const o=s._getNodeRef(s.meshCache,n.mesh,i);return n.weights!==void 0&&o.traverse(function(r){if(r.isMesh)for(let A=0,l=n.weights.length;A<l;A++)r.morphTargetInfluences[A]=n.weights[A]}),o})}loadNode(e){const t=this.json,s=this,n=t.nodes[e],i=s._loadNodeShallow(e),o=[],r=n.children||[];for(let l=0,h=r.length;l<h;l++)o.push(s.getDependency("node",r[l]));const A=n.skin===void 0?Promise.resolve(null):s.getDependency("skin",n.skin);return Promise.all([i,Promise.all(o),A]).then(function(l){const h=l[0],u=l[1],d=l[2];d!==null&&h.traverse(function(g){g.isSkinnedMesh&&g.bind(d,hr)});for(let g=0,f=u.length;g<f;g++)h.add(u[g]);return h})}_loadNodeShallow(e){const t=this.json,s=this.extensions,n=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const i=t.nodes[e],o=i.name?n.createUniqueName(i.name):"",r=[],A=n._invokeOne(function(l){return l.createNodeMesh&&l.createNodeMesh(e)});return A&&r.push(A),i.camera!==void 0&&r.push(n.getDependency("camera",i.camera).then(function(l){return n._getNodeRef(n.cameraCache,i.camera,l)})),n._invokeAll(function(l){return l.createNodeAttachment&&l.createNodeAttachment(e)}).forEach(function(l){r.push(l)}),this.nodeCache[e]=Promise.all(r).then(function(l){let h;if(i.isBone===!0?h=new a.Bone:l.length>1?h=new a.Group:l.length===1?h=l[0]:h=new a.Object3D,h!==l[0])for(let u=0,d=l.length;u<d;u++)h.add(l[u]);if(i.name&&(h.userData.name=i.name,h.name=o),lt(h,i),i.extensions&&Et(s,h,i),i.matrix!==void 0){const u=new a.Matrix4;u.fromArray(i.matrix),h.applyMatrix4(u)}else i.translation!==void 0&&h.position.fromArray(i.translation),i.rotation!==void 0&&h.quaternion.fromArray(i.rotation),i.scale!==void 0&&h.scale.fromArray(i.scale);return n.associations.has(h)||n.associations.set(h,{}),n.associations.get(h).nodes=e,h}),this.nodeCache[e]}loadScene(e){const t=this.extensions,s=this.json.scenes[e],n=this,i=new a.Group;s.name&&(i.name=n.createUniqueName(s.name)),lt(i,s),s.extensions&&Et(t,i,s);const o=s.nodes||[],r=[];for(let A=0,l=o.length;A<l;A++)r.push(n.getDependency("node",o[A]));return Promise.all(r).then(function(A){for(let h=0,u=A.length;h<u;h++)i.add(A[h]);const l=h=>{const u=new Map;for(const[d,g]of n.associations)(d instanceof a.Material||d instanceof a.Texture)&&u.set(d,g);return h.traverse(d=>{const g=n.associations.get(d);g!=null&&u.set(d,g)}),u};return n.associations=l(i),i})}_createAnimationTracks(e,t,s,n,i){const o=[],r=e.name?e.name:e.uuid,A=[];pt[i.path]===pt.weights?e.traverse(function(d){d.morphTargetInfluences&&A.push(d.name?d.name:d.uuid)}):A.push(r);let l;switch(pt[i.path]){case pt.weights:l=a.NumberKeyframeTrack;break;case pt.rotation:l=a.QuaternionKeyframeTrack;break;case pt.position:case pt.scale:l=a.VectorKeyframeTrack;break;default:switch(s.itemSize){case 1:l=a.NumberKeyframeTrack;break;case 2:case 3:default:l=a.VectorKeyframeTrack;break}break}const h=n.interpolation!==void 0?or[n.interpolation]:a.InterpolateLinear,u=this._getArrayFromAccessor(s);for(let d=0,g=A.length;d<g;d++){const f=new l(A[d]+"."+pt[i.path],t.array,u,h);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(f),o.push(f)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const s=zn(t.constructor),n=new Float32Array(t.length);for(let i=0,o=t.length;i<o;i++)n[i]=t[i]*s;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(s){const n=this instanceof a.QuaternionKeyframeTrack?ir:ci;return new n(this.times,this.values,this.getValueSize()/3,s)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function dr(c,e,t){const s=e.attributes,n=new a.Box3;if(s.POSITION!==void 0){const r=t.json.accessors[s.POSITION],A=r.min,l=r.max;if(A!==void 0&&l!==void 0){if(n.set(new a.Vector3(A[0],A[1],A[2]),new a.Vector3(l[0],l[1],l[2])),r.normalized){const h=zn(Dt[r.componentType]);n.min.multiplyScalar(h),n.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const i=e.targets;if(i!==void 0){const r=new a.Vector3,A=new a.Vector3;for(let l=0,h=i.length;l<h;l++){const u=i[l];if(u.POSITION!==void 0){const d=t.json.accessors[u.POSITION],g=d.min,f=d.max;if(g!==void 0&&f!==void 0){if(A.setX(Math.max(Math.abs(g[0]),Math.abs(f[0]))),A.setY(Math.max(Math.abs(g[1]),Math.abs(f[1]))),A.setZ(Math.max(Math.abs(g[2]),Math.abs(f[2]))),d.normalized){const I=zn(Dt[d.componentType]);A.multiplyScalar(I)}r.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(r)}c.boundingBox=n;const o=new a.Sphere;n.getCenter(o.center),o.radius=n.min.distanceTo(n.max)/2,c.boundingSphere=o}function bs(c,e,t){const s=e.attributes,n=[];function i(o,r){return t.getDependency("accessor",o).then(function(A){c.setAttribute(r,A)})}for(const o in s){const r=qn[o]||o.toLowerCase();r in c.attributes||n.push(i(s[o],r))}if(e.indices!==void 0&&!c.index){const o=t.getDependency("accessor",e.indices).then(function(r){c.setIndex(r)});n.push(o)}return a.ColorManagement.workingColorSpace!==a.LinearSRGBColorSpace&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${a.ColorManagement.workingColorSpace}" not supported.`),lt(c,e),dr(c,e,t),Promise.all(n).then(function(){return e.targets!==void 0?ar(c,e.targets,t):c})}var pr=(function(){var c="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgE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ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),s=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n=WebAssembly.validate(t)?e:c,i,o=WebAssembly.instantiate(r(n),{}).then(function(C){i=C.instance,i.exports.__wasm_call_ctors()});function r(C){for(var w=new Uint8Array(C.length),E=0;E<C.length;++E){var y=C.charCodeAt(E);w[E]=y>96?y-97:y>64?y-39:y+4}for(var Q=0,E=0;E<C.length;++E)w[Q++]=w[E]<60?s[w[E]]:(w[E]-60)*64+w[++E];return w.buffer.slice(0,Q)}function A(C,w,E,y,Q,R){var _=i.exports.sbrk,S=E+3&-4,v=_(S*y),G=_(Q.length),N=new Uint8Array(i.exports.memory.buffer);N.set(Q,G);var H=C(v,E,y,G,Q.length);if(H==0&&R&&R(v,S,y),w.set(N.subarray(v,v+E*y)),_(v-_(0)),H!=0)throw new Error("Malformed buffer data: "+H)}var l={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},u=[],d=0;function g(C){var w={object:new Worker(C),pending:0,requests:{}};return w.object.onmessage=function(E){var y=E.data;w.pending-=y.count,w.requests[y.id][y.action](y.value),delete w.requests[y.id]},w}function f(C){for(var w="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r(n))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+A.toString()+b.toString(),E=new Blob([w],{type:"text/javascript"}),y=URL.createObjectURL(E),Q=0;Q<C;++Q)u[Q]=g(y);URL.revokeObjectURL(y)}function I(C,w,E,y,Q){for(var R=u[0],_=1;_<u.length;++_)u[_].pending<R.pending&&(R=u[_]);return new Promise(function(S,v){var G=new Uint8Array(E),N=d++;R.pending+=C,R.requests[N]={resolve:S,reject:v},R.object.postMessage({id:N,count:C,size:w,source:G,mode:y,filter:Q},[G.buffer])})}function b(C){o.then(function(){var w=C.data;try{var E=new Uint8Array(w.count*w.size);A(i.exports[w.mode],E,w.count,w.size,w.source,i.exports[w.filter]),self.postMessage({id:w.id,count:w.count,action:"resolve",value:E},[E.buffer])}catch(y){self.postMessage({id:w.id,count:w.count,action:"reject",value:y})}})}return{ready:o,supported:!0,useWorkers:function(C){f(C)},decodeVertexBuffer:function(C,w,E,y,Q){A(i.exports.meshopt_decodeVertexBuffer,C,w,E,y,i.exports[l[Q]])},decodeIndexBuffer:function(C,w,E,y){A(i.exports.meshopt_decodeIndexBuffer,C,w,E,y)},decodeIndexSequence:function(C,w,E,y){A(i.exports.meshopt_decodeIndexSequence,C,w,E,y)},decodeGltfBuffer:function(C,w,E,y,Q,R){A(i.exports[h[Q]],C,w,E,y,i.exports[l[R]])},decodeGltfBufferAsync:function(C,w,E,y,Q){return u.length>0?I(C,w,E,h[y],l[Q]):o.then(function(){var R=new Uint8Array(C*w);return A(i.exports[h[y]],R,C,w,E,i.exports[l[Q]]),R})}}})();const Bn=new WeakMap;class gr extends a.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,s,n){const i=new a.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,o=>{this.parse(o,t,n)},s,n)}parse(e,t,s=()=>{}){this.decodeDracoFile(e,t,null,null,a.SRGBColorSpace,s).catch(s)}decodeDracoFile(e,t,s,n,i=a.LinearSRGBColorSpace,o=()=>{}){const r={attributeIDs:s||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!s,vertexColorSpace:i};return this.decodeGeometry(e,r).then(t).catch(o)}decodeGeometry(e,t){const s=JSON.stringify(t);if(Bn.has(e)){const A=Bn.get(e);if(A.key===s)return A.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const i=this.workerNextTaskID++,o=e.byteLength,r=this._getWorker(i,o).then(A=>(n=A,new Promise((l,h)=>{n._callbacks[i]={resolve:l,reject:h},n.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return r.catch(()=>!0).then(()=>{n&&i&&this._releaseTask(n,i)}),Bn.set(e,{key:s,promise:r}),r}_createGeometry(e){const t=new a.BufferGeometry;e.index&&t.setIndex(new a.BufferAttribute(e.index.array,1));for(let s=0;s<e.attributes.length;s++){const n=e.attributes[s],i=n.name,o=n.array,r=n.itemSize,A=new a.BufferAttribute(o,r);i==="color"&&(this._assignVertexColorSpace(A,n.vertexColorSpace),A.normalized=!(o instanceof Float32Array)),t.setAttribute(i,A)}return t}_assignVertexColorSpace(e,t){if(t!==a.SRGBColorSpace)return;const s=new a.Color;for(let n=0,i=e.count;n<i;n++)s.fromBufferAttribute(e,n),a.ColorManagement.toWorkingColorSpace(s,a.SRGBColorSpace),e.setXYZ(n,s.r,s.g,s.b)}_loadLibrary(e,t){const s=new a.FileLoader(this.manager);return s.setPath(this.decoderPath),s.setResponseType(t),s.setWithCredentials(this.withCredentials),new Promise((n,i)=>{s.load(e,n,void 0,i)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(s=>{const n=s[0];e||(this.decoderConfig.wasmBinary=s[1]);const i=fr.toString(),o=["/* draco decoder */",n,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join(`
34
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(i){const o=i.data;switch(o.type){case"decode":n._callbacks[o.id].resolve(o);break;case"error":n._callbacks[o.id].reject(o);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+o.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,i){return n._taskLoad>i._taskLoad?-1:1});const s=this.workerPool[this.workerPool.length-1];return s._taskCosts[e]=t,s._taskLoad+=t,s})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function fr(){let c,e;onmessage=function(o){const r=o.data;switch(r.type){case"init":c=r.decoderConfig,e=new Promise(function(h){c.onModuleLoaded=function(u){h({draco:u})},DracoDecoderModule(c)});break;case"decode":const A=r.buffer,l=r.taskConfig;e.then(h=>{const u=h.draco,d=new u.Decoder;try{const g=t(u,d,new Int8Array(A),l),f=g.attributes.map(I=>I.array.buffer);g.index&&f.push(g.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:g},f)}catch(g){console.error(g),self.postMessage({type:"error",id:r.id,error:g.message})}finally{u.destroy(d)}});break}};function t(o,r,A,l){const h=l.attributeIDs,u=l.attributeTypes;let d,g;const f=r.GetEncodedGeometryType(A);if(f===o.TRIANGULAR_MESH)d=new o.Mesh,g=r.DecodeArrayToMesh(A,A.byteLength,d);else if(f===o.POINT_CLOUD)d=new o.PointCloud,g=r.DecodeArrayToPointCloud(A,A.byteLength,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!g.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+g.error_msg());const I={index:null,attributes:[]};for(const b in h){const C=self[u[b]];let w,E;if(l.useUniqueIDs)E=h[b],w=r.GetAttributeByUniqueId(d,E);else{if(E=r.GetAttributeId(d,o[h[b]]),E===-1)continue;w=r.GetAttribute(d,E)}const y=n(o,r,d,b,C,w);b==="color"&&(y.vertexColorSpace=l.vertexColorSpace),I.attributes.push(y)}return f===o.TRIANGULAR_MESH&&(I.index=s(o,r,d)),o.destroy(d),I}function s(o,r,A){const h=A.num_faces()*3,u=h*4,d=o._malloc(u);r.GetTrianglesUInt32Array(A,u,d);const g=new Uint32Array(o.HEAPF32.buffer,d,h).slice();return o._free(d),{array:g,itemSize:1}}function n(o,r,A,l,h,u){const d=u.num_components(),f=A.num_points()*d,I=f*h.BYTES_PER_ELEMENT,b=i(o,h),C=o._malloc(I);r.GetAttributeDataArrayForAllPoints(A,u,b,I,C);const w=new h(o.HEAPF32.buffer,C,f).slice();return o._free(C),{name:l,array:w,itemSize:d}}function i(o,r){switch(r){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}class mr{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const s=this.workersResolve[e];if(s&&s(t),this.queue.length){const{resolve:n,msg:i,transfer:o}=this.queue.shift();this.workersResolve[e]=n,this.workers[e].postMessage(i,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(s=>{const n=this._getIdleWorker();n!==-1?(this._initWorker(n),this.workerStatus|=1<<n,this.workersResolve[n]=s,this.workers[n].postMessage(e,t)):this.queue.push({resolve:s,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const Ir=0,Es=2,br=1,Cs=2,Er=0,Cr=1,Br=10,yr=0,li=9,hi=15,ui=16,di=22,pi=37,gi=43,fi=76,mi=83,Ii=97,bi=100,Ei=103,Ci=109,Bi=122,yi=123,wr=131,Qr=132,xr=133,Sr=134,Tr=137,vr=138,Mr=141,Rr=142,_r=145,Dr=146,wi=148,Qi=152,Fr=157,Lr=158,xi=165,Si=166,ts=1000066e3;class Nt{constructor(e,t,s,n){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,s),this._littleEndian=n,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const t=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,t}_skip(e){return this._offset+=e,this}_scan(e,t=0){const s=this._offset;let n=0;for(;this._dataView.getUint8(this._offset)!==t&&n<e;)n++,this._offset++;return n<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+s,n)}}const Le=[171,75,84,88,32,50,48,187,13,10,26,10];function Bs(c){return new TextDecoder().decode(c)}function kr(c){const e=new Uint8Array(c.buffer,c.byteOffset,Le.length);if(e[0]!==Le[0]||e[1]!==Le[1]||e[2]!==Le[2]||e[3]!==Le[3]||e[4]!==Le[4]||e[5]!==Le[5]||e[6]!==Le[6]||e[7]!==Le[7]||e[8]!==Le[8]||e[9]!==Le[9]||e[10]!==Le[10]||e[11]!==Le[11])throw new Error("Missing KTX 2.0 identifier.");const t={vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null},s=17*Uint32Array.BYTES_PER_ELEMENT,n=new Nt(c,Le.length,s,!0);t.vkFormat=n._nextUint32(),t.typeSize=n._nextUint32(),t.pixelWidth=n._nextUint32(),t.pixelHeight=n._nextUint32(),t.pixelDepth=n._nextUint32(),t.layerCount=n._nextUint32(),t.faceCount=n._nextUint32(),t.levelCount=n._nextUint32(),t.supercompressionScheme=n._nextUint32();const i=n._nextUint32(),o=n._nextUint32(),r=n._nextUint32(),A=n._nextUint32(),l=n._nextUint64(),h=n._nextUint64(),u=3*Math.max(t.levelCount,1)*8,d=new Nt(c,Le.length+s,u,!0);for(let te=0,W=Math.max(t.levelCount,1);te<W;te++)t.levels.push({levelData:new Uint8Array(c.buffer,c.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const g=new Nt(c,i,o,!0);g._skip(4);const f=g._nextUint16(),I=g._nextUint16(),b=g._nextUint16(),C=g._nextUint16(),w={vendorId:f,descriptorType:I,versionNumber:b,colorModel:g._nextUint8(),colorPrimaries:g._nextUint8(),transferFunction:g._nextUint8(),flags:g._nextUint8(),texelBlockDimension:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],bytesPlane:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],samples:[]},E=(C/4-6)/4;for(let te=0;te<E;te++){const W={bitOffset:g._nextUint16(),bitLength:g._nextUint8(),channelType:g._nextUint8(),samplePosition:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&W.channelType?(W.sampleLower=g._nextInt32(),W.sampleUpper=g._nextInt32()):(W.sampleLower=g._nextUint32(),W.sampleUpper=g._nextUint32()),w.samples[te]=W}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(w);const y=new Nt(c,r,A,!0);for(;y._offset<A;){const te=y._nextUint32(),W=y._scan(te),se=Bs(W);if(t.keyValue[se]=y._nextUint8Array(te-W.byteLength-1),se.match(/^ktx/i)){const de=Bs(t.keyValue[se]);t.keyValue[se]=de.substring(0,de.lastIndexOf("\0"))}y._skip(te%4?4-te%4:0)}if(h<=0)return t;const Q=new Nt(c,l,h,!0),R=Q._nextUint16(),_=Q._nextUint16(),S=Q._nextUint32(),v=Q._nextUint32(),G=Q._nextUint32(),N=Q._nextUint32(),H=[];for(let te=0,W=Math.max(t.levelCount,1);te<W;te++)H.push({imageFlags:Q._nextUint32(),rgbSliceByteOffset:Q._nextUint32(),rgbSliceByteLength:Q._nextUint32(),alphaSliceByteOffset:Q._nextUint32(),alphaSliceByteLength:Q._nextUint32()});const X=l+Q._offset,U=X+S,K=U+v,O=K+G,Z=new Uint8Array(c.buffer,c.byteOffset+X,S),ie=new Uint8Array(c.buffer,c.byteOffset+U,v),ee=new Uint8Array(c.buffer,c.byteOffset+K,G),ce=new Uint8Array(c.buffer,c.byteOffset+O,N);return t.globalData={endpointCount:R,selectorCount:_,imageDescs:H,endpointsData:Z,selectorsData:ie,tablesData:ee,extendedData:ce},t}let yn,ct,Kn;const wn={env:{emscripten_notify_memory_growth:function(c){Kn=new Uint8Array(ct.exports.memory.buffer)}}};class Gr{init(){return yn||(yn=typeof fetch<"u"?fetch("data:application/wasm;base64,"+ys).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,wn)).then(this._init):WebAssembly.instantiate(Buffer.from(ys,"base64"),wn).then(this._init),yn)}_init(e){ct=e.instance,wn.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!ct)throw new Error("ZSTDDecoder: Await .init() before decoding.");const s=e.byteLength,n=ct.exports.malloc(s);Kn.set(e,n),t=t||Number(ct.exports.ZSTD_findDecompressedSize(n,s));const i=ct.exports.malloc(t),o=ct.exports.ZSTD_decompress(i,t,n,s),r=Kn.slice(i,i+o);return ct.exports.free(n),ct.exports.free(i),r}}const ys="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYC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QIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksN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AkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQF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IAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZ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//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Nr="display-p3",Ur="display-p3-linear",Qn=new WeakMap;let xn=0,Sn;class Ze extends a.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new mr,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),astcHDRSupported:!1,etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),astcHDRSupported:e.extensions.has("WEBGL_compressed_texture_astc")&&e.extensions.get("WEBGL_compressed_texture_astc").getSupportedProfiles().includes("hdr"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}init(){if(!this.transcoderPending){const e=new a.FileLoader(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),s=new a.FileLoader(this.manager);s.setPath(this.transcoderPath),s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials);const n=s.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,n]).then(([i,o])=>{const r=Ze.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(Ze.EngineFormat),"let _EngineType = "+JSON.stringify(Ze.EngineType),"let _TranscoderFormat = "+JSON.stringify(Ze.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Ze.BasisFormat),"/* basis_transcoder.js */",i,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
35
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{const l=new Worker(this.workerSourceURL),h=this.transcoderBinary.slice(0);return l.postMessage({type:"init",config:this.workerConfig,transcoderBinary:h},[h]),l})}),xn>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),xn++}return this.transcoderPending}load(e,t,s,n){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const i=new a.FileLoader(this.manager);i.setPath(this.path),i.setCrossOrigin(this.crossOrigin),i.setWithCredentials(this.withCredentials),i.setResponseType("arraybuffer"),i.load(e,o=>{this.parse(o,t,n)},s,n)}parse(e,t,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Qn.has(e))return Qn.get(e).promise.then(t).catch(s);this._createTexture(e).then(n=>t?t(n):null).catch(s)}_createTextureFrom(e,t){const{type:s,error:n,data:{faces:i,width:o,height:r,format:A,type:l,dfdFlags:h}}=e;if(s==="error")return Promise.reject(n);let u;if(t.faceCount===6)u=new a.CompressedCubeTexture(i,A,l);else{const d=i[0].mipmaps;u=t.layerCount>1?new a.CompressedArrayTexture(d,o,r,t.layerCount,A,l):new a.CompressedTexture(d,o,r,A,l)}return u.minFilter=i[0].mipmaps.length===1?a.LinearFilter:a.LinearMipmapLinearFilter,u.magFilter=a.LinearFilter,u.generateMipmaps=!1,u.needsUpdate=!0,u.colorSpace=Ti(t),u.premultiplyAlpha=!!(h&br),u}async _createTexture(e,t={}){const s=kr(new Uint8Array(e)),n=s.vkFormat===ts&&s.dataFormatDescriptor[0].colorModel===167;if(!(s.vkFormat===yr||n&&!this.workerConfig.astcHDRSupported))return Or(s);const o=t,r=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:o},[e])).then(A=>this._createTextureFrom(A.data,s));return Qn.set(e,{promise:r}),r}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),xn--}}Ze.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2};Ze.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16,BC6H:22,RGB_HALF:24,RGBA_HALF:25};Ze.EngineFormat={RGBAFormat:a.RGBAFormat,RGBA_ASTC_4x4_Format:a.RGBA_ASTC_4x4_Format,RGB_BPTC_UNSIGNED_Format:a.RGB_BPTC_UNSIGNED_Format,RGBA_BPTC_Format:a.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:a.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:a.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:a.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:a.RGB_ETC1_Format,RGB_ETC2_Format:a.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT1_Format:a.RGBA_S3TC_DXT1_Format};Ze.EngineType={UnsignedByteType:a.UnsignedByteType,HalfFloatType:a.HalfFloatType,FloatType:a.FloatType};Ze.BasisWorker=function(){let c,e,t;const s=_EngineFormat,n=_EngineType,i=_TranscoderFormat,o=_BasisFormat;self.addEventListener("message",function(f){const I=f.data;switch(I.type){case"init":c=I.config,r(I.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:b,buffers:C,width:w,height:E,hasAlpha:y,format:Q,type:R,dfdFlags:_}=A(I.buffer);self.postMessage({type:"transcode",id:I.id,data:{faces:b,width:w,height:E,hasAlpha:y,format:Q,type:R,dfdFlags:_}},C)}catch(b){console.error(b),self.postMessage({type:"error",id:I.id,error:b.message})}});break}});function r(f){e=new Promise(I=>{t={wasmBinary:f,onRuntimeInitialized:I},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(f){const I=new t.KTX2File(new Uint8Array(f));function b(){I.close(),I.delete()}if(!I.isValid())throw b(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let C;if(I.isUASTC())C=o.UASTC;else if(I.isETC1S())C=o.ETC1S;else if(I.isHDR())C=o.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const w=I.getWidth(),E=I.getHeight(),y=I.getLayers()||1,Q=I.getLevels(),R=I.getFaces(),_=I.getHasAlpha(),S=I.getDFDFlags(),{transcoderFormat:v,engineFormat:G,engineType:N}=u(C,w,E,_);if(!w||!E||!Q)throw b(),new Error("THREE.KTX2Loader: Invalid texture");if(!I.startTranscoding())throw b(),new Error("THREE.KTX2Loader: .startTranscoding failed");const H=[],X=[];for(let U=0;U<R;U++){const K=[];for(let O=0;O<Q;O++){const Z=[];let ie,ee;for(let te=0;te<y;te++){const W=I.getImageLevelInfo(O,te,U);U===0&&O===0&&te===0&&(W.origWidth%4!==0||W.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),Q>1?(ie=W.origWidth,ee=W.origHeight):(ie=W.width,ee=W.height);let se=new Uint8Array(I.getImageTranscodedSizeInBytes(O,te,0,v));const de=I.transcodeImage(se,O,te,U,v,0,-1,-1);if(N===n.HalfFloatType&&(se=new Uint16Array(se.buffer,se.byteOffset,se.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!de)throw b(),new Error("THREE.KTX2Loader: .transcodeImage failed.");Z.push(se)}const ce=g(Z);K.push({data:ce,width:ie,height:ee}),X.push(ce.buffer)}H.push({mipmaps:K,width:w,height:E,format:G,type:N})}return b(),{faces:H,buffers:X,width:w,height:E,hasAlpha:_,dfdFlags:S,format:G,type:N}}const l=[{if:"astcSupported",basisFormat:[o.UASTC],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[s.RGBA_ASTC_4x4_Format,s.RGBA_ASTC_4x4_Format],engineType:[n.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[s.RGBA_BPTC_Format,s.RGBA_BPTC_Format],engineType:[n.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.BC1,i.BC3],engineFormat:[s.RGBA_S3TC_DXT1_Format,s.RGBA_S3TC_DXT5_Format],engineType:[n.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[s.RGB_ETC2_Format,s.RGBA_ETC2_EAC_Format],engineType:[n.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.ETC1],engineFormat:[s.RGB_ETC1_Format],engineType:[n.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[s.RGB_PVRTC_4BPPV1_Format,s.RGBA_PVRTC_4BPPV1_Format],engineType:[n.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[o.UASTC_HDR],transcoderFormat:[i.BC6H],engineFormat:[s.RGB_BPTC_UNSIGNED_Format],engineType:[n.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[o.ETC1S,o.UASTC],transcoderFormat:[i.RGBA32,i.RGBA32],engineFormat:[s.RGBAFormat,s.RGBAFormat],engineType:[n.UnsignedByteType,n.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[o.UASTC_HDR],transcoderFormat:[i.RGBA_HALF],engineFormat:[s.RGBAFormat],engineType:[n.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],h={[o.ETC1S]:l.filter(f=>f.basisFormat.includes(o.ETC1S)).sort((f,I)=>f.priorityUASTC-I.priorityUASTC),[o.UASTC]:l.filter(f=>f.basisFormat.includes(o.UASTC)).sort((f,I)=>f.priorityUASTC-I.priorityUASTC),[o.UASTC_HDR]:l.filter(f=>f.basisFormat.includes(o.UASTC_HDR)).sort((f,I)=>f.priorityHDR-I.priorityHDR)};function u(f,I,b,C){const w=h[f];for(let E=0;E<w.length;E++){const y=w[E];if(y.if&&!c[y.if]||!y.basisFormat.includes(f)||C&&y.transcoderFormat.length<2||y.needsPowerOfTwo&&!(d(I)&&d(b)))continue;const Q=y.transcoderFormat[C?1:0],R=y.engineFormat[C?1:0],_=y.engineType[0];return{transcoderFormat:Q,engineFormat:R,engineType:_}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function d(f){return f<=2?!0:(f&f-1)===0&&f!==0}function g(f){if(f.length===1)return f[0];let I=0;for(let w=0;w<f.length;w++){const E=f[w];I+=E.byteLength}const b=new Uint8Array(I);let C=0;for(let w=0;w<f.length;w++){const E=f[w];b.set(E,C),C+=E.byteLength}return b}};const Pr=new Set([a.RGBAFormat,a.RGBFormat,a.RGFormat,a.RedFormat]),Tn={[Ci]:a.RGBAFormat,[Ii]:a.RGBAFormat,[pi]:a.RGBAFormat,[gi]:a.RGBAFormat,[Ei]:a.RGFormat,[mi]:a.RGFormat,[ui]:a.RGFormat,[di]:a.RGFormat,[bi]:a.RedFormat,[fi]:a.RedFormat,[hi]:a.RedFormat,[li]:a.RedFormat,[yi]:a.RGBFormat,[Bi]:a.RGBFormat,[wi]:a.RGB_ETC2_Format,[Qi]:a.RGBA_ETC2_EAC_Format,[ts]:a.RGBA_ASTC_4x4_Format,[Lr]:a.RGBA_ASTC_4x4_Format,[Fr]:a.RGBA_ASTC_4x4_Format,[Si]:a.RGBA_ASTC_6x6_Format,[xi]:a.RGBA_ASTC_6x6_Format,[xr]:a.RGBA_S3TC_DXT1_Format,[Sr]:a.RGBA_S3TC_DXT1_Format,[wr]:a.RGB_S3TC_DXT1_Format,[Qr]:a.RGB_S3TC_DXT1_Format,[vr]:a.RGBA_S3TC_DXT3_Format,[Tr]:a.RGBA_S3TC_DXT3_Format,[Rr]:a.RGBA_S3TC_DXT5_Format,[Mr]:a.RGBA_S3TC_DXT5_Format,[Dr]:a.RGBA_BPTC_Format,[_r]:a.RGBA_BPTC_Format},Ut={[Ci]:a.FloatType,[Ii]:a.HalfFloatType,[pi]:a.UnsignedByteType,[gi]:a.UnsignedByteType,[Ei]:a.FloatType,[mi]:a.HalfFloatType,[ui]:a.UnsignedByteType,[di]:a.UnsignedByteType,[bi]:a.FloatType,[fi]:a.HalfFloatType,[hi]:a.UnsignedByteType,[li]:a.UnsignedByteType,[yi]:a.UnsignedInt5999Type,[Bi]:a.UnsignedInt101111Type,[wi]:a.UnsignedByteType,[Qi]:a.UnsignedByteType,[ts]:a.HalfFloatType,[Si]:a.UnsignedByteType,[xi]:a.UnsignedByteType};async function Or(c){const{vkFormat:e}=c;if(Tn[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;c.supercompressionScheme===Es&&(Sn||(Sn=new Promise(async o=>{const r=new Gr;await r.init(),o(r)})),t=await Sn);const s=[];for(let o=0;o<c.levels.length;o++){const r=Math.max(1,c.pixelWidth>>o),A=Math.max(1,c.pixelHeight>>o),l=c.pixelDepth?Math.max(1,c.pixelDepth>>o):0,h=c.levels[o];let u;if(c.supercompressionScheme===Ir)u=h.levelData;else if(c.supercompressionScheme===Es)u=t.decode(h.levelData,h.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let d;Ut[e]===a.FloatType?d=new Float32Array(u.buffer,u.byteOffset,u.byteLength/Float32Array.BYTES_PER_ELEMENT):Ut[e]===a.HalfFloatType?d=new Uint16Array(u.buffer,u.byteOffset,u.byteLength/Uint16Array.BYTES_PER_ELEMENT):Ut[e]===a.UnsignedInt5999Type||Ut[e]===a.UnsignedInt101111Type?d=new Uint32Array(u.buffer,u.byteOffset,u.byteLength/Uint32Array.BYTES_PER_ELEMENT):d=u,s.push({data:d,width:r,height:A,depth:l})}const n=c.levelCount===0||s.length>1;let i;if(Pr.has(Tn[e]))i=c.pixelDepth===0?new a.DataTexture(s[0].data,c.pixelWidth,c.pixelHeight):new a.Data3DTexture(s[0].data,c.pixelWidth,c.pixelHeight,c.pixelDepth),i.minFilter=n?a.NearestMipmapNearestFilter:a.NearestFilter,i.magFilter=a.NearestFilter,i.generateMipmaps=c.levelCount===0;else{if(c.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");i=new a.CompressedTexture(s,c.pixelWidth,c.pixelHeight),i.minFilter=n?a.LinearMipmapLinearFilter:a.LinearFilter,i.magFilter=a.LinearFilter}return i.mipmaps=s,i.type=Ut[e],i.format=Tn[e],i.colorSpace=Ti(c),i.needsUpdate=!0,Promise.resolve(i)}function Ti(c){const e=c.dataFormatDescriptor[0];return e.colorPrimaries===Cr?e.transferFunction===Cs?a.SRGBColorSpace:a.LinearSRGBColorSpace:e.colorPrimaries===Br?e.transferFunction===Cs?Nr:Ur:(e.colorPrimaries===Er||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),a.NoColorSpace)}class Hr extends a.ExtrudeGeometry{constructor(e,t={}){const s=t.font;if(s===void 0)super();else{const n=s.generateShapes(e,t.size);t.depth===void 0&&t.height!==void 0&&console.warn("THREE.TextGeometry: .height is now depreciated. Please use .depth instead"),t.depth=t.depth!==void 0?t.depth:t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(n,t)}this.type="TextGeometry"}}class jr extends a.Loader{constructor(e){super(e)}load(e,t,s,n){const i=this,o=new a.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(r){const A=i.parse(JSON.parse(r));t&&t(A)},s,n)}parse(e){return new vi(e)}}class vi{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const s=[],n=qr(e,t,this.data);for(let i=0,o=n.length;i<o;i++)s.push(...n[i].toShapes());return s}}function qr(c,e,t){const s=Array.from(c),n=e/t.resolution,i=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*n,o=[];let r=0,A=0;for(let l=0;l<s.length;l++){const h=s[l];if(h===`
36
+ `)r=0,A-=i;else{const u=zr(h,n,r,A,t);r+=u.offsetX,o.push(u.path)}}return o}function zr(c,e,t,s,n){const i=n.glyphs[c]||n.glyphs["?"];if(!i){console.error('THREE.Font: character "'+c+'" does not exists in font family '+n.familyName+".");return}const o=new a.ShapePath;let r,A,l,h,u,d,g,f;if(i.o){const I=i._cachedOutline||(i._cachedOutline=i.o.split(" "));for(let b=0,C=I.length;b<C;)switch(I[b++]){case"m":r=I[b++]*e+t,A=I[b++]*e+s,o.moveTo(r,A);break;case"l":r=I[b++]*e+t,A=I[b++]*e+s,o.lineTo(r,A);break;case"q":l=I[b++]*e+t,h=I[b++]*e+s,u=I[b++]*e+t,d=I[b++]*e+s,o.quadraticCurveTo(u,d,l,h);break;case"b":l=I[b++]*e+t,h=I[b++]*e+s,u=I[b++]*e+t,d=I[b++]*e+s,g=I[b++]*e+t,f=I[b++]*e+s,o.bezierCurveTo(u,d,g,f,l,h);break}}return{offsetX:i.ha*e,path:o}}const Ct=new a.Raycaster,Fe=new a.Vector3,gt=new a.Vector3,Ce=new a.Quaternion,ws={X:new a.Vector3(1,0,0),Y:new a.Vector3(0,1,0),Z:new a.Vector3(0,0,1)},vn={type:"change"},Qs={type:"mouseDown",mode:null},xs={type:"mouseUp",mode:null},Ss={type:"objectChange"};class Kr extends a.Controls{constructor(e,t=null){super(void 0,t);const s=new Zr(this);this._root=s;const n=new Mi;this._gizmo=n,s.add(n);const i=new $r;this._plane=i,s.add(i);const o=this;function r(E,y){let Q=y;Object.defineProperty(o,E,{get:function(){return Q!==void 0?Q:y},set:function(R){Q!==R&&(Q=R,i[E]=R,n[E]=R,o.dispatchEvent({type:E+"-changed",value:R}),o.dispatchEvent(vn))}}),o[E]=y,i[E]=y,n[E]=y}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const A=new a.Vector3,l=new a.Vector3,h=new a.Quaternion,u=new a.Quaternion,d=new a.Vector3,g=new a.Quaternion,f=new a.Vector3,I=new a.Vector3,b=new a.Vector3,C=0,w=new a.Vector3;r("worldPosition",A),r("worldPositionStart",l),r("worldQuaternion",h),r("worldQuaternionStart",u),r("cameraPosition",d),r("cameraQuaternion",g),r("pointStart",f),r("pointEnd",I),r("rotationAxis",b),r("rotationAngle",C),r("eye",w),this._offset=new a.Vector3,this._startNorm=new a.Vector3,this._endNorm=new a.Vector3,this._cameraScale=new a.Vector3,this._parentPosition=new a.Vector3,this._parentQuaternion=new a.Quaternion,this._parentQuaternionInv=new a.Quaternion,this._parentScale=new a.Vector3,this._worldScaleStart=new a.Vector3,this._worldQuaternionInv=new a.Quaternion,this._worldScale=new a.Vector3,this._positionStart=new a.Vector3,this._quaternionStart=new a.Quaternion,this._scaleStart=new a.Vector3,this._getPointer=Yr.bind(this),this._onPointerDown=Jr.bind(this),this._onPointerHover=Vr.bind(this),this._onPointerMove=Wr.bind(this),this._onPointerUp=Xr.bind(this),t!==null&&this.connect()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&Ct.setFromCamera(e,this.camera);const t=Mn(this._gizmo.picker[this.mode],Ct);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&Ct.setFromCamera(e,this.camera);const t=Mn(this._plane,Ct,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Qs.mode=this.mode,this.dispatchEvent(Qs)}}pointerMove(e){const t=this.axis,s=this.mode,n=this.object;let i=this.space;if(s==="scale"?i="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(i="world"),n===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&Ct.setFromCamera(e,this.camera);const o=Mn(this._plane,Ct,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),i==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),i==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),n.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i==="local"&&(n.position.applyQuaternion(Ce.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.position.applyQuaternion(this._quaternionStart)),i==="world"&&(n.parent&&n.position.add(Fe.setFromMatrixPosition(n.parent.matrixWorld)),t.search("X")!==-1&&(n.position.x=Math.round(n.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(n.position.y=Math.round(n.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(n.position.z=Math.round(n.position.z/this.translationSnap)*this.translationSnap),n.parent&&n.position.sub(Fe.setFromMatrixPosition(n.parent.matrixWorld))));else if(s==="scale"){if(t.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),gt.set(r,r,r)}else Fe.copy(this.pointStart),gt.copy(this.pointEnd),Fe.applyQuaternion(this._worldQuaternionInv),gt.applyQuaternion(this._worldQuaternionInv),gt.divide(Fe),t.search("X")===-1&&(gt.x=1),t.search("Y")===-1&&(gt.y=1),t.search("Z")===-1&&(gt.z=1);n.scale.copy(this._scaleStart).multiply(gt),this.scaleSnap&&(t.search("X")!==-1&&(n.scale.x=Math.round(n.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(n.scale.y=Math.round(n.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(n.scale.z=Math.round(n.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(Fe.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Fe.copy(this.rotationAxis).cross(this.eye))*r):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(ws[t]),Fe.copy(ws[t]),i==="local"&&Fe.applyQuaternion(this.worldQuaternion),Fe.cross(this.eye),Fe.length()===0?A=!0:this.rotationAngle=this._offset.dot(Fe.normalize())*r),(t==="E"||A)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i==="local"&&t!=="E"&&t!=="XYZE"?(n.quaternion.copy(this._quaternionStart),n.quaternion.multiply(Ce.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),n.quaternion.copy(Ce.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),n.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(vn),this.dispatchEvent(Ss)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(xs.mode=this.mode,this.dispatchEvent(xs)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(vn),this.dispatchEvent(Ss),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Ct}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function Yr(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const e=this.domElement.getBoundingClientRect();return{x:(c.clientX-e.left)/e.width*2-1,y:-(c.clientY-e.top)/e.height*2+1,button:c.button}}}function Vr(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function Jr(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function Wr(c){this.enabled&&this.pointerMove(this._getPointer(c))}function Xr(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function Mn(c,e,t){const s=e.intersectObject(c,!0);for(let n=0;n<s.length;n++)if(s[n].object.visible||t)return s[n];return!1}const nn=new a.Euler,ge=new a.Vector3(0,1,0),Ts=new a.Vector3(0,0,0),vs=new a.Matrix4,sn=new a.Quaternion,dn=new a.Quaternion,tt=new a.Vector3,Ms=new a.Matrix4,Yt=new a.Vector3(1,0,0),wt=new a.Vector3(0,1,0),Vt=new a.Vector3(0,0,1),on=new a.Vector3,Pt=new a.Vector3,Ot=new a.Vector3;class Zr extends a.Object3D{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){const t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),super.updateMatrixWorld(e)}}class Mi extends a.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new a.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new a.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),s=e.clone();s.opacity=.15;const n=t.clone();n.opacity=.5;const i=e.clone();i.color.setHex(16711680);const o=e.clone();o.color.setHex(65280);const r=e.clone();r.color.setHex(255);const A=e.clone();A.color.setHex(16711680),A.opacity=.5;const l=e.clone();l.color.setHex(65280),l.opacity=.5;const h=e.clone();h.color.setHex(255),h.opacity=.5;const u=e.clone();u.opacity=.25;const d=e.clone();d.color.setHex(16776960),d.opacity=.25,e.clone().color.setHex(16776960);const f=e.clone();f.color.setHex(7895160);const I=new a.CylinderGeometry(0,.04,.1,12);I.translate(0,.05,0);const b=new a.BoxGeometry(.08,.08,.08);b.translate(0,.04,0);const C=new a.BufferGeometry;C.setAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));const w=new a.CylinderGeometry(.0075,.0075,.5,3);w.translate(0,.25,0);function E(K,O){const Z=new a.TorusGeometry(K,.0075,3,64,O*Math.PI*2);return Z.rotateY(Math.PI/2),Z.rotateX(Math.PI/2),Z}function y(){const K=new a.BufferGeometry;return K.setAttribute("position",new a.Float32BufferAttribute([0,0,0,1,1,1],3)),K}const Q={X:[[new a.Mesh(I,i),[.5,0,0],[0,0,-Math.PI/2]],[new a.Mesh(I,i),[-.5,0,0],[0,0,Math.PI/2]],[new a.Mesh(w,i),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(I,o),[0,.5,0]],[new a.Mesh(I,o),[0,-.5,0],[Math.PI,0,0]],[new a.Mesh(w,o)]],Z:[[new a.Mesh(I,r),[0,0,.5],[Math.PI/2,0,0]],[new a.Mesh(I,r),[0,0,-.5],[-Math.PI/2,0,0]],[new a.Mesh(w,r),null,[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),u.clone()),[0,0,0]]],XY:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),h.clone()),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),A.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},R={X:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,.3,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),s)]],XY:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]]},_={START:[[new a.Mesh(new a.OctahedronGeometry(.01,2),n),null,null,null,"helper"]],END:[[new a.Mesh(new a.OctahedronGeometry(.01,2),n),null,null,null,"helper"]],DELTA:[[new a.Line(y(),n),null,null,null,"helper"]],X:[[new a.Line(C,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a.Line(C,n.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a.Line(C,n.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},S={XYZE:[[new a.Mesh(E(.5,1),f),null,[0,Math.PI/2,0]]],X:[[new a.Mesh(E(.5,.5),i)]],Y:[[new a.Mesh(E(.5,.5),o),null,[0,0,-Math.PI/2]]],Z:[[new a.Mesh(E(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new a.Mesh(E(.75,1),d),null,[0,Math.PI/2,0]]]},v={AXIS:[[new a.Line(C,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},G={XYZE:[[new a.Mesh(new a.SphereGeometry(.25,10,8),s)]],X:[[new a.Mesh(new a.TorusGeometry(.5,.1,4,24),s),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusGeometry(.5,.1,4,24),s),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusGeometry(.5,.1,4,24),s),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusGeometry(.75,.1,2,24),s)]]},N={X:[[new a.Mesh(b,i),[.5,0,0],[0,0,-Math.PI/2]],[new a.Mesh(w,i),[0,0,0],[0,0,-Math.PI/2]],[new a.Mesh(b,i),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new a.Mesh(b,o),[0,.5,0]],[new a.Mesh(w,o)],[new a.Mesh(b,o),[0,-.5,0],[0,0,Math.PI]]],Z:[[new a.Mesh(b,r),[0,0,.5],[Math.PI/2,0,0]],[new a.Mesh(w,r),[0,0,0],[Math.PI/2,0,0]],[new a.Mesh(b,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxGeometry(.1,.1,.1),u.clone())]]},H={X:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,.3,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new a.Mesh(new a.CylinderGeometry(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxGeometry(.2,.2,.2),s),[0,0,0]]]},X={X:[[new a.Line(C,n.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new a.Line(C,n.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new a.Line(C,n.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function U(K){const O=new a.Object3D;for(const Z in K)for(let ie=K[Z].length;ie--;){const ee=K[Z][ie][0].clone(),ce=K[Z][ie][1],te=K[Z][ie][2],W=K[Z][ie][3],se=K[Z][ie][4];ee.name=Z,ee.tag=se,ce&&ee.position.set(ce[0],ce[1],ce[2]),te&&ee.rotation.set(te[0],te[1],te[2]),W&&ee.scale.set(W[0],W[1],W[2]),ee.updateMatrix();const de=ee.geometry.clone();de.applyMatrix4(ee.matrix),ee.geometry=de,ee.renderOrder=1/0,ee.position.set(0,0,0),ee.rotation.set(0,0,0),ee.scale.set(1,1,1),O.add(ee)}return O}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=U(Q)),this.add(this.gizmo.rotate=U(S)),this.add(this.gizmo.scale=U(N)),this.add(this.picker.translate=U(R)),this.add(this.picker.rotate=U(G)),this.add(this.picker.scale=U(H)),this.add(this.helper.translate=U(_)),this.add(this.helper.rotate=U(v)),this.add(this.helper.scale=U(X)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const s=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:dn;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let i=0;i<n.length;i++){const o=n[i];o.visible=!0,o.rotation.set(0,0,0),o.position.copy(this.worldPosition);let r;if(this.camera.isOrthographicCamera?r=(this.camera.top-this.camera.bottom)/this.camera.zoom:r=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),o.scale.set(1,1,1).multiplyScalar(r*this.size/4),o.tag==="helper"){o.visible=!1,o.name==="AXIS"?(o.visible=!!this.axis,this.axis==="X"&&(Ce.setFromEuler(nn.set(0,0,0)),o.quaternion.copy(s).multiply(Ce),Math.abs(ge.copy(Yt).applyQuaternion(s).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Y"&&(Ce.setFromEuler(nn.set(0,0,Math.PI/2)),o.quaternion.copy(s).multiply(Ce),Math.abs(ge.copy(wt).applyQuaternion(s).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(Ce.setFromEuler(nn.set(0,Math.PI/2,0)),o.quaternion.copy(s).multiply(Ce),Math.abs(ge.copy(Vt).applyQuaternion(s).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(Ce.setFromEuler(nn.set(0,Math.PI/2,0)),ge.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(vs.lookAt(Ts,ge,wt)),o.quaternion.multiply(Ce),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),Fe.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Fe.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(Fe),o.visible=this.dragging):(o.quaternion.copy(s),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(s),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(ge.copy(Yt).applyQuaternion(s).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(ge.copy(wt).applyQuaternion(s).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(ge.copy(Vt).applyQuaternion(s).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(ge.copy(Vt).applyQuaternion(s).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(ge.copy(Yt).applyQuaternion(s).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(ge.copy(wt).applyQuaternion(s).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(sn.copy(s),ge.copy(this.eye).applyQuaternion(Ce.copy(s).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(vs.lookAt(this.eye,Ts,wt)),o.name==="X"&&(Ce.setFromAxisAngle(Yt,Math.atan2(-ge.y,ge.z)),Ce.multiplyQuaternions(sn,Ce),o.quaternion.copy(Ce)),o.name==="Y"&&(Ce.setFromAxisAngle(wt,Math.atan2(ge.x,ge.z)),Ce.multiplyQuaternions(sn,Ce),o.quaternion.copy(Ce)),o.name==="Z"&&(Ce.setFromAxisAngle(Vt,Math.atan2(ge.y,ge.x)),Ce.multiplyQuaternions(sn,Ce),o.quaternion.copy(Ce))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis||this.axis.split("").some(function(A){return o.name===A}))&&(o.material.color.setHex(16776960),o.material.opacity=1)}super.updateMatrixWorld(e)}}class $r extends a.Mesh{constructor(){super(new a.PlaneGeometry(1e5,1e5,2,2),new a.MeshBasicMaterial({visible:!1,wireframe:!0,side:a.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),on.copy(Yt).applyQuaternion(t==="local"?this.worldQuaternion:dn),Pt.copy(wt).applyQuaternion(t==="local"?this.worldQuaternion:dn),Ot.copy(Vt).applyQuaternion(t==="local"?this.worldQuaternion:dn),ge.copy(Pt),this.mode){case"translate":case"scale":switch(this.axis){case"X":ge.copy(this.eye).cross(on),tt.copy(on).cross(ge);break;case"Y":ge.copy(this.eye).cross(Pt),tt.copy(Pt).cross(ge);break;case"Z":ge.copy(this.eye).cross(Ot),tt.copy(Ot).cross(ge);break;case"XY":tt.copy(Ot);break;case"YZ":tt.copy(on);break;case"XZ":ge.copy(Ot),tt.copy(Pt);break;case"XYZ":case"E":tt.set(0,0,0);break}break;case"rotate":default:tt.set(0,0,0)}tt.length()===0?this.quaternion.copy(this.cameraQuaternion):(Ms.lookAt(Fe.set(0,0,0),tt,ge),this.quaternion.setFromRotationMatrix(Ms)),super.updateMatrixWorld(e)}}/*!
37
37
  fflate - fast JavaScript compression/decompression
38
38
  <https://101arrowz.github.io/fflate>
39
39
  Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
40
40
  version 0.8.2
41
- */var Qe=Uint8Array,qe=Uint16Array,ts=Int32Array,pn=new Qe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),gn=new Qe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Yn=new Qe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Si=function(c,e){for(var t=new qe(31),s=0;s<31;++s)t[s]=e+=1<<c[s-1];for(var n=new ts(t[30]),s=1;s<30;++s)for(var i=t[s];i<t[s+1];++i)n[i]=i-t[s]<<5|s;return{b:t,r:n}},Ti=Si(pn,2),vi=Ti.b,Vn=Ti.r;vi[28]=258,Vn[258]=28;var Mi=Si(gn,0),Nr=Mi.b,Ms=Mi.r,Jn=new qe(32768);for(var be=0;be<32768;++be){var ft=(be&43690)>>1|(be&21845)<<1;ft=(ft&52428)>>2|(ft&13107)<<2,ft=(ft&61680)>>4|(ft&3855)<<4,Jn[be]=((ft&65280)>>8|(ft&255)<<8)>>1}var ot=(function(c,e,t){for(var s=c.length,n=0,i=new qe(e);n<s;++n)c[n]&&++i[c[n]-1];var o=new qe(e);for(n=1;n<e;++n)o[n]=o[n-1]+i[n-1]<<1;var r;if(t){r=new qe(1<<e);var A=15-e;for(n=0;n<s;++n)if(c[n])for(var l=n<<4|c[n],h=e-c[n],u=o[c[n]-1]++<<h,p=u|(1<<h)-1;u<=p;++u)r[Jn[u]>>A]=l}else for(r=new qe(s),n=0;n<s;++n)c[n]&&(r[n]=Jn[o[c[n]-1]++]>>15-c[n]);return r}),mt=new Qe(288);for(var be=0;be<144;++be)mt[be]=8;for(var be=144;be<256;++be)mt[be]=9;for(var be=256;be<280;++be)mt[be]=7;for(var be=280;be<288;++be)mt[be]=8;var Xt=new Qe(32);for(var be=0;be<32;++be)Xt[be]=5;var Gr=ot(mt,9,0),Ur=ot(mt,9,1),Pr=ot(Xt,5,0),Or=ot(Xt,5,1),Rn=function(c){for(var e=c[0],t=1;t<c.length;++t)c[t]>e&&(e=c[t]);return e},Ze=function(c,e,t){var s=e/8|0;return(c[s]|c[s+1]<<8)>>(e&7)&t},Dn=function(c,e){var t=e/8|0;return(c[t]|c[t+1]<<8|c[t+2]<<16)>>(e&7)},ns=function(c){return(c+7)/8|0},ss=function(c,e,t){return(t==null||t>c.length)&&(t=c.length),new Qe(c.subarray(e,t))},Hr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ge=function(c,e,t){var s=new Error(e||Hr[c]);if(s.code=c,Error.captureStackTrace&&Error.captureStackTrace(s,Ge),!t)throw s;return s},jr=function(c,e,t,s){var n=c.length,i=0;if(!n||e.f&&!e.l)return t||new Qe(0);var o=!t,r=o||e.i!=2,A=e.i;o&&(t=new Qe(n*3));var l=function(ht){var It=t.length;if(ht>It){var rt=new Qe(Math.max(It*2,ht));rt.set(t),t=rt}},h=e.f||0,u=e.p||0,p=e.b||0,g=e.l,f=e.d,I=e.m,b=e.n,E=n*8;do{if(!g){h=Ze(c,u,1);var y=Ze(c,u+1,3);if(u+=3,y)if(y==1)g=Ur,f=Or,I=9,b=5;else if(y==2){var R=Ze(c,u,31)+257,D=Ze(c,u+10,15)+4,S=R+Ze(c,u+5,31)+1;u+=14;for(var v=new Qe(S),N=new Qe(19),G=0;G<D;++G)N[Yn[G]]=Ze(c,u+G*3,7);u+=D*3;for(var O=Rn(N),X=(1<<O)-1,U=ot(N,O,1),G=0;G<S;){var q=U[Ze(c,u,X)];u+=q&15;var C=q>>4;if(C<16)v[G++]=C;else{var H=0,z=0;for(C==16?(z=3+Ze(c,u,3),u+=2,H=v[G-1]):C==17?(z=3+Ze(c,u,7),u+=3):C==18&&(z=11+Ze(c,u,127),u+=7);z--;)v[G++]=H}}var $=v.subarray(0,R),ee=v.subarray(R);I=Rn($),b=Rn(ee),g=ot($,I,1),f=ot(ee,b,1)}else Ge(1);else{var C=ns(u)+4,w=c[C-4]|c[C-3]<<8,x=C+w;if(x>n){A&&Ge(0);break}r&&l(p+w),t.set(c.subarray(C,x),p),e.b=p+=w,e.p=u=x*8,e.f=h;continue}if(u>E){A&&Ge(0);break}}r&&l(p+131072);for(var se=(1<<I)-1,ce=(1<<b)-1,re=u;;re=u){var H=g[Dn(c,u)&se],le=H>>4;if(u+=H&15,u>E){A&&Ge(0);break}if(H||Ge(2),le<256)t[p++]=le;else if(le==256){re=u,g=null;break}else{var Ce=le-254;if(le>264){var G=le-257,fe=pn[G];Ce=Ze(c,u,(1<<fe)-1)+vi[G],u+=fe}var ae=f[Dn(c,u)&ce],Pe=ae>>4;ae||Ge(3),u+=ae&15;var ee=Nr[Pe];if(Pe>3){var fe=gn[Pe];ee+=Dn(c,u)&(1<<fe)-1,u+=fe}if(u>E){A&&Ge(0);break}r&&l(p+131072);var Oe=p+Ce;if(p<ee){var xt=i-ee,St=Math.min(ee,Oe);for(xt+p<0&&Ge(3);p<St;++p)t[p]=s[xt+p]}for(;p<Oe;++p)t[p]=t[p-ee]}}e.l=g,e.p=re,e.b=p,e.f=h,g&&(h=1,e.m=I,e.d=f,e.n=b)}while(!h);return p!=t.length&&o?ss(t,0,p):t.subarray(0,p)},At=function(c,e,t){t<<=e&7;var s=e/8|0;c[s]|=t,c[s+1]|=t>>8},Ot=function(c,e,t){t<<=e&7;var s=e/8|0;c[s]|=t,c[s+1]|=t>>8,c[s+2]|=t>>16},_n=function(c,e){for(var t=[],s=0;s<c.length;++s)c[s]&&t.push({s,f:c[s]});var n=t.length,i=t.slice();if(!n)return{t:Di,l:0};if(n==1){var o=new Qe(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(x,R){return x.f-R.f}),t.push({s:-1,f:25001});var r=t[0],A=t[1],l=0,h=1,u=2;for(t[0]={s:-1,f:r.f+A.f,l:r,r:A};h!=n-1;)r=t[t[l].f<t[u].f?l++:u++],A=t[l!=h&&t[l].f<t[u].f?l++:u++],t[h++]={s:-1,f:r.f+A.f,l:r,r:A};for(var p=i[0].s,s=1;s<n;++s)i[s].s>p&&(p=i[s].s);var g=new qe(p+1),f=Wn(t[h-1],g,0);if(f>e){var s=0,I=0,b=f-e,E=1<<b;for(i.sort(function(R,D){return g[D.s]-g[R.s]||R.f-D.f});s<n;++s){var y=i[s].s;if(g[y]>e)I+=E-(1<<f-g[y]),g[y]=e;else break}for(I>>=b;I>0;){var C=i[s].s;g[C]<e?I-=1<<e-g[C]++-1:++s}for(;s>=0&&I;--s){var w=i[s].s;g[w]==e&&(--g[w],++I)}f=e}return{t:new Qe(g),l:f}},Wn=function(c,e,t){return c.s==-1?Math.max(Wn(c.l,e,t+1),Wn(c.r,e,t+1)):e[c.s]=t},Rs=function(c){for(var e=c.length;e&&!c[--e];);for(var t=new qe(++e),s=0,n=c[0],i=1,o=function(A){t[s++]=A},r=1;r<=e;++r)if(c[r]==n&&r!=e)++i;else{if(!n&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(n),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(n);i=1,n=c[r]}return{c:t.subarray(0,s),n:e}},Ht=function(c,e){for(var t=0,s=0;s<e.length;++s)t+=c[s]*e[s];return t},Ri=function(c,e,t){var s=t.length,n=ns(e+2);c[n]=s&255,c[n+1]=s>>8,c[n+2]=c[n]^255,c[n+3]=c[n+1]^255;for(var i=0;i<s;++i)c[n+i+4]=t[i];return(n+4+s)*8},Ds=function(c,e,t,s,n,i,o,r,A,l,h){At(e,h++,t),++n[256];for(var u=_n(n,15),p=u.t,g=u.l,f=_n(i,15),I=f.t,b=f.l,E=Rs(p),y=E.c,C=E.n,w=Rs(I),x=w.c,R=w.n,D=new qe(19),S=0;S<y.length;++S)++D[y[S]&31];for(var S=0;S<x.length;++S)++D[x[S]&31];for(var v=_n(D,7),N=v.t,G=v.l,O=19;O>4&&!N[Yn[O-1]];--O);var X=l+5<<3,U=Ht(n,mt)+Ht(i,Xt)+o,q=Ht(n,p)+Ht(i,I)+o+14+3*O+Ht(D,N)+2*D[16]+3*D[17]+7*D[18];if(A>=0&&X<=U&&X<=q)return Ri(e,h,c.subarray(A,A+l));var H,z,$,ee;if(At(e,h,1+(q<U)),h+=2,q<U){H=ot(p,g,0),z=p,$=ot(I,b,0),ee=I;var se=ot(N,G,0);At(e,h,C-257),At(e,h+5,R-1),At(e,h+10,O-4),h+=14;for(var S=0;S<O;++S)At(e,h+3*S,N[Yn[S]]);h+=3*O;for(var ce=[y,x],re=0;re<2;++re)for(var le=ce[re],S=0;S<le.length;++S){var Ce=le[S]&31;At(e,h,se[Ce]),h+=N[Ce],Ce>15&&(At(e,h,le[S]>>5&127),h+=le[S]>>12)}}else H=Gr,z=mt,$=Pr,ee=Xt;for(var S=0;S<r;++S){var fe=s[S];if(fe>255){var Ce=fe>>18&31;Ot(e,h,H[Ce+257]),h+=z[Ce+257],Ce>7&&(At(e,h,fe>>23&31),h+=pn[Ce]);var ae=fe&31;Ot(e,h,$[ae]),h+=ee[ae],ae>3&&(Ot(e,h,fe>>5&8191),h+=gn[ae])}else Ot(e,h,H[fe]),h+=z[fe]}return Ot(e,h,H[256]),h+z[256]},qr=new ts([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Di=new Qe(0),zr=function(c,e,t,s,n,i){var o=i.z||c.length,r=new Qe(s+o+5*(1+Math.ceil(o/7e3))+n),A=r.subarray(s,r.length-n),l=i.l,h=(i.r||0)&7;if(e){h&&(A[0]=i.r>>3);for(var u=qr[e-1],p=u>>13,g=u&8191,f=(1<<t)-1,I=i.p||new qe(32768),b=i.h||new qe(f+1),E=Math.ceil(t/3),y=2*E,C=function(Tt){return(c[Tt]^c[Tt+1]<<E^c[Tt+2]<<y)&f},w=new ts(25e3),x=new qe(288),R=new qe(32),D=0,S=0,v=i.i||0,N=0,G=i.w||0,O=0;v+2<o;++v){var X=C(v),U=v&32767,q=b[X];if(I[U]=q,b[X]=U,G<=v){var H=o-v;if((D>7e3||N>24576)&&(H>423||!l)){h=Ds(c,A,0,w,x,R,S,N,O,v-O,h),N=D=S=0,O=v;for(var z=0;z<286;++z)x[z]=0;for(var z=0;z<30;++z)R[z]=0}var $=2,ee=0,se=g,ce=U-q&32767;if(H>2&&X==C(v-ce))for(var re=Math.min(p,H)-1,le=Math.min(32767,v),Ce=Math.min(258,H);ce<=le&&--se&&U!=q;){if(c[v+$]==c[v+$-ce]){for(var fe=0;fe<Ce&&c[v+fe]==c[v+fe-ce];++fe);if(fe>$){if($=fe,ee=ce,fe>re)break;for(var ae=Math.min(ce,fe-2),Pe=0,z=0;z<ae;++z){var Oe=v-ce+z&32767,xt=I[Oe],St=Oe-xt&32767;St>Pe&&(Pe=St,q=Oe)}}}U=q,q=I[U],ce+=U-q&32767}if(ee){w[N++]=268435456|Vn[$]<<18|Ms[ee];var ht=Vn[$]&31,It=Ms[ee]&31;S+=pn[ht]+gn[It],++x[257+ht],++R[It],G=v+$,++D}else w[N++]=c[v],++x[c[v]]}}for(v=Math.max(v,G);v<o;++v)w[N++]=c[v],++x[c[v]];h=Ds(c,A,l,w,x,R,S,N,O,v-O,h),l||(i.r=h&7|A[h/8|0]<<3,h-=7,i.h=b,i.p=I,i.i=v,i.w=G)}else{for(var v=i.w||0;v<o+l;v+=65535){var rt=v+65535;rt>=o&&(A[h/8|0]=l,rt=o),h=Ri(A,h+1,c.subarray(v,rt))}i.i=o}return ss(r,0,s+ns(h)+n)},Kr=(function(){for(var c=new Int32Array(256),e=0;e<256;++e){for(var t=e,s=9;--s;)t=(t&1&&-306674912)^t>>>1;c[e]=t}return c})(),Yr=function(){var c=-1;return{p:function(e){for(var t=c,s=0;s<e.length;++s)t=Kr[t&255^e[s]]^t>>>8;c=t},d:function(){return~c}}},Vr=function(c,e,t,s,n){if(!n&&(n={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new Qe(i.length+c.length);o.set(i),o.set(c,i.length),c=o,n.w=i.length}return zr(c,e.level==null?6:e.level,e.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(c.length)))*1.5):20:12+e.mem,t,s,n)},_i=function(c,e){var t={};for(var s in c)t[s]=c[s];for(var s in e)t[s]=e[s];return t},Re=function(c,e,t){for(;t;++e)c[e]=t,t>>>=8},Jr=function(c,e){return((c[0]&15)!=8||c[0]>>4>7||(c[0]<<8|c[1])%31)&&Ge(6,"invalid zlib data"),(c[1]>>5&1)==1&&Ge(6,"invalid zlib data: "+(c[1]&32?"need":"unexpected")+" dictionary"),(c[1]>>3&4)+2};function Wr(c,e){return Vr(c,e||{},0,0)}function Vt(c,e){return jr(c.subarray(Jr(c),-4),{i:2},e,e)}var Fi=function(c,e,t,s){for(var n in c){var i=c[n],o=e+n,r=s;Array.isArray(i)&&(r=_i(s,i[1]),i=i[0]),i instanceof Qe?t[o]=[i,r]:(t[o+="/"]=[new Qe(0),r],Fi(i,o,t,s))}},_s=typeof TextEncoder<"u"&&new TextEncoder,Xr=typeof TextDecoder<"u"&&new TextDecoder,Zr=0;try{Xr.decode(Di,{stream:!0}),Zr=1}catch{}function Xn(c,e){var t;if(_s)return _s.encode(c);for(var s=c.length,n=new Qe(c.length+(c.length>>1)),i=0,o=function(l){n[i++]=l},t=0;t<s;++t){if(i+5>n.length){var r=new Qe(i+8+(s-t<<1));r.set(n),n=r}var A=c.charCodeAt(t);A<128||e?o(A):A<2048?(o(192|A>>6),o(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|c.charCodeAt(++t)&1023,o(240|A>>18),o(128|A>>12&63),o(128|A>>6&63),o(128|A&63)):(o(224|A>>12),o(128|A>>6&63),o(128|A&63))}return ss(n,0,i)}var Zn=function(c){var e=0;if(c)for(var t in c){var s=c[t].length;s>65535&&Ge(9),e+=s+4}return e},Fs=function(c,e,t,s,n,i,o,r){var A=s.length,l=t.extra,h=r&&r.length,u=Zn(l);Re(c,e,o!=null?33639248:67324752),e+=4,o!=null&&(c[e++]=20,c[e++]=t.os),c[e]=20,e+=2,c[e++]=t.flag<<1|(i<0&&8),c[e++]=n&&8,c[e++]=t.compression&255,c[e++]=t.compression>>8;var p=new Date(t.mtime==null?Date.now():t.mtime),g=p.getFullYear()-1980;if((g<0||g>119)&&Ge(10),Re(c,e,g<<25|p.getMonth()+1<<21|p.getDate()<<16|p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>1),e+=4,i!=-1&&(Re(c,e,t.crc),Re(c,e+4,i<0?-i-2:i),Re(c,e+8,t.size)),Re(c,e+12,A),Re(c,e+14,u),e+=16,o!=null&&(Re(c,e,h),Re(c,e+6,t.attrs),Re(c,e+10,o),e+=14),c.set(s,e),e+=A,u)for(var f in l){var I=l[f],b=I.length;Re(c,e,+f),Re(c,e+2,b),c.set(I,e+4),e+=4+b}return h&&(c.set(r,e),e+=h),e},$r=function(c,e,t,s,n){Re(c,e,101010256),Re(c,e+8,t),Re(c,e+10,t),Re(c,e+12,s),Re(c,e+16,n)};function ea(c,e){e||(e={});var t={},s=[];Fi(c,"",t,e);var n=0,i=0;for(var o in t){var r=t[o],A=r[0],l=r[1],h=l.level==0?0:8,u=Xn(o),p=u.length,g=l.comment,f=g&&Xn(g),I=f&&f.length,b=Zn(l.extra);p>65535&&Ge(11);var E=h?Wr(A,l):A,y=E.length,C=Yr();C.p(A),s.push(_i(l,{size:A.length,crc:C.d(),c:E,f:u,m:f,u:p!=o.length||f&&g.length!=I,o:n,compression:h})),n+=30+p+b+y,i+=76+2*(p+b)+(I||0)+y}for(var w=new Qe(i+22),x=n,R=i-n,D=0;D<s.length;++D){var u=s[D];Fs(w,u.o,u,u.f,u.u,u.c.length);var S=30+u.f.length+Zn(u.extra);w.set(u.c,u.o+S),Fs(w,n,u,u.f,u.u,u.c.length,u.o,u.m),n+=16+S+(u.m?u.m.length:0)}return $r(w,n,s.length,R,x),w}class Li extends a.DataTextureLoader{constructor(e){super(e),this.type=a.HalfFloatType}parse(e){const v=Math.pow(2.7182818,2.2);function N(d,m){let B=0;for(let M=0;M<65536;++M)(M==0||d[M>>3]&1<<(M&7))&&(m[B++]=M);const Q=B-1;for(;B<65536;)m[B++]=0;return Q}function G(d){for(let m=0;m<16384;m++)d[m]={},d[m].len=0,d[m].lit=0,d[m].p=null}const O={l:0,c:0,lc:0};function X(d,m,B,Q,M){for(;B<d;)m=m<<8|cs(Q,M),B+=8;B-=d,O.l=m>>B&(1<<d)-1,O.c=m,O.lc=B}const U=new Array(59);function q(d){for(let B=0;B<=58;++B)U[B]=0;for(let B=0;B<65537;++B)U[d[B]]+=1;let m=0;for(let B=58;B>0;--B){const Q=m+U[B]>>1;U[B]=m,m=Q}for(let B=0;B<65537;++B){const Q=d[B];Q>0&&(d[B]=Q|U[Q]++<<6)}}function H(d,m,B,Q,M,T){const L=m;let P=0,k=0;for(;Q<=M;Q++){if(L.value-m.value>B)return!1;X(6,P,k,d,L);const F=O.l;if(P=O.c,k=O.lc,T[Q]=F,F==63){if(L.value-m.value>B)throw new Error("Something wrong with hufUnpackEncTable");X(8,P,k,d,L);let _=O.l+6;if(P=O.c,k=O.lc,Q+_>M+1)throw new Error("Something wrong with hufUnpackEncTable");for(;_--;)T[Q++]=0;Q--}else if(F>=59){let _=F-59+2;if(Q+_>M+1)throw new Error("Something wrong with hufUnpackEncTable");for(;_--;)T[Q++]=0;Q--}}q(T)}function z(d){return d&63}function $(d){return d>>6}function ee(d,m,B,Q){for(;m<=B;m++){const M=$(d[m]),T=z(d[m]);if(M>>T)throw new Error("Invalid table entry");if(T>14){const L=Q[M>>T-14];if(L.len)throw new Error("Invalid table entry");if(L.lit++,L.p){const P=L.p;L.p=new Array(L.lit);for(let k=0;k<L.lit-1;++k)L.p[k]=P[k]}else L.p=new Array(1);L.p[L.lit-1]=m}else if(T){let L=0;for(let P=1<<14-T;P>0;P--){const k=Q[(M<<14-T)+L];if(k.len||k.p)throw new Error("Invalid table entry");k.len=T,k.lit=m,L++}}}return!0}const se={c:0,lc:0};function ce(d,m,B,Q){d=d<<8|cs(B,Q),m+=8,se.c=d,se.lc=m}const re={c:0,lc:0};function le(d,m,B,Q,M,T,L,P,k){if(d==m){Q<8&&(ce(B,Q,M,T),B=se.c,Q=se.lc),Q-=8;let F=B>>Q;if(F=new Uint8Array([F])[0],P.value+F>k)return!1;const _=L[P.value-1];for(;F-- >0;)L[P.value++]=_}else if(P.value<k)L[P.value++]=d;else return!1;re.c=B,re.lc=Q}function Ce(d){return d&65535}function fe(d){const m=Ce(d);return m>32767?m-65536:m}const ae={a:0,b:0};function Pe(d,m){const B=fe(d),M=fe(m),T=B+(M&1)+(M>>1),L=T,P=T-M;ae.a=L,ae.b=P}function Oe(d,m){const B=Ce(d),Q=Ce(m),M=B-(Q>>1)&65535,T=Q+M-32768&65535;ae.a=T,ae.b=M}function xt(d,m,B,Q,M,T,L){const P=L<16384,k=B>M?M:B;let F=1,_,j;for(;F<=k;)F<<=1;for(F>>=1,_=F,F>>=1;F>=1;){j=0;const J=j+T*(M-_),K=T*F,Z=T*_,Y=Q*F,W=Q*_;let te,de,Be,je;for(;j<=J;j+=Z){let me=j;const Ae=j+Q*(B-_);for(;me<=Ae;me+=W){const xe=me+Y,Ve=me+K,Te=Ve+Y;P?(Pe(d[me+m],d[Ve+m]),te=ae.a,Be=ae.b,Pe(d[xe+m],d[Te+m]),de=ae.a,je=ae.b,Pe(te,de),d[me+m]=ae.a,d[xe+m]=ae.b,Pe(Be,je),d[Ve+m]=ae.a,d[Te+m]=ae.b):(Oe(d[me+m],d[Ve+m]),te=ae.a,Be=ae.b,Oe(d[xe+m],d[Te+m]),de=ae.a,je=ae.b,Oe(te,de),d[me+m]=ae.a,d[xe+m]=ae.b,Oe(Be,je),d[Ve+m]=ae.a,d[Te+m]=ae.b)}if(B&F){const xe=me+K;P?Pe(d[me+m],d[xe+m]):Oe(d[me+m],d[xe+m]),te=ae.a,d[xe+m]=ae.b,d[me+m]=te}}if(M&F){let me=j;const Ae=j+Q*(B-_);for(;me<=Ae;me+=W){const xe=me+Y;P?Pe(d[me+m],d[xe+m]):Oe(d[me+m],d[xe+m]),te=ae.a,d[xe+m]=ae.b,d[me+m]=te}}_=F,F>>=1}return j}function St(d,m,B,Q,M,T,L,P,k){let F=0,_=0;const j=L,J=Math.trunc(Q.value+(M+7)/8);for(;Q.value<J;)for(ce(F,_,B,Q),F=se.c,_=se.lc;_>=14;){const Z=F>>_-14&16383,Y=m[Z];if(Y.len)_-=Y.len,le(Y.lit,T,F,_,B,Q,P,k,j),F=re.c,_=re.lc;else{if(!Y.p)throw new Error("hufDecode issues");let W;for(W=0;W<Y.lit;W++){const te=z(d[Y.p[W]]);for(;_<te&&Q.value<J;)ce(F,_,B,Q),F=se.c,_=se.lc;if(_>=te&&$(d[Y.p[W]])==(F>>_-te&(1<<te)-1)){_-=te,le(Y.p[W],T,F,_,B,Q,P,k,j),F=re.c,_=re.lc;break}}if(W==Y.lit)throw new Error("hufDecode issues")}}const K=8-M&7;for(F>>=K,_-=K;_>0;){const Z=m[F<<14-_&16383];if(Z.len)_-=Z.len,le(Z.lit,T,F,_,B,Q,P,k,j),F=re.c,_=re.lc;else throw new Error("hufDecode issues")}return!0}function ht(d,m,B,Q,M,T){const L={value:0},P=B.value,k=Ye(m,B),F=Ye(m,B);B.value+=4;const _=Ye(m,B);if(B.value+=4,k<0||k>=65537||F<0||F>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const j=new Array(65537),J=new Array(16384);G(J);const K=Q-(B.value-P);if(H(d,B,K,k,F,j),_>8*(Q-(B.value-P)))throw new Error("Something wrong with hufUncompress");ee(j,k,F,J),St(j,J,d,B,_,F,T,M,L)}function It(d,m,B){for(let Q=0;Q<B;++Q)m[Q]=d[m[Q]]}function rt(d){for(let m=1;m<d.length;m++){const B=d[m-1]+d[m]-128;d[m]=B}}function Tt(d,m){let B=0,Q=Math.floor((d.length+1)/2),M=0;const T=d.length-1;for(;!(M>T||(m[M++]=d[B++],M>T));)m[M++]=d[Q++]}function as(d){let m=d.byteLength;const B=new Array;let Q=0;const M=new DataView(d);for(;m>0;){const T=M.getInt8(Q++);if(T<0){const L=-T;m-=L+1;for(let P=0;P<L;P++)B.push(M.getUint8(Q++))}else{const L=T;m-=2;const P=M.getUint8(Q++);for(let k=0;k<L+1;k++)B.push(P)}}return B}function Ki(d,m,B,Q,M,T){let L=new DataView(T.buffer);const P=B[d.idx[0]].width,k=B[d.idx[0]].height,F=3,_=Math.floor(P/8),j=Math.ceil(P/8),J=Math.ceil(k/8),K=P-(j-1)*8,Z=k-(J-1)*8,Y={value:0},W=new Array(F),te=new Array(F),de=new Array(F),Be=new Array(F),je=new Array(F);for(let Ae=0;Ae<F;++Ae)je[Ae]=m[d.idx[Ae]],W[Ae]=Ae<1?0:W[Ae-1]+j*J,te[Ae]=new Float32Array(64),de[Ae]=new Uint16Array(64),Be[Ae]=new Uint16Array(j*64);for(let Ae=0;Ae<J;++Ae){let xe=8;Ae==J-1&&(xe=Z);let Ve=8;for(let ue=0;ue<j;++ue){ue==j-1&&(Ve=K);for(let ge=0;ge<F;++ge)de[ge].fill(0),de[ge][0]=M[W[ge]++],Yi(Y,Q,de[ge]),Vi(de[ge],te[ge]),Ji(te[ge]);Wi(te);for(let ge=0;ge<F;++ge)Xi(te[ge],Be[ge],ue*64)}let Te=0;for(let ue=0;ue<F;++ue){const ge=B[d.idx[ue]].type;for(let at=8*Ae;at<8*Ae+xe;++at){Te=je[ue][at];for(let Lt=0;Lt<_;++Lt){const $e=Lt*64+(at&7)*8;L.setUint16(Te+0*ge,Be[ue][$e+0],!0),L.setUint16(Te+2*ge,Be[ue][$e+1],!0),L.setUint16(Te+4*ge,Be[ue][$e+2],!0),L.setUint16(Te+6*ge,Be[ue][$e+3],!0),L.setUint16(Te+8*ge,Be[ue][$e+4],!0),L.setUint16(Te+10*ge,Be[ue][$e+5],!0),L.setUint16(Te+12*ge,Be[ue][$e+6],!0),L.setUint16(Te+14*ge,Be[ue][$e+7],!0),Te+=16*ge}}if(_!=j)for(let at=8*Ae;at<8*Ae+xe;++at){const Lt=je[ue][at]+8*_*2*ge,$e=_*64+(at&7)*8;for(let en=0;en<Ve;++en)L.setUint16(Lt+en*2*ge,Be[ue][$e+en],!0)}}}const me=new Uint16Array(P);L=new DataView(T.buffer);for(let Ae=0;Ae<F;++Ae){B[d.idx[Ae]].decoded=!0;const xe=B[d.idx[Ae]].type;if(B[Ae].type==2)for(let Ve=0;Ve<k;++Ve){const Te=je[Ae][Ve];for(let ue=0;ue<P;++ue)me[ue]=L.getUint16(Te+ue*2*xe,!0);for(let ue=0;ue<P;++ue)L.setFloat32(Te+ue*2*xe,V(me[ue]),!0)}}}function Yi(d,m,B){let Q,M=1;for(;M<64;)Q=m[d.value],Q==65280?M=64:Q>>8==255?M+=Q&255:(B[M]=Q,M++),d.value++}function Vi(d,m){m[0]=V(d[0]),m[1]=V(d[1]),m[2]=V(d[5]),m[3]=V(d[6]),m[4]=V(d[14]),m[5]=V(d[15]),m[6]=V(d[27]),m[7]=V(d[28]),m[8]=V(d[2]),m[9]=V(d[4]),m[10]=V(d[7]),m[11]=V(d[13]),m[12]=V(d[16]),m[13]=V(d[26]),m[14]=V(d[29]),m[15]=V(d[42]),m[16]=V(d[3]),m[17]=V(d[8]),m[18]=V(d[12]),m[19]=V(d[17]),m[20]=V(d[25]),m[21]=V(d[30]),m[22]=V(d[41]),m[23]=V(d[43]),m[24]=V(d[9]),m[25]=V(d[11]),m[26]=V(d[18]),m[27]=V(d[24]),m[28]=V(d[31]),m[29]=V(d[40]),m[30]=V(d[44]),m[31]=V(d[53]),m[32]=V(d[10]),m[33]=V(d[19]),m[34]=V(d[23]),m[35]=V(d[32]),m[36]=V(d[39]),m[37]=V(d[45]),m[38]=V(d[52]),m[39]=V(d[54]),m[40]=V(d[20]),m[41]=V(d[22]),m[42]=V(d[33]),m[43]=V(d[38]),m[44]=V(d[46]),m[45]=V(d[51]),m[46]=V(d[55]),m[47]=V(d[60]),m[48]=V(d[21]),m[49]=V(d[34]),m[50]=V(d[37]),m[51]=V(d[47]),m[52]=V(d[50]),m[53]=V(d[56]),m[54]=V(d[59]),m[55]=V(d[61]),m[56]=V(d[35]),m[57]=V(d[36]),m[58]=V(d[48]),m[59]=V(d[49]),m[60]=V(d[57]),m[61]=V(d[58]),m[62]=V(d[62]),m[63]=V(d[63])}function Ji(d){const m=.5*Math.cos(.7853975),B=.5*Math.cos(3.14159/16),Q=.5*Math.cos(3.14159/8),M=.5*Math.cos(3*3.14159/16),T=.5*Math.cos(5*3.14159/16),L=.5*Math.cos(3*3.14159/8),P=.5*Math.cos(7*3.14159/16),k=new Array(4),F=new Array(4),_=new Array(4),j=new Array(4);for(let J=0;J<8;++J){const K=J*8;k[0]=Q*d[K+2],k[1]=L*d[K+2],k[2]=Q*d[K+6],k[3]=L*d[K+6],F[0]=B*d[K+1]+M*d[K+3]+T*d[K+5]+P*d[K+7],F[1]=M*d[K+1]-P*d[K+3]-B*d[K+5]-T*d[K+7],F[2]=T*d[K+1]-B*d[K+3]+P*d[K+5]+M*d[K+7],F[3]=P*d[K+1]-T*d[K+3]+M*d[K+5]-B*d[K+7],_[0]=m*(d[K+0]+d[K+4]),_[3]=m*(d[K+0]-d[K+4]),_[1]=k[0]+k[3],_[2]=k[1]-k[2],j[0]=_[0]+_[1],j[1]=_[3]+_[2],j[2]=_[3]-_[2],j[3]=_[0]-_[1],d[K+0]=j[0]+F[0],d[K+1]=j[1]+F[1],d[K+2]=j[2]+F[2],d[K+3]=j[3]+F[3],d[K+4]=j[3]-F[3],d[K+5]=j[2]-F[2],d[K+6]=j[1]-F[1],d[K+7]=j[0]-F[0]}for(let J=0;J<8;++J)k[0]=Q*d[16+J],k[1]=L*d[16+J],k[2]=Q*d[48+J],k[3]=L*d[48+J],F[0]=B*d[8+J]+M*d[24+J]+T*d[40+J]+P*d[56+J],F[1]=M*d[8+J]-P*d[24+J]-B*d[40+J]-T*d[56+J],F[2]=T*d[8+J]-B*d[24+J]+P*d[40+J]+M*d[56+J],F[3]=P*d[8+J]-T*d[24+J]+M*d[40+J]-B*d[56+J],_[0]=m*(d[J]+d[32+J]),_[3]=m*(d[J]-d[32+J]),_[1]=k[0]+k[3],_[2]=k[1]-k[2],j[0]=_[0]+_[1],j[1]=_[3]+_[2],j[2]=_[3]-_[2],j[3]=_[0]-_[1],d[0+J]=j[0]+F[0],d[8+J]=j[1]+F[1],d[16+J]=j[2]+F[2],d[24+J]=j[3]+F[3],d[32+J]=j[3]-F[3],d[40+J]=j[2]-F[2],d[48+J]=j[1]-F[1],d[56+J]=j[0]-F[0]}function Wi(d){for(let m=0;m<64;++m){const B=d[0][m],Q=d[1][m],M=d[2][m];d[0][m]=B+1.5747*M,d[1][m]=B-.1873*Q-.4682*M,d[2][m]=B+1.8556*Q}}function Xi(d,m,B){for(let Q=0;Q<64;++Q)m[B+Q]=a.DataUtils.toHalfFloat(Zi(d[Q]))}function Zi(d){return d<=1?Math.sign(d)*Math.pow(Math.abs(d),2.2):Math.sign(d)*Math.pow(v,Math.abs(d)-1)}function fn(d){return new DataView(d.array.buffer,d.offset.value,d.size)}function $i(d){const m=d.viewer.buffer.slice(d.offset.value,d.offset.value+d.size),B=new Uint8Array(as(m)),Q=new Uint8Array(B.length);return rt(B),Tt(B,Q),new DataView(Q.buffer)}function mn(d){const m=d.array.slice(d.offset.value,d.offset.value+d.size),B=Vt(m),Q=new Uint8Array(B.length);return rt(B),Tt(B,Q),new DataView(Q.buffer)}function eo(d){const m=d.viewer,B={value:d.offset.value},Q=new Uint16Array(d.columns*d.lines*(d.inputChannels.length*d.type)),M=new Uint8Array(8192);let T=0;const L=new Array(d.inputChannels.length);for(let Z=0,Y=d.inputChannels.length;Z<Y;Z++)L[Z]={},L[Z].start=T,L[Z].end=L[Z].start,L[Z].nx=d.columns,L[Z].ny=d.lines,L[Z].size=d.type,T+=L[Z].nx*L[Z].ny*L[Z].size;const P=Ft(m,B),k=Ft(m,B);if(k>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(P<=k)for(let Z=0;Z<k-P+1;Z++)M[Z+P]=ut(m,B);const F=new Uint16Array(65536),_=N(M,F),j=Ye(m,B);ht(d.array,m,B,j,Q,T);for(let Z=0;Z<d.inputChannels.length;++Z){const Y=L[Z];for(let W=0;W<L[Z].size;++W)xt(Q,Y.start+W,Y.nx,Y.size,Y.ny,Y.nx*Y.size,_)}It(F,Q,T);let J=0;const K=new Uint8Array(Q.buffer.byteLength);for(let Z=0;Z<d.lines;Z++)for(let Y=0;Y<d.inputChannels.length;Y++){const W=L[Y],te=W.nx*W.size,de=new Uint8Array(Q.buffer,W.end*2,te*2);K.set(de,J),J+=te*2,W.end+=te}return new DataView(K.buffer)}function to(d){const m=d.array.slice(d.offset.value,d.offset.value+d.size),B=Vt(m),Q=d.inputChannels.length*d.lines*d.columns*d.totalBytes,M=new ArrayBuffer(Q),T=new DataView(M);let L=0,P=0;const k=new Array(4);for(let F=0;F<d.lines;F++)for(let _=0;_<d.inputChannels.length;_++){let j=0;switch(d.inputChannels[_].pixelType){case 1:k[0]=L,k[1]=k[0]+d.columns,L=k[1]+d.columns;for(let K=0;K<d.columns;++K){const Z=B[k[0]++]<<8|B[k[1]++];j+=Z,T.setUint16(P,j,!0),P+=2}break;case 2:k[0]=L,k[1]=k[0]+d.columns,k[2]=k[1]+d.columns,L=k[2]+d.columns;for(let K=0;K<d.columns;++K){const Z=B[k[0]++]<<24|B[k[1]++]<<16|B[k[2]++]<<8;j+=Z,T.setUint32(P,j,!0),P+=4}break}}return T}function As(d){const m=d.viewer,B={value:d.offset.value},Q=new Uint8Array(d.columns*d.lines*(d.inputChannels.length*d.type*2)),M={version:He(m,B),unknownUncompressedSize:He(m,B),unknownCompressedSize:He(m,B),acCompressedSize:He(m,B),dcCompressedSize:He(m,B),rleCompressedSize:He(m,B),rleUncompressedSize:He(m,B),rleRawSize:He(m,B),totalAcUncompressedCount:He(m,B),totalDcUncompressedCount:He(m,B),acCompression:He(m,B)};if(M.version<2)throw new Error("EXRLoader.parse: "+bt.compression+" version "+M.version+" is unsupported");const T=new Array;let L=Ft(m,B)-2;for(;L>0;){const Y=$t(m.buffer,B),W=ut(m,B),te=W>>2&3,de=(W>>4)-1,Be=new Int8Array([de])[0],je=ut(m,B);T.push({name:Y,index:Be,type:je,compression:te}),L-=Y.length+3}const P=bt.channels,k=new Array(d.inputChannels.length);for(let Y=0;Y<d.inputChannels.length;++Y){const W=k[Y]={},te=P[Y];W.name=te.name,W.compression=0,W.decoded=!1,W.type=te.pixelType,W.pLinear=te.pLinear,W.width=d.columns,W.height=d.lines}const F={idx:new Array(3)};for(let Y=0;Y<d.inputChannels.length;++Y){const W=k[Y];for(let te=0;te<T.length;++te){const de=T[te];W.name==de.name&&(W.compression=de.compression,de.index>=0&&(F.idx[de.index]=Y),W.offset=Y)}}let _,j,J;if(M.acCompressedSize>0)switch(M.acCompression){case 0:_=new Uint16Array(M.totalAcUncompressedCount),ht(d.array,m,B,M.acCompressedSize,_,M.totalAcUncompressedCount);break;case 1:const Y=d.array.slice(B.value,B.value+M.totalAcUncompressedCount),W=Vt(Y);_=new Uint16Array(W.buffer),B.value+=M.totalAcUncompressedCount;break}if(M.dcCompressedSize>0){const Y={array:d.array,offset:B,size:M.dcCompressedSize};j=new Uint16Array(mn(Y).buffer),B.value+=M.dcCompressedSize}if(M.rleRawSize>0){const Y=d.array.slice(B.value,B.value+M.rleCompressedSize),W=Vt(Y);J=as(W.buffer),B.value+=M.rleCompressedSize}let K=0;const Z=new Array(k.length);for(let Y=0;Y<Z.length;++Y)Z[Y]=new Array;for(let Y=0;Y<d.lines;++Y)for(let W=0;W<k.length;++W)Z[W].push(K),K+=k[W].width*d.type*2;Ki(F,Z,k,_,j,Q);for(let Y=0;Y<k.length;++Y){const W=k[Y];if(!W.decoded)switch(W.compression){case 2:let te=0,de=0;for(let Be=0;Be<d.lines;++Be){let je=Z[Y][te];for(let me=0;me<W.width;++me){for(let Ae=0;Ae<2*W.type;++Ae)Q[je++]=J[de+Ae*W.width*W.height];de++}te++}break;case 1:default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(Q.buffer)}function $t(d,m){const B=new Uint8Array(d);let Q=0;for(;B[m.value+Q]!=0;)Q+=1;const M=new TextDecoder().decode(B.slice(m.value,m.value+Q));return m.value=m.value+Q+1,M}function no(d,m,B){const Q=new TextDecoder().decode(new Uint8Array(d).slice(m.value,m.value+B));return m.value=m.value+B,Q}function so(d,m){const B=Ke(d,m),Q=Ye(d,m);return[B,Q]}function io(d,m){const B=Ye(d,m),Q=Ye(d,m);return[B,Q]}function Ke(d,m){const B=d.getInt32(m.value,!0);return m.value=m.value+4,B}function Ye(d,m){const B=d.getUint32(m.value,!0);return m.value=m.value+4,B}function cs(d,m){const B=d[m.value];return m.value=m.value+1,B}function ut(d,m){const B=d.getUint8(m.value);return m.value=m.value+1,B}const He=function(d,m){let B;return"getBigInt64"in DataView.prototype?B=Number(d.getBigInt64(m.value,!0)):B=d.getUint32(m.value+4,!0)+Number(d.getUint32(m.value,!0)<<32),m.value+=8,B};function _e(d,m){const B=d.getFloat32(m.value,!0);return m.value+=4,B}function oo(d,m){return a.DataUtils.toHalfFloat(_e(d,m))}function V(d){const m=(d&31744)>>10,B=d&1023;return(d>>15?-1:1)*(m?m===31?B?NaN:1/0:Math.pow(2,m-15)*(1+B/1024):6103515625e-14*(B/1024))}function Ft(d,m){const B=d.getUint16(m.value,!0);return m.value+=2,B}function ro(d,m){return V(Ft(d,m))}function ao(d,m,B,Q){const M=B.value,T=[];for(;B.value<M+Q-1;){const L=$t(m,B),P=Ke(d,B),k=ut(d,B);B.value+=3;const F=Ke(d,B),_=Ke(d,B);T.push({name:L,pixelType:P,pLinear:k,xSampling:F,ySampling:_})}return B.value+=1,T}function Ao(d,m){const B=_e(d,m),Q=_e(d,m),M=_e(d,m),T=_e(d,m),L=_e(d,m),P=_e(d,m),k=_e(d,m),F=_e(d,m);return{redX:B,redY:Q,greenX:M,greenY:T,blueX:L,blueY:P,whiteX:k,whiteY:F}}function co(d,m){const B=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],Q=ut(d,m);return B[Q]}function lo(d,m){const B=Ke(d,m),Q=Ke(d,m),M=Ke(d,m),T=Ke(d,m);return{xMin:B,yMin:Q,xMax:M,yMax:T}}function ho(d,m){const B=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],Q=ut(d,m);return B[Q]}function uo(d,m){const B=["ENVMAP_LATLONG","ENVMAP_CUBE"],Q=ut(d,m);return B[Q]}function po(d,m){const B=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],Q=["ROUND_DOWN","ROUND_UP"],M=Ye(d,m),T=Ye(d,m),L=ut(d,m);return{xSize:M,ySize:T,levelMode:B[L&15],roundingMode:Q[L>>4]}}function go(d,m){const B=_e(d,m),Q=_e(d,m);return[B,Q]}function fo(d,m){const B=_e(d,m),Q=_e(d,m),M=_e(d,m);return[B,Q,M]}function mo(d,m,B,Q,M){if(Q==="string"||Q==="stringvector"||Q==="iccProfile")return no(m,B,M);if(Q==="chlist")return ao(d,m,B,M);if(Q==="chromaticities")return Ao(d,B);if(Q==="compression")return co(d,B);if(Q==="box2i")return lo(d,B);if(Q==="envmap")return uo(d,B);if(Q==="tiledesc")return po(d,B);if(Q==="lineOrder")return ho(d,B);if(Q==="float")return _e(d,B);if(Q==="v2f")return go(d,B);if(Q==="v3f")return fo(d,B);if(Q==="int")return Ke(d,B);if(Q==="rational")return so(d,B);if(Q==="timecode")return io(d,B);if(Q==="preview")return B.value+=M,"skipped";B.value+=M}function Io(d,m){const B=Math.log2(d);return m=="ROUND_DOWN"?Math.floor(B):Math.ceil(B)}function bo(d,m,B){let Q=0;switch(d.levelMode){case"ONE_LEVEL":Q=1;break;case"MIPMAP_LEVELS":Q=Io(Math.max(m,B),d.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return Q}function ls(d,m,B,Q){const M=new Array(d);for(let T=0;T<d;T++){const L=1<<T;let P=m/L|0;Q=="ROUND_UP"&&P*L<m&&(P+=1);const k=Math.max(P,1);M[T]=(k+B-1)/B|0}return M}function Eo(){const d=this,m=d.offset,B={value:0};for(let Q=0;Q<d.tileCount;Q++){const M=Ke(d.viewer,m),T=Ke(d.viewer,m);m.value+=8,d.size=Ye(d.viewer,m);const L=M*d.blockWidth,P=T*d.blockHeight;d.columns=L+d.blockWidth>d.width?d.width-L:d.blockWidth,d.lines=P+d.blockHeight>d.height?d.height-P:d.blockHeight;const k=d.columns*d.totalBytes,_=d.size<d.lines*k?d.uncompress(d):fn(d);m.value+=d.size;for(let j=0;j<d.lines;j++){const J=j*d.columns*d.totalBytes;for(let K=0;K<d.inputChannels.length;K++){const Z=bt.channels[K].name,Y=d.channelByteOffsets[Z]*d.columns,W=d.decodeChannels[Z];if(W===void 0)continue;B.value=J+Y;const te=(d.height-(1+P+j))*d.outLineWidth;for(let de=0;de<d.columns;de++){const Be=te+(de+L)*d.outputChannels+W;d.byteArray[Be]=d.getter(_,B)}}}}}function Co(){const d=this,m=d.offset,B={value:0};for(let Q=0;Q<d.height/d.blockHeight;Q++){const M=Ke(d.viewer,m)-bt.dataWindow.yMin;d.size=Ye(d.viewer,m),d.lines=M+d.blockHeight>d.height?d.height-M:d.blockHeight;const T=d.columns*d.totalBytes,P=d.size<d.lines*T?d.uncompress(d):fn(d);m.value+=d.size;for(let k=0;k<d.blockHeight;k++){const F=Q*d.blockHeight,_=k+d.scanOrder(F);if(_>=d.height)continue;const j=k*T,J=(d.height-1-_)*d.outLineWidth;for(let K=0;K<d.inputChannels.length;K++){const Z=bt.channels[K].name,Y=d.channelByteOffsets[Z]*d.columns,W=d.decodeChannels[Z];if(W!==void 0){B.value=j+Y;for(let te=0;te<d.columns;te++){const de=J+te*d.outputChannels+W;d.byteArray[de]=d.getter(P,B)}}}}}}function Bo(d,m,B){const Q={};if(d.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");Q.version=d.getUint8(4);const M=d.getUint8(5);Q.spec={singleTile:!!(M&2),longName:!!(M&4),deepFormat:!!(M&8),multiPart:!!(M&16)},B.value=8;let T=!0;for(;T;){const L=$t(m,B);if(L==0)T=!1;else{const P=$t(m,B),k=Ye(d,B),F=mo(d,m,B,P,k);F===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${P}'.`):Q[L]=F}}if((M&-7)!=0)throw console.error("THREE.EXRHeader:",Q),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return Q}function yo(d,m,B,Q,M){const T={size:0,viewer:m,array:B,offset:Q,width:d.dataWindow.xMax-d.dataWindow.xMin+1,height:d.dataWindow.yMax-d.dataWindow.yMin+1,inputChannels:d.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:a.LinearSRGBColorSpace};switch(d.compression){case"NO_COMPRESSION":T.blockHeight=1,T.uncompress=fn;break;case"RLE_COMPRESSION":T.blockHeight=1,T.uncompress=$i;break;case"ZIPS_COMPRESSION":T.blockHeight=1,T.uncompress=mn;break;case"ZIP_COMPRESSION":T.blockHeight=16,T.uncompress=mn;break;case"PIZ_COMPRESSION":T.blockHeight=32,T.uncompress=eo;break;case"PXR24_COMPRESSION":T.blockHeight=16,T.uncompress=to;break;case"DWAA_COMPRESSION":T.blockHeight=32,T.uncompress=As;break;case"DWAB_COMPRESSION":T.blockHeight=256,T.uncompress=As;break;default:throw new Error("EXRLoader.parse: "+d.compression+" is unsupported")}const L={};for(const _ of d.channels)switch(_.name){case"Y":case"R":case"G":case"B":case"A":L[_.name]=!0,T.type=_.pixelType}let P=!1;if(L.R&&L.G&&L.B)P=!L.A,T.outputChannels=4,T.decodeChannels={R:0,G:1,B:2,A:3};else if(L.Y)T.outputChannels=1,T.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(T.type==1)switch(M){case a.FloatType:T.getter=ro;break;case a.HalfFloatType:T.getter=Ft;break}else if(T.type==2)switch(M){case a.FloatType:T.getter=_e;break;case a.HalfFloatType:T.getter=oo}else throw new Error("EXRLoader.parse: unsupported pixelType "+T.type+" for "+d.compression+".");T.columns=T.width;const k=T.width*T.height*T.outputChannels;switch(M){case a.FloatType:T.byteArray=new Float32Array(k),P&&T.byteArray.fill(1,0,k);break;case a.HalfFloatType:T.byteArray=new Uint16Array(k),P&&T.byteArray.fill(15360,0,k);break;default:console.error("THREE.EXRLoader: unsupported type: ",M);break}let F=0;for(const _ of d.channels)T.decodeChannels[_.name]!==void 0&&(T.channelByteOffsets[_.name]=F),F+=_.pixelType*2;if(T.totalBytes=F,T.outLineWidth=T.width*T.outputChannels,d.lineOrder==="INCREASING_Y"?T.scanOrder=_=>_:T.scanOrder=_=>T.height-1-_,T.outputChannels==4?(T.format=a.RGBAFormat,T.colorSpace=a.LinearSRGBColorSpace):(T.format=a.RedFormat,T.colorSpace=a.NoColorSpace),d.spec.singleTile){T.blockHeight=d.tiles.ySize,T.blockWidth=d.tiles.xSize;const _=bo(d.tiles,T.width,T.height),j=ls(_,T.width,d.tiles.xSize,d.tiles.roundingMode),J=ls(_,T.height,d.tiles.ySize,d.tiles.roundingMode);T.tileCount=j[0]*J[0];for(let K=0;K<_;K++)for(let Z=0;Z<J[K];Z++)for(let Y=0;Y<j[K];Y++)He(m,Q);T.decode=Eo.bind(T)}else{T.blockWidth=T.width;const _=Math.ceil(T.height/T.blockHeight);for(let j=0;j<_;j++)He(m,Q);T.decode=Co.bind(T)}return T}const hs={value:0},us=new DataView(e),wo=new Uint8Array(e),bt=Bo(us,e,hs),vt=yo(bt,us,wo,hs,this.type);return vt.decode(),{header:bt,width:vt.width,height:vt.height,data:vt.byteArray,format:vt.format,colorSpace:vt.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,s,n){function i(o,r){o.colorSpace=r.colorSpace,o.minFilter=a.LinearFilter,o.magFilter=a.LinearFilter,o.generateMipmaps=!1,o.flipY=!1,t&&t(o,r)}return super.load(e,i,s,n)}}const ta=Object.freeze(Object.defineProperty({__proto__:null,EXRLoader:Li},Symbol.toStringTag,{value:"Module"}));class ki extends a.DataTextureLoader{constructor(e){super(e),this.type=a.HalfFloatType}parse(e){const o=function(S,v){switch(S){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(v||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(v||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(v||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(v||""))}},u=function(S,v,N){v=v||1024;let O=S.pos,X=-1,U=0,q="",H=String.fromCharCode.apply(null,new Uint16Array(S.subarray(O,O+128)));for(;0>(X=H.indexOf(`
42
- `))&&U<v&&O<S.byteLength;)q+=H,U+=H.length,O+=128,H+=String.fromCharCode.apply(null,new Uint16Array(S.subarray(O,O+128)));return-1<X?(S.pos+=U+X+1,q+H.slice(0,X)):!1},p=function(S){const v=/^#\?(\S+)/,N=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,G=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,O=/^\s*FORMAT=(\S+)\s*$/,X=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,U={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let q,H;for((S.pos>=S.byteLength||!(q=u(S)))&&o(1,"no header found"),(H=q.match(v))||o(3,"bad initial token"),U.valid|=1,U.programtype=H[1],U.string+=q+`
43
- `;q=u(S),q!==!1;){if(U.string+=q+`
44
- `,q.charAt(0)==="#"){U.comments+=q+`
45
- `;continue}if((H=q.match(N))&&(U.gamma=parseFloat(H[1])),(H=q.match(G))&&(U.exposure=parseFloat(H[1])),(H=q.match(O))&&(U.valid|=2,U.format=H[1]),(H=q.match(X))&&(U.valid|=4,U.height=parseInt(H[1],10),U.width=parseInt(H[2],10)),U.valid&2&&U.valid&4)break}return U.valid&2||o(3,"missing format specifier"),U.valid&4||o(3,"missing image size specifier"),U},g=function(S,v,N){const G=v;if(G<8||G>32767||S[0]!==2||S[1]!==2||S[2]&128)return new Uint8Array(S);G!==(S[2]<<8|S[3])&&o(3,"wrong scanline width");const O=new Uint8Array(4*v*N);O.length||o(4,"unable to allocate buffer space");let X=0,U=0;const q=4*G,H=new Uint8Array(4),z=new Uint8Array(q);let $=N;for(;$>0&&U<S.byteLength;){U+4>S.byteLength&&o(1),H[0]=S[U++],H[1]=S[U++],H[2]=S[U++],H[3]=S[U++],(H[0]!=2||H[1]!=2||(H[2]<<8|H[3])!=G)&&o(3,"bad rgbe scanline format");let ee=0,se;for(;ee<q&&U<S.byteLength;){se=S[U++];const re=se>128;if(re&&(se-=128),(se===0||ee+se>q)&&o(3,"bad scanline data"),re){const le=S[U++];for(let Ce=0;Ce<se;Ce++)z[ee++]=le}else z.set(S.subarray(U,U+se),ee),ee+=se,U+=se}const ce=G;for(let re=0;re<ce;re++){let le=0;O[X]=z[re+le],le+=G,O[X+1]=z[re+le],le+=G,O[X+2]=z[re+le],le+=G,O[X+3]=z[re+le],X+=4}$--}return O},f=function(S,v,N,G){const O=S[v+3],X=Math.pow(2,O-128)/255;N[G+0]=S[v+0]*X,N[G+1]=S[v+1]*X,N[G+2]=S[v+2]*X,N[G+3]=1},I=function(S,v,N,G){const O=S[v+3],X=Math.pow(2,O-128)/255;N[G+0]=a.DataUtils.toHalfFloat(Math.min(S[v+0]*X,65504)),N[G+1]=a.DataUtils.toHalfFloat(Math.min(S[v+1]*X,65504)),N[G+2]=a.DataUtils.toHalfFloat(Math.min(S[v+2]*X,65504)),N[G+3]=a.DataUtils.toHalfFloat(1)},b=new Uint8Array(e);b.pos=0;const E=p(b),y=E.width,C=E.height,w=g(b.subarray(b.pos),y,C);let x,R,D;switch(this.type){case a.FloatType:D=w.length/4;const S=new Float32Array(D*4);for(let N=0;N<D;N++)f(w,N*4,S,N*4);x=S,R=a.FloatType;break;case a.HalfFloatType:D=w.length/4;const v=new Uint16Array(D*4);for(let N=0;N<D;N++)I(w,N*4,v,N*4);x=v,R=a.HalfFloatType;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:y,height:C,data:x,header:E.string,gamma:E.gamma,exposure:E.exposure,type:R}}setDataType(e){return this.type=e,this}load(e,t,s,n){function i(o,r){switch(o.type){case a.FloatType:case a.HalfFloatType:o.colorSpace=a.LinearSRGBColorSpace,o.minFilter=a.LinearFilter,o.magFilter=a.LinearFilter,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,r)}return super.load(e,i,s,n)}}const na=Object.freeze(Object.defineProperty({__proto__:null,RGBELoader:ki},Symbol.toStringTag,{value:"Module"}));function Ni(c,e,t){const s=t.length-c-1;if(e>=t[s])return s-1;if(e<=t[c])return c;let n=c,i=s,o=Math.floor((n+i)/2);for(;e<t[o]||e>=t[o+1];)e<t[o]?i=o:n=o,o=Math.floor((n+i)/2);return o}function sa(c,e,t,s){const n=[],i=[],o=[];n[0]=1;for(let r=1;r<=t;++r){i[r]=e-s[c+1-r],o[r]=s[c+r]-e;let A=0;for(let l=0;l<r;++l){const h=o[l+1],u=i[r-l],p=n[l]/(h+u);n[l]=A+h*p,A=u*p}n[r]=A}return n}function ia(c,e,t,s){const n=Ni(c,s,e),i=sa(n,s,c,e),o=new a.Vector4(0,0,0,0);for(let r=0;r<=c;++r){const A=t[n-c+r],l=i[r],h=A.w*l;o.x+=A.x*h,o.y+=A.y*h,o.z+=A.z*h,o.w+=A.w*l}return o}function oa(c,e,t,s,n){const i=[];for(let u=0;u<=t;++u)i[u]=0;const o=[];for(let u=0;u<=s;++u)o[u]=i.slice(0);const r=[];for(let u=0;u<=t;++u)r[u]=i.slice(0);r[0][0]=1;const A=i.slice(0),l=i.slice(0);for(let u=1;u<=t;++u){A[u]=e-n[c+1-u],l[u]=n[c+u]-e;let p=0;for(let g=0;g<u;++g){const f=l[g+1],I=A[u-g];r[u][g]=f+I;const b=r[g][u-1]/r[u][g];r[g][u]=p+f*b,p=I*b}r[u][u]=p}for(let u=0;u<=t;++u)o[0][u]=r[u][t];for(let u=0;u<=t;++u){let p=0,g=1;const f=[];for(let I=0;I<=t;++I)f[I]=i.slice(0);f[0][0]=1;for(let I=1;I<=s;++I){let b=0;const E=u-I,y=t-I;u>=I&&(f[g][0]=f[p][0]/r[y+1][E],b=f[g][0]*r[E][y]);const C=E>=-1?1:-E,w=u-1<=y?I-1:t-u;for(let R=C;R<=w;++R)f[g][R]=(f[p][R]-f[p][R-1])/r[y+1][E+R],b+=f[g][R]*r[E+R][y];u<=y&&(f[g][I]=-f[p][I-1]/r[y+1][u],b+=f[g][I]*r[u][y]),o[I][u]=b;const x=p;p=g,g=x}}let h=t;for(let u=1;u<=s;++u){for(let p=0;p<=t;++p)o[u][p]*=h;h*=t-u}return o}function ra(c,e,t,s,n){const i=n<c?n:c,o=[],r=Ni(c,s,e),A=oa(r,s,c,i,e),l=[];for(let h=0;h<t.length;++h){const u=t[h].clone(),p=u.w;u.x*=p,u.y*=p,u.z*=p,l[h]=u}for(let h=0;h<=i;++h){const u=l[r-c].clone().multiplyScalar(A[h][0]);for(let p=1;p<=c;++p)u.add(l[r-c+p].clone().multiplyScalar(A[h][p]));o[h]=u}for(let h=i+1;h<=n+1;++h)o[h]=new a.Vector4(0,0,0);return o}function aa(c,e){let t=1;for(let n=2;n<=c;++n)t*=n;let s=1;for(let n=2;n<=e;++n)s*=n;for(let n=2;n<=c-e;++n)s*=n;return t/s}function Aa(c){const e=c.length,t=[],s=[];for(let i=0;i<e;++i){const o=c[i];t[i]=new a.Vector3(o.x,o.y,o.z),s[i]=o.w}const n=[];for(let i=0;i<e;++i){const o=t[i].clone();for(let r=1;r<=i;++r)o.sub(n[i-r].clone().multiplyScalar(aa(i,r)*s[r]));n[i]=o.divideScalar(s[0])}return n}function ca(c,e,t,s,n){const i=ra(c,e,t,s,n);return Aa(i)}class la extends a.Curve{constructor(e,t,s,n,i){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=n||0,this.endKnot=i||this.knots.length-1;for(let o=0;o<s.length;++o){const r=s[o];this.controlPoints[o]=new a.Vector4(r.x,r.y,r.z,r.w)}}getPoint(e,t=new a.Vector3){const s=t,n=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),i=ia(this.degree,this.knots,this.controlPoints,n);return i.w!==1&&i.divideScalar(i.w),s.set(i.x,i.y,i.z)}getTangent(e,t=new a.Vector3){const s=t,n=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),i=ca(this.degree,this.knots,this.controlPoints,n,1);return s.copy(i[1]).normalize(),s}}let ne,we,ke;class ha extends a.Loader{constructor(e){super(e)}load(e,t,s,n){const i=this,o=i.path===""?a.LoaderUtils.extractUrlBase(e):i.path,r=new a.FileLoader(this.manager);r.setPath(i.path),r.setResponseType("arraybuffer"),r.setRequestHeader(i.requestHeader),r.setWithCredentials(i.withCredentials),r.load(e,function(A){try{t(i.parse(A,o))}catch(l){n?n(l):console.error(l),i.manager.itemError(e)}},s,n)}parse(e,t){if(ma(e))ne=new fa().parse(e);else{const n=Pi(e);if(!Ia(n))throw new Error("THREE.FBXLoader: Unknown format.");if(ks(n)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+ks(n));ne=new ga().parse(n)}const s=new a.TextureLoader(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new ua(s,this.manager).parse(ne)}getFbxTree(){return ne}}class ua{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){we=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),s=this.parseMaterials(t),n=this.parseDeformers(),i=new da().parse(n);return this.parseScene(n,i,s),ke}parseConnections(){const e=new Map;return"Connections"in ne&&ne.Connections.connections.forEach(function(s){const n=s[0],i=s[1],o=s[2];e.has(n)||e.set(n,{parents:[],children:[]});const r={ID:i,relationship:o};e.get(n).parents.push(r),e.has(i)||e.set(i,{parents:[],children:[]});const A={ID:n,relationship:o};e.get(i).children.push(A)}),e}parseImages(){const e={},t={};if("Video"in ne.Objects){const s=ne.Objects.Video;for(const n in s){const i=s[n],o=parseInt(n);if(e[o]=i.RelativeFilename||i.Filename,"Content"in i){const r=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,A=typeof i.Content=="string"&&i.Content!=="";if(r||A){const l=this.parseImage(s[n]);t[i.RelativeFilename||i.Filename]=l}}}}for(const s in e){const n=e[s];t[n]!==void 0?e[s]=t[n]:e[s]=e[s].split("\\").pop()}return e}parseImage(e){const t=e.Content,s=e.RelativeFilename||e.Filename,n=s.slice(s.lastIndexOf(".")+1).toLowerCase();let i;switch(n){case"bmp":i="image/bmp";break;case"jpg":case"jpeg":i="image/jpeg";break;case"png":i="image/png";break;case"tif":i="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",s),i="image/tga";break;default:console.warn('FBXLoader: Image type "'+n+'" is not supported.');return}if(typeof t=="string")return"data:"+i+";base64,"+t;{const o=new Uint8Array(t);return window.URL.createObjectURL(new Blob([o],{type:i}))}}parseTextures(e){const t=new Map;if("Texture"in ne.Objects){const s=ne.Objects.Texture;for(const n in s){const i=this.parseTexture(s[n],e);t.set(parseInt(n),i)}}return t}parseTexture(e,t){const s=this.loadTexture(e,t);s.ID=e.id,s.name=e.attrName;const n=e.WrapModeU,i=e.WrapModeV,o=n!==void 0?n.value:0,r=i!==void 0?i.value:0;if(s.wrapS=o===0?a.RepeatWrapping:a.ClampToEdgeWrapping,s.wrapT=r===0?a.RepeatWrapping:a.ClampToEdgeWrapping,"Scaling"in e){const A=e.Scaling.value;s.repeat.x=A[0],s.repeat.y=A[1]}if("Translation"in e){const A=e.Translation.value;s.offset.x=A[0],s.offset.y=A[1]}return s}loadTexture(e,t){const s=new Set(["tga","tif","tiff","exr","dds","hdr","ktx2"]),n=e.FileName.split(".").pop().toLowerCase(),i=s.has(n)?this.manager.getHandler(`.${n}`):this.textureLoader;if(!i)return console.warn(`FBXLoader: ${n.toUpperCase()} loader not found, creating placeholder texture for`,e.RelativeFilename),new a.Texture;const o=i.path;o||i.setPath(this.textureLoader.path);const r=we.get(e.id).children;let A;r!==void 0&&r.length>0&&t[r[0].ID]!==void 0&&(A=t[r[0].ID],(A.indexOf("blob:")===0||A.indexOf("data:")===0)&&i.setPath(void 0));const l=i.load(A);return i.setPath(o),l}parseMaterials(e){const t=new Map;if("Material"in ne.Objects){const s=ne.Objects.Material;for(const n in s){const i=this.parseMaterial(s[n],e);i!==null&&t.set(parseInt(n),i)}}return t}parseMaterial(e,t){const s=e.id,n=e.attrName;let i=e.ShadingModel;if(typeof i=="object"&&(i=i.value),!we.has(s))return null;const o=this.parseParameters(e,t,s);let r;switch(i.toLowerCase()){case"phong":r=new a.MeshPhongMaterial;break;case"lambert":r=new a.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',i),r=new a.MeshPhongMaterial;break}return r.setValues(o),r.name=n,r}parseParameters(e,t,s){const n={};e.BumpFactor&&(n.bumpScale=e.BumpFactor.value),e.Diffuse?n.color=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.Diffuse.value),a.SRGBColorSpace):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(n.color=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.DiffuseColor.value),a.SRGBColorSpace)),e.DisplacementFactor&&(n.displacementScale=e.DisplacementFactor.value),e.Emissive?n.emissive=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.Emissive.value),a.SRGBColorSpace):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(n.emissive=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.EmissiveColor.value),a.SRGBColorSpace)),e.EmissiveFactor&&(n.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(n.opacity=parseFloat(e.Opacity.value)),n.opacity<1&&(n.transparent=!0),e.ReflectionFactor&&(n.reflectivity=e.ReflectionFactor.value),e.Shininess&&(n.shininess=e.Shininess.value),e.Specular?n.specular=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.Specular.value),a.SRGBColorSpace):e.SpecularColor&&e.SpecularColor.type==="Color"&&(n.specular=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.SpecularColor.value),a.SRGBColorSpace));const i=this;return we.get(s).children.forEach(function(o){const r=o.relationship;switch(r){case"Bump":n.bumpMap=i.getTexture(t,o.ID);break;case"Maya|TEX_ao_map":n.aoMap=i.getTexture(t,o.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":n.map=i.getTexture(t,o.ID),n.map!==void 0&&(n.map.colorSpace=a.SRGBColorSpace);break;case"DisplacementColor":n.displacementMap=i.getTexture(t,o.ID);break;case"EmissiveColor":n.emissiveMap=i.getTexture(t,o.ID),n.emissiveMap!==void 0&&(n.emissiveMap.colorSpace=a.SRGBColorSpace);break;case"NormalMap":case"Maya|TEX_normal_map":n.normalMap=i.getTexture(t,o.ID);break;case"ReflectionColor":n.envMap=i.getTexture(t,o.ID),n.envMap!==void 0&&(n.envMap.mapping=a.EquirectangularReflectionMapping,n.envMap.colorSpace=a.SRGBColorSpace);break;case"SpecularColor":n.specularMap=i.getTexture(t,o.ID),n.specularMap!==void 0&&(n.specularMap.colorSpace=a.SRGBColorSpace);break;case"TransparentColor":case"TransparencyFactor":n.alphaMap=i.getTexture(t,o.ID),n.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r);break}}),n}getTexture(e,t){return"LayeredTexture"in ne.Objects&&t in ne.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=we.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in ne.Objects){const s=ne.Objects.Deformer;for(const n in s){const i=s[n],o=we.get(parseInt(n));if(i.attrType==="Skin"){const r=this.parseSkeleton(o,s);r.ID=n,o.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),r.geometryID=o.parents[0].ID,e[n]=r}else if(i.attrType==="BlendShape"){const r={id:n};r.rawTargets=this.parseMorphTargets(o,s),r.id=n,o.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[n]=r}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const s=[];return e.children.forEach(function(n){const i=t[n.ID];if(i.attrType!=="Cluster")return;const o={ID:n.ID,indices:[],weights:[],transformLink:new a.Matrix4().fromArray(i.TransformLink.a)};"Indexes"in i&&(o.indices=i.Indexes.a,o.weights=i.Weights.a),s.push(o)}),{rawBones:s,bones:[]}}parseMorphTargets(e,t){const s=[];for(let n=0;n<e.children.length;n++){const i=e.children[n],o=t[i.ID],r={name:o.attrName,initialWeight:o.DeformPercent,id:o.id,fullWeights:o.FullWeights.a};if(o.attrType!=="BlendShapeChannel")return;r.geoID=we.get(parseInt(i.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,s.push(r)}return s}parseScene(e,t,s){ke=new a.Group;const n=this.parseModels(e.skeletons,t,s),i=ne.Objects.Model,o=this;n.forEach(function(A){const l=i[A.ID];o.setLookAtProperties(A,l),we.get(A.ID)?.parents?.forEach(function(u){const p=n.get(u.ID);p!==void 0&&p.add(A)}),A.parent===null&&ke.add(A)}),this.bindSkeleton(e.skeletons,t,n),this.addGlobalSceneSettings(),ke.traverse(function(A){if(A.userData.transformData){A.parent&&(A.userData.transformData.parentMatrix=A.parent.matrix,A.userData.transformData.parentMatrixWorld=A.parent.matrixWorld);const l=Ui(A.userData.transformData);A.applyMatrix4(l),A.updateWorldMatrix()}A.isSkinnedMesh&&(A.computeBoundingBox(),A.computeBoundingSphere(),A.boundingBox.expandByScalar(3),A.boundingSphere.radius*=3)});const r=new pa().parse();ke.children.length===1&&ke.children[0].isGroup&&(ke.children[0].animations=r,ke=ke.children[0]),ke.animations=r}parseModels(e,t,s){const n=new Map,i=ne.Objects.Model;for(const o in i){const r=parseInt(o),A=i[o],l=we.get(r);let h=this.buildSkeleton(l,e,r,A.attrName);if(!h){switch(A.attrType){case"Camera":h=this.createCamera(l);break;case"Light":h=this.createLight(l);break;case"Mesh":h=this.createMesh(l,t,s);break;case"NurbsCurve":h=this.createCurve(l,t);break;case"LimbNode":case"Root":h=new a.Bone;break;case"Null":default:h=new a.Group;break}h.name=A.attrName?a.PropertyBinding.sanitizeNodeName(A.attrName):"",h.userData.originalName=A.attrName,h.ID=r}this.getTransformData(h,A),n.set(r,h)}return n}buildSkeleton(e,t,s,n){let i=null;return e?.parents.forEach(function(o){for(const r in t){const A=t[r];A.rawBones.forEach(function(l,h){if(l.ID===o.ID){const u=i;i=new a.Bone,i.matrixWorld.copy(l.transformLink),i.name=n?a.PropertyBinding.sanitizeNodeName(n):"",i.userData.originalName=n,i.ID=s,A.bones[h]=i,u!==null&&i.add(u)}})}}),i}createCamera(e){let t,s;if(e.children.forEach(function(n){const i=ne.Objects.NodeAttribute[n.ID];i!==void 0&&(s=i)}),s===void 0)t=new a.Object3D;else{let n=0;s.CameraProjectionType!==void 0&&s.CameraProjectionType.value===1&&(n=1);let i=1;s.NearPlane!==void 0&&(i=s.NearPlane.value/1e3);let o=1e3;s.FarPlane!==void 0&&(o=s.FarPlane.value/1e3);let r=window.innerWidth,A=window.innerHeight;s.AspectWidth!==void 0&&s.AspectHeight!==void 0&&(r=s.AspectWidth.value,A=s.AspectHeight.value);const l=r/A;let h=45;s.FieldOfView!==void 0&&(h=s.FieldOfView.value);const u=s.FocalLength?s.FocalLength.value:null;switch(n){case 0:t=new a.PerspectiveCamera(h,l,i,o),u!==null&&t.setFocalLength(u);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new a.Object3D;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+n+"."),t=new a.Object3D;break}}return t}createLight(e){let t,s;if(e.children.forEach(function(n){const i=ne.Objects.NodeAttribute[n.ID];i!==void 0&&(s=i)}),s===void 0)t=new a.Object3D;else{let n;s.LightType===void 0?n=0:n=s.LightType.value;let i=16777215;s.Color!==void 0&&(i=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(s.Color.value),a.SRGBColorSpace));let o=s.Intensity===void 0?1:s.Intensity.value/100;s.CastLightOnObject!==void 0&&s.CastLightOnObject.value===0&&(o=0);let r=0;s.FarAttenuationEnd!==void 0&&(s.EnableFarAttenuation!==void 0&&s.EnableFarAttenuation.value===0?r=0:r=s.FarAttenuationEnd.value);const A=1;switch(n){case 0:t=new a.PointLight(i,o,r,A);break;case 1:t=new a.DirectionalLight(i,o);break;case 2:let l=Math.PI/3;s.InnerAngle!==void 0&&(l=a.MathUtils.degToRad(s.InnerAngle.value));let h=0;s.OuterAngle!==void 0&&(h=a.MathUtils.degToRad(s.OuterAngle.value),h=Math.max(h,1)),t=new a.SpotLight(i,o,r,l,h,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+s.LightType.value+", defaulting to a PointLight."),t=new a.PointLight(i,o);break}s.CastShadows!==void 0&&s.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,s){let n,i=null,o=null;const r=[];if(e.children.forEach(function(A){t.has(A.ID)&&(i=t.get(A.ID)),s.has(A.ID)&&r.push(s.get(A.ID))}),r.length>1?o=r:r.length>0?o=r[0]:(o=new a.MeshPhongMaterial({name:a.Loader.DEFAULT_MATERIAL_NAME,color:13421772}),r.push(o)),"color"in i.attributes&&r.forEach(function(A){A.vertexColors=!0}),i.groups.length>0){let A=!1;for(let l=0,h=i.groups.length;l<h;l++){const u=i.groups[l];(u.materialIndex<0||u.materialIndex>=r.length)&&(u.materialIndex=r.length,A=!0)}if(A){const l=new a.MeshStandardMaterial;r.push(l)}}return i.FBX_Deformer?(n=new a.SkinnedMesh(i,o),n.normalizeSkinWeights()):n=new a.Mesh(i,o),n}createCurve(e,t){const s=e.children.reduce(function(i,o){return t.has(o.ID)&&(i=t.get(o.ID)),i},null),n=new a.LineBasicMaterial({name:a.Loader.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new a.Line(s,n)}getTransformData(e,t){const s={};"InheritType"in t&&(s.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?s.eulerOrder=Zt(t.RotationOrder.value):s.eulerOrder=Zt(0),"Lcl_Translation"in t&&(s.translation=t.Lcl_Translation.value),"PreRotation"in t&&(s.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(s.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(s.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(s.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(s.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(s.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(s.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(s.rotationPivot=t.RotationPivot.value),e.userData.transformData=s}setLookAtProperties(e,t){"LookAtProperty"in t&&we.get(e.ID).children.forEach(function(n){if(n.relationship==="LookAtProperty"){const i=ne.Objects.Model[n.ID];if("Lcl_Translation"in i){const o=i.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(o),ke.add(e.target)):e.lookAt(new a.Vector3().fromArray(o))}}})}bindSkeleton(e,t,s){const n=this.parsePoseNodes();for(const i in e){const o=e[i];we.get(parseInt(o.ID)).parents.forEach(function(A){if(t.has(A.ID)){const l=A.ID;we.get(l).parents.forEach(function(u){s.has(u.ID)&&s.get(u.ID).bind(new a.Skeleton(o.bones),n[u.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in ne.Objects){const t=ne.Objects.Pose;for(const s in t)if(t[s].attrType==="BindPose"&&t[s].NbPoseNodes>0){const n=t[s].PoseNode;Array.isArray(n)?n.forEach(function(i){e[i.Node]=new a.Matrix4().fromArray(i.Matrix.a)}):e[n.Node]=new a.Matrix4().fromArray(n.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in ne){if("AmbientColor"in ne.GlobalSettings){const e=ne.GlobalSettings.AmbientColor.value,t=e[0],s=e[1],n=e[2];if(t!==0||s!==0||n!==0){const i=new a.Color().setRGB(t,s,n,a.SRGBColorSpace);ke.add(new a.AmbientLight(i,1))}}"UnitScaleFactor"in ne.GlobalSettings&&(ke.userData.unitScaleFactor=ne.GlobalSettings.UnitScaleFactor.value)}}}class da{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in ne.Objects){const s=ne.Objects.Geometry;for(const n in s){const i=we.get(parseInt(n)),o=this.parseGeometry(i,s[n],e);t.set(parseInt(n),o)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,s){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,s);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,s){const n=s.skeletons,i=[],o=e.parents.map(function(u){return ne.Objects.Model[u.ID]});if(o.length===0)return;const r=e.children.reduce(function(u,p){return n[p.ID]!==void 0&&(u=n[p.ID]),u},null);e.children.forEach(function(u){s.morphTargets[u.ID]!==void 0&&i.push(s.morphTargets[u.ID])});const A=o[0],l={};"RotationOrder"in A&&(l.eulerOrder=Zt(A.RotationOrder.value)),"InheritType"in A&&(l.inheritType=parseInt(A.InheritType.value)),"GeometricTranslation"in A&&(l.translation=A.GeometricTranslation.value),"GeometricRotation"in A&&(l.rotation=A.GeometricRotation.value),"GeometricScaling"in A&&(l.scale=A.GeometricScaling.value);const h=Ui(l);return this.genGeometry(t,r,i,h)}genGeometry(e,t,s,n){const i=new a.BufferGeometry;e.attrName&&(i.name=e.attrName);const o=this.parseGeoNode(e,t),r=this.genBuffers(o),A=new a.Float32BufferAttribute(r.vertex,3);if(A.applyMatrix4(n),i.setAttribute("position",A),r.colors.length>0&&i.setAttribute("color",new a.Float32BufferAttribute(r.colors,3)),t&&(i.setAttribute("skinIndex",new a.Uint16BufferAttribute(r.weightsIndices,4)),i.setAttribute("skinWeight",new a.Float32BufferAttribute(r.vertexWeights,4)),i.FBX_Deformer=t),r.normal.length>0){const l=new a.Matrix3().getNormalMatrix(n),h=new a.Float32BufferAttribute(r.normal,3);h.applyNormalMatrix(l),i.setAttribute("normal",h)}if(r.uvs.forEach(function(l,h){const u=h===0?"uv":`uv${h}`;i.setAttribute(u,new a.Float32BufferAttribute(r.uvs[h],2))}),o.material&&o.material.mappingType!=="AllSame"){let l=r.materialIndex[0],h=0;if(r.materialIndex.forEach(function(u,p){u!==l&&(i.addGroup(h,p-h,l),l=u,h=p)}),i.groups.length>0){const u=i.groups[i.groups.length-1],p=u.start+u.count;p!==r.materialIndex.length&&i.addGroup(p,r.materialIndex.length-p,l)}i.groups.length===0&&i.addGroup(0,r.materialIndex.length,r.materialIndex[0])}return this.addMorphTargets(i,e,s,n),i}parseGeoNode(e,t){const s={};if(s.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],s.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(s.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(s.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(s.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){s.uv=[];let n=0;for(;e.LayerElementUV[n];)e.LayerElementUV[n].UV&&s.uv.push(this.parseUVs(e.LayerElementUV[n])),n++}return s.weightTable={},t!==null&&(s.skeleton=t,t.rawBones.forEach(function(n,i){n.indices.forEach(function(o,r){s.weightTable[o]===void 0&&(s.weightTable[o]=[]),s.weightTable[o].push({id:i,weight:n.weights[r]})})})),s}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let s=0,n=0,i=!1,o=[],r=[],A=[],l=[],h=[],u=[];const p=this;return e.vertexIndices.forEach(function(g,f){let I,b=!1;g<0&&(g=g^-1,b=!0);let E=[],y=[];if(o.push(g*3,g*3+1,g*3+2),e.color){const C=on(f,s,g,e.color);A.push(C[0],C[1],C[2])}if(e.skeleton){if(e.weightTable[g]!==void 0&&e.weightTable[g].forEach(function(C){y.push(C.weight),E.push(C.id)}),y.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);const C=[0,0,0,0],w=[0,0,0,0];y.forEach(function(x,R){let D=x,S=E[R];w.forEach(function(v,N,G){if(D>v){G[N]=D,D=v;const O=C[N];C[N]=S,S=O}})}),E=C,y=w}for(;y.length<4;)y.push(0),E.push(0);for(let C=0;C<4;++C)h.push(y[C]),u.push(E[C])}if(e.normal){const C=on(f,s,g,e.normal);r.push(C[0],C[1],C[2])}e.material&&e.material.mappingType!=="AllSame"&&(I=on(f,s,g,e.material)[0],I<0&&(p.negativeMaterialIndices=!0,I=0)),e.uv&&e.uv.forEach(function(C,w){const x=on(f,s,g,C);l[w]===void 0&&(l[w]=[]),l[w].push(x[0]),l[w].push(x[1])}),n++,b&&(p.genFace(t,e,o,I,r,A,l,h,u,n),s++,n=0,o=[],r=[],A=[],l=[],h=[],u=[])}),t}getNormalNewell(e){const t=new a.Vector3(0,0,0);for(let s=0;s<e.length;s++){const n=e[s],i=e[(s+1)%e.length];t.x+=(n.y-i.y)*(n.z+i.z),t.y+=(n.z-i.z)*(n.x+i.x),t.z+=(n.x-i.x)*(n.y+i.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),n=(Math.abs(t.z)>.5?new a.Vector3(0,1,0):new a.Vector3(0,0,1)).cross(t).normalize(),i=t.clone().cross(n).normalize();return{normal:t,tangent:n,bitangent:i}}flattenVertex(e,t,s){return new a.Vector2(e.dot(t),e.dot(s))}genFace(e,t,s,n,i,o,r,A,l,h){let u;if(h>3){const p=[],g=t.baseVertexPositions||t.vertexPositions;for(let E=0;E<s.length;E+=3)p.push(new a.Vector3(g[s[E]],g[s[E+1]],g[s[E+2]]));const{tangent:f,bitangent:I}=this.getNormalTangentAndBitangent(p),b=[];for(const E of p)b.push(this.flattenVertex(E,f,I));u=a.ShapeUtils.triangulateShape(b,[])}else h===2?(console.warn("THREE.FBXLoader: Edge topology detected. This is currently not supported. The resulting mesh will not be correct."),u=[[0,1,2]]):u=[[0,1,2]];for(const[p,g,f]of u)e.vertex.push(t.vertexPositions[s[p*3]]),e.vertex.push(t.vertexPositions[s[p*3+1]]),e.vertex.push(t.vertexPositions[s[p*3+2]]),e.vertex.push(t.vertexPositions[s[g*3]]),e.vertex.push(t.vertexPositions[s[g*3+1]]),e.vertex.push(t.vertexPositions[s[g*3+2]]),e.vertex.push(t.vertexPositions[s[f*3]]),e.vertex.push(t.vertexPositions[s[f*3+1]]),e.vertex.push(t.vertexPositions[s[f*3+2]]),t.skeleton&&(e.vertexWeights.push(A[p*4]),e.vertexWeights.push(A[p*4+1]),e.vertexWeights.push(A[p*4+2]),e.vertexWeights.push(A[p*4+3]),e.vertexWeights.push(A[g*4]),e.vertexWeights.push(A[g*4+1]),e.vertexWeights.push(A[g*4+2]),e.vertexWeights.push(A[g*4+3]),e.vertexWeights.push(A[f*4]),e.vertexWeights.push(A[f*4+1]),e.vertexWeights.push(A[f*4+2]),e.vertexWeights.push(A[f*4+3]),e.weightsIndices.push(l[p*4]),e.weightsIndices.push(l[p*4+1]),e.weightsIndices.push(l[p*4+2]),e.weightsIndices.push(l[p*4+3]),e.weightsIndices.push(l[g*4]),e.weightsIndices.push(l[g*4+1]),e.weightsIndices.push(l[g*4+2]),e.weightsIndices.push(l[g*4+3]),e.weightsIndices.push(l[f*4]),e.weightsIndices.push(l[f*4+1]),e.weightsIndices.push(l[f*4+2]),e.weightsIndices.push(l[f*4+3])),t.color&&(e.colors.push(o[p*3]),e.colors.push(o[p*3+1]),e.colors.push(o[p*3+2]),e.colors.push(o[g*3]),e.colors.push(o[g*3+1]),e.colors.push(o[g*3+2]),e.colors.push(o[f*3]),e.colors.push(o[f*3+1]),e.colors.push(o[f*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(n),e.materialIndex.push(n),e.materialIndex.push(n)),t.normal&&(e.normal.push(i[p*3]),e.normal.push(i[p*3+1]),e.normal.push(i[p*3+2]),e.normal.push(i[g*3]),e.normal.push(i[g*3+1]),e.normal.push(i[g*3+2]),e.normal.push(i[f*3]),e.normal.push(i[f*3+1]),e.normal.push(i[f*3+2])),t.uv&&t.uv.forEach(function(I,b){e.uvs[b]===void 0&&(e.uvs[b]=[]),e.uvs[b].push(r[b][p*2]),e.uvs[b].push(r[b][p*2+1]),e.uvs[b].push(r[b][g*2]),e.uvs[b].push(r[b][g*2+1]),e.uvs[b].push(r[b][f*2]),e.uvs[b].push(r[b][f*2+1])})}addMorphTargets(e,t,s,n){if(s.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const i=this;s.forEach(function(o){o.rawTargets.forEach(function(r){const A=ne.Objects.Geometry[r.geoID];A!==void 0&&i.genMorphGeometry(e,t,A,n,r.name)})})}genMorphGeometry(e,t,s,n,i){const o=t.Vertices!==void 0?t.Vertices.a:[],r=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=s.Vertices!==void 0?s.Vertices.a:[],l=s.Indexes!==void 0?s.Indexes.a:[],h=e.attributes.position.count*3,u=new Float32Array(h);for(let I=0;I<l.length;I++){const b=l[I]*3;u[b]=A[I*3],u[b+1]=A[I*3+1],u[b+2]=A[I*3+2]}const p={vertexIndices:r,vertexPositions:u,baseVertexPositions:o},g=this.genBuffers(p),f=new a.Float32BufferAttribute(g.vertex,3);f.name=i||s.attrName,f.applyMatrix4(n),e.morphAttributes.position.push(f)}parseNormals(e){const t=e.MappingInformationType,s=e.ReferenceInformationType,n=e.Normals.a;let i=[];return s==="IndexToDirect"&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:n,indices:i,mappingType:t,referenceType:s}}parseUVs(e){const t=e.MappingInformationType,s=e.ReferenceInformationType,n=e.UV.a;let i=[];return s==="IndexToDirect"&&(i=e.UVIndex.a),{dataSize:2,buffer:n,indices:i,mappingType:t,referenceType:s}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,s=e.ReferenceInformationType,n=e.Colors.a;let i=[];s==="IndexToDirect"&&(i=e.ColorIndex.a);for(let o=0,r=new a.Color;o<n.length;o+=4)r.fromArray(n,o),a.ColorManagement.toWorkingColorSpace(r,a.SRGBColorSpace),r.toArray(n,o);return{dataSize:4,buffer:n,indices:i,mappingType:t,referenceType:s}}parseMaterialIndices(e){const t=e.MappingInformationType,s=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:s};const n=e.Materials.a,i=[];for(let o=0;o<n.length;++o)i.push(o);return{dataSize:1,buffer:n,indices:i,mappingType:t,referenceType:s}}parseNurbsGeometry(e){const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new a.BufferGeometry;const s=t-1,n=e.KnotVector.a,i=[],o=e.Points.a;for(let u=0,p=o.length;u<p;u+=4)i.push(new a.Vector4().fromArray(o,u));let r,A;if(e.Form==="Closed")i.push(i[0]);else if(e.Form==="Periodic"){r=s,A=n.length-1-r;for(let u=0;u<s;++u)i.push(i[u])}const h=new la(s,n,i,r,A).getPoints(i.length*12);return new a.BufferGeometry().setFromPoints(h)}}class pa{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const s in t){const n=t[s],i=this.addClip(n);e.push(i)}return e}parseClips(){if(ne.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=ne.Objects.AnimationCurveNode,t=new Map;for(const s in e){const n=e[s];if(n.attrName.match(/S|R|T|DeformPercent/)!==null){const i={id:n.id,attr:n.attrName,curves:{}};t.set(i.id,i)}}return t}parseAnimationCurves(e){const t=ne.Objects.AnimationCurve;for(const s in t){const n={id:t[s].id,times:t[s].KeyTime.a.map(ba),values:t[s].KeyValueFloat.a},i=we.get(n.id);if(i!==void 0){const o=i.parents[0].ID,r=i.parents[0].relationship;r.match(/X/)?e.get(o).curves.x=n:r.match(/Y/)?e.get(o).curves.y=n:r.match(/Z/)?e.get(o).curves.z=n:r.match(/DeformPercent/)&&e.has(o)&&(e.get(o).curves.morph=n)}}}parseAnimationLayers(e){const t=ne.Objects.AnimationLayer,s=new Map;for(const n in t){const i=[],o=we.get(parseInt(n));o!==void 0&&(o.children.forEach(function(A,l){if(e.has(A.ID)){const h=e.get(A.ID);if(h.curves.x!==void 0||h.curves.y!==void 0||h.curves.z!==void 0){if(i[l]===void 0){const u=we.get(A.ID).parents.filter(function(p){return p.relationship!==void 0})[0].ID;if(u!==void 0){const p=ne.Objects.Model[u.toString()];if(p===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",A);return}const g={modelName:p.attrName?a.PropertyBinding.sanitizeNodeName(p.attrName):"",ID:p.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};ke.traverse(function(f){f.ID===p.id&&(g.transform=f.matrix,f.userData.transformData&&(g.eulerOrder=f.userData.transformData.eulerOrder))}),g.transform||(g.transform=new a.Matrix4),"PreRotation"in p&&(g.preRotation=p.PreRotation.value),"PostRotation"in p&&(g.postRotation=p.PostRotation.value),i[l]=g}}i[l]&&(i[l][h.attr]=h)}else if(h.curves.morph!==void 0){if(i[l]===void 0){const u=we.get(A.ID).parents.filter(function(E){return E.relationship!==void 0})[0].ID,p=we.get(u).parents[0].ID,g=we.get(p).parents[0].ID,f=we.get(g).parents[0].ID,I=ne.Objects.Model[f],b={modelName:I.attrName?a.PropertyBinding.sanitizeNodeName(I.attrName):"",morphName:ne.Objects.Deformer[u].attrName};i[l]=b}i[l][h.attr]=h}}}),s.set(parseInt(n),i))}return s}parseAnimStacks(e){const t=ne.Objects.AnimationStack,s={};for(const n in t){const i=we.get(parseInt(n)).children;i.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const o=e.get(i[0].ID);s[n]={name:t[n].attrName,layer:o}}return s}addClip(e){let t=[];const s=this;return e.layer.forEach(function(n){t=t.concat(s.generateTracks(n))}),new a.AnimationClip(e.name,-1,t)}generateTracks(e){const t=[];let s=new a.Vector3,n=new a.Vector3;if(e.transform&&e.transform.decompose(s,new a.Quaternion,n),s=s.toArray(),n=n.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.T.curves,s,"position");i!==void 0&&t.push(i)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const i=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);i!==void 0&&t.push(i)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.S.curves,n,"scale");i!==void 0&&t.push(i)}if(e.DeformPercent!==void 0){const i=this.generateMorphTrack(e);i!==void 0&&t.push(i)}return t}generateVectorTrack(e,t,s,n){const i=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(i,t,s);return new a.VectorKeyframeTrack(e+"."+n,i,o)}generateRotationTrack(e,t,s,n,i){let o,r;if(t.x===void 0||t.y===void 0||t.z===void 0){console.warn("THREE.FBXLoader: Missing rotation curves "+(t.x===void 0?"x ":"")+(t.y===void 0?"y ":"")+(t.z===void 0?"z ":"")+" for animation of "+e+". This is currently not supported.");return}if(t.x!==void 0&&t.y!==void 0&&t.z!==void 0){const p=this.interpolateRotations(t.x,t.y,t.z,i);o=p[0],r=p[1]}const A=Zt(0);s!==void 0&&(s=s.map(a.MathUtils.degToRad),s.push(A),s=new a.Euler().fromArray(s),s=new a.Quaternion().setFromEuler(s)),n!==void 0&&(n=n.map(a.MathUtils.degToRad),n.push(A),n=new a.Euler().fromArray(n),n=new a.Quaternion().setFromEuler(n).invert());const l=new a.Quaternion,h=new a.Euler,u=[];if(!(!r||!o)){for(let p=0;p<r.length;p+=3)h.set(r[p],r[p+1],r[p+2],i),l.setFromEuler(h),s!==void 0&&l.premultiply(s),n!==void 0&&l.multiply(n),p>2&&new a.Quaternion().fromArray(u,(p-3)/3*4).dot(l)<0&&l.set(-l.x,-l.y,-l.z,-l.w),l.toArray(u,p/3*4);return new a.QuaternionKeyframeTrack(e+".quaternion",o,u)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,s=t.values.map(function(i){return i/100}),n=ke.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new a.NumberKeyframeTrack(e.modelName+".morphTargetInfluences["+n+"]",t.times,s)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(s,n){return s-n}),t.length>1){let s=1,n=t[0];for(let i=1;i<t.length;i++){const o=t[i];o!==n&&(t[s]=o,n=o,s++)}t=t.slice(0,s)}return t}getKeyframeTrackValues(e,t,s){const n=s,i=[];let o=-1,r=-1,A=-1;return e.forEach(function(l){if(t.x&&(o=t.x.times.indexOf(l)),t.y&&(r=t.y.times.indexOf(l)),t.z&&(A=t.z.times.indexOf(l)),o!==-1){const h=t.x.values[o];i.push(h),n[0]=h}else i.push(n[0]);if(r!==-1){const h=t.y.values[r];i.push(h),n[1]=h}else i.push(n[1]);if(A!==-1){const h=t.z.values[A];i.push(h),n[2]=h}else i.push(n[2])}),i}interpolateRotations(e,t,s,n){const i=[],o=[];i.push(e.times[0]),o.push(a.MathUtils.degToRad(e.values[0])),o.push(a.MathUtils.degToRad(t.values[0])),o.push(a.MathUtils.degToRad(s.values[0]));for(let r=1;r<e.values.length;r++){const A=[e.values[r-1],t.values[r-1],s.values[r-1]];if(isNaN(A[0])||isNaN(A[1])||isNaN(A[2]))continue;const l=A.map(a.MathUtils.degToRad),h=[e.values[r],t.values[r],s.values[r]];if(isNaN(h[0])||isNaN(h[1])||isNaN(h[2]))continue;const u=h.map(a.MathUtils.degToRad),p=[h[0]-A[0],h[1]-A[1],h[2]-A[2]],g=[Math.abs(p[0]),Math.abs(p[1]),Math.abs(p[2])];if(g[0]>=180||g[1]>=180||g[2]>=180){const I=Math.max(...g)/180,b=new a.Euler(...l,n),E=new a.Euler(...u,n),y=new a.Quaternion().setFromEuler(b),C=new a.Quaternion().setFromEuler(E);y.dot(C)&&C.set(-C.x,-C.y,-C.z,-C.w);const w=e.times[r-1],x=e.times[r]-w,R=new a.Quaternion,D=new a.Euler;for(let S=0;S<1;S+=1/I)R.copy(y.clone().slerp(C.clone(),S)),i.push(w+S*x),D.setFromQuaternion(R,n),o.push(D.x),o.push(D.y),o.push(D.z)}else i.push(e.times[r]),o.push(a.MathUtils.degToRad(e.values[r])),o.push(a.MathUtils.degToRad(t.values[r])),o.push(a.MathUtils.degToRad(s.values[r]))}return[i,o]}}class ga{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new Gi,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,s=e.split(/[\r\n]+/);return s.forEach(function(n,i){const o=n.match(/^[\s\t]*;/),r=n.match(/^[\s\t]*$/);if(o||r)return;const A=n.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),l=n.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),h=n.match("^\\t{"+(t.currentIndent-1)+"}}");A?t.parseNodeBegin(n,A):l?t.parseNodeProperty(n,l,s[++i]):h?t.popStack():n.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(n)}),this.allNodes}parseNodeBegin(e,t){const s=t[1].trim().replace(/^"/,"").replace(/"$/,""),n=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),i={name:s},o=this.parseNodeAttr(n),r=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(s,i):s in r?(s==="PoseNode"?r.PoseNode.push(i):r[s].id!==void 0&&(r[s]={},r[s][r[s].id]=r[s]),o.id!==""&&(r[s][o.id]=i)):typeof o.id=="number"?(r[s]={},r[s][o.id]=i):s!=="Properties70"&&(s==="PoseNode"?r[s]=[i]:r[s]=i),typeof o.id=="number"&&(i.id=o.id),o.name!==""&&(i.attrName=o.name),o.type!==""&&(i.attrType=o.type),this.pushStack(i)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let s="",n="";return e.length>1&&(s=e[1].replace(/^(\w+)::/,""),n=e[2]),{id:t,name:s,type:n}}parseNodeProperty(e,t,s){let n=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();n==="Content"&&i===","&&(i=s.replace(/"/g,"").replace(/,$/,"").trim());const o=this.getCurrentNode();if(o.name==="Properties70"){this.parseNodeSpecialProperty(e,n,i);return}if(n==="C"){const A=i.split(",").slice(1),l=parseInt(A[0]),h=parseInt(A[1]);let u=i.split(",").slice(3);u=u.map(function(p){return p.trim().replace(/^"/,"")}),n="connections",i=[l,h],Ca(i,u),o[n]===void 0&&(o[n]=[])}n==="Node"&&(o.id=i),n in o&&Array.isArray(o[n])?o[n].push(i):n!=="a"?o[n]=i:o.a=i,this.setCurrentProp(o,n),n==="a"&&i.slice(-1)!==","&&(o.a=Ln(i))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=Ln(t.a))}parseNodeSpecialProperty(e,t,s){const n=s.split('",').map(function(h){return h.trim().replace(/^\"/,"").replace(/\s/,"_")}),i=n[0],o=n[1],r=n[2],A=n[3];let l=n[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=Ln(l);break}this.getPrevNode()[i]={type:o,type2:r,flag:A,value:l},this.setCurrentProp(this.getPrevNode(),i)}}class fa{parse(e){const t=new Ls(e);t.skip(23);const s=t.getUint32();if(s<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+s);const n=new Gi;for(;!this.endOfContent(t);){const i=this.parseNode(t,s);i!==null&&n.add(i.name,i)}return n}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const s={},n=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const o=e.getUint8(),r=e.getString(o);if(n===0)return null;const A=[];for(let p=0;p<i;p++)A.push(this.parseProperty(e));const l=A.length>0?A[0]:"",h=A.length>1?A[1]:"",u=A.length>2?A[2]:"";for(s.singleProperty=i===1&&e.getOffset()===n;n>e.getOffset();){const p=this.parseNode(e,t);p!==null&&this.parseSubNode(r,s,p)}return s.propertyList=A,typeof l=="number"&&(s.id=l),h!==""&&(s.attrName=h),u!==""&&(s.attrType=u),r!==""&&(s.name=r),s}parseSubNode(e,t,s){if(s.singleProperty===!0){const n=s.propertyList[0];Array.isArray(n)?(t[s.name]=s,s.a=n):t[s.name]=n}else if(e==="Connections"&&s.name==="C"){const n=[];s.propertyList.forEach(function(i,o){o!==0&&n.push(i)}),t.connections===void 0&&(t.connections=[]),t.connections.push(n)}else if(s.name==="Properties70")Object.keys(s).forEach(function(i){t[i]=s[i]});else if(e==="Properties70"&&s.name==="P"){let n=s.propertyList[0],i=s.propertyList[1];const o=s.propertyList[2],r=s.propertyList[3];let A;n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),i.indexOf("Lcl ")===0&&(i=i.replace("Lcl ","Lcl_")),i==="Color"||i==="ColorRGB"||i==="Vector"||i==="Vector3D"||i.indexOf("Lcl_")===0?A=[s.propertyList[4],s.propertyList[5],s.propertyList[6]]:A=s.propertyList[4],t[n]={type:i,type2:o,flag:r,value:A}}else t[s.name]===void 0?typeof s.id=="number"?(t[s.name]={},t[s.name][s.id]=s):t[s.name]=s:s.name==="PoseNode"?(Array.isArray(t[s.name])||(t[s.name]=[t[s.name]]),t[s.name].push(s)):t[s.name][s.id]===void 0&&(t[s.name][s.id]=s)}parseProperty(e){const t=e.getString(1);let s;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return s=e.getUint32(),e.getArrayBuffer(s);case"S":return s=e.getUint32(),e.getString(s);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const n=e.getUint32(),i=e.getUint32(),o=e.getUint32();if(i===0)switch(t){case"b":case"c":return e.getBooleanArray(n);case"d":return e.getFloat64Array(n);case"f":return e.getFloat32Array(n);case"i":return e.getInt32Array(n);case"l":return e.getInt64Array(n)}const r=Vt(new Uint8Array(e.getArrayBuffer(o))),A=new Ls(r.buffer);switch(t){case"b":case"c":return A.getBooleanArray(n);case"d":return A.getFloat64Array(n);case"f":return A.getFloat32Array(n);case"i":return A.getInt32Array(n);case"l":return A.getInt64Array(n)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class Ls{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){const t=[];for(let s=0;s<e;s++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t&2147483648?(t=~t&4294967295,e=~e&4294967295,e===4294967295&&(t=t+1&4294967295),e=e+1&4294967295,-(t*4294967296+e)):t*4294967296+e}getInt64Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t*4294967296+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){const t=this.offset;let s=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const n=s.indexOf(0);return n>=0&&(s=new Uint8Array(this.dv.buffer,t,n)),this._textDecoder.decode(s)}}class Gi{add(e,t){this[e]=t}}function ma(c){const e="Kaydara FBX Binary \0";return c.byteLength>=e.length&&e===Pi(c,0,e.length)}function Ia(c){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function s(n){const i=c[n-1];return c=c.slice(t+n),t++,i}for(let n=0;n<e.length;++n)if(s(1)===e[n])return!1;return!0}function ks(c){const e=/FBXVersion: (\d+)/,t=c.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function ba(c){return c/46186158e3}const Ea=[];function on(c,e,t,s){let n;switch(s.mappingType){case"ByPolygonVertex":n=c;break;case"ByPolygon":n=e;break;case"ByVertice":n=t;break;case"AllSame":n=s.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+s.mappingType)}s.referenceType==="IndexToDirect"&&(n=s.indices[n]);const i=n*s.dataSize,o=i+s.dataSize;return Ba(Ea,s.buffer,i,o)}const Fn=new a.Euler,Mt=new a.Vector3;function Ui(c){const e=new a.Matrix4,t=new a.Matrix4,s=new a.Matrix4,n=new a.Matrix4,i=new a.Matrix4,o=new a.Matrix4,r=new a.Matrix4,A=new a.Matrix4,l=new a.Matrix4,h=new a.Matrix4,u=new a.Matrix4,p=new a.Matrix4,g=c.inheritType?c.inheritType:0;c.translation&&e.setPosition(Mt.fromArray(c.translation));const f=Zt(0);if(c.preRotation){const G=c.preRotation.map(a.MathUtils.degToRad);G.push(f),t.makeRotationFromEuler(Fn.fromArray(G))}if(c.rotation){const G=c.rotation.map(a.MathUtils.degToRad);G.push(c.eulerOrder||f),s.makeRotationFromEuler(Fn.fromArray(G))}if(c.postRotation){const G=c.postRotation.map(a.MathUtils.degToRad);G.push(f),n.makeRotationFromEuler(Fn.fromArray(G)),n.invert()}c.scale&&i.scale(Mt.fromArray(c.scale)),c.scalingOffset&&r.setPosition(Mt.fromArray(c.scalingOffset)),c.scalingPivot&&o.setPosition(Mt.fromArray(c.scalingPivot)),c.rotationOffset&&A.setPosition(Mt.fromArray(c.rotationOffset)),c.rotationPivot&&l.setPosition(Mt.fromArray(c.rotationPivot)),c.parentMatrixWorld&&(u.copy(c.parentMatrix),h.copy(c.parentMatrixWorld));const I=t.clone().multiply(s).multiply(n),b=new a.Matrix4;b.extractRotation(h);const E=new a.Matrix4;E.copyPosition(h);const y=E.clone().invert().multiply(h),C=b.clone().invert().multiply(y),w=i,x=new a.Matrix4;if(g===0)x.copy(b).multiply(I).multiply(C).multiply(w);else if(g===1)x.copy(b).multiply(C).multiply(I).multiply(w);else{const O=new a.Matrix4().scale(new a.Vector3().setFromMatrixScale(u)).clone().invert(),X=C.clone().multiply(O);x.copy(b).multiply(I).multiply(X).multiply(w)}const R=l.clone().invert(),D=o.clone().invert();let S=e.clone().multiply(A).multiply(l).multiply(t).multiply(s).multiply(n).multiply(R).multiply(r).multiply(o).multiply(i).multiply(D);const v=new a.Matrix4().copyPosition(S),N=h.clone().multiply(v);return p.copyPosition(N),S=p.clone().multiply(x),S.premultiply(h.invert()),S}function Zt(c){c=c||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return c===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[c]}function Ln(c){return c.split(",").map(function(t){return parseFloat(t)})}function Pi(c,e,t){return e===void 0&&(e=0),t===void 0&&(t=c.byteLength),new TextDecoder().decode(new Uint8Array(c,e,t))}function Ca(c,e){for(let t=0,s=c.length,n=e.length;t<n;t++,s++)c[s]=e[t]}function Ba(c,e,t,s){for(let n=t,i=0;n<s;n++,i++)c[i]=e[n];return c}class ya extends a.Loader{constructor(e){super(e)}load(e,t,s,n){const i=this,o=this.path===""?a.LoaderUtils.extractUrlBase(e):this.path,r=new a.FileLoader(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(A){try{t(i.parse(A,o))}catch(l){n?n(l):console.error(l),i.manager.itemError(e)}},s,n)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const s=e.split(`
46
- `);let n={};const i=/\s+/,o={};for(let A=0;A<s.length;A++){let l=s[A];if(l=l.trim(),l.length===0||l.charAt(0)==="#")continue;const h=l.indexOf(" ");let u=h>=0?l.substring(0,h):l;u=u.toLowerCase();let p=h>=0?l.substring(h+1):"";if(p=p.trim(),u==="newmtl")n={name:p},o[p]=n;else if(u==="ka"||u==="kd"||u==="ks"||u==="ke"){const g=p.split(i,3);n[u]=[parseFloat(g[0]),parseFloat(g[1]),parseFloat(g[2])]}else n[u]=p}const r=new wa(this.resourcePath||t,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(o),r}}class wa{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:a.FrontSide,this.wrap=this.options.wrap!==void 0?this.options.wrap:a.RepeatWrapping}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const s in e){const n=e[s],i={};t[s]=i;for(const o in n){let r=!0,A=n[o];const l=o.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(A=[A[0]/255,A[1]/255,A[2]/255]),this.options&&this.options.ignoreZeroRGBs&&A[0]===0&&A[1]===0&&A[2]===0&&(r=!1);break}r&&(i[l]=A)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,s=this.materialsInfo[e],n={name:e,side:this.side};function i(r,A){return typeof A!="string"||A===""?"":/^https?:\/\//i.test(A)?A:r+A}function o(r,A){if(n[r])return;const l=t.getTextureParams(A,n),h=t.loadTexture(i(t.baseUrl,l.url));h.repeat.copy(l.scale),h.offset.copy(l.offset),h.wrapS=t.wrap,h.wrapT=t.wrap,(r==="map"||r==="emissiveMap")&&(h.colorSpace=a.SRGBColorSpace),n[r]=h}for(const r in s){const A=s[r];let l;if(A!=="")switch(r.toLowerCase()){case"kd":n.color=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(A),a.SRGBColorSpace);break;case"ks":n.specular=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(A),a.SRGBColorSpace);break;case"ke":n.emissive=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(A),a.SRGBColorSpace);break;case"map_kd":o("map",A);break;case"map_ks":o("specularMap",A);break;case"map_ke":o("emissiveMap",A);break;case"norm":o("normalMap",A);break;case"map_bump":case"bump":o("bumpMap",A);break;case"map_d":o("alphaMap",A),n.transparent=!0;break;case"ns":n.shininess=parseFloat(A);break;case"d":l=parseFloat(A),l<1&&(n.opacity=l,n.transparent=!0);break;case"tr":l=parseFloat(A),this.options&&this.options.invertTrProperty&&(l=1-l),l>0&&(n.opacity=1-l,n.transparent=!0);break}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]}getTextureParams(e,t){const s={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},n=e.split(/\s+/);let i;return i=n.indexOf("-bm"),i>=0&&(t.bumpScale=parseFloat(n[i+1]),n.splice(i,2)),i=n.indexOf("-s"),i>=0&&(s.scale.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),i=n.indexOf("-o"),i>=0&&(s.offset.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),s.url=n.join(" ").trim(),s}loadTexture(e,t,s,n,i){const o=this.manager!==void 0?this.manager:a.DefaultLoadingManager;let r=o.getHandler(e);r===null&&(r=new a.TextureLoader(o)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const A=r.load(e,s,n,i);return t!==void 0&&(A.mapping=t),A}}const Qa=/^[og]\s*(.+)?/,xa=/^mtllib /,Sa=/^usemtl /,Ta=/^usemap /,Ns=/\s+/,Gs=new a.Vector3,kn=new a.Vector3,Us=new a.Vector3,Ps=new a.Vector3,Je=new a.Vector3,rn=new a.Color;function va(){const c={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}const s=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(n,i){const o=this._finalize(!1);o&&(o.inherited||o.groupCount<=0)&&this.materials.splice(o.index,1);const r={index:this.materials.length,name:n||"",mtllib:Array.isArray(i)&&i.length>0?i[i.length-1]:"",smooth:o!==void 0?o.smooth:this.smooth,groupStart:o!==void 0?o.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(A){const l={index:typeof A=="number"?A:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return l.clone=this.clone.bind(l),l}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(n){const i=this.currentMaterial();if(i&&i.groupEnd===-1&&(i.groupEnd=this.geometry.vertices.length/3,i.groupCount=i.groupEnd-i.groupStart,i.inherited=!1),n&&this.materials.length>1)for(let o=this.materials.length-1;o>=0;o--)this.materials[o].groupCount<=0&&this.materials.splice(o,1);return n&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),i}},s&&s.name&&typeof s.clone=="function"){const n=s.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const s=parseInt(e,10);return(s>=0?s-1:s+t/3)*3},parseNormalIndex:function(e,t){const s=parseInt(e,10);return(s>=0?s-1:s+t/3)*3},parseUVIndex:function(e,t){const s=parseInt(e,10);return(s>=0?s-1:s+t/2)*2},addVertex:function(e,t,s){const n=this.vertices,i=this.object.geometry.vertices;i.push(n[e+0],n[e+1],n[e+2]),i.push(n[t+0],n[t+1],n[t+2]),i.push(n[s+0],n[s+1],n[s+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,s){const n=this.normals,i=this.object.geometry.normals;i.push(n[e+0],n[e+1],n[e+2]),i.push(n[t+0],n[t+1],n[t+2]),i.push(n[s+0],n[s+1],n[s+2])},addFaceNormal:function(e,t,s){const n=this.vertices,i=this.object.geometry.normals;Gs.fromArray(n,e),kn.fromArray(n,t),Us.fromArray(n,s),Je.subVectors(Us,kn),Ps.subVectors(Gs,kn),Je.cross(Ps),Je.normalize(),i.push(Je.x,Je.y,Je.z),i.push(Je.x,Je.y,Je.z),i.push(Je.x,Je.y,Je.z)},addColor:function(e,t,s){const n=this.colors,i=this.object.geometry.colors;n[e]!==void 0&&i.push(n[e+0],n[e+1],n[e+2]),n[t]!==void 0&&i.push(n[t+0],n[t+1],n[t+2]),n[s]!==void 0&&i.push(n[s+0],n[s+1],n[s+2])},addUV:function(e,t,s){const n=this.uvs,i=this.object.geometry.uvs;i.push(n[e+0],n[e+1]),i.push(n[t+0],n[t+1]),i.push(n[s+0],n[s+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,s,n,i,o,r,A,l){const h=this.vertices.length;let u=this.parseVertexIndex(e,h),p=this.parseVertexIndex(t,h),g=this.parseVertexIndex(s,h);if(this.addVertex(u,p,g),this.addColor(u,p,g),r!==void 0&&r!==""){const f=this.normals.length;u=this.parseNormalIndex(r,f),p=this.parseNormalIndex(A,f),g=this.parseNormalIndex(l,f),this.addNormal(u,p,g)}else this.addFaceNormal(u,p,g);if(n!==void 0&&n!==""){const f=this.uvs.length;u=this.parseUVIndex(n,f),p=this.parseUVIndex(i,f),g=this.parseUVIndex(o,f),this.addUV(u,p,g),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let s=0,n=e.length;s<n;s++){const i=this.parseVertexIndex(e[s],t);this.addVertexPoint(i),this.addColor(i)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const s=this.vertices.length,n=this.uvs.length;for(let i=0,o=e.length;i<o;i++)this.addVertexLine(this.parseVertexIndex(e[i],s));for(let i=0,o=t.length;i<o;i++)this.addUVLine(this.parseUVIndex(t[i],n))}};return c.startObject("",!1),c}class Ma extends a.Loader{constructor(e){super(e),this.materials=null,this.materialsLoader=new ya(e)}load(e,t,s,n){const i=this,o=new a.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,async function(r){try{const A=i.parse(r,!0);for(let l=0,h=A.materialLibraries.length;l<h;l++){const u=A.materialLibraries[l],p=e.startsWith("blob:")?e+"/"+u:new URL(u,e);console.debug("Loading MTL file: "+p),await new Promise((g,f)=>{i.materialsLoader.load(p.toString(),I=>{i.setMaterials(I),g()},null,f)})}t(i.createObjects(A))}catch(A){n?n(A):console.error(A),i.manager.itemError(e)}},s,n)}setMTLLoader(e){return this.materialsLoader=e,this}setMaterials(e){return this.materials=e,this}parse(e,t=!1){const s=new va;e.indexOf(`\r
41
+ */var Qe=Uint8Array,qe=Uint16Array,ns=Int32Array,gn=new Qe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fn=new Qe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Yn=new Qe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ri=function(c,e){for(var t=new qe(31),s=0;s<31;++s)t[s]=e+=1<<c[s-1];for(var n=new ns(t[30]),s=1;s<30;++s)for(var i=t[s];i<t[s+1];++i)n[i]=i-t[s]<<5|s;return{b:t,r:n}},_i=Ri(gn,2),Di=_i.b,Vn=_i.r;Di[28]=258,Vn[258]=28;var Fi=Ri(fn,0),ea=Fi.b,Rs=Fi.r,Jn=new qe(32768);for(var Ee=0;Ee<32768;++Ee){var ft=(Ee&43690)>>1|(Ee&21845)<<1;ft=(ft&52428)>>2|(ft&13107)<<2,ft=(ft&61680)>>4|(ft&3855)<<4,Jn[Ee]=((ft&65280)>>8|(ft&255)<<8)>>1}var ot=(function(c,e,t){for(var s=c.length,n=0,i=new qe(e);n<s;++n)c[n]&&++i[c[n]-1];var o=new qe(e);for(n=1;n<e;++n)o[n]=o[n-1]+i[n-1]<<1;var r;if(t){r=new qe(1<<e);var A=15-e;for(n=0;n<s;++n)if(c[n])for(var l=n<<4|c[n],h=e-c[n],u=o[c[n]-1]++<<h,d=u|(1<<h)-1;u<=d;++u)r[Jn[u]>>A]=l}else for(r=new qe(s),n=0;n<s;++n)c[n]&&(r[n]=Jn[o[c[n]-1]++]>>15-c[n]);return r}),mt=new Qe(288);for(var Ee=0;Ee<144;++Ee)mt[Ee]=8;for(var Ee=144;Ee<256;++Ee)mt[Ee]=9;for(var Ee=256;Ee<280;++Ee)mt[Ee]=7;for(var Ee=280;Ee<288;++Ee)mt[Ee]=8;var Zt=new Qe(32);for(var Ee=0;Ee<32;++Ee)Zt[Ee]=5;var ta=ot(mt,9,0),na=ot(mt,9,1),sa=ot(Zt,5,0),ia=ot(Zt,5,1),Rn=function(c){for(var e=c[0],t=1;t<c.length;++t)c[t]>e&&(e=c[t]);return e},$e=function(c,e,t){var s=e/8|0;return(c[s]|c[s+1]<<8)>>(e&7)&t},_n=function(c,e){var t=e/8|0;return(c[t]|c[t+1]<<8|c[t+2]<<16)>>(e&7)},ss=function(c){return(c+7)/8|0},is=function(c,e,t){return(t==null||t>c.length)&&(t=c.length),new Qe(c.subarray(e,t))},oa=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ne=function(c,e,t){var s=new Error(e||oa[c]);if(s.code=c,Error.captureStackTrace&&Error.captureStackTrace(s,Ne),!t)throw s;return s},ra=function(c,e,t,s){var n=c.length,i=0;if(!n||e.f&&!e.l)return t||new Qe(0);var o=!t,r=o||e.i!=2,A=e.i;o&&(t=new Qe(n*3));var l=function(ht){var It=t.length;if(ht>It){var rt=new Qe(Math.max(It*2,ht));rt.set(t),t=rt}},h=e.f||0,u=e.p||0,d=e.b||0,g=e.l,f=e.d,I=e.m,b=e.n,C=n*8;do{if(!g){h=$e(c,u,1);var w=$e(c,u+1,3);if(u+=3,w)if(w==1)g=na,f=ia,I=9,b=5;else if(w==2){var R=$e(c,u,31)+257,_=$e(c,u+10,15)+4,S=R+$e(c,u+5,31)+1;u+=14;for(var v=new Qe(S),G=new Qe(19),N=0;N<_;++N)G[Yn[N]]=$e(c,u+N*3,7);u+=_*3;for(var H=Rn(G),X=(1<<H)-1,U=ot(G,H,1),N=0;N<S;){var K=U[$e(c,u,X)];u+=K&15;var E=K>>4;if(E<16)v[N++]=E;else{var O=0,Z=0;for(E==16?(Z=3+$e(c,u,3),u+=2,O=v[N-1]):E==17?(Z=3+$e(c,u,7),u+=3):E==18&&(Z=11+$e(c,u,127),u+=7);Z--;)v[N++]=O}}var ie=v.subarray(0,R),ee=v.subarray(R);I=Rn(ie),b=Rn(ee),g=ot(ie,I,1),f=ot(ee,b,1)}else Ne(1);else{var E=ss(u)+4,y=c[E-4]|c[E-3]<<8,Q=E+y;if(Q>n){A&&Ne(0);break}r&&l(d+y),t.set(c.subarray(E,Q),d),e.b=d+=y,e.p=u=Q*8,e.f=h;continue}if(u>C){A&&Ne(0);break}}r&&l(d+131072);for(var ce=(1<<I)-1,te=(1<<b)-1,W=u;;W=u){var O=g[_n(c,u)&ce],se=O>>4;if(u+=O&15,u>C){A&&Ne(0);break}if(O||Ne(2),se<256)t[d++]=se;else if(se==256){W=u,g=null;break}else{var de=se-254;if(se>264){var N=se-257,me=gn[N];de=$e(c,u,(1<<me)-1)+Di[N],u+=me}var Ae=f[_n(c,u)&te],Pe=Ae>>4;Ae||Ne(3),u+=Ae&15;var ee=ea[Pe];if(Pe>3){var me=fn[Pe];ee+=_n(c,u)&(1<<me)-1,u+=me}if(u>C){A&&Ne(0);break}r&&l(d+131072);var Oe=d+de;if(d<ee){var xt=i-ee,St=Math.min(ee,Oe);for(xt+d<0&&Ne(3);d<St;++d)t[d]=s[xt+d]}for(;d<Oe;++d)t[d]=t[d-ee]}}e.l=g,e.p=W,e.b=d,e.f=h,g&&(h=1,e.m=I,e.d=f,e.n=b)}while(!h);return d!=t.length&&o?is(t,0,d):t.subarray(0,d)},At=function(c,e,t){t<<=e&7;var s=e/8|0;c[s]|=t,c[s+1]|=t>>8},Ht=function(c,e,t){t<<=e&7;var s=e/8|0;c[s]|=t,c[s+1]|=t>>8,c[s+2]|=t>>16},Dn=function(c,e){for(var t=[],s=0;s<c.length;++s)c[s]&&t.push({s,f:c[s]});var n=t.length,i=t.slice();if(!n)return{t:ki,l:0};if(n==1){var o=new Qe(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(Q,R){return Q.f-R.f}),t.push({s:-1,f:25001});var r=t[0],A=t[1],l=0,h=1,u=2;for(t[0]={s:-1,f:r.f+A.f,l:r,r:A};h!=n-1;)r=t[t[l].f<t[u].f?l++:u++],A=t[l!=h&&t[l].f<t[u].f?l++:u++],t[h++]={s:-1,f:r.f+A.f,l:r,r:A};for(var d=i[0].s,s=1;s<n;++s)i[s].s>d&&(d=i[s].s);var g=new qe(d+1),f=Wn(t[h-1],g,0);if(f>e){var s=0,I=0,b=f-e,C=1<<b;for(i.sort(function(R,_){return g[_.s]-g[R.s]||R.f-_.f});s<n;++s){var w=i[s].s;if(g[w]>e)I+=C-(1<<f-g[w]),g[w]=e;else break}for(I>>=b;I>0;){var E=i[s].s;g[E]<e?I-=1<<e-g[E]++-1:++s}for(;s>=0&&I;--s){var y=i[s].s;g[y]==e&&(--g[y],++I)}f=e}return{t:new Qe(g),l:f}},Wn=function(c,e,t){return c.s==-1?Math.max(Wn(c.l,e,t+1),Wn(c.r,e,t+1)):e[c.s]=t},_s=function(c){for(var e=c.length;e&&!c[--e];);for(var t=new qe(++e),s=0,n=c[0],i=1,o=function(A){t[s++]=A},r=1;r<=e;++r)if(c[r]==n&&r!=e)++i;else{if(!n&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(n),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(n);i=1,n=c[r]}return{c:t.subarray(0,s),n:e}},jt=function(c,e){for(var t=0,s=0;s<e.length;++s)t+=c[s]*e[s];return t},Li=function(c,e,t){var s=t.length,n=ss(e+2);c[n]=s&255,c[n+1]=s>>8,c[n+2]=c[n]^255,c[n+3]=c[n+1]^255;for(var i=0;i<s;++i)c[n+i+4]=t[i];return(n+4+s)*8},Ds=function(c,e,t,s,n,i,o,r,A,l,h){At(e,h++,t),++n[256];for(var u=Dn(n,15),d=u.t,g=u.l,f=Dn(i,15),I=f.t,b=f.l,C=_s(d),w=C.c,E=C.n,y=_s(I),Q=y.c,R=y.n,_=new qe(19),S=0;S<w.length;++S)++_[w[S]&31];for(var S=0;S<Q.length;++S)++_[Q[S]&31];for(var v=Dn(_,7),G=v.t,N=v.l,H=19;H>4&&!G[Yn[H-1]];--H);var X=l+5<<3,U=jt(n,mt)+jt(i,Zt)+o,K=jt(n,d)+jt(i,I)+o+14+3*H+jt(_,G)+2*_[16]+3*_[17]+7*_[18];if(A>=0&&X<=U&&X<=K)return Li(e,h,c.subarray(A,A+l));var O,Z,ie,ee;if(At(e,h,1+(K<U)),h+=2,K<U){O=ot(d,g,0),Z=d,ie=ot(I,b,0),ee=I;var ce=ot(G,N,0);At(e,h,E-257),At(e,h+5,R-1),At(e,h+10,H-4),h+=14;for(var S=0;S<H;++S)At(e,h+3*S,G[Yn[S]]);h+=3*H;for(var te=[w,Q],W=0;W<2;++W)for(var se=te[W],S=0;S<se.length;++S){var de=se[S]&31;At(e,h,ce[de]),h+=G[de],de>15&&(At(e,h,se[S]>>5&127),h+=se[S]>>12)}}else O=ta,Z=mt,ie=sa,ee=Zt;for(var S=0;S<r;++S){var me=s[S];if(me>255){var de=me>>18&31;Ht(e,h,O[de+257]),h+=Z[de+257],de>7&&(At(e,h,me>>23&31),h+=gn[de]);var Ae=me&31;Ht(e,h,ie[Ae]),h+=ee[Ae],Ae>3&&(Ht(e,h,me>>5&8191),h+=fn[Ae])}else Ht(e,h,O[me]),h+=Z[me]}return Ht(e,h,O[256]),h+Z[256]},aa=new ns([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ki=new Qe(0),Aa=function(c,e,t,s,n,i){var o=i.z||c.length,r=new Qe(s+o+5*(1+Math.ceil(o/7e3))+n),A=r.subarray(s,r.length-n),l=i.l,h=(i.r||0)&7;if(e){h&&(A[0]=i.r>>3);for(var u=aa[e-1],d=u>>13,g=u&8191,f=(1<<t)-1,I=i.p||new qe(32768),b=i.h||new qe(f+1),C=Math.ceil(t/3),w=2*C,E=function(Tt){return(c[Tt]^c[Tt+1]<<C^c[Tt+2]<<w)&f},y=new ns(25e3),Q=new qe(288),R=new qe(32),_=0,S=0,v=i.i||0,G=0,N=i.w||0,H=0;v+2<o;++v){var X=E(v),U=v&32767,K=b[X];if(I[U]=K,b[X]=U,N<=v){var O=o-v;if((_>7e3||G>24576)&&(O>423||!l)){h=Ds(c,A,0,y,Q,R,S,G,H,v-H,h),G=_=S=0,H=v;for(var Z=0;Z<286;++Z)Q[Z]=0;for(var Z=0;Z<30;++Z)R[Z]=0}var ie=2,ee=0,ce=g,te=U-K&32767;if(O>2&&X==E(v-te))for(var W=Math.min(d,O)-1,se=Math.min(32767,v),de=Math.min(258,O);te<=se&&--ce&&U!=K;){if(c[v+ie]==c[v+ie-te]){for(var me=0;me<de&&c[v+me]==c[v+me-te];++me);if(me>ie){if(ie=me,ee=te,me>W)break;for(var Ae=Math.min(te,me-2),Pe=0,Z=0;Z<Ae;++Z){var Oe=v-te+Z&32767,xt=I[Oe],St=Oe-xt&32767;St>Pe&&(Pe=St,K=Oe)}}}U=K,K=I[U],te+=U-K&32767}if(ee){y[G++]=268435456|Vn[ie]<<18|Rs[ee];var ht=Vn[ie]&31,It=Rs[ee]&31;S+=gn[ht]+fn[It],++Q[257+ht],++R[It],N=v+ie,++_}else y[G++]=c[v],++Q[c[v]]}}for(v=Math.max(v,N);v<o;++v)y[G++]=c[v],++Q[c[v]];h=Ds(c,A,l,y,Q,R,S,G,H,v-H,h),l||(i.r=h&7|A[h/8|0]<<3,h-=7,i.h=b,i.p=I,i.i=v,i.w=N)}else{for(var v=i.w||0;v<o+l;v+=65535){var rt=v+65535;rt>=o&&(A[h/8|0]=l,rt=o),h=Li(A,h+1,c.subarray(v,rt))}i.i=o}return is(r,0,s+ss(h)+n)},ca=(function(){for(var c=new Int32Array(256),e=0;e<256;++e){for(var t=e,s=9;--s;)t=(t&1&&-306674912)^t>>>1;c[e]=t}return c})(),la=function(){var c=-1;return{p:function(e){for(var t=c,s=0;s<e.length;++s)t=ca[t&255^e[s]]^t>>>8;c=t},d:function(){return~c}}},ha=function(c,e,t,s,n){if(!n&&(n={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new Qe(i.length+c.length);o.set(i),o.set(c,i.length),c=o,n.w=i.length}return Aa(c,e.level==null?6:e.level,e.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(c.length)))*1.5):20:12+e.mem,t,s,n)},Gi=function(c,e){var t={};for(var s in c)t[s]=c[s];for(var s in e)t[s]=e[s];return t},Re=function(c,e,t){for(;t;++e)c[e]=t,t>>>=8},ua=function(c,e){return((c[0]&15)!=8||c[0]>>4>7||(c[0]<<8|c[1])%31)&&Ne(6,"invalid zlib data"),(c[1]>>5&1)==1&&Ne(6,"invalid zlib data: "+(c[1]&32?"need":"unexpected")+" dictionary"),(c[1]>>3&4)+2};function da(c,e){return ha(c,e||{},0,0)}function Jt(c,e){return ra(c.subarray(ua(c),-4),{i:2},e,e)}var Ni=function(c,e,t,s){for(var n in c){var i=c[n],o=e+n,r=s;Array.isArray(i)&&(r=Gi(s,i[1]),i=i[0]),i instanceof Qe?t[o]=[i,r]:(t[o+="/"]=[new Qe(0),r],Ni(i,o,t,s))}},Fs=typeof TextEncoder<"u"&&new TextEncoder,pa=typeof TextDecoder<"u"&&new TextDecoder,ga=0;try{pa.decode(ki,{stream:!0}),ga=1}catch{}function Xn(c,e){var t;if(Fs)return Fs.encode(c);for(var s=c.length,n=new Qe(c.length+(c.length>>1)),i=0,o=function(l){n[i++]=l},t=0;t<s;++t){if(i+5>n.length){var r=new Qe(i+8+(s-t<<1));r.set(n),n=r}var A=c.charCodeAt(t);A<128||e?o(A):A<2048?(o(192|A>>6),o(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|c.charCodeAt(++t)&1023,o(240|A>>18),o(128|A>>12&63),o(128|A>>6&63),o(128|A&63)):(o(224|A>>12),o(128|A>>6&63),o(128|A&63))}return is(n,0,i)}var Zn=function(c){var e=0;if(c)for(var t in c){var s=c[t].length;s>65535&&Ne(9),e+=s+4}return e},Ls=function(c,e,t,s,n,i,o,r){var A=s.length,l=t.extra,h=r&&r.length,u=Zn(l);Re(c,e,o!=null?33639248:67324752),e+=4,o!=null&&(c[e++]=20,c[e++]=t.os),c[e]=20,e+=2,c[e++]=t.flag<<1|(i<0&&8),c[e++]=n&&8,c[e++]=t.compression&255,c[e++]=t.compression>>8;var d=new Date(t.mtime==null?Date.now():t.mtime),g=d.getFullYear()-1980;if((g<0||g>119)&&Ne(10),Re(c,e,g<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),e+=4,i!=-1&&(Re(c,e,t.crc),Re(c,e+4,i<0?-i-2:i),Re(c,e+8,t.size)),Re(c,e+12,A),Re(c,e+14,u),e+=16,o!=null&&(Re(c,e,h),Re(c,e+6,t.attrs),Re(c,e+10,o),e+=14),c.set(s,e),e+=A,u)for(var f in l){var I=l[f],b=I.length;Re(c,e,+f),Re(c,e+2,b),c.set(I,e+4),e+=4+b}return h&&(c.set(r,e),e+=h),e},fa=function(c,e,t,s,n){Re(c,e,101010256),Re(c,e+8,t),Re(c,e+10,t),Re(c,e+12,s),Re(c,e+16,n)};function ma(c,e){e||(e={});var t={},s=[];Ni(c,"",t,e);var n=0,i=0;for(var o in t){var r=t[o],A=r[0],l=r[1],h=l.level==0?0:8,u=Xn(o),d=u.length,g=l.comment,f=g&&Xn(g),I=f&&f.length,b=Zn(l.extra);d>65535&&Ne(11);var C=h?da(A,l):A,w=C.length,E=la();E.p(A),s.push(Gi(l,{size:A.length,crc:E.d(),c:C,f:u,m:f,u:d!=o.length||f&&g.length!=I,o:n,compression:h})),n+=30+d+b+w,i+=76+2*(d+b)+(I||0)+w}for(var y=new Qe(i+22),Q=n,R=i-n,_=0;_<s.length;++_){var u=s[_];Ls(y,u.o,u,u.f,u.u,u.c.length);var S=30+u.f.length+Zn(u.extra);y.set(u.c,u.o+S),Ls(y,n,u,u.f,u.u,u.c.length,u.o,u.m),n+=16+S+(u.m?u.m.length:0)}return fa(y,n,s.length,R,Q),y}class Ui extends a.DataTextureLoader{constructor(e){super(e),this.type=a.HalfFloatType}parse(e){const v=Math.pow(2.7182818,2.2);function G(p,m){let B=0;for(let M=0;M<65536;++M)(M==0||p[M>>3]&1<<(M&7))&&(m[B++]=M);const x=B-1;for(;B<65536;)m[B++]=0;return x}function N(p){for(let m=0;m<16384;m++)p[m]={},p[m].len=0,p[m].lit=0,p[m].p=null}const H={l:0,c:0,lc:0};function X(p,m,B,x,M){for(;B<p;)m=m<<8|ls(x,M),B+=8;B-=p,H.l=m>>B&(1<<p)-1,H.c=m,H.lc=B}const U=new Array(59);function K(p){for(let B=0;B<=58;++B)U[B]=0;for(let B=0;B<65537;++B)U[p[B]]+=1;let m=0;for(let B=58;B>0;--B){const x=m+U[B]>>1;U[B]=m,m=x}for(let B=0;B<65537;++B){const x=p[B];x>0&&(p[B]=x|U[x]++<<6)}}function O(p,m,B,x,M,T){const L=m;let P=0,k=0;for(;x<=M;x++){if(L.value-m.value>B)return!1;X(6,P,k,p,L);const F=H.l;if(P=H.c,k=H.lc,T[x]=F,F==63){if(L.value-m.value>B)throw new Error("Something wrong with hufUnpackEncTable");X(8,P,k,p,L);let D=H.l+6;if(P=H.c,k=H.lc,x+D>M+1)throw new Error("Something wrong with hufUnpackEncTable");for(;D--;)T[x++]=0;x--}else if(F>=59){let D=F-59+2;if(x+D>M+1)throw new Error("Something wrong with hufUnpackEncTable");for(;D--;)T[x++]=0;x--}}K(T)}function Z(p){return p&63}function ie(p){return p>>6}function ee(p,m,B,x){for(;m<=B;m++){const M=ie(p[m]),T=Z(p[m]);if(M>>T)throw new Error("Invalid table entry");if(T>14){const L=x[M>>T-14];if(L.len)throw new Error("Invalid table entry");if(L.lit++,L.p){const P=L.p;L.p=new Array(L.lit);for(let k=0;k<L.lit-1;++k)L.p[k]=P[k]}else L.p=new Array(1);L.p[L.lit-1]=m}else if(T){let L=0;for(let P=1<<14-T;P>0;P--){const k=x[(M<<14-T)+L];if(k.len||k.p)throw new Error("Invalid table entry");k.len=T,k.lit=m,L++}}}return!0}const ce={c:0,lc:0};function te(p,m,B,x){p=p<<8|ls(B,x),m+=8,ce.c=p,ce.lc=m}const W={c:0,lc:0};function se(p,m,B,x,M,T,L,P,k){if(p==m){x<8&&(te(B,x,M,T),B=ce.c,x=ce.lc),x-=8;let F=B>>x;if(F=new Uint8Array([F])[0],P.value+F>k)return!1;const D=L[P.value-1];for(;F-- >0;)L[P.value++]=D}else if(P.value<k)L[P.value++]=p;else return!1;W.c=B,W.lc=x}function de(p){return p&65535}function me(p){const m=de(p);return m>32767?m-65536:m}const Ae={a:0,b:0};function Pe(p,m){const B=me(p),M=me(m),T=B+(M&1)+(M>>1),L=T,P=T-M;Ae.a=L,Ae.b=P}function Oe(p,m){const B=de(p),x=de(m),M=B-(x>>1)&65535,T=x+M-32768&65535;Ae.a=T,Ae.b=M}function xt(p,m,B,x,M,T,L){const P=L<16384,k=B>M?M:B;let F=1,D,j;for(;F<=k;)F<<=1;for(F>>=1,D=F,F>>=1;F>=1;){j=0;const V=j+T*(M-D),q=T*F,$=T*D,z=x*F,J=x*D;let ne,pe,Be,je;for(;j<=V;j+=$){let Ie=j;const le=j+x*(B-D);for(;Ie<=le;Ie+=J){const xe=Ie+z,Ve=Ie+q,Te=Ve+z;P?(Pe(p[Ie+m],p[Ve+m]),ne=Ae.a,Be=Ae.b,Pe(p[xe+m],p[Te+m]),pe=Ae.a,je=Ae.b,Pe(ne,pe),p[Ie+m]=Ae.a,p[xe+m]=Ae.b,Pe(Be,je),p[Ve+m]=Ae.a,p[Te+m]=Ae.b):(Oe(p[Ie+m],p[Ve+m]),ne=Ae.a,Be=Ae.b,Oe(p[xe+m],p[Te+m]),pe=Ae.a,je=Ae.b,Oe(ne,pe),p[Ie+m]=Ae.a,p[xe+m]=Ae.b,Oe(Be,je),p[Ve+m]=Ae.a,p[Te+m]=Ae.b)}if(B&F){const xe=Ie+q;P?Pe(p[Ie+m],p[xe+m]):Oe(p[Ie+m],p[xe+m]),ne=Ae.a,p[xe+m]=Ae.b,p[Ie+m]=ne}}if(M&F){let Ie=j;const le=j+x*(B-D);for(;Ie<=le;Ie+=J){const xe=Ie+z;P?Pe(p[Ie+m],p[xe+m]):Oe(p[Ie+m],p[xe+m]),ne=Ae.a,p[xe+m]=Ae.b,p[Ie+m]=ne}}D=F,F>>=1}return j}function St(p,m,B,x,M,T,L,P,k){let F=0,D=0;const j=L,V=Math.trunc(x.value+(M+7)/8);for(;x.value<V;)for(te(F,D,B,x),F=ce.c,D=ce.lc;D>=14;){const $=F>>D-14&16383,z=m[$];if(z.len)D-=z.len,se(z.lit,T,F,D,B,x,P,k,j),F=W.c,D=W.lc;else{if(!z.p)throw new Error("hufDecode issues");let J;for(J=0;J<z.lit;J++){const ne=Z(p[z.p[J]]);for(;D<ne&&x.value<V;)te(F,D,B,x),F=ce.c,D=ce.lc;if(D>=ne&&ie(p[z.p[J]])==(F>>D-ne&(1<<ne)-1)){D-=ne,se(z.p[J],T,F,D,B,x,P,k,j),F=W.c,D=W.lc;break}}if(J==z.lit)throw new Error("hufDecode issues")}}const q=8-M&7;for(F>>=q,D-=q;D>0;){const $=m[F<<14-D&16383];if($.len)D-=$.len,se($.lit,T,F,D,B,x,P,k,j),F=W.c,D=W.lc;else throw new Error("hufDecode issues")}return!0}function ht(p,m,B,x,M,T){const L={value:0},P=B.value,k=Ye(m,B),F=Ye(m,B);B.value+=4;const D=Ye(m,B);if(B.value+=4,k<0||k>=65537||F<0||F>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const j=new Array(65537),V=new Array(16384);N(V);const q=x-(B.value-P);if(O(p,B,q,k,F,j),D>8*(x-(B.value-P)))throw new Error("Something wrong with hufUncompress");ee(j,k,F,V),St(j,V,p,B,D,F,T,M,L)}function It(p,m,B){for(let x=0;x<B;++x)m[x]=p[m[x]]}function rt(p){for(let m=1;m<p.length;m++){const B=p[m-1]+p[m]-128;p[m]=B}}function Tt(p,m){let B=0,x=Math.floor((p.length+1)/2),M=0;const T=p.length-1;for(;!(M>T||(m[M++]=p[B++],M>T));)m[M++]=p[x++]}function As(p){let m=p.byteLength;const B=new Array;let x=0;const M=new DataView(p);for(;m>0;){const T=M.getInt8(x++);if(T<0){const L=-T;m-=L+1;for(let P=0;P<L;P++)B.push(M.getUint8(x++))}else{const L=T;m-=2;const P=M.getUint8(x++);for(let k=0;k<L+1;k++)B.push(P)}}return B}function Wi(p,m,B,x,M,T){let L=new DataView(T.buffer);const P=B[p.idx[0]].width,k=B[p.idx[0]].height,F=3,D=Math.floor(P/8),j=Math.ceil(P/8),V=Math.ceil(k/8),q=P-(j-1)*8,$=k-(V-1)*8,z={value:0},J=new Array(F),ne=new Array(F),pe=new Array(F),Be=new Array(F),je=new Array(F);for(let le=0;le<F;++le)je[le]=m[p.idx[le]],J[le]=le<1?0:J[le-1]+j*V,ne[le]=new Float32Array(64),pe[le]=new Uint16Array(64),Be[le]=new Uint16Array(j*64);for(let le=0;le<V;++le){let xe=8;le==V-1&&(xe=$);let Ve=8;for(let ue=0;ue<j;++ue){ue==j-1&&(Ve=q);for(let fe=0;fe<F;++fe)pe[fe].fill(0),pe[fe][0]=M[J[fe]++],Xi(z,x,pe[fe]),Zi(pe[fe],ne[fe]),$i(ne[fe]);eo(ne);for(let fe=0;fe<F;++fe)to(ne[fe],Be[fe],ue*64)}let Te=0;for(let ue=0;ue<F;++ue){const fe=B[p.idx[ue]].type;for(let at=8*le;at<8*le+xe;++at){Te=je[ue][at];for(let Lt=0;Lt<D;++Lt){const et=Lt*64+(at&7)*8;L.setUint16(Te+0*fe,Be[ue][et+0],!0),L.setUint16(Te+2*fe,Be[ue][et+1],!0),L.setUint16(Te+4*fe,Be[ue][et+2],!0),L.setUint16(Te+6*fe,Be[ue][et+3],!0),L.setUint16(Te+8*fe,Be[ue][et+4],!0),L.setUint16(Te+10*fe,Be[ue][et+5],!0),L.setUint16(Te+12*fe,Be[ue][et+6],!0),L.setUint16(Te+14*fe,Be[ue][et+7],!0),Te+=16*fe}}if(D!=j)for(let at=8*le;at<8*le+xe;++at){const Lt=je[ue][at]+8*D*2*fe,et=D*64+(at&7)*8;for(let tn=0;tn<Ve;++tn)L.setUint16(Lt+tn*2*fe,Be[ue][et+tn],!0)}}}const Ie=new Uint16Array(P);L=new DataView(T.buffer);for(let le=0;le<F;++le){B[p.idx[le]].decoded=!0;const xe=B[p.idx[le]].type;if(B[le].type==2)for(let Ve=0;Ve<k;++Ve){const Te=je[le][Ve];for(let ue=0;ue<P;++ue)Ie[ue]=L.getUint16(Te+ue*2*xe,!0);for(let ue=0;ue<P;++ue)L.setFloat32(Te+ue*2*xe,Y(Ie[ue]),!0)}}}function Xi(p,m,B){let x,M=1;for(;M<64;)x=m[p.value],x==65280?M=64:x>>8==255?M+=x&255:(B[M]=x,M++),p.value++}function Zi(p,m){m[0]=Y(p[0]),m[1]=Y(p[1]),m[2]=Y(p[5]),m[3]=Y(p[6]),m[4]=Y(p[14]),m[5]=Y(p[15]),m[6]=Y(p[27]),m[7]=Y(p[28]),m[8]=Y(p[2]),m[9]=Y(p[4]),m[10]=Y(p[7]),m[11]=Y(p[13]),m[12]=Y(p[16]),m[13]=Y(p[26]),m[14]=Y(p[29]),m[15]=Y(p[42]),m[16]=Y(p[3]),m[17]=Y(p[8]),m[18]=Y(p[12]),m[19]=Y(p[17]),m[20]=Y(p[25]),m[21]=Y(p[30]),m[22]=Y(p[41]),m[23]=Y(p[43]),m[24]=Y(p[9]),m[25]=Y(p[11]),m[26]=Y(p[18]),m[27]=Y(p[24]),m[28]=Y(p[31]),m[29]=Y(p[40]),m[30]=Y(p[44]),m[31]=Y(p[53]),m[32]=Y(p[10]),m[33]=Y(p[19]),m[34]=Y(p[23]),m[35]=Y(p[32]),m[36]=Y(p[39]),m[37]=Y(p[45]),m[38]=Y(p[52]),m[39]=Y(p[54]),m[40]=Y(p[20]),m[41]=Y(p[22]),m[42]=Y(p[33]),m[43]=Y(p[38]),m[44]=Y(p[46]),m[45]=Y(p[51]),m[46]=Y(p[55]),m[47]=Y(p[60]),m[48]=Y(p[21]),m[49]=Y(p[34]),m[50]=Y(p[37]),m[51]=Y(p[47]),m[52]=Y(p[50]),m[53]=Y(p[56]),m[54]=Y(p[59]),m[55]=Y(p[61]),m[56]=Y(p[35]),m[57]=Y(p[36]),m[58]=Y(p[48]),m[59]=Y(p[49]),m[60]=Y(p[57]),m[61]=Y(p[58]),m[62]=Y(p[62]),m[63]=Y(p[63])}function $i(p){const m=.5*Math.cos(.7853975),B=.5*Math.cos(3.14159/16),x=.5*Math.cos(3.14159/8),M=.5*Math.cos(3*3.14159/16),T=.5*Math.cos(5*3.14159/16),L=.5*Math.cos(3*3.14159/8),P=.5*Math.cos(7*3.14159/16),k=new Array(4),F=new Array(4),D=new Array(4),j=new Array(4);for(let V=0;V<8;++V){const q=V*8;k[0]=x*p[q+2],k[1]=L*p[q+2],k[2]=x*p[q+6],k[3]=L*p[q+6],F[0]=B*p[q+1]+M*p[q+3]+T*p[q+5]+P*p[q+7],F[1]=M*p[q+1]-P*p[q+3]-B*p[q+5]-T*p[q+7],F[2]=T*p[q+1]-B*p[q+3]+P*p[q+5]+M*p[q+7],F[3]=P*p[q+1]-T*p[q+3]+M*p[q+5]-B*p[q+7],D[0]=m*(p[q+0]+p[q+4]),D[3]=m*(p[q+0]-p[q+4]),D[1]=k[0]+k[3],D[2]=k[1]-k[2],j[0]=D[0]+D[1],j[1]=D[3]+D[2],j[2]=D[3]-D[2],j[3]=D[0]-D[1],p[q+0]=j[0]+F[0],p[q+1]=j[1]+F[1],p[q+2]=j[2]+F[2],p[q+3]=j[3]+F[3],p[q+4]=j[3]-F[3],p[q+5]=j[2]-F[2],p[q+6]=j[1]-F[1],p[q+7]=j[0]-F[0]}for(let V=0;V<8;++V)k[0]=x*p[16+V],k[1]=L*p[16+V],k[2]=x*p[48+V],k[3]=L*p[48+V],F[0]=B*p[8+V]+M*p[24+V]+T*p[40+V]+P*p[56+V],F[1]=M*p[8+V]-P*p[24+V]-B*p[40+V]-T*p[56+V],F[2]=T*p[8+V]-B*p[24+V]+P*p[40+V]+M*p[56+V],F[3]=P*p[8+V]-T*p[24+V]+M*p[40+V]-B*p[56+V],D[0]=m*(p[V]+p[32+V]),D[3]=m*(p[V]-p[32+V]),D[1]=k[0]+k[3],D[2]=k[1]-k[2],j[0]=D[0]+D[1],j[1]=D[3]+D[2],j[2]=D[3]-D[2],j[3]=D[0]-D[1],p[0+V]=j[0]+F[0],p[8+V]=j[1]+F[1],p[16+V]=j[2]+F[2],p[24+V]=j[3]+F[3],p[32+V]=j[3]-F[3],p[40+V]=j[2]-F[2],p[48+V]=j[1]-F[1],p[56+V]=j[0]-F[0]}function eo(p){for(let m=0;m<64;++m){const B=p[0][m],x=p[1][m],M=p[2][m];p[0][m]=B+1.5747*M,p[1][m]=B-.1873*x-.4682*M,p[2][m]=B+1.8556*x}}function to(p,m,B){for(let x=0;x<64;++x)m[B+x]=a.DataUtils.toHalfFloat(no(p[x]))}function no(p){return p<=1?Math.sign(p)*Math.pow(Math.abs(p),2.2):Math.sign(p)*Math.pow(v,Math.abs(p)-1)}function mn(p){return new DataView(p.array.buffer,p.offset.value,p.size)}function so(p){const m=p.viewer.buffer.slice(p.offset.value,p.offset.value+p.size),B=new Uint8Array(As(m)),x=new Uint8Array(B.length);return rt(B),Tt(B,x),new DataView(x.buffer)}function In(p){const m=p.array.slice(p.offset.value,p.offset.value+p.size),B=Jt(m),x=new Uint8Array(B.length);return rt(B),Tt(B,x),new DataView(x.buffer)}function io(p){const m=p.viewer,B={value:p.offset.value},x=new Uint16Array(p.columns*p.lines*(p.inputChannels.length*p.type)),M=new Uint8Array(8192);let T=0;const L=new Array(p.inputChannels.length);for(let $=0,z=p.inputChannels.length;$<z;$++)L[$]={},L[$].start=T,L[$].end=L[$].start,L[$].nx=p.columns,L[$].ny=p.lines,L[$].size=p.type,T+=L[$].nx*L[$].ny*L[$].size;const P=Ft(m,B),k=Ft(m,B);if(k>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(P<=k)for(let $=0;$<k-P+1;$++)M[$+P]=ut(m,B);const F=new Uint16Array(65536),D=G(M,F),j=Ye(m,B);ht(p.array,m,B,j,x,T);for(let $=0;$<p.inputChannels.length;++$){const z=L[$];for(let J=0;J<L[$].size;++J)xt(x,z.start+J,z.nx,z.size,z.ny,z.nx*z.size,D)}It(F,x,T);let V=0;const q=new Uint8Array(x.buffer.byteLength);for(let $=0;$<p.lines;$++)for(let z=0;z<p.inputChannels.length;z++){const J=L[z],ne=J.nx*J.size,pe=new Uint8Array(x.buffer,J.end*2,ne*2);q.set(pe,V),V+=ne*2,J.end+=ne}return new DataView(q.buffer)}function oo(p){const m=p.array.slice(p.offset.value,p.offset.value+p.size),B=Jt(m),x=p.inputChannels.length*p.lines*p.columns*p.totalBytes,M=new ArrayBuffer(x),T=new DataView(M);let L=0,P=0;const k=new Array(4);for(let F=0;F<p.lines;F++)for(let D=0;D<p.inputChannels.length;D++){let j=0;switch(p.inputChannels[D].pixelType){case 1:k[0]=L,k[1]=k[0]+p.columns,L=k[1]+p.columns;for(let q=0;q<p.columns;++q){const $=B[k[0]++]<<8|B[k[1]++];j+=$,T.setUint16(P,j,!0),P+=2}break;case 2:k[0]=L,k[1]=k[0]+p.columns,k[2]=k[1]+p.columns,L=k[2]+p.columns;for(let q=0;q<p.columns;++q){const $=B[k[0]++]<<24|B[k[1]++]<<16|B[k[2]++]<<8;j+=$,T.setUint32(P,j,!0),P+=4}break}}return T}function cs(p){const m=p.viewer,B={value:p.offset.value},x=new Uint8Array(p.columns*p.lines*(p.inputChannels.length*p.type*2)),M={version:He(m,B),unknownUncompressedSize:He(m,B),unknownCompressedSize:He(m,B),acCompressedSize:He(m,B),dcCompressedSize:He(m,B),rleCompressedSize:He(m,B),rleUncompressedSize:He(m,B),rleRawSize:He(m,B),totalAcUncompressedCount:He(m,B),totalDcUncompressedCount:He(m,B),acCompression:He(m,B)};if(M.version<2)throw new Error("EXRLoader.parse: "+bt.compression+" version "+M.version+" is unsupported");const T=new Array;let L=Ft(m,B)-2;for(;L>0;){const z=en(m.buffer,B),J=ut(m,B),ne=J>>2&3,pe=(J>>4)-1,Be=new Int8Array([pe])[0],je=ut(m,B);T.push({name:z,index:Be,type:je,compression:ne}),L-=z.length+3}const P=bt.channels,k=new Array(p.inputChannels.length);for(let z=0;z<p.inputChannels.length;++z){const J=k[z]={},ne=P[z];J.name=ne.name,J.compression=0,J.decoded=!1,J.type=ne.pixelType,J.pLinear=ne.pLinear,J.width=p.columns,J.height=p.lines}const F={idx:new Array(3)};for(let z=0;z<p.inputChannels.length;++z){const J=k[z];for(let ne=0;ne<T.length;++ne){const pe=T[ne];J.name==pe.name&&(J.compression=pe.compression,pe.index>=0&&(F.idx[pe.index]=z),J.offset=z)}}let D,j,V;if(M.acCompressedSize>0)switch(M.acCompression){case 0:D=new Uint16Array(M.totalAcUncompressedCount),ht(p.array,m,B,M.acCompressedSize,D,M.totalAcUncompressedCount);break;case 1:const z=p.array.slice(B.value,B.value+M.totalAcUncompressedCount),J=Jt(z);D=new Uint16Array(J.buffer),B.value+=M.totalAcUncompressedCount;break}if(M.dcCompressedSize>0){const z={array:p.array,offset:B,size:M.dcCompressedSize};j=new Uint16Array(In(z).buffer),B.value+=M.dcCompressedSize}if(M.rleRawSize>0){const z=p.array.slice(B.value,B.value+M.rleCompressedSize),J=Jt(z);V=As(J.buffer),B.value+=M.rleCompressedSize}let q=0;const $=new Array(k.length);for(let z=0;z<$.length;++z)$[z]=new Array;for(let z=0;z<p.lines;++z)for(let J=0;J<k.length;++J)$[J].push(q),q+=k[J].width*p.type*2;Wi(F,$,k,D,j,x);for(let z=0;z<k.length;++z){const J=k[z];if(!J.decoded)switch(J.compression){case 2:let ne=0,pe=0;for(let Be=0;Be<p.lines;++Be){let je=$[z][ne];for(let Ie=0;Ie<J.width;++Ie){for(let le=0;le<2*J.type;++le)x[je++]=V[pe+le*J.width*J.height];pe++}ne++}break;case 1:default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(x.buffer)}function en(p,m){const B=new Uint8Array(p);let x=0;for(;B[m.value+x]!=0;)x+=1;const M=new TextDecoder().decode(B.slice(m.value,m.value+x));return m.value=m.value+x+1,M}function ro(p,m,B){const x=new TextDecoder().decode(new Uint8Array(p).slice(m.value,m.value+B));return m.value=m.value+B,x}function ao(p,m){const B=Ke(p,m),x=Ye(p,m);return[B,x]}function Ao(p,m){const B=Ye(p,m),x=Ye(p,m);return[B,x]}function Ke(p,m){const B=p.getInt32(m.value,!0);return m.value=m.value+4,B}function Ye(p,m){const B=p.getUint32(m.value,!0);return m.value=m.value+4,B}function ls(p,m){const B=p[m.value];return m.value=m.value+1,B}function ut(p,m){const B=p.getUint8(m.value);return m.value=m.value+1,B}const He=function(p,m){let B;return"getBigInt64"in DataView.prototype?B=Number(p.getBigInt64(m.value,!0)):B=p.getUint32(m.value+4,!0)+Number(p.getUint32(m.value,!0)<<32),m.value+=8,B};function De(p,m){const B=p.getFloat32(m.value,!0);return m.value+=4,B}function co(p,m){return a.DataUtils.toHalfFloat(De(p,m))}function Y(p){const m=(p&31744)>>10,B=p&1023;return(p>>15?-1:1)*(m?m===31?B?NaN:1/0:Math.pow(2,m-15)*(1+B/1024):6103515625e-14*(B/1024))}function Ft(p,m){const B=p.getUint16(m.value,!0);return m.value+=2,B}function lo(p,m){return Y(Ft(p,m))}function ho(p,m,B,x){const M=B.value,T=[];for(;B.value<M+x-1;){const L=en(m,B),P=Ke(p,B),k=ut(p,B);B.value+=3;const F=Ke(p,B),D=Ke(p,B);T.push({name:L,pixelType:P,pLinear:k,xSampling:F,ySampling:D})}return B.value+=1,T}function uo(p,m){const B=De(p,m),x=De(p,m),M=De(p,m),T=De(p,m),L=De(p,m),P=De(p,m),k=De(p,m),F=De(p,m);return{redX:B,redY:x,greenX:M,greenY:T,blueX:L,blueY:P,whiteX:k,whiteY:F}}function po(p,m){const B=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],x=ut(p,m);return B[x]}function go(p,m){const B=Ke(p,m),x=Ke(p,m),M=Ke(p,m),T=Ke(p,m);return{xMin:B,yMin:x,xMax:M,yMax:T}}function fo(p,m){const B=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],x=ut(p,m);return B[x]}function mo(p,m){const B=["ENVMAP_LATLONG","ENVMAP_CUBE"],x=ut(p,m);return B[x]}function Io(p,m){const B=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],x=["ROUND_DOWN","ROUND_UP"],M=Ye(p,m),T=Ye(p,m),L=ut(p,m);return{xSize:M,ySize:T,levelMode:B[L&15],roundingMode:x[L>>4]}}function bo(p,m){const B=De(p,m),x=De(p,m);return[B,x]}function Eo(p,m){const B=De(p,m),x=De(p,m),M=De(p,m);return[B,x,M]}function Co(p,m,B,x,M){if(x==="string"||x==="stringvector"||x==="iccProfile")return ro(m,B,M);if(x==="chlist")return ho(p,m,B,M);if(x==="chromaticities")return uo(p,B);if(x==="compression")return po(p,B);if(x==="box2i")return go(p,B);if(x==="envmap")return mo(p,B);if(x==="tiledesc")return Io(p,B);if(x==="lineOrder")return fo(p,B);if(x==="float")return De(p,B);if(x==="v2f")return bo(p,B);if(x==="v3f")return Eo(p,B);if(x==="int")return Ke(p,B);if(x==="rational")return ao(p,B);if(x==="timecode")return Ao(p,B);if(x==="preview")return B.value+=M,"skipped";B.value+=M}function Bo(p,m){const B=Math.log2(p);return m=="ROUND_DOWN"?Math.floor(B):Math.ceil(B)}function yo(p,m,B){let x=0;switch(p.levelMode){case"ONE_LEVEL":x=1;break;case"MIPMAP_LEVELS":x=Bo(Math.max(m,B),p.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return x}function hs(p,m,B,x){const M=new Array(p);for(let T=0;T<p;T++){const L=1<<T;let P=m/L|0;x=="ROUND_UP"&&P*L<m&&(P+=1);const k=Math.max(P,1);M[T]=(k+B-1)/B|0}return M}function wo(){const p=this,m=p.offset,B={value:0};for(let x=0;x<p.tileCount;x++){const M=Ke(p.viewer,m),T=Ke(p.viewer,m);m.value+=8,p.size=Ye(p.viewer,m);const L=M*p.blockWidth,P=T*p.blockHeight;p.columns=L+p.blockWidth>p.width?p.width-L:p.blockWidth,p.lines=P+p.blockHeight>p.height?p.height-P:p.blockHeight;const k=p.columns*p.totalBytes,D=p.size<p.lines*k?p.uncompress(p):mn(p);m.value+=p.size;for(let j=0;j<p.lines;j++){const V=j*p.columns*p.totalBytes;for(let q=0;q<p.inputChannels.length;q++){const $=bt.channels[q].name,z=p.channelByteOffsets[$]*p.columns,J=p.decodeChannels[$];if(J===void 0)continue;B.value=V+z;const ne=(p.height-(1+P+j))*p.outLineWidth;for(let pe=0;pe<p.columns;pe++){const Be=ne+(pe+L)*p.outputChannels+J;p.byteArray[Be]=p.getter(D,B)}}}}}function Qo(){const p=this,m=p.offset,B={value:0};for(let x=0;x<p.height/p.blockHeight;x++){const M=Ke(p.viewer,m)-bt.dataWindow.yMin;p.size=Ye(p.viewer,m),p.lines=M+p.blockHeight>p.height?p.height-M:p.blockHeight;const T=p.columns*p.totalBytes,P=p.size<p.lines*T?p.uncompress(p):mn(p);m.value+=p.size;for(let k=0;k<p.blockHeight;k++){const F=x*p.blockHeight,D=k+p.scanOrder(F);if(D>=p.height)continue;const j=k*T,V=(p.height-1-D)*p.outLineWidth;for(let q=0;q<p.inputChannels.length;q++){const $=bt.channels[q].name,z=p.channelByteOffsets[$]*p.columns,J=p.decodeChannels[$];if(J!==void 0){B.value=j+z;for(let ne=0;ne<p.columns;ne++){const pe=V+ne*p.outputChannels+J;p.byteArray[pe]=p.getter(P,B)}}}}}}function xo(p,m,B){const x={};if(p.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");x.version=p.getUint8(4);const M=p.getUint8(5);x.spec={singleTile:!!(M&2),longName:!!(M&4),deepFormat:!!(M&8),multiPart:!!(M&16)},B.value=8;let T=!0;for(;T;){const L=en(m,B);if(L==0)T=!1;else{const P=en(m,B),k=Ye(p,B),F=Co(p,m,B,P,k);F===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${P}'.`):x[L]=F}}if((M&-7)!=0)throw console.error("THREE.EXRHeader:",x),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return x}function So(p,m,B,x,M){const T={size:0,viewer:m,array:B,offset:x,width:p.dataWindow.xMax-p.dataWindow.xMin+1,height:p.dataWindow.yMax-p.dataWindow.yMin+1,inputChannels:p.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:a.LinearSRGBColorSpace};switch(p.compression){case"NO_COMPRESSION":T.blockHeight=1,T.uncompress=mn;break;case"RLE_COMPRESSION":T.blockHeight=1,T.uncompress=so;break;case"ZIPS_COMPRESSION":T.blockHeight=1,T.uncompress=In;break;case"ZIP_COMPRESSION":T.blockHeight=16,T.uncompress=In;break;case"PIZ_COMPRESSION":T.blockHeight=32,T.uncompress=io;break;case"PXR24_COMPRESSION":T.blockHeight=16,T.uncompress=oo;break;case"DWAA_COMPRESSION":T.blockHeight=32,T.uncompress=cs;break;case"DWAB_COMPRESSION":T.blockHeight=256,T.uncompress=cs;break;default:throw new Error("EXRLoader.parse: "+p.compression+" is unsupported")}const L={};for(const D of p.channels)switch(D.name){case"Y":case"R":case"G":case"B":case"A":L[D.name]=!0,T.type=D.pixelType}let P=!1;if(L.R&&L.G&&L.B)P=!L.A,T.outputChannels=4,T.decodeChannels={R:0,G:1,B:2,A:3};else if(L.Y)T.outputChannels=1,T.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(T.type==1)switch(M){case a.FloatType:T.getter=lo;break;case a.HalfFloatType:T.getter=Ft;break}else if(T.type==2)switch(M){case a.FloatType:T.getter=De;break;case a.HalfFloatType:T.getter=co}else throw new Error("EXRLoader.parse: unsupported pixelType "+T.type+" for "+p.compression+".");T.columns=T.width;const k=T.width*T.height*T.outputChannels;switch(M){case a.FloatType:T.byteArray=new Float32Array(k),P&&T.byteArray.fill(1,0,k);break;case a.HalfFloatType:T.byteArray=new Uint16Array(k),P&&T.byteArray.fill(15360,0,k);break;default:console.error("THREE.EXRLoader: unsupported type: ",M);break}let F=0;for(const D of p.channels)T.decodeChannels[D.name]!==void 0&&(T.channelByteOffsets[D.name]=F),F+=D.pixelType*2;if(T.totalBytes=F,T.outLineWidth=T.width*T.outputChannels,p.lineOrder==="INCREASING_Y"?T.scanOrder=D=>D:T.scanOrder=D=>T.height-1-D,T.outputChannels==4?(T.format=a.RGBAFormat,T.colorSpace=a.LinearSRGBColorSpace):(T.format=a.RedFormat,T.colorSpace=a.NoColorSpace),p.spec.singleTile){T.blockHeight=p.tiles.ySize,T.blockWidth=p.tiles.xSize;const D=yo(p.tiles,T.width,T.height),j=hs(D,T.width,p.tiles.xSize,p.tiles.roundingMode),V=hs(D,T.height,p.tiles.ySize,p.tiles.roundingMode);T.tileCount=j[0]*V[0];for(let q=0;q<D;q++)for(let $=0;$<V[q];$++)for(let z=0;z<j[q];z++)He(m,x);T.decode=wo.bind(T)}else{T.blockWidth=T.width;const D=Math.ceil(T.height/T.blockHeight);for(let j=0;j<D;j++)He(m,x);T.decode=Qo.bind(T)}return T}const us={value:0},ds=new DataView(e),To=new Uint8Array(e),bt=xo(ds,e,us),vt=So(bt,ds,To,us,this.type);return vt.decode(),{header:bt,width:vt.width,height:vt.height,data:vt.byteArray,format:vt.format,colorSpace:vt.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,s,n){function i(o,r){o.colorSpace=r.colorSpace,o.minFilter=a.LinearFilter,o.magFilter=a.LinearFilter,o.generateMipmaps=!1,o.flipY=!1,t&&t(o,r)}return super.load(e,i,s,n)}}const Ia=Object.freeze(Object.defineProperty({__proto__:null,EXRLoader:Ui},Symbol.toStringTag,{value:"Module"}));class Pi extends a.DataTextureLoader{constructor(e){super(e),this.type=a.HalfFloatType}parse(e){const o=function(S,v){switch(S){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(v||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(v||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(v||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(v||""))}},u=function(S,v,G){v=v||1024;let H=S.pos,X=-1,U=0,K="",O=String.fromCharCode.apply(null,new Uint16Array(S.subarray(H,H+128)));for(;0>(X=O.indexOf(`
42
+ `))&&U<v&&H<S.byteLength;)K+=O,U+=O.length,H+=128,O+=String.fromCharCode.apply(null,new Uint16Array(S.subarray(H,H+128)));return-1<X?(S.pos+=U+X+1,K+O.slice(0,X)):!1},d=function(S){const v=/^#\?(\S+)/,G=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,N=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,H=/^\s*FORMAT=(\S+)\s*$/,X=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,U={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let K,O;for((S.pos>=S.byteLength||!(K=u(S)))&&o(1,"no header found"),(O=K.match(v))||o(3,"bad initial token"),U.valid|=1,U.programtype=O[1],U.string+=K+`
43
+ `;K=u(S),K!==!1;){if(U.string+=K+`
44
+ `,K.charAt(0)==="#"){U.comments+=K+`
45
+ `;continue}if((O=K.match(G))&&(U.gamma=parseFloat(O[1])),(O=K.match(N))&&(U.exposure=parseFloat(O[1])),(O=K.match(H))&&(U.valid|=2,U.format=O[1]),(O=K.match(X))&&(U.valid|=4,U.height=parseInt(O[1],10),U.width=parseInt(O[2],10)),U.valid&2&&U.valid&4)break}return U.valid&2||o(3,"missing format specifier"),U.valid&4||o(3,"missing image size specifier"),U},g=function(S,v,G){const N=v;if(N<8||N>32767||S[0]!==2||S[1]!==2||S[2]&128)return new Uint8Array(S);N!==(S[2]<<8|S[3])&&o(3,"wrong scanline width");const H=new Uint8Array(4*v*G);H.length||o(4,"unable to allocate buffer space");let X=0,U=0;const K=4*N,O=new Uint8Array(4),Z=new Uint8Array(K);let ie=G;for(;ie>0&&U<S.byteLength;){U+4>S.byteLength&&o(1),O[0]=S[U++],O[1]=S[U++],O[2]=S[U++],O[3]=S[U++],(O[0]!=2||O[1]!=2||(O[2]<<8|O[3])!=N)&&o(3,"bad rgbe scanline format");let ee=0,ce;for(;ee<K&&U<S.byteLength;){ce=S[U++];const W=ce>128;if(W&&(ce-=128),(ce===0||ee+ce>K)&&o(3,"bad scanline data"),W){const se=S[U++];for(let de=0;de<ce;de++)Z[ee++]=se}else Z.set(S.subarray(U,U+ce),ee),ee+=ce,U+=ce}const te=N;for(let W=0;W<te;W++){let se=0;H[X]=Z[W+se],se+=N,H[X+1]=Z[W+se],se+=N,H[X+2]=Z[W+se],se+=N,H[X+3]=Z[W+se],X+=4}ie--}return H},f=function(S,v,G,N){const H=S[v+3],X=Math.pow(2,H-128)/255;G[N+0]=S[v+0]*X,G[N+1]=S[v+1]*X,G[N+2]=S[v+2]*X,G[N+3]=1},I=function(S,v,G,N){const H=S[v+3],X=Math.pow(2,H-128)/255;G[N+0]=a.DataUtils.toHalfFloat(Math.min(S[v+0]*X,65504)),G[N+1]=a.DataUtils.toHalfFloat(Math.min(S[v+1]*X,65504)),G[N+2]=a.DataUtils.toHalfFloat(Math.min(S[v+2]*X,65504)),G[N+3]=a.DataUtils.toHalfFloat(1)},b=new Uint8Array(e);b.pos=0;const C=d(b),w=C.width,E=C.height,y=g(b.subarray(b.pos),w,E);let Q,R,_;switch(this.type){case a.FloatType:_=y.length/4;const S=new Float32Array(_*4);for(let G=0;G<_;G++)f(y,G*4,S,G*4);Q=S,R=a.FloatType;break;case a.HalfFloatType:_=y.length/4;const v=new Uint16Array(_*4);for(let G=0;G<_;G++)I(y,G*4,v,G*4);Q=v,R=a.HalfFloatType;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:w,height:E,data:Q,header:C.string,gamma:C.gamma,exposure:C.exposure,type:R}}setDataType(e){return this.type=e,this}load(e,t,s,n){function i(o,r){switch(o.type){case a.FloatType:case a.HalfFloatType:o.colorSpace=a.LinearSRGBColorSpace,o.minFilter=a.LinearFilter,o.magFilter=a.LinearFilter,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,r)}return super.load(e,i,s,n)}}const ba=Object.freeze(Object.defineProperty({__proto__:null,RGBELoader:Pi},Symbol.toStringTag,{value:"Module"}));function Oi(c,e,t){const s=t.length-c-1;if(e>=t[s])return s-1;if(e<=t[c])return c;let n=c,i=s,o=Math.floor((n+i)/2);for(;e<t[o]||e>=t[o+1];)e<t[o]?i=o:n=o,o=Math.floor((n+i)/2);return o}function Ea(c,e,t,s){const n=[],i=[],o=[];n[0]=1;for(let r=1;r<=t;++r){i[r]=e-s[c+1-r],o[r]=s[c+r]-e;let A=0;for(let l=0;l<r;++l){const h=o[l+1],u=i[r-l],d=n[l]/(h+u);n[l]=A+h*d,A=u*d}n[r]=A}return n}function Ca(c,e,t,s){const n=Oi(c,s,e),i=Ea(n,s,c,e),o=new a.Vector4(0,0,0,0);for(let r=0;r<=c;++r){const A=t[n-c+r],l=i[r],h=A.w*l;o.x+=A.x*h,o.y+=A.y*h,o.z+=A.z*h,o.w+=A.w*l}return o}function Ba(c,e,t,s,n){const i=[];for(let u=0;u<=t;++u)i[u]=0;const o=[];for(let u=0;u<=s;++u)o[u]=i.slice(0);const r=[];for(let u=0;u<=t;++u)r[u]=i.slice(0);r[0][0]=1;const A=i.slice(0),l=i.slice(0);for(let u=1;u<=t;++u){A[u]=e-n[c+1-u],l[u]=n[c+u]-e;let d=0;for(let g=0;g<u;++g){const f=l[g+1],I=A[u-g];r[u][g]=f+I;const b=r[g][u-1]/r[u][g];r[g][u]=d+f*b,d=I*b}r[u][u]=d}for(let u=0;u<=t;++u)o[0][u]=r[u][t];for(let u=0;u<=t;++u){let d=0,g=1;const f=[];for(let I=0;I<=t;++I)f[I]=i.slice(0);f[0][0]=1;for(let I=1;I<=s;++I){let b=0;const C=u-I,w=t-I;u>=I&&(f[g][0]=f[d][0]/r[w+1][C],b=f[g][0]*r[C][w]);const E=C>=-1?1:-C,y=u-1<=w?I-1:t-u;for(let R=E;R<=y;++R)f[g][R]=(f[d][R]-f[d][R-1])/r[w+1][C+R],b+=f[g][R]*r[C+R][w];u<=w&&(f[g][I]=-f[d][I-1]/r[w+1][u],b+=f[g][I]*r[u][w]),o[I][u]=b;const Q=d;d=g,g=Q}}let h=t;for(let u=1;u<=s;++u){for(let d=0;d<=t;++d)o[u][d]*=h;h*=t-u}return o}function ya(c,e,t,s,n){const i=n<c?n:c,o=[],r=Oi(c,s,e),A=Ba(r,s,c,i,e),l=[];for(let h=0;h<t.length;++h){const u=t[h].clone(),d=u.w;u.x*=d,u.y*=d,u.z*=d,l[h]=u}for(let h=0;h<=i;++h){const u=l[r-c].clone().multiplyScalar(A[h][0]);for(let d=1;d<=c;++d)u.add(l[r-c+d].clone().multiplyScalar(A[h][d]));o[h]=u}for(let h=i+1;h<=n+1;++h)o[h]=new a.Vector4(0,0,0);return o}function wa(c,e){let t=1;for(let n=2;n<=c;++n)t*=n;let s=1;for(let n=2;n<=e;++n)s*=n;for(let n=2;n<=c-e;++n)s*=n;return t/s}function Qa(c){const e=c.length,t=[],s=[];for(let i=0;i<e;++i){const o=c[i];t[i]=new a.Vector3(o.x,o.y,o.z),s[i]=o.w}const n=[];for(let i=0;i<e;++i){const o=t[i].clone();for(let r=1;r<=i;++r)o.sub(n[i-r].clone().multiplyScalar(wa(i,r)*s[r]));n[i]=o.divideScalar(s[0])}return n}function xa(c,e,t,s,n){const i=ya(c,e,t,s,n);return Qa(i)}class Sa extends a.Curve{constructor(e,t,s,n,i){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=n||0,this.endKnot=i||this.knots.length-1;for(let o=0;o<s.length;++o){const r=s[o];this.controlPoints[o]=new a.Vector4(r.x,r.y,r.z,r.w)}}getPoint(e,t=new a.Vector3){const s=t,n=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),i=Ca(this.degree,this.knots,this.controlPoints,n);return i.w!==1&&i.divideScalar(i.w),s.set(i.x,i.y,i.z)}getTangent(e,t=new a.Vector3){const s=t,n=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),i=xa(this.degree,this.knots,this.controlPoints,n,1);return s.copy(i[1]).normalize(),s}}let oe,we,ke;class Ta extends a.Loader{constructor(e){super(e)}load(e,t,s,n){const i=this,o=i.path===""?a.LoaderUtils.extractUrlBase(e):i.path,r=new a.FileLoader(this.manager);r.setPath(i.path),r.setResponseType("arraybuffer"),r.setRequestHeader(i.requestHeader),r.setWithCredentials(i.withCredentials),r.load(e,function(A){try{t(i.parse(A,o))}catch(l){n?n(l):console.error(l),i.manager.itemError(e)}},s,n)}parse(e,t){if(Fa(e))oe=new Da().parse(e);else{const n=qi(e);if(!La(n))throw new Error("THREE.FBXLoader: Unknown format.");if(Gs(n)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+Gs(n));oe=new _a().parse(n)}const s=new a.TextureLoader(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new va(s,this.manager).parse(oe)}getFbxTree(){return oe}}class va{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){we=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),s=this.parseMaterials(t),n=this.parseDeformers(),i=new Ma().parse(n);return this.parseScene(n,i,s),ke}parseConnections(){const e=new Map;return"Connections"in oe&&oe.Connections.connections.forEach(function(s){const n=s[0],i=s[1],o=s[2];e.has(n)||e.set(n,{parents:[],children:[]});const r={ID:i,relationship:o};e.get(n).parents.push(r),e.has(i)||e.set(i,{parents:[],children:[]});const A={ID:n,relationship:o};e.get(i).children.push(A)}),e}parseImages(){const e={},t={};if("Video"in oe.Objects){const s=oe.Objects.Video;for(const n in s){const i=s[n],o=parseInt(n);if(e[o]=i.RelativeFilename||i.Filename,"Content"in i){const r=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,A=typeof i.Content=="string"&&i.Content!=="";if(r||A){const l=this.parseImage(s[n]);t[i.RelativeFilename||i.Filename]=l}}}}for(const s in e){const n=e[s];t[n]!==void 0?e[s]=t[n]:e[s]=e[s].split("\\").pop()}return e}parseImage(e){const t=e.Content,s=e.RelativeFilename||e.Filename,n=s.slice(s.lastIndexOf(".")+1).toLowerCase();let i;switch(n){case"bmp":i="image/bmp";break;case"jpg":case"jpeg":i="image/jpeg";break;case"png":i="image/png";break;case"tif":i="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",s),i="image/tga";break;default:console.warn('FBXLoader: Image type "'+n+'" is not supported.');return}if(typeof t=="string")return"data:"+i+";base64,"+t;{const o=new Uint8Array(t);return window.URL.createObjectURL(new Blob([o],{type:i}))}}parseTextures(e){const t=new Map;if("Texture"in oe.Objects){const s=oe.Objects.Texture;for(const n in s){const i=this.parseTexture(s[n],e);t.set(parseInt(n),i)}}return t}parseTexture(e,t){const s=this.loadTexture(e,t);s.ID=e.id,s.name=e.attrName;const n=e.WrapModeU,i=e.WrapModeV,o=n!==void 0?n.value:0,r=i!==void 0?i.value:0;if(s.wrapS=o===0?a.RepeatWrapping:a.ClampToEdgeWrapping,s.wrapT=r===0?a.RepeatWrapping:a.ClampToEdgeWrapping,"Scaling"in e){const A=e.Scaling.value;s.repeat.x=A[0],s.repeat.y=A[1]}if("Translation"in e){const A=e.Translation.value;s.offset.x=A[0],s.offset.y=A[1]}return s}loadTexture(e,t){const s=new Set(["tga","tif","tiff","exr","dds","hdr","ktx2"]),n=e.FileName.split(".").pop().toLowerCase(),i=s.has(n)?this.manager.getHandler(`.${n}`):this.textureLoader;if(!i)return console.warn(`FBXLoader: ${n.toUpperCase()} loader not found, creating placeholder texture for`,e.RelativeFilename),new a.Texture;const o=i.path;o||i.setPath(this.textureLoader.path);const r=we.get(e.id).children;let A;r!==void 0&&r.length>0&&t[r[0].ID]!==void 0&&(A=t[r[0].ID],(A.indexOf("blob:")===0||A.indexOf("data:")===0)&&i.setPath(void 0));const l=i.load(A);return i.setPath(o),l}parseMaterials(e){const t=new Map;if("Material"in oe.Objects){const s=oe.Objects.Material;for(const n in s){const i=this.parseMaterial(s[n],e);i!==null&&t.set(parseInt(n),i)}}return t}parseMaterial(e,t){const s=e.id,n=e.attrName;let i=e.ShadingModel;if(typeof i=="object"&&(i=i.value),!we.has(s))return null;const o=this.parseParameters(e,t,s);let r;switch(i.toLowerCase()){case"phong":r=new a.MeshPhongMaterial;break;case"lambert":r=new a.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',i),r=new a.MeshPhongMaterial;break}return r.setValues(o),r.name=n,r}parseParameters(e,t,s){const n={};e.BumpFactor&&(n.bumpScale=e.BumpFactor.value),e.Diffuse?n.color=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.Diffuse.value),a.SRGBColorSpace):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(n.color=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.DiffuseColor.value),a.SRGBColorSpace)),e.DisplacementFactor&&(n.displacementScale=e.DisplacementFactor.value),e.Emissive?n.emissive=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.Emissive.value),a.SRGBColorSpace):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(n.emissive=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.EmissiveColor.value),a.SRGBColorSpace)),e.EmissiveFactor&&(n.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(n.opacity=parseFloat(e.Opacity.value)),n.opacity<1&&(n.transparent=!0),e.ReflectionFactor&&(n.reflectivity=e.ReflectionFactor.value),e.Shininess&&(n.shininess=e.Shininess.value),e.Specular?n.specular=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.Specular.value),a.SRGBColorSpace):e.SpecularColor&&e.SpecularColor.type==="Color"&&(n.specular=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(e.SpecularColor.value),a.SRGBColorSpace));const i=this;return we.get(s).children.forEach(function(o){const r=o.relationship;switch(r){case"Bump":n.bumpMap=i.getTexture(t,o.ID);break;case"Maya|TEX_ao_map":n.aoMap=i.getTexture(t,o.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":n.map=i.getTexture(t,o.ID),n.map!==void 0&&(n.map.colorSpace=a.SRGBColorSpace);break;case"DisplacementColor":n.displacementMap=i.getTexture(t,o.ID);break;case"EmissiveColor":n.emissiveMap=i.getTexture(t,o.ID),n.emissiveMap!==void 0&&(n.emissiveMap.colorSpace=a.SRGBColorSpace);break;case"NormalMap":case"Maya|TEX_normal_map":n.normalMap=i.getTexture(t,o.ID);break;case"ReflectionColor":n.envMap=i.getTexture(t,o.ID),n.envMap!==void 0&&(n.envMap.mapping=a.EquirectangularReflectionMapping,n.envMap.colorSpace=a.SRGBColorSpace);break;case"SpecularColor":n.specularMap=i.getTexture(t,o.ID),n.specularMap!==void 0&&(n.specularMap.colorSpace=a.SRGBColorSpace);break;case"TransparentColor":case"TransparencyFactor":n.alphaMap=i.getTexture(t,o.ID),n.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r);break}}),n}getTexture(e,t){return"LayeredTexture"in oe.Objects&&t in oe.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=we.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in oe.Objects){const s=oe.Objects.Deformer;for(const n in s){const i=s[n],o=we.get(parseInt(n));if(i.attrType==="Skin"){const r=this.parseSkeleton(o,s);r.ID=n,o.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),r.geometryID=o.parents[0].ID,e[n]=r}else if(i.attrType==="BlendShape"){const r={id:n};r.rawTargets=this.parseMorphTargets(o,s),r.id=n,o.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[n]=r}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const s=[];return e.children.forEach(function(n){const i=t[n.ID];if(i.attrType!=="Cluster")return;const o={ID:n.ID,indices:[],weights:[],transformLink:new a.Matrix4().fromArray(i.TransformLink.a)};"Indexes"in i&&(o.indices=i.Indexes.a,o.weights=i.Weights.a),s.push(o)}),{rawBones:s,bones:[]}}parseMorphTargets(e,t){const s=[];for(let n=0;n<e.children.length;n++){const i=e.children[n],o=t[i.ID],r={name:o.attrName,initialWeight:o.DeformPercent,id:o.id,fullWeights:o.FullWeights.a};if(o.attrType!=="BlendShapeChannel")return;r.geoID=we.get(parseInt(i.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,s.push(r)}return s}parseScene(e,t,s){ke=new a.Group;const n=this.parseModels(e.skeletons,t,s),i=oe.Objects.Model,o=this;n.forEach(function(A){const l=i[A.ID];o.setLookAtProperties(A,l),we.get(A.ID)?.parents?.forEach(function(u){const d=n.get(u.ID);d!==void 0&&d.add(A)}),A.parent===null&&ke.add(A)}),this.bindSkeleton(e.skeletons,t,n),this.addGlobalSceneSettings(),ke.traverse(function(A){if(A.userData.transformData){A.parent&&(A.userData.transformData.parentMatrix=A.parent.matrix,A.userData.transformData.parentMatrixWorld=A.parent.matrixWorld);const l=ji(A.userData.transformData);A.applyMatrix4(l),A.updateWorldMatrix()}A.isSkinnedMesh&&(A.computeBoundingBox(),A.computeBoundingSphere(),A.boundingBox.expandByScalar(3),A.boundingSphere.radius*=3)});const r=new Ra().parse();ke.children.length===1&&ke.children[0].isGroup&&(ke.children[0].animations=r,ke=ke.children[0]),ke.animations=r}parseModels(e,t,s){const n=new Map,i=oe.Objects.Model;for(const o in i){const r=parseInt(o),A=i[o],l=we.get(r);let h=this.buildSkeleton(l,e,r,A.attrName);if(!h){switch(A.attrType){case"Camera":h=this.createCamera(l);break;case"Light":h=this.createLight(l);break;case"Mesh":h=this.createMesh(l,t,s);break;case"NurbsCurve":h=this.createCurve(l,t);break;case"LimbNode":case"Root":h=new a.Bone;break;case"Null":default:h=new a.Group;break}h.name=A.attrName?a.PropertyBinding.sanitizeNodeName(A.attrName):"",h.userData.originalName=A.attrName,h.ID=r}this.getTransformData(h,A),n.set(r,h)}return n}buildSkeleton(e,t,s,n){let i=null;return e?.parents.forEach(function(o){for(const r in t){const A=t[r];A.rawBones.forEach(function(l,h){if(l.ID===o.ID){const u=i;i=new a.Bone,i.matrixWorld.copy(l.transformLink),i.name=n?a.PropertyBinding.sanitizeNodeName(n):"",i.userData.originalName=n,i.ID=s,A.bones[h]=i,u!==null&&i.add(u)}})}}),i}createCamera(e){let t,s;if(e.children.forEach(function(n){const i=oe.Objects.NodeAttribute[n.ID];i!==void 0&&(s=i)}),s===void 0)t=new a.Object3D;else{let n=0;s.CameraProjectionType!==void 0&&s.CameraProjectionType.value===1&&(n=1);let i=1;s.NearPlane!==void 0&&(i=s.NearPlane.value/1e3);let o=1e3;s.FarPlane!==void 0&&(o=s.FarPlane.value/1e3);let r=window.innerWidth,A=window.innerHeight;s.AspectWidth!==void 0&&s.AspectHeight!==void 0&&(r=s.AspectWidth.value,A=s.AspectHeight.value);const l=r/A;let h=45;s.FieldOfView!==void 0&&(h=s.FieldOfView.value);const u=s.FocalLength?s.FocalLength.value:null;switch(n){case 0:t=new a.PerspectiveCamera(h,l,i,o),u!==null&&t.setFocalLength(u);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new a.Object3D;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+n+"."),t=new a.Object3D;break}}return t}createLight(e){let t,s;if(e.children.forEach(function(n){const i=oe.Objects.NodeAttribute[n.ID];i!==void 0&&(s=i)}),s===void 0)t=new a.Object3D;else{let n;s.LightType===void 0?n=0:n=s.LightType.value;let i=16777215;s.Color!==void 0&&(i=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(s.Color.value),a.SRGBColorSpace));let o=s.Intensity===void 0?1:s.Intensity.value/100;s.CastLightOnObject!==void 0&&s.CastLightOnObject.value===0&&(o=0);let r=0;s.FarAttenuationEnd!==void 0&&(s.EnableFarAttenuation!==void 0&&s.EnableFarAttenuation.value===0?r=0:r=s.FarAttenuationEnd.value);const A=1;switch(n){case 0:t=new a.PointLight(i,o,r,A);break;case 1:t=new a.DirectionalLight(i,o);break;case 2:let l=Math.PI/3;s.InnerAngle!==void 0&&(l=a.MathUtils.degToRad(s.InnerAngle.value));let h=0;s.OuterAngle!==void 0&&(h=a.MathUtils.degToRad(s.OuterAngle.value),h=Math.max(h,1)),t=new a.SpotLight(i,o,r,l,h,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+s.LightType.value+", defaulting to a PointLight."),t=new a.PointLight(i,o);break}s.CastShadows!==void 0&&s.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,s){let n,i=null,o=null;const r=[];if(e.children.forEach(function(A){t.has(A.ID)&&(i=t.get(A.ID)),s.has(A.ID)&&r.push(s.get(A.ID))}),r.length>1?o=r:r.length>0?o=r[0]:(o=new a.MeshPhongMaterial({name:a.Loader.DEFAULT_MATERIAL_NAME,color:13421772}),r.push(o)),"color"in i.attributes&&r.forEach(function(A){A.vertexColors=!0}),i.groups.length>0){let A=!1;for(let l=0,h=i.groups.length;l<h;l++){const u=i.groups[l];(u.materialIndex<0||u.materialIndex>=r.length)&&(u.materialIndex=r.length,A=!0)}if(A){const l=new a.MeshStandardMaterial;r.push(l)}}return i.FBX_Deformer?(n=new a.SkinnedMesh(i,o),n.normalizeSkinWeights()):n=new a.Mesh(i,o),n}createCurve(e,t){const s=e.children.reduce(function(i,o){return t.has(o.ID)&&(i=t.get(o.ID)),i},null),n=new a.LineBasicMaterial({name:a.Loader.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new a.Line(s,n)}getTransformData(e,t){const s={};"InheritType"in t&&(s.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?s.eulerOrder=$t(t.RotationOrder.value):s.eulerOrder=$t(0),"Lcl_Translation"in t&&(s.translation=t.Lcl_Translation.value),"PreRotation"in t&&(s.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(s.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(s.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(s.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(s.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(s.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(s.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(s.rotationPivot=t.RotationPivot.value),e.userData.transformData=s}setLookAtProperties(e,t){"LookAtProperty"in t&&we.get(e.ID).children.forEach(function(n){if(n.relationship==="LookAtProperty"){const i=oe.Objects.Model[n.ID];if("Lcl_Translation"in i){const o=i.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(o),ke.add(e.target)):e.lookAt(new a.Vector3().fromArray(o))}}})}bindSkeleton(e,t,s){const n=this.parsePoseNodes();for(const i in e){const o=e[i];we.get(parseInt(o.ID)).parents.forEach(function(A){if(t.has(A.ID)){const l=A.ID;we.get(l).parents.forEach(function(u){s.has(u.ID)&&s.get(u.ID).bind(new a.Skeleton(o.bones),n[u.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in oe.Objects){const t=oe.Objects.Pose;for(const s in t)if(t[s].attrType==="BindPose"&&t[s].NbPoseNodes>0){const n=t[s].PoseNode;Array.isArray(n)?n.forEach(function(i){e[i.Node]=new a.Matrix4().fromArray(i.Matrix.a)}):e[n.Node]=new a.Matrix4().fromArray(n.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in oe){if("AmbientColor"in oe.GlobalSettings){const e=oe.GlobalSettings.AmbientColor.value,t=e[0],s=e[1],n=e[2];if(t!==0||s!==0||n!==0){const i=new a.Color().setRGB(t,s,n,a.SRGBColorSpace);ke.add(new a.AmbientLight(i,1))}}"UnitScaleFactor"in oe.GlobalSettings&&(ke.userData.unitScaleFactor=oe.GlobalSettings.UnitScaleFactor.value)}}}class Ma{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in oe.Objects){const s=oe.Objects.Geometry;for(const n in s){const i=we.get(parseInt(n)),o=this.parseGeometry(i,s[n],e);t.set(parseInt(n),o)}}return this.negativeMaterialIndices===!0&&console.warn("THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),t}parseGeometry(e,t,s){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,s);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,s){const n=s.skeletons,i=[],o=e.parents.map(function(u){return oe.Objects.Model[u.ID]});if(o.length===0)return;const r=e.children.reduce(function(u,d){return n[d.ID]!==void 0&&(u=n[d.ID]),u},null);e.children.forEach(function(u){s.morphTargets[u.ID]!==void 0&&i.push(s.morphTargets[u.ID])});const A=o[0],l={};"RotationOrder"in A&&(l.eulerOrder=$t(A.RotationOrder.value)),"InheritType"in A&&(l.inheritType=parseInt(A.InheritType.value)),"GeometricTranslation"in A&&(l.translation=A.GeometricTranslation.value),"GeometricRotation"in A&&(l.rotation=A.GeometricRotation.value),"GeometricScaling"in A&&(l.scale=A.GeometricScaling.value);const h=ji(l);return this.genGeometry(t,r,i,h)}genGeometry(e,t,s,n){const i=new a.BufferGeometry;e.attrName&&(i.name=e.attrName);const o=this.parseGeoNode(e,t),r=this.genBuffers(o),A=new a.Float32BufferAttribute(r.vertex,3);if(A.applyMatrix4(n),i.setAttribute("position",A),r.colors.length>0&&i.setAttribute("color",new a.Float32BufferAttribute(r.colors,3)),t&&(i.setAttribute("skinIndex",new a.Uint16BufferAttribute(r.weightsIndices,4)),i.setAttribute("skinWeight",new a.Float32BufferAttribute(r.vertexWeights,4)),i.FBX_Deformer=t),r.normal.length>0){const l=new a.Matrix3().getNormalMatrix(n),h=new a.Float32BufferAttribute(r.normal,3);h.applyNormalMatrix(l),i.setAttribute("normal",h)}if(r.uvs.forEach(function(l,h){const u=h===0?"uv":`uv${h}`;i.setAttribute(u,new a.Float32BufferAttribute(r.uvs[h],2))}),o.material&&o.material.mappingType!=="AllSame"){let l=r.materialIndex[0],h=0;if(r.materialIndex.forEach(function(u,d){u!==l&&(i.addGroup(h,d-h,l),l=u,h=d)}),i.groups.length>0){const u=i.groups[i.groups.length-1],d=u.start+u.count;d!==r.materialIndex.length&&i.addGroup(d,r.materialIndex.length-d,l)}i.groups.length===0&&i.addGroup(0,r.materialIndex.length,r.materialIndex[0])}return this.addMorphTargets(i,e,s,n),i}parseGeoNode(e,t){const s={};if(s.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],s.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(s.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(s.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(s.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){s.uv=[];let n=0;for(;e.LayerElementUV[n];)e.LayerElementUV[n].UV&&s.uv.push(this.parseUVs(e.LayerElementUV[n])),n++}return s.weightTable={},t!==null&&(s.skeleton=t,t.rawBones.forEach(function(n,i){n.indices.forEach(function(o,r){s.weightTable[o]===void 0&&(s.weightTable[o]=[]),s.weightTable[o].push({id:i,weight:n.weights[r]})})})),s}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let s=0,n=0,i=!1,o=[],r=[],A=[],l=[],h=[],u=[];const d=this;return e.vertexIndices.forEach(function(g,f){let I,b=!1;g<0&&(g=g^-1,b=!0);let C=[],w=[];if(o.push(g*3,g*3+1,g*3+2),e.color){const E=rn(f,s,g,e.color);A.push(E[0],E[1],E[2])}if(e.skeleton){if(e.weightTable[g]!==void 0&&e.weightTable[g].forEach(function(E){w.push(E.weight),C.push(E.id)}),w.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);const E=[0,0,0,0],y=[0,0,0,0];w.forEach(function(Q,R){let _=Q,S=C[R];y.forEach(function(v,G,N){if(_>v){N[G]=_,_=v;const H=E[G];E[G]=S,S=H}})}),C=E,w=y}for(;w.length<4;)w.push(0),C.push(0);for(let E=0;E<4;++E)h.push(w[E]),u.push(C[E])}if(e.normal){const E=rn(f,s,g,e.normal);r.push(E[0],E[1],E[2])}e.material&&e.material.mappingType!=="AllSame"&&(I=rn(f,s,g,e.material)[0],I<0&&(d.negativeMaterialIndices=!0,I=0)),e.uv&&e.uv.forEach(function(E,y){const Q=rn(f,s,g,E);l[y]===void 0&&(l[y]=[]),l[y].push(Q[0]),l[y].push(Q[1])}),n++,b&&(d.genFace(t,e,o,I,r,A,l,h,u,n),s++,n=0,o=[],r=[],A=[],l=[],h=[],u=[])}),t}getNormalNewell(e){const t=new a.Vector3(0,0,0);for(let s=0;s<e.length;s++){const n=e[s],i=e[(s+1)%e.length];t.x+=(n.y-i.y)*(n.z+i.z),t.y+=(n.z-i.z)*(n.x+i.x),t.z+=(n.x-i.x)*(n.y+i.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),n=(Math.abs(t.z)>.5?new a.Vector3(0,1,0):new a.Vector3(0,0,1)).cross(t).normalize(),i=t.clone().cross(n).normalize();return{normal:t,tangent:n,bitangent:i}}flattenVertex(e,t,s){return new a.Vector2(e.dot(t),e.dot(s))}genFace(e,t,s,n,i,o,r,A,l,h){let u;if(h>3){const d=[],g=t.baseVertexPositions||t.vertexPositions;for(let C=0;C<s.length;C+=3)d.push(new a.Vector3(g[s[C]],g[s[C+1]],g[s[C+2]]));const{tangent:f,bitangent:I}=this.getNormalTangentAndBitangent(d),b=[];for(const C of d)b.push(this.flattenVertex(C,f,I));u=a.ShapeUtils.triangulateShape(b,[])}else h===2?(console.warn("THREE.FBXLoader: Edge topology detected. This is currently not supported. The resulting mesh will not be correct."),u=[[0,1,2]]):u=[[0,1,2]];for(const[d,g,f]of u)e.vertex.push(t.vertexPositions[s[d*3]]),e.vertex.push(t.vertexPositions[s[d*3+1]]),e.vertex.push(t.vertexPositions[s[d*3+2]]),e.vertex.push(t.vertexPositions[s[g*3]]),e.vertex.push(t.vertexPositions[s[g*3+1]]),e.vertex.push(t.vertexPositions[s[g*3+2]]),e.vertex.push(t.vertexPositions[s[f*3]]),e.vertex.push(t.vertexPositions[s[f*3+1]]),e.vertex.push(t.vertexPositions[s[f*3+2]]),t.skeleton&&(e.vertexWeights.push(A[d*4]),e.vertexWeights.push(A[d*4+1]),e.vertexWeights.push(A[d*4+2]),e.vertexWeights.push(A[d*4+3]),e.vertexWeights.push(A[g*4]),e.vertexWeights.push(A[g*4+1]),e.vertexWeights.push(A[g*4+2]),e.vertexWeights.push(A[g*4+3]),e.vertexWeights.push(A[f*4]),e.vertexWeights.push(A[f*4+1]),e.vertexWeights.push(A[f*4+2]),e.vertexWeights.push(A[f*4+3]),e.weightsIndices.push(l[d*4]),e.weightsIndices.push(l[d*4+1]),e.weightsIndices.push(l[d*4+2]),e.weightsIndices.push(l[d*4+3]),e.weightsIndices.push(l[g*4]),e.weightsIndices.push(l[g*4+1]),e.weightsIndices.push(l[g*4+2]),e.weightsIndices.push(l[g*4+3]),e.weightsIndices.push(l[f*4]),e.weightsIndices.push(l[f*4+1]),e.weightsIndices.push(l[f*4+2]),e.weightsIndices.push(l[f*4+3])),t.color&&(e.colors.push(o[d*3]),e.colors.push(o[d*3+1]),e.colors.push(o[d*3+2]),e.colors.push(o[g*3]),e.colors.push(o[g*3+1]),e.colors.push(o[g*3+2]),e.colors.push(o[f*3]),e.colors.push(o[f*3+1]),e.colors.push(o[f*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(n),e.materialIndex.push(n),e.materialIndex.push(n)),t.normal&&(e.normal.push(i[d*3]),e.normal.push(i[d*3+1]),e.normal.push(i[d*3+2]),e.normal.push(i[g*3]),e.normal.push(i[g*3+1]),e.normal.push(i[g*3+2]),e.normal.push(i[f*3]),e.normal.push(i[f*3+1]),e.normal.push(i[f*3+2])),t.uv&&t.uv.forEach(function(I,b){e.uvs[b]===void 0&&(e.uvs[b]=[]),e.uvs[b].push(r[b][d*2]),e.uvs[b].push(r[b][d*2+1]),e.uvs[b].push(r[b][g*2]),e.uvs[b].push(r[b][g*2+1]),e.uvs[b].push(r[b][f*2]),e.uvs[b].push(r[b][f*2+1])})}addMorphTargets(e,t,s,n){if(s.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const i=this;s.forEach(function(o){o.rawTargets.forEach(function(r){const A=oe.Objects.Geometry[r.geoID];A!==void 0&&i.genMorphGeometry(e,t,A,n,r.name)})})}genMorphGeometry(e,t,s,n,i){const o=t.Vertices!==void 0?t.Vertices.a:[],r=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=s.Vertices!==void 0?s.Vertices.a:[],l=s.Indexes!==void 0?s.Indexes.a:[],h=e.attributes.position.count*3,u=new Float32Array(h);for(let I=0;I<l.length;I++){const b=l[I]*3;u[b]=A[I*3],u[b+1]=A[I*3+1],u[b+2]=A[I*3+2]}const d={vertexIndices:r,vertexPositions:u,baseVertexPositions:o},g=this.genBuffers(d),f=new a.Float32BufferAttribute(g.vertex,3);f.name=i||s.attrName,f.applyMatrix4(n),e.morphAttributes.position.push(f)}parseNormals(e){const t=e.MappingInformationType,s=e.ReferenceInformationType,n=e.Normals.a;let i=[];return s==="IndexToDirect"&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:n,indices:i,mappingType:t,referenceType:s}}parseUVs(e){const t=e.MappingInformationType,s=e.ReferenceInformationType,n=e.UV.a;let i=[];return s==="IndexToDirect"&&(i=e.UVIndex.a),{dataSize:2,buffer:n,indices:i,mappingType:t,referenceType:s}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,s=e.ReferenceInformationType,n=e.Colors.a;let i=[];s==="IndexToDirect"&&(i=e.ColorIndex.a);for(let o=0,r=new a.Color;o<n.length;o+=4)r.fromArray(n,o),a.ColorManagement.toWorkingColorSpace(r,a.SRGBColorSpace),r.toArray(n,o);return{dataSize:4,buffer:n,indices:i,mappingType:t,referenceType:s}}parseMaterialIndices(e){const t=e.MappingInformationType,s=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:s};const n=e.Materials.a,i=[];for(let o=0;o<n.length;++o)i.push(o);return{dataSize:1,buffer:n,indices:i,mappingType:t,referenceType:s}}parseNurbsGeometry(e){const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new a.BufferGeometry;const s=t-1,n=e.KnotVector.a,i=[],o=e.Points.a;for(let u=0,d=o.length;u<d;u+=4)i.push(new a.Vector4().fromArray(o,u));let r,A;if(e.Form==="Closed")i.push(i[0]);else if(e.Form==="Periodic"){r=s,A=n.length-1-r;for(let u=0;u<s;++u)i.push(i[u])}const h=new Sa(s,n,i,r,A).getPoints(i.length*12);return new a.BufferGeometry().setFromPoints(h)}}class Ra{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const s in t){const n=t[s],i=this.addClip(n);e.push(i)}return e}parseClips(){if(oe.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=oe.Objects.AnimationCurveNode,t=new Map;for(const s in e){const n=e[s];if(n.attrName.match(/S|R|T|DeformPercent/)!==null){const i={id:n.id,attr:n.attrName,curves:{}};t.set(i.id,i)}}return t}parseAnimationCurves(e){const t=oe.Objects.AnimationCurve;for(const s in t){const n={id:t[s].id,times:t[s].KeyTime.a.map(ka),values:t[s].KeyValueFloat.a},i=we.get(n.id);if(i!==void 0){const o=i.parents[0].ID,r=i.parents[0].relationship;r.match(/X/)?e.get(o).curves.x=n:r.match(/Y/)?e.get(o).curves.y=n:r.match(/Z/)?e.get(o).curves.z=n:r.match(/DeformPercent/)&&e.has(o)&&(e.get(o).curves.morph=n)}}}parseAnimationLayers(e){const t=oe.Objects.AnimationLayer,s=new Map;for(const n in t){const i=[],o=we.get(parseInt(n));o!==void 0&&(o.children.forEach(function(A,l){if(e.has(A.ID)){const h=e.get(A.ID);if(h.curves.x!==void 0||h.curves.y!==void 0||h.curves.z!==void 0){if(i[l]===void 0){const u=we.get(A.ID).parents.filter(function(d){return d.relationship!==void 0})[0].ID;if(u!==void 0){const d=oe.Objects.Model[u.toString()];if(d===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",A);return}const g={modelName:d.attrName?a.PropertyBinding.sanitizeNodeName(d.attrName):"",ID:d.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};ke.traverse(function(f){f.ID===d.id&&(g.transform=f.matrix,f.userData.transformData&&(g.eulerOrder=f.userData.transformData.eulerOrder))}),g.transform||(g.transform=new a.Matrix4),"PreRotation"in d&&(g.preRotation=d.PreRotation.value),"PostRotation"in d&&(g.postRotation=d.PostRotation.value),i[l]=g}}i[l]&&(i[l][h.attr]=h)}else if(h.curves.morph!==void 0){if(i[l]===void 0){const u=we.get(A.ID).parents.filter(function(C){return C.relationship!==void 0})[0].ID,d=we.get(u).parents[0].ID,g=we.get(d).parents[0].ID,f=we.get(g).parents[0].ID,I=oe.Objects.Model[f],b={modelName:I.attrName?a.PropertyBinding.sanitizeNodeName(I.attrName):"",morphName:oe.Objects.Deformer[u].attrName};i[l]=b}i[l][h.attr]=h}}}),s.set(parseInt(n),i))}return s}parseAnimStacks(e){const t=oe.Objects.AnimationStack,s={};for(const n in t){const i=we.get(parseInt(n)).children;i.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const o=e.get(i[0].ID);s[n]={name:t[n].attrName,layer:o}}return s}addClip(e){let t=[];const s=this;return e.layer.forEach(function(n){t=t.concat(s.generateTracks(n))}),new a.AnimationClip(e.name,-1,t)}generateTracks(e){const t=[];let s=new a.Vector3,n=new a.Vector3;if(e.transform&&e.transform.decompose(s,new a.Quaternion,n),s=s.toArray(),n=n.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.T.curves,s,"position");i!==void 0&&t.push(i)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const i=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);i!==void 0&&t.push(i)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.S.curves,n,"scale");i!==void 0&&t.push(i)}if(e.DeformPercent!==void 0){const i=this.generateMorphTrack(e);i!==void 0&&t.push(i)}return t}generateVectorTrack(e,t,s,n){const i=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(i,t,s);return new a.VectorKeyframeTrack(e+"."+n,i,o)}generateRotationTrack(e,t,s,n,i){let o,r;if(t.x===void 0||t.y===void 0||t.z===void 0){console.warn("THREE.FBXLoader: Missing rotation curves "+(t.x===void 0?"x ":"")+(t.y===void 0?"y ":"")+(t.z===void 0?"z ":"")+" for animation of "+e+". This is currently not supported.");return}if(t.x!==void 0&&t.y!==void 0&&t.z!==void 0){const d=this.interpolateRotations(t.x,t.y,t.z,i);o=d[0],r=d[1]}const A=$t(0);s!==void 0&&(s=s.map(a.MathUtils.degToRad),s.push(A),s=new a.Euler().fromArray(s),s=new a.Quaternion().setFromEuler(s)),n!==void 0&&(n=n.map(a.MathUtils.degToRad),n.push(A),n=new a.Euler().fromArray(n),n=new a.Quaternion().setFromEuler(n).invert());const l=new a.Quaternion,h=new a.Euler,u=[];if(!(!r||!o)){for(let d=0;d<r.length;d+=3)h.set(r[d],r[d+1],r[d+2],i),l.setFromEuler(h),s!==void 0&&l.premultiply(s),n!==void 0&&l.multiply(n),d>2&&new a.Quaternion().fromArray(u,(d-3)/3*4).dot(l)<0&&l.set(-l.x,-l.y,-l.z,-l.w),l.toArray(u,d/3*4);return new a.QuaternionKeyframeTrack(e+".quaternion",o,u)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,s=t.values.map(function(i){return i/100}),n=ke.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new a.NumberKeyframeTrack(e.modelName+".morphTargetInfluences["+n+"]",t.times,s)}getTimesForAllAxes(e){let t=[];if(e.x!==void 0&&(t=t.concat(e.x.times)),e.y!==void 0&&(t=t.concat(e.y.times)),e.z!==void 0&&(t=t.concat(e.z.times)),t=t.sort(function(s,n){return s-n}),t.length>1){let s=1,n=t[0];for(let i=1;i<t.length;i++){const o=t[i];o!==n&&(t[s]=o,n=o,s++)}t=t.slice(0,s)}return t}getKeyframeTrackValues(e,t,s){const n=s,i=[];let o=-1,r=-1,A=-1;return e.forEach(function(l){if(t.x&&(o=t.x.times.indexOf(l)),t.y&&(r=t.y.times.indexOf(l)),t.z&&(A=t.z.times.indexOf(l)),o!==-1){const h=t.x.values[o];i.push(h),n[0]=h}else i.push(n[0]);if(r!==-1){const h=t.y.values[r];i.push(h),n[1]=h}else i.push(n[1]);if(A!==-1){const h=t.z.values[A];i.push(h),n[2]=h}else i.push(n[2])}),i}interpolateRotations(e,t,s,n){const i=[],o=[];i.push(e.times[0]),o.push(a.MathUtils.degToRad(e.values[0])),o.push(a.MathUtils.degToRad(t.values[0])),o.push(a.MathUtils.degToRad(s.values[0]));for(let r=1;r<e.values.length;r++){const A=[e.values[r-1],t.values[r-1],s.values[r-1]];if(isNaN(A[0])||isNaN(A[1])||isNaN(A[2]))continue;const l=A.map(a.MathUtils.degToRad),h=[e.values[r],t.values[r],s.values[r]];if(isNaN(h[0])||isNaN(h[1])||isNaN(h[2]))continue;const u=h.map(a.MathUtils.degToRad),d=[h[0]-A[0],h[1]-A[1],h[2]-A[2]],g=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(g[0]>=180||g[1]>=180||g[2]>=180){const I=Math.max(...g)/180,b=new a.Euler(...l,n),C=new a.Euler(...u,n),w=new a.Quaternion().setFromEuler(b),E=new a.Quaternion().setFromEuler(C);w.dot(E)&&E.set(-E.x,-E.y,-E.z,-E.w);const y=e.times[r-1],Q=e.times[r]-y,R=new a.Quaternion,_=new a.Euler;for(let S=0;S<1;S+=1/I)R.copy(w.clone().slerp(E.clone(),S)),i.push(y+S*Q),_.setFromQuaternion(R,n),o.push(_.x),o.push(_.y),o.push(_.z)}else i.push(e.times[r]),o.push(a.MathUtils.degToRad(e.values[r])),o.push(a.MathUtils.degToRad(t.values[r])),o.push(a.MathUtils.degToRad(s.values[r]))}return[i,o]}}class _a{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new Hi,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,s=e.split(/[\r\n]+/);return s.forEach(function(n,i){const o=n.match(/^[\s\t]*;/),r=n.match(/^[\s\t]*$/);if(o||r)return;const A=n.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),l=n.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),h=n.match("^\\t{"+(t.currentIndent-1)+"}}");A?t.parseNodeBegin(n,A):l?t.parseNodeProperty(n,l,s[++i]):h?t.popStack():n.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(n)}),this.allNodes}parseNodeBegin(e,t){const s=t[1].trim().replace(/^"/,"").replace(/"$/,""),n=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),i={name:s},o=this.parseNodeAttr(n),r=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(s,i):s in r?(s==="PoseNode"?r.PoseNode.push(i):r[s].id!==void 0&&(r[s]={},r[s][r[s].id]=r[s]),o.id!==""&&(r[s][o.id]=i)):typeof o.id=="number"?(r[s]={},r[s][o.id]=i):s!=="Properties70"&&(s==="PoseNode"?r[s]=[i]:r[s]=i),typeof o.id=="number"&&(i.id=o.id),o.name!==""&&(i.attrName=o.name),o.type!==""&&(i.attrType=o.type),this.pushStack(i)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let s="",n="";return e.length>1&&(s=e[1].replace(/^(\w+)::/,""),n=e[2]),{id:t,name:s,type:n}}parseNodeProperty(e,t,s){let n=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();n==="Content"&&i===","&&(i=s.replace(/"/g,"").replace(/,$/,"").trim());const o=this.getCurrentNode();if(o.name==="Properties70"){this.parseNodeSpecialProperty(e,n,i);return}if(n==="C"){const A=i.split(",").slice(1),l=parseInt(A[0]),h=parseInt(A[1]);let u=i.split(",").slice(3);u=u.map(function(d){return d.trim().replace(/^"/,"")}),n="connections",i=[l,h],Na(i,u),o[n]===void 0&&(o[n]=[])}n==="Node"&&(o.id=i),n in o&&Array.isArray(o[n])?o[n].push(i):n!=="a"?o[n]=i:o.a=i,this.setCurrentProp(o,n),n==="a"&&i.slice(-1)!==","&&(o.a=Ln(i))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=Ln(t.a))}parseNodeSpecialProperty(e,t,s){const n=s.split('",').map(function(h){return h.trim().replace(/^\"/,"").replace(/\s/,"_")}),i=n[0],o=n[1],r=n[2],A=n[3];let l=n[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=Ln(l);break}this.getPrevNode()[i]={type:o,type2:r,flag:A,value:l},this.setCurrentProp(this.getPrevNode(),i)}}class Da{parse(e){const t=new ks(e);t.skip(23);const s=t.getUint32();if(s<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+s);const n=new Hi;for(;!this.endOfContent(t);){const i=this.parseNode(t,s);i!==null&&n.add(i.name,i)}return n}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const s={},n=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const o=e.getUint8(),r=e.getString(o);if(n===0)return null;const A=[];for(let d=0;d<i;d++)A.push(this.parseProperty(e));const l=A.length>0?A[0]:"",h=A.length>1?A[1]:"",u=A.length>2?A[2]:"";for(s.singleProperty=i===1&&e.getOffset()===n;n>e.getOffset();){const d=this.parseNode(e,t);d!==null&&this.parseSubNode(r,s,d)}return s.propertyList=A,typeof l=="number"&&(s.id=l),h!==""&&(s.attrName=h),u!==""&&(s.attrType=u),r!==""&&(s.name=r),s}parseSubNode(e,t,s){if(s.singleProperty===!0){const n=s.propertyList[0];Array.isArray(n)?(t[s.name]=s,s.a=n):t[s.name]=n}else if(e==="Connections"&&s.name==="C"){const n=[];s.propertyList.forEach(function(i,o){o!==0&&n.push(i)}),t.connections===void 0&&(t.connections=[]),t.connections.push(n)}else if(s.name==="Properties70")Object.keys(s).forEach(function(i){t[i]=s[i]});else if(e==="Properties70"&&s.name==="P"){let n=s.propertyList[0],i=s.propertyList[1];const o=s.propertyList[2],r=s.propertyList[3];let A;n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),i.indexOf("Lcl ")===0&&(i=i.replace("Lcl ","Lcl_")),i==="Color"||i==="ColorRGB"||i==="Vector"||i==="Vector3D"||i.indexOf("Lcl_")===0?A=[s.propertyList[4],s.propertyList[5],s.propertyList[6]]:A=s.propertyList[4],t[n]={type:i,type2:o,flag:r,value:A}}else t[s.name]===void 0?typeof s.id=="number"?(t[s.name]={},t[s.name][s.id]=s):t[s.name]=s:s.name==="PoseNode"?(Array.isArray(t[s.name])||(t[s.name]=[t[s.name]]),t[s.name].push(s)):t[s.name][s.id]===void 0&&(t[s.name][s.id]=s)}parseProperty(e){const t=e.getString(1);let s;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return s=e.getUint32(),e.getArrayBuffer(s);case"S":return s=e.getUint32(),e.getString(s);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const n=e.getUint32(),i=e.getUint32(),o=e.getUint32();if(i===0)switch(t){case"b":case"c":return e.getBooleanArray(n);case"d":return e.getFloat64Array(n);case"f":return e.getFloat32Array(n);case"i":return e.getInt32Array(n);case"l":return e.getInt64Array(n)}const r=Jt(new Uint8Array(e.getArrayBuffer(o))),A=new ks(r.buffer);switch(t){case"b":case"c":return A.getBooleanArray(n);case"d":return A.getFloat64Array(n);case"f":return A.getFloat32Array(n);case"i":return A.getInt32Array(n);case"l":return A.getInt64Array(n)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class ks{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=t!==void 0?t:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(e){const t=[];for(let s=0;s<e;s++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t&2147483648?(t=~t&4294967295,e=~e&4294967295,e===4294967295&&(t=t+1&4294967295),e=e+1&4294967295,-(t*4294967296+e)):t*4294967296+e}getInt64Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),t*4294967296+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let s=0;s<e;s++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){const t=this.offset;let s=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const n=s.indexOf(0);return n>=0&&(s=new Uint8Array(this.dv.buffer,t,n)),this._textDecoder.decode(s)}}class Hi{add(e,t){this[e]=t}}function Fa(c){const e="Kaydara FBX Binary \0";return c.byteLength>=e.length&&e===qi(c,0,e.length)}function La(c){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function s(n){const i=c[n-1];return c=c.slice(t+n),t++,i}for(let n=0;n<e.length;++n)if(s(1)===e[n])return!1;return!0}function Gs(c){const e=/FBXVersion: (\d+)/,t=c.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function ka(c){return c/46186158e3}const Ga=[];function rn(c,e,t,s){let n;switch(s.mappingType){case"ByPolygonVertex":n=c;break;case"ByPolygon":n=e;break;case"ByVertice":n=t;break;case"AllSame":n=s.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+s.mappingType)}s.referenceType==="IndexToDirect"&&(n=s.indices[n]);const i=n*s.dataSize,o=i+s.dataSize;return Ua(Ga,s.buffer,i,o)}const Fn=new a.Euler,Mt=new a.Vector3;function ji(c){const e=new a.Matrix4,t=new a.Matrix4,s=new a.Matrix4,n=new a.Matrix4,i=new a.Matrix4,o=new a.Matrix4,r=new a.Matrix4,A=new a.Matrix4,l=new a.Matrix4,h=new a.Matrix4,u=new a.Matrix4,d=new a.Matrix4,g=c.inheritType?c.inheritType:0;c.translation&&e.setPosition(Mt.fromArray(c.translation));const f=$t(0);if(c.preRotation){const N=c.preRotation.map(a.MathUtils.degToRad);N.push(f),t.makeRotationFromEuler(Fn.fromArray(N))}if(c.rotation){const N=c.rotation.map(a.MathUtils.degToRad);N.push(c.eulerOrder||f),s.makeRotationFromEuler(Fn.fromArray(N))}if(c.postRotation){const N=c.postRotation.map(a.MathUtils.degToRad);N.push(f),n.makeRotationFromEuler(Fn.fromArray(N)),n.invert()}c.scale&&i.scale(Mt.fromArray(c.scale)),c.scalingOffset&&r.setPosition(Mt.fromArray(c.scalingOffset)),c.scalingPivot&&o.setPosition(Mt.fromArray(c.scalingPivot)),c.rotationOffset&&A.setPosition(Mt.fromArray(c.rotationOffset)),c.rotationPivot&&l.setPosition(Mt.fromArray(c.rotationPivot)),c.parentMatrixWorld&&(u.copy(c.parentMatrix),h.copy(c.parentMatrixWorld));const I=t.clone().multiply(s).multiply(n),b=new a.Matrix4;b.extractRotation(h);const C=new a.Matrix4;C.copyPosition(h);const w=C.clone().invert().multiply(h),E=b.clone().invert().multiply(w),y=i,Q=new a.Matrix4;if(g===0)Q.copy(b).multiply(I).multiply(E).multiply(y);else if(g===1)Q.copy(b).multiply(E).multiply(I).multiply(y);else{const H=new a.Matrix4().scale(new a.Vector3().setFromMatrixScale(u)).clone().invert(),X=E.clone().multiply(H);Q.copy(b).multiply(I).multiply(X).multiply(y)}const R=l.clone().invert(),_=o.clone().invert();let S=e.clone().multiply(A).multiply(l).multiply(t).multiply(s).multiply(n).multiply(R).multiply(r).multiply(o).multiply(i).multiply(_);const v=new a.Matrix4().copyPosition(S),G=h.clone().multiply(v);return d.copyPosition(G),S=d.clone().multiply(Q),S.premultiply(h.invert()),S}function $t(c){c=c||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return c===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[c]}function Ln(c){return c.split(",").map(function(t){return parseFloat(t)})}function qi(c,e,t){return e===void 0&&(e=0),t===void 0&&(t=c.byteLength),new TextDecoder().decode(new Uint8Array(c,e,t))}function Na(c,e){for(let t=0,s=c.length,n=e.length;t<n;t++,s++)c[s]=e[t]}function Ua(c,e,t,s){for(let n=t,i=0;n<s;n++,i++)c[i]=e[n];return c}class Pa extends a.Loader{constructor(e){super(e)}load(e,t,s,n){const i=this,o=this.path===""?a.LoaderUtils.extractUrlBase(e):this.path,r=new a.FileLoader(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(A){try{t(i.parse(A,o))}catch(l){n?n(l):console.error(l),i.manager.itemError(e)}},s,n)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const s=e.split(`
46
+ `);let n={};const i=/\s+/,o={};for(let A=0;A<s.length;A++){let l=s[A];if(l=l.trim(),l.length===0||l.charAt(0)==="#")continue;const h=l.indexOf(" ");let u=h>=0?l.substring(0,h):l;u=u.toLowerCase();let d=h>=0?l.substring(h+1):"";if(d=d.trim(),u==="newmtl")n={name:d},o[d]=n;else if(u==="ka"||u==="kd"||u==="ks"||u==="ke"){const g=d.split(i,3);n[u]=[parseFloat(g[0]),parseFloat(g[1]),parseFloat(g[2])]}else n[u]=d}const r=new Oa(this.resourcePath||t,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(o),r}}class Oa{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:a.FrontSide,this.wrap=this.options.wrap!==void 0?this.options.wrap:a.RepeatWrapping}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const s in e){const n=e[s],i={};t[s]=i;for(const o in n){let r=!0,A=n[o];const l=o.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(A=[A[0]/255,A[1]/255,A[2]/255]),this.options&&this.options.ignoreZeroRGBs&&A[0]===0&&A[1]===0&&A[2]===0&&(r=!1);break}r&&(i[l]=A)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,s=this.materialsInfo[e],n={name:e,side:this.side};function i(r,A){return typeof A!="string"||A===""?"":/^https?:\/\//i.test(A)?A:r+A}function o(r,A){if(n[r])return;const l=t.getTextureParams(A,n),h=t.loadTexture(i(t.baseUrl,l.url));h.repeat.copy(l.scale),h.offset.copy(l.offset),h.wrapS=t.wrap,h.wrapT=t.wrap,(r==="map"||r==="emissiveMap")&&(h.colorSpace=a.SRGBColorSpace),n[r]=h}for(const r in s){const A=s[r];let l;if(A!=="")switch(r.toLowerCase()){case"kd":n.color=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(A),a.SRGBColorSpace);break;case"ks":n.specular=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(A),a.SRGBColorSpace);break;case"ke":n.emissive=a.ColorManagement.toWorkingColorSpace(new a.Color().fromArray(A),a.SRGBColorSpace);break;case"map_kd":o("map",A);break;case"map_ks":o("specularMap",A);break;case"map_ke":o("emissiveMap",A);break;case"norm":o("normalMap",A);break;case"map_bump":case"bump":o("bumpMap",A);break;case"map_d":o("alphaMap",A),n.transparent=!0;break;case"ns":n.shininess=parseFloat(A);break;case"d":l=parseFloat(A),l<1&&(n.opacity=l,n.transparent=!0);break;case"tr":l=parseFloat(A),this.options&&this.options.invertTrProperty&&(l=1-l),l>0&&(n.opacity=1-l,n.transparent=!0);break}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]}getTextureParams(e,t){const s={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},n=e.split(/\s+/);let i;return i=n.indexOf("-bm"),i>=0&&(t.bumpScale=parseFloat(n[i+1]),n.splice(i,2)),i=n.indexOf("-s"),i>=0&&(s.scale.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),i=n.indexOf("-o"),i>=0&&(s.offset.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),s.url=n.join(" ").trim(),s}loadTexture(e,t,s,n,i){const o=this.manager!==void 0?this.manager:a.DefaultLoadingManager;let r=o.getHandler(e);r===null&&(r=new a.TextureLoader(o)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const A=r.load(e,s,n,i);return t!==void 0&&(A.mapping=t),A}}const Ha=/^[og]\s*(.+)?/,ja=/^mtllib /,qa=/^usemtl /,za=/^usemap /,Ns=/\s+/,Us=new a.Vector3,kn=new a.Vector3,Ps=new a.Vector3,Os=new a.Vector3,Je=new a.Vector3,an=new a.Color;function Ka(){const c={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}const s=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(n,i){const o=this._finalize(!1);o&&(o.inherited||o.groupCount<=0)&&this.materials.splice(o.index,1);const r={index:this.materials.length,name:n||"",mtllib:Array.isArray(i)&&i.length>0?i[i.length-1]:"",smooth:o!==void 0?o.smooth:this.smooth,groupStart:o!==void 0?o.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(A){const l={index:typeof A=="number"?A:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return l.clone=this.clone.bind(l),l}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(n){const i=this.currentMaterial();if(i&&i.groupEnd===-1&&(i.groupEnd=this.geometry.vertices.length/3,i.groupCount=i.groupEnd-i.groupStart,i.inherited=!1),n&&this.materials.length>1)for(let o=this.materials.length-1;o>=0;o--)this.materials[o].groupCount<=0&&this.materials.splice(o,1);return n&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),i}},s&&s.name&&typeof s.clone=="function"){const n=s.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const s=parseInt(e,10);return(s>=0?s-1:s+t/3)*3},parseNormalIndex:function(e,t){const s=parseInt(e,10);return(s>=0?s-1:s+t/3)*3},parseUVIndex:function(e,t){const s=parseInt(e,10);return(s>=0?s-1:s+t/2)*2},addVertex:function(e,t,s){const n=this.vertices,i=this.object.geometry.vertices;i.push(n[e+0],n[e+1],n[e+2]),i.push(n[t+0],n[t+1],n[t+2]),i.push(n[s+0],n[s+1],n[s+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,s){const n=this.normals,i=this.object.geometry.normals;i.push(n[e+0],n[e+1],n[e+2]),i.push(n[t+0],n[t+1],n[t+2]),i.push(n[s+0],n[s+1],n[s+2])},addFaceNormal:function(e,t,s){const n=this.vertices,i=this.object.geometry.normals;Us.fromArray(n,e),kn.fromArray(n,t),Ps.fromArray(n,s),Je.subVectors(Ps,kn),Os.subVectors(Us,kn),Je.cross(Os),Je.normalize(),i.push(Je.x,Je.y,Je.z),i.push(Je.x,Je.y,Je.z),i.push(Je.x,Je.y,Je.z)},addColor:function(e,t,s){const n=this.colors,i=this.object.geometry.colors;n[e]!==void 0&&i.push(n[e+0],n[e+1],n[e+2]),n[t]!==void 0&&i.push(n[t+0],n[t+1],n[t+2]),n[s]!==void 0&&i.push(n[s+0],n[s+1],n[s+2])},addUV:function(e,t,s){const n=this.uvs,i=this.object.geometry.uvs;i.push(n[e+0],n[e+1]),i.push(n[t+0],n[t+1]),i.push(n[s+0],n[s+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,s,n,i,o,r,A,l){const h=this.vertices.length;let u=this.parseVertexIndex(e,h),d=this.parseVertexIndex(t,h),g=this.parseVertexIndex(s,h);if(this.addVertex(u,d,g),this.addColor(u,d,g),r!==void 0&&r!==""){const f=this.normals.length;u=this.parseNormalIndex(r,f),d=this.parseNormalIndex(A,f),g=this.parseNormalIndex(l,f),this.addNormal(u,d,g)}else this.addFaceNormal(u,d,g);if(n!==void 0&&n!==""){const f=this.uvs.length;u=this.parseUVIndex(n,f),d=this.parseUVIndex(i,f),g=this.parseUVIndex(o,f),this.addUV(u,d,g),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let s=0,n=e.length;s<n;s++){const i=this.parseVertexIndex(e[s],t);this.addVertexPoint(i),this.addColor(i)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const s=this.vertices.length,n=this.uvs.length;for(let i=0,o=e.length;i<o;i++)this.addVertexLine(this.parseVertexIndex(e[i],s));for(let i=0,o=t.length;i<o;i++)this.addUVLine(this.parseUVIndex(t[i],n))}};return c.startObject("",!1),c}class Ya extends a.Loader{constructor(e){super(e),this.materials=null,this.materialsLoader=new Pa(e)}load(e,t,s,n){const i=this,o=new a.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,async function(r){try{const A=i.parse(r,!0);for(let l=0,h=A.materialLibraries.length;l<h;l++){const u=A.materialLibraries[l],d=e.startsWith("blob:")?e+"/"+u:new URL(u,e);console.debug("Loading MTL file: "+d),await new Promise((g,f)=>{i.materialsLoader.load(d.toString(),I=>{i.setMaterials(I),g()},null,f)})}t(i.createObjects(A))}catch(A){n?n(A):console.error(A),i.manager.itemError(e)}},s,n)}setMTLLoader(e){return this.materialsLoader=e,this}setMaterials(e){return this.materials=e,this}parse(e,t=!1){const s=new Ka;e.indexOf(`\r
47
47
  `)!==-1&&(e=e.replace(/\r\n/g,`
48
48
  `)),e.indexOf(`\\
49
49
  `)!==-1&&(e=e.replace(/\\\n/g,""));const n=e.split(`
50
- `);let i=[];for(let o=0,r=n.length;o<r;o++){const A=n[o].trimStart();if(A.length===0)continue;const l=A.charAt(0);if(l!=="#")if(l==="v"){const h=A.split(Ns);switch(h[0]){case"v":s.vertices.push(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3])),h.length>=7?(rn.setRGB(parseFloat(h[4]),parseFloat(h[5]),parseFloat(h[6]),a.SRGBColorSpace),s.colors.push(rn.r,rn.g,rn.b)):s.colors.push(void 0,void 0,void 0);break;case"vn":s.normals.push(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3]));break;case"vt":s.uvs.push(parseFloat(h[1]),parseFloat(h[2]));break}}else if(l==="f"){const u=A.slice(1).trim().split(Ns),p=[];for(let f=0,I=u.length;f<I;f++){const b=u[f];if(b.length>0){const E=b.split("/");p.push(E)}}const g=p[0];for(let f=1,I=p.length-1;f<I;f++){const b=p[f],E=p[f+1];s.addFace(g[0],b[0],E[0],g[1],b[1],E[1],g[2],b[2],E[2])}}else if(l==="l"){const h=A.substring(1).trim().split(" ");let u=[];const p=[];if(A.indexOf("/")===-1)u=h;else for(let g=0,f=h.length;g<f;g++){const I=h[g].split("/");I[0]!==""&&u.push(I[0]),I[1]!==""&&p.push(I[1])}s.addLineGeometry(u,p)}else if(l==="p"){const u=A.slice(1).trim().split(" ");s.addPointGeometry(u)}else if((i=Qa.exec(A))!==null){const h=(" "+i[0].slice(1).trim()).slice(1);s.startObject(h)}else if(Sa.test(A))s.object.startMaterial(A.substring(7).trim(),s.materialLibraries);else if(xa.test(A))s.materialLibraries.push(A.substring(7).trim());else if(Ta.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(l==="s"){if(i=A.split(" "),i.length>1){const u=i[1].trim().toLowerCase();s.object.smooth=u!=="0"&&u!=="off"}else s.object.smooth=!0;const h=s.object.currentMaterial();h&&(h.smooth=s.object.smooth)}else{if(A==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+A+'"')}}return s.finalize(),t?s:this.createObjects(s)}createObjects(e){const t=new a.Group;if(t.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let n=0,i=e.objects.length;n<i;n++){const o=e.objects[n],r=o.geometry,A=o.materials,l=r.type==="Line",h=r.type==="Points";let u=!1;if(r.vertices.length===0)continue;const p=new a.BufferGeometry;p.setAttribute("position",new a.Float32BufferAttribute(r.vertices,3)),r.normals.length>0&&p.setAttribute("normal",new a.Float32BufferAttribute(r.normals,3)),r.colors.length>0&&(u=!0,p.setAttribute("color",new a.Float32BufferAttribute(r.colors,3))),r.hasUVIndices===!0&&p.setAttribute("uv",new a.Float32BufferAttribute(r.uvs,2));const g=[];for(let I=0,b=A.length;I<b;I++){const E=A[I],y=E.name+"_"+E.smooth+"_"+u;let C=e.materials[y];if(this.materials!==null){if(C=this.materials.create(E.name),l&&C&&!(C instanceof a.LineBasicMaterial)){const w=new a.LineBasicMaterial;a.Material.prototype.copy.call(w,C),w.color.copy(C.color),C=w}else if(h&&C&&!(C instanceof a.PointsMaterial)){const w=new a.PointsMaterial({size:10,sizeAttenuation:!1});a.Material.prototype.copy.call(w,C),w.color.copy(C.color),w.map=C.map,C=w}}C===void 0&&(l?C=new a.LineBasicMaterial:h?C=new a.PointsMaterial({size:1,sizeAttenuation:!1}):C=new a.MeshPhongMaterial,C.name=E.name,C.flatShading=!E.smooth,C.vertexColors=u,e.materials[y]=C),g.push(C)}let f;if(g.length>1){for(let I=0,b=A.length;I<b;I++){const E=A[I];p.addGroup(E.groupStart,E.groupCount,I)}l?f=new a.LineSegments(p,g):h?f=new a.Points(p,g):f=new a.Mesh(p,g)}else l?f=new a.LineSegments(p,g[0]):h?f=new a.Points(p,g[0]):f=new a.Mesh(p,g[0]);f.name=o.name,t.add(f)}else if(e.vertices.length>0){const n=new a.PointsMaterial({size:1,sizeAttenuation:!1}),i=new a.BufferGeometry;i.setAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(i.setAttribute("color",new a.Float32BufferAttribute(e.colors,3)),n.vertexColors=!0);const o=new a.Points(i,n);t.add(o)}return t}}const Os={type:"change"},is={type:"start"},Oi={type:"end"},Ra={type:"endMovement"},an=new a.Ray,Hs=new a.Plane,Da=Math.cos(70*a.MathUtils.DEG2RAD),Se=new a.Vector3;new a.Vector3;const Ne=2*Math.PI,he={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Bt=1e-6;let _a=class extends a.Controls{constructor(e,t=null){super(e,t),this.state=he.NONE,this.enabled=!0,this.target=new a.Vector3,this.cursor=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:a.MOUSE.ROTATE,MIDDLE:a.MOUSE.DOLLY,RIGHT:a.MOUSE.PAN},this.touches={ONE:a.TOUCH.ROTATE,TWO:a.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new a.Vector3,this._lastQuaternion=new a.Quaternion,this._lastTargetPosition=new a.Vector3,this._quat=new a.Quaternion().setFromUnitVectors(e.up,new a.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new a.Spherical,this._sphericalDelta=new a.Spherical,this._scale=1,this._currentScale=1,this._panOffset=new a.Vector3,this._rotateStart=new a.Vector2,this._rotateEnd=new a.Vector2,this._rotateDelta=new a.Vector2,this._panStart=new a.Vector2,this._panEnd=new a.Vector2,this._panDelta=new a.Vector2,this._dollyStart=new a.Vector2,this._dollyEnd=new a.Vector2,this._dollyDelta=new a.Vector2,this._dollyDirection=new a.Vector3,this._mouse=new a.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=La.bind(this),this._onPointerDown=Fa.bind(this),this._onPointerUp=ka.bind(this),this._onContextMenu=ja.bind(this),this._onMouseWheel=Ua.bind(this),this._onKeyDown=Pa.bind(this),this._onTouchStart=Oa.bind(this),this._onTouchMove=Ha.bind(this),this._onMouseDown=Na.bind(this),this._onMouseMove=Ga.bind(this),this._interceptControlDown=qa.bind(this),this._interceptControlUp=za.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Os),this.update(),this.state=he.NONE,this._isDamping=!1}update(e=null){if(this.enableDamping&&e===null)return;const t=this.object.getWorldPosition(this.object.position);Se.copy(t).sub(this.target),Se.applyQuaternion(this._quat),this._spherical.setFromVector3(Se),this.autoRotate&&this.state===he.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(s)&&isFinite(n)&&(s<-Math.PI?s+=Ne:s>Math.PI&&(s-=Ne),n<-Math.PI?n+=Ne:n>Math.PI&&(n-=Ne),s<=n?this._spherical.theta=Math.max(s,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+n)/2?Math.max(s,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.enableDamping?this._currentScale=a.MathUtils.lerp(this._currentScale,this._scale,this.dampingFactor):this._currentScale=this._scale,this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),i=Math.abs(o-this._spherical.radius)>Bt*100}if(Se.setFromSpherical(this._spherical),Se.applyQuaternion(this._quatInverse),t.copy(this.target).add(Se),this.object.parent?this.object.parent.worldToLocal(t):this.object.position.copy(t),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const r=Se.length();o=this._clampDistance(r*this._currentScale);const A=r-o;this.object.position.addScaledVector(this._dollyDirection,A),this.object.updateMatrixWorld(),i=Math.abs(A)>Bt}else if(this.object.isOrthographicCamera){const r=new a.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const A=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._currentScale)),this.object.updateProjectionMatrix(),i=Math.abs(A-this.object.zoom)>Bt;const l=new a.Vector3(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(r),this.object.updateMatrixWorld(),o=Se.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(an.origin.copy(this.object.position),an.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(an.direction))<Da?this.object.lookAt(this.target):(Hs.setFromNormalAndCoplanarPoint(this.object.up,this.target),an.intersectPlane(Hs,this.target))))}else if(this.object.isOrthographicCamera){const o=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(o-this.object.zoom)>Bt&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,i||this._lastPosition.distanceToSquared(this.object.position)>Bt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Bt||this._lastTargetPosition.distanceToSquared(this.target)>Bt?(this.dispatchEvent(Os),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this._lastIsDamping=!0,this._isDamping=!0,!0):(this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this.state===he.NONE&&(this._lastIsDamping=this._isDamping,this._isDamping=!1),this._lastIsDamping&&!this._isDamping&&this.state===he.NONE&&(this._isDamping=!1,this._lastIsDamping=!1,this.dispatchEvent(Ra)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(e){return e!==null?Ne/60*this.autoRotateSpeed*e:Ne/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Se.setFromMatrixColumn(t,0),Se.multiplyScalar(-e),this._panOffset.add(Se)}_panUp(e,t){this.screenSpacePanning===!0?Se.setFromMatrixColumn(t,1):(Se.setFromMatrixColumn(t,0),Se.crossVectors(this.object.up,Se)),Se.multiplyScalar(e),this._panOffset.add(Se)}_pan(e,t){const s=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(Se).sub(this.target);let n=Se.length();n*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*n/s.clientHeight,this.object.matrixWorld),this._panUp(2*t*n/s.clientHeight,this.object.matrixWorld)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrixWorld),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrixWorld)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),n=e-s.left,i=t-s.top,o=s.width,r=s.height;this._mouse.x=n/o*2-1,this._mouse.y=-(i/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Ne*this._rotateDelta.x/t.clientHeight),this._rotateUp(Ne*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateUp(Ne*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateUp(-Ne*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateLeft(Ne*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateLeft(-Ne*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._rotateStart.set(s,n)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panStart.set(s,n)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),s=e.pageX-t.x,n=e.pageY-t.y,i=Math.sqrt(s*s+n*n);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const s=this._getSecondPointerPosition(e),n=.5*(e.pageX+s.x),i=.5*(e.pageY+s.y);this._rotateEnd.set(n,i)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Ne*this._rotateDelta.x/t.clientHeight),this._rotateUp(Ne*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panEnd.set(s,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),s=e.pageX-t.x,n=e.pageY-t.y,i=Math.sqrt(s*s+n*n);this._dollyEnd.set(0,i),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(e.pageX+t.x)*.5,r=(e.pageY+t.y)*.5;this._updateZoomParameters(o,r)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new a.Vector2,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,s={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}};function Fa(c){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),window.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(c)&&(this._addPointer(c),c.pointerType==="touch"?this._onTouchStart(c):this._onMouseDown(c)))}function La(c){this.enabled!==!1&&(c.pointerType==="touch"?this._onTouchMove(c):this._onMouseMove(c))}function ka(c){switch(this._removePointer(c),this._pointers.length){case 0:this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),window.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Oi),this.state=he.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function Na(c){let e;switch(c.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case a.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(c),this.state=he.DOLLY;break;case a.MOUSE.ROTATE:if(c.ctrlKey||c.metaKey||c.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(c),this.state=he.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(c),this.state=he.ROTATE}break;case a.MOUSE.PAN:if(c.ctrlKey||c.metaKey||c.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(c),this.state=he.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(c),this.state=he.PAN}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(is)}function Ga(c){switch(this.state){case he.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(c);break;case he.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(c);break;case he.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(c);break}}function Ua(c){this.enabled===!1||this.enableZoom===!1||this.state!==he.NONE||(c.preventDefault(),this.dispatchEvent(is),this._handleMouseWheel(this._customWheelEvent(c)),this.dispatchEvent(Oi))}function Pa(c){this.enabled===!1||this.enablePan===!1||this._handleKeyDown(c)}function Oa(c){switch(this._trackPointer(c),this._pointers.length){case 1:switch(this.touches.ONE){case a.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(c),this.state=he.TOUCH_ROTATE;break;case a.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(c),this.state=he.TOUCH_PAN;break;default:this.state=he.NONE}break;case 2:switch(this.touches.TWO){case a.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(c),this.state=he.TOUCH_DOLLY_PAN;break;case a.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(c),this.state=he.TOUCH_DOLLY_ROTATE;break;default:this.state=he.NONE}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(is)}function Ha(c){switch(this._trackPointer(c),this.state){case he.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(c),this.update();break;case he.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(c),this.update();break;case he.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(c),this.update();break;case he.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(c),this.update();break;default:this.state=he.NONE}}function ja(c){this.enabled!==!1&&c.preventDefault()}function qa(c){c.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function za(c){c.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class Ka extends a.Line{constructor(e,t=1,s=16,n=2){const i=new a.BufferGeometry,o=s+n*2,r=new Float32Array((o*3+3)*3);i.setAttribute("position",new a.BufferAttribute(r,3));const A=new a.LineBasicMaterial({color:65280}),l=new a.LineBasicMaterial({color:16776960});super(i,[l,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=s,this.divisionsOuterAngle=n,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,s=this.divisionsInnerAngle,n=this.divisionsOuterAngle,i=a.MathUtils.degToRad(e.panner.coneInnerAngle),o=a.MathUtils.degToRad(e.panner.coneOuterAngle),r=i/2,A=o/2;let l=0,h=0,u,p;const g=this.geometry,f=g.attributes.position;g.clearGroups();function I(b,E,y,C){const w=(E-b)/y;for(f.setXYZ(l,0,0,0),h++,u=b;u<E;u+=w)p=l+h,f.setXYZ(p,Math.sin(u)*t,0,Math.cos(u)*t),f.setXYZ(p+1,Math.sin(Math.min(u+w,E))*t,0,Math.cos(Math.min(u+w,E))*t),f.setXYZ(p+2,0,0,0),h+=3;g.addGroup(l,h,C),l+=h,h=0}I(-A,-r,n,0),I(-r,r,s,1),I(r,A,n,0),f.needsUpdate=!0,i===o&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const Ya={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
50
+ `);let i=[];for(let o=0,r=n.length;o<r;o++){const A=n[o].trimStart();if(A.length===0)continue;const l=A.charAt(0);if(l!=="#")if(l==="v"){const h=A.split(Ns);switch(h[0]){case"v":s.vertices.push(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3])),h.length>=7?(an.setRGB(parseFloat(h[4]),parseFloat(h[5]),parseFloat(h[6]),a.SRGBColorSpace),s.colors.push(an.r,an.g,an.b)):s.colors.push(void 0,void 0,void 0);break;case"vn":s.normals.push(parseFloat(h[1]),parseFloat(h[2]),parseFloat(h[3]));break;case"vt":s.uvs.push(parseFloat(h[1]),parseFloat(h[2]));break}}else if(l==="f"){const u=A.slice(1).trim().split(Ns),d=[];for(let f=0,I=u.length;f<I;f++){const b=u[f];if(b.length>0){const C=b.split("/");d.push(C)}}const g=d[0];for(let f=1,I=d.length-1;f<I;f++){const b=d[f],C=d[f+1];s.addFace(g[0],b[0],C[0],g[1],b[1],C[1],g[2],b[2],C[2])}}else if(l==="l"){const h=A.substring(1).trim().split(" ");let u=[];const d=[];if(A.indexOf("/")===-1)u=h;else for(let g=0,f=h.length;g<f;g++){const I=h[g].split("/");I[0]!==""&&u.push(I[0]),I[1]!==""&&d.push(I[1])}s.addLineGeometry(u,d)}else if(l==="p"){const u=A.slice(1).trim().split(" ");s.addPointGeometry(u)}else if((i=Ha.exec(A))!==null){const h=(" "+i[0].slice(1).trim()).slice(1);s.startObject(h)}else if(qa.test(A))s.object.startMaterial(A.substring(7).trim(),s.materialLibraries);else if(ja.test(A))s.materialLibraries.push(A.substring(7).trim());else if(za.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(l==="s"){if(i=A.split(" "),i.length>1){const u=i[1].trim().toLowerCase();s.object.smooth=u!=="0"&&u!=="off"}else s.object.smooth=!0;const h=s.object.currentMaterial();h&&(h.smooth=s.object.smooth)}else{if(A==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+A+'"')}}return s.finalize(),t?s:this.createObjects(s)}createObjects(e){const t=new a.Group;if(t.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let n=0,i=e.objects.length;n<i;n++){const o=e.objects[n],r=o.geometry,A=o.materials,l=r.type==="Line",h=r.type==="Points";let u=!1;if(r.vertices.length===0)continue;const d=new a.BufferGeometry;d.setAttribute("position",new a.Float32BufferAttribute(r.vertices,3)),r.normals.length>0&&d.setAttribute("normal",new a.Float32BufferAttribute(r.normals,3)),r.colors.length>0&&(u=!0,d.setAttribute("color",new a.Float32BufferAttribute(r.colors,3))),r.hasUVIndices===!0&&d.setAttribute("uv",new a.Float32BufferAttribute(r.uvs,2));const g=[];for(let I=0,b=A.length;I<b;I++){const C=A[I],w=C.name+"_"+C.smooth+"_"+u;let E=e.materials[w];if(this.materials!==null){if(E=this.materials.create(C.name),l&&E&&!(E instanceof a.LineBasicMaterial)){const y=new a.LineBasicMaterial;a.Material.prototype.copy.call(y,E),y.color.copy(E.color),E=y}else if(h&&E&&!(E instanceof a.PointsMaterial)){const y=new a.PointsMaterial({size:10,sizeAttenuation:!1});a.Material.prototype.copy.call(y,E),y.color.copy(E.color),y.map=E.map,E=y}}E===void 0&&(l?E=new a.LineBasicMaterial:h?E=new a.PointsMaterial({size:1,sizeAttenuation:!1}):E=new a.MeshPhongMaterial,E.name=C.name,E.flatShading=!C.smooth,E.vertexColors=u,e.materials[w]=E),g.push(E)}let f;if(g.length>1){for(let I=0,b=A.length;I<b;I++){const C=A[I];d.addGroup(C.groupStart,C.groupCount,I)}l?f=new a.LineSegments(d,g):h?f=new a.Points(d,g):f=new a.Mesh(d,g)}else l?f=new a.LineSegments(d,g[0]):h?f=new a.Points(d,g[0]):f=new a.Mesh(d,g[0]);f.name=o.name,t.add(f)}else if(e.vertices.length>0){const n=new a.PointsMaterial({size:1,sizeAttenuation:!1}),i=new a.BufferGeometry;i.setAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(i.setAttribute("color",new a.Float32BufferAttribute(e.colors,3)),n.vertexColors=!0);const o=new a.Points(i,n);t.add(o)}return t}}const Hs={type:"change"},os={type:"start"},zi={type:"end"},Va={type:"endMovement"},An=new a.Ray,js=new a.Plane,Ja=Math.cos(70*a.MathUtils.DEG2RAD),Se=new a.Vector3;new a.Vector3;const Ge=2*Math.PI,he={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Bt=1e-6;let Wa=class extends a.Controls{constructor(e,t=null){super(e,t),this.state=he.NONE,this.enabled=!0,this.target=new a.Vector3,this.cursor=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:a.MOUSE.ROTATE,MIDDLE:a.MOUSE.DOLLY,RIGHT:a.MOUSE.PAN},this.touches={ONE:a.TOUCH.ROTATE,TWO:a.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new a.Vector3,this._lastQuaternion=new a.Quaternion,this._lastTargetPosition=new a.Vector3,this._quat=new a.Quaternion().setFromUnitVectors(e.up,new a.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new a.Spherical,this._sphericalDelta=new a.Spherical,this._scale=1,this._currentScale=1,this._panOffset=new a.Vector3,this._rotateStart=new a.Vector2,this._rotateEnd=new a.Vector2,this._rotateDelta=new a.Vector2,this._panStart=new a.Vector2,this._panEnd=new a.Vector2,this._panDelta=new a.Vector2,this._dollyStart=new a.Vector2,this._dollyEnd=new a.Vector2,this._dollyDelta=new a.Vector2,this._dollyDirection=new a.Vector3,this._mouse=new a.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=Za.bind(this),this._onPointerDown=Xa.bind(this),this._onPointerUp=$a.bind(this),this._onContextMenu=rA.bind(this),this._onMouseWheel=nA.bind(this),this._onKeyDown=sA.bind(this),this._onTouchStart=iA.bind(this),this._onTouchMove=oA.bind(this),this._onMouseDown=eA.bind(this),this._onMouseMove=tA.bind(this),this._interceptControlDown=aA.bind(this),this._interceptControlUp=AA.bind(this),this.domElement!==null&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Hs),this.update(),this.state=he.NONE,this._isDamping=!1}update(e=null){if(this.enableDamping&&e===null)return;const t=this.object.getWorldPosition(this.object.position);Se.copy(t).sub(this.target),Se.applyQuaternion(this._quat),this._spherical.setFromVector3(Se),this.autoRotate&&this.state===he.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(s)&&isFinite(n)&&(s<-Math.PI?s+=Ge:s>Math.PI&&(s-=Ge),n<-Math.PI?n+=Ge:n>Math.PI&&(n-=Ge),s<=n?this._spherical.theta=Math.max(s,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+n)/2?Math.max(s,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.enableDamping?this._currentScale=a.MathUtils.lerp(this._currentScale,this._scale,this.dampingFactor):this._currentScale=this._scale,this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),i=Math.abs(o-this._spherical.radius)>Bt*100}if(Se.setFromSpherical(this._spherical),Se.applyQuaternion(this._quatInverse),t.copy(this.target).add(Se),this.object.parent?this.object.parent.worldToLocal(t):this.object.position.copy(t),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const r=Se.length();o=this._clampDistance(r*this._currentScale);const A=r-o;this.object.position.addScaledVector(this._dollyDirection,A),this.object.updateMatrixWorld(),i=Math.abs(A)>Bt}else if(this.object.isOrthographicCamera){const r=new a.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const A=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._currentScale)),this.object.updateProjectionMatrix(),i=Math.abs(A-this.object.zoom)>Bt;const l=new a.Vector3(this._mouse.x,this._mouse.y,0);l.unproject(this.object),this.object.position.sub(l).add(r),this.object.updateMatrixWorld(),o=Se.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(An.origin.copy(this.object.position),An.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(An.direction))<Ja?this.object.lookAt(this.target):(js.setFromNormalAndCoplanarPoint(this.object.up,this.target),An.intersectPlane(js,this.target))))}else if(this.object.isOrthographicCamera){const o=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(o-this.object.zoom)>Bt&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,i||this._lastPosition.distanceToSquared(this.object.position)>Bt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Bt||this._lastTargetPosition.distanceToSquared(this.target)>Bt?(this.dispatchEvent(Hs),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this._lastIsDamping=!0,this._isDamping=!0,!0):(this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),this.state===he.NONE&&(this._lastIsDamping=this._isDamping,this._isDamping=!1),this._lastIsDamping&&!this._isDamping&&this.state===he.NONE&&(this._isDamping=!1,this._lastIsDamping=!1,this.dispatchEvent(Va)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(e){return e!==null?Ge/60*this.autoRotateSpeed*e:Ge/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Se.setFromMatrixColumn(t,0),Se.multiplyScalar(-e),this._panOffset.add(Se)}_panUp(e,t){this.screenSpacePanning===!0?Se.setFromMatrixColumn(t,1):(Se.setFromMatrixColumn(t,0),Se.crossVectors(this.object.up,Se)),Se.multiplyScalar(e),this._panOffset.add(Se)}_pan(e,t){const s=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(Se).sub(this.target);let n=Se.length();n*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*n/s.clientHeight,this.object.matrixWorld),this._panUp(2*t*n/s.clientHeight,this.object.matrixWorld)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrixWorld),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrixWorld)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),n=e-s.left,i=t-s.top,o=s.width,r=s.height;this._mouse.x=n/o*2-1,this._mouse.y=-(i/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Ge*this._rotateDelta.x/t.clientHeight),this._rotateUp(Ge*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateUp(Ge*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateUp(-Ge*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateLeft(Ge*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this._rotateLeft(-Ge*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._rotateStart.set(s,n)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panStart.set(s,n)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),s=e.pageX-t.x,n=e.pageY-t.y,i=Math.sqrt(s*s+n*n);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const s=this._getSecondPointerPosition(e),n=.5*(e.pageX+s.x),i=.5*(e.pageY+s.y);this._rotateEnd.set(n,i)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Ge*this._rotateDelta.x/t.clientHeight),this._rotateUp(Ge*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),s=.5*(e.pageX+t.x),n=.5*(e.pageY+t.y);this._panEnd.set(s,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),s=e.pageX-t.x,n=e.pageY-t.y,i=Math.sqrt(s*s+n*n);this._dollyEnd.set(0,i),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(e.pageX+t.x)*.5,r=(e.pageY+t.y)*.5;this._updateZoomParameters(o,r)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId){this._pointers.splice(t,1);return}}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];t===void 0&&(t=new a.Vector2,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,s={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return e.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}};function Xa(c){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),window.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(c)&&(this._addPointer(c),c.pointerType==="touch"?this._onTouchStart(c):this._onMouseDown(c)))}function Za(c){this.enabled!==!1&&(c.pointerType==="touch"?this._onTouchMove(c):this._onMouseMove(c))}function $a(c){switch(this._removePointer(c),this._pointers.length){case 0:this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),window.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(zi),this.state=he.NONE;break;case 1:const e=this._pointers[0],t=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:t.x,pageY:t.y});break}}function eA(c){let e;switch(c.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case a.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(c),this.state=he.DOLLY;break;case a.MOUSE.ROTATE:if(c.ctrlKey||c.metaKey||c.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(c),this.state=he.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(c),this.state=he.ROTATE}break;case a.MOUSE.PAN:if(c.ctrlKey||c.metaKey||c.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(c),this.state=he.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(c),this.state=he.PAN}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(os)}function tA(c){switch(this.state){case he.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(c);break;case he.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(c);break;case he.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(c);break}}function nA(c){this.enabled===!1||this.enableZoom===!1||this.state!==he.NONE||(c.preventDefault(),this.dispatchEvent(os),this._handleMouseWheel(this._customWheelEvent(c)),this.dispatchEvent(zi))}function sA(c){this.enabled===!1||this.enablePan===!1||this._handleKeyDown(c)}function iA(c){switch(this._trackPointer(c),this._pointers.length){case 1:switch(this.touches.ONE){case a.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(c),this.state=he.TOUCH_ROTATE;break;case a.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(c),this.state=he.TOUCH_PAN;break;default:this.state=he.NONE}break;case 2:switch(this.touches.TWO){case a.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(c),this.state=he.TOUCH_DOLLY_PAN;break;case a.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(c),this.state=he.TOUCH_DOLLY_ROTATE;break;default:this.state=he.NONE}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(os)}function oA(c){switch(this._trackPointer(c),this.state){case he.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(c),this.update();break;case he.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(c),this.update();break;case he.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(c),this.update();break;case he.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(c),this.update();break;default:this.state=he.NONE}}function rA(c){this.enabled!==!1&&c.preventDefault()}function aA(c){c.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function AA(c){c.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class cA extends a.Line{constructor(e,t=1,s=16,n=2){const i=new a.BufferGeometry,o=s+n*2,r=new Float32Array((o*3+3)*3);i.setAttribute("position",new a.BufferAttribute(r,3));const A=new a.LineBasicMaterial({color:65280}),l=new a.LineBasicMaterial({color:16776960});super(i,[l,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=s,this.divisionsOuterAngle=n,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,s=this.divisionsInnerAngle,n=this.divisionsOuterAngle,i=a.MathUtils.degToRad(e.panner.coneInnerAngle),o=a.MathUtils.degToRad(e.panner.coneOuterAngle),r=i/2,A=o/2;let l=0,h=0,u,d;const g=this.geometry,f=g.attributes.position;g.clearGroups();function I(b,C,w,E){const y=(C-b)/w;for(f.setXYZ(l,0,0,0),h++,u=b;u<C;u+=y)d=l+h,f.setXYZ(d,Math.sin(u)*t,0,Math.cos(u)*t),f.setXYZ(d+1,Math.sin(Math.min(u+y,C))*t,0,Math.cos(Math.min(u+y,C))*t),f.setXYZ(d+2,0,0,0),h+=3;g.addGroup(l,h,E),l+=h,h=0}I(-A,-r,n,0),I(-r,r,s,1),I(r,A,n,0),f.needsUpdate=!0,i===o&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const lA={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
51
51
 
52
52
  varying vec2 vUv;
53
53
 
@@ -79,7 +79,7 @@ version 0.8.2
79
79
 
80
80
  gl_FragColor = sum;
81
81
 
82
- }`},Va={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
82
+ }`},hA={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
83
83
 
84
84
  varying vec2 vUv;
85
85
 
@@ -111,7 +111,7 @@ version 0.8.2
111
111
 
112
112
  gl_FragColor = sum;
113
113
 
114
- }`};let jt,Nn,Rt,An;function Gn(c,e=1/0,t=null){Nn||(Nn=new a.PlaneGeometry(2,2,1,1)),Rt||(Rt=new a.ShaderMaterial({uniforms:{blitTexture:new a.Uniform$1(c)},vertexShader:`
114
+ }`};let qt,Gn,Rt,cn;function Nn(c,e=1/0,t=null){Gn||(Gn=new a.PlaneGeometry(2,2,1,1)),Rt||(Rt=new a.ShaderMaterial({uniforms:{blitTexture:new a.Uniform$1(c)},vertexShader:`
115
115
  varying vec2 vUv;
116
116
  void main(){
117
117
  vUv = uv;
@@ -128,7 +128,7 @@ version 0.8.2
128
128
  #else
129
129
  gl_FragColor = texture2D( blitTexture, vUv);
130
130
  #endif
131
- }`})),Rt.uniforms.blitTexture.value=c,Rt.defines.IS_SRGB=c.colorSpace==a.SRGBColorSpace,Rt.needsUpdate=!0,An||(An=new a.Mesh(Nn,Rt),An.frustumCulled=!1);const s=new a.PerspectiveCamera,n=new a.Scene;n.add(An),t===null&&(t=jt=new a.WebGLRenderer({antialias:!1}));const i=Math.min(c.image.width,e),o=Math.min(c.image.height,e);t.setSize(i,o),t.clear(),t.render(n,s);const r=document.createElement("canvas"),A=r.getContext("2d");r.width=i,r.height=o,A.drawImage(t.domElement,0,0,i,o);const l=new a.CanvasTexture(r);return l.minFilter=c.minFilter,l.magFilter=c.magFilter,l.wrapS=c.wrapS,l.wrapT=c.wrapT,l.colorSpace=c.colorSpace,l.name=c.name,jt&&(jt.forceContextLoss(),jt.dispose(),jt=null),l}const js={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class os{constructor(){this.pluginCallbacks=[],this.register(function(e){return new iA(e)}),this.register(function(e){return new oA(e)}),this.register(function(e){return new cA(e)}),this.register(function(e){return new lA(e)}),this.register(function(e){return new hA(e)}),this.register(function(e){return new uA(e)}),this.register(function(e){return new rA(e)}),this.register(function(e){return new aA(e)}),this.register(function(e){return new AA(e)}),this.register(function(e){return new dA(e)}),this.register(function(e){return new pA(e)}),this.register(function(e){return new gA(e)}),this.register(function(e){return new fA(e)}),this.register(function(e){return new mA(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,n){const i=new sA,o=[];for(let r=0,A=this.pluginCallbacks.length;r<A;r++)o.push(this.pluginCallbacks[r](i));i.setPlugins(o),i.write(e,t,n).catch(s)}parseAsync(e,t){const s=this;return new Promise(function(n,i){s.parse(e,n,i,t)})}}const oe={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},Un="KHR_mesh_quantization",ze={};ze[a.NearestFilter]=oe.NEAREST;ze[a.NearestMipmapNearestFilter]=oe.NEAREST_MIPMAP_NEAREST;ze[a.NearestMipmapLinearFilter]=oe.NEAREST_MIPMAP_LINEAR;ze[a.LinearFilter]=oe.LINEAR;ze[a.LinearMipmapNearestFilter]=oe.LINEAR_MIPMAP_NEAREST;ze[a.LinearMipmapLinearFilter]=oe.LINEAR_MIPMAP_LINEAR;ze[a.ClampToEdgeWrapping]=oe.CLAMP_TO_EDGE;ze[a.RepeatWrapping]=oe.REPEAT;ze[a.MirroredRepeatWrapping]=oe.MIRRORED_REPEAT;const qs={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},Ja=new a.Color,zs=12,Wa=1179937895,Xa=2,Ks=8,Za=1313821514,$a=5130562;function Jt(c,e){return c.length===e.length&&c.every(function(t,s){return t===e[s]})}function eA(c){return new TextEncoder().encode(c).buffer}function tA(c){return Jt(c.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function nA(c,e,t){const s={min:new Array(c.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(c.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let n=e;n<e+t;n++)for(let i=0;i<c.itemSize;i++){let o;c.itemSize>4?o=c.array[n*c.itemSize+i]:(i===0?o=c.getX(n):i===1?o=c.getY(n):i===2?o=c.getZ(n):i===3&&(o=c.getW(n)),c.normalized===!0&&(o=a.MathUtils.normalize(o,c.array))),s.min[i]=Math.min(s.min[i],o),s.max[i]=Math.max(s.max[i],o)}return s}function Hi(c){return Math.ceil(c/4)*4}function Pn(c,e=0){const t=Hi(c.byteLength);if(t!==c.byteLength){const s=new Uint8Array(t);if(s.set(new Uint8Array(c)),e!==0)for(let n=c.byteLength;n<t;n++)s[n]=e;return s.buffer}return c}function Ys(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Vs(c,e){if(c.toBlob!==void 0)return new Promise(s=>c.toBlob(s,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),c.convertToBlob({type:e,quality:t})}class sA{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+a.REVISION}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,s={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},s),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const n=this,i=n.buffers,o=n.json;s=n.options;const r=n.extensionsUsed,A=n.extensionsRequired,l=new Blob(i,{type:"application/octet-stream"}),h=Object.keys(r),u=Object.keys(A);if(h.length>0&&(o.extensionsUsed=h),u.length>0&&(o.extensionsRequired=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=l.size),s.binary===!0){const p=new FileReader;p.readAsArrayBuffer(l),p.onloadend=function(){const g=Pn(p.result),f=new DataView(new ArrayBuffer(Ks));f.setUint32(0,g.byteLength,!0),f.setUint32(4,$a,!0);const I=Pn(eA(JSON.stringify(o)),32),b=new DataView(new ArrayBuffer(Ks));b.setUint32(0,I.byteLength,!0),b.setUint32(4,Za,!0);const E=new ArrayBuffer(zs),y=new DataView(E);y.setUint32(0,Wa,!0),y.setUint32(4,Xa,!0);const C=zs+b.byteLength+I.byteLength+f.byteLength+g.byteLength;y.setUint32(8,C,!0);const w=new Blob([E,b,I,f,g],{type:"application/octet-stream"}),x=new FileReader;x.readAsArrayBuffer(w),x.onloadend=function(){t(x.result)}}}else if(o.buffers&&o.buffers.length>0){const p=new FileReader;p.readAsDataURL(l),p.onloadend=function(){const g=p.result;o.buffers[0].uri=g,t(o)}}else t(o)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const s=this.options,n=this.extensionsUsed;try{const i=JSON.parse(JSON.stringify(e.userData));if(s.includeCustomExtensions&&i.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const o in i.gltfExtensions)t.extensions[o]=i.gltfExtensions[o],n[o]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const n=new Map;n.set(!0,this.uid++),n.set(!1,this.uid++),this.uids.set(e,n)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const s=new a.Vector3;for(let n=0,i=e.count;n<i;n++)if(Math.abs(s.fromBufferAttribute(e,n).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const s=e.clone(),n=new a.Vector3;for(let i=0,o=s.count;i<o;i++)n.fromBufferAttribute(s,i),n.x===0&&n.y===0&&n.z===0?n.setX(1):n.normalize(),s.setXYZ(i,n.x,n.y,n.z);return t.attributesNormalized.set(e,s),s}applyTextureTransform(e,t){let s=!1;const n={};(t.offset.x!==0||t.offset.y!==0)&&(n.offset=t.offset.toArray(),s=!0),t.rotation!==0&&(n.rotation=t.rotation,s=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(n.scale=t.repeat.toArray(),s=!0),s&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=n,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function s(g){return g.colorSpace===a.SRGBColorSpace?function(I){return I<.04045?I*.0773993808:Math.pow(I*.9478672986+.0521327014,2.4)}:function(I){return I}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof a.CompressedTexture&&(e=Gn(e)),t instanceof a.CompressedTexture&&(t=Gn(t));const n=e?e.image:null,i=t?t.image:null,o=Math.max(n?n.width:0,i?i.width:0),r=Math.max(n?n.height:0,i?i.height:0),A=Ys();A.width=o,A.height=r;const l=A.getContext("2d",{willReadFrequently:!0});l.fillStyle="#00ffff",l.fillRect(0,0,o,r);const h=l.getImageData(0,0,o,r);if(n){l.drawImage(n,0,0,o,r);const g=s(e),f=l.getImageData(0,0,o,r).data;for(let I=2;I<f.length;I+=4)h.data[I]=g(f[I]/256)*256}if(i){l.drawImage(i,0,0,o,r);const g=s(t),f=l.getImageData(0,0,o,r).data;for(let I=1;I<f.length;I+=4)h.data[I]=g(f[I]/256)*256}l.putImageData(h,0,0);const p=(e||t).clone();return p.source=new a.Source(A),p.colorSpace=a.NoColorSpace,p.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),p}processBuffer(e){const t=this.json,s=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),s.push(e),0}processBufferView(e,t,s,n,i){const o=this.json;o.bufferViews||(o.bufferViews=[]);let r;switch(t){case oe.BYTE:case oe.UNSIGNED_BYTE:r=1;break;case oe.SHORT:case oe.UNSIGNED_SHORT:r=2;break;default:r=4}let A=e.itemSize*r;i===oe.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const l=Hi(n*A),h=new DataView(new ArrayBuffer(l));let u=0;for(let f=s;f<s+n;f++){for(let I=0;I<e.itemSize;I++){let b;e.itemSize>4?b=e.array[f*e.itemSize+I]:(I===0?b=e.getX(f):I===1?b=e.getY(f):I===2?b=e.getZ(f):I===3&&(b=e.getW(f)),e.normalized===!0&&(b=a.MathUtils.normalize(b,e.array))),t===oe.FLOAT?h.setFloat32(u,b,!0):t===oe.INT?h.setInt32(u,b,!0):t===oe.UNSIGNED_INT?h.setUint32(u,b,!0):t===oe.SHORT?h.setInt16(u,b,!0):t===oe.UNSIGNED_SHORT?h.setUint16(u,b,!0):t===oe.BYTE?h.setInt8(u,b):t===oe.UNSIGNED_BYTE&&h.setUint8(u,b),u+=r}u%A!==0&&(u+=A-u%A)}const p={buffer:this.processBuffer(h.buffer),byteOffset:this.byteOffset,byteLength:l};return i!==void 0&&(p.target=i),i===oe.ARRAY_BUFFER&&(p.byteStride=A),this.byteOffset+=l,o.bufferViews.push(p),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,s=t.json;return s.bufferViews||(s.bufferViews=[]),new Promise(function(n){const i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){const o=Pn(i.result),r={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,n(s.bufferViews.push(r)-1)}})}processAccessor(e,t,s,n){const i=this.json,o={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let r;if(e.array.constructor===Float32Array)r=oe.FLOAT;else if(e.array.constructor===Int32Array)r=oe.INT;else if(e.array.constructor===Uint32Array)r=oe.UNSIGNED_INT;else if(e.array.constructor===Int16Array)r=oe.SHORT;else if(e.array.constructor===Uint16Array)r=oe.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)r=oe.BYTE;else if(e.array.constructor===Uint8Array)r=oe.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(s===void 0&&(s=0),(n===void 0||n===1/0)&&(n=e.count),n===0)return null;const A=nA(e,s,n);let l;t!==void 0&&(l=e===t.index?oe.ELEMENT_ARRAY_BUFFER:oe.ARRAY_BUFFER);const h=this.processBufferView(e,r,s,n,l),u={bufferView:h.id,byteOffset:h.byteOffset,componentType:r,count:n,max:A.max,min:A.min,type:o[e.itemSize]};return e.normalized===!0&&(u.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(u)-1}processImage(e,t,s,n="image/png"){if(e!==null){const i=this,o=i.cache,r=i.json,A=i.options,l=i.pending;o.images.has(e)||o.images.set(e,{});const h=o.images.get(e),u=n+":flipY/"+s.toString();if(h[u]!==void 0)return h[u];r.images||(r.images=[]);const p={mimeType:n},g=Ys();g.width=Math.min(e.width,A.maxTextureSize),g.height=Math.min(e.height,A.maxTextureSize);const f=g.getContext("2d",{willReadFrequently:!0});if(s===!0&&(f.translate(0,g.height),f.scale(1,-1)),e.data!==void 0){t!==a.RGBAFormat&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>A.maxTextureSize||e.height>A.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const b=new Uint8ClampedArray(e.height*e.width*4);for(let E=0;E<b.length;E+=4)b[E+0]=e.data[E+0],b[E+1]=e.data[E+1],b[E+2]=e.data[E+2],b[E+3]=e.data[E+3];f.putImageData(new ImageData(b,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)f.drawImage(e,0,0,g.width,g.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");A.binary===!0?l.push(Vs(g,n).then(b=>i.processBufferViewImage(b)).then(b=>{p.bufferView=b})):g.toDataURL!==void 0?p.uri=g.toDataURL(n):l.push(Vs(g,n).then(b=>new FileReader().readAsDataURL(b)).then(b=>{p.uri=b}));const I=r.images.push(p)-1;return h[u]=I,I}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const s={magFilter:ze[e.magFilter],minFilter:ze[e.minFilter],wrapS:ze[e.wrapS],wrapT:ze[e.wrapT]};return t.samplers.push(s)-1}processTexture(e){const s=this.options,n=this.cache,i=this.json;if(n.textures.has(e))return n.textures.get(e);const o={keep:!0,newTexture:null};if(this._invokeAll(function(h){h.beforeWriteTexture&&h.beforeWriteTexture(e,o)}),o.keep===!1)return null;o.newTexture!=null&&(e=o.newTexture),i.textures||(i.textures=[]),e instanceof a.CompressedTexture&&(e=Gn(e,s.maxTextureSize));let r=e.userData.mimeType;r==="image/webp"&&(r="image/png");const A={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,r)};e.name&&(A.name=e.name),this._invokeAll(function(h){h.writeTexture&&h.writeTexture(e,A)});const l=i.textures.push(A)-1;return n.textures.set(e,l),l}processMaterial(e){const t=this.cache,s=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;s.materials||(s.materials=[]);const n={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const i=e.color.toArray().concat([e.opacity]);Jt(i,[1,1,1,1])||(n.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(n.pbrMetallicRoughness.metallicFactor=e.metalness,n.pbrMetallicRoughness.roughnessFactor=e.roughness):(n.pbrMetallicRoughness.metallicFactor=.5,n.pbrMetallicRoughness.roughnessFactor=.5);const o=e.metalnessMap?.image?e.metalnessMap:void 0,r=e.roughnessMap?.image?e.roughnessMap:void 0;if(o||r){const l=this.buildMetalRoughTexture(o,r),h={index:this.processTexture(l),channel:l.channel};this.applyTextureTransform(h,l),n.pbrMetallicRoughness.metallicRoughnessTexture=h}if(e.map){const l={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(l,e.map),n.pbrMetallicRoughness.baseColorTexture=l}if(e.emissive){const l=e.emissive;if(Math.max(l.r,l.g,l.b)>0&&(n.emissiveFactor=e.emissive.toArray()),e.emissiveMap?.image){const u={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(u,e.emissiveMap),n.emissiveTexture=u}}if(e.normalMap?.image){const l={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(l.scale=e.normalScale.x),this.applyTextureTransform(l,e.normalMap),n.normalTexture=l}if(e.aoMap?.image){const l={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(l.strength=e.aoMapIntensity),this.applyTextureTransform(l,e.aoMap),n.occlusionTexture=l}e.transparent?n.alphaMode="BLEND":e.alphaTest>0&&(n.alphaMode="MASK",n.alphaCutoff=e.alphaTest),e.side===a.DoubleSide&&(n.doubleSided=!0),e.name!==""&&(n.name=e.name),this.serializeUserData(e,n),this._invokeAll(function(l){l.writeMaterial&&l.writeMaterial(e,n)});const A=s.materials.push(n)-1;return t.materials.set(e,A),A}processMesh(e){const t={keep:!0};if(this._invokeAll(function(x){x.beforeWriteMesh&&x.beforeWriteMesh(e,t)}),t.keep!=!0)return null;const s=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let x=0,R=e.material.length;x<R;x++)i.push(e.material[x].uuid);else i.push(e.material.uuid);const o=i.join(":");if(s.meshes.has(o))return s.meshes.get(o);const r=e.geometry;let A;e.isLineSegments?A=oe.LINES:e.isLineLoop?A=oe.LINE_LOOP:e.isLine?A=oe.LINE_STRIP:e.isPoints?A=oe.POINTS:A=e.material.wireframe?oe.LINES:oe.TRIANGLES;const l={},h={},u=[],p=[],g={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=r.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),r.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let I=null;for(let x in r.attributes){if(x.slice(0,5)==="morph")continue;const R=r.attributes[x];if(x=g[x]||x.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(x)||(x="_"+x),s.attributes.has(this.getUID(R))){h[x]=s.attributes.get(this.getUID(R));continue}I=null;const S=R.array;x==="JOINTS_0"&&!(S instanceof Uint16Array)&&!(S instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),I=new a.BufferAttribute(new Uint16Array(S),R.itemSize,R.normalized));const v=this.processAccessor(I||R,r);v!==null&&(x.startsWith("_")||this.detectMeshQuantization(x,R),h[x]=v,s.attributes.set(this.getUID(R),v))}if(f!==void 0&&r.setAttribute("normal",f),Object.keys(h).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const x=[],R=[],D={};if(e.morphTargetDictionary!==void 0)for(const S in e.morphTargetDictionary)D[e.morphTargetDictionary[S]]=S;for(let S=0;S<e.morphTargetInfluences.length;++S){const v={};let N=!1;for(const G in r.morphAttributes){if(G!=="position"&&G!=="normal"&&G!=="color"){N||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),N=!0);continue}const O=r.morphAttributes[G][S],X=G.toUpperCase()+(G==="color"?"_0":""),U=r.attributes[G];if(s.attributes.has(this.getUID(O,!0))){v[X]=s.attributes.get(this.getUID(O,!0));continue}const q=O.clone();if(!r.morphTargetsRelative)for(let H=0,z=O.count;H<z;H++)for(let $=0;$<O.itemSize;$++)$===0&&q.setX(H,O.getX(H)-U.getX(H)),$===1&&q.setY(H,O.getY(H)-U.getY(H)),$===2&&q.setZ(H,O.getZ(H)-U.getZ(H)),$===3&&q.setW(H,O.getW(H)-U.getW(H));v[X]=this.processAccessor(q,r),s.attributes.set(this.getUID(U,!0),v[X])}p.push(v),x.push(e.morphTargetInfluences[S]),e.morphTargetDictionary!==void 0&&R.push(D[S])}l.weights=x,R.length>0&&(l.extras={},l.extras.targetNames=R)}const b=Array.isArray(e.material);if(b&&r.groups.length===0)return null;let E=!1;if(b&&r.index===null){const x=[];for(let R=0,D=r.attributes.position.count;R<D;R++)x[R]=R;r.setIndex(x),E=!0}const y=b?e.material:[e.material],C=b?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let x=0,R=C.length;x<R;x++){const D={mode:A,attributes:h};if(this.serializeUserData(r,D),p.length>0&&(D.targets=p),r.index!==null){let v=this.getUID(r.index);(C[x].start!==void 0||C[x].count!==void 0)&&(v+=":"+C[x].start+":"+C[x].count),s.attributes.has(v)?D.indices=s.attributes.get(v):(D.indices=this.processAccessor(r.index,r,C[x].start,C[x].count),s.attributes.set(v,D.indices)),D.indices===null&&delete D.indices}const S=this.processMaterial(y[C[x].materialIndex]);S!==null&&(D.material=S),u.push(D)}E===!0&&r.setIndex(null),l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(x){x.writeMesh&&x.writeMesh(e,l)});const w=n.meshes.push(l)-1;return s.meshes.set(o,w),w}detectMeshQuantization(e,t){if(this.extensionsUsed[Un])return;let s;switch(t.array.constructor){case Int8Array:s="byte";break;case Uint8Array:s="unsigned byte";break;case Int16Array:s="short";break;case Uint16Array:s="unsigned short";break;default:return}t.normalized&&(s+=" normalized");const n=e.split("_",1)[0];js[n]&&js[n].includes(s)&&(this.extensionsUsed[Un]=!0,this.extensionsRequired[Un]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const s=e.isOrthographicCamera,n={type:s?"orthographic":"perspective"};return s?n.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:n.perspective={aspectRatio:e.aspect,yfov:a.MathUtils.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(n.name=e.type),t.cameras.push(n)-1}processAnimation(e,t){const s=this.json,n=this.nodeMap;s.animations||(s.animations=[]),e=os.Utils.mergeMorphTargetTracks(e.clone(),t);const i=e.tracks,o=[],r=[];for(let A=0;A<i.length;++A){const l=i[A],h=a.PropertyBinding.parseTrackName(l.name);let u=a.PropertyBinding.findNode(t,h.nodeName);const p=qs[h.propertyName];if(h.objectName==="bones"&&(u.isSkinnedMesh===!0?u=u.skeleton.getBoneByName(h.objectIndex):u=void 0),!u||!p){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',l.name);continue}const g=1;let f=l.values.length/l.times.length;p===qs.morphTargetInfluences&&(f/=u.morphTargetInfluences.length);let I;l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(I="CUBICSPLINE",f/=3):l.getInterpolation()===a.InterpolateDiscrete?I="STEP":I="LINEAR",r.push({input:this.processAccessor(new a.BufferAttribute(l.times,g)),output:this.processAccessor(new a.BufferAttribute(l.values,f)),interpolation:I}),o.push({sampler:r.length-1,target:{node:n.get(u),path:p}})}return s.animations.push({name:e.name||"clip_"+s.animations.length,samplers:r,channels:o}),s.animations.length-1}processSkin(e){const t=this.json,s=this.nodeMap,n=t.nodes[s.get(e)],i=e.skeleton;if(i===void 0)return null;const o=e.skeleton.bones[0];if(o===void 0)return null;const r=[],A=new Float32Array(i.bones.length*16),l=new a.Matrix4;for(let u=0;u<i.bones.length;++u)r.push(s.get(i.bones[u])),l.copy(i.boneInverses[u]),l.multiply(e.bindMatrix).toArray(A,u*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new a.BufferAttribute(A,16)),joints:r,skeleton:s.get(o)}),n.skin=t.skins.length-1}processNode(e){const t={keep:!0};if(this._invokeAll(function(A){A.beforeWriteNode&&A.beforeWriteNode(e,t)}),t.keep!=!0)return null;const s=this.json,n=this.options,i=this.nodeMap;s.nodes||(s.nodes=[]);const o={};if(n.trs){const A=e.quaternion.toArray(),l=e.position.toArray(),h=e.scale.toArray();Jt(A,[0,0,0,1])||(o.rotation=A),Jt(l,[0,0,0])||(o.translation=l),Jt(h,[1,1,1])||(o.scale=h)}else e.matrixAutoUpdate&&e.updateMatrix(),tA(e.matrix)===!1&&(o.matrix=e.matrix.elements);if(e.name!==""&&(o.name=String(e.name)),this.serializeUserData(e,o),e.isMesh||e.isLine||e.isPoints){const A=this.processMesh(e);A!==null&&(o.mesh=A)}else e.isCamera&&(o.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const A=[];for(let l=0,h=e.children.length;l<h;l++){const u=e.children[l];if(u.visible||n.onlyVisible===!1){const p=this.processNode(u);p!==null&&A.push(p)}}A.length>0&&(o.children=A)}this._invokeAll(function(A){A.writeNode&&A.writeNode(e,o)});const r=s.nodes.push(o)-1;return i.set(e,r),r}processScene(e){const t=this.json,s=this.options;t.scenes||(t.scenes=[],t.scene=0);const n={};e.name!==""&&(n.name=e.name),t.scenes.push(n);const i=[];for(let o=0,r=e.children.length;o<r;o++){const A=e.children[o];if(A.visible||s.onlyVisible===!1){const l=this.processNode(A);l!==null&&i.push(l)}}i.length>0&&(n.nodes=i),this.serializeUserData(e,n)}processObjects(e){const t=new a.Scene;t.name="AuxScene";for(let s=0;s<e.length;s++)t.children.push(e[s]);this.processScene(t)}processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(n){n.beforeParse&&n.beforeParse(e)});const s=[];for(let n=0;n<e.length;n++)e[n]instanceof a.Scene?this.processScene(e[n]):s.push(e[n]);s.length>0&&this.processObjects(s);for(let n=0;n<this.skins.length;++n)this.processSkin(this.skins[n]);for(let n=0;n<t.animations.length;++n)this.processAnimation(t.animations[n],e[0]);this._invokeAll(function(n){n.afterParse&&n.afterParse(e)})}_invokeAll(e){for(let t=0,s=this.plugins.length;t<s;t++)e(this.plugins[t])}}class iA{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const s=this.writer,n=s.json,i=s.extensionsUsed,o={};e.name&&(o.name=e.name),o.color=e.color.toArray(),o.intensity=e.intensity,e.isDirectionalLight?o.type="directional":e.isPointLight?(o.type="point",e.distance>0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(1-e.penumbra)*e.angle,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(n.extensions=n.extensions||{},n.extensions[this.name]={lights:[]},i[this.name]=!0);const r=n.extensions[this.name].lights;r.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:r.length-1}}}class oA{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class rA{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){const o={index:s.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};s.applyTextureTransform(o,e.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const o={index:s.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};s.applyTextureTransform(o,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(e.clearcoatNormalMap){const o={index:s.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(o.scale=e.clearcoatNormalScale.x),s.applyTextureTransform(o,e.clearcoatNormalMap),i.clearcoatNormalTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class aA{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const n=this.writer.extensionsUsed,i={};i.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class AA{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){const o={index:s.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};s.applyTextureTransform(o,e.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const o={index:s.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};s.applyTextureTransform(o,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class cA{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){const o={index:s.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};s.applyTextureTransform(o,e.transmissionMap),i.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class lA{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){const o={index:s.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};s.applyTextureTransform(o,e.thicknessMap),i.thicknessTexture=o}e.attenuationDistance!==1/0&&(i.attenuationDistance=e.attenuationDistance),i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class hA{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const n=this.writer.extensionsUsed,i={};i.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class uA{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(Ja)&&!e.specularIntensityMap&&!e.specularColorMap)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.specularIntensityMap){const o={index:s.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};s.applyTextureTransform(o,e.specularIntensityMap),i.specularTexture=o}if(e.specularColorMap){const o={index:s.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};s.applyTextureTransform(o,e.specularColorMap),i.specularColorTexture=o}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class dA{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.sheenRoughnessMap){const o={index:s.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};s.applyTextureTransform(o,e.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(e.sheenColorMap){const o={index:s.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};s.applyTextureTransform(o,e.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class pA{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.anisotropyMap){const o={index:s.processTexture(e.anisotropyMap)};s.applyTextureTransform(o,e.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class gA{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,i={};i.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class fA{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.bumpMap){const o={index:s.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};s.applyTextureTransform(o,e.bumpMap),i.bumpTexture=o}i.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class mA{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const s=this.writer,n=e,i=new Float32Array(n.count*3),o=new Float32Array(n.count*4),r=new Float32Array(n.count*3),A=new a.Matrix4,l=new a.Vector3,h=new a.Quaternion,u=new a.Vector3;for(let g=0;g<n.count;g++)n.getMatrixAt(g,A),A.decompose(l,h,u),l.toArray(i,g*3),h.toArray(o,g*4),u.toArray(r,g*3);const p={TRANSLATION:s.processAccessor(new a.BufferAttribute(i,3)),ROTATION:s.processAccessor(new a.BufferAttribute(o,4)),SCALE:s.processAccessor(new a.BufferAttribute(r,3))};n.instanceColor&&(p._COLOR_0=s.processAccessor(n.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:p},s.extensionsUsed[this.name]=!0,s.extensionsRequired[this.name]=!0}}os.Utils={insertKeyframe:function(c,e){const s=c.getValueSize(),n=new c.TimeBufferType(c.times.length+1),i=new c.ValueBufferType(c.values.length+s),o=c.createInterpolant(new c.ValueBufferType(s));let r;if(c.times.length===0){n[0]=e;for(let A=0;A<s;A++)i[A]=0;r=0}else if(e<c.times[0]){if(Math.abs(c.times[0]-e)<.001)return 0;n[0]=e,n.set(c.times,1),i.set(o.evaluate(e),0),i.set(c.values,s),r=0}else if(e>c.times[c.times.length-1]){if(Math.abs(c.times[c.times.length-1]-e)<.001)return c.times.length-1;n[n.length-1]=e,n.set(c.times,0),i.set(c.values,0),i.set(o.evaluate(e),c.values.length),r=n.length-1}else for(let A=0;A<c.times.length;A++){if(Math.abs(c.times[A]-e)<.001)return A;if(c.times[A]<e&&c.times[A+1]>e){n.set(c.times.slice(0,A+1),0),n[A+1]=e,n.set(c.times.slice(A+1),A+2),i.set(c.values.slice(0,(A+1)*s),0),i.set(o.evaluate(e),(A+1)*s),i.set(c.values.slice((A+1)*s),(A+2)*s),r=A+1;break}}return c.times=n,c.values=i,r},mergeMorphTargetTracks:function(c,e){const t=[],s={},n=c.tracks;for(let i=0;i<n.length;++i){let o=n[i];const r=a.PropertyBinding.parseTrackName(o.name),A=a.PropertyBinding.findNode(e,r.nodeName);if(r.propertyName!=="morphTargetInfluences"||r.propertyIndex===void 0){t.push(o);continue}if(o.createInterpolant!==o.InterpolantFactoryMethodDiscrete&&o.createInterpolant!==o.InterpolantFactoryMethodLinear){if(o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),o=o.clone(),o.setInterpolation(a.InterpolateLinear)}const l=A.morphTargetInfluences.length,h=A.morphTargetDictionary[r.propertyIndex];if(h===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+r.propertyIndex);let u;if(s[A.uuid]===void 0){u=o.clone();const g=new u.ValueBufferType(l*u.times.length);for(let f=0;f<u.times.length;f++)g[f*l+h]=u.values[f];u.name=(r.nodeName||"")+".morphTargetInfluences",u.values=g,s[A.uuid]=u,t.push(u);continue}const p=o.createInterpolant(new o.ValueBufferType(1));u=s[A.uuid];for(let g=0;g<u.times.length;g++)u.values[g*l+h]=p.evaluate(u.times[g]);for(let g=0;g<o.times.length;g++){const f=this.insertKeyframe(u,o.times[g]);u.values[f*l+h]=o.values[g]}}return c.tracks=t,c}};const ye={ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function ji(c){const e=await fetch(c);if(e.ok)return e.json();throw new Error(e.statusText)}async function IA(c){if(!c)throw new Error("No basePath supplied");return await ji(`${c}/profilesList.json`)}async function bA(c,e,t=null,s=!0){if(!c)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const n=await IA(e);let i;if(c.profiles.some(A=>{const l=n[A];return l&&(i={profileId:A,profilePath:`${e}/${l.path}`,deprecated:!!l.deprecated}),!!i}),!i){if(!t)throw new Error("No matching profile name found");const A=n[t];if(!A)throw new Error(`No matching profile name found and default profile "${t}" missing.`);i={profileId:t,profilePath:`${e}/${A.path}`,deprecated:!!A.deprecated}}const o=await ji(i.profilePath);let r;if(s){let A;if(c.handedness==="any"?A=o.layouts[Object.keys(o.layouts)[0]]:A=o.layouts[c.handedness],!A)throw new Error(`No matching handedness, ${c.handedness}, in profile ${i.profileId}`);A.assetPath&&(r=i.profilePath.replace("profile.json",A.assetPath))}return{profile:o,assetPath:r}}const EA={xAxis:0,yAxis:0,button:0,state:ye.ComponentState.DEFAULT};function CA(c=0,e=0){let t=c,s=e;if(Math.sqrt(c*c+e*e)>1){const o=Math.atan2(e,c);t=Math.cos(o),s=Math.sin(o)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:s*.5+.5}}class BA{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===ye.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(EA)}updateFromComponent({xAxis:e,yAxis:t,button:s,state:n}){const{normalizedXAxis:i,normalizedYAxis:o}=CA(e,t);switch(this.componentProperty){case ye.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?i:.5;break;case ye.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case ye.ComponentProperty.BUTTON:this.value=this.states.includes(n)?s:0;break;case ye.ComponentProperty.STATE:this.valueNodeProperty===ye.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class yA{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(s=>{const n=new BA(t.visualResponses[s]);this.visualResponses[s]=n}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:ye.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=ye.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=ye.ComponentState.PRESSED:(t.touched||this.values.button>ye.ButtonTouchThreshold)&&(this.values.state=ye.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===ye.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>ye.AxisTouchThreshold&&(this.values.state=ye.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===ye.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>ye.AxisTouchThreshold&&(this.values.state=ye.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class wA{constructor(e,t,s){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=s,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(n=>{const i=this.layoutDescription.components[n];this.components[n]=new yA(n,i)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}}const QA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",xA="generic-trigger";class SA extends a.Object3D{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e?this:(this.envMap=e,this.traverse(t=>{t.isMesh&&(t.material.envMap=this.envMap,t.material.needsUpdate=!0)}),this)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(t=>{Object.values(t.visualResponses).forEach(s=>{const{valueNode:n,minNode:i,maxNode:o,value:r,valueNodeProperty:A}=s;n&&(A===ye.VisualResponseProperty.VISIBILITY?n.visible=r:A===ye.VisualResponseProperty.TRANSFORM&&(n.quaternion.slerpQuaternions(i.quaternion,o.quaternion,r),n.position.lerpVectors(i.position,o.position,r)))})}))}}function TA(c,e){Object.values(c.components).forEach(t=>{const{type:s,touchPointNodeName:n,visualResponses:i}=t;if(s===ye.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(n),t.touchPointNode){const o=new a.SphereGeometry(.001),r=new a.MeshBasicMaterial({color:255}),A=new a.Mesh(o,r);t.touchPointNode.add(A)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(i).forEach(o=>{const{valueNodeName:r,minNodeName:A,maxNodeName:l,valueNodeProperty:h}=o;if(h===ye.VisualResponseProperty.TRANSFORM){if(o.minNode=e.getObjectByName(A),o.maxNode=e.getObjectByName(l),!o.minNode){console.warn(`Could not find ${A} in the model`);return}if(!o.maxNode){console.warn(`Could not find ${l} in the model`);return}}o.valueNode=e.getObjectByName(r),o.valueNode||console.warn(`Could not find ${r} in the model`)})})}function Js(c,e){TA(c.motionController,e),c.envMap&&e.traverse(t=>{t.isMesh&&(t.material.envMap=c.envMap,t.material.needsUpdate=!0)}),c.layers.mask!=0&&e.traverse(t=>{t.layers.mask=c.layers.mask}),c.add(e)}class vA{constructor(e=null,t=null){this.gltfLoader=e,this.path=QA,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new es)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new SA;let s=null;return e.addEventListener("connected",n=>{const i=n.data;i.targetRayMode!=="tracked-pointer"||!i.gamepad||i.hand||bA(i,this.path,xA).then(({profile:o,assetPath:r})=>{t.motionController=new wA(i,o,r);const A=this._assetCache[t.motionController.assetUrl];if(A)s=A.scene.clone(),Js(t,s),this.onLoad&&this.onLoad(s);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,l=>{this._assetCache[t.motionController.assetUrl]=l,s=l.scene.clone(),Js(t,s),this.onLoad&&this.onLoad(s)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(o=>{console.warn(o)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(s),s=null}),t}}const MA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class RA{constructor(e,t,s,n,i=null,o=null){this.controller=t,this.handModel=e,this.bones=[],i===null&&(i=new es,i.setPath(s||MA)),i.load(`${n}.glb`,r=>{const A=r.scene.children[0];this.handModel.add(A),A.layers.mask=this.handModel.layers.mask;const l=A.getObjectByProperty("type","SkinnedMesh");l.frustumCulled=!1,l.castShadow=!0,l.receiveShadow=!0,["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"].forEach(u=>{const p=A.getObjectByName(u);p!==void 0?p.jointName=u:console.warn(`Couldn't find ${u} in ${n} hand mesh`),this.bones.push(p)}),o&&o(A)})}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const s=this.bones[t];if(s){const n=e[s.jointName];if(n.visible){const i=n.position;s.position.copy(i),s.quaternion.copy(n.quaternion)}}}}}const Ws=new a.Box3,cn=new a.Vector3;class qi extends a.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],s=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(s),this.setAttribute("position",new a.Float32BufferAttribute(e,3)),this.setAttribute("uv",new a.Float32BufferAttribute(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,s=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),s.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const s=new a.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new a.InterleavedBufferAttribute(s,3,0)),this.setAttribute("instanceEnd",new a.InterleavedBufferAttribute(s,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const s=new a.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new a.InterleavedBufferAttribute(s,3,0)),this.setAttribute("instanceColorEnd",new a.InterleavedBufferAttribute(s,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new a.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new a.Box3);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Ws.setFromBufferAttribute(t),this.boundingBox.union(Ws))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new a.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const s=this.boundingSphere.center;this.boundingBox.getCenter(s);let n=0;for(let i=0,o=e.count;i<o;i++)cn.fromBufferAttribute(e,i),n=Math.max(n,s.distanceToSquared(cn)),cn.fromBufferAttribute(t,i),n=Math.max(n,s.distanceToSquared(cn));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}a.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new a.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};a.ShaderLib.line={uniforms:a.UniformsUtils.merge([a.UniformsLib.common,a.UniformsLib.fog,a.UniformsLib.line]),vertexShader:`
131
+ }`})),Rt.uniforms.blitTexture.value=c,Rt.defines.IS_SRGB=c.colorSpace==a.SRGBColorSpace,Rt.needsUpdate=!0,cn||(cn=new a.Mesh(Gn,Rt),cn.frustumCulled=!1);const s=new a.PerspectiveCamera,n=new a.Scene;n.add(cn),t===null&&(t=qt=new a.WebGLRenderer({antialias:!1}));const i=Math.min(c.image.width,e),o=Math.min(c.image.height,e);t.setSize(i,o),t.clear(),t.render(n,s);const r=document.createElement("canvas"),A=r.getContext("2d");r.width=i,r.height=o,A.drawImage(t.domElement,0,0,i,o);const l=new a.CanvasTexture(r);return l.minFilter=c.minFilter,l.magFilter=c.magFilter,l.wrapS=c.wrapS,l.wrapT=c.wrapT,l.colorSpace=c.colorSpace,l.name=c.name,qt&&(qt.forceContextLoss(),qt.dispose(),qt=null),l}const qs={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class rs{constructor(){this.pluginCallbacks=[],this.register(function(e){return new CA(e)}),this.register(function(e){return new BA(e)}),this.register(function(e){return new xA(e)}),this.register(function(e){return new SA(e)}),this.register(function(e){return new TA(e)}),this.register(function(e){return new vA(e)}),this.register(function(e){return new yA(e)}),this.register(function(e){return new wA(e)}),this.register(function(e){return new QA(e)}),this.register(function(e){return new MA(e)}),this.register(function(e){return new RA(e)}),this.register(function(e){return new _A(e)}),this.register(function(e){return new DA(e)}),this.register(function(e){return new FA(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s,n){const i=new EA,o=[];for(let r=0,A=this.pluginCallbacks.length;r<A;r++)o.push(this.pluginCallbacks[r](i));i.setPlugins(o),i.write(e,t,n).catch(s)}parseAsync(e,t){const s=this;return new Promise(function(n,i){s.parse(e,n,i,t)})}}const ae={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},Un="KHR_mesh_quantization",ze={};ze[a.NearestFilter]=ae.NEAREST;ze[a.NearestMipmapNearestFilter]=ae.NEAREST_MIPMAP_NEAREST;ze[a.NearestMipmapLinearFilter]=ae.NEAREST_MIPMAP_LINEAR;ze[a.LinearFilter]=ae.LINEAR;ze[a.LinearMipmapNearestFilter]=ae.LINEAR_MIPMAP_NEAREST;ze[a.LinearMipmapLinearFilter]=ae.LINEAR_MIPMAP_LINEAR;ze[a.ClampToEdgeWrapping]=ae.CLAMP_TO_EDGE;ze[a.RepeatWrapping]=ae.REPEAT;ze[a.MirroredRepeatWrapping]=ae.MIRRORED_REPEAT;const zs={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},uA=new a.Color,Ks=12,dA=1179937895,pA=2,Ys=8,gA=1313821514,fA=5130562;function Wt(c,e){return c.length===e.length&&c.every(function(t,s){return t===e[s]})}function mA(c){return new TextEncoder().encode(c).buffer}function IA(c){return Wt(c.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function bA(c,e,t){const s={min:new Array(c.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(c.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let n=e;n<e+t;n++)for(let i=0;i<c.itemSize;i++){let o;c.itemSize>4?o=c.array[n*c.itemSize+i]:(i===0?o=c.getX(n):i===1?o=c.getY(n):i===2?o=c.getZ(n):i===3&&(o=c.getW(n)),c.normalized===!0&&(o=a.MathUtils.normalize(o,c.array))),s.min[i]=Math.min(s.min[i],o),s.max[i]=Math.max(s.max[i],o)}return s}function Ki(c){return Math.ceil(c/4)*4}function Pn(c,e=0){const t=Ki(c.byteLength);if(t!==c.byteLength){const s=new Uint8Array(t);if(s.set(new Uint8Array(c)),e!==0)for(let n=c.byteLength;n<t;n++)s[n]=e;return s.buffer}return c}function Vs(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Js(c,e){if(c.toBlob!==void 0)return new Promise(s=>c.toBlob(s,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),c.convertToBlob({type:e,quality:t})}class EA{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+a.REVISION}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,s={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},s),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const n=this,i=n.buffers,o=n.json;s=n.options;const r=n.extensionsUsed,A=n.extensionsRequired,l=new Blob(i,{type:"application/octet-stream"}),h=Object.keys(r),u=Object.keys(A);if(h.length>0&&(o.extensionsUsed=h),u.length>0&&(o.extensionsRequired=u),o.buffers&&o.buffers.length>0&&(o.buffers[0].byteLength=l.size),s.binary===!0){const d=new FileReader;d.readAsArrayBuffer(l),d.onloadend=function(){const g=Pn(d.result),f=new DataView(new ArrayBuffer(Ys));f.setUint32(0,g.byteLength,!0),f.setUint32(4,fA,!0);const I=Pn(mA(JSON.stringify(o)),32),b=new DataView(new ArrayBuffer(Ys));b.setUint32(0,I.byteLength,!0),b.setUint32(4,gA,!0);const C=new ArrayBuffer(Ks),w=new DataView(C);w.setUint32(0,dA,!0),w.setUint32(4,pA,!0);const E=Ks+b.byteLength+I.byteLength+f.byteLength+g.byteLength;w.setUint32(8,E,!0);const y=new Blob([C,b,I,f,g],{type:"application/octet-stream"}),Q=new FileReader;Q.readAsArrayBuffer(y),Q.onloadend=function(){t(Q.result)}}}else if(o.buffers&&o.buffers.length>0){const d=new FileReader;d.readAsDataURL(l),d.onloadend=function(){const g=d.result;o.buffers[0].uri=g,t(o)}}else t(o)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const s=this.options,n=this.extensionsUsed;try{const i=JSON.parse(JSON.stringify(e.userData));if(s.includeCustomExtensions&&i.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const o in i.gltfExtensions)t.extensions[o]=i.gltfExtensions[o],n[o]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const n=new Map;n.set(!0,this.uid++),n.set(!1,this.uid++),this.uids.set(e,n)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const s=new a.Vector3;for(let n=0,i=e.count;n<i;n++)if(Math.abs(s.fromBufferAttribute(e,n).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const s=e.clone(),n=new a.Vector3;for(let i=0,o=s.count;i<o;i++)n.fromBufferAttribute(s,i),n.x===0&&n.y===0&&n.z===0?n.setX(1):n.normalize(),s.setXYZ(i,n.x,n.y,n.z);return t.attributesNormalized.set(e,s),s}applyTextureTransform(e,t){let s=!1;const n={};(t.offset.x!==0||t.offset.y!==0)&&(n.offset=t.offset.toArray(),s=!0),t.rotation!==0&&(n.rotation=t.rotation,s=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(n.scale=t.repeat.toArray(),s=!0),s&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=n,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function s(g){return g.colorSpace===a.SRGBColorSpace?function(I){return I<.04045?I*.0773993808:Math.pow(I*.9478672986+.0521327014,2.4)}:function(I){return I}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof a.CompressedTexture&&(e=Nn(e)),t instanceof a.CompressedTexture&&(t=Nn(t));const n=e?e.image:null,i=t?t.image:null,o=Math.max(n?n.width:0,i?i.width:0),r=Math.max(n?n.height:0,i?i.height:0),A=Vs();A.width=o,A.height=r;const l=A.getContext("2d",{willReadFrequently:!0});l.fillStyle="#00ffff",l.fillRect(0,0,o,r);const h=l.getImageData(0,0,o,r);if(n){l.drawImage(n,0,0,o,r);const g=s(e),f=l.getImageData(0,0,o,r).data;for(let I=2;I<f.length;I+=4)h.data[I]=g(f[I]/256)*256}if(i){l.drawImage(i,0,0,o,r);const g=s(t),f=l.getImageData(0,0,o,r).data;for(let I=1;I<f.length;I+=4)h.data[I]=g(f[I]/256)*256}l.putImageData(h,0,0);const d=(e||t).clone();return d.source=new a.Source(A),d.colorSpace=a.NoColorSpace,d.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),d}processBuffer(e){const t=this.json,s=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),s.push(e),0}processBufferView(e,t,s,n,i){const o=this.json;o.bufferViews||(o.bufferViews=[]);let r;switch(t){case ae.BYTE:case ae.UNSIGNED_BYTE:r=1;break;case ae.SHORT:case ae.UNSIGNED_SHORT:r=2;break;default:r=4}let A=e.itemSize*r;i===ae.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const l=Ki(n*A),h=new DataView(new ArrayBuffer(l));let u=0;for(let f=s;f<s+n;f++){for(let I=0;I<e.itemSize;I++){let b;e.itemSize>4?b=e.array[f*e.itemSize+I]:(I===0?b=e.getX(f):I===1?b=e.getY(f):I===2?b=e.getZ(f):I===3&&(b=e.getW(f)),e.normalized===!0&&(b=a.MathUtils.normalize(b,e.array))),t===ae.FLOAT?h.setFloat32(u,b,!0):t===ae.INT?h.setInt32(u,b,!0):t===ae.UNSIGNED_INT?h.setUint32(u,b,!0):t===ae.SHORT?h.setInt16(u,b,!0):t===ae.UNSIGNED_SHORT?h.setUint16(u,b,!0):t===ae.BYTE?h.setInt8(u,b):t===ae.UNSIGNED_BYTE&&h.setUint8(u,b),u+=r}u%A!==0&&(u+=A-u%A)}const d={buffer:this.processBuffer(h.buffer),byteOffset:this.byteOffset,byteLength:l};return i!==void 0&&(d.target=i),i===ae.ARRAY_BUFFER&&(d.byteStride=A),this.byteOffset+=l,o.bufferViews.push(d),{id:o.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,s=t.json;return s.bufferViews||(s.bufferViews=[]),new Promise(function(n){const i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){const o=Pn(i.result),r={buffer:t.processBuffer(o),byteOffset:t.byteOffset,byteLength:o.byteLength};t.byteOffset+=o.byteLength,n(s.bufferViews.push(r)-1)}})}processAccessor(e,t,s,n){const i=this.json,o={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let r;if(e.array.constructor===Float32Array)r=ae.FLOAT;else if(e.array.constructor===Int32Array)r=ae.INT;else if(e.array.constructor===Uint32Array)r=ae.UNSIGNED_INT;else if(e.array.constructor===Int16Array)r=ae.SHORT;else if(e.array.constructor===Uint16Array)r=ae.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)r=ae.BYTE;else if(e.array.constructor===Uint8Array)r=ae.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(s===void 0&&(s=0),(n===void 0||n===1/0)&&(n=e.count),n===0)return null;const A=bA(e,s,n);let l;t!==void 0&&(l=e===t.index?ae.ELEMENT_ARRAY_BUFFER:ae.ARRAY_BUFFER);const h=this.processBufferView(e,r,s,n,l),u={bufferView:h.id,byteOffset:h.byteOffset,componentType:r,count:n,max:A.max,min:A.min,type:o[e.itemSize]};return e.normalized===!0&&(u.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(u)-1}processImage(e,t,s,n="image/png"){if(e!==null){const i=this,o=i.cache,r=i.json,A=i.options,l=i.pending;o.images.has(e)||o.images.set(e,{});const h=o.images.get(e),u=n+":flipY/"+s.toString();if(h[u]!==void 0)return h[u];r.images||(r.images=[]);const d={mimeType:n},g=Vs();g.width=Math.min(e.width,A.maxTextureSize),g.height=Math.min(e.height,A.maxTextureSize);const f=g.getContext("2d",{willReadFrequently:!0});if(s===!0&&(f.translate(0,g.height),f.scale(1,-1)),e.data!==void 0){t!==a.RGBAFormat&&console.error("GLTFExporter: Only RGBAFormat is supported.",t),(e.width>A.maxTextureSize||e.height>A.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const b=new Uint8ClampedArray(e.height*e.width*4);for(let C=0;C<b.length;C+=4)b[C+0]=e.data[C+0],b[C+1]=e.data[C+1],b[C+2]=e.data[C+2],b[C+3]=e.data[C+3];f.putImageData(new ImageData(b,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)f.drawImage(e,0,0,g.width,g.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");A.binary===!0?l.push(Js(g,n).then(b=>i.processBufferViewImage(b)).then(b=>{d.bufferView=b})):g.toDataURL!==void 0?d.uri=g.toDataURL(n):l.push(Js(g,n).then(b=>new FileReader().readAsDataURL(b)).then(b=>{d.uri=b}));const I=r.images.push(d)-1;return h[u]=I,I}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const s={magFilter:ze[e.magFilter],minFilter:ze[e.minFilter],wrapS:ze[e.wrapS],wrapT:ze[e.wrapT]};return t.samplers.push(s)-1}processTexture(e){const s=this.options,n=this.cache,i=this.json;if(n.textures.has(e))return n.textures.get(e);const o={keep:!0,newTexture:null};if(this._invokeAll(function(h){h.beforeWriteTexture&&h.beforeWriteTexture(e,o)}),o.keep===!1)return null;o.newTexture!=null&&(e=o.newTexture),i.textures||(i.textures=[]),e instanceof a.CompressedTexture&&(e=Nn(e,s.maxTextureSize));let r=e.userData.mimeType;r==="image/webp"&&(r="image/png");const A={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,r)};e.name&&(A.name=e.name),this._invokeAll(function(h){h.writeTexture&&h.writeTexture(e,A)});const l=i.textures.push(A)-1;return n.textures.set(e,l),l}processMaterial(e){const t=this.cache,s=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;s.materials||(s.materials=[]);const n={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const i=e.color.toArray().concat([e.opacity]);Wt(i,[1,1,1,1])||(n.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(n.pbrMetallicRoughness.metallicFactor=e.metalness,n.pbrMetallicRoughness.roughnessFactor=e.roughness):(n.pbrMetallicRoughness.metallicFactor=.5,n.pbrMetallicRoughness.roughnessFactor=.5);const o=e.metalnessMap?.image?e.metalnessMap:void 0,r=e.roughnessMap?.image?e.roughnessMap:void 0;if(o||r){const l=this.buildMetalRoughTexture(o,r),h={index:this.processTexture(l),channel:l.channel};this.applyTextureTransform(h,l),n.pbrMetallicRoughness.metallicRoughnessTexture=h}if(e.map){const l={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(l,e.map),n.pbrMetallicRoughness.baseColorTexture=l}if(e.emissive){const l=e.emissive;if(Math.max(l.r,l.g,l.b)>0&&(n.emissiveFactor=e.emissive.toArray()),e.emissiveMap?.image){const u={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(u,e.emissiveMap),n.emissiveTexture=u}}if(e.normalMap?.image){const l={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(l.scale=e.normalScale.x),this.applyTextureTransform(l,e.normalMap),n.normalTexture=l}if(e.aoMap?.image){const l={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(l.strength=e.aoMapIntensity),this.applyTextureTransform(l,e.aoMap),n.occlusionTexture=l}e.transparent?n.alphaMode="BLEND":e.alphaTest>0&&(n.alphaMode="MASK",n.alphaCutoff=e.alphaTest),e.side===a.DoubleSide&&(n.doubleSided=!0),e.name!==""&&(n.name=e.name),this.serializeUserData(e,n),this._invokeAll(function(l){l.writeMaterial&&l.writeMaterial(e,n)});const A=s.materials.push(n)-1;return t.materials.set(e,A),A}processMesh(e){const t={keep:!0};if(this._invokeAll(function(Q){Q.beforeWriteMesh&&Q.beforeWriteMesh(e,t)}),t.keep!=!0)return null;const s=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let Q=0,R=e.material.length;Q<R;Q++)i.push(e.material[Q].uuid);else i.push(e.material.uuid);const o=i.join(":");if(s.meshes.has(o))return s.meshes.get(o);const r=e.geometry;let A;e.isLineSegments?A=ae.LINES:e.isLineLoop?A=ae.LINE_LOOP:e.isLine?A=ae.LINE_STRIP:e.isPoints?A=ae.POINTS:A=e.material.wireframe?ae.LINES:ae.TRIANGLES;const l={},h={},u=[],d=[],g={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=r.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),r.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let I=null;for(let Q in r.attributes){if(Q.slice(0,5)==="morph")continue;const R=r.attributes[Q];if(Q=g[Q]||Q.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(Q)||(Q="_"+Q),s.attributes.has(this.getUID(R))){h[Q]=s.attributes.get(this.getUID(R));continue}I=null;const S=R.array;Q==="JOINTS_0"&&!(S instanceof Uint16Array)&&!(S instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),I=new a.BufferAttribute(new Uint16Array(S),R.itemSize,R.normalized));const v=this.processAccessor(I||R,r);v!==null&&(Q.startsWith("_")||this.detectMeshQuantization(Q,R),h[Q]=v,s.attributes.set(this.getUID(R),v))}if(f!==void 0&&r.setAttribute("normal",f),Object.keys(h).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const Q=[],R=[],_={};if(e.morphTargetDictionary!==void 0)for(const S in e.morphTargetDictionary)_[e.morphTargetDictionary[S]]=S;for(let S=0;S<e.morphTargetInfluences.length;++S){const v={};let G=!1;for(const N in r.morphAttributes){if(N!=="position"&&N!=="normal"&&N!=="color"){G||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),G=!0);continue}const H=r.morphAttributes[N][S],X=N.toUpperCase()+(N==="color"?"_0":""),U=r.attributes[N];if(s.attributes.has(this.getUID(H,!0))){v[X]=s.attributes.get(this.getUID(H,!0));continue}const K=H.clone();if(!r.morphTargetsRelative)for(let O=0,Z=H.count;O<Z;O++)for(let ie=0;ie<H.itemSize;ie++)ie===0&&K.setX(O,H.getX(O)-U.getX(O)),ie===1&&K.setY(O,H.getY(O)-U.getY(O)),ie===2&&K.setZ(O,H.getZ(O)-U.getZ(O)),ie===3&&K.setW(O,H.getW(O)-U.getW(O));v[X]=this.processAccessor(K,r),s.attributes.set(this.getUID(U,!0),v[X])}d.push(v),Q.push(e.morphTargetInfluences[S]),e.morphTargetDictionary!==void 0&&R.push(_[S])}l.weights=Q,R.length>0&&(l.extras={},l.extras.targetNames=R)}const b=Array.isArray(e.material);if(b&&r.groups.length===0)return null;let C=!1;if(b&&r.index===null){const Q=[];for(let R=0,_=r.attributes.position.count;R<_;R++)Q[R]=R;r.setIndex(Q),C=!0}const w=b?e.material:[e.material],E=b?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let Q=0,R=E.length;Q<R;Q++){const _={mode:A,attributes:h};if(this.serializeUserData(r,_),d.length>0&&(_.targets=d),r.index!==null){let v=this.getUID(r.index);(E[Q].start!==void 0||E[Q].count!==void 0)&&(v+=":"+E[Q].start+":"+E[Q].count),s.attributes.has(v)?_.indices=s.attributes.get(v):(_.indices=this.processAccessor(r.index,r,E[Q].start,E[Q].count),s.attributes.set(v,_.indices)),_.indices===null&&delete _.indices}const S=this.processMaterial(w[E[Q].materialIndex]);S!==null&&(_.material=S),u.push(_)}C===!0&&r.setIndex(null),l.primitives=u,n.meshes||(n.meshes=[]),this._invokeAll(function(Q){Q.writeMesh&&Q.writeMesh(e,l)});const y=n.meshes.push(l)-1;return s.meshes.set(o,y),y}detectMeshQuantization(e,t){if(this.extensionsUsed[Un])return;let s;switch(t.array.constructor){case Int8Array:s="byte";break;case Uint8Array:s="unsigned byte";break;case Int16Array:s="short";break;case Uint16Array:s="unsigned short";break;default:return}t.normalized&&(s+=" normalized");const n=e.split("_",1)[0];qs[n]&&qs[n].includes(s)&&(this.extensionsUsed[Un]=!0,this.extensionsRequired[Un]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const s=e.isOrthographicCamera,n={type:s?"orthographic":"perspective"};return s?n.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:n.perspective={aspectRatio:e.aspect,yfov:a.MathUtils.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(n.name=e.type),t.cameras.push(n)-1}processAnimation(e,t){const s=this.json,n=this.nodeMap;s.animations||(s.animations=[]),e=rs.Utils.mergeMorphTargetTracks(e.clone(),t);const i=e.tracks,o=[],r=[];for(let A=0;A<i.length;++A){const l=i[A],h=a.PropertyBinding.parseTrackName(l.name);let u=a.PropertyBinding.findNode(t,h.nodeName);const d=zs[h.propertyName];if(h.objectName==="bones"&&(u.isSkinnedMesh===!0?u=u.skeleton.getBoneByName(h.objectIndex):u=void 0),!u||!d){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',l.name);continue}const g=1;let f=l.values.length/l.times.length;d===zs.morphTargetInfluences&&(f/=u.morphTargetInfluences.length);let I;l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(I="CUBICSPLINE",f/=3):l.getInterpolation()===a.InterpolateDiscrete?I="STEP":I="LINEAR",r.push({input:this.processAccessor(new a.BufferAttribute(l.times,g)),output:this.processAccessor(new a.BufferAttribute(l.values,f)),interpolation:I}),o.push({sampler:r.length-1,target:{node:n.get(u),path:d}})}return s.animations.push({name:e.name||"clip_"+s.animations.length,samplers:r,channels:o}),s.animations.length-1}processSkin(e){const t=this.json,s=this.nodeMap,n=t.nodes[s.get(e)],i=e.skeleton;if(i===void 0)return null;const o=e.skeleton.bones[0];if(o===void 0)return null;const r=[],A=new Float32Array(i.bones.length*16),l=new a.Matrix4;for(let u=0;u<i.bones.length;++u)r.push(s.get(i.bones[u])),l.copy(i.boneInverses[u]),l.multiply(e.bindMatrix).toArray(A,u*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new a.BufferAttribute(A,16)),joints:r,skeleton:s.get(o)}),n.skin=t.skins.length-1}processNode(e){const t={keep:!0};if(this._invokeAll(function(A){A.beforeWriteNode&&A.beforeWriteNode(e,t)}),t.keep!=!0)return null;const s=this.json,n=this.options,i=this.nodeMap;s.nodes||(s.nodes=[]);const o={};if(n.trs){const A=e.quaternion.toArray(),l=e.position.toArray(),h=e.scale.toArray();Wt(A,[0,0,0,1])||(o.rotation=A),Wt(l,[0,0,0])||(o.translation=l),Wt(h,[1,1,1])||(o.scale=h)}else e.matrixAutoUpdate&&e.updateMatrix(),IA(e.matrix)===!1&&(o.matrix=e.matrix.elements);if(e.name!==""&&(o.name=String(e.name)),this.serializeUserData(e,o),e.isMesh||e.isLine||e.isPoints){const A=this.processMesh(e);A!==null&&(o.mesh=A)}else e.isCamera&&(o.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const A=[];for(let l=0,h=e.children.length;l<h;l++){const u=e.children[l];if(u.visible||n.onlyVisible===!1){const d=this.processNode(u);d!==null&&A.push(d)}}A.length>0&&(o.children=A)}this._invokeAll(function(A){A.writeNode&&A.writeNode(e,o)});const r=s.nodes.push(o)-1;return i.set(e,r),r}processScene(e){const t=this.json,s=this.options;t.scenes||(t.scenes=[],t.scene=0);const n={};e.name!==""&&(n.name=e.name),t.scenes.push(n);const i=[];for(let o=0,r=e.children.length;o<r;o++){const A=e.children[o];if(A.visible||s.onlyVisible===!1){const l=this.processNode(A);l!==null&&i.push(l)}}i.length>0&&(n.nodes=i),this.serializeUserData(e,n)}processObjects(e){const t=new a.Scene;t.name="AuxScene";for(let s=0;s<e.length;s++)t.children.push(e[s]);this.processScene(t)}processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(n){n.beforeParse&&n.beforeParse(e)});const s=[];for(let n=0;n<e.length;n++)e[n]instanceof a.Scene?this.processScene(e[n]):s.push(e[n]);s.length>0&&this.processObjects(s);for(let n=0;n<this.skins.length;++n)this.processSkin(this.skins[n]);for(let n=0;n<t.animations.length;++n)this.processAnimation(t.animations[n],e[0]);this._invokeAll(function(n){n.afterParse&&n.afterParse(e)})}_invokeAll(e){for(let t=0,s=this.plugins.length;t<s;t++)e(this.plugins[t])}}class CA{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}const s=this.writer,n=s.json,i=s.extensionsUsed,o={};e.name&&(o.name=e.name),o.color=e.color.toArray(),o.intensity=e.intensity,e.isDirectionalLight?o.type="directional":e.isPointLight?(o.type="point",e.distance>0&&(o.range=e.distance)):e.isSpotLight&&(o.type="spot",e.distance>0&&(o.range=e.distance),o.spot={},o.spot.innerConeAngle=(1-e.penumbra)*e.angle,o.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(n.extensions=n.extensions||{},n.extensions[this.name]={lights:[]},i[this.name]=!0);const r=n.extensions[this.name].lights;r.push(o),t.extensions=t.extensions||{},t.extensions[this.name]={light:r.length-1}}}class BA{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class yA{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){const o={index:s.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};s.applyTextureTransform(o,e.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const o={index:s.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};s.applyTextureTransform(o,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(e.clearcoatNormalMap){const o={index:s.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(o.scale=e.clearcoatNormalScale.x),s.applyTextureTransform(o,e.clearcoatNormalMap),i.clearcoatNormalTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class wA{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const n=this.writer.extensionsUsed,i={};i.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class QA{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){const o={index:s.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};s.applyTextureTransform(o,e.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const o={index:s.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};s.applyTextureTransform(o,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class xA{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){const o={index:s.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};s.applyTextureTransform(o,e.transmissionMap),i.transmissionTexture=o}t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class SA{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const s=this.writer,n=s.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){const o={index:s.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};s.applyTextureTransform(o,e.thicknessMap),i.thicknessTexture=o}e.attenuationDistance!==1/0&&(i.attenuationDistance=e.attenuationDistance),i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class TA{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const n=this.writer.extensionsUsed,i={};i.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class vA{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(uA)&&!e.specularIntensityMap&&!e.specularColorMap)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.specularIntensityMap){const o={index:s.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};s.applyTextureTransform(o,e.specularIntensityMap),i.specularTexture=o}if(e.specularColorMap){const o={index:s.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};s.applyTextureTransform(o,e.specularColorMap),i.specularColorTexture=o}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class MA{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.sheenRoughnessMap){const o={index:s.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};s.applyTextureTransform(o,e.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(e.sheenColorMap){const o={index:s.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};s.applyTextureTransform(o,e.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class RA{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.anisotropyMap){const o={index:s.processTexture(e.anisotropyMap)};s.applyTextureTransform(o,e.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class _A{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,i={};i.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class DA{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const s=this.writer,n=s.extensionsUsed,i={};if(e.bumpMap){const o={index:s.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};s.applyTextureTransform(o,e.bumpMap),i.bumpTexture=o}i.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=i,n[this.name]=!0}}class FA{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const s=this.writer,n=e,i=new Float32Array(n.count*3),o=new Float32Array(n.count*4),r=new Float32Array(n.count*3),A=new a.Matrix4,l=new a.Vector3,h=new a.Quaternion,u=new a.Vector3;for(let g=0;g<n.count;g++)n.getMatrixAt(g,A),A.decompose(l,h,u),l.toArray(i,g*3),h.toArray(o,g*4),u.toArray(r,g*3);const d={TRANSLATION:s.processAccessor(new a.BufferAttribute(i,3)),ROTATION:s.processAccessor(new a.BufferAttribute(o,4)),SCALE:s.processAccessor(new a.BufferAttribute(r,3))};n.instanceColor&&(d._COLOR_0=s.processAccessor(n.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:d},s.extensionsUsed[this.name]=!0,s.extensionsRequired[this.name]=!0}}rs.Utils={insertKeyframe:function(c,e){const s=c.getValueSize(),n=new c.TimeBufferType(c.times.length+1),i=new c.ValueBufferType(c.values.length+s),o=c.createInterpolant(new c.ValueBufferType(s));let r;if(c.times.length===0){n[0]=e;for(let A=0;A<s;A++)i[A]=0;r=0}else if(e<c.times[0]){if(Math.abs(c.times[0]-e)<.001)return 0;n[0]=e,n.set(c.times,1),i.set(o.evaluate(e),0),i.set(c.values,s),r=0}else if(e>c.times[c.times.length-1]){if(Math.abs(c.times[c.times.length-1]-e)<.001)return c.times.length-1;n[n.length-1]=e,n.set(c.times,0),i.set(c.values,0),i.set(o.evaluate(e),c.values.length),r=n.length-1}else for(let A=0;A<c.times.length;A++){if(Math.abs(c.times[A]-e)<.001)return A;if(c.times[A]<e&&c.times[A+1]>e){n.set(c.times.slice(0,A+1),0),n[A+1]=e,n.set(c.times.slice(A+1),A+2),i.set(c.values.slice(0,(A+1)*s),0),i.set(o.evaluate(e),(A+1)*s),i.set(c.values.slice((A+1)*s),(A+2)*s),r=A+1;break}}return c.times=n,c.values=i,r},mergeMorphTargetTracks:function(c,e){const t=[],s={},n=c.tracks;for(let i=0;i<n.length;++i){let o=n[i];const r=a.PropertyBinding.parseTrackName(o.name),A=a.PropertyBinding.findNode(e,r.nodeName);if(r.propertyName!=="morphTargetInfluences"||r.propertyIndex===void 0){t.push(o);continue}if(o.createInterpolant!==o.InterpolantFactoryMethodDiscrete&&o.createInterpolant!==o.InterpolantFactoryMethodLinear){if(o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),o=o.clone(),o.setInterpolation(a.InterpolateLinear)}const l=A.morphTargetInfluences.length,h=A.morphTargetDictionary[r.propertyIndex];if(h===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+r.propertyIndex);let u;if(s[A.uuid]===void 0){u=o.clone();const g=new u.ValueBufferType(l*u.times.length);for(let f=0;f<u.times.length;f++)g[f*l+h]=u.values[f];u.name=(r.nodeName||"")+".morphTargetInfluences",u.values=g,s[A.uuid]=u,t.push(u);continue}const d=o.createInterpolant(new o.ValueBufferType(1));u=s[A.uuid];for(let g=0;g<u.times.length;g++)u.values[g*l+h]=d.evaluate(u.times[g]);for(let g=0;g<o.times.length;g++){const f=this.insertKeyframe(u,o.times[g]);u.values[f*l+h]=o.values[g]}}return c.tracks=t,c}};const ye={ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function Yi(c){const e=await fetch(c);if(e.ok)return e.json();throw new Error(e.statusText)}async function LA(c){if(!c)throw new Error("No basePath supplied");return await Yi(`${c}/profilesList.json`)}async function kA(c,e,t=null,s=!0){if(!c)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const n=await LA(e);let i;if(c.profiles.some(A=>{const l=n[A];return l&&(i={profileId:A,profilePath:`${e}/${l.path}`,deprecated:!!l.deprecated}),!!i}),!i){if(!t)throw new Error("No matching profile name found");const A=n[t];if(!A)throw new Error(`No matching profile name found and default profile "${t}" missing.`);i={profileId:t,profilePath:`${e}/${A.path}`,deprecated:!!A.deprecated}}const o=await Yi(i.profilePath);let r;if(s){let A;if(c.handedness==="any"?A=o.layouts[Object.keys(o.layouts)[0]]:A=o.layouts[c.handedness],!A)throw new Error(`No matching handedness, ${c.handedness}, in profile ${i.profileId}`);A.assetPath&&(r=i.profilePath.replace("profile.json",A.assetPath))}return{profile:o,assetPath:r}}const GA={xAxis:0,yAxis:0,button:0,state:ye.ComponentState.DEFAULT};function NA(c=0,e=0){let t=c,s=e;if(Math.sqrt(c*c+e*e)>1){const o=Math.atan2(e,c);t=Math.cos(o),s=Math.sin(o)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:s*.5+.5}}class UA{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===ye.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(GA)}updateFromComponent({xAxis:e,yAxis:t,button:s,state:n}){const{normalizedXAxis:i,normalizedYAxis:o}=NA(e,t);switch(this.componentProperty){case ye.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?i:.5;break;case ye.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case ye.ComponentProperty.BUTTON:this.value=this.states.includes(n)?s:0;break;case ye.ComponentProperty.STATE:this.valueNodeProperty===ye.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class PA{constructor(e,t){if(!e||!t||!t.visualResponses||!t.gamepadIndices||Object.keys(t.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach(s=>{const n=new UA(t.visualResponses[s]);this.visualResponses[s]=n}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:ye.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=ye.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||this.values.button===1?this.values.state=ye.ComponentState.PRESSED:(t.touched||this.values.button>ye.ButtonTouchThreshold)&&(this.values.state=ye.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===ye.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>ye.AxisTouchThreshold&&(this.values.state=ye.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===ye.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>ye.AxisTouchThreshold&&(this.values.state=ye.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class OA{constructor(e,t,s){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=s,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(n=>{const i=this.layoutDescription.components[n];this.components[n]=new PA(n,i)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach(t=>{e.push(t.data)}),e}updateFromGamepad(){Object.values(this.components).forEach(e=>{e.updateFromGamepad(this.xrInputSource.gamepad)})}}const HA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",jA="generic-trigger";class qA extends a.Object3D{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e?this:(this.envMap=e,this.traverse(t=>{t.isMesh&&(t.material.envMap=this.envMap,t.material.needsUpdate=!0)}),this)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(t=>{Object.values(t.visualResponses).forEach(s=>{const{valueNode:n,minNode:i,maxNode:o,value:r,valueNodeProperty:A}=s;n&&(A===ye.VisualResponseProperty.VISIBILITY?n.visible=r:A===ye.VisualResponseProperty.TRANSFORM&&(n.quaternion.slerpQuaternions(i.quaternion,o.quaternion,r),n.position.lerpVectors(i.position,o.position,r)))})}))}}function zA(c,e){Object.values(c.components).forEach(t=>{const{type:s,touchPointNodeName:n,visualResponses:i}=t;if(s===ye.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(n),t.touchPointNode){const o=new a.SphereGeometry(.001),r=new a.MeshBasicMaterial({color:255}),A=new a.Mesh(o,r);t.touchPointNode.add(A)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(i).forEach(o=>{const{valueNodeName:r,minNodeName:A,maxNodeName:l,valueNodeProperty:h}=o;if(h===ye.VisualResponseProperty.TRANSFORM){if(o.minNode=e.getObjectByName(A),o.maxNode=e.getObjectByName(l),!o.minNode){console.warn(`Could not find ${A} in the model`);return}if(!o.maxNode){console.warn(`Could not find ${l} in the model`);return}}o.valueNode=e.getObjectByName(r),o.valueNode||console.warn(`Could not find ${r} in the model`)})})}function Ws(c,e){zA(c.motionController,e),c.envMap&&e.traverse(t=>{t.isMesh&&(t.material.envMap=c.envMap,t.material.needsUpdate=!0)}),c.layers.mask!=0&&e.traverse(t=>{t.layers.mask=c.layers.mask}),c.add(e)}class KA{constructor(e=null,t=null){this.gltfLoader=e,this.path=HA,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new es)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new qA;let s=null;return e.addEventListener("connected",n=>{const i=n.data;i.targetRayMode!=="tracked-pointer"||!i.gamepad||i.hand||kA(i,this.path,jA).then(({profile:o,assetPath:r})=>{t.motionController=new OA(i,o,r);const A=this._assetCache[t.motionController.assetUrl];if(A)s=A.scene.clone(),Ws(t,s),this.onLoad&&this.onLoad(s);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,l=>{this._assetCache[t.motionController.assetUrl]=l,s=l.scene.clone(),Ws(t,s),this.onLoad&&this.onLoad(s)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(o=>{console.warn(o)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(s),s=null}),t}}const YA="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class VA{constructor(e,t,s,n,i=null,o=null){this.controller=t,this.handModel=e,this.bones=[],i===null&&(i=new es,i.setPath(s||YA)),i.load(`${n}.glb`,r=>{const A=r.scene.children[0];this.handModel.add(A),A.layers.mask=this.handModel.layers.mask;const l=A.getObjectByProperty("type","SkinnedMesh");l.frustumCulled=!1,l.castShadow=!0,l.receiveShadow=!0,["wrist","thumb-metacarpal","thumb-phalanx-proximal","thumb-phalanx-distal","thumb-tip","index-finger-metacarpal","index-finger-phalanx-proximal","index-finger-phalanx-intermediate","index-finger-phalanx-distal","index-finger-tip","middle-finger-metacarpal","middle-finger-phalanx-proximal","middle-finger-phalanx-intermediate","middle-finger-phalanx-distal","middle-finger-tip","ring-finger-metacarpal","ring-finger-phalanx-proximal","ring-finger-phalanx-intermediate","ring-finger-phalanx-distal","ring-finger-tip","pinky-finger-metacarpal","pinky-finger-phalanx-proximal","pinky-finger-phalanx-intermediate","pinky-finger-phalanx-distal","pinky-finger-tip"].forEach(u=>{const d=A.getObjectByName(u);d!==void 0?d.jointName=u:console.warn(`Couldn't find ${u} in ${n} hand mesh`),this.bones.push(d)}),o&&o(A)})}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const s=this.bones[t];if(s){const n=e[s.jointName];if(n.visible){const i=n.position;s.position.copy(i),s.quaternion.copy(n.quaternion)}}}}}const Xs=new a.Box3,ln=new a.Vector3;class Vi extends a.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],s=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(s),this.setAttribute("position",new a.Float32BufferAttribute(e,3)),this.setAttribute("uv",new a.Float32BufferAttribute(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,s=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),s.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const s=new a.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new a.InterleavedBufferAttribute(s,3,0)),this.setAttribute("instanceEnd",new a.InterleavedBufferAttribute(s,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const s=new a.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new a.InterleavedBufferAttribute(s,3,0)),this.setAttribute("instanceColorEnd",new a.InterleavedBufferAttribute(s,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new a.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new a.Box3);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Xs.setFromBufferAttribute(t),this.boundingBox.union(Xs))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new a.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const s=this.boundingSphere.center;this.boundingBox.getCenter(s);let n=0;for(let i=0,o=e.count;i<o;i++)ln.fromBufferAttribute(e,i),n=Math.max(n,s.distanceToSquared(ln)),ln.fromBufferAttribute(t,i),n=Math.max(n,s.distanceToSquared(ln));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}a.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new a.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};a.ShaderLib.line={uniforms:a.UniformsUtils.merge([a.UniformsLib.common,a.UniformsLib.fog,a.UniformsLib.line]),vertexShader:`
132
132
  #include <common>
133
133
  #include <color_pars_vertex>
134
134
  #include <fog_pars_vertex>
@@ -498,4 +498,4 @@ version 0.8.2
498
498
  #include <premultiplied_alpha_fragment>
499
499
 
500
500
  }
501
- `};class rs extends a.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:a.UniformsUtils.clone(a.ShaderLib.line.uniforms),vertexShader:a.ShaderLib.line.vertexShader,fragmentShader:a.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const On=new a.Vector4,Xs=new a.Vector3,Zs=new a.Vector3,ve=new a.Vector4,Me=new a.Vector4,tt=new a.Vector4,Hn=new a.Vector3,jn=new a.Matrix4,De=new a.Line3,$s=new a.Vector3,ln=new a.Box3,hn=new a.Sphere,nt=new a.Vector4;let st,Qt;function ei(c,e,t){return nt.set(0,0,-e,1).applyMatrix4(c.projectionMatrix),nt.multiplyScalar(1/nt.w),nt.x=Qt/t.width,nt.y=Qt/t.height,nt.applyMatrix4(c.projectionMatrixInverse),nt.multiplyScalar(1/nt.w),Math.abs(Math.max(nt.x,nt.y))}function DA(c,e){const t=c.matrixWorld,s=c.geometry,n=s.attributes.instanceStart,i=s.attributes.instanceEnd,o=Math.min(s.instanceCount,n.count);for(let r=0,A=o;r<A;r++){De.start.fromBufferAttribute(n,r),De.end.fromBufferAttribute(i,r),De.applyMatrix4(t);const l=new a.Vector3,h=new a.Vector3;st.distanceSqToSegment(De.start,De.end,h,l),h.distanceTo(l)<Qt*.5&&e.push({point:h,pointOnLine:l,distance:st.origin.distanceTo(h),object:c,face:null,faceIndex:r,uv:null,uv1:null})}}function _A(c,e,t){const s=e.projectionMatrix,i=c.material.resolution,o=c.matrixWorld,r=c.geometry,A=r.attributes.instanceStart,l=r.attributes.instanceEnd,h=Math.min(r.instanceCount,A.count),u=-e.near;st.at(1,tt),tt.w=1,tt.applyMatrix4(e.matrixWorldInverse),tt.applyMatrix4(s),tt.multiplyScalar(1/tt.w),tt.x*=i.x/2,tt.y*=i.y/2,tt.z=0,Hn.copy(tt),jn.multiplyMatrices(e.matrixWorldInverse,o);for(let p=0,g=h;p<g;p++){if(ve.fromBufferAttribute(A,p),Me.fromBufferAttribute(l,p),ve.w=1,Me.w=1,ve.applyMatrix4(jn),Me.applyMatrix4(jn),ve.z>u&&Me.z>u)continue;if(ve.z>u){const C=ve.z-Me.z,w=(ve.z-u)/C;ve.lerp(Me,w)}else if(Me.z>u){const C=Me.z-ve.z,w=(Me.z-u)/C;Me.lerp(ve,w)}ve.applyMatrix4(s),Me.applyMatrix4(s),ve.multiplyScalar(1/ve.w),Me.multiplyScalar(1/Me.w),ve.x*=i.x/2,ve.y*=i.y/2,Me.x*=i.x/2,Me.y*=i.y/2,De.start.copy(ve),De.start.z=0,De.end.copy(Me),De.end.z=0;const I=De.closestPointToPointParameter(Hn,!0);De.at(I,$s);const b=a.MathUtils.lerp(ve.z,Me.z,I),E=b>=-1&&b<=1,y=Hn.distanceTo($s)<Qt*.5;if(E&&y){De.start.fromBufferAttribute(A,p),De.end.fromBufferAttribute(l,p),De.start.applyMatrix4(o),De.end.applyMatrix4(o);const C=new a.Vector3,w=new a.Vector3;st.distanceSqToSegment(De.start,De.end,w,C),t.push({point:w,pointOnLine:C,distance:st.origin.distanceTo(w),object:c,face:null,faceIndex:p,uv:null,uv1:null})}}}class FA extends a.Mesh{constructor(e=new qi,t=new rs({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,s=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let o=0,r=0,A=t.count;o<A;o++,r+=2)Xs.fromBufferAttribute(t,o),Zs.fromBufferAttribute(s,o),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Xs.distanceTo(Zs);const i=new a.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new a.InterleavedBufferAttribute(i,1,0)),e.setAttribute("instanceDistanceEnd",new a.InterleavedBufferAttribute(i,1,1)),this}raycast(e,t){const s=this.material.worldUnits,n=e.camera;n===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;st=e.ray;const o=this.matrixWorld,r=this.geometry,A=this.material;Qt=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),hn.copy(r.boundingSphere).applyMatrix4(o);let l;if(s)l=Qt*.5;else{const u=Math.max(n.near,hn.distanceToPoint(st.origin));l=ei(n,u,A.resolution)}if(hn.radius+=l,st.intersectsSphere(hn)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),ln.copy(r.boundingBox).applyMatrix4(o);let h;if(s)h=Qt*.5;else{const u=Math.max(n.near,ln.distanceToPoint(st.origin));h=ei(n,u,A.resolution)}ln.expandByScalar(h),st.intersectsBox(ln)!==!1&&(s?DA(this,t):_A(this,n,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(On),this.material.uniforms.resolution.value.set(On.z,On.w))}}class zi extends qi{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setPositions(s),this}setColors(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setColors(s),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class LA extends FA{constructor(e=new zi,t=new rs({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class kA extends a.Mesh{constructor(e){const t=new NA(e),s=new a.PlaneGeometry(t.image.width*.001,t.image.height*.001),n=new a.MeshBasicMaterial({map:t,toneMapped:!1,transparent:!0});super(s,n);function i(o){n.map.dispatchDOMEvent(o)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){s.dispose(),n.dispose(),n.map.dispose(),$n.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class NA extends a.CanvasTexture{constructor(e){super(ti(e)),this.dom=e,this.anisotropy=16,this.colorSpace=a.SRGBColorSpace,this.minFilter=a.LinearFilter,this.magFilter=a.LinearFilter;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),s={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,s),this.observer=t}dispatchDOMEvent(e){e.data&&GA(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=ti(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const $n=new WeakMap;function ti(c){const e=document.createRange(),t=new a.Color;function s(p){const g=[];let f=!1;function I(){if(f&&(f=!1,p.restore()),g.length===0)return;let b=-1/0,E=-1/0,y=1/0,C=1/0;for(let w=0;w<g.length;w++){const x=g[w];b=Math.max(b,x.x),E=Math.max(E,x.y),y=Math.min(y,x.x+x.width),C=Math.min(C,x.y+x.height)}p.save(),p.beginPath(),p.rect(b,E,y-b,C-E),p.clip(),f=!0}return{add:function(b){g.push(b),I()},remove:function(){g.pop(),I()}}}function n(p,g,f,I){I!==""&&(p.textTransform==="uppercase"&&(I=I.toUpperCase()),h.font=p.fontWeight+" "+p.fontSize+" "+p.fontFamily,h.textBaseline="top",h.fillStyle=p.color,h.fillText(I,g,f+parseFloat(p.fontSize)*.1))}function i(p,g,f,I,b){f<2*b&&(b=f/2),I<2*b&&(b=I/2),h.beginPath(),h.moveTo(p+b,g),h.arcTo(p+f,g,p+f,g+I,b),h.arcTo(p+f,g+I,p,g+I,b),h.arcTo(p,g+I,p,g,b),h.arcTo(p,g,p+f,g,b),h.closePath()}function o(p,g,f,I,b,E){const y=p[g+"Width"],C=p[g+"Style"],w=p[g+"Color"];y!=="0px"&&C!=="none"&&w!=="transparent"&&w!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=w,h.lineWidth=parseFloat(y),h.beginPath(),h.moveTo(f,I),h.lineTo(f+b,I+E),h.stroke())}function r(p,g){if(p.nodeType===Node.COMMENT_NODE||p.nodeName==="SCRIPT"||p.style&&p.style.display==="none")return;let f=0,I=0,b=0,E=0;if(p.nodeType===Node.TEXT_NODE){e.selectNode(p);const C=e.getBoundingClientRect();f=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,n(g,f,I,p.nodeValue.trim())}else if(p instanceof HTMLCanvasElement){const C=p.getBoundingClientRect();f=C.left-A.left-.5,I=C.top-A.top-.5,h.save();const w=window.devicePixelRatio;h.scale(1/w,1/w),h.drawImage(p,f,I),h.restore()}else if(p instanceof HTMLImageElement){const C=p.getBoundingClientRect();f=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,h.drawImage(p,f,I,b,E)}else{const C=p.getBoundingClientRect();f=C.left-A.left-.5,I=C.top-A.top-.5,b=C.width,E=C.height,g=window.getComputedStyle(p),i(f,I,b,E,parseFloat(g.borderRadius));const w=g.backgroundColor;w!=="transparent"&&w!=="rgba(0, 0, 0, 0)"&&(h.fillStyle=w,h.fill());const x=["borderTop","borderLeft","borderBottom","borderRight"];let R=!0,D=null;for(const S of x){if(D!==null&&(R=g[S+"Width"]===g[D+"Width"]&&g[S+"Color"]===g[D+"Color"]&&g[S+"Style"]===g[D+"Style"]),R===!1)break;D=S}if(R===!0){const S=parseFloat(g.borderTopWidth);g.borderTopWidth!=="0px"&&g.borderTopStyle!=="none"&&g.borderTopColor!=="transparent"&&g.borderTopColor!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=g.borderTopColor,h.lineWidth=S,h.stroke())}else o(g,"borderTop",f,I,b,0),o(g,"borderLeft",f,I,0,E),o(g,"borderBottom",f,I+E,b,0),o(g,"borderRight",f+b,I,0,E);if(p instanceof HTMLInputElement){let S=g.accentColor;(S===void 0||S==="auto")&&(S=g.color),t.set(S);const N=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(p.type==="radio"&&(i(f,I,b,E,E),h.fillStyle="white",h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),p.checked&&(i(f+2,I+2,b-4,E-4,E),h.fillStyle=S,h.strokeStyle=N,h.lineWidth=2,h.fill(),h.stroke())),p.type==="checkbox"&&(i(f,I,b,E,2),h.fillStyle=p.checked?S:"white",h.strokeStyle=p.checked?N:S,h.lineWidth=1,h.stroke(),h.fill(),p.checked)){const G=h.textAlign;h.textAlign="center";const O={color:N,fontFamily:g.fontFamily,fontSize:E+"px",fontWeight:"bold"};n(O,f+b/2,I,"✔"),h.textAlign=G}if(p.type==="range"){const[G,O,X]=["min","max","value"].map(q=>parseFloat(p[q])),U=(X-G)/(O-G)*(b-E);i(f,I+E/4,b,E/2,E/4),h.fillStyle=N,h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),i(f,I+E/4,U+E/2,E/2,E/4),h.fillStyle=S,h.fill(),i(f+U,I,E,E,E/2),h.fillStyle=S,h.fill()}(p.type==="color"||p.type==="text"||p.type==="number")&&(u.add({x:f,y:I,width:b,height:E}),n(g,f+parseInt(g.paddingLeft),I+parseInt(g.paddingTop),p.value),u.remove())}}const y=g.overflow==="auto"||g.overflow==="hidden";y&&u.add({x:f,y:I,width:b,height:E});for(let C=0;C<p.childNodes.length;C++)r(p.childNodes[C],g);y&&u.remove()}const A=c.getBoundingClientRect();let l=$n.get(c);l===void 0&&(l=document.createElement("canvas"),l.width=A.width,l.height=A.height,$n.set(c,l));const h=l.getContext("2d"),u=new s(h);return h.clearRect(0,0,l.width,l.height),r(c),l}function GA(c,e,t,s){const n={clientX:t*c.offsetWidth+c.offsetLeft,clientY:s*c.offsetHeight+c.offsetTop,view:c.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,n));const i=c.getBoundingClientRect();t=t*i.width+i.left,s=s*i.height+i.top;function o(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&s>A.top&&s<A.bottom&&(r.dispatchEvent(new MouseEvent(e,n)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[l,h]=["min","max"].map(f=>parseFloat(r[f])),u=A.width,g=(t-A.x)/u;r.value=l+(h-l)*g,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let l=0;l<r.childNodes.length;l++)o(r.childNodes[l])}}o(c)}const dn=new a.Vector2,Dt={type:"",data:dn},ni=new a.Raycaster;class UA extends a.Group{listenToPointerEvents(e,t){const s=this,n=new a.Raycaster,i=e.domElement;function o(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();dn.x=(r.clientX-A.left)/A.width*2-1,dn.y=-(r.clientY-A.top)/A.height*2+1,n.setFromCamera(dn,t);const l=n.intersectObjects(s.children,!1);if(l.length>0){const h=l[0],u=h.object,p=h.uv;Dt.type=r.type,Dt.data.set(p.x,1-p.y),u.dispatchEvent(Dt)}}i.addEventListener("pointerdown",o),i.addEventListener("pointerup",o),i.addEventListener("pointermove",o),i.addEventListener("mousedown",o),i.addEventListener("mouseup",o),i.addEventListener("mousemove",o),i.addEventListener("click",o)}listenToXRControllerEvents(e){const t=this,s={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function n(i){const o=i.target;ni.setFromXRController(o);const r=ni.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],l=A.object,h=A.uv;Dt.type=s[i.type],Dt.data.set(h.x,1-h.y),l.dispatchEvent(Dt)}}e.addEventListener("move",n),e.addEventListener("select",n),e.addEventListener("selectstart",n),e.addEventListener("selectend",n)}}const qt=new a.Vector3,zt=new a.Vector3,si=new a.Matrix3;class PA extends a.LineSegments{constructor(e,t=1,s=16711680){const n=new a.BufferGeometry,i=e.geometry.attributes.normal.count,o=new a.Float32BufferAttribute(i*2*3,3);n.setAttribute("position",o),super(n,new a.LineBasicMaterial({color:s,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),si.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,s=this.object.geometry;if(s){const n=s.attributes.position,i=s.attributes.normal;let o=0;for(let r=0,A=n.count;r<A;r++)qt.fromBufferAttribute(n,r).applyMatrix4(e),zt.fromBufferAttribute(i,r),zt.applyMatrix3(si).normalize().multiplyScalar(this.size).add(qt),t.setXYZ(o,qt.x,qt.y,qt.z),o=o+1,t.setXYZ(o,zt.x,zt.y,zt.z),o=o+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class OA{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new a.OrthographicCamera(-1,1,1,-1,0,1);class HA extends a.BufferGeometry{constructor(){super(),this.setAttribute("position",new a.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new a.Float32BufferAttribute([0,2,0,0,2,0],2))}}new HA;const We={node:"node",material:"material",camera:"camera",light:"light"},yt="KHR_animation_pointer",jA={CUBICSPLINE:void 0,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},ii=a.PropertyBinding.findNode;let oi=!1;class qA{constructor(e){this.parser=e,this.name=yt,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){oi||(oi=!0,a.PropertyBinding.findNode=function(e,t){if(t.startsWith(".materials.")){const s=t.substring(11).substring(t.indexOf(".")),n=s.indexOf("."),i=n<0?s:s.substring(0,n);let o=null;return e.traverse(r=>{o!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(o=r.material,o!==null&&(s.endsWith(".map")?o=o.map:s.endsWith(".emissiveMap")&&(o=o.emissiveMap)))}),o}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const s=t.split(".");let n;for(let i=1;i<s.length;i++){const o=s[i];if(o.length==36)n=e.getObjectByProperty("uuid",o);else if(n&&n[o]){const A=Number.parseInt(o);let l=o;A>=0&&(l=A),n=n[l]}else{const A=e.getObjectByName(o);A&&(n=A)}}if(!n){const i=ii(e,s[2]);return i||console.warn(yt+": Property binding not found",t,e,e.name,s),i}return n}return ii(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,s=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",s)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,s=t.extensions&&t.extensions[yt]&&t.path&&t.path==="pointer";if(!s)return null;let n,i=We.node,o;if(s){const A=t.extensions[yt];let l=A.pointer;if(!l){console.warn("Invalid path",A,t);return}if(l.startsWith("/materials/")?i=We.material:l.startsWith("/extensions/KHR_lights_punctual/lights/")?i=We.light:l.startsWith("/cameras/")&&(i=We.camera),o=this._tryResolveTargetId(l,i),o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,l);return}switch(i){case We.material:const u=("/materials/"+o.toString()+"/").length,p=l.substring(0,u);switch(n=l.substring(u),n){case"pbrMetallicRoughness/baseColorFactor":n="color";break;case"pbrMetallicRoughness/roughnessFactor":n="roughness";break;case"pbrMetallicRoughness/metallicFactor":n="metalness";break;case"emissiveFactor":n="emissive";break;case"alphaCutoff":n="alphaTest";break;case"occlusionTexture/strength":n="aoMapIntensity";break;case"normalTexture/scale":n="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":n="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":n="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":n="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":n="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":n="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":n="transmission";break;case"extensions/KHR_materials_ior/ior":n="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":n="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":n="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":n="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":n="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":n="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":n="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":n="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":n="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":n="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":n="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":n="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":n="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":n="specularColor";break}l=p+n;break;case We.node:const g=("/nodes/"+o.toString()+"/").length,f=l.substring(0,g);switch(n=l.substring(g),n){case"translation":n="position";break;case"rotation":n="quaternion";break;case"scale":n="scale";break;case"weights":n="morphTargetInfluences";break}l=f+n;break;case We.light:const I=("/extensions/KHR_lights_punctual/lights/"+o.toString()+"/").length;switch(n=l.substring(I),n){case"color":break;case"intensity":break;case"spot/innerConeAngle":n="penumbra";break;case"spot/outerConeAngle":n="angle";break;case"range":n="distance";break}l="/lights/"+o.toString()+"/"+n;break;case We.camera:const b=("/cameras/"+o.toString()+"/").length,E=l.substring(0,b);switch(n=l.substring(b),n){case"perspective/yfov":n="fov";break;case"perspective/znear":case"orthographic/znear":n="near";break;case"perspective/zfar":case"orthographic/zfar":n="far";break;case"perspective/aspect":n="aspect";break;case"orthographic/xmag":n="zoom";break;case"orthographic/ymag":n="zoom";break}l=E+n;break}const h=this.animationPointerResolver;h&&h.resolvePath&&(l=h.resolvePath(l)),t.extensions[yt].pointer=l}if(o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,t);return}let r;return i===We.node?r=this.parser.getDependency("node",o):i===We.material?r=this.parser.getDependency("material",o):i===We.light?r=this.parser.getDependency("light",o):i===We.camera?r=this.parser.getDependency("camera",o):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,s,n,i){if(!(i.extensions&&i.extensions[yt]&&i.path&&i.path==="pointer"))return null;let r=i.extensions[yt].pointer;if(!r)return null;const A=[];r=r.replaceAll("/",".");const l=r.split(".");var u=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(l[2]=u,l[3]==="morphTargetInfluences"&&e.type==="Group"){for(const g of e.children)g instanceof a.SkinnedMesh&&g.morphTargetInfluences&&(l[3]=g.name,l[4]="morphTargetInfluences",p(this.parser));return A}p(this.parser);function p(g){r=l.join(".");let f;switch(s.itemSize){case 1:f=a.NumberKeyframeTrack;break;case 2:case 3:f=a.VectorKeyframeTrack;break;case 4:r.endsWith(".quaternion")?f=a.QuaternionKeyframeTrack:f=a.ColorKeyframeTrack;break}const I=n.interpolation!==void 0?jA[n.interpolation]:a.InterpolateLinear;let b=g._getArrayFromAccessor(s);r.endsWith(".fov")&&(b=b.map(y=>y/Math.PI*180));const E=new f(r,t.array,b,I);if(I==="CUBICSPLINE"&&g._createCubicSplineTrackInterpolant(E),A.push(E),r&&s.itemSize===4&&r.startsWith(".materials.")&&r.endsWith(".color")){const y=new Float32Array(b.length/4);for(let w=0,x=b.length/4;w<x;w+=1)y[w]=b[w*4+3];const C=new f(r.replace(".color",".opacity"),t.array,y,I);I==="CUBICSPLINE"&&g._createCubicSplineTrackInterpolant(E),A.push(C)}}return A}_tryResolveTargetId(e,t){let s="";return t==="node"?s=e.substring(7):t==="material"?s=e.substring(11):t==="light"?s=e.substring(39):t==="camera"&&(s=e.substring(9)),s=s.substring(0,s.indexOf("/")),Number.parseInt(s)}loadAnimation(e){const t=this,s=this.parser.json,n=this.parser,i=s.animations[e],o=i.name?i.name:"animation_"+e,r=[],A=[],l=[],h=[],u=[];for(let p=0,g=i.channels.length;p<g;p++){const f=i.channels[p],I=i.samplers[f.sampler],b=f.target,E=i.parameters!==void 0?i.parameters[I.input]:I.input,y=i.parameters!==void 0?i.parameters[I.output]:I.output;let C=t.loadAnimationTargetFromChannelWithAnimationPointer(f);C||(C=t.loadAnimationTargetFromChannel(f)),r.push(C),A.push(n.getDependency("accessor",E)),l.push(n.getDependency("accessor",y)),h.push(I),u.push(b)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(l),Promise.all(h),Promise.all(u)]).then(function(p){const g=p[0],f=p[1],I=p[2],b=p[3],E=p[4],y=[];for(let C=0,w=g.length;C<w;C++){const x=g[C],R=f[C],D=I[C],S=b[C],v=E[C];if(x===void 0)continue;x.updateMatrix&&(x.updateMatrix(),x.matrixAutoUpdate=!0);let N=t.createAnimationTracksWithAnimationPointer(x,R,D,S,v);if(N||(N=n._createAnimationTracks(x,R,D,S,v)),N)for(let G=0;G<N.length;G++)y.push(N[G])}return new a.AnimationClip(o,void 0,y)})}}const zA=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:qA},Symbol.toStringTag,{value:"Module"}));exports.DRACOLoader=hr;exports.EXRLoader=Li;exports.EXRLoader$1=ta;exports.FBXLoader=ha;exports.Font=Qi;exports.FontLoader=xr;exports.GLTFExporter=os;exports.GLTFLoader=es;exports.GLTFLoaderAnimationPointer=zA;exports.GroundedSkybox=Qo;exports.HTMLMesh=kA;exports.HorizontalBlurShader=Ya;exports.InteractiveGroup=UA;exports.KTX2Loader=it;exports.Line2=LA;exports.LineGeometry=zi;exports.LineMaterial=rs;exports.MeshoptDecoder=lr;exports.OBJLoader=Ma;exports.OrbitControls=_a;exports.Pass=OA;exports.PositionalAudioHelper=Ka;exports.RGBELoader=ki;exports.RGBELoader$1=na;exports.Stats=Wt;exports.TextGeometry=Qr;exports.TransformControls=vr;exports.TransformControlsGizmo=xi;exports.VertexNormalsHelper=PA;exports.VerticalBlurShader=Va;exports.XRControllerModelFactory=vA;exports.XRHandMeshModel=RA;exports.mergeVertices=vo;exports.nodeFrame=Ue;exports.strToU8=Xn;exports.zipSync=ea;
501
+ `};class as extends a.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:a.UniformsUtils.clone(a.ShaderLib.line.uniforms),vertexShader:a.ShaderLib.line.vertexShader,fragmentShader:a.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const On=new a.Vector4,Zs=new a.Vector3,$s=new a.Vector3,ve=new a.Vector4,Me=new a.Vector4,nt=new a.Vector4,Hn=new a.Vector3,jn=new a.Matrix4,_e=new a.Line3,ei=new a.Vector3,hn=new a.Box3,un=new a.Sphere,st=new a.Vector4;let it,Qt;function ti(c,e,t){return st.set(0,0,-e,1).applyMatrix4(c.projectionMatrix),st.multiplyScalar(1/st.w),st.x=Qt/t.width,st.y=Qt/t.height,st.applyMatrix4(c.projectionMatrixInverse),st.multiplyScalar(1/st.w),Math.abs(Math.max(st.x,st.y))}function JA(c,e){const t=c.matrixWorld,s=c.geometry,n=s.attributes.instanceStart,i=s.attributes.instanceEnd,o=Math.min(s.instanceCount,n.count);for(let r=0,A=o;r<A;r++){_e.start.fromBufferAttribute(n,r),_e.end.fromBufferAttribute(i,r),_e.applyMatrix4(t);const l=new a.Vector3,h=new a.Vector3;it.distanceSqToSegment(_e.start,_e.end,h,l),h.distanceTo(l)<Qt*.5&&e.push({point:h,pointOnLine:l,distance:it.origin.distanceTo(h),object:c,face:null,faceIndex:r,uv:null,uv1:null})}}function WA(c,e,t){const s=e.projectionMatrix,i=c.material.resolution,o=c.matrixWorld,r=c.geometry,A=r.attributes.instanceStart,l=r.attributes.instanceEnd,h=Math.min(r.instanceCount,A.count),u=-e.near;it.at(1,nt),nt.w=1,nt.applyMatrix4(e.matrixWorldInverse),nt.applyMatrix4(s),nt.multiplyScalar(1/nt.w),nt.x*=i.x/2,nt.y*=i.y/2,nt.z=0,Hn.copy(nt),jn.multiplyMatrices(e.matrixWorldInverse,o);for(let d=0,g=h;d<g;d++){if(ve.fromBufferAttribute(A,d),Me.fromBufferAttribute(l,d),ve.w=1,Me.w=1,ve.applyMatrix4(jn),Me.applyMatrix4(jn),ve.z>u&&Me.z>u)continue;if(ve.z>u){const E=ve.z-Me.z,y=(ve.z-u)/E;ve.lerp(Me,y)}else if(Me.z>u){const E=Me.z-ve.z,y=(Me.z-u)/E;Me.lerp(ve,y)}ve.applyMatrix4(s),Me.applyMatrix4(s),ve.multiplyScalar(1/ve.w),Me.multiplyScalar(1/Me.w),ve.x*=i.x/2,ve.y*=i.y/2,Me.x*=i.x/2,Me.y*=i.y/2,_e.start.copy(ve),_e.start.z=0,_e.end.copy(Me),_e.end.z=0;const I=_e.closestPointToPointParameter(Hn,!0);_e.at(I,ei);const b=a.MathUtils.lerp(ve.z,Me.z,I),C=b>=-1&&b<=1,w=Hn.distanceTo(ei)<Qt*.5;if(C&&w){_e.start.fromBufferAttribute(A,d),_e.end.fromBufferAttribute(l,d),_e.start.applyMatrix4(o),_e.end.applyMatrix4(o);const E=new a.Vector3,y=new a.Vector3;it.distanceSqToSegment(_e.start,_e.end,y,E),t.push({point:y,pointOnLine:E,distance:it.origin.distanceTo(y),object:c,face:null,faceIndex:d,uv:null,uv1:null})}}}class XA extends a.Mesh{constructor(e=new Vi,t=new as({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,s=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let o=0,r=0,A=t.count;o<A;o++,r+=2)Zs.fromBufferAttribute(t,o),$s.fromBufferAttribute(s,o),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+Zs.distanceTo($s);const i=new a.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new a.InterleavedBufferAttribute(i,1,0)),e.setAttribute("instanceDistanceEnd",new a.InterleavedBufferAttribute(i,1,1)),this}raycast(e,t){const s=this.material.worldUnits,n=e.camera;n===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const i=e.params.Line2!==void 0&&e.params.Line2.threshold||0;it=e.ray;const o=this.matrixWorld,r=this.geometry,A=this.material;Qt=A.linewidth+i,r.boundingSphere===null&&r.computeBoundingSphere(),un.copy(r.boundingSphere).applyMatrix4(o);let l;if(s)l=Qt*.5;else{const u=Math.max(n.near,un.distanceToPoint(it.origin));l=ti(n,u,A.resolution)}if(un.radius+=l,it.intersectsSphere(un)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),hn.copy(r.boundingBox).applyMatrix4(o);let h;if(s)h=Qt*.5;else{const u=Math.max(n.near,hn.distanceToPoint(it.origin));h=ti(n,u,A.resolution)}hn.expandByScalar(h),it.intersectsBox(hn)!==!1&&(s?JA(this,t):WA(this,n,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(On),this.material.uniforms.resolution.value.set(On.z,On.w))}}class Ji extends Vi{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setPositions(s),this}setColors(e){const t=e.length-3,s=new Float32Array(2*t);for(let n=0;n<t;n+=3)s[2*n]=e[n],s[2*n+1]=e[n+1],s[2*n+2]=e[n+2],s[2*n+3]=e[n+3],s[2*n+4]=e[n+4],s[2*n+5]=e[n+5];return super.setColors(s),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class ZA extends XA{constructor(e=new Ji,t=new as({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class $A extends a.Mesh{constructor(e){const t=new ec(e),s=new a.PlaneGeometry(t.image.width*.001,t.image.height*.001),n=new a.MeshBasicMaterial({map:t,toneMapped:!1,transparent:!0});super(s,n);function i(o){n.map.dispatchDOMEvent(o)}this.addEventListener("mousedown",i),this.addEventListener("mousemove",i),this.addEventListener("mouseup",i),this.addEventListener("click",i),this.dispose=function(){s.dispose(),n.dispose(),n.map.dispose(),$n.delete(e),this.removeEventListener("mousedown",i),this.removeEventListener("mousemove",i),this.removeEventListener("mouseup",i),this.removeEventListener("click",i)}}}class ec extends a.CanvasTexture{constructor(e){super(ni(e)),this.dom=e,this.anisotropy=16,this.colorSpace=a.SRGBColorSpace,this.minFilter=a.LinearFilter,this.magFilter=a.LinearFilter;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),s={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,s),this.observer=t}dispatchDOMEvent(e){e.data&&tc(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=ni(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const $n=new WeakMap;function ni(c){const e=document.createRange(),t=new a.Color;function s(d){const g=[];let f=!1;function I(){if(f&&(f=!1,d.restore()),g.length===0)return;let b=-1/0,C=-1/0,w=1/0,E=1/0;for(let y=0;y<g.length;y++){const Q=g[y];b=Math.max(b,Q.x),C=Math.max(C,Q.y),w=Math.min(w,Q.x+Q.width),E=Math.min(E,Q.y+Q.height)}d.save(),d.beginPath(),d.rect(b,C,w-b,E-C),d.clip(),f=!0}return{add:function(b){g.push(b),I()},remove:function(){g.pop(),I()}}}function n(d,g,f,I){I!==""&&(d.textTransform==="uppercase"&&(I=I.toUpperCase()),h.font=d.fontWeight+" "+d.fontSize+" "+d.fontFamily,h.textBaseline="top",h.fillStyle=d.color,h.fillText(I,g,f+parseFloat(d.fontSize)*.1))}function i(d,g,f,I,b){f<2*b&&(b=f/2),I<2*b&&(b=I/2),h.beginPath(),h.moveTo(d+b,g),h.arcTo(d+f,g,d+f,g+I,b),h.arcTo(d+f,g+I,d,g+I,b),h.arcTo(d,g+I,d,g,b),h.arcTo(d,g,d+f,g,b),h.closePath()}function o(d,g,f,I,b,C){const w=d[g+"Width"],E=d[g+"Style"],y=d[g+"Color"];w!=="0px"&&E!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=y,h.lineWidth=parseFloat(w),h.beginPath(),h.moveTo(f,I),h.lineTo(f+b,I+C),h.stroke())}function r(d,g){if(d.nodeType===Node.COMMENT_NODE||d.nodeName==="SCRIPT"||d.style&&d.style.display==="none")return;let f=0,I=0,b=0,C=0;if(d.nodeType===Node.TEXT_NODE){e.selectNode(d);const E=e.getBoundingClientRect();f=E.left-A.left-.5,I=E.top-A.top-.5,b=E.width,C=E.height,n(g,f,I,d.nodeValue.trim())}else if(d instanceof HTMLCanvasElement){const E=d.getBoundingClientRect();f=E.left-A.left-.5,I=E.top-A.top-.5,h.save();const y=window.devicePixelRatio;h.scale(1/y,1/y),h.drawImage(d,f,I),h.restore()}else if(d instanceof HTMLImageElement){const E=d.getBoundingClientRect();f=E.left-A.left-.5,I=E.top-A.top-.5,b=E.width,C=E.height,h.drawImage(d,f,I,b,C)}else{const E=d.getBoundingClientRect();f=E.left-A.left-.5,I=E.top-A.top-.5,b=E.width,C=E.height,g=window.getComputedStyle(d),i(f,I,b,C,parseFloat(g.borderRadius));const y=g.backgroundColor;y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(h.fillStyle=y,h.fill());const Q=["borderTop","borderLeft","borderBottom","borderRight"];let R=!0,_=null;for(const S of Q){if(_!==null&&(R=g[S+"Width"]===g[_+"Width"]&&g[S+"Color"]===g[_+"Color"]&&g[S+"Style"]===g[_+"Style"]),R===!1)break;_=S}if(R===!0){const S=parseFloat(g.borderTopWidth);g.borderTopWidth!=="0px"&&g.borderTopStyle!=="none"&&g.borderTopColor!=="transparent"&&g.borderTopColor!=="rgba(0, 0, 0, 0)"&&(h.strokeStyle=g.borderTopColor,h.lineWidth=S,h.stroke())}else o(g,"borderTop",f,I,b,0),o(g,"borderLeft",f,I,0,C),o(g,"borderBottom",f,I+C,b,0),o(g,"borderRight",f+b,I,0,C);if(d instanceof HTMLInputElement){let S=g.accentColor;(S===void 0||S==="auto")&&(S=g.color),t.set(S);const G=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(d.type==="radio"&&(i(f,I,b,C,C),h.fillStyle="white",h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),d.checked&&(i(f+2,I+2,b-4,C-4,C),h.fillStyle=S,h.strokeStyle=G,h.lineWidth=2,h.fill(),h.stroke())),d.type==="checkbox"&&(i(f,I,b,C,2),h.fillStyle=d.checked?S:"white",h.strokeStyle=d.checked?G:S,h.lineWidth=1,h.stroke(),h.fill(),d.checked)){const N=h.textAlign;h.textAlign="center";const H={color:G,fontFamily:g.fontFamily,fontSize:C+"px",fontWeight:"bold"};n(H,f+b/2,I,"✔"),h.textAlign=N}if(d.type==="range"){const[N,H,X]=["min","max","value"].map(K=>parseFloat(d[K])),U=(X-N)/(H-N)*(b-C);i(f,I+C/4,b,C/2,C/4),h.fillStyle=G,h.strokeStyle=S,h.lineWidth=1,h.fill(),h.stroke(),i(f,I+C/4,U+C/2,C/2,C/4),h.fillStyle=S,h.fill(),i(f+U,I,C,C,C/2),h.fillStyle=S,h.fill()}(d.type==="color"||d.type==="text"||d.type==="number")&&(u.add({x:f,y:I,width:b,height:C}),n(g,f+parseInt(g.paddingLeft),I+parseInt(g.paddingTop),d.value),u.remove())}}const w=g.overflow==="auto"||g.overflow==="hidden";w&&u.add({x:f,y:I,width:b,height:C});for(let E=0;E<d.childNodes.length;E++)r(d.childNodes[E],g);w&&u.remove()}const A=c.getBoundingClientRect();let l=$n.get(c);l===void 0&&(l=document.createElement("canvas"),l.width=A.width,l.height=A.height,$n.set(c,l));const h=l.getContext("2d"),u=new s(h);return h.clearRect(0,0,l.width,l.height),r(c),l}function tc(c,e,t,s){const n={clientX:t*c.offsetWidth+c.offsetLeft,clientY:s*c.offsetHeight+c.offsetTop,view:c.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,n));const i=c.getBoundingClientRect();t=t*i.width+i.left,s=s*i.height+i.top;function o(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&s>A.top&&s<A.bottom&&(r.dispatchEvent(new MouseEvent(e,n)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[l,h]=["min","max"].map(f=>parseFloat(r[f])),u=A.width,g=(t-A.x)/u;r.value=l+(h-l)*g,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let l=0;l<r.childNodes.length;l++)o(r.childNodes[l])}}o(c)}const pn=new a.Vector2,_t={type:"",data:pn},si=new a.Raycaster;class nc extends a.Group{listenToPointerEvents(e,t){const s=this,n=new a.Raycaster,i=e.domElement;function o(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();pn.x=(r.clientX-A.left)/A.width*2-1,pn.y=-(r.clientY-A.top)/A.height*2+1,n.setFromCamera(pn,t);const l=n.intersectObjects(s.children,!1);if(l.length>0){const h=l[0],u=h.object,d=h.uv;_t.type=r.type,_t.data.set(d.x,1-d.y),u.dispatchEvent(_t)}}i.addEventListener("pointerdown",o),i.addEventListener("pointerup",o),i.addEventListener("pointermove",o),i.addEventListener("mousedown",o),i.addEventListener("mouseup",o),i.addEventListener("mousemove",o),i.addEventListener("click",o)}listenToXRControllerEvents(e){const t=this,s={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function n(i){const o=i.target;si.setFromXRController(o);const r=si.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],l=A.object,h=A.uv;_t.type=s[i.type],_t.data.set(h.x,1-h.y),l.dispatchEvent(_t)}}e.addEventListener("move",n),e.addEventListener("select",n),e.addEventListener("selectstart",n),e.addEventListener("selectend",n)}}const zt=new a.Vector3,Kt=new a.Vector3,ii=new a.Matrix3;class sc extends a.LineSegments{constructor(e,t=1,s=16711680){const n=new a.BufferGeometry,i=e.geometry.attributes.normal.count,o=new a.Float32BufferAttribute(i*2*3,3);n.setAttribute("position",o),super(n,new a.LineBasicMaterial({color:s,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),ii.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,s=this.object.geometry;if(s){const n=s.attributes.position,i=s.attributes.normal;let o=0;for(let r=0,A=n.count;r<A;r++)zt.fromBufferAttribute(n,r).applyMatrix4(e),Kt.fromBufferAttribute(i,r),Kt.applyMatrix3(ii).normalize().multiplyScalar(this.size).add(zt),t.setXYZ(o,zt.x,zt.y,zt.z),o=o+1,t.setXYZ(o,Kt.x,Kt.y,Kt.z),o=o+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class ic{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}new a.OrthographicCamera(-1,1,1,-1,0,1);class oc extends a.BufferGeometry{constructor(){super(),this.setAttribute("position",new a.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new a.Float32BufferAttribute([0,2,0,0,2,0],2))}}new oc;const We={node:"node",material:"material",camera:"camera",light:"light"},yt="KHR_animation_pointer",rc={CUBICSPLINE:void 0,LINEAR:a.InterpolateLinear,STEP:a.InterpolateDiscrete},oi=a.PropertyBinding.findNode;let ri=!1;class ac{constructor(e){this.parser=e,this.name=yt,this.animationPointerResolver=null}setAnimationPointerResolver(e){return this.animationPointerResolver=e,this}_patchPropertyBindingFindNode(){ri||(ri=!0,a.PropertyBinding.findNode=function(e,t){if(t.startsWith(".materials.")){const s=t.substring(11).substring(t.indexOf(".")),n=s.indexOf("."),i=n<0?s:s.substring(0,n);let o=null;return e.traverse(r=>{o!==null||r.type!=="Mesh"&&r.type!=="SkinnedMesh"||r.material&&(r.material.uuid===i||r.material.name===i)&&(o=r.material,o!==null&&(s.endsWith(".map")?o=o.map:s.endsWith(".emissiveMap")&&(o=o.emissiveMap)))}),o}else if(t.startsWith(".nodes.")||t.startsWith(".lights.")||t.startsWith(".cameras.")){const s=t.split(".");let n;for(let i=1;i<s.length;i++){const o=s[i];if(o.length==36)n=e.getObjectByProperty("uuid",o);else if(n&&n[o]){const A=Number.parseInt(o);let l=o;A>=0&&(l=A),n=n[l]}else{const A=e.getObjectByName(o);A&&(n=A)}}if(!n){const i=oi(e,s[2]);return i||console.warn(yt+": Property binding not found",t,e,e.name,s),i}return n}return oi(e,t)})}loadAnimationTargetFromChannel(e){const t=e.target,s=t.node!==void 0?t.node:t.id;return this.parser.getDependency("node",s)}loadAnimationTargetFromChannelWithAnimationPointer(e){this._havePatchedPropertyBindings||this._patchPropertyBindingFindNode();const t=e.target,s=t.extensions&&t.extensions[yt]&&t.path&&t.path==="pointer";if(!s)return null;let n,i=We.node,o;if(s){const A=t.extensions[yt];let l=A.pointer;if(!l){console.warn("Invalid path",A,t);return}if(l.startsWith("/materials/")?i=We.material:l.startsWith("/extensions/KHR_lights_punctual/lights/")?i=We.light:l.startsWith("/cameras/")&&(i=We.camera),o=this._tryResolveTargetId(l,i),o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,l);return}switch(i){case We.material:const u=("/materials/"+o.toString()+"/").length,d=l.substring(0,u);switch(n=l.substring(u),n){case"pbrMetallicRoughness/baseColorFactor":n="color";break;case"pbrMetallicRoughness/roughnessFactor":n="roughness";break;case"pbrMetallicRoughness/metallicFactor":n="metalness";break;case"emissiveFactor":n="emissive";break;case"alphaCutoff":n="alphaTest";break;case"occlusionTexture/strength":n="aoMapIntensity";break;case"normalTexture/scale":n="normalScale";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale":n="map/repeat";break;case"pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset":n="map/offset";break;case"emissiveTexture/extensions/KHR_texture_transform/scale":n="emissiveMap/repeat";break;case"emissiveTexture/extensions/KHR_texture_transform/offset":n="emissiveMap/offset";break;case"extensions/KHR_materials_emissive_strength/emissiveStrength":n="emissiveIntensity";break;case"extensions/KHR_materials_transmission/transmissionFactor":n="transmission";break;case"extensions/KHR_materials_ior/ior":n="ior";break;case"extensions/KHR_materials_volume/thicknessFactor":n="thickness";break;case"extensions/KHR_materials_volume/attenuationColor":n="attenuationColor";break;case"extensions/KHR_materials_volume/attenuationDistance":n="attenuationDistance";break;case"extensions/KHR_materials_iridescence/iridescenceFactor":n="iridescence";break;case"extensions/KHR_materials_iridescence/iridescenceIor":n="iridescenceIOR";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMinimum":n="iridescenceThicknessRange[0]";break;case"extensions/KHR_materials_iridescence/iridescenceThicknessMaximum":n="iridescenceThicknessRange[1]";break;case"extensions/KHR_materials_clearcoat/clearcoatFactor":n="clearcoat";break;case"extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor":n="clearcoatRoughness";break;case"extensions/KHR_materials_sheen/sheenColorFactor":n="sheenColor";break;case"extensions/KHR_materials_sheen/sheenRoughnessFactor":n="sheenRoughness";break;case"extensions/KHR_materials_specular/specularFactor":n="specularIntensity";break;case"extensions/KHR_materials_specular/specularColorFactor":n="specularColor";break}l=d+n;break;case We.node:const g=("/nodes/"+o.toString()+"/").length,f=l.substring(0,g);switch(n=l.substring(g),n){case"translation":n="position";break;case"rotation":n="quaternion";break;case"scale":n="scale";break;case"weights":n="morphTargetInfluences";break}l=f+n;break;case We.light:const I=("/extensions/KHR_lights_punctual/lights/"+o.toString()+"/").length;switch(n=l.substring(I),n){case"color":break;case"intensity":break;case"spot/innerConeAngle":n="penumbra";break;case"spot/outerConeAngle":n="angle";break;case"range":n="distance";break}l="/lights/"+o.toString()+"/"+n;break;case We.camera:const b=("/cameras/"+o.toString()+"/").length,C=l.substring(0,b);switch(n=l.substring(b),n){case"perspective/yfov":n="fov";break;case"perspective/znear":case"orthographic/znear":n="near";break;case"perspective/zfar":case"orthographic/zfar":n="far";break;case"perspective/aspect":n="aspect";break;case"orthographic/xmag":n="zoom";break;case"orthographic/ymag":n="zoom";break}l=C+n;break}const h=this.animationPointerResolver;h&&h.resolvePath&&(l=h.resolvePath(l)),t.extensions[yt].pointer=l}if(o===null||isNaN(o)){console.warn("Failed resolving animation node id: "+o,t);return}let r;return i===We.node?r=this.parser.getDependency("node",o):i===We.material?r=this.parser.getDependency("material",o):i===We.light?r=this.parser.getDependency("light",o):i===We.camera?r=this.parser.getDependency("camera",o):console.error("Unhandled type",i),r}createAnimationTracksWithAnimationPointer(e,t,s,n,i){if(!(i.extensions&&i.extensions[yt]&&i.path&&i.path==="pointer"))return null;let r=i.extensions[yt].pointer;if(!r)return null;const A=[];r=r.replaceAll("/",".");const l=r.split(".");var u=e.name!==void 0&&e.name!==null?e.name:e.uuid;if(l[2]=u,l[3]==="morphTargetInfluences"&&e.type==="Group"){for(const g of e.children)g instanceof a.SkinnedMesh&&g.morphTargetInfluences&&(l[3]=g.name,l[4]="morphTargetInfluences",d(this.parser));return A}d(this.parser);function d(g){r=l.join(".");let f;switch(s.itemSize){case 1:f=a.NumberKeyframeTrack;break;case 2:case 3:f=a.VectorKeyframeTrack;break;case 4:r.endsWith(".quaternion")?f=a.QuaternionKeyframeTrack:f=a.ColorKeyframeTrack;break}const I=n.interpolation!==void 0?rc[n.interpolation]:a.InterpolateLinear;let b=g._getArrayFromAccessor(s);r.endsWith(".fov")&&(b=b.map(w=>w/Math.PI*180));const C=new f(r,t.array,b,I);if(I==="CUBICSPLINE"&&g._createCubicSplineTrackInterpolant(C),A.push(C),r&&s.itemSize===4&&r.startsWith(".materials.")&&r.endsWith(".color")){const w=new Float32Array(b.length/4);for(let y=0,Q=b.length/4;y<Q;y+=1)w[y]=b[y*4+3];const E=new f(r.replace(".color",".opacity"),t.array,w,I);I==="CUBICSPLINE"&&g._createCubicSplineTrackInterpolant(C),A.push(E)}}return A}_tryResolveTargetId(e,t){let s="";return t==="node"?s=e.substring(7):t==="material"?s=e.substring(11):t==="light"?s=e.substring(39):t==="camera"&&(s=e.substring(9)),s=s.substring(0,s.indexOf("/")),Number.parseInt(s)}loadAnimation(e){const t=this,s=this.parser.json,n=this.parser,i=s.animations[e],o=i.name?i.name:"animation_"+e,r=[],A=[],l=[],h=[],u=[];for(let d=0,g=i.channels.length;d<g;d++){const f=i.channels[d],I=i.samplers[f.sampler],b=f.target,C=i.parameters!==void 0?i.parameters[I.input]:I.input,w=i.parameters!==void 0?i.parameters[I.output]:I.output;let E=t.loadAnimationTargetFromChannelWithAnimationPointer(f);E||(E=t.loadAnimationTargetFromChannel(f)),r.push(E),A.push(n.getDependency("accessor",C)),l.push(n.getDependency("accessor",w)),h.push(I),u.push(b)}return Promise.all([Promise.all(r),Promise.all(A),Promise.all(l),Promise.all(h),Promise.all(u)]).then(function(d){const g=d[0],f=d[1],I=d[2],b=d[3],C=d[4],w=[];for(let E=0,y=g.length;E<y;E++){const Q=g[E],R=f[E],_=I[E],S=b[E],v=C[E];if(Q===void 0)continue;Q.updateMatrix&&(Q.updateMatrix(),Q.matrixAutoUpdate=!0);let G=t.createAnimationTracksWithAnimationPointer(Q,R,_,S,v);if(G||(G=n._createAnimationTracks(Q,R,_,S,v)),G)for(let N=0;N<G.length;N++)w.push(G[N])}return new a.AnimationClip(o,void 0,w)})}}const Ac=Object.freeze(Object.defineProperty({__proto__:null,GLTFAnimationPointerExtension:ac},Symbol.toStringTag,{value:"Module"}));exports.DRACOLoader=gr;exports.EXRLoader=Ui;exports.EXRLoader$1=Ia;exports.FBXLoader=Ta;exports.Font=vi;exports.FontLoader=jr;exports.GLTFExporter=rs;exports.GLTFLoader=es;exports.GLTFLoaderAnimationPointer=Ac;exports.GroundedSkybox=vo;exports.HTMLMesh=$A;exports.HorizontalBlurShader=lA;exports.InteractiveGroup=nc;exports.KTX2Loader=Ze;exports.Line2=ZA;exports.LineGeometry=Ji;exports.LineMaterial=as;exports.MeshoptDecoder=pr;exports.OBJLoader=Ya;exports.OrbitControls=Wa;exports.Pass=ic;exports.PositionalAudioHelper=cA;exports.RGBELoader=Pi;exports.RGBELoader$1=ba;exports.Stats=Xt;exports.TextGeometry=Hr;exports.TransformControls=Kr;exports.TransformControlsGizmo=Mi;exports.VertexNormalsHelper=sc;exports.VerticalBlurShader=hA;exports.XRControllerModelFactory=KA;exports.XRHandMeshModel=VA;exports.mergeVertices=Do;exports.nodeFrame=Ue;exports.strToU8=Xn;exports.zipSync=ma;