arize-phoenix 8.13.1__py3-none-any.whl → 8.14.0__py3-none-any.whl
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.
Potentially problematic release.
This version of arize-phoenix might be problematic. Click here for more details.
- {arize_phoenix-8.13.1.dist-info → arize_phoenix-8.14.0.dist-info}/METADATA +12 -36
- {arize_phoenix-8.13.1.dist-info → arize_phoenix-8.14.0.dist-info}/RECORD +18 -18
- phoenix/server/api/helpers/playground_clients.py +23 -7
- phoenix/server/static/.vite/manifest.json +45 -45
- phoenix/server/static/assets/{components-DvgP87AK.js → components-E6p--qL4.js} +553 -553
- phoenix/server/static/assets/{index-CLClYeDh.js → index-BZg1KoYU.js} +10 -10
- phoenix/server/static/assets/{pages-BnuKGq5F.js → pages-BsPyKRtU.js} +537 -533
- phoenix/server/static/assets/vendor-BT2CVKel.js +905 -0
- phoenix/server/static/assets/{vendor-arizeai-bw-hz0cw.js → vendor-arizeai-Dzsaenki.js} +2 -2
- phoenix/server/static/assets/vendor-codemirror-D2R3PB3i.js +33 -0
- phoenix/server/static/assets/{vendor-recharts-BMT-13Pz.js → vendor-recharts-DetvdWCF.js} +2 -2
- phoenix/server/static/assets/{vendor-shiki-CevgDqNV.js → vendor-shiki-dzrzjP7E.js} +1 -1
- phoenix/server/static/assets/{vendor-three-C-AGeJYv.js → vendor-three-C5WAXd5r.js} +1 -1
- phoenix/version.py +1 -1
- phoenix/server/static/assets/vendor-CwOvppSU.js +0 -902
- phoenix/server/static/assets/vendor-codemirror-Du5cjwoZ.js +0 -24
- {arize_phoenix-8.13.1.dist-info → arize_phoenix-8.14.0.dist-info}/WHEEL +0 -0
- {arize_phoenix-8.13.1.dist-info → arize_phoenix-8.14.0.dist-info}/entry_points.txt +0 -0
- {arize_phoenix-8.13.1.dist-info → arize_phoenix-8.14.0.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-8.13.1.dist-info → arize_phoenix-8.14.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -2995,4 +2995,4 @@ void main() {
|
|
|
2995
2995
|
squared_mean = squared_mean / samples;
|
|
2996
2996
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
2997
2997
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
2998
|
-
}`;function Nu(s,e,t){let n=new Qr;const i=new Z,r=new Z,o=new qe,a=new yo({depthPacking:uu}),l=new _o,c={},h=t.maxTextureSize,u={0:Pt,1:hi,2:ui},d=new zt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Z},radius:{value:4}},vertexShader:e0,fragmentShader:t0}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const g=new ye;g.setAttribute("position",new Oe(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const p=new ht(g,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ka,this.render=function(_,b,A){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||_.length===0)return;const R=s.getRenderTarget(),P=s.getActiveCubeFace(),H=s.getActiveMipmapLevel(),I=s.state;I.setBlending(pn),I.buffers.color.setClear(1,1,1,1),I.buffers.depth.setTest(!0),I.setScissorTest(!1);for(let v=0,C=_.length;v<C;v++){const j=_[v],F=j.shadow;if(F===void 0){console.warn("THREE.WebGLShadowMap:",j,"has no shadow.");continue}if(F.autoUpdate===!1&&F.needsUpdate===!1)continue;i.copy(F.mapSize);const U=F.getFrameExtents();if(i.multiply(U),r.copy(F.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(r.x=Math.floor(h/U.x),i.x=r.x*U.x,F.mapSize.x=r.x),i.y>h&&(r.y=Math.floor(h/U.y),i.y=r.y*U.y,F.mapSize.y=r.y)),F.map===null&&!F.isPointLightShadow&&this.type===Ji&&(F.map=new St(i.x,i.y),F.map.texture.name=j.name+".shadowMap",F.mapPass=new St(i.x,i.y),F.camera.updateProjectionMatrix()),F.map===null){const k={minFilter:ct,magFilter:ct,format:Lt};F.map=new St(i.x,i.y,k),F.map.texture.name=j.name+".shadowMap",F.camera.updateProjectionMatrix()}s.setRenderTarget(F.map),s.clear();const N=F.getViewportCount();for(let k=0;k<N;k++){const D=F.getViewport(k);o.set(r.x*D.x,r.y*D.y,r.x*D.z,r.y*D.w),I.viewport(o),F.updateMatrices(j,k),n=F.getFrustum(),M(b,A,F.camera,j,this.type)}!F.isPointLightShadow&&this.type===Ji&&x(F,A),F.needsUpdate=!1}m.needsUpdate=!1,s.setRenderTarget(R,P,H)};function x(_,b){const A=e.update(p);d.defines.VSM_SAMPLES!==_.blurSamples&&(d.defines.VSM_SAMPLES=_.blurSamples,f.defines.VSM_SAMPLES=_.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),d.uniforms.shadow_pass.value=_.map.texture,d.uniforms.resolution.value=_.mapSize,d.uniforms.radius.value=_.radius,s.setRenderTarget(_.mapPass),s.clear(),s.renderBufferDirect(b,null,A,d,p,null),f.uniforms.shadow_pass.value=_.mapPass.texture,f.uniforms.resolution.value=_.mapSize,f.uniforms.radius.value=_.radius,s.setRenderTarget(_.map),s.clear(),s.renderBufferDirect(b,null,A,f,p,null)}function y(_,b,A,R,P,H){let I=null;const v=A.isPointLight===!0?_.customDistanceMaterial:_.customDepthMaterial;if(v!==void 0?I=v:I=A.isPointLight===!0?l:a,s.localClippingEnabled&&b.clipShadows===!0&&b.clippingPlanes.length!==0||b.displacementMap&&b.displacementScale!==0||b.alphaMap&&b.alphaTest>0){const C=I.uuid,j=b.uuid;let F=c[C];F===void 0&&(F={},c[C]=F);let U=F[j];U===void 0&&(U=I.clone(),F[j]=U),I=U}return I.visible=b.visible,I.wireframe=b.wireframe,H===Ji?I.side=b.shadowSide!==null?b.shadowSide:b.side:I.side=b.shadowSide!==null?b.shadowSide:u[b.side],I.alphaMap=b.alphaMap,I.alphaTest=b.alphaTest,I.clipShadows=b.clipShadows,I.clippingPlanes=b.clippingPlanes,I.clipIntersection=b.clipIntersection,I.displacementMap=b.displacementMap,I.displacementScale=b.displacementScale,I.displacementBias=b.displacementBias,I.wireframeLinewidth=b.wireframeLinewidth,I.linewidth=b.linewidth,A.isPointLight===!0&&I.isMeshDistanceMaterial===!0&&(I.referencePosition.setFromMatrixPosition(A.matrixWorld),I.nearDistance=R,I.farDistance=P),I}function M(_,b,A,R,P){if(_.visible===!1)return;if(_.layers.test(b.layers)&&(_.isMesh||_.isLine||_.isPoints)&&(_.castShadow||_.receiveShadow&&P===Ji)&&(!_.frustumCulled||n.intersectsObject(_))){_.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,_.matrixWorld);const v=e.update(_),C=_.material;if(Array.isArray(C)){const j=v.groups;for(let F=0,U=j.length;F<U;F++){const N=j[F],k=C[N.materialIndex];if(k&&k.visible){const D=y(_,k,R,A.near,A.far,P);s.renderBufferDirect(A,null,v,D,_,N)}}}else if(C.visible){const j=y(_,C,R,A.near,A.far,P);s.renderBufferDirect(A,null,v,j,_,null)}}const I=_.children;for(let v=0,C=I.length;v<C;v++)M(I[v],b,A,R,P)}}function n0(s,e,t){const n=t.isWebGL2;function i(){let L=!1;const oe=new qe;let re=null;const Me=new qe(0,0,0,0);return{setMask:function(ue){re!==ue&&!L&&(s.colorMask(ue,ue,ue,ue),re=ue)},setLocked:function(ue){L=ue},setClear:function(ue,be,ie,Ee,Ze){Ze===!0&&(ue*=Ee,be*=Ee,ie*=Ee),oe.set(ue,be,ie,Ee),Me.equals(oe)===!1&&(s.clearColor(ue,be,ie,Ee),Me.copy(oe))},reset:function(){L=!1,re=null,Me.set(-1,0,0,0)}}}function r(){let L=!1,oe=null,re=null,Me=null;return{setTest:function(ue){ue?Se(2929):q(2929)},setMask:function(ue){oe!==ue&&!L&&(s.depthMask(ue),oe=ue)},setFunc:function(ue){if(re!==ue){if(ue)switch(ue){case Ph:s.depthFunc(512);break;case Ih:s.depthFunc(519);break;case Dh:s.depthFunc(513);break;case no:s.depthFunc(515);break;case Fh:s.depthFunc(514);break;case Bh:s.depthFunc(518);break;case Nh:s.depthFunc(516);break;case zh:s.depthFunc(517);break;default:s.depthFunc(515)}else s.depthFunc(515);re=ue}},setLocked:function(ue){L=ue},setClear:function(ue){Me!==ue&&(s.clearDepth(ue),Me=ue)},reset:function(){L=!1,oe=null,re=null,Me=null}}}function o(){let L=!1,oe=null,re=null,Me=null,ue=null,be=null,ie=null,Ee=null,Ze=null;return{setTest:function(Ue){L||(Ue?Se(2960):q(2960))},setMask:function(Ue){oe!==Ue&&!L&&(s.stencilMask(Ue),oe=Ue)},setFunc:function(Ue,Jt,Yt){(re!==Ue||Me!==Jt||ue!==Yt)&&(s.stencilFunc(Ue,Jt,Yt),re=Ue,Me=Jt,ue=Yt)},setOp:function(Ue,Jt,Yt){(be!==Ue||ie!==Jt||Ee!==Yt)&&(s.stencilOp(Ue,Jt,Yt),be=Ue,ie=Jt,Ee=Yt)},setLocked:function(Ue){L=Ue},setClear:function(Ue){Ze!==Ue&&(s.clearStencil(Ue),Ze=Ue)},reset:function(){L=!1,oe=null,re=null,Me=null,ue=null,be=null,ie=null,Ee=null,Ze=null}}}const a=new i,l=new r,c=new o;let h={},u={},d=new WeakMap,f=[],g=null,p=!1,m=null,x=null,y=null,M=null,_=null,b=null,A=null,R=!1,P=null,H=null,I=null,v=null,C=null;const j=s.getParameter(35661);let F=!1,U=0;const N=s.getParameter(7938);N.indexOf("WebGL")!==-1?(U=parseFloat(/^WebGL (\d)/.exec(N)[1]),F=U>=1):N.indexOf("OpenGL ES")!==-1&&(U=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),F=U>=2);let k=null,D={};const X=s.getParameter(3088),$=s.getParameter(2978),te=new qe().fromArray(X),K=new qe().fromArray($);function ge(L,oe,re){const Me=new Uint8Array(4),ue=s.createTexture();s.bindTexture(L,ue),s.texParameteri(L,10241,9728),s.texParameteri(L,10240,9728);for(let be=0;be<re;be++)s.texImage2D(oe+be,0,6408,1,1,0,6408,5121,Me);return ue}const ze={};ze[3553]=ge(3553,3553,1),ze[34067]=ge(34067,34069,6),a.setClear(0,0,0,1),l.setClear(1),c.setClear(0),Se(2929),l.setFunc(no),ee(!1),pe(xa),Se(2884),W(pn);function Se(L){h[L]!==!0&&(s.enable(L),h[L]=!0)}function q(L){h[L]!==!1&&(s.disable(L),h[L]=!1)}function Ve(L,oe){return u[L]!==oe?(s.bindFramebuffer(L,oe),u[L]=oe,n&&(L===36009&&(u[36160]=oe),L===36160&&(u[36009]=oe)),!0):!1}function Ce(L,oe){let re=f,Me=!1;if(L)if(re=d.get(oe),re===void 0&&(re=[],d.set(oe,re)),L.isWebGLMultipleRenderTargets){const ue=L.texture;if(re.length!==ue.length||re[0]!==36064){for(let be=0,ie=ue.length;be<ie;be++)re[be]=36064+be;re.length=ue.length,Me=!0}}else re[0]!==36064&&(re[0]=36064,Me=!0);else re[0]!==1029&&(re[0]=1029,Me=!0);Me&&(t.isWebGL2?s.drawBuffers(re):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(re))}function Re(L){return g!==L?(s.useProgram(L),g=L,!0):!1}const ne={[Kn]:32774,[vh]:32778,[Mh]:32779};if(n)ne[Ma]=32775,ne[ba]=32776;else{const L=e.get("EXT_blend_minmax");L!==null&&(ne[Ma]=L.MIN_EXT,ne[ba]=L.MAX_EXT)}const Be={[bh]:0,[wh]:1,[Sh]:768,[el]:770,[Lh]:776,[Ch]:774,[Th]:772,[Eh]:769,[tl]:771,[Rh]:775,[Ah]:773};function W(L,oe,re,Me,ue,be,ie,Ee){if(L===pn){p===!0&&(q(3042),p=!1);return}if(p===!1&&(Se(3042),p=!0),L!==_h){if(L!==m||Ee!==R){if((x!==Kn||_!==Kn)&&(s.blendEquation(32774),x=Kn,_=Kn),Ee)switch(L){case ri:s.blendFuncSeparate(1,771,1,771);break;case ya:s.blendFunc(1,1);break;case _a:s.blendFuncSeparate(0,769,0,1);break;case va:s.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",L);break}else switch(L){case ri:s.blendFuncSeparate(770,771,1,771);break;case ya:s.blendFunc(770,1);break;case _a:s.blendFuncSeparate(0,769,0,1);break;case va:s.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",L);break}y=null,M=null,b=null,A=null,m=L,R=Ee}return}ue=ue||oe,be=be||re,ie=ie||Me,(oe!==x||ue!==_)&&(s.blendEquationSeparate(ne[oe],ne[ue]),x=oe,_=ue),(re!==y||Me!==M||be!==b||ie!==A)&&(s.blendFuncSeparate(Be[re],Be[Me],Be[be],Be[ie]),y=re,M=Me,b=be,A=ie),m=L,R=null}function Y(L,oe){L.side===ui?q(2884):Se(2884);let re=L.side===Pt;oe&&(re=!re),ee(re),L.blending===ri&&L.transparent===!1?W(pn):W(L.blending,L.blendEquation,L.blendSrc,L.blendDst,L.blendEquationAlpha,L.blendSrcAlpha,L.blendDstAlpha,L.premultipliedAlpha),l.setFunc(L.depthFunc),l.setTest(L.depthTest),l.setMask(L.depthWrite),a.setMask(L.colorWrite);const Me=L.stencilWrite;c.setTest(Me),Me&&(c.setMask(L.stencilWriteMask),c.setFunc(L.stencilFunc,L.stencilRef,L.stencilFuncMask),c.setOp(L.stencilFail,L.stencilZFail,L.stencilZPass)),Te(L.polygonOffset,L.polygonOffsetFactor,L.polygonOffsetUnits),L.alphaToCoverage===!0?Se(32926):q(32926)}function ee(L){P!==L&&(L?s.frontFace(2304):s.frontFace(2305),P=L)}function pe(L){L!==gh?(Se(2884),L!==H&&(L===xa?s.cullFace(1029):L===xh?s.cullFace(1028):s.cullFace(1032))):q(2884),H=L}function ce(L){L!==I&&(F&&s.lineWidth(L),I=L)}function Te(L,oe,re){L?(Se(32823),(v!==oe||C!==re)&&(s.polygonOffset(oe,re),v=oe,C=re)):q(32823)}function ve(L){L?Se(3089):q(3089)}function xe(L){L===void 0&&(L=33984+j-1),k!==L&&(s.activeTexture(L),k=L)}function Ke(L,oe){k===null&&xe();let re=D[k];re===void 0&&(re={type:void 0,texture:void 0},D[k]=re),(re.type!==L||re.texture!==oe)&&(s.bindTexture(L,oe||ze[L]),re.type=L,re.texture=oe)}function Ye(){const L=D[k];L!==void 0&&L.type!==void 0&&(s.bindTexture(L.type,null),L.type=void 0,L.texture=void 0)}function T(){try{s.compressedTexImage2D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function w(){try{s.texSubImage2D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function G(){try{s.texSubImage3D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function Q(){try{s.compressedTexSubImage2D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function le(){try{s.texStorage2D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function he(){try{s.texStorage3D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function _e(){try{s.texImage2D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function V(){try{s.texImage3D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function Le(L){te.equals(L)===!1&&(s.scissor(L.x,L.y,L.z,L.w),te.copy(L))}function Ie(L){K.equals(L)===!1&&(s.viewport(L.x,L.y,L.z,L.w),K.copy(L))}function me(){s.disable(3042),s.disable(2884),s.disable(2929),s.disable(32823),s.disable(3089),s.disable(2960),s.disable(32926),s.blendEquation(32774),s.blendFunc(1,0),s.blendFuncSeparate(1,0,1,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(513),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(519,0,4294967295),s.stencilOp(7680,7680,7680),s.clearStencil(0),s.cullFace(1029),s.frontFace(2305),s.polygonOffset(0,0),s.activeTexture(33984),s.bindFramebuffer(36160,null),n===!0&&(s.bindFramebuffer(36009,null),s.bindFramebuffer(36008,null)),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),h={},k=null,D={},u={},d=new WeakMap,f=[],g=null,p=!1,m=null,x=null,y=null,M=null,_=null,b=null,A=null,R=!1,P=null,H=null,I=null,v=null,C=null,te.set(0,0,s.canvas.width,s.canvas.height),K.set(0,0,s.canvas.width,s.canvas.height),a.reset(),l.reset(),c.reset()}return{buffers:{color:a,depth:l,stencil:c},enable:Se,disable:q,bindFramebuffer:Ve,drawBuffers:Ce,useProgram:Re,setBlending:W,setMaterial:Y,setFlipSided:ee,setCullFace:pe,setLineWidth:ce,setPolygonOffset:Te,setScissorTest:ve,activeTexture:xe,bindTexture:Ke,unbindTexture:Ye,compressedTexImage2D:T,texImage2D:_e,texImage3D:V,texStorage2D:le,texStorage3D:he,texSubImage2D:w,texSubImage3D:G,compressedTexSubImage2D:Q,scissor:Le,viewport:Ie,reset:me}}function i0(s,e,t,n,i,r,o){const a=i.isWebGL2,l=i.maxTextures,c=i.maxCubemapSize,h=i.maxTextureSize,u=i.maxSamples,d=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,f=/OculusBrowser/g.test(navigator.userAgent),g=new WeakMap;let p;const m=new WeakMap;let x=!1;try{x=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(T,w){return x?new OffscreenCanvas(T,w):kr("canvas")}function M(T,w,G,Q){let le=1;if((T.width>Q||T.height>Q)&&(le=Q/Math.max(T.width,T.height)),le<1||w===!0)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap){const he=w?oo:Math.floor,_e=he(le*T.width),V=he(le*T.height);p===void 0&&(p=y(_e,V));const Le=G?y(_e,V):p;return Le.width=_e,Le.height=V,Le.getContext("2d").drawImage(T,0,0,_e,V),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+T.width+"x"+T.height+") to ("+_e+"x"+V+")."),Le}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+T.width+"x"+T.height+")."),T;return T}function _(T){return qa(T.width)&&qa(T.height)}function b(T){return a?!1:T.wrapS!==wt||T.wrapT!==wt||T.minFilter!==ct&&T.minFilter!==it}function A(T,w){return T.generateMipmaps&&w&&T.minFilter!==ct&&T.minFilter!==it}function R(T){s.generateMipmap(T)}function P(T,w,G,Q,le=!1){if(a===!1)return w;if(T!==null){if(s[T]!==void 0)return s[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let he=w;return w===6403&&(G===5126&&(he=33326),G===5131&&(he=33325),G===5121&&(he=33321)),w===33319&&(G===5126&&(he=33328),G===5131&&(he=33327),G===5121&&(he=33323)),w===6408&&(G===5126&&(he=34836),G===5131&&(he=34842),G===5121&&(he=Q===$e&&le===!1?35907:32856),G===32819&&(he=32854),G===32820&&(he=32855)),(he===33325||he===33326||he===33327||he===33328||he===34842||he===34836)&&e.get("EXT_color_buffer_float"),he}function H(T,w,G){return A(T,G)===!0||T.isFramebufferTexture&&T.minFilter!==ct&&T.minFilter!==it?Math.log2(Math.max(w.width,w.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?w.mipmaps.length:1}function I(T){return T===ct||T===io||T===ro?9728:9729}function v(T){const w=T.target;w.removeEventListener("dispose",v),j(w),w.isVideoTexture&&g.delete(w)}function C(T){const w=T.target;w.removeEventListener("dispose",C),U(w)}function j(T){const w=n.get(T);if(w.__webglInit===void 0)return;const G=T.source,Q=m.get(G);if(Q){const le=Q[w.__cacheKey];le.usedTimes--,le.usedTimes===0&&F(T),Object.keys(Q).length===0&&m.delete(G)}n.remove(T)}function F(T){const w=n.get(T);s.deleteTexture(w.__webglTexture);const G=T.source,Q=m.get(G);delete Q[w.__cacheKey],o.memory.textures--}function U(T){const w=T.texture,G=n.get(T),Q=n.get(w);if(Q.__webglTexture!==void 0&&(s.deleteTexture(Q.__webglTexture),o.memory.textures--),T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let le=0;le<6;le++)s.deleteFramebuffer(G.__webglFramebuffer[le]),G.__webglDepthbuffer&&s.deleteRenderbuffer(G.__webglDepthbuffer[le]);else s.deleteFramebuffer(G.__webglFramebuffer),G.__webglDepthbuffer&&s.deleteRenderbuffer(G.__webglDepthbuffer),G.__webglMultisampledFramebuffer&&s.deleteFramebuffer(G.__webglMultisampledFramebuffer),G.__webglColorRenderbuffer&&s.deleteRenderbuffer(G.__webglColorRenderbuffer),G.__webglDepthRenderbuffer&&s.deleteRenderbuffer(G.__webglDepthRenderbuffer);if(T.isWebGLMultipleRenderTargets)for(let le=0,he=w.length;le<he;le++){const _e=n.get(w[le]);_e.__webglTexture&&(s.deleteTexture(_e.__webglTexture),o.memory.textures--),n.remove(w[le])}n.remove(w),n.remove(T)}let N=0;function k(){N=0}function D(){const T=N;return T>=l&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+l),N+=1,T}function X(T){const w=[];return w.push(T.wrapS),w.push(T.wrapT),w.push(T.magFilter),w.push(T.minFilter),w.push(T.anisotropy),w.push(T.internalFormat),w.push(T.format),w.push(T.type),w.push(T.generateMipmaps),w.push(T.premultiplyAlpha),w.push(T.flipY),w.push(T.unpackAlignment),w.push(T.encoding),w.join()}function $(T,w){const G=n.get(T);if(T.isVideoTexture&&Ke(T),T.isRenderTargetTexture===!1&&T.version>0&&G.__version!==T.version){const Q=T.image;if(Q===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ce(G,T,w);return}}t.activeTexture(33984+w),t.bindTexture(3553,G.__webglTexture)}function te(T,w){const G=n.get(T);if(T.version>0&&G.__version!==T.version){Ce(G,T,w);return}t.activeTexture(33984+w),t.bindTexture(35866,G.__webglTexture)}function K(T,w){const G=n.get(T);if(T.version>0&&G.__version!==T.version){Ce(G,T,w);return}t.activeTexture(33984+w),t.bindTexture(32879,G.__webglTexture)}function ge(T,w){const G=n.get(T);if(T.version>0&&G.__version!==T.version){Re(G,T,w);return}t.activeTexture(33984+w),t.bindTexture(34067,G.__webglTexture)}const ze={[Nr]:10497,[wt]:33071,[zr]:33648},Se={[ct]:9728,[io]:9984,[ro]:9986,[it]:9729,[nl]:9985,[vi]:9987};function q(T,w,G){if(G?(s.texParameteri(T,10242,ze[w.wrapS]),s.texParameteri(T,10243,ze[w.wrapT]),(T===32879||T===35866)&&s.texParameteri(T,32882,ze[w.wrapR]),s.texParameteri(T,10240,Se[w.magFilter]),s.texParameteri(T,10241,Se[w.minFilter])):(s.texParameteri(T,10242,33071),s.texParameteri(T,10243,33071),(T===32879||T===35866)&&s.texParameteri(T,32882,33071),(w.wrapS!==wt||w.wrapT!==wt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),s.texParameteri(T,10240,I(w.magFilter)),s.texParameteri(T,10241,I(w.minFilter)),w.minFilter!==ct&&w.minFilter!==it&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Q=e.get("EXT_texture_filter_anisotropic");if(w.type===fn&&e.has("OES_texture_float_linear")===!1||a===!1&&w.type===si&&e.has("OES_texture_half_float_linear")===!1)return;(w.anisotropy>1||n.get(w).__currentAnisotropy)&&(s.texParameterf(T,Q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,i.getMaxAnisotropy())),n.get(w).__currentAnisotropy=w.anisotropy)}}function Ve(T,w){let G=!1;T.__webglInit===void 0&&(T.__webglInit=!0,w.addEventListener("dispose",v));const Q=w.source;let le=m.get(Q);le===void 0&&(le={},m.set(Q,le));const he=X(w);if(he!==T.__cacheKey){le[he]===void 0&&(le[he]={texture:s.createTexture(),usedTimes:0},o.memory.textures++,G=!0),le[he].usedTimes++;const _e=le[T.__cacheKey];_e!==void 0&&(le[T.__cacheKey].usedTimes--,_e.usedTimes===0&&F(w)),T.__cacheKey=he,T.__webglTexture=le[he].texture}return G}function Ce(T,w,G){let Q=3553;w.isDataArrayTexture&&(Q=35866),w.isData3DTexture&&(Q=32879);const le=Ve(T,w),he=w.source;if(t.activeTexture(33984+G),t.bindTexture(Q,T.__webglTexture),he.version!==he.__currentVersion||le===!0){s.pixelStorei(37440,w.flipY),s.pixelStorei(37441,w.premultiplyAlpha),s.pixelStorei(3317,w.unpackAlignment),s.pixelStorei(37443,0);const _e=b(w)&&_(w.image)===!1;let V=M(w.image,_e,!1,h);V=Ye(w,V);const Le=_(V)||a,Ie=r.convert(w.format,w.encoding);let me=r.convert(w.type),L=P(w.internalFormat,Ie,me,w.encoding,w.isVideoTexture);q(Q,w,Le);let oe;const re=w.mipmaps,Me=a&&w.isVideoTexture!==!0,ue=T.__version===void 0,be=H(w,V,Le);if(w.isDepthTexture)L=6402,a?w.type===fn?L=36012:w.type===Lr?L=33190:w.type===oi?L=35056:L=33189:w.type===fn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),w.format===Rn&&L===6402&&w.type!==ji&&w.type!==Lr&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),w.type=ji,me=r.convert(w.type)),w.format===di&&L===6402&&(L=34041,w.type!==oi&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),w.type=oi,me=r.convert(w.type))),Me&&ue?t.texStorage2D(3553,1,L,V.width,V.height):t.texImage2D(3553,0,L,V.width,V.height,0,Ie,me,null);else if(w.isDataTexture)if(re.length>0&&Le){Me&&ue&&t.texStorage2D(3553,be,L,re[0].width,re[0].height);for(let ie=0,Ee=re.length;ie<Ee;ie++)oe=re[ie],Me?t.texSubImage2D(3553,ie,0,0,oe.width,oe.height,Ie,me,oe.data):t.texImage2D(3553,ie,L,oe.width,oe.height,0,Ie,me,oe.data);w.generateMipmaps=!1}else Me?(ue&&t.texStorage2D(3553,be,L,V.width,V.height),t.texSubImage2D(3553,0,0,0,V.width,V.height,Ie,me,V.data)):t.texImage2D(3553,0,L,V.width,V.height,0,Ie,me,V.data);else if(w.isCompressedTexture){Me&&ue&&t.texStorage2D(3553,be,L,re[0].width,re[0].height);for(let ie=0,Ee=re.length;ie<Ee;ie++)oe=re[ie],w.format!==Lt?Ie!==null?Me?t.compressedTexSubImage2D(3553,ie,0,0,oe.width,oe.height,Ie,oe.data):t.compressedTexImage2D(3553,ie,L,oe.width,oe.height,0,oe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Me?t.texSubImage2D(3553,ie,0,0,oe.width,oe.height,Ie,me,oe.data):t.texImage2D(3553,ie,L,oe.width,oe.height,0,Ie,me,oe.data)}else if(w.isDataArrayTexture)Me?(ue&&t.texStorage3D(35866,be,L,V.width,V.height,V.depth),t.texSubImage3D(35866,0,0,0,0,V.width,V.height,V.depth,Ie,me,V.data)):t.texImage3D(35866,0,L,V.width,V.height,V.depth,0,Ie,me,V.data);else if(w.isData3DTexture)Me?(ue&&t.texStorage3D(32879,be,L,V.width,V.height,V.depth),t.texSubImage3D(32879,0,0,0,0,V.width,V.height,V.depth,Ie,me,V.data)):t.texImage3D(32879,0,L,V.width,V.height,V.depth,0,Ie,me,V.data);else if(w.isFramebufferTexture)Me&&ue?t.texStorage2D(3553,be,L,V.width,V.height):t.texImage2D(3553,0,L,V.width,V.height,0,Ie,me,null);else if(re.length>0&&Le){Me&&ue&&t.texStorage2D(3553,be,L,re[0].width,re[0].height);for(let ie=0,Ee=re.length;ie<Ee;ie++)oe=re[ie],Me?t.texSubImage2D(3553,ie,0,0,Ie,me,oe):t.texImage2D(3553,ie,L,Ie,me,oe);w.generateMipmaps=!1}else Me?(ue&&t.texStorage2D(3553,be,L,V.width,V.height),t.texSubImage2D(3553,0,0,0,Ie,me,V)):t.texImage2D(3553,0,L,Ie,me,V);A(w,Le)&&R(Q),he.__currentVersion=he.version,w.onUpdate&&w.onUpdate(w)}T.__version=w.version}function Re(T,w,G){if(w.image.length!==6)return;const Q=Ve(T,w),le=w.source;if(t.activeTexture(33984+G),t.bindTexture(34067,T.__webglTexture),le.version!==le.__currentVersion||Q===!0){s.pixelStorei(37440,w.flipY),s.pixelStorei(37441,w.premultiplyAlpha),s.pixelStorei(3317,w.unpackAlignment),s.pixelStorei(37443,0);const he=w.isCompressedTexture||w.image[0].isCompressedTexture,_e=w.image[0]&&w.image[0].isDataTexture,V=[];for(let ie=0;ie<6;ie++)!he&&!_e?V[ie]=M(w.image[ie],!1,!0,c):V[ie]=_e?w.image[ie].image:w.image[ie],V[ie]=Ye(w,V[ie]);const Le=V[0],Ie=_(Le)||a,me=r.convert(w.format,w.encoding),L=r.convert(w.type),oe=P(w.internalFormat,me,L,w.encoding),re=a&&w.isVideoTexture!==!0,Me=T.__version===void 0;let ue=H(w,Le,Ie);q(34067,w,Ie);let be;if(he){re&&Me&&t.texStorage2D(34067,ue,oe,Le.width,Le.height);for(let ie=0;ie<6;ie++){be=V[ie].mipmaps;for(let Ee=0;Ee<be.length;Ee++){const Ze=be[Ee];w.format!==Lt?me!==null?re?t.compressedTexSubImage2D(34069+ie,Ee,0,0,Ze.width,Ze.height,me,Ze.data):t.compressedTexImage2D(34069+ie,Ee,oe,Ze.width,Ze.height,0,Ze.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):re?t.texSubImage2D(34069+ie,Ee,0,0,Ze.width,Ze.height,me,L,Ze.data):t.texImage2D(34069+ie,Ee,oe,Ze.width,Ze.height,0,me,L,Ze.data)}}}else{be=w.mipmaps,re&&Me&&(be.length>0&&ue++,t.texStorage2D(34067,ue,oe,V[0].width,V[0].height));for(let ie=0;ie<6;ie++)if(_e){re?t.texSubImage2D(34069+ie,0,0,0,V[ie].width,V[ie].height,me,L,V[ie].data):t.texImage2D(34069+ie,0,oe,V[ie].width,V[ie].height,0,me,L,V[ie].data);for(let Ee=0;Ee<be.length;Ee++){const Ue=be[Ee].image[ie].image;re?t.texSubImage2D(34069+ie,Ee+1,0,0,Ue.width,Ue.height,me,L,Ue.data):t.texImage2D(34069+ie,Ee+1,oe,Ue.width,Ue.height,0,me,L,Ue.data)}}else{re?t.texSubImage2D(34069+ie,0,0,0,me,L,V[ie]):t.texImage2D(34069+ie,0,oe,me,L,V[ie]);for(let Ee=0;Ee<be.length;Ee++){const Ze=be[Ee];re?t.texSubImage2D(34069+ie,Ee+1,0,0,me,L,Ze.image[ie]):t.texImage2D(34069+ie,Ee+1,oe,me,L,Ze.image[ie])}}}A(w,Ie)&&R(34067),le.__currentVersion=le.version,w.onUpdate&&w.onUpdate(w)}T.__version=w.version}function ne(T,w,G,Q,le){const he=r.convert(G.format,G.encoding),_e=r.convert(G.type),V=P(G.internalFormat,he,_e,G.encoding);n.get(w).__hasExternalTextures||(le===32879||le===35866?t.texImage3D(le,0,V,w.width,w.height,w.depth,0,he,_e,null):t.texImage2D(le,0,V,w.width,w.height,0,he,_e,null)),t.bindFramebuffer(36160,T),xe(w)?d.framebufferTexture2DMultisampleEXT(36160,Q,le,n.get(G).__webglTexture,0,ve(w)):s.framebufferTexture2D(36160,Q,le,n.get(G).__webglTexture,0),t.bindFramebuffer(36160,null)}function Be(T,w,G){if(s.bindRenderbuffer(36161,T),w.depthBuffer&&!w.stencilBuffer){let Q=33189;if(G||xe(w)){const le=w.depthTexture;le&&le.isDepthTexture&&(le.type===fn?Q=36012:le.type===Lr&&(Q=33190));const he=ve(w);xe(w)?d.renderbufferStorageMultisampleEXT(36161,he,Q,w.width,w.height):s.renderbufferStorageMultisample(36161,he,Q,w.width,w.height)}else s.renderbufferStorage(36161,Q,w.width,w.height);s.framebufferRenderbuffer(36160,36096,36161,T)}else if(w.depthBuffer&&w.stencilBuffer){const Q=ve(w);G&&xe(w)===!1?s.renderbufferStorageMultisample(36161,Q,35056,w.width,w.height):xe(w)?d.renderbufferStorageMultisampleEXT(36161,Q,35056,w.width,w.height):s.renderbufferStorage(36161,34041,w.width,w.height),s.framebufferRenderbuffer(36160,33306,36161,T)}else{const Q=w.isWebGLMultipleRenderTargets===!0?w.texture[0]:w.texture,le=r.convert(Q.format,Q.encoding),he=r.convert(Q.type),_e=P(Q.internalFormat,le,he,Q.encoding),V=ve(w);G&&xe(w)===!1?s.renderbufferStorageMultisample(36161,V,_e,w.width,w.height):xe(w)?d.renderbufferStorageMultisampleEXT(36161,V,_e,w.width,w.height):s.renderbufferStorage(36161,_e,w.width,w.height)}s.bindRenderbuffer(36161,null)}function W(T,w){if(w&&w.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,T),!(w.depthTexture&&w.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(w.depthTexture).__webglTexture||w.depthTexture.image.width!==w.width||w.depthTexture.image.height!==w.height)&&(w.depthTexture.image.width=w.width,w.depthTexture.image.height=w.height,w.depthTexture.needsUpdate=!0),$(w.depthTexture,0);const Q=n.get(w.depthTexture).__webglTexture,le=ve(w);if(w.depthTexture.format===Rn)xe(w)?d.framebufferTexture2DMultisampleEXT(36160,36096,3553,Q,0,le):s.framebufferTexture2D(36160,36096,3553,Q,0);else if(w.depthTexture.format===di)xe(w)?d.framebufferTexture2DMultisampleEXT(36160,33306,3553,Q,0,le):s.framebufferTexture2D(36160,33306,3553,Q,0);else throw new Error("Unknown depthTexture format")}function Y(T){const w=n.get(T),G=T.isWebGLCubeRenderTarget===!0;if(T.depthTexture&&!w.__autoAllocateDepthBuffer){if(G)throw new Error("target.depthTexture not supported in Cube render targets");W(w.__webglFramebuffer,T)}else if(G){w.__webglDepthbuffer=[];for(let Q=0;Q<6;Q++)t.bindFramebuffer(36160,w.__webglFramebuffer[Q]),w.__webglDepthbuffer[Q]=s.createRenderbuffer(),Be(w.__webglDepthbuffer[Q],T,!1)}else t.bindFramebuffer(36160,w.__webglFramebuffer),w.__webglDepthbuffer=s.createRenderbuffer(),Be(w.__webglDepthbuffer,T,!1);t.bindFramebuffer(36160,null)}function ee(T,w,G){const Q=n.get(T);w!==void 0&&ne(Q.__webglFramebuffer,T,T.texture,36064,3553),G!==void 0&&Y(T)}function pe(T){const w=T.texture,G=n.get(T),Q=n.get(w);T.addEventListener("dispose",C),T.isWebGLMultipleRenderTargets!==!0&&(Q.__webglTexture===void 0&&(Q.__webglTexture=s.createTexture()),Q.__version=w.version,o.memory.textures++);const le=T.isWebGLCubeRenderTarget===!0,he=T.isWebGLMultipleRenderTargets===!0,_e=_(T)||a;if(le){G.__webglFramebuffer=[];for(let V=0;V<6;V++)G.__webglFramebuffer[V]=s.createFramebuffer()}else if(G.__webglFramebuffer=s.createFramebuffer(),he)if(i.drawBuffers){const V=T.texture;for(let Le=0,Ie=V.length;Le<Ie;Le++){const me=n.get(V[Le]);me.__webglTexture===void 0&&(me.__webglTexture=s.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(a&&T.samples>0&&xe(T)===!1){G.__webglMultisampledFramebuffer=s.createFramebuffer(),G.__webglColorRenderbuffer=s.createRenderbuffer(),s.bindRenderbuffer(36161,G.__webglColorRenderbuffer);const V=r.convert(w.format,w.encoding),Le=r.convert(w.type),Ie=P(w.internalFormat,V,Le,w.encoding),me=ve(T);s.renderbufferStorageMultisample(36161,me,Ie,T.width,T.height),t.bindFramebuffer(36160,G.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(36160,36064,36161,G.__webglColorRenderbuffer),s.bindRenderbuffer(36161,null),T.depthBuffer&&(G.__webglDepthRenderbuffer=s.createRenderbuffer(),Be(G.__webglDepthRenderbuffer,T,!0)),t.bindFramebuffer(36160,null)}if(le){t.bindTexture(34067,Q.__webglTexture),q(34067,w,_e);for(let V=0;V<6;V++)ne(G.__webglFramebuffer[V],T,w,36064,34069+V);A(w,_e)&&R(34067),t.unbindTexture()}else if(he){const V=T.texture;for(let Le=0,Ie=V.length;Le<Ie;Le++){const me=V[Le],L=n.get(me);t.bindTexture(3553,L.__webglTexture),q(3553,me,_e),ne(G.__webglFramebuffer,T,me,36064+Le,3553),A(me,_e)&&R(3553)}t.unbindTexture()}else{let V=3553;(T.isWebGL3DRenderTarget||T.isWebGLArrayRenderTarget)&&(a?V=T.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(V,Q.__webglTexture),q(V,w,_e),ne(G.__webglFramebuffer,T,w,36064,V),A(w,_e)&&R(V),t.unbindTexture()}T.depthBuffer&&Y(T)}function ce(T){const w=_(T)||a,G=T.isWebGLMultipleRenderTargets===!0?T.texture:[T.texture];for(let Q=0,le=G.length;Q<le;Q++){const he=G[Q];if(A(he,w)){const _e=T.isWebGLCubeRenderTarget?34067:3553,V=n.get(he).__webglTexture;t.bindTexture(_e,V),R(_e),t.unbindTexture()}}}function Te(T){if(a&&T.samples>0&&xe(T)===!1){const w=T.width,G=T.height;let Q=16384;const le=[36064],he=T.stencilBuffer?33306:36096;T.depthBuffer&&le.push(he);const _e=n.get(T),V=_e.__ignoreDepthValues!==void 0?_e.__ignoreDepthValues:!1;V===!1&&(T.depthBuffer&&(Q|=256),T.stencilBuffer&&(Q|=1024)),t.bindFramebuffer(36008,_e.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,_e.__webglFramebuffer),V===!0&&(s.invalidateFramebuffer(36008,[he]),s.invalidateFramebuffer(36009,[he])),s.blitFramebuffer(0,0,w,G,0,0,w,G,Q,9728),f&&s.invalidateFramebuffer(36008,le),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,_e.__webglMultisampledFramebuffer)}}function ve(T){return Math.min(u,T.samples)}function xe(T){const w=n.get(T);return a&&T.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function Ke(T){const w=o.render.frame;g.get(T)!==w&&(g.set(T,w),T.update())}function Ye(T,w){const G=T.encoding,Q=T.format,le=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||T.format===so||G!==nn&&(G===$e?a===!1?e.has("EXT_sRGB")===!0&&Q===Lt?(T.format=so,T.minFilter=it,T.generateMipmaps=!1):w=Un.sRGBToLinear(w):(Q!==Lt||le!==Dn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",G)),w}this.allocateTextureUnit=D,this.resetTextureUnits=k,this.setTexture2D=$,this.setTexture2DArray=te,this.setTexture3D=K,this.setTextureCube=ge,this.rebindTextures=ee,this.setupRenderTarget=pe,this.updateRenderTargetMipmap=ce,this.updateMultisampleRenderTarget=Te,this.setupDepthRenderbuffer=Y,this.setupFrameBufferTexture=ne,this.useMultisampledRTT=xe}function zu(s,e,t){const n=t.isWebGL2;function i(r,o=null){let a;if(r===Dn)return 5121;if(r===Yh)return 32819;if(r===Zh)return 32820;if(r===qh)return 5120;if(r===Xh)return 5122;if(r===ji)return 5123;if(r===Jh)return 5124;if(r===Lr)return 5125;if(r===fn)return 5126;if(r===si)return n?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===$h)return 6406;if(r===Lt)return 6408;if(r===Kh)return 6409;if(r===Qh)return 6410;if(r===Rn)return 6402;if(r===di)return 34041;if(r===eu)return 6403;if(r===jh)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(r===so)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===tu)return 36244;if(r===nu)return 33319;if(r===iu)return 33320;if(r===ru)return 36249;if(r===Zs||r===$s||r===js||r===Ks)if(o===$e)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Zs)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===$s)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===js)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Ks)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Zs)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===$s)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===js)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Ks)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===wa||r===Sa||r===Ea||r===Ta)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===wa)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===Sa)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===Ea)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===Ta)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===su)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===Aa||r===Ca)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===Aa)return o===$e?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===Ca)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===Ra||r===La||r===Pa||r===Ia||r===Da||r===Fa||r===Ba||r===Na||r===za||r===Ua||r===Oa||r===Ha||r===Ga||r===ka)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===Ra)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===La)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===Pa)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===Ia)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===Da)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===Fa)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===Ba)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===Na)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===za)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===Ua)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===Oa)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===Ha)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===Ga)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===ka)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Va)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Va)return o===$e?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(r===oi)return n?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:i}}class ol extends mt{constructor(e=[]){super(),this.cameras=e}}ol.prototype.isArrayCamera=!0;class ii extends Ne{constructor(){super(),this.type="Group"}}ii.prototype.isGroup=!0;const r0={type:"move"};class aa{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ii,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ii,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new S,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new S),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ii,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new S,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new S),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(a!==null&&(i=t.getPose(e.targetRaySpace,n),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(r0))),c&&e.hand){o=!0;for(const p of e.hand.values()){const m=t.getJointPose(p,n);if(c.joints[p.jointName]===void 0){const y=new ii;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[p.jointName]=y,c.add(y)}const x=c.joints[p.jointName];m!==null&&(x.matrix.fromArray(m.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.jointRadius=m.radius),x.visible=m!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,g=.005;c.inputState.pinching&&d>f+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}}class al extends ut{constructor(e,t,n,i,r,o,a,l,c,h){if(h=h!==void 0?h:Rn,h!==Rn&&h!==di)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Rn&&(n=ji),n===void 0&&h===di&&(n=oi),super(null,i,r,o,a,l,h,n,c),this.image={width:e,height:t},this.magFilter=a!==void 0?a:ct,this.minFilter=l!==void 0?l:ct,this.flipY=!1,this.generateMipmaps=!1}}al.prototype.isDepthTexture=!0;class s0 extends zn{constructor(e,t){super();const n=this;let i=null,r=1,o=null,a="local-floor",l=null,c=null,h=null,u=null,d=null;const f=t.getContextAttributes();let g=null,p=null;const m=[],x=new Map,y=new mt;y.layers.enable(1),y.viewport=new qe;const M=new mt;M.layers.enable(2),M.viewport=new qe;const _=[y,M],b=new ol;b.layers.enable(1),b.layers.enable(2);let A=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(D){let X=m[D];return X===void 0&&(X=new aa,m[D]=X),X.getTargetRaySpace()},this.getControllerGrip=function(D){let X=m[D];return X===void 0&&(X=new aa,m[D]=X),X.getGripSpace()},this.getHand=function(D){let X=m[D];return X===void 0&&(X=new aa,m[D]=X),X.getHandSpace()};function P(D){const X=x.get(D.inputSource);X&&X.dispatchEvent({type:D.type,data:D.inputSource})}function H(){x.forEach(function(D,X){D.disconnect(X)}),x.clear(),A=null,R=null,e.setRenderTarget(g),u=null,h=null,c=null,i=null,p=null,k.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(D){r=D,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(D){a=D,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return h!==null?h:u},this.getBinding=function(){return c},this.getFrame=function(){return d},this.getSession=function(){return i},this.setSession=async function(D){if(i=D,i!==null){if(g=e.getRenderTarget(),i.addEventListener("select",P),i.addEventListener("selectstart",P),i.addEventListener("selectend",P),i.addEventListener("squeeze",P),i.addEventListener("squeezestart",P),i.addEventListener("squeezeend",P),i.addEventListener("end",H),i.addEventListener("inputsourceschange",I),f.xrCompatible!==!0&&await t.makeXRCompatible(),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const X={antialias:i.renderState.layers===void 0?f.antialias:!0,alpha:f.alpha,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:r};u=new XRWebGLLayer(i,t,X),i.updateRenderState({baseLayer:u}),p=new St(u.framebufferWidth,u.framebufferHeight,{format:Lt,type:Dn,encoding:e.outputEncoding})}else{let X=null,$=null,te=null;f.depth&&(te=f.stencil?35056:33190,X=f.stencil?di:Rn,$=f.stencil?oi:ji);const K={colorFormat:e.outputEncoding===$e?35907:32856,depthFormat:te,scaleFactor:r};c=new XRWebGLBinding(i,t),h=c.createProjectionLayer(K),i.updateRenderState({layers:[h]}),p=new St(h.textureWidth,h.textureHeight,{format:Lt,type:Dn,depthTexture:new al(h.textureWidth,h.textureHeight,$,void 0,void 0,void 0,void 0,void 0,void 0,X),stencilBuffer:f.stencil,encoding:e.outputEncoding,samples:f.antialias?4:0});const ge=e.properties.get(p);ge.__ignoreDepthValues=h.ignoreDepthValues}p.isXRRenderTarget=!0,this.setFoveation(1),o=await i.requestReferenceSpace(a),k.setContext(i),k.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function I(D){const X=i.inputSources;for(let $=0;$<m.length;$++)x.set(X[$],m[$]);for(let $=0;$<D.removed.length;$++){const te=D.removed[$],K=x.get(te);K&&(K.dispatchEvent({type:"disconnected",data:te}),x.delete(te))}for(let $=0;$<D.added.length;$++){const te=D.added[$],K=x.get(te);K&&K.dispatchEvent({type:"connected",data:te})}}const v=new S,C=new S;function j(D,X,$){v.setFromMatrixPosition(X.matrixWorld),C.setFromMatrixPosition($.matrixWorld);const te=v.distanceTo(C),K=X.projectionMatrix.elements,ge=$.projectionMatrix.elements,ze=K[14]/(K[10]-1),Se=K[14]/(K[10]+1),q=(K[9]+1)/K[5],Ve=(K[9]-1)/K[5],Ce=(K[8]-1)/K[0],Re=(ge[8]+1)/ge[0],ne=ze*Ce,Be=ze*Re,W=te/(-Ce+Re),Y=W*-Ce;X.matrixWorld.decompose(D.position,D.quaternion,D.scale),D.translateX(Y),D.translateZ(W),D.matrixWorld.compose(D.position,D.quaternion,D.scale),D.matrixWorldInverse.copy(D.matrixWorld).invert();const ee=ze+W,pe=Se+W,ce=ne-Y,Te=Be+(te-Y),ve=q*Se/pe*ee,xe=Ve*Se/pe*ee;D.projectionMatrix.makePerspective(ce,Te,ve,xe,ee,pe)}function F(D,X){X===null?D.matrixWorld.copy(D.matrix):D.matrixWorld.multiplyMatrices(X.matrixWorld,D.matrix),D.matrixWorldInverse.copy(D.matrixWorld).invert()}this.updateCamera=function(D){if(i===null)return;b.near=M.near=y.near=D.near,b.far=M.far=y.far=D.far,(A!==b.near||R!==b.far)&&(i.updateRenderState({depthNear:b.near,depthFar:b.far}),A=b.near,R=b.far);const X=D.parent,$=b.cameras;F(b,X);for(let K=0;K<$.length;K++)F($[K],X);b.matrixWorld.decompose(b.position,b.quaternion,b.scale),D.position.copy(b.position),D.quaternion.copy(b.quaternion),D.scale.copy(b.scale),D.matrix.copy(b.matrix),D.matrixWorld.copy(b.matrixWorld);const te=D.children;for(let K=0,ge=te.length;K<ge;K++)te[K].updateMatrixWorld(!0);$.length===2?j(b,y,M):b.projectionMatrix.copy(y.projectionMatrix)},this.getCamera=function(){return b},this.getFoveation=function(){if(h!==null)return h.fixedFoveation;if(u!==null)return u.fixedFoveation},this.setFoveation=function(D){h!==null&&(h.fixedFoveation=D),u!==null&&u.fixedFoveation!==void 0&&(u.fixedFoveation=D)};let U=null;function N(D,X){if(l=X.getViewerPose(o),d=X,l!==null){const te=l.views;u!==null&&(e.setRenderTargetFramebuffer(p,u.framebuffer),e.setRenderTarget(p));let K=!1;te.length!==b.cameras.length&&(b.cameras.length=0,K=!0);for(let ge=0;ge<te.length;ge++){const ze=te[ge];let Se=null;if(u!==null)Se=u.getViewport(ze);else{const Ve=c.getViewSubImage(h,ze);Se=Ve.viewport,ge===0&&(e.setRenderTargetTextures(p,Ve.colorTexture,h.ignoreDepthValues?void 0:Ve.depthStencilTexture),e.setRenderTarget(p))}const q=_[ge];q.matrix.fromArray(ze.transform.matrix),q.projectionMatrix.fromArray(ze.projectionMatrix),q.viewport.set(Se.x,Se.y,Se.width,Se.height),ge===0&&b.matrix.copy(q.matrix),K===!0&&b.cameras.push(q)}}const $=i.inputSources;for(let te=0;te<m.length;te++){const K=m[te],ge=$[te];K.update(ge,X,o)}U&&U(D,X),d=null}const k=new Cu;k.setAnimationLoop(N),this.setAnimationLoop=function(D){U=D},this.dispose=function(){}}}function o0(s,e){function t(p,m){p.fogColor.value.copy(m.color),m.isFog?(p.fogNear.value=m.near,p.fogFar.value=m.far):m.isFogExp2&&(p.fogDensity.value=m.density)}function n(p,m,x,y,M){m.isMeshBasicMaterial||m.isMeshLambertMaterial?i(p,m):m.isMeshToonMaterial?(i(p,m),h(p,m)):m.isMeshPhongMaterial?(i(p,m),c(p,m)):m.isMeshStandardMaterial?(i(p,m),u(p,m),m.isMeshPhysicalMaterial&&d(p,m,M)):m.isMeshMatcapMaterial?(i(p,m),f(p,m)):m.isMeshDepthMaterial?i(p,m):m.isMeshDistanceMaterial?(i(p,m),g(p,m)):m.isMeshNormalMaterial?i(p,m):m.isLineBasicMaterial?(r(p,m),m.isLineDashedMaterial&&o(p,m)):m.isPointsMaterial?a(p,m,x,y):m.isSpriteMaterial?l(p,m):m.isShadowMaterial?(p.color.value.copy(m.color),p.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function i(p,m){p.opacity.value=m.opacity,m.color&&p.diffuse.value.copy(m.color),m.emissive&&p.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.bumpMap&&(p.bumpMap.value=m.bumpMap,p.bumpScale.value=m.bumpScale,m.side===Pt&&(p.bumpScale.value*=-1)),m.displacementMap&&(p.displacementMap.value=m.displacementMap,p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias),m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap),m.normalMap&&(p.normalMap.value=m.normalMap,p.normalScale.value.copy(m.normalScale),m.side===Pt&&p.normalScale.value.negate()),m.specularMap&&(p.specularMap.value=m.specularMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);const x=e.get(m).envMap;if(x&&(p.envMap.value=x,p.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=m.reflectivity,p.ior.value=m.ior,p.refractionRatio.value=m.refractionRatio),m.lightMap){p.lightMap.value=m.lightMap;const _=s.physicallyCorrectLights!==!0?Math.PI:1;p.lightMapIntensity.value=m.lightMapIntensity*_}m.aoMap&&(p.aoMap.value=m.aoMap,p.aoMapIntensity.value=m.aoMapIntensity);let y;m.map?y=m.map:m.specularMap?y=m.specularMap:m.displacementMap?y=m.displacementMap:m.normalMap?y=m.normalMap:m.bumpMap?y=m.bumpMap:m.roughnessMap?y=m.roughnessMap:m.metalnessMap?y=m.metalnessMap:m.alphaMap?y=m.alphaMap:m.emissiveMap?y=m.emissiveMap:m.clearcoatMap?y=m.clearcoatMap:m.clearcoatNormalMap?y=m.clearcoatNormalMap:m.clearcoatRoughnessMap?y=m.clearcoatRoughnessMap:m.specularIntensityMap?y=m.specularIntensityMap:m.specularColorMap?y=m.specularColorMap:m.transmissionMap?y=m.transmissionMap:m.thicknessMap?y=m.thicknessMap:m.sheenColorMap?y=m.sheenColorMap:m.sheenRoughnessMap&&(y=m.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),p.uvTransform.value.copy(y.matrix));let M;m.aoMap?M=m.aoMap:m.lightMap&&(M=m.lightMap),M!==void 0&&(M.isWebGLRenderTarget&&(M=M.texture),M.matrixAutoUpdate===!0&&M.updateMatrix(),p.uv2Transform.value.copy(M.matrix))}function r(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity}function o(p,m){p.dashSize.value=m.dashSize,p.totalSize.value=m.dashSize+m.gapSize,p.scale.value=m.scale}function a(p,m,x,y){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.size.value=m.size*x,p.scale.value=y*.5,m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let M;m.map?M=m.map:m.alphaMap&&(M=m.alphaMap),M!==void 0&&(M.matrixAutoUpdate===!0&&M.updateMatrix(),p.uvTransform.value.copy(M.matrix))}function l(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.rotation.value=m.rotation,m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let x;m.map?x=m.map:m.alphaMap&&(x=m.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),p.uvTransform.value.copy(x.matrix))}function c(p,m){p.specular.value.copy(m.specular),p.shininess.value=Math.max(m.shininess,1e-4)}function h(p,m){m.gradientMap&&(p.gradientMap.value=m.gradientMap)}function u(p,m){p.roughness.value=m.roughness,p.metalness.value=m.metalness,m.roughnessMap&&(p.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(p.metalnessMap.value=m.metalnessMap),e.get(m).envMap&&(p.envMapIntensity.value=m.envMapIntensity)}function d(p,m,x){p.ior.value=m.ior,m.sheen>0&&(p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(p.sheenColorMap.value=m.sheenColorMap),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap)),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),p.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===Pt&&p.clearcoatNormalScale.value.negate())),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=x.texture,p.transmissionSamplerSize.value.set(x.width,x.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap),p.attenuationDistance.value=m.attenuationDistance,p.attenuationColor.value.copy(m.attenuationColor)),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap)}function f(p,m){m.matcap&&(p.matcap.value=m.matcap)}function g(p,m){p.referencePosition.value.copy(m.referencePosition),p.nearDistance.value=m.nearDistance,p.farDistance.value=m.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:n}}function a0(){const s=kr("canvas");return s.style.display="block",s}function Je(s={}){const e=s.canvas!==void 0?s.canvas:a0(),t=s.context!==void 0?s.context:null,n=s.depth!==void 0?s.depth:!0,i=s.stencil!==void 0?s.stencil:!0,r=s.antialias!==void 0?s.antialias:!1,o=s.premultipliedAlpha!==void 0?s.premultipliedAlpha:!0,a=s.preserveDrawingBuffer!==void 0?s.preserveDrawingBuffer:!1,l=s.powerPreference!==void 0?s.powerPreference:"default",c=s.failIfMajorPerformanceCaveat!==void 0?s.failIfMajorPerformanceCaveat:!1;let h;s.context!==void 0?h=t.getContextAttributes().alpha:h=s.alpha!==void 0?s.alpha:!1;let u=null,d=null;const f=[],g=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=nn,this.physicallyCorrectLights=!1,this.toneMapping=Qt,this.toneMappingExposure=1;const p=this;let m=!1,x=0,y=0,M=null,_=-1,b=null;const A=new qe,R=new qe;let P=null,H=e.width,I=e.height,v=1,C=null,j=null;const F=new qe(0,0,H,I),U=new qe(0,0,H,I);let N=!1;const k=new Qr;let D=!1,X=!1,$=null;const te=new fe,K=new Z,ge=new S,ze={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Se(){return M===null?v:1}let q=t;function Ve(E,B){for(let O=0;O<E.length;O++){const z=E[O],J=e.getContext(z,B);if(J!==null)return J}return null}try{const E={alpha:!0,depth:n,stencil:i,antialias:r,premultipliedAlpha:o,preserveDrawingBuffer:a,powerPreference:l,failIfMajorPerformanceCaveat:c};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${lo}`),e.addEventListener("webglcontextlost",L,!1),e.addEventListener("webglcontextrestored",oe,!1),q===null){const B=["webgl2","webgl","experimental-webgl"];if(p.isWebGL1Renderer===!0&&B.shift(),q=Ve(B,E),q===null)throw Ve(B)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}q.getShaderPrecisionFormat===void 0&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let Ce,Re,ne,Be,W,Y,ee,pe,ce,Te,ve,xe,Ke,Ye,T,w,G,Q,le,he,_e,V,Le;function Ie(){Ce=new Tg(q),Re=new vg(q,Ce,s),Ce.init(Re),V=new zu(q,Ce,Re),ne=new n0(q,Ce,Re),Be=new Rg,W=new qx,Y=new i0(q,Ce,ne,W,Re,V,Be),ee=new bg(p),pe=new Eg(p),ce=new Vf(q,Re),Le=new yg(q,Ce,ce,Re),Te=new Ag(q,ce,Be,Le),ve=new Dg(q,Te,ce,Be),le=new Ig(q,Re,Y),w=new Mg(W),xe=new Wx(p,ee,pe,Ce,Re,Le,w),Ke=new o0(p,W),Ye=new Jx,T=new Qx(Ce,Re),Q=new xg(p,ee,ne,ve,h,o),G=new Nu(p,ve,Re),he=new _g(q,Ce,Be,Re),_e=new Cg(q,Ce,Be,Re),Be.programs=xe.programs,p.capabilities=Re,p.extensions=Ce,p.properties=W,p.renderLists=Ye,p.shadowMap=G,p.state=ne,p.info=Be}Ie();const me=new s0(p,q);this.xr=me,this.getContext=function(){return q},this.getContextAttributes=function(){return q.getContextAttributes()},this.forceContextLoss=function(){const E=Ce.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){const E=Ce.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return v},this.setPixelRatio=function(E){E!==void 0&&(v=E,this.setSize(H,I,!1))},this.getSize=function(E){return E.set(H,I)},this.setSize=function(E,B,O){if(me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}H=E,I=B,e.width=Math.floor(E*v),e.height=Math.floor(B*v),O!==!1&&(e.style.width=E+"px",e.style.height=B+"px"),this.setViewport(0,0,E,B)},this.getDrawingBufferSize=function(E){return E.set(H*v,I*v).floor()},this.setDrawingBufferSize=function(E,B,O){H=E,I=B,v=O,e.width=Math.floor(E*O),e.height=Math.floor(B*O),this.setViewport(0,0,E,B)},this.getCurrentViewport=function(E){return E.copy(A)},this.getViewport=function(E){return E.copy(F)},this.setViewport=function(E,B,O,z){E.isVector4?F.set(E.x,E.y,E.z,E.w):F.set(E,B,O,z),ne.viewport(A.copy(F).multiplyScalar(v).floor())},this.getScissor=function(E){return E.copy(U)},this.setScissor=function(E,B,O,z){E.isVector4?U.set(E.x,E.y,E.z,E.w):U.set(E,B,O,z),ne.scissor(R.copy(U).multiplyScalar(v).floor())},this.getScissorTest=function(){return N},this.setScissorTest=function(E){ne.setScissorTest(N=E)},this.setOpaqueSort=function(E){C=E},this.setTransparentSort=function(E){j=E},this.getClearColor=function(E){return E.copy(Q.getClearColor())},this.setClearColor=function(){Q.setClearColor.apply(Q,arguments)},this.getClearAlpha=function(){return Q.getClearAlpha()},this.setClearAlpha=function(){Q.setClearAlpha.apply(Q,arguments)},this.clear=function(E=!0,B=!0,O=!0){let z=0;E&&(z|=16384),B&&(z|=256),O&&(z|=1024),q.clear(z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",L,!1),e.removeEventListener("webglcontextrestored",oe,!1),Ye.dispose(),T.dispose(),W.dispose(),ee.dispose(),pe.dispose(),ve.dispose(),Le.dispose(),xe.dispose(),me.dispose(),me.removeEventListener("sessionstart",Ee),me.removeEventListener("sessionend",Ze),$&&($.dispose(),$=null),Ue.stop()};function L(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),m=!0}function oe(){console.log("THREE.WebGLRenderer: Context Restored."),m=!1;const E=Be.autoReset,B=G.enabled,O=G.autoUpdate,z=G.needsUpdate,J=G.type;Ie(),Be.autoReset=E,G.enabled=B,G.autoUpdate=O,G.needsUpdate=z,G.type=J}function re(E){const B=E.target;B.removeEventListener("dispose",re),Me(B)}function Me(E){ue(E),W.remove(E)}function ue(E){const B=W.get(E).programs;B!==void 0&&(B.forEach(function(O){xe.releaseProgram(O)}),E.isShaderMaterial&&xe.releaseShaderCache(E))}this.renderBufferDirect=function(E,B,O,z,J,we){B===null&&(B=ze);const Ae=J.isMesh&&J.matrixWorld.determinant()<0,De=Cd(E,B,O,z,J);ne.setMaterial(z,Ae);let Pe=O.index;const Xe=O.attributes.position;if(Pe===null){if(Xe===void 0||Xe.count===0)return}else if(Pe.count===0)return;let He=1;z.wireframe===!0&&(Pe=Te.getWireframeAttribute(O),He=2),Le.setup(J,z,De,O,Pe);let ke,et=he;Pe!==null&&(ke=ce.get(Pe),et=_e,et.setIndex(ke));const kn=Pe!==null?Pe.count:Xe.count,Ti=O.drawRange.start*He,Ai=O.drawRange.count*He,Zt=we!==null?we.start*He:0,We=we!==null?we.count*He:1/0,Ci=Math.max(Ti,Zt),at=Math.min(kn,Ti+Ai,Zt+We)-1,$t=Math.max(0,at-Ci+1);if($t!==0){if(J.isMesh)z.wireframe===!0?(ne.setLineWidth(z.wireframeLinewidth*Se()),et.setMode(1)):et.setMode(4);else if(J.isLine){let _n=z.linewidth;_n===void 0&&(_n=1),ne.setLineWidth(_n*Se()),J.isLineSegments?et.setMode(1):J.isLineLoop?et.setMode(2):et.setMode(3)}else J.isPoints?et.setMode(0):J.isSprite&&et.setMode(4);if(J.isInstancedMesh)et.renderInstances(Ci,$t,J.count);else if(O.isInstancedBufferGeometry){const _n=Math.min(O.instanceCount,O._maxInstanceCount);et.renderInstances(Ci,$t,_n)}else et.render(Ci,$t)}},this.compile=function(E,B){d=T.get(E),d.init(),g.push(d),E.traverseVisible(function(O){O.isLight&&O.layers.test(B.layers)&&(d.pushLight(O),O.castShadow&&d.pushShadow(O))}),d.setupLights(p.physicallyCorrectLights),E.traverse(function(O){const z=O.material;if(z)if(Array.isArray(z))for(let J=0;J<z.length;J++){const we=z[J];Do(we,E,O)}else Do(z,E,O)}),g.pop(),d=null};let be=null;function ie(E){be&&be(E)}function Ee(){Ue.stop()}function Ze(){Ue.start()}const Ue=new Cu;Ue.setAnimationLoop(ie),typeof self<"u"&&Ue.setContext(self),this.setAnimationLoop=function(E){be=E,me.setAnimationLoop(E),E===null?Ue.stop():Ue.start()},me.addEventListener("sessionstart",Ee),me.addEventListener("sessionend",Ze),this.render=function(E,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(m===!0)return;E.autoUpdate===!0&&E.updateMatrixWorld(),B.parent===null&&B.updateMatrixWorld(),me.enabled===!0&&me.isPresenting===!0&&(me.cameraAutoUpdate===!0&&me.updateCamera(B),B=me.getCamera()),E.isScene===!0&&E.onBeforeRender(p,E,B,M),d=T.get(E,g.length),d.init(),g.push(d),te.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),k.setFromProjectionMatrix(te),X=this.localClippingEnabled,D=w.init(this.clippingPlanes,X,B),u=Ye.get(E,f.length),u.init(),f.push(u),Jt(E,B,0,p.sortObjects),u.finish(),p.sortObjects===!0&&u.sort(C,j),D===!0&&w.beginShadows();const O=d.state.shadowsArray;if(G.render(O,E,B),D===!0&&w.endShadows(),this.info.autoReset===!0&&this.info.reset(),Q.render(u,E),d.setupLights(p.physicallyCorrectLights),B.isArrayCamera){const z=B.cameras;for(let J=0,we=z.length;J<we;J++){const Ae=z[J];Yt(u,E,Ae,Ae.viewport)}}else Yt(u,E,B);M!==null&&(Y.updateMultisampleRenderTarget(M),Y.updateRenderTargetMipmap(M)),E.isScene===!0&&E.onAfterRender(p,E,B),Le.resetDefaultState(),_=-1,b=null,g.pop(),g.length>0?d=g[g.length-1]:d=null,f.pop(),f.length>0?u=f[f.length-1]:u=null};function Jt(E,B,O,z){if(E.visible===!1)return;if(E.layers.test(B.layers)){if(E.isGroup)O=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(B);else if(E.isLight)d.pushLight(E),E.castShadow&&d.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||k.intersectsSprite(E)){z&&ge.setFromMatrixPosition(E.matrixWorld).applyMatrix4(te);const Ae=ve.update(E),De=E.material;De.visible&&u.push(E,Ae,De,O,ge.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(E.isSkinnedMesh&&E.skeleton.frame!==Be.render.frame&&(E.skeleton.update(),E.skeleton.frame=Be.render.frame),!E.frustumCulled||k.intersectsObject(E))){z&&ge.setFromMatrixPosition(E.matrixWorld).applyMatrix4(te);const Ae=ve.update(E),De=E.material;if(Array.isArray(De)){const Pe=Ae.groups;for(let Xe=0,He=Pe.length;Xe<He;Xe++){const ke=Pe[Xe],et=De[ke.materialIndex];et&&et.visible&&u.push(E,Ae,et,O,ge.z,ke)}}else De.visible&&u.push(E,Ae,De,O,ge.z,null)}}const we=E.children;for(let Ae=0,De=we.length;Ae<De;Ae++)Jt(we[Ae],B,O,z)}function Yt(E,B,O,z){const J=E.opaque,we=E.transmissive,Ae=E.transparent;d.setupLightsView(O),we.length>0&&Td(J,B,O),z&&ne.viewport(A.copy(z)),J.length>0&&as(J,B,O),we.length>0&&as(we,B,O),Ae.length>0&&as(Ae,B,O),ne.buffers.depth.setTest(!0),ne.buffers.depth.setMask(!0),ne.buffers.color.setMask(!0),ne.setPolygonOffset(!1)}function Td(E,B,O){const z=Re.isWebGL2;$===null&&($=new St(1,1,{generateMipmaps:!0,type:V.convert(si)!==null?si:Dn,minFilter:vi,samples:z&&r===!0?4:0})),p.getDrawingBufferSize(K),z?$.setSize(K.x,K.y):$.setSize(oo(K.x),oo(K.y));const J=p.getRenderTarget();p.setRenderTarget($),p.clear();const we=p.toneMapping;p.toneMapping=Qt,as(E,B,O),p.toneMapping=we,Y.updateMultisampleRenderTarget($),Y.updateRenderTargetMipmap($),p.setRenderTarget(J)}function as(E,B,O){const z=B.isScene===!0?B.overrideMaterial:null;for(let J=0,we=E.length;J<we;J++){const Ae=E[J],De=Ae.object,Pe=Ae.geometry,Xe=z===null?Ae.material:z,He=Ae.group;De.layers.test(O.layers)&&Ad(De,B,O,Pe,Xe,He)}}function Ad(E,B,O,z,J,we){E.onBeforeRender(p,B,O,z,J,we),E.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),J.onBeforeRender(p,B,O,z,E,we),J.transparent===!0&&J.side===ui?(J.side=Pt,J.needsUpdate=!0,p.renderBufferDirect(O,B,z,J,E,we),J.side=hi,J.needsUpdate=!0,p.renderBufferDirect(O,B,z,J,E,we),J.side=ui):p.renderBufferDirect(O,B,z,J,E,we),E.onAfterRender(p,B,O,z,J,we)}function Do(E,B,O){B.isScene!==!0&&(B=ze);const z=W.get(E),J=d.state.lights,we=d.state.shadowsArray,Ae=J.state.version,De=xe.getParameters(E,J.state,we,B,O),Pe=xe.getProgramCacheKey(De);let Xe=z.programs;z.environment=E.isMeshStandardMaterial?B.environment:null,z.fog=B.fog,z.envMap=(E.isMeshStandardMaterial?pe:ee).get(E.envMap||z.environment),Xe===void 0&&(E.addEventListener("dispose",re),Xe=new Map,z.programs=Xe);let He=Xe.get(Pe);if(He!==void 0){if(z.currentProgram===He&&z.lightsStateVersion===Ae)return Wl(E,De),He}else De.uniforms=xe.getUniforms(E),E.onBuild(O,De,p),E.onBeforeCompile(De,p),He=xe.acquireProgram(De,Pe),Xe.set(Pe,He),z.uniforms=De.uniforms;const ke=z.uniforms;(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(ke.clippingPlanes=w.uniform),Wl(E,De),z.needsLights=Ld(E),z.lightsStateVersion=Ae,z.needsLights&&(ke.ambientLightColor.value=J.state.ambient,ke.lightProbe.value=J.state.probe,ke.directionalLights.value=J.state.directional,ke.directionalLightShadows.value=J.state.directionalShadow,ke.spotLights.value=J.state.spot,ke.spotLightShadows.value=J.state.spotShadow,ke.rectAreaLights.value=J.state.rectArea,ke.ltc_1.value=J.state.rectAreaLTC1,ke.ltc_2.value=J.state.rectAreaLTC2,ke.pointLights.value=J.state.point,ke.pointLightShadows.value=J.state.pointShadow,ke.hemisphereLights.value=J.state.hemi,ke.directionalShadowMap.value=J.state.directionalShadowMap,ke.directionalShadowMatrix.value=J.state.directionalShadowMatrix,ke.spotShadowMap.value=J.state.spotShadowMap,ke.spotShadowMatrix.value=J.state.spotShadowMatrix,ke.pointShadowMap.value=J.state.pointShadowMap,ke.pointShadowMatrix.value=J.state.pointShadowMatrix);const et=He.getUniforms(),kn=Ln.seqWithValue(et.seq,ke);return z.currentProgram=He,z.uniformsList=kn,He}function Wl(E,B){const O=W.get(E);O.outputEncoding=B.outputEncoding,O.instancing=B.instancing,O.skinning=B.skinning,O.morphTargets=B.morphTargets,O.morphNormals=B.morphNormals,O.morphColors=B.morphColors,O.morphTargetsCount=B.morphTargetsCount,O.numClippingPlanes=B.numClippingPlanes,O.numIntersection=B.numClipIntersection,O.vertexAlphas=B.vertexAlphas,O.vertexTangents=B.vertexTangents,O.toneMapping=B.toneMapping}function Cd(E,B,O,z,J){B.isScene!==!0&&(B=ze),Y.resetTextureUnits();const we=B.fog,Ae=z.isMeshStandardMaterial?B.environment:null,De=M===null?p.outputEncoding:M.isXRRenderTarget===!0?M.texture.encoding:nn,Pe=(z.isMeshStandardMaterial?pe:ee).get(z.envMap||Ae),Xe=z.vertexColors===!0&&!!O.attributes.color&&O.attributes.color.itemSize===4,He=!!z.normalMap&&!!O.attributes.tangent,ke=!!O.morphAttributes.position,et=!!O.morphAttributes.normal,kn=!!O.morphAttributes.color,Ti=z.toneMapped?p.toneMapping:Qt,Ai=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,Zt=Ai!==void 0?Ai.length:0,We=W.get(z),Ci=d.state.lights;if(D===!0&&(X===!0||E!==b)){const Ut=E===b&&z.id===_;w.setState(z,E,Ut)}let at=!1;z.version===We.__version?(We.needsLights&&We.lightsStateVersion!==Ci.state.version||We.outputEncoding!==De||J.isInstancedMesh&&We.instancing===!1||!J.isInstancedMesh&&We.instancing===!0||J.isSkinnedMesh&&We.skinning===!1||!J.isSkinnedMesh&&We.skinning===!0||We.envMap!==Pe||z.fog&&We.fog!==we||We.numClippingPlanes!==void 0&&(We.numClippingPlanes!==w.numPlanes||We.numIntersection!==w.numIntersection)||We.vertexAlphas!==Xe||We.vertexTangents!==He||We.morphTargets!==ke||We.morphNormals!==et||We.morphColors!==kn||We.toneMapping!==Ti||Re.isWebGL2===!0&&We.morphTargetsCount!==Zt)&&(at=!0):(at=!0,We.__version=z.version);let $t=We.currentProgram;at===!0&&($t=Do(z,B,J));let _n=!1,_r=!1,Fo=!1;const _t=$t.getUniforms(),vr=We.uniforms;if(ne.useProgram($t.program)&&(_n=!0,_r=!0,Fo=!0),z.id!==_&&(_=z.id,_r=!0),_n||b!==E){if(_t.setValue(q,"projectionMatrix",E.projectionMatrix),Re.logarithmicDepthBuffer&&_t.setValue(q,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),b!==E&&(b=E,_r=!0,Fo=!0),z.isShaderMaterial||z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshStandardMaterial||z.envMap){const Ut=_t.map.cameraPosition;Ut!==void 0&&Ut.setValue(q,ge.setFromMatrixPosition(E.matrixWorld))}(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial)&&_t.setValue(q,"isOrthographic",E.isOrthographicCamera===!0),(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial||z.isShadowMaterial||J.isSkinnedMesh)&&_t.setValue(q,"viewMatrix",E.matrixWorldInverse)}if(J.isSkinnedMesh){_t.setOptional(q,J,"bindMatrix"),_t.setOptional(q,J,"bindMatrixInverse");const Ut=J.skeleton;Ut&&(Re.floatVertexTextures?(Ut.boneTexture===null&&Ut.computeBoneTexture(),_t.setValue(q,"boneTexture",Ut.boneTexture,Y),_t.setValue(q,"boneTextureSize",Ut.boneTextureSize)):_t.setOptional(q,Ut,"boneMatrices"))}const Bo=O.morphAttributes;return(Bo.position!==void 0||Bo.normal!==void 0||Bo.color!==void 0&&Re.isWebGL2===!0)&&le.update(J,O,z,$t),(_r||We.receiveShadow!==J.receiveShadow)&&(We.receiveShadow=J.receiveShadow,_t.setValue(q,"receiveShadow",J.receiveShadow)),_r&&(_t.setValue(q,"toneMappingExposure",p.toneMappingExposure),We.needsLights&&Rd(vr,Fo),we&&z.fog&&Ke.refreshFogUniforms(vr,we),Ke.refreshMaterialUniforms(vr,z,v,I,$),Ln.upload(q,We.uniformsList,vr,Y)),z.isShaderMaterial&&z.uniformsNeedUpdate===!0&&(Ln.upload(q,We.uniformsList,vr,Y),z.uniformsNeedUpdate=!1),z.isSpriteMaterial&&_t.setValue(q,"center",J.center),_t.setValue(q,"modelViewMatrix",J.modelViewMatrix),_t.setValue(q,"normalMatrix",J.normalMatrix),_t.setValue(q,"modelMatrix",J.matrixWorld),$t}function Rd(E,B){E.ambientLightColor.needsUpdate=B,E.lightProbe.needsUpdate=B,E.directionalLights.needsUpdate=B,E.directionalLightShadows.needsUpdate=B,E.pointLights.needsUpdate=B,E.pointLightShadows.needsUpdate=B,E.spotLights.needsUpdate=B,E.spotLightShadows.needsUpdate=B,E.rectAreaLights.needsUpdate=B,E.hemisphereLights.needsUpdate=B}function Ld(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return M},this.setRenderTargetTextures=function(E,B,O){W.get(E.texture).__webglTexture=B,W.get(E.depthTexture).__webglTexture=O;const z=W.get(E);z.__hasExternalTextures=!0,z.__hasExternalTextures&&(z.__autoAllocateDepthBuffer=O===void 0,z.__autoAllocateDepthBuffer||Ce.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),z.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(E,B){const O=W.get(E);O.__webglFramebuffer=B,O.__useDefaultFramebuffer=B===void 0},this.setRenderTarget=function(E,B=0,O=0){M=E,x=B,y=O;let z=!0;if(E){const Pe=W.get(E);Pe.__useDefaultFramebuffer!==void 0?(ne.bindFramebuffer(36160,null),z=!1):Pe.__webglFramebuffer===void 0?Y.setupRenderTarget(E):Pe.__hasExternalTextures&&Y.rebindTextures(E,W.get(E.texture).__webglTexture,W.get(E.depthTexture).__webglTexture)}let J=null,we=!1,Ae=!1;if(E){const Pe=E.texture;(Pe.isData3DTexture||Pe.isDataArrayTexture)&&(Ae=!0);const Xe=W.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(J=Xe[B],we=!0):Re.isWebGL2&&E.samples>0&&Y.useMultisampledRTT(E)===!1?J=W.get(E).__webglMultisampledFramebuffer:J=Xe,A.copy(E.viewport),R.copy(E.scissor),P=E.scissorTest}else A.copy(F).multiplyScalar(v).floor(),R.copy(U).multiplyScalar(v).floor(),P=N;if(ne.bindFramebuffer(36160,J)&&Re.drawBuffers&&z&&ne.drawBuffers(E,J),ne.viewport(A),ne.scissor(R),ne.setScissorTest(P),we){const Pe=W.get(E.texture);q.framebufferTexture2D(36160,36064,34069+B,Pe.__webglTexture,O)}else if(Ae){const Pe=W.get(E.texture),Xe=B||0;q.framebufferTextureLayer(36160,36064,Pe.__webglTexture,O||0,Xe)}_=-1},this.readRenderTargetPixels=function(E,B,O,z,J,we,Ae){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let De=W.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&Ae!==void 0&&(De=De[Ae]),De){ne.bindFramebuffer(36160,De);try{const Pe=E.texture,Xe=Pe.format,He=Pe.type;if(Xe!==Lt&&V.convert(Xe)!==q.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ke=He===si&&(Ce.has("EXT_color_buffer_half_float")||Re.isWebGL2&&Ce.has("EXT_color_buffer_float"));if(He!==Dn&&V.convert(He)!==q.getParameter(35738)&&!(He===fn&&(Re.isWebGL2||Ce.has("OES_texture_float")||Ce.has("WEBGL_color_buffer_float")))&&!ke){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=E.width-z&&O>=0&&O<=E.height-J&&q.readPixels(B,O,z,J,V.convert(Xe),V.convert(He),we)}finally{const Pe=M!==null?W.get(M).__webglFramebuffer:null;ne.bindFramebuffer(36160,Pe)}}},this.copyFramebufferToTexture=function(E,B,O=0){if(B.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}const z=Math.pow(2,-O),J=Math.floor(B.image.width*z),we=Math.floor(B.image.height*z);Y.setTexture2D(B,0),q.copyTexSubImage2D(3553,O,0,0,E.x,E.y,J,we),ne.unbindTexture()},this.copyTextureToTexture=function(E,B,O,z=0){const J=B.image.width,we=B.image.height,Ae=V.convert(O.format),De=V.convert(O.type);Y.setTexture2D(O,0),q.pixelStorei(37440,O.flipY),q.pixelStorei(37441,O.premultiplyAlpha),q.pixelStorei(3317,O.unpackAlignment),B.isDataTexture?q.texSubImage2D(3553,z,E.x,E.y,J,we,Ae,De,B.image.data):B.isCompressedTexture?q.compressedTexSubImage2D(3553,z,E.x,E.y,B.mipmaps[0].width,B.mipmaps[0].height,Ae,B.mipmaps[0].data):q.texSubImage2D(3553,z,E.x,E.y,Ae,De,B.image),z===0&&O.generateMipmaps&&q.generateMipmap(3553),ne.unbindTexture()},this.copyTextureToTexture3D=function(E,B,O,z,J=0){if(p.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const we=E.max.x-E.min.x+1,Ae=E.max.y-E.min.y+1,De=E.max.z-E.min.z+1,Pe=V.convert(z.format),Xe=V.convert(z.type);let He;if(z.isData3DTexture)Y.setTexture3D(z,0),He=32879;else if(z.isDataArrayTexture)Y.setTexture2DArray(z,0),He=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}q.pixelStorei(37440,z.flipY),q.pixelStorei(37441,z.premultiplyAlpha),q.pixelStorei(3317,z.unpackAlignment);const ke=q.getParameter(3314),et=q.getParameter(32878),kn=q.getParameter(3316),Ti=q.getParameter(3315),Ai=q.getParameter(32877),Zt=O.isCompressedTexture?O.mipmaps[0]:O.image;q.pixelStorei(3314,Zt.width),q.pixelStorei(32878,Zt.height),q.pixelStorei(3316,E.min.x),q.pixelStorei(3315,E.min.y),q.pixelStorei(32877,E.min.z),O.isDataTexture||O.isData3DTexture?q.texSubImage3D(He,J,B.x,B.y,B.z,we,Ae,De,Pe,Xe,Zt.data):O.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),q.compressedTexSubImage3D(He,J,B.x,B.y,B.z,we,Ae,De,Pe,Zt.data)):q.texSubImage3D(He,J,B.x,B.y,B.z,we,Ae,De,Pe,Xe,Zt),q.pixelStorei(3314,ke),q.pixelStorei(32878,et),q.pixelStorei(3316,kn),q.pixelStorei(3315,Ti),q.pixelStorei(32877,Ai),J===0&&z.generateMipmaps&&q.generateMipmap(He),ne.unbindTexture()},this.initTexture=function(E){Y.setTexture2D(E,0),ne.unbindTexture()},this.resetState=function(){x=0,y=0,M=null,ne.reset(),Le.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Je.prototype.isWebGLRenderer=!0;class Uu extends Je{}Uu.prototype.isWebGL1Renderer=!0;class ts{constructor(e,t=25e-5){this.name="",this.color=new ae(e),this.density=t}clone(){return new ts(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}ts.prototype.isFogExp2=!0;class ns{constructor(e,t=1,n=1e3){this.name="",this.color=new ae(e),this.near=t,this.far=n}clone(){return new ns(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}ns.prototype.isFog=!0;class vo extends Ne{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}vo.prototype.isScene=!0;class bi{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ki,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=It()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=It()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=It()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}bi.prototype.isInterleavedBuffer=!0;const bt=new S;class Fn{constructor(e,t,n,i=!1){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)bt.fromBufferAttribute(this,t),bt.applyMatrix4(e),this.setXYZ(t,bt.x,bt.y,bt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)bt.fromBufferAttribute(this,t),bt.applyNormalMatrix(e),this.setXYZ(t,bt.x,bt.y,bt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)bt.fromBufferAttribute(this,t),bt.transformDirection(e),this.setXYZ(t,bt.x,bt.y,bt.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return new Oe(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Fn(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Fn.prototype.isInterleavedBufferAttribute=!0;class Mo extends ot{constructor(e){super(),this.type="SpriteMaterial",this.color=new ae(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}Mo.prototype.isSpriteMaterial=!0;let Vi;const Sr=new S,Wi=new S,qi=new S,Xi=new Z,Er=new Z,Ou=new fe,Cs=new S,Tr=new S,Rs=new S,Ec=new Z,la=new Z,Tc=new Z;class bo extends Ne{constructor(e){if(super(),this.type="Sprite",Vi===void 0){Vi=new ye;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new bi(t,5);Vi.setIndex([0,1,2,0,2,3]),Vi.setAttribute("position",new Fn(n,3,0,!1)),Vi.setAttribute("uv",new Fn(n,2,3,!1))}this.geometry=Vi,this.material=e!==void 0?e:new Mo,this.center=new Z(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Wi.setFromMatrixScale(this.matrixWorld),Ou.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),qi.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Wi.multiplyScalar(-qi.z);const n=this.material.rotation;let i,r;n!==0&&(r=Math.cos(n),i=Math.sin(n));const o=this.center;Ls(Cs.set(-.5,-.5,0),qi,o,Wi,i,r),Ls(Tr.set(.5,-.5,0),qi,o,Wi,i,r),Ls(Rs.set(.5,.5,0),qi,o,Wi,i,r),Ec.set(0,0),la.set(1,0),Tc.set(1,1);let a=e.ray.intersectTriangle(Cs,Tr,Rs,!1,Sr);if(a===null&&(Ls(Tr.set(-.5,.5,0),qi,o,Wi,i,r),la.set(0,1),a=e.ray.intersectTriangle(Cs,Rs,Tr,!1,Sr),a===null))return;const l=e.ray.origin.distanceTo(Sr);l<e.near||l>e.far||t.push({distance:l,point:Sr.clone(),uv:st.getUV(Sr,Cs,Tr,Rs,Ec,la,Tc,new Z),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}bo.prototype.isSprite=!0;function Ls(s,e,t,n,i,r){Xi.subVectors(s,t).addScalar(.5).multiply(n),i!==void 0?(Er.x=r*Xi.x-i*Xi.y,Er.y=i*Xi.x+r*Xi.y):Er.copy(Xi),s.copy(e),s.x+=Er.x,s.y+=Er.y,s.applyMatrix4(Ou)}const Ps=new S,Ac=new S;class Hu extends Ne{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const r=t[n];this.addLevel(r.object.clone(),r.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const n=this.levels;let i;for(i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Ps.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Ps);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Ps.setFromMatrixPosition(e.matrixWorld),Ac.setFromMatrixPosition(this.matrixWorld);const n=Ps.distanceTo(Ac)/e.zoom;t[0].object.visible=!0;let i,r;for(i=1,r=t.length;i<r&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;i<r;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,r=n.length;i<r;i++){const o=n[i];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const Cc=new S,Rc=new qe,Lc=new qe,l0=new S,Pc=new fe;class wo extends ht{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new fe,this.bindMatrixInverse=new fe}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new qe,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,i=this.geometry;Rc.fromBufferAttribute(i.attributes.skinIndex,e),Lc.fromBufferAttribute(i.attributes.skinWeight,e),Cc.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const o=Lc.getComponent(r);if(o!==0){const a=Rc.getComponent(r);Pc.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(l0.copy(Cc).applyMatrix4(Pc),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}wo.prototype.isSkinnedMesh=!0;class So extends Ne{constructor(){super(),this.type="Bone"}}So.prototype.isBone=!0;class ci extends ut{constructor(e=null,t=1,n=1,i,r,o,a,l,c=ct,h=ct,u,d){super(null,o,a,l,c,h,i,r,u,d),this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}ci.prototype.isDataTexture=!0;const Ic=new fe,c0=new fe;class Eo{constructor(e=[],t=[]){this.uuid=It(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new fe)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new fe;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,o=e.length;r<o;r++){const a=e[r]?e[r].matrixWorld:c0;Ic.multiplyMatrices(a,t[r]),Ic.toArray(n,r*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Eo(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=pu(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new ci(t,e,e,Lt,fn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const r=e.bones[n];let o=t[r];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),o=new So),this.bones.push(o),this.boneInverses.push(new fe().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,r=t.length;i<r;i++){const o=t[i];e.bones.push(o.uuid);const a=n[i];e.boneInverses.push(a.toArray())}return e}}class pi extends Oe{constructor(e,t,n,i=1){typeof n=="number"&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}pi.prototype.isInstancedBufferAttribute=!0;const Dc=new fe,Fc=new fe,Is=[],Ar=new ht;class ll extends ht{constructor(e,t,n){super(e,t),this.instanceMatrix=new pi(new Float32Array(n*16),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Ar.geometry=this.geometry,Ar.material=this.material,Ar.material!==void 0)for(let r=0;r<i;r++){this.getMatrixAt(r,Dc),Fc.multiplyMatrices(n,Dc),Ar.matrixWorld=Fc,Ar.raycast(e,Is);for(let o=0,a=Is.length;o<a;o++){const l=Is[o];l.instanceId=r,l.object=this,t.push(l)}Is.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new pi(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}ll.prototype.isInstancedMesh=!0;class gt extends ot{constructor(e){super(),this.type="LineBasicMaterial",this.color=new ae(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}gt.prototype.isLineBasicMaterial=!0;const Bc=new S,Nc=new S,zc=new fe,ca=new Hn,Ds=new On;class gn extends Ne{constructor(e=new ye,t=new gt){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,r=t.count;i<r;i++)Bc.fromBufferAttribute(t,i-1),Nc.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=Bc.distanceTo(Nc);e.setAttribute("lineDistance",new de(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ds.copy(n.boundingSphere),Ds.applyMatrix4(i),Ds.radius+=r,e.ray.intersectsSphere(Ds)===!1)return;zc.copy(i).invert(),ca.copy(e.ray).applyMatrix4(zc);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=new S,h=new S,u=new S,d=new S,f=this.isLineSegments?2:1;if(n.isBufferGeometry){const g=n.index,m=n.attributes.position;if(g!==null){const x=Math.max(0,o.start),y=Math.min(g.count,o.start+o.count);for(let M=x,_=y-1;M<_;M+=f){const b=g.getX(M),A=g.getX(M+1);if(c.fromBufferAttribute(m,b),h.fromBufferAttribute(m,A),ca.distanceSqToSegment(c,h,d,u)>l)continue;d.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(d);P<e.near||P>e.far||t.push({distance:P,point:u.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const x=Math.max(0,o.start),y=Math.min(m.count,o.start+o.count);for(let M=x,_=y-1;M<_;M+=f){if(c.fromBufferAttribute(m,M),h.fromBufferAttribute(m,M+1),ca.distanceSqToSegment(c,h,d,u)>l)continue;d.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(d);A<e.near||A>e.far||t.push({distance:A,point:u.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r<o;r++){const a=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}gn.prototype.isLine=!0;const Uc=new S,Oc=new S;class At extends gn{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,r=t.count;i<r;i+=2)Uc.fromBufferAttribute(t,i),Oc.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Uc.distanceTo(Oc);e.setAttribute("lineDistance",new de(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}At.prototype.isLineSegments=!0;class cl extends gn{constructor(e,t){super(e,t),this.type="LineLoop"}}cl.prototype.isLineLoop=!0;class wi extends ot{constructor(e){super(),this.type="PointsMaterial",this.color=new ae(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}wi.prototype.isPointsMaterial=!0;const Hc=new fe,Ya=new Hn,Fs=new On,Bs=new S;class is extends Ne{constructor(e=new ye,t=new wi){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Fs.copy(n.boundingSphere),Fs.applyMatrix4(i),Fs.radius+=r,e.ray.intersectsSphere(Fs)===!1)return;Hc.copy(i).invert(),Ya.copy(e.ray).applyMatrix4(Hc);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(n.isBufferGeometry){const c=n.index,u=n.attributes.position;if(c!==null){const d=Math.max(0,o.start),f=Math.min(c.count,o.start+o.count);for(let g=d,p=f;g<p;g++){const m=c.getX(g);Bs.fromBufferAttribute(u,m),Gc(Bs,m,l,i,e,t,this)}}else{const d=Math.max(0,o.start),f=Math.min(u.count,o.start+o.count);for(let g=d,p=f;g<p;g++)Bs.fromBufferAttribute(u,g),Gc(Bs,g,l,i,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r<o;r++){const a=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}is.prototype.isPoints=!0;function Gc(s,e,t,n,i,r,o){const a=Ya.distanceSqToPoint(s);if(a<t){const l=new S;Ya.closestPointToPoint(s,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class Gu extends ut{constructor(e,t,n,i,r,o,a,l,c){super(e,t,n,i,r,o,a,l,c),this.minFilter=o!==void 0?o:it,this.magFilter=r!==void 0?r:it,this.generateMipmaps=!1;const h=this;function u(){h.needsUpdate=!0,e.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Gu.prototype.isVideoTexture=!0;class ku extends ut{constructor(e,t,n){super({width:e,height:t}),this.format=n,this.magFilter=ct,this.minFilter=ct,this.generateMipmaps=!1,this.needsUpdate=!0}}ku.prototype.isFramebufferTexture=!0;class hl extends ut{constructor(e,t,n,i,r,o,a,l,c,h,u,d){super(null,o,a,l,c,h,i,r,u,d),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}hl.prototype.isCompressedTexture=!0;class Vu extends ut{constructor(e,t,n,i,r,o,a,l,c){super(e,t,n,i,r,o,a,l,c),this.needsUpdate=!0}}Vu.prototype.isCanvasTexture=!0;class Dt{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const r=n.length;let o;t?o=t:o=e*n[r-1];let a=0,l=r-1,c;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),c=n[i]-o,c<0)a=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(r-1);const h=n[i],d=n[i+1]-h,f=(o-h)/d;return(i+f)/(r-1)}getTangent(e,t){let i=e-1e-4,r=e+1e-4;i<0&&(i=0),r>1&&(r=1);const o=this.getPoint(i),a=this.getPoint(r),l=t||(o.isVector2?new Z:new S);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new S,i=[],r=[],o=[],a=new S,l=new fe;for(let f=0;f<=e;f++){const g=f/e;i[f]=this.getTangentAt(g,new S)}r[0]=new S,o[0]=new S;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),o[0].crossVectors(i[0],r[0]);for(let f=1;f<=e;f++){if(r[f]=r[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(rt(i[f-1].dot(i[f]),-1,1));r[f].applyMatrix4(l.makeRotationAxis(a,g))}o[f].crossVectors(i[f],r[f])}if(t===!0){let f=Math.acos(rt(r[0].dot(r[e]),-1,1));f/=e,i[0].dot(a.crossVectors(r[0],r[e]))>0&&(f=-f);for(let g=1;g<=e;g++)r[g].applyMatrix4(l.makeRotationAxis(i[g],f*g)),o[g].crossVectors(i[g],r[g])}return{tangents:i,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class rs extends Dt{constructor(e=0,t=0,n=1,i=1,r=0,o=Math.PI*2,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const n=t||new Z,i=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(o?r=0:r=i),this.aClockwise===!0&&!o&&(r===i?r=-i:r=r-i);const a=this.aStartAngle+e*r;let l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const h=Math.cos(this.aRotation),u=Math.sin(this.aRotation),d=l-this.aX,f=c-this.aY;l=d*h-f*u+this.aX,c=d*u+f*h+this.aY}return n.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}rs.prototype.isEllipseCurve=!0;class ul extends rs{constructor(e,t,n,i,r,o){super(e,t,n,n,i,r,o),this.type="ArcCurve"}}ul.prototype.isArcCurve=!0;function dl(){let s=0,e=0,t=0,n=0;function i(r,o,a,l){s=r,e=a,t=-3*r+3*o-2*a-l,n=2*r-2*o+a+l}return{initCatmullRom:function(r,o,a,l,c){i(o,a,c*(a-r),c*(l-o))},initNonuniformCatmullRom:function(r,o,a,l,c,h,u){let d=(o-r)/c-(a-r)/(c+h)+(a-o)/h,f=(a-o)/h-(l-o)/(h+u)+(l-a)/u;d*=h,f*=h,i(o,a,d,f)},calc:function(r){const o=r*r,a=o*r;return s+e*r+t*o+n*a}}}const Ns=new S,ha=new dl,ua=new dl,da=new dl;class fl extends Dt{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new S){const n=t,i=this.points,r=i.length,o=(r-(this.closed?0:1))*e;let a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/r)+1)*r:l===0&&a===r-1&&(a=r-2,l=1);let c,h;this.closed||a>0?c=i[(a-1)%r]:(Ns.subVectors(i[0],i[1]).add(i[0]),c=Ns);const u=i[a%r],d=i[(a+1)%r];if(this.closed||a+2<r?h=i[(a+2)%r]:(Ns.subVectors(i[r-1],i[r-2]).add(i[r-1]),h=Ns),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let g=Math.pow(c.distanceToSquared(u),f),p=Math.pow(u.distanceToSquared(d),f),m=Math.pow(d.distanceToSquared(h),f);p<1e-4&&(p=1),g<1e-4&&(g=p),m<1e-4&&(m=p),ha.initNonuniformCatmullRom(c.x,u.x,d.x,h.x,g,p,m),ua.initNonuniformCatmullRom(c.y,u.y,d.y,h.y,g,p,m),da.initNonuniformCatmullRom(c.z,u.z,d.z,h.z,g,p,m)}else this.curveType==="catmullrom"&&(ha.initCatmullRom(c.x,u.x,d.x,h.x,this.tension),ua.initCatmullRom(c.y,u.y,d.y,h.y,this.tension),da.initCatmullRom(c.z,u.z,d.z,h.z,this.tension));return n.set(ha.calc(l),ua.calc(l),da.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new S().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}fl.prototype.isCatmullRomCurve3=!0;function kc(s,e,t,n,i){const r=(n-e)*.5,o=(i-t)*.5,a=s*s,l=s*a;return(2*t-2*n+r+o)*l+(-3*t+3*n-2*r-o)*a+r*s+t}function h0(s,e){const t=1-s;return t*t*e}function u0(s,e){return 2*(1-s)*s*e}function d0(s,e){return s*s*e}function Ir(s,e,t,n){return h0(s,e)+u0(s,t)+d0(s,n)}function f0(s,e){const t=1-s;return t*t*t*e}function p0(s,e){const t=1-s;return 3*t*t*s*e}function m0(s,e){return 3*(1-s)*s*s*e}function g0(s,e){return s*s*s*e}function Dr(s,e,t,n,i){return f0(s,e)+p0(s,t)+m0(s,n)+g0(s,i)}class To extends Dt{constructor(e=new Z,t=new Z,n=new Z,i=new Z){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Z){const n=t,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(Dr(e,i.x,r.x,o.x,a.x),Dr(e,i.y,r.y,o.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}To.prototype.isCubicBezierCurve=!0;class pl extends Dt{constructor(e=new S,t=new S,n=new S,i=new S){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new S){const n=t,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(Dr(e,i.x,r.x,o.x,a.x),Dr(e,i.y,r.y,o.y,a.y),Dr(e,i.z,r.z,o.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}pl.prototype.isCubicBezierCurve3=!0;class ss extends Dt{constructor(e=new Z,t=new Z){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Z){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new Z;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}ss.prototype.isLineCurve=!0;class Wu extends Dt{constructor(e=new S,t=new S){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new S){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Ao extends Dt{constructor(e=new Z,t=new Z,n=new Z){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Z){const n=t,i=this.v0,r=this.v1,o=this.v2;return n.set(Ir(e,i.x,r.x,o.x),Ir(e,i.y,r.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Ao.prototype.isQuadraticBezierCurve=!0;class Co extends Dt{constructor(e=new S,t=new S,n=new S){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new S){const n=t,i=this.v0,r=this.v1,o=this.v2;return n.set(Ir(e,i.x,r.x,o.x),Ir(e,i.y,r.y,o.y),Ir(e,i.z,r.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Co.prototype.isQuadraticBezierCurve3=!0;class Ro extends Dt{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Z){const n=t,i=this.points,r=(i.length-1)*e,o=Math.floor(r),a=r-o,l=i[o===0?o:o-1],c=i[o],h=i[o>i.length-2?i.length-1:o+1],u=i[o>i.length-3?i.length-1:o+2];return n.set(kc(a,l.x,c.x,h.x,u.x),kc(a,l.y,c.y,h.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new Z().fromArray(i))}return this}}Ro.prototype.isSplineCurve=!0;var ml=Object.freeze({__proto__:null,ArcCurve:ul,CatmullRomCurve3:fl,CubicBezierCurve:To,CubicBezierCurve3:pl,EllipseCurve:rs,LineCurve:ss,LineCurve3:Wu,QuadraticBezierCurve:Ao,QuadraticBezierCurve3:Co,SplineCurve:Ro});class qu extends Dt{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ss(t,e))}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=n){const o=i[r]-n,a=this.curves[r],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const o=r[i],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,l=o.getPoints(a);for(let c=0;c<l.length;c++){const h=l[c];n&&n.equals(h)||(t.push(h),n=h)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(new ml[i.type]().fromJSON(i))}return this}}class tr extends qu{constructor(e){super(),this.type="Path",this.currentPoint=new Z,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new ss(this.currentPoint.clone(),new Z(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const r=new Ao(this.currentPoint.clone(),new Z(e,t),new Z(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,r,o){const a=new To(this.currentPoint.clone(),new Z(e,t),new Z(n,i),new Z(r,o));return this.curves.push(a),this.currentPoint.set(r,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Ro(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,r,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,n,i,r,o),this}absarc(e,t,n,i,r,o){return this.absellipse(e,t,n,n,i,r,o),this}ellipse(e,t,n,i,r,o,a,l){const c=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+c,t+h,n,i,r,o,a,l),this}absellipse(e,t,n,i,r,o,a,l){const c=new rs(e,t,n,i,r,o,a,l);if(this.curves.length>0){const u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class mi extends ye{constructor(e=[new Z(0,.5),new Z(.5,0),new Z(0,-.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=rt(i,0,Math.PI*2);const r=[],o=[],a=[],l=[],c=[],h=1/t,u=new S,d=new Z,f=new S,g=new S,p=new S;let m=0,x=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:m=e[y+1].x-e[y].x,x=e[y+1].y-e[y].y,f.x=x*1,f.y=-m,f.z=x*0,p.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(p.x,p.y,p.z);break;default:m=e[y+1].x-e[y].x,x=e[y+1].y-e[y].y,f.x=x*1,f.y=-m,f.z=x*0,g.copy(f),f.x+=p.x,f.y+=p.y,f.z+=p.z,f.normalize(),l.push(f.x,f.y,f.z),p.copy(g)}for(let y=0;y<=t;y++){const M=n+y*h*i,_=Math.sin(M),b=Math.cos(M);for(let A=0;A<=e.length-1;A++){u.x=e[A].x*_,u.y=e[A].y,u.z=e[A].x*b,o.push(u.x,u.y,u.z),d.x=y/t,d.y=A/(e.length-1),a.push(d.x,d.y);const R=l[3*A+0]*_,P=l[3*A+1],H=l[3*A+0]*b;c.push(R,P,H)}}for(let y=0;y<t;y++)for(let M=0;M<e.length-1;M++){const _=M+y*e.length,b=_,A=_+e.length,R=_+e.length+1,P=_+1;r.push(b,A,P),r.push(R,P,A)}this.setIndex(r),this.setAttribute("position",new de(o,3)),this.setAttribute("uv",new de(a,2)),this.setAttribute("normal",new de(c,3))}static fromJSON(e){return new mi(e.points,e.segments,e.phiStart,e.phiLength)}}class nr extends mi{constructor(e=1,t=1,n=4,i=8){const r=new tr;r.absarc(0,-t/2,e,Math.PI*1.5,0),r.absarc(0,t/2,e,0,Math.PI*.5),super(r.getPoints(n),i),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:i}}static fromJSON(e){return new nr(e.radius,e.length,e.capSegments,e.radialSegments)}}class ir extends ye{constructor(e=1,t=8,n=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const r=[],o=[],a=[],l=[],c=new S,h=new Z;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let u=0,d=3;u<=t;u++,d+=3){const f=n+u/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),h.x=(o[d]/e+1)/2,h.y=(o[d+1]/e+1)/2,l.push(h.x,h.y)}for(let u=1;u<=t;u++)r.push(u,u+1,0);this.setIndex(r),this.setAttribute("position",new de(o,3)),this.setAttribute("normal",new de(a,3)),this.setAttribute("uv",new de(l,2))}static fromJSON(e){return new ir(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Bn extends ye{constructor(e=1,t=1,n=1,i=8,r=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:l};const c=this;i=Math.floor(i),r=Math.floor(r);const h=[],u=[],d=[],f=[];let g=0;const p=[],m=n/2;let x=0;y(),o===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(h),this.setAttribute("position",new de(u,3)),this.setAttribute("normal",new de(d,3)),this.setAttribute("uv",new de(f,2));function y(){const _=new S,b=new S;let A=0;const R=(t-e)/n;for(let P=0;P<=r;P++){const H=[],I=P/r,v=I*(t-e)+e;for(let C=0;C<=i;C++){const j=C/i,F=j*l+a,U=Math.sin(F),N=Math.cos(F);b.x=v*U,b.y=-I*n+m,b.z=v*N,u.push(b.x,b.y,b.z),_.set(U,R,N).normalize(),d.push(_.x,_.y,_.z),f.push(j,1-I),H.push(g++)}p.push(H)}for(let P=0;P<i;P++)for(let H=0;H<r;H++){const I=p[H][P],v=p[H+1][P],C=p[H+1][P+1],j=p[H][P+1];h.push(I,v,j),h.push(v,C,j),A+=6}c.addGroup(x,A,0),x+=A}function M(_){const b=g,A=new Z,R=new S;let P=0;const H=_===!0?e:t,I=_===!0?1:-1;for(let C=1;C<=i;C++)u.push(0,m*I,0),d.push(0,I,0),f.push(.5,.5),g++;const v=g;for(let C=0;C<=i;C++){const F=C/i*l+a,U=Math.cos(F),N=Math.sin(F);R.x=H*N,R.y=m*I,R.z=H*U,u.push(R.x,R.y,R.z),d.push(0,I,0),A.x=U*.5+.5,A.y=N*.5*I+.5,f.push(A.x,A.y),g++}for(let C=0;C<i;C++){const j=b+C,F=v+C;_===!0?h.push(F,F+1,j):h.push(F+1,F,j),P+=3}c.addGroup(x,P,_===!0?1:2),x+=P}}static fromJSON(e){return new Bn(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class rr extends Bn{constructor(e=1,t=1,n=8,i=1,r=!1,o=0,a=Math.PI*2){super(0,e,t,n,i,r,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}static fromJSON(e){return new rr(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class rn extends ye{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const r=[],o=[];a(i),c(n),h(),this.setAttribute("position",new de(r,3)),this.setAttribute("normal",new de(r.slice(),3)),this.setAttribute("uv",new de(o,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function a(y){const M=new S,_=new S,b=new S;for(let A=0;A<t.length;A+=3)f(t[A+0],M),f(t[A+1],_),f(t[A+2],b),l(M,_,b,y)}function l(y,M,_,b){const A=b+1,R=[];for(let P=0;P<=A;P++){R[P]=[];const H=y.clone().lerp(_,P/A),I=M.clone().lerp(_,P/A),v=A-P;for(let C=0;C<=v;C++)C===0&&P===A?R[P][C]=H:R[P][C]=H.clone().lerp(I,C/v)}for(let P=0;P<A;P++)for(let H=0;H<2*(A-P)-1;H++){const I=Math.floor(H/2);H%2===0?(d(R[P][I+1]),d(R[P+1][I]),d(R[P][I])):(d(R[P][I+1]),d(R[P+1][I+1]),d(R[P+1][I]))}}function c(y){const M=new S;for(let _=0;_<r.length;_+=3)M.x=r[_+0],M.y=r[_+1],M.z=r[_+2],M.normalize().multiplyScalar(y),r[_+0]=M.x,r[_+1]=M.y,r[_+2]=M.z}function h(){const y=new S;for(let M=0;M<r.length;M+=3){y.x=r[M+0],y.y=r[M+1],y.z=r[M+2];const _=m(y)/2/Math.PI+.5,b=x(y)/Math.PI+.5;o.push(_,1-b)}g(),u()}function u(){for(let y=0;y<o.length;y+=6){const M=o[y+0],_=o[y+2],b=o[y+4],A=Math.max(M,_,b),R=Math.min(M,_,b);A>.9&&R<.1&&(M<.2&&(o[y+0]+=1),_<.2&&(o[y+2]+=1),b<.2&&(o[y+4]+=1))}}function d(y){r.push(y.x,y.y,y.z)}function f(y,M){const _=y*3;M.x=e[_+0],M.y=e[_+1],M.z=e[_+2]}function g(){const y=new S,M=new S,_=new S,b=new S,A=new Z,R=new Z,P=new Z;for(let H=0,I=0;H<r.length;H+=9,I+=6){y.set(r[H+0],r[H+1],r[H+2]),M.set(r[H+3],r[H+4],r[H+5]),_.set(r[H+6],r[H+7],r[H+8]),A.set(o[I+0],o[I+1]),R.set(o[I+2],o[I+3]),P.set(o[I+4],o[I+5]),b.copy(y).add(M).add(_).divideScalar(3);const v=m(b);p(A,I+0,y,v),p(R,I+2,M,v),p(P,I+4,_,v)}}function p(y,M,_,b){b<0&&y.x===1&&(o[M]=y.x-1),_.x===0&&_.z===0&&(o[M]=b/2/Math.PI+.5)}function m(y){return Math.atan2(y.z,-y.x)}function x(y){return Math.atan2(-y.y,Math.sqrt(y.x*y.x+y.z*y.z))}}static fromJSON(e){return new rn(e.vertices,e.indices,e.radius,e.details)}}class sr extends rn{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(r,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new sr(e.radius,e.detail)}}const zs=new S,Us=new S,fa=new S,Os=new st;class gl extends ye{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const i=Math.pow(10,4),r=Math.cos(ai*t),o=e.getIndex(),a=e.getAttribute("position"),l=o?o.count:a.count,c=[0,0,0],h=["a","b","c"],u=new Array(3),d={},f=[];for(let g=0;g<l;g+=3){o?(c[0]=o.getX(g),c[1]=o.getX(g+1),c[2]=o.getX(g+2)):(c[0]=g,c[1]=g+1,c[2]=g+2);const{a:p,b:m,c:x}=Os;if(p.fromBufferAttribute(a,c[0]),m.fromBufferAttribute(a,c[1]),x.fromBufferAttribute(a,c[2]),Os.getNormal(fa),u[0]=`${Math.round(p.x*i)},${Math.round(p.y*i)},${Math.round(p.z*i)}`,u[1]=`${Math.round(m.x*i)},${Math.round(m.y*i)},${Math.round(m.z*i)}`,u[2]=`${Math.round(x.x*i)},${Math.round(x.y*i)},${Math.round(x.z*i)}`,!(u[0]===u[1]||u[1]===u[2]||u[2]===u[0]))for(let y=0;y<3;y++){const M=(y+1)%3,_=u[y],b=u[M],A=Os[h[y]],R=Os[h[M]],P=`${_}_${b}`,H=`${b}_${_}`;H in d&&d[H]?(fa.dot(d[H].normal)<=r&&(f.push(A.x,A.y,A.z),f.push(R.x,R.y,R.z)),d[H]=null):P in d||(d[P]={index0:c[y],index1:c[M],normal:fa.clone()})}}for(const g in d)if(d[g]){const{index0:p,index1:m}=d[g];zs.fromBufferAttribute(a,p),Us.fromBufferAttribute(a,m),f.push(zs.x,zs.y,zs.z),f.push(Us.x,Us.y,Us.z)}this.setAttribute("position",new de(f,3))}}}class en extends tr{constructor(e){super(e),this.uuid=It(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(new tr().fromJSON(i))}return this}}const x0={triangulate:function(s,e,t=2){const n=e&&e.length,i=n?e[0]*t:s.length;let r=Xu(s,0,i,t,!0);const o=[];if(!r||r.next===r.prev)return o;let a,l,c,h,u,d,f;if(n&&(r=b0(s,e,r,t)),s.length>80*t){a=c=s[0],l=h=s[1];for(let g=t;g<i;g+=t)u=s[g],d=s[g+1],u<a&&(a=u),d<l&&(l=d),u>c&&(c=u),d>h&&(h=d);f=Math.max(c-a,h-l),f=f!==0?1/f:0}return Vr(r,o,t,a,l,f),o}};function Xu(s,e,t,n,i){let r,o;if(i===D0(s,e,t,n)>0)for(r=e;r<t;r+=n)o=Vc(r,s[r],s[r+1],o);else for(r=t-n;r>=e;r-=n)o=Vc(r,s[r],s[r+1],o);return o&&Lo(o,o.next)&&(qr(o),o=o.next),o}function Nn(s,e){if(!s)return s;e||(e=s);let t=s,n;do if(n=!1,!t.steiner&&(Lo(t,t.next)||Qe(t.prev,t,t.next)===0)){if(qr(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Vr(s,e,t,n,i,r,o){if(!s)return;!o&&r&&A0(s,n,i,r);let a=s,l,c;for(;s.prev!==s.next;){if(l=s.prev,c=s.next,r?_0(s,n,i,r):y0(s)){e.push(l.i/t),e.push(s.i/t),e.push(c.i/t),qr(s),s=c.next,a=c.next;continue}if(s=c,s===a){o?o===1?(s=v0(Nn(s),e,t),Vr(s,e,t,n,i,r,2)):o===2&&M0(s,e,t,n,i,r):Vr(Nn(s),e,t,n,i,r,1);break}}}function y0(s){const e=s.prev,t=s,n=s.next;if(Qe(e,t,n)>=0)return!1;let i=s.next.next;for(;i!==s.prev;){if($i(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Qe(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function _0(s,e,t,n){const i=s.prev,r=s,o=s.next;if(Qe(i,r,o)>=0)return!1;const a=i.x<r.x?i.x<o.x?i.x:o.x:r.x<o.x?r.x:o.x,l=i.y<r.y?i.y<o.y?i.y:o.y:r.y<o.y?r.y:o.y,c=i.x>r.x?i.x>o.x?i.x:o.x:r.x>o.x?r.x:o.x,h=i.y>r.y?i.y>o.y?i.y:o.y:r.y>o.y?r.y:o.y,u=Za(a,l,e,t,n),d=Za(c,h,e,t,n);let f=s.prevZ,g=s.nextZ;for(;f&&f.z>=u&&g&&g.z<=d;){if(f!==s.prev&&f!==s.next&&$i(i.x,i.y,r.x,r.y,o.x,o.y,f.x,f.y)&&Qe(f.prev,f,f.next)>=0||(f=f.prevZ,g!==s.prev&&g!==s.next&&$i(i.x,i.y,r.x,r.y,o.x,o.y,g.x,g.y)&&Qe(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;f&&f.z>=u;){if(f!==s.prev&&f!==s.next&&$i(i.x,i.y,r.x,r.y,o.x,o.y,f.x,f.y)&&Qe(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;g&&g.z<=d;){if(g!==s.prev&&g!==s.next&&$i(i.x,i.y,r.x,r.y,o.x,o.y,g.x,g.y)&&Qe(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function v0(s,e,t){let n=s;do{const i=n.prev,r=n.next.next;!Lo(i,r)&&Ju(i,n,n.next,r)&&Wr(i,r)&&Wr(r,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(r.i/t),qr(n),qr(n.next),n=s=r),n=n.next}while(n!==s);return Nn(n)}function M0(s,e,t,n,i,r){let o=s;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&L0(o,a)){let l=Yu(o,a);o=Nn(o,o.next),l=Nn(l,l.next),Vr(o,e,t,n,i,r),Vr(l,e,t,n,i,r);return}a=a.next}o=o.next}while(o!==s)}function b0(s,e,t,n){const i=[];let r,o,a,l,c;for(r=0,o=e.length;r<o;r++)a=e[r]*n,l=r<o-1?e[r+1]*n:s.length,c=Xu(s,a,l,n,!1),c===c.next&&(c.steiner=!0),i.push(R0(c));for(i.sort(w0),r=0;r<i.length;r++)S0(i[r],t),t=Nn(t,t.next);return t}function w0(s,e){return s.x-e.x}function S0(s,e){if(e=E0(s,e),e){const t=Yu(e,s);Nn(e,e.next),Nn(t,t.next)}}function E0(s,e){let t=e;const n=s.x,i=s.y;let r=-1/0,o;do{if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>r){if(r=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(n===r)return o;const a=o,l=o.x,c=o.y;let h=1/0,u;t=o;do n>=t.x&&t.x>=l&&n!==t.x&&$i(i<c?n:r,i,l,c,i<c?r:n,i,t.x,t.y)&&(u=Math.abs(i-t.y)/(n-t.x),Wr(t,s)&&(u<h||u===h&&(t.x>o.x||t.x===o.x&&T0(o,t)))&&(o=t,h=u)),t=t.next;while(t!==a);return o}function T0(s,e){return Qe(s.prev,s,e.prev)<0&&Qe(e.next,s,s.next)<0}function A0(s,e,t,n){let i=s;do i.z===null&&(i.z=Za(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==s);i.prevZ.nextZ=null,i.prevZ=null,C0(i)}function C0(s){let e,t,n,i,r,o,a,l,c=1;do{for(t=s,s=null,r=null,o=0;t;){for(o++,n=t,a=0,e=0;e<c&&(a++,n=n.nextZ,!!n);e++);for(l=c;a>0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),r?r.nextZ=i:s=i,i.prevZ=r,r=i;t=n}r.nextZ=null,c*=2}while(o>1);return s}function Za(s,e,t,n,i){return s=32767*(s-t)*i,e=32767*(e-n)*i,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,s|e<<1}function R0(s){let e=s,t=s;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==s);return t}function $i(s,e,t,n,i,r,o,a){return(i-o)*(e-a)-(s-o)*(r-a)>=0&&(s-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(r-a)-(i-o)*(n-a)>=0}function L0(s,e){return s.next.i!==e.i&&s.prev.i!==e.i&&!P0(s,e)&&(Wr(s,e)&&Wr(e,s)&&I0(s,e)&&(Qe(s.prev,s,e.prev)||Qe(s,e.prev,e))||Lo(s,e)&&Qe(s.prev,s,s.next)>0&&Qe(e.prev,e,e.next)>0)}function Qe(s,e,t){return(e.y-s.y)*(t.x-e.x)-(e.x-s.x)*(t.y-e.y)}function Lo(s,e){return s.x===e.x&&s.y===e.y}function Ju(s,e,t,n){const i=Gs(Qe(s,e,t)),r=Gs(Qe(s,e,n)),o=Gs(Qe(t,n,s)),a=Gs(Qe(t,n,e));return!!(i!==r&&o!==a||i===0&&Hs(s,t,e)||r===0&&Hs(s,n,e)||o===0&&Hs(t,s,n)||a===0&&Hs(t,e,n))}function Hs(s,e,t){return e.x<=Math.max(s.x,t.x)&&e.x>=Math.min(s.x,t.x)&&e.y<=Math.max(s.y,t.y)&&e.y>=Math.min(s.y,t.y)}function Gs(s){return s>0?1:s<0?-1:0}function P0(s,e){let t=s;do{if(t.i!==s.i&&t.next.i!==s.i&&t.i!==e.i&&t.next.i!==e.i&&Ju(t,t.next,s,e))return!0;t=t.next}while(t!==s);return!1}function Wr(s,e){return Qe(s.prev,s,s.next)<0?Qe(s,e,s.next)>=0&&Qe(s,s.prev,e)>=0:Qe(s,e,s.prev)<0||Qe(s,s.next,e)<0}function I0(s,e){let t=s,n=!1;const i=(s.x+e.x)/2,r=(s.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&i<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==s);return n}function Yu(s,e){const t=new $a(s.i,s.x,s.y),n=new $a(e.i,e.x,e.y),i=s.next,r=e.prev;return s.next=e,e.prev=s,t.next=i,i.prev=t,n.next=t,t.prev=n,r.next=n,n.prev=r,n}function Vc(s,e,t,n){const i=new $a(s,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function qr(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function $a(s,e,t){this.i=s,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function D0(s,e,t,n){let i=0;for(let r=e,o=t-n;r<t;r+=n)i+=(s[o]-s[r])*(s[r+1]+s[o+1]),o=r;return i}class tn{static area(e){const t=e.length;let n=0;for(let i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return n*.5}static isClockWise(e){return tn.area(e)<0}static triangulateShape(e,t){const n=[],i=[],r=[];Wc(e),qc(n,e);let o=e.length;t.forEach(Wc);for(let l=0;l<t.length;l++)i.push(o),o+=t[l].length,qc(n,t[l]);const a=x0.triangulate(n,i);for(let l=0;l<a.length;l+=3)r.push(a.slice(l,l+3));return r}}function Wc(s){const e=s.length;e>2&&s[e-1].equals(s[0])&&s.pop()}function qc(s,e){for(let t=0;t<e.length;t++)s.push(e[t].x),s.push(e[t].y)}class sn extends ye{constructor(e=new en([new Z(.5,.5),new Z(-.5,.5),new Z(-.5,-.5),new Z(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],r=[];for(let a=0,l=e.length;a<l;a++){const c=e[a];o(c)}this.setAttribute("position",new de(i,3)),this.setAttribute("uv",new de(r,2)),this.computeVertexNormals();function o(a){const l=[],c=t.curveSegments!==void 0?t.curveSegments:12,h=t.steps!==void 0?t.steps:1;let u=t.depth!==void 0?t.depth:1,d=t.bevelEnabled!==void 0?t.bevelEnabled:!0,f=t.bevelThickness!==void 0?t.bevelThickness:.2,g=t.bevelSize!==void 0?t.bevelSize:f-.1,p=t.bevelOffset!==void 0?t.bevelOffset:0,m=t.bevelSegments!==void 0?t.bevelSegments:3;const x=t.extrudePath,y=t.UVGenerator!==void 0?t.UVGenerator:F0;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),u=t.amount);let M,_=!1,b,A,R,P;x&&(M=x.getSpacedPoints(h),_=!0,d=!1,b=x.computeFrenetFrames(h,!1),A=new S,R=new S,P=new S),d||(m=0,f=0,g=0,p=0);const H=a.extractPoints(c);let I=H.shape;const v=H.holes;if(!tn.isClockWise(I)){I=I.reverse();for(let W=0,Y=v.length;W<Y;W++){const ee=v[W];tn.isClockWise(ee)&&(v[W]=ee.reverse())}}const j=tn.triangulateShape(I,v),F=I;for(let W=0,Y=v.length;W<Y;W++){const ee=v[W];I=I.concat(ee)}function U(W,Y,ee){return Y||console.error("THREE.ExtrudeGeometry: vec does not exist"),Y.clone().multiplyScalar(ee).add(W)}const N=I.length,k=j.length;function D(W,Y,ee){let pe,ce,Te;const ve=W.x-Y.x,xe=W.y-Y.y,Ke=ee.x-W.x,Ye=ee.y-W.y,T=ve*ve+xe*xe,w=ve*Ye-xe*Ke;if(Math.abs(w)>Number.EPSILON){const G=Math.sqrt(T),Q=Math.sqrt(Ke*Ke+Ye*Ye),le=Y.x-xe/G,he=Y.y+ve/G,_e=ee.x-Ye/Q,V=ee.y+Ke/Q,Le=((_e-le)*Ye-(V-he)*Ke)/(ve*Ye-xe*Ke);pe=le+ve*Le-W.x,ce=he+xe*Le-W.y;const Ie=pe*pe+ce*ce;if(Ie<=2)return new Z(pe,ce);Te=Math.sqrt(Ie/2)}else{let G=!1;ve>Number.EPSILON?Ke>Number.EPSILON&&(G=!0):ve<-Number.EPSILON?Ke<-Number.EPSILON&&(G=!0):Math.sign(xe)===Math.sign(Ye)&&(G=!0),G?(pe=-xe,ce=ve,Te=Math.sqrt(T)):(pe=ve,ce=xe,Te=Math.sqrt(T/2))}return new Z(pe/Te,ce/Te)}const X=[];for(let W=0,Y=F.length,ee=Y-1,pe=W+1;W<Y;W++,ee++,pe++)ee===Y&&(ee=0),pe===Y&&(pe=0),X[W]=D(F[W],F[ee],F[pe]);const $=[];let te,K=X.concat();for(let W=0,Y=v.length;W<Y;W++){const ee=v[W];te=[];for(let pe=0,ce=ee.length,Te=ce-1,ve=pe+1;pe<ce;pe++,Te++,ve++)Te===ce&&(Te=0),ve===ce&&(ve=0),te[pe]=D(ee[pe],ee[Te],ee[ve]);$.push(te),K=K.concat(te)}for(let W=0;W<m;W++){const Y=W/m,ee=f*Math.cos(Y*Math.PI/2),pe=g*Math.sin(Y*Math.PI/2)+p;for(let ce=0,Te=F.length;ce<Te;ce++){const ve=U(F[ce],X[ce],pe);Ve(ve.x,ve.y,-ee)}for(let ce=0,Te=v.length;ce<Te;ce++){const ve=v[ce];te=$[ce];for(let xe=0,Ke=ve.length;xe<Ke;xe++){const Ye=U(ve[xe],te[xe],pe);Ve(Ye.x,Ye.y,-ee)}}}const ge=g+p;for(let W=0;W<N;W++){const Y=d?U(I[W],K[W],ge):I[W];_?(R.copy(b.normals[0]).multiplyScalar(Y.x),A.copy(b.binormals[0]).multiplyScalar(Y.y),P.copy(M[0]).add(R).add(A),Ve(P.x,P.y,P.z)):Ve(Y.x,Y.y,0)}for(let W=1;W<=h;W++)for(let Y=0;Y<N;Y++){const ee=d?U(I[Y],K[Y],ge):I[Y];_?(R.copy(b.normals[W]).multiplyScalar(ee.x),A.copy(b.binormals[W]).multiplyScalar(ee.y),P.copy(M[W]).add(R).add(A),Ve(P.x,P.y,P.z)):Ve(ee.x,ee.y,u/h*W)}for(let W=m-1;W>=0;W--){const Y=W/m,ee=f*Math.cos(Y*Math.PI/2),pe=g*Math.sin(Y*Math.PI/2)+p;for(let ce=0,Te=F.length;ce<Te;ce++){const ve=U(F[ce],X[ce],pe);Ve(ve.x,ve.y,u+ee)}for(let ce=0,Te=v.length;ce<Te;ce++){const ve=v[ce];te=$[ce];for(let xe=0,Ke=ve.length;xe<Ke;xe++){const Ye=U(ve[xe],te[xe],pe);_?Ve(Ye.x,Ye.y+M[h-1].y,M[h-1].x+ee):Ve(Ye.x,Ye.y,u+ee)}}}ze(),Se();function ze(){const W=i.length/3;if(d){let Y=0,ee=N*Y;for(let pe=0;pe<k;pe++){const ce=j[pe];Ce(ce[2]+ee,ce[1]+ee,ce[0]+ee)}Y=h+m*2,ee=N*Y;for(let pe=0;pe<k;pe++){const ce=j[pe];Ce(ce[0]+ee,ce[1]+ee,ce[2]+ee)}}else{for(let Y=0;Y<k;Y++){const ee=j[Y];Ce(ee[2],ee[1],ee[0])}for(let Y=0;Y<k;Y++){const ee=j[Y];Ce(ee[0]+N*h,ee[1]+N*h,ee[2]+N*h)}}n.addGroup(W,i.length/3-W,0)}function Se(){const W=i.length/3;let Y=0;q(F,Y),Y+=F.length;for(let ee=0,pe=v.length;ee<pe;ee++){const ce=v[ee];q(ce,Y),Y+=ce.length}n.addGroup(W,i.length/3-W,1)}function q(W,Y){let ee=W.length;for(;--ee>=0;){const pe=ee;let ce=ee-1;ce<0&&(ce=W.length-1);for(let Te=0,ve=h+m*2;Te<ve;Te++){const xe=N*Te,Ke=N*(Te+1),Ye=Y+pe+xe,T=Y+ce+xe,w=Y+ce+Ke,G=Y+pe+Ke;Re(Ye,T,w,G)}}}function Ve(W,Y,ee){l.push(W),l.push(Y),l.push(ee)}function Ce(W,Y,ee){ne(W),ne(Y),ne(ee);const pe=i.length/3,ce=y.generateTopUV(n,i,pe-3,pe-2,pe-1);Be(ce[0]),Be(ce[1]),Be(ce[2])}function Re(W,Y,ee,pe){ne(W),ne(Y),ne(pe),ne(Y),ne(ee),ne(pe);const ce=i.length/3,Te=y.generateSideWallUV(n,i,ce-6,ce-3,ce-2,ce-1);Be(Te[0]),Be(Te[1]),Be(Te[3]),Be(Te[1]),Be(Te[2]),Be(Te[3])}function ne(W){i.push(l[W*3+0]),i.push(l[W*3+1]),i.push(l[W*3+2])}function Be(W){r.push(W.x),r.push(W.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return B0(t,n,e)}static fromJSON(e,t){const n=[];for(let r=0,o=e.shapes.length;r<o;r++){const a=t[e.shapes[r]];n.push(a)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new ml[i.type]().fromJSON(i)),new sn(n,e.options)}}const F0={generateTopUV:function(s,e,t,n,i){const r=e[t*3],o=e[t*3+1],a=e[n*3],l=e[n*3+1],c=e[i*3],h=e[i*3+1];return[new Z(r,o),new Z(a,l),new Z(c,h)]},generateSideWallUV:function(s,e,t,n,i,r){const o=e[t*3],a=e[t*3+1],l=e[t*3+2],c=e[n*3],h=e[n*3+1],u=e[n*3+2],d=e[i*3],f=e[i*3+1],g=e[i*3+2],p=e[r*3],m=e[r*3+1],x=e[r*3+2];return Math.abs(a-h)<Math.abs(o-c)?[new Z(o,1-l),new Z(c,1-u),new Z(d,1-g),new Z(p,1-x)]:[new Z(a,1-l),new Z(h,1-u),new Z(f,1-g),new Z(m,1-x)]}};function B0(s,e,t){if(t.shapes=[],Array.isArray(s))for(let n=0,i=s.length;n<i;n++){const r=s[n];t.shapes.push(r.uuid)}else t.shapes.push(s.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class or extends rn{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(i,r,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new or(e.radius,e.detail)}}class gi extends rn{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(n,i,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new gi(e.radius,e.detail)}}class ar extends ye{constructor(e=.5,t=1,n=8,i=1,r=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},n=Math.max(3,n),i=Math.max(1,i);const a=[],l=[],c=[],h=[];let u=e;const d=(t-e)/i,f=new S,g=new Z;for(let p=0;p<=i;p++){for(let m=0;m<=n;m++){const x=r+m/n*o;f.x=u*Math.cos(x),f.y=u*Math.sin(x),l.push(f.x,f.y,f.z),c.push(0,0,1),g.x=(f.x/t+1)/2,g.y=(f.y/t+1)/2,h.push(g.x,g.y)}u+=d}for(let p=0;p<i;p++){const m=p*(n+1);for(let x=0;x<n;x++){const y=x+m,M=y,_=y+n+1,b=y+n+2,A=y+1;a.push(M,_,A),a.push(_,b,A)}}this.setIndex(a),this.setAttribute("position",new de(l,3)),this.setAttribute("normal",new de(c,3)),this.setAttribute("uv",new de(h,2))}static fromJSON(e){return new ar(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class xi extends ye{constructor(e=new en([new Z(0,.5),new Z(-.5,-.5),new Z(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],r=[],o=[];let a=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let h=0;h<e.length;h++)c(e[h]),this.addGroup(a,l,h),a+=l,l=0;this.setIndex(n),this.setAttribute("position",new de(i,3)),this.setAttribute("normal",new de(r,3)),this.setAttribute("uv",new de(o,2));function c(h){const u=i.length/3,d=h.extractPoints(t);let f=d.shape;const g=d.holes;tn.isClockWise(f)===!1&&(f=f.reverse());for(let m=0,x=g.length;m<x;m++){const y=g[m];tn.isClockWise(y)===!0&&(g[m]=y.reverse())}const p=tn.triangulateShape(f,g);for(let m=0,x=g.length;m<x;m++){const y=g[m];f=f.concat(y)}for(let m=0,x=f.length;m<x;m++){const y=f[m];i.push(y.x,y.y,0),r.push(0,0,1),o.push(y.x,y.y)}for(let m=0,x=p.length;m<x;m++){const y=p[m],M=y[0]+u,_=y[1]+u,b=y[2]+u;n.push(M,_,b),l+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return N0(t,e)}static fromJSON(e,t){const n=[];for(let i=0,r=e.shapes.length;i<r;i++){const o=t[e.shapes[i]];n.push(o)}return new xi(n,e.curveSegments)}}function N0(s,e){if(e.shapes=[],Array.isArray(s))for(let t=0,n=s.length;t<n;t++){const i=s[t];e.shapes.push(i.uuid)}else e.shapes.push(s.uuid);return e}class yi extends ye{constructor(e=1,t=32,n=16,i=0,r=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(o+a,Math.PI);let c=0;const h=[],u=new S,d=new S,f=[],g=[],p=[],m=[];for(let x=0;x<=n;x++){const y=[],M=x/n;let _=0;x==0&&o==0?_=.5/t:x==n&&l==Math.PI&&(_=-.5/t);for(let b=0;b<=t;b++){const A=b/t;u.x=-e*Math.cos(i+A*r)*Math.sin(o+M*a),u.y=e*Math.cos(o+M*a),u.z=e*Math.sin(i+A*r)*Math.sin(o+M*a),g.push(u.x,u.y,u.z),d.copy(u).normalize(),p.push(d.x,d.y,d.z),m.push(A+_,1-M),y.push(c++)}h.push(y)}for(let x=0;x<n;x++)for(let y=0;y<t;y++){const M=h[x][y+1],_=h[x][y],b=h[x+1][y],A=h[x+1][y+1];(x!==0||o>0)&&f.push(M,_,A),(x!==n-1||l<Math.PI)&&f.push(_,b,A)}this.setIndex(f),this.setAttribute("position",new de(g,3)),this.setAttribute("normal",new de(p,3)),this.setAttribute("uv",new de(m,2))}static fromJSON(e){return new yi(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class lr extends rn{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,i,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new lr(e.radius,e.detail)}}class cr extends ye{constructor(e=1,t=.4,n=8,i=6,r=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},n=Math.floor(n),i=Math.floor(i);const o=[],a=[],l=[],c=[],h=new S,u=new S,d=new S;for(let f=0;f<=n;f++)for(let g=0;g<=i;g++){const p=g/i*r,m=f/n*Math.PI*2;u.x=(e+t*Math.cos(m))*Math.cos(p),u.y=(e+t*Math.cos(m))*Math.sin(p),u.z=t*Math.sin(m),a.push(u.x,u.y,u.z),h.x=e*Math.cos(p),h.y=e*Math.sin(p),d.subVectors(u,h).normalize(),l.push(d.x,d.y,d.z),c.push(g/i),c.push(f/n)}for(let f=1;f<=n;f++)for(let g=1;g<=i;g++){const p=(i+1)*f+g-1,m=(i+1)*(f-1)+g-1,x=(i+1)*(f-1)+g,y=(i+1)*f+g;o.push(p,m,y),o.push(m,x,y)}this.setIndex(o),this.setAttribute("position",new de(a,3)),this.setAttribute("normal",new de(l,3)),this.setAttribute("uv",new de(c,2))}static fromJSON(e){return new cr(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class hr extends ye{constructor(e=1,t=.4,n=64,i=8,r=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:o},n=Math.floor(n),i=Math.floor(i);const a=[],l=[],c=[],h=[],u=new S,d=new S,f=new S,g=new S,p=new S,m=new S,x=new S;for(let M=0;M<=n;++M){const _=M/n*r*Math.PI*2;y(_,r,o,e,f),y(_+.01,r,o,e,g),m.subVectors(g,f),x.addVectors(g,f),p.crossVectors(m,x),x.crossVectors(p,m),p.normalize(),x.normalize();for(let b=0;b<=i;++b){const A=b/i*Math.PI*2,R=-t*Math.cos(A),P=t*Math.sin(A);u.x=f.x+(R*x.x+P*p.x),u.y=f.y+(R*x.y+P*p.y),u.z=f.z+(R*x.z+P*p.z),l.push(u.x,u.y,u.z),d.subVectors(u,f).normalize(),c.push(d.x,d.y,d.z),h.push(M/n),h.push(b/i)}}for(let M=1;M<=n;M++)for(let _=1;_<=i;_++){const b=(i+1)*(M-1)+(_-1),A=(i+1)*M+(_-1),R=(i+1)*M+_,P=(i+1)*(M-1)+_;a.push(b,A,P),a.push(A,R,P)}this.setIndex(a),this.setAttribute("position",new de(l,3)),this.setAttribute("normal",new de(c,3)),this.setAttribute("uv",new de(h,2));function y(M,_,b,A,R){const P=Math.cos(M),H=Math.sin(M),I=b/_*M,v=Math.cos(I);R.x=A*(2+v)*.5*P,R.y=A*(2+v)*H*.5,R.z=A*Math.sin(I)*.5}}static fromJSON(e){return new hr(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class ur extends ye{constructor(e=new Co(new S(-1,-1,0),new S(-1,1,0),new S(1,1,0)),t=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r};const o=e.computeFrenetFrames(t,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new S,l=new S,c=new Z;let h=new S;const u=[],d=[],f=[],g=[];p(),this.setIndex(g),this.setAttribute("position",new de(u,3)),this.setAttribute("normal",new de(d,3)),this.setAttribute("uv",new de(f,2));function p(){for(let M=0;M<t;M++)m(M);m(r===!1?t:0),y(),x()}function m(M){h=e.getPointAt(M/t,h);const _=o.normals[M],b=o.binormals[M];for(let A=0;A<=i;A++){const R=A/i*Math.PI*2,P=Math.sin(R),H=-Math.cos(R);l.x=H*_.x+P*b.x,l.y=H*_.y+P*b.y,l.z=H*_.z+P*b.z,l.normalize(),d.push(l.x,l.y,l.z),a.x=h.x+n*l.x,a.y=h.y+n*l.y,a.z=h.z+n*l.z,u.push(a.x,a.y,a.z)}}function x(){for(let M=1;M<=t;M++)for(let _=1;_<=i;_++){const b=(i+1)*(M-1)+(_-1),A=(i+1)*M+(_-1),R=(i+1)*M+_,P=(i+1)*(M-1)+_;g.push(b,A,P),g.push(A,R,P)}}function y(){for(let M=0;M<=t;M++)for(let _=0;_<=i;_++)c.x=M/t,c.y=_/i,f.push(c.x,c.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new ur(new ml[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class xl extends ye{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new S,r=new S;if(e.index!==null){const o=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let c=0,h=l.length;c<h;++c){const u=l[c],d=u.start,f=u.count;for(let g=d,p=d+f;g<p;g+=3)for(let m=0;m<3;m++){const x=a.getX(g+m),y=a.getX(g+(m+1)%3);i.fromBufferAttribute(o,x),r.fromBufferAttribute(o,y),Xc(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}}else{const o=e.attributes.position;for(let a=0,l=o.count/3;a<l;a++)for(let c=0;c<3;c++){const h=3*a+c,u=3*a+(c+1)%3;i.fromBufferAttribute(o,h),r.fromBufferAttribute(o,u),Xc(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new de(t,3))}}}function Xc(s,e,t){const n=`${s.x},${s.y},${s.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${s.x},${s.y},${s.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}var Jc=Object.freeze({__proto__:null,BoxGeometry:mn,BoxBufferGeometry:mn,CapsuleGeometry:nr,CapsuleBufferGeometry:nr,CircleGeometry:ir,CircleBufferGeometry:ir,ConeGeometry:rr,ConeBufferGeometry:rr,CylinderGeometry:Bn,CylinderBufferGeometry:Bn,DodecahedronGeometry:sr,DodecahedronBufferGeometry:sr,EdgesGeometry:gl,ExtrudeGeometry:sn,ExtrudeBufferGeometry:sn,IcosahedronGeometry:or,IcosahedronBufferGeometry:or,LatheGeometry:mi,LatheBufferGeometry:mi,OctahedronGeometry:gi,OctahedronBufferGeometry:gi,PlaneGeometry:fi,PlaneBufferGeometry:fi,PolyhedronGeometry:rn,PolyhedronBufferGeometry:rn,RingGeometry:ar,RingBufferGeometry:ar,ShapeGeometry:xi,ShapeBufferGeometry:xi,SphereGeometry:yi,SphereBufferGeometry:yi,TetrahedronGeometry:lr,TetrahedronBufferGeometry:lr,TorusGeometry:cr,TorusBufferGeometry:cr,TorusKnotGeometry:hr,TorusKnotBufferGeometry:hr,TubeGeometry:ur,TubeBufferGeometry:ur,WireframeGeometry:xl});class yl extends ot{constructor(e){super(),this.type="ShadowMaterial",this.color=new ae(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}yl.prototype.isShadowMaterial=!0;class _l extends zt{constructor(e){super(e),this.type="RawShaderMaterial"}}_l.prototype.isRawShaderMaterial=!0;class Po extends ot{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ae(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mi,this.normalScale=new Z(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}Po.prototype.isMeshStandardMaterial=!0;class vl extends Po{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Z(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return rt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenColor=new ae(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new ae(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new ae(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}vl.prototype.isMeshPhysicalMaterial=!0;class Ml extends ot{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new ae(16777215),this.specular=new ae(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mi,this.normalScale=new Z(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$r,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}Ml.prototype.isMeshPhongMaterial=!0;class bl extends ot{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ae(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mi,this.normalScale=new Z(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}bl.prototype.isMeshToonMaterial=!0;class wl extends ot{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mi,this.normalScale=new Z(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}wl.prototype.isMeshNormalMaterial=!0;class Sl extends ot{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new ae(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$r,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}Sl.prototype.isMeshLambertMaterial=!0;class El extends ot{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ae(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mi,this.normalScale=new Z(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}El.prototype.isMeshMatcapMaterial=!0;class Tl extends gt{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}Tl.prototype.isLineDashedMaterial=!0;const z0={ShadowMaterial:yl,SpriteMaterial:Mo,RawShaderMaterial:_l,ShaderMaterial:zt,PointsMaterial:wi,MeshPhysicalMaterial:vl,MeshStandardMaterial:Po,MeshPhongMaterial:Ml,MeshToonMaterial:bl,MeshNormalMaterial:wl,MeshLambertMaterial:Sl,MeshDepthMaterial:yo,MeshDistanceMaterial:_o,MeshBasicMaterial:yn,MeshMatcapMaterial:El,LineDashedMaterial:Tl,LineBasicMaterial:gt,Material:ot};ot.fromType=function(s){return new z0[s]};const je={arraySlice:function(s,e,t){return je.isTypedArray(s)?new s.constructor(s.subarray(e,t!==void 0?t:s.length)):s.slice(e,t)},convertArray:function(s,e,t){return!s||!t&&s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)},isTypedArray:function(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)},getKeyframeOrder:function(s){function e(i,r){return s[i]-s[r]}const t=s.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n},sortedArray:function(s,e,t){const n=s.length,i=new s.constructor(n);for(let r=0,o=0;o!==n;++r){const a=t[r]*e;for(let l=0;l!==e;++l)i[o++]=s[a+l]}return i},flattenJSON:function(s,e,t,n){let i=1,r=s[0];for(;r!==void 0&&r[n]===void 0;)r=s[i++];if(r===void 0)return;let o=r[n];if(o!==void 0)if(Array.isArray(o))do o=r[n],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=s[i++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[n],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=s[i++];while(r!==void 0);else do o=r[n],o!==void 0&&(e.push(r.time),t.push(o)),r=s[i++];while(r!==void 0)},subclip:function(s,e,t,n,i=30){const r=s.clone();r.name=e;const o=[];for(let l=0;l<r.tracks.length;++l){const c=r.tracks[l],h=c.getValueSize(),u=[],d=[];for(let f=0;f<c.times.length;++f){const g=c.times[f]*i;if(!(g<t||g>=n)){u.push(c.times[f]);for(let p=0;p<h;++p)d.push(c.values[f*h+p])}}u.length!==0&&(c.times=je.convertArray(u,c.times.constructor),c.values=je.convertArray(d,c.values.constructor),o.push(c))}r.tracks=o;let a=1/0;for(let l=0;l<r.tracks.length;++l)a>r.tracks[l].times[0]&&(a=r.tracks[l].times[0]);for(let l=0;l<r.tracks.length;++l)r.tracks[l].shift(-1*a);return r.resetDuration(),r},makeClipAdditive:function(s,e=0,t=s,n=30){n<=0&&(n=30);const i=t.tracks.length,r=e/n;for(let o=0;o<i;++o){const a=t.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const c=s.tracks.find(function(x){return x.name===a.name&&x.ValueTypeName===l});if(c===void 0)continue;let h=0;const u=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=u/3);let d=0;const f=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(d=f/3);const g=a.times.length-1;let p;if(r<=a.times[0]){const x=h,y=u-h;p=je.arraySlice(a.values,x,y)}else if(r>=a.times[g]){const x=g*u+h,y=x+u-h;p=je.arraySlice(a.values,x,y)}else{const x=a.createInterpolant(),y=h,M=u-h;x.evaluate(r),p=je.arraySlice(x.resultBuffer,y,M)}l==="quaternion"&&new yt().fromArray(p).normalize().conjugate().toArray(p);const m=c.times.length;for(let x=0;x<m;++x){const y=x*f+d;if(l==="quaternion")yt.multiplyQuaternionsFlat(c.values,y,p,0,c.values,y);else{const M=f-d*2;for(let _=0;_<M;++_)c.values[y+_]-=p[_]}}}return s.blendMode=il,s}};class xn{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{let o;n:{i:if(!(e<i)){for(let a=n+2;;){if(i===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,r)}if(n===a)break;if(r=i,i=t[++n],e<i)break t}o=t.length;break n}if(!(e>=r)){const a=t[1];e<a&&(n=2,r=a);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===l)break;if(i=r,r=t[--n-1],e>=r)break t}o=n,n=0;break n}break e}for(;n<o;){const a=n+o>>>1;e<t[a]?o=a:n=a+1}if(i=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(i===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,r,e)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let o=0;o!==i;++o)t[o]=n[r+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}xn.prototype.beforeStart_=xn.prototype.copySampleValue_;xn.prototype.afterEnd_=xn.prototype.copySampleValue_;class Zu extends xn{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ei,endingEnd:ei}}intervalChanged_(e,t,n){const i=this.parameterPositions;let r=e-2,o=e+1,a=i[r],l=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case ti:r=e,a=2*t-n;break;case Hr:r=i.length-2,a=t+i[r]-i[r+1];break;default:r=e,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case ti:o=e,l=2*n-t;break;case Hr:o=1,l=n+i[1]-i[0];break;default:o=e-1,l=t}const c=(n-t)*.5,h=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(l-n),this._offsetPrev=r*h,this._offsetNext=o*h}interpolate_(e,t,n,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,g=(n-t)/(i-t),p=g*g,m=p*g,x=-d*m+2*d*p-d*g,y=(1+d)*m+(-1.5-2*d)*p+(-.5+d)*g+1,M=(-1-f)*m+(1.5+f)*p+.5*g,_=f*m-f*p;for(let b=0;b!==a;++b)r[b]=x*o[h+b]+y*o[c+b]+M*o[l+b]+_*o[u+b];return r}}class Al extends xn{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,h=(n-t)/(i-t),u=1-h;for(let d=0;d!==a;++d)r[d]=o[c+d]*u+o[l+d]*h;return r}}class $u extends xn{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Xt{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=je.convertArray(t,this.TimeBufferType),this.values=je.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:je.convertArray(e.times,Array),values:je.convertArray(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new $u(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Al(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Zu(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Ur:t=this.InterpolantFactoryMethodDiscrete;break;case Or:t=this.InterpolantFactoryMethodLinear;break;case Qs:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ur;case this.InterpolantFactoryMethodLinear:return Or;case this.InterpolantFactoryMethodSmooth:return Qs}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let r=0,o=i-1;for(;r!==i&&n[r]<e;)++r;for(;o!==-1&&n[o]>t;)--o;if(++o,r!==0||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=je.arraySlice(n,r,o),this.values=je.arraySlice(this.values,r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&je.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){const c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=je.arraySlice(this.times),t=je.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Qs,r=e.length-1;let o=1;for(let a=1;a<r;++a){let l=!1;const c=e[a],h=e[a+1];if(c!==h&&(a!==1||c!==e[0]))if(i)l=!0;else{const u=a*n,d=u-n,f=u+n;for(let g=0;g!==n;++g){const p=t[u+g];if(p!==t[d+g]||p!==t[f+g]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];const u=a*n,d=o*n;for(let f=0;f!==n;++f)t[d+f]=t[u+f]}++o}}if(r>0){e[o]=e[r];for(let a=r*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=je.arraySlice(e,0,o),this.values=je.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){const e=je.arraySlice(this.times,0),t=je.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Xt.prototype.TimeBufferType=Float32Array;Xt.prototype.ValueBufferType=Float32Array;Xt.prototype.DefaultInterpolation=Or;class Si extends Xt{}Si.prototype.ValueTypeName="bool";Si.prototype.ValueBufferType=Array;Si.prototype.DefaultInterpolation=Ur;Si.prototype.InterpolantFactoryMethodLinear=void 0;Si.prototype.InterpolantFactoryMethodSmooth=void 0;class Cl extends Xt{}Cl.prototype.ValueTypeName="color";class Xr extends Xt{}Xr.prototype.ValueTypeName="number";class ju extends xn{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t);let c=e*a;for(let h=c+a;c!==h;c+=4)yt.slerpFlat(r,0,o,c-a,o,c,l);return r}}class gr extends Xt{InterpolantFactoryMethodLinear(e){return new ju(this.times,this.values,this.getValueSize(),e)}}gr.prototype.ValueTypeName="quaternion";gr.prototype.DefaultInterpolation=Or;gr.prototype.InterpolantFactoryMethodSmooth=void 0;class Ei extends Xt{}Ei.prototype.ValueTypeName="string";Ei.prototype.ValueBufferType=Array;Ei.prototype.DefaultInterpolation=Ur;Ei.prototype.InterpolantFactoryMethodLinear=void 0;Ei.prototype.InterpolantFactoryMethodSmooth=void 0;class Jr extends Xt{}Jr.prototype.ValueTypeName="vector";class Yr{constructor(e,t=-1,n,i=ho){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=It(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(O0(n[o]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=n.length;r!==o;++r)t.push(Xt.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const r=t.length,o=[];for(let a=0;a<r;a++){let l=[],c=[];l.push((a+r-1)%r,a,(a+1)%r),c.push(0,1,0);const h=je.getKeyframeOrder(l);l=je.sortedArray(l,1,h),c=je.sortedArray(c,1,h),!i&&l[0]===0&&(l.push(r),c.push(c[0])),o.push(new Xr(".morphTargetInfluences["+t[a].name+"]",l,c).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const c=e[a],h=c.name.match(r);if(h&&h.length>1){const u=h[1];let d=i[u];d||(i[u]=d=[]),d.push(c)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,d,f,g,p){if(f.length!==0){const m=[],x=[];je.flattenJSON(f,m,x,g),m.length!==0&&p.push(new u(d,m,x))}},i=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let u=0;u<c.length;u++){const d=c[u].keys;if(!(!d||d.length===0))if(d[0].morphTargets){const f={};let g;for(g=0;g<d.length;g++)if(d[g].morphTargets)for(let p=0;p<d[g].morphTargets.length;p++)f[d[g].morphTargets[p]]=-1;for(const p in f){const m=[],x=[];for(let y=0;y!==d[g].morphTargets.length;++y){const M=d[g];m.push(M.time),x.push(M.morphTarget===p?1:0)}i.push(new Xr(".morphTargetInfluence["+p+"]",m,x))}l=f.length*o}else{const f=".bones["+t[u].name+"]";n(Jr,f+".position",d,"pos",i),n(gr,f+".quaternion",d,"rot",i),n(Jr,f+".scale",d,"scl",i)}}return i.length===0?null:new this(r,l,i,a)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function U0(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Xr;case"vector":case"vector2":case"vector3":case"vector4":return Jr;case"color":return Cl;case"quaternion":return gr;case"bool":case"boolean":return Si;case"string":return Ei}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function O0(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=U0(s.type);if(s.times===void 0){const t=[],n=[];je.flattenJSON(s.keys,t,n,"value"),s.times=t,s.values=n}return e.parse!==void 0?e.parse(s):new e(s.name,s.times,s.values,s.interpolation)}const _i={enabled:!1,files:{},add:function(s,e){this.enabled!==!1&&(this.files[s]=e)},get:function(s){if(this.enabled!==!1)return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};class Rl{constructor(e,t,n){const i=this;let r=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(h){a++,r===!1&&i.onStart!==void 0&&i.onStart(h,o,a),r=!0},this.itemEnd=function(h){o++,i.onProgress!==void 0&&i.onProgress(h,o,a),o===a&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,u){return c.push(h,u),this},this.removeHandler=function(h){const u=c.indexOf(h);return u!==-1&&c.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=c.length;u<d;u+=2){const f=c[u],g=c[u+1];if(f.global&&(f.lastIndex=0),f.test(h))return g}return null}}}const Ku=new Rl;class Tt{constructor(e){this.manager=e!==void 0?e:Ku,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,r){n.load(e,i,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const dn={};class on extends Tt{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=_i.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if(dn[e]!==void 0){dn[e].push({onLoad:t,onProgress:n,onError:i});return}dn[e]=[],dn[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=dn[e],u=c.body.getReader(),d=c.headers.get("Content-Length"),f=d?parseInt(d):0,g=f!==0;let p=0;const m=new ReadableStream({start(x){y();function y(){u.read().then(({done:M,value:_})=>{if(M)x.close();else{p+=_.byteLength;const b=new ProgressEvent("progress",{lengthComputable:g,loaded:p,total:f});for(let A=0,R=h.length;A<R;A++){const P=h[A];P.onProgress&&P.onProgress(b)}x.enqueue(_),y()}})}}});return new Response(m)}else throw Error(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return c.json();default:if(a===void 0)return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(a),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(g=>f.decode(g))}}}).then(c=>{_i.add(e,c);const h=dn[e];delete dn[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onLoad&&f.onLoad(c)}}).catch(c=>{const h=dn[e];if(h===void 0)throw this.manager.itemError(e),c;delete dn[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onError&&f.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class H0 extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new on(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=Yr.parse(e[n]);t.push(i)}return t}}class G0 extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=[],a=new hl,l=new on(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(r.withCredentials);let c=0;function h(u){l.load(e[u],function(d){const f=r.parse(d,!0);o[u]={width:f.width,height:f.height,format:f.format,mipmaps:f.mipmaps},c+=1,c===6&&(f.mipmapCount===1&&(a.minFilter=it),a.image=o,a.format=f.format,a.needsUpdate=!0,t&&t(a))},n,i)}if(Array.isArray(e))for(let u=0,d=e.length;u<d;++u)h(u);else l.load(e,function(u){const d=r.parse(u,!0);if(d.isCubemap){const f=d.mipmaps.length/d.mipmapCount;for(let g=0;g<f;g++){o[g]={mipmaps:[]};for(let p=0;p<d.mipmapCount;p++)o[g].mipmaps.push(d.mipmaps[g*d.mipmapCount+p]),o[g].format=d.format,o[g].width=d.width,o[g].height=d.height}a.image=o}else a.image.width=d.width,a.image.height=d.height,a.mipmaps=d.mipmaps;d.mipmapCount===1&&(a.minFilter=it),a.format=d.format,a.needsUpdate=!0,t&&t(a)},n,i);return a}}class Zr extends Tt{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=_i.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=kr("img");function l(){h(),_i.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(u){h(),i&&i(u),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class Qu extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=new pr,o=new Zr(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(c){o.load(e[c],function(h){r.images[c]=h,a++,a===6&&(r.needsUpdate=!0,t&&t(r))},void 0,i)}for(let c=0;c<e.length;++c)l(c);return r}}class ed extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new ci,a=new on(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(r.withCredentials),a.load(e,function(l){const c=r.parse(l);c&&(c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:wt,o.wrapT=c.wrapT!==void 0?c.wrapT:wt,o.magFilter=c.magFilter!==void 0?c.magFilter:it,o.minFilter=c.minFilter!==void 0?c.minFilter:it,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.encoding!==void 0&&(o.encoding=c.encoding),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=vi),c.mipmapCount===1&&(o.minFilter=it),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c))},n,i),o}}class td extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=new ut,o=new Zr(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},n,i),r}}class qt extends Ne{constructor(e,t=1){super(),this.type="Light",this.color=new ae(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}qt.prototype.isLight=!0;class Ll extends qt{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(Ne.DefaultUp),this.updateMatrix(),this.groundColor=new ae(t)}copy(e){return qt.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Ll.prototype.isHemisphereLight=!0;const Yc=new fe,Zc=new S,$c=new S;class Pl{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Z(512,512),this.map=null,this.mapPass=null,this.matrix=new fe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Qr,this._frameExtents=new Z(1,1),this._viewportCount=1,this._viewports=[new qe(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Zc.setFromMatrixPosition(e.matrixWorld),t.position.copy(Zc),$c.setFromMatrixPosition(e.target.matrixWorld),t.lookAt($c),t.updateMatrixWorld(),Yc.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Yc),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class nd extends Pl{constructor(){super(new mt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=Gr*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(n!==t.fov||i!==t.aspect||r!==t.far)&&(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}nd.prototype.isSpotLightShadow=!0;class Il extends qt{constructor(e,t,n=0,i=Math.PI/3,r=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(Ne.DefaultUp),this.updateMatrix(),this.target=new Ne,this.distance=n,this.angle=i,this.penumbra=r,this.decay=o,this.shadow=new nd}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Il.prototype.isSpotLight=!0;const jc=new fe,Cr=new S,pa=new S;class id extends Pl{constructor(){super(new mt(90,1,.5,500)),this._frameExtents=new Z(4,2),this._viewportCount=6,this._viewports=[new qe(2,1,1,1),new qe(0,1,1,1),new qe(3,1,1,1),new qe(1,1,1,1),new qe(3,0,1,1),new qe(1,0,1,1)],this._cubeDirections=[new S(1,0,0),new S(-1,0,0),new S(0,0,1),new S(0,0,-1),new S(0,1,0),new S(0,-1,0)],this._cubeUps=[new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,0,1),new S(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,r=e.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),Cr.setFromMatrixPosition(e.matrixWorld),n.position.copy(Cr),pa.copy(n.position),pa.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(pa),n.updateMatrixWorld(),i.makeTranslation(-Cr.x,-Cr.y,-Cr.z),jc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(jc)}}id.prototype.isPointLightShadow=!0;class Dl extends qt{constructor(e,t,n=0,i=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new id}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Dl.prototype.isPointLight=!0;class rd extends Pl{constructor(){super(new es(-5,5,5,-5,.5,500))}}rd.prototype.isDirectionalLightShadow=!0;class Fl extends qt{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Ne.DefaultUp),this.updateMatrix(),this.target=new Ne,this.shadow=new rd}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Fl.prototype.isDirectionalLight=!0;class Bl extends qt{constructor(e,t){super(e,t),this.type="AmbientLight"}}Bl.prototype.isAmbientLight=!0;class Nl extends qt{constructor(e,t,n=10,i=10){super(e,t),this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Nl.prototype.isRectAreaLight=!0;class zl{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new S)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,i=e.y,r=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*i),t.addScaledVector(o[2],.488603*r),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],1.092548*(n*i)),t.addScaledVector(o[5],1.092548*(i*r)),t.addScaledVector(o[6],.315392*(3*r*r-1)),t.addScaledVector(o[7],1.092548*(n*r)),t.addScaledVector(o[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,r=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*i),t.addScaledVector(o[2],2*.511664*r),t.addScaledVector(o[3],2*.511664*n),t.addScaledVector(o[4],2*.429043*n*i),t.addScaledVector(o[5],2*.429043*i*r),t.addScaledVector(o[6],.743125*r*r-.247708),t.addScaledVector(o[7],2*.429043*n*r),t.addScaledVector(o[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+i*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+i*3);return e}static getBasisAt(e,t){const n=e.x,i=e.y,r=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*r,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*n*r,t[8]=.546274*(n*n-i*i)}}zl.prototype.isSphericalHarmonics3=!0;class os extends qt{constructor(e=new zl,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}os.prototype.isLightProbe=!0;class sd extends Tt{constructor(e){super(e),this.textures={}}load(e,t,n,i){const r=this,o=new on(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}parse(e){const t=this.textures;function n(r){return t[r]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",r),t[r]}const i=ot.fromType(e.type);if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=e.sheen),e.sheenColor!==void 0&&(i.sheenColor=new ae().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==1&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const o=e.uniforms[r];switch(i.uniforms[r]={},o.type){case"t":i.uniforms[r].value=n(o.value);break;case"c":i.uniforms[r].value=new ae().setHex(o.value);break;case"v2":i.uniforms[r].value=new Z().fromArray(o.value);break;case"v3":i.uniforms[r].value=new S().fromArray(o.value);break;case"v4":i.uniforms[r].value=new qe().fromArray(o.value);break;case"m3":i.uniforms[r].value=new ft().fromArray(o.value);break;case"m4":i.uniforms[r].value=new fe().fromArray(o.value);break;default:i.uniforms[r].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const r in e.extensions)i.extensions[r]=e.extensions[r];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),i.normalScale=new Z().fromArray(r)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Z().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}}class ao{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class Ul extends ye{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}Ul.prototype.isInstancedBufferGeometry=!0;class od extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new on(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}parse(e){const t={},n={};function i(f,g){if(t[g]!==void 0)return t[g];const m=f.interleavedBuffers[g],x=r(f,m.buffer),y=Yi(m.type,x),M=new bi(y,m.stride);return M.uuid=m.uuid,t[g]=M,M}function r(f,g){if(n[g]!==void 0)return n[g];const m=f.arrayBuffers[g],x=new Uint32Array(m).buffer;return n[g]=x,x}const o=e.isInstancedBufferGeometry?new Ul:new ye,a=e.data.index;if(a!==void 0){const f=Yi(a.type,a.array);o.setIndex(new Oe(f,1))}const l=e.data.attributes;for(const f in l){const g=l[f];let p;if(g.isInterleavedBufferAttribute){const m=i(e.data,g.data);p=new Fn(m,g.itemSize,g.offset,g.normalized)}else{const m=Yi(g.type,g.array),x=g.isInstancedBufferAttribute?pi:Oe;p=new x(m,g.itemSize,g.normalized)}g.name!==void 0&&(p.name=g.name),g.usage!==void 0&&p.setUsage(g.usage),g.updateRange!==void 0&&(p.updateRange.offset=g.updateRange.offset,p.updateRange.count=g.updateRange.count),o.setAttribute(f,p)}const c=e.data.morphAttributes;if(c)for(const f in c){const g=c[f],p=[];for(let m=0,x=g.length;m<x;m++){const y=g[m];let M;if(y.isInterleavedBufferAttribute){const _=i(e.data,y.data);M=new Fn(_,y.itemSize,y.offset,y.normalized)}else{const _=Yi(y.type,y.array);M=new Oe(_,y.itemSize,y.normalized)}y.name!==void 0&&(M.name=y.name),p.push(M)}o.morphAttributes[f]=p}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const u=e.data.groups||e.data.drawcalls||e.data.offsets;if(u!==void 0)for(let f=0,g=u.length;f!==g;++f){const p=u[f];o.addGroup(p.start,p.count,p.materialIndex)}const d=e.data.boundingSphere;if(d!==void 0){const f=new S;d.center!==void 0&&f.fromArray(d.center),o.boundingSphere=new On(f,d.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class k0 extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=this.path===""?ao.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new on(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){let c=null;try{c=JSON.parse(l)}catch(u){i!==void 0&&i(u),console.error("THREE:ObjectLoader: Can't parse "+e+".",u.message);return}const h=c.metadata;if(h===void 0||h.type===void 0||h.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}r.parse(c,t)},n,i)}async loadAsync(e,t){const n=this,i=this.path===""?ao.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const r=new on(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const o=await r.loadAsync(e,t),a=JSON.parse(o),l=a.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await n.parseAsync(a)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),a=this.parseTextures(e.textures,o),l=this.parseMaterials(e.materials,a),c=this.parseObject(e.object,r,l,a,n),h=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,h),t!==void 0){let u=!1;for(const d in o)if(o[d]instanceof HTMLImageElement){u=!0;break}u===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),r=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,r),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,i,a,o,t),c=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,c),l}parseShapes(e){const t={};if(e!==void 0)for(let n=0,i=e.length;n<i;n++){const r=new en().fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse(function(r){r.isBone&&(i[r.uuid]=r)}),e!==void 0)for(let r=0,o=e.length;r<o;r++){const a=new Eo().fromJSON(e[r],i);n[a.uuid]=a}return n}parseGeometries(e,t){const n={};if(e!==void 0){const i=new od;for(let r=0,o=e.length;r<o;r++){let a;const l=e[r];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(l);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:l.type in Jc?a=Jc[l.type].fromJSON(l,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),a.isBufferGeometry===!0&&l.userData!==void 0&&(a.userData=l.userData),n[l.uuid]=a}}return n}parseMaterials(e,t){const n={},i={};if(e!==void 0){const r=new sd;r.setTextures(t);for(let o=0,a=e.length;o<a;o++){const l=e[o];if(l.type==="MultiMaterial"){const c=[];for(let h=0;h<l.materials.length;h++){const u=l.materials[h];n[u.uuid]===void 0&&(n[u.uuid]=r.parse(u)),c.push(n[u.uuid])}i[l.uuid]=c}else n[l.uuid]===void 0&&(n[l.uuid]=r.parse(l)),i[l.uuid]=n[l.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const i=e[n],r=Yr.parse(i);t[r.uuid]=r}return t}parseImages(e,t){const n=this,i={};let r;function o(l){return n.manager.itemStart(l),r.load(l,function(){n.manager.itemEnd(l)},void 0,function(){n.manager.itemError(l),n.manager.itemEnd(l)})}function a(l){if(typeof l=="string"){const c=l,h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:n.resourcePath+c;return o(h)}else return l.data?{data:Yi(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new Rl(t);r=new Zr(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,h=e.length;c<h;c++){const u=e[c],d=u.url;if(Array.isArray(d)){const f=[];for(let g=0,p=d.length;g<p;g++){const m=d[g],x=a(m);x!==null&&(x instanceof HTMLImageElement?f.push(x):f.push(new ci(x.data,x.width,x.height)))}i[u.uuid]=new ni(f)}else{const f=a(u.url);i[u.uuid]=new ni(f)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function r(o){if(typeof o=="string"){const a=o,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await i.loadAsync(l)}else return o.data?{data:Yi(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){i=new Zr(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const l=e[o],c=l.url;if(Array.isArray(c)){const h=[];for(let u=0,d=c.length;u<d;u++){const f=c[u],g=await r(f);g!==null&&(g instanceof HTMLImageElement?h.push(g):h.push(new ci(g.data,g.width,g.height)))}n[l.uuid]=new ni(h)}else{const h=await r(l.url);n[l.uuid]=new ni(h)}}}return n}parseTextures(e,t){function n(r,o){return typeof r=="number"?r:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",r),o[r])}const i={};if(e!==void 0)for(let r=0,o=e.length;r<o;r++){const a=e[r];a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const l=t[a.image],c=l.data;let h;Array.isArray(c)?(h=new pr,c.length===6&&(h.needsUpdate=!0)):(c&&c.data?h=new ci:h=new ut,c&&(h.needsUpdate=!0)),h.source=l,h.uuid=a.uuid,a.name!==void 0&&(h.name=a.name),a.mapping!==void 0&&(h.mapping=n(a.mapping,V0)),a.offset!==void 0&&h.offset.fromArray(a.offset),a.repeat!==void 0&&h.repeat.fromArray(a.repeat),a.center!==void 0&&h.center.fromArray(a.center),a.rotation!==void 0&&(h.rotation=a.rotation),a.wrap!==void 0&&(h.wrapS=n(a.wrap[0],Kc),h.wrapT=n(a.wrap[1],Kc)),a.format!==void 0&&(h.format=a.format),a.type!==void 0&&(h.type=a.type),a.encoding!==void 0&&(h.encoding=a.encoding),a.minFilter!==void 0&&(h.minFilter=n(a.minFilter,Qc)),a.magFilter!==void 0&&(h.magFilter=n(a.magFilter,Qc)),a.anisotropy!==void 0&&(h.anisotropy=a.anisotropy),a.flipY!==void 0&&(h.flipY=a.flipY),a.premultiplyAlpha!==void 0&&(h.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(h.unpackAlignment=a.unpackAlignment),a.userData!==void 0&&(h.userData=a.userData),i[a.uuid]=h}return i}parseObject(e,t,n,i,r){let o;function a(d){return t[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",d),t[d]}function l(d){if(d!==void 0){if(Array.isArray(d)){const f=[];for(let g=0,p=d.length;g<p;g++){const m=d[g];n[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",m),f.push(n[m])}return f}return n[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",d),n[d]}}function c(d){return i[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",d),i[d]}let h,u;switch(e.type){case"Scene":o=new vo,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new ae(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new ns(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new ts(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new mt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new es(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new Bl(e.color,e.intensity);break;case"DirectionalLight":o=new Fl(e.color,e.intensity);break;case"PointLight":o=new Dl(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new Nl(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new Il(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new Ll(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new os().fromJSON(e);break;case"SkinnedMesh":h=a(e.geometry),u=l(e.material),o=new wo(h,u),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":h=a(e.geometry),u=l(e.material),o=new ht(h,u);break;case"InstancedMesh":h=a(e.geometry),u=l(e.material);const d=e.count,f=e.instanceMatrix,g=e.instanceColor;o=new ll(h,u,d),o.instanceMatrix=new pi(new Float32Array(f.array),16),g!==void 0&&(o.instanceColor=new pi(new Float32Array(g.array),g.itemSize));break;case"LOD":o=new Hu;break;case"Line":o=new gn(a(e.geometry),l(e.material));break;case"LineLoop":o=new cl(a(e.geometry),l(e.material));break;case"LineSegments":o=new At(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new is(a(e.geometry),l(e.material));break;case"Sprite":o=new bo(l(e.material));break;case"Group":o=new ii;break;case"Bone":o=new So;break;default:o=new Ne}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let f=0;f<d.length;f++)o.add(this.parseObject(d[f],t,n,i,r))}if(e.animations!==void 0){const d=e.animations;for(let f=0;f<d.length;f++){const g=d[f];o.animations.push(r[g])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const d=e.levels;for(let f=0;f<d.length;f++){const g=d[f],p=o.getObjectByProperty("uuid",g.object);p!==void 0&&o.addLevel(p,g.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const i=t[n.skeleton];i===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(i,n.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const V0={UVMapping:co,CubeReflectionMapping:Pn,CubeRefractionMapping:In,EquirectangularReflectionMapping:Fr,EquirectangularRefractionMapping:Br,CubeUVReflectionMapping:dr},Kc={RepeatWrapping:Nr,ClampToEdgeWrapping:wt,MirroredRepeatWrapping:zr},Qc={NearestFilter:ct,NearestMipmapNearestFilter:io,NearestMipmapLinearFilter:ro,LinearFilter:it,LinearMipmapNearestFilter:nl,LinearMipmapLinearFilter:vi};class ad extends Tt{constructor(e){super(e),typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=_i.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){_i.add(e,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){i&&i(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}ad.prototype.isImageBitmapLoader=!0;let ks;const Ol={getContext:function(){return ks===void 0&&(ks=new(window.AudioContext||window.webkitAudioContext)),ks},setContext:function(s){ks=s}};class ld extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new on(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{const l=a.slice(0);Ol.getContext().decodeAudioData(l,function(h){t(h)})}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}}class cd extends os{constructor(e,t,n=1){super(void 0,n);const i=new ae().set(e),r=new ae().set(t),o=new S(i.r,i.g,i.b),a=new S(r.r,r.g,r.b),l=Math.sqrt(Math.PI),c=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}}cd.prototype.isHemisphereLightProbe=!0;class hd extends os{constructor(e,t=1){super(void 0,t);const n=new ae().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}hd.prototype.isAmbientLightProbe=!0;const eh=new fe,th=new fe,Xn=new fe;class W0{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new mt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new mt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Xn.copy(e.projectionMatrix);const i=t.eyeSep/2,r=i*t.near/t.focus,o=t.near*Math.tan(ai*t.fov*.5)/t.zoom;let a,l;th.elements[12]=-i,eh.elements[12]=i,a=-o*t.aspect+r,l=o*t.aspect+r,Xn.elements[0]=2*t.near/(l-a),Xn.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Xn),a=-o*t.aspect-r,l=o*t.aspect-r,Xn.elements[0]=2*t.near/(l-a),Xn.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Xn)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(th),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(eh)}}class ud{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=nh(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=nh();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function nh(){return(typeof performance>"u"?Date:performance).now()}const Jn=new S,ih=new yt,q0=new S,Yn=new S;class X0 extends Ne{constructor(){super(),this.type="AudioListener",this.context=Ol.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ud}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Jn,ih,q0),Yn.set(0,0,-1).applyQuaternion(ih),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Jn.x,i),t.positionY.linearRampToValueAtTime(Jn.y,i),t.positionZ.linearRampToValueAtTime(Jn.z,i),t.forwardX.linearRampToValueAtTime(Yn.x,i),t.forwardY.linearRampToValueAtTime(Yn.y,i),t.forwardZ.linearRampToValueAtTime(Yn.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(Jn.x,Jn.y,Jn.z),t.setOrientation(Yn.x,Yn.y,Yn.z,n.x,n.y,n.z)}}class Hl extends Ne{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Zn=new S,rh=new yt,J0=new S,$n=new S;class Y0 extends Hl{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Zn,rh,J0),$n.set(0,0,1).applyQuaternion(rh);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Zn.x,n),t.positionY.linearRampToValueAtTime(Zn.y,n),t.positionZ.linearRampToValueAtTime(Zn.z,n),t.orientationX.linearRampToValueAtTime($n.x,n),t.orientationY.linearRampToValueAtTime($n.y,n),t.orientationZ.linearRampToValueAtTime($n.z,n)}else t.setPosition(Zn.x,Zn.y,Zn.z),t.setOrientation($n.x,$n.y,$n.z)}}class dd{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class fd{constructor(e,t,n){this.binding=e,this.valueSize=n;let i,r,o;switch(t){case"quaternion":i=this._slerp,r=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":i=this._select,r=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:i=this._lerp,r=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=r,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,i=this.valueSize,r=e*i+i;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==i;++a)n[r+a]=n[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(n,r,0,a,i)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,r=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const l=t*this._origIndex;this._mixBufferRegion(n,i,l,1-r,t)}o>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let r=n,o=i;r!==o;++r)t[r]=t[i+r%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,r){if(i>=.5)for(let o=0;o!==r;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){yt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,r){const o=this._workIndex*r;yt.multiplyQuaternionsFlat(e,o,e,t,e,n),yt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,r){const o=1-i;for(let a=0;a!==r;++a){const l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,r){for(let o=0;o!==r;++o){const a=t+o;e[a]=e[a]+e[n+o]*i}}}const Gl="\\[\\]\\.:\\/",Z0=new RegExp("["+Gl+"]","g"),kl="[^"+Gl+"]",$0="[^"+Gl.replace("\\.","")+"]",j0=/((?:WC+[\/:])*)/.source.replace("WC",kl),K0=/(WCOD+)?/.source.replace("WCOD",$0),Q0=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",kl),ey=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",kl),ty=new RegExp("^"+j0+K0+Q0+ey+"$"),ny=["material","materials","bones"];class iy{constructor(e,t,n){const i=n||Ge.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Ge{constructor(e,t,n){this.path=t,this.parsedPath=n||Ge.parseTrackName(t),this.node=Ge.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Ge.Composite(e,t,n):new Ge(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Z0,"")}static parseTrackName(e){const t=ty.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const r=n.nodeName.substring(i+1);ny.indexOf(r)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(r){for(let o=0;o<r.length;o++){const a=r[o];if(a.name===t||a.uuid===t)return a;const l=n(a.children);if(l)return l}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let r=t.propertyIndex;if(e||(e=Ge.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(n){let c=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let h=0;h<e.length;h++)if(e[h].name===c){c=h;break}break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const o=e[i];if(o===void 0){const c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(r!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[r]!==void 0&&(r=e.morphTargetDictionary[r])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ge.Composite=iy;Ge.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Ge.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Ge.prototype.GetterByBindingType=[Ge.prototype._getValue_direct,Ge.prototype._getValue_array,Ge.prototype._getValue_arrayElement,Ge.prototype._getValue_toArray];Ge.prototype.SetterByBindingTypeAndVersioning=[[Ge.prototype._setValue_direct,Ge.prototype._setValue_direct_setNeedsUpdate,Ge.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ge.prototype._setValue_array,Ge.prototype._setValue_array_setNeedsUpdate,Ge.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ge.prototype._setValue_arrayElement,Ge.prototype._setValue_arrayElement_setNeedsUpdate,Ge.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ge.prototype._setValue_fromArray,Ge.prototype._setValue_fromArray_setNeedsUpdate,Ge.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class pd{constructor(){this.uuid=It(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,i=arguments.length;n!==i;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,r=this._bindings,o=r.length;let a,l=e.length,c=this.nCachedObjects_;for(let h=0,u=arguments.length;h!==u;++h){const d=arguments[h],f=d.uuid;let g=t[f];if(g===void 0){g=l++,t[f]=g,e.push(d);for(let p=0,m=o;p!==m;++p)r[p].push(new Ge(d,n[p],i[p]))}else if(g<c){a=e[g];const p=--c,m=e[p];t[m.uuid]=g,e[g]=m,t[f]=p,e[p]=d;for(let x=0,y=o;x!==y;++x){const M=r[x],_=M[p];let b=M[g];M[g]=_,b===void 0&&(b=new Ge(d,n[x],i[x])),M[p]=b}}else e[g]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const l=arguments[o],c=l.uuid,h=t[c];if(h!==void 0&&h>=r){const u=r++,d=e[u];t[d.uuid]=h,e[h]=d,t[c]=u,e[u]=l;for(let f=0,g=i;f!==g;++f){const p=n[f],m=p[u],x=p[h];p[h]=m,p[u]=x}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],h=c.uuid,u=t[h];if(u!==void 0)if(delete t[h],u<r){const d=--r,f=e[d],g=--o,p=e[g];t[f.uuid]=u,e[u]=f,t[p.uuid]=d,e[d]=p,e.pop();for(let m=0,x=i;m!==x;++m){const y=n[m],M=y[d],_=y[g];y[u]=M,y[d]=_,y.pop()}}else{const d=--o,f=e[d];d>0&&(t[f.uuid]=u),e[u]=f,e.pop();for(let g=0,p=i;g!==p;++g){const m=n[g];m[u]=m[d],m.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const r=this._bindings;if(i!==void 0)return r[i];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);i=r.length,n[e]=i,o.push(e),a.push(t),r.push(u);for(let d=h,f=l.length;d!==f;++d){const g=l[d];u[d]=new Ge(g,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}}pd.prototype.isAnimationObjectGroup=!0;class ry{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const r=t.tracks,o=r.length,a=new Array(o),l={endingStart:ei,endingEnd:ei};for(let c=0;c!==o;++c){const h=r[c].createInterpolant(null);a[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=au,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,r=e._clip.duration,o=r/i,a=i/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,r=i.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=r,l[1]=r+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const l=(e-r)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case il:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(o),c[h].accumulateAdditive(a);break;case ho:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(o),c[h].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,r=this._loopCount;const o=n===lu;if(e===0)return r===-1?i:o&&(r&1)===1?t-i:i;if(n===ou){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,r+=Math.abs(a);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(r&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=ti,i.endingEnd=ti):(e?i.endingStart=this.zeroSlopeAtStart?ti:ei:i.endingStart=Hr,t?i.endingEnd=this.zeroSlopeAtEnd?ti:ei:i.endingEnd=Hr)}_scheduleFading(e,t,n){const i=this._mixer,r=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,l[0]=t,a[1]=r+e,l[1]=n,this}}class md extends zn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName;let h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==r;++u){const d=i[u],f=d.name;let g=h[f];if(g!==void 0)++g.referenceCount,o[u]=g;else{if(g=o[u],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,f));continue}const p=t&&t._propertyBindings[u].binding.parsedPath;g=new fd(Ge.create(n,f,p),d.ValueTypeName,d.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,f),o[u]=g}a[u].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,r=this._actionsByClip[i];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const r=t[n];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const r=t[n];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const i=this._actions,r=this._actionsByClip;let o=r[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=i.length,i.push(e),o.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const r=e._clip.uuid,o=this._actionsByClip,a=o[r],l=a.knownActions,c=l[l.length-1],h=e._byClipCacheIndex;c._byClipCacheIndex=h,l[h]=c,l.pop(),e._byClipCacheIndex=null;const u=a.actionByRoot,d=(e._localRoot||this._root).uuid;delete u[d],l.length===0&&delete o[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const r=t[n];--r.referenceCount===0&&this._removeInactiveBinding(r)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,r=this._bindings;let o=i[t];o===void 0&&(o={},i[t]=o),o[n]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,a=o[i],l=t[t.length-1],c=e._cacheIndex;l._cacheIndex=c,t[c]=l,t.pop(),delete a[r],Object.keys(a).length===0&&delete o[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new Al(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,r=t[i];e.__cacheIndex=i,t[i]=e,r.__cacheIndex=n,t[n]=r}clipAction(e,t,n){const i=t||this._root,r=i.uuid;let o=typeof e=="string"?Yr.findByName(i,e):e;const a=o!==null?o.uuid:e,l=this._actionsByClip[a];let c=null;if(n===void 0&&(o!==null?n=o.blendMode:n=ho),l!==void 0){const u=l.actionByRoot[r];if(u!==void 0&&u.blendMode===n)return u;c=l.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;const h=new ry(this,o,t,n);return this._bindAction(h,c),this._addInactiveAction(h,a,r),h}existingAction(e,t){const n=t||this._root,i=n.uuid,r=typeof e=="string"?Yr.findByName(n,e):e,o=r?r.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[i]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,r,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,i=this._actionsByClip,r=i[n];if(r!==void 0){const o=r.knownActions;for(let a=0,l=o.length;a!==l;++a){const c=o[a];this._deactivateAction(c);const h=c._cacheIndex,u=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=h,t[h]=u,t.pop(),this._removeInactiveBindingsForAction(c)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const o in n){const a=n[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const i=this._bindingsByRootAndName,r=i[t];if(r!==void 0)for(const o in r){const a=r[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}md.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Io{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Io(this.value.clone===void 0?this.value:this.value.clone())}}class gd extends bi{constructor(e,t,n=1){super(e,t),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}gd.prototype.isInstancedInterleavedBuffer=!0;class xd{constructor(e,t,n,i,r){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,this.count=r,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}xd.prototype.isGLBufferAttribute=!0;class sy{constructor(e,t,n=0,i=1/0){this.ray=new Hn(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new uo,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return ja(e,this,n,t),n.sort(sh),n}intersectObjects(e,t=!0,n=[]){for(let i=0,r=e.length;i<r;i++)ja(e[i],this,n,t);return n.sort(sh),n}}function sh(s,e){return s.distance-e.distance}function ja(s,e,t,n){if(s.layers.test(e.layers)&&s.raycast(e,t),n===!0){const i=s.children;for(let r=0,o=i.length;r<o;r++)ja(i[r],e,t,!0)}}class oy{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(rt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class ay{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}const oh=new Z;class xr{constructor(e=new Z(1/0,1/0),t=new Z(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=oh.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return oh.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}xr.prototype.isBox2=!0;const ah=new S,Vs=new S;class yd{constructor(e=new S,t=new S){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){ah.subVectors(e,this.start),Vs.subVectors(this.end,this.start);const n=Vs.dot(Vs);let r=Vs.dot(ah)/n;return t&&(r=rt(r,0,1)),r}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const lh=new S;class ly extends Ne{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new ye,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o<l;o++,a++){const c=o/l*Math.PI*2,h=a/l*Math.PI*2;i.push(Math.cos(c),Math.sin(c),1,Math.cos(h),Math.sin(h),1)}n.setAttribute("position",new de(i,3));const r=new gt({fog:!1,toneMapped:!1});this.cone=new At(n,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),lh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(lh),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const An=new S,Ws=new fe,ma=new fe;class _d extends At{constructor(e){const t=vd(e),n=new ye,i=[],r=[],o=new ae(0,0,1),a=new ae(0,1,0);for(let c=0;c<t.length;c++){const h=t[c];h.parent&&h.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(a.r,a.g,a.b))}n.setAttribute("position",new de(i,3)),n.setAttribute("color",new de(r,3));const l=new gt({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,l),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,i=n.getAttribute("position");ma.copy(this.root.matrixWorld).invert();for(let r=0,o=0;r<t.length;r++){const a=t[r];a.parent&&a.parent.isBone&&(Ws.multiplyMatrices(ma,a.matrixWorld),An.setFromMatrixPosition(Ws),i.setXYZ(o,An.x,An.y,An.z),Ws.multiplyMatrices(ma,a.parent.matrixWorld),An.setFromMatrixPosition(Ws),i.setXYZ(o+1,An.x,An.y,An.z),o+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function vd(s){const e=[];s.isBone===!0&&e.push(s);for(let t=0;t<s.children.length;t++)e.push.apply(e,vd(s.children[t]));return e}class cy extends ht{constructor(e,t,n){const i=new yi(t,4,2),r=new yn({wireframe:!0,fog:!1,toneMapped:!1});super(i,r),this.light=e,this.light.updateMatrixWorld(),this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const hy=new S,ch=new ae,hh=new ae;class uy extends Ne{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const i=new gi(t);i.rotateY(Math.PI*.5),this.material=new yn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const r=i.getAttribute("position"),o=new Float32Array(r.count*3);i.setAttribute("color",new Oe(o,3)),this.add(new ht(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");ch.copy(this.light.color),hh.copy(this.light.groundColor);for(let n=0,i=t.count;n<i;n++){const r=n<i/2?ch:hh;t.setXYZ(n,r.r,r.g,r.b)}t.needsUpdate=!0}e.lookAt(hy.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Md extends At{constructor(e=10,t=10,n=4473924,i=8947848){n=new ae(n),i=new ae(i);const r=t/2,o=e/t,a=e/2,l=[],c=[];for(let d=0,f=0,g=-a;d<=t;d++,g+=o){l.push(-a,0,g,a,0,g),l.push(g,0,-a,g,0,a);const p=d===r?n:i;p.toArray(c,f),f+=3,p.toArray(c,f),f+=3,p.toArray(c,f),f+=3,p.toArray(c,f),f+=3}const h=new ye;h.setAttribute("position",new de(l,3)),h.setAttribute("color",new de(c,3));const u=new gt({vertexColors:!0,toneMapped:!1});super(h,u),this.type="GridHelper"}}class dy extends At{constructor(e=10,t=16,n=8,i=64,r=4473924,o=8947848){r=new ae(r),o=new ae(o);const a=[],l=[];for(let u=0;u<=t;u++){const d=u/t*(Math.PI*2),f=Math.sin(d)*e,g=Math.cos(d)*e;a.push(0,0,0),a.push(f,0,g);const p=u&1?r:o;l.push(p.r,p.g,p.b),l.push(p.r,p.g,p.b)}for(let u=0;u<=n;u++){const d=u&1?r:o,f=e-e/n*u;for(let g=0;g<i;g++){let p=g/i*(Math.PI*2),m=Math.sin(p)*f,x=Math.cos(p)*f;a.push(m,0,x),l.push(d.r,d.g,d.b),p=(g+1)/i*(Math.PI*2),m=Math.sin(p)*f,x=Math.cos(p)*f,a.push(m,0,x),l.push(d.r,d.g,d.b)}}const c=new ye;c.setAttribute("position",new de(a,3)),c.setAttribute("color",new de(l,3));const h=new gt({vertexColors:!0,toneMapped:!1});super(c,h),this.type="PolarGridHelper"}}const uh=new S,qs=new S,dh=new S;class fy extends Ne{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,t===void 0&&(t=1);let i=new ye;i.setAttribute("position",new de([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const r=new gt({fog:!1,toneMapped:!1});this.lightPlane=new gn(i,r),this.add(this.lightPlane),i=new ye,i.setAttribute("position",new de([0,0,0,0,0,1],3)),this.targetLine=new gn(i,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){uh.setFromMatrixPosition(this.light.matrixWorld),qs.setFromMatrixPosition(this.light.target.matrixWorld),dh.subVectors(qs,uh),this.lightPlane.lookAt(qs),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(qs),this.targetLine.scale.z=dh.length()}}const Xs=new S,tt=new Kr;class py extends At{constructor(e){const t=new ye,n=new gt({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],o={},a=new ae(16755200),l=new ae(16711680),c=new ae(43775),h=new ae(16777215),u=new ae(3355443);d("n1","n2",a),d("n2","n4",a),d("n4","n3",a),d("n3","n1",a),d("f1","f2",a),d("f2","f4",a),d("f4","f3",a),d("f3","f1",a),d("n1","f1",a),d("n2","f2",a),d("n3","f3",a),d("n4","f4",a),d("p","n1",l),d("p","n2",l),d("p","n3",l),d("p","n4",l),d("u1","u2",c),d("u2","u3",c),d("u3","u1",c),d("c","t",h),d("p","c",u),d("cn1","cn2",u),d("cn3","cn4",u),d("cf1","cf2",u),d("cf3","cf4",u);function d(g,p,m){f(g,m),f(p,m)}function f(g,p){i.push(0,0,0),r.push(p.r,p.g,p.b),o[g]===void 0&&(o[g]=[]),o[g].push(i.length/3-1)}t.setAttribute("position",new de(i,3)),t.setAttribute("color",new de(r,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){const e=this.geometry,t=this.pointMap,n=1,i=1;tt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),nt("c",t,e,tt,0,0,-1),nt("t",t,e,tt,0,0,1),nt("n1",t,e,tt,-1,-1,-1),nt("n2",t,e,tt,n,-1,-1),nt("n3",t,e,tt,-1,i,-1),nt("n4",t,e,tt,n,i,-1),nt("f1",t,e,tt,-1,-1,1),nt("f2",t,e,tt,n,-1,1),nt("f3",t,e,tt,-1,i,1),nt("f4",t,e,tt,n,i,1),nt("u1",t,e,tt,n*.7,i*1.1,-1),nt("u2",t,e,tt,-1*.7,i*1.1,-1),nt("u3",t,e,tt,0,i*2,-1),nt("cf1",t,e,tt,-1,0,1),nt("cf2",t,e,tt,n,0,1),nt("cf3",t,e,tt,0,-1,1),nt("cf4",t,e,tt,0,i,1),nt("cn1",t,e,tt,-1,0,-1),nt("cn2",t,e,tt,n,0,-1),nt("cn3",t,e,tt,0,-1,-1),nt("cn4",t,e,tt,0,i,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function nt(s,e,t,n,i,r,o){Xs.set(i,r,o).unproject(n);const a=e[s];if(a!==void 0){const l=t.getAttribute("position");for(let c=0,h=a.length;c<h;c++)l.setXYZ(a[c],Xs.x,Xs.y,Xs.z)}}const Js=new Ft;class bd extends At{constructor(e,t=16776960){const n=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]),i=new Float32Array(8*3),r=new ye;r.setIndex(new Oe(n,1)),r.setAttribute("position",new Oe(i,3)),super(r,new gt({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&Js.setFromObject(this.object),Js.isEmpty())return;const t=Js.min,n=Js.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=t.x,r[4]=n.y,r[5]=n.z,r[6]=t.x,r[7]=t.y,r[8]=n.z,r[9]=n.x,r[10]=t.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=t.z,r[15]=t.x,r[16]=n.y,r[17]=t.z,r[18]=t.x,r[19]=t.y,r[20]=t.z,r[21]=n.x,r[22]=t.y,r[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return At.prototype.copy.call(this,e),this.object=e.object,this}}class my extends At{constructor(e,t=16776960){const n=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]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],r=new ye;r.setIndex(new Oe(n,1)),r.setAttribute("position",new de(i,3)),super(r,new gt({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class gy extends gn{constructor(e,t=1,n=16776960){const i=n,r=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],o=new ye;o.setAttribute("position",new de(r,3)),o.computeBoundingSphere(),super(o,new gt({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],l=new ye;l.setAttribute("position",new de(a,3)),l.computeBoundingSphere(),this.add(new ht(l,new yn({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?Pt:hi,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const fh=new S;let Ys,ga;class xy extends Ne{constructor(e=new S(0,0,1),t=new S(0,0,0),n=1,i=16776960,r=n*.2,o=r*.2){super(),this.type="ArrowHelper",Ys===void 0&&(Ys=new ye,Ys.setAttribute("position",new de([0,0,0,0,1,0],3)),ga=new Bn(0,.5,1,5,1),ga.translate(0,-.5,0)),this.position.copy(t),this.line=new gn(Ys,new gt({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ht(ga,new yn({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,r,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{fh.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(fh,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class wd extends At{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new ye;i.setAttribute("position",new de(t,3)),i.setAttribute("color",new de(n,3));const r=new gt({vertexColors:!0,toneMapped:!1});super(i,r),this.type="AxesHelper"}setColors(e,t,n){const i=new ae,r=this.geometry.attributes.color.array;return i.set(e),i.toArray(r,0),i.toArray(r,3),i.set(t),i.toArray(r,6),i.toArray(r,9),i.set(n),i.toArray(r,12),i.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class yy{constructor(){this.type="ShapePath",this.color=new ae,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new tr,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,r,o){return this.currentPath.bezierCurveTo(e,t,n,i,r,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(y){const M=[];for(let _=0,b=y.length;_<b;_++){const A=y[_],R=new en;R.curves=A.curves,M.push(R)}return M}function i(y,M){const _=M.length;let b=!1;for(let A=_-1,R=0;R<_;A=R++){let P=M[A],H=M[R],I=H.x-P.x,v=H.y-P.y;if(Math.abs(v)>Number.EPSILON){if(v<0&&(P=M[R],I=-I,H=M[A],v=-v),y.y<P.y||y.y>H.y)continue;if(y.y===P.y){if(y.x===P.x)return!0}else{const C=v*(y.x-P.x)-I*(y.y-P.y);if(C===0)return!0;if(C<0)continue;b=!b}}else{if(y.y!==P.y)continue;if(H.x<=y.x&&y.x<=P.x||P.x<=y.x&&y.x<=H.x)return!0}}return b}const r=tn.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c;const h=[];if(o.length===1)return l=o[0],c=new en,c.curves=l.curves,h.push(c),h;let u=!r(o[0].getPoints());u=e?!u:u;const d=[],f=[];let g=[],p=0,m;f[p]=void 0,g[p]=[];for(let y=0,M=o.length;y<M;y++)l=o[y],m=l.getPoints(),a=r(m),a=e?!a:a,a?(!u&&f[p]&&p++,f[p]={s:new en,p:m},f[p].s.curves=l.curves,u&&p++,g[p]=[]):g[p].push({h:l,p:m[0]});if(!f[0])return n(o);if(f.length>1){let y=!1,M=0;for(let _=0,b=f.length;_<b;_++)d[_]=[];for(let _=0,b=f.length;_<b;_++){const A=g[_];for(let R=0;R<A.length;R++){const P=A[R];let H=!0;for(let I=0;I<f.length;I++)i(P.p,f[I].p)&&(_!==I&&M++,H?(H=!1,d[I].push(P)):y=!0);H&&d[_].push(P)}}M>0&&y===!1&&(g=d)}let x;for(let y=0,M=f.length;y<M;y++){c=f[y].s,h.push(c),x=g[y];for(let _=0,b=x.length;_<b;_++)c.holes.push(x[_].h)}return h}}class _y{static toHalfFloat(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=rt(e,-65504,65504),ph[0]=e;const t=mh[0],n=t>>23&511;return kt[n]+((t&8388607)>>Vt[n])}static fromHalfFloat(e){const t=e>>10;return mh[0]=Vl[Ed[t]+(e&1023)]+yr[t],ph[0]}}const Sd=new ArrayBuffer(4),ph=new Float32Array(Sd),mh=new Uint32Array(Sd),kt=new Uint32Array(512),Vt=new Uint32Array(512);for(let s=0;s<256;++s){const e=s-127;e<-27?(kt[s]=0,kt[s|256]=32768,Vt[s]=24,Vt[s|256]=24):e<-14?(kt[s]=1024>>-e-14,kt[s|256]=1024>>-e-14|32768,Vt[s]=-e-1,Vt[s|256]=-e-1):e<=15?(kt[s]=e+15<<10,kt[s|256]=e+15<<10|32768,Vt[s]=13,Vt[s|256]=13):e<128?(kt[s]=31744,kt[s|256]=64512,Vt[s]=24,Vt[s|256]=24):(kt[s]=31744,kt[s|256]=64512,Vt[s]=13,Vt[s|256]=13)}const Vl=new Uint32Array(2048),yr=new Uint32Array(64),Ed=new Uint32Array(64);for(let s=1;s<1024;++s){let e=s<<13,t=0;for(;!(e&8388608);)e<<=1,t-=8388608;e&=-8388609,t+=947912704,Vl[s]=e|t}for(let s=1024;s<2048;++s)Vl[s]=939524096+(s-1024<<13);for(let s=1;s<31;++s)yr[s]=s<<23;yr[31]=1199570944;yr[32]=2147483648;for(let s=33;s<63;++s)yr[s]=2147483648+(s-32<<23);yr[63]=3347054592;for(let s=1;s<64;++s)s!==32&&(Ed[s]=1024);const vy=0,My=1,by=0,wy=1,Sy=2;function Ey(s){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),s}function Ty(s=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),s.isMultiMaterial=!0,s.materials=s,s.clone=function(){return s.slice()},s}class Ay extends is{constructor(e,t){console.warn("THREE.PointCloud has been renamed to THREE.Points."),super(e,t)}}class Cy extends bo{constructor(e){console.warn("THREE.Particle has been renamed to THREE.Sprite."),super(e)}}class Ry extends is{constructor(e,t){console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),super(e,t)}}class Ly extends wi{constructor(e){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),super(e)}}class Py extends wi{constructor(e){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),super(e)}}class Iy extends wi{constructor(e){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),super(e)}}class Dy extends S{constructor(e,t,n){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),super(e,t,n)}}class Fy extends Oe{constructor(e,t){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),super(e,t),this.setUsage(Qi)}}class By extends vu{constructor(e,t){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),super(e,t)}}class Ny extends Mu{constructor(e,t){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),super(e,t)}}class zy extends bu{constructor(e,t){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),super(e,t)}}class Uy extends wu{constructor(e,t){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),super(e,t)}}class Oy extends fo{constructor(e,t){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),super(e,t)}}class Hy extends Su{constructor(e,t){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),super(e,t)}}class Gy extends po{constructor(e,t){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),super(e,t)}}class ky extends de{constructor(e,t){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),super(e,t)}}class Vy extends Tu{constructor(e,t){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),super(e,t)}}Dt.create=function(s,e){return console.log("THREE.Curve.create() has been deprecated"),s.prototype=Object.create(Dt.prototype),s.prototype.constructor=s,s.prototype.getPoint=e,s};tr.prototype.fromPoints=function(s){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(s)};class Wy extends wd{constructor(e){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),super(e)}}class qy extends bd{constructor(e,t){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),super(e,t)}}class Xy extends At{constructor(e,t){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),super(new gl(e.geometry),new gt({color:t!==void 0?t:16777215}))}}Md.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};_d.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};class Jy extends At{constructor(e,t){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),super(new xl(e.geometry),new gt({color:t!==void 0?t:16777215}))}}Tt.prototype.extractUrlBase=function(s){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),ao.extractUrlBase(s)};Tt.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};class Yy extends on{constructor(e){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),super(e)}}class Zy extends ed{constructor(e){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),super(e)}}xr.prototype.center=function(s){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(s)};xr.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()};xr.prototype.isIntersectionBox=function(s){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(s)};xr.prototype.size=function(s){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(s)};Ft.prototype.center=function(s){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(s)};Ft.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Ft.prototype.isIntersectionBox=function(s){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(s)};Ft.prototype.isIntersectionSphere=function(s){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(s)};Ft.prototype.size=function(s){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(s)};Gn.prototype.toVector3=function(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")};On.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Qr.prototype.setFromMatrix=function(s){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(s)};yd.prototype.center=function(s){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(s)};ft.prototype.flattenToArrayOffset=function(s,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(s,e)};ft.prototype.multiplyVector3=function(s){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),s.applyMatrix3(this)};ft.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")};ft.prototype.applyToBufferAttribute=function(s){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),s.applyMatrix3(this)};ft.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")};ft.prototype.getInverse=function(s){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(s).invert()};fe.prototype.extractPosition=function(s){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(s)};fe.prototype.flattenToArrayOffset=function(s,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(s,e)};fe.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new S().setFromMatrixColumn(this,3)};fe.prototype.setRotationFromQuaternion=function(s){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(s)};fe.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")};fe.prototype.multiplyVector3=function(s){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),s.applyMatrix4(this)};fe.prototype.multiplyVector4=function(s){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),s.applyMatrix4(this)};fe.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")};fe.prototype.rotateAxis=function(s){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),s.transformDirection(this)};fe.prototype.crossVector=function(s){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),s.applyMatrix4(this)};fe.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")};fe.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")};fe.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")};fe.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")};fe.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")};fe.prototype.applyToBufferAttribute=function(s){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),s.applyMatrix4(this)};fe.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")};fe.prototype.makeFrustum=function(s,e,t,n,i,r){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(s,e,n,t,i,r)};fe.prototype.getInverse=function(s){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(s).invert()};Kt.prototype.isIntersectionLine=function(s){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(s)};yt.prototype.multiplyVector3=function(s){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),s.applyQuaternion(this)};yt.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()};Hn.prototype.isIntersectionBox=function(s){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(s)};Hn.prototype.isIntersectionPlane=function(s){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(s)};Hn.prototype.isIntersectionSphere=function(s){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(s)};st.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()};st.prototype.barycoordFromPoint=function(s,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(s,e)};st.prototype.midpoint=function(s){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(s)};st.prototypenormal=function(s){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(s)};st.prototype.plane=function(s){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(s)};st.barycoordFromPoint=function(s,e,t,n,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),st.getBarycoord(s,e,t,n,i)};st.normal=function(s,e,t,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),st.getNormal(s,e,t,n)};en.prototype.extractAllPoints=function(s){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(s)};en.prototype.extrude=function(s){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new sn(this,s)};en.prototype.makeGeometry=function(s){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new xi(this,s)};Z.prototype.fromAttribute=function(s,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(s,e,t)};Z.prototype.distanceToManhattan=function(s){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(s)};Z.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};S.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")};S.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")};S.prototype.getPositionFromMatrix=function(s){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(s)};S.prototype.getScaleFromMatrix=function(s){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(s)};S.prototype.getColumnFromMatrix=function(s,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,s)};S.prototype.applyProjection=function(s){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(s)};S.prototype.fromAttribute=function(s,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(s,e,t)};S.prototype.distanceToManhattan=function(s){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(s)};S.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};qe.prototype.fromAttribute=function(s,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(s,e,t)};qe.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};Ne.prototype.getChildByName=function(s){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(s)};Ne.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")};Ne.prototype.translate=function(s,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,s)};Ne.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")};Ne.prototype.applyMatrix=function(s){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(s)};Object.defineProperties(Ne.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(s){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=s}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});ht.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")};Object.defineProperties(ht.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),cu},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}});wo.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")};mt.prototype.setLens=function(s,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(s)};Object.defineProperties(qt.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(s){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=s}},shadowCameraLeft:{set:function(s){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=s}},shadowCameraRight:{set:function(s){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=s}},shadowCameraTop:{set:function(s){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=s}},shadowCameraBottom:{set:function(s){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=s}},shadowCameraNear:{set:function(s){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=s}},shadowCameraFar:{set:function(s){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=s}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(s){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=s}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(s){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=s}},shadowMapHeight:{set:function(s){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=s}}});Object.defineProperties(Oe.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Qi},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Qi)}}});Oe.prototype.setDynamic=function(s){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(s===!0?Qi:Ki),this};Oe.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Oe.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};ye.prototype.addIndex=function(s){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(s)};ye.prototype.addAttribute=function(s,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),!(e&&e.isBufferAttribute)&&!(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(s,new Oe(arguments[1],arguments[2]))):s==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(s,e)};ye.prototype.addDrawCall=function(s,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(s,e)};ye.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()};ye.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")};ye.prototype.removeAttribute=function(s){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(s)};ye.prototype.applyMatrix=function(s){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(s)};Object.defineProperties(ye.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}});bi.prototype.setDynamic=function(s){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(s===!0?Qi:Ki),this};bi.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};sn.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")};sn.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")};sn.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")};vo.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")};Io.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this};Object.defineProperties(ot.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new ae}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(s){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=s===Qa}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(s){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=s}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}});Object.defineProperties(zt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(s){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=s}}});Je.prototype.clearTarget=function(s,e,t,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(s),this.clear(e,t,n)};Je.prototype.animate=function(s){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(s)};Je.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()};Je.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()};Je.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision};Je.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()};Je.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")};Je.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")};Je.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")};Je.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")};Je.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")};Je.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")};Je.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures};Je.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")};Je.prototype.enableScissorTest=function(s){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(s)};Je.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};Je.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};Je.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};Je.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Je.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")};Je.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")};Je.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")};Je.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")};Je.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")};Je.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()};Object.defineProperties(Je.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(s){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=s}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(s){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=s}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(s){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=s===!0?$e:nn}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});Object.defineProperties(Nu.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});class $y extends go{constructor(e,t,n){console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),super(e,n)}}Object.defineProperties(St.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(s){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=s}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(s){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=s}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(s){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=s}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(s){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=s}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(s){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=s}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(s){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=s}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(s){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=s}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(s){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=s}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(s){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=s}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(s){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=s}}});Hl.prototype.load=function(s){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new ld().load(s,function(n){e.setBuffer(n)}),this};dd.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};mo.prototype.updateCubeMap=function(s,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(s,e)};mo.prototype.clear=function(s,e,t,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(s,e,t,n)};Un.crossOrigin=void 0;Un.loadTexture=function(s,e,t,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new td;i.setCrossOrigin(this.crossOrigin);const r=i.load(s,t,void 0,n);return e&&(r.mapping=e),r};Un.loadTextureCube=function(s,e,t,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new Qu;i.setCrossOrigin(this.crossOrigin);const r=i.load(s,t,void 0,n);return e&&(r.mapping=e),r};Un.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};Un.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};function jy(){console.error("THREE.CanvasRenderer has been removed")}function Ky(){console.error("THREE.JSONLoader has been removed.")}const Qy={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function e_(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}class t_ extends ye{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class n_ extends ye{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function i_(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function r_(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function s_(){console.error("THREE.ImmediateRenderObject has been removed.")}class o_ extends St{constructor(e,t,n){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,n),this.samples=4}}class a_ extends fr{constructor(e,t,n,i){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,n,i)}}class l_ extends jr{constructor(e,t,n,i){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,n,i)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:lo}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=lo);const c_=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Vh,AddEquation:Kn,AddOperation:Oh,AdditiveAnimationBlendMode:il,AdditiveBlending:ya,AlphaFormat:$h,AlwaysDepth:Ih,AlwaysStencilFunc:fu,AmbientLight:Bl,AmbientLightProbe:hd,AnimationClip:Yr,AnimationLoader:H0,AnimationMixer:md,AnimationObjectGroup:pd,AnimationUtils:je,ArcCurve:ul,ArrayCamera:ol,ArrowHelper:xy,Audio:Hl,AudioAnalyser:dd,AudioContext:Ol,AudioListener:X0,AudioLoader:ld,AxesHelper:wd,AxisHelper:Wy,BackSide:Pt,BasicDepthPacking:hu,BasicShadowMap:Fd,BinaryTextureLoader:Zy,Bone:So,BooleanKeyframeTrack:Si,BoundingBoxHelper:qy,Box2:xr,Box3:Ft,Box3Helper:my,BoxBufferGeometry:mn,BoxGeometry:mn,BoxHelper:bd,BufferAttribute:Oe,BufferGeometry:ye,BufferGeometryLoader:od,ByteType:qh,Cache:_i,Camera:Kr,CameraHelper:py,CanvasRenderer:jy,CanvasTexture:Vu,CapsuleBufferGeometry:nr,CapsuleGeometry:nr,CatmullRomCurve3:fl,CineonToneMapping:kh,CircleBufferGeometry:ir,CircleGeometry:ir,ClampToEdgeWrapping:wt,Clock:ud,Color:ae,ColorKeyframeTrack:Cl,ColorManagement:Nt,CompressedTexture:hl,CompressedTextureLoader:G0,ConeBufferGeometry:rr,ConeGeometry:rr,CubeCamera:mo,CubeReflectionMapping:Pn,CubeRefractionMapping:In,CubeTexture:pr,CubeTextureLoader:Qu,CubeUVReflectionMapping:dr,CubicBezierCurve:To,CubicBezierCurve3:pl,CubicInterpolant:Zu,CullFaceBack:xa,CullFaceFront:xh,CullFaceFrontBack:Dd,CullFaceNone:gh,Curve:Dt,CurvePath:qu,CustomBlending:_h,CustomToneMapping:Wh,CylinderBufferGeometry:Bn,CylinderGeometry:Bn,Cylindrical:ay,Data3DTexture:jr,DataArrayTexture:fr,DataTexture:ci,DataTexture2DArray:a_,DataTexture3D:l_,DataTextureLoader:ed,DataUtils:_y,DecrementStencilOp:Xd,DecrementWrapStencilOp:Yd,DefaultLoadingManager:Ku,DepthFormat:Rn,DepthStencilFormat:di,DepthTexture:al,DirectionalLight:Fl,DirectionalLightHelper:fy,DiscreteInterpolant:$u,DodecahedronBufferGeometry:sr,DodecahedronGeometry:sr,DoubleSide:ui,DstAlphaFactor:Th,DstColorFactor:Ch,DynamicBufferAttribute:Fy,DynamicCopyUsage:cf,DynamicDrawUsage:Qi,DynamicReadUsage:of,EdgesGeometry:gl,EdgesHelper:Xy,EllipseCurve:rs,EqualDepth:Fh,EqualStencilFunc:Kd,EquirectangularReflectionMapping:Fr,EquirectangularRefractionMapping:Br,Euler:Gn,EventDispatcher:zn,ExtrudeBufferGeometry:sn,ExtrudeGeometry:sn,FaceColors:wy,FileLoader:on,FlatShading:Qa,Float16BufferAttribute:Eu,Float32Attribute:ky,Float32BufferAttribute:de,Float64Attribute:Vy,Float64BufferAttribute:Tu,FloatType:fn,Fog:ns,FogExp2:ts,Font:r_,FontLoader:i_,FramebufferTexture:ku,FrontSide:hi,Frustum:Qr,GLBufferAttribute:xd,GLSL1:uf,GLSL3:Wa,GreaterDepth:Nh,GreaterEqualDepth:Bh,GreaterEqualStencilFunc:nf,GreaterStencilFunc:ef,GridHelper:Md,Group:ii,HalfFloatType:si,HemisphereLight:Ll,HemisphereLightHelper:uy,HemisphereLightProbe:cd,IcosahedronBufferGeometry:or,IcosahedronGeometry:or,ImageBitmapLoader:ad,ImageLoader:Zr,ImageUtils:Un,ImmediateRenderObject:s_,IncrementStencilOp:qd,IncrementWrapStencilOp:Jd,InstancedBufferAttribute:pi,InstancedBufferGeometry:Ul,InstancedInterleavedBuffer:gd,InstancedMesh:ll,Int16Attribute:Uy,Int16BufferAttribute:wu,Int32Attribute:Hy,Int32BufferAttribute:Su,Int8Attribute:By,Int8BufferAttribute:vu,IntType:Jh,InterleavedBuffer:bi,InterleavedBufferAttribute:Fn,Interpolant:xn,InterpolateDiscrete:Ur,InterpolateLinear:Or,InterpolateSmooth:Qs,InvertStencilOp:Zd,JSONLoader:Ky,KeepStencilOp:eo,KeyframeTrack:Xt,LOD:Hu,LatheBufferGeometry:mi,LatheGeometry:mi,Layers:uo,LensFlare:e_,LessDepth:Dh,LessEqualDepth:no,LessEqualStencilFunc:Qd,LessStencilFunc:jd,Light:qt,LightProbe:os,Line:gn,Line3:yd,LineBasicMaterial:gt,LineCurve:ss,LineCurve3:Wu,LineDashedMaterial:Tl,LineLoop:cl,LinePieces:My,LineSegments:At,LineStrip:vy,LinearEncoding:nn,LinearFilter:it,LinearInterpolant:Al,LinearMipMapLinearFilter:Od,LinearMipMapNearestFilter:Ud,LinearMipmapLinearFilter:vi,LinearMipmapNearestFilter:nl,LinearSRGBColorSpace:Cn,LinearToneMapping:Hh,Loader:Tt,LoaderUtils:ao,LoadingManager:Rl,LoopOnce:ou,LoopPingPong:lu,LoopRepeat:au,LuminanceAlphaFormat:Qh,LuminanceFormat:Kh,MOUSE:Pd,Material:ot,MaterialLoader:sd,Math:Xl,MathUtils:Xl,Matrix3:ft,Matrix4:fe,MaxEquation:ba,Mesh:ht,MeshBasicMaterial:yn,MeshDepthMaterial:yo,MeshDistanceMaterial:_o,MeshFaceMaterial:Ey,MeshLambertMaterial:Sl,MeshMatcapMaterial:El,MeshNormalMaterial:wl,MeshPhongMaterial:Ml,MeshPhysicalMaterial:vl,MeshStandardMaterial:Po,MeshToonMaterial:bl,MinEquation:Ma,MirroredRepeatWrapping:zr,MixOperation:Uh,MultiMaterial:Ty,MultiplyBlending:va,MultiplyOperation:$r,NearestFilter:ct,NearestMipMapLinearFilter:zd,NearestMipMapNearestFilter:Nd,NearestMipmapLinearFilter:ro,NearestMipmapNearestFilter:io,NeverDepth:Ph,NeverStencilFunc:$d,NoBlending:pn,NoColorSpace:kd,NoColors:by,NoToneMapping:Qt,NormalAnimationBlendMode:ho,NormalBlending:ri,NotEqualDepth:zh,NotEqualStencilFunc:tf,NumberKeyframeTrack:Xr,Object3D:Ne,ObjectLoader:k0,ObjectSpaceNormalMap:du,OctahedronBufferGeometry:gi,OctahedronGeometry:gi,OneFactor:wh,OneMinusDstAlphaFactor:Ah,OneMinusDstColorFactor:Rh,OneMinusSrcAlphaFactor:tl,OneMinusSrcColorFactor:Eh,OrthographicCamera:es,PCFShadowMap:Ka,PCFSoftShadowMap:yh,PMREMGenerator:Xa,ParametricGeometry:t_,Particle:Cy,ParticleBasicMaterial:Py,ParticleSystem:Ry,ParticleSystemMaterial:Iy,Path:tr,PerspectiveCamera:mt,Plane:Kt,PlaneBufferGeometry:fi,PlaneGeometry:fi,PlaneHelper:gy,PointCloud:Ay,PointCloudMaterial:Ly,PointLight:Dl,PointLightHelper:cy,Points:is,PointsMaterial:wi,PolarGridHelper:dy,PolyhedronBufferGeometry:rn,PolyhedronGeometry:rn,PositionalAudio:Y0,PropertyBinding:Ge,PropertyMixer:fd,QuadraticBezierCurve:Ao,QuadraticBezierCurve3:Co,Quaternion:yt,QuaternionKeyframeTrack:gr,QuaternionLinearInterpolant:ju,REVISION:lo,RGBADepthPacking:uu,RGBAFormat:Lt,RGBAIntegerFormat:ru,RGBA_ASTC_10x10_Format:Ha,RGBA_ASTC_10x5_Format:za,RGBA_ASTC_10x6_Format:Ua,RGBA_ASTC_10x8_Format:Oa,RGBA_ASTC_12x10_Format:Ga,RGBA_ASTC_12x12_Format:ka,RGBA_ASTC_4x4_Format:Ra,RGBA_ASTC_5x4_Format:La,RGBA_ASTC_5x5_Format:Pa,RGBA_ASTC_6x5_Format:Ia,RGBA_ASTC_6x6_Format:Da,RGBA_ASTC_8x5_Format:Fa,RGBA_ASTC_8x6_Format:Ba,RGBA_ASTC_8x8_Format:Na,RGBA_BPTC_Format:Va,RGBA_ETC2_EAC_Format:Ca,RGBA_PVRTC_2BPPV1_Format:Ta,RGBA_PVRTC_4BPPV1_Format:Ea,RGBA_S3TC_DXT1_Format:$s,RGBA_S3TC_DXT3_Format:js,RGBA_S3TC_DXT5_Format:Ks,RGBFormat:jh,RGB_ETC1_Format:su,RGB_ETC2_Format:Aa,RGB_PVRTC_2BPPV1_Format:Sa,RGB_PVRTC_4BPPV1_Format:wa,RGB_S3TC_DXT1_Format:Zs,RGFormat:nu,RGIntegerFormat:iu,RawShaderMaterial:_l,Ray:Hn,Raycaster:sy,RectAreaLight:Nl,RedFormat:eu,RedIntegerFormat:tu,ReinhardToneMapping:Gh,RepeatWrapping:Nr,ReplaceStencilOp:Wd,ReverseSubtractEquation:Mh,RingBufferGeometry:ar,RingGeometry:ar,SRGBColorSpace:jt,Scene:vo,SceneUtils:Qy,ShaderChunk:Fe,ShaderLib:Wt,ShaderMaterial:zt,ShadowMaterial:yl,Shape:en,ShapeBufferGeometry:xi,ShapeGeometry:xi,ShapePath:yy,ShapeUtils:tn,ShortType:Xh,Skeleton:Eo,SkeletonHelper:_d,SkinnedMesh:wo,SmoothShading:Bd,Source:ni,Sphere:On,SphereBufferGeometry:yi,SphereGeometry:yi,Spherical:oy,SphericalHarmonics3:zl,SplineCurve:Ro,SpotLight:Il,SpotLightHelper:ly,Sprite:bo,SpriteMaterial:Mo,SrcAlphaFactor:el,SrcAlphaSaturateFactor:Lh,SrcColorFactor:Sh,StaticCopyUsage:lf,StaticDrawUsage:Ki,StaticReadUsage:sf,StereoCamera:W0,StreamCopyUsage:hf,StreamDrawUsage:rf,StreamReadUsage:af,StringKeyframeTrack:Ei,SubtractEquation:vh,SubtractiveBlending:_a,TOUCH:Id,TangentSpaceNormalMap:Mi,TetrahedronBufferGeometry:lr,TetrahedronGeometry:lr,TextGeometry:n_,Texture:ut,TextureLoader:td,TorusBufferGeometry:cr,TorusGeometry:cr,TorusKnotBufferGeometry:hr,TorusKnotGeometry:hr,Triangle:st,TriangleFanDrawMode:Gd,TriangleStripDrawMode:Hd,TrianglesDrawMode:cu,TubeBufferGeometry:ur,TubeGeometry:ur,UVMapping:co,Uint16Attribute:Oy,Uint16BufferAttribute:fo,Uint32Attribute:Gy,Uint32BufferAttribute:po,Uint8Attribute:Ny,Uint8BufferAttribute:Mu,Uint8ClampedAttribute:zy,Uint8ClampedBufferAttribute:bu,Uniform:Io,UniformsLib:se,UniformsUtils:Au,UnsignedByteType:Dn,UnsignedInt248Type:oi,UnsignedIntType:Lr,UnsignedShort4444Type:Yh,UnsignedShort5551Type:Zh,UnsignedShortType:ji,VSMShadowMap:Ji,Vector2:Z,Vector3:S,Vector4:qe,VectorKeyframeTrack:Jr,Vertex:Dy,VertexColors:Sy,VideoTexture:Gu,WebGL1Renderer:Uu,WebGL3DRenderTarget:yu,WebGLArrayRenderTarget:xu,WebGLCubeRenderTarget:go,WebGLMultipleRenderTargets:_u,WebGLMultisampleRenderTarget:o_,WebGLRenderTarget:St,WebGLRenderTargetCube:$y,WebGLRenderer:Je,WebGLUtils:zu,WireframeGeometry:xl,WireframeHelper:Jy,WrapAroundEnding:Hr,XHRLoader:Yy,ZeroCurvatureEnding:ei,ZeroFactor:bh,ZeroSlopeEnding:ti,ZeroStencilOp:Vd,_SRGBAFormat:so,sRGBEncoding:$e},Symbol.toStringTag,{value:"Module"}));export{Vh as A,ye as B,Nt as C,ui as D,zn as E,de as F,Co as G,gn as H,Ul as I,yi as J,Ne as K,nn as L,Pd as M,Qt as N,es as O,mt as P,yt as Q,sy as R,vo as S,ut as T,Au as U,S as V,Je as W,yh as a,Kr as b,Z as c,ud as d,uo as e,ae as f,c_ as g,Oe as h,oy as i,Id as j,Hn as k,Kt as l,gd as m,Fn as n,xl as o,Ft as p,On as q,zt as r,$e as s,lo as t,se as u,ht as v,qe as w,yd as x,fe as y,Xl as z};
|
|
2998
|
+
}`;function Nu(s,e,t){let n=new Qr;const i=new Z,r=new Z,o=new qe,a=new yo({depthPacking:uu}),l=new _o,c={},h=t.maxTextureSize,u={0:Pt,1:hi,2:ui},d=new zt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Z},radius:{value:4}},vertexShader:e0,fragmentShader:t0}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const g=new ye;g.setAttribute("position",new Oe(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const p=new ht(g,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ka,this.render=function(_,b,A){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||_.length===0)return;const R=s.getRenderTarget(),P=s.getActiveCubeFace(),H=s.getActiveMipmapLevel(),I=s.state;I.setBlending(pn),I.buffers.color.setClear(1,1,1,1),I.buffers.depth.setTest(!0),I.setScissorTest(!1);for(let v=0,C=_.length;v<C;v++){const j=_[v],F=j.shadow;if(F===void 0){console.warn("THREE.WebGLShadowMap:",j,"has no shadow.");continue}if(F.autoUpdate===!1&&F.needsUpdate===!1)continue;i.copy(F.mapSize);const U=F.getFrameExtents();if(i.multiply(U),r.copy(F.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(r.x=Math.floor(h/U.x),i.x=r.x*U.x,F.mapSize.x=r.x),i.y>h&&(r.y=Math.floor(h/U.y),i.y=r.y*U.y,F.mapSize.y=r.y)),F.map===null&&!F.isPointLightShadow&&this.type===Ji&&(F.map=new St(i.x,i.y),F.map.texture.name=j.name+".shadowMap",F.mapPass=new St(i.x,i.y),F.camera.updateProjectionMatrix()),F.map===null){const k={minFilter:ct,magFilter:ct,format:Lt};F.map=new St(i.x,i.y,k),F.map.texture.name=j.name+".shadowMap",F.camera.updateProjectionMatrix()}s.setRenderTarget(F.map),s.clear();const N=F.getViewportCount();for(let k=0;k<N;k++){const D=F.getViewport(k);o.set(r.x*D.x,r.y*D.y,r.x*D.z,r.y*D.w),I.viewport(o),F.updateMatrices(j,k),n=F.getFrustum(),M(b,A,F.camera,j,this.type)}!F.isPointLightShadow&&this.type===Ji&&x(F,A),F.needsUpdate=!1}m.needsUpdate=!1,s.setRenderTarget(R,P,H)};function x(_,b){const A=e.update(p);d.defines.VSM_SAMPLES!==_.blurSamples&&(d.defines.VSM_SAMPLES=_.blurSamples,f.defines.VSM_SAMPLES=_.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),d.uniforms.shadow_pass.value=_.map.texture,d.uniforms.resolution.value=_.mapSize,d.uniforms.radius.value=_.radius,s.setRenderTarget(_.mapPass),s.clear(),s.renderBufferDirect(b,null,A,d,p,null),f.uniforms.shadow_pass.value=_.mapPass.texture,f.uniforms.resolution.value=_.mapSize,f.uniforms.radius.value=_.radius,s.setRenderTarget(_.map),s.clear(),s.renderBufferDirect(b,null,A,f,p,null)}function y(_,b,A,R,P,H){let I=null;const v=A.isPointLight===!0?_.customDistanceMaterial:_.customDepthMaterial;if(v!==void 0?I=v:I=A.isPointLight===!0?l:a,s.localClippingEnabled&&b.clipShadows===!0&&b.clippingPlanes.length!==0||b.displacementMap&&b.displacementScale!==0||b.alphaMap&&b.alphaTest>0){const C=I.uuid,j=b.uuid;let F=c[C];F===void 0&&(F={},c[C]=F);let U=F[j];U===void 0&&(U=I.clone(),F[j]=U),I=U}return I.visible=b.visible,I.wireframe=b.wireframe,H===Ji?I.side=b.shadowSide!==null?b.shadowSide:b.side:I.side=b.shadowSide!==null?b.shadowSide:u[b.side],I.alphaMap=b.alphaMap,I.alphaTest=b.alphaTest,I.clipShadows=b.clipShadows,I.clippingPlanes=b.clippingPlanes,I.clipIntersection=b.clipIntersection,I.displacementMap=b.displacementMap,I.displacementScale=b.displacementScale,I.displacementBias=b.displacementBias,I.wireframeLinewidth=b.wireframeLinewidth,I.linewidth=b.linewidth,A.isPointLight===!0&&I.isMeshDistanceMaterial===!0&&(I.referencePosition.setFromMatrixPosition(A.matrixWorld),I.nearDistance=R,I.farDistance=P),I}function M(_,b,A,R,P){if(_.visible===!1)return;if(_.layers.test(b.layers)&&(_.isMesh||_.isLine||_.isPoints)&&(_.castShadow||_.receiveShadow&&P===Ji)&&(!_.frustumCulled||n.intersectsObject(_))){_.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,_.matrixWorld);const v=e.update(_),C=_.material;if(Array.isArray(C)){const j=v.groups;for(let F=0,U=j.length;F<U;F++){const N=j[F],k=C[N.materialIndex];if(k&&k.visible){const D=y(_,k,R,A.near,A.far,P);s.renderBufferDirect(A,null,v,D,_,N)}}}else if(C.visible){const j=y(_,C,R,A.near,A.far,P);s.renderBufferDirect(A,null,v,j,_,null)}}const I=_.children;for(let v=0,C=I.length;v<C;v++)M(I[v],b,A,R,P)}}function n0(s,e,t){const n=t.isWebGL2;function i(){let L=!1;const oe=new qe;let re=null;const Me=new qe(0,0,0,0);return{setMask:function(ue){re!==ue&&!L&&(s.colorMask(ue,ue,ue,ue),re=ue)},setLocked:function(ue){L=ue},setClear:function(ue,be,ie,Ee,Ze){Ze===!0&&(ue*=Ee,be*=Ee,ie*=Ee),oe.set(ue,be,ie,Ee),Me.equals(oe)===!1&&(s.clearColor(ue,be,ie,Ee),Me.copy(oe))},reset:function(){L=!1,re=null,Me.set(-1,0,0,0)}}}function r(){let L=!1,oe=null,re=null,Me=null;return{setTest:function(ue){ue?Se(2929):q(2929)},setMask:function(ue){oe!==ue&&!L&&(s.depthMask(ue),oe=ue)},setFunc:function(ue){if(re!==ue){if(ue)switch(ue){case Ph:s.depthFunc(512);break;case Ih:s.depthFunc(519);break;case Dh:s.depthFunc(513);break;case no:s.depthFunc(515);break;case Fh:s.depthFunc(514);break;case Bh:s.depthFunc(518);break;case Nh:s.depthFunc(516);break;case zh:s.depthFunc(517);break;default:s.depthFunc(515)}else s.depthFunc(515);re=ue}},setLocked:function(ue){L=ue},setClear:function(ue){Me!==ue&&(s.clearDepth(ue),Me=ue)},reset:function(){L=!1,oe=null,re=null,Me=null}}}function o(){let L=!1,oe=null,re=null,Me=null,ue=null,be=null,ie=null,Ee=null,Ze=null;return{setTest:function(Ue){L||(Ue?Se(2960):q(2960))},setMask:function(Ue){oe!==Ue&&!L&&(s.stencilMask(Ue),oe=Ue)},setFunc:function(Ue,Jt,Yt){(re!==Ue||Me!==Jt||ue!==Yt)&&(s.stencilFunc(Ue,Jt,Yt),re=Ue,Me=Jt,ue=Yt)},setOp:function(Ue,Jt,Yt){(be!==Ue||ie!==Jt||Ee!==Yt)&&(s.stencilOp(Ue,Jt,Yt),be=Ue,ie=Jt,Ee=Yt)},setLocked:function(Ue){L=Ue},setClear:function(Ue){Ze!==Ue&&(s.clearStencil(Ue),Ze=Ue)},reset:function(){L=!1,oe=null,re=null,Me=null,ue=null,be=null,ie=null,Ee=null,Ze=null}}}const a=new i,l=new r,c=new o;let h={},u={},d=new WeakMap,f=[],g=null,p=!1,m=null,x=null,y=null,M=null,_=null,b=null,A=null,R=!1,P=null,H=null,I=null,v=null,C=null;const j=s.getParameter(35661);let F=!1,U=0;const N=s.getParameter(7938);N.indexOf("WebGL")!==-1?(U=parseFloat(/^WebGL (\d)/.exec(N)[1]),F=U>=1):N.indexOf("OpenGL ES")!==-1&&(U=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),F=U>=2);let k=null,D={};const X=s.getParameter(3088),$=s.getParameter(2978),te=new qe().fromArray(X),K=new qe().fromArray($);function ge(L,oe,re){const Me=new Uint8Array(4),ue=s.createTexture();s.bindTexture(L,ue),s.texParameteri(L,10241,9728),s.texParameteri(L,10240,9728);for(let be=0;be<re;be++)s.texImage2D(oe+be,0,6408,1,1,0,6408,5121,Me);return ue}const ze={};ze[3553]=ge(3553,3553,1),ze[34067]=ge(34067,34069,6),a.setClear(0,0,0,1),l.setClear(1),c.setClear(0),Se(2929),l.setFunc(no),ee(!1),pe(xa),Se(2884),W(pn);function Se(L){h[L]!==!0&&(s.enable(L),h[L]=!0)}function q(L){h[L]!==!1&&(s.disable(L),h[L]=!1)}function Ve(L,oe){return u[L]!==oe?(s.bindFramebuffer(L,oe),u[L]=oe,n&&(L===36009&&(u[36160]=oe),L===36160&&(u[36009]=oe)),!0):!1}function Ce(L,oe){let re=f,Me=!1;if(L)if(re=d.get(oe),re===void 0&&(re=[],d.set(oe,re)),L.isWebGLMultipleRenderTargets){const ue=L.texture;if(re.length!==ue.length||re[0]!==36064){for(let be=0,ie=ue.length;be<ie;be++)re[be]=36064+be;re.length=ue.length,Me=!0}}else re[0]!==36064&&(re[0]=36064,Me=!0);else re[0]!==1029&&(re[0]=1029,Me=!0);Me&&(t.isWebGL2?s.drawBuffers(re):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(re))}function Re(L){return g!==L?(s.useProgram(L),g=L,!0):!1}const ne={[Kn]:32774,[vh]:32778,[Mh]:32779};if(n)ne[Ma]=32775,ne[ba]=32776;else{const L=e.get("EXT_blend_minmax");L!==null&&(ne[Ma]=L.MIN_EXT,ne[ba]=L.MAX_EXT)}const Be={[bh]:0,[wh]:1,[Sh]:768,[el]:770,[Lh]:776,[Ch]:774,[Th]:772,[Eh]:769,[tl]:771,[Rh]:775,[Ah]:773};function W(L,oe,re,Me,ue,be,ie,Ee){if(L===pn){p===!0&&(q(3042),p=!1);return}if(p===!1&&(Se(3042),p=!0),L!==_h){if(L!==m||Ee!==R){if((x!==Kn||_!==Kn)&&(s.blendEquation(32774),x=Kn,_=Kn),Ee)switch(L){case ri:s.blendFuncSeparate(1,771,1,771);break;case ya:s.blendFunc(1,1);break;case _a:s.blendFuncSeparate(0,769,0,1);break;case va:s.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",L);break}else switch(L){case ri:s.blendFuncSeparate(770,771,1,771);break;case ya:s.blendFunc(770,1);break;case _a:s.blendFuncSeparate(0,769,0,1);break;case va:s.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",L);break}y=null,M=null,b=null,A=null,m=L,R=Ee}return}ue=ue||oe,be=be||re,ie=ie||Me,(oe!==x||ue!==_)&&(s.blendEquationSeparate(ne[oe],ne[ue]),x=oe,_=ue),(re!==y||Me!==M||be!==b||ie!==A)&&(s.blendFuncSeparate(Be[re],Be[Me],Be[be],Be[ie]),y=re,M=Me,b=be,A=ie),m=L,R=null}function Y(L,oe){L.side===ui?q(2884):Se(2884);let re=L.side===Pt;oe&&(re=!re),ee(re),L.blending===ri&&L.transparent===!1?W(pn):W(L.blending,L.blendEquation,L.blendSrc,L.blendDst,L.blendEquationAlpha,L.blendSrcAlpha,L.blendDstAlpha,L.premultipliedAlpha),l.setFunc(L.depthFunc),l.setTest(L.depthTest),l.setMask(L.depthWrite),a.setMask(L.colorWrite);const Me=L.stencilWrite;c.setTest(Me),Me&&(c.setMask(L.stencilWriteMask),c.setFunc(L.stencilFunc,L.stencilRef,L.stencilFuncMask),c.setOp(L.stencilFail,L.stencilZFail,L.stencilZPass)),Te(L.polygonOffset,L.polygonOffsetFactor,L.polygonOffsetUnits),L.alphaToCoverage===!0?Se(32926):q(32926)}function ee(L){P!==L&&(L?s.frontFace(2304):s.frontFace(2305),P=L)}function pe(L){L!==gh?(Se(2884),L!==H&&(L===xa?s.cullFace(1029):L===xh?s.cullFace(1028):s.cullFace(1032))):q(2884),H=L}function ce(L){L!==I&&(F&&s.lineWidth(L),I=L)}function Te(L,oe,re){L?(Se(32823),(v!==oe||C!==re)&&(s.polygonOffset(oe,re),v=oe,C=re)):q(32823)}function ve(L){L?Se(3089):q(3089)}function xe(L){L===void 0&&(L=33984+j-1),k!==L&&(s.activeTexture(L),k=L)}function Ke(L,oe){k===null&&xe();let re=D[k];re===void 0&&(re={type:void 0,texture:void 0},D[k]=re),(re.type!==L||re.texture!==oe)&&(s.bindTexture(L,oe||ze[L]),re.type=L,re.texture=oe)}function Ye(){const L=D[k];L!==void 0&&L.type!==void 0&&(s.bindTexture(L.type,null),L.type=void 0,L.texture=void 0)}function T(){try{s.compressedTexImage2D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function w(){try{s.texSubImage2D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function G(){try{s.texSubImage3D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function Q(){try{s.compressedTexSubImage2D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function le(){try{s.texStorage2D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function he(){try{s.texStorage3D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function _e(){try{s.texImage2D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function V(){try{s.texImage3D.apply(s,arguments)}catch(L){console.error("THREE.WebGLState:",L)}}function Le(L){te.equals(L)===!1&&(s.scissor(L.x,L.y,L.z,L.w),te.copy(L))}function Ie(L){K.equals(L)===!1&&(s.viewport(L.x,L.y,L.z,L.w),K.copy(L))}function me(){s.disable(3042),s.disable(2884),s.disable(2929),s.disable(32823),s.disable(3089),s.disable(2960),s.disable(32926),s.blendEquation(32774),s.blendFunc(1,0),s.blendFuncSeparate(1,0,1,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(513),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(519,0,4294967295),s.stencilOp(7680,7680,7680),s.clearStencil(0),s.cullFace(1029),s.frontFace(2305),s.polygonOffset(0,0),s.activeTexture(33984),s.bindFramebuffer(36160,null),n===!0&&(s.bindFramebuffer(36009,null),s.bindFramebuffer(36008,null)),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),h={},k=null,D={},u={},d=new WeakMap,f=[],g=null,p=!1,m=null,x=null,y=null,M=null,_=null,b=null,A=null,R=!1,P=null,H=null,I=null,v=null,C=null,te.set(0,0,s.canvas.width,s.canvas.height),K.set(0,0,s.canvas.width,s.canvas.height),a.reset(),l.reset(),c.reset()}return{buffers:{color:a,depth:l,stencil:c},enable:Se,disable:q,bindFramebuffer:Ve,drawBuffers:Ce,useProgram:Re,setBlending:W,setMaterial:Y,setFlipSided:ee,setCullFace:pe,setLineWidth:ce,setPolygonOffset:Te,setScissorTest:ve,activeTexture:xe,bindTexture:Ke,unbindTexture:Ye,compressedTexImage2D:T,texImage2D:_e,texImage3D:V,texStorage2D:le,texStorage3D:he,texSubImage2D:w,texSubImage3D:G,compressedTexSubImage2D:Q,scissor:Le,viewport:Ie,reset:me}}function i0(s,e,t,n,i,r,o){const a=i.isWebGL2,l=i.maxTextures,c=i.maxCubemapSize,h=i.maxTextureSize,u=i.maxSamples,d=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,f=/OculusBrowser/g.test(navigator.userAgent),g=new WeakMap;let p;const m=new WeakMap;let x=!1;try{x=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(T,w){return x?new OffscreenCanvas(T,w):kr("canvas")}function M(T,w,G,Q){let le=1;if((T.width>Q||T.height>Q)&&(le=Q/Math.max(T.width,T.height)),le<1||w===!0)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap){const he=w?oo:Math.floor,_e=he(le*T.width),V=he(le*T.height);p===void 0&&(p=y(_e,V));const Le=G?y(_e,V):p;return Le.width=_e,Le.height=V,Le.getContext("2d").drawImage(T,0,0,_e,V),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+T.width+"x"+T.height+") to ("+_e+"x"+V+")."),Le}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+T.width+"x"+T.height+")."),T;return T}function _(T){return qa(T.width)&&qa(T.height)}function b(T){return a?!1:T.wrapS!==wt||T.wrapT!==wt||T.minFilter!==ct&&T.minFilter!==it}function A(T,w){return T.generateMipmaps&&w&&T.minFilter!==ct&&T.minFilter!==it}function R(T){s.generateMipmap(T)}function P(T,w,G,Q,le=!1){if(a===!1)return w;if(T!==null){if(s[T]!==void 0)return s[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let he=w;return w===6403&&(G===5126&&(he=33326),G===5131&&(he=33325),G===5121&&(he=33321)),w===33319&&(G===5126&&(he=33328),G===5131&&(he=33327),G===5121&&(he=33323)),w===6408&&(G===5126&&(he=34836),G===5131&&(he=34842),G===5121&&(he=Q===$e&&le===!1?35907:32856),G===32819&&(he=32854),G===32820&&(he=32855)),(he===33325||he===33326||he===33327||he===33328||he===34842||he===34836)&&e.get("EXT_color_buffer_float"),he}function H(T,w,G){return A(T,G)===!0||T.isFramebufferTexture&&T.minFilter!==ct&&T.minFilter!==it?Math.log2(Math.max(w.width,w.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?w.mipmaps.length:1}function I(T){return T===ct||T===io||T===ro?9728:9729}function v(T){const w=T.target;w.removeEventListener("dispose",v),j(w),w.isVideoTexture&&g.delete(w)}function C(T){const w=T.target;w.removeEventListener("dispose",C),U(w)}function j(T){const w=n.get(T);if(w.__webglInit===void 0)return;const G=T.source,Q=m.get(G);if(Q){const le=Q[w.__cacheKey];le.usedTimes--,le.usedTimes===0&&F(T),Object.keys(Q).length===0&&m.delete(G)}n.remove(T)}function F(T){const w=n.get(T);s.deleteTexture(w.__webglTexture);const G=T.source,Q=m.get(G);delete Q[w.__cacheKey],o.memory.textures--}function U(T){const w=T.texture,G=n.get(T),Q=n.get(w);if(Q.__webglTexture!==void 0&&(s.deleteTexture(Q.__webglTexture),o.memory.textures--),T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let le=0;le<6;le++)s.deleteFramebuffer(G.__webglFramebuffer[le]),G.__webglDepthbuffer&&s.deleteRenderbuffer(G.__webglDepthbuffer[le]);else s.deleteFramebuffer(G.__webglFramebuffer),G.__webglDepthbuffer&&s.deleteRenderbuffer(G.__webglDepthbuffer),G.__webglMultisampledFramebuffer&&s.deleteFramebuffer(G.__webglMultisampledFramebuffer),G.__webglColorRenderbuffer&&s.deleteRenderbuffer(G.__webglColorRenderbuffer),G.__webglDepthRenderbuffer&&s.deleteRenderbuffer(G.__webglDepthRenderbuffer);if(T.isWebGLMultipleRenderTargets)for(let le=0,he=w.length;le<he;le++){const _e=n.get(w[le]);_e.__webglTexture&&(s.deleteTexture(_e.__webglTexture),o.memory.textures--),n.remove(w[le])}n.remove(w),n.remove(T)}let N=0;function k(){N=0}function D(){const T=N;return T>=l&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+l),N+=1,T}function X(T){const w=[];return w.push(T.wrapS),w.push(T.wrapT),w.push(T.magFilter),w.push(T.minFilter),w.push(T.anisotropy),w.push(T.internalFormat),w.push(T.format),w.push(T.type),w.push(T.generateMipmaps),w.push(T.premultiplyAlpha),w.push(T.flipY),w.push(T.unpackAlignment),w.push(T.encoding),w.join()}function $(T,w){const G=n.get(T);if(T.isVideoTexture&&Ke(T),T.isRenderTargetTexture===!1&&T.version>0&&G.__version!==T.version){const Q=T.image;if(Q===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ce(G,T,w);return}}t.activeTexture(33984+w),t.bindTexture(3553,G.__webglTexture)}function te(T,w){const G=n.get(T);if(T.version>0&&G.__version!==T.version){Ce(G,T,w);return}t.activeTexture(33984+w),t.bindTexture(35866,G.__webglTexture)}function K(T,w){const G=n.get(T);if(T.version>0&&G.__version!==T.version){Ce(G,T,w);return}t.activeTexture(33984+w),t.bindTexture(32879,G.__webglTexture)}function ge(T,w){const G=n.get(T);if(T.version>0&&G.__version!==T.version){Re(G,T,w);return}t.activeTexture(33984+w),t.bindTexture(34067,G.__webglTexture)}const ze={[Nr]:10497,[wt]:33071,[zr]:33648},Se={[ct]:9728,[io]:9984,[ro]:9986,[it]:9729,[nl]:9985,[vi]:9987};function q(T,w,G){if(G?(s.texParameteri(T,10242,ze[w.wrapS]),s.texParameteri(T,10243,ze[w.wrapT]),(T===32879||T===35866)&&s.texParameteri(T,32882,ze[w.wrapR]),s.texParameteri(T,10240,Se[w.magFilter]),s.texParameteri(T,10241,Se[w.minFilter])):(s.texParameteri(T,10242,33071),s.texParameteri(T,10243,33071),(T===32879||T===35866)&&s.texParameteri(T,32882,33071),(w.wrapS!==wt||w.wrapT!==wt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),s.texParameteri(T,10240,I(w.magFilter)),s.texParameteri(T,10241,I(w.minFilter)),w.minFilter!==ct&&w.minFilter!==it&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Q=e.get("EXT_texture_filter_anisotropic");if(w.type===fn&&e.has("OES_texture_float_linear")===!1||a===!1&&w.type===si&&e.has("OES_texture_half_float_linear")===!1)return;(w.anisotropy>1||n.get(w).__currentAnisotropy)&&(s.texParameterf(T,Q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,i.getMaxAnisotropy())),n.get(w).__currentAnisotropy=w.anisotropy)}}function Ve(T,w){let G=!1;T.__webglInit===void 0&&(T.__webglInit=!0,w.addEventListener("dispose",v));const Q=w.source;let le=m.get(Q);le===void 0&&(le={},m.set(Q,le));const he=X(w);if(he!==T.__cacheKey){le[he]===void 0&&(le[he]={texture:s.createTexture(),usedTimes:0},o.memory.textures++,G=!0),le[he].usedTimes++;const _e=le[T.__cacheKey];_e!==void 0&&(le[T.__cacheKey].usedTimes--,_e.usedTimes===0&&F(w)),T.__cacheKey=he,T.__webglTexture=le[he].texture}return G}function Ce(T,w,G){let Q=3553;w.isDataArrayTexture&&(Q=35866),w.isData3DTexture&&(Q=32879);const le=Ve(T,w),he=w.source;if(t.activeTexture(33984+G),t.bindTexture(Q,T.__webglTexture),he.version!==he.__currentVersion||le===!0){s.pixelStorei(37440,w.flipY),s.pixelStorei(37441,w.premultiplyAlpha),s.pixelStorei(3317,w.unpackAlignment),s.pixelStorei(37443,0);const _e=b(w)&&_(w.image)===!1;let V=M(w.image,_e,!1,h);V=Ye(w,V);const Le=_(V)||a,Ie=r.convert(w.format,w.encoding);let me=r.convert(w.type),L=P(w.internalFormat,Ie,me,w.encoding,w.isVideoTexture);q(Q,w,Le);let oe;const re=w.mipmaps,Me=a&&w.isVideoTexture!==!0,ue=T.__version===void 0,be=H(w,V,Le);if(w.isDepthTexture)L=6402,a?w.type===fn?L=36012:w.type===Lr?L=33190:w.type===oi?L=35056:L=33189:w.type===fn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),w.format===Rn&&L===6402&&w.type!==ji&&w.type!==Lr&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),w.type=ji,me=r.convert(w.type)),w.format===di&&L===6402&&(L=34041,w.type!==oi&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),w.type=oi,me=r.convert(w.type))),Me&&ue?t.texStorage2D(3553,1,L,V.width,V.height):t.texImage2D(3553,0,L,V.width,V.height,0,Ie,me,null);else if(w.isDataTexture)if(re.length>0&&Le){Me&&ue&&t.texStorage2D(3553,be,L,re[0].width,re[0].height);for(let ie=0,Ee=re.length;ie<Ee;ie++)oe=re[ie],Me?t.texSubImage2D(3553,ie,0,0,oe.width,oe.height,Ie,me,oe.data):t.texImage2D(3553,ie,L,oe.width,oe.height,0,Ie,me,oe.data);w.generateMipmaps=!1}else Me?(ue&&t.texStorage2D(3553,be,L,V.width,V.height),t.texSubImage2D(3553,0,0,0,V.width,V.height,Ie,me,V.data)):t.texImage2D(3553,0,L,V.width,V.height,0,Ie,me,V.data);else if(w.isCompressedTexture){Me&&ue&&t.texStorage2D(3553,be,L,re[0].width,re[0].height);for(let ie=0,Ee=re.length;ie<Ee;ie++)oe=re[ie],w.format!==Lt?Ie!==null?Me?t.compressedTexSubImage2D(3553,ie,0,0,oe.width,oe.height,Ie,oe.data):t.compressedTexImage2D(3553,ie,L,oe.width,oe.height,0,oe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Me?t.texSubImage2D(3553,ie,0,0,oe.width,oe.height,Ie,me,oe.data):t.texImage2D(3553,ie,L,oe.width,oe.height,0,Ie,me,oe.data)}else if(w.isDataArrayTexture)Me?(ue&&t.texStorage3D(35866,be,L,V.width,V.height,V.depth),t.texSubImage3D(35866,0,0,0,0,V.width,V.height,V.depth,Ie,me,V.data)):t.texImage3D(35866,0,L,V.width,V.height,V.depth,0,Ie,me,V.data);else if(w.isData3DTexture)Me?(ue&&t.texStorage3D(32879,be,L,V.width,V.height,V.depth),t.texSubImage3D(32879,0,0,0,0,V.width,V.height,V.depth,Ie,me,V.data)):t.texImage3D(32879,0,L,V.width,V.height,V.depth,0,Ie,me,V.data);else if(w.isFramebufferTexture)Me&&ue?t.texStorage2D(3553,be,L,V.width,V.height):t.texImage2D(3553,0,L,V.width,V.height,0,Ie,me,null);else if(re.length>0&&Le){Me&&ue&&t.texStorage2D(3553,be,L,re[0].width,re[0].height);for(let ie=0,Ee=re.length;ie<Ee;ie++)oe=re[ie],Me?t.texSubImage2D(3553,ie,0,0,Ie,me,oe):t.texImage2D(3553,ie,L,Ie,me,oe);w.generateMipmaps=!1}else Me?(ue&&t.texStorage2D(3553,be,L,V.width,V.height),t.texSubImage2D(3553,0,0,0,Ie,me,V)):t.texImage2D(3553,0,L,Ie,me,V);A(w,Le)&&R(Q),he.__currentVersion=he.version,w.onUpdate&&w.onUpdate(w)}T.__version=w.version}function Re(T,w,G){if(w.image.length!==6)return;const Q=Ve(T,w),le=w.source;if(t.activeTexture(33984+G),t.bindTexture(34067,T.__webglTexture),le.version!==le.__currentVersion||Q===!0){s.pixelStorei(37440,w.flipY),s.pixelStorei(37441,w.premultiplyAlpha),s.pixelStorei(3317,w.unpackAlignment),s.pixelStorei(37443,0);const he=w.isCompressedTexture||w.image[0].isCompressedTexture,_e=w.image[0]&&w.image[0].isDataTexture,V=[];for(let ie=0;ie<6;ie++)!he&&!_e?V[ie]=M(w.image[ie],!1,!0,c):V[ie]=_e?w.image[ie].image:w.image[ie],V[ie]=Ye(w,V[ie]);const Le=V[0],Ie=_(Le)||a,me=r.convert(w.format,w.encoding),L=r.convert(w.type),oe=P(w.internalFormat,me,L,w.encoding),re=a&&w.isVideoTexture!==!0,Me=T.__version===void 0;let ue=H(w,Le,Ie);q(34067,w,Ie);let be;if(he){re&&Me&&t.texStorage2D(34067,ue,oe,Le.width,Le.height);for(let ie=0;ie<6;ie++){be=V[ie].mipmaps;for(let Ee=0;Ee<be.length;Ee++){const Ze=be[Ee];w.format!==Lt?me!==null?re?t.compressedTexSubImage2D(34069+ie,Ee,0,0,Ze.width,Ze.height,me,Ze.data):t.compressedTexImage2D(34069+ie,Ee,oe,Ze.width,Ze.height,0,Ze.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):re?t.texSubImage2D(34069+ie,Ee,0,0,Ze.width,Ze.height,me,L,Ze.data):t.texImage2D(34069+ie,Ee,oe,Ze.width,Ze.height,0,me,L,Ze.data)}}}else{be=w.mipmaps,re&&Me&&(be.length>0&&ue++,t.texStorage2D(34067,ue,oe,V[0].width,V[0].height));for(let ie=0;ie<6;ie++)if(_e){re?t.texSubImage2D(34069+ie,0,0,0,V[ie].width,V[ie].height,me,L,V[ie].data):t.texImage2D(34069+ie,0,oe,V[ie].width,V[ie].height,0,me,L,V[ie].data);for(let Ee=0;Ee<be.length;Ee++){const Ue=be[Ee].image[ie].image;re?t.texSubImage2D(34069+ie,Ee+1,0,0,Ue.width,Ue.height,me,L,Ue.data):t.texImage2D(34069+ie,Ee+1,oe,Ue.width,Ue.height,0,me,L,Ue.data)}}else{re?t.texSubImage2D(34069+ie,0,0,0,me,L,V[ie]):t.texImage2D(34069+ie,0,oe,me,L,V[ie]);for(let Ee=0;Ee<be.length;Ee++){const Ze=be[Ee];re?t.texSubImage2D(34069+ie,Ee+1,0,0,me,L,Ze.image[ie]):t.texImage2D(34069+ie,Ee+1,oe,me,L,Ze.image[ie])}}}A(w,Ie)&&R(34067),le.__currentVersion=le.version,w.onUpdate&&w.onUpdate(w)}T.__version=w.version}function ne(T,w,G,Q,le){const he=r.convert(G.format,G.encoding),_e=r.convert(G.type),V=P(G.internalFormat,he,_e,G.encoding);n.get(w).__hasExternalTextures||(le===32879||le===35866?t.texImage3D(le,0,V,w.width,w.height,w.depth,0,he,_e,null):t.texImage2D(le,0,V,w.width,w.height,0,he,_e,null)),t.bindFramebuffer(36160,T),xe(w)?d.framebufferTexture2DMultisampleEXT(36160,Q,le,n.get(G).__webglTexture,0,ve(w)):s.framebufferTexture2D(36160,Q,le,n.get(G).__webglTexture,0),t.bindFramebuffer(36160,null)}function Be(T,w,G){if(s.bindRenderbuffer(36161,T),w.depthBuffer&&!w.stencilBuffer){let Q=33189;if(G||xe(w)){const le=w.depthTexture;le&&le.isDepthTexture&&(le.type===fn?Q=36012:le.type===Lr&&(Q=33190));const he=ve(w);xe(w)?d.renderbufferStorageMultisampleEXT(36161,he,Q,w.width,w.height):s.renderbufferStorageMultisample(36161,he,Q,w.width,w.height)}else s.renderbufferStorage(36161,Q,w.width,w.height);s.framebufferRenderbuffer(36160,36096,36161,T)}else if(w.depthBuffer&&w.stencilBuffer){const Q=ve(w);G&&xe(w)===!1?s.renderbufferStorageMultisample(36161,Q,35056,w.width,w.height):xe(w)?d.renderbufferStorageMultisampleEXT(36161,Q,35056,w.width,w.height):s.renderbufferStorage(36161,34041,w.width,w.height),s.framebufferRenderbuffer(36160,33306,36161,T)}else{const Q=w.isWebGLMultipleRenderTargets===!0?w.texture[0]:w.texture,le=r.convert(Q.format,Q.encoding),he=r.convert(Q.type),_e=P(Q.internalFormat,le,he,Q.encoding),V=ve(w);G&&xe(w)===!1?s.renderbufferStorageMultisample(36161,V,_e,w.width,w.height):xe(w)?d.renderbufferStorageMultisampleEXT(36161,V,_e,w.width,w.height):s.renderbufferStorage(36161,_e,w.width,w.height)}s.bindRenderbuffer(36161,null)}function W(T,w){if(w&&w.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,T),!(w.depthTexture&&w.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(w.depthTexture).__webglTexture||w.depthTexture.image.width!==w.width||w.depthTexture.image.height!==w.height)&&(w.depthTexture.image.width=w.width,w.depthTexture.image.height=w.height,w.depthTexture.needsUpdate=!0),$(w.depthTexture,0);const Q=n.get(w.depthTexture).__webglTexture,le=ve(w);if(w.depthTexture.format===Rn)xe(w)?d.framebufferTexture2DMultisampleEXT(36160,36096,3553,Q,0,le):s.framebufferTexture2D(36160,36096,3553,Q,0);else if(w.depthTexture.format===di)xe(w)?d.framebufferTexture2DMultisampleEXT(36160,33306,3553,Q,0,le):s.framebufferTexture2D(36160,33306,3553,Q,0);else throw new Error("Unknown depthTexture format")}function Y(T){const w=n.get(T),G=T.isWebGLCubeRenderTarget===!0;if(T.depthTexture&&!w.__autoAllocateDepthBuffer){if(G)throw new Error("target.depthTexture not supported in Cube render targets");W(w.__webglFramebuffer,T)}else if(G){w.__webglDepthbuffer=[];for(let Q=0;Q<6;Q++)t.bindFramebuffer(36160,w.__webglFramebuffer[Q]),w.__webglDepthbuffer[Q]=s.createRenderbuffer(),Be(w.__webglDepthbuffer[Q],T,!1)}else t.bindFramebuffer(36160,w.__webglFramebuffer),w.__webglDepthbuffer=s.createRenderbuffer(),Be(w.__webglDepthbuffer,T,!1);t.bindFramebuffer(36160,null)}function ee(T,w,G){const Q=n.get(T);w!==void 0&&ne(Q.__webglFramebuffer,T,T.texture,36064,3553),G!==void 0&&Y(T)}function pe(T){const w=T.texture,G=n.get(T),Q=n.get(w);T.addEventListener("dispose",C),T.isWebGLMultipleRenderTargets!==!0&&(Q.__webglTexture===void 0&&(Q.__webglTexture=s.createTexture()),Q.__version=w.version,o.memory.textures++);const le=T.isWebGLCubeRenderTarget===!0,he=T.isWebGLMultipleRenderTargets===!0,_e=_(T)||a;if(le){G.__webglFramebuffer=[];for(let V=0;V<6;V++)G.__webglFramebuffer[V]=s.createFramebuffer()}else if(G.__webglFramebuffer=s.createFramebuffer(),he)if(i.drawBuffers){const V=T.texture;for(let Le=0,Ie=V.length;Le<Ie;Le++){const me=n.get(V[Le]);me.__webglTexture===void 0&&(me.__webglTexture=s.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(a&&T.samples>0&&xe(T)===!1){G.__webglMultisampledFramebuffer=s.createFramebuffer(),G.__webglColorRenderbuffer=s.createRenderbuffer(),s.bindRenderbuffer(36161,G.__webglColorRenderbuffer);const V=r.convert(w.format,w.encoding),Le=r.convert(w.type),Ie=P(w.internalFormat,V,Le,w.encoding),me=ve(T);s.renderbufferStorageMultisample(36161,me,Ie,T.width,T.height),t.bindFramebuffer(36160,G.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(36160,36064,36161,G.__webglColorRenderbuffer),s.bindRenderbuffer(36161,null),T.depthBuffer&&(G.__webglDepthRenderbuffer=s.createRenderbuffer(),Be(G.__webglDepthRenderbuffer,T,!0)),t.bindFramebuffer(36160,null)}if(le){t.bindTexture(34067,Q.__webglTexture),q(34067,w,_e);for(let V=0;V<6;V++)ne(G.__webglFramebuffer[V],T,w,36064,34069+V);A(w,_e)&&R(34067),t.unbindTexture()}else if(he){const V=T.texture;for(let Le=0,Ie=V.length;Le<Ie;Le++){const me=V[Le],L=n.get(me);t.bindTexture(3553,L.__webglTexture),q(3553,me,_e),ne(G.__webglFramebuffer,T,me,36064+Le,3553),A(me,_e)&&R(3553)}t.unbindTexture()}else{let V=3553;(T.isWebGL3DRenderTarget||T.isWebGLArrayRenderTarget)&&(a?V=T.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(V,Q.__webglTexture),q(V,w,_e),ne(G.__webglFramebuffer,T,w,36064,V),A(w,_e)&&R(V),t.unbindTexture()}T.depthBuffer&&Y(T)}function ce(T){const w=_(T)||a,G=T.isWebGLMultipleRenderTargets===!0?T.texture:[T.texture];for(let Q=0,le=G.length;Q<le;Q++){const he=G[Q];if(A(he,w)){const _e=T.isWebGLCubeRenderTarget?34067:3553,V=n.get(he).__webglTexture;t.bindTexture(_e,V),R(_e),t.unbindTexture()}}}function Te(T){if(a&&T.samples>0&&xe(T)===!1){const w=T.width,G=T.height;let Q=16384;const le=[36064],he=T.stencilBuffer?33306:36096;T.depthBuffer&&le.push(he);const _e=n.get(T),V=_e.__ignoreDepthValues!==void 0?_e.__ignoreDepthValues:!1;V===!1&&(T.depthBuffer&&(Q|=256),T.stencilBuffer&&(Q|=1024)),t.bindFramebuffer(36008,_e.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,_e.__webglFramebuffer),V===!0&&(s.invalidateFramebuffer(36008,[he]),s.invalidateFramebuffer(36009,[he])),s.blitFramebuffer(0,0,w,G,0,0,w,G,Q,9728),f&&s.invalidateFramebuffer(36008,le),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,_e.__webglMultisampledFramebuffer)}}function ve(T){return Math.min(u,T.samples)}function xe(T){const w=n.get(T);return a&&T.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function Ke(T){const w=o.render.frame;g.get(T)!==w&&(g.set(T,w),T.update())}function Ye(T,w){const G=T.encoding,Q=T.format,le=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||T.format===so||G!==nn&&(G===$e?a===!1?e.has("EXT_sRGB")===!0&&Q===Lt?(T.format=so,T.minFilter=it,T.generateMipmaps=!1):w=Un.sRGBToLinear(w):(Q!==Lt||le!==Dn)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",G)),w}this.allocateTextureUnit=D,this.resetTextureUnits=k,this.setTexture2D=$,this.setTexture2DArray=te,this.setTexture3D=K,this.setTextureCube=ge,this.rebindTextures=ee,this.setupRenderTarget=pe,this.updateRenderTargetMipmap=ce,this.updateMultisampleRenderTarget=Te,this.setupDepthRenderbuffer=Y,this.setupFrameBufferTexture=ne,this.useMultisampledRTT=xe}function zu(s,e,t){const n=t.isWebGL2;function i(r,o=null){let a;if(r===Dn)return 5121;if(r===Yh)return 32819;if(r===Zh)return 32820;if(r===qh)return 5120;if(r===Xh)return 5122;if(r===ji)return 5123;if(r===Jh)return 5124;if(r===Lr)return 5125;if(r===fn)return 5126;if(r===si)return n?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===$h)return 6406;if(r===Lt)return 6408;if(r===Kh)return 6409;if(r===Qh)return 6410;if(r===Rn)return 6402;if(r===di)return 34041;if(r===eu)return 6403;if(r===jh)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(r===so)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===tu)return 36244;if(r===nu)return 33319;if(r===iu)return 33320;if(r===ru)return 36249;if(r===Zs||r===$s||r===js||r===Ks)if(o===$e)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Zs)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===$s)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===js)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Ks)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Zs)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===$s)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===js)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Ks)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===wa||r===Sa||r===Ea||r===Ta)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===wa)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===Sa)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===Ea)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===Ta)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===su)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===Aa||r===Ca)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===Aa)return o===$e?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===Ca)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===Ra||r===La||r===Pa||r===Ia||r===Da||r===Fa||r===Ba||r===Na||r===za||r===Ua||r===Oa||r===Ha||r===Ga||r===ka)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===Ra)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===La)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===Pa)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===Ia)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===Da)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===Fa)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===Ba)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===Na)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===za)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===Ua)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===Oa)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===Ha)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===Ga)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===ka)return o===$e?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Va)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Va)return o===$e?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(r===oi)return n?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:i}}class ol extends mt{constructor(e=[]){super(),this.cameras=e}}ol.prototype.isArrayCamera=!0;class ii extends Ne{constructor(){super(),this.type="Group"}}ii.prototype.isGroup=!0;const r0={type:"move"};class aa{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ii,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ii,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new S,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new S),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ii,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new S,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new S),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(a!==null&&(i=t.getPose(e.targetRaySpace,n),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(r0))),c&&e.hand){o=!0;for(const p of e.hand.values()){const m=t.getJointPose(p,n);if(c.joints[p.jointName]===void 0){const y=new ii;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[p.jointName]=y,c.add(y)}const x=c.joints[p.jointName];m!==null&&(x.matrix.fromArray(m.transform.matrix),x.matrix.decompose(x.position,x.rotation,x.scale),x.jointRadius=m.radius),x.visible=m!==null}const h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),f=.02,g=.005;c.inputState.pinching&&d>f+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}}class al extends ut{constructor(e,t,n,i,r,o,a,l,c,h){if(h=h!==void 0?h:Rn,h!==Rn&&h!==di)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Rn&&(n=ji),n===void 0&&h===di&&(n=oi),super(null,i,r,o,a,l,h,n,c),this.image={width:e,height:t},this.magFilter=a!==void 0?a:ct,this.minFilter=l!==void 0?l:ct,this.flipY=!1,this.generateMipmaps=!1}}al.prototype.isDepthTexture=!0;class s0 extends zn{constructor(e,t){super();const n=this;let i=null,r=1,o=null,a="local-floor",l=null,c=null,h=null,u=null,d=null;const f=t.getContextAttributes();let g=null,p=null;const m=[],x=new Map,y=new mt;y.layers.enable(1),y.viewport=new qe;const M=new mt;M.layers.enable(2),M.viewport=new qe;const _=[y,M],b=new ol;b.layers.enable(1),b.layers.enable(2);let A=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(D){let X=m[D];return X===void 0&&(X=new aa,m[D]=X),X.getTargetRaySpace()},this.getControllerGrip=function(D){let X=m[D];return X===void 0&&(X=new aa,m[D]=X),X.getGripSpace()},this.getHand=function(D){let X=m[D];return X===void 0&&(X=new aa,m[D]=X),X.getHandSpace()};function P(D){const X=x.get(D.inputSource);X&&X.dispatchEvent({type:D.type,data:D.inputSource})}function H(){x.forEach(function(D,X){D.disconnect(X)}),x.clear(),A=null,R=null,e.setRenderTarget(g),u=null,h=null,c=null,i=null,p=null,k.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(D){r=D,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(D){a=D,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return h!==null?h:u},this.getBinding=function(){return c},this.getFrame=function(){return d},this.getSession=function(){return i},this.setSession=async function(D){if(i=D,i!==null){if(g=e.getRenderTarget(),i.addEventListener("select",P),i.addEventListener("selectstart",P),i.addEventListener("selectend",P),i.addEventListener("squeeze",P),i.addEventListener("squeezestart",P),i.addEventListener("squeezeend",P),i.addEventListener("end",H),i.addEventListener("inputsourceschange",I),f.xrCompatible!==!0&&await t.makeXRCompatible(),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const X={antialias:i.renderState.layers===void 0?f.antialias:!0,alpha:f.alpha,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:r};u=new XRWebGLLayer(i,t,X),i.updateRenderState({baseLayer:u}),p=new St(u.framebufferWidth,u.framebufferHeight,{format:Lt,type:Dn,encoding:e.outputEncoding})}else{let X=null,$=null,te=null;f.depth&&(te=f.stencil?35056:33190,X=f.stencil?di:Rn,$=f.stencil?oi:ji);const K={colorFormat:e.outputEncoding===$e?35907:32856,depthFormat:te,scaleFactor:r};c=new XRWebGLBinding(i,t),h=c.createProjectionLayer(K),i.updateRenderState({layers:[h]}),p=new St(h.textureWidth,h.textureHeight,{format:Lt,type:Dn,depthTexture:new al(h.textureWidth,h.textureHeight,$,void 0,void 0,void 0,void 0,void 0,void 0,X),stencilBuffer:f.stencil,encoding:e.outputEncoding,samples:f.antialias?4:0});const ge=e.properties.get(p);ge.__ignoreDepthValues=h.ignoreDepthValues}p.isXRRenderTarget=!0,this.setFoveation(1),o=await i.requestReferenceSpace(a),k.setContext(i),k.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};function I(D){const X=i.inputSources;for(let $=0;$<m.length;$++)x.set(X[$],m[$]);for(let $=0;$<D.removed.length;$++){const te=D.removed[$],K=x.get(te);K&&(K.dispatchEvent({type:"disconnected",data:te}),x.delete(te))}for(let $=0;$<D.added.length;$++){const te=D.added[$],K=x.get(te);K&&K.dispatchEvent({type:"connected",data:te})}}const v=new S,C=new S;function j(D,X,$){v.setFromMatrixPosition(X.matrixWorld),C.setFromMatrixPosition($.matrixWorld);const te=v.distanceTo(C),K=X.projectionMatrix.elements,ge=$.projectionMatrix.elements,ze=K[14]/(K[10]-1),Se=K[14]/(K[10]+1),q=(K[9]+1)/K[5],Ve=(K[9]-1)/K[5],Ce=(K[8]-1)/K[0],Re=(ge[8]+1)/ge[0],ne=ze*Ce,Be=ze*Re,W=te/(-Ce+Re),Y=W*-Ce;X.matrixWorld.decompose(D.position,D.quaternion,D.scale),D.translateX(Y),D.translateZ(W),D.matrixWorld.compose(D.position,D.quaternion,D.scale),D.matrixWorldInverse.copy(D.matrixWorld).invert();const ee=ze+W,pe=Se+W,ce=ne-Y,Te=Be+(te-Y),ve=q*Se/pe*ee,xe=Ve*Se/pe*ee;D.projectionMatrix.makePerspective(ce,Te,ve,xe,ee,pe)}function F(D,X){X===null?D.matrixWorld.copy(D.matrix):D.matrixWorld.multiplyMatrices(X.matrixWorld,D.matrix),D.matrixWorldInverse.copy(D.matrixWorld).invert()}this.updateCamera=function(D){if(i===null)return;b.near=M.near=y.near=D.near,b.far=M.far=y.far=D.far,(A!==b.near||R!==b.far)&&(i.updateRenderState({depthNear:b.near,depthFar:b.far}),A=b.near,R=b.far);const X=D.parent,$=b.cameras;F(b,X);for(let K=0;K<$.length;K++)F($[K],X);b.matrixWorld.decompose(b.position,b.quaternion,b.scale),D.position.copy(b.position),D.quaternion.copy(b.quaternion),D.scale.copy(b.scale),D.matrix.copy(b.matrix),D.matrixWorld.copy(b.matrixWorld);const te=D.children;for(let K=0,ge=te.length;K<ge;K++)te[K].updateMatrixWorld(!0);$.length===2?j(b,y,M):b.projectionMatrix.copy(y.projectionMatrix)},this.getCamera=function(){return b},this.getFoveation=function(){if(h!==null)return h.fixedFoveation;if(u!==null)return u.fixedFoveation},this.setFoveation=function(D){h!==null&&(h.fixedFoveation=D),u!==null&&u.fixedFoveation!==void 0&&(u.fixedFoveation=D)};let U=null;function N(D,X){if(l=X.getViewerPose(o),d=X,l!==null){const te=l.views;u!==null&&(e.setRenderTargetFramebuffer(p,u.framebuffer),e.setRenderTarget(p));let K=!1;te.length!==b.cameras.length&&(b.cameras.length=0,K=!0);for(let ge=0;ge<te.length;ge++){const ze=te[ge];let Se=null;if(u!==null)Se=u.getViewport(ze);else{const Ve=c.getViewSubImage(h,ze);Se=Ve.viewport,ge===0&&(e.setRenderTargetTextures(p,Ve.colorTexture,h.ignoreDepthValues?void 0:Ve.depthStencilTexture),e.setRenderTarget(p))}const q=_[ge];q.matrix.fromArray(ze.transform.matrix),q.projectionMatrix.fromArray(ze.projectionMatrix),q.viewport.set(Se.x,Se.y,Se.width,Se.height),ge===0&&b.matrix.copy(q.matrix),K===!0&&b.cameras.push(q)}}const $=i.inputSources;for(let te=0;te<m.length;te++){const K=m[te],ge=$[te];K.update(ge,X,o)}U&&U(D,X),d=null}const k=new Cu;k.setAnimationLoop(N),this.setAnimationLoop=function(D){U=D},this.dispose=function(){}}}function o0(s,e){function t(p,m){p.fogColor.value.copy(m.color),m.isFog?(p.fogNear.value=m.near,p.fogFar.value=m.far):m.isFogExp2&&(p.fogDensity.value=m.density)}function n(p,m,x,y,M){m.isMeshBasicMaterial||m.isMeshLambertMaterial?i(p,m):m.isMeshToonMaterial?(i(p,m),h(p,m)):m.isMeshPhongMaterial?(i(p,m),c(p,m)):m.isMeshStandardMaterial?(i(p,m),u(p,m),m.isMeshPhysicalMaterial&&d(p,m,M)):m.isMeshMatcapMaterial?(i(p,m),f(p,m)):m.isMeshDepthMaterial?i(p,m):m.isMeshDistanceMaterial?(i(p,m),g(p,m)):m.isMeshNormalMaterial?i(p,m):m.isLineBasicMaterial?(r(p,m),m.isLineDashedMaterial&&o(p,m)):m.isPointsMaterial?a(p,m,x,y):m.isSpriteMaterial?l(p,m):m.isShadowMaterial?(p.color.value.copy(m.color),p.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function i(p,m){p.opacity.value=m.opacity,m.color&&p.diffuse.value.copy(m.color),m.emissive&&p.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.bumpMap&&(p.bumpMap.value=m.bumpMap,p.bumpScale.value=m.bumpScale,m.side===Pt&&(p.bumpScale.value*=-1)),m.displacementMap&&(p.displacementMap.value=m.displacementMap,p.displacementScale.value=m.displacementScale,p.displacementBias.value=m.displacementBias),m.emissiveMap&&(p.emissiveMap.value=m.emissiveMap),m.normalMap&&(p.normalMap.value=m.normalMap,p.normalScale.value.copy(m.normalScale),m.side===Pt&&p.normalScale.value.negate()),m.specularMap&&(p.specularMap.value=m.specularMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);const x=e.get(m).envMap;if(x&&(p.envMap.value=x,p.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=m.reflectivity,p.ior.value=m.ior,p.refractionRatio.value=m.refractionRatio),m.lightMap){p.lightMap.value=m.lightMap;const _=s.physicallyCorrectLights!==!0?Math.PI:1;p.lightMapIntensity.value=m.lightMapIntensity*_}m.aoMap&&(p.aoMap.value=m.aoMap,p.aoMapIntensity.value=m.aoMapIntensity);let y;m.map?y=m.map:m.specularMap?y=m.specularMap:m.displacementMap?y=m.displacementMap:m.normalMap?y=m.normalMap:m.bumpMap?y=m.bumpMap:m.roughnessMap?y=m.roughnessMap:m.metalnessMap?y=m.metalnessMap:m.alphaMap?y=m.alphaMap:m.emissiveMap?y=m.emissiveMap:m.clearcoatMap?y=m.clearcoatMap:m.clearcoatNormalMap?y=m.clearcoatNormalMap:m.clearcoatRoughnessMap?y=m.clearcoatRoughnessMap:m.specularIntensityMap?y=m.specularIntensityMap:m.specularColorMap?y=m.specularColorMap:m.transmissionMap?y=m.transmissionMap:m.thicknessMap?y=m.thicknessMap:m.sheenColorMap?y=m.sheenColorMap:m.sheenRoughnessMap&&(y=m.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),p.uvTransform.value.copy(y.matrix));let M;m.aoMap?M=m.aoMap:m.lightMap&&(M=m.lightMap),M!==void 0&&(M.isWebGLRenderTarget&&(M=M.texture),M.matrixAutoUpdate===!0&&M.updateMatrix(),p.uv2Transform.value.copy(M.matrix))}function r(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity}function o(p,m){p.dashSize.value=m.dashSize,p.totalSize.value=m.dashSize+m.gapSize,p.scale.value=m.scale}function a(p,m,x,y){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.size.value=m.size*x,p.scale.value=y*.5,m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let M;m.map?M=m.map:m.alphaMap&&(M=m.alphaMap),M!==void 0&&(M.matrixAutoUpdate===!0&&M.updateMatrix(),p.uvTransform.value.copy(M.matrix))}function l(p,m){p.diffuse.value.copy(m.color),p.opacity.value=m.opacity,p.rotation.value=m.rotation,m.map&&(p.map.value=m.map),m.alphaMap&&(p.alphaMap.value=m.alphaMap),m.alphaTest>0&&(p.alphaTest.value=m.alphaTest);let x;m.map?x=m.map:m.alphaMap&&(x=m.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),p.uvTransform.value.copy(x.matrix))}function c(p,m){p.specular.value.copy(m.specular),p.shininess.value=Math.max(m.shininess,1e-4)}function h(p,m){m.gradientMap&&(p.gradientMap.value=m.gradientMap)}function u(p,m){p.roughness.value=m.roughness,p.metalness.value=m.metalness,m.roughnessMap&&(p.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(p.metalnessMap.value=m.metalnessMap),e.get(m).envMap&&(p.envMapIntensity.value=m.envMapIntensity)}function d(p,m,x){p.ior.value=m.ior,m.sheen>0&&(p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(p.sheenColorMap.value=m.sheenColorMap),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap)),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),p.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===Pt&&p.clearcoatNormalScale.value.negate())),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=x.texture,p.transmissionSamplerSize.value.set(x.width,x.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap),p.attenuationDistance.value=m.attenuationDistance,p.attenuationColor.value.copy(m.attenuationColor)),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap)}function f(p,m){m.matcap&&(p.matcap.value=m.matcap)}function g(p,m){p.referencePosition.value.copy(m.referencePosition),p.nearDistance.value=m.nearDistance,p.farDistance.value=m.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:n}}function a0(){const s=kr("canvas");return s.style.display="block",s}function Je(s={}){const e=s.canvas!==void 0?s.canvas:a0(),t=s.context!==void 0?s.context:null,n=s.depth!==void 0?s.depth:!0,i=s.stencil!==void 0?s.stencil:!0,r=s.antialias!==void 0?s.antialias:!1,o=s.premultipliedAlpha!==void 0?s.premultipliedAlpha:!0,a=s.preserveDrawingBuffer!==void 0?s.preserveDrawingBuffer:!1,l=s.powerPreference!==void 0?s.powerPreference:"default",c=s.failIfMajorPerformanceCaveat!==void 0?s.failIfMajorPerformanceCaveat:!1;let h;s.context!==void 0?h=t.getContextAttributes().alpha:h=s.alpha!==void 0?s.alpha:!1;let u=null,d=null;const f=[],g=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=nn,this.physicallyCorrectLights=!1,this.toneMapping=Qt,this.toneMappingExposure=1;const p=this;let m=!1,x=0,y=0,M=null,_=-1,b=null;const A=new qe,R=new qe;let P=null,H=e.width,I=e.height,v=1,C=null,j=null;const F=new qe(0,0,H,I),U=new qe(0,0,H,I);let N=!1;const k=new Qr;let D=!1,X=!1,$=null;const te=new fe,K=new Z,ge=new S,ze={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Se(){return M===null?v:1}let q=t;function Ve(E,B){for(let O=0;O<E.length;O++){const z=E[O],J=e.getContext(z,B);if(J!==null)return J}return null}try{const E={alpha:!0,depth:n,stencil:i,antialias:r,premultipliedAlpha:o,preserveDrawingBuffer:a,powerPreference:l,failIfMajorPerformanceCaveat:c};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${lo}`),e.addEventListener("webglcontextlost",L,!1),e.addEventListener("webglcontextrestored",oe,!1),q===null){const B=["webgl2","webgl","experimental-webgl"];if(p.isWebGL1Renderer===!0&&B.shift(),q=Ve(B,E),q===null)throw Ve(B)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}q.getShaderPrecisionFormat===void 0&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let Ce,Re,ne,Be,W,Y,ee,pe,ce,Te,ve,xe,Ke,Ye,T,w,G,Q,le,he,_e,V,Le;function Ie(){Ce=new Tg(q),Re=new vg(q,Ce,s),Ce.init(Re),V=new zu(q,Ce,Re),ne=new n0(q,Ce,Re),Be=new Rg,W=new qx,Y=new i0(q,Ce,ne,W,Re,V,Be),ee=new bg(p),pe=new Eg(p),ce=new Vf(q,Re),Le=new yg(q,Ce,ce,Re),Te=new Ag(q,ce,Be,Le),ve=new Dg(q,Te,ce,Be),le=new Ig(q,Re,Y),w=new Mg(W),xe=new Wx(p,ee,pe,Ce,Re,Le,w),Ke=new o0(p,W),Ye=new Jx,T=new Qx(Ce,Re),Q=new xg(p,ee,ne,ve,h,o),G=new Nu(p,ve,Re),he=new _g(q,Ce,Be,Re),_e=new Cg(q,Ce,Be,Re),Be.programs=xe.programs,p.capabilities=Re,p.extensions=Ce,p.properties=W,p.renderLists=Ye,p.shadowMap=G,p.state=ne,p.info=Be}Ie();const me=new s0(p,q);this.xr=me,this.getContext=function(){return q},this.getContextAttributes=function(){return q.getContextAttributes()},this.forceContextLoss=function(){const E=Ce.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){const E=Ce.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return v},this.setPixelRatio=function(E){E!==void 0&&(v=E,this.setSize(H,I,!1))},this.getSize=function(E){return E.set(H,I)},this.setSize=function(E,B,O){if(me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}H=E,I=B,e.width=Math.floor(E*v),e.height=Math.floor(B*v),O!==!1&&(e.style.width=E+"px",e.style.height=B+"px"),this.setViewport(0,0,E,B)},this.getDrawingBufferSize=function(E){return E.set(H*v,I*v).floor()},this.setDrawingBufferSize=function(E,B,O){H=E,I=B,v=O,e.width=Math.floor(E*O),e.height=Math.floor(B*O),this.setViewport(0,0,E,B)},this.getCurrentViewport=function(E){return E.copy(A)},this.getViewport=function(E){return E.copy(F)},this.setViewport=function(E,B,O,z){E.isVector4?F.set(E.x,E.y,E.z,E.w):F.set(E,B,O,z),ne.viewport(A.copy(F).multiplyScalar(v).floor())},this.getScissor=function(E){return E.copy(U)},this.setScissor=function(E,B,O,z){E.isVector4?U.set(E.x,E.y,E.z,E.w):U.set(E,B,O,z),ne.scissor(R.copy(U).multiplyScalar(v).floor())},this.getScissorTest=function(){return N},this.setScissorTest=function(E){ne.setScissorTest(N=E)},this.setOpaqueSort=function(E){C=E},this.setTransparentSort=function(E){j=E},this.getClearColor=function(E){return E.copy(Q.getClearColor())},this.setClearColor=function(){Q.setClearColor.apply(Q,arguments)},this.getClearAlpha=function(){return Q.getClearAlpha()},this.setClearAlpha=function(){Q.setClearAlpha.apply(Q,arguments)},this.clear=function(E=!0,B=!0,O=!0){let z=0;E&&(z|=16384),B&&(z|=256),O&&(z|=1024),q.clear(z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",L,!1),e.removeEventListener("webglcontextrestored",oe,!1),Ye.dispose(),T.dispose(),W.dispose(),ee.dispose(),pe.dispose(),ve.dispose(),Le.dispose(),xe.dispose(),me.dispose(),me.removeEventListener("sessionstart",Ee),me.removeEventListener("sessionend",Ze),$&&($.dispose(),$=null),Ue.stop()};function L(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),m=!0}function oe(){console.log("THREE.WebGLRenderer: Context Restored."),m=!1;const E=Be.autoReset,B=G.enabled,O=G.autoUpdate,z=G.needsUpdate,J=G.type;Ie(),Be.autoReset=E,G.enabled=B,G.autoUpdate=O,G.needsUpdate=z,G.type=J}function re(E){const B=E.target;B.removeEventListener("dispose",re),Me(B)}function Me(E){ue(E),W.remove(E)}function ue(E){const B=W.get(E).programs;B!==void 0&&(B.forEach(function(O){xe.releaseProgram(O)}),E.isShaderMaterial&&xe.releaseShaderCache(E))}this.renderBufferDirect=function(E,B,O,z,J,we){B===null&&(B=ze);const Ae=J.isMesh&&J.matrixWorld.determinant()<0,De=Cd(E,B,O,z,J);ne.setMaterial(z,Ae);let Pe=O.index;const Xe=O.attributes.position;if(Pe===null){if(Xe===void 0||Xe.count===0)return}else if(Pe.count===0)return;let He=1;z.wireframe===!0&&(Pe=Te.getWireframeAttribute(O),He=2),Le.setup(J,z,De,O,Pe);let ke,et=he;Pe!==null&&(ke=ce.get(Pe),et=_e,et.setIndex(ke));const kn=Pe!==null?Pe.count:Xe.count,Ti=O.drawRange.start*He,Ai=O.drawRange.count*He,Zt=we!==null?we.start*He:0,We=we!==null?we.count*He:1/0,Ci=Math.max(Ti,Zt),at=Math.min(kn,Ti+Ai,Zt+We)-1,$t=Math.max(0,at-Ci+1);if($t!==0){if(J.isMesh)z.wireframe===!0?(ne.setLineWidth(z.wireframeLinewidth*Se()),et.setMode(1)):et.setMode(4);else if(J.isLine){let _n=z.linewidth;_n===void 0&&(_n=1),ne.setLineWidth(_n*Se()),J.isLineSegments?et.setMode(1):J.isLineLoop?et.setMode(2):et.setMode(3)}else J.isPoints?et.setMode(0):J.isSprite&&et.setMode(4);if(J.isInstancedMesh)et.renderInstances(Ci,$t,J.count);else if(O.isInstancedBufferGeometry){const _n=Math.min(O.instanceCount,O._maxInstanceCount);et.renderInstances(Ci,$t,_n)}else et.render(Ci,$t)}},this.compile=function(E,B){d=T.get(E),d.init(),g.push(d),E.traverseVisible(function(O){O.isLight&&O.layers.test(B.layers)&&(d.pushLight(O),O.castShadow&&d.pushShadow(O))}),d.setupLights(p.physicallyCorrectLights),E.traverse(function(O){const z=O.material;if(z)if(Array.isArray(z))for(let J=0;J<z.length;J++){const we=z[J];Do(we,E,O)}else Do(z,E,O)}),g.pop(),d=null};let be=null;function ie(E){be&&be(E)}function Ee(){Ue.stop()}function Ze(){Ue.start()}const Ue=new Cu;Ue.setAnimationLoop(ie),typeof self<"u"&&Ue.setContext(self),this.setAnimationLoop=function(E){be=E,me.setAnimationLoop(E),E===null?Ue.stop():Ue.start()},me.addEventListener("sessionstart",Ee),me.addEventListener("sessionend",Ze),this.render=function(E,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(m===!0)return;E.autoUpdate===!0&&E.updateMatrixWorld(),B.parent===null&&B.updateMatrixWorld(),me.enabled===!0&&me.isPresenting===!0&&(me.cameraAutoUpdate===!0&&me.updateCamera(B),B=me.getCamera()),E.isScene===!0&&E.onBeforeRender(p,E,B,M),d=T.get(E,g.length),d.init(),g.push(d),te.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),k.setFromProjectionMatrix(te),X=this.localClippingEnabled,D=w.init(this.clippingPlanes,X,B),u=Ye.get(E,f.length),u.init(),f.push(u),Jt(E,B,0,p.sortObjects),u.finish(),p.sortObjects===!0&&u.sort(C,j),D===!0&&w.beginShadows();const O=d.state.shadowsArray;if(G.render(O,E,B),D===!0&&w.endShadows(),this.info.autoReset===!0&&this.info.reset(),Q.render(u,E),d.setupLights(p.physicallyCorrectLights),B.isArrayCamera){const z=B.cameras;for(let J=0,we=z.length;J<we;J++){const Ae=z[J];Yt(u,E,Ae,Ae.viewport)}}else Yt(u,E,B);M!==null&&(Y.updateMultisampleRenderTarget(M),Y.updateRenderTargetMipmap(M)),E.isScene===!0&&E.onAfterRender(p,E,B),Le.resetDefaultState(),_=-1,b=null,g.pop(),g.length>0?d=g[g.length-1]:d=null,f.pop(),f.length>0?u=f[f.length-1]:u=null};function Jt(E,B,O,z){if(E.visible===!1)return;if(E.layers.test(B.layers)){if(E.isGroup)O=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(B);else if(E.isLight)d.pushLight(E),E.castShadow&&d.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||k.intersectsSprite(E)){z&&ge.setFromMatrixPosition(E.matrixWorld).applyMatrix4(te);const Ae=ve.update(E),De=E.material;De.visible&&u.push(E,Ae,De,O,ge.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(E.isSkinnedMesh&&E.skeleton.frame!==Be.render.frame&&(E.skeleton.update(),E.skeleton.frame=Be.render.frame),!E.frustumCulled||k.intersectsObject(E))){z&&ge.setFromMatrixPosition(E.matrixWorld).applyMatrix4(te);const Ae=ve.update(E),De=E.material;if(Array.isArray(De)){const Pe=Ae.groups;for(let Xe=0,He=Pe.length;Xe<He;Xe++){const ke=Pe[Xe],et=De[ke.materialIndex];et&&et.visible&&u.push(E,Ae,et,O,ge.z,ke)}}else De.visible&&u.push(E,Ae,De,O,ge.z,null)}}const we=E.children;for(let Ae=0,De=we.length;Ae<De;Ae++)Jt(we[Ae],B,O,z)}function Yt(E,B,O,z){const J=E.opaque,we=E.transmissive,Ae=E.transparent;d.setupLightsView(O),we.length>0&&Td(J,B,O),z&&ne.viewport(A.copy(z)),J.length>0&&as(J,B,O),we.length>0&&as(we,B,O),Ae.length>0&&as(Ae,B,O),ne.buffers.depth.setTest(!0),ne.buffers.depth.setMask(!0),ne.buffers.color.setMask(!0),ne.setPolygonOffset(!1)}function Td(E,B,O){const z=Re.isWebGL2;$===null&&($=new St(1,1,{generateMipmaps:!0,type:V.convert(si)!==null?si:Dn,minFilter:vi,samples:z&&r===!0?4:0})),p.getDrawingBufferSize(K),z?$.setSize(K.x,K.y):$.setSize(oo(K.x),oo(K.y));const J=p.getRenderTarget();p.setRenderTarget($),p.clear();const we=p.toneMapping;p.toneMapping=Qt,as(E,B,O),p.toneMapping=we,Y.updateMultisampleRenderTarget($),Y.updateRenderTargetMipmap($),p.setRenderTarget(J)}function as(E,B,O){const z=B.isScene===!0?B.overrideMaterial:null;for(let J=0,we=E.length;J<we;J++){const Ae=E[J],De=Ae.object,Pe=Ae.geometry,Xe=z===null?Ae.material:z,He=Ae.group;De.layers.test(O.layers)&&Ad(De,B,O,Pe,Xe,He)}}function Ad(E,B,O,z,J,we){E.onBeforeRender(p,B,O,z,J,we),E.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),J.onBeforeRender(p,B,O,z,E,we),J.transparent===!0&&J.side===ui?(J.side=Pt,J.needsUpdate=!0,p.renderBufferDirect(O,B,z,J,E,we),J.side=hi,J.needsUpdate=!0,p.renderBufferDirect(O,B,z,J,E,we),J.side=ui):p.renderBufferDirect(O,B,z,J,E,we),E.onAfterRender(p,B,O,z,J,we)}function Do(E,B,O){B.isScene!==!0&&(B=ze);const z=W.get(E),J=d.state.lights,we=d.state.shadowsArray,Ae=J.state.version,De=xe.getParameters(E,J.state,we,B,O),Pe=xe.getProgramCacheKey(De);let Xe=z.programs;z.environment=E.isMeshStandardMaterial?B.environment:null,z.fog=B.fog,z.envMap=(E.isMeshStandardMaterial?pe:ee).get(E.envMap||z.environment),Xe===void 0&&(E.addEventListener("dispose",re),Xe=new Map,z.programs=Xe);let He=Xe.get(Pe);if(He!==void 0){if(z.currentProgram===He&&z.lightsStateVersion===Ae)return Wl(E,De),He}else De.uniforms=xe.getUniforms(E),E.onBuild(O,De,p),E.onBeforeCompile(De,p),He=xe.acquireProgram(De,Pe),Xe.set(Pe,He),z.uniforms=De.uniforms;const ke=z.uniforms;(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(ke.clippingPlanes=w.uniform),Wl(E,De),z.needsLights=Ld(E),z.lightsStateVersion=Ae,z.needsLights&&(ke.ambientLightColor.value=J.state.ambient,ke.lightProbe.value=J.state.probe,ke.directionalLights.value=J.state.directional,ke.directionalLightShadows.value=J.state.directionalShadow,ke.spotLights.value=J.state.spot,ke.spotLightShadows.value=J.state.spotShadow,ke.rectAreaLights.value=J.state.rectArea,ke.ltc_1.value=J.state.rectAreaLTC1,ke.ltc_2.value=J.state.rectAreaLTC2,ke.pointLights.value=J.state.point,ke.pointLightShadows.value=J.state.pointShadow,ke.hemisphereLights.value=J.state.hemi,ke.directionalShadowMap.value=J.state.directionalShadowMap,ke.directionalShadowMatrix.value=J.state.directionalShadowMatrix,ke.spotShadowMap.value=J.state.spotShadowMap,ke.spotShadowMatrix.value=J.state.spotShadowMatrix,ke.pointShadowMap.value=J.state.pointShadowMap,ke.pointShadowMatrix.value=J.state.pointShadowMatrix);const et=He.getUniforms(),kn=Ln.seqWithValue(et.seq,ke);return z.currentProgram=He,z.uniformsList=kn,He}function Wl(E,B){const O=W.get(E);O.outputEncoding=B.outputEncoding,O.instancing=B.instancing,O.skinning=B.skinning,O.morphTargets=B.morphTargets,O.morphNormals=B.morphNormals,O.morphColors=B.morphColors,O.morphTargetsCount=B.morphTargetsCount,O.numClippingPlanes=B.numClippingPlanes,O.numIntersection=B.numClipIntersection,O.vertexAlphas=B.vertexAlphas,O.vertexTangents=B.vertexTangents,O.toneMapping=B.toneMapping}function Cd(E,B,O,z,J){B.isScene!==!0&&(B=ze),Y.resetTextureUnits();const we=B.fog,Ae=z.isMeshStandardMaterial?B.environment:null,De=M===null?p.outputEncoding:M.isXRRenderTarget===!0?M.texture.encoding:nn,Pe=(z.isMeshStandardMaterial?pe:ee).get(z.envMap||Ae),Xe=z.vertexColors===!0&&!!O.attributes.color&&O.attributes.color.itemSize===4,He=!!z.normalMap&&!!O.attributes.tangent,ke=!!O.morphAttributes.position,et=!!O.morphAttributes.normal,kn=!!O.morphAttributes.color,Ti=z.toneMapped?p.toneMapping:Qt,Ai=O.morphAttributes.position||O.morphAttributes.normal||O.morphAttributes.color,Zt=Ai!==void 0?Ai.length:0,We=W.get(z),Ci=d.state.lights;if(D===!0&&(X===!0||E!==b)){const Ut=E===b&&z.id===_;w.setState(z,E,Ut)}let at=!1;z.version===We.__version?(We.needsLights&&We.lightsStateVersion!==Ci.state.version||We.outputEncoding!==De||J.isInstancedMesh&&We.instancing===!1||!J.isInstancedMesh&&We.instancing===!0||J.isSkinnedMesh&&We.skinning===!1||!J.isSkinnedMesh&&We.skinning===!0||We.envMap!==Pe||z.fog&&We.fog!==we||We.numClippingPlanes!==void 0&&(We.numClippingPlanes!==w.numPlanes||We.numIntersection!==w.numIntersection)||We.vertexAlphas!==Xe||We.vertexTangents!==He||We.morphTargets!==ke||We.morphNormals!==et||We.morphColors!==kn||We.toneMapping!==Ti||Re.isWebGL2===!0&&We.morphTargetsCount!==Zt)&&(at=!0):(at=!0,We.__version=z.version);let $t=We.currentProgram;at===!0&&($t=Do(z,B,J));let _n=!1,_r=!1,Fo=!1;const _t=$t.getUniforms(),vr=We.uniforms;if(ne.useProgram($t.program)&&(_n=!0,_r=!0,Fo=!0),z.id!==_&&(_=z.id,_r=!0),_n||b!==E){if(_t.setValue(q,"projectionMatrix",E.projectionMatrix),Re.logarithmicDepthBuffer&&_t.setValue(q,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),b!==E&&(b=E,_r=!0,Fo=!0),z.isShaderMaterial||z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshStandardMaterial||z.envMap){const Ut=_t.map.cameraPosition;Ut!==void 0&&Ut.setValue(q,ge.setFromMatrixPosition(E.matrixWorld))}(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial)&&_t.setValue(q,"isOrthographic",E.isOrthographicCamera===!0),(z.isMeshPhongMaterial||z.isMeshToonMaterial||z.isMeshLambertMaterial||z.isMeshBasicMaterial||z.isMeshStandardMaterial||z.isShaderMaterial||z.isShadowMaterial||J.isSkinnedMesh)&&_t.setValue(q,"viewMatrix",E.matrixWorldInverse)}if(J.isSkinnedMesh){_t.setOptional(q,J,"bindMatrix"),_t.setOptional(q,J,"bindMatrixInverse");const Ut=J.skeleton;Ut&&(Re.floatVertexTextures?(Ut.boneTexture===null&&Ut.computeBoneTexture(),_t.setValue(q,"boneTexture",Ut.boneTexture,Y),_t.setValue(q,"boneTextureSize",Ut.boneTextureSize)):_t.setOptional(q,Ut,"boneMatrices"))}const Bo=O.morphAttributes;return(Bo.position!==void 0||Bo.normal!==void 0||Bo.color!==void 0&&Re.isWebGL2===!0)&&le.update(J,O,z,$t),(_r||We.receiveShadow!==J.receiveShadow)&&(We.receiveShadow=J.receiveShadow,_t.setValue(q,"receiveShadow",J.receiveShadow)),_r&&(_t.setValue(q,"toneMappingExposure",p.toneMappingExposure),We.needsLights&&Rd(vr,Fo),we&&z.fog&&Ke.refreshFogUniforms(vr,we),Ke.refreshMaterialUniforms(vr,z,v,I,$),Ln.upload(q,We.uniformsList,vr,Y)),z.isShaderMaterial&&z.uniformsNeedUpdate===!0&&(Ln.upload(q,We.uniformsList,vr,Y),z.uniformsNeedUpdate=!1),z.isSpriteMaterial&&_t.setValue(q,"center",J.center),_t.setValue(q,"modelViewMatrix",J.modelViewMatrix),_t.setValue(q,"normalMatrix",J.normalMatrix),_t.setValue(q,"modelMatrix",J.matrixWorld),$t}function Rd(E,B){E.ambientLightColor.needsUpdate=B,E.lightProbe.needsUpdate=B,E.directionalLights.needsUpdate=B,E.directionalLightShadows.needsUpdate=B,E.pointLights.needsUpdate=B,E.pointLightShadows.needsUpdate=B,E.spotLights.needsUpdate=B,E.spotLightShadows.needsUpdate=B,E.rectAreaLights.needsUpdate=B,E.hemisphereLights.needsUpdate=B}function Ld(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return M},this.setRenderTargetTextures=function(E,B,O){W.get(E.texture).__webglTexture=B,W.get(E.depthTexture).__webglTexture=O;const z=W.get(E);z.__hasExternalTextures=!0,z.__hasExternalTextures&&(z.__autoAllocateDepthBuffer=O===void 0,z.__autoAllocateDepthBuffer||Ce.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),z.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(E,B){const O=W.get(E);O.__webglFramebuffer=B,O.__useDefaultFramebuffer=B===void 0},this.setRenderTarget=function(E,B=0,O=0){M=E,x=B,y=O;let z=!0;if(E){const Pe=W.get(E);Pe.__useDefaultFramebuffer!==void 0?(ne.bindFramebuffer(36160,null),z=!1):Pe.__webglFramebuffer===void 0?Y.setupRenderTarget(E):Pe.__hasExternalTextures&&Y.rebindTextures(E,W.get(E.texture).__webglTexture,W.get(E.depthTexture).__webglTexture)}let J=null,we=!1,Ae=!1;if(E){const Pe=E.texture;(Pe.isData3DTexture||Pe.isDataArrayTexture)&&(Ae=!0);const Xe=W.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(J=Xe[B],we=!0):Re.isWebGL2&&E.samples>0&&Y.useMultisampledRTT(E)===!1?J=W.get(E).__webglMultisampledFramebuffer:J=Xe,A.copy(E.viewport),R.copy(E.scissor),P=E.scissorTest}else A.copy(F).multiplyScalar(v).floor(),R.copy(U).multiplyScalar(v).floor(),P=N;if(ne.bindFramebuffer(36160,J)&&Re.drawBuffers&&z&&ne.drawBuffers(E,J),ne.viewport(A),ne.scissor(R),ne.setScissorTest(P),we){const Pe=W.get(E.texture);q.framebufferTexture2D(36160,36064,34069+B,Pe.__webglTexture,O)}else if(Ae){const Pe=W.get(E.texture),Xe=B||0;q.framebufferTextureLayer(36160,36064,Pe.__webglTexture,O||0,Xe)}_=-1},this.readRenderTargetPixels=function(E,B,O,z,J,we,Ae){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let De=W.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&Ae!==void 0&&(De=De[Ae]),De){ne.bindFramebuffer(36160,De);try{const Pe=E.texture,Xe=Pe.format,He=Pe.type;if(Xe!==Lt&&V.convert(Xe)!==q.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ke=He===si&&(Ce.has("EXT_color_buffer_half_float")||Re.isWebGL2&&Ce.has("EXT_color_buffer_float"));if(He!==Dn&&V.convert(He)!==q.getParameter(35738)&&!(He===fn&&(Re.isWebGL2||Ce.has("OES_texture_float")||Ce.has("WEBGL_color_buffer_float")))&&!ke){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=E.width-z&&O>=0&&O<=E.height-J&&q.readPixels(B,O,z,J,V.convert(Xe),V.convert(He),we)}finally{const Pe=M!==null?W.get(M).__webglFramebuffer:null;ne.bindFramebuffer(36160,Pe)}}},this.copyFramebufferToTexture=function(E,B,O=0){if(B.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}const z=Math.pow(2,-O),J=Math.floor(B.image.width*z),we=Math.floor(B.image.height*z);Y.setTexture2D(B,0),q.copyTexSubImage2D(3553,O,0,0,E.x,E.y,J,we),ne.unbindTexture()},this.copyTextureToTexture=function(E,B,O,z=0){const J=B.image.width,we=B.image.height,Ae=V.convert(O.format),De=V.convert(O.type);Y.setTexture2D(O,0),q.pixelStorei(37440,O.flipY),q.pixelStorei(37441,O.premultiplyAlpha),q.pixelStorei(3317,O.unpackAlignment),B.isDataTexture?q.texSubImage2D(3553,z,E.x,E.y,J,we,Ae,De,B.image.data):B.isCompressedTexture?q.compressedTexSubImage2D(3553,z,E.x,E.y,B.mipmaps[0].width,B.mipmaps[0].height,Ae,B.mipmaps[0].data):q.texSubImage2D(3553,z,E.x,E.y,Ae,De,B.image),z===0&&O.generateMipmaps&&q.generateMipmap(3553),ne.unbindTexture()},this.copyTextureToTexture3D=function(E,B,O,z,J=0){if(p.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const we=E.max.x-E.min.x+1,Ae=E.max.y-E.min.y+1,De=E.max.z-E.min.z+1,Pe=V.convert(z.format),Xe=V.convert(z.type);let He;if(z.isData3DTexture)Y.setTexture3D(z,0),He=32879;else if(z.isDataArrayTexture)Y.setTexture2DArray(z,0),He=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}q.pixelStorei(37440,z.flipY),q.pixelStorei(37441,z.premultiplyAlpha),q.pixelStorei(3317,z.unpackAlignment);const ke=q.getParameter(3314),et=q.getParameter(32878),kn=q.getParameter(3316),Ti=q.getParameter(3315),Ai=q.getParameter(32877),Zt=O.isCompressedTexture?O.mipmaps[0]:O.image;q.pixelStorei(3314,Zt.width),q.pixelStorei(32878,Zt.height),q.pixelStorei(3316,E.min.x),q.pixelStorei(3315,E.min.y),q.pixelStorei(32877,E.min.z),O.isDataTexture||O.isData3DTexture?q.texSubImage3D(He,J,B.x,B.y,B.z,we,Ae,De,Pe,Xe,Zt.data):O.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),q.compressedTexSubImage3D(He,J,B.x,B.y,B.z,we,Ae,De,Pe,Zt.data)):q.texSubImage3D(He,J,B.x,B.y,B.z,we,Ae,De,Pe,Xe,Zt),q.pixelStorei(3314,ke),q.pixelStorei(32878,et),q.pixelStorei(3316,kn),q.pixelStorei(3315,Ti),q.pixelStorei(32877,Ai),J===0&&z.generateMipmaps&&q.generateMipmap(He),ne.unbindTexture()},this.initTexture=function(E){Y.setTexture2D(E,0),ne.unbindTexture()},this.resetState=function(){x=0,y=0,M=null,ne.reset(),Le.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Je.prototype.isWebGLRenderer=!0;class Uu extends Je{}Uu.prototype.isWebGL1Renderer=!0;class ts{constructor(e,t=25e-5){this.name="",this.color=new ae(e),this.density=t}clone(){return new ts(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}ts.prototype.isFogExp2=!0;class ns{constructor(e,t=1,n=1e3){this.name="",this.color=new ae(e),this.near=t,this.far=n}clone(){return new ns(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}ns.prototype.isFog=!0;class vo extends Ne{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}vo.prototype.isScene=!0;class bi{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ki,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=It()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=It()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=It()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}bi.prototype.isInterleavedBuffer=!0;const bt=new S;class Fn{constructor(e,t,n,i=!1){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)bt.fromBufferAttribute(this,t),bt.applyMatrix4(e),this.setXYZ(t,bt.x,bt.y,bt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)bt.fromBufferAttribute(this,t),bt.applyNormalMatrix(e),this.setXYZ(t,bt.x,bt.y,bt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)bt.fromBufferAttribute(this,t),bt.transformDirection(e),this.setXYZ(t,bt.x,bt.y,bt.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return new Oe(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Fn(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Fn.prototype.isInterleavedBufferAttribute=!0;class Mo extends ot{constructor(e){super(),this.type="SpriteMaterial",this.color=new ae(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}Mo.prototype.isSpriteMaterial=!0;let Vi;const Sr=new S,Wi=new S,qi=new S,Xi=new Z,Er=new Z,Ou=new fe,Cs=new S,Tr=new S,Rs=new S,Ec=new Z,la=new Z,Tc=new Z;class bo extends Ne{constructor(e){if(super(),this.type="Sprite",Vi===void 0){Vi=new ye;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new bi(t,5);Vi.setIndex([0,1,2,0,2,3]),Vi.setAttribute("position",new Fn(n,3,0,!1)),Vi.setAttribute("uv",new Fn(n,2,3,!1))}this.geometry=Vi,this.material=e!==void 0?e:new Mo,this.center=new Z(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Wi.setFromMatrixScale(this.matrixWorld),Ou.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),qi.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Wi.multiplyScalar(-qi.z);const n=this.material.rotation;let i,r;n!==0&&(r=Math.cos(n),i=Math.sin(n));const o=this.center;Ls(Cs.set(-.5,-.5,0),qi,o,Wi,i,r),Ls(Tr.set(.5,-.5,0),qi,o,Wi,i,r),Ls(Rs.set(.5,.5,0),qi,o,Wi,i,r),Ec.set(0,0),la.set(1,0),Tc.set(1,1);let a=e.ray.intersectTriangle(Cs,Tr,Rs,!1,Sr);if(a===null&&(Ls(Tr.set(-.5,.5,0),qi,o,Wi,i,r),la.set(0,1),a=e.ray.intersectTriangle(Cs,Rs,Tr,!1,Sr),a===null))return;const l=e.ray.origin.distanceTo(Sr);l<e.near||l>e.far||t.push({distance:l,point:Sr.clone(),uv:st.getUV(Sr,Cs,Tr,Rs,Ec,la,Tc,new Z),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}bo.prototype.isSprite=!0;function Ls(s,e,t,n,i,r){Xi.subVectors(s,t).addScalar(.5).multiply(n),i!==void 0?(Er.x=r*Xi.x-i*Xi.y,Er.y=i*Xi.x+r*Xi.y):Er.copy(Xi),s.copy(e),s.x+=Er.x,s.y+=Er.y,s.applyMatrix4(Ou)}const Ps=new S,Ac=new S;class Hu extends Ne{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const r=t[n];this.addLevel(r.object.clone(),r.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const n=this.levels;let i;for(i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Ps.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Ps);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Ps.setFromMatrixPosition(e.matrixWorld),Ac.setFromMatrixPosition(this.matrixWorld);const n=Ps.distanceTo(Ac)/e.zoom;t[0].object.visible=!0;let i,r;for(i=1,r=t.length;i<r&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;i<r;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,r=n.length;i<r;i++){const o=n[i];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const Cc=new S,Rc=new qe,Lc=new qe,l0=new S,Pc=new fe;class wo extends ht{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new fe,this.bindMatrixInverse=new fe}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new qe,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,i=this.geometry;Rc.fromBufferAttribute(i.attributes.skinIndex,e),Lc.fromBufferAttribute(i.attributes.skinWeight,e),Cc.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const o=Lc.getComponent(r);if(o!==0){const a=Rc.getComponent(r);Pc.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),t.addScaledVector(l0.copy(Cc).applyMatrix4(Pc),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}wo.prototype.isSkinnedMesh=!0;class So extends Ne{constructor(){super(),this.type="Bone"}}So.prototype.isBone=!0;class ci extends ut{constructor(e=null,t=1,n=1,i,r,o,a,l,c=ct,h=ct,u,d){super(null,o,a,l,c,h,i,r,u,d),this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}ci.prototype.isDataTexture=!0;const Ic=new fe,c0=new fe;class Eo{constructor(e=[],t=[]){this.uuid=It(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new fe)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new fe;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,o=e.length;r<o;r++){const a=e[r]?e[r].matrixWorld:c0;Ic.multiplyMatrices(a,t[r]),Ic.toArray(n,r*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Eo(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=pu(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new ci(t,e,e,Lt,fn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const r=e.bones[n];let o=t[r];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),o=new So),this.bones.push(o),this.boneInverses.push(new fe().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,r=t.length;i<r;i++){const o=t[i];e.bones.push(o.uuid);const a=n[i];e.boneInverses.push(a.toArray())}return e}}class pi extends Oe{constructor(e,t,n,i=1){typeof n=="number"&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}pi.prototype.isInstancedBufferAttribute=!0;const Dc=new fe,Fc=new fe,Is=[],Ar=new ht;class ll extends ht{constructor(e,t,n){super(e,t),this.instanceMatrix=new pi(new Float32Array(n*16),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Ar.geometry=this.geometry,Ar.material=this.material,Ar.material!==void 0)for(let r=0;r<i;r++){this.getMatrixAt(r,Dc),Fc.multiplyMatrices(n,Dc),Ar.matrixWorld=Fc,Ar.raycast(e,Is);for(let o=0,a=Is.length;o<a;o++){const l=Is[o];l.instanceId=r,l.object=this,t.push(l)}Is.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new pi(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}ll.prototype.isInstancedMesh=!0;class gt extends ot{constructor(e){super(),this.type="LineBasicMaterial",this.color=new ae(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}gt.prototype.isLineBasicMaterial=!0;const Bc=new S,Nc=new S,zc=new fe,ca=new Hn,Ds=new On;class gn extends Ne{constructor(e=new ye,t=new gt){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,r=t.count;i<r;i++)Bc.fromBufferAttribute(t,i-1),Nc.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=Bc.distanceTo(Nc);e.setAttribute("lineDistance",new de(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ds.copy(n.boundingSphere),Ds.applyMatrix4(i),Ds.radius+=r,e.ray.intersectsSphere(Ds)===!1)return;zc.copy(i).invert(),ca.copy(e.ray).applyMatrix4(zc);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=new S,h=new S,u=new S,d=new S,f=this.isLineSegments?2:1;if(n.isBufferGeometry){const g=n.index,m=n.attributes.position;if(g!==null){const x=Math.max(0,o.start),y=Math.min(g.count,o.start+o.count);for(let M=x,_=y-1;M<_;M+=f){const b=g.getX(M),A=g.getX(M+1);if(c.fromBufferAttribute(m,b),h.fromBufferAttribute(m,A),ca.distanceSqToSegment(c,h,d,u)>l)continue;d.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(d);P<e.near||P>e.far||t.push({distance:P,point:u.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else{const x=Math.max(0,o.start),y=Math.min(m.count,o.start+o.count);for(let M=x,_=y-1;M<_;M+=f){if(c.fromBufferAttribute(m,M),h.fromBufferAttribute(m,M+1),ca.distanceSqToSegment(c,h,d,u)>l)continue;d.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(d);A<e.near||A>e.far||t.push({distance:A,point:u.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r<o;r++){const a=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}gn.prototype.isLine=!0;const Uc=new S,Oc=new S;class At extends gn{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,r=t.count;i<r;i+=2)Uc.fromBufferAttribute(t,i),Oc.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Uc.distanceTo(Oc);e.setAttribute("lineDistance",new de(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}At.prototype.isLineSegments=!0;class cl extends gn{constructor(e,t){super(e,t),this.type="LineLoop"}}cl.prototype.isLineLoop=!0;class wi extends ot{constructor(e){super(),this.type="PointsMaterial",this.color=new ae(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}wi.prototype.isPointsMaterial=!0;const Hc=new fe,Ya=new Hn,Fs=new On,Bs=new S;class is extends Ne{constructor(e=new ye,t=new wi){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Fs.copy(n.boundingSphere),Fs.applyMatrix4(i),Fs.radius+=r,e.ray.intersectsSphere(Fs)===!1)return;Hc.copy(i).invert(),Ya.copy(e.ray).applyMatrix4(Hc);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a;if(n.isBufferGeometry){const c=n.index,u=n.attributes.position;if(c!==null){const d=Math.max(0,o.start),f=Math.min(c.count,o.start+o.count);for(let g=d,p=f;g<p;g++){const m=c.getX(g);Bs.fromBufferAttribute(u,m),Gc(Bs,m,l,i,e,t,this)}}else{const d=Math.max(0,o.start),f=Math.min(u.count,o.start+o.count);for(let g=d,p=f;g<p;g++)Bs.fromBufferAttribute(u,g),Gc(Bs,g,l,i,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r<o;r++){const a=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=r}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}is.prototype.isPoints=!0;function Gc(s,e,t,n,i,r,o){const a=Ya.distanceSqToPoint(s);if(a<t){const l=new S;Ya.closestPointToPoint(s,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class Gu extends ut{constructor(e,t,n,i,r,o,a,l,c){super(e,t,n,i,r,o,a,l,c),this.minFilter=o!==void 0?o:it,this.magFilter=r!==void 0?r:it,this.generateMipmaps=!1;const h=this;function u(){h.needsUpdate=!0,e.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Gu.prototype.isVideoTexture=!0;class ku extends ut{constructor(e,t,n){super({width:e,height:t}),this.format=n,this.magFilter=ct,this.minFilter=ct,this.generateMipmaps=!1,this.needsUpdate=!0}}ku.prototype.isFramebufferTexture=!0;class hl extends ut{constructor(e,t,n,i,r,o,a,l,c,h,u,d){super(null,o,a,l,c,h,i,r,u,d),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}hl.prototype.isCompressedTexture=!0;class Vu extends ut{constructor(e,t,n,i,r,o,a,l,c){super(e,t,n,i,r,o,a,l,c),this.needsUpdate=!0}}Vu.prototype.isCanvasTexture=!0;class Dt{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const r=n.length;let o;t?o=t:o=e*n[r-1];let a=0,l=r-1,c;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),c=n[i]-o,c<0)a=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(r-1);const h=n[i],d=n[i+1]-h,f=(o-h)/d;return(i+f)/(r-1)}getTangent(e,t){let i=e-1e-4,r=e+1e-4;i<0&&(i=0),r>1&&(r=1);const o=this.getPoint(i),a=this.getPoint(r),l=t||(o.isVector2?new Z:new S);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new S,i=[],r=[],o=[],a=new S,l=new fe;for(let f=0;f<=e;f++){const g=f/e;i[f]=this.getTangentAt(g,new S)}r[0]=new S,o[0]=new S;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),o[0].crossVectors(i[0],r[0]);for(let f=1;f<=e;f++){if(r[f]=r[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(i[f-1],i[f]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(rt(i[f-1].dot(i[f]),-1,1));r[f].applyMatrix4(l.makeRotationAxis(a,g))}o[f].crossVectors(i[f],r[f])}if(t===!0){let f=Math.acos(rt(r[0].dot(r[e]),-1,1));f/=e,i[0].dot(a.crossVectors(r[0],r[e]))>0&&(f=-f);for(let g=1;g<=e;g++)r[g].applyMatrix4(l.makeRotationAxis(i[g],f*g)),o[g].crossVectors(i[g],r[g])}return{tangents:i,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class rs extends Dt{constructor(e=0,t=0,n=1,i=1,r=0,o=Math.PI*2,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const n=t||new Z,i=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(o?r=0:r=i),this.aClockwise===!0&&!o&&(r===i?r=-i:r=r-i);const a=this.aStartAngle+e*r;let l=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const h=Math.cos(this.aRotation),u=Math.sin(this.aRotation),d=l-this.aX,f=c-this.aY;l=d*h-f*u+this.aX,c=d*u+f*h+this.aY}return n.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}rs.prototype.isEllipseCurve=!0;class ul extends rs{constructor(e,t,n,i,r,o){super(e,t,n,n,i,r,o),this.type="ArcCurve"}}ul.prototype.isArcCurve=!0;function dl(){let s=0,e=0,t=0,n=0;function i(r,o,a,l){s=r,e=a,t=-3*r+3*o-2*a-l,n=2*r-2*o+a+l}return{initCatmullRom:function(r,o,a,l,c){i(o,a,c*(a-r),c*(l-o))},initNonuniformCatmullRom:function(r,o,a,l,c,h,u){let d=(o-r)/c-(a-r)/(c+h)+(a-o)/h,f=(a-o)/h-(l-o)/(h+u)+(l-a)/u;d*=h,f*=h,i(o,a,d,f)},calc:function(r){const o=r*r,a=o*r;return s+e*r+t*o+n*a}}}const Ns=new S,ha=new dl,ua=new dl,da=new dl;class fl extends Dt{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new S){const n=t,i=this.points,r=i.length,o=(r-(this.closed?0:1))*e;let a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/r)+1)*r:l===0&&a===r-1&&(a=r-2,l=1);let c,h;this.closed||a>0?c=i[(a-1)%r]:(Ns.subVectors(i[0],i[1]).add(i[0]),c=Ns);const u=i[a%r],d=i[(a+1)%r];if(this.closed||a+2<r?h=i[(a+2)%r]:(Ns.subVectors(i[r-1],i[r-2]).add(i[r-1]),h=Ns),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let g=Math.pow(c.distanceToSquared(u),f),p=Math.pow(u.distanceToSquared(d),f),m=Math.pow(d.distanceToSquared(h),f);p<1e-4&&(p=1),g<1e-4&&(g=p),m<1e-4&&(m=p),ha.initNonuniformCatmullRom(c.x,u.x,d.x,h.x,g,p,m),ua.initNonuniformCatmullRom(c.y,u.y,d.y,h.y,g,p,m),da.initNonuniformCatmullRom(c.z,u.z,d.z,h.z,g,p,m)}else this.curveType==="catmullrom"&&(ha.initCatmullRom(c.x,u.x,d.x,h.x,this.tension),ua.initCatmullRom(c.y,u.y,d.y,h.y,this.tension),da.initCatmullRom(c.z,u.z,d.z,h.z,this.tension));return n.set(ha.calc(l),ua.calc(l),da.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new S().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}fl.prototype.isCatmullRomCurve3=!0;function kc(s,e,t,n,i){const r=(n-e)*.5,o=(i-t)*.5,a=s*s,l=s*a;return(2*t-2*n+r+o)*l+(-3*t+3*n-2*r-o)*a+r*s+t}function h0(s,e){const t=1-s;return t*t*e}function u0(s,e){return 2*(1-s)*s*e}function d0(s,e){return s*s*e}function Ir(s,e,t,n){return h0(s,e)+u0(s,t)+d0(s,n)}function f0(s,e){const t=1-s;return t*t*t*e}function p0(s,e){const t=1-s;return 3*t*t*s*e}function m0(s,e){return 3*(1-s)*s*s*e}function g0(s,e){return s*s*s*e}function Dr(s,e,t,n,i){return f0(s,e)+p0(s,t)+m0(s,n)+g0(s,i)}class To extends Dt{constructor(e=new Z,t=new Z,n=new Z,i=new Z){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Z){const n=t,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(Dr(e,i.x,r.x,o.x,a.x),Dr(e,i.y,r.y,o.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}To.prototype.isCubicBezierCurve=!0;class pl extends Dt{constructor(e=new S,t=new S,n=new S,i=new S){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new S){const n=t,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(Dr(e,i.x,r.x,o.x,a.x),Dr(e,i.y,r.y,o.y,a.y),Dr(e,i.z,r.z,o.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}pl.prototype.isCubicBezierCurve3=!0;class ss extends Dt{constructor(e=new Z,t=new Z){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Z){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new Z;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}ss.prototype.isLineCurve=!0;class Wu extends Dt{constructor(e=new S,t=new S){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new S){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Ao extends Dt{constructor(e=new Z,t=new Z,n=new Z){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Z){const n=t,i=this.v0,r=this.v1,o=this.v2;return n.set(Ir(e,i.x,r.x,o.x),Ir(e,i.y,r.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Ao.prototype.isQuadraticBezierCurve=!0;class Co extends Dt{constructor(e=new S,t=new S,n=new S){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new S){const n=t,i=this.v0,r=this.v1,o=this.v2;return n.set(Ir(e,i.x,r.x,o.x),Ir(e,i.y,r.y,o.y),Ir(e,i.z,r.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Co.prototype.isQuadraticBezierCurve3=!0;class Ro extends Dt{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Z){const n=t,i=this.points,r=(i.length-1)*e,o=Math.floor(r),a=r-o,l=i[o===0?o:o-1],c=i[o],h=i[o>i.length-2?i.length-1:o+1],u=i[o>i.length-3?i.length-1:o+2];return n.set(kc(a,l.x,c.x,h.x,u.x),kc(a,l.y,c.y,h.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new Z().fromArray(i))}return this}}Ro.prototype.isSplineCurve=!0;var ml=Object.freeze({__proto__:null,ArcCurve:ul,CatmullRomCurve3:fl,CubicBezierCurve:To,CubicBezierCurve3:pl,EllipseCurve:rs,LineCurve:ss,LineCurve3:Wu,QuadraticBezierCurve:Ao,QuadraticBezierCurve3:Co,SplineCurve:Ro});class qu extends Dt{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ss(t,e))}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=n){const o=i[r]-n,a=this.curves[r],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const o=r[i],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,l=o.getPoints(a);for(let c=0;c<l.length;c++){const h=l[c];n&&n.equals(h)||(t.push(h),n=h)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const i=e.curves[t];this.curves.push(new ml[i.type]().fromJSON(i))}return this}}class tr extends qu{constructor(e){super(),this.type="Path",this.currentPoint=new Z,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new ss(this.currentPoint.clone(),new Z(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const r=new Ao(this.currentPoint.clone(),new Z(e,t),new Z(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,r,o){const a=new To(this.currentPoint.clone(),new Z(e,t),new Z(n,i),new Z(r,o));return this.curves.push(a),this.currentPoint.set(r,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Ro(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,r,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,n,i,r,o),this}absarc(e,t,n,i,r,o){return this.absellipse(e,t,n,n,i,r,o),this}ellipse(e,t,n,i,r,o,a,l){const c=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+c,t+h,n,i,r,o,a,l),this}absellipse(e,t,n,i,r,o,a,l){const c=new rs(e,t,n,i,r,o,a,l);if(this.curves.length>0){const u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);const h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class mi extends ye{constructor(e=[new Z(0,.5),new Z(.5,0),new Z(0,-.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=rt(i,0,Math.PI*2);const r=[],o=[],a=[],l=[],c=[],h=1/t,u=new S,d=new Z,f=new S,g=new S,p=new S;let m=0,x=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:m=e[y+1].x-e[y].x,x=e[y+1].y-e[y].y,f.x=x*1,f.y=-m,f.z=x*0,p.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(p.x,p.y,p.z);break;default:m=e[y+1].x-e[y].x,x=e[y+1].y-e[y].y,f.x=x*1,f.y=-m,f.z=x*0,g.copy(f),f.x+=p.x,f.y+=p.y,f.z+=p.z,f.normalize(),l.push(f.x,f.y,f.z),p.copy(g)}for(let y=0;y<=t;y++){const M=n+y*h*i,_=Math.sin(M),b=Math.cos(M);for(let A=0;A<=e.length-1;A++){u.x=e[A].x*_,u.y=e[A].y,u.z=e[A].x*b,o.push(u.x,u.y,u.z),d.x=y/t,d.y=A/(e.length-1),a.push(d.x,d.y);const R=l[3*A+0]*_,P=l[3*A+1],H=l[3*A+0]*b;c.push(R,P,H)}}for(let y=0;y<t;y++)for(let M=0;M<e.length-1;M++){const _=M+y*e.length,b=_,A=_+e.length,R=_+e.length+1,P=_+1;r.push(b,A,P),r.push(R,P,A)}this.setIndex(r),this.setAttribute("position",new de(o,3)),this.setAttribute("uv",new de(a,2)),this.setAttribute("normal",new de(c,3))}static fromJSON(e){return new mi(e.points,e.segments,e.phiStart,e.phiLength)}}class nr extends mi{constructor(e=1,t=1,n=4,i=8){const r=new tr;r.absarc(0,-t/2,e,Math.PI*1.5,0),r.absarc(0,t/2,e,0,Math.PI*.5),super(r.getPoints(n),i),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:i}}static fromJSON(e){return new nr(e.radius,e.length,e.capSegments,e.radialSegments)}}class ir extends ye{constructor(e=1,t=8,n=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const r=[],o=[],a=[],l=[],c=new S,h=new Z;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let u=0,d=3;u<=t;u++,d+=3){const f=n+u/t*i;c.x=e*Math.cos(f),c.y=e*Math.sin(f),o.push(c.x,c.y,c.z),a.push(0,0,1),h.x=(o[d]/e+1)/2,h.y=(o[d+1]/e+1)/2,l.push(h.x,h.y)}for(let u=1;u<=t;u++)r.push(u,u+1,0);this.setIndex(r),this.setAttribute("position",new de(o,3)),this.setAttribute("normal",new de(a,3)),this.setAttribute("uv",new de(l,2))}static fromJSON(e){return new ir(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Bn extends ye{constructor(e=1,t=1,n=1,i=8,r=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:l};const c=this;i=Math.floor(i),r=Math.floor(r);const h=[],u=[],d=[],f=[];let g=0;const p=[],m=n/2;let x=0;y(),o===!1&&(e>0&&M(!0),t>0&&M(!1)),this.setIndex(h),this.setAttribute("position",new de(u,3)),this.setAttribute("normal",new de(d,3)),this.setAttribute("uv",new de(f,2));function y(){const _=new S,b=new S;let A=0;const R=(t-e)/n;for(let P=0;P<=r;P++){const H=[],I=P/r,v=I*(t-e)+e;for(let C=0;C<=i;C++){const j=C/i,F=j*l+a,U=Math.sin(F),N=Math.cos(F);b.x=v*U,b.y=-I*n+m,b.z=v*N,u.push(b.x,b.y,b.z),_.set(U,R,N).normalize(),d.push(_.x,_.y,_.z),f.push(j,1-I),H.push(g++)}p.push(H)}for(let P=0;P<i;P++)for(let H=0;H<r;H++){const I=p[H][P],v=p[H+1][P],C=p[H+1][P+1],j=p[H][P+1];h.push(I,v,j),h.push(v,C,j),A+=6}c.addGroup(x,A,0),x+=A}function M(_){const b=g,A=new Z,R=new S;let P=0;const H=_===!0?e:t,I=_===!0?1:-1;for(let C=1;C<=i;C++)u.push(0,m*I,0),d.push(0,I,0),f.push(.5,.5),g++;const v=g;for(let C=0;C<=i;C++){const F=C/i*l+a,U=Math.cos(F),N=Math.sin(F);R.x=H*N,R.y=m*I,R.z=H*U,u.push(R.x,R.y,R.z),d.push(0,I,0),A.x=U*.5+.5,A.y=N*.5*I+.5,f.push(A.x,A.y),g++}for(let C=0;C<i;C++){const j=b+C,F=v+C;_===!0?h.push(F,F+1,j):h.push(F+1,F,j),P+=3}c.addGroup(x,P,_===!0?1:2),x+=P}}static fromJSON(e){return new Bn(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class rr extends Bn{constructor(e=1,t=1,n=8,i=1,r=!1,o=0,a=Math.PI*2){super(0,e,t,n,i,r,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}static fromJSON(e){return new rr(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class rn extends ye{constructor(e=[],t=[],n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const r=[],o=[];a(i),c(n),h(),this.setAttribute("position",new de(r,3)),this.setAttribute("normal",new de(r.slice(),3)),this.setAttribute("uv",new de(o,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function a(y){const M=new S,_=new S,b=new S;for(let A=0;A<t.length;A+=3)f(t[A+0],M),f(t[A+1],_),f(t[A+2],b),l(M,_,b,y)}function l(y,M,_,b){const A=b+1,R=[];for(let P=0;P<=A;P++){R[P]=[];const H=y.clone().lerp(_,P/A),I=M.clone().lerp(_,P/A),v=A-P;for(let C=0;C<=v;C++)C===0&&P===A?R[P][C]=H:R[P][C]=H.clone().lerp(I,C/v)}for(let P=0;P<A;P++)for(let H=0;H<2*(A-P)-1;H++){const I=Math.floor(H/2);H%2===0?(d(R[P][I+1]),d(R[P+1][I]),d(R[P][I])):(d(R[P][I+1]),d(R[P+1][I+1]),d(R[P+1][I]))}}function c(y){const M=new S;for(let _=0;_<r.length;_+=3)M.x=r[_+0],M.y=r[_+1],M.z=r[_+2],M.normalize().multiplyScalar(y),r[_+0]=M.x,r[_+1]=M.y,r[_+2]=M.z}function h(){const y=new S;for(let M=0;M<r.length;M+=3){y.x=r[M+0],y.y=r[M+1],y.z=r[M+2];const _=m(y)/2/Math.PI+.5,b=x(y)/Math.PI+.5;o.push(_,1-b)}g(),u()}function u(){for(let y=0;y<o.length;y+=6){const M=o[y+0],_=o[y+2],b=o[y+4],A=Math.max(M,_,b),R=Math.min(M,_,b);A>.9&&R<.1&&(M<.2&&(o[y+0]+=1),_<.2&&(o[y+2]+=1),b<.2&&(o[y+4]+=1))}}function d(y){r.push(y.x,y.y,y.z)}function f(y,M){const _=y*3;M.x=e[_+0],M.y=e[_+1],M.z=e[_+2]}function g(){const y=new S,M=new S,_=new S,b=new S,A=new Z,R=new Z,P=new Z;for(let H=0,I=0;H<r.length;H+=9,I+=6){y.set(r[H+0],r[H+1],r[H+2]),M.set(r[H+3],r[H+4],r[H+5]),_.set(r[H+6],r[H+7],r[H+8]),A.set(o[I+0],o[I+1]),R.set(o[I+2],o[I+3]),P.set(o[I+4],o[I+5]),b.copy(y).add(M).add(_).divideScalar(3);const v=m(b);p(A,I+0,y,v),p(R,I+2,M,v),p(P,I+4,_,v)}}function p(y,M,_,b){b<0&&y.x===1&&(o[M]=y.x-1),_.x===0&&_.z===0&&(o[M]=b/2/Math.PI+.5)}function m(y){return Math.atan2(y.z,-y.x)}function x(y){return Math.atan2(-y.y,Math.sqrt(y.x*y.x+y.z*y.z))}}static fromJSON(e){return new rn(e.vertices,e.indices,e.radius,e.details)}}class sr extends rn{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(r,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new sr(e.radius,e.detail)}}const zs=new S,Us=new S,fa=new S,Os=new st;class gl extends ye{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const i=Math.pow(10,4),r=Math.cos(ai*t),o=e.getIndex(),a=e.getAttribute("position"),l=o?o.count:a.count,c=[0,0,0],h=["a","b","c"],u=new Array(3),d={},f=[];for(let g=0;g<l;g+=3){o?(c[0]=o.getX(g),c[1]=o.getX(g+1),c[2]=o.getX(g+2)):(c[0]=g,c[1]=g+1,c[2]=g+2);const{a:p,b:m,c:x}=Os;if(p.fromBufferAttribute(a,c[0]),m.fromBufferAttribute(a,c[1]),x.fromBufferAttribute(a,c[2]),Os.getNormal(fa),u[0]=`${Math.round(p.x*i)},${Math.round(p.y*i)},${Math.round(p.z*i)}`,u[1]=`${Math.round(m.x*i)},${Math.round(m.y*i)},${Math.round(m.z*i)}`,u[2]=`${Math.round(x.x*i)},${Math.round(x.y*i)},${Math.round(x.z*i)}`,!(u[0]===u[1]||u[1]===u[2]||u[2]===u[0]))for(let y=0;y<3;y++){const M=(y+1)%3,_=u[y],b=u[M],A=Os[h[y]],R=Os[h[M]],P=`${_}_${b}`,H=`${b}_${_}`;H in d&&d[H]?(fa.dot(d[H].normal)<=r&&(f.push(A.x,A.y,A.z),f.push(R.x,R.y,R.z)),d[H]=null):P in d||(d[P]={index0:c[y],index1:c[M],normal:fa.clone()})}}for(const g in d)if(d[g]){const{index0:p,index1:m}=d[g];zs.fromBufferAttribute(a,p),Us.fromBufferAttribute(a,m),f.push(zs.x,zs.y,zs.z),f.push(Us.x,Us.y,Us.z)}this.setAttribute("position",new de(f,3))}}}class en extends tr{constructor(e){super(e),this.uuid=It(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const i=e.holes[t];this.holes.push(new tr().fromJSON(i))}return this}}const x0={triangulate:function(s,e,t=2){const n=e&&e.length,i=n?e[0]*t:s.length;let r=Xu(s,0,i,t,!0);const o=[];if(!r||r.next===r.prev)return o;let a,l,c,h,u,d,f;if(n&&(r=b0(s,e,r,t)),s.length>80*t){a=c=s[0],l=h=s[1];for(let g=t;g<i;g+=t)u=s[g],d=s[g+1],u<a&&(a=u),d<l&&(l=d),u>c&&(c=u),d>h&&(h=d);f=Math.max(c-a,h-l),f=f!==0?1/f:0}return Vr(r,o,t,a,l,f),o}};function Xu(s,e,t,n,i){let r,o;if(i===D0(s,e,t,n)>0)for(r=e;r<t;r+=n)o=Vc(r,s[r],s[r+1],o);else for(r=t-n;r>=e;r-=n)o=Vc(r,s[r],s[r+1],o);return o&&Lo(o,o.next)&&(qr(o),o=o.next),o}function Nn(s,e){if(!s)return s;e||(e=s);let t=s,n;do if(n=!1,!t.steiner&&(Lo(t,t.next)||Qe(t.prev,t,t.next)===0)){if(qr(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Vr(s,e,t,n,i,r,o){if(!s)return;!o&&r&&A0(s,n,i,r);let a=s,l,c;for(;s.prev!==s.next;){if(l=s.prev,c=s.next,r?_0(s,n,i,r):y0(s)){e.push(l.i/t),e.push(s.i/t),e.push(c.i/t),qr(s),s=c.next,a=c.next;continue}if(s=c,s===a){o?o===1?(s=v0(Nn(s),e,t),Vr(s,e,t,n,i,r,2)):o===2&&M0(s,e,t,n,i,r):Vr(Nn(s),e,t,n,i,r,1);break}}}function y0(s){const e=s.prev,t=s,n=s.next;if(Qe(e,t,n)>=0)return!1;let i=s.next.next;for(;i!==s.prev;){if($i(e.x,e.y,t.x,t.y,n.x,n.y,i.x,i.y)&&Qe(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function _0(s,e,t,n){const i=s.prev,r=s,o=s.next;if(Qe(i,r,o)>=0)return!1;const a=i.x<r.x?i.x<o.x?i.x:o.x:r.x<o.x?r.x:o.x,l=i.y<r.y?i.y<o.y?i.y:o.y:r.y<o.y?r.y:o.y,c=i.x>r.x?i.x>o.x?i.x:o.x:r.x>o.x?r.x:o.x,h=i.y>r.y?i.y>o.y?i.y:o.y:r.y>o.y?r.y:o.y,u=Za(a,l,e,t,n),d=Za(c,h,e,t,n);let f=s.prevZ,g=s.nextZ;for(;f&&f.z>=u&&g&&g.z<=d;){if(f!==s.prev&&f!==s.next&&$i(i.x,i.y,r.x,r.y,o.x,o.y,f.x,f.y)&&Qe(f.prev,f,f.next)>=0||(f=f.prevZ,g!==s.prev&&g!==s.next&&$i(i.x,i.y,r.x,r.y,o.x,o.y,g.x,g.y)&&Qe(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;f&&f.z>=u;){if(f!==s.prev&&f!==s.next&&$i(i.x,i.y,r.x,r.y,o.x,o.y,f.x,f.y)&&Qe(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;g&&g.z<=d;){if(g!==s.prev&&g!==s.next&&$i(i.x,i.y,r.x,r.y,o.x,o.y,g.x,g.y)&&Qe(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function v0(s,e,t){let n=s;do{const i=n.prev,r=n.next.next;!Lo(i,r)&&Ju(i,n,n.next,r)&&Wr(i,r)&&Wr(r,i)&&(e.push(i.i/t),e.push(n.i/t),e.push(r.i/t),qr(n),qr(n.next),n=s=r),n=n.next}while(n!==s);return Nn(n)}function M0(s,e,t,n,i,r){let o=s;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&L0(o,a)){let l=Yu(o,a);o=Nn(o,o.next),l=Nn(l,l.next),Vr(o,e,t,n,i,r),Vr(l,e,t,n,i,r);return}a=a.next}o=o.next}while(o!==s)}function b0(s,e,t,n){const i=[];let r,o,a,l,c;for(r=0,o=e.length;r<o;r++)a=e[r]*n,l=r<o-1?e[r+1]*n:s.length,c=Xu(s,a,l,n,!1),c===c.next&&(c.steiner=!0),i.push(R0(c));for(i.sort(w0),r=0;r<i.length;r++)S0(i[r],t),t=Nn(t,t.next);return t}function w0(s,e){return s.x-e.x}function S0(s,e){if(e=E0(s,e),e){const t=Yu(e,s);Nn(e,e.next),Nn(t,t.next)}}function E0(s,e){let t=e;const n=s.x,i=s.y;let r=-1/0,o;do{if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const d=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=n&&d>r){if(r=d,d===n){if(i===t.y)return t;if(i===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(n===r)return o;const a=o,l=o.x,c=o.y;let h=1/0,u;t=o;do n>=t.x&&t.x>=l&&n!==t.x&&$i(i<c?n:r,i,l,c,i<c?r:n,i,t.x,t.y)&&(u=Math.abs(i-t.y)/(n-t.x),Wr(t,s)&&(u<h||u===h&&(t.x>o.x||t.x===o.x&&T0(o,t)))&&(o=t,h=u)),t=t.next;while(t!==a);return o}function T0(s,e){return Qe(s.prev,s,e.prev)<0&&Qe(e.next,s,s.next)<0}function A0(s,e,t,n){let i=s;do i.z===null&&(i.z=Za(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==s);i.prevZ.nextZ=null,i.prevZ=null,C0(i)}function C0(s){let e,t,n,i,r,o,a,l,c=1;do{for(t=s,s=null,r=null,o=0;t;){for(o++,n=t,a=0,e=0;e<c&&(a++,n=n.nextZ,!!n);e++);for(l=c;a>0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),r?r.nextZ=i:s=i,i.prevZ=r,r=i;t=n}r.nextZ=null,c*=2}while(o>1);return s}function Za(s,e,t,n,i){return s=32767*(s-t)*i,e=32767*(e-n)*i,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,s|e<<1}function R0(s){let e=s,t=s;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==s);return t}function $i(s,e,t,n,i,r,o,a){return(i-o)*(e-a)-(s-o)*(r-a)>=0&&(s-o)*(n-a)-(t-o)*(e-a)>=0&&(t-o)*(r-a)-(i-o)*(n-a)>=0}function L0(s,e){return s.next.i!==e.i&&s.prev.i!==e.i&&!P0(s,e)&&(Wr(s,e)&&Wr(e,s)&&I0(s,e)&&(Qe(s.prev,s,e.prev)||Qe(s,e.prev,e))||Lo(s,e)&&Qe(s.prev,s,s.next)>0&&Qe(e.prev,e,e.next)>0)}function Qe(s,e,t){return(e.y-s.y)*(t.x-e.x)-(e.x-s.x)*(t.y-e.y)}function Lo(s,e){return s.x===e.x&&s.y===e.y}function Ju(s,e,t,n){const i=Gs(Qe(s,e,t)),r=Gs(Qe(s,e,n)),o=Gs(Qe(t,n,s)),a=Gs(Qe(t,n,e));return!!(i!==r&&o!==a||i===0&&Hs(s,t,e)||r===0&&Hs(s,n,e)||o===0&&Hs(t,s,n)||a===0&&Hs(t,e,n))}function Hs(s,e,t){return e.x<=Math.max(s.x,t.x)&&e.x>=Math.min(s.x,t.x)&&e.y<=Math.max(s.y,t.y)&&e.y>=Math.min(s.y,t.y)}function Gs(s){return s>0?1:s<0?-1:0}function P0(s,e){let t=s;do{if(t.i!==s.i&&t.next.i!==s.i&&t.i!==e.i&&t.next.i!==e.i&&Ju(t,t.next,s,e))return!0;t=t.next}while(t!==s);return!1}function Wr(s,e){return Qe(s.prev,s,s.next)<0?Qe(s,e,s.next)>=0&&Qe(s,s.prev,e)>=0:Qe(s,e,s.prev)<0||Qe(s,s.next,e)<0}function I0(s,e){let t=s,n=!1;const i=(s.x+e.x)/2,r=(s.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&i<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==s);return n}function Yu(s,e){const t=new $a(s.i,s.x,s.y),n=new $a(e.i,e.x,e.y),i=s.next,r=e.prev;return s.next=e,e.prev=s,t.next=i,i.prev=t,n.next=t,t.prev=n,r.next=n,n.prev=r,n}function Vc(s,e,t,n){const i=new $a(s,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function qr(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function $a(s,e,t){this.i=s,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function D0(s,e,t,n){let i=0;for(let r=e,o=t-n;r<t;r+=n)i+=(s[o]-s[r])*(s[r+1]+s[o+1]),o=r;return i}class tn{static area(e){const t=e.length;let n=0;for(let i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return n*.5}static isClockWise(e){return tn.area(e)<0}static triangulateShape(e,t){const n=[],i=[],r=[];Wc(e),qc(n,e);let o=e.length;t.forEach(Wc);for(let l=0;l<t.length;l++)i.push(o),o+=t[l].length,qc(n,t[l]);const a=x0.triangulate(n,i);for(let l=0;l<a.length;l+=3)r.push(a.slice(l,l+3));return r}}function Wc(s){const e=s.length;e>2&&s[e-1].equals(s[0])&&s.pop()}function qc(s,e){for(let t=0;t<e.length;t++)s.push(e[t].x),s.push(e[t].y)}class sn extends ye{constructor(e=new en([new Z(.5,.5),new Z(-.5,.5),new Z(-.5,-.5),new Z(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],r=[];for(let a=0,l=e.length;a<l;a++){const c=e[a];o(c)}this.setAttribute("position",new de(i,3)),this.setAttribute("uv",new de(r,2)),this.computeVertexNormals();function o(a){const l=[],c=t.curveSegments!==void 0?t.curveSegments:12,h=t.steps!==void 0?t.steps:1;let u=t.depth!==void 0?t.depth:1,d=t.bevelEnabled!==void 0?t.bevelEnabled:!0,f=t.bevelThickness!==void 0?t.bevelThickness:.2,g=t.bevelSize!==void 0?t.bevelSize:f-.1,p=t.bevelOffset!==void 0?t.bevelOffset:0,m=t.bevelSegments!==void 0?t.bevelSegments:3;const x=t.extrudePath,y=t.UVGenerator!==void 0?t.UVGenerator:F0;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),u=t.amount);let M,_=!1,b,A,R,P;x&&(M=x.getSpacedPoints(h),_=!0,d=!1,b=x.computeFrenetFrames(h,!1),A=new S,R=new S,P=new S),d||(m=0,f=0,g=0,p=0);const H=a.extractPoints(c);let I=H.shape;const v=H.holes;if(!tn.isClockWise(I)){I=I.reverse();for(let W=0,Y=v.length;W<Y;W++){const ee=v[W];tn.isClockWise(ee)&&(v[W]=ee.reverse())}}const j=tn.triangulateShape(I,v),F=I;for(let W=0,Y=v.length;W<Y;W++){const ee=v[W];I=I.concat(ee)}function U(W,Y,ee){return Y||console.error("THREE.ExtrudeGeometry: vec does not exist"),Y.clone().multiplyScalar(ee).add(W)}const N=I.length,k=j.length;function D(W,Y,ee){let pe,ce,Te;const ve=W.x-Y.x,xe=W.y-Y.y,Ke=ee.x-W.x,Ye=ee.y-W.y,T=ve*ve+xe*xe,w=ve*Ye-xe*Ke;if(Math.abs(w)>Number.EPSILON){const G=Math.sqrt(T),Q=Math.sqrt(Ke*Ke+Ye*Ye),le=Y.x-xe/G,he=Y.y+ve/G,_e=ee.x-Ye/Q,V=ee.y+Ke/Q,Le=((_e-le)*Ye-(V-he)*Ke)/(ve*Ye-xe*Ke);pe=le+ve*Le-W.x,ce=he+xe*Le-W.y;const Ie=pe*pe+ce*ce;if(Ie<=2)return new Z(pe,ce);Te=Math.sqrt(Ie/2)}else{let G=!1;ve>Number.EPSILON?Ke>Number.EPSILON&&(G=!0):ve<-Number.EPSILON?Ke<-Number.EPSILON&&(G=!0):Math.sign(xe)===Math.sign(Ye)&&(G=!0),G?(pe=-xe,ce=ve,Te=Math.sqrt(T)):(pe=ve,ce=xe,Te=Math.sqrt(T/2))}return new Z(pe/Te,ce/Te)}const X=[];for(let W=0,Y=F.length,ee=Y-1,pe=W+1;W<Y;W++,ee++,pe++)ee===Y&&(ee=0),pe===Y&&(pe=0),X[W]=D(F[W],F[ee],F[pe]);const $=[];let te,K=X.concat();for(let W=0,Y=v.length;W<Y;W++){const ee=v[W];te=[];for(let pe=0,ce=ee.length,Te=ce-1,ve=pe+1;pe<ce;pe++,Te++,ve++)Te===ce&&(Te=0),ve===ce&&(ve=0),te[pe]=D(ee[pe],ee[Te],ee[ve]);$.push(te),K=K.concat(te)}for(let W=0;W<m;W++){const Y=W/m,ee=f*Math.cos(Y*Math.PI/2),pe=g*Math.sin(Y*Math.PI/2)+p;for(let ce=0,Te=F.length;ce<Te;ce++){const ve=U(F[ce],X[ce],pe);Ve(ve.x,ve.y,-ee)}for(let ce=0,Te=v.length;ce<Te;ce++){const ve=v[ce];te=$[ce];for(let xe=0,Ke=ve.length;xe<Ke;xe++){const Ye=U(ve[xe],te[xe],pe);Ve(Ye.x,Ye.y,-ee)}}}const ge=g+p;for(let W=0;W<N;W++){const Y=d?U(I[W],K[W],ge):I[W];_?(R.copy(b.normals[0]).multiplyScalar(Y.x),A.copy(b.binormals[0]).multiplyScalar(Y.y),P.copy(M[0]).add(R).add(A),Ve(P.x,P.y,P.z)):Ve(Y.x,Y.y,0)}for(let W=1;W<=h;W++)for(let Y=0;Y<N;Y++){const ee=d?U(I[Y],K[Y],ge):I[Y];_?(R.copy(b.normals[W]).multiplyScalar(ee.x),A.copy(b.binormals[W]).multiplyScalar(ee.y),P.copy(M[W]).add(R).add(A),Ve(P.x,P.y,P.z)):Ve(ee.x,ee.y,u/h*W)}for(let W=m-1;W>=0;W--){const Y=W/m,ee=f*Math.cos(Y*Math.PI/2),pe=g*Math.sin(Y*Math.PI/2)+p;for(let ce=0,Te=F.length;ce<Te;ce++){const ve=U(F[ce],X[ce],pe);Ve(ve.x,ve.y,u+ee)}for(let ce=0,Te=v.length;ce<Te;ce++){const ve=v[ce];te=$[ce];for(let xe=0,Ke=ve.length;xe<Ke;xe++){const Ye=U(ve[xe],te[xe],pe);_?Ve(Ye.x,Ye.y+M[h-1].y,M[h-1].x+ee):Ve(Ye.x,Ye.y,u+ee)}}}ze(),Se();function ze(){const W=i.length/3;if(d){let Y=0,ee=N*Y;for(let pe=0;pe<k;pe++){const ce=j[pe];Ce(ce[2]+ee,ce[1]+ee,ce[0]+ee)}Y=h+m*2,ee=N*Y;for(let pe=0;pe<k;pe++){const ce=j[pe];Ce(ce[0]+ee,ce[1]+ee,ce[2]+ee)}}else{for(let Y=0;Y<k;Y++){const ee=j[Y];Ce(ee[2],ee[1],ee[0])}for(let Y=0;Y<k;Y++){const ee=j[Y];Ce(ee[0]+N*h,ee[1]+N*h,ee[2]+N*h)}}n.addGroup(W,i.length/3-W,0)}function Se(){const W=i.length/3;let Y=0;q(F,Y),Y+=F.length;for(let ee=0,pe=v.length;ee<pe;ee++){const ce=v[ee];q(ce,Y),Y+=ce.length}n.addGroup(W,i.length/3-W,1)}function q(W,Y){let ee=W.length;for(;--ee>=0;){const pe=ee;let ce=ee-1;ce<0&&(ce=W.length-1);for(let Te=0,ve=h+m*2;Te<ve;Te++){const xe=N*Te,Ke=N*(Te+1),Ye=Y+pe+xe,T=Y+ce+xe,w=Y+ce+Ke,G=Y+pe+Ke;Re(Ye,T,w,G)}}}function Ve(W,Y,ee){l.push(W),l.push(Y),l.push(ee)}function Ce(W,Y,ee){ne(W),ne(Y),ne(ee);const pe=i.length/3,ce=y.generateTopUV(n,i,pe-3,pe-2,pe-1);Be(ce[0]),Be(ce[1]),Be(ce[2])}function Re(W,Y,ee,pe){ne(W),ne(Y),ne(pe),ne(Y),ne(ee),ne(pe);const ce=i.length/3,Te=y.generateSideWallUV(n,i,ce-6,ce-3,ce-2,ce-1);Be(Te[0]),Be(Te[1]),Be(Te[3]),Be(Te[1]),Be(Te[2]),Be(Te[3])}function ne(W){i.push(l[W*3+0]),i.push(l[W*3+1]),i.push(l[W*3+2])}function Be(W){r.push(W.x),r.push(W.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return B0(t,n,e)}static fromJSON(e,t){const n=[];for(let r=0,o=e.shapes.length;r<o;r++){const a=t[e.shapes[r]];n.push(a)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new ml[i.type]().fromJSON(i)),new sn(n,e.options)}}const F0={generateTopUV:function(s,e,t,n,i){const r=e[t*3],o=e[t*3+1],a=e[n*3],l=e[n*3+1],c=e[i*3],h=e[i*3+1];return[new Z(r,o),new Z(a,l),new Z(c,h)]},generateSideWallUV:function(s,e,t,n,i,r){const o=e[t*3],a=e[t*3+1],l=e[t*3+2],c=e[n*3],h=e[n*3+1],u=e[n*3+2],d=e[i*3],f=e[i*3+1],g=e[i*3+2],p=e[r*3],m=e[r*3+1],x=e[r*3+2];return Math.abs(a-h)<Math.abs(o-c)?[new Z(o,1-l),new Z(c,1-u),new Z(d,1-g),new Z(p,1-x)]:[new Z(a,1-l),new Z(h,1-u),new Z(f,1-g),new Z(m,1-x)]}};function B0(s,e,t){if(t.shapes=[],Array.isArray(s))for(let n=0,i=s.length;n<i;n++){const r=s[n];t.shapes.push(r.uuid)}else t.shapes.push(s.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class or extends rn{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],r=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(i,r,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new or(e.radius,e.detail)}}class gi extends rn{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(n,i,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new gi(e.radius,e.detail)}}class ar extends ye{constructor(e=.5,t=1,n=8,i=1,r=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},n=Math.max(3,n),i=Math.max(1,i);const a=[],l=[],c=[],h=[];let u=e;const d=(t-e)/i,f=new S,g=new Z;for(let p=0;p<=i;p++){for(let m=0;m<=n;m++){const x=r+m/n*o;f.x=u*Math.cos(x),f.y=u*Math.sin(x),l.push(f.x,f.y,f.z),c.push(0,0,1),g.x=(f.x/t+1)/2,g.y=(f.y/t+1)/2,h.push(g.x,g.y)}u+=d}for(let p=0;p<i;p++){const m=p*(n+1);for(let x=0;x<n;x++){const y=x+m,M=y,_=y+n+1,b=y+n+2,A=y+1;a.push(M,_,A),a.push(_,b,A)}}this.setIndex(a),this.setAttribute("position",new de(l,3)),this.setAttribute("normal",new de(c,3)),this.setAttribute("uv",new de(h,2))}static fromJSON(e){return new ar(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class xi extends ye{constructor(e=new en([new Z(0,.5),new Z(-.5,-.5),new Z(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],r=[],o=[];let a=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let h=0;h<e.length;h++)c(e[h]),this.addGroup(a,l,h),a+=l,l=0;this.setIndex(n),this.setAttribute("position",new de(i,3)),this.setAttribute("normal",new de(r,3)),this.setAttribute("uv",new de(o,2));function c(h){const u=i.length/3,d=h.extractPoints(t);let f=d.shape;const g=d.holes;tn.isClockWise(f)===!1&&(f=f.reverse());for(let m=0,x=g.length;m<x;m++){const y=g[m];tn.isClockWise(y)===!0&&(g[m]=y.reverse())}const p=tn.triangulateShape(f,g);for(let m=0,x=g.length;m<x;m++){const y=g[m];f=f.concat(y)}for(let m=0,x=f.length;m<x;m++){const y=f[m];i.push(y.x,y.y,0),r.push(0,0,1),o.push(y.x,y.y)}for(let m=0,x=p.length;m<x;m++){const y=p[m],M=y[0]+u,_=y[1]+u,b=y[2]+u;n.push(M,_,b),l+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return N0(t,e)}static fromJSON(e,t){const n=[];for(let i=0,r=e.shapes.length;i<r;i++){const o=t[e.shapes[i]];n.push(o)}return new xi(n,e.curveSegments)}}function N0(s,e){if(e.shapes=[],Array.isArray(s))for(let t=0,n=s.length;t<n;t++){const i=s[t];e.shapes.push(i.uuid)}else e.shapes.push(s.uuid);return e}class yi extends ye{constructor(e=1,t=32,n=16,i=0,r=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(o+a,Math.PI);let c=0;const h=[],u=new S,d=new S,f=[],g=[],p=[],m=[];for(let x=0;x<=n;x++){const y=[],M=x/n;let _=0;x==0&&o==0?_=.5/t:x==n&&l==Math.PI&&(_=-.5/t);for(let b=0;b<=t;b++){const A=b/t;u.x=-e*Math.cos(i+A*r)*Math.sin(o+M*a),u.y=e*Math.cos(o+M*a),u.z=e*Math.sin(i+A*r)*Math.sin(o+M*a),g.push(u.x,u.y,u.z),d.copy(u).normalize(),p.push(d.x,d.y,d.z),m.push(A+_,1-M),y.push(c++)}h.push(y)}for(let x=0;x<n;x++)for(let y=0;y<t;y++){const M=h[x][y+1],_=h[x][y],b=h[x+1][y],A=h[x+1][y+1];(x!==0||o>0)&&f.push(M,_,A),(x!==n-1||l<Math.PI)&&f.push(_,b,A)}this.setIndex(f),this.setAttribute("position",new de(g,3)),this.setAttribute("normal",new de(p,3)),this.setAttribute("uv",new de(m,2))}static fromJSON(e){return new yi(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class lr extends rn{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,i,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new lr(e.radius,e.detail)}}class cr extends ye{constructor(e=1,t=.4,n=8,i=6,r=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},n=Math.floor(n),i=Math.floor(i);const o=[],a=[],l=[],c=[],h=new S,u=new S,d=new S;for(let f=0;f<=n;f++)for(let g=0;g<=i;g++){const p=g/i*r,m=f/n*Math.PI*2;u.x=(e+t*Math.cos(m))*Math.cos(p),u.y=(e+t*Math.cos(m))*Math.sin(p),u.z=t*Math.sin(m),a.push(u.x,u.y,u.z),h.x=e*Math.cos(p),h.y=e*Math.sin(p),d.subVectors(u,h).normalize(),l.push(d.x,d.y,d.z),c.push(g/i),c.push(f/n)}for(let f=1;f<=n;f++)for(let g=1;g<=i;g++){const p=(i+1)*f+g-1,m=(i+1)*(f-1)+g-1,x=(i+1)*(f-1)+g,y=(i+1)*f+g;o.push(p,m,y),o.push(m,x,y)}this.setIndex(o),this.setAttribute("position",new de(a,3)),this.setAttribute("normal",new de(l,3)),this.setAttribute("uv",new de(c,2))}static fromJSON(e){return new cr(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class hr extends ye{constructor(e=1,t=.4,n=64,i=8,r=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:o},n=Math.floor(n),i=Math.floor(i);const a=[],l=[],c=[],h=[],u=new S,d=new S,f=new S,g=new S,p=new S,m=new S,x=new S;for(let M=0;M<=n;++M){const _=M/n*r*Math.PI*2;y(_,r,o,e,f),y(_+.01,r,o,e,g),m.subVectors(g,f),x.addVectors(g,f),p.crossVectors(m,x),x.crossVectors(p,m),p.normalize(),x.normalize();for(let b=0;b<=i;++b){const A=b/i*Math.PI*2,R=-t*Math.cos(A),P=t*Math.sin(A);u.x=f.x+(R*x.x+P*p.x),u.y=f.y+(R*x.y+P*p.y),u.z=f.z+(R*x.z+P*p.z),l.push(u.x,u.y,u.z),d.subVectors(u,f).normalize(),c.push(d.x,d.y,d.z),h.push(M/n),h.push(b/i)}}for(let M=1;M<=n;M++)for(let _=1;_<=i;_++){const b=(i+1)*(M-1)+(_-1),A=(i+1)*M+(_-1),R=(i+1)*M+_,P=(i+1)*(M-1)+_;a.push(b,A,P),a.push(A,R,P)}this.setIndex(a),this.setAttribute("position",new de(l,3)),this.setAttribute("normal",new de(c,3)),this.setAttribute("uv",new de(h,2));function y(M,_,b,A,R){const P=Math.cos(M),H=Math.sin(M),I=b/_*M,v=Math.cos(I);R.x=A*(2+v)*.5*P,R.y=A*(2+v)*H*.5,R.z=A*Math.sin(I)*.5}}static fromJSON(e){return new hr(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class ur extends ye{constructor(e=new Co(new S(-1,-1,0),new S(-1,1,0),new S(1,1,0)),t=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r};const o=e.computeFrenetFrames(t,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new S,l=new S,c=new Z;let h=new S;const u=[],d=[],f=[],g=[];p(),this.setIndex(g),this.setAttribute("position",new de(u,3)),this.setAttribute("normal",new de(d,3)),this.setAttribute("uv",new de(f,2));function p(){for(let M=0;M<t;M++)m(M);m(r===!1?t:0),y(),x()}function m(M){h=e.getPointAt(M/t,h);const _=o.normals[M],b=o.binormals[M];for(let A=0;A<=i;A++){const R=A/i*Math.PI*2,P=Math.sin(R),H=-Math.cos(R);l.x=H*_.x+P*b.x,l.y=H*_.y+P*b.y,l.z=H*_.z+P*b.z,l.normalize(),d.push(l.x,l.y,l.z),a.x=h.x+n*l.x,a.y=h.y+n*l.y,a.z=h.z+n*l.z,u.push(a.x,a.y,a.z)}}function x(){for(let M=1;M<=t;M++)for(let _=1;_<=i;_++){const b=(i+1)*(M-1)+(_-1),A=(i+1)*M+(_-1),R=(i+1)*M+_,P=(i+1)*(M-1)+_;g.push(b,A,P),g.push(A,R,P)}}function y(){for(let M=0;M<=t;M++)for(let _=0;_<=i;_++)c.x=M/t,c.y=_/i,f.push(c.x,c.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new ur(new ml[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class xl extends ye{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new S,r=new S;if(e.index!==null){const o=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let c=0,h=l.length;c<h;++c){const u=l[c],d=u.start,f=u.count;for(let g=d,p=d+f;g<p;g+=3)for(let m=0;m<3;m++){const x=a.getX(g+m),y=a.getX(g+(m+1)%3);i.fromBufferAttribute(o,x),r.fromBufferAttribute(o,y),Xc(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}}else{const o=e.attributes.position;for(let a=0,l=o.count/3;a<l;a++)for(let c=0;c<3;c++){const h=3*a+c,u=3*a+(c+1)%3;i.fromBufferAttribute(o,h),r.fromBufferAttribute(o,u),Xc(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new de(t,3))}}}function Xc(s,e,t){const n=`${s.x},${s.y},${s.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${s.x},${s.y},${s.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}var Jc=Object.freeze({__proto__:null,BoxGeometry:mn,BoxBufferGeometry:mn,CapsuleGeometry:nr,CapsuleBufferGeometry:nr,CircleGeometry:ir,CircleBufferGeometry:ir,ConeGeometry:rr,ConeBufferGeometry:rr,CylinderGeometry:Bn,CylinderBufferGeometry:Bn,DodecahedronGeometry:sr,DodecahedronBufferGeometry:sr,EdgesGeometry:gl,ExtrudeGeometry:sn,ExtrudeBufferGeometry:sn,IcosahedronGeometry:or,IcosahedronBufferGeometry:or,LatheGeometry:mi,LatheBufferGeometry:mi,OctahedronGeometry:gi,OctahedronBufferGeometry:gi,PlaneGeometry:fi,PlaneBufferGeometry:fi,PolyhedronGeometry:rn,PolyhedronBufferGeometry:rn,RingGeometry:ar,RingBufferGeometry:ar,ShapeGeometry:xi,ShapeBufferGeometry:xi,SphereGeometry:yi,SphereBufferGeometry:yi,TetrahedronGeometry:lr,TetrahedronBufferGeometry:lr,TorusGeometry:cr,TorusBufferGeometry:cr,TorusKnotGeometry:hr,TorusKnotBufferGeometry:hr,TubeGeometry:ur,TubeBufferGeometry:ur,WireframeGeometry:xl});class yl extends ot{constructor(e){super(),this.type="ShadowMaterial",this.color=new ae(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}yl.prototype.isShadowMaterial=!0;class _l extends zt{constructor(e){super(e),this.type="RawShaderMaterial"}}_l.prototype.isRawShaderMaterial=!0;class Po extends ot{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ae(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mi,this.normalScale=new Z(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}Po.prototype.isMeshStandardMaterial=!0;class vl extends Po{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Z(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return rt(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenColor=new ae(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new ae(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new ae(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}vl.prototype.isMeshPhysicalMaterial=!0;class Ml extends ot{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new ae(16777215),this.specular=new ae(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mi,this.normalScale=new Z(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$r,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}Ml.prototype.isMeshPhongMaterial=!0;class bl extends ot{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ae(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mi,this.normalScale=new Z(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}bl.prototype.isMeshToonMaterial=!0;class wl extends ot{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mi,this.normalScale=new Z(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}wl.prototype.isMeshNormalMaterial=!0;class Sl extends ot{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new ae(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$r,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}Sl.prototype.isMeshLambertMaterial=!0;class El extends ot{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ae(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mi,this.normalScale=new Z(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}El.prototype.isMeshMatcapMaterial=!0;class Tl extends gt{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}Tl.prototype.isLineDashedMaterial=!0;const z0={ShadowMaterial:yl,SpriteMaterial:Mo,RawShaderMaterial:_l,ShaderMaterial:zt,PointsMaterial:wi,MeshPhysicalMaterial:vl,MeshStandardMaterial:Po,MeshPhongMaterial:Ml,MeshToonMaterial:bl,MeshNormalMaterial:wl,MeshLambertMaterial:Sl,MeshDepthMaterial:yo,MeshDistanceMaterial:_o,MeshBasicMaterial:yn,MeshMatcapMaterial:El,LineDashedMaterial:Tl,LineBasicMaterial:gt,Material:ot};ot.fromType=function(s){return new z0[s]};const je={arraySlice:function(s,e,t){return je.isTypedArray(s)?new s.constructor(s.subarray(e,t!==void 0?t:s.length)):s.slice(e,t)},convertArray:function(s,e,t){return!s||!t&&s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)},isTypedArray:function(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)},getKeyframeOrder:function(s){function e(i,r){return s[i]-s[r]}const t=s.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n},sortedArray:function(s,e,t){const n=s.length,i=new s.constructor(n);for(let r=0,o=0;o!==n;++r){const a=t[r]*e;for(let l=0;l!==e;++l)i[o++]=s[a+l]}return i},flattenJSON:function(s,e,t,n){let i=1,r=s[0];for(;r!==void 0&&r[n]===void 0;)r=s[i++];if(r===void 0)return;let o=r[n];if(o!==void 0)if(Array.isArray(o))do o=r[n],o!==void 0&&(e.push(r.time),t.push.apply(t,o)),r=s[i++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[n],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=s[i++];while(r!==void 0);else do o=r[n],o!==void 0&&(e.push(r.time),t.push(o)),r=s[i++];while(r!==void 0)},subclip:function(s,e,t,n,i=30){const r=s.clone();r.name=e;const o=[];for(let l=0;l<r.tracks.length;++l){const c=r.tracks[l],h=c.getValueSize(),u=[],d=[];for(let f=0;f<c.times.length;++f){const g=c.times[f]*i;if(!(g<t||g>=n)){u.push(c.times[f]);for(let p=0;p<h;++p)d.push(c.values[f*h+p])}}u.length!==0&&(c.times=je.convertArray(u,c.times.constructor),c.values=je.convertArray(d,c.values.constructor),o.push(c))}r.tracks=o;let a=1/0;for(let l=0;l<r.tracks.length;++l)a>r.tracks[l].times[0]&&(a=r.tracks[l].times[0]);for(let l=0;l<r.tracks.length;++l)r.tracks[l].shift(-1*a);return r.resetDuration(),r},makeClipAdditive:function(s,e=0,t=s,n=30){n<=0&&(n=30);const i=t.tracks.length,r=e/n;for(let o=0;o<i;++o){const a=t.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const c=s.tracks.find(function(x){return x.name===a.name&&x.ValueTypeName===l});if(c===void 0)continue;let h=0;const u=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=u/3);let d=0;const f=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(d=f/3);const g=a.times.length-1;let p;if(r<=a.times[0]){const x=h,y=u-h;p=je.arraySlice(a.values,x,y)}else if(r>=a.times[g]){const x=g*u+h,y=x+u-h;p=je.arraySlice(a.values,x,y)}else{const x=a.createInterpolant(),y=h,M=u-h;x.evaluate(r),p=je.arraySlice(x.resultBuffer,y,M)}l==="quaternion"&&new yt().fromArray(p).normalize().conjugate().toArray(p);const m=c.times.length;for(let x=0;x<m;++x){const y=x*f+d;if(l==="quaternion")yt.multiplyQuaternionsFlat(c.values,y,p,0,c.values,y);else{const M=f-d*2;for(let _=0;_<M;++_)c.values[y+_]-=p[_]}}}return s.blendMode=il,s}};class xn{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{let o;n:{i:if(!(e<i)){for(let a=n+2;;){if(i===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,r)}if(n===a)break;if(r=i,i=t[++n],e<i)break t}o=t.length;break n}if(!(e>=r)){const a=t[1];e<a&&(n=2,r=a);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===l)break;if(i=r,r=t[--n-1],e>=r)break t}o=n,n=0;break n}break e}for(;n<o;){const a=n+o>>>1;e<t[a]?o=a:n=a+1}if(i=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(i===void 0)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,r,e)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let o=0;o!==i;++o)t[o]=n[r+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}xn.prototype.beforeStart_=xn.prototype.copySampleValue_;xn.prototype.afterEnd_=xn.prototype.copySampleValue_;class Zu extends xn{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ei,endingEnd:ei}}intervalChanged_(e,t,n){const i=this.parameterPositions;let r=e-2,o=e+1,a=i[r],l=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case ti:r=e,a=2*t-n;break;case Hr:r=i.length-2,a=t+i[r]-i[r+1];break;default:r=e,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case ti:o=e,l=2*n-t;break;case Hr:o=1,l=n+i[1]-i[0];break;default:o=e-1,l=t}const c=(n-t)*.5,h=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(l-n),this._offsetPrev=r*h,this._offsetNext=o*h}interpolate_(e,t,n,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,f=this._weightNext,g=(n-t)/(i-t),p=g*g,m=p*g,x=-d*m+2*d*p-d*g,y=(1+d)*m+(-1.5-2*d)*p+(-.5+d)*g+1,M=(-1-f)*m+(1.5+f)*p+.5*g,_=f*m-f*p;for(let b=0;b!==a;++b)r[b]=x*o[h+b]+y*o[c+b]+M*o[l+b]+_*o[u+b];return r}}class Al extends xn{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,c=l-a,h=(n-t)/(i-t),u=1-h;for(let d=0;d!==a;++d)r[d]=o[c+d]*u+o[l+d]*h;return r}}class $u extends xn{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Xt{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=je.convertArray(t,this.TimeBufferType),this.values=je.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:je.convertArray(e.times,Array),values:je.convertArray(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new $u(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Al(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Zu(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Ur:t=this.InterpolantFactoryMethodDiscrete;break;case Or:t=this.InterpolantFactoryMethodLinear;break;case Qs:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ur;case this.InterpolantFactoryMethodLinear:return Or;case this.InterpolantFactoryMethodSmooth:return Qs}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let r=0,o=i-1;for(;r!==i&&n[r]<e;)++r;for(;o!==-1&&n[o]>t;)--o;if(++o,r!==0||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=je.arraySlice(n,r,o),this.values=je.arraySlice(this.values,r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&je.isTypedArray(i))for(let a=0,l=i.length;a!==l;++a){const c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=je.arraySlice(this.times),t=je.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Qs,r=e.length-1;let o=1;for(let a=1;a<r;++a){let l=!1;const c=e[a],h=e[a+1];if(c!==h&&(a!==1||c!==e[0]))if(i)l=!0;else{const u=a*n,d=u-n,f=u+n;for(let g=0;g!==n;++g){const p=t[u+g];if(p!==t[d+g]||p!==t[f+g]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];const u=a*n,d=o*n;for(let f=0;f!==n;++f)t[d+f]=t[u+f]}++o}}if(r>0){e[o]=e[r];for(let a=r*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=je.arraySlice(e,0,o),this.values=je.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){const e=je.arraySlice(this.times,0),t=je.arraySlice(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Xt.prototype.TimeBufferType=Float32Array;Xt.prototype.ValueBufferType=Float32Array;Xt.prototype.DefaultInterpolation=Or;class Si extends Xt{}Si.prototype.ValueTypeName="bool";Si.prototype.ValueBufferType=Array;Si.prototype.DefaultInterpolation=Ur;Si.prototype.InterpolantFactoryMethodLinear=void 0;Si.prototype.InterpolantFactoryMethodSmooth=void 0;class Cl extends Xt{}Cl.prototype.ValueTypeName="color";class Xr extends Xt{}Xr.prototype.ValueTypeName="number";class ju extends xn{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t);let c=e*a;for(let h=c+a;c!==h;c+=4)yt.slerpFlat(r,0,o,c-a,o,c,l);return r}}class gr extends Xt{InterpolantFactoryMethodLinear(e){return new ju(this.times,this.values,this.getValueSize(),e)}}gr.prototype.ValueTypeName="quaternion";gr.prototype.DefaultInterpolation=Or;gr.prototype.InterpolantFactoryMethodSmooth=void 0;class Ei extends Xt{}Ei.prototype.ValueTypeName="string";Ei.prototype.ValueBufferType=Array;Ei.prototype.DefaultInterpolation=Ur;Ei.prototype.InterpolantFactoryMethodLinear=void 0;Ei.prototype.InterpolantFactoryMethodSmooth=void 0;class Jr extends Xt{}Jr.prototype.ValueTypeName="vector";class Yr{constructor(e,t=-1,n,i=ho){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=It(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(O0(n[o]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=n.length;r!==o;++r)t.push(Xt.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const r=t.length,o=[];for(let a=0;a<r;a++){let l=[],c=[];l.push((a+r-1)%r,a,(a+1)%r),c.push(0,1,0);const h=je.getKeyframeOrder(l);l=je.sortedArray(l,1,h),c=je.sortedArray(c,1,h),!i&&l[0]===0&&(l.push(r),c.push(c[0])),o.push(new Xr(".morphTargetInfluences["+t[a].name+"]",l,c).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const c=e[a],h=c.name.match(r);if(h&&h.length>1){const u=h[1];let d=i[u];d||(i[u]=d=[]),d.push(c)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(u,d,f,g,p){if(f.length!==0){const m=[],x=[];je.flattenJSON(f,m,x,g),m.length!==0&&p.push(new u(d,m,x))}},i=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let u=0;u<c.length;u++){const d=c[u].keys;if(!(!d||d.length===0))if(d[0].morphTargets){const f={};let g;for(g=0;g<d.length;g++)if(d[g].morphTargets)for(let p=0;p<d[g].morphTargets.length;p++)f[d[g].morphTargets[p]]=-1;for(const p in f){const m=[],x=[];for(let y=0;y!==d[g].morphTargets.length;++y){const M=d[g];m.push(M.time),x.push(M.morphTarget===p?1:0)}i.push(new Xr(".morphTargetInfluence["+p+"]",m,x))}l=f.length*o}else{const f=".bones["+t[u].name+"]";n(Jr,f+".position",d,"pos",i),n(gr,f+".quaternion",d,"rot",i),n(Jr,f+".scale",d,"scl",i)}}return i.length===0?null:new this(r,l,i,a)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function U0(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Xr;case"vector":case"vector2":case"vector3":case"vector4":return Jr;case"color":return Cl;case"quaternion":return gr;case"bool":case"boolean":return Si;case"string":return Ei}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function O0(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=U0(s.type);if(s.times===void 0){const t=[],n=[];je.flattenJSON(s.keys,t,n,"value"),s.times=t,s.values=n}return e.parse!==void 0?e.parse(s):new e(s.name,s.times,s.values,s.interpolation)}const _i={enabled:!1,files:{},add:function(s,e){this.enabled!==!1&&(this.files[s]=e)},get:function(s){if(this.enabled!==!1)return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};class Rl{constructor(e,t,n){const i=this;let r=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(h){a++,r===!1&&i.onStart!==void 0&&i.onStart(h,o,a),r=!0},this.itemEnd=function(h){o++,i.onProgress!==void 0&&i.onProgress(h,o,a),o===a&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,u){return c.push(h,u),this},this.removeHandler=function(h){const u=c.indexOf(h);return u!==-1&&c.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=c.length;u<d;u+=2){const f=c[u],g=c[u+1];if(f.global&&(f.lastIndex=0),f.test(h))return g}return null}}}const Ku=new Rl;class Tt{constructor(e){this.manager=e!==void 0?e:Ku,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,r){n.load(e,i,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const dn={};class on extends Tt{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=_i.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if(dn[e]!==void 0){dn[e].push({onLoad:t,onProgress:n,onError:i});return}dn[e]=[],dn[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const h=dn[e],u=c.body.getReader(),d=c.headers.get("Content-Length"),f=d?parseInt(d):0,g=f!==0;let p=0;const m=new ReadableStream({start(x){y();function y(){u.read().then(({done:M,value:_})=>{if(M)x.close();else{p+=_.byteLength;const b=new ProgressEvent("progress",{lengthComputable:g,loaded:p,total:f});for(let A=0,R=h.length;A<R;A++){const P=h[A];P.onProgress&&P.onProgress(b)}x.enqueue(_),y()}})}}});return new Response(m)}else throw Error(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return c.json();default:if(a===void 0)return c.text();{const u=/charset="?([^;"\s]*)"?/i.exec(a),d=u&&u[1]?u[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(g=>f.decode(g))}}}).then(c=>{_i.add(e,c);const h=dn[e];delete dn[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onLoad&&f.onLoad(c)}}).catch(c=>{const h=dn[e];if(h===void 0)throw this.manager.itemError(e),c;delete dn[e];for(let u=0,d=h.length;u<d;u++){const f=h[u];f.onError&&f.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class H0 extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new on(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=Yr.parse(e[n]);t.push(i)}return t}}class G0 extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=[],a=new hl,l=new on(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(r.withCredentials);let c=0;function h(u){l.load(e[u],function(d){const f=r.parse(d,!0);o[u]={width:f.width,height:f.height,format:f.format,mipmaps:f.mipmaps},c+=1,c===6&&(f.mipmapCount===1&&(a.minFilter=it),a.image=o,a.format=f.format,a.needsUpdate=!0,t&&t(a))},n,i)}if(Array.isArray(e))for(let u=0,d=e.length;u<d;++u)h(u);else l.load(e,function(u){const d=r.parse(u,!0);if(d.isCubemap){const f=d.mipmaps.length/d.mipmapCount;for(let g=0;g<f;g++){o[g]={mipmaps:[]};for(let p=0;p<d.mipmapCount;p++)o[g].mipmaps.push(d.mipmaps[g*d.mipmapCount+p]),o[g].format=d.format,o[g].width=d.width,o[g].height=d.height}a.image=o}else a.image.width=d.width,a.image.height=d.height,a.mipmaps=d.mipmaps;d.mipmapCount===1&&(a.minFilter=it),a.format=d.format,a.needsUpdate=!0,t&&t(a)},n,i);return a}}class Zr extends Tt{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=_i.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a=kr("img");function l(){h(),_i.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(u){h(),i&&i(u),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class Qu extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=new pr,o=new Zr(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(c){o.load(e[c],function(h){r.images[c]=h,a++,a===6&&(r.needsUpdate=!0,t&&t(r))},void 0,i)}for(let c=0;c<e.length;++c)l(c);return r}}class ed extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new ci,a=new on(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(r.withCredentials),a.load(e,function(l){const c=r.parse(l);c&&(c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:wt,o.wrapT=c.wrapT!==void 0?c.wrapT:wt,o.magFilter=c.magFilter!==void 0?c.magFilter:it,o.minFilter=c.minFilter!==void 0?c.minFilter:it,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.encoding!==void 0&&(o.encoding=c.encoding),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=vi),c.mipmapCount===1&&(o.minFilter=it),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c))},n,i),o}}class td extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=new ut,o=new Zr(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,t!==void 0&&t(r)},n,i),r}}class qt extends Ne{constructor(e,t=1){super(),this.type="Light",this.color=new ae(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}qt.prototype.isLight=!0;class Ll extends qt{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(Ne.DefaultUp),this.updateMatrix(),this.groundColor=new ae(t)}copy(e){return qt.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Ll.prototype.isHemisphereLight=!0;const Yc=new fe,Zc=new S,$c=new S;class Pl{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Z(512,512),this.map=null,this.mapPass=null,this.matrix=new fe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Qr,this._frameExtents=new Z(1,1),this._viewportCount=1,this._viewports=[new qe(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Zc.setFromMatrixPosition(e.matrixWorld),t.position.copy(Zc),$c.setFromMatrixPosition(e.target.matrixWorld),t.lookAt($c),t.updateMatrixWorld(),Yc.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Yc),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class nd extends Pl{constructor(){super(new mt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=Gr*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;(n!==t.fov||i!==t.aspect||r!==t.far)&&(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}nd.prototype.isSpotLightShadow=!0;class Il extends qt{constructor(e,t,n=0,i=Math.PI/3,r=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(Ne.DefaultUp),this.updateMatrix(),this.target=new Ne,this.distance=n,this.angle=i,this.penumbra=r,this.decay=o,this.shadow=new nd}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Il.prototype.isSpotLight=!0;const jc=new fe,Cr=new S,pa=new S;class id extends Pl{constructor(){super(new mt(90,1,.5,500)),this._frameExtents=new Z(4,2),this._viewportCount=6,this._viewports=[new qe(2,1,1,1),new qe(0,1,1,1),new qe(3,1,1,1),new qe(1,1,1,1),new qe(3,0,1,1),new qe(1,0,1,1)],this._cubeDirections=[new S(1,0,0),new S(-1,0,0),new S(0,0,1),new S(0,0,-1),new S(0,1,0),new S(0,-1,0)],this._cubeUps=[new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,1,0),new S(0,0,1),new S(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,r=e.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),Cr.setFromMatrixPosition(e.matrixWorld),n.position.copy(Cr),pa.copy(n.position),pa.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(pa),n.updateMatrixWorld(),i.makeTranslation(-Cr.x,-Cr.y,-Cr.z),jc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(jc)}}id.prototype.isPointLightShadow=!0;class Dl extends qt{constructor(e,t,n=0,i=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new id}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Dl.prototype.isPointLight=!0;class rd extends Pl{constructor(){super(new es(-5,5,5,-5,.5,500))}}rd.prototype.isDirectionalLightShadow=!0;class Fl extends qt{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Ne.DefaultUp),this.updateMatrix(),this.target=new Ne,this.shadow=new rd}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Fl.prototype.isDirectionalLight=!0;class Bl extends qt{constructor(e,t){super(e,t),this.type="AmbientLight"}}Bl.prototype.isAmbientLight=!0;class Nl extends qt{constructor(e,t,n=10,i=10){super(e,t),this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Nl.prototype.isRectAreaLight=!0;class zl{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new S)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,i=e.y,r=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*i),t.addScaledVector(o[2],.488603*r),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],1.092548*(n*i)),t.addScaledVector(o[5],1.092548*(i*r)),t.addScaledVector(o[6],.315392*(3*r*r-1)),t.addScaledVector(o[7],1.092548*(n*r)),t.addScaledVector(o[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,r=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*i),t.addScaledVector(o[2],2*.511664*r),t.addScaledVector(o[3],2*.511664*n),t.addScaledVector(o[4],2*.429043*n*i),t.addScaledVector(o[5],2*.429043*i*r),t.addScaledVector(o[6],.743125*r*r-.247708),t.addScaledVector(o[7],2*.429043*n*r),t.addScaledVector(o[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+i*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+i*3);return e}static getBasisAt(e,t){const n=e.x,i=e.y,r=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*r,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*n*r,t[8]=.546274*(n*n-i*i)}}zl.prototype.isSphericalHarmonics3=!0;class os extends qt{constructor(e=new zl,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}os.prototype.isLightProbe=!0;class sd extends Tt{constructor(e){super(e),this.textures={}}load(e,t,n,i){const r=this,o=new on(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}parse(e){const t=this.textures;function n(r){return t[r]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",r),t[r]}const i=ot.fromType(e.type);if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=e.sheen),e.sheenColor!==void 0&&(i.sheenColor=new ae().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==1&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const o=e.uniforms[r];switch(i.uniforms[r]={},o.type){case"t":i.uniforms[r].value=n(o.value);break;case"c":i.uniforms[r].value=new ae().setHex(o.value);break;case"v2":i.uniforms[r].value=new Z().fromArray(o.value);break;case"v3":i.uniforms[r].value=new S().fromArray(o.value);break;case"v4":i.uniforms[r].value=new qe().fromArray(o.value);break;case"m3":i.uniforms[r].value=new ft().fromArray(o.value);break;case"m4":i.uniforms[r].value=new fe().fromArray(o.value);break;default:i.uniforms[r].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.extensions!==void 0)for(const r in e.extensions)i.extensions[r]=e.extensions[r];if(e.shading!==void 0&&(i.flatShading=e.shading===1),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),i.normalScale=new Z().fromArray(r)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Z().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}}class ao{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class Ul extends ye{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}Ul.prototype.isInstancedBufferGeometry=!0;class od extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new on(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}parse(e){const t={},n={};function i(f,g){if(t[g]!==void 0)return t[g];const m=f.interleavedBuffers[g],x=r(f,m.buffer),y=Yi(m.type,x),M=new bi(y,m.stride);return M.uuid=m.uuid,t[g]=M,M}function r(f,g){if(n[g]!==void 0)return n[g];const m=f.arrayBuffers[g],x=new Uint32Array(m).buffer;return n[g]=x,x}const o=e.isInstancedBufferGeometry?new Ul:new ye,a=e.data.index;if(a!==void 0){const f=Yi(a.type,a.array);o.setIndex(new Oe(f,1))}const l=e.data.attributes;for(const f in l){const g=l[f];let p;if(g.isInterleavedBufferAttribute){const m=i(e.data,g.data);p=new Fn(m,g.itemSize,g.offset,g.normalized)}else{const m=Yi(g.type,g.array),x=g.isInstancedBufferAttribute?pi:Oe;p=new x(m,g.itemSize,g.normalized)}g.name!==void 0&&(p.name=g.name),g.usage!==void 0&&p.setUsage(g.usage),g.updateRange!==void 0&&(p.updateRange.offset=g.updateRange.offset,p.updateRange.count=g.updateRange.count),o.setAttribute(f,p)}const c=e.data.morphAttributes;if(c)for(const f in c){const g=c[f],p=[];for(let m=0,x=g.length;m<x;m++){const y=g[m];let M;if(y.isInterleavedBufferAttribute){const _=i(e.data,y.data);M=new Fn(_,y.itemSize,y.offset,y.normalized)}else{const _=Yi(y.type,y.array);M=new Oe(_,y.itemSize,y.normalized)}y.name!==void 0&&(M.name=y.name),p.push(M)}o.morphAttributes[f]=p}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const u=e.data.groups||e.data.drawcalls||e.data.offsets;if(u!==void 0)for(let f=0,g=u.length;f!==g;++f){const p=u[f];o.addGroup(p.start,p.count,p.materialIndex)}const d=e.data.boundingSphere;if(d!==void 0){const f=new S;d.center!==void 0&&f.fromArray(d.center),o.boundingSphere=new On(f,d.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class k0 extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=this.path===""?ao.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new on(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){let c=null;try{c=JSON.parse(l)}catch(u){i!==void 0&&i(u),console.error("THREE:ObjectLoader: Can't parse "+e+".",u.message);return}const h=c.metadata;if(h===void 0||h.type===void 0||h.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}r.parse(c,t)},n,i)}async loadAsync(e,t){const n=this,i=this.path===""?ao.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const r=new on(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const o=await r.loadAsync(e,t),a=JSON.parse(o),l=a.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await n.parseAsync(a)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),a=this.parseTextures(e.textures,o),l=this.parseMaterials(e.materials,a),c=this.parseObject(e.object,r,l,a,n),h=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,h),t!==void 0){let u=!1;for(const d in o)if(o[d]instanceof HTMLImageElement){u=!0;break}u===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),r=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,r),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,i,a,o,t),c=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,c),l}parseShapes(e){const t={};if(e!==void 0)for(let n=0,i=e.length;n<i;n++){const r=new en().fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse(function(r){r.isBone&&(i[r.uuid]=r)}),e!==void 0)for(let r=0,o=e.length;r<o;r++){const a=new Eo().fromJSON(e[r],i);n[a.uuid]=a}return n}parseGeometries(e,t){const n={};if(e!==void 0){const i=new od;for(let r=0,o=e.length;r<o;r++){let a;const l=e[r];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(l);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:l.type in Jc?a=Jc[l.type].fromJSON(l,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),a.isBufferGeometry===!0&&l.userData!==void 0&&(a.userData=l.userData),n[l.uuid]=a}}return n}parseMaterials(e,t){const n={},i={};if(e!==void 0){const r=new sd;r.setTextures(t);for(let o=0,a=e.length;o<a;o++){const l=e[o];if(l.type==="MultiMaterial"){const c=[];for(let h=0;h<l.materials.length;h++){const u=l.materials[h];n[u.uuid]===void 0&&(n[u.uuid]=r.parse(u)),c.push(n[u.uuid])}i[l.uuid]=c}else n[l.uuid]===void 0&&(n[l.uuid]=r.parse(l)),i[l.uuid]=n[l.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const i=e[n],r=Yr.parse(i);t[r.uuid]=r}return t}parseImages(e,t){const n=this,i={};let r;function o(l){return n.manager.itemStart(l),r.load(l,function(){n.manager.itemEnd(l)},void 0,function(){n.manager.itemError(l),n.manager.itemEnd(l)})}function a(l){if(typeof l=="string"){const c=l,h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:n.resourcePath+c;return o(h)}else return l.data?{data:Yi(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new Rl(t);r=new Zr(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,h=e.length;c<h;c++){const u=e[c],d=u.url;if(Array.isArray(d)){const f=[];for(let g=0,p=d.length;g<p;g++){const m=d[g],x=a(m);x!==null&&(x instanceof HTMLImageElement?f.push(x):f.push(new ci(x.data,x.width,x.height)))}i[u.uuid]=new ni(f)}else{const f=a(u.url);i[u.uuid]=new ni(f)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function r(o){if(typeof o=="string"){const a=o,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await i.loadAsync(l)}else return o.data?{data:Yi(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){i=new Zr(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const l=e[o],c=l.url;if(Array.isArray(c)){const h=[];for(let u=0,d=c.length;u<d;u++){const f=c[u],g=await r(f);g!==null&&(g instanceof HTMLImageElement?h.push(g):h.push(new ci(g.data,g.width,g.height)))}n[l.uuid]=new ni(h)}else{const h=await r(l.url);n[l.uuid]=new ni(h)}}}return n}parseTextures(e,t){function n(r,o){return typeof r=="number"?r:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",r),o[r])}const i={};if(e!==void 0)for(let r=0,o=e.length;r<o;r++){const a=e[r];a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const l=t[a.image],c=l.data;let h;Array.isArray(c)?(h=new pr,c.length===6&&(h.needsUpdate=!0)):(c&&c.data?h=new ci:h=new ut,c&&(h.needsUpdate=!0)),h.source=l,h.uuid=a.uuid,a.name!==void 0&&(h.name=a.name),a.mapping!==void 0&&(h.mapping=n(a.mapping,V0)),a.offset!==void 0&&h.offset.fromArray(a.offset),a.repeat!==void 0&&h.repeat.fromArray(a.repeat),a.center!==void 0&&h.center.fromArray(a.center),a.rotation!==void 0&&(h.rotation=a.rotation),a.wrap!==void 0&&(h.wrapS=n(a.wrap[0],Kc),h.wrapT=n(a.wrap[1],Kc)),a.format!==void 0&&(h.format=a.format),a.type!==void 0&&(h.type=a.type),a.encoding!==void 0&&(h.encoding=a.encoding),a.minFilter!==void 0&&(h.minFilter=n(a.minFilter,Qc)),a.magFilter!==void 0&&(h.magFilter=n(a.magFilter,Qc)),a.anisotropy!==void 0&&(h.anisotropy=a.anisotropy),a.flipY!==void 0&&(h.flipY=a.flipY),a.premultiplyAlpha!==void 0&&(h.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(h.unpackAlignment=a.unpackAlignment),a.userData!==void 0&&(h.userData=a.userData),i[a.uuid]=h}return i}parseObject(e,t,n,i,r){let o;function a(d){return t[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",d),t[d]}function l(d){if(d!==void 0){if(Array.isArray(d)){const f=[];for(let g=0,p=d.length;g<p;g++){const m=d[g];n[m]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",m),f.push(n[m])}return f}return n[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",d),n[d]}}function c(d){return i[d]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",d),i[d]}let h,u;switch(e.type){case"Scene":o=new vo,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new ae(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new ns(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new ts(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new mt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new es(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new Bl(e.color,e.intensity);break;case"DirectionalLight":o=new Fl(e.color,e.intensity);break;case"PointLight":o=new Dl(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new Nl(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new Il(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new Ll(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new os().fromJSON(e);break;case"SkinnedMesh":h=a(e.geometry),u=l(e.material),o=new wo(h,u),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":h=a(e.geometry),u=l(e.material),o=new ht(h,u);break;case"InstancedMesh":h=a(e.geometry),u=l(e.material);const d=e.count,f=e.instanceMatrix,g=e.instanceColor;o=new ll(h,u,d),o.instanceMatrix=new pi(new Float32Array(f.array),16),g!==void 0&&(o.instanceColor=new pi(new Float32Array(g.array),g.itemSize));break;case"LOD":o=new Hu;break;case"Line":o=new gn(a(e.geometry),l(e.material));break;case"LineLoop":o=new cl(a(e.geometry),l(e.material));break;case"LineSegments":o=new At(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new is(a(e.geometry),l(e.material));break;case"Sprite":o=new bo(l(e.material));break;case"Group":o=new ii;break;case"Bone":o=new So;break;default:o=new Ne}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let f=0;f<d.length;f++)o.add(this.parseObject(d[f],t,n,i,r))}if(e.animations!==void 0){const d=e.animations;for(let f=0;f<d.length;f++){const g=d[f];o.animations.push(r[g])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const d=e.levels;for(let f=0;f<d.length;f++){const g=d[f],p=o.getObjectByProperty("uuid",g.object);p!==void 0&&o.addLevel(p,g.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const i=t[n.skeleton];i===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(i,n.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const V0={UVMapping:co,CubeReflectionMapping:Pn,CubeRefractionMapping:In,EquirectangularReflectionMapping:Fr,EquirectangularRefractionMapping:Br,CubeUVReflectionMapping:dr},Kc={RepeatWrapping:Nr,ClampToEdgeWrapping:wt,MirroredRepeatWrapping:zr},Qc={NearestFilter:ct,NearestMipmapNearestFilter:io,NearestMipmapLinearFilter:ro,LinearFilter:it,LinearMipmapNearestFilter:nl,LinearMipmapLinearFilter:vi};class ad extends Tt{constructor(e){super(e),typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=_i.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(l){_i.add(e,l),t&&t(l),r.manager.itemEnd(e)}).catch(function(l){i&&i(l),r.manager.itemError(e),r.manager.itemEnd(e)}),r.manager.itemStart(e)}}ad.prototype.isImageBitmapLoader=!0;let ks;const Ol={getContext:function(){return ks===void 0&&(ks=new(window.AudioContext||window.webkitAudioContext)),ks},setContext:function(s){ks=s}};class ld extends Tt{constructor(e){super(e)}load(e,t,n,i){const r=this,o=new on(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{const l=a.slice(0);Ol.getContext().decodeAudioData(l,function(h){t(h)})}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}}class cd extends os{constructor(e,t,n=1){super(void 0,n);const i=new ae().set(e),r=new ae().set(t),o=new S(i.r,i.g,i.b),a=new S(r.r,r.g,r.b),l=Math.sqrt(Math.PI),c=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}}cd.prototype.isHemisphereLightProbe=!0;class hd extends os{constructor(e,t=1){super(void 0,t);const n=new ae().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}hd.prototype.isAmbientLightProbe=!0;const eh=new fe,th=new fe,Xn=new fe;class W0{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new mt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new mt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Xn.copy(e.projectionMatrix);const i=t.eyeSep/2,r=i*t.near/t.focus,o=t.near*Math.tan(ai*t.fov*.5)/t.zoom;let a,l;th.elements[12]=-i,eh.elements[12]=i,a=-o*t.aspect+r,l=o*t.aspect+r,Xn.elements[0]=2*t.near/(l-a),Xn.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Xn),a=-o*t.aspect-r,l=o*t.aspect-r,Xn.elements[0]=2*t.near/(l-a),Xn.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Xn)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(th),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(eh)}}class ud{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=nh(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=nh();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function nh(){return(typeof performance>"u"?Date:performance).now()}const Jn=new S,ih=new yt,q0=new S,Yn=new S;class X0 extends Ne{constructor(){super(),this.type="AudioListener",this.context=Ol.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ud}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Jn,ih,q0),Yn.set(0,0,-1).applyQuaternion(ih),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Jn.x,i),t.positionY.linearRampToValueAtTime(Jn.y,i),t.positionZ.linearRampToValueAtTime(Jn.z,i),t.forwardX.linearRampToValueAtTime(Yn.x,i),t.forwardY.linearRampToValueAtTime(Yn.y,i),t.forwardZ.linearRampToValueAtTime(Yn.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(Jn.x,Jn.y,Jn.z),t.setOrientation(Yn.x,Yn.y,Yn.z,n.x,n.y,n.z)}}class Hl extends Ne{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Zn=new S,rh=new yt,J0=new S,$n=new S;class Y0 extends Hl{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Zn,rh,J0),$n.set(0,0,1).applyQuaternion(rh);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Zn.x,n),t.positionY.linearRampToValueAtTime(Zn.y,n),t.positionZ.linearRampToValueAtTime(Zn.z,n),t.orientationX.linearRampToValueAtTime($n.x,n),t.orientationY.linearRampToValueAtTime($n.y,n),t.orientationZ.linearRampToValueAtTime($n.z,n)}else t.setPosition(Zn.x,Zn.y,Zn.z),t.setOrientation($n.x,$n.y,$n.z)}}class dd{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class fd{constructor(e,t,n){this.binding=e,this.valueSize=n;let i,r,o;switch(t){case"quaternion":i=this._slerp,r=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":i=this._select,r=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:i=this._lerp,r=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=r,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,i=this.valueSize,r=e*i+i;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==i;++a)n[r+a]=n[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(n,r,0,a,i)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,r=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const l=t*this._origIndex;this._mixBufferRegion(n,i,l,1-r,t)}o>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let r=n,o=i;r!==o;++r)t[r]=t[i+r%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,r){if(i>=.5)for(let o=0;o!==r;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){yt.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,r){const o=this._workIndex*r;yt.multiplyQuaternionsFlat(e,o,e,t,e,n),yt.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,r){const o=1-i;for(let a=0;a!==r;++a){const l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,r){for(let o=0;o!==r;++o){const a=t+o;e[a]=e[a]+e[n+o]*i}}}const Gl="\\[\\]\\.:\\/",Z0=new RegExp("["+Gl+"]","g"),kl="[^"+Gl+"]",$0="[^"+Gl.replace("\\.","")+"]",j0=/((?:WC+[\/:])*)/.source.replace("WC",kl),K0=/(WCOD+)?/.source.replace("WCOD",$0),Q0=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",kl),ey=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",kl),ty=new RegExp("^"+j0+K0+Q0+ey+"$"),ny=["material","materials","bones"];class iy{constructor(e,t,n){const i=n||Ge.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Ge{constructor(e,t,n){this.path=t,this.parsedPath=n||Ge.parseTrackName(t),this.node=Ge.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Ge.Composite(e,t,n):new Ge(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Z0,"")}static parseTrackName(e){const t=ty.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const r=n.nodeName.substring(i+1);ny.indexOf(r)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(r){for(let o=0;o<r.length;o++){const a=r[o];if(a.name===t||a.uuid===t)return a;const l=n(a.children);if(l)return l}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let r=t.propertyIndex;if(e||(e=Ge.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(n){let c=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let h=0;h<e.length;h++)if(e[h].name===c){c=h;break}break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const o=e[i];if(o===void 0){const c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(r!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[r]!==void 0&&(r=e.morphTargetDictionary[r])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ge.Composite=iy;Ge.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Ge.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Ge.prototype.GetterByBindingType=[Ge.prototype._getValue_direct,Ge.prototype._getValue_array,Ge.prototype._getValue_arrayElement,Ge.prototype._getValue_toArray];Ge.prototype.SetterByBindingTypeAndVersioning=[[Ge.prototype._setValue_direct,Ge.prototype._setValue_direct_setNeedsUpdate,Ge.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ge.prototype._setValue_array,Ge.prototype._setValue_array_setNeedsUpdate,Ge.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ge.prototype._setValue_arrayElement,Ge.prototype._setValue_arrayElement_setNeedsUpdate,Ge.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ge.prototype._setValue_fromArray,Ge.prototype._setValue_fromArray_setNeedsUpdate,Ge.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class pd{constructor(){this.uuid=It(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,i=arguments.length;n!==i;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,r=this._bindings,o=r.length;let a,l=e.length,c=this.nCachedObjects_;for(let h=0,u=arguments.length;h!==u;++h){const d=arguments[h],f=d.uuid;let g=t[f];if(g===void 0){g=l++,t[f]=g,e.push(d);for(let p=0,m=o;p!==m;++p)r[p].push(new Ge(d,n[p],i[p]))}else if(g<c){a=e[g];const p=--c,m=e[p];t[m.uuid]=g,e[g]=m,t[f]=p,e[p]=d;for(let x=0,y=o;x!==y;++x){const M=r[x],_=M[p];let b=M[g];M[g]=_,b===void 0&&(b=new Ge(d,n[x],i[x])),M[p]=b}}else e[g]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const l=arguments[o],c=l.uuid,h=t[c];if(h!==void 0&&h>=r){const u=r++,d=e[u];t[d.uuid]=h,e[h]=d,t[c]=u,e[u]=l;for(let f=0,g=i;f!==g;++f){const p=n[f],m=p[u],x=p[h];p[h]=m,p[u]=x}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],h=c.uuid,u=t[h];if(u!==void 0)if(delete t[h],u<r){const d=--r,f=e[d],g=--o,p=e[g];t[f.uuid]=u,e[u]=f,t[p.uuid]=d,e[d]=p,e.pop();for(let m=0,x=i;m!==x;++m){const y=n[m],M=y[d],_=y[g];y[u]=M,y[d]=_,y.pop()}}else{const d=--o,f=e[d];d>0&&(t[f.uuid]=u),e[u]=f,e.pop();for(let g=0,p=i;g!==p;++g){const m=n[g];m[u]=m[d],m.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const r=this._bindings;if(i!==void 0)return r[i];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,h=this.nCachedObjects_,u=new Array(c);i=r.length,n[e]=i,o.push(e),a.push(t),r.push(u);for(let d=h,f=l.length;d!==f;++d){const g=l[d];u[d]=new Ge(g,e,t)}return u}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}}pd.prototype.isAnimationObjectGroup=!0;class ry{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const r=t.tracks,o=r.length,a=new Array(o),l={endingStart:ei,endingEnd:ei};for(let c=0;c!==o;++c){const h=r[c].createInterpolant(null);a[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=au,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,r=e._clip.duration,o=r/i,a=i/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,r=i.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=r,l[1]=r+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const l=(e-r)*n;if(l<0||n===0)return;this._startTime=null,t=n*l}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case il:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(o),c[h].accumulateAdditive(a);break;case ho:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(o),c[h].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,r=this._loopCount;const o=n===lu;if(e===0)return r===-1?i:o&&(r&1)===1?t-i:i;if(n===ou){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,r+=Math.abs(a);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(r&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=ti,i.endingEnd=ti):(e?i.endingStart=this.zeroSlopeAtStart?ti:ei:i.endingStart=Hr,t?i.endingEnd=this.zeroSlopeAtEnd?ti:ei:i.endingEnd=Hr)}_scheduleFading(e,t,n){const i=this._mixer,r=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,l[0]=t,a[1]=r+e,l[1]=n,this}}class md extends zn{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName;let h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==r;++u){const d=i[u],f=d.name;let g=h[f];if(g!==void 0)++g.referenceCount,o[u]=g;else{if(g=o[u],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,f));continue}const p=t&&t._propertyBindings[u].binding.parsedPath;g=new fd(Ge.create(n,f,p),d.ValueTypeName,d.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,f),o[u]=g}a[u].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,r=this._actionsByClip[i];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const r=t[n];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const r=t[n];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const i=this._actions,r=this._actionsByClip;let o=r[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=i.length,i.push(e),o.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const r=e._clip.uuid,o=this._actionsByClip,a=o[r],l=a.knownActions,c=l[l.length-1],h=e._byClipCacheIndex;c._byClipCacheIndex=h,l[h]=c,l.pop(),e._byClipCacheIndex=null;const u=a.actionByRoot,d=(e._localRoot||this._root).uuid;delete u[d],l.length===0&&delete o[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const r=t[n];--r.referenceCount===0&&this._removeInactiveBinding(r)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,r=this._bindings;let o=i[t];o===void 0&&(o={},i[t]=o),o[n]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,a=o[i],l=t[t.length-1],c=e._cacheIndex;l._cacheIndex=c,t[c]=l,t.pop(),delete a[r],Object.keys(a).length===0&&delete o[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new Al(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,r=t[i];e.__cacheIndex=i,t[i]=e,r.__cacheIndex=n,t[n]=r}clipAction(e,t,n){const i=t||this._root,r=i.uuid;let o=typeof e=="string"?Yr.findByName(i,e):e;const a=o!==null?o.uuid:e,l=this._actionsByClip[a];let c=null;if(n===void 0&&(o!==null?n=o.blendMode:n=ho),l!==void 0){const u=l.actionByRoot[r];if(u!==void 0&&u.blendMode===n)return u;c=l.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;const h=new ry(this,o,t,n);return this._bindAction(h,c),this._addInactiveAction(h,a,r),h}existingAction(e,t){const n=t||this._root,i=n.uuid,r=typeof e=="string"?Yr.findByName(n,e):e,o=r?r.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[i]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,r,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,i=this._actionsByClip,r=i[n];if(r!==void 0){const o=r.knownActions;for(let a=0,l=o.length;a!==l;++a){const c=o[a];this._deactivateAction(c);const h=c._cacheIndex,u=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=h,t[h]=u,t.pop(),this._removeInactiveBindingsForAction(c)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const o in n){const a=n[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const i=this._bindingsByRootAndName,r=i[t];if(r!==void 0)for(const o in r){const a=r[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}md.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Io{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Io(this.value.clone===void 0?this.value:this.value.clone())}}class gd extends bi{constructor(e,t,n=1){super(e,t),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}gd.prototype.isInstancedInterleavedBuffer=!0;class xd{constructor(e,t,n,i,r){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,this.count=r,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}xd.prototype.isGLBufferAttribute=!0;class sy{constructor(e,t,n=0,i=1/0){this.ray=new Hn(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new uo,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return ja(e,this,n,t),n.sort(sh),n}intersectObjects(e,t=!0,n=[]){for(let i=0,r=e.length;i<r;i++)ja(e[i],this,n,t);return n.sort(sh),n}}function sh(s,e){return s.distance-e.distance}function ja(s,e,t,n){if(s.layers.test(e.layers)&&s.raycast(e,t),n===!0){const i=s.children;for(let r=0,o=i.length;r<o;r++)ja(i[r],e,t,!0)}}class oy{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(rt(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class ay{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}const oh=new Z;class xr{constructor(e=new Z(1/0,1/0),t=new Z(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=oh.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return oh.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}xr.prototype.isBox2=!0;const ah=new S,Vs=new S;class yd{constructor(e=new S,t=new S){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){ah.subVectors(e,this.start),Vs.subVectors(this.end,this.start);const n=Vs.dot(Vs);let r=Vs.dot(ah)/n;return t&&(r=rt(r,0,1)),r}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const lh=new S;class ly extends Ne{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new ye,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o<l;o++,a++){const c=o/l*Math.PI*2,h=a/l*Math.PI*2;i.push(Math.cos(c),Math.sin(c),1,Math.cos(h),Math.sin(h),1)}n.setAttribute("position",new de(i,3));const r=new gt({fog:!1,toneMapped:!1});this.cone=new At(n,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),lh.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(lh),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const An=new S,Ws=new fe,ma=new fe;class _d extends At{constructor(e){const t=vd(e),n=new ye,i=[],r=[],o=new ae(0,0,1),a=new ae(0,1,0);for(let c=0;c<t.length;c++){const h=t[c];h.parent&&h.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(a.r,a.g,a.b))}n.setAttribute("position",new de(i,3)),n.setAttribute("color",new de(r,3));const l=new gt({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,l),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,i=n.getAttribute("position");ma.copy(this.root.matrixWorld).invert();for(let r=0,o=0;r<t.length;r++){const a=t[r];a.parent&&a.parent.isBone&&(Ws.multiplyMatrices(ma,a.matrixWorld),An.setFromMatrixPosition(Ws),i.setXYZ(o,An.x,An.y,An.z),Ws.multiplyMatrices(ma,a.parent.matrixWorld),An.setFromMatrixPosition(Ws),i.setXYZ(o+1,An.x,An.y,An.z),o+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function vd(s){const e=[];s.isBone===!0&&e.push(s);for(let t=0;t<s.children.length;t++)e.push.apply(e,vd(s.children[t]));return e}class cy extends ht{constructor(e,t,n){const i=new yi(t,4,2),r=new yn({wireframe:!0,fog:!1,toneMapped:!1});super(i,r),this.light=e,this.light.updateMatrixWorld(),this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const hy=new S,ch=new ae,hh=new ae;class uy extends Ne{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const i=new gi(t);i.rotateY(Math.PI*.5),this.material=new yn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const r=i.getAttribute("position"),o=new Float32Array(r.count*3);i.setAttribute("color",new Oe(o,3)),this.add(new ht(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");ch.copy(this.light.color),hh.copy(this.light.groundColor);for(let n=0,i=t.count;n<i;n++){const r=n<i/2?ch:hh;t.setXYZ(n,r.r,r.g,r.b)}t.needsUpdate=!0}e.lookAt(hy.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Md extends At{constructor(e=10,t=10,n=4473924,i=8947848){n=new ae(n),i=new ae(i);const r=t/2,o=e/t,a=e/2,l=[],c=[];for(let d=0,f=0,g=-a;d<=t;d++,g+=o){l.push(-a,0,g,a,0,g),l.push(g,0,-a,g,0,a);const p=d===r?n:i;p.toArray(c,f),f+=3,p.toArray(c,f),f+=3,p.toArray(c,f),f+=3,p.toArray(c,f),f+=3}const h=new ye;h.setAttribute("position",new de(l,3)),h.setAttribute("color",new de(c,3));const u=new gt({vertexColors:!0,toneMapped:!1});super(h,u),this.type="GridHelper"}}class dy extends At{constructor(e=10,t=16,n=8,i=64,r=4473924,o=8947848){r=new ae(r),o=new ae(o);const a=[],l=[];for(let u=0;u<=t;u++){const d=u/t*(Math.PI*2),f=Math.sin(d)*e,g=Math.cos(d)*e;a.push(0,0,0),a.push(f,0,g);const p=u&1?r:o;l.push(p.r,p.g,p.b),l.push(p.r,p.g,p.b)}for(let u=0;u<=n;u++){const d=u&1?r:o,f=e-e/n*u;for(let g=0;g<i;g++){let p=g/i*(Math.PI*2),m=Math.sin(p)*f,x=Math.cos(p)*f;a.push(m,0,x),l.push(d.r,d.g,d.b),p=(g+1)/i*(Math.PI*2),m=Math.sin(p)*f,x=Math.cos(p)*f,a.push(m,0,x),l.push(d.r,d.g,d.b)}}const c=new ye;c.setAttribute("position",new de(a,3)),c.setAttribute("color",new de(l,3));const h=new gt({vertexColors:!0,toneMapped:!1});super(c,h),this.type="PolarGridHelper"}}const uh=new S,qs=new S,dh=new S;class fy extends Ne{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,t===void 0&&(t=1);let i=new ye;i.setAttribute("position",new de([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const r=new gt({fog:!1,toneMapped:!1});this.lightPlane=new gn(i,r),this.add(this.lightPlane),i=new ye,i.setAttribute("position",new de([0,0,0,0,0,1],3)),this.targetLine=new gn(i,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){uh.setFromMatrixPosition(this.light.matrixWorld),qs.setFromMatrixPosition(this.light.target.matrixWorld),dh.subVectors(qs,uh),this.lightPlane.lookAt(qs),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(qs),this.targetLine.scale.z=dh.length()}}const Xs=new S,tt=new Kr;class py extends At{constructor(e){const t=new ye,n=new gt({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],o={},a=new ae(16755200),l=new ae(16711680),c=new ae(43775),h=new ae(16777215),u=new ae(3355443);d("n1","n2",a),d("n2","n4",a),d("n4","n3",a),d("n3","n1",a),d("f1","f2",a),d("f2","f4",a),d("f4","f3",a),d("f3","f1",a),d("n1","f1",a),d("n2","f2",a),d("n3","f3",a),d("n4","f4",a),d("p","n1",l),d("p","n2",l),d("p","n3",l),d("p","n4",l),d("u1","u2",c),d("u2","u3",c),d("u3","u1",c),d("c","t",h),d("p","c",u),d("cn1","cn2",u),d("cn3","cn4",u),d("cf1","cf2",u),d("cf3","cf4",u);function d(g,p,m){f(g,m),f(p,m)}function f(g,p){i.push(0,0,0),r.push(p.r,p.g,p.b),o[g]===void 0&&(o[g]=[]),o[g].push(i.length/3-1)}t.setAttribute("position",new de(i,3)),t.setAttribute("color",new de(r,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){const e=this.geometry,t=this.pointMap,n=1,i=1;tt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),nt("c",t,e,tt,0,0,-1),nt("t",t,e,tt,0,0,1),nt("n1",t,e,tt,-1,-1,-1),nt("n2",t,e,tt,n,-1,-1),nt("n3",t,e,tt,-1,i,-1),nt("n4",t,e,tt,n,i,-1),nt("f1",t,e,tt,-1,-1,1),nt("f2",t,e,tt,n,-1,1),nt("f3",t,e,tt,-1,i,1),nt("f4",t,e,tt,n,i,1),nt("u1",t,e,tt,n*.7,i*1.1,-1),nt("u2",t,e,tt,-1*.7,i*1.1,-1),nt("u3",t,e,tt,0,i*2,-1),nt("cf1",t,e,tt,-1,0,1),nt("cf2",t,e,tt,n,0,1),nt("cf3",t,e,tt,0,-1,1),nt("cf4",t,e,tt,0,i,1),nt("cn1",t,e,tt,-1,0,-1),nt("cn2",t,e,tt,n,0,-1),nt("cn3",t,e,tt,0,-1,-1),nt("cn4",t,e,tt,0,i,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function nt(s,e,t,n,i,r,o){Xs.set(i,r,o).unproject(n);const a=e[s];if(a!==void 0){const l=t.getAttribute("position");for(let c=0,h=a.length;c<h;c++)l.setXYZ(a[c],Xs.x,Xs.y,Xs.z)}}const Js=new Ft;class bd extends At{constructor(e,t=16776960){const n=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]),i=new Float32Array(8*3),r=new ye;r.setIndex(new Oe(n,1)),r.setAttribute("position",new Oe(i,3)),super(r,new gt({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&Js.setFromObject(this.object),Js.isEmpty())return;const t=Js.min,n=Js.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=t.x,r[4]=n.y,r[5]=n.z,r[6]=t.x,r[7]=t.y,r[8]=n.z,r[9]=n.x,r[10]=t.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=t.z,r[15]=t.x,r[16]=n.y,r[17]=t.z,r[18]=t.x,r[19]=t.y,r[20]=t.z,r[21]=n.x,r[22]=t.y,r[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return At.prototype.copy.call(this,e),this.object=e.object,this}}class my extends At{constructor(e,t=16776960){const n=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]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],r=new ye;r.setIndex(new Oe(n,1)),r.setAttribute("position",new de(i,3)),super(r,new gt({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class gy extends gn{constructor(e,t=1,n=16776960){const i=n,r=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],o=new ye;o.setAttribute("position",new de(r,3)),o.computeBoundingSphere(),super(o,new gt({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],l=new ye;l.setAttribute("position",new de(a,3)),l.computeBoundingSphere(),this.add(new ht(l,new yn({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?Pt:hi,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const fh=new S;let Ys,ga;class xy extends Ne{constructor(e=new S(0,0,1),t=new S(0,0,0),n=1,i=16776960,r=n*.2,o=r*.2){super(),this.type="ArrowHelper",Ys===void 0&&(Ys=new ye,Ys.setAttribute("position",new de([0,0,0,0,1,0],3)),ga=new Bn(0,.5,1,5,1),ga.translate(0,-.5,0)),this.position.copy(t),this.line=new gn(Ys,new gt({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ht(ga,new yn({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,r,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{fh.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(fh,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class wd extends At{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new ye;i.setAttribute("position",new de(t,3)),i.setAttribute("color",new de(n,3));const r=new gt({vertexColors:!0,toneMapped:!1});super(i,r),this.type="AxesHelper"}setColors(e,t,n){const i=new ae,r=this.geometry.attributes.color.array;return i.set(e),i.toArray(r,0),i.toArray(r,3),i.set(t),i.toArray(r,6),i.toArray(r,9),i.set(n),i.toArray(r,12),i.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class yy{constructor(){this.type="ShapePath",this.color=new ae,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new tr,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,r,o){return this.currentPath.bezierCurveTo(e,t,n,i,r,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(y){const M=[];for(let _=0,b=y.length;_<b;_++){const A=y[_],R=new en;R.curves=A.curves,M.push(R)}return M}function i(y,M){const _=M.length;let b=!1;for(let A=_-1,R=0;R<_;A=R++){let P=M[A],H=M[R],I=H.x-P.x,v=H.y-P.y;if(Math.abs(v)>Number.EPSILON){if(v<0&&(P=M[R],I=-I,H=M[A],v=-v),y.y<P.y||y.y>H.y)continue;if(y.y===P.y){if(y.x===P.x)return!0}else{const C=v*(y.x-P.x)-I*(y.y-P.y);if(C===0)return!0;if(C<0)continue;b=!b}}else{if(y.y!==P.y)continue;if(H.x<=y.x&&y.x<=P.x||P.x<=y.x&&y.x<=H.x)return!0}}return b}const r=tn.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return n(o);let a,l,c;const h=[];if(o.length===1)return l=o[0],c=new en,c.curves=l.curves,h.push(c),h;let u=!r(o[0].getPoints());u=e?!u:u;const d=[],f=[];let g=[],p=0,m;f[p]=void 0,g[p]=[];for(let y=0,M=o.length;y<M;y++)l=o[y],m=l.getPoints(),a=r(m),a=e?!a:a,a?(!u&&f[p]&&p++,f[p]={s:new en,p:m},f[p].s.curves=l.curves,u&&p++,g[p]=[]):g[p].push({h:l,p:m[0]});if(!f[0])return n(o);if(f.length>1){let y=!1,M=0;for(let _=0,b=f.length;_<b;_++)d[_]=[];for(let _=0,b=f.length;_<b;_++){const A=g[_];for(let R=0;R<A.length;R++){const P=A[R];let H=!0;for(let I=0;I<f.length;I++)i(P.p,f[I].p)&&(_!==I&&M++,H?(H=!1,d[I].push(P)):y=!0);H&&d[_].push(P)}}M>0&&y===!1&&(g=d)}let x;for(let y=0,M=f.length;y<M;y++){c=f[y].s,h.push(c),x=g[y];for(let _=0,b=x.length;_<b;_++)c.holes.push(x[_].h)}return h}}class _y{static toHalfFloat(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=rt(e,-65504,65504),ph[0]=e;const t=mh[0],n=t>>23&511;return kt[n]+((t&8388607)>>Vt[n])}static fromHalfFloat(e){const t=e>>10;return mh[0]=Vl[Ed[t]+(e&1023)]+yr[t],ph[0]}}const Sd=new ArrayBuffer(4),ph=new Float32Array(Sd),mh=new Uint32Array(Sd),kt=new Uint32Array(512),Vt=new Uint32Array(512);for(let s=0;s<256;++s){const e=s-127;e<-27?(kt[s]=0,kt[s|256]=32768,Vt[s]=24,Vt[s|256]=24):e<-14?(kt[s]=1024>>-e-14,kt[s|256]=1024>>-e-14|32768,Vt[s]=-e-1,Vt[s|256]=-e-1):e<=15?(kt[s]=e+15<<10,kt[s|256]=e+15<<10|32768,Vt[s]=13,Vt[s|256]=13):e<128?(kt[s]=31744,kt[s|256]=64512,Vt[s]=24,Vt[s|256]=24):(kt[s]=31744,kt[s|256]=64512,Vt[s]=13,Vt[s|256]=13)}const Vl=new Uint32Array(2048),yr=new Uint32Array(64),Ed=new Uint32Array(64);for(let s=1;s<1024;++s){let e=s<<13,t=0;for(;(e&8388608)===0;)e<<=1,t-=8388608;e&=-8388609,t+=947912704,Vl[s]=e|t}for(let s=1024;s<2048;++s)Vl[s]=939524096+(s-1024<<13);for(let s=1;s<31;++s)yr[s]=s<<23;yr[31]=1199570944;yr[32]=2147483648;for(let s=33;s<63;++s)yr[s]=2147483648+(s-32<<23);yr[63]=3347054592;for(let s=1;s<64;++s)s!==32&&(Ed[s]=1024);const vy=0,My=1,by=0,wy=1,Sy=2;function Ey(s){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),s}function Ty(s=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),s.isMultiMaterial=!0,s.materials=s,s.clone=function(){return s.slice()},s}class Ay extends is{constructor(e,t){console.warn("THREE.PointCloud has been renamed to THREE.Points."),super(e,t)}}class Cy extends bo{constructor(e){console.warn("THREE.Particle has been renamed to THREE.Sprite."),super(e)}}class Ry extends is{constructor(e,t){console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),super(e,t)}}class Ly extends wi{constructor(e){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),super(e)}}class Py extends wi{constructor(e){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),super(e)}}class Iy extends wi{constructor(e){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),super(e)}}class Dy extends S{constructor(e,t,n){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),super(e,t,n)}}class Fy extends Oe{constructor(e,t){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),super(e,t),this.setUsage(Qi)}}class By extends vu{constructor(e,t){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),super(e,t)}}class Ny extends Mu{constructor(e,t){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),super(e,t)}}class zy extends bu{constructor(e,t){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),super(e,t)}}class Uy extends wu{constructor(e,t){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),super(e,t)}}class Oy extends fo{constructor(e,t){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),super(e,t)}}class Hy extends Su{constructor(e,t){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),super(e,t)}}class Gy extends po{constructor(e,t){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),super(e,t)}}class ky extends de{constructor(e,t){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),super(e,t)}}class Vy extends Tu{constructor(e,t){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),super(e,t)}}Dt.create=function(s,e){return console.log("THREE.Curve.create() has been deprecated"),s.prototype=Object.create(Dt.prototype),s.prototype.constructor=s,s.prototype.getPoint=e,s};tr.prototype.fromPoints=function(s){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(s)};class Wy extends wd{constructor(e){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),super(e)}}class qy extends bd{constructor(e,t){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),super(e,t)}}class Xy extends At{constructor(e,t){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),super(new gl(e.geometry),new gt({color:t!==void 0?t:16777215}))}}Md.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};_d.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};class Jy extends At{constructor(e,t){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),super(new xl(e.geometry),new gt({color:t!==void 0?t:16777215}))}}Tt.prototype.extractUrlBase=function(s){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),ao.extractUrlBase(s)};Tt.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}};class Yy extends on{constructor(e){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),super(e)}}class Zy extends ed{constructor(e){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),super(e)}}xr.prototype.center=function(s){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(s)};xr.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()};xr.prototype.isIntersectionBox=function(s){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(s)};xr.prototype.size=function(s){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(s)};Ft.prototype.center=function(s){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(s)};Ft.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Ft.prototype.isIntersectionBox=function(s){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(s)};Ft.prototype.isIntersectionSphere=function(s){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(s)};Ft.prototype.size=function(s){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(s)};Gn.prototype.toVector3=function(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")};On.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()};Qr.prototype.setFromMatrix=function(s){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(s)};yd.prototype.center=function(s){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(s)};ft.prototype.flattenToArrayOffset=function(s,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(s,e)};ft.prototype.multiplyVector3=function(s){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),s.applyMatrix3(this)};ft.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")};ft.prototype.applyToBufferAttribute=function(s){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),s.applyMatrix3(this)};ft.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")};ft.prototype.getInverse=function(s){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(s).invert()};fe.prototype.extractPosition=function(s){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(s)};fe.prototype.flattenToArrayOffset=function(s,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(s,e)};fe.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new S().setFromMatrixColumn(this,3)};fe.prototype.setRotationFromQuaternion=function(s){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(s)};fe.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")};fe.prototype.multiplyVector3=function(s){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),s.applyMatrix4(this)};fe.prototype.multiplyVector4=function(s){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),s.applyMatrix4(this)};fe.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")};fe.prototype.rotateAxis=function(s){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),s.transformDirection(this)};fe.prototype.crossVector=function(s){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),s.applyMatrix4(this)};fe.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")};fe.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")};fe.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")};fe.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")};fe.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")};fe.prototype.applyToBufferAttribute=function(s){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),s.applyMatrix4(this)};fe.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")};fe.prototype.makeFrustum=function(s,e,t,n,i,r){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(s,e,n,t,i,r)};fe.prototype.getInverse=function(s){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(s).invert()};Kt.prototype.isIntersectionLine=function(s){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(s)};yt.prototype.multiplyVector3=function(s){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),s.applyQuaternion(this)};yt.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()};Hn.prototype.isIntersectionBox=function(s){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(s)};Hn.prototype.isIntersectionPlane=function(s){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(s)};Hn.prototype.isIntersectionSphere=function(s){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(s)};st.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()};st.prototype.barycoordFromPoint=function(s,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(s,e)};st.prototype.midpoint=function(s){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(s)};st.prototypenormal=function(s){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(s)};st.prototype.plane=function(s){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(s)};st.barycoordFromPoint=function(s,e,t,n,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),st.getBarycoord(s,e,t,n,i)};st.normal=function(s,e,t,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),st.getNormal(s,e,t,n)};en.prototype.extractAllPoints=function(s){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(s)};en.prototype.extrude=function(s){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new sn(this,s)};en.prototype.makeGeometry=function(s){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new xi(this,s)};Z.prototype.fromAttribute=function(s,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(s,e,t)};Z.prototype.distanceToManhattan=function(s){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(s)};Z.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};S.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")};S.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")};S.prototype.getPositionFromMatrix=function(s){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(s)};S.prototype.getScaleFromMatrix=function(s){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(s)};S.prototype.getColumnFromMatrix=function(s,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,s)};S.prototype.applyProjection=function(s){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(s)};S.prototype.fromAttribute=function(s,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(s,e,t)};S.prototype.distanceToManhattan=function(s){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(s)};S.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};qe.prototype.fromAttribute=function(s,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(s,e,t)};qe.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()};Ne.prototype.getChildByName=function(s){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(s)};Ne.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")};Ne.prototype.translate=function(s,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,s)};Ne.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")};Ne.prototype.applyMatrix=function(s){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(s)};Object.defineProperties(Ne.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(s){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=s}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});ht.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")};Object.defineProperties(ht.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),cu},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}});wo.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")};mt.prototype.setLens=function(s,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),e!==void 0&&(this.filmGauge=e),this.setFocalLength(s)};Object.defineProperties(qt.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(s){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=s}},shadowCameraLeft:{set:function(s){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=s}},shadowCameraRight:{set:function(s){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=s}},shadowCameraTop:{set:function(s){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=s}},shadowCameraBottom:{set:function(s){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=s}},shadowCameraNear:{set:function(s){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=s}},shadowCameraFar:{set:function(s){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=s}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(s){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=s}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(s){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=s}},shadowMapHeight:{set:function(s){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=s}}});Object.defineProperties(Oe.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Qi},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Qi)}}});Oe.prototype.setDynamic=function(s){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(s===!0?Qi:Ki),this};Oe.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Oe.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};ye.prototype.addIndex=function(s){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(s)};ye.prototype.addAttribute=function(s,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),!(e&&e.isBufferAttribute)&&!(e&&e.isInterleavedBufferAttribute)?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(s,new Oe(arguments[1],arguments[2]))):s==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(s,e)};ye.prototype.addDrawCall=function(s,e,t){t!==void 0&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(s,e)};ye.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()};ye.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")};ye.prototype.removeAttribute=function(s){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(s)};ye.prototype.applyMatrix=function(s){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(s)};Object.defineProperties(ye.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}});bi.prototype.setDynamic=function(s){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(s===!0?Qi:Ki),this};bi.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")};sn.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")};sn.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")};sn.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")};vo.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")};Io.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this};Object.defineProperties(ot.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new ae}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(s){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=s===Qa}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(s){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=s}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}});Object.defineProperties(zt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(s){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=s}}});Je.prototype.clearTarget=function(s,e,t,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(s),this.clear(e,t,n)};Je.prototype.animate=function(s){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(s)};Je.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()};Je.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()};Je.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision};Je.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()};Je.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")};Je.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")};Je.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")};Je.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")};Je.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")};Je.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")};Je.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures};Je.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")};Je.prototype.enableScissorTest=function(s){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(s)};Je.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};Je.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};Je.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};Je.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Je.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")};Je.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")};Je.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")};Je.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")};Je.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")};Je.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()};Object.defineProperties(Je.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(s){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=s}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(s){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=s}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(s){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=s===!0?$e:nn}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});Object.defineProperties(Nu.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});class $y extends go{constructor(e,t,n){console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),super(e,n)}}Object.defineProperties(St.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(s){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=s}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(s){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=s}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(s){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=s}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(s){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=s}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(s){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=s}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(s){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=s}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(s){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=s}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(s){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=s}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(s){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=s}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(s){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=s}}});Hl.prototype.load=function(s){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new ld().load(s,function(n){e.setBuffer(n)}),this};dd.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};mo.prototype.updateCubeMap=function(s,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(s,e)};mo.prototype.clear=function(s,e,t,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(s,e,t,n)};Un.crossOrigin=void 0;Un.loadTexture=function(s,e,t,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new td;i.setCrossOrigin(this.crossOrigin);const r=i.load(s,t,void 0,n);return e&&(r.mapping=e),r};Un.loadTextureCube=function(s,e,t,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new Qu;i.setCrossOrigin(this.crossOrigin);const r=i.load(s,t,void 0,n);return e&&(r.mapping=e),r};Un.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};Un.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};function jy(){console.error("THREE.CanvasRenderer has been removed")}function Ky(){console.error("THREE.JSONLoader has been removed.")}const Qy={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function e_(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}class t_ extends ye{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class n_ extends ye{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function i_(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function r_(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function s_(){console.error("THREE.ImmediateRenderObject has been removed.")}class o_ extends St{constructor(e,t,n){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,n),this.samples=4}}class a_ extends fr{constructor(e,t,n,i){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,n,i)}}class l_ extends jr{constructor(e,t,n,i){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,n,i)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:lo}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=lo);const c_=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Vh,AddEquation:Kn,AddOperation:Oh,AdditiveAnimationBlendMode:il,AdditiveBlending:ya,AlphaFormat:$h,AlwaysDepth:Ih,AlwaysStencilFunc:fu,AmbientLight:Bl,AmbientLightProbe:hd,AnimationClip:Yr,AnimationLoader:H0,AnimationMixer:md,AnimationObjectGroup:pd,AnimationUtils:je,ArcCurve:ul,ArrayCamera:ol,ArrowHelper:xy,Audio:Hl,AudioAnalyser:dd,AudioContext:Ol,AudioListener:X0,AudioLoader:ld,AxesHelper:wd,AxisHelper:Wy,BackSide:Pt,BasicDepthPacking:hu,BasicShadowMap:Fd,BinaryTextureLoader:Zy,Bone:So,BooleanKeyframeTrack:Si,BoundingBoxHelper:qy,Box2:xr,Box3:Ft,Box3Helper:my,BoxBufferGeometry:mn,BoxGeometry:mn,BoxHelper:bd,BufferAttribute:Oe,BufferGeometry:ye,BufferGeometryLoader:od,ByteType:qh,Cache:_i,Camera:Kr,CameraHelper:py,CanvasRenderer:jy,CanvasTexture:Vu,CapsuleBufferGeometry:nr,CapsuleGeometry:nr,CatmullRomCurve3:fl,CineonToneMapping:kh,CircleBufferGeometry:ir,CircleGeometry:ir,ClampToEdgeWrapping:wt,Clock:ud,Color:ae,ColorKeyframeTrack:Cl,ColorManagement:Nt,CompressedTexture:hl,CompressedTextureLoader:G0,ConeBufferGeometry:rr,ConeGeometry:rr,CubeCamera:mo,CubeReflectionMapping:Pn,CubeRefractionMapping:In,CubeTexture:pr,CubeTextureLoader:Qu,CubeUVReflectionMapping:dr,CubicBezierCurve:To,CubicBezierCurve3:pl,CubicInterpolant:Zu,CullFaceBack:xa,CullFaceFront:xh,CullFaceFrontBack:Dd,CullFaceNone:gh,Curve:Dt,CurvePath:qu,CustomBlending:_h,CustomToneMapping:Wh,CylinderBufferGeometry:Bn,CylinderGeometry:Bn,Cylindrical:ay,Data3DTexture:jr,DataArrayTexture:fr,DataTexture:ci,DataTexture2DArray:a_,DataTexture3D:l_,DataTextureLoader:ed,DataUtils:_y,DecrementStencilOp:Xd,DecrementWrapStencilOp:Yd,DefaultLoadingManager:Ku,DepthFormat:Rn,DepthStencilFormat:di,DepthTexture:al,DirectionalLight:Fl,DirectionalLightHelper:fy,DiscreteInterpolant:$u,DodecahedronBufferGeometry:sr,DodecahedronGeometry:sr,DoubleSide:ui,DstAlphaFactor:Th,DstColorFactor:Ch,DynamicBufferAttribute:Fy,DynamicCopyUsage:cf,DynamicDrawUsage:Qi,DynamicReadUsage:of,EdgesGeometry:gl,EdgesHelper:Xy,EllipseCurve:rs,EqualDepth:Fh,EqualStencilFunc:Kd,EquirectangularReflectionMapping:Fr,EquirectangularRefractionMapping:Br,Euler:Gn,EventDispatcher:zn,ExtrudeBufferGeometry:sn,ExtrudeGeometry:sn,FaceColors:wy,FileLoader:on,FlatShading:Qa,Float16BufferAttribute:Eu,Float32Attribute:ky,Float32BufferAttribute:de,Float64Attribute:Vy,Float64BufferAttribute:Tu,FloatType:fn,Fog:ns,FogExp2:ts,Font:r_,FontLoader:i_,FramebufferTexture:ku,FrontSide:hi,Frustum:Qr,GLBufferAttribute:xd,GLSL1:uf,GLSL3:Wa,GreaterDepth:Nh,GreaterEqualDepth:Bh,GreaterEqualStencilFunc:nf,GreaterStencilFunc:ef,GridHelper:Md,Group:ii,HalfFloatType:si,HemisphereLight:Ll,HemisphereLightHelper:uy,HemisphereLightProbe:cd,IcosahedronBufferGeometry:or,IcosahedronGeometry:or,ImageBitmapLoader:ad,ImageLoader:Zr,ImageUtils:Un,ImmediateRenderObject:s_,IncrementStencilOp:qd,IncrementWrapStencilOp:Jd,InstancedBufferAttribute:pi,InstancedBufferGeometry:Ul,InstancedInterleavedBuffer:gd,InstancedMesh:ll,Int16Attribute:Uy,Int16BufferAttribute:wu,Int32Attribute:Hy,Int32BufferAttribute:Su,Int8Attribute:By,Int8BufferAttribute:vu,IntType:Jh,InterleavedBuffer:bi,InterleavedBufferAttribute:Fn,Interpolant:xn,InterpolateDiscrete:Ur,InterpolateLinear:Or,InterpolateSmooth:Qs,InvertStencilOp:Zd,JSONLoader:Ky,KeepStencilOp:eo,KeyframeTrack:Xt,LOD:Hu,LatheBufferGeometry:mi,LatheGeometry:mi,Layers:uo,LensFlare:e_,LessDepth:Dh,LessEqualDepth:no,LessEqualStencilFunc:Qd,LessStencilFunc:jd,Light:qt,LightProbe:os,Line:gn,Line3:yd,LineBasicMaterial:gt,LineCurve:ss,LineCurve3:Wu,LineDashedMaterial:Tl,LineLoop:cl,LinePieces:My,LineSegments:At,LineStrip:vy,LinearEncoding:nn,LinearFilter:it,LinearInterpolant:Al,LinearMipMapLinearFilter:Od,LinearMipMapNearestFilter:Ud,LinearMipmapLinearFilter:vi,LinearMipmapNearestFilter:nl,LinearSRGBColorSpace:Cn,LinearToneMapping:Hh,Loader:Tt,LoaderUtils:ao,LoadingManager:Rl,LoopOnce:ou,LoopPingPong:lu,LoopRepeat:au,LuminanceAlphaFormat:Qh,LuminanceFormat:Kh,MOUSE:Pd,Material:ot,MaterialLoader:sd,Math:Xl,MathUtils:Xl,Matrix3:ft,Matrix4:fe,MaxEquation:ba,Mesh:ht,MeshBasicMaterial:yn,MeshDepthMaterial:yo,MeshDistanceMaterial:_o,MeshFaceMaterial:Ey,MeshLambertMaterial:Sl,MeshMatcapMaterial:El,MeshNormalMaterial:wl,MeshPhongMaterial:Ml,MeshPhysicalMaterial:vl,MeshStandardMaterial:Po,MeshToonMaterial:bl,MinEquation:Ma,MirroredRepeatWrapping:zr,MixOperation:Uh,MultiMaterial:Ty,MultiplyBlending:va,MultiplyOperation:$r,NearestFilter:ct,NearestMipMapLinearFilter:zd,NearestMipMapNearestFilter:Nd,NearestMipmapLinearFilter:ro,NearestMipmapNearestFilter:io,NeverDepth:Ph,NeverStencilFunc:$d,NoBlending:pn,NoColorSpace:kd,NoColors:by,NoToneMapping:Qt,NormalAnimationBlendMode:ho,NormalBlending:ri,NotEqualDepth:zh,NotEqualStencilFunc:tf,NumberKeyframeTrack:Xr,Object3D:Ne,ObjectLoader:k0,ObjectSpaceNormalMap:du,OctahedronBufferGeometry:gi,OctahedronGeometry:gi,OneFactor:wh,OneMinusDstAlphaFactor:Ah,OneMinusDstColorFactor:Rh,OneMinusSrcAlphaFactor:tl,OneMinusSrcColorFactor:Eh,OrthographicCamera:es,PCFShadowMap:Ka,PCFSoftShadowMap:yh,PMREMGenerator:Xa,ParametricGeometry:t_,Particle:Cy,ParticleBasicMaterial:Py,ParticleSystem:Ry,ParticleSystemMaterial:Iy,Path:tr,PerspectiveCamera:mt,Plane:Kt,PlaneBufferGeometry:fi,PlaneGeometry:fi,PlaneHelper:gy,PointCloud:Ay,PointCloudMaterial:Ly,PointLight:Dl,PointLightHelper:cy,Points:is,PointsMaterial:wi,PolarGridHelper:dy,PolyhedronBufferGeometry:rn,PolyhedronGeometry:rn,PositionalAudio:Y0,PropertyBinding:Ge,PropertyMixer:fd,QuadraticBezierCurve:Ao,QuadraticBezierCurve3:Co,Quaternion:yt,QuaternionKeyframeTrack:gr,QuaternionLinearInterpolant:ju,REVISION:lo,RGBADepthPacking:uu,RGBAFormat:Lt,RGBAIntegerFormat:ru,RGBA_ASTC_10x10_Format:Ha,RGBA_ASTC_10x5_Format:za,RGBA_ASTC_10x6_Format:Ua,RGBA_ASTC_10x8_Format:Oa,RGBA_ASTC_12x10_Format:Ga,RGBA_ASTC_12x12_Format:ka,RGBA_ASTC_4x4_Format:Ra,RGBA_ASTC_5x4_Format:La,RGBA_ASTC_5x5_Format:Pa,RGBA_ASTC_6x5_Format:Ia,RGBA_ASTC_6x6_Format:Da,RGBA_ASTC_8x5_Format:Fa,RGBA_ASTC_8x6_Format:Ba,RGBA_ASTC_8x8_Format:Na,RGBA_BPTC_Format:Va,RGBA_ETC2_EAC_Format:Ca,RGBA_PVRTC_2BPPV1_Format:Ta,RGBA_PVRTC_4BPPV1_Format:Ea,RGBA_S3TC_DXT1_Format:$s,RGBA_S3TC_DXT3_Format:js,RGBA_S3TC_DXT5_Format:Ks,RGBFormat:jh,RGB_ETC1_Format:su,RGB_ETC2_Format:Aa,RGB_PVRTC_2BPPV1_Format:Sa,RGB_PVRTC_4BPPV1_Format:wa,RGB_S3TC_DXT1_Format:Zs,RGFormat:nu,RGIntegerFormat:iu,RawShaderMaterial:_l,Ray:Hn,Raycaster:sy,RectAreaLight:Nl,RedFormat:eu,RedIntegerFormat:tu,ReinhardToneMapping:Gh,RepeatWrapping:Nr,ReplaceStencilOp:Wd,ReverseSubtractEquation:Mh,RingBufferGeometry:ar,RingGeometry:ar,SRGBColorSpace:jt,Scene:vo,SceneUtils:Qy,ShaderChunk:Fe,ShaderLib:Wt,ShaderMaterial:zt,ShadowMaterial:yl,Shape:en,ShapeBufferGeometry:xi,ShapeGeometry:xi,ShapePath:yy,ShapeUtils:tn,ShortType:Xh,Skeleton:Eo,SkeletonHelper:_d,SkinnedMesh:wo,SmoothShading:Bd,Source:ni,Sphere:On,SphereBufferGeometry:yi,SphereGeometry:yi,Spherical:oy,SphericalHarmonics3:zl,SplineCurve:Ro,SpotLight:Il,SpotLightHelper:ly,Sprite:bo,SpriteMaterial:Mo,SrcAlphaFactor:el,SrcAlphaSaturateFactor:Lh,SrcColorFactor:Sh,StaticCopyUsage:lf,StaticDrawUsage:Ki,StaticReadUsage:sf,StereoCamera:W0,StreamCopyUsage:hf,StreamDrawUsage:rf,StreamReadUsage:af,StringKeyframeTrack:Ei,SubtractEquation:vh,SubtractiveBlending:_a,TOUCH:Id,TangentSpaceNormalMap:Mi,TetrahedronBufferGeometry:lr,TetrahedronGeometry:lr,TextGeometry:n_,Texture:ut,TextureLoader:td,TorusBufferGeometry:cr,TorusGeometry:cr,TorusKnotBufferGeometry:hr,TorusKnotGeometry:hr,Triangle:st,TriangleFanDrawMode:Gd,TriangleStripDrawMode:Hd,TrianglesDrawMode:cu,TubeBufferGeometry:ur,TubeGeometry:ur,UVMapping:co,Uint16Attribute:Oy,Uint16BufferAttribute:fo,Uint32Attribute:Gy,Uint32BufferAttribute:po,Uint8Attribute:Ny,Uint8BufferAttribute:Mu,Uint8ClampedAttribute:zy,Uint8ClampedBufferAttribute:bu,Uniform:Io,UniformsLib:se,UniformsUtils:Au,UnsignedByteType:Dn,UnsignedInt248Type:oi,UnsignedIntType:Lr,UnsignedShort4444Type:Yh,UnsignedShort5551Type:Zh,UnsignedShortType:ji,VSMShadowMap:Ji,Vector2:Z,Vector3:S,Vector4:qe,VectorKeyframeTrack:Jr,Vertex:Dy,VertexColors:Sy,VideoTexture:Gu,WebGL1Renderer:Uu,WebGL3DRenderTarget:yu,WebGLArrayRenderTarget:xu,WebGLCubeRenderTarget:go,WebGLMultipleRenderTargets:_u,WebGLMultisampleRenderTarget:o_,WebGLRenderTarget:St,WebGLRenderTargetCube:$y,WebGLRenderer:Je,WebGLUtils:zu,WireframeGeometry:xl,WireframeHelper:Jy,WrapAroundEnding:Hr,XHRLoader:Yy,ZeroCurvatureEnding:ei,ZeroFactor:bh,ZeroSlopeEnding:ti,ZeroStencilOp:Vd,_SRGBAFormat:so,sRGBEncoding:$e},Symbol.toStringTag,{value:"Module"}));export{Vh as A,ye as B,Nt as C,ui as D,zn as E,de as F,Co as G,gn as H,Ul as I,yi as J,Ne as K,nn as L,Pd as M,Qt as N,es as O,mt as P,yt as Q,sy as R,vo as S,ut as T,Au as U,S as V,Je as W,yh as a,Kr as b,Z as c,ud as d,uo as e,ae as f,c_ as g,Oe as h,oy as i,Id as j,Hn as k,Kt as l,gd as m,Fn as n,xl as o,Ft as p,On as q,zt as r,$e as s,lo as t,se as u,ht as v,qe as w,yd as x,fe as y,Xl as z};
|