@needle-tools/engine 5.1.0-alpha.1 → 5.1.0-canary.0d9f44e
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.
- package/.needle/generated/needle-bindings.gen.d.ts +5 -0
- package/components.needle.json +1 -1
- package/dist/{gltf-progressive-DJBMx-zB.umd.cjs → gltf-progressive-BmblPzFj.umd.cjs} +4 -4
- package/dist/{gltf-progressive-BryRjllq.min.js → gltf-progressive-CN_mbb66.min.js} +2 -2
- package/dist/{gltf-progressive-Cl167Vjx.js → gltf-progressive-DUlhxdv4.js} +5 -2
- package/dist/{needle-engine.bundle-BGyKqxBH.js → needle-engine.bundle-B35n_IHX.js} +8736 -8500
- package/dist/{needle-engine.bundle-DzVx9Z8D.umd.cjs → needle-engine.bundle-CDj15wRB.umd.cjs} +164 -164
- package/dist/{needle-engine.bundle-CiYtOO2O.min.js → needle-engine.bundle-D5zzggEG.min.js} +164 -164
- package/dist/needle-engine.d.ts +140 -22
- package/dist/needle-engine.js +172 -170
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-B_9sKVU7.min.js → postprocessing-B571qGWR.min.js} +34 -34
- package/dist/{postprocessing-WDc9WwI3.js → postprocessing-CfrLAbLX.js} +0 -1
- package/dist/{postprocessing-B2wb6pzI.umd.cjs → postprocessing-CiGkAeM9.umd.cjs} +17 -17
- package/dist/three-examples.js +4289 -3778
- package/dist/three-examples.min.js +301 -14
- package/dist/three-examples.umd.cjs +301 -14
- package/dist/{vendor-CAcsI0eU.js → vendor-BFrMaK9q.js} +8983 -9136
- package/dist/vendor-CJmyOrCq.min.js +1116 -0
- package/dist/vendor-DkMW3WY4.umd.cjs +1116 -0
- package/lib/engine/api.d.ts +12 -0
- package/lib/engine/api.js +2 -0
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/debug/debug_environment.js +1 -1
- package/lib/engine/debug/debug_environment.js.map +1 -1
- package/lib/engine/engine_application.js +8 -6
- package/lib/engine/engine_application.js.map +1 -1
- package/lib/engine/engine_constants.js +6 -0
- package/lib/engine/engine_constants.js.map +1 -1
- package/lib/engine/engine_context.d.ts +31 -2
- package/lib/engine/engine_context.js +43 -2
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_context_registry.js +1 -1
- package/lib/engine/engine_context_registry.js.map +1 -1
- package/lib/engine/engine_init.js +5 -0
- package/lib/engine/engine_init.js.map +1 -1
- package/lib/engine/engine_input.d.ts +3 -2
- package/lib/engine/engine_input.js +3 -2
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_license.d.ts +2 -0
- package/lib/engine/engine_license.js +25 -15
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_lifecycle_functions_internal.js +5 -0
- package/lib/engine/engine_lifecycle_functions_internal.js.map +1 -1
- package/lib/engine/engine_networking_blob.d.ts +1 -1
- package/lib/engine/engine_networking_blob.js +5 -11
- package/lib/engine/engine_networking_blob.js.map +1 -1
- package/lib/engine/engine_physics_rapier.js +0 -1
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/engine_pmrem.js +2 -2
- package/lib/engine/engine_pmrem.js.map +1 -1
- package/lib/engine/engine_scenedata.d.ts +34 -0
- package/lib/engine/engine_scenedata.js +135 -0
- package/lib/engine/engine_scenedata.js.map +1 -0
- package/lib/engine/engine_ssr.d.ts +18 -0
- package/lib/engine/engine_ssr.js +40 -0
- package/lib/engine/engine_ssr.js.map +1 -0
- package/lib/engine/engine_three_utils.d.ts +14 -7
- package/lib/engine/engine_three_utils.js +14 -7
- package/lib/engine/engine_three_utils.js.map +1 -1
- package/lib/engine/engine_types.d.ts +2 -0
- package/lib/engine/engine_types.js.map +1 -1
- package/lib/engine/engine_utils.js +2 -0
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/engine_utils_hash.d.ts +9 -0
- package/lib/engine/engine_utils_hash.js +112 -0
- package/lib/engine/engine_utils_hash.js.map +1 -0
- package/lib/engine/webcomponents/logo-element.d.ts +10 -1
- package/lib/engine/webcomponents/logo-element.js +2 -1
- package/lib/engine/webcomponents/logo-element.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.d.ts +12 -4
- package/lib/engine/webcomponents/needle menu/needle-menu.js +2 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-button.d.ts +15 -1
- package/lib/engine/webcomponents/needle-button.js +2 -1
- package/lib/engine/webcomponents/needle-button.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.d.ts +7 -1
- package/lib/engine/webcomponents/needle-engine.js +2 -1
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.js +1 -1
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine-components/Light.d.ts +25 -8
- package/lib/engine-components/Light.js +132 -27
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/RigidBody.js +3 -3
- package/lib/engine-components/RigidBody.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.js +2 -0
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/BloomEffect.d.ts +1 -1
- package/lib/engine-components/postprocessing/Effects/Sharpening.js +1 -2
- package/lib/engine-components/postprocessing/Effects/Sharpening.js.map +1 -1
- package/lib/engine-components/postprocessing/PostProcessingHandler.js +5 -6
- package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
- package/lib/engine-components/web/ScrollFollow.d.ts +0 -1
- package/lib/engine-components/web/ScrollFollow.js +3 -2
- package/lib/engine-components/web/ScrollFollow.js.map +1 -1
- package/lib/needle-engine.d.ts +1 -0
- package/lib/needle-engine.js +1 -0
- package/lib/needle-engine.js.map +1 -1
- package/package.json +7 -5
- package/plugins/dts-generator/dts.codegen.js +334 -0
- package/plugins/dts-generator/dts.scan.js +99 -0
- package/plugins/dts-generator/dts.writer.js +59 -0
- package/plugins/dts-generator/glb.discovery.js +279 -0
- package/plugins/dts-generator/glb.extractor.js +215 -0
- package/plugins/dts-generator/glb.reader.js +167 -0
- package/plugins/dts-generator/index.js +36 -0
- package/plugins/dts-generator/manifest.types.js +174 -0
- package/plugins/types/index.d.ts +2 -1
- package/plugins/types/needle-bindings.d.ts +30 -0
- package/plugins/types/userconfig.d.ts +21 -2
- package/plugins/vite/asap.js +1 -1
- package/plugins/vite/dependency-watcher.d.ts +2 -2
- package/plugins/vite/dependency-watcher.js +3 -4
- package/plugins/vite/drop.d.ts +2 -2
- package/plugins/vite/drop.js +3 -4
- package/plugins/vite/dts-generator.d.ts +7 -0
- package/plugins/vite/dts-generator.js +191 -0
- package/plugins/vite/index.d.ts +10 -3
- package/plugins/vite/index.js +27 -10
- package/plugins/vite/logging.js +2 -2
- package/plugins/vite/meta.js +4 -2
- package/plugins/vite/poster.d.ts +2 -2
- package/plugins/vite/poster.js +3 -5
- package/plugins/vite/reload.d.ts +2 -2
- package/plugins/vite/reload.js +5 -5
- package/src/engine/api.ts +15 -1
- package/src/engine/debug/debug_environment.ts +1 -1
- package/src/engine/engine_application.ts +8 -6
- package/src/engine/engine_constants.ts +11 -6
- package/src/engine/engine_context.ts +47 -2
- package/src/engine/engine_context_registry.ts +1 -1
- package/src/engine/engine_init.ts +4 -0
- package/src/engine/engine_input.ts +3 -2
- package/src/engine/engine_license.ts +23 -19
- package/src/engine/engine_lifecycle_functions_internal.ts +7 -0
- package/src/engine/engine_networking_blob.ts +5 -11
- package/src/engine/engine_physics_rapier.ts +0 -3
- package/src/engine/engine_pmrem.ts +3 -3
- package/src/engine/engine_scenedata.ts +133 -0
- package/src/engine/engine_ssr.ts +48 -0
- package/src/engine/engine_three_utils.ts +15 -7
- package/src/engine/engine_types.ts +2 -0
- package/src/engine/engine_utils.ts +1 -0
- package/src/engine/engine_utils_hash.ts +65 -0
- package/src/engine/webcomponents/logo-element.ts +10 -1
- package/src/engine/webcomponents/needle menu/needle-menu.ts +11 -2
- package/src/engine/webcomponents/needle-button.ts +15 -1
- package/src/engine/webcomponents/needle-engine.ts +8 -1
- package/src/engine/xr/NeedleXRSession.ts +1 -1
- package/src/engine-components/Light.ts +132 -27
- package/src/engine-components/RigidBody.ts +3 -3
- package/src/engine-components/SceneSwitcher.ts +1 -0
- package/src/engine-components/postprocessing/Effects/BloomEffect.ts +1 -1
- package/src/engine-components/postprocessing/Effects/Sharpening.ts +1 -2
- package/src/engine-components/postprocessing/PostProcessingHandler.ts +4 -8
- package/src/engine-components/web/ScrollFollow.ts +2 -2
- package/src/needle-engine.ts +2 -0
- package/src/vite-env.d.ts +16 -0
- package/dist/vendor-CEM38hLE.umd.cjs +0 -1116
- package/dist/vendor-HRlxIBga.min.js +0 -1116
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,TrianglesDrawMode as qo,TriangleFanDrawMode as ri,TriangleStripDrawMode as Cn,Loader as xt,LoaderUtils as qt,FileLoader as ht,MeshPhysicalMaterial as bt,Vector2 as _e,Color as Be,LinearSRGBColorSpace as Ve,SRGBColorSpace as ce,SpotLight as Bn,PointLight as Ai,DirectionalLight as wn,Matrix4 as le,InstancedMesh as zo,Quaternion as we,InstancedBufferAttribute as Yo,Object3D as It,TextureLoader as ci,ImageBitmapLoader as Ko,BufferAttribute as st,InterleavedBuffer as Jo,LinearMipmapLinearFilter as hs,NearestMipmapLinearFilter as Qn,LinearMipmapNearestFilter as yn,NearestMipmapNearestFilter as li,LinearFilter as it,NearestFilter as Ls,RepeatWrapping as zt,MirroredRepeatWrapping as vn,ClampToEdgeWrapping as Ns,PointsMaterial as gs,Material as ds,LineBasicMaterial as St,MeshStandardMaterial as hi,DoubleSide as gi,PropertyBinding as Dt,BufferGeometry as rt,SkinnedMesh as xn,LineSegments as Us,Line as gt,LineLoop as Vo,Points as Gs,Group as Yt,PerspectiveCamera as Ps,MathUtils as Ee,OrthographicCamera as Sn,Skeleton as Dn,AnimationClip as Rn,Bone as di,InterpolateDiscrete as Tn,InterpolateLinear as pi,InterleavedBufferAttribute as Kt,Texture as ui,VectorKeyframeTrack as fi,NumberKeyframeTrack as mi,QuaternionKeyframeTrack as bi,ColorManagement as We,FrontSide as kn,Interpolant as Wo,Box3 as Os,Sphere as Ii,CompressedCubeTexture as Xo,CompressedArrayTexture as Zo,CompressedTexture as ps,NoColorSpace as Hs,RGBA_BPTC_Format as Ei,RGBA_S3TC_DXT5_Format as Ci,RGBA_S3TC_DXT3_Format as Mn,RGB_S3TC_DXT1_Format as Fn,RGBA_S3TC_DXT1_Format as Bi,RGBA_ASTC_6x6_Format as _n,RGBA_ASTC_4x4_Format as js,RGBA_ETC2_EAC_Format as Ln,RGB_ETC2_Format as Nn,RGBFormat as wi,RedFormat as ts,RGFormat as us,RGBAFormat as Nt,UnsignedByteType as dt,HalfFloatType as Xe,UnsignedInt101111Type as Un,UnsignedInt5999Type as Gn,FloatType as pt,DataTexture as $o,Data3DTexture as er,RGB_PVRTC_4BPPV1_Format as tr,RGB_ETC1_Format as sr,RGBA_PVRTC_4BPPV1_Format as ir,RGB_BPTC_UNSIGNED_Format as nr,NodeFrame as ar,ShaderLib as Et,ExtrudeGeometry as or,ShapePath as rr,DataTextureLoader as Pn,DataUtils as ss,CylinderGeometry as Ze,BoxGeometry as Ye,Float32BufferAttribute as Te,OctahedronGeometry as qs,TorusGeometry as fs,Euler as Ut,Controls as On,Raycaster as Qi,PlaneGeometry as yi,MOUSE as is,TOUCH as ns,Spherical as Hn,Ray as Ar,Plane as cr,ShaderMaterial as jn,Uniform$1 as lr,Scene as vi,WebGLRenderer as hr,CanvasTexture as qn,REVISION as gr,Source as dr,InstancedBufferGeometry as pr,InstancedInterleavedBuffer as xi,WireframeGeometry as ur,UniformsUtils as zn,UniformsLib as zs,Vector4 as Rt,Line3 as fr,Matrix3 as Yn,Curve as mr,MeshPhongMaterial as ms,MeshLambertMaterial as br,EquirectangularReflectionMapping as Ir,AmbientLight as Er,Uint16BufferAttribute as Cr,ShapeUtils as Br,DefaultLoadingManager as wr}from"./three.min.js";class Qr extends O{constructor(e,t,i,s=128){if(t<=0||i<=0||s<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const n=new oi(i,2*s,s);n.scale(1,1,-1);const a=n.getAttribute("position"),r=new N;for(let A=0;A<a.count;++A)if(r.fromBufferAttribute(a,A),r.y<0){const c=-t*3/2,l=r.y<c?-t/r.y:1-r.y*r.y/(3*c*c);r.multiplyScalar(l),r.toArray(a.array,3*A)}a.needsUpdate=!0,super(n,new mt({map:e,depthWrite:!1}))}}function yr(o,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},i=o.getIndex(),s=o.getAttribute("position"),n=i?i.count:s.count;let a=0;const r=Object.keys(o.attributes),A={},c={},l=[],h=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"];for(let E=0,C=r.length;E<C;E++){const Q=r[E],w=o.attributes[Q];A[Q]=new w.constructor(new w.array.constructor(w.count*w.itemSize),w.itemSize,w.normalized);const x=o.morphAttributes[Q];x&&(c[Q]||(c[Q]=[]),x.forEach((D,S)=>{const F=new D.array.constructor(D.count*D.itemSize);c[Q][S]=new D.constructor(F,D.itemSize,D.normalized)}))}const p=e*.5,f=Math.log10(1/e),b=Math.pow(10,f),m=p*b;for(let E=0;E<n;E++){const C=i?i.getX(E):E;let Q="";for(let w=0,x=r.length;w<x;w++){const D=r[w],S=o.getAttribute(D),F=S.itemSize;for(let Y=0;Y<F;Y++)Q+=`${~~(S[h[Y]](C)*b+m)},`}if(Q in t)l.push(t[Q]);else{for(let w=0,x=r.length;w<x;w++){const D=r[w],S=o.getAttribute(D),F=o.morphAttributes[D],Y=S.itemSize,V=A[D],K=c[D];for(let W=0;W<Y;W++){const j=h[W],X=d[W];if(V[X](a,S[j](C)),F)for(let J=0,ee=F.length;J<ee;J++)K[J][X](a,F[J][j](C))}}t[Q]=a,l.push(a),a++}}const I=o.clone();for(const E in o.attributes){const C=A[E];if(I.setAttribute(E,new C.constructor(C.array.slice(0,a*C.itemSize),C.itemSize,C.normalized)),E in c)for(let Q=0;Q<c[E].length;Q++){const w=c[E][Q];I.morphAttributes[E][Q]=new w.constructor(w.array.slice(0,a*w.itemSize),w.itemSize,w.normalized)}}return I.setIndex(l),I}function Kn(o,e){if(e===qo)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===ri||e===Cn){let t=o.getIndex();if(t===null){const a=[],r=o.getAttribute("position");if(r!==void 0){for(let A=0;A<r.count;A++)a.push(A);o.setIndex(a),t=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}const i=t.count-2,s=[];if(e===ri)for(let a=1;a<=i;a++)s.push(t.getX(0)),s.push(t.getX(a)),s.push(t.getX(a+1));else for(let a=0;a<i;a++)a%2===0?(s.push(t.getX(a)),s.push(t.getX(a+1)),s.push(t.getX(a+2))):(s.push(t.getX(a+2)),s.push(t.getX(a+1)),s.push(t.getX(a)));s.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const n=o.clone();return n.setIndex(s),n.clearGroups(),n}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}class Si extends xt{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new Rr(t)}),this.register(function(t){return new Tr(t)}),this.register(function(t){return new Pr(t)}),this.register(function(t){return new Or(t)}),this.register(function(t){return new Hr(t)}),this.register(function(t){return new Mr(t)}),this.register(function(t){return new Fr(t)}),this.register(function(t){return new _r(t)}),this.register(function(t){return new Lr(t)}),this.register(function(t){return new Dr(t)}),this.register(function(t){return new Nr(t)}),this.register(function(t){return new kr(t)}),this.register(function(t){return new Gr(t)}),this.register(function(t){return new Ur(t)}),this.register(function(t){return new xr(t)}),this.register(function(t){return new jr(t)}),this.register(function(t){return new qr(t)})}load(e,t,i,s){const n=this;let a;if(this.resourcePath!=="")a=this.resourcePath;else if(this.path!==""){const c=qt.extractUrlBase(e);a=qt.resolveURL(c,this.path)}else a=qt.extractUrlBase(e);this.manager.itemStart(e);const r=function(c){s?s(c):console.error(c),n.manager.itemError(e),n.manager.itemEnd(e)},A=new ht(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(c){try{n.parse(c,a,function(l){t(l),n.manager.itemEnd(e)},r)}catch(l){r(l)}},i,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,i,s){let n,a;const r={},A={},c=new TextDecoder;if(typeof e=="string")try{n=JSON.parse(e)}catch(h){a=e,s&&s(h);return}else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===Jn){try{r[ne.KHR_BINARY_GLTF]=new zr(e)}catch(h){s&&s(h);return}try{n=JSON.parse(r[ne.KHR_BINARY_GLTF].content)}catch(h){a=r[ne.KHR_BINARY_GLTF].content,s&&s(h);return}}else try{n=JSON.parse(c.decode(e))}catch(h){a=c.decode(e),s&&s(h);return}else n=e;if(n.asset===void 0||n.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=n,this.jsonErrorData=a;const l=new nA(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const d=this.pluginCallbacks[h](l);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),A[d.name]=d,r[d.name]=!0}if(n.extensionsUsed)for(let h=0;h<n.extensionsUsed.length;++h){const d=n.extensionsUsed[h],p=n.extensionsRequired||[];switch(d){case ne.KHR_MATERIALS_UNLIT:r[d]=new Sr;break;case ne.KHR_DRACO_MESH_COMPRESSION:r[d]=new Yr(n,this.dracoLoader);break;case ne.KHR_TEXTURE_TRANSFORM:r[d]=new Kr;break;case ne.KHR_MESH_QUANTIZATION:r[d]=new Jr;break;default:p.indexOf(d)>=0&&A[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}l.setExtensions(r),l.setPlugins(A),l.parse(i,s)}parseAsync(e,t){const i=this;return new Promise(function(s,n){i.parse(e,t,s,n)})}}function vr(){let o={};return{get:function(e){return o[e]},add:function(e,t){o[e]=t},remove:function(e){delete o[e]},removeAll:function(){o={}}}}const ne={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 xr{constructor(e){this.parser=e,this.name=ne.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,s=t.length;i<s;i++){const n=t[i];n.extensions&&n.extensions[this.name]&&n.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){const t=this.parser,i="light:"+e;let s=t.cache.get(i);if(s)return s;const n=t.json,a=((n.extensions&&n.extensions[this.name]||{}).lights||[])[e];let r;const A=new Be(16777215);a.color!==void 0&&A.setRGB(a.color[0],a.color[1],a.color[2],Ve);const c=a.range!==void 0?a.range:0;switch(a.type){case"directional":r=new wn(A),r.target.position.set(0,0,-1),r.add(r.target);break;case"point":r=new Ai(A),r.distance=c;break;case"spot":r=new Bn(A),r.distance=c,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,r.angle=a.spot.outerConeAngle,r.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,r.target.position.set(0,0,-1),r.add(r.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}return r.position.set(0,0,0),r.decay=2,Tt(r,a),a.intensity!==void 0&&(r.intensity=a.intensity),r.name=t.createUniqueName(a.name||"light_"+e),s=Promise.resolve(r),t.cache.add(i,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,i=this.parser,s=i.json.nodes[e],n=(s.extensions&&s.extensions[this.name]||{}).light;return n===void 0?null:this._loadLight(n).then(function(a){return i._getNodeRef(t.cache,n,a)})}}let Sr=class{constructor(){this.name=ne.KHR_MATERIALS_UNLIT}getMaterialType(){return mt}extendParams(o,e,t){const i=[];o.color=new Be(1,1,1),o.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const n=s.baseColorFactor;o.color.setRGB(n[0],n[1],n[2],Ve),o.opacity=n[3]}s.baseColorTexture!==void 0&&i.push(t.assignTexture(o,"map",s.baseColorTexture,ce))}return Promise.all(i)}},Dr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const i=t.extensions[this.name].emissiveStrength;return i!==void 0&&(e.emissiveIntensity=i),Promise.resolve()}},Rr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_CLEARCOAT}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];if(n.clearcoatFactor!==void 0&&(e.clearcoat=n.clearcoatFactor),n.clearcoatTexture!==void 0&&s.push(t.assignTexture(e,"clearcoatMap",n.clearcoatTexture)),n.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=n.clearcoatRoughnessFactor),n.clearcoatRoughnessTexture!==void 0&&s.push(t.assignTexture(e,"clearcoatRoughnessMap",n.clearcoatRoughnessTexture)),n.clearcoatNormalTexture!==void 0&&(s.push(t.assignTexture(e,"clearcoatNormalMap",n.clearcoatNormalTexture)),n.clearcoatNormalTexture.scale!==void 0)){const a=n.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new _e(a,a)}return Promise.all(s)}},Tr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_DISPERSION}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const i=t.extensions[this.name];return e.dispersion=i.dispersion!==void 0?i.dispersion:0,Promise.resolve()}},kr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_IRIDESCENCE}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.iridescenceFactor!==void 0&&(e.iridescence=n.iridescenceFactor),n.iridescenceTexture!==void 0&&s.push(t.assignTexture(e,"iridescenceMap",n.iridescenceTexture)),n.iridescenceIor!==void 0&&(e.iridescenceIOR=n.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),n.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=n.iridescenceThicknessMinimum),n.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=n.iridescenceThicknessMaximum),n.iridescenceThicknessTexture!==void 0&&s.push(t.assignTexture(e,"iridescenceThicknessMap",n.iridescenceThicknessTexture)),Promise.all(s)}},Mr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_SHEEN}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new Be(0,0,0),e.sheenRoughness=0,e.sheen=1;const n=i.extensions[this.name];if(n.sheenColorFactor!==void 0){const a=n.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],Ve)}return n.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=n.sheenRoughnessFactor),n.sheenColorTexture!==void 0&&s.push(t.assignTexture(e,"sheenColorMap",n.sheenColorTexture,ce)),n.sheenRoughnessTexture!==void 0&&s.push(t.assignTexture(e,"sheenRoughnessMap",n.sheenRoughnessTexture)),Promise.all(s)}},Fr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_TRANSMISSION}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.transmissionFactor!==void 0&&(e.transmission=n.transmissionFactor),n.transmissionTexture!==void 0&&s.push(t.assignTexture(e,"transmissionMap",n.transmissionTexture)),Promise.all(s)}},_r=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_VOLUME}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];e.thickness=n.thicknessFactor!==void 0?n.thicknessFactor:0,n.thicknessTexture!==void 0&&s.push(t.assignTexture(e,"thicknessMap",n.thicknessTexture)),e.attenuationDistance=n.attenuationDistance||1/0;const a=n.attenuationColor||[1,1,1];return e.attenuationColor=new Be().setRGB(a[0],a[1],a[2],Ve),Promise.all(s)}},Lr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_IOR}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const i=t.extensions[this.name];return e.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}},Nr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_SPECULAR}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];e.specularIntensity=n.specularFactor!==void 0?n.specularFactor:1,n.specularTexture!==void 0&&s.push(t.assignTexture(e,"specularIntensityMap",n.specularTexture));const a=n.specularColorFactor||[1,1,1];return e.specularColor=new Be().setRGB(a[0],a[1],a[2],Ve),n.specularColorTexture!==void 0&&s.push(t.assignTexture(e,"specularColorMap",n.specularColorTexture,ce)),Promise.all(s)}},Ur=class{constructor(o){this.parser=o,this.name=ne.EXT_MATERIALS_BUMP}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return e.bumpScale=n.bumpFactor!==void 0?n.bumpFactor:1,n.bumpTexture!==void 0&&s.push(t.assignTexture(e,"bumpMap",n.bumpTexture)),Promise.all(s)}},Gr=class{constructor(o){this.parser=o,this.name=ne.KHR_MATERIALS_ANISOTROPY}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,i=t.json.materials[o];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],n=i.extensions[this.name];return n.anisotropyStrength!==void 0&&(e.anisotropy=n.anisotropyStrength),n.anisotropyRotation!==void 0&&(e.anisotropyRotation=n.anisotropyRotation),n.anisotropyTexture!==void 0&&s.push(t.assignTexture(e,"anisotropyMap",n.anisotropyTexture)),Promise.all(s)}};class Pr{constructor(e){this.parser=e,this.name=ne.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,i=t.json,s=i.textures[e];if(!s.extensions||!s.extensions[this.name])return null;const n=s.extensions[this.name],a=t.options.ktx2Loader;if(!a){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,n.source,a)}}class Or{constructor(e){this.parser=e,this.name=ne.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;const a=n.extensions[t],r=s.images[a.source];let A=i.textureLoader;if(r.uri){const c=i.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,a.source,A);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.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 Hr{constructor(e){this.parser=e,this.name=ne.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,s=i.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;const a=n.extensions[t],r=s.images[a.source];let A=i.textureLoader;if(r.uri){const c=i.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,a.source,A);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.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 jr{constructor(e){this.name=ne.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const s=i.extensions[this.name],n=this.parser.getDependency("buffer",s.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.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 n.then(function(r){const A=s.byteOffset||0,c=s.byteLength||0,l=s.count,h=s.byteStride,d=new Uint8Array(r,A,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(l,h,d,s.mode,s.filter).then(function(p){return p.buffer}):a.ready.then(function(){const p=new ArrayBuffer(l*h);return a.decodeGltfBuffer(new Uint8Array(p),l,h,d,s.mode,s.filter),p})})}else return null}}let qr=class{constructor(o){this.name=ne.EXT_MESH_GPU_INSTANCING,this.parser=o}createNodeMesh(o){const e=this.parser.json,t=e.nodes[o];if(!t.extensions||!t.extensions[this.name]||t.mesh===void 0)return null;const i=e.meshes[t.mesh];for(const r of i.primitives)if(r.mode!==At.TRIANGLES&&r.mode!==At.TRIANGLE_STRIP&&r.mode!==At.TRIANGLE_FAN&&r.mode!==void 0)return null;const s=t.extensions[this.name].attributes,n=[],a={};for(const r in s)n.push(this.parser.getDependency("accessor",s[r]).then(A=>(a[r]=A,a[r])));return n.length<1?null:(n.push(this.parser.createNodeMesh(o)),Promise.all(n).then(r=>{const A=r.pop(),c=A.isGroup?A.children:[A],l=r[0].count,h=[];for(const d of c){const p=new le,f=new N,b=new we,m=new N(1,1,1),I=new zo(d.geometry,d.material,l);for(let E=0;E<l;E++)a.TRANSLATION&&f.fromBufferAttribute(a.TRANSLATION,E),a.ROTATION&&b.fromBufferAttribute(a.ROTATION,E),a.SCALE&&m.fromBufferAttribute(a.SCALE,E),I.setMatrixAt(E,p.compose(f,b,m));for(const E in a)if(E==="_COLOR_0"){const C=a[E];I.instanceColor=new Yo(C.array,C.itemSize,C.normalized)}else E!=="TRANSLATION"&&E!=="ROTATION"&&E!=="SCALE"&&d.geometry.setAttribute(E,a[E]);It.prototype.copy.call(I,d),this.parser.assignFinalMaterial(I),h.push(I)}return A.isGroup?(A.clear(),A.add(...h),A):h[0]}))}};const Jn="glTF",bs=12,Vn={JSON:1313821514,BIN:5130562};class zr{constructor(e){this.name=ne.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,bs),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Jn)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const s=this.header.length-bs,n=new DataView(e,bs);let a=0;for(;a<s;){const r=n.getUint32(a,!0);a+=4;const A=n.getUint32(a,!0);if(a+=4,A===Vn.JSON){const c=new Uint8Array(e,bs+a,r);this.content=i.decode(c)}else if(A===Vn.BIN){const c=bs+a;this.body=e.slice(c,c+r)}a+=r}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Yr{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ne.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const i=this.json,s=this.dracoLoader,n=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,r={},A={},c={};for(const l in a){const h=Ri[l]||l.toLowerCase();r[h]=a[l]}for(const l in e.attributes){const h=Ri[l]||l.toLowerCase();if(a[l]!==void 0){const d=i.accessors[e.attributes[l]],p=as[d.componentType];c[h]=p.name,A[h]=d.normalized===!0}}return t.getDependency("bufferView",n).then(function(l){return new Promise(function(h,d){s.decodeDracoFile(l,function(p){for(const f in p.attributes){const b=p.attributes[f],m=A[f];m!==void 0&&(b.normalized=m)}h(p)},r,c,Ve,d)})})}}class Kr{constructor(){this.name=ne.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 Jr{constructor(){this.name=ne.KHR_MESH_QUANTIZATION}}class Wn extends Wo{constructor(e,t,i,s){super(e,t,i,s)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,s=this.valueSize,n=e*s*3+s;for(let a=0;a!==s;a++)t[a]=i[n+a];return t}interpolate_(e,t,i,s){const n=this.resultBuffer,a=this.sampleValues,r=this.valueSize,A=r*2,c=r*3,l=s-t,h=(i-t)/l,d=h*h,p=d*h,f=e*c,b=f-c,m=-2*p+3*d,I=p-d,E=1-m,C=I-d+h;for(let Q=0;Q!==r;Q++){const w=a[b+Q+r],x=a[b+Q+A]*l,D=a[f+Q+r],S=a[f+Q]*l;n[Q]=E*w+C*x+m*D+I*S}return n}}const Vr=new we;class Wr extends Wn{interpolate_(e,t,i,s){const n=super.interpolate_(e,t,i,s);return Vr.fromArray(n).normalize().toArray(n),n}}const At={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},as={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Xn={9728:Ls,9729:it,9984:li,9985:yn,9986:Qn,9987:hs},Zn={33071:Ns,33648:vn,10497:zt},Di={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ri={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"},Gt={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Xr={CUBICSPLINE:void 0,LINEAR:pi,STEP:Tn},Ti={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Zr(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new hi({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:kn})),o.DefaultMaterial}function Jt(o,e,t){for(const i in t.extensions)o[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Tt(o,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(o.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function $r(o,e,t){let i=!1,s=!1,n=!1;for(let c=0,l=e.length;c<l;c++){const h=e[c];if(h.POSITION!==void 0&&(i=!0),h.NORMAL!==void 0&&(s=!0),h.COLOR_0!==void 0&&(n=!0),i&&s&&n)break}if(!i&&!s&&!n)return Promise.resolve(o);const a=[],r=[],A=[];for(let c=0,l=e.length;c<l;c++){const h=e[c];if(i){const d=h.POSITION!==void 0?t.getDependency("accessor",h.POSITION):o.attributes.position;a.push(d)}if(s){const d=h.NORMAL!==void 0?t.getDependency("accessor",h.NORMAL):o.attributes.normal;r.push(d)}if(n){const d=h.COLOR_0!==void 0?t.getDependency("accessor",h.COLOR_0):o.attributes.color;A.push(d)}}return Promise.all([Promise.all(a),Promise.all(r),Promise.all(A)]).then(function(c){const l=c[0],h=c[1],d=c[2];return i&&(o.morphAttributes.position=l),s&&(o.morphAttributes.normal=h),n&&(o.morphAttributes.color=d),o.morphTargetsRelative=!0,o})}function eA(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)o.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(o.morphTargetInfluences.length===t.length){o.morphTargetDictionary={};for(let i=0,s=t.length;i<s;i++)o.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function tA(o){let e;const t=o.extensions&&o.extensions[ne.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+ki(t.attributes):e=o.indices+":"+ki(o.attributes)+":"+o.mode,o.targets!==void 0)for(let i=0,s=o.targets.length;i<s;i++)e+=":"+ki(o.targets[i]);return e}function ki(o){let e="";const t=Object.keys(o).sort();for(let i=0,s=t.length;i<s;i++)e+=t[i]+":"+o[t[i]]+";";return e}function Mi(o){switch(o){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 sA(o){return o.search(/\.jpe?g($|\?)/i)>0||o.search(/^data\:image\/jpeg/)===0?"image/jpeg":o.search(/\.webp($|\?)/i)>0||o.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const iA=new le;class nA{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new vr,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 i=!1,s=-1,n=!1,a=-1;if(typeof navigator<"u"){const r=navigator.userAgent;i=/^((?!chrome|android).)*safari/i.test(r)===!0;const A=r.match(/Version\/(\d+)/);s=i&&A?parseInt(A[1],10):-1,n=r.indexOf("Firefox")>-1,a=n?r.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||i&&s<17||n&&a<98?this.textureLoader=new ci(this.options.manager):this.textureLoader=new Ko(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new ht(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 i=this,s=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(a){const r={scene:a[0][s.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:s.asset,parser:i,userData:{}};return Jt(n,r,s),Tt(r,s),Promise.all(i._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||[],i=this.json.meshes||[];for(let s=0,n=t.length;s<n;s++){const a=t[s].joints;for(let r=0,A=a.length;r<A;r++)e[a[r]].isBone=!0}for(let s=0,n=e.length;s<n;s++){const a=e[s];a.mesh!==void 0&&(this._addNodeRef(this.meshCache,a.mesh),a.skin!==void 0&&(i[a.mesh].isSkinnedMesh=!0)),a.camera!==void 0&&this._addNodeRef(this.cameraCache,a.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,i){if(e.refs[t]<=1)return i;const s=i.clone(),n=(a,r)=>{const A=this.associations.get(a);A!=null&&this.associations.set(r,A);for(const[c,l]of a.children.entries())n(l,r.children[c])};return n(i,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const s=e(t[i]);if(s)return s}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let s=0;s<t.length;s++){const n=e(t[s]);n&&i.push(n)}return i}getDependency(e,t){const i=e+":"+t;let s=this.cache.get(i);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(n){return n.loadNode&&n.loadNode(t)});break;case"mesh":s=this._invokeOne(function(n){return n.loadMesh&&n.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(n){return n.loadBufferView&&n.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(n){return n.loadMaterial&&n.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(n){return n.loadTexture&&n.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(n){return n.loadAnimation&&n.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(i,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(n,a){return i.getDependency(e,a)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=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[ne.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(n,a){i.load(qt.resolveURL(t.uri,s.path),n,void 0,function(){a(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(i){const s=t.byteLength||0,n=t.byteOffset||0;return i.slice(n,n+s)})}loadAccessor(e){const t=this,i=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){const a=Di[s.type],r=as[s.componentType],A=s.normalized===!0,c=new r(s.count*a);return Promise.resolve(new st(c,a,A))}const n=[];return s.bufferView!==void 0?n.push(this.getDependency("bufferView",s.bufferView)):n.push(null),s.sparse!==void 0&&(n.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(n).then(function(a){const r=a[0],A=Di[s.type],c=as[s.componentType],l=c.BYTES_PER_ELEMENT,h=l*A,d=s.byteOffset||0,p=s.bufferView!==void 0?i.bufferViews[s.bufferView].byteStride:void 0,f=s.normalized===!0;let b,m;if(p&&p!==h){const I=Math.floor(d/p),E="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+I+":"+s.count;let C=t.cache.get(E);C||(b=new c(r,I*p,s.count*p/l),C=new Jo(b,p/l),t.cache.add(E,C)),m=new Kt(C,A,d%p/l,f)}else r===null?b=new c(s.count*A):b=new c(r,d,s.count*A),m=new st(b,A,f);if(s.sparse!==void 0){const I=Di.SCALAR,E=as[s.sparse.indices.componentType],C=s.sparse.indices.byteOffset||0,Q=s.sparse.values.byteOffset||0,w=new E(a[1],C,s.sparse.count*I),x=new c(a[2],Q,s.sparse.count*A);r!==null&&(m=new st(m.array.slice(),m.itemSize,m.normalized)),m.normalized=!1;for(let D=0,S=w.length;D<S;D++){const F=w[D];if(m.setX(F,x[D*A]),A>=2&&m.setY(F,x[D*A+1]),A>=3&&m.setZ(F,x[D*A+2]),A>=4&&m.setW(F,x[D*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}m.normalized=f}return m})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,n=t.images[s];let a=this.textureLoader;if(n.uri){const r=i.manager.getHandler(n.uri);r!==null&&(a=r)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const s=this,n=this.json,a=n.textures[e],r=n.images[t],A=(r.uri||r.bufferView)+":"+a.sampler;if(this.textureCache[A])return this.textureCache[A];const c=this.loadImageSource(t,i).then(function(l){l.flipY=!1,l.name=a.name||r.name||"",l.name===""&&typeof r.uri=="string"&&r.uri.startsWith("data:image/")===!1&&(l.name=r.uri);const h=(n.samplers||{})[a.sampler]||{};return l.magFilter=Xn[h.magFilter]||it,l.minFilter=Xn[h.minFilter]||hs,l.wrapS=Zn[h.wrapS]||zt,l.wrapT=Zn[h.wrapT]||zt,l.anisotropy=4,s.associations.set(l,{textures:e}),l}).catch(function(){return null});return this.textureCache[A]=c,c}loadImageSource(e,t){const i=this,s=this.json,n=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const a=s.images[e],r=self.URL||self.webkitURL;let A=a.uri||"",c=!1;if(a.bufferView!==void 0)A=i.getDependency("bufferView",a.bufferView).then(function(h){c=!0;const d=new Blob([h],{type:a.mimeType});return A=r.createObjectURL(d),A});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const l=Promise.resolve(A).then(function(h){return new Promise(function(d,p){let f=d;t.isImageBitmapLoader===!0&&(f=function(b){const m=new ui(b);m.needsUpdate=!0,d(m)}),t.load(qt.resolveURL(h,n.path),f,void 0,p)})}).then(function(h){return c===!0&&r.revokeObjectURL(A),Tt(h,a),h.userData.mimeType=a.mimeType||sA(a.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),h});return this.sourceCache[e]=l,l}assignTexture(e,t,i,s){const n=this;return this.getDependency("texture",i.index).then(function(a){if(!a)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(a=a.clone(),a.channel=i.texCoord),n.extensions[ne.KHR_TEXTURE_TRANSFORM]){const r=i.extensions!==void 0?i.extensions[ne.KHR_TEXTURE_TRANSFORM]:void 0;if(r){const A=n.associations.get(a);a=n.extensions[ne.KHR_TEXTURE_TRANSFORM].extendTexture(a,r),n.associations.set(a,A)}}return s!==void 0&&(a.colorSpace=s),e[t]=a,a})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const s=t.attributes.tangent===void 0,n=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){const r="PointsMaterial:"+i.uuid;let A=this.cache.get(r);A||(A=new gs,ds.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,A.sizeAttenuation=!1,this.cache.add(r,A)),i=A}else if(e.isLine){const r="LineBasicMaterial:"+i.uuid;let A=this.cache.get(r);A||(A=new St,ds.prototype.copy.call(A,i),A.color.copy(i.color),A.map=i.map,this.cache.add(r,A)),i=A}if(s||n||a){let r="ClonedMaterial:"+i.uuid+":";s&&(r+="derivative-tangents:"),n&&(r+="vertex-colors:"),a&&(r+="flat-shading:");let A=this.cache.get(r);A||(A=i.clone(),n&&(A.vertexColors=!0),a&&(A.flatShading=!0),s&&(A.normalScale&&(A.normalScale.y*=-1),A.clearcoatNormalScale&&(A.clearcoatNormalScale.y*=-1)),this.cache.add(r,A),this.associations.set(A,this.associations.get(i))),i=A}e.material=i}getMaterialType(){return hi}loadMaterial(e){const t=this,i=this.json,s=this.extensions,n=i.materials[e];let a;const r={},A=n.extensions||{},c=[];if(A[ne.KHR_MATERIALS_UNLIT]){const h=s[ne.KHR_MATERIALS_UNLIT];a=h.getMaterialType(),c.push(h.extendParams(r,n,t))}else{const h=n.pbrMetallicRoughness||{};if(r.color=new Be(1,1,1),r.opacity=1,Array.isArray(h.baseColorFactor)){const d=h.baseColorFactor;r.color.setRGB(d[0],d[1],d[2],Ve),r.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(r,"map",h.baseColorTexture,ce)),r.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,r.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(r,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(r,"roughnessMap",h.metallicRoughnessTexture))),a=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,r)})))}n.doubleSided===!0&&(r.side=gi);const l=n.alphaMode||Ti.OPAQUE;if(l===Ti.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,l===Ti.MASK&&(r.alphaTest=n.alphaCutoff!==void 0?n.alphaCutoff:.5)),n.normalTexture!==void 0&&a!==mt&&(c.push(t.assignTexture(r,"normalMap",n.normalTexture)),r.normalScale=new _e(1,1),n.normalTexture.scale!==void 0)){const h=n.normalTexture.scale;r.normalScale.set(h,h)}if(n.occlusionTexture!==void 0&&a!==mt&&(c.push(t.assignTexture(r,"aoMap",n.occlusionTexture)),n.occlusionTexture.strength!==void 0&&(r.aoMapIntensity=n.occlusionTexture.strength)),n.emissiveFactor!==void 0&&a!==mt){const h=n.emissiveFactor;r.emissive=new Be().setRGB(h[0],h[1],h[2],Ve)}return n.emissiveTexture!==void 0&&a!==mt&&c.push(t.assignTexture(r,"emissiveMap",n.emissiveTexture,ce)),Promise.all(c).then(function(){const h=new a(r);return n.name&&(h.name=n.name),Tt(h,n),t.associations.set(h,{materials:e}),n.extensions&&Jt(s,h,n),h})}createUniqueName(e){const t=Dt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,s=this.primitiveCache;function n(r){return i[ne.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(r,t).then(function(A){return $n(A,r,t)})}const a=[];for(let r=0,A=e.length;r<A;r++){const c=e[r],l=tA(c),h=s[l];if(h)a.push(h.promise);else{let d;c.extensions&&c.extensions[ne.KHR_DRACO_MESH_COMPRESSION]?d=n(c):d=$n(new rt,c,t),s[l]={primitive:c,promise:d},a.push(d)}}return Promise.all(a)}loadMesh(e){const t=this,i=this.json,s=this.extensions,n=i.meshes[e],a=n.primitives,r=[];for(let A=0,c=a.length;A<c;A++){const l=a[A].material===void 0?Zr(this.cache):this.getDependency("material",a[A].material);r.push(l)}return r.push(t.loadGeometries(a)),Promise.all(r).then(function(A){const c=A.slice(0,A.length-1),l=A[A.length-1],h=[];for(let p=0,f=l.length;p<f;p++){const b=l[p],m=a[p];let I;const E=c[p];if(m.mode===At.TRIANGLES||m.mode===At.TRIANGLE_STRIP||m.mode===At.TRIANGLE_FAN||m.mode===void 0)I=n.isSkinnedMesh===!0?new xn(b,E):new O(b,E),I.isSkinnedMesh===!0&&I.normalizeSkinWeights(),m.mode===At.TRIANGLE_STRIP?I.geometry=Kn(I.geometry,Cn):m.mode===At.TRIANGLE_FAN&&(I.geometry=Kn(I.geometry,ri));else if(m.mode===At.LINES)I=new Us(b,E);else if(m.mode===At.LINE_STRIP)I=new gt(b,E);else if(m.mode===At.LINE_LOOP)I=new Vo(b,E);else if(m.mode===At.POINTS)I=new Gs(b,E);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(I.geometry.morphAttributes).length>0&&eA(I,n),I.name=t.createUniqueName(n.name||"mesh_"+e),Tt(I,n),m.extensions&&Jt(s,I,m),t.assignFinalMaterial(I),h.push(I)}for(let p=0,f=h.length;p<f;p++)t.associations.set(h[p],{meshes:e,primitives:p});if(h.length===1)return n.extensions&&Jt(s,h[0],n),h[0];const d=new Yt;n.extensions&&Jt(s,d,n),t.associations.set(d,{meshes:e});for(let p=0,f=h.length;p<f;p++)d.add(h[p]);return d})}loadCamera(e){let t;const i=this.json.cameras[e],s=i[i.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Ps(Ee.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):i.type==="orthographic"&&(t=new Sn(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),Tt(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i=[];for(let s=0,n=t.joints.length;s<n;s++)i.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(s){const n=s.pop(),a=s,r=[],A=[];for(let c=0,l=a.length;c<l;c++){const h=a[c];if(h){r.push(h);const d=new le;n!==null&&d.fromArray(n.array,c*16),A.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new Dn(r,A)})}loadAnimation(e){const t=this.json,i=this,s=t.animations[e],n=s.name?s.name:"animation_"+e,a=[],r=[],A=[],c=[],l=[];let h=0,d=s.channels.length;for(h=0,d=s.channels.length;h<d;h++){const p=s.channels[h],f=s.samplers[p.sampler],b=p.target,m=b.node,I=s.parameters!==void 0?s.parameters[f.input]:f.input,E=s.parameters!==void 0?s.parameters[f.output]:f.output;b.node!==void 0&&(a.push(this.getDependency("node",m)),r.push(this.getDependency("accessor",I)),A.push(this.getDependency("accessor",E)),c.push(f),l.push(b))}return Promise.all([Promise.all(a),Promise.all(r),Promise.all(A),Promise.all(c),Promise.all(l)]).then(function(p){const f=p[0],b=p[1],m=p[2],I=p[3],E=p[4],C=[];for(h=0,d=f.length;h<d;h++){const Q=f[h],w=b[h],x=m[h],D=I[h],S=E[h];if(Q===void 0)continue;Q.updateMatrix&&Q.updateMatrix();const F=i._createAnimationTracks(Q,w,x,D,S);if(F)for(let Y=0;Y<F.length;Y++)C.push(F[Y])}return new Rn(n,void 0,C)})}createNodeMesh(e){const t=this.json,i=this,s=t.nodes[e];return s.mesh===void 0?null:i.getDependency("mesh",s.mesh).then(function(n){const a=i._getNodeRef(i.meshCache,s.mesh,n);return s.weights!==void 0&&a.traverse(function(r){if(r.isMesh)for(let A=0,c=s.weights.length;A<c;A++)r.morphTargetInfluences[A]=s.weights[A]}),a})}loadNode(e){const t=this.json,i=this,s=t.nodes[e],n=i._loadNodeShallow(e),a=[],r=s.children||[];for(let c=0,l=r.length;c<l;c++)a.push(i.getDependency("node",r[c]));const A=s.skin===void 0?Promise.resolve(null):i.getDependency("skin",s.skin);return Promise.all([n,Promise.all(a),A]).then(function(c){const l=c[0],h=c[1],d=c[2];d!==null&&l.traverse(function(p){p.isSkinnedMesh&&p.bind(d,iA)});for(let p=0,f=h.length;p<f;p++)l.add(h[p]);return l})}_loadNodeShallow(e){const t=this.json,i=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const n=t.nodes[e],a=n.name?s.createUniqueName(n.name):"",r=[],A=s._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return A&&r.push(A),n.camera!==void 0&&r.push(s.getDependency("camera",n.camera).then(function(c){return s._getNodeRef(s.cameraCache,n.camera,c)})),s._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){r.push(c)}),this.nodeCache[e]=Promise.all(r).then(function(c){let l;if(n.isBone===!0?l=new di:c.length>1?l=new Yt:c.length===1?l=c[0]:l=new It,l!==c[0])for(let h=0,d=c.length;h<d;h++)l.add(c[h]);if(n.name&&(l.userData.name=n.name,l.name=a),Tt(l,n),n.extensions&&Jt(i,l,n),n.matrix!==void 0){const h=new le;h.fromArray(n.matrix),l.applyMatrix4(h)}else n.translation!==void 0&&l.position.fromArray(n.translation),n.rotation!==void 0&&l.quaternion.fromArray(n.rotation),n.scale!==void 0&&l.scale.fromArray(n.scale);return s.associations.has(l)||s.associations.set(l,{}),s.associations.get(l).nodes=e,l}),this.nodeCache[e]}loadScene(e){const t=this.extensions,i=this.json.scenes[e],s=this,n=new Yt;i.name&&(n.name=s.createUniqueName(i.name)),Tt(n,i),i.extensions&&Jt(t,n,i);const a=i.nodes||[],r=[];for(let A=0,c=a.length;A<c;A++)r.push(s.getDependency("node",a[A]));return Promise.all(r).then(function(A){for(let l=0,h=A.length;l<h;l++)n.add(A[l]);const c=l=>{const h=new Map;for(const[d,p]of s.associations)(d instanceof ds||d instanceof ui)&&h.set(d,p);return l.traverse(d=>{const p=s.associations.get(d);p!=null&&h.set(d,p)}),h};return s.associations=c(n),n})}_createAnimationTracks(e,t,i,s,n){const a=[],r=e.name?e.name:e.uuid,A=[];Gt[n.path]===Gt.weights?e.traverse(function(d){d.morphTargetInfluences&&A.push(d.name?d.name:d.uuid)}):A.push(r);let c;switch(Gt[n.path]){case Gt.weights:c=mi;break;case Gt.rotation:c=bi;break;case Gt.position:case Gt.scale:c=fi;break;default:i.itemSize===1?c=mi:c=fi;break}const l=s.interpolation!==void 0?Xr[s.interpolation]:pi,h=this._getArrayFromAccessor(i);for(let d=0,p=A.length;d<p;d++){const f=new c(A[d]+"."+Gt[n.path],t.array,h,l);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(f),a.push(f)}return a}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const i=Mi(t.constructor),s=new Float32Array(t.length);for(let n=0,a=t.length;n<a;n++)s[n]=t[n]*i;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const i=this instanceof bi?Wr:Wn;return new i(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function aA(o,e,t){const i=e.attributes,s=new Os;if(i.POSITION!==void 0){const r=t.json.accessors[i.POSITION],A=r.min,c=r.max;if(A!==void 0&&c!==void 0){if(s.set(new N(A[0],A[1],A[2]),new N(c[0],c[1],c[2])),r.normalized){const l=Mi(as[r.componentType]);s.min.multiplyScalar(l),s.max.multiplyScalar(l)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const n=e.targets;if(n!==void 0){const r=new N,A=new N;for(let c=0,l=n.length;c<l;c++){const h=n[c];if(h.POSITION!==void 0){const d=t.json.accessors[h.POSITION],p=d.min,f=d.max;if(p!==void 0&&f!==void 0){if(A.setX(Math.max(Math.abs(p[0]),Math.abs(f[0]))),A.setY(Math.max(Math.abs(p[1]),Math.abs(f[1]))),A.setZ(Math.max(Math.abs(p[2]),Math.abs(f[2]))),d.normalized){const b=Mi(as[d.componentType]);A.multiplyScalar(b)}r.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(r)}o.boundingBox=s;const a=new Ii;s.getCenter(a.center),a.radius=s.min.distanceTo(s.max)/2,o.boundingSphere=a}function $n(o,e,t){const i=e.attributes,s=[];function n(a,r){return t.getDependency("accessor",a).then(function(A){o.setAttribute(r,A)})}for(const a in i){const r=Ri[a]||a.toLowerCase();r in o.attributes||s.push(n(i[a],r))}if(e.indices!==void 0&&!o.index){const a=t.getDependency("accessor",e.indices).then(function(r){o.setIndex(r)});s.push(a)}return We.workingColorSpace!==Ve&&"COLOR_0"in i&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${We.workingColorSpace}" not supported.`),Tt(o,e),aA(o,e,t),Promise.all(s).then(function(){return e.targets!==void 0?$r(o,e.targets,t):o})}var oA=function(){var o="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:NgK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8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;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]),i=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 s=WebAssembly.validate(t)?e:o,n,a=WebAssembly.instantiate(r(s),{}).then(function(I){n=I.instance,n.exports.__wasm_call_ctors()});function r(I){for(var E=new Uint8Array(I.length),C=0;C<I.length;++C){var Q=I.charCodeAt(C);E[C]=Q>96?Q-97:Q>64?Q-39:Q+4}for(var w=0,C=0;C<I.length;++C)E[w++]=E[C]<60?i[E[C]]:(E[C]-60)*64+E[++C];return E.buffer.slice(0,w)}function A(I,E,C,Q,w,x){var D=n.exports.sbrk,S=C+3&-4,F=D(S*Q),Y=D(w.length),V=new Uint8Array(n.exports.memory.buffer);V.set(w,Y);var K=I(F,C,Q,Y,w.length);if(K==0&&x&&x(F,S,Q),E.set(V.subarray(F,F+C*Q)),D(F-D(0)),K!=0)throw new Error("Malformed buffer data: "+K)}var c={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],d=0;function p(I){var E={object:new Worker(I),pending:0,requests:{}};return E.object.onmessage=function(C){var Q=C.data;E.pending-=Q.count,E.requests[Q.id][Q.action](Q.value),delete E.requests[Q.id]},E}function f(I){for(var E="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r(s))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+A.toString()+m.toString(),C=new Blob([E],{type:"text/javascript"}),Q=URL.createObjectURL(C),w=0;w<I;++w)h[w]=p(Q);URL.revokeObjectURL(Q)}function b(I,E,C,Q,w){for(var x=h[0],D=1;D<h.length;++D)h[D].pending<x.pending&&(x=h[D]);return new Promise(function(S,F){var Y=new Uint8Array(C),V=d++;x.pending+=I,x.requests[V]={resolve:S,reject:F},x.object.postMessage({id:V,count:I,size:E,source:Y,mode:Q,filter:w},[Y.buffer])})}function m(I){a.then(function(){var E=I.data;try{var C=new Uint8Array(E.count*E.size);A(n.exports[E.mode],C,E.count,E.size,E.source,n.exports[E.filter]),self.postMessage({id:E.id,count:E.count,action:"resolve",value:C},[C.buffer])}catch(Q){self.postMessage({id:E.id,count:E.count,action:"reject",value:Q})}})}return{ready:a,supported:!0,useWorkers:function(I){f(I)},decodeVertexBuffer:function(I,E,C,Q,w){A(n.exports.meshopt_decodeVertexBuffer,I,E,C,Q,n.exports[c[w]])},decodeIndexBuffer:function(I,E,C,Q){A(n.exports.meshopt_decodeIndexBuffer,I,E,C,Q)},decodeIndexSequence:function(I,E,C,Q){A(n.exports.meshopt_decodeIndexSequence,I,E,C,Q)},decodeGltfBuffer:function(I,E,C,Q,w,x){A(n.exports[l[w]],I,E,C,Q,n.exports[c[x]])},decodeGltfBufferAsync:function(I,E,C,Q,w){return h.length>0?b(I,E,C,l[Q],c[w]):a.then(function(){var x=new Uint8Array(I*E);return A(n.exports[l[Q]],x,I,E,C,n.exports[c[w]]),x})}}}();const Fi=new WeakMap;class rA extends xt{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,i,s){const n=new ht(this.manager);n.setPath(this.path),n.setResponseType("arraybuffer"),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,a=>{this.parse(a,t,s)},i,s)}parse(e,t,i=()=>{}){this.decodeDracoFile(e,t,null,null,ce,i).catch(i)}decodeDracoFile(e,t,i,s,n=Ve,a=()=>{}){const r={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:n};return this.decodeGeometry(e,r).then(t).catch(a)}decodeGeometry(e,t){const i=JSON.stringify(t);if(Fi.has(e)){const A=Fi.get(e);if(A.key===i)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 s;const n=this.workerNextTaskID++,a=e.byteLength,r=this._getWorker(n,a).then(A=>(s=A,new Promise((c,l)=>{s._callbacks[n]={resolve:c,reject:l},s.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return r.catch(()=>!0).then(()=>{s&&n&&this._releaseTask(s,n)}),Fi.set(e,{key:i,promise:r}),r}_createGeometry(e){const t=new rt;e.index&&t.setIndex(new st(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const s=e.attributes[i],n=s.name,a=s.array,r=s.itemSize,A=new st(a,r);n==="color"&&(this._assignVertexColorSpace(A,s.vertexColorSpace),A.normalized=!(a instanceof Float32Array)),t.setAttribute(n,A)}return t}_assignVertexColorSpace(e,t){if(t!==ce)return;const i=new Be;for(let s=0,n=e.count;s<n;s++)i.fromBufferAttribute(e,s),We.toWorkingColorSpace(i,ce),e.setXYZ(s,i.r,i.g,i.b)}_loadLibrary(e,t){const i=new ht(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((s,n)=>{i.load(e,s,void 0,n)})}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(i=>{const s=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const n=AA.toString(),a=["/* draco decoder */",s,"","/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join(`
|
|
2
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const s=new Worker(this.workerSourceURL);s._callbacks={},s._taskCosts={},s._taskLoad=0,s.postMessage({type:"init",decoderConfig:this.decoderConfig}),s.onmessage=function(n){const a=n.data;switch(a.type){case"decode":s._callbacks[a.id].resolve(a);break;case"error":s._callbacks[a.id].reject(a);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+a.type+'"')}},this.workerPool.push(s)}else this.workerPool.sort(function(s,n){return s._taskLoad>n._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_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 AA(){let o,e;onmessage=function(a){const r=a.data;switch(r.type){case"init":o=r.decoderConfig,e=new Promise(function(l){o.onModuleLoaded=function(h){l({draco:h})},DracoDecoderModule(o)});break;case"decode":const A=r.buffer,c=r.taskConfig;e.then(l=>{const h=l.draco,d=new h.Decoder;try{const p=t(h,d,new Int8Array(A),c),f=p.attributes.map(b=>b.array.buffer);p.index&&f.push(p.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:p},f)}catch(p){console.error(p),self.postMessage({type:"error",id:r.id,error:p.message})}finally{h.destroy(d)}});break}};function t(a,r,A,c){const l=c.attributeIDs,h=c.attributeTypes;let d,p;const f=r.GetEncodedGeometryType(A);if(f===a.TRIANGULAR_MESH)d=new a.Mesh,p=r.DecodeArrayToMesh(A,A.byteLength,d);else if(f===a.POINT_CLOUD)d=new a.PointCloud,p=r.DecodeArrayToPointCloud(A,A.byteLength,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!p.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+p.error_msg());const b={index:null,attributes:[]};for(const m in l){const I=self[h[m]];let E,C;if(c.useUniqueIDs)C=l[m],E=r.GetAttributeByUniqueId(d,C);else{if(C=r.GetAttributeId(d,a[l[m]]),C===-1)continue;E=r.GetAttribute(d,C)}const Q=s(a,r,d,m,I,E);m==="color"&&(Q.vertexColorSpace=c.vertexColorSpace),b.attributes.push(Q)}return f===a.TRIANGULAR_MESH&&(b.index=i(a,r,d)),a.destroy(d),b}function i(a,r,A){const c=A.num_faces()*3,l=c*4,h=a._malloc(l);r.GetTrianglesUInt32Array(A,l,h);const d=new Uint32Array(a.HEAPF32.buffer,h,c).slice();return a._free(h),{array:d,itemSize:1}}function s(a,r,A,c,l,h){const d=h.num_components(),p=A.num_points()*d,f=p*l.BYTES_PER_ELEMENT,b=n(a,l),m=a._malloc(f);r.GetAttributeDataArrayForAllPoints(A,h,b,f,m);const I=new l(a.HEAPF32.buffer,m,p).slice();return a._free(m),{name:c,array:I,itemSize:d}}function n(a,r){switch(r){case Float32Array:return a.DT_FLOAT32;case Int8Array:return a.DT_INT8;case Int16Array:return a.DT_INT16;case Int32Array:return a.DT_INT32;case Uint8Array:return a.DT_UINT8;case Uint16Array:return a.DT_UINT16;case Uint32Array:return a.DT_UINT32}}}class cA{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 i=this.workersResolve[e];if(i&&i(t),this.queue.length){const{resolve:s,msg:n,transfer:a}=this.queue.shift();this.workersResolve[e]=s,this.workers[e].postMessage(n,a)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(i=>{const s=this._getIdleWorker();s!==-1?(this._initWorker(s),this.workerStatus|=1<<s,this.workersResolve[s]=i,this.workers[s].postMessage(e,t)):this.queue.push({resolve:i,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 lA=0,ea=2,hA=1,ta=2,gA=0,dA=1,pA=10,uA=0,sa=9,ia=15,na=16,aa=22,oa=37,ra=43,Aa=76,ca=83,la=97,ha=100,ga=103,da=109,pa=122,ua=123,fA=131,mA=132,bA=133,IA=134,EA=137,CA=138,BA=141,wA=142,QA=145,yA=146,fa=148,ma=152,vA=157,xA=158,ba=165,Ia=166,_i=1000066e3;class Is{constructor(e,t,i,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,i),this._littleEndian=s,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 i=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==t&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,s)}}const Ke=[171,75,84,88,32,50,48,187,13,10,26,10];function Ea(o){return new TextDecoder().decode(o)}function SA(o){const e=new Uint8Array(o.buffer,o.byteOffset,Ke.length);if(e[0]!==Ke[0]||e[1]!==Ke[1]||e[2]!==Ke[2]||e[3]!==Ke[3]||e[4]!==Ke[4]||e[5]!==Ke[5]||e[6]!==Ke[6]||e[7]!==Ke[7]||e[8]!==Ke[8]||e[9]!==Ke[9]||e[10]!==Ke[10]||e[11]!==Ke[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},i=17*Uint32Array.BYTES_PER_ELEMENT,s=new Is(o,Ke.length,i,!0);t.vkFormat=s._nextUint32(),t.typeSize=s._nextUint32(),t.pixelWidth=s._nextUint32(),t.pixelHeight=s._nextUint32(),t.pixelDepth=s._nextUint32(),t.layerCount=s._nextUint32(),t.faceCount=s._nextUint32(),t.levelCount=s._nextUint32(),t.supercompressionScheme=s._nextUint32();const n=s._nextUint32(),a=s._nextUint32(),r=s._nextUint32(),A=s._nextUint32(),c=s._nextUint64(),l=s._nextUint64(),h=3*Math.max(t.levelCount,1)*8,d=new Is(o,Ke.length+i,h,!0);for(let se=0,oe=Math.max(t.levelCount,1);se<oe;se++)t.levels.push({levelData:new Uint8Array(o.buffer,o.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const p=new Is(o,n,a,!0);p._skip(4);const f=p._nextUint16(),b=p._nextUint16(),m=p._nextUint16(),I=p._nextUint16(),E={vendorId:f,descriptorType:b,versionNumber:m,colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},C=(I/4-6)/4;for(let se=0;se<C;se++){const oe={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&oe.channelType?(oe.sampleLower=p._nextInt32(),oe.sampleUpper=p._nextInt32()):(oe.sampleLower=p._nextUint32(),oe.sampleUpper=p._nextUint32()),E.samples[se]=oe}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(E);const Q=new Is(o,r,A,!0);for(;Q._offset<A;){const se=Q._nextUint32(),oe=Q._scan(se),Ae=Ea(oe);if(t.keyValue[Ae]=Q._nextUint8Array(se-oe.byteLength-1),Ae.match(/^ktx/i)){const Se=Ea(t.keyValue[Ae]);t.keyValue[Ae]=Se.substring(0,Se.lastIndexOf("\0"))}Q._skip(se%4?4-se%4:0)}if(l<=0)return t;const w=new Is(o,c,l,!0),x=w._nextUint16(),D=w._nextUint16(),S=w._nextUint32(),F=w._nextUint32(),Y=w._nextUint32(),V=w._nextUint32(),K=[];for(let se=0,oe=Math.max(t.levelCount,1);se<oe;se++)K.push({imageFlags:w._nextUint32(),rgbSliceByteOffset:w._nextUint32(),rgbSliceByteLength:w._nextUint32(),alphaSliceByteOffset:w._nextUint32(),alphaSliceByteLength:w._nextUint32()});const W=c+w._offset,j=W+S,X=j+F,J=X+Y,ee=new Uint8Array(o.buffer,o.byteOffset+W,S),$=new Uint8Array(o.buffer,o.byteOffset+j,F),ue=new Uint8Array(o.buffer,o.byteOffset+X,Y),De=new Uint8Array(o.buffer,o.byteOffset+J,V);return t.globalData={endpointCount:x,selectorCount:D,imageDescs:K,endpointsData:ee,selectorsData:$,tablesData:ue,extendedData:De},t}let Li,kt,Ni;const Ui={env:{emscripten_notify_memory_growth:function(o){Ni=new Uint8Array(kt.exports.memory.buffer)}}};class DA{init(){return Li||(Li=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Ca).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Ui)).then(this._init):WebAssembly.instantiate(Buffer.from(Ca,"base64"),Ui).then(this._init),Li)}_init(e){kt=e.instance,Ui.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!kt)throw new Error("ZSTDDecoder: Await .init() before decoding.");const i=e.byteLength,s=kt.exports.malloc(i);Ni.set(e,s),t=t||Number(kt.exports.ZSTD_findDecompressedSize(s,i));const n=kt.exports.malloc(t),a=kt.exports.ZSTD_decompress(n,t,s,i),r=Ni.slice(n,n+a);return kt.exports.free(s),kt.exports.free(n),r}}const Ca="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAA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YCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDc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vOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G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qIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAco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AFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtB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AIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQ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AAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",RA="display-p3",TA="display-p3-linear",Gi=new WeakMap;let Pi=0,Oi;class lt extends xt{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new cA,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 ht(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),i=new ht(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer"),i.setWithCredentials(this.withCredentials);const s=i.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then(([n,a])=>{const r=lt.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(lt.EngineFormat),"let _EngineType = "+JSON.stringify(lt.EngineType),"let _TranscoderFormat = "+JSON.stringify(lt.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(lt.BasisFormat),"/* basis_transcoder.js */",n,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
|
|
3
|
-
`);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=a,this.workerPool.setWorkerCreator(()=>{const c=new Worker(this.workerSourceURL),l=this.transcoderBinary.slice(0);return c.postMessage({type:"init",config:this.workerConfig,transcoderBinary:l},[l]),c})}),Pi>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Pi++}return this.transcoderPending}load(e,t,i,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const n=new ht(this.manager);n.setPath(this.path),n.setCrossOrigin(this.crossOrigin),n.setWithCredentials(this.withCredentials),n.setResponseType("arraybuffer"),n.load(e,a=>{this.parse(a,t,s)},i,s)}parse(e,t,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(Gi.has(e))return Gi.get(e).promise.then(t).catch(i);this._createTexture(e).then(s=>t?t(s):null).catch(i)}_createTextureFrom(e,t){const{type:i,error:s,data:{faces:n,width:a,height:r,format:A,type:c,dfdFlags:l}}=e;if(i==="error")return Promise.reject(s);let h;if(t.faceCount===6)h=new Xo(n,A,c);else{const d=n[0].mipmaps;h=t.layerCount>1?new Zo(d,a,r,t.layerCount,A,c):new ps(d,a,r,A,c)}return h.minFilter=n[0].mipmaps.length===1?it:hs,h.magFilter=it,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=Ba(t),h.premultiplyAlpha=!!(l&hA),h}async _createTexture(e,t={}){const i=SA(new Uint8Array(e)),s=i.vkFormat===_i&&i.dataFormatDescriptor[0].colorModel===167;if(!(i.vkFormat===uA||s&&!this.workerConfig.astcHDRSupported))return MA(i);const n=t,a=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:n},[e])).then(r=>this._createTextureFrom(r.data,i));return Gi.set(e,{promise:a}),a}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Pi--}}lt.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},lt.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},lt.EngineFormat={RGBAFormat:Nt,RGBA_ASTC_4x4_Format:js,RGB_BPTC_UNSIGNED_Format:nr,RGBA_BPTC_Format:Ei,RGBA_ETC2_EAC_Format:Ln,RGBA_PVRTC_4BPPV1_Format:ir,RGBA_S3TC_DXT5_Format:Ci,RGB_ETC1_Format:sr,RGB_ETC2_Format:Nn,RGB_PVRTC_4BPPV1_Format:tr,RGBA_S3TC_DXT1_Format:Bi},lt.EngineType={UnsignedByteType:dt,HalfFloatType:Xe,FloatType:pt},lt.BasisWorker=function(){let o,e,t;const i=_EngineFormat,s=_EngineType,n=_TranscoderFormat,a=_BasisFormat;self.addEventListener("message",function(f){const b=f.data;switch(b.type){case"init":o=b.config,r(b.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:m,buffers:I,width:E,height:C,hasAlpha:Q,format:w,type:x,dfdFlags:D}=A(b.buffer);self.postMessage({type:"transcode",id:b.id,data:{faces:m,width:E,height:C,hasAlpha:Q,format:w,type:x,dfdFlags:D}},I)}catch(m){console.error(m),self.postMessage({type:"error",id:b.id,error:m.message})}});break}});function r(f){e=new Promise(b=>{t={wasmBinary:f,onRuntimeInitialized:b},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(f){const b=new t.KTX2File(new Uint8Array(f));function m(){b.close(),b.delete()}if(!b.isValid())throw m(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let I;if(b.isUASTC())I=a.UASTC;else if(b.isETC1S())I=a.ETC1S;else if(b.isHDR())I=a.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const E=b.getWidth(),C=b.getHeight(),Q=b.getLayers()||1,w=b.getLevels(),x=b.getFaces(),D=b.getHasAlpha(),S=b.getDFDFlags(),{transcoderFormat:F,engineFormat:Y,engineType:V}=h(I,E,C,D);if(!E||!C||!w)throw m(),new Error("THREE.KTX2Loader: Invalid texture");if(!b.startTranscoding())throw m(),new Error("THREE.KTX2Loader: .startTranscoding failed");const K=[],W=[];for(let j=0;j<x;j++){const X=[];for(let J=0;J<w;J++){const ee=[];let $,ue;for(let se=0;se<Q;se++){const oe=b.getImageLevelInfo(J,se,j);j===0&&J===0&&se===0&&(oe.origWidth%4!==0||oe.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),w>1?($=oe.origWidth,ue=oe.origHeight):($=oe.width,ue=oe.height);let Ae=new Uint8Array(b.getImageTranscodedSizeInBytes(J,se,0,F));const Se=b.transcodeImage(Ae,J,se,j,F,0,-1,-1);if(V===s.HalfFloatType&&(Ae=new Uint16Array(Ae.buffer,Ae.byteOffset,Ae.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Se)throw m(),new Error("THREE.KTX2Loader: .transcodeImage failed.");ee.push(Ae)}const De=p(ee);X.push({data:De,width:$,height:ue}),W.push(De.buffer)}K.push({mipmaps:X,width:E,height:C,format:Y,type:V})}return m(),{faces:K,buffers:W,width:E,height:C,hasAlpha:D,dfdFlags:S,format:Y,type:V}}const c=[{if:"astcSupported",basisFormat:[a.UASTC],transcoderFormat:[n.ASTC_4x4,n.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],engineType:[s.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.BC7_M5,n.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],engineType:[s.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.BC1,n.BC3],engineFormat:[i.RGBA_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],engineType:[s.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.ETC1,n.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],engineType:[s.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.ETC1],engineFormat:[i.RGB_ETC1_Format],engineType:[s.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.PVRTC1_4_RGB,n.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],engineType:[s.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[a.UASTC_HDR],transcoderFormat:[n.BC6H],engineFormat:[i.RGB_BPTC_UNSIGNED_Format],engineType:[s.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[a.ETC1S,a.UASTC],transcoderFormat:[n.RGBA32,n.RGBA32],engineFormat:[i.RGBAFormat,i.RGBAFormat],engineType:[s.UnsignedByteType,s.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[a.UASTC_HDR],transcoderFormat:[n.RGBA_HALF],engineFormat:[i.RGBAFormat],engineType:[s.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],l={[a.ETC1S]:c.filter(f=>f.basisFormat.includes(a.ETC1S)).sort((f,b)=>f.priorityUASTC-b.priorityUASTC),[a.UASTC]:c.filter(f=>f.basisFormat.includes(a.UASTC)).sort((f,b)=>f.priorityUASTC-b.priorityUASTC),[a.UASTC_HDR]:c.filter(f=>f.basisFormat.includes(a.UASTC_HDR)).sort((f,b)=>f.priorityHDR-b.priorityHDR)};function h(f,b,m,I){const E=l[f];for(let C=0;C<E.length;C++){const Q=E[C];if(Q.if&&!o[Q.if]||!Q.basisFormat.includes(f)||I&&Q.transcoderFormat.length<2||Q.needsPowerOfTwo&&!(d(b)&&d(m)))continue;const w=Q.transcoderFormat[I?1:0],x=Q.engineFormat[I?1:0],D=Q.engineType[0];return{transcoderFormat:w,engineFormat:x,engineType:D}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function d(f){return f<=2?!0:(f&f-1)===0&&f!==0}function p(f){if(f.length===1)return f[0];let b=0;for(let E=0;E<f.length;E++){const C=f[E];b+=C.byteLength}const m=new Uint8Array(b);let I=0;for(let E=0;E<f.length;E++){const C=f[E];m.set(C,I),I+=C.byteLength}return m}};const kA=new Set([Nt,wi,us,ts]),Hi={[da]:Nt,[la]:Nt,[oa]:Nt,[ra]:Nt,[ga]:us,[ca]:us,[na]:us,[aa]:us,[ha]:ts,[Aa]:ts,[ia]:ts,[sa]:ts,[ua]:wi,[pa]:wi,[fa]:Nn,[ma]:Ln,[_i]:js,[xA]:js,[vA]:js,[Ia]:_n,[ba]:_n,[bA]:Bi,[IA]:Bi,[fA]:Fn,[mA]:Fn,[CA]:Mn,[EA]:Mn,[wA]:Ci,[BA]:Ci,[yA]:Ei,[QA]:Ei},Es={[da]:pt,[la]:Xe,[oa]:dt,[ra]:dt,[ga]:pt,[ca]:Xe,[na]:dt,[aa]:dt,[ha]:pt,[Aa]:Xe,[ia]:dt,[sa]:dt,[ua]:Gn,[pa]:Un,[fa]:dt,[ma]:dt,[_i]:Xe,[Ia]:dt,[ba]:dt};async function MA(o){const{vkFormat:e}=o;if(Hi[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;o.supercompressionScheme===ea&&(Oi||(Oi=new Promise(async a=>{const r=new DA;await r.init(),a(r)})),t=await Oi);const i=[];for(let a=0;a<o.levels.length;a++){const r=Math.max(1,o.pixelWidth>>a),A=Math.max(1,o.pixelHeight>>a),c=o.pixelDepth?Math.max(1,o.pixelDepth>>a):0,l=o.levels[a];let h;if(o.supercompressionScheme===lA)h=l.levelData;else if(o.supercompressionScheme===ea)h=t.decode(l.levelData,l.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let d;Es[e]===pt?d=new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):Es[e]===Xe?d=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):Es[e]===Gn||Es[e]===Un?d=new Uint32Array(h.buffer,h.byteOffset,h.byteLength/Uint32Array.BYTES_PER_ELEMENT):d=h,i.push({data:d,width:r,height:A,depth:c})}const s=o.levelCount===0||i.length>1;let n;if(kA.has(Hi[e]))n=o.pixelDepth===0?new $o(i[0].data,o.pixelWidth,o.pixelHeight):new er(i[0].data,o.pixelWidth,o.pixelHeight,o.pixelDepth),n.minFilter=s?li:Ls,n.magFilter=Ls,n.generateMipmaps=o.levelCount===0;else{if(o.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");n=new ps(i,o.pixelWidth,o.pixelHeight),n.minFilter=s?hs:it,n.magFilter=it}return n.mipmaps=i,n.type=Es[e],n.format=Hi[e],n.colorSpace=Ba(o),n.needsUpdate=!0,Promise.resolve(n)}function Ba(o){const e=o.dataFormatDescriptor[0];return e.colorPrimaries===dA?e.transferFunction===ta?ce:Ve:e.colorPrimaries===pA?e.transferFunction===ta?RA:TA:e.colorPrimaries===gA?Hs:(console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),Hs)}const wa=new ar;wa.camera=new Ps,Et.basic,Et.basic,Et.points,Et.standard,Et.physical,Et.phong;var Cs=function(){var o=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(l){l.preventDefault(),i(++o%e.children.length)},!1);function t(l){return e.appendChild(l.dom),l}function i(l){for(var h=0;h<e.children.length;h++)e.children[h].style.display=h===l?"block":"none";o=l}var s=(performance||Date).now(),n=s,a=0,r=t(new Cs.Panel("FPS","#0ff","#002")),A=t(new Cs.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new Cs.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:e,addPanel:t,showPanel:i,begin:function(){s=(performance||Date).now()},end:function(){a++;var l=(performance||Date).now();if(A.update(l-s,200),l>=n+1e3&&(r.update(a*1e3/(l-n),100),n=l,a=0,c)){var h=performance.memory;c.update(h.usedJSHeapSize/1048576,h.jsHeapSizeLimit/1048576)}return l},update:function(){s=this.end()},domElement:e,setMode:i}};Cs.Panel=function(o,e,t){var i=1/0,s=0,n=Math.round,a=n(window.devicePixelRatio||1),r=80*a,A=48*a,c=3*a,l=2*a,h=3*a,d=15*a,p=74*a,f=30*a,b=document.createElement("canvas");b.width=r,b.height=A,b.style.cssText="width:80px;height:48px";var m=b.getContext("2d");return m.font="bold "+9*a+"px Helvetica,Arial,sans-serif",m.textBaseline="top",m.fillStyle=t,m.fillRect(0,0,r,A),m.fillStyle=e,m.fillText(o,c,l),m.fillRect(h,d,p,f),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(h,d,p,f),{dom:b,update:function(I,E){i=Math.min(i,I),s=Math.max(s,I),m.fillStyle=t,m.globalAlpha=1,m.fillRect(0,0,r,d),m.fillStyle=e,m.fillText(n(I)+" "+o+" ("+n(i)+"-"+n(s)+")",c,l),m.drawImage(b,h+a,d,p-a,f,h,d,p-a,f),m.fillRect(h+p-a,d,a,f),m.fillStyle=t,m.globalAlpha=.9,m.fillRect(h+p-a,d,a,n((1-I/E)*f))}}};class FA extends or{constructor(e,t={}){const i=t.font;if(i===void 0)super();else{const s=i.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(s,t)}this.type="TextGeometry"}}class _A extends xt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=new ht(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(r){const A=n.parse(JSON.parse(r));t&&t(A)},i,s)}parse(e){return new Qa(e)}}class Qa{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],s=LA(e,t,this.data);for(let n=0,a=s.length;n<a;n++)i.push(...s[n].toShapes());return i}}function LA(o,e,t){const i=Array.from(o),s=e/t.resolution,n=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*s,a=[];let r=0,A=0;for(let c=0;c<i.length;c++){const l=i[c];if(l===`
|
|
4
|
-
`)r=0,A-=n;else{const h=NA(l,s,r,A,t);r+=h.offsetX,a.push(h.path)}}return a}function NA(o,e,t,i,s){const n=s.glyphs[o]||s.glyphs["?"];if(!n){console.error('THREE.Font: character "'+o+'" does not exists in font family '+s.familyName+".");return}const a=new rr;let r,A,c,l,h,d,p,f;if(n.o){const b=n._cachedOutline||(n._cachedOutline=n.o.split(" "));for(let m=0,I=b.length;m<I;)switch(b[m++]){case"m":r=b[m++]*e+t,A=b[m++]*e+i,a.moveTo(r,A);break;case"l":r=b[m++]*e+t,A=b[m++]*e+i,a.lineTo(r,A);break;case"q":c=b[m++]*e+t,l=b[m++]*e+i,h=b[m++]*e+t,d=b[m++]*e+i,a.quadraticCurveTo(h,d,c,l);break;case"b":c=b[m++]*e+t,l=b[m++]*e+i,h=b[m++]*e+t,d=b[m++]*e+i,p=b[m++]*e+t,f=b[m++]*e+i,a.bezierCurveTo(h,d,p,f,c,l);break}}return{offsetX:n.ha*e,path:a}}var ve=Uint8Array,nt=Uint16Array,ji=Int32Array,Ys=new ve([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]),Ks=new ve([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]),qi=new ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ya=function(o,e){for(var t=new nt(31),i=0;i<31;++i)t[i]=e+=1<<o[i-1];for(var s=new ji(t[30]),i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)s[n]=n-t[i]<<5|i;return{b:t,r:s}},va=ya(Ys,2),xa=va.b,zi=va.r;xa[28]=258,zi[258]=28;for(var Sa=ya(Ks,0),UA=Sa.b,Da=Sa.r,Yi=new nt(32768),be=0;be<32768;++be){var Pt=(be&43690)>>1|(be&21845)<<1;Pt=(Pt&52428)>>2|(Pt&13107)<<2,Pt=(Pt&61680)>>4|(Pt&3855)<<4,Yi[be]=((Pt&65280)>>8|(Pt&255)<<8)>>1}for(var Ct=function(o,e,t){for(var i=o.length,s=0,n=new nt(e);s<i;++s)o[s]&&++n[o[s]-1];var a=new nt(e);for(s=1;s<e;++s)a[s]=a[s-1]+n[s-1]<<1;var r;if(t){r=new nt(1<<e);var A=15-e;for(s=0;s<i;++s)if(o[s])for(var c=s<<4|o[s],l=e-o[s],h=a[o[s]-1]++<<l,d=h|(1<<l)-1;h<=d;++h)r[Yi[h]>>A]=c}else for(r=new nt(i),s=0;s<i;++s)o[s]&&(r[s]=Yi[a[o[s]-1]++]>>15-o[s]);return r},Ot=new ve(288),be=0;be<144;++be)Ot[be]=8;for(var be=144;be<256;++be)Ot[be]=9;for(var be=256;be<280;++be)Ot[be]=7;for(var be=280;be<288;++be)Ot[be]=8;for(var Bs=new ve(32),be=0;be<32;++be)Bs[be]=5;var GA=Ct(Ot,9,0),PA=Ct(Ot,9,1),OA=Ct(Bs,5,0),HA=Ct(Bs,5,1),Ki=function(o){for(var e=o[0],t=1;t<o.length;++t)o[t]>e&&(e=o[t]);return e},ut=function(o,e,t){var i=e/8|0;return(o[i]|o[i+1]<<8)>>(e&7)&t},Ji=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},Vi=function(o){return(o+7)/8|0},Wi=function(o,e,t){return(t==null||t>o.length)&&(t=o.length),new ve(o.subarray(e,t))},jA=["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"],$e=function(o,e,t){var i=new Error(e||jA[o]);if(i.code=o,Error.captureStackTrace&&Error.captureStackTrace(i,$e),!t)throw i;return i},qA=function(o,e,t,i){var s=o.length,n=0;if(!s||e.f&&!e.l)return t||new ve(0);var a=!t,r=a||e.i!=2,A=e.i;a&&(t=new ve(s*3));var c=function(Me){var Lt=t.length;if(Me>Lt){var ze=new ve(Math.max(Lt*2,Me));ze.set(t),t=ze}},l=e.f||0,h=e.p||0,d=e.b||0,p=e.l,f=e.d,b=e.m,m=e.n,I=s*8;do{if(!p){l=ut(o,h,1);var E=ut(o,h+1,3);if(h+=3,E)if(E==1)p=PA,f=HA,b=9,m=5;else if(E==2){var C=ut(o,h,31)+257,Q=ut(o,h+10,15)+4,w=C+ut(o,h+5,31)+1;h+=14;for(var x=new ve(w),D=new ve(19),S=0;S<Q;++S)D[qi[S]]=ut(o,h+S*3,7);h+=Q*3;for(var F=Ki(D),Y=(1<<F)-1,V=Ct(D,F,1),S=0;S<w;){var K=V[ut(o,h,Y)];h+=K&15;var W=K>>4;if(W<16)x[S++]=W;else{var j=0,X=0;for(W==16?(X=3+ut(o,h,3),h+=2,j=x[S-1]):W==17?(X=3+ut(o,h,7),h+=3):W==18&&(X=11+ut(o,h,127),h+=7);X--;)x[S++]=j}}var J=x.subarray(0,C),ee=x.subarray(C);b=Ki(J),m=Ki(ee),p=Ct(J,b,1),f=Ct(ee,m,1)}else $e(1);else{var W=Vi(h)+4,$=o[W-4]|o[W-3]<<8,ue=W+$;if(ue>s){A&&$e(0);break}r&&c(d+$),t.set(o.subarray(W,ue),d),e.b=d+=$,e.p=h=ue*8,e.f=l;continue}if(h>I){A&&$e(0);break}}r&&c(d+131072);for(var De=(1<<b)-1,se=(1<<m)-1,oe=h;;oe=h){var j=p[Ji(o,h)&De],Ae=j>>4;if(h+=j&15,h>I){A&&$e(0);break}if(j||$e(2),Ae<256)t[d++]=Ae;else if(Ae==256){oe=h,p=null;break}else{var Se=Ae-254;if(Ae>264){var S=Ae-257,fe=Ys[S];Se=ut(o,h,(1<<fe)-1)+xa[S],h+=fe}var qe=f[Ji(o,h)&se],Ft=qe>>4;qe||$e(3),h+=qe&15;var ee=UA[Ft];if(Ft>3){var fe=Ks[Ft];ee+=Ji(o,h)&(1<<fe)-1,h+=fe}if(h>I){A&&$e(0);break}r&&c(d+131072);var _t=d+Se;if(d<ee){var $t=n-ee,Le=Math.min(ee,_t);for($t+d<0&&$e(3);d<Le;++d)t[d]=i[$t+d]}for(;d<_t;++d)t[d]=t[d-ee]}}e.l=p,e.p=oe,e.b=d,e.f=l,p&&(l=1,e.m=b,e.d=f,e.n=m)}while(!l);return d!=t.length&&a?Wi(t,0,d):t.subarray(0,d)},Mt=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8},ws=function(o,e,t){t<<=e&7;var i=e/8|0;o[i]|=t,o[i+1]|=t>>8,o[i+2]|=t>>16},Xi=function(o,e){for(var t=[],i=0;i<o.length;++i)o[i]&&t.push({s:i,f:o[i]});var s=t.length,n=t.slice();if(!s)return{t:Ma,l:0};if(s==1){var a=new ve(t[0].s+1);return a[t[0].s]=1,{t:a,l:1}}t.sort(function(w,x){return w.f-x.f}),t.push({s:-1,f:25001});var r=t[0],A=t[1],c=0,l=1,h=2;for(t[0]={s:-1,f:r.f+A.f,l:r,r:A};l!=s-1;)r=t[t[c].f<t[h].f?c++:h++],A=t[c!=l&&t[c].f<t[h].f?c++:h++],t[l++]={s:-1,f:r.f+A.f,l:r,r:A};for(var d=n[0].s,i=1;i<s;++i)n[i].s>d&&(d=n[i].s);var p=new nt(d+1),f=Zi(t[l-1],p,0);if(f>e){var i=0,b=0,m=f-e,I=1<<m;for(n.sort(function(x,D){return p[D.s]-p[x.s]||x.f-D.f});i<s;++i){var E=n[i].s;if(p[E]>e)b+=I-(1<<f-p[E]),p[E]=e;else break}for(b>>=m;b>0;){var C=n[i].s;p[C]<e?b-=1<<e-p[C]++-1:++i}for(;i>=0&&b;--i){var Q=n[i].s;p[Q]==e&&(--p[Q],++b)}f=e}return{t:new ve(p),l:f}},Zi=function(o,e,t){return o.s==-1?Math.max(Zi(o.l,e,t+1),Zi(o.r,e,t+1)):e[o.s]=t},Ra=function(o){for(var e=o.length;e&&!o[--e];);for(var t=new nt(++e),i=0,s=o[0],n=1,a=function(A){t[i++]=A},r=1;r<=e;++r)if(o[r]==s&&r!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=o[r]}return{c:t.subarray(0,i),n:e}},Qs=function(o,e){for(var t=0,i=0;i<e.length;++i)t+=o[i]*e[i];return t},Ta=function(o,e,t){var i=t.length,s=Vi(e+2);o[s]=i&255,o[s+1]=i>>8,o[s+2]=o[s]^255,o[s+3]=o[s+1]^255;for(var n=0;n<i;++n)o[s+n+4]=t[n];return(s+4+i)*8},ka=function(o,e,t,i,s,n,a,r,A,c,l){Mt(e,l++,t),++s[256];for(var h=Xi(s,15),d=h.t,p=h.l,f=Xi(n,15),b=f.t,m=f.l,I=Ra(d),E=I.c,C=I.n,Q=Ra(b),w=Q.c,x=Q.n,D=new nt(19),S=0;S<E.length;++S)++D[E[S]&31];for(var S=0;S<w.length;++S)++D[w[S]&31];for(var F=Xi(D,7),Y=F.t,V=F.l,K=19;K>4&&!Y[qi[K-1]];--K);var W=c+5<<3,j=Qs(s,Ot)+Qs(n,Bs)+a,X=Qs(s,d)+Qs(n,b)+a+14+3*K+Qs(D,Y)+2*D[16]+3*D[17]+7*D[18];if(A>=0&&W<=j&&W<=X)return Ta(e,l,o.subarray(A,A+c));var J,ee,$,ue;if(Mt(e,l,1+(X<j)),l+=2,X<j){J=Ct(d,p,0),ee=d,$=Ct(b,m,0),ue=b;var De=Ct(Y,V,0);Mt(e,l,C-257),Mt(e,l+5,x-1),Mt(e,l+10,K-4),l+=14;for(var S=0;S<K;++S)Mt(e,l+3*S,Y[qi[S]]);l+=3*K;for(var se=[E,w],oe=0;oe<2;++oe)for(var Ae=se[oe],S=0;S<Ae.length;++S){var Se=Ae[S]&31;Mt(e,l,De[Se]),l+=Y[Se],Se>15&&(Mt(e,l,Ae[S]>>5&127),l+=Ae[S]>>12)}}else J=GA,ee=Ot,$=OA,ue=Bs;for(var S=0;S<r;++S){var fe=i[S];if(fe>255){var Se=fe>>18&31;ws(e,l,J[Se+257]),l+=ee[Se+257],Se>7&&(Mt(e,l,fe>>23&31),l+=Ys[Se]);var qe=fe&31;ws(e,l,$[qe]),l+=ue[qe],qe>3&&(ws(e,l,fe>>5&8191),l+=Ks[qe])}else ws(e,l,J[fe]),l+=ee[fe]}return ws(e,l,J[256]),l+ee[256]},zA=new ji([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ma=new ve(0),YA=function(o,e,t,i,s,n){var a=n.z||o.length,r=new ve(i+a+5*(1+Math.ceil(a/7e3))+s),A=r.subarray(i,r.length-s),c=n.l,l=(n.r||0)&7;if(e){l&&(A[0]=n.r>>3);for(var h=zA[e-1],d=h>>13,p=h&8191,f=(1<<t)-1,b=n.p||new nt(32768),m=n.h||new nt(f+1),I=Math.ceil(t/3),E=2*I,C=function(Ne){return(o[Ne]^o[Ne+1]<<I^o[Ne+2]<<E)&f},Q=new ji(25e3),w=new nt(288),x=new nt(32),D=0,S=0,F=n.i||0,Y=0,V=n.w||0,K=0;F+2<a;++F){var W=C(F),j=F&32767,X=m[W];if(b[j]=X,m[W]=j,V<=F){var J=a-F;if((D>7e3||Y>24576)&&(J>423||!c)){l=ka(o,A,0,Q,w,x,S,Y,K,F-K,l),Y=D=S=0,K=F;for(var ee=0;ee<286;++ee)w[ee]=0;for(var ee=0;ee<30;++ee)x[ee]=0}var $=2,ue=0,De=p,se=j-X&32767;if(J>2&&W==C(F-se))for(var oe=Math.min(d,J)-1,Ae=Math.min(32767,F),Se=Math.min(258,J);se<=Ae&&--De&&j!=X;){if(o[F+$]==o[F+$-se]){for(var fe=0;fe<Se&&o[F+fe]==o[F+fe-se];++fe);if(fe>$){if($=fe,ue=se,fe>oe)break;for(var qe=Math.min(se,fe-2),Ft=0,ee=0;ee<qe;++ee){var _t=F-se+ee&32767,$t=b[_t],Le=_t-$t&32767;Le>Ft&&(Ft=Le,X=_t)}}}j=X,X=b[j],se+=j-X&32767}if(ue){Q[Y++]=268435456|zi[$]<<18|Da[ue];var Me=zi[$]&31,Lt=Da[ue]&31;S+=Ys[Me]+Ks[Lt],++w[257+Me],++x[Lt],V=F+$,++D}else Q[Y++]=o[F],++w[o[F]]}}for(F=Math.max(F,V);F<a;++F)Q[Y++]=o[F],++w[o[F]];l=ka(o,A,c,Q,w,x,S,Y,K,F-K,l),c||(n.r=l&7|A[l/8|0]<<3,l-=7,n.h=m,n.p=b,n.i=F,n.w=V)}else{for(var F=n.w||0;F<a+c;F+=65535){var ze=F+65535;ze>=a&&(A[l/8|0]=c,ze=a),l=Ta(A,l+1,o.subarray(F,ze))}n.i=a}return Wi(r,0,i+Vi(l)+s)},KA=function(){for(var o=new Int32Array(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(t&1&&-306674912)^t>>>1;o[e]=t}return o}(),JA=function(){var o=-1;return{p:function(e){for(var t=o,i=0;i<e.length;++i)t=KA[t&255^e[i]]^t>>>8;o=t},d:function(){return~o}}},VA=function(o,e,t,i,s){if(!s&&(s={l:1},e.dictionary)){var n=e.dictionary.subarray(-32768),a=new ve(n.length+o.length);a.set(n),a.set(o,n.length),o=a,s.w=n.length}return YA(o,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(o.length)))*1.5):20:12+e.mem,t,i,s)},Fa=function(o,e){var t={};for(var i in o)t[i]=o[i];for(var i in e)t[i]=e[i];return t},Ue=function(o,e,t){for(;t;++e)o[e]=t,t>>>=8},WA=function(o,e){return((o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31)&&$e(6,"invalid zlib data"),(o[1]>>5&1)==1&&$e(6,"invalid zlib data: "+(o[1]&32?"need":"unexpected")+" dictionary"),(o[1]>>3&4)+2};function XA(o,e){return VA(o,e||{},0,0)}function ys(o,e){return qA(o.subarray(WA(o),-4),{i:2},e,e)}var _a=function(o,e,t,i){for(var s in o){var n=o[s],a=e+s,r=i;Array.isArray(n)&&(r=Fa(i,n[1]),n=n[0]),n instanceof ve?t[a]=[n,r]:(t[a+="/"]=[new ve(0),r],_a(n,a,t,i))}},La=typeof TextEncoder<"u"&&new TextEncoder,ZA=typeof TextDecoder<"u"&&new TextDecoder,$A=0;try{ZA.decode(Ma,{stream:!0}),$A=1}catch{}function $i(o,e){var t;if(La)return La.encode(o);for(var i=o.length,s=new ve(o.length+(o.length>>1)),n=0,a=function(l){s[n++]=l},t=0;t<i;++t){if(n+5>s.length){var r=new ve(n+8+(i-t<<1));r.set(s),s=r}var A=o.charCodeAt(t);A<128||e?a(A):A<2048?(a(192|A>>6),a(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|o.charCodeAt(++t)&1023,a(240|A>>18),a(128|A>>12&63),a(128|A>>6&63),a(128|A&63)):(a(224|A>>12),a(128|A>>6&63),a(128|A&63))}return Wi(s,0,n)}var en=function(o){var e=0;if(o)for(var t in o){var i=o[t].length;i>65535&&$e(9),e+=i+4}return e},Na=function(o,e,t,i,s,n,a,r){var A=i.length,c=t.extra,l=r&&r.length,h=en(c);Ue(o,e,a!=null?33639248:67324752),e+=4,a!=null&&(o[e++]=20,o[e++]=t.os),o[e]=20,e+=2,o[e++]=t.flag<<1|(n<0&&8),o[e++]=s&&8,o[e++]=t.compression&255,o[e++]=t.compression>>8;var d=new Date(t.mtime==null?Date.now():t.mtime),p=d.getFullYear()-1980;if((p<0||p>119)&&$e(10),Ue(o,e,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),e+=4,n!=-1&&(Ue(o,e,t.crc),Ue(o,e+4,n<0?-n-2:n),Ue(o,e+8,t.size)),Ue(o,e+12,A),Ue(o,e+14,h),e+=16,a!=null&&(Ue(o,e,l),Ue(o,e+6,t.attrs),Ue(o,e+10,a),e+=14),o.set(i,e),e+=A,h)for(var f in c){var b=c[f],m=b.length;Ue(o,e,+f),Ue(o,e+2,m),o.set(b,e+4),e+=4+m}return l&&(o.set(r,e),e+=l),e},ec=function(o,e,t,i,s){Ue(o,e,101010256),Ue(o,e+8,t),Ue(o,e+10,t),Ue(o,e+12,i),Ue(o,e+16,s)};function tc(o,e){e||(e={});var t={},i=[];_a(o,"",t,e);var s=0,n=0;for(var a in t){var r=t[a],A=r[0],c=r[1],l=c.level==0?0:8,h=$i(a),d=h.length,p=c.comment,f=p&&$i(p),b=f&&f.length,m=en(c.extra);d>65535&&$e(11);var I=l?XA(A,c):A,E=I.length,C=JA();C.p(A),i.push(Fa(c,{size:A.length,crc:C.d(),c:I,f:h,m:f,u:d!=a.length||f&&p.length!=b,o:s,compression:l})),s+=30+d+m+E,n+=76+2*(d+m)+(b||0)+E}for(var Q=new ve(n+22),w=s,x=n-s,D=0;D<i.length;++D){var h=i[D];Na(Q,h.o,h,h.f,h.u,h.c.length);var S=30+h.f.length+en(h.extra);Q.set(h.c,h.o+S),Na(Q,s,h,h.f,h.u,h.c.length,h.o,h.m),s+=16+S+(h.m?h.m.length:0)}return ec(Q,s,i.length,x,w),Q}class sc extends Pn{constructor(e){super(e),this.type=Xe}parse(e){const t=Math.pow(2.7182818,2.2);function i(g,u){let B=0;for(let R=0;R<65536;++R)(R==0||g[R>>3]&1<<(R&7))&&(u[B++]=R);const y=B-1;for(;B<65536;)u[B++]=0;return y}function s(g){for(let u=0;u<16384;u++)g[u]={},g[u].len=0,g[u].lit=0,g[u].p=null}const n={l:0,c:0,lc:0};function a(g,u,B,y,R){for(;B<g;)u=u<<8|Lt(y,R),B+=8;B-=g,n.l=u>>B&(1<<g)-1,n.c=u,n.lc=B}const r=new Array(59);function A(g){for(let B=0;B<=58;++B)r[B]=0;for(let B=0;B<65537;++B)r[g[B]]+=1;let u=0;for(let B=58;B>0;--B){const y=u+r[B]>>1;r[B]=u,u=y}for(let B=0;B<65537;++B){const y=g[B];y>0&&(g[B]=y|r[y]++<<6)}}function c(g,u,B,y,R,v){const M=u;let L=0,_=0;for(;y<=R;y++){if(M.value-u.value>B)return!1;a(6,L,_,g,M);const k=n.l;if(L=n.c,_=n.lc,v[y]=k,k==63){if(M.value-u.value>B)throw new Error("Something wrong with hufUnpackEncTable");a(8,L,_,g,M);let T=n.l+6;if(L=n.c,_=n.lc,y+T>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;T--;)v[y++]=0;y--}else if(k>=59){let T=k-59+2;if(y+T>R+1)throw new Error("Something wrong with hufUnpackEncTable");for(;T--;)v[y++]=0;y--}}A(v)}function l(g){return g&63}function h(g){return g>>6}function d(g,u,B,y){for(;u<=B;u++){const R=h(g[u]),v=l(g[u]);if(R>>v)throw new Error("Invalid table entry");if(v>14){const M=y[R>>v-14];if(M.len)throw new Error("Invalid table entry");if(M.lit++,M.p){const L=M.p;M.p=new Array(M.lit);for(let _=0;_<M.lit-1;++_)M.p[_]=L[_]}else M.p=new Array(1);M.p[M.lit-1]=u}else if(v){let M=0;for(let L=1<<14-v;L>0;L--){const _=y[(R<<14-v)+M];if(_.len||_.p)throw new Error("Invalid table entry");_.len=v,_.lit=u,M++}}}return!0}const p={c:0,lc:0};function f(g,u,B,y){g=g<<8|Lt(B,y),u+=8,p.c=g,p.lc=u}const b={c:0,lc:0};function m(g,u,B,y,R,v,M,L,_){if(g==u){y<8&&(f(B,y,R,v),B=p.c,y=p.lc),y-=8;let k=B>>y;if(k=new Uint8Array([k])[0],L.value+k>_)return!1;const T=M[L.value-1];for(;k-- >0;)M[L.value++]=T}else if(L.value<_)M[L.value++]=g;else return!1;b.c=B,b.lc=y}function I(g){return g&65535}function E(g){const u=I(g);return u>32767?u-65536:u}const C={a:0,b:0};function Q(g,u){const B=E(g),y=E(u),R=B+(y&1)+(y>>1),v=R,M=R-y;C.a=v,C.b=M}function w(g,u){const B=I(g),y=I(u),R=B-(y>>1)&65535,v=y+R-32768&65535;C.a=v,C.b=R}function x(g,u,B,y,R,v,M){const L=M<16384,_=B>R?R:B;let k=1,T,G;for(;k<=_;)k<<=1;for(k>>=1,T=k,k>>=1;k>=1;){G=0;const U=G+v*(R-T),q=v*k,Z=v*T,P=y*k,z=y*T;let te,Ie,ye,tt;for(;G<=U;G+=Z){let me=G;const re=G+y*(B-T);for(;me<=re;me+=z){const Re=me+P,ot=me+q,Fe=ot+P;L?(Q(g[me+u],g[ot+u]),te=C.a,ye=C.b,Q(g[Re+u],g[Fe+u]),Ie=C.a,tt=C.b,Q(te,Ie),g[me+u]=C.a,g[Re+u]=C.b,Q(ye,tt),g[ot+u]=C.a,g[Fe+u]=C.b):(w(g[me+u],g[ot+u]),te=C.a,ye=C.b,w(g[Re+u],g[Fe+u]),Ie=C.a,tt=C.b,w(te,Ie),g[me+u]=C.a,g[Re+u]=C.b,w(ye,tt),g[ot+u]=C.a,g[Fe+u]=C.b)}if(B&k){const Re=me+q;L?Q(g[me+u],g[Re+u]):w(g[me+u],g[Re+u]),te=C.a,g[Re+u]=C.b,g[me+u]=te}}if(R&k){let me=G;const re=G+y*(B-T);for(;me<=re;me+=z){const Re=me+P;L?Q(g[me+u],g[Re+u]):w(g[me+u],g[Re+u]),te=C.a,g[Re+u]=C.b,g[me+u]=te}}T=k,k>>=1}return G}function D(g,u,B,y,R,v,M,L,_){let k=0,T=0;const G=M,U=Math.trunc(y.value+(R+7)/8);for(;y.value<U;)for(f(k,T,B,y),k=p.c,T=p.lc;T>=14;){const Z=k>>T-14&16383,P=u[Z];if(P.len)T-=P.len,m(P.lit,v,k,T,B,y,L,_,G),k=b.c,T=b.lc;else{if(!P.p)throw new Error("hufDecode issues");let z;for(z=0;z<P.lit;z++){const te=l(g[P.p[z]]);for(;T<te&&y.value<U;)f(k,T,B,y),k=p.c,T=p.lc;if(T>=te&&h(g[P.p[z]])==(k>>T-te&(1<<te)-1)){T-=te,m(P.p[z],v,k,T,B,y,L,_,G),k=b.c,T=b.lc;break}}if(z==P.lit)throw new Error("hufDecode issues")}}const q=8-R&7;for(k>>=q,T-=q;T>0;){const Z=u[k<<14-T&16383];if(Z.len)T-=Z.len,m(Z.lit,v,k,T,B,y,L,_,G),k=b.c,T=b.lc;else throw new Error("hufDecode issues")}return!0}function S(g,u,B,y,R,v){const M={value:0},L=B.value,_=Me(u,B),k=Me(u,B);B.value+=4;const T=Me(u,B);if(B.value+=4,_<0||_>=65537||k<0||k>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const G=new Array(65537),U=new Array(16384);s(U);const q=y-(B.value-L);if(c(g,B,q,_,k,G),T>8*(y-(B.value-L)))throw new Error("Something wrong with hufUncompress");d(G,_,k,U),D(G,U,g,B,T,k,v,R,M)}function F(g,u,B){for(let y=0;y<B;++y)u[y]=g[u[y]]}function Y(g){for(let u=1;u<g.length;u++){const B=g[u-1]+g[u]-128;g[u]=B}}function V(g,u){let B=0,y=Math.floor((g.length+1)/2),R=0;const v=g.length-1;for(;!(R>v||(u[R++]=g[B++],R>v));)u[R++]=g[y++]}function K(g){let u=g.byteLength;const B=new Array;let y=0;const R=new DataView(g);for(;u>0;){const v=R.getInt8(y++);if(v<0){const M=-v;u-=M+1;for(let L=0;L<M;L++)B.push(R.getUint8(y++))}else{const M=v;u-=2;const L=R.getUint8(y++);for(let _=0;_<M+1;_++)B.push(L)}}return B}function W(g,u,B,y,R,v){let M=new DataView(v.buffer);const L=B[g.idx[0]].width,_=B[g.idx[0]].height,k=3,T=Math.floor(L/8),G=Math.ceil(L/8),U=Math.ceil(_/8),q=L-(G-1)*8,Z=_-(U-1)*8,P={value:0},z=new Array(k),te=new Array(k),Ie=new Array(k),ye=new Array(k),tt=new Array(k);for(let re=0;re<k;++re)tt[re]=u[g.idx[re]],z[re]=re<1?0:z[re-1]+G*U,te[re]=new Float32Array(64),Ie[re]=new Uint16Array(64),ye[re]=new Uint16Array(G*64);for(let re=0;re<U;++re){let Re=8;re==U-1&&(Re=Z);let ot=8;for(let ge=0;ge<G;++ge){ge==G-1&&(ot=q);for(let pe=0;pe<k;++pe)Ie[pe].fill(0),Ie[pe][0]=R[z[pe]++],j(P,y,Ie[pe]),X(Ie[pe],te[pe]),J(te[pe]);ee(te);for(let pe=0;pe<k;++pe)$(te[pe],ye[pe],ge*64)}let Fe=0;for(let ge=0;ge<k;++ge){const pe=B[g.idx[ge]].type;for(let vt=8*re;vt<8*re+Re;++vt){Fe=tt[ge][vt];for(let ls=0;ls<T;++ls){const ft=ls*64+(vt&7)*8;M.setUint16(Fe+0*pe,ye[ge][ft+0],!0),M.setUint16(Fe+2*pe,ye[ge][ft+1],!0),M.setUint16(Fe+4*pe,ye[ge][ft+2],!0),M.setUint16(Fe+6*pe,ye[ge][ft+3],!0),M.setUint16(Fe+8*pe,ye[ge][ft+4],!0),M.setUint16(Fe+10*pe,ye[ge][ft+5],!0),M.setUint16(Fe+12*pe,ye[ge][ft+6],!0),M.setUint16(Fe+14*pe,ye[ge][ft+7],!0),Fe+=16*pe}}if(T!=G)for(let vt=8*re;vt<8*re+Re;++vt){const ls=tt[ge][vt]+8*T*2*pe,ft=T*64+(vt&7)*8;for(let _s=0;_s<ot;++_s)M.setUint16(ls+_s*2*pe,ye[ge][ft+_s],!0)}}}const me=new Uint16Array(L);M=new DataView(v.buffer);for(let re=0;re<k;++re){B[g.idx[re]].decoded=!0;const Re=B[g.idx[re]].type;if(B[re].type==2)for(let ot=0;ot<_;++ot){const Fe=tt[re][ot];for(let ge=0;ge<L;++ge)me[ge]=M.getUint16(Fe+ge*2*Re,!0);for(let ge=0;ge<L;++ge)M.setFloat32(Fe+ge*2*Re,H(me[ge]),!0)}}}function j(g,u,B){let y,R=1;for(;R<64;)y=u[g.value],y==65280?R=64:y>>8==255?R+=y&255:(B[R]=y,R++),g.value++}function X(g,u){u[0]=H(g[0]),u[1]=H(g[1]),u[2]=H(g[5]),u[3]=H(g[6]),u[4]=H(g[14]),u[5]=H(g[15]),u[6]=H(g[27]),u[7]=H(g[28]),u[8]=H(g[2]),u[9]=H(g[4]),u[10]=H(g[7]),u[11]=H(g[13]),u[12]=H(g[16]),u[13]=H(g[26]),u[14]=H(g[29]),u[15]=H(g[42]),u[16]=H(g[3]),u[17]=H(g[8]),u[18]=H(g[12]),u[19]=H(g[17]),u[20]=H(g[25]),u[21]=H(g[30]),u[22]=H(g[41]),u[23]=H(g[43]),u[24]=H(g[9]),u[25]=H(g[11]),u[26]=H(g[18]),u[27]=H(g[24]),u[28]=H(g[31]),u[29]=H(g[40]),u[30]=H(g[44]),u[31]=H(g[53]),u[32]=H(g[10]),u[33]=H(g[19]),u[34]=H(g[23]),u[35]=H(g[32]),u[36]=H(g[39]),u[37]=H(g[45]),u[38]=H(g[52]),u[39]=H(g[54]),u[40]=H(g[20]),u[41]=H(g[22]),u[42]=H(g[33]),u[43]=H(g[38]),u[44]=H(g[46]),u[45]=H(g[51]),u[46]=H(g[55]),u[47]=H(g[60]),u[48]=H(g[21]),u[49]=H(g[34]),u[50]=H(g[37]),u[51]=H(g[47]),u[52]=H(g[50]),u[53]=H(g[56]),u[54]=H(g[59]),u[55]=H(g[61]),u[56]=H(g[35]),u[57]=H(g[36]),u[58]=H(g[48]),u[59]=H(g[49]),u[60]=H(g[57]),u[61]=H(g[58]),u[62]=H(g[62]),u[63]=H(g[63])}function J(g){const u=.5*Math.cos(.7853975),B=.5*Math.cos(3.14159/16),y=.5*Math.cos(3.14159/8),R=.5*Math.cos(3*3.14159/16),v=.5*Math.cos(5*3.14159/16),M=.5*Math.cos(3*3.14159/8),L=.5*Math.cos(7*3.14159/16),_=new Array(4),k=new Array(4),T=new Array(4),G=new Array(4);for(let U=0;U<8;++U){const q=U*8;_[0]=y*g[q+2],_[1]=M*g[q+2],_[2]=y*g[q+6],_[3]=M*g[q+6],k[0]=B*g[q+1]+R*g[q+3]+v*g[q+5]+L*g[q+7],k[1]=R*g[q+1]-L*g[q+3]-B*g[q+5]-v*g[q+7],k[2]=v*g[q+1]-B*g[q+3]+L*g[q+5]+R*g[q+7],k[3]=L*g[q+1]-v*g[q+3]+R*g[q+5]-B*g[q+7],T[0]=u*(g[q+0]+g[q+4]),T[3]=u*(g[q+0]-g[q+4]),T[1]=_[0]+_[3],T[2]=_[1]-_[2],G[0]=T[0]+T[1],G[1]=T[3]+T[2],G[2]=T[3]-T[2],G[3]=T[0]-T[1],g[q+0]=G[0]+k[0],g[q+1]=G[1]+k[1],g[q+2]=G[2]+k[2],g[q+3]=G[3]+k[3],g[q+4]=G[3]-k[3],g[q+5]=G[2]-k[2],g[q+6]=G[1]-k[1],g[q+7]=G[0]-k[0]}for(let U=0;U<8;++U)_[0]=y*g[16+U],_[1]=M*g[16+U],_[2]=y*g[48+U],_[3]=M*g[48+U],k[0]=B*g[8+U]+R*g[24+U]+v*g[40+U]+L*g[56+U],k[1]=R*g[8+U]-L*g[24+U]-B*g[40+U]-v*g[56+U],k[2]=v*g[8+U]-B*g[24+U]+L*g[40+U]+R*g[56+U],k[3]=L*g[8+U]-v*g[24+U]+R*g[40+U]-B*g[56+U],T[0]=u*(g[U]+g[32+U]),T[3]=u*(g[U]-g[32+U]),T[1]=_[0]+_[3],T[2]=_[1]-_[2],G[0]=T[0]+T[1],G[1]=T[3]+T[2],G[2]=T[3]-T[2],G[3]=T[0]-T[1],g[0+U]=G[0]+k[0],g[8+U]=G[1]+k[1],g[16+U]=G[2]+k[2],g[24+U]=G[3]+k[3],g[32+U]=G[3]-k[3],g[40+U]=G[2]-k[2],g[48+U]=G[1]-k[1],g[56+U]=G[0]-k[0]}function ee(g){for(let u=0;u<64;++u){const B=g[0][u],y=g[1][u],R=g[2][u];g[0][u]=B+1.5747*R,g[1][u]=B-.1873*y-.4682*R,g[2][u]=B+1.8556*y}}function $(g,u,B){for(let y=0;y<64;++y)u[B+y]=ss.toHalfFloat(ue(g[y]))}function ue(g){return g<=1?Math.sign(g)*Math.pow(Math.abs(g),2.2):Math.sign(g)*Math.pow(t,Math.abs(g)-1)}function De(g){return new DataView(g.array.buffer,g.offset.value,g.size)}function se(g){const u=g.viewer.buffer.slice(g.offset.value,g.offset.value+g.size),B=new Uint8Array(K(u)),y=new Uint8Array(B.length);return Y(B),V(B,y),new DataView(y.buffer)}function oe(g){const u=g.array.slice(g.offset.value,g.offset.value+g.size),B=ys(u),y=new Uint8Array(B.length);return Y(B),V(B,y),new DataView(y.buffer)}function Ae(g){const u=g.viewer,B={value:g.offset.value},y=new Uint16Array(g.columns*g.lines*(g.inputChannels.length*g.type)),R=new Uint8Array(8192);let v=0;const M=new Array(g.inputChannels.length);for(let Z=0,P=g.inputChannels.length;Z<P;Z++)M[Z]={},M[Z].start=v,M[Z].end=M[Z].start,M[Z].nx=g.columns,M[Z].ny=g.lines,M[Z].size=g.type,v+=M[Z].nx*M[Z].ny*M[Z].size;const L=cs(u,B),_=cs(u,B);if(_>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(L<=_)for(let Z=0;Z<_-L+1;Z++)R[Z+L]=ze(u,B);const k=new Uint16Array(65536),T=i(R,k),G=Me(u,B);S(g.array,u,B,G,y,v);for(let Z=0;Z<g.inputChannels.length;++Z){const P=M[Z];for(let z=0;z<M[Z].size;++z)x(y,P.start+z,P.nx,P.size,P.ny,P.nx*P.size,T)}F(k,y,v);let U=0;const q=new Uint8Array(y.buffer.byteLength);for(let Z=0;Z<g.lines;Z++)for(let P=0;P<g.inputChannels.length;P++){const z=M[P],te=z.nx*z.size,Ie=new Uint8Array(y.buffer,z.end*2,te*2);q.set(Ie,U),U+=te*2,z.end+=te}return new DataView(q.buffer)}function Se(g){const u=g.array.slice(g.offset.value,g.offset.value+g.size),B=ys(u),y=g.inputChannels.length*g.lines*g.columns*g.totalBytes,R=new ArrayBuffer(y),v=new DataView(R);let M=0,L=0;const _=new Array(4);for(let k=0;k<g.lines;k++)for(let T=0;T<g.inputChannels.length;T++){let G=0;switch(g.inputChannels[T].pixelType){case 1:_[0]=M,_[1]=_[0]+g.columns,M=_[1]+g.columns;for(let U=0;U<g.columns;++U){const q=B[_[0]++]<<8|B[_[1]++];G+=q,v.setUint16(L,G,!0),L+=2}break;case 2:_[0]=M,_[1]=_[0]+g.columns,_[2]=_[1]+g.columns,M=_[2]+g.columns;for(let U=0;U<g.columns;++U){const q=B[_[0]++]<<24|B[_[1]++]<<16|B[_[2]++]<<8;G+=q,v.setUint32(L,G,!0),L+=4}break}}return v}function fe(g){const u=g.viewer,B={value:g.offset.value},y=new Uint8Array(g.columns*g.lines*(g.inputChannels.length*g.type*2)),R={version:Ne(u,B),unknownUncompressedSize:Ne(u,B),unknownCompressedSize:Ne(u,B),acCompressedSize:Ne(u,B),dcCompressedSize:Ne(u,B),rleCompressedSize:Ne(u,B),rleUncompressedSize:Ne(u,B),rleRawSize:Ne(u,B),totalAcUncompressedCount:Ne(u,B),totalDcUncompressedCount:Ne(u,B),acCompression:Ne(u,B)};if(R.version<2)throw new Error("EXRLoader.parse: "+jt.compression+" version "+R.version+" is unsupported");const v=new Array;let M=cs(u,B)-2;for(;M>0;){const P=qe(u.buffer,B),z=ze(u,B),te=z>>2&3,Ie=(z>>4)-1,ye=new Int8Array([Ie])[0],tt=ze(u,B);v.push({name:P,index:ye,type:tt,compression:te}),M-=P.length+3}const L=jt.channels,_=new Array(g.inputChannels.length);for(let P=0;P<g.inputChannels.length;++P){const z=_[P]={},te=L[P];z.name=te.name,z.compression=0,z.decoded=!1,z.type=te.pixelType,z.pLinear=te.pLinear,z.width=g.columns,z.height=g.lines}const k={idx:new Array(3)};for(let P=0;P<g.inputChannels.length;++P){const z=_[P];for(let te=0;te<v.length;++te){const Ie=v[te];z.name==Ie.name&&(z.compression=Ie.compression,Ie.index>=0&&(k.idx[Ie.index]=P),z.offset=P)}}let T,G,U;if(R.acCompressedSize>0)switch(R.acCompression){case 0:T=new Uint16Array(R.totalAcUncompressedCount),S(g.array,u,B,R.acCompressedSize,T,R.totalAcUncompressedCount);break;case 1:const P=g.array.slice(B.value,B.value+R.totalAcUncompressedCount),z=ys(P);T=new Uint16Array(z.buffer),B.value+=R.totalAcUncompressedCount;break}if(R.dcCompressedSize>0){const P={array:g.array,offset:B,size:R.dcCompressedSize};G=new Uint16Array(oe(P).buffer),B.value+=R.dcCompressedSize}if(R.rleRawSize>0){const P=g.array.slice(B.value,B.value+R.rleCompressedSize),z=ys(P);U=K(z.buffer),B.value+=R.rleCompressedSize}let q=0;const Z=new Array(_.length);for(let P=0;P<Z.length;++P)Z[P]=new Array;for(let P=0;P<g.lines;++P)for(let z=0;z<_.length;++z)Z[z].push(q),q+=_[z].width*g.type*2;W(k,Z,_,T,G,y);for(let P=0;P<_.length;++P){const z=_[P];if(!z.decoded)switch(z.compression){case 2:let te=0,Ie=0;for(let ye=0;ye<g.lines;++ye){let tt=Z[P][te];for(let me=0;me<z.width;++me){for(let re=0;re<2*z.type;++re)y[tt++]=U[Ie+re*z.width*z.height];Ie++}te++}break;default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(y.buffer)}function qe(g,u){const B=new Uint8Array(g);let y=0;for(;B[u.value+y]!=0;)y+=1;const R=new TextDecoder().decode(B.slice(u.value,u.value+y));return u.value=u.value+y+1,R}function Ft(g,u,B){const y=new TextDecoder().decode(new Uint8Array(g).slice(u.value,u.value+B));return u.value=u.value+B,y}function _t(g,u){const B=Le(g,u),y=Me(g,u);return[B,y]}function $t(g,u){const B=Me(g,u),y=Me(g,u);return[B,y]}function Le(g,u){const B=g.getInt32(u.value,!0);return u.value=u.value+4,B}function Me(g,u){const B=g.getUint32(u.value,!0);return u.value=u.value+4,B}function Lt(g,u){const B=g[u.value];return u.value=u.value+1,B}function ze(g,u){const B=g.getUint8(u.value);return u.value=u.value+1,B}const Ne=function(g,u){let B;return"getBigInt64"in DataView.prototype?B=Number(g.getBigInt64(u.value,!0)):B=g.getUint32(u.value+4,!0)+Number(g.getUint32(u.value,!0)<<32),u.value+=8,B};function He(g,u){const B=g.getFloat32(u.value,!0);return u.value+=4,B}function yo(g,u){return ss.toHalfFloat(He(g,u))}function H(g){const u=(g&31744)>>10,B=g&1023;return(g>>15?-1:1)*(u?u===31?B?NaN:1/0:Math.pow(2,u-15)*(1+B/1024):6103515625e-14*(B/1024))}function cs(g,u){const B=g.getUint16(u.value,!0);return u.value+=2,B}function vo(g,u){return H(cs(g,u))}function xo(g,u,B,y){const R=B.value,v=[];for(;B.value<R+y-1;){const M=qe(u,B),L=Le(g,B),_=ze(g,B);B.value+=3;const k=Le(g,B),T=Le(g,B);v.push({name:M,pixelType:L,pLinear:_,xSampling:k,ySampling:T})}return B.value+=1,v}function So(g,u){const B=He(g,u),y=He(g,u),R=He(g,u),v=He(g,u),M=He(g,u),L=He(g,u),_=He(g,u),k=He(g,u);return{redX:B,redY:y,greenX:R,greenY:v,blueX:M,blueY:L,whiteX:_,whiteY:k}}function Do(g,u){const B=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],y=ze(g,u);return B[y]}function Ro(g,u){const B=Le(g,u),y=Le(g,u),R=Le(g,u),v=Le(g,u);return{xMin:B,yMin:y,xMax:R,yMax:v}}function To(g,u){const B=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],y=ze(g,u);return B[y]}function ko(g,u){const B=["ENVMAP_LATLONG","ENVMAP_CUBE"],y=ze(g,u);return B[y]}function Mo(g,u){const B=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],y=["ROUND_DOWN","ROUND_UP"],R=Me(g,u),v=Me(g,u),M=ze(g,u);return{xSize:R,ySize:v,levelMode:B[M&15],roundingMode:y[M>>4]}}function Fo(g,u){const B=He(g,u),y=He(g,u);return[B,y]}function _o(g,u){const B=He(g,u),y=He(g,u),R=He(g,u);return[B,y,R]}function Lo(g,u,B,y,R){if(y==="string"||y==="stringvector"||y==="iccProfile")return Ft(u,B,R);if(y==="chlist")return xo(g,u,B,R);if(y==="chromaticities")return So(g,B);if(y==="compression")return Do(g,B);if(y==="box2i")return Ro(g,B);if(y==="envmap")return ko(g,B);if(y==="tiledesc")return Mo(g,B);if(y==="lineOrder")return To(g,B);if(y==="float")return He(g,B);if(y==="v2f")return Fo(g,B);if(y==="v3f")return _o(g,B);if(y==="int")return Le(g,B);if(y==="rational")return _t(g,B);if(y==="timecode")return $t(g,B);if(y==="preview")return B.value+=R,"skipped";B.value+=R}function No(g,u){const B=Math.log2(g);return u=="ROUND_DOWN"?Math.floor(B):Math.ceil(B)}function Uo(g,u,B){let y=0;switch(g.levelMode){case"ONE_LEVEL":y=1;break;case"MIPMAP_LEVELS":y=No(Math.max(u,B),g.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return y}function bn(g,u,B,y){const R=new Array(g);for(let v=0;v<g;v++){const M=1<<v;let L=u/M|0;y=="ROUND_UP"&&L*M<u&&(L+=1);const _=Math.max(L,1);R[v]=(_+B-1)/B|0}return R}function Go(){const g=this,u=g.offset,B={value:0};for(let y=0;y<g.tileCount;y++){const R=Le(g.viewer,u),v=Le(g.viewer,u);u.value+=8,g.size=Me(g.viewer,u);const M=R*g.blockWidth,L=v*g.blockHeight;g.columns=M+g.blockWidth>g.width?g.width-M:g.blockWidth,g.lines=L+g.blockHeight>g.height?g.height-L:g.blockHeight;const _=g.columns*g.totalBytes,k=g.size<g.lines*_?g.uncompress(g):De(g);u.value+=g.size;for(let T=0;T<g.lines;T++){const G=T*g.columns*g.totalBytes;for(let U=0;U<g.inputChannels.length;U++){const q=jt.channels[U].name,Z=g.channelByteOffsets[q]*g.columns,P=g.decodeChannels[q];if(P===void 0)continue;B.value=G+Z;const z=(g.height-(1+L+T))*g.outLineWidth;for(let te=0;te<g.columns;te++){const Ie=z+(te+M)*g.outputChannels+P;g.byteArray[Ie]=g.getter(k,B)}}}}}function Po(){const g=this,u=g.offset,B={value:0};for(let y=0;y<g.height/g.blockHeight;y++){const R=Le(g.viewer,u)-jt.dataWindow.yMin;g.size=Me(g.viewer,u),g.lines=R+g.blockHeight>g.height?g.height-R:g.blockHeight;const v=g.columns*g.totalBytes,M=g.size<g.lines*v?g.uncompress(g):De(g);u.value+=g.size;for(let L=0;L<g.blockHeight;L++){const _=y*g.blockHeight,k=L+g.scanOrder(_);if(k>=g.height)continue;const T=L*v,G=(g.height-1-k)*g.outLineWidth;for(let U=0;U<g.inputChannels.length;U++){const q=jt.channels[U].name,Z=g.channelByteOffsets[q]*g.columns,P=g.decodeChannels[q];if(P!==void 0){B.value=T+Z;for(let z=0;z<g.columns;z++){const te=G+z*g.outputChannels+P;g.byteArray[te]=g.getter(M,B)}}}}}}function Oo(g,u,B){const y={};if(g.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");y.version=g.getUint8(4);const R=g.getUint8(5);y.spec={singleTile:!!(R&2),longName:!!(R&4),deepFormat:!!(R&8),multiPart:!!(R&16)},B.value=8;let v=!0;for(;v;){const M=qe(u,B);if(M==0)v=!1;else{const L=qe(u,B),_=Me(g,B),k=Lo(g,u,B,L,_);k===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${L}'.`):y[M]=k}}if((R&-7)!=0)throw console.error("THREE.EXRHeader:",y),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return y}function Ho(g,u,B,y,R){const v={size:0,viewer:u,array:B,offset:y,width:g.dataWindow.xMax-g.dataWindow.xMin+1,height:g.dataWindow.yMax-g.dataWindow.yMin+1,inputChannels:g.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:Ve};switch(g.compression){case"NO_COMPRESSION":v.blockHeight=1,v.uncompress=De;break;case"RLE_COMPRESSION":v.blockHeight=1,v.uncompress=se;break;case"ZIPS_COMPRESSION":v.blockHeight=1,v.uncompress=oe;break;case"ZIP_COMPRESSION":v.blockHeight=16,v.uncompress=oe;break;case"PIZ_COMPRESSION":v.blockHeight=32,v.uncompress=Ae;break;case"PXR24_COMPRESSION":v.blockHeight=16,v.uncompress=Se;break;case"DWAA_COMPRESSION":v.blockHeight=32,v.uncompress=fe;break;case"DWAB_COMPRESSION":v.blockHeight=256,v.uncompress=fe;break;default:throw new Error("EXRLoader.parse: "+g.compression+" is unsupported")}const M={};for(const T of g.channels)switch(T.name){case"Y":case"R":case"G":case"B":case"A":M[T.name]=!0,v.type=T.pixelType}let L=!1;if(M.R&&M.G&&M.B)L=!M.A,v.outputChannels=4,v.decodeChannels={R:0,G:1,B:2,A:3};else if(M.Y)v.outputChannels=1,v.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(v.type==1)switch(R){case pt:v.getter=vo;break;case Xe:v.getter=cs;break}else if(v.type==2)switch(R){case pt:v.getter=He;break;case Xe:v.getter=yo}else throw new Error("EXRLoader.parse: unsupported pixelType "+v.type+" for "+g.compression+".");v.columns=v.width;const _=v.width*v.height*v.outputChannels;switch(R){case pt:v.byteArray=new Float32Array(_),L&&v.byteArray.fill(1,0,_);break;case Xe:v.byteArray=new Uint16Array(_),L&&v.byteArray.fill(15360,0,_);break;default:console.error("THREE.EXRLoader: unsupported type: ",R);break}let k=0;for(const T of g.channels)v.decodeChannels[T.name]!==void 0&&(v.channelByteOffsets[T.name]=k),k+=T.pixelType*2;if(v.totalBytes=k,v.outLineWidth=v.width*v.outputChannels,g.lineOrder==="INCREASING_Y"?v.scanOrder=T=>T:v.scanOrder=T=>v.height-1-T,v.outputChannels==4?(v.format=Nt,v.colorSpace=Ve):(v.format=ts,v.colorSpace=Hs),g.spec.singleTile){v.blockHeight=g.tiles.ySize,v.blockWidth=g.tiles.xSize;const T=Uo(g.tiles,v.width,v.height),G=bn(T,v.width,g.tiles.xSize,g.tiles.roundingMode),U=bn(T,v.height,g.tiles.ySize,g.tiles.roundingMode);v.tileCount=G[0]*U[0];for(let q=0;q<T;q++)for(let Z=0;Z<U[q];Z++)for(let P=0;P<G[q];P++)Ne(u,y);v.decode=Go.bind(v)}else{v.blockWidth=v.width;const T=Math.ceil(v.height/v.blockHeight);for(let G=0;G<T;G++)Ne(u,y);v.decode=Po.bind(v)}return v}const In={value:0},En=new DataView(e),jo=new Uint8Array(e),jt=Oo(En,e,In),es=Ho(jt,En,jo,In,this.type);return es.decode(),{header:jt,width:es.width,height:es.height,data:es.byteArray,format:es.format,colorSpace:es.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,i,s){function n(a,r){a.colorSpace=r.colorSpace,a.minFilter=it,a.magFilter=it,a.generateMipmaps=!1,a.flipY=!1,t&&t(a,r)}return super.load(e,n,i,s)}}class ic extends Pn{constructor(e){super(e),this.type=Xe}parse(e){const t=function(m,I){switch(m){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(I||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(I||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(I||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(I||""))}},i=function(m,I,E){I=I||1024;let C=m.pos,Q=-1,w=0,x="",D=String.fromCharCode.apply(null,new Uint16Array(m.subarray(C,C+128)));for(;0>(Q=D.indexOf(`
|
|
5
|
-
`))&&w<I&&
|
|
6
|
-
`;D=
|
|
1
|
+
import{Mesh as O,SphereGeometry as hs,Vector3 as F,MeshBasicMaterial as ht,TrianglesDrawMode as sr,TriangleFanDrawMode as gs,TriangleStripDrawMode as Ta,Loader as St,LoaderUtils as Yt,FileLoader as gt,MeshPhysicalMaterial as bt,Vector2 as Re,Color as Be,LinearSRGBColorSpace as Ve,SRGBColorSpace as le,SpotLight as Ra,PointLight as ds,DirectionalLight as ps,Matrix4 as re,InstancedMesh as ar,Quaternion as we,InstancedBufferAttribute as nr,Object3D as It,TextureLoader as us,ImageBitmapLoader as or,BufferAttribute as Ye,InterleavedBuffer as rr,LinearMipmapLinearFilter as di,NearestMipmapLinearFilter as Ma,LinearMipmapNearestFilter as _a,NearestMipmapNearestFilter as fs,LinearFilter as st,NearestFilter as Gi,RepeatWrapping as Kt,MirroredRepeatWrapping as La,ClampToEdgeWrapping as Oi,PointsMaterial as pi,Material as ui,LineBasicMaterial as Et,MeshStandardMaterial as ms,DoubleSide as Hi,PropertyBinding as Dt,BufferGeometry as at,SkinnedMesh as ka,LineSegments as fi,Line as dt,LineLoop as Ar,Points as ji,Group as Tt,PerspectiveCamera as qi,MathUtils as be,OrthographicCamera as Fa,Skeleton as Na,AnimationClip as Ua,Bone as bs,InterpolateDiscrete as Pa,InterpolateLinear as Is,InterleavedBufferAttribute as Jt,Texture as Es,VectorKeyframeTrack as Cs,NumberKeyframeTrack as Bs,QuaternionKeyframeTrack as ws,ColorManagement as Xe,FrontSide as Ga,Interpolant as cr,Box3 as Wt,Sphere as ys,CompressedCubeTexture as lr,CompressedArrayTexture as hr,CompressedTexture as mi,NoColorSpace as zi,RGBA_BPTC_Format as Qs,RGBA_S3TC_DXT5_Format as vs,RGBA_S3TC_DXT3_Format as Oa,RGB_S3TC_DXT1_Format as Ha,RGBA_S3TC_DXT1_Format as xs,RGBA_ASTC_6x6_Format as ja,RGBA_ASTC_4x4_Format as Yi,RGBA_ETC2_EAC_Format as qa,RGB_ETC2_Format as za,RGBFormat as Ss,RedFormat as si,RGFormat as bi,RGBAFormat as Pt,UnsignedByteType as pt,HalfFloatType as Ze,UnsignedInt101111Type as Ya,UnsignedInt5999Type as Ka,FloatType as ut,DataTexture as gr,Data3DTexture as dr,RGB_PVRTC_4BPPV1_Format as pr,RGB_ETC1_Format as ur,RGBA_PVRTC_4BPPV1_Format as fr,RGB_BPTC_UNSIGNED_Format as mr,NodeFrame as br,ShaderLib as Ct,ExtrudeGeometry as Ir,ShapePath as Er,DataTextureLoader as Ja,DataUtils as ai,CylinderGeometry as $e,BoxGeometry as Ke,Float32BufferAttribute as Me,OctahedronGeometry as Ki,TorusGeometry as Ii,Euler as Gt,Controls as Wa,Raycaster as Ds,PlaneGeometry as Ji,MOUSE as ni,TOUCH as oi,Spherical as Va,Ray as Cr,Plane as Br,ShaderMaterial as Xa,Uniform$1 as wr,Scene as Ts,WebGLRenderer as yr,CanvasTexture as Za,REVISION as Qr,Source as vr,InstancedBufferGeometry as xr,InstancedInterleavedBuffer as Rs,WireframeGeometry as Sr,UniformsUtils as $a,UniformsLib as Wi,Vector4 as Rt,Line3 as Dr,ShaderChunk as Ms,Box3Helper as en,Matrix3 as tn,Curve as Tr,MeshPhongMaterial as Ei,MeshLambertMaterial as Rr,EquirectangularReflectionMapping as Mr,AmbientLight as _r,Uint16BufferAttribute as Lr,ShapeUtils as kr,DefaultLoadingManager as Fr}from"./three.min.js";class Nr extends O{constructor(e,t,s,i=128){if(t<=0||s<=0||i<=0)throw new Error("GroundedSkybox height, radius, and resolution must be positive.");const a=new hs(s,2*i,i);a.scale(1,1,-1);const n=a.getAttribute("position"),r=new F;for(let A=0;A<n.count;++A)if(r.fromBufferAttribute(n,A),r.y<0){const c=-t*3/2,l=r.y<c?-t/r.y:1-r.y*r.y/(3*c*c);r.multiplyScalar(l),r.toArray(n.array,3*A)}n.needsUpdate=!0,super(a,new ht({map:e,depthWrite:!1}))}}function Ur(o,e=1e-4){e=Math.max(e,Number.EPSILON);const t={},s=o.getIndex(),i=o.getAttribute("position"),a=s?s.count:i.count;let n=0;const r=Object.keys(o.attributes),A={},c={},l=[],h=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"];for(let C=0,E=r.length;C<E;C++){const y=r[C],w=o.attributes[y];A[y]=new w.constructor(new w.array.constructor(w.count*w.itemSize),w.itemSize,w.normalized);const x=o.morphAttributes[y];x&&(c[y]||(c[y]=[]),x.forEach((D,S)=>{const L=new D.array.constructor(D.count*D.itemSize);c[y][S]=new D.constructor(L,D.itemSize,D.normalized)}))}const p=e*.5,f=Math.log10(1/e),b=Math.pow(10,f),u=p*b;for(let C=0;C<a;C++){const E=s?s.getX(C):C;let y="";for(let w=0,x=r.length;w<x;w++){const D=r[w],S=o.getAttribute(D),L=S.itemSize;for(let Y=0;Y<L;Y++)y+=`${~~(S[h[Y]](E)*b+u)},`}if(y in t)l.push(t[y]);else{for(let w=0,x=r.length;w<x;w++){const D=r[w],S=o.getAttribute(D),L=o.morphAttributes[D],Y=S.itemSize,W=A[D],K=c[D];for(let V=0;V<Y;V++){const j=h[V],X=d[V];if(W[X](n,S[j](E)),L)for(let J=0,ee=L.length;J<ee;J++)K[J][X](n,L[J][j](E))}}t[y]=n,l.push(n),n++}}const I=o.clone();for(const C in o.attributes){const E=A[C];if(I.setAttribute(C,new E.constructor(E.array.slice(0,n*E.itemSize),E.itemSize,E.normalized)),C in c)for(let y=0;y<c[C].length;y++){const w=c[C][y];I.morphAttributes[C][y]=new w.constructor(w.array.slice(0,n*w.itemSize),w.itemSize,w.normalized)}}return I.setIndex(l),I}function sn(o,e){if(e===sr)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(e===gs||e===Ta){let t=o.getIndex();if(t===null){const n=[],r=o.getAttribute("position");if(r!==void 0){for(let A=0;A<r.count;A++)n.push(A);o.setIndex(n),t=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}const s=t.count-2,i=[];if(e===gs)for(let n=1;n<=s;n++)i.push(t.getX(0)),i.push(t.getX(n)),i.push(t.getX(n+1));else for(let n=0;n<s;n++)n%2===0?(i.push(t.getX(n)),i.push(t.getX(n+1)),i.push(t.getX(n+2))):(i.push(t.getX(n+2)),i.push(t.getX(n+1)),i.push(t.getX(n)));i.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=o.clone();return a.setIndex(i),a.clearGroups(),a}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),o}class _s extends St{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new jr(t)}),this.register(function(t){return new qr(t)}),this.register(function(t){return new $r(t)}),this.register(function(t){return new eA(t)}),this.register(function(t){return new tA(t)}),this.register(function(t){return new Yr(t)}),this.register(function(t){return new Kr(t)}),this.register(function(t){return new Jr(t)}),this.register(function(t){return new Wr(t)}),this.register(function(t){return new Hr(t)}),this.register(function(t){return new Vr(t)}),this.register(function(t){return new zr(t)}),this.register(function(t){return new Zr(t)}),this.register(function(t){return new Xr(t)}),this.register(function(t){return new Gr(t)}),this.register(function(t){return new iA(t)}),this.register(function(t){return new sA(t)})}load(e,t,s,i){const a=this;let n;if(this.resourcePath!=="")n=this.resourcePath;else if(this.path!==""){const c=Yt.extractUrlBase(e);n=Yt.resolveURL(c,this.path)}else n=Yt.extractUrlBase(e);this.manager.itemStart(e);const r=function(c){i?i(c):console.error(c),a.manager.itemError(e),a.manager.itemEnd(e)},A=new gt(this.manager);A.setPath(this.path),A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setWithCredentials(this.withCredentials),A.load(e,function(c){try{a.parse(c,n,function(l){t(l),a.manager.itemEnd(e)},r)}catch(l){r(l)}},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,i){let a,n;const r={},A={},c=new TextDecoder;if(typeof e=="string")try{a=JSON.parse(e)}catch(h){n=e,i&&i(h);return}else if(e instanceof ArrayBuffer)if(c.decode(new Uint8Array(e,0,4))===an){try{r[ae.KHR_BINARY_GLTF]=new aA(e)}catch(h){i&&i(h);return}try{a=JSON.parse(r[ae.KHR_BINARY_GLTF].content)}catch(h){n=r[ae.KHR_BINARY_GLTF].content,i&&i(h);return}}else try{a=JSON.parse(c.decode(e))}catch(h){n=c.decode(e),i&&i(h);return}else a=e;if(a.asset===void 0||a.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}this.json=a,this.jsonErrorData=n;const l=new mA(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let h=0;h<this.pluginCallbacks.length;h++){const d=this.pluginCallbacks[h](l);d.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),A[d.name]=d,r[d.name]=!0}if(a.extensionsUsed)for(let h=0;h<a.extensionsUsed.length;++h){const d=a.extensionsUsed[h],p=a.extensionsRequired||[];switch(d){case ae.KHR_MATERIALS_UNLIT:r[d]=new Or;break;case ae.KHR_DRACO_MESH_COMPRESSION:r[d]=new nA(a,this.dracoLoader);break;case ae.KHR_TEXTURE_TRANSFORM:r[d]=new oA;break;case ae.KHR_MESH_QUANTIZATION:r[d]=new rA;break;default:p.indexOf(d)>=0&&A[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}l.setExtensions(r),l.setPlugins(A),l.parse(s,i)}parseAsync(e,t){const s=this;return new Promise(function(i,a){s.parse(e,t,i,a)})}}function Pr(){let o={};return{get:function(e){return o[e]},add:function(e,t){o[e]=t},remove:function(e){delete o[e]},removeAll:function(){o={}}}}const ae={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 Gr{constructor(e){this.parser=e,this.name=ae.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let s=0,i=t.length;s<i;s++){const a=t[s];a.extensions&&a.extensions[this.name]&&a.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,a.extensions[this.name].light)}}_loadLight(e){const t=this.parser,s="light:"+e;let i=t.cache.get(s);if(i)return i;const a=t.json,n=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e];let r;const A=new Be(16777215);n.color!==void 0&&A.setRGB(n.color[0],n.color[1],n.color[2],Ve);const c=n.range!==void 0?n.range:0;switch(n.type){case"directional":r=new ps(A),r.target.position.set(0,0,-1),r.add(r.target);break;case"point":r=new ds(A),r.distance=c;break;case"spot":r=new Ra(A),r.distance=c,n.spot=n.spot||{},n.spot.innerConeAngle=n.spot.innerConeAngle!==void 0?n.spot.innerConeAngle:0,n.spot.outerConeAngle=n.spot.outerConeAngle!==void 0?n.spot.outerConeAngle:Math.PI/4,r.angle=n.spot.outerConeAngle,r.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,r.target.position.set(0,0,-1),r.add(r.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+n.type)}return r.position.set(0,0,0),r.decay=2,Mt(r,n),n.intensity!==void 0&&(r.intensity=n.intensity),r.name=t.createUniqueName(n.name||"light_"+e),i=Promise.resolve(r),t.cache.add(s,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,s=this.parser,i=s.json.nodes[e],a=(i.extensions&&i.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(n){return s._getNodeRef(t.cache,a,n)})}}let Or=class{constructor(){this.name=ae.KHR_MATERIALS_UNLIT}getMaterialType(){return ht}extendParams(o,e,t){const s=[];o.color=new Be(1,1,1),o.opacity=1;const i=e.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const a=i.baseColorFactor;o.color.setRGB(a[0],a[1],a[2],Ve),o.opacity=a[3]}i.baseColorTexture!==void 0&&s.push(t.assignTexture(o,"map",i.baseColorTexture,le))}return Promise.all(s)}},Hr=class{constructor(o){this.parser=o,this.name=ae.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const s=t.extensions[this.name].emissiveStrength;return s!==void 0&&(e.emissiveIntensity=s),Promise.resolve()}},jr=class{constructor(o){this.parser=o,this.name=ae.KHR_MATERIALS_CLEARCOAT}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,s=t.json.materials[o];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],a=s.extensions[this.name];if(a.clearcoatFactor!==void 0&&(e.clearcoat=a.clearcoatFactor),a.clearcoatTexture!==void 0&&i.push(t.assignTexture(e,"clearcoatMap",a.clearcoatTexture)),a.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=a.clearcoatRoughnessFactor),a.clearcoatRoughnessTexture!==void 0&&i.push(t.assignTexture(e,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),a.clearcoatNormalTexture!==void 0&&(i.push(t.assignTexture(e,"clearcoatNormalMap",a.clearcoatNormalTexture)),a.clearcoatNormalTexture.scale!==void 0)){const n=a.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new Re(n,n)}return Promise.all(i)}},qr=class{constructor(o){this.parser=o,this.name=ae.KHR_MATERIALS_DISPERSION}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const s=t.extensions[this.name];return e.dispersion=s.dispersion!==void 0?s.dispersion:0,Promise.resolve()}},zr=class{constructor(o){this.parser=o,this.name=ae.KHR_MATERIALS_IRIDESCENCE}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,s=t.json.materials[o];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],a=s.extensions[this.name];return a.iridescenceFactor!==void 0&&(e.iridescence=a.iridescenceFactor),a.iridescenceTexture!==void 0&&i.push(t.assignTexture(e,"iridescenceMap",a.iridescenceTexture)),a.iridescenceIor!==void 0&&(e.iridescenceIOR=a.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),a.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),a.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),a.iridescenceThicknessTexture!==void 0&&i.push(t.assignTexture(e,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(i)}},Yr=class{constructor(o){this.parser=o,this.name=ae.KHR_MATERIALS_SHEEN}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,s=t.json.materials[o];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[];e.sheenColor=new Be(0,0,0),e.sheenRoughness=0,e.sheen=1;const a=s.extensions[this.name];if(a.sheenColorFactor!==void 0){const n=a.sheenColorFactor;e.sheenColor.setRGB(n[0],n[1],n[2],Ve)}return a.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=a.sheenRoughnessFactor),a.sheenColorTexture!==void 0&&i.push(t.assignTexture(e,"sheenColorMap",a.sheenColorTexture,le)),a.sheenRoughnessTexture!==void 0&&i.push(t.assignTexture(e,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(i)}},Kr=class{constructor(o){this.parser=o,this.name=ae.KHR_MATERIALS_TRANSMISSION}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,s=t.json.materials[o];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],a=s.extensions[this.name];return a.transmissionFactor!==void 0&&(e.transmission=a.transmissionFactor),a.transmissionTexture!==void 0&&i.push(t.assignTexture(e,"transmissionMap",a.transmissionTexture)),Promise.all(i)}},Jr=class{constructor(o){this.parser=o,this.name=ae.KHR_MATERIALS_VOLUME}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,s=t.json.materials[o];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],a=s.extensions[this.name];e.thickness=a.thicknessFactor!==void 0?a.thicknessFactor:0,a.thicknessTexture!==void 0&&i.push(t.assignTexture(e,"thicknessMap",a.thicknessTexture)),e.attenuationDistance=a.attenuationDistance||1/0;const n=a.attenuationColor||[1,1,1];return e.attenuationColor=new Be().setRGB(n[0],n[1],n[2],Ve),Promise.all(i)}},Wr=class{constructor(o){this.parser=o,this.name=ae.KHR_MATERIALS_IOR}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser.json.materials[o];if(!t.extensions||!t.extensions[this.name])return Promise.resolve();const s=t.extensions[this.name];return e.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}},Vr=class{constructor(o){this.parser=o,this.name=ae.KHR_MATERIALS_SPECULAR}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,s=t.json.materials[o];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],a=s.extensions[this.name];e.specularIntensity=a.specularFactor!==void 0?a.specularFactor:1,a.specularTexture!==void 0&&i.push(t.assignTexture(e,"specularIntensityMap",a.specularTexture));const n=a.specularColorFactor||[1,1,1];return e.specularColor=new Be().setRGB(n[0],n[1],n[2],Ve),a.specularColorTexture!==void 0&&i.push(t.assignTexture(e,"specularColorMap",a.specularColorTexture,le)),Promise.all(i)}},Xr=class{constructor(o){this.parser=o,this.name=ae.EXT_MATERIALS_BUMP}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,s=t.json.materials[o];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],a=s.extensions[this.name];return e.bumpScale=a.bumpFactor!==void 0?a.bumpFactor:1,a.bumpTexture!==void 0&&i.push(t.assignTexture(e,"bumpMap",a.bumpTexture)),Promise.all(i)}},Zr=class{constructor(o){this.parser=o,this.name=ae.KHR_MATERIALS_ANISOTROPY}getMaterialType(o){const e=this.parser.json.materials[o];return!e.extensions||!e.extensions[this.name]?null:bt}extendMaterialParams(o,e){const t=this.parser,s=t.json.materials[o];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const i=[],a=s.extensions[this.name];return a.anisotropyStrength!==void 0&&(e.anisotropy=a.anisotropyStrength),a.anisotropyRotation!==void 0&&(e.anisotropyRotation=a.anisotropyRotation),a.anisotropyTexture!==void 0&&i.push(t.assignTexture(e,"anisotropyMap",a.anisotropyTexture)),Promise.all(i)}};class $r{constructor(e){this.parser=e,this.name=ae.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,s=t.json,i=s.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const a=i.extensions[this.name],n=t.options.ktx2Loader;if(!n){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,a.source,n)}}class eA{constructor(e){this.parser=e,this.name=ae.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,a=i.textures[e];if(!a.extensions||!a.extensions[t])return null;const n=a.extensions[t],r=i.images[n.source];let A=s.textureLoader;if(r.uri){const c=s.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return s.loadTextureImage(e,n.source,A);if(i.extensionsRequired&&i.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 tA{constructor(e){this.parser=e,this.name=ae.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,s=this.parser,i=s.json,a=i.textures[e];if(!a.extensions||!a.extensions[t])return null;const n=a.extensions[t],r=i.images[n.source];let A=s.textureLoader;if(r.uri){const c=s.options.manager.getHandler(r.uri);c!==null&&(A=c)}return this.detectSupport().then(function(c){if(c)return s.loadTextureImage(e,n.source,A);if(i.extensionsRequired&&i.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 iA{constructor(e){this.name=ae.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 i=s.extensions[this.name],a=this.parser.getDependency("buffer",i.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.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 a.then(function(r){const A=i.byteOffset||0,c=i.byteLength||0,l=i.count,h=i.byteStride,d=new Uint8Array(r,A,c);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(l,h,d,i.mode,i.filter).then(function(p){return p.buffer}):n.ready.then(function(){const p=new ArrayBuffer(l*h);return n.decodeGltfBuffer(new Uint8Array(p),l,h,d,i.mode,i.filter),p})})}else return null}}let sA=class{constructor(o){this.name=ae.EXT_MESH_GPU_INSTANCING,this.parser=o}createNodeMesh(o){const e=this.parser.json,t=e.nodes[o];if(!t.extensions||!t.extensions[this.name]||t.mesh===void 0)return null;const s=e.meshes[t.mesh];for(const r of s.primitives)if(r.mode!==At.TRIANGLES&&r.mode!==At.TRIANGLE_STRIP&&r.mode!==At.TRIANGLE_FAN&&r.mode!==void 0)return null;const i=t.extensions[this.name].attributes,a=[],n={};for(const r in i)a.push(this.parser.getDependency("accessor",i[r]).then(A=>(n[r]=A,n[r])));return a.length<1?null:(a.push(this.parser.createNodeMesh(o)),Promise.all(a).then(r=>{const A=r.pop(),c=A.isGroup?A.children:[A],l=r[0].count,h=[];for(const d of c){const p=new re,f=new F,b=new we,u=new F(1,1,1),I=new ar(d.geometry,d.material,l);for(let C=0;C<l;C++)n.TRANSLATION&&f.fromBufferAttribute(n.TRANSLATION,C),n.ROTATION&&b.fromBufferAttribute(n.ROTATION,C),n.SCALE&&u.fromBufferAttribute(n.SCALE,C),I.setMatrixAt(C,p.compose(f,b,u));for(const C in n)if(C==="_COLOR_0"){const E=n[C];I.instanceColor=new nr(E.array,E.itemSize,E.normalized)}else C!=="TRANSLATION"&&C!=="ROTATION"&&C!=="SCALE"&&d.geometry.setAttribute(C,n[C]);It.prototype.copy.call(I,d),this.parser.assignFinalMaterial(I),h.push(I)}return A.isGroup?(A.clear(),A.add(...h),A):h[0]}))}};const an="glTF",Ci=12,nn={JSON:1313821514,BIN:5130562};class aA{constructor(e){this.name=ae.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Ci),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!==an)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Ci,a=new DataView(e,Ci);let n=0;for(;n<i;){const r=a.getUint32(n,!0);n+=4;const A=a.getUint32(n,!0);if(n+=4,A===nn.JSON){const c=new Uint8Array(e,Ci+n,r);this.content=s.decode(c)}else if(A===nn.BIN){const c=Ci+n;this.body=e.slice(c,c+r)}n+=r}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class nA{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ae.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const s=this.json,i=this.dracoLoader,a=e.extensions[this.name].bufferView,n=e.extensions[this.name].attributes,r={},A={},c={};for(const l in n){const h=ks[l]||l.toLowerCase();r[h]=n[l]}for(const l in e.attributes){const h=ks[l]||l.toLowerCase();if(n[l]!==void 0){const d=s.accessors[e.attributes[l]],p=ri[d.componentType];c[h]=p.name,A[h]=d.normalized===!0}}return t.getDependency("bufferView",a).then(function(l){return new Promise(function(h,d){i.decodeDracoFile(l,function(p){for(const f in p.attributes){const b=p.attributes[f],u=A[f];u!==void 0&&(b.normalized=u)}h(p)},r,c,Ve,d)})})}}class oA{constructor(){this.name=ae.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 rA{constructor(){this.name=ae.KHR_MESH_QUANTIZATION}}class on extends cr{constructor(e,t,s,i){super(e,t,s,i)}copySampleValue_(e){const t=this.resultBuffer,s=this.sampleValues,i=this.valueSize,a=e*i*3+i;for(let n=0;n!==i;n++)t[n]=s[a+n];return t}interpolate_(e,t,s,i){const a=this.resultBuffer,n=this.sampleValues,r=this.valueSize,A=r*2,c=r*3,l=i-t,h=(s-t)/l,d=h*h,p=d*h,f=e*c,b=f-c,u=-2*p+3*d,I=p-d,C=1-u,E=I-d+h;for(let y=0;y!==r;y++){const w=n[b+y+r],x=n[b+y+A]*l,D=n[f+y+r],S=n[f+y]*l;a[y]=C*w+E*x+u*D+I*S}return a}}const AA=new we;class cA extends on{interpolate_(e,t,s,i){const a=super.interpolate_(e,t,s,i);return AA.fromArray(a).normalize().toArray(a),a}}const At={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},ri={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},rn={9728:Gi,9729:st,9984:fs,9985:_a,9986:Ma,9987:di},An={33071:Oi,33648:La,10497:Kt},Ls={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ks={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"},Ot={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},lA={CUBICSPLINE:void 0,LINEAR:Is,STEP:Pa},Fs={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function hA(o){return o.DefaultMaterial===void 0&&(o.DefaultMaterial=new ms({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Ga})),o.DefaultMaterial}function Vt(o,e,t){for(const s in t.extensions)o[s]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[s]=t.extensions[s])}function Mt(o,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(o.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function gA(o,e,t){let s=!1,i=!1,a=!1;for(let c=0,l=e.length;c<l;c++){const h=e[c];if(h.POSITION!==void 0&&(s=!0),h.NORMAL!==void 0&&(i=!0),h.COLOR_0!==void 0&&(a=!0),s&&i&&a)break}if(!s&&!i&&!a)return Promise.resolve(o);const n=[],r=[],A=[];for(let c=0,l=e.length;c<l;c++){const h=e[c];if(s){const d=h.POSITION!==void 0?t.getDependency("accessor",h.POSITION):o.attributes.position;n.push(d)}if(i){const d=h.NORMAL!==void 0?t.getDependency("accessor",h.NORMAL):o.attributes.normal;r.push(d)}if(a){const d=h.COLOR_0!==void 0?t.getDependency("accessor",h.COLOR_0):o.attributes.color;A.push(d)}}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(A)]).then(function(c){const l=c[0],h=c[1],d=c[2];return s&&(o.morphAttributes.position=l),i&&(o.morphAttributes.normal=h),a&&(o.morphAttributes.color=d),o.morphTargetsRelative=!0,o})}function dA(o,e){if(o.updateMorphTargets(),e.weights!==void 0)for(let t=0,s=e.weights.length;t<s;t++)o.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(o.morphTargetInfluences.length===t.length){o.morphTargetDictionary={};for(let s=0,i=t.length;s<i;s++)o.morphTargetDictionary[t[s]]=s}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function pA(o){let e;const t=o.extensions&&o.extensions[ae.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Ns(t.attributes):e=o.indices+":"+Ns(o.attributes)+":"+o.mode,o.targets!==void 0)for(let s=0,i=o.targets.length;s<i;s++)e+=":"+Ns(o.targets[s]);return e}function Ns(o){let e="";const t=Object.keys(o).sort();for(let s=0,i=t.length;s<i;s++)e+=t[s]+":"+o[t[s]]+";";return e}function Us(o){switch(o){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 uA(o){return o.search(/\.jpe?g($|\?)/i)>0||o.search(/^data\:image\/jpeg/)===0?"image/jpeg":o.search(/\.webp($|\?)/i)>0||o.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const fA=new re;class mA{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Pr,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,i=-1,a=!1,n=-1;if(typeof navigator<"u"){const r=navigator.userAgent;s=/^((?!chrome|android).)*safari/i.test(r)===!0;const A=r.match(/Version\/(\d+)/);i=s&&A?parseInt(A[1],10):-1,a=r.indexOf("Firefox")>-1,n=a?r.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||s&&i<17||a&&n<98?this.textureLoader=new us(this.options.manager):this.textureLoader=new or(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new gt(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,i=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(n){return n._markDefs&&n._markDefs()}),Promise.all(this._invokeAll(function(n){return n.beforeRoot&&n.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(n){const r={scene:n[0][i.scene||0],scenes:n[0],animations:n[1],cameras:n[2],asset:i.asset,parser:s,userData:{}};return Vt(a,r,i),Mt(r,i),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 i=0,a=t.length;i<a;i++){const n=t[i].joints;for(let r=0,A=n.length;r<A;r++)e[n[r]].isBone=!0}for(let i=0,a=e.length;i<a;i++){const n=e[i];n.mesh!==void 0&&(this._addNodeRef(this.meshCache,n.mesh),n.skin!==void 0&&(s[n.mesh].isSkinnedMesh=!0)),n.camera!==void 0&&this._addNodeRef(this.cameraCache,n.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 i=s.clone(),a=(n,r)=>{const A=this.associations.get(n);A!=null&&this.associations.set(r,A);for(const[c,l]of n.children.entries())a(l,r.children[c])};return a(s,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let s=0;s<t.length;s++){const i=e(t[s]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const s=[];for(let i=0;i<t.length;i++){const a=e(t[i]);a&&s.push(a)}return s}getDependency(e,t){const s=e+":"+t;let i=this.cache.get(s);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(a){return a.loadNode&&a.loadNode(t)});break;case"mesh":i=this._invokeOne(function(a){return a.loadMesh&&a.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(a){return a.loadBufferView&&a.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(a){return a.loadMaterial&&a.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(a){return a.loadTexture&&a.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(a){return a.loadAnimation&&a.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(a){return a!=this&&a.getDependency&&a.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(s,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const s=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(a,n){return s.getDependency(e,n)})),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[ae.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(a,n){s.load(Yt.resolveURL(t.uri,i.path),a,void 0,function(){n(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 i=t.byteLength||0,a=t.byteOffset||0;return s.slice(a,a+i)})}loadAccessor(e){const t=this,s=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const n=Ls[i.type],r=ri[i.componentType],A=i.normalized===!0,c=new r(i.count*n);return Promise.resolve(new Ye(c,n,A))}const a=[];return i.bufferView!==void 0?a.push(this.getDependency("bufferView",i.bufferView)):a.push(null),i.sparse!==void 0&&(a.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(a).then(function(n){const r=n[0],A=Ls[i.type],c=ri[i.componentType],l=c.BYTES_PER_ELEMENT,h=l*A,d=i.byteOffset||0,p=i.bufferView!==void 0?s.bufferViews[i.bufferView].byteStride:void 0,f=i.normalized===!0;let b,u;if(p&&p!==h){const I=Math.floor(d/p),C="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+I+":"+i.count;let E=t.cache.get(C);E||(b=new c(r,I*p,i.count*p/l),E=new rr(b,p/l),t.cache.add(C,E)),u=new Jt(E,A,d%p/l,f)}else r===null?b=new c(i.count*A):b=new c(r,d,i.count*A),u=new Ye(b,A,f);if(i.sparse!==void 0){const I=Ls.SCALAR,C=ri[i.sparse.indices.componentType],E=i.sparse.indices.byteOffset||0,y=i.sparse.values.byteOffset||0,w=new C(n[1],E,i.sparse.count*I),x=new c(n[2],y,i.sparse.count*A);r!==null&&(u=new Ye(u.array.slice(),u.itemSize,u.normalized)),u.normalized=!1;for(let D=0,S=w.length;D<S;D++){const L=w[D];if(u.setX(L,x[D*A]),A>=2&&u.setY(L,x[D*A+1]),A>=3&&u.setZ(L,x[D*A+2]),A>=4&&u.setW(L,x[D*A+3]),A>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}u.normalized=f}return u})}loadTexture(e){const t=this.json,s=this.options,i=t.textures[e].source,a=t.images[i];let n=this.textureLoader;if(a.uri){const r=s.manager.getHandler(a.uri);r!==null&&(n=r)}return this.loadTextureImage(e,i,n)}loadTextureImage(e,t,s){const i=this,a=this.json,n=a.textures[e],r=a.images[t],A=(r.uri||r.bufferView)+":"+n.sampler;if(this.textureCache[A])return this.textureCache[A];const c=this.loadImageSource(t,s).then(function(l){l.flipY=!1,l.name=n.name||r.name||"",l.name===""&&typeof r.uri=="string"&&r.uri.startsWith("data:image/")===!1&&(l.name=r.uri);const h=(a.samplers||{})[n.sampler]||{};return l.magFilter=rn[h.magFilter]||st,l.minFilter=rn[h.minFilter]||di,l.wrapS=An[h.wrapS]||Kt,l.wrapT=An[h.wrapT]||Kt,l.anisotropy=4,i.associations.set(l,{textures:e}),l}).catch(function(){return null});return this.textureCache[A]=c,c}loadImageSource(e,t){const s=this,i=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const n=i.images[e],r=self.URL||self.webkitURL;let A=n.uri||"",c=!1;if(n.bufferView!==void 0)A=s.getDependency("bufferView",n.bufferView).then(function(h){c=!0;const d=new Blob([h],{type:n.mimeType});return A=r.createObjectURL(d),A});else if(n.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const l=Promise.resolve(A).then(function(h){return new Promise(function(d,p){let f=d;t.isImageBitmapLoader===!0&&(f=function(b){const u=new Es(b);u.needsUpdate=!0,d(u)}),t.load(Yt.resolveURL(h,a.path),f,void 0,p)})}).then(function(h){return c===!0&&r.revokeObjectURL(A),Mt(h,n),h.userData.mimeType=n.mimeType||uA(n.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",A),h});return this.sourceCache[e]=l,l}assignTexture(e,t,s,i){const a=this;return this.getDependency("texture",s.index).then(function(n){if(!n)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(n=n.clone(),n.channel=s.texCoord),a.extensions[ae.KHR_TEXTURE_TRANSFORM]){const r=s.extensions!==void 0?s.extensions[ae.KHR_TEXTURE_TRANSFORM]:void 0;if(r){const A=a.associations.get(n);n=a.extensions[ae.KHR_TEXTURE_TRANSFORM].extendTexture(n,r),a.associations.set(n,A)}}return i!==void 0&&(n.colorSpace=i),e[t]=n,n})}assignFinalMaterial(e){const t=e.geometry;let s=e.material;const i=t.attributes.tangent===void 0,a=t.attributes.color!==void 0,n=t.attributes.normal===void 0;if(e.isPoints){const r="PointsMaterial:"+s.uuid;let A=this.cache.get(r);A||(A=new pi,ui.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 Et,ui.prototype.copy.call(A,s),A.color.copy(s.color),A.map=s.map,this.cache.add(r,A)),s=A}if(i||a||n){let r="ClonedMaterial:"+s.uuid+":";i&&(r+="derivative-tangents:"),a&&(r+="vertex-colors:"),n&&(r+="flat-shading:");let A=this.cache.get(r);A||(A=s.clone(),a&&(A.vertexColors=!0),n&&(A.flatShading=!0),i&&(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 ms}loadMaterial(e){const t=this,s=this.json,i=this.extensions,a=s.materials[e];let n;const r={},A=a.extensions||{},c=[];if(A[ae.KHR_MATERIALS_UNLIT]){const h=i[ae.KHR_MATERIALS_UNLIT];n=h.getMaterialType(),c.push(h.extendParams(r,a,t))}else{const h=a.pbrMetallicRoughness||{};if(r.color=new Be(1,1,1),r.opacity=1,Array.isArray(h.baseColorFactor)){const d=h.baseColorFactor;r.color.setRGB(d[0],d[1],d[2],Ve),r.opacity=d[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(r,"map",h.baseColorTexture,le)),r.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,r.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(r,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(r,"roughnessMap",h.metallicRoughnessTexture))),n=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,r)})))}a.doubleSided===!0&&(r.side=Hi);const l=a.alphaMode||Fs.OPAQUE;if(l===Fs.BLEND?(r.transparent=!0,r.depthWrite=!1):(r.transparent=!1,l===Fs.MASK&&(r.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&n!==ht&&(c.push(t.assignTexture(r,"normalMap",a.normalTexture)),r.normalScale=new Re(1,1),a.normalTexture.scale!==void 0)){const h=a.normalTexture.scale;r.normalScale.set(h,h)}if(a.occlusionTexture!==void 0&&n!==ht&&(c.push(t.assignTexture(r,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(r.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&n!==ht){const h=a.emissiveFactor;r.emissive=new Be().setRGB(h[0],h[1],h[2],Ve)}return a.emissiveTexture!==void 0&&n!==ht&&c.push(t.assignTexture(r,"emissiveMap",a.emissiveTexture,le)),Promise.all(c).then(function(){const h=new n(r);return a.name&&(h.name=a.name),Mt(h,a),t.associations.set(h,{materials:e}),a.extensions&&Vt(i,h,a),h})}createUniqueName(e){const t=Dt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,s=this.extensions,i=this.primitiveCache;function a(r){return s[ae.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(r,t).then(function(A){return cn(A,r,t)})}const n=[];for(let r=0,A=e.length;r<A;r++){const c=e[r],l=pA(c),h=i[l];if(h)n.push(h.promise);else{let d;c.extensions&&c.extensions[ae.KHR_DRACO_MESH_COMPRESSION]?d=a(c):d=cn(new at,c,t),i[l]={primitive:c,promise:d},n.push(d)}}return Promise.all(n)}loadMesh(e){const t=this,s=this.json,i=this.extensions,a=s.meshes[e],n=a.primitives,r=[];for(let A=0,c=n.length;A<c;A++){const l=n[A].material===void 0?hA(this.cache):this.getDependency("material",n[A].material);r.push(l)}return r.push(t.loadGeometries(n)),Promise.all(r).then(function(A){const c=A.slice(0,A.length-1),l=A[A.length-1],h=[];for(let p=0,f=l.length;p<f;p++){const b=l[p],u=n[p];let I;const C=c[p];if(u.mode===At.TRIANGLES||u.mode===At.TRIANGLE_STRIP||u.mode===At.TRIANGLE_FAN||u.mode===void 0)I=a.isSkinnedMesh===!0?new ka(b,C):new O(b,C),I.isSkinnedMesh===!0&&I.normalizeSkinWeights(),u.mode===At.TRIANGLE_STRIP?I.geometry=sn(I.geometry,Ta):u.mode===At.TRIANGLE_FAN&&(I.geometry=sn(I.geometry,gs));else if(u.mode===At.LINES)I=new fi(b,C);else if(u.mode===At.LINE_STRIP)I=new dt(b,C);else if(u.mode===At.LINE_LOOP)I=new Ar(b,C);else if(u.mode===At.POINTS)I=new ji(b,C);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);Object.keys(I.geometry.morphAttributes).length>0&&dA(I,a),I.name=t.createUniqueName(a.name||"mesh_"+e),Mt(I,a),u.extensions&&Vt(i,I,u),t.assignFinalMaterial(I),h.push(I)}for(let p=0,f=h.length;p<f;p++)t.associations.set(h[p],{meshes:e,primitives:p});if(h.length===1)return a.extensions&&Vt(i,h[0],a),h[0];const d=new Tt;a.extensions&&Vt(i,d,a),t.associations.set(d,{meshes:e});for(let p=0,f=h.length;p<f;p++)d.add(h[p]);return d})}loadCamera(e){let t;const s=this.json.cameras[e],i=s[s.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return s.type==="perspective"?t=new qi(be.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):s.type==="orthographic"&&(t=new Fa(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),s.name&&(t.name=this.createUniqueName(s.name)),Mt(t,s),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],s=[];for(let i=0,a=t.joints.length;i<a;i++)s.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?s.push(this.getDependency("accessor",t.inverseBindMatrices)):s.push(null),Promise.all(s).then(function(i){const a=i.pop(),n=i,r=[],A=[];for(let c=0,l=n.length;c<l;c++){const h=n[c];if(h){r.push(h);const d=new re;a!==null&&d.fromArray(a.array,c*16),A.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new Na(r,A)})}loadAnimation(e){const t=this.json,s=this,i=t.animations[e],a=i.name?i.name:"animation_"+e,n=[],r=[],A=[],c=[],l=[];let h=0,d=i.channels.length;for(h=0,d=i.channels.length;h<d;h++){const p=i.channels[h],f=i.samplers[p.sampler],b=p.target,u=b.node,I=i.parameters!==void 0?i.parameters[f.input]:f.input,C=i.parameters!==void 0?i.parameters[f.output]:f.output;b.node!==void 0&&(n.push(this.getDependency("node",u)),r.push(this.getDependency("accessor",I)),A.push(this.getDependency("accessor",C)),c.push(f),l.push(b))}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(A),Promise.all(c),Promise.all(l)]).then(function(p){const f=p[0],b=p[1],u=p[2],I=p[3],C=p[4],E=[];for(h=0,d=f.length;h<d;h++){const y=f[h],w=b[h],x=u[h],D=I[h],S=C[h];if(y===void 0)continue;y.updateMatrix&&y.updateMatrix();const L=s._createAnimationTracks(y,w,x,D,S);if(L)for(let Y=0;Y<L.length;Y++)E.push(L[Y])}return new Ua(a,void 0,E)})}createNodeMesh(e){const t=this.json,s=this,i=t.nodes[e];return i.mesh===void 0?null:s.getDependency("mesh",i.mesh).then(function(a){const n=s._getNodeRef(s.meshCache,i.mesh,a);return i.weights!==void 0&&n.traverse(function(r){if(r.isMesh)for(let A=0,c=i.weights.length;A<c;A++)r.morphTargetInfluences[A]=i.weights[A]}),n})}loadNode(e){const t=this.json,s=this,i=t.nodes[e],a=s._loadNodeShallow(e),n=[],r=i.children||[];for(let c=0,l=r.length;c<l;c++)n.push(s.getDependency("node",r[c]));const A=i.skin===void 0?Promise.resolve(null):s.getDependency("skin",i.skin);return Promise.all([a,Promise.all(n),A]).then(function(c){const l=c[0],h=c[1],d=c[2];d!==null&&l.traverse(function(p){p.isSkinnedMesh&&p.bind(d,fA)});for(let p=0,f=h.length;p<f;p++)l.add(h[p]);return l})}_loadNodeShallow(e){const t=this.json,s=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const a=t.nodes[e],n=a.name?i.createUniqueName(a.name):"",r=[],A=i._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return A&&r.push(A),a.camera!==void 0&&r.push(i.getDependency("camera",a.camera).then(function(c){return i._getNodeRef(i.cameraCache,a.camera,c)})),i._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){r.push(c)}),this.nodeCache[e]=Promise.all(r).then(function(c){let l;if(a.isBone===!0?l=new bs:c.length>1?l=new Tt:c.length===1?l=c[0]:l=new It,l!==c[0])for(let h=0,d=c.length;h<d;h++)l.add(c[h]);if(a.name&&(l.userData.name=a.name,l.name=n),Mt(l,a),a.extensions&&Vt(s,l,a),a.matrix!==void 0){const h=new re;h.fromArray(a.matrix),l.applyMatrix4(h)}else a.translation!==void 0&&l.position.fromArray(a.translation),a.rotation!==void 0&&l.quaternion.fromArray(a.rotation),a.scale!==void 0&&l.scale.fromArray(a.scale);return i.associations.has(l)||i.associations.set(l,{}),i.associations.get(l).nodes=e,l}),this.nodeCache[e]}loadScene(e){const t=this.extensions,s=this.json.scenes[e],i=this,a=new Tt;s.name&&(a.name=i.createUniqueName(s.name)),Mt(a,s),s.extensions&&Vt(t,a,s);const n=s.nodes||[],r=[];for(let A=0,c=n.length;A<c;A++)r.push(i.getDependency("node",n[A]));return Promise.all(r).then(function(A){for(let l=0,h=A.length;l<h;l++)a.add(A[l]);const c=l=>{const h=new Map;for(const[d,p]of i.associations)(d instanceof ui||d instanceof Es)&&h.set(d,p);return l.traverse(d=>{const p=i.associations.get(d);p!=null&&h.set(d,p)}),h};return i.associations=c(a),a})}_createAnimationTracks(e,t,s,i,a){const n=[],r=e.name?e.name:e.uuid,A=[];Ot[a.path]===Ot.weights?e.traverse(function(d){d.morphTargetInfluences&&A.push(d.name?d.name:d.uuid)}):A.push(r);let c;switch(Ot[a.path]){case Ot.weights:c=Bs;break;case Ot.rotation:c=ws;break;case Ot.position:case Ot.scale:c=Cs;break;default:s.itemSize===1?c=Bs:c=Cs;break}const l=i.interpolation!==void 0?lA[i.interpolation]:Is,h=this._getArrayFromAccessor(s);for(let d=0,p=A.length;d<p;d++){const f=new c(A[d]+"."+Ot[a.path],t.array,h,l);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(f),n.push(f)}return n}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const s=Us(t.constructor),i=new Float32Array(t.length);for(let a=0,n=t.length;a<n;a++)i[a]=t[a]*s;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const s=this instanceof ws?cA:on;return new s(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function bA(o,e,t){const s=e.attributes,i=new Wt;if(s.POSITION!==void 0){const r=t.json.accessors[s.POSITION],A=r.min,c=r.max;if(A!==void 0&&c!==void 0){if(i.set(new F(A[0],A[1],A[2]),new F(c[0],c[1],c[2])),r.normalized){const l=Us(ri[r.componentType]);i.min.multiplyScalar(l),i.max.multiplyScalar(l)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const a=e.targets;if(a!==void 0){const r=new F,A=new F;for(let c=0,l=a.length;c<l;c++){const h=a[c];if(h.POSITION!==void 0){const d=t.json.accessors[h.POSITION],p=d.min,f=d.max;if(p!==void 0&&f!==void 0){if(A.setX(Math.max(Math.abs(p[0]),Math.abs(f[0]))),A.setY(Math.max(Math.abs(p[1]),Math.abs(f[1]))),A.setZ(Math.max(Math.abs(p[2]),Math.abs(f[2]))),d.normalized){const b=Us(ri[d.componentType]);A.multiplyScalar(b)}r.max(A)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(r)}o.boundingBox=i;const n=new ys;i.getCenter(n.center),n.radius=i.min.distanceTo(i.max)/2,o.boundingSphere=n}function cn(o,e,t){const s=e.attributes,i=[];function a(n,r){return t.getDependency("accessor",n).then(function(A){o.setAttribute(r,A)})}for(const n in s){const r=ks[n]||n.toLowerCase();r in o.attributes||i.push(a(s[n],r))}if(e.indices!==void 0&&!o.index){const n=t.getDependency("accessor",e.indices).then(function(r){o.setIndex(r)});i.push(n)}return Xe.workingColorSpace!==Ve&&"COLOR_0"in s&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Xe.workingColorSpace}" not supported.`),Mt(o,e),bA(o,e,t),Promise.all(i).then(function(){return e.targets!==void 0?gA(o,e.targets,t):o})}var IA=function(){var o="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;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3c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Dce0mbavc;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 i=WebAssembly.validate(t)?e:o,a,n=WebAssembly.instantiate(r(i),{}).then(function(I){a=I.instance,a.exports.__wasm_call_ctors()});function r(I){for(var C=new Uint8Array(I.length),E=0;E<I.length;++E){var y=I.charCodeAt(E);C[E]=y>96?y-97:y>64?y-39:y+4}for(var w=0,E=0;E<I.length;++E)C[w++]=C[E]<60?s[C[E]]:(C[E]-60)*64+C[++E];return C.buffer.slice(0,w)}function A(I,C,E,y,w,x){var D=a.exports.sbrk,S=E+3&-4,L=D(S*y),Y=D(w.length),W=new Uint8Array(a.exports.memory.buffer);W.set(w,Y);var K=I(L,E,y,Y,w.length);if(K==0&&x&&x(L,S,y),C.set(W.subarray(L,L+E*y)),D(L-D(0)),K!=0)throw new Error("Malformed buffer data: "+K)}var c={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],d=0;function p(I){var C={object:new Worker(I),pending:0,requests:{}};return C.object.onmessage=function(E){var y=E.data;C.pending-=y.count,C.requests[y.id][y.action](y.value),delete C.requests[y.id]},C}function f(I){for(var C="var instance; var ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r(i))+"]), {}).then(function(result) { instance = result.instance; instance.exports.__wasm_call_ctors(); });self.onmessage = workerProcess;"+A.toString()+u.toString(),E=new Blob([C],{type:"text/javascript"}),y=URL.createObjectURL(E),w=0;w<I;++w)h[w]=p(y);URL.revokeObjectURL(y)}function b(I,C,E,y,w){for(var x=h[0],D=1;D<h.length;++D)h[D].pending<x.pending&&(x=h[D]);return new Promise(function(S,L){var Y=new Uint8Array(E),W=d++;x.pending+=I,x.requests[W]={resolve:S,reject:L},x.object.postMessage({id:W,count:I,size:C,source:Y,mode:y,filter:w},[Y.buffer])})}function u(I){n.then(function(){var C=I.data;try{var E=new Uint8Array(C.count*C.size);A(a.exports[C.mode],E,C.count,C.size,C.source,a.exports[C.filter]),self.postMessage({id:C.id,count:C.count,action:"resolve",value:E},[E.buffer])}catch(y){self.postMessage({id:C.id,count:C.count,action:"reject",value:y})}})}return{ready:n,supported:!0,useWorkers:function(I){f(I)},decodeVertexBuffer:function(I,C,E,y,w){A(a.exports.meshopt_decodeVertexBuffer,I,C,E,y,a.exports[c[w]])},decodeIndexBuffer:function(I,C,E,y){A(a.exports.meshopt_decodeIndexBuffer,I,C,E,y)},decodeIndexSequence:function(I,C,E,y){A(a.exports.meshopt_decodeIndexSequence,I,C,E,y)},decodeGltfBuffer:function(I,C,E,y,w,x){A(a.exports[l[w]],I,C,E,y,a.exports[c[x]])},decodeGltfBufferAsync:function(I,C,E,y,w){return h.length>0?b(I,C,E,l[y],c[w]):n.then(function(){var x=new Uint8Array(I*C);return A(a.exports[l[y]],x,I,C,E,a.exports[c[w]]),x})}}}();const Ps=new WeakMap;class EA extends St{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,i){const a=new gt(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,n=>{this.parse(n,t,i)},s,i)}parse(e,t,s=()=>{}){this.decodeDracoFile(e,t,null,null,le,s).catch(s)}decodeDracoFile(e,t,s,i,a=Ve,n=()=>{}){const r={attributeIDs:s||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!s,vertexColorSpace:a};return this.decodeGeometry(e,r).then(t).catch(n)}decodeGeometry(e,t){const s=JSON.stringify(t);if(Ps.has(e)){const A=Ps.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 i;const a=this.workerNextTaskID++,n=e.byteLength,r=this._getWorker(a,n).then(A=>(i=A,new Promise((c,l)=>{i._callbacks[a]={resolve:c,reject:l},i.postMessage({type:"decode",id:a,taskConfig:t,buffer:e},[e])}))).then(A=>this._createGeometry(A.geometry));return r.catch(()=>!0).then(()=>{i&&a&&this._releaseTask(i,a)}),Ps.set(e,{key:s,promise:r}),r}_createGeometry(e){const t=new at;e.index&&t.setIndex(new Ye(e.index.array,1));for(let s=0;s<e.attributes.length;s++){const i=e.attributes[s],a=i.name,n=i.array,r=i.itemSize,A=new Ye(n,r);a==="color"&&(this._assignVertexColorSpace(A,i.vertexColorSpace),A.normalized=!(n instanceof Float32Array)),t.setAttribute(a,A)}return t}_assignVertexColorSpace(e,t){if(t!==le)return;const s=new Be;for(let i=0,a=e.count;i<a;i++)s.fromBufferAttribute(e,i),Xe.toWorkingColorSpace(s,le),e.setXYZ(i,s.r,s.g,s.b)}_loadLibrary(e,t){const s=new gt(this.manager);return s.setPath(this.decoderPath),s.setResponseType(t),s.setWithCredentials(this.withCredentials),new Promise((i,a)=>{s.load(e,i,void 0,a)})}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 i=s[0];e||(this.decoderConfig.wasmBinary=s[1]);const a=CA.toString(),n=["/* draco decoder */",i,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(`
|
|
2
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([n]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const i=new Worker(this.workerSourceURL);i._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:this.decoderConfig}),i.onmessage=function(a){const n=a.data;switch(n.type){case"decode":i._callbacks[n.id].resolve(n);break;case"error":i._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(i)}else this.workerPool.sort(function(i,a){return i._taskLoad>a._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 CA(){let o,e;onmessage=function(n){const r=n.data;switch(r.type){case"init":o=r.decoderConfig,e=new Promise(function(l){o.onModuleLoaded=function(h){l({draco:h})},DracoDecoderModule(o)});break;case"decode":const A=r.buffer,c=r.taskConfig;e.then(l=>{const h=l.draco,d=new h.Decoder;try{const p=t(h,d,new Int8Array(A),c),f=p.attributes.map(b=>b.array.buffer);p.index&&f.push(p.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:p},f)}catch(p){console.error(p),self.postMessage({type:"error",id:r.id,error:p.message})}finally{h.destroy(d)}});break}};function t(n,r,A,c){const l=c.attributeIDs,h=c.attributeTypes;let d,p;const f=r.GetEncodedGeometryType(A);if(f===n.TRIANGULAR_MESH)d=new n.Mesh,p=r.DecodeArrayToMesh(A,A.byteLength,d);else if(f===n.POINT_CLOUD)d=new n.PointCloud,p=r.DecodeArrayToPointCloud(A,A.byteLength,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!p.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+p.error_msg());const b={index:null,attributes:[]};for(const u in l){const I=self[h[u]];let C,E;if(c.useUniqueIDs)E=l[u],C=r.GetAttributeByUniqueId(d,E);else{if(E=r.GetAttributeId(d,n[l[u]]),E===-1)continue;C=r.GetAttribute(d,E)}const y=i(n,r,d,u,I,C);u==="color"&&(y.vertexColorSpace=c.vertexColorSpace),b.attributes.push(y)}return f===n.TRIANGULAR_MESH&&(b.index=s(n,r,d)),n.destroy(d),b}function s(n,r,A){const c=A.num_faces()*3,l=c*4,h=n._malloc(l);r.GetTrianglesUInt32Array(A,l,h);const d=new Uint32Array(n.HEAPF32.buffer,h,c).slice();return n._free(h),{array:d,itemSize:1}}function i(n,r,A,c,l,h){const d=h.num_components(),p=A.num_points()*d,f=p*l.BYTES_PER_ELEMENT,b=a(n,l),u=n._malloc(f);r.GetAttributeDataArrayForAllPoints(A,h,b,f,u);const I=new l(n.HEAPF32.buffer,u,p).slice();return n._free(u),{name:c,array:I,itemSize:d}}function a(n,r){switch(r){case Float32Array:return n.DT_FLOAT32;case Int8Array:return n.DT_INT8;case Int16Array:return n.DT_INT16;case Int32Array:return n.DT_INT32;case Uint8Array:return n.DT_UINT8;case Uint16Array:return n.DT_UINT16;case Uint32Array:return n.DT_UINT32}}}class BA{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:i,msg:a,transfer:n}=this.queue.shift();this.workersResolve[e]=i,this.workers[e].postMessage(a,n)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(s=>{const i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=s,this.workers[i].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 wA=0,ln=2,yA=1,hn=2,QA=0,vA=1,xA=10,SA=0,gn=9,dn=15,pn=16,un=22,fn=37,mn=43,bn=76,In=83,En=97,Cn=100,Bn=103,wn=109,yn=122,Qn=123,DA=131,TA=132,RA=133,MA=134,_A=137,LA=138,kA=141,FA=142,NA=145,UA=146,vn=148,xn=152,PA=157,GA=158,Sn=165,Dn=166,Gs=1000066e3;class Bi{constructor(e,t,s,i){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+t,s),this._littleEndian=i,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 i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+s,i)}}const Je=[171,75,84,88,32,50,48,187,13,10,26,10];function Tn(o){return new TextDecoder().decode(o)}function OA(o){const e=new Uint8Array(o.buffer,o.byteOffset,Je.length);if(e[0]!==Je[0]||e[1]!==Je[1]||e[2]!==Je[2]||e[3]!==Je[3]||e[4]!==Je[4]||e[5]!==Je[5]||e[6]!==Je[6]||e[7]!==Je[7]||e[8]!==Je[8]||e[9]!==Je[9]||e[10]!==Je[10]||e[11]!==Je[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,i=new Bi(o,Je.length,s,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32(),t.levelCount=i._nextUint32(),t.supercompressionScheme=i._nextUint32();const a=i._nextUint32(),n=i._nextUint32(),r=i._nextUint32(),A=i._nextUint32(),c=i._nextUint64(),l=i._nextUint64(),h=3*Math.max(t.levelCount,1)*8,d=new Bi(o,Je.length+s,h,!0);for(let ie=0,oe=Math.max(t.levelCount,1);ie<oe;ie++)t.levels.push({levelData:new Uint8Array(o.buffer,o.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});const p=new Bi(o,a,n,!0);p._skip(4);const f=p._nextUint16(),b=p._nextUint16(),u=p._nextUint16(),I=p._nextUint16(),C={vendorId:f,descriptorType:b,versionNumber:u,colorModel:p._nextUint8(),colorPrimaries:p._nextUint8(),transferFunction:p._nextUint8(),flags:p._nextUint8(),texelBlockDimension:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],bytesPlane:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],samples:[]},E=(I/4-6)/4;for(let ie=0;ie<E;ie++){const oe={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};64&oe.channelType?(oe.sampleLower=p._nextInt32(),oe.sampleUpper=p._nextInt32()):(oe.sampleLower=p._nextUint32(),oe.sampleUpper=p._nextUint32()),C.samples[ie]=oe}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(C);const y=new Bi(o,r,A,!0);for(;y._offset<A;){const ie=y._nextUint32(),oe=y._scan(ie),ce=Tn(oe);if(t.keyValue[ce]=y._nextUint8Array(ie-oe.byteLength-1),ce.match(/^ktx/i)){const Se=Tn(t.keyValue[ce]);t.keyValue[ce]=Se.substring(0,Se.lastIndexOf("\0"))}y._skip(ie%4?4-ie%4:0)}if(l<=0)return t;const w=new Bi(o,c,l,!0),x=w._nextUint16(),D=w._nextUint16(),S=w._nextUint32(),L=w._nextUint32(),Y=w._nextUint32(),W=w._nextUint32(),K=[];for(let ie=0,oe=Math.max(t.levelCount,1);ie<oe;ie++)K.push({imageFlags:w._nextUint32(),rgbSliceByteOffset:w._nextUint32(),rgbSliceByteLength:w._nextUint32(),alphaSliceByteOffset:w._nextUint32(),alphaSliceByteLength:w._nextUint32()});const V=c+w._offset,j=V+S,X=j+L,J=X+Y,ee=new Uint8Array(o.buffer,o.byteOffset+V,S),$=new Uint8Array(o.buffer,o.byteOffset+j,L),ue=new Uint8Array(o.buffer,o.byteOffset+X,Y),De=new Uint8Array(o.buffer,o.byteOffset+J,W);return t.globalData={endpointCount:x,selectorCount:D,imageDescs:K,endpointsData:ee,selectorsData:$,tablesData:ue,extendedData:De},t}let Os,_t,Hs;const js={env:{emscripten_notify_memory_growth:function(o){Hs=new Uint8Array(_t.exports.memory.buffer)}}};class HA{init(){return Os||(Os=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Rn).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,js)).then(this._init):WebAssembly.instantiate(Buffer.from(Rn,"base64"),js).then(this._init),Os)}_init(e){_t=e.instance,js.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!_t)throw new Error("ZSTDDecoder: Await .init() before decoding.");const s=e.byteLength,i=_t.exports.malloc(s);Hs.set(e,i),t=t||Number(_t.exports.ZSTD_findDecompressedSize(i,s));const a=_t.exports.malloc(t),n=_t.exports.ZSTD_decompress(a,t,i,s),r=Hs.slice(a,a+n);return _t.exports.free(i),_t.exports.free(a),r}}const Rn="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/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJ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XRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAI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CXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgA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gECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQ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AAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",jA="display-p3",qA="display-p3-linear",qs=new WeakMap;let zs=0,Ys;class lt extends St{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new BA,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 gt(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),s=new gt(this.manager);s.setPath(this.transcoderPath),s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials);const i=s.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then(([a,n])=>{const r=lt.BasisWorker.toString(),A=["/* constants */","let _EngineFormat = "+JSON.stringify(lt.EngineFormat),"let _EngineType = "+JSON.stringify(lt.EngineType),"let _TranscoderFormat = "+JSON.stringify(lt.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(lt.BasisFormat),"/* basis_transcoder.js */",a,"/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
|
|
3
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([A])),this.transcoderBinary=n,this.workerPool.setWorkerCreator(()=>{const c=new Worker(this.workerSourceURL),l=this.transcoderBinary.slice(0);return c.postMessage({type:"init",config:this.workerConfig,transcoderBinary:l},[l]),c})}),zs>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),zs++}return this.transcoderPending}load(e,t,s,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const a=new gt(this.manager);a.setPath(this.path),a.setCrossOrigin(this.crossOrigin),a.setWithCredentials(this.withCredentials),a.setResponseType("arraybuffer"),a.load(e,n=>{this.parse(n,t,i)},s,i)}parse(e,t,s){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");if(qs.has(e))return qs.get(e).promise.then(t).catch(s);this._createTexture(e).then(i=>t?t(i):null).catch(s)}_createTextureFrom(e,t){const{type:s,error:i,data:{faces:a,width:n,height:r,format:A,type:c,dfdFlags:l}}=e;if(s==="error")return Promise.reject(i);let h;if(t.faceCount===6)h=new lr(a,A,c);else{const d=a[0].mipmaps;h=t.layerCount>1?new hr(d,n,r,t.layerCount,A,c):new mi(d,n,r,A,c)}return h.minFilter=a[0].mipmaps.length===1?st:di,h.magFilter=st,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=Mn(t),h.premultiplyAlpha=!!(l&yA),h}async _createTexture(e,t={}){const s=OA(new Uint8Array(e)),i=s.vkFormat===Gs&&s.dataFormatDescriptor[0].colorModel===167;if(!(s.vkFormat===SA||i&&!this.workerConfig.astcHDRSupported))return YA(s);const a=t,n=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:a},[e])).then(r=>this._createTextureFrom(r.data,s));return qs.set(e,{promise:n}),n}dispose(){this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),zs--}}lt.BasisFormat={ETC1S:0,UASTC:1,UASTC_HDR:2},lt.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},lt.EngineFormat={RGBAFormat:Pt,RGBA_ASTC_4x4_Format:Yi,RGB_BPTC_UNSIGNED_Format:mr,RGBA_BPTC_Format:Qs,RGBA_ETC2_EAC_Format:qa,RGBA_PVRTC_4BPPV1_Format:fr,RGBA_S3TC_DXT5_Format:vs,RGB_ETC1_Format:ur,RGB_ETC2_Format:za,RGB_PVRTC_4BPPV1_Format:pr,RGBA_S3TC_DXT1_Format:xs},lt.EngineType={UnsignedByteType:pt,HalfFloatType:Ze,FloatType:ut},lt.BasisWorker=function(){let o,e,t;const s=_EngineFormat,i=_EngineType,a=_TranscoderFormat,n=_BasisFormat;self.addEventListener("message",function(f){const b=f.data;switch(b.type){case"init":o=b.config,r(b.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:u,buffers:I,width:C,height:E,hasAlpha:y,format:w,type:x,dfdFlags:D}=A(b.buffer);self.postMessage({type:"transcode",id:b.id,data:{faces:u,width:C,height:E,hasAlpha:y,format:w,type:x,dfdFlags:D}},I)}catch(u){console.error(u),self.postMessage({type:"error",id:b.id,error:u.message})}});break}});function r(f){e=new Promise(b=>{t={wasmBinary:f,onRuntimeInitialized:b},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function A(f){const b=new t.KTX2File(new Uint8Array(f));function u(){b.close(),b.delete()}if(!b.isValid())throw u(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");let I;if(b.isUASTC())I=n.UASTC;else if(b.isETC1S())I=n.ETC1S;else if(b.isHDR())I=n.UASTC_HDR;else throw new Error("THREE.KTX2Loader: Unknown Basis encoding");const C=b.getWidth(),E=b.getHeight(),y=b.getLayers()||1,w=b.getLevels(),x=b.getFaces(),D=b.getHasAlpha(),S=b.getDFDFlags(),{transcoderFormat:L,engineFormat:Y,engineType:W}=h(I,C,E,D);if(!C||!E||!w)throw u(),new Error("THREE.KTX2Loader: Invalid texture");if(!b.startTranscoding())throw u(),new Error("THREE.KTX2Loader: .startTranscoding failed");const K=[],V=[];for(let j=0;j<x;j++){const X=[];for(let J=0;J<w;J++){const ee=[];let $,ue;for(let ie=0;ie<y;ie++){const oe=b.getImageLevelInfo(J,ie,j);j===0&&J===0&&ie===0&&(oe.origWidth%4!==0||oe.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),w>1?($=oe.origWidth,ue=oe.origHeight):($=oe.width,ue=oe.height);let ce=new Uint8Array(b.getImageTranscodedSizeInBytes(J,ie,0,L));const Se=b.transcodeImage(ce,J,ie,j,L,0,-1,-1);if(W===i.HalfFloatType&&(ce=new Uint16Array(ce.buffer,ce.byteOffset,ce.byteLength/Uint16Array.BYTES_PER_ELEMENT)),!Se)throw u(),new Error("THREE.KTX2Loader: .transcodeImage failed.");ee.push(ce)}const De=p(ee);X.push({data:De,width:$,height:ue}),V.push(De.buffer)}K.push({mipmaps:X,width:C,height:E,format:Y,type:W})}return u(),{faces:K,buffers:V,width:C,height:E,hasAlpha:D,dfdFlags:S,format:Y,type:W}}const c=[{if:"astcSupported",basisFormat:[n.UASTC],transcoderFormat:[a.ASTC_4x4,a.ASTC_4x4],engineFormat:[s.RGBA_ASTC_4x4_Format,s.RGBA_ASTC_4x4_Format],engineType:[i.UnsignedByteType],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[a.BC7_M5,a.BC7_M5],engineFormat:[s.RGBA_BPTC_Format,s.RGBA_BPTC_Format],engineType:[i.UnsignedByteType],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[a.BC1,a.BC3],engineFormat:[s.RGBA_S3TC_DXT1_Format,s.RGBA_S3TC_DXT5_Format],engineType:[i.UnsignedByteType],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[a.ETC1,a.ETC2],engineFormat:[s.RGB_ETC2_Format,s.RGBA_ETC2_EAC_Format],engineType:[i.UnsignedByteType],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[a.ETC1],engineFormat:[s.RGB_ETC1_Format],engineType:[i.UnsignedByteType],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[a.PVRTC1_4_RGB,a.PVRTC1_4_RGBA],engineFormat:[s.RGB_PVRTC_4BPPV1_Format,s.RGBA_PVRTC_4BPPV1_Format],engineType:[i.UnsignedByteType],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0},{if:"bptcSupported",basisFormat:[n.UASTC_HDR],transcoderFormat:[a.BC6H],engineFormat:[s.RGB_BPTC_UNSIGNED_Format],engineType:[i.HalfFloatType],priorityHDR:1,needsPowerOfTwo:!1},{basisFormat:[n.ETC1S,n.UASTC],transcoderFormat:[a.RGBA32,a.RGBA32],engineFormat:[s.RGBAFormat,s.RGBAFormat],engineType:[i.UnsignedByteType,i.UnsignedByteType],priorityETC1S:100,priorityUASTC:100,needsPowerOfTwo:!1},{basisFormat:[n.UASTC_HDR],transcoderFormat:[a.RGBA_HALF],engineFormat:[s.RGBAFormat],engineType:[i.HalfFloatType],priorityHDR:100,needsPowerOfTwo:!1}],l={[n.ETC1S]:c.filter(f=>f.basisFormat.includes(n.ETC1S)).sort((f,b)=>f.priorityUASTC-b.priorityUASTC),[n.UASTC]:c.filter(f=>f.basisFormat.includes(n.UASTC)).sort((f,b)=>f.priorityUASTC-b.priorityUASTC),[n.UASTC_HDR]:c.filter(f=>f.basisFormat.includes(n.UASTC_HDR)).sort((f,b)=>f.priorityHDR-b.priorityHDR)};function h(f,b,u,I){const C=l[f];for(let E=0;E<C.length;E++){const y=C[E];if(y.if&&!o[y.if]||!y.basisFormat.includes(f)||I&&y.transcoderFormat.length<2||y.needsPowerOfTwo&&!(d(b)&&d(u)))continue;const w=y.transcoderFormat[I?1:0],x=y.engineFormat[I?1:0],D=y.engineType[0];return{transcoderFormat:w,engineFormat:x,engineType:D}}throw new Error("THREE.KTX2Loader: Failed to identify transcoding target.")}function d(f){return f<=2?!0:(f&f-1)===0&&f!==0}function p(f){if(f.length===1)return f[0];let b=0;for(let C=0;C<f.length;C++){const E=f[C];b+=E.byteLength}const u=new Uint8Array(b);let I=0;for(let C=0;C<f.length;C++){const E=f[C];u.set(E,I),I+=E.byteLength}return u}};const zA=new Set([Pt,Ss,bi,si]),Ks={[wn]:Pt,[En]:Pt,[fn]:Pt,[mn]:Pt,[Bn]:bi,[In]:bi,[pn]:bi,[un]:bi,[Cn]:si,[bn]:si,[dn]:si,[gn]:si,[Qn]:Ss,[yn]:Ss,[vn]:za,[xn]:qa,[Gs]:Yi,[GA]:Yi,[PA]:Yi,[Dn]:ja,[Sn]:ja,[RA]:xs,[MA]:xs,[DA]:Ha,[TA]:Ha,[LA]:Oa,[_A]:Oa,[FA]:vs,[kA]:vs,[UA]:Qs,[NA]:Qs},wi={[wn]:ut,[En]:Ze,[fn]:pt,[mn]:pt,[Bn]:ut,[In]:Ze,[pn]:pt,[un]:pt,[Cn]:ut,[bn]:Ze,[dn]:pt,[gn]:pt,[Qn]:Ka,[yn]:Ya,[vn]:pt,[xn]:pt,[Gs]:Ze,[Dn]:pt,[Sn]:pt};async function YA(o){const{vkFormat:e}=o;if(Ks[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;o.supercompressionScheme===ln&&(Ys||(Ys=new Promise(async n=>{const r=new HA;await r.init(),n(r)})),t=await Ys);const s=[];for(let n=0;n<o.levels.length;n++){const r=Math.max(1,o.pixelWidth>>n),A=Math.max(1,o.pixelHeight>>n),c=o.pixelDepth?Math.max(1,o.pixelDepth>>n):0,l=o.levels[n];let h;if(o.supercompressionScheme===wA)h=l.levelData;else if(o.supercompressionScheme===ln)h=t.decode(l.levelData,l.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let d;wi[e]===ut?d=new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):wi[e]===Ze?d=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):wi[e]===Ka||wi[e]===Ya?d=new Uint32Array(h.buffer,h.byteOffset,h.byteLength/Uint32Array.BYTES_PER_ELEMENT):d=h,s.push({data:d,width:r,height:A,depth:c})}const i=o.levelCount===0||s.length>1;let a;if(zA.has(Ks[e]))a=o.pixelDepth===0?new gr(s[0].data,o.pixelWidth,o.pixelHeight):new dr(s[0].data,o.pixelWidth,o.pixelHeight,o.pixelDepth),a.minFilter=i?fs:Gi,a.magFilter=Gi,a.generateMipmaps=o.levelCount===0;else{if(o.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");a=new mi(s,o.pixelWidth,o.pixelHeight),a.minFilter=i?di:st,a.magFilter=st}return a.mipmaps=s,a.type=wi[e],a.format=Ks[e],a.colorSpace=Mn(o),a.needsUpdate=!0,Promise.resolve(a)}function Mn(o){const e=o.dataFormatDescriptor[0];return e.colorPrimaries===vA?e.transferFunction===hn?le:Ve:e.colorPrimaries===xA?e.transferFunction===hn?jA:qA:e.colorPrimaries===QA?zi:(console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),zi)}const _n=new br;_n.camera=new qi,Ct.basic,Ct.basic,Ct.points,Ct.standard,Ct.physical,Ct.phong;var yi=function(){var o=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(l){l.preventDefault(),s(++o%e.children.length)},!1);function t(l){return e.appendChild(l.dom),l}function s(l){for(var h=0;h<e.children.length;h++)e.children[h].style.display=h===l?"block":"none";o=l}var i=(performance||Date).now(),a=i,n=0,r=t(new yi.Panel("FPS","#0ff","#002")),A=t(new yi.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new yi.Panel("MB","#f08","#201"));return s(0),{REVISION:16,dom:e,addPanel:t,showPanel:s,begin:function(){i=(performance||Date).now()},end:function(){n++;var l=(performance||Date).now();if(A.update(l-i,200),l>=a+1e3&&(r.update(n*1e3/(l-a),100),a=l,n=0,c)){var h=performance.memory;c.update(h.usedJSHeapSize/1048576,h.jsHeapSizeLimit/1048576)}return l},update:function(){i=this.end()},domElement:e,setMode:s}};yi.Panel=function(o,e,t){var s=1/0,i=0,a=Math.round,n=a(window.devicePixelRatio||1),r=80*n,A=48*n,c=3*n,l=2*n,h=3*n,d=15*n,p=74*n,f=30*n,b=document.createElement("canvas");b.width=r,b.height=A,b.style.cssText="width:80px;height:48px";var u=b.getContext("2d");return u.font="bold "+9*n+"px Helvetica,Arial,sans-serif",u.textBaseline="top",u.fillStyle=t,u.fillRect(0,0,r,A),u.fillStyle=e,u.fillText(o,c,l),u.fillRect(h,d,p,f),u.fillStyle=t,u.globalAlpha=.9,u.fillRect(h,d,p,f),{dom:b,update:function(I,C){s=Math.min(s,I),i=Math.max(i,I),u.fillStyle=t,u.globalAlpha=1,u.fillRect(0,0,r,d),u.fillStyle=e,u.fillText(a(I)+" "+o+" ("+a(s)+"-"+a(i)+")",c,l),u.drawImage(b,h+n,d,p-n,f,h,d,p-n,f),u.fillRect(h+p-n,d,n,f),u.fillStyle=t,u.globalAlpha=.9,u.fillRect(h+p-n,d,n,a((1-I/C)*f))}}};class KA extends Ir{constructor(e,t={}){const s=t.font;if(s===void 0)super();else{const i=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(i,t)}this.type="TextGeometry"}}class JA extends St{constructor(e){super(e)}load(e,t,s,i){const a=this,n=new gt(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,function(r){const A=a.parse(JSON.parse(r));t&&t(A)},s,i)}parse(e){return new Ln(e)}}class Ln{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const s=[],i=WA(e,t,this.data);for(let a=0,n=i.length;a<n;a++)s.push(...i[a].toShapes());return s}}function WA(o,e,t){const s=Array.from(o),i=e/t.resolution,a=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*i,n=[];let r=0,A=0;for(let c=0;c<s.length;c++){const l=s[c];if(l===`
|
|
4
|
+
`)r=0,A-=a;else{const h=VA(l,i,r,A,t);r+=h.offsetX,n.push(h.path)}}return n}function VA(o,e,t,s,i){const a=i.glyphs[o]||i.glyphs["?"];if(!a){console.error('THREE.Font: character "'+o+'" does not exists in font family '+i.familyName+".");return}const n=new Er;let r,A,c,l,h,d,p,f;if(a.o){const b=a._cachedOutline||(a._cachedOutline=a.o.split(" "));for(let u=0,I=b.length;u<I;)switch(b[u++]){case"m":r=b[u++]*e+t,A=b[u++]*e+s,n.moveTo(r,A);break;case"l":r=b[u++]*e+t,A=b[u++]*e+s,n.lineTo(r,A);break;case"q":c=b[u++]*e+t,l=b[u++]*e+s,h=b[u++]*e+t,d=b[u++]*e+s,n.quadraticCurveTo(h,d,c,l);break;case"b":c=b[u++]*e+t,l=b[u++]*e+s,h=b[u++]*e+t,d=b[u++]*e+s,p=b[u++]*e+t,f=b[u++]*e+s,n.bezierCurveTo(h,d,p,f,c,l);break}}return{offsetX:a.ha*e,path:n}}var ve=Uint8Array,nt=Uint16Array,Js=Int32Array,Vi=new ve([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]),Xi=new ve([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]),Ws=new ve([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),kn=function(o,e){for(var t=new nt(31),s=0;s<31;++s)t[s]=e+=1<<o[s-1];for(var i=new Js(t[30]),s=1;s<30;++s)for(var a=t[s];a<t[s+1];++a)i[a]=a-t[s]<<5|s;return{b:t,r:i}},Fn=kn(Vi,2),Nn=Fn.b,Vs=Fn.r;Nn[28]=258,Vs[258]=28;for(var Un=kn(Xi,0),XA=Un.b,Pn=Un.r,Xs=new nt(32768),Ie=0;Ie<32768;++Ie){var Ht=(Ie&43690)>>1|(Ie&21845)<<1;Ht=(Ht&52428)>>2|(Ht&13107)<<2,Ht=(Ht&61680)>>4|(Ht&3855)<<4,Xs[Ie]=((Ht&65280)>>8|(Ht&255)<<8)>>1}for(var Bt=function(o,e,t){for(var s=o.length,i=0,a=new nt(e);i<s;++i)o[i]&&++a[o[i]-1];var n=new nt(e);for(i=1;i<e;++i)n[i]=n[i-1]+a[i-1]<<1;var r;if(t){r=new nt(1<<e);var A=15-e;for(i=0;i<s;++i)if(o[i])for(var c=i<<4|o[i],l=e-o[i],h=n[o[i]-1]++<<l,d=h|(1<<l)-1;h<=d;++h)r[Xs[h]>>A]=c}else for(r=new nt(s),i=0;i<s;++i)o[i]&&(r[i]=Xs[n[o[i]-1]++]>>15-o[i]);return r},jt=new ve(288),Ie=0;Ie<144;++Ie)jt[Ie]=8;for(var Ie=144;Ie<256;++Ie)jt[Ie]=9;for(var Ie=256;Ie<280;++Ie)jt[Ie]=7;for(var Ie=280;Ie<288;++Ie)jt[Ie]=8;for(var Qi=new ve(32),Ie=0;Ie<32;++Ie)Qi[Ie]=5;var ZA=Bt(jt,9,0),$A=Bt(jt,9,1),ec=Bt(Qi,5,0),tc=Bt(Qi,5,1),Zs=function(o){for(var e=o[0],t=1;t<o.length;++t)o[t]>e&&(e=o[t]);return e},ft=function(o,e,t){var s=e/8|0;return(o[s]|o[s+1]<<8)>>(e&7)&t},$s=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},ea=function(o){return(o+7)/8|0},ta=function(o,e,t){return(t==null||t>o.length)&&(t=o.length),new ve(o.subarray(e,t))},ic=["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"],et=function(o,e,t){var s=new Error(e||ic[o]);if(s.code=o,Error.captureStackTrace&&Error.captureStackTrace(s,et),!t)throw s;return s},sc=function(o,e,t,s){var i=o.length,a=0;if(!i||e.f&&!e.l)return t||new ve(0);var n=!t,r=n||e.i!=2,A=e.i;n&&(t=new ve(i*3));var c=function(Le){var Ut=t.length;if(Le>Ut){var ze=new ve(Math.max(Ut*2,Le));ze.set(t),t=ze}},l=e.f||0,h=e.p||0,d=e.b||0,p=e.l,f=e.d,b=e.m,u=e.n,I=i*8;do{if(!p){l=ft(o,h,1);var C=ft(o,h+1,3);if(h+=3,C)if(C==1)p=$A,f=tc,b=9,u=5;else if(C==2){var E=ft(o,h,31)+257,y=ft(o,h+10,15)+4,w=E+ft(o,h+5,31)+1;h+=14;for(var x=new ve(w),D=new ve(19),S=0;S<y;++S)D[Ws[S]]=ft(o,h+S*3,7);h+=y*3;for(var L=Zs(D),Y=(1<<L)-1,W=Bt(D,L,1),S=0;S<w;){var K=W[ft(o,h,Y)];h+=K&15;var V=K>>4;if(V<16)x[S++]=V;else{var j=0,X=0;for(V==16?(X=3+ft(o,h,3),h+=2,j=x[S-1]):V==17?(X=3+ft(o,h,7),h+=3):V==18&&(X=11+ft(o,h,127),h+=7);X--;)x[S++]=j}}var J=x.subarray(0,E),ee=x.subarray(E);b=Zs(J),u=Zs(ee),p=Bt(J,b,1),f=Bt(ee,u,1)}else et(1);else{var V=ea(h)+4,$=o[V-4]|o[V-3]<<8,ue=V+$;if(ue>i){A&&et(0);break}r&&c(d+$),t.set(o.subarray(V,ue),d),e.b=d+=$,e.p=h=ue*8,e.f=l;continue}if(h>I){A&&et(0);break}}r&&c(d+131072);for(var De=(1<<b)-1,ie=(1<<u)-1,oe=h;;oe=h){var j=p[$s(o,h)&De],ce=j>>4;if(h+=j&15,h>I){A&&et(0);break}if(j||et(2),ce<256)t[d++]=ce;else if(ce==256){oe=h,p=null;break}else{var Se=ce-254;if(ce>264){var S=ce-257,fe=Vi[S];Se=ft(o,h,(1<<fe)-1)+Nn[S],h+=fe}var qe=f[$s(o,h)&ie],Ft=qe>>4;qe||et(3),h+=qe&15;var ee=XA[Ft];if(Ft>3){var fe=Xi[Ft];ee+=$s(o,h)&(1<<fe)-1,h+=fe}if(h>I){A&&et(0);break}r&&c(d+131072);var Nt=d+Se;if(d<ee){var ti=a-ee,Fe=Math.min(ee,Nt);for(ti+d<0&&et(3);d<Fe;++d)t[d]=s[ti+d]}for(;d<Nt;++d)t[d]=t[d-ee]}}e.l=p,e.p=oe,e.b=d,e.f=l,p&&(l=1,e.m=b,e.d=f,e.n=u)}while(!l);return d!=t.length&&n?ta(t,0,d):t.subarray(0,d)},Lt=function(o,e,t){t<<=e&7;var s=e/8|0;o[s]|=t,o[s+1]|=t>>8},vi=function(o,e,t){t<<=e&7;var s=e/8|0;o[s]|=t,o[s+1]|=t>>8,o[s+2]|=t>>16},ia=function(o,e){for(var t=[],s=0;s<o.length;++s)o[s]&&t.push({s,f:o[s]});var i=t.length,a=t.slice();if(!i)return{t:jn,l:0};if(i==1){var n=new ve(t[0].s+1);return n[t[0].s]=1,{t:n,l:1}}t.sort(function(w,x){return w.f-x.f}),t.push({s:-1,f:25001});var r=t[0],A=t[1],c=0,l=1,h=2;for(t[0]={s:-1,f:r.f+A.f,l:r,r:A};l!=i-1;)r=t[t[c].f<t[h].f?c++:h++],A=t[c!=l&&t[c].f<t[h].f?c++:h++],t[l++]={s:-1,f:r.f+A.f,l:r,r:A};for(var d=a[0].s,s=1;s<i;++s)a[s].s>d&&(d=a[s].s);var p=new nt(d+1),f=sa(t[l-1],p,0);if(f>e){var s=0,b=0,u=f-e,I=1<<u;for(a.sort(function(x,D){return p[D.s]-p[x.s]||x.f-D.f});s<i;++s){var C=a[s].s;if(p[C]>e)b+=I-(1<<f-p[C]),p[C]=e;else break}for(b>>=u;b>0;){var E=a[s].s;p[E]<e?b-=1<<e-p[E]++-1:++s}for(;s>=0&&b;--s){var y=a[s].s;p[y]==e&&(--p[y],++b)}f=e}return{t:new ve(p),l:f}},sa=function(o,e,t){return o.s==-1?Math.max(sa(o.l,e,t+1),sa(o.r,e,t+1)):e[o.s]=t},Gn=function(o){for(var e=o.length;e&&!o[--e];);for(var t=new nt(++e),s=0,i=o[0],a=1,n=function(A){t[s++]=A},r=1;r<=e;++r)if(o[r]==i&&r!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)n(32754);a>2&&(n(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(n(i),--a;a>6;a-=6)n(8304);a>2&&(n(a-3<<5|8208),a=0)}for(;a--;)n(i);a=1,i=o[r]}return{c:t.subarray(0,s),n:e}},xi=function(o,e){for(var t=0,s=0;s<e.length;++s)t+=o[s]*e[s];return t},On=function(o,e,t){var s=t.length,i=ea(e+2);o[i]=s&255,o[i+1]=s>>8,o[i+2]=o[i]^255,o[i+3]=o[i+1]^255;for(var a=0;a<s;++a)o[i+a+4]=t[a];return(i+4+s)*8},Hn=function(o,e,t,s,i,a,n,r,A,c,l){Lt(e,l++,t),++i[256];for(var h=ia(i,15),d=h.t,p=h.l,f=ia(a,15),b=f.t,u=f.l,I=Gn(d),C=I.c,E=I.n,y=Gn(b),w=y.c,x=y.n,D=new nt(19),S=0;S<C.length;++S)++D[C[S]&31];for(var S=0;S<w.length;++S)++D[w[S]&31];for(var L=ia(D,7),Y=L.t,W=L.l,K=19;K>4&&!Y[Ws[K-1]];--K);var V=c+5<<3,j=xi(i,jt)+xi(a,Qi)+n,X=xi(i,d)+xi(a,b)+n+14+3*K+xi(D,Y)+2*D[16]+3*D[17]+7*D[18];if(A>=0&&V<=j&&V<=X)return On(e,l,o.subarray(A,A+c));var J,ee,$,ue;if(Lt(e,l,1+(X<j)),l+=2,X<j){J=Bt(d,p,0),ee=d,$=Bt(b,u,0),ue=b;var De=Bt(Y,W,0);Lt(e,l,E-257),Lt(e,l+5,x-1),Lt(e,l+10,K-4),l+=14;for(var S=0;S<K;++S)Lt(e,l+3*S,Y[Ws[S]]);l+=3*K;for(var ie=[C,w],oe=0;oe<2;++oe)for(var ce=ie[oe],S=0;S<ce.length;++S){var Se=ce[S]&31;Lt(e,l,De[Se]),l+=Y[Se],Se>15&&(Lt(e,l,ce[S]>>5&127),l+=ce[S]>>12)}}else J=ZA,ee=jt,$=ec,ue=Qi;for(var S=0;S<r;++S){var fe=s[S];if(fe>255){var Se=fe>>18&31;vi(e,l,J[Se+257]),l+=ee[Se+257],Se>7&&(Lt(e,l,fe>>23&31),l+=Vi[Se]);var qe=fe&31;vi(e,l,$[qe]),l+=ue[qe],qe>3&&(vi(e,l,fe>>5&8191),l+=Xi[qe])}else vi(e,l,J[fe]),l+=ee[fe]}return vi(e,l,J[256]),l+ee[256]},ac=new Js([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),jn=new ve(0),nc=function(o,e,t,s,i,a){var n=a.z||o.length,r=new ve(s+n+5*(1+Math.ceil(n/7e3))+i),A=r.subarray(s,r.length-i),c=a.l,l=(a.r||0)&7;if(e){l&&(A[0]=a.r>>3);for(var h=ac[e-1],d=h>>13,p=h&8191,f=(1<<t)-1,b=a.p||new nt(32768),u=a.h||new nt(f+1),I=Math.ceil(t/3),C=2*I,E=function(Ne){return(o[Ne]^o[Ne+1]<<I^o[Ne+2]<<C)&f},y=new Js(25e3),w=new nt(288),x=new nt(32),D=0,S=0,L=a.i||0,Y=0,W=a.w||0,K=0;L+2<n;++L){var V=E(L),j=L&32767,X=u[V];if(b[j]=X,u[V]=j,W<=L){var J=n-L;if((D>7e3||Y>24576)&&(J>423||!c)){l=Hn(o,A,0,y,w,x,S,Y,K,L-K,l),Y=D=S=0,K=L;for(var ee=0;ee<286;++ee)w[ee]=0;for(var ee=0;ee<30;++ee)x[ee]=0}var $=2,ue=0,De=p,ie=j-X&32767;if(J>2&&V==E(L-ie))for(var oe=Math.min(d,J)-1,ce=Math.min(32767,L),Se=Math.min(258,J);ie<=ce&&--De&&j!=X;){if(o[L+$]==o[L+$-ie]){for(var fe=0;fe<Se&&o[L+fe]==o[L+fe-ie];++fe);if(fe>$){if($=fe,ue=ie,fe>oe)break;for(var qe=Math.min(ie,fe-2),Ft=0,ee=0;ee<qe;++ee){var Nt=L-ie+ee&32767,ti=b[Nt],Fe=Nt-ti&32767;Fe>Ft&&(Ft=Fe,X=Nt)}}}j=X,X=b[j],ie+=j-X&32767}if(ue){y[Y++]=268435456|Vs[$]<<18|Pn[ue];var Le=Vs[$]&31,Ut=Pn[ue]&31;S+=Vi[Le]+Xi[Ut],++w[257+Le],++x[Ut],W=L+$,++D}else y[Y++]=o[L],++w[o[L]]}}for(L=Math.max(L,W);L<n;++L)y[Y++]=o[L],++w[o[L]];l=Hn(o,A,c,y,w,x,S,Y,K,L-K,l),c||(a.r=l&7|A[l/8|0]<<3,l-=7,a.h=u,a.p=b,a.i=L,a.w=W)}else{for(var L=a.w||0;L<n+c;L+=65535){var ze=L+65535;ze>=n&&(A[l/8|0]=c,ze=n),l=On(A,l+1,o.subarray(L,ze))}a.i=n}return ta(r,0,s+ea(l)+i)},oc=function(){for(var o=new Int32Array(256),e=0;e<256;++e){for(var t=e,s=9;--s;)t=(t&1&&-306674912)^t>>>1;o[e]=t}return o}(),rc=function(){var o=-1;return{p:function(e){for(var t=o,s=0;s<e.length;++s)t=oc[t&255^e[s]]^t>>>8;o=t},d:function(){return~o}}},Ac=function(o,e,t,s,i){if(!i&&(i={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),n=new ve(a.length+o.length);n.set(a),n.set(o,a.length),o=n,i.w=a.length}return nc(o,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(o.length)))*1.5):20:12+e.mem,t,s,i)},qn=function(o,e){var t={};for(var s in o)t[s]=o[s];for(var s in e)t[s]=e[s];return t},Ue=function(o,e,t){for(;t;++e)o[e]=t,t>>>=8},cc=function(o,e){return((o[0]&15)!=8||o[0]>>4>7||(o[0]<<8|o[1])%31)&&et(6,"invalid zlib data"),(o[1]>>5&1)==1&&et(6,"invalid zlib data: "+(o[1]&32?"need":"unexpected")+" dictionary"),(o[1]>>3&4)+2};function lc(o,e){return Ac(o,e||{},0,0)}function Si(o,e){return sc(o.subarray(cc(o),-4),{i:2},e,e)}var zn=function(o,e,t,s){for(var i in o){var a=o[i],n=e+i,r=s;Array.isArray(a)&&(r=qn(s,a[1]),a=a[0]),a instanceof ve?t[n]=[a,r]:(t[n+="/"]=[new ve(0),r],zn(a,n,t,s))}},Yn=typeof TextEncoder<"u"&&new TextEncoder,hc=typeof TextDecoder<"u"&&new TextDecoder,gc=0;try{hc.decode(jn,{stream:!0}),gc=1}catch{}function aa(o,e){var t;if(Yn)return Yn.encode(o);for(var s=o.length,i=new ve(o.length+(o.length>>1)),a=0,n=function(l){i[a++]=l},t=0;t<s;++t){if(a+5>i.length){var r=new ve(a+8+(s-t<<1));r.set(i),i=r}var A=o.charCodeAt(t);A<128||e?n(A):A<2048?(n(192|A>>6),n(128|A&63)):A>55295&&A<57344?(A=65536+(A&1047552)|o.charCodeAt(++t)&1023,n(240|A>>18),n(128|A>>12&63),n(128|A>>6&63),n(128|A&63)):(n(224|A>>12),n(128|A>>6&63),n(128|A&63))}return ta(i,0,a)}var na=function(o){var e=0;if(o)for(var t in o){var s=o[t].length;s>65535&&et(9),e+=s+4}return e},Kn=function(o,e,t,s,i,a,n,r){var A=s.length,c=t.extra,l=r&&r.length,h=na(c);Ue(o,e,n!=null?33639248:67324752),e+=4,n!=null&&(o[e++]=20,o[e++]=t.os),o[e]=20,e+=2,o[e++]=t.flag<<1|(a<0&&8),o[e++]=i&&8,o[e++]=t.compression&255,o[e++]=t.compression>>8;var d=new Date(t.mtime==null?Date.now():t.mtime),p=d.getFullYear()-1980;if((p<0||p>119)&&et(10),Ue(o,e,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),e+=4,a!=-1&&(Ue(o,e,t.crc),Ue(o,e+4,a<0?-a-2:a),Ue(o,e+8,t.size)),Ue(o,e+12,A),Ue(o,e+14,h),e+=16,n!=null&&(Ue(o,e,l),Ue(o,e+6,t.attrs),Ue(o,e+10,n),e+=14),o.set(s,e),e+=A,h)for(var f in c){var b=c[f],u=b.length;Ue(o,e,+f),Ue(o,e+2,u),o.set(b,e+4),e+=4+u}return l&&(o.set(r,e),e+=l),e},dc=function(o,e,t,s,i){Ue(o,e,101010256),Ue(o,e+8,t),Ue(o,e+10,t),Ue(o,e+12,s),Ue(o,e+16,i)};function pc(o,e){e||(e={});var t={},s=[];zn(o,"",t,e);var i=0,a=0;for(var n in t){var r=t[n],A=r[0],c=r[1],l=c.level==0?0:8,h=aa(n),d=h.length,p=c.comment,f=p&&aa(p),b=f&&f.length,u=na(c.extra);d>65535&&et(11);var I=l?lc(A,c):A,C=I.length,E=rc();E.p(A),s.push(qn(c,{size:A.length,crc:E.d(),c:I,f:h,m:f,u:d!=n.length||f&&p.length!=b,o:i,compression:l})),i+=30+d+u+C,a+=76+2*(d+u)+(b||0)+C}for(var y=new ve(a+22),w=i,x=a-i,D=0;D<s.length;++D){var h=s[D];Kn(y,h.o,h,h.f,h.u,h.c.length);var S=30+h.f.length+na(h.extra);y.set(h.c,h.o+S),Kn(y,i,h,h.f,h.u,h.c.length,h.o,h.m),i+=16+S+(h.m?h.m.length:0)}return dc(y,i,s.length,x,w),y}class uc extends Ja{constructor(e){super(e),this.type=Ze}parse(e){const t=Math.pow(2.7182818,2.2);function s(g,m){let B=0;for(let T=0;T<65536;++T)(T==0||g[T>>3]&1<<(T&7))&&(m[B++]=T);const Q=B-1;for(;B<65536;)m[B++]=0;return Q}function i(g){for(let m=0;m<16384;m++)g[m]={},g[m].len=0,g[m].lit=0,g[m].p=null}const a={l:0,c:0,lc:0};function n(g,m,B,Q,T){for(;B<g;)m=m<<8|Ut(Q,T),B+=8;B-=g,a.l=m>>B&(1<<g)-1,a.c=m,a.lc=B}const r=new Array(59);function A(g){for(let B=0;B<=58;++B)r[B]=0;for(let B=0;B<65537;++B)r[g[B]]+=1;let m=0;for(let B=58;B>0;--B){const Q=m+r[B]>>1;r[B]=m,m=Q}for(let B=0;B<65537;++B){const Q=g[B];Q>0&&(g[B]=Q|r[Q]++<<6)}}function c(g,m,B,Q,T,v){const _=m;let N=0,k=0;for(;Q<=T;Q++){if(_.value-m.value>B)return!1;n(6,N,k,g,_);const M=a.l;if(N=a.c,k=a.lc,v[Q]=M,M==63){if(_.value-m.value>B)throw new Error("Something wrong with hufUnpackEncTable");n(8,N,k,g,_);let R=a.l+6;if(N=a.c,k=a.lc,Q+R>T+1)throw new Error("Something wrong with hufUnpackEncTable");for(;R--;)v[Q++]=0;Q--}else if(M>=59){let R=M-59+2;if(Q+R>T+1)throw new Error("Something wrong with hufUnpackEncTable");for(;R--;)v[Q++]=0;Q--}}A(v)}function l(g){return g&63}function h(g){return g>>6}function d(g,m,B,Q){for(;m<=B;m++){const T=h(g[m]),v=l(g[m]);if(T>>v)throw new Error("Invalid table entry");if(v>14){const _=Q[T>>v-14];if(_.len)throw new Error("Invalid table entry");if(_.lit++,_.p){const N=_.p;_.p=new Array(_.lit);for(let k=0;k<_.lit-1;++k)_.p[k]=N[k]}else _.p=new Array(1);_.p[_.lit-1]=m}else if(v){let _=0;for(let N=1<<14-v;N>0;N--){const k=Q[(T<<14-v)+_];if(k.len||k.p)throw new Error("Invalid table entry");k.len=v,k.lit=m,_++}}}return!0}const p={c:0,lc:0};function f(g,m,B,Q){g=g<<8|Ut(B,Q),m+=8,p.c=g,p.lc=m}const b={c:0,lc:0};function u(g,m,B,Q,T,v,_,N,k){if(g==m){Q<8&&(f(B,Q,T,v),B=p.c,Q=p.lc),Q-=8;let M=B>>Q;if(M=new Uint8Array([M])[0],N.value+M>k)return!1;const R=_[N.value-1];for(;M-- >0;)_[N.value++]=R}else if(N.value<k)_[N.value++]=g;else return!1;b.c=B,b.lc=Q}function I(g){return g&65535}function C(g){const m=I(g);return m>32767?m-65536:m}const E={a:0,b:0};function y(g,m){const B=C(g),Q=C(m),T=B+(Q&1)+(Q>>1),v=T,_=T-Q;E.a=v,E.b=_}function w(g,m){const B=I(g),Q=I(m),T=B-(Q>>1)&65535,v=Q+T-32768&65535;E.a=v,E.b=T}function x(g,m,B,Q,T,v,_){const N=_<16384,k=B>T?T:B;let M=1,R,P;for(;M<=k;)M<<=1;for(M>>=1,R=M,M>>=1;M>=1;){P=0;const U=P+v*(T-R),q=v*M,Z=v*R,G=Q*M,z=Q*R;let te,Ee,Qe,it;for(;P<=U;P+=Z){let me=P;const Ae=P+Q*(B-R);for(;me<=Ae;me+=z){const Te=me+G,rt=me+q,ke=rt+G;N?(y(g[me+m],g[rt+m]),te=E.a,Qe=E.b,y(g[Te+m],g[ke+m]),Ee=E.a,it=E.b,y(te,Ee),g[me+m]=E.a,g[Te+m]=E.b,y(Qe,it),g[rt+m]=E.a,g[ke+m]=E.b):(w(g[me+m],g[rt+m]),te=E.a,Qe=E.b,w(g[Te+m],g[ke+m]),Ee=E.a,it=E.b,w(te,Ee),g[me+m]=E.a,g[Te+m]=E.b,w(Qe,it),g[rt+m]=E.a,g[ke+m]=E.b)}if(B&M){const Te=me+q;N?y(g[me+m],g[Te+m]):w(g[me+m],g[Te+m]),te=E.a,g[Te+m]=E.b,g[me+m]=te}}if(T&M){let me=P;const Ae=P+Q*(B-R);for(;me<=Ae;me+=z){const Te=me+G;N?y(g[me+m],g[Te+m]):w(g[me+m],g[Te+m]),te=E.a,g[Te+m]=E.b,g[me+m]=te}}R=M,M>>=1}return P}function D(g,m,B,Q,T,v,_,N,k){let M=0,R=0;const P=_,U=Math.trunc(Q.value+(T+7)/8);for(;Q.value<U;)for(f(M,R,B,Q),M=p.c,R=p.lc;R>=14;){const Z=M>>R-14&16383,G=m[Z];if(G.len)R-=G.len,u(G.lit,v,M,R,B,Q,N,k,P),M=b.c,R=b.lc;else{if(!G.p)throw new Error("hufDecode issues");let z;for(z=0;z<G.lit;z++){const te=l(g[G.p[z]]);for(;R<te&&Q.value<U;)f(M,R,B,Q),M=p.c,R=p.lc;if(R>=te&&h(g[G.p[z]])==(M>>R-te&(1<<te)-1)){R-=te,u(G.p[z],v,M,R,B,Q,N,k,P),M=b.c,R=b.lc;break}}if(z==G.lit)throw new Error("hufDecode issues")}}const q=8-T&7;for(M>>=q,R-=q;R>0;){const Z=m[M<<14-R&16383];if(Z.len)R-=Z.len,u(Z.lit,v,M,R,B,Q,N,k,P),M=b.c,R=b.lc;else throw new Error("hufDecode issues")}return!0}function S(g,m,B,Q,T,v){const _={value:0},N=B.value,k=Le(m,B),M=Le(m,B);B.value+=4;const R=Le(m,B);if(B.value+=4,k<0||k>=65537||M<0||M>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const P=new Array(65537),U=new Array(16384);i(U);const q=Q-(B.value-N);if(c(g,B,q,k,M,P),R>8*(Q-(B.value-N)))throw new Error("Something wrong with hufUncompress");d(P,k,M,U),D(P,U,g,B,R,M,v,T,_)}function L(g,m,B){for(let Q=0;Q<B;++Q)m[Q]=g[m[Q]]}function Y(g){for(let m=1;m<g.length;m++){const B=g[m-1]+g[m]-128;g[m]=B}}function W(g,m){let B=0,Q=Math.floor((g.length+1)/2),T=0;const v=g.length-1;for(;!(T>v||(m[T++]=g[B++],T>v));)m[T++]=g[Q++]}function K(g){let m=g.byteLength;const B=new Array;let Q=0;const T=new DataView(g);for(;m>0;){const v=T.getInt8(Q++);if(v<0){const _=-v;m-=_+1;for(let N=0;N<_;N++)B.push(T.getUint8(Q++))}else{const _=v;m-=2;const N=T.getUint8(Q++);for(let k=0;k<_+1;k++)B.push(N)}}return B}function V(g,m,B,Q,T,v){let _=new DataView(v.buffer);const N=B[g.idx[0]].width,k=B[g.idx[0]].height,M=3,R=Math.floor(N/8),P=Math.ceil(N/8),U=Math.ceil(k/8),q=N-(P-1)*8,Z=k-(U-1)*8,G={value:0},z=new Array(M),te=new Array(M),Ee=new Array(M),Qe=new Array(M),it=new Array(M);for(let Ae=0;Ae<M;++Ae)it[Ae]=m[g.idx[Ae]],z[Ae]=Ae<1?0:z[Ae-1]+P*U,te[Ae]=new Float32Array(64),Ee[Ae]=new Uint16Array(64),Qe[Ae]=new Uint16Array(P*64);for(let Ae=0;Ae<U;++Ae){let Te=8;Ae==U-1&&(Te=Z);let rt=8;for(let ge=0;ge<P;++ge){ge==P-1&&(rt=q);for(let pe=0;pe<M;++pe)Ee[pe].fill(0),Ee[pe][0]=T[z[pe]++],j(G,Q,Ee[pe]),X(Ee[pe],te[pe]),J(te[pe]);ee(te);for(let pe=0;pe<M;++pe)$(te[pe],Qe[pe],ge*64)}let ke=0;for(let ge=0;ge<M;++ge){const pe=B[g.idx[ge]].type;for(let xt=8*Ae;xt<8*Ae+Te;++xt){ke=it[ge][xt];for(let gi=0;gi<R;++gi){const mt=gi*64+(xt&7)*8;_.setUint16(ke+0*pe,Qe[ge][mt+0],!0),_.setUint16(ke+2*pe,Qe[ge][mt+1],!0),_.setUint16(ke+4*pe,Qe[ge][mt+2],!0),_.setUint16(ke+6*pe,Qe[ge][mt+3],!0),_.setUint16(ke+8*pe,Qe[ge][mt+4],!0),_.setUint16(ke+10*pe,Qe[ge][mt+5],!0),_.setUint16(ke+12*pe,Qe[ge][mt+6],!0),_.setUint16(ke+14*pe,Qe[ge][mt+7],!0),ke+=16*pe}}if(R!=P)for(let xt=8*Ae;xt<8*Ae+Te;++xt){const gi=it[ge][xt]+8*R*2*pe,mt=R*64+(xt&7)*8;for(let Pi=0;Pi<rt;++Pi)_.setUint16(gi+Pi*2*pe,Qe[ge][mt+Pi],!0)}}}const me=new Uint16Array(N);_=new DataView(v.buffer);for(let Ae=0;Ae<M;++Ae){B[g.idx[Ae]].decoded=!0;const Te=B[g.idx[Ae]].type;if(B[Ae].type==2)for(let rt=0;rt<k;++rt){const ke=it[Ae][rt];for(let ge=0;ge<N;++ge)me[ge]=_.getUint16(ke+ge*2*Te,!0);for(let ge=0;ge<N;++ge)_.setFloat32(ke+ge*2*Te,H(me[ge]),!0)}}}function j(g,m,B){let Q,T=1;for(;T<64;)Q=m[g.value],Q==65280?T=64:Q>>8==255?T+=Q&255:(B[T]=Q,T++),g.value++}function X(g,m){m[0]=H(g[0]),m[1]=H(g[1]),m[2]=H(g[5]),m[3]=H(g[6]),m[4]=H(g[14]),m[5]=H(g[15]),m[6]=H(g[27]),m[7]=H(g[28]),m[8]=H(g[2]),m[9]=H(g[4]),m[10]=H(g[7]),m[11]=H(g[13]),m[12]=H(g[16]),m[13]=H(g[26]),m[14]=H(g[29]),m[15]=H(g[42]),m[16]=H(g[3]),m[17]=H(g[8]),m[18]=H(g[12]),m[19]=H(g[17]),m[20]=H(g[25]),m[21]=H(g[30]),m[22]=H(g[41]),m[23]=H(g[43]),m[24]=H(g[9]),m[25]=H(g[11]),m[26]=H(g[18]),m[27]=H(g[24]),m[28]=H(g[31]),m[29]=H(g[40]),m[30]=H(g[44]),m[31]=H(g[53]),m[32]=H(g[10]),m[33]=H(g[19]),m[34]=H(g[23]),m[35]=H(g[32]),m[36]=H(g[39]),m[37]=H(g[45]),m[38]=H(g[52]),m[39]=H(g[54]),m[40]=H(g[20]),m[41]=H(g[22]),m[42]=H(g[33]),m[43]=H(g[38]),m[44]=H(g[46]),m[45]=H(g[51]),m[46]=H(g[55]),m[47]=H(g[60]),m[48]=H(g[21]),m[49]=H(g[34]),m[50]=H(g[37]),m[51]=H(g[47]),m[52]=H(g[50]),m[53]=H(g[56]),m[54]=H(g[59]),m[55]=H(g[61]),m[56]=H(g[35]),m[57]=H(g[36]),m[58]=H(g[48]),m[59]=H(g[49]),m[60]=H(g[57]),m[61]=H(g[58]),m[62]=H(g[62]),m[63]=H(g[63])}function J(g){const m=.5*Math.cos(.7853975),B=.5*Math.cos(3.14159/16),Q=.5*Math.cos(3.14159/8),T=.5*Math.cos(3*3.14159/16),v=.5*Math.cos(5*3.14159/16),_=.5*Math.cos(3*3.14159/8),N=.5*Math.cos(7*3.14159/16),k=new Array(4),M=new Array(4),R=new Array(4),P=new Array(4);for(let U=0;U<8;++U){const q=U*8;k[0]=Q*g[q+2],k[1]=_*g[q+2],k[2]=Q*g[q+6],k[3]=_*g[q+6],M[0]=B*g[q+1]+T*g[q+3]+v*g[q+5]+N*g[q+7],M[1]=T*g[q+1]-N*g[q+3]-B*g[q+5]-v*g[q+7],M[2]=v*g[q+1]-B*g[q+3]+N*g[q+5]+T*g[q+7],M[3]=N*g[q+1]-v*g[q+3]+T*g[q+5]-B*g[q+7],R[0]=m*(g[q+0]+g[q+4]),R[3]=m*(g[q+0]-g[q+4]),R[1]=k[0]+k[3],R[2]=k[1]-k[2],P[0]=R[0]+R[1],P[1]=R[3]+R[2],P[2]=R[3]-R[2],P[3]=R[0]-R[1],g[q+0]=P[0]+M[0],g[q+1]=P[1]+M[1],g[q+2]=P[2]+M[2],g[q+3]=P[3]+M[3],g[q+4]=P[3]-M[3],g[q+5]=P[2]-M[2],g[q+6]=P[1]-M[1],g[q+7]=P[0]-M[0]}for(let U=0;U<8;++U)k[0]=Q*g[16+U],k[1]=_*g[16+U],k[2]=Q*g[48+U],k[3]=_*g[48+U],M[0]=B*g[8+U]+T*g[24+U]+v*g[40+U]+N*g[56+U],M[1]=T*g[8+U]-N*g[24+U]-B*g[40+U]-v*g[56+U],M[2]=v*g[8+U]-B*g[24+U]+N*g[40+U]+T*g[56+U],M[3]=N*g[8+U]-v*g[24+U]+T*g[40+U]-B*g[56+U],R[0]=m*(g[U]+g[32+U]),R[3]=m*(g[U]-g[32+U]),R[1]=k[0]+k[3],R[2]=k[1]-k[2],P[0]=R[0]+R[1],P[1]=R[3]+R[2],P[2]=R[3]-R[2],P[3]=R[0]-R[1],g[0+U]=P[0]+M[0],g[8+U]=P[1]+M[1],g[16+U]=P[2]+M[2],g[24+U]=P[3]+M[3],g[32+U]=P[3]-M[3],g[40+U]=P[2]-M[2],g[48+U]=P[1]-M[1],g[56+U]=P[0]-M[0]}function ee(g){for(let m=0;m<64;++m){const B=g[0][m],Q=g[1][m],T=g[2][m];g[0][m]=B+1.5747*T,g[1][m]=B-.1873*Q-.4682*T,g[2][m]=B+1.8556*Q}}function $(g,m,B){for(let Q=0;Q<64;++Q)m[B+Q]=ai.toHalfFloat(ue(g[Q]))}function ue(g){return g<=1?Math.sign(g)*Math.pow(Math.abs(g),2.2):Math.sign(g)*Math.pow(t,Math.abs(g)-1)}function De(g){return new DataView(g.array.buffer,g.offset.value,g.size)}function ie(g){const m=g.viewer.buffer.slice(g.offset.value,g.offset.value+g.size),B=new Uint8Array(K(m)),Q=new Uint8Array(B.length);return Y(B),W(B,Q),new DataView(Q.buffer)}function oe(g){const m=g.array.slice(g.offset.value,g.offset.value+g.size),B=Si(m),Q=new Uint8Array(B.length);return Y(B),W(B,Q),new DataView(Q.buffer)}function ce(g){const m=g.viewer,B={value:g.offset.value},Q=new Uint16Array(g.columns*g.lines*(g.inputChannels.length*g.type)),T=new Uint8Array(8192);let v=0;const _=new Array(g.inputChannels.length);for(let Z=0,G=g.inputChannels.length;Z<G;Z++)_[Z]={},_[Z].start=v,_[Z].end=_[Z].start,_[Z].nx=g.columns,_[Z].ny=g.lines,_[Z].size=g.type,v+=_[Z].nx*_[Z].ny*_[Z].size;const N=hi(m,B),k=hi(m,B);if(k>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(N<=k)for(let Z=0;Z<k-N+1;Z++)T[Z+N]=ze(m,B);const M=new Uint16Array(65536),R=s(T,M),P=Le(m,B);S(g.array,m,B,P,Q,v);for(let Z=0;Z<g.inputChannels.length;++Z){const G=_[Z];for(let z=0;z<_[Z].size;++z)x(Q,G.start+z,G.nx,G.size,G.ny,G.nx*G.size,R)}L(M,Q,v);let U=0;const q=new Uint8Array(Q.buffer.byteLength);for(let Z=0;Z<g.lines;Z++)for(let G=0;G<g.inputChannels.length;G++){const z=_[G],te=z.nx*z.size,Ee=new Uint8Array(Q.buffer,z.end*2,te*2);q.set(Ee,U),U+=te*2,z.end+=te}return new DataView(q.buffer)}function Se(g){const m=g.array.slice(g.offset.value,g.offset.value+g.size),B=Si(m),Q=g.inputChannels.length*g.lines*g.columns*g.totalBytes,T=new ArrayBuffer(Q),v=new DataView(T);let _=0,N=0;const k=new Array(4);for(let M=0;M<g.lines;M++)for(let R=0;R<g.inputChannels.length;R++){let P=0;switch(g.inputChannels[R].pixelType){case 1:k[0]=_,k[1]=k[0]+g.columns,_=k[1]+g.columns;for(let U=0;U<g.columns;++U){const q=B[k[0]++]<<8|B[k[1]++];P+=q,v.setUint16(N,P,!0),N+=2}break;case 2:k[0]=_,k[1]=k[0]+g.columns,k[2]=k[1]+g.columns,_=k[2]+g.columns;for(let U=0;U<g.columns;++U){const q=B[k[0]++]<<24|B[k[1]++]<<16|B[k[2]++]<<8;P+=q,v.setUint32(N,P,!0),N+=4}break}}return v}function fe(g){const m=g.viewer,B={value:g.offset.value},Q=new Uint8Array(g.columns*g.lines*(g.inputChannels.length*g.type*2)),T={version:Ne(m,B),unknownUncompressedSize:Ne(m,B),unknownCompressedSize:Ne(m,B),acCompressedSize:Ne(m,B),dcCompressedSize:Ne(m,B),rleCompressedSize:Ne(m,B),rleUncompressedSize:Ne(m,B),rleRawSize:Ne(m,B),totalAcUncompressedCount:Ne(m,B),totalDcUncompressedCount:Ne(m,B),acCompression:Ne(m,B)};if(T.version<2)throw new Error("EXRLoader.parse: "+zt.compression+" version "+T.version+" is unsupported");const v=new Array;let _=hi(m,B)-2;for(;_>0;){const G=qe(m.buffer,B),z=ze(m,B),te=z>>2&3,Ee=(z>>4)-1,Qe=new Int8Array([Ee])[0],it=ze(m,B);v.push({name:G,index:Qe,type:it,compression:te}),_-=G.length+3}const N=zt.channels,k=new Array(g.inputChannels.length);for(let G=0;G<g.inputChannels.length;++G){const z=k[G]={},te=N[G];z.name=te.name,z.compression=0,z.decoded=!1,z.type=te.pixelType,z.pLinear=te.pLinear,z.width=g.columns,z.height=g.lines}const M={idx:new Array(3)};for(let G=0;G<g.inputChannels.length;++G){const z=k[G];for(let te=0;te<v.length;++te){const Ee=v[te];z.name==Ee.name&&(z.compression=Ee.compression,Ee.index>=0&&(M.idx[Ee.index]=G),z.offset=G)}}let R,P,U;if(T.acCompressedSize>0)switch(T.acCompression){case 0:R=new Uint16Array(T.totalAcUncompressedCount),S(g.array,m,B,T.acCompressedSize,R,T.totalAcUncompressedCount);break;case 1:const G=g.array.slice(B.value,B.value+T.totalAcUncompressedCount),z=Si(G);R=new Uint16Array(z.buffer),B.value+=T.totalAcUncompressedCount;break}if(T.dcCompressedSize>0){const G={array:g.array,offset:B,size:T.dcCompressedSize};P=new Uint16Array(oe(G).buffer),B.value+=T.dcCompressedSize}if(T.rleRawSize>0){const G=g.array.slice(B.value,B.value+T.rleCompressedSize),z=Si(G);U=K(z.buffer),B.value+=T.rleCompressedSize}let q=0;const Z=new Array(k.length);for(let G=0;G<Z.length;++G)Z[G]=new Array;for(let G=0;G<g.lines;++G)for(let z=0;z<k.length;++z)Z[z].push(q),q+=k[z].width*g.type*2;V(M,Z,k,R,P,Q);for(let G=0;G<k.length;++G){const z=k[G];if(!z.decoded)switch(z.compression){case 2:let te=0,Ee=0;for(let Qe=0;Qe<g.lines;++Qe){let it=Z[G][te];for(let me=0;me<z.width;++me){for(let Ae=0;Ae<2*z.type;++Ae)Q[it++]=U[Ee+Ae*z.width*z.height];Ee++}te++}break;default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(Q.buffer)}function qe(g,m){const B=new Uint8Array(g);let Q=0;for(;B[m.value+Q]!=0;)Q+=1;const T=new TextDecoder().decode(B.slice(m.value,m.value+Q));return m.value=m.value+Q+1,T}function Ft(g,m,B){const Q=new TextDecoder().decode(new Uint8Array(g).slice(m.value,m.value+B));return m.value=m.value+B,Q}function Nt(g,m){const B=Fe(g,m),Q=Le(g,m);return[B,Q]}function ti(g,m){const B=Le(g,m),Q=Le(g,m);return[B,Q]}function Fe(g,m){const B=g.getInt32(m.value,!0);return m.value=m.value+4,B}function Le(g,m){const B=g.getUint32(m.value,!0);return m.value=m.value+4,B}function Ut(g,m){const B=g[m.value];return m.value=m.value+1,B}function ze(g,m){const B=g.getUint8(m.value);return m.value=m.value+1,B}const Ne=function(g,m){let B;return"getBigInt64"in DataView.prototype?B=Number(g.getBigInt64(m.value,!0)):B=g.getUint32(m.value+4,!0)+Number(g.getUint32(m.value,!0)<<32),m.value+=8,B};function He(g,m){const B=g.getFloat32(m.value,!0);return m.value+=4,B}function Uo(g,m){return ai.toHalfFloat(He(g,m))}function H(g){const m=(g&31744)>>10,B=g&1023;return(g>>15?-1:1)*(m?m===31?B?NaN:1/0:Math.pow(2,m-15)*(1+B/1024):6103515625e-14*(B/1024))}function hi(g,m){const B=g.getUint16(m.value,!0);return m.value+=2,B}function Po(g,m){return H(hi(g,m))}function Go(g,m,B,Q){const T=B.value,v=[];for(;B.value<T+Q-1;){const _=qe(m,B),N=Fe(g,B),k=ze(g,B);B.value+=3;const M=Fe(g,B),R=Fe(g,B);v.push({name:_,pixelType:N,pLinear:k,xSampling:M,ySampling:R})}return B.value+=1,v}function Oo(g,m){const B=He(g,m),Q=He(g,m),T=He(g,m),v=He(g,m),_=He(g,m),N=He(g,m),k=He(g,m),M=He(g,m);return{redX:B,redY:Q,greenX:T,greenY:v,blueX:_,blueY:N,whiteX:k,whiteY:M}}function Ho(g,m){const B=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],Q=ze(g,m);return B[Q]}function jo(g,m){const B=Fe(g,m),Q=Fe(g,m),T=Fe(g,m),v=Fe(g,m);return{xMin:B,yMin:Q,xMax:T,yMax:v}}function qo(g,m){const B=["INCREASING_Y","DECREASING_Y","RANDOM_Y"],Q=ze(g,m);return B[Q]}function zo(g,m){const B=["ENVMAP_LATLONG","ENVMAP_CUBE"],Q=ze(g,m);return B[Q]}function Yo(g,m){const B=["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"],Q=["ROUND_DOWN","ROUND_UP"],T=Le(g,m),v=Le(g,m),_=ze(g,m);return{xSize:T,ySize:v,levelMode:B[_&15],roundingMode:Q[_>>4]}}function Ko(g,m){const B=He(g,m),Q=He(g,m);return[B,Q]}function Jo(g,m){const B=He(g,m),Q=He(g,m),T=He(g,m);return[B,Q,T]}function Wo(g,m,B,Q,T){if(Q==="string"||Q==="stringvector"||Q==="iccProfile")return Ft(m,B,T);if(Q==="chlist")return Go(g,m,B,T);if(Q==="chromaticities")return Oo(g,B);if(Q==="compression")return Ho(g,B);if(Q==="box2i")return jo(g,B);if(Q==="envmap")return zo(g,B);if(Q==="tiledesc")return Yo(g,B);if(Q==="lineOrder")return qo(g,B);if(Q==="float")return He(g,B);if(Q==="v2f")return Ko(g,B);if(Q==="v3f")return Jo(g,B);if(Q==="int")return Fe(g,B);if(Q==="rational")return Nt(g,B);if(Q==="timecode")return ti(g,B);if(Q==="preview")return B.value+=T,"skipped";B.value+=T}function Vo(g,m){const B=Math.log2(g);return m=="ROUND_DOWN"?Math.floor(B):Math.ceil(B)}function Xo(g,m,B){let Q=0;switch(g.levelMode){case"ONE_LEVEL":Q=1;break;case"MIPMAP_LEVELS":Q=Vo(Math.max(m,B),g.roundingMode)+1;break;case"RIPMAP_LEVELS":throw new Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return Q}function xa(g,m,B,Q){const T=new Array(g);for(let v=0;v<g;v++){const _=1<<v;let N=m/_|0;Q=="ROUND_UP"&&N*_<m&&(N+=1);const k=Math.max(N,1);T[v]=(k+B-1)/B|0}return T}function Zo(){const g=this,m=g.offset,B={value:0};for(let Q=0;Q<g.tileCount;Q++){const T=Fe(g.viewer,m),v=Fe(g.viewer,m);m.value+=8,g.size=Le(g.viewer,m);const _=T*g.blockWidth,N=v*g.blockHeight;g.columns=_+g.blockWidth>g.width?g.width-_:g.blockWidth,g.lines=N+g.blockHeight>g.height?g.height-N:g.blockHeight;const k=g.columns*g.totalBytes,M=g.size<g.lines*k?g.uncompress(g):De(g);m.value+=g.size;for(let R=0;R<g.lines;R++){const P=R*g.columns*g.totalBytes;for(let U=0;U<g.inputChannels.length;U++){const q=zt.channels[U].name,Z=g.channelByteOffsets[q]*g.columns,G=g.decodeChannels[q];if(G===void 0)continue;B.value=P+Z;const z=(g.height-(1+N+R))*g.outLineWidth;for(let te=0;te<g.columns;te++){const Ee=z+(te+_)*g.outputChannels+G;g.byteArray[Ee]=g.getter(M,B)}}}}}function $o(){const g=this,m=g.offset,B={value:0};for(let Q=0;Q<g.height/g.blockHeight;Q++){const T=Fe(g.viewer,m)-zt.dataWindow.yMin;g.size=Le(g.viewer,m),g.lines=T+g.blockHeight>g.height?g.height-T:g.blockHeight;const v=g.columns*g.totalBytes,_=g.size<g.lines*v?g.uncompress(g):De(g);m.value+=g.size;for(let N=0;N<g.blockHeight;N++){const k=Q*g.blockHeight,M=N+g.scanOrder(k);if(M>=g.height)continue;const R=N*v,P=(g.height-1-M)*g.outLineWidth;for(let U=0;U<g.inputChannels.length;U++){const q=zt.channels[U].name,Z=g.channelByteOffsets[q]*g.columns,G=g.decodeChannels[q];if(G!==void 0){B.value=R+Z;for(let z=0;z<g.columns;z++){const te=P+z*g.outputChannels+G;g.byteArray[te]=g.getter(_,B)}}}}}}function er(g,m,B){const Q={};if(g.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");Q.version=g.getUint8(4);const T=g.getUint8(5);Q.spec={singleTile:!!(T&2),longName:!!(T&4),deepFormat:!!(T&8),multiPart:!!(T&16)},B.value=8;let v=!0;for(;v;){const _=qe(m,B);if(_==0)v=!1;else{const N=qe(m,B),k=Le(g,B),M=Wo(g,m,B,N,k);M===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${N}'.`):Q[_]=M}}if((T&-7)!=0)throw console.error("THREE.EXRHeader:",Q),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return Q}function tr(g,m,B,Q,T){const v={size:0,viewer:m,array:B,offset:Q,width:g.dataWindow.xMax-g.dataWindow.xMin+1,height:g.dataWindow.yMax-g.dataWindow.yMin+1,inputChannels:g.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:Ve};switch(g.compression){case"NO_COMPRESSION":v.blockHeight=1,v.uncompress=De;break;case"RLE_COMPRESSION":v.blockHeight=1,v.uncompress=ie;break;case"ZIPS_COMPRESSION":v.blockHeight=1,v.uncompress=oe;break;case"ZIP_COMPRESSION":v.blockHeight=16,v.uncompress=oe;break;case"PIZ_COMPRESSION":v.blockHeight=32,v.uncompress=ce;break;case"PXR24_COMPRESSION":v.blockHeight=16,v.uncompress=Se;break;case"DWAA_COMPRESSION":v.blockHeight=32,v.uncompress=fe;break;case"DWAB_COMPRESSION":v.blockHeight=256,v.uncompress=fe;break;default:throw new Error("EXRLoader.parse: "+g.compression+" is unsupported")}const _={};for(const R of g.channels)switch(R.name){case"Y":case"R":case"G":case"B":case"A":_[R.name]=!0,v.type=R.pixelType}let N=!1;if(_.R&&_.G&&_.B)N=!_.A,v.outputChannels=4,v.decodeChannels={R:0,G:1,B:2,A:3};else if(_.Y)v.outputChannels=1,v.decodeChannels={Y:0};else throw new Error("EXRLoader.parse: file contains unsupported data channels.");if(v.type==1)switch(T){case ut:v.getter=Po;break;case Ze:v.getter=hi;break}else if(v.type==2)switch(T){case ut:v.getter=He;break;case Ze:v.getter=Uo}else throw new Error("EXRLoader.parse: unsupported pixelType "+v.type+" for "+g.compression+".");v.columns=v.width;const k=v.width*v.height*v.outputChannels;switch(T){case ut:v.byteArray=new Float32Array(k),N&&v.byteArray.fill(1,0,k);break;case Ze:v.byteArray=new Uint16Array(k),N&&v.byteArray.fill(15360,0,k);break;default:console.error("THREE.EXRLoader: unsupported type: ",T);break}let M=0;for(const R of g.channels)v.decodeChannels[R.name]!==void 0&&(v.channelByteOffsets[R.name]=M),M+=R.pixelType*2;if(v.totalBytes=M,v.outLineWidth=v.width*v.outputChannels,g.lineOrder==="INCREASING_Y"?v.scanOrder=R=>R:v.scanOrder=R=>v.height-1-R,v.outputChannels==4?(v.format=Pt,v.colorSpace=Ve):(v.format=si,v.colorSpace=zi),g.spec.singleTile){v.blockHeight=g.tiles.ySize,v.blockWidth=g.tiles.xSize;const R=Xo(g.tiles,v.width,v.height),P=xa(R,v.width,g.tiles.xSize,g.tiles.roundingMode),U=xa(R,v.height,g.tiles.ySize,g.tiles.roundingMode);v.tileCount=P[0]*U[0];for(let q=0;q<R;q++)for(let Z=0;Z<U[q];Z++)for(let G=0;G<P[q];G++)Ne(m,Q);v.decode=Zo.bind(v)}else{v.blockWidth=v.width;const R=Math.ceil(v.height/v.blockHeight);for(let P=0;P<R;P++)Ne(m,Q);v.decode=$o.bind(v)}return v}const Sa={value:0},Da=new DataView(e),ir=new Uint8Array(e),zt=er(Da,e,Sa),ii=tr(zt,Da,ir,Sa,this.type);return ii.decode(),{header:zt,width:ii.width,height:ii.height,data:ii.byteArray,format:ii.format,colorSpace:ii.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,s,i){function a(n,r){n.colorSpace=r.colorSpace,n.minFilter=st,n.magFilter=st,n.generateMipmaps=!1,n.flipY=!1,t&&t(n,r)}return super.load(e,a,s,i)}}class fc extends Ja{constructor(e){super(e),this.type=Ze}parse(e){const t=function(u,I){switch(u){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(I||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(I||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(I||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(I||""))}},s=function(u,I,C){I=I||1024;let E=u.pos,y=-1,w=0,x="",D=String.fromCharCode.apply(null,new Uint16Array(u.subarray(E,E+128)));for(;0>(y=D.indexOf(`
|
|
5
|
+
`))&&w<I&&E<u.byteLength;)x+=D,w+=D.length,E+=128,D+=String.fromCharCode.apply(null,new Uint16Array(u.subarray(E,E+128)));return-1<y?(u.pos+=w+y+1,x+D.slice(0,y)):!1},i=function(u){const I=/^#\?(\S+)/,C=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,E=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,y=/^\s*FORMAT=(\S+)\s*$/,w=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,x={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let D,S;for((u.pos>=u.byteLength||!(D=s(u)))&&t(1,"no header found"),(S=D.match(I))||t(3,"bad initial token"),x.valid|=1,x.programtype=S[1],x.string+=D+`
|
|
6
|
+
`;D=s(u),D!==!1;){if(x.string+=D+`
|
|
7
7
|
`,D.charAt(0)==="#"){x.comments+=D+`
|
|
8
|
-
`;continue}if((S=D.match(E))&&(x.gamma=parseFloat(S[1])),(S=D.match(C))&&(x.exposure=parseFloat(S[1])),(S=D.match(Q))&&(x.valid|=2,x.format=S[1]),(S=D.match(w))&&(x.valid|=4,x.height=parseInt(S[1],10),x.width=parseInt(S[2],10)),x.valid&2&&x.valid&4)break}return x.valid&2||t(3,"missing format specifier"),x.valid&4||t(3,"missing image size specifier"),x},n=function(m,I,E){const C=I;if(C<8||C>32767||m[0]!==2||m[1]!==2||m[2]&128)return new Uint8Array(m);C!==(m[2]<<8|m[3])&&t(3,"wrong scanline width");const Q=new Uint8Array(4*I*E);Q.length||t(4,"unable to allocate buffer space");let w=0,x=0;const D=4*C,S=new Uint8Array(4),F=new Uint8Array(D);let Y=E;for(;Y>0&&x<m.byteLength;){x+4>m.byteLength&&t(1),S[0]=m[x++],S[1]=m[x++],S[2]=m[x++],S[3]=m[x++],(S[0]!=2||S[1]!=2||(S[2]<<8|S[3])!=C)&&t(3,"bad rgbe scanline format");let V=0,K;for(;V<D&&x<m.byteLength;){K=m[x++];const j=K>128;if(j&&(K-=128),(K===0||V+K>D)&&t(3,"bad scanline data"),j){const X=m[x++];for(let J=0;J<K;J++)F[V++]=X}else F.set(m.subarray(x,x+K),V),V+=K,x+=K}const W=C;for(let j=0;j<W;j++){let X=0;Q[w]=F[j+X],X+=C,Q[w+1]=F[j+X],X+=C,Q[w+2]=F[j+X],X+=C,Q[w+3]=F[j+X],w+=4}Y--}return Q},a=function(m,I,E,C){const Q=m[I+3],w=Math.pow(2,Q-128)/255;E[C+0]=m[I+0]*w,E[C+1]=m[I+1]*w,E[C+2]=m[I+2]*w,E[C+3]=1},r=function(m,I,E,C){const Q=m[I+3],w=Math.pow(2,Q-128)/255;E[C+0]=ss.toHalfFloat(Math.min(m[I+0]*w,65504)),E[C+1]=ss.toHalfFloat(Math.min(m[I+1]*w,65504)),E[C+2]=ss.toHalfFloat(Math.min(m[I+2]*w,65504)),E[C+3]=ss.toHalfFloat(1)},A=new Uint8Array(e);A.pos=0;const c=s(A),l=c.width,h=c.height,d=n(A.subarray(A.pos),l,h);let p,f,b;switch(this.type){case pt:b=d.length/4;const m=new Float32Array(b*4);for(let E=0;E<b;E++)a(d,E*4,m,E*4);p=m,f=pt;break;case Xe:b=d.length/4;const I=new Uint16Array(b*4);for(let E=0;E<b;E++)r(d,E*4,I,E*4);p=I,f=Xe;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:l,height:h,data:p,header:c.string,gamma:c.gamma,exposure:c.exposure,type:f}}setDataType(e){return this.type=e,this}load(e,t,i,s){function n(a,r){switch(a.type){case pt:case Xe:a.colorSpace=Ve,a.minFilter=it,a.magFilter=it,a.generateMipmaps=!1,a.flipY=!0;break}t&&t(a,r)}return super.load(e,n,i,s)}}const Vt=new Qi,je=new N,Ht=new N,Ce=new we,Ua={X:new N(1,0,0),Y:new N(0,1,0),Z:new N(0,0,1)},tn={type:"change"},Ga={type:"mouseDown",mode:null},Pa={type:"mouseUp",mode:null},Oa={type:"objectChange"};class nc extends On{constructor(e,t=null){super(void 0,t);const i=new lc(this);this._root=i;const s=new za;this._gizmo=s,i.add(s);const n=new hc;this._plane=n,i.add(n);const a=this;function r(C,Q){let w=Q;Object.defineProperty(a,C,{get:function(){return w!==void 0?w:Q},set:function(x){w!==x&&(w=x,n[C]=x,s[C]=x,a.dispatchEvent({type:C+"-changed",value:x}),a.dispatchEvent(tn))}}),a[C]=Q,n[C]=Q,s[C]=Q}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 N,c=new N,l=new we,h=new we,d=new N,p=new we,f=new N,b=new N,m=new N,I=0,E=new N;r("worldPosition",A),r("worldPositionStart",c),r("worldQuaternion",l),r("worldQuaternionStart",h),r("cameraPosition",d),r("cameraQuaternion",p),r("pointStart",f),r("pointEnd",b),r("rotationAxis",m),r("rotationAngle",I),r("eye",E),this._offset=new N,this._startNorm=new N,this._endNorm=new N,this._cameraScale=new N,this._parentPosition=new N,this._parentQuaternion=new we,this._parentQuaternionInv=new we,this._parentScale=new N,this._worldScaleStart=new N,this._worldQuaternionInv=new we,this._worldScale=new N,this._positionStart=new N,this._quaternionStart=new we,this._scaleStart=new N,this._getPointer=ac.bind(this),this._onPointerDown=rc.bind(this),this._onPointerHover=oc.bind(this),this._onPointerMove=Ac.bind(this),this._onPointerUp=cc.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&&Vt.setFromCamera(e,this.camera);const t=sn(this._gizmo.picker[this.mode],Vt);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&&Vt.setFromCamera(e,this.camera);const t=sn(this._plane,Vt,!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,Ga.mode=this.mode,this.dispatchEvent(Ga)}}pointerMove(e){const t=this.axis,i=this.mode,s=this.object;let n=this.space;if(i==="scale"?n="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(n="world"),s===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&Vt.setFromCamera(e,this.camera);const a=sn(this._plane,Vt,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="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),n==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(n==="local"&&(s.position.applyQuaternion(Ce.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),n==="world"&&(s.parent&&s.position.add(je.setFromMatrixPosition(s.parent.matrixWorld)),t.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(je.setFromMatrixPosition(s.parent.matrixWorld))));else if(i==="scale"){if(t.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),Ht.set(r,r,r)}else je.copy(this.pointStart),Ht.copy(this.pointEnd),je.applyQuaternion(this._worldQuaternionInv),Ht.applyQuaternion(this._worldQuaternionInv),Ht.divide(je),t.search("X")===-1&&(Ht.x=1),t.search("Y")===-1&&(Ht.y=1),t.search("Z")===-1&&(Ht.z=1);s.scale.copy(this._scaleStart).multiply(Ht),this.scaleSnap&&(t.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(je.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(je.copy(this.rotationAxis).cross(this.eye))*r):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Ua[t]),je.copy(Ua[t]),n==="local"&&je.applyQuaternion(this.worldQuaternion),je.cross(this.eye),je.length()===0?A=!0:this.rotationAngle=this._offset.dot(je.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),n==="local"&&t!=="E"&&t!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(Ce.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(Ce.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(tn),this.dispatchEvent(Oa)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Pa.mode=this.mode,this.dispatchEvent(Pa)),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(tn),this.dispatchEvent(Oa),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Vt}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 ac(o){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:o.button};{const e=this.domElement.getBoundingClientRect();return{x:(o.clientX-e.left)/e.width*2-1,y:-(o.clientY-e.top)/e.height*2+1,button:o.button}}}function oc(o){if(this.enabled)switch(o.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(o));break}}function rc(o){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(o.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(o)),this.pointerDown(this._getPointer(o)))}function Ac(o){this.enabled&&this.pointerMove(this._getPointer(o))}function cc(o){this.enabled&&(this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(o)))}function sn(o,e,t){const i=e.intersectObject(o,!0);for(let s=0;s<i.length;s++)if(i[s].object.visible||t)return i[s];return!1}const Js=new Ut,de=new N(0,1,0),Ha=new N(0,0,0),ja=new le,Vs=new we,Ws=new we,Bt=new N,qa=new le,vs=new N(1,0,0),Wt=new N(0,1,0),xs=new N(0,0,1),Xs=new N,Ss=new N,Ds=new N;class lc extends It{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 za extends It{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new mt({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new St({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=e.clone();i.opacity=.15;const s=t.clone();s.opacity=.5;const n=e.clone();n.color.setHex(16711680);const a=e.clone();a.color.setHex(65280);const r=e.clone();r.color.setHex(255);const A=e.clone();A.color.setHex(16711680),A.opacity=.5;const c=e.clone();c.color.setHex(65280),c.opacity=.5;const l=e.clone();l.color.setHex(255),l.opacity=.5;const h=e.clone();h.opacity=.25;const d=e.clone();d.color.setHex(16776960),d.opacity=.25,e.clone().color.setHex(16776960);const p=e.clone();p.color.setHex(7895160);const f=new Ze(0,.04,.1,12);f.translate(0,.05,0);const b=new Ye(.08,.08,.08);b.translate(0,.04,0);const m=new rt;m.setAttribute("position",new Te([0,0,0,1,0,0],3));const I=new Ze(.0075,.0075,.5,3);I.translate(0,.25,0);function E(j,X){const J=new fs(j,.0075,3,64,X*Math.PI*2);return J.rotateY(Math.PI/2),J.rotateX(Math.PI/2),J}function C(){const j=new rt;return j.setAttribute("position",new Te([0,0,0,1,1,1],3)),j}const Q={X:[[new O(f,n),[.5,0,0],[0,0,-Math.PI/2]],[new O(f,n),[-.5,0,0],[0,0,Math.PI/2]],[new O(I,n),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new O(f,a),[0,.5,0]],[new O(f,a),[0,-.5,0],[Math.PI,0,0]],[new O(I,a)]],Z:[[new O(f,r),[0,0,.5],[Math.PI/2,0,0]],[new O(f,r),[0,0,-.5],[-Math.PI/2,0,0]],[new O(I,r),null,[Math.PI/2,0,0]]],XYZ:[[new O(new qs(.1,0),h.clone()),[0,0,0]]],XY:[[new O(new Ye(.15,.15,.01),l.clone()),[.15,.15,0]]],YZ:[[new O(new Ye(.15,.15,.01),A.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.15,.15,.01),c.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},w={X:[[new O(new Ze(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new O(new Ze(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new Ze(.2,0,.6,4),i),[0,.3,0]],[new O(new Ze(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new Ze(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new O(new Ze(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new O(new qs(.2,0),i)]],XY:[[new O(new Ye(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new O(new Ye(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},x={START:[[new O(new qs(.01,2),s),null,null,null,"helper"]],END:[[new O(new qs(.01,2),s),null,null,null,"helper"]],DELTA:[[new gt(C(),s),null,null,null,"helper"]],X:[[new gt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new gt(m,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new gt(m,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},D={XYZE:[[new O(E(.5,1),p),null,[0,Math.PI/2,0]]],X:[[new O(E(.5,.5),n)]],Y:[[new O(E(.5,.5),a),null,[0,0,-Math.PI/2]]],Z:[[new O(E(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new O(E(.75,1),d),null,[0,Math.PI/2,0]]]},S={AXIS:[[new gt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},F={XYZE:[[new O(new oi(.25,10,8),i)]],X:[[new O(new fs(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new O(new fs(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new O(new fs(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new O(new fs(.75,.1,2,24),i)]]},Y={X:[[new O(b,n),[.5,0,0],[0,0,-Math.PI/2]],[new O(I,n),[0,0,0],[0,0,-Math.PI/2]],[new O(b,n),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new O(b,a),[0,.5,0]],[new O(I,a)],[new O(b,a),[0,-.5,0],[0,0,Math.PI]]],Z:[[new O(b,r),[0,0,.5],[Math.PI/2,0,0]],[new O(I,r),[0,0,0],[Math.PI/2,0,0]],[new O(b,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new O(new Ye(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new O(new Ye(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ye(.1,.1,.1),h.clone())]]},V={X:[[new O(new Ze(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new O(new Ze(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new Ze(.2,0,.6,4),i),[0,.3,0]],[new O(new Ze(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new Ze(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new O(new Ze(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new O(new Ye(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new O(new Ye(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ye(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ye(.2,.2,.2),i),[0,0,0]]]},K={X:[[new gt(m,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new gt(m,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new gt(m,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function W(j){const X=new It;for(const J in j)for(let ee=j[J].length;ee--;){const $=j[J][ee][0].clone(),ue=j[J][ee][1],De=j[J][ee][2],se=j[J][ee][3],oe=j[J][ee][4];$.name=J,$.tag=oe,ue&&$.position.set(ue[0],ue[1],ue[2]),De&&$.rotation.set(De[0],De[1],De[2]),se&&$.scale.set(se[0],se[1],se[2]),$.updateMatrix();const Ae=$.geometry.clone();Ae.applyMatrix4($.matrix),$.geometry=Ae,$.renderOrder=1/0,$.position.set(0,0,0),$.rotation.set(0,0,0),$.scale.set(1,1,1),X.add($)}return X}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=W(Q)),this.add(this.gizmo.rotate=W(D)),this.add(this.gizmo.scale=W(Y)),this.add(this.picker.translate=W(w)),this.add(this.picker.rotate=W(F)),this.add(this.picker.scale=W(V)),this.add(this.helper.translate=W(x)),this.add(this.helper.rotate=W(S)),this.add(this.helper.scale=W(K)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Ws;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 i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let s=0;s<i.length;s++){const n=i[s];n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition);let a;if(this.camera.isOrthographicCamera?a=(this.camera.top-this.camera.bottom)/this.camera.zoom:a=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(a*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(Ce.setFromEuler(Js.set(0,0,0)),n.quaternion.copy(t).multiply(Ce),Math.abs(de.copy(vs).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(Ce.setFromEuler(Js.set(0,0,Math.PI/2)),n.quaternion.copy(t).multiply(Ce),Math.abs(de.copy(Wt).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(Ce.setFromEuler(Js.set(0,Math.PI/2,0)),n.quaternion.copy(t).multiply(Ce),Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(Ce.setFromEuler(Js.set(0,Math.PI/2,0)),de.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(ja.lookAt(Ha,de,Wt)),n.quaternion.multiply(Ce),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),je.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),je.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(je),n.visible=this.dragging):(n.quaternion.copy(t),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(de.copy(vs).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(de.copy(Wt).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(de.copy(xs).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(de.copy(vs).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(de.copy(Wt).applyQuaternion(t).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Vs.copy(t),de.copy(this.eye).applyQuaternion(Ce.copy(t).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(ja.lookAt(this.eye,Ha,Wt)),n.name==="X"&&(Ce.setFromAxisAngle(vs,Math.atan2(-de.y,de.z)),Ce.multiplyQuaternions(Vs,Ce),n.quaternion.copy(Ce)),n.name==="Y"&&(Ce.setFromAxisAngle(Wt,Math.atan2(de.x,de.z)),Ce.multiplyQuaternions(Vs,Ce),n.quaternion.copy(Ce)),n.name==="Z"&&(Ce.setFromAxisAngle(xs,Math.atan2(de.y,de.x)),Ce.multiplyQuaternions(Vs,Ce),n.quaternion.copy(Ce))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(r){return n.name===r}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}super.updateMatrixWorld(e)}}class hc extends O{constructor(){super(new yi(1e5,1e5,2,2),new mt({visible:!1,wireframe:!0,side:gi,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"),Xs.copy(vs).applyQuaternion(t==="local"?this.worldQuaternion:Ws),Ss.copy(Wt).applyQuaternion(t==="local"?this.worldQuaternion:Ws),Ds.copy(xs).applyQuaternion(t==="local"?this.worldQuaternion:Ws),de.copy(Ss),this.mode){case"translate":case"scale":switch(this.axis){case"X":de.copy(this.eye).cross(Xs),Bt.copy(Xs).cross(de);break;case"Y":de.copy(this.eye).cross(Ss),Bt.copy(Ss).cross(de);break;case"Z":de.copy(this.eye).cross(Ds),Bt.copy(Ds).cross(de);break;case"XY":Bt.copy(Ds);break;case"YZ":Bt.copy(Xs);break;case"XZ":de.copy(Ds),Bt.copy(Ss);break;case"XYZ":case"E":Bt.set(0,0,0);break}break;default:Bt.set(0,0,0)}Bt.length()===0?this.quaternion.copy(this.cameraQuaternion):(qa.lookAt(je.set(0,0,0),Bt,de),this.quaternion.setFromRotationMatrix(qa)),super.updateMatrixWorld(e)}}const Ya={type:"change"},nn={type:"start"},Ka={type:"end"},gc={type:"endMovement"},Zs=new Ar,Ja=new cr,dc=Math.cos(70*Ee.DEG2RAD),ke=new N;new N;const et=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},Xt=1e-6;let pc=class extends On{constructor(o,e=null){super(o,e),this.state=he.NONE,this.enabled=!0,this.target=new N,this.cursor=new N,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:is.ROTATE,MIDDLE:is.DOLLY,RIGHT:is.PAN},this.touches={ONE:ns.ROTATE,TWO:ns.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new N,this._lastQuaternion=new we,this._lastTargetPosition=new N,this._quat=new we().setFromUnitVectors(o.up,new N(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Hn,this._sphericalDelta=new Hn,this._scale=1,this._currentScale=1,this._panOffset=new N,this._rotateStart=new _e,this._rotateEnd=new _e,this._rotateDelta=new _e,this._panStart=new _e,this._panEnd=new _e,this._panDelta=new _e,this._dollyStart=new _e,this._dollyEnd=new _e,this._dollyDelta=new _e,this._dollyDirection=new N,this._mouse=new _e,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=fc.bind(this),this._onPointerDown=uc.bind(this),this._onPointerUp=mc.bind(this),this._onContextMenu=Qc.bind(this),this._onMouseWheel=Ec.bind(this),this._onKeyDown=Cc.bind(this),this._onTouchStart=Bc.bind(this),this._onTouchMove=wc.bind(this),this._onMouseDown=bc.bind(this),this._onMouseMove=Ic.bind(this),this._interceptControlDown=yc.bind(this),this._interceptControlUp=vc.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(o){o.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=o}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(Ya),this.update(),this.state=he.NONE,this._isDamping=!1}update(o=null){if(this.enableDamping&&o===null)return;const e=this.object.getWorldPosition(this.object.position);ke.copy(e).sub(this.target),ke.applyQuaternion(this._quat),this._spherical.setFromVector3(ke),this.autoRotate&&this.state===he.NONE&&this._rotateLeft(this._getAutoRotationAngle(o)),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 t=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(t)&&isFinite(i)&&(t<-Math.PI?t+=et:t>Math.PI&&(t-=et),i<-Math.PI?i+=et:i>Math.PI&&(i-=et),t<=i?this._spherical.theta=Math.max(t,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(t+i)/2?Math.max(t,this._spherical.theta):Math.min(i,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 s=!1;if(this.enableDamping?this._currentScale=Ee.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 n=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),s=Math.abs(n-this._spherical.radius)>Xt*100}if(ke.setFromSpherical(this._spherical),ke.applyQuaternion(this._quatInverse),e.copy(this.target).add(ke),this.object.parent?this.object.parent.worldToLocal(e):this.object.position.copy(e),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 n=null;if(this.object.isPerspectiveCamera){const a=ke.length();n=this._clampDistance(a*this._currentScale);const r=a-n;this.object.position.addScaledVector(this._dollyDirection,r),this.object.updateMatrixWorld(),s=Math.abs(r)>Xt}else if(this.object.isOrthographicCamera){const a=new N(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const r=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._currentScale)),this.object.updateProjectionMatrix(),s=Math.abs(r-this.object.zoom)>Xt;const A=new N(this._mouse.x,this._mouse.y,0);A.unproject(this.object),this.object.position.sub(A).add(a),this.object.updateMatrixWorld(),n=ke.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;n!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(n).add(this.object.position):(Zs.origin.copy(this.object.position),Zs.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Zs.direction))<dc?this.object.lookAt(this.target):(Ja.setFromNormalAndCoplanarPoint(this.object.up,this.target),Zs.intersectPlane(Ja,this.target))))}else if(this.object.isOrthographicCamera){const n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(n-this.object.zoom)>Xt&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,s||this._lastPosition.distanceToSquared(this.object.position)>Xt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Xt||this._lastTargetPosition.distanceToSquared(this.target)>Xt?(this.dispatchEvent(Ya),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(gc)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(o){return o!==null?et/60*this.autoRotateSpeed*o:et/60/60*this.autoRotateSpeed}_getZoomScale(o){const e=Math.abs(o*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(o){this._sphericalDelta.theta-=o}_rotateUp(o){this._sphericalDelta.phi-=o}_panLeft(o,e){ke.setFromMatrixColumn(e,0),ke.multiplyScalar(-o),this._panOffset.add(ke)}_panUp(o,e){this.screenSpacePanning===!0?ke.setFromMatrixColumn(e,1):(ke.setFromMatrixColumn(e,0),ke.crossVectors(this.object.up,ke)),ke.multiplyScalar(o),this._panOffset.add(ke)}_pan(o,e){const t=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(ke).sub(this.target);let i=ke.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*i/t.clientHeight,this.object.matrixWorld),this._panUp(2*e*i/t.clientHeight,this.object.matrixWorld)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/t.clientWidth,this.object.matrixWorld),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/t.clientHeight,this.object.matrixWorld)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(o,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const t=this.domElement.getBoundingClientRect(),i=o-t.left,s=e-t.top,n=t.width,a=t.height;this._mouse.x=i/n*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(o){return Math.max(this.minDistance,Math.min(this.maxDistance,o))}_handleMouseDownRotate(o){this._rotateStart.set(o.clientX,o.clientY)}_handleMouseDownDolly(o){this._updateZoomParameters(o.clientX,o.clientX),this._dollyStart.set(o.clientX,o.clientY)}_handleMouseDownPan(o){this._panStart.set(o.clientX,o.clientY)}_handleMouseMoveRotate(o){this._rotateEnd.set(o.clientX,o.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(et*this._rotateDelta.x/e.clientHeight),this._rotateUp(et*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(o){this._dollyEnd.set(o.clientX,o.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(o){this._panEnd.set(o.clientX,o.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(o){this._updateZoomParameters(o.clientX,o.clientY),o.deltaY<0?this._dollyIn(this._getZoomScale(o.deltaY)):o.deltaY>0&&this._dollyOut(this._getZoomScale(o.deltaY)),this.update()}_handleKeyDown(o){let e=!1;switch(o.code){case this.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateUp(et*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateUp(-et*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateLeft(et*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateLeft(-et*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(o.preventDefault(),this.update())}_handleTouchStartRotate(o){if(this._pointers.length===1)this._rotateStart.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),i=.5*(o.pageY+e.y);this._rotateStart.set(t,i)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),i=.5*(o.pageY+e.y);this._panStart.set(t,i)}}_handleTouchStartDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,i=o.pageY-e.y,s=Math.sqrt(t*t+i*i);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enablePan&&this._handleTouchStartPan(o)}_handleTouchStartDollyRotate(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enableRotate&&this._handleTouchStartRotate(o)}_handleTouchMoveRotate(o){if(this._pointers.length==1)this._rotateEnd.set(o.pageX,o.pageY);else{const t=this._getSecondPointerPosition(o),i=.5*(o.pageX+t.x),s=.5*(o.pageY+t.y);this._rotateEnd.set(i,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(et*this._rotateDelta.x/e.clientHeight),this._rotateUp(et*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(o){if(this._pointers.length===1)this._panEnd.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),i=.5*(o.pageY+e.y);this._panEnd.set(t,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,i=o.pageY-e.y,s=Math.sqrt(t*t+i*i);this._dollyEnd.set(0,s),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 n=(o.pageX+e.x)*.5,a=(o.pageY+e.y)*.5;this._updateZoomParameters(n,a)}_handleTouchMoveDollyPan(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enablePan&&this._handleTouchMovePan(o)}_handleTouchMoveDollyRotate(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enableRotate&&this._handleTouchMoveRotate(o)}_addPointer(o){this._pointers.push(o.pointerId)}_removePointer(o){delete this._pointerPositions[o.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==o.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(o){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==o.pointerId)return!0;return!1}_trackPointer(o){let e=this._pointerPositions[o.pointerId];e===void 0&&(e=new _e,this._pointerPositions[o.pointerId]=e),e.set(o.pageX,o.pageY)}_getSecondPointerPosition(o){const e=o.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(o){const e=o.deltaMode,t={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(e){case 1:t.deltaY*=16;break;case 2:t.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(t.deltaY*=10),t}};function uc(o){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(o.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),window.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(o)&&(this._addPointer(o),o.pointerType==="touch"?this._onTouchStart(o):this._onMouseDown(o)))}function fc(o){this.enabled!==!1&&(o.pointerType==="touch"?this._onTouchMove(o):this._onMouseMove(o))}function mc(o){switch(this._removePointer(o),this._pointers.length){case 0:this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),window.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Ka),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 bc(o){let e;switch(o.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 is.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(o),this.state=he.DOLLY;break;case is.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=he.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=he.ROTATE}break;case is.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=he.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=he.PAN}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(nn)}function Ic(o){switch(this.state){case he.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(o);break;case he.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(o);break;case he.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(o);break}}function Ec(o){this.enabled===!1||this.enableZoom===!1||this.state!==he.NONE||(o.preventDefault(),this.dispatchEvent(nn),this._handleMouseWheel(this._customWheelEvent(o)),this.dispatchEvent(Ka))}function Cc(o){this.enabled===!1||this.enablePan===!1||this._handleKeyDown(o)}function Bc(o){switch(this._trackPointer(o),this._pointers.length){case 1:switch(this.touches.ONE){case ns.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(o),this.state=he.TOUCH_ROTATE;break;case ns.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(o),this.state=he.TOUCH_PAN;break;default:this.state=he.NONE}break;case 2:switch(this.touches.TWO){case ns.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(o),this.state=he.TOUCH_DOLLY_PAN;break;case ns.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(o),this.state=he.TOUCH_DOLLY_ROTATE;break;default:this.state=he.NONE}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(nn)}function wc(o){switch(this._trackPointer(o),this.state){case he.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(o),this.update();break;case he.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(o),this.update();break;case he.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(o),this.update();break;case he.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(o),this.update();break;default:this.state=he.NONE}}function Qc(o){this.enabled!==!1&&o.preventDefault()}function yc(o){o.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function vc(o){o.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class xc extends gt{constructor(e,t=1,i=16,s=2){const n=new rt,a=i+s*2,r=new Float32Array((a*3+3)*3);n.setAttribute("position",new st(r,3));const A=new St({color:65280}),c=new St({color:16776960});super(n,[c,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=i,this.divisionsOuterAngle=s,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,i=this.divisionsInnerAngle,s=this.divisionsOuterAngle,n=Ee.degToRad(e.panner.coneInnerAngle),a=Ee.degToRad(e.panner.coneOuterAngle),r=n/2,A=a/2;let c=0,l=0,h,d;const p=this.geometry,f=p.attributes.position;p.clearGroups();function b(m,I,E,C){const Q=(I-m)/E;for(f.setXYZ(c,0,0,0),l++,h=m;h<I;h+=Q)d=c+l,f.setXYZ(d,Math.sin(h)*t,0,Math.cos(h)*t),f.setXYZ(d+1,Math.sin(Math.min(h+Q,I))*t,0,Math.cos(Math.min(h+Q,I))*t),f.setXYZ(d+2,0,0,0),l+=3;p.addGroup(c,l,C),c+=l,l=0}b(-A,-r,s,0),b(-r,r,i,1),b(r,A,s,0),f.needsUpdate=!0,n===a&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const Sc={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
|
|
8
|
+
`;continue}if((S=D.match(C))&&(x.gamma=parseFloat(S[1])),(S=D.match(E))&&(x.exposure=parseFloat(S[1])),(S=D.match(y))&&(x.valid|=2,x.format=S[1]),(S=D.match(w))&&(x.valid|=4,x.height=parseInt(S[1],10),x.width=parseInt(S[2],10)),x.valid&2&&x.valid&4)break}return x.valid&2||t(3,"missing format specifier"),x.valid&4||t(3,"missing image size specifier"),x},a=function(u,I,C){const E=I;if(E<8||E>32767||u[0]!==2||u[1]!==2||u[2]&128)return new Uint8Array(u);E!==(u[2]<<8|u[3])&&t(3,"wrong scanline width");const y=new Uint8Array(4*I*C);y.length||t(4,"unable to allocate buffer space");let w=0,x=0;const D=4*E,S=new Uint8Array(4),L=new Uint8Array(D);let Y=C;for(;Y>0&&x<u.byteLength;){x+4>u.byteLength&&t(1),S[0]=u[x++],S[1]=u[x++],S[2]=u[x++],S[3]=u[x++],(S[0]!=2||S[1]!=2||(S[2]<<8|S[3])!=E)&&t(3,"bad rgbe scanline format");let W=0,K;for(;W<D&&x<u.byteLength;){K=u[x++];const j=K>128;if(j&&(K-=128),(K===0||W+K>D)&&t(3,"bad scanline data"),j){const X=u[x++];for(let J=0;J<K;J++)L[W++]=X}else L.set(u.subarray(x,x+K),W),W+=K,x+=K}const V=E;for(let j=0;j<V;j++){let X=0;y[w]=L[j+X],X+=E,y[w+1]=L[j+X],X+=E,y[w+2]=L[j+X],X+=E,y[w+3]=L[j+X],w+=4}Y--}return y},n=function(u,I,C,E){const y=u[I+3],w=Math.pow(2,y-128)/255;C[E+0]=u[I+0]*w,C[E+1]=u[I+1]*w,C[E+2]=u[I+2]*w,C[E+3]=1},r=function(u,I,C,E){const y=u[I+3],w=Math.pow(2,y-128)/255;C[E+0]=ai.toHalfFloat(Math.min(u[I+0]*w,65504)),C[E+1]=ai.toHalfFloat(Math.min(u[I+1]*w,65504)),C[E+2]=ai.toHalfFloat(Math.min(u[I+2]*w,65504)),C[E+3]=ai.toHalfFloat(1)},A=new Uint8Array(e);A.pos=0;const c=i(A),l=c.width,h=c.height,d=a(A.subarray(A.pos),l,h);let p,f,b;switch(this.type){case ut:b=d.length/4;const u=new Float32Array(b*4);for(let C=0;C<b;C++)n(d,C*4,u,C*4);p=u,f=ut;break;case Ze:b=d.length/4;const I=new Uint16Array(b*4);for(let C=0;C<b;C++)r(d,C*4,I,C*4);p=I,f=Ze;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:l,height:h,data:p,header:c.string,gamma:c.gamma,exposure:c.exposure,type:f}}setDataType(e){return this.type=e,this}load(e,t,s,i){function a(n,r){switch(n.type){case ut:case Ze:n.colorSpace=Ve,n.minFilter=st,n.magFilter=st,n.generateMipmaps=!1,n.flipY=!0;break}t&&t(n,r)}return super.load(e,a,s,i)}}const Xt=new Ds,je=new F,qt=new F,Ce=new we,Jn={X:new F(1,0,0),Y:new F(0,1,0),Z:new F(0,0,1)},oa={type:"change"},Wn={type:"mouseDown",mode:null},Vn={type:"mouseUp",mode:null},Xn={type:"objectChange"};class mc extends Wa{constructor(e,t=null){super(void 0,t);const s=new wc(this);this._root=s;const i=new to;this._gizmo=i,s.add(i);const a=new yc;this._plane=a,s.add(a);const n=this;function r(E,y){let w=y;Object.defineProperty(n,E,{get:function(){return w!==void 0?w:y},set:function(x){w!==x&&(w=x,a[E]=x,i[E]=x,n.dispatchEvent({type:E+"-changed",value:x}),n.dispatchEvent(oa))}}),n[E]=y,a[E]=y,i[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 F,c=new F,l=new we,h=new we,d=new F,p=new we,f=new F,b=new F,u=new F,I=0,C=new F;r("worldPosition",A),r("worldPositionStart",c),r("worldQuaternion",l),r("worldQuaternionStart",h),r("cameraPosition",d),r("cameraQuaternion",p),r("pointStart",f),r("pointEnd",b),r("rotationAxis",u),r("rotationAngle",I),r("eye",C),this._offset=new F,this._startNorm=new F,this._endNorm=new F,this._cameraScale=new F,this._parentPosition=new F,this._parentQuaternion=new we,this._parentQuaternionInv=new we,this._parentScale=new F,this._worldScaleStart=new F,this._worldQuaternionInv=new we,this._worldScale=new F,this._positionStart=new F,this._quaternionStart=new we,this._scaleStart=new F,this._getPointer=bc.bind(this),this._onPointerDown=Ec.bind(this),this._onPointerHover=Ic.bind(this),this._onPointerMove=Cc.bind(this),this._onPointerUp=Bc.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&&Xt.setFromCamera(e,this.camera);const t=ra(this._gizmo.picker[this.mode],Xt);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&&Xt.setFromCamera(e,this.camera);const t=ra(this._plane,Xt,!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,Wn.mode=this.mode,this.dispatchEvent(Wn)}}pointerMove(e){const t=this.axis,s=this.mode,i=this.object;let a=this.space;if(s==="scale"?a="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(a="world"),i===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&Xt.setFromCamera(e,this.camera);const n=ra(this._plane,Xt,!0);if(n){if(this.pointEnd.copy(n.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),a==="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),a==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(a==="local"&&(i.position.applyQuaternion(Ce.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),a==="world"&&(i.parent&&i.position.add(je.setFromMatrixPosition(i.parent.matrixWorld)),t.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(je.setFromMatrixPosition(i.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),qt.set(r,r,r)}else je.copy(this.pointStart),qt.copy(this.pointEnd),je.applyQuaternion(this._worldQuaternionInv),qt.applyQuaternion(this._worldQuaternionInv),qt.divide(je),t.search("X")===-1&&(qt.x=1),t.search("Y")===-1&&(qt.y=1),t.search("Z")===-1&&(qt.z=1);i.scale.copy(this._scaleStart).multiply(qt),this.scaleSnap&&(t.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(i.scale.z=Math.round(i.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(je.setFromMatrixPosition(this.camera.matrixWorld));let A=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(je.copy(this.rotationAxis).cross(this.eye))*r):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Jn[t]),je.copy(Jn[t]),a==="local"&&je.applyQuaternion(this.worldQuaternion),je.cross(this.eye),je.length()===0?A=!0:this.rotationAngle=this._offset.dot(je.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),a==="local"&&t!=="E"&&t!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Ce.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Ce.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(oa),this.dispatchEvent(Xn)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Vn.mode=this.mode,this.dispatchEvent(Vn)),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(oa),this.dispatchEvent(Xn),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Xt}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 bc(o){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:o.button};{const e=this.domElement.getBoundingClientRect();return{x:(o.clientX-e.left)/e.width*2-1,y:-(o.clientY-e.top)/e.height*2+1,button:o.button}}}function Ic(o){if(this.enabled)switch(o.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(o));break}}function Ec(o){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(o.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(o)),this.pointerDown(this._getPointer(o)))}function Cc(o){this.enabled&&this.pointerMove(this._getPointer(o))}function Bc(o){this.enabled&&(this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(o)))}function ra(o,e,t){const s=e.intersectObject(o,!0);for(let i=0;i<s.length;i++)if(s[i].object.visible||t)return s[i];return!1}const Zi=new Gt,de=new F(0,1,0),Zn=new F(0,0,0),$n=new re,$i=new we,es=new we,wt=new F,eo=new re,Di=new F(1,0,0),Zt=new F(0,1,0),Ti=new F(0,0,1),ts=new F,Ri=new F,Mi=new F;class wc extends It{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 to extends It{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new ht({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new Et({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),s=e.clone();s.opacity=.15;const i=t.clone();i.opacity=.5;const a=e.clone();a.color.setHex(16711680);const n=e.clone();n.color.setHex(65280);const r=e.clone();r.color.setHex(255);const A=e.clone();A.color.setHex(16711680),A.opacity=.5;const c=e.clone();c.color.setHex(65280),c.opacity=.5;const l=e.clone();l.color.setHex(255),l.opacity=.5;const h=e.clone();h.opacity=.25;const d=e.clone();d.color.setHex(16776960),d.opacity=.25,e.clone().color.setHex(16776960);const p=e.clone();p.color.setHex(7895160);const f=new $e(0,.04,.1,12);f.translate(0,.05,0);const b=new Ke(.08,.08,.08);b.translate(0,.04,0);const u=new at;u.setAttribute("position",new Me([0,0,0,1,0,0],3));const I=new $e(.0075,.0075,.5,3);I.translate(0,.25,0);function C(j,X){const J=new Ii(j,.0075,3,64,X*Math.PI*2);return J.rotateY(Math.PI/2),J.rotateX(Math.PI/2),J}function E(){const j=new at;return j.setAttribute("position",new Me([0,0,0,1,1,1],3)),j}const y={X:[[new O(f,a),[.5,0,0],[0,0,-Math.PI/2]],[new O(f,a),[-.5,0,0],[0,0,Math.PI/2]],[new O(I,a),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new O(f,n),[0,.5,0]],[new O(f,n),[0,-.5,0],[Math.PI,0,0]],[new O(I,n)]],Z:[[new O(f,r),[0,0,.5],[Math.PI/2,0,0]],[new O(f,r),[0,0,-.5],[-Math.PI/2,0,0]],[new O(I,r),null,[Math.PI/2,0,0]]],XYZ:[[new O(new Ki(.1,0),h.clone()),[0,0,0]]],XY:[[new O(new Ke(.15,.15,.01),l.clone()),[.15,.15,0]]],YZ:[[new O(new Ke(.15,.15,.01),A.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.15,.15,.01),c.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},w={X:[[new O(new $e(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new O(new $e(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new $e(.2,0,.6,4),s),[0,.3,0]],[new O(new $e(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new $e(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new O(new $e(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ki(.2,0),s)]],XY:[[new O(new Ke(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new O(new Ke(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]]},x={START:[[new O(new Ki(.01,2),i),null,null,null,"helper"]],END:[[new O(new Ki(.01,2),i),null,null,null,"helper"]],DELTA:[[new dt(E(),i),null,null,null,"helper"]],X:[[new dt(u,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new dt(u,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new dt(u,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},D={XYZE:[[new O(C(.5,1),p),null,[0,Math.PI/2,0]]],X:[[new O(C(.5,.5),a)]],Y:[[new O(C(.5,.5),n),null,[0,0,-Math.PI/2]]],Z:[[new O(C(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new O(C(.75,1),d),null,[0,Math.PI/2,0]]]},S={AXIS:[[new dt(u,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},L={XYZE:[[new O(new hs(.25,10,8),s)]],X:[[new O(new Ii(.5,.1,4,24),s),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new O(new Ii(.5,.1,4,24),s),[0,0,0],[Math.PI/2,0,0]]],Z:[[new O(new Ii(.5,.1,4,24),s),[0,0,0],[0,0,-Math.PI/2]]],E:[[new O(new Ii(.75,.1,2,24),s)]]},Y={X:[[new O(b,a),[.5,0,0],[0,0,-Math.PI/2]],[new O(I,a),[0,0,0],[0,0,-Math.PI/2]],[new O(b,a),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new O(b,n),[0,.5,0]],[new O(I,n)],[new O(b,n),[0,-.5,0],[0,0,Math.PI]]],Z:[[new O(b,r),[0,0,.5],[Math.PI/2,0,0]],[new O(I,r),[0,0,0],[Math.PI/2,0,0]],[new O(b,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new O(new Ke(.15,.15,.01),l),[.15,.15,0]]],YZ:[[new O(new Ke(.15,.15,.01),A),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ke(.1,.1,.1),h.clone())]]},W={X:[[new O(new $e(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new O(new $e(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new O(new $e(.2,0,.6,4),s),[0,.3,0]],[new O(new $e(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new O(new $e(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new O(new $e(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new O(new Ke(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new O(new Ke(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new O(new Ke(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new O(new Ke(.2,.2,.2),s),[0,0,0]]]},K={X:[[new dt(u,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new dt(u,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new dt(u,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function V(j){const X=new It;for(const J in j)for(let ee=j[J].length;ee--;){const $=j[J][ee][0].clone(),ue=j[J][ee][1],De=j[J][ee][2],ie=j[J][ee][3],oe=j[J][ee][4];$.name=J,$.tag=oe,ue&&$.position.set(ue[0],ue[1],ue[2]),De&&$.rotation.set(De[0],De[1],De[2]),ie&&$.scale.set(ie[0],ie[1],ie[2]),$.updateMatrix();const ce=$.geometry.clone();ce.applyMatrix4($.matrix),$.geometry=ce,$.renderOrder=1/0,$.position.set(0,0,0),$.rotation.set(0,0,0),$.scale.set(1,1,1),X.add($)}return X}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=V(y)),this.add(this.gizmo.rotate=V(D)),this.add(this.gizmo.scale=V(Y)),this.add(this.picker.translate=V(w)),this.add(this.picker.rotate=V(L)),this.add(this.picker.scale=V(W)),this.add(this.helper.translate=V(x)),this.add(this.helper.rotate=V(S)),this.add(this.helper.scale=V(K)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:es;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 s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let i=0;i<s.length;i++){const a=s[i];a.visible=!0,a.rotation.set(0,0,0),a.position.copy(this.worldPosition);let n;if(this.camera.isOrthographicCamera?n=(this.camera.top-this.camera.bottom)/this.camera.zoom:n=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),a.scale.set(1,1,1).multiplyScalar(n*this.size/4),a.tag==="helper"){a.visible=!1,a.name==="AXIS"?(a.visible=!!this.axis,this.axis==="X"&&(Ce.setFromEuler(Zi.set(0,0,0)),a.quaternion.copy(t).multiply(Ce),Math.abs(de.copy(Di).applyQuaternion(t).dot(this.eye))>.9&&(a.visible=!1)),this.axis==="Y"&&(Ce.setFromEuler(Zi.set(0,0,Math.PI/2)),a.quaternion.copy(t).multiply(Ce),Math.abs(de.copy(Zt).applyQuaternion(t).dot(this.eye))>.9&&(a.visible=!1)),this.axis==="Z"&&(Ce.setFromEuler(Zi.set(0,Math.PI/2,0)),a.quaternion.copy(t).multiply(Ce),Math.abs(de.copy(Ti).applyQuaternion(t).dot(this.eye))>.9&&(a.visible=!1)),this.axis==="XYZE"&&(Ce.setFromEuler(Zi.set(0,Math.PI/2,0)),de.copy(this.rotationAxis),a.quaternion.setFromRotationMatrix($n.lookAt(Zn,de,Zt)),a.quaternion.multiply(Ce),a.visible=this.dragging),this.axis==="E"&&(a.visible=!1)):a.name==="START"?(a.position.copy(this.worldPositionStart),a.visible=this.dragging):a.name==="END"?(a.position.copy(this.worldPosition),a.visible=this.dragging):a.name==="DELTA"?(a.position.copy(this.worldPositionStart),a.quaternion.copy(this.worldQuaternionStart),je.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),je.applyQuaternion(this.worldQuaternionStart.clone().invert()),a.scale.copy(je),a.visible=this.dragging):(a.quaternion.copy(t),this.dragging?a.position.copy(this.worldPositionStart):a.position.copy(this.worldPosition),this.axis&&(a.visible=this.axis.search(a.name)!==-1));continue}a.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(a.name==="X"&&Math.abs(de.copy(Di).applyQuaternion(t).dot(this.eye))>.99&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),a.name==="Y"&&Math.abs(de.copy(Zt).applyQuaternion(t).dot(this.eye))>.99&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),a.name==="Z"&&Math.abs(de.copy(Ti).applyQuaternion(t).dot(this.eye))>.99&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),a.name==="XY"&&Math.abs(de.copy(Ti).applyQuaternion(t).dot(this.eye))<.2&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),a.name==="YZ"&&Math.abs(de.copy(Di).applyQuaternion(t).dot(this.eye))<.2&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1),a.name==="XZ"&&Math.abs(de.copy(Zt).applyQuaternion(t).dot(this.eye))<.2&&(a.scale.set(1e-10,1e-10,1e-10),a.visible=!1)):this.mode==="rotate"&&($i.copy(t),de.copy(this.eye).applyQuaternion(Ce.copy(t).invert()),a.name.search("E")!==-1&&a.quaternion.setFromRotationMatrix($n.lookAt(this.eye,Zn,Zt)),a.name==="X"&&(Ce.setFromAxisAngle(Di,Math.atan2(-de.y,de.z)),Ce.multiplyQuaternions($i,Ce),a.quaternion.copy(Ce)),a.name==="Y"&&(Ce.setFromAxisAngle(Zt,Math.atan2(de.x,de.z)),Ce.multiplyQuaternions($i,Ce),a.quaternion.copy(Ce)),a.name==="Z"&&(Ce.setFromAxisAngle(Ti,Math.atan2(de.y,de.x)),Ce.multiplyQuaternions($i,Ce),a.quaternion.copy(Ce))),a.visible=a.visible&&(a.name.indexOf("X")===-1||this.showX),a.visible=a.visible&&(a.name.indexOf("Y")===-1||this.showY),a.visible=a.visible&&(a.name.indexOf("Z")===-1||this.showZ),a.visible=a.visible&&(a.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),a.material._color=a.material._color||a.material.color.clone(),a.material._opacity=a.material._opacity||a.material.opacity,a.material.color.copy(a.material._color),a.material.opacity=a.material._opacity,this.enabled&&this.axis&&(a.name===this.axis||this.axis.split("").some(function(r){return a.name===r}))&&(a.material.color.setHex(16776960),a.material.opacity=1)}super.updateMatrixWorld(e)}}class yc extends O{constructor(){super(new Ji(1e5,1e5,2,2),new ht({visible:!1,wireframe:!0,side:Hi,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"),ts.copy(Di).applyQuaternion(t==="local"?this.worldQuaternion:es),Ri.copy(Zt).applyQuaternion(t==="local"?this.worldQuaternion:es),Mi.copy(Ti).applyQuaternion(t==="local"?this.worldQuaternion:es),de.copy(Ri),this.mode){case"translate":case"scale":switch(this.axis){case"X":de.copy(this.eye).cross(ts),wt.copy(ts).cross(de);break;case"Y":de.copy(this.eye).cross(Ri),wt.copy(Ri).cross(de);break;case"Z":de.copy(this.eye).cross(Mi),wt.copy(Mi).cross(de);break;case"XY":wt.copy(Mi);break;case"YZ":wt.copy(ts);break;case"XZ":de.copy(Mi),wt.copy(Ri);break;case"XYZ":case"E":wt.set(0,0,0);break}break;default:wt.set(0,0,0)}wt.length()===0?this.quaternion.copy(this.cameraQuaternion):(eo.lookAt(je.set(0,0,0),wt,de),this.quaternion.setFromRotationMatrix(eo)),super.updateMatrixWorld(e)}}const io={type:"change"},Aa={type:"start"},so={type:"end"},Qc={type:"endMovement"},is=new Cr,ao=new Br,vc=Math.cos(70*be.DEG2RAD),_e=new F;new F;const tt=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},$t=1e-6;let xc=class extends Wa{constructor(o,e=null){super(o,e),this.state=he.NONE,this.enabled=!0,this.target=new F,this.cursor=new F,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:ni.ROTATE,MIDDLE:ni.DOLLY,RIGHT:ni.PAN},this.touches={ONE:oi.ROTATE,TWO:oi.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new F,this._lastQuaternion=new we,this._lastTargetPosition=new F,this._quat=new we().setFromUnitVectors(o.up,new F(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Va,this._sphericalDelta=new Va,this._scale=1,this._currentScale=1,this._panOffset=new F,this._rotateStart=new Re,this._rotateEnd=new Re,this._rotateDelta=new Re,this._panStart=new Re,this._panEnd=new Re,this._panDelta=new Re,this._dollyStart=new Re,this._dollyEnd=new Re,this._dollyDelta=new Re,this._dollyDirection=new F,this._mouse=new Re,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._lastIsDamping=!1,this._isDamping=!1,this._onPointerMove=Dc.bind(this),this._onPointerDown=Sc.bind(this),this._onPointerUp=Tc.bind(this),this._onContextMenu=Nc.bind(this),this._onMouseWheel=_c.bind(this),this._onKeyDown=Lc.bind(this),this._onTouchStart=kc.bind(this),this._onTouchMove=Fc.bind(this),this._onMouseDown=Rc.bind(this),this._onMouseMove=Mc.bind(this),this._interceptControlDown=Uc.bind(this),this._interceptControlUp=Pc.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(o){o.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=o}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(io),this.update(),this.state=he.NONE,this._isDamping=!1}update(o=null){if(this.enableDamping&&o===null)return;const e=this.object.getWorldPosition(this.object.position);_e.copy(e).sub(this.target),_e.applyQuaternion(this._quat),this._spherical.setFromVector3(_e),this.autoRotate&&this.state===he.NONE&&this._rotateLeft(this._getAutoRotationAngle(o)),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 t=this.minAzimuthAngle,s=this.maxAzimuthAngle;isFinite(t)&&isFinite(s)&&(t<-Math.PI?t+=tt:t>Math.PI&&(t-=tt),s<-Math.PI?s+=tt:s>Math.PI&&(s-=tt),t<=s?this._spherical.theta=Math.max(t,Math.min(s,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(t+s)/2?Math.max(t,this._spherical.theta):Math.min(s,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=be.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 a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._currentScale),i=Math.abs(a-this._spherical.radius)>$t*100}if(_e.setFromSpherical(this._spherical),_e.applyQuaternion(this._quatInverse),e.copy(this.target).add(_e),this.object.parent?this.object.parent.worldToLocal(e):this.object.position.copy(e),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 a=null;if(this.object.isPerspectiveCamera){const n=_e.length();a=this._clampDistance(n*this._currentScale);const r=n-a;this.object.position.addScaledVector(this._dollyDirection,r),this.object.updateMatrixWorld(),i=Math.abs(r)>$t}else if(this.object.isOrthographicCamera){const n=new F(this._mouse.x,this._mouse.y,0);n.unproject(this.object);const r=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(r-this.object.zoom)>$t;const A=new F(this._mouse.x,this._mouse.y,0);A.unproject(this.object),this.object.position.sub(A).add(n),this.object.updateMatrixWorld(),a=_e.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(is.origin.copy(this.object.position),is.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(is.direction))<vc?this.object.lookAt(this.target):(ao.setFromNormalAndCoplanarPoint(this.object.up,this.target),is.intersectPlane(ao,this.target))))}else if(this.object.isOrthographicCamera){const a=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),Math.abs(a-this.object.zoom)>$t&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,i||this._lastPosition.distanceToSquared(this.object.position)>$t||8*(1-this._lastQuaternion.dot(this.object.quaternion))>$t||this._lastTargetPosition.distanceToSquared(this.target)>$t?(this.dispatchEvent(io),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(Qc)),this._performCursorZoom=!1,!1)}_getAutoRotationAngle(o){return o!==null?tt/60*this.autoRotateSpeed*o:tt/60/60*this.autoRotateSpeed}_getZoomScale(o){const e=Math.abs(o*.01);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(o){this._sphericalDelta.theta-=o}_rotateUp(o){this._sphericalDelta.phi-=o}_panLeft(o,e){_e.setFromMatrixColumn(e,0),_e.multiplyScalar(-o),this._panOffset.add(_e)}_panUp(o,e){this.screenSpacePanning===!0?_e.setFromMatrixColumn(e,1):(_e.setFromMatrixColumn(e,0),_e.crossVectors(this.object.up,_e)),_e.multiplyScalar(o),this._panOffset.add(_e)}_pan(o,e){const t=this.domElement;if(this.object.isPerspectiveCamera){this.object.getWorldPosition(_e).sub(this.target);let s=_e.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*s/t.clientHeight,this.object.matrixWorld),this._panUp(2*e*s/t.clientHeight,this.object.matrixWorld)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/t.clientWidth,this.object.matrixWorld),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/t.clientHeight,this.object.matrixWorld)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(o,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const t=this.domElement.getBoundingClientRect(),s=o-t.left,i=e-t.top,a=t.width,n=t.height;this._mouse.x=s/a*2-1,this._mouse.y=-(i/n)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(o){return Math.max(this.minDistance,Math.min(this.maxDistance,o))}_handleMouseDownRotate(o){this._rotateStart.set(o.clientX,o.clientY)}_handleMouseDownDolly(o){this._updateZoomParameters(o.clientX,o.clientX),this._dollyStart.set(o.clientX,o.clientY)}_handleMouseDownPan(o){this._panStart.set(o.clientX,o.clientY)}_handleMouseMoveRotate(o){this._rotateEnd.set(o.clientX,o.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(tt*this._rotateDelta.x/e.clientHeight),this._rotateUp(tt*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(o){this._dollyEnd.set(o.clientX,o.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(o){this._panEnd.set(o.clientX,o.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(o){this._updateZoomParameters(o.clientX,o.clientY),o.deltaY<0?this._dollyIn(this._getZoomScale(o.deltaY)):o.deltaY>0&&this._dollyOut(this._getZoomScale(o.deltaY)),this.update()}_handleKeyDown(o){let e=!1;switch(o.code){case this.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateUp(tt*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateUp(-tt*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateLeft(tt*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?this._rotateLeft(-tt*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),e=!0;break}e&&(o.preventDefault(),this.update())}_handleTouchStartRotate(o){if(this._pointers.length===1)this._rotateStart.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),s=.5*(o.pageY+e.y);this._rotateStart.set(t,s)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),s=.5*(o.pageY+e.y);this._panStart.set(t,s)}}_handleTouchStartDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,s=o.pageY-e.y,i=Math.sqrt(t*t+s*s);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enablePan&&this._handleTouchStartPan(o)}_handleTouchStartDollyRotate(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enableRotate&&this._handleTouchStartRotate(o)}_handleTouchMoveRotate(o){if(this._pointers.length==1)this._rotateEnd.set(o.pageX,o.pageY);else{const t=this._getSecondPointerPosition(o),s=.5*(o.pageX+t.x),i=.5*(o.pageY+t.y);this._rotateEnd.set(s,i)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(tt*this._rotateDelta.x/e.clientHeight),this._rotateUp(tt*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(o){if(this._pointers.length===1)this._panEnd.set(o.pageX,o.pageY);else{const e=this._getSecondPointerPosition(o),t=.5*(o.pageX+e.x),s=.5*(o.pageY+e.y);this._panEnd.set(t,s)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(o){const e=this._getSecondPointerPosition(o),t=o.pageX-e.x,s=o.pageY-e.y,i=Math.sqrt(t*t+s*s);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 a=(o.pageX+e.x)*.5,n=(o.pageY+e.y)*.5;this._updateZoomParameters(a,n)}_handleTouchMoveDollyPan(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enablePan&&this._handleTouchMovePan(o)}_handleTouchMoveDollyRotate(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enableRotate&&this._handleTouchMoveRotate(o)}_addPointer(o){this._pointers.push(o.pointerId)}_removePointer(o){delete this._pointerPositions[o.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==o.pointerId){this._pointers.splice(e,1);return}}_isTrackingPointer(o){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==o.pointerId)return!0;return!1}_trackPointer(o){let e=this._pointerPositions[o.pointerId];e===void 0&&(e=new Re,this._pointerPositions[o.pointerId]=e),e.set(o.pageX,o.pageY)}_getSecondPointerPosition(o){const e=o.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(o){const e=o.deltaMode,t={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(e){case 1:t.deltaY*=16;break;case 2:t.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(t.deltaY*=10),t}};function Sc(o){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(o.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),window.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(o)&&(this._addPointer(o),o.pointerType==="touch"?this._onTouchStart(o):this._onMouseDown(o)))}function Dc(o){this.enabled!==!1&&(o.pointerType==="touch"?this._onTouchMove(o):this._onMouseMove(o))}function Tc(o){switch(this._removePointer(o),this._pointers.length){case 0:this.domElement.releasePointerCapture(o.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),window.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(so),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 Rc(o){let e;switch(o.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 ni.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(o),this.state=he.DOLLY;break;case ni.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=he.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=he.ROTATE}break;case ni.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(o),this.state=he.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(o),this.state=he.PAN}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(Aa)}function Mc(o){switch(this.state){case he.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(o);break;case he.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(o);break;case he.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(o);break}}function _c(o){this.enabled===!1||this.enableZoom===!1||this.state!==he.NONE||(o.preventDefault(),this.dispatchEvent(Aa),this._handleMouseWheel(this._customWheelEvent(o)),this.dispatchEvent(so))}function Lc(o){this.enabled===!1||this.enablePan===!1||this._handleKeyDown(o)}function kc(o){switch(this._trackPointer(o),this._pointers.length){case 1:switch(this.touches.ONE){case oi.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(o),this.state=he.TOUCH_ROTATE;break;case oi.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(o),this.state=he.TOUCH_PAN;break;default:this.state=he.NONE}break;case 2:switch(this.touches.TWO){case oi.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(o),this.state=he.TOUCH_DOLLY_PAN;break;case oi.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(o),this.state=he.TOUCH_DOLLY_ROTATE;break;default:this.state=he.NONE}break;default:this.state=he.NONE}this.state!==he.NONE&&this.dispatchEvent(Aa)}function Fc(o){switch(this._trackPointer(o),this.state){case he.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(o),this.update();break;case he.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(o),this.update();break;case he.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(o),this.update();break;case he.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(o),this.update();break;default:this.state=he.NONE}}function Nc(o){this.enabled!==!1&&o.preventDefault()}function Uc(o){o.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Pc(o){o.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}class Gc extends dt{constructor(e,t=1,s=16,i=2){const a=new at,n=s+i*2,r=new Float32Array((n*3+3)*3);a.setAttribute("position",new Ye(r,3));const A=new Et({color:65280}),c=new Et({color:16776960});super(a,[c,A]),this.audio=e,this.range=t,this.divisionsInnerAngle=s,this.divisionsOuterAngle=i,this.type="PositionalAudioHelper",this.update()}update(){const e=this.audio,t=this.range,s=this.divisionsInnerAngle,i=this.divisionsOuterAngle,a=be.degToRad(e.panner.coneInnerAngle),n=be.degToRad(e.panner.coneOuterAngle),r=a/2,A=n/2;let c=0,l=0,h,d;const p=this.geometry,f=p.attributes.position;p.clearGroups();function b(u,I,C,E){const y=(I-u)/C;for(f.setXYZ(c,0,0,0),l++,h=u;h<I;h+=y)d=c+l,f.setXYZ(d,Math.sin(h)*t,0,Math.cos(h)*t),f.setXYZ(d+1,Math.sin(Math.min(h+y,I))*t,0,Math.cos(Math.min(h+y,I))*t),f.setXYZ(d+2,0,0,0),l+=3;p.addGroup(c,l,E),c+=l,l=0}b(-A,-r,i,0),b(-r,r,s,1),b(r,A,i,0),f.needsUpdate=!0,a===n&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}const Oc={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
|
|
9
9
|
|
|
10
10
|
varying vec2 vUv;
|
|
11
11
|
|
|
@@ -37,7 +37,7 @@ import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,Trian
|
|
|
37
37
|
|
|
38
38
|
gl_FragColor = sum;
|
|
39
39
|
|
|
40
|
-
}`},
|
|
40
|
+
}`},Hc={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
|
|
41
41
|
|
|
42
42
|
varying vec2 vUv;
|
|
43
43
|
|
|
@@ -69,7 +69,7 @@ import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,Trian
|
|
|
69
69
|
|
|
70
70
|
gl_FragColor = sum;
|
|
71
71
|
|
|
72
|
-
}`};let
|
|
72
|
+
}`};let _i,ca,Ai,ss;function la(o,e=1/0,t=null){ca||(ca=new Ji(2,2,1,1)),Ai||(Ai=new Xa({uniforms:{blitTexture:new wr(o)},vertexShader:`
|
|
73
73
|
varying vec2 vUv;
|
|
74
74
|
void main(){
|
|
75
75
|
vUv = uv;
|
|
@@ -86,7 +86,7 @@ import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,Trian
|
|
|
86
86
|
#else
|
|
87
87
|
gl_FragColor = texture2D( blitTexture, vUv);
|
|
88
88
|
#endif
|
|
89
|
-
}`})),os.uniforms.blitTexture.value=o,os.defines.IS_SRGB=o.colorSpace==ce,os.needsUpdate=!0,$s||($s=new O(an,os),$s.frustumCulled=!1);const i=new Ps,s=new vi;s.add($s),t===null&&(t=Rs=new hr({antialias:!1}));const n=Math.min(o.image.width,e),a=Math.min(o.image.height,e);t.setSize(n,a),t.clear(),t.render(s,i);const r=document.createElement("canvas"),A=r.getContext("2d");r.width=n,r.height=a,A.drawImage(t.domElement,0,0,n,a);const c=new qn(r);return c.minFilter=o.minFilter,c.magFilter=o.magFilter,c.wrapS=o.wrapS,c.wrapT=o.wrapT,c.colorSpace=o.colorSpace,c.name=o.name,Rs&&(Rs.forceContextLoss(),Rs.dispose(),Rs=null),c}const Va={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 rn{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Gc(e)}),this.register(function(e){return new Pc(e)}),this.register(function(e){return new qc(e)}),this.register(function(e){return new zc(e)}),this.register(function(e){return new Yc(e)}),this.register(function(e){return new Kc(e)}),this.register(function(e){return new Oc(e)}),this.register(function(e){return new Hc(e)}),this.register(function(e){return new jc(e)}),this.register(function(e){return new Jc(e)}),this.register(function(e){return new Vc(e)}),this.register(function(e){return new Wc(e)}),this.register(function(e){return new Xc(e)}),this.register(function(e){return new Zc(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,i,s){const n=new Uc,a=[];for(let r=0,A=this.pluginCallbacks.length;r<A;r++)a.push(this.pluginCallbacks[r](n));n.setPlugins(a),n.write(e,t,s).catch(i)}parseAsync(e,t){const i=this;return new Promise(function(s,n){i.parse(e,s,n,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},An="KHR_mesh_quantization",at={};at[Ls]=ae.NEAREST,at[li]=ae.NEAREST_MIPMAP_NEAREST,at[Qn]=ae.NEAREST_MIPMAP_LINEAR,at[it]=ae.LINEAR,at[yn]=ae.LINEAR_MIPMAP_NEAREST,at[hs]=ae.LINEAR_MIPMAP_LINEAR,at[Ns]=ae.CLAMP_TO_EDGE,at[zt]=ae.REPEAT,at[vn]=ae.MIRRORED_REPEAT;const Wa={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},Rc=new Be,Xa=12,Tc=1179937895,kc=2,Za=8,Mc=1313821514,Fc=5130562;function Ts(o,e){return o.length===e.length&&o.every(function(t,i){return t===e[i]})}function _c(o){return new TextEncoder().encode(o).buffer}function Lc(o){return Ts(o.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function Nc(o,e,t){const i={min:new Array(o.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(o.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let s=e;s<e+t;s++)for(let n=0;n<o.itemSize;n++){let a;o.itemSize>4?a=o.array[s*o.itemSize+n]:(n===0?a=o.getX(s):n===1?a=o.getY(s):n===2?a=o.getZ(s):n===3&&(a=o.getW(s)),o.normalized===!0&&(a=Ee.normalize(a,o.array))),i.min[n]=Math.min(i.min[n],a),i.max[n]=Math.max(i.max[n],a)}return i}function $a(o){return Math.ceil(o/4)*4}function cn(o,e=0){const t=$a(o.byteLength);if(t!==o.byteLength){const i=new Uint8Array(t);if(i.set(new Uint8Array(o)),e!==0)for(let s=o.byteLength;s<t;s++)i[s]=e;return i.buffer}return o}function eo(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function to(o,e){if(o.toBlob!==void 0)return new Promise(i=>o.toBlob(i,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),o.convertToBlob({type:e,quality:t})}class Uc{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"+gr}},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,i={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const s=this,n=s.buffers,a=s.json;i=s.options;const r=s.extensionsUsed,A=s.extensionsRequired,c=new Blob(n,{type:"application/octet-stream"}),l=Object.keys(r),h=Object.keys(A);if(l.length>0&&(a.extensionsUsed=l),h.length>0&&(a.extensionsRequired=h),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=c.size),i.binary===!0){const d=new FileReader;d.readAsArrayBuffer(c),d.onloadend=function(){const p=cn(d.result),f=new DataView(new ArrayBuffer(Za));f.setUint32(0,p.byteLength,!0),f.setUint32(4,Fc,!0);const b=cn(_c(JSON.stringify(a)),32),m=new DataView(new ArrayBuffer(Za));m.setUint32(0,b.byteLength,!0),m.setUint32(4,Mc,!0);const I=new ArrayBuffer(Xa),E=new DataView(I);E.setUint32(0,Tc,!0),E.setUint32(4,kc,!0);const C=Xa+m.byteLength+b.byteLength+f.byteLength+p.byteLength;E.setUint32(8,C,!0);const Q=new Blob([I,m,b,f,p],{type:"application/octet-stream"}),w=new FileReader;w.readAsArrayBuffer(Q),w.onloadend=function(){t(w.result)}}}else if(a.buffers&&a.buffers.length>0){const d=new FileReader;d.readAsDataURL(c),d.onloadend=function(){const p=d.result;a.buffers[0].uri=p,t(a)}}else t(a)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const i=this.options,s=this.extensionsUsed;try{const n=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&n.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const a in n.gltfExtensions)t.extensions[a]=n.gltfExtensions[a],s[a]=!0;delete n.gltfExtensions}Object.keys(n).length>0&&(t.extras=n)}catch(n){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+n.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const i=new Map;i.set(!0,this.uid++),i.set(!1,this.uid++),this.uids.set(e,i)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new N;for(let i=0,s=e.count;i<s;i++)if(Math.abs(t.fromBufferAttribute(e,i).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 i=e.clone(),s=new N;for(let n=0,a=i.count;n<a;n++)s.fromBufferAttribute(i,n),s.x===0&&s.y===0&&s.z===0?s.setX(1):s.normalize(),i.setXYZ(n,s.x,s.y,s.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1;const s={};(t.offset.x!==0||t.offset.y!==0)&&(s.offset=t.offset.toArray(),i=!0),t.rotation!==0&&(s.rotation=t.rotation,i=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(s.scale=t.repeat.toArray(),i=!0),i&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=s,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function i(d){return d.colorSpace===ce?function(p){return p<.04045?p*.0773993808:Math.pow(p*.9478672986+.0521327014,2.4)}:function(p){return p}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof ps&&(e=on(e)),t instanceof ps&&(t=on(t));const s=e?e.image:null,n=t?t.image:null,a=Math.max(s?s.width:0,n?n.width:0),r=Math.max(s?s.height:0,n?n.height:0),A=eo();A.width=a,A.height=r;const c=A.getContext("2d",{willReadFrequently:!0});c.fillStyle="#00ffff",c.fillRect(0,0,a,r);const l=c.getImageData(0,0,a,r);if(s){c.drawImage(s,0,0,a,r);const d=i(e),p=c.getImageData(0,0,a,r).data;for(let f=2;f<p.length;f+=4)l.data[f]=d(p[f]/256)*256}if(n){c.drawImage(n,0,0,a,r);const d=i(t),p=c.getImageData(0,0,a,r).data;for(let f=1;f<p.length;f+=4)l.data[f]=d(p[f]/256)*256}c.putImageData(l,0,0);const h=(e||t).clone();return h.source=new dr(A),h.colorSpace=Hs,h.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),h}processBuffer(e){const t=this.json,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,s,n){const a=this.json;a.bufferViews||(a.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;n===ae.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const c=$a(s*A),l=new DataView(new ArrayBuffer(c));let h=0;for(let p=i;p<i+s;p++){for(let f=0;f<e.itemSize;f++){let b;e.itemSize>4?b=e.array[p*e.itemSize+f]:(f===0?b=e.getX(p):f===1?b=e.getY(p):f===2?b=e.getZ(p):f===3&&(b=e.getW(p)),e.normalized===!0&&(b=Ee.normalize(b,e.array))),t===ae.FLOAT?l.setFloat32(h,b,!0):t===ae.INT?l.setInt32(h,b,!0):t===ae.UNSIGNED_INT?l.setUint32(h,b,!0):t===ae.SHORT?l.setInt16(h,b,!0):t===ae.UNSIGNED_SHORT?l.setUint16(h,b,!0):t===ae.BYTE?l.setInt8(h,b):t===ae.UNSIGNED_BYTE&&l.setUint8(h,b),h+=r}h%A!==0&&(h+=A-h%A)}const d={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:c};return n!==void 0&&(d.target=n),n===ae.ARRAY_BUFFER&&(d.byteStride=A),this.byteOffset+=c,a.bufferViews.push(d),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise(function(s){const n=new FileReader;n.readAsArrayBuffer(e),n.onloadend=function(){const a=cn(n.result),r={buffer:t.processBuffer(a),byteOffset:t.byteOffset,byteLength:a.byteLength};t.byteOffset+=a.byteLength,s(i.bufferViews.push(r)-1)}})}processAccessor(e,t,i,s){const n=this.json,a={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(i===void 0&&(i=0),(s===void 0||s===1/0)&&(s=e.count),s===0)return null;const A=Nc(e,i,s);let c;t!==void 0&&(c=e===t.index?ae.ELEMENT_ARRAY_BUFFER:ae.ARRAY_BUFFER);const l=this.processBufferView(e,r,i,s,c),h={bufferView:l.id,byteOffset:l.byteOffset,componentType:r,count:s,max:A.max,min:A.min,type:a[e.itemSize]};return e.normalized===!0&&(h.normalized=!0),n.accessors||(n.accessors=[]),n.accessors.push(h)-1}processImage(e,t,i,s="image/png"){if(e!==null){const n=this,a=n.cache,r=n.json,A=n.options,c=n.pending;a.images.has(e)||a.images.set(e,{});const l=a.images.get(e),h=s+":flipY/"+i.toString();if(l[h]!==void 0)return l[h];r.images||(r.images=[]);const d={mimeType:s},p=eo();p.width=Math.min(e.width,A.maxTextureSize),p.height=Math.min(e.height,A.maxTextureSize);const f=p.getContext("2d",{willReadFrequently:!0});if(i===!0&&(f.translate(0,p.height),f.scale(1,-1)),e.data!==void 0){t!==Nt&&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 m=new Uint8ClampedArray(e.height*e.width*4);for(let I=0;I<m.length;I+=4)m[I+0]=e.data[I+0],m[I+1]=e.data[I+1],m[I+2]=e.data[I+2],m[I+3]=e.data[I+3];f.putImageData(new ImageData(m,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,p.width,p.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");A.binary===!0?c.push(to(p,s).then(m=>n.processBufferViewImage(m)).then(m=>{d.bufferView=m})):p.toDataURL!==void 0?d.uri=p.toDataURL(s):c.push(to(p,s).then(m=>new FileReader().readAsDataURL(m)).then(m=>{d.uri=m}));const b=r.images.push(d)-1;return l[h]=b,b}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 i={magFilter:at[e.magFilter],minFilter:at[e.minFilter],wrapS:at[e.wrapS],wrapT:at[e.wrapT]};return t.samplers.push(i)-1}processTexture(e){const t=this.options,i=this.cache,s=this.json;if(i.textures.has(e))return i.textures.get(e);const n={keep:!0,newTexture:null};if(this._invokeAll(function(c){c.beforeWriteTexture&&c.beforeWriteTexture(e,n)}),n.keep===!1)return null;n.newTexture!=null&&(e=n.newTexture),s.textures||(s.textures=[]),e instanceof ps&&(e=on(e,t.maxTextureSize));let a=e.userData.mimeType;a==="image/webp"&&(a="image/png");const r={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,a)};e.name&&(r.name=e.name),this._invokeAll(function(c){c.writeTexture&&c.writeTexture(e,r)});const A=s.textures.push(r)-1;return i.textures.set(e,A),A}processMaterial(e){const t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;i.materials||(i.materials=[]);const s={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const n=e.color.toArray().concat([e.opacity]);Ts(n,[1,1,1,1])||(s.pbrMetallicRoughness.baseColorFactor=n),e.isMeshStandardMaterial?(s.pbrMetallicRoughness.metallicFactor=e.metalness,s.pbrMetallicRoughness.roughnessFactor=e.roughness):(s.pbrMetallicRoughness.metallicFactor=.5,s.pbrMetallicRoughness.roughnessFactor=.5);const a=e.metalnessMap?.image?e.metalnessMap:void 0,r=e.roughnessMap?.image?e.roughnessMap:void 0;if(a||r){const c=this.buildMetalRoughTexture(a,r),l={index:this.processTexture(c),channel:c.channel};this.applyTextureTransform(l,c),s.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const c={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(c,e.map),s.pbrMetallicRoughness.baseColorTexture=c}if(e.emissive){const c=e.emissive;if(Math.max(c.r,c.g,c.b)>0&&(s.emissiveFactor=e.emissive.toArray()),e.emissiveMap?.image){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),s.emissiveTexture=l}}if(e.normalMap?.image){const c={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(c.scale=e.normalScale.x),this.applyTextureTransform(c,e.normalMap),s.normalTexture=c}if(e.aoMap?.image){const c={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(c.strength=e.aoMapIntensity),this.applyTextureTransform(c,e.aoMap),s.occlusionTexture=c}e.transparent?s.alphaMode="BLEND":e.alphaTest>0&&(s.alphaMode="MASK",s.alphaCutoff=e.alphaTest),e.side===gi&&(s.doubleSided=!0),e.name!==""&&(s.name=e.name),this.serializeUserData(e,s),this._invokeAll(function(c){c.writeMaterial&&c.writeMaterial(e,s)});const A=i.materials.push(s)-1;return t.materials.set(e,A),A}processMesh(e){const t={keep:!0};if(this._invokeAll(function(w){w.beforeWriteMesh&&w.beforeWriteMesh(e,t)}),t.keep!=!0)return null;const i=this.cache,s=this.json,n=[e.geometry.uuid];if(Array.isArray(e.material))for(let w=0,x=e.material.length;w<x;w++)n.push(e.material[w].uuid);else n.push(e.material.uuid);const a=n.join(":");if(i.meshes.has(a))return i.meshes.get(a);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 c={},l={},h=[],d=[],p={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 b=null;for(let w in r.attributes){if(w.slice(0,5)==="morph")continue;const x=r.attributes[w];if(w=p[w]||w.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(w)||(w="_"+w),i.attributes.has(this.getUID(x))){l[w]=i.attributes.get(this.getUID(x));continue}b=null;const D=x.array;w==="JOINTS_0"&&!(D instanceof Uint16Array)&&!(D instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),b=new st(new Uint16Array(D),x.itemSize,x.normalized));const S=this.processAccessor(b||x,r);S!==null&&(w.startsWith("_")||this.detectMeshQuantization(w,x),l[w]=S,i.attributes.set(this.getUID(x),S))}if(f!==void 0&&r.setAttribute("normal",f),Object.keys(l).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const w=[],x=[],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 F={};let Y=!1;for(const V in r.morphAttributes){if(V!=="position"&&V!=="normal"&&V!=="color"){Y||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),Y=!0);continue}const K=r.morphAttributes[V][S],W=V.toUpperCase()+(V==="color"?"_0":""),j=r.attributes[V];if(i.attributes.has(this.getUID(K,!0))){F[W]=i.attributes.get(this.getUID(K,!0));continue}const X=K.clone();if(!r.morphTargetsRelative)for(let J=0,ee=K.count;J<ee;J++)for(let $=0;$<K.itemSize;$++)$===0&&X.setX(J,K.getX(J)-j.getX(J)),$===1&&X.setY(J,K.getY(J)-j.getY(J)),$===2&&X.setZ(J,K.getZ(J)-j.getZ(J)),$===3&&X.setW(J,K.getW(J)-j.getW(J));F[W]=this.processAccessor(X,r),i.attributes.set(this.getUID(j,!0),F[W])}d.push(F),w.push(e.morphTargetInfluences[S]),e.morphTargetDictionary!==void 0&&x.push(D[S])}c.weights=w,x.length>0&&(c.extras={},c.extras.targetNames=x)}const m=Array.isArray(e.material);if(m&&r.groups.length===0)return null;let I=!1;if(m&&r.index===null){const w=[];for(let x=0,D=r.attributes.position.count;x<D;x++)w[x]=x;r.setIndex(w),I=!0}const E=m?e.material:[e.material],C=m?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let w=0,x=C.length;w<x;w++){const D={mode:A,attributes:l};if(this.serializeUserData(r,D),d.length>0&&(D.targets=d),r.index!==null){let F=this.getUID(r.index);(C[w].start!==void 0||C[w].count!==void 0)&&(F+=":"+C[w].start+":"+C[w].count),i.attributes.has(F)?D.indices=i.attributes.get(F):(D.indices=this.processAccessor(r.index,r,C[w].start,C[w].count),i.attributes.set(F,D.indices)),D.indices===null&&delete D.indices}const S=this.processMaterial(E[C[w].materialIndex]);S!==null&&(D.material=S),h.push(D)}I===!0&&r.setIndex(null),c.primitives=h,s.meshes||(s.meshes=[]),this._invokeAll(function(w){w.writeMesh&&w.writeMesh(e,c)});const Q=s.meshes.push(c)-1;return i.meshes.set(a,Q),Q}detectMeshQuantization(e,t){if(this.extensionsUsed[An])return;let i;switch(t.array.constructor){case Int8Array:i="byte";break;case Uint8Array:i="unsigned byte";break;case Int16Array:i="short";break;case Uint16Array:i="unsigned short";break;default:return}t.normalized&&(i+=" normalized");const s=e.split("_",1)[0];Va[s]&&Va[s].includes(i)&&(this.extensionsUsed[An]=!0,this.extensionsRequired[An]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const i=e.isOrthographicCamera,s={type:i?"orthographic":"perspective"};return i?s.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:s.perspective={aspectRatio:e.aspect,yfov:Ee.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(s.name=e.type),t.cameras.push(s)-1}processAnimation(e,t){const i=this.json,s=this.nodeMap;i.animations||(i.animations=[]),e=rn.Utils.mergeMorphTargetTracks(e.clone(),t);const n=e.tracks,a=[],r=[];for(let A=0;A<n.length;++A){const c=n[A],l=Dt.parseTrackName(c.name);let h=Dt.findNode(t,l.nodeName);const d=Wa[l.propertyName];if(l.objectName==="bones"&&(h.isSkinnedMesh===!0?h=h.skeleton.getBoneByName(l.objectIndex):h=void 0),!h||!d){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',c.name);continue}const p=1;let f=c.values.length/c.times.length;d===Wa.morphTargetInfluences&&(f/=h.morphTargetInfluences.length);let b;c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(b="CUBICSPLINE",f/=3):c.getInterpolation()===Tn?b="STEP":b="LINEAR",r.push({input:this.processAccessor(new st(c.times,p)),output:this.processAccessor(new st(c.values,f)),interpolation:b}),a.push({sampler:r.length-1,target:{node:s.get(h),path:d}})}return i.animations.push({name:e.name||"clip_"+i.animations.length,samplers:r,channels:a}),i.animations.length-1}processSkin(e){const t=this.json,i=this.nodeMap,s=t.nodes[i.get(e)],n=e.skeleton;if(n===void 0)return null;const a=e.skeleton.bones[0];if(a===void 0)return null;const r=[],A=new Float32Array(n.bones.length*16),c=new le;for(let l=0;l<n.bones.length;++l)r.push(i.get(n.bones[l])),c.copy(n.boneInverses[l]),c.multiply(e.bindMatrix).toArray(A,l*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new st(A,16)),joints:r,skeleton:i.get(a)}),s.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 i=this.json,s=this.options,n=this.nodeMap;i.nodes||(i.nodes=[]);const a={};if(s.trs){const A=e.quaternion.toArray(),c=e.position.toArray(),l=e.scale.toArray();Ts(A,[0,0,0,1])||(a.rotation=A),Ts(c,[0,0,0])||(a.translation=c),Ts(l,[1,1,1])||(a.scale=l)}else e.matrixAutoUpdate&&e.updateMatrix(),Lc(e.matrix)===!1&&(a.matrix=e.matrix.elements);if(e.name!==""&&(a.name=String(e.name)),this.serializeUserData(e,a),e.isMesh||e.isLine||e.isPoints){const A=this.processMesh(e);A!==null&&(a.mesh=A)}else e.isCamera&&(a.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const A=[];for(let c=0,l=e.children.length;c<l;c++){const h=e.children[c];if(h.visible||s.onlyVisible===!1){const d=this.processNode(h);d!==null&&A.push(d)}}A.length>0&&(a.children=A)}this._invokeAll(function(A){A.writeNode&&A.writeNode(e,a)});const r=i.nodes.push(a)-1;return n.set(e,r),r}processScene(e){const t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);const s={};e.name!==""&&(s.name=e.name),t.scenes.push(s);const n=[];for(let a=0,r=e.children.length;a<r;a++){const A=e.children[a];if(A.visible||i.onlyVisible===!1){const c=this.processNode(A);c!==null&&n.push(c)}}n.length>0&&(s.nodes=n),this.serializeUserData(e,s)}processObjects(e){const t=new vi;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);this.processScene(t)}processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(s){s.beforeParse&&s.beforeParse(e)});const i=[];for(let s=0;s<e.length;s++)e[s]instanceof vi?this.processScene(e[s]):i.push(e[s]);i.length>0&&this.processObjects(i);for(let s=0;s<this.skins.length;++s)this.processSkin(this.skins[s]);for(let s=0;s<t.animations.length;++s)this.processAnimation(t.animations[s],e[0]);this._invokeAll(function(s){s.afterParse&&s.afterParse(e)})}_invokeAll(e){for(let t=0,i=this.plugins.length;t<i;t++)e(this.plugins[t])}}class Gc{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 i=this.writer,s=i.json,n=i.extensionsUsed,a={};e.name&&(a.name=e.name),a.color=e.color.toArray(),a.intensity=e.intensity,e.isDirectionalLight?a.type="directional":e.isPointLight?(a.type="point",e.distance>0&&(a.range=e.distance)):e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(1-e.penumbra)*e.angle,a.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."),n[this.name]||(s.extensions=s.extensions||{},s.extensions[this.name]={lights:[]},n[this.name]=!0);const r=s.extensions[this.name].lights;r.push(a),t.extensions=t.extensions||{},t.extensions[this.name]={light:r.length-1}}}class Pc{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class Oc{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.clearcoatFactor=e.clearcoat,e.clearcoatMap){const a={index:i.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};i.applyTextureTransform(a,e.clearcoatMap),n.clearcoatTexture=a}if(n.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const a={index:i.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};i.applyTextureTransform(a,e.clearcoatRoughnessMap),n.clearcoatRoughnessTexture=a}if(e.clearcoatNormalMap){const a={index:i.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(a.scale=e.clearcoatNormalScale.x),i.applyTextureTransform(a,e.clearcoatNormalMap),n.clearcoatNormalTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Hc{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const i=this.writer.extensionsUsed,s={};s.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class jc{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.iridescenceFactor=e.iridescence,e.iridescenceMap){const a={index:i.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};i.applyTextureTransform(a,e.iridescenceMap),n.iridescenceTexture=a}if(n.iridescenceIor=e.iridescenceIOR,n.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],n.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const a={index:i.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};i.applyTextureTransform(a,e.iridescenceThicknessMap),n.iridescenceThicknessTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class qc{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.transmissionFactor=e.transmission,e.transmissionMap){const a={index:i.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};i.applyTextureTransform(a,e.transmissionMap),n.transmissionTexture=a}t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class zc{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const i=this.writer,s=i.extensionsUsed,n={};if(n.thicknessFactor=e.thickness,e.thicknessMap){const a={index:i.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};i.applyTextureTransform(a,e.thicknessMap),n.thicknessTexture=a}e.attenuationDistance!==1/0&&(n.attenuationDistance=e.attenuationDistance),n.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Yc{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const i=this.writer.extensionsUsed,s={};s.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Kc{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(Rc)&&!e.specularIntensityMap&&!e.specularColorMap)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.specularIntensityMap){const a={index:i.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};i.applyTextureTransform(a,e.specularIntensityMap),n.specularTexture=a}if(e.specularColorMap){const a={index:i.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};i.applyTextureTransform(a,e.specularColorMap),n.specularColorTexture=a}n.specularFactor=e.specularIntensity,n.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Jc{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.sheenRoughnessMap){const a={index:i.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};i.applyTextureTransform(a,e.sheenRoughnessMap),n.sheenRoughnessTexture=a}if(e.sheenColorMap){const a={index:i.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};i.applyTextureTransform(a,e.sheenColorMap),n.sheenColorTexture=a}n.sheenRoughnessFactor=e.sheenRoughness,n.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Vc{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.anisotropyMap){const a={index:i.processTexture(e.anisotropyMap)};i.applyTextureTransform(a,e.anisotropyMap),n.anisotropyTexture=a}n.anisotropyStrength=e.anisotropy,n.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Wc{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const i=this.writer.extensionsUsed,s={};s.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Xc{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;const i=this.writer,s=i.extensionsUsed,n={};if(e.bumpMap){const a={index:i.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};i.applyTextureTransform(a,e.bumpMap),n.bumpTexture=a}n.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=n,s[this.name]=!0}}class Zc{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const i=this.writer,s=e,n=new Float32Array(s.count*3),a=new Float32Array(s.count*4),r=new Float32Array(s.count*3),A=new le,c=new N,l=new we,h=new N;for(let p=0;p<s.count;p++)s.getMatrixAt(p,A),A.decompose(c,l,h),c.toArray(n,p*3),l.toArray(a,p*4),h.toArray(r,p*3);const d={TRANSLATION:i.processAccessor(new st(n,3)),ROTATION:i.processAccessor(new st(a,4)),SCALE:i.processAccessor(new st(r,3))};s.instanceColor&&(d._COLOR_0=i.processAccessor(s.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:d},i.extensionsUsed[this.name]=!0,i.extensionsRequired[this.name]=!0}}rn.Utils={insertKeyframe:function(o,e){const t=o.getValueSize(),i=new o.TimeBufferType(o.times.length+1),s=new o.ValueBufferType(o.values.length+t),n=o.createInterpolant(new o.ValueBufferType(t));let a;if(o.times.length===0){i[0]=e;for(let r=0;r<t;r++)s[r]=0;a=0}else if(e<o.times[0]){if(Math.abs(o.times[0]-e)<.001)return 0;i[0]=e,i.set(o.times,1),s.set(n.evaluate(e),0),s.set(o.values,t),a=0}else if(e>o.times[o.times.length-1]){if(Math.abs(o.times[o.times.length-1]-e)<.001)return o.times.length-1;i[i.length-1]=e,i.set(o.times,0),s.set(o.values,0),s.set(n.evaluate(e),o.values.length),a=i.length-1}else for(let r=0;r<o.times.length;r++){if(Math.abs(o.times[r]-e)<.001)return r;if(o.times[r]<e&&o.times[r+1]>e){i.set(o.times.slice(0,r+1),0),i[r+1]=e,i.set(o.times.slice(r+1),r+2),s.set(o.values.slice(0,(r+1)*t),0),s.set(n.evaluate(e),(r+1)*t),s.set(o.values.slice((r+1)*t),(r+2)*t),a=r+1;break}}return o.times=i,o.values=s,a},mergeMorphTargetTracks:function(o,e){const t=[],i={},s=o.tracks;for(let n=0;n<s.length;++n){let a=s[n];const r=Dt.parseTrackName(a.name),A=Dt.findNode(e,r.nodeName);if(r.propertyName!=="morphTargetInfluences"||r.propertyIndex===void 0){t.push(a);continue}if(a.createInterpolant!==a.InterpolantFactoryMethodDiscrete&&a.createInterpolant!==a.InterpolantFactoryMethodLinear){if(a.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."),a=a.clone(),a.setInterpolation(pi)}const c=A.morphTargetInfluences.length,l=A.morphTargetDictionary[r.propertyIndex];if(l===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+r.propertyIndex);let h;if(i[A.uuid]===void 0){h=a.clone();const p=new h.ValueBufferType(c*h.times.length);for(let f=0;f<h.times.length;f++)p[f*c+l]=h.values[f];h.name=(r.nodeName||"")+".morphTargetInfluences",h.values=p,i[A.uuid]=h,t.push(h);continue}const d=a.createInterpolant(new a.ValueBufferType(1));h=i[A.uuid];for(let p=0;p<h.times.length;p++)h.values[p*c+l]=d.evaluate(h.times[p]);for(let p=0;p<a.times.length;p++){const f=this.insertKeyframe(h,a.times[p]);h.values[f*c+l]=a.values[p]}}return o.tracks=t,o}};const Qe={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 so(o){const e=await fetch(o);if(e.ok)return e.json();throw new Error(e.statusText)}async function $c(o){if(!o)throw new Error("No basePath supplied");return await so(`${o}/profilesList.json`)}async function el(o,e,t=null,i=!0){if(!o)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const s=await $c(e);let n;if(o.profiles.some(A=>{const c=s[A];return c&&(n={profileId:A,profilePath:`${e}/${c.path}`,deprecated:!!c.deprecated}),!!n}),!n){if(!t)throw new Error("No matching profile name found");const A=s[t];if(!A)throw new Error(`No matching profile name found and default profile "${t}" missing.`);n={profileId:t,profilePath:`${e}/${A.path}`,deprecated:!!A.deprecated}}const a=await so(n.profilePath);let r;if(i){let A;if(o.handedness==="any"?A=a.layouts[Object.keys(a.layouts)[0]]:A=a.layouts[o.handedness],!A)throw new Error(`No matching handedness, ${o.handedness}, in profile ${n.profileId}`);A.assetPath&&(r=n.profilePath.replace("profile.json",A.assetPath))}return{profile:a,assetPath:r}}const tl={xAxis:0,yAxis:0,button:0,state:Qe.ComponentState.DEFAULT};function sl(o=0,e=0){let t=o,i=e;if(Math.sqrt(o*o+e*e)>1){const s=Math.atan2(e,o);t=Math.cos(s),i=Math.sin(s)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:i*.5+.5}}class il{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===Qe.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(tl)}updateFromComponent({xAxis:e,yAxis:t,button:i,state:s}){const{normalizedXAxis:n,normalizedYAxis:a}=sl(e,t);switch(this.componentProperty){case Qe.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?n:.5;break;case Qe.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?a:.5;break;case Qe.ComponentProperty.BUTTON:this.value=this.states.includes(s)?i:0;break;case Qe.ComponentProperty.STATE:this.valueNodeProperty===Qe.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(s):this.value=this.states.includes(s)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class nl{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(i=>{const s=new il(t.visualResponses[i]);this.visualResponses[i]=s}),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:Qe.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=Qe.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=Qe.ComponentState.PRESSED:(t.touched||this.values.button>Qe.ButtonTouchThreshold)&&(this.values.state=Qe.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===Qe.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Qe.AxisTouchThreshold&&(this.values.state=Qe.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===Qe.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Qe.AxisTouchThreshold&&(this.values.state=Qe.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class al{constructor(e,t,i){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=i,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(s=>{const n=this.layoutDescription.components[s];this.components[s]=new nl(s,n)}),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 ol="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",rl="generic-trigger";class Al extends It{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(i=>{const{valueNode:s,minNode:n,maxNode:a,value:r,valueNodeProperty:A}=i;s&&(A===Qe.VisualResponseProperty.VISIBILITY?s.visible=r:A===Qe.VisualResponseProperty.TRANSFORM&&(s.quaternion.slerpQuaternions(n.quaternion,a.quaternion,r),s.position.lerpVectors(n.position,a.position,r)))})}))}}function cl(o,e){Object.values(o.components).forEach(t=>{const{type:i,touchPointNodeName:s,visualResponses:n}=t;if(i===Qe.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(s),t.touchPointNode){const a=new oi(.001),r=new mt({color:255}),A=new O(a,r);t.touchPointNode.add(A)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(n).forEach(a=>{const{valueNodeName:r,minNodeName:A,maxNodeName:c,valueNodeProperty:l}=a;if(l===Qe.VisualResponseProperty.TRANSFORM){if(a.minNode=e.getObjectByName(A),a.maxNode=e.getObjectByName(c),!a.minNode){console.warn(`Could not find ${A} in the model`);return}if(!a.maxNode){console.warn(`Could not find ${c} in the model`);return}}a.valueNode=e.getObjectByName(r),a.valueNode||console.warn(`Could not find ${r} in the model`)})})}function io(o,e){cl(o.motionController,e),o.envMap&&e.traverse(t=>{t.isMesh&&(t.material.envMap=o.envMap,t.material.needsUpdate=!0)}),o.layers.mask!=0&&e.traverse(t=>{t.layers.mask=o.layers.mask}),o.add(e)}class ll{constructor(e=null,t=null){this.gltfLoader=e,this.path=ol,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new Si)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new Al;let i=null;return e.addEventListener("connected",s=>{const n=s.data;n.targetRayMode!=="tracked-pointer"||!n.gamepad||n.hand||el(n,this.path,rl).then(({profile:a,assetPath:r})=>{t.motionController=new al(n,a,r);const A=this._assetCache[t.motionController.assetUrl];if(A)i=A.scene.clone(),io(t,i),this.onLoad&&this.onLoad(i);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,c=>{this._assetCache[t.motionController.assetUrl]=c,i=c.scene.clone(),io(t,i),this.onLoad&&this.onLoad(i)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(a=>{console.warn(a)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(i),i=null}),t}}const hl="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class gl{constructor(e,t,i,s,n=null,a=null){this.controller=t,this.handModel=e,this.bones=[],n===null&&(n=new Si,n.setPath(i||hl)),n.load(`${s}.glb`,r=>{const A=r.scene.children[0];this.handModel.add(A),A.layers.mask=this.handModel.layers.mask;const c=A.getObjectByProperty("type","SkinnedMesh");c.frustumCulled=!1,c.castShadow=!0,c.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(l=>{const h=A.getObjectByName(l);h!==void 0?h.jointName=l:console.warn(`Couldn't find ${l} in ${s} hand mesh`),this.bones.push(h)}),a&&a(A)})}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const i=this.bones[t];if(i){const s=e[i.jointName];if(s.visible){const n=s.position;i.position.copy(n),i.quaternion.copy(s.quaternion)}}}}}const no=new Os,ei=new N;class ao extends pr{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],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new Te(e,3)),this.setAttribute("uv",new Te(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),i.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 i=new xi(t,6,1);return this.setAttribute("instanceStart",new Kt(i,3,0)),this.setAttribute("instanceEnd",new Kt(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const i=new xi(t,6,1);return this.setAttribute("instanceColorStart",new Kt(i,3,0)),this.setAttribute("instanceColorEnd",new Kt(i,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 ur(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Os);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),no.setFromBufferAttribute(t),this.boundingBox.union(no))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ii),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let s=0;for(let n=0,a=e.count;n<a;n++)ei.fromBufferAttribute(e,n),s=Math.max(s,i.distanceToSquared(ei)),ei.fromBufferAttribute(t,n),s=Math.max(s,i.distanceToSquared(ei));this.boundingSphere.radius=Math.sqrt(s),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)}}zs.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new _e(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Et.line={uniforms:zn.merge([zs.common,zs.fog,zs.line]),vertexShader:`
|
|
89
|
+
}`})),Ai.uniforms.blitTexture.value=o,Ai.defines.IS_SRGB=o.colorSpace==le,Ai.needsUpdate=!0,ss||(ss=new O(ca,Ai),ss.frustumCulled=!1);const s=new qi,i=new Ts;i.add(ss),t===null&&(t=_i=new yr({antialias:!1}));const a=Math.min(o.image.width,e),n=Math.min(o.image.height,e);t.setSize(a,n),t.clear(),t.render(i,s);const r=document.createElement("canvas"),A=r.getContext("2d");r.width=a,r.height=n,A.drawImage(t.domElement,0,0,a,n);const c=new Za(r);return c.minFilter=o.minFilter,c.magFilter=o.magFilter,c.wrapS=o.wrapS,c.wrapT=o.wrapT,c.colorSpace=o.colorSpace,c.name=o.name,_i&&(_i.forceContextLoss(),_i.dispose(),_i=null),c}const no={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 ha{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Zc(e)}),this.register(function(e){return new $c(e)}),this.register(function(e){return new sl(e)}),this.register(function(e){return new al(e)}),this.register(function(e){return new nl(e)}),this.register(function(e){return new ol(e)}),this.register(function(e){return new el(e)}),this.register(function(e){return new tl(e)}),this.register(function(e){return new il(e)}),this.register(function(e){return new rl(e)}),this.register(function(e){return new Al(e)}),this.register(function(e){return new cl(e)}),this.register(function(e){return new ll(e)}),this.register(function(e){return new hl(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,i){const a=new Xc,n=[];for(let r=0,A=this.pluginCallbacks.length;r<A;r++)n.push(this.pluginCallbacks[r](a));a.setPlugins(n),a.write(e,t,i).catch(s)}parseAsync(e,t){const s=this;return new Promise(function(i,a){s.parse(e,i,a,t)})}}const ne={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},ga="KHR_mesh_quantization",ot={};ot[Gi]=ne.NEAREST,ot[fs]=ne.NEAREST_MIPMAP_NEAREST,ot[Ma]=ne.NEAREST_MIPMAP_LINEAR,ot[st]=ne.LINEAR,ot[_a]=ne.LINEAR_MIPMAP_NEAREST,ot[di]=ne.LINEAR_MIPMAP_LINEAR,ot[Oi]=ne.CLAMP_TO_EDGE,ot[Kt]=ne.REPEAT,ot[La]=ne.MIRRORED_REPEAT;const oo={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},jc=new Be,ro=12,qc=1179937895,zc=2,Ao=8,Yc=1313821514,Kc=5130562;function Li(o,e){return o.length===e.length&&o.every(function(t,s){return t===e[s]})}function Jc(o){return new TextEncoder().encode(o).buffer}function Wc(o){return Li(o.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function Vc(o,e,t){const s={min:new Array(o.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(o.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=e;i<e+t;i++)for(let a=0;a<o.itemSize;a++){let n;o.itemSize>4?n=o.array[i*o.itemSize+a]:(a===0?n=o.getX(i):a===1?n=o.getY(i):a===2?n=o.getZ(i):a===3&&(n=o.getW(i)),o.normalized===!0&&(n=be.normalize(n,o.array))),s.min[a]=Math.min(s.min[a],n),s.max[a]=Math.max(s.max[a],n)}return s}function co(o){return Math.ceil(o/4)*4}function da(o,e=0){const t=co(o.byteLength);if(t!==o.byteLength){const s=new Uint8Array(t);if(s.set(new Uint8Array(o)),e!==0)for(let i=o.byteLength;i<t;i++)s[i]=e;return s.buffer}return o}function lo(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function ho(o,e){if(o.toBlob!==void 0)return new Promise(s=>o.toBlob(s,e));let t;return e==="image/jpeg"?t=.92:e==="image/webp"&&(t=.8),o.convertToBlob({type:e,quality:t})}class Xc{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"+Qr}},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 i=this,a=i.buffers,n=i.json;s=i.options;const r=i.extensionsUsed,A=i.extensionsRequired,c=new Blob(a,{type:"application/octet-stream"}),l=Object.keys(r),h=Object.keys(A);if(l.length>0&&(n.extensionsUsed=l),h.length>0&&(n.extensionsRequired=h),n.buffers&&n.buffers.length>0&&(n.buffers[0].byteLength=c.size),s.binary===!0){const d=new FileReader;d.readAsArrayBuffer(c),d.onloadend=function(){const p=da(d.result),f=new DataView(new ArrayBuffer(Ao));f.setUint32(0,p.byteLength,!0),f.setUint32(4,Kc,!0);const b=da(Jc(JSON.stringify(n)),32),u=new DataView(new ArrayBuffer(Ao));u.setUint32(0,b.byteLength,!0),u.setUint32(4,Yc,!0);const I=new ArrayBuffer(ro),C=new DataView(I);C.setUint32(0,qc,!0),C.setUint32(4,zc,!0);const E=ro+u.byteLength+b.byteLength+f.byteLength+p.byteLength;C.setUint32(8,E,!0);const y=new Blob([I,u,b,f,p],{type:"application/octet-stream"}),w=new FileReader;w.readAsArrayBuffer(y),w.onloadend=function(){t(w.result)}}}else if(n.buffers&&n.buffers.length>0){const d=new FileReader;d.readAsDataURL(c),d.onloadend=function(){const p=d.result;n.buffers[0].uri=p,t(n)}}else t(n)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;const s=this.options,i=this.extensionsUsed;try{const a=JSON.parse(JSON.stringify(e.userData));if(s.includeCustomExtensions&&a.gltfExtensions){t.extensions===void 0&&(t.extensions={});for(const n in a.gltfExtensions)t.extensions[n]=a.gltfExtensions[n],i[n]=!0;delete a.gltfExtensions}Object.keys(a).length>0&&(t.extras=a)}catch(a){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+a.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){const s=new Map;s.set(!0,this.uid++),s.set(!1,this.uid++),this.uids.set(e,s)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new F;for(let s=0,i=e.count;s<i;s++)if(Math.abs(t.fromBufferAttribute(e,s).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(),i=new F;for(let a=0,n=s.count;a<n;a++)i.fromBufferAttribute(s,a),i.x===0&&i.y===0&&i.z===0?i.setX(1):i.normalize(),s.setXYZ(a,i.x,i.y,i.z);return t.attributesNormalized.set(e,s),s}applyTextureTransform(e,t){let s=!1;const i={};(t.offset.x!==0||t.offset.y!==0)&&(i.offset=t.offset.toArray(),s=!0),t.rotation!==0&&(i.rotation=t.rotation,s=!0),(t.repeat.x!==1||t.repeat.y!==1)&&(i.scale=t.repeat.toArray(),s=!0),s&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=i,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function s(d){return d.colorSpace===le?function(p){return p<.04045?p*.0773993808:Math.pow(p*.9478672986+.0521327014,2.4)}:function(p){return p}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof mi&&(e=la(e)),t instanceof mi&&(t=la(t));const i=e?e.image:null,a=t?t.image:null,n=Math.max(i?i.width:0,a?a.width:0),r=Math.max(i?i.height:0,a?a.height:0),A=lo();A.width=n,A.height=r;const c=A.getContext("2d",{willReadFrequently:!0});c.fillStyle="#00ffff",c.fillRect(0,0,n,r);const l=c.getImageData(0,0,n,r);if(i){c.drawImage(i,0,0,n,r);const d=s(e),p=c.getImageData(0,0,n,r).data;for(let f=2;f<p.length;f+=4)l.data[f]=d(p[f]/256)*256}if(a){c.drawImage(a,0,0,n,r);const d=s(t),p=c.getImageData(0,0,n,r).data;for(let f=1;f<p.length;f+=4)l.data[f]=d(p[f]/256)*256}c.putImageData(l,0,0);const h=(e||t).clone();return h.source=new vr(A),h.colorSpace=zi,h.channel=(e||t).channel,e&&t&&e.channel!==t.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),h}processBuffer(e){const t=this.json,s=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),s.push(e),0}processBufferView(e,t,s,i,a){const n=this.json;n.bufferViews||(n.bufferViews=[]);let r;switch(t){case ne.BYTE:case ne.UNSIGNED_BYTE:r=1;break;case ne.SHORT:case ne.UNSIGNED_SHORT:r=2;break;default:r=4}let A=e.itemSize*r;a===ne.ARRAY_BUFFER&&(A=Math.ceil(A/4)*4);const c=co(i*A),l=new DataView(new ArrayBuffer(c));let h=0;for(let p=s;p<s+i;p++){for(let f=0;f<e.itemSize;f++){let b;e.itemSize>4?b=e.array[p*e.itemSize+f]:(f===0?b=e.getX(p):f===1?b=e.getY(p):f===2?b=e.getZ(p):f===3&&(b=e.getW(p)),e.normalized===!0&&(b=be.normalize(b,e.array))),t===ne.FLOAT?l.setFloat32(h,b,!0):t===ne.INT?l.setInt32(h,b,!0):t===ne.UNSIGNED_INT?l.setUint32(h,b,!0):t===ne.SHORT?l.setInt16(h,b,!0):t===ne.UNSIGNED_SHORT?l.setUint16(h,b,!0):t===ne.BYTE?l.setInt8(h,b):t===ne.UNSIGNED_BYTE&&l.setUint8(h,b),h+=r}h%A!==0&&(h+=A-h%A)}const d={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:c};return a!==void 0&&(d.target=a),a===ne.ARRAY_BUFFER&&(d.byteStride=A),this.byteOffset+=c,n.bufferViews.push(d),{id:n.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,s=t.json;return s.bufferViews||(s.bufferViews=[]),new Promise(function(i){const a=new FileReader;a.readAsArrayBuffer(e),a.onloadend=function(){const n=da(a.result),r={buffer:t.processBuffer(n),byteOffset:t.byteOffset,byteLength:n.byteLength};t.byteOffset+=n.byteLength,i(s.bufferViews.push(r)-1)}})}processAccessor(e,t,s,i){const a=this.json,n={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let r;if(e.array.constructor===Float32Array)r=ne.FLOAT;else if(e.array.constructor===Int32Array)r=ne.INT;else if(e.array.constructor===Uint32Array)r=ne.UNSIGNED_INT;else if(e.array.constructor===Int16Array)r=ne.SHORT;else if(e.array.constructor===Uint16Array)r=ne.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)r=ne.BYTE;else if(e.array.constructor===Uint8Array)r=ne.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(s===void 0&&(s=0),(i===void 0||i===1/0)&&(i=e.count),i===0)return null;const A=Vc(e,s,i);let c;t!==void 0&&(c=e===t.index?ne.ELEMENT_ARRAY_BUFFER:ne.ARRAY_BUFFER);const l=this.processBufferView(e,r,s,i,c),h={bufferView:l.id,byteOffset:l.byteOffset,componentType:r,count:i,max:A.max,min:A.min,type:n[e.itemSize]};return e.normalized===!0&&(h.normalized=!0),a.accessors||(a.accessors=[]),a.accessors.push(h)-1}processImage(e,t,s,i="image/png"){if(e!==null){const a=this,n=a.cache,r=a.json,A=a.options,c=a.pending;n.images.has(e)||n.images.set(e,{});const l=n.images.get(e),h=i+":flipY/"+s.toString();if(l[h]!==void 0)return l[h];r.images||(r.images=[]);const d={mimeType:i},p=lo();p.width=Math.min(e.width,A.maxTextureSize),p.height=Math.min(e.height,A.maxTextureSize);const f=p.getContext("2d",{willReadFrequently:!0});if(s===!0&&(f.translate(0,p.height),f.scale(1,-1)),e.data!==void 0){t!==Pt&&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 u=new Uint8ClampedArray(e.height*e.width*4);for(let I=0;I<u.length;I+=4)u[I+0]=e.data[I+0],u[I+1]=e.data[I+1],u[I+2]=e.data[I+2],u[I+3]=e.data[I+3];f.putImageData(new ImageData(u,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,p.width,p.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");A.binary===!0?c.push(ho(p,i).then(u=>a.processBufferViewImage(u)).then(u=>{d.bufferView=u})):p.toDataURL!==void 0?d.uri=p.toDataURL(i):c.push(ho(p,i).then(u=>new FileReader().readAsDataURL(u)).then(u=>{d.uri=u}));const b=r.images.push(d)-1;return l[h]=b,b}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:ot[e.magFilter],minFilter:ot[e.minFilter],wrapS:ot[e.wrapS],wrapT:ot[e.wrapT]};return t.samplers.push(s)-1}processTexture(e){const t=this.options,s=this.cache,i=this.json;if(s.textures.has(e))return s.textures.get(e);const a={keep:!0,newTexture:null};if(this._invokeAll(function(c){c.beforeWriteTexture&&c.beforeWriteTexture(e,a)}),a.keep===!1)return null;a.newTexture!=null&&(e=a.newTexture),i.textures||(i.textures=[]),e instanceof mi&&(e=la(e,t.maxTextureSize));let n=e.userData.mimeType;n==="image/webp"&&(n="image/png");const r={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,n)};e.name&&(r.name=e.name),this._invokeAll(function(c){c.writeTexture&&c.writeTexture(e,r)});const A=i.textures.push(r)-1;return s.textures.set(e,A),A}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 i={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const a=e.color.toArray().concat([e.opacity]);Li(a,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=a),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5);const n=e.metalnessMap?.image?e.metalnessMap:void 0,r=e.roughnessMap?.image?e.roughnessMap:void 0;if(n||r){const c=this.buildMetalRoughTexture(n,r),l={index:this.processTexture(c),channel:c.channel};this.applyTextureTransform(l,c),i.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const c={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(c,e.map),i.pbrMetallicRoughness.baseColorTexture=c}if(e.emissive){const c=e.emissive;if(Math.max(c.r,c.g,c.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap?.image){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),i.emissiveTexture=l}}if(e.normalMap?.image){const c={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(c.scale=e.normalScale.x),this.applyTextureTransform(c,e.normalMap),i.normalTexture=c}if(e.aoMap?.image){const c={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(c.strength=e.aoMapIntensity),this.applyTextureTransform(c,e.aoMap),i.occlusionTexture=c}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Hi&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(c){c.writeMaterial&&c.writeMaterial(e,i)});const A=s.materials.push(i)-1;return t.materials.set(e,A),A}processMesh(e){const t={keep:!0};if(this._invokeAll(function(w){w.beforeWriteMesh&&w.beforeWriteMesh(e,t)}),t.keep!=!0)return null;const s=this.cache,i=this.json,a=[e.geometry.uuid];if(Array.isArray(e.material))for(let w=0,x=e.material.length;w<x;w++)a.push(e.material[w].uuid);else a.push(e.material.uuid);const n=a.join(":");if(s.meshes.has(n))return s.meshes.get(n);const r=e.geometry;let A;e.isLineSegments?A=ne.LINES:e.isLineLoop?A=ne.LINE_LOOP:e.isLine?A=ne.LINE_STRIP:e.isPoints?A=ne.POINTS:A=e.material.wireframe?ne.LINES:ne.TRIANGLES;const c={},l={},h=[],d=[],p={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 b=null;for(let w in r.attributes){if(w.slice(0,5)==="morph")continue;const x=r.attributes[w];if(w=p[w]||w.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(w)||(w="_"+w),s.attributes.has(this.getUID(x))){l[w]=s.attributes.get(this.getUID(x));continue}b=null;const D=x.array;w==="JOINTS_0"&&!(D instanceof Uint16Array)&&!(D instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),b=new Ye(new Uint16Array(D),x.itemSize,x.normalized));const S=this.processAccessor(b||x,r);S!==null&&(w.startsWith("_")||this.detectMeshQuantization(w,x),l[w]=S,s.attributes.set(this.getUID(x),S))}if(f!==void 0&&r.setAttribute("normal",f),Object.keys(l).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const w=[],x=[],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 L={};let Y=!1;for(const W in r.morphAttributes){if(W!=="position"&&W!=="normal"&&W!=="color"){Y||(console.warn("GLTFExporter: Only POSITION, NORMAL and COLOR morph are supported."),Y=!0);continue}const K=r.morphAttributes[W][S],V=W.toUpperCase()+(W==="color"?"_0":""),j=r.attributes[W];if(s.attributes.has(this.getUID(K,!0))){L[V]=s.attributes.get(this.getUID(K,!0));continue}const X=K.clone();if(!r.morphTargetsRelative)for(let J=0,ee=K.count;J<ee;J++)for(let $=0;$<K.itemSize;$++)$===0&&X.setX(J,K.getX(J)-j.getX(J)),$===1&&X.setY(J,K.getY(J)-j.getY(J)),$===2&&X.setZ(J,K.getZ(J)-j.getZ(J)),$===3&&X.setW(J,K.getW(J)-j.getW(J));L[V]=this.processAccessor(X,r),s.attributes.set(this.getUID(j,!0),L[V])}d.push(L),w.push(e.morphTargetInfluences[S]),e.morphTargetDictionary!==void 0&&x.push(D[S])}c.weights=w,x.length>0&&(c.extras={},c.extras.targetNames=x)}const u=Array.isArray(e.material);if(u&&r.groups.length===0)return null;let I=!1;if(u&&r.index===null){const w=[];for(let x=0,D=r.attributes.position.count;x<D;x++)w[x]=x;r.setIndex(w),I=!0}const C=u?e.material:[e.material],E=u?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let w=0,x=E.length;w<x;w++){const D={mode:A,attributes:l};if(this.serializeUserData(r,D),d.length>0&&(D.targets=d),r.index!==null){let L=this.getUID(r.index);(E[w].start!==void 0||E[w].count!==void 0)&&(L+=":"+E[w].start+":"+E[w].count),s.attributes.has(L)?D.indices=s.attributes.get(L):(D.indices=this.processAccessor(r.index,r,E[w].start,E[w].count),s.attributes.set(L,D.indices)),D.indices===null&&delete D.indices}const S=this.processMaterial(C[E[w].materialIndex]);S!==null&&(D.material=S),h.push(D)}I===!0&&r.setIndex(null),c.primitives=h,i.meshes||(i.meshes=[]),this._invokeAll(function(w){w.writeMesh&&w.writeMesh(e,c)});const y=i.meshes.push(c)-1;return s.meshes.set(n,y),y}detectMeshQuantization(e,t){if(this.extensionsUsed[ga])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 i=e.split("_",1)[0];no[i]&&no[i].includes(s)&&(this.extensionsUsed[ga]=!0,this.extensionsRequired[ga]=!0)}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const s=e.isOrthographicCamera,i={type:s?"orthographic":"perspective"};return s?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:be.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){const s=this.json,i=this.nodeMap;s.animations||(s.animations=[]),e=ha.Utils.mergeMorphTargetTracks(e.clone(),t);const a=e.tracks,n=[],r=[];for(let A=0;A<a.length;++A){const c=a[A],l=Dt.parseTrackName(c.name);let h=Dt.findNode(t,l.nodeName);const d=oo[l.propertyName];if(l.objectName==="bones"&&(h.isSkinnedMesh===!0?h=h.skeleton.getBoneByName(l.objectIndex):h=void 0),!h||!d){console.warn('THREE.GLTFExporter: Could not export animation track "%s".',c.name);continue}const p=1;let f=c.values.length/c.times.length;d===oo.morphTargetInfluences&&(f/=h.morphTargetInfluences.length);let b;c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(b="CUBICSPLINE",f/=3):c.getInterpolation()===Pa?b="STEP":b="LINEAR",r.push({input:this.processAccessor(new Ye(c.times,p)),output:this.processAccessor(new Ye(c.values,f)),interpolation:b}),n.push({sampler:r.length-1,target:{node:i.get(h),path:d}})}return s.animations.push({name:e.name||"clip_"+s.animations.length,samplers:r,channels:n}),s.animations.length-1}processSkin(e){const t=this.json,s=this.nodeMap,i=t.nodes[s.get(e)],a=e.skeleton;if(a===void 0)return null;const n=e.skeleton.bones[0];if(n===void 0)return null;const r=[],A=new Float32Array(a.bones.length*16),c=new re;for(let l=0;l<a.bones.length;++l)r.push(s.get(a.bones[l])),c.copy(a.boneInverses[l]),c.multiply(e.bindMatrix).toArray(A,l*16);return t.skins===void 0&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new Ye(A,16)),joints:r,skeleton:s.get(n)}),i.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,i=this.options,a=this.nodeMap;s.nodes||(s.nodes=[]);const n={};if(i.trs){const A=e.quaternion.toArray(),c=e.position.toArray(),l=e.scale.toArray();Li(A,[0,0,0,1])||(n.rotation=A),Li(c,[0,0,0])||(n.translation=c),Li(l,[1,1,1])||(n.scale=l)}else e.matrixAutoUpdate&&e.updateMatrix(),Wc(e.matrix)===!1&&(n.matrix=e.matrix.elements);if(e.name!==""&&(n.name=String(e.name)),this.serializeUserData(e,n),e.isMesh||e.isLine||e.isPoints){const A=this.processMesh(e);A!==null&&(n.mesh=A)}else e.isCamera&&(n.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const A=[];for(let c=0,l=e.children.length;c<l;c++){const h=e.children[c];if(h.visible||i.onlyVisible===!1){const d=this.processNode(h);d!==null&&A.push(d)}}A.length>0&&(n.children=A)}this._invokeAll(function(A){A.writeNode&&A.writeNode(e,n)});const r=s.nodes.push(n)-1;return a.set(e,r),r}processScene(e){const t=this.json,s=this.options;t.scenes||(t.scenes=[],t.scene=0);const i={};e.name!==""&&(i.name=e.name),t.scenes.push(i);const a=[];for(let n=0,r=e.children.length;n<r;n++){const A=e.children[n];if(A.visible||s.onlyVisible===!1){const c=this.processNode(A);c!==null&&a.push(c)}}a.length>0&&(i.nodes=a),this.serializeUserData(e,i)}processObjects(e){const t=new Ts;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(i){i.beforeParse&&i.beforeParse(e)});const s=[];for(let i=0;i<e.length;i++)e[i]instanceof Ts?this.processScene(e[i]):s.push(e[i]);s.length>0&&this.processObjects(s);for(let i=0;i<this.skins.length;++i)this.processSkin(this.skins[i]);for(let i=0;i<t.animations.length;++i)this.processAnimation(t.animations[i],e[0]);this._invokeAll(function(i){i.afterParse&&i.afterParse(e)})}_invokeAll(e){for(let t=0,s=this.plugins.length;t<s;t++)e(this.plugins[t])}}class Zc{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,i=s.json,a=s.extensionsUsed,n={};e.name&&(n.name=e.name),n.color=e.color.toArray(),n.intensity=e.intensity,e.isDirectionalLight?n.type="directional":e.isPointLight?(n.type="point",e.distance>0&&(n.range=e.distance)):e.isSpotLight&&(n.type="spot",e.distance>0&&(n.range=e.distance),n.spot={},n.spot.innerConeAngle=(1-e.penumbra)*e.angle,n.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."),a[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},a[this.name]=!0);const r=i.extensions[this.name].lights;r.push(n),t.extensions=t.extensions||{},t.extensions[this.name]={light:r.length-1}}}class $c{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const s=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},s[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class el{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;const s=this.writer,i=s.extensionsUsed,a={};if(a.clearcoatFactor=e.clearcoat,e.clearcoatMap){const n={index:s.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};s.applyTextureTransform(n,e.clearcoatMap),a.clearcoatTexture=n}if(a.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const n={index:s.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};s.applyTextureTransform(n,e.clearcoatRoughnessMap),a.clearcoatRoughnessTexture=n}if(e.clearcoatNormalMap){const n={index:s.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};e.clearcoatNormalScale.x!==1&&(n.scale=e.clearcoatNormalScale.x),s.applyTextureTransform(n,e.clearcoatNormalMap),a.clearcoatNormalTexture=n}t.extensions=t.extensions||{},t.extensions[this.name]=a,i[this.name]=!0}}class tl{constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.dispersion===0)return;const s=this.writer.extensionsUsed,i={};i.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class il{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;const s=this.writer,i=s.extensionsUsed,a={};if(a.iridescenceFactor=e.iridescence,e.iridescenceMap){const n={index:s.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};s.applyTextureTransform(n,e.iridescenceMap),a.iridescenceTexture=n}if(a.iridescenceIor=e.iridescenceIOR,a.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],a.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const n={index:s.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};s.applyTextureTransform(n,e.iridescenceThicknessMap),a.iridescenceThicknessTexture=n}t.extensions=t.extensions||{},t.extensions[this.name]=a,i[this.name]=!0}}class sl{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const s=this.writer,i=s.extensionsUsed,a={};if(a.transmissionFactor=e.transmission,e.transmissionMap){const n={index:s.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};s.applyTextureTransform(n,e.transmissionMap),a.transmissionTexture=n}t.extensions=t.extensions||{},t.extensions[this.name]=a,i[this.name]=!0}}class al{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const s=this.writer,i=s.extensionsUsed,a={};if(a.thicknessFactor=e.thickness,e.thicknessMap){const n={index:s.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};s.applyTextureTransform(n,e.thicknessMap),a.thicknessTexture=n}e.attenuationDistance!==1/0&&(a.attenuationDistance=e.attenuationDistance),a.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=a,i[this.name]=!0}}class nl{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;const s=this.writer.extensionsUsed,i={};i.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class ol{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(jc)&&!e.specularIntensityMap&&!e.specularColorMap)return;const s=this.writer,i=s.extensionsUsed,a={};if(e.specularIntensityMap){const n={index:s.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};s.applyTextureTransform(n,e.specularIntensityMap),a.specularTexture=n}if(e.specularColorMap){const n={index:s.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};s.applyTextureTransform(n,e.specularColorMap),a.specularColorTexture=n}a.specularFactor=e.specularIntensity,a.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=a,i[this.name]=!0}}class rl{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const s=this.writer,i=s.extensionsUsed,a={};if(e.sheenRoughnessMap){const n={index:s.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};s.applyTextureTransform(n,e.sheenRoughnessMap),a.sheenRoughnessTexture=n}if(e.sheenColorMap){const n={index:s.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};s.applyTextureTransform(n,e.sheenColorMap),a.sheenColorTexture=n}a.sheenRoughnessFactor=e.sheenRoughness,a.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=a,i[this.name]=!0}}class Al{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;const s=this.writer,i=s.extensionsUsed,a={};if(e.anisotropyMap){const n={index:s.processTexture(e.anisotropyMap)};s.applyTextureTransform(n,e.anisotropyMap),a.anisotropyTexture=n}a.anisotropyStrength=e.anisotropy,a.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=a,i[this.name]=!0}}class cl{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;const s=this.writer.extensionsUsed,i={};i.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=i,s[this.name]=!0}}class ll{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,i=s.extensionsUsed,a={};if(e.bumpMap){const n={index:s.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};s.applyTextureTransform(n,e.bumpMap),a.bumpTexture=n}a.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=a,i[this.name]=!0}}class hl{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,t){if(!e.isInstancedMesh)return;const s=this.writer,i=e,a=new Float32Array(i.count*3),n=new Float32Array(i.count*4),r=new Float32Array(i.count*3),A=new re,c=new F,l=new we,h=new F;for(let p=0;p<i.count;p++)i.getMatrixAt(p,A),A.decompose(c,l,h),c.toArray(a,p*3),l.toArray(n,p*4),h.toArray(r,p*3);const d={TRANSLATION:s.processAccessor(new Ye(a,3)),ROTATION:s.processAccessor(new Ye(n,4)),SCALE:s.processAccessor(new Ye(r,3))};i.instanceColor&&(d._COLOR_0=s.processAccessor(i.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:d},s.extensionsUsed[this.name]=!0,s.extensionsRequired[this.name]=!0}}ha.Utils={insertKeyframe:function(o,e){const t=o.getValueSize(),s=new o.TimeBufferType(o.times.length+1),i=new o.ValueBufferType(o.values.length+t),a=o.createInterpolant(new o.ValueBufferType(t));let n;if(o.times.length===0){s[0]=e;for(let r=0;r<t;r++)i[r]=0;n=0}else if(e<o.times[0]){if(Math.abs(o.times[0]-e)<.001)return 0;s[0]=e,s.set(o.times,1),i.set(a.evaluate(e),0),i.set(o.values,t),n=0}else if(e>o.times[o.times.length-1]){if(Math.abs(o.times[o.times.length-1]-e)<.001)return o.times.length-1;s[s.length-1]=e,s.set(o.times,0),i.set(o.values,0),i.set(a.evaluate(e),o.values.length),n=s.length-1}else for(let r=0;r<o.times.length;r++){if(Math.abs(o.times[r]-e)<.001)return r;if(o.times[r]<e&&o.times[r+1]>e){s.set(o.times.slice(0,r+1),0),s[r+1]=e,s.set(o.times.slice(r+1),r+2),i.set(o.values.slice(0,(r+1)*t),0),i.set(a.evaluate(e),(r+1)*t),i.set(o.values.slice((r+1)*t),(r+2)*t),n=r+1;break}}return o.times=s,o.values=i,n},mergeMorphTargetTracks:function(o,e){const t=[],s={},i=o.tracks;for(let a=0;a<i.length;++a){let n=i[a];const r=Dt.parseTrackName(n.name),A=Dt.findNode(e,r.nodeName);if(r.propertyName!=="morphTargetInfluences"||r.propertyIndex===void 0){t.push(n);continue}if(n.createInterpolant!==n.InterpolantFactoryMethodDiscrete&&n.createInterpolant!==n.InterpolantFactoryMethodLinear){if(n.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."),n=n.clone(),n.setInterpolation(Is)}const c=A.morphTargetInfluences.length,l=A.morphTargetDictionary[r.propertyIndex];if(l===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+r.propertyIndex);let h;if(s[A.uuid]===void 0){h=n.clone();const p=new h.ValueBufferType(c*h.times.length);for(let f=0;f<h.times.length;f++)p[f*c+l]=h.values[f];h.name=(r.nodeName||"")+".morphTargetInfluences",h.values=p,s[A.uuid]=h,t.push(h);continue}const d=n.createInterpolant(new n.ValueBufferType(1));h=s[A.uuid];for(let p=0;p<h.times.length;p++)h.values[p*c+l]=d.evaluate(h.times[p]);for(let p=0;p<n.times.length;p++){const f=this.insertKeyframe(h,n.times[p]);h.values[f*c+l]=n.values[p]}}return o.tracks=t,o}};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 go(o){const e=await fetch(o);if(e.ok)return e.json();throw new Error(e.statusText)}async function gl(o){if(!o)throw new Error("No basePath supplied");return await go(`${o}/profilesList.json`)}async function dl(o,e,t=null,s=!0){if(!o)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const i=await gl(e);let a;if(o.profiles.some(A=>{const c=i[A];return c&&(a={profileId:A,profilePath:`${e}/${c.path}`,deprecated:!!c.deprecated}),!!a}),!a){if(!t)throw new Error("No matching profile name found");const A=i[t];if(!A)throw new Error(`No matching profile name found and default profile "${t}" missing.`);a={profileId:t,profilePath:`${e}/${A.path}`,deprecated:!!A.deprecated}}const n=await go(a.profilePath);let r;if(s){let A;if(o.handedness==="any"?A=n.layouts[Object.keys(n.layouts)[0]]:A=n.layouts[o.handedness],!A)throw new Error(`No matching handedness, ${o.handedness}, in profile ${a.profileId}`);A.assetPath&&(r=a.profilePath.replace("profile.json",A.assetPath))}return{profile:n,assetPath:r}}const pl={xAxis:0,yAxis:0,button:0,state:ye.ComponentState.DEFAULT};function ul(o=0,e=0){let t=o,s=e;if(Math.sqrt(o*o+e*e)>1){const i=Math.atan2(e,o);t=Math.cos(i),s=Math.sin(i)}return{normalizedXAxis:t*.5+.5,normalizedYAxis:s*.5+.5}}class fl{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(pl)}updateFromComponent({xAxis:e,yAxis:t,button:s,state:i}){const{normalizedXAxis:a,normalizedYAxis:n}=ul(e,t);switch(this.componentProperty){case ye.ComponentProperty.X_AXIS:this.value=this.states.includes(i)?a:.5;break;case ye.ComponentProperty.Y_AXIS:this.value=this.states.includes(i)?n:.5;break;case ye.ComponentProperty.BUTTON:this.value=this.states.includes(i)?s:0;break;case ye.ComponentProperty.STATE:this.valueNodeProperty===ye.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(i):this.value=this.states.includes(i)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class ml{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 i=new fl(t.visualResponses[s]);this.visualResponses[s]=i}),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 bl{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(i=>{const a=this.layoutDescription.components[i];this.components[i]=new ml(i,a)}),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 Il="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",El="generic-trigger";class Cl extends It{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:i,minNode:a,maxNode:n,value:r,valueNodeProperty:A}=s;i&&(A===ye.VisualResponseProperty.VISIBILITY?i.visible=r:A===ye.VisualResponseProperty.TRANSFORM&&(i.quaternion.slerpQuaternions(a.quaternion,n.quaternion,r),i.position.lerpVectors(a.position,n.position,r)))})}))}}function Bl(o,e){Object.values(o.components).forEach(t=>{const{type:s,touchPointNodeName:i,visualResponses:a}=t;if(s===ye.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(i),t.touchPointNode){const n=new hs(.001),r=new ht({color:255}),A=new O(n,r);t.touchPointNode.add(A)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(a).forEach(n=>{const{valueNodeName:r,minNodeName:A,maxNodeName:c,valueNodeProperty:l}=n;if(l===ye.VisualResponseProperty.TRANSFORM){if(n.minNode=e.getObjectByName(A),n.maxNode=e.getObjectByName(c),!n.minNode){console.warn(`Could not find ${A} in the model`);return}if(!n.maxNode){console.warn(`Could not find ${c} in the model`);return}}n.valueNode=e.getObjectByName(r),n.valueNode||console.warn(`Could not find ${r} in the model`)})})}function po(o,e){Bl(o.motionController,e),o.envMap&&e.traverse(t=>{t.isMesh&&(t.material.envMap=o.envMap,t.material.needsUpdate=!0)}),o.layers.mask!=0&&e.traverse(t=>{t.layers.mask=o.layers.mask}),o.add(e)}class wl{constructor(e=null,t=null){this.gltfLoader=e,this.path=Il,this._assetCache={},this.onLoad=t,this.gltfLoader||(this.gltfLoader=new _s)}setPath(e){return this.path=e,this}createControllerModel(e){const t=new Cl;let s=null;return e.addEventListener("connected",i=>{const a=i.data;a.targetRayMode!=="tracked-pointer"||!a.gamepad||a.hand||dl(a,this.path,El).then(({profile:n,assetPath:r})=>{t.motionController=new bl(a,n,r);const A=this._assetCache[t.motionController.assetUrl];if(A)s=A.scene.clone(),po(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,c=>{this._assetCache[t.motionController.assetUrl]=c,s=c.scene.clone(),po(t,s),this.onLoad&&this.onLoad(s)},null,()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)})}}).catch(n=>{console.warn(n)})}),e.addEventListener("disconnected",()=>{t.motionController=null,t.remove(s),s=null}),t}}const yl="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles/generic-hand/";class Ql{constructor(e,t,s,i,a=null,n=null){this.controller=t,this.handModel=e,this.bones=[],a===null&&(a=new _s,a.setPath(s||yl)),a.load(`${i}.glb`,r=>{const A=r.scene.children[0];this.handModel.add(A),A.layers.mask=this.handModel.layers.mask;const c=A.getObjectByProperty("type","SkinnedMesh");c.frustumCulled=!1,c.castShadow=!0,c.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(l=>{const h=A.getObjectByName(l);h!==void 0?h.jointName=l:console.warn(`Couldn't find ${l} in ${i} hand mesh`),this.bones.push(h)}),n&&n(A)})}updateMesh(){const e=this.controller.joints;for(let t=0;t<this.bones.length;t++){const s=this.bones[t];if(s){const i=e[s.jointName];if(i.visible){const a=i.position;s.position.copy(a),s.quaternion.copy(i.quaternion)}}}}}const uo=new Wt,as=new F;class fo extends xr{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 Me(e,3)),this.setAttribute("uv",new Me(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 Rs(t,6,1);return this.setAttribute("instanceStart",new Jt(s,3,0)),this.setAttribute("instanceEnd",new Jt(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 Rs(t,6,1);return this.setAttribute("instanceColorStart",new Jt(s,3,0)),this.setAttribute("instanceColorEnd",new Jt(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 Sr(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Wt);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),uo.setFromBufferAttribute(t),this.boundingBox.union(uo))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ys),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 i=0;for(let a=0,n=e.count;a<n;a++)as.fromBufferAttribute(e,a),i=Math.max(i,s.distanceToSquared(as)),as.fromBufferAttribute(t,a),i=Math.max(i,s.distanceToSquared(as));this.boundingSphere.radius=Math.sqrt(i),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)}}Wi.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Re(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Ct.line={uniforms:$a.merge([Wi.common,Wi.fog,Wi.line]),vertexShader:`
|
|
90
90
|
#include <common>
|
|
91
91
|
#include <color_pars_vertex>
|
|
92
92
|
#include <fog_pars_vertex>
|
|
@@ -456,9 +456,296 @@ import{Mesh as O,SphereGeometry as oi,Vector3 as N,MeshBasicMaterial as mt,Trian
|
|
|
456
456
|
#include <premultiplied_alpha_fragment>
|
|
457
457
|
|
|
458
458
|
}
|
|
459
|
-
`};class ln extends jn{constructor(e){super({type:"LineMaterial",uniforms:zn.clone(Et.line.uniforms),vertexShader:Et.line.vertexShader,fragmentShader:Et.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 hn=new Rt,oo=new N,ro=new N,Ge=new Rt,Pe=new Rt,wt=new Rt,gn=new N,dn=new le,Oe=new fr,Ao=new N,ti=new Os,si=new Ii,Qt=new Rt;let yt,Zt;function co(o,e,t){return Qt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),Qt.multiplyScalar(1/Qt.w),Qt.x=Zt/t.width,Qt.y=Zt/t.height,Qt.applyMatrix4(o.projectionMatrixInverse),Qt.multiplyScalar(1/Qt.w),Math.abs(Math.max(Qt.x,Qt.y))}function dl(o,e){const t=o.matrixWorld,i=o.geometry,s=i.attributes.instanceStart,n=i.attributes.instanceEnd,a=Math.min(i.instanceCount,s.count);for(let r=0,A=a;r<A;r++){Oe.start.fromBufferAttribute(s,r),Oe.end.fromBufferAttribute(n,r),Oe.applyMatrix4(t);const c=new N,l=new N;yt.distanceSqToSegment(Oe.start,Oe.end,l,c),l.distanceTo(c)<Zt*.5&&e.push({point:l,pointOnLine:c,distance:yt.origin.distanceTo(l),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function pl(o,e,t){const i=e.projectionMatrix,s=o.material.resolution,n=o.matrixWorld,a=o.geometry,r=a.attributes.instanceStart,A=a.attributes.instanceEnd,c=Math.min(a.instanceCount,r.count),l=-e.near;yt.at(1,wt),wt.w=1,wt.applyMatrix4(e.matrixWorldInverse),wt.applyMatrix4(i),wt.multiplyScalar(1/wt.w),wt.x*=s.x/2,wt.y*=s.y/2,wt.z=0,gn.copy(wt),dn.multiplyMatrices(e.matrixWorldInverse,n);for(let h=0,d=c;h<d;h++){if(Ge.fromBufferAttribute(r,h),Pe.fromBufferAttribute(A,h),Ge.w=1,Pe.w=1,Ge.applyMatrix4(dn),Pe.applyMatrix4(dn),Ge.z>l&&Pe.z>l)continue;if(Ge.z>l){const I=Ge.z-Pe.z,E=(Ge.z-l)/I;Ge.lerp(Pe,E)}else if(Pe.z>l){const I=Pe.z-Ge.z,E=(Pe.z-l)/I;Pe.lerp(Ge,E)}Ge.applyMatrix4(i),Pe.applyMatrix4(i),Ge.multiplyScalar(1/Ge.w),Pe.multiplyScalar(1/Pe.w),Ge.x*=s.x/2,Ge.y*=s.y/2,Pe.x*=s.x/2,Pe.y*=s.y/2,Oe.start.copy(Ge),Oe.start.z=0,Oe.end.copy(Pe),Oe.end.z=0;const p=Oe.closestPointToPointParameter(gn,!0);Oe.at(p,Ao);const f=Ee.lerp(Ge.z,Pe.z,p),b=f>=-1&&f<=1,m=gn.distanceTo(Ao)<Zt*.5;if(b&&m){Oe.start.fromBufferAttribute(r,h),Oe.end.fromBufferAttribute(A,h),Oe.start.applyMatrix4(n),Oe.end.applyMatrix4(n);const I=new N,E=new N;yt.distanceSqToSegment(Oe.start,Oe.end,E,I),t.push({point:E,pointOnLine:I,distance:yt.origin.distanceTo(E),object:o,face:null,faceIndex:h,uv:null,uv1:null})}}}class ul extends O{constructor(e=new ao,t=new ln({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,i=e.attributes.instanceEnd,s=new Float32Array(2*t.count);for(let a=0,r=0,A=t.count;a<A;a++,r+=2)oo.fromBufferAttribute(t,a),ro.fromBufferAttribute(i,a),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+oo.distanceTo(ro);const n=new xi(s,2,1);return e.setAttribute("instanceDistanceStart",new Kt(n,1,0)),e.setAttribute("instanceDistanceEnd",new Kt(n,1,1)),this}raycast(e,t){const i=this.material.worldUnits,s=e.camera;s===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const n=e.params.Line2!==void 0&&e.params.Line2.threshold||0;yt=e.ray;const a=this.matrixWorld,r=this.geometry,A=this.material;Zt=A.linewidth+n,r.boundingSphere===null&&r.computeBoundingSphere(),si.copy(r.boundingSphere).applyMatrix4(a);let c;if(i)c=Zt*.5;else{const h=Math.max(s.near,si.distanceToPoint(yt.origin));c=co(s,h,A.resolution)}if(si.radius+=c,yt.intersectsSphere(si)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),ti.copy(r.boundingBox).applyMatrix4(a);let l;if(i)l=Zt*.5;else{const h=Math.max(s.near,ti.distanceToPoint(yt.origin));l=co(s,h,A.resolution)}ti.expandByScalar(l),yt.intersectsBox(ti)!==!1&&(i?dl(this,t):pl(this,s,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(hn),this.material.uniforms.resolution.value.set(hn.z,hn.w))}}class lo extends ao{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,i=new Float32Array(2*t);for(let s=0;s<t;s+=3)i[2*s]=e[s],i[2*s+1]=e[s+1],i[2*s+2]=e[s+2],i[2*s+3]=e[s+3],i[2*s+4]=e[s+4],i[2*s+5]=e[s+5];return super.setPositions(i),this}setColors(e){const t=e.length-3,i=new Float32Array(2*t);for(let s=0;s<t;s+=3)i[2*s]=e[s],i[2*s+1]=e[s+1],i[2*s+2]=e[s+2],i[2*s+3]=e[s+3],i[2*s+4]=e[s+4],i[2*s+5]=e[s+5];return super.setColors(i),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class fl extends ul{constructor(e=new lo,t=new ln({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}class ml extends O{constructor(e){const t=new bl(e),i=new yi(t.image.width*.001,t.image.height*.001),s=new mt({map:t,toneMapped:!1,transparent:!0});super(i,s);function n(a){s.map.dispatchDOMEvent(a)}this.addEventListener("mousedown",n),this.addEventListener("mousemove",n),this.addEventListener("mouseup",n),this.addEventListener("click",n),this.dispose=function(){i.dispose(),s.dispose(),s.map.dispose(),pn.delete(e),this.removeEventListener("mousedown",n),this.removeEventListener("mousemove",n),this.removeEventListener("mouseup",n),this.removeEventListener("click",n)}}}class bl extends qn{constructor(e){super(ho(e)),this.dom=e,this.anisotropy=16,this.colorSpace=ce,this.minFilter=it,this.magFilter=it;const t=new MutationObserver(()=>{this.scheduleUpdate||(this.scheduleUpdate=setTimeout(()=>this.update(),16))}),i={attributes:!0,childList:!0,subtree:!0,characterData:!0};t.observe(e,i),this.observer=t}dispatchDOMEvent(e){e.data&&Il(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=ho(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const pn=new WeakMap;function ho(o){const e=document.createRange(),t=new Be;function i(d){const p=[];let f=!1;function b(){if(f&&(f=!1,d.restore()),p.length===0)return;let m=-1/0,I=-1/0,E=1/0,C=1/0;for(let Q=0;Q<p.length;Q++){const w=p[Q];m=Math.max(m,w.x),I=Math.max(I,w.y),E=Math.min(E,w.x+w.width),C=Math.min(C,w.y+w.height)}d.save(),d.beginPath(),d.rect(m,I,E-m,C-I),d.clip(),f=!0}return{add:function(m){p.push(m),b()},remove:function(){p.pop(),b()}}}function s(d,p,f,b){b!==""&&(d.textTransform==="uppercase"&&(b=b.toUpperCase()),l.font=d.fontWeight+" "+d.fontSize+" "+d.fontFamily,l.textBaseline="top",l.fillStyle=d.color,l.fillText(b,p,f+parseFloat(d.fontSize)*.1))}function n(d,p,f,b,m){f<2*m&&(m=f/2),b<2*m&&(m=b/2),l.beginPath(),l.moveTo(d+m,p),l.arcTo(d+f,p,d+f,p+b,m),l.arcTo(d+f,p+b,d,p+b,m),l.arcTo(d,p+b,d,p,m),l.arcTo(d,p,d+f,p,m),l.closePath()}function a(d,p,f,b,m,I){const E=d[p+"Width"],C=d[p+"Style"],Q=d[p+"Color"];E!=="0px"&&C!=="none"&&Q!=="transparent"&&Q!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=Q,l.lineWidth=parseFloat(E),l.beginPath(),l.moveTo(f,b),l.lineTo(f+m,b+I),l.stroke())}function r(d,p){if(d.nodeType===Node.COMMENT_NODE||d.nodeName==="SCRIPT"||d.style&&d.style.display==="none")return;let f=0,b=0,m=0,I=0;if(d.nodeType===Node.TEXT_NODE){e.selectNode(d);const C=e.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,s(p,f,b,d.nodeValue.trim())}else if(d instanceof HTMLCanvasElement){const C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,l.save();const Q=window.devicePixelRatio;l.scale(1/Q,1/Q),l.drawImage(d,f,b),l.restore()}else if(d instanceof HTMLImageElement){const C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,l.drawImage(d,f,b,m,I)}else{const C=d.getBoundingClientRect();f=C.left-A.left-.5,b=C.top-A.top-.5,m=C.width,I=C.height,p=window.getComputedStyle(d),n(f,b,m,I,parseFloat(p.borderRadius));const Q=p.backgroundColor;Q!=="transparent"&&Q!=="rgba(0, 0, 0, 0)"&&(l.fillStyle=Q,l.fill());const w=["borderTop","borderLeft","borderBottom","borderRight"];let x=!0,D=null;for(const S of w){if(D!==null&&(x=p[S+"Width"]===p[D+"Width"]&&p[S+"Color"]===p[D+"Color"]&&p[S+"Style"]===p[D+"Style"]),x===!1)break;D=S}if(x===!0){const S=parseFloat(p.borderTopWidth);p.borderTopWidth!=="0px"&&p.borderTopStyle!=="none"&&p.borderTopColor!=="transparent"&&p.borderTopColor!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=p.borderTopColor,l.lineWidth=S,l.stroke())}else a(p,"borderTop",f,b,m,0),a(p,"borderLeft",f,b,0,I),a(p,"borderBottom",f,b+I,m,0),a(p,"borderRight",f+m,b,0,I);if(d instanceof HTMLInputElement){let S=p.accentColor;(S===void 0||S==="auto")&&(S=p.color),t.set(S);const F=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(d.type==="radio"&&(n(f,b,m,I,I),l.fillStyle="white",l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),d.checked&&(n(f+2,b+2,m-4,I-4,I),l.fillStyle=S,l.strokeStyle=F,l.lineWidth=2,l.fill(),l.stroke())),d.type==="checkbox"&&(n(f,b,m,I,2),l.fillStyle=d.checked?S:"white",l.strokeStyle=d.checked?F:S,l.lineWidth=1,l.stroke(),l.fill(),d.checked)){const Y=l.textAlign;l.textAlign="center";const V={color:F,fontFamily:p.fontFamily,fontSize:I+"px",fontWeight:"bold"};s(V,f+m/2,b,"\u2714"),l.textAlign=Y}if(d.type==="range"){const[Y,V,K]=["min","max","value"].map(j=>parseFloat(d[j])),W=(K-Y)/(V-Y)*(m-I);n(f,b+I/4,m,I/2,I/4),l.fillStyle=F,l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),n(f,b+I/4,W+I/2,I/2,I/4),l.fillStyle=S,l.fill(),n(f+W,b,I,I,I/2),l.fillStyle=S,l.fill()}(d.type==="color"||d.type==="text"||d.type==="number")&&(h.add({x:f,y:b,width:m,height:I}),s(p,f+parseInt(p.paddingLeft),b+parseInt(p.paddingTop),d.value),h.remove())}}const E=p.overflow==="auto"||p.overflow==="hidden";E&&h.add({x:f,y:b,width:m,height:I});for(let C=0;C<d.childNodes.length;C++)r(d.childNodes[C],p);E&&h.remove()}const A=o.getBoundingClientRect();let c=pn.get(o);c===void 0&&(c=document.createElement("canvas"),c.width=A.width,c.height=A.height,pn.set(o,c));const l=c.getContext("2d"),h=new i(l);return l.clearRect(0,0,c.width,c.height),r(o),c}function Il(o,e,t,i){const s={clientX:t*o.offsetWidth+o.offsetLeft,clientY:i*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,s));const n=o.getBoundingClientRect();t=t*n.width+n.left,i=i*n.height+n.top;function a(r){if(r.nodeType!==Node.TEXT_NODE&&r.nodeType!==Node.COMMENT_NODE){const A=r.getBoundingClientRect();if(t>A.left&&t<A.right&&i>A.top&&i<A.bottom&&(r.dispatchEvent(new MouseEvent(e,s)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[c,l]=["min","max"].map(p=>parseFloat(r[p])),h=A.width,d=(t-A.x)/h;r.value=c+(l-c)*d,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let c=0;c<r.childNodes.length;c++)a(r.childNodes[c])}}a(o)}const ii=new _e,rs={type:"",data:ii},go=new Qi;class El extends Yt{listenToPointerEvents(e,t){const i=this,s=new Qi,n=e.domElement;function a(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();ii.x=(r.clientX-A.left)/A.width*2-1,ii.y=-(r.clientY-A.top)/A.height*2+1,s.setFromCamera(ii,t);const c=s.intersectObjects(i.children,!1);if(c.length>0){const l=c[0],h=l.object,d=l.uv;rs.type=r.type,rs.data.set(d.x,1-d.y),h.dispatchEvent(rs)}}n.addEventListener("pointerdown",a),n.addEventListener("pointerup",a),n.addEventListener("pointermove",a),n.addEventListener("mousedown",a),n.addEventListener("mouseup",a),n.addEventListener("mousemove",a),n.addEventListener("click",a)}listenToXRControllerEvents(e){const t=this,i={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function s(n){const a=n.target;go.setFromXRController(a);const r=go.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],c=A.object,l=A.uv;rs.type=i[n.type],rs.data.set(l.x,1-l.y),c.dispatchEvent(rs)}}e.addEventListener("move",s),e.addEventListener("select",s),e.addEventListener("selectstart",s),e.addEventListener("selectend",s)}}const ks=new N,Ms=new N,po=new Yn;class Cl extends Us{constructor(e,t=1,i=16711680){const s=new rt,n=e.geometry.attributes.normal.count,a=new Te(n*2*3,3);s.setAttribute("position",a),super(s,new St({color:i,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),po.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,i=this.object.geometry;if(i){const s=i.attributes.position,n=i.attributes.normal;let a=0;for(let r=0,A=s.count;r<A;r++)ks.fromBufferAttribute(s,r).applyMatrix4(e),Ms.fromBufferAttribute(n,r),Ms.applyMatrix3(po).normalize().multiplyScalar(this.size).add(ks),t.setXYZ(a,ks.x,ks.y,ks.z),a=a+1,t.setXYZ(a,Ms.x,Ms.y,Ms.z),a=a+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function uo(o,e,t){const i=t.length-o-1;if(e>=t[i])return i-1;if(e<=t[o])return o;let s=o,n=i,a=Math.floor((s+n)/2);for(;e<t[a]||e>=t[a+1];)e<t[a]?n=a:s=a,a=Math.floor((s+n)/2);return a}function Bl(o,e,t,i){const s=[],n=[],a=[];s[0]=1;for(let r=1;r<=t;++r){n[r]=e-i[o+1-r],a[r]=i[o+r]-e;let A=0;for(let c=0;c<r;++c){const l=a[c+1],h=n[r-c],d=s[c]/(l+h);s[c]=A+l*d,A=h*d}s[r]=A}return s}function wl(o,e,t,i){const s=uo(o,i,e),n=Bl(s,i,o,e),a=new Rt(0,0,0,0);for(let r=0;r<=o;++r){const A=t[s-o+r],c=n[r],l=A.w*c;a.x+=A.x*l,a.y+=A.y*l,a.z+=A.z*l,a.w+=A.w*c}return a}function Ql(o,e,t,i,s){const n=[];for(let h=0;h<=t;++h)n[h]=0;const a=[];for(let h=0;h<=i;++h)a[h]=n.slice(0);const r=[];for(let h=0;h<=t;++h)r[h]=n.slice(0);r[0][0]=1;const A=n.slice(0),c=n.slice(0);for(let h=1;h<=t;++h){A[h]=e-s[o+1-h],c[h]=s[o+h]-e;let d=0;for(let p=0;p<h;++p){const f=c[p+1],b=A[h-p];r[h][p]=f+b;const m=r[p][h-1]/r[h][p];r[p][h]=d+f*m,d=b*m}r[h][h]=d}for(let h=0;h<=t;++h)a[0][h]=r[h][t];for(let h=0;h<=t;++h){let d=0,p=1;const f=[];for(let b=0;b<=t;++b)f[b]=n.slice(0);f[0][0]=1;for(let b=1;b<=i;++b){let m=0;const I=h-b,E=t-b;h>=b&&(f[p][0]=f[d][0]/r[E+1][I],m=f[p][0]*r[I][E]);const C=I>=-1?1:-I,Q=h-1<=E?b-1:t-h;for(let x=C;x<=Q;++x)f[p][x]=(f[d][x]-f[d][x-1])/r[E+1][I+x],m+=f[p][x]*r[I+x][E];h<=E&&(f[p][b]=-f[d][b-1]/r[E+1][h],m+=f[p][b]*r[h][E]),a[b][h]=m;const w=d;d=p,p=w}}let l=t;for(let h=1;h<=i;++h){for(let d=0;d<=t;++d)a[h][d]*=l;l*=t-h}return a}function yl(o,e,t,i,s){const n=s<o?s:o,a=[],r=uo(o,i,e),A=Ql(r,i,o,n,e),c=[];for(let l=0;l<t.length;++l){const h=t[l].clone(),d=h.w;h.x*=d,h.y*=d,h.z*=d,c[l]=h}for(let l=0;l<=n;++l){const h=c[r-o].clone().multiplyScalar(A[l][0]);for(let d=1;d<=o;++d)h.add(c[r-o+d].clone().multiplyScalar(A[l][d]));a[l]=h}for(let l=n+1;l<=s+1;++l)a[l]=new Rt(0,0,0);return a}function vl(o,e){let t=1;for(let s=2;s<=o;++s)t*=s;let i=1;for(let s=2;s<=e;++s)i*=s;for(let s=2;s<=o-e;++s)i*=s;return t/i}function xl(o){const e=o.length,t=[],i=[];for(let n=0;n<e;++n){const a=o[n];t[n]=new N(a.x,a.y,a.z),i[n]=a.w}const s=[];for(let n=0;n<e;++n){const a=t[n].clone();for(let r=1;r<=n;++r)a.sub(s[n-r].clone().multiplyScalar(vl(n,r)*i[r]));s[n]=a.divideScalar(i[0])}return s}function Sl(o,e,t,i,s){const n=yl(o,e,t,i,s);return xl(n)}class Dl extends mr{constructor(e,t,i,s,n){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=s||0,this.endKnot=n||this.knots.length-1;for(let a=0;a<i.length;++a){const r=i[a];this.controlPoints[a]=new Rt(r.x,r.y,r.z,r.w)}}getPoint(e,t=new N){const i=t,s=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),n=wl(this.degree,this.knots,this.controlPoints,s);return n.w!==1&&n.divideScalar(n.w),i.set(n.x,n.y,n.z)}getTangent(e,t=new N){const i=t,s=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),n=Sl(this.degree,this.knots,this.controlPoints,s,1);return i.copy(n[1]).normalize(),i}}let ie,xe,Je;class Rl extends xt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=n.path===""?qt.extractUrlBase(e):n.path,r=new ht(this.manager);r.setPath(n.path),r.setResponseType("arraybuffer"),r.setRequestHeader(n.requestHeader),r.setWithCredentials(n.withCredentials),r.load(e,function(A){try{t(n.parse(A,a))}catch(c){s?s(c):console.error(c),n.manager.itemError(e)}},i,s)}parse(e,t){if(Ll(e))ie=new _l().parse(e);else{const s=Eo(e);if(!Nl(s))throw new Error("THREE.FBXLoader: Unknown format.");if(bo(s)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+bo(s));ie=new Fl().parse(s)}const i=new ci(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new Tl(i,this.manager).parse(ie)}getFbxTree(){return ie}}class Tl{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){xe=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),i=this.parseMaterials(t),s=this.parseDeformers(),n=new kl().parse(s);return this.parseScene(s,n,i),Je}parseConnections(){const e=new Map;return"Connections"in ie&&ie.Connections.connections.forEach(function(t){const i=t[0],s=t[1],n=t[2];e.has(i)||e.set(i,{parents:[],children:[]});const a={ID:s,relationship:n};e.get(i).parents.push(a),e.has(s)||e.set(s,{parents:[],children:[]});const r={ID:i,relationship:n};e.get(s).children.push(r)}),e}parseImages(){const e={},t={};if("Video"in ie.Objects){const i=ie.Objects.Video;for(const s in i){const n=i[s],a=parseInt(s);if(e[a]=n.RelativeFilename||n.Filename,"Content"in n){const r=n.Content instanceof ArrayBuffer&&n.Content.byteLength>0,A=typeof n.Content=="string"&&n.Content!=="";if(r||A){const c=this.parseImage(i[s]);t[n.RelativeFilename||n.Filename]=c}}}}for(const i in e){const s=e[i];t[s]!==void 0?e[i]=t[s]:e[i]=e[i].split("\\").pop()}return e}parseImage(e){const t=e.Content,i=e.RelativeFilename||e.Filename,s=i.slice(i.lastIndexOf(".")+1).toLowerCase();let n;switch(s){case"bmp":n="image/bmp";break;case"jpg":case"jpeg":n="image/jpeg";break;case"png":n="image/png";break;case"tif":n="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",i),n="image/tga";break;default:console.warn('FBXLoader: Image type "'+s+'" is not supported.');return}if(typeof t=="string")return"data:"+n+";base64,"+t;{const a=new Uint8Array(t);return window.URL.createObjectURL(new Blob([a],{type:n}))}}parseTextures(e){const t=new Map;if("Texture"in ie.Objects){const i=ie.Objects.Texture;for(const s in i){const n=this.parseTexture(i[s],e);t.set(parseInt(s),n)}}return t}parseTexture(e,t){const i=this.loadTexture(e,t);i.ID=e.id,i.name=e.attrName;const s=e.WrapModeU,n=e.WrapModeV,a=s!==void 0?s.value:0,r=n!==void 0?n.value:0;if(i.wrapS=a===0?zt:Ns,i.wrapT=r===0?zt:Ns,"Scaling"in e){const A=e.Scaling.value;i.repeat.x=A[0],i.repeat.y=A[1]}if("Translation"in e){const A=e.Translation.value;i.offset.x=A[0],i.offset.y=A[1]}return i}loadTexture(e,t){const i=new Set(["tga","tif","tiff","exr","dds","hdr","ktx2"]),s=e.FileName.split(".").pop().toLowerCase(),n=i.has(s)?this.manager.getHandler(`.${s}`):this.textureLoader;if(!n)return console.warn(`FBXLoader: ${s.toUpperCase()} loader not found, creating placeholder texture for`,e.RelativeFilename),new ui;const a=n.path;a||n.setPath(this.textureLoader.path);const r=xe.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)&&n.setPath(void 0));const c=n.load(A);return n.setPath(a),c}parseMaterials(e){const t=new Map;if("Material"in ie.Objects){const i=ie.Objects.Material;for(const s in i){const n=this.parseMaterial(i[s],e);n!==null&&t.set(parseInt(s),n)}}return t}parseMaterial(e,t){const i=e.id,s=e.attrName;let n=e.ShadingModel;if(typeof n=="object"&&(n=n.value),!xe.has(i))return null;const a=this.parseParameters(e,t,i);let r;switch(n.toLowerCase()){case"phong":r=new ms;break;case"lambert":r=new br;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',n),r=new ms;break}return r.setValues(a),r.name=s,r}parseParameters(e,t,i){const s={};e.BumpFactor&&(s.bumpScale=e.BumpFactor.value),e.Diffuse?s.color=We.toWorkingColorSpace(new Be().fromArray(e.Diffuse.value),ce):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(s.color=We.toWorkingColorSpace(new Be().fromArray(e.DiffuseColor.value),ce)),e.DisplacementFactor&&(s.displacementScale=e.DisplacementFactor.value),e.Emissive?s.emissive=We.toWorkingColorSpace(new Be().fromArray(e.Emissive.value),ce):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(s.emissive=We.toWorkingColorSpace(new Be().fromArray(e.EmissiveColor.value),ce)),e.EmissiveFactor&&(s.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(s.opacity=parseFloat(e.Opacity.value)),s.opacity<1&&(s.transparent=!0),e.ReflectionFactor&&(s.reflectivity=e.ReflectionFactor.value),e.Shininess&&(s.shininess=e.Shininess.value),e.Specular?s.specular=We.toWorkingColorSpace(new Be().fromArray(e.Specular.value),ce):e.SpecularColor&&e.SpecularColor.type==="Color"&&(s.specular=We.toWorkingColorSpace(new Be().fromArray(e.SpecularColor.value),ce));const n=this;return xe.get(i).children.forEach(function(a){const r=a.relationship;switch(r){case"Bump":s.bumpMap=n.getTexture(t,a.ID);break;case"Maya|TEX_ao_map":s.aoMap=n.getTexture(t,a.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=n.getTexture(t,a.ID),s.map!==void 0&&(s.map.colorSpace=ce);break;case"DisplacementColor":s.displacementMap=n.getTexture(t,a.ID);break;case"EmissiveColor":s.emissiveMap=n.getTexture(t,a.ID),s.emissiveMap!==void 0&&(s.emissiveMap.colorSpace=ce);break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=n.getTexture(t,a.ID);break;case"ReflectionColor":s.envMap=n.getTexture(t,a.ID),s.envMap!==void 0&&(s.envMap.mapping=Ir,s.envMap.colorSpace=ce);break;case"SpecularColor":s.specularMap=n.getTexture(t,a.ID),s.specularMap!==void 0&&(s.specularMap.colorSpace=ce);break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=n.getTexture(t,a.ID),s.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r);break}}),s}getTexture(e,t){return"LayeredTexture"in ie.Objects&&t in ie.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=xe.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in ie.Objects){const i=ie.Objects.Deformer;for(const s in i){const n=i[s],a=xe.get(parseInt(s));if(n.attrType==="Skin"){const r=this.parseSkeleton(a,i);r.ID=s,a.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),r.geometryID=a.parents[0].ID,e[s]=r}else if(n.attrType==="BlendShape"){const r={id:s};r.rawTargets=this.parseMorphTargets(a,i),r.id=s,a.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[s]=r}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const i=[];return e.children.forEach(function(s){const n=t[s.ID];if(n.attrType!=="Cluster")return;const a={ID:s.ID,indices:[],weights:[],transformLink:new le().fromArray(n.TransformLink.a)};"Indexes"in n&&(a.indices=n.Indexes.a,a.weights=n.Weights.a),i.push(a)}),{rawBones:i,bones:[]}}parseMorphTargets(e,t){const i=[];for(let s=0;s<e.children.length;s++){const n=e.children[s],a=t[n.ID],r={name:a.attrName,initialWeight:a.DeformPercent,id:a.id,fullWeights:a.FullWeights.a};if(a.attrType!=="BlendShapeChannel")return;r.geoID=xe.get(parseInt(n.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,i.push(r)}return i}parseScene(e,t,i){Je=new Yt;const s=this.parseModels(e.skeletons,t,i),n=ie.Objects.Model,a=this;s.forEach(function(A){const c=n[A.ID];a.setLookAtProperties(A,c),xe.get(A.ID)?.parents?.forEach(function(l){const h=s.get(l.ID);h!==void 0&&h.add(A)}),A.parent===null&&Je.add(A)}),this.bindSkeleton(e.skeletons,t,s),this.addGlobalSceneSettings(),Je.traverse(function(A){if(A.userData.transformData){A.parent&&(A.userData.transformData.parentMatrix=A.parent.matrix,A.userData.transformData.parentMatrixWorld=A.parent.matrixWorld);const c=Io(A.userData.transformData);A.applyMatrix4(c),A.updateWorldMatrix()}A.isSkinnedMesh&&(A.computeBoundingBox(),A.computeBoundingSphere(),A.boundingBox.expandByScalar(3),A.boundingSphere.radius*=3)});const r=new Ml().parse();Je.children.length===1&&Je.children[0].isGroup&&(Je.children[0].animations=r,Je=Je.children[0]),Je.animations=r}parseModels(e,t,i){const s=new Map,n=ie.Objects.Model;for(const a in n){const r=parseInt(a),A=n[a],c=xe.get(r);let l=this.buildSkeleton(c,e,r,A.attrName);if(!l){switch(A.attrType){case"Camera":l=this.createCamera(c);break;case"Light":l=this.createLight(c);break;case"Mesh":l=this.createMesh(c,t,i);break;case"NurbsCurve":l=this.createCurve(c,t);break;case"LimbNode":case"Root":l=new di;break;default:l=new Yt;break}l.name=A.attrName?Dt.sanitizeNodeName(A.attrName):"",l.userData.originalName=A.attrName,l.ID=r}this.getTransformData(l,A),s.set(r,l)}return s}buildSkeleton(e,t,i,s){let n=null;return e?.parents.forEach(function(a){for(const r in t){const A=t[r];A.rawBones.forEach(function(c,l){if(c.ID===a.ID){const h=n;n=new di,n.matrixWorld.copy(c.transformLink),n.name=s?Dt.sanitizeNodeName(s):"",n.userData.originalName=s,n.ID=i,A.bones[l]=n,h!==null&&n.add(h)}})}}),n}createCamera(e){let t,i;if(e.children.forEach(function(s){const n=ie.Objects.NodeAttribute[s.ID];n!==void 0&&(i=n)}),i===void 0)t=new It;else{let s=0;i.CameraProjectionType!==void 0&&i.CameraProjectionType.value===1&&(s=1);let n=1;i.NearPlane!==void 0&&(n=i.NearPlane.value/1e3);let a=1e3;i.FarPlane!==void 0&&(a=i.FarPlane.value/1e3);let r=window.innerWidth,A=window.innerHeight;i.AspectWidth!==void 0&&i.AspectHeight!==void 0&&(r=i.AspectWidth.value,A=i.AspectHeight.value);const c=r/A;let l=45;i.FieldOfView!==void 0&&(l=i.FieldOfView.value);const h=i.FocalLength?i.FocalLength.value:null;switch(s){case 0:t=new Ps(l,c,n,a),h!==null&&t.setFocalLength(h);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new It;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+s+"."),t=new It;break}}return t}createLight(e){let t,i;if(e.children.forEach(function(s){const n=ie.Objects.NodeAttribute[s.ID];n!==void 0&&(i=n)}),i===void 0)t=new It;else{let s;i.LightType===void 0?s=0:s=i.LightType.value;let n=16777215;i.Color!==void 0&&(n=We.toWorkingColorSpace(new Be().fromArray(i.Color.value),ce));let a=i.Intensity===void 0?1:i.Intensity.value/100;i.CastLightOnObject!==void 0&&i.CastLightOnObject.value===0&&(a=0);let r=0;i.FarAttenuationEnd!==void 0&&(i.EnableFarAttenuation!==void 0&&i.EnableFarAttenuation.value===0?r=0:r=i.FarAttenuationEnd.value);const A=1;switch(s){case 0:t=new Ai(n,a,r,A);break;case 1:t=new wn(n,a);break;case 2:let c=Math.PI/3;i.InnerAngle!==void 0&&(c=Ee.degToRad(i.InnerAngle.value));let l=0;i.OuterAngle!==void 0&&(l=Ee.degToRad(i.OuterAngle.value),l=Math.max(l,1)),t=new Bn(n,a,r,c,l,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a PointLight."),t=new Ai(n,a);break}i.CastShadows!==void 0&&i.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,i){let s,n=null,a=null;const r=[];if(e.children.forEach(function(A){t.has(A.ID)&&(n=t.get(A.ID)),i.has(A.ID)&&r.push(i.get(A.ID))}),r.length>1?a=r:r.length>0?a=r[0]:(a=new ms({name:xt.DEFAULT_MATERIAL_NAME,color:13421772}),r.push(a)),"color"in n.attributes&&r.forEach(function(A){A.vertexColors=!0}),n.groups.length>0){let A=!1;for(let c=0,l=n.groups.length;c<l;c++){const h=n.groups[c];(h.materialIndex<0||h.materialIndex>=r.length)&&(h.materialIndex=r.length,A=!0)}if(A){const c=new hi;r.push(c)}}return n.FBX_Deformer?(s=new xn(n,a),s.normalizeSkinWeights()):s=new O(n,a),s}createCurve(e,t){const i=e.children.reduce(function(n,a){return t.has(a.ID)&&(n=t.get(a.ID)),n},null),s=new St({name:xt.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new gt(i,s)}getTransformData(e,t){const i={};"InheritType"in t&&(i.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?i.eulerOrder=Fs(t.RotationOrder.value):i.eulerOrder=Fs(0),"Lcl_Translation"in t&&(i.translation=t.Lcl_Translation.value),"PreRotation"in t&&(i.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(i.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(i.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(i.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(i.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(i.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(i.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(i.rotationPivot=t.RotationPivot.value),e.userData.transformData=i}setLookAtProperties(e,t){"LookAtProperty"in t&&xe.get(e.ID).children.forEach(function(i){if(i.relationship==="LookAtProperty"){const s=ie.Objects.Model[i.ID];if("Lcl_Translation"in s){const n=s.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(n),Je.add(e.target)):e.lookAt(new N().fromArray(n))}}})}bindSkeleton(e,t,i){const s=this.parsePoseNodes();for(const n in e){const a=e[n];xe.get(parseInt(a.ID)).parents.forEach(function(r){if(t.has(r.ID)){const A=r.ID;xe.get(A).parents.forEach(function(c){i.has(c.ID)&&i.get(c.ID).bind(new Dn(a.bones),s[c.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in ie.Objects){const t=ie.Objects.Pose;for(const i in t)if(t[i].attrType==="BindPose"&&t[i].NbPoseNodes>0){const s=t[i].PoseNode;Array.isArray(s)?s.forEach(function(n){e[n.Node]=new le().fromArray(n.Matrix.a)}):e[s.Node]=new le().fromArray(s.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in ie){if("AmbientColor"in ie.GlobalSettings){const e=ie.GlobalSettings.AmbientColor.value,t=e[0],i=e[1],s=e[2];if(t!==0||i!==0||s!==0){const n=new Be().setRGB(t,i,s,ce);Je.add(new Er(n,1))}}"UnitScaleFactor"in ie.GlobalSettings&&(Je.userData.unitScaleFactor=ie.GlobalSettings.UnitScaleFactor.value)}}}class kl{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in ie.Objects){const i=ie.Objects.Geometry;for(const s in i){const n=xe.get(parseInt(s)),a=this.parseGeometry(n,i[s],e);t.set(parseInt(s),a)}}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,i){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,i);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,i){const s=i.skeletons,n=[],a=e.parents.map(function(h){return ie.Objects.Model[h.ID]});if(a.length===0)return;const r=e.children.reduce(function(h,d){return s[d.ID]!==void 0&&(h=s[d.ID]),h},null);e.children.forEach(function(h){i.morphTargets[h.ID]!==void 0&&n.push(i.morphTargets[h.ID])});const A=a[0],c={};"RotationOrder"in A&&(c.eulerOrder=Fs(A.RotationOrder.value)),"InheritType"in A&&(c.inheritType=parseInt(A.InheritType.value)),"GeometricTranslation"in A&&(c.translation=A.GeometricTranslation.value),"GeometricRotation"in A&&(c.rotation=A.GeometricRotation.value),"GeometricScaling"in A&&(c.scale=A.GeometricScaling.value);const l=Io(c);return this.genGeometry(t,r,n,l)}genGeometry(e,t,i,s){const n=new rt;e.attrName&&(n.name=e.attrName);const a=this.parseGeoNode(e,t),r=this.genBuffers(a),A=new Te(r.vertex,3);if(A.applyMatrix4(s),n.setAttribute("position",A),r.colors.length>0&&n.setAttribute("color",new Te(r.colors,3)),t&&(n.setAttribute("skinIndex",new Cr(r.weightsIndices,4)),n.setAttribute("skinWeight",new Te(r.vertexWeights,4)),n.FBX_Deformer=t),r.normal.length>0){const c=new Yn().getNormalMatrix(s),l=new Te(r.normal,3);l.applyNormalMatrix(c),n.setAttribute("normal",l)}if(r.uvs.forEach(function(c,l){const h=l===0?"uv":`uv${l}`;n.setAttribute(h,new Te(r.uvs[l],2))}),a.material&&a.material.mappingType!=="AllSame"){let c=r.materialIndex[0],l=0;if(r.materialIndex.forEach(function(h,d){h!==c&&(n.addGroup(l,d-l,c),c=h,l=d)}),n.groups.length>0){const h=n.groups[n.groups.length-1],d=h.start+h.count;d!==r.materialIndex.length&&n.addGroup(d,r.materialIndex.length-d,c)}n.groups.length===0&&n.addGroup(0,r.materialIndex.length,r.materialIndex[0])}return this.addMorphTargets(n,e,i,s),n}parseGeoNode(e,t){const i={};if(i.vertexPositions=e.Vertices!==void 0?e.Vertices.a:[],i.vertexIndices=e.PolygonVertexIndex!==void 0?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(i.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(i.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(i.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){i.uv=[];let s=0;for(;e.LayerElementUV[s];)e.LayerElementUV[s].UV&&i.uv.push(this.parseUVs(e.LayerElementUV[s])),s++}return i.weightTable={},t!==null&&(i.skeleton=t,t.rawBones.forEach(function(s,n){s.indices.forEach(function(a,r){i.weightTable[a]===void 0&&(i.weightTable[a]=[]),i.weightTable[a].push({id:n,weight:s.weights[r]})})})),i}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let i=0,s=0,n=!1,a=[],r=[],A=[],c=[],l=[],h=[];const d=this;return e.vertexIndices.forEach(function(p,f){let b,m=!1;p<0&&(p=p^-1,m=!0);let I=[],E=[];if(a.push(p*3,p*3+1,p*3+2),e.color){const C=ni(f,i,p,e.color);A.push(C[0],C[1],C[2])}if(e.skeleton){if(e.weightTable[p]!==void 0&&e.weightTable[p].forEach(function(C){E.push(C.weight),I.push(C.id)}),E.length>4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);const C=[0,0,0,0],Q=[0,0,0,0];E.forEach(function(w,x){let D=w,S=I[x];Q.forEach(function(F,Y,V){if(D>F){V[Y]=D,D=F;const K=C[Y];C[Y]=S,S=K}})}),I=C,E=Q}for(;E.length<4;)E.push(0),I.push(0);for(let C=0;C<4;++C)l.push(E[C]),h.push(I[C])}if(e.normal){const C=ni(f,i,p,e.normal);r.push(C[0],C[1],C[2])}e.material&&e.material.mappingType!=="AllSame"&&(b=ni(f,i,p,e.material)[0],b<0&&(d.negativeMaterialIndices=!0,b=0)),e.uv&&e.uv.forEach(function(C,Q){const w=ni(f,i,p,C);c[Q]===void 0&&(c[Q]=[]),c[Q].push(w[0]),c[Q].push(w[1])}),s++,m&&(d.genFace(t,e,a,b,r,A,c,l,h,s),i++,s=0,a=[],r=[],A=[],c=[],l=[],h=[])}),t}getNormalNewell(e){const t=new N(0,0,0);for(let i=0;i<e.length;i++){const s=e[i],n=e[(i+1)%e.length];t.x+=(s.y-n.y)*(s.z+n.z),t.y+=(s.z-n.z)*(s.x+n.x),t.z+=(s.x-n.x)*(s.y+n.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),i=(Math.abs(t.z)>.5?new N(0,1,0):new N(0,0,1)).cross(t).normalize(),s=t.clone().cross(i).normalize();return{normal:t,tangent:i,bitangent:s}}flattenVertex(e,t,i){return new _e(e.dot(t),e.dot(i))}genFace(e,t,i,s,n,a,r,A,c,l){let h;if(l>3){const d=[],p=t.baseVertexPositions||t.vertexPositions;for(let I=0;I<i.length;I+=3)d.push(new N(p[i[I]],p[i[I+1]],p[i[I+2]]));const{tangent:f,bitangent:b}=this.getNormalTangentAndBitangent(d),m=[];for(const I of d)m.push(this.flattenVertex(I,f,b));h=Br.triangulateShape(m,[])}else l===2?(console.warn("THREE.FBXLoader: Edge topology detected. This is currently not supported. The resulting mesh will not be correct."),h=[[0,1,2]]):h=[[0,1,2]];for(const[d,p,f]of h)e.vertex.push(t.vertexPositions[i[d*3]]),e.vertex.push(t.vertexPositions[i[d*3+1]]),e.vertex.push(t.vertexPositions[i[d*3+2]]),e.vertex.push(t.vertexPositions[i[p*3]]),e.vertex.push(t.vertexPositions[i[p*3+1]]),e.vertex.push(t.vertexPositions[i[p*3+2]]),e.vertex.push(t.vertexPositions[i[f*3]]),e.vertex.push(t.vertexPositions[i[f*3+1]]),e.vertex.push(t.vertexPositions[i[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[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[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(c[d*4]),e.weightsIndices.push(c[d*4+1]),e.weightsIndices.push(c[d*4+2]),e.weightsIndices.push(c[d*4+3]),e.weightsIndices.push(c[p*4]),e.weightsIndices.push(c[p*4+1]),e.weightsIndices.push(c[p*4+2]),e.weightsIndices.push(c[p*4+3]),e.weightsIndices.push(c[f*4]),e.weightsIndices.push(c[f*4+1]),e.weightsIndices.push(c[f*4+2]),e.weightsIndices.push(c[f*4+3])),t.color&&(e.colors.push(a[d*3]),e.colors.push(a[d*3+1]),e.colors.push(a[d*3+2]),e.colors.push(a[p*3]),e.colors.push(a[p*3+1]),e.colors.push(a[p*3+2]),e.colors.push(a[f*3]),e.colors.push(a[f*3+1]),e.colors.push(a[f*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(s),e.materialIndex.push(s),e.materialIndex.push(s)),t.normal&&(e.normal.push(n[d*3]),e.normal.push(n[d*3+1]),e.normal.push(n[d*3+2]),e.normal.push(n[p*3]),e.normal.push(n[p*3+1]),e.normal.push(n[p*3+2]),e.normal.push(n[f*3]),e.normal.push(n[f*3+1]),e.normal.push(n[f*3+2])),t.uv&&t.uv.forEach(function(b,m){e.uvs[m]===void 0&&(e.uvs[m]=[]),e.uvs[m].push(r[m][d*2]),e.uvs[m].push(r[m][d*2+1]),e.uvs[m].push(r[m][p*2]),e.uvs[m].push(r[m][p*2+1]),e.uvs[m].push(r[m][f*2]),e.uvs[m].push(r[m][f*2+1])})}addMorphTargets(e,t,i,s){if(i.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const n=this;i.forEach(function(a){a.rawTargets.forEach(function(r){const A=ie.Objects.Geometry[r.geoID];A!==void 0&&n.genMorphGeometry(e,t,A,s,r.name)})})}genMorphGeometry(e,t,i,s,n){const a=t.Vertices!==void 0?t.Vertices.a:[],r=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=i.Vertices!==void 0?i.Vertices.a:[],c=i.Indexes!==void 0?i.Indexes.a:[],l=e.attributes.position.count*3,h=new Float32Array(l);for(let b=0;b<c.length;b++){const m=c[b]*3;h[m]=A[b*3],h[m+1]=A[b*3+1],h[m+2]=A[b*3+2]}const d={vertexIndices:r,vertexPositions:h,baseVertexPositions:a},p=this.genBuffers(d),f=new Te(p.vertex,3);f.name=n||i.attrName,f.applyMatrix4(s),e.morphAttributes.position.push(f)}parseNormals(e){const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.Normals.a;let n=[];return i==="IndexToDirect"&&("NormalIndex"in e?n=e.NormalIndex.a:"NormalsIndex"in e&&(n=e.NormalsIndex.a)),{dataSize:3,buffer:s,indices:n,mappingType:t,referenceType:i}}parseUVs(e){const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.UV.a;let n=[];return i==="IndexToDirect"&&(n=e.UVIndex.a),{dataSize:2,buffer:s,indices:n,mappingType:t,referenceType:i}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,i=e.ReferenceInformationType,s=e.Colors.a;let n=[];i==="IndexToDirect"&&(n=e.ColorIndex.a);for(let a=0,r=new Be;a<s.length;a+=4)r.fromArray(s,a),We.toWorkingColorSpace(r,ce),r.toArray(s,a);return{dataSize:4,buffer:s,indices:n,mappingType:t,referenceType:i}}parseMaterialIndices(e){const t=e.MappingInformationType,i=e.ReferenceInformationType;if(t==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};const s=e.Materials.a,n=[];for(let a=0;a<s.length;++a)n.push(a);return{dataSize:1,buffer:s,indices:n,mappingType:t,referenceType:i}}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 rt;const i=t-1,s=e.KnotVector.a,n=[],a=e.Points.a;for(let l=0,h=a.length;l<h;l+=4)n.push(new Rt().fromArray(a,l));let r,A;if(e.Form==="Closed")n.push(n[0]);else if(e.Form==="Periodic"){r=i,A=s.length-1-r;for(let l=0;l<i;++l)n.push(n[l])}const c=new Dl(i,s,n,r,A).getPoints(n.length*12);return new rt().setFromPoints(c)}}class Ml{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const i in t){const s=t[i],n=this.addClip(s);e.push(n)}return e}parseClips(){if(ie.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=ie.Objects.AnimationCurveNode,t=new Map;for(const i in e){const s=e[i];if(s.attrName.match(/S|R|T|DeformPercent/)!==null){const n={id:s.id,attr:s.attrName,curves:{}};t.set(n.id,n)}}return t}parseAnimationCurves(e){const t=ie.Objects.AnimationCurve;for(const i in t){const s={id:t[i].id,times:t[i].KeyTime.a.map(Ul),values:t[i].KeyValueFloat.a},n=xe.get(s.id);if(n!==void 0){const a=n.parents[0].ID,r=n.parents[0].relationship;r.match(/X/)?e.get(a).curves.x=s:r.match(/Y/)?e.get(a).curves.y=s:r.match(/Z/)?e.get(a).curves.z=s:r.match(/DeformPercent/)&&e.has(a)&&(e.get(a).curves.morph=s)}}}parseAnimationLayers(e){const t=ie.Objects.AnimationLayer,i=new Map;for(const s in t){const n=[],a=xe.get(parseInt(s));a!==void 0&&(a.children.forEach(function(r,A){if(e.has(r.ID)){const c=e.get(r.ID);if(c.curves.x!==void 0||c.curves.y!==void 0||c.curves.z!==void 0){if(n[A]===void 0){const l=xe.get(r.ID).parents.filter(function(h){return h.relationship!==void 0})[0].ID;if(l!==void 0){const h=ie.Objects.Model[l.toString()];if(h===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",r);return}const d={modelName:h.attrName?Dt.sanitizeNodeName(h.attrName):"",ID:h.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};Je.traverse(function(p){p.ID===h.id&&(d.transform=p.matrix,p.userData.transformData&&(d.eulerOrder=p.userData.transformData.eulerOrder))}),d.transform||(d.transform=new le),"PreRotation"in h&&(d.preRotation=h.PreRotation.value),"PostRotation"in h&&(d.postRotation=h.PostRotation.value),n[A]=d}}n[A]&&(n[A][c.attr]=c)}else if(c.curves.morph!==void 0){if(n[A]===void 0){const l=xe.get(r.ID).parents.filter(function(m){return m.relationship!==void 0})[0].ID,h=xe.get(l).parents[0].ID,d=xe.get(h).parents[0].ID,p=xe.get(d).parents[0].ID,f=ie.Objects.Model[p],b={modelName:f.attrName?Dt.sanitizeNodeName(f.attrName):"",morphName:ie.Objects.Deformer[l].attrName};n[A]=b}n[A][c.attr]=c}}}),i.set(parseInt(s),n))}return i}parseAnimStacks(e){const t=ie.Objects.AnimationStack,i={};for(const s in t){const n=xe.get(parseInt(s)).children;n.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const a=e.get(n[0].ID);i[s]={name:t[s].attrName,layer:a}}return i}addClip(e){let t=[];const i=this;return e.layer.forEach(function(s){t=t.concat(i.generateTracks(s))}),new Rn(e.name,-1,t)}generateTracks(e){const t=[];let i=new N,s=new N;if(e.transform&&e.transform.decompose(i,new we,s),i=i.toArray(),s=s.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.T.curves,i,"position");n!==void 0&&t.push(n)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const n=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);n!==void 0&&t.push(n)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.S.curves,s,"scale");n!==void 0&&t.push(n)}if(e.DeformPercent!==void 0){const n=this.generateMorphTrack(e);n!==void 0&&t.push(n)}return t}generateVectorTrack(e,t,i,s){const n=this.getTimesForAllAxes(t),a=this.getKeyframeTrackValues(n,t,i);return new fi(e+"."+s,n,a)}generateRotationTrack(e,t,i,s,n){let a,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,n);a=d[0],r=d[1]}const A=Fs(0);i!==void 0&&(i=i.map(Ee.degToRad),i.push(A),i=new Ut().fromArray(i),i=new we().setFromEuler(i)),s!==void 0&&(s=s.map(Ee.degToRad),s.push(A),s=new Ut().fromArray(s),s=new we().setFromEuler(s).invert());const c=new we,l=new Ut,h=[];if(!(!r||!a)){for(let d=0;d<r.length;d+=3)l.set(r[d],r[d+1],r[d+2],n),c.setFromEuler(l),i!==void 0&&c.premultiply(i),s!==void 0&&c.multiply(s),d>2&&new we().fromArray(h,(d-3)/3*4).dot(c)<0&&c.set(-c.x,-c.y,-c.z,-c.w),c.toArray(h,d/3*4);return new bi(e+".quaternion",a,h)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,i=t.values.map(function(n){return n/100}),s=Je.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new mi(e.modelName+".morphTargetInfluences["+s+"]",t.times,i)}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(i,s){return i-s}),t.length>1){let i=1,s=t[0];for(let n=1;n<t.length;n++){const a=t[n];a!==s&&(t[i]=a,s=a,i++)}t=t.slice(0,i)}return t}getKeyframeTrackValues(e,t,i){const s=i,n=[];let a=-1,r=-1,A=-1;return e.forEach(function(c){if(t.x&&(a=t.x.times.indexOf(c)),t.y&&(r=t.y.times.indexOf(c)),t.z&&(A=t.z.times.indexOf(c)),a!==-1){const l=t.x.values[a];n.push(l),s[0]=l}else n.push(s[0]);if(r!==-1){const l=t.y.values[r];n.push(l),s[1]=l}else n.push(s[1]);if(A!==-1){const l=t.z.values[A];n.push(l),s[2]=l}else n.push(s[2])}),n}interpolateRotations(e,t,i,s){const n=[],a=[];n.push(e.times[0]),a.push(Ee.degToRad(e.values[0])),a.push(Ee.degToRad(t.values[0])),a.push(Ee.degToRad(i.values[0]));for(let r=1;r<e.values.length;r++){const A=[e.values[r-1],t.values[r-1],i.values[r-1]];if(isNaN(A[0])||isNaN(A[1])||isNaN(A[2]))continue;const c=A.map(Ee.degToRad),l=[e.values[r],t.values[r],i.values[r]];if(isNaN(l[0])||isNaN(l[1])||isNaN(l[2]))continue;const h=l.map(Ee.degToRad),d=[l[0]-A[0],l[1]-A[1],l[2]-A[2]],p=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){const f=Math.max(...p)/180,b=new Ut(...c,s),m=new Ut(...h,s),I=new we().setFromEuler(b),E=new we().setFromEuler(m);I.dot(E)&&E.set(-E.x,-E.y,-E.z,-E.w);const C=e.times[r-1],Q=e.times[r]-C,w=new we,x=new Ut;for(let D=0;D<1;D+=1/f)w.copy(I.clone().slerp(E.clone(),D)),n.push(C+D*Q),x.setFromQuaternion(w,s),a.push(x.x),a.push(x.y),a.push(x.z)}else n.push(e.times[r]),a.push(Ee.degToRad(e.values[r])),a.push(Ee.degToRad(t.values[r])),a.push(Ee.degToRad(i.values[r]))}return[n,a]}}class Fl{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 mo,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,i=e.split(/[\r\n]+/);return i.forEach(function(s,n){const a=s.match(/^[\s\t]*;/),r=s.match(/^[\s\t]*$/);if(a||r)return;const A=s.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),c=s.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=s.match("^\\t{"+(t.currentIndent-1)+"}}");A?t.parseNodeBegin(s,A):c?t.parseNodeProperty(s,c,i[++n]):l?t.popStack():s.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(s)}),this.allNodes}parseNodeBegin(e,t){const i=t[1].trim().replace(/^"/,"").replace(/"$/,""),s=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),n={name:i},a=this.parseNodeAttr(s),r=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(i,n):i in r?(i==="PoseNode"?r.PoseNode.push(n):r[i].id!==void 0&&(r[i]={},r[i][r[i].id]=r[i]),a.id!==""&&(r[i][a.id]=n)):typeof a.id=="number"?(r[i]={},r[i][a.id]=n):i!=="Properties70"&&(i==="PoseNode"?r[i]=[n]:r[i]=n),typeof a.id=="number"&&(n.id=a.id),a.name!==""&&(n.attrName=a.name),a.type!==""&&(n.attrType=a.type),this.pushStack(n)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let i="",s="";return e.length>1&&(i=e[1].replace(/^(\w+)::/,""),s=e[2]),{id:t,name:i,type:s}}parseNodeProperty(e,t,i){let s=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();s==="Content"&&n===","&&(n=i.replace(/"/g,"").replace(/,$/,"").trim());const a=this.getCurrentNode();if(a.name==="Properties70"){this.parseNodeSpecialProperty(e,s,n);return}if(s==="C"){const r=n.split(",").slice(1),A=parseInt(r[0]),c=parseInt(r[1]);let l=n.split(",").slice(3);l=l.map(function(h){return h.trim().replace(/^"/,"")}),s="connections",n=[A,c],Pl(n,l),a[s]===void 0&&(a[s]=[])}s==="Node"&&(a.id=n),s in a&&Array.isArray(a[s])?a[s].push(n):s!=="a"?a[s]=n:a.a=n,this.setCurrentProp(a,s),s==="a"&&n.slice(-1)!==","&&(a.a=fn(n))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=fn(t.a))}parseNodeSpecialProperty(e,t,i){const s=i.split('",').map(function(l){return l.trim().replace(/^\"/,"").replace(/\s/,"_")}),n=s[0],a=s[1],r=s[2],A=s[3];let c=s[4];switch(a){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":c=parseFloat(c);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":c=fn(c);break}this.getPrevNode()[n]={type:a,type2:r,flag:A,value:c},this.setCurrentProp(this.getPrevNode(),n)}}class _l{parse(e){const t=new fo(e);t.skip(23);const i=t.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);const s=new mo;for(;!this.endOfContent(t);){const n=this.parseNode(t,i);n!==null&&s.add(n.name,n)}return s}endOfContent(e){return e.size()%16===0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const i={},s=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const a=e.getUint8(),r=e.getString(a);if(s===0)return null;const A=[];for(let d=0;d<n;d++)A.push(this.parseProperty(e));const c=A.length>0?A[0]:"",l=A.length>1?A[1]:"",h=A.length>2?A[2]:"";for(i.singleProperty=n===1&&e.getOffset()===s;s>e.getOffset();){const d=this.parseNode(e,t);d!==null&&this.parseSubNode(r,i,d)}return i.propertyList=A,typeof c=="number"&&(i.id=c),l!==""&&(i.attrName=l),h!==""&&(i.attrType=h),r!==""&&(i.name=r),i}parseSubNode(e,t,i){if(i.singleProperty===!0){const s=i.propertyList[0];Array.isArray(s)?(t[i.name]=i,i.a=s):t[i.name]=s}else if(e==="Connections"&&i.name==="C"){const s=[];i.propertyList.forEach(function(n,a){a!==0&&s.push(n)}),t.connections===void 0&&(t.connections=[]),t.connections.push(s)}else if(i.name==="Properties70")Object.keys(i).forEach(function(s){t[s]=i[s]});else if(e==="Properties70"&&i.name==="P"){let s=i.propertyList[0],n=i.propertyList[1];const a=i.propertyList[2],r=i.propertyList[3];let A;s.indexOf("Lcl ")===0&&(s=s.replace("Lcl ","Lcl_")),n.indexOf("Lcl ")===0&&(n=n.replace("Lcl ","Lcl_")),n==="Color"||n==="ColorRGB"||n==="Vector"||n==="Vector3D"||n.indexOf("Lcl_")===0?A=[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:A=i.propertyList[4],t[s]={type:n,type2:a,flag:r,value:A}}else t[i.name]===void 0?typeof i.id=="number"?(t[i.name]={},t[i.name][i.id]=i):t[i.name]=i:i.name==="PoseNode"?(Array.isArray(t[i.name])||(t[i.name]=[t[i.name]]),t[i.name].push(i)):t[i.name][i.id]===void 0&&(t[i.name][i.id]=i)}parseProperty(e){const t=e.getString(1);let i;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 i=e.getUint32(),e.getArrayBuffer(i);case"S":return i=e.getUint32(),e.getString(i);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const s=e.getUint32(),n=e.getUint32(),a=e.getUint32();if(n===0)switch(t){case"b":case"c":return e.getBooleanArray(s);case"d":return e.getFloat64Array(s);case"f":return e.getFloat32Array(s);case"i":return e.getInt32Array(s);case"l":return e.getInt64Array(s)}const r=ys(new Uint8Array(e.getArrayBuffer(a))),A=new fo(r.buffer);switch(t){case"b":case"c":return A.getBooleanArray(s);case"d":return A.getFloat64Array(s);case"f":return A.getFloat32Array(s);case"i":return A.getInt32Array(s);case"l":return A.getInt64Array(s)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class fo{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 i=0;i<e;i++)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 i=0;i<e;i++)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 i=0;i<e;i++)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 i=0;i<e;i++)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 i=0;i<e;i++)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 i=new Uint8Array(this.dv.buffer,t,e);this.skip(e);const s=i.indexOf(0);return s>=0&&(i=new Uint8Array(this.dv.buffer,t,s)),this._textDecoder.decode(i)}}class mo{add(e,t){this[e]=t}}function Ll(o){const e="Kaydara FBX Binary \0";return o.byteLength>=e.length&&e===Eo(o,0,e.length)}function Nl(o){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function i(s){const n=o[s-1];return o=o.slice(t+s),t++,n}for(let s=0;s<e.length;++s)if(i(1)===e[s])return!1;return!0}function bo(o){const e=/FBXVersion: (\d+)/,t=o.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function Ul(o){return o/46186158e3}const Gl=[];function ni(o,e,t,i){let s;switch(i.mappingType){case"ByPolygonVertex":s=o;break;case"ByPolygon":s=e;break;case"ByVertice":s=t;break;case"AllSame":s=i.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+i.mappingType)}i.referenceType==="IndexToDirect"&&(s=i.indices[s]);const n=s*i.dataSize,a=n+i.dataSize;return Ol(Gl,i.buffer,n,a)}const un=new Ut,As=new N;function Io(o){const e=new le,t=new le,i=new le,s=new le,n=new le,a=new le,r=new le,A=new le,c=new le,l=new le,h=new le,d=new le,p=o.inheritType?o.inheritType:0;o.translation&&e.setPosition(As.fromArray(o.translation));const f=Fs(0);if(o.preRotation){const V=o.preRotation.map(Ee.degToRad);V.push(f),t.makeRotationFromEuler(un.fromArray(V))}if(o.rotation){const V=o.rotation.map(Ee.degToRad);V.push(o.eulerOrder||f),i.makeRotationFromEuler(un.fromArray(V))}if(o.postRotation){const V=o.postRotation.map(Ee.degToRad);V.push(f),s.makeRotationFromEuler(un.fromArray(V)),s.invert()}o.scale&&n.scale(As.fromArray(o.scale)),o.scalingOffset&&r.setPosition(As.fromArray(o.scalingOffset)),o.scalingPivot&&a.setPosition(As.fromArray(o.scalingPivot)),o.rotationOffset&&A.setPosition(As.fromArray(o.rotationOffset)),o.rotationPivot&&c.setPosition(As.fromArray(o.rotationPivot)),o.parentMatrixWorld&&(h.copy(o.parentMatrix),l.copy(o.parentMatrixWorld));const b=t.clone().multiply(i).multiply(s),m=new le;m.extractRotation(l);const I=new le;I.copyPosition(l);const E=I.clone().invert().multiply(l),C=m.clone().invert().multiply(E),Q=n,w=new le;if(p===0)w.copy(m).multiply(b).multiply(C).multiply(Q);else if(p===1)w.copy(m).multiply(C).multiply(b).multiply(Q);else{const V=new le().scale(new N().setFromMatrixScale(h)).clone().invert(),K=C.clone().multiply(V);w.copy(m).multiply(b).multiply(K).multiply(Q)}const x=c.clone().invert(),D=a.clone().invert();let S=e.clone().multiply(A).multiply(c).multiply(t).multiply(i).multiply(s).multiply(x).multiply(r).multiply(a).multiply(n).multiply(D);const F=new le().copyPosition(S),Y=l.clone().multiply(F);return d.copyPosition(Y),S=d.clone().multiply(w),S.premultiply(l.invert()),S}function Fs(o){o=o||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return o===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[o]}function fn(o){return o.split(",").map(function(e){return parseFloat(e)})}function Eo(o,e,t){return e===void 0&&(e=0),t===void 0&&(t=o.byteLength),new TextDecoder().decode(new Uint8Array(o,e,t))}function Pl(o,e){for(let t=0,i=o.length,s=e.length;t<s;t++,i++)o[i]=e[t]}function Ol(o,e,t,i){for(let s=t,n=0;s<i;s++,n++)o[n]=e[s];return o}class Hl extends xt{constructor(e){super(e)}load(e,t,i,s){const n=this,a=this.path===""?qt.extractUrlBase(e):this.path,r=new ht(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(A){try{t(n.parse(A,a))}catch(c){s?s(c):console.error(c),n.manager.itemError(e)}},i,s)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const i=e.split(`
|
|
460
|
-
|
|
459
|
+
`};class pa extends Xa{constructor(e){super({type:"LineMaterial",uniforms:$a.clone(Ct.line.uniforms),vertexShader:Ct.line.vertexShader,fragmentShader:Ct.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 ua=new Rt,mo=new F,bo=new F,Pe=new Rt,Ge=new Rt,yt=new Rt,fa=new F,ma=new re,Oe=new Dr,Io=new F,ns=new Wt,os=new ys,Qt=new Rt;let vt,ei;function Eo(o,e,t){return Qt.set(0,0,-e,1).applyMatrix4(o.projectionMatrix),Qt.multiplyScalar(1/Qt.w),Qt.x=ei/t.width,Qt.y=ei/t.height,Qt.applyMatrix4(o.projectionMatrixInverse),Qt.multiplyScalar(1/Qt.w),Math.abs(Math.max(Qt.x,Qt.y))}function vl(o,e){const t=o.matrixWorld,s=o.geometry,i=s.attributes.instanceStart,a=s.attributes.instanceEnd,n=Math.min(s.instanceCount,i.count);for(let r=0,A=n;r<A;r++){Oe.start.fromBufferAttribute(i,r),Oe.end.fromBufferAttribute(a,r),Oe.applyMatrix4(t);const c=new F,l=new F;vt.distanceSqToSegment(Oe.start,Oe.end,l,c),l.distanceTo(c)<ei*.5&&e.push({point:l,pointOnLine:c,distance:vt.origin.distanceTo(l),object:o,face:null,faceIndex:r,uv:null,uv1:null})}}function xl(o,e,t){const s=e.projectionMatrix,i=o.material.resolution,a=o.matrixWorld,n=o.geometry,r=n.attributes.instanceStart,A=n.attributes.instanceEnd,c=Math.min(n.instanceCount,r.count),l=-e.near;vt.at(1,yt),yt.w=1,yt.applyMatrix4(e.matrixWorldInverse),yt.applyMatrix4(s),yt.multiplyScalar(1/yt.w),yt.x*=i.x/2,yt.y*=i.y/2,yt.z=0,fa.copy(yt),ma.multiplyMatrices(e.matrixWorldInverse,a);for(let h=0,d=c;h<d;h++){if(Pe.fromBufferAttribute(r,h),Ge.fromBufferAttribute(A,h),Pe.w=1,Ge.w=1,Pe.applyMatrix4(ma),Ge.applyMatrix4(ma),Pe.z>l&&Ge.z>l)continue;if(Pe.z>l){const I=Pe.z-Ge.z,C=(Pe.z-l)/I;Pe.lerp(Ge,C)}else if(Ge.z>l){const I=Ge.z-Pe.z,C=(Ge.z-l)/I;Ge.lerp(Pe,C)}Pe.applyMatrix4(s),Ge.applyMatrix4(s),Pe.multiplyScalar(1/Pe.w),Ge.multiplyScalar(1/Ge.w),Pe.x*=i.x/2,Pe.y*=i.y/2,Ge.x*=i.x/2,Ge.y*=i.y/2,Oe.start.copy(Pe),Oe.start.z=0,Oe.end.copy(Ge),Oe.end.z=0;const p=Oe.closestPointToPointParameter(fa,!0);Oe.at(p,Io);const f=be.lerp(Pe.z,Ge.z,p),b=f>=-1&&f<=1,u=fa.distanceTo(Io)<ei*.5;if(b&&u){Oe.start.fromBufferAttribute(r,h),Oe.end.fromBufferAttribute(A,h),Oe.start.applyMatrix4(a),Oe.end.applyMatrix4(a);const I=new F,C=new F;vt.distanceSqToSegment(Oe.start,Oe.end,C,I),t.push({point:C,pointOnLine:I,distance:vt.origin.distanceTo(C),object:o,face:null,faceIndex:h,uv:null,uv1:null})}}}class Sl extends O{constructor(e=new fo,t=new pa({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,i=new Float32Array(2*t.count);for(let n=0,r=0,A=t.count;n<A;n++,r+=2)mo.fromBufferAttribute(t,n),bo.fromBufferAttribute(s,n),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+mo.distanceTo(bo);const a=new Rs(i,2,1);return e.setAttribute("instanceDistanceStart",new Jt(a,1,0)),e.setAttribute("instanceDistanceEnd",new Jt(a,1,1)),this}raycast(e,t){const s=this.material.worldUnits,i=e.camera;i===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const a=e.params.Line2!==void 0&&e.params.Line2.threshold||0;vt=e.ray;const n=this.matrixWorld,r=this.geometry,A=this.material;ei=A.linewidth+a,r.boundingSphere===null&&r.computeBoundingSphere(),os.copy(r.boundingSphere).applyMatrix4(n);let c;if(s)c=ei*.5;else{const h=Math.max(i.near,os.distanceToPoint(vt.origin));c=Eo(i,h,A.resolution)}if(os.radius+=c,vt.intersectsSphere(os)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),ns.copy(r.boundingBox).applyMatrix4(n);let l;if(s)l=ei*.5;else{const h=Math.max(i.near,ns.distanceToPoint(vt.origin));l=Eo(i,h,A.resolution)}ns.expandByScalar(l),vt.intersectsBox(ns)!==!1&&(s?vl(this,t):xl(this,i,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(ua),this.material.uniforms.resolution.value.set(ua.z,ua.w))}}class Co extends fo{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,s=new Float32Array(2*t);for(let i=0;i<t;i+=3)s[2*i]=e[i],s[2*i+1]=e[i+1],s[2*i+2]=e[i+2],s[2*i+3]=e[i+3],s[2*i+4]=e[i+4],s[2*i+5]=e[i+5];return super.setPositions(s),this}setColors(e){const t=e.length-3,s=new Float32Array(2*t);for(let i=0;i<t;i+=3)s[2*i]=e[i],s[2*i+1]=e[i+1],s[2*i+2]=e[i+2],s[2*i+3]=e[i+3],s[2*i+4]=e[i+4],s[2*i+5]=e[i+5];return super.setColors(s),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Dl extends Sl{constructor(e=new Co,t=new pa({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}const ba=new re;class ls{constructor(e){e=e||{},this.vertices={near:[new F,new F,new F,new F],far:[new F,new F,new F,new F]},e.projectionMatrix!==void 0&&this.setFromProjectionMatrix(e.projectionMatrix,e.maxFar||1e4)}setFromProjectionMatrix(e,t){const s=e.elements[11]===0;return ba.copy(e).invert(),this.vertices.near[0].set(1,1,-1),this.vertices.near[1].set(1,-1,-1),this.vertices.near[2].set(-1,-1,-1),this.vertices.near[3].set(-1,1,-1),this.vertices.near.forEach(function(i){i.applyMatrix4(ba)}),this.vertices.far[0].set(1,1,1),this.vertices.far[1].set(1,-1,1),this.vertices.far[2].set(-1,-1,1),this.vertices.far[3].set(-1,1,1),this.vertices.far.forEach(function(i){i.applyMatrix4(ba);const a=Math.abs(i.z);s?i.z*=Math.min(t/a,1):i.multiplyScalar(Math.min(t/a,1))}),this.vertices}split(e,t){for(;e.length>t.length;)t.push(new ls);t.length=e.length;for(let s=0;s<e.length;s++){const i=t[s];if(s===0)for(let a=0;a<4;a++)i.vertices.near[a].copy(this.vertices.near[a]);else for(let a=0;a<4;a++)i.vertices.near[a].lerpVectors(this.vertices.near[a],this.vertices.far[a],e[s-1]);if(s===e.length-1)for(let a=0;a<4;a++)i.vertices.far[a].copy(this.vertices.far[a]);else for(let a=0;a<4;a++)i.vertices.far[a].lerpVectors(this.vertices.near[a],this.vertices.far[a],e[s])}}toSpace(e,t){for(let s=0;s<4;s++)t.vertices.near[s].copy(this.vertices.near[s]).applyMatrix4(e),t.vertices.far[s].copy(this.vertices.far[s]).applyMatrix4(e)}}const Bo={lights_fragment_begin:`
|
|
460
|
+
vec3 geometryPosition = - vViewPosition;
|
|
461
|
+
vec3 geometryNormal = normal;
|
|
462
|
+
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
|
|
463
|
+
|
|
464
|
+
vec3 geometryClearcoatNormal = vec3( 0.0 );
|
|
465
|
+
|
|
466
|
+
#ifdef USE_CLEARCOAT
|
|
467
|
+
|
|
468
|
+
geometryClearcoatNormal = clearcoatNormal;
|
|
469
|
+
|
|
470
|
+
#endif
|
|
471
|
+
|
|
472
|
+
#ifdef USE_IRIDESCENCE
|
|
473
|
+
float dotNVi = saturate( dot( normal, geometryViewDir ) );
|
|
474
|
+
if ( material.iridescenceThickness == 0.0 ) {
|
|
475
|
+
material.iridescence = 0.0;
|
|
476
|
+
} else {
|
|
477
|
+
material.iridescence = saturate( material.iridescence );
|
|
478
|
+
}
|
|
479
|
+
if ( material.iridescence > 0.0 ) {
|
|
480
|
+
material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
|
|
481
|
+
// Iridescence F0 approximation
|
|
482
|
+
material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
|
|
483
|
+
}
|
|
484
|
+
#endif
|
|
485
|
+
|
|
486
|
+
IncidentLight directLight;
|
|
487
|
+
|
|
488
|
+
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
|
|
489
|
+
|
|
490
|
+
PointLight pointLight;
|
|
491
|
+
#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
|
|
492
|
+
PointLightShadow pointLightShadow;
|
|
493
|
+
#endif
|
|
494
|
+
|
|
495
|
+
#pragma unroll_loop_start
|
|
496
|
+
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
|
|
497
|
+
|
|
498
|
+
pointLight = pointLights[ i ];
|
|
499
|
+
|
|
500
|
+
getPointLightInfo( pointLight, geometryPosition, directLight );
|
|
501
|
+
|
|
502
|
+
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
|
|
503
|
+
pointLightShadow = pointLightShadows[ i ];
|
|
504
|
+
directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
|
|
505
|
+
#endif
|
|
506
|
+
|
|
507
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
508
|
+
|
|
509
|
+
}
|
|
510
|
+
#pragma unroll_loop_end
|
|
511
|
+
|
|
512
|
+
#endif
|
|
513
|
+
|
|
514
|
+
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
|
|
515
|
+
|
|
516
|
+
SpotLight spotLight;
|
|
517
|
+
vec4 spotColor;
|
|
518
|
+
vec3 spotLightCoord;
|
|
519
|
+
bool inSpotLightMap;
|
|
520
|
+
|
|
521
|
+
#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
|
|
522
|
+
SpotLightShadow spotLightShadow;
|
|
523
|
+
#endif
|
|
524
|
+
|
|
525
|
+
#pragma unroll_loop_start
|
|
526
|
+
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
|
|
527
|
+
|
|
528
|
+
spotLight = spotLights[ i ];
|
|
529
|
+
|
|
530
|
+
getSpotLightInfo( spotLight, geometryPosition, directLight );
|
|
531
|
+
|
|
532
|
+
// spot lights are ordered [shadows with maps, shadows without maps, maps without shadows, none]
|
|
533
|
+
#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
|
|
534
|
+
#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
|
|
535
|
+
#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
|
536
|
+
#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
|
|
537
|
+
#else
|
|
538
|
+
#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
|
|
539
|
+
#endif
|
|
540
|
+
#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
|
|
541
|
+
spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
|
|
542
|
+
inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
|
|
543
|
+
spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
|
|
544
|
+
directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
|
|
545
|
+
#endif
|
|
546
|
+
#undef SPOT_LIGHT_MAP_INDEX
|
|
547
|
+
|
|
548
|
+
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
|
549
|
+
spotLightShadow = spotLightShadows[ i ];
|
|
550
|
+
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
|
|
551
|
+
|
|
552
|
+
#endif
|
|
553
|
+
|
|
554
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
555
|
+
|
|
556
|
+
}
|
|
557
|
+
#pragma unroll_loop_end
|
|
558
|
+
|
|
559
|
+
#endif
|
|
560
|
+
|
|
561
|
+
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && defined( USE_CSM ) && defined( CSM_CASCADES )
|
|
562
|
+
|
|
563
|
+
DirectionalLight directionalLight;
|
|
564
|
+
float linearDepth = (vViewPosition.z) / (shadowFar - cameraNear);
|
|
565
|
+
#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
|
|
566
|
+
DirectionalLightShadow directionalLightShadow;
|
|
567
|
+
#endif
|
|
568
|
+
|
|
569
|
+
#if defined( USE_SHADOWMAP ) && defined( CSM_FADE )
|
|
570
|
+
vec2 cascade;
|
|
571
|
+
float cascadeCenter;
|
|
572
|
+
float closestEdge;
|
|
573
|
+
float margin;
|
|
574
|
+
float csmx;
|
|
575
|
+
float csmy;
|
|
576
|
+
|
|
577
|
+
#pragma unroll_loop_start
|
|
578
|
+
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
|
|
579
|
+
|
|
580
|
+
directionalLight = directionalLights[ i ];
|
|
581
|
+
getDirectionalLightInfo( directionalLight, directLight );
|
|
582
|
+
|
|
583
|
+
#if ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
|
|
584
|
+
// NOTE: Depth gets larger away from the camera.
|
|
585
|
+
// cascade.x is closer, cascade.y is further
|
|
586
|
+
cascade = CSM_cascades[ i ];
|
|
587
|
+
cascadeCenter = ( cascade.x + cascade.y ) / 2.0;
|
|
588
|
+
closestEdge = linearDepth < cascadeCenter ? cascade.x : cascade.y;
|
|
589
|
+
margin = 0.25 * pow( closestEdge, 2.0 );
|
|
590
|
+
csmx = cascade.x - margin / 2.0;
|
|
591
|
+
csmy = cascade.y + margin / 2.0;
|
|
592
|
+
if( linearDepth >= csmx && ( linearDepth < csmy || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 ) ) {
|
|
593
|
+
|
|
594
|
+
float dist = min( linearDepth - csmx, csmy - linearDepth );
|
|
595
|
+
float ratio = clamp( dist / margin, 0.0, 1.0 );
|
|
596
|
+
|
|
597
|
+
vec3 prevColor = directLight.color;
|
|
598
|
+
directionalLightShadow = directionalLightShadows[ i ];
|
|
599
|
+
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
|
600
|
+
|
|
601
|
+
bool shouldFadeLastCascade = UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth > cascadeCenter;
|
|
602
|
+
directLight.color = mix( prevColor, directLight.color, shouldFadeLastCascade ? ratio : 1.0 );
|
|
603
|
+
|
|
604
|
+
ReflectedLight prevLight = reflectedLight;
|
|
605
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
606
|
+
|
|
607
|
+
bool shouldBlend = UNROLLED_LOOP_INDEX != CSM_CASCADES - 1 || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth < cascadeCenter;
|
|
608
|
+
float blendRatio = shouldBlend ? ratio : 1.0;
|
|
609
|
+
|
|
610
|
+
reflectedLight.directDiffuse = mix( prevLight.directDiffuse, reflectedLight.directDiffuse, blendRatio );
|
|
611
|
+
reflectedLight.directSpecular = mix( prevLight.directSpecular, reflectedLight.directSpecular, blendRatio );
|
|
612
|
+
reflectedLight.indirectDiffuse = mix( prevLight.indirectDiffuse, reflectedLight.indirectDiffuse, blendRatio );
|
|
613
|
+
reflectedLight.indirectSpecular = mix( prevLight.indirectSpecular, reflectedLight.indirectSpecular, blendRatio );
|
|
614
|
+
|
|
615
|
+
}
|
|
616
|
+
#endif
|
|
617
|
+
|
|
618
|
+
}
|
|
619
|
+
#pragma unroll_loop_end
|
|
620
|
+
#elif defined (USE_SHADOWMAP)
|
|
621
|
+
|
|
622
|
+
#pragma unroll_loop_start
|
|
623
|
+
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
|
|
624
|
+
|
|
625
|
+
directionalLight = directionalLights[ i ];
|
|
626
|
+
getDirectionalLightInfo( directionalLight, directLight );
|
|
627
|
+
|
|
628
|
+
#if ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
|
|
629
|
+
|
|
630
|
+
directionalLightShadow = directionalLightShadows[ i ];
|
|
631
|
+
if(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y) directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
|
632
|
+
|
|
633
|
+
if(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
634
|
+
|
|
635
|
+
#endif
|
|
636
|
+
|
|
637
|
+
}
|
|
638
|
+
#pragma unroll_loop_end
|
|
639
|
+
|
|
640
|
+
#elif ( NUM_DIR_LIGHT_SHADOWS > 0 )
|
|
641
|
+
// note: no loop here - all CSM lights are in fact one light only
|
|
642
|
+
getDirectionalLightInfo( directionalLights[0], directLight );
|
|
643
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
644
|
+
|
|
645
|
+
#endif
|
|
646
|
+
|
|
647
|
+
#if ( NUM_DIR_LIGHTS > NUM_DIR_LIGHT_SHADOWS)
|
|
648
|
+
// compute the lights not casting shadows (if any)
|
|
649
|
+
|
|
650
|
+
#pragma unroll_loop_start
|
|
651
|
+
for ( int i = NUM_DIR_LIGHT_SHADOWS; i < NUM_DIR_LIGHTS; i ++ ) {
|
|
652
|
+
|
|
653
|
+
directionalLight = directionalLights[ i ];
|
|
654
|
+
|
|
655
|
+
getDirectionalLightInfo( directionalLight, directLight );
|
|
656
|
+
|
|
657
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
658
|
+
|
|
659
|
+
}
|
|
660
|
+
#pragma unroll_loop_end
|
|
661
|
+
|
|
662
|
+
#endif
|
|
663
|
+
|
|
664
|
+
#endif
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && !defined( USE_CSM ) && !defined( CSM_CASCADES )
|
|
668
|
+
|
|
669
|
+
DirectionalLight directionalLight;
|
|
670
|
+
#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
|
|
671
|
+
DirectionalLightShadow directionalLightShadow;
|
|
672
|
+
#endif
|
|
673
|
+
|
|
674
|
+
#pragma unroll_loop_start
|
|
675
|
+
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
|
|
676
|
+
|
|
677
|
+
directionalLight = directionalLights[ i ];
|
|
678
|
+
|
|
679
|
+
getDirectionalLightInfo( directionalLight, directLight );
|
|
680
|
+
|
|
681
|
+
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
|
|
682
|
+
directionalLightShadow = directionalLightShadows[ i ];
|
|
683
|
+
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
|
684
|
+
#endif
|
|
685
|
+
|
|
686
|
+
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
687
|
+
|
|
688
|
+
}
|
|
689
|
+
#pragma unroll_loop_end
|
|
690
|
+
|
|
691
|
+
#endif
|
|
692
|
+
|
|
693
|
+
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
|
|
694
|
+
|
|
695
|
+
RectAreaLight rectAreaLight;
|
|
696
|
+
|
|
697
|
+
#pragma unroll_loop_start
|
|
698
|
+
for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
|
|
699
|
+
|
|
700
|
+
rectAreaLight = rectAreaLights[ i ];
|
|
701
|
+
RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
702
|
+
|
|
703
|
+
}
|
|
704
|
+
#pragma unroll_loop_end
|
|
705
|
+
|
|
706
|
+
#endif
|
|
707
|
+
|
|
708
|
+
#if defined( RE_IndirectDiffuse )
|
|
709
|
+
|
|
710
|
+
vec3 iblIrradiance = vec3( 0.0 );
|
|
711
|
+
|
|
712
|
+
vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
|
|
713
|
+
|
|
714
|
+
#if defined( USE_LIGHT_PROBES )
|
|
715
|
+
|
|
716
|
+
irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
|
|
717
|
+
|
|
718
|
+
#endif
|
|
719
|
+
|
|
720
|
+
#if ( NUM_HEMI_LIGHTS > 0 )
|
|
721
|
+
|
|
722
|
+
#pragma unroll_loop_start
|
|
723
|
+
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
|
|
724
|
+
|
|
725
|
+
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
|
|
726
|
+
|
|
727
|
+
}
|
|
728
|
+
#pragma unroll_loop_end
|
|
729
|
+
|
|
730
|
+
#endif
|
|
731
|
+
|
|
732
|
+
#endif
|
|
733
|
+
|
|
734
|
+
#if defined( RE_IndirectSpecular )
|
|
735
|
+
|
|
736
|
+
vec3 radiance = vec3( 0.0 );
|
|
737
|
+
vec3 clearcoatRadiance = vec3( 0.0 );
|
|
738
|
+
|
|
739
|
+
#endif
|
|
740
|
+
`,lights_pars_begin:`
|
|
741
|
+
#if defined( USE_CSM ) && defined( CSM_CASCADES )
|
|
742
|
+
uniform vec2 CSM_cascades[CSM_CASCADES];
|
|
743
|
+
uniform float cameraNear;
|
|
744
|
+
uniform float shadowFar;
|
|
745
|
+
#endif
|
|
746
|
+
`+Ms.lights_pars_begin},wo=new re,Ia=new ls,kt=new F,ki=new Wt,Ea=[],Ca=[],Ba=new re,yo=new re,Tl=new F(0,1,0);class Rl{constructor(e){this.camera=e.camera,this.parent=e.parent,this.cascades=e.cascades||3,this.maxFar=e.maxFar||1e5,this.mode=e.mode||"practical",this.shadowMapSize=e.shadowMapSize||2048,this.shadowBias=e.shadowBias||1e-6,this.lightDirection=e.lightDirection||new F(1,-1,1).normalize(),this.lightIntensity=e.lightIntensity||3,this.lightNear=e.lightNear||1,this.lightFar=e.lightFar||2e3,this.lightMargin=e.lightMargin||200,this.customSplitsCallback=e.customSplitsCallback,this.fade=!1,this.mainFrustum=new ls,this.frustums=[],this.breaks=[],this.lights=[],this.shaders=new Map,this.createLights(),this.updateFrustums(),this.injectInclude()}createLights(){for(let e=0;e<this.cascades;e++){const t=new ps(16777215,this.lightIntensity);t.castShadow=!0,t.shadow.mapSize.width=this.shadowMapSize,t.shadow.mapSize.height=this.shadowMapSize,t.shadow.camera.near=this.lightNear,t.shadow.camera.far=this.lightFar,t.shadow.bias=this.shadowBias,this.parent.add(t),this.parent.add(t.target),this.lights.push(t)}}initCascades(){const e=this.camera;e.updateProjectionMatrix(),this.mainFrustum.setFromProjectionMatrix(e.projectionMatrix,this.maxFar),this.mainFrustum.split(this.breaks,this.frustums)}updateShadowBounds(){const e=this.frustums;for(let t=0;t<e.length;t++){const s=this.lights[t].shadow.camera,i=this.frustums[t],a=i.vertices.near,n=i.vertices.far,r=n[0];let A;r.distanceTo(n[2])>r.distanceTo(a[2])?A=n[2]:A=a[2];let c=r.distanceTo(A);if(this.fade){const l=this.camera,h=Math.max(l.far,this.maxFar),d=i.vertices.far[0].z/(h-l.near),p=.25*Math.pow(d,2)*(h-l.near);c+=p}s.left=-c/2,s.right=c/2,s.top=c/2,s.bottom=-c/2,s.updateProjectionMatrix()}}getBreaks(){const e=this.camera,t=Math.min(e.far,this.maxFar);switch(this.breaks.length=0,this.mode){case"uniform":s(this.cascades,e.near,t,this.breaks);break;case"logarithmic":i(this.cascades,e.near,t,this.breaks);break;case"practical":a(this.cascades,e.near,t,.5,this.breaks);break;case"custom":this.customSplitsCallback===void 0&&console.error("CSM: Custom split scheme callback not defined."),this.customSplitsCallback(this.cascades,e.near,t,this.breaks);break}function s(n,r,A,c){for(let l=1;l<n;l++)c.push((r+(A-r)*l/n)/A);c.push(1)}function i(n,r,A,c){for(let l=1;l<n;l++)c.push(r*(A/r)**(l/n)/A);c.push(1)}function a(n,r,A,c,l){Ea.length=0,Ca.length=0,i(n,r,A,Ca),s(n,r,A,Ea);for(let h=1;h<n;h++)l.push(be.lerp(Ea[h-1],Ca[h-1],c));l.push(1)}}update(){const e=this.camera,t=this.frustums;Ba.lookAt(new F,this.lightDirection,Tl),yo.copy(Ba).invert();for(let s=0;s<t.length;s++){const i=this.lights[s],a=i.shadow.camera,n=(a.right-a.left)/this.shadowMapSize,r=(a.top-a.bottom)/this.shadowMapSize;wo.multiplyMatrices(yo,e.matrixWorld),t[s].toSpace(wo,Ia);const A=Ia.vertices.near,c=Ia.vertices.far;ki.makeEmpty();for(let l=0;l<4;l++)ki.expandByPoint(A[l]),ki.expandByPoint(c[l]);ki.getCenter(kt),kt.z=ki.max.z+this.lightMargin,kt.x=Math.floor(kt.x/n)*n,kt.y=Math.floor(kt.y/r)*r,kt.applyMatrix4(Ba),i.position.copy(kt),i.target.position.copy(kt),i.target.position.x+=this.lightDirection.x,i.target.position.y+=this.lightDirection.y,i.target.position.z+=this.lightDirection.z}}injectInclude(){Ms.lights_fragment_begin=Bo.lights_fragment_begin,Ms.lights_pars_begin=Bo.lights_pars_begin}setupMaterial(e){e.defines=e.defines||{},e.defines.USE_CSM=1,e.defines.CSM_CASCADES=this.cascades,this.fade&&(e.defines.CSM_FADE="");const t=[],s=this,i=this.shaders;e.onBeforeCompile=function(a){const n=Math.min(s.camera.far,s.maxFar);s.getExtendedBreaks(t),a.uniforms.CSM_cascades={value:t},a.uniforms.cameraNear={value:s.camera.near},a.uniforms.shadowFar={value:n},i.set(e,a)},i.set(e,null)}updateUniforms(){const e=Math.min(this.camera.far,this.maxFar);this.shaders.forEach(function(t,s){if(t!==null){const i=t.uniforms;this.getExtendedBreaks(i.CSM_cascades.value),i.cameraNear.value=this.camera.near,i.shadowFar.value=e}!this.fade&&"CSM_FADE"in s.defines?(delete s.defines.CSM_FADE,s.needsUpdate=!0):this.fade&&!("CSM_FADE"in s.defines)&&(s.defines.CSM_FADE="",s.needsUpdate=!0)},this)}getExtendedBreaks(e){for(;e.length<this.breaks.length;)e.push(new Re);e.length=this.breaks.length;for(let t=0;t<this.cascades;t++){const s=this.breaks[t],i=this.breaks[t-1]||0;e[t].x=i,e[t].y=s}}updateFrustums(){this.getBreaks(),this.initCascades(),this.updateShadowBounds(),this.updateUniforms()}remove(){for(let e=0;e<this.lights.length;e++)this.parent.remove(this.lights[e].target),this.parent.remove(this.lights[e])}dispose(){const e=this.shaders;e.forEach(function(t,s){delete s.onBeforeCompile,delete s.defines.USE_CSM,delete s.defines.CSM_CASCADES,delete s.defines.CSM_FADE,t!==null&&(delete t.uniforms.CSM_cascades,delete t.uniforms.cameraNear,delete t.uniforms.shadowFar),s.needsUpdate=!0}),e.clear()}}class Ml extends Tt{constructor(e){super(),this.csm=e,this.displayFrustum=!0,this.displayPlanes=!0,this.displayShadowBounds=!0;const t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),s=new Float32Array(24),i=new at;i.setIndex(new Ye(t,1)),i.setAttribute("position",new Ye(s,3,!1));const a=new fi(i,new Et);this.add(a),this.frustumLines=a,this.cascadeLines=[],this.cascadePlanes=[],this.shadowLines=[]}updateVisibility(){const e=this.displayFrustum,t=this.displayPlanes,s=this.displayShadowBounds,i=this.frustumLines,a=this.cascadeLines,n=this.cascadePlanes,r=this.shadowLines;for(let A=0,c=a.length;A<c;A++){const l=a[A],h=n[A],d=r[A];l.visible=e,h.visible=e&&t,d.visible=s}i.visible=e}update(){const e=this.csm,t=e.camera,s=e.cascades,i=e.mainFrustum,a=e.frustums,n=e.lights,r=this.frustumLines.geometry.getAttribute("position"),A=this.cascadeLines,c=this.cascadePlanes,l=this.shadowLines;for(this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.updateMatrixWorld(!0);A.length>s;)this.remove(A.pop()),this.remove(c.pop()),this.remove(l.pop());for(;A.length<s;){const p=new en(new Wt,16777215),f=new ht({transparent:!0,opacity:.1,depthWrite:!1,side:Hi}),b=new O(new Ji,f),u=new Tt,I=new en(new Wt,16776960);u.add(I),this.add(p),this.add(b),this.add(u),A.push(p),c.push(b),l.push(u)}for(let p=0;p<s;p++){const f=a[p],b=n[p].shadow.camera,u=f.vertices.far,I=A[p],C=c[p],E=l[p],y=E.children[0];I.box.min.copy(u[2]),I.box.max.copy(u[0]),I.box.max.z+=1e-4,C.position.addVectors(u[0],u[2]),C.position.multiplyScalar(.5),C.scale.subVectors(u[0],u[2]),C.scale.z=1e-4,this.remove(E),E.position.copy(b.position),E.quaternion.copy(b.quaternion),E.scale.copy(b.scale),E.updateMatrixWorld(!0),this.attach(E),y.box.min.set(b.bottom,b.left,-b.far),y.box.max.set(b.top,b.right,-b.near)}const h=i.vertices.near,d=i.vertices.far;r.setXYZ(0,d[0].x,d[0].y,d[0].z),r.setXYZ(1,d[3].x,d[3].y,d[3].z),r.setXYZ(2,d[2].x,d[2].y,d[2].z),r.setXYZ(3,d[1].x,d[1].y,d[1].z),r.setXYZ(4,h[0].x,h[0].y,h[0].z),r.setXYZ(5,h[3].x,h[3].y,h[3].z),r.setXYZ(6,h[2].x,h[2].y,h[2].z),r.setXYZ(7,h[1].x,h[1].y,h[1].z),r.needsUpdate=!0}dispose(){const e=this.frustumLines,t=this.cascadeLines,s=this.cascadePlanes,i=this.shadowLines;e.geometry.dispose(),e.material.dispose();const a=this.csm.cascades;for(let n=0;n<a;n++){const r=t[n],A=s[n],c=i[n].children[0];r.dispose(),A.geometry.dispose(),A.material.dispose(),c.dispose()}}}class _l extends O{constructor(e){const t=new Ll(e),s=new Ji(t.image.width*.001,t.image.height*.001),i=new ht({map:t,toneMapped:!1,transparent:!0});super(s,i);function a(n){i.map.dispatchDOMEvent(n)}this.addEventListener("mousedown",a),this.addEventListener("mousemove",a),this.addEventListener("mouseup",a),this.addEventListener("click",a),this.dispose=function(){s.dispose(),i.dispose(),i.map.dispose(),wa.delete(e),this.removeEventListener("mousedown",a),this.removeEventListener("mousemove",a),this.removeEventListener("mouseup",a),this.removeEventListener("click",a)}}}class Ll extends Za{constructor(e){super(Qo(e)),this.dom=e,this.anisotropy=16,this.colorSpace=le,this.minFilter=st,this.magFilter=st;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&&kl(this.dom,e.type,e.data.x,e.data.y)}update(){this.image=Qo(this.dom),this.needsUpdate=!0,this.scheduleUpdate=null}dispose(){this.observer&&this.observer.disconnect(),this.scheduleUpdate=clearTimeout(this.scheduleUpdate),super.dispose()}}const wa=new WeakMap;function Qo(o){const e=document.createRange(),t=new Be;function s(d){const p=[];let f=!1;function b(){if(f&&(f=!1,d.restore()),p.length===0)return;let u=-1/0,I=-1/0,C=1/0,E=1/0;for(let y=0;y<p.length;y++){const w=p[y];u=Math.max(u,w.x),I=Math.max(I,w.y),C=Math.min(C,w.x+w.width),E=Math.min(E,w.y+w.height)}d.save(),d.beginPath(),d.rect(u,I,C-u,E-I),d.clip(),f=!0}return{add:function(u){p.push(u),b()},remove:function(){p.pop(),b()}}}function i(d,p,f,b){b!==""&&(d.textTransform==="uppercase"&&(b=b.toUpperCase()),l.font=d.fontWeight+" "+d.fontSize+" "+d.fontFamily,l.textBaseline="top",l.fillStyle=d.color,l.fillText(b,p,f+parseFloat(d.fontSize)*.1))}function a(d,p,f,b,u){f<2*u&&(u=f/2),b<2*u&&(u=b/2),l.beginPath(),l.moveTo(d+u,p),l.arcTo(d+f,p,d+f,p+b,u),l.arcTo(d+f,p+b,d,p+b,u),l.arcTo(d,p+b,d,p,u),l.arcTo(d,p,d+f,p,u),l.closePath()}function n(d,p,f,b,u,I){const C=d[p+"Width"],E=d[p+"Style"],y=d[p+"Color"];C!=="0px"&&E!=="none"&&y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=y,l.lineWidth=parseFloat(C),l.beginPath(),l.moveTo(f,b),l.lineTo(f+u,b+I),l.stroke())}function r(d,p){if(d.nodeType===Node.COMMENT_NODE||d.nodeName==="SCRIPT"||d.style&&d.style.display==="none")return;let f=0,b=0,u=0,I=0;if(d.nodeType===Node.TEXT_NODE){e.selectNode(d);const E=e.getBoundingClientRect();f=E.left-A.left-.5,b=E.top-A.top-.5,u=E.width,I=E.height,i(p,f,b,d.nodeValue.trim())}else if(d instanceof HTMLCanvasElement){const E=d.getBoundingClientRect();f=E.left-A.left-.5,b=E.top-A.top-.5,l.save();const y=window.devicePixelRatio;l.scale(1/y,1/y),l.drawImage(d,f,b),l.restore()}else if(d instanceof HTMLImageElement){const E=d.getBoundingClientRect();f=E.left-A.left-.5,b=E.top-A.top-.5,u=E.width,I=E.height,l.drawImage(d,f,b,u,I)}else{const E=d.getBoundingClientRect();f=E.left-A.left-.5,b=E.top-A.top-.5,u=E.width,I=E.height,p=window.getComputedStyle(d),a(f,b,u,I,parseFloat(p.borderRadius));const y=p.backgroundColor;y!=="transparent"&&y!=="rgba(0, 0, 0, 0)"&&(l.fillStyle=y,l.fill());const w=["borderTop","borderLeft","borderBottom","borderRight"];let x=!0,D=null;for(const S of w){if(D!==null&&(x=p[S+"Width"]===p[D+"Width"]&&p[S+"Color"]===p[D+"Color"]&&p[S+"Style"]===p[D+"Style"]),x===!1)break;D=S}if(x===!0){const S=parseFloat(p.borderTopWidth);p.borderTopWidth!=="0px"&&p.borderTopStyle!=="none"&&p.borderTopColor!=="transparent"&&p.borderTopColor!=="rgba(0, 0, 0, 0)"&&(l.strokeStyle=p.borderTopColor,l.lineWidth=S,l.stroke())}else n(p,"borderTop",f,b,u,0),n(p,"borderLeft",f,b,0,I),n(p,"borderBottom",f,b+I,u,0),n(p,"borderRight",f+u,b,0,I);if(d instanceof HTMLInputElement){let S=p.accentColor;(S===void 0||S==="auto")&&(S=p.color),t.set(S);const L=Math.sqrt(.299*t.r**2+.587*t.g**2+.114*t.b**2)<.5?"white":"#111111";if(d.type==="radio"&&(a(f,b,u,I,I),l.fillStyle="white",l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),d.checked&&(a(f+2,b+2,u-4,I-4,I),l.fillStyle=S,l.strokeStyle=L,l.lineWidth=2,l.fill(),l.stroke())),d.type==="checkbox"&&(a(f,b,u,I,2),l.fillStyle=d.checked?S:"white",l.strokeStyle=d.checked?L:S,l.lineWidth=1,l.stroke(),l.fill(),d.checked)){const Y=l.textAlign;l.textAlign="center";const W={color:L,fontFamily:p.fontFamily,fontSize:I+"px",fontWeight:"bold"};i(W,f+u/2,b,"\u2714"),l.textAlign=Y}if(d.type==="range"){const[Y,W,K]=["min","max","value"].map(j=>parseFloat(d[j])),V=(K-Y)/(W-Y)*(u-I);a(f,b+I/4,u,I/2,I/4),l.fillStyle=L,l.strokeStyle=S,l.lineWidth=1,l.fill(),l.stroke(),a(f,b+I/4,V+I/2,I/2,I/4),l.fillStyle=S,l.fill(),a(f+V,b,I,I,I/2),l.fillStyle=S,l.fill()}(d.type==="color"||d.type==="text"||d.type==="number")&&(h.add({x:f,y:b,width:u,height:I}),i(p,f+parseInt(p.paddingLeft),b+parseInt(p.paddingTop),d.value),h.remove())}}const C=p.overflow==="auto"||p.overflow==="hidden";C&&h.add({x:f,y:b,width:u,height:I});for(let E=0;E<d.childNodes.length;E++)r(d.childNodes[E],p);C&&h.remove()}const A=o.getBoundingClientRect();let c=wa.get(o);c===void 0&&(c=document.createElement("canvas"),c.width=A.width,c.height=A.height,wa.set(o,c));const l=c.getContext("2d"),h=new s(l);return l.clearRect(0,0,c.width,c.height),r(o),c}function kl(o,e,t,s){const i={clientX:t*o.offsetWidth+o.offsetLeft,clientY:s*o.offsetHeight+o.offsetTop,view:o.ownerDocument.defaultView};window.dispatchEvent(new MouseEvent(e,i));const a=o.getBoundingClientRect();t=t*a.width+a.left,s=s*a.height+a.top;function n(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,i)),r instanceof HTMLInputElement&&r.type==="range"&&(e==="mousedown"||e==="click"))){const[c,l]=["min","max"].map(p=>parseFloat(r[p])),h=A.width,d=(t-A.x)/h;r.value=c+(l-c)*d,r.dispatchEvent(new InputEvent("input",{bubbles:!0}))}for(let c=0;c<r.childNodes.length;c++)n(r.childNodes[c])}}n(o)}const rs=new Re,ci={type:"",data:rs},vo=new Ds;class Fl extends Tt{listenToPointerEvents(e,t){const s=this,i=new Ds,a=e.domElement;function n(r){r.stopPropagation();const A=e.domElement.getBoundingClientRect();rs.x=(r.clientX-A.left)/A.width*2-1,rs.y=-(r.clientY-A.top)/A.height*2+1,i.setFromCamera(rs,t);const c=i.intersectObjects(s.children,!1);if(c.length>0){const l=c[0],h=l.object,d=l.uv;ci.type=r.type,ci.data.set(d.x,1-d.y),h.dispatchEvent(ci)}}a.addEventListener("pointerdown",n),a.addEventListener("pointerup",n),a.addEventListener("pointermove",n),a.addEventListener("mousedown",n),a.addEventListener("mouseup",n),a.addEventListener("mousemove",n),a.addEventListener("click",n)}listenToXRControllerEvents(e){const t=this,s={move:"mousemove",select:"click",selectstart:"mousedown",selectend:"mouseup"};function i(a){const n=a.target;vo.setFromXRController(n);const r=vo.intersectObjects(t.children,!1);if(r.length>0){const A=r[0],c=A.object,l=A.uv;ci.type=s[a.type],ci.data.set(l.x,1-l.y),c.dispatchEvent(ci)}}e.addEventListener("move",i),e.addEventListener("select",i),e.addEventListener("selectstart",i),e.addEventListener("selectend",i)}}const Fi=new F,Ni=new F,xo=new tn;class Nl extends fi{constructor(e,t=1,s=16711680){const i=new at,a=e.geometry.attributes.normal.count,n=new Me(a*2*3,3);i.setAttribute("position",n),super(i,new Et({color:s,toneMapped:!1})),this.object=e,this.size=t,this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),xo.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,t=this.geometry.attributes.position,s=this.object.geometry;if(s){const i=s.attributes.position,a=s.attributes.normal;let n=0;for(let r=0,A=i.count;r<A;r++)Fi.fromBufferAttribute(i,r).applyMatrix4(e),Ni.fromBufferAttribute(a,r),Ni.applyMatrix3(xo).normalize().multiplyScalar(this.size).add(Fi),t.setXYZ(n,Fi.x,Fi.y,Fi.z),n=n+1,t.setXYZ(n,Ni.x,Ni.y,Ni.z),n=n+1}t.needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function So(o,e,t){const s=t.length-o-1;if(e>=t[s])return s-1;if(e<=t[o])return o;let i=o,a=s,n=Math.floor((i+a)/2);for(;e<t[n]||e>=t[n+1];)e<t[n]?a=n:i=n,n=Math.floor((i+a)/2);return n}function Ul(o,e,t,s){const i=[],a=[],n=[];i[0]=1;for(let r=1;r<=t;++r){a[r]=e-s[o+1-r],n[r]=s[o+r]-e;let A=0;for(let c=0;c<r;++c){const l=n[c+1],h=a[r-c],d=i[c]/(l+h);i[c]=A+l*d,A=h*d}i[r]=A}return i}function Pl(o,e,t,s){const i=So(o,s,e),a=Ul(i,s,o,e),n=new Rt(0,0,0,0);for(let r=0;r<=o;++r){const A=t[i-o+r],c=a[r],l=A.w*c;n.x+=A.x*l,n.y+=A.y*l,n.z+=A.z*l,n.w+=A.w*c}return n}function Gl(o,e,t,s,i){const a=[];for(let h=0;h<=t;++h)a[h]=0;const n=[];for(let h=0;h<=s;++h)n[h]=a.slice(0);const r=[];for(let h=0;h<=t;++h)r[h]=a.slice(0);r[0][0]=1;const A=a.slice(0),c=a.slice(0);for(let h=1;h<=t;++h){A[h]=e-i[o+1-h],c[h]=i[o+h]-e;let d=0;for(let p=0;p<h;++p){const f=c[p+1],b=A[h-p];r[h][p]=f+b;const u=r[p][h-1]/r[h][p];r[p][h]=d+f*u,d=b*u}r[h][h]=d}for(let h=0;h<=t;++h)n[0][h]=r[h][t];for(let h=0;h<=t;++h){let d=0,p=1;const f=[];for(let b=0;b<=t;++b)f[b]=a.slice(0);f[0][0]=1;for(let b=1;b<=s;++b){let u=0;const I=h-b,C=t-b;h>=b&&(f[p][0]=f[d][0]/r[C+1][I],u=f[p][0]*r[I][C]);const E=I>=-1?1:-I,y=h-1<=C?b-1:t-h;for(let x=E;x<=y;++x)f[p][x]=(f[d][x]-f[d][x-1])/r[C+1][I+x],u+=f[p][x]*r[I+x][C];h<=C&&(f[p][b]=-f[d][b-1]/r[C+1][h],u+=f[p][b]*r[h][C]),n[b][h]=u;const w=d;d=p,p=w}}let l=t;for(let h=1;h<=s;++h){for(let d=0;d<=t;++d)n[h][d]*=l;l*=t-h}return n}function Ol(o,e,t,s,i){const a=i<o?i:o,n=[],r=So(o,s,e),A=Gl(r,s,o,a,e),c=[];for(let l=0;l<t.length;++l){const h=t[l].clone(),d=h.w;h.x*=d,h.y*=d,h.z*=d,c[l]=h}for(let l=0;l<=a;++l){const h=c[r-o].clone().multiplyScalar(A[l][0]);for(let d=1;d<=o;++d)h.add(c[r-o+d].clone().multiplyScalar(A[l][d]));n[l]=h}for(let l=a+1;l<=i+1;++l)n[l]=new Rt(0,0,0);return n}function Hl(o,e){let t=1;for(let i=2;i<=o;++i)t*=i;let s=1;for(let i=2;i<=e;++i)s*=i;for(let i=2;i<=o-e;++i)s*=i;return t/s}function jl(o){const e=o.length,t=[],s=[];for(let a=0;a<e;++a){const n=o[a];t[a]=new F(n.x,n.y,n.z),s[a]=n.w}const i=[];for(let a=0;a<e;++a){const n=t[a].clone();for(let r=1;r<=a;++r)n.sub(i[a-r].clone().multiplyScalar(Hl(a,r)*s[r]));i[a]=n.divideScalar(s[0])}return i}function ql(o,e,t,s,i){const a=Ol(o,e,t,s,i);return jl(a)}class zl extends Tr{constructor(e,t,s,i,a){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=i||0,this.endKnot=a||this.knots.length-1;for(let n=0;n<s.length;++n){const r=s[n];this.controlPoints[n]=new Rt(r.x,r.y,r.z,r.w)}}getPoint(e,t=new F){const s=t,i=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),a=Pl(this.degree,this.knots,this.controlPoints,i);return a.w!==1&&a.divideScalar(a.w),s.set(a.x,a.y,a.z)}getTangent(e,t=new F){const s=t,i=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),a=ql(this.degree,this.knots,this.controlPoints,i,1);return s.copy(a[1]).normalize(),s}}let se,xe,We;class Yl extends St{constructor(e){super(e)}load(e,t,s,i){const a=this,n=a.path===""?Yt.extractUrlBase(e):a.path,r=new gt(this.manager);r.setPath(a.path),r.setResponseType("arraybuffer"),r.setRequestHeader(a.requestHeader),r.setWithCredentials(a.withCredentials),r.load(e,function(A){try{t(a.parse(A,n))}catch(c){i?i(c):console.error(c),a.manager.itemError(e)}},s,i)}parse(e,t){if(Zl(e))se=new Xl().parse(e);else{const i=_o(e);if(!$l(i))throw new Error("THREE.FBXLoader: Unknown format.");if(Ro(i)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+Ro(i));se=new Vl().parse(i)}const s=new us(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new Kl(s,this.manager).parse(se)}getFbxTree(){return se}}class Kl{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){xe=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),s=this.parseMaterials(t),i=this.parseDeformers(),a=new Jl().parse(i);return this.parseScene(i,a,s),We}parseConnections(){const e=new Map;return"Connections"in se&&se.Connections.connections.forEach(function(t){const s=t[0],i=t[1],a=t[2];e.has(s)||e.set(s,{parents:[],children:[]});const n={ID:i,relationship:a};e.get(s).parents.push(n),e.has(i)||e.set(i,{parents:[],children:[]});const r={ID:s,relationship:a};e.get(i).children.push(r)}),e}parseImages(){const e={},t={};if("Video"in se.Objects){const s=se.Objects.Video;for(const i in s){const a=s[i],n=parseInt(i);if(e[n]=a.RelativeFilename||a.Filename,"Content"in a){const r=a.Content instanceof ArrayBuffer&&a.Content.byteLength>0,A=typeof a.Content=="string"&&a.Content!=="";if(r||A){const c=this.parseImage(s[i]);t[a.RelativeFilename||a.Filename]=c}}}}for(const s in e){const i=e[s];t[i]!==void 0?e[s]=t[i]:e[s]=e[s].split("\\").pop()}return e}parseImage(e){const t=e.Content,s=e.RelativeFilename||e.Filename,i=s.slice(s.lastIndexOf(".")+1).toLowerCase();let a;switch(i){case"bmp":a="image/bmp";break;case"jpg":case"jpeg":a="image/jpeg";break;case"png":a="image/png";break;case"tif":a="image/tiff";break;case"tga":this.manager.getHandler(".tga")===null&&console.warn("FBXLoader: TGA loader not found, skipping ",s),a="image/tga";break;default:console.warn('FBXLoader: Image type "'+i+'" is not supported.');return}if(typeof t=="string")return"data:"+a+";base64,"+t;{const n=new Uint8Array(t);return window.URL.createObjectURL(new Blob([n],{type:a}))}}parseTextures(e){const t=new Map;if("Texture"in se.Objects){const s=se.Objects.Texture;for(const i in s){const a=this.parseTexture(s[i],e);t.set(parseInt(i),a)}}return t}parseTexture(e,t){const s=this.loadTexture(e,t);s.ID=e.id,s.name=e.attrName;const i=e.WrapModeU,a=e.WrapModeV,n=i!==void 0?i.value:0,r=a!==void 0?a.value:0;if(s.wrapS=n===0?Kt:Oi,s.wrapT=r===0?Kt:Oi,"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"]),i=e.FileName.split(".").pop().toLowerCase(),a=s.has(i)?this.manager.getHandler(`.${i}`):this.textureLoader;if(!a)return console.warn(`FBXLoader: ${i.toUpperCase()} loader not found, creating placeholder texture for`,e.RelativeFilename),new Es;const n=a.path;n||a.setPath(this.textureLoader.path);const r=xe.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)&&a.setPath(void 0));const c=a.load(A);return a.setPath(n),c}parseMaterials(e){const t=new Map;if("Material"in se.Objects){const s=se.Objects.Material;for(const i in s){const a=this.parseMaterial(s[i],e);a!==null&&t.set(parseInt(i),a)}}return t}parseMaterial(e,t){const s=e.id,i=e.attrName;let a=e.ShadingModel;if(typeof a=="object"&&(a=a.value),!xe.has(s))return null;const n=this.parseParameters(e,t,s);let r;switch(a.toLowerCase()){case"phong":r=new Ei;break;case"lambert":r=new Rr;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',a),r=new Ei;break}return r.setValues(n),r.name=i,r}parseParameters(e,t,s){const i={};e.BumpFactor&&(i.bumpScale=e.BumpFactor.value),e.Diffuse?i.color=Xe.toWorkingColorSpace(new Be().fromArray(e.Diffuse.value),le):e.DiffuseColor&&(e.DiffuseColor.type==="Color"||e.DiffuseColor.type==="ColorRGB")&&(i.color=Xe.toWorkingColorSpace(new Be().fromArray(e.DiffuseColor.value),le)),e.DisplacementFactor&&(i.displacementScale=e.DisplacementFactor.value),e.Emissive?i.emissive=Xe.toWorkingColorSpace(new Be().fromArray(e.Emissive.value),le):e.EmissiveColor&&(e.EmissiveColor.type==="Color"||e.EmissiveColor.type==="ColorRGB")&&(i.emissive=Xe.toWorkingColorSpace(new Be().fromArray(e.EmissiveColor.value),le)),e.EmissiveFactor&&(i.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(i.opacity=parseFloat(e.Opacity.value)),i.opacity<1&&(i.transparent=!0),e.ReflectionFactor&&(i.reflectivity=e.ReflectionFactor.value),e.Shininess&&(i.shininess=e.Shininess.value),e.Specular?i.specular=Xe.toWorkingColorSpace(new Be().fromArray(e.Specular.value),le):e.SpecularColor&&e.SpecularColor.type==="Color"&&(i.specular=Xe.toWorkingColorSpace(new Be().fromArray(e.SpecularColor.value),le));const a=this;return xe.get(s).children.forEach(function(n){const r=n.relationship;switch(r){case"Bump":i.bumpMap=a.getTexture(t,n.ID);break;case"Maya|TEX_ao_map":i.aoMap=a.getTexture(t,n.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":i.map=a.getTexture(t,n.ID),i.map!==void 0&&(i.map.colorSpace=le);break;case"DisplacementColor":i.displacementMap=a.getTexture(t,n.ID);break;case"EmissiveColor":i.emissiveMap=a.getTexture(t,n.ID),i.emissiveMap!==void 0&&(i.emissiveMap.colorSpace=le);break;case"NormalMap":case"Maya|TEX_normal_map":i.normalMap=a.getTexture(t,n.ID);break;case"ReflectionColor":i.envMap=a.getTexture(t,n.ID),i.envMap!==void 0&&(i.envMap.mapping=Mr,i.envMap.colorSpace=le);break;case"SpecularColor":i.specularMap=a.getTexture(t,n.ID),i.specularMap!==void 0&&(i.specularMap.colorSpace=le);break;case"TransparentColor":case"TransparencyFactor":i.alphaMap=a.getTexture(t,n.ID),i.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",r);break}}),i}getTexture(e,t){return"LayeredTexture"in se.Objects&&t in se.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=xe.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in se.Objects){const s=se.Objects.Deformer;for(const i in s){const a=s[i],n=xe.get(parseInt(i));if(a.attrType==="Skin"){const r=this.parseSkeleton(n,s);r.ID=i,n.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),r.geometryID=n.parents[0].ID,e[i]=r}else if(a.attrType==="BlendShape"){const r={id:i};r.rawTargets=this.parseMorphTargets(n,s),r.id=i,n.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[i]=r}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const s=[];return e.children.forEach(function(i){const a=t[i.ID];if(a.attrType!=="Cluster")return;const n={ID:i.ID,indices:[],weights:[],transformLink:new re().fromArray(a.TransformLink.a)};"Indexes"in a&&(n.indices=a.Indexes.a,n.weights=a.Weights.a),s.push(n)}),{rawBones:s,bones:[]}}parseMorphTargets(e,t){const s=[];for(let i=0;i<e.children.length;i++){const a=e.children[i],n=t[a.ID],r={name:n.attrName,initialWeight:n.DeformPercent,id:n.id,fullWeights:n.FullWeights.a};if(n.attrType!=="BlendShapeChannel")return;r.geoID=xe.get(parseInt(a.ID)).children.filter(function(A){return A.relationship===void 0})[0].ID,s.push(r)}return s}parseScene(e,t,s){We=new Tt;const i=this.parseModels(e.skeletons,t,s),a=se.Objects.Model,n=this;i.forEach(function(A){const c=a[A.ID];n.setLookAtProperties(A,c),xe.get(A.ID)?.parents?.forEach(function(l){const h=i.get(l.ID);h!==void 0&&h.add(A)}),A.parent===null&&We.add(A)}),this.bindSkeleton(e.skeletons,t,i),this.addGlobalSceneSettings(),We.traverse(function(A){if(A.userData.transformData){A.parent&&(A.userData.transformData.parentMatrix=A.parent.matrix,A.userData.transformData.parentMatrixWorld=A.parent.matrixWorld);const c=Mo(A.userData.transformData);A.applyMatrix4(c),A.updateWorldMatrix()}A.isSkinnedMesh&&(A.computeBoundingBox(),A.computeBoundingSphere(),A.boundingBox.expandByScalar(3),A.boundingSphere.radius*=3)});const r=new Wl().parse();We.children.length===1&&We.children[0].isGroup&&(We.children[0].animations=r,We=We.children[0]),We.animations=r}parseModels(e,t,s){const i=new Map,a=se.Objects.Model;for(const n in a){const r=parseInt(n),A=a[n],c=xe.get(r);let l=this.buildSkeleton(c,e,r,A.attrName);if(!l){switch(A.attrType){case"Camera":l=this.createCamera(c);break;case"Light":l=this.createLight(c);break;case"Mesh":l=this.createMesh(c,t,s);break;case"NurbsCurve":l=this.createCurve(c,t);break;case"LimbNode":case"Root":l=new bs;break;default:l=new Tt;break}l.name=A.attrName?Dt.sanitizeNodeName(A.attrName):"",l.userData.originalName=A.attrName,l.ID=r}this.getTransformData(l,A),i.set(r,l)}return i}buildSkeleton(e,t,s,i){let a=null;return e?.parents.forEach(function(n){for(const r in t){const A=t[r];A.rawBones.forEach(function(c,l){if(c.ID===n.ID){const h=a;a=new bs,a.matrixWorld.copy(c.transformLink),a.name=i?Dt.sanitizeNodeName(i):"",a.userData.originalName=i,a.ID=s,A.bones[l]=a,h!==null&&a.add(h)}})}}),a}createCamera(e){let t,s;if(e.children.forEach(function(i){const a=se.Objects.NodeAttribute[i.ID];a!==void 0&&(s=a)}),s===void 0)t=new It;else{let i=0;s.CameraProjectionType!==void 0&&s.CameraProjectionType.value===1&&(i=1);let a=1;s.NearPlane!==void 0&&(a=s.NearPlane.value/1e3);let n=1e3;s.FarPlane!==void 0&&(n=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 c=r/A;let l=45;s.FieldOfView!==void 0&&(l=s.FieldOfView.value);const h=s.FocalLength?s.FocalLength.value:null;switch(i){case 0:t=new qi(l,c,a,n),h!==null&&t.setFocalLength(h);break;case 1:console.warn("THREE.FBXLoader: Orthographic cameras not supported yet."),t=new It;break;default:console.warn("THREE.FBXLoader: Unknown camera type "+i+"."),t=new It;break}}return t}createLight(e){let t,s;if(e.children.forEach(function(i){const a=se.Objects.NodeAttribute[i.ID];a!==void 0&&(s=a)}),s===void 0)t=new It;else{let i;s.LightType===void 0?i=0:i=s.LightType.value;let a=16777215;s.Color!==void 0&&(a=Xe.toWorkingColorSpace(new Be().fromArray(s.Color.value),le));let n=s.Intensity===void 0?1:s.Intensity.value/100;s.CastLightOnObject!==void 0&&s.CastLightOnObject.value===0&&(n=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(i){case 0:t=new ds(a,n,r,A);break;case 1:t=new ps(a,n);break;case 2:let c=Math.PI/3;s.InnerAngle!==void 0&&(c=be.degToRad(s.InnerAngle.value));let l=0;s.OuterAngle!==void 0&&(l=be.degToRad(s.OuterAngle.value),l=Math.max(l,1)),t=new Ra(a,n,r,c,l,A);break;default:console.warn("THREE.FBXLoader: Unknown light type "+s.LightType.value+", defaulting to a PointLight."),t=new ds(a,n);break}s.CastShadows!==void 0&&s.CastShadows.value===1&&(t.castShadow=!0)}return t}createMesh(e,t,s){let i,a=null,n=null;const r=[];if(e.children.forEach(function(A){t.has(A.ID)&&(a=t.get(A.ID)),s.has(A.ID)&&r.push(s.get(A.ID))}),r.length>1?n=r:r.length>0?n=r[0]:(n=new Ei({name:St.DEFAULT_MATERIAL_NAME,color:13421772}),r.push(n)),"color"in a.attributes&&r.forEach(function(A){A.vertexColors=!0}),a.groups.length>0){let A=!1;for(let c=0,l=a.groups.length;c<l;c++){const h=a.groups[c];(h.materialIndex<0||h.materialIndex>=r.length)&&(h.materialIndex=r.length,A=!0)}if(A){const c=new ms;r.push(c)}}return a.FBX_Deformer?(i=new ka(a,n),i.normalizeSkinWeights()):i=new O(a,n),i}createCurve(e,t){const s=e.children.reduce(function(a,n){return t.has(n.ID)&&(a=t.get(n.ID)),a},null),i=new Et({name:St.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new dt(s,i)}getTransformData(e,t){const s={};"InheritType"in t&&(s.inheritType=parseInt(t.InheritType.value)),"RotationOrder"in t?s.eulerOrder=Ui(t.RotationOrder.value):s.eulerOrder=Ui(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&&xe.get(e.ID).children.forEach(function(s){if(s.relationship==="LookAtProperty"){const i=se.Objects.Model[s.ID];if("Lcl_Translation"in i){const a=i.Lcl_Translation.value;e.target!==void 0?(e.target.position.fromArray(a),We.add(e.target)):e.lookAt(new F().fromArray(a))}}})}bindSkeleton(e,t,s){const i=this.parsePoseNodes();for(const a in e){const n=e[a];xe.get(parseInt(n.ID)).parents.forEach(function(r){if(t.has(r.ID)){const A=r.ID;xe.get(A).parents.forEach(function(c){s.has(c.ID)&&s.get(c.ID).bind(new Na(n.bones),i[c.ID])})}})}}parsePoseNodes(){const e={};if("Pose"in se.Objects){const t=se.Objects.Pose;for(const s in t)if(t[s].attrType==="BindPose"&&t[s].NbPoseNodes>0){const i=t[s].PoseNode;Array.isArray(i)?i.forEach(function(a){e[a.Node]=new re().fromArray(a.Matrix.a)}):e[i.Node]=new re().fromArray(i.Matrix.a)}}return e}addGlobalSceneSettings(){if("GlobalSettings"in se){if("AmbientColor"in se.GlobalSettings){const e=se.GlobalSettings.AmbientColor.value,t=e[0],s=e[1],i=e[2];if(t!==0||s!==0||i!==0){const a=new Be().setRGB(t,s,i,le);We.add(new _r(a,1))}}"UnitScaleFactor"in se.GlobalSettings&&(We.userData.unitScaleFactor=se.GlobalSettings.UnitScaleFactor.value)}}}class Jl{constructor(){this.negativeMaterialIndices=!1}parse(e){const t=new Map;if("Geometry"in se.Objects){const s=se.Objects.Geometry;for(const i in s){const a=xe.get(parseInt(i)),n=this.parseGeometry(a,s[i],e);t.set(parseInt(i),n)}}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 i=s.skeletons,a=[],n=e.parents.map(function(h){return se.Objects.Model[h.ID]});if(n.length===0)return;const r=e.children.reduce(function(h,d){return i[d.ID]!==void 0&&(h=i[d.ID]),h},null);e.children.forEach(function(h){s.morphTargets[h.ID]!==void 0&&a.push(s.morphTargets[h.ID])});const A=n[0],c={};"RotationOrder"in A&&(c.eulerOrder=Ui(A.RotationOrder.value)),"InheritType"in A&&(c.inheritType=parseInt(A.InheritType.value)),"GeometricTranslation"in A&&(c.translation=A.GeometricTranslation.value),"GeometricRotation"in A&&(c.rotation=A.GeometricRotation.value),"GeometricScaling"in A&&(c.scale=A.GeometricScaling.value);const l=Mo(c);return this.genGeometry(t,r,a,l)}genGeometry(e,t,s,i){const a=new at;e.attrName&&(a.name=e.attrName);const n=this.parseGeoNode(e,t),r=this.genBuffers(n),A=new Me(r.vertex,3);if(A.applyMatrix4(i),a.setAttribute("position",A),r.colors.length>0&&a.setAttribute("color",new Me(r.colors,3)),t&&(a.setAttribute("skinIndex",new Lr(r.weightsIndices,4)),a.setAttribute("skinWeight",new Me(r.vertexWeights,4)),a.FBX_Deformer=t),r.normal.length>0){const c=new tn().getNormalMatrix(i),l=new Me(r.normal,3);l.applyNormalMatrix(c),a.setAttribute("normal",l)}if(r.uvs.forEach(function(c,l){const h=l===0?"uv":`uv${l}`;a.setAttribute(h,new Me(r.uvs[l],2))}),n.material&&n.material.mappingType!=="AllSame"){let c=r.materialIndex[0],l=0;if(r.materialIndex.forEach(function(h,d){h!==c&&(a.addGroup(l,d-l,c),c=h,l=d)}),a.groups.length>0){const h=a.groups[a.groups.length-1],d=h.start+h.count;d!==r.materialIndex.length&&a.addGroup(d,r.materialIndex.length-d,c)}a.groups.length===0&&a.addGroup(0,r.materialIndex.length,r.materialIndex[0])}return this.addMorphTargets(a,e,s,i),a}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 i=0;for(;e.LayerElementUV[i];)e.LayerElementUV[i].UV&&s.uv.push(this.parseUVs(e.LayerElementUV[i])),i++}return s.weightTable={},t!==null&&(s.skeleton=t,t.rawBones.forEach(function(i,a){i.indices.forEach(function(n,r){s.weightTable[n]===void 0&&(s.weightTable[n]=[]),s.weightTable[n].push({id:a,weight:i.weights[r]})})})),s}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let s=0,i=0,a=!1,n=[],r=[],A=[],c=[],l=[],h=[];const d=this;return e.vertexIndices.forEach(function(p,f){let b,u=!1;p<0&&(p=p^-1,u=!0);let I=[],C=[];if(n.push(p*3,p*3+1,p*3+2),e.color){const E=As(f,s,p,e.color);A.push(E[0],E[1],E[2])}if(e.skeleton){if(e.weightTable[p]!==void 0&&e.weightTable[p].forEach(function(E){C.push(E.weight),I.push(E.id)}),C.length>4){a||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),a=!0);const E=[0,0,0,0],y=[0,0,0,0];C.forEach(function(w,x){let D=w,S=I[x];y.forEach(function(L,Y,W){if(D>L){W[Y]=D,D=L;const K=E[Y];E[Y]=S,S=K}})}),I=E,C=y}for(;C.length<4;)C.push(0),I.push(0);for(let E=0;E<4;++E)l.push(C[E]),h.push(I[E])}if(e.normal){const E=As(f,s,p,e.normal);r.push(E[0],E[1],E[2])}e.material&&e.material.mappingType!=="AllSame"&&(b=As(f,s,p,e.material)[0],b<0&&(d.negativeMaterialIndices=!0,b=0)),e.uv&&e.uv.forEach(function(E,y){const w=As(f,s,p,E);c[y]===void 0&&(c[y]=[]),c[y].push(w[0]),c[y].push(w[1])}),i++,u&&(d.genFace(t,e,n,b,r,A,c,l,h,i),s++,i=0,n=[],r=[],A=[],c=[],l=[],h=[])}),t}getNormalNewell(e){const t=new F(0,0,0);for(let s=0;s<e.length;s++){const i=e[s],a=e[(s+1)%e.length];t.x+=(i.y-a.y)*(i.z+a.z),t.y+=(i.z-a.z)*(i.x+a.x),t.z+=(i.x-a.x)*(i.y+a.y)}return t.normalize(),t}getNormalTangentAndBitangent(e){const t=this.getNormalNewell(e),s=(Math.abs(t.z)>.5?new F(0,1,0):new F(0,0,1)).cross(t).normalize(),i=t.clone().cross(s).normalize();return{normal:t,tangent:s,bitangent:i}}flattenVertex(e,t,s){return new Re(e.dot(t),e.dot(s))}genFace(e,t,s,i,a,n,r,A,c,l){let h;if(l>3){const d=[],p=t.baseVertexPositions||t.vertexPositions;for(let I=0;I<s.length;I+=3)d.push(new F(p[s[I]],p[s[I+1]],p[s[I+2]]));const{tangent:f,bitangent:b}=this.getNormalTangentAndBitangent(d),u=[];for(const I of d)u.push(this.flattenVertex(I,f,b));h=kr.triangulateShape(u,[])}else l===2?(console.warn("THREE.FBXLoader: Edge topology detected. This is currently not supported. The resulting mesh will not be correct."),h=[[0,1,2]]):h=[[0,1,2]];for(const[d,p,f]of h)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[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[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[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[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(c[d*4]),e.weightsIndices.push(c[d*4+1]),e.weightsIndices.push(c[d*4+2]),e.weightsIndices.push(c[d*4+3]),e.weightsIndices.push(c[p*4]),e.weightsIndices.push(c[p*4+1]),e.weightsIndices.push(c[p*4+2]),e.weightsIndices.push(c[p*4+3]),e.weightsIndices.push(c[f*4]),e.weightsIndices.push(c[f*4+1]),e.weightsIndices.push(c[f*4+2]),e.weightsIndices.push(c[f*4+3])),t.color&&(e.colors.push(n[d*3]),e.colors.push(n[d*3+1]),e.colors.push(n[d*3+2]),e.colors.push(n[p*3]),e.colors.push(n[p*3+1]),e.colors.push(n[p*3+2]),e.colors.push(n[f*3]),e.colors.push(n[f*3+1]),e.colors.push(n[f*3+2])),t.material&&t.material.mappingType!=="AllSame"&&(e.materialIndex.push(i),e.materialIndex.push(i),e.materialIndex.push(i)),t.normal&&(e.normal.push(a[d*3]),e.normal.push(a[d*3+1]),e.normal.push(a[d*3+2]),e.normal.push(a[p*3]),e.normal.push(a[p*3+1]),e.normal.push(a[p*3+2]),e.normal.push(a[f*3]),e.normal.push(a[f*3+1]),e.normal.push(a[f*3+2])),t.uv&&t.uv.forEach(function(b,u){e.uvs[u]===void 0&&(e.uvs[u]=[]),e.uvs[u].push(r[u][d*2]),e.uvs[u].push(r[u][d*2+1]),e.uvs[u].push(r[u][p*2]),e.uvs[u].push(r[u][p*2+1]),e.uvs[u].push(r[u][f*2]),e.uvs[u].push(r[u][f*2+1])})}addMorphTargets(e,t,s,i){if(s.length===0)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const a=this;s.forEach(function(n){n.rawTargets.forEach(function(r){const A=se.Objects.Geometry[r.geoID];A!==void 0&&a.genMorphGeometry(e,t,A,i,r.name)})})}genMorphGeometry(e,t,s,i,a){const n=t.Vertices!==void 0?t.Vertices.a:[],r=t.PolygonVertexIndex!==void 0?t.PolygonVertexIndex.a:[],A=s.Vertices!==void 0?s.Vertices.a:[],c=s.Indexes!==void 0?s.Indexes.a:[],l=e.attributes.position.count*3,h=new Float32Array(l);for(let b=0;b<c.length;b++){const u=c[b]*3;h[u]=A[b*3],h[u+1]=A[b*3+1],h[u+2]=A[b*3+2]}const d={vertexIndices:r,vertexPositions:h,baseVertexPositions:n},p=this.genBuffers(d),f=new Me(p.vertex,3);f.name=a||s.attrName,f.applyMatrix4(i),e.morphAttributes.position.push(f)}parseNormals(e){const t=e.MappingInformationType,s=e.ReferenceInformationType,i=e.Normals.a;let a=[];return s==="IndexToDirect"&&("NormalIndex"in e?a=e.NormalIndex.a:"NormalsIndex"in e&&(a=e.NormalsIndex.a)),{dataSize:3,buffer:i,indices:a,mappingType:t,referenceType:s}}parseUVs(e){const t=e.MappingInformationType,s=e.ReferenceInformationType,i=e.UV.a;let a=[];return s==="IndexToDirect"&&(a=e.UVIndex.a),{dataSize:2,buffer:i,indices:a,mappingType:t,referenceType:s}}parseVertexColors(e){if(!e.Colors)return;const t=e.MappingInformationType,s=e.ReferenceInformationType,i=e.Colors.a;let a=[];s==="IndexToDirect"&&(a=e.ColorIndex.a);for(let n=0,r=new Be;n<i.length;n+=4)r.fromArray(i,n),Xe.toWorkingColorSpace(r,le),r.toArray(i,n);return{dataSize:4,buffer:i,indices:a,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 i=e.Materials.a,a=[];for(let n=0;n<i.length;++n)a.push(n);return{dataSize:1,buffer:i,indices:a,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 at;const s=t-1,i=e.KnotVector.a,a=[],n=e.Points.a;for(let l=0,h=n.length;l<h;l+=4)a.push(new Rt().fromArray(n,l));let r,A;if(e.Form==="Closed")a.push(a[0]);else if(e.Form==="Periodic"){r=s,A=i.length-1-r;for(let l=0;l<s;++l)a.push(a[l])}const c=new zl(s,i,a,r,A).getPoints(a.length*12);return new at().setFromPoints(c)}}class Wl{parse(){const e=[],t=this.parseClips();if(t!==void 0)for(const s in t){const i=t[s],a=this.addClip(i);e.push(a)}return e}parseClips(){if(se.Objects.AnimationCurve===void 0)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=se.Objects.AnimationCurveNode,t=new Map;for(const s in e){const i=e[s];if(i.attrName.match(/S|R|T|DeformPercent/)!==null){const a={id:i.id,attr:i.attrName,curves:{}};t.set(a.id,a)}}return t}parseAnimationCurves(e){const t=se.Objects.AnimationCurve;for(const s in t){const i={id:t[s].id,times:t[s].KeyTime.a.map(eh),values:t[s].KeyValueFloat.a},a=xe.get(i.id);if(a!==void 0){const n=a.parents[0].ID,r=a.parents[0].relationship;r.match(/X/)?e.get(n).curves.x=i:r.match(/Y/)?e.get(n).curves.y=i:r.match(/Z/)?e.get(n).curves.z=i:r.match(/DeformPercent/)&&e.has(n)&&(e.get(n).curves.morph=i)}}}parseAnimationLayers(e){const t=se.Objects.AnimationLayer,s=new Map;for(const i in t){const a=[],n=xe.get(parseInt(i));n!==void 0&&(n.children.forEach(function(r,A){if(e.has(r.ID)){const c=e.get(r.ID);if(c.curves.x!==void 0||c.curves.y!==void 0||c.curves.z!==void 0){if(a[A]===void 0){const l=xe.get(r.ID).parents.filter(function(h){return h.relationship!==void 0})[0].ID;if(l!==void 0){const h=se.Objects.Model[l.toString()];if(h===void 0){console.warn("THREE.FBXLoader: Encountered a unused curve.",r);return}const d={modelName:h.attrName?Dt.sanitizeNodeName(h.attrName):"",ID:h.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};We.traverse(function(p){p.ID===h.id&&(d.transform=p.matrix,p.userData.transformData&&(d.eulerOrder=p.userData.transformData.eulerOrder))}),d.transform||(d.transform=new re),"PreRotation"in h&&(d.preRotation=h.PreRotation.value),"PostRotation"in h&&(d.postRotation=h.PostRotation.value),a[A]=d}}a[A]&&(a[A][c.attr]=c)}else if(c.curves.morph!==void 0){if(a[A]===void 0){const l=xe.get(r.ID).parents.filter(function(u){return u.relationship!==void 0})[0].ID,h=xe.get(l).parents[0].ID,d=xe.get(h).parents[0].ID,p=xe.get(d).parents[0].ID,f=se.Objects.Model[p],b={modelName:f.attrName?Dt.sanitizeNodeName(f.attrName):"",morphName:se.Objects.Deformer[l].attrName};a[A]=b}a[A][c.attr]=c}}}),s.set(parseInt(i),a))}return s}parseAnimStacks(e){const t=se.Objects.AnimationStack,s={};for(const i in t){const a=xe.get(parseInt(i)).children;a.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const n=e.get(a[0].ID);s[i]={name:t[i].attrName,layer:n}}return s}addClip(e){let t=[];const s=this;return e.layer.forEach(function(i){t=t.concat(s.generateTracks(i))}),new Ua(e.name,-1,t)}generateTracks(e){const t=[];let s=new F,i=new F;if(e.transform&&e.transform.decompose(s,new we,i),s=s.toArray(),i=i.toArray(),e.T!==void 0&&Object.keys(e.T.curves).length>0){const a=this.generateVectorTrack(e.modelName,e.T.curves,s,"position");a!==void 0&&t.push(a)}if(e.R!==void 0&&Object.keys(e.R.curves).length>0){const a=this.generateRotationTrack(e.modelName,e.R.curves,e.preRotation,e.postRotation,e.eulerOrder);a!==void 0&&t.push(a)}if(e.S!==void 0&&Object.keys(e.S.curves).length>0){const a=this.generateVectorTrack(e.modelName,e.S.curves,i,"scale");a!==void 0&&t.push(a)}if(e.DeformPercent!==void 0){const a=this.generateMorphTrack(e);a!==void 0&&t.push(a)}return t}generateVectorTrack(e,t,s,i){const a=this.getTimesForAllAxes(t),n=this.getKeyframeTrackValues(a,t,s);return new Cs(e+"."+i,a,n)}generateRotationTrack(e,t,s,i,a){let n,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,a);n=d[0],r=d[1]}const A=Ui(0);s!==void 0&&(s=s.map(be.degToRad),s.push(A),s=new Gt().fromArray(s),s=new we().setFromEuler(s)),i!==void 0&&(i=i.map(be.degToRad),i.push(A),i=new Gt().fromArray(i),i=new we().setFromEuler(i).invert());const c=new we,l=new Gt,h=[];if(!(!r||!n)){for(let d=0;d<r.length;d+=3)l.set(r[d],r[d+1],r[d+2],a),c.setFromEuler(l),s!==void 0&&c.premultiply(s),i!==void 0&&c.multiply(i),d>2&&new we().fromArray(h,(d-3)/3*4).dot(c)<0&&c.set(-c.x,-c.y,-c.z,-c.w),c.toArray(h,d/3*4);return new ws(e+".quaternion",n,h)}}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,s=t.values.map(function(a){return a/100}),i=We.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new Bs(e.modelName+".morphTargetInfluences["+i+"]",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,i){return s-i}),t.length>1){let s=1,i=t[0];for(let a=1;a<t.length;a++){const n=t[a];n!==i&&(t[s]=n,i=n,s++)}t=t.slice(0,s)}return t}getKeyframeTrackValues(e,t,s){const i=s,a=[];let n=-1,r=-1,A=-1;return e.forEach(function(c){if(t.x&&(n=t.x.times.indexOf(c)),t.y&&(r=t.y.times.indexOf(c)),t.z&&(A=t.z.times.indexOf(c)),n!==-1){const l=t.x.values[n];a.push(l),i[0]=l}else a.push(i[0]);if(r!==-1){const l=t.y.values[r];a.push(l),i[1]=l}else a.push(i[1]);if(A!==-1){const l=t.z.values[A];a.push(l),i[2]=l}else a.push(i[2])}),a}interpolateRotations(e,t,s,i){const a=[],n=[];a.push(e.times[0]),n.push(be.degToRad(e.values[0])),n.push(be.degToRad(t.values[0])),n.push(be.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 c=A.map(be.degToRad),l=[e.values[r],t.values[r],s.values[r]];if(isNaN(l[0])||isNaN(l[1])||isNaN(l[2]))continue;const h=l.map(be.degToRad),d=[l[0]-A[0],l[1]-A[1],l[2]-A[2]],p=[Math.abs(d[0]),Math.abs(d[1]),Math.abs(d[2])];if(p[0]>=180||p[1]>=180||p[2]>=180){const f=Math.max(...p)/180,b=new Gt(...c,i),u=new Gt(...h,i),I=new we().setFromEuler(b),C=new we().setFromEuler(u);I.dot(C)&&C.set(-C.x,-C.y,-C.z,-C.w);const E=e.times[r-1],y=e.times[r]-E,w=new we,x=new Gt;for(let D=0;D<1;D+=1/f)w.copy(I.clone().slerp(C.clone(),D)),a.push(E+D*y),x.setFromQuaternion(w,i),n.push(x.x),n.push(x.y),n.push(x.z)}else a.push(e.times[r]),n.push(be.degToRad(e.values[r])),n.push(be.degToRad(t.values[r])),n.push(be.degToRad(s.values[r]))}return[a,n]}}class Vl{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 To,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,s=e.split(/[\r\n]+/);return s.forEach(function(i,a){const n=i.match(/^[\s\t]*;/),r=i.match(/^[\s\t]*$/);if(n||r)return;const A=i.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),c=i.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=i.match("^\\t{"+(t.currentIndent-1)+"}}");A?t.parseNodeBegin(i,A):c?t.parseNodeProperty(i,c,s[++a]):l?t.popStack():i.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(i)}),this.allNodes}parseNodeBegin(e,t){const s=t[1].trim().replace(/^"/,"").replace(/"$/,""),i=t[2].split(",").map(function(A){return A.trim().replace(/^"/,"").replace(/"$/,"")}),a={name:s},n=this.parseNodeAttr(i),r=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(s,a):s in r?(s==="PoseNode"?r.PoseNode.push(a):r[s].id!==void 0&&(r[s]={},r[s][r[s].id]=r[s]),n.id!==""&&(r[s][n.id]=a)):typeof n.id=="number"?(r[s]={},r[s][n.id]=a):s!=="Properties70"&&(s==="PoseNode"?r[s]=[a]:r[s]=a),typeof n.id=="number"&&(a.id=n.id),n.name!==""&&(a.attrName=n.name),n.type!==""&&(a.attrType=n.type),this.pushStack(a)}parseNodeAttr(e){let t=e[0];e[0]!==""&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let s="",i="";return e.length>1&&(s=e[1].replace(/^(\w+)::/,""),i=e[2]),{id:t,name:s,type:i}}parseNodeProperty(e,t,s){let i=t[1].replace(/^"/,"").replace(/"$/,"").trim(),a=t[2].replace(/^"/,"").replace(/"$/,"").trim();i==="Content"&&a===","&&(a=s.replace(/"/g,"").replace(/,$/,"").trim());const n=this.getCurrentNode();if(n.name==="Properties70"){this.parseNodeSpecialProperty(e,i,a);return}if(i==="C"){const r=a.split(",").slice(1),A=parseInt(r[0]),c=parseInt(r[1]);let l=a.split(",").slice(3);l=l.map(function(h){return h.trim().replace(/^"/,"")}),i="connections",a=[A,c],ih(a,l),n[i]===void 0&&(n[i]=[])}i==="Node"&&(n.id=a),i in n&&Array.isArray(n[i])?n[i].push(a):i!=="a"?n[i]=a:n.a=a,this.setCurrentProp(n,i),i==="a"&&a.slice(-1)!==","&&(n.a=Qa(a))}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,e.slice(-1)!==","&&(t.a=Qa(t.a))}parseNodeSpecialProperty(e,t,s){const i=s.split('",').map(function(l){return l.trim().replace(/^\"/,"").replace(/\s/,"_")}),a=i[0],n=i[1],r=i[2],A=i[3];let c=i[4];switch(n){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":c=parseFloat(c);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":c=Qa(c);break}this.getPrevNode()[a]={type:n,type2:r,flag:A,value:c},this.setCurrentProp(this.getPrevNode(),a)}}class Xl{parse(e){const t=new Do(e);t.skip(23);const s=t.getUint32();if(s<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+s);const i=new To;for(;!this.endOfContent(t);){const a=this.parseNode(t,s);a!==null&&i.add(a.name,a)}return i}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={},i=t>=7500?e.getUint64():e.getUint32(),a=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const n=e.getUint8(),r=e.getString(n);if(i===0)return null;const A=[];for(let d=0;d<a;d++)A.push(this.parseProperty(e));const c=A.length>0?A[0]:"",l=A.length>1?A[1]:"",h=A.length>2?A[2]:"";for(s.singleProperty=a===1&&e.getOffset()===i;i>e.getOffset();){const d=this.parseNode(e,t);d!==null&&this.parseSubNode(r,s,d)}return s.propertyList=A,typeof c=="number"&&(s.id=c),l!==""&&(s.attrName=l),h!==""&&(s.attrType=h),r!==""&&(s.name=r),s}parseSubNode(e,t,s){if(s.singleProperty===!0){const i=s.propertyList[0];Array.isArray(i)?(t[s.name]=s,s.a=i):t[s.name]=i}else if(e==="Connections"&&s.name==="C"){const i=[];s.propertyList.forEach(function(a,n){n!==0&&i.push(a)}),t.connections===void 0&&(t.connections=[]),t.connections.push(i)}else if(s.name==="Properties70")Object.keys(s).forEach(function(i){t[i]=s[i]});else if(e==="Properties70"&&s.name==="P"){let i=s.propertyList[0],a=s.propertyList[1];const n=s.propertyList[2],r=s.propertyList[3];let A;i.indexOf("Lcl ")===0&&(i=i.replace("Lcl ","Lcl_")),a.indexOf("Lcl ")===0&&(a=a.replace("Lcl ","Lcl_")),a==="Color"||a==="ColorRGB"||a==="Vector"||a==="Vector3D"||a.indexOf("Lcl_")===0?A=[s.propertyList[4],s.propertyList[5],s.propertyList[6]]:A=s.propertyList[4],t[i]={type:a,type2:n,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 i=e.getUint32(),a=e.getUint32(),n=e.getUint32();if(a===0)switch(t){case"b":case"c":return e.getBooleanArray(i);case"d":return e.getFloat64Array(i);case"f":return e.getFloat32Array(i);case"i":return e.getInt32Array(i);case"l":return e.getInt64Array(i)}const r=Si(new Uint8Array(e.getArrayBuffer(n))),A=new Do(r.buffer);switch(t){case"b":case"c":return A.getBooleanArray(i);case"d":return A.getFloat64Array(i);case"f":return A.getFloat32Array(i);case"i":return A.getInt32Array(i);case"l":return A.getInt64Array(i)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class Do{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 i=s.indexOf(0);return i>=0&&(s=new Uint8Array(this.dv.buffer,t,i)),this._textDecoder.decode(s)}}class To{add(e,t){this[e]=t}}function Zl(o){const e="Kaydara FBX Binary \0";return o.byteLength>=e.length&&e===_o(o,0,e.length)}function $l(o){const e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let t=0;function s(i){const a=o[i-1];return o=o.slice(t+i),t++,a}for(let i=0;i<e.length;++i)if(s(1)===e[i])return!1;return!0}function Ro(o){const e=/FBXVersion: (\d+)/,t=o.match(e);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function eh(o){return o/46186158e3}const th=[];function As(o,e,t,s){let i;switch(s.mappingType){case"ByPolygonVertex":i=o;break;case"ByPolygon":i=e;break;case"ByVertice":i=t;break;case"AllSame":i=s.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+s.mappingType)}s.referenceType==="IndexToDirect"&&(i=s.indices[i]);const a=i*s.dataSize,n=a+s.dataSize;return sh(th,s.buffer,a,n)}const ya=new Gt,li=new F;function Mo(o){const e=new re,t=new re,s=new re,i=new re,a=new re,n=new re,r=new re,A=new re,c=new re,l=new re,h=new re,d=new re,p=o.inheritType?o.inheritType:0;o.translation&&e.setPosition(li.fromArray(o.translation));const f=Ui(0);if(o.preRotation){const W=o.preRotation.map(be.degToRad);W.push(f),t.makeRotationFromEuler(ya.fromArray(W))}if(o.rotation){const W=o.rotation.map(be.degToRad);W.push(o.eulerOrder||f),s.makeRotationFromEuler(ya.fromArray(W))}if(o.postRotation){const W=o.postRotation.map(be.degToRad);W.push(f),i.makeRotationFromEuler(ya.fromArray(W)),i.invert()}o.scale&&a.scale(li.fromArray(o.scale)),o.scalingOffset&&r.setPosition(li.fromArray(o.scalingOffset)),o.scalingPivot&&n.setPosition(li.fromArray(o.scalingPivot)),o.rotationOffset&&A.setPosition(li.fromArray(o.rotationOffset)),o.rotationPivot&&c.setPosition(li.fromArray(o.rotationPivot)),o.parentMatrixWorld&&(h.copy(o.parentMatrix),l.copy(o.parentMatrixWorld));const b=t.clone().multiply(s).multiply(i),u=new re;u.extractRotation(l);const I=new re;I.copyPosition(l);const C=I.clone().invert().multiply(l),E=u.clone().invert().multiply(C),y=a,w=new re;if(p===0)w.copy(u).multiply(b).multiply(E).multiply(y);else if(p===1)w.copy(u).multiply(E).multiply(b).multiply(y);else{const W=new re().scale(new F().setFromMatrixScale(h)).clone().invert(),K=E.clone().multiply(W);w.copy(u).multiply(b).multiply(K).multiply(y)}const x=c.clone().invert(),D=n.clone().invert();let S=e.clone().multiply(A).multiply(c).multiply(t).multiply(s).multiply(i).multiply(x).multiply(r).multiply(n).multiply(a).multiply(D);const L=new re().copyPosition(S),Y=l.clone().multiply(L);return d.copyPosition(Y),S=d.clone().multiply(w),S.premultiply(l.invert()),S}function Ui(o){o=o||0;const e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return o===6?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[o]}function Qa(o){return o.split(",").map(function(e){return parseFloat(e)})}function _o(o,e,t){return e===void 0&&(e=0),t===void 0&&(t=o.byteLength),new TextDecoder().decode(new Uint8Array(o,e,t))}function ih(o,e){for(let t=0,s=o.length,i=e.length;t<i;t++,s++)o[s]=e[t]}function sh(o,e,t,s){for(let i=t,a=0;i<s;i++,a++)o[a]=e[i];return o}class ah extends St{constructor(e){super(e)}load(e,t,s,i){const a=this,n=this.path===""?Yt.extractUrlBase(e):this.path,r=new gt(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(A){try{t(a.parse(A,n))}catch(c){i?i(c):console.error(c),a.manager.itemError(e)}},s,i)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const s=e.split(`
|
|
747
|
+
`);let i={};const a=/\s+/,n={};for(let A=0;A<s.length;A++){let c=s[A];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const l=c.indexOf(" ");let h=l>=0?c.substring(0,l):c;h=h.toLowerCase();let d=l>=0?c.substring(l+1):"";if(d=d.trim(),h==="newmtl")i={name:d},n[d]=i;else if(h==="ka"||h==="kd"||h==="ks"||h==="ke"){const p=d.split(a,3);i[h]=[parseFloat(p[0]),parseFloat(p[1]),parseFloat(p[2])]}else i[h]=d}const r=new nh(this.resourcePath||t,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(n),r}}class nh{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:Ga,this.wrap=this.options.wrap!==void 0?this.options.wrap:Kt}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 i=e[s],a={};t[s]=a;for(const n in i){let r=!0,A=i[n];const c=n.toLowerCase();switch(c){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&&(a[c]=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],i={name:e,side:this.side};function a(r,A){return typeof A!="string"||A===""?"":/^https?:\/\//i.test(A)?A:r+A}function n(r,A){if(i[r])return;const c=t.getTextureParams(A,i),l=t.loadTexture(a(t.baseUrl,c.url));l.repeat.copy(c.scale),l.offset.copy(c.offset),l.wrapS=t.wrap,l.wrapT=t.wrap,(r==="map"||r==="emissiveMap")&&(l.colorSpace=le),i[r]=l}for(const r in s){const A=s[r];let c;if(A!=="")switch(r.toLowerCase()){case"kd":i.color=Xe.toWorkingColorSpace(new Be().fromArray(A),le);break;case"ks":i.specular=Xe.toWorkingColorSpace(new Be().fromArray(A),le);break;case"ke":i.emissive=Xe.toWorkingColorSpace(new Be().fromArray(A),le);break;case"map_kd":n("map",A);break;case"map_ks":n("specularMap",A);break;case"map_ke":n("emissiveMap",A);break;case"norm":n("normalMap",A);break;case"map_bump":case"bump":n("bumpMap",A);break;case"map_d":n("alphaMap",A),i.transparent=!0;break;case"ns":i.shininess=parseFloat(A);break;case"d":c=parseFloat(A),c<1&&(i.opacity=c,i.transparent=!0);break;case"tr":c=parseFloat(A),this.options&&this.options.invertTrProperty&&(c=1-c),c>0&&(i.opacity=1-c,i.transparent=!0);break}}return this.materials[e]=new Ei(i),this.materials[e]}getTextureParams(e,t){const s={scale:new Re(1,1),offset:new Re(0,0)},i=e.split(/\s+/);let a;return a=i.indexOf("-bm"),a>=0&&(t.bumpScale=parseFloat(i[a+1]),i.splice(a,2)),a=i.indexOf("-s"),a>=0&&(s.scale.set(parseFloat(i[a+1]),parseFloat(i[a+2])),i.splice(a,4)),a=i.indexOf("-o"),a>=0&&(s.offset.set(parseFloat(i[a+1]),parseFloat(i[a+2])),i.splice(a,4)),s.url=i.join(" ").trim(),s}loadTexture(e,t,s,i,a){const n=this.manager!==void 0?this.manager:Fr;let r=n.getHandler(e);r===null&&(r=new us(n)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const A=r.load(e,s,i,a);return t!==void 0&&(A.mapping=t),A}}const oh=/^[og]\s*(.+)?/,rh=/^mtllib /,Ah=/^usemtl /,ch=/^usemap /,Lo=/\s+/,ko=new F,va=new F,Fo=new F,No=new F,ct=new F,cs=new Be;function lh(){const o={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(i,a){const n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);const r={index:this.materials.length,name:i||"",mtllib:Array.isArray(a)&&a.length>0?a[a.length-1]:"",smooth:n!==void 0?n.smooth:this.smooth,groupStart:n!==void 0?n.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(A){const c={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 c.clone=this.clone.bind(c),c}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const a=this.currentMaterial();if(a&&a.groupEnd===-1&&(a.groupEnd=this.geometry.vertices.length/3,a.groupCount=a.groupEnd-a.groupStart,a.inherited=!1),i&&this.materials.length>1)for(let n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),a}},s&&s.name&&typeof s.clone=="function"){const i=s.clone(0);i.inherited=!0,this.object.materials.push(i)}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 i=this.vertices,a=this.object.geometry.vertices;a.push(i[e+0],i[e+1],i[e+2]),a.push(i[t+0],i[t+1],i[t+2]),a.push(i[s+0],i[s+1],i[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 i=this.normals,a=this.object.geometry.normals;a.push(i[e+0],i[e+1],i[e+2]),a.push(i[t+0],i[t+1],i[t+2]),a.push(i[s+0],i[s+1],i[s+2])},addFaceNormal:function(e,t,s){const i=this.vertices,a=this.object.geometry.normals;ko.fromArray(i,e),va.fromArray(i,t),Fo.fromArray(i,s),ct.subVectors(Fo,va),No.subVectors(ko,va),ct.cross(No),ct.normalize(),a.push(ct.x,ct.y,ct.z),a.push(ct.x,ct.y,ct.z),a.push(ct.x,ct.y,ct.z)},addColor:function(e,t,s){const i=this.colors,a=this.object.geometry.colors;i[e]!==void 0&&a.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&a.push(i[t+0],i[t+1],i[t+2]),i[s]!==void 0&&a.push(i[s+0],i[s+1],i[s+2])},addUV:function(e,t,s){const i=this.uvs,a=this.object.geometry.uvs;a.push(i[e+0],i[e+1]),a.push(i[t+0],i[t+1]),a.push(i[s+0],i[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,i,a,n,r,A,c){const l=this.vertices.length;let h=this.parseVertexIndex(e,l),d=this.parseVertexIndex(t,l),p=this.parseVertexIndex(s,l);if(this.addVertex(h,d,p),this.addColor(h,d,p),r!==void 0&&r!==""){const f=this.normals.length;h=this.parseNormalIndex(r,f),d=this.parseNormalIndex(A,f),p=this.parseNormalIndex(c,f),this.addNormal(h,d,p)}else this.addFaceNormal(h,d,p);if(i!==void 0&&i!==""){const f=this.uvs.length;h=this.parseUVIndex(i,f),d=this.parseUVIndex(a,f),p=this.parseUVIndex(n,f),this.addUV(h,d,p),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,i=e.length;s<i;s++){const a=this.parseVertexIndex(e[s],t);this.addVertexPoint(a),this.addColor(a)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const s=this.vertices.length,i=this.uvs.length;for(let a=0,n=e.length;a<n;a++)this.addVertexLine(this.parseVertexIndex(e[a],s));for(let a=0,n=t.length;a<n;a++)this.addUVLine(this.parseUVIndex(t[a],i))}};return o.startObject("",!1),o}class hh extends St{constructor(e){super(e),this.materials=null,this.materialsLoader=new ah(e)}load(e,t,s,i){const a=this,n=new gt(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,async function(r){try{const A=a.parse(r,!0);for(let c=0,l=A.materialLibraries.length;c<l;c++){const h=A.materialLibraries[c];if(!h||typeof h!="string"||h.trim()===""){console.warn("THREE.OBJLoader: Invalid or empty material library reference, skipping.");continue}const d=e.startsWith("blob:")?e+"/"+h:new URL(h,e);console.debug("Loading MTL file: "+d),await new Promise((p,f)=>{a.materialsLoader.load(d.toString(),b=>{a.setMaterials(b),p()},null,f)})}t(a.createObjects(A))}catch(A){i?i(A):console.error(A),a.manager.itemError(e)}},s,i)}setMTLLoader(e){return this.materialsLoader=e,this}setMaterials(e){return this.materials=e,this}parse(e,t=!1){const s=new lh;e.indexOf(`\r
|
|
461
748
|
`)!==-1&&(e=e.replace(/\r\n/g,`
|
|
462
749
|
`)),e.indexOf(`\\
|
|
463
|
-
`)!==-1&&(e=e.replace(/\\\n/g,""));const
|
|
464
|
-
`);let
|
|
750
|
+
`)!==-1&&(e=e.replace(/\\\n/g,""));const i=e.split(`
|
|
751
|
+
`);let a=[];for(let n=0,r=i.length;n<r;n++){const A=i[n].trimStart();if(A.length===0)continue;const c=A.charAt(0);if(c!=="#")if(c==="v"){const l=A.split(Lo);switch(l[0]){case"v":s.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])),l.length>=7?(cs.setRGB(parseFloat(l[4]),parseFloat(l[5]),parseFloat(l[6]),le),s.colors.push(cs.r,cs.g,cs.b)):s.colors.push(void 0,void 0,void 0);break;case"vn":s.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));break;case"vt":s.uvs.push(parseFloat(l[1]),parseFloat(l[2]));break}}else if(c==="f"){const l=A.slice(1).trim().split(Lo),h=[];for(let p=0,f=l.length;p<f;p++){const b=l[p];if(b.length>0){const u=b.split("/");h.push(u)}}const d=h[0];for(let p=1,f=h.length-1;p<f;p++){const b=h[p],u=h[p+1];s.addFace(d[0],b[0],u[0],d[1],b[1],u[1],d[2],b[2],u[2])}}else if(c==="l"){const l=A.substring(1).trim().split(" ");let h=[];const d=[];if(A.indexOf("/")===-1)h=l;else for(let p=0,f=l.length;p<f;p++){const b=l[p].split("/");b[0]!==""&&h.push(b[0]),b[1]!==""&&d.push(b[1])}s.addLineGeometry(h,d)}else if(c==="p"){const l=A.slice(1).trim().split(" ");s.addPointGeometry(l)}else if((a=oh.exec(A))!==null){const l=(" "+a[0].slice(1).trim()).slice(1);s.startObject(l)}else if(Ah.test(A))s.object.startMaterial(A.substring(7).trim(),s.materialLibraries);else if(rh.test(A))s.materialLibraries.push(A.substring(7).trim());else if(ch.test(A))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(c==="s"){if(a=A.split(" "),a.length>1){const h=a[1].trim().toLowerCase();s.object.smooth=h!=="0"&&h!=="off"}else s.object.smooth=!0;const l=s.object.currentMaterial();l&&(l.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 Tt;if(t.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0))for(let s=0,i=e.objects.length;s<i;s++){const a=e.objects[s],n=a.geometry,r=a.materials,A=n.type==="Line",c=n.type==="Points";let l=!1;if(n.vertices.length===0)continue;const h=new at;h.setAttribute("position",new Me(n.vertices,3)),n.normals.length>0&&h.setAttribute("normal",new Me(n.normals,3)),n.colors.length>0&&(l=!0,h.setAttribute("color",new Me(n.colors,3))),n.hasUVIndices===!0&&h.setAttribute("uv",new Me(n.uvs,2));const d=[];for(let f=0,b=r.length;f<b;f++){const u=r[f],I=u.name+"_"+u.smooth+"_"+l;let C=e.materials[I];if(this.materials!==null){if(C=this.materials.create(u.name),A&&C&&!(C instanceof Et)){const E=new Et;ui.prototype.copy.call(E,C),E.color.copy(C.color),C=E}else if(c&&C&&!(C instanceof pi)){const E=new pi({size:10,sizeAttenuation:!1});ui.prototype.copy.call(E,C),E.color.copy(C.color),E.map=C.map,C=E}}C===void 0&&(A?C=new Et:c?C=new pi({size:1,sizeAttenuation:!1}):C=new Ei,C.name=u.name,C.flatShading=!u.smooth,C.vertexColors=l,e.materials[I]=C),d.push(C)}let p;if(d.length>1){for(let f=0,b=r.length;f<b;f++){const u=r[f];h.addGroup(u.groupStart,u.groupCount,f)}A?p=new fi(h,d):c?p=new ji(h,d):p=new O(h,d)}else A?p=new fi(h,d[0]):c?p=new ji(h,d[0]):p=new O(h,d[0]);p.name=a.name,t.add(p)}else if(e.vertices.length>0){const s=new pi({size:1,sizeAttenuation:!1}),i=new at;i.setAttribute("position",new Me(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(i.setAttribute("color",new Me(e.colors,3)),s.vertexColors=!0);const a=new ji(i,s);t.add(a)}return t}}class gh{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 Fa(-1,1,1,-1,0,1);class dh extends at{constructor(){super(),this.setAttribute("position",new Me([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Me([0,2,0,0,2,0],2))}}new dh;export{Rl as CSM,Ml as CSMHelper,EA as DRACOLoader,uc as EXRLoader,Yl as FBXLoader,Ln as Font,JA as FontLoader,ha as GLTFExporter,_s as GLTFLoader,Nr as GroundedSkybox,_l as HTMLMesh,Oc as HorizontalBlurShader,Fl as InteractiveGroup,lt as KTX2Loader,Dl as Line2,Co as LineGeometry,pa as LineMaterial,IA as MeshoptDecoder,hh as OBJLoader,xc as OrbitControls,gh as Pass,Gc as PositionalAudioHelper,fc as RGBELoader,yi as Stats,KA as TextGeometry,mc as TransformControls,to as TransformControlsGizmo,Nl as VertexNormalsHelper,Hc as VerticalBlurShader,wl as XRControllerModelFactory,Ql as XRHandMeshModel,Ur as mergeVertices,_n as nodeFrame,aa as strToU8,pc as zipSync};
|