@volter/model-editor 0.5.66 → 0.5.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +1022 -1006
- package/dist/assets/AudioViewer-DVXaSSYC.js +1 -0
- package/dist/assets/{BVHLoader-xUHWsz84.js → BVHLoader-msuIvJVn.js} +1 -1
- package/dist/assets/ColladaLoader-BpvxwqkB.js +3 -0
- package/dist/assets/EntityModelDocument-BtlQZcoU.js +1 -0
- package/dist/assets/EnvironmentAssetDocument-BH3zT9rt.js +1 -0
- package/dist/assets/FBXLoader-CsdO937F.js +1 -0
- package/dist/assets/{GameplaySessionTimeline-HJLZUV4Q.js → GameplaySessionTimeline-Dko95kB7.js} +10 -10
- package/dist/assets/ImageViewer-CZ_RMER2.js +1 -0
- package/dist/assets/{InspectorCanvasPreview-CLDhscy0.js → InspectorCanvasPreview-BLecDHpc.js} +1 -1
- package/dist/assets/InspectorObjectPreview-CSIWwJQE.js +1 -0
- package/dist/assets/JsonAssetDocument-CGYSeJyl.js +2 -0
- package/dist/assets/{LineSegments2-C8H20K8w.js → LineSegments2-BKEsgiC8.js} +2 -2
- package/dist/assets/LiveModuleDocument-CIvS-SUT.js +2 -0
- package/dist/assets/LutAssetDocument-BA70uU3w.js +1 -0
- package/dist/assets/{MTLLoader-C-rA0fNF.js → MTLLoader-DNh2pFDc.js} +2 -2
- package/dist/assets/ModelAssetDocument-D0lNEhOg.js +1 -0
- package/dist/assets/NonThreeAuthoringBootstrap-C0pCfkJ4.js +2 -0
- package/dist/assets/OBJLoader-DPi99VIm.js +5 -0
- package/dist/assets/Object3DDocumentToolbar-PGYkZEwr.js +1 -0
- package/dist/assets/Object3DPreview-BROKXSTC.js +2 -0
- package/dist/assets/OnlineAssetDetail-lEHnhdUS.js +1 -0
- package/dist/assets/OrbitControls-smIenN60.js +1 -0
- package/dist/assets/PLYLoader-Cx9Yc9xe.js +2 -0
- package/dist/assets/QuarksAssetDocument-C_8eG4KG.js +2 -0
- package/dist/assets/RectAreaLightUniformsLib-Iam8rS8R.js +1 -0
- package/dist/assets/STLLoader-BaJkM-k1.js +1 -0
- package/dist/assets/{ShaderAssetDocument-qlLeb2S3.js → ShaderAssetDocument-Gdp7OCfv.js} +5 -5
- package/dist/assets/SourceAssetViewer-l72u0hOa.js +1 -0
- package/dist/assets/StageHost-CdzuP0NS.js +1179 -0
- package/dist/assets/TDSLoader-BskhMiUy.js +1 -0
- package/dist/assets/ToolObject3DPreview-CU5klD6l.js +1 -0
- package/dist/assets/Toolbar-DI0LGx25.js +1 -0
- package/dist/assets/TransientHint-myZtSdd6.js +1 -0
- package/dist/assets/VideoViewer-z0JPXPKa.js +1 -0
- package/dist/assets/ViewportShadingMenu-CVU2bU_3.js +1 -0
- package/dist/assets/animation-mixers.service-DSIsxWG5.js +1 -0
- package/dist/assets/animation-timeline.utility-BEgDQC04.js +1 -0
- package/dist/assets/asset-editor-persistence-BtRQI8t6.js +1 -0
- package/dist/assets/bitmap-label-Ct4k6ehY.js +1 -0
- package/dist/assets/{blender-emscripten-engine-CEsWgnR7.js → blender-emscripten-engine-BeWFjMn-.js} +1 -1
- package/dist/assets/blender-node-editor.document-C_kpsARB.js +1 -0
- package/dist/assets/{blender-properties-tab-C5tUuCSv.js → blender-properties-tab-B_XBg6S8.js} +3 -3
- package/dist/assets/blender-runtime-host-CYhl4T9S.js +4 -0
- package/dist/assets/{blender-runtime-skin-DMq0XAvO.js → blender-runtime-skin-Bk6uXECD.js} +98 -51
- package/dist/assets/blender-runtime.document-CAPDRCvN.js +12 -0
- package/dist/assets/blender-timeline.document-CcEymQyL.js +1 -0
- package/dist/assets/blender-uv-editor.document-DSPvSEuE.js +1 -0
- package/dist/assets/blender-version.status-CEu7vCi3.js +1 -0
- package/dist/assets/{blender-wali-engine-D3iKpzn9.js → blender-wali-engine-da698rDf.js} +1 -1
- package/dist/assets/blender.command-BCb_c9lw.js +1 -0
- package/dist/assets/blender.keymap-_rF_vRX8.js +1 -0
- package/dist/assets/{blender.status-ujwGU6dU.js → blender.status-DrasQhJV.js} +1 -1
- package/dist/assets/{blender.style-CxfbTFcE.js → blender.style-DaIh9SiA.js} +1 -1
- package/dist/assets/{client-DNXj_opT.js → client-mkWk8S65.js} +1 -1
- package/dist/assets/content-bounds-_QWiKD5_.js +85 -0
- package/dist/assets/{hosted-asset-materialization-BXM49Qkc.js → hosted-asset-materialization-hUS3IhTD.js} +2 -2
- package/dist/assets/index-0Lm0Nf1M.css +1 -0
- package/dist/assets/{index-CJbYy-CF.js → index-7vd2obXq.js} +2 -2
- package/dist/assets/{index-DgapqSPi.js → index-BRLA7zdc.js} +1 -1
- package/dist/assets/{index-BtfYaG4D.js → index-CQG6JOSy.js} +18 -18
- package/dist/assets/{index-CanA16PU.js → index-CnvSS9lU.js} +1 -1
- package/dist/assets/{index-Bge9JUr6.js → index-DYNMP0kE.js} +1 -1
- package/dist/assets/index-Dm_h-T4x.js +1406 -0
- package/dist/assets/{index-gHZae-lw.js → index-Dz8qGBZc.js} +1 -1
- package/dist/assets/{index-BncK9THk.js → index-Fv4R0cYr.js} +1 -1
- package/dist/assets/{index-IEjydI9d.js → index-f-MQ14bP.js} +1 -1
- package/dist/assets/{index-D2LwEE0L.js → index-jib6KJY8.js} +6 -6
- package/dist/assets/{index-DUqP1RMl.js → index-ux8XhRyW.js} +1 -1
- package/dist/assets/{jsx-runtime-DPjLkJKQ.js → jsx-runtime-CAUTK36e.js} +1 -1
- package/dist/assets/layered-pick-CT4HlEpW.js +1 -0
- package/dist/assets/live-mixers-B-bwLZ7c.js +1 -0
- package/dist/assets/model-inspection-DDZE59vp.js +1 -0
- package/dist/assets/models.finder-Caf-3Yix.js +1 -0
- package/dist/assets/product-DbFrUS6F.js +1 -0
- package/dist/assets/properties-bone-constraints.inspector-DB3Rc_Hf.js +1 -0
- package/dist/assets/properties-bone.inspector-B7f7H_Co.js +1 -0
- package/dist/assets/properties-collection.inspector-JCtV3h3Y.js +1 -0
- package/dist/assets/properties-constraints.inspector-Cs8MwS-1.js +1 -0
- package/dist/assets/properties-data.inspector-DKGiHu8O.js +1 -0
- package/dist/assets/properties-material.inspector-Dc18RI13.js +1 -0
- package/dist/assets/properties-modifiers.inspector-DvGvXq2v.js +1 -0
- package/dist/assets/properties-object.inspector-Bl9nrytP.js +1 -0
- package/dist/assets/properties-output.inspector-B6QsU94n.js +1 -0
- package/dist/assets/properties-particles.inspector-B1dMnZSA.js +1 -0
- package/dist/assets/properties-physics.inspector-BwfNykfW.js +1 -0
- package/dist/assets/properties-render.inspector-KrL2EiTH.js +1 -0
- package/dist/assets/properties-scene.inspector-CewQnyRt.js +1 -0
- package/dist/assets/properties-texture.inspector-BITMzY-f.js +1 -0
- package/dist/assets/properties-view-layer.inspector-BpkDbmcb.js +1 -0
- package/dist/assets/properties-world.inspector-DLRH45Oj.js +1 -0
- package/dist/assets/{react-18-DyywM-Z2.js → react-18-D335xReo.js} +1 -1
- package/dist/assets/{react-story-board-B9V-j_Y5.js → react-story-board-CkaP4mEG.js} +1 -1
- package/dist/assets/{session-CsR0lApe.js → session-CTXsU1lK.js} +176 -1
- package/dist/assets/{spark.module-gG1EsWx8.js → spark.module-DMQ9J7rT.js} +11 -11
- package/dist/assets/stage-keyboard-BY7u9_MB.js +1 -0
- package/dist/assets/stage-overlay-set-DRFcVd27.js +1 -0
- package/dist/assets/stage-presence-markers-D2IpuOAY.js +1 -0
- package/dist/assets/stage-transform-tools-BGcIULoe.js +1 -0
- package/dist/assets/story-capture-RSWY8I8h.js +1 -0
- package/dist/assets/three-integration.service-0EyPpd5f.js +4 -0
- package/dist/assets/{three.module-ZILb6uB7.js → three.module-CrYDk-Xr.js} +1 -1
- package/dist/assets/transform-mode-request-Cz6fzydi.js +1 -0
- package/dist/assets/transport-strip-Co-ZDkf-.js +1 -0
- package/dist/assets/{vgai-shared-fontawesome-CFSkqz69.js → vgai-shared-fontawesome-2ZSGa7vM.js} +1 -1
- package/dist/assets/vgai-shared-jsx-dev-runtime-hkPLeIJV.js +1 -0
- package/dist/assets/vgai-shared-jsx-runtime-CUvvjEqj.js +1 -0
- package/dist/assets/{vgai-shared-react-dom-client-S0ozfl6_.js → vgai-shared-react-dom-client-CS681GK2.js} +1 -1
- package/dist/assets/{vgai-shared-three-DzfWDqlp.js → vgai-shared-three-CLJ0K3jQ.js} +1 -1
- package/dist/assets/viewport-door-BdL0u5rd.js +1 -0
- package/dist/assets/viewport-editor-controls-BYaAZ_Ku.js +1 -0
- package/dist/assets/viewport-surface-status-yS6CrXH7.js +24 -0
- package/dist/assets/{worker-B7zhIsFh.js → worker-CC9Ug5Ei.js} +1 -1
- package/dist/assets/world-documents-B5IWN-ng.js +3 -0
- package/dist/vgai-shared-react.json +4 -4
- package/dist/vgai-shared-three.json +1 -1
- package/dist-node/cli.js +248 -209
- package/dist-node/create.js +77 -77
- package/package.json +10 -10
- package/src/index.ts +1 -0
- package/dist/assets/AudioViewer-CRWsJVYN.js +0 -1
- package/dist/assets/ColladaLoader-Ccy_gHsu.js +0 -3
- package/dist/assets/EntityModelDocument-Dal8YnLK.js +0 -1
- package/dist/assets/EnvironmentAssetDocument-DFOFYX5v.js +0 -1
- package/dist/assets/FBXLoader-Dh0pOBW2.js +0 -1
- package/dist/assets/ImageViewer-BzqBpqL-.js +0 -1
- package/dist/assets/InspectorObjectPreview-BUZEp4xS.js +0 -1
- package/dist/assets/JsonAssetDocument-DCkqRS0N.js +0 -2
- package/dist/assets/LiveModuleDocument-CuOBVz3A.js +0 -2
- package/dist/assets/LutAssetDocument-IyEir1rq.js +0 -1
- package/dist/assets/ModelAssetDocument-DNStNyCc.js +0 -1
- package/dist/assets/NonThreeAuthoringBootstrap-BE15Wpmw.js +0 -2
- package/dist/assets/OBJLoader-CopWRneC.js +0 -5
- package/dist/assets/Object3DDocumentToolbar-5Dv_8caG.js +0 -1
- package/dist/assets/Object3DPreview-C09u9uQZ.js +0 -2
- package/dist/assets/OnlineAssetDetail-DOPUI1iu.js +0 -1
- package/dist/assets/OrbitControls-DrFzvAAB.js +0 -1
- package/dist/assets/PLYLoader-D_esTZ2f.js +0 -2
- package/dist/assets/QuarksAssetDocument-BbSJ970L.js +0 -2
- package/dist/assets/RectAreaLightUniformsLib-u1ciScuw.js +0 -1
- package/dist/assets/STLLoader-Cl5I0sAi.js +0 -1
- package/dist/assets/SourceAssetViewer-DwhuqbA4.js +0 -1
- package/dist/assets/StageHost-D-o8MsFS.js +0 -1122
- package/dist/assets/TDSLoader-KKBg8ef1.js +0 -1
- package/dist/assets/ToolObject3DPreview-ILbch3kN.js +0 -1
- package/dist/assets/Toolbar-DYJjJKTt.js +0 -1
- package/dist/assets/TransientHint-D94hsJSR.js +0 -1
- package/dist/assets/VideoViewer-Bx3FPbgE.js +0 -1
- package/dist/assets/ViewportShadingMenu-B3N6hSdN.js +0 -1
- package/dist/assets/animation-mixers.service-N9HxGOMf.js +0 -1
- package/dist/assets/asset-editor-persistence-DGD05u26.js +0 -1
- package/dist/assets/blender-node-editor.document-BT2M622g.js +0 -1
- package/dist/assets/blender-runtime-host-4ufXy47O.js +0 -4
- package/dist/assets/blender-runtime.document-DeFQQsF6.js +0 -8
- package/dist/assets/blender-timeline.document-BnlSdxy0.js +0 -1
- package/dist/assets/blender-uv-editor.document-UC-XeNn0.js +0 -1
- package/dist/assets/blender-version.status-BZP39oH7.js +0 -1
- package/dist/assets/blender.command-IGP5wuda.js +0 -1
- package/dist/assets/blender.keymap-GAQgeklK.js +0 -1
- package/dist/assets/browserAll-2r3AVaAO.js +0 -14
- package/dist/assets/canvas-preview-frames-CO60PDM7.js +0 -5
- package/dist/assets/index-B4bmKkgY.css +0 -1
- package/dist/assets/index-cpXNKgvz.js +0 -1498
- package/dist/assets/live-mixers-BRkRHd6g.js +0 -1
- package/dist/assets/material-preview.view-DqNcpd_b.js +0 -1
- package/dist/assets/model-inspection-JC6gbV8Q.js +0 -1
- package/dist/assets/models.finder-BplPGS4I.js +0 -1
- package/dist/assets/product-CfZaqLpw.js +0 -1
- package/dist/assets/properties-bone-constraints.inspector-Di8kNtAi.js +0 -1
- package/dist/assets/properties-bone.inspector-CqAIKNsE.js +0 -1
- package/dist/assets/properties-collection.inspector-DpHC_fXW.js +0 -1
- package/dist/assets/properties-constraints.inspector-C7G7NOZU.js +0 -1
- package/dist/assets/properties-data.inspector-D1sUUst6.js +0 -1
- package/dist/assets/properties-material.inspector-BUSjc8tl.js +0 -1
- package/dist/assets/properties-modifiers.inspector-Sq9bcfFz.js +0 -1
- package/dist/assets/properties-object.inspector-BzqiU_29.js +0 -1
- package/dist/assets/properties-output.inspector-BWpFqvfT.js +0 -1
- package/dist/assets/properties-particles.inspector-DO1KoaTz.js +0 -1
- package/dist/assets/properties-physics.inspector-BgkrTNSA.js +0 -1
- package/dist/assets/properties-render.inspector-BU5NOVoQ.js +0 -1
- package/dist/assets/properties-scene.inspector-DbMErJ48.js +0 -1
- package/dist/assets/properties-texture.inspector-toPpEwqp.js +0 -1
- package/dist/assets/properties-view-layer.inspector-COpx9iEK.js +0 -1
- package/dist/assets/properties-world.inspector-CxU0DrYX.js +0 -1
- package/dist/assets/react-three-rapier.esm-CN6t4A7c.js +0 -1
- package/dist/assets/stage-keyboard-CzlqI0nh.js +0 -1
- package/dist/assets/stage-overlay-set-DQeskS16.js +0 -1
- package/dist/assets/stage-presence-markers-S1lMOwIa.js +0 -1
- package/dist/assets/stage-transform-tools-Cqtv-ZQ1.js +0 -1
- package/dist/assets/story-capture-DmIUyEQn.js +0 -1
- package/dist/assets/story-mount-turn-2IYGgHob.js +0 -1
- package/dist/assets/story-pixi-preview-aw8xQhvF.js +0 -1
- package/dist/assets/story-three-preview-DDmMjlI8.js +0 -37
- package/dist/assets/transform-mode-request-DSPwviXs.js +0 -1
- package/dist/assets/vgai-shared-jsx-dev-runtime-DFDKL7fx.js +0 -1
- package/dist/assets/vgai-shared-jsx-runtime-DIqBpTut.js +0 -1
- package/dist/assets/viewport-pick-context-DkawXbEi.js +0 -1
- package/dist/assets/viewport-surface-status-DuININWe.js +0 -20
- package/dist/assets/webworkerAll-CqQUotBj.js +0 -101
- package/dist/assets/world-documents-DkBqH8VU.js +0 -3
|
@@ -3837,4 +3837,4 @@ void main() {
|
|
|
3837
3837
|
|
|
3838
3838
|
}
|
|
3839
3839
|
|
|
3840
|
-
}`;class Vy{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){const n=new dc(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,n=new fn({vertexShader:zy,fragmentShader:ky,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new ye(new Ss(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Hy extends En{constructor(t,e){super();const n=this;let i=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,f=null,m=null;const _=typeof XRWebGLBinding<"u",g=new Vy,p={},y=e.getContextAttributes();let v=null,x=null;const A=[],T=[],R=new Q;let I=null;const b=new Te;b.viewport=new te;const S=new Te;S.viewport=new te;const L=[b,S],F=new af;let z=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let et=A[Y];return et===void 0&&(et=new pa,A[Y]=et),et.getTargetRaySpace()},this.getControllerGrip=function(Y){let et=A[Y];return et===void 0&&(et=new pa,A[Y]=et),et.getGripSpace()},this.getHand=function(Y){let et=A[Y];return et===void 0&&(et=new pa,A[Y]=et),et.getHandSpace()};function q(Y){const et=T.indexOf(Y.inputSource);if(et===-1)return;const yt=A[et];yt!==void 0&&(yt.update(Y.inputSource,Y.frame,c||a),yt.dispatchEvent({type:Y.type,data:Y.inputSource}))}function W(){i.removeEventListener("select",q),i.removeEventListener("selectstart",q),i.removeEventListener("selectend",q),i.removeEventListener("squeeze",q),i.removeEventListener("squeezestart",q),i.removeEventListener("squeezeend",q),i.removeEventListener("end",W),i.removeEventListener("inputsourceschange",nt);for(let Y=0;Y<A.length;Y++){const et=T[Y];et!==null&&(T[Y]=null,A[Y].disconnect(et))}z=null,G=null,g.reset();for(const Y in p)delete p[Y];t.setRenderTarget(v),f=null,d=null,u=null,i=null,x=null,Qt.stop(),n.isPresenting=!1,t.setPixelRatio(I),t.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){o=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u===null&&_&&(u=new XRWebGLBinding(i,e)),u},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(Y){if(i=Y,i!==null){if(v=t.getRenderTarget(),i.addEventListener("select",q),i.addEventListener("selectstart",q),i.addEventListener("selectend",q),i.addEventListener("squeeze",q),i.addEventListener("squeezestart",q),i.addEventListener("squeezeend",q),i.addEventListener("end",W),i.addEventListener("inputsourceschange",nt),y.xrCompatible!==!0&&await e.makeXRCompatible(),I=t.getPixelRatio(),t.getSize(R),_&&"createProjectionLayer"in XRWebGLBinding.prototype){let yt=null,Pt=null,Tt=null;y.depth&&(Tt=y.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,yt=y.stencil?ds:us,Pt=y.stencil?hs:kn);const Zt={colorFormat:e.RGBA8,depthFormat:Tt,scaleFactor:s};u=this.getBinding(),d=u.createProjectionLayer(Zt),i.updateRenderState({layers:[d]}),t.setPixelRatio(1),t.setSize(d.textureWidth,d.textureHeight,!1),x=new bn(d.textureWidth,d.textureHeight,{format:Oe,type:dn,depthTexture:new uc(d.textureWidth,d.textureHeight,Pt,void 0,void 0,void 0,void 0,void 0,void 0,yt),stencilBuffer:y.stencil,colorSpace:t.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const yt={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(i,e,yt),i.updateRenderState({baseLayer:f}),t.setPixelRatio(1),t.setSize(f.framebufferWidth,f.framebufferHeight,!1),x=new bn(f.framebufferWidth,f.framebufferHeight,{format:Oe,type:dn,colorSpace:t.outputColorSpace,stencilBuffer:y.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}x.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Qt.setContext(i),Qt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function nt(Y){for(let et=0;et<Y.removed.length;et++){const yt=Y.removed[et],Pt=T.indexOf(yt);Pt>=0&&(T[Pt]=null,A[Pt].disconnect(yt))}for(let et=0;et<Y.added.length;et++){const yt=Y.added[et];let Pt=T.indexOf(yt);if(Pt===-1){for(let Zt=0;Zt<A.length;Zt++)if(Zt>=T.length){T.push(yt),Pt=Zt;break}else if(T[Zt]===null){T[Zt]=yt,Pt=Zt;break}if(Pt===-1)break}const Tt=A[Pt];Tt&&Tt.connect(yt)}}const H=new C,ut=new C;function _t(Y,et,yt){H.setFromMatrixPosition(et.matrixWorld),ut.setFromMatrixPosition(yt.matrixWorld);const Pt=H.distanceTo(ut),Tt=et.projectionMatrix.elements,Zt=yt.projectionMatrix.elements,ce=Tt[14]/(Tt[10]-1),P=Tt[14]/(Tt[10]+1),tt=(Tt[9]+1)/Tt[5],$=(Tt[9]-1)/Tt[5],J=(Tt[8]-1)/Tt[0],Z=(Zt[8]+1)/Zt[0],ct=ce*J,it=ce*Z,ht=Pt/(-J+Z),kt=ht*-J;if(et.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(kt),Y.translateZ(ht),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Tt[10]===-1)Y.projectionMatrix.copy(et.projectionMatrix),Y.projectionMatrixInverse.copy(et.projectionMatrixInverse);else{const zt=ce+ht,w=P+ht,M=ct-kt,O=it+(Pt-kt),V=tt*P/w*zt,j=$*P/w*zt;Y.projectionMatrix.makePerspective(M,O,V,j,zt,w),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function St(Y,et){et===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(et.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(i===null)return;let et=Y.near,yt=Y.far;g.texture!==null&&(g.depthNear>0&&(et=g.depthNear),g.depthFar>0&&(yt=g.depthFar)),F.near=S.near=b.near=et,F.far=S.far=b.far=yt,(z!==F.near||G!==F.far)&&(i.updateRenderState({depthNear:F.near,depthFar:F.far}),z=F.near,G=F.far),F.layers.mask=Y.layers.mask|6,b.layers.mask=F.layers.mask&3,S.layers.mask=F.layers.mask&5;const Pt=Y.parent,Tt=F.cameras;St(F,Pt);for(let Zt=0;Zt<Tt.length;Zt++)St(Tt[Zt],Pt);Tt.length===2?_t(F,b,S):F.projectionMatrix.copy(b.projectionMatrix),Gt(Y,F,Pt)};function Gt(Y,et,yt){yt===null?Y.matrix.copy(et.matrixWorld):(Y.matrix.copy(yt.matrixWorld),Y.matrix.invert(),Y.matrix.multiply(et.matrixWorld)),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.updateMatrixWorld(!0),Y.projectionMatrix.copy(et.projectionMatrix),Y.projectionMatrixInverse.copy(et.projectionMatrixInverse),Y.isPerspectiveCamera&&(Y.fov=ps*2*Math.atan(1/Y.projectionMatrix.elements[5]),Y.zoom=1)}this.getCamera=function(){return F},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(Y){l=Y,d!==null&&(d.fixedFoveation=Y),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=Y)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(F)},this.getCameraTexture=function(Y){return p[Y]};let $t=null;function se(Y,et){if(h=et.getViewerPose(c||a),m=et,h!==null){const yt=h.views;f!==null&&(t.setRenderTargetFramebuffer(x,f.framebuffer),t.setRenderTarget(x));let Pt=!1;yt.length!==F.cameras.length&&(F.cameras.length=0,Pt=!0);for(let P=0;P<yt.length;P++){const tt=yt[P];let $=null;if(f!==null)$=f.getViewport(tt);else{const Z=u.getViewSubImage(d,tt);$=Z.viewport,P===0&&(t.setRenderTargetTextures(x,Z.colorTexture,Z.depthStencilTexture),t.setRenderTarget(x))}let J=L[P];J===void 0&&(J=new Te,J.layers.enable(P),J.viewport=new te,L[P]=J),J.matrix.fromArray(tt.transform.matrix),J.matrix.decompose(J.position,J.quaternion,J.scale),J.projectionMatrix.fromArray(tt.projectionMatrix),J.projectionMatrixInverse.copy(J.projectionMatrix).invert(),J.viewport.set($.x,$.y,$.width,$.height),P===0&&(F.matrix.copy(J.matrix),F.matrix.decompose(F.position,F.quaternion,F.scale)),Pt===!0&&F.cameras.push(J)}const Tt=i.enabledFeatures;if(Tt&&Tt.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&_){u=n.getBinding();const P=u.getDepthInformation(yt[0]);P&&P.isValid&&P.texture&&g.init(P,i.renderState)}if(Tt&&Tt.includes("camera-access")&&_){t.state.unbindTexture(),u=n.getBinding();for(let P=0;P<yt.length;P++){const tt=yt[P].camera;if(tt){let $=p[tt];$||($=new dc,p[tt]=$);const J=u.getCameraImage(tt);$.sourceTexture=J}}}}for(let yt=0;yt<A.length;yt++){const Pt=T[yt],Tt=A[yt];Pt!==null&&Tt!==void 0&&Tt.update(Pt,et,c||a)}$t&&$t(Y,et),et.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:et}),m=null}const Qt=new df;Qt.setAnimationLoop(se),this.setAnimationLoop=function(Y){$t=Y},this.dispose=function(){}}}const vi=new tn,Gy=new Ot;function Wy(r,t){function e(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function n(g,p){p.color.getRGB(g.fogColor.value,cd(r)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,y,v,x){p.isMeshBasicMaterial||p.isMeshLambertMaterial?s(g,p):p.isMeshToonMaterial?(s(g,p),u(g,p)):p.isMeshPhongMaterial?(s(g,p),h(g,p)):p.isMeshStandardMaterial?(s(g,p),d(g,p),p.isMeshPhysicalMaterial&&f(g,p,x)):p.isMeshMatcapMaterial?(s(g,p),m(g,p)):p.isMeshDepthMaterial?s(g,p):p.isMeshDistanceMaterial?(s(g,p),_(g,p)):p.isMeshNormalMaterial?s(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,y,v):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function s(g,p){g.opacity.value=p.opacity,p.color&&g.diffuse.value.copy(p.color),p.emissive&&g.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(g.map.value=p.map,e(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,e(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===Be&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,e(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===Be&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,e(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,e(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,e(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);const y=t.get(p),v=y.envMap,x=y.envMapRotation;v&&(g.envMap.value=v,vi.copy(x),vi.x*=-1,vi.y*=-1,vi.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(vi.y*=-1,vi.z*=-1),g.envMapRotation.value.setFromMatrix4(Gy.makeRotationFromEuler(vi)),g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap&&(g.lightMap.value=p.lightMap,g.lightMapIntensity.value=p.lightMapIntensity,e(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,e(p.aoMap,g.aoMapTransform))}function a(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,e(p.map,g.mapTransform))}function o(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function l(g,p,y,v){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*y,g.scale.value=v*.5,p.map&&(g.map.value=p.map,e(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,e(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function d(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,e(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,e(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function f(g,p,y){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,e(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,e(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,e(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,e(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,e(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Be&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,e(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,e(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,e(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,e(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,e(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,e(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,e(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const y=t.get(p).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function Xy(r,t,e,n){let i={},s={},a=[];const o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,v){const x=v.program;n.uniformBlockBinding(y,x)}function c(y,v){let x=i[y.id];x===void 0&&(m(y),x=h(y),i[y.id]=x,y.addEventListener("dispose",g));const A=v.program;n.updateUBOMapping(y,A);const T=t.render.frame;s[y.id]!==T&&(d(y),s[y.id]=T)}function h(y){const v=u();y.__bindingPointIndex=v;const x=r.createBuffer(),A=y.__size,T=y.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,A,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,x),x}function u(){for(let y=0;y<o;y++)if(a.indexOf(y)===-1)return a.push(y),y;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(y){const v=i[y.id],x=y.uniforms,A=y.__cache;r.bindBuffer(r.UNIFORM_BUFFER,v);for(let T=0,R=x.length;T<R;T++){const I=Array.isArray(x[T])?x[T]:[x[T]];for(let b=0,S=I.length;b<S;b++){const L=I[b];if(f(L,T,b,A)===!0){const F=L.__offset,z=Array.isArray(L.value)?L.value:[L.value];let G=0;for(let q=0;q<z.length;q++){const W=z[q],nt=_(W);typeof W=="number"||typeof W=="boolean"?(L.__data[0]=W,r.bufferSubData(r.UNIFORM_BUFFER,F+G,L.__data)):W.isMatrix3?(L.__data[0]=W.elements[0],L.__data[1]=W.elements[1],L.__data[2]=W.elements[2],L.__data[3]=0,L.__data[4]=W.elements[3],L.__data[5]=W.elements[4],L.__data[6]=W.elements[5],L.__data[7]=0,L.__data[8]=W.elements[6],L.__data[9]=W.elements[7],L.__data[10]=W.elements[8],L.__data[11]=0):(W.toArray(L.__data,G),G+=nt.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,F,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function f(y,v,x,A){const T=y.value,R=v+"_"+x;if(A[R]===void 0)return typeof T=="number"||typeof T=="boolean"?A[R]=T:A[R]=T.clone(),!0;{const I=A[R];if(typeof T=="number"||typeof T=="boolean"){if(I!==T)return A[R]=T,!0}else if(I.equals(T)===!1)return I.copy(T),!0}return!1}function m(y){const v=y.uniforms;let x=0;const A=16;for(let R=0,I=v.length;R<I;R++){const b=Array.isArray(v[R])?v[R]:[v[R]];for(let S=0,L=b.length;S<L;S++){const F=b[S],z=Array.isArray(F.value)?F.value:[F.value];for(let G=0,q=z.length;G<q;G++){const W=z[G],nt=_(W),H=x%A,ut=H%nt.boundary,_t=H+ut;x+=ut,_t!==0&&A-_t<nt.storage&&(x+=A-_t),F.__data=new Float32Array(nt.storage/Float32Array.BYTES_PER_ELEMENT),F.__offset=x,x+=nt.storage}}}const T=x%A;return T>0&&(x+=A-T),y.__size=x,y.__cache={},this}function _(y){const v={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(v.boundary=4,v.storage=4):y.isVector2?(v.boundary=8,v.storage=8):y.isVector3||y.isColor?(v.boundary=16,v.storage=12):y.isVector4?(v.boundary=16,v.storage=16):y.isMatrix3?(v.boundary=48,v.storage=48):y.isMatrix4?(v.boundary=64,v.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),v}function g(y){const v=y.target;v.removeEventListener("dispose",g);const x=a.indexOf(v.__bindingPointIndex);a.splice(x,1),r.deleteBuffer(i[v.id]),delete i[v.id],delete s[v.id]}function p(){for(const y in i)r.deleteBuffer(i[y]);a=[],i={},s={}}return{bind:l,update:c,dispose:p}}class qy{constructor(t={}){const{canvas:e=ad(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1}=t;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const y=[],v=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Fn,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const x=this;let A=!1;this._outputColorSpace=Ge;let T=0,R=0,I=null,b=-1,S=null;const L=new te,F=new te;let z=null;const G=new xt(0);let q=0,W=e.width,nt=e.height,H=1,ut=null,_t=null;const St=new te(0,0,W,nt),Gt=new te(0,0,W,nt);let $t=!1;const se=new Ms;let Qt=!1,Y=!1;const et=new Ot,yt=new C,Pt=new te,Tt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Zt=!1;function ce(){return I===null?H:1}let P=n;function tt(E,U){return e.getContext(E,U)}try{const E={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine","three.js r180"),e.addEventListener("webglcontextlost",dt,!1),e.addEventListener("webglcontextrestored",bt,!1),e.addEventListener("webglcontextcreationerror",rt,!1),P===null){const U="webgl2";if(P=tt(U,E),P===null)throw tt(U)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let $,J,Z,ct,it,ht,kt,zt,w,M,O,V,j,X,Rt,lt,At,wt,st,gt,Ft,It,pt,qt;function D(){$=new iv(P),$.init(),It=new _f(P,$),J=new $x(P,$,t,It),Z=new Oy(P,$),J.reversedDepthBuffer&&d&&Z.buffers.depth.setReversed(!0),ct=new av(P),it=new Ey,ht=new By(P,$,Z,it,J,It,ct),kt=new Qx(x),zt=new nv(x),w=new d_(P),pt=new Zx(P,w),M=new sv(P,w,ct,pt),O=new lv(P,M,w,ct),st=new ov(P,J,ht),lt=new Kx(it),V=new by(x,kt,zt,$,J,pt,lt),j=new Wy(x,it),X=new Ay,Rt=new Ly($),wt=new Yx(x,kt,zt,Z,O,f,l),At=new Ny(x,O,J),qt=new Xy(P,ct,J,Z),gt=new Jx(P,$,ct),Ft=new rv(P,$,ct),ct.programs=V.programs,x.capabilities=J,x.extensions=$,x.properties=it,x.renderLists=X,x.shadowMap=At,x.state=Z,x.info=ct}D();const ot=new Hy(x,P);this.xr=ot,this.getContext=function(){return P},this.getContextAttributes=function(){return P.getContextAttributes()},this.forceContextLoss=function(){const E=$.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){const E=$.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(E){E!==void 0&&(H=E,this.setSize(W,nt,!1))},this.getSize=function(E){return E.set(W,nt)},this.setSize=function(E,U,B=!0){if(ot.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}W=E,nt=U,e.width=Math.floor(E*H),e.height=Math.floor(U*H),B===!0&&(e.style.width=E+"px",e.style.height=U+"px"),this.setViewport(0,0,E,U)},this.getDrawingBufferSize=function(E){return E.set(W*H,nt*H).floor()},this.setDrawingBufferSize=function(E,U,B){W=E,nt=U,H=B,e.width=Math.floor(E*B),e.height=Math.floor(U*B),this.setViewport(0,0,E,U)},this.getCurrentViewport=function(E){return E.copy(L)},this.getViewport=function(E){return E.copy(St)},this.setViewport=function(E,U,B,k){E.isVector4?St.set(E.x,E.y,E.z,E.w):St.set(E,U,B,k),Z.viewport(L.copy(St).multiplyScalar(H).round())},this.getScissor=function(E){return E.copy(Gt)},this.setScissor=function(E,U,B,k){E.isVector4?Gt.set(E.x,E.y,E.z,E.w):Gt.set(E,U,B,k),Z.scissor(F.copy(Gt).multiplyScalar(H).round())},this.getScissorTest=function(){return $t},this.setScissorTest=function(E){Z.setScissorTest($t=E)},this.setOpaqueSort=function(E){ut=E},this.setTransparentSort=function(E){_t=E},this.getClearColor=function(E){return E.copy(wt.getClearColor())},this.setClearColor=function(){wt.setClearColor(...arguments)},this.getClearAlpha=function(){return wt.getClearAlpha()},this.setClearAlpha=function(){wt.setClearAlpha(...arguments)},this.clear=function(E=!0,U=!0,B=!0){let k=0;if(E){let N=!1;if(I!==null){const at=I.texture.format;N=at===ho||at===co||at===dr}if(N){const at=I.texture.type,mt=at===dn||at===kn||at===cs||at===hs||at===ao||at===oo,Et=wt.getClearColor(),vt=wt.getClearAlpha(),Ut=Et.r,Bt=Et.g,Lt=Et.b;mt?(m[0]=Ut,m[1]=Bt,m[2]=Lt,m[3]=vt,P.clearBufferuiv(P.COLOR,0,m)):(_[0]=Ut,_[1]=Bt,_[2]=Lt,_[3]=vt,P.clearBufferiv(P.COLOR,0,_))}else k|=P.COLOR_BUFFER_BIT}U&&(k|=P.DEPTH_BUFFER_BIT),B&&(k|=P.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),P.clear(k)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",dt,!1),e.removeEventListener("webglcontextrestored",bt,!1),e.removeEventListener("webglcontextcreationerror",rt,!1),wt.dispose(),X.dispose(),Rt.dispose(),it.dispose(),kt.dispose(),zt.dispose(),O.dispose(),pt.dispose(),qt.dispose(),V.dispose(),ot.dispose(),ot.removeEventListener("sessionstart",mn),ot.removeEventListener("sessionend",Dc),si.stop()};function dt(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),A=!0}function bt(){console.log("THREE.WebGLRenderer: Context Restored."),A=!1;const E=ct.autoReset,U=At.enabled,B=At.autoUpdate,k=At.needsUpdate,N=At.type;D(),ct.autoReset=E,At.enabled=U,At.autoUpdate=B,At.needsUpdate=k,At.type=N}function rt(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function K(E){const U=E.target;U.removeEventListener("dispose",K),Ct(U)}function Ct(E){Vt(E),it.remove(E)}function Vt(E){const U=it.get(E).programs;U!==void 0&&(U.forEach(function(B){V.releaseProgram(B)}),E.isShaderMaterial&&V.releaseShaderCache(E))}this.renderBufferDirect=function(E,U,B,k,N,at){U===null&&(U=Tt);const mt=N.isMesh&&N.matrixWorld.determinant()<0,Et=xf(E,U,B,k,N);Z.setMaterial(k,mt);let vt=B.index,Ut=1;if(k.wireframe===!0){if(vt=M.getWireframeAttribute(B),vt===void 0)return;Ut=2}const Bt=B.drawRange,Lt=B.attributes.position;let Jt=Bt.start*Ut,ae=(Bt.start+Bt.count)*Ut;at!==null&&(Jt=Math.max(Jt,at.start*Ut),ae=Math.min(ae,(at.start+at.count)*Ut)),vt!==null?(Jt=Math.max(Jt,0),ae=Math.min(ae,vt.count)):Lt!=null&&(Jt=Math.max(Jt,0),ae=Math.min(ae,Lt.count));const me=ae-Jt;if(me<0||me===1/0)return;pt.setup(N,k,Et,B,vt);let ue,le=gt;if(vt!==null&&(ue=w.get(vt),le=Ft,le.setIndex(ue)),N.isMesh)k.wireframe===!0?(Z.setLineWidth(k.wireframeLinewidth*ce()),le.setMode(P.LINES)):le.setMode(P.TRIANGLES);else if(N.isLine){let Dt=k.linewidth;Dt===void 0&&(Dt=1),Z.setLineWidth(Dt*ce()),N.isLineSegments?le.setMode(P.LINES):N.isLineLoop?le.setMode(P.LINE_LOOP):le.setMode(P.LINE_STRIP)}else N.isPoints?le.setMode(P.POINTS):N.isSprite&&le.setMode(P.TRIANGLES);if(N.isBatchedMesh)if(N._multiDrawInstances!==null)ir("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),le.renderMultiDrawInstances(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount,N._multiDrawInstances);else if($.get("WEBGL_multi_draw"))le.renderMultiDraw(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount);else{const Dt=N._multiDrawStarts,de=N._multiDrawCounts,ne=N._multiDrawCount,Ze=vt?w.get(vt).bytesPerElement:1,Fi=it.get(k).currentProgram.getUniforms();for(let Je=0;Je<ne;Je++)Fi.setValue(P,"_gl_DrawID",Je),le.render(Dt[Je]/Ze,de[Je])}else if(N.isInstancedMesh)le.renderInstances(Jt,me,N.count);else if(B.isInstancedBufferGeometry){const Dt=B._maxInstanceCount!==void 0?B._maxInstanceCount:1/0,de=Math.min(B.instanceCount,Dt);le.renderInstances(Jt,me,de)}else le.render(Jt,me)};function he(E,U,B){E.transparent===!0&&E.side===vn&&E.forceSinglePass===!1?(E.side=Be,E.needsUpdate=!0,Mr(E,U,B),E.side=Bn,E.needsUpdate=!0,Mr(E,U,B),E.side=vn):Mr(E,U,B)}this.compile=function(E,U,B=null){B===null&&(B=E),p=Rt.get(B),p.init(U),v.push(p),B.traverseVisible(function(N){N.isLight&&N.layers.test(U.layers)&&(p.pushLight(N),N.castShadow&&p.pushShadow(N))}),E!==B&&E.traverseVisible(function(N){N.isLight&&N.layers.test(U.layers)&&(p.pushLight(N),N.castShadow&&p.pushShadow(N))}),p.setupLights();const k=new Set;return E.traverse(function(N){if(!(N.isMesh||N.isPoints||N.isLine||N.isSprite))return;const at=N.material;if(at)if(Array.isArray(at))for(let mt=0;mt<at.length;mt++){const Et=at[mt];he(Et,B,N),k.add(Et)}else he(at,B,N),k.add(at)}),p=v.pop(),k},this.compileAsync=function(E,U,B=null){const k=this.compile(E,U,B);return new Promise(N=>{function at(){if(k.forEach(function(mt){it.get(mt).currentProgram.isReady()&&k.delete(mt)}),k.size===0){N(E);return}setTimeout(at,10)}$.get("KHR_parallel_shader_compile")!==null?at():setTimeout(at,10)})};let ie=null;function An(E){ie&&ie(E)}function mn(){si.stop()}function Dc(){si.start()}const si=new df;si.setAnimationLoop(An),typeof self<"u"&&si.setContext(self),this.setAnimationLoop=function(E){ie=E,ot.setAnimationLoop(E),E===null?si.stop():si.start()},ot.addEventListener("sessionstart",mn),ot.addEventListener("sessionend",Dc),this.render=function(E,U){if(U!==void 0&&U.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(A===!0)return;if(E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),U.parent===null&&U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),ot.enabled===!0&&ot.isPresenting===!0&&(ot.cameraAutoUpdate===!0&&ot.updateCamera(U),U=ot.getCamera()),E.isScene===!0&&E.onBeforeRender(x,E,U,I),p=Rt.get(E,v.length),p.init(U),v.push(p),et.multiplyMatrices(U.projectionMatrix,U.matrixWorldInverse),se.setFromProjectionMatrix(et,Qe,U.reversedDepth),Y=this.localClippingEnabled,Qt=lt.init(this.clippingPlanes,Y),g=X.get(E,y.length),g.init(),y.push(g),ot.enabled===!0&&ot.isPresenting===!0){const at=x.xr.getDepthSensingMesh();at!==null&&zo(at,U,-1/0,x.sortObjects)}zo(E,U,0,x.sortObjects),g.finish(),x.sortObjects===!0&&g.sort(ut,_t),Zt=ot.enabled===!1||ot.isPresenting===!1||ot.hasDepthSensing()===!1,Zt&&wt.addToRenderList(g,E),this.info.render.frame++,Qt===!0&<.beginShadows();const B=p.state.shadowsArray;At.render(B,E,U),Qt===!0&<.endShadows(),this.info.autoReset===!0&&this.info.reset();const k=g.opaque,N=g.transmissive;if(p.setupLights(),U.isArrayCamera){const at=U.cameras;if(N.length>0)for(let mt=0,Et=at.length;mt<Et;mt++){const vt=at[mt];Nc(k,N,E,vt)}Zt&&wt.render(E);for(let mt=0,Et=at.length;mt<Et;mt++){const vt=at[mt];Uc(g,E,vt,vt.viewport)}}else N.length>0&&Nc(k,N,E,U),Zt&&wt.render(E),Uc(g,E,U);I!==null&&R===0&&(ht.updateMultisampleRenderTarget(I),ht.updateRenderTargetMipmap(I)),E.isScene===!0&&E.onAfterRender(x,E,U),pt.resetDefaultState(),b=-1,S=null,v.pop(),v.length>0?(p=v[v.length-1],Qt===!0&<.setGlobalState(x.clippingPlanes,p.state.camera)):p=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function zo(E,U,B,k){if(E.visible===!1)return;if(E.layers.test(U.layers)){if(E.isGroup)B=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(U);else if(E.isLight)p.pushLight(E),E.castShadow&&p.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||se.intersectsSprite(E)){k&&Pt.setFromMatrixPosition(E.matrixWorld).applyMatrix4(et);const mt=O.update(E),Et=E.material;Et.visible&&g.push(E,mt,Et,B,Pt.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||se.intersectsObject(E))){const mt=O.update(E),Et=E.material;if(k&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),Pt.copy(E.boundingSphere.center)):(mt.boundingSphere===null&&mt.computeBoundingSphere(),Pt.copy(mt.boundingSphere.center)),Pt.applyMatrix4(E.matrixWorld).applyMatrix4(et)),Array.isArray(Et)){const vt=mt.groups;for(let Ut=0,Bt=vt.length;Ut<Bt;Ut++){const Lt=vt[Ut],Jt=Et[Lt.materialIndex];Jt&&Jt.visible&&g.push(E,mt,Jt,B,Pt.z,Lt)}}else Et.visible&&g.push(E,mt,Et,B,Pt.z,null)}}const at=E.children;for(let mt=0,Et=at.length;mt<Et;mt++)zo(at[mt],U,B,k)}function Uc(E,U,B,k){const N=E.opaque,at=E.transmissive,mt=E.transparent;p.setupLightsView(B),Qt===!0&<.setGlobalState(x.clippingPlanes,B),k&&Z.viewport(L.copy(k)),N.length>0&&yr(N,U,B),at.length>0&&yr(at,U,B),mt.length>0&&yr(mt,U,B),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function Nc(E,U,B,k){if((B.isScene===!0?B.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[k.id]===void 0&&(p.state.transmissionRenderTarget[k.id]=new bn(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?vs:dn,minFilter:yn,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Kt.workingColorSpace}));const at=p.state.transmissionRenderTarget[k.id],mt=k.viewport||L;at.setSize(mt.z*x.transmissionResolutionScale,mt.w*x.transmissionResolutionScale);const Et=x.getRenderTarget(),vt=x.getActiveCubeFace(),Ut=x.getActiveMipmapLevel();x.setRenderTarget(at),x.getClearColor(G),q=x.getClearAlpha(),q<1&&x.setClearColor(16777215,.5),x.clear(),Zt&&wt.render(B);const Bt=x.toneMapping;x.toneMapping=Fn;const Lt=k.viewport;if(k.viewport!==void 0&&(k.viewport=void 0),p.setupLightsView(k),Qt===!0&<.setGlobalState(x.clippingPlanes,k),yr(E,B,k),ht.updateMultisampleRenderTarget(at),ht.updateRenderTargetMipmap(at),$.has("WEBGL_multisampled_render_to_texture")===!1){let Jt=!1;for(let ae=0,me=U.length;ae<me;ae++){const ue=U[ae],le=ue.object,Dt=ue.geometry,de=ue.material,ne=ue.group;if(de.side===vn&&le.layers.test(k.layers)){const Ze=de.side;de.side=Be,de.needsUpdate=!0,Fc(le,B,k,Dt,de,ne),de.side=Ze,de.needsUpdate=!0,Jt=!0}}Jt===!0&&(ht.updateMultisampleRenderTarget(at),ht.updateRenderTargetMipmap(at))}x.setRenderTarget(Et,vt,Ut),x.setClearColor(G,q),Lt!==void 0&&(k.viewport=Lt),x.toneMapping=Bt}function yr(E,U,B){const k=U.isScene===!0?U.overrideMaterial:null;for(let N=0,at=E.length;N<at;N++){const mt=E[N],Et=mt.object,vt=mt.geometry,Ut=mt.group;let Bt=mt.material;Bt.allowOverride===!0&&k!==null&&(Bt=k),Et.layers.test(B.layers)&&Fc(Et,U,B,vt,Bt,Ut)}}function Fc(E,U,B,k,N,at){E.onBeforeRender(x,U,B,k,N,at),E.modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),N.onBeforeRender(x,U,B,k,E,at),N.transparent===!0&&N.side===vn&&N.forceSinglePass===!1?(N.side=Be,N.needsUpdate=!0,x.renderBufferDirect(B,U,k,N,E,at),N.side=Bn,N.needsUpdate=!0,x.renderBufferDirect(B,U,k,N,E,at),N.side=vn):x.renderBufferDirect(B,U,k,N,E,at),E.onAfterRender(x,U,B,k,N,at)}function Mr(E,U,B){U.isScene!==!0&&(U=Tt);const k=it.get(E),N=p.state.lights,at=p.state.shadowsArray,mt=N.state.version,Et=V.getParameters(E,N.state,at,U,B),vt=V.getProgramCacheKey(Et);let Ut=k.programs;k.environment=E.isMeshStandardMaterial?U.environment:null,k.fog=U.fog,k.envMap=(E.isMeshStandardMaterial?zt:kt).get(E.envMap||k.environment),k.envMapRotation=k.environment!==null&&E.envMap===null?U.environmentRotation:E.envMapRotation,Ut===void 0&&(E.addEventListener("dispose",K),Ut=new Map,k.programs=Ut);let Bt=Ut.get(vt);if(Bt!==void 0){if(k.currentProgram===Bt&&k.lightsStateVersion===mt)return Bc(E,Et),Bt}else Et.uniforms=V.getUniforms(E),E.onBeforeCompile(Et,x),Bt=V.acquireProgram(Et,vt),Ut.set(vt,Bt),k.uniforms=Et.uniforms;const Lt=k.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(Lt.clippingPlanes=lt.uniform),Bc(E,Et),k.needsLights=yf(E),k.lightsStateVersion=mt,k.needsLights&&(Lt.ambientLightColor.value=N.state.ambient,Lt.lightProbe.value=N.state.probe,Lt.directionalLights.value=N.state.directional,Lt.directionalLightShadows.value=N.state.directionalShadow,Lt.spotLights.value=N.state.spot,Lt.spotLightShadows.value=N.state.spotShadow,Lt.rectAreaLights.value=N.state.rectArea,Lt.ltc_1.value=N.state.rectAreaLTC1,Lt.ltc_2.value=N.state.rectAreaLTC2,Lt.pointLights.value=N.state.point,Lt.pointLightShadows.value=N.state.pointShadow,Lt.hemisphereLights.value=N.state.hemi,Lt.directionalShadowMap.value=N.state.directionalShadowMap,Lt.directionalShadowMatrix.value=N.state.directionalShadowMatrix,Lt.spotShadowMap.value=N.state.spotShadowMap,Lt.spotLightMatrix.value=N.state.spotLightMatrix,Lt.spotLightMap.value=N.state.spotLightMap,Lt.pointShadowMap.value=N.state.pointShadowMap,Lt.pointShadowMatrix.value=N.state.pointShadowMatrix),k.currentProgram=Bt,k.uniformsList=null,Bt}function Oc(E){if(E.uniformsList===null){const U=E.currentProgram.getUniforms();E.uniformsList=ma.seqWithValue(U.seq,E.uniforms)}return E.uniformsList}function Bc(E,U){const B=it.get(E);B.outputColorSpace=U.outputColorSpace,B.batching=U.batching,B.batchingColor=U.batchingColor,B.instancing=U.instancing,B.instancingColor=U.instancingColor,B.instancingMorph=U.instancingMorph,B.skinning=U.skinning,B.morphTargets=U.morphTargets,B.morphNormals=U.morphNormals,B.morphColors=U.morphColors,B.morphTargetsCount=U.morphTargetsCount,B.numClippingPlanes=U.numClippingPlanes,B.numIntersection=U.numClipIntersection,B.vertexAlphas=U.vertexAlphas,B.vertexTangents=U.vertexTangents,B.toneMapping=U.toneMapping}function xf(E,U,B,k,N){U.isScene!==!0&&(U=Tt),ht.resetTextureUnits();const at=U.fog,mt=k.isMeshStandardMaterial?U.environment:null,Et=I===null?x.outputColorSpace:I.isXRRenderTarget===!0?I.texture.colorSpace:Ii,vt=(k.isMeshStandardMaterial?zt:kt).get(k.envMap||mt),Ut=k.vertexColors===!0&&!!B.attributes.color&&B.attributes.color.itemSize===4,Bt=!!B.attributes.tangent&&(!!k.normalMap||k.anisotropy>0),Lt=!!B.morphAttributes.position,Jt=!!B.morphAttributes.normal,ae=!!B.morphAttributes.color;let me=Fn;k.toneMapped&&(I===null||I.isXRRenderTarget===!0)&&(me=x.toneMapping);const ue=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,le=ue!==void 0?ue.length:0,Dt=it.get(k),de=p.state.lights;if(Qt===!0&&(Y===!0||E!==S)){const De=E===S&&k.id===b;lt.setState(k,E,De)}let ne=!1;k.version===Dt.__version?(Dt.needsLights&&Dt.lightsStateVersion!==de.state.version||Dt.outputColorSpace!==Et||N.isBatchedMesh&&Dt.batching===!1||!N.isBatchedMesh&&Dt.batching===!0||N.isBatchedMesh&&Dt.batchingColor===!0&&N.colorTexture===null||N.isBatchedMesh&&Dt.batchingColor===!1&&N.colorTexture!==null||N.isInstancedMesh&&Dt.instancing===!1||!N.isInstancedMesh&&Dt.instancing===!0||N.isSkinnedMesh&&Dt.skinning===!1||!N.isSkinnedMesh&&Dt.skinning===!0||N.isInstancedMesh&&Dt.instancingColor===!0&&N.instanceColor===null||N.isInstancedMesh&&Dt.instancingColor===!1&&N.instanceColor!==null||N.isInstancedMesh&&Dt.instancingMorph===!0&&N.morphTexture===null||N.isInstancedMesh&&Dt.instancingMorph===!1&&N.morphTexture!==null||Dt.envMap!==vt||k.fog===!0&&Dt.fog!==at||Dt.numClippingPlanes!==void 0&&(Dt.numClippingPlanes!==lt.numPlanes||Dt.numIntersection!==lt.numIntersection)||Dt.vertexAlphas!==Ut||Dt.vertexTangents!==Bt||Dt.morphTargets!==Lt||Dt.morphNormals!==Jt||Dt.morphColors!==ae||Dt.toneMapping!==me||Dt.morphTargetsCount!==le)&&(ne=!0):(ne=!0,Dt.__version=k.version);let Ze=Dt.currentProgram;ne===!0&&(Ze=Mr(k,U,N));let Fi=!1,Je=!1,Es=!1;const fe=Ze.getUniforms(),en=Dt.uniforms;if(Z.useProgram(Ze.program)&&(Fi=!0,Je=!0,Es=!0),k.id!==b&&(b=k.id,Je=!0),Fi||S!==E){Z.buffers.depth.getReversed()&&E.reversedDepth!==!0&&(E._reversedDepth=!0,E.updateProjectionMatrix()),fe.setValue(P,"projectionMatrix",E.projectionMatrix),fe.setValue(P,"viewMatrix",E.matrixWorldInverse);const ke=fe.map.cameraPosition;ke!==void 0&&ke.setValue(P,yt.setFromMatrixPosition(E.matrixWorld)),J.logarithmicDepthBuffer&&fe.setValue(P,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(k.isMeshPhongMaterial||k.isMeshToonMaterial||k.isMeshLambertMaterial||k.isMeshBasicMaterial||k.isMeshStandardMaterial||k.isShaderMaterial)&&fe.setValue(P,"isOrthographic",E.isOrthographicCamera===!0),S!==E&&(S=E,Je=!0,Es=!0)}if(N.isSkinnedMesh){fe.setOptional(P,N,"bindMatrix"),fe.setOptional(P,N,"bindMatrixInverse");const De=N.skeleton;De&&(De.boneTexture===null&&De.computeBoneTexture(),fe.setValue(P,"boneTexture",De.boneTexture,ht))}N.isBatchedMesh&&(fe.setOptional(P,N,"batchingTexture"),fe.setValue(P,"batchingTexture",N._matricesTexture,ht),fe.setOptional(P,N,"batchingIdTexture"),fe.setValue(P,"batchingIdTexture",N._indirectTexture,ht),fe.setOptional(P,N,"batchingColorTexture"),N._colorsTexture!==null&&fe.setValue(P,"batchingColorTexture",N._colorsTexture,ht));const nn=B.morphAttributes;if((nn.position!==void 0||nn.normal!==void 0||nn.color!==void 0)&&st.update(N,B,Ze),(Je||Dt.receiveShadow!==N.receiveShadow)&&(Dt.receiveShadow=N.receiveShadow,fe.setValue(P,"receiveShadow",N.receiveShadow)),k.isMeshGouraudMaterial&&k.envMap!==null&&(en.envMap.value=vt,en.flipEnvMap.value=vt.isCubeTexture&&vt.isRenderTargetTexture===!1?-1:1),k.isMeshStandardMaterial&&k.envMap===null&&U.environment!==null&&(en.envMapIntensity.value=U.environmentIntensity),Je&&(fe.setValue(P,"toneMappingExposure",x.toneMappingExposure),Dt.needsLights&&vf(en,Es),at&&k.fog===!0&&j.refreshFogUniforms(en,at),j.refreshMaterialUniforms(en,k,H,nt,p.state.transmissionRenderTarget[E.id]),ma.upload(P,Oc(Dt),en,ht)),k.isShaderMaterial&&k.uniformsNeedUpdate===!0&&(ma.upload(P,Oc(Dt),en,ht),k.uniformsNeedUpdate=!1),k.isSpriteMaterial&&fe.setValue(P,"center",N.center),fe.setValue(P,"modelViewMatrix",N.modelViewMatrix),fe.setValue(P,"normalMatrix",N.normalMatrix),fe.setValue(P,"modelMatrix",N.matrixWorld),k.isShaderMaterial||k.isRawShaderMaterial){const De=k.uniformsGroups;for(let ke=0,ko=De.length;ke<ko;ke++){const ri=De[ke];qt.update(ri,Ze),qt.bind(ri,Ze)}}return Ze}function vf(E,U){E.ambientLightColor.needsUpdate=U,E.lightProbe.needsUpdate=U,E.directionalLights.needsUpdate=U,E.directionalLightShadows.needsUpdate=U,E.pointLights.needsUpdate=U,E.pointLightShadows.needsUpdate=U,E.spotLights.needsUpdate=U,E.spotLightShadows.needsUpdate=U,E.rectAreaLights.needsUpdate=U,E.hemisphereLights.needsUpdate=U}function yf(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return T},this.getActiveMipmapLevel=function(){return R},this.getRenderTarget=function(){return I},this.setRenderTargetTextures=function(E,U,B){const k=it.get(E);k.__autoAllocateDepthBuffer=E.resolveDepthBuffer===!1,k.__autoAllocateDepthBuffer===!1&&(k.__useRenderToTexture=!1),it.get(E.texture).__webglTexture=U,it.get(E.depthTexture).__webglTexture=k.__autoAllocateDepthBuffer?void 0:B,k.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(E,U){const B=it.get(E);B.__webglFramebuffer=U,B.__useDefaultFramebuffer=U===void 0};const Mf=P.createFramebuffer();this.setRenderTarget=function(E,U=0,B=0){I=E,T=U,R=B;let k=!0,N=null,at=!1,mt=!1;if(E){const vt=it.get(E);if(vt.__useDefaultFramebuffer!==void 0)Z.bindFramebuffer(P.FRAMEBUFFER,null),k=!1;else if(vt.__webglFramebuffer===void 0)ht.setupRenderTarget(E);else if(vt.__hasExternalTextures)ht.rebindTextures(E,it.get(E.texture).__webglTexture,it.get(E.depthTexture).__webglTexture);else if(E.depthBuffer){const Lt=E.depthTexture;if(vt.__boundDepthTexture!==Lt){if(Lt!==null&&it.has(Lt)&&(E.width!==Lt.image.width||E.height!==Lt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ht.setupDepthRenderbuffer(E)}}const Ut=E.texture;(Ut.isData3DTexture||Ut.isDataArrayTexture||Ut.isCompressedArrayTexture)&&(mt=!0);const Bt=it.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(Bt[U])?N=Bt[U][B]:N=Bt[U],at=!0):E.samples>0&&ht.useMultisampledRTT(E)===!1?N=it.get(E).__webglMultisampledFramebuffer:Array.isArray(Bt)?N=Bt[B]:N=Bt,L.copy(E.viewport),F.copy(E.scissor),z=E.scissorTest}else L.copy(St).multiplyScalar(H).floor(),F.copy(Gt).multiplyScalar(H).floor(),z=$t;if(B!==0&&(N=Mf),Z.bindFramebuffer(P.FRAMEBUFFER,N)&&k&&Z.drawBuffers(E,N),Z.viewport(L),Z.scissor(F),Z.setScissorTest(z),at){const vt=it.get(E.texture);P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_CUBE_MAP_POSITIVE_X+U,vt.__webglTexture,B)}else if(mt){const vt=U;for(let Ut=0;Ut<E.textures.length;Ut++){const Bt=it.get(E.textures[Ut]);P.framebufferTextureLayer(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0+Ut,Bt.__webglTexture,B,vt)}}else if(E!==null&&B!==0){const vt=it.get(E.texture);P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,vt.__webglTexture,B)}b=-1},this.readRenderTargetPixels=function(E,U,B,k,N,at,mt,Et=0){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let vt=it.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&mt!==void 0&&(vt=vt[mt]),vt){Z.bindFramebuffer(P.FRAMEBUFFER,vt);try{const Ut=E.textures[Et],Bt=Ut.format,Lt=Ut.type;if(!J.textureFormatReadable(Bt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!J.textureTypeReadable(Lt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}U>=0&&U<=E.width-k&&B>=0&&B<=E.height-N&&(E.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+Et),P.readPixels(U,B,k,N,It.convert(Bt),It.convert(Lt),at))}finally{const Ut=I!==null?it.get(I).__webglFramebuffer:null;Z.bindFramebuffer(P.FRAMEBUFFER,Ut)}}},this.readRenderTargetPixelsAsync=async function(E,U,B,k,N,at,mt,Et=0){if(!(E&&E.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let vt=it.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&mt!==void 0&&(vt=vt[mt]),vt)if(U>=0&&U<=E.width-k&&B>=0&&B<=E.height-N){Z.bindFramebuffer(P.FRAMEBUFFER,vt);const Ut=E.textures[Et],Bt=Ut.format,Lt=Ut.type;if(!J.textureFormatReadable(Bt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!J.textureTypeReadable(Lt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Jt=P.createBuffer();P.bindBuffer(P.PIXEL_PACK_BUFFER,Jt),P.bufferData(P.PIXEL_PACK_BUFFER,at.byteLength,P.STREAM_READ),E.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+Et),P.readPixels(U,B,k,N,It.convert(Bt),It.convert(Lt),0);const ae=I!==null?it.get(I).__webglFramebuffer:null;Z.bindFramebuffer(P.FRAMEBUFFER,ae);const me=P.fenceSync(P.SYNC_GPU_COMMANDS_COMPLETE,0);return P.flush(),await Cp(P,me,4),P.bindBuffer(P.PIXEL_PACK_BUFFER,Jt),P.getBufferSubData(P.PIXEL_PACK_BUFFER,0,at),P.deleteBuffer(Jt),P.deleteSync(me),at}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(E,U=null,B=0){const k=Math.pow(2,-B),N=Math.floor(E.image.width*k),at=Math.floor(E.image.height*k),mt=U!==null?U.x:0,Et=U!==null?U.y:0;ht.setTexture2D(E,0),P.copyTexSubImage2D(P.TEXTURE_2D,B,0,0,mt,Et,N,at),Z.unbindTexture()};const Sf=P.createFramebuffer(),bf=P.createFramebuffer();this.copyTextureToTexture=function(E,U,B=null,k=null,N=0,at=null){at===null&&(N!==0?(ir("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),at=N,N=0):at=0);let mt,Et,vt,Ut,Bt,Lt,Jt,ae,me;const ue=E.isCompressedTexture?E.mipmaps[at]:E.image;if(B!==null)mt=B.max.x-B.min.x,Et=B.max.y-B.min.y,vt=B.isBox3?B.max.z-B.min.z:1,Ut=B.min.x,Bt=B.min.y,Lt=B.isBox3?B.min.z:0;else{const nn=Math.pow(2,-N);mt=Math.floor(ue.width*nn),Et=Math.floor(ue.height*nn),E.isDataArrayTexture?vt=ue.depth:E.isData3DTexture?vt=Math.floor(ue.depth*nn):vt=1,Ut=0,Bt=0,Lt=0}k!==null?(Jt=k.x,ae=k.y,me=k.z):(Jt=0,ae=0,me=0);const le=It.convert(U.format),Dt=It.convert(U.type);let de;U.isData3DTexture?(ht.setTexture3D(U,0),de=P.TEXTURE_3D):U.isDataArrayTexture||U.isCompressedArrayTexture?(ht.setTexture2DArray(U,0),de=P.TEXTURE_2D_ARRAY):(ht.setTexture2D(U,0),de=P.TEXTURE_2D),P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,U.flipY),P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),P.pixelStorei(P.UNPACK_ALIGNMENT,U.unpackAlignment);const ne=P.getParameter(P.UNPACK_ROW_LENGTH),Ze=P.getParameter(P.UNPACK_IMAGE_HEIGHT),Fi=P.getParameter(P.UNPACK_SKIP_PIXELS),Je=P.getParameter(P.UNPACK_SKIP_ROWS),Es=P.getParameter(P.UNPACK_SKIP_IMAGES);P.pixelStorei(P.UNPACK_ROW_LENGTH,ue.width),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,ue.height),P.pixelStorei(P.UNPACK_SKIP_PIXELS,Ut),P.pixelStorei(P.UNPACK_SKIP_ROWS,Bt),P.pixelStorei(P.UNPACK_SKIP_IMAGES,Lt);const fe=E.isDataArrayTexture||E.isData3DTexture,en=U.isDataArrayTexture||U.isData3DTexture;if(E.isDepthTexture){const nn=it.get(E),De=it.get(U),ke=it.get(nn.__renderTarget),ko=it.get(De.__renderTarget);Z.bindFramebuffer(P.READ_FRAMEBUFFER,ke.__webglFramebuffer),Z.bindFramebuffer(P.DRAW_FRAMEBUFFER,ko.__webglFramebuffer);for(let ri=0;ri<vt;ri++)fe&&(P.framebufferTextureLayer(P.READ_FRAMEBUFFER,P.COLOR_ATTACHMENT0,it.get(E).__webglTexture,N,Lt+ri),P.framebufferTextureLayer(P.DRAW_FRAMEBUFFER,P.COLOR_ATTACHMENT0,it.get(U).__webglTexture,at,me+ri)),P.blitFramebuffer(Ut,Bt,mt,Et,Jt,ae,mt,Et,P.DEPTH_BUFFER_BIT,P.NEAREST);Z.bindFramebuffer(P.READ_FRAMEBUFFER,null),Z.bindFramebuffer(P.DRAW_FRAMEBUFFER,null)}else if(N!==0||E.isRenderTargetTexture||it.has(E)){const nn=it.get(E),De=it.get(U);Z.bindFramebuffer(P.READ_FRAMEBUFFER,Sf),Z.bindFramebuffer(P.DRAW_FRAMEBUFFER,bf);for(let ke=0;ke<vt;ke++)fe?P.framebufferTextureLayer(P.READ_FRAMEBUFFER,P.COLOR_ATTACHMENT0,nn.__webglTexture,N,Lt+ke):P.framebufferTexture2D(P.READ_FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,nn.__webglTexture,N),en?P.framebufferTextureLayer(P.DRAW_FRAMEBUFFER,P.COLOR_ATTACHMENT0,De.__webglTexture,at,me+ke):P.framebufferTexture2D(P.DRAW_FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,De.__webglTexture,at),N!==0?P.blitFramebuffer(Ut,Bt,mt,Et,Jt,ae,mt,Et,P.COLOR_BUFFER_BIT,P.NEAREST):en?P.copyTexSubImage3D(de,at,Jt,ae,me+ke,Ut,Bt,mt,Et):P.copyTexSubImage2D(de,at,Jt,ae,Ut,Bt,mt,Et);Z.bindFramebuffer(P.READ_FRAMEBUFFER,null),Z.bindFramebuffer(P.DRAW_FRAMEBUFFER,null)}else en?E.isDataTexture||E.isData3DTexture?P.texSubImage3D(de,at,Jt,ae,me,mt,Et,vt,le,Dt,ue.data):U.isCompressedArrayTexture?P.compressedTexSubImage3D(de,at,Jt,ae,me,mt,Et,vt,le,ue.data):P.texSubImage3D(de,at,Jt,ae,me,mt,Et,vt,le,Dt,ue):E.isDataTexture?P.texSubImage2D(P.TEXTURE_2D,at,Jt,ae,mt,Et,le,Dt,ue.data):E.isCompressedTexture?P.compressedTexSubImage2D(P.TEXTURE_2D,at,Jt,ae,ue.width,ue.height,le,ue.data):P.texSubImage2D(P.TEXTURE_2D,at,Jt,ae,mt,Et,le,Dt,ue);P.pixelStorei(P.UNPACK_ROW_LENGTH,ne),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,Ze),P.pixelStorei(P.UNPACK_SKIP_PIXELS,Fi),P.pixelStorei(P.UNPACK_SKIP_ROWS,Je),P.pixelStorei(P.UNPACK_SKIP_IMAGES,Es),at===0&&U.generateMipmaps&&P.generateMipmap(de),Z.unbindTexture()},this.initRenderTarget=function(E){it.get(E).__webglFramebuffer===void 0&&ht.setupRenderTarget(E)},this.initTexture=function(E){E.isCubeTexture?ht.setTextureCube(E,0):E.isData3DTexture?ht.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?ht.setTexture2DArray(E,0):ht.setTexture2D(E,0),Z.unbindTexture()},this.resetState=function(){T=0,R=0,I=null,Z.reset(),pt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Qe}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=Kt._getDrawingBufferColorSpace(t),e.unpackColorSpace=Kt._getUnpackColorSpace()}}const Zy=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Vu,AddEquation:$n,AddOperation:Ou,AdditiveAnimationBlendMode:nc,AdditiveBlending:Ll,AgXToneMapping:Gu,AlphaFormat:jl,AlwaysCompare:sd,AlwaysDepth:va,AlwaysStencilFunc:Fl,AmbientLight:jd,AnimationAction:hf,AnimationClip:cr,AnimationLoader:eg,AnimationMixer:Ig,AnimationObjectGroup:Cg,AnimationUtils:Km,ArcCurve:Ed,ArrayCamera:af,ArrowHelper:i_,AttachedBindMode:Nl,Audio:lf,AudioAnalyser:xg,AudioContext:wc,AudioListener:mg,AudioLoader:dg,AxesHelper:s_,BackSide:Be,BasicDepthPacking:Ju,BasicShadowMap:wf,BatchedMesh:vd,Bone:cc,BooleanKeyframeTrack:Ui,Box2:Vg,Box3:Pe,Box3Helper:e_,BoxGeometry:Di,BoxHelper:t_,BufferAttribute:oe,BufferGeometry:Xt,BufferGeometryLoader:rf,ByteType:Jl,Cache:Mn,Camera:go,CameraHelper:jg,CanvasTexture:ym,CapsuleGeometry:bo,CatmullRomCurve3:Td,CineonToneMapping:ku,CircleGeometry:Eo,ClampToEdgeWrapping:rn,Clock:of,Color:xt,ColorKeyframeTrack:Ec,ColorManagement:Kt,CompressedArrayTexture:xm,CompressedCubeTexture:vm,CompressedTexture:So,CompressedTextureLoader:ng,ConeGeometry:mr,ConstantAlphaFactor:Uu,ConstantColorFactor:Lu,Controls:a_,CubeCamera:ud,CubeReflectionMapping:zn,CubeRefractionMapping:Qn,CubeTexture:fr,CubeTextureLoader:ig,CubeUVReflectionMapping:xs,CubicBezierCurve:pc,CubicBezierCurve3:Ad,CubicInterpolant:Xd,CullFaceBack:Pl,CullFaceFront:gu,CullFaceFrontBack:Af,CullFaceNone:mu,Curve:pn,CurvePath:Cd,CustomBlending:xu,CustomToneMapping:Hu,CylinderGeometry:pr,Cylindrical:kg,Data3DTexture:po,DataArrayTexture:fo,DataTexture:Sn,DataTextureLoader:sg,DataUtils:Gp,DecrementStencilOp:Vf,DecrementWrapStencilOp:Gf,DefaultLoadingManager:Zd,DepthFormat:us,DepthStencilFormat:ds,DepthTexture:uc,DetachedBindMode:Xu,DirectionalLight:Qd,DirectionalLightHelper:Qg,DiscreteInterpolant:qd,DodecahedronGeometry:To,DoubleSide:vn,DstAlphaFactor:wu,DstColorFactor:Ru,DynamicCopyUsage:sp,DynamicDrawUsage:Qf,DynamicReadUsage:ep,EdgesGeometry:bd,EllipseCurve:Ao,EqualCompare:td,EqualDepth:Ma,EqualStencilFunc:Yf,EquirectangularReflectionMapping:Zs,EquirectangularRefractionMapping:Js,Euler:tn,EventDispatcher:En,ExternalTexture:dc,ExtrudeGeometry:wo,FileLoader:Vn,Float16BufferAttribute:$p,Float32BufferAttribute:Mt,FloatType:Xe,Fog:xo,FogExp2:_o,FramebufferTexture:_m,FrontSide:Bn,Frustum:Ms,FrustumArray:Mo,GLBufferAttribute:Ng,GLSL1:ap,GLSL3:Ol,GreaterCompare:ed,GreaterDepth:ba,GreaterEqualCompare:id,GreaterEqualDepth:Sa,GreaterEqualStencilFunc:Kf,GreaterStencilFunc:Jf,GridHelper:$g,Group:as,HalfFloatType:vs,HemisphereLight:Jd,HemisphereLightHelper:Jg,IcosahedronGeometry:Co,ImageBitmapLoader:ug,ImageLoader:hr,ImageUtils:od,IncrementStencilOp:kf,IncrementWrapStencilOp:Hf,InstancedBufferAttribute:gs,InstancedBufferGeometry:sf,InstancedInterleavedBuffer:Ug,InstancedMesh:xd,Int16BufferAttribute:Zp,Int32BufferAttribute:Jp,Int8BufferAttribute:Xp,IntType:ro,InterleavedBuffer:vo,InterleavedBufferAttribute:Pi,Interpolant:xr,InterpolateDiscrete:Qs,InterpolateLinear:ja,InterpolateSmooth:fa,InterpolationSamplingMode:cp,InterpolationSamplingType:lp,InvertStencilOp:Wf,KeepStencilOp:yi,KeyframeTrack:an,LOD:gd,LatheGeometry:Ro,Layers:mo,LessCompare:ju,LessDepth:ya,LessEqualCompare:ic,LessEqualDepth:Ri,LessEqualStencilFunc:Zf,LessStencilFunc:qf,Light:ii,LightProbe:nf,Line:jn,Line3:Wg,LineBasicMaterial:ze,LineCurve:mc,LineCurve3:wd,LineDashedMaterial:Hd,LineLoop:yd,LineSegments:Tn,LinearFilter:Me,LinearInterpolant:bc,LinearMipMapLinearFilter:Pf,LinearMipMapNearestFilter:If,LinearMipmapLinearFilter:yn,LinearMipmapNearestFilter:ks,LinearSRGBColorSpace:Ii,LinearToneMapping:Bu,LinearTransfer:tr,Loader:Ye,LoaderUtils:Hl,LoadingManager:Tc,LoopOnce:qu,LoopPingPong:Zu,LoopRepeat:Yu,MOUSE:Ef,Material:Le,MaterialLoader:Oo,MathUtils:Ap,Matrix2:Pc,Matrix3:Ht,Matrix4:Ot,MaxEquation:Su,Mesh:ye,MeshBasicMaterial:ei,MeshDepthMaterial:yc,MeshDistanceMaterial:Mc,MeshLambertMaterial:kd,MeshMatcapMaterial:Vd,MeshNormalMaterial:zd,MeshPhongMaterial:Od,MeshPhysicalMaterial:Fd,MeshStandardMaterial:vc,MeshToonMaterial:Bd,MinEquation:Mu,MirroredRepeatWrapping:Ks,MixOperation:Fu,MultiplyBlending:Ul,MultiplyOperation:ur,NearestFilter:Ae,NearestMipMapLinearFilter:Rf,NearestMipMapNearestFilter:Cf,NearestMipmapLinearFilter:ss,NearestMipmapNearestFilter:Zl,NeutralToneMapping:Wu,NeverCompare:Qu,NeverDepth:xa,NeverStencilFunc:Xf,NoBlending:Nn,NoColorSpace:Dn,NoToneMapping:Fn,NormalAnimationBlendMode:uo,NormalBlending:Ai,NotEqualCompare:nd,NotEqualDepth:Ea,NotEqualStencilFunc:$f,NumberKeyframeTrack:or,Object3D:ee,ObjectLoader:cg,ObjectSpaceNormalMap:Ku,OctahedronGeometry:gr,OneFactor:Eu,OneMinusConstantAlphaFactor:Nu,OneMinusConstantColorFactor:Du,OneMinusDstAlphaFactor:Cu,OneMinusDstColorFactor:Iu,OneMinusSrcAlphaFactor:_a,OneMinusSrcColorFactor:Au,OrthographicCamera:Fo,PCFShadowMap:Yl,PCFSoftShadowMap:_u,PMREMGenerator:Xl,Path:io,PerspectiveCamera:Te,Plane:Jn,PlaneGeometry:Ss,PlaneHelper:n_,PointLight:Kd,PointLightHelper:Yg,Points:Md,PointsMaterial:hc,PolarGridHelper:Kg,PolyhedronGeometry:ni,PositionalAudio:_g,PropertyBinding:jt,PropertyMixer:cf,QuadraticBezierCurve:gc,QuadraticBezierCurve3:_c,Quaternion:qe,QuaternionKeyframeTrack:vr,QuaternionLinearInterpolant:Yd,RED_GREEN_RGTC2_Format:Ka,RED_RGTC1_Format:Ja,REVISION:"180",RGBADepthPacking:$u,RGBAFormat:Oe,RGBAIntegerFormat:ho,RGBA_ASTC_10x10_Format:Ga,RGBA_ASTC_10x5_Format:ka,RGBA_ASTC_10x6_Format:Va,RGBA_ASTC_10x8_Format:Ha,RGBA_ASTC_12x10_Format:Wa,RGBA_ASTC_12x12_Format:Xa,RGBA_ASTC_4x4_Format:La,RGBA_ASTC_5x4_Format:Da,RGBA_ASTC_5x5_Format:Ua,RGBA_ASTC_6x5_Format:Na,RGBA_ASTC_6x6_Format:Fa,RGBA_ASTC_8x5_Format:Oa,RGBA_ASTC_8x6_Format:Ba,RGBA_ASTC_8x8_Format:za,RGBA_BPTC_Format:qa,RGBA_ETC2_EAC_Format:Pa,RGBA_PVRTC_2BPPV1_Format:Ca,RGBA_PVRTC_4BPPV1_Format:wa,RGBA_S3TC_DXT1_Format:Hs,RGBA_S3TC_DXT3_Format:Gs,RGBA_S3TC_DXT5_Format:Ws,RGBDepthPacking:Ff,RGBFormat:tc,RGBIntegerFormat:Lf,RGB_BPTC_SIGNED_Format:Ya,RGB_BPTC_UNSIGNED_Format:Za,RGB_ETC1_Format:Ra,RGB_ETC2_Format:Ia,RGB_PVRTC_2BPPV1_Format:Aa,RGB_PVRTC_4BPPV1_Format:Ta,RGB_S3TC_DXT1_Format:Vs,RGDepthPacking:Of,RGFormat:ec,RGIntegerFormat:co,RawShaderMaterial:Nd,Ray:ys,Raycaster:Fg,RectAreaLight:tf,RedFormat:lo,RedIntegerFormat:dr,ReinhardToneMapping:zu,RenderTarget:rc,RenderTarget3D:Pg,RepeatWrapping:$s,ReplaceStencilOp:zf,ReverseSubtractEquation:yu,RingGeometry:Io,SIGNED_RED_GREEN_RGTC2_Format:Qa,SIGNED_RED_RGTC1_Format:$a,SRGBColorSpace:Ge,SRGBTransfer:re,Scene:fd,ShaderChunk:Yt,ShaderLib:hn,ShaderMaterial:fn,ShadowMaterial:Ud,Shape:Ci,ShapeGeometry:Po,ShapePath:r_,ShapeUtils:un,ShortType:$l,Skeleton:yo,SkeletonHelper:qg,SkinnedMesh:_d,Source:Kn,Sphere:we,SphereGeometry:_r,Spherical:zg,SphericalHarmonics3:ef,SplineCurve:xc,SpotLight:$d,SpotLightHelper:Xg,Sprite:md,SpriteMaterial:lc,SrcAlphaFactor:ga,SrcAlphaSaturateFactor:Pu,SrcColorFactor:Tu,StaticCopyUsage:ip,StaticDrawUsage:er,StaticReadUsage:tp,StereoCamera:fg,StreamCopyUsage:rp,StreamDrawUsage:jf,StreamReadUsage:np,StringKeyframeTrack:Ni,SubtractEquation:vu,SubtractiveBlending:Dl,TOUCH:Tf,TangentSpaceNormalMap:ti,TetrahedronGeometry:Lo,Texture:_e,TextureLoader:rg,TextureUtils:u_,Timer:Og,TimestampQuery:op,TorusGeometry:Do,TorusKnotGeometry:Uo,Triangle:We,TriangleFanDrawMode:Nf,TriangleStripDrawMode:Uf,TrianglesDrawMode:Df,TubeGeometry:No,UVMapping:so,Uint16BufferAttribute:ac,Uint32BufferAttribute:oc,Uint8BufferAttribute:qp,Uint8ClampedBufferAttribute:Yp,Uniform:Ic,UniformsGroup:Dg,UniformsLib:ft,UniformsUtils:hd,UnsignedByteType:dn,UnsignedInt101111Type:Ql,UnsignedInt248Type:hs,UnsignedInt5999Type:Kl,UnsignedIntType:kn,UnsignedShort4444Type:ao,UnsignedShort5551Type:oo,UnsignedShortType:cs,VSMShadowMap:xn,Vector2:Q,Vector3:C,Vector4:te,VectorKeyframeTrack:lr,VideoFrameTexture:gm,VideoTexture:Sd,WebGL3DRenderTarget:Dp,WebGLArrayRenderTarget:Lp,WebGLCoordinateSystem:Qe,WebGLCubeRenderTarget:dd,WebGLRenderTarget:bn,WebGLRenderer:qy,WebGLUtils:_f,WebGPUCoordinateSystem:fs,WebXRController:pa,WireframeGeometry:Dd,WrapAroundEnding:js,ZeroCurvatureEnding:bi,ZeroFactor:bu,ZeroSlopeEnding:Ei,ZeroStencilOp:Bf,createCanvasElement:ad},Symbol.toStringTag,{value:"Module"}));export{po as $,Vu as A,Pe as B,a_ as C,$u as D,Zs as E,Xe as F,ya as G,yc as H,Ii as I,Dn as J,uc as K,Me as L,Ef as M,Nn as N,ds as O,Jn as P,qe as Q,ys as R,zg as S,Tf as T,Ic as U,C as V,qy as W,hs as X,kn as Y,Oe as Z,vs as _,Q as a,Qd as a$,Ye as a0,Tc as a1,Vn as a2,rn as a3,Sn as a4,lo as a5,zd as a6,Be as a7,vn as a8,Bn as a9,tn as aA,Pc as aB,Fg as aC,ee as aD,cs as aE,Yt as aF,gs as aG,Qf as aH,Nd as aI,as as aJ,Mt as aK,ze as aL,hc as aM,Od as aN,Tn as aO,Md as aP,Hl as aQ,Kt as aR,Zd as aS,rg as aT,yo as aU,cc as aV,lr as aW,vr as aX,cr as aY,Ll as aZ,Jd as a_,Fo as aa,_e as ab,Ma as ac,Ea as ad,yn as ae,ba as af,Sa as ag,Ri as ah,xa as ai,Le as aj,Xt as ak,oe as al,ec as am,Ol as an,of as ao,Ht as ap,ho as aq,dd as ar,Pf as as,ud as at,go as au,Xl as av,sf as aw,Lp as ax,co as ay,fo as az,Ap as b,Io as b$,$g as b0,qg as b1,Ig as b2,Di as b3,sg as b4,kd as b5,jd as b6,$d as b7,Kd as b8,_d as b9,wf as bA,mo as bB,tf as bC,Fd as bD,Ks as bE,Ms as bF,Ku as bG,ti as bH,Yu as bI,Vd as bJ,pr as bK,gr as bL,Do as bM,cg as bN,yd as bO,gd as bP,vd as bQ,xd as bR,nf as bS,xo as bT,_o as bU,qu as bV,We as bW,Lo as bX,bd as bY,Hd as bZ,Bu as b_,jn as ba,so as bb,Gp as bc,ft as bd,jg as be,md as bf,lc as bg,e_ as bh,hn as bi,hd as bj,Ug as bk,Pi as bl,Dd as bm,we as bn,Wg as bo,Hu as bp,Gu as bq,Fn as br,pn as bs,ac as bt,un as bu,or as bv,_u as bw,Wu as bx,xn as by,Yl as bz,jt as c,Qg as c0,Yg as c1,Xg as c2,Jg as c3,mr as c4,t_ as c5,Df as c6,Nf as c7,Uf as c8,ug as c9,Kl as cA,Ta as cB,Ra as cC,Ws as cD,Za as cE,re as cF,zu as cG,ku as cH,Td as cI,vo as ca,ss as cb,ks as cc,Zl as cd,Qs as ce,ja as cf,xr as cg,vm as ch,xm as ci,So as cj,Ca as ck,wa as cl,qa as cm,Ka as cn,Qa as co,Ja as cp,$a as cq,Gs as cr,Vs as cs,Hs as ct,Fa as cu,La as cv,Ia as cw,Pa as cx,tc as cy,Ql as cz,Ot as d,Ge as e,fd as f,Te as g,xt as h,Ss as i,ei as j,ye as k,vc as l,_r as m,Eo as n,te as o,ym as p,$s as q,fn as r,Zy as s,bn as t,Ae as u,En as v,dn as w,Ju as x,Yy as y,va as z};
|
|
3840
|
+
}`;class Vy{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){const n=new dc(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=n}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,n=new fn({vertexShader:zy,fragmentShader:ky,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new ye(new Ss(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Hy extends En{constructor(t,e){super();const n=this;let i=null,s=1,a=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,f=null,m=null;const _=typeof XRWebGLBinding<"u",g=new Vy,p={},y=e.getContextAttributes();let v=null,x=null;const A=[],T=[],R=new Q;let I=null;const b=new Te;b.viewport=new te;const S=new Te;S.viewport=new te;const L=[b,S],F=new af;let z=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let et=A[Y];return et===void 0&&(et=new pa,A[Y]=et),et.getTargetRaySpace()},this.getControllerGrip=function(Y){let et=A[Y];return et===void 0&&(et=new pa,A[Y]=et),et.getGripSpace()},this.getHand=function(Y){let et=A[Y];return et===void 0&&(et=new pa,A[Y]=et),et.getHandSpace()};function q(Y){const et=T.indexOf(Y.inputSource);if(et===-1)return;const yt=A[et];yt!==void 0&&(yt.update(Y.inputSource,Y.frame,c||a),yt.dispatchEvent({type:Y.type,data:Y.inputSource}))}function W(){i.removeEventListener("select",q),i.removeEventListener("selectstart",q),i.removeEventListener("selectend",q),i.removeEventListener("squeeze",q),i.removeEventListener("squeezestart",q),i.removeEventListener("squeezeend",q),i.removeEventListener("end",W),i.removeEventListener("inputsourceschange",nt);for(let Y=0;Y<A.length;Y++){const et=T[Y];et!==null&&(T[Y]=null,A[Y].disconnect(et))}z=null,G=null,g.reset();for(const Y in p)delete p[Y];t.setRenderTarget(v),f=null,d=null,u=null,i=null,x=null,Qt.stop(),n.isPresenting=!1,t.setPixelRatio(I),t.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){s=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){o=Y,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(Y){c=Y},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return u===null&&_&&(u=new XRWebGLBinding(i,e)),u},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(Y){if(i=Y,i!==null){if(v=t.getRenderTarget(),i.addEventListener("select",q),i.addEventListener("selectstart",q),i.addEventListener("selectend",q),i.addEventListener("squeeze",q),i.addEventListener("squeezestart",q),i.addEventListener("squeezeend",q),i.addEventListener("end",W),i.addEventListener("inputsourceschange",nt),y.xrCompatible!==!0&&await e.makeXRCompatible(),I=t.getPixelRatio(),t.getSize(R),_&&"createProjectionLayer"in XRWebGLBinding.prototype){let yt=null,Pt=null,Tt=null;y.depth&&(Tt=y.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,yt=y.stencil?ds:us,Pt=y.stencil?hs:kn);const Zt={colorFormat:e.RGBA8,depthFormat:Tt,scaleFactor:s};u=this.getBinding(),d=u.createProjectionLayer(Zt),i.updateRenderState({layers:[d]}),t.setPixelRatio(1),t.setSize(d.textureWidth,d.textureHeight,!1),x=new bn(d.textureWidth,d.textureHeight,{format:Oe,type:dn,depthTexture:new uc(d.textureWidth,d.textureHeight,Pt,void 0,void 0,void 0,void 0,void 0,void 0,yt),stencilBuffer:y.stencil,colorSpace:t.outputColorSpace,samples:y.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const yt={antialias:y.antialias,alpha:!0,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(i,e,yt),i.updateRenderState({baseLayer:f}),t.setPixelRatio(1),t.setSize(f.framebufferWidth,f.framebufferHeight,!1),x=new bn(f.framebufferWidth,f.framebufferHeight,{format:Oe,type:dn,colorSpace:t.outputColorSpace,stencilBuffer:y.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}x.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Qt.setContext(i),Qt.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function nt(Y){for(let et=0;et<Y.removed.length;et++){const yt=Y.removed[et],Pt=T.indexOf(yt);Pt>=0&&(T[Pt]=null,A[Pt].disconnect(yt))}for(let et=0;et<Y.added.length;et++){const yt=Y.added[et];let Pt=T.indexOf(yt);if(Pt===-1){for(let Zt=0;Zt<A.length;Zt++)if(Zt>=T.length){T.push(yt),Pt=Zt;break}else if(T[Zt]===null){T[Zt]=yt,Pt=Zt;break}if(Pt===-1)break}const Tt=A[Pt];Tt&&Tt.connect(yt)}}const H=new C,ut=new C;function _t(Y,et,yt){H.setFromMatrixPosition(et.matrixWorld),ut.setFromMatrixPosition(yt.matrixWorld);const Pt=H.distanceTo(ut),Tt=et.projectionMatrix.elements,Zt=yt.projectionMatrix.elements,ce=Tt[14]/(Tt[10]-1),P=Tt[14]/(Tt[10]+1),tt=(Tt[9]+1)/Tt[5],$=(Tt[9]-1)/Tt[5],J=(Tt[8]-1)/Tt[0],Z=(Zt[8]+1)/Zt[0],ct=ce*J,it=ce*Z,ht=Pt/(-J+Z),kt=ht*-J;if(et.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(kt),Y.translateZ(ht),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Tt[10]===-1)Y.projectionMatrix.copy(et.projectionMatrix),Y.projectionMatrixInverse.copy(et.projectionMatrixInverse);else{const zt=ce+ht,w=P+ht,M=ct-kt,O=it+(Pt-kt),V=tt*P/w*zt,j=$*P/w*zt;Y.projectionMatrix.makePerspective(M,O,V,j,zt,w),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function St(Y,et){et===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(et.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(i===null)return;let et=Y.near,yt=Y.far;g.texture!==null&&(g.depthNear>0&&(et=g.depthNear),g.depthFar>0&&(yt=g.depthFar)),F.near=S.near=b.near=et,F.far=S.far=b.far=yt,(z!==F.near||G!==F.far)&&(i.updateRenderState({depthNear:F.near,depthFar:F.far}),z=F.near,G=F.far),F.layers.mask=Y.layers.mask|6,b.layers.mask=F.layers.mask&3,S.layers.mask=F.layers.mask&5;const Pt=Y.parent,Tt=F.cameras;St(F,Pt);for(let Zt=0;Zt<Tt.length;Zt++)St(Tt[Zt],Pt);Tt.length===2?_t(F,b,S):F.projectionMatrix.copy(b.projectionMatrix),Gt(Y,F,Pt)};function Gt(Y,et,yt){yt===null?Y.matrix.copy(et.matrixWorld):(Y.matrix.copy(yt.matrixWorld),Y.matrix.invert(),Y.matrix.multiply(et.matrixWorld)),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.updateMatrixWorld(!0),Y.projectionMatrix.copy(et.projectionMatrix),Y.projectionMatrixInverse.copy(et.projectionMatrixInverse),Y.isPerspectiveCamera&&(Y.fov=ps*2*Math.atan(1/Y.projectionMatrix.elements[5]),Y.zoom=1)}this.getCamera=function(){return F},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(Y){l=Y,d!==null&&(d.fixedFoveation=Y),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=Y)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(F)},this.getCameraTexture=function(Y){return p[Y]};let $t=null;function se(Y,et){if(h=et.getViewerPose(c||a),m=et,h!==null){const yt=h.views;f!==null&&(t.setRenderTargetFramebuffer(x,f.framebuffer),t.setRenderTarget(x));let Pt=!1;yt.length!==F.cameras.length&&(F.cameras.length=0,Pt=!0);for(let P=0;P<yt.length;P++){const tt=yt[P];let $=null;if(f!==null)$=f.getViewport(tt);else{const Z=u.getViewSubImage(d,tt);$=Z.viewport,P===0&&(t.setRenderTargetTextures(x,Z.colorTexture,Z.depthStencilTexture),t.setRenderTarget(x))}let J=L[P];J===void 0&&(J=new Te,J.layers.enable(P),J.viewport=new te,L[P]=J),J.matrix.fromArray(tt.transform.matrix),J.matrix.decompose(J.position,J.quaternion,J.scale),J.projectionMatrix.fromArray(tt.projectionMatrix),J.projectionMatrixInverse.copy(J.projectionMatrix).invert(),J.viewport.set($.x,$.y,$.width,$.height),P===0&&(F.matrix.copy(J.matrix),F.matrix.decompose(F.position,F.quaternion,F.scale)),Pt===!0&&F.cameras.push(J)}const Tt=i.enabledFeatures;if(Tt&&Tt.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&_){u=n.getBinding();const P=u.getDepthInformation(yt[0]);P&&P.isValid&&P.texture&&g.init(P,i.renderState)}if(Tt&&Tt.includes("camera-access")&&_){t.state.unbindTexture(),u=n.getBinding();for(let P=0;P<yt.length;P++){const tt=yt[P].camera;if(tt){let $=p[tt];$||($=new dc,p[tt]=$);const J=u.getCameraImage(tt);$.sourceTexture=J}}}}for(let yt=0;yt<A.length;yt++){const Pt=T[yt],Tt=A[yt];Pt!==null&&Tt!==void 0&&Tt.update(Pt,et,c||a)}$t&&$t(Y,et),et.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:et}),m=null}const Qt=new df;Qt.setAnimationLoop(se),this.setAnimationLoop=function(Y){$t=Y},this.dispose=function(){}}}const vi=new tn,Gy=new Ot;function Wy(r,t){function e(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function n(g,p){p.color.getRGB(g.fogColor.value,cd(r)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,y,v,x){p.isMeshBasicMaterial||p.isMeshLambertMaterial?s(g,p):p.isMeshToonMaterial?(s(g,p),u(g,p)):p.isMeshPhongMaterial?(s(g,p),h(g,p)):p.isMeshStandardMaterial?(s(g,p),d(g,p),p.isMeshPhysicalMaterial&&f(g,p,x)):p.isMeshMatcapMaterial?(s(g,p),m(g,p)):p.isMeshDepthMaterial?s(g,p):p.isMeshDistanceMaterial?(s(g,p),_(g,p)):p.isMeshNormalMaterial?s(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,y,v):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function s(g,p){g.opacity.value=p.opacity,p.color&&g.diffuse.value.copy(p.color),p.emissive&&g.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(g.map.value=p.map,e(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,e(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===Be&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,e(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===Be&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,e(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,e(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,e(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);const y=t.get(p),v=y.envMap,x=y.envMapRotation;v&&(g.envMap.value=v,vi.copy(x),vi.x*=-1,vi.y*=-1,vi.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(vi.y*=-1,vi.z*=-1),g.envMapRotation.value.setFromMatrix4(Gy.makeRotationFromEuler(vi)),g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap&&(g.lightMap.value=p.lightMap,g.lightMapIntensity.value=p.lightMapIntensity,e(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,e(p.aoMap,g.aoMapTransform))}function a(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,e(p.map,g.mapTransform))}function o(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function l(g,p,y,v){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*y,g.scale.value=v*.5,p.map&&(g.map.value=p.map,e(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,e(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,e(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function d(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,e(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,e(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function f(g,p,y){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,e(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,e(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,e(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,e(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,e(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Be&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,e(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,e(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,e(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,e(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,e(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,e(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,e(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const y=t.get(p).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function Xy(r,t,e,n){let i={},s={},a=[];const o=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,v){const x=v.program;n.uniformBlockBinding(y,x)}function c(y,v){let x=i[y.id];x===void 0&&(m(y),x=h(y),i[y.id]=x,y.addEventListener("dispose",g));const A=v.program;n.updateUBOMapping(y,A);const T=t.render.frame;s[y.id]!==T&&(d(y),s[y.id]=T)}function h(y){const v=u();y.__bindingPointIndex=v;const x=r.createBuffer(),A=y.__size,T=y.usage;return r.bindBuffer(r.UNIFORM_BUFFER,x),r.bufferData(r.UNIFORM_BUFFER,A,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,x),x}function u(){for(let y=0;y<o;y++)if(a.indexOf(y)===-1)return a.push(y),y;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(y){const v=i[y.id],x=y.uniforms,A=y.__cache;r.bindBuffer(r.UNIFORM_BUFFER,v);for(let T=0,R=x.length;T<R;T++){const I=Array.isArray(x[T])?x[T]:[x[T]];for(let b=0,S=I.length;b<S;b++){const L=I[b];if(f(L,T,b,A)===!0){const F=L.__offset,z=Array.isArray(L.value)?L.value:[L.value];let G=0;for(let q=0;q<z.length;q++){const W=z[q],nt=_(W);typeof W=="number"||typeof W=="boolean"?(L.__data[0]=W,r.bufferSubData(r.UNIFORM_BUFFER,F+G,L.__data)):W.isMatrix3?(L.__data[0]=W.elements[0],L.__data[1]=W.elements[1],L.__data[2]=W.elements[2],L.__data[3]=0,L.__data[4]=W.elements[3],L.__data[5]=W.elements[4],L.__data[6]=W.elements[5],L.__data[7]=0,L.__data[8]=W.elements[6],L.__data[9]=W.elements[7],L.__data[10]=W.elements[8],L.__data[11]=0):(W.toArray(L.__data,G),G+=nt.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,F,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function f(y,v,x,A){const T=y.value,R=v+"_"+x;if(A[R]===void 0)return typeof T=="number"||typeof T=="boolean"?A[R]=T:A[R]=T.clone(),!0;{const I=A[R];if(typeof T=="number"||typeof T=="boolean"){if(I!==T)return A[R]=T,!0}else if(I.equals(T)===!1)return I.copy(T),!0}return!1}function m(y){const v=y.uniforms;let x=0;const A=16;for(let R=0,I=v.length;R<I;R++){const b=Array.isArray(v[R])?v[R]:[v[R]];for(let S=0,L=b.length;S<L;S++){const F=b[S],z=Array.isArray(F.value)?F.value:[F.value];for(let G=0,q=z.length;G<q;G++){const W=z[G],nt=_(W),H=x%A,ut=H%nt.boundary,_t=H+ut;x+=ut,_t!==0&&A-_t<nt.storage&&(x+=A-_t),F.__data=new Float32Array(nt.storage/Float32Array.BYTES_PER_ELEMENT),F.__offset=x,x+=nt.storage}}}const T=x%A;return T>0&&(x+=A-T),y.__size=x,y.__cache={},this}function _(y){const v={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(v.boundary=4,v.storage=4):y.isVector2?(v.boundary=8,v.storage=8):y.isVector3||y.isColor?(v.boundary=16,v.storage=12):y.isVector4?(v.boundary=16,v.storage=16):y.isMatrix3?(v.boundary=48,v.storage=48):y.isMatrix4?(v.boundary=64,v.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),v}function g(y){const v=y.target;v.removeEventListener("dispose",g);const x=a.indexOf(v.__bindingPointIndex);a.splice(x,1),r.deleteBuffer(i[v.id]),delete i[v.id],delete s[v.id]}function p(){for(const y in i)r.deleteBuffer(i[y]);a=[],i={},s={}}return{bind:l,update:c,dispose:p}}class qy{constructor(t={}){const{canvas:e=ad(),context:n=null,depth:i=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1}=t;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const y=[],v=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Fn,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const x=this;let A=!1;this._outputColorSpace=Ge;let T=0,R=0,I=null,b=-1,S=null;const L=new te,F=new te;let z=null;const G=new xt(0);let q=0,W=e.width,nt=e.height,H=1,ut=null,_t=null;const St=new te(0,0,W,nt),Gt=new te(0,0,W,nt);let $t=!1;const se=new Ms;let Qt=!1,Y=!1;const et=new Ot,yt=new C,Pt=new te,Tt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Zt=!1;function ce(){return I===null?H:1}let P=n;function tt(E,U){return e.getContext(E,U)}try{const E={alpha:!0,depth:i,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine","three.js r180"),e.addEventListener("webglcontextlost",dt,!1),e.addEventListener("webglcontextrestored",bt,!1),e.addEventListener("webglcontextcreationerror",rt,!1),P===null){const U="webgl2";if(P=tt(U,E),P===null)throw tt(U)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let $,J,Z,ct,it,ht,kt,zt,w,M,O,V,j,X,Rt,lt,At,wt,st,gt,Ft,It,pt,qt;function D(){$=new iv(P),$.init(),It=new _f(P,$),J=new $x(P,$,t,It),Z=new Oy(P,$),J.reversedDepthBuffer&&d&&Z.buffers.depth.setReversed(!0),ct=new av(P),it=new Ey,ht=new By(P,$,Z,it,J,It,ct),kt=new Qx(x),zt=new nv(x),w=new d_(P),pt=new Zx(P,w),M=new sv(P,w,ct,pt),O=new lv(P,M,w,ct),st=new ov(P,J,ht),lt=new Kx(it),V=new by(x,kt,zt,$,J,pt,lt),j=new Wy(x,it),X=new Ay,Rt=new Ly($),wt=new Yx(x,kt,zt,Z,O,f,l),At=new Ny(x,O,J),qt=new Xy(P,ct,J,Z),gt=new Jx(P,$,ct),Ft=new rv(P,$,ct),ct.programs=V.programs,x.capabilities=J,x.extensions=$,x.properties=it,x.renderLists=X,x.shadowMap=At,x.state=Z,x.info=ct}D();const ot=new Hy(x,P);this.xr=ot,this.getContext=function(){return P},this.getContextAttributes=function(){return P.getContextAttributes()},this.forceContextLoss=function(){const E=$.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){const E=$.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(E){E!==void 0&&(H=E,this.setSize(W,nt,!1))},this.getSize=function(E){return E.set(W,nt)},this.setSize=function(E,U,B=!0){if(ot.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}W=E,nt=U,e.width=Math.floor(E*H),e.height=Math.floor(U*H),B===!0&&(e.style.width=E+"px",e.style.height=U+"px"),this.setViewport(0,0,E,U)},this.getDrawingBufferSize=function(E){return E.set(W*H,nt*H).floor()},this.setDrawingBufferSize=function(E,U,B){W=E,nt=U,H=B,e.width=Math.floor(E*B),e.height=Math.floor(U*B),this.setViewport(0,0,E,U)},this.getCurrentViewport=function(E){return E.copy(L)},this.getViewport=function(E){return E.copy(St)},this.setViewport=function(E,U,B,k){E.isVector4?St.set(E.x,E.y,E.z,E.w):St.set(E,U,B,k),Z.viewport(L.copy(St).multiplyScalar(H).round())},this.getScissor=function(E){return E.copy(Gt)},this.setScissor=function(E,U,B,k){E.isVector4?Gt.set(E.x,E.y,E.z,E.w):Gt.set(E,U,B,k),Z.scissor(F.copy(Gt).multiplyScalar(H).round())},this.getScissorTest=function(){return $t},this.setScissorTest=function(E){Z.setScissorTest($t=E)},this.setOpaqueSort=function(E){ut=E},this.setTransparentSort=function(E){_t=E},this.getClearColor=function(E){return E.copy(wt.getClearColor())},this.setClearColor=function(){wt.setClearColor(...arguments)},this.getClearAlpha=function(){return wt.getClearAlpha()},this.setClearAlpha=function(){wt.setClearAlpha(...arguments)},this.clear=function(E=!0,U=!0,B=!0){let k=0;if(E){let N=!1;if(I!==null){const at=I.texture.format;N=at===ho||at===co||at===dr}if(N){const at=I.texture.type,mt=at===dn||at===kn||at===cs||at===hs||at===ao||at===oo,Et=wt.getClearColor(),vt=wt.getClearAlpha(),Ut=Et.r,Bt=Et.g,Lt=Et.b;mt?(m[0]=Ut,m[1]=Bt,m[2]=Lt,m[3]=vt,P.clearBufferuiv(P.COLOR,0,m)):(_[0]=Ut,_[1]=Bt,_[2]=Lt,_[3]=vt,P.clearBufferiv(P.COLOR,0,_))}else k|=P.COLOR_BUFFER_BIT}U&&(k|=P.DEPTH_BUFFER_BIT),B&&(k|=P.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),P.clear(k)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",dt,!1),e.removeEventListener("webglcontextrestored",bt,!1),e.removeEventListener("webglcontextcreationerror",rt,!1),wt.dispose(),X.dispose(),Rt.dispose(),it.dispose(),kt.dispose(),zt.dispose(),O.dispose(),pt.dispose(),qt.dispose(),V.dispose(),ot.dispose(),ot.removeEventListener("sessionstart",mn),ot.removeEventListener("sessionend",Dc),si.stop()};function dt(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),A=!0}function bt(){console.log("THREE.WebGLRenderer: Context Restored."),A=!1;const E=ct.autoReset,U=At.enabled,B=At.autoUpdate,k=At.needsUpdate,N=At.type;D(),ct.autoReset=E,At.enabled=U,At.autoUpdate=B,At.needsUpdate=k,At.type=N}function rt(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function K(E){const U=E.target;U.removeEventListener("dispose",K),Ct(U)}function Ct(E){Vt(E),it.remove(E)}function Vt(E){const U=it.get(E).programs;U!==void 0&&(U.forEach(function(B){V.releaseProgram(B)}),E.isShaderMaterial&&V.releaseShaderCache(E))}this.renderBufferDirect=function(E,U,B,k,N,at){U===null&&(U=Tt);const mt=N.isMesh&&N.matrixWorld.determinant()<0,Et=xf(E,U,B,k,N);Z.setMaterial(k,mt);let vt=B.index,Ut=1;if(k.wireframe===!0){if(vt=M.getWireframeAttribute(B),vt===void 0)return;Ut=2}const Bt=B.drawRange,Lt=B.attributes.position;let Jt=Bt.start*Ut,ae=(Bt.start+Bt.count)*Ut;at!==null&&(Jt=Math.max(Jt,at.start*Ut),ae=Math.min(ae,(at.start+at.count)*Ut)),vt!==null?(Jt=Math.max(Jt,0),ae=Math.min(ae,vt.count)):Lt!=null&&(Jt=Math.max(Jt,0),ae=Math.min(ae,Lt.count));const me=ae-Jt;if(me<0||me===1/0)return;pt.setup(N,k,Et,B,vt);let ue,le=gt;if(vt!==null&&(ue=w.get(vt),le=Ft,le.setIndex(ue)),N.isMesh)k.wireframe===!0?(Z.setLineWidth(k.wireframeLinewidth*ce()),le.setMode(P.LINES)):le.setMode(P.TRIANGLES);else if(N.isLine){let Dt=k.linewidth;Dt===void 0&&(Dt=1),Z.setLineWidth(Dt*ce()),N.isLineSegments?le.setMode(P.LINES):N.isLineLoop?le.setMode(P.LINE_LOOP):le.setMode(P.LINE_STRIP)}else N.isPoints?le.setMode(P.POINTS):N.isSprite&&le.setMode(P.TRIANGLES);if(N.isBatchedMesh)if(N._multiDrawInstances!==null)ir("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),le.renderMultiDrawInstances(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount,N._multiDrawInstances);else if($.get("WEBGL_multi_draw"))le.renderMultiDraw(N._multiDrawStarts,N._multiDrawCounts,N._multiDrawCount);else{const Dt=N._multiDrawStarts,de=N._multiDrawCounts,ne=N._multiDrawCount,Ze=vt?w.get(vt).bytesPerElement:1,Fi=it.get(k).currentProgram.getUniforms();for(let Je=0;Je<ne;Je++)Fi.setValue(P,"_gl_DrawID",Je),le.render(Dt[Je]/Ze,de[Je])}else if(N.isInstancedMesh)le.renderInstances(Jt,me,N.count);else if(B.isInstancedBufferGeometry){const Dt=B._maxInstanceCount!==void 0?B._maxInstanceCount:1/0,de=Math.min(B.instanceCount,Dt);le.renderInstances(Jt,me,de)}else le.render(Jt,me)};function he(E,U,B){E.transparent===!0&&E.side===vn&&E.forceSinglePass===!1?(E.side=Be,E.needsUpdate=!0,Mr(E,U,B),E.side=Bn,E.needsUpdate=!0,Mr(E,U,B),E.side=vn):Mr(E,U,B)}this.compile=function(E,U,B=null){B===null&&(B=E),p=Rt.get(B),p.init(U),v.push(p),B.traverseVisible(function(N){N.isLight&&N.layers.test(U.layers)&&(p.pushLight(N),N.castShadow&&p.pushShadow(N))}),E!==B&&E.traverseVisible(function(N){N.isLight&&N.layers.test(U.layers)&&(p.pushLight(N),N.castShadow&&p.pushShadow(N))}),p.setupLights();const k=new Set;return E.traverse(function(N){if(!(N.isMesh||N.isPoints||N.isLine||N.isSprite))return;const at=N.material;if(at)if(Array.isArray(at))for(let mt=0;mt<at.length;mt++){const Et=at[mt];he(Et,B,N),k.add(Et)}else he(at,B,N),k.add(at)}),p=v.pop(),k},this.compileAsync=function(E,U,B=null){const k=this.compile(E,U,B);return new Promise(N=>{function at(){if(k.forEach(function(mt){it.get(mt).currentProgram.isReady()&&k.delete(mt)}),k.size===0){N(E);return}setTimeout(at,10)}$.get("KHR_parallel_shader_compile")!==null?at():setTimeout(at,10)})};let ie=null;function An(E){ie&&ie(E)}function mn(){si.stop()}function Dc(){si.start()}const si=new df;si.setAnimationLoop(An),typeof self<"u"&&si.setContext(self),this.setAnimationLoop=function(E){ie=E,ot.setAnimationLoop(E),E===null?si.stop():si.start()},ot.addEventListener("sessionstart",mn),ot.addEventListener("sessionend",Dc),this.render=function(E,U){if(U!==void 0&&U.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(A===!0)return;if(E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),U.parent===null&&U.matrixWorldAutoUpdate===!0&&U.updateMatrixWorld(),ot.enabled===!0&&ot.isPresenting===!0&&(ot.cameraAutoUpdate===!0&&ot.updateCamera(U),U=ot.getCamera()),E.isScene===!0&&E.onBeforeRender(x,E,U,I),p=Rt.get(E,v.length),p.init(U),v.push(p),et.multiplyMatrices(U.projectionMatrix,U.matrixWorldInverse),se.setFromProjectionMatrix(et,Qe,U.reversedDepth),Y=this.localClippingEnabled,Qt=lt.init(this.clippingPlanes,Y),g=X.get(E,y.length),g.init(),y.push(g),ot.enabled===!0&&ot.isPresenting===!0){const at=x.xr.getDepthSensingMesh();at!==null&&zo(at,U,-1/0,x.sortObjects)}zo(E,U,0,x.sortObjects),g.finish(),x.sortObjects===!0&&g.sort(ut,_t),Zt=ot.enabled===!1||ot.isPresenting===!1||ot.hasDepthSensing()===!1,Zt&&wt.addToRenderList(g,E),this.info.render.frame++,Qt===!0&<.beginShadows();const B=p.state.shadowsArray;At.render(B,E,U),Qt===!0&<.endShadows(),this.info.autoReset===!0&&this.info.reset();const k=g.opaque,N=g.transmissive;if(p.setupLights(),U.isArrayCamera){const at=U.cameras;if(N.length>0)for(let mt=0,Et=at.length;mt<Et;mt++){const vt=at[mt];Nc(k,N,E,vt)}Zt&&wt.render(E);for(let mt=0,Et=at.length;mt<Et;mt++){const vt=at[mt];Uc(g,E,vt,vt.viewport)}}else N.length>0&&Nc(k,N,E,U),Zt&&wt.render(E),Uc(g,E,U);I!==null&&R===0&&(ht.updateMultisampleRenderTarget(I),ht.updateRenderTargetMipmap(I)),E.isScene===!0&&E.onAfterRender(x,E,U),pt.resetDefaultState(),b=-1,S=null,v.pop(),v.length>0?(p=v[v.length-1],Qt===!0&<.setGlobalState(x.clippingPlanes,p.state.camera)):p=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function zo(E,U,B,k){if(E.visible===!1)return;if(E.layers.test(U.layers)){if(E.isGroup)B=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(U);else if(E.isLight)p.pushLight(E),E.castShadow&&p.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||se.intersectsSprite(E)){k&&Pt.setFromMatrixPosition(E.matrixWorld).applyMatrix4(et);const mt=O.update(E),Et=E.material;Et.visible&&g.push(E,mt,Et,B,Pt.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||se.intersectsObject(E))){const mt=O.update(E),Et=E.material;if(k&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),Pt.copy(E.boundingSphere.center)):(mt.boundingSphere===null&&mt.computeBoundingSphere(),Pt.copy(mt.boundingSphere.center)),Pt.applyMatrix4(E.matrixWorld).applyMatrix4(et)),Array.isArray(Et)){const vt=mt.groups;for(let Ut=0,Bt=vt.length;Ut<Bt;Ut++){const Lt=vt[Ut],Jt=Et[Lt.materialIndex];Jt&&Jt.visible&&g.push(E,mt,Jt,B,Pt.z,Lt)}}else Et.visible&&g.push(E,mt,Et,B,Pt.z,null)}}const at=E.children;for(let mt=0,Et=at.length;mt<Et;mt++)zo(at[mt],U,B,k)}function Uc(E,U,B,k){const N=E.opaque,at=E.transmissive,mt=E.transparent;p.setupLightsView(B),Qt===!0&<.setGlobalState(x.clippingPlanes,B),k&&Z.viewport(L.copy(k)),N.length>0&&yr(N,U,B),at.length>0&&yr(at,U,B),mt.length>0&&yr(mt,U,B),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function Nc(E,U,B,k){if((B.isScene===!0?B.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[k.id]===void 0&&(p.state.transmissionRenderTarget[k.id]=new bn(1,1,{generateMipmaps:!0,type:$.has("EXT_color_buffer_half_float")||$.has("EXT_color_buffer_float")?vs:dn,minFilter:yn,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Kt.workingColorSpace}));const at=p.state.transmissionRenderTarget[k.id],mt=k.viewport||L;at.setSize(mt.z*x.transmissionResolutionScale,mt.w*x.transmissionResolutionScale);const Et=x.getRenderTarget(),vt=x.getActiveCubeFace(),Ut=x.getActiveMipmapLevel();x.setRenderTarget(at),x.getClearColor(G),q=x.getClearAlpha(),q<1&&x.setClearColor(16777215,.5),x.clear(),Zt&&wt.render(B);const Bt=x.toneMapping;x.toneMapping=Fn;const Lt=k.viewport;if(k.viewport!==void 0&&(k.viewport=void 0),p.setupLightsView(k),Qt===!0&<.setGlobalState(x.clippingPlanes,k),yr(E,B,k),ht.updateMultisampleRenderTarget(at),ht.updateRenderTargetMipmap(at),$.has("WEBGL_multisampled_render_to_texture")===!1){let Jt=!1;for(let ae=0,me=U.length;ae<me;ae++){const ue=U[ae],le=ue.object,Dt=ue.geometry,de=ue.material,ne=ue.group;if(de.side===vn&&le.layers.test(k.layers)){const Ze=de.side;de.side=Be,de.needsUpdate=!0,Fc(le,B,k,Dt,de,ne),de.side=Ze,de.needsUpdate=!0,Jt=!0}}Jt===!0&&(ht.updateMultisampleRenderTarget(at),ht.updateRenderTargetMipmap(at))}x.setRenderTarget(Et,vt,Ut),x.setClearColor(G,q),Lt!==void 0&&(k.viewport=Lt),x.toneMapping=Bt}function yr(E,U,B){const k=U.isScene===!0?U.overrideMaterial:null;for(let N=0,at=E.length;N<at;N++){const mt=E[N],Et=mt.object,vt=mt.geometry,Ut=mt.group;let Bt=mt.material;Bt.allowOverride===!0&&k!==null&&(Bt=k),Et.layers.test(B.layers)&&Fc(Et,U,B,vt,Bt,Ut)}}function Fc(E,U,B,k,N,at){E.onBeforeRender(x,U,B,k,N,at),E.modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),N.onBeforeRender(x,U,B,k,E,at),N.transparent===!0&&N.side===vn&&N.forceSinglePass===!1?(N.side=Be,N.needsUpdate=!0,x.renderBufferDirect(B,U,k,N,E,at),N.side=Bn,N.needsUpdate=!0,x.renderBufferDirect(B,U,k,N,E,at),N.side=vn):x.renderBufferDirect(B,U,k,N,E,at),E.onAfterRender(x,U,B,k,N,at)}function Mr(E,U,B){U.isScene!==!0&&(U=Tt);const k=it.get(E),N=p.state.lights,at=p.state.shadowsArray,mt=N.state.version,Et=V.getParameters(E,N.state,at,U,B),vt=V.getProgramCacheKey(Et);let Ut=k.programs;k.environment=E.isMeshStandardMaterial?U.environment:null,k.fog=U.fog,k.envMap=(E.isMeshStandardMaterial?zt:kt).get(E.envMap||k.environment),k.envMapRotation=k.environment!==null&&E.envMap===null?U.environmentRotation:E.envMapRotation,Ut===void 0&&(E.addEventListener("dispose",K),Ut=new Map,k.programs=Ut);let Bt=Ut.get(vt);if(Bt!==void 0){if(k.currentProgram===Bt&&k.lightsStateVersion===mt)return Bc(E,Et),Bt}else Et.uniforms=V.getUniforms(E),E.onBeforeCompile(Et,x),Bt=V.acquireProgram(Et,vt),Ut.set(vt,Bt),k.uniforms=Et.uniforms;const Lt=k.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(Lt.clippingPlanes=lt.uniform),Bc(E,Et),k.needsLights=yf(E),k.lightsStateVersion=mt,k.needsLights&&(Lt.ambientLightColor.value=N.state.ambient,Lt.lightProbe.value=N.state.probe,Lt.directionalLights.value=N.state.directional,Lt.directionalLightShadows.value=N.state.directionalShadow,Lt.spotLights.value=N.state.spot,Lt.spotLightShadows.value=N.state.spotShadow,Lt.rectAreaLights.value=N.state.rectArea,Lt.ltc_1.value=N.state.rectAreaLTC1,Lt.ltc_2.value=N.state.rectAreaLTC2,Lt.pointLights.value=N.state.point,Lt.pointLightShadows.value=N.state.pointShadow,Lt.hemisphereLights.value=N.state.hemi,Lt.directionalShadowMap.value=N.state.directionalShadowMap,Lt.directionalShadowMatrix.value=N.state.directionalShadowMatrix,Lt.spotShadowMap.value=N.state.spotShadowMap,Lt.spotLightMatrix.value=N.state.spotLightMatrix,Lt.spotLightMap.value=N.state.spotLightMap,Lt.pointShadowMap.value=N.state.pointShadowMap,Lt.pointShadowMatrix.value=N.state.pointShadowMatrix),k.currentProgram=Bt,k.uniformsList=null,Bt}function Oc(E){if(E.uniformsList===null){const U=E.currentProgram.getUniforms();E.uniformsList=ma.seqWithValue(U.seq,E.uniforms)}return E.uniformsList}function Bc(E,U){const B=it.get(E);B.outputColorSpace=U.outputColorSpace,B.batching=U.batching,B.batchingColor=U.batchingColor,B.instancing=U.instancing,B.instancingColor=U.instancingColor,B.instancingMorph=U.instancingMorph,B.skinning=U.skinning,B.morphTargets=U.morphTargets,B.morphNormals=U.morphNormals,B.morphColors=U.morphColors,B.morphTargetsCount=U.morphTargetsCount,B.numClippingPlanes=U.numClippingPlanes,B.numIntersection=U.numClipIntersection,B.vertexAlphas=U.vertexAlphas,B.vertexTangents=U.vertexTangents,B.toneMapping=U.toneMapping}function xf(E,U,B,k,N){U.isScene!==!0&&(U=Tt),ht.resetTextureUnits();const at=U.fog,mt=k.isMeshStandardMaterial?U.environment:null,Et=I===null?x.outputColorSpace:I.isXRRenderTarget===!0?I.texture.colorSpace:Ii,vt=(k.isMeshStandardMaterial?zt:kt).get(k.envMap||mt),Ut=k.vertexColors===!0&&!!B.attributes.color&&B.attributes.color.itemSize===4,Bt=!!B.attributes.tangent&&(!!k.normalMap||k.anisotropy>0),Lt=!!B.morphAttributes.position,Jt=!!B.morphAttributes.normal,ae=!!B.morphAttributes.color;let me=Fn;k.toneMapped&&(I===null||I.isXRRenderTarget===!0)&&(me=x.toneMapping);const ue=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,le=ue!==void 0?ue.length:0,Dt=it.get(k),de=p.state.lights;if(Qt===!0&&(Y===!0||E!==S)){const De=E===S&&k.id===b;lt.setState(k,E,De)}let ne=!1;k.version===Dt.__version?(Dt.needsLights&&Dt.lightsStateVersion!==de.state.version||Dt.outputColorSpace!==Et||N.isBatchedMesh&&Dt.batching===!1||!N.isBatchedMesh&&Dt.batching===!0||N.isBatchedMesh&&Dt.batchingColor===!0&&N.colorTexture===null||N.isBatchedMesh&&Dt.batchingColor===!1&&N.colorTexture!==null||N.isInstancedMesh&&Dt.instancing===!1||!N.isInstancedMesh&&Dt.instancing===!0||N.isSkinnedMesh&&Dt.skinning===!1||!N.isSkinnedMesh&&Dt.skinning===!0||N.isInstancedMesh&&Dt.instancingColor===!0&&N.instanceColor===null||N.isInstancedMesh&&Dt.instancingColor===!1&&N.instanceColor!==null||N.isInstancedMesh&&Dt.instancingMorph===!0&&N.morphTexture===null||N.isInstancedMesh&&Dt.instancingMorph===!1&&N.morphTexture!==null||Dt.envMap!==vt||k.fog===!0&&Dt.fog!==at||Dt.numClippingPlanes!==void 0&&(Dt.numClippingPlanes!==lt.numPlanes||Dt.numIntersection!==lt.numIntersection)||Dt.vertexAlphas!==Ut||Dt.vertexTangents!==Bt||Dt.morphTargets!==Lt||Dt.morphNormals!==Jt||Dt.morphColors!==ae||Dt.toneMapping!==me||Dt.morphTargetsCount!==le)&&(ne=!0):(ne=!0,Dt.__version=k.version);let Ze=Dt.currentProgram;ne===!0&&(Ze=Mr(k,U,N));let Fi=!1,Je=!1,Es=!1;const fe=Ze.getUniforms(),en=Dt.uniforms;if(Z.useProgram(Ze.program)&&(Fi=!0,Je=!0,Es=!0),k.id!==b&&(b=k.id,Je=!0),Fi||S!==E){Z.buffers.depth.getReversed()&&E.reversedDepth!==!0&&(E._reversedDepth=!0,E.updateProjectionMatrix()),fe.setValue(P,"projectionMatrix",E.projectionMatrix),fe.setValue(P,"viewMatrix",E.matrixWorldInverse);const ke=fe.map.cameraPosition;ke!==void 0&&ke.setValue(P,yt.setFromMatrixPosition(E.matrixWorld)),J.logarithmicDepthBuffer&&fe.setValue(P,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(k.isMeshPhongMaterial||k.isMeshToonMaterial||k.isMeshLambertMaterial||k.isMeshBasicMaterial||k.isMeshStandardMaterial||k.isShaderMaterial)&&fe.setValue(P,"isOrthographic",E.isOrthographicCamera===!0),S!==E&&(S=E,Je=!0,Es=!0)}if(N.isSkinnedMesh){fe.setOptional(P,N,"bindMatrix"),fe.setOptional(P,N,"bindMatrixInverse");const De=N.skeleton;De&&(De.boneTexture===null&&De.computeBoneTexture(),fe.setValue(P,"boneTexture",De.boneTexture,ht))}N.isBatchedMesh&&(fe.setOptional(P,N,"batchingTexture"),fe.setValue(P,"batchingTexture",N._matricesTexture,ht),fe.setOptional(P,N,"batchingIdTexture"),fe.setValue(P,"batchingIdTexture",N._indirectTexture,ht),fe.setOptional(P,N,"batchingColorTexture"),N._colorsTexture!==null&&fe.setValue(P,"batchingColorTexture",N._colorsTexture,ht));const nn=B.morphAttributes;if((nn.position!==void 0||nn.normal!==void 0||nn.color!==void 0)&&st.update(N,B,Ze),(Je||Dt.receiveShadow!==N.receiveShadow)&&(Dt.receiveShadow=N.receiveShadow,fe.setValue(P,"receiveShadow",N.receiveShadow)),k.isMeshGouraudMaterial&&k.envMap!==null&&(en.envMap.value=vt,en.flipEnvMap.value=vt.isCubeTexture&&vt.isRenderTargetTexture===!1?-1:1),k.isMeshStandardMaterial&&k.envMap===null&&U.environment!==null&&(en.envMapIntensity.value=U.environmentIntensity),Je&&(fe.setValue(P,"toneMappingExposure",x.toneMappingExposure),Dt.needsLights&&vf(en,Es),at&&k.fog===!0&&j.refreshFogUniforms(en,at),j.refreshMaterialUniforms(en,k,H,nt,p.state.transmissionRenderTarget[E.id]),ma.upload(P,Oc(Dt),en,ht)),k.isShaderMaterial&&k.uniformsNeedUpdate===!0&&(ma.upload(P,Oc(Dt),en,ht),k.uniformsNeedUpdate=!1),k.isSpriteMaterial&&fe.setValue(P,"center",N.center),fe.setValue(P,"modelViewMatrix",N.modelViewMatrix),fe.setValue(P,"normalMatrix",N.normalMatrix),fe.setValue(P,"modelMatrix",N.matrixWorld),k.isShaderMaterial||k.isRawShaderMaterial){const De=k.uniformsGroups;for(let ke=0,ko=De.length;ke<ko;ke++){const ri=De[ke];qt.update(ri,Ze),qt.bind(ri,Ze)}}return Ze}function vf(E,U){E.ambientLightColor.needsUpdate=U,E.lightProbe.needsUpdate=U,E.directionalLights.needsUpdate=U,E.directionalLightShadows.needsUpdate=U,E.pointLights.needsUpdate=U,E.pointLightShadows.needsUpdate=U,E.spotLights.needsUpdate=U,E.spotLightShadows.needsUpdate=U,E.rectAreaLights.needsUpdate=U,E.hemisphereLights.needsUpdate=U}function yf(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return T},this.getActiveMipmapLevel=function(){return R},this.getRenderTarget=function(){return I},this.setRenderTargetTextures=function(E,U,B){const k=it.get(E);k.__autoAllocateDepthBuffer=E.resolveDepthBuffer===!1,k.__autoAllocateDepthBuffer===!1&&(k.__useRenderToTexture=!1),it.get(E.texture).__webglTexture=U,it.get(E.depthTexture).__webglTexture=k.__autoAllocateDepthBuffer?void 0:B,k.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(E,U){const B=it.get(E);B.__webglFramebuffer=U,B.__useDefaultFramebuffer=U===void 0};const Mf=P.createFramebuffer();this.setRenderTarget=function(E,U=0,B=0){I=E,T=U,R=B;let k=!0,N=null,at=!1,mt=!1;if(E){const vt=it.get(E);if(vt.__useDefaultFramebuffer!==void 0)Z.bindFramebuffer(P.FRAMEBUFFER,null),k=!1;else if(vt.__webglFramebuffer===void 0)ht.setupRenderTarget(E);else if(vt.__hasExternalTextures)ht.rebindTextures(E,it.get(E.texture).__webglTexture,it.get(E.depthTexture).__webglTexture);else if(E.depthBuffer){const Lt=E.depthTexture;if(vt.__boundDepthTexture!==Lt){if(Lt!==null&&it.has(Lt)&&(E.width!==Lt.image.width||E.height!==Lt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ht.setupDepthRenderbuffer(E)}}const Ut=E.texture;(Ut.isData3DTexture||Ut.isDataArrayTexture||Ut.isCompressedArrayTexture)&&(mt=!0);const Bt=it.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(Bt[U])?N=Bt[U][B]:N=Bt[U],at=!0):E.samples>0&&ht.useMultisampledRTT(E)===!1?N=it.get(E).__webglMultisampledFramebuffer:Array.isArray(Bt)?N=Bt[B]:N=Bt,L.copy(E.viewport),F.copy(E.scissor),z=E.scissorTest}else L.copy(St).multiplyScalar(H).floor(),F.copy(Gt).multiplyScalar(H).floor(),z=$t;if(B!==0&&(N=Mf),Z.bindFramebuffer(P.FRAMEBUFFER,N)&&k&&Z.drawBuffers(E,N),Z.viewport(L),Z.scissor(F),Z.setScissorTest(z),at){const vt=it.get(E.texture);P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_CUBE_MAP_POSITIVE_X+U,vt.__webglTexture,B)}else if(mt){const vt=U;for(let Ut=0;Ut<E.textures.length;Ut++){const Bt=it.get(E.textures[Ut]);P.framebufferTextureLayer(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0+Ut,Bt.__webglTexture,B,vt)}}else if(E!==null&&B!==0){const vt=it.get(E.texture);P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,vt.__webglTexture,B)}b=-1},this.readRenderTargetPixels=function(E,U,B,k,N,at,mt,Et=0){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let vt=it.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&mt!==void 0&&(vt=vt[mt]),vt){Z.bindFramebuffer(P.FRAMEBUFFER,vt);try{const Ut=E.textures[Et],Bt=Ut.format,Lt=Ut.type;if(!J.textureFormatReadable(Bt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!J.textureTypeReadable(Lt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}U>=0&&U<=E.width-k&&B>=0&&B<=E.height-N&&(E.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+Et),P.readPixels(U,B,k,N,It.convert(Bt),It.convert(Lt),at))}finally{const Ut=I!==null?it.get(I).__webglFramebuffer:null;Z.bindFramebuffer(P.FRAMEBUFFER,Ut)}}},this.readRenderTargetPixelsAsync=async function(E,U,B,k,N,at,mt,Et=0){if(!(E&&E.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let vt=it.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&mt!==void 0&&(vt=vt[mt]),vt)if(U>=0&&U<=E.width-k&&B>=0&&B<=E.height-N){Z.bindFramebuffer(P.FRAMEBUFFER,vt);const Ut=E.textures[Et],Bt=Ut.format,Lt=Ut.type;if(!J.textureFormatReadable(Bt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!J.textureTypeReadable(Lt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Jt=P.createBuffer();P.bindBuffer(P.PIXEL_PACK_BUFFER,Jt),P.bufferData(P.PIXEL_PACK_BUFFER,at.byteLength,P.STREAM_READ),E.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+Et),P.readPixels(U,B,k,N,It.convert(Bt),It.convert(Lt),0);const ae=I!==null?it.get(I).__webglFramebuffer:null;Z.bindFramebuffer(P.FRAMEBUFFER,ae);const me=P.fenceSync(P.SYNC_GPU_COMMANDS_COMPLETE,0);return P.flush(),await Cp(P,me,4),P.bindBuffer(P.PIXEL_PACK_BUFFER,Jt),P.getBufferSubData(P.PIXEL_PACK_BUFFER,0,at),P.deleteBuffer(Jt),P.deleteSync(me),at}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(E,U=null,B=0){const k=Math.pow(2,-B),N=Math.floor(E.image.width*k),at=Math.floor(E.image.height*k),mt=U!==null?U.x:0,Et=U!==null?U.y:0;ht.setTexture2D(E,0),P.copyTexSubImage2D(P.TEXTURE_2D,B,0,0,mt,Et,N,at),Z.unbindTexture()};const Sf=P.createFramebuffer(),bf=P.createFramebuffer();this.copyTextureToTexture=function(E,U,B=null,k=null,N=0,at=null){at===null&&(N!==0?(ir("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),at=N,N=0):at=0);let mt,Et,vt,Ut,Bt,Lt,Jt,ae,me;const ue=E.isCompressedTexture?E.mipmaps[at]:E.image;if(B!==null)mt=B.max.x-B.min.x,Et=B.max.y-B.min.y,vt=B.isBox3?B.max.z-B.min.z:1,Ut=B.min.x,Bt=B.min.y,Lt=B.isBox3?B.min.z:0;else{const nn=Math.pow(2,-N);mt=Math.floor(ue.width*nn),Et=Math.floor(ue.height*nn),E.isDataArrayTexture?vt=ue.depth:E.isData3DTexture?vt=Math.floor(ue.depth*nn):vt=1,Ut=0,Bt=0,Lt=0}k!==null?(Jt=k.x,ae=k.y,me=k.z):(Jt=0,ae=0,me=0);const le=It.convert(U.format),Dt=It.convert(U.type);let de;U.isData3DTexture?(ht.setTexture3D(U,0),de=P.TEXTURE_3D):U.isDataArrayTexture||U.isCompressedArrayTexture?(ht.setTexture2DArray(U,0),de=P.TEXTURE_2D_ARRAY):(ht.setTexture2D(U,0),de=P.TEXTURE_2D),P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,U.flipY),P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),P.pixelStorei(P.UNPACK_ALIGNMENT,U.unpackAlignment);const ne=P.getParameter(P.UNPACK_ROW_LENGTH),Ze=P.getParameter(P.UNPACK_IMAGE_HEIGHT),Fi=P.getParameter(P.UNPACK_SKIP_PIXELS),Je=P.getParameter(P.UNPACK_SKIP_ROWS),Es=P.getParameter(P.UNPACK_SKIP_IMAGES);P.pixelStorei(P.UNPACK_ROW_LENGTH,ue.width),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,ue.height),P.pixelStorei(P.UNPACK_SKIP_PIXELS,Ut),P.pixelStorei(P.UNPACK_SKIP_ROWS,Bt),P.pixelStorei(P.UNPACK_SKIP_IMAGES,Lt);const fe=E.isDataArrayTexture||E.isData3DTexture,en=U.isDataArrayTexture||U.isData3DTexture;if(E.isDepthTexture){const nn=it.get(E),De=it.get(U),ke=it.get(nn.__renderTarget),ko=it.get(De.__renderTarget);Z.bindFramebuffer(P.READ_FRAMEBUFFER,ke.__webglFramebuffer),Z.bindFramebuffer(P.DRAW_FRAMEBUFFER,ko.__webglFramebuffer);for(let ri=0;ri<vt;ri++)fe&&(P.framebufferTextureLayer(P.READ_FRAMEBUFFER,P.COLOR_ATTACHMENT0,it.get(E).__webglTexture,N,Lt+ri),P.framebufferTextureLayer(P.DRAW_FRAMEBUFFER,P.COLOR_ATTACHMENT0,it.get(U).__webglTexture,at,me+ri)),P.blitFramebuffer(Ut,Bt,mt,Et,Jt,ae,mt,Et,P.DEPTH_BUFFER_BIT,P.NEAREST);Z.bindFramebuffer(P.READ_FRAMEBUFFER,null),Z.bindFramebuffer(P.DRAW_FRAMEBUFFER,null)}else if(N!==0||E.isRenderTargetTexture||it.has(E)){const nn=it.get(E),De=it.get(U);Z.bindFramebuffer(P.READ_FRAMEBUFFER,Sf),Z.bindFramebuffer(P.DRAW_FRAMEBUFFER,bf);for(let ke=0;ke<vt;ke++)fe?P.framebufferTextureLayer(P.READ_FRAMEBUFFER,P.COLOR_ATTACHMENT0,nn.__webglTexture,N,Lt+ke):P.framebufferTexture2D(P.READ_FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,nn.__webglTexture,N),en?P.framebufferTextureLayer(P.DRAW_FRAMEBUFFER,P.COLOR_ATTACHMENT0,De.__webglTexture,at,me+ke):P.framebufferTexture2D(P.DRAW_FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,De.__webglTexture,at),N!==0?P.blitFramebuffer(Ut,Bt,mt,Et,Jt,ae,mt,Et,P.COLOR_BUFFER_BIT,P.NEAREST):en?P.copyTexSubImage3D(de,at,Jt,ae,me+ke,Ut,Bt,mt,Et):P.copyTexSubImage2D(de,at,Jt,ae,Ut,Bt,mt,Et);Z.bindFramebuffer(P.READ_FRAMEBUFFER,null),Z.bindFramebuffer(P.DRAW_FRAMEBUFFER,null)}else en?E.isDataTexture||E.isData3DTexture?P.texSubImage3D(de,at,Jt,ae,me,mt,Et,vt,le,Dt,ue.data):U.isCompressedArrayTexture?P.compressedTexSubImage3D(de,at,Jt,ae,me,mt,Et,vt,le,ue.data):P.texSubImage3D(de,at,Jt,ae,me,mt,Et,vt,le,Dt,ue):E.isDataTexture?P.texSubImage2D(P.TEXTURE_2D,at,Jt,ae,mt,Et,le,Dt,ue.data):E.isCompressedTexture?P.compressedTexSubImage2D(P.TEXTURE_2D,at,Jt,ae,ue.width,ue.height,le,ue.data):P.texSubImage2D(P.TEXTURE_2D,at,Jt,ae,mt,Et,le,Dt,ue);P.pixelStorei(P.UNPACK_ROW_LENGTH,ne),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,Ze),P.pixelStorei(P.UNPACK_SKIP_PIXELS,Fi),P.pixelStorei(P.UNPACK_SKIP_ROWS,Je),P.pixelStorei(P.UNPACK_SKIP_IMAGES,Es),at===0&&U.generateMipmaps&&P.generateMipmap(de),Z.unbindTexture()},this.initRenderTarget=function(E){it.get(E).__webglFramebuffer===void 0&&ht.setupRenderTarget(E)},this.initTexture=function(E){E.isCubeTexture?ht.setTextureCube(E,0):E.isData3DTexture?ht.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?ht.setTexture2DArray(E,0):ht.setTexture2D(E,0),Z.unbindTexture()},this.resetState=function(){T=0,R=0,I=null,Z.reset(),pt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Qe}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=Kt._getDrawingBufferColorSpace(t),e.unpackColorSpace=Kt._getUnpackColorSpace()}}const Zy=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:Vu,AddEquation:$n,AddOperation:Ou,AdditiveAnimationBlendMode:nc,AdditiveBlending:Ll,AgXToneMapping:Gu,AlphaFormat:jl,AlwaysCompare:sd,AlwaysDepth:va,AlwaysStencilFunc:Fl,AmbientLight:jd,AnimationAction:hf,AnimationClip:cr,AnimationLoader:eg,AnimationMixer:Ig,AnimationObjectGroup:Cg,AnimationUtils:Km,ArcCurve:Ed,ArrayCamera:af,ArrowHelper:i_,AttachedBindMode:Nl,Audio:lf,AudioAnalyser:xg,AudioContext:wc,AudioListener:mg,AudioLoader:dg,AxesHelper:s_,BackSide:Be,BasicDepthPacking:Ju,BasicShadowMap:wf,BatchedMesh:vd,Bone:cc,BooleanKeyframeTrack:Ui,Box2:Vg,Box3:Pe,Box3Helper:e_,BoxGeometry:Di,BoxHelper:t_,BufferAttribute:oe,BufferGeometry:Xt,BufferGeometryLoader:rf,ByteType:Jl,Cache:Mn,Camera:go,CameraHelper:jg,CanvasTexture:ym,CapsuleGeometry:bo,CatmullRomCurve3:Td,CineonToneMapping:ku,CircleGeometry:Eo,ClampToEdgeWrapping:rn,Clock:of,Color:xt,ColorKeyframeTrack:Ec,ColorManagement:Kt,CompressedArrayTexture:xm,CompressedCubeTexture:vm,CompressedTexture:So,CompressedTextureLoader:ng,ConeGeometry:mr,ConstantAlphaFactor:Uu,ConstantColorFactor:Lu,Controls:a_,CubeCamera:ud,CubeReflectionMapping:zn,CubeRefractionMapping:Qn,CubeTexture:fr,CubeTextureLoader:ig,CubeUVReflectionMapping:xs,CubicBezierCurve:pc,CubicBezierCurve3:Ad,CubicInterpolant:Xd,CullFaceBack:Pl,CullFaceFront:gu,CullFaceFrontBack:Af,CullFaceNone:mu,Curve:pn,CurvePath:Cd,CustomBlending:xu,CustomToneMapping:Hu,CylinderGeometry:pr,Cylindrical:kg,Data3DTexture:po,DataArrayTexture:fo,DataTexture:Sn,DataTextureLoader:sg,DataUtils:Gp,DecrementStencilOp:Vf,DecrementWrapStencilOp:Gf,DefaultLoadingManager:Zd,DepthFormat:us,DepthStencilFormat:ds,DepthTexture:uc,DetachedBindMode:Xu,DirectionalLight:Qd,DirectionalLightHelper:Qg,DiscreteInterpolant:qd,DodecahedronGeometry:To,DoubleSide:vn,DstAlphaFactor:wu,DstColorFactor:Ru,DynamicCopyUsage:sp,DynamicDrawUsage:Qf,DynamicReadUsage:ep,EdgesGeometry:bd,EllipseCurve:Ao,EqualCompare:td,EqualDepth:Ma,EqualStencilFunc:Yf,EquirectangularReflectionMapping:Zs,EquirectangularRefractionMapping:Js,Euler:tn,EventDispatcher:En,ExternalTexture:dc,ExtrudeGeometry:wo,FileLoader:Vn,Float16BufferAttribute:$p,Float32BufferAttribute:Mt,FloatType:Xe,Fog:xo,FogExp2:_o,FramebufferTexture:_m,FrontSide:Bn,Frustum:Ms,FrustumArray:Mo,GLBufferAttribute:Ng,GLSL1:ap,GLSL3:Ol,GreaterCompare:ed,GreaterDepth:ba,GreaterEqualCompare:id,GreaterEqualDepth:Sa,GreaterEqualStencilFunc:Kf,GreaterStencilFunc:Jf,GridHelper:$g,Group:as,HalfFloatType:vs,HemisphereLight:Jd,HemisphereLightHelper:Jg,IcosahedronGeometry:Co,ImageBitmapLoader:ug,ImageLoader:hr,ImageUtils:od,IncrementStencilOp:kf,IncrementWrapStencilOp:Hf,InstancedBufferAttribute:gs,InstancedBufferGeometry:sf,InstancedInterleavedBuffer:Ug,InstancedMesh:xd,Int16BufferAttribute:Zp,Int32BufferAttribute:Jp,Int8BufferAttribute:Xp,IntType:ro,InterleavedBuffer:vo,InterleavedBufferAttribute:Pi,Interpolant:xr,InterpolateDiscrete:Qs,InterpolateLinear:ja,InterpolateSmooth:fa,InterpolationSamplingMode:cp,InterpolationSamplingType:lp,InvertStencilOp:Wf,KeepStencilOp:yi,KeyframeTrack:an,LOD:gd,LatheGeometry:Ro,Layers:mo,LessCompare:ju,LessDepth:ya,LessEqualCompare:ic,LessEqualDepth:Ri,LessEqualStencilFunc:Zf,LessStencilFunc:qf,Light:ii,LightProbe:nf,Line:jn,Line3:Wg,LineBasicMaterial:ze,LineCurve:mc,LineCurve3:wd,LineDashedMaterial:Hd,LineLoop:yd,LineSegments:Tn,LinearFilter:Me,LinearInterpolant:bc,LinearMipMapLinearFilter:Pf,LinearMipMapNearestFilter:If,LinearMipmapLinearFilter:yn,LinearMipmapNearestFilter:ks,LinearSRGBColorSpace:Ii,LinearToneMapping:Bu,LinearTransfer:tr,Loader:Ye,LoaderUtils:Hl,LoadingManager:Tc,LoopOnce:qu,LoopPingPong:Zu,LoopRepeat:Yu,MOUSE:Ef,Material:Le,MaterialLoader:Oo,MathUtils:Ap,Matrix2:Pc,Matrix3:Ht,Matrix4:Ot,MaxEquation:Su,Mesh:ye,MeshBasicMaterial:ei,MeshDepthMaterial:yc,MeshDistanceMaterial:Mc,MeshLambertMaterial:kd,MeshMatcapMaterial:Vd,MeshNormalMaterial:zd,MeshPhongMaterial:Od,MeshPhysicalMaterial:Fd,MeshStandardMaterial:vc,MeshToonMaterial:Bd,MinEquation:Mu,MirroredRepeatWrapping:Ks,MixOperation:Fu,MultiplyBlending:Ul,MultiplyOperation:ur,NearestFilter:Ae,NearestMipMapLinearFilter:Rf,NearestMipMapNearestFilter:Cf,NearestMipmapLinearFilter:ss,NearestMipmapNearestFilter:Zl,NeutralToneMapping:Wu,NeverCompare:Qu,NeverDepth:xa,NeverStencilFunc:Xf,NoBlending:Nn,NoColorSpace:Dn,NoToneMapping:Fn,NormalAnimationBlendMode:uo,NormalBlending:Ai,NotEqualCompare:nd,NotEqualDepth:Ea,NotEqualStencilFunc:$f,NumberKeyframeTrack:or,Object3D:ee,ObjectLoader:cg,ObjectSpaceNormalMap:Ku,OctahedronGeometry:gr,OneFactor:Eu,OneMinusConstantAlphaFactor:Nu,OneMinusConstantColorFactor:Du,OneMinusDstAlphaFactor:Cu,OneMinusDstColorFactor:Iu,OneMinusSrcAlphaFactor:_a,OneMinusSrcColorFactor:Au,OrthographicCamera:Fo,PCFShadowMap:Yl,PCFSoftShadowMap:_u,PMREMGenerator:Xl,Path:io,PerspectiveCamera:Te,Plane:Jn,PlaneGeometry:Ss,PlaneHelper:n_,PointLight:Kd,PointLightHelper:Yg,Points:Md,PointsMaterial:hc,PolarGridHelper:Kg,PolyhedronGeometry:ni,PositionalAudio:_g,PropertyBinding:jt,PropertyMixer:cf,QuadraticBezierCurve:gc,QuadraticBezierCurve3:_c,Quaternion:qe,QuaternionKeyframeTrack:vr,QuaternionLinearInterpolant:Yd,RED_GREEN_RGTC2_Format:Ka,RED_RGTC1_Format:Ja,REVISION:"180",RGBADepthPacking:$u,RGBAFormat:Oe,RGBAIntegerFormat:ho,RGBA_ASTC_10x10_Format:Ga,RGBA_ASTC_10x5_Format:ka,RGBA_ASTC_10x6_Format:Va,RGBA_ASTC_10x8_Format:Ha,RGBA_ASTC_12x10_Format:Wa,RGBA_ASTC_12x12_Format:Xa,RGBA_ASTC_4x4_Format:La,RGBA_ASTC_5x4_Format:Da,RGBA_ASTC_5x5_Format:Ua,RGBA_ASTC_6x5_Format:Na,RGBA_ASTC_6x6_Format:Fa,RGBA_ASTC_8x5_Format:Oa,RGBA_ASTC_8x6_Format:Ba,RGBA_ASTC_8x8_Format:za,RGBA_BPTC_Format:qa,RGBA_ETC2_EAC_Format:Pa,RGBA_PVRTC_2BPPV1_Format:Ca,RGBA_PVRTC_4BPPV1_Format:wa,RGBA_S3TC_DXT1_Format:Hs,RGBA_S3TC_DXT3_Format:Gs,RGBA_S3TC_DXT5_Format:Ws,RGBDepthPacking:Ff,RGBFormat:tc,RGBIntegerFormat:Lf,RGB_BPTC_SIGNED_Format:Ya,RGB_BPTC_UNSIGNED_Format:Za,RGB_ETC1_Format:Ra,RGB_ETC2_Format:Ia,RGB_PVRTC_2BPPV1_Format:Aa,RGB_PVRTC_4BPPV1_Format:Ta,RGB_S3TC_DXT1_Format:Vs,RGDepthPacking:Of,RGFormat:ec,RGIntegerFormat:co,RawShaderMaterial:Nd,Ray:ys,Raycaster:Fg,RectAreaLight:tf,RedFormat:lo,RedIntegerFormat:dr,ReinhardToneMapping:zu,RenderTarget:rc,RenderTarget3D:Pg,RepeatWrapping:$s,ReplaceStencilOp:zf,ReverseSubtractEquation:yu,RingGeometry:Io,SIGNED_RED_GREEN_RGTC2_Format:Qa,SIGNED_RED_RGTC1_Format:$a,SRGBColorSpace:Ge,SRGBTransfer:re,Scene:fd,ShaderChunk:Yt,ShaderLib:hn,ShaderMaterial:fn,ShadowMaterial:Ud,Shape:Ci,ShapeGeometry:Po,ShapePath:r_,ShapeUtils:un,ShortType:$l,Skeleton:yo,SkeletonHelper:qg,SkinnedMesh:_d,Source:Kn,Sphere:we,SphereGeometry:_r,Spherical:zg,SphericalHarmonics3:ef,SplineCurve:xc,SpotLight:$d,SpotLightHelper:Xg,Sprite:md,SpriteMaterial:lc,SrcAlphaFactor:ga,SrcAlphaSaturateFactor:Pu,SrcColorFactor:Tu,StaticCopyUsage:ip,StaticDrawUsage:er,StaticReadUsage:tp,StereoCamera:fg,StreamCopyUsage:rp,StreamDrawUsage:jf,StreamReadUsage:np,StringKeyframeTrack:Ni,SubtractEquation:vu,SubtractiveBlending:Dl,TOUCH:Tf,TangentSpaceNormalMap:ti,TetrahedronGeometry:Lo,Texture:_e,TextureLoader:rg,TextureUtils:u_,Timer:Og,TimestampQuery:op,TorusGeometry:Do,TorusKnotGeometry:Uo,Triangle:We,TriangleFanDrawMode:Nf,TriangleStripDrawMode:Uf,TrianglesDrawMode:Df,TubeGeometry:No,UVMapping:so,Uint16BufferAttribute:ac,Uint32BufferAttribute:oc,Uint8BufferAttribute:qp,Uint8ClampedBufferAttribute:Yp,Uniform:Ic,UniformsGroup:Dg,UniformsLib:ft,UniformsUtils:hd,UnsignedByteType:dn,UnsignedInt101111Type:Ql,UnsignedInt248Type:hs,UnsignedInt5999Type:Kl,UnsignedIntType:kn,UnsignedShort4444Type:ao,UnsignedShort5551Type:oo,UnsignedShortType:cs,VSMShadowMap:xn,Vector2:Q,Vector3:C,Vector4:te,VectorKeyframeTrack:lr,VideoFrameTexture:gm,VideoTexture:Sd,WebGL3DRenderTarget:Dp,WebGLArrayRenderTarget:Lp,WebGLCoordinateSystem:Qe,WebGLCubeRenderTarget:dd,WebGLRenderTarget:bn,WebGLRenderer:qy,WebGLUtils:_f,WebGPUCoordinateSystem:fs,WebXRController:pa,WireframeGeometry:Dd,WrapAroundEnding:js,ZeroCurvatureEnding:bi,ZeroFactor:bu,ZeroSlopeEnding:Ei,ZeroStencilOp:Bf,createCanvasElement:ad},Symbol.toStringTag,{value:"Module"}));export{Fg as $,jd as A,Xt as B,xt as C,Qd as D,tn as E,Mt as F,as as G,vs as H,rn as I,Fd as J,Yt as K,Ii as L,Ht as M,$s as N,ee as O,Te as P,qe as Q,Oe as R,fn as S,Ks as T,so as U,C as V,bn as W,Ss as X,fd as Y,go as Z,Zy as _,Ot as a,ug as a$,Tn as a0,ze as a1,vn as a2,xu as a3,ga as a4,_a as a5,kd as a6,we as a7,Ms as a8,Ku as a9,Xl as aA,qy as aB,hd as aC,Nd as aD,Kt as aE,re as aF,Bu as aG,zu as aH,ku as aI,Vu as aJ,Hu as aK,e_ as aL,hn as aM,ft as aN,sf as aO,Ug as aP,Pi as aQ,Dd as aR,Wg as aS,Ye as aT,Vn as aU,Df as aV,Nf as aW,Uf as aX,Hl as aY,gs as aZ,rg as a_,ti as aa,Ae as ab,yn as ac,Dn as ad,fo as ae,dn as af,_e as ag,ac as ah,cc as ai,_d as aj,yo as ak,vr as al,lr as am,Ig as an,cr as ao,Yu as ap,uc as aq,_u as ar,Fn as as,Fo as at,Wu as au,Gu as av,vc as aw,xd as ax,sg as ay,ec as az,Bn as b,mo as b$,vo as b0,ss as b1,ks as b2,Zl as b3,hc as b4,Le as b5,jt as b6,jn as b7,yd as b8,Md as b9,Ws as bA,Za as bB,Tc as bC,qg as bD,Td as bE,md as bF,gd as bG,Jd as bH,$g as bI,of as bJ,a_ as bK,Ef as bL,Tf as bM,zg as bN,ys as bO,ym as bP,zd as bQ,Ll as bR,Vd as bS,pr as bT,gr as bU,Do as bV,cg as bW,vd as bX,nf as bY,xo as bZ,_o as b_,Qs as ba,ja as bb,or as bc,xr as bd,vm as be,xm as bf,So as bg,Ca as bh,wa as bi,qa as bj,Ka as bk,Qa as bl,Ja as bm,$a as bn,Gs as bo,Vs as bp,Hs as bq,Fa as br,La as bs,Ia as bt,Pa as bu,tc as bv,Ql as bw,Kl as bx,Ta as by,Ra as bz,ye as c,qu as c0,Qf as c1,Ic as c2,We as c3,Lo as c4,bd as c5,Hd as c6,Io as c7,Qg as c8,Yg as c9,Pf as cA,ud as cB,Pc as cC,co as cD,Lp as cE,cs as cF,pn as cG,Od as cH,Zd as cI,Xg as ca,Jg as cb,jg as cc,mr as cd,lc as ce,t_ as cf,Eo as cg,ds as ch,hs as ci,kn as cj,Ju as ck,En as cl,Nn as cm,Yy as cn,va as co,$u as cp,ya as cq,yc as cr,Ma as cs,Ea as ct,ba as cu,Sa as cv,Ri as cw,xa as cx,ho as cy,dd as cz,_r as d,ei as e,Ge as f,Q as g,un as h,oe as i,Ap as j,te as k,Sn as l,Zs as m,Me as n,Kd as o,$d as p,tf as q,Gp as r,Jn as s,Pe as t,po as u,lo as v,Xe as w,Di as x,Be as y,Ol as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{eR as l,eS as u,I as d,eT as f,b7 as m}from"./index-Dm_h-T4x.js";function T(e,n){if(e.setTransformMode(n),n==="select")return;const r=[...e.selectedEntityIds];if(r.length===0)return;const a=l(e),s=((a===null?null:u(a)?.adapter)??d(e).adapter).transforms?.editability;if(!s)return;let t;for(const i of r){const o=f(c=>s(i,c));if(!o.locked)return;t??=o.reason}t&&m(t)}export{T as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./jsx-runtime-CAUTK36e.js";import{r as c}from"./index-DaQZGF7d.js";import"./index-CtzuWnCS.js";import{al as b,am as v,an as g,ao as r,ap as j,ak as t}from"./index-Dm_h-T4x.js";const S=[.25,.5,1,2];function y(a,l){const i=Math.round(a*l);return`${a.toFixed(2)}s · f${i}`}function E({transport:a}){const l=c.useSyncExternalStore(c.useCallback(e=>a?a.subscribe(e):()=>{},[a]),c.useCallback(()=>a?.snapshot()??null,[a]));if(!a||!l||l.activeSubject===null)return null;const i=l.driver==="world",n=l.playbackState==="playing",{start:x,end:h,fps:o,loop:m}=l.range,d=l.subjects.find(e=>e.id===l.activeSubject),p=l.subjects.length>1?l.subjects:null,u=a.activeClips();return s.jsxs("section",{"aria-label":"Transport","data-testid":"stage-transport-strip",style:{display:"flex",alignItems:"center",gap:"var(--vgai-space-2)",padding:"var(--vgai-space-1) var(--vgai-space-3)",borderTop:`var(--vgai-stroke-resting) solid ${b.boundary.default}`,background:b.surface.raised},children:[s.jsx(v,{size:"compact","aria-label":n?"Pause":"Play",disabled:i,onClick:()=>n?a.pause():a.play(),children:s.jsx(g,{icon:n?r.transport.pause:r.transport.play})}),s.jsx(v,{size:"compact","aria-label":"Stop",disabled:i,onClick:()=>a.stop(),children:s.jsx(g,{icon:r.transport.stop})}),s.jsx(j,{"aria-label":"Playhead",type:"range",min:x,max:h,step:1/o,value:l.time,disabled:i,onChange:e=>a.seek(Number(e.target.value)),style:{flex:1}}),s.jsx(t,{as:"span",variant:"caption",children:y(l.time,o)}),p?s.jsx("select",{"aria-label":"Subject",value:l.activeSubject,disabled:i,onChange:e=>a.setActiveSubject(e.target.value),children:p.map(e=>s.jsx("option",{value:e.id,children:e.label},e.id))}):null,u?s.jsx("select",{"aria-label":"Clip",disabled:i,onChange:e=>a.setActiveClip(e.target.value),children:u.map(e=>s.jsx("option",{value:e.id,children:e.label},e.id))}):null,s.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"var(--vgai-space-1)"},children:[s.jsx("input",{type:"checkbox",checked:m,disabled:i,onChange:e=>a.setLoop(e.target.checked)}),s.jsx(t,{as:"span",variant:"caption",children:"Loop"})]}),s.jsx("select",{"aria-label":"Speed",value:String(l.timeScale),disabled:i,onChange:e=>a.setTimeScale(Number(e.target.value)),children:S.map(e=>s.jsxs("option",{value:String(e),children:[e,"×"]},e))}),i?s.jsx(t,{as:"span",variant:"caption",children:"The world is driving time (Play); pause the game to scrub"}):d?s.jsx(t,{as:"span",variant:"caption",children:d.label}):null]})}export{E as T};
|
package/dist/assets/{vgai-shared-fontawesome-CFSkqz69.js → vgai-shared-fontawesome-2ZSGa7vM.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"./index-
|
|
1
|
+
import{_ as e}from"./index-jib6KJY8.js";import"./index-DaQZGF7d.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-CAUTK36e.js";const o=e,a=o.FontAwesomeIcon,c=o.FontAwesomeLayers,p=o.LayersCounter,y=o.LayersText;export{a as FontAwesomeIcon,c as FontAwesomeLayers,p as LayersCounter,y as LayersText,o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./jsx-runtime-CAUTK36e.js";import"./_commonjsHelpers-D6-XlEtG.js";function j(e,n,o,s){return s?t.jsxs(e,n,o):t.jsx(e,n,o)}const m=Object.freeze(Object.defineProperty({__proto__:null,Fragment:t.Fragment,jsxDEV:j},Symbol.toStringTag,{value:"Module"})),r=m,_=r.Fragment,c=r.jsxDEV;export{_ as Fragment,r as default,c as jsxDEV};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t,_ as n}from"./jsx-runtime-CAUTK36e.js";import"./_commonjsHelpers-D6-XlEtG.js";const s=t??n,m=s.Fragment,r=s.jsx,x=s.jsxs;export{m as Fragment,s as default,r as jsx,x as jsxs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,_ as r}from"./client-
|
|
1
|
+
import{c as t,_ as r}from"./client-mkWk8S65.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const o=t??r,n=o.createRoot,i=o.hydrateRoot,m=o.version;export{n as createRoot,o as default,i as hydrateRoot,m as version};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as t}from"./three.module-ZILb6uB7.js";const e=t,n=e.ACESFilmicToneMapping,r=e.AddEquation,a=e.AddOperation,c=e.AdditiveAnimationBlendMode,s=e.AdditiveBlending,i=e.AgXToneMapping,l=e.AlphaFormat,p=e.AlwaysCompare,m=e.AlwaysDepth,u=e.AlwaysStencilFunc,d=e.AmbientLight,C=e.AnimationAction,S=e.AnimationClip,T=e.AnimationLoader,g=e.AnimationMixer,M=e.AnimationObjectGroup,F=e.AnimationUtils,A=e.ArcCurve,G=e.ArrayCamera,h=e.ArrowHelper,B=e.AttachedBindMode,_=e.Audio,R=e.AudioAnalyser,L=e.AudioContext,y=e.AudioListener,D=e.AudioLoader,f=e.AxesHelper,E=e.BackSide,x=e.BasicDepthPacking,b=e.BasicShadowMap,P=e.BatchedMesh,I=e.Bone,U=e.BooleanKeyframeTrack,N=e.Box2,O=e.Box3,v=e.Box3Helper,k=e.BoxGeometry,q=e.BoxHelper,H=e.BufferAttribute,V=e.BufferGeometry,w=e.BufferGeometryLoader,W=e.ByteType,K=e.Cache,Q=e.Camera,X=e.CameraHelper,j=e.CanvasTexture,z=e.CapsuleGeometry,Z=e.CatmullRomCurve3,J=e.CineonToneMapping,Y=e.CircleGeometry,$=e.ClampToEdgeWrapping,ee=e.Clock,te=e.Color,oe=e.ColorKeyframeTrack,ne=e.ColorManagement,re=e.CompressedArrayTexture,ae=e.CompressedCubeTexture,ce=e.CompressedTexture,se=e.CompressedTextureLoader,ie=e.ConeGeometry,le=e.ConstantAlphaFactor,pe=e.ConstantColorFactor,me=e.Controls,ue=e.CubeCamera,de=e.CubeReflectionMapping,Ce=e.CubeRefractionMapping,Se=e.CubeTexture,Te=e.CubeTextureLoader,ge=e.CubeUVReflectionMapping,Me=e.CubicBezierCurve,Fe=e.CubicBezierCurve3,Ae=e.CubicInterpolant,Ge=e.CullFaceBack,he=e.CullFaceFront,Be=e.CullFaceFrontBack,_e=e.CullFaceNone,Re=e.Curve,Le=e.CurvePath,ye=e.CustomBlending,De=e.CustomToneMapping,fe=e.CylinderGeometry,Ee=e.Cylindrical,xe=e.Data3DTexture,be=e.DataArrayTexture,Pe=e.DataTexture,Ie=e.DataTextureLoader,Ue=e.DataUtils,Ne=e.DecrementStencilOp,Oe=e.DecrementWrapStencilOp,ve=e.DefaultLoadingManager,ke=e.DepthFormat,qe=e.DepthStencilFormat,He=e.DepthTexture,Ve=e.DetachedBindMode,we=e.DirectionalLight,We=e.DirectionalLightHelper,Ke=e.DiscreteInterpolant,Qe=e.DodecahedronGeometry,Xe=e.DoubleSide,je=e.DstAlphaFactor,ze=e.DstColorFactor,Ze=e.DynamicCopyUsage,Je=e.DynamicDrawUsage,Ye=e.DynamicReadUsage,$e=e.EdgesGeometry,et=e.EllipseCurve,tt=e.EqualCompare,ot=e.EqualDepth,nt=e.EqualStencilFunc,rt=e.EquirectangularReflectionMapping,at=e.EquirectangularRefractionMapping,ct=e.Euler,st=e.EventDispatcher,it=e.ExternalTexture,lt=e.ExtrudeGeometry,pt=e.FileLoader,mt=e.Float16BufferAttribute,ut=e.Float32BufferAttribute,dt=e.FloatType,Ct=e.Fog,St=e.FogExp2,Tt=e.FramebufferTexture,gt=e.FrontSide,Mt=e.Frustum,Ft=e.FrustumArray,At=e.GLBufferAttribute,Gt=e.GLSL1,ht=e.GLSL3,Bt=e.GreaterCompare,_t=e.GreaterDepth,Rt=e.GreaterEqualCompare,Lt=e.GreaterEqualDepth,yt=e.GreaterEqualStencilFunc,Dt=e.GreaterStencilFunc,ft=e.GridHelper,Et=e.Group,xt=e.HalfFloatType,bt=e.HemisphereLight,Pt=e.HemisphereLightHelper,It=e.IcosahedronGeometry,Ut=e.ImageBitmapLoader,Nt=e.ImageLoader,Ot=e.ImageUtils,vt=e.IncrementStencilOp,kt=e.IncrementWrapStencilOp,qt=e.InstancedBufferAttribute,Ht=e.InstancedBufferGeometry,Vt=e.InstancedInterleavedBuffer,wt=e.InstancedMesh,Wt=e.Int16BufferAttribute,Kt=e.Int32BufferAttribute,Qt=e.Int8BufferAttribute,Xt=e.IntType,jt=e.InterleavedBuffer,zt=e.InterleavedBufferAttribute,Zt=e.Interpolant,Jt=e.InterpolateDiscrete,Yt=e.InterpolateLinear,$t=e.InterpolateSmooth,eo=e.InterpolationSamplingMode,to=e.InterpolationSamplingType,oo=e.InvertStencilOp,no=e.KeepStencilOp,ro=e.KeyframeTrack,ao=e.LOD,co=e.LatheGeometry,so=e.Layers,io=e.LessCompare,lo=e.LessDepth,po=e.LessEqualCompare,mo=e.LessEqualDepth,uo=e.LessEqualStencilFunc,Co=e.LessStencilFunc,So=e.Light,To=e.LightProbe,go=e.Line,Mo=e.Line3,Fo=e.LineBasicMaterial,Ao=e.LineCurve,Go=e.LineCurve3,ho=e.LineDashedMaterial,Bo=e.LineLoop,_o=e.LineSegments,Ro=e.LinearFilter,Lo=e.LinearInterpolant,yo=e.LinearMipMapLinearFilter,Do=e.LinearMipMapNearestFilter,fo=e.LinearMipmapLinearFilter,Eo=e.LinearMipmapNearestFilter,xo=e.LinearSRGBColorSpace,bo=e.LinearToneMapping,Po=e.LinearTransfer,Io=e.Loader,Uo=e.LoaderUtils,No=e.LoadingManager,Oo=e.LoopOnce,vo=e.LoopPingPong,ko=e.LoopRepeat,qo=e.MOUSE,Ho=e.Material,Vo=e.MaterialLoader,wo=e.MathUtils,Wo=e.Matrix2,Ko=e.Matrix3,Qo=e.Matrix4,Xo=e.MaxEquation,jo=e.Mesh,zo=e.MeshBasicMaterial,Zo=e.MeshDepthMaterial,Jo=e.MeshDistanceMaterial,Yo=e.MeshLambertMaterial,$o=e.MeshMatcapMaterial,en=e.MeshNormalMaterial,tn=e.MeshPhongMaterial,on=e.MeshPhysicalMaterial,nn=e.MeshStandardMaterial,rn=e.MeshToonMaterial,an=e.MinEquation,cn=e.MirroredRepeatWrapping,sn=e.MixOperation,ln=e.MultiplyBlending,pn=e.MultiplyOperation,mn=e.NearestFilter,un=e.NearestMipMapLinearFilter,dn=e.NearestMipMapNearestFilter,Cn=e.NearestMipmapLinearFilter,Sn=e.NearestMipmapNearestFilter,Tn=e.NeutralToneMapping,gn=e.NeverCompare,Mn=e.NeverDepth,Fn=e.NeverStencilFunc,An=e.NoBlending,Gn=e.NoColorSpace,hn=e.NoToneMapping,Bn=e.NormalAnimationBlendMode,_n=e.NormalBlending,Rn=e.NotEqualCompare,Ln=e.NotEqualDepth,yn=e.NotEqualStencilFunc,Dn=e.NumberKeyframeTrack,fn=e.Object3D,En=e.ObjectLoader,xn=e.ObjectSpaceNormalMap,bn=e.OctahedronGeometry,Pn=e.OneFactor,In=e.OneMinusConstantAlphaFactor,Un=e.OneMinusConstantColorFactor,Nn=e.OneMinusDstAlphaFactor,On=e.OneMinusDstColorFactor,vn=e.OneMinusSrcAlphaFactor,kn=e.OneMinusSrcColorFactor,qn=e.OrthographicCamera,Hn=e.PCFShadowMap,Vn=e.PCFSoftShadowMap,wn=e.PMREMGenerator,Wn=e.Path,Kn=e.PerspectiveCamera,Qn=e.Plane,Xn=e.PlaneGeometry,jn=e.PlaneHelper,zn=e.PointLight,Zn=e.PointLightHelper,Jn=e.Points,Yn=e.PointsMaterial,$n=e.PolarGridHelper,er=e.PolyhedronGeometry,tr=e.PositionalAudio,or=e.PropertyBinding,nr=e.PropertyMixer,rr=e.QuadraticBezierCurve,ar=e.QuadraticBezierCurve3,cr=e.Quaternion,sr=e.QuaternionKeyframeTrack,ir=e.QuaternionLinearInterpolant,lr=e.RED_GREEN_RGTC2_Format,pr=e.RED_RGTC1_Format,mr=e.REVISION,ur=e.RGBADepthPacking,dr=e.RGBAFormat,Cr=e.RGBAIntegerFormat,Sr=e.RGBA_ASTC_10x10_Format,Tr=e.RGBA_ASTC_10x5_Format,gr=e.RGBA_ASTC_10x6_Format,Mr=e.RGBA_ASTC_10x8_Format,Fr=e.RGBA_ASTC_12x10_Format,Ar=e.RGBA_ASTC_12x12_Format,Gr=e.RGBA_ASTC_4x4_Format,hr=e.RGBA_ASTC_5x4_Format,Br=e.RGBA_ASTC_5x5_Format,_r=e.RGBA_ASTC_6x5_Format,Rr=e.RGBA_ASTC_6x6_Format,Lr=e.RGBA_ASTC_8x5_Format,yr=e.RGBA_ASTC_8x6_Format,Dr=e.RGBA_ASTC_8x8_Format,fr=e.RGBA_BPTC_Format,Er=e.RGBA_ETC2_EAC_Format,xr=e.RGBA_PVRTC_2BPPV1_Format,br=e.RGBA_PVRTC_4BPPV1_Format,Pr=e.RGBA_S3TC_DXT1_Format,Ir=e.RGBA_S3TC_DXT3_Format,Ur=e.RGBA_S3TC_DXT5_Format,Nr=e.RGBDepthPacking,Or=e.RGBFormat,vr=e.RGBIntegerFormat,kr=e.RGB_BPTC_SIGNED_Format,qr=e.RGB_BPTC_UNSIGNED_Format,Hr=e.RGB_ETC1_Format,Vr=e.RGB_ETC2_Format,wr=e.RGB_PVRTC_2BPPV1_Format,Wr=e.RGB_PVRTC_4BPPV1_Format,Kr=e.RGB_S3TC_DXT1_Format,Qr=e.RGDepthPacking,Xr=e.RGFormat,jr=e.RGIntegerFormat,zr=e.RawShaderMaterial,Zr=e.Ray,Jr=e.Raycaster,Yr=e.RectAreaLight,$r=e.RedFormat,ea=e.RedIntegerFormat,ta=e.ReinhardToneMapping,oa=e.RenderTarget,na=e.RenderTarget3D,ra=e.RepeatWrapping,aa=e.ReplaceStencilOp,ca=e.ReverseSubtractEquation,sa=e.RingGeometry,ia=e.SIGNED_RED_GREEN_RGTC2_Format,la=e.SIGNED_RED_RGTC1_Format,pa=e.SRGBColorSpace,ma=e.SRGBTransfer,ua=e.Scene,da=e.ShaderChunk,Ca=e.ShaderLib,Sa=e.ShaderMaterial,Ta=e.ShadowMaterial,ga=e.Shape,Ma=e.ShapeGeometry,Fa=e.ShapePath,Aa=e.ShapeUtils,Ga=e.ShortType,ha=e.Skeleton,Ba=e.SkeletonHelper,_a=e.SkinnedMesh,Ra=e.Source,La=e.Sphere,ya=e.SphereGeometry,Da=e.Spherical,fa=e.SphericalHarmonics3,Ea=e.SplineCurve,xa=e.SpotLight,ba=e.SpotLightHelper,Pa=e.Sprite,Ia=e.SpriteMaterial,Ua=e.SrcAlphaFactor,Na=e.SrcAlphaSaturateFactor,Oa=e.SrcColorFactor,va=e.StaticCopyUsage,ka=e.StaticDrawUsage,qa=e.StaticReadUsage,Ha=e.StereoCamera,Va=e.StreamCopyUsage,wa=e.StreamDrawUsage,Wa=e.StreamReadUsage,Ka=e.StringKeyframeTrack,Qa=e.SubtractEquation,Xa=e.SubtractiveBlending,ja=e.TOUCH,za=e.TangentSpaceNormalMap,Za=e.TetrahedronGeometry,Ja=e.Texture,Ya=e.TextureLoader,$a=e.TextureUtils,ec=e.Timer,tc=e.TimestampQuery,oc=e.TorusGeometry,nc=e.TorusKnotGeometry,rc=e.Triangle,ac=e.TriangleFanDrawMode,cc=e.TriangleStripDrawMode,sc=e.TrianglesDrawMode,ic=e.TubeGeometry,lc=e.UVMapping,pc=e.Uint16BufferAttribute,mc=e.Uint32BufferAttribute,uc=e.Uint8BufferAttribute,dc=e.Uint8ClampedBufferAttribute,Cc=e.Uniform,Sc=e.UniformsGroup,Tc=e.UniformsLib,gc=e.UniformsUtils,Mc=e.UnsignedByteType,Fc=e.UnsignedInt101111Type,Ac=e.UnsignedInt248Type,Gc=e.UnsignedInt5999Type,hc=e.UnsignedIntType,Bc=e.UnsignedShort4444Type,_c=e.UnsignedShort5551Type,Rc=e.UnsignedShortType,Lc=e.VSMShadowMap,yc=e.Vector2,Dc=e.Vector3,fc=e.Vector4,Ec=e.VectorKeyframeTrack,xc=e.VideoFrameTexture,bc=e.VideoTexture,Pc=e.WebGL3DRenderTarget,Ic=e.WebGLArrayRenderTarget,Uc=e.WebGLCoordinateSystem,Nc=e.WebGLCubeRenderTarget,Oc=e.WebGLRenderTarget,vc=e.WebGLRenderer,kc=e.WebGLUtils,qc=e.WebGPUCoordinateSystem,Hc=e.WebXRController,Vc=e.WireframeGeometry,wc=e.WrapAroundEnding,Wc=e.ZeroCurvatureEnding,Kc=e.ZeroFactor,Qc=e.ZeroSlopeEnding,Xc=e.ZeroStencilOp,jc=e.createCanvasElement;export{n as ACESFilmicToneMapping,r as AddEquation,a as AddOperation,c as AdditiveAnimationBlendMode,s as AdditiveBlending,i as AgXToneMapping,l as AlphaFormat,p as AlwaysCompare,m as AlwaysDepth,u as AlwaysStencilFunc,d as AmbientLight,C as AnimationAction,S as AnimationClip,T as AnimationLoader,g as AnimationMixer,M as AnimationObjectGroup,F as AnimationUtils,A as ArcCurve,G as ArrayCamera,h as ArrowHelper,B as AttachedBindMode,_ as Audio,R as AudioAnalyser,L as AudioContext,y as AudioListener,D as AudioLoader,f as AxesHelper,E as BackSide,x as BasicDepthPacking,b as BasicShadowMap,P as BatchedMesh,I as Bone,U as BooleanKeyframeTrack,N as Box2,O as Box3,v as Box3Helper,k as BoxGeometry,q as BoxHelper,H as BufferAttribute,V as BufferGeometry,w as BufferGeometryLoader,W as ByteType,K as Cache,Q as Camera,X as CameraHelper,j as CanvasTexture,z as CapsuleGeometry,Z as CatmullRomCurve3,J as CineonToneMapping,Y as CircleGeometry,$ as ClampToEdgeWrapping,ee as Clock,te as Color,oe as ColorKeyframeTrack,ne as ColorManagement,re as CompressedArrayTexture,ae as CompressedCubeTexture,ce as CompressedTexture,se as CompressedTextureLoader,ie as ConeGeometry,le as ConstantAlphaFactor,pe as ConstantColorFactor,me as Controls,ue as CubeCamera,de as CubeReflectionMapping,Ce as CubeRefractionMapping,Se as CubeTexture,Te as CubeTextureLoader,ge as CubeUVReflectionMapping,Me as CubicBezierCurve,Fe as CubicBezierCurve3,Ae as CubicInterpolant,Ge as CullFaceBack,he as CullFaceFront,Be as CullFaceFrontBack,_e as CullFaceNone,Re as Curve,Le as CurvePath,ye as CustomBlending,De as CustomToneMapping,fe as CylinderGeometry,Ee as Cylindrical,xe as Data3DTexture,be as DataArrayTexture,Pe as DataTexture,Ie as DataTextureLoader,Ue as DataUtils,Ne as DecrementStencilOp,Oe as DecrementWrapStencilOp,ve as DefaultLoadingManager,ke as DepthFormat,qe as DepthStencilFormat,He as DepthTexture,Ve as DetachedBindMode,we as DirectionalLight,We as DirectionalLightHelper,Ke as DiscreteInterpolant,Qe as DodecahedronGeometry,Xe as DoubleSide,je as DstAlphaFactor,ze as DstColorFactor,Ze as DynamicCopyUsage,Je as DynamicDrawUsage,Ye as DynamicReadUsage,$e as EdgesGeometry,et as EllipseCurve,tt as EqualCompare,ot as EqualDepth,nt as EqualStencilFunc,rt as EquirectangularReflectionMapping,at as EquirectangularRefractionMapping,ct as Euler,st as EventDispatcher,it as ExternalTexture,lt as ExtrudeGeometry,pt as FileLoader,mt as Float16BufferAttribute,ut as Float32BufferAttribute,dt as FloatType,Ct as Fog,St as FogExp2,Tt as FramebufferTexture,gt as FrontSide,Mt as Frustum,Ft as FrustumArray,At as GLBufferAttribute,Gt as GLSL1,ht as GLSL3,Bt as GreaterCompare,_t as GreaterDepth,Rt as GreaterEqualCompare,Lt as GreaterEqualDepth,yt as GreaterEqualStencilFunc,Dt as GreaterStencilFunc,ft as GridHelper,Et as Group,xt as HalfFloatType,bt as HemisphereLight,Pt as HemisphereLightHelper,It as IcosahedronGeometry,Ut as ImageBitmapLoader,Nt as ImageLoader,Ot as ImageUtils,vt as IncrementStencilOp,kt as IncrementWrapStencilOp,qt as InstancedBufferAttribute,Ht as InstancedBufferGeometry,Vt as InstancedInterleavedBuffer,wt as InstancedMesh,Wt as Int16BufferAttribute,Kt as Int32BufferAttribute,Qt as Int8BufferAttribute,Xt as IntType,jt as InterleavedBuffer,zt as InterleavedBufferAttribute,Zt as Interpolant,Jt as InterpolateDiscrete,Yt as InterpolateLinear,$t as InterpolateSmooth,eo as InterpolationSamplingMode,to as InterpolationSamplingType,oo as InvertStencilOp,no as KeepStencilOp,ro as KeyframeTrack,ao as LOD,co as LatheGeometry,so as Layers,io as LessCompare,lo as LessDepth,po as LessEqualCompare,mo as LessEqualDepth,uo as LessEqualStencilFunc,Co as LessStencilFunc,So as Light,To as LightProbe,go as Line,Mo as Line3,Fo as LineBasicMaterial,Ao as LineCurve,Go as LineCurve3,ho as LineDashedMaterial,Bo as LineLoop,_o as LineSegments,Ro as LinearFilter,Lo as LinearInterpolant,yo as LinearMipMapLinearFilter,Do as LinearMipMapNearestFilter,fo as LinearMipmapLinearFilter,Eo as LinearMipmapNearestFilter,xo as LinearSRGBColorSpace,bo as LinearToneMapping,Po as LinearTransfer,Io as Loader,Uo as LoaderUtils,No as LoadingManager,Oo as LoopOnce,vo as LoopPingPong,ko as LoopRepeat,qo as MOUSE,Ho as Material,Vo as MaterialLoader,wo as MathUtils,Wo as Matrix2,Ko as Matrix3,Qo as Matrix4,Xo as MaxEquation,jo as Mesh,zo as MeshBasicMaterial,Zo as MeshDepthMaterial,Jo as MeshDistanceMaterial,Yo as MeshLambertMaterial,$o as MeshMatcapMaterial,en as MeshNormalMaterial,tn as MeshPhongMaterial,on as MeshPhysicalMaterial,nn as MeshStandardMaterial,rn as MeshToonMaterial,an as MinEquation,cn as MirroredRepeatWrapping,sn as MixOperation,ln as MultiplyBlending,pn as MultiplyOperation,mn as NearestFilter,un as NearestMipMapLinearFilter,dn as NearestMipMapNearestFilter,Cn as NearestMipmapLinearFilter,Sn as NearestMipmapNearestFilter,Tn as NeutralToneMapping,gn as NeverCompare,Mn as NeverDepth,Fn as NeverStencilFunc,An as NoBlending,Gn as NoColorSpace,hn as NoToneMapping,Bn as NormalAnimationBlendMode,_n as NormalBlending,Rn as NotEqualCompare,Ln as NotEqualDepth,yn as NotEqualStencilFunc,Dn as NumberKeyframeTrack,fn as Object3D,En as ObjectLoader,xn as ObjectSpaceNormalMap,bn as OctahedronGeometry,Pn as OneFactor,In as OneMinusConstantAlphaFactor,Un as OneMinusConstantColorFactor,Nn as OneMinusDstAlphaFactor,On as OneMinusDstColorFactor,vn as OneMinusSrcAlphaFactor,kn as OneMinusSrcColorFactor,qn as OrthographicCamera,Hn as PCFShadowMap,Vn as PCFSoftShadowMap,wn as PMREMGenerator,Wn as Path,Kn as PerspectiveCamera,Qn as Plane,Xn as PlaneGeometry,jn as PlaneHelper,zn as PointLight,Zn as PointLightHelper,Jn as Points,Yn as PointsMaterial,$n as PolarGridHelper,er as PolyhedronGeometry,tr as PositionalAudio,or as PropertyBinding,nr as PropertyMixer,rr as QuadraticBezierCurve,ar as QuadraticBezierCurve3,cr as Quaternion,sr as QuaternionKeyframeTrack,ir as QuaternionLinearInterpolant,lr as RED_GREEN_RGTC2_Format,pr as RED_RGTC1_Format,mr as REVISION,ur as RGBADepthPacking,dr as RGBAFormat,Cr as RGBAIntegerFormat,Sr as RGBA_ASTC_10x10_Format,Tr as RGBA_ASTC_10x5_Format,gr as RGBA_ASTC_10x6_Format,Mr as RGBA_ASTC_10x8_Format,Fr as RGBA_ASTC_12x10_Format,Ar as RGBA_ASTC_12x12_Format,Gr as RGBA_ASTC_4x4_Format,hr as RGBA_ASTC_5x4_Format,Br as RGBA_ASTC_5x5_Format,_r as RGBA_ASTC_6x5_Format,Rr as RGBA_ASTC_6x6_Format,Lr as RGBA_ASTC_8x5_Format,yr as RGBA_ASTC_8x6_Format,Dr as RGBA_ASTC_8x8_Format,fr as RGBA_BPTC_Format,Er as RGBA_ETC2_EAC_Format,xr as RGBA_PVRTC_2BPPV1_Format,br as RGBA_PVRTC_4BPPV1_Format,Pr as RGBA_S3TC_DXT1_Format,Ir as RGBA_S3TC_DXT3_Format,Ur as RGBA_S3TC_DXT5_Format,Nr as RGBDepthPacking,Or as RGBFormat,vr as RGBIntegerFormat,kr as RGB_BPTC_SIGNED_Format,qr as RGB_BPTC_UNSIGNED_Format,Hr as RGB_ETC1_Format,Vr as RGB_ETC2_Format,wr as RGB_PVRTC_2BPPV1_Format,Wr as RGB_PVRTC_4BPPV1_Format,Kr as RGB_S3TC_DXT1_Format,Qr as RGDepthPacking,Xr as RGFormat,jr as RGIntegerFormat,zr as RawShaderMaterial,Zr as Ray,Jr as Raycaster,Yr as RectAreaLight,$r as RedFormat,ea as RedIntegerFormat,ta as ReinhardToneMapping,oa as RenderTarget,na as RenderTarget3D,ra as RepeatWrapping,aa as ReplaceStencilOp,ca as ReverseSubtractEquation,sa as RingGeometry,ia as SIGNED_RED_GREEN_RGTC2_Format,la as SIGNED_RED_RGTC1_Format,pa as SRGBColorSpace,ma as SRGBTransfer,ua as Scene,da as ShaderChunk,Ca as ShaderLib,Sa as ShaderMaterial,Ta as ShadowMaterial,ga as Shape,Ma as ShapeGeometry,Fa as ShapePath,Aa as ShapeUtils,Ga as ShortType,ha as Skeleton,Ba as SkeletonHelper,_a as SkinnedMesh,Ra as Source,La as Sphere,ya as SphereGeometry,Da as Spherical,fa as SphericalHarmonics3,Ea as SplineCurve,xa as SpotLight,ba as SpotLightHelper,Pa as Sprite,Ia as SpriteMaterial,Ua as SrcAlphaFactor,Na as SrcAlphaSaturateFactor,Oa as SrcColorFactor,va as StaticCopyUsage,ka as StaticDrawUsage,qa as StaticReadUsage,Ha as StereoCamera,Va as StreamCopyUsage,wa as StreamDrawUsage,Wa as StreamReadUsage,Ka as StringKeyframeTrack,Qa as SubtractEquation,Xa as SubtractiveBlending,ja as TOUCH,za as TangentSpaceNormalMap,Za as TetrahedronGeometry,Ja as Texture,Ya as TextureLoader,$a as TextureUtils,ec as Timer,tc as TimestampQuery,oc as TorusGeometry,nc as TorusKnotGeometry,rc as Triangle,ac as TriangleFanDrawMode,cc as TriangleStripDrawMode,sc as TrianglesDrawMode,ic as TubeGeometry,lc as UVMapping,pc as Uint16BufferAttribute,mc as Uint32BufferAttribute,uc as Uint8BufferAttribute,dc as Uint8ClampedBufferAttribute,Cc as Uniform,Sc as UniformsGroup,Tc as UniformsLib,gc as UniformsUtils,Mc as UnsignedByteType,Fc as UnsignedInt101111Type,Ac as UnsignedInt248Type,Gc as UnsignedInt5999Type,hc as UnsignedIntType,Bc as UnsignedShort4444Type,_c as UnsignedShort5551Type,Rc as UnsignedShortType,Lc as VSMShadowMap,yc as Vector2,Dc as Vector3,fc as Vector4,Ec as VectorKeyframeTrack,xc as VideoFrameTexture,bc as VideoTexture,Pc as WebGL3DRenderTarget,Ic as WebGLArrayRenderTarget,Uc as WebGLCoordinateSystem,Nc as WebGLCubeRenderTarget,Oc as WebGLRenderTarget,vc as WebGLRenderer,kc as WebGLUtils,qc as WebGPUCoordinateSystem,Hc as WebXRController,Vc as WireframeGeometry,wc as WrapAroundEnding,Wc as ZeroCurvatureEnding,Kc as ZeroFactor,Qc as ZeroSlopeEnding,Xc as ZeroStencilOp,jc as createCanvasElement,e as default};
|
|
1
|
+
import{_ as t}from"./three.module-CrYDk-Xr.js";const e=t,n=e.ACESFilmicToneMapping,r=e.AddEquation,a=e.AddOperation,c=e.AdditiveAnimationBlendMode,s=e.AdditiveBlending,i=e.AgXToneMapping,l=e.AlphaFormat,p=e.AlwaysCompare,m=e.AlwaysDepth,u=e.AlwaysStencilFunc,d=e.AmbientLight,C=e.AnimationAction,S=e.AnimationClip,T=e.AnimationLoader,g=e.AnimationMixer,M=e.AnimationObjectGroup,F=e.AnimationUtils,A=e.ArcCurve,G=e.ArrayCamera,h=e.ArrowHelper,_=e.AttachedBindMode,B=e.Audio,R=e.AudioAnalyser,L=e.AudioContext,y=e.AudioListener,D=e.AudioLoader,f=e.AxesHelper,E=e.BackSide,x=e.BasicDepthPacking,b=e.BasicShadowMap,P=e.BatchedMesh,I=e.Bone,U=e.BooleanKeyframeTrack,N=e.Box2,O=e.Box3,v=e.Box3Helper,k=e.BoxGeometry,q=e.BoxHelper,H=e.BufferAttribute,V=e.BufferGeometry,w=e.BufferGeometryLoader,W=e.ByteType,K=e.Cache,Q=e.Camera,X=e.CameraHelper,j=e.CanvasTexture,z=e.CapsuleGeometry,Z=e.CatmullRomCurve3,J=e.CineonToneMapping,Y=e.CircleGeometry,$=e.ClampToEdgeWrapping,ee=e.Clock,te=e.Color,oe=e.ColorKeyframeTrack,ne=e.ColorManagement,re=e.CompressedArrayTexture,ae=e.CompressedCubeTexture,ce=e.CompressedTexture,se=e.CompressedTextureLoader,ie=e.ConeGeometry,le=e.ConstantAlphaFactor,pe=e.ConstantColorFactor,me=e.Controls,ue=e.CubeCamera,de=e.CubeReflectionMapping,Ce=e.CubeRefractionMapping,Se=e.CubeTexture,Te=e.CubeTextureLoader,ge=e.CubeUVReflectionMapping,Me=e.CubicBezierCurve,Fe=e.CubicBezierCurve3,Ae=e.CubicInterpolant,Ge=e.CullFaceBack,he=e.CullFaceFront,_e=e.CullFaceFrontBack,Be=e.CullFaceNone,Re=e.Curve,Le=e.CurvePath,ye=e.CustomBlending,De=e.CustomToneMapping,fe=e.CylinderGeometry,Ee=e.Cylindrical,xe=e.Data3DTexture,be=e.DataArrayTexture,Pe=e.DataTexture,Ie=e.DataTextureLoader,Ue=e.DataUtils,Ne=e.DecrementStencilOp,Oe=e.DecrementWrapStencilOp,ve=e.DefaultLoadingManager,ke=e.DepthFormat,qe=e.DepthStencilFormat,He=e.DepthTexture,Ve=e.DetachedBindMode,we=e.DirectionalLight,We=e.DirectionalLightHelper,Ke=e.DiscreteInterpolant,Qe=e.DodecahedronGeometry,Xe=e.DoubleSide,je=e.DstAlphaFactor,ze=e.DstColorFactor,Ze=e.DynamicCopyUsage,Je=e.DynamicDrawUsage,Ye=e.DynamicReadUsage,$e=e.EdgesGeometry,et=e.EllipseCurve,tt=e.EqualCompare,ot=e.EqualDepth,nt=e.EqualStencilFunc,rt=e.EquirectangularReflectionMapping,at=e.EquirectangularRefractionMapping,ct=e.Euler,st=e.EventDispatcher,it=e.ExternalTexture,lt=e.ExtrudeGeometry,pt=e.FileLoader,mt=e.Float16BufferAttribute,ut=e.Float32BufferAttribute,dt=e.FloatType,Ct=e.Fog,St=e.FogExp2,Tt=e.FramebufferTexture,gt=e.FrontSide,Mt=e.Frustum,Ft=e.FrustumArray,At=e.GLBufferAttribute,Gt=e.GLSL1,ht=e.GLSL3,_t=e.GreaterCompare,Bt=e.GreaterDepth,Rt=e.GreaterEqualCompare,Lt=e.GreaterEqualDepth,yt=e.GreaterEqualStencilFunc,Dt=e.GreaterStencilFunc,ft=e.GridHelper,Et=e.Group,xt=e.HalfFloatType,bt=e.HemisphereLight,Pt=e.HemisphereLightHelper,It=e.IcosahedronGeometry,Ut=e.ImageBitmapLoader,Nt=e.ImageLoader,Ot=e.ImageUtils,vt=e.IncrementStencilOp,kt=e.IncrementWrapStencilOp,qt=e.InstancedBufferAttribute,Ht=e.InstancedBufferGeometry,Vt=e.InstancedInterleavedBuffer,wt=e.InstancedMesh,Wt=e.Int16BufferAttribute,Kt=e.Int32BufferAttribute,Qt=e.Int8BufferAttribute,Xt=e.IntType,jt=e.InterleavedBuffer,zt=e.InterleavedBufferAttribute,Zt=e.Interpolant,Jt=e.InterpolateDiscrete,Yt=e.InterpolateLinear,$t=e.InterpolateSmooth,eo=e.InterpolationSamplingMode,to=e.InterpolationSamplingType,oo=e.InvertStencilOp,no=e.KeepStencilOp,ro=e.KeyframeTrack,ao=e.LOD,co=e.LatheGeometry,so=e.Layers,io=e.LessCompare,lo=e.LessDepth,po=e.LessEqualCompare,mo=e.LessEqualDepth,uo=e.LessEqualStencilFunc,Co=e.LessStencilFunc,So=e.Light,To=e.LightProbe,go=e.Line,Mo=e.Line3,Fo=e.LineBasicMaterial,Ao=e.LineCurve,Go=e.LineCurve3,ho=e.LineDashedMaterial,_o=e.LineLoop,Bo=e.LineSegments,Ro=e.LinearFilter,Lo=e.LinearInterpolant,yo=e.LinearMipMapLinearFilter,Do=e.LinearMipMapNearestFilter,fo=e.LinearMipmapLinearFilter,Eo=e.LinearMipmapNearestFilter,xo=e.LinearSRGBColorSpace,bo=e.LinearToneMapping,Po=e.LinearTransfer,Io=e.Loader,Uo=e.LoaderUtils,No=e.LoadingManager,Oo=e.LoopOnce,vo=e.LoopPingPong,ko=e.LoopRepeat,qo=e.MOUSE,Ho=e.Material,Vo=e.MaterialLoader,wo=e.MathUtils,Wo=e.Matrix2,Ko=e.Matrix3,Qo=e.Matrix4,Xo=e.MaxEquation,jo=e.Mesh,zo=e.MeshBasicMaterial,Zo=e.MeshDepthMaterial,Jo=e.MeshDistanceMaterial,Yo=e.MeshLambertMaterial,$o=e.MeshMatcapMaterial,en=e.MeshNormalMaterial,tn=e.MeshPhongMaterial,on=e.MeshPhysicalMaterial,nn=e.MeshStandardMaterial,rn=e.MeshToonMaterial,an=e.MinEquation,cn=e.MirroredRepeatWrapping,sn=e.MixOperation,ln=e.MultiplyBlending,pn=e.MultiplyOperation,mn=e.NearestFilter,un=e.NearestMipMapLinearFilter,dn=e.NearestMipMapNearestFilter,Cn=e.NearestMipmapLinearFilter,Sn=e.NearestMipmapNearestFilter,Tn=e.NeutralToneMapping,gn=e.NeverCompare,Mn=e.NeverDepth,Fn=e.NeverStencilFunc,An=e.NoBlending,Gn=e.NoColorSpace,hn=e.NoToneMapping,_n=e.NormalAnimationBlendMode,Bn=e.NormalBlending,Rn=e.NotEqualCompare,Ln=e.NotEqualDepth,yn=e.NotEqualStencilFunc,Dn=e.NumberKeyframeTrack,fn=e.Object3D,En=e.ObjectLoader,xn=e.ObjectSpaceNormalMap,bn=e.OctahedronGeometry,Pn=e.OneFactor,In=e.OneMinusConstantAlphaFactor,Un=e.OneMinusConstantColorFactor,Nn=e.OneMinusDstAlphaFactor,On=e.OneMinusDstColorFactor,vn=e.OneMinusSrcAlphaFactor,kn=e.OneMinusSrcColorFactor,qn=e.OrthographicCamera,Hn=e.PCFShadowMap,Vn=e.PCFSoftShadowMap,wn=e.PMREMGenerator,Wn=e.Path,Kn=e.PerspectiveCamera,Qn=e.Plane,Xn=e.PlaneGeometry,jn=e.PlaneHelper,zn=e.PointLight,Zn=e.PointLightHelper,Jn=e.Points,Yn=e.PointsMaterial,$n=e.PolarGridHelper,er=e.PolyhedronGeometry,tr=e.PositionalAudio,or=e.PropertyBinding,nr=e.PropertyMixer,rr=e.QuadraticBezierCurve,ar=e.QuadraticBezierCurve3,cr=e.Quaternion,sr=e.QuaternionKeyframeTrack,ir=e.QuaternionLinearInterpolant,lr=e.RED_GREEN_RGTC2_Format,pr=e.RED_RGTC1_Format,mr=e.REVISION,ur=e.RGBADepthPacking,dr=e.RGBAFormat,Cr=e.RGBAIntegerFormat,Sr=e.RGBA_ASTC_10x10_Format,Tr=e.RGBA_ASTC_10x5_Format,gr=e.RGBA_ASTC_10x6_Format,Mr=e.RGBA_ASTC_10x8_Format,Fr=e.RGBA_ASTC_12x10_Format,Ar=e.RGBA_ASTC_12x12_Format,Gr=e.RGBA_ASTC_4x4_Format,hr=e.RGBA_ASTC_5x4_Format,_r=e.RGBA_ASTC_5x5_Format,Br=e.RGBA_ASTC_6x5_Format,Rr=e.RGBA_ASTC_6x6_Format,Lr=e.RGBA_ASTC_8x5_Format,yr=e.RGBA_ASTC_8x6_Format,Dr=e.RGBA_ASTC_8x8_Format,fr=e.RGBA_BPTC_Format,Er=e.RGBA_ETC2_EAC_Format,xr=e.RGBA_PVRTC_2BPPV1_Format,br=e.RGBA_PVRTC_4BPPV1_Format,Pr=e.RGBA_S3TC_DXT1_Format,Ir=e.RGBA_S3TC_DXT3_Format,Ur=e.RGBA_S3TC_DXT5_Format,Nr=e.RGBDepthPacking,Or=e.RGBFormat,vr=e.RGBIntegerFormat,kr=e.RGB_BPTC_SIGNED_Format,qr=e.RGB_BPTC_UNSIGNED_Format,Hr=e.RGB_ETC1_Format,Vr=e.RGB_ETC2_Format,wr=e.RGB_PVRTC_2BPPV1_Format,Wr=e.RGB_PVRTC_4BPPV1_Format,Kr=e.RGB_S3TC_DXT1_Format,Qr=e.RGDepthPacking,Xr=e.RGFormat,jr=e.RGIntegerFormat,zr=e.RawShaderMaterial,Zr=e.Ray,Jr=e.Raycaster,Yr=e.RectAreaLight,$r=e.RedFormat,ea=e.RedIntegerFormat,ta=e.ReinhardToneMapping,oa=e.RenderTarget,na=e.RenderTarget3D,ra=e.RepeatWrapping,aa=e.ReplaceStencilOp,ca=e.ReverseSubtractEquation,sa=e.RingGeometry,ia=e.SIGNED_RED_GREEN_RGTC2_Format,la=e.SIGNED_RED_RGTC1_Format,pa=e.SRGBColorSpace,ma=e.SRGBTransfer,ua=e.Scene,da=e.ShaderChunk,Ca=e.ShaderLib,Sa=e.ShaderMaterial,Ta=e.ShadowMaterial,ga=e.Shape,Ma=e.ShapeGeometry,Fa=e.ShapePath,Aa=e.ShapeUtils,Ga=e.ShortType,ha=e.Skeleton,_a=e.SkeletonHelper,Ba=e.SkinnedMesh,Ra=e.Source,La=e.Sphere,ya=e.SphereGeometry,Da=e.Spherical,fa=e.SphericalHarmonics3,Ea=e.SplineCurve,xa=e.SpotLight,ba=e.SpotLightHelper,Pa=e.Sprite,Ia=e.SpriteMaterial,Ua=e.SrcAlphaFactor,Na=e.SrcAlphaSaturateFactor,Oa=e.SrcColorFactor,va=e.StaticCopyUsage,ka=e.StaticDrawUsage,qa=e.StaticReadUsage,Ha=e.StereoCamera,Va=e.StreamCopyUsage,wa=e.StreamDrawUsage,Wa=e.StreamReadUsage,Ka=e.StringKeyframeTrack,Qa=e.SubtractEquation,Xa=e.SubtractiveBlending,ja=e.TOUCH,za=e.TangentSpaceNormalMap,Za=e.TetrahedronGeometry,Ja=e.Texture,Ya=e.TextureLoader,$a=e.TextureUtils,ec=e.Timer,tc=e.TimestampQuery,oc=e.TorusGeometry,nc=e.TorusKnotGeometry,rc=e.Triangle,ac=e.TriangleFanDrawMode,cc=e.TriangleStripDrawMode,sc=e.TrianglesDrawMode,ic=e.TubeGeometry,lc=e.UVMapping,pc=e.Uint16BufferAttribute,mc=e.Uint32BufferAttribute,uc=e.Uint8BufferAttribute,dc=e.Uint8ClampedBufferAttribute,Cc=e.Uniform,Sc=e.UniformsGroup,Tc=e.UniformsLib,gc=e.UniformsUtils,Mc=e.UnsignedByteType,Fc=e.UnsignedInt101111Type,Ac=e.UnsignedInt248Type,Gc=e.UnsignedInt5999Type,hc=e.UnsignedIntType,_c=e.UnsignedShort4444Type,Bc=e.UnsignedShort5551Type,Rc=e.UnsignedShortType,Lc=e.VSMShadowMap,yc=e.Vector2,Dc=e.Vector3,fc=e.Vector4,Ec=e.VectorKeyframeTrack,xc=e.VideoFrameTexture,bc=e.VideoTexture,Pc=e.WebGL3DRenderTarget,Ic=e.WebGLArrayRenderTarget,Uc=e.WebGLCoordinateSystem,Nc=e.WebGLCubeRenderTarget,Oc=e.WebGLRenderTarget,vc=e.WebGLRenderer,kc=e.WebGLUtils,qc=e.WebGPUCoordinateSystem,Hc=e.WebXRController,Vc=e.WireframeGeometry,wc=e.WrapAroundEnding,Wc=e.ZeroCurvatureEnding,Kc=e.ZeroFactor,Qc=e.ZeroSlopeEnding,Xc=e.ZeroStencilOp,jc=e.createCanvasElement;export{n as ACESFilmicToneMapping,r as AddEquation,a as AddOperation,c as AdditiveAnimationBlendMode,s as AdditiveBlending,i as AgXToneMapping,l as AlphaFormat,p as AlwaysCompare,m as AlwaysDepth,u as AlwaysStencilFunc,d as AmbientLight,C as AnimationAction,S as AnimationClip,T as AnimationLoader,g as AnimationMixer,M as AnimationObjectGroup,F as AnimationUtils,A as ArcCurve,G as ArrayCamera,h as ArrowHelper,_ as AttachedBindMode,B as Audio,R as AudioAnalyser,L as AudioContext,y as AudioListener,D as AudioLoader,f as AxesHelper,E as BackSide,x as BasicDepthPacking,b as BasicShadowMap,P as BatchedMesh,I as Bone,U as BooleanKeyframeTrack,N as Box2,O as Box3,v as Box3Helper,k as BoxGeometry,q as BoxHelper,H as BufferAttribute,V as BufferGeometry,w as BufferGeometryLoader,W as ByteType,K as Cache,Q as Camera,X as CameraHelper,j as CanvasTexture,z as CapsuleGeometry,Z as CatmullRomCurve3,J as CineonToneMapping,Y as CircleGeometry,$ as ClampToEdgeWrapping,ee as Clock,te as Color,oe as ColorKeyframeTrack,ne as ColorManagement,re as CompressedArrayTexture,ae as CompressedCubeTexture,ce as CompressedTexture,se as CompressedTextureLoader,ie as ConeGeometry,le as ConstantAlphaFactor,pe as ConstantColorFactor,me as Controls,ue as CubeCamera,de as CubeReflectionMapping,Ce as CubeRefractionMapping,Se as CubeTexture,Te as CubeTextureLoader,ge as CubeUVReflectionMapping,Me as CubicBezierCurve,Fe as CubicBezierCurve3,Ae as CubicInterpolant,Ge as CullFaceBack,he as CullFaceFront,_e as CullFaceFrontBack,Be as CullFaceNone,Re as Curve,Le as CurvePath,ye as CustomBlending,De as CustomToneMapping,fe as CylinderGeometry,Ee as Cylindrical,xe as Data3DTexture,be as DataArrayTexture,Pe as DataTexture,Ie as DataTextureLoader,Ue as DataUtils,Ne as DecrementStencilOp,Oe as DecrementWrapStencilOp,ve as DefaultLoadingManager,ke as DepthFormat,qe as DepthStencilFormat,He as DepthTexture,Ve as DetachedBindMode,we as DirectionalLight,We as DirectionalLightHelper,Ke as DiscreteInterpolant,Qe as DodecahedronGeometry,Xe as DoubleSide,je as DstAlphaFactor,ze as DstColorFactor,Ze as DynamicCopyUsage,Je as DynamicDrawUsage,Ye as DynamicReadUsage,$e as EdgesGeometry,et as EllipseCurve,tt as EqualCompare,ot as EqualDepth,nt as EqualStencilFunc,rt as EquirectangularReflectionMapping,at as EquirectangularRefractionMapping,ct as Euler,st as EventDispatcher,it as ExternalTexture,lt as ExtrudeGeometry,pt as FileLoader,mt as Float16BufferAttribute,ut as Float32BufferAttribute,dt as FloatType,Ct as Fog,St as FogExp2,Tt as FramebufferTexture,gt as FrontSide,Mt as Frustum,Ft as FrustumArray,At as GLBufferAttribute,Gt as GLSL1,ht as GLSL3,_t as GreaterCompare,Bt as GreaterDepth,Rt as GreaterEqualCompare,Lt as GreaterEqualDepth,yt as GreaterEqualStencilFunc,Dt as GreaterStencilFunc,ft as GridHelper,Et as Group,xt as HalfFloatType,bt as HemisphereLight,Pt as HemisphereLightHelper,It as IcosahedronGeometry,Ut as ImageBitmapLoader,Nt as ImageLoader,Ot as ImageUtils,vt as IncrementStencilOp,kt as IncrementWrapStencilOp,qt as InstancedBufferAttribute,Ht as InstancedBufferGeometry,Vt as InstancedInterleavedBuffer,wt as InstancedMesh,Wt as Int16BufferAttribute,Kt as Int32BufferAttribute,Qt as Int8BufferAttribute,Xt as IntType,jt as InterleavedBuffer,zt as InterleavedBufferAttribute,Zt as Interpolant,Jt as InterpolateDiscrete,Yt as InterpolateLinear,$t as InterpolateSmooth,eo as InterpolationSamplingMode,to as InterpolationSamplingType,oo as InvertStencilOp,no as KeepStencilOp,ro as KeyframeTrack,ao as LOD,co as LatheGeometry,so as Layers,io as LessCompare,lo as LessDepth,po as LessEqualCompare,mo as LessEqualDepth,uo as LessEqualStencilFunc,Co as LessStencilFunc,So as Light,To as LightProbe,go as Line,Mo as Line3,Fo as LineBasicMaterial,Ao as LineCurve,Go as LineCurve3,ho as LineDashedMaterial,_o as LineLoop,Bo as LineSegments,Ro as LinearFilter,Lo as LinearInterpolant,yo as LinearMipMapLinearFilter,Do as LinearMipMapNearestFilter,fo as LinearMipmapLinearFilter,Eo as LinearMipmapNearestFilter,xo as LinearSRGBColorSpace,bo as LinearToneMapping,Po as LinearTransfer,Io as Loader,Uo as LoaderUtils,No as LoadingManager,Oo as LoopOnce,vo as LoopPingPong,ko as LoopRepeat,qo as MOUSE,Ho as Material,Vo as MaterialLoader,wo as MathUtils,Wo as Matrix2,Ko as Matrix3,Qo as Matrix4,Xo as MaxEquation,jo as Mesh,zo as MeshBasicMaterial,Zo as MeshDepthMaterial,Jo as MeshDistanceMaterial,Yo as MeshLambertMaterial,$o as MeshMatcapMaterial,en as MeshNormalMaterial,tn as MeshPhongMaterial,on as MeshPhysicalMaterial,nn as MeshStandardMaterial,rn as MeshToonMaterial,an as MinEquation,cn as MirroredRepeatWrapping,sn as MixOperation,ln as MultiplyBlending,pn as MultiplyOperation,mn as NearestFilter,un as NearestMipMapLinearFilter,dn as NearestMipMapNearestFilter,Cn as NearestMipmapLinearFilter,Sn as NearestMipmapNearestFilter,Tn as NeutralToneMapping,gn as NeverCompare,Mn as NeverDepth,Fn as NeverStencilFunc,An as NoBlending,Gn as NoColorSpace,hn as NoToneMapping,_n as NormalAnimationBlendMode,Bn as NormalBlending,Rn as NotEqualCompare,Ln as NotEqualDepth,yn as NotEqualStencilFunc,Dn as NumberKeyframeTrack,fn as Object3D,En as ObjectLoader,xn as ObjectSpaceNormalMap,bn as OctahedronGeometry,Pn as OneFactor,In as OneMinusConstantAlphaFactor,Un as OneMinusConstantColorFactor,Nn as OneMinusDstAlphaFactor,On as OneMinusDstColorFactor,vn as OneMinusSrcAlphaFactor,kn as OneMinusSrcColorFactor,qn as OrthographicCamera,Hn as PCFShadowMap,Vn as PCFSoftShadowMap,wn as PMREMGenerator,Wn as Path,Kn as PerspectiveCamera,Qn as Plane,Xn as PlaneGeometry,jn as PlaneHelper,zn as PointLight,Zn as PointLightHelper,Jn as Points,Yn as PointsMaterial,$n as PolarGridHelper,er as PolyhedronGeometry,tr as PositionalAudio,or as PropertyBinding,nr as PropertyMixer,rr as QuadraticBezierCurve,ar as QuadraticBezierCurve3,cr as Quaternion,sr as QuaternionKeyframeTrack,ir as QuaternionLinearInterpolant,lr as RED_GREEN_RGTC2_Format,pr as RED_RGTC1_Format,mr as REVISION,ur as RGBADepthPacking,dr as RGBAFormat,Cr as RGBAIntegerFormat,Sr as RGBA_ASTC_10x10_Format,Tr as RGBA_ASTC_10x5_Format,gr as RGBA_ASTC_10x6_Format,Mr as RGBA_ASTC_10x8_Format,Fr as RGBA_ASTC_12x10_Format,Ar as RGBA_ASTC_12x12_Format,Gr as RGBA_ASTC_4x4_Format,hr as RGBA_ASTC_5x4_Format,_r as RGBA_ASTC_5x5_Format,Br as RGBA_ASTC_6x5_Format,Rr as RGBA_ASTC_6x6_Format,Lr as RGBA_ASTC_8x5_Format,yr as RGBA_ASTC_8x6_Format,Dr as RGBA_ASTC_8x8_Format,fr as RGBA_BPTC_Format,Er as RGBA_ETC2_EAC_Format,xr as RGBA_PVRTC_2BPPV1_Format,br as RGBA_PVRTC_4BPPV1_Format,Pr as RGBA_S3TC_DXT1_Format,Ir as RGBA_S3TC_DXT3_Format,Ur as RGBA_S3TC_DXT5_Format,Nr as RGBDepthPacking,Or as RGBFormat,vr as RGBIntegerFormat,kr as RGB_BPTC_SIGNED_Format,qr as RGB_BPTC_UNSIGNED_Format,Hr as RGB_ETC1_Format,Vr as RGB_ETC2_Format,wr as RGB_PVRTC_2BPPV1_Format,Wr as RGB_PVRTC_4BPPV1_Format,Kr as RGB_S3TC_DXT1_Format,Qr as RGDepthPacking,Xr as RGFormat,jr as RGIntegerFormat,zr as RawShaderMaterial,Zr as Ray,Jr as Raycaster,Yr as RectAreaLight,$r as RedFormat,ea as RedIntegerFormat,ta as ReinhardToneMapping,oa as RenderTarget,na as RenderTarget3D,ra as RepeatWrapping,aa as ReplaceStencilOp,ca as ReverseSubtractEquation,sa as RingGeometry,ia as SIGNED_RED_GREEN_RGTC2_Format,la as SIGNED_RED_RGTC1_Format,pa as SRGBColorSpace,ma as SRGBTransfer,ua as Scene,da as ShaderChunk,Ca as ShaderLib,Sa as ShaderMaterial,Ta as ShadowMaterial,ga as Shape,Ma as ShapeGeometry,Fa as ShapePath,Aa as ShapeUtils,Ga as ShortType,ha as Skeleton,_a as SkeletonHelper,Ba as SkinnedMesh,Ra as Source,La as Sphere,ya as SphereGeometry,Da as Spherical,fa as SphericalHarmonics3,Ea as SplineCurve,xa as SpotLight,ba as SpotLightHelper,Pa as Sprite,Ia as SpriteMaterial,Ua as SrcAlphaFactor,Na as SrcAlphaSaturateFactor,Oa as SrcColorFactor,va as StaticCopyUsage,ka as StaticDrawUsage,qa as StaticReadUsage,Ha as StereoCamera,Va as StreamCopyUsage,wa as StreamDrawUsage,Wa as StreamReadUsage,Ka as StringKeyframeTrack,Qa as SubtractEquation,Xa as SubtractiveBlending,ja as TOUCH,za as TangentSpaceNormalMap,Za as TetrahedronGeometry,Ja as Texture,Ya as TextureLoader,$a as TextureUtils,ec as Timer,tc as TimestampQuery,oc as TorusGeometry,nc as TorusKnotGeometry,rc as Triangle,ac as TriangleFanDrawMode,cc as TriangleStripDrawMode,sc as TrianglesDrawMode,ic as TubeGeometry,lc as UVMapping,pc as Uint16BufferAttribute,mc as Uint32BufferAttribute,uc as Uint8BufferAttribute,dc as Uint8ClampedBufferAttribute,Cc as Uniform,Sc as UniformsGroup,Tc as UniformsLib,gc as UniformsUtils,Mc as UnsignedByteType,Fc as UnsignedInt101111Type,Ac as UnsignedInt248Type,Gc as UnsignedInt5999Type,hc as UnsignedIntType,_c as UnsignedShort4444Type,Bc as UnsignedShort5551Type,Rc as UnsignedShortType,Lc as VSMShadowMap,yc as Vector2,Dc as Vector3,fc as Vector4,Ec as VectorKeyframeTrack,xc as VideoFrameTexture,bc as VideoTexture,Pc as WebGL3DRenderTarget,Ic as WebGLArrayRenderTarget,Uc as WebGLCoordinateSystem,Nc as WebGLCubeRenderTarget,Oc as WebGLRenderTarget,vc as WebGLRenderer,kc as WebGLUtils,qc as WebGPUCoordinateSystem,Hc as WebXRController,Vc as WireframeGeometry,wc as WrapAroundEnding,Wc as ZeroCurvatureEnding,Kc as ZeroFactor,Qc as ZeroSlopeEnding,Xc as ZeroStencilOp,jc as createCanvasElement,e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as w}from"./index-Dm_h-T4x.js";function S(e,t){return e.object3D?.(t)??null}const s=new Map,u=new Map;function g(e){let t=u.get(e);return t||(t={frameListeners:new Set,helpers:new Map},u.set(e,t)),t}const f=new Set,c=new Set;function p(){for(const t of s.values())if(t.presenting)return t;const e=w();if(e!==null){const t=s.get(e);if(t)return t}return s.values().next().value??null}let a=null;function l(){a=null;const e=v();for(const t of c)t(e)}function h(e,t){const r=g(e);return{documentId:e,rig:()=>s.get(e)?.rig??t,setHelper:(n,o)=>{r.helpers.set(n,o),s.get(e)?.setHelper(n,o)},onFrame:n=>(r.frameListeners.add(n),()=>{r.frameListeners.delete(n)})}}function b(e,t,r,n){const o=g(n.documentId),i={documentId:n.documentId,rig:e,present:t,setHelper:r,frameListeners:o.frameListeners,helpers:o.helpers,presenting:!1};s.set(n.documentId,i);for(const[m,d]of i.helpers)r(m,d);return l(),()=>{s.get(n.documentId)===i&&(s.delete(n.documentId),l())}}function y(){return p()?.rig??null}function F(e){return f.add(e),()=>{f.delete(e)}}function v(){return a||(a=[...s.values()].map(e=>h(e.documentId,e.rig))),a}function D(e){const t=u.get(e);return t?[...t.helpers].filter(([,r])=>r!==null).map(([r])=>r):[]}function I(e){return c.add(e),()=>{c.delete(e)}}function V(e,t){const r=s.get(e);if(r){for(const n of r.frameListeners)n(t);if(p()===r)for(const n of f)n(t)}}export{F as a,y as b,b as c,D as d,I as o,V as r,S as t,v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let t=null;function r(o){t=o}function n(){return t}export{r as s,n as v};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{k as yt,c as nt}from"./content-bounds-_QWiKD5_.js";import{s as Q,E as Mt}from"./three-integration.service-0EyPpd5f.js";import{D as j,G as Y,A as wt,t as bt,c as St,X as xt,V as Z,aK as kt,av as It,aJ as Ft,as as Pt,j as d,aA as tt,C as f,l as it,R as rt,H as Ct,m as Et,L as Gt,n as H,f as st,bI as Rt,r as Tt,aw as Dt,K as et}from"./three.module-CrYDk-Xr.js";import{cF as _t,cG as At,ax as $t,al as Ot}from"./index-Dm_h-T4x.js";import{j as Bt}from"./jsx-runtime-CAUTK36e.js";import"./index-DaQZGF7d.js";import"./index-CtzuWnCS.js";import"./index-jib6KJY8.js";let at=0;function Lt(){at++}function re(){return at}const se=[.8,.5,-1],N=new f(1975600),U=new f(5004144);function Ht(){const i=typeof document>"u"?null:document.querySelector("[data-vgai-palette]");if(!i)return{bottom:N.clone(),top:U.clone()};const t=getComputedStyle(i),o=document.createElement("canvas");o.width=o.height=1;const e=o.getContext("2d"),r=(s,u)=>{const p=t.getPropertyValue(s).trim();if(!e||!p||!CSS.supports("color",p))return u.clone();e.fillStyle=u.getStyle(),e.fillRect(0,0,1,1),e.fillStyle=t.getPropertyValue("--vgai-surface-shell").trim(),e.fillRect(0,0,1,1),e.fillStyle=p,e.fillRect(0,0,1,1);const[y,l,M]=e.getImageData(0,0,1,1).data;return new f().setRGB(y/255,l/255,M/255,st)},n=r("--vgai-surface-panel",N),a=r("--vgai-surface-raised",U),h=n.lerp(N,.25).lerp(new f(16777215),.03),c=a.lerp(U,.25).lerp(new f(16777215),.04);return{bottom:h,top:c}}function ae(i){if(typeof document>"u"||typeof MutationObserver>"u")return()=>{};const t=document.querySelector("[data-vgai-palette]");if(!t)return()=>{};const o=new MutationObserver(()=>{i(),Lt()});return o.observe(t,{attributes:!0,attributeFilter:["data-vgai-palette","data-vgai-material"]}),()=>o.disconnect()}function zt(i=Ht()){const o=new Uint8Array(512),e=new f;for(let n=0;n<128;n++)e.copy(i.bottom).lerp(i.top,n/127).convertLinearToSRGB(),o[n*4]=Math.round(e.r*255),o[n*4+1]=Math.round(e.g*255),o[n*4+2]=Math.round(e.b*255),o[n*4+3]=255;const r=new it(o,1,128,rt);return r.colorSpace=st,r.magFilter=H,r.minFilter=H,r.needsUpdate=!0,r}function Nt(i){const t=nt(i);if(t.isEmpty())return{size:50,centre:[0,0]};const o=Math.max(t.max.x-t.min.x,t.max.z-t.min.z);return{size:Math.min(Math.max(Math.ceil(o/10)*10+20,50),1e3),centre:[(t.min.x+t.max.x)/2,(t.min.z+t.max.z)/2]}}function Ut(i){for(const t of[1,2,5,10])if(i/t<=60)return Math.round(i/t);return Math.round(i/10)}function Wt(i,t){const o=t/2,e=o*.55,r=o;i.onBeforeCompile=n=>{n.uniforms.uGridFadeStart={value:e},n.uniforms.uGridFadeEnd={value:r},n.vertexShader=n.vertexShader.replace("#include <common>",`#include <common>
|
|
2
|
+
varying vec2 vGridPlanePosition;`).replace("#include <begin_vertex>",`#include <begin_vertex>
|
|
3
|
+
vGridPlanePosition = position.xz;`),n.fragmentShader=n.fragmentShader.replace("#include <common>",`#include <common>
|
|
4
|
+
varying vec2 vGridPlanePosition;
|
|
5
|
+
uniform float uGridFadeStart;
|
|
6
|
+
uniform float uGridFadeEnd;`).replace("#include <color_fragment>",`#include <color_fragment>
|
|
7
|
+
diffuseColor.a *= 1.0 - smoothstep(uGridFadeStart, uGridFadeEnd, length(vGridPlanePosition));`)},i.customProgramCacheKey=()=>`vgai-grid-fade:${e}:${r}`}function le(i,t){const{environment:o,background:e=!0,keyLight:r=!0,grid:n=!1}=t,a=[],h=[];let c=null;if(o&&(i.environment=o.texture),e&&(c=zt(),i.background=c),r){const l=new j(16774109,1.9);l.name="vgai:standard-dressing-key",l.position.set(6,10,-4),l.castShadow=!0,Q(l,"editorHelper",!0),i.add(l),a.push(l),h.push(l)}let s=null,u="";const p=l=>{if(!n)return;const{size:M,centre:w}=Nt(l),b=`${M}:${w.join(":")}`;if(b===u)return;u=b,s&&(s.removeFromParent(),s.dispose(),a.splice(a.indexOf(s),1));const g=new Rt(M,Ut(M),10066329,10066329);s=g;const S=g.material;S.transparent=!0,S.opacity=.35,S.depthWrite=!1,Wt(S,M),g.name="vgai:standard-dressing-grid",g.position.set(w[0],-.02,w[1]),g.layers.set(Mt),Q(g,"editorHelper",!0),i.add(g),a.push(g)};p(t.content??i);let y=!1;return{backgroundTexture:c,lights:h,frameContent:p,dispose(){if(!y){y=!0;for(const l of a)l.removeFromParent(),l.dispose?.();o&&(i.environment===o.texture&&(i.environment=null),o.dispose()),c&&(i.background===c&&(i.background=null),c.dispose())}}}}const W=12,Vt=`
|
|
8
|
+
vec3 vgaiHable( vec3 x ) {
|
|
9
|
+
const float A = 0.22 * 4.0;
|
|
10
|
+
const float B = 0.30 * 2.0;
|
|
11
|
+
const float C = 0.10;
|
|
12
|
+
const float D = 0.20;
|
|
13
|
+
const float E = 0.01;
|
|
14
|
+
const float F = 0.30;
|
|
15
|
+
return ( ( x * ( A * x + C * B ) + D * E ) / ( x * ( A * x + B ) + D * F ) ) - E / F;
|
|
16
|
+
}
|
|
17
|
+
vec3 CustomToneMapping( vec3 color ) {
|
|
18
|
+
color *= toneMappingExposure;
|
|
19
|
+
return clamp( vgaiHable( max( vec3( 0.0 ), color ) ) / vgaiHable( vec3( 1.0 ) ), 0.0, 1.0 );
|
|
20
|
+
}`;{const i=et.tonemapping_pars_fragment,t="vec3 CustomToneMapping( vec3 color ) { return color; }";i.includes(t)&&(et.tonemapping_pars_fragment=i.replace(t,Vt))}const jt={none:Pt,aces:Ft,agx:It,filmic:kt};function ot(i){return`image|${i.id}|${i.url}`}function V(i){return i*i*(3-2*i)}function k(i,t,o){let e=Math.imul(i,374761393)^Math.imul(t,668265263)^Math.imul(o,1440662683);return e=Math.imul(e^e>>>13,1274126177),((e^e>>>16)>>>0)/4294967296}function qt(i,t,o){const e=Math.floor(i),r=Math.floor(t),n=Math.floor(o),a=V(i-e),h=V(t-r),c=V(o-n),s=d.lerp,u=s(k(e,r,n),k(e+1,r,n),a),p=s(k(e,r+1,n),k(e+1,r+1,n),a),y=s(k(e,r,n+1),k(e+1,r,n+1),a),l=s(k(e,r+1,n+1),k(e+1,r+1,n+1),a);return s(s(u,p,h),s(y,l,h),c)}function lt(i,t,o){let e=0,r=.5,n=1,a=0;for(let h=0;h<5;h++)e+=r*qt(i*n,t*n,o*n),a+=r,r*=.5,n*=2;return e/a}let _=null;function Kt(i){if(!_){const o=new Float32Array(4096);for(let e=0;e<o.length;e++){const r=1-2*(e+.5)/o.length,n=Math.sqrt(1-r*r),a=e*2.399963229728653;o[e]=lt(Math.cos(a)*n*4,r*4,Math.sin(a)*n*4)}_=o.sort()}const t=d.clamp(Math.round((1-i)*(_.length-1)),0,_.length-1);return _[t]}function Xt(i){if(!i)return null;const t=(e,r)=>typeof e=="number"&&Number.isFinite(e)?e:r,o={cover:d.clamp(t(i.cover,.5),0,1),opacity:d.clamp(t(i.opacity,1),0,1),scale:Math.max(t(i.scale,4),.1)};return o.cover>0&&o.opacity>0?o:null}const R=4,q=400;function Jt(){const i=new Dt({roughness:.9,metalness:0,transparent:!0,depthWrite:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),t=q/2;return i.onBeforeCompile=o=>{o.vertexShader=o.vertexShader.replace("void main() {",`varying vec2 vFloorPlane;
|
|
21
|
+
void main() {`).replace("#include <begin_vertex>",`#include <begin_vertex>
|
|
22
|
+
vFloorPlane = position.xz;`),o.fragmentShader=o.fragmentShader.replace("void main() {",`varying vec2 vFloorPlane;
|
|
23
|
+
void main() {`).replace("#include <dithering_fragment>",`#include <dithering_fragment>
|
|
24
|
+
gl_FragColor.a *= 1.0 - smoothstep(${(t*.3).toFixed(1)}, ${(t*.95).toFixed(1)}, length(vFloorPlane));`)},i.customProgramCacheKey=()=>"vgai-fading-floor",i}class ce{constructor(t,o){this.onReady=o,this.group.name="vgai:stage-presentation-rig",this.group.userData.editorHelper=!0,this.group.add(this.ambient),t.add(this.group),this.previewGroup.name="vgai:stage-preview-rig",this.previewGroup.userData.editorHelper=!0,this.sun.name="vgai:preview-sun",this.sun.userData.editorHelper=!0,this.previewGroup.add(this.sun,this.sun.target),this.previewGroup.visible=!1,t.add(this.previewGroup),this.floor.name="vgai:preview-floor",this.floor.userData.editorHelper=!0,this.floor.receiveShadow=!0,this.floor.renderOrder=-1,this.floor.visible=!1,t.add(this.floor)}group=new Y;ambient=new wt(16777215,0);lights=[];preset=null;presentation=null;source="studio";previewGroup=new Y;sun=new j(16777215,1);floorBounds=new bt;floorContent=null;floor=new St(new xt(q,q).rotateX(-Math.PI/2),Jt());sky=null;pmrem=null;direction=new Z;loadingImage=null;pendingImage=null;failedImages=new Set;latestSky=null;rotation=0;disposed=!1;apply(t,o,e,r={}){this.presentation=t;const{lighting:n}=t,a=r.floor!==!1&&t.overlays.floor.visible,h=a&&!this.floor.visible;this.floor.visible=a,h&&this.floorContent&&this.placeFloor(this.floorContent),this.floor.material.color.set(t.overlays.floor.color);const c=_t(n.studioPreset);c!==this.preset&&this.build(c),this.source=n.source,this.group.visible=n.source==="studio",r.tone!==!1&&(o.toneMapping=e??jt[n.tone.mapper],o.toneMappingExposure=n.tone.exposure);const{sun:s,environment:u}=n.preview,p=d.degToRad(s.altitude),y=d.degToRad(s.azimuth);this.sun.color.set(s.color),this.sun.intensity=s.enabled?s.energy:0,this.sun.position.set(Math.sin(y)*Math.cos(p),Math.sin(p),-Math.cos(y)*Math.cos(p)).multiplyScalar(W),this.sun.castShadow=s.enabled&&s.shadowDistance>0;const l=Math.min(Math.max(s.shadowDistance,1),50)/2;if(Object.assign(this.sun.shadow.camera,{left:-l,right:l,top:l,bottom:-l}),this.sun.shadow.camera.updateProjectionMatrix(),this.sun.updateMatrixWorld(),this.sun.target.updateMatrixWorld(),this.rotation=d.degToRad(u.rotation),!(r.sky!==!1&&u.enabled&&(n.source==="preview"||t.backdrop.source==="environment"))){this.loadingImage=null,this.pendingImage=null;return}const w=u.image===null?null:At(u.image),b=()=>this.buildSky(u.sky,o,s.enabled?{direction:this.sun.position.clone().normalize(),color:s.color,energy:s.energy}:null);if(this.latestSky=b,w&&!this.failedImages.has(ot(w))){this.sky||b(),this.buildImage(w,o);return}this.loadingImage=null,this.pendingImage=u.image===null?null:{id:u.image,state:w?"failed":"unregistered"},b()}buildImage(t,o){const e=ot(t);if(this.sky?.key===e){this.pendingImage=null;return}this.loadingImage!==e&&(this.loadingImage=e,this.pendingImage={id:t.id,state:"loading"},yt(t.url,t.format).then(r=>{if(this.disposed||this.loadingImage!==e){r.dispose();return}let n;try{this.pmrem??=new tt(o),n=this.pmrem.fromEquirectangular(r)}catch(a){throw r.dispose(),a}this.loadingImage=null,this.pendingImage=null,this.disposeSky(),this.sky={key:e,image:t.id,background:r,environment:n},this.onReady?.()}).catch(r=>{this.disposed||this.loadingImage!==e||(this.loadingImage=null,this.failedImages.add(e),this.pendingImage={id:t.id,state:"failed"},$t.error(`Environment image "${t.id}" (${t.url}) did not load: ${String(r)}`,"viewport"),this.latestSky?.(),this.onReady?.())}))}placeFloor(t){if(this.floorContent=t,!this.floor.visible)return;const o=nt(t,this.floorBounds);this.floor.position.y=o.isEmpty()?0:o.min.y,this.floor.updateMatrixWorld()}forgetFailedImages(){this.failedImages.clear()}sceneLightsShown(){return this.source!=="preview"||this.presentation?.lighting.preview.sceneLights!==!1}imageReport(){return{shown:this.sky?.image??null,pending:this.pendingImage}}turn(){return this.sky?.image?this.rotation:0}buildSky(t,o,e){const r=e?`${e.direction.toArray().map(m=>m.toFixed(4)).join(",")}|${e.color}|${e.energy}`:"none",n=Xt(t.clouds),a=n?`${n.cover}|${n.opacity}|${n.scale}`:"clear",h=`${t.top}|${t.horizon}|${t.ground}|${t.topCurve}|${t.groundCurve}|${a}|${r}`;if(this.sky?.key===h)return;this.disposeSky();const c=1024,s=512,u=d.degToRad(.5),p=d.degToRad(30),y=.15,l=new f(t.top),M=new f(t.horizon),w=new f(t.ground),b=e?new f(e.color).multiplyScalar(e.energy):null,g=new Uint16Array(c*s*4),S=m=>Tt.toHalfFloat(Math.min(m,65504)),ct=Math.max(t.topCurve,.001),ut=Math.max(t.groundCurve,.001),A=new f,I=new f,dt=new f(.92,.93,.95).lerp(M,.2),T=c/R,z=s/2/R+1,K=n?Kt(n.cover):1;let $=null;if(n){$=new Float32Array(T*z);for(let m=0;m<z;m++){const P=((Math.min(s/2+m*R,s-1)+.5)/s-.5)*Math.PI;for(let C=0;C<T;C++){const v=((C*R+.5)/c-.5)*Math.PI*2;$[m*T+C]=lt(Math.cos(v)*Math.cos(P)*n.scale,Math.sin(P)*n.scale,Math.sin(v)*Math.cos(P)*n.scale)}}}const X=new Z;for(let m=0;m<s;m++){const x=((m+.5)/s-.5)*Math.PI,P=Math.PI/2-x;if(P<=Math.PI/2){const v=1-P/(Math.PI/2);A.copy(M).lerp(l,d.clamp(1-Math.pow(1-v,1/ct),0,1))}else{const v=(P-Math.PI/2)/(Math.PI/2);A.copy(M).lerp(w,d.clamp(1-Math.pow(1-v,1/ut),0,1))}const C=n&&x>0?d.smoothstep(Math.sin(x),0,.25):0;for(let v=0;v<c;v++){if(I.copy(A),n&&$&&C>0){const D=v/R,E=(m-s/2)/R,G=Math.floor(D),B=Math.max(0,Math.floor(E)),J=D-G,pt=E-Math.floor(E),L=(ft,vt)=>$[Math.min(vt,z-1)*T+ft%T],gt=d.lerp(d.lerp(L(G,B),L(G+1,B),J),d.lerp(L(G,B+1),L(G+1,B+1),J),pt),mt=d.smoothstep(gt,K-.1,K+.1);I.lerp(dt,mt*n.opacity*C)}if(b&&e&&x>-Math.PI/2){const D=((v+.5)/c-.5)*Math.PI*2;X.set(Math.cos(D)*Math.cos(x),Math.sin(x),Math.sin(D)*Math.cos(x));const E=X.angleTo(e.direction);if(E<u)I.copy(b);else if(E<p){const G=(E-u)/(p-u);I.copy(b).lerp(A,d.clamp(1-Math.pow(1-G,1/y),0,1))}}const O=(m*c+v)*4;g[O]=S(I.r),g[O+1]=S(I.g),g[O+2]=S(I.b),g[O+3]=S(1)}}const F=new it(g,c,s,rt,Ct);F.mapping=Et,F.colorSpace=Gt,F.magFilter=H,F.minFilter=H,F.needsUpdate=!0,this.pmrem??=new tt(o);const ht=this.pmrem.fromEquirectangular(F);this.sky={key:h,image:null,background:F,environment:ht}}disposeSky(){this.sky?.background.dispose(),this.sky?.environment.dispose(),this.sky=null}environment(){const t=this.presentation?.lighting;return t?this.source==="studio"?{texture:null,intensity:this.preset?.environmentIntensity??0,rotation:0}:this.source==="preview"?t.preview.environment.enabled?{texture:this.sky?.environment.texture??null,intensity:t.preview.environment.energy,rotation:this.turn()}:{texture:null,intensity:0,rotation:0}:null:null}backdrop(){const t=this.presentation?.backdrop;return!t||t.source==="fill"||t.source==="scene"?"keep":t.source==="transparent"?{value:null,blur:0,intensity:1,rotation:0}:t.source==="color"?{value:new f(t.color),blur:0,intensity:1,rotation:0}:this.sky?{value:this.sky.background,blur:t.blur,intensity:t.opacity,rotation:this.turn()}:"keep"}resolveSource(t){const o=this.presentation?.lighting;let e=o?.source??"studio";return o?.auto&&e!=="scene"&&o.auto.takeover.some(r=>t[r]===!0)&&(e="scene"),this.source=e,this.group.visible=e==="studio",this.previewGroup.visible=e==="preview",e}roots(){return[this.group,this.previewGroup,this.floor]}lightsVisible(){return this.group.visible&&this.lights.length>0}presetId(){return this.preset?.id??null}update(t){if(this.group.visible)for(const{light:o,spec:e}of this.lights)this.direction.set(...e.direction).normalize(),e.space==="camera"&&this.direction.applyQuaternion(t.quaternion),o.position.copy(this.direction).multiplyScalar(-W),o.target.position.set(0,0,0),o.updateMatrixWorld(),o.target.updateMatrixWorld()}dispose(){this.disposed=!0,this.clearLights(),this.group.removeFromParent(),this.previewGroup.removeFromParent(),this.floor.removeFromParent(),this.floor.geometry.dispose(),this.floor.material.dispose(),this.sun.dispose(),this.disposeSky(),this.pmrem?.dispose()}build(t){this.clearLights(),this.preset=t,this.ambient.color.set(t.ambient.color),this.ambient.intensity=t.ambient.intensity;for(const o of t.lights){const e=new j(o.color,o.intensity);e.name=`vgai:studio-light:${t.id}`,e.castShadow=o.castShadow===!0,e.userData.editorHelper=!0,this.group.add(e),this.group.add(e.target),this.lights.push({light:e,spec:o})}this.direction.set(0,0,0);for(const{light:o,spec:e}of this.lights)e.space==="world"&&(this.direction.set(...e.direction).normalize(),o.position.copy(this.direction).multiplyScalar(-W),o.updateMatrixWorld(),o.target.updateMatrixWorld())}clearLights(){for(const{light:t}of this.lights)t.removeFromParent(),t.target.removeFromParent(),t.dispose();this.lights=[]}}const ue="Preparing the viewport…";function de({testId:i,children:t}){return Bt.jsx("div",{"data-testid":i,style:{position:"absolute",inset:0,padding:16,fontSize:12,color:Ot.content.muted,pointerEvents:"none"},children:t})}export{ue as O,ce as S,de as V,le as a,se as b,zt as c,Lt as i,re as s,ae as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const d="/work/.vgai-session",ae=`${d}/session.py`,se=[`${d}/in`,`${d}/reply`],N="/__editor/blender-wasm";function D(e){return new URL(`${N}/${e}`,import.meta.url).href}async function M(){const e=await fetch(D("status"));return e.ok?await e.json():{available:!1,skew:null,dir:null,sizes:{},encoded:{},missing:[`${N}/status answered ${e.status}`]}}async function J(e){const t=await M();if(!t.available)throw new Error(`The headless Blender WebAssembly build is not served by this editor: ${t.missing.join("; ")}`);if(t.skew==="wali"){const{startWaliBlenderEngine:n}=await import("./blender-wali-engine-D3iKpzn9.js");return n(e,t)}const{startEmscriptenBlenderEngine:r}=await import("./blender-emscripten-engine-CEsWgnR7.js");return r(e,t)}function U(e){return e<200?1:e<5e3?5:25}const C=e=>new Promise(t=>setTimeout(t,e)),A=new TextDecoder;function ie(e,t,r){let n=0,a=0;const o=new Set;async function s(u){for(const l of o)u.has(`${l}.done`)||(await e.unlink(`${d}/reply/${l}.json`),await e.unlink(`${d}/reply/${l}.done`),o.delete(l))}async function i(){let u;try{u=await e.readdir(`${d}/ask`)}catch{return}const l=new Set(u.filter(h=>h.endsWith(".done")));await s(l);for(const h of l){const w=h.slice(0,-5);if(Number(w)<=a)continue;a=Number(w);const m=JSON.parse(A.decode(await e.readFile(`${d}/ask/${w}.json`)));let S;try{S=await t.ask(m)}catch(v){S={error:v instanceof Error?v.message:String(v)}}await e.writeFile(`${d}/reply/${w}.json`,JSON.stringify(S??null)),await e.writeFile(`${d}/reply/${w}.done`,"1"),o.add(w)}}async function c(u){const l=String(++n);await e.writeFile(`${d}/in/${l}.json`,JSON.stringify(u)),await e.writeFile(`${d}/in/${l}.done`,"1");const h=performance.now();for(;;){if(await i(),await e.stat(`${d}/out/${l}.done`)){const m=JSON.parse(A.decode(await e.readFile(`${d}/out/${l}.json`)));if(await e.unlink(`${d}/in/${l}.json`),await e.unlink(`${d}/in/${l}.done`),m.error)throw new Error(m.error);return m.result}const w=r?.();if(w)throw new Error(`Blender is gone, so this call will never be answered: ${w}. The session keeps its directory and its cached banner, so every later call would wait on the same missing answer; start a new program with \`blender-start {fresh: true}\` (\`VGAI_BLENDER_FRESH_SESSION=1\` for the battery harness).`);await C(U(performance.now()-h))}}return{request:c}}const P=e=>typeof e=="object"&&e!==null&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.dtype=="string"&&typeof e.count=="number"&&typeof e.stride=="number",W={f32:e=>new Float32Array(e.buffer,e.byteOffset,e.byteLength>>2),f64:e=>new Float64Array(e.buffer,e.byteOffset,e.byteLength>>3),u32:e=>new Uint32Array(e.buffer,e.byteOffset,e.byteLength>>2),i32:e=>new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u16:e=>new Uint16Array(e.buffer,e.byteOffset,e.byteLength>>1),i16:e=>new Int16Array(e.buffer,e.byteOffset,e.byteLength>>1),u8:e=>e,i8:e=>new Int8Array(e.buffer,e.byteOffset,e.byteLength)};function z(e,t,r){const n=W[r.dtype];if(!n)throw new Error(`Blender frame column ${t}: unknown dtype ${r.dtype}`);const{offset:a,length:o}=r;if(a<0||o<0||a+o>e.byteLength)throw new Error(`Blender frame column ${t}: bytes ${a}..${a+o} lie outside the ${e.byteLength}-byte export arena`);const s=e.subarray(a,a+o).slice(),i=n(s),c=r.count*r.stride;if(i.length!==c)throw new Error(`Blender frame column ${t}: ${i.length} values, ${c} declared (${r.count} x ${r.stride})`);return i}function H(e,t){const r=(n,a)=>{if(P(n)){const o=z(e,a,n);return a==="co"?Float64Array.from(o):o}if(Array.isArray(n))return n.map(o=>r(o,a));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=r(i,s);return o}return n};return r(t,"")}async function V(e,t){const r=async(n,a)=>{if(P(n)){const{offset:o,length:s,dtype:i}=n;if(o<0||s<0||o+s>e.byteLength)throw new Error(`Blender frame column ${a}: bytes ${o}..${o+s} lie outside the ${e.byteLength}-byte export arena`);const c=e.subarray(o,o+s).slice(),u=await crypto.subtle.digest("SHA-256",c),l=[...new Uint8Array(u)].map(h=>h.toString(16).padStart(2,"0")).join("");return{dtype:i,length:s,sha256:l}}if(Array.isArray(n))return Promise.all(n.map(o=>r(o,a)));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=await r(i,s);return o}return n};return r(t,"")}const b=e=>self.postMessage(e),O=(e,t)=>b({op:"log",level:e,text:t});let p=null,E=null,G=0;const j=new Map;function K(e,t,r){const n=++G,a=[],o=e;for(const s of[o?.meshes??{},o?.images??{}])for(const i of Object.values(s))for(const c of Object.values(i))ArrayBuffer.isView(c)&&c.buffer instanceof ArrayBuffer&&!a.includes(c.buffer)&&a.push(c.buffer);return new Promise((s,i)=>{j.set(n,{resolve:s,reject:i}),self.postMessage({op:"present",id:n,frame:e,description:t,...r?{capture:r}:{}},a)})}let f=null,$=null,B=!1,T=Promise.resolve();function Q(e){const t=T.then(e);return T=t.catch(()=>{}),t}function _(e){B=e,b({op:"document-dirty",dirty:e})}async function F(){if(!f||$===null)return;const e=$;let t;try{t=await f.request({op:"save-document"})}catch(n){throw new Error(`The Blender document ${e} could not be saved: ${g(n)}`)}if(!t?.saved||typeof t.path!="string")throw new Error(`Blender did not save the document ${e}`);let r;try{r=await f.files.readFile(t.path)}catch(n){throw new Error(`The Blender document ${e} could not be read back out of the engine: ${g(n)}`)}y.delete(t.path);try{const n=await fetch(`/__editor/blender-document?path=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([r])});if(!n.ok){const a=await n.text().catch(()=>"");throw new Error(`HTTP ${n.status} ${a}`)}}catch(n){throw new Error(`The Blender document ${e} was not written to the project: ${g(n)}`)}_(!1),O("log",`@@VGAI-DOCUMENT ${JSON.stringify({path:e,bytes:r.length})}`)}async function X(e,t){const r={engine:null},n=await J({project:e,log:O,ask:async({frame:o,capture:s,saveDue:i})=>{if(!r.engine)throw new Error("The Blender session presented before it started");i&&$!==null&&_(!0);const c=await r.engine.readArena(),u=await V(c,o),l=await K(H(c,o),u,s);return{...typeof l.capture=="object"&&l.capture!==null?l.capture:{},..."held"in l?{held:l.held}:{}}}});r.engine=n,f=n,t&&await L(n.files,e);const a=await n.request({op:"start",project:e,...t?{document:t}:{}});return t&&($=t),p={start:async()=>a,execute:async o=>{const s=await n.request({op:"execute",code:o});return s.error?`Error executing code: ${s.error}`:`Code executed successfully: ${s.result}`},sceneInfo:async()=>JSON.stringify(await n.request({op:"scene-info"}),null,2),objectInfo:async o=>JSON.stringify(await n.request({op:"object-info",name:o}),null,2),screenshotView:async o=>(await n.request({op:"present",capture:{size:o}}),JSON.stringify({view:{size:o}}))},{...a,engine:"blender-wasm",skew:n.skew,bootMs:Math.round(n.bootMs),releasedPayloadMB:n.releasedPayloadBytes===null?null:Math.round(n.releasedPayloadBytes/1048576)}}async function Y(){try{const e=await fetch("/__editor/blender-wasm/status");return e.ok?await e.json():{available:!1,missing:[`status answered ${e.status}`]}}catch(e){return{available:!1,missing:[String(e)]}}}async function Z(e,t){if(p)throw new Error("The Blender session is already started");if(!e.startsWith("/"))throw new Error("The Blender session needs the project's absolute path");if(t!==void 0&&!q(t))throw new Error(`The Blender document must be a project-relative .blend path with no traversal (models/model.blend); got ${JSON.stringify(t)}`);const r=await Y();if(!r.available)throw new Error(`Headless Blender is not served by this editor, so there is no modeling engine: ${r.missing.join("; ")}. The engine is Blender compiled to WebAssembly (packages/blender-engine/wasm, or the directory VGAI_BLENDER_WASM_DIR names); nothing stands in for it.`);return E=e,X(e,t)}function q(e){return!e.endsWith(".blend")||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(r=>r!==""&&r!=="."&&r!=="..")}const x=new Set;function k(e){x.has(e)||(x.add(e),O("error",e))}async function ee(e){const t=s=>(k(`The project's files are not readable from Python: ${s}`),null);let r;try{r=await fetch("/__editor/blender-project-index")}catch(s){return t(String(s))}if(!r.ok)return t(`/__editor/blender-project-index answered ${r.status}`);let n;try{if(n=await r.json(),typeof n?.root!="string"||!Array.isArray(n.files))return t("invalid project index")}catch(s){return t(String(s))}const{root:a,files:o}=n;return a!==e&&k(`The editor serving this tab has ${a} open, not ${e}; its files are mounted at ${e}, which is where Python is looking.`),o}const y=new Map;async function te(e,t){const r=await e.stat(t);return r?`${r.size}:${r.mtimeMs}`:""}async function L(e,t){const r=await ee(t);if(!r)return;const n=new Set(r.map(a=>`${t}/${a.path}`));for(const a of[...y.keys()])if(!n.has(a)){try{await e.unlink(a)}catch{}y.delete(a)}for(const a of r){const o=`${t}/${a.path}`,s=`${a.size}:${a.mtime}`;if(y.get(o)?.host===s||!y.has(o)&&await e.stat(o)!==null)continue;const i=await fetch(`/__editor/blender-project-file?path=${encodeURIComponent(a.path)}`);if(!i.ok){k(`${a.path}: HTTP ${i.status}`);continue}const c=o.slice(0,o.lastIndexOf("/"));c&&await e.mkdirTree(c),await e.writeFile(o,new Uint8Array(await i.arrayBuffer())),y.set(o,{host:s,engine:await te(e,o)})}}async function ne(e,t){const r=[],n=async a=>{let o;try{o=await e.readdir(a)}catch{return}for(const s of o){if(s==="."||s==="..")continue;const i=`${a.replace(/\/$/,"")}/${s}`,c=await e.stat(i);if(c){if((c.mode&61440)===16384){await n(i);continue}y.get(i)?.engine!==`${c.size}:${c.mtimeMs}`&&r.push({path:i,size:c.size,mtime:c.mtimeMs})}}};return await n(t),r}async function R(e){switch(e.op){case"start":return Z(e.project,e.document);case"present-result":{const n=j.get(e.id);j.delete(e.id),n&&(e.error?n.reject(new Error(e.error)):n.resolve({...e.capture===void 0?{}:{capture:e.capture},..."held"in e?{held:e.held}:{}}));return}}if(!p||!E||!f)throw new Error("The Blender session has not started");const t=f.files,r=f.request.bind(f);switch(e.op){case"flush-document":return B?(await F(),{saved:!0}):{saved:!1};case"history-begin":case"history-end":return r({op:e.op});case"history-step":return r({op:"history-step",token:e.token,direction:e.direction});case"execute":await L(t,E);{const n=await r({op:"execute",code:e.code,history:e.history??!0,label:e.label??"Blender Python"});return n.error?`Error executing code: ${n.error}`:`Code executed successfully: ${n.result}`}case"present":return r({op:"present"});case"scene-info":return p.sceneInfo();case"object-info":return p.objectInfo(e.name);case"rna":return r({op:"rna",path:e.path,...e.names===void 0?{}:{names:e.names}});case"rna-context":return r({op:"rna-context",...e.object===void 0?{}:{object:e.object},...e.collection===void 0?{}:{collection:e.collection}});case"rna-set":return r({op:"rna-set",history:e.history!==!1,path:e.path,property:e.property,value:e.value,...e.index===void 0?{}:{index:e.index}});case"outliner":return r({op:"outliner",...e.selected===void 0?{}:{selected:[...e.selected]}});case"node-tree":return r({op:"node-tree",...e.path===void 0?{}:{path:e.path},...e.material===void 0?{}:{material:e.material}});case"uv-layout":return r({op:"uv-layout",...e.object===void 0?{}:{object:e.object},...e.uvLayer===void 0?{}:{uvLayer:e.uvLayer}});case"rig":return r({op:"rig",...e.object===void 0?{}:{object:e.object}});case"action-clip":return r({op:"action-clip",...e.object===void 0?{}:{object:e.object},...e.bake===void 0?{}:{bake:e.bake}});case"outliner-set":return r({op:"outliner-set",path:e.path,column:e.column,value:e.value});case"screenshot-view":return JSON.parse(await p.screenshotView(e.maxSize));case"read-file":return t.readFile(e.path);case"write-file":{const n=e.path.slice(0,e.path.lastIndexOf("/"));n&&await t.mkdirTree(n),await t.writeFile(e.path,e.bytes),y.delete(e.path);return}case"list-files":return ne(t,e.path)}throw new Error(`Unknown Blender worker request ${e.op}`)}function g(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return typeof t.name=="string"?`${t.name}: ${t.message}`:t.message;try{return JSON.stringify(e)??Object.prototype.toString.call(e)}catch{return Object.prototype.toString.call(e)}}return String(e)}function re(){if(!f)return;const e=f.memoryBytes();e!==null&&b({op:"memory",bytes:e})}self.onmessage=e=>{const t=e.data;if(t.op==="present-result"){R(t);return}Q(()=>oe(t))};async function oe(e){try{const t=await R(e);B&&await F(),await I(),b({id:e.id,result:t})}catch(t){let r=g(t);try{await I()}catch(n){r+=`
|
|
1
|
+
const d="/work/.vgai-session",ae=`${d}/session.py`,se=[`${d}/in`,`${d}/reply`],N="/__editor/blender-wasm";function D(e){return new URL(`${N}/${e}`,import.meta.url).href}async function M(){const e=await fetch(D("status"));return e.ok?await e.json():{available:!1,skew:null,dir:null,sizes:{},encoded:{},missing:[`${N}/status answered ${e.status}`]}}async function J(e){const t=await M();if(!t.available)throw new Error(`The headless Blender WebAssembly build is not served by this editor: ${t.missing.join("; ")}`);if(t.skew==="wali"){const{startWaliBlenderEngine:n}=await import("./blender-wali-engine-da698rDf.js");return n(e,t)}const{startEmscriptenBlenderEngine:r}=await import("./blender-emscripten-engine-BeWFjMn-.js");return r(e,t)}function U(e){return e<200?1:e<5e3?5:25}const C=e=>new Promise(t=>setTimeout(t,e)),A=new TextDecoder;function ie(e,t,r){let n=0,a=0;const o=new Set;async function s(u){for(const l of o)u.has(`${l}.done`)||(await e.unlink(`${d}/reply/${l}.json`),await e.unlink(`${d}/reply/${l}.done`),o.delete(l))}async function i(){let u;try{u=await e.readdir(`${d}/ask`)}catch{return}const l=new Set(u.filter(h=>h.endsWith(".done")));await s(l);for(const h of l){const w=h.slice(0,-5);if(Number(w)<=a)continue;a=Number(w);const m=JSON.parse(A.decode(await e.readFile(`${d}/ask/${w}.json`)));let S;try{S=await t.ask(m)}catch(v){S={error:v instanceof Error?v.message:String(v)}}await e.writeFile(`${d}/reply/${w}.json`,JSON.stringify(S??null)),await e.writeFile(`${d}/reply/${w}.done`,"1"),o.add(w)}}async function c(u){const l=String(++n);await e.writeFile(`${d}/in/${l}.json`,JSON.stringify(u)),await e.writeFile(`${d}/in/${l}.done`,"1");const h=performance.now();for(;;){if(await i(),await e.stat(`${d}/out/${l}.done`)){const m=JSON.parse(A.decode(await e.readFile(`${d}/out/${l}.json`)));if(await e.unlink(`${d}/in/${l}.json`),await e.unlink(`${d}/in/${l}.done`),m.error)throw new Error(m.error);return m.result}const w=r?.();if(w)throw new Error(`Blender is gone, so this call will never be answered: ${w}. The session keeps its directory and its cached banner, so every later call would wait on the same missing answer; start a new program with \`blender-start {fresh: true}\` (\`VGAI_BLENDER_FRESH_SESSION=1\` for the battery harness).`);await C(U(performance.now()-h))}}return{request:c}}const P=e=>typeof e=="object"&&e!==null&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.dtype=="string"&&typeof e.count=="number"&&typeof e.stride=="number",W={f32:e=>new Float32Array(e.buffer,e.byteOffset,e.byteLength>>2),f64:e=>new Float64Array(e.buffer,e.byteOffset,e.byteLength>>3),u32:e=>new Uint32Array(e.buffer,e.byteOffset,e.byteLength>>2),i32:e=>new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u16:e=>new Uint16Array(e.buffer,e.byteOffset,e.byteLength>>1),i16:e=>new Int16Array(e.buffer,e.byteOffset,e.byteLength>>1),u8:e=>e,i8:e=>new Int8Array(e.buffer,e.byteOffset,e.byteLength)};function z(e,t,r){const n=W[r.dtype];if(!n)throw new Error(`Blender frame column ${t}: unknown dtype ${r.dtype}`);const{offset:a,length:o}=r;if(a<0||o<0||a+o>e.byteLength)throw new Error(`Blender frame column ${t}: bytes ${a}..${a+o} lie outside the ${e.byteLength}-byte export arena`);const s=e.subarray(a,a+o).slice(),i=n(s),c=r.count*r.stride;if(i.length!==c)throw new Error(`Blender frame column ${t}: ${i.length} values, ${c} declared (${r.count} x ${r.stride})`);return i}function H(e,t){const r=(n,a)=>{if(P(n)){const o=z(e,a,n);return a==="co"?Float64Array.from(o):o}if(Array.isArray(n))return n.map(o=>r(o,a));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=r(i,s);return o}return n};return r(t,"")}async function V(e,t){const r=async(n,a)=>{if(P(n)){const{offset:o,length:s,dtype:i}=n;if(o<0||s<0||o+s>e.byteLength)throw new Error(`Blender frame column ${a}: bytes ${o}..${o+s} lie outside the ${e.byteLength}-byte export arena`);const c=e.subarray(o,o+s).slice(),u=await crypto.subtle.digest("SHA-256",c),l=[...new Uint8Array(u)].map(h=>h.toString(16).padStart(2,"0")).join("");return{dtype:i,length:s,sha256:l}}if(Array.isArray(n))return Promise.all(n.map(o=>r(o,a)));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=await r(i,s);return o}return n};return r(t,"")}const b=e=>self.postMessage(e),O=(e,t)=>b({op:"log",level:e,text:t});let p=null,E=null,G=0;const j=new Map;function K(e,t,r){const n=++G,a=[],o=e;for(const s of[o?.meshes??{},o?.images??{}])for(const i of Object.values(s))for(const c of Object.values(i))ArrayBuffer.isView(c)&&c.buffer instanceof ArrayBuffer&&!a.includes(c.buffer)&&a.push(c.buffer);return new Promise((s,i)=>{j.set(n,{resolve:s,reject:i}),self.postMessage({op:"present",id:n,frame:e,description:t,...r?{capture:r}:{}},a)})}let f=null,$=null,B=!1,T=Promise.resolve();function Q(e){const t=T.then(e);return T=t.catch(()=>{}),t}function _(e){B=e,b({op:"document-dirty",dirty:e})}async function F(){if(!f||$===null)return;const e=$;let t;try{t=await f.request({op:"save-document"})}catch(n){throw new Error(`The Blender document ${e} could not be saved: ${g(n)}`)}if(!t?.saved||typeof t.path!="string")throw new Error(`Blender did not save the document ${e}`);let r;try{r=await f.files.readFile(t.path)}catch(n){throw new Error(`The Blender document ${e} could not be read back out of the engine: ${g(n)}`)}y.delete(t.path);try{const n=await fetch(`/__editor/blender-document?path=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([r])});if(!n.ok){const a=await n.text().catch(()=>"");throw new Error(`HTTP ${n.status} ${a}`)}}catch(n){throw new Error(`The Blender document ${e} was not written to the project: ${g(n)}`)}_(!1),O("log",`@@VGAI-DOCUMENT ${JSON.stringify({path:e,bytes:r.length})}`)}async function X(e,t){const r={engine:null},n=await J({project:e,log:O,ask:async({frame:o,capture:s,saveDue:i})=>{if(!r.engine)throw new Error("The Blender session presented before it started");i&&$!==null&&_(!0);const c=await r.engine.readArena(),u=await V(c,o),l=await K(H(c,o),u,s);return{...typeof l.capture=="object"&&l.capture!==null?l.capture:{},..."held"in l?{held:l.held}:{}}}});r.engine=n,f=n,t&&await L(n.files,e);const a=await n.request({op:"start",project:e,...t?{document:t}:{}});return t&&($=t),p={start:async()=>a,execute:async o=>{const s=await n.request({op:"execute",code:o});return s.error?`Error executing code: ${s.error}`:`Code executed successfully: ${s.result}`},sceneInfo:async()=>JSON.stringify(await n.request({op:"scene-info"}),null,2),objectInfo:async o=>JSON.stringify(await n.request({op:"object-info",name:o}),null,2),screenshotView:async o=>(await n.request({op:"present",capture:{size:o}}),JSON.stringify({view:{size:o}}))},{...a,engine:"blender-wasm",skew:n.skew,bootMs:Math.round(n.bootMs),releasedPayloadMB:n.releasedPayloadBytes===null?null:Math.round(n.releasedPayloadBytes/1048576)}}async function Y(){try{const e=await fetch("/__editor/blender-wasm/status");return e.ok?await e.json():{available:!1,missing:[`status answered ${e.status}`]}}catch(e){return{available:!1,missing:[String(e)]}}}async function Z(e,t){if(p)throw new Error("The Blender session is already started");if(!e.startsWith("/"))throw new Error("The Blender session needs the project's absolute path");if(t!==void 0&&!q(t))throw new Error(`The Blender document must be a project-relative .blend path with no traversal (models/model.blend); got ${JSON.stringify(t)}`);const r=await Y();if(!r.available)throw new Error(`Headless Blender is not served by this editor, so there is no modeling engine: ${r.missing.join("; ")}. The engine is Blender compiled to WebAssembly (packages/blender-engine/wasm, or the directory VGAI_BLENDER_WASM_DIR names); nothing stands in for it.`);return E=e,X(e,t)}function q(e){return!e.endsWith(".blend")||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(r=>r!==""&&r!=="."&&r!=="..")}const x=new Set;function k(e){x.has(e)||(x.add(e),O("error",e))}async function ee(e){const t=s=>(k(`The project's files are not readable from Python: ${s}`),null);let r;try{r=await fetch("/__editor/blender-project-index")}catch(s){return t(String(s))}if(!r.ok)return t(`/__editor/blender-project-index answered ${r.status}`);let n;try{if(n=await r.json(),typeof n?.root!="string"||!Array.isArray(n.files))return t("invalid project index")}catch(s){return t(String(s))}const{root:a,files:o}=n;return a!==e&&k(`The editor serving this tab has ${a} open, not ${e}; its files are mounted at ${e}, which is where Python is looking.`),o}const y=new Map;async function te(e,t){const r=await e.stat(t);return r?`${r.size}:${r.mtimeMs}`:""}async function L(e,t){const r=await ee(t);if(!r)return;const n=new Set(r.map(a=>`${t}/${a.path}`));for(const a of[...y.keys()])if(!n.has(a)){try{await e.unlink(a)}catch{}y.delete(a)}for(const a of r){const o=`${t}/${a.path}`,s=`${a.size}:${a.mtime}`;if(y.get(o)?.host===s||!y.has(o)&&await e.stat(o)!==null)continue;const i=await fetch(`/__editor/blender-project-file?path=${encodeURIComponent(a.path)}`);if(!i.ok){k(`${a.path}: HTTP ${i.status}`);continue}const c=o.slice(0,o.lastIndexOf("/"));c&&await e.mkdirTree(c),await e.writeFile(o,new Uint8Array(await i.arrayBuffer())),y.set(o,{host:s,engine:await te(e,o)})}}async function ne(e,t){const r=[],n=async a=>{let o;try{o=await e.readdir(a)}catch{return}for(const s of o){if(s==="."||s==="..")continue;const i=`${a.replace(/\/$/,"")}/${s}`,c=await e.stat(i);if(c){if((c.mode&61440)===16384){await n(i);continue}y.get(i)?.engine!==`${c.size}:${c.mtimeMs}`&&r.push({path:i,size:c.size,mtime:c.mtimeMs})}}};return await n(t),r}async function R(e){switch(e.op){case"start":return Z(e.project,e.document);case"present-result":{const n=j.get(e.id);j.delete(e.id),n&&(e.error?n.reject(new Error(e.error)):n.resolve({...e.capture===void 0?{}:{capture:e.capture},..."held"in e?{held:e.held}:{}}));return}}if(!p||!E||!f)throw new Error("The Blender session has not started");const t=f.files,r=f.request.bind(f);switch(e.op){case"flush-document":return B?(await F(),{saved:!0}):{saved:!1};case"history-begin":case"history-end":return r({op:e.op});case"history-step":return r({op:"history-step",token:e.token,direction:e.direction});case"execute":await L(t,E);{const n=await r({op:"execute",code:e.code,history:e.history??!0,label:e.label??"Blender Python"});return n.error?`Error executing code: ${n.error}`:`Code executed successfully: ${n.result}`}case"present":return r({op:"present"});case"scene-info":return p.sceneInfo();case"object-info":return p.objectInfo(e.name);case"rna":return r({op:"rna",path:e.path,...e.names===void 0?{}:{names:e.names}});case"rna-context":return r({op:"rna-context",...e.object===void 0?{}:{object:e.object},...e.collection===void 0?{}:{collection:e.collection}});case"rna-set":return r({op:"rna-set",history:e.history!==!1,path:e.path,property:e.property,value:e.value,...e.index===void 0?{}:{index:e.index}});case"outliner":return r({op:"outliner",...e.selected===void 0?{}:{selected:[...e.selected]}});case"node-tree":return r({op:"node-tree",...e.path===void 0?{}:{path:e.path},...e.material===void 0?{}:{material:e.material}});case"uv-layout":return r({op:"uv-layout",...e.object===void 0?{}:{object:e.object},...e.uvLayer===void 0?{}:{uvLayer:e.uvLayer}});case"rig":return r({op:"rig",...e.object===void 0?{}:{object:e.object}});case"action-clip":return r({op:"action-clip",...e.object===void 0?{}:{object:e.object},...e.bake===void 0?{}:{bake:e.bake}});case"outliner-set":return r({op:"outliner-set",path:e.path,column:e.column,value:e.value});case"screenshot-view":return JSON.parse(await p.screenshotView(e.maxSize));case"read-file":return t.readFile(e.path);case"write-file":{const n=e.path.slice(0,e.path.lastIndexOf("/"));n&&await t.mkdirTree(n),await t.writeFile(e.path,e.bytes),y.delete(e.path);return}case"list-files":return ne(t,e.path)}throw new Error(`Unknown Blender worker request ${e.op}`)}function g(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return typeof t.name=="string"?`${t.name}: ${t.message}`:t.message;try{return JSON.stringify(e)??Object.prototype.toString.call(e)}catch{return Object.prototype.toString.call(e)}}return String(e)}function re(){if(!f)return;const e=f.memoryBytes();e!==null&&b({op:"memory",bytes:e})}self.onmessage=e=>{const t=e.data;if(t.op==="present-result"){R(t);return}Q(()=>oe(t))};async function oe(e){try{const t=await R(e);B&&await F(),await I(),b({id:e.id,result:t})}catch(t){let r=g(t);try{await I()}catch(n){r+=`
|
|
2
2
|
Unable to deliver Blender history: ${g(n)}`}b({id:e.id,error:r})}re()}async function I(){if(!f||!p)return;const e=await f.request({op:"history-events"});e.length&&b({op:"history",entries:e})}export{N as A,se as P,d as S,ae as a,D as b,ie as o,C as s};
|