@volter/game-editor 0.5.71 → 0.5.72
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 +18 -18
- package/catalog/entries/music.json +2 -2
- package/dist/.vite/manifest.json +2149 -2124
- package/dist/assets/{AssetBudgetPanel-CbSEGrcI.js → AssetBudgetPanel-TYxRsWF2.js} +3 -3
- package/dist/assets/{AudioViewer-DbO2vY3o.js → AudioViewer-SyAuzT6d.js} +1 -1
- package/dist/assets/{CanvasBoardDocument-BWmMyiAX.js → CanvasBoardDocument-bGKEifjb.js} +1 -1
- package/dist/assets/{CanvasSceneViewport-CrmQdonP.js → CanvasSceneViewport-DOvsDDXx.js} +1 -1
- package/dist/assets/{ColorInput-BOPGcPsk.js → ColorInput-ZEZlxzBn.js} +1 -1
- package/dist/assets/{EntityModelDocument-DUZaNI2v.js → EntityModelDocument-DLYhSTh-.js} +1 -1
- package/dist/assets/{EnvironmentAssetDocument-Bqsm2NLI.js → EnvironmentAssetDocument-BNcQR6yX.js} +1 -1
- package/dist/assets/{GameplaySessionTimeline-DmGEiHHD.js → GameplaySessionTimeline-B6GEizjr.js} +1 -1
- package/dist/assets/{ImageViewer-BXQ1dXgz.js → ImageViewer-CVnrpv0B.js} +1 -1
- package/dist/assets/InspectorObjectPreview-BanF_X-B.js +1 -0
- package/dist/assets/{JsonAssetDocument-BPQR7OXc.js → JsonAssetDocument-Cztt4zjY.js} +1 -1
- package/dist/assets/{LiveModuleDocument-DnlLSCZw.js → LiveModuleDocument-26blElg2.js} +1 -1
- package/dist/assets/{LutAssetDocument-CMDB77UF.js → LutAssetDocument-BnsiHHrS.js} +1 -1
- package/dist/assets/{ModelAssetDocument-C7Su96Mo.js → ModelAssetDocument-B5Yp9L8F.js} +1 -1
- package/dist/assets/{NonThreeAuthoringBootstrap-BqY5ceef.js → NonThreeAuthoringBootstrap-BHOfZ9sF.js} +1 -1
- package/dist/assets/{Object3DDocumentToolbar-CDYwPpW6.js → Object3DDocumentToolbar-B6BaAth8.js} +1 -1
- package/dist/assets/Object3DDocumentViewport-B4A-C5QD.js +2 -0
- package/dist/assets/{Object3DPreview-B_3FCd_-.js → Object3DPreview-BbPdqVcd.js} +1 -1
- package/dist/assets/{OnlineAssetDetail-BMAMYfaN.js → OnlineAssetDetail-B9ku5sHJ.js} +1 -1
- package/dist/assets/{PlayBar-DvpDIJXg.js → PlayBar-C72OdJpY.js} +1 -1
- package/dist/assets/{QuarksAssetDocument-BbG3zMIR.js → QuarksAssetDocument-B8WiFZqH.js} +1 -1
- package/dist/assets/{ReactCanvasControls-CnIJItuA.js → ReactCanvasControls-B-P7GL52.js} +1 -1
- package/dist/assets/{RootSelectionOverlay-47LRczuj.js → RootSelectionOverlay-DcHmoze3.js} +1 -1
- package/dist/assets/{ShaderAssetDocument-KDN9ZgDF.js → ShaderAssetDocument-CAx5sVKJ.js} +1 -1
- package/dist/assets/{ShadowEditor-CBNfgpsF.js → ShadowEditor-CCch2nLq.js} +1 -1
- package/dist/assets/{SourceAssetViewer-LGC-eTLS.js → SourceAssetViewer-bAfvPckn.js} +1 -1
- package/dist/assets/{StageHost-BOin7YcY.js → StageHost-D_2vBQsa.js} +2 -2
- package/dist/assets/{StoryPreviewMount-CN-jnvnn.js → StoryPreviewMount-BNoIvc7l.js} +1 -1
- package/dist/assets/{ThreeBoardDocument-DgC6xWZu.js → ThreeBoardDocument-Bvu00xSO.js} +2 -2
- package/dist/assets/{ThreeIsolationSceneContent-ieFf0WbO.js → ThreeIsolationSceneContent-DGtDG--4.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-B15_D8MJ.js → ToolObject3DPreview-BKlQKnPe.js} +1 -1
- package/dist/assets/{Toolbar-CAnrijz7.js → Toolbar-TU3vLh4L.js} +1 -1
- package/dist/assets/{TransientHint-BiIz-7Hh.js → TransientHint-K6pZSJgG.js} +1 -1
- package/dist/assets/{VideoViewer-CrP78U5w.js → VideoViewer-DrtHx0m_.js} +1 -1
- package/dist/assets/{ViewportShadingMenu-BfoDB2WO.js → ViewportShadingMenu-zMKOlcUM.js} +1 -1
- package/dist/assets/{active-ingest-CHE8woWv.js → active-ingest-gUx8jeyJ.js} +2 -2
- package/dist/assets/{animation-clock-DWhLTlyc.js → animation-clock-D-tLCTj6.js} +1 -1
- package/dist/assets/{animation-mixers.service-xdiawk5y.js → animation-mixers.service-CuNPgPSv.js} +1 -1
- package/dist/assets/{animation-timeline.utility-Czb7Ax-Z.js → animation-timeline.utility-BzbSVAmj.js} +1 -1
- package/dist/assets/{asset-budget-asset.menu-CpHLTATf.js → asset-budget-asset.menu-B_A367BM.js} +1 -1
- package/dist/assets/{asset-budget.action-C_ZI2rdN.js → asset-budget.action-UgvyFZGk.js} +1 -1
- package/dist/assets/{asset-budget.document-hmCS7sH2.js → asset-budget.document-C20mZfef.js} +1 -1
- package/dist/assets/{asset-budget.menu-BZyzyVdk.js → asset-budget.menu-C1THP8Ir.js} +1 -1
- package/dist/assets/{asset-editor-persistence-BIFP2LgP.js → asset-editor-persistence-D-YVUM-o.js} +1 -1
- package/dist/assets/{asset-loaders-DqbPEavT.js → asset-loaders-ClM8urgu.js} +1 -1
- package/dist/assets/{asset-preview-BzDHm81_.js → asset-preview-BD4OZrEp.js} +1 -1
- package/dist/assets/{audio-unlock.service-C2a8hsP0.js → audio-unlock.service-krSi_8MS.js} +1 -1
- package/dist/assets/{audio.utility-VklURuQw.js → audio.utility-DjFH8tZN.js} +1 -1
- package/dist/assets/autoplay.service-C_iwBCWg.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-DBBX2Hem.js → babylon-authoring-adapter-C6qqXaiV.js} +1 -1
- package/dist/assets/{binding-resolver-aDFCbAcG.js → binding-resolver-B6upIc33.js} +2 -2
- package/dist/assets/{blender-node-editor.document-BdX0SCxH.js → blender-node-editor.document-DsDBkUHt.js} +1 -1
- package/dist/assets/{blender-properties-tab-BVdvAiLS.js → blender-properties-tab-9RSYwbBS.js} +1 -1
- package/dist/assets/{blender-runtime-host-B1bjBV91.js → blender-runtime-host-DtpNeLGc.js} +1 -1
- package/dist/assets/{blender-runtime-skin-BEbT46i_.js → blender-runtime-skin-EKCns7fu.js} +1 -1
- package/dist/assets/{blender-runtime.document-BAQTV4az.js → blender-runtime.document-CmLNi8tH.js} +1 -1
- package/dist/assets/{blender-timeline.document-BTwdMhSn.js → blender-timeline.document-qArofonU.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-CqxvqlSw.js → blender-uv-editor.document-Dv3ihJD4.js} +1 -1
- package/dist/assets/{blender-version.status-D-kPKENT.js → blender-version.status-BEIisS2r.js} +1 -1
- package/dist/assets/{blender.command-BABpNHlJ.js → blender.command-1xwFaSJs.js} +1 -1
- package/dist/assets/{board-guides-BVkDJqat.js → board-guides-DnI_fMSm.js} +1 -1
- package/dist/assets/bridge.command-C5EYO4OS.js +3 -0
- package/dist/assets/{browserAll-DjSaXYpJ.js → browserAll-Co_vDC8r.js} +1 -1
- package/dist/assets/{build-player.document-viLZOb6A.js → build-player.document-LBxyS2AI.js} +1 -1
- package/dist/assets/{build-profiles.document-C9gM1NV6.js → build-profiles.document-B_6Df2Sp.js} +1 -1
- package/dist/assets/{build-progress.status-DKw0YdnU.js → build-progress.status-Cdt1Zuu_.js} +1 -1
- package/dist/assets/{build-session-CpAT9iQU.js → build-session-DKHnqiXT.js} +1 -1
- package/dist/assets/{build.action-BrSZc3kA.js → build.action-DRDdqtZb.js} +1 -1
- package/dist/assets/{build.command-CVB-50ii.js → build.command-ry_OUUh9.js} +1 -1
- package/dist/assets/{build.header-BhOtTPyg.js → build.header-CiTCHvry.js} +1 -1
- package/dist/assets/{build.menu-BHIVHysW.js → build.menu-DiViXEwh.js} +1 -1
- package/dist/assets/{build.service-C5awmXgd.js → build.service-BSGXA-SQ.js} +1 -1
- package/dist/assets/{camera-B_ssMgXA.js → camera-B8Mdswus.js} +1 -1
- package/dist/assets/{camera-runtime.inspector-BAc2xnsF.js → camera-runtime.inspector-CupJRuBs.js} +1 -1
- package/dist/assets/{canvas-design-mount-DW2RoIFP.js → canvas-design-mount-DS8xWFiw.js} +3 -3
- package/dist/assets/{canvas-entry-runtime-BQdfSw1B.js → canvas-entry-runtime-BURQgaLB.js} +2 -2
- package/dist/assets/{canvas-preview-frames-Bc44u87o.js → canvas-preview-frames-Crj5bFty.js} +1 -1
- package/dist/assets/{canvas-story-capture.service-DTLE6FK3.js → canvas-story-capture.service-DQ6Zw3b0.js} +2 -2
- package/dist/assets/{capability-coverage-6I_iG0kk.js → capability-coverage-Ctnmu2LE.js} +1 -1
- package/dist/assets/{collaboration-presence-wD0oKl7P.js → collaboration-presence-C-yh_YBU.js} +1 -1
- package/dist/assets/{collider-BQKrXUbD.js → collider-C_I5Xdtu.js} +1 -1
- package/dist/assets/{component-board.service-BzZ2JQC8.js → component-board.service-BJ2DCCXQ.js} +2 -2
- package/dist/assets/component-board.service-COaCvlbA.js +2 -0
- package/dist/assets/{component-board.service-Cnxftkv8.js → component-board.service-DwPBo3xK.js} +2 -2
- package/dist/assets/{component-contracts.service-BJ73JRuk.js → component-contracts.service-RJCV5AAt.js} +1 -1
- package/dist/assets/{component-instance-root-9MmHwMal.js → component-instance-root-DjA11g2U.js} +1 -1
- package/dist/assets/{component-verbs.command-_nUoLZ1s.js → component-verbs.command-BwYzS1c0.js} +1 -1
- package/dist/assets/{component-verbs.service-D9qvuexk.js → component-verbs.service-CJvrj9av.js} +1 -1
- package/dist/assets/{config-DabjxySF.js → config-B4n-SqJs.js} +2 -2
- package/dist/assets/{configurations-CACHqi7T.js → configurations-Bqg2uvA4.js} +1 -1
- package/dist/assets/{connection.status-CfFK9wti.js → connection.status-BVL6eTcF.js} +1 -1
- package/dist/assets/{constraints.inspector-DvTTgVxM.js → constraints.inspector-CqY4o8xc.js} +1 -1
- package/dist/assets/{content-bounds-938XXJRy.js → content-bounds-C1-UpGMc.js} +1 -1
- package/dist/assets/{contract-system-adapters-D9Gcb7R7.js → contract-system-adapters-StvC0uNq.js} +1 -1
- package/dist/assets/{coverage.service-CyWmmos8.js → coverage.service-DI7ocYK8.js} +1 -1
- package/dist/assets/{create-runtime-D3CS8u84.js → create-runtime-DwcO7h9p.js} +1 -1
- package/dist/assets/{curve-CzIvpvWX.js → curve-CPd2jkVJ.js} +1 -1
- package/dist/assets/{data-asset-Dt3MP-sl.js → data-asset-B2UtWmua.js} +1 -1
- package/dist/assets/{data-ref-COkdIktX.js → data-ref-B036kumM.js} +1 -1
- package/dist/assets/{debug-bridge-LaiaWRls.js → debug-bridge-BG5c-HdI.js} +1 -1
- package/dist/assets/{debug-registry-BUPLu5EA.js → debug-registry--ZkoQWOO.js} +1 -1
- package/dist/assets/{deferred-ingest-play-DVLTxYCk.js → deferred-ingest-play-CmJi6tql.js} +2 -2
- package/dist/assets/{design-time-canvas-mount-CkOQQvFW.js → design-time-canvas-mount-2sEXGMyx.js} +2 -2
- package/dist/assets/design-time-layers-CUuV2SKK.js +1 -0
- package/dist/assets/{design-time-mount.service-C8VeEbCC.js → design-time-mount.service-DaEwimcE.js} +2 -2
- package/dist/assets/design-time-mount.service-m_Alk1A4.js +2 -0
- package/dist/assets/design-time-react-mount-CcCuClCL.js +1 -0
- package/dist/assets/{document-preview-three-C8Pzyiai.js → document-preview-three-CRYXGELs.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-71D70rVP.js → dom-authoring-adapter-BQor85A0.js} +1 -1
- package/dist/assets/{draco3d-XOYD2Hke.js → draco3d-zcIWTWKV.js} +1 -1
- package/dist/assets/{edit-mode-audio.service-OcRQ9Ozq.js → edit-mode-audio.service-BZ_MguuB.js} +1 -1
- package/dist/assets/{edit-mode-authoring-Du1CaTkH.js → edit-mode-authoring-B8NE5TIR.js} +1 -1
- package/dist/assets/{edit-mode-networking.service-BWz-nxiL.js → edit-mode-networking.service-BnR0zkEk.js} +1 -1
- package/dist/assets/editor-api-D9ypvXGZ.js +1 -0
- package/dist/assets/{editor-layers-qlgroPbE.js → editor-layers-B2mwHrrn.js} +1 -1
- package/dist/assets/{editor-shell-store-Di0waLQj.js → editor-shell-store-V7HfbGqh.js} +1 -1
- package/dist/assets/{entity-object-BeRdaaqQ.js → entity-object-BqQBOLh4.js} +1 -1
- package/dist/assets/{extend-CFEzxGGP.js → extend-vhXKbXwa.js} +1 -1
- package/dist/assets/{fork-menu-Bujed-pM.js → fork-menu-CGygk03X.js} +1 -1
- package/dist/assets/{frame-debugger-store-CCm_jyhx.js → frame-debugger-store-BFHDpd_6.js} +1 -1
- package/dist/assets/{game-contract-seams-DOwrbA13.js → game-contract-seams-DYi5-NnM.js} +1 -1
- package/dist/assets/{game-css-scope-transform-DuP554oX.js → game-css-scope-transform-tjGkUu5X.js} +1 -1
- package/dist/assets/game-document.service-jY65msUL.js +1 -0
- package/dist/assets/game-eval.command-C0iQ6vZD.js +2 -0
- package/dist/assets/{game-module-access-gOlo85at.js → game-module-access-BlCkxuVe.js} +1 -1
- package/dist/assets/game-network-gqU0qk9j.js +22 -0
- package/dist/assets/game-surface-defaults-D8S4cRxi.js +1 -0
- package/dist/assets/{gameplay-export-Clmlm922.js → gameplay-export-SxI2CiOU.js} +1 -1
- package/dist/assets/{gameplay-replay-Dxz93B2M.js → gameplay-replay-CLHO__fQ.js} +1 -1
- package/dist/assets/gameplay.command-CQyRcFql.js +1 -0
- package/dist/assets/{generation-jobs-_kzxAnbI.js → generation-jobs-C6l_ZBhD.js} +1 -1
- package/dist/assets/{generation.service-B533Kbco.js → generation.service-CgbxxPGg.js} +1 -1
- package/dist/assets/{generations-D5GcYf91.js → generations-DxppE9pN.js} +1 -1
- package/dist/assets/{generations.status-CDZ_eHJZ.js → generations.status-DIzDQ4QZ.js} +1 -1
- package/dist/assets/{hierarchy-marks-BrmGekuT.js → hierarchy-marks-CSQMtCBU.js} +1 -1
- package/dist/assets/{hosted-asset-materialization-DBLM2dtz.js → hosted-asset-materialization-TryBlckx.js} +1 -1
- package/dist/assets/{index-CP1Fd1fP.js → index-AagWeY8V.js} +1 -1
- package/dist/assets/{index-vjNaMgz6.js → index-C8u7p1K7.js} +1 -1
- package/dist/assets/{index-Q98tByQ2.js → index-Cj4vTL7A.js} +1 -1
- package/dist/assets/{index-CiqSswEV.js → index-CpMTewhc.js} +1 -1
- package/dist/assets/{index-C8jugKW5.js → index-DBIi3ND-.js} +1 -1
- package/dist/assets/{index-sTPbmuS8.js → index-d2quMKQM.js} +1 -1
- package/dist/assets/{index-BPUmREu0.js → index-u6amYfnv.js} +2 -2
- package/dist/assets/{index-iW3HFEJB.js → index-wjn2vkB8.js} +10 -10
- package/dist/assets/{index-BU93FMYM.js → index-xsQaHGma.js} +1 -1
- package/dist/assets/{inference-diagnostics-PcfFN6SD.js → inference-diagnostics-dZd7OUSj.js} +1 -1
- package/dist/assets/{ingest-boot-viewport-CrnkiTcJ.js → ingest-boot-viewport-Chqb3b3L.js} +1 -1
- package/dist/assets/{ingest-siblings-CQ95u6JM.js → ingest-siblings-DyKim2on.js} +1 -1
- package/dist/assets/{ingest-source-persistence-2MRBPgo0.js → ingest-source-persistence-D7jtuLEB.js} +1 -1
- package/dist/assets/{ingest.service-DQqEvbsT.js → ingest.service-C2q5JocL.js} +1 -1
- package/dist/assets/{inspect-CUNyIUii.js → inspect-Cl65lNby.js} +1 -1
- package/dist/assets/instances.command-CnrRMqOy.js +1 -0
- package/dist/assets/{json-history-resource-82d2z68R.js → json-history-resource-DWPJt2Bk.js} +1 -1
- package/dist/assets/{layered-pick-Db8YSlDp.js → layered-pick-wB2IUStv.js} +1 -1
- package/dist/assets/{light-PK9RLNmD.js → light-BK4WrhlP.js} +1 -1
- package/dist/assets/{live-project-verbs-CayyA6Tc.js → live-project-verbs-CSKXil-5.js} +1 -1
- package/dist/assets/{machine.document-CUO0RxDP.js → machine.document-Wxh00rVH.js} +1 -1
- package/dist/assets/{machines.finder-B-DdPjby.js → machines.finder-Bq84a20u.js} +1 -1
- package/dist/assets/{material-C_mvE2lW.js → material-DzSXsXYn.js} +1 -1
- package/dist/assets/{material-factory-kKKe4-DN.js → material-factory-6zzgHeT5.js} +1 -1
- package/dist/assets/{mesh-fUiQLtsU.js → mesh-DTSUSSfl.js} +1 -1
- package/dist/assets/{model-asset-sections.service-Dfkzhu6Q.js → model-asset-sections.service-eYy0ol55.js} +1 -1
- package/dist/assets/{model-inspection-DgqjTy5z.js → model-inspection-DM9bxnjs.js} +1 -1
- package/dist/assets/{model-thumbnail-DORLbXyw.js → model-thumbnail-DcI972TR.js} +1 -1
- package/dist/assets/{models.finder-DzW1Sg26.js → models.finder-CbfSmlRN.js} +1 -1
- package/dist/assets/{module-mode-BWoDD0oV.js → module-mode-BCWTllUj.js} +2 -2
- package/dist/assets/mount-canvas-ingest-root-BWvMQ1oU.js +2 -0
- package/dist/assets/{mount-dom-ingest-root-BOEt11vp.js → mount-dom-ingest-root-C8_3MNzH.js} +2 -2
- package/dist/assets/mount-ingest-root-CnfZV05y.js +2 -0
- package/dist/assets/mount-manifest-BHLEQ9MI.js +1 -0
- package/dist/assets/mount-three-ingest-root-Ci-ZYEqi.js +1 -0
- package/dist/assets/{mounted-authoring-30zCcxeV.js → mounted-authoring-CRGnDIkF.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-N0xrUdtm.js → mounted-story-viewport-source-BV9Vkz5j.js} +1 -1
- package/dist/assets/{native-debug-module-Cofo9dCU.js → native-debug-module-D0TMOJ5J.js} +1 -1
- package/dist/assets/{navigation-B9kSIhNu.js → navigation-Dtw9RIIP.js} +1 -1
- package/dist/assets/{navmesh.menu-DPNQ2RCH.js → navmesh.menu-BOqiQXs0.js} +1 -1
- package/dist/assets/{navmesh.service-pffKX_Ht.js → navmesh.service-DRssu5HB.js} +1 -1
- package/dist/assets/network-observer.service-CSbHzsem.js +1 -0
- package/dist/assets/network.utility-DkecVQis.js +1 -0
- package/dist/assets/{object3d-document-session-registry-DMhhDWnQ.js → object3d-document-session-registry-D68l_sLd.js} +2 -2
- package/dist/assets/{oid-transform-AHICFvQG.js → oid-transform-DELHL858.js} +1 -1
- package/dist/assets/{particles-DIMSkSIe.js → particles-DxmpSiYm.js} +1 -1
- package/dist/assets/{pixi-authoring-adapter-DR6NNYrL.js → pixi-authoring-adapter-crYHqvEe.js} +1 -1
- package/dist/assets/{pixi-live-write-target-CXDKS1kQ.js → pixi-live-write-target-Cx72kgN6.js} +1 -1
- package/dist/assets/play.command-WI1aGM0Z.js +2 -0
- package/dist/assets/{presentation-DPddUHCg.js → presentation-CqPEUUNS.js} +1 -1
- package/dist/assets/{product-CEH3MVYt.js → product-dDGXQlJ0.js} +1 -1
- package/dist/assets/{profiler.action-qMarbw9x.js → profiler.action-DsAh7yvt.js} +1 -1
- package/dist/assets/{profiler.menu-C52_wfu8.js → profiler.menu-eMeZSO2J.js} +1 -1
- package/dist/assets/{profiler.utility-DzfXG0cD.js → profiler.utility-B9hb8tbg.js} +1 -1
- package/dist/assets/project-authoring-session-7KN3YlPS.js +2 -0
- package/dist/assets/{properties-bone-constraints.inspector-DEOxhp1W.js → properties-bone-constraints.inspector-DoCD043b.js} +1 -1
- package/dist/assets/{properties-bone.inspector-CY8EEYZl.js → properties-bone.inspector-mlQIkyBf.js} +1 -1
- package/dist/assets/{properties-collection.inspector-rGoZwmsY.js → properties-collection.inspector-BSGr9-vR.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-DJITSHiL.js → properties-constraints.inspector-BfpdPfPN.js} +1 -1
- package/dist/assets/{properties-data.inspector-CNJ6cUzA.js → properties-data.inspector-yyf0b8Uw.js} +1 -1
- package/dist/assets/{properties-material.inspector-BkCUSFdM.js → properties-material.inspector-BjKs4qAn.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-C9ij0UfE.js → properties-modifiers.inspector-XAML7OJx.js} +1 -1
- package/dist/assets/{properties-object.inspector-IvVsyikt.js → properties-object.inspector-cHVVC7vP.js} +1 -1
- package/dist/assets/{properties-output.inspector-Df-fx8vq.js → properties-output.inspector-BE6O5uWt.js} +1 -1
- package/dist/assets/{properties-particles.inspector-J3UOyWlz.js → properties-particles.inspector-DA9r9tox.js} +1 -1
- package/dist/assets/{properties-physics.inspector-BmcTY5Q8.js → properties-physics.inspector-6V50bg6n.js} +1 -1
- package/dist/assets/{properties-render.inspector-DUB5qwIR.js → properties-render.inspector-1iXZTLFj.js} +1 -1
- package/dist/assets/{properties-scene.inspector-DxBRs2ae.js → properties-scene.inspector-8qzTDRZ-.js} +1 -1
- package/dist/assets/{properties-texture.inspector-BqzPv1aS.js → properties-texture.inspector-DnndHFBA.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-D1a1Dc1r.js → properties-view-layer.inspector-BFqtpGAW.js} +1 -1
- package/dist/assets/{properties-world.inspector-CCwHv8ha.js → properties-world.inspector-DrZZRQoS.js} +1 -1
- package/dist/assets/r3f-design-session-Bg3EEQz6.js +2 -0
- package/dist/assets/{r3f-physics-binding-mLmXPi7n.js → r3f-physics-binding-DSD0HHLc.js} +1 -1
- package/dist/assets/{r3f-source-authoring-adapter-W1zVFNuZ.js → r3f-source-authoring-adapter-Ca9azh8e.js} +1 -1
- package/dist/assets/{react-canvas-navigation-IPhloKzi.js → react-canvas-navigation-2OqMWHDI.js} +1 -1
- package/dist/assets/{react-inspector.service-C7T_Pqud.js → react-inspector.service-DYyJPfNc.js} +1 -1
- package/dist/assets/{react-story-board-CPTQdOIn.js → react-story-board-Cry0gSQl.js} +1 -1
- package/dist/assets/{react-three-rapier.esm-D43m0aj7.js → react-three-rapier.esm-DMmOHQDe.js} +1 -1
- package/dist/assets/{react-world-authoring-adapter-DgsCzOTj.js → react-world-authoring-adapter-CQtYfgx9.js} +1 -1
- package/dist/assets/{realm-services-C8OlRuJ5.js → realm-services-DBqdRLI4.js} +1 -1
- package/dist/assets/{reflection-probe-capture.inspector-DT1jvM_q.js → reflection-probe-capture.inspector-C5Bu6QzV.js} +1 -1
- package/dist/assets/{registry-XvQ4sPew.js → registry-_NCUhY0b.js} +1 -1
- package/dist/assets/{relative-import-specifier-CPCtuEhc.js → relative-import-specifier-BiEpXss5.js} +1 -1
- package/dist/assets/{render-env-BYsqF2DQ.js → render-env-D-pSIlJ1.js} +1 -1
- package/dist/assets/{render-features-CL2D1X_X.js → render-features-l7BQbeaM.js} +1 -1
- package/dist/assets/{render-settings-CsCXKLaq.js → render-settings-DjdbF9VX.js} +1 -1
- package/dist/assets/{resolve-three-DRDYxBE9.js → resolve-three-C5BhpPqs.js} +3 -3
- package/dist/assets/{root-seam-contract-BNGi8m22.js → root-seam-contract-cbINkIcN.js} +1 -1
- package/dist/assets/{run-selection-8wjzFzVg.js → run-selection-CxsHUK_M.js} +1 -1
- package/dist/assets/{scene-capture-aq3yUgox.js → scene-capture-CCifsWLp.js} +1 -1
- package/dist/assets/{scene-document.service-qnY16vPq.js → scene-document.service-TFlDSvVA.js} +2 -2
- package/dist/assets/{scene-framing-BWGUKaVh.js → scene-framing--293N2xY.js} +1 -1
- package/dist/assets/{seeded-random-BIdiJ8w9.js → seeded-random-BMF_UDMF.js} +1 -1
- package/dist/assets/{setup-renderer-BI8Dltzx.js → setup-renderer-ZCwGcqc7.js} +1 -1
- package/dist/assets/{source-object3d-authoring-adapter-Des84Gk3.js → source-object3d-authoring-adapter-C2qh6_pn.js} +1 -1
- package/dist/assets/{source-persistence-backend-I5wxqQgh.js → source-persistence-backend-iG_P2f_a.js} +1 -1
- package/dist/assets/{stage-keyboard-Ckod5Y4M.js → stage-keyboard-Bj7F0kP-.js} +1 -1
- package/dist/assets/{stage-overlay-set-CLTmSTo9.js → stage-overlay-set-4eMxmCWg.js} +1 -1
- package/dist/assets/{stage-presence-markers-DOoDCC7Z.js → stage-presence-markers-Dvo3soHw.js} +1 -1
- package/dist/assets/{stage-transform-tools-DjYQ95b7.js → stage-transform-tools-BGCCPEHD.js} +1 -1
- package/dist/assets/{standard-viewport-dressing-DE9WE1Lv.js → standard-viewport-dressing-DisOo98G.js} +1 -1
- package/dist/assets/{state-watch.action-D0rXmFVx.js → state-watch.action-BjMVtMnK.js} +1 -1
- package/dist/assets/{state-watch.menu-DJyVHqNM.js → state-watch.menu-uo9i_GJH.js} +1 -1
- package/dist/assets/{state-watch.utility-CHL55Pbn.js → state-watch.utility-BDSAOvyy.js} +1 -1
- package/dist/assets/{story-capture-BGeBen-R.js → story-capture-BZD3x0Pr.js} +1 -1
- package/dist/assets/{story-documents-B8TSr_CN.js → story-documents-DOsBtURt.js} +1 -1
- package/dist/assets/{story-documents.service-C_Q58qZs.js → story-documents.service-CbADy_Hj.js} +1 -1
- package/dist/assets/{story-documents.service-B1hhvZad.js → story-documents.service-D_hsjJr9.js} +1 -1
- package/dist/assets/{story-media-presence-CEwzSadX.js → story-media-presence-9jRxsUgl.js} +1 -1
- package/dist/assets/{story-pixi-preview-rAub2W_H.js → story-pixi-preview-DbcYdZMI.js} +1 -1
- package/dist/assets/{story-presentation-CdJ6Ncu6.js → story-presentation-CdTE_XUR.js} +1 -1
- package/dist/assets/{story-three-preview-Cp9kfSo0.js → story-three-preview-Bg0NL_U_.js} +2 -2
- package/dist/assets/{studio-environment-BCf09Sox.js → studio-environment-Cso4y0lE.js} +1 -1
- package/dist/assets/{surface-state-BUmVXUJj.js → surface-state-B_0Yt3kv.js} +1 -1
- package/dist/assets/{syntactic-prop-specs-BHoShoI2.js → syntactic-prop-specs-BrDBqyDN.js} +1 -1
- package/dist/assets/team-playtest.service-BaW1I4YQ.js +1 -0
- package/dist/assets/{three-wsMw8Ifj.js → three-C0qVNsOS.js} +1 -1
- package/dist/assets/{three-authoring-adapter-DctJX96k.js → three-authoring-adapter-C92rm99z.js} +1 -1
- package/dist/assets/three-authoring.service-D_KTfVs4.js +2 -0
- package/dist/assets/{three-ingest-runtime-Bqwv-JsZ.js → three-ingest-runtime-DOUKRBrc.js} +1 -1
- package/dist/assets/{three-integration-C9bu5OXH.js → three-integration-pMMAFpYl.js} +2 -2
- package/dist/assets/three-integration.service-k1_xWOYd.js +1 -0
- package/dist/assets/{three-projection-core-rOK39WmJ.js → three-projection-core-BOq13mz-.js} +1 -1
- package/dist/assets/{three-state-Cu8xEils.js → three-state-B6NLTszJ.js} +1 -1
- package/dist/assets/{three-story-capture.service-DJaS21h9.js → three-story-capture.service-CcRSfWad.js} +2 -2
- package/dist/assets/{three-story-model-CE0vGtKW.js → three-story-model-7qxVYOkR.js} +1 -1
- package/dist/assets/{three-viewport-presentation-IVtG1zll.js → three-viewport-presentation-DatfjZJH.js} +1 -1
- package/dist/assets/{transform-mode-request-C7qvcvEe.js → transform-mode-request-c8d5QQwQ.js} +1 -1
- package/dist/assets/{transport-strip-B6Hauzjh.js → transport-strip-BlGEb51b.js} +1 -1
- package/dist/assets/transport.header-DZ6f7-ON.js +1 -0
- package/dist/assets/{tuples-CP56GoRo.js → tuples-ChC18dWq.js} +1 -1
- package/dist/assets/ui-board-document-CliGHHFn.js +2 -0
- package/dist/assets/{user-data-BGLBYiFw.js → user-data-C2bC2Cok.js} +1 -1
- package/dist/assets/{utility-view-state-y2PTWZuT.js → utility-view-state-DbTE0Ome.js} +1 -1
- package/dist/assets/{viewport-door-B7DJhMPS.js → viewport-door-DNJf5Mej.js} +1 -1
- package/dist/assets/{viewport-root-presentation-DPtVohIT.js → viewport-root-presentation-CGYHAB1r.js} +1 -1
- package/dist/assets/{viewport-surface-status-CleQnKBz.js → viewport-surface-status-Db1dCE5f.js} +1 -1
- package/dist/assets/{webworkerAll-B8sqUYid.js → webworkerAll-K8X7iPJw.js} +1 -1
- package/dist/assets/{workspace-arrangement-6V8ZwB2d.js → workspace-arrangement-coA4mYU_.js} +1 -1
- package/dist/assets/world-documents-kcOR7HSb.js +1 -0
- package/dist/assets/{world-root-stage-binding-OOLit0lW.js → world-root-stage-binding-WQv8K4Zz.js} +1 -1
- package/dist/assets/{xstate-animation-binding-KbfYItEZ.js → xstate-animation-binding-BTIYbpkG.js} +1 -1
- package/dist/assets/{xstate-animation-meta-DM_K9jo1.js → xstate-animation-meta-D4bo9lqY.js} +1 -1
- package/dist-node/cli.js +14 -14
- package/package.json +14 -14
- package/template/.agents/references/project-manual.md +1 -1
- package/template/.agents/skills/volter-ingest-existing-game/SKILL.md +1 -1
- package/template/.agents/skills/volter-threejs-authoring/SKILL.md +1 -1
- package/template/.claude/skills/volter-ingest-existing-game/SKILL.md +1 -1
- package/template/.claude/skills/volter-threejs-authoring/SKILL.md +1 -1
- package/template/.github/skills/volter-ingest-existing-game/SKILL.md +1 -1
- package/template/.github/skills/volter-threejs-authoring/SKILL.md +1 -1
- package/template/IDIOMS.md +1 -1
- package/template/package.json +10 -10
- package/template/src/bot/bot-station.ts +1 -1
- package/template/vite.config.ts +2 -2
- package/template-dotfiles/gitignore +1 -1
- package/dist/assets/InspectorObjectPreview-JE22P2KW.js +0 -1
- package/dist/assets/Object3DDocumentViewport-mDettU8s.js +0 -2
- package/dist/assets/autoplay.service-ap_sEfca.js +0 -1
- package/dist/assets/bridge.command-DNktKXNP.js +0 -3
- package/dist/assets/component-board.service-DTH3BKq_.js +0 -2
- package/dist/assets/design-time-layers-Cv3txX_V.js +0 -1
- package/dist/assets/design-time-mount.service-DupCKL6-.js +0 -2
- package/dist/assets/design-time-react-mount-CT8eihNN.js +0 -1
- package/dist/assets/editor-api-BqS9NdSX.js +0 -1
- package/dist/assets/game-document.service-CW928hrj.js +0 -1
- package/dist/assets/game-eval.command-D8ohGtA6.js +0 -2
- package/dist/assets/game-network-CU3Yp0oN.js +0 -22
- package/dist/assets/gameplay.command-b2D2rbZV.js +0 -1
- package/dist/assets/instances.command-wzs2BWwt.js +0 -1
- package/dist/assets/mount-canvas-ingest-root-nBqJPkbz.js +0 -2
- package/dist/assets/mount-ingest-root-9KaA9ETn.js +0 -2
- package/dist/assets/mount-manifest-BOiv1Hix.js +0 -1
- package/dist/assets/mount-three-ingest-root-C_0Slh91.js +0 -1
- package/dist/assets/network-observer.service-D61Whg6t.js +0 -1
- package/dist/assets/network.utility-Bw74dLIu.js +0 -1
- package/dist/assets/play.command-L6qPHLHh.js +0 -2
- package/dist/assets/project-authoring-session-sbmVUm3i.js +0 -2
- package/dist/assets/r3f-design-session-By5arVMz.js +0 -2
- package/dist/assets/team-playtest.service-DErOWVaA.js +0 -1
- package/dist/assets/three-authoring.service-B2LLPXyf.js +0 -2
- package/dist/assets/three-integration.service-BXQuaWQ-.js +0 -1
- package/dist/assets/transport.header-CDivn20X.js +0 -1
- package/dist/assets/ui-board-document-B69iTbe5.js +0 -2
- package/dist/assets/world-documents-CwxZ4xtW.js +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BU93FMYM.js","assets/extends-CF3RwP-h.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/client-DNXj_opT.js","assets/index-CinJrH5C.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-bQE2NA0D.js","assets/Gltf-GjdUJfpn.js","assets/BufferGeometryUtils-FJZNEiJN.js","assets/OrthographicCamera-QGDXU8-_.js","assets/Fbo-BwAOPGSM.js","assets/PerspectiveCamera-CzyDwUe8.js","assets/OrbitControls-DqeA2OK1.js","assets/index-iW3HFEJB.js","assets/index-CtzuWnCS.js","assets/index-FUuS4qwW.js","assets/index-CPiRKiDC.css","assets/RoundedBox-DrJK5JOI.js","assets/babylon-authoring-adapter-DBBX2Hem.js","assets/json-history-resource-82d2z68R.js","assets/source-persistence-backend-I5wxqQgh.js","assets/ingest-source-persistence-2MRBPgo0.js","assets/pixi-authoring-adapter-DR6NNYrL.js","assets/index-BPUmREu0.js","assets/component-instance-root-9MmHwMal.js","assets/user-data-BGLBYiFw.js","assets/workspace-arrangement-6V8ZwB2d.js","assets/pixi-transform-channels-P4rvmusc.js","assets/pixi-live-write-target-CXDKS1kQ.js","assets/canvas-entry-runtime-BQdfSw1B.js","assets/debug-registry-BUPLu5EA.js","assets/mount-ingest-root-9KaA9ETn.js","assets/active-ingest-CHE8woWv.js","assets/game-contract-seams-DOwrbA13.js","assets/capability-coverage-6I_iG0kk.js","assets/contract-system-adapters-D9Gcb7R7.js","assets/three-state-Cu8xEils.js","assets/editor-shell-store-Di0waLQj.js","assets/output-pass-HurwNl0G.js","assets/Pass-D1MRT672.js","assets/editor-layers-qlgroPbE.js","assets/entity-object-BeRdaaqQ.js","assets/three-contract-Dkt6PmWY.js","assets/module-mode-BWoDD0oV.js","assets/binding-resolver-aDFCbAcG.js","assets/native-debug-module-Cofo9dCU.js","assets/native-entry-surface-BE8LJNdu.js","assets/adapter-surface-Y37Nzcyw.js","assets/structural-signature-Dc7skRiy.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/realm-services-C8OlRuJ5.js","assets/three-ingest-runtime-Bqwv-JsZ.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/CSS3DRenderer-BsAqfavI.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-BHA-cdrW.js","assets/mount-manifest-BOiv1Hix.js","assets/create-runtime-D3CS8u84.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/setup-renderer-BI8Dltzx.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-CsCXKLaq.js","assets/render-features-CL2D1X_X.js","assets/seeded-random-BIdiJ8w9.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/performance-profiler-CMbwGBuk.js","assets/debug-bridge-LaiaWRls.js","assets/index-OZVqp6xS.js","assets/index-Da9JhEvW.js","assets/game-audio-BeCyd0Ha.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/live-project-verbs-CayyA6Tc.js","assets/edit-mode-authoring-Du1CaTkH.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/pixi-story-model-DNkfnWUV.js","assets/surface-content-Dg9Kkazf.js","assets/viewport-root-presentation-DPtVohIT.js","assets/mounted-authoring-30zCcxeV.js","assets/three-wsMw8Ifj.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three-authoring-adapter-DctJX96k.js","assets/three-projection-core-rOK39WmJ.js","assets/body-marks-C1LxJtQb.js","assets/structural-ids-BOo2BRoY.js","assets/object3d-authoring-subject-XccsO0xG.js","assets/r3f-physics-binding-mLmXPi7n.js","assets/deferred-ingest-play-DVLTxYCk.js","assets/rrweb-Cd2ifIRP.js","assets/react-world-authoring-adapter-DgsCzOTj.js","assets/board-guides-BVkDJqat.js","assets/relative-import-specifier-CPCtuEhc.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-CUNyIUii.js","assets/inference-diagnostics-PcfFN6SD.js","assets/writer-tw6EcuVO.js","assets/viewport-door-B7DJhMPS.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{u as An,p as Ar,S as Ir}from"./index-OZVqp6xS.js";import{decode as Q,encode as xr}from"./index-Da9JhEvW.js";import{Q as At,Z as In,Y as Rr,_ as $,e1 as xn,bA as Cr,p as Rn,M as Or,h3 as kr,m6 as Dr,m7 as Nr,m4 as Fr,m8 as jr,m9 as Br,bH as $r,bI as Gr,X as Cn,ma as On,bB as zr,bC as Ur,bE as kn,mb as Vr,V as Wr,mc as qr,bD as Hr,O as M,r as P,jb as Dn,md as Kr,me as Yr,mf as Jr,mg as X,aj as Xr,l8 as Nn,ah as Qr,bu as Me,jx as Zr,mh as es,at as Fn,mi as ts,aw as Xe,y as jn,aa as Ae,ko as Kt,mj as Bn,mk as $n,ml as Gn,kF as zn,hc as Un,q as ns,ku as rs,mm as ss,mn as os,mo as is,mp as as,mq as ls,gV as cs,go as us,aA as ds,bt as Vn,mr as fs,ms as Wn,m0 as ps,g4 as gs,bm as hs,bn as ms,e3 as ys,gQ as ws,mt as vs,gx as bs,ft as Ls}from"./index-iW3HFEJB.js";import{i as Es,b as Ss}from"./native-debug-module-Cofo9dCU.js";import{T as Ie,c as _s,g as Ms}from"./seeded-random-BIdiJ8w9.js";import{g as Qe,D as K}from"./debug-registry-BUPLu5EA.js";import{o as Ts}from"./game-audio-BeCyd0Ha.js";import{createRapierBodyEditing as Ps}from"./rapier-physics-adapter-CaZqWLu0.js";import{_ as As}from"./events-156d8d12.esm-CYeuVCYr.js";import{fo as Ve,dp as gt}from"./three.core-3arARmh6.js";import{b as qn,p as Hn}from"./live-project-verbs-CayyA6Tc.js";import{B as Yt}from"./edit-mode-authoring-Du1CaTkH.js";import{p as Kn,c as Is}from"./json-history-resource-82d2z68R.js";import{b as Yn}from"./binding-resolver-aDFCbAcG.js";import{i as xs,s as Rs}from"./editor-presentation-activity-CqJH4G9t.js";import{E as Jn,$ as Cs,a0 as Os,G as Xn,B as ht,l as We,a1 as ks,g as Ds}from"./active-ingest-CHE8woWv.js";import{m as Ns}from"./pixi-story-model-DNkfnWUV.js";import{t as Fs,d as js}from"./surface-content-Dg9Kkazf.js";import{p as Bs,l as $s}from"./viewport-root-presentation-DPtVohIT.js";import{assertNever as Gs}from"./adapter-surface-Y37Nzcyw.js";import{r as zs,o as Us,s as Vs}from"./three-authoring-adapter-DctJX96k.js";import{t as It}from"./three-contract-Dkt6PmWY.js";import{mountDeferredIngestForPlay as Ws,exitDeferredIngestPlay as qs}from"./deferred-ingest-play-DVLTxYCk.js";import{r as se}from"./rrweb-Cd2ifIRP.js";import{R as Hs,w as Ks}from"./react-world-authoring-adapter-DgsCzOTj.js";import{o as Ys}from"./three-state-Cu8xEils.js";import{p as Js}from"./viewport-door-B7DJhMPS.js";async function Xs(t){try{const e=await fetch(`${At}/log-session`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start",...t?{name:t}:{}})});return(await Rr(e,"Could not start a play log session")).file}catch{return null}}async function Qs(){try{const t=await fetch(`${At}/log-session`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"end"})});In(t,"Could not end the play log session")}catch{}}async function Qn(t){if(t.length===0)return!0;try{const e=await fetch(`${At}/log-entries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entries:t})});return In(e,"Could not flush play log entries"),!0}catch{return!1}}async function Zs(t){if(t.length===0)return;const{useGLTF:e,useTexture:n}=await $(async()=>{const{useGLTF:r,useTexture:s}=await import("./index-BU93FMYM.js");return{useGLTF:r,useTexture:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));for(const r of t)e.clear(r),n.clear(r)}const eo=60;function to(t){if(t.length===0)return{ms:null,fps:null,worstMs:null,samples:[]};let e=0,n=0;for(const s of t)e+=s,s>n&&(n=s);const r=e/t.length;return{ms:xe(r,2),fps:r>0?xe(1e3/r,1):null,worstMs:xe(n,2),samples:t.map(s=>xe(s,2))}}function xe(t,e){const n=10**e;return Math.round(t*n)/n}const no="No physics adapter on this game implements setDebugDrawEnabled, so nothing can draw its colliders. A first-party three root with Rapier physics registers one; a game with no physics has no colliders to draw.",Re=xn([]);function ro(t){const e=[];let n=Jt();const r=t.onRenderStep(()=>{const a=Jt();e.push(a-n),n=a,e.length>eo&&e.shift()});let s=!1;const o=()=>{const a=Rn(t.systemAdapters.physics);return a?.setDebugDrawEnabled?a:null};return{instruments:[{id:"timescale",label:"Time scale",hint:"Sim speed multiplier. 1 is real time, 0 freezes the simulation while the game keeps drawing.",unit:"x",control:{kind:"scale",action:"set",min:Ie.min,max:Ie.max,step:.05},actions:[{id:"set",label:"Set",hint:`Set the sim speed multiplier (${Ie.min}–${Ie.max}).`,args:xn([Cr()]),run:a=>(t.loop.timeScale=_s(a[0]),t.loop.timeScale)}],read:()=>t.loop.timeScale},{id:"paused",label:"Paused",hint:"Freeze the simulation. The game keeps drawing, so you can look at a frozen frame.",control:{kind:"toggle",action:"toggle"},actions:[{id:"toggle",label:"Toggle",hint:"Pause or resume the simulation.",args:Re,run:()=>(t.play.paused?t.play.resume():t.play.pause(),t.play.paused)},{id:"step",label:"Step",hint:"Advance exactly one fixed substep. Pauses first if the game is running.",args:Re,run:()=>(t.play.paused||t.play.pause(),t.play.step(),t.play.paused)}],read:()=>t.play.paused},{id:"colliders",label:"Colliders drawn",hint:"Draw the physics colliders over the world, through the game's own physics adapter.",control:{kind:"toggle",action:"toggle"},actions:[{id:"toggle",label:"Toggle",hint:"Turn collider wireframes on or off.",args:Re,run:()=>{const a=o();if(!a)throw new Error(no);return s=!s,a.setDebugDrawEnabled?.(s),s}}],read:()=>o()===null?null:s},{id:"frame-time",label:"Frame time",hint:"Wall-clock milliseconds per display frame, newest last. The window is where a hitch shows; the mean hides it.",unit:"ms",control:{kind:"plot"},actions:[{id:"clear",label:"Clear",hint:"Forget the sampled window and start measuring again.",args:Re,run:()=>(e.length=0,null)}],read:()=>to(e)}],dispose(){r(),e.length=0}}}function Jt(){return typeof performance>"u"?Date.now():performance.now()}const so="instruments",oo="__instruments__";function io(t){const e={name:`instrument.${t.id}`,id:t.id,label:t.label,hint:t.hint,...t.unit===void 0?{}:{unit:t.unit},control:t.control,actions:t.actions.map(n=>({name:`instrument.${t.id}.${n.id}`,id:n.id,label:n.label,hint:n.hint}))};try{return{...e,value:t.read()}}catch(n){return{...e,value:null,error:n instanceof Error?n.message:String(n)}}}function ao(t){const e=Qe(t);if(!e)throw new Error("Cannot publish dev instruments: mounted Game has no debug registry.");const n=ro(t),r=e.forRoot(oo);for(const s of n.instruments){r.registerStateProvider(`instrument.${s.id}`,()=>s.read(),{tier:"assisted"});for(const o of s.actions)r.registerCommand(`instrument.${s.id}.${o.id}`,{description:`${s.label}: ${o.label} — ${o.hint}`,locus:"client",args:o.args},(...i)=>o.run(i))}return r.registerStateProvider(so,()=>n.instruments.map(io),{tier:"assisted"}),()=>n.dispose()}function lo(t){if(!t||typeof t!="object")return!1;const e=t;return e.rigidBodyStates instanceof Map&&e.colliderStates instanceof Map&&e.world!==void 0&&e.rapier!==void 0}let Ce=null,co=null;function uo(){return Ce||(co??=(async()=>{if(!await Or()){Ce=As;return}const t=await import(kr);if(!(t.r3fRoots instanceof Map))throw new Error("The packaged runtime's synthetic R3F module did not export `r3fRoots` — see R3F_DOORWAY in vite-plugin-module-doorways.ts.");Ce=t.r3fRoots})(),null)}function ie(t){const e=uo();if(!e)return null;for(const n of e.values()){if(n.store.getState().scene!==t)continue;const r=n.fiber.current,s=r?[r]:[];for(;s.length>0;){const o=s.pop(),i=o.memoizedProps?.value;if(lo(i))return i;o.sibling&&s.push(o.sibling),o.child&&s.push(o.child)}}return null}function Fa(t,e=6e4){const n=performance.now();return new Promise(r=>{const s=()=>{if(ie(t))return r(!0);if(performance.now()-n>e)return r(!1);setTimeout(s,250)};s()})}function Xt(t,e){let n;for(const r of t)if(r.object.traverse(s=>{!n&&s.userData.entityId===e&&(n=s)}),n)return n}function Qt(t,e){const n=new Map;for(const r of e)n.set(r.object,r.rigidBody);for(let r=t;r;r=r.parent){const s=n.get(r);if(s)return s}}const U=t=>[t.x,t.y,t.z],me=t=>[t.x,t.y,t.z,t.w];function Zt(t,e){const{ShapeType:n}=t.rapier;switch(e.shapeType()){case n.Cuboid:return{type:"cuboid",halfExtents:U(e.halfExtents())};case n.Ball:return{type:"ball",radius:e.radius()};case n.Capsule:return{type:"capsule",halfHeight:e.halfHeight(),radius:e.radius()};default:return{type:"unsupported",kind:n[e.shapeType()]??`shapeType ${e.shapeType()}`}}}function fo(t,e){const{JointType:n}=t.rapier;switch(e){case n.Revolute:return"revolute";case n.Fixed:return"fixed";case n.Prismatic:return"prismatic";case n.Rope:return"rope";case n.Spring:return"spring";case n.Spherical:return"spherical";default:return"generic"}}function en(t,e){return U(new Ve(e.x,e.y,e.z).applyQuaternion(new gt(...me(t.rotation()))).add(new Ve(...U(t.translation()))))}function po(t,e){const n=e.body1(),r=e.body2(),s=e.anchor1(),o=e.anchor2(),i=fo(t,e.type()),a=i==="revolute"||i==="prismatic",l=a?e.frameX1():null,p=l?new Ve(1,0,0).applyQuaternion(new gt(l.x,l.y,l.z,l.w)):null,u=e;return{id:String(e.handle),type:i,body1:String(n.handle),body2:String(r.handle),anchor1:U(s),anchor2:U(o),worldAnchor1:en(n,s),worldAnchor2:en(r,o),body1Position:U(n.translation()),body2Position:U(r.translation()),body1Rotation:me(n.rotation()),body2Rotation:me(r.rotation()),...p?{axis:U(p),worldAxis:U(p.clone().applyQuaternion(new gt(...me(n.rotation()))))}:{},...a&&u.limitsEnabled()?{limits:{min:u.limitsMin(),max:u.limitsMax()}}:{},contactsEnabled:e.contactsEnabled()}}function go(t){const e=r=>{const s=ie(t);if(!s)return{kind:"unresolved"};const o=[...s.rigidBodyStates.values()],i=Xt(o,r);if(!i)return{kind:"unresolved"};const a=Qt(i,o);return a?{kind:"body",body:a}:{kind:"no-body"}},n=r=>{const s=ie(t);if(!s)return null;const o=[...s.rigidBodyStates.values()],i=Xt(o,r),a=i?Qt(i,o):void 0;return a?{context:s,body:a}:null};return{...Ps(e),colliders(r){const s=n(r);if(!s)return[];const o=[];for(const i of s.context.colliderStates.values()){if(i.collider.parent()?.handle!==s.body.handle)continue;i.object.updateWorldMatrix(!0,!1);const a=i.object.getWorldScale(new Ve);o.push({id:String(i.collider.handle),shape:Zt(s.context,i.collider),position:U(i.collider.translation()),rotation:me(i.collider.rotation()),scale:[Math.abs(a.x),Math.abs(a.y),Math.abs(a.z)],sensor:i.collider.isSensor()})}return o.sort((i,a)=>Number(i.id)-Number(a.id))},previewCollider(r,s){const o=ie(t),i=o?[...o.colliderStates.values()].find(a=>String(a.collider.handle)===r)?.collider:void 0;if(!(!o||!i||Zt(o,i).type!==s.type))switch(s.type){case"cuboid":i.setHalfExtents({x:s.halfExtents[0],y:s.halfExtents[1],z:s.halfExtents[2]});break;case"ball":i.setRadius(s.radius);break;case"capsule":i.setHalfHeight(s.halfHeight),i.setRadius(s.radius);break}},joints(r){const s=n(r);if(!s)return[];const o=[],i=s.context.world.impulseJoints;return i.forEachJointHandleAttachedToRigidBody(s.body.handle,a=>{const l=i.get(a);l&&o.push(po(s.context,l))}),o.sort((a,l)=>Number(a.id)-Number(l.id))},previewJointAnchor(r,s,o){const i=ie(t)?.world.impulseJoints.get(Number(r));if(!i)return;const a={x:o[0],y:o[1],z:o[2]};s===0?i.setAnchor1(a):i.setAnchor2(a)}}}const ho="__adapter__",tn=new WeakSet;function nn(t,e){const n=[];for(const r of t.roots){const s=r.binding?.observation[e];s&&n.push(s)}return n}function mo(t,e){return e.some(n=>n.slots.audio||n.absent.some(r=>r.slot==="audio"))?e:t.roots.map(n=>{const r=e.find(s=>s.rootId===n.id);return{rootId:n.id,slots:{...r?.slots,audio:Ts},absent:r?.absent??[]}})}const yo=["@colyseus/sdk","colyseus.js"];function wo(t,e){const n=e.some(u=>u.slots.networking||u.absent.some(f=>f.slot==="networking"));qn();const r=Hn(),s=r===null||r.some(u=>yo.includes(u)),o=t.roots[0];if(n||!s||!o)return e;const i=e.findIndex(u=>u.rootId===o.id),a=i>=0?e[i]:void 0,l={rootId:o.id,slots:{...a?.slots,networking:ca},absent:a?.absent??[]},p=[...e];return i>=0?p[i]=l:p.push(l),p}const vo=["@react-three/rapier","@dimforge/rapier3d-compat"];function bo(t,e){qn();const n=Hn(),r=n===null||n.some(o=>vo.includes(o)),s=[...e];for(const o of t.roots){if(o.mounted.kind!=="three"||o.mounted.systems?.physics)continue;const i=s.findIndex(f=>f.rootId===o.id),a=i>=0?s[i]:void 0;if(a&&(a.slots.physics||a.absent.some(f=>f.slot==="physics")))continue;const l=o.mounted.scene;if(!r&&!ie(l))continue;const p=go(l),u={rootId:o.id,slots:{...a?.slots,physics:p},absent:a?.absent??[]};i>=0?s[i]=u:s.push(u)}return s}function Lo(t,e,n){const r=e.forRoot(ho);for(const s of n){if(s.kind==="state"){r.registerStateProvider(s.id,()=>{if(!s.answer)throw new K("OBSERVATION_UNANSWERED",`Observation "${s.id}" (state) is declared by this game's adapter with no answer.`);return s.answer(t)},{tier:"assisted"});continue}r.registerCommand(s.id,{...s.description?{description:s.description}:{},locus:s.locus??"client"},(...o)=>{if(!s.answer)throw new K("OBSERVATION_UNANSWERED",`Observation "${s.id}" (command) is declared by this game's adapter with no answer.`);return s.answer(t,...o)})}}function ot(t,e){const n=t.actions(e);if(!Array.isArray(n))throw new Error("volter.adapter.ts input.actions must return an array.");const r=new Map;for(const s of n){if(typeof s?.name!="string"||s.name.length===0||!Nr.includes(s.valueType))throw new Error("volter.adapter.ts input.actions returned an invalid action; each action needs a non-empty `name` and a supported `valueType`.");if(r.has(s.name))throw new Error(`volter.adapter.ts input.actions returned duplicate action "${s.name}".`);r.set(s.name,s.valueType)}return r}function Eo(t,e){return t==="digital"?typeof e=="boolean":t==="scalar"?typeof e=="number"&&Number.isFinite(e):typeof e=="object"&&e!==null&&typeof e.x=="number"&&Number.isFinite(e.x)&&typeof e.y=="number"&&Number.isFinite(e.y)}function So(t,e,n){if(!t.world(n.root))throw new Error(`volter.adapter.ts input.root names "${n.root}", which is not a mounted manifest root.`);const r=[],s=[];let o=!1;const i=(f,d)=>{const c=ot(n,t).get(f);if(!c)throw new K("INPUT_ACTION_NOT_FOUND",`Adapter input has no action named "${f}".`,{registered:[...ot(n,t).keys()]});if(!Eo(c,d))throw new K("INPUT_ACTION_VALUE_TYPE",`Adapter input action "${f}" expects ${c}, not ${typeof d}.`,{action:f,expected:c});return c},a=(f,d,c)=>{i(f,d),n.set(t,f,d),o&&s.push({tick:c,action:f,value:d})},l=()=>{const f=e.getGameTick(),d=r.filter(c=>c.tick===f);if(d.length!==0){for(let c=r.length-1;c>=0;c--)r[c].tick===f&&r.splice(c,1);for(const c of d)a(c.action,c.value,f)}};t.systems.add("input",l,{name:"adapter.input"});const p=f=>{throw new K("ADAPTER_INPUT_SOURCE_UNSUPPORTED",`${f} addresses an engine test source, but this game declares an app-owned action store. Drive it by action name instead.`)},u={setVirtualAction(f,d){return a(f,d,e.getGameTick()),{delivered:!0}},tapVirtualAction(f){const d=e.getGameTick();return a(f,!0,d),r.push({tick:d+1,action:f,value:!1}),{delivered:!0}},clearVirtualActions(){r.length=0,n.clear(t)},scheduleActionAtTick(f,d,c){const h=e.getGameTick();if(!Number.isInteger(f)||f<h)throw new K("TICK_ALREADY_PASSED",`Cannot schedule adapter input for tick ${f}; current tick is ${h}.`,{tick:f,currentTick:h});i(d,c),r.push({tick:f,action:d,value:c})},startInputRecording(){s.length=0,o=!0},stopInputRecording(){o=!1},isInputRecording(){return o},injectAxis(){p("injectAxis")},injectVector2(){p("injectVector2")},injectPointerDelta(){p("injectPointerDelta")},injectPointerPosition(){p("injectPointerPosition")}};e.setInputActionsSource(n.root,()=>[...ot(n,t)].map(([f,d])=>({name:f,valueType:d}))),e.setInputTraceSource(n.root,()=>({version:1,seed:null,fixedDt:t.loop.fixedDt,ticks:[...s]})),e.setVirtualInputTarget(n.root,u)}function Zn(t){if(tn.has(t))return;Es(t,nn(t,"entryDebug")),Ss(t,wo(t,bo(t,mo(t,nn(t,"entrySystems"))))),ao(t);const e=Qe(t);if(!e)throw new Error("Cannot install adapter runtime bindings: mounted Game has no debug registry.");t.roots.some(s=>s.mounted.systems?.debug!==void 0&&s.mounted.systems.debug!==e.adapter)||Lo(t,e,Fr());const r=Dr();r&&So(t,e,r),tn.add(t)}let m=(function(t){return t.info="info",t.warn="warn",t.error="error",t.debug="debug",t.trace="trace",t.fatal="fatal",t})({});const ue={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},er=Symbol.for("loglayer.lazy"),xt="[LazyEvalError]";function le(t){return t!=null&&typeof t=="object"&&er in t}function rn(t){let e=0;for(const n of Object.keys(t))le(t[n])&&e++;return e}function it(t){let e=!1;for(const s of Object.keys(t))if(le(t[s])){e=!0;break}if(!e)return{resolved:t,errors:null};const n={};let r=null;for(const s of Object.keys(t)){const o=t[s];if(le(o))try{n[s]=o[er]()}catch(i){n[s]=xt,r||(r=[]),r.push({key:s,error:i})}else n[s]=o}return{resolved:n,errors:r}}function _o(t){for(const e of Object.keys(t))if(t[e]instanceof Promise)return!0;return!1}function sn(t){let e=null;const n={};for(const r of Object.keys(t))t[r]instanceof Promise?(n[r]=xt,e||(e=[]),e.push(r)):n[r]=t[r];return e?{resolved:n,asyncKeys:e}:{resolved:t,asyncKeys:null}}async function Mo(t){const e=Object.keys(t),n=await Promise.allSettled(e.map(o=>Promise.resolve(t[o]))),r={};let s=null;for(let o=0;o<e.length;o++){const i=n[o];i.status==="fulfilled"?r[e[o]]=i.value:(r[e[o]]=xt,s||(s=[]),s.push({key:e[o],error:i.reason}))}return{resolved:r,errors:s}}function B(t){const e=t[0];if(Array.isArray(e)&&typeof e.raw<"u"){const n=e,r=t.slice(1);let s="";for(let o=0;o<n.length;o++)s+=n[o],o<r.length&&(s+=String(r[o]));return[s]}return t}let C=(function(t){return t.transformLogLevel="transformLogLevel",t.onBeforeDataOut="onBeforeDataOut",t.shouldSendToLogger="shouldSendToLogger",t.onMetadataCalled="onMetadataCalled",t.onBeforeMessageOut="onBeforeMessageOut",t.onContextCalled="onContextCalled",t})({});var To=class tr{context={};hasContext=!1;setContext(e){if(!e){this.context={},this.hasContext=!1;return}this.context=e,this.hasContext=!0}appendContext(e){this.context={...this.context,...e},this.hasContext=!0}getContext(){return this.context}hasContextData(){return this.hasContext}clearContext(e){if(e===void 0){this.context={},this.hasContext=!1;return}const n=Array.isArray(e)?e:[e];for(const r of n)delete this.context[r];this.hasContext=Object.keys(this.context).length>0}onChildLoggerCreated({parentContextManager:e,childContextManager:n}){if(e.hasContextData()){const r=e.getContext();n.setContext({...r})}}clone(){const e=new tr;return e.setContext({...this.context}),e.hasContext=this.hasContext,e}},Po=class mt{logLevelEnabledStatus={info:!0,warn:!0,error:!0,debug:!0,trace:!0,fatal:!0};setLevel(e){const n=ue[e];for(const r of Object.values(m)){const s=r,o=ue[r];this.logLevelEnabledStatus[s]=o>=n}}enableIndividualLevel(e){const n=e;n in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[n]=!0)}disableIndividualLevel(e){const n=e;n in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[n]=!1)}isLevelEnabled(e){const n=e;return this.logLevelEnabledStatus[n]}enableLogging(){for(const e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!0}disableLogging(){for(const e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!1}onChildLoggerCreated({parentLogLevelManager:e,childLogLevelManager:n}){const r=e.logLevelEnabledStatus;n instanceof mt&&(n.logLevelEnabledStatus={...r})}clone(){const e=new mt;return e.logLevelEnabledStatus={...this.logLevelEnabledStatus},e}},Ao=class{id;enabled;level;consoleDebug;constructor(t){this.id=t.id??Date.now().toString()+Math.random().toString(),this.enabled=t.enabled??!0,this.consoleDebug=t.consoleDebug??!1,this.level=t.level??"trace"}_sendToLogger(t){if(!this.enabled||ue[t.logLevel]<ue[this.level])return;const e=this.shipToLogger(t);if(this.consoleDebug)switch(t.logLevel){case m.info:console.info(...e);break;case m.warn:console.warn(...e);break;case m.error:console.error(...e);break;case m.trace:console.debug(...e);break;case m.debug:console.debug(...e);break;case m.fatal:console.debug(...e);break;default:console.log(...e)}}getLoggerInstance(){throw new Error("This transport does not have a logger instance")}},Io={};const xo=[C.onBeforeDataOut,C.onMetadataCalled,C.onBeforeMessageOut,C.transformLogLevel,C.shouldSendToLogger,C.onContextCalled];var on=class{idToPlugin;transformLogLevel=[];onBeforeDataOut=[];shouldSendToLogger=[];onMetadataCalled=[];onBeforeMessageOut=[];onContextCalled=[];constructor(t){this.idToPlugin={},this.mapPlugins(t),this.indexPlugins()}mapPlugins(t){for(const e of t){if(e.id||(e.id=Date.now().toString()+Math.random().toString()),this.idToPlugin[e.id])throw new Error(`[LogLayer] Plugin with id ${e.id} already exists.`);e.registeredAt=Date.now(),this.idToPlugin[e.id]=e}}indexPlugins(){this.transformLogLevel=[],this.onBeforeDataOut=[],this.shouldSendToLogger=[],this.onMetadataCalled=[],this.onBeforeMessageOut=[],this.onContextCalled=[];const t=Object.values(this.idToPlugin).sort((e,n)=>e.registeredAt-n.registeredAt);for(const e of t){if(e.disabled)return;for(const n of xo)e[n]&&e.id&&this[n].push(e.id)}}hasPlugins(t){return this[t].length>0}countPlugins(t){return t?this[t].length:Object.keys(this.idToPlugin).length}addPlugins(t){this.mapPlugins(t),this.indexPlugins()}enablePlugin(t){const e=this.idToPlugin[t];e&&(e.disabled=!1),this.indexPlugins()}disablePlugin(t){const e=this.idToPlugin[t];e&&(e.disabled=!0),this.indexPlugins()}removePlugin(t){delete this.idToPlugin[t],this.indexPlugins()}runTransformLogLevel(t,e){let n=null;for(const r of this.transformLogLevel){const s=this.idToPlugin[r];if(s.transformLogLevel){const o=s.transformLogLevel({data:t.data,logLevel:t.logLevel,messages:t.messages,error:t.error,metadata:t.metadata,context:t.context,groups:t.groups,schema:t.schema,prefix:t.prefix},e);o!=null&&o!==!1&&(n=o)}}return n!=null&&n!==!1?n:t.logLevel}runOnBeforeDataOut(t,e){const n={...t},r=n.data;for(const s of this.onBeforeDataOut){const o=this.idToPlugin[s];if(o.onBeforeDataOut){const i=o.onBeforeDataOut({data:n.data,logLevel:n.logLevel,error:n.error,metadata:n.metadata,context:n.context,groups:n.groups,schema:n.schema,prefix:n.prefix},e);i&&(n.data||(n.data={}),i!==r&&Object.assign(n.data,i))}}return n.data}runShouldSendToLogger(t,e){return!this.shouldSendToLogger.some(n=>!this.idToPlugin[n].shouldSendToLogger?.(t,e))}runOnMetadataCalled(t,e){let n={...t};for(const r of this.onMetadataCalled){const s=this.idToPlugin[r].onMetadataCalled?.(n,e);if(s)n=s;else return null}return n}runOnBeforeMessageOut(t,e){let n=[...t.messages];for(const r of this.onBeforeMessageOut){const s=this.idToPlugin[r].onBeforeMessageOut?.({messages:n,logLevel:t.logLevel,groups:t.groups,schema:t.schema,prefix:t.prefix},e);s&&(n=s)}return n}runOnContextCalled(t,e){let n={...t};for(const r of this.onContextCalled){const s=this.idToPlugin[r].onContextCalled?.(n,e);if(s)n=s;else return null}return n}},Ro=class nr{pluginManager;idToTransport;hasMultipleTransports;singleTransport;contextManager;logLevelManager;_isLoggingLazyError=!1;_lazyContextCount=0;_assignedGroups=null;_groupsConfig=null;_activeGroups=null;_ungroupedBehavior="all";_config;constructor(e){this._config={...e,enabled:e.enabled??!0},this.contextManager=new To,this.logLevelManager=new Po,this._config.enabled||this.disableLogging();const n=[...e.plugins||[],...ye.pluginsToInit];this.pluginManager=new on(n),this._config.errorFieldName||(this._config.errorFieldName="err"),this._config.copyMsgOnOnlyError||(this._config.copyMsgOnOnlyError=!1),this._initializeTransports(this._config.transport),this._groupsConfig=e.groups?{...e.groups}:null,this._ungroupedBehavior=e.ungroupedBehavior??"all",this._activeGroups=e.activeGroups?new Set(e.activeGroups):null,this._parseEnvGroups(),ye.logLayerHandlers.length>0&&ye.logLayerHandlers.forEach(r=>{r.onConstruct&&r.onConstruct(this,e)})}withContextManager(e){return this.contextManager&&typeof this.contextManager[Symbol.dispose]=="function"&&this.contextManager[Symbol.dispose](),this.contextManager=e,this._lazyContextCount=e.hasContextData()?rn(e.getContext()):0,this}getContextManager(){return this.contextManager}withLogLevelManager(e){return this.logLevelManager&&typeof this.logLevelManager[Symbol.dispose]=="function"&&this.logLevelManager[Symbol.dispose](),this.logLevelManager=e,this}getLogLevelManager(){return this.logLevelManager}getConfig(){return this._config}_initializeTransports(e){if(this.idToTransport)for(const n in this.idToTransport)this.idToTransport[n]&&typeof this.idToTransport[n][Symbol.dispose]=="function"&&this.idToTransport[n][Symbol.dispose]();this.hasMultipleTransports=Array.isArray(e)&&e.length>1,this.singleTransport=this.hasMultipleTransports?null:Array.isArray(e)?e[0]:e,Array.isArray(e)?this.idToTransport=e.reduce((n,r)=>(n[r.id]=r,n),{}):this.idToTransport={[e.id]:e}}withPrefix(e){const n=this.child();return n._config.prefix=e,n}withGroup(e){const n=this.child(),r=Array.isArray(e)?e:[e];if(n._assignedGroups){const s=new Set([...n._assignedGroups,...r]);n._assignedGroups=Array.from(s)}else n._assignedGroups=[...r];return n}addGroup(e,n){return this._groupsConfig||(this._groupsConfig={}),this._groupsConfig[e]={...n},this}removeGroup(e){return this._groupsConfig&&(delete this._groupsConfig[e],Object.keys(this._groupsConfig).length===0&&(this._groupsConfig=null)),this}enableGroup(e){return this._groupsConfig?.[e]&&(this._groupsConfig[e]={...this._groupsConfig[e],enabled:!0}),this}disableGroup(e){return this._groupsConfig?.[e]&&(this._groupsConfig[e]={...this._groupsConfig[e],enabled:!1}),this}setGroupLevel(e,n){return this._groupsConfig?.[e]&&(this._groupsConfig[e]={...this._groupsConfig[e],level:n}),this}setActiveGroups(e){return this._activeGroups=e?new Set(e):null,this}getGroups(){return this._groupsConfig?{...this._groupsConfig}:{}}withContext(e){let n=e;if(!e)return this._config.consoleDebug&&console.debug("[LogLayer] withContext was called with no context; dropping."),this;if(this.pluginManager.hasPlugins(C.onContextCalled)&&(n=this.pluginManager.runOnContextCalled(e,this),!n))return this._config.consoleDebug&&console.debug("[LogLayer] Context was dropped due to plugin returning falsy value."),this;const r=this.contextManager.getContext();for(const s of Object.keys(n)){const o=s in r&&le(r[s]),i=le(n[s]);!o&&i?this._lazyContextCount++:o&&!i&&this._lazyContextCount--}return this.contextManager.appendContext(n),this}clearContext(e){if(e!==void 0&&this._lazyContextCount>0){const n=this.contextManager.getContext(),r=Array.isArray(e)?e:[e];for(const s of r)s in n&&le(n[s])&&this._lazyContextCount--}else e===void 0&&(this._lazyContextCount=0);return this.contextManager.clearContext(e),this}getContext(e){const n=this.contextManager.getContext();if(e?.raw||this._lazyContextCount===0)return n;const{resolved:r,errors:s}=it(n);s&&this._logLazyEvalErrors(s,"context");const{resolved:o,asyncKeys:i}=sn(r);return i&&this._logAsyncLazyContextErrors(i),o}addPlugins(e){this.pluginManager.addPlugins(e)}enablePlugin(e){this.pluginManager.enablePlugin(e)}disablePlugin(e){this.pluginManager.disablePlugin(e)}removePlugin(e){this.pluginManager.removePlugin(e)}withMetadata(e){return new an(this).withMetadata(e)}withError(e){return new an(this).withError(e)}child(){const e=new nr({...this._config,transport:Array.isArray(this._config.transport)?[...this._config.transport]:this._config.transport}).withPluginManager(this.pluginManager).withContextManager(this.contextManager.clone()).withLogLevelManager(this.logLevelManager.clone());return this.contextManager.onChildLoggerCreated({parentContextManager:this.contextManager,childContextManager:e.contextManager,parentLogger:this,childLogger:e}),this.logLevelManager.onChildLoggerCreated({parentLogLevelManager:this.logLevelManager,childLogLevelManager:e.logLevelManager,parentLogger:this,childLogger:e}),e._lazyContextCount=e.contextManager.hasContextData()?rn(e.contextManager.getContext()):0,e._groupsConfig=this._groupsConfig,e._activeGroups=this._activeGroups,e._ungroupedBehavior=this._ungroupedBehavior,e._assignedGroups=this._assignedGroups?[...this._assignedGroups]:null,e}withFreshTransports(e){return this._config.transport=e,this._initializeTransports(e),this}addTransport(e){const n=Array.isArray(e)?e:[e],r=Array.isArray(this._config.transport)?this._config.transport:[this._config.transport],s=new Set(n.map(i=>i.id));for(const i of n){const a=this.idToTransport[i.id];a&&typeof a[Symbol.dispose]=="function"&&a[Symbol.dispose]()}const o=[...r.filter(i=>!s.has(i.id)),...n];this._config.transport=o;for(const i of n)this.idToTransport[i.id]=i;return this.hasMultipleTransports=o.length>1,this.singleTransport=this.hasMultipleTransports?null:o[0],this}removeTransport(e){const n=this.idToTransport[e];if(!n)return!1;typeof n[Symbol.dispose]=="function"&&n[Symbol.dispose](),delete this.idToTransport[e];const r=(Array.isArray(this._config.transport)?this._config.transport:[this._config.transport]).filter(s=>s.id!==e);return this._config.transport=r.length===1?r[0]:r,this.hasMultipleTransports=r.length>1,this.singleTransport=this.hasMultipleTransports?null:r[0]||null,!0}withFreshPlugins(e){return this._config.plugins=e,this.pluginManager=new on(e),this}withPluginManager(e){return this.pluginManager=e,this}errorOnly(e,n){const r=n?.logLevel||m.error;if(!this.isLevelEnabled(r))return;const{copyMsgOnOnlyError:s}=this._config,o={logLevel:r,err:e};(s&&n?.copyMsg!==!1||n?.copyMsg===!0)&&e?.message&&(o.params=[e.message]),this._formatLog(o)}metadataOnly(e,n=m.info){if(!this.isLevelEnabled(n))return;const{muteMetadata:r,consoleDebug:s}=this._config;if(r)return;if(!e){s&&console.debug("[LogLayer] metadataOnly was called with no metadata; dropping.");return}let o=e;if(this.pluginManager.hasPlugins(C.onMetadataCalled)&&(o=this.pluginManager.runOnMetadataCalled(e,this),!o)){s&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value.");return}const i={logLevel:n,metadata:o};return this._formatLog(i)}info(...e){if(!this.isLevelEnabled(m.info))return;const n=B(e);this._formatMessage(n),this._formatLog({logLevel:m.info,params:n})}warn(...e){if(!this.isLevelEnabled(m.warn))return;const n=B(e);this._formatMessage(n),this._formatLog({logLevel:m.warn,params:n})}error(...e){if(!this.isLevelEnabled(m.error))return;const n=B(e);this._formatMessage(n),this._formatLog({logLevel:m.error,params:n})}debug(...e){if(!this.isLevelEnabled(m.debug))return;const n=B(e);this._formatMessage(n),this._formatLog({logLevel:m.debug,params:n})}trace(...e){if(!this.isLevelEnabled(m.trace))return;const n=B(e);this._formatMessage(n),this._formatLog({logLevel:m.trace,params:n})}fatal(...e){if(!this.isLevelEnabled(m.fatal))return;const n=B(e);this._formatMessage(n),this._formatLog({logLevel:m.fatal,params:n})}raw(e){if(!this.isLevelEnabled(e.logLevel))return;const n={logLevel:e.logLevel,params:e.messages,metadata:e.metadata,rootData:e.rootData,err:e.error,context:e.context};return this._formatMessage(e.messages),this._formatLog(n)}disableLogging(){return this.logLevelManager.disableLogging(),this}enableLogging(){return this.logLevelManager.enableLogging(),this}muteContext(){return this._config.muteContext=!0,this}unMuteContext(){return this._config.muteContext=!1,this}muteMetadata(){return this._config.muteMetadata=!0,this}unMuteMetadata(){return this._config.muteMetadata=!1,this}enableIndividualLevel(e){return this.logLevelManager.enableIndividualLevel(e),this}disableIndividualLevel(e){return this.logLevelManager.disableIndividualLevel(e),this}setLevel(e){return this.logLevelManager.setLevel(e),this}isLevelEnabled(e){return this.logLevelManager.isLevelEnabled(e)}formatContext(e){const{contextFieldName:n,muteContext:r}=this._config;return e&&Object.keys(e).length>0&&!r?n?{[n]:{...e}}:{...e}:{}}formatMetadata(e=null){const{metadataFieldName:n,muteMetadata:r}=this._config;return e&&!r?n?{[n]:{...e}}:{...e}:{}}getLoggerInstance(e){const n=this.idToTransport[e];if(n)return n.getLoggerInstance()}_parseEnvGroups(){const e=typeof process<"u"?Io?.LOGLAYER_GROUPS:void 0;if(!e)return;const n=e.split(",").map(s=>s.trim()).filter(Boolean),r=[];for(const s of n){const o=s.indexOf(":");if(o>0){const i=s.slice(0,o),a=s.slice(o+1);r.push(i),this._groupsConfig?.[i]&&(this._groupsConfig[i]={...this._groupsConfig[i],level:a})}else r.push(s)}this._activeGroups=new Set(r)}_mergeGroups(e){if(this._assignedGroups&&e){const n=new Set([...this._assignedGroups,...e]);return Array.from(n)}return e||this._assignedGroups}_applyUngroupedRules(e){return this._ungroupedBehavior==="all"?!0:this._ungroupedBehavior==="none"?!1:this._ungroupedBehavior.includes(e)}_shouldTransportReceiveLog(e,n,r){if(!this._groupsConfig)return!0;const s=this._mergeGroups(r);if(!s||s.length===0)return this._applyUngroupedRules(e);let o=!1;for(const i of s){const a=this._groupsConfig[i];if(a&&(o=!0,a.enabled!==!1&&!(this._activeGroups&&!this._activeGroups.has(i)))){if(a.level){const l=ue[a.level];if(ue[n]<l)continue}if(a.transports.includes(e))return!0}}return o?!1:this._applyUngroupedRules(e)}_formatMessage(e=[]){const{prefix:n}=this._config;n&&typeof e[0]=="string"&&(e[0]=`${n} ${e[0]}`)}_formatLog({logLevel:e,params:n=[],metadata:r=null,rootData:s=null,err:o,context:i=null,groups:a=null}){const l=i!==null?i:this.contextManager.getContext();let p;if(this._lazyContextCount>0||i!==null){const f=it(l);f.errors&&this._logLazyEvalErrors(f.errors,"context");const{resolved:d,asyncKeys:c}=sn(f.resolved);c&&this._logAsyncLazyContextErrors(c),p=d}else p=l;let u=null;if(r){const f=it(r);r=f.resolved,u=f.errors}if(u&&this._logLazyEvalErrors(u,"metadata"),r&&_o(r))return this._resolveAsyncAndProcess(e,n,p,r,s,o,i,a);this._processLog(e,n,p,r,s,o,i,a)}async _resolveAsyncAndProcess(e,n,r,s,o,i,a,l){let p=null;if(s){const u=await Mo(s);p=u.resolved,u.errors&&this._logLazyEvalErrors(u.errors,"metadata")}this._processLog(e,n,r,p,o,i,a,l)}_logLazyEvalErrors(e,n){if(this._isLoggingLazyError){for(const r of e)console.error(`[LogLayer] Lazy evaluation error in ${n} key "${r.key}":`,r.error);return}this._isLoggingLazyError=!0;try{for(const r of e){const s=r.error instanceof Error?r.error.message:String(r.error);this._processLog(m.error,[`[LogLayer] Lazy evaluation failed for ${n} key "${r.key}": ${s}`],{},null,null,r.error instanceof Error?r.error:void 0,{})}}finally{this._isLoggingLazyError=!1}}_logAsyncLazyContextErrors(e){if(this._isLoggingLazyError){for(const n of e)console.error(`[LogLayer] Async lazy values are not supported in context (key "${n}"). Use async lazy only in metadata.`);return}this._isLoggingLazyError=!0;try{for(const n of e)this._processLog(m.error,[`[LogLayer] Async lazy values are not supported in context (key "${n}"). Use async lazy only in metadata.`],{},null,null,void 0,{})}finally{this._isLoggingLazyError=!1}}_processLog(e,n,r,s,o,i,a,l=null){const{errorSerializer:p,errorFieldInMetadata:u,muteContext:f,contextFieldName:d,metadataFieldName:c,errorFieldName:h,prefix:E}=this._config,v={contextFieldName:d??void 0,metadataFieldName:c??void 0,errorFieldName:h??"err"},S=this._mergeGroups(l)??void 0;let y=!!s||(f?!1:a!==null?Object.keys(a).length>0:this.contextManager.hasContextData()),w={};if(y)if(d&&d===c){const _=this.formatContext(r)[d],T=this.formatMetadata(s)[c];w={[d]:{..._,...T}}}else w={...this.formatContext(r),...this.formatMetadata(s)};if(i){const _=p?p(i):i;u&&s&&c?w?.[c]?w[c][h]=_:w={...w,[c]:{[h]:_}}:u&&!s&&c?w={...w,[c]:{[h]:_}}:w={...w,[h]:_},y=!0}o&&Object.keys(o).length>0&&(w={...w,...o},y=!0),this.pluginManager.hasPlugins(C.onBeforeDataOut)&&(w=this.pluginManager.runOnBeforeDataOut({data:y?w:void 0,logLevel:e,error:i,metadata:s,context:r,groups:S,schema:v,prefix:E},this),w&&!y&&(y=!0)),this.pluginManager.hasPlugins(C.onBeforeMessageOut)&&(n=this.pluginManager.runOnBeforeMessageOut({messages:[...n],logLevel:e,groups:S,schema:v,prefix:E},this)),this.pluginManager.hasPlugins(C.transformLogLevel)&&(e=this.pluginManager.runTransformLogLevel({data:y?w:void 0,logLevel:e,messages:[...n],error:i,metadata:s,context:r,groups:S,schema:v,prefix:E},this));const k={data:y?w:void 0,error:i,metadata:s,context:r,groups:S,schema:v,prefix:E};if(this.hasMultipleTransports){const _=this._config.transport.filter(T=>!(!T.enabled||!this._shouldTransportReceiveLog(T.id,e,S))).map(async T=>{const D=e;if(!(this.pluginManager.hasPlugins(C.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...n],logLevel:D,transportId:T.id,...k},this)))return T._sendToLogger({logLevel:D,messages:[...n],hasData:y,...k})});Promise.all(_).catch(T=>{this._config.consoleDebug&&console.error("[LogLayer] Error executing transports:",T)})}else{if(!this.singleTransport?.enabled||!this._shouldTransportReceiveLog(this.singleTransport.id,e,S)||this.pluginManager.hasPlugins(C.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...n],logLevel:e,transportId:this.singleTransport.id,...k},this))return;this.singleTransport._sendToLogger({logLevel:e,messages:[...n],hasData:y,...k})}}};const ye={logLayerHandlers:[],pluginsToInit:[],logBuilderHandlers:[]};var an=class{err;metadata;structuredLogger;hasMetadata;pluginManager;_groups=null;constructor(t){this.err=null,this.metadata={},this.structuredLogger=t,this.hasMetadata=!1,this.pluginManager=t.pluginManager,ye.logBuilderHandlers.length>0&&ye.logBuilderHandlers.forEach(e=>{e.onConstruct&&e.onConstruct(this,t)})}withMetadata(t){const{pluginManager:e,structuredLogger:{_config:{consoleDebug:n}}}=this;if(!t)return n&&console.debug("[LogLayer] withMetadata was called with no metadata; dropping."),this;let r=t;return e.hasPlugins(C.onMetadataCalled)&&(r=e.runOnMetadataCalled(t,this.structuredLogger),!r)?(n&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value."),this):(this.metadata={...this.metadata,...r},this.hasMetadata=!0,this)}withError(t){return this.err=t,this}withGroup(t){const e=Array.isArray(t)?t:[t];if(this._groups){const n=new Set([...this._groups,...e]);this._groups=Array.from(n)}else this._groups=[...e];return this}info(...t){if(!this.structuredLogger.isLevelEnabled(m.info))return;const e=B(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.info,e)}warn(...t){if(!this.structuredLogger.isLevelEnabled(m.warn))return;const e=B(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.warn,e)}error(...t){if(!this.structuredLogger.isLevelEnabled(m.error))return;const e=B(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.error,e)}debug(...t){if(!this.structuredLogger.isLevelEnabled(m.debug))return;const e=B(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.debug,e)}trace(...t){if(!this.structuredLogger.isLevelEnabled(m.trace))return;const e=B(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.trace,e)}fatal(...t){if(!this.structuredLogger.isLevelEnabled(m.fatal))return;const e=B(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.fatal,e)}disableLogging(){return this.structuredLogger.disableLogging(),this}enableLogging(){return this.structuredLogger.enableLogging(),this}formatLog(t,e){const{muteMetadata:n}=this.structuredLogger._config,r=n?!1:this.hasMetadata;return this.structuredLogger._formatLog({logLevel:t,params:e,metadata:r?this.metadata:null,err:this.err,groups:this._groups})}},Co=class extends Ao{shipToLoggerFn;constructor(t){super(t),this.shipToLoggerFn=t.shipToLogger}shipToLogger(t){return this.shipToLoggerFn(t)}};let yt=!1;const Oo={trace:"log",debug:"log",info:"log",warn:"warn",error:"error",fatal:"error"},Rt=new Ro({transport:new Co({shipToLogger:({logLevel:t,messages:e,data:n,hasData:r})=>{const s=Oo[t]??"log";let o,i;if(r&&n){const{_sub:a,...l}=n;o=a?String(a):void 0,Object.keys(l).length>0&&(i=l)}return yt=!0,i?console[s](...e,i):console[s](...e),yt=!1,typeof window<"u"&&window.postMessage({type:"engine-log",level:t,message:e.join(" "),subsystem:o,metadata:i,timestamp:Date.now()},"*"),e}}),prefix:"[engine]"});Rt.setLevel(m.info);typeof window<"u"&&(window.setEngineLogLevel=t=>{Rt.setLevel(t)});if(typeof window<"u"){const t=new URLSearchParams(window.location.search).get("engineLogLevel");t&&Rt.setLevel(t)}const ko=4,Do=1e4;async function No(t,e,n,r){const s=t.getRunTicksTarget();if(s===null)throw new K("RUN_TICKS_UNAVAILABLE","runTicksWhenSettled: no run-ticks target is wired — no Game has mounted yet");const o=Do,i=ko,a=n?.render??"last";for(let l=0;l<e;l++){if(!t.worldSettled()){const f=Date.now()+o;for(;!t.worldSettled();){if(Date.now()>f)throw new K("WORLD_UNSETTLED_TIMEOUT",`runTicksWhenSettled: a world-settled probe still answers false after ${o}ms — a scene remount (or a broken probe) is stuck, and driving ticks into it would race it`);await new Promise(d=>setTimeout(d,i))}}const p=l===e-1,u=a==="all"?"all":a==="none"?"none":p?"last":"none";s.runTicks(1,{render:u})}}const Fo="fit",rr=[{id:Fo,label:"Fit panel",kind:"fit",width:null,height:null,dpr:null,safeArea:null},{id:"iphone-portrait",label:"iPhone 14 — 390×844 @3x",kind:"phone",width:390,height:844,dpr:3,safeArea:{top:47,right:0,bottom:34,left:0}},{id:"iphone-landscape",label:"iPhone 14 landscape — 844×390 @3x",kind:"phone",width:844,height:390,dpr:3,safeArea:{top:0,right:47,bottom:21,left:47}},{id:"android-portrait",label:"Android — 412×915 @2.6x",kind:"phone",width:412,height:915,dpr:2.6,safeArea:{top:24,right:0,bottom:24,left:0}},{id:"ipad-portrait",label:"iPad — 820×1180 @2x",kind:"tablet",width:820,height:1180,dpr:2,safeArea:{top:24,right:0,bottom:20,left:0}},{id:"desktop-1080p",label:"Desktop — 1920×1080 @1x",kind:"desktop",width:1920,height:1080,dpr:1,safeArea:null}],Ct=rr[0];function sr(t){return rr.find(e=>e.id===t)??Ct}let O=Ct,te=null,or=0;const wt=new Set;function Ot(){or++;for(const t of wt)t()}function ja(t){return wt.add(t),()=>{wt.delete(t)}}const Ba=()=>or;function $a(){return O}function ir(){return te??(O.kind==="phone"||O.kind==="tablet")}function Ga(t){const e=sr(t);e!==O&&(O=e,te=null,ar(),Ot())}function za(t){t!==te&&(te=t,ar(),Ot())}function jo(){return O.dpr}function Ua(){return Math.min(typeof window<"u"&&window.devicePixelRatio||1,2)}function ar(){jr({devicePreview:{preset:O.id,touch:te}})}function Va(){const t=Br().devicePreview;return t?.preset?(O=sr(t.preset),te=typeof t.touch=="boolean"?t.touch:null):(O=Ct,te=null),Ot(),O}const ln=["pointerdown","pointermove","pointerup","pointercancel"],cn=new WeakSet;let vt=null,at=null;function un(t){if(!ir()||cn.has(t)||!(t instanceof PointerEvent)||t.pointerType!=="mouse")return;const e=t.target;if(!e)return;t.stopImmediatePropagation();const n=new PointerEvent(t.type,{bubbles:!0,cancelable:t.cancelable,composed:!0,view:t.view,detail:t.detail,clientX:t.clientX,clientY:t.clientY,screenX:t.screenX,screenY:t.screenY,button:t.button,buttons:t.buttons,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,pointerId:t.pointerId,pointerType:"touch",isPrimary:!0,pressure:t.type==="pointerup"||t.type==="pointercancel"?0:Math.max(t.pressure,.5),width:20,height:20});cn.add(n),e.dispatchEvent(n),n.defaultPrevented&&t.preventDefault()}function Bo(t){if(t!==vt&&(at?.(),at=null,vt=t,!!t)){for(const e of ln)t.addEventListener(e,un,{capture:!0});at=()=>{for(const e of ln)t.removeEventListener(e,un,{capture:!0})}}}function Wa(t){vt===t&&Bo(null)}function $o(){return{presetId:O.id,presetLabel:O.label,dpr:O.dpr,safeArea:O.safeArea,touchActive:ir()}}typeof window<"u"&&(window.__volterDevicePreview=$o);const Go=15e3;function zo(t,e,n){const r=n?` (open ${n})`:"";return`Play start stalled at "${t}" for ${Math.round(e/1e3)}s and the editor tab is HIDDEN — a backgrounded tab has its network requests deprioritized by the browser, so this step is queued rather than broken. Bring the editor tab to the foreground${r} and run play again; the engine loop itself is hidden-safe, only the boot's fetches are starved.`}function Uo(t,e,n){const r=n.stallMs??Go,s=n.setTimer??((i,a)=>setTimeout(i,a)),o=n.clearTimer??(i=>clearTimeout(i));return new Promise((i,a)=>{let l=!1;const p=s(()=>{l||n.isHidden()&&(l=!0,a(new Error(zo(t,r,n.editorUrl))))},r);e.then(u=>{l||(l=!0,o(p),i(u))},u=>{l||(l=!0,o(p),a(u instanceof Error?u:new Error(String(u))))})})}function Vo(t,e,n=Date.now()){const r=t.filter(s=>s.seq>e).sort((s,o)=>s.seq-o.seq);return{entries:r.map(s=>({t:n,level:"info",source:"game-event",msg:s.event,tick:s.tick,simT:s.simT,meta:{seq:s.seq,...s.detail!==void 0?{detail:s.detail}:{}}})),lastSeq:r.at(-1)?.seq??e}}const Ne="data-volter-replay-block",pe="data-volter-replay-video",dn="https://replay-assets.invalid/",Wo=1e3,qo=256*1024,Ho=/data:image\/(?:png|jpeg|webp|gif|svg\+xml);base64,[a-zA-Z0-9+/=]+/g;function lt(t){const e=t.getBoundingClientRect();return{left:e.left,top:e.top,width:e.width,height:e.height}}function Ko(t){switch(t.toLowerCase()){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/webp":return"webp";case"image/gif":return"gif";case"image/svg+xml":return"svg";default:return null}}function Yo(t){const e=/^data:([^;,]+);base64,([\s\S]+)$/i.exec(t);if(!e)throw new Error("image data URL is not base64 encoded");const n=atob(e[2]),r=new Uint8Array(n.length);for(let s=0;s<n.length;s+=1)r[s]=n.charCodeAt(s);return new Blob([r],{type:e[1].toLowerCase()})}function Jo(t){const e=[];for(let n=t;n&&n!==document.body;n=n.parentElement){const r=n.parentElement;if(!r)break;for(const s of Array.from(r.children))s!==n&&!["STYLE","LINK","SCRIPT"].includes(s.tagName)&&!s.hasAttribute(Ne)&&(s.setAttribute(Ne,""),e.push(s))}return()=>{for(const n of e)n.removeAttribute(Ne)}}function Xo(t,e,n){if(n.format!=="canvas-dom"||n.replayPath===null)throw new Error("gameplay DOM recording requires a canvas-dom sink");const r=Jo(t),s=e.getAttribute(pe);e.setAttribute(pe,"");const o=()=>{r(),s===null?e.removeAttribute(pe):e.setAttribute(pe,s)},i=[],a=new Map,l=[];let p=0,u=0,f=0,d=0,c=0,h=null,E=Date.now(),v=null,S=Promise.resolve(),y=!1;const w=(b,z)=>{S=S.then(async()=>{if(!v)try{await z()}catch(re){const H=re instanceof Error?re.message:String(re);v=new Error(`${b}: ${H}`)}})},k=b=>{const z=a.get(b);if(z)return`${dn}${z}`;const re=/^data:([^;,]+)/i.exec(b)?.[1]??"",H=Ko(re);if(!H)return b;const Pe=`${String(c).padStart(6,"0")}.${H}`;return c+=1,a.set(b,Pe),w(`replay asset ${Pe}`,async()=>{const Ht=Yo(b);f+=Ht.size,await $r(n,Pe,Ht)}),`${dn}${Pe}`},_=b=>b.includes("data:image/")?b.replace(Ho,k):b,T=()=>{if(i.length===0)return;const b=new Blob([`[${i.join(",")}]`],{type:"application/json"});i.length=0,p=0;const z=d;d+=1,w(`DOM event batch ${z}`,()=>Gr(n,z,b))};let D;try{D=se({emit(b){h??=b.timestamp;const z=JSON.stringify(b,(re,H)=>typeof H=="string"?_(H):H);i.push(z),p+=z.length,u+=1,p>=qo&&T()},blockSelector:`[${Ne}], [${pe}]`,recordCanvas:!0,inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,sampling:{mousemove:!1,mouseInteraction:!1,scroll:100,canvas:15},errorHandler(b){return l.push(b instanceof Error?b.message:String(b)),!0}})}catch(b){throw o(),b}if(!D)throw o(),new Error("rrweb could not start the DOM recording");const N=t.ownerDocument.defaultView??window,L={width:N.innerWidth,height:N.innerHeight,dpr:N.devicePixelRatio},I=lt(t),fe=lt(e),st=se.mirror.getId(t),Tr=se.mirror.getId(e),Wt=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{se.addCustomEvent("volter-canvas-layout",{rect:lt(e),drawingWidth:e.width,drawingHeight:e.height,dpr:N.devicePixelRatio})});Wt?.observe(e),se.addCustomEvent("volter-canvas-layout",{rect:fe,drawingWidth:e.width,drawingHeight:e.height,dpr:N.devicePixelRatio});const Pr=N.setInterval(T,Wo),qt=()=>{N.clearInterval(Pr),Wt?.disconnect(),o()};return{markVideoStarted(b){E=b},async stop(b){if(y)throw new Error("gameplay DOM recording is already stopped");if(y=!0,se.addCustomEvent("volter-recording-stop",{}),D(),qt(),T(),await S,v)throw v;return{version:1,recorder:"rrweb@2.1.6",events:"events.json",assets:"assets/",video:b,videoStartEpochMs:E,firstEventEpochMs:h,viewport:L,surface:I,surfaceNodeId:st,canvas:{...fe,nodeId:Tr,drawingWidth:e.width,drawingHeight:e.height},eventCount:u,assetCount:a.size,assetBytes:f,rrwebErrors:l}},async abort(){y||(y=!0,D(),qt(),i.length=0,await S)}}}function Qo(){let t=null,e=!1,n=null;const r=`
|
|
3
|
-
let canvas;
|
|
4
|
-
onmessage = async ({data}) => {
|
|
5
|
-
const {bitmap, width, height, type, quality} = data;
|
|
6
|
-
try {
|
|
7
|
-
if (!canvas) canvas = new OffscreenCanvas(width, height);
|
|
8
|
-
if (canvas.width !== width) canvas.width = width;
|
|
9
|
-
if (canvas.height !== height) canvas.height = height;
|
|
10
|
-
const context = canvas.getContext('2d');
|
|
11
|
-
if (!context) throw new Error('No worker canvas context');
|
|
12
|
-
context.globalCompositeOperation = 'copy';
|
|
13
|
-
context.drawImage(bitmap, 0, 0, width, height);
|
|
14
|
-
bitmap.close();
|
|
15
|
-
const blob = await canvas.convertToBlob({type, quality});
|
|
16
|
-
postMessage({blob});
|
|
17
|
-
} catch (error) {
|
|
18
|
-
bitmap.close();
|
|
19
|
-
postMessage({error: error instanceof Error ? error.message : String(error)});
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
`;function s(o){const i=n;n=null,t?.terminate(),t=null,i?.reject(o)}return{encode(o,i,a,l,p){return e?Promise.reject(new Error("Recording preview encoder stopped")):n?Promise.reject(new Error("Recording preview already in flight")):new Promise((u,f)=>{const d={resolve:u,reject:f};n=d;try{if(!t){const c=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));try{t=new Worker(c)}finally{URL.revokeObjectURL(c)}t.onmessage=({data:h})=>{if(h.error||!h.blob){s(new Error(h.error??"No recording preview image"));return}const E=n;n=null,E?.resolve(h.blob)},t.onerror=h=>{h.preventDefault(),s(new Error(h.message||"Recording preview worker failed"))},t.onmessageerror=()=>s(new Error("Recording preview worker message failed"))}createImageBitmap(o).then(c=>{if(e||n!==d||!t){c.close();return}try{t.postMessage({bitmap:c,width:i,height:a,type:l,quality:p},[c])}catch(h){c.close(),s(h instanceof Error?h:new Error(String(h)))}},c=>{n===d&&s(c instanceof Error?c:new Error(String(c)))})}catch(c){s(c instanceof Error?c:new Error(String(c)))}})},dispose(){e=!0,s(new Error("Recording preview encoder stopped"))}}}let q=null;const fn=1,pn=60,Zo=30,Ze=2,ei=1e3/Ze,et=12e4,ti=et/1e3*Ze,ni=256,ri="image/webp",si=.72;function oi(t,e){const n="'use strict';var t=null;onmessage=function(e){clearInterval(t);t=null;if(e.data&&e.data.ms>0){t=setInterval(function(){postMessage(0)},e.data.ms)}};";try{const r=URL.createObjectURL(new Blob([n],{type:"text/javascript"})),s=new Worker(r);URL.revokeObjectURL(r);let o=null;return s.addEventListener("error",i=>{i.preventDefault(),o===null&&(o=window.setInterval(e,t))}),s.addEventListener("message",()=>e()),s.postMessage({ms:t}),{stop(){s.postMessage({ms:0}),s.terminate(),o!==null&&window.clearInterval(o)}}}catch{const r=window.setInterval(e,t);return{stop(){window.clearInterval(r)}}}}function ii(t){const e=t??Zo;if(!Number.isFinite(e)||!Number.isInteger(e)||e<fn||e>pn)throw new Error(`gameplay recording fps must be an integer from ${fn} to ${pn}`);return e}function ai(t){const n=(t?["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"]:["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"]).find(r=>MediaRecorder.isTypeSupported(r));if(!n)throw new Error("this browser exposes MediaRecorder but no WebM video codec");return n}function kt(){qr(q?.previewSnapshot??null)}function ct(t,e){t.previewSnapshot={startedAt:t.started.startedAt,width:t.started.width,height:t.started.height,liveEdgeMs:e,sampleFps:Ze,retentionMs:et,frames:[...t.previewFrames],previewError:t.previewError},q===t&&kt()}function li(t){for(const e of t.previewFrames)URL.revokeObjectURL(e.src);t.previewFrames.length=0}function lr(t,e){if(t.stopping||t.previewEncoding||t.previewError||e<t.nextPreviewAt)return;t.nextPreviewAt=e+ei;const n=Math.min(1,ni/Math.max(1,t.output.width)),r=Math.max(1,Math.round(t.output.width*n)),s=Math.max(1,Math.round(t.output.height*n));t.previewEncoding=!0;const o=new Date().toISOString(),i=t.nextPreviewSequence;t.nextPreviewSequence+=1;const a=t.previewEncoder.encode(t.output,r,s,ri,si).then(l=>{if(t.stopping)return;if(!l){t.previewError="The browser could not encode recording previews.",ct(t,e);return}const p={sequence:i,mediaTimeMs:Math.max(0,Math.round(e)),capturedAt:o,src:URL.createObjectURL(l),width:r,height:s};for(t.previewFrames.push(p);t.previewFrames.length>ti||(t.previewFrames[0]?.mediaTimeMs??p.mediaTimeMs)<p.mediaTimeMs-et;){const u=t.previewFrames.shift();u&&URL.revokeObjectURL(u.src)}ct(t,p.mediaTimeMs)}).catch(l=>{t.stopping||(t.previewError=l instanceof Error?l.message:"The browser could not encode recording previews.",ct(t,e))}).finally(()=>{t.previewEncoding=!1});t.previewTask=a}function ci(){if(q)throw new Error("a gameplay recording is already active; stop it before starting one");if(typeof MediaRecorder>"u")throw new Error("this browser does not support MediaRecorder gameplay capture")}function ui(t){t.stopping||t.drawing||performance.now()<t.nextFrameAt||(typeof document<"u"&&document.hidden&&(t.hidden=!0),t.drawing=!0,t.frameTask=(async()=>{const e=performance.now();try{if(t.options.refreshFrame?.(),t.started.format==="composite-webm"){const n=t.staging,r=t.overlayCache;if(!n||!r)throw new Error("gameplay recording: composite buffers unavailable");await Cn(t.container,n,{canvasFrame:t.options.canvasFrame,snapshots:t.snapshots,overlayCache:r});const{output:s}=t,o=s.getContext("2d");if(!o)throw new Error("gameplay recording: output context unavailable");s.width!==n.width&&(s.width=n.width),s.height!==n.height&&(s.height=n.height),o.globalCompositeOperation="copy",o.drawImage(n,0,0),o.globalCompositeOperation="source-over",lr(t,performance.now()-t.startedWallMs)}t.frames+=1}catch{t.frameErrors+=1}finally{t.drawing=!1;const n=performance.now()-e;t.nextFrameAt=e+Math.max(t.intervalMs/2,2*n)}})())}async function cr(t,e={}){ci();const n=ii(e.fps),r=e.format??"composite-webm",s=t.ownerDocument.createElement("canvas"),o=e.audio??null;let i=null,a=null,l=null;const p=Wr(),u=Vr();try{const f=await Cn(t,s,{canvasFrame:e.canvasFrame,snapshots:p,overlayCache:u});if(f.canvases===0&&f.domOverlays===0)throw new Error("gameplay recording: no game layers are mounted");const d=Array.from(t.querySelectorAll("canvas")).filter(On);if(r==="canvas-dom"&&d.length!==1)throw new Error(`canvas-dom recording requires exactly one root canvas; this game has ${d.length}`);const c=r==="canvas-dom"?d[0]:s;if(typeof c.captureStream!="function")throw new Error("this browser cannot capture a canvas as a media stream");if(i=c.captureStream(n),o)for(const w of o.stream.getAudioTracks())i.addTrack(w);const h=ai(i.getAudioTracks().length>0),E=new MediaRecorder(i,{mimeType:h}),v=new Date().toISOString();a=await zr({startedAt:v,mimeType:h,name:e.name??null,format:r}),r==="canvas-dom"&&(l=Xo(t,c,a),u.dispose());const S={format:r,startedAt:v,mimeType:h,width:c.width,height:c.height,fps:n,audio:i.getAudioTracks().length>0,layers:f,path:a.path,replayPath:a.replayPath,rotates:a.rotates,logFile:a.logFile},y={started:S,recorder:E,output:c,staging:r==="composite-webm"?t.ownerDocument.createElement("canvas"):null,stream:i,audio:o,sink:a,startedWallMs:performance.now(),intervalMs:1e3/n,container:t,options:{canvasFrame:e.canvasFrame,refreshFrame:e.refreshFrame},clock:null,frameTask:null,drawing:!1,nextFrameAt:0,snapshots:p,overlayCache:r==="composite-webm"?u:null,domRecording:l,previewEncoder:Qo(),previewFrames:[],previewSnapshot:{startedAt:v,width:c.width,height:c.height,liveEdgeMs:0,sampleFps:Ze,retentionMs:et,frames:[],previewError:null},previewTask:null,previewEncoding:!1,previewError:null,nextPreviewAt:0,nextPreviewSequence:0,frames:1,frameErrors:0,hidden:typeof document<"u"&&document.hidden,recorderError:null,uploadError:null,uploads:Promise.resolve(),nextSequence:0,stopping:!1};return E.addEventListener("dataavailable",w=>{if(w.data.size===0||y.uploadError)return;const k=y.nextSequence;y.nextSequence+=1,y.uploads=y.uploads.then(async()=>{if(!y.uploadError)try{await Ur(y.sink,k,w.data)}catch(_){y.uploadError=_ instanceof Error?_:new Error(String(_))}})}),E.addEventListener("error",w=>{y.recorderError=w.error??new Error("gameplay recording failed")}),E.addEventListener("start",()=>{y.domRecording?.markVideoStarted(Date.now())}),E.start(1e3),q=y,kt(),r==="composite-webm"&&lr(y,0),y.clock=oi(y.intervalMs,()=>ui(y)),S}catch(f){await l?.abort(),u.dispose(),a&&await kn(a);for(const d of i?.getTracks()??[])d.stop();throw o?.dispose(),f}}async function ur(t){const e=q;if(!e)throw new Error("no gameplay recording is active");e.stopping=!0,e.clock?.stop(),e.clock=null,await e.frameTask,e.previewEncoder.dispose(),await e.previewTask;let n=!1;try{if(e.recorder.state!=="inactive"){const l=new Promise(p=>{e.recorder.addEventListener("stop",()=>p(),{once:!0})});e.recorder.stop(),await l}if(e.recorderError)throw e.recorderError;if(await e.uploads,e.uploadError)throw e.uploadError;const r=Math.max(0,Math.round(performance.now()-e.startedWallMs)),s=Math.round(r/1e3*e.started.fps),o={...e.started,durationMs:r,droppedFrames:Math.max(0,s-e.frames),frameErrors:e.frameErrors,effectiveFps:r>0?Math.round(e.frames/(r/1e3)*10)/10:0,hidden:e.hidden},i=e.sink.path.split(/[\\/]/).at(-1)??"video.webm",a=await e.domRecording?.stop(i);return await Hr(e.sink,t??null,void 0,a?{...a,capture:{durationMs:o.durationMs,droppedFrames:o.droppedFrames,frameErrors:o.frameErrors,effectiveFps:o.effectiveFps,hidden:o.hidden,fps:o.fps,width:o.width,height:o.height,mimeType:o.mimeType,audio:o.audio}}:null),n=!0,o}finally{n||(await e.domRecording?.abort(),await kn(e.sink)),q=null,kt(),li(e),e.overlayCache?.dispose();for(const r of e.stream.getTracks())r.stop();e.audio?.dispose()}}function Dt(){return q!==null}function di(){return q?.started??null}function dr(t,e){return Math.max(0,Math.floor(e-t))}function fi(){const t=q;return t===null?null:{startedAt:t.started.startedAt,elapsedMs:dr(t.startedWallMs,performance.now())}}const qa=Object.freeze(Object.defineProperty({__proto__:null,activeGameplayRecording:di,activeGameplayRecordingTimeline:fi,gameplayRecordingActive:Dt,recordingTimelineElapsedMs:dr,startGameplayRecording:cr,stopGameplayRecording:ur},Symbol.toStringTag,{value:"Module"})),Nt=12e4,pi=5e3,gn=["keydown","keyup","pointerdown","pointermove","wheel","touchstart","touchmove"];let x=null,Fe=null,hn=0,gi=null,fr=null;function hi(t){fr=t}function mi(){return!x||!Dt()?null:{path:x.started.path,format:x.started.format,replayPath:x.started.replayPath,startedAt:x.started.startedAt,rotates:x.started.rotates,logFile:x.started.logFile,idleAutoStopMs:Nt}}function pr(){x&&(x.lastActivityMs=Date.now())}function yi(){if(typeof window>"u")return()=>{};const t=()=>pr();for(const e of gn)window.addEventListener(e,t,{capture:!0,passive:!0});return()=>{for(const e of gn)window.removeEventListener(e,t,{capture:!0})}}async function Ha(t,e={}){if(x&&await Ft("restart"),await Fe,!t)return M.warn("Play started, but gameplay recording did not: no game surface is mounted to record.","play-recording"),null;try{return x={started:await cr(t,{format:Array.from(t.querySelectorAll("canvas")).filter(On).length===1?"canvas-dom":"composite-webm",...e.name?{name:e.name}:{},...e.audio?{audio:e.audio}:{},...e.refreshFrame?{refreshFrame:e.refreshFrame}:{},...e.canvasFrame?{canvasFrame:e.canvasFrame}:{}}),lastActivityMs:Date.now(),poll:null,releaseInput:yi(),ending:!1},x.poll=window.setInterval(()=>{const r=x;!r||r.ending||Date.now()-r.lastActivityMs<Nt||vi()},pi),mi()}catch(n){return M.warn(`Play started, but gameplay recording did not: ${n instanceof Error?n.message:String(n)}`,"play-recording"),null}}async function Ft(t){const e=x;if(!e||e.ending)return Fe;if(e.ending=!0,e.poll!==null&&window.clearInterval(e.poll),e.releaseInput?.(),x=null,!Dt())return null;const n=++hn,r=(async()=>{try{const s=await ur(t);return gi=s,s}catch(s){return M.warn(`Gameplay recording could not be finalized: ${s instanceof Error?s.message:String(s)}`,"play-recording"),null}finally{hn===n&&(Fe=null)}})();return Fe=r,r}function wi(t){const e=Math.round(t.durationMs/100)/10;return`${t.path} — ${e}s at ${t.effectiveFps} fps${t.hidden?" (tab hidden; that is the cadence actually captured, not the requested one)":""}`}async function vi(){const t=Math.round(Nt/1e3),e=await Ft("idle-autostop");M.log(e===null?`Play auto-stopped after ${t}s with no session command and no player input.`:`Play auto-stopped after ${t}s with no session command and no player input. Recording finalized: ${wi(e)}`,"play-recording"),fr?.()}P().session.onCommandDispatched(()=>pr());const bi={source:"live",label:"live",detail:"Running DOM adopted from the playing game. Edits apply to this session only and are discarded when play stops."},mn="structure is owned by the running React tree — play edits are live-DOM only and are discarded on stop; stop play to change structure in source";function ut(t,e){const n=[];for(const r of Ks(t).nodes.values())r.oid===e&&n.push(r.el);return n}function yn(t){return t.style?t.style:null}function Li(t){return{writeStyle:async(e,n,r)=>{const s=ut(t,e);if(s.length===0)return{changed:!1,error:`no live element carries oid "${e}"`};for(const o of s){const i=yn(o);i&&(i[n]=r)}return{changed:!0,route:"live-dom"}},removeStyle:async(e,n)=>{const r=ut(t,e);if(r.length===0)return{changed:!1,error:`no live element carries oid "${e}"`};let s=!1;for(const o of r){const i=yn(o),a=i?.[n];i&&a!==void 0&&a!==null&&a!==""&&(delete i[n],s=!0)}return{changed:s,route:"live-dom"}},writeText:async(e,n)=>{const r=ut(t,e).filter(o=>o.children.length===0);if(r.length===0)return{changed:!1,error:`no live leaf element carries oid "${e}"`};const s=r[0]?.textContent??null;for(const o of r)o.textContent=n;return{changed:!0,prevText:s}},writeProp:async(e,n)=>({changed:!1,error:`prop "${n}" is owned by the running React element (its value lives at the parent call site, not in the DOM) — play edits are live-DOM only and are discarded on stop; stop play to change it in source`}),writeStruct:async()=>({changed:!1,error:mn}),writeStructMany:async()=>({changed:!1,error:mn})}}function Ei(t,e){return new Hs(t,e.shell,{writeBackend:Li(t),provenance:bi})}function gr(){return{id:"",journalSession:"",name:"",container:null,session:null,presentation:null,unregisterPerformanceSource:null,unsubscribeSystemAdapters:null,determinismDeclared:!1,resizeObserver:null,rootResources:[]}}const g=gr(),G=[];let we=[],Y=null;const bt=new Set;function jt(){return Y&&(Y===g.id||G.some(t=>t.id===Y))?Y:g.id}function Ka(){return g.id}function Ya(t){return bt.add(t),()=>bt.delete(t)}function Bt(){for(const t of bt)t()}function Ja(t){Nn(t),jt()!==t&&(Y=t,Bt())}function Lt(t){if(!A)return!1;const{store:e}=A;return e.shell.playState==="playing"&&e.shell.activeViewportTab==="play"&&jt()===t&&ps()}let A=null;const je=new Set;function Si(){return A?Promise.resolve():new Promise((t,e)=>{const n=()=>{clearTimeout(r),je.delete(n),t()},r=setTimeout(()=>{je.delete(n),e(new Error("Play mode failed to start: the editor shell did not bind within 15 seconds."))},15e3);je.add(n)})}const Et=new Set,qe=new Set;let He=null;function hr(){return He}function Xa(t){return qe.add(t),()=>qe.delete(t)}function _i(t){He=t;for(const e of qe)e();P().live.notifyChanged()}const dt=new Set;function Mi(){if(dt.size>0){const t=[...dt].map(e=>({severity:"warn",message:e}));dt.clear(),ls("console-resolved",{conditions:t,by:"play-mode"})}if(He!==null){He=null;for(const t of qe)t();P().live.notifyChanged()}}function tt(){wr();for(const t of Et)t()}function Qa(t){return Et.add(t),()=>Et.delete(t)}let R=0,$t=null,Ke=null;Os();let Be;function Oe(t){const e={...t.capabilities,persist:!1},n=Is(),r=()=>hs({resolve:()=>ms("play edits are session-local by architecture",ys),record:()=>{}}),s=t.transforms,o=s&&{...s,get:l=>s.get(l),beginEdit:l=>s.beginEdit(l),apply:(l,p)=>s.apply(l,p),endEdit:l=>(s.endEdit(l),r()),...s.remove?{remove:()=>r()}:{}},i=t.inspector,a=i&&{...i,properties:l=>i.properties(l),get:(l,p)=>i.get(l,p),set:(l,p,u)=>(i.set(l,p,u),r()),...i.remove?{remove:()=>r()}:{}};return new Proxy(t,{get(l,p){if(p==="capabilities")return e;if(p==="persistence")return n;if(p==="transforms"&&o)return o;if(p==="inspector"&&a)return a;const u=Reflect.get(l,p,l);return typeof u=="function"?u.bind(l):u}})}function Ti(){Be!==void 0&&(Vn(Be),Be=void 0)}async function Pi(t,e,n,r,s){Be=bs();const o=[],i=[],a=()=>{for(const u of i)"dispose"in u&&typeof u.dispose=="function"&&u.dispose()};for(const u of e){const f=n?cs(n,u.id):void 0,d=f?{zOrder:f.zOrder,pausable:f.pausable,...f.entry?{content:`Entry · ${f.entry}`}:{}}:{};if(f?.adapter.identity==="ingest-react"){o.push({worldId:u.id,kind:u.kind,adapter:new Yt(t.shell,{id:u.id,kind:u.kind,adapter:f.adapter.identity,entryOrScenePath:f.entry,zOrder:f.zOrder,pausable:f.pausable}),...d});continue}const c=u.mounted;if(c.kind==="three"){const h=It(c).scene,E=u.id===r&&h===t.scene,v=E?await zs():void 0;if(!s()){a();return}const S=E?Us(t,h,$s(u.id),ft(u.id),{explicitSourceCommit:!0,sourceAnchor:v}):Vs(t,h,{frameControl:"host",journal:ft(u.id)});i.push(S),o.push({worldId:u.id,kind:u.kind,adapter:Oe(S),...d})}else if(c.kind==="canvas"){if(c.substrate.name==="babylon"){const{BabylonAuthoringAdapter:I}=await $(async()=>{const{BabylonAuthoringAdapter:st}=await import("./babylon-authoring-adapter-DBBX2Hem.js");return{BabylonAuthoringAdapter:st}},__vite__mapDeps([23,18,2,3,4,10,19,6,20,5,21,24,25,26]));if(!s()){a();return}const fe=new I(c.substrate.root,t,{canvas:c.canvas,api:c.substrate.api,provenance:{source:"live",label:"live",detail:"Native Babylon.js play scene; ordinary Play edits are ephemeral."}});i.push(fe),o.push({worldId:u.id,kind:u.kind,adapter:Oe(fe),...d});continue}if(c.substrate.name!=="pixi"){const I=new Yt(t.shell,{id:u.id,kind:u.kind,adapter:c.substrate.name,entryOrScenePath:f?.entry,zOrder:f?.zOrder??0,pausable:f?.pausable??!0},`No authoring adapter is registered for canvas substrate "${c.substrate.name}".`);i.push(I),o.push({worldId:u.id,kind:u.kind,adapter:I,...d});continue}const h=c.substrate.root,[E,v,S,y,w]=await Promise.all([$(()=>import("./physics-registry-B2Jkp8e6.js"),[]),$(()=>import("./system-adapters-rIC8FSGP.js"),[]),$(()=>import("./pixi-authoring-adapter-DR6NNYrL.js").then(I=>I.p),__vite__mapDeps([27,28,18,2,3,4,10,19,6,20,5,21,25,26,29,30,31,24,32])),$(()=>import("./pixi-live-write-target-CXDKS1kQ.js"),__vite__mapDeps([33,18,2,3,4,10,19,6,20,5,21,24,25,26,32])),$(()=>import("./canvas-entry-runtime-BQdfSw1B.js"),__vite__mapDeps([34,18,2,3,4,10,19,6,20,5,21,35]))]);if(!s()){a();return}const{createPhysics2DRegistry:k}=E,{createPhysicsAdapter2D:_}=v,{PixiAuthoringAdapter:T}=S,{createLiveCanvasWriteTarget:D}=y,N=_(u.physics2d??k()),L=new T(h,t,{pixi:await w.resolveCanvasPixiForEditor(),target:D({physics:N}),journal:ft(u.id),surface:xi});i.push(L),o.push({worldId:u.id,kind:u.kind,adapter:Oe(L),...d})}else if(c.kind==="dom"){const h=Ei(c.container,t);i.push(h),o.push({worldId:u.id,kind:u.kind,adapter:Oe(h),...d})}else Gs(c,"installPlayRootAuthoring")}if(!s()){a();return}g.rootResources=i;const l=us(Xe()?.config),p=new ds(o,void 0,l);Vn(p),t.shell.notifyIngestEdit()}function ft(t){return Kn(g.id,t)}function Ai(t){for(const e of g.rootResources)"dispose"in e&&typeof e.dispose=="function"&&e.dispose();g.rootResources=[],g.journalSession&&(t.shell.projectHistory?.expireSession(g.journalSession),g.journalSession="")}function Ii(t){return!(t.defaultPrevented||vs(t.target))}let ve=null,be=null,Le=null,Ee=null,Se=null,J=Promise.resolve(),$e=null,Z=[],Ge=0;function mr(){const t=g.session?.game;if(!t)return{};const e=t.roots,n=g.presentation?.worldId??(e.length===1?e[0]?.id:void 0),r=t.loop.timeScale;return{...n!==void 0?{world:n}:{},...typeof r=="number"?{simSpeed:r}:{}}}function St(){const t=g.session?.game?.systemAdapters?.debug;if(t)try{const e=Vo(t.events(Ge),Ge);Ge=e.lastSeq;const n=mr();for(const r of e.entries)Z.push({...r,...n})}catch{}}Zr(t=>{Zs(t),g.session&&_i("Project assets changed — restart play to load the revised models or textures.")});function xi(){return P().workspace.liveDocument.container()}function Ri(){const t=()=>{const e=P().workspace.liveDocument.container();if(!e)return;const n=typeof document<"u"?document.activeElement:null;n instanceof HTMLElement&&n!==e&&n.tagName==="BUTTON"&&n.blur(),e.hasAttribute("tabindex")||(e.tabIndex=-1);try{e.focus({preventScroll:!0})}catch{}gs("viewport")};t(),setTimeout(t,150),setTimeout(t,600)}Ys(t=>Ci(t));function Ci(t){A={store:t,gameContainer:null},hi(ae);for(const e of je)e()}function ze(){return g.session!==null}function ke(){const t=g.session?.game;if(!t)return null;const e=Qe(t),n=e?.getRunTicksTarget()??null;return{getInputTarget:r=>e?.getVirtualInputTarget(r)??null,loop:t.loop,runTicks:n?n.runTicks.bind(n):null,runTicksSettled:e&&n?(r,s)=>No(e,r,s):null,random:Ms(t),determinismDeclared:g.determinismDeclared}}function Za(){const t=g.session?.game.defaultRoot.mounted;return t?.kind==="three"?It(t).scene:null}function el(){const t=g.session?.game?.roots;return t?t.map(e=>{const n=e.mounted;let r=!1;if(n.kind==="three")r=Fs(It(n).scene);else if(n.kind==="canvas")try{r=n.substrate.name==="pixi"?Ns(n.substrate.root):n.substrate.name==="babylon"?(n.substrate.root.scenes??[]).some(s=>(s.rootNodes?.length??0)>0):!1}catch{r=!1}else r=js(n.container);return{rootId:e.id,kind:n.kind,hasRenderableContent:r}}):[]}function Oi(){return g.session?Dn(P().workspace.liveDocument.container()).canvas:null}function ki(t){return!t||t===g.id?P().workspace.liveDocument.container():G.find(e=>e.id===t)?.container??null}function tl(t){if(!t||t===g.id)return Oi();const e=G.find(n=>n.id===t);return e?.session?Dn(e.container).canvas:null}function yr(){return $t}function Di(){return Ke}function ne(){return[g,...G].filter(t=>t.session)}const De=new Set;function wr(){const t=new Set(ne().map(e=>e.session.game.loop));for(const e of De)t.has(e)||De.delete(e);for(const e of t)xs()?De.delete(e)&&e.start():e.liveness!=="stopped"&&(De.add(e),e.stop())}Rs(wr);function wn(){const t=ne(),e=ws();return t.find(n=>n.id===e)??t[0]??null}let Ye=null;function Ni(){Ye?.(),Ye=fs(()=>({projectName:Xe()?.config.name??null,instanceName:ne().length>1?wn()?.name??null:null})),Wn(()=>{const t=wn();return t?.session?{game:t.session.game,instanceId:t.id,recording:Ls}:null})}function Fi(){Ye?.(),Ye=null,Wn(null)}function nl(t,e,n){for(const r of ne())r.session?.resize(t,e,n)}let vn=Promise.resolve(),nt=null,Gt=null;function rl(){return nt}function ji(){const t=globalThis.crypto?.randomUUID?.()??`private-${Date.now()}`;return{mode:"private",id:t,roomKey:`private:${t}`,revision:null,participantId:Xr}}function bn(t,e=ji(),n,r){const s=r??null,o=vn.then(()=>(Yr(),$i(t,e,n??null,s).finally(()=>{Jr()})));return vn=o.then(()=>{},()=>{}),o}async function Bi(t){const{autoLaunchIngest:e}=await $(async()=>{const{autoLaunchIngest:s}=await import("./mount-ingest-root-9KaA9ETn.js").then(o=>o.m);return{autoLaunchIngest:s}},__vite__mapDeps([36,18,2,3,4,10,19,6,20,5,21,37,38,39,26,40,41,42,43,7,8,44,45,31,30,46,47]));await e(t);const n=Ds();if(n)return n.play(),!0;const{isModuleModeActive:r}=await $(async()=>{const{isModuleModeActive:s}=await import("./module-mode-BWoDD0oV.js");return{isModuleModeActive:s}},__vite__mapDeps([48,18,2,3,4,10,19,6,20,5,21,39,38,49,50,51,35,40,52,53,8,54,9,7,11,55,34,56,57,58,59,44,60,61,62]));return r()}function pt(t,e){return X(t),Uo(t,e,{isHidden:()=>typeof document<"u"&&document.hidden,editorUrl:typeof window<"u"?window.location.href:void 0})}async function $i(t,e,n,r){if(!A){const d=R;if(X("waiting for the editor to bind Play"),await Si(),R!==d)throw new Error("Play start cancelled while waiting for the editor to bind.")}if(!A)throw new Error("Play mode failed to start: the editor shell is not bound.");if(X("waiting for the project bootstrap to settle"),await es(),g.session&&ae(),Gt=r,await Bi(A.store)||await Ws(A.store))return;const s=++R;nt=e,$t=Date.now(),Ke=null;const{store:o}=A;Ki();const i=J.then(()=>Xs(n));if(J=i,await pt("starting the play log session",i),s!==R||(Z=[],Ge=0,M.setSink(d=>{let c;try{const h=g.session?.game?.systemAdapters.debug?.state("time");typeof h?.tick=="number"&&typeof h.simSeconds=="number"&&(c={tick:h.tick,simT:h.simSeconds})}catch{}Z.push({t:d.timestamp,level:d.level,msg:d.message,...d.source?{source:d.source}:{},...d.subsystem?{sub:d.subsystem}:{},...d.metadata?{meta:d.metadata}:{},...c??{},...mr()})}),$e=setInterval(()=>{if(St(),Z.length>0){const d=Z.splice(0);J=J.then(()=>Qn(d))}},200),ve=d=>{d.key==="Escape"&&Ii(d)&&ae()},window.addEventListener("keydown",ve),X("opening the Game document"),await P().workspace.liveDocument.acquire(),s!==R))return;const a=P().workspace.liveDocument.container();if(!a){const d="Play mode failed to start: the game container is not mounted in the workspace.";throw M.error(d,"play-mode"),ae(),new Error(d)}const l=a.clientWidth,p=a.clientHeight;a.style.contain||(a.style.cssText+=Xn),Fn(a),ht(a),P().viewport.transition.begin(),o.shell.setPlayState("playing"),Ri(),M.log("Play mode started","play-mode"),P().viewport.transition.onSettled(()=>{s===R&&o.shell.playState==="playing"&&ts()});let u=null,f=null;try{const d=Xe();if(!d)throw new Error("No project open — open or create a project first");const c=await pt("fetching the project manifest",jn());we=Ae(c).map(L=>L.id);for(const L of we)Kt({rootId:L,mechanism:"host-mount",source:"declared",state:"waiting"});let h;Bn();const{entries:E,mountId:v}=await pt("resolving the project's root entries",Yn(c,d.rootPath,{selectionOverride:r??void 0}));if(M.log(`Resolved manifest composition (${Ae(c).length} world${Ae(c).length===1?"":"s"}): `+Ae(c).map(L=>`${L.id} (${L.surface})`).join(", "),"play-mode"),s!==R)return;const S=a.clientWidth||l,y=a.clientHeight||p;ht(a,v),u=v,X("mounting the runtime roots");const{mountManifestRoots:w}=await $(async()=>{const{mountManifestRoots:L}=await import("./mount-manifest-BOiv1Hix.js");return{mountManifestRoots:L}},__vite__mapDeps([63,52,18,2,3,4,10,19,6,20,5,21,64,65,66,67,68,69,7,8,70,71,72,73,74,75,76,77,35,78,79,80,81,82,83,84,85,50,51,40,38,86,87,9,11,88,39,89,24,49,53,54,55,34,56,57,58,59,44,60,61,62,90,37,26,91,92,93,94,46,30,31,47,95,45,29,96,97,25,98,99,100,101,102,103,104,105,106,107,108,109,110,111,41,42,43,112]));if(h=await w({manifest:c,container:a,entries:E,width:S,height:y,seed:t,playtest:e}),f=h,s!==R){h.stop(),Te(h,v,"Cancelled instance");return}for(const L of $n(d.rootPath))M.error(Gn(L),"play-mode");for(const L of we)Kt({rootId:L,mechanism:"host-mount",source:"declared",state:"ready"});if(Zn(h.game),g.session=h,g.id=v,g.journalSession=Kn(v,"").session,g.name=vr(0),g.unregisterPerformanceSource?.(),g.unregisterPerformanceSource=zn({id:"workspace:game",label:"Game runtime",kind:"game",instanceId:v,profiler:h.game.profiler}),Mi(),g.determinismDeclared=c.determinism?.seededRandom===!0,c.configurations.some(L=>L.kind==="process")&&Qe(h.game)?.setRoomDeclared(!0),tt(),o.shell.setPlayEditRegime("ephemeral"),g.presentation=Js(h.game.roots)??Bs(o,h.game.roots),X("installing play authoring for each root"),await Pi(o,h.game.roots,c,g.presentation?.worldId??null,()=>s===R),s!==R)return;X("binding the editor to the running game");const k=h.game.systemAdapters;Me(k,v),Nn(v),Ni(),g.unsubscribeSystemAdapters?.(),g.unsubscribeSystemAdapters=h.game.subscribeSystemAdapters?.(()=>{Un(h.game.systemAdapters,v)})??null,We(()=>Lt(v),v),We(()=>Lt(jt()));const _=Rn(k.physics);o.setEcsSyncTransform((L,I)=>{!_||ns(_,L)==="unresolved"||_.commit(L,{position:I.position.toArray(),rotation:I.quaternion.toArray(),scale:I.scale.toArray()})});const T=jo(),D=a.clientWidth,N=a.clientHeight;D>0&&N>0&&(D!==l||N!==p||T!==null)&&h.resize(D,N,T??void 0),P().viewport.transition.ready(()=>{const L=g.session?.game;if(!L)return null;for(const I of L.roots)if(I.mounted.kind==="three")return I.mounted.camera;return null})}catch(d){const c=`Play mode failed to start: ${d}`;if(M.error(c,"play-mode"),u!==null&&g.id!==u)if(f){try{f.stop()}catch(h){M.error(`Error stopping the failed play session: ${h}`,"play-mode")}Te(f,u,"Failed instance")}else rt(u,"Failed instance");throw s===R&&ae(),new Error(c)}}async function sl(t,e){if(!A)throw new Error("Cannot mount an additional instance: play mode is not bound.");if(!g.session)throw new Error("Cannot mount an additional instance: no primary play session is running.");const n=R,r=Xe();if(!r)throw new Error("Cannot mount an additional instance: no project is open.");const s=await jn();Bn();const{entries:o,mountId:i}=await Yn(s,r.rootPath,{selectionOverride:Gt??void 0});t.style.contain||(t.style.cssText+=Xn),Fn(t),ht(t,i);const{mountManifestRoots:a}=await $(async()=>{const{mountManifestRoots:d}=await import("./mount-manifest-BOiv1Hix.js");return{mountManifestRoots:d}},__vite__mapDeps([63,52,18,2,3,4,10,19,6,20,5,21,64,65,66,67,68,69,7,8,70,71,72,73,74,75,76,77,35,78,79,80,81,82,83,84,85,50,51,40,38,86,87,9,11,88,39,89,24,49,53,54,55,34,56,57,58,59,44,60,61,62,90,37,26,91,92,93,94,46,30,31,47,95,45,29,96,97,25,98,99,100,101,102,103,104,105,106,107,108,109,110,111,41,42,43,112])),l=await a({manifest:s,container:t,entries:o,width:t.clientWidth,height:t.clientHeight,playtest:nt});for(const d of $n(r.rootPath))M.error(Gn(d),"play-mode");if(n!==R||!g.session){try{l.stop()}catch{}return Te(l,i,e?.trim()||"Cancelled instance"),i}Zn(l.game);const p=gr();p.id=i,p.name=e?.trim()||vr(G.length+1),p.container=t,p.session=l,p.unregisterPerformanceSource=zn({id:`workspace:game:${i}`,label:`Game runtime (instance ${i})`,kind:"game",instanceId:i,profiler:l.game.profiler});const u=l.game.systemAdapters;Me(u,i),p.unsubscribeSystemAdapters=l.game.subscribeSystemAdapters?.(()=>{Un(l.game.systemAdapters,i)})??null,We(()=>Lt(i),i),G.push(p);const f=g.session.game.systemAdapters;return Me(f,g.id),tt(),i}function Gi(){return G.map(t=>t.id)}function ol(){const t=[];g.id&&t.push({id:g.id,name:g.name});for(const e of G)e.id&&t.push({id:e.id,name:e.name});return t}function zi(t){return g.id===t?g.name:G.find(e=>e.id===t)?.name}function rt(t,e){t&&(Jn(t),Cs(t,e))}function Te(t,e,n){t.stopComplete.then(()=>rt(e,n))}function Ui(t){const e=G.findIndex(s=>s.id===t);if(e<0)return;const[n]=G.splice(e,1);if(!n)return;n.unsubscribeSystemAdapters?.(),n.unsubscribeSystemAdapters=null;const r=n.session;try{r?.stop()}catch(s){M.error(`Error stopping additional instance ${n.id}: ${s}`,"play-mode")}n.unregisterPerformanceSource?.(),Me(null,n.id),r?Te(r,n.id,n.name):rt(n.id,n.name),n.container=null,n.session=null,Y===t&&(Y=null,Bt()),tt()}function Vi(){for(const t of Gi())Ui(t)}let ce=[];const _t=new Set;function zt(t){if(t===0){const e=Qr()?.getPlayerIdentity?.()?.name?.trim();if(e)return e}return`Instance ${t+1}`}function il(){return ce.length===0?0:ce.length-1}function vr(t){return ce[t]??zt(t)}function al(t){return _t.add(t),()=>_t.delete(t)}function Wi(){for(const t of _t)t()}function qi(t){const e=Math.max(0,Math.floor(t));Hi(e===0?[]:Array.from({length:e+1},(n,r)=>zt(r)))}function Hi(t){const e=t.length<=1?[]:t.map((n,r)=>n?.trim()?n.trim():zt(r));e.length===ce.length&&e.every((n,r)=>n===ce[r])||(ce=e,Wi())}function ae(){if(R++,Kr(),!A||(Ft("teardown"),Fi(),Gt=null,qs(A.store)))return;nt=null,Y=null,Bt();const{store:t}=A;St(),qi(0),Vi(),P().viewport.transition.end(),t.setEcsSyncTransform(null);const e=g.id,n=g.name||"Game instance";g.id="",g.unsubscribeSystemAdapters?.(),g.unsubscribeSystemAdapters=null,Me(null,e),g.presentation?.dispose(),g.presentation=null,Ai(t),Ti(),t.shell.setPlayEditRegime(null);const r=g.session;if(r)try{r.stop()}catch(s){M.error(`Error stopping play session: ${s}`,"play-mode")}finally{g.unregisterPerformanceSource?.(),g.unregisterPerformanceSource=null,g.session=null,g.determinismDeclared=!1,tt()}r?Te(r,e,n):rt(e,n);for(const s of we)rs(s);if(we=[],We(()=>!0),Jn(),g.resizeObserver?.disconnect(),g.resizeObserver=null,ve&&(window.removeEventListener("keydown",ve),ve=null),M.log("Play mode stopped","play-mode"),ss(),$e&&(clearInterval($e),$e=null),St(),M.setSink(null),Z.length>0){const s=Z.splice(0);J=J.then(()=>Qn(s))}J=J.then(()=>Qs()),Yi(),t.shell.setPlayState("stopped"),P().workspace.liveDocument.release(),$t!==null&&Ke===null&&(Ke=Date.now())}function ll(){if(!(!g.session||!A)){for(const t of ne())t.session?.pause();A.store.shell.setPlayState("paused"),M.log("Play mode paused","play-mode")}}function cl(){if(!(!g.session||!A)){for(const t of ne())t.session?.resume();A.store.shell.setPlayState("playing"),M.log("Play mode resumed","play-mode")}}function ul(){if(g.session)for(const t of ne())t.session?.step()}function Ki(){os(),be=console.log,Le=console.info,Ee=console.warn,Se=console.error;const t=(e,n)=>{if(yt)return;const r=ks();M.logStructured(e,as(n),"game",void 0,r?{instanceId:r,instanceName:zi(r)??`Instance ${r}`}:void 0)};console.log=(...e)=>{be?.apply(console,e),t("info",e)},console.info=(...e)=>{Le?.apply(console,e),t("info",e)},console.warn=(...e)=>{Ee?.apply(console,e),t("warn",e)},console.error=(...e)=>{Se?.apply(console,e),t("error",e)}}function Yi(){is(),be&&(console.log=be),Le&&(console.info=Le),Ee&&(console.warn=Ee),Se&&(console.error=Se),be=null,Le=null,Ee=null,Se=null}P().live.register({id:"play",priority:0,mounted:ze,playing:ze,stop:ae,instanceContainer:t=>ki(t),startedAt:yr,endedAt:Di,restartRequired:hr,restart:()=>void bn(),remount:async t=>{try{return await bn(void 0,void 0,void 0,t),ze()?{ok:!0}:{ok:!1,error:"Play did not start: the remount was superseded before it finished booting."}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}});P().session.reportFacet(()=>({timeScale:ke()?.loop.timeScale??null,loopLiveness:ke()?.loop.liveness??null,restartRequired:hr(),seed:ke()?.random?.seed??null,deterministic:ke()?.determinismDeclared??!1}));const br=10,Ji=11,Lr=12,Ut=13,Xi=14,Qi=15,Er=17,Vt=18,Ln=2e3,V=[],Mt=new WeakMap,En=new WeakMap,_e=new WeakMap;let Tt={latencyMs:0,jitterMs:0,packetLoss:0};function Sn(t,e,n){const{latencyMs:r,jitterMs:s}=Tt,o=performance.now(),i=e==="in"?t.dueIn:t.dueOut;if(r<=0&&s<=0&&i<=o){n();return}const a=Math.max(i,o+r+Math.random()*s);e==="in"?t.dueIn=a:t.dueOut=a,setTimeout(n,a-o)}const Ue=new Map,ge=[];let _n=0;const Pt=new Set;let ee={start:0,msgsIn:0,msgsOut:0,bytesIn:0,bytesOut:0},he={msgsIn:0,msgsOut:0,bytesIn:0,bytesOut:0};function W(){for(const t of Pt)t()}function Sr(t){const e=t-ee.start;e<1e3||(he=e<2e3?{...ee}:{msgsIn:0,msgsOut:0,bytesIn:0,bytesOut:0},ee={start:t,msgsIn:0,msgsOut:0,bytesIn:0,bytesOut:0})}let de=!1;const Zi="networkProfilerAutostart";let Mn;function ea(t){const e=new Map,n=(r,s)=>{if(!r||typeof r!="object"||e.has(r))return;e.set(r,s);const o=r.constructor?.[Symbol.metadata];if(o){for(const i of Object.keys(o)){const a=/^\d+$/.test(i)?o[i]?.name:void 0;a&&n(r[a],[...s,a])}return}r.forEach?.((i,a)=>n(i,[...s,String(a)]))};return n(t,[]),e}function ta(t,e,n){if(!de||e.length===0)return;const r=ea(t.serializer?.getState()),s=new Map;for(const o of e){const i=[...r.get(o.ref)??[],String(o.dynamicIndex??o.field)],a=i.slice(0,i.length>1?2:1).join(".");s.set(a,(s.get(a)??0)+1)}for(const[o,i]of s){let a=t.entities.get(o);a||(a={path:o,syncs:0,changes:0,patchBytesMin:n,patchBytesMax:n},t.entities.set(o,a)),a.syncs+=1,a.changes+=i,a.patchBytesMin=Math.min(a.patchBytesMin,n),a.patchBytesMax=Math.max(a.patchBytesMax,n)}}function F(t,e,n,r,s){if(!de)return;const o=Date.now();Sr(o),e==="in"?(ee.msgsIn+=1,ee.bytesIn+=r):(ee.msgsOut+=1,ee.bytesOut+=r);let i=t.types.get(n);i||(i={type:n,countIn:0,countOut:0,bytesIn:0,bytesOut:0},t.types.set(n,i)),e==="in"?(i.countIn+=1,i.bytesIn+=r):(i.countOut+=1,i.bytesOut+=r),s!==void 0&&(i.last=s),_n+=1,ge.push({seq:_n,time:performance.now(),direction:e,type:n,size:r}),ge.length>Ln&&ge.splice(0,ge.length-Ln)}function Je(t,e){const n=t;return Q.stringCheck(n,e)?Q.string(n,e):String(Q.number(n,e))}function na(t,e){const n=e[0],r={offset:1},s=e;try{if(n===br)Q.utf8Read(s,r,e[r.offset++]),Q.utf8Read(s,r,e[r.offset++])==="schema"&&!t.serializer&&(t.serializer=new Ir,e.byteLength>r.offset&&t.serializer.handshake(e,r)),t.state="connected",t.joinedAt??=Date.now(),F(t,"in","join",e.byteLength);else if(n===Ji){const o=Q.number(s,r),i=Q.string(s,r);t.error=`${o}: ${i}`,t.state="error",F(t,"in","error",e.byteLength)}else if(n===Lr)F(t,"in","leave",e.byteLength);else if(n===Xi)t.serializer?.setState(e,r),t.stateBytes=e.byteLength,F(t,"in","state",e.byteLength);else if(n===Qi){const o=t.serializer?.decoder;let i=[];o&&(o.triggerChanges=a=>i=a),t.serializer?.patch(e,r),ta(t,i,e.byteLength),de&&(t.patches+=1,t.patchBytes+=e.byteLength),F(t,"in","patch",e.byteLength)}else if(n===Ut){const o=Je(e,r),i=e.byteLength>r.offset?An(e,{start:r.offset}):void 0;F(t,"in",o,e.byteLength,i)}else if(n===Er)F(t,"in",Je(e,r),e.byteLength);else if(n===Vt){t.pingSentAt!==null&&(t.rttMs=Math.round(performance.now()-t.pingSentAt)),t.pingSentAt=null;const o=_e.get(t);_e.delete(t),o&&t.rttMs!==null&&o(t.rttMs),F(t,"in","ping",e.byteLength)}}catch(o){t.error||(t.error=`the editor could not read a frame (code ${n}): ${String(o)}`)}W()}function ra(t,e){const n=e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):null;if(!n||n.byteLength===0)return;const r=n[0],s={offset:1};try{if(r===Ut){const o=Je(n,s),i=n.byteLength>s.offset?An(n,{start:s.offset}):void 0;F(t,"out",o,n.byteLength,i)}else r===Er?F(t,"out",Je(n,s),n.byteLength):r===Vt?(t.pingSentAt=performance.now(),F(t,"out","ping",n.byteLength)):r===br?F(t,"out","join",n.byteLength):r===Lr&&F(t,"out","leave",n.byteLength)}catch{}W()}function sa(t){let e;try{e=new URL(t,location.href)}catch{return null}const n=e.searchParams.get("sessionId"),r=e.pathname.split("/").filter(Boolean);if(!n||r.length<2)return null;const s=r[r.length-1];return{processId:r[r.length-2],roomId:s,sessionId:n,endpoint:`${e.protocol}//${e.host}`}}function oa(t,e){const n=sa(e);if(!n)return;const r={...n,state:"connecting",joinedAt:null,closedAt:null,closeCode:null,error:null,serializer:null,pingSentAt:null,rttMs:null,stateBytes:0,patches:0,entities:new Map,patchBytes:0,types:new Map,socket:t,dueIn:0,dueOut:0,receive:null},s=ze()?yr():null,o=!V.some(a=>a.state==="connected"||a.state==="connecting");(s!==Mn||s===null&&o)&&(Mn=s,de=P().projectLocalState.read(Zi)??!1),V.push(r),Mt.set(t,r),t.addEventListener("message",a=>{Sn(r,"in",()=>{a.data instanceof ArrayBuffer&&na(r,new Uint8Array(a.data)),r.receive?.(a)})}),t.addEventListener("close",a=>{r.state="disconnected",r.closedAt=Date.now(),r.closeCode=a.code,W()}),t.addEventListener("error",()=>{r.state="error",r.error??="the socket reported an error",W()});const i=t.send.bind(t);t.send=a=>{ra(r,a),Sn(r,"out",()=>{t.readyState===t.OPEN&&i(a)})},W()}function ia(t,e){const n=typeof t=="string"?t:t instanceof URL?t.href:t.url;/\/matchmake\//.test(n)&&e.clone().json().then(r=>{const s=r.room??r;typeof s.roomId=="string"&&typeof s.name=="string"&&(Ue.set(s.roomId,s.name),W())}).catch(()=>{})}function dl(){const t=window;if(t.__volterNetworkObserver)return;t.__volterNetworkObserver=!0;const e=window.WebSocket;if(typeof e=="function"){const r=class extends e{constructor(s,o){super(s,o),oa(this,String(s))}set onmessage(s){const o=Mt.get(this);if(!o){super.onmessage=s;return}En.set(this,s),o.receive=s?i=>s.call(this,i):null}get onmessage(){return Mt.has(this)?En.get(this)??null:super.onmessage}};window.WebSocket=r}const n=window.fetch;typeof n=="function"&&(window.fetch=async(r,s)=>{const o=await n(r,s);return ia(r,o),o})}function _r(t){if(typeof t=="string")return t;if(typeof t=="function")return"schema";if(t&&typeof t=="object"){const[e,n]=Object.entries(t)[0]??[];if(e)return`${e}<${_r(n)}>`}return"unknown"}function aa(t,e){let n=t,r=null,s=null;for(const o of e){if(n==null)return null;const i=n.constructor?.[Symbol.metadata];if(i&&typeof i[o]=="number")s=i[i[o]]?.type??null,r=s&&typeof s=="object"?Object.values(s)[0]:null,n=n[o];else{s=r,r=null;const a=n;n=a.get?a.get(String(o)):a.at?a.at(Number(o)):void 0}}return s===null?null:_r(s)}function Mr(t){return`${t.endpoint.replace(/^ws/,"http")}/monitor/api`}async function Tn(t){const e=await fetch(t).catch(()=>null);return!e||!e.ok?null:await e.json().catch(()=>null)}async function oe(t,e,n,r){const s=j();if(!s)throw new Error("No room is observed.");const o=new URLSearchParams({roomId:r??s.roomId,method:t,args:JSON.stringify(e)}),i=await fetch(`${Mr(s)}/room/call?${o}`);if(i.status===404)throw new Error(`The room server serves no Monitor view, so ${n} has nowhere to go (its \`server\` configuration sets VOLTER_ROOM_MONITOR=1).`);if(!i.ok)throw new Error(`The room server refused ${n} (${i.status}).`)}function j(){for(let t=V.length-1;t>=0;t-=1)if(V[t].state!=="disconnected")return V[t];return V[V.length-1]??null}function la(t){const e=t?.serializer?.getState();return e?.toJSON?e.toJSON():e}function Pn(){return Sr(Date.now()),{msgsInPerSec:he.msgsIn,msgsOutPerSec:he.msgsOut,bytesInPerSec:he.bytesIn,bytesOutPerSec:he.bytesOut}}const ca={peers(){return V.filter(t=>t.state==="connected").map(t=>({id:t.sessionId,label:`${Ue.get(t.roomId)??t.roomId} (this client)`}))},networkId:()=>null,authority:()=>"server",editable:()=>!1,getConnectionState(){return j()?.state??"disconnected"},getRoomInfo(){const t=j();return t?{roomId:t.roomId,sessionId:t.sessionId,roomName:Ue.get(t.roomId)??""}:null},getReplicationStats(){const e=j()?.serializer?.decoder?.root?.refs,n=Pn();return{entities:e?.size??0,msgsInPerSec:n.msgsInPerSec,msgsOutPerSec:n.msgsOutPerSec}},subscribe(t){return Pt.add(t),()=>{Pt.delete(t)}},getStateSnapshot:()=>la(j()),messageEvents(t=0){return ge.filter(e=>e.seq>t)},getRates:Pn,sendMessage(t,e){const n=j();if(!n||n.state!=="connected")throw new Error("No room is connected to send into.");const r=new Uint8Array(6+t.length*3);r[0]=Ut;const s={offset:1};xr.string(r,t,s);const o=e===void 0?new Uint8Array(0):new Uint8Array(Ar(e)),i=new Uint8Array(s.offset+o.byteLength);i.set(r.subarray(0,s.offset)),i.set(o,s.offset),n.socket.send(i)},getConditioning:()=>({...Tt}),setConditioning(t){Tt={latencyMs:Math.max(0,t.latencyMs),jitterMs:Math.max(0,t.jitterMs),packetLoss:0},W()},getConditioningLimits:()=>({packetLoss:"A WebSocket is reliable and ordered: a lost packet is resent, so loss is not simulated here."}),ping(){const t=j();return!t||t.state!=="connected"?Promise.reject(new Error("No room is connected to ping.")):new Promise((e,n)=>{_e.set(t,e),setTimeout(()=>{_e.get(t)===e&&(_e.delete(t),n(new Error("The server did not answer the ping within 5 s.")))},5e3),t.socket.send(new Uint8Array([Vt]))})},async inspectServer(t){const e=j();if(!e)return null;const n=Mr(e),r=await Tn(`${n}/`);if(!r)return null;const s=t??e.roomId,o=await Tn(`${n}/room?roomId=${encodeURIComponent(s)}`),i=a=>{const l=Number(a);return Number.isFinite(l)?l:null};return{rooms:(r.rooms??[]).map(a=>({roomId:a.roomId,name:a.name,clients:a.clients,maxClients:i(a.maxClients),locked:a.locked===!0,elapsedMs:a.elapsedTime??0})),connections:r.connections??0,cpuPercent:typeof r.cpu=="number"&&Number.isFinite(r.cpu)?r.cpu:null,memory:r.memory?.usedMemMb!==void 0&&r.memory.totalMemMb!==void 0?{usedMb:r.memory.usedMemMb,totalMb:r.memory.totalMemMb}:null,room:o?{roomId:s,clients:(o.clients??[]).map(a=>({sessionId:a.sessionId,elapsedMs:a.elapsedTime})),stateBytes:o.stateSize??0,...o.state!==void 0?{state:o.state}:{}}:null}},disconnectClient:(t,e)=>oe("_forceClientDisconnect",[t],"the disconnect",e),editServerState:(t,e,n)=>oe("_editStateProperty",[t,e],"the state edit",n),deleteServerState:(t,e)=>oe("_deleteStateProperty",[t],"the state delete",e),sendToClient:(t,e,n,r)=>oe("_sendMessageToClient",[t,e,n],"the send",r),broadcast:(t,e,n)=>oe("broadcast",[t,e],"the broadcast",n),disposeRoom:t=>oe("disconnect",[],"the dispose",t),clearTraffic(){for(const t of V)t.types.clear(),t.entities.clear(),t.patches=0,t.patchBytes=0;W()},stateFieldType(t){return aa(j()?.serializer?.getState(),t)},getTrafficByType(){const t=j();return t?[...t.types.values()].map(({type:e,countIn:n,countOut:r,bytesIn:s,bytesOut:o})=>({type:e,countIn:n,countOut:r,bytesIn:s,bytesOut:o})):[]},getTrafficByEntity(){const t=j();return t?[...t.entities.values()].map(({path:e,syncs:n,changes:r,patchBytesMin:s,patchBytesMax:o})=>({path:e,syncs:n,changes:r,patchBytesMin:s,patchBytesMax:o})).sort((e,n)=>n.syncs-e.syncs):[]},isRecording:()=>de,setRecording(t){de=t,W()},getServerConfig(){const t=j();if(!t)return null;const e=Ue.get(t.roomId);return e?{endpoint:t.endpoint,roomName:e}:{endpoint:t.endpoint}}};export{sl as $,ki as A,tl as B,mi as C,cr as D,fi as E,Fa as F,bo as G,Zs as H,Za as I,rr as J,ir as K,za as L,$a as M,Zi as N,Ga as O,ja as P,Ba as Q,Ya as R,Va as S,Bo as T,Wa as U,nl as V,Ja as W,Ka as X,vr as Y,el as Z,Qa as _,ze as a,Ui as a0,Ua as a1,Fo as a2,qa as a3,ol as b,Hi as c,ur as d,bn as e,ul as f,ke as g,Ft as h,dl as i,ae as j,Ha as k,cl as l,rl as m,pr as n,Qs as o,ll as p,Qn as q,No as r,qi as s,Xs as t,xi as u,jt as v,al as w,il as x,Xa as y,hr as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as a}from"./index-iW3HFEJB.js";import{s as n,n as s}from"./command-results-CUQD49AB.js";import{g as m,a as p}from"./game-network-CU3Yp0oN.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"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-Cofo9dCU.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-BUPLu5EA.js";import"./contract-system-adapters-D9Gcb7R7.js";import"./game-contract-seams-DOwrbA13.js";import"./seeded-random-BIdiJ8w9.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CayyA6Tc.js";import"./capability-coverage-6I_iG0kk.js";import"./edit-mode-authoring-Du1CaTkH.js";import"./json-history-resource-82d2z68R.js";import"./binding-resolver-aDFCbAcG.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-C8OlRuJ5.js";import"./canvas-entry-runtime-BQdfSw1B.js";import"./three-ingest-runtime-Bqwv-JsZ.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CHE8woWv.js";import"./ingest-source-persistence-2MRBPgo0.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DPtVohIT.js";import"./mounted-authoring-30zCcxeV.js";import"./entity-object-BeRdaaqQ.js";import"./user-data-BGLBYiFw.js";import"./workspace-arrangement-6V8ZwB2d.js";import"./three-contract-Dkt6PmWY.js";import"./three-wsMw8Ifj.js";import"./editor-layers-qlgroPbE.js";import"./component-instance-root-9MmHwMal.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-DctJX96k.js";import"./source-persistence-backend-I5wxqQgh.js";import"./three-projection-core-rOK39WmJ.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-mLmXPi7n.js";import"./deferred-ingest-play-DVLTxYCk.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DgsCzOTj.js";import"./board-guides-BVkDJqat.js";import"./relative-import-specifier-CPCtuEhc.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-CUNyIUii.js";import"./inference-diagnostics-PcfFN6SD.js";import"./writer-tw6EcuVO.js";import"./three-state-Cu8xEils.js";import"./editor-shell-store-Di0waLQj.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-B7DJhMPS.js";const Ge="workspace.command",Le={"list-gameplay-state":{derivedRefresh:"if-content-changed",handle:()=>{const e=a().debug;return e?{ok:!0,data:{providers:e.providers()}}:p()?{ok:!0,data:{providers:[]}}:s()}},"inspect-gameplay-state":{derivedRefresh:"if-content-changed",handle:e=>{const t=a().debug;if(!t)return p()?{ok:!0,data:{state:null}}:s();const r=e.keys;try{const o={};if(r&&r.length>0)for(const i of r)o[i]=t.state(i);else Object.assign(o,t.stateAll());return{ok:!0,data:{state:o}}}catch(o){return n(o)}}},"list-debug-commands":{derivedRefresh:"if-content-changed",handle:()=>{const e=a().debug;return e?{ok:!0,data:{commands:e.commands()}}:p()?{ok:!0,data:{commands:[]}}:s()}},"invoke-debug-command":{derivedRefresh:"always",handle:async e=>{const t=a().debug;if(!t)return p()?{ok:!1,error:`debug: no command registered under "${e.name}" — this game exposes no debug adapter`,data:{code:"DEBUG_COMMAND_NOT_REGISTERED",registered:[]}}:s();try{return{ok:!0,data:{result:await t.invoke(e.name,e.args??[])}}}catch(r){return n(r)}}},"inject-input":{derivedRefresh:"none",handle:e=>{const t=m();if(!t)return{ok:!1,error:"not in play mode — start play before injecting input"};let r;try{r=t.getInputTarget(e.worldId)}catch(o){return n(o)}if(!r)return{ok:!1,error:"this play session has no input door: no root entry exports `debug.input`"};try{if(e.kind==="action"){const i=e.atTick;return typeof i=="number"?(r.scheduleActionAtTick(i,e.action,e.value),{ok:!0,data:{scheduled:!0,tick:i}}):{ok:!0,data:r.setVirtualAction(e.action,e.value)}}const o=e.sourceId;switch(e.kind){case"axis":r.injectAxis(o,e.value);break;case"vector2":r.injectVector2(o,e.value);break;case"pointerDelta":r.injectPointerDelta(o,e.value);break;case"pointerPosition":r.injectPointerPosition(o,e.value);break;default:return{ok:!1,error:`unknown injection kind "${e.kind}"`}}return{ok:!0,data:{delivered:!0}}}catch(o){return n(o)}}},"set-time-scale":{derivedRefresh:"none",handle:e=>{const t=m();return t?(t.loop.timeScale=e.timeScale,{ok:!0,data:{timeScale:t.loop.timeScale}}):{ok:!1,error:"not in play mode — start play before setting time-scale"}}},"set-seed":{derivedRefresh:"none",handle:e=>{const t=m();return t?t.determinismDeclared?t.random?(t.random.reseed(e.seed),{ok:!0,data:{seed:t.random.seed}}):{ok:!1,error:"this play session has no first-party ctx.random to reseed"}:{ok:!1,error:"this project's manifest does not declare determinism.seededRandom — play.seed.set has no documented contract to reseed against (D15)",data:{code:"DETERMINISM_NOT_DECLARED"}}:{ok:!1,error:"not in play mode — start play before setting the seed"}}},"run-ticks":{derivedRefresh:"none",handle:async e=>{const t=m();if(!t)return{ok:!1,error:"not in play mode — start play before running ticks"};if(!t.runTicks)return{ok:!1,error:"this play session has no first-party Game to run ticks on",data:{code:"RUN_TICKS_UNAVAILABLE"}};try{const r=e.n,o=e.render;return t.runTicksSettled?await t.runTicksSettled(r,o?{render:o}:void 0):t.runTicks(r,o?{render:o}:void 0),{ok:!0}}catch(r){return n(r)}}}};export{Le as commands,Ge as point};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ab as m}from"./index-iW3HFEJB.js";import{b as p,a as e,c as n,s}from"./game-network-CU3Yp0oN.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"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-Cofo9dCU.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-BUPLu5EA.js";import"./contract-system-adapters-D9Gcb7R7.js";import"./game-contract-seams-DOwrbA13.js";import"./seeded-random-BIdiJ8w9.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CayyA6Tc.js";import"./capability-coverage-6I_iG0kk.js";import"./edit-mode-authoring-Du1CaTkH.js";import"./json-history-resource-82d2z68R.js";import"./binding-resolver-aDFCbAcG.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-C8OlRuJ5.js";import"./canvas-entry-runtime-BQdfSw1B.js";import"./three-ingest-runtime-Bqwv-JsZ.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CHE8woWv.js";import"./ingest-source-persistence-2MRBPgo0.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DPtVohIT.js";import"./mounted-authoring-30zCcxeV.js";import"./entity-object-BeRdaaqQ.js";import"./user-data-BGLBYiFw.js";import"./workspace-arrangement-6V8ZwB2d.js";import"./three-contract-Dkt6PmWY.js";import"./three-wsMw8Ifj.js";import"./editor-layers-qlgroPbE.js";import"./component-instance-root-9MmHwMal.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-DctJX96k.js";import"./source-persistence-backend-I5wxqQgh.js";import"./three-projection-core-rOK39WmJ.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-mLmXPi7n.js";import"./deferred-ingest-play-DVLTxYCk.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DgsCzOTj.js";import"./board-guides-BVkDJqat.js";import"./relative-import-specifier-CPCtuEhc.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-CUNyIUii.js";import"./inference-diagnostics-PcfFN6SD.js";import"./writer-tw6EcuVO.js";import"./three-state-Cu8xEils.js";import"./editor-shell-store-Di0waLQj.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-B7DJhMPS.js";const jt="workspace.command",a=()=>({ok:!1,error:"not in play mode — start play before using the debug seam"}),zt={"set-instance-count":{derivedRefresh:"always",handle:o=>{if(!e())return a();const r=o.names;if(Array.isArray(r)&&r.every(i=>typeof i=="string"))return r.length<1?{ok:!1,error:'set-instance-count "names" must have at least one entry.'}:(n(r),{ok:!0});const t=o.count;return typeof t!="number"||!Number.isFinite(t)||t<1?{ok:!1,error:`set-instance-count requires a whole "count" >= 1 (or a "names" array), got ${String(t)}.`}:(s(Math.floor(t)-1),{ok:!0})}},"list-instances":{derivedRefresh:"if-content-changed",handle:()=>({ok:!0,data:{instances:m(),named:p()}})}};export{zt as commands,jt as point};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-iW3HFEJB.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-CPiRKiDC.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{E as z,ez as me,f9 as he,cx as I,cy as fe,fU as ge,fl as ye,fZ as ve,f_ as be,f$ as we,g0 as Se,g1 as Ce,fR as xe,bw as X,O as g,br as Ee,ko as _,_ as N,bt as J,bv as K,aw as Ae,j as Ie,bu as Pe}from"./index-iW3HFEJB.js";import{m as P}from"./capability-coverage-6I_iG0kk.js";import{n as ke}from"./after-paint-CB4bz1-e.js";import{BabylonAuthoringAdapter as Re}from"./babylon-authoring-adapter-DBBX2Hem.js";import{a as k,S as Y,s as De,c as Me,C as $e,D as R,G as je,B as _e,H as T,E as L,T as Te,j as q,k as Q,l as Z,r as ee,p as te,o as ne,U as Ge,K as se,u as Oe}from"./active-ingest-CHE8woWv.js";import{c as Le,a as Be}from"./json-history-resource-82d2z68R.js";import{P as Fe}from"./pixi-authoring-adapter-DR6NNYrL.js";import{createLiveCanvasWriteTarget as We}from"./pixi-live-write-target-CXDKS1kQ.js";import{a as Ne}from"./source-persistence-backend-I5wxqQgh.js";import{resolveCanvasPixiForEditor as He}from"./canvas-entry-runtime-BQdfSw1B.js";import{registerPresentedPixiApps as Ue,capturePixiDisplayObjectThumbnail as Ve}from"./canvas-preview-frames-Bc44u87o.js";import{p as ze}from"./contract-system-adapters-D9Gcb7R7.js";import{s as Xe,d as Je,f as Ke,b as re,g as Ye,e as ie,w as qe,j as Qe}from"./resolve-three-DRDYxBE9.js";import{createPhysics2DRegistry as Ze}from"./physics-registry-B2Jkp8e6.js";import{composePhysicsAdapters2D as et,createPhysicsAdapter2D as tt}from"./system-adapters-rIC8FSGP.js";import{s as nt}from"./mount-ingest-root-9KaA9ETn.js";import{landIngestBootInEdit as ae}from"./ingest-boot-viewport-CrnkiTcJ.js";import{a as C}from"./jsx-runtime-DPjLkJKQ.js";import{b as st}from"./react-canvas-navigation-IPhloKzi.js";import{C as H,a as rt,b as it}from"./CanvasSceneViewport-CrmQdonP.js";import{R as at}from"./RootSelectionOverlay-47LRczuj.js";import{e as ot,S as ct}from"./surface-state-BUmVXUJj.js";import{r as w}from"./index-nmcBqr7Y.js";import{b as dt,e as lt,g as ut}from"./registry-XvQ4sPew.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./game-contract-seams-DOwrbA13.js";import"./ingest-source-persistence-2MRBPgo0.js";import"./index-BPUmREu0.js";import"./component-instance-root-9MmHwMal.js";import"./user-data-BGLBYiFw.js";import"./workspace-arrangement-6V8ZwB2d.js";import"./pixi-transform-channels-P4rvmusc.js";import"./debug-registry-BUPLu5EA.js";import"./dom-authoring-adapter-71D70rVP.js";import"./react-world-authoring-adapter-DgsCzOTj.js";import"./board-guides-BVkDJqat.js";import"./relative-import-specifier-CPCtuEhc.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-CUNyIUii.js";import"./inference-diagnostics-PcfFN6SD.js";import"./writer-tw6EcuVO.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./three.core-3arARmh6.js";import"./three-state-Cu8xEils.js";import"./editor-shell-store-Di0waLQj.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./Pass-D1MRT672.js";import"./editor-layers-qlgroPbE.js";import"./entity-object-BeRdaaqQ.js";import"./three-contract-Dkt6PmWY.js";import"./Toolbar-CAnrijz7.js";import"./transform-mode-request-C7qvcvEe.js";import"./TransientHint-BiIz-7Hh.js";import"./layered-pick-Db8YSlDp.js";import"./root-stacking-BEd9ZvxC.js";import"./eyedropper-session-bjPXnfeX.js";import"./react-story-board-CPTQdOIn.js";import"./viewport-editor-controls-BYaAZ_Ku.js";function pt(n){if(typeof n?.game?.scene?.getScenes=="function")return n.game;const e=n?.Phaser?.GAMES;return Array.isArray(e)?e.find(t=>typeof t?.scene?.getScenes=="function")??null:null}function mt(n){const e=n?.__volterBabylon?.engines,t=Array.isArray(e)?e:n?.BABYLON?.Engine?.Instances;return Array.isArray(t)?[...t].reverse().find(s=>Array.isArray(s?.scenes)&&s.scenes.length>0)??null:null}function ht(n){return[0,0,Math.sin(n/2),Math.cos(n/2)]}function ft(n){return 2*Math.atan2(n[2],n[3])}function gt(n){return encodeURIComponent(n||"unnamed")}function yt(n){return Array.isArray(n.list)?n.list:[]}class vt{constructor(e,t){this.game=e,this.store=t}capabilities={transform:!0,inspectorFields:!0,persist:!1};provenance={source:"foreign",label:"live-only",detail:"Live Phaser scene/display lists projected directly — edits apply to native game objects for this session only."};persistence={...Le(),destination:"live-only (not saved)"};indexed=new Map;listeners=new Set;refresh(){this.reindex();let e=0,t=0;for(const s of this.indexed.values())s.kind==="scene"?e++:t++;return{scenes:e,objects:t}}scenes(){const e=this.game.scene?.getScenes;if(typeof e!="function")return[];const t=e.call(this.game.scene,!0);return Array.isArray(t)?t:[]}reindex(){this.indexed.clear();for(const[e,t]of this.scenes().entries()){const s=t.sys?.settings?.key||`Scene ${e+1}`,r=`phaser:scene:${e}:${gt(s)}`,o=Array.isArray(t.children?.list)?t.children.list:[],a={id:r,label:s,role:"root",kind:"phaser-scene",typeLabel:"Phaser.Scene",parentId:null,childIds:[]};this.indexed.set(r,{kind:"scene",scene:t,node:a}),a.childIds=o.map((i,c)=>this.indexObject(i,r,`${e}/${c}`))}}indexObject(e,t,s){const r=e.type||e.constructor?.name||"GameObject",o=e.name||r,a=`phaser:object:${s}`,i={id:a,label:o,role:"entity",kind:`phaser-${r.toLowerCase()}`,typeLabel:r,parentId:t,childIds:[]};return this.indexed.set(a,{kind:"object",object:e,node:i}),i.childIds=yt(e).map((c,d)=>this.indexObject(c,a,`${s}/${d}`)),a}hierarchy={roots:()=>(this.reindex(),[...this.indexed.values()].filter(e=>e.kind==="scene").map(e=>e.node)),node:e=>(this.reindex(),this.indexed.get(e)?.node??null)};selection={get:()=>[...this.store.shell.selectedEntityIds],set:e=>{this.store.shell.selectMultiple(e),this.notify()}};transforms={dimensions:e=>(this.reindex(),this.indexed.get(e)?.kind==="object"?"2d":null),get:e=>{this.reindex();const t=this.indexed.get(e);if(!t||t.kind!=="object")return{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]};const s=t.object;return{position:[s.x??0,s.y??0,s.depth??0],rotation:ht(s.rotation??0),scale:[s.scaleX??1,s.scaleY??1,1]}},beginEdit:e=>{},apply:(e,t)=>{this.reindex();const s=this.indexed.get(e);!s||s.kind!=="object"||(s.object.x=t.position[0],s.object.y=t.position[1],s.object.depth=t.position[2],s.object.rotation=ft(t.rotation),s.object.scaleX=t.scale[0],s.object.scaleY=t.scale[1],this.notify())},endEdit:e=>{}};inspector={properties:e=>{this.reindex();const t=this.indexed.get(e);return t?t.kind==="scene"?[{path:"key",label:"Scene key",type:"string",readonly:!0}]:[{path:"type",label:"Type",type:"string",readonly:!0},{path:"name",label:"Name",type:"string"},{path:"active",label:"Active",type:"boolean"},{path:"visible",label:"Visible",type:"boolean"},{path:"alpha",label:"Alpha",type:"number"},{path:"depth",label:"Depth",type:"number"}]:[]},get:(e,t)=>{this.reindex();const s=this.indexed.get(e);if(s)return s.kind==="scene"?t==="key"?s.scene.sys?.settings?.key:void 0:t==="type"?s.object.type||s.object.constructor?.name:s.object[t]},set:(e,t,s)=>{this.reindex();const r=this.indexed.get(e);!r||r.kind!=="object"||t==="type"||(r.object[t]=s,this.notify())}};subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}dispose(){this.listeners.clear(),this.indexed.clear()}notify(){for(const e of this.listeners)e();this.store.shell.notifyIngestEdit()}}function bt(n){return We({physics:n.physics,persistence:Ne({history:n.history,writer:n.writer})})}function wt(n,e={}){const s=n.Application.prototype;let r=null,o=0;const a=[],i=Object.getOwnPropertyDescriptor(s,"render"),c=s.render;return Object.defineProperty(s,"render",{configurable:!0,writable:!0,value:function(...d){o++;const u=this.stage;if(!r&&u){const p={stage:u,renderer:this.renderer,app:this};if(e.accept?.(p)??!0){r=p;for(const f of a.splice(0))f(r)}}return c?.apply(this,d)}}),{get captured(){return r},getDrawCount(){return o},setPaused(d){const u=r?.app;u?.ticker&&(d?u.ticker.stop():u.ticker.start())},waitForCapture(d){const u=typeof d=="number"?{timeoutMs:d}:d??{},p=u.timeoutMs??1e4;return r?Promise.resolve(r):new Promise((f,x)=>{const y=Xe({budgetMs:p,clock:u.visibility??Je(),onExpire:()=>{const l=a.indexOf(S);l>=0&&a.splice(l,1),u.onWait?.(null),x(new Error(`pixi scene capture timed out after ${p}ms of VISIBLE time (${Math.round(y.elapsedHiddenMs())}ms browser-suspended, which is not counted because no frame can be presented) — the game never rendered, or it bundles its own (un-shared) copy of pixi.js.`))}}),S=l=>{y.cancel(),u.onWait?.(null),f(l)};a.push(S),u.onWait?.(y)})},uninstall(){i?Object.defineProperty(s,"render",i):c&&Object.defineProperty(s,"render",{configurable:!0,writable:!0,value:c})}}}const oe="IngestGame2DLoadError";class St extends Error{constructor(e,t){super(`pixi ingest: game "${e}" failed to load: ${t}`,{cause:t}),this.name=oe}}async function Ct(n,e,t={}){const s=wt(n,{...t.acceptCapture?{accept:t.acceptCapture}:{}});try{if(await e.load(),await t.preferStructuralRuntime?.())return s.uninstall(),null}catch(o){throw s.uninstall(),new St(e.id,o)}const r=t.captureTimeoutMs??e.captureTimeoutMs??8e3;try{return{stage:(await s.waitForCapture({timeoutMs:r,...t.onWait?{onWait:t.onWait}:{}})).stage,capture:s,setPaused:a=>s.setPaused(a),dispose:()=>s.uninstall()}}catch(o){throw s.uninstall(),new Error(`pixi ingest: game "${e.id}" rendered no capturable frame within ${r}ms: ${o}`)}}const xt=1500,Et=1e4;function At(n,e){const t=e.settleGraceMs??xt,s=e.deadlineMs??Et;let r=null,o=null;const a=i=>{e.isHeld()&&(r??=i,o===null&&e.currentScene()===n&&(o=i),e.render(),!(o!==null&&i-o>=t)&&(o===null&&i-r>=s||e.schedule(a)))};e.schedule(a)}function It(n){const e=k();if(e?.kind!=="canvas"||!e.session.adapter)return()=>{};const t=z()?.scenes;if(t&&me(t))return()=>{};const s=e.worldId;he({id:I,title:"Scene",kind:"world",workspaceRole:"authored-subject",provenance:{rootId:s},Content:n,closeable:!1,presentation:()=>({kind:"world",id:s})}),fe(I);const r=ge(s,I);return()=>{r(),ye(I,{discardDirty:!0})}}function Pt(){const n=z()?.scenes;if(!n?.default)return;const e=n.entries.find(r=>r.id===n.default),t=e?.source?.export??e?.id;return t?(Y()?.storiesFor("")??[]).find(r=>r.label===t||r.id===t)?.id:void 0}function kt({active:n,adapter:e,documentId:t,store:s,worldId:r,contractSceneId:o}){const a=w.useRef(null),c=w.useRef(ve()).current;w.useSyncExternalStore(s.shell.subscribe,s.shell.getSnapshot);const d=w.useSyncExternalStore(be,we),u=w.useSyncExternalStore(Se,Ce),p=k(),f=e.hierarchy.roots(),x=new Set(e.rects?.emptyContainers?.().map(l=>l.id)??[]),y=f.some(l=>!x.has(l.id)),S=ot({surface:"Ingest scene",rootIds:[r],phase:p?.kind==="canvas"&&p.worldId===r&&p.session.hostEl?"ready":"loading",content:p?.kind!=="canvas"||p.worldId!==r||!p.session.hostEl?"unknown":y?"present":"empty",readiness:d,failures:u});return w.useEffect(()=>xe(t,()=>({adapter:e,nodeId:[...s.shell.selectedEntityIds].find(l=>e.hierarchy.node(l))??null})),[e,t,s]),w.useEffect(()=>{const l=a.current;if(l)return st(l,c)},[c]),w.useEffect(()=>{if(!n)return;const l=a.current,v=k(),b=v?.kind==="canvas"?v.session.hostEl:void 0;if(!(!l||!b))return l.appendChild(b),()=>{const E=X();E&&b.parentElement===l&&E.appendChild(b)}},[n]),w.useEffect(()=>{if(!n)return;const l=o??Pt();if(!l)return;const v=Y();v&&v.goToScene(l)},[n,o]),C.jsxs("div",{ref:a,"data-testid":"world-document:ingest-canvas-scene","data-volter-backdrop-color":n?H:void 0,"data-volter-backdrop-policy":n?"dark-frost":void 0,style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"auto",backgroundColor:H,touchAction:"none"},children:[C.jsx(rt,{view:c,documentId:t}),C.jsx(at,{adapter:e,view:c,transformModeAware:!0,presentationId:t}),C.jsx(ct,{explanation:S,testId:"ingest-canvas-surface-status",style:{zIndex:20}}),C.jsx(it,{active:n,adapter:e,containerRef:a,view:c,documentId:t})]})}function ce(n){const e=k();if(e?.kind!=="canvas"||!e.session.adapter)return()=>{};const t=e.session.adapter,s=e.worldId;return It(o=>C.jsx(kt,{...o,adapter:t,store:n,worldId:s}))}function Rt(n,e){const{adapter:t}=n;if(t.type!=="ingest")throw new Error(`resolveIngest2DDescriptor: world "${n.id}" is not an { ingest } world.`);if(!n.entry)throw new Error(`resolveIngest2DDescriptor: world "${n.id}" has no \`entry\` — an ingest root mounts the game's own entry module.`);const s=Ke(e);return{id:n.id,name:n.id,description:n.description??"",...t.captureTimeoutMs!==void 0?{captureTimeoutMs:t.captureTimeoutMs}:{},load:re(s.entry(n.entry),t.contractShim===void 0?void 0:s.module(t.contractShim))}}function U(n,e){const t=ut(n,e),s=lt[t];if(!s)throw new Error(`canvas ingest discovery: "${n}"'s module "${e}" did not match any game module (looked for glob key "${t}").`);return s}function Dt({folderId:n,manifest:e,root:t}){const{adapter:s}=t;if(!t.entry)throw new Error(`canvas ingest discovery: "${n}" has no \`entry\` — an ingest root mounts the game's own entry module.`);return{...{id:t.id,name:e.name,description:t.description??"",...s.captureTimeoutMs!==void 0?{captureTimeoutMs:s.captureTimeoutMs}:{}},load:re(U(n,t.entry),s.contractShim===void 0?void 0:U(n,s.contractShim))}}let G=null;function Mt(){return G||(G=dt("canvas").map(Dt).sort((n,e)=>n.id.localeCompare(e.id))),G}function $t(n){return Mt().find(e=>e.id===n)}const jt="this game imports the host's pixi directly, in the editor's own realm";function de(n,e,t){const s=R()?.systems;let r=null;const{systems:o,renderDebug:a,debugCollisions:i}=qe({contractSystems:s,surface:"canvas",...t?{physics:t}:{},...e?{canvasRuntime:{renderer:e}}:{},setRenderPassHooks:c=>{r?.(),r=c?Qe(e,c):null}});Pe(o),g.log(s?`canvas ingest: "${n}" declares the volter game contract — ${s.commands?.length??0} commands, ${s.state?.length??0} state providers`:`canvas ingest: "${n}" declares no volter game contract — game.commands()/game.state() have nothing to answer and will refuse by naming that`,"ingest");for(const c of i)g.error(`canvas ingest: "${n}" — ${c}; it will refuse`,"ingest");return e&&g.log(a?`canvas ingest: "${n}" render debugging is live — the Frame debugger captures through the game's own Pixi renderer (draws are unattributed: Pixi's batcher merges display objects, so no display object is the author of a draw)`:`canvas ingest: "${n}" has no render-debug capability — its renderer exposes no real WebGL2 context, or no prerender/postrender runners to bracket`,"ingest"),{wiring:a,uninstall:()=>r?.()}}function _t(n,e){return e instanceof Error&&e.name===oe?`canvas ingest: game "${n}" never ran — its own modules failed to load, so nothing could render and there is no canvas runtime in the realm to recognize (${e})`:`canvas ingest: game "${n}" mounted no recognized canvas runtime — the host's pixi captured no frame, and the realm holds no Phaser game or Babylon.js engine on their own public registries either (${e})`}function Tt(n,e){const t=n?.canvas;return t instanceof Node&&e.contains(t)}function le(){return Ie(ze(R()?.systems,"canvas").bound.physics)}function O(n,e){const t=pt(e);if(t)return{runtime:"phaser",adapter:new vt(t,n),mechanism:"this game runs its own Phaser instance in the editor's own realm; the host reads that live game’s active scenes and display lists"};const s=mt(e);return s?{runtime:"babylon",adapter:new Re(s,n),mechanism:"this game runs its own Babylon.js engine in the editor's own realm; the host reads that live engine’s scenes and root nodes"}:null}function V(n,e,t,s,r){const o=r.adapter;o.refresh();const a=ie({primary:o,worldId:t,hostEl:s,store:n}),i=se(),c=()=>i?{loop:null,reason:"the same-realm loop gate holds this game’s scheduling, but no probe has measured that control on this route"}:{loop:null,reason:Ge},d=q(i?{setPaused:p=>{p?i.hold():i.release()}}:{pauseGap:`${r.runtime} exposes no host-controlled loop gate`});let u=()=>{};Q({kind:"canvas",session:{store:n,adapter:o,hostEl:s,lifecycle:d,loop:c,dispose:()=>{u(),o.dispose(),L(),s.remove()}},siblings:[],worldId:t}),u=ce(n),Z(()=>n.shell.playState==="playing"&&n.shell.activeViewportTab==="play"),J(a),de(e.name,void 0,le()),ae(),n.shell.notifyIngestEdit(),K(),ee({reach:P({authoring:a}),reachMechanism:r.mechanism,loop:c}),g.log(`canvas ingest: recognized ${r.runtime} in the realm and captured "${e.name}"`,"ingest"),te("__volterIngest2D",{gameId:t,...ne(a),runtime:r.runtime,get reflected(){return o.refresh()},...d.setPaused?{setPaused:d.setPaused}:{},reach:P({authoring:a}),adapter:a,store:n})}async function Gt(n,e,t){Me(),await Ee();const s=X();if(!s){g.error("Game container not mounted — cannot ingest (canvas)","ingest");return}n.shell.setPlayState("playing"),g.log(`Ingesting unmodified PixiJS game: ${e.name}`,"ingest");const r=$e(R());r.malformed!==null&&g.error(`Ingest game "${e.id}" ${r.malformed} — the host is measuring readiness instead.`,"ingest");const o=r.ready===null?"measured-wait":"contract-ready",a=r.ready===null?"measured":"declared";_({rootId:e.id,mechanism:o,source:a,state:"waiting"});const i=document.createElement("div");i.id="container",i.style.cssText=`position:absolute;inset:0;width:100%;height:100%;overflow:hidden;background:#000;${je}`,s.appendChild(i),_e(i);{const{markGameCssScope:h}=await N(async()=>{const{markGameCssScope:$}=await import("./index-iW3HFEJB.js").then(j=>j.tX);return{markGameCssScope:$}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));h(i);const m=Ae();if(m){const{ensureScopedGameStyles:$}=await N(async()=>{const{ensureScopedGameStyles:j}=await import("./index-iW3HFEJB.js").then(pe=>pe.tY);return{ensureScopedGameStyles:j}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));await $(m.rootPath)}}window.__volterMountCold=!0;const c=await He();let d;try{const h=await Ct(c,e,{...e.captureTimeoutMs!==void 0?{captureTimeoutMs:e.captureTimeoutMs}:{},acceptCapture:({renderer:m})=>Tt(m,i),onWait:m=>nt(e.id,m),preferStructuralRuntime:async()=>{const m=T();return await m.__volterBabylon?.ready,O(n,m)!==null}});if(h===null){const m=O(n,T());if(m){V(n,e,t,i,m);return}throw new Error(`canvas ingest: game "${e.id}" reported a structural runtime, but it disappeared before dispatch`)}d=h}catch(h){const m=O(n,T());if(m){V(n,e,t,i,m);return}throw L(),i.remove(),_({rootId:e.id,mechanism:o,source:a,state:"failed",failure:r.ready===null?"no-readiness-declaration":"declared-ready-never-resolved"}),new Error(_t(e.id,h))}const u=d.stage;for(let h=0;h<90&&(u.children?.length??0)===0;h++)await ke();const p=d.capture.captured?.app,f=p?.canvas;f&&(Ye(f),f.parentElement!==i&&i.appendChild(f));const x=Ue(p?[p]:[]),y=le(),S=tt(Ze()),l=y?et([y,S]):S,v=Te(R(),{onSwitchAccepted:h=>At(h,{isHeld:()=>!Oe(),currentScene:()=>v?.active("")??null,render:()=>p?.render(),schedule:m=>requestAnimationFrame(m)})}),b=new Fe(u,n,{pixi:c,journal:Be(t),target:bt({physics:l,history:n.shell.projectHistory}),...v?{stories:v}:{},surface:()=>p?.canvas??null,capturePreview:(h,m)=>Ve(h,{...m,pixi:c})}),E=b.refresh(),A=ie({primary:b,worldId:t,hostEl:i,store:n});let D=null,B=()=>{};const F=se(),W=q({setPaused:h=>{d.setPaused(h),h?F?.hold():F?.release()}});Q({kind:"canvas",session:{store:n,adapter:b,hostEl:i,lifecycle:W,dispose:()=>{B(),D?.uninstall(),D?.wiring?.dispose(),x(),d.dispose(),L(),i.remove()}},siblings:[],worldId:t}),B=ce(n),Z(()=>n.shell.playState==="playing"&&n.shell.activeViewportTab==="play"),J(A),D=de(e.name,d.capture.captured?.renderer,y?l:null),ae(),n.shell.notifyIngestEdit(),K();let M="measured";if(r.ready)try{await r.ready(),M="declared"}catch(h){g.error(`Ingest game "${e.id}" declared \`window.volterGame.ready\` and it REJECTED (${String(h)}) — the frame was already captured, so the host fell back to the measured settle wait. This root now reports readiness as measured.`,"ingest")}_({rootId:e.id,mechanism:M==="declared"?"contract-ready":"measured-wait",source:M,state:"ready"}),ee({reach:P({authoring:A}),reachMechanism:jt,loop:()=>({loop:null,reason:"the host stops and starts the captured PixiJS Application ticker directly, but no probe has measured whether that holds everything this game schedules"})}),g.log(`pixi ingest: captured "${e.name}" (${E.count} nodes, ${E.sprites} sprites)`,"ingest"),te("__volterIngest2D",{gameId:t,...ne(A),drawCount:()=>d.capture.getDrawCount(),get reflected(){return b.refresh()},setPaused:W.setPaused,reach:P({authoring:A}),adapter:A,store:n})}function ue(n,e,t){return De(()=>Gt(n,e,t))}async function Jn(n,e,t){const s=Rt(e,t);return ue(n,s,e.id)}async function Kn(n,e){const t=$t(e);if(!t){g.error(`Unknown pixi ingest game: ${e}`,"ingest");return}return ue(n,t,e)}export{ue as mountCanvasIngestRoot,Kn as mountCanvasIngestRootById,Jn as mountCanvasIngestRootFromManifest};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mount-canvas-ingest-root-nBqJPkbz.js","assets/index-iW3HFEJB.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-CPiRKiDC.css","assets/capability-coverage-6I_iG0kk.js","assets/game-contract-seams-DOwrbA13.js","assets/after-paint-CB4bz1-e.js","assets/babylon-authoring-adapter-DBBX2Hem.js","assets/json-history-resource-82d2z68R.js","assets/source-persistence-backend-I5wxqQgh.js","assets/ingest-source-persistence-2MRBPgo0.js","assets/active-ingest-CHE8woWv.js","assets/contract-system-adapters-D9Gcb7R7.js","assets/pixi-authoring-adapter-DR6NNYrL.js","assets/index-BPUmREu0.js","assets/component-instance-root-9MmHwMal.js","assets/user-data-BGLBYiFw.js","assets/workspace-arrangement-6V8ZwB2d.js","assets/pixi-transform-channels-P4rvmusc.js","assets/pixi-live-write-target-CXDKS1kQ.js","assets/canvas-entry-runtime-BQdfSw1B.js","assets/debug-registry-BUPLu5EA.js","assets/canvas-preview-frames-Bc44u87o.js","assets/resolve-three-DRDYxBE9.js","assets/dom-authoring-adapter-71D70rVP.js","assets/react-world-authoring-adapter-DgsCzOTj.js","assets/board-guides-BVkDJqat.js","assets/relative-import-specifier-CPCtuEhc.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-CUNyIUii.js","assets/inference-diagnostics-PcfFN6SD.js","assets/writer-tw6EcuVO.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/three.core-3arARmh6.js","assets/physics-registry-B2Jkp8e6.js","assets/system-adapters-rIC8FSGP.js","assets/ingest-boot-viewport-CrnkiTcJ.js","assets/react-canvas-navigation-IPhloKzi.js","assets/CanvasSceneViewport-CrmQdonP.js","assets/RootSelectionOverlay-47LRczuj.js","assets/eyedropper-session-bjPXnfeX.js","assets/layered-pick-Db8YSlDp.js","assets/root-stacking-BEd9ZvxC.js","assets/react-story-board-CPTQdOIn.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/Toolbar-CAnrijz7.js","assets/transform-mode-request-C7qvcvEe.js","assets/TransientHint-BiIz-7Hh.js","assets/surface-state-BUmVXUJj.js","assets/registry-XvQ4sPew.js","assets/three-state-Cu8xEils.js","assets/editor-shell-store-Di0waLQj.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/Pass-D1MRT672.js","assets/editor-layers-qlgroPbE.js","assets/entity-object-BeRdaaqQ.js","assets/three-contract-Dkt6PmWY.js","assets/mount-dom-ingest-root-BOEt11vp.js","assets/binding-resolver-aDFCbAcG.js","assets/native-debug-module-Cofo9dCU.js","assets/native-entry-surface-BE8LJNdu.js","assets/adapter-surface-Y37Nzcyw.js","assets/structural-signature-Dc7skRiy.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/index-bQE2NA0D.js","assets/realm-services-C8OlRuJ5.js","assets/three-ingest-runtime-Bqwv-JsZ.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/CSS3DRenderer-BsAqfavI.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-BHA-cdrW.js","assets/mount-three-ingest-root-C_0Slh91.js","assets/scene-framing-BWGUKaVh.js","assets/mount-readiness-DyAd17pe.js","assets/loop-gate-report-N52EWFGD.js","assets/three-authoring-adapter-DctJX96k.js","assets/three-projection-core-rOK39WmJ.js","assets/three-wsMw8Ifj.js","assets/body-marks-C1LxJtQb.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/structural-ids-BOo2BRoY.js","assets/object3d-authoring-subject-XccsO0xG.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/r3f-physics-binding-mLmXPi7n.js","assets/renderer-ownership-BovSEcLv.js","assets/scene-capture-aq3yUgox.js","assets/ingest-siblings-CQ95u6JM.js","assets/mounted-authoring-30zCcxeV.js","assets/crash-null-boundary-v3a0uEgw.js","assets/module-mode-BWoDD0oV.js","assets/deferred-ingest-play-DVLTxYCk.js","assets/edit-mode-authoring-Du1CaTkH.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{gS as S,aw as d,_ as s,y as k,gT as C,O as u,gU as T,bq as c,bw as g,z as L,bp as y,aA as I,gV as F,bt as O,gx as D,bv as V,gW as j}from"./index-iW3HFEJB.js";import{q as $,t as x,g as _,u as W,a as z,v as q,c as B,w as N,x as K,i as G,y as H}from"./active-ingest-CHE8woWv.js";import{o as U}from"./three-state-Cu8xEils.js";let M=null;const J=new Set;function Q(){for(const t of J)t()}function gt(t,n){M=n?{worldId:t,window:n}:null,Q(),S()}function X(){const t=M;if(!t)return null;const n=t.window.isHidden(),o=t.window.isSuspended(),e=t.window.suspensionReason();return{worldId:t.worldId,budgetMs:t.window.budgetMs,elapsedVisibleMs:Math.round(t.window.elapsedVisibleMs()),hidden:n,suspended:o,suspensionReason:e,reason:e==="hidden"?"waiting for first visible frame — tab is hidden (a hidden tab cannot render, so the capture window is parked, not counting down; bring the tab to the foreground)":e==="unfocused"?"waiting for the browser to resume frame presentation — the editor window is unfocused (WebKit can suspend requestAnimationFrame in this state, so the capture window is parked; focus the editor window)":e==="page-suspended"?"waiting for the browser to restore the suspended editor page — the capture window is parked, not counting down":o?"waiting for the browser to resume frame presentation — the capture window is parked":"waiting for the game's first rendered frame"}}function R(){const t=z();if(!t)return null;const n=t.kind==="three"?t.session.mount:void 0,o=t.kind==="canvas"?t.session.loop?.():void 0,e=$(n?.realmLoopVerdict?.())??o?.loop??null,r=n?.realmLoopVerdict?.()?.reason??o?.reason??null;return{worldId:t.worldId,kind:t.kind,playing:W(),loop:e,loopReason:r,canStep:_()?.canStep??!1,coverage:x()}}const Y=()=>s(()=>import("./mount-canvas-ingest-root-nBqJPkbz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64])),Z=()=>s(()=>import("./mount-dom-ingest-root-BOEt11vp.js"),__vite__mapDeps([65,1,2,3,4,5,6,7,8,9,10,11,12,66,67,68,28,19,69,70,40,39,71,60,72,73,27,74,75,76,77,61,78,79,80,18,17,15,31,32,33,34,35,36,37,38,43,56])),tt=()=>s(()=>import("./mount-three-ingest-root-C_0Slh91.js"),__vite__mapDeps([81,11,1,2,3,4,5,6,7,8,9,10,12,18,17,19,82,62,24,40,30,15,31,32,33,34,35,36,37,38,28,39,22,23,74,60,75,76,77,61,78,83,84,85,16,86,87,63,64,51,88,89,90,91,92,93,94,95,96,43,56,57,58,59]));function b(...t){return Y().then(n=>n.mountCanvasIngestRootFromManifest(...t))}function v(...t){return Z().then(n=>n.mountDomIngestRootFromManifest(...t))}function A(...t){return tt().then(n=>n.mountThreeIngestRootFromManifest(...t))}U(t=>{V()});j(()=>({ingest:R(),ingestCaptureWait:X()}));function l(t,n){u.error(`Ingest mount failed for "${n.worldId}" (${n.identity}): ${n.message}`,"ingest"),B(),q(),t.shell.setPlayState("stopped"),y(n),t.shell.notifyIngestEdit()}async function et(){try{return await k()}catch(t){return C(t)||u.error(`Ingest routing: this project's ${T} could not be read, so no root was mounted from it — ${c(t)}`,"ingest"),null}}function f(t){return L(t)}function p(t){const n=t.map(e=>`"${e.id}"`).join(", "),o=`a composite manifest declares exactly ONE ingest world in this slice — found ${t.length}: ${n}.`;u.error(`Manifest composite ingest route: ${o}`,"ingest");for(const e of t)y({worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:o})}async function w(t,n,o,e,r){const{mountIngestSiblings:a}=await s(async()=>{const{mountIngestSiblings:E}=await import("./ingest-siblings-CQ95u6JM.js");return{mountIngestSiblings:E}},__vite__mapDeps([97,1,2,3,4,5,6,7,8,9,10,98,63,23,24,64,20,21,16,17,22,15,25,26,27,28,99,73,74,60,40,75,76,77,61,78,80,31,32,33,34,35,36,37,38,41,42,85,86,62,87,51,88,89,90,91,92,93,94,100,11,12,66,67,68,19,69,70,39,71,72,79])),i=await a(t,n,o,e,r);return N(i),i}function m(t,n,o){if(o.length===0)return;const e=D();if(!e)return;const a=[...e instanceof I?e.childAdapters().map(i=>({worldId:i.worldId,kind:i.kind,adapter:i.adapter,role:i.role,zOrder:i.zOrder,...i.label!==void 0?{label:i.label}:{},...i.parentRootId!==void 0?{parentRootId:i.parentRootId}:{}})):[{worldId:n.id,kind:n.surface,adapter:e}],...o.map(i=>({worldId:i.worldId,kind:F(t,i.worldId)?.surface??"unknown",adapter:i.authoring}))];O(new I(a))}async function nt(t,n){if(!n)return!1;const o=f(n);if(o.length===0)return!1;if(o.length>1)return p(o),!0;const e=o[0];if(e.adapter.identity!=="ingest-three")return!1;const r=d();if(!r)return u.error("Manifest declares an ingest-three world but no project is open — cannot auto-ingest","ingest"),!0;try{await A(t,e,r.rootPath);const a=g();if(a){const i=await w(n,e.id,a,r.rootPath,t);m(n,e,i)}}catch(a){l(t,{worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:c(a)})}return!0}async function ot(t,n){if(!n)return!1;const o=f(n);if(o.length===0)return!1;if(o.length>1)return p(o),!0;const e=o[0];if(e.adapter.identity!=="ingest-pixi")return!1;const r=d();if(!r)return u.error("Manifest declares an ingest-pixi world but no project is open — cannot auto-ingest","ingest"),!0;try{await b(t,e,r.rootPath);const a=g();if(a){const i=await w(n,e.id,a,r.rootPath,t);m(n,e,i)}}catch(a){l(t,{worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:c(a)})}return!0}async function rt(t,n){if(!n)return!1;const o=f(n);if(o.length===0)return!1;if(o.length>1)return p(o),!0;const e=o[0];if(e.adapter.identity!=="ingest-react")return!1;const r=d();if(!r)return u.error("Manifest declares an ingest-react world but no project is open — cannot auto-ingest","ingest"),!0;try{await v(t,n,e,r.rootPath);const a=g();if(a){const i=await w(n,e.id,a,r.rootPath,t);m(n,e,i)}}catch(a){l(t,{worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:c(a)})}return!0}function it(t){return at(t,()=>st(t))}const h=new WeakMap;function at(t,n){let o=h.get(t);o||(o=new Map,h.set(t,o));const e=d()?.rootPath??"",r=o.get(e);if(r)return r;const a=n();return o.set(e,a),a}async function P(t){const{tryManifestModuleRoute:n}=await s(async()=>{const{tryManifestModuleRoute:e}=await import("./module-mode-BWoDD0oV.js");return{tryManifestModuleRoute:e}},__vite__mapDeps([100,1,2,3,4,5,6,7,8,9,10,11,12,66,67,68,28,19,69,70,40,39,71,60,72,73,27,74,75,76,77,61,78,79,80]));if(await n(t))return;const o=await et();await nt(t,o)||await ot(t,o)||await rt(t,o)}async function st(t){const{deferredIngestPlayActive:n,ingestMountIsDeferredToPlay:o}=await s(async()=>{const{deferredIngestPlayActive:e,ingestMountIsDeferredToPlay:r}=await import("./deferred-ingest-play-DVLTxYCk.js");return{deferredIngestPlayActive:e,ingestMountIsDeferredToPlay:r}},__vite__mapDeps([101,1,2,3,4,5,6,7,8,9,10,102,18,12,11,17,19]));if(await o()){if(n())return;const{landIngestBootInEdit:e}=await s(async()=>{const{landIngestBootInEdit:r}=await import("./ingest-boot-viewport-CrnkiTcJ.js");return{landIngestBootInEdit:r}},__vite__mapDeps([43,1,2,3,4,5,6,7,8,9,10,18,12,11,17,19]));e();return}await P(t)}const lt=Object.freeze(Object.defineProperty({__proto__:null,activeIngestKind:K,autoLaunchIngest:it,getIngestPlayControl:_,ingestStatusFacet:R,isIngestActive:G,launchIngestRoutes:P,mountCanvasIngestRootFromManifest:b,mountDomIngestRootFromManifest:v,mountThreeIngestRootFromManifest:A,unmountThreeIngestRoot:H},Symbol.toStringTag,{value:"Module"}));export{it as a,lt as m,gt as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{assertNever as u}from"./adapter-surface-Y37Nzcyw.js";import{aa as c,a9 as f}from"./index-iW3HFEJB.js";import{c as l}from"./create-runtime-D3CS8u84.js";import{m as h}from"./debug-bridge-LaiaWRls.js";import{g}from"./debug-registry-BUPLu5EA.js";import{R as y}from"./seeded-random-BIdiJ8w9.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"./binding-Bmxqznjk.js";import"./root-stacking-BEd9ZvxC.js";import"./assets-BcrMQHRv.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./setup-renderer-BI8Dltzx.js";import"./index-DHhMOs_s.js";import"./defaults-DKiBJCPN.js";import"./render-settings-CsCXKLaq.js";import"./render-features-CL2D1X_X.js";import"./loop-gate-report-N52EWFGD.js";import"./system-slot-E2mEdiih.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./performance-profiler-CMbwGBuk.js";import"./game-network-CU3Yp0oN.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-Cofo9dCU.js";import"./native-entry-surface-BE8LJNdu.js";import"./contract-system-adapters-D9Gcb7R7.js";import"./game-contract-seams-DOwrbA13.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CayyA6Tc.js";import"./capability-coverage-6I_iG0kk.js";import"./edit-mode-authoring-Du1CaTkH.js";import"./json-history-resource-82d2z68R.js";import"./binding-resolver-aDFCbAcG.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-C8OlRuJ5.js";import"./canvas-entry-runtime-BQdfSw1B.js";import"./three-ingest-runtime-Bqwv-JsZ.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CHE8woWv.js";import"./ingest-source-persistence-2MRBPgo0.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DPtVohIT.js";import"./mounted-authoring-30zCcxeV.js";import"./entity-object-BeRdaaqQ.js";import"./user-data-BGLBYiFw.js";import"./workspace-arrangement-6V8ZwB2d.js";import"./three-contract-Dkt6PmWY.js";import"./three-wsMw8Ifj.js";import"./editor-layers-qlgroPbE.js";import"./component-instance-root-9MmHwMal.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-DctJX96k.js";import"./source-persistence-backend-I5wxqQgh.js";import"./three-projection-core-rOK39WmJ.js";import"./body-marks-C1LxJtQb.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-mLmXPi7n.js";import"./deferred-ingest-play-DVLTxYCk.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DgsCzOTj.js";import"./board-guides-BVkDJqat.js";import"./relative-import-specifier-CPCtuEhc.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-CUNyIUii.js";import"./inference-diagnostics-PcfFN6SD.js";import"./writer-tw6EcuVO.js";import"./three-state-Cu8xEils.js";import"./editor-shell-store-Di0waLQj.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-B7DJhMPS.js";function R(e){if(e.determinism?.seededRandom!==!0)return;const t=e.url?v(e.url):void 0;return e.explicitSeed??t??e.determinism.defaultSeed}function v(e){const t=new URLSearchParams(e.search).get(y);if(t===null||t==="")return;const r=Number(t);return Number.isFinite(r)?r:void 0}function b(){return typeof window<"u"}function E(e){if(typeof e!="object"||e===null)return!1;if(Array.isArray(e.deferredConfigurationKinds))return!0;const t=e.roots;return!Array.isArray(t)||t.length===0?!1:t.every(r=>{if(typeof r!="object"||r===null)return!1;const i=r.adapter;if(typeof i!="object"||i===null)return!1;const o=i.type;return o==="builtin"||o==="module"||o==="ingest"})}function M(e){return E(e)?e:f(e,{configurationKinds:"defer"})}function $(e,t){if(t?.adapter)return t.adapter;throw e.adapter.type==="module"?new Error(`mountManifestRoots: world "${e.id}" (three) declares a { module } adapter ("${e.adapter.module}") — mountManifestRoots never imports an arbitrary module path itself (no \`/@fs/\`, no dev server). Import the module yourself and supply the constructed adapter via entries["${e.id}"] = { kind: 'three', adapter }.`):e.adapter.type==="ingest"?new Error(`mountManifestRoots: world "${e.id}" (three) declares an { ingest } adapter — captured ingest roots require the editor's dev-server-backed mount machinery (an EditorStore plus in-realm scene capture, see resolveIngestDescriptor + mountThreeIngestRootFromManifest) and are not supported by mountManifestRoots (no porting aids, no hosted ingest routes).`):e.entry!==void 0?new Error(`mountManifestRoots: world "${e.id}" (three) declares \`entry\` "${e.entry}" — supply entries["${e.id}"] = { kind: 'three', adapter } (for a default-exported world, the editor builds it from the entry module with \`resolveR3FEntryAdapterForEditor\`). Got ${t===void 0?"no entry at all":"an entry with no `adapter`"}.`):new Error(`mountManifestRoots: world "${e.id}" is default-three with no \`entry\` — this should have been rejected by manifest validation.`)}function w(e,t){if(t?.adapter)return t.adapter;throw new Error(`mountManifestRoots: world "${e.id}" (canvas) has no entries["${e.id}"] — a canvas world always needs a caller-supplied, already-constructed adapter (entries["${e.id}"] = { kind: 'canvas', adapter }, constructed from your own already-imported pixi module graph) — mountManifestRoots never value-imports pixi.js (mirrors create-runtime.ts's own pixi-free-core discipline).`)}function k(e,t){if(t?.adapter)return t.adapter;throw new Error(`mountManifestRoots: world "${e.id}" (react) has no entries["${e.id}"] — a react world always needs a caller-supplied, already-constructed \`RootAdapter<'dom'>\` (entries["${e.id}"] = { kind: 'dom', adapter }, mounting via your own already-imported react-dom \`createRoot\`) — mountManifestRoots never value-imports react/react-dom (mirrors create-runtime.ts's own react-free-core discipline).`)}function A(e,t){if(t!==void 0&&t.kind!==e.surface)throw new Error(`mountManifestRoots: entries["${e.id}"] declares kind "${t.kind}" but the manifest's root "${e.id}" uses surface "${e.surface}" — fix the entries key (or the manifest) so the two agree.`);const r={id:e.id,zOrder:e.zOrder,pausable:e.pausable,...t?.declaration===void 0?{}:{declaration:{root:e,...t.declaration}}};return e.surface==="three"?{...r,kind:"three",adapter:$(e,t)}:e.surface==="canvas"?{...r,kind:"canvas",adapter:w(e,t)}:e.surface==="dom"?{...r,kind:"dom",adapter:k(e,t)}:u(e.surface,"mountManifestRoots")}async function gt(e){const t=M(e.manifest),r=c(t);if(r.length===0)throw new Error("mountManifestRoots: manifest declares no roots — nothing to mount.");const i=e.entries??{},o=r.map(n=>A(n,i[n.id])),p=e.seedUrl??(b()?window.location:void 0),d=R({determinism:t.determinism,explicitSeed:e.seed,url:p}),a=await l({container:e.container,roots:o,width:e.width??t.resolution?.width,height:e.height??t.resolution?.height,headless:e.headless,...t.rendering===void 0?{}:{antialias:t.rendering.antialias},seed:d,playtest:e.playtest});t.determinism?.seededRandom;const s=g(a.game);if(s){t.configurations.some(m=>m.kind==="process")&&s.setRoomDeclared(!0);const n=h({registry:s,manifest:t,url:e.debugBridge?.url,window:e.debugBridge?.window});if(n){const m=a.stop;a.stop=()=>{n.uninstall(),m()}}}return a}export{gt as mountManifestRoots,R as resolveDeterminismSeed,M as resolveManifest};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as X}from"./capability-coverage-6I_iG0kk.js";import{O as h,at as Y,av as Z,kn as ee,ko as E,kp as D,kq as te,aw as O,kr as re,ks as oe,kt as ne,ku as se,br as ie,bw as ae,bt as ce,bu as de,bv as ue}from"./index-iW3HFEJB.js";import{A as le,G as me,B as pe,C as fe,D as v,E as W,F as he,H as ge,I as ye,J as we,K as M,L as be,s as ve,c as Se,M as Ie,j as Re,k as ke,l as Ee,N as $e,u as Ce,y as Me,z as Pe,O as Le,r as Ge,P as Ae,Q as Te,p as De,o as Oe}from"./active-ingest-CHE8woWv.js";import{p as We}from"./scene-framing-BWGUKaVh.js";import{w as je,c as H,h as _e,i as ze,a as Fe,b as He,r as Ue,e as xe}from"./resolve-three-DRDYxBE9.js";import{b as Ve}from"./component-instance-root-9MmHwMal.js";import{s as Ne}from"./ingest-source-persistence-2MRBPgo0.js";import{a as j}from"./json-history-resource-82d2z68R.js";import{r as Be}from"./three-ingest-runtime-Bqwv-JsZ.js";import{describeMountFailure as qe}from"./mount-readiness-DyAd17pe.js";import{formatLoopGateMessage as Je}from"./loop-gate-report-N52EWFGD.js";import{a as Ke,s as Qe}from"./three-authoring-adapter-DctJX96k.js";import{i as Xe}from"./renderer-ownership-BovSEcLv.js";import{installSceneCapture as Ye}from"./scene-capture-aq3yUgox.js";import{s as Ze}from"./mount-ingest-root-9KaA9ETn.js";import{landIngestBootInEdit as et}from"./ingest-boot-viewport-CrnkiTcJ.js";import{b as tt,c as _,e as rt,g as U}from"./registry-XvQ4sPew.js";import"./game-contract-seams-DOwrbA13.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"./contract-system-adapters-D9Gcb7R7.js";import"./editor-layers-qlgroPbE.js";import"./workspace-arrangement-6V8ZwB2d.js";import"./three.core-3arARmh6.js";import"./dom-authoring-adapter-71D70rVP.js";import"./react-world-authoring-adapter-DgsCzOTj.js";import"./board-guides-BVkDJqat.js";import"./relative-import-specifier-CPCtuEhc.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-CUNyIUii.js";import"./inference-diagnostics-PcfFN6SD.js";import"./writer-tw6EcuVO.js";import"./debug-registry-BUPLu5EA.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./user-data-BGLBYiFw.js";import"./three.module-BLhyNg0e.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./source-persistence-backend-I5wxqQgh.js";import"./three-projection-core-rOK39WmJ.js";import"./three-wsMw8Ifj.js";import"./entity-object-BeRdaaqQ.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-mLmXPi7n.js";import"./three-state-Cu8xEils.js";import"./editor-shell-store-Di0waLQj.js";import"./output-pass-HurwNl0G.js";const ot="contract-hierarchy:group:",I="contract-hierarchy:render-tree";function x(t){return`${ot}${encodeURIComponent(t)}`}function z(t){return{id:x(t.id),label:t.label,secondaryLabel:`${t.count} ${t.count===1?"item":"items"}`,role:"folder",kind:"group",parentId:null,childIds:[]}}function nt(t){if(!Array.isArray(t))throw new Error("hierarchy() did not return an array");const e=new Set;for(const r of t){if(typeof r!="object"||r===null||typeof r.id!="string"||r.id.trim().length===0||typeof r.label!="string"||r.label.trim().length===0||typeof r.count!="number"||!Number.isInteger(r.count)||r.count<0)throw new Error("hierarchy() returned an invalid { id, label, count } group");if(e.has(r.id))throw new Error(`hierarchy() returned duplicate id "${r.id}"`);e.add(r.id)}return t}function st(t,e){if(!e)return t;let r=!1;const n=()=>{try{return nt(e())}catch(i){return r||(r=!0,h.warn(`Ignored invalid game-contract hierarchy: ${i instanceof Error?i.message:String(i)}`,"ingest")),[]}},o=()=>{const i=n(),a=t.hierarchy.roots();return i.length===0?a:[...i.map(z),{id:I,label:"Rendered objects",secondaryLabel:"live tree",role:"folder",kind:"group",parentId:null,childIds:a.map(d=>d.id)}]},s=i=>{const a=n(),d=a.find(w=>x(w.id)===i);if(d)return z(d);if(a.length>0&&i===I){const w=t.hierarchy.roots();return{id:I,label:"Rendered objects",secondaryLabel:"live tree",role:"folder",kind:"group",parentId:null,childIds:w.map(g=>g.id)}}const f=t.hierarchy.node(i);return a.length>0&&f?.parentId===null?{...f,parentId:I}:f},l=new Proxy(t.hierarchy,{get(i,a){if(a==="roots")return o;if(a==="node")return s;const d=Reflect.get(i,a,i);return typeof d=="function"?d.bind(i):d}}),m=i=>{const a=t.subscribe?.(i),d=e.subscribe?.(i);return()=>{a?.(),d?.()}};return new Proxy(t,{get(i,a){if(a==="hierarchy")return l;if(a==="subscribe")return m;const d=Reflect.get(i,a,i);return typeof d=="function"?d.bind(i):d}})}const it="volterDomStub";let F=null;function V(t){for(const e of le())if(e.surface.contains(t))return e;return null}function at(){if(F!==null||typeof Element>"u")return;const t=Element.prototype,e=t.requestPointerLock;typeof e=="function"&&(F=e,t.requestPointerLock=function(r){const n=V(this);return n&&!n.gate()?(console.error("Ingested game requested pointer lock while its input gate is closed — refused. A game only captures the mouse while play is running AND the Game tab is active (the same predicate that gates its keyboard listeners); the editor viewport owns pointer lock otherwise. See packages/editor/src/ingest/game-pointer-lock.ts."),Promise.reject(new Error("pointer lock refused: game input gate is closed"))):e.call(this,r)})}function N(){if(typeof document>"u")return;const t=document.pointerLockElement;t&&V(t)&&document.exitPointerLock()}function ct(t,e,r,n,o={}){let s=null;return{setPaused(l){if(!l){n.resume(),o.realmGate?.release();return}n.pause(),o.realmGate?.hold(),ye({gate:o.realmGate??null,progress:()=>e.info?.render.frame??t.getDrawCount(),...o.verifyWindowMs!==void 0?{windowMs:o.verifyWindowMs}:{},...o.sleep!==void 0?{sleep:o.sleep}:{}}).then(m=>{s=m,o.onVerdict?.(m),m.loop!=="gated"&&console.warn(Je({worldId:r,reason:t.getAnimationLoop(e)?m.reason:`${m.reason} (this game also never called renderer.setAnimationLoop)`}))})},lastVerdict:()=>s}}function dt(t){let e=0;return t.traverse(r=>{Ve(r)!==void 0&&e++}),e}async function ut(t,e=2500,r=n=>new Promise(o=>setTimeout(o,n))){const n=performance.now();for(;;){const o=dt(t);if(o>0)return o;if(performance.now()-n>=e)return 0;await r(100)}}function lt(t,e){const r=e.replace(/\\/g,"/"),n=r.startsWith("/")?"":t.replace(/\\/g,"/"),o=[];for(const s of`${n}/${r}`.split("/"))s===""||s==="."||(s===".."?o.pop():o.push(s));return`/${o.join("/")}`}function mt(t,e){if(!t)return[];const r=t.replace(/\\/g,"/").replace(/\/+$/,""),n=new Set([r]);for(const o of e??[]){const s=lt(r,o),l=s.slice(0,s.lastIndexOf("/"));l&&n.add(l)}return[...n]}function pt(t,e){if(!t||e.length===0)return!1;for(const r of Object.values(t)){const n=r?.file;if(typeof n!="string")continue;const o=n.replace(/\\/g,"/");if(e.some(s=>o===s||o.startsWith(`${s}/`)))return!0}return!1}function ft(t){return t.servedStampedSource||t.graphStamps>0?"oid-source":"structural"}async function ht(){if(!await re())return null;try{return await oe().index?.()??null}catch{return null}}function gt(t){return h.getEntries().filter(e=>e.level==="error"&&e.source==="runtime"&&e.timestamp>=t).slice(-10).map(e=>e.count>1?`${e.message} (×${e.count})`:e.message)}async function yt(t,e,r){if(r)try{return await r(),"declared"}catch(n){h.error(`Ingest game "${t}" declared \`window.volterGame.ready\` and it REJECTED (${String(n)}) — the world was already captured, so the host fell back to the measured settle wait. This root now reports readiness as measured.`,"ingest")}return await wt(e),"measured"}async function wt(t,e=5e3){const r=performance.now();let n=-1,o=0;return new Promise(s=>{const l=()=>{const m=t.children.length;if(o=m===n?o+1:0,n=m,o>=3||performance.now()-r>e)return s();setTimeout(l,120)};l()})}function bt(t,e){const r=ge(),n=v()?.root??r.__volterGameRoot,o=n instanceof HTMLElement&&n.contains(e)?n:e;return o.contains(t)?t:(o.parentElement!==t&&t.contains(o)||(H(o),o.parentElement!==t&&t.appendChild(o)),o)}async function vt(t,e,r,n={}){const o=document.createElement("div");o.id="container",o.style.cssText=`position:absolute;inset:0;width:100%;height:100%;overflow:hidden;${me}`,r.appendChild(o);const s=pe(o);Y(o);const l=O();l&&await Z(l.rootPath);const m=[];for(const c of e.domStubs??[]){if(document.getElementById(c))continue;const p=document.createElement("div");p.id=c,p.style.display="none",p.dataset[it]="",o.appendChild(p),m.push(p)}const i=await Be(),a=i.three,d=Ye(a,i.EffectComposer,{isHostRenderer:Xe,additionalRendererCtors:[i.CSS3DRenderer],declaredScene:()=>{const c=be(v());return c.malformed!==null&&h.error(`Ingest game "${e.id}" ${c.malformed} — falling back to the MEASURED first-render adoption.`,"ingest"),c.world},onWorldAdoption:ee(e.id)});if(e.assets){const c=e.assets;a.DefaultLoadingManager.setURLModifier(p=>{for(const y of Object.keys(c))if(p.includes(y))return c[y];return p})}window.__volterMountCold=!0;const f=Date.now();await e.load();const w=n.captureTimeoutMs??1e4,g=fe(v());g.malformed!==null&&h.error(`Ingest game "${e.id}" ${g.malformed} — the host is measuring readiness instead.`,"ingest");const b=g.ready===null?"measured":"declared";E({rootId:e.id,mechanism:g.ready===null?"measured-wait":"contract-ready",source:b,state:"waiting"});let u;try{u=await d.waitForCapture({timeoutMs:w,onWait:c=>Ze(e.id,c)})}catch(c){d.uninstall(),a.DefaultLoadingManager.setURLModifier(y=>y);for(const y of m)y.remove();W(),o.remove(),D(e.id);const p=qe({gameId:e.id,timeoutMs:w,readinessSource:b,pageErrors:gt(f),cause:String(c)});throw E({rootId:e.id,mechanism:g.ready===null?"measured-wait":"contract-ready",source:b,state:"failed",failure:p.kind}),new Error(p.message)}const R=bt(o,u.renderer.domElement),S=he(v());S.malformed!==null&&h.error(`Ingest game "${e.id}" ${S.malformed} — the host is using the captured renderer’s canvas instead.`,"ingest"),te(e.id,S.canvas??u.renderer.domElement,S.canvas?"declared":"measured"),at();const P=await yt(e.id,u.scene,g.ready);E({rootId:e.id,mechanism:P==="declared"?"contract-ready":"measured-wait",source:P,state:"ready"});const k={pause:()=>u.renderer.setAnimationLoop?.(null),resume:()=>{const c=d.getAnimationLoop(u.renderer);c&&u.renderer.setAnimationLoop?.(c)}};Ne(e.dataWriter??null);const q=mt(O()?.rootPath,e.sourceModules),L=pt(await ht(),q),J=L?0:await ut(u.scene),G=ft({servedStampedSource:L,graphStamps:J})==="oid-source"?Ke(t,u.scene,{worldId:e.id,loop:k,camera:u.camera,journal:j(e.id)}):Qe(t,u.scene,{loop:k,camera:u.camera,journal:j(e.id)}),A=ct(d,u.renderer,e.id,k,{realmGate:M(),onVerdict:()=>t.shell.notifyIngestEdit()}),{systems:T,renderDebug:K,debugCollisions:Q}=je({contractSystems:v()?.systems,surface:"three",runtime:u,setRenderPassHooks:c=>d.setRenderPassHooks(c)});for(const c of Q)h.error(`Ingest game "${e.id}" — ${c}; it will refuse`,"ingest");return{game:{kind:"three",scene:u.scene,camera:u.camera,drivesOwnLoop:!0,...Object.keys(T).length>0?{systems:T}:{},setPaused:c=>A.setPaused(c),resize:(c,p)=>{if(s.gameResizesItself){s.dispatchResize();return}const y=_e(c,p);u.renderer.setSize(y.width,y.height,!1),d.resizeComposers(y.width,y.height),H(R)},dispose:()=>{d.setRenderPassHooks(null),we(),K?.dispose();try{u.renderer.setAnimationLoop?.(null),u.renderer.dispose?.()}catch{}d.uninstall(),a.DefaultLoadingManager.setURLModifier(c=>c);for(const c of m)c.remove();N(),W(),ne(e.id),se(e.id),D(e.id),o.remove()},authoring:G},authoring:G,hostEl:o,capture:d,scene:u.scene,realmLoopVerdict:()=>A.lastVerdict()}}function St(t,e){const r={};for(const[n,o]of Object.entries(e)){const s=U(t,o),l=_[s];if(!l)throw new Error(`ingest discovery: "${t}"'s asset "${o}" did not match any served asset (looked for glob key "${s}" — available: ${Object.keys(_).join(", ")})`);r[n]=l}return r}function $(t,e){const r=U(t,e),n=rt[r];if(!n)throw new Error(`ingest discovery: "${t}"'s module "${e}" did not match any game module (looked for glob key "${r}").`);return n}function It({folderId:t,manifest:e,root:r}){const{adapter:n}=r;if(!r.entry)throw new Error(`ingest discovery: "${t}" has no \`entry\` — an ingest root mounts the game's own entry module.`);return{...{id:r.id,name:e.name,description:r.description??"",gameVersion:e.version,sourceModules:Fe(r.entry,r.world?.entry),...ze(n.dataWriter,s=>$(t,s)),...n.assets!==void 0?{assets:St(t,n.assets)}:{},...n.domStubs!==void 0?{domStubs:n.domStubs}:{},...n.captureTimeoutMs!==void 0?{captureTimeoutMs:n.captureTimeoutMs}:{}},load:He($(t,r.entry),n.contractShim===void 0?void 0:$(t,n.contractShim))}}let C=null;function Rt(){return C||(C=tt("three").map(It).sort((t,e)=>t.id.localeCompare(e.id))),C}function kt(t){return Rt().find(e=>e.id===t)}function Et(t){return t==="devtools-observer"?"this game runs its OWN copy of three; the host reached its renderer through three's `__THREE_DEVTOOLS__` observation seam":"this game imports the host's three directly, in the editor's own realm"}function $t(t){const{store:e,session:r,sessionId:n}=t,o=r.mount;if(!o)return;const s=o.authoring,l=Pe(),m=st(s,l?.systems?.hierarchy),i=xe({primary:m,worldId:n,hostEl:o.hostEl,...l?.root?{declaredRoot:l.root}:{},store:e}),a=o.scene,d=new ResizeObserver(()=>{const u=t.gameContainer.getBoundingClientRect();u.width>0&&u.height>0&&o.game.resize?.(u.width,u.height)});d.observe(t.gameContainer),r.resizeObserver=d;const f=s.refresh(),w=s.measureWriteReach();h.log(`Captured live scene (${a.children.length} top-level children, ${o.capture.getDrawCount()} draws); ingested ${f.count} objects (${f.meshes} meshes, ${f.lights} lights`+(f.instancedMeshes>0?`, incl. ${f.instancedMeshes} InstancedMesh drawing ${f.instances} units`:"")+`); ${w.addressable} of ${w.total} have a source address — edits go to ${w.destination}`,"ingest"),Le(n,o.realmLoopVerdict?.()??void 0),ce(i),de(o.game.systems??{}),e.enterPlayScene(a,void 0,s.objectMapSnapshot()),e.focusOnScene(()=>We(o.capture.captured?.camera,a)),et(),e.shell.notifyIngestEdit(),ue();const g=X({authoring:i});Ge({reach:g,reachMechanism:Et(o.capture.capturedVia),loop:()=>Ae(o),writeReach:()=>s.measureWriteReach()});const b={gameId:n,...Oe(i),drawCount:()=>o.capture.getDrawCount(),get reflected(){return s.refresh()},get sceneChildren(){return a.children.length},reach:g,resize:(u,R)=>o.game.resize?.(u,R),...r.lifecycle.setPaused?{setPaused:r.lifecycle.setPaused}:{}};Te(b,o),De("__volterIngest",b)}async function Ct(t,e,r){Se(),Ie(r),await ie();const n=ae();if(!n){h.error("Game container not mounted — cannot ingest","ingest");return}t.shell.setPlayState("playing"),h.log(`Ingesting unmodified game: ${e.name}`,"ingest");const o=()=>t.shell.playState==="playing"&&t.shell.activeViewportTab==="play";try{const s={captureTimeoutMs:e.captureTimeoutMs},l=await vt(t,e,n,s),m=l.game.setPaused,i={store:t,mount:l,lifecycle:Re(m?{setPaused:a=>m(a),step:()=>M()?.step(1),canStep:()=>l.realmLoopVerdict?.()?.loop==="gated"&&M()!==null}:{pauseGap:"the captured Three root exposes no mounted setPaused capability"})};ke({kind:"three",session:i,siblings:[],worldId:r}),Ee(o),i.inputGateUnsubscribe=t.shell.subscribe(()=>{o()||N()}),$e(Ce()),$t({store:t,session:i,gameContainer:n,sessionId:r})}catch(s){throw h.error(`Ingest failed: ${s}`,"ingest"),Me(),s}}function B(t,e,r){return ve(()=>Ct(t,e,r))}async function _r(t,e){const r=kt(e);if(!r){h.error(`Unknown ingest game: ${e}`,"ingest");return}return B(t,r,e)}async function zr(t,e,r){const n=Ue(e,r);return B(t,n,e.id)}export{B as mountThreeIngestRoot,_r as mountThreeIngestRootById,zr as mountThreeIngestRootFromManifest};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as t}from"./game-network-CU3Yp0oN.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-iW3HFEJB.js";import"./index-nmcBqr7Y.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"./native-debug-module-Cofo9dCU.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-BUPLu5EA.js";import"./contract-system-adapters-D9Gcb7R7.js";import"./game-contract-seams-DOwrbA13.js";import"./seeded-random-BIdiJ8w9.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CayyA6Tc.js";import"./capability-coverage-6I_iG0kk.js";import"./edit-mode-authoring-Du1CaTkH.js";import"./json-history-resource-82d2z68R.js";import"./binding-resolver-aDFCbAcG.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-C8OlRuJ5.js";import"./canvas-entry-runtime-BQdfSw1B.js";import"./three-ingest-runtime-Bqwv-JsZ.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CHE8woWv.js";import"./ingest-source-persistence-2MRBPgo0.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DPtVohIT.js";import"./mounted-authoring-30zCcxeV.js";import"./entity-object-BeRdaaqQ.js";import"./user-data-BGLBYiFw.js";import"./workspace-arrangement-6V8ZwB2d.js";import"./three-contract-Dkt6PmWY.js";import"./three-wsMw8Ifj.js";import"./editor-layers-qlgroPbE.js";import"./component-instance-root-9MmHwMal.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-DctJX96k.js";import"./source-persistence-backend-I5wxqQgh.js";import"./three-projection-core-rOK39WmJ.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-mLmXPi7n.js";import"./deferred-ingest-play-DVLTxYCk.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DgsCzOTj.js";import"./board-guides-BVkDJqat.js";import"./relative-import-specifier-CPCtuEhc.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-CUNyIUii.js";import"./inference-diagnostics-PcfFN6SD.js";import"./writer-tw6EcuVO.js";import"./three-state-Cu8xEils.js";import"./editor-shell-store-Di0waLQj.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-B7DJhMPS.js";const yt="workspace.service";function zt(){t()}export{yt as point,zt as start};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r as B,ep as C,af as o,en as c,a0 as k,aR as Q,aM as O,dy as D,eF as Z,eY as tt}from"./index-iW3HFEJB.js";import{N as et}from"./game-network-CU3Yp0oN.js";import{r as f}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.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"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-Cofo9dCU.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-BUPLu5EA.js";import"./contract-system-adapters-D9Gcb7R7.js";import"./game-contract-seams-DOwrbA13.js";import"./seeded-random-BIdiJ8w9.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CayyA6Tc.js";import"./capability-coverage-6I_iG0kk.js";import"./edit-mode-authoring-Du1CaTkH.js";import"./json-history-resource-82d2z68R.js";import"./binding-resolver-aDFCbAcG.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-C8OlRuJ5.js";import"./canvas-entry-runtime-BQdfSw1B.js";import"./three-ingest-runtime-Bqwv-JsZ.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CHE8woWv.js";import"./ingest-source-persistence-2MRBPgo0.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DPtVohIT.js";import"./mounted-authoring-30zCcxeV.js";import"./entity-object-BeRdaaqQ.js";import"./user-data-BGLBYiFw.js";import"./workspace-arrangement-6V8ZwB2d.js";import"./three-contract-Dkt6PmWY.js";import"./three-wsMw8Ifj.js";import"./editor-layers-qlgroPbE.js";import"./component-instance-root-9MmHwMal.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-DctJX96k.js";import"./source-persistence-backend-I5wxqQgh.js";import"./three-projection-core-rOK39WmJ.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-mLmXPi7n.js";import"./deferred-ingest-play-DVLTxYCk.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DgsCzOTj.js";import"./board-guides-BVkDJqat.js";import"./relative-import-specifier-CPCtuEhc.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-CUNyIUii.js";import"./inference-diagnostics-PcfFN6SD.js";import"./writer-tw6EcuVO.js";import"./three-state-Cu8xEils.js";import"./editor-shell-store-Di0waLQj.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-B7DJhMPS.js";function nt(e){return e?{connectionState:e.getConnectionState?.(),roomInfo:e.getRoomInfo?.(),stats:e.getReplicationStats?.()}:null}function st(e){return e?{stateTree:typeof e.getStateSnapshot=="function",messageLog:typeof e.messageEvents=="function",rates:typeof e.getRates=="function",conditioning:typeof e.getConditioning=="function"&&typeof e.setConditioning=="function",connection:typeof e.getConnectionState=="function",room:typeof e.getRoomInfo=="function",stats:typeof e.getReplicationStats=="function",identity:typeof e.getPlayerIdentity=="function",identitySettable:typeof e.setPlayerIdentity=="function",traffic:typeof e.getTrafficByType=="function",send:typeof e.sendMessage=="function",ping:typeof e.ping=="function",server:typeof e.inspectServer=="function",entityTraffic:typeof e.getTrafficByEntity=="function",recording:typeof e.isRecording=="function"&&typeof e.setRecording=="function"}:null}class _{constructor(n=500){this.capacity=n}entries=[];lastSeq=0;paused=!1;pull(n){if(this.paused||!n?.messageEvents)return 0;const s=n.messageEvents(this.lastSeq);if(s.length===0)return 0;for(const i of s)this.entries.push(i),i.seq>this.lastSeq&&(this.lastSeq=i.seq);return this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),s.length}get all(){return this.entries}clear(){this.entries=[]}}function it(e,n){const s=n.trim().toLowerCase();return s?e.filter(i=>i.type.toLowerCase().includes(s)):[...e]}class P{constructor(n=60){this.capacity=n}values=[];push(n){this.values.push(n),this.values.length>this.capacity&&this.values.shift()}get data(){return this.values}get latest(){return this.values.length>0?this.values[this.values.length-1]:null}}class V{msgsIn=new P;msgsOut=new P;bytesIn=new P;bytesOut=new P;sample(n){this.msgsIn.push(n.msgsInPerSec),this.msgsOut.push(n.msgsOutPerSec),n.bytesInPerSec!==void 0&&this.bytesIn.push(n.bytesInPerSec),n.bytesOutPerSec!==void 0&&this.bytesOut.push(n.bytesOutPerSec)}}function ot(e,n,s,i=1){if(e.length<2)return"";const a=Math.max(1,...e),l=s-i*2,u=n/(e.length-1);return e.map((y,S)=>{const v=S*u,h=i+l*(1-y/a);return`${v.toFixed(1)},${h.toFixed(1)}`}).join(" ")}const rt={disconnected:o.content.muted,connecting:o.semantic.warning,connected:o.semantic.success,error:o.semantic.danger},R={fontFamily:o.typography.mono,fontSize:C.base};function T({children:e,testId:n}){return t.jsx("div",{"data-testid":n,style:{padding:c[4],color:o.content.muted,fontSize:C.base,fontStyle:"italic"},children:e})}function lt(e){return e!==null&&typeof e=="object"}function at(e){return typeof e=="string"?`"${e}"`:typeof e=="number"?Number.isInteger(e)?String(e):e.toFixed(3):String(e)}function K({type:e}){return e?t.jsx("span",{"data-testid":"net-tree-type",style:{color:o.content.dim,marginLeft:6},children:e}):null}function H({name:e,value:n,depth:s,path:i=[],edit:a,remove:l,typeOf:u}){const[y,S]=f.useState(s===0),[v,h]=f.useState(null),[x,m]=f.useState(null),d={...R,paddingLeft:8+s*14,lineHeight:"18px",whiteSpace:"nowrap"};if(!lt(n)){const j=a&&(typeof n=="number"||typeof n=="string"||typeof n=="boolean"),$=p=>{h(null),a?.(i,p).then(()=>m(null),I=>m(I instanceof Error?I.message:String(I)))},E=p=>{if(typeof n=="number"){const I=Number(p);return Number.isFinite(I)?I:n}return p};return t.jsxs("div",{style:d,"data-testid":"net-tree-leaf","data-path":i.join("."),children:[t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsx("span",{style:{color:o.content.muted},children:": "}),v!==null?t.jsx(O,{"data-testid":"net-tree-edit",autoFocus:!0,value:v,onChange:p=>h(p.target.value),onKeyDown:p=>{p.key==="Enter"&&$(E(v)),p.key==="Escape"&&h(null)},onBlur:()=>h(null),style:{width:120}}):t.jsx("span",{"data-testid":j?"net-tree-value":void 0,title:j?typeof n=="boolean"?"Click to toggle on the server":"Click to edit on the server":void 0,style:{color:o.content.primary,cursor:j?"text":void 0},onClick:j?()=>typeof n=="boolean"?$(!n):h(String(n)):void 0,children:at(n)}),t.jsx(K,{type:i.length>0?u?.(i):null}),l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:()=>l(i).then(()=>m(null),p=>m(p instanceof Error?p.message:String(p))),style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null,x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null]})}const g=Object.entries(n);return t.jsxs("div",{children:[t.jsxs("div",{style:{...d,cursor:"pointer",userSelect:"none"},"data-testid":"net-tree-branch","data-expanded":y||void 0,onClick:()=>S(j=>!j),children:[t.jsx("span",{style:{color:o.content.muted,display:"inline-block",width:12},children:t.jsx(Z,{direction:y?"down":"right"})}),t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsxs("span",{style:{color:o.content.dim},children:[" ",Array.isArray(n)?`[${g.length}]`:`{${g.length}}`]}),t.jsx(K,{type:i.length>0?u?.(i):null}),x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null,l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:j=>{j.stopPropagation(),l(i).then(()=>m(null),$=>m($ instanceof Error?$.message:String($)))},style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null]}),y&&g.map(([j,$])=>t.jsx(H,{name:j,value:$,depth:s+1,path:s===0?[j]:[...i,j],edit:a,remove:l,typeOf:u},j))]})}const U=96,G=22,dt=f.memo(function({points:n,color:s}){return t.jsx("svg",{width:U,height:G,style:{display:"block",background:o.surface.inset,borderRadius:o.shape.small},role:"img","aria-label":"rate sparkline",children:n&&t.jsx("polyline",{points:n,fill:"none",stroke:s,strokeWidth:1.2})})});function F({label:e,series:n,unit:s,color:i,testId:a}){const l=n.latest;return t.jsxs("div",{"data-testid":a,style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsxs("div",{style:{fontSize:C.sm,color:o.content.muted},children:[e," ",t.jsx("span",{style:{color:o.content.primary,fontFamily:o.typography.mono},children:l===null?"n/a":`${l}${s}`})]}),t.jsx(dt,{points:ot(n.data,U,G),color:i})]})}function ct({event:e}){const n=e.direction==="in"?o.semantic.success:o.accent.default;return t.jsxs("div",{"data-testid":"net-log-row","data-direction":e.direction,style:{...R,display:"grid",gridTemplateColumns:"64px 24px 1fr 56px",gap:c[2],lineHeight:"17px",padding:`0 ${c[4]}`,opacity:e.dropped?.55:1},children:[t.jsxs("span",{style:{color:o.content.dim},children:[(e.time/1e3).toFixed(2),"s"]}),t.jsx("span",{style:{color:n},children:e.direction==="in"?"↓in":"↑out"}),t.jsxs("span",{style:{color:o.content.primary,textDecoration:e.dropped?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis"},children:[e.type,e.dropped?" (dropped)":""]}),t.jsx("span",{style:{color:o.content.muted,textAlign:"right"},children:e.size!==void 0?`${e.size} B`:"—"})]})}function pt({adapter:e}){const[n,s]=f.useState(()=>e.getConditioning?.()??{latencyMs:0,jitterMs:0,packetLoss:0}),i=e.getConditioningLimits?.()??{},a=l=>{s(l),e.setConditioning?.(l)};return t.jsxs("div",{"data-testid":"net-conditioner",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Conditioner"}),t.jsx(D,{label:"latency ms",value:n.latencyMs,step:10,testId:"net-cond-latency",onChange:l=>a({...n,latencyMs:Math.max(0,l)})}),t.jsx(D,{label:"jitter ms",value:n.jitterMs,step:5,testId:"net-cond-jitter",onChange:l=>a({...n,jitterMs:Math.max(0,l)})}),i.packetLoss?t.jsx("span",{"data-testid":"net-cond-loss-absent",title:i.packetLoss,style:{fontSize:C.sm,color:o.content.muted},children:"loss: not simulated"}):t.jsx(D,{label:"loss %",value:n.packetLoss*100,step:5,testId:"net-cond-loss",onChange:l=>a({...n,packetLoss:Math.min(1,Math.max(0,l/100))})})]})}function ut({adapter:e,settable:n}){const[s,i]=f.useState(()=>e.getPlayerIdentity?.()?.name??""),a=()=>{const l=s.trim();l&&e.setPlayerIdentity?.({name:l})};return t.jsxs("div",{"data-testid":"net-identity",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Player name"}),n?t.jsx(O,{"data-testid":"net-identity-name",value:s,onChange:l=>i(l.target.value),onBlur:a,onKeyDown:l=>{l.key==="Enter"&&l.currentTarget.blur()},style:{width:140}}):t.jsx("span",{"data-testid":"net-identity-name",style:{...R,color:o.content.primary},children:s||"—"})]})}function yt({view:e,caps:n,rates:s}){return t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:c[6],alignItems:"center",padding:`${c[2]} ${c[4]}`,borderBottom:`1px solid ${o.boundary.default}`},children:[e.connectionState!==void 0?t.jsxs("span",{"data-testid":"net-connection-state",style:{color:rt[e.connectionState]},children:["● ",e.connectionState]}):t.jsx(T,{testId:"net-connection-state-absent",children:"Connection state not provided by this adapter."}),e.roomInfo===void 0?t.jsx(T,{testId:"net-room-absent",children:"Room info not provided by this adapter."}):e.roomInfo?t.jsxs("span",{style:{...R,color:o.content.primary},children:[e.roomInfo.roomName," · ",e.roomInfo.roomId," · session ",e.roomInfo.sessionId]}):t.jsx("span",{style:{color:o.content.muted},children:"no room"}),e.stats?t.jsxs("span",{style:{color:o.content.muted},children:["entities ",t.jsx("span",{style:{color:o.content.primary},children:e.stats.entities})]}):t.jsx(T,{testId:"net-stats-absent",children:"Replication stats not provided by this adapter."}),n.rates?t.jsxs("div",{"data-testid":"net-sparklines",style:{display:"flex",gap:c[5]},children:[t.jsx(F,{label:"msgs in",unit:"/s",series:s.msgsIn,color:o.semantic.success,testId:"net-rate-msgs-in"}),t.jsx(F,{label:"msgs out",unit:"/s",series:s.msgsOut,color:o.accent.default,testId:"net-rate-msgs-out"}),t.jsx(F,{label:"bytes in",unit:" B/s",series:s.bytesIn,color:o.semantic.success,testId:"net-rate-bytes-in"}),t.jsx(F,{label:"bytes out",unit:" B/s",series:s.bytesOut,color:o.accent.default,testId:"net-rate-bytes-out"})]}):t.jsx(T,{testId:"net-rates-absent",children:"Rates not provided by this adapter."})]})}const W=et,J="networkMessageDraft";function mt(){const[,e]=f.useReducer(p=>p+1,0),n=f.useRef(new _),s=f.useRef(new V),i=f.useRef(null),[a,l]=f.useState(!1),[u,y]=f.useState(""),[S,v]=f.useState(()=>B().projectLocalState.read(W)??!1),[h,x]=f.useState(()=>B().projectLocalState.read(J)??{type:"message_type",payload:"{}"}),m=p=>{B().projectLocalState.write(J,p),x(p)};f.useEffect(()=>{const p=()=>{const M=B().systems.inspectedNetworking()??null;return M!==i.current&&(i.current=M,n.current=new _,n.current.paused=a,s.current=new V),M},I=()=>{const M=p();n.current.pull(M),e()};I();const L=setInterval(I,250),w=setInterval(()=>{const r=p()?.getRates?.();r&&s.current.sample(r)},1e3),N=B().systems.inspectedNetworking()?.subscribe(()=>e());return()=>{clearInterval(L),clearInterval(w),N?.()}},[a]);const d=i.current??B().systems.inspectedNetworking()??null,g=st(d);if(!d||!g)return t.jsxs("div",{"data-testid":"network-inspector-empty",style:{padding:c[8],color:o.content.muted,fontSize:C.md,lineHeight:"18px"},children:[t.jsx("div",{style:{color:o.content.primary,marginBottom:c[2]},children:"No networking adapter is registered."}),"Games expose replication state to this inspector by registering a"," ",t.jsx("code",{style:R,children:"NetworkingAdapter"})," during setup:"," ",t.jsx("code",{style:R,children:"ctx.registerSystemAdapter?.('networking', adapter)"})," — see the third-person-arena example. Single-player games register none; there is nothing to inspect."]});const j=nt(d),$=g.stateTree?d.getStateSnapshot?.():void 0,E=it(n.current.all,u);return t.jsxs("div",{"data-testid":"network-inspector",className:"volter-content-frost",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",fontSize:C.md},children:[t.jsx(yt,{view:j,caps:g,rates:s.current}),g.identity?t.jsx(ut,{adapter:d,settable:g.identitySettable},d.getPlayerIdentity?.()?.name??""):null,g.conditioning?t.jsx(pt,{adapter:d}):t.jsx(T,{testId:"net-conditioner-absent",children:"Link conditioning not provided by this adapter."}),g.server?t.jsx(vt,{adapter:d,ownSession:j.roomInfo?.sessionId??null,ownRoom:j.roomInfo?.roomId??null,draft:h,setDraft:m}):null,g.recording||g.traffic?t.jsxs("div",{"data-testid":"net-profiler-bar",style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2],borderBottom:`1px solid ${o.boundary.default}`},children:[g.recording?t.jsx(t.Fragment,{children:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-recording","aria-pressed":d.isRecording?.()===!0,onClick:()=>{d.setRecording?.(!d.isRecording?.()),e()},children:d.isRecording?.()?"Stop":"Start"})}):null,t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-clear",onClick:()=>{n.current.clear(),d.clearTraffic?.(),e()},children:"Clear"}),g.recording?t.jsxs("label",{style:{display:"flex",gap:c[1],alignItems:"center",whiteSpace:"nowrap"},children:[t.jsx(Q,{"data-testid":"net-autostart",checked:S,onChange:p=>{const I=p.currentTarget.checked;B().projectLocalState.write(W,I),v(I)}}),"Autostart"]}):null]}):null,g.traffic?t.jsx(bt,{rows:d.getTrafficByType?.()??[]}):null,g.entityTraffic?t.jsx(ht,{rows:d.getTrafficByEntity?.()??[]}):null,g.send?t.jsx(St,{adapter:d,ping:g.ping,draft:h,setDraft:m}):null,t.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[t.jsx("div",{"data-testid":"net-state-tree",style:{flex:1,minWidth:0,overflow:"auto",borderRight:`1px solid ${o.boundary.default}`,padding:`${c[2]} 0`},children:g.stateTree?$!=null?t.jsx(H,{name:"state",value:$,depth:0,edit:d.editServerState?(p,I)=>d.editServerState(p,I):void 0,remove:d.deleteServerState?p=>d.deleteServerState(p):void 0,typeOf:d.stateFieldType?p=>d.stateFieldType(p):void 0}):t.jsx(T,{children:"Not connected — no replicated state to show."}):t.jsx(T,{testId:"net-tree-absent",children:"Replicated-state snapshot not provided by this adapter."})}),t.jsx("div",{"data-testid":"net-message-log",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:g.messageLog?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2]},children:[g.recording?null:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-pause",onClick:()=>{const p=!a;n.current.paused=p,l(p)},children:a?"Resume":"Pause"}),t.jsx(O,{"data-testid":"net-log-filter",placeholder:"Filter by type",value:u,onChange:p=>y(p.target.value),style:{flex:1,minWidth:60}}),t.jsxs("span",{style:{fontSize:C.sm,color:o.content.muted},children:[E.length,"/",n.current.all.length]})]}),t.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto"},children:E.length===0?t.jsx(T,{children:"No messages captured yet."}):E.map(p=>t.jsx(ct,{event:p},p.seq))})]}):t.jsx(T,{testId:"net-log-absent",children:"Message log not provided by this adapter."})})]})]})}function ht({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"};return t.jsx("div",{"data-testid":"net-entity-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx(T,{children:"No state patches yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...R},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Entity"}),t.jsx("th",{style:n,title:"Syncs in - out, as Godot pairs them: the state patches that changed it, and none out, because a Colyseus client sends no state",children:"Count"}),t.jsx("th",{style:n,title:"Field changes those patches carried",children:"Changes"}),t.jsx("th",{style:n,title:"Size in - out: the size range of the patches that carried it (they carried other entities too), and none out",children:"Size"})]})}),t.jsx("tbody",{children:e.map(s=>t.jsxs("tr",{"data-testid":"net-entity-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:s.path}),t.jsx("td",{style:n,children:`${s.syncs} - 0`}),t.jsx("td",{style:n,children:s.changes}),t.jsx("td",{style:n,children:`${s.patchBytesMin===s.patchBytesMax?`${s.patchBytesMin} B`:`${s.patchBytesMin}…${s.patchBytesMax} B`} - 0 B`})]},s.path))})]})})}function gt(e){try{return JSON.parse(e)}catch{return e}}function xt({text:e,onChange:n}){const[s,i]=f.useState("tree");let a;try{a=e.trim()===""?{}:JSON.parse(e)}catch{a=void 0}const l=u=>n(JSON.stringify(u));return t.jsxs("div",{"data-testid":"net-payload-editor",style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("div",{style:{display:"flex",gap:c[1]},children:["tree","text"].map(u=>t.jsx(k,{type:"button",variant:"ghost","aria-pressed":s===u,"data-testid":`net-payload-view-${u}`,onClick:()=>i(u),children:u==="tree"?"Tree":"Text"},u))}),s==="text"||a===void 0?t.jsxs(t.Fragment,{children:[t.jsx(tt,{"data-testid":"net-send-dialog-payload",rows:6,value:e,onChange:u=>n(u.target.value),style:R}),a===void 0?t.jsx("span",{style:{color:o.content.muted},children:"Not JSON yet, so the tree cannot show it."}):null]}):t.jsx("div",{style:{...R,fontSize:C.sm},children:t.jsx(X,{value:a,onChange:l,depth:0})})]})}function X({value:e,onChange:n,depth:s}){const[i,a]=f.useState(""),[l,u]=f.useState(""),y={paddingLeft:s*12};if(e!==null&&typeof e=="object"){const S=Array.isArray(e),v=S?e.map((m,d)=>[String(d),m]):Object.entries(e),h=(m,d)=>{n(S?e.map((g,j)=>String(j)===m?d:g):{...e,[m]:d})},x=m=>{n(S?e.filter((d,g)=>String(g)!==m):Object.fromEntries(Object.entries(e).filter(([d])=>d!==m)))};return t.jsxs("div",{"data-testid":"net-payload-branch",children:[v.map(([m,d])=>t.jsxs("div",{style:y,children:[t.jsxs("span",{style:{color:o.content.muted},children:[m,": "]}),d!==null&&typeof d=="object"?t.jsx("span",{style:{color:o.content.muted},children:Array.isArray(d)?"[":"{"}):null,t.jsx("button",{type:"button","data-testid":"net-payload-remove",title:`Remove ${m}`,onClick:()=>x(m),style:{background:"none",border:0,color:o.content.muted,cursor:"pointer"},children:"×"}),d!==null&&typeof d=="object"?t.jsx(X,{value:d,onChange:g=>h(m,g),depth:s+1}):t.jsx(q,{value:d,onChange:g=>h(m,g)})]},m)),t.jsxs("div",{style:{...y,display:"flex",gap:c[1]},children:[S?null:t.jsx(O,{"data-testid":"net-payload-new-key",placeholder:"key",value:i,onChange:m=>a(m.target.value),style:{width:90}}),t.jsx(O,{"data-testid":"net-payload-new-value",placeholder:"value",value:l,onChange:m=>u(m.target.value),style:{width:110}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-payload-add",disabled:!S&&i.trim()==="",onClick:()=>{const m=gt(l);n(S?[...e,m]:{...e,[i.trim()]:m}),a(""),u("")},children:"Add"})]})]})}return t.jsx(q,{value:e,onChange:n})}function q({value:e,onChange:n}){const s=e===null?"null":typeof e=="number"?"number":typeof e=="boolean"?"boolean":"string",i=s==="string"?String(e):JSON.stringify(e),[a,l]=f.useState(i);f.useEffect(()=>l(i),[i]);const u=(y,S)=>{if(y==="null")return null;if(y==="boolean")return S.trim()==="true";if(y==="number"){const v=Number(S);return Number.isFinite(v)?v:0}return S};return t.jsxs("span",{style:{display:"inline-flex",gap:4},children:[s==="boolean"?t.jsx("input",{type:"checkbox","data-testid":"net-payload-leaf-boolean",checked:e===!0,onChange:y=>n(y.currentTarget.checked)}):s==="null"?t.jsx("span",{style:{color:o.content.muted},children:"null"}):t.jsx(O,{"data-testid":"net-payload-leaf",value:a,onChange:y=>l(y.target.value),onBlur:()=>n(u(s,a)),onKeyDown:y=>{y.key==="Enter"&&n(u(s,a))},style:{width:120}}),t.jsx("select",{"data-testid":"net-payload-leaf-type","aria-label":"Value type",value:s,onChange:y=>n(u(y.currentTarget.value,a)),children:["string","number","boolean","null"].map(y=>t.jsx("option",{value:y,children:y},y))})]})}const ft=[["name","Name"],["roomId","Room"],["clients","Clients"],["locked","Locked"],["elapsedMs","Elapsed"]];function jt(e,n){const s=i=>{const a=i[n.key];return typeof a=="number"?a:typeof a=="boolean"?Number(a):String(a)};return[...e].sort((i,a)=>{const l=s(i),u=s(a),y=l<u?-1:l>u?1:0;return n.descending?-y:y})}function bt({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"},s=i=>i>=1024?`${(i/1024).toFixed(1)} KiB`:`${i} B`;return t.jsx("div",{"data-testid":"net-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx(T,{children:"No traffic yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...R},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Type"}),t.jsx("th",{style:n,children:"In"}),t.jsx("th",{style:n,children:"Bytes in"}),t.jsx("th",{style:n,children:"Out"}),t.jsx("th",{style:n,children:"Bytes out"})]})}),t.jsx("tbody",{children:e.map(i=>t.jsxs("tr",{"data-testid":"net-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:i.type}),t.jsx("td",{style:n,children:i.countIn||"-"}),t.jsx("td",{style:n,children:i.countIn?s(i.bytesIn):"-"}),t.jsx("td",{style:n,children:i.countOut||"-"}),t.jsx("td",{style:n,children:i.countOut?s(i.bytesOut):"-"})]},i.type))})]})})}function Y(e){if(e.type.trim()==="")throw new Error("Name the message type first.");return{type:e.type,payload:e.payload.trim()===""?void 0:JSON.parse(e.payload)}}function St({adapter:e,ping:n,draft:s,setDraft:i}){const[a,l]=f.useState(null),u=()=>{l("…"),e.ping?.().then(h=>l(`${h} ms`),h=>l(h instanceof Error?h.message:String(h)))},[y,S]=f.useState(null),v=()=>{try{const h=Y(s);e.sendMessage?.(h.type,h.payload),S(null)}catch(h){S(h instanceof Error?h.message:String(h))}};return t.jsxs("div",{"data-testid":"net-send",style:{display:"flex",gap:c[2],alignItems:"center",padding:c[2]},children:[t.jsx(O,{"data-testid":"net-send-type",placeholder:"Message type",value:s.type,onChange:h=>i({...s,type:h.target.value}),style:{width:140}}),t.jsx(O,{"data-testid":"net-send-payload",placeholder:'Payload (JSON), e.g. {"x": 1}',value:s.payload,onChange:h=>i({...s,payload:h.target.value}),style:{flex:1,minWidth:80}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-send-button",disabled:s.type.trim()==="",onClick:v,children:"Send as this client"}),n?t.jsxs(t.Fragment,{children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-ping",onClick:u,children:"Ping"}),a?t.jsx("span",{"data-testid":"net-rtt",style:{fontSize:C.sm,...R},children:a}):null]}):null,y?t.jsx("span",{"data-testid":"net-send-error",style:{color:o.semantic.danger,fontSize:C.sm},children:y}):null]})}function vt({adapter:e,ownSession:n,ownRoom:s,draft:i,setDraft:a}){const[l,u]=f.useState(null),[y,S]=f.useState(null),[v,h]=f.useState("clients"),[x,m]=f.useState(void 0),[d,g]=f.useState(void 0),[j,$]=f.useState({key:"elapsedMs",descending:!0}),[E,p]=f.useState(null);f.useEffect(()=>{let r=!0;const b=()=>{e.inspectServer?.(d).then(A=>{r&&m(A)},A=>{r&&p(A instanceof Error?A.message:String(A))})};b();const z=setInterval(b,2e3);return()=>{r=!1,clearInterval(z)}},[e,d]);const I=r=>{try{r()?.then(()=>p(null),b=>p(b instanceof Error?b.message:String(b)))}catch(b){p(b instanceof Error?b.message:String(b))}},L=r=>`${Math.round(r/1e3)} s`,w={padding:`0 ${c[3]}`,whiteSpace:"nowrap"};if(x===void 0)return null;if(x===null)return t.jsx(T,{testId:"net-server-absent",children:"The room server serves no Monitor view (its `server` configuration sets VOLTER_ROOM_MONITOR=1)."});const N=x.room?.roomId,M=(r,b,z)=>t.jsx(k,{type:"button",variant:"ghost","data-testid":r,onClick:()=>I(z),children:b});return t.jsxs("div",{"data-testid":"net-server",style:{padding:`${c[2]} 0`,borderBottom:`1px solid ${o.boundary.default}`,fontSize:C.sm},children:[t.jsxs("div",{"data-testid":"net-server-summary",style:{padding:`0 ${c[3]}`,color:o.content.muted},children:["Server · ",x.rooms.length," room",x.rooms.length===1?"":"s"," · ",x.connections," ","connection",x.connections===1?"":"s",x.cpuPercent!==null?` · CPU ${x.cpuPercent.toFixed(0)}%`:"",x.memory?` · memory ${Math.round(x.memory.usedMb)} / ${Math.round(x.memory.totalMb)} MB`:"",x.room?` · state ${x.room.stateBytes} B`:""]}),t.jsxs("table",{style:{borderCollapse:"collapse",...R},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[ft.map(([r,b])=>t.jsxs("th",{"data-testid":`net-server-sort-${r}`,"aria-sort":j.key===r?j.descending?"descending":"ascending":"none",style:{...w,textAlign:"left",cursor:"pointer",fontWeight:"normal"},onClick:()=>$({key:r,descending:j.key===r?!j.descending:!1}),children:[b,j.key===r?j.descending?" ▾":" ▴":""]},r)),t.jsx("th",{style:w})]})}),t.jsx("tbody",{children:jt(x.rooms,j).map(r=>t.jsxs("tr",{"data-testid":"net-server-room","data-inspected":r.roomId===N||void 0,children:[t.jsx("td",{style:w,children:r.name}),t.jsx("td",{style:w,children:r.roomId}),t.jsxs("td",{style:w,children:[r.clients,r.maxClients!==null?` / ${r.maxClients}`:""," clients"]}),t.jsx("td",{style:w,children:r.locked?"locked":"open"}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,children:[r.roomId===N?t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-broadcast",onClick:()=>{S(null),u({sessionId:null})},children:"Broadcast"}):t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-inspect",onClick:()=>g(r.roomId),children:"Inspect"}),M("net-server-dispose","Dispose",()=>e.disposeRoom?.(r.roomId))]})]},r.roomId))})]}),l?t.jsxs("div",{"data-testid":"net-send-dialog",role:"group","aria-labelledby":"net-send-dialog-title",style:{margin:c[2],padding:c[3],border:`1px solid ${o.boundary.default}`,borderRadius:4},children:[t.jsx("div",{id:"net-send-dialog-title",style:{color:o.content.primary,marginBottom:c[2]},children:l.sessionId?`Send message to client (${l.sessionId})`:"Broadcast message to all clients"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:c[2]},children:[t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message type"}),t.jsx(O,{"data-testid":"net-send-dialog-type",value:i.type,onChange:r=>a({...i,type:r.target.value})})]}),t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message payload (JSON)"}),t.jsx(xt,{text:i.payload,onChange:r=>a({...i,payload:r})})]}),y?t.jsx("span",{"data-testid":"net-send-dialog-error",children:y}):null]}),t.jsxs("div",{style:{display:"flex",gap:c[2],justifyContent:"flex-end",marginTop:c[2]},children:[t.jsx(k,{type:"button",variant:"ghost",onClick:()=>u(null),children:"Cancel"}),t.jsx(k,{type:"button","data-testid":"net-send-dialog-send",onClick:()=>{const r=l;(async()=>{try{const b=Y(i);await(r.sessionId?e.sendToClient?.(r.sessionId,b.type,b.payload,N):e.broadcast?.(b.type,b.payload,N)),S(null),u(null)}catch(b){S(b instanceof Error?b.message:String(b))}})()},children:"Send"})]})]}):null,x.room?t.jsxs("div",{"data-testid":"net-server-room-view",style:{padding:`${c[2]} 0`},children:[t.jsx("div",{role:"tablist",style:{display:"flex",gap:c[2],padding:`0 ${c[3]}`},children:[["clients",`Clients (${x.room.clients.length})`],["state","State"]].map(([r,b])=>t.jsx(k,{type:"button",variant:"ghost",role:"tab","aria-selected":v===r,"data-testid":`net-server-tab-${r}`,onClick:()=>h(r),children:b},r))}),v==="clients"?t.jsx("table",{style:{borderCollapse:"collapse",...R},children:t.jsx("tbody",{children:x.room.clients.map(r=>t.jsxs("tr",{"data-testid":"net-server-client",children:[t.jsx("td",{style:w,children:"client"}),t.jsxs("td",{style:w,children:[r.sessionId,r.sessionId===n?" (this client)":""]}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,colSpan:3,children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-send",onClick:()=>{S(null),u({sessionId:r.sessionId})},children:"Send"}),M("net-server-disconnect","Disconnect",()=>e.disconnectClient?.(r.sessionId,N))]})]},r.sessionId))})}):x.room.state!==void 0?t.jsx("div",{"data-testid":"net-server-room-state",children:t.jsx(H,{name:`room ${x.room.roomId}${x.room.roomId===s?" (this client’s room)":""}`,value:x.room.state,depth:0,edit:e.editServerState?(r,b)=>e.editServerState(r,b,N):void 0,remove:e.deleteServerState?r=>e.deleteServerState(r,N):void 0})}):t.jsx(T,{children:"The server sent no state for this room."})]}):null,E?t.jsx(T,{children:E}):null]})}const Ue="workspace.utility",Ge="Network",Xe=25,Ye=()=>B().systems.inspectedNetworking()!==null;function Qe(){return t.jsx(mt,{})}export{Ye as available,Qe as default,Xe as order,Ue as point,Ge as title};
|