From 0e0c907f8eebac1f6b09ca033cddf5fa4d7f3765 Mon Sep 17 00:00:00 2001 From: Ustym Date: Sat, 24 Sep 2022 15:51:03 +0300 Subject: [PATCH] Update playground tests & dependencies --- README.md | 14 +- .../{index.d14d1cb9.js => index.eaee3187.js} | 16 +- dist/index.html | 2 +- package.json | 28 +- pnpm-lock.yaml | 613 +++++++++--------- src/playground/index.ts | 8 +- tests/playground/GroundMaterial.spec.ts | 2 +- tests/playground/Playground.spec.ts | 142 +++- 8 files changed, 486 insertions(+), 339 deletions(-) rename dist/assets/{index.d14d1cb9.js => index.eaee3187.js} (97%) diff --git a/README.md b/README.md index a4c267c..d7c0308 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,15 @@ *[Three.js](https://threejs.org/) + [TypeScript](https://www.typescriptlang.org/) + [SolidJS](https://www.solidjs.com/) + [Vite](https://vitejs.dev/) + [Vitest](https://vitest.dev/)* -![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/animejs?style=flat-square) -![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/solid-js?style=flat-square) ![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/three?style=flat-square) - - - - +![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/dev/typescript?style=flat-square) +![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/solid-js?style=flat-square) +![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/dev/vite?style=flat-square) +![](https://img.shields.io/github/package-json/dependency-version/UstymUkhman/threejs-boilerplate/dev/vitest?style=flat-square) ![](https://img.shields.io/github/deployments/UstymUkhman/threejs-boilerplate/github-pages?style=flat-square) -![](https://img.shields.io/github/repo-size/UstymUkhman/threejs-boilerplate?style=flat-square) -![](https://img.shields.io/badge/coverage-99.2%25-green?style=flat-square) +![](https://img.shields.io/github/repo-size/UstymUkhman/threejs-boilerplate?color=green&style=flat-square) +![](https://img.shields.io/badge/coverage-98.5%25-green?style=flat-square) ![](https://img.shields.io/github/package-json/v/UstymUkhman/threejs-boilerplate?color=brightgreen&style=flat-square) ![](https://img.shields.io/github/license/UstymUkhman/threejs-boilerplate?color=brightgreen&style=flat-square) diff --git a/dist/assets/index.d14d1cb9.js b/dist/assets/index.eaee3187.js similarity index 97% rename from dist/assets/index.d14d1cb9.js rename to dist/assets/index.eaee3187.js index bf160d2..d71ef09 100644 --- a/dist/assets/index.d14d1cb9.js +++ b/dist/assets/index.eaee3187.js @@ -5397,25 +5397,25 @@ void main() { gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); } -`;function Ap(s,e,t){let i=new Pr;const n=new De,r=new De,o=new Je,a=new Sp({depthPacking:wc}),c=new Ep,l={},h=t.maxTextureSize,u={0:Tt,1:cn,2:Jt},d=new Pi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new De},radius:{value:4}},vertexShader:wp,fragmentShader:Tp}),m=d.clone();m.defines.HORIZONTAL_PASS=1;const g=new kt;g.setAttribute("position",new zt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const p=new Qt(g,d),f=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=No,this.render=function(x,E,C){if(f.enabled===!1||f.autoUpdate===!1&&f.needsUpdate===!1||x.length===0)return;const L=s.getRenderTarget(),v=s.getActiveCubeFace(),A=s.getActiveMipmapLevel(),N=s.state;N.setBlending(di),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);for(let $=0,Q=x.length;$h||n.y>h)&&(n.x>h&&(r.x=Math.floor(h/X.x),n.x=r.x*X.x,U.mapSize.x=r.x),n.y>h&&(r.y=Math.floor(h/X.y),n.y=r.y*X.y,U.mapSize.y=r.y)),U.map===null){const Z=this.type!==En?{minFilter:ct,magFilter:ct}:{};U.map=new Fi(n.x,n.y,Z),U.map.texture.name=B.name+".shadowMap",U.camera.updateProjectionMatrix()}s.setRenderTarget(U.map),s.clear();const Y=U.getViewportCount();for(let Z=0;Z0){const Q=N.uuid,B=E.uuid;let U=l[Q];U===void 0&&(U={},l[Q]=U);let X=U[B];X===void 0&&(X=N.clone(),U[B]=X),N=X}return N.visible=E.visible,N.wireframe=E.wireframe,A===En?N.side=E.shadowSide!==null?E.shadowSide:E.side:N.side=E.shadowSide!==null?E.shadowSide:u[E.side],N.alphaMap=E.alphaMap,N.alphaTest=E.alphaTest,N.clipShadows=E.clipShadows,N.clippingPlanes=E.clippingPlanes,N.clipIntersection=E.clipIntersection,N.displacementMap=E.displacementMap,N.displacementScale=E.displacementScale,N.displacementBias=E.displacementBias,N.wireframeLinewidth=E.wireframeLinewidth,N.linewidth=E.linewidth,C.isPointLight===!0&&N.isMeshDistanceMaterial===!0&&(N.referencePosition.setFromMatrixPosition(C.matrixWorld),N.nearDistance=L,N.farDistance=v),N}function w(x,E,C,L,v){if(x.visible===!1)return;if(x.layers.test(E.layers)&&(x.isMesh||x.isLine||x.isPoints)&&(x.castShadow||x.receiveShadow&&v===En)&&(!x.frustumCulled||i.intersectsObject(x))){x.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,x.matrixWorld);const $=e.update(x),Q=x.material;if(Array.isArray(Q)){const B=$.groups;for(let U=0,X=B.length;U=1):V.indexOf("OpenGL ES")!==-1&&(Z=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),Y=Z>=2);let I=null,z={};const J=s.getParameter(s.SCISSOR_BOX),j=s.getParameter(s.VIEWPORT),ne=new Je().fromArray(J),ue=new Je().fromArray(j);function _e(R,se,G){const ce=new Uint8Array(4),le=s.createTexture();s.bindTexture(R,le),s.texParameteri(R,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(R,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let Ae=0;AeK||T.height>K)&&(ee=K/Math.max(T.width,T.height)),ee<1||M===!0)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap){const ae=M?_r:Math.floor,me=ae(ee*T.width),b=ae(ee*T.height);p===void 0&&(p=y(me,b));const q=k?y(me,b):p;return q.width=me,q.height=b,q.getContext("2d").drawImage(T,0,0,me,b),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+T.width+"x"+T.height+") to ("+me+"x"+b+")."),q}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+T.width+"x"+T.height+")."),T;return T}function x(T){return Gr(T.width)&&Gr(T.height)}function E(T){return a?!1:T.wrapS!==Pt||T.wrapT!==Pt||T.minFilter!==ct&&T.minFilter!==St}function C(T,M){return T.generateMipmaps&&M&&T.minFilter!==ct&&T.minFilter!==St}function L(T){s.generateMipmap(T)}function v(T,M,k,K,ee=!1){if(a===!1)return M;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 ae=M;return M===s.RED&&(k===s.FLOAT&&(ae=s.R32F),k===s.HALF_FLOAT&&(ae=s.R16F),k===s.UNSIGNED_BYTE&&(ae=s.R8)),M===s.RG&&(k===s.FLOAT&&(ae=s.RG32F),k===s.HALF_FLOAT&&(ae=s.RG16F),k===s.UNSIGNED_BYTE&&(ae=s.RG8)),M===s.RGBA&&(k===s.FLOAT&&(ae=s.RGBA32F),k===s.HALF_FLOAT&&(ae=s.RGBA16F),k===s.UNSIGNED_BYTE&&(ae=K===Oe&&ee===!1?s.SRGB8_ALPHA8:s.RGBA8),k===s.UNSIGNED_SHORT_4_4_4_4&&(ae=s.RGBA4),k===s.UNSIGNED_SHORT_5_5_5_1&&(ae=s.RGB5_A1)),(ae===s.R16F||ae===s.R32F||ae===s.RG16F||ae===s.RG32F||ae===s.RGBA16F||ae===s.RGBA32F)&&e.get("EXT_color_buffer_float"),ae}function A(T,M,k){return C(T,k)===!0||T.isFramebufferTexture&&T.minFilter!==ct&&T.minFilter!==St?Math.log2(Math.max(M.width,M.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?M.mipmaps.length:1}function N(T){return T===ct||T===ia||T===na?s.NEAREST:s.LINEAR}function $(T){const M=T.target;M.removeEventListener("dispose",$),B(M),M.isVideoTexture&&g.delete(M)}function Q(T){const M=T.target;M.removeEventListener("dispose",Q),X(M)}function B(T){const M=i.get(T);if(M.__webglInit===void 0)return;const k=T.source,K=f.get(k);if(K){const ee=K[M.__cacheKey];ee.usedTimes--,ee.usedTimes===0&&U(T),Object.keys(K).length===0&&f.delete(k)}i.remove(T)}function U(T){const M=i.get(T);s.deleteTexture(M.__webglTexture);const k=T.source,K=f.get(k);delete K[M.__cacheKey],o.memory.textures--}function X(T){const M=T.texture,k=i.get(T),K=i.get(M);if(K.__webglTexture!==void 0&&(s.deleteTexture(K.__webglTexture),o.memory.textures--),T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let ee=0;ee<6;ee++)s.deleteFramebuffer(k.__webglFramebuffer[ee]),k.__webglDepthbuffer&&s.deleteRenderbuffer(k.__webglDepthbuffer[ee]);else{if(s.deleteFramebuffer(k.__webglFramebuffer),k.__webglDepthbuffer&&s.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&s.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let ee=0;ee=c&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+c),Y+=1,T}function I(T){const M=[];return M.push(T.wrapS),M.push(T.wrapT),M.push(T.magFilter),M.push(T.minFilter),M.push(T.anisotropy),M.push(T.internalFormat),M.push(T.format),M.push(T.type),M.push(T.generateMipmaps),M.push(T.premultiplyAlpha),M.push(T.flipY),M.push(T.unpackAlignment),M.push(T.encoding),M.join()}function z(T,M){const k=i.get(T);if(T.isVideoTexture&&xt(T),T.isRenderTargetTexture===!1&&T.version>0&&k.__version!==T.version){const K=T.image;if(K===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(K.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{pe(k,T,M);return}}t.activeTexture(s.TEXTURE0+M),t.bindTexture(s.TEXTURE_2D,k.__webglTexture)}function J(T,M){const k=i.get(T);if(T.version>0&&k.__version!==T.version){pe(k,T,M);return}t.activeTexture(s.TEXTURE0+M),t.bindTexture(s.TEXTURE_2D_ARRAY,k.__webglTexture)}function j(T,M){const k=i.get(T);if(T.version>0&&k.__version!==T.version){pe(k,T,M);return}t.activeTexture(s.TEXTURE0+M),t.bindTexture(s.TEXTURE_3D,k.__webglTexture)}function ne(T,M){const k=i.get(T);if(T.version>0&&k.__version!==T.version){xe(k,T,M);return}t.activeTexture(s.TEXTURE0+M),t.bindTexture(s.TEXTURE_CUBE_MAP,k.__webglTexture)}const ue={[yr]:s.REPEAT,[Pt]:s.CLAMP_TO_EDGE,[br]:s.MIRRORED_REPEAT},_e={[ct]:s.NEAREST,[ia]:s.NEAREST_MIPMAP_NEAREST,[na]:s.NEAREST_MIPMAP_LINEAR,[St]:s.LINEAR,[lc]:s.LINEAR_MIPMAP_NEAREST,[Es]:s.LINEAR_MIPMAP_LINEAR};function D(T,M,k){if(k?(s.texParameteri(T,s.TEXTURE_WRAP_S,ue[M.wrapS]),s.texParameteri(T,s.TEXTURE_WRAP_T,ue[M.wrapT]),(T===s.TEXTURE_3D||T===s.TEXTURE_2D_ARRAY)&&s.texParameteri(T,s.TEXTURE_WRAP_R,ue[M.wrapR]),s.texParameteri(T,s.TEXTURE_MAG_FILTER,_e[M.magFilter]),s.texParameteri(T,s.TEXTURE_MIN_FILTER,_e[M.minFilter])):(s.texParameteri(T,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(T,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),(T===s.TEXTURE_3D||T===s.TEXTURE_2D_ARRAY)&&s.texParameteri(T,s.TEXTURE_WRAP_R,s.CLAMP_TO_EDGE),(M.wrapS!==Pt||M.wrapT!==Pt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),s.texParameteri(T,s.TEXTURE_MAG_FILTER,N(M.magFilter)),s.texParameteri(T,s.TEXTURE_MIN_FILTER,N(M.minFilter)),M.minFilter!==ct&&M.minFilter!==St&&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 K=e.get("EXT_texture_filter_anisotropic");if(M.type===bi&&e.has("OES_texture_float_linear")===!1||a===!1&&M.type===Cn&&e.has("OES_texture_half_float_linear")===!1)return;(M.anisotropy>1||i.get(M).__currentAnisotropy)&&(s.texParameterf(T,K.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(M.anisotropy,n.getMaxAnisotropy())),i.get(M).__currentAnisotropy=M.anisotropy)}}function Ce(T,M){let k=!1;T.__webglInit===void 0&&(T.__webglInit=!0,M.addEventListener("dispose",$));const K=M.source;let ee=f.get(K);ee===void 0&&(ee={},f.set(K,ee));const ae=I(M);if(ae!==T.__cacheKey){ee[ae]===void 0&&(ee[ae]={texture:s.createTexture(),usedTimes:0},o.memory.textures++,k=!0),ee[ae].usedTimes++;const me=ee[T.__cacheKey];me!==void 0&&(ee[T.__cacheKey].usedTimes--,me.usedTimes===0&&U(M)),T.__cacheKey=ae,T.__webglTexture=ee[ae].texture}return k}function pe(T,M,k){let K=s.TEXTURE_2D;M.isDataArrayTexture&&(K=s.TEXTURE_2D_ARRAY),M.isData3DTexture&&(K=s.TEXTURE_3D);const ee=Ce(T,M),ae=M.source;if(t.activeTexture(s.TEXTURE0+k),t.bindTexture(K,T.__webglTexture),ae.version!==ae.__currentVersion||ee===!0){s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,M.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,M.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE);const me=E(M)&&x(M.image)===!1;let b=w(M.image,me,!1,h);b=ut(M,b);const q=x(b)||a,te=r.convert(M.format,M.encoding);let oe=r.convert(M.type),re=v(M.internalFormat,te,oe,M.encoding,M.isVideoTexture);D(K,M,q);let ge;const Ee=M.mipmaps,Ne=a&&M.isVideoTexture!==!0,R=ae.__currentVersion===void 0||ee===!0,se=A(M,b,q);if(M.isDepthTexture)re=s.DEPTH_COMPONENT,a?M.type===bi?re=s.DEPTH_COMPONENT32F:M.type===yi?re=s.DEPTH_COMPONENT24:M.type===ln?re=s.DEPTH24_STENCIL8:re=s.DEPTH_COMPONENT16:M.type===bi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),M.format===Ti&&re===s.DEPTH_COMPONENT&&M.type!==ko&&M.type!==yi&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),M.type=yi,oe=r.convert(M.type)),M.format===dn&&re===s.DEPTH_COMPONENT&&(re=s.DEPTH_STENCIL,M.type!==ln&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),M.type=ln,oe=r.convert(M.type))),R&&(Ne?t.texStorage2D(s.TEXTURE_2D,1,re,b.width,b.height):t.texImage2D(s.TEXTURE_2D,0,re,b.width,b.height,0,te,oe,null));else if(M.isDataTexture)if(Ee.length>0&&q){Ne&&R&&t.texStorage2D(s.TEXTURE_2D,se,re,Ee[0].width,Ee[0].height);for(let G=0,ce=Ee.length;G>=1,ce>>=1}}else if(Ee.length>0&&q){Ne&&R&&t.texStorage2D(s.TEXTURE_2D,se,re,Ee[0].width,Ee[0].height);for(let G=0,ce=Ee.length;G0&&R++,t.texStorage2D(s.TEXTURE_CUBE_MAP,R,ge,b[0].width,b[0].height));for(let G=0;G<6;G++)if(me){Ee?t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+G,0,0,0,b[G].width,b[G].height,oe,re,b[G].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+G,0,ge,b[G].width,b[G].height,0,oe,re,b[G].data);for(let ce=0;ce0&&Fe(T)===!1){const b=ae?M:[M];k.__webglMultisampledFramebuffer=s.createFramebuffer(),k.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,k.__webglMultisampledFramebuffer);for(let q=0;q0&&Fe(T)===!1){const M=T.isWebGLMultipleRenderTargets?T.texture:[T.texture],k=T.width,K=T.height;let ee=s.COLOR_BUFFER_BIT;const ae=[],me=T.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,b=i.get(T),q=T.isWebGLMultipleRenderTargets===!0;if(q)for(let te=0;te0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&M.__useRenderToTexture!==!1}function xt(T){const M=o.render.frame;g.get(T)!==M&&(g.set(T,M),T.update())}function ut(T,M){const k=T.encoding,K=T.format,ee=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||T.format===Sr||k!==Li&&(k===Oe?a===!1?e.has("EXT_sRGB")===!0&&K===Ot?(T.format=Sr,T.minFilter=St,T.generateMipmaps=!1):M=tl.sRGBToLinear(M):(K!==Ot||ee!==Ri)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",k)),M}this.allocateTextureUnit=V,this.resetTextureUnits=Z,this.setTexture2D=z,this.setTexture2DArray=J,this.setTexture3D=j,this.setTextureCube=ne,this.rebindTextures=ke,this.setupRenderTarget=et,this.updateRenderTargetMipmap=Xe,this.updateMultisampleRenderTarget=ht,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=he,this.useMultisampledRTT=Fe}function Lp(s,e,t){const i=t.isWebGL2;function n(r,o=null){let a;if(r===Ri)return s.UNSIGNED_BYTE;if(r===dc)return s.UNSIGNED_SHORT_4_4_4_4;if(r===fc)return s.UNSIGNED_SHORT_5_5_5_1;if(r===cc)return s.BYTE;if(r===hc)return s.SHORT;if(r===ko)return s.UNSIGNED_SHORT;if(r===uc)return s.INT;if(r===yi)return s.UNSIGNED_INT;if(r===bi)return s.FLOAT;if(r===Cn)return i?s.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===pc)return s.ALPHA;if(r===Ot)return s.RGBA;if(r===gc)return s.LUMINANCE;if(r===_c)return s.LUMINANCE_ALPHA;if(r===Ti)return s.DEPTH_COMPONENT;if(r===dn)return s.DEPTH_STENCIL;if(r===xc)return s.RED;if(r===mc)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),s.RGBA;if(r===Sr)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===vc)return s.RED_INTEGER;if(r===Mc)return s.RG;if(r===yc)return s.RG_INTEGER;if(r===bc)return s.RGBA_INTEGER;if(r===Gs||r===ks||r===Hs||r===Vs)if(o===Oe)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Gs)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===ks)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Hs)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Vs)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Gs)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===ks)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Hs)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Vs)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===sa||r===ra||r===aa||r===oa)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===sa)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===ra)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===aa)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===oa)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===Sc)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===la||r===ca)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===la)return o===Oe?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===ca)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===ha||r===ua||r===da||r===fa||r===pa||r===ma||r===ga||r===_a||r===xa||r===va||r===Ma||r===ya||r===ba||r===Sa)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===ha)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===ua)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===da)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===fa)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===pa)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===ma)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===ga)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===_a)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===xa)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===va)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===Ma)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===ya)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===ba)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===Sa)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Ea)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Ea)return o===Oe?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return r===ln?i?s.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):s[r]!==void 0?s[r]:null}return{convert:n}}class Dp extends Et{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class us extends Qe{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Pp={type:"move"};class fr{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new us,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 us,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new us,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),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,i){let n=null,r=null,o=null;const a=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){o=!0;for(const p of e.hand.values()){const f=t.getJointPose(p,i);if(l.joints[p.jointName]===void 0){const y=new us;y.matrixAutoUpdate=!1,y.visible=!1,l.joints[p.jointName]=y,l.add(y)}const _=l.joints[p.jointName];f!==null&&(_.matrix.fromArray(f.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.jointRadius=f.radius),_.visible=f!==null}const h=l.joints["index-finger-tip"],u=l.joints["thumb-tip"],d=h.position.distanceTo(u.position),m=.02,g=.005;l.inputState.pinching&&d>m+g?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&d<=m-g&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(n=t.getPose(e.targetRaySpace,i),n===null&&r!==null&&(n=r),n!==null&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Pp)))}return a!==null&&(a.visible=n!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=o!==null),this}}class Fp extends Ft{constructor(e,t,i,n,r,o,a,c,l,h){if(h=h!==void 0?h:Ti,h!==Ti&&h!==dn)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===Ti&&(i=yi),i===void 0&&h===dn&&(i=ln),super(null,n,r,o,a,c,h,i,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:ct,this.minFilter=c!==void 0?c:ct,this.flipY=!1,this.generateMipmaps=!1}}class Ip extends pn{constructor(e,t){super();const i=this;let n=null,r=1,o=null,a="local-floor",c=null,l=null,h=null,u=null,d=null,m=null;const g=t.getContextAttributes();let p=null,f=null;const _=[],y=[],w=new Et;w.layers.enable(1),w.viewport=new Je;const x=new Et;x.layers.enable(2),x.viewport=new Je;const E=[w,x],C=new Dp;C.layers.enable(1),C.layers.enable(2);let L=null,v=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(I){let z=_[I];return z===void 0&&(z=new fr,_[I]=z),z.getTargetRaySpace()},this.getControllerGrip=function(I){let z=_[I];return z===void 0&&(z=new fr,_[I]=z),z.getGripSpace()},this.getHand=function(I){let z=_[I];return z===void 0&&(z=new fr,_[I]=z),z.getHandSpace()};function A(I){const z=y.indexOf(I.inputSource);if(z===-1)return;const J=_[z];J!==void 0&&J.dispatchEvent({type:I.type,data:I.inputSource})}function N(){n.removeEventListener("select",A),n.removeEventListener("selectstart",A),n.removeEventListener("selectend",A),n.removeEventListener("squeeze",A),n.removeEventListener("squeezestart",A),n.removeEventListener("squeezeend",A),n.removeEventListener("end",N),n.removeEventListener("inputsourceschange",$);for(let I=0;I<_.length;I++){const z=y[I];z!==null&&(y[I]=null,_[I].disconnect(z))}L=null,v=null,e.setRenderTarget(p),d=null,u=null,h=null,n=null,f=null,V.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(I){r=I,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(I){a=I,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(I){c=I},this.getBaseLayer=function(){return u!==null?u:d},this.getBinding=function(){return h},this.getFrame=function(){return m},this.getSession=function(){return n},this.setSession=async function(I){if(n=I,n!==null){if(p=e.getRenderTarget(),n.addEventListener("select",A),n.addEventListener("selectstart",A),n.addEventListener("selectend",A),n.addEventListener("squeeze",A),n.addEventListener("squeezestart",A),n.addEventListener("squeezeend",A),n.addEventListener("end",N),n.addEventListener("inputsourceschange",$),g.xrCompatible!==!0&&await t.makeXRCompatible(),n.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const z={antialias:n.renderState.layers===void 0?g.antialias:!0,alpha:g.alpha,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(n,t,z),n.updateRenderState({baseLayer:d}),f=new Fi(d.framebufferWidth,d.framebufferHeight,{format:Ot,type:Ri,encoding:e.outputEncoding,stencilBuffer:g.stencil})}else{let z=null,J=null,j=null;g.depth&&(j=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,z=g.stencil?dn:Ti,J=g.stencil?ln:yi);const ne={colorFormat:t.RGBA8,depthFormat:j,scaleFactor:r};h=new XRWebGLBinding(n,t),u=h.createProjectionLayer(ne),n.updateRenderState({layers:[u]}),f=new Fi(u.textureWidth,u.textureHeight,{format:Ot,type:Ri,depthTexture:new Fp(u.textureWidth,u.textureHeight,J,void 0,void 0,void 0,void 0,void 0,void 0,z),stencilBuffer:g.stencil,encoding:e.outputEncoding,samples:g.antialias?4:0});const ue=e.properties.get(f);ue.__ignoreDepthValues=u.ignoreDepthValues}f.isXRRenderTarget=!0,this.setFoveation(1),c=null,o=await n.requestReferenceSpace(a),V.setContext(n),V.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function $(I){for(let z=0;z=0&&(y[j]=null,_[j].dispatchEvent({type:"disconnected",data:J}))}for(let z=0;z=y.length){y.push(J),j=ue;break}else if(y[ue]===null){y[ue]=J,j=ue;break}if(j===-1)break}const ne=_[j];ne&&ne.dispatchEvent({type:"connected",data:J})}}const Q=new P,B=new P;function U(I,z,J){Q.setFromMatrixPosition(z.matrixWorld),B.setFromMatrixPosition(J.matrixWorld);const j=Q.distanceTo(B),ne=z.projectionMatrix.elements,ue=J.projectionMatrix.elements,_e=ne[14]/(ne[10]-1),D=ne[14]/(ne[10]+1),Ce=(ne[9]+1)/ne[5],pe=(ne[9]-1)/ne[5],xe=(ne[8]-1)/ne[0],he=(ue[8]+1)/ue[0],Pe=_e*xe,ye=_e*he,fe=j/(-xe+he),ke=fe*-xe;z.matrixWorld.decompose(I.position,I.quaternion,I.scale),I.translateX(ke),I.translateZ(fe),I.matrixWorld.compose(I.position,I.quaternion,I.scale),I.matrixWorldInverse.copy(I.matrixWorld).invert();const et=_e+fe,Xe=D+fe,ht=Pe-ke,qe=ye+(j-ke),Fe=Ce*D/Xe*et,xt=pe*D/Xe*et;I.projectionMatrix.makePerspective(ht,qe,Fe,xt,et,Xe)}function X(I,z){z===null?I.matrixWorld.copy(I.matrix):I.matrixWorld.multiplyMatrices(z.matrixWorld,I.matrix),I.matrixWorldInverse.copy(I.matrixWorld).invert()}this.updateCamera=function(I){if(n===null)return;C.near=x.near=w.near=I.near,C.far=x.far=w.far=I.far,(L!==C.near||v!==C.far)&&(n.updateRenderState({depthNear:C.near,depthFar:C.far}),L=C.near,v=C.far);const z=I.parent,J=C.cameras;X(C,z);for(let ne=0;ne0&&(p.alphaTest.value=f.alphaTest);const _=e.get(f).envMap;if(_&&(p.envMap.value=_,p.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=f.reflectivity,p.ior.value=f.ior,p.refractionRatio.value=f.refractionRatio),f.lightMap){p.lightMap.value=f.lightMap;const x=s.physicallyCorrectLights!==!0?Math.PI:1;p.lightMapIntensity.value=f.lightMapIntensity*x}f.aoMap&&(p.aoMap.value=f.aoMap,p.aoMapIntensity.value=f.aoMapIntensity);let y;f.map?y=f.map:f.specularMap?y=f.specularMap:f.displacementMap?y=f.displacementMap:f.normalMap?y=f.normalMap:f.bumpMap?y=f.bumpMap:f.roughnessMap?y=f.roughnessMap:f.metalnessMap?y=f.metalnessMap:f.alphaMap?y=f.alphaMap:f.emissiveMap?y=f.emissiveMap:f.clearcoatMap?y=f.clearcoatMap:f.clearcoatNormalMap?y=f.clearcoatNormalMap:f.clearcoatRoughnessMap?y=f.clearcoatRoughnessMap:f.iridescenceMap?y=f.iridescenceMap:f.iridescenceThicknessMap?y=f.iridescenceThicknessMap:f.specularIntensityMap?y=f.specularIntensityMap:f.specularColorMap?y=f.specularColorMap:f.transmissionMap?y=f.transmissionMap:f.thicknessMap?y=f.thicknessMap:f.sheenColorMap?y=f.sheenColorMap:f.sheenRoughnessMap&&(y=f.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),p.uvTransform.value.copy(y.matrix));let w;f.aoMap?w=f.aoMap:f.lightMap&&(w=f.lightMap),w!==void 0&&(w.isWebGLRenderTarget&&(w=w.texture),w.matrixAutoUpdate===!0&&w.updateMatrix(),p.uv2Transform.value.copy(w.matrix))}function r(p,f){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity}function o(p,f){p.dashSize.value=f.dashSize,p.totalSize.value=f.dashSize+f.gapSize,p.scale.value=f.scale}function a(p,f,_,y){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity,p.size.value=f.size*_,p.scale.value=y*.5,f.map&&(p.map.value=f.map),f.alphaMap&&(p.alphaMap.value=f.alphaMap),f.alphaTest>0&&(p.alphaTest.value=f.alphaTest);let w;f.map?w=f.map:f.alphaMap&&(w=f.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),p.uvTransform.value.copy(w.matrix))}function c(p,f){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity,p.rotation.value=f.rotation,f.map&&(p.map.value=f.map),f.alphaMap&&(p.alphaMap.value=f.alphaMap),f.alphaTest>0&&(p.alphaTest.value=f.alphaTest);let _;f.map?_=f.map:f.alphaMap&&(_=f.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),p.uvTransform.value.copy(_.matrix))}function l(p,f){p.specular.value.copy(f.specular),p.shininess.value=Math.max(f.shininess,1e-4)}function h(p,f){f.gradientMap&&(p.gradientMap.value=f.gradientMap)}function u(p,f){p.roughness.value=f.roughness,p.metalness.value=f.metalness,f.roughnessMap&&(p.roughnessMap.value=f.roughnessMap),f.metalnessMap&&(p.metalnessMap.value=f.metalnessMap),e.get(f).envMap&&(p.envMapIntensity.value=f.envMapIntensity)}function d(p,f,_){p.ior.value=f.ior,f.sheen>0&&(p.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),p.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(p.sheenColorMap.value=f.sheenColorMap),f.sheenRoughnessMap&&(p.sheenRoughnessMap.value=f.sheenRoughnessMap)),f.clearcoat>0&&(p.clearcoat.value=f.clearcoat,p.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(p.clearcoatMap.value=f.clearcoatMap),f.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap),f.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),p.clearcoatNormalMap.value=f.clearcoatNormalMap,f.side===Tt&&p.clearcoatNormalScale.value.negate())),f.iridescence>0&&(p.iridescence.value=f.iridescence,p.iridescenceIOR.value=f.iridescenceIOR,p.iridescenceThicknessMinimum.value=f.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=f.iridescenceThicknessRange[1],f.iridescenceMap&&(p.iridescenceMap.value=f.iridescenceMap),f.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=f.iridescenceThicknessMap)),f.transmission>0&&(p.transmission.value=f.transmission,p.transmissionSamplerMap.value=_.texture,p.transmissionSamplerSize.value.set(_.width,_.height),f.transmissionMap&&(p.transmissionMap.value=f.transmissionMap),p.thickness.value=f.thickness,f.thicknessMap&&(p.thicknessMap.value=f.thicknessMap),p.attenuationDistance.value=f.attenuationDistance,p.attenuationColor.value.copy(f.attenuationColor)),p.specularIntensity.value=f.specularIntensity,p.specularColor.value.copy(f.specularColor),f.specularIntensityMap&&(p.specularIntensityMap.value=f.specularIntensityMap),f.specularColorMap&&(p.specularColorMap.value=f.specularColorMap)}function m(p,f){f.matcap&&(p.matcap.value=f.matcap)}function g(p,f){p.referencePosition.value.copy(f.referencePosition),p.nearDistance.value=f.nearDistance,p.farDistance.value=f.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:i}}function Np(s,e,t,i){let n={},r={},o=[];const a=t.isWebGL2?s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(y,w){const x=w.program;i.uniformBlockBinding(y,x)}function l(y,w){let x=n[y.id];x===void 0&&(g(y),x=h(y),n[y.id]=x,y.addEventListener("dispose",f));const E=w.program;i.updateUBOMapping(y,E);const C=e.render.frame;r[y.id]!==C&&(d(y),r[y.id]=C)}function h(y){const w=u();y.__bindingPointIndex=w;const x=s.createBuffer(),E=y.__size,C=y.usage;return s.bindBuffer(s.UNIFORM_BUFFER,x),s.bufferData(s.UNIFORM_BUFFER,E,C),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,w,x),x}function u(){for(let y=0;y0){C=x%E;const $=E-C;C!==0&&$-N.boundary<0&&(x+=E-C,A.__offset=x)}x+=N.storage}return C=x%E,C>0&&(x+=E-C),y.__size=x,y.__cache={},this}function p(y){const w=y.value,x={boundary:0,storage:0};return typeof w=="number"?(x.boundary=4,x.storage=4):w.isVector2?(x.boundary=8,x.storage=8):w.isVector3||w.isColor?(x.boundary=16,x.storage=12):w.isVector4?(x.boundary=16,x.storage=16):w.isMatrix3?(x.boundary=48,x.storage=48):w.isMatrix4?(x.boundary=64,x.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),x}function f(y){const w=y.target;w.removeEventListener("dispose",f);const x=o.indexOf(w.__bindingPointIndex);o.splice(x,1),s.deleteBuffer(n[w.id]),delete n[w.id],delete r[w.id]}function _(){for(const y in n)s.deleteBuffer(n[y]);o=[],n={},r={}}return{bind:c,update:l,dispose:_}}function Op(){const s=Ms("canvas");return s.style.display="block",s}function zp(s={}){this.isWebGLRenderer=!0;const e=s.canvas!==void 0?s.canvas:Op(),t=s.context!==void 0?s.context:null,i=s.depth!==void 0?s.depth:!0,n=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,c=s.powerPreference!==void 0?s.powerPreference:"default",l=s.failIfMajorPerformanceCaveat!==void 0?s.failIfMajorPerformanceCaveat:!1;let h;t!==null?h=t.getContextAttributes().alpha:h=s.alpha!==void 0?s.alpha:!1;let u=null,d=null;const m=[],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=Li,this.physicallyCorrectLights=!1,this.toneMapping=ei,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const p=this;let f=!1,_=0,y=0,w=null,x=-1,E=null;const C=new Je,L=new Je;let v=null,A=e.width,N=e.height,$=1,Q=null,B=null;const U=new Je(0,0,A,N),X=new Je(0,0,A,N);let Y=!1;const Z=new Pr;let V=!1,I=!1,z=null;const J=new We,j=new De,ne=new P,ue={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function _e(){return w===null?$:1}let D=t;function Ce(S,O){for(let H=0;H0?d=g[g.length-1]:d=null,m.pop(),m.length>0?u=m[m.length-1]:u=null};function ii(S,O,H,F){if(S.visible===!1)return;if(S.layers.test(O.layers)){if(S.isGroup)H=S.renderOrder;else if(S.isLOD)S.autoUpdate===!0&&S.update(O);else if(S.isLight)d.pushLight(S),S.castShadow&&d.pushShadow(S);else if(S.isSprite){if(!S.frustumCulled||Z.intersectsSprite(S)){F&&ne.setFromMatrixPosition(S.matrixWorld).applyMatrix4(J);const ve=qe.update(S),be=S.material;be.visible&&u.push(S,ve,be,H,ne.z,null)}}else if((S.isMesh||S.isLine||S.isPoints)&&(S.isSkinnedMesh&&S.skeleton.frame!==Pe.render.frame&&(S.skeleton.update(),S.skeleton.frame=Pe.render.frame),!S.frustumCulled||Z.intersectsObject(S))){F&&ne.setFromMatrixPosition(S.matrixWorld).applyMatrix4(J);const ve=qe.update(S),be=S.material;if(Array.isArray(be)){const Me=ve.groups;for(let Ie=0,we=Me.length;Ie0&&Ht(W,O,H),F&&he.viewport(C.copy(F)),W.length>0&&vt(W,O,H),de.length>0&&vt(de,O,H),ve.length>0&&vt(ve,O,H),he.buffers.depth.setTest(!0),he.buffers.depth.setMask(!0),he.buffers.color.setMask(!0),he.setPolygonOffset(!1)}function Ht(S,O,H){const F=xe.isWebGL2;z===null&&(z=new Fi(1,1,{generateMipmaps:!0,type:pe.has("EXT_color_buffer_half_float")?Cn:Ri,minFilter:Es,samples:F&&r===!0?4:0})),p.getDrawingBufferSize(j),F?z.setSize(j.x,j.y):z.setSize(_r(j.x),_r(j.y));const W=p.getRenderTarget();p.setRenderTarget(z),p.clear();const de=p.toneMapping;p.toneMapping=ei,vt(S,O,H),p.toneMapping=de,fe.updateMultisampleRenderTarget(z),fe.updateRenderTargetMipmap(z),p.setRenderTarget(W)}function vt(S,O,H){const F=O.isScene===!0?O.overrideMaterial:null;for(let W=0,de=S.length;W0&&fe.useMultisampledRTT(S)===!1?W=ye.get(S).__webglMultisampledFramebuffer:W=Ie,C.copy(S.viewport),L.copy(S.scissor),v=S.scissorTest}else C.copy(U).multiplyScalar($).floor(),L.copy(X).multiplyScalar($).floor(),v=Y;if(he.bindFramebuffer(D.FRAMEBUFFER,W)&&xe.drawBuffers&&F&&he.drawBuffers(S,W),he.viewport(C),he.scissor(L),he.setScissorTest(v),de){const Me=ye.get(S.texture);D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_CUBE_MAP_POSITIVE_X+O,Me.__webglTexture,H)}else if(ve){const Me=ye.get(S.texture),Ie=O||0;D.framebufferTextureLayer(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,Me.__webglTexture,H||0,Ie)}x=-1},this.readRenderTargetPixels=function(S,O,H,F,W,de,ve){if(!(S&&S.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let be=ye.get(S).__webglFramebuffer;if(S.isWebGLCubeRenderTarget&&ve!==void 0&&(be=be[ve]),be){he.bindFramebuffer(D.FRAMEBUFFER,be);try{const Me=S.texture,Ie=Me.format,we=Me.type;if(Ie!==Ot&&b.convert(Ie)!==D.getParameter(D.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Te=we===Cn&&(pe.has("EXT_color_buffer_half_float")||xe.isWebGL2&&pe.has("EXT_color_buffer_float"));if(we!==Ri&&b.convert(we)!==D.getParameter(D.IMPLEMENTATION_COLOR_READ_TYPE)&&!(we===bi&&(xe.isWebGL2||pe.has("OES_texture_float")||pe.has("WEBGL_color_buffer_float")))&&!Te){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}O>=0&&O<=S.width-F&&H>=0&&H<=S.height-W&&D.readPixels(O,H,F,W,b.convert(Ie),b.convert(we),de)}finally{const Me=w!==null?ye.get(w).__webglFramebuffer:null;he.bindFramebuffer(D.FRAMEBUFFER,Me)}}},this.copyFramebufferToTexture=function(S,O,H=0){const F=Math.pow(2,-H),W=Math.floor(O.image.width*F),de=Math.floor(O.image.height*F);fe.setTexture2D(O,0),D.copyTexSubImage2D(D.TEXTURE_2D,H,0,0,S.x,S.y,W,de),he.unbindTexture()},this.copyTextureToTexture=function(S,O,H,F=0){const W=O.image.width,de=O.image.height,ve=b.convert(H.format),be=b.convert(H.type);fe.setTexture2D(H,0),D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,H.flipY),D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),D.pixelStorei(D.UNPACK_ALIGNMENT,H.unpackAlignment),O.isDataTexture?D.texSubImage2D(D.TEXTURE_2D,F,S.x,S.y,W,de,ve,be,O.image.data):O.isCompressedTexture?D.compressedTexSubImage2D(D.TEXTURE_2D,F,S.x,S.y,O.mipmaps[0].width,O.mipmaps[0].height,ve,O.mipmaps[0].data):D.texSubImage2D(D.TEXTURE_2D,F,S.x,S.y,ve,be,O.image),F===0&&H.generateMipmaps&&D.generateMipmap(D.TEXTURE_2D),he.unbindTexture()},this.copyTextureToTexture3D=function(S,O,H,F,W=0){if(p.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const de=S.max.x-S.min.x+1,ve=S.max.y-S.min.y+1,be=S.max.z-S.min.z+1,Me=b.convert(F.format),Ie=b.convert(F.type);let we;if(F.isData3DTexture)fe.setTexture3D(F,0),we=D.TEXTURE_3D;else if(F.isDataArrayTexture)fe.setTexture2DArray(F,0),we=D.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,F.flipY),D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,F.premultiplyAlpha),D.pixelStorei(D.UNPACK_ALIGNMENT,F.unpackAlignment);const Te=D.getParameter(D.UNPACK_ROW_LENGTH),Be=D.getParameter(D.UNPACK_IMAGE_HEIGHT),fi=D.getParameter(D.UNPACK_SKIP_PIXELS),Ui=D.getParameter(D.UNPACK_SKIP_ROWS),Ni=D.getParameter(D.UNPACK_SKIP_IMAGES),It=H.isCompressedTexture?H.mipmaps[0]:H.image;D.pixelStorei(D.UNPACK_ROW_LENGTH,It.width),D.pixelStorei(D.UNPACK_IMAGE_HEIGHT,It.height),D.pixelStorei(D.UNPACK_SKIP_PIXELS,S.min.x),D.pixelStorei(D.UNPACK_SKIP_ROWS,S.min.y),D.pixelStorei(D.UNPACK_SKIP_IMAGES,S.min.z),H.isDataTexture||H.isData3DTexture?D.texSubImage3D(we,W,O.x,O.y,O.z,de,ve,be,Me,Ie,It.data):H.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),D.compressedTexSubImage3D(we,W,O.x,O.y,O.z,de,ve,be,Me,It.data)):D.texSubImage3D(we,W,O.x,O.y,O.z,de,ve,be,Me,Ie,It),D.pixelStorei(D.UNPACK_ROW_LENGTH,Te),D.pixelStorei(D.UNPACK_IMAGE_HEIGHT,Be),D.pixelStorei(D.UNPACK_SKIP_PIXELS,fi),D.pixelStorei(D.UNPACK_SKIP_ROWS,Ui),D.pixelStorei(D.UNPACK_SKIP_IMAGES,Ni),W===0&&F.generateMipmaps&&D.generateMipmap(we),he.unbindTexture()},this.initTexture=function(S){S.isCubeTexture?fe.setTextureCube(S,0):S.isData3DTexture?fe.setTexture3D(S,0):S.isDataArrayTexture?fe.setTexture2DArray(S,0):fe.setTexture2D(S,0),he.unbindTexture()},this.resetState=function(){_=0,y=0,w=null,he.reset(),q.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Bp extends Ko{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}var Tn=function(){var s=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(h){h.preventDefault(),i(++s%e.children.length)},!1);function t(h){return e.appendChild(h.dom),h}function i(h){for(var u=0;u=r+1e3&&(a.update(o*1e3/(h-r),100),r=h,o=0,l)){var u=performance.memory;l.update(u.usedJSHeapSize/1048576,u.jsHeapSizeLimit/1048576)}return h},update:function(){n=this.end()},domElement:e,setMode:i}};Tn.Panel=function(s,e,t){var i=1/0,n=0,r=Math.round,o=r(window.devicePixelRatio||1),a=80*o,c=48*o,l=3*o,h=2*o,u=3*o,d=15*o,m=74*o,g=30*o,p=document.createElement("canvas");p.width=a,p.height=c,p.style.cssText="width:80px;height:48px";var f=p.getContext("2d");return f.font="bold "+9*o+"px Helvetica,Arial,sans-serif",f.textBaseline="top",f.fillStyle=t,f.fillRect(0,0,a,c),f.fillStyle=e,f.fillText(s,l,h),f.fillRect(u,d,m,g),f.fillStyle=t,f.globalAlpha=.9,f.fillRect(u,d,m,g),{dom:p,update:function(_,y){i=Math.min(i,_),n=Math.max(n,_),f.fillStyle=t,f.globalAlpha=1,f.fillRect(0,0,a,d),f.fillStyle=e,f.fillText(r(_)+" "+s+" ("+r(i)+"-"+r(n)+")",l,h),f.drawImage(p,u+o,d,m-o,g,u,d,m-o,g),f.fillRect(u+m-o,d,o,g),f.fillStyle=t,f.globalAlpha=.9,f.fillRect(u+m-o,d,o,r((1-_/y)*g))}}};const Gp=Tn;class kp extends Qe{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,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.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class Hp extends gn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Le(16777215),this.specular=new Le(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ho,this.normalScale=new De(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Rr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,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.fog=e.fog,this}}var Vp="out vec2 groundUV;",Wp="groundUV = uv;",Xp=`in vec2 groundUV; -uniform float cellSize;`,qp=`vec2 position = floor(groundUV * cellSize); +`;function Ap(s,e,t){let i=new Pr;const n=new De,r=new De,o=new Je,a=new Sp({depthPacking:wc}),c=new Ep,l={},h=t.maxTextureSize,u={0:Tt,1:cn,2:Jt},d=new Pi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new De},radius:{value:4}},vertexShader:wp,fragmentShader:Tp}),m=d.clone();m.defines.HORIZONTAL_PASS=1;const g=new kt;g.setAttribute("position",new zt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const p=new Qt(g,d),f=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=No,this.render=function(x,E,C){if(f.enabled===!1||f.autoUpdate===!1&&f.needsUpdate===!1||x.length===0)return;const L=s.getRenderTarget(),v=s.getActiveCubeFace(),A=s.getActiveMipmapLevel(),N=s.state;N.setBlending(di),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);for(let $=0,Q=x.length;$h||n.y>h)&&(n.x>h&&(r.x=Math.floor(h/X.x),n.x=r.x*X.x,U.mapSize.x=r.x),n.y>h&&(r.y=Math.floor(h/X.y),n.y=r.y*X.y,U.mapSize.y=r.y)),U.map===null){const Z=this.type!==En?{minFilter:ct,magFilter:ct}:{};U.map=new Fi(n.x,n.y,Z),U.map.texture.name=B.name+".shadowMap",U.camera.updateProjectionMatrix()}s.setRenderTarget(U.map),s.clear();const Y=U.getViewportCount();for(let Z=0;Z0){const Q=N.uuid,B=E.uuid;let U=l[Q];U===void 0&&(U={},l[Q]=U);let X=U[B];X===void 0&&(X=N.clone(),U[B]=X),N=X}return N.visible=E.visible,N.wireframe=E.wireframe,A===En?N.side=E.shadowSide!==null?E.shadowSide:E.side:N.side=E.shadowSide!==null?E.shadowSide:u[E.side],N.alphaMap=E.alphaMap,N.alphaTest=E.alphaTest,N.clipShadows=E.clipShadows,N.clippingPlanes=E.clippingPlanes,N.clipIntersection=E.clipIntersection,N.displacementMap=E.displacementMap,N.displacementScale=E.displacementScale,N.displacementBias=E.displacementBias,N.wireframeLinewidth=E.wireframeLinewidth,N.linewidth=E.linewidth,C.isPointLight===!0&&N.isMeshDistanceMaterial===!0&&(N.referencePosition.setFromMatrixPosition(C.matrixWorld),N.nearDistance=L,N.farDistance=v),N}function w(x,E,C,L,v){if(x.visible===!1)return;if(x.layers.test(E.layers)&&(x.isMesh||x.isLine||x.isPoints)&&(x.castShadow||x.receiveShadow&&v===En)&&(!x.frustumCulled||i.intersectsObject(x))){x.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,x.matrixWorld);const $=e.update(x),Q=x.material;if(Array.isArray(Q)){const B=$.groups;for(let U=0,X=B.length;U=1):V.indexOf("OpenGL ES")!==-1&&(Z=parseFloat(/^OpenGL ES (\d)/.exec(V)[1]),Y=Z>=2);let I=null,z={};const J=s.getParameter(s.SCISSOR_BOX),j=s.getParameter(s.VIEWPORT),ne=new Je().fromArray(J),ue=new Je().fromArray(j);function _e(R,se,G){const ce=new Uint8Array(4),le=s.createTexture();s.bindTexture(R,le),s.texParameteri(R,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(R,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let Ae=0;AeK||T.height>K)&&(ee=K/Math.max(T.width,T.height)),ee<1||M===!0)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap){const ae=M?_r:Math.floor,me=ae(ee*T.width),b=ae(ee*T.height);p===void 0&&(p=y(me,b));const q=k?y(me,b):p;return q.width=me,q.height=b,q.getContext("2d").drawImage(T,0,0,me,b),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+T.width+"x"+T.height+") to ("+me+"x"+b+")."),q}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+T.width+"x"+T.height+")."),T;return T}function x(T){return Gr(T.width)&&Gr(T.height)}function E(T){return a?!1:T.wrapS!==Pt||T.wrapT!==Pt||T.minFilter!==ct&&T.minFilter!==St}function C(T,M){return T.generateMipmaps&&M&&T.minFilter!==ct&&T.minFilter!==St}function L(T){s.generateMipmap(T)}function v(T,M,k,K,ee=!1){if(a===!1)return M;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 ae=M;return M===s.RED&&(k===s.FLOAT&&(ae=s.R32F),k===s.HALF_FLOAT&&(ae=s.R16F),k===s.UNSIGNED_BYTE&&(ae=s.R8)),M===s.RG&&(k===s.FLOAT&&(ae=s.RG32F),k===s.HALF_FLOAT&&(ae=s.RG16F),k===s.UNSIGNED_BYTE&&(ae=s.RG8)),M===s.RGBA&&(k===s.FLOAT&&(ae=s.RGBA32F),k===s.HALF_FLOAT&&(ae=s.RGBA16F),k===s.UNSIGNED_BYTE&&(ae=K===Oe&&ee===!1?s.SRGB8_ALPHA8:s.RGBA8),k===s.UNSIGNED_SHORT_4_4_4_4&&(ae=s.RGBA4),k===s.UNSIGNED_SHORT_5_5_5_1&&(ae=s.RGB5_A1)),(ae===s.R16F||ae===s.R32F||ae===s.RG16F||ae===s.RG32F||ae===s.RGBA16F||ae===s.RGBA32F)&&e.get("EXT_color_buffer_float"),ae}function A(T,M,k){return C(T,k)===!0||T.isFramebufferTexture&&T.minFilter!==ct&&T.minFilter!==St?Math.log2(Math.max(M.width,M.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?M.mipmaps.length:1}function N(T){return T===ct||T===ia||T===na?s.NEAREST:s.LINEAR}function $(T){const M=T.target;M.removeEventListener("dispose",$),B(M),M.isVideoTexture&&g.delete(M)}function Q(T){const M=T.target;M.removeEventListener("dispose",Q),X(M)}function B(T){const M=i.get(T);if(M.__webglInit===void 0)return;const k=T.source,K=f.get(k);if(K){const ee=K[M.__cacheKey];ee.usedTimes--,ee.usedTimes===0&&U(T),Object.keys(K).length===0&&f.delete(k)}i.remove(T)}function U(T){const M=i.get(T);s.deleteTexture(M.__webglTexture);const k=T.source,K=f.get(k);delete K[M.__cacheKey],o.memory.textures--}function X(T){const M=T.texture,k=i.get(T),K=i.get(M);if(K.__webglTexture!==void 0&&(s.deleteTexture(K.__webglTexture),o.memory.textures--),T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let ee=0;ee<6;ee++)s.deleteFramebuffer(k.__webglFramebuffer[ee]),k.__webglDepthbuffer&&s.deleteRenderbuffer(k.__webglDepthbuffer[ee]);else{if(s.deleteFramebuffer(k.__webglFramebuffer),k.__webglDepthbuffer&&s.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&s.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let ee=0;ee=c&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+c),Y+=1,T}function I(T){const M=[];return M.push(T.wrapS),M.push(T.wrapT),M.push(T.magFilter),M.push(T.minFilter),M.push(T.anisotropy),M.push(T.internalFormat),M.push(T.format),M.push(T.type),M.push(T.generateMipmaps),M.push(T.premultiplyAlpha),M.push(T.flipY),M.push(T.unpackAlignment),M.push(T.encoding),M.join()}function z(T,M){const k=i.get(T);if(T.isVideoTexture&&xt(T),T.isRenderTargetTexture===!1&&T.version>0&&k.__version!==T.version){const K=T.image;if(K===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(K.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{pe(k,T,M);return}}t.activeTexture(s.TEXTURE0+M),t.bindTexture(s.TEXTURE_2D,k.__webglTexture)}function J(T,M){const k=i.get(T);if(T.version>0&&k.__version!==T.version){pe(k,T,M);return}t.activeTexture(s.TEXTURE0+M),t.bindTexture(s.TEXTURE_2D_ARRAY,k.__webglTexture)}function j(T,M){const k=i.get(T);if(T.version>0&&k.__version!==T.version){pe(k,T,M);return}t.activeTexture(s.TEXTURE0+M),t.bindTexture(s.TEXTURE_3D,k.__webglTexture)}function ne(T,M){const k=i.get(T);if(T.version>0&&k.__version!==T.version){xe(k,T,M);return}t.activeTexture(s.TEXTURE0+M),t.bindTexture(s.TEXTURE_CUBE_MAP,k.__webglTexture)}const ue={[yr]:s.REPEAT,[Pt]:s.CLAMP_TO_EDGE,[br]:s.MIRRORED_REPEAT},_e={[ct]:s.NEAREST,[ia]:s.NEAREST_MIPMAP_NEAREST,[na]:s.NEAREST_MIPMAP_LINEAR,[St]:s.LINEAR,[lc]:s.LINEAR_MIPMAP_NEAREST,[Es]:s.LINEAR_MIPMAP_LINEAR};function D(T,M,k){if(k?(s.texParameteri(T,s.TEXTURE_WRAP_S,ue[M.wrapS]),s.texParameteri(T,s.TEXTURE_WRAP_T,ue[M.wrapT]),(T===s.TEXTURE_3D||T===s.TEXTURE_2D_ARRAY)&&s.texParameteri(T,s.TEXTURE_WRAP_R,ue[M.wrapR]),s.texParameteri(T,s.TEXTURE_MAG_FILTER,_e[M.magFilter]),s.texParameteri(T,s.TEXTURE_MIN_FILTER,_e[M.minFilter])):(s.texParameteri(T,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(T,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),(T===s.TEXTURE_3D||T===s.TEXTURE_2D_ARRAY)&&s.texParameteri(T,s.TEXTURE_WRAP_R,s.CLAMP_TO_EDGE),(M.wrapS!==Pt||M.wrapT!==Pt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),s.texParameteri(T,s.TEXTURE_MAG_FILTER,N(M.magFilter)),s.texParameteri(T,s.TEXTURE_MIN_FILTER,N(M.minFilter)),M.minFilter!==ct&&M.minFilter!==St&&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 K=e.get("EXT_texture_filter_anisotropic");if(M.type===bi&&e.has("OES_texture_float_linear")===!1||a===!1&&M.type===Cn&&e.has("OES_texture_half_float_linear")===!1)return;(M.anisotropy>1||i.get(M).__currentAnisotropy)&&(s.texParameterf(T,K.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(M.anisotropy,n.getMaxAnisotropy())),i.get(M).__currentAnisotropy=M.anisotropy)}}function Ce(T,M){let k=!1;T.__webglInit===void 0&&(T.__webglInit=!0,M.addEventListener("dispose",$));const K=M.source;let ee=f.get(K);ee===void 0&&(ee={},f.set(K,ee));const ae=I(M);if(ae!==T.__cacheKey){ee[ae]===void 0&&(ee[ae]={texture:s.createTexture(),usedTimes:0},o.memory.textures++,k=!0),ee[ae].usedTimes++;const me=ee[T.__cacheKey];me!==void 0&&(ee[T.__cacheKey].usedTimes--,me.usedTimes===0&&U(M)),T.__cacheKey=ae,T.__webglTexture=ee[ae].texture}return k}function pe(T,M,k){let K=s.TEXTURE_2D;M.isDataArrayTexture&&(K=s.TEXTURE_2D_ARRAY),M.isData3DTexture&&(K=s.TEXTURE_3D);const ee=Ce(T,M),ae=M.source;if(t.activeTexture(s.TEXTURE0+k),t.bindTexture(K,T.__webglTexture),ae.version!==ae.__currentVersion||ee===!0){s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,M.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,M.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,M.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE);const me=E(M)&&x(M.image)===!1;let b=w(M.image,me,!1,h);b=ut(M,b);const q=x(b)||a,te=r.convert(M.format,M.encoding);let oe=r.convert(M.type),re=v(M.internalFormat,te,oe,M.encoding,M.isVideoTexture);D(K,M,q);let ge;const Ee=M.mipmaps,Ne=a&&M.isVideoTexture!==!0,R=ae.__currentVersion===void 0||ee===!0,se=A(M,b,q);if(M.isDepthTexture)re=s.DEPTH_COMPONENT,a?M.type===bi?re=s.DEPTH_COMPONENT32F:M.type===yi?re=s.DEPTH_COMPONENT24:M.type===ln?re=s.DEPTH24_STENCIL8:re=s.DEPTH_COMPONENT16:M.type===bi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),M.format===Ti&&re===s.DEPTH_COMPONENT&&M.type!==ko&&M.type!==yi&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),M.type=yi,oe=r.convert(M.type)),M.format===dn&&re===s.DEPTH_COMPONENT&&(re=s.DEPTH_STENCIL,M.type!==ln&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),M.type=ln,oe=r.convert(M.type))),R&&(Ne?t.texStorage2D(s.TEXTURE_2D,1,re,b.width,b.height):t.texImage2D(s.TEXTURE_2D,0,re,b.width,b.height,0,te,oe,null));else if(M.isDataTexture)if(Ee.length>0&&q){Ne&&R&&t.texStorage2D(s.TEXTURE_2D,se,re,Ee[0].width,Ee[0].height);for(let G=0,ce=Ee.length;G>=1,ce>>=1}}else if(Ee.length>0&&q){Ne&&R&&t.texStorage2D(s.TEXTURE_2D,se,re,Ee[0].width,Ee[0].height);for(let G=0,ce=Ee.length;G0&&R++,t.texStorage2D(s.TEXTURE_CUBE_MAP,R,ge,b[0].width,b[0].height));for(let G=0;G<6;G++)if(me){Ee?t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+G,0,0,0,b[G].width,b[G].height,oe,re,b[G].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+G,0,ge,b[G].width,b[G].height,0,oe,re,b[G].data);for(let ce=0;ce0&&Fe(T)===!1){const b=ae?M:[M];k.__webglMultisampledFramebuffer=s.createFramebuffer(),k.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,k.__webglMultisampledFramebuffer);for(let q=0;q0&&Fe(T)===!1){const M=T.isWebGLMultipleRenderTargets?T.texture:[T.texture],k=T.width,K=T.height;let ee=s.COLOR_BUFFER_BIT;const ae=[],me=T.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,b=i.get(T),q=T.isWebGLMultipleRenderTargets===!0;if(q)for(let te=0;te0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&M.__useRenderToTexture!==!1}function xt(T){const M=o.render.frame;g.get(T)!==M&&(g.set(T,M),T.update())}function ut(T,M){const k=T.encoding,K=T.format,ee=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||T.format===Sr||k!==Li&&(k===Oe?a===!1?e.has("EXT_sRGB")===!0&&K===Ot?(T.format=Sr,T.minFilter=St,T.generateMipmaps=!1):M=tl.sRGBToLinear(M):(K!==Ot||ee!==Ri)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",k)),M}this.allocateTextureUnit=V,this.resetTextureUnits=Z,this.setTexture2D=z,this.setTexture2DArray=J,this.setTexture3D=j,this.setTextureCube=ne,this.rebindTextures=ke,this.setupRenderTarget=et,this.updateRenderTargetMipmap=Xe,this.updateMultisampleRenderTarget=ht,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=he,this.useMultisampledRTT=Fe}function Lp(s,e,t){const i=t.isWebGL2;function n(r,o=null){let a;if(r===Ri)return s.UNSIGNED_BYTE;if(r===dc)return s.UNSIGNED_SHORT_4_4_4_4;if(r===fc)return s.UNSIGNED_SHORT_5_5_5_1;if(r===cc)return s.BYTE;if(r===hc)return s.SHORT;if(r===ko)return s.UNSIGNED_SHORT;if(r===uc)return s.INT;if(r===yi)return s.UNSIGNED_INT;if(r===bi)return s.FLOAT;if(r===Cn)return i?s.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(r===pc)return s.ALPHA;if(r===Ot)return s.RGBA;if(r===gc)return s.LUMINANCE;if(r===_c)return s.LUMINANCE_ALPHA;if(r===Ti)return s.DEPTH_COMPONENT;if(r===dn)return s.DEPTH_STENCIL;if(r===xc)return s.RED;if(r===mc)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),s.RGBA;if(r===Sr)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(r===vc)return s.RED_INTEGER;if(r===Mc)return s.RG;if(r===yc)return s.RG_INTEGER;if(r===bc)return s.RGBA_INTEGER;if(r===Gs||r===ks||r===Hs||r===Vs)if(o===Oe)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(r===Gs)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===ks)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Hs)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Vs)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(r===Gs)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===ks)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Hs)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Vs)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===sa||r===ra||r===aa||r===oa)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(r===sa)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===ra)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===aa)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===oa)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===Sc)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===la||r===ca)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(r===la)return o===Oe?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(r===ca)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===ha||r===ua||r===da||r===fa||r===pa||r===ma||r===ga||r===_a||r===xa||r===va||r===Ma||r===ya||r===ba||r===Sa)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(r===ha)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===ua)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===da)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===fa)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===pa)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===ma)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===ga)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===_a)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===xa)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===va)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===Ma)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===ya)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===ba)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===Sa)return o===Oe?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Ea)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(r===Ea)return o===Oe?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return r===ln?i?s.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):s[r]!==void 0?s[r]:null}return{convert:n}}class Dp extends Et{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class us extends Qe{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Pp={type:"move"};class fr{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new us,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 us,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new us,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),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,i){let n=null,r=null,o=null;const a=this._targetRay,c=this._grip,l=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(l&&e.hand){o=!0;for(const p of e.hand.values()){const f=t.getJointPose(p,i);if(l.joints[p.jointName]===void 0){const y=new us;y.matrixAutoUpdate=!1,y.visible=!1,l.joints[p.jointName]=y,l.add(y)}const _=l.joints[p.jointName];f!==null&&(_.matrix.fromArray(f.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.jointRadius=f.radius),_.visible=f!==null}const h=l.joints["index-finger-tip"],u=l.joints["thumb-tip"],d=h.position.distanceTo(u.position),m=.02,g=.005;l.inputState.pinching&&d>m+g?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&d<=m-g&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1));a!==null&&(n=t.getPose(e.targetRaySpace,i),n===null&&r!==null&&(n=r),n!==null&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Pp)))}return a!==null&&(a.visible=n!==null),c!==null&&(c.visible=r!==null),l!==null&&(l.visible=o!==null),this}}class Fp extends Ft{constructor(e,t,i,n,r,o,a,c,l,h){if(h=h!==void 0?h:Ti,h!==Ti&&h!==dn)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===Ti&&(i=yi),i===void 0&&h===dn&&(i=ln),super(null,n,r,o,a,c,h,i,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:ct,this.minFilter=c!==void 0?c:ct,this.flipY=!1,this.generateMipmaps=!1}}class Ip extends pn{constructor(e,t){super();const i=this;let n=null,r=1,o=null,a="local-floor",c=null,l=null,h=null,u=null,d=null,m=null;const g=t.getContextAttributes();let p=null,f=null;const _=[],y=[],w=new Et;w.layers.enable(1),w.viewport=new Je;const x=new Et;x.layers.enable(2),x.viewport=new Je;const E=[w,x],C=new Dp;C.layers.enable(1),C.layers.enable(2);let L=null,v=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(I){let z=_[I];return z===void 0&&(z=new fr,_[I]=z),z.getTargetRaySpace()},this.getControllerGrip=function(I){let z=_[I];return z===void 0&&(z=new fr,_[I]=z),z.getGripSpace()},this.getHand=function(I){let z=_[I];return z===void 0&&(z=new fr,_[I]=z),z.getHandSpace()};function A(I){const z=y.indexOf(I.inputSource);if(z===-1)return;const J=_[z];J!==void 0&&J.dispatchEvent({type:I.type,data:I.inputSource})}function N(){n.removeEventListener("select",A),n.removeEventListener("selectstart",A),n.removeEventListener("selectend",A),n.removeEventListener("squeeze",A),n.removeEventListener("squeezestart",A),n.removeEventListener("squeezeend",A),n.removeEventListener("end",N),n.removeEventListener("inputsourceschange",$);for(let I=0;I<_.length;I++){const z=y[I];z!==null&&(y[I]=null,_[I].disconnect(z))}L=null,v=null,e.setRenderTarget(p),d=null,u=null,h=null,n=null,f=null,V.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(I){r=I,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(I){a=I,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(I){c=I},this.getBaseLayer=function(){return u!==null?u:d},this.getBinding=function(){return h},this.getFrame=function(){return m},this.getSession=function(){return n},this.setSession=async function(I){if(n=I,n!==null){if(p=e.getRenderTarget(),n.addEventListener("select",A),n.addEventListener("selectstart",A),n.addEventListener("selectend",A),n.addEventListener("squeeze",A),n.addEventListener("squeezestart",A),n.addEventListener("squeezeend",A),n.addEventListener("end",N),n.addEventListener("inputsourceschange",$),g.xrCompatible!==!0&&await t.makeXRCompatible(),n.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const z={antialias:n.renderState.layers===void 0?g.antialias:!0,alpha:g.alpha,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(n,t,z),n.updateRenderState({baseLayer:d}),f=new Fi(d.framebufferWidth,d.framebufferHeight,{format:Ot,type:Ri,encoding:e.outputEncoding,stencilBuffer:g.stencil})}else{let z=null,J=null,j=null;g.depth&&(j=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,z=g.stencil?dn:Ti,J=g.stencil?ln:yi);const ne={colorFormat:t.RGBA8,depthFormat:j,scaleFactor:r};h=new XRWebGLBinding(n,t),u=h.createProjectionLayer(ne),n.updateRenderState({layers:[u]}),f=new Fi(u.textureWidth,u.textureHeight,{format:Ot,type:Ri,depthTexture:new Fp(u.textureWidth,u.textureHeight,J,void 0,void 0,void 0,void 0,void 0,void 0,z),stencilBuffer:g.stencil,encoding:e.outputEncoding,samples:g.antialias?4:0});const ue=e.properties.get(f);ue.__ignoreDepthValues=u.ignoreDepthValues}f.isXRRenderTarget=!0,this.setFoveation(1),c=null,o=await n.requestReferenceSpace(a),V.setContext(n),V.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function $(I){for(let z=0;z=0&&(y[j]=null,_[j].dispatchEvent({type:"disconnected",data:J}))}for(let z=0;z=y.length){y.push(J),j=ue;break}else if(y[ue]===null){y[ue]=J,j=ue;break}if(j===-1)break}const ne=_[j];ne&&ne.dispatchEvent({type:"connected",data:J})}}const Q=new P,B=new P;function U(I,z,J){Q.setFromMatrixPosition(z.matrixWorld),B.setFromMatrixPosition(J.matrixWorld);const j=Q.distanceTo(B),ne=z.projectionMatrix.elements,ue=J.projectionMatrix.elements,_e=ne[14]/(ne[10]-1),D=ne[14]/(ne[10]+1),Ce=(ne[9]+1)/ne[5],pe=(ne[9]-1)/ne[5],xe=(ne[8]-1)/ne[0],he=(ue[8]+1)/ue[0],Pe=_e*xe,ye=_e*he,fe=j/(-xe+he),ke=fe*-xe;z.matrixWorld.decompose(I.position,I.quaternion,I.scale),I.translateX(ke),I.translateZ(fe),I.matrixWorld.compose(I.position,I.quaternion,I.scale),I.matrixWorldInverse.copy(I.matrixWorld).invert();const et=_e+fe,Xe=D+fe,ht=Pe-ke,qe=ye+(j-ke),Fe=Ce*D/Xe*et,xt=pe*D/Xe*et;I.projectionMatrix.makePerspective(ht,qe,Fe,xt,et,Xe)}function X(I,z){z===null?I.matrixWorld.copy(I.matrix):I.matrixWorld.multiplyMatrices(z.matrixWorld,I.matrix),I.matrixWorldInverse.copy(I.matrixWorld).invert()}this.updateCamera=function(I){if(n===null)return;C.near=x.near=w.near=I.near,C.far=x.far=w.far=I.far,(L!==C.near||v!==C.far)&&(n.updateRenderState({depthNear:C.near,depthFar:C.far}),L=C.near,v=C.far);const z=I.parent,J=C.cameras;X(C,z);for(let ne=0;ne0&&(p.alphaTest.value=f.alphaTest);const _=e.get(f).envMap;if(_&&(p.envMap.value=_,p.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=f.reflectivity,p.ior.value=f.ior,p.refractionRatio.value=f.refractionRatio),f.lightMap){p.lightMap.value=f.lightMap;const x=s.physicallyCorrectLights!==!0?Math.PI:1;p.lightMapIntensity.value=f.lightMapIntensity*x}f.aoMap&&(p.aoMap.value=f.aoMap,p.aoMapIntensity.value=f.aoMapIntensity);let y;f.map?y=f.map:f.specularMap?y=f.specularMap:f.displacementMap?y=f.displacementMap:f.normalMap?y=f.normalMap:f.bumpMap?y=f.bumpMap:f.roughnessMap?y=f.roughnessMap:f.metalnessMap?y=f.metalnessMap:f.alphaMap?y=f.alphaMap:f.emissiveMap?y=f.emissiveMap:f.clearcoatMap?y=f.clearcoatMap:f.clearcoatNormalMap?y=f.clearcoatNormalMap:f.clearcoatRoughnessMap?y=f.clearcoatRoughnessMap:f.iridescenceMap?y=f.iridescenceMap:f.iridescenceThicknessMap?y=f.iridescenceThicknessMap:f.specularIntensityMap?y=f.specularIntensityMap:f.specularColorMap?y=f.specularColorMap:f.transmissionMap?y=f.transmissionMap:f.thicknessMap?y=f.thicknessMap:f.sheenColorMap?y=f.sheenColorMap:f.sheenRoughnessMap&&(y=f.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),p.uvTransform.value.copy(y.matrix));let w;f.aoMap?w=f.aoMap:f.lightMap&&(w=f.lightMap),w!==void 0&&(w.isWebGLRenderTarget&&(w=w.texture),w.matrixAutoUpdate===!0&&w.updateMatrix(),p.uv2Transform.value.copy(w.matrix))}function r(p,f){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity}function o(p,f){p.dashSize.value=f.dashSize,p.totalSize.value=f.dashSize+f.gapSize,p.scale.value=f.scale}function a(p,f,_,y){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity,p.size.value=f.size*_,p.scale.value=y*.5,f.map&&(p.map.value=f.map),f.alphaMap&&(p.alphaMap.value=f.alphaMap),f.alphaTest>0&&(p.alphaTest.value=f.alphaTest);let w;f.map?w=f.map:f.alphaMap&&(w=f.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),p.uvTransform.value.copy(w.matrix))}function c(p,f){p.diffuse.value.copy(f.color),p.opacity.value=f.opacity,p.rotation.value=f.rotation,f.map&&(p.map.value=f.map),f.alphaMap&&(p.alphaMap.value=f.alphaMap),f.alphaTest>0&&(p.alphaTest.value=f.alphaTest);let _;f.map?_=f.map:f.alphaMap&&(_=f.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),p.uvTransform.value.copy(_.matrix))}function l(p,f){p.specular.value.copy(f.specular),p.shininess.value=Math.max(f.shininess,1e-4)}function h(p,f){f.gradientMap&&(p.gradientMap.value=f.gradientMap)}function u(p,f){p.roughness.value=f.roughness,p.metalness.value=f.metalness,f.roughnessMap&&(p.roughnessMap.value=f.roughnessMap),f.metalnessMap&&(p.metalnessMap.value=f.metalnessMap),e.get(f).envMap&&(p.envMapIntensity.value=f.envMapIntensity)}function d(p,f,_){p.ior.value=f.ior,f.sheen>0&&(p.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),p.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(p.sheenColorMap.value=f.sheenColorMap),f.sheenRoughnessMap&&(p.sheenRoughnessMap.value=f.sheenRoughnessMap)),f.clearcoat>0&&(p.clearcoat.value=f.clearcoat,p.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(p.clearcoatMap.value=f.clearcoatMap),f.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap),f.clearcoatNormalMap&&(p.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),p.clearcoatNormalMap.value=f.clearcoatNormalMap,f.side===Tt&&p.clearcoatNormalScale.value.negate())),f.iridescence>0&&(p.iridescence.value=f.iridescence,p.iridescenceIOR.value=f.iridescenceIOR,p.iridescenceThicknessMinimum.value=f.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=f.iridescenceThicknessRange[1],f.iridescenceMap&&(p.iridescenceMap.value=f.iridescenceMap),f.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=f.iridescenceThicknessMap)),f.transmission>0&&(p.transmission.value=f.transmission,p.transmissionSamplerMap.value=_.texture,p.transmissionSamplerSize.value.set(_.width,_.height),f.transmissionMap&&(p.transmissionMap.value=f.transmissionMap),p.thickness.value=f.thickness,f.thicknessMap&&(p.thicknessMap.value=f.thicknessMap),p.attenuationDistance.value=f.attenuationDistance,p.attenuationColor.value.copy(f.attenuationColor)),p.specularIntensity.value=f.specularIntensity,p.specularColor.value.copy(f.specularColor),f.specularIntensityMap&&(p.specularIntensityMap.value=f.specularIntensityMap),f.specularColorMap&&(p.specularColorMap.value=f.specularColorMap)}function m(p,f){f.matcap&&(p.matcap.value=f.matcap)}function g(p,f){p.referencePosition.value.copy(f.referencePosition),p.nearDistance.value=f.nearDistance,p.farDistance.value=f.farDistance}return{refreshFogUniforms:t,refreshMaterialUniforms:i}}function Np(s,e,t,i){let n={},r={},o=[];const a=t.isWebGL2?s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(y,w){const x=w.program;i.uniformBlockBinding(y,x)}function l(y,w){let x=n[y.id];x===void 0&&(g(y),x=h(y),n[y.id]=x,y.addEventListener("dispose",f));const E=w.program;i.updateUBOMapping(y,E);const C=e.render.frame;r[y.id]!==C&&(d(y),r[y.id]=C)}function h(y){const w=u();y.__bindingPointIndex=w;const x=s.createBuffer(),E=y.__size,C=y.usage;return s.bindBuffer(s.UNIFORM_BUFFER,x),s.bufferData(s.UNIFORM_BUFFER,E,C),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,w,x),x}function u(){for(let y=0;y0){C=x%E;const $=E-C;C!==0&&$-N.boundary<0&&(x+=E-C,A.__offset=x)}x+=N.storage}return C=x%E,C>0&&(x+=E-C),y.__size=x,y.__cache={},this}function p(y){const w=y.value,x={boundary:0,storage:0};return typeof w=="number"?(x.boundary=4,x.storage=4):w.isVector2?(x.boundary=8,x.storage=8):w.isVector3||w.isColor?(x.boundary=16,x.storage=12):w.isVector4?(x.boundary=16,x.storage=16):w.isMatrix3?(x.boundary=48,x.storage=48):w.isMatrix4?(x.boundary=64,x.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),x}function f(y){const w=y.target;w.removeEventListener("dispose",f);const x=o.indexOf(w.__bindingPointIndex);o.splice(x,1),s.deleteBuffer(n[w.id]),delete n[w.id],delete r[w.id]}function _(){for(const y in n)s.deleteBuffer(n[y]);o=[],n={},r={}}return{bind:c,update:l,dispose:_}}function Op(){const s=Ms("canvas");return s.style.display="block",s}function zp(s={}){this.isWebGLRenderer=!0;const e=s.canvas!==void 0?s.canvas:Op(),t=s.context!==void 0?s.context:null,i=s.depth!==void 0?s.depth:!0,n=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,c=s.powerPreference!==void 0?s.powerPreference:"default",l=s.failIfMajorPerformanceCaveat!==void 0?s.failIfMajorPerformanceCaveat:!1;let h;t!==null?h=t.getContextAttributes().alpha:h=s.alpha!==void 0?s.alpha:!1;let u=null,d=null;const m=[],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=Li,this.physicallyCorrectLights=!1,this.toneMapping=ei,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const p=this;let f=!1,_=0,y=0,w=null,x=-1,E=null;const C=new Je,L=new Je;let v=null,A=e.width,N=e.height,$=1,Q=null,B=null;const U=new Je(0,0,A,N),X=new Je(0,0,A,N);let Y=!1;const Z=new Pr;let V=!1,I=!1,z=null;const J=new We,j=new De,ne=new P,ue={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function _e(){return w===null?$:1}let D=t;function Ce(S,O){for(let H=0;H0?d=g[g.length-1]:d=null,m.pop(),m.length>0?u=m[m.length-1]:u=null};function ii(S,O,H,F){if(S.visible===!1)return;if(S.layers.test(O.layers)){if(S.isGroup)H=S.renderOrder;else if(S.isLOD)S.autoUpdate===!0&&S.update(O);else if(S.isLight)d.pushLight(S),S.castShadow&&d.pushShadow(S);else if(S.isSprite){if(!S.frustumCulled||Z.intersectsSprite(S)){F&&ne.setFromMatrixPosition(S.matrixWorld).applyMatrix4(J);const ve=qe.update(S),be=S.material;be.visible&&u.push(S,ve,be,H,ne.z,null)}}else if((S.isMesh||S.isLine||S.isPoints)&&(S.isSkinnedMesh&&S.skeleton.frame!==Pe.render.frame&&(S.skeleton.update(),S.skeleton.frame=Pe.render.frame),!S.frustumCulled||Z.intersectsObject(S))){F&&ne.setFromMatrixPosition(S.matrixWorld).applyMatrix4(J);const ve=qe.update(S),be=S.material;if(Array.isArray(be)){const Me=ve.groups;for(let Ie=0,we=Me.length;Ie0&&Ht(W,O,H),F&&he.viewport(C.copy(F)),W.length>0&&vt(W,O,H),de.length>0&&vt(de,O,H),ve.length>0&&vt(ve,O,H),he.buffers.depth.setTest(!0),he.buffers.depth.setMask(!0),he.buffers.color.setMask(!0),he.setPolygonOffset(!1)}function Ht(S,O,H){const F=xe.isWebGL2;z===null&&(z=new Fi(1,1,{generateMipmaps:!0,type:pe.has("EXT_color_buffer_half_float")?Cn:Ri,minFilter:Es,samples:F&&r===!0?4:0})),p.getDrawingBufferSize(j),F?z.setSize(j.x,j.y):z.setSize(_r(j.x),_r(j.y));const W=p.getRenderTarget();p.setRenderTarget(z),p.clear();const de=p.toneMapping;p.toneMapping=ei,vt(S,O,H),p.toneMapping=de,fe.updateMultisampleRenderTarget(z),fe.updateRenderTargetMipmap(z),p.setRenderTarget(W)}function vt(S,O,H){const F=O.isScene===!0?O.overrideMaterial:null;for(let W=0,de=S.length;W0&&fe.useMultisampledRTT(S)===!1?W=ye.get(S).__webglMultisampledFramebuffer:W=Ie,C.copy(S.viewport),L.copy(S.scissor),v=S.scissorTest}else C.copy(U).multiplyScalar($).floor(),L.copy(X).multiplyScalar($).floor(),v=Y;if(he.bindFramebuffer(D.FRAMEBUFFER,W)&&xe.drawBuffers&&F&&he.drawBuffers(S,W),he.viewport(C),he.scissor(L),he.setScissorTest(v),de){const Me=ye.get(S.texture);D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_CUBE_MAP_POSITIVE_X+O,Me.__webglTexture,H)}else if(ve){const Me=ye.get(S.texture),Ie=O||0;D.framebufferTextureLayer(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,Me.__webglTexture,H||0,Ie)}x=-1},this.readRenderTargetPixels=function(S,O,H,F,W,de,ve){if(!(S&&S.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let be=ye.get(S).__webglFramebuffer;if(S.isWebGLCubeRenderTarget&&ve!==void 0&&(be=be[ve]),be){he.bindFramebuffer(D.FRAMEBUFFER,be);try{const Me=S.texture,Ie=Me.format,we=Me.type;if(Ie!==Ot&&b.convert(Ie)!==D.getParameter(D.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Te=we===Cn&&(pe.has("EXT_color_buffer_half_float")||xe.isWebGL2&&pe.has("EXT_color_buffer_float"));if(we!==Ri&&b.convert(we)!==D.getParameter(D.IMPLEMENTATION_COLOR_READ_TYPE)&&!(we===bi&&(xe.isWebGL2||pe.has("OES_texture_float")||pe.has("WEBGL_color_buffer_float")))&&!Te){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}O>=0&&O<=S.width-F&&H>=0&&H<=S.height-W&&D.readPixels(O,H,F,W,b.convert(Ie),b.convert(we),de)}finally{const Me=w!==null?ye.get(w).__webglFramebuffer:null;he.bindFramebuffer(D.FRAMEBUFFER,Me)}}},this.copyFramebufferToTexture=function(S,O,H=0){const F=Math.pow(2,-H),W=Math.floor(O.image.width*F),de=Math.floor(O.image.height*F);fe.setTexture2D(O,0),D.copyTexSubImage2D(D.TEXTURE_2D,H,0,0,S.x,S.y,W,de),he.unbindTexture()},this.copyTextureToTexture=function(S,O,H,F=0){const W=O.image.width,de=O.image.height,ve=b.convert(H.format),be=b.convert(H.type);fe.setTexture2D(H,0),D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,H.flipY),D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),D.pixelStorei(D.UNPACK_ALIGNMENT,H.unpackAlignment),O.isDataTexture?D.texSubImage2D(D.TEXTURE_2D,F,S.x,S.y,W,de,ve,be,O.image.data):O.isCompressedTexture?D.compressedTexSubImage2D(D.TEXTURE_2D,F,S.x,S.y,O.mipmaps[0].width,O.mipmaps[0].height,ve,O.mipmaps[0].data):D.texSubImage2D(D.TEXTURE_2D,F,S.x,S.y,ve,be,O.image),F===0&&H.generateMipmaps&&D.generateMipmap(D.TEXTURE_2D),he.unbindTexture()},this.copyTextureToTexture3D=function(S,O,H,F,W=0){if(p.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const de=S.max.x-S.min.x+1,ve=S.max.y-S.min.y+1,be=S.max.z-S.min.z+1,Me=b.convert(F.format),Ie=b.convert(F.type);let we;if(F.isData3DTexture)fe.setTexture3D(F,0),we=D.TEXTURE_3D;else if(F.isDataArrayTexture)fe.setTexture2DArray(F,0),we=D.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,F.flipY),D.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,F.premultiplyAlpha),D.pixelStorei(D.UNPACK_ALIGNMENT,F.unpackAlignment);const Te=D.getParameter(D.UNPACK_ROW_LENGTH),Be=D.getParameter(D.UNPACK_IMAGE_HEIGHT),fi=D.getParameter(D.UNPACK_SKIP_PIXELS),Ui=D.getParameter(D.UNPACK_SKIP_ROWS),Ni=D.getParameter(D.UNPACK_SKIP_IMAGES),It=H.isCompressedTexture?H.mipmaps[0]:H.image;D.pixelStorei(D.UNPACK_ROW_LENGTH,It.width),D.pixelStorei(D.UNPACK_IMAGE_HEIGHT,It.height),D.pixelStorei(D.UNPACK_SKIP_PIXELS,S.min.x),D.pixelStorei(D.UNPACK_SKIP_ROWS,S.min.y),D.pixelStorei(D.UNPACK_SKIP_IMAGES,S.min.z),H.isDataTexture||H.isData3DTexture?D.texSubImage3D(we,W,O.x,O.y,O.z,de,ve,be,Me,Ie,It.data):H.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),D.compressedTexSubImage3D(we,W,O.x,O.y,O.z,de,ve,be,Me,It.data)):D.texSubImage3D(we,W,O.x,O.y,O.z,de,ve,be,Me,Ie,It),D.pixelStorei(D.UNPACK_ROW_LENGTH,Te),D.pixelStorei(D.UNPACK_IMAGE_HEIGHT,Be),D.pixelStorei(D.UNPACK_SKIP_PIXELS,fi),D.pixelStorei(D.UNPACK_SKIP_ROWS,Ui),D.pixelStorei(D.UNPACK_SKIP_IMAGES,Ni),W===0&&F.generateMipmaps&&D.generateMipmap(we),he.unbindTexture()},this.initTexture=function(S){S.isCubeTexture?fe.setTextureCube(S,0):S.isData3DTexture?fe.setTexture3D(S,0):S.isDataArrayTexture?fe.setTexture2DArray(S,0):fe.setTexture2D(S,0),he.unbindTexture()},this.resetState=function(){_=0,y=0,w=null,he.reset(),q.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Bp extends Ko{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}var Tn=function(){var s=0,e=document.createElement("div");e.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",e.addEventListener("click",function(h){h.preventDefault(),i(++s%e.children.length)},!1);function t(h){return e.appendChild(h.dom),h}function i(h){for(var u=0;u=r+1e3&&(a.update(o*1e3/(h-r),100),r=h,o=0,l)){var u=performance.memory;l.update(u.usedJSHeapSize/1048576,u.jsHeapSizeLimit/1048576)}return h},update:function(){n=this.end()},domElement:e,setMode:i}};Tn.Panel=function(s,e,t){var i=1/0,n=0,r=Math.round,o=r(window.devicePixelRatio||1),a=80*o,c=48*o,l=3*o,h=2*o,u=3*o,d=15*o,m=74*o,g=30*o,p=document.createElement("canvas");p.width=a,p.height=c,p.style.cssText="width:80px;height:48px";var f=p.getContext("2d");return f.font="bold "+9*o+"px Helvetica,Arial,sans-serif",f.textBaseline="top",f.fillStyle=t,f.fillRect(0,0,a,c),f.fillStyle=e,f.fillText(s,l,h),f.fillRect(u,d,m,g),f.fillStyle=t,f.globalAlpha=.9,f.fillRect(u,d,m,g),{dom:p,update:function(_,y){i=Math.min(i,_),n=Math.max(n,_),f.fillStyle=t,f.globalAlpha=1,f.fillRect(0,0,a,d),f.fillStyle=e,f.fillText(r(_)+" "+s+" ("+r(i)+"-"+r(n)+")",l,h),f.drawImage(p,u+o,d,m-o,g,u,d,m-o,g),f.fillRect(u+m-o,d,o,g),f.fillStyle=t,f.globalAlpha=.9,f.fillRect(u+m-o,d,o,r((1-_/y)*g))}}};const Gp=Tn;class kp extends gn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Le(16777215),this.specular=new Le(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ho,this.normalScale=new De(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Rr,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,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.fog=e.fog,this}}var Hp="out vec2 groundUV;",Vp="groundUV = uv;",Wp=`in vec2 groundUV; +uniform float cellSize;`,Xp=`vec2 position = floor(groundUV * cellSize); vec3 pattern = vec3(0.8 + 0.2 * mod( floor(position.x) + floor(position.y), 2.0 )); outgoingLight = outgoingLight * pattern; -#include `,Nt;(s=>{s.blend=(e,t,i=.5)=>{const n=s.hexToRGB(e),r=s.hexToRGB(t);return`#${(4294967296+Math.round((r.r-n.r)*i+n.r)*65536+Math.round((r.g-n.g)*i+n.g)*256+Math.round((r.b-n.b)*i+n.b)).toString(16).slice(3)}`.toUpperCase()},s.getClass=e=>new Le(e),s.rgbToHEX=e=>`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`.toUpperCase(),s.hexToRGB=e=>{const t=parseInt(e.slice(1),16);return{r:t>>16&255,g:t>>8&255,b:t&255}},s.BLACK=0,s.FOG=15263976,s.WHITE=16777215})(Nt||(Nt={}));var Ke;(s=>{s.Background=Nt.FOG,s.Fog={color:Nt.FOG,visible:!0,near:100,far:250},s.Camera={position:new P(0,25,-50),target:new P(0,0,25),fov:50,near:.1,far:500},s.Lights={ambient:{color:Nt.WHITE,intensity:.25},directional:{position:new P(-15,25,50),rotation:new mn(.785,0,.25),color:Nt.WHITE,intensity:1,shadow:{mapSize:new De(1024,1024),cast:!0,camera:{bottom:-25,right:25,left:-25,near:1,far:50,top:15}},helper:{color:Nt.WHITE,visible:!0,size:10}}},s.Ground={color:Nt.WHITE,size:500,cell:26}})(Ke||(Ke={}));class Yp extends Hp{constructor(e={}){super(e),this.cellSize={value:Ke.Ground.cell},this.setValues(e)}updateDefaultVertexShader(e){e.vertexShader=`${Vp} +#include `,Nt;(s=>{s.blend=(e,t,i=.5)=>{const n=s.hexToRGB(e),r=s.hexToRGB(t);return`#${(4294967296+Math.round((r.r-n.r)*i+n.r)*65536+Math.round((r.g-n.g)*i+n.g)*256+Math.round((r.b-n.b)*i+n.b)).toString(16).slice(3)}`.toUpperCase()},s.getClass=e=>new Le(e),s.rgbToHEX=e=>`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`.toUpperCase(),s.hexToRGB=e=>{const t=parseInt(e.slice(1),16);return{r:t>>16&255,g:t>>8&255,b:t&255}},s.BLACK=0,s.FOG=15263976,s.WHITE=16777215})(Nt||(Nt={}));var Ke;(s=>{s.Background=Nt.FOG,s.Fog={color:Nt.FOG,visible:!0,near:100,far:250},s.Camera={position:new P(0,25,-50),target:new P(0,0,25),fov:50,near:.1,far:500},s.Lights={ambient:{color:Nt.WHITE,intensity:.25},directional:{position:new P(-15,25,50),rotation:new mn(.785,0,.25),color:Nt.WHITE,intensity:1,shadow:{mapSize:new De(1024,1024),cast:!0,camera:{bottom:-25,right:25,left:-25,near:1,far:50,top:15}},helper:{color:Nt.WHITE,visible:!0,size:10}}},s.Ground={color:Nt.WHITE,size:500,cell:26}})(Ke||(Ke={}));class qp extends kp{cellSize={value:Ke.Ground.cell};constructor(e={}){super(e),this.setValues(e)}updateDefaultVertexShader(e){e.vertexShader=`${Hp} ${e.vertexShader.replace("void main() {",`void main() { - ${Wp}`)}`}updateDefaultFragmentShader(e){e.fragmentShader=`${Xp} + ${Vp}`)}`}updateDefaultFragmentShader(e){e.fragmentShader=`${Wp} ${e.fragmentShader.replace("#include ",` - ${qp}`)}`}onBeforeCompile(e){e.uniforms.cellSize=this.cellSize,this.updateDefaultFragmentShader(e),this.updateDefaultVertexShader(e),this.needsUpdate=!0}set cell(e){this.cellSize.value=e}}class Ir{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Le(e),this.near=t,this.far=i}clone(){return new Ir(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}/** + ${Xp}`)}`}onBeforeCompile(e){e.uniforms.cellSize=this.cellSize,this.updateDefaultFragmentShader(e),this.updateDefaultVertexShader(e),this.needsUpdate=!0}set cell(e){this.cellSize.value=e}}/** * lil-gui * https://lil-gui.georgealways.com * @version 0.17.0 * @author George Michael Brower * @license MIT - */class Gt{constructor(e,t,i,n,r="div"){this.parent=e,this.object=t,this.property=i,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(n),this.$name=document.createElement("div"),this.$name.classList.add("name"),Gt.nextNameID=Gt.nextNameID||0,this.$name.id=`lil-gui-name-${++Gt.nextNameID}`,this.$widget=document.createElement(r),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(i)}name(e){return this._name=e,this.$name.innerHTML=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){const t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.object[this.property]=e,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class $p extends Gt{constructor(e,t,i){super(e,t,i,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function wr(s){let e,t;return(e=s.match(/(#|0x)?([a-f0-9]{6})/i))?t=e[2]:(e=s.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?t=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=s.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),t?"#"+t:!1}const jp={isPrimitive:!0,match:s=>typeof s=="string",fromHexString:wr,toHexString:wr},Ln={isPrimitive:!0,match:s=>typeof s=="number",fromHexString:s=>parseInt(s.substring(1),16),toHexString:s=>"#"+s.toString(16).padStart(6,0)},Zp={isPrimitive:!1,match:Array.isArray,fromHexString(s,e,t=1){const i=Ln.fromHexString(s);e[0]=(i>>16&255)/255*t,e[1]=(i>>8&255)/255*t,e[2]=(i&255)/255*t},toHexString([s,e,t],i=1){i=255/i;const n=s*i<<16^e*i<<8^t*i<<0;return Ln.toHexString(n)}},Kp={isPrimitive:!1,match:s=>Object(s)===s,fromHexString(s,e,t=1){const i=Ln.fromHexString(s);e.r=(i>>16&255)/255*t,e.g=(i>>8&255)/255*t,e.b=(i&255)/255*t},toHexString({r:s,g:e,b:t},i=1){i=255/i;const n=s*i<<16^e*i<<8^t*i<<0;return Ln.toHexString(n)}},Jp=[jp,Ln,Zp,Kp];function Qp(s){return Jp.find(e=>e.match(s))}class em extends Gt{constructor(e,t,i,n){super(e,t,i,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=Qp(this.initialValue),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{const r=wr(this.$text.value);r&&this._setValueFromHexString(r)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){const t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class pr extends Gt{constructor(e,t,i){super(e,t,i,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",n=>{n.preventDefault(),this.getValue().call(this.object)}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}}class tm extends Gt{constructor(e,t,i,n,r,o){super(e,t,i,"number"),this._initInput(),this.min(n),this.max(r);const a=o!==void 0;this.step(a?o:this._getImplicitStep(),a),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=t*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$disable=this.$input;const e=()=>{let _=parseFloat(this.$input.value);isNaN(_)||(this._stepExplicit&&(_=this._snap(_)),this.setValue(this._clamp(_)))},t=_=>{const y=parseFloat(this.$input.value);isNaN(y)||(this._snapClampSetValue(y+_),this.$input.value=this.getValue())},i=_=>{_.code==="Enter"&&this.$input.blur(),_.code==="ArrowUp"&&(_.preventDefault(),t(this._step*this._arrowKeyMultiplier(_))),_.code==="ArrowDown"&&(_.preventDefault(),t(this._step*this._arrowKeyMultiplier(_)*-1))},n=_=>{this._inputFocused&&(_.preventDefault(),t(this._step*this._normalizeMouseWheel(_)))};let r=!1,o,a,c,l,h;const u=5,d=_=>{o=_.clientX,a=c=_.clientY,r=!0,l=this.getValue(),h=0,window.addEventListener("mousemove",m),window.addEventListener("mouseup",g)},m=_=>{if(r){const y=_.clientX-o,w=_.clientY-a;Math.abs(w)>u?(_.preventDefault(),this.$input.blur(),r=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(y)>u&&g()}r||(h-=(_.clientY-c)*this._step*this._arrowKeyMultiplier(_),l+h>this._max?h=this._max-l:l+h{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",g)},p=()=>{this._inputFocused=!0},f=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",e),this.$input.addEventListener("keydown",i),this.$input.addEventListener("wheel",n,{passive:!1}),this.$input.addEventListener("mousedown",d),this.$input.addEventListener("focus",p),this.$input.addEventListener("blur",f)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");const e=(_,y,w,x,E)=>(_-y)/(w-y)*(E-x)+x,t=_=>{const y=this.$slider.getBoundingClientRect();let w=e(_,y.left,y.right,this._min,this._max);this._snapClampSetValue(w)},i=_=>{this._setDraggingStyle(!0),t(_.clientX),window.addEventListener("mousemove",n),window.addEventListener("mouseup",r)},n=_=>{t(_.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",r)};let o=!1,a,c;const l=_=>{_.preventDefault(),this._setDraggingStyle(!0),t(_.touches[0].clientX),o=!1},h=_=>{_.touches.length>1||(this._hasScrollBar?(a=_.touches[0].clientX,c=_.touches[0].clientY,o=!0):l(_),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",d))},u=_=>{if(o){const y=_.touches[0].clientX-a,w=_.touches[0].clientY-c;Math.abs(y)>Math.abs(w)?l(_):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",d))}else _.preventDefault(),t(_.touches[0].clientX)},d=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",d)},m=this._callOnFinishChange.bind(this),g=400;let p;const f=_=>{if(Math.abs(_.deltaX)this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}}class im extends Gt{constructor(e,t,i,n){super(e,t,i,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(n)?n:Object.values(n),this._names=Array.isArray(n)?n:Object.keys(n),this._names.forEach(r=>{const o=document.createElement("option");o.innerHTML=r,this.$select.appendChild(o)}),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}updateDisplay(){const e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.innerHTML=t===-1?e:this._names[t],this}}class nm extends Gt{constructor(e,t,i){super(e,t,i,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",n=>{n.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}const sm=`.lil-gui { + */class Gt{constructor(e,t,i,n,r="div"){this.parent=e,this.object=t,this.property=i,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(n),this.$name=document.createElement("div"),this.$name.classList.add("name"),Gt.nextNameID=Gt.nextNameID||0,this.$name.id=`lil-gui-name-${++Gt.nextNameID}`,this.$widget=document.createElement(r),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(i)}name(e){return this._name=e,this.$name.innerHTML=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){const t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.object[this.property]=e,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class Yp extends Gt{constructor(e,t,i){super(e,t,i,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function wr(s){let e,t;return(e=s.match(/(#|0x)?([a-f0-9]{6})/i))?t=e[2]:(e=s.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?t=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=s.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),t?"#"+t:!1}const $p={isPrimitive:!0,match:s=>typeof s=="string",fromHexString:wr,toHexString:wr},Ln={isPrimitive:!0,match:s=>typeof s=="number",fromHexString:s=>parseInt(s.substring(1),16),toHexString:s=>"#"+s.toString(16).padStart(6,0)},jp={isPrimitive:!1,match:Array.isArray,fromHexString(s,e,t=1){const i=Ln.fromHexString(s);e[0]=(i>>16&255)/255*t,e[1]=(i>>8&255)/255*t,e[2]=(i&255)/255*t},toHexString([s,e,t],i=1){i=255/i;const n=s*i<<16^e*i<<8^t*i<<0;return Ln.toHexString(n)}},Zp={isPrimitive:!1,match:s=>Object(s)===s,fromHexString(s,e,t=1){const i=Ln.fromHexString(s);e.r=(i>>16&255)/255*t,e.g=(i>>8&255)/255*t,e.b=(i&255)/255*t},toHexString({r:s,g:e,b:t},i=1){i=255/i;const n=s*i<<16^e*i<<8^t*i<<0;return Ln.toHexString(n)}},Kp=[$p,Ln,jp,Zp];function Jp(s){return Kp.find(e=>e.match(s))}class Qp extends Gt{constructor(e,t,i,n){super(e,t,i,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=Jp(this.initialValue),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{const r=wr(this.$text.value);r&&this._setValueFromHexString(r)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){const t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class pr extends Gt{constructor(e,t,i){super(e,t,i,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",n=>{n.preventDefault(),this.getValue().call(this.object)}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}}class em extends Gt{constructor(e,t,i,n,r,o){super(e,t,i,"number"),this._initInput(),this.min(n),this.max(r);const a=o!==void 0;this.step(a?o:this._getImplicitStep(),a),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){const e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=t*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$disable=this.$input;const e=()=>{let _=parseFloat(this.$input.value);isNaN(_)||(this._stepExplicit&&(_=this._snap(_)),this.setValue(this._clamp(_)))},t=_=>{const y=parseFloat(this.$input.value);isNaN(y)||(this._snapClampSetValue(y+_),this.$input.value=this.getValue())},i=_=>{_.code==="Enter"&&this.$input.blur(),_.code==="ArrowUp"&&(_.preventDefault(),t(this._step*this._arrowKeyMultiplier(_))),_.code==="ArrowDown"&&(_.preventDefault(),t(this._step*this._arrowKeyMultiplier(_)*-1))},n=_=>{this._inputFocused&&(_.preventDefault(),t(this._step*this._normalizeMouseWheel(_)))};let r=!1,o,a,c,l,h;const u=5,d=_=>{o=_.clientX,a=c=_.clientY,r=!0,l=this.getValue(),h=0,window.addEventListener("mousemove",m),window.addEventListener("mouseup",g)},m=_=>{if(r){const y=_.clientX-o,w=_.clientY-a;Math.abs(w)>u?(_.preventDefault(),this.$input.blur(),r=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(y)>u&&g()}r||(h-=(_.clientY-c)*this._step*this._arrowKeyMultiplier(_),l+h>this._max?h=this._max-l:l+h{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",g)},p=()=>{this._inputFocused=!0},f=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",e),this.$input.addEventListener("keydown",i),this.$input.addEventListener("wheel",n,{passive:!1}),this.$input.addEventListener("mousedown",d),this.$input.addEventListener("focus",p),this.$input.addEventListener("blur",f)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");const e=(_,y,w,x,E)=>(_-y)/(w-y)*(E-x)+x,t=_=>{const y=this.$slider.getBoundingClientRect();let w=e(_,y.left,y.right,this._min,this._max);this._snapClampSetValue(w)},i=_=>{this._setDraggingStyle(!0),t(_.clientX),window.addEventListener("mousemove",n),window.addEventListener("mouseup",r)},n=_=>{t(_.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",r)};let o=!1,a,c;const l=_=>{_.preventDefault(),this._setDraggingStyle(!0),t(_.touches[0].clientX),o=!1},h=_=>{_.touches.length>1||(this._hasScrollBar?(a=_.touches[0].clientX,c=_.touches[0].clientY,o=!0):l(_),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",d))},u=_=>{if(o){const y=_.touches[0].clientX-a,w=_.touches[0].clientY-c;Math.abs(y)>Math.abs(w)?l(_):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",d))}else _.preventDefault(),t(_.touches[0].clientX)},d=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",d)},m=this._callOnFinishChange.bind(this),g=400;let p;const f=_=>{if(Math.abs(_.deltaX)this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){const e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}}class tm extends Gt{constructor(e,t,i,n){super(e,t,i,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(n)?n:Object.values(n),this._names=Array.isArray(n)?n:Object.keys(n),this._names.forEach(r=>{const o=document.createElement("option");o.innerHTML=r,this.$select.appendChild(o)}),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}updateDisplay(){const e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.innerHTML=t===-1?e:this._names[t],this}}class im extends Gt{constructor(e,t,i){super(e,t,i,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",n=>{n.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}const nm=`.lil-gui { font-family: var(--font-family); font-size: var(--font-size); line-height: 1; @@ -5846,7 +5846,7 @@ outgoingLight = outgoingLight * pattern; @font-face { font-family: "lil-gui"; src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff"); -}`;function rm(s){const e=document.createElement("style");e.innerHTML=s;const t=document.querySelector("head link[rel=stylesheet], head style");t?document.head.insertBefore(e,t):document.head.appendChild(e)}let yo=!1;class Ur{constructor({parent:e,autoPlace:t=e===void 0,container:i,width:n,title:r="Controls",injectStyles:o=!0,touchStyles:a=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",c=>{(c.code==="Enter"||c.code==="Space")&&(c.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(r),a&&this.domElement.classList.add("allow-touch-styles"),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),!yo&&o&&(rm(sm),yo=!0),i?i.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px"),this.domElement.addEventListener("keydown",c=>c.stopPropagation()),this.domElement.addEventListener("keyup",c=>c.stopPropagation())}add(e,t,i,n,r){if(Object(i)===i)return new im(this,e,t,i);const o=e[t];switch(typeof o){case"number":return new tm(this,e,t,i,n,r);case"boolean":return new $p(this,e,t);case"string":return new nm(this,e,t);case"function":return new pr(this,e,t)}console.error(`gui.add failed +}`;function sm(s){const e=document.createElement("style");e.innerHTML=s;const t=document.querySelector("head link[rel=stylesheet], head style");t?document.head.insertBefore(e,t):document.head.appendChild(e)}let yo=!1;class Ir{constructor({parent:e,autoPlace:t=e===void 0,container:i,width:n,title:r="Controls",injectStyles:o=!0,touchStyles:a=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",c=>{(c.code==="Enter"||c.code==="Space")&&(c.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(r),a&&this.domElement.classList.add("allow-touch-styles"),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),!yo&&o&&(sm(nm),yo=!0),i?i.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px"),this.domElement.addEventListener("keydown",c=>c.stopPropagation()),this.domElement.addEventListener("keyup",c=>c.stopPropagation())}add(e,t,i,n,r){if(Object(i)===i)return new tm(this,e,t,i);const o=e[t];switch(typeof o){case"number":return new em(this,e,t,i,n,r);case"boolean":return new Yp(this,e,t);case"string":return new im(this,e,t);case"function":return new pr(this,e,t)}console.error(`gui.add failed property:`,t,` object:`,e,` - value:`,o)}addColor(e,t,i=1){return new em(this,e,t,i)}addFolder(e){return new Ur({parent:this,title:e})}load(e,t=!0){return e.controllers&&this.controllers.forEach(i=>{i instanceof pr||i._name in e.controllers&&i.load(e.controllers[i._name])}),t&&e.folders&&this.folders.forEach(i=>{i._title in e.folders&&i.load(e.folders[i._title])}),this}save(e=!0){const t={controllers:{},folders:{}};return this.controllers.forEach(i=>{if(!(i instanceof pr)){if(i._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${i._name}"`);t.controllers[i._name]=i.save()}}),e&&this.folders.forEach(i=>{if(i._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${i._title}"`);t.folders[i._title]=i.save()}),t}open(e=!0){return this._closed=!e,this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._closed=!e,this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");const i=r=>{r.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",i))};this.$children.addEventListener("transitionend",i);const n=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(e){return this._title=e,this.$title.innerHTML=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}}class am{constructor(e){this.main=e,this.gui=new Ur({width:250,injectStyles:!0}),this.cameraPosition=Ke.Camera.position.clone(),this.cameraTarget=Ke.Camera.target.clone(),this.createSceneControls(),this.createCameraControls(),this.createLightsControls(),this.createGroundControls(),this.createFogControls(),this.gui.close()}createSceneControls(){const e=this.gui.addFolder("Scene").close(),t={color:Ke.Background,controls:!0,pause:!1};e.addColor(t,"color").name("Background").onChange(i=>this.main.background=i),e.add(t,"controls").name("Controls").onChange(i=>this.main.controls=i).listen(),e.add(t,"pause").name("Pause").onChange(i=>{this.main.pause=i,t.controls=!i})}createCameraControls(){const e={...Ke.Camera},t=this.gui.addFolder("Camera").close();t.add(e,"fov",1,100).name("Field of View").onChange(()=>this.main.updateCamera(e)),t.add(e,"near",.1,1).name("Near Plane").onChange(()=>this.main.updateCamera(e)),t.add(e,"far",1,2e3).name("Far Plane").onChange(()=>this.main.updateCamera(e));const i=t.addFolder("Position").close();i.add(this.cameraPosition,"x").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen(),i.add(this.cameraPosition,"y").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen(),i.add(this.cameraPosition,"z").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen();const n=t.addFolder("Target").close();n.add(this.cameraTarget,"x").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen(),n.add(this.cameraTarget,"y").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen(),n.add(this.cameraTarget,"z").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen()}createGroundControls(){const e={...Ke.Ground},t=this.gui.addFolder("Ground").close();t.addColor(e,"color").name("Color").onChange(()=>this.main.updateGround(e)),t.add(e,"size",1,1e3).name("Size").onChange(()=>this.main.updateGround(e)),t.add(e,"cell",2,100).name("Cell").onChange(()=>this.main.updateGround(e)).step(2)}createLightsControls(){const e={...Ke.Lights.ambient},t={...Ke.Lights.directional},i=this.gui.addFolder("Lights").close(),n=i.addFolder("Ambient").close(),r=i.addFolder("Directional").close();n.addColor(e,"color").name("Color").onChange(()=>this.main.updateAmbient(e)),n.add(e,"intensity",0,1).name("Intensity").onChange(()=>this.main.updateAmbient(e)),r.addColor(t,"color").name("Color").onChange(()=>this.main.updateDirectional(t)),r.add(t,"intensity",0,1).name("Intensity").onChange(()=>this.main.updateDirectional(t)),r.add(t.shadow,"cast").name("Cast Shadow").onChange(()=>this.main.updateDirectional(t)),r.add(t.helper,"visible").name("Helper").onChange(()=>this.main.updateDirectional(t));const o=r.addFolder("Position").close();o.add(t.position,"x").onChange(()=>this.main.updateDirectional(t)).decimals(3),o.add(t.position,"y").onChange(()=>this.main.updateDirectional(t)).decimals(3),o.add(t.position,"z").onChange(()=>this.main.updateDirectional(t)).decimals(3);const a=r.addFolder("Rotation").close();a.add(t.rotation,"x").onChange(()=>this.main.updateDirectional(t)).decimals(3),a.add(t.rotation,"y").onChange(()=>this.main.updateDirectional(t)).decimals(3),a.add(t.rotation,"z").onChange(()=>this.main.updateDirectional(t)).decimals(3);const c=r.addFolder("Shadow").close(),l=c.addFolder("Camera").close();l.add(t.shadow.camera,"top").onChange(()=>this.main.updateDirectional(t)).decimals(3),l.add(t.shadow.camera,"right").onChange(()=>this.main.updateDirectional(t)).decimals(3),l.add(t.shadow.camera,"bottom").onChange(()=>this.main.updateDirectional(t)).decimals(3),l.add(t.shadow.camera,"left").onChange(()=>this.main.updateDirectional(t)).decimals(3),l.add(t.shadow.camera,"near").onChange(()=>this.main.updateDirectional(t)).decimals(3),l.add(t.shadow.camera,"far").onChange(()=>this.main.updateDirectional(t)).decimals(3);const h=c.addFolder("Map Size").close();h.add(t.shadow.mapSize,"x").onChange(()=>this.main.updateDirectional(t)).decimals(3),h.add(t.shadow.mapSize,"y").onChange(()=>this.main.updateDirectional(t)).decimals(3)}createFogControls(){const e={...Ke.Fog},t=this.gui.addFolder("Fog").close();t.addColor(e,"color").name("Color").onChange(()=>this.main.updateFog(e)),t.add(e,"near",1,1e3).name("Near").onChange(()=>this.main.updateFog(e)),t.add(e,"far",1,1e3).name("Far").onChange(()=>this.main.updateFog(e)),t.add(e,"visible").name("Visible").onChange(()=>this.main.updateFog(e))}update(e,t){this.cameraPosition.copy(e),this.cameraTarget.copy(t)}dispose(){this.gui.destroy()}}class om{constructor(){this.width=window.innerWidth,this.height=window.innerHeight,this.ratio=this.width/this.height,this.callbacks=[],this.root=document.documentElement.style,this.update=this.updateScreen.bind(this),window.addEventListener("resize",this.update,!1),this.updateScreen()}updateScreen(){this.width=window.innerWidth,this.height=window.innerHeight,this.ratio=this.width/this.height,this.root.setProperty("--ratio",`${this.ratio}`),this.root.setProperty("--width",`${this.width}px`),this.root.setProperty("--height",`${this.height}px`);for(let e=this.callbacks.length;e--;)this.callbacks[e](this.width,this.height,this.ratio)}addResizeCallback(e){this.callbacks.indexOf(e)===-1&&this.callbacks.push(e)}removeResizeCallback(e){const t=this.callbacks.indexOf(e);t!==-1&&this.callbacks.splice(t,1)}dispose(){window.removeEventListener("resize",this.update,!1),this.callbacks.splice(0,this.callbacks.length)}get size(){return{height:this.height,width:this.width,ratio:this.ratio}}}const ds=new om,lm=Object.freeze({m2:Math.PI*2,d2:Math.PI*.5});class cm{constructor(){this.paused=!0,this.callbacks=[],this.onUpdate=this.update.bind(this)}add(e){this.callbacks.indexOf(e)===-1&&this.callbacks.push(e)}update(e){for(let t=this.callbacks.length;t--;)this.callbacks[t](e);this.raf=requestAnimationFrame(this.onUpdate)}remove(e){const t=this.callbacks.indexOf(e);t!==-1&&this.callbacks.splice(t,1)}dispose(){cancelAnimationFrame(this.raf),this.callbacks.splice(0)}set pause(e){this.paused!==e&&((this.paused=e)?cancelAnimationFrame(this.raf):this.raf=requestAnimationFrame(this.onUpdate))}}const fs=new cm;class hm{constructor(){this.groundSize=Ke.Ground.size,this.update=this.render.bind(this),this.scene=new kp,this.createScene(),this.createCamera(),this.createLights(),this.createGround(),this.createRenderer(),this.createControls(),this.createStats(),fs.add(this.update),fs.pause=!1}createScene(){this.scene.background=Nt.getClass(0),this.background=Ke.Background,this.updateFog(Ke.Fog)}createCamera(){const{fov:e,near:t,far:i,position:n}=Ke.Camera;this.camera=new Et(e,ds.size.ratio,t,i),this.camera.position.copy(n)}createLights(){const{ambient:e,directional:t}=Ke.Lights;this.ambient=new Bp(e.color,e.intensity),this.directional=new Kc(t.color,t.intensity),this.helper=new Lc(this.directional,t.helper.size,t.helper.color),this.updateDirectional(t),this.scene.add(this.directional),this.scene.add(this.ambient),this.scene.add(this.helper)}createGround(){const{color:e,size:t}=Ke.Ground;this.ground=new Qt(new Ts(t,t),new Yp({side:Jt,color:e})),this.ground.receiveShadow=!0,this.ground.rotateX(-lm.d2),this.scene.add(this.ground)}createRenderer(){this.renderer=new zp({powerPreference:"high-performance",antialias:!0}),this.renderer.setSize(ds.size.width,ds.size.height),this.renderer.shadowMap.type=Oo,this.renderer.setClearColor(Nt.BLACK,1),this.renderer.setPixelRatio(devicePixelRatio),this.renderer.outputEncoding=Oe,this.renderer.shadowMap.enabled=!0}createControls(){this.orbitControls=new qc(this.camera,this.domElement),this.orbitControls.target.copy(Ke.Camera.target),ds.addResizeCallback(this.resize.bind(this)),this.guiControls=new am(this),this.orbitControls.update()}createStats(){document.body.lastElementChild?.id!=="stats"&&(this.stats=Gp(),this.stats.showPanel(0),this.stats.domElement.id="stats",document.body.appendChild(this.stats.domElement))}resize(e,t,i){this.camera.aspect=i,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t)}render(){this.stats?.begin(),this.orbitControls.update(),this.renderer.render(this.scene,this.camera),this.guiControls.update(this.camera.position,this.orbitControls.target),this.stats?.end()}destroy(){this.renderer.domElement.remove(),this.stats?.domElement.remove(),this.orbitControls.dispose(),this.guiControls.dispose(),this.renderer.dispose(),this.scene.clear(),fs.dispose()}get domElement(){return this.renderer.domElement}set background(e){this.scene.background.set(e)}set controls(e){this.orbitControls.enabled=e}set pause(e){this.controls=!e,fs.pause=e}updateAmbient(e){const{color:t,intensity:i}=e;this.ambient.intensity=i,this.ambient.color.set(t)}updateDirectional(e){const{bottom:t,right:i,left:n,top:r,near:o,far:a}=e.shadow.camera,{color:c,intensity:l,position:h,rotation:u,shadow:d}=e;this.directional.shadow.mapSize.copy(d.mapSize),this.helper.visible=e.helper.visible,this.directional.shadow.camera.bottom=t,this.directional.shadow.camera.right=i,this.directional.shadow.camera.left=n,this.directional.shadow.camera.top=r,this.directional.shadow.camera.near=o,this.directional.castShadow=d.cast,this.directional.shadow.camera.far=a,this.directional.position.copy(h),this.directional.rotation.copy(u),this.directional.intensity=l,this.directional.color.set(c)}updateFog(e){const{visible:t,color:i,near:n,far:r}=e;this.scene.fog=t?new Ir(i,n,r):null,this.scene.fog&&(this.scene.fog.near=n,this.scene.fog.far=r,this.scene.fog.color.set(i))}updateCamera(e){const{fov:t,near:i,far:n}=e;this.camera.fov=t,this.camera.near=i,this.camera.far=n,this.camera.updateProjectionMatrix()}updateCameraPosition(e,t){this.orbitControls.target.copy(t),this.camera.position.copy(e)}updateGround(e){const{color:t,size:i,cell:n}=e;this.ground.material.color.set(t),this.ground.material.cell=n,this.ground.scale.setScalar(i/this.groundSize)}}const um=""+new URL("../img/logo.png",import.meta.url).href,dm="_logo_1ode6_1",fm="_fade-out_1ode6_1",pm={logo:dm,fadeOut:fm},mm=Do('
Three.js

Three.js Boilerplate

'),gm=()=>(()=>{const s=mm.cloneNode(!0),e=s.firstChild;return El(e,"src",um),An(()=>Po(s,pm.logo)),s})(),_m="_version_1h8gi_1",xm={version:_m},vm=Do(""),Mm=()=>(()=>{const s=vm.cloneNode(!0);return s.firstChild,Fo(s,"3.0.0",null),An(()=>Po(s,xm.version)),s})(),ym=({root:s})=>{const e=new hm().domElement,[t,i]=_l(!0);return setTimeout(i,2500),s.appendChild(e),e.focus(),[zn((()=>{const n=zn(()=>!!t(),!0);return()=>n()&&mr(gm,{})})()),zn((()=>{const n=zn(()=>!1,!0);return()=>n()&&mr(Mm,{})})())]},bo=document.getElementById("root");Sl(()=>mr(ym,{root:bo}),bo); + value:`,o)}addColor(e,t,i=1){return new Qp(this,e,t,i)}addFolder(e){return new Ir({parent:this,title:e})}load(e,t=!0){return e.controllers&&this.controllers.forEach(i=>{i instanceof pr||i._name in e.controllers&&i.load(e.controllers[i._name])}),t&&e.folders&&this.folders.forEach(i=>{i._title in e.folders&&i.load(e.folders[i._title])}),this}save(e=!0){const t={controllers:{},folders:{}};return this.controllers.forEach(i=>{if(!(i instanceof pr)){if(i._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${i._name}"`);t.controllers[i._name]=i.save()}}),e&&this.folders.forEach(i=>{if(i._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${i._title}"`);t.folders[i._title]=i.save()}),t}open(e=!0){return this._closed=!e,this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._closed=!e,this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");const i=r=>{r.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",i))};this.$children.addEventListener("transitionend",i);const n=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(e){return this._title=e,this.$title.innerHTML=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(i=>i.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}}class rm{constructor(e){this.main=e,this.createSceneControls(),this.createCameraControls(),this.createLightsControls(),this.createGroundControls(),this.createFogControls(),this.gui.close()}gui=new Ir({width:250,injectStyles:!0});cameraPosition=Ke.Camera.position.clone();cameraTarget=Ke.Camera.target.clone();createSceneControls(){const e=this.gui.addFolder("Scene").close(),t={color:Ke.Background,controls:!0,pause:!1};e.addColor(t,"color").name("Background").onChange(i=>this.main.background=i),e.add(t,"controls").name("Controls").onChange(i=>this.main.controls=i).listen(),e.add(t,"pause").name("Pause").onChange(i=>{this.main.pause=i,t.controls=!i})}createCameraControls(){const e={...Ke.Camera},t=this.gui.addFolder("Camera").close();t.add(e,"fov",1,100).name("Field of View").onChange(()=>this.main.updateCamera(e)),t.add(e,"near",.1,1).name("Near Plane").onChange(()=>this.main.updateCamera(e)),t.add(e,"far",1,2e3).name("Far Plane").onChange(()=>this.main.updateCamera(e));const i=t.addFolder("Position").close();i.add(this.cameraPosition,"x").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen(),i.add(this.cameraPosition,"y").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen(),i.add(this.cameraPosition,"z").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen();const n=t.addFolder("Target").close();n.add(this.cameraTarget,"x").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen(),n.add(this.cameraTarget,"y").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen(),n.add(this.cameraTarget,"z").onChange(()=>this.main.updateCameraPosition(this.cameraPosition,this.cameraTarget)).decimals(3).listen()}createGroundControls(){const e={...Ke.Ground},t=this.gui.addFolder("Ground").close();t.addColor(e,"color").name("Color").onChange(()=>this.main.updateGround(e)),t.add(e,"size",1,1e3).name("Size").onChange(()=>this.main.updateGround(e)),t.add(e,"cell",2,100).name("Cell").onChange(()=>this.main.updateGround(e)).step(2)}createLightsControls(){const e={...Ke.Lights.ambient},t={...Ke.Lights.directional},i=this.gui.addFolder("Lights").close(),n=i.addFolder("Ambient").close(),r=i.addFolder("Directional").close();n.addColor(e,"color").name("Color").onChange(()=>this.main.updateAmbient(e)),n.add(e,"intensity",0,1).name("Intensity").onChange(()=>this.main.updateAmbient(e)),r.addColor(t,"color").name("Color").onChange(()=>this.main.updateDirectional(t)),r.add(t,"intensity",0,1).name("Intensity").onChange(()=>this.main.updateDirectional(t)),r.add(t.shadow,"cast").name("Cast Shadow").onChange(()=>this.main.updateDirectional(t)),r.add(t.helper,"visible").name("Helper").onChange(()=>this.main.updateDirectional(t));const o=r.addFolder("Position").close();o.add(t.position,"x").onChange(()=>this.main.updateDirectional(t)).decimals(3),o.add(t.position,"y").onChange(()=>this.main.updateDirectional(t)).decimals(3),o.add(t.position,"z").onChange(()=>this.main.updateDirectional(t)).decimals(3);const a=r.addFolder("Rotation").close();a.add(t.rotation,"x").onChange(()=>this.main.updateDirectional(t)).decimals(3),a.add(t.rotation,"y").onChange(()=>this.main.updateDirectional(t)).decimals(3),a.add(t.rotation,"z").onChange(()=>this.main.updateDirectional(t)).decimals(3);const c=r.addFolder("Shadow").close(),l=c.addFolder("Camera").close();l.add(t.shadow.camera,"top").onChange(()=>this.main.updateDirectional(t)).decimals(3),l.add(t.shadow.camera,"right").onChange(()=>this.main.updateDirectional(t)).decimals(3),l.add(t.shadow.camera,"bottom").onChange(()=>this.main.updateDirectional(t)).decimals(3),l.add(t.shadow.camera,"left").onChange(()=>this.main.updateDirectional(t)).decimals(3),l.add(t.shadow.camera,"near").onChange(()=>this.main.updateDirectional(t)).decimals(3),l.add(t.shadow.camera,"far").onChange(()=>this.main.updateDirectional(t)).decimals(3);const h=c.addFolder("Map Size").close();h.add(t.shadow.mapSize,"x").onChange(()=>this.main.updateDirectional(t)).decimals(3),h.add(t.shadow.mapSize,"y").onChange(()=>this.main.updateDirectional(t)).decimals(3)}createFogControls(){const e={...Ke.Fog},t=this.gui.addFolder("Fog").close();t.addColor(e,"color").name("Color").onChange(()=>this.main.updateFog(e)),t.add(e,"near",1,1e3).name("Near").onChange(()=>this.main.updateFog(e)),t.add(e,"far",1,1e3).name("Far").onChange(()=>this.main.updateFog(e)),t.add(e,"visible").name("Visible").onChange(()=>this.main.updateFog(e))}update(e,t){this.cameraPosition.copy(e),this.cameraTarget.copy(t)}dispose(){this.gui.destroy()}}class am extends Qe{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,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.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class Ur{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Le(e),this.near=t,this.far=i}clone(){return new Ur(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class om{width=window.innerWidth;height=window.innerHeight;ratio=this.width/this.height;callbacks=[];root=document.documentElement.style;update=this.updateScreen.bind(this);constructor(){window.addEventListener("resize",this.update,!1),this.updateScreen()}updateScreen(){this.width=window.innerWidth,this.height=window.innerHeight,this.ratio=this.width/this.height,this.root.setProperty("--ratio",`${this.ratio}`),this.root.setProperty("--width",`${this.width}px`),this.root.setProperty("--height",`${this.height}px`);for(let e=this.callbacks.length;e--;)this.callbacks[e](this.width,this.height,this.ratio)}addResizeCallback(e){this.callbacks.indexOf(e)===-1&&this.callbacks.push(e)}removeResizeCallback(e){const t=this.callbacks.indexOf(e);t!==-1&&this.callbacks.splice(t,1)}dispose(){window.removeEventListener("resize",this.update,!1),this.callbacks.splice(0,this.callbacks.length)}get size(){return{height:this.height,width:this.width,ratio:this.ratio}}}const ds=new om,lm=Object.freeze({m2:Math.PI*2,d2:Math.PI*.5});class cm{raf;paused=!0;callbacks=[];onUpdate=this.update.bind(this);add(e){this.callbacks.indexOf(e)===-1&&this.callbacks.push(e)}update(e){for(let t=this.callbacks.length;t--;)this.callbacks[t](e);this.raf=requestAnimationFrame(this.onUpdate)}remove(e){const t=this.callbacks.indexOf(e);t!==-1&&this.callbacks.splice(t,1)}dispose(){cancelAnimationFrame(this.raf),this.callbacks.splice(0)}set pause(e){this.paused!==e&&((this.paused=e)?cancelAnimationFrame(this.raf):this.raf=requestAnimationFrame(this.onUpdate))}}const fs=new cm;class hm{groundSize=Ke.Ground.size;update=this.render.bind(this);helper;directional;orbitControls;camera;guiControls;renderer;ambient;scene=new am;ground;stats;constructor(){this.createScene(),this.createCamera(),this.createLights(),this.createGround(),this.createRenderer(),this.createControls(),this.createStats(),fs.add(this.update),fs.pause=!1}createScene(){this.scene.background=Nt.getClass(0),this.background=Ke.Background,this.updateFog(Ke.Fog)}createCamera(){const{fov:e,near:t,far:i,position:n}=Ke.Camera;this.camera=new Et(e,ds.size.ratio,t,i),this.camera.position.copy(n)}createLights(){const{ambient:e,directional:t}=Ke.Lights;this.ambient=new Bp(e.color,e.intensity),this.directional=new Kc(t.color,t.intensity),this.helper=new Lc(this.directional,t.helper.size,t.helper.color),this.updateDirectional(t),this.scene.add(this.directional),this.scene.add(this.ambient),this.scene.add(this.helper)}createGround(){const{color:e,size:t}=Ke.Ground;this.ground=new Qt(new Ts(t,t),new qp({side:Jt,color:e})),this.ground.receiveShadow=!0,this.ground.rotateX(-lm.d2),this.scene.add(this.ground)}createRenderer(){this.renderer=new zp({powerPreference:"high-performance",antialias:!0}),this.renderer.setSize(ds.size.width,ds.size.height),this.renderer.shadowMap.type=Oo,this.renderer.setClearColor(Nt.BLACK,1),this.renderer.setPixelRatio(devicePixelRatio),this.renderer.outputEncoding=Oe,this.renderer.shadowMap.enabled=!0}createControls(){this.orbitControls=new qc(this.camera,this.domElement),this.orbitControls.target.copy(Ke.Camera.target),ds.addResizeCallback(this.resize.bind(this)),this.guiControls=new rm(this),this.orbitControls.update()}createStats(){document.body.lastElementChild?.id!=="stats"&&(this.stats=Gp(),this.stats.showPanel(0),this.stats.domElement.id="stats",document.body.appendChild(this.stats.domElement))}resize(e,t,i){this.camera.aspect=i,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t)}render(){this.stats?.begin(),this.orbitControls.update(),this.renderer.render(this.scene,this.camera),this.guiControls.update(this.camera.position,this.orbitControls.target),this.stats?.end()}destroy(){this.renderer.domElement.remove(),this.stats?.domElement.remove(),this.orbitControls.dispose(),this.guiControls.dispose(),this.renderer.dispose(),this.scene.clear(),fs.dispose()}get domElement(){return this.renderer.domElement}set background(e){this.scene.background.set(e)}set controls(e){this.orbitControls.enabled=e}set pause(e){this.controls=!e,fs.pause=e}updateAmbient(e){const{color:t,intensity:i}=e;this.ambient.intensity=i,this.ambient.color.set(t)}updateDirectional(e){const{bottom:t,right:i,left:n,top:r,near:o,far:a}=e.shadow.camera,{color:c,intensity:l,position:h,rotation:u,shadow:d}=e;this.directional.shadow.mapSize.copy(d.mapSize),this.helper.visible=e.helper.visible,this.directional.shadow.camera.bottom=t,this.directional.shadow.camera.right=i,this.directional.shadow.camera.left=n,this.directional.shadow.camera.top=r,this.directional.shadow.camera.near=o,this.directional.castShadow=d.cast,this.directional.shadow.camera.far=a,this.directional.position.copy(h),this.directional.rotation.copy(u),this.directional.intensity=l,this.directional.color.set(c)}updateFog(e){const{visible:t,color:i,near:n,far:r}=e;this.scene.fog=t?new Ur(i,n,r):null,this.scene.fog&&(this.scene.fog.near=n,this.scene.fog.far=r,this.scene.fog.color.set(i))}updateCamera(e){const{fov:t,near:i,far:n}=e;this.camera.fov=t,this.camera.near=i,this.camera.far=n,this.camera.updateProjectionMatrix()}updateCameraPosition(e,t){this.orbitControls.target.copy(t),this.camera.position.copy(e)}updateGround(e){const{color:t,size:i,cell:n}=e;this.ground.material.color.set(t),this.ground.material.cell=n,this.ground.scale.setScalar(i/this.groundSize)}}const um=""+new URL("../img/logo.png",import.meta.url).href,dm="_logo_1ode6_1",fm="_fade-out_1ode6_1",pm={logo:dm,fadeOut:fm},mm=Do('
Three.js

Three.js Boilerplate

'),gm=()=>(()=>{const s=mm.cloneNode(!0),e=s.firstChild;return El(e,"src",um),An(()=>Po(s,pm.logo)),s})(),_m="_version_1h8gi_1",xm={version:_m},vm=Do(""),Mm=()=>(()=>{const s=vm.cloneNode(!0);return s.firstChild,Fo(s,"3.0.0",null),An(()=>Po(s,xm.version)),s})(),ym=({root:s})=>{const e=new hm().domElement,[t,i]=_l(!0);return setTimeout(i,2500),s.appendChild(e),e.focus(),[zn((()=>{const n=zn(()=>!!t(),!0);return()=>n()&&mr(gm,{})})()),zn((()=>{const n=zn(()=>!1,!0);return()=>n()&&mr(Mm,{})})())]},bo=document.getElementById("root");Sl(()=>mr(ym,{root:bo}),bo); diff --git a/dist/index.html b/dist/index.html index 44792a1..d5a9e9f 100644 --- a/dist/index.html +++ b/dist/index.html @@ -68,7 +68,7 @@ - + diff --git a/package.json b/package.json index a023a34..eab4755 100644 --- a/package.json +++ b/package.json @@ -40,32 +40,32 @@ }, "dependencies": { "animejs": "^3.2.1", - "solid-js": "^1.5.4", + "solid-js": "^1.5.6", "three": "^0.144.0" }, "devDependencies": { "@types/animejs": "^3.1.5", - "@types/node": "^18.7.16", + "@types/node": "^18.7.19", "@types/three": "^0.144.0", - "@typescript-eslint/eslint-plugin": "^5.36.2", - "@typescript-eslint/parser": "^5.36.2", - "@vitest/web-worker": "^0.23.1", + "@typescript-eslint/eslint-plugin": "^5.38.0", + "@typescript-eslint/parser": "^5.38.0", + "@vitest/web-worker": "^0.23.4", "c8": "^7.12.0", - "eslint": "^8.23.0", + "eslint": "^8.24.0", "jest-canvas-mock": "^2.4.0", "jsdom": "^20.0.0", "lil-gui": "^0.17.0", "postcss": "^8.4.16", - "postcss-scss": "^4.0.4", - "sass": "^1.54.9", + "postcss-scss": "^4.0.5", + "sass": "^1.55.0", "solid-testing-library": "^0.3.0", - "stylelint": "^14.11.0", + "stylelint": "^14.12.1", "stylelint-config-standard": "^28.0.0", - "typescript": "^4.8.2", - "vite": "^3.1.0", - "vite-plugin-glsl": "^0.3.0", - "vite-plugin-solid": "^2.3.0", - "vitest": "^0.23.1" + "typescript": "^4.8.3", + "vite": "^3.1.3", + "vite-plugin-glsl": "^0.4.0", + "vite-plugin-solid": "^2.3.7", + "vitest": "^0.23.4" }, "engines": { "node": ">= 16.15.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0e763c0..a2681cb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,59 +2,59 @@ lockfileVersion: 5.4 specifiers: '@types/animejs': ^3.1.5 - '@types/node': ^18.7.16 + '@types/node': ^18.7.19 '@types/three': ^0.144.0 - '@typescript-eslint/eslint-plugin': ^5.36.2 - '@typescript-eslint/parser': ^5.36.2 - '@vitest/web-worker': ^0.23.1 + '@typescript-eslint/eslint-plugin': ^5.38.0 + '@typescript-eslint/parser': ^5.38.0 + '@vitest/web-worker': ^0.23.4 animejs: ^3.2.1 c8: ^7.12.0 - eslint: ^8.23.0 + eslint: ^8.24.0 jest-canvas-mock: ^2.4.0 jsdom: ^20.0.0 lil-gui: ^0.17.0 postcss: ^8.4.16 - postcss-scss: ^4.0.4 - sass: ^1.54.9 - solid-js: ^1.5.4 + postcss-scss: ^4.0.5 + sass: ^1.55.0 + solid-js: ^1.5.6 solid-testing-library: ^0.3.0 - stylelint: ^14.11.0 + stylelint: ^14.12.1 stylelint-config-standard: ^28.0.0 three: ^0.144.0 - typescript: ^4.8.2 - vite: ^3.1.0 - vite-plugin-glsl: ^0.3.0 - vite-plugin-solid: ^2.3.0 - vitest: ^0.23.1 + typescript: ^4.8.3 + vite: ^3.1.3 + vite-plugin-glsl: ^0.4.0 + vite-plugin-solid: ^2.3.7 + vitest: ^0.23.4 dependencies: animejs: 3.2.1 - solid-js: 1.5.4 + solid-js: 1.5.6 three: 0.144.0 devDependencies: '@types/animejs': 3.1.5 - '@types/node': 18.7.16 + '@types/node': 18.7.19 '@types/three': 0.144.0 - '@typescript-eslint/eslint-plugin': 5.36.2_iurrlxgqcgk5svigzxakafpeuu - '@typescript-eslint/parser': 5.36.2_yqf6kl63nyoq5megxukfnom5rm - '@vitest/web-worker': 0.23.1_sass@1.54.9+vitest@0.23.1 + '@typescript-eslint/eslint-plugin': 5.38.0_4gkcvl6qsi23tqqawfqgcwtp54 + '@typescript-eslint/parser': 5.38.0_7ilbxdl5iguzcjriqqcg2m5cku + '@vitest/web-worker': 0.23.4_sass@1.55.0+vitest@0.23.4 c8: 7.12.0 - eslint: 8.23.0 + eslint: 8.24.0 jest-canvas-mock: 2.4.0 jsdom: 20.0.0 lil-gui: 0.17.0 postcss: 8.4.16 - postcss-scss: 4.0.4_postcss@8.4.16 - sass: 1.54.9 - solid-testing-library: 0.3.0_solid-js@1.5.4 - stylelint: 14.11.0 - stylelint-config-standard: 28.0.0_stylelint@14.11.0 - typescript: 4.8.2 - vite: 3.1.0_sass@1.54.9 - vite-plugin-glsl: 0.3.0 - vite-plugin-solid: 2.3.0_solid-js@1.5.4+vite@3.1.0 - vitest: 0.23.1_jsdom@20.0.0+sass@1.54.9 + postcss-scss: 4.0.5_postcss@8.4.16 + sass: 1.55.0 + solid-testing-library: 0.3.0_solid-js@1.5.6 + stylelint: 14.12.1 + stylelint-config-standard: 28.0.0_stylelint@14.12.1 + typescript: 4.8.3 + vite: 3.1.3_sass@1.55.0 + vite-plugin-glsl: 0.4.0 + vite-plugin-solid: 2.3.7_solid-js@1.5.6+vite@3.1.3 + vitest: 0.23.4_jsdom@20.0.0+sass@1.55.0 packages: @@ -73,24 +73,24 @@ packages: '@babel/highlight': 7.18.6 dev: true - /@babel/compat-data/7.19.0: - resolution: {integrity: sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw==} + /@babel/compat-data/7.19.1: + resolution: {integrity: sha512-72a9ghR0gnESIa7jBN53U32FOVCEoztyIlKaNoU05zRhEecduGK9L9c3ww7Mp06JiR+0ls0GBPFJQwwtjn9ksg==} engines: {node: '>=6.9.0'} dev: true - /@babel/core/7.19.0: - resolution: {integrity: sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ==} + /@babel/core/7.19.1: + resolution: {integrity: sha512-1H8VgqXme4UXCRv7/Wa1bq7RVymKOzC7znjyFM8KiEzwFqcKUKYNoQef4GhdklgNvoBXyW4gYhuBNCM5o1zImw==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.0 '@babel/code-frame': 7.18.6 '@babel/generator': 7.19.0 - '@babel/helper-compilation-targets': 7.19.0_@babel+core@7.19.0 + '@babel/helper-compilation-targets': 7.19.1_@babel+core@7.19.1 '@babel/helper-module-transforms': 7.19.0 '@babel/helpers': 7.19.0 - '@babel/parser': 7.19.0 + '@babel/parser': 7.19.1 '@babel/template': 7.18.10 - '@babel/traverse': 7.19.0 + '@babel/traverse': 7.19.1 '@babel/types': 7.19.0 convert-source-map: 1.8.0 debug: 4.3.4 @@ -117,32 +117,32 @@ packages: '@babel/types': 7.19.0 dev: true - /@babel/helper-compilation-targets/7.19.0_@babel+core@7.19.0: - resolution: {integrity: sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA==} + /@babel/helper-compilation-targets/7.19.1_@babel+core@7.19.1: + resolution: {integrity: sha512-LlLkkqhCMyz2lkQPvJNdIYU7O5YjWRgC2R4omjCTpZd8u8KMQzZvX4qce+/BluN1rcQiV7BoGUpmQ0LeHerbhg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/compat-data': 7.19.0 - '@babel/core': 7.19.0 + '@babel/compat-data': 7.19.1 + '@babel/core': 7.19.1 '@babel/helper-validator-option': 7.18.6 - browserslist: 4.21.3 + browserslist: 4.21.4 semver: 6.3.0 dev: true - /@babel/helper-create-class-features-plugin/7.19.0_@babel+core@7.19.0: + /@babel/helper-create-class-features-plugin/7.19.0_@babel+core@7.19.1: resolution: {integrity: sha512-NRz8DwF4jT3UfrmUoZjd0Uph9HQnP30t7Ash+weACcyNkiYTywpIjDBgReJMKgr+n86sn2nPVVmJ28Dm053Kqw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.19.0 + '@babel/core': 7.19.1 '@babel/helper-annotate-as-pure': 7.18.6 '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-function-name': 7.19.0 '@babel/helper-member-expression-to-functions': 7.18.9 '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-replace-supers': 7.18.9 + '@babel/helper-replace-supers': 7.19.1 '@babel/helper-split-export-declaration': 7.18.6 transitivePeerDependencies: - supports-color @@ -197,9 +197,9 @@ packages: '@babel/helper-module-imports': 7.18.6 '@babel/helper-simple-access': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 '@babel/template': 7.18.10 - '@babel/traverse': 7.19.0 + '@babel/traverse': 7.19.1 '@babel/types': 7.19.0 transitivePeerDependencies: - supports-color @@ -217,14 +217,14 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-replace-supers/7.18.9: - resolution: {integrity: sha512-dNsWibVI4lNT6HiuOIBr1oyxo40HvIVmbwPUm3XZ7wMh4k2WxrxTqZwSqw/eEmXDS9np0ey5M2bz9tBmO9c+YQ==} + /@babel/helper-replace-supers/7.19.1: + resolution: {integrity: sha512-T7ahH7wV0Hfs46SFh5Jz3s0B6+o8g3c+7TMxu7xKfmHikg7EAZ3I2Qk9LFhjxXq8sL7UkP5JflezNwoZa8WvWw==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-member-expression-to-functions': 7.18.9 '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/traverse': 7.19.0 + '@babel/traverse': 7.19.1 '@babel/types': 7.19.0 transitivePeerDependencies: - supports-color @@ -249,8 +249,8 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-identifier/7.18.6: - resolution: {integrity: sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==} + /@babel/helper-validator-identifier/7.19.1: + resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} engines: {node: '>=6.9.0'} dev: true @@ -264,7 +264,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.18.10 - '@babel/traverse': 7.19.0 + '@babel/traverse': 7.19.1 '@babel/types': 7.19.0 transitivePeerDependencies: - supports-color @@ -274,72 +274,72 @@ packages: resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 chalk: 2.4.2 js-tokens: 4.0.0 dev: true - /@babel/parser/7.19.0: - resolution: {integrity: sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw==} + /@babel/parser/7.19.1: + resolution: {integrity: sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A==} engines: {node: '>=6.0.0'} hasBin: true dependencies: '@babel/types': 7.19.0 dev: true - /@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.19.0: + /@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.19.1: resolution: {integrity: sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.19.0 + '@babel/core': 7.19.1 '@babel/helper-plugin-utils': 7.19.0 dev: true - /@babel/plugin-syntax-typescript/7.18.6_@babel+core@7.19.0: + /@babel/plugin-syntax-typescript/7.18.6_@babel+core@7.19.1: resolution: {integrity: sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.19.0 + '@babel/core': 7.19.1 '@babel/helper-plugin-utils': 7.19.0 dev: true - /@babel/plugin-transform-typescript/7.19.0_@babel+core@7.19.0: - resolution: {integrity: sha512-DOOIywxPpkQHXijXv+s9MDAyZcLp12oYRl3CMWZ6u7TjSoCBq/KqHR/nNFR3+i2xqheZxoF0H2XyL7B6xeSRuA==} + /@babel/plugin-transform-typescript/7.19.1_@babel+core@7.19.1: + resolution: {integrity: sha512-+ILcOU+6mWLlvCwnL920m2Ow3wWx3Wo8n2t5aROQmV55GZt+hOiLvBaa3DNzRjSEHa1aauRs4/YLmkCfFkhhRQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.19.0 - '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.19.0 + '@babel/core': 7.19.1 + '@babel/helper-create-class-features-plugin': 7.19.0_@babel+core@7.19.1 '@babel/helper-plugin-utils': 7.19.0 - '@babel/plugin-syntax-typescript': 7.18.6_@babel+core@7.19.0 + '@babel/plugin-syntax-typescript': 7.18.6_@babel+core@7.19.1 transitivePeerDependencies: - supports-color dev: true - /@babel/preset-typescript/7.18.6_@babel+core@7.19.0: + /@babel/preset-typescript/7.18.6_@babel+core@7.19.1: resolution: {integrity: sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.19.0 + '@babel/core': 7.19.1 '@babel/helper-plugin-utils': 7.19.0 '@babel/helper-validator-option': 7.18.6 - '@babel/plugin-transform-typescript': 7.19.0_@babel+core@7.19.0 + '@babel/plugin-transform-typescript': 7.19.1_@babel+core@7.19.1 transitivePeerDependencies: - supports-color dev: true - /@babel/runtime-corejs3/7.19.0: - resolution: {integrity: sha512-JyXXoCu1N8GLuKc2ii8y5RGma5FMpFeO2nAQIe0Yzrbq+rQnN+sFj47auLblR5ka6aHNGPDgv8G/iI2Grb0ldQ==} + /@babel/runtime-corejs3/7.19.1: + resolution: {integrity: sha512-j2vJGnkopRzH+ykJ8h68wrHnEUmtK//E723jjixiAl/PPf6FhqY/vYRcMVlNydRKQjQsTsYEjpx+DZMIvnGk/g==} engines: {node: '>=6.9.0'} dependencies: - core-js-pure: 3.25.1 + core-js-pure: 3.25.2 regenerator-runtime: 0.13.9 dev: true @@ -355,12 +355,12 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/parser': 7.19.0 + '@babel/parser': 7.19.1 '@babel/types': 7.19.0 dev: true - /@babel/traverse/7.19.0: - resolution: {integrity: sha512-4pKpFRDh+utd2mbRC8JLnlsMUii3PMHjpL6a0SZ4NMZy7YFP9aXORxEhdMVOc9CpWtDF09IkciQLEhK7Ml7gRA==} + /@babel/traverse/7.19.1: + resolution: {integrity: sha512-0j/ZfZMxKukDaag2PtOPDbwuELqIar6lLskVPPJDjXMXjfLb1Obo/1yjxIGqqAJrmfaTIY3z2wFLAQ7qSkLsuA==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 @@ -369,7 +369,7 @@ packages: '@babel/helper-function-name': 7.19.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.19.0 + '@babel/parser': 7.19.1 '@babel/types': 7.19.0 debug: 4.3.4 globals: 11.12.0 @@ -382,7 +382,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.18.10 - '@babel/helper-validator-identifier': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 dev: true @@ -401,8 +401,17 @@ packages: postcss-selector-parser: 6.0.10 dev: true - /@esbuild/linux-loong64/0.15.7: - resolution: {integrity: sha512-IKznSJOsVUuyt7cDzzSZyqBEcZe+7WlBqTVXiF1OXP/4Nm387ToaXZ0fyLwI1iBlI/bzpxVq411QE2/Bt2XWWw==} + /@esbuild/android-arm/0.15.9: + resolution: {integrity: sha512-VZPy/ETF3fBG5PiinIkA0W/tlsvlEgJccyN2DzWZEl0DlVKRbu91PvY2D6Lxgluj4w9QtYHjOWjAT44C+oQ+EQ==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64/0.15.9: + resolution: {integrity: sha512-O+NfmkfRrb3uSsTa4jE3WApidSe3N5++fyOVGP1SmMZi4A3BZELkhUUvj5hwmMuNdlpzAZ8iAPz2vmcR7DCFQA==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -410,8 +419,8 @@ packages: dev: true optional: true - /@eslint/eslintrc/1.3.1: - resolution: {integrity: sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ==} + /@eslint/eslintrc/1.3.2: + resolution: {integrity: sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 @@ -427,8 +436,8 @@ packages: - supports-color dev: true - /@humanwhocodes/config-array/0.10.4: - resolution: {integrity: sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==} + /@humanwhocodes/config-array/0.10.5: + resolution: {integrity: sha512-XVVDtp+dVvRxMoxSiSfasYaG02VEe1qH5cKgMQJWhol6HwzbcqoCMJi8dAGoYAO57jhUyhI6cWuRiTcRaDaYug==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -462,7 +471,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.7.16 + '@types/node': 18.7.19 '@types/yargs': 15.0.14 chalk: 4.1.2 dev: true @@ -595,8 +604,8 @@ packages: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true - /@types/node/18.7.16: - resolution: {integrity: sha512-EQHhixfu+mkqHMZl1R2Ovuvn47PUw18azMJOTwSZr9/fhzHNGXAJ0ma0dayRVchprpCj0Kc1K1xKoWaATWF1qg==} + /@types/node/18.7.19: + resolution: {integrity: sha512-Sq1itGUKUX1ap7GgZlrzdBydjbsJL/NSQt/4wkAxUJ7/OS5c2WkoN6WSpWc2Yc5wtKMZOUA0VCs/j2XJadN3HA==} dev: true /@types/normalize-package-data/2.4.1: @@ -627,8 +636,8 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@typescript-eslint/eslint-plugin/5.36.2_iurrlxgqcgk5svigzxakafpeuu: - resolution: {integrity: sha512-OwwR8LRwSnI98tdc2z7mJYgY60gf7I9ZfGjN5EjCwwns9bdTuQfAXcsjSB2wSQ/TVNYSGKf4kzVXbNGaZvwiXw==} + /@typescript-eslint/eslint-plugin/5.38.0_4gkcvl6qsi23tqqawfqgcwtp54: + resolution: {integrity: sha512-GgHi/GNuUbTOeoJiEANi0oI6fF3gBQc3bGFYj40nnAPCbhrtEDf2rjBmefFadweBmO1Du1YovHeDP2h5JLhtTQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -638,24 +647,23 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.36.2_yqf6kl63nyoq5megxukfnom5rm - '@typescript-eslint/scope-manager': 5.36.2 - '@typescript-eslint/type-utils': 5.36.2_yqf6kl63nyoq5megxukfnom5rm - '@typescript-eslint/utils': 5.36.2_yqf6kl63nyoq5megxukfnom5rm + '@typescript-eslint/parser': 5.38.0_7ilbxdl5iguzcjriqqcg2m5cku + '@typescript-eslint/scope-manager': 5.38.0 + '@typescript-eslint/type-utils': 5.38.0_7ilbxdl5iguzcjriqqcg2m5cku + '@typescript-eslint/utils': 5.38.0_7ilbxdl5iguzcjriqqcg2m5cku debug: 4.3.4 - eslint: 8.23.0 - functional-red-black-tree: 1.0.1 + eslint: 8.24.0 ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.7 - tsutils: 3.21.0_typescript@4.8.2 - typescript: 4.8.2 + tsutils: 3.21.0_typescript@4.8.3 + typescript: 4.8.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser/5.36.2_yqf6kl63nyoq5megxukfnom5rm: - resolution: {integrity: sha512-qS/Kb0yzy8sR0idFspI9Z6+t7mqk/oRjnAYfewG+VN73opAUvmYL3oPIMmgOX6CnQS6gmVIXGshlb5RY/R22pA==} + /@typescript-eslint/parser/5.38.0_7ilbxdl5iguzcjriqqcg2m5cku: + resolution: {integrity: sha512-/F63giJGLDr0ms1Cr8utDAxP2SPiglaD6V+pCOcG35P2jCqdfR7uuEhz1GIC3oy4hkUF8xA1XSXmd9hOh/a5EA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -664,26 +672,26 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.36.2 - '@typescript-eslint/types': 5.36.2 - '@typescript-eslint/typescript-estree': 5.36.2_typescript@4.8.2 + '@typescript-eslint/scope-manager': 5.38.0 + '@typescript-eslint/types': 5.38.0 + '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.8.3 debug: 4.3.4 - eslint: 8.23.0 - typescript: 4.8.2 + eslint: 8.24.0 + typescript: 4.8.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager/5.36.2: - resolution: {integrity: sha512-cNNP51L8SkIFSfce8B1NSUBTJTu2Ts4nWeWbFrdaqjmn9yKrAaJUBHkyTZc0cL06OFHpb+JZq5AUHROS398Orw==} + /@typescript-eslint/scope-manager/5.38.0: + resolution: {integrity: sha512-ByhHIuNyKD9giwkkLqzezZ9y5bALW8VNY6xXcP+VxoH4JBDKjU5WNnsiD4HJdglHECdV+lyaxhvQjTUbRboiTA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.36.2 - '@typescript-eslint/visitor-keys': 5.36.2 + '@typescript-eslint/types': 5.38.0 + '@typescript-eslint/visitor-keys': 5.38.0 dev: true - /@typescript-eslint/type-utils/5.36.2_yqf6kl63nyoq5megxukfnom5rm: - resolution: {integrity: sha512-rPQtS5rfijUWLouhy6UmyNquKDPhQjKsaKH0WnY6hl/07lasj8gPaH2UD8xWkePn6SC+jW2i9c2DZVDnL+Dokw==} + /@typescript-eslint/type-utils/5.38.0_7ilbxdl5iguzcjriqqcg2m5cku: + resolution: {integrity: sha512-iZq5USgybUcj/lfnbuelJ0j3K9dbs1I3RICAJY9NZZpDgBYXmuUlYQGzftpQA9wC8cKgtS6DASTvF3HrXwwozA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -692,23 +700,23 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.36.2_typescript@4.8.2 - '@typescript-eslint/utils': 5.36.2_yqf6kl63nyoq5megxukfnom5rm + '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.8.3 + '@typescript-eslint/utils': 5.38.0_7ilbxdl5iguzcjriqqcg2m5cku debug: 4.3.4 - eslint: 8.23.0 - tsutils: 3.21.0_typescript@4.8.2 - typescript: 4.8.2 + eslint: 8.24.0 + tsutils: 3.21.0_typescript@4.8.3 + typescript: 4.8.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types/5.36.2: - resolution: {integrity: sha512-9OJSvvwuF1L5eS2EQgFUbECb99F0mwq501w0H0EkYULkhFa19Qq7WFbycdw1PexAc929asupbZcgjVIe6OK/XQ==} + /@typescript-eslint/types/5.38.0: + resolution: {integrity: sha512-HHu4yMjJ7i3Cb+8NUuRCdOGu2VMkfmKyIJsOr9PfkBVYLYrtMCK/Ap50Rpov+iKpxDTfnqvDbuPLgBE5FwUNfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.36.2_typescript@4.8.2: - resolution: {integrity: sha512-8fyH+RfbKc0mTspfuEjlfqA4YywcwQK2Amcf6TDOwaRLg7Vwdu4bZzyvBZp4bjt1RRjQ5MDnOZahxMrt2l5v9w==} + /@typescript-eslint/typescript-estree/5.38.0_typescript@4.8.3: + resolution: {integrity: sha512-6P0RuphkR+UuV7Avv7MU3hFoWaGcrgOdi8eTe1NwhMp2/GjUJoODBTRWzlHpZh6lFOaPmSvgxGlROa0Sg5Zbyg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -716,51 +724,51 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.36.2 - '@typescript-eslint/visitor-keys': 5.36.2 + '@typescript-eslint/types': 5.38.0 + '@typescript-eslint/visitor-keys': 5.38.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.7 - tsutils: 3.21.0_typescript@4.8.2 - typescript: 4.8.2 + tsutils: 3.21.0_typescript@4.8.3 + typescript: 4.8.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils/5.36.2_yqf6kl63nyoq5megxukfnom5rm: - resolution: {integrity: sha512-uNcopWonEITX96v9pefk9DC1bWMdkweeSsewJ6GeC7L6j2t0SJywisgkr9wUTtXk90fi2Eljj90HSHm3OGdGRg==} + /@typescript-eslint/utils/5.38.0_7ilbxdl5iguzcjriqqcg2m5cku: + resolution: {integrity: sha512-6sdeYaBgk9Fh7N2unEXGz+D+som2QCQGPAf1SxrkEr+Z32gMreQ0rparXTNGRRfYUWk/JzbGdcM8NSSd6oqnTA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: '@types/json-schema': 7.0.11 - '@typescript-eslint/scope-manager': 5.36.2 - '@typescript-eslint/types': 5.36.2 - '@typescript-eslint/typescript-estree': 5.36.2_typescript@4.8.2 - eslint: 8.23.0 + '@typescript-eslint/scope-manager': 5.38.0 + '@typescript-eslint/types': 5.38.0 + '@typescript-eslint/typescript-estree': 5.38.0_typescript@4.8.3 + eslint: 8.24.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.23.0 + eslint-utils: 3.0.0_eslint@8.24.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys/5.36.2: - resolution: {integrity: sha512-BtRvSR6dEdrNt7Net2/XDjbYKU5Ml6GqJgVfXT0CxTCJlnIqK7rAGreuWKMT2t8cFUT2Msv5oxw0GMRD7T5J7A==} + /@typescript-eslint/visitor-keys/5.38.0: + resolution: {integrity: sha512-MxnrdIyArnTi+XyFLR+kt/uNAcdOnmT+879os7qDRI+EYySR4crXJq9BXPfRzzLGq0wgxkwidrCJ9WCAoacm1w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.36.2 + '@typescript-eslint/types': 5.38.0 eslint-visitor-keys: 3.3.0 dev: true - /@vitest/web-worker/0.23.1_sass@1.54.9+vitest@0.23.1: - resolution: {integrity: sha512-sHvHSHZzRJfnxC8U4ODel54QoYmY7hj8h7tgTJ6TdvYav8+MbaAhuB7JTSRxbxfqnA17MjZk5dvZmhx0NhrDJA==} + /@vitest/web-worker/0.23.4_sass@1.55.0+vitest@0.23.4: + resolution: {integrity: sha512-3MITYIXT2JpXKGqozF8/BQBjOBP14BarmPJgXuS8yjUpRO6yzBg7b5n1SDXQ98+t7QhDAqIIWa7mBjKQBsIvmA==} peerDependencies: vitest: '*' dependencies: - vite-node: 0.23.1_sass@1.54.9 - vitest: 0.23.1_jsdom@20.0.0+sass@1.54.9 + vite-node: 0.23.4_sass@1.55.0 + vitest: 0.23.4_jsdom@20.0.0+sass@1.55.0 transitivePeerDependencies: - less - sass @@ -872,7 +880,7 @@ packages: engines: {node: '>=6.0'} dependencies: '@babel/runtime': 7.19.0 - '@babel/runtime-corejs3': 7.19.0 + '@babel/runtime-corejs3': 7.19.1 dev: true /array-union/2.1.0: @@ -898,25 +906,25 @@ packages: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: true - /babel-plugin-jsx-dom-expressions/0.34.7_@babel+core@7.19.0: - resolution: {integrity: sha512-jTxBhu/MQscWdOcLfqKAY8lIiRsv1ivrMQShlePoa4G8S2cFNb93HTWN4FFdp3SpILaibygFXWU3H+aHpoGH/w==} + /babel-plugin-jsx-dom-expressions/0.34.10_@babel+core@7.19.1: + resolution: {integrity: sha512-YTuTvhpGWuD67JTgb/oFDkQMEzsAG7GKBSl+WNTMkmD9tUBkDNZoKijsDRA2R+zV2VJz2aPaXu3gwPkIIbhMtg==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.19.0 + '@babel/core': 7.19.1 '@babel/helper-module-imports': 7.16.0 - '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.19.0 + '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.19.1 '@babel/types': 7.19.0 html-entities: 2.3.2 dev: true - /babel-preset-solid/1.5.4_@babel+core@7.19.0: - resolution: {integrity: sha512-pangM+KhBx8J6gRHiaRO4yD/J5gK3sydX+TIoC1TaYjxtVV78GIHRtg/HHtCAfg/iRQCJyiGR9TrN0brG8eDZA==} + /babel-preset-solid/1.5.6_@babel+core@7.19.1: + resolution: {integrity: sha512-DETqhEygtRq627y5jII5szev495CvbPZJDTaosCbRWdbBh7nMBPI9JuVBUdWs56M2D4mqYa6Z2vH4mdIS6srwA==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.19.0 - babel-plugin-jsx-dom-expressions: 0.34.7_@babel+core@7.19.0 + '@babel/core': 7.19.1 + babel-plugin-jsx-dom-expressions: 0.34.10_@babel+core@7.19.1 dev: true /balanced-match/1.0.2: @@ -950,15 +958,15 @@ packages: resolution: {integrity: sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==} dev: true - /browserslist/4.21.3: - resolution: {integrity: sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ==} + /browserslist/4.21.4: + resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001393 - electron-to-chromium: 1.4.244 + caniuse-lite: 1.0.30001410 + electron-to-chromium: 1.4.261 node-releases: 2.0.6 - update-browserslist-db: 1.0.7_browserslist@4.21.3 + update-browserslist-db: 1.0.9_browserslist@4.21.4 dev: true /c8/7.12.0: @@ -999,8 +1007,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite/1.0.30001393: - resolution: {integrity: sha512-N/od11RX+Gsk+1qY/jbPa0R6zJupEa0lxeBG598EbrtblxVCTJsQwbRBm6+V+rxpc5lHKdsXb9RY83cZIPLseA==} + /caniuse-lite/1.0.30001410: + resolution: {integrity: sha512-QoblBnuE+rG0lc3Ur9ltP5q47lbguipa/ncNMyyGuqPk44FxbScWAeEO+k5fSQ8WekdAK4mWqNs1rADDAiN5xQ==} dev: true /chai/4.3.6: @@ -1102,8 +1110,8 @@ packages: safe-buffer: 5.1.2 dev: true - /core-js-pure/3.25.1: - resolution: {integrity: sha512-7Fr74bliUDdeJCBMxkkIuQ4xfxn/SwrVg+HkJUAoNEXVqYLv55l6Af0dJ5Lq2YBUW9yKqSkLXaS5SYPK6MGa/A==} + /core-js-pure/3.25.2: + resolution: {integrity: sha512-ItD7YpW1cUB4jaqFLZXe1AXkyqIxz6GqPnsDV4uF4hVcWh/WAGIqSqw5p0/WdsILM0Xht9s3Koyw05R3K6RtiA==} requiresBuild: true dev: true @@ -1157,8 +1165,8 @@ packages: cssom: 0.3.8 dev: true - /csstype/3.1.0: - resolution: {integrity: sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==} + /csstype/3.1.1: + resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} /data-urls/3.0.2: resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==} @@ -1194,8 +1202,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /decimal.js/10.4.0: - resolution: {integrity: sha512-Nv6ENEzyPQ6AItkGwLE2PGKinZZ9g59vSh2BeH6NqPu0OTKZ5ruJsVqh/orbAnqXc9pBbgXAIrc2EyaCj8NpGg==} + /decimal.js/10.4.1: + resolution: {integrity: sha512-F29o+vci4DodHYT9UrR5IEbfBw9pE5eSapIJdTqXK5+6hq+t8VRxwQyKlW2i+KDKFkkJQRvFyI/QXD83h8LyQw==} dev: true /deep-eql/3.0.1: @@ -1239,8 +1247,8 @@ packages: webidl-conversions: 7.0.0 dev: true - /electron-to-chromium/1.4.244: - resolution: {integrity: sha512-E21saXLt2eTDaTxgUtiJtBUqanF9A32wZasAwDZ8gvrqXoxrBrbwtDCx7c/PQTLp81wj4X0OLDeoGQg7eMo3+w==} + /electron-to-chromium/1.4.261: + resolution: {integrity: sha512-fVXliNUGJ7XUVJSAasPseBbVgJIeyw5M1xIkgXdTSRjlmCqBbiSTsEdLOCJS31Fc8B7CaloQ/BFAg8By3ODLdg==} dev: true /emoji-regex/8.0.0: @@ -1258,8 +1266,8 @@ packages: is-arrayish: 0.2.1 dev: true - /esbuild-android-64/0.15.7: - resolution: {integrity: sha512-p7rCvdsldhxQr3YHxptf1Jcd86dlhvc3EQmQJaZzzuAxefO9PvcI0GLOa5nCWem1AJ8iMRu9w0r5TG8pHmbi9w==} + /esbuild-android-64/0.15.9: + resolution: {integrity: sha512-HQCX7FJn9T4kxZQkhPjNZC7tBWZqJvhlLHPU2SFzrQB/7nDXjmTIFpFTjt7Bd1uFpeXmuwf5h5fZm+x/hLnhbw==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1267,8 +1275,8 @@ packages: dev: true optional: true - /esbuild-android-arm64/0.15.7: - resolution: {integrity: sha512-L775l9ynJT7rVqRM5vo+9w5g2ysbOCfsdLV4CWanTZ1k/9Jb3IYlQ06VCI1edhcosTYJRECQFJa3eAvkx72eyQ==} + /esbuild-android-arm64/0.15.9: + resolution: {integrity: sha512-E6zbLfqbFVCNEKircSHnPiSTsm3fCRxeIMPfrkS33tFjIAoXtwegQfVZqMGR0FlsvVxp2NEDOUz+WW48COCjSg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1276,8 +1284,8 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.15.7: - resolution: {integrity: sha512-KGPt3r1c9ww009t2xLB6Vk0YyNOXh7hbjZ3EecHoVDxgtbUlYstMPDaReimKe6eOEfyY4hBEEeTvKwPsiH5WZg==} + /esbuild-darwin-64/0.15.9: + resolution: {integrity: sha512-gI7dClcDN/HHVacZhTmGjl0/TWZcGuKJ0I7/xDGJwRQQn7aafZGtvagOFNmuOq+OBFPhlPv1T6JElOXb0unkSQ==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1285,8 +1293,8 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.15.7: - resolution: {integrity: sha512-kBIHvtVqbSGajN88lYMnR3aIleH3ABZLLFLxwL2stiuIGAjGlQW741NxVTpUHQXUmPzxi6POqc9npkXa8AcSZQ==} + /esbuild-darwin-arm64/0.15.9: + resolution: {integrity: sha512-VZIMlcRN29yg/sv7DsDwN+OeufCcoTNaTl3Vnav7dL/nvsApD7uvhVRbgyMzv0zU/PP0xRhhIpTyc7lxEzHGSw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1294,8 +1302,8 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.15.7: - resolution: {integrity: sha512-hESZB91qDLV5MEwNxzMxPfbjAhOmtfsr9Wnuci7pY6TtEh4UDuevmGmkUIjX/b+e/k4tcNBMf7SRQ2mdNuK/HQ==} + /esbuild-freebsd-64/0.15.9: + resolution: {integrity: sha512-uM4z5bTvuAXqPxrI204txhlsPIolQPWRMLenvGuCPZTnnGlCMF2QLs0Plcm26gcskhxewYo9LkkmYSS5Czrb5A==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -1303,8 +1311,8 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64/0.15.7: - resolution: {integrity: sha512-dLFR0ChH5t+b3J8w0fVKGvtwSLWCv7GYT2Y2jFGulF1L5HftQLzVGN+6pi1SivuiVSmTh28FwUhi9PwQicXI6Q==} + /esbuild-freebsd-arm64/0.15.9: + resolution: {integrity: sha512-HHDjT3O5gWzicGdgJ5yokZVN9K9KG05SnERwl9nBYZaCjcCgj/sX8Ps1jvoFSfNCO04JSsHSOWo4qvxFuj8FoA==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -1312,8 +1320,8 @@ packages: dev: true optional: true - /esbuild-linux-32/0.15.7: - resolution: {integrity: sha512-v3gT/LsONGUZcjbt2swrMjwxo32NJzk+7sAgtxhGx1+ZmOFaTRXBAi1PPfgpeo/J//Un2jIKm/I+qqeo4caJvg==} + /esbuild-linux-32/0.15.9: + resolution: {integrity: sha512-AQIdE8FugGt1DkcekKi5ycI46QZpGJ/wqcMr7w6YUmOmp2ohQ8eO4sKUsOxNOvYL7hGEVwkndSyszR6HpVHLFg==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -1321,8 +1329,8 @@ packages: dev: true optional: true - /esbuild-linux-64/0.15.7: - resolution: {integrity: sha512-LxXEfLAKwOVmm1yecpMmWERBshl+Kv5YJ/1KnyAr6HRHFW8cxOEsEfisD3sVl/RvHyW//lhYUVSuy9jGEfIRAQ==} + /esbuild-linux-64/0.15.9: + resolution: {integrity: sha512-4RXjae7g6Qs7StZyiYyXTZXBlfODhb1aBVAjd+ANuPmMhWthQilWo7rFHwJwL7DQu1Fjej2sODAVwLbcIVsAYQ==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -1330,8 +1338,8 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.15.7: - resolution: {integrity: sha512-JKgAHtMR5f75wJTeuNQbyznZZa+pjiUHV7sRZp42UNdyXC6TiUYMW/8z8yIBAr2Fpad8hM1royZKQisqPABPvQ==} + /esbuild-linux-arm/0.15.9: + resolution: {integrity: sha512-3Zf2GVGUOI7XwChH3qrnTOSqfV1V4CAc/7zLVm4lO6JT6wbJrTgEYCCiNSzziSju+J9Jhf9YGWk/26quWPC6yQ==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -1339,8 +1347,8 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.15.7: - resolution: {integrity: sha512-P3cfhudpzWDkglutWgXcT2S7Ft7o2e3YDMrP1n0z2dlbUZghUkKCyaWw0zhp4KxEEzt/E7lmrtRu/pGWnwb9vw==} + /esbuild-linux-arm64/0.15.9: + resolution: {integrity: sha512-a+bTtxJmYmk9d+s2W4/R1SYKDDAldOKmWjWP0BnrWtDbvUBNOm++du0ysPju4mZVoEFgS1yLNW+VXnG/4FNwdQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -1348,8 +1356,8 @@ packages: dev: true optional: true - /esbuild-linux-mips64le/0.15.7: - resolution: {integrity: sha512-T7XKuxl0VpeFLCJXub6U+iybiqh0kM/bWOTb4qcPyDDwNVhLUiPcGdG2/0S7F93czUZOKP57YiLV8YQewgLHKw==} + /esbuild-linux-mips64le/0.15.9: + resolution: {integrity: sha512-Zn9HSylDp89y+TRREMDoGrc3Z4Hs5u56ozZLQCiZAUx2+HdbbXbWdjmw3FdTJ/i7t5Cew6/Q+6kfO3KCcFGlyw==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -1357,8 +1365,8 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.15.7: - resolution: {integrity: sha512-6mGuC19WpFN7NYbecMIJjeQgvDb5aMuvyk0PDYBJrqAEMkTwg3Z98kEKuCm6THHRnrgsdr7bp4SruSAxEM4eJw==} + /esbuild-linux-ppc64le/0.15.9: + resolution: {integrity: sha512-OEiOxNAMH9ENFYqRsWUj3CWyN3V8P3ZXyfNAtX5rlCEC/ERXrCEFCJji/1F6POzsXAzxvUJrTSTCy7G6BhA6Fw==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -1366,8 +1374,8 @@ packages: dev: true optional: true - /esbuild-linux-riscv64/0.15.7: - resolution: {integrity: sha512-uUJsezbswAYo/X7OU/P+PuL/EI9WzxsEQXDekfwpQ23uGiooxqoLFAPmXPcRAt941vjlY9jtITEEikWMBr+F/g==} + /esbuild-linux-riscv64/0.15.9: + resolution: {integrity: sha512-ukm4KsC3QRausEFjzTsOZ/qqazw0YvJsKmfoZZm9QW27OHjk2XKSQGGvx8gIEswft/Sadp03/VZvAaqv5AIwNA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -1375,8 +1383,8 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.15.7: - resolution: {integrity: sha512-+tO+xOyTNMc34rXlSxK7aCwJgvQyffqEM5MMdNDEeMU3ss0S6wKvbBOQfgd5jRPblfwJ6b+bKiz0g5nABpY0QQ==} + /esbuild-linux-s390x/0.15.9: + resolution: {integrity: sha512-uDOQEH55wQ6ahcIKzQr3VyjGc6Po/xblLGLoUk3fVL1qjlZAibtQr6XRfy5wPJLu/M2o0vQKLq4lyJ2r1tWKcw==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -1384,8 +1392,8 @@ packages: dev: true optional: true - /esbuild-netbsd-64/0.15.7: - resolution: {integrity: sha512-yVc4Wz+Pu3cP5hzm5kIygNPrjar/v5WCSoRmIjCPWfBVJkZNb5brEGKUlf+0Y759D48BCWa0WHrWXaNy0DULTQ==} + /esbuild-netbsd-64/0.15.9: + resolution: {integrity: sha512-yWgxaYTQz+TqX80wXRq6xAtb7GSBAp6gqLKfOdANg9qEmAI1Bxn04IrQr0Mzm4AhxvGKoHzjHjMgXbCCSSDxcw==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -1393,8 +1401,8 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.15.7: - resolution: {integrity: sha512-GsimbwC4FSR4lN3wf8XmTQ+r8/0YSQo21rWDL0XFFhLHKlzEA4SsT1Tl8bPYu00IU6UWSJ+b3fG/8SB69rcuEQ==} + /esbuild-openbsd-64/0.15.9: + resolution: {integrity: sha512-JmS18acQl4iSAjrEha1MfEmUMN4FcnnrtTaJ7Qg0tDCOcgpPPQRLGsZqhes0vmx8VA6IqRyScqXvaL7+Q0Uf3A==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -1402,8 +1410,8 @@ packages: dev: true optional: true - /esbuild-sunos-64/0.15.7: - resolution: {integrity: sha512-8CDI1aL/ts0mDGbWzjEOGKXnU7p3rDzggHSBtVryQzkSOsjCHRVe0iFYUuhczlxU1R3LN/E7HgUO4NXzGGP/Ag==} + /esbuild-sunos-64/0.15.9: + resolution: {integrity: sha512-UKynGSWpzkPmXW3D2UMOD9BZPIuRaSqphxSCwScfEE05Be3KAmvjsBhht1fLzKpiFVJb0BYMd4jEbWMyJ/z1hQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -1411,8 +1419,8 @@ packages: dev: true optional: true - /esbuild-windows-32/0.15.7: - resolution: {integrity: sha512-cOnKXUEPS8EGCzRSFa1x6NQjGhGsFlVgjhqGEbLTPsA7x4RRYiy2RKoArNUU4iR2vHmzqS5Gr84MEumO/wxYKA==} + /esbuild-windows-32/0.15.9: + resolution: {integrity: sha512-aqXvu4/W9XyTVqO/hw3rNxKE1TcZiEYHPsXM9LwYmKSX9/hjvfIJzXwQBlPcJ/QOxedfoMVH0YnhhQ9Ffb0RGA==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -1420,8 +1428,8 @@ packages: dev: true optional: true - /esbuild-windows-64/0.15.7: - resolution: {integrity: sha512-7MI08Ec2sTIDv+zH6StNBKO+2hGUYIT42GmFyW6MBBWWtJhTcQLinKS6ldIN1d52MXIbiJ6nXyCJ+LpL4jBm3Q==} + /esbuild-windows-64/0.15.9: + resolution: {integrity: sha512-zm7h91WUmlS4idMtjvCrEeNhlH7+TNOmqw5dJPJZrgFaxoFyqYG6CKDpdFCQXdyKpD5yvzaQBOMVTCBVKGZDEg==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1429,8 +1437,8 @@ packages: dev: true optional: true - /esbuild-windows-arm64/0.15.7: - resolution: {integrity: sha512-R06nmqBlWjKHddhRJYlqDd3Fabx9LFdKcjoOy08YLimwmsswlFBJV4rXzZCxz/b7ZJXvrZgj8DDv1ewE9+StMw==} + /esbuild-windows-arm64/0.15.9: + resolution: {integrity: sha512-yQEVIv27oauAtvtuhJVfSNMztJJX47ismRS6Sv2QMVV9RM+6xjbMWuuwM2nxr5A2/gj/mu2z9YlQxiwoFRCfZA==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -1438,33 +1446,34 @@ packages: dev: true optional: true - /esbuild/0.15.7: - resolution: {integrity: sha512-7V8tzllIbAQV1M4QoE52ImKu8hT/NLGlGXkiDsbEU5PS6K8Mn09ZnYoS+dcmHxOS9CRsV4IRAMdT3I67IyUNXw==} + /esbuild/0.15.9: + resolution: {integrity: sha512-OnYr1rkMVxtmMHIAKZLMcEUlJmqcbxBz9QoBU8G9v455na0fuzlT/GLu6l+SRghrk0Mm2fSSciMmzV43Q8e0Gg==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/linux-loong64': 0.15.7 - esbuild-android-64: 0.15.7 - esbuild-android-arm64: 0.15.7 - esbuild-darwin-64: 0.15.7 - esbuild-darwin-arm64: 0.15.7 - esbuild-freebsd-64: 0.15.7 - esbuild-freebsd-arm64: 0.15.7 - esbuild-linux-32: 0.15.7 - esbuild-linux-64: 0.15.7 - esbuild-linux-arm: 0.15.7 - esbuild-linux-arm64: 0.15.7 - esbuild-linux-mips64le: 0.15.7 - esbuild-linux-ppc64le: 0.15.7 - esbuild-linux-riscv64: 0.15.7 - esbuild-linux-s390x: 0.15.7 - esbuild-netbsd-64: 0.15.7 - esbuild-openbsd-64: 0.15.7 - esbuild-sunos-64: 0.15.7 - esbuild-windows-32: 0.15.7 - esbuild-windows-64: 0.15.7 - esbuild-windows-arm64: 0.15.7 + '@esbuild/android-arm': 0.15.9 + '@esbuild/linux-loong64': 0.15.9 + esbuild-android-64: 0.15.9 + esbuild-android-arm64: 0.15.9 + esbuild-darwin-64: 0.15.9 + esbuild-darwin-arm64: 0.15.9 + esbuild-freebsd-64: 0.15.9 + esbuild-freebsd-arm64: 0.15.9 + esbuild-linux-32: 0.15.9 + esbuild-linux-64: 0.15.9 + esbuild-linux-arm: 0.15.9 + esbuild-linux-arm64: 0.15.9 + esbuild-linux-mips64le: 0.15.9 + esbuild-linux-ppc64le: 0.15.9 + esbuild-linux-riscv64: 0.15.9 + esbuild-linux-s390x: 0.15.9 + esbuild-netbsd-64: 0.15.9 + esbuild-openbsd-64: 0.15.9 + esbuild-sunos-64: 0.15.9 + esbuild-windows-32: 0.15.9 + esbuild-windows-64: 0.15.9 + esbuild-windows-arm64: 0.15.9 dev: true /escalade/3.1.1: @@ -1511,13 +1520,13 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils/3.0.0_eslint@8.23.0: + /eslint-utils/3.0.0_eslint@8.24.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.23.0 + eslint: 8.24.0 eslint-visitor-keys: 2.1.0 dev: true @@ -1531,13 +1540,13 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint/8.23.0: - resolution: {integrity: sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA==} + /eslint/8.24.0: + resolution: {integrity: sha512-dWFaPhGhTAiPcCgm3f6LI2MBWbogMnTJzFBbhXVRQDJPkr9pGZvVjlVfXd+vyDcWPA2Ic9L2AXPIQM0+vk/cSQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint/eslintrc': 1.3.1 - '@humanwhocodes/config-array': 0.10.4 + '@eslint/eslintrc': 1.3.2 + '@humanwhocodes/config-array': 0.10.5 '@humanwhocodes/gitignore-to-minimatch': 1.0.2 '@humanwhocodes/module-importer': 1.0.1 ajv: 6.12.6 @@ -1547,7 +1556,7 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.23.0 + eslint-utils: 3.0.0_eslint@8.24.0 eslint-visitor-keys: 3.3.0 espree: 9.4.0 esquery: 1.4.0 @@ -1555,7 +1564,6 @@ packages: fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 find-up: 5.0.0 - functional-red-black-tree: 1.0.1 glob-parent: 6.0.2 globals: 13.17.0 globby: 11.1.0 @@ -1564,6 +1572,7 @@ packages: import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 + js-sdsl: 4.1.4 js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 @@ -1631,8 +1640,8 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true - /fast-glob/3.2.11: - resolution: {integrity: sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==} + /fast-glob/3.2.12: + resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} dependencies: '@nodelib/fs.stat': 2.0.5 @@ -1736,10 +1745,6 @@ packages: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: true - /functional-red-black-tree/1.0.1: - resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} - dev: true - /gensync/1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -1813,7 +1818,7 @@ packages: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.2.11 + fast-glob: 3.2.12 ignore: 5.2.0 merge2: 1.4.1 slash: 3.0.0 @@ -2046,6 +2051,10 @@ packages: moo-color: 1.0.3 dev: true + /js-sdsl/4.1.4: + resolution: {integrity: sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==} + dev: true + /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true @@ -2072,7 +2081,7 @@ packages: cssom: 0.5.0 cssstyle: 2.3.0 data-urls: 3.0.2 - decimal.js: 10.4.0 + decimal.js: 10.4.1 domexception: 4.0.0 escodegen: 2.0.0 form-data: 4.0.0 @@ -2091,7 +2100,7 @@ packages: whatwg-encoding: 2.0.0 whatwg-mimetype: 3.0.0 whatwg-url: 11.0.0 - ws: 8.8.1 + ws: 8.9.0 xml-name-validator: 4.0.0 transitivePeerDependencies: - bufferutil @@ -2301,11 +2310,11 @@ packages: kind-of: 6.0.3 dev: true - /mlly/0.5.14: - resolution: {integrity: sha512-DgRgNUSX9NIxxCxygX4Xeg9C7GX7OUx1wuQ8cXx9o9LE0e9wrH+OZ9fcnrlEedsC/rtqry3ZhUddC759XD/L0w==} + /mlly/0.5.16: + resolution: {integrity: sha512-LaJ8yuh4v0zEmge/g3c7jjFlhoCPfQn6RCjXgm9A0Qiuochq4BcuOxVfWmdnCoLTlg2MV+hqhOek+W2OhG0Lwg==} dependencies: acorn: 8.8.0 - pathe: 0.3.7 + pathe: 0.3.8 pkg-types: 0.3.5 ufo: 0.8.5 dev: true @@ -2476,8 +2485,8 @@ packages: resolution: {integrity: sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==} dev: true - /pathe/0.3.7: - resolution: {integrity: sha512-yz7GK+kSsS27x727jtXpd5VT4dDfP/JDIQmaowfxyWCnFjOWtE1VIh7i6TzcSfzW0n4+bRQztj1VdKnITNq/MA==} + /pathe/0.3.8: + resolution: {integrity: sha512-c71n61F1skhj/jzZe+fWE9XDoTYjWbUwIKVwFftZ5IOgiX44BVkTkD+/803YDgR50tqeO4eXWxLyVHBLWQAD1g==} dev: true /pathval/1.1.1: @@ -2497,8 +2506,8 @@ packages: resolution: {integrity: sha512-VkxCBFVgQhNHYk9subx+HOhZ4jzynH11ah63LZsprTKwPCWG9pfWBlkElWFbvkP9BVR0dP1jS9xPdhaHQNK74Q==} dependencies: jsonc-parser: 3.2.0 - mlly: 0.5.14 - pathe: 0.3.7 + mlly: 0.5.16 + pathe: 0.3.8 dev: true /postcss-media-query-parser/0.2.3: @@ -2518,8 +2527,8 @@ packages: postcss: 8.4.16 dev: true - /postcss-scss/4.0.4_postcss@8.4.16: - resolution: {integrity: sha512-aBBbVyzA8b3hUL0MGrpydxxXKXFZc5Eqva0Q3V9qsBOLEMsjb6w49WfpsoWzpEgcqJGW4t7Rio8WXVU9Gd8vWg==} + /postcss-scss/4.0.5_postcss@8.4.16: + resolution: {integrity: sha512-F7xpB6TrXyqUh3GKdyB4Gkp3QL3DDW1+uI+gxx/oJnUt/qXI4trj5OGlp9rOKdoABGULuqtqeG+3HEVQk4DjmA==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.3.3 @@ -2704,8 +2713,8 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true - /sass/1.54.9: - resolution: {integrity: sha512-xb1hjASzEH+0L0WI9oFjqhRi51t/gagWnxLiwUNMltA0Ab6jIDkAacgKiGYKM9Jhy109osM7woEEai6SXeJo5Q==} + /sass/1.55.0: + resolution: {integrity: sha512-Pk+PMy7OGLs9WaxZGJMn7S96dvlyVBwwtToX895WmCpAOr5YiJYEUJfiJidMuKb613z2xNWcXCHEuOvjZbqC6A==} engines: {node: '>=12.0.0'} hasBin: true dependencies: @@ -2769,12 +2778,12 @@ packages: is-fullwidth-code-point: 3.0.0 dev: true - /solid-js/1.5.4: - resolution: {integrity: sha512-+65anSHhH27htkhP5LuC912fviMIckgc7/yN+WWrKhS9Kp3dvtDNl5/m4GWX1lpCvcubjShqJjGt16HET5z5Ig==} + /solid-js/1.5.6: + resolution: {integrity: sha512-EA7hjMIEdDUuV6Fk3WUQ2fPx7sRnhjl+3M59zj6Sh+c7c3JF3N1cSViBvX8MYJG9vEBEqKQBZUfKHPe/9JgKvQ==} dependencies: - csstype: 3.1.0 + csstype: 3.1.1 - /solid-refresh/0.4.1_solid-js@1.5.4: + /solid-refresh/0.4.1_solid-js@1.5.6: resolution: {integrity: sha512-v3tD/OXQcUyXLrWjPW1dXZyeWwP7/+GQNs8YTL09GBq+5FguA6IejJWUvJDrLIA4M0ho9/5zK2e9n+uy+4488g==} peerDependencies: solid-js: ^1.3 @@ -2782,17 +2791,17 @@ packages: '@babel/generator': 7.19.0 '@babel/helper-module-imports': 7.18.6 '@babel/types': 7.19.0 - solid-js: 1.5.4 + solid-js: 1.5.6 dev: true - /solid-testing-library/0.3.0_solid-js@1.5.4: + /solid-testing-library/0.3.0_solid-js@1.5.6: resolution: {integrity: sha512-6NWVbySNVzyReBm2N6p3eF8bzxRZXHZTAmPix4vFWYol16QWVjNQsEUxvr+ZOutb0yuMZmNuGx3b6WIJYmjwMQ==} engines: {node: '>= 14'} peerDependencies: solid-js: '>=1.0.0' dependencies: '@testing-library/dom': 7.31.2 - solid-js: 1.5.4 + solid-js: 1.5.6 dev: true /source-map-js/1.0.2: @@ -2857,8 +2866,8 @@ packages: engines: {node: '>=8'} dev: true - /strip-literal/0.4.0: - resolution: {integrity: sha512-ql/sBDoJOybTKSIOWrrh8kgUEMjXMwRAkZTD0EwiwxQH/6tTPkZvMIEjp0CRlpi6V5FMiJyvxeRkEi1KrGISoA==} + /strip-literal/0.4.2: + resolution: {integrity: sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==} dependencies: acorn: 8.8.0 dev: true @@ -2867,25 +2876,25 @@ packages: resolution: {integrity: sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==} dev: true - /stylelint-config-recommended/9.0.0_stylelint@14.11.0: + /stylelint-config-recommended/9.0.0_stylelint@14.12.1: resolution: {integrity: sha512-9YQSrJq4NvvRuTbzDsWX3rrFOzOlYBmZP+o513BJN/yfEmGSr0AxdvrWs0P/ilSpVV/wisamAHu5XSk8Rcf4CQ==} peerDependencies: stylelint: ^14.10.0 dependencies: - stylelint: 14.11.0 + stylelint: 14.12.1 dev: true - /stylelint-config-standard/28.0.0_stylelint@14.11.0: + /stylelint-config-standard/28.0.0_stylelint@14.12.1: resolution: {integrity: sha512-q/StuowDdDmFCravzGHAwgS9pjX0bdOQUEBBDIkIWsQuYGgYz/xsO8CM6eepmIQ1fc5bKdDVimlJZ6MoOUcJ5Q==} peerDependencies: stylelint: ^14.11.0 dependencies: - stylelint: 14.11.0 - stylelint-config-recommended: 9.0.0_stylelint@14.11.0 + stylelint: 14.12.1 + stylelint-config-recommended: 9.0.0_stylelint@14.12.1 dev: true - /stylelint/14.11.0: - resolution: {integrity: sha512-OTLjLPxpvGtojEfpESWM8Ir64Z01E89xsisaBMUP/ngOx1+4VG2DPRcUyCCiin9Rd3kPXPsh/uwHd9eqnvhsYA==} + /stylelint/14.12.1: + resolution: {integrity: sha512-ZEM4TuksChMBfuPadQsHUkbOoRySAT9QMfDvvYxdAchOJl0p+csTMBXOu6ORAAxKhwBmxqJiep8V88bXfNs3EQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} hasBin: true dependencies: @@ -2895,7 +2904,7 @@ packages: cosmiconfig: 7.0.1 css-functions-list: 3.1.0 debug: 4.3.4 - fast-glob: 3.2.11 + fast-glob: 3.2.12 fastest-levenshtein: 1.0.16 file-entry-cache: 6.0.1 global-modules: 2.0.0 @@ -2998,8 +3007,8 @@ packages: resolution: {integrity: sha512-ak+PZZEuH3mw6CCFOgf5S90YH0MARnZNhxjhjguAmoJimEMAJuNip/rJRd6/wyylHItomVpKTzZk9zrhTrQCoQ==} dev: true - /tinypool/0.2.4: - resolution: {integrity: sha512-Vs3rhkUH6Qq1t5bqtb816oT+HeJTXfwt2cbPH17sWHIYKTotQIFPk3tf2fgqRrVyMDVOc1EnPgzIxfIulXVzwQ==} + /tinypool/0.3.0: + resolution: {integrity: sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==} engines: {node: '>=14.0.0'} dev: true @@ -3050,14 +3059,14 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tsutils/3.21.0_typescript@4.8.2: + /tsutils/3.21.0_typescript@4.8.3: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.8.2 + typescript: 4.8.3 dev: true /type-check/0.3.2: @@ -3099,8 +3108,8 @@ packages: engines: {node: '>=8'} dev: true - /typescript/4.8.2: - resolution: {integrity: sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==} + /typescript/4.8.3: + resolution: {integrity: sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig==} engines: {node: '>=4.2.0'} hasBin: true dev: true @@ -3114,13 +3123,13 @@ packages: engines: {node: '>= 4.0.0'} dev: true - /update-browserslist-db/1.0.7_browserslist@4.21.3: - resolution: {integrity: sha512-iN/XYesmZ2RmmWAiI4Z5rq0YqSiv0brj9Ce9CfhNE4xIW2h+MFxcgkxIzZ+ShkFPUkjU3gQ+3oypadD3RAMtrg==} + /update-browserslist-db/1.0.9_browserslist@4.21.4: + resolution: {integrity: sha512-/xsqn21EGVdXI3EXSum1Yckj3ZVZugqyOZQ/CxYPBD/R+ko9NSUScf8tFF4dOKY+2pvSSJA/S+5B8s4Zr4kyvg==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.3 + browserslist: 4.21.4 escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -3162,15 +3171,15 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /vite-node/0.23.1_sass@1.54.9: - resolution: {integrity: sha512-Pw/tUT+28AArEuY5OoNzcNVD1QtUmJklNIX6mlk9w0Eda/31HrCpgIf14OJGLf3DiAPNdCEJI9jHQFyvb4U8rw==} + /vite-node/0.23.4_sass@1.55.0: + resolution: {integrity: sha512-8VuDGwTWIvwPYcbw8ZycMlwAwqCmqZfLdFrDK75+o+6bWYpede58k6AAXN9ioU+icW82V4u1MzkxLVhhIoQ9xA==} engines: {node: '>=v14.16.0'} hasBin: true dependencies: debug: 4.3.4 - mlly: 0.5.14 + mlly: 0.5.16 pathe: 0.2.0 - vite: 3.1.0_sass@1.54.9 + vite: 3.1.3_sass@1.55.0 transitivePeerDependencies: - less - sass @@ -3179,32 +3188,32 @@ packages: - terser dev: true - /vite-plugin-glsl/0.3.0: - resolution: {integrity: sha512-cH7ni+Y3Vz1yOumvrP/71hXVdyTxZIaYYNDeK7KMvO5nzo0uGZZrrkwEVUaESS8/5dYemb/6G0YBj3jsP2sW1A==} + /vite-plugin-glsl/0.4.0: + resolution: {integrity: sha512-Q+g008AWOGOm1Ng63A2YoLEUkONFRNtzwTmK0mgL2V9Pf/omsd2TSrRHCVXa24CmEAxT1VtV5nH2+u/uCNTR9Q==} engines: {node: '>= 14.18.0', npm: '>= 6.14.17'} dependencies: '@rollup/pluginutils': 4.2.1 dev: true - /vite-plugin-solid/2.3.0_solid-js@1.5.4+vite@3.1.0: - resolution: {integrity: sha512-N2sa54C3UZC2nN5vpj5o6YP+XdIAZW6n6xv8OasxNAcAJPFeZT7EOVvumL0V4c8hBz1yuYniMWdESY8807fVSg==} + /vite-plugin-solid/2.3.7_solid-js@1.5.6+vite@3.1.3: + resolution: {integrity: sha512-fwr/G4NoQZ2J76QEolEJemhrPWK5/uamYDo8xDM9d4+C6jQ6Yrs14h8lrU56mybE789ecOODcunP83b+JBH6Rg==} peerDependencies: solid-js: ^1.3.17 vite: ^3.0.0 dependencies: - '@babel/core': 7.19.0 - '@babel/preset-typescript': 7.18.6_@babel+core@7.19.0 - babel-preset-solid: 1.5.4_@babel+core@7.19.0 + '@babel/core': 7.19.1 + '@babel/preset-typescript': 7.18.6_@babel+core@7.19.1 + babel-preset-solid: 1.5.6_@babel+core@7.19.1 merge-anything: 5.0.4 - solid-js: 1.5.4 - solid-refresh: 0.4.1_solid-js@1.5.4 - vite: 3.1.0_sass@1.54.9 + solid-js: 1.5.6 + solid-refresh: 0.4.1_solid-js@1.5.6 + vite: 3.1.3_sass@1.55.0 transitivePeerDependencies: - supports-color dev: true - /vite/3.1.0_sass@1.54.9: - resolution: {integrity: sha512-YBg3dUicDpDWFCGttmvMbVyS9ydjntwEjwXRj2KBFwSB8SxmGcudo1yb8FW5+M/G86aS8x828ujnzUVdsLjs9g==} + /vite/3.1.3_sass@1.55.0: + resolution: {integrity: sha512-/3XWiktaopByM5bd8dqvHxRt5EEgRikevnnrpND0gRfNkrMrPaGGexhtLCzv15RcCMtV2CLw+BPas8YFeSG0KA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -3222,17 +3231,17 @@ packages: terser: optional: true dependencies: - esbuild: 0.15.7 + esbuild: 0.15.9 postcss: 8.4.16 resolve: 1.22.1 rollup: 2.78.1 - sass: 1.54.9 + sass: 1.55.0 optionalDependencies: fsevents: 2.3.2 dev: true - /vitest/0.23.1_jsdom@20.0.0+sass@1.54.9: - resolution: {integrity: sha512-kn9pG+h6VA3yj/xRvwgLKEd33rOlzMqJEg3tl5HSm3WUPlkY1Lr1FK8RN1uIqVKvFxmz6HGU3EQW+xW2kazRkQ==} + /vitest/0.23.4_jsdom@20.0.0+sass@1.55.0: + resolution: {integrity: sha512-iukBNWqQAv8EKDBUNntspLp9SfpaVFbmzmM0sNcnTxASQZMzRw3PsM6DMlsHiI+I6GeO5/sYDg3ecpC+SNFLrQ==} engines: {node: '>=v14.16.0'} hasBin: true peerDependencies: @@ -3255,16 +3264,16 @@ packages: dependencies: '@types/chai': 4.3.3 '@types/chai-subset': 1.3.3 - '@types/node': 18.7.16 + '@types/node': 18.7.19 chai: 4.3.6 debug: 4.3.4 jsdom: 20.0.0 local-pkg: 0.4.2 - strip-literal: 0.4.0 + strip-literal: 0.4.2 tinybench: 2.1.5 - tinypool: 0.2.4 + tinypool: 0.3.0 tinyspy: 1.0.2 - vite: 3.1.0_sass@1.54.9 + vite: 3.1.3_sass@1.55.0 transitivePeerDependencies: - less - sass @@ -3352,8 +3361,8 @@ packages: signal-exit: 3.0.7 dev: true - /ws/8.8.1: - resolution: {integrity: sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==} + /ws/8.9.0: + resolution: {integrity: sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 diff --git a/src/playground/index.ts b/src/playground/index.ts index aa57f53..6df49e0 100644 --- a/src/playground/index.ts +++ b/src/playground/index.ts @@ -8,18 +8,18 @@ import { WebGLRenderer } from 'three/src/renderers/WebGLRenderer'; import type { Color as ThreeColor } from 'three/src/math/Color'; import { AmbientLight } from 'three/src/lights/AmbientLight'; import Stats from 'three/examples/jsm/libs/stats.module'; -import type { Vector3 } from 'three/src/math/Vector3'; +import GroundMaterial from '@/playground/GroundMaterial'; +import type { Vector3 } from 'three/src/math/Vector3'; +import GUIControls from '@/playground/GUIControls'; import { DoubleSide } from 'three/src/constants'; import { Scene } from 'three/src/scenes/Scene'; -import GroundMaterial from './GroundMaterial'; import { Mesh } from 'three/src/objects/Mesh'; +import { Config } from '@/playground/Config'; import { Fog } from 'three/src/scenes/Fog'; -import GUIControls from './GUIControls'; import Viewport from '@/utils/Viewport'; import { Color } from '@/utils/Color'; import { PI } from '@/utils/Number'; -import { Config } from './Config'; import RAF from '@/utils/RAF'; export default class Playground diff --git a/tests/playground/GroundMaterial.spec.ts b/tests/playground/GroundMaterial.spec.ts index 34a5736..0d44788 100644 --- a/tests/playground/GroundMaterial.spec.ts +++ b/tests/playground/GroundMaterial.spec.ts @@ -2,7 +2,7 @@ import { MeshPhongMaterial } from 'three/src/materials/MeshPhongMaterial'; import GroundMaterial from '@/playground/GroundMaterial'; import { describe, test, expect, vi } from 'vitest'; -interface PublicGroundMaterial { +export interface PublicGroundMaterial { cellSize: { value: number }; set cell (size: number); } diff --git a/tests/playground/Playground.spec.ts b/tests/playground/Playground.spec.ts index 52bb9ec..442bb89 100644 --- a/tests/playground/Playground.spec.ts +++ b/tests/playground/Playground.spec.ts @@ -1,15 +1,43 @@ +import type { DirectionalLightHelper } from 'three/src/helpers/DirectionalLightHelper'; import type { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; +import type { PerspectiveCamera } from 'three/src/cameras/PerspectiveCamera'; +import type { DirectionalLight } from 'three/src/lights/DirectionalLight'; +import type { PublicGroundMaterial } from './GroundMaterial.spec'; +import type { AmbientLight } from 'three/src/lights/AmbientLight'; +import type GroundMaterial from '@/playground/GroundMaterial'; + import { describe, test, expect, vi } from 'vitest'; +import type { Scene } from 'three/src/scenes/Scene'; +import type { Mesh } from 'three/src/objects/Mesh'; +import { Vector3 } from 'three/src/math/Vector3'; +import { Config } from '@/playground/Config'; +import { Fog } from 'three/src/scenes/Fog'; +import { Vector } from '@/utils/Vector'; import Playground from '@/playground'; +import { Color } from '@/utils/Color'; vi.mock('three/src/renderers/WebGLRenderer'); interface PublicPlayground { - orbitControls: OrbitControls; + updateDirectional: (directional: typeof Config.Lights.directional) => void; + updateCameraPosition: (position: Vector3, target: Vector3) => void; + updateAmbient: (ambient: typeof Config.Lights.ambient) => void; + updateCamera: (ambient: typeof Config.Camera) => void; + updateGround: (ground: typeof Config.Ground) => void; + updateFog: (ground: typeof Config.Fog) => void; + get domElement (): HTMLCanvasElement; set controls (enabled: boolean); set pause (paused: boolean); destroy: () => void; + + helper: DirectionalLightHelper; + directional: DirectionalLight; + orbitControls: OrbitControls; + camera: PerspectiveCamera; + ambient: AmbientLight; + ground: Mesh; + scene: Scene; } describe('Playground', () => { @@ -53,4 +81,116 @@ describe('Playground', () => { playground.pause = false; expect(playground.orbitControls.enabled).toStrictEqual(true); }); + + test('updateAmbient', () => { + playground.updateAmbient(Config.Lights.ambient); + + expect(playground.ambient.intensity).toStrictEqual( + Config.Lights.ambient.intensity + ); + + expect(playground.ambient.color.equals( + Color.getClass(Config.Lights.ambient.color) + )).toStrictEqual(true); + }); + + test('updateDirectional', () => { + const directional = Config.Lights.directional; + + expect(playground.helper.visible).toStrictEqual(directional.helper.visible); + expect(playground.directional.intensity).toStrictEqual(directional.intensity); + + expect(playground.directional.shadow.camera.bottom).toStrictEqual( + directional.shadow.camera.bottom + ); + + expect(playground.directional.shadow.camera.right).toStrictEqual( + directional.shadow.camera.right + ); + + expect(playground.directional.shadow.camera.left).toStrictEqual( + directional.shadow.camera.left + ); + + expect(playground.directional.shadow.camera.top).toStrictEqual( + directional.shadow.camera.top + ); + + expect(playground.directional.shadow.camera.near).toStrictEqual( + directional.shadow.camera.near + ); + + expect(playground.directional.shadow.camera.far).toStrictEqual( + directional.shadow.camera.far + ); + + expect(playground.directional.castShadow).toStrictEqual( + directional.shadow.cast + ); + + expect(playground.directional.shadow.mapSize.equals( + directional.shadow.mapSize + )).toStrictEqual(true); + + expect(playground.directional.position.equals( + directional.position + )).toStrictEqual(true); + + expect(playground.directional.rotation.equals( + directional.rotation + )).toStrictEqual(true); + + expect(playground.directional.color.equals( + Color.getClass(directional.color) + )).toStrictEqual(true); + }); + + test('updateFog', () => { + const fog = playground.scene.fog as Fog; + playground.updateFog(Config.Fog); + + expect(fog).toBeInstanceOf(Fog); + expect(fog.near).toStrictEqual(Config.Fog.near); + expect(fog.far).toStrictEqual(Config.Fog.far); + + expect(fog.color.equals( + Color.getClass(Config.Fog.color) + )).toStrictEqual(true); + + playground.updateFog({ ...Config.Fog, visible: false }); + expect(playground.scene.fog).toStrictEqual(null); + }); + + test('updateCamera', () => { + playground.updateCamera(Config.Camera); + + expect(playground.camera.fov).toStrictEqual(Config.Camera.fov); + expect(playground.camera.near).toStrictEqual(Config.Camera.near); + expect(playground.camera.far).toStrictEqual(Config.Camera.far); + }); + + test('updateCameraPosition', () => { + const target = Vector.random(); + const position = Vector.random(); + + playground.updateCameraPosition(position, target); + + expect(playground.orbitControls.target.equals(target)).toStrictEqual(true); + expect(playground.camera.position.equals(position)).toStrictEqual(true); + }); + + test('updateGround', () => { + playground.updateGround(Config.Ground); + const groundScale = new Vector3(1.0, 1.0, 1.0); + + expect(playground.ground.scale.equals(groundScale)).toStrictEqual(true); + + expect((playground.ground.material as unknown as GroundMaterial).color.equals( + Color.getClass(Config.Ground.color)) + ).toStrictEqual(true); + + expect( + (playground.ground.material as unknown as PublicGroundMaterial).cellSize.value + ).toStrictEqual(Config.Ground.cell); + }); });