@volter/game-editor 0.5.65 → 0.5.66
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/BUNDLED_NOTICES +1962 -363
- package/catalog/entries/bake.json +0 -1
- package/catalog/entries/blender.json +2 -2
- package/catalog/entries/reflections.json +2 -4
- package/catalog/project-source/src/lib/bake/asset-seed.ts +1 -2
- package/catalog/project-source/src/lib/bake/clip-layering.ts +3 -4
- package/catalog/project-source/src/lib/bake/gltf-bake.ts +1 -1
- package/catalog/project-source/src/lib/bake/params.ts +3 -5
- package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +2 -3
- package/dist/.vite/manifest.json +2406 -2182
- package/dist/assets/{AssetBudgetPanel-J9--TZPU.js → AssetBudgetPanel-csYWK2H4.js} +8 -8
- package/dist/assets/{AudioViewer-CR7333fe.js → AudioViewer-BH_LUYs5.js} +1 -1
- package/dist/assets/{BVHLoader-6bQIXhMX.js → BVHLoader-Jkzh8hMf.js} +1 -1
- package/dist/assets/BufferGeometryUtils-CAbuTPOA.js +1 -0
- package/dist/assets/{CCDIKSolver-CD7vLpsK.js → CCDIKSolver-D4NvkJ8d.js} +1 -1
- package/dist/assets/{CSS3DRenderer-CL7ABLVK.js → CSS3DRenderer-CAS2WZZy.js} +1 -1
- package/dist/assets/CanvasSceneViewport-BlsRTk-X.js +1 -0
- package/dist/assets/ColladaLoader-DxYB89DA.js +3 -0
- package/dist/assets/{ColorInput-DQBNrW-K.js → ColorInput-CPQNsDf1.js} +1 -1
- package/dist/assets/{ConvexGeometry-CAzXlPVG.js → ConvexGeometry-Dinf-sev.js} +1 -1
- package/dist/assets/{ConvexHull-BINCESFp.js → ConvexHull-CrJ8FY-w.js} +1 -1
- package/dist/assets/{DecalGeometry-160KRdfg.js → DecalGeometry-owkbefLa.js} +1 -1
- package/dist/assets/EffectComposer-BHDH-NLz.js +1 -0
- package/dist/assets/EntityModelDocument-DuQivdvc.js +1 -0
- package/dist/assets/EnvironmentAssetDocument-CnTEMn3A.js +1 -0
- package/dist/assets/FBXLoader-BMUbIhtE.js +1 -0
- package/dist/assets/Fbo-DrK7CWlB.js +1 -0
- package/dist/assets/{FontLoader-CvGoVI5a.js → FontLoader-BR_K6Baw.js} +2 -2
- package/dist/assets/GLTFExporter-BZqAQJbw.js +1 -0
- package/dist/assets/{GameplaySessionTimeline-B52W3FVZ.js → GameplaySessionTimeline-Crqwv2fP.js} +1 -1
- package/dist/assets/Gltf-7cVbZUzT.js +2 -0
- package/dist/assets/ImageViewer-BkFie7Hm.js +1 -0
- package/dist/assets/InspectorObjectPreview-Dl3tyJBn.js +1 -0
- package/dist/assets/JsonAssetDocument-BUFzubHM.js +2 -0
- package/dist/assets/{LineSegments2-CsOpKSiM.js → LineSegments2-Cicm_Hu1.js} +2 -2
- package/dist/assets/LiveModuleDocument-C3OQxiba.js +1 -0
- package/dist/assets/LutAssetDocument-DVzd1RZ9.js +1 -0
- package/dist/assets/{MTLLoader-_Xzd4_0p.js → MTLLoader-Bg_grNiT.js} +2 -2
- package/dist/assets/{MarchingCubes-Bsp4wrzd.js → MarchingCubes-a78AL3HB.js} +1 -1
- package/dist/assets/MeshBVH-BCSLNEeP.js +1 -0
- package/dist/assets/ModelAssetDocument-pN84goRT.js +1 -0
- package/dist/assets/{NonThreeAuthoringBootstrap-C3woOMxX.js → NonThreeAuthoringBootstrap-BKNejRiW.js} +1 -1
- package/dist/assets/{OBJLoader-BhIC6Hwo.js → OBJLoader-BiwzVj5b.js} +2 -2
- package/dist/assets/Object3DDocumentToolbar-D5Bg5FEf.js +1 -0
- package/dist/assets/Object3DDocumentViewport-DFHqru3a.js +2 -0
- package/dist/assets/Object3DPreview-BTtZ-41z.js +2 -0
- package/dist/assets/OnlineAssetDetail-BAqozdAp.js +1 -0
- package/dist/assets/{OrbitControls-DLpayAaK.js → OrbitControls-CzKVCORl.js} +1 -1
- package/dist/assets/{OrbitControls-CM3bPray.js → OrbitControls-CzTRRI7x.js} +1 -1
- package/dist/assets/{OrthographicCamera-bQozawrh.js → OrthographicCamera-CSDDsvu7.js} +1 -1
- package/dist/assets/{PLYLoader-DYQqs5Ik.js → PLYLoader-QxrxxMpE.js} +2 -2
- package/dist/assets/{PerspectiveCamera-CQ2lh01o.js → PerspectiveCamera-DzD_NfVh.js} +1 -1
- package/dist/assets/PlayBar-qVJpgwJt.js +2 -0
- package/dist/assets/QuarksAssetDocument-B4vBlUsS.js +2 -0
- package/dist/assets/RGBELoader-WQ7xZofE.js +1 -0
- package/dist/assets/RectAreaLightUniformsLib-CwcuoVqt.js +1 -0
- package/dist/assets/{RenderPass-DPrn-Uky.js → RenderPass-C_CeQNdh.js} +1 -1
- package/dist/assets/{ResolutionPicker-C67vs1F3.js → ResolutionPicker-DpHVJxn5.js} +1 -1
- package/dist/assets/RootSelectionOverlay-BxvsunO4.js +1 -0
- package/dist/assets/{RoundedBox-BDGBg6QZ.js → RoundedBox-B_cZ0NFy.js} +1 -1
- package/dist/assets/{RoundedBoxGeometry-CyUuYPfW.js → RoundedBoxGeometry-Y4rcSIvX.js} +1 -1
- package/dist/assets/STLLoader-Bej_Nkpr.js +1 -0
- package/dist/assets/{SelectionBox-D_75KrNW.js → SelectionBox-Cn9vm7f9.js} +1 -1
- package/dist/assets/ShaderAssetDocument-Dx2x8CLr.js +12 -0
- package/dist/assets/{ShaderPass-QYRpPuFJ.js → ShaderPass-qtkA7CQ8.js} +1 -1
- package/dist/assets/{ShadowEditor-DkImwu1Y.js → ShadowEditor-BEIUkrHL.js} +1 -1
- package/dist/assets/SimplifyModifier-D2EesGr2.js +1 -0
- package/dist/assets/{SkeletonUtils-Cps8GOC6.js → SkeletonUtils-C8ayciDc.js} +1 -1
- package/dist/assets/{Sky-CQKCgYDs.js → Sky-BBpnAJZV.js} +1 -1
- package/dist/assets/SourceAssetViewer-BpMbbuy6.js +1 -0
- package/dist/assets/StageHost-lB8f---y.js +2 -0
- package/dist/assets/{StoryPreviewMount-DjyxRCXu.js → StoryPreviewMount-BIfxmkYh.js} +1 -1
- package/dist/assets/{TDSLoader-D_T8XJ81.js → TDSLoader-rHl5Uwc0.js} +1 -1
- package/dist/assets/{TextGeometry-DOWAEUV0.js → TextGeometry-BRHSufuM.js} +1 -1
- package/dist/assets/ThreeBoardDocument-BHV92Ia3.js +2 -0
- package/dist/assets/{ThreeIsolationSceneContent-C8C8whSF.js → ThreeIsolationSceneContent-BqtgDHBK.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-BRoDWe4Q.js → ToolObject3DPreview-CcaPJTyH.js} +1 -1
- package/dist/assets/Toolbar-keHcSvDD.js +1 -0
- package/dist/assets/{TrackballControls-DfznuQTh.js → TrackballControls-Cce-6Ff5.js} +1 -1
- package/dist/assets/{TransientHint-BB1fwrvK.js → TransientHint-Dlslh3oX.js} +1 -1
- package/dist/assets/{UnrealBloomPass-CR-cS_K5.js → UnrealBloomPass-DiseEiFK.js} +2 -2
- package/dist/assets/{VideoViewer-C6kocgIU.js → VideoViewer-naGSXHd6.js} +1 -1
- package/dist/assets/ViewportShadingMenu-C7Hdhtca.js +1 -0
- package/dist/assets/{active-ingest-CT6jSGhr.js → active-ingest-DEgq9JiA.js} +3 -3
- package/dist/assets/{animation-clock-CnjZqfJp.js → animation-clock-lTIb6nk3.js} +1 -1
- package/dist/assets/animation-mixers.service-2O2rVwQf.js +1 -0
- package/dist/assets/asset-budget-asset.menu-9NhdHAC9.js +1 -0
- package/dist/assets/asset-budget.action-yg6-luUJ.js +1 -0
- package/dist/assets/asset-budget.document-B46_VFqa.js +1 -0
- package/dist/assets/asset-budget.menu-DuH07N-e.js +1 -0
- package/dist/assets/{asset-editor-persistence-BBaONOJt.js → asset-editor-persistence-BVtzjadu.js} +1 -1
- package/dist/assets/{asset-loaders-BOy5Ss8k.js → asset-loaders-BxG1LykH.js} +2 -2
- package/dist/assets/{assets-BuSoGjBX.js → assets-Do88ZdV_.js} +1 -1
- package/dist/assets/{audio-unlock.service-CfUgUQVy.js → audio-unlock.service-BJH0mWvX.js} +1 -1
- package/dist/assets/{audio.utility-C6K6jem8.js → audio.utility-Cp4aVYFU.js} +1 -1
- package/dist/assets/autoplay.service-FxpRy7Ev.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-CL02gWDn.js → babylon-authoring-adapter-B_8iE8fK.js} +1 -1
- package/dist/assets/{binding-resolver-Dsh-6Vor.js → binding-resolver-BWwG10zJ.js} +2 -2
- package/dist/assets/blender-emscripten-engine-CEsWgnR7.js +2 -0
- package/dist/assets/{blender-node-editor.document-iIDkB9sI.js → blender-node-editor.document-DTgwy8KC.js} +1 -1
- package/dist/assets/blender-properties-tab-DWSJpkxq.js +3 -0
- package/dist/assets/blender-runtime-host-OGjPjTrG.js +4 -0
- package/dist/assets/{blender-runtime-skin-DyQ9B6CR.js → blender-runtime-skin-DymtXlpt.js} +37 -39
- package/dist/assets/blender-runtime.document-CzH2ohHR.js +8 -0
- package/dist/assets/{blender-timeline.document-77fx96N7.js → blender-timeline.document-BRy_QPHt.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-fsT7B4gV.js → blender-uv-editor.document-D-AbUCqz.js} +1 -1
- package/dist/assets/{blender-version.status-o6dBm3n6.js → blender-version.status-B7flzX_7.js} +1 -1
- package/dist/assets/{blender-wali-engine-wTOcrOMC.js → blender-wali-engine-D3iKpzn9.js} +1 -1
- package/dist/assets/blender.command-BVHtgTQy.js +1 -0
- package/dist/assets/blender.environment-CG-pC7sk.js +1 -0
- package/dist/assets/{blender.style-Dcem5f_T.js → blender.style-CxfbTFcE.js} +1 -1
- package/dist/assets/{board-guides-DziKSTss.js → board-guides-C3usUZZk.js} +1 -1
- package/dist/assets/body-marks-D8iaje6y.js +1 -0
- package/dist/assets/bridge.command-BF9u6r0A.js +3 -0
- package/dist/assets/browserAll-38aBu-cf.js +1 -0
- package/dist/assets/{build-profiles.document-kW8iw8Xj.js → build-profiles.document-DO7oNRuo.js} +2 -2
- package/dist/assets/{build-progress.status-BNRLytg2.js → build-progress.status-COeNVhYd.js} +1 -1
- package/dist/assets/{build-session-C_sg3CEn.js → build-session-IWIriS5P.js} +1 -1
- package/dist/assets/{build.action-lYjTLb7K.js → build.action-DlkFvZf6.js} +1 -1
- package/dist/assets/{build.command-DIGgUPU_.js → build.command-DPqQIYj_.js} +1 -1
- package/dist/assets/{build.header-CKajx5U3.js → build.header-CNLG-pV8.js} +1 -1
- package/dist/assets/{build.menu-BdU0QXny.js → build.menu-hUlH6loi.js} +1 -1
- package/dist/assets/{build.service-CbBAyeu3.js → build.service-C86Td3_9.js} +1 -1
- package/dist/assets/{camera-KEsKvOL7.js → camera-CKbyBXMe.js} +1 -1
- package/dist/assets/camera-authoring-Ci3KnE-W.js +1 -0
- package/dist/assets/{camera-runtime.inspector-B7unX4g1.js → camera-runtime.inspector-DdR3P2BF.js} +1 -1
- package/dist/assets/canvas-entry-runtime-E5YjSgre.js +2 -0
- package/dist/assets/canvas-preview-frames-CiAx7dpV.js +1 -0
- package/dist/assets/{capability-coverage-Czas4C18.js → capability-coverage-CfUeULDN.js} +5 -5
- package/dist/assets/city-EkhAOo5s.exr +0 -0
- package/dist/assets/{collaboration-presence-DLoZ7EA3.js → collaboration-presence-CSLFNT7m.js} +1 -1
- package/dist/assets/{collider-Bw0mXlsW.js → collider-DRSaLRM9.js} +1 -1
- package/dist/assets/{component-board.service-DCwcUssB.js → component-board.service-B7Sv8b7m.js} +2 -2
- package/dist/assets/component-board.service-B8UHw8dn.js +2 -0
- package/dist/assets/component-contracts.service-LFGekycZ.js +1 -0
- package/dist/assets/{component-verbs.command-7xzfjGMZ.js → component-verbs.command-D4SvFjfG.js} +1 -1
- package/dist/assets/component-verbs.service-TGvWxf2b.js +1 -0
- package/dist/assets/{config-CEZk921y.js → config-DB_RH-hO.js} +3 -3
- package/dist/assets/{configurations-DTBMdaTL.js → configurations-C2qgJNnW.js} +1 -1
- package/dist/assets/{connection.status-BifnQdOs.js → connection.status-CG7X2brL.js} +1 -1
- package/dist/assets/{console-bridge-CHcb-xk5.js → console-bridge-B5Ltae37.js} +1 -1
- package/dist/assets/{constraint-De8f1Uiq.js → constraint-C_Jj7dXy.js} +1 -1
- package/dist/assets/constraints.inspector-D6QZJS4b.js +1 -0
- package/dist/assets/courtyard-DqlebbpC.exr +0 -0
- package/dist/assets/coverage.service-Clo86874.js +3 -0
- package/dist/assets/{create-runtime-CVCc1BDx.js → create-runtime-lmA910XT.js} +1 -1
- package/dist/assets/{curve-7Q79VgU4.js → curve-6-TR6dNb.js} +1 -1
- package/dist/assets/{data-asset-4hjS642k.js → data-asset-BNbd309U.js} +1 -1
- package/dist/assets/{data-ref-CQI28C0D.js → data-ref-Dvmd7eb1.js} +1 -1
- package/dist/assets/{debug-bridge-CCohG-d-.js → debug-bridge-BUNhgyY6.js} +1 -1
- package/dist/assets/{debug-registry-Dgvitx8M.js → debug-registry-B3Cnne3x.js} +1 -1
- package/dist/assets/deferred-ingest-play-7V8OrW3e.js +2 -0
- package/dist/assets/design-time-layers-g9VS6amb.js +1 -0
- package/dist/assets/design-time-mount.service-HtMr_vBd.js +2 -0
- package/dist/assets/design-time-react-mount-Dx6fJ-Hg.js +1 -0
- package/dist/assets/{directional-shadow-fit-BVkOKAv2.js → directional-shadow-fit-Cjz_Eg2b.js} +1 -1
- package/dist/assets/{document-preview-three-Kbg2GCLm.js → document-preview-three-C3y0syYQ.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-CY8C7f4T.js → dom-authoring-adapter-CEeFyatF.js} +1 -1
- package/dist/assets/{draco3d-BBUTcNkz.js → draco3d-FKy0apkb.js} +1 -1
- package/dist/assets/drei-asset-caches-jJoHXbTj.js +2 -0
- package/dist/assets/{edit-mode-audio.service-Bzetwd5B.js → edit-mode-audio.service-DZTnrW6t.js} +1 -1
- package/dist/assets/edit-mode-authoring-D_BiHCQj.js +1 -0
- package/dist/assets/{edit-mode-networking.service-YCX6RRb_.js → edit-mode-networking.service-BzMI2VxO.js} +1 -1
- package/dist/assets/editor-api-Bzmo0o8_.js +1 -0
- package/dist/assets/{entry-adjudication-Cq8Yeb74.js → entry-adjudication-BYy7TXOB.js} +1 -1
- package/dist/assets/{events-156d8d12.esm-ErOhDXXB.js → events-156d8d12.esm-C734MYnx.js} +7 -7
- package/dist/assets/{extend-B-eOccUm.js → extend-CLG0ymiX.js} +1 -1
- package/dist/assets/forest-P_CQY3b_.exr +0 -0
- package/dist/assets/fork-menu-De7HU6_H.js +1 -0
- package/dist/assets/{frame-debugger-store-D1Mf_5up.js → frame-debugger-store-BZgIOlU6.js} +1 -1
- package/dist/assets/{game-DHOZVb-7.js → game-D5EJoILQ.js} +1 -1
- package/dist/assets/{game-contract-seams-a5YXejOu.js → game-contract-seams-TCpIMmHP.js} +1 -1
- package/dist/assets/{game-css-scope-transform-Eng4wS8E.js → game-css-scope-transform-NbpajQr-.js} +1 -1
- package/dist/assets/game-document.service-6eRlrI-d.js +1 -0
- package/dist/assets/game-eval.command-hKnSMlX0.js +2 -0
- package/dist/assets/{game-input-seams-CIQdetRw.js → game-input-seams-BC6xhZy3.js} +1 -1
- package/dist/assets/{game-module-access-B2mFxv-i.js → game-module-access-ry3xb1Ix.js} +1 -1
- package/dist/assets/{gameplay-export-BoKXm51x.js → gameplay-export-DiLQuPpn.js} +1 -1
- package/dist/assets/gameplay-replay-Bsre-1K8.js +1 -0
- package/dist/assets/{gameplay-rng-trap-CTNhm-UW.js → gameplay-rng-trap-BhRx_CtU.js} +1 -1
- package/dist/assets/gameplay.command-BqiyGn-I.js +1 -0
- package/dist/assets/{generation-jobs-BQrXbGp_.js → generation-jobs-BYcpgeGk.js} +1 -1
- package/dist/assets/generation.service-O81IqA-6.js +1 -0
- package/dist/assets/{generations-DzUogZsM.js → generations-CsGQ3twi.js} +1 -1
- package/dist/assets/{generations.status-CgOUBCum.js → generations.status-C3YU0_ml.js} +1 -1
- package/dist/assets/godot.style-DxJaFWOP.js +1 -0
- package/dist/assets/godot.view-BFsHk8b2.js +1 -0
- package/dist/assets/{hosted-asset-materialization-CiIvWkGU.js → hosted-asset-materialization-Bk-plQF6.js} +2 -2
- package/dist/assets/{ibl-override-material-BlmCxFKq.js → ibl-override-material-BhbGwgS1.js} +1 -1
- package/dist/assets/{index-mjWQmGhM.js → index-0n9eSzwT.js} +1 -1
- package/dist/assets/index-B4bmKkgY.css +1 -0
- package/dist/assets/index-BLo2LE8C.js +3404 -0
- package/dist/assets/index-BWW4-DBH.js +1 -0
- package/dist/assets/index-CLcsjKUs.js +1 -0
- package/dist/assets/index-CU5YUq-x.js +134 -0
- package/dist/assets/{index-DUpHH6JR.js → index-Cb6o_Td_.js} +1 -1
- package/dist/assets/index-Ckxb31Yz.js +1500 -0
- package/dist/assets/index-CnpsJMao.js +1 -0
- package/dist/assets/index-Cr23XhNm.js +1 -0
- package/dist/assets/index-DO1rWQ_r.js +487 -0
- package/dist/assets/{index-BcCBqgM_.js → index-DUh02lTr.js} +1 -1
- package/dist/assets/index-DXEHfb0b.js +1 -0
- package/dist/assets/{index-V1R-e5Bd.js → index-wRCvCebM.js} +1 -1
- package/dist/assets/{inference-diagnostics-Dhmtfbq_.js → inference-diagnostics-YW0yJkKx.js} +1 -1
- package/dist/assets/{ingest-BbYMC2vQ.js → ingest-BlQnR7s3.js} +1 -1
- package/dist/assets/ingest-boot-viewport-uG9jQ1zm.js +1 -0
- package/dist/assets/ingest-siblings-DRQXSWax.js +1 -0
- package/dist/assets/{ingest-source-persistence-C_6Hiyra.js → ingest-source-persistence-DH6ioCOu.js} +1 -1
- package/dist/assets/{ingest.service-BTDnQfM1.js → ingest.service-GeaWMaZX.js} +1 -1
- package/dist/assets/{input-manager-DH_hGW6d.js → input-manager-Cxx3RJgG.js} +1 -1
- package/dist/assets/{input-router-BNQvtIqw.js → input-router-FzxO5ld6.js} +1 -1
- package/dist/assets/{inspect-BZfi3mmo.js → inspect-BRgDdtVk.js} +1 -1
- package/dist/assets/instances.command-CFOMPSj3.js +1 -0
- package/dist/assets/{instruments-CKR02Y8I.js → instruments-IKn-vvNb.js} +1 -1
- package/dist/assets/interior-Bo_lba15.exr +0 -0
- package/dist/assets/{json-history-resource-BbxllWfV.js → json-history-resource-r-9q_hxP.js} +1 -1
- package/dist/assets/{light-D-_wsKTq.js → light-CFAor97k.js} +1 -1
- package/dist/assets/light-camera-factory-D1sgz3YB.js +1 -0
- package/dist/assets/live-mixers-BRkRHd6g.js +1 -0
- package/dist/assets/{loader-CaF_I7Yt.js → loader-BbMsvIxP.js} +1 -1
- package/dist/assets/machine.document-CgmsOh-s.js +24 -0
- package/dist/assets/machines.finder-nxiCgQc2.js +1 -0
- package/dist/assets/matcap-texture-Dh65bX5V.js +1 -0
- package/dist/assets/{material-CpAdjDxn.js → material-D5kXEZWQ.js} +1 -1
- package/dist/assets/{material-factory-Bz6h__6g.js → material-factory-0Qb0VuZ5.js} +1 -1
- package/dist/assets/material-preview.view-DqNcpd_b.js +1 -0
- package/dist/assets/{mesh-B3WPtNKO.js → mesh-BKPgNTwh.js} +1 -1
- package/dist/assets/{mesh-shadow-CZnXrw_l.js → mesh-shadow-BDQP4mHs.js} +1 -1
- package/dist/assets/model-asset-sections.service-DWPLmkqa.js +1 -0
- package/dist/assets/model-inspection-Cxfg_Fei.js +1 -0
- package/dist/assets/model.layout-BpZE1W9V.js +1 -0
- package/dist/assets/{models.finder-G2jQgIRu.js → models.finder-DHW17ZEa.js} +1 -1
- package/dist/assets/module-mode-CRfHyIMS.js +2 -0
- package/dist/assets/mount-canvas-ingest-root-BZZ8M3Lu.js +2 -0
- package/dist/assets/mount-dom-ingest-root-D1GV6Jjt.js +2 -0
- package/dist/assets/{mount-game-6t9cKNo4.js → mount-game-F9e76auh.js} +1 -1
- package/dist/assets/mount-ingest-root-B5D-Lmmk.js +2 -0
- package/dist/assets/{mount-manifest-CGVxhmAw.js → mount-manifest-cYRhgHfo.js} +1 -1
- package/dist/assets/mount-three-ingest-root-BNnouaBn.js +1 -0
- package/dist/assets/{mounted-authoring-Dmg5xmhP.js → mounted-authoring-TIN5EnCb.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-DjP6RA9U.js → mounted-story-viewport-source-CAlEmE0_.js} +1 -1
- package/dist/assets/{native-debug-module-CWicoSGD.js → native-debug-module-j-MekcLS.js} +1 -1
- package/dist/assets/{navigation-CIiCx-SM.js → navigation-DmR1BDVo.js} +1 -1
- package/dist/assets/{navmesh.menu-CAKiH8PW.js → navmesh.menu-FhL1pGx1.js} +1 -1
- package/dist/assets/{navmesh.service-jgDWlgj1.js → navmesh.service-usyDeJlm.js} +1 -1
- package/dist/assets/{network.utility-CEu5nHf7.js → network.utility-BPh4hTmh.js} +1 -1
- package/dist/assets/night-CvV4Gybt.exr +0 -0
- package/dist/assets/{object3d-authoring-subject-CH5sI2oP.js → object3d-authoring-subject-CyE4rQ2A.js} +1 -1
- package/dist/assets/oid-transform-BOqL6YH6.js +2 -0
- package/dist/assets/{particles-Y626p22p.js → particles-C47L-dda.js} +1 -1
- package/dist/assets/particles-factory-CRqPLdS7.js +1 -0
- package/dist/assets/pixi-authoring-adapter-C5Ikqj5-.js +1 -0
- package/dist/assets/{pixi-live-write-target-DuWydlWb.js → pixi-live-write-target-OWBk79dp.js} +1 -1
- package/dist/assets/pixi-primitive-D5igywJ_.js +1 -0
- package/dist/assets/pixi-react-root-factory-9lZ0Yz-n.js +1 -0
- package/dist/assets/play-mode-DomOvQie.js +22 -0
- package/dist/assets/play.command-DoqjH-Pp.js +2 -0
- package/dist/assets/{playtest-BXIL1JEF.js → playtest-BnFenMBW.js} +1 -1
- package/dist/assets/{pose-guard-6Osb2cFu.js → pose-guard-Bb3gZOzk.js} +1 -1
- package/dist/assets/{product-DFhyARJj.js → product-CTDJoVo5.js} +1 -1
- package/dist/assets/{profiler.action-CaXJDp3t.js → profiler.action-C_OFGkDw.js} +1 -1
- package/dist/assets/{profiler.menu-BIMF6Bi4.js → profiler.menu-BJbnVoo4.js} +1 -1
- package/dist/assets/{profiler.utility-BExw9wBO.js → profiler.utility-qpfhuwRw.js} +1 -1
- package/dist/assets/project-authoring-session-BV-MM8Fl.js +2 -0
- package/dist/assets/{project-provenance-BoP3nrle.js → project-provenance-4ldz-EOG.js} +1 -1
- package/dist/assets/{properties-bone-constraints.inspector-ByT6p7S-.js → properties-bone-constraints.inspector-C-ByIdg1.js} +1 -1
- package/dist/assets/{properties-bone.inspector-z4qJwKO5.js → properties-bone.inspector-CXY0xCQB.js} +1 -1
- package/dist/assets/{properties-collection.inspector-D0_3ijWU.js → properties-collection.inspector-DIfkZAel.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-CESzjuls.js → properties-constraints.inspector-BaunL5nT.js} +1 -1
- package/dist/assets/{properties-data.inspector-hG8Wgyzb.js → properties-data.inspector-DQD-jfO2.js} +1 -1
- package/dist/assets/{properties-material.inspector-CzY0JCQ6.js → properties-material.inspector-A0HZ4SX6.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-3dDhwf7g.js → properties-modifiers.inspector-GUnVhVwZ.js} +1 -1
- package/dist/assets/{properties-object.inspector-CiarfxkT.js → properties-object.inspector-Chsfa4Xa.js} +1 -1
- package/dist/assets/{properties-output.inspector-DKJxmKSD.js → properties-output.inspector-U7ZmD0Me.js} +1 -1
- package/dist/assets/{properties-particles.inspector-CCEdYWGm.js → properties-particles.inspector-umkW-OlI.js} +1 -1
- package/dist/assets/{properties-physics.inspector-B2c0KUyA.js → properties-physics.inspector-CLVBlWwL.js} +1 -1
- package/dist/assets/{properties-render.inspector-Bcm0HLRW.js → properties-render.inspector-D0u9taKy.js} +1 -1
- package/dist/assets/{properties-scene.inspector-PIM_eTb_.js → properties-scene.inspector-JwGCZQAx.js} +1 -1
- package/dist/assets/{properties-texture.inspector-CgFlnyr8.js → properties-texture.inspector-B1vC28pw.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-DGjF_Aqo.js → properties-view-layer.inspector-BuUKyBFp.js} +1 -1
- package/dist/assets/{properties-world.inspector-CrMvaRvB.js → properties-world.inspector-VXUj4dT4.js} +1 -1
- package/dist/assets/r3f-design-session-qJ2v5SrB.js +2 -0
- package/dist/assets/r3f-physics-binding-C8OqNRG2.js +1 -0
- package/dist/assets/{r3f-root-factory-z9llD1OU.js → r3f-root-factory-DjGnbU4n.js} +1 -1
- package/dist/assets/r3f-source-authoring-adapter-CG9heazM.js +12 -0
- package/dist/assets/{rapier-physics-bridge-CMoeVo3Y.js → rapier-physics-bridge-B-EK7KYV.js} +1 -1
- package/dist/assets/react-inspector.service-DWeXDHJq.js +1 -0
- package/dist/assets/{react-root-CEz5NTck.js → react-root-DGLRLr-F.js} +1 -1
- package/dist/assets/react-story-board-CSqHY0Cg.js +1 -0
- package/dist/assets/{react-three-fiber.esm-CycrbDlA.js → react-three-fiber.esm-BxIoqVh1.js} +1 -1
- package/dist/assets/{react-three-rapier.esm-CEfKpvxT.js → react-three-rapier.esm-BYzLhdSV.js} +1 -1
- package/dist/assets/react-world-authoring-adapter-BMT9kLWU.js +1 -0
- package/dist/assets/{realm-services-CobQsq_X.js → realm-services-D25JHoqD.js} +1 -1
- package/dist/assets/{reflection-probe-Don-M3Fj.js → reflection-probe-CqXWlicu.js} +1 -1
- package/dist/assets/{reflection-probe-capture.inspector-CmFUoJCx.js → reflection-probe-capture.inspector-B7Qa30vB.js} +1 -1
- package/dist/assets/regions-DWeEBnE2.js +1 -0
- package/dist/assets/{register-render-vitals-BiZk29b2.js → register-render-vitals-BO7x64kR.js} +1 -1
- package/dist/assets/{registry-02YZjMNp.js → registry-DlTluc4x.js} +1 -1
- package/dist/assets/{render-audio-control-vMRlePWb.js → render-audio-control-DCa_bOBI.js} +1 -1
- package/dist/assets/{render-batch-system-0vq7p0VC.js → render-batch-system-CzCp9YKM.js} +1 -1
- package/dist/assets/{render-control-Df3yTiyr.js → render-control-BNQr1eNO.js} +1 -1
- package/dist/assets/{render-env-D2IV2x5k.js → render-env-emvlfeTG.js} +1 -1
- package/dist/assets/{render-features-CPQ_e568.js → render-features-COF7MSQ9.js} +1 -1
- package/dist/assets/{render-settings-Bw4W9SYF.js → render-settings-C_kIMq8Y.js} +1 -1
- package/dist/assets/{resolve-three-SZE_WWUM.js → resolve-three-C-nx-QdA.js} +13 -13
- package/dist/assets/{root-seam-contract-Z0VWX3Bk.js → root-seam-contract-C7GOxf5x.js} +1 -1
- package/dist/assets/{run-ticks-settled-C4ksViyA.js → run-ticks-settled-B0cTtmhQ.js} +1 -1
- package/dist/assets/{scene-capture-CGYF-Viw.js → scene-capture-CLOc7GXc.js} +1 -1
- package/dist/assets/{scene-capture-BQKzU0NT.js → scene-capture-D10Nxkvp.js} +1 -1
- package/dist/assets/scene-document.service-B7kAVTko.js +2 -0
- package/dist/assets/{scene-framing-Cat0GtyJ.js → scene-framing-50N7SKuX.js} +1 -1
- package/dist/assets/{scene-index-B6BZOHMk.js → scene-index-Bce459yu.js} +1 -1
- package/dist/assets/{scene-query-C7_N-TpI.js → scene-query-IUZhw6pA.js} +1 -1
- package/dist/assets/{schema-kl9-2B_J.js → schema-Iy-mbzll.js} +1 -1
- package/dist/assets/sculpt.layout-D-K5cLw6.js +1 -0
- package/dist/assets/{seeded-random-i3mtgBKZ.js → seeded-random-CN0scLZj.js} +1 -1
- package/dist/assets/{session-CZ5JPg-z.js → session-CsR0lApe.js} +24 -15
- package/dist/assets/{setup-audio-S8GQF91f.js → setup-audio-BJ18gvXZ.js} +1 -1
- package/dist/assets/setup-particles-B6H-GbAA.js +1 -0
- package/dist/assets/{setup-physics-BeZ7-LKD.js → setup-physics-GugbTT0J.js} +1 -1
- package/dist/assets/{setup-renderer-DVXaSGin.js → setup-renderer-wt_a-p8r.js} +20 -20
- package/dist/assets/shading.layout-CZZHKBer.js +1 -0
- package/dist/assets/{sim-clock-CLflx7kg.js → sim-clock-DEfbb_-P.js} +1 -1
- package/dist/assets/{soft-particle-depth-DGvfQDi1.js → soft-particle-depth-CKUS1j0Y.js} +1 -1
- package/dist/assets/source-object3d-authoring-adapter-CfHQLFAL.js +1 -0
- package/dist/assets/{source-persistence-backend-C-aR-B_Y.js → source-persistence-backend-_-JMEXxE.js} +1 -1
- package/dist/assets/{spark-renderer-lifecycle-ynWESJcv.js → spark-renderer-lifecycle-9mnMW3Z4.js} +1 -1
- package/dist/assets/{spark.module-4pXQoz5d.js → spark.module-CXth-y_a.js} +1 -1
- package/dist/assets/stage-keyboard-C0FdDLOQ.js +1 -0
- package/dist/assets/stage-overlay-set-CwhCzbOy.js +1 -0
- package/dist/assets/stage-presence-markers-DVMDKiB-.js +1 -0
- package/dist/assets/stage-transform-tools-B09Z7v0o.js +1 -0
- package/dist/assets/standard-viewport-dressing-GUUr6GuK.js +20 -0
- package/dist/assets/{state-watch.action-BOvQR2qt.js → state-watch.action-CgF8qoFC.js} +1 -1
- package/dist/assets/{state-watch.menu-CNLvDeeY.js → state-watch.menu-CIMncESW.js} +1 -1
- package/dist/assets/{state-watch.utility-Bg1tTTQU.js → state-watch.utility-zTHkUALC.js} +1 -1
- package/dist/assets/static-batch-advisor-DqfXWRUq.js +1 -0
- package/dist/assets/story-capture-COQgezzl.js +1 -0
- package/dist/assets/story-documents-DQ0KORmd.js +3 -0
- package/dist/assets/story-documents.service-DOSaqPqv.js +1 -0
- package/dist/assets/story-documents.service-Gb7oUkbg.js +1 -0
- package/dist/assets/{story-media-presence-BHzk2IV5.js → story-media-presence-nW3zJqKv.js} +1 -1
- package/dist/assets/story-pixi-preview-COPTEsHo.js +1 -0
- package/dist/assets/story-presentation-CxADj5oz.js +1 -0
- package/dist/assets/{story-three-preview-BHEDZzcl.js → story-three-preview-C9W__8Or.js} +2 -2
- package/dist/assets/{structural-ids-Dc-7rEwi.js → structural-ids-CblajJQK.js} +1 -1
- package/dist/assets/studio-CysTBGIb.exr +0 -0
- package/dist/assets/sunrise-Dj0psFrf.exr +0 -0
- package/dist/assets/sunset-Bw3x2Bot.exr +0 -0
- package/dist/assets/{surface-state-DaxyruCj.js → surface-state-BAUJu6GY.js} +1 -1
- package/dist/assets/{system-runner-DkOjxEBt.js → system-runner-D_DtVrer.js} +1 -1
- package/dist/assets/team-playtest.service--79O6xkx.js +1 -0
- package/dist/assets/{three-CDSueJyJ.js → three-DSsr_Lvp.js} +1 -1
- package/dist/assets/{three-authoring-adapter-CmSQ3Vui.js → three-authoring-adapter-Yqsank46.js} +1 -1
- package/dist/assets/three-authoring.service-BDos-bRt.js +2 -0
- package/dist/assets/{three-ingest-runtime-QzDYk6tU.js → three-ingest-runtime-DWijtqQ8.js} +1 -1
- package/dist/assets/{three-projection-core-BmKMZ-nf.js → three-projection-core-kubBTx0s.js} +1 -1
- package/dist/assets/three-story-model-BraQFA9h.js +1 -0
- package/dist/assets/three-viewport-presentation-BL7Uc2i6.js +1 -0
- package/dist/assets/{three.module-D396a9Mn.js → three.module-IFn-4i31.js} +1 -1
- package/dist/assets/three.quarks.esm-CRKGjKAH.js +1039 -0
- package/dist/assets/transform-mode-request-Cu7ewbtr.js +1 -0
- package/dist/assets/{transform-writer-BhBBTx33.js → transform-writer-DXxrI4t7.js} +1 -1
- package/dist/assets/transport.header-CeND8Vzh.js +1 -0
- package/dist/assets/{trigger-volume-BNK2XzPL.js → trigger-volume-BCVRS3NM.js} +1 -1
- package/dist/assets/{tuples-CIQ4Bn1U.js → tuples-DKDGrN1t.js} +1 -1
- package/dist/assets/ui-board-document-DD2CAEAo.js +2 -0
- package/dist/assets/unity.style-vCmLw4gI.js +1 -0
- package/dist/assets/unity.view-DIn2S6Do.js +1 -0
- package/dist/assets/unreal.style-BQn-HhOX.js +1 -0
- package/dist/assets/unreal.view-adNBETZK.js +1 -0
- package/dist/assets/user-data-CZqsJDk-.js +1 -0
- package/dist/assets/{utility-view-state-BHypxA33.js → utility-view-state-DYJY8V8O.js} +1 -1
- package/dist/assets/uv-editing.layout-A8RA-cbM.js +1 -0
- package/dist/assets/{vgai-shared-three-Bc5PvpLM.js → vgai-shared-three-D_RAEumG.js} +1 -1
- package/dist/assets/{viewport-root-presentation-CWsE56K6.js → viewport-root-presentation-C9M98VNM.js} +1 -1
- package/dist/assets/{viewport-shading-BuA88e_A.js → viewport-shading-BzcvgJhK.js} +1 -1
- package/dist/assets/viewport-shading-boundary-CBvvzS-p.js +84 -0
- package/dist/assets/{viewport-surface-status-B3om4Kcf.js → viewport-surface-status-BFmnWp7z.js} +1 -1
- package/dist/assets/voxel-surface-ROWYug7H.js +1 -0
- package/dist/assets/webgl-frame-capture-CRKX73E9.js +1 -0
- package/dist/assets/webworkerAll-CehoCtFb.js +1 -0
- package/dist/assets/{worker-UrMcrc5_.js → worker-B7zhIsFh.js} +2 -2
- package/dist/assets/world-documents-DErHq15h.js +1 -0
- package/dist/assets/world-root-stage-binding-BIymcQ4K.js +1 -0
- package/dist/assets/{world-state-BWG-IcOd.js → world-state-ZGDGY_Xl.js} +1 -1
- package/dist/assets/{writer-B-KovzkA.js → writer-BPbm4_my.js} +5 -5
- package/dist/assets/xstate-animation-binding-Cvd4JbEY.js +1 -0
- package/dist/assets/{xstate-animation-meta-Q3u9zh_m.js → xstate-animation-meta-B3OZR8Q2.js} +1 -1
- package/dist/vgai-shared-three.json +1 -1
- package/dist-node/cli.js +317 -73
- package/dist-node/create.js +59 -19
- package/package.json +16 -13
- package/src/index.ts +6 -0
- package/template/.agents/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/.claude/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/.github/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.github/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/AGENTS.md +1 -1
- package/template/check-idioms.ts +4 -5
- package/template/package.json +9 -9
- package/template/tsconfig.json +1 -0
- package/template/vgai.adapter.ts +1 -0
- package/template-dotfiles/gitignore +2 -0
- package/workbench/src/media/game-cover.css +1 -1
- package/catalog/project-source/src/lib/bake/mesh-slice.ts +0 -157
- package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +0 -1
- package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +0 -1
- package/dist/assets/ColladaLoader-aVOPIsCh.js +0 -3
- package/dist/assets/EXRLoader-Cdans_oJ.js +0 -1
- package/dist/assets/EffectComposer-DQxfsXBZ.js +0 -1
- package/dist/assets/EntityModelDocument-Ccvw66N9.js +0 -1
- package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +0 -1
- package/dist/assets/FBXLoader-B4MoUtAn.js +0 -1
- package/dist/assets/Fbo-Dz-Soul3.js +0 -1
- package/dist/assets/GLTFExporter-HgrCle4L.js +0 -1
- package/dist/assets/Gltf-UHVWKz65.js +0 -2
- package/dist/assets/HDRLoader-THU88oVD.js +0 -5
- package/dist/assets/ImageViewer-Tn7s_MnW.js +0 -1
- package/dist/assets/InspectorObjectPreview-CVejvLRg.js +0 -1
- package/dist/assets/JsonAssetDocument-C7VGcLhu.js +0 -3
- package/dist/assets/MeshBVH-BiDHDcu-.js +0 -1
- package/dist/assets/ModelAssetDocument-F5GACirk.js +0 -1
- package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +0 -2
- package/dist/assets/Object3DPreview-DL8oi7Xs.js +0 -2
- package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +0 -2
- package/dist/assets/PlayBar-BR-Vg3Jb.js +0 -2
- package/dist/assets/RGBELoader-BgBcQv8j.js +0 -1
- package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +0 -1
- package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +0 -1
- package/dist/assets/STLLoader-Dyv3lsxY.js +0 -1
- package/dist/assets/SimplifyModifier-C8ayvRzd.js +0 -1
- package/dist/assets/SourceAssetViewer-2SWQoUut.js +0 -12
- package/dist/assets/StageHost-BN-IoTef.js +0 -2
- package/dist/assets/ThreeBoardDocument-CVncZyIq.js +0 -2
- package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +0 -1
- package/dist/assets/asset-budget.action-DCzzcuTh.js +0 -1
- package/dist/assets/asset-budget.document-BWU8wnVW.js +0 -1
- package/dist/assets/asset-budget.menu-BGZpT_31.js +0 -1
- package/dist/assets/autoplay.service-BZBGNSvt.js +0 -1
- package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +0 -2
- package/dist/assets/blender-properties-tab-C5CyPydi.js +0 -3
- package/dist/assets/blender-runtime-host-BpBwGv7r.js +0 -4
- package/dist/assets/blender-runtime.document-lIYhhPtv.js +0 -8
- package/dist/assets/blender.command-BtJeWk-A.js +0 -1
- package/dist/assets/body-marks-h_xDxiDE.js +0 -1
- package/dist/assets/bridge.command-o5gDNEwa.js +0 -3
- package/dist/assets/browserAll-DeWblVez.js +0 -1
- package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +0 -2
- package/dist/assets/component-board.service-DidCyM4O.js +0 -2
- package/dist/assets/component-verbs.service-Bv9jId3q.js +0 -1
- package/dist/assets/constraints.inspector-B9U9Yj-u.js +0 -1
- package/dist/assets/coverage.service-VTX5Mcsx.js +0 -3
- package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +0 -2
- package/dist/assets/design-time-layers-wYgOTgni.js +0 -1
- package/dist/assets/design-time-mount.service-BzY21e1F.js +0 -2
- package/dist/assets/design-time-react-mount-DM9WLrF2.js +0 -1
- package/dist/assets/edit-mode-authoring-B47TfLqu.js +0 -1
- package/dist/assets/editor-api-BoJIcyZG.js +0 -1
- package/dist/assets/fflate.module-DPuTF8aG.js +0 -6
- package/dist/assets/fork-menu-BoVyw2Wu.js +0 -1
- package/dist/assets/game-document.service-DbRfx2V0.js +0 -1
- package/dist/assets/game-eval.command-D-7Dxbj_.js +0 -2
- package/dist/assets/gameplay-replay-e5umMlXv.js +0 -1
- package/dist/assets/gameplay.command-DxcVYX6F.js +0 -1
- package/dist/assets/generation.service-CDIgObuw.js +0 -1
- package/dist/assets/index-96FBF1Oj.js +0 -1
- package/dist/assets/index-BAWkB0dv.js +0 -1
- package/dist/assets/index-BDnS2b6S.js +0 -1
- package/dist/assets/index-BjTCPEQ7.js +0 -134
- package/dist/assets/index-CVCb_ImQ.js +0 -1
- package/dist/assets/index-CZd9o7Lu.js +0 -1
- package/dist/assets/index-D2fNXpHa.css +0 -1
- package/dist/assets/index-GIL7oGEO.js +0 -4894
- package/dist/assets/index-OrYXPk3Z.js +0 -487
- package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +0 -1
- package/dist/assets/ingest-siblings-Bop2kqVl.js +0 -1
- package/dist/assets/instances.command-D6UkZNO8.js +0 -1
- package/dist/assets/light-camera-factory-CWbbe9gI.js +0 -1
- package/dist/assets/live-behaviors-Bxq49Maz.js +0 -1
- package/dist/assets/matcap-texture-CVfalpWT.js +0 -1
- package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +0 -1
- package/dist/assets/model.layout-BJUEQYUI.js +0 -1
- package/dist/assets/module-mode-DVBLT9d-.js +0 -2
- package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +0 -2
- package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +0 -2
- package/dist/assets/mount-ingest-root-glv2SSWf.js +0 -2
- package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +0 -1
- package/dist/assets/particles-factory-DnLOHXT8.js +0 -1
- package/dist/assets/pasteboard-materialize-BqSS4QzV.js +0 -20
- package/dist/assets/pasteboard.action-DU3UHtJG.js +0 -2
- package/dist/assets/pixi-authoring-adapter-CjibysC3.js +0 -1
- package/dist/assets/pixi-primitive-DlWbUPN9.js +0 -1
- package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +0 -1
- package/dist/assets/play-mode-BFU2PCkG.js +0 -22
- package/dist/assets/play.command-BpqqLqkq.js +0 -2
- package/dist/assets/project-authoring-session-Bnt6icLr.js +0 -2
- package/dist/assets/r3f-design-session-D-4yyDO9.js +0 -2
- package/dist/assets/r3f-physics-binding-BBo8oma9.js +0 -1
- package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +0 -13
- package/dist/assets/react-inspector.service-B_neRnSK.js +0 -1
- package/dist/assets/react-story-board-BDDwiE2H.js +0 -1
- package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +0 -1
- package/dist/assets/runtime-inspection-l2iFQSsg.js +0 -1
- package/dist/assets/scene-document.service-qkDjUrlP.js +0 -2
- package/dist/assets/sculpt.layout-zJF55yCR.js +0 -1
- package/dist/assets/setup-particles-GCXlnkj_.js +0 -1
- package/dist/assets/shading.layout-DULYZV6M.js +0 -1
- package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +0 -1
- package/dist/assets/stage-invalidation-DBg3C3Ta.js +0 -1
- package/dist/assets/stage-keyboard-n-5kKH-m.js +0 -1
- package/dist/assets/stage-overlay-set-B9zp2sLB.js +0 -1
- package/dist/assets/stage-presence-markers-DiGI6A45.js +0 -1
- package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +0 -7
- package/dist/assets/static-batch-advisor-B13QEH7d.js +0 -1
- package/dist/assets/story-capture-_gC8dXV-.js +0 -1
- package/dist/assets/story-documents--TDLaPeL.js +0 -3
- package/dist/assets/story-documents.service-BiS_YbNQ.js +0 -1
- package/dist/assets/story-documents.service-CxOPYJ2j.js +0 -1
- package/dist/assets/story-pixi-preview-BUrOJZXS.js +0 -1
- package/dist/assets/story-presentation-j2AVN-mK.js +0 -1
- package/dist/assets/team-playtest.service-DqOinFVA.js +0 -1
- package/dist/assets/three-authoring.service-iuHLwtf1.js +0 -2
- package/dist/assets/three-viewport-presentation-QBQpSdMh.js +0 -1
- package/dist/assets/three.quarks.esm-B1C61jGo.js +0 -1039
- package/dist/assets/transport.header-B-6HQlU2.js +0 -1
- package/dist/assets/ui-board-document-Bwtt--xp.js +0 -2
- package/dist/assets/use-live-actor-state-DErbWQWF.js +0 -1
- package/dist/assets/user-data-BB2Of6Ht.js +0 -1
- package/dist/assets/uv-editing.layout-BEKHxmHw.js +0 -1
- package/dist/assets/viewport-shading-boundary-B_-_gABg.js +0 -82
- package/dist/assets/voxel-surface-DtcsSWRL.js +0 -1
- package/dist/assets/webgl-frame-capture-FlF9zQmW.js +0 -1
- package/dist/assets/webworkerAll-CM2o_dnz.js +0 -1
- package/dist/assets/world-documents-147tiFZe.js +0 -1
- package/dist/assets/world-root-stage-binding-vwTrtBz6.js +0 -1
- package/dist/assets/xstate-animation-binding-Brd0NST6.js +0 -1
- package/dist/assets/xstate-behavior.action-B8UluFBK.js +0 -1
- package/dist/assets/xstate-behavior.document-CKAsE45I.js +0 -1
- package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +0 -1
- package/dist/assets/xstate-behavior.menu-BXbPICIh.js +0 -1
- package/dist/assets/xstate-inspection-BsZv8LS9.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import{q as t}from"./index-GIL7oGEO.js";import{r as m}from"./index-nmcBqr7Y.js";import{P as p}from"./PlayBar-BR-Vg3Jb.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./configurations-DTBMdaTL.js";import"./active-ingest-CT6jSGhr.js";import"./game-contract-seams-a5YXejOu.js";import"./capability-coverage-Czas4C18.js";import"./ingest-source-persistence-C_6Hiyra.js";import"./playtest-BXIL1JEF.js";import"./play-mode-BFU2PCkG.js";import"./native-debug-module-CWicoSGD.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-Dgvitx8M.js";import"./instruments-CKR02Y8I.js";import"./frame-pacing-D5acoOzO.js";import"./edit-mode-authoring-B47TfLqu.js";import"./json-history-resource-BbxllWfV.js";import"./binding-resolver-Dsh-6Vor.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-Cq8Yeb74.js";import"./r3f-root-factory-z9llD1OU.js";import"./register-render-vitals-BiZk29b2.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-B13QEH7d.js";import"./webgl-frame-capture-FlF9zQmW.js";import"./world-state-BWG-IcOd.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-CIQdetRw.js";import"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-ErOhDXXB.js";import"./index-bQE2NA0D.js";import"./realm-services-CobQsq_X.js";import"./canvas-entry-runtime-SfBxaR9M.js";import"./three-ingest-runtime-QzDYk6tU.js";import"./EffectComposer-DQxfsXBZ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-QYRpPuFJ.js";import"./CSS3DRenderer-CL7ABLVK.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-CEz5NTck.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CWsE56K6.js";import"./mounted-authoring-Dmg5xmhP.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./logger-Dqis-7W1.js";import"./run-ticks-settled-C4ksViyA.js";import"./three-authoring-adapter-CmSQ3Vui.js";import"./source-persistence-backend-C-aR-B_Y.js";import"./three-projection-core-BmKMZ-nf.js";import"./body-marks-h_xDxiDE.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Dc-7rEwi.js";import"./object3d-authoring-subject-CH5sI2oP.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-BBo8oma9.js";import"./deferred-ingest-play-DCJi_Pgu.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DmrwM3py.js";import"./board-guides-DziKSTss.js";import"./writer-B-KovzkA.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";const Ao="workspace.header",Co=0;function Do(){const{project:o}=t();return m.useSyncExternalStore(o.subscribe,o.mounts,o.mounts)?r.jsx(p,{}):null}export{Do as default,Co as order,Ao as point};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-capture-_gC8dXV-.js","assets/react-story-board-BDDwiE2H.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-GIL7oGEO.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/StoryPreviewMount-DjyxRCXu.js","assets/story-pixi-preview-BUrOJZXS.js","assets/crash-null-boundary-v3a0uEgw.js","assets/pixi-story-model-DNkfnWUV.js","assets/story-mount-turn-DFRTj5hi.js","assets/story-presentation-j2AVN-mK.js","assets/story-three-preview-BHEDZzcl.js","assets/events-156d8d12.esm-ErOhDXXB.js","assets/index-bQE2NA0D.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{di as s,av as m,dj as p,aF as n,_ as c,bG as d}from"./index-GIL7oGEO.js";import{a as u}from"./jsx-runtime-DPjLkJKQ.js";import{d as v,p as l,r as P}from"./design-time-layers-wYgOTgni.js";import{RootDocumentContent as w}from"./world-documents-147tiFZe.js";import{U as _}from"./component-board.service-DidCyM4O.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./edit-mode-authoring-B47TfLqu.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./react-story-board-BDDwiE2H.js";import"./CanvasSceneViewport-Bpi6gVTC.js";import"./RootSelectionOverlay-BZPlxmXU.js";import"./eyedropper-session-bjPXnfeX.js";import"./viewport-pick-context-DkawXbEi.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";import"./TransientHint-BB1fwrvK.js";import"./component-board-registry-DrIa2csL.js";import"./surface-state-DaxyruCj.js";import"./board-guides-DziKSTss.js";import"./story-media-presence-BHzk2IV5.js";const b={revision:()=>JSON.stringify(d().map(({id:e,modulePath:t})=>[e,t])),subscribe:m,capture:async({width:e,height:t})=>{const{captureDomStoryBoardPreview:o}=await c(async()=>{const{captureDomStoryBoardPreview:i}=await import("./story-capture-_gC8dXV-.js");return{captureDomStoryBoardPreview:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]));return o(e,t)}};function z({store:e,composite:t}){const o=v(t).find(r=>r.kind==="dom")??l(),i=r=>u.jsx(w,{...r,composite:t,descriptor:o,store:e});s({id:p,title:_,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:o.worldId,...o.path?{sourcePath:o.path}:{}},Content:i,preview:b,presentation:()=>{const r=n()?.rootPath,a=r?P(r,o.worldId):void 0;return{kind:"workspace",id:p,...a?{story:a}:{}}},onActivate:()=>e.setActiveViewportTab("edit")},{category:"canvas",default:!t.childAdapters().some(r=>r.kind==="three"||r.kind==="canvas")})}export{z as installUiBoard};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as f}from"./index-nmcBqr7Y.js";const b="#";console.log.bind(console);const h=t=>t[0]===b;function u(t,e){if(h(e))return t.machine.getStateNodeById(e);if(!t.states)throw new Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);const n=t.states[e];if(!n)throw new Error(`Child state '${e}' does not exist on '${t.id}'`);return n}function d(t,e){if(typeof e=="string"){const o=t.states[e];if(!o)throw new Error(`State '${e}' does not exist on '${t.id}'`);return[t,o]}const n=Object.keys(e),r=n.map(o=>u(t,o)).filter(Boolean);return[t.machine.root,t].concat(r,n.reduce((o,s)=>{const i=u(t,s);if(!i)return o;const c=d(i,e[s]);return o.concat(c)},[]))}function y(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function l(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function"){const e=t.name;if(e&&e!=="guard"&&e!=="anonymous")return e;const n=t.toString().replace(/\s+/g," ").trim();return n.length>60?`${n.slice(0,57)}...`:n}return y(t)&&typeof t.type=="string"?t.type:"(guard)"}}function*p(t,e,n){yield{node:t,parentId:e,depth:n};for(const r of Object.values(t.states))yield*p(r,t.id,n+1)}function S(t){const e=t.parent;return e?e.type!=="compound"?!1:e.initial?.target?.some(n=>n.id===t.id)??!1:!0}function $(t,e){const n=[];for(const[r,o]of Object.entries(t.on))for(const s of o)for(const i of s.target??[])n.push({id:`${t.id}--${r}--${i.id}--${e()}`,source:t.id,target:i.id,eventLabel:r,isEventless:!1,guardLabel:l(s.guard)});for(const r of t.always??[])for(const o of r.target??[])n.push({id:`${t.id}--always--${o.id}--${e()}`,source:t.id,target:o.id,eventLabel:"always",isEventless:!0,guardLabel:l(r.guard)});return n}function v(t){const e=t.root,n=[],r=[];let o=0;const s=()=>o++;for(const{node:i,parentId:c,depth:g}of p(e,null,0))n.push({id:i.id,key:i.key,parentId:c,depth:g,type:i.type,isInitial:S(i)}),r.push(...$(i,s));return{machineId:e.id,nodes:n,edges:r}}function a(t,e){return d(t.root,e).map(n=>n.id)}function I(t,e){const[n,r]=f.useState(null);return f.useEffect(()=>{if(!e){r(null);return}r(a(t,e.getSnapshot().value));const o=e.subscribe(s=>{r(a(t,s.value))});return()=>o.unsubscribe()},[t,e]),n}export{v as b,I as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ObjectMarkKeys as i}from"./object-marks-DwvIEBOK.js";const a={...i,entityId:"entityId",forward:"forward",tags:"tags",attributes:"attributes",navRole:"navRole",pivot:"pivot",splineCurve:"splineCurve",splineControlPoint:"splineControlPoint",_camera:"_camera",_particleSystem:"_particleSystem",gaussianSplat:"gaussianSplat",_animMixer:"_animMixer",_animClips:"_animClips",_availableClips:"_availableClips",_animationRuntime:"_animationRuntime",_xstateBehavior:"_xstateBehavior",_xstateAnimation:"_xstateAnimation",__sharedGeometry:"__sharedGeometry",__shadeOrig:"__shadeOrig",__shadeUnlit:"__shadeUnlit",__ingest:"__ingest",__ingestNextId:"__ingestNextId",authoringRoot:"authoringRoot",authoringInstance:"authoringInstance",authoringLabel:"authoringLabel",vgaiBodyOwner:"vgaiBodyOwner",authoringComponent:"authoringComponent",authoringDocument:"authoringDocument",authoringHierarchyId:"authoringHierarchyId",authoringHierarchyParentId:"authoringHierarchyParentId",authoringHierarchyOrder:"authoringHierarchyOrder",editorIcon:"editorIcon",envObject:"envObject",constraints:"constraints",authoringSubject:"authoringSubject",reflectionProbe:"reflectionProbe",triggerVolume:"triggerVolume",vcDirIdx:"vcDirIdx"};function o(t,e){return t?t.userData[a[e]]:void 0}function s(t,e,r){t.userData[a[e]]=r}function u(t,e){return t?t.userData[a[e]]!==void 0:!1}function _(t,e){delete t.userData[a[e]]}export{a as UserDataKeys,_ as deleteUserData,o as getUserData,u as hasUserData,s as setUserData};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="workspace.layout",t={id:"uv-editing",title:"UV Editing",description:"Blender-shaped UV editing: the viewport beside the mesh's UV layout, read-only.",requires:{documentKind:"model"},regions:{header:"shown",shelf:"shown",inspector:"properties",drawer:"hidden"},areas:[{id:"uv",document:"blender-uv-editor.document",place:"left",ratio:.5003}]};export{t as layout,e as point};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/spark.module-4pXQoz5d.js","assets/three.module-D396a9Mn.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-D2fNXpHa.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{aI as U,aM as W,aN as M,aO as Rt,jO as tt,ly as ye,lz as Mt,ki as bs,ks as Ht,kh as xs,lA as we,lB as ve,lC as be,kk as Ss,jQ as Cs,lD as xe,ek as Pt,dG as F,V as At,lE as Wt,lF as Ms,lG as Hs,lH as Ps,lI as As,lJ as Es,e$ as Is,lK as Ts,lL as zs,kn as Se,ko as Ce,kp as Me,bD as He,ao as Et,lM as Os,lN as Ds,lO as Pe,gQ as Ae,bx as Ls,_ as Rs,aH as ks}from"./index-GIL7oGEO.js";import{i as Yt}from"./stage-invalidation-DBg3C3Ta.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{E as Ee,a as Ie,f as js}from"./clip-planes-CnAI6DZn.js";import{e as ce,r as kt}from"./three-CDSueJyJ.js";import{OrbitControls as Fs}from"./OrbitControls-CM3bPray.js";import{l as Gs,V as h,Q as T,t as et,O as Gt,z as X,aZ as ht,bJ as O,B as E,aB as lt,aY as yt,M as m,cs as it,bh as V,ct as pt,H as Q,aQ as $e,a as fe,y as Je,ap as Bt,aX as q,cu as Bs,C as x,r as Y,cv as ts,b0 as _e,cm as es,u as ft,ch as Vs,cl as Xs,b_ as Ws,v as Ys,X as ss,bP as Ns,q as Te,g as K,w as Qs,x as qs,ar as Nt,bU as Zs,D as Us,m as Qt,cw as Ks,cx as $s,cy as Js,cz as ti,cA as ei,bd as si,s as ii,be as oi,bf as ni,h as ri,a1 as ai,j as li,k as ci}from"./three.module-D396a9Mn.js";import{L as is,a as os,b as ns}from"./LineSegments2-CsOpKSiM.js";import{B as hi}from"./three.quarks.esm-B1C61jGo.js";import{b as pi,e as di}from"./live-gesture-lock-DJbrjOqf.js";import{s as ze}from"./viewport-pick-context-DkawXbEi.js";import{f as Oe,v as ui,s as fi}from"./scene-framing-Cat0GtyJ.js";function he(a){const t=U(a,"triggerVolume");if(!t||typeof t!="object")return null;const{radius:e}=t;return typeof e=="number"&&Number.isFinite(e)&&e>0?{radius:e}:null}const $=new et,z=new h,Z=new h,P=new T,De={X:new h(1,0,0),Y:new h(0,1,0),Z:new h(0,0,1)},qt={type:"change"},Le={type:"mouseDown",mode:null},Re={type:"mouseUp",mode:null},ke={type:"objectChange"};class Zt extends Gs{constructor(t,e=null){super(void 0,e);const s=new vi(this);this._root=s;const i=new bi;this._gizmo=i,s.add(i);const o=new xi;this._plane=o,s.add(o);const n=this;function r(b,L){let R=L;Object.defineProperty(n,b,{get:function(){return R!==void 0?R:L},set:function(S){R!==S&&(R=S,o[b]=S,i[b]=S,n.dispatchEvent({type:b+"-changed",value:S}),n.dispatchEvent(qt))}}),n[b]=L,o[b]=L,i[b]=L}r("camera",t),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0),r("minX",-1/0),r("maxX",1/0),r("minY",-1/0),r("maxY",1/0),r("minZ",-1/0),r("maxZ",1/0);const l=new h,c=new h,d=new T,p=new T,f=new h,u=new T,_=new h,g=new h,y=new h,v=0,w=new h;r("worldPosition",l),r("worldPositionStart",c),r("worldQuaternion",d),r("worldQuaternionStart",p),r("cameraPosition",f),r("cameraQuaternion",u),r("pointStart",_),r("pointEnd",g),r("rotationAxis",y),r("rotationAngle",v),r("eye",w),this._offset=new h,this._startNorm=new h,this._endNorm=new h,this._cameraScale=new h,this._parentPosition=new h,this._parentQuaternion=new T,this._parentQuaternionInv=new T,this._parentScale=new h,this._worldScaleStart=new h,this._worldQuaternionInv=new T,this._worldScale=new h,this._positionStart=new h,this._quaternionStart=new T,this._scaleStart=new h,this._getPointer=_i.bind(this),this._onPointerDown=gi.bind(this),this._onPointerHover=mi.bind(this),this._onPointerMove=yi.bind(this),this._onPointerUp=wi.bind(this),e!==null&&this.connect(e)}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&&$.setFromCamera(t,this.camera);const e=Ut(this._gizmo.picker[this.mode],$);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&&$.setFromCamera(t,this.camera);const e=Ut(this._plane,$,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,Le.mode=this.mode,this.dispatchEvent(Le)}}pointerMove(t){const e=this.axis,s=this.mode,i=this.object;let o=this.space;if(s==="scale"?o="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(o="world"),i===void 0||e===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&&$.setFromCamera(t,this.camera);const n=Ut(this._plane,$,!0);if(n){if(this.pointEnd.copy(n.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),o==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),o==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(o==="local"&&(i.position.applyQuaternion(P.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),o==="world"&&(i.parent&&i.position.add(z.setFromMatrixPosition(i.parent.matrixWorld)),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(z.setFromMatrixPosition(i.parent.matrixWorld)))),i.position.x=Math.max(this.minX,Math.min(this.maxX,i.position.x)),i.position.y=Math.max(this.minY,Math.min(this.maxY,i.position.y)),i.position.z=Math.max(this.minZ,Math.min(this.maxZ,i.position.z));else if(s==="scale"){if(e.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),Z.set(r,r,r)}else z.copy(this.pointStart),Z.copy(this.pointEnd),z.applyQuaternion(this._worldQuaternionInv),Z.applyQuaternion(this._worldQuaternionInv),Z.divide(z),e.search("X")===-1&&(Z.x=1),e.search("Y")===-1&&(Z.y=1),e.search("Z")===-1&&(Z.z=1);i.scale.copy(this._scaleStart).multiply(Z),this.scaleSnap&&(e.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(z.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(z.copy(this.rotationAxis).cross(this.eye))*r):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(De[e]),z.copy(De[e]),o==="local"&&z.applyQuaternion(this.worldQuaternion),z.cross(this.eye),z.length()===0?l=!0:this.rotationAngle=this._offset.dot(z.normalize())*r),(e==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),o==="local"&&e!=="E"&&e!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(P.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(P.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(qt),this.dispatchEvent(ke)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(Re.mode=this.mode,this.dispatchEvent(Re)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(t){return this.object=t,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(qt),this.dispatchEvent(ke),this.pointStart.copy(this.pointEnd))}getRaycaster(){return $}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}setColors(t,e,s,i){const o=this._gizmo.materialLib;o.xAxis.color.set(t),o.yAxis.color.set(e),o.zAxis.color.set(s),o.active.color.set(i),o.xAxisTransparent.color.set(t),o.yAxisTransparent.color.set(e),o.zAxisTransparent.color.set(s),o.activeTransparent.color.set(i),o.xAxis._color&&o.xAxis._color.set(t),o.yAxis._color&&o.yAxis._color.set(e),o.zAxis._color&&o.zAxis._color.set(s),o.active._color&&o.active._color.set(i),o.xAxisTransparent._color&&o.xAxisTransparent._color.set(t),o.yAxisTransparent._color&&o.yAxisTransparent._color.set(e),o.zAxisTransparent._color&&o.zAxisTransparent._color.set(s),o.activeTransparent._color&&o.activeTransparent._color.set(i)}}function _i(a){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:a.button};{const t=this.domElement.getBoundingClientRect();return{x:(a.clientX-t.left)/t.width*2-1,y:-(a.clientY-t.top)/t.height*2+1,button:a.button}}}function mi(a){if(this.enabled)switch(a.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(a));break}}function gi(a){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(a.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(a)),this.pointerDown(this._getPointer(a)))}function yi(a){this.enabled&&this.pointerMove(this._getPointer(a))}function wi(a){this.enabled&&(this.domElement.releasePointerCapture(a.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(a)))}function Ut(a,t,e){const s=t.intersectObject(a,!0);for(let i=0;i<s.length;i++)if(s[i].object.visible||e)return s[i];return!1}const It=new $e,H=new h(0,1,0),je=new h(0,0,0),Fe=new fe,Tt=new T,jt=new T,B=new h,Ge=new fe,_t=new h(1,0,0),st=new h(0,1,0),mt=new h(0,0,1),zt=new h,dt=new h,ut=new h;class vi extends Gt{constructor(t){super(),this.isTransformControlsRoot=!0,this.controls=t,this.visible=!1}updateMatrixWorld(t){const e=this.controls;e.object!==void 0&&(e.object.updateMatrixWorld(),e.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):e.object.parent.matrixWorld.decompose(e._parentPosition,e._parentQuaternion,e._parentScale),e.object.matrixWorld.decompose(e.worldPosition,e.worldQuaternion,e._worldScale),e._parentQuaternionInv.copy(e._parentQuaternion).invert(),e._worldQuaternionInv.copy(e.worldQuaternion).invert()),e.camera.updateMatrixWorld(),e.camera.matrixWorld.decompose(e.cameraPosition,e.cameraQuaternion,e._cameraScale),e.camera.isOrthographicCamera?e.camera.getWorldDirection(e.eye).negate():e.eye.copy(e.cameraPosition).sub(e.worldPosition).normalize(),super.updateMatrixWorld(t)}dispose(){this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}}class bi extends Gt{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const t=new X({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=new ht({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),s=t.clone();s.opacity=.15;const i=e.clone();i.opacity=.5;const o=t.clone();o.color.setHex(16711680);const n=t.clone();n.color.setHex(65280);const r=t.clone();r.color.setHex(255);const l=t.clone();l.color.setHex(16711680),l.opacity=.5;const c=t.clone();c.color.setHex(65280),c.opacity=.5;const d=t.clone();d.color.setHex(255),d.opacity=.5;const p=t.clone();p.opacity=.25;const f=t.clone();f.color.setHex(16776960),f.opacity=.25;const u=t.clone();u.color.setHex(16776960);const _=t.clone();_.color.setHex(7895160),this.materialLib={xAxis:o,yAxis:n,zAxis:r,active:u,xAxisTransparent:l,yAxisTransparent:c,zAxisTransparent:d,activeTransparent:f};const g=new O(0,.04,.1,12);g.translate(0,.05,0);const y=new E(.08,.08,.08);y.translate(0,.04,0);const v=new lt;v.setAttribute("position",new yt([0,0,0,1,0,0],3));const w=new O(.0075,.0075,.5,3);w.translate(0,.25,0);function b(k,bt){const j=new pt(k,.0075,3,64,bt*Math.PI*2);return j.rotateY(Math.PI/2),j.rotateX(Math.PI/2),j}function L(){const k=new lt;return k.setAttribute("position",new yt([0,0,0,1,1,1],3)),k}const R={X:[[new m(g,o),[.5,0,0],[0,0,-Math.PI/2]],[new m(g,o),[-.5,0,0],[0,0,Math.PI/2]],[new m(w,o),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new m(g,n),[0,.5,0]],[new m(g,n),[0,-.5,0],[Math.PI,0,0]],[new m(w,n)]],Z:[[new m(g,r),[0,0,.5],[Math.PI/2,0,0]],[new m(g,r),[0,0,-.5],[-Math.PI/2,0,0]],[new m(w,r),null,[Math.PI/2,0,0]]],XYZ:[[new m(new it(.1,0),p),[0,0,0]]],XY:[[new m(new E(.15,.15,.01),d),[.15,.15,0]]],YZ:[[new m(new E(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new m(new E(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]]},S={X:[[new m(new O(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new m(new O(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new m(new O(.2,0,.6,4),s),[0,.3,0]],[new m(new O(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new m(new O(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new m(new O(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new m(new it(.2,0),s)]],XY:[[new m(new E(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new m(new E(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new m(new E(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]]},C={START:[[new m(new it(.01,2),i),null,null,null,"helper"]],END:[[new m(new it(.01,2),i),null,null,null,"helper"]],DELTA:[[new V(L(),i),null,null,null,"helper"]],X:[[new V(v,i),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new V(v,i),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new V(v,i),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},A={XYZE:[[new m(b(.5,1),_),null,[0,Math.PI/2,0]]],X:[[new m(b(.5,.5),o)]],Y:[[new m(b(.5,.5),n),null,[0,0,-Math.PI/2]]],Z:[[new m(b(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new m(b(.75,1),f),null,[0,Math.PI/2,0]]]},I={AXIS:[[new V(v,i),[-1e3,0,0],null,[1e6,1,1],"helper"]]},vt={XYZE:[[new m(new Q(.25,10,8),s)]],X:[[new m(new pt(.5,.1,4,24),s),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new m(new pt(.5,.1,4,24),s),[0,0,0],[Math.PI/2,0,0]]],Z:[[new m(new pt(.5,.1,4,24),s),[0,0,0],[0,0,-Math.PI/2]]],E:[[new m(new pt(.75,.1,2,24),s)]]},gs={X:[[new m(y,o),[.5,0,0],[0,0,-Math.PI/2]],[new m(w,o),[0,0,0],[0,0,-Math.PI/2]],[new m(y,o),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new m(y,n),[0,.5,0]],[new m(w,n)],[new m(y,n),[0,-.5,0],[0,0,Math.PI]]],Z:[[new m(y,r),[0,0,.5],[Math.PI/2,0,0]],[new m(w,r),[0,0,0],[Math.PI/2,0,0]],[new m(y,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new m(new E(.15,.15,.01),d),[.15,.15,0]]],YZ:[[new m(new E(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new m(new E(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new m(new E(.1,.1,.1),p)]]},ys={X:[[new m(new O(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new m(new O(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new m(new O(.2,0,.6,4),s),[0,.3,0]],[new m(new O(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new m(new O(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new m(new O(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new m(new E(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new m(new E(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new m(new E(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new m(new E(.2,.2,.2),s),[0,0,0]]]},ws={X:[[new V(v,i),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new V(v,i),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new V(v,i),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function N(k){const bt=new Gt;for(const j in k)for(let ot=k[j].length;ot--;){const D=k[j][ot][0].clone(),xt=k[j][ot][1],St=k[j][ot][2],Ct=k[j][ot][3],vs=k[j][ot][4];D.name=j,D.tag=vs,xt&&D.position.set(xt[0],xt[1],xt[2]),St&&D.rotation.set(St[0],St[1],St[2]),Ct&&D.scale.set(Ct[0],Ct[1],Ct[2]),D.updateMatrix();const ge=D.geometry.clone();ge.applyMatrix4(D.matrix),D.geometry=ge,D.renderOrder=1/0,D.position.set(0,0,0),D.rotation.set(0,0,0),D.scale.set(1,1,1),bt.add(D)}return bt}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=N(R)),this.add(this.gizmo.rotate=N(A)),this.add(this.gizmo.scale=N(gs)),this.add(this.picker.translate=N(S)),this.add(this.picker.rotate=N(vt)),this.add(this.picker.scale=N(ys)),this.add(this.helper.translate=N(C)),this.add(this.helper.rotate=N(I)),this.add(this.helper.scale=N(ws)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(t){const s=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:jt;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let o=0;o<i.length;o++){const n=i[o];n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition);let r;if(this.camera.isOrthographicCamera?r=(this.camera.top-this.camera.bottom)/this.camera.zoom:r=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(r*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(P.setFromEuler(It.set(0,0,0)),n.quaternion.copy(s).multiply(P),Math.abs(H.copy(_t).applyQuaternion(s).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(P.setFromEuler(It.set(0,0,Math.PI/2)),n.quaternion.copy(s).multiply(P),Math.abs(H.copy(st).applyQuaternion(s).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(P.setFromEuler(It.set(0,Math.PI/2,0)),n.quaternion.copy(s).multiply(P),Math.abs(H.copy(mt).applyQuaternion(s).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(P.setFromEuler(It.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(Fe.lookAt(je,H,st)),n.quaternion.multiply(P),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),z.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),z.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(z),n.visible=this.dragging):(n.quaternion.copy(s),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(s),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(H.copy(_t).applyQuaternion(s).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(H.copy(st).applyQuaternion(s).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(H.copy(mt).applyQuaternion(s).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(H.copy(mt).applyQuaternion(s).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(H.copy(_t).applyQuaternion(s).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(H.copy(st).applyQuaternion(s).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Tt.copy(s),H.copy(this.eye).applyQuaternion(P.copy(s).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(Fe.lookAt(this.eye,je,st)),n.name==="X"&&(P.setFromAxisAngle(_t,Math.atan2(-H.y,H.z)),P.multiplyQuaternions(Tt,P),n.quaternion.copy(P)),n.name==="Y"&&(P.setFromAxisAngle(st,Math.atan2(H.x,H.z)),P.multiplyQuaternions(Tt,P),n.quaternion.copy(P)),n.name==="Z"&&(P.setFromAxisAngle(mt,Math.atan2(H.y,H.x)),P.multiplyQuaternions(Tt,P),n.quaternion.copy(P))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis?(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1):this.axis.split("").some(function(l){return n.name===l})&&(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1))}super.updateMatrixWorld(t)}}class xi extends m{constructor(){super(new Je(1e5,1e5,2,2),new X({visible:!1,wireframe:!0,side:Bt,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),zt.copy(_t).applyQuaternion(e==="local"?this.worldQuaternion:jt),dt.copy(st).applyQuaternion(e==="local"?this.worldQuaternion:jt),ut.copy(mt).applyQuaternion(e==="local"?this.worldQuaternion:jt),H.copy(dt),this.mode){case"translate":case"scale":switch(this.axis){case"X":H.copy(this.eye).cross(zt),B.copy(zt).cross(H);break;case"Y":H.copy(this.eye).cross(dt),B.copy(dt).cross(H);break;case"Z":H.copy(this.eye).cross(ut),B.copy(ut).cross(H);break;case"XY":B.copy(ut);break;case"YZ":B.copy(zt);break;case"XZ":H.copy(ut),B.copy(dt);break;case"XYZ":case"E":B.set(0,0,0);break}break;case"rotate":default:B.set(0,0,0)}B.length()===0?this.quaternion.copy(this.cameraQuaternion):(Ge.lookAt(z.set(0,0,0),B,H),this.quaternion.setFromRotationMatrix(Ge)),super.updateMatrixWorld(t)}}const Kt=new x(4441855),Ot=new x(16758858),Dt=new x(14185983),Si=new x(16731496),Be=new x(16777215);function $t(a){return new V(new lt,new ht({color:a,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function Jt(a,t){return new m(a,new X({color:t,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function te(a,t){if(a.visible=t.length>1,!a.visible)return;let e=a.geometry.getAttribute("position");(!e||e.count!==t.length)&&(e=new yt(t.length*3,3),a.geometry.setAttribute("position",e));for(let s=0;s<t.length;s++)e.setXYZ(s,t[s].x,t[s].y,t[s].z);e.needsUpdate=!0,a.geometry.computeBoundingSphere()}class Ci extends q{constructor(t){super(),this.source=t,this.name="Constraint Helper",this.renderOrder=999,W(this,"editorHelper",!0),W(this,"editorHelperType","constraints"),this.layers.set(M),this.refreshStructure()}selected=!1;hoveredControl=null;selectedObjects=new Set;visuals=[];setSelected(t){this.selected=t}setSelectedObjects(t){this.selectedObjects=t}controlMeshes(){return this.visuals.flatMap(t=>[t.targetHit,t.poleHit].filter(e=>e.visible))}presents(t){return t===this.source?!0:this.visuals.some(e=>{const s=e.mark.getSnapshot();return t===s.target||t===s.pole})}controlFor(t){for(const e of this.visuals){const s=e.mark.getSnapshot();if((t===e.target||t===e.targetHit)&&s.target)return{kind:"target",label:s.target.name||`${e.mark.config.label} target`,object:s.target,mesh:e.target};if((t===e.pole||t===e.poleHit)&&s.pole)return{kind:"pole",label:s.pole.name||`${e.mark.config.label} pole`,object:s.pole,mesh:e.pole}}return null}setHoveredControl(t){this.hoveredControl=t}update(t){this.refreshStructure();for(const e of this.visuals)this.updateVisual(e,t)}dispose(){this.clearVisuals(),this.removeFromParent()}refreshStructure(){const t=ce(this.source);t.length===this.visuals.length&&t.every((s,i)=>{const o=s.getSnapshot(),n=o.chain.length>0?o.chain.length:o.constrained?1:0;return this.visuals[i]?.mark===s&&this.visuals[i]?.positions.length===n})||(this.clearVisuals(),this.visuals=t.map(s=>this.makeVisual(s)))}makeVisual(t){const e=t.getSnapshot(),s=e.chain.length>0?e.chain:e.constrained?[e.constrained]:[],i=$t(Kt),o=$t(Ot),n=$t(Dt),r=s.map(()=>Jt(new Q(.035,10,7),Kt)),l=Jt(new it(.085),Ot),c=Jt(new Bs(.075),Dt),d=new X({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1,colorWrite:!1}),p=new m(new Q(.16,10,7),d),f=new m(new Q(.15,10,7),d.clone());for(const u of[i,o,n,...r,l,c,p,f])u.renderOrder=this.renderOrder,u.layers.set(M),this.add(u);return{mark:t,chain:i,targetLine:o,poleLine:n,joints:r,target:l,pole:c,targetHit:p,poleHit:f,positions:s.map(()=>new h),targetPosition:new h,polePosition:new h}}updateVisual(t,e){const s=t.mark.getSnapshot(),i=s.chain.length>0?s.chain:s.constrained?[s.constrained]:[];for(let f=0;f<i.length;f++)i[f].getWorldPosition(t.positions[f]);te(t.chain,t.positions);for(let f=0;f<t.joints.length;f++){const u=t.joints[f],_=t.positions[f];u.visible=!!_,_&&(u.position.copy(_),u.scale.setScalar(this.handleScale(e,_)))}const o=t.positions.at(-1),n=s.target?.getWorldPosition(t.targetPosition)??null,r=s.pole?.getWorldPosition(t.polePosition)??null;te(t.targetLine,o&&n?[o,n]:[]),te(t.poleLine,t.positions[0]&&r?[t.positions[0],r]:[]),t.target.visible=n!==null,n&&(t.target.position.copy(n),t.target.scale.setScalar(this.handleScale(e,n)*(this.hoveredControl===t.target?1.22:1))),t.targetHit.visible=n!==null,n&&(t.targetHit.position.copy(n),t.targetHit.scale.copy(t.target.scale)),t.pole.visible=r!==null,r&&(t.pole.position.copy(r),t.pole.scale.setScalar(this.handleScale(e,r)*(this.hoveredControl===t.pole?1.22:1))),t.poleHit.visible=r!==null,r&&(t.poleHit.position.copy(r),t.poleHit.scale.copy(t.pole.scale));const l=s.status==="error"||s.status==="unresolved",c=this.selected?1:.52;for(const f of[t.chain,...t.joints]){const u=f.material;u.color.copy(l?Si:Kt),u.opacity=c}const d=this.hoveredControl===t.target||s.target!==null&&this.selectedObjects.has(s.target),p=this.hoveredControl===t.pole||s.pole!==null&&this.selectedObjects.has(s.pole);t.target.material.color.copy(d?Be:Ot),t.pole.material.color.copy(p?Be:Dt),t.targetLine.material.color.copy(Ot),t.poleLine.material.color.copy(Dt),t.targetLine.material.opacity=c,t.poleLine.material.opacity=c,t.target.material.opacity=d?1:c,t.pole.material.opacity=p?1:c}handleScale(t,e){return Y.clamp(t.position.distanceTo(e)/8,.65,4)}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry.dispose();const s=Array.isArray(e.material)?e.material:[e.material];for(const i of s)i.dispose()}this.visuals=[],this.hoveredControl=null}}const Mi=new x(4892927),Hi=new x(7718143),Pi=new x(16758858),Ai=new x(16777215);class Ei extends q{constructor(t){super(),this.source=t,this.name="Reflection Probe Helper",this.matrixAutoUpdate=!1,this.renderOrder=998,W(this,"editorHelper",!0),W(this,"editorHelperType","reflection-probes"),this.layers.set(M),this.refresh(!0)}signature="";selected=!1;setSelected(t){this.selected!==t&&(this.selected=t,this.refresh(!0))}update(){this.refresh(!1),this.source.updateWorldMatrix(!0,!1),this.matrix.copy(this.source.matrixWorld),this.matrixWorldNeedsUpdate=!0}dispose(){this.clearVisuals(),this.removeFromParent()}refresh(t){const e=kt(this.source);if(!e)return;const s=e.config,i=JSON.stringify(s);if(!t&&i===this.signature)return;this.signature=i,this.clearVisuals();const o=this.selected?Hi:Mi,n=this.selected?1:.62,r=Math.max(0,s.blendDistance);if(s.shape==="sphere"){const c=Math.max(.01,s.radius);this.addWire(new Q(c,24,16),o,n),r>0&&c-r>.01&&this.addWire(new Q(c-r,20,12),o,this.selected?.55:.28)}else{const[c,d,p]=s.size.map(u=>Math.max(.01,u));this.addWire(new E(c,d,p),o,n);const f=[c-r*2,d-r*2,p-r*2];r>0&&f.every(u=>u>.01)&&this.addWire(new E(f[0],f[1],f[2]),o,this.selected?.55:.28)}if(s.parallaxProjection){const[c,d,p]=s.parallaxSize.map(u=>Math.max(.01,u));this.addWire(new E(c,d,p),Pi,this.selected?.9:.45).position.fromArray(s.parallaxOffset)}this.addWire(new it(this.selected?.16:.11),Ai,this.selected?1:.72).position.fromArray(s.captureOffset),this.traverse(c=>c.layers.set(M))}addWire(t,e,s){const i=new ts(t);t.dispose();const o=new ht({color:e,depthTest:!1,transparent:!0,opacity:s,toneMapped:!1}),n=new _e(i,o);return n.renderOrder=this.renderOrder,this.add(n),n}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry?.dispose();const s=Array.isArray(e.material)?e.material:[e.material];for(const i of s)i?.dispose()}}}const me=new WeakMap,rs=new Q(1,12,8);function ct(a){return new h(a[0],a[1],a[2])}function wt(a){const t={color:a.color,transparent:!0,opacity:a.opacity??.68,depthTest:!1};return a.dashed?new es({...t,dashSize:.18,gapSize:.12}):new ht(t)}function G(a,t,e,s=!1){const i=s&&t.length>0?[...t,t[0]]:[...t],o=new V(new lt().setFromPoints(i),e);o.renderOrder=997,o.layers.set(M),e instanceof es&&o.computeLineDistances(),a.add(o)}function Ft(a,t,e,s,i=64){const o=[];for(let n=0;n<i;n++){const r=n/i*Math.PI*2;o.push(a.clone().addScaledVector(e,Math.cos(r)*t).addScaledVector(s,Math.sin(r)*t))}return o}function Ii(a){const t=new q,e=ct(a.center),s=wt(a);return G(t,Ft(e,a.radius,new h(1,0,0),new h(0,1,0)),s,!0),G(t,Ft(e,a.radius,new h(1,0,0),new h(0,0,1)),s,!0),G(t,Ft(e,a.radius,new h(0,1,0),new h(0,0,1)),s,!0),t}function Ti(a){const t=new q;return G(t,a.points.map(ct),wt(a)),t}function zi(a){const t=new q,e=ct(a.origin),s=ct(a.direction).normalize(),i=Math.abs(s.y)<.9?new h(0,1,0):new h(1,0,0),o=new h().crossVectors(i,s).normalize(),n=new h().crossVectors(s,o).normalize(),r=Y.degToRad(Math.max(0,Math.min(360,a.angle))/2),l=wt(a),c=[];for(let d=0;d<64;d++){const p=d/64*Math.PI*2,f=o.clone().multiplyScalar(Math.cos(p)).addScaledVector(n,Math.sin(p));c.push(e.clone().addScaledVector(s,Math.cos(r)*a.length).addScaledVector(f,Math.sin(r)*a.length))}G(t,c,l,!0);for(const d of[0,16,32,48])G(t,[e,c[d]],l);return t}function Oi(a,t,e){return a.applyQuaternion(new T(...e)).add(new h(...t))}function Di(a){const t=new q,e=wt(a),[s,i,o]=a.halfExtents,n=[[-s,-i,-o],[s,-i,-o],[s,i,-o],[-s,i,-o],[-s,-i,o],[s,-i,o],[s,i,o],[-s,i,o]].map(([r,l,c])=>Oi(new h(r,l,c),a.center,a.rotation));for(const[r,l]of[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]])G(t,[n[r],n[l]],e);return t}function Li(a){const t=new q,e=wt(a),s=new T(...a.rotation),i=ct(a.center),o=r=>r.applyQuaternion(s).add(i),n=(r,l,c)=>Ft(new h(0,r,0),a.radius,l,c).map(o);G(t,n(a.halfHeight,new h(1,0,0),new h(0,0,1)),e,!0),G(t,n(-a.halfHeight,new h(1,0,0),new h(0,0,1)),e,!0);for(const[r,l]of[[a.radius,0],[-a.radius,0],[0,a.radius],[0,-a.radius]])G(t,[o(new h(r,-a.halfHeight,l)),o(new h(r,a.halfHeight,l))],e);for(const r of["x","z"]){const l=[];for(let c=0;c<=32;c++){const d=c/32*Math.PI,p=new h(0,a.halfHeight+Math.sin(d)*a.radius,0);p[r]=Math.cos(d)*a.radius,l.push(o(p))}for(let c=0;c<=32;c++){const d=Math.PI+c/32*Math.PI,p=new h(0,-a.halfHeight+Math.sin(d)*a.radius,0);p[r]=Math.cos(d)*a.radius,l.push(o(p))}G(t,l,e)}return t}function Ri(a){const t=a.kind==="line"?Ti(a):a.kind==="sphere"?Ii(a):a.kind==="cone"?zi(a):a.kind==="box"?Di(a):Li(a);return t.layers.set(M),t.traverse(e=>e.layers.set(M)),t}function ki(a,t){const e=new X({color:t.color,depthTest:!1,transparent:!0,opacity:t.writable?.92:.35}),s=new m(rs,e);return Object.defineProperty(s,"isSpatialHandleMesh",{value:!0}),s.position.copy(ct(t.position)),s.renderOrder=998,s.layers.set(M),me.set(s,{nodeId:a,handle:t}),s}function ji(a,t){const e=[],s=[];for(const i of t){for(const o of i.guides)e.push(Ri(o));for(const o of i.handles){const n=ki(a,o);e.push(n),s.push(n)}}return{roots:e,handles:s}}function Ve(a){return me.get(a)??null}function ee(a,t){const e=me.get(a);a.material.color.set(t&&e?.handle.writable?"#ffffff":e?.handle.color??"#ffffff")}function Xe(a,t){const e=a.position.distanceTo(t.position);a.scale.setScalar(Math.max(.025,e*.012))}function Fi(a,t,e){const s=a,i=s.geometry;i&&i!==rs&&!t.has(i)&&(i.dispose(),t.add(i));const o=Array.isArray(s.material)?s.material:s.material?[s.material]:[];for(const n of o)e.has(n)||(n.dispose(),e.add(n))}function We(a){const t=new Set,e=new Set;for(const s of a)s.removeFromParent(),s.traverse(i=>Fi(i,t,e))}function se(a,t,e,s=1.15){if(a.isEmpty())return 3;const i=e.clone().normalize(),o=Math.abs(i.dot(t.up))>.999?new h(0,0,1):t.up,n=new h().crossVectors(o,i).normalize(),r=new h().crossVectors(i,n).normalize(),l=a.getCenter(new h);let c=0,d=0,p=0;for(const g of[a.min.x,a.max.x])for(const y of[a.min.y,a.max.y])for(const v of[a.min.z,a.max.z]){const w=new h(g,y,v).sub(l);p=Math.max(p,Math.abs(w.dot(n))),d=Math.max(d,Math.abs(w.dot(r))),c=Math.max(c,Math.abs(w.dot(i)))}const f=Y.degToRad(t.fov*.5),u=Math.atan(Math.tan(f)*Math.max(t.aspect,.01)),_=Math.max(d/Math.tan(f),p/Math.tan(u));return Math.max(_*s+c,t.near*4,.01)}const Gi=3,Bi=.05,Vi=.03,Xi=.6,Wi=.15,Yi=.08,Ni=3,Qi=.45,qi=.001,Zi=24,Ui=6,Ki=[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]];function ie(a){const t=Y.clamp(a*Wi,Yi,Ni);return Math.max(Math.min(t,a*Qi),qi)}function oe(a){return Y.clamp(a*Bi,Vi,Xi)}function $i(a,t){const{min:e,max:s}=a,i=ie(s.x-e.x),o=ie(s.y-e.y),n=ie(s.z-e.z);let r=0;for(const[l,c,d]of Ki){const p=l===0?e.x:s.x,f=c===0?e.y:s.y,u=d===0?e.z:s.z,_=l===0?i:-i,g=c===0?o:-o,y=d===0?n:-n;t[r++]=p,t[r++]=f,t[r++]=u,t[r++]=p+_,t[r++]=f,t[r++]=u,t[r++]=p,t[r++]=f,t[r++]=u,t[r++]=p,t[r++]=f+g,t[r++]=u,t[r++]=p,t[r++]=f,t[r++]=u,t[r++]=p,t[r++]=f,t[r++]=u+y}}class ne extends is{entityObject;_fixedSize;_positions=new Float32Array(Zi*Ui);_box=new ft;_worldPos=new h;_fixedExtent=new h;_standoff=new h;_lastRootMatrix=new Float32Array(16);_requiresContinuousBounds;constructor(t,e){const s=new os,i=new ns({color:e.color,linewidth:Gi,worldUnits:!1,alphaToCoverage:!0,toneMapped:!1,depthTest:!1,depthWrite:!1});super(s,i),this.entityObject=t,this._fixedSize=e.fixedSize;let o=!1;t.traverse(n=>{const r=n;(n.isSkinnedMesh||Array.isArray(r.morphTargetInfluences)&&r.morphTargetInfluences.length>0||n.userData._animMixer)&&(o=!0)}),this._requiresContinuousBounds=o,this.renderOrder=1,this.frustumCulled=!1,s.setPositions(this._positions),this.update()}setColor(t){this.material.color.setHex(t)}updateIfNeeded(){this.entityObject.updateWorldMatrix(!0,!1);const t=this.entityObject.matrixWorld.elements;let e=!1;for(let s=0;s<t.length;s++)if(t[s]!==this._lastRootMatrix[s]){e=!0;break}(e||this._requiresContinuousBounds)&&this.update()}update(){if(this.entityObject.updateWorldMatrix(!0,!1),this._fixedSize!==void 0)this.entityObject.getWorldPosition(this._worldPos),this._fixedExtent.setScalar(this._fixedSize),this._box.setFromCenterAndSize(this._worldPos,this._fixedExtent);else if(Rt(this.entityObject,this._box),this._box.isEmpty())return;this._box.getSize(this._standoff),this._standoff.set(oe(this._standoff.x),oe(this._standoff.y),oe(this._standoff.z)),this._box.expandByVector(this._standoff),$i(this._box,this._positions);const t=this.geometry.getAttribute("instanceStart");t&&(t.data.needsUpdate=!0),this._lastRootMatrix.set(this.entityObject.matrixWorld.elements)}dispose(){this.geometry.dispose(),this.material.dispose()}}function No({BlendFunction:a,KernelSize:t,OutlineEffect:e},s,i,o){const n=Ji(()=>new e(s,i,{blendFunction:a.ALPHA,visibleEdgeColor:o.visible,hiddenEdgeColor:o.hidden,edgeStrength:5,pulseSpeed:0,blur:!0,kernelSize:t.MEDIUM,resolutionScale:.5,xRay:!0}));return n.selectionLayer=ye,i.layers.disable(ye),n}function Ji(a){const t=console.warn;console.warn=(...e)=>{e[0]!=="Layer out of range, resetting to 2"&&t.apply(console,e)};try{return a()}finally{console.warn=t}}function Qo(a,t){a.visibleEdgeColor.setHex(t.visible),a.hiddenEdgeColor.setHex(t.hidden)}function to(a){return a.isBone?!1:a.isMesh||a.isLine||a.isPoints||a.isSprite}function as(a){const t=[],e=new Set;for(const s of a)s.isBone||s.traverse(i=>{e.has(i)||tt(i)||!to(i)||(e.add(i),t.push(i))});return t}function qo(a,t){const e=as(t);a.selection.size===e.length&&e.every(s=>a.selection.has(s))||a.selection.set(e)}function Ye(a,t){const e=new x(a);if(!t||t.toneMapping===Vs)return e;const s=t.toneMappingExposure||1;if(t.toneMapping===Xs)return e.multiplyScalar(1/s);if(t.toneMapping===Ws)return eo(e,s);if(t.toneMapping!==Ys)return e;const i=[[.59719,.35458,.04823],[.076,.90834,.01566],[.0284,.13383,.83777]],o=[[1.60475,-.53108,-.07367],[-.10208,1.10813,-.00605],[-.00327,-.07276,1.07602]],n=p=>(p*(p+.0245786)-90537e-9)/(p*(.983729*p+.432951)+.238081),r=p=>{let f=0,u=64;for(let _=0;_<60;_++){const g=(f+u)/2;n(g)<p?f=g:u=g}return(f+u)/2},c=nt(Vt(o),[e.r,e.g,e.b]).map(p=>p<=0?0:r(Math.min(p,.999))),d=nt(Vt(i),c).map(p=>Math.max(0,p)*(.6/s));return new x().setRGB(d[0],d[1],d[2],ss)}function eo(a,t){const e=[[.6274,.3293,.0433],[.0691,.9195,.0113],[.0164,.088,.8956]],s=[[1.6605,-.5876,-.0728],[-.1246,1.1329,-.0083],[-.0182,-.1006,1.1187]],i=[[.856627153315983,.0951212405381588,.0482516061458583],[.137318972929847,.761241990602591,.101439036467562],[.11189821299995,.0767994186031903,.811302368396859]],o=[[1.1271005818144368,-.11060664309660323,-.016493938717834573],[-.1413297634984383,1.157823702216272,-.016493938717834257],[-.14132976349843826,-.11060664309660294,1.2519364065950405]],n=-12.47393,r=4.026069,l=_=>{const g=_*_,y=g*g;return 15.5*y*g-40.14*y*_+31.96*y-6.868*g*_+.4298*g+.1191*_-.00232},c=_=>{let g=0,y=1;for(let v=0;v<60;v++){const w=(g+y)/2;l(w)<_?g=w:y=w}return(g+y)/2},d=nt(e,[a.r,a.g,a.b]),f=nt(Vt(o),d.map(_=>Math.max(0,_)**(1/2.2))).map(_=>2**(c(_)*(r-n)+n)),u=nt(s,nt(Vt(i),f)).map(_=>Math.max(0,_)/t);return new x().setRGB(u[0],u[1],u[2],ss)}function nt(a,t){return[a[0][0]*t[0]+a[0][1]*t[1]+a[0][2]*t[2],a[1][0]*t[0]+a[1][1]*t[1]+a[1][2]*t[2],a[2][0]*t[0]+a[2][1]*t[1]+a[2][2]*t[2]]}function Vt(a){const[[t,e,s],[i,o,n],[r,l,c]]=a,d=o*c-n*l,p=-(i*c-n*r),f=i*l-o*r,u=t*d+e*p+s*f;return[[d/u,-(e*c-s*l)/u,(e*n-s*o)/u],[p/u,(t*c-s*r)/u,-(t*n-s*i)/u],[f/u,-(t*l-e*r)/u,(t*o-e*i)/u]]}const so=new x(5231045),io=new x(10481896),Ne=64,oo=.6;class no extends q{constructor(t){super(),this.source=t,this.name="Trigger Volume Helper",this.matrixAutoUpdate=!1,this.renderOrder=998,W(this,"editorHelper",!0),W(this,"editorHelperType","trigger-volumes"),this.layers.set(M),this.refresh(!0)}signature="";selected=!1;setSelected(t){this.selected!==t&&(this.selected=t,this.refresh(!0))}update(){this.refresh(!1),this.source.updateWorldMatrix(!0,!1),this.matrix.copy(this.source.matrixWorld),this.matrixWorldNeedsUpdate=!0}dispose(){this.clearVisuals(),this.removeFromParent()}refresh(t){const e=he(this.source);if(!e)return;const s=e.radius,i=String(s);if(!t&&i===this.signature)return;this.signature=i,this.clearVisuals();const o=this.selected?io:so,n=this.selected?1:.62,r=[];for(let u=0;u<Ne;u+=1){const _=u/Ne*Math.PI*2;r.push(Math.cos(_)*s,0,Math.sin(_)*s)}const l=new lt;l.setAttribute("position",new yt(r,3));const c=new Ns(l,this.lineMaterial(o,n));c.renderOrder=this.renderOrder,this.add(c);const d=[];for(const[u,_]of[[s,0],[-s,0],[0,s],[0,-s]])d.push(u,0,_,u,oo,_);const p=new lt;p.setAttribute("position",new yt(d,3));const f=new _e(p,this.lineMaterial(o,n));f.renderOrder=this.renderOrder,this.add(f),this.traverse(u=>u.layers.set(M))}lineMaterial(t,e){return new ht({color:t,depthTest:!1,transparent:!0,opacity:e,toneMapped:!1})}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry?.dispose();const s=Array.isArray(e.material)?e.material:[e.material];for(const i of s)i?.dispose()}}}const ls="vgai-viewport-orbit-gestures-v1",ro="vgai-viewport-orbit-learned-v1",cs=3,pe=new Set;let rt=null;function hs(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function ps(){if(rt===null){const a=hs();a?.getItem(ro)==="1"?rt=cs:rt=Number(a?.getItem(ls)??0)||0}return rt}function Qe(){return ps()>=cs}function ao(){if(!Qe()&&(rt=ps()+1,hs()?.setItem(ls,String(rt)),Qe()))for(const a of pe)a()}function Zo(a){return pe.add(a),()=>{pe.delete(a)}}function lo(a){const t=new Set(a.values()),e=[];for(const s of t){let i=s.parent,o=!1;for(;i!==null;){if(t.has(i)){o=!0;break}i=i.parent}o||e.push(s)}return e}function co(a,t){const e=new Set;for(const s of t){const i=a.get(s);i&&e.add(i)}return[...e].filter(s=>{for(let i=s.parent;i!==null;i=i.parent)if(e.has(i))return!1;return!0})}const Lt=.5,ho=1e3,po=new h(0,1,0),uo=new h(0,0,1),re=new ii,fo=new h,qe=new h,ae=new T,Ze=new h,_o=1e-8,mo=[new h(1,0,0),new h(-1,0,0),new h(0,1,0),new h(0,-1,0),new h(0,0,1),new h(0,0,-1)],J=[[.96,.2,.32],[.53,.84,.01],[.16,.55,.96]],le=[[0,1],[1,1],[2,1]],Ue=[[0,1],[2,1],[1,-1]],go=["X","Y","Z"],yo=62.6;function Ke(a){const t=Number.isFinite(a)&&a>.01?a:1,e=Y.degToRad(yo/2),s=t>=1?Math.atan(Math.tan(e)/t):e;return Y.radToDeg(s*2)}const wo=39/21,vo=[new x(16070225),new x(7316507),new x(3048419)],bo=.356,xo=7.5/17.5;function So(a,t){const s=document.createElement("canvas");s.width=32,s.height=32;const i=s.getContext("2d");if(i){const n=`#${a.getHexString()}`,r=32/2-1;if(t===null){const l=ds/de*32;i.beginPath(),i.arc(32/2,32/2,r,0,Math.PI*2),i.fillStyle=n,i.globalAlpha=.35,i.fill(),i.globalAlpha=1,i.beginPath(),i.arc(32/2,32/2,r-l/2,0,Math.PI*2),i.lineWidth=l,i.strokeStyle=n,i.stroke()}else{i.beginPath(),i.arc(32/2,32/2,r,0,Math.PI*2),i.fillStyle=n,i.fill();const l=a.clone().multiplyScalar(bo);i.fillStyle=`#${l.getHexString()}`;const c=xo*(2*r);i.font=`bold ${Math.round(c/.72)}px system-ui, -apple-system, sans-serif`,i.textAlign="center",i.textBaseline="middle",i.fillText(t,32/2,32/2+2)}}const o=new ai(s);return o.colorSpace=li,o.generateMipmaps=!1,o.minFilter=ci,o}const Co=new h(.8187,.4458,.3617),at=90,Mo=32,de=15,Ho=2.75,ds=2,Po=74.5,us=73.5,Ao=8.5+Po/2-at/2,fs=38+us/2-at/2,Uo=fs+at/2+us/2+16-14.5,_s=`
|
|
3
|
-
float vgaiGrazingFade(vec3 worldPosition, vec3 eye, vec3 planeNormal, float amount) {
|
|
4
|
-
vec3 toEye = eye - worldPosition;
|
|
5
|
-
float toEyeLength = max(length(toEye), 1e-6);
|
|
6
|
-
float graze = 1.0 - abs(dot(toEye / toEyeLength, planeNormal));
|
|
7
|
-
graze *= graze;
|
|
8
|
-
return mix(1.0, 1.0 - graze * graze, amount);
|
|
9
|
-
}
|
|
10
|
-
`,ue=200,gt=2,Xt=ue*2/gt;function Eo(){const a=[];for(let t=0;t<Xt;t++){const e=-ue+t*gt,s=e+gt;a.push(e,.001,0,s,.001,0)}for(let t=0;t<Xt;t++){const e=-ue+t*gt,s=e+gt;a.push(0,.001,e,0,.001,s)}return a}function Io(a,t){a.onBeforeCompile=e=>{e.uniforms.uGrazingFade=t,e.vertexShader=e.vertexShader.replace("void main() {",`varying vec3 vAxisWorld;
|
|
11
|
-
void main() {`).replace("vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );",`vAxisWorld = ( modelMatrix * vec4( position.y < 0.5 ? instanceStart : instanceEnd, 1.0 ) ).xyz;
|
|
12
|
-
vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );`),e.fragmentShader=e.fragmentShader.replace("void main() {",`varying vec3 vAxisWorld;
|
|
13
|
-
uniform float uGrazingFade;
|
|
14
|
-
${_s}
|
|
15
|
-
void main() {`).replace("gl_FragColor = vec4( diffuseColor.rgb, alpha );","gl_FragColor = vec4( diffuseColor.rgb, alpha * vgaiGrazingFade( vAxisWorld, cameraPosition, vec3( 0.0, 1.0, 0.0 ), uGrazingFade ) );")},a.customProgramCacheKey=()=>"vgai-axis-grazing-fade"}function To(a){const t=new Je(a,a);t.rotateX(-Math.PI/2);const e=new ri({uniforms:{uColor:{value:new x(10066329)},uMajorColor:{value:new x(10066329)},uOpacity:{value:1},uLineWidth:{value:1.5},uFadeStart:{value:a/2*.55},uFadeEnd:{value:a/2},uGrazingFade:{value:0}},vertexShader:`
|
|
16
|
-
varying vec3 vWorld;
|
|
17
|
-
void main() {
|
|
18
|
-
vWorld = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
19
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
20
|
-
}
|
|
21
|
-
`,fragmentShader:`
|
|
22
|
-
uniform vec3 uColor;
|
|
23
|
-
uniform vec3 uMajorColor;
|
|
24
|
-
uniform float uOpacity;
|
|
25
|
-
uniform float uLineWidth;
|
|
26
|
-
uniform float uFadeStart;
|
|
27
|
-
uniform float uFadeEnd;
|
|
28
|
-
uniform float uGrazingFade;
|
|
29
|
-
varying vec3 vWorld;
|
|
30
|
-
${_s}
|
|
31
|
-
// Coverage of a line WIDTH device pixels across, with a one-pixel
|
|
32
|
-
// anti-aliased edge — so its core is FULL, the way Blender's is. The
|
|
33
|
-
// earlier form (1 - distance/width) was a triangle with no plateau:
|
|
34
|
-
// whether a line reached its own colour depended on where the nearest
|
|
35
|
-
// fragment centre happened to fall, and the measured peak wandered
|
|
36
|
-
// between 0.67 and 1 of it.
|
|
37
|
-
float gridLine(vec2 coord, float width) {
|
|
38
|
-
vec2 d = max(fwidth(coord), vec2(1e-6));
|
|
39
|
-
vec2 dist = abs(fract(coord - 0.5) - 0.5) / d;
|
|
40
|
-
vec2 cov = clamp(width * 0.5 - dist + 0.5, 0.0, 1.0);
|
|
41
|
-
return max(cov.x, cov.y);
|
|
42
|
-
}
|
|
43
|
-
void main() {
|
|
44
|
-
vec2 p = vWorld.xz;
|
|
45
|
-
vec2 pixelsPerMetre = 1.0 / max(fwidth(p), vec2(1e-6));
|
|
46
|
-
float minorVisible = smoothstep(4.0, 14.0, min(pixelsPerMetre.x, pixelsPerMetre.y));
|
|
47
|
-
// Both levels reach FULL strength in their own colour, as Blender's
|
|
48
|
-
// do: the 1 m line is measured at exactly the palette's grid colour
|
|
49
|
-
// and the 10 m line brighter than it (see uMajorColor). The minor
|
|
50
|
-
// level's only attenuation is its own drop-out as cells shrink.
|
|
51
|
-
float minor = gridLine(p, uLineWidth) * minorVisible;
|
|
52
|
-
// The 10 m level is WIDER as well as brighter, which is what lets it
|
|
53
|
-
// reach full coverage — and so its full colour. Measured across one
|
|
54
|
-
// scanline of modeling-object-none.png at device resolution: the 1 m
|
|
55
|
-
// line is 4 px at half rise and plateaus at 83, the 10 m line is 6 px
|
|
56
|
-
// and plateaus at 101. At one shared width ours drew a 10 m line that
|
|
57
|
-
// never exceeded 0.75 coverage and so measured 91, not 102.
|
|
58
|
-
float major = gridLine(p / 10.0, uLineWidth * 1.5);
|
|
59
|
-
float line = max(minor, major);
|
|
60
|
-
float fade = 1.0 - smoothstep(uFadeStart, uFadeEnd, length(p));
|
|
61
|
-
// The floor's DEPTH, beside the band that ends its finite extent:
|
|
62
|
-
// Blender's own grazing-angle profile, transcribed from its frames
|
|
63
|
-
// (see GRAZING_FADE_GLSL above). Without it this lattice reads the
|
|
64
|
-
// same ink at the front of the frame and at the horizon.
|
|
65
|
-
fade *= vgaiGrazingFade(vWorld, cameraPosition, vec3(0.0, 1.0, 0.0), uGrazingFade);
|
|
66
|
-
float alpha = line * fade * uOpacity;
|
|
67
|
-
if (alpha <= 0.002) discard;
|
|
68
|
-
// WHICH level a fragment belongs to is the major's SHARE of the
|
|
69
|
-
// coverage being drawn, never a comparison of the two and never the
|
|
70
|
-
// major's raw coverage. Every 10 m line is also a 1 m line, so there
|
|
71
|
-
// the two are equal: a step() between them compares values equal to
|
|
72
|
-
// within rounding and flips per fragment (photographed with the major
|
|
73
|
-
// forced white: the 10 m lines came out DOTTED), and mixing by the raw
|
|
74
|
-
// coverage dilutes the colour by the line's own anti-aliasing (the
|
|
75
|
-
// same lines then measured 91 where Blender's is 102). As a share it
|
|
76
|
-
// is exactly 1 wherever the major draws — core and skirt alike, and in
|
|
77
|
-
// the far field where the minor has dropped out — and 0 on a 1 m line.
|
|
78
|
-
float majorShare = clamp(major / max(line, 1e-6), 0.0, 1.0);
|
|
79
|
-
gl_FragColor = vec4(mix(uColor, uMajorColor, majorShare), alpha);
|
|
80
|
-
#include <colorspace_fragment>
|
|
81
|
-
}
|
|
82
|
-
`,transparent:!0,depthWrite:!1,side:Bt}),s=new m(t,e);return s.name="editor-floor-grid",s}class ms{setTransformMode(t){this._store.setTransformMode(t)}camera;orthographicCamera;orbitControls;transformControls;_auxRotateControls;_auxScaleControls;_activeGizmo;raycaster=(()=>{const t=new et;return t.layers.enableAll(),t})();grid;_boxHelpers=new Map;_unsubscribeSelectionTheme=()=>{};_constraintHelpers=new Map;_constraintControlRaycaster=(()=>{const t=new et;return t.layers.enableAll(),t})();_hoveredConstraintControl=null;_constraintControlPointerSession=!1;_reflectionProbeHelpers=new Map;_triggerVolumeHelpers=new Map;_cameraHelpers=new Map;_lightHelpers=new Map;_audioHelpers=new Map;_spatialHandleRoots=[];_spatialHandleMeshes=[];_spatialHandleRaycaster=(()=>{const t=new et;return t.layers.enableAll(),t})();_activeSpatialHandle=null;_hoveredSpatialHandle=null;_spatialHandleDragPlane=new Te;_spatialHandleDragOffset=new h;_spatialHandleDragPoint=new h;_orbitEnabledBeforeHandleDrag=!0;_transformEnabledBeforeHandleDrag=!0;_gizmoHelper;_editorAmbient;_editorDirLight;_lightRig;_scene;_contentBoundsBox=new ft;_contentBoundsAt=0;_renderer;_sparkRenderer=null;_sparkRendererLoading=!1;_sparkRendererFailed=!1;_lastSparkDiscoveryAt=Number.NEGATIVE_INFINITY;_disposed=!1;_editorObjects=[];_axisLines=null;_axesWanted=!1;_lookAxisHexes=null;_lookGridHex=null;_lookBackgroundHex=null;_lookToneMapping=null;_lookExposure=null;_lookGizmoSizePx=null;_lookAxisFrame=le;_appliedAxisSigns=[1,1,1];_lookBoxSelect=null;_store;_objectMap=new Map;_canvas;_interactionElement;_onInteractionPointerUp;_onInteractionDblClick;_authoring;_pick;_standaloneAuthoring;_publishPickContext;_onlineAssetResolver;_onProjectionChange;_pointerDownPos=new K;_skipNextSync=!1;_marqueeActive=!1;_pointerSessionActive=!1;_marqueeDiv=null;_pointerDownButton=-1;_altDragOrbit=!1;_vcScene=new Qs;_vcCamera;_vcClickTargets=[];_vcBalls=[];_vcStalks=[];_vcSize=at;_vcMarginRight=Ao;_vcMarginTop=fs;_chromeInsetPx=0;_vcDir=new h;_previewClearColor=new x;_cameraView=null;_projection="perspective";_pendingProjection=null;_viewportAspect=1;_orthographicHeight=10;_cameraViewMode=null;_orbitEnabledBeforeCameraView=!0;_orbitTargetBeforeCameraView=new h;_lastGizmoObjectMap=null;_lastGizmoSig="";_lastGizmoEpoch=-1;_threejsToolContextActive=!1;_threeSurfaceShowing=!1;_vcRaycaster=new et;_dropOverlay=null;_groundPlane=new Te(new h(0,1,0),0);_dragStartPos=new h;_dragStartQuat=new T;_dragStartScale=new h;_attachedAuthoringId=null;_otherDragObjects=[];_allDragObjects=[];_preservedChildObjects=[];_activeTransformEditIds=[];_pivotDummy=new Gt;_dummyIsPresentationAnchor=!1;_pivotPos=new h;_surfaceSnapRaycaster=new et;_surfaceSnapIndicator;_vertexSnapTargets=[];_vertexSnapIndicator;_vertexSnapThreshold=20;batchedRenderer;_helpers=new Map;_snapAnimating=!1;_snapStartTime=0;_snapDuration=400;_snapQ1=new T;_snapQ2=new T;_snapDist=0;_flyActive=!1;_orbitGesture=!1;_orbitGestureCounted=!1;_snapHold=!1;_flyKeys=new Set;_flySpeed=5;_flyEuler=new $e(0,0,0,"YXZ");_rightMouseDown=!1;constructor(t,e,s,i=t,o={}){this._canvas=t,this._interactionElement=i,this._scene=e,this._renderer=o.renderer,this._store=s,this._authoring=o.authoring??(()=>Mt().activeAuthoring(this._store)),this._pick=o.pick,this._standaloneAuthoring=o.authoring!==void 0,this._publishPickContext=o.publishPickContext??!0,this._chromeInsetPx=o.chromeInsetPx??0,this._onlineAssetResolver=o.onlineAssetResolver,this._onProjectionChange=o.onProjectionChange,this.camera=new qs(Ke(t.clientWidth/Math.max(1,t.clientHeight)),t.clientWidth/t.clientHeight,Ee,Ie),this.camera.position.copy(Co).multiplyScalar(17.32),this.camera.lookAt(0,0,0),this.camera.layers.enableAll(),this._viewportAspect=t.clientWidth/Math.max(1,t.clientHeight),this.orthographicCamera=new Nt(-5,5,5,-5,Ee,Ie),this.orthographicCamera.layers.enableAll(),this._syncOrthographicFromPerspective(),this.grid=To(400),this.grid.layers.set(M),e.add(this.grid);const n=new os;n.setPositions(Eo()),n.setColors(new Array(Xt*2*2*3).fill(1)),this._axisLines=new is(n,new ns({vertexColors:!0,linewidth:2,transparent:!0,opacity:1,depthWrite:!1,toneMapped:!1})),Io(this._axisLines.material,this.grid.material.uniforms.uGrazingFade),this._axisLines.visible=!1,this._axisLines.layers.set(M),e.add(this._axisLines),this._unsubscribeSelectionTheme=bs(t,()=>{Yt();const l=Ht(t).visible;for(const c of this._boxHelpers.values())c instanceof ne&&c.setColor(l);this._applyViewportLook(xs(t)),this._lookGizmoSizePx=we(t),this._applyGizmoSize(),this._readLookStage(t)}),this._lightRig=o?.lightRig!==!1,this._editorAmbient=new Zs(16777215,.5),this._editorAmbient.layers.set(M),e.add(this._editorAmbient),this._editorDirLight=new Us(16777215,1),this._editorDirLight.position.set(10,20,10),this._editorDirLight.layers.set(M),e.add(this._editorDirLight),this._editorAmbient.visible=this._lightRig,this._editorDirLight.visible=this._lightRig,this.batchedRenderer=new hi,this.batchedRenderer.layers.set(M),e.add(this.batchedRenderer),i.addEventListener("wheel",this._onTrackpadWheel,{passive:!1}),this.orbitControls=new Fs(this.camera,i),this.orbitControls.enableDamping=!0,this.orbitControls.dampingFactor=.1,this.orbitControls.mouseButtons={LEFT:-1,MIDDLE:Qt.PAN,RIGHT:Qt.ROTATE},this.transformControls=new Zt(this.camera,t),this._auxScaleControls=new Zt(this.camera,t),this._auxScaleControls.setMode("scale"),this._auxRotateControls=new Zt(this.camera,t),this._auxRotateControls.setMode("rotate"),this._activeGizmo=this.transformControls;const r=l=>{l.getRaycaster().layers.enableAll(),l.addEventListener("dragging-changed",c=>{const d=c.value;if(d?pi():di(),this.orbitControls.enabled=!d,d){this._activeGizmo=l;for(const g of this._allGizmos())g!==l&&(g.enabled=!1);const p=l.object,f=l.mode==="translate"?"position":l.mode==="rotate"?"rotation":"scale",u=g=>this._authoring().transforms?.editability?.(g,f).writable??!0,_=this._attachedAuthoringId??(p&&this._authoringIdForObject(p))??"";if(p){if(this._dragStartPos.copy(p.position),this._dragStartQuat.copy(p.quaternion),this._dragStartScale.copy(p.scale),this._otherDragObjects=[],this._allDragObjects=[],this._pivotPos.copy(p.position),p===this._pivotDummy?null:this._authoringIdForObject(p))for(const w of this._store.selectedEntityIds){if(w===_||!u(w))continue;const b=this._objectForAuthoringId(w);b&&this._otherDragObjects.push({id:w,obj:b,startPos:b.position.clone(),startQuat:b.quaternion.clone(),startScale:b.scale.clone()})}else for(const w of this._store.selectedEntityIds){if(!u(w))continue;const b=this._objectForAuthoringId(w);b&&this._allDragObjects.push({id:w,obj:b,startPos:b.position.clone(),startQuat:b.quaternion.clone(),startScale:b.scale.clone()})}const y=p===this._pivotDummy?this._allDragObjects.map(({id:w})=>w):[_,...this._otherDragObjects.map(({id:w})=>w)];this._preservedChildObjects=this._preparePreservedChildren(y.filter(Boolean)),this._activeTransformEditIds=[...new Set([...y.filter(Boolean),...this._preservedChildObjects.map(({id:w})=>w)])];const v=this._authoring();for(const w of this._activeTransformEditIds)Se(v,w)}}else this._surfaceSnapIndicator.visible=!1,this._vertexSnapIndicator.visible=!1,this.syncFromStore()}),l.addEventListener("objectChange",()=>{const c=l.object;if(!c)return;const d=l.mode,p=this._store.pivotMode==="individual-origins"||this._dummyIsPresentationAnchor,u=this._allDragObjects.length>0?this._allDragObjects:this._otherDragObjects;if(u.length>0){if(d==="translate"){const _=c.position.clone().sub(this._dragStartPos);for(const{obj:g,startPos:y}of u)g.position.copy(y).add(_)}else if(d==="rotate"){const _=c.quaternion.clone().multiply(this._dragStartQuat.clone().invert());if(p)for(const{obj:g,startQuat:y}of u)g.quaternion.copy(_).multiply(y);else for(const{obj:g,startPos:y,startQuat:v}of u){const w=y.clone().sub(this._pivotPos);w.applyQuaternion(_),g.position.copy(this._pivotPos).add(w),g.quaternion.copy(_).multiply(v)}}else if(d==="scale"){const _=new h(this._dragStartScale.x!==0?c.scale.x/this._dragStartScale.x:1,this._dragStartScale.y!==0?c.scale.y/this._dragStartScale.y:1,this._dragStartScale.z!==0?c.scale.z/this._dragStartScale.z:1);if(p)for(const{obj:g,startScale:y}of u)g.scale.copy(y).multiply(_);else for(const{obj:g,startPos:y,startScale:v}of u){const w=y.clone().sub(this._pivotPos);w.multiply(_),g.position.copy(this._pivotPos).add(w),g.scale.copy(v).multiply(_)}}}d==="translate"&&this._store.vertexSnapActive&&this._vertexSnapTargets.length>0?this._applyVertexSnap(c,u):d==="translate"&&this._store.snapToSurface&&this._applySurfaceSnap(c,u),this._restorePreservedChildren();for(const _ of this._boxHelpers.values())"update"in _&&_.update();this._flushGizmoToStoreLive()}),l.addEventListener("mouseUp",()=>{this._flushGizmoToStore()})};r(this.transformControls),r(this._auxRotateControls),r(this._auxScaleControls),this._gizmoHelper=this.transformControls.getHelper(),this._gizmoHelper.traverse(l=>l.layers.set(M)),e.add(this._gizmoHelper);for(const l of[this._auxRotateControls,this._auxScaleControls]){const c=l.getHelper();c.traverse(d=>d.layers.set(M)),c.visible=!1,e.add(c)}this._pivotDummy.layers.set(M),e.add(this._pivotDummy),this._surfaceSnapIndicator=new m(new Ks(.08,.12,16),new X({color:65416,side:Bt,depthTest:!1})),this._surfaceSnapIndicator.rotation.x=-Math.PI/2,this._surfaceSnapIndicator.visible=!1,this._surfaceSnapIndicator.renderOrder=999,this._surfaceSnapIndicator.layers.set(M),e.add(this._surfaceSnapIndicator),this._vertexSnapIndicator=new m(new Q(1,8,8),new X({color:65450,depthTest:!1})),this._vertexSnapIndicator.visible=!1,this._vertexSnapIndicator.renderOrder=999,this._vertexSnapIndicator.layers.set(M),e.add(this._vertexSnapIndicator),this._patchGizmo(this._gizmoHelper),this._patchGizmo(this._auxRotateControls.getHelper()),this._patchGizmo(this._auxScaleControls.getHelper()),this._dropNegativeAxisHandles(this._gizmoHelper,["translate","scale"]),this._dropNegativeAxisHandles(this._auxScaleControls.getHelper(),["scale"]),this._patchCombinedScaleGizmo(this._auxScaleControls.getHelper()),this._lookGizmoSizePx=we(t),this._applyGizmoSize(),this._lookAxisFrame=ve(t)==="z"?Ue:le,this._lookBoxSelect=be(t),this._applyGizmoAxisFrame(),this._vcCamera=new Nt(-1.5,1.5,1.5,-1.5,.1,10),this._initOrientationGizmo(),window.addEventListener("keydown",this._onFlyKeyDown),window.addEventListener("keyup",this._onFlyKeyUp),i.addEventListener("pointerdown",this._onFlyPointerDown),i.addEventListener("pointerup",this._onFlyPointerUp),i.addEventListener("pointermove",this._onFlyPointerMove),i.addEventListener("wheel",this._onFlyWheel,{passive:!1}),t.addEventListener("pointerdown",this._onAltOrbitStart,{capture:!0}),window.addEventListener("pointerup",this._onAltOrbitRelease,{capture:!0}),window.addEventListener("pointercancel",this._onAltOrbitRelease,{capture:!0}),this.orbitControls.addEventListener("change",()=>{this._orbitGesture&&!this._orbitGestureCounted&&(this._orbitGestureCounted=!0,ao())}),window.addEventListener("keydown",this._onSnapHoldKey),window.addEventListener("keyup",this._onSnapHoldKey),t.addEventListener("pointerdown",this._onPointerDown),i.addEventListener("pointermove",this._onPointerMove),this._onInteractionPointerUp=l=>{(l.target===t||l.target===i||this._pointerSessionActive)&&this._onPointerUp(l)},i.addEventListener("pointerup",this._onInteractionPointerUp),this._onInteractionDblClick=l=>{(l.target===t||l.target===i)&&this._onDoubleClick(l)},i.addEventListener("dblclick",this._onInteractionDblClick),t.addEventListener("dragover",this._onDragOver),t.addEventListener("dragleave",this._onDragLeave),t.addEventListener("drop",this._onDrop),this._editorObjects=[this.grid,...this._axisLines?[this._axisLines]:[],this._editorAmbient,this._editorDirLight,this.batchedRenderer,this._gizmoHelper,this._auxRotateControls.getHelper(),this._auxScaleControls.getHelper(),this._pivotDummy,this._surfaceSnapIndicator,this._vertexSnapIndicator],this._publishPickContext&&this._installPickContext(this.camera)}setScene(t){if(t===this._scene)return;for(const s of this._editorObjects)s.removeFromParent(),t.add(s);for(const s of this._boxHelpers.values())s.removeFromParent(),t.add(s);for(const s of this._constraintHelpers.values())s.removeFromParent(),t.add(s);for(const s of this._reflectionProbeHelpers.values())s.removeFromParent(),t.add(s);for(const s of this._triggerVolumeHelpers.values())s.removeFromParent(),t.add(s);for(const{helper:s}of this._cameraHelpers.values())s.removeFromParent(),t.add(s);for(const s of this._spatialHandleRoots)s.removeFromParent(),t.add(s);this._scene=t,this._contentBoundsAt=0;const e=this._lightRig&&!this._store.isAdoptedSceneActive;this._editorAmbient.visible=e,this._editorDirLight.visible=e}get currentScene(){return this._scene}get renderCamera(){return this._cameraView??this.freeCamera}get freeCamera(){return this._projection==="orthographic"?this.orthographicCamera:this.camera}get projection(){return this._projection}_installPickContext(t){this._publishPickContext&&ze({camera:t,canvas:this._canvas,editorControls:{activate:(e,s)=>this._selectConstraintControlAt({clientX:e,clientY:s},!1),hover:(e,s)=>this._hoverConstraintControlAt({clientX:e,clientY:s}),clearHover:()=>this._clearConstraintControlHover()}})}setProjection(t){if(this._cameraView){this._pendingProjection=t;return}if(this._projection===t)return;t==="orthographic"?this._syncOrthographicFromPerspective():this._syncPerspectiveFromOrthographic(),this._projection=t;const e=this.freeCamera;this.orbitControls.object=e;for(const s of this._allGizmos())s.camera=e;this._applyGizmoSize(),this.orbitControls.update(),this._installPickContext(e),this._onProjectionChange?.(t)}_syncOrthographicFromPerspective(t=!1){const e=Math.max(.01,this.camera.position.distanceTo(this.orbitControls?.target??new h));t||(this._orthographicHeight=2*e*Math.tan(Y.degToRad(this.camera.fov*.5))),this.orthographicCamera.position.copy(this.camera.position),this.orthographicCamera.quaternion.copy(this.camera.quaternion),this.orthographicCamera.up.copy(this.camera.up),this.orthographicCamera.zoom=1,this._applyOrthographicFrustum(),this.orthographicCamera.updateMatrixWorld(!0)}_syncPerspectiveFromOrthographic(){const e=this._orthographicHeight/Math.max(this.orthographicCamera.zoom,.01)/(2*Math.tan(Y.degToRad(this.camera.fov*.5))),s=this.orthographicCamera.position.clone().sub(this.orbitControls.target).normalize();this.camera.position.copy(this.orbitControls.target).add(s.multiplyScalar(e)),this.camera.quaternion.copy(this.orthographicCamera.quaternion),this.camera.up.copy(this.orthographicCamera.up),this.camera.updateMatrixWorld(!0)}_applyOrthographicFrustum(){const t=this._orthographicHeight*.5,e=t*this._viewportAspect;this.orthographicCamera.left=-e,this.orthographicCamera.right=e,this.orthographicCamera.top=t,this.orthographicCamera.bottom=-t,this.orthographicCamera.updateProjectionMatrix()}get cameraViewMode(){return this._cameraViewMode}setCameraView(t,e){if(this.clearCameraView(),this._cameraView=t,this._cameraViewMode=e,this._orbitEnabledBeforeCameraView=this.orbitControls.enabled,this._orbitTargetBeforeCameraView.copy(this.orbitControls.target),e==="pilot"){const s=t.getWorldPosition(new h),i=t.getWorldDirection(new h),o=Math.max(1,this.freeCamera.position.distanceTo(this.orbitControls.target));this.orbitControls.object=t,this.orbitControls.target.copy(s).add(i.multiplyScalar(o)),this.orbitControls.enabled=!0,this.orbitControls.update()}else this.orbitControls.enabled=!1;this._publishPickContext&&this._installPickContext(t)}clearCameraView(){if(!this._cameraView)return;this._flyActive&&this._exitFlyMode(),this.orbitControls.object=this.freeCamera,this.orbitControls.target.copy(this._orbitTargetBeforeCameraView),this.orbitControls.enabled=this._orbitEnabledBeforeCameraView,this.orbitControls.update(),this._cameraView=null,this._cameraViewMode=null;const t=this._pendingProjection;this._pendingProjection=null,t&&t!==this._projection&&this.setProjection(t),this._publishPickContext&&this._installPickContext(this.freeCamera)}get objectMap(){return this._objectMap}set objectMap(t){this._objectMap=t}attach(t){const e=this._objectForAuthoringId(t);e&&(this._attachedAuthoringId=t,this._attachGizmosTo(e))}detach(){this._attachedAuthoringId=null,this._detachGizmos()}_objectForAuthoringId(t){const e=this._authoring();return e.hierarchy.node(t)===null?null:Ss(e,this._objectMap,t)}_authoringIdForObject(t){return this._authoring().hierarchy.idForObject3D?.(t)??Cs(t)??null}_hasBoundableGeometry(t){return as([t]).length>0}_makeDiagnosticBounds(t){if(this._hasBoundableGeometry(t))return new xe(t,Ht(this._canvas).visible);const e=new E(Lt,Lt,Lt),s=new ts(e);e.dispose();const i=new ht({color:new x(Ht(this._canvas).visible),toneMapped:!1}),o=new _e(s,i);return t.getWorldPosition(o.position),o.isBoxHelper=!0,o._entityObj=t,o}_syncBoxHelpers(){for(const e of this._boxHelpers.values())this._scene.remove(e),e.geometry.dispose(),e.material.dispose();this._boxHelpers.clear();const t=(e,s)=>{s.layers.set(M),this._scene.add(s),this._boxHelpers.set(e,s)};if(this._store.showHelpers&&this._store.helperVisibility.bounds)for(const e of this._objectMap.keys()){const s=this._objectForAuthoringId(e);s&&t(`bounds:${e}`,this._makeDiagnosticBounds(s))}for(const e of this._store.selectedEntityIds){const s=this._objectForAuthoringId(e);!s||this._hasBoundableGeometry(s)||this._standaloneAuthoring&&s.isBone||[...this._constraintHelpers.values()].some(i=>i.presents(s))||t(`selection:${e}`,new ne(s,{fixedSize:Lt,color:Ht(this._canvas).visible}))}}_syncReflectionProbeHelpers(t=null){if(t===null){const e=new Map,s=new Set;for(const[i,o]of this._objectMap)!o||s.has(o)||!kt(o)||(s.add(o),e.set(i,o));for(const[i,o]of this._reflectionProbeHelpers)e.get(i)!==o.source&&(o.dispose(),this._reflectionProbeHelpers.delete(i));for(const[i,o]of e)this._ensureReflectionProbeHelper(i,o)}else{let e=!1;for(const s of t){const i=this._objectMap.get(s),o=i&&kt(i)?i:null,n=this._reflectionProbeHelpers.get(s);n&&n.source!==o&&(o===null&&(e=!0),n.dispose(),this._reflectionProbeHelpers.delete(s)),o&&![...this._reflectionProbeHelpers.values()].some(r=>r.source===o)&&this._ensureReflectionProbeHelper(s,o)}if(e){this._syncReflectionProbeHelpers();return}}for(const[e,s]of this._reflectionProbeHelpers)s.setSelected(this._store.selectedEntityIds.has(e)),s.visible=this._threejsToolContextActive&&this._store.showHelpers&&this._store.helperVisibility.reflectionProbes,s.update()}_ensureReflectionProbeHelper(t,e){if(this._reflectionProbeHelpers.has(t))return;const s=new Ei(e);this._reflectionProbeHelpers.set(t,s),this._scene.add(s)}_syncTriggerVolumeHelpers(t=null){if(t===null){const s=new Map,i=new Set;for(const[o,n]of this._objectMap)!n||i.has(n)||!he(n)||(i.add(n),s.set(o,n));for(const[o,n]of this._triggerVolumeHelpers)s.get(o)!==n.source&&this._disposeTriggerVolumeHelper(o,n);for(const[o,n]of s)this._ensureTriggerVolumeHelper(o,n)}else{let s=!1;for(const i of t){const o=this._objectMap.get(i),n=o&&he(o)?o:null,r=this._triggerVolumeHelpers.get(i);r&&r.source!==n&&(n===null&&(s=!0),this._disposeTriggerVolumeHelper(i,r)),n&&![...this._triggerVolumeHelpers.values()].some(l=>l.source===n)&&this._ensureTriggerVolumeHelper(i,n)}if(s){this._syncTriggerVolumeHelpers();return}}const e=this._threeSurfaceShowing&&this._store.showHelpers&&this._store.helperVisibility.triggerVolumes;for(const[s,i]of this._triggerVolumeHelpers)i.setSelected(this._store.selectedEntityIds.has(s)),i.visible=e,i.update()}_ensureTriggerVolumeHelper(t,e){if(this._triggerVolumeHelpers.has(t))return;const s=new no(e);this._triggerVolumeHelpers.set(t,s),this._scene.add(s)}_disposeTriggerVolumeHelper(t,e){e.dispose(),this._triggerVolumeHelpers.delete(t)}_syncConstraintHelpers(t=null){if(t===null){const s=new Map,i=new Set;for(const[o,n]of this._objectMap)!n||i.has(n)||ce(n).length===0||(i.add(n),s.set(o,n));for(const[o,n]of this._constraintHelpers)s.get(o)!==n.source&&(this._disposeConstraintHelper(n),this._constraintHelpers.delete(o));for(const[o,n]of s)this._ensureConstraintHelper(o,n)}else{let s=!1;for(const i of t){const o=this._objectMap.get(i),n=o&&ce(o).length>0?o:null,r=this._constraintHelpers.get(i);r&&r.source!==n&&(n===null&&(s=!0),this._disposeConstraintHelper(r),this._constraintHelpers.delete(i)),n&&![...this._constraintHelpers.values()].some(l=>l.source===n)&&this._ensureConstraintHelper(i,n)}if(s){this._syncConstraintHelpers();return}}const e=new Set;for(const s of this._store.selectedEntityIds){const i=this._objectForAuthoringId(s);i&&e.add(i)}for(const[s,i]of this._constraintHelpers)i.setSelected(this._store.selectedEntityIds.has(s)),i.setSelectedObjects(e),i.visible=this._threejsToolContextActive&&this._store.showHelpers&&this._store.helperVisibility.constraints,i.update(this.camera)}_ensureConstraintHelper(t,e){if(this._constraintHelpers.has(t))return;const s=new Ci(e);this._constraintHelpers.set(t,s),this._scene.add(s)}_disposeConstraintHelper(t){this._hoveredConstraintControl?.helper===t&&(this._hoveredConstraintControl=null),t.dispose()}_raycastConstraintControl(t){const e=[];for(const n of this._constraintHelpers.values())n.visible&&e.push(...n.controlMeshes());if(e.length===0)return null;const s=this._canvas.getBoundingClientRect(),i=new K((t.clientX-s.left)/s.width*2-1,-((t.clientY-s.top)/s.height)*2+1);this._constraintControlRaycaster.setFromCamera(i,this.renderCamera);const o=this._constraintControlRaycaster.intersectObjects(e,!1)[0]?.object;if(!o)return null;for(const n of this._constraintHelpers.values()){const r=n.controlFor(o);if(r)return{helper:n,control:r}}return null}_updateConstraintControlHover(t){if(t.buttons&1)return this._constraintControlPointerSession;const e=this._hoverConstraintControlAt(t);return e?(this._hoveredSpatialHandle&&(ee(this._hoveredSpatialHandle,!1),this._hoveredSpatialHandle=null),this._canvas.style.cursor=e,!0):(this._canvas.style.cursor="",!1)}_hoverConstraintControlAt(t){const e=this._raycastConstraintControl(t),s=this._hoveredConstraintControl;return e?(s?.mesh!==e.control.mesh&&(s&&s.helper.setHoveredControl(null),e.helper.setHoveredControl(e.control.mesh),this._hoveredConstraintControl={helper:e.helper,mesh:e.control.mesh}),this._authoringIdForObject(e.control.object)?"pointer":"not-allowed"):(this._clearConstraintControlHover(),null)}_clearConstraintControlHover(){this._hoveredConstraintControl?.helper.setHoveredControl(null),this._hoveredConstraintControl=null}_selectConstraintControlAt(t,e=!0){const s=this._raycastConstraintControl(t);if(!s)return!1;this._constraintControlPointerSession=e;const i=this._authoringIdForObject(s.control.object);if(i){const o=this._authoring();Pt(o,[i],{intent:"exact"})||this._store.select(i),F(`${s.control.label} selected — move it with the gizmo.`)}else F(`${s.control.label} is a runtime-only constraint control.`);return!0}_syncCameraHelpers(t=null){if(t===null){const s=new Map;for(const[i,o]of this._objectMap){const n=this._nativeCamera(o);n&&s.set(i,n)}for(const[i,o]of this._cameraHelpers)s.get(i)!==o.source&&this._disposeCameraHelper(i,o);for(const[i,o]of s)this._ensureCameraHelper(i,o)}else{let s=!1;for(const i of t){const o=this._objectMap.get(i),n=o?this._nativeCamera(o):null,r=this._cameraHelpers.get(i);r&&r.source!==n&&(n===null&&(s=!0),this._disposeCameraHelper(i,r)),n&&![...this._cameraHelpers.values()].some(l=>l.source===n)&&this._ensureCameraHelper(i,n)}if(s){this._syncCameraHelpers();return}}const e=this._threeSurfaceShowing&&this._store.showHelpers&&this._store.helperVisibility.cameras;for(const s of this._cameraHelpers.values())s.helper.visible=e,s.helper.update()}_syncLightHelpers(t=null){if(t===null){const s=new Map;for(const[i,o]of this._objectMap){const n=this._nativeLight(o);n&&s.set(i,n)}for(const[i,o]of this._lightHelpers)s.get(i)!==o.source&&this._disposeLightHelper(i,o);for(const[i,o]of s)this._ensureLightHelper(i,o)}else{let s=!1;for(const i of t){const o=this._objectMap.get(i),n=o?this._nativeLight(o):null,r=this._lightHelpers.get(i);r&&r.source!==n&&(n===null&&(s=!0),this._disposeLightHelper(i,r)),n&&![...this._lightHelpers.values()].some(l=>l.source===n)&&this._ensureLightHelper(i,n)}if(s){this._syncLightHelpers();return}}const e=this._threeSurfaceShowing&&this._store.showHelpers&&this._store.helperVisibility.lights;for(const s of this._lightHelpers.values())s.helper.visible=e,s.helper.update?.()}_nativeLight(t){return t.isLight?t:null}_disposeLightHelper(t,e){e.helper.removeFromParent(),e.helper.dispose?.(),this._lightHelpers.delete(t)}_ensureLightHelper(t,e){if(this._lightHelpers.has(t))return;const s=.5;let i=null;const o=e;try{o.isDirectionalLight?i=new $s(e,s):o.isPointLight?i=new Js(e,s):o.isSpotLight?i=new ti(e):o.isHemisphereLight&&(i=new ei(e,s))}catch{i=null}i&&(i.name=`Light helper: ${e.name||t}`,i.userData.editorOnly=!0,i.traverse(n=>n.layers.set(M)),i.layers.set(M),this._lightHelpers.set(t,{source:e,helper:i}),this._scene.add(i))}_syncAudioHelpers(t=null){if(t===null){const s=new Map;for(const[i,o]of this._objectMap){const n=this._nativeAudio(o);n&&s.set(i,n)}for(const[i,o]of this._audioHelpers)s.get(i)!==o.source&&this._disposeAudioHelper(i,o);for(const[i,o]of s)this._ensureAudioHelper(i,o)}else for(const s of t){const i=this._objectMap.get(s),o=i?this._nativeAudio(i):null,n=this._audioHelpers.get(s);n&&n.source!==o&&this._disposeAudioHelper(s,n),o&&![...this._audioHelpers.values()].some(r=>r.source===o)&&this._ensureAudioHelper(s,o)}const e=this._threeSurfaceShowing&&this._store.showHelpers&&this._store.helperVisibility.audio;for(const s of this._audioHelpers.values())s.helper.visible=e}_nativeAudio(t){const e=t.type;return e==="Audio"||e==="PositionalAudio"||e==="AudioListener"?t:null}_ensureAudioHelper(t,e){if(this._audioHelpers.has(t))return;const s=new q,i=e.type==="AudioListener"?8377599:16763274,o=new m(new it(.16),new X({color:i,wireframe:!0,depthTest:!1}));s.add(o),s.name=`Audio helper: ${e.name||t}`,s.userData.editorOnly=!0,s.traverse(n=>n.layers.set(M)),s.layers.set(M),e.add(s),this._audioHelpers.set(t,{source:e,helper:s})}_disposeAudioHelper(t,e){e.helper.traverse(s=>{const i=s;i.geometry?.dispose?.(),i.material?.dispose?.()}),e.helper.removeFromParent(),this._audioHelpers.delete(t)}_disposeCameraHelper(t,e){e.helper.removeFromParent(),e.helper.dispose(),this._cameraHelpers.delete(t)}_ensureCameraHelper(t,e){if(this._cameraHelpers.has(t))return;let s;try{s=new si(e)}catch(i){this._refuseCameraOverlay(t,e,i);return}s.name=`Camera frustum: ${e.name||t}`,s.userData.editorOnly=!0,s.layers.set(M),this._cameraHelpers.set(t,{source:e,helper:s}),this._scene.add(s)}_refusedCameraOverlays=new Set;_refuseCameraOverlay(t,e,s){this._refusedCameraOverlays.has(t)||(this._refusedCameraOverlays.add(t),At.warn(`Helpers → Cameras draws no frustum for "${e.name||e.type}": ${s instanceof Error?s.message:String(s)}. This world's camera was constructed by the GAME's own copy of three, and \`THREE.CameraHelper\` is the editor's class reading fields off it that that revision does not define. Every other camera capability (framing, selection, inspection) is unaffected. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"authoring"))}_nativeCamera(t){if(t.isCamera)return t;const e=U(t,"_camera");return e?.isCamera?e:null}_syncSpatialHandles(){We(this._spatialHandleRoots),this._spatialHandleRoots=[],this._spatialHandleMeshes=[],this._hoveredSpatialHandle=null;const t=Wt(this._authoring());if(!t||!this._threejsToolContextActive||!this._store.showHelpers)return;const e=this._store.helperVisibility;for(const s of this._store.selectedEntityIds){const i=t.layers(s).filter(n=>n.category in e?e[n.category]:!0),o=ji(s,i);for(const n of o.handles)Xe(n,this.renderCamera);for(const n of o.roots)this._scene.add(n);this._spatialHandleRoots.push(...o.roots),this._spatialHandleMeshes.push(...o.handles)}}_raycastSpatialHandle(t){if(this._spatialHandleMeshes.length===0)return null;const e=this._canvas.getBoundingClientRect(),s=new K((t.clientX-e.left)/e.width*2-1,-((t.clientY-e.top)/e.height)*2+1);return this._spatialHandleRaycaster.setFromCamera(s,this.renderCamera),this._spatialHandleRaycaster.intersectObjects(this._spatialHandleMeshes,!1)[0]?.object??null}_spatialHandleWorldPoint(t){const e=this._canvas.getBoundingClientRect(),s=new K((t.clientX-e.left)/e.width*2-1,-((t.clientY-e.top)/e.height)*2+1);this._spatialHandleRaycaster.setFromCamera(s,this.renderCamera);const i=new h;return this._spatialHandleRaycaster.ray.intersectPlane(this._spatialHandleDragPlane,i)?i.add(this._spatialHandleDragOffset):null}_finishSpatialHandleDrag(t){const e=this._activeSpatialHandle;this._activeSpatialHandle=null,this.orbitControls.enabled=this._orbitEnabledBeforeHandleDrag,this.transformControls.enabled=this._transformEnabledBeforeHandleDrag,this.syncFromStore(),this._canvas.style.cursor="",t&&e&&Wt(this._authoring())?.commit(e.nodeId,e.handle.id,[this._spatialHandleDragPoint.x,this._spatialHandleDragPoint.y,this._spatialHandleDragPoint.z])}_updateSpatialHandleDrag(t){const e=this._activeSpatialHandle;if(!e)return!1;const s=this._spatialHandleWorldPoint(t);return s&&(this._spatialHandleDragPoint.copy(s),Wt(this._authoring())?.preview(e.nodeId,e.handle.id,[s.x,s.y,s.z]),this._syncSpatialHandles(),this._canvas.style.cursor="grabbing"),!0}_updateSpatialHandleHover(t){if(t.buttons&1||this._spatialHandleMeshes.length===0)return;const e=this._raycastSpatialHandle(t);if(e===this._hoveredSpatialHandle)return;if(this._hoveredSpatialHandle&&ee(this._hoveredSpatialHandle,!1),this._hoveredSpatialHandle=e,!e){this._canvas.style.cursor="";return}ee(e,!0);const s=Ve(e);this._canvas.style.cursor=s?.handle.writable?"grab":"not-allowed"}_updateEditorHandleInteraction(t){return this._updateSpatialHandleDrag(t)||this._updateConstraintControlHover(t)}_previewInfrastructure(){return[this.grid,...this._axisLines?[this._axisLines]:[],this._gizmoHelper,this._auxRotateControls.getHelper(),this._auxScaleControls.getHelper(),...this._boxHelpers.values(),...this._constraintHelpers.values(),...this._reflectionProbeHelpers.values(),...this._triggerVolumeHelpers.values(),...[...this._cameraHelpers.values()].map(({helper:t})=>t),...this._spatialHandleRoots]}_suspendPreviewInfrastructure(){const t=this._previewInfrastructure().map(e=>[e,e.visible]);for(const[e]of t)e.visible=!1;return()=>{for(const[e,s]of t)e.visible=s}}_allGizmos(){return[this.transformControls,this._auxRotateControls,this._auxScaleControls]}_anyGizmoDragging(){return this._allGizmos().some(t=>t.dragging)}_attachGizmosTo(t){this.transformControls.attach(t),this._auxRotateControls.attach(t),this._auxScaleControls.attach(t)}_detachGizmos(){for(const t of this._allGizmos())t.detach()}syncFromStore(){this._gizmoHelper.traverse(S=>S.layers.set(M));const t=this._store.transformMode,s=t==="combined"||t==="select"?"translate":t;this.transformControls.mode!==s&&this.transformControls.setMode(s),this._applySnapToGizmos();for(const S of this._allGizmos())S.setSpace(this._store.transformSpace);const i=Mt(),o=this._authoring(),n=i.toolOwner(o,this._store.selectedEntityIds);this._threejsToolContextActive=(this._standaloneAuthoring||i.toolOwnerPainted(this._store,n))&&n?.kind==="three";const r=this._standaloneAuthoring||i.threeSurfaceShowing(this._store,o);this._threeSurfaceShowing=r,this.grid.visible=this._store.showGrid&&r,this._axisLines&&(this._axisLines.visible=this.grid.visible&&this._axesWanted);const l=this._store.helperVisibility,c=this._standaloneAuthoring?null:i.threeViewportRootId(this._store),d=c!==null&&Ls(c);d&&i.applyRootHiddenVisibility(this._objectMap,c),d&&i.suppressRootEnvironment(this._scene);const p=this._store.gizmoEpoch,f=`${this._store.showHelpers}|${JSON.stringify(l)}|${c??""}|${d}|${this._threejsToolContextActive}`,u=this._objectMap!==this._lastGizmoObjectMap,_=f!==this._lastGizmoSig,g=u?null:this._store.ingestObjectMapMembershipChangesSince(this._lastGizmoEpoch),y=u||_||g===null?null:g.changedIds,v=y===null||y.size>0;if(this._lastGizmoObjectMap=this._objectMap,this._lastGizmoSig=f,this._lastGizmoEpoch=p,v){i.applyRootHiddenVisibility(this._objectMap,c);const S=y===null?lo(this._objectMap):co(this._objectMap,y);for(const C of S)C.traverse(A=>{if(U(A,"editorIcon")){A.visible=this._store.showHelpers;return}if(!U(A,"editorHelper"))return;const I=U(A,"editorHelperType");if(I==="skeletons"){A.visible=this._store.showHelpers&&(l.skeletons||!!U(A,"skeletonEnabled"));return}I&&I in l?A.visible=this._store.showHelpers&&l[I]:A.visible=this._store.showHelpers});for(const[C,A]of this._helpers)A.visible=this._store.showHelpers&&(!(C in l)||l[C]);this._syncCameraHelpers(y),this._syncLightHelpers(y)}this._syncAudioHelpers(y),this._syncReflectionProbeHelpers(y),this._syncTriggerVolumeHelpers(y),this._syncConstraintHelpers(y);const w=this._threejsToolContextActive&&o.capabilities.transform&&t!=="select"?this._store.selectedEntityId:null,b=t==="translate"||t==="combined"?"position":t==="rotate"?"rotation":"scale",R=w?t==="combined"?(S=>["position","rotation","scale"].some(C=>o.transforms?.editability?.(S,C).writable??!0))(w):o.transforms?.editability?.(w,b).writable??!0:!1;if(w&&R){if(!this._anyGizmoDragging())if(this._store.pivotMode==="median-point"&&this._store.selectedEntityIds.size>1){const S=new h;let C=0;for(const A of this._store.selectedEntityIds){if(!(o.transforms?.editability?.(A,b).writable??!0))continue;const I=this._objectForAuthoringId(A);I&&(S.add(I.getWorldPosition(fo)),C++)}C>0&&S.divideScalar(C),this._pivotDummy.position.copy(S),this._pivotDummy.quaternion.identity(),this._pivotDummy.scale.set(1,1,1),this._attachedAuthoringId=null,this._dummyIsPresentationAnchor=!1,this._attachGizmosTo(this._pivotDummy)}else{const S=this._objectForAuthoringId(w),C=U(S,"pivot"),A=C&&(C[0]!==0||C[1]!==0||C[2]!==0),I=A?null:this._centreAnchorFor(S);if(I&&S)this._pivotDummy.position.copy(I),this._pivotDummy.quaternion.copy(S.getWorldQuaternion(ae)),this._pivotDummy.scale.copy(S.getWorldScale(Ze)),this._attachedAuthoringId=w,this._dummyIsPresentationAnchor=!0,this._attachGizmosTo(this._pivotDummy);else if(A&&S){const vt=new h(C[0],C[1],C[2]);vt.applyQuaternion(S.getWorldQuaternion(ae)),this._pivotDummy.position.copy(S.getWorldPosition(qe)).add(vt),this._pivotDummy.quaternion.copy(ae),this._pivotDummy.scale.copy(S.getWorldScale(Ze)),this._attachedAuthoringId=w,this._dummyIsPresentationAnchor=!1,this._attachGizmosTo(this._pivotDummy)}else this._dummyIsPresentationAnchor=!1,this.attach(w)}}else this.detach();this._syncBoxHelpers(),this._syncSpatialHandles(),this._syncCombinedGizmoHalves()}_applySnapToGizmos(){const t=this._store.snapEnabled||this._snapHold,e=this._store.snapValues;for(const s of this._allGizmos())s.setTranslationSnap(t?e.translate:null),s.setRotationSnap(t?Y.degToRad(e.rotate):null),s.setScaleSnap(t?e.scale:null)}_onAltOrbitStart=t=>{t.altKey&&t.button===0&&(this._altDragOrbit=!0,this.orbitControls.mouseButtons.LEFT=Qt.ROTATE),(t.button===2||t.altKey&&t.button===0)&&(this._orbitGesture=!0)};_onAltOrbitRelease=()=>{this._orbitGesture=!1,this._orbitGestureCounted=!1,this._altDragOrbit&&(this._altDragOrbit=!1,this.orbitControls.mouseButtons.LEFT=-1)};_onSnapHoldKey=t=>{const e=t.ctrlKey||t.metaKey;if(e!==this._snapHold&&(this._snapHold=e,this._applySnapToGizmos(),e&&this._anyGizmoDragging()&&!this._store.snapEnabled)){const{translate:s,rotate:i,scale:o}=this._store.snapValues;F(`Snapping while held: ${s} units · ${i}° · ×${o}`)}};_syncCombinedGizmoHalves(){if(this._anyGizmoDragging())return;const t=this._store.transformMode==="combined",e=this._attachedAuthoringId,s=this._authoring().transforms?.editability,i=c=>e===null||(s?.(e,c).writable??!0),o=t&&this._auxRotateControls.object!==void 0&&i("rotation"),n=t&&this._auxScaleControls.object!==void 0&&i("scale");this._auxRotateControls.enabled=o,this._auxScaleControls.enabled=n;const r=this._auxRotateControls.getHelper(),l=this._auxScaleControls.getHelper();r.visible=o,l.visible=n;for(const c of[r,l])c.traverse(d=>d.layers.set(M));this.transformControls.enabled=!0}moveGizmosTo(t){const e=this._gizmoObjects();for(const s of e)t.add(s)}restoreGizmos(){const t=this._gizmoObjects();for(const e of t)this._scene.add(e)}_gizmoObjects(){return[this.grid,...this._axisLines?[this._axisLines]:[],this._editorAmbient,this._editorDirLight,this.batchedRenderer,this._gizmoHelper,this._auxRotateControls.getHelper(),this._auxScaleControls.getHelper(),this._pivotDummy,this._surfaceSnapIndicator,...[...this._cameraHelpers.values()].map(({helper:t})=>t),...this._spatialHandleRoots]}_contentBounds(t=!1){const e=performance.now(),s=this._contentBoundsAt===0||e-this._contentBoundsAt>ho;if(t||s){this._contentBoundsBox.makeEmpty();for(const i of this._scene.children)tt(i)||Ms(this._contentBoundsBox,i);this._contentBoundsAt=e}return this._contentBoundsBox}_measureContentBounds(){const t=[];for(const e of this._scene.children)tt(e)||Hs(e,t);this._contentBoundsBox.makeEmpty();for(const e of t)this._contentBoundsBox.union(e);return this._contentBoundsAt=performance.now(),t}_updateClipPlanes(){const t=this._contentBounds();let e=0,s=0;t.isEmpty()||(t.getBoundingSphere(re),e=this.freeCamera.position.distanceTo(re.center),s=re.radius);const{near:i,far:o}=js(e,s);i===this.camera.near&&o===this.camera.far||(this.camera.near=i,this.camera.far=o,this.camera.updateProjectionMatrix(),this.orthographicCamera.near=i,this.orthographicCamera.far=o,this.orthographicCamera.updateProjectionMatrix())}seedFromGameCamera(t){const e=Oe(this._measureContentBounds()),s=ui(t,e);if(!s)return!1;const i=this.camera.position.clone(),o=this.orbitControls.target.clone();this.camera.position.copy(s.position),this.orbitControls.target.copy(s.target),this.camera.lookAt(this.orbitControls.target),this.camera.updateMatrixWorld(!0);const n=this._scene.children.filter(r=>!tt(r));return fi(this.camera,n,s.position.distanceTo(s.target))?(this._updateClipPlanes(),this.orbitControls.update(),!0):(this.camera.position.copy(i),this.orbitControls.target.copy(o),this.camera.lookAt(this.orbitControls.target),this.camera.updateMatrixWorld(!0),!1)}focusOnScene(){const t=Oe(this._measureContentBounds());if(t.isEmpty())return!1;const e=t.getCenter(new h),s=this.camera.position.clone().sub(this.orbitControls.target).normalize(),i=se(t,this.camera,s);return Number.isFinite(i)?(this.camera.position.copy(e).add(s.multiplyScalar(i)),this.orbitControls.target.copy(e),this._orthographicHeight=Math.max(t.getSize(new h).y,t.getSize(new h).x/this._viewportAspect)*1.15,this._syncOrthographicFromPerspective(!0),this._updateClipPlanes(),!0):!1}focusOn(t){const e=this._contentOrProbeBounds(t),s=e.getCenter(new h),i=this.camera.position.clone().sub(this.orbitControls.target).normalize(),o=se(e,this.camera,i);this.camera.position.copy(s).add(i.multiplyScalar(o)),this.orbitControls.target.copy(s);const n=e.getSize(new h);this._orthographicHeight=Math.max(n.y,n.x/this._viewportAspect,.01)*1.15,this._syncOrthographicFromPerspective(!0)}activateVertexSnap(){this._vertexSnapTargets=this._collectVertices(this._store.selectedEntityIds)}deactivateVertexSnap(){this._vertexSnapTargets=[],this._vertexSnapIndicator.visible=!1}focusOnMultiple(t){if(t.length===0)return;if(t.length===1){this.focusOn(t[0]);return}const e=new ft;for(const r of t)e.union(this._contentOrProbeBounds(r));const s=e.getCenter(new h),i=this.camera.position.clone().sub(this.orbitControls.target).normalize(),o=se(e,this.camera,i);this.camera.position.copy(s).add(i.multiplyScalar(o)),this.orbitControls.target.copy(s);const n=e.getSize(new h);this._orthographicHeight=Math.max(n.y,n.x/this._viewportAspect,.01)*1.15,this._syncOrthographicFromPerspective(!0)}_centreAnchorFor(t){const e=this._store.gizmoAnchor;if(!t||e==="pivot"||e==="auto"&&Ps(t)===0)return null;const s=Rt(t);if(s.isEmpty()||e==="auto"&&!As(t,s)?.worldAnchored)return null;const i=s.getCenter(new h);return t.updateWorldMatrix(!0,!1),i.distanceToSquared(t.getWorldPosition(qe))<_o?null:i}_contentOrProbeBounds(t){const e=kt(t);if(!e)return Rt(t);const s=e.config,[i,o,n]=s.size,r=s.shape==="sphere"?new h(1,1,1).multiplyScalar(Math.max(.01,s.radius)):new h(Math.max(.01,i),Math.max(.01,o),Math.max(.01,n)).multiplyScalar(.5);return t.updateWorldMatrix(!0,!1),new ft(r.clone().negate(),r).applyMatrix4(t.matrixWorld)}setHelper(t,e){Yt();const s=this._helpers.get(t);if(s&&(this._scene.remove(s),this._helpers.delete(t)),!e)return;W(e,"editorHelper",!0),W(e,"editorHelperType",t);const i=this._store.helperVisibility;e.visible=this._store.showHelpers&&(!(t in i)||i[t]),this._scene.add(e),this._helpers.set(t,e)}setViewPreset(t){this._projection==="orthographic"&&this.setProjection("perspective");const e=this.orbitControls.target.clone(),s=this.camera.position.distanceTo(e),i=new h;switch(t){case"top":i.set(0,1,0);break;case"front":i.set(0,0,1);break;case"right":i.set(1,0,0);break;case"perspective":i.set(1,1,1).normalize();break}this.camera.position.copy(e).add(i.multiplyScalar(s)),this.camera.lookAt(e),t!=="perspective"&&this.setProjection("orthographic"),this.orbitControls.update()}setPose(t,e,s){this.setProjection("perspective"),this.camera.position.set(t.x,t.y,t.z),this.orbitControls.target.set(e.x,e.y,e.z),this.camera.lookAt(this.orbitControls.target),s!==void 0&&(this.camera.fov=s,this.camera.updateProjectionMatrix()),this.orbitControls.update()}resize(t,e){this._viewportAspect=Math.max(1,t)/Math.max(1,e),this.camera.aspect=this._viewportAspect,this.camera.fov=Ke(this._viewportAspect),this.camera.updateProjectionMatrix(),this._applyOrthographicFrustum(),this._applyGizmoSize()}update(t=0){this._ensureSparkRenderer(),this._syncLookBackground();const e=this.transformControls.object;if(e&&e!==this._pivotDummy&&!e.parent&&(this._detachGizmos(),this.syncFromStore()),this._updateFlyCamera(t),this.orbitControls.update(),this._snapAnimating){const s=performance.now()-this._snapStartTime;let i=Math.min(s/this._snapDuration,1);i=i<.5?4*i*i*i:1-(-2*i+2)**3/2;const o=new T().slerpQuaternions(this._snapQ1,this._snapQ2,i),n=new h(0,0,1).applyQuaternion(o);this.freeCamera.position.copy(this.orbitControls.target).add(n.multiplyScalar(this._snapDist)),this.freeCamera.lookAt(this.orbitControls.target),i>=1&&(this._snapAnimating=!1)}for(const s of this._boxHelpers.values()){if(s instanceof ne){s.updateIfNeeded();continue}const i=s;i._entityObj?i._entityObj.getWorldPosition(s.position):s instanceof xe&&s.update()}for(const s of this._constraintHelpers.values())s.update(this.camera);for(const s of this._reflectionProbeHelpers.values())s.update();for(const s of this._triggerVolumeHelpers.values())s.update();for(const{helper:s}of this._cameraHelpers.values())s.update();for(const s of this._spatialHandleMeshes)Xe(s,this.renderCamera);this._enforceLodForcedLevels(),this._updateClipPlanes()}_enforceLodForcedLevels(){const t=new Set(this._objectMap.values());for(const[e,s]of this._store.lodForcedLevels){const i=this._objectMap.get(e),o=i?Es(i,r=>t.has(r)):null;if(!o||o.levels.length===0)continue;o.autoUpdate=!1;const n=Math.min(Math.max(s,0),o.levels.length-1);for(let r=0;r<o.levels.length;r++)o.levels[r].object.visible=r===n}}renderWithInfrastructure(t){const e=this._sparkRenderer,s=this._cameraView?this._suspendPreviewInfrastructure():null;e&&this._scene.add(e);try{t()}finally{e?.removeFromParent(),s?.()}}renderViewCube(t){if(!this._threeSurfaceShowing||this._cameraView)return;const e=t.domElement.clientWidth,s=t.domElement.clientHeight,i=this._vcSize,o=this._vcDir.subVectors(this.freeCamera.position,this.orbitControls.target).normalize();this._vcCamera.position.copy(o.multiplyScalar(4)),this._vcCamera.up.copy(this.freeCamera.up),this._vcCamera.lookAt(0,0,0),this._syncOrientationGizmoDepth();const n=e-i-this._vcMarginRight-this._chromeInsetPx,r=s-i-this._vcMarginTop-this._chromeInsetPx,l=t.autoClear;try{t.setScissorTest(!0),t.setViewport(n,r,i,i),t.setScissor(n,r,i,i),t.clear(!1,!0,!1),t.autoClear=!1,t.render(this._vcScene,this._vcCamera)}finally{t.autoClear=l,t.setScissorTest(!1),t.setViewport(0,0,e,s)}}renderCameraPreview(t,e,s){if(!e||!s||this._cameraView)return;const i=t.domElement.clientWidth,o=t.domElement.clientHeight,n=t.domElement.getBoundingClientRect(),r=s.getBoundingClientRect(),l=Math.round(r.left-n.left),c=Math.round(n.bottom-r.bottom),d=Math.max(1,Math.round(r.width)),p=Math.max(1,Math.round(r.height));if(l>=i||c>=o||l+d<=0||c+p<=0)return;const f=this._suspendPreviewInfrastructure(),u=t.getClearColor(this._previewClearColor),_=t.getClearAlpha();try{t.setScissorTest(!0),t.setViewport(l,c,d,p),t.setScissor(l,c,d,p),t.setClearColor(1118740,1),t.clear(),t.render(this._scene,e)}finally{t.setScissorTest(!1),t.setViewport(0,0,i,o),t.setClearColor(u,_),f()}}get isFlying(){return this._flyActive}_inputDisconnected=!1;disconnectInput(){if(!this._inputDisconnected){this._inputDisconnected=!0,this._publishPickContext&&ze(null),window.removeEventListener("keydown",this._onFlyKeyDown),window.removeEventListener("keyup",this._onFlyKeyUp),this._interactionElement.removeEventListener("pointerdown",this._onFlyPointerDown),this._canvas.removeEventListener("pointerdown",this._onAltOrbitStart,{capture:!0}),window.removeEventListener("pointerup",this._onAltOrbitRelease,{capture:!0}),window.removeEventListener("pointercancel",this._onAltOrbitRelease,{capture:!0}),window.removeEventListener("keydown",this._onSnapHoldKey),window.removeEventListener("keyup",this._onSnapHoldKey),this._interactionElement.removeEventListener("pointerup",this._onFlyPointerUp),this._interactionElement.removeEventListener("pointermove",this._onFlyPointerMove),this._interactionElement.removeEventListener("wheel",this._onFlyWheel),this._interactionElement.removeEventListener("wheel",this._onTrackpadWheel),this._canvas.removeEventListener("pointerdown",this._onPointerDown),this._interactionElement.removeEventListener("pointermove",this._onPointerMove),this._onInteractionPointerUp&&this._interactionElement.removeEventListener("pointerup",this._onInteractionPointerUp),this._onInteractionDblClick&&this._interactionElement.removeEventListener("dblclick",this._onInteractionDblClick),this._canvas.removeEventListener("dragover",this._onDragOver),this._canvas.removeEventListener("dragleave",this._onDragLeave),this._canvas.removeEventListener("drop",this._onDrop),this.orbitControls.dispose();for(const t of this._allGizmos())t.dispose()}}_applyViewportLook(t){this._lookGridHex=t.grid??10066329;const e=this.grid.material.uniforms.uGrazingFade;if(e&&(e.value=t.background!==null?1:0),this._paintLookGrid(),this._axesWanted=t.axisX!==null&&t.axisY!==null,this._lookAxisHexes=t.axisX!==null&&t.axisY!==null?{x:t.axisX,y:t.axisY}:null,this._paintLookAxes(),this._axisLines&&(this._axisLines.visible=this.grid.visible&&this._axesWanted),t.background!==null){const s=this._scene.background,i=s===null||s instanceof x&&[this._lookBackgroundHex,t.background].includes(s.getHex());this._lookBackgroundHex=t.background,i&&this._paintLookBackground()}else this._lookBackgroundHex=null}_paintLookGrid(){const t=this._lookGridHex;if(t===null)return;const e=this._lookBackgroundHex??4144959,s=r=>{const l=t>>r&255,c=e>>r&255;return Math.round(Math.min(255,Math.max(0,c+(l-c)*wo)))},i=s(16)<<16|s(8)<<8|s(0),o=Ye(t,this._renderer),n=Ye(i,this._renderer);this.grid.material.uniforms.uColor?.value?.copy(o),this.grid.material.uniforms.uMajorColor?.value?.copy(n)}_paintLookAxes(){const t=this._lookAxisHexes;if(!this._axisLines||t===null)return;const e=new x(t.x),s=new x(t.y),i=[];for(const o of[e,s])for(let n=0;n<Xt*2;n++)i.push(o.r,o.g,o.b);this._axisLines.geometry.setColors(i)}_paintLookBackground(){this._lookBackgroundHex!==null&&(this._scene.background=new x(this._lookBackgroundHex))}_syncLookBackground(){this._renderer&&(this._renderer.toneMapping===this._lookToneMapping&&this._renderer.toneMappingExposure===this._lookExposure||(this._paintLookGrid(),this._lookToneMapping=this._renderer.toneMapping,this._lookExposure=this._renderer.toneMappingExposure))}dispose(){this._disposed=!0,this._unsubscribeSelectionTheme(),this._axisLines&&(this._scene.remove(this._axisLines),this._axisLines.geometry.dispose(),this._axisLines.material.dispose(),this._axisLines=null),this.clearCameraView(),this._sparkRenderer&&(this._scene.remove(this._sparkRenderer),Is(this._sparkRenderer),this._sparkRenderer=null),this.disconnectInput(),this._hideDropOverlay();for(const t of this._helpers.values())this._scene.remove(t);this._helpers.clear();for(const t of this._boxHelpers.values())this._scene.remove(t),t.geometry.dispose(),t.material.dispose();this._boxHelpers.clear();for(const t of this._reflectionProbeHelpers.values())t.dispose();this._reflectionProbeHelpers.clear();for(const t of this._triggerVolumeHelpers.values())t.dispose();this._triggerVolumeHelpers.clear();for(const t of this._constraintHelpers.values())t.dispose();this._constraintHelpers.clear();for(const{helper:t}of this._cameraHelpers.values())t.dispose();this._cameraHelpers.clear(),We(this._spatialHandleRoots),this._spatialHandleRoots=[],this._spatialHandleMeshes=[]}_ensureSparkRenderer(){if(!this._renderer||this._sparkRenderer||this._sparkRendererLoading||this._sparkRendererFailed)return;const t=performance.now();Ts(this._lastSparkDiscoveryAt,t)&&(this._lastSparkDiscoveryAt=t,zs(this._scene)&&(this._sparkRendererLoading=!0,Rs(async()=>{const{SparkRenderer:e}=await import("./spark.module-4pXQoz5d.js");return{SparkRenderer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({SparkRenderer:e})=>{if(this._disposed||!this._renderer)return;const s=new e({renderer:this._renderer,enableLod:!1});s.traverse(i=>W(i,"engineInternal",!0)),this._sparkRenderer=s,Yt()}).catch(e=>{this._sparkRendererFailed=!0,console.error("Failed to install SparkRenderer in the editor viewport.",e)}).finally(()=>{this._sparkRendererLoading=!1})))}_buildOrientationGizmo(){if(this._vcScene!==void 0){for(const t of[...this._vcScene.children])this._vcScene.remove(t);this._vcBalls.length=0,this._vcStalks.length=0,this._vcClickTargets.length=0,this._initOrientationGizmo()}}_initOrientationGizmo(){const t=at/3,e=de/t,s=Mo/t,i=ds/t/2,o=[new h(1,0,0),new h(0,1,0),new h(0,0,1)],n=new Q(e*.6,8,8),r=new X({visible:!1});for(let l=0;l<3;l++){const[c,d]=this._lookAxisFrame[l],p=vo[c],f=go[c],u=o[l].clone().multiplyScalar(d),_=new m(new O(i,i,s,8),new X({color:p,transparent:!0,depthTest:!1}));_.position.copy(u).multiplyScalar(s/2),_.quaternion.setFromUnitVectors(new h(0,1,0),u),this._vcScene.add(_),this._vcStalks.push({mesh:_,direction:u.clone()});for(const g of[1,-1]){const y=u.clone().multiplyScalar(g),v=new oi(new ni({map:So(p,g>0?f:null),transparent:!0,depthTest:!1}));v.position.copy(y).multiplyScalar(s),v.scale.setScalar(e),this._vcScene.add(v),this._vcBalls.push({sprite:v,direction:y.clone(),positive:g>0});const w=new m(n,r);w.position.copy(v.position),W(w,"vcDirIdx",l*2+(d*g>0?0:1)),this._vcScene.add(w),this._vcClickTargets.push(w)}}}_syncOrientationGizmoDepth(){const t=at/3,e=this._vcDir.copy(this._vcCamera.position).normalize();for(const{sprite:s,direction:i,positive:o}of this._vcBalls){const n=(i.dot(e)+1)/2,r=s.material;r.opacity=o?1:.56+n*.44,s.scale.setScalar((de+Ho*n)/t),s.renderOrder=10+Math.round(n*100)}for(const{mesh:s,direction:i}of this._vcStalks){const o=(i.dot(e)+1)/2;s.material.opacity=.35+o*.65,s.renderOrder=Math.round(o*100)}}_isOverViewCube(t,e){const s=this._canvas.getBoundingClientRect(),i=t-s.left,o=e-s.top,n=s.width-this._vcSize-this._vcMarginRight,r=this._vcMarginTop;return i>=n&&i<=n+this._vcSize&&o>=r&&o<=r+this._vcSize}_handleViewCubeClick(t){if(!this._isOverViewCube(t.clientX,t.clientY))return!1;const e=this._canvas.getBoundingClientRect(),s=t.clientX-e.left,i=t.clientY-e.top,o=e.width-this._vcSize-this._vcMarginRight,n=this._vcMarginTop,r=(s-o)/this._vcSize*2-1,l=-((i-n)/this._vcSize*2-1);this._vcRaycaster.setFromCamera(new K(r,l),this._vcCamera);const c=this._vcRaycaster.intersectObjects(this._vcClickTargets);if(c.length===0)return!0;const d=U(c[0].object,"vcDirIdx"),p=mo[d],f=new h().subVectors(this.freeCamera.position,this.orbitControls.target).normalize();return this._snapDist=this.freeCamera.position.distanceTo(this.orbitControls.target),this._snapQ1.setFromUnitVectors(new h(0,0,1),f),this._snapQ2.setFromUnitVectors(new h(0,0,1),p),this._snapStartTime=performance.now(),this._snapAnimating=!0,!0}_flushGizmoToStoreLive(){this._skipNextSync=!0;const t=this._authoring(),e=(i,o)=>{i&&Ce(t,i,{position:o.position.toArray(),rotation:o.quaternion.toArray(),scale:o.scale.toArray()})},s=this._activeGizmo.object;s&&s!==this._pivotDummy&&e(this._attachedAuthoringId??this._authoringIdForObject(s),s);for(const{id:i,obj:o}of this._otherDragObjects)e(i,o);for(const{id:i,obj:o}of this._allDragObjects)e(i,o);for(const{id:i,obj:o}of this._preservedChildObjects)e(i,o)}_preparePreservedChildren(t){if(!this._store.preserveChildrenTransform)return[];const e=this._authoring(),s=new Set(t),i=new Map;for(const o of s){const n=this._preservedChildrenForParent(e,o,s,i);if(typeof n=="string")return F(n),[];for(const r of n)i.set(r.id,r)}return[...i.values()]}_preservedChildrenForParent(t,e,s,i){const o=[];for(const n of t.hierarchy.node(e)?.childIds??[]){if(s.has(n)||i.has(n))continue;const r=this._objectForAuthoringId(n);if(!r?.parent)continue;const l=this._unwritableTransformChannel(t,n);if(l){const c=t.hierarchy.node(n)?.label??n;return`Preserve Children Transform needs writable ${l} on ${c}. The parent will transform normally.`}r.updateWorldMatrix(!0,!1),o.push({id:n,obj:r,worldMatrix:r.matrixWorld.clone()})}return o}_unwritableTransformChannel(t,e){return["position","rotation","scale"].find(s=>!(t.transforms?.editability?.(e,s).writable??!1))}_restorePreservedChildren(){const t=new fe;for(const e of this._preservedChildObjects){const s=e.obj.parent;s&&(s.updateWorldMatrix(!0,!1),t.copy(s.matrixWorld).invert().multiply(e.worldMatrix),t.decompose(e.obj.position,e.obj.quaternion,e.obj.scale),e.obj.updateMatrix(),e.obj.updateWorldMatrix(!1,!0))}}_belongsToRoots(t,e){let s=t;for(;s;){if(e.has(s))return!0;s=s.parent}return!1}_floorSnapPosition(t,e){t.updateWorldMatrix(!0,!0);const s=Rt(t);if(s.isEmpty())return null;const i=Math.min((s.max.x-s.min.x)*.1,.05),o=Math.min((s.max.z-s.min.z)*.1,.05),n=[[(s.min.x+s.max.x)/2,(s.min.z+s.max.z)/2],[s.min.x+i,s.min.z+o],[s.max.x-i,s.min.z+o],[s.min.x+i,s.max.z-o],[s.max.x-i,s.max.z-o]],r=new et;r.layers.enableAll();const l=s.min.y+Math.max((s.max.y-s.min.y)*.001,.001);let c=Number.NEGATIVE_INFINITY;for(const[f,u]of n){r.set(new h(f,l,u),new h(0,-1,0));const _=r.intersectObjects(this._scene.children,!0).find(g=>!this._belongsToRoots(g.object,e)&&!tt(g.object)&&g.point.y<=l);_&&(c=Math.max(c,_.point.y))}if(!Number.isFinite(c))return null;const d=c-s.min.y;if(Math.abs(d)<1e-6)return null;const p=t.getWorldPosition(new h);return p.y+=d,t.parent?(t.parent.updateWorldMatrix(!0,!1),t.parent.worldToLocal(p)):p}snapSelectionToFloor(){const t=this._authoring(),e=t.transforms;if(!e){F("This document does not expose writable transforms.");return}const s=[...this._store.selectedEntityIds].map(l=>({id:l,obj:this._objectForAuthoringId(l)})).filter(l=>!!l.obj&&(e.editability?.(l.id,"position").writable??!0)),i=new Set(s.map(({obj:l})=>l)),o=s.filter(({obj:l})=>{let c=l.parent;for(;c;){if(i.has(c))return!1;c=c.parent}return!0});if(o.length===0){F("Select an object with a writable position first.");return}const n=new Set(o.map(({obj:l})=>l)),r=[];for(const l of o){const c=this._floorSnapPosition(l.obj,n);c&&r.push({...l,position:c})}if(r.length===0){F("No solid scene surface was found beneath the selection.");return}for(const{id:l}of r)Se(t,l);for(const{obj:l,position:c}of r)l.position.copy(c);this._skipNextSync=!0;for(const{id:l,obj:c}of r)Ce(t,l,{position:c.position.toArray(),rotation:c.quaternion.toArray(),scale:c.scale.toArray()});for(const{id:l}of r)Me(t,l);this.syncFromStore()}_applySurfaceSnap(t,e){const s=new Set,i=this._attachedAuthoringId??this._authoringIdForObject(t);i&&s.add(i);for(const{id:c}of e)s.add(c);const o=[];for(const[c,d]of this._objectMap)s.has(c)||o.push(d);if(o.push(this.grid),o.length===0){this._surfaceSnapIndicator.visible=!1;return}const n=t.position.clone();n.y+=50,this._surfaceSnapRaycaster.set(n,new h(0,-1,0)),this._surfaceSnapRaycaster.far=200;const l=this._surfaceSnapRaycaster.intersectObjects(o,!0).find(c=>c.object===this.grid||!tt(c.object));if(l){const c=l.point,d=c.y,p=d-t.position.y;t.position.y=d;for(const{obj:u}of e)u.position.y+=p;this._surfaceSnapIndicator.position.copy(c),this._surfaceSnapIndicator.position.y+=.01;const f=l.face?.normal;if(f){const u=f.clone().transformDirection(l.object.matrixWorld);this._surfaceSnapIndicator.quaternion.setFromUnitVectors(new h(0,1,0),u)}this._surfaceSnapIndicator.visible=!0}else this._surfaceSnapIndicator.visible=!1}_collectVertices(t){const e=[];for(const[i,o]of this._objectMap)t.has(i)||o.traverse(n=>{if(tt(n))return;const r=n;if(!r.isMesh||!r.geometry)return;const l=r.geometry.getAttribute("position");if(!l)return;const c=Math.min(l.count,1e3),d=r.matrixWorld;for(let p=0;p<c;p++){const f=new h(l.getX(p),l.getY(p),l.getZ(p));f.applyMatrix4(d),e.push(f)}});return e}_applyVertexSnap(t,e){const s=t.position,i=s.clone().project(this.renderCamera),o=this._canvas.getBoundingClientRect(),n=(i.x+1)/2*o.width,r=(-i.y+1)/2*o.height;let l=this._vertexSnapThreshold,c=null;for(const d of this._vertexSnapTargets){const p=d.clone().project(this.renderCamera);if(p.z>1)continue;const f=(p.x+1)/2*o.width,u=(-p.y+1)/2*o.height,_=n-f,g=r-u,y=Math.sqrt(_*_+g*g);y<l&&(l=y,c=d)}if(c){const d=c.clone().sub(s);t.position.copy(c);for(const{obj:f}of e)f.position.add(d);this._vertexSnapIndicator.position.copy(c),this._vertexSnapIndicator.visible=!0;const p=c.distanceTo(this.renderCamera.position);this._vertexSnapIndicator.scale.setScalar(p*.008)}else this._vertexSnapIndicator.visible=!1}_flushGizmoToStore(){this._flushGizmoToStoreLive();const t=this._activeTransformEditIds;this._activeTransformEditIds=[],this._otherDragObjects=[],this._allDragObjects=[],this._preservedChildObjects=[];const e=this._authoring();for(const s of t)Me(e,s)}consumeSkipSync(){return this._skipNextSync?(this._skipNextSync=!1,!0):!1}_applyGizmoSize(){if(this.transformControls===void 0)return;const t=this._lookGizmoSizePx,e=Math.max(1,this._canvas.clientHeight),s=t===null?null:2*t,i=s===null?1:this.freeCamera instanceof Nt?4*s/e:s/(.2375*e);for(const o of this._allGizmos())o.size=i}_dropNegativeAxisHandles(t,e){const s=t.children.find(o=>o.isTransformControlsGizmo);if(!s)return;const i={X:new h(1,0,0),Y:new h(0,1,0),Z:new h(0,0,1)};for(const o of e)for(const n of[s.gizmo[o],s.picker[o]])if(n)for(const r of[...n.children]){const l=i[r.name];if(l===void 0)continue;const c=r;if(!c.geometry)continue;c.geometry.computeBoundingBox();const d=c.geometry.boundingBox;d&&d.getCenter(new h).dot(l)<0&&n.remove(r)}}_axisColorMap(){const t=o=>new x(...J[this._lookAxisFrame[o][0]]),e=t(0),s=t(1),i=t(2);return{X:e,Y:s,Z:i,XY:i,YZ:e,XZ:s}}_readLookStage(t){this._lookAxisFrame=ve(t)==="z"?Ue:le,this._lookBoxSelect=be(t),this._applyGizmoAxisFrame(),this._buildOrientationGizmo()}_applyGizmoAxisFrame(){if(this.transformControls===void 0)return;const t=this._lookAxisFrame.map(([,r])=>r),e=[0,1,2].map(r=>t[r]===this._appliedAxisSigns[r]?1:-1),s=e.some(r=>r===-1),i=this._axisColorMap(),o={X:new x(...J[0]),Y:new x(...J[1]),Z:new x(...J[2]),XY:new x(...J[2]),YZ:new x(...J[0]),XZ:new x(...J[1])},n=(r,l,c,d=!1)=>{r&&r.traverse(p=>{const f=p;c&&f.geometry&&f.geometry.scale(e[0],e[1],e[2]),d&&f.material&&!Array.isArray(f.material)&&!f.userData.vgaiOwnMaterial&&(f.material=f.material.clone(),f.userData.vgaiOwnMaterial=!0);const u=f.material;if(!u||Array.isArray(u))return;c&&(u.side=Bt);const _=l[p.name];_&&u.color&&(u.color.copy(_),u._color=void 0)})};for(const r of this._allGizmos()){const l=r.getHelper().children.find(c=>c.isTransformControlsGizmo);if(l)for(const c of["gizmo","picker","helper"])n(l[c]?.translate,i,s),n(l[c]?.rotate,i,!1),n(l[c]?.scale,o,!1,!0)}s&&(this._appliedAxisSigns=t)}_patchGizmo(t){const e=this._axisColorMap(),s={XY:[-.075,-.075,0],YZ:[0,-.075,-.075],XZ:[-.075,0,-.075]};t.traverse(i=>{const o=i,n=e[i.name];if(n&&o.material){const l=o.material;l.color&&l.color.copy(n)}const r=s[i.name];r&&o.geometry&&o.geometry.translate(r[0],r[1],r[2])})}_patchCombinedScaleGizmo(t){const s=t.children.find(r=>r.isTransformControlsGizmo);if(!s)return;const i={X:new h(1,0,0),Y:new h(0,1,0),Z:new h(0,0,1)},o=.54+.55,n=.3;for(const[r,l]of[[s.gizmo.scale,!1],[s.picker.scale,!0]])if(r)for(const c of[...r.children]){const d=c,p=i[c.name],f=p!==void 0&&d.geometry?.type==="CylinderGeometry"&&d.geometry.parameters.radiusTop<.05;if(p===void 0||f){r.remove(c);continue}d.geometry.computeBoundingBox();const u=d.geometry.boundingBox;if(!u)continue;const _=Math.sign(u.getCenter(new h).dot(p))||1;if(l){const y=p.clone().multiplyScalar(_*o);d.geometry.dispose(),d.geometry=new E(n,n,n).translate(y.x,y.y,y.z);continue}const g=p.clone().multiplyScalar(_*.55);d.geometry.translate(g.x,g.y,g.z)}}_projectToScreen(t){const e=new h;t.getWorldPosition(e),e.project(this.renderCamera);const s=this._canvas.getBoundingClientRect();return new K((e.x+1)/2*s.width+s.left,(-e.y+1)/2*s.height+s.top)}static _FLY_KEYS=new Set(["w","a","s","d","q","e"]);_enterFlyMode(){this._flyActive||this._cameraViewMode!=="view"&&(this._flyActive=!0,this._snapAnimating=!1,this.orbitControls.enabled=!1,this._flyEuler.setFromQuaternion(this.renderCamera.quaternion,"YXZ"),this.orbitControls.dispatchEvent({type:"start"}),this._canvas.requestPointerLock?.())}_exitFlyMode(){if(!this._flyActive)return;this._flyActive=!1,this._flyKeys.clear(),this.orbitControls.enabled=this._cameraViewMode!=="view",document.exitPointerLock();const t=this.renderCamera,e=new h(0,0,-1).applyQuaternion(t.quaternion),s=t.position.distanceTo(this.orbitControls.target);this.orbitControls.target.copy(t.position).add(e.multiplyScalar(Math.max(s,5))),this.orbitControls.dispatchEvent({type:"end"})}_updateFlyCamera(t){if(!this._flyActive||this._flyKeys.size===0)return;const e=this.renderCamera,s=this._flySpeed*(this._flyKeys.has("shift")?3:1),i=new h(0,0,-1).applyQuaternion(e.quaternion),o=new h(1,0,0).applyQuaternion(e.quaternion),n=new h;this._flyKeys.has("w")&&n.add(i),this._flyKeys.has("s")&&n.sub(i),this._flyKeys.has("d")&&n.add(o),this._flyKeys.has("a")&&n.sub(o),this._flyKeys.has("e")&&(n.y+=1),this._flyKeys.has("q")&&(n.y-=1),n.lengthSq()>0&&(n.normalize().multiplyScalar(s*t),e.position.add(n),this.orbitControls.dispatchEvent({type:"change"}))}_onFlyKeyDown=t=>{if(!this._rightMouseDown||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement)return;const e=t.key.toLowerCase();if(e==="shift"){this._flyKeys.add("shift");return}ms._FLY_KEYS.has(e)&&(t.preventDefault(),t.stopPropagation(),this._flyKeys.add(e),this._flyActive||this._enterFlyMode())};_onFlyKeyUp=t=>{const e=t.key.toLowerCase();if(e==="shift"){this._flyKeys.delete("shift");return}this._flyKeys.delete(e)};_onFlyPointerDown=t=>{t.button===2&&(this._rightMouseDown=!0)};_onFlyPointerUp=t=>{t.button===2&&(this._rightMouseDown=!1,this._flyActive&&this._exitFlyMode())};_onFlyPointerMove=t=>{if(!this._flyActive)return;const e=.002;this._flyEuler.y-=t.movementX*e,this._flyEuler.x-=t.movementY*e,this._flyEuler.x=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,this._flyEuler.x)),this.renderCamera.quaternion.setFromEuler(this._flyEuler),this.orbitControls.dispatchEvent({type:"change"})};_onTrackpadWheel=t=>{if(this._flyActive||!this.orbitControls.enabled||t.ctrlKey||Math.abs(t.deltaX)<.5&&!t.shiftKey)return;t.preventDefault(),t.stopImmediatePropagation();const e=this._interactionElement.clientHeight||1,s=this.camera.position.distanceTo(this.orbitControls.target),i=2*Math.tan(this.camera.fov/2*Math.PI/180)*s/e,o=t.deltaMode===1?16:1,n=d=>Math.sign(d)*Math.min(Math.abs(d*o),30),r=new h().setFromMatrixColumn(this.camera.matrix,0),l=new h().setFromMatrixColumn(this.camera.matrix,1),c=r.multiplyScalar(n(t.deltaX)*i).add(l.multiplyScalar(-n(t.deltaY)*i));this.camera.position.add(c),this.orbitControls.target.add(c),this.orbitControls.update()};_onFlyWheel=t=>{if(!this._flyActive)return;t.preventDefault();const e=t.deltaY>0?.85:1.18;this._flySpeed=Math.max(.5,Math.min(100,this._flySpeed*e))};_onPointerDown=t=>{if(this._pointerDownPos.set(t.clientX,t.clientY),this._pointerDownButton=t.button,this._marqueeActive=!1,this._pointerSessionActive=!0,this._constraintControlPointerSession=!1,t.button===0&&!t.altKey){if(this._selectConstraintControlAt(t))return;const e=this._raycastSpatialHandle(t),s=e?Ve(e):null;if(e&&s?.handle.writable){t.stopPropagation(),this._activeSpatialHandle=s,this._spatialHandleDragPoint.copy(e.position),this._orbitEnabledBeforeHandleDrag=this.orbitControls.enabled,this._transformEnabledBeforeHandleDrag=this.transformControls.enabled,this.orbitControls.enabled=!1;for(const n of this._allGizmos())n.enabled=!1;const i=this.renderCamera.getWorldDirection(new h);this._spatialHandleDragPlane.setFromNormalAndCoplanarPoint(i,e.position),this._spatialHandleDragOffset.set(0,0,0);const o=this._spatialHandleWorldPoint(t);o&&this._spatialHandleDragOffset.subVectors(e.position,o),this._canvas.style.cursor="grabbing"}}};_onPointerMove=t=>{if(this._updateEditorHandleInteraction(t)||(this._updateSpatialHandleHover(t),!this._pointerSessionActive)||!(t.buttons&1)||this._pointerDownButton!==0||this._anyGizmoDragging()||this._altDragOrbit)return;const e=t.clientX-this._pointerDownPos.x,s=t.clientY-this._pointerDownPos.y;if(!this._marqueeActive&&Math.sqrt(e*e+s*s)>5){const i=this._canvas.getBoundingClientRect(),o=this._pointerDownPos.x-i.left,n=this._pointerDownPos.y-i.top,r=i.width-this._vcSize-this._vcMarginRight;if(o>=r&&o<=r+this._vcSize&&n>=this._vcMarginTop&&n<=this._vcMarginTop+this._vcSize)return;this._marqueeActive=!0,this.orbitControls.enabled=!1,this._marqueeDiv||(this._marqueeDiv=document.createElement("div"),Object.assign(this._marqueeDiv.style,{position:"fixed",border:`1px solid ${Et.accent.default}`,background:Et.accent.muted,pointerEvents:"none",zIndex:He.sticky}),(document.getElementById("editor-chrome-root")??document.body).appendChild(this._marqueeDiv))}if(this._marqueeActive&&this._marqueeDiv){const i=Math.min(this._pointerDownPos.x,t.clientX),o=Math.min(this._pointerDownPos.y,t.clientY),n=Math.abs(t.clientX-this._pointerDownPos.x),r=Math.abs(t.clientY-this._pointerDownPos.y);Object.assign(this._marqueeDiv.style,{left:`${i}px`,top:`${o}px`,width:`${n}px`,height:`${r}px`,display:"block"})}};_onPointerUp=t=>{if(!this._pointerSessionActive)return;if(this._pointerSessionActive=!1,this._activeSpatialHandle){this._finishSpatialHandleDrag(!0);return}if(this._constraintControlPointerSession){this._constraintControlPointerSession=!1;return}if(this._marqueeActive){this._marqueeActive=!1,this.orbitControls.enabled=!0,this._marqueeDiv&&(this._marqueeDiv.style.display="none");const n=Math.min(this._pointerDownPos.x,t.clientX),r=Math.max(this._pointerDownPos.x,t.clientX),l=Math.min(this._pointerDownPos.y,t.clientY),c=Math.max(this._pointerDownPos.y,t.clientY),d=[],p=new h,f=new ft;for(const[u,_]of this._objectMap){if(!_.visible||_.isCamera===!0)continue;if(f.setFromObject(_),f.isEmpty()){const C=this._projectToScreen(_);C.x>=n&&C.x<=r&&C.y>=l&&C.y<=c&&d.push(u);continue}const g=this._lookBoxSelect==="touch",y=this._canvas.getBoundingClientRect();let v=!0,w=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(let C=0;C<8;C++){if(p.set(C&1?f.max.x:f.min.x,C&2?f.max.y:f.min.y,C&4?f.max.z:f.min.z),p.project(this.camera),p.z<-1||p.z>1){if(v=!1,!g)break;continue}const A=y.left+(p.x+1)*y.width/2,I=y.top+(1-p.y)*y.height/2;(A<n||A>r||I<l||I>c)&&(v=!1),w=Math.min(w,A),b=Math.max(b,A),L=Math.min(L,I),R=Math.max(R,I)}const S=w<=b&&b>=n&&w<=r&&R>=l&&L<=c;(g?S:v)&&d.push(u)}if(t.shiftKey)for(const u of d)this._store.addToSelection(u);else Pt(this._authoring(),d);return}if(t.button!==0)return;const e=t.clientX-this._pointerDownPos.x,s=t.clientY-this._pointerDownPos.y;if(Math.sqrt(e*e+s*s)>5||this._anyGizmoDragging()||this._threejsToolContextActive&&this._handleViewCubeClick(t))return;const i=t.shiftKey&&(t.metaKey||t.ctrlKey),o=Os(this._scopeAuthoring(),()=>this._pickAt(t.clientX,t.clientY,i?"deep":"normal"));i?Pt(this._authoring(),o?[o]:[]):t.shiftKey&&o?this._store.toggleSelection(o):(t.metaKey||t.ctrlKey)&&o?this._store.toggleSelection(o):Pt(this._authoring(),o?[o]:[])};_scopeAuthoring(){return this._standaloneAuthoring?this._authoring():Mt().panelAuthoring(this._store)}_pickAt(t,e,s){return this._pick?this._pick(t,e):Mt().pick(this._store,t,e,s)}_onDoubleClick=t=>{if(t.button!==0||this._anyGizmoDragging()||this._marqueeActive||this._threejsToolContextActive&&this._isOverViewCube(t.clientX,t.clientY))return;const e=this._pickAt(t.clientX,t.clientY,"normal");e&&Ds(this._scopeAuthoring(),e,()=>this._pickAt(t.clientX,t.clientY,"normal"))};_raycastGroundPlane(t){const e=this._canvas.getBoundingClientRect(),s=new K((t.clientX-e.left)/e.width*2-1,-((t.clientY-e.top)/e.height)*2+1);this.raycaster.setFromCamera(s,this.renderCamera);const i=Pe("three");this._groundPlane.set(i.up==="z"?uo:po,-i.groundHeight);const o=new h;return this.raycaster.ray.intersectPlane(this._groundPlane,o)}_showDropOverlay(){if(this._dropOverlay)return;const t=document.createElement("div");Object.assign(t.style,{position:"fixed",inset:"0",pointerEvents:"none",border:`2px dashed ${Et.accent.default}`,background:Et.accent.muted,zIndex:He.base}),(document.getElementById("editor-chrome-root")??document.body).appendChild(t),this._dropOverlay=t}_hideDropOverlay(){this._dropOverlay&&(this._dropOverlay.remove(),this._dropOverlay=null)}_onDragOver=t=>{t.dataTransfer?.types.includes("application/x-editor-asset")&&(t.preventDefault(),t.dataTransfer.dropEffect="copy",this._showDropOverlay())};_onDragLeave=t=>{this._hideDropOverlay()};_onDrop=t=>{this._hideDropOverlay();const e=t.dataTransfer?.getData("application/x-editor-asset");if(!e)return;t.preventDefault();let s;try{s=JSON.parse(e)}catch{return}const i=Pe("three"),o=this._raycastGroundPlane(t),n=p=>Math.round(p*100)/100,r=i.up==="z"?[n(o?.x??0),n(o?.y??0),i.groundHeight]:[n(o?.x??0),i.groundHeight,n(o?.z??0)],l=this._authoring(),c=l.assetDrop,d=s.component??{kind:"file",name:s.name};if(!c){At.warn(`Dropped “${s.name}” was not placed: this document does not accept dropped assets.`,"editor");return}if(s.online){const p=s.online,f=this._onlineAssetResolver;if(!f){At.warn(`Dropped “${s.name}” was not placed: this viewport has no online-asset resolver installed.`,"editor");return}F(`Downloading ${p.name} from the library…`),f(p).then(u=>{u?(F(`${p.name} downloaded — placing it.`),Ae(l,"",u,{position:r})):F(`Could not download ${p.name} — see the Console.`)}).catch(()=>{F(`Could not download ${p.name} — see the Console.`),At.error(`Could not download ${p.name}.`,"asset")});return}Ae(l,"",s.path,{position:r,item:d})}}const Ko=a=>!ks(a);export{Uo as C,ms as E,qo as a,Qo as b,No as c,Ko as i,Qe as o,se as p,Zo as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C,aB as F,aC as z}from"./three.module-D396a9Mn.js";class w extends Error{constructor(o){super(o),this.name="VoxelSurfaceError"}}const b=[{normal:[1,0,0],corners:[[1,0,1],[1,0,0],[1,1,0],[1,1,1]]},{normal:[-1,0,0],corners:[[0,0,0],[0,0,1],[0,1,1],[0,1,0]]},{normal:[0,1,0],corners:[[0,1,1],[1,1,1],[1,1,0],[0,1,0]]},{normal:[0,-1,0],corners:[[0,0,0],[1,0,0],[1,0,1],[0,0,1]]},{normal:[0,0,1],corners:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{normal:[0,0,-1],corners:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];function Y(e,o){if(e.length%2!==0)throw new w(`a run list is [count, type] pairs, so its length must be even; got ${e.length}`);let n=0,t=0;for(let s=0;s<e.length;s+=2){const l=e[s];if(!Number.isInteger(l)||l<=0)throw new w(`run ${s/2} has a count of ${l}; counts are positive`);t+=l,n=Math.max(n,e[s+1])}if(t!==o)throw new w(`the runs cover ${t} cells; the volume holds ${o}`);const c=n>65535?new Uint32Array(o):new Uint16Array(o);let d=0;for(let s=0;s<e.length;s+=2){const l=e[s];c.fill(e[s+1],d,d+l),d+=l}return c}function E(e){const[o,n,t]=e.size;if(o<=0||n<=0||t<=0)throw new w(`a volume needs a positive size on every axis; got ${e.size}`);const c=o*n*t;if(e.cells.length!==c)throw new w(`a ${o}×${n}×${t} volume holds ${c} cells; got ${e.cells.length}`);return[o,n,t]}function U(e,o,n,t){if(e===void 0)return;const c=e.get(o);if(c===void 0)throw new w(`no colour for type ${o}, which cell ${n} holds — every solid type in the volume needs a row, so a forgotten one fails here rather than drawing white`);return t.setHex(c)}function M(e,o,n,t,c,d){const[s,l,f]=o;let g=0;for(const m of b){const[x,y,$]=m.normal;if(c(s+x,l+y,f+$))continue;const h=e.positions.length/3;for(const[u,v,A]of m.corners)e.positions.push(...d(s+u,l+v,f+A)),e.normals.push(x,y,$),t!==void 0&&e.colors.push(t.r,t.g,t.b);e.indices.push(h,h+1,h+2,h,h+2,h+3),e.quadsByType.set(n,(e.quadsByType.get(n)??0)+1),g+=1}return g}function Z(e,o={}){const[n,t,c]=E(e),d=o.emptyType??0,s=o.closedBoundary!==!0,l=e.cellSize??1,[f,g,m]=e.origin??[0,0,0],x=e.cells,y=(r,i,a)=>x[(i*c+a)*n+r],$=(r,i,a)=>r<0||i<0||a<0||r>=n||i>=t||a>=c?!s:y(r,i,a)!==d,h=(r,i,a)=>[f+r*l,g+i*l,m+a*l],u={positions:[],normals:[],colors:[],indices:[],quadsByType:new Map},v=new C;let A=0,S=0;for(let r=0;r<t;r+=1)for(let i=0;i<c;i+=1)for(let a=0;a<n;a+=1){const B=y(a,r,i);if(B===d)continue;A+=1;const T=U(o.colors,B,`(${a}, ${r}, ${i})`,v);S+=M(u,[a,r,i],B,T,$,h)}const p=new F;p.setAttribute("position",new z(new Float32Array(u.positions),3)),p.setAttribute("normal",new z(new Float32Array(u.normals),3)),o.colors!==void 0&&p.setAttribute("color",new z(new Float32Array(u.colors),3));const V=u.positions.length/3,q=V>65535?new Uint32Array(u.indices):new Uint16Array(u.indices);return p.setIndex(new z(q,1)),p.computeBoundingSphere(),p.computeBoundingBox(),{geometry:p,quads:S,vertices:V,triangles:S*2,solidCells:A,quadsByType:new Map([...u.quadsByType].sort(([r],[i])=>r-i))}}export{w as VoxelSurfaceError,Z as buildVoxelSurface,Y as expandVoxelRuns};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ah as k,c3 as W,c4 as Y,ag as j,c5 as z,aG as K,R as J,aO as V,N as X,c6 as Z,Y as q,c7 as Q,K as ee,Z as te,ai as re,c8 as ne,aS as ae,c9 as se,ca as oe,a7 as ie}from"./three.module-D396a9Mn.js";function ue(e,r){if(e||!r||typeof r!="object")return null;const o=r;return typeof o.getExtension!="function"||typeof o.drawArrays!="function"||typeof o.drawElements!="function"?null:r}function ce(e){const r=e;return!!(r.isMesh||r.isSkinnedMesh||r.isPoints||r.isLine||r.isSprite)}function le(e){const r=e,o=r.geometry,c=r.material,s=Array.isArray(c)?c[0]:c,u=e.userData?.entityId;return{object:{name:e.name||e.type,type:e.type,...u!==void 0?{entityId:String(u)}:{}},geometry:{type:o?.type??"unknown",name:o?.name??"",attributes:o?Object.keys(o.attributes):[],indexed:!!o?.index},material:{type:s?.type??"unknown",name:s?.name??""}}}function de(e){const{capture:r,scene:o,memory:c}=e,s=e.timeoutMs??5e3,u=e.setTimeoutFn??((a,f)=>setTimeout(a,f)),l=e.clearTimeoutFn??(a=>clearTimeout(a));let y=null;function F(){const a=[];return o&&o.traverse(f=>{if(!ce(f))return;const R=f.onBeforeRender;f.onBeforeRender=function(...T){r.annotateNextDraw(le(f)),R.apply(this,T)},a.push(()=>{f.onBeforeRender=R})}),a}function E(){const a=y;if(a&&!a.settled){a.settled=!0,l(a.timer);for(const f of a.restores)f();return y=null,a}return null}return{adapter:{captureFrame(){return y?Promise.reject(new Error("RenderDebugAdapter: a frame capture is already pending")):new Promise((a,f)=>{const R=F();r.arm();const b={resolve:a,reject:f,restores:R,timer:null,settled:!1};y=b,b.timer=u(()=>{E()&&f(new Error(`RenderDebugAdapter: no frame rendered within ${s}ms — the world may be paused or stopped`))},s)})},...c?{memorySnapshot:()=>c()}:{}},beforeRender(){r.beginPass()},afterRender(){const a=r.endPass();a&&y&&E()?.resolve(a)},dispose(){const a=E();a&&a.reject(new Error("RenderDebugAdapter: disposed before a frame was captured"))}}}const _e=Object.freeze(Object.defineProperty({__proto__:null,createRenderDebugAdapter:de,frameCaptureContextFor:ue},Symbol.toStringTag,{value:"Module"})),S=10,fe={[Q]:1,[q]:1,[Z]:1,[X]:2,[V]:2,[J]:4,[K]:4,[z]:1,[j]:2},me={[ie]:1,[oe]:1,[se]:2,[ae]:2,[ne]:4,[re]:4,[te]:4,[ee]:2},pe={[Y]:2,[W]:2,[k]:4};function ye(e,r){const o=pe[r];if(o!==void 0)return o;const c=fe[e],s=me[r];return c===void 0||s===void 0?null:c*s}function D(e){const r=new Set;let o=0;const c=s=>{s&&!r.has(s)&&(r.add(s),o+=s.byteLength)};for(const s of Object.values(e.attributes)){const u=s.data?.array;c(u??s.array)}return c(e.index?.array),o}function L(e){const r=e;if(r.isCompressedTexture&&Array.isArray(r.mipmaps)){let y=0;for(const F of r.mipmaps){const E=F.data;E?.byteLength&&(y+=E.byteLength)}return y}const o=e.image,c=o?.width,s=o?.height;if(!c||!s)return null;const u=ye(e.format,e.type);if(u===null)return null;const l=c*s*u;return e.generateMipmaps?Math.round(l*1.333):l}function M(e){return e.name||e.image?.src||`texture:${e.uuid}`}function Ee(e){return e.name||`${e.type}:${e.uuid}`}function Re(e){const r=e.image;return!r?.width||!r?.height?"no image dimensions available":`unsupported format/type (format 0x${e.format.toString(16)}, type 0x${e.type.toString(16)})`}function Te(e){const r=new Map,o=new Map,c=s=>{for(const u of Object.values(s))if(u&&u.isTexture){const l=u;o.set(l.uuid,l)}};e.traverse(s=>{const u=s.geometry;u?.isBufferGeometry&&r.set(u.uuid,u);const l=s.material;Array.isArray(l)?l.forEach(c):l&&c(l)});for(const s of[e])for(const u of[s.background,s.environment])if(u&&u.isTexture){const l=u;o.set(l.uuid,l)}return{geometries:r,textures:o}}function Fe(e,r){const{geometries:o,textures:c}=Te(e),s=[];let u=0;for(const p of o.values()){const a=D(p);u+=a,s.push({name:Ee(p),bytes:a})}const l=[],y=[];let F=0;for(const p of c.values()){const a=L(p);if(a===null){y.push({name:M(p),reason:Re(p)});continue}F+=a,l.push({name:M(p),bytes:a})}const E=(p,a)=>a.bytes-p.bytes;return{counts:{geometries:r.memory.geometries,textures:r.memory.textures,programs:r.programs?r.programs.length:null},estimatedTextureBytes:F,estimatedGeometryBytes:u,topTextures:l.sort(E).slice(0,S),topGeometries:s.sort(E).slice(0,S),unestimated:y}}const Pe=Object.freeze(Object.defineProperty({__proto__:null,collectRenderMemory:Fe,estimateGeometryBytes:D,estimateTextureBytes:L},Symbol.toStringTag,{value:"Module"})),be=5e3;function he(e){return new Map([[e.POINTS,"POINTS"],[e.LINES,"LINES"],[e.LINE_LOOP,"LINE_LOOP"],[e.LINE_STRIP,"LINE_STRIP"],[e.TRIANGLES,"TRIANGLES"],[e.TRIANGLE_STRIP,"TRIANGLE_STRIP"],[e.TRIANGLE_FAN,"TRIANGLE_FAN"]])}function Ae(e,r={}){const o=r.now??(()=>Date.now()),c=r.maxDrawCalls??be,s=he(e),u=new Map,l=new Map;let y=0,F=0,E=0,p=null,a=null,f=[0,0,0,0],R=!1,b=!1,T=[],w=0,N=[],A=null;const B=new Map,I=new Set;function O(t){return s.get(t)??`0x${t.toString(16)}`}function U(t){if(!t)return null;let n=u.get(t);return n===void 0&&(n=`program#${y++}`,u.set(t,n)),n}function v(){try{if(e.getFramebufferAttachmentParameter(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)===e.RENDERBUFFER){const n=e.getFramebufferAttachmentParameter(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);if(!n)return{width:null,height:null};const i=e.getParameter(e.RENDERBUFFER_BINDING);e.bindRenderbuffer(e.RENDERBUFFER,n);const d=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_WIDTH),m=e.getRenderbufferParameter(e.RENDERBUFFER,e.RENDERBUFFER_HEIGHT);return e.bindRenderbuffer(e.RENDERBUFFER,i),{width:d,height:m}}}catch{}return{width:null,height:null}}function C(){if(!a)return{kind:"canvas"};let t=l.get(a);t===void 0&&(t=`framebuffer#${F++}`,l.set(a,t));const{width:n,height:i}=v();return{kind:"framebuffer",width:n,height:i,label:t}}function x(){return e.getParameter(e.CULL_FACE)?e.getParameter(e.CULL_FACE_MODE)===e.FRONT?"front":"back":"none"}function _(t,n,i,d){if(T.length>=c){w++,A=null;return}const m=A;A=null,T.push({index:T.length,entryPoint:t,mode:O(n),count:i,instanceCount:d,programLabel:U(p),target:C(),viewport:[...f],state:{blend:!!e.getParameter(e.BLEND),depthTest:!!e.getParameter(e.DEPTH_TEST),depthWrite:!!e.getParameter(e.DEPTH_WRITEMASK),cull:x(),scissor:!!e.getParameter(e.SCISSOR_TEST)},annotation:m??null})}const P=e;function h(t,n){const i=P[t];B.set(t,i),Object.hasOwn(e,t)&&I.add(t),P[t]=n(i.bind(e))}function G(){for(const[t,n]of B)I.has(t)?P[t]=n:delete P[t];B.clear(),I.clear()}function H(){try{const t=e.getParameter(e.VIEWPORT);t&&t.length>=4&&(f=[t[0],t[1],t[2],t[3]]),a=e.getParameter(e.FRAMEBUFFER_BINDING),p=e.getParameter(e.CURRENT_PROGRAM)}catch{}h("useProgram",t=>n=>(p=n??null,t(n))),h("bindFramebuffer",t=>(n,i)=>((n===e.FRAMEBUFFER||n===e.DRAW_FRAMEBUFFER)&&(a=i??null),t(n,i))),h("viewport",t=>(n,i,d,m)=>(f=[n,i,d,m],t(n,i,d,m))),h("drawArrays",t=>(n,i,d)=>(_("drawArrays",n,d,null),t(n,i,d))),h("drawElements",t=>(n,i,d,m)=>(_("drawElements",n,i,null),t(n,i,d,m))),h("drawArraysInstanced",t=>(n,i,d,m)=>(_("drawArraysInstanced",n,d,m),t(n,i,d,m))),h("drawElementsInstanced",t=>(n,i,d,m,g)=>(_("drawElementsInstanced",n,i,g),t(n,i,d,m,g))),h("drawRangeElements",t=>(n,i,d,m,g,$)=>(_("drawRangeElements",n,m,null),t(n,i,d,m,g,$)))}return{arm(){R=!0},get armed(){return R},beginPass(){!R||b||(b=!0,T=[],w=0,N=[],A=null,H())},endPass(){if(!b)return R=!1,null;try{w>0&&N.push(`Draw list capped at ${c}; ${w} later draw(s) were not recorded.`);const t=T.reduce((n,i)=>n+(i.annotation===null?1:0),0);return{id:++E,capturedAt:o(),drawCalls:T.slice(),totals:{drawCalls:T.length,unattributed:t,truncated:w},notes:N.slice()}}finally{G(),b=!1,R=!1,A=null}},annotateNextDraw(t){A=t}}}const ge=Object.freeze(Object.defineProperty({__proto__:null,createWebGLFrameCapture:Ae},Symbol.toStringTag,{value:"Module"}));export{de as a,Fe as b,Ae as c,Pe as d,ue as f,_e as r,ge as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gy as t,th as i,ti as r,tj as m}from"./index-GIL7oGEO.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";t.add(i,r);t.add(m);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{bt as N,bA as G,ei as T,aY as et,gk as I,bz as ot,f6 as nt,a4 as O,f8 as D,a5 as M,fb as st,fc as at,fa as rt,em as it,gl as lt,eR as ct,d8 as j,gm as F,gn as dt,d7 as z,e2 as ut,d9 as V,e1 as U,di as pt,aU as ht,go as mt,aS as ft,gp as bt,gq as xt,gr as gt,gs as vt,gt as wt,gu as yt,f3 as St,gv as kt,aG as Rt,gw as H,gx as Ct,fm as Et}from"./index-GIL7oGEO.js";import{r as p}from"./index-nmcBqr7Y.js";import{d as It,m as jt}from"./design-time-layers-wYgOTgni.js";import{I as zt}from"./edit-mode-authoring-B47TfLqu.js";import{i as At,a as Dt,C as L,b as Mt,c as Bt}from"./CanvasSceneViewport-Bpi6gVTC.js";import{a as Tt,g as $t,e as Ft,f as Vt,h as _t,s as Z,i as Pt,t as Nt,R as P,j as Gt}from"./react-story-board-BDDwiE2H.js";import{s as Wt,c as Ot,a as Ut,b as Ht}from"./component-board-registry-DrIa2csL.js";import{e as Lt,S as Zt}from"./surface-state-DaxyruCj.js";import"./index-CtzuWnCS.js";import{c as Yt,d as Xt,r as Y,e as X,f as qt,m as q,b as Kt,a as Jt,s as Qt}from"./board-guides-DziKSTss.js";import{R as te}from"./RootSelectionOverlay-BZPlxmXU.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./three.module-D396a9Mn.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./TransientHint-BB1fwrvK.js";import"./eyedropper-session-bjPXnfeX.js";import"./viewport-pick-context-DkawXbEi.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";const y=16,_="rgba(255, 82, 82, 0.9)",K="rgba(18, 22, 26, 0.92)",A="rgba(255, 255, 255, 0.28)";function ee(o){return[10,25,50,100,250,500,1e3,2500,5e3].find(i=>i*o>=60)??1e4}function J(o){return Math.abs(o)>=1e3?`${o/1e3}k`:String(o)}function oe({docId:o,containerRef:c}){const i=p.useSyncExternalStore(N,G),f=p.useSyncExternalStore(Yt,()=>Xt(o)),[n,d]=p.useState(null),b=p.useRef(null);p.useEffect(()=>{const e=c.current;if(!e)return;const a=e.getBoundingClientRect();return Y(o,{originX:a.left,originY:a.top,panX:i.x,panY:i.y,zoom:i.zoom}),()=>Y(o,null)},[o,c,i.x,i.y,i.zoom]);const m=(e,a)=>Math.round((e-(a==="x"?i.x:i.y))/i.zoom),h=(e,a)=>(a==="x"?i.x:i.y)+e*i.zoom,x=e=>{const a=c.current?.getBoundingClientRect();return a?{x:e.clientX-a.left,y:e.clientY-a.top}:{x:0,y:0}},k=e=>a=>{a.preventDefault(),a.currentTarget.setPointerCapture(a.pointerId);const t=x(a);d({kind:"place",axis:e,id:null,at:e==="x"?t.x:t.y})},w=e=>a=>{a.preventDefault(),a.stopPropagation(),a.currentTarget.setPointerCapture(a.pointerId);const t=x(a);d({kind:"move",axis:e.axis,id:e.id,at:e.axis==="x"?t.x:t.y})},R=e=>{if(!n)return;const a=x(e),t=n.axis==="x"?a.x:a.y;d({...n,at:t}),n.kind==="move"&&n.id&&q(o,n.id,m(t,n.axis))},C=e=>{if(!n)return;const a=x(e),t=n.axis==="x"?a.x:a.y,l=t<=y;n.kind==="place"?l||qt(o,n.axis,m(t,n.axis)):n.id&&(l?X(o,n.id):q(o,n.id,m(t,n.axis))),d(null)},r=e=>{const a=c.current,t=a?e==="x"?a.clientWidth:a.clientHeight:0,l=ee(i.zoom),g=Math.ceil(m(y,e)/l)*l,S=m(t,e),v=[];for(let E=g;E<=S&&v.length<200;E+=l)v.push(E);return v},u={position:"absolute",background:K,zIndex:61,userSelect:"none",touchAction:"none",overflow:"hidden"};return s.jsxs("div",{ref:b,"data-testid":"board-rulers",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:60},onPointerMove:R,onPointerUp:C,children:[f.map(e=>{const a=h(e.value,e.axis),t=e.axis==="x";return s.jsx("div",{"data-testid":`board-guide-${e.axis}-${e.value}`,title:`${e.axis} = ${e.value} — drag to move, drop on the ruler or double-click to remove`,onPointerDown:w(e),onPointerMove:R,onPointerUp:C,onDoubleClick:()=>X(o,e.id),style:{position:"absolute",pointerEvents:"auto",cursor:t?"col-resize":"row-resize",zIndex:60,...t?{left:a-2,top:0,bottom:0,width:5}:{top:a-2,left:0,right:0,height:5}},children:s.jsx("div",{style:{position:"absolute",background:_,...t?{left:2,top:0,bottom:0,width:1}:{top:2,left:0,right:0,height:1}}})},e.id)}),n&&s.jsx("div",{style:{position:"absolute",background:_,zIndex:62,...n.axis==="x"?{left:n.at,top:0,bottom:0,width:1}:{top:n.at,left:0,right:0,height:1}},children:s.jsx("span",{style:{position:"absolute",...n.axis==="x"?{top:y+4,left:4}:{left:y+4,top:4},fontSize:9,fontFamily:"ui-monospace, monospace",color:_,background:K,padding:"1px 3px",borderRadius:3,whiteSpace:"nowrap"},children:m(n.at,n.axis)})}),s.jsx("div",{"data-testid":"board-ruler-top",onPointerDown:k("y"),style:{...u,top:0,left:y,right:0,height:y,cursor:"row-resize",pointerEvents:"auto"},children:r("x").map(e=>s.jsx("span",{style:{position:"absolute",left:h(e,"x"),bottom:0,borderLeft:`1px solid ${A}`,height:5},children:s.jsx("span",{style:{position:"absolute",left:2,bottom:3,fontSize:8,color:A,fontFamily:"ui-monospace, monospace"},children:J(e)})},e))}),s.jsx("div",{"data-testid":"board-ruler-left",onPointerDown:k("x"),style:{...u,top:y,left:0,bottom:0,width:y,cursor:"col-resize",pointerEvents:"auto"},children:r("y").map(e=>s.jsx("span",{style:{position:"absolute",top:h(e,"y"),right:0,borderTop:`1px solid ${A}`,width:5},children:s.jsx("span",{style:{position:"absolute",top:1,right:3,fontSize:8,color:A,fontFamily:"ui-monospace, monospace",writingMode:"vertical-rl"},children:J(e)})},e))}),s.jsx(ne,{}),s.jsx("div",{style:{...u,top:0,left:0,width:y,height:y,borderRight:`1px solid ${T.border}`,borderBottom:`1px solid ${T.border}`}})]})}function ne(){const o=p.useSyncExternalStore(Kt,Jt);return o?s.jsxs("button",{type:"button","data-testid":"board-breakpoint-pill",title:"Style edits are scoped to this breakpoint — click to return to Base",onClick:()=>Qt(null),style:{position:"absolute",top:y+8,right:12,zIndex:62,pointerEvents:"auto",background:"rgba(18, 22, 26, 0.92)",color:T.accent,border:`1px solid ${T.accent}`,borderRadius:999,fontSize:10,padding:"3px 10px",cursor:"pointer"},children:["@ ",o," · editing this breakpoint — click to clear"]}):null}const Q={fill:null,desktop:{width:1440,height:900},tablet:{width:768,height:1024},mobile:{width:390,height:844}};function se({boardViewport:o,containerRef:c,selectViewport:i,viewportValue:f}){return s.jsxs(s.Fragment,{children:[s.jsxs(it,{"aria-label":"Responsive viewport",title:o?.locked?"Viewport is locked by this story’s globals.viewport":"Responsive viewport",value:f,disabled:o?.locked===!0,onChange:n=>i(n.target.value),className:"vgai-react-viewport-select",children:[s.jsx("option",{value:"fill",children:"Responsive"}),o?o.choices.map(n=>s.jsxs("option",{value:n.id,children:[n.label," · ",n.width,"×",n.height]},n.id)):s.jsxs(s.Fragment,{children:[s.jsx("option",{value:"desktop",children:"Desktop · 1440×900"}),s.jsx("option",{value:"tablet",children:"Tablet · 768×1024"}),s.jsx("option",{value:"mobile",children:"Mobile · 390×844"})]})]}),o&&s.jsx(D,{"aria-label":"Rotate viewport",title:o.locked?"Viewport is locked by this story’s globals.viewport":"Rotate viewport",size:"comfortable",disabled:o.locked,onClick:()=>Nt(c.current),children:s.jsx(M,{icon:lt,size:"md"})})]})}function ae({containerRef:o,context:c,boardOnly:i=!1}){const f=et();p.useSyncExternalStore(f.subscribe,f.getSnapshot);const n=p.useSyncExternalStore(N,G),d=p.useSyncExternalStore(Tt,$t),b=p.useSyncExternalStore(Ft,()=>Vt(o.current),()=>null),m=p.useCallback(r=>{const u=o.current;if(!u)return;const e=Math.min(4,Math.max(.1,r)),a=u.clientWidth/2,t=u.clientHeight/2,l=(a-n.x)/n.zoom,g=(t-n.y)/n.zoom;I(a-l*e,t-g*e,e)},[o,n]),h=p.useCallback(()=>{const r=o.current,u=[...f.selectedEntityIds].at(-1);if(!r||!u)return;const e=c?.adapter.rects?.rect(u);if(!e||e.width<=0||e.height<=0)return;const a=Math.max(1,r.clientWidth-96),t=Math.max(1,r.clientHeight-96),l=Math.min(4,Math.max(.1,Math.min(a/e.width,t/e.height)));I(r.clientWidth/2-(e.x+e.width/2)*l,r.clientHeight/2-(e.y+e.height/2)*l,l)},[o,c,f]),x=p.useCallback(r=>{const u=o.current;if(b){_t(u,r==="fill"?null:r);return}const e=Q[r];if(!u||e===null){Z(null,null),I(0,0,1);return}Z(e.width,e.height);const a=Math.min(1,Math.max(.1,Math.min((u.clientWidth-96)/e.width,(u.clientHeight-96)/e.height)));I((u.clientWidth-e.width*a)/2,(u.clientHeight-e.height*a)/2,a)},[b,o]),k=p.useCallback(()=>{const r=o.current;r&&Pt(r)},[o]),w=b!==null,R=c?.kind==="dom"&&!!c.adapter.rects;if(i?!w:!R)return null;const C=b?b.selectedViewportId??"fill":Object.entries(Q).find(([,r])=>r===null?d.width===null:r.width===d.width&&r.height===d.height)?.[0]??"fill";return s.jsxs(s.Fragment,{children:[!w&&d.width!==null&&d.height!==null&&s.jsx("div",{"data-testid":"react-canvas-device-frame",style:{position:"absolute",left:0,top:0,zIndex:0,width:d.width,height:d.height,transform:ot(n),transformOrigin:"0 0",pointerEvents:"none",background:"#fff",boxShadow:"0 0 0 1px #ffffff40, 0 8px 30px #0009"}}),s.jsxs(nt,{label:i?"2D component board view":"React canvas view","data-testid":i?"canvas-board-zoom-controls":"react-canvas-zoom-controls","data-vgai-canvas-navigation-ignore":"true",className:"vgai-react-canvas-controls",children:[!i&&s.jsx(se,{boardViewport:b,containerRef:o,selectViewport:x,viewportValue:C}),w&&s.jsx(O,{variant:"ghost","aria-label":"Fit story board",title:"Fit all stories",size:"comfortable",onClick:k,children:"Fit board"}),s.jsx(D,{"aria-label":"Zoom out",title:"Zoom out",size:"comfortable",onClick:()=>m(n.zoom/1.2),children:s.jsx(M,{icon:st,size:"md"})}),s.jsxs(O,{variant:"ghost","aria-label":"Reset zoom to 100%",title:"Reset zoom to 100%",size:"comfortable",onClick:()=>m(1),children:[Math.round(n.zoom*100),"%"]}),s.jsx(D,{"aria-label":"Zoom in",title:"Zoom in",size:"comfortable",onClick:()=>m(n.zoom*1.2),children:s.jsx(M,{icon:at,size:"md"})}),!i&&s.jsx(D,{"aria-label":"Zoom to selection",title:"Zoom to selection",size:"comfortable",onClick:h,children:s.jsx(M,{icon:rt,size:"md"})})]})]})}const re="Scene";function ie({active:o,composite:c,descriptor:i,documentId:f,store:n}){const d=p.useRef(null),b=p.useRef(null),[m]=p.useState(bt),h=i.kind==="canvas",x=h?m:St;p.useSyncExternalStore(n.subscribe,n.getSnapshot);const k=p.useSyncExternalStore(xt,gt),w=p.useSyncExternalStore(vt,wt),[R,C]=p.useState(null),r=c.childAdapters().find(v=>v.worldId===i.worldId)?.adapter??R??void 0,u=h&&r?.provenance?.label==="babylon",e=r?.hierarchy.roots()??[],a=new Set(r?.rects?.emptyContainers?.().map(v=>v.id)??[]),t=e.some(v=>!a.has(v.id)),l=Lt({surface:h?"Scene":i.kind==="dom"?"UI":"World",rootIds:[i.worldId],playSuspended:n.playState!=="stopped"&&(!r||r.provenance?.source==="boundary"),phase:!r||r.provenance?.source==="boundary"?"loading":"ready",content:!r||r.provenance?.source==="boundary"?"unknown":t?"present":"empty",readiness:k,failures:w});p.useEffect(()=>{if(r)return yt(f,()=>({adapter:r,nodeId:[...n.selectedEntityIds].find(v=>r.hierarchy.node(v))??null}))},[c,r,f,n]),p.useEffect(()=>{const v=d.current;if(v&&!u)return h?At(v,x):Dt(v,x)},[x,u,h]),p.useEffect(()=>{if(!o)return;if(!!!b.current&&d.current){b.current=jt(d.current,c,n,[i],(ce,tt)=>C(tt),h?{canvasSceneView:m}:void 0,f);return}let E=0,$=0;const W=()=>{if(E+=1,E<2){$=requestAnimationFrame(W);return}Et(f)};return $=requestAnimationFrame(W),()=>cancelAnimationFrame($)},[o,m,c,i,f,h,n]),p.useEffect(()=>()=>{b.current?.(),b.current=null},[]);const g=kt(Rt(n),n.selectedEntityIds),S=g?.worldId===i.worldId?g:r?.rects?{worldId:i.worldId,kind:"dom",adapter:r}:null;return s.jsxs("div",{ref:d,"data-testid":`world-document:${i.worldId}`,"data-vgai-backdrop-color":o?u?"#111827":h?L:P:void 0,"data-vgai-backdrop-policy":o?"dark-frost":void 0,onPointerDown:()=>Ct("viewport"),style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"auto",backgroundColor:u?"#111827":h?L:P,touchAction:"none"},children:[u?null:h?s.jsx(Mt,{view:m}):s.jsx(le,{}),s.jsx(te,{...r?{adapter:r}:{},...h&&!u?{view:m,transformModeAware:!0}:{}},`selection:${H(r)}`),s.jsx(Zt,{explanation:l,testId:`world-surface-status:${i.worldId}`,style:{zIndex:20}}),u?null:h?s.jsx(Bt,{active:o,...r?{adapter:r}:{},containerRef:d,view:m},`controls:${H(r)}`):s.jsxs(s.Fragment,{children:[s.jsx(oe,{docId:i.worldId,containerRef:d}),s.jsx(ae,{containerRef:d,context:S})]})]})}function le(){const o=p.useSyncExternalStore(N,G),c=Math.max(8,24*o.zoom),i=Math.max(.7,Math.min(1.4,o.zoom));return s.jsx("div",{"data-testid":"react-design-canvas-backdrop","aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:P,backgroundImage:`radial-gradient(circle, ${Gt} ${i}px, transparent ${i}px)`,backgroundPosition:`${o.x}px ${o.y}px`,backgroundSize:`${c}px ${c}px`}})}let B=null;function Te(){return B}function $e(o,c){B={store:o,composite:c};const i=ht(),f=c.childAdapters().some(t=>t.role==="world"&&t.kind==="three"),n=c.childAdapters().some(t=>t.kind===zt);!f&&!n&&ct(j,{discardDirty:!0});const d=new Set,b=[];let m=!1;for(const t of c.childAdapters())t.role==="world"&&t.kind==="three"&&b.push(F(t.worldId,j));const h=It(c),x=h.find(t=>t.kind==="canvas");x&&b.push(F(x.worldId,z));const k=new Set([...c.childAdapters().filter(t=>t.role==="world"&&t.kind==="three"),...x?[x]:[]].map(t=>t.worldId)),w=new Map;function R(){for(const t of h){if(k.has(t.worldId)||w.has(t.worldId))continue;const l=Ut(t.kind);if(!l)continue;const g=F(t.worldId,l.documentId),S=mt(t.worldId,()=>l.presence()==="absent"?`Root "${t.worldId}" has no document of its own: its design surface is the project's ${l.title} board (${l.documentId}). ${l.absentReason()}`:null);w.set(t.worldId,()=>{S(),g()})}}b.push(dt(t=>{const l=ft();if(l.some(S=>S.descriptor.id===t))return null;const g=Ht(t);return g?g.presence()==="absent"?g.absentReason():null:`No workspace document is named "${t}". Open in this session: ${l.map(S=>S.descriptor.id).join(", ")||"(none)"}. A component board is present only when the package that owns its medium says this project has one, so a board id can be absent for this project and present for another.`}));function C(t){const l=g=>s.jsx(ie,{...g,composite:c,descriptor:t,store:o});pt({id:z,title:re,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:t.worldId,...t.path?{sourcePath:t.path}:{}},Content:l,presentation:()=>({kind:"world",id:t.worldId}),onActivate:()=>o.setActiveViewportTab("edit")},{category:"scene",default:!f,rootId:t.worldId})}function r(t){d.add(t.documentId);const l=()=>{d.delete(t.documentId)};try{Promise.resolve(t.install({store:o,composite:c})).catch(l)}catch{l()}}function u(){if(!m){R();for(const t of Ot()){const l=t.presence();if(l===null)continue;const g=d.has(t.documentId);l==="present"!==g&&(l==="present"?r(t):(U(t.documentId),d.delete(t.documentId)))}}}x&&(C(x),d.add(z)),u();const e=Wt(u),a=x?z:[...d][0];return!f&&a!==void 0&&(i===null||i===j||i===ut)?V(a):i?V(i):f&&V(j),()=>{m=!0,B?.store===o&&(B=null),e();for(const t of b)t();for(const t of w.values())t();w.clear();for(const t of d)U(t)}}export{ie as RootDocumentContent,Te as activeRootDocumentHost,$e as installRootDocuments};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{k1 as Ge,k2 as ve,k3 as H,fP as Ee,a5 as M,jB as He,a9 as Z,f7 as B,f8 as _,k4 as Be,k5 as _e,k6 as Ue,hL as Qe,a4 as G,k7 as Te,k8 as we,k9 as Ke,fe as qe,hK as Xe,ka as Ye,gK as Je,kb as Ze,kc as et,V as k,B as tt,cl as rt,kd as Se,cB as at,ke as nt,kf as st,kg as it,kh as ot,ki as ct,kj as lt,aG as C,kk as J,kl as dt,cX as ut,km as mt,dd as pt,cu as ft,cz as gt,kn as ye,ko as Ce,kp as xe,kq as ht,ao as bt,kr as vt,ks as je,fm as wt,kt as St,ku as yt,jC as Ct,jD as xt,jE as jt,jF as Pt,fS as kt,fT as Et,jM as Tt,jN as At,gq as Vt,gr as Rt,gs as Mt,gt as Ot,aN as Ft}from"./index-GIL7oGEO.js";import{R as zt}from"./RootSelectionOverlay-BZPlxmXU.js";import{e as Lt,S as It}from"./surface-state-DaxyruCj.js";import{b as Nt,s as Wt,t as Dt,V as $t}from"./three-viewport-presentation-QBQpSdMh.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as Gt}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{createPerformanceProfiler as Ht}from"./performance-profiler-D_Jey87L.js";import{createWebGLGpuTimer as Bt}from"./webgl-gpu-timer-D3YX7RaD.js";import{a as _t}from"./renderer-config-BqG4O8i9.js";import{getUserData as Ae}from"./user-data-BB2Of6Ht.js";import{detectKtx2Support as Ut}from"./loader-CaF_I7Yt.js";import{resolveRenderSettings as Qt}from"./render-settings-Bw4W9SYF.js";import{createSoftParticleDepthPass as Kt}from"./soft-particle-depth-DGvfQDi1.js";import{ViewportShadingRenderer as qt}from"./viewport-shading-BuA88e_A.js";import{applyRendererSettings as Xt,applySceneRenderPipeline as Yt}from"./setup-renderer-DVXaSGin.js";import{EffectComposer as Jt,BlendFunction as Zt,KernelSize as er,OutlineEffect as tr,EffectPass as rr}from"./index-BcCBqgM_.js";import{w as ar,C as nr,V as $,W as sr,cb as ir,Q as Pe,T as or}from"./three.module-D396a9Mn.js";import{d as cr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as lr}from"./project-authoring-session-Bnt6icLr.js";import{i as dr}from"./editor-presentation-activity-C7SNSmTd.js";import{E as ur,c as mr,a as pr,b as fr,i as gr}from"./viewport-shading-boundary-B_-_gABg.js";import{p as hr}from"./viewport-root-presentation-CWsE56K6.js";import{d as br}from"./asset-editor-persistence-BBaONOJt.js";import{bindStagePresenceMarkers as vr}from"./stage-presence-markers-DiGI6A45.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./eyedropper-session-bjPXnfeX.js";import"./react-story-board-BDDwiE2H.js";import"./viewport-pick-context-DkawXbEi.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";import"./object-marks-DwvIEBOK.js";import"./render-features-CPQ_e568.js";import"./matcap-texture-CVfalpWT.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-B47TfLqu.js";import"./stage-invalidation-DBg3C3Ta.js";import"./clip-planes-CnAI6DZn.js";import"./three-CDSueJyJ.js";import"./OrbitControls-CM3bPray.js";import"./LineSegments2-CsOpKSiM.js";import"./three.quarks.esm-B1C61jGo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-Cat0GtyJ.js";import"./mounted-authoring-Dmg5xmhP.js";import"./collaboration-presence-DLoZ7EA3.js";function wr({previewRef:r}){const{preview:e,previewPinned:i}=H(),[n,c]=f.useState(!1),o=f.useRef(null);if(f.useEffect(()=>{if(!n)return;const u=P=>{o.current?.contains(P.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[n]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return s.jsxs("div",{className:"vgai-camera-preview","data-testid":"camera-preview",children:[s.jsxs(Ee,{className:"vgai-camera-preview-header",gap:4,align:"center",children:[s.jsx(M,{icon:He,size:"sm"}),s.jsx(Z,{variant:"label",truncate:!0,className:"vgai-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),s.jsx(B,{text:i?"Unpin camera preview":"Pin camera preview",children:s.jsx(_,{"aria-label":i?"Unpin camera preview":"Pin camera preview","aria-pressed":i,size:"compact",onClick:Be,children:s.jsx(M,{icon:_e,size:"sm"})})}),s.jsxs("div",{ref:o,className:"vgai-camera-preview-menu-anchor",children:[s.jsx(B,{text:"Camera actions",children:s.jsx(_,{"aria-label":"Camera actions","aria-expanded":n,size:"compact",onClick:()=>c(u=>!u),children:s.jsx(M,{icon:Ue,size:"sm"})})}),n?s.jsxs(Qe,{className:"vgai-camera-preview-menu",children:[s.jsx(G,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Te(e)},children:"Pilot Camera"}),s.jsx(G,{variant:"ghost",size:"compact",onClick:()=>{c(!1),we(e)},children:"View Through Camera"}),s.jsx(G,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Ke(e)},children:"Align Camera to Current View"})]}):null]})]}),s.jsx("div",{ref:r,className:"vgai-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>we(e)})]})}function Sr(){return s.jsxs("div",{className:"vgai-camera-guides","aria-hidden":"true",children:[s.jsx("div",{className:"vgai-camera-guide vgai-camera-guide-v1"}),s.jsx("div",{className:"vgai-camera-guide vgai-camera-guide-v2"}),s.jsx("div",{className:"vgai-camera-guide vgai-camera-guide-h1"}),s.jsx("div",{className:"vgai-camera-guide vgai-camera-guide-h2"}),s.jsx("div",{className:"vgai-camera-safe-frame"}),s.jsx("div",{className:"vgai-camera-center-mark"})]})}function yr(){const{view:r,guidesVisible:e}=H();if(!r)return null;const i=r.mode==="pilot";return s.jsxs(s.Fragment,{children:[e?s.jsx(Sr,{}):null,s.jsx(qe,{variant:"overlay",border:!0,className:"vgai-camera-view-banner vgai-chrome-island vgai-glass-island","data-testid":"camera-view-banner",children:s.jsxs(Ee,{gap:6,align:"center",children:[s.jsx(Xe,{children:i?"PILOTING":"CAMERA VIEW"}),s.jsx(Z,{variant:"label",children:r.subject.name}),s.jsx(Z,{variant:"caption",tone:"muted",children:"Exact camera view"}),s.jsx(B,{text:e?"Hide composition guides":"Show composition guides",children:s.jsx(_,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:Ye,children:s.jsx(M,{icon:Je,size:"sm"})})}),i?null:s.jsx(G,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Te(r.subject),children:"Pilot"}),s.jsx(B,{text:"Exit camera view",children:s.jsx(_,{"aria-label":"Exit camera view",size:"compact",onClick:Ze,children:s.jsx(M,{icon:et,size:"sm"})})})]})})]})}function Cr({previewRef:r}){return f.useSyncExternalStore(Ge,ve,ve),s.jsxs(s.Fragment,{children:[s.jsx(wr,{previewRef:r}),s.jsx(yr,{})]})}const xr=2e4,jr=250,Pr=5e3;class kr{#e=0;#t=0;#r=0;#a;constructor(e){this.#a=e}get pending(){return this.#e>0||this.#t>0}begin(e,i){this.#e=e+xr,this.#t=i?e+Pr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+jr,this.#t>0&&this.#a.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#a.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const ke=new WeakMap;function Er(r,e){if(!r)return e(),!0;if(ke.has(r))return!1;try{return e(),!0}catch(i){const n=i instanceof Error?i.message:String(i);return ke.set(r,n),k.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${n}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${tt("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Tr(){const r=rt();r.addEventListener("server-log",i=>{try{Se(JSON.parse(i.data))}catch{}});let e=!1;return(async()=>{try{const i=await at();if(e)return;for(const n of i)Se(n)}catch{}})(),()=>{e=!0,r.close()}}const Ve="viewportPose";function Ar(){const r=nt(Ve);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Vr(r,e){st(Ve,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}function Rr(r,e,i){const n=document.createElement("canvas");n.setAttribute("aria-label",`${i} authoring viewport`),n.setAttribute("data-testid","editor-canvas"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1,n.style.width="100%",n.style.height="100%",n.style.display="block",n.style.pointerEvents="auto",r.appendChild(n);const c=Math.max(1,e.clientWidth),o=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);n.width=Math.ceil(c*m),n.height=Math.ceil(o*m);const u=pt(new sr({canvas:n,antialias:!!Qt(void 0).antialias,powerPreference:"high-performance"}));return Xt(u,void 0,m),u.setSize(c,o),u.shadowMap.type=ir,u.info.autoReset=!1,Ut(u),{canvas:n,renderer:u,lease:null}}async function Mr(r){const e=ft(r.source,r.id);if(e)return e;let i=r.url,n=r.format??"gltf",c=r.includes;if(!i){const u=(await gt(r.source,r.id))[0];if(!u)return k.error(`No downloadable files for ${r.name}.`,"asset"),null;i=u.url,n=u.format,c=u.includes}const o={source:r.source,id:r.id,name:r.name,url:i,format:n};c&&(o.includes=c);const m=await br(o);return m.ok&&m.path?`/${m.path}`:(k.error(`Could not download ${r.name}.`,"asset"),null)}function Or(r){if(r.isCamera)return r;const e=Ae(r,"_camera");return e?.isCamera?e:null}function Fr(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const i=r;return i.isOrthographicCamera?`Orthographic · ${i.zoom.toFixed(2)}×`:r.type}function zr(r,e){const i=r.transforms;if(!i)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const n=i.editability?.(e,"position")??{writable:!0},c=i.editability?.(e,"rotation")??{writable:!0};return n.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:n.reason??c.reason??"This camera pose is read-only."}}function Lr(r,e,i){const n=e.get(i)??null;if(!n)return null;const c=Or(n);return c?{id:i,name:n.name||c.name||"Camera",camera:c,lens:Fr(c),...zr(r,i)}:null}function Ir(r){const e=new Map;for(const[i,n]of r.objectMap){const c=Ae(n,"tags");Array.isArray(c)&&c.length>0&&e.set(i,c)}return e}function Nr(r){const{store:e,documentId:i,container:n,canvas:c,renderer:o,stats:m}=r,u=new Jt(o),P=Kt(),O=new qt,g=Ht(),F=Bt(o.getContext()),Re=t=>{g.enabled&&F.begin();try{t()}finally{F.end()}},Me=()=>g.enabled?F.poll():null,Oe=it({id:i,label:"Scene viewport",kind:"scene",profiler:g}),S=new ar;S.background=new nr(ot(c).background??11184810),e.bindScene(S,o);const a=new ur(c,S,e,n,{renderer:o,onlineAssetResolver:Mr,onProjectionChange:Nt});e.bindScene(S,o,a.batchedRenderer,a.camera),e.setOrbitTarget(a.orbitControls.target);const U=new $,z=new $,ee=new $,te=()=>{const t=a.renderCamera;t.getWorldPosition(U),a.cameraViewMode==="pilot"?z.copy(a.orbitControls.target):a.cameraViewMode?(t.getWorldDirection(ee),z.copy(U).add(ee.multiplyScalar(10))):z.copy(a.orbitControls.target);const l=t.fov;return{position:U,target:z,fov:typeof l=="number"?l:0}},E=vr({scene:S,store:e,documentId:i,container:n,canvas:c,viewport:a,readVisibleCameraPose:te});let re="",Q=null,h=null,x=null,L=null;const ae=()=>{h&&fr(h,je(o.domElement))},Fe=ct(o.domElement,ae),ne=()=>{if(!h)return;const t=C(e),l=[...e.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>J(t,e.objectMap,d)).filter(d=>d!==null);pr(h,l);const p=h.selection.size>0;x&&(x.enabled=p,x.renderToScreen=p),L&&(L.renderToScreen=!p)};function T(){vt(e),Q?.(),Q=null,h?.selection.clear(),h=null,x=null,L=null,Yt(u,o,e.scene??S,a.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:Ir(e)}),h=mr({BlendFunction:Zt,KernelSize:er,OutlineEffect:tr},e.scene??S,a.renderCamera,je(o.domElement)),ae(),L=u.passes.at(-1)??null,x=new rr(a.renderCamera,h),x.enabled=!1,u.addPass(x),ne();const t=e.adoptedImageConfig;t&&(Q=_t(or,o,t))}const se=()=>{a.setProjection(Dt().projection),e.setViewportCamera(a.freeCamera),T()},ze=Wt(se);se();const K=t=>Lr(C(e),e.objectMap,t);let b=null;const A=()=>{b&&(xe(C(e),b),b=null)},ie=()=>{const t=H().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(b=t.subject.id,ye(C(e),b))},oe=()=>{if(!b||a.cameraViewMode!=="pilot")return;const t=K(b),l=C(e),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(b)}catch(v){k.error(v instanceof Error?v.message:String(v),"camera-authoring"),A();return}Ce(l,b,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.notifyIngestEdit()};a.orbitControls.addEventListener("start",ie),a.orbitControls.addEventListener("change",oe),a.orbitControls.addEventListener("end",A);const Le=lt({active:()=>e.playState==="stopped"&&e.activeViewportTab==="edit",selected:()=>{const t=e.selectedEntityId;return t?K(t):null},resolve:K,showView:(t,l)=>{A(),a.setCameraView(t.camera,l),T(),E.reportCamera()},leaveView:()=>{A(),a.clearCameraView(),T(),E.reportCamera()},alignToViewport:t=>{const l=C(e),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const v=a.camera.getWorldPosition(new $),y=a.camera.getWorldQuaternion(new Pe),w=v.clone(),V=y.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(w);const R=d.parent.getWorldQuaternion(new Pe);V.premultiply(R.invert())}let be;try{be=p.get(t.id)}catch(R){k.error(R instanceof Error?R.message:String(R),"camera-authoring");return}ye(l,t.id),Ce(l,t.id,{position:w.toArray(),rotation:V.toArray(),scale:be.scale}),e.notifyIngestEdit(),xe(l,t.id)},subscribe:e.subscribe});let ce=null;const le=()=>{const t=ht(e);t!==ce&&(ce=t,c.style.opacity=t?"1":"0",n.style.backgroundColor=t?"":bt.surface.raised,n.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",n.style.backgroundPosition=t?"":"0 0, 8px 8px",n.style.backgroundSize=t?"":"16px 16px")};le();let de=e.composerVersion;const Ie=e.subscribe(()=>{le();const t=e.scene;t&&t!==a.currentScene&&a.setScene(t),a.objectMap=e.objectMap,a.syncFromStore(),e.composerVersion!==de?(de=e.composerVersion,T()):ne()});let I=null;const q=new kr({seedFromGameCamera:()=>{const t=I?.()??null;return!!t&&a.seedFromGameCamera(t)},frameContent:()=>a.focusOnScene()}),ue=()=>{q.cancel(),I=null};a.orbitControls.addEventListener("start",ue);const me=()=>Vr(a.camera,a.orbitControls.target);a.orbitControls.addEventListener("end",me);const Ne=e.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=J(C(e),e.objectMap,t.id);l&&a.focusOn(l);break}case"focus-scene":{{const l=Ar();if(l){a.camera.position.set(...l.position),a.orbitControls.target.set(...l.target),a.orbitControls.update();break}}I=t.gameCamera??null,q.begin(performance.now(),I!==null);break}case"focus-selection":{const l=C(e),p=[...e.selectedEntityIds].map(d=>J(l,e.objectMap,d)).filter(d=>d!==null);a.focusOnMultiple(p);break}case"snap-selection-to-floor":a.snapSelectionToFloor();break;case"set-view-preset":a.setViewPreset(t.preset);break;case"set-camera-pose":a.setPose(t.position,t.target,t.fov);break}});Tr();const pe=new ResizeObserver(()=>{const t=Math.max(1,n.clientWidth),l=Math.max(1,n.clientHeight);o.setSize(t,l),u.setSize(t,l),a.resize(t,l)});pe.observe(n);let N=performance.now(),W=!0,j=!1,fe=!1;function ge(t){return Er(a.currentScene,()=>{P.render(o,a.currentScene,a.renderCamera),a.renderWithInfrastructure(()=>{yt(a.currentScene,()=>O.render(a.currentScene,e.shadingMode,()=>u.render(t),gr)),a.renderViewCube(o),a.renderCameraPreview(o,H().preview?.camera??null,r.cameraPreview())})})}const We=dt(c,async()=>{if(j||!dr()||!n.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ge(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),X=()=>St(e)===e;function De(t,l){if(j)return;if(l&&(N=t),!n.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){N=t,W=!0;return}g.beginFrame();const p=t-N,d=p/1e3;X()&&(m.frameTime=p,m.fps=1e3/p),N=t,E.syncMarkers(d),q.tick(t),g.beginPhase(),a.update(d),r.runFrame(d),a.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),o.info.reset(),Re(()=>{ge(d)}),g.reportRender({gpuMs:Me(),drawCalls:o.info.render.calls,triangles:o.info.render.triangles,geometries:o.info.memory.geometries,textures:o.info.memory.textures}),g.endPhase("render"),X()&&(m.drawCalls=o.info.render.calls,m.triangles=o.info.render.triangles),W&&fe&&(W=!1,wt(i)),g.endFrame();const v=te(),y=v.position,w=v.target;X()&&(m.cameraPosition.x=y.x,m.cameraPosition.y=y.y,m.cameraPosition.z=y.z,m.cameraTarget.x=w.x,m.cameraTarget.y=w.y,m.cameraTarget.z=w.z);const V=`${y.x},${y.y},${y.z},${w.x},${w.y},${w.z},${v.fov}`;V!==re&&(re=V,E.reportCamera())}a.objectMap=e.objectMap,a.syncFromStore(),T();let Y,D;async function $e(t){if(j)return;r.onMountStatus("mounting"),D?.(),D=void 0,Y=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=cr("three");if(j||Y!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:o}):()=>{};if(j||Y!==t){p();return}D=p,j||r.onMountStatus("ready")}const he=lr(e,$e);return he.ready.then(()=>ut(mt(e))).catch(t=>{k.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{fe=!0,W=!0}),{scene:S,viewport:a,frame:De,present:t=>hr(e,t),setHelper:(t,l)=>a.setHelper(t,l),dispose:()=>{j=!0,Oe(),We(),pe.disconnect(),Ie(),Ne(),Le(),a.orbitControls.removeEventListener("start",ie),a.orbitControls.removeEventListener("change",oe),a.orbitControls.removeEventListener("end",A),a.orbitControls.removeEventListener("start",ue),a.orbitControls.removeEventListener("end",me),he.dispose(),D?.(),E.dispose(),O.dispose(),F.dispose(),ze(),Fe(),h?.selection.clear(),P.dispose(),u.dispose()}}}function Wr({store:r,rootIds:e,mountStatus:i}){f.useSyncExternalStore(r.subscribe,r.getSnapshot);const n=f.useSyncExternalStore(Vt,Rt),c=f.useSyncExternalStore(Mt,Ot),o=r.scene?.background,m=o!==null&&!(o?.isColor===!0&&o.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&Gt(r.scene,{includeBackground:!1,ignoredLayer:Ft})),[r.scene,r.contentVersion]),P=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:i==="mounting"?"loading":"ready",content:P?"present":i==="mounting"?"unknown":"empty",readiness:n,failures:c});return s.jsx(It,{explanation:O,testId:"scene-viewport-status"})}function Dr({store:r,documentId:e,cameraPreviewRef:i,mountStatus:n,rootIds:c}){f.useSyncExternalStore(r.subscribe,r.getShellSnapshot??r.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(jt,Pt),f.useSyncExternalStore(kt,Et);const o=Tt(r,e,"document"),m=At(o);return s.jsxs(s.Fragment,{children:[o.surface!==null?s.jsx(zt,{}):null,o.surface==="three"?s.jsx(Cr,{previewRef:i}):null,!m&&o.surface!=="three"&&n==="mounting"?s.jsx($t,{}):null,s.jsx(Wr,{store:r,rootIds:c,mountStatus:n})]})}const Na={mountWorldRootSurface:Rr,installWorldRootStage:Nr,Overlays:Dr};export{Na as worldRootStageBinding};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{setUserData as ee,getUserData as te,deleteUserData as ne}from"./user-data-BB2Of6Ht.js";import{attachAnimationRuntimeInspection as ie}from"./runtime-inspection-l2iFQSsg.js";import{collectMachineAnimationMeta as oe,clipNamesOf as P,isBlendTreeAnimationMeta as O,asBlendTreeDef as ae}from"./xstate-animation-meta-Q3u9zh_m.js";import{O as se,bn as re,bo as ce,bp as le,d as fe,bq as de,br as he,bs as me}from"./three.module-D396a9Mn.js";import"./object-marks-DwvIEBOK.js";import"./index-GIL7oGEO.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";class M extends Error{constructor(i,c){super(i),this.stateId=c,this.name="AnimationBindingError"}}function ue(n){const i=n.logic;if(i?.root)return i;const c=n.getSnapshot();if(c?.machine?.root)return c.machine;throw new M("[bindXStateAnimation] the actor exposes no state machine — only a state-machine actor carries the `meta.animation` this binder reads")}let _=0;const k=new Set;function Ne(n){return k.add(n),()=>k.delete(n)}function Xe(){return _}function q(){_++;for(const n of k)n()}const I=n=>n.layer??"base",E=n=>n.weight??1,R=n=>n.blendMode??"override";function U(n){try{return de.parseTrackName(n.name).nodeName??""}catch{const i=n.name.indexOf(".");return i<0?n.name:n.name.slice(0,i)}}function V(n,i,c){const o=new Set,f=[];for(const l of i){let m=!1;n.traverse(u=>{u.name===l&&(m=!0,u.traverse(d=>{d.name&&o.add(d.name)}))}),c.has(l)&&(m=!0,o.add(l)),m||f.push(l)}return{names:o,missing:f}}function pe(n,i,c,o){const f=new Set(n.tracks.map(U)),l=i.include?V(c,i.include,f):void 0,m=i.exclude?V(c,i.exclude,f):void 0,u=[...l?.missing??[],...m?.missing??[]];if(u.length)throw new M(`[bindXStateAnimation] state "${o}" boneMask names unknown bones/objects: ${u.join(", ")}`,o);const d=n.tracks.filter(p=>{const w=U(p);return(!l||l.names.has(w))&&!m?.names.has(w)});if(d.length===0)throw new M(`[bindXStateAnimation] state "${o}" boneMask removes every track from clip "${n.name}"`,o);return new fe(n.name,n.duration,d.map(p=>p.clone()))}function ge(n){return n.reduce((i,c)=>c.weight>i.weight?c:i,n[0])}function Le(n,i,c,o={}){const f=i.getRoot(),l=o.root??(f instanceof se?f:void 0);if(!l)throw new M("[bindXStateAnimation] a THREE.Object3D `root` option is required when the mixer uses AnimationObjectGroup");const m=o.owner??l,u=ue(n).root,d=oe(u),p=new Map(d.map(t=>[t.stateId,t.meta]));for(const t of d)for(const e of P(t.meta))if(!c.has(e))throw new M(`[bindXStateAnimation] state "${t.stateId}" references clip "${e}", which is not present in the supplied clips map. Known clips: ${[...c.keys()].join(", ")||"(none)"}`,t.stateId);const w=new Map;function S(t,e,s){return I(e)!=="base"||!!e.boneMask||R(e)==="additive"?`${t}\0${s}`:s}for(const{stateId:t,meta:e}of d)for(const s of P(e)){const a=S(t,e,s);if(w.has(a))continue;const r=c.get(s);let h=e.boneMask?pe(r,e.boneMask,l,t):r;(h!==r||a!==s)&&(h===r&&(h=r.clone()),h.name=`${r.name}@${I(e)}:${t}`),R(e)==="additive"?(re.makeClipAdditive(h),h.blendMode=ce):h.blendMode=le,w.set(a,h)}const g=new Map;function F(t,e,s,a){let r=g.get(t);if(!r){const h=w.get(t);if(!h)throw new M(`[bindXStateAnimation] prepared clip "${t}" not found`);const v=i.clipAction(h);v.setEffectiveWeight(0),v.play(),r={action:v,clip:h},g.set(t,r)}return r.action.setLoop(e?he:me,1/0),r.action.clampWhenFinished=!e,r.action.timeScale=s,r.action.weight=a,r.action}function N(t){const e=o.selectParameters?o.selectParameters(t):t;return new Map(Object.entries(e??{}))}function X(t,e,s){return(O(e)?we(ae(e.blendTree),N(s)):[{clip:e.clip,weight:1}]).map(({clip:r,weight:h})=>({clip:r,weight:h,actionKey:S(t,e,r)}))}const b=new Map;let K=!1,L=()=>{};function j(t,e,s){for(const a of t){if(a.actionKey===e)continue;const r=g.get(a.actionKey)?.action;r&&(s>0?r.fadeOut(s):r.setEffectiveWeight(0))}}function x(t,e){if(!O(t.meta))return;t.natural=X(t.stateId,t.meta,e);const s=E(t.meta);for(const a of t.natural)g.get(a.actionKey)?.action.setEffectiveWeight(a.weight*s)}function G(t,e,s){const a=I(e),r=b.get(a)??null,h=X(t,e,s),v=ge(h),J=O(e)?!0:e.loop,Q=O(e)?1:e.speed,W=E(e);for(const y of h)F(y.actionKey,J,Q,W);const $=g.get(v.actionKey).action;$.reset().setEffectiveWeight(W);for(const y of h)y.actionKey!==v.actionKey&&g.get(y.actionKey).action.reset().setEffectiveWeight(0);const A=e.crossfade?.duration??0,Z=e.crossfade?.warp??!1;if(!r)A>0&&$.fadeIn(A);else{j(r.natural,r.dominantActionKey,A);const y=g.get(r.dominantActionKey)?.action;y&&A>0?y.crossFadeTo($,A,Z):(y?.setEffectiveWeight(0),$.setEffectiveWeight(W))}const C={layer:a,stateId:t,meta:e,natural:h,dominantActionKey:v.actionKey,crossfadeRemaining:A};b.set(a,C),O(e)&&A<=0&&x(C,s)}function Y(t){return Object.keys(t.getMeta()).filter(e=>p.has(e))}function T(t){const e=new Map;for(const s of Y(t)){const a=p.get(s),r=I(a),h=e.get(r);if(h)throw new M(`[bindXStateAnimation] animated states "${h}" and "${s}" are both active on layer "${r}". Give parallel regions distinct meta.animation.layer names.`,s);e.set(r,s)}for(const[s,a]of b)e.has(s)||(j(a.natural,void 0,0),b.delete(s));for(const[s,a]of e)b.get(s)?.stateId!==a&&G(a,p.get(a),t.context)}const H=n.getSnapshot();T(H);const z=n.subscribe(t=>{K||T(t)});function B(t){if(K)return;const e=t,s=n.getSnapshot().context;for(const a of b.values())a.crossfadeRemaining>0?(a.crossfadeRemaining=Math.max(0,a.crossfadeRemaining-e),a.crossfadeRemaining<=0&&x(a,s)):x(a,s);i.update(e)}const D={tick:B,actor:n,getParameters:()=>N(n.getSnapshot().context),getActiveLayers:()=>[...b.values()].map(t=>({layer:t.layer,stateId:t.stateId,clips:t.natural.map(e=>e.clip),clipWeights:t.natural.map(e=>({clip:e.clip,weight:g.get(e.actionKey)?.action.getEffectiveWeight()??0})),weight:E(t.meta),blendMode:R(t.meta),...t.meta.boneMask?{boneMask:t.meta.boneMask}:{}})),dispose(){if(!K){K=!0,L(),o.systems?.remove("animation",B),z.unsubscribe();for(const{action:t,clip:e}of g.values())t.stop(),i.uncacheAction(e,t.getRoot());g.clear(),b.clear(),te(m,"_xstateAnimation")===D&&(ne(m,"_xstateAnimation"),q())}}};return L=ie(m,{mixer:i,clips:c}),ee(m,"_xstateAnimation",D),q(),o.systems?.add("animation",B),D}function we(n,i){switch(n.type){case"1D":return be(n,i);case"2D":return ye(n,i);case"direct":return ve(n);default:return n.children.map(c=>({clip:c.clip,weight:1/n.children.length}))}}function be(n,i){const c=Number(i.get(n.parameter)??0),o=[...n.children].sort((l,m)=>l.threshold-m.threshold),f=o.map(l=>({clip:l.clip,weight:0}));if(o.length===0)return f;if(o.length===1||c<=o[0].threshold)return f[0].weight=1,f;if(c>=o[o.length-1].threshold)return f[f.length-1].weight=1,f;for(let l=0;l<o.length-1;l++){const m=o[l],u=o[l+1];if(c>=m.threshold&&c<=u.threshold){const d=u.threshold-m.threshold,p=d>0?(c-m.threshold)/d:0;return f[l].weight=1-p,f[l+1].weight=p,f}}return f}function ye(n,i){const c=Number(i.get(n.parameter)??0),o=Number(i.get(n.parameterY??"")??0),f=n.children,l=f.map(d=>({clip:d.clip,weight:0}));let m=0;const u=[];for(const d of f){const p=c-d.threshold,w=o-(d.thresholdY??0),S=Math.sqrt(p*p+w*w),g=S<.001?1e3:1/S;u.push(g),m+=g}if(m>0)for(let d=0;d<l.length;d++)l[d].weight=u[d]/m;return l}function ve(n){const i=n.children.map(o=>({clip:o.clip,weight:o.weight??0})),c=i.reduce((o,f)=>o+f.weight,0);if(c>0)for(const o of i)o.weight/=c;return i}export{M as AnimationBindingError,Le as bindXStateAnimation,we as evaluateBlendTree,Xe as getXStateAnimationBindingsVersion,ue as machineOfXStateActor,Ne as subscribeXStateAnimationBindings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as e}from"./index-GIL7oGEO.js";import{subscribeXStateBehaviorInspections as r}from"./xstate-inspection-BsZv8LS9.js";import{o as s,l as p,a}from"./live-behaviors-Bxq49Maz.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";const D="workspace.action",H=()=>[{id:"inspect-behavior",label:"Inspect Behavior",execute:()=>void s()},...p().map(o=>({id:`xstate-machine:${o.machineId}:${o.nodeId}`,label:`Inspect Behavior: ${o.machineId}`,execute:()=>void a(o.nodeId)}))],k=o=>{const i=r(o),t=e().hierarchy.subscribe(o);return()=>{i(),t()}};export{H as actions,D as point,k as subscribe};
|