@volter/game-editor 0.5.154 → 0.5.155

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.
Files changed (294) hide show
  1. package/BUNDLED_NOTICES +22 -22
  2. package/catalog/entries/blender.json +2 -2
  3. package/catalog/entries/music.json +2 -2
  4. package/dist/.vite/manifest.json +2129 -2129
  5. package/dist/assets/{AssetBudgetPanel-VWgpnuIc.js → AssetBudgetPanel-B2Wb7-b1.js} +3 -3
  6. package/dist/assets/{AudioViewer-DfHCf1lW.js → AudioViewer-gge--M-h.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-CX4PNJyw.js → CanvasBoardDocument-CyGiXrEJ.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-CQfbmxpt.js → CanvasSceneViewport-ChG9oRS8.js} +1 -1
  9. package/dist/assets/{ColorInput-BlrT435I.js → ColorInput-Dzpqy-J3.js} +1 -1
  10. package/dist/assets/{ColorPicker-Cd-YIyWU.js → ColorPicker-CqJPBHlh.js} +1 -1
  11. package/dist/assets/{EntityModelDocument-BmKOcswo.js → EntityModelDocument-D7XDf6uB.js} +1 -1
  12. package/dist/assets/{EnvironmentAssetDocument-BEuthcGj.js → EnvironmentAssetDocument-BgO7Hl3g.js} +1 -1
  13. package/dist/assets/{GameplaySessionTimeline-BN2umpRb.js → GameplaySessionTimeline-BBmwHCKA.js} +1 -1
  14. package/dist/assets/{ImageViewer-D9hKvFKP.js → ImageViewer-BjxoscVa.js} +1 -1
  15. package/dist/assets/InspectorObjectPreview-C87CasN_.js +1 -0
  16. package/dist/assets/{JsonAssetDocument-DMhiFUNl.js → JsonAssetDocument-D81JuRAm.js} +1 -1
  17. package/dist/assets/{LiveModuleDocument-ChrbfWzt.js → LiveModuleDocument-bgStMiU1.js} +1 -1
  18. package/dist/assets/{LutAssetDocument-D5cdrT07.js → LutAssetDocument-cl9Jq0Zw.js} +1 -1
  19. package/dist/assets/{ModelAssetDocument-Dh2Yp-5_.js → ModelAssetDocument-CYCLKpxJ.js} +1 -1
  20. package/dist/assets/{NonThreeAuthoringBootstrap-5lJjd2ul.js → NonThreeAuthoringBootstrap-DhHjvD5d.js} +1 -1
  21. package/dist/assets/{Object3DDocumentToolbar-DVNZXciL.js → Object3DDocumentToolbar-CQbARBIW.js} +1 -1
  22. package/dist/assets/Object3DDocumentViewport-BpiyRQ5p.js +2 -0
  23. package/dist/assets/{Object3DPreview-hnWxlKV2.js → Object3DPreview-BOZYzjz_.js} +1 -1
  24. package/dist/assets/{OnlineAssetDetail-TlMhKqz-.js → OnlineAssetDetail-DdKHHjxg.js} +1 -1
  25. package/dist/assets/{PlayBar-YdSOe6Mn.js → PlayBar-CAarfEOh.js} +1 -1
  26. package/dist/assets/{QuarksAssetDocument-CmVrkxb8.js → QuarksAssetDocument-GTbawoy7.js} +1 -1
  27. package/dist/assets/{ReactCanvasControls-Co3jjBJY.js → ReactCanvasControls-DIFkxeKv.js} +1 -1
  28. package/dist/assets/{RootSelectionOverlay-DRjJypx0.js → RootSelectionOverlay-Dv_w1D9s.js} +1 -1
  29. package/dist/assets/{ShaderAssetDocument-Bm1FTj5L.js → ShaderAssetDocument-OA-nshNN.js} +1 -1
  30. package/dist/assets/{ShadowEditor-Ah6UaoTL.js → ShadowEditor-Cp1QVCo9.js} +1 -1
  31. package/dist/assets/{SourceAssetViewer-CRp-jbVU.js → SourceAssetViewer-CGGHBzgL.js} +1 -1
  32. package/dist/assets/{StageHost-j9meef5x.js → StageHost-BMgCrIPG.js} +2 -2
  33. package/dist/assets/{StoryPreviewMount-ChfzCbJ3.js → StoryPreviewMount-CyF7FwI7.js} +1 -1
  34. package/dist/assets/{ThreeBoardDocument-DAGUbLlA.js → ThreeBoardDocument-DCJkLWU8.js} +2 -2
  35. package/dist/assets/{ThreeIsolationSceneContent-D48zPEk7.js → ThreeIsolationSceneContent-CxsM-QHW.js} +1 -1
  36. package/dist/assets/{ToolObject3DPreview-DgLF_qu6.js → ToolObject3DPreview-lsAoRxtr.js} +1 -1
  37. package/dist/assets/{Toolbar-B9tUYMZc.js → Toolbar-yvFlRv8R.js} +1 -1
  38. package/dist/assets/{TransientHint-DXKNt-QA.js → TransientHint-Bslncm_l.js} +1 -1
  39. package/dist/assets/{VideoViewer-Bi0Wh21M.js → VideoViewer-Ba-e91kP.js} +1 -1
  40. package/dist/assets/{ViewportShadingMenu-Csmdi4hc.js → ViewportShadingMenu-CgbuQ0e-.js} +1 -1
  41. package/dist/assets/{active-ingest-CmyN258P.js → active-ingest-CJ2U5L1O.js} +2 -2
  42. package/dist/assets/{animation-clock-BC2sWdly.js → animation-clock-CVpGQSVj.js} +1 -1
  43. package/dist/assets/{animation-mixers.service-DQX6SNau.js → animation-mixers.service-CI0K1tfi.js} +1 -1
  44. package/dist/assets/{animation-timeline.utility-CKWv5WpM.js → animation-timeline.utility-Wg6WxkxK.js} +1 -1
  45. package/dist/assets/{asset-budget-asset.menu-Cb9YAl0T.js → asset-budget-asset.menu-BbCBxjLY.js} +1 -1
  46. package/dist/assets/{asset-budget.action-Cgtt8vU9.js → asset-budget.action-CK8h0v1A.js} +1 -1
  47. package/dist/assets/{asset-budget.document-BVkKAZy5.js → asset-budget.document-CYVcDLvH.js} +1 -1
  48. package/dist/assets/{asset-budget.menu-DNkA4on_.js → asset-budget.menu-BcTijQ2R.js} +1 -1
  49. package/dist/assets/{asset-editor-persistence-BBd80LM5.js → asset-editor-persistence-DWp0E8cc.js} +1 -1
  50. package/dist/assets/{asset-loaders-BcvaZp8m.js → asset-loaders-Bo91oPiL.js} +1 -1
  51. package/dist/assets/{asset-preview-DmWBo3u0.js → asset-preview-BUpxsHNd.js} +1 -1
  52. package/dist/assets/{audio-unlock.service-DdLpyfa_.js → audio-unlock.service-CyiXe5qk.js} +1 -1
  53. package/dist/assets/{audio.utility-Py14n_vZ.js → audio.utility-BN4mANCx.js} +1 -1
  54. package/dist/assets/autoplay.service-CKBqjozr.js +1 -0
  55. package/dist/assets/{babylon-authoring-adapter-rHojeSh-.js → babylon-authoring-adapter-C-EAsfMr.js} +1 -1
  56. package/dist/assets/{binding-resolver-4nTdtOpk.js → binding-resolver-DoOAFM2m.js} +2 -2
  57. package/dist/assets/{blender-node-editor.document-GUoOIqO0.js → blender-node-editor.document-BzkGPs0i.js} +1 -1
  58. package/dist/assets/{blender-properties-tab-DFdr0HH9.js → blender-properties-tab-B1ggqOYB.js} +1 -1
  59. package/dist/assets/{blender-runtime-host-B63tuG7j.js → blender-runtime-host-MJZEPwHA.js} +1 -1
  60. package/dist/assets/{blender-runtime-skin-CPgzavkZ.js → blender-runtime-skin-hw-op7Nt.js} +34 -34
  61. package/dist/assets/{blender-runtime.document-BXMq3aHl.js → blender-runtime.document-CvTyAou8.js} +1 -1
  62. package/dist/assets/{blender-screenshot.menu-eE85nOyL.js → blender-screenshot.menu-C4VXpXVa.js} +1 -1
  63. package/dist/assets/{blender-timeline.document-pcpWfAfg.js → blender-timeline.document-BRFDd7JZ.js} +1 -1
  64. package/dist/assets/{blender-uv-editor.document-BALjSW5I.js → blender-uv-editor.document-CM09ITWu.js} +1 -1
  65. package/dist/assets/{blender-version.status-Iy8VtIIH.js → blender-version.status-CPyc_-kA.js} +1 -1
  66. package/dist/assets/{blender.command-B7a7jadi.js → blender.command-ktKz-2Zi.js} +1 -1
  67. package/dist/assets/{board-guides-Cnfvv0uu.js → board-guides-CCiyx8cT.js} +1 -1
  68. package/dist/assets/{bridge.command-BgMolZm1.js → bridge.command-tP5j6w72.js} +3 -3
  69. package/dist/assets/{browserAll-DNmYiuy_.js → browserAll-BSQVVrNG.js} +1 -1
  70. package/dist/assets/{build-player.document-C0_bEcCK.js → build-player.document-BwbBXtF5.js} +1 -1
  71. package/dist/assets/{build-profiles.document-DT2a6gH1.js → build-profiles.document-UiF_BsjE.js} +1 -1
  72. package/dist/assets/{build-progress.status-ycndNYab.js → build-progress.status-Bf5KpnxC.js} +1 -1
  73. package/dist/assets/{build-session-Bhmr1BX8.js → build-session-C4jVDt-u.js} +1 -1
  74. package/dist/assets/{build.action-DxTFOUGG.js → build.action-DP2d1Uhj.js} +1 -1
  75. package/dist/assets/{build.command-DpKOQydG.js → build.command-D5pyNcoj.js} +1 -1
  76. package/dist/assets/{build.header-zCX7El5x.js → build.header-DupBIAOw.js} +1 -1
  77. package/dist/assets/{build.menu-Y4MQiX4G.js → build.menu-DWrKtdoV.js} +1 -1
  78. package/dist/assets/{build.service-DHiSV5PL.js → build.service-qnz73gSX.js} +1 -1
  79. package/dist/assets/{camera-DI8pqzQ3.js → camera-C74U5X7o.js} +1 -1
  80. package/dist/assets/{camera-runtime.inspector-eJ8cyMzk.js → camera-runtime.inspector-B2l34Xhl.js} +1 -1
  81. package/dist/assets/{canvas-design-mount-CAFDbAPl.js → canvas-design-mount-D4M3E1AX.js} +3 -3
  82. package/dist/assets/{canvas-entry-runtime-CgJkCzp_.js → canvas-entry-runtime-CLOuJcgT.js} +2 -2
  83. package/dist/assets/{canvas-preview-frames-DMZo3rqI.js → canvas-preview-frames-CSCcu2sG.js} +1 -1
  84. package/dist/assets/{canvas-story-capture.service-CHnbQ9OT.js → canvas-story-capture.service-onD_xSpQ.js} +2 -2
  85. package/dist/assets/{capability-coverage-BMuTFU_9.js → capability-coverage-EnZ99FoT.js} +1 -1
  86. package/dist/assets/{collaboration-presence-Dqfb6e2Y.js → collaboration-presence-1_UMOAkw.js} +1 -1
  87. package/dist/assets/{collider-WqTqi5FX.js → collider-C6R1tHfa.js} +1 -1
  88. package/dist/assets/{component-board.service-DJYpMxt6.js → component-board.service-BX_2bwX3.js} +2 -2
  89. package/dist/assets/{component-board.service-RgOavG9Y.js → component-board.service-Ckl-5tA4.js} +2 -2
  90. package/dist/assets/{component-board.service-C-ukHwAR.js → component-board.service-Cuf_SXeA.js} +2 -2
  91. package/dist/assets/{component-contracts.service-B-uhvD4S.js → component-contracts.service-rI-rbvDG.js} +1 -1
  92. package/dist/assets/{component-instance-root-Ctbx3vOO.js → component-instance-root-wO1p-rLr.js} +1 -1
  93. package/dist/assets/{component-verbs.command-C07COqiF.js → component-verbs.command-O2bwqmK3.js} +1 -1
  94. package/dist/assets/{component-verbs.service-EKWGRKJg.js → component-verbs.service-BiiQMtJt.js} +1 -1
  95. package/dist/assets/{config-Bzq-GFuV.js → config-dVnV1cxW.js} +2 -2
  96. package/dist/assets/{configurations-BICGR-Zc.js → configurations-8qaUqMH7.js} +1 -1
  97. package/dist/assets/{connection.status-BMAWlexm.js → connection.status-vH9WCDDg.js} +1 -1
  98. package/dist/assets/{constraints.inspector-DQdAuWx-.js → constraints.inspector-C7UjUxPR.js} +1 -1
  99. package/dist/assets/{content-bounds-D_jbMNmm.js → content-bounds-Dl5Y3LLv.js} +1 -1
  100. package/dist/assets/{contract-system-adapters-D8SzcuZo.js → contract-system-adapters-BDUpDoKd.js} +1 -1
  101. package/dist/assets/{coverage.service-DZ4GmnS6.js → coverage.service-IS7Oklo8.js} +1 -1
  102. package/dist/assets/{create-runtime-BKAyWS74.js → create-runtime-Bucz0XVU.js} +1 -1
  103. package/dist/assets/{curve-DNYPUZIO.js → curve-D0Q6TczG.js} +1 -1
  104. package/dist/assets/{data-asset-LAsOyoML.js → data-asset-B0a1y8M-.js} +1 -1
  105. package/dist/assets/{data-ref-CbopN4AX.js → data-ref-dRt2Wi5L.js} +1 -1
  106. package/dist/assets/{debug-bridge-Cx3PFUcu.js → debug-bridge-EhDkhrLX.js} +1 -1
  107. package/dist/assets/{debug-registry-CcTdmLf3.js → debug-registry-B2THKz1v.js} +1 -1
  108. package/dist/assets/{deferred-ingest-play-DsV_qXEP.js → deferred-ingest-play-To3ZratW.js} +2 -2
  109. package/dist/assets/{design-time-canvas-mount-BGmhI2sv.js → design-time-canvas-mount-BnSaRAbS.js} +2 -2
  110. package/dist/assets/{design-time-layers-CyFYxvKE.js → design-time-layers-OMAIxOrv.js} +1 -1
  111. package/dist/assets/{design-time-mount.service-CeT_SfZi.js → design-time-mount.service-Bgr_nCDs.js} +2 -2
  112. package/dist/assets/{design-time-mount.service-Dui8o0rU.js → design-time-mount.service-RFkiqPIn.js} +2 -2
  113. package/dist/assets/{design-time-react-mount-3LQxFo0f.js → design-time-react-mount-BsSBoX7J.js} +1 -1
  114. package/dist/assets/{document-preview-three-BiKoHIJ7.js → document-preview-three-Qni0oVBw.js} +1 -1
  115. package/dist/assets/{dom-authoring-adapter-DBtypFqH.js → dom-authoring-adapter-DsUgOtQy.js} +1 -1
  116. package/dist/assets/{draco3d-CTue-r-D.js → draco3d-DyZllcka.js} +1 -1
  117. package/dist/assets/{edit-mode-audio.service-4vq1g0yL.js → edit-mode-audio.service-CjXNAZEs.js} +1 -1
  118. package/dist/assets/{edit-mode-authoring-CIXoejcH.js → edit-mode-authoring-BDgZD47j.js} +1 -1
  119. package/dist/assets/{edit-mode-networking.service-vseafVn2.js → edit-mode-networking.service-3dUr2g_0.js} +1 -1
  120. package/dist/assets/{editor-api-BboLGD_u.js → editor-api-DTrNJMXL.js} +1 -1
  121. package/dist/assets/{editor-layers-CYVQVJ5O.js → editor-layers-DwaX5UFy.js} +1 -1
  122. package/dist/assets/{editor-shell-store-B76wIXvV.js → editor-shell-store-aKHbAoCV.js} +1 -1
  123. package/dist/assets/{entity-object-C6hm5vYx.js → entity-object-BLJ-I8XT.js} +1 -1
  124. package/dist/assets/{extend-BUAnZzoH.js → extend-6LrR7eSL.js} +1 -1
  125. package/dist/assets/{fork-menu-D9wqdfzJ.js → fork-menu-V-FM6YuY.js} +1 -1
  126. package/dist/assets/{frame-debugger-store-BnZFxjhV.js → frame-debugger-store-DwDC0wAm.js} +1 -1
  127. package/dist/assets/{game-contract-seams-CzlxJGC2.js → game-contract-seams-C22a4B79.js} +1 -1
  128. package/dist/assets/{game-css-scope-transform-DhimYh-2.js → game-css-scope-transform-Wv0ZdTsR.js} +1 -1
  129. package/dist/assets/{game-document.service-CPeo8J5j.js → game-document.service-BzvFIWCc.js} +1 -1
  130. package/dist/assets/{game-eval.command-Zj-0kehE.js → game-eval.command-DpQn_nY8.js} +1 -1
  131. package/dist/assets/{game-module-access-B2UMV47n.js → game-module-access-BI6oBa8Y.js} +1 -1
  132. package/dist/assets/{game-network-Bof-cN2R.js → game-network-Deo8lcPw.js} +3 -3
  133. package/dist/assets/{gameplay-export-Bq4t4aCy.js → gameplay-export-BOLhxmII.js} +1 -1
  134. package/dist/assets/{gameplay-replay-DP08m8Vv.js → gameplay-replay-Dkvmv6hf.js} +1 -1
  135. package/dist/assets/{gameplay.command-Del3_mAr.js → gameplay.command-DCKqLv7C.js} +1 -1
  136. package/dist/assets/{generation-jobs-Mfqth2Xe.js → generation-jobs-6D562vMB.js} +1 -1
  137. package/dist/assets/{generation.service-CUJTwwYl.js → generation.service-BFRoLb7y.js} +1 -1
  138. package/dist/assets/{generations-CJUKodbu.js → generations-HwV1btKK.js} +1 -1
  139. package/dist/assets/{generations.status-mer9NXCK.js → generations.status-BLiDcKsg.js} +1 -1
  140. package/dist/assets/{hierarchy-marks-sMK9R4NU.js → hierarchy-marks-DeG4E4Ke.js} +1 -1
  141. package/dist/assets/{hosted-asset-materialization-BSvRWupx.js → hosted-asset-materialization-Bod7CEMF.js} +1 -1
  142. package/dist/assets/{index-Com2cl89.js → index-4hL3-0yz.js} +1 -1
  143. package/dist/assets/{index-DUA0RF9E.js → index-CHOT9sYh.js} +2 -2
  144. package/dist/assets/{index-DHFPVxsm.js → index-CLUA6PYq.js} +1 -1
  145. package/dist/assets/{index---JtxLq2.js → index-CdLhNxor.js} +1 -1
  146. package/dist/assets/{index-Cjv2Ynte.js → index-ClgrFOcX.js} +7 -7
  147. package/dist/assets/{index-ICvy7jWw.js → index-CyLPQ8pY.js} +1 -1
  148. package/dist/assets/{index-uTZA4wRW.js → index-DkYeh000.js} +1 -1
  149. package/dist/assets/{index-BpfZiKqX.js → index-KIR4Has5.js} +1 -1
  150. package/dist/assets/{index-CCOqpqGv.js → index-jS3rfNkZ.js} +1 -1
  151. package/dist/assets/{inference-diagnostics-DE1P5w14.js → inference-diagnostics-BmZ5ggEK.js} +1 -1
  152. package/dist/assets/{ingest-boot-viewport-Dynh3g5V.js → ingest-boot-viewport-CipkFljr.js} +1 -1
  153. package/dist/assets/{ingest-siblings-BsIV1T53.js → ingest-siblings-CEwYp-xg.js} +1 -1
  154. package/dist/assets/{ingest-source-persistence-BNek6mSi.js → ingest-source-persistence-CVU1rTj0.js} +1 -1
  155. package/dist/assets/{ingest.service-C0M-0EwA.js → ingest.service-bNqvcqoK.js} +1 -1
  156. package/dist/assets/{inspect-xUKvX80V.js → inspect-BunjdqX7.js} +1 -1
  157. package/dist/assets/instances.command-DzcXdKuG.js +1 -0
  158. package/dist/assets/{json-history-resource-C1pGwXuI.js → json-history-resource-CDEoQe1R.js} +1 -1
  159. package/dist/assets/{layered-pick-ASc-_oGG.js → layered-pick-guh6WlA7.js} +1 -1
  160. package/dist/assets/{light-CHiYAJQ0.js → light-BPZivpCK.js} +1 -1
  161. package/dist/assets/{live-project-verbs-D_8wWaCB.js → live-project-verbs-Bqmxbr2o.js} +1 -1
  162. package/dist/assets/{machine.document-CnvC2j0i.js → machine.document-CAFPFq5K.js} +1 -1
  163. package/dist/assets/{machines.finder-x38pLZFO.js → machines.finder-CbUWReMp.js} +1 -1
  164. package/dist/assets/{material-factory-wvMjnOTo.js → material-factory-BkyOzJ7B.js} +1 -1
  165. package/dist/assets/{material-B9iSj5st.js → material-huG6lNEK.js} +1 -1
  166. package/dist/assets/{mesh-C64nd8qK.js → mesh-CjCfRcFK.js} +1 -1
  167. package/dist/assets/{model-asset-sections.service-UsTToAYb.js → model-asset-sections.service-Dt4V2K2v.js} +1 -1
  168. package/dist/assets/{model-inspection-ae_w8T6s.js → model-inspection-BDA5jikL.js} +1 -1
  169. package/dist/assets/{model-thumbnail-ClOTX_JF.js → model-thumbnail-CF3qGQWb.js} +1 -1
  170. package/dist/assets/{models.finder-Bl6i3QOW.js → models.finder-yh4YeGrA.js} +1 -1
  171. package/dist/assets/{module-mode-CRBEidVP.js → module-mode-D8en13PD.js} +2 -2
  172. package/dist/assets/{mount-canvas-ingest-root-BFKVZ_nn.js → mount-canvas-ingest-root-JOkm2Ypj.js} +2 -2
  173. package/dist/assets/{mount-dom-ingest-root-CUBVJcU_.js → mount-dom-ingest-root-CVXFnJZb.js} +2 -2
  174. package/dist/assets/{mount-ingest-root-CyZae-B7.js → mount-ingest-root-C3o0o28C.js} +2 -2
  175. package/dist/assets/{mount-manifest-BMD5D62M.js → mount-manifest-d7WQ9MYp.js} +1 -1
  176. package/dist/assets/{mount-three-ingest-root-BgBc58nU.js → mount-three-ingest-root-Dqd4XWP1.js} +1 -1
  177. package/dist/assets/{mounted-authoring-DQ0-LgR6.js → mounted-authoring-B697dYuN.js} +1 -1
  178. package/dist/assets/{mounted-story-viewport-source-BsbduGue.js → mounted-story-viewport-source-BvNZ3QQn.js} +1 -1
  179. package/dist/assets/{native-debug-module-BUPFKtBc.js → native-debug-module-iX2-V5kg.js} +1 -1
  180. package/dist/assets/{navigation-DN3By10F.js → navigation-CIl9OY1F.js} +1 -1
  181. package/dist/assets/{navmesh.menu-BkB8EXHu.js → navmesh.menu-DrMoj7Ag.js} +1 -1
  182. package/dist/assets/{navmesh.service-C75Hdd7h.js → navmesh.service-CTr1NVfz.js} +1 -1
  183. package/dist/assets/network-observer.service-DyzpGKA7.js +1 -0
  184. package/dist/assets/{network.utility-C_lQVcOt.js → network.utility-Btexm5ao.js} +1 -1
  185. package/dist/assets/{object3d-document-session-registry-D8XSoEpf.js → object3d-document-session-registry-CADiW-LP.js} +2 -2
  186. package/dist/assets/{oid-transform-CvzWDfCe.js → oid-transform-Ca1oU_Ei.js} +1 -1
  187. package/dist/assets/{particles-JKSmSdCW.js → particles-D1oPwNJh.js} +1 -1
  188. package/dist/assets/{pixi-authoring-adapter-CAS5Elnh.js → pixi-authoring-adapter-B1BBfTju.js} +1 -1
  189. package/dist/assets/{pixi-live-write-target-BO-cO1Gl.js → pixi-live-write-target-BcUhtqmJ.js} +1 -1
  190. package/dist/assets/{play.command-Czxm8cvG.js → play.command-ScnwcvJr.js} +2 -2
  191. package/dist/assets/{presentation-xDN53iEZ.js → presentation-DPfnCjNA.js} +1 -1
  192. package/dist/assets/{product-mtU_pRkY.js → product-D_9saRiZ.js} +1 -1
  193. package/dist/assets/{profiler.action-Beoiw4ON.js → profiler.action-PXTw93E5.js} +1 -1
  194. package/dist/assets/{profiler.menu-BvuSldBS.js → profiler.menu-DPFV6QQD.js} +1 -1
  195. package/dist/assets/{profiler.utility-3qST7Ixj.js → profiler.utility-eDooJGnI.js} +1 -1
  196. package/dist/assets/{project-authoring-session-DAcbPWsU.js → project-authoring-session-BmeutotA.js} +2 -2
  197. package/dist/assets/{properties-bone-constraints.inspector-8yqXfdtn.js → properties-bone-constraints.inspector-BW0V1WXQ.js} +1 -1
  198. package/dist/assets/{properties-bone.inspector-CQ41MY4S.js → properties-bone.inspector-DIvTZhY8.js} +1 -1
  199. package/dist/assets/{properties-collection.inspector-Bdk09XCE.js → properties-collection.inspector-Dbt5XMhs.js} +1 -1
  200. package/dist/assets/{properties-constraints.inspector-CrNnu6jW.js → properties-constraints.inspector-5SvB0GDC.js} +1 -1
  201. package/dist/assets/{properties-data.inspector-84938huJ.js → properties-data.inspector-C-SngIsI.js} +1 -1
  202. package/dist/assets/{properties-material.inspector-BarvuWEj.js → properties-material.inspector-CYAWsvsX.js} +1 -1
  203. package/dist/assets/{properties-modifiers.inspector-Cm2y4Vb6.js → properties-modifiers.inspector-XN6BL-Ll.js} +1 -1
  204. package/dist/assets/{properties-object.inspector-Bf0eY0kG.js → properties-object.inspector-CfryU0kN.js} +1 -1
  205. package/dist/assets/{properties-output.inspector-D_NFrDmS.js → properties-output.inspector-COfgmFUW.js} +1 -1
  206. package/dist/assets/{properties-particles.inspector-BZaLS0X7.js → properties-particles.inspector-BCh0vFr6.js} +1 -1
  207. package/dist/assets/{properties-physics.inspector-BIwFNf1B.js → properties-physics.inspector-B6to1u6U.js} +1 -1
  208. package/dist/assets/{properties-render.inspector-BahRi3z3.js → properties-render.inspector-C4hVfo7j.js} +1 -1
  209. package/dist/assets/{properties-scene.inspector-C9p2pucf.js → properties-scene.inspector-dKta4xn5.js} +1 -1
  210. package/dist/assets/{properties-texture.inspector-J_6EK4f-.js → properties-texture.inspector-ZlNhW25m.js} +1 -1
  211. package/dist/assets/{properties-view-layer.inspector-BgniFnwR.js → properties-view-layer.inspector-CIxHmkDR.js} +1 -1
  212. package/dist/assets/{properties-world.inspector-CzcRcbOY.js → properties-world.inspector-Ce0q2dmK.js} +1 -1
  213. package/dist/assets/{r3f-design-session-C5_NQltq.js → r3f-design-session-1riISktt.js} +2 -2
  214. package/dist/assets/{r3f-physics-binding-BRcBDERW.js → r3f-physics-binding-DuG97FR9.js} +1 -1
  215. package/dist/assets/{r3f-source-authoring-adapter-N_d4ivmu.js → r3f-source-authoring-adapter-B8qqrdwk.js} +1 -1
  216. package/dist/assets/{react-canvas-navigation-BWgmHmpc.js → react-canvas-navigation-CxBm8iw8.js} +1 -1
  217. package/dist/assets/{react-inspector.service-C0telKKC.js → react-inspector.service-BcdePwno.js} +1 -1
  218. package/dist/assets/{react-story-board-CGF1vFuk.js → react-story-board-CMvkLAkF.js} +1 -1
  219. package/dist/assets/{react-three-rapier.esm-C8iL26_6.js → react-three-rapier.esm-D5svf-ME.js} +1 -1
  220. package/dist/assets/{react-world-authoring-adapter-CTCp7U6C.js → react-world-authoring-adapter-Dq8NqvWu.js} +1 -1
  221. package/dist/assets/{realm-services-CbgTofeT.js → realm-services-CqjVBanw.js} +1 -1
  222. package/dist/assets/{reflection-probe-capture.inspector-Dp3WN9X2.js → reflection-probe-capture.inspector-uEvyppEj.js} +1 -1
  223. package/dist/assets/{registry-DPYQgPRv.js → registry-D7lFIA8c.js} +1 -1
  224. package/dist/assets/{relative-import-specifier-CPSPKQKY.js → relative-import-specifier-CA9mSNXO.js} +1 -1
  225. package/dist/assets/{render-env-FpydFP_z.js → render-env-BHasp-z3.js} +1 -1
  226. package/dist/assets/{render-features-BYgh328X.js → render-features-sSb1-c5x.js} +1 -1
  227. package/dist/assets/{render-settings-DeBS5HzD.js → render-settings-CUbo4Sw5.js} +1 -1
  228. package/dist/assets/{resolve-three-BUKYgCMY.js → resolve-three-TQ367RQD.js} +3 -3
  229. package/dist/assets/{root-seam-contract-B33VsC6Z.js → root-seam-contract-CneTgNww.js} +1 -1
  230. package/dist/assets/{run-selection-BdsJXY3k.js → run-selection-CNsOQTEG.js} +1 -1
  231. package/dist/assets/{scene-capture-CMwvLaW9.js → scene-capture-KbdRgsD3.js} +1 -1
  232. package/dist/assets/{scene-document.service-DqReOF6t.js → scene-document.service-CmPSUocW.js} +2 -2
  233. package/dist/assets/{scene-framing-Dq-okRQ_.js → scene-framing-B5JC4NeG.js} +1 -1
  234. package/dist/assets/{seeded-random-BVi4_fs4.js → seeded-random-B6zqGkWP.js} +1 -1
  235. package/dist/assets/{setup-renderer-Cdx_0C3T.js → setup-renderer-efjIBSGF.js} +1 -1
  236. package/dist/assets/{source-object3d-authoring-adapter-CRQ5Iruy.js → source-object3d-authoring-adapter-DeeboYub.js} +1 -1
  237. package/dist/assets/{source-persistence-backend-BMbXR_WB.js → source-persistence-backend-Cwy93SmQ.js} +1 -1
  238. package/dist/assets/{stage-keyboard-ntaDc3sd.js → stage-keyboard-GNCaTXLA.js} +1 -1
  239. package/dist/assets/{stage-overlay-set-CmvMTUuj.js → stage-overlay-set-DV3SCzJb.js} +1 -1
  240. package/dist/assets/{stage-presence-markers--CsmPxKk.js → stage-presence-markers-CBEU1Kzo.js} +1 -1
  241. package/dist/assets/{stage-transform-tools-eaq_pmiw.js → stage-transform-tools-C9nNDW6n.js} +1 -1
  242. package/dist/assets/{standard-viewport-dressing-DaBfL3HV.js → standard-viewport-dressing-BJkGwiNT.js} +1 -1
  243. package/dist/assets/{state-watch.action-BBeD9rI6.js → state-watch.action-Doz_jrzS.js} +1 -1
  244. package/dist/assets/{state-watch.menu-BtjTGcSx.js → state-watch.menu-Dj4DUUxN.js} +1 -1
  245. package/dist/assets/{state-watch.utility-CLrBmLch.js → state-watch.utility-COPa8xpV.js} +1 -1
  246. package/dist/assets/{story-capture-DvMpONUV.js → story-capture-stRSY4PQ.js} +1 -1
  247. package/dist/assets/{story-documents-C1h5_Fvv.js → story-documents-CYzWYY1o.js} +1 -1
  248. package/dist/assets/{story-documents.service-BvSI6xU7.js → story-documents.service-C5r8KFEG.js} +1 -1
  249. package/dist/assets/{story-documents.service-e4GgOiBP.js → story-documents.service-DJBu4rve.js} +1 -1
  250. package/dist/assets/{story-media-presence-UYdQuwtq.js → story-media-presence-D4AIsAtK.js} +1 -1
  251. package/dist/assets/{story-pixi-preview-BVXZsJAe.js → story-pixi-preview-mPo3OFOd.js} +1 -1
  252. package/dist/assets/{story-presentation-CU1g5VGf.js → story-presentation-Dw4Vw65P.js} +1 -1
  253. package/dist/assets/{story-three-preview-DdduzS7D.js → story-three-preview-CWM0Rj7x.js} +2 -2
  254. package/dist/assets/{studio-environment-DZOr5iAy.js → studio-environment-Bw9zMFE8.js} +1 -1
  255. package/dist/assets/{surface-state-C0NqVDj5.js → surface-state-b_H4iOCJ.js} +1 -1
  256. package/dist/assets/{syntactic-prop-specs--oEbzaCI.js → syntactic-prop-specs-BCdwWi-T.js} +1 -1
  257. package/dist/assets/{team-playtest.service-DTvCDmka.js → team-playtest.service-CnxdTghn.js} +1 -1
  258. package/dist/assets/{three-CAVY58Dv.js → three-DWy0sZom.js} +1 -1
  259. package/dist/assets/{three-authoring-adapter-BDMrB8fC.js → three-authoring-adapter-9LcUBPaU.js} +1 -1
  260. package/dist/assets/three-authoring.service-DdTMF4A2.js +2 -0
  261. package/dist/assets/{three-ingest-runtime-BPTa3ryG.js → three-ingest-runtime-x9nLmUl-.js} +1 -1
  262. package/dist/assets/{three-integration-CJIrJnlD.js → three-integration-DB-xQHD5.js} +2 -2
  263. package/dist/assets/three-integration.service-DwToRGIc.js +1 -0
  264. package/dist/assets/{three-projection-core-BnoDtdZY.js → three-projection-core-IUovHgg_.js} +1 -1
  265. package/dist/assets/{three-state-_BZo8PPs.js → three-state-_ImCbP87.js} +1 -1
  266. package/dist/assets/{three-story-capture.service-CzIciMHs.js → three-story-capture.service-wKwfSnqA.js} +2 -2
  267. package/dist/assets/{three-story-model-BZAqoEDw.js → three-story-model-BxWKcl9d.js} +1 -1
  268. package/dist/assets/{three-viewport-presentation-DsFI1PyU.js → three-viewport-presentation-Bg86EsDJ.js} +1 -1
  269. package/dist/assets/{transform-mode-request-ROdyyd8M.js → transform-mode-request-BnV8FSnx.js} +1 -1
  270. package/dist/assets/{transport-strip-DAasOTBr.js → transport-strip-BZQnaxFN.js} +1 -1
  271. package/dist/assets/transport.header-1SF4ZbEd.js +1 -0
  272. package/dist/assets/{tuples-BFQG7BqZ.js → tuples-DR33sMq6.js} +1 -1
  273. package/dist/assets/{ui-board-document-C-DxG3Lj.js → ui-board-document-VJMvm6Ks.js} +2 -2
  274. package/dist/assets/{user-data-DxeJHxTz.js → user-data-DL6HsBPf.js} +1 -1
  275. package/dist/assets/{utility-view-state-CGlE9NdF.js → utility-view-state-ghWXsYXq.js} +1 -1
  276. package/dist/assets/{viewport-door-CTspfOX-.js → viewport-door-BV_lf5uK.js} +1 -1
  277. package/dist/assets/{viewport-root-presentation-Co7zteuS.js → viewport-root-presentation-CKqhX3mt.js} +1 -1
  278. package/dist/assets/{viewport-surface-status-P6QST-xH.js → viewport-surface-status-D7M2L2lI.js} +1 -1
  279. package/dist/assets/{webworkerAll-BH-WTk1P.js → webworkerAll-DDbFvxgB.js} +1 -1
  280. package/dist/assets/{workspace-arrangement-Bq8u7HUK.js → workspace-arrangement-86_8Kk5K.js} +1 -1
  281. package/dist/assets/{world-documents-DP1Ifjck.js → world-documents-DeNJUefV.js} +1 -1
  282. package/dist/assets/{world-root-stage-binding-1BOYY3z-.js → world-root-stage-binding-VOrldLB4.js} +1 -1
  283. package/dist/assets/{xstate-animation-binding-GsfnPsLk.js → xstate-animation-binding-747CfEeB.js} +1 -1
  284. package/dist/assets/{xstate-animation-meta-BS3q6oQo.js → xstate-animation-meta-DNMlMnr-.js} +1 -1
  285. package/dist-node/cli.js +16 -16
  286. package/package.json +16 -16
  287. package/dist/assets/InspectorObjectPreview-Bc9QgcaX.js +0 -1
  288. package/dist/assets/Object3DDocumentViewport-S-0l2Ppm.js +0 -2
  289. package/dist/assets/autoplay.service-BxNf_ohc.js +0 -1
  290. package/dist/assets/instances.command-Cc9TSete.js +0 -1
  291. package/dist/assets/network-observer.service-AzK_SzI2.js +0 -1
  292. package/dist/assets/three-authoring.service-DbhfcSSn.js +0 -2
  293. package/dist/assets/three-integration.service-DTBYyabq.js +0 -1
  294. package/dist/assets/transport.header-QMchTQhw.js +0 -1
@@ -1 +1 @@
1
- import{gp as k,Z as p,ag as I,gq as P,gr as N,aG as H,gs as C,b$ as f,b4 as _,gt as g,gu as F,gv as $,gw as B,aC as W,gx as A,gy as x,gz as M,gA as O,b_ as D,gB as T}from"./index-Cjv2Ynte.js";const G={transform:!1,inspectorFields:!1,persist:!1};class q{capabilities=G;provenance={source:"boundary",label:"read-only",detail:"Declared world without a live editing surface in this viewport — disclosed, not simulated; rows are read-only."};world;reason;store;pickable;constructor(e,r,n,s){this.store=e,this.world=r,this.reason=n??null,s&&(this.pickable={pick:s})}get disclosure(){return this.reason}get label(){return this.world.entryOrScenePath?.split("/").pop()??this.world.id}get node(){return{id:this.world.id,label:this.label,secondaryLabel:this.reason?"Unavailable":"Read-only",role:"boundary",kind:this.world.kind,parentId:null,childIds:[]}}hierarchy={roots:()=>[this.node],node:e=>e===this.world.id?this.node:null};selection={get:()=>[...this.store.selectedEntityIds],set:e=>this.store.selectMultiple(e)};inspector={properties:e=>{if(e!==this.world.id)return[];const r=[{path:"kind",label:"Kind",type:"string",readonly:!0}];return this.world.adapter!==void 0&&r.push({path:"adapter",label:"Adapter",type:"string",readonly:!0}),this.world.entryOrScenePath!==void 0&&r.push({path:"path",label:"Entry / Scene",type:"string",readonly:!0}),r.push({path:"zOrder",label:"Z Order",type:"number",readonly:!0},{path:"pausable",label:"Pausable",type:"boolean",readonly:!0}),this.reason&&r.push({path:"reason",label:"Reason",type:"string",readonly:!0}),r},get:(e,r)=>{if(e===this.world.id)switch(r){case"kind":return this.world.kind;case"adapter":return this.world.adapter;case"path":return this.world.entryOrScenePath;case"zOrder":return this.world.zOrder;case"pausable":return this.world.pausable;case"reason":return this.reason??void 0;default:return}},set:(e,r,n)=>{}}}const u=new WeakMap,V=new Set;function R(){for(const t of V)t()}function J(t){const e=(u.get(t)?.generation??0)+1;return u.set(t,{generation:e,settled:!1}),R(),()=>{const r=u.get(t);!r||r.generation!==e||r.settled||(u.set(t,{generation:e,settled:!0}),R())}}const L="(invalid manifest)";let v=!1,b=!1,w=!1,l=null;function h(){if(b||w||!v||!l)return;b=!0;const t=l;queueMicrotask(()=>{if(b=!1,l!==t){h();return}v=!1,w=!0,Promise.resolve().then(t).catch(e=>{p.error(`Edit-mode rebuild failed: ${e instanceof Error?e.message:String(e)}`,"authoring")}).finally(()=>{w=!1,h()})})}function re(t){return l=t,h(),()=>{l===t&&(l=null)}}function ne(){v=!0,h()}const Z=new Set(["three","canvas","dom"]);function d(t){return typeof t=="string"?t:void 0}function K(t){const e=t.world;if(!e||typeof e!="object")return;const r=d(e.entry);if(r)return{entry:r,export:d(e.export)}}function U(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="object"){const e=t;if(typeof e.module=="string")return`module:${e.module}`;const r=e.ingest;if(r&&typeof r=="object")return"ingest"}}}function Q(t){if(!t||typeof t!="object")return null;const e=t.roots;return e===void 0||!Array.isArray(e)?null:{roots:e.map((n,s)=>{const i=n&&typeof n=="object"?n:{},a=i.zOrder,o=i.pausable;return{id:d(i.id)??`(world ${s})`,surface:(typeof i.adapter=="string"?d(i.adapter):void 0)??d(i.adapter&&typeof i.adapter=="object"?i.adapter.surface:void 0)??"(missing adapter surface)",adapter:U(i.adapter),scene:d(i.scene),entry:d(i.entry),zOrder:typeof a=="number"?a:void 0,pausable:typeof o=="boolean"?o:void 0,dev:i.dev===!0,world:K(i)}})}}function X(t){return Z.has(t.surface)?!t.scene&&!t.entry?`World "${t.id}" declares neither \`scene\` nor \`entry\` — nothing to mount.`:null:`Unknown world surface "${t.surface}" — expected one of: three, canvas, react.`}function c(t,e){const r=t.roots;if(Array.isArray(r))return r.find(n=>!!n&&typeof n=="object"&&n.id===e)}function E(t,e){return c(t,e)}class Y{raw;synthesizedValue;store;fileHistory;unsubscribeHistory;constructor(e,r,n){this.raw=e,this.synthesizedValue=r,this.store=n;const s=n.projectHistory;this.fileHistory=s?_(s,g(),"project-manifest"):null,this.unsubscribeHistory=this.fileHistory?this.fileHistory.subscribeAll(i=>{i==="volter.project.json"&&g().readBytes(i).then(a=>JSON.parse(new TextDecoder().decode(a))).then(a=>{for(const o of Object.keys(this.raw))delete this.raw[o];Object.assign(this.raw,a),this.store.notifyIngestEdit()}).catch(()=>{})}):null}getGameName(){const e=this.raw.name;return typeof e=="string"?e:""}get synthesized(){return this.synthesizedValue}setGameName(e){this.raw.name=e,this.persist("Rename Game")}getRootContentSource(e){const r=c(this.raw,e);if(!r)return;const n=r.scene;if(typeof n=="string")return`Scene · ${n}`;const s=r.entry;return typeof s=="string"?`Entry · ${s}`:"Adapter-owned runtime content"}getRootZOrder(e){const r=c(this.raw,e)?.zOrder;return typeof r=="number"?r:0}setRootZOrder(e,r){const n=E(this.raw,e);n&&(n.zOrder=r,this.persist("Change World Order"))}getRootPausable(e){const r=c(this.raw,e)?.pausable;return typeof r=="boolean"?r:!0}setRootPausable(e,r){const n=E(this.raw,e);n&&(n.pausable=r,this.persist("Change World Pausing"))}async materialize(){const e=await this.write("Create Game Manifest");return e&&(this.synthesizedValue=!1),e}dispose(){this.unsubscribeHistory?.()}persist(e){this.synthesized||this.write(e)}async write(e){const r=JSON.stringify(this.raw,null,2);try{if(this.fileHistory)return await this.fileHistory.write("volter.project.json",r,{label:e,kind:"manifest",contentType:"application/json"}),this.store.notifyIngestEdit(),!0;const n=async()=>{const s=await fetch("/__editor/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:"volter.project.json",content:r,...F()})});$(s,"Write volter.project.json failed"),s.ok||await B(s,{label:"Write volter.project.json",attempted:{"volter.project.json":r},reapply:n})};return await n(),this.store.notifyIngestEdit(),!0}catch(n){return this.fileHistory&&g().readBytes("volter.project.json").then(s=>JSON.parse(new TextDecoder().decode(s))).then(s=>{for(const i of Object.keys(this.raw))delete this.raw[i];Object.assign(this.raw,s),this.store.notifyIngestEdit()}).catch(()=>{}),p.error(`Failed to write volter.project.json: ${n}`,"project"),!1}}}let m=null;function ee(t,e,r){const n=I(e).map(o=>{const y=o.zOrder??0,j=P(o.surface);if(j)return{worldId:o.id,kind:o.surface,adapter:j(t,o.id),zOrder:y};const S=X(o),z={id:o.id,kind:o.surface,adapter:o.adapter,entryOrScenePath:o.scene??o.entry,zOrder:y,pausable:o.pausable??!0};return{worldId:o.id,kind:o.surface,adapter:new q(t,z,S??void 0),zOrder:y}}),s=r&&n.length>=1?new Y(r.raw,r.synthesized,t):void 0;m=s??null;const i=N(W()?.config),a=new H(n,s,i);if(n.length>=1){if(A()&&!x())return p.warn("Edit-mode authoring not installed: a foreign session (ingest/play) owns the authoring override.","authoring"),a;C(a),f(a),t.notifyIngestEdit()}else if(!A()){const o=D(t,"No world yet","Declare a root in volter.project.json");M(o),f(o),t.notifyIngestEdit()}return a}function se(t){t&&O()===t&&f(null);const e=T();e&&O()===e&&f(null),M(null),m?.dispose(),m=null}async function ie(t){const e=J(t);let r,n;try{const s=await k(),i=s!==null&&Q(s);if(i)r=i,n={raw:s,synthesized:!1};else throw new Error("manifest has no `roots` array (zero roots is fine; a missing field is not)")}catch(s){const i=s instanceof Error?s.message:String(s);p.error(`Failed to load volter.project.json: ${i}`,"project"),r={roots:[{id:"manifest",surface:L,adapter:i}]}}try{return ee(t,r,n)}finally{e()}}export{q as B,L as I,re as b,se as e,ie as i,Q as p,ne as q};
1
+ import{gp as k,Z as p,ag as I,gq as P,gr as N,aG as H,gs as C,b$ as f,b4 as _,gt as g,gu as F,gv as $,gw as B,aC as W,gx as A,gy as x,gz as M,gA as O,b_ as D,gB as T}from"./index-ClgrFOcX.js";const G={transform:!1,inspectorFields:!1,persist:!1};class q{capabilities=G;provenance={source:"boundary",label:"read-only",detail:"Declared world without a live editing surface in this viewport — disclosed, not simulated; rows are read-only."};world;reason;store;pickable;constructor(e,r,n,s){this.store=e,this.world=r,this.reason=n??null,s&&(this.pickable={pick:s})}get disclosure(){return this.reason}get label(){return this.world.entryOrScenePath?.split("/").pop()??this.world.id}get node(){return{id:this.world.id,label:this.label,secondaryLabel:this.reason?"Unavailable":"Read-only",role:"boundary",kind:this.world.kind,parentId:null,childIds:[]}}hierarchy={roots:()=>[this.node],node:e=>e===this.world.id?this.node:null};selection={get:()=>[...this.store.selectedEntityIds],set:e=>this.store.selectMultiple(e)};inspector={properties:e=>{if(e!==this.world.id)return[];const r=[{path:"kind",label:"Kind",type:"string",readonly:!0}];return this.world.adapter!==void 0&&r.push({path:"adapter",label:"Adapter",type:"string",readonly:!0}),this.world.entryOrScenePath!==void 0&&r.push({path:"path",label:"Entry / Scene",type:"string",readonly:!0}),r.push({path:"zOrder",label:"Z Order",type:"number",readonly:!0},{path:"pausable",label:"Pausable",type:"boolean",readonly:!0}),this.reason&&r.push({path:"reason",label:"Reason",type:"string",readonly:!0}),r},get:(e,r)=>{if(e===this.world.id)switch(r){case"kind":return this.world.kind;case"adapter":return this.world.adapter;case"path":return this.world.entryOrScenePath;case"zOrder":return this.world.zOrder;case"pausable":return this.world.pausable;case"reason":return this.reason??void 0;default:return}},set:(e,r,n)=>{}}}const u=new WeakMap,V=new Set;function R(){for(const t of V)t()}function J(t){const e=(u.get(t)?.generation??0)+1;return u.set(t,{generation:e,settled:!1}),R(),()=>{const r=u.get(t);!r||r.generation!==e||r.settled||(u.set(t,{generation:e,settled:!0}),R())}}const L="(invalid manifest)";let v=!1,b=!1,w=!1,l=null;function h(){if(b||w||!v||!l)return;b=!0;const t=l;queueMicrotask(()=>{if(b=!1,l!==t){h();return}v=!1,w=!0,Promise.resolve().then(t).catch(e=>{p.error(`Edit-mode rebuild failed: ${e instanceof Error?e.message:String(e)}`,"authoring")}).finally(()=>{w=!1,h()})})}function re(t){return l=t,h(),()=>{l===t&&(l=null)}}function ne(){v=!0,h()}const Z=new Set(["three","canvas","dom"]);function d(t){return typeof t=="string"?t:void 0}function K(t){const e=t.world;if(!e||typeof e!="object")return;const r=d(e.entry);if(r)return{entry:r,export:d(e.export)}}function U(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="object"){const e=t;if(typeof e.module=="string")return`module:${e.module}`;const r=e.ingest;if(r&&typeof r=="object")return"ingest"}}}function Q(t){if(!t||typeof t!="object")return null;const e=t.roots;return e===void 0||!Array.isArray(e)?null:{roots:e.map((n,s)=>{const i=n&&typeof n=="object"?n:{},a=i.zOrder,o=i.pausable;return{id:d(i.id)??`(world ${s})`,surface:(typeof i.adapter=="string"?d(i.adapter):void 0)??d(i.adapter&&typeof i.adapter=="object"?i.adapter.surface:void 0)??"(missing adapter surface)",adapter:U(i.adapter),scene:d(i.scene),entry:d(i.entry),zOrder:typeof a=="number"?a:void 0,pausable:typeof o=="boolean"?o:void 0,dev:i.dev===!0,world:K(i)}})}}function X(t){return Z.has(t.surface)?!t.scene&&!t.entry?`World "${t.id}" declares neither \`scene\` nor \`entry\` — nothing to mount.`:null:`Unknown world surface "${t.surface}" — expected one of: three, canvas, react.`}function c(t,e){const r=t.roots;if(Array.isArray(r))return r.find(n=>!!n&&typeof n=="object"&&n.id===e)}function E(t,e){return c(t,e)}class Y{raw;synthesizedValue;store;fileHistory;unsubscribeHistory;constructor(e,r,n){this.raw=e,this.synthesizedValue=r,this.store=n;const s=n.projectHistory;this.fileHistory=s?_(s,g(),"project-manifest"):null,this.unsubscribeHistory=this.fileHistory?this.fileHistory.subscribeAll(i=>{i==="volter.project.json"&&g().readBytes(i).then(a=>JSON.parse(new TextDecoder().decode(a))).then(a=>{for(const o of Object.keys(this.raw))delete this.raw[o];Object.assign(this.raw,a),this.store.notifyIngestEdit()}).catch(()=>{})}):null}getGameName(){const e=this.raw.name;return typeof e=="string"?e:""}get synthesized(){return this.synthesizedValue}setGameName(e){this.raw.name=e,this.persist("Rename Game")}getRootContentSource(e){const r=c(this.raw,e);if(!r)return;const n=r.scene;if(typeof n=="string")return`Scene · ${n}`;const s=r.entry;return typeof s=="string"?`Entry · ${s}`:"Adapter-owned runtime content"}getRootZOrder(e){const r=c(this.raw,e)?.zOrder;return typeof r=="number"?r:0}setRootZOrder(e,r){const n=E(this.raw,e);n&&(n.zOrder=r,this.persist("Change World Order"))}getRootPausable(e){const r=c(this.raw,e)?.pausable;return typeof r=="boolean"?r:!0}setRootPausable(e,r){const n=E(this.raw,e);n&&(n.pausable=r,this.persist("Change World Pausing"))}async materialize(){const e=await this.write("Create Game Manifest");return e&&(this.synthesizedValue=!1),e}dispose(){this.unsubscribeHistory?.()}persist(e){this.synthesized||this.write(e)}async write(e){const r=JSON.stringify(this.raw,null,2);try{if(this.fileHistory)return await this.fileHistory.write("volter.project.json",r,{label:e,kind:"manifest",contentType:"application/json"}),this.store.notifyIngestEdit(),!0;const n=async()=>{const s=await fetch("/__editor/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:"volter.project.json",content:r,...F()})});$(s,"Write volter.project.json failed"),s.ok||await B(s,{label:"Write volter.project.json",attempted:{"volter.project.json":r},reapply:n})};return await n(),this.store.notifyIngestEdit(),!0}catch(n){return this.fileHistory&&g().readBytes("volter.project.json").then(s=>JSON.parse(new TextDecoder().decode(s))).then(s=>{for(const i of Object.keys(this.raw))delete this.raw[i];Object.assign(this.raw,s),this.store.notifyIngestEdit()}).catch(()=>{}),p.error(`Failed to write volter.project.json: ${n}`,"project"),!1}}}let m=null;function ee(t,e,r){const n=I(e).map(o=>{const y=o.zOrder??0,j=P(o.surface);if(j)return{worldId:o.id,kind:o.surface,adapter:j(t,o.id),zOrder:y};const S=X(o),z={id:o.id,kind:o.surface,adapter:o.adapter,entryOrScenePath:o.scene??o.entry,zOrder:y,pausable:o.pausable??!0};return{worldId:o.id,kind:o.surface,adapter:new q(t,z,S??void 0),zOrder:y}}),s=r&&n.length>=1?new Y(r.raw,r.synthesized,t):void 0;m=s??null;const i=N(W()?.config),a=new H(n,s,i);if(n.length>=1){if(A()&&!x())return p.warn("Edit-mode authoring not installed: a foreign session (ingest/play) owns the authoring override.","authoring"),a;C(a),f(a),t.notifyIngestEdit()}else if(!A()){const o=D(t,"No world yet","Declare a root in volter.project.json");M(o),f(o),t.notifyIngestEdit()}return a}function se(t){t&&O()===t&&f(null);const e=T();e&&O()===e&&f(null),M(null),m?.dispose(),m=null}async function ie(t){const e=J(t);let r,n;try{const s=await k(),i=s!==null&&Q(s);if(i)r=i,n={raw:s,synthesized:!1};else throw new Error("manifest has no `roots` array (zero roots is fine; a missing field is not)")}catch(s){const i=s instanceof Error?s.message:String(s);p.error(`Failed to load volter.project.json: ${i}`,"project"),r={roots:[{id:"manifest",surface:L,adapter:i}]}}try{return ee(t,r,n)}finally{e()}}export{q as B,L as I,re as b,se as e,ie as i,Q as p,ne as q};
@@ -1 +1 @@
1
- import{ey as n,aC as i,ez as s}from"./index-Cjv2Ynte.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";function c(){const t=(i()?.config.configurations??[]).find(o=>o.kind==="process"&&typeof o.port=="number");return t?{endpoint:`ws://${globalThis.location?.hostname||"localhost"}:${t.port}`}:null}const a=[],p={entities:0,msgsInPerSec:0,msgsOutPerSec:0};function l(t){return{peers:()=>a,networkId:()=>null,authority:()=>"local",editable:()=>!0,getConnectionState:()=>"disconnected",getRoomInfo:()=>null,getReplicationStats:()=>p,subscribe:()=>()=>{},getServerConfig:()=>t}}function r(){const t=c();return t?(n(l(t)),()=>n(null)):()=>{}}const k="workspace.service";function w(){let t=r();const e=s(()=>{t(),t=r()});return()=>{e(),t()}}export{k as point,w as start};
1
+ import{ey as n,aC as i,ez as s}from"./index-ClgrFOcX.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";function c(){const t=(i()?.config.configurations??[]).find(o=>o.kind==="process"&&typeof o.port=="number");return t?{endpoint:`ws://${globalThis.location?.hostname||"localhost"}:${t.port}`}:null}const a=[],p={entities:0,msgsInPerSec:0,msgsOutPerSec:0};function l(t){return{peers:()=>a,networkId:()=>null,authority:()=>"local",editable:()=>!0,getConnectionState:()=>"disconnected",getRoomInfo:()=>null,getReplicationStats:()=>p,subscribe:()=>()=>{},getServerConfig:()=>t}}function r(){const t=c();return t?(n(l(t)),()=>n(null)):()=>{}}const k="workspace.service";function w(){let t=r();const e=s(()=>{t(),t=r()});return()=>{e(),t()}}export{k as point,w as start};
@@ -1 +1 @@
1
- import{$ as e,a3 as r,c7 as i,c8 as a,c9 as p,ca as c}from"./index-Cjv2Ynte.js";import{cb as Ot,cc as Ht,cd as Ut,ce as qt,cf as Bt,cg as Jt,ch as Mt,b2 as Vt,ci as zt,cj as Kt,ck as Nt,cl as Qt,cm as Xt,a$ as Yt,cn as Zt,co as _t,cp as te,cq as ee,cr as re,cs as oe,ct as se,cu as ie,cv as ae,cw as pe,cx as ce,cy as me,cz as ne,cA as le,cB as de,cC as ge,cD as ue,cE as Ee,cF as ye,cG as Se,cH as Pe,cI as je,cJ as be,cK as ve,cL as fe,cM as he,cN as Ae,cO as ke,cP as we,cQ as Ce,cR as Re,cS as xe,cT as Fe,cU as Te,cV as Le,cW as De,cX as Ge,b0 as $e,cY as We,cZ as Ie,c_ as Oe,c$ as He,d0 as Ue,d1 as qe,d2 as Be}from"./index-Cjv2Ynte.js";import{o as Me,q as Ve,t as ze}from"./game-network-Bof-cN2R.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-BUPFKtBc.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-CcTdmLf3.js";import"./contract-system-adapters-D8SzcuZo.js";import"./game-contract-seams-CzlxJGC2.js";import"./seeded-random-BVi4_fs4.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-DzuOGwVB.js";import"./live-project-verbs-D_8wWaCB.js";import"./capability-coverage-BMuTFU_9.js";import"./edit-mode-authoring-CIXoejcH.js";import"./json-history-resource-C1pGwXuI.js";import"./binding-resolver-4nTdtOpk.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CbgTofeT.js";import"./canvas-entry-runtime-CgJkCzp_.js";import"./three-ingest-runtime-BPTa3ryG.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-CmyN258P.js";import"./ingest-source-persistence-BNek6mSi.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-Co7zteuS.js";import"./mounted-authoring-DQ0-LgR6.js";import"./entity-object-C6hm5vYx.js";import"./user-data-DxeJHxTz.js";import"./workspace-arrangement-Bq8u7HUK.js";import"./three-contract-Dkt6PmWY.js";import"./three-CAVY58Dv.js";import"./editor-layers-CYVQVJ5O.js";import"./component-instance-root-Ctbx3vOO.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BDMrB8fC.js";import"./source-persistence-backend-BMbXR_WB.js";import"./three-projection-core-BnoDtdZY.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-BRcBDERW.js";import"./deferred-ingest-play-DsV_qXEP.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CTCp7U6C.js";import"./board-guides-Cnfvv0uu.js";import"./relative-import-specifier-CPSPKQKY.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-xUKvX80V.js";import"./inference-diagnostics-DE1P5w14.js";import"./writer-tw6EcuVO.js";import"./three-state-_BZo8PPs.js";import"./editor-shell-store-B76wIXvV.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-CTspfOX-.js";import"./game-surface-defaults-D8S4cRxi.js";async function Dt(){try{const t=await fetch(`${e}/examples`);return(await r(t,`GET ${e}/examples failed`)).examples}catch{return[]}}function Gt(t){return t.startsWith("/")?t:`${e}/learn-thumbnail?file=${encodeURIComponent(t)}`}async function $t(){const t=await fetch(`${e}/templates`);return(await r(t,`GET ${e}/templates failed`)).templates}export{Ot as AssetDeliveryError,c as abortGameplayRecordingSink,Ht as adaptProjectFolder,Ut as appendGameplayRecordingAsset,a as appendGameplayRecordingChunk,qt as appendGameplayRecordingDomEvents,Bt as archiveEditorWorktree,Jt as assetDeliveryIssueMessage,i as beginGameplayRecordingSink,Mt as browseFolder,Vt as captureProjectAssetHistory,zt as connectEvents,Kt as connectTabPresence,Nt as createEditorWorktree,Qt as createProject,Xt as delegateEditorTask,Yt as downloadOnlineAsset,Me as endLogSession,p as finishGameplayRecordingSink,Ve as flushLogEntries,Zt as getAssetLibraryCategories,_t as getCurrentServerProject,te as getDownloadUrl,ee as getDownloadedAssetPath,re as getEditorCompatibility,oe as getEditorRepositoryPresence,se as getEditorSessionWorktreeIdentity,ie as getLauncherSettings,ae as getOnlineAssetFiles,pe as getOnlineAssetPreview,ce as getServerValidationLog,me as inspectProjectFolder,Gt as learnThumbnailUrl,ne as listAssets,le as listDelegateHarnesses,de as listEditorWorktrees,Dt as listExamples,ge as listProjectComponents,ue as listProjectSourceFiles,Ee as listRecentProjects,$t as listTemplates,ye as loadDownloadedAssets,Se as loadEditorState,Pe as onAssetDownloaded,je as openEditorWorktree,be as openProjectOnServer,ve as pollEditorLeaseIdentity,fe as probeCurrentServerProject,he as probeProjectFile,Ae as projectFileExists,ke as readProjectSourceText,we as readProjectTextFile,Ce as removeRecentProject,Re as reportCommandListener,xe as reportCommandReceived,Fe as reportCommandResult,Te as reportEditorState,Le as reportPlayBootPhase,De as reportTabRoute,Ge as requireEditorCompatibility,$e as restoreProjectAssetHistory,We as revealInFinder,Ie as saveEditorState,Oe as saveFile,He as saveThumbnail,Ue as searchOnlineAssets,ze as startLogSession,qe as stopEditorWorktreeSession,Be as updateLauncherSettings};
1
+ import{$ as e,a3 as r,c7 as i,c8 as a,c9 as p,ca as c}from"./index-ClgrFOcX.js";import{cb as Ot,cc as Ht,cd as Ut,ce as qt,cf as Bt,cg as Jt,ch as Mt,b2 as Vt,ci as zt,cj as Kt,ck as Nt,cl as Qt,cm as Xt,a$ as Yt,cn as Zt,co as _t,cp as te,cq as ee,cr as re,cs as oe,ct as se,cu as ie,cv as ae,cw as pe,cx as ce,cy as me,cz as ne,cA as le,cB as de,cC as ge,cD as ue,cE as Ee,cF as ye,cG as Se,cH as Pe,cI as je,cJ as be,cK as ve,cL as fe,cM as he,cN as Ae,cO as ke,cP as we,cQ as Ce,cR as Re,cS as xe,cT as Fe,cU as Te,cV as Le,cW as De,cX as Ge,b0 as $e,cY as We,cZ as Ie,c_ as Oe,c$ as He,d0 as Ue,d1 as qe,d2 as Be}from"./index-ClgrFOcX.js";import{o as Me,q as Ve,t as ze}from"./game-network-Deo8lcPw.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-iX2-V5kg.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B2THKz1v.js";import"./contract-system-adapters-BDUpDoKd.js";import"./game-contract-seams-C22a4B79.js";import"./seeded-random-B6zqGkWP.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-DzuOGwVB.js";import"./live-project-verbs-Bqmxbr2o.js";import"./capability-coverage-EnZ99FoT.js";import"./edit-mode-authoring-BDgZD47j.js";import"./json-history-resource-CDEoQe1R.js";import"./binding-resolver-DoOAFM2m.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CqjVBanw.js";import"./canvas-entry-runtime-CLOuJcgT.js";import"./three-ingest-runtime-x9nLmUl-.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-CJ2U5L1O.js";import"./ingest-source-persistence-CVU1rTj0.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CKqhX3mt.js";import"./mounted-authoring-B697dYuN.js";import"./entity-object-BLJ-I8XT.js";import"./user-data-DL6HsBPf.js";import"./workspace-arrangement-86_8Kk5K.js";import"./three-contract-Dkt6PmWY.js";import"./three-DWy0sZom.js";import"./editor-layers-DwaX5UFy.js";import"./component-instance-root-wO1p-rLr.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-9LcUBPaU.js";import"./source-persistence-backend-Cwy93SmQ.js";import"./three-projection-core-IUovHgg_.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-DuG97FR9.js";import"./deferred-ingest-play-To3ZratW.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-Dq8NqvWu.js";import"./board-guides-CCiyx8cT.js";import"./relative-import-specifier-CA9mSNXO.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BunjdqX7.js";import"./inference-diagnostics-BmZ5ggEK.js";import"./writer-tw6EcuVO.js";import"./three-state-_ImCbP87.js";import"./editor-shell-store-aKHbAoCV.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-BV_lf5uK.js";import"./game-surface-defaults-D8S4cRxi.js";async function Dt(){try{const t=await fetch(`${e}/examples`);return(await r(t,`GET ${e}/examples failed`)).examples}catch{return[]}}function Gt(t){return t.startsWith("/")?t:`${e}/learn-thumbnail?file=${encodeURIComponent(t)}`}async function $t(){const t=await fetch(`${e}/templates`);return(await r(t,`GET ${e}/templates failed`)).templates}export{Ot as AssetDeliveryError,c as abortGameplayRecordingSink,Ht as adaptProjectFolder,Ut as appendGameplayRecordingAsset,a as appendGameplayRecordingChunk,qt as appendGameplayRecordingDomEvents,Bt as archiveEditorWorktree,Jt as assetDeliveryIssueMessage,i as beginGameplayRecordingSink,Mt as browseFolder,Vt as captureProjectAssetHistory,zt as connectEvents,Kt as connectTabPresence,Nt as createEditorWorktree,Qt as createProject,Xt as delegateEditorTask,Yt as downloadOnlineAsset,Me as endLogSession,p as finishGameplayRecordingSink,Ve as flushLogEntries,Zt as getAssetLibraryCategories,_t as getCurrentServerProject,te as getDownloadUrl,ee as getDownloadedAssetPath,re as getEditorCompatibility,oe as getEditorRepositoryPresence,se as getEditorSessionWorktreeIdentity,ie as getLauncherSettings,ae as getOnlineAssetFiles,pe as getOnlineAssetPreview,ce as getServerValidationLog,me as inspectProjectFolder,Gt as learnThumbnailUrl,ne as listAssets,le as listDelegateHarnesses,de as listEditorWorktrees,Dt as listExamples,ge as listProjectComponents,ue as listProjectSourceFiles,Ee as listRecentProjects,$t as listTemplates,ye as loadDownloadedAssets,Se as loadEditorState,Pe as onAssetDownloaded,je as openEditorWorktree,be as openProjectOnServer,ve as pollEditorLeaseIdentity,fe as probeCurrentServerProject,he as probeProjectFile,Ae as projectFileExists,ke as readProjectSourceText,we as readProjectTextFile,Ce as removeRecentProject,Re as reportCommandListener,xe as reportCommandReceived,Fe as reportCommandResult,Te as reportEditorState,Le as reportPlayBootPhase,De as reportTabRoute,Ge as requireEditorCompatibility,$e as restoreProjectAssetHistory,We as revealInFinder,Ie as saveEditorState,Oe as saveFile,He as saveThumbnail,Ue as searchOnlineAssets,ze as startLogSession,qe as stopEditorWorktreeSession,Be as updateLauncherSettings};
@@ -1 +1 @@
1
- import{g as e}from"./workspace-arrangement-Bq8u7HUK.js";import"./index-Cjv2Ynte.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";const i=31,d=30;function n(r){return(r.layers.mask&1<<i)!==0||!!e(r,"editorHelper")||!!e(r,"engineInternal")}function f(r){let t=r;for(;t;){if(n(t))return!0;t=t.parent}return!1}export{i as EDITOR_LAYER,d as EDITOR_SELECTION_LAYER,n as isEditorOwnedObject,f as isInEditorOwnedSubtree};
1
+ import{g as e}from"./workspace-arrangement-86_8Kk5K.js";import"./index-ClgrFOcX.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";const i=31,d=30;function n(r){return(r.layers.mask&1<<i)!==0||!!e(r,"editorHelper")||!!e(r,"engineInternal")}function f(r){let t=r;for(;t;){if(n(t))return!0;t=t.parent}return!1}export{i as EDITOR_LAYER,d as EDITOR_SELECTION_LAYER,n as isEditorOwnedObject,f as isInEditorOwnedSubtree};
@@ -1 +1 @@
1
- import{v as x}from"./output-pass-HurwNl0G.js";import{isEditorOwnedObject as L}from"./editor-layers-CYVQVJ5O.js";import{g as y,s as E}from"./user-data-DxeJHxTz.js";import{i as P,e as F}from"./entity-object-C6hm5vYx.js";import"./index-Cjv2Ynte.js";import{fo as R,fx as C,bi as V,d9 as k}from"./three.core-3arARmh6.js";function O(r,e=P){if(r.isLOD)return r;const s=[...r.children];for(;s.length>0;){const t=s.pop();if(!e(t)){if(t.isLOD)return t;s.push(...t.children)}}return null}const H=1e20,N=2e20;function D(r,e){const s=r.fog;if(!s){e();return}const t=s.isFog?s:null,i=s.isFogExp2?s:null,o=t?.near,a=t?.far,n=i?.density;t&&(t.near=H,t.far=N),i&&(i.density=0);try{e()}finally{t&&o!==void 0&&a!==void 0&&(t.near=o,t.far=a),i&&n!==void 0&&(i.density=n)}}const U=256;class d{constructor(e){this.shell=e}_scene=null;_adoptionStack=[];_objectMap=new Map;_renderer=null;_camera=null;_batchedRenderer=null;_lastThumbnailTime=0;_lastEditorStateSaveTime=0;_orbitTarget=null;_gizmoEpoch=0;_objectMapParentChangedAt=new Map;_objectMapFullChangeEpoch=0;_objectMapMembershipChangedAt=new Map;_objectMapMembershipFullChangeEpoch=0;_objectMapMembershipHistoryFloor=0;_showStats=!1;_shadingMode="solid";_statePersistence=null;_vertexSnapActive=!1;_composerVersion=0;bindScene(e,s,t,i){const o=this._adoptionStack[0];o?o.scene=e:this._scene=e,this._renderer=s??null,this._batchedRenderer=t??null,i&&(this._camera=i)}setOrbitTarget(e){this._orbitTarget=e}setViewportCamera(e){this._camera=e}attachStatePersistence(e){if(this._statePersistence!==e){if(this._statePersistence)throw new Error("EditorStore is already attached to a state persistence.");this._statePersistence=e}}get sceneCameraLookup(){return this._sceneCameraLookup}_sceneCameraLookup=null;focusOnScene(e){this._sceneCameraLookup=e??null,this.shell.focusOnScene()}get cameraPose(){if(!this._camera)return null;const e=this._camera.fov;return{position:this._camera.position.clone(),target:this._orbitTarget?this._orbitTarget.clone():new R,fov:typeof e=="number"?e:0}}get objectMap(){return this._objectMap}get scene(){return this._scene}get composerVersion(){return this._composerVersion}get gizmoEpoch(){return this._gizmoEpoch}ingestObjectMapChangesSince(e){if(e<0||e>this._gizmoEpoch||e<this._objectMapFullChangeEpoch)return null;const s=new Set;for(const[t,i]of this._objectMapParentChangedAt)i>e&&s.add(t);return{epoch:this._gizmoEpoch,changedParentIds:s}}ingestObjectMapMembershipChangesSince(e){if(e<0||e>this._gizmoEpoch||e<this._objectMapMembershipFullChangeEpoch||e<this._objectMapMembershipHistoryFloor)return null;const s=new Set;for(const[t,i]of this._objectMapMembershipChangedAt)i>e&&s.add(t);return{epoch:this._gizmoEpoch,changedIds:s}}isSkeletonVisible(e){return!!y(this._objectMap.get(e),"skeletonVisible")}setSkeletonVisible(e,s){const t=this._objectMap.get(e);t&&(E(t,"skeletonVisible",s),t.traverse(i=>{y(i,"editorHelperType")==="skeletons"&&(E(i,"skeletonEnabled",s),i.visible=s||this.shell.helperVisibility.skeletons)}),this.shell.notifyChange())}get showStats(){return this._showStats}get shadingMode(){return this._shadingMode}notifyIngestObjectMapEdit(e){if(this._gizmoEpoch++,e===void 0||e.rootsChanged)this._objectMapFullChangeEpoch=this._gizmoEpoch,this._objectMapParentChangedAt.clear();else for(const t of e.changedParentIds)this._objectMapParentChangedAt.set(t,this._gizmoEpoch);if(e?.addedIds===void 0||e.removedIds===void 0)this._objectMapMembershipFullChangeEpoch=this._gizmoEpoch,this._objectMapMembershipChangedAt.clear();else{for(const i of e.addedIds)this._objectMapMembershipChangedAt.set(i,this._gizmoEpoch);for(const i of e.removedIds)this._objectMapMembershipChangedAt.set(i,this._gizmoEpoch);const t=Math.max(0,this._gizmoEpoch-U);if(t>this._objectMapMembershipHistoryFloor){this._objectMapMembershipHistoryFloor=t;for(const[i,o]of this._objectMapMembershipChangedAt)o<=t&&this._objectMapMembershipChangedAt.delete(i)}}const s=e===void 0||e.rootsChanged||[...e.addedIds??[],...e.removedIds??[]].some(t=>this.shell.selectedEntityIds.has(t));this.shell.notifyChange("content",s?"shell":"object-map",!1)}_ecsSyncTransform=null;setEcsSyncTransform(e){this._ecsSyncTransform=e}enterPlayScene(e,s,t){this._adoptionStack.push({scene:this._scene,objectMap:this._objectMap,extras:this._captureAdoptionExtras(),selection:new Set(this.shell.selectedEntityIds),imageConfig:this._adoptedImageConfig}),this._scene=e,this._applyAdoptedImageConfig(s);const i=t?new Map(t):(()=>{const o=new Map,a=n=>{if(L(n))return;const l=F(n);l!==void 0&&o.set(l,n);for(const p of n.children)a(p)};for(const n of e.children)a(n);return o})();this._objectMap=i,this.shell.applySelectionBeforePresentation([...this.shell.selectedEntityIds].filter(o=>i.has(o))),this._lodForcedLevels.clear(),this._composerVersion++,this.shell.notifyChange()}get hasAdoptedScene(){return this._adoptionStack.length>0}exitPlayScene(){const e=this._adoptionStack.pop();e&&(this._scene=e.scene,this._objectMap=e.objectMap,this._applyAdoptedImageConfig(e.imageConfig),this._restoreAdoptionExtras(e.extras),this.shell.applySelectionBeforePresentation([...e.selection]),this._composerVersion++,this.shell.notifyChange())}releaseAdoptedScene(e){if(this._scene===e){this.exitPlayScene();return}const s=this._adoptionStack.findIndex(t=>t.scene===e);s!==-1&&this._adoptionStack.splice(s,1)}_adoptedImageConfig;get adoptedImageConfig(){return this._adoptedImageConfig}_applyAdoptedImageConfig(e){e!==this._adoptedImageConfig&&(this._adoptedImageConfig=e,this._composerVersion++)}get isAdoptedSceneActive(){return this._adoptionStack.length>0}get vertexSnapActive(){return this._vertexSnapActive}setVertexSnapActive(e){this._vertexSnapActive=e,this.shell.notifyChange()}static THUMBNAIL_INTERVAL_MS=6e4;static THUMBNAIL_SIZE=256;_renderViewportImage(e,s){if(!this._renderer||!this._scene||!this._camera)return null;const t=typeof e=="number"?e:e.width,i=typeof e=="number"?e:e.height;if(!Number.isFinite(t)||t<1||!Number.isFinite(i)||i<1)return null;const o=t*2,a=i*2,n=this._renderer,l=new C(o,a,{type:V}),p=new C(o,a),T=n.getRenderTarget(),w=n.getPixelRatio(),h=this._camera,I=h.layers.mask,c=h instanceof k?h:null,u=c?.aspect;s?h.layers.enableAll():(h.layers.disableAll(),h.layers.enable(0));try{c&&(c.aspect=t/i,c.updateProjectionMatrix()),n.setPixelRatio(1),n.setRenderTarget(l),D(this._scene,()=>n.render(this._scene,h)),x().render(n,p,l,0,!1)}finally{n.setRenderTarget(T),n.setPixelRatio(w),h.layers.mask=I,c&&u!==void 0&&(c.aspect=u,c.updateProjectionMatrix())}const _=o*4,b=new Uint8Array(_*a);n.readRenderTargetPixels(p,0,0,o,a,b),p.dispose(),l.dispose();const g=document.createElement("canvas");g.width=o,g.height=a;const M=g.getContext("2d"),S=M.createImageData(o,a);for(let m=0;m<a;m++){const v=(a-1-m)*_,j=m*_;S.data.set(b.subarray(v,v+_),j)}M.putImageData(S,0,0);const f=document.createElement("canvas");return f.width=t,f.height=i,f.getContext("2d").drawImage(g,0,0,t,i),f.toDataURL("image/png")}_captureThumbnail(){const e=Date.now();if(e-this._lastThumbnailTime<d.THUMBNAIL_INTERVAL_MS)return;this._lastThumbnailTime=e;const s=this._renderViewportImage(d.THUMBNAIL_SIZE,!1);s&&this._statePersistence?.saveThumbnail?.(s)}captureViewportImage(e=d.THUMBNAIL_SIZE){return this._renderViewportImage(e,!0)}viewportCanvas(){return this._renderer?.domElement??null}static EDITOR_STATE_INTERVAL_MS=6e4;_saveEditorStateIfDue(){if(!this._statePersistence)return;const e=Date.now();if(e-this._lastEditorStateSaveTime<d.EDITOR_STATE_INTERVAL_MS)return;this._lastEditorStateSaveTime=e;const s={transformMode:this.shell.transformMode,transformSpace:this.shell.transformSpace,snapEnabled:this.shell.snapEnabled,snapValues:this.shell.snapValues,preserveChildrenTransform:this.shell.preserveChildrenTransform,pivotMode:this.shell.pivotMode,gizmoAnchor:this.shell.gizmoAnchor,showHelpers:this.shell.showHelpers,helperVisibility:{...this.shell.helperVisibility},showStats:this._showStats,shadingMode:this._shadingMode};if(Object.assign(s,this._editorStateExtras()),this._camera){const t=this._camera;s.camera={position:t.position.toArray(),target:this._orbitTarget?this._orbitTarget.toArray():[0,0,0]}}this._statePersistence.save(s)}_lodForcedLevels=new Map;get lodForcedLevels(){return this._lodForcedLevels}getLodForcedLevel(e){return this._lodForcedLevels.get(e)??null}setLodForcedLevel(e,s){if(s===null){this._lodForcedLevels.delete(e);const t=this._objectMap.get(e),i=new Set(this._objectMap.values()),o=t?O(t,a=>i.has(a)):null;o&&(o.autoUpdate=!0)}else this._lodForcedLevels.set(e,s);this.shell.notifyChange()}toggleStats(){this._showStats=!this._showStats,this.shell.notifyChange()}setShadingMode(e){this._shadingMode=e,this.shell.notifyChange()}_captureAdoptionExtras(){}_restoreAdoptionExtras(e){}_editorStateExtras(){return{}}}const A=new WeakMap;function q(r){let e=A.get(r);return e||(e=new d(r),A.set(r,e)),e}export{O as f,q as t,D as w};
1
+ import{v as x}from"./output-pass-HurwNl0G.js";import{isEditorOwnedObject as L}from"./editor-layers-DwaX5UFy.js";import{g as y,s as E}from"./user-data-DL6HsBPf.js";import{i as P,e as F}from"./entity-object-BLJ-I8XT.js";import"./index-ClgrFOcX.js";import{fo as R,fx as C,bi as V,d9 as k}from"./three.core-3arARmh6.js";function O(r,e=P){if(r.isLOD)return r;const s=[...r.children];for(;s.length>0;){const t=s.pop();if(!e(t)){if(t.isLOD)return t;s.push(...t.children)}}return null}const H=1e20,N=2e20;function D(r,e){const s=r.fog;if(!s){e();return}const t=s.isFog?s:null,i=s.isFogExp2?s:null,o=t?.near,a=t?.far,n=i?.density;t&&(t.near=H,t.far=N),i&&(i.density=0);try{e()}finally{t&&o!==void 0&&a!==void 0&&(t.near=o,t.far=a),i&&n!==void 0&&(i.density=n)}}const U=256;class d{constructor(e){this.shell=e}_scene=null;_adoptionStack=[];_objectMap=new Map;_renderer=null;_camera=null;_batchedRenderer=null;_lastThumbnailTime=0;_lastEditorStateSaveTime=0;_orbitTarget=null;_gizmoEpoch=0;_objectMapParentChangedAt=new Map;_objectMapFullChangeEpoch=0;_objectMapMembershipChangedAt=new Map;_objectMapMembershipFullChangeEpoch=0;_objectMapMembershipHistoryFloor=0;_showStats=!1;_shadingMode="solid";_statePersistence=null;_vertexSnapActive=!1;_composerVersion=0;bindScene(e,s,t,i){const o=this._adoptionStack[0];o?o.scene=e:this._scene=e,this._renderer=s??null,this._batchedRenderer=t??null,i&&(this._camera=i)}setOrbitTarget(e){this._orbitTarget=e}setViewportCamera(e){this._camera=e}attachStatePersistence(e){if(this._statePersistence!==e){if(this._statePersistence)throw new Error("EditorStore is already attached to a state persistence.");this._statePersistence=e}}get sceneCameraLookup(){return this._sceneCameraLookup}_sceneCameraLookup=null;focusOnScene(e){this._sceneCameraLookup=e??null,this.shell.focusOnScene()}get cameraPose(){if(!this._camera)return null;const e=this._camera.fov;return{position:this._camera.position.clone(),target:this._orbitTarget?this._orbitTarget.clone():new R,fov:typeof e=="number"?e:0}}get objectMap(){return this._objectMap}get scene(){return this._scene}get composerVersion(){return this._composerVersion}get gizmoEpoch(){return this._gizmoEpoch}ingestObjectMapChangesSince(e){if(e<0||e>this._gizmoEpoch||e<this._objectMapFullChangeEpoch)return null;const s=new Set;for(const[t,i]of this._objectMapParentChangedAt)i>e&&s.add(t);return{epoch:this._gizmoEpoch,changedParentIds:s}}ingestObjectMapMembershipChangesSince(e){if(e<0||e>this._gizmoEpoch||e<this._objectMapMembershipFullChangeEpoch||e<this._objectMapMembershipHistoryFloor)return null;const s=new Set;for(const[t,i]of this._objectMapMembershipChangedAt)i>e&&s.add(t);return{epoch:this._gizmoEpoch,changedIds:s}}isSkeletonVisible(e){return!!y(this._objectMap.get(e),"skeletonVisible")}setSkeletonVisible(e,s){const t=this._objectMap.get(e);t&&(E(t,"skeletonVisible",s),t.traverse(i=>{y(i,"editorHelperType")==="skeletons"&&(E(i,"skeletonEnabled",s),i.visible=s||this.shell.helperVisibility.skeletons)}),this.shell.notifyChange())}get showStats(){return this._showStats}get shadingMode(){return this._shadingMode}notifyIngestObjectMapEdit(e){if(this._gizmoEpoch++,e===void 0||e.rootsChanged)this._objectMapFullChangeEpoch=this._gizmoEpoch,this._objectMapParentChangedAt.clear();else for(const t of e.changedParentIds)this._objectMapParentChangedAt.set(t,this._gizmoEpoch);if(e?.addedIds===void 0||e.removedIds===void 0)this._objectMapMembershipFullChangeEpoch=this._gizmoEpoch,this._objectMapMembershipChangedAt.clear();else{for(const i of e.addedIds)this._objectMapMembershipChangedAt.set(i,this._gizmoEpoch);for(const i of e.removedIds)this._objectMapMembershipChangedAt.set(i,this._gizmoEpoch);const t=Math.max(0,this._gizmoEpoch-U);if(t>this._objectMapMembershipHistoryFloor){this._objectMapMembershipHistoryFloor=t;for(const[i,o]of this._objectMapMembershipChangedAt)o<=t&&this._objectMapMembershipChangedAt.delete(i)}}const s=e===void 0||e.rootsChanged||[...e.addedIds??[],...e.removedIds??[]].some(t=>this.shell.selectedEntityIds.has(t));this.shell.notifyChange("content",s?"shell":"object-map",!1)}_ecsSyncTransform=null;setEcsSyncTransform(e){this._ecsSyncTransform=e}enterPlayScene(e,s,t){this._adoptionStack.push({scene:this._scene,objectMap:this._objectMap,extras:this._captureAdoptionExtras(),selection:new Set(this.shell.selectedEntityIds),imageConfig:this._adoptedImageConfig}),this._scene=e,this._applyAdoptedImageConfig(s);const i=t?new Map(t):(()=>{const o=new Map,a=n=>{if(L(n))return;const l=F(n);l!==void 0&&o.set(l,n);for(const p of n.children)a(p)};for(const n of e.children)a(n);return o})();this._objectMap=i,this.shell.applySelectionBeforePresentation([...this.shell.selectedEntityIds].filter(o=>i.has(o))),this._lodForcedLevels.clear(),this._composerVersion++,this.shell.notifyChange()}get hasAdoptedScene(){return this._adoptionStack.length>0}exitPlayScene(){const e=this._adoptionStack.pop();e&&(this._scene=e.scene,this._objectMap=e.objectMap,this._applyAdoptedImageConfig(e.imageConfig),this._restoreAdoptionExtras(e.extras),this.shell.applySelectionBeforePresentation([...e.selection]),this._composerVersion++,this.shell.notifyChange())}releaseAdoptedScene(e){if(this._scene===e){this.exitPlayScene();return}const s=this._adoptionStack.findIndex(t=>t.scene===e);s!==-1&&this._adoptionStack.splice(s,1)}_adoptedImageConfig;get adoptedImageConfig(){return this._adoptedImageConfig}_applyAdoptedImageConfig(e){e!==this._adoptedImageConfig&&(this._adoptedImageConfig=e,this._composerVersion++)}get isAdoptedSceneActive(){return this._adoptionStack.length>0}get vertexSnapActive(){return this._vertexSnapActive}setVertexSnapActive(e){this._vertexSnapActive=e,this.shell.notifyChange()}static THUMBNAIL_INTERVAL_MS=6e4;static THUMBNAIL_SIZE=256;_renderViewportImage(e,s){if(!this._renderer||!this._scene||!this._camera)return null;const t=typeof e=="number"?e:e.width,i=typeof e=="number"?e:e.height;if(!Number.isFinite(t)||t<1||!Number.isFinite(i)||i<1)return null;const o=t*2,a=i*2,n=this._renderer,l=new C(o,a,{type:V}),p=new C(o,a),T=n.getRenderTarget(),w=n.getPixelRatio(),h=this._camera,I=h.layers.mask,c=h instanceof k?h:null,u=c?.aspect;s?h.layers.enableAll():(h.layers.disableAll(),h.layers.enable(0));try{c&&(c.aspect=t/i,c.updateProjectionMatrix()),n.setPixelRatio(1),n.setRenderTarget(l),D(this._scene,()=>n.render(this._scene,h)),x().render(n,p,l,0,!1)}finally{n.setRenderTarget(T),n.setPixelRatio(w),h.layers.mask=I,c&&u!==void 0&&(c.aspect=u,c.updateProjectionMatrix())}const _=o*4,b=new Uint8Array(_*a);n.readRenderTargetPixels(p,0,0,o,a,b),p.dispose(),l.dispose();const g=document.createElement("canvas");g.width=o,g.height=a;const M=g.getContext("2d"),S=M.createImageData(o,a);for(let m=0;m<a;m++){const v=(a-1-m)*_,j=m*_;S.data.set(b.subarray(v,v+_),j)}M.putImageData(S,0,0);const f=document.createElement("canvas");return f.width=t,f.height=i,f.getContext("2d").drawImage(g,0,0,t,i),f.toDataURL("image/png")}_captureThumbnail(){const e=Date.now();if(e-this._lastThumbnailTime<d.THUMBNAIL_INTERVAL_MS)return;this._lastThumbnailTime=e;const s=this._renderViewportImage(d.THUMBNAIL_SIZE,!1);s&&this._statePersistence?.saveThumbnail?.(s)}captureViewportImage(e=d.THUMBNAIL_SIZE){return this._renderViewportImage(e,!0)}viewportCanvas(){return this._renderer?.domElement??null}static EDITOR_STATE_INTERVAL_MS=6e4;_saveEditorStateIfDue(){if(!this._statePersistence)return;const e=Date.now();if(e-this._lastEditorStateSaveTime<d.EDITOR_STATE_INTERVAL_MS)return;this._lastEditorStateSaveTime=e;const s={transformMode:this.shell.transformMode,transformSpace:this.shell.transformSpace,snapEnabled:this.shell.snapEnabled,snapValues:this.shell.snapValues,preserveChildrenTransform:this.shell.preserveChildrenTransform,pivotMode:this.shell.pivotMode,gizmoAnchor:this.shell.gizmoAnchor,showHelpers:this.shell.showHelpers,helperVisibility:{...this.shell.helperVisibility},showStats:this._showStats,shadingMode:this._shadingMode};if(Object.assign(s,this._editorStateExtras()),this._camera){const t=this._camera;s.camera={position:t.position.toArray(),target:this._orbitTarget?this._orbitTarget.toArray():[0,0,0]}}this._statePersistence.save(s)}_lodForcedLevels=new Map;get lodForcedLevels(){return this._lodForcedLevels}getLodForcedLevel(e){return this._lodForcedLevels.get(e)??null}setLodForcedLevel(e,s){if(s===null){this._lodForcedLevels.delete(e);const t=this._objectMap.get(e),i=new Set(this._objectMap.values()),o=t?O(t,a=>i.has(a)):null;o&&(o.autoUpdate=!0)}else this._lodForcedLevels.set(e,s);this.shell.notifyChange()}toggleStats(){this._showStats=!this._showStats,this.shell.notifyChange()}setShadingMode(e){this._shadingMode=e,this.shell.notifyChange()}_captureAdoptionExtras(){}_restoreAdoptionExtras(e){}_editorStateExtras(){return{}}}const A=new WeakMap;function q(r){let e=A.get(r);return e||(e=new d(r),A.set(r,e)),e}export{O as f,q as t,D as w};
@@ -1 +1 @@
1
- import{s as r,g as i}from"./user-data-DxeJHxTz.js";import{a as s}from"./three-contract-Dkt6PmWY.js";function f(e,t,n){return s(e.hierarchy,n)??t.get(n)??null}function a(e){const t=i(e,"entityId");return typeof t=="string"&&t?t:void 0}function o(e){return a(e)!==void 0}function y(e){let t=e??null;for(;t&&!o(t);)t=t.parent;return t}function d(e,t){r(e,"entityId",t)}export{f as a,a as e,o as i,y as n,d as s};
1
+ import{s as r,g as i}from"./user-data-DL6HsBPf.js";import{a as s}from"./three-contract-Dkt6PmWY.js";function f(e,t,n){return s(e.hierarchy,n)??t.get(n)??null}function a(e){const t=i(e,"entityId");return typeof t=="string"&&t?t:void 0}function o(e){return a(e)!==void 0}function y(e){let t=e??null;for(;t&&!o(t);)t=t.parent;return t}function d(e,t){r(e,"entityId",t)}export{f as a,a as e,o as i,y as n,d as s};
@@ -1,4 +1,4 @@
1
- import{a as Uu}from"./jsx-runtime-DPjLkJKQ.js";import{h as Vy,M as oy}from"./index-DzuOGwVB.js";import{c as pa,C as Hu,G as gy,A as by,e as cm,T as Ef}from"./index-DUA0RF9E.js";import{r as Wl}from"./index-nmcBqr7Y.js";import{g as Jy}from"./_commonjsHelpers-D6-XlEtG.js";import{r as xy}from"./index-D_NuPfjr.js";var mf={exports:{}},_t={};/**
1
+ import{a as Uu}from"./jsx-runtime-DPjLkJKQ.js";import{h as Vy,M as oy}from"./index-DzuOGwVB.js";import{c as pa,C as Hu,G as gy,A as by,e as cm,T as Ef}from"./index-CHOT9sYh.js";import{r as Wl}from"./index-nmcBqr7Y.js";import{g as Jy}from"./_commonjsHelpers-D6-XlEtG.js";import{r as xy}from"./index-D_NuPfjr.js";var mf={exports:{}},_t={};/**
2
2
  * @license React
3
3
  * react-reconciler-constants.production.js
4
4
  *
@@ -1 +1 @@
1
- import{fh as c,fi as o,aD as s,dv as u}from"./index-Cjv2Ynte.js";import{E as h,a as E,F as g,c as m}from"./instance-fork-actions-D3sRzS3K.js";import{t as i}from"./editor-shell-store-B76wIXvV.js";function l(e,t){return c(e,t)}function F(e,t){const n=s(e.shell);return E(n.hierarchy.node(t),l(n,t),t)}let r=null;function O(){r||(r=o(({nodeId:e,store:t})=>F(i(t),e),({nodeId:e,store:t})=>{const n=l(s(t),e);return[{label:h,action:()=>{n?.extractComponent?.(e).then(u)}}]}))}function b(){r?.(),r=null}function f(e,t){return c(e,t)}function p(e,t){const n=s(e.shell);return m(n.hierarchy.node(t),f(n,t),t)}let a=null;function A(){a||(a=o(({nodeId:e,store:t})=>p(i(t),e),({nodeId:e,store:t})=>{const n=f(s(t),e);return[{label:g,action:()=>{n?.forkComponent?.(e).then(u)}}]}))}function C(){a?.(),a=null}export{l as a,A as b,C as c,O as e,f as i,b as u};
1
+ import{fh as c,fi as o,aD as s,dv as u}from"./index-ClgrFOcX.js";import{E as h,a as E,F as g,c as m}from"./instance-fork-actions-D3sRzS3K.js";import{t as i}from"./editor-shell-store-aKHbAoCV.js";function l(e,t){return c(e,t)}function F(e,t){const n=s(e.shell);return E(n.hierarchy.node(t),l(n,t),t)}let r=null;function O(){r||(r=o(({nodeId:e,store:t})=>F(i(t),e),({nodeId:e,store:t})=>{const n=l(s(t),e);return[{label:h,action:()=>{n?.extractComponent?.(e).then(u)}}]}))}function b(){r?.(),r=null}function f(e,t){return c(e,t)}function p(e,t){const n=s(e.shell);return m(n.hierarchy.node(t),f(n,t),t)}let a=null;function A(){a||(a=o(({nodeId:e,store:t})=>p(i(t),e),({nodeId:e,store:t})=>{const n=f(s(t),e);return[{label:g,action:()=>{n?.forkComponent?.(e).then(u)}}]}))}function C(){a?.(),a=null}export{l as a,A as b,C as c,O as e,f as i,b as u};
@@ -1 +1 @@
1
- import{r as b}from"./index-nmcBqr7Y.js";import{gM as R,gN as x,gO as B,gP as I,gQ as P,gR as C,gS as _,gT as $,gU as A,y as N}from"./index-Cjv2Ynte.js";function X(){b.useSyncExternalStore(R,x,x),b.useSyncExternalStore(B,I,I),b.useSyncExternalStore(P,C,C);const t=N();return(t==="workspace:game"?_($()):null)??A(t)}function Y(t){return t?{capture:typeof t.captureFrame=="function",memory:typeof t.memorySnapshot=="function"}:null}class D{constructor(s=10){this.capacity=s}captures=[];selectedId=null;add(s){this.captures.push(s),this.captures.length>this.capacity&&this.captures.splice(0,this.captures.length-this.capacity),this.selectedId=s.id}get all(){return this.captures}select(s){this.captures.some(e=>e.id===s)&&(this.selectedId=s)}get selectedIdOrNull(){return this.selectedId}get selected(){return this.selectedId===null?null:this.captures.find(s=>s.id===this.selectedId)??null}clear(){this.captures=[],this.selectedId=null}}function Q(t){const s=new Map,e=[];for(const o of t.drawCalls){const r=o.target.kind==="canvas"?"canvas":o.target.label??"framebuffer";let n=s.get(r);n||(n=[],s.set(r,n),e.push(r)),n.push(o)}return e.map(o=>({target:o,draws:s.get(o)??[]}))}function q(t){const s=new Set;for(const e of t.drawCalls)s.add(e.target.kind==="canvas"?"canvas":e.target.label??"framebuffer");return{id:t.id,drawCalls:t.totals.drawCalls,unattributed:t.totals.unattributed,truncated:t.totals.truncated,targets:s.size}}function J(t,s){let e=Math.max(0,t.cpuMs);for(const a of t.phases)e=Math.max(e,(a.startMs??0)+a.ms);for(const a of t.systems)e=Math.max(e,a.startMs+a.ms);for(const a of t.components)e=Math.max(e,a.startMs+a.ms);const o=e>0?e:1,r=s/o,n=(a,l,u,p)=>({x:Math.max(0,a*r),w:Math.max(0,l*r),depth:u,label:p,ms:l}),c=[n(0,t.cpuMs,0,`frame ${t.id}`)];for(const a of t.phases)c.push(n(a.startMs??0,a.ms,1,a.name));for(const a of t.systems)c.push(n(a.startMs,a.ms,2,a.name));for(const a of t.components)c.push(n(a.startMs,a.ms,3,a.name));return c}function Z(t,s,e){if(t.length===0)return[];const o=Math.max(1,...t.map(n=>n.cpuMs)),r=s/t.length;return t.map((n,c)=>({index:c,frameId:n.id,x:c*r,w:r,h:Math.max(0,n.cpuMs/o*e),cpuMs:n.cpuMs}))}function tt(t){if(!Number.isFinite(t)||t<0)return"—";if(t<1024)return`${t} B`;const s=["KB","MB","GB","TB"];let e=t/1024,o=0;for(;e>=1024&&o<s.length-1;)e/=1024,o++;return`${e<10?e.toFixed(2):e.toFixed(1)} ${s[o]}`}function et(t,s){const e=Math.max(0,t),o=Math.max(0,e-Math.max(0,s));return{frameMs:e,gapMs:o,dominated:e>20&&o>e/2}}function T(t){const s=new Map;let e=0,o=0;for(const r of t){e+=r.duration;for(const n of r.scripts??[]){o+=n.duration;const c=n.sourceURL?n.sourceURL.split("/").slice(-2).join("/"):"",a=n.sourceFunctionName||n.invoker||"(anonymous)",l=c?`${a} @ ${c}`:a,u=s.get(l)??{totalMs:0,count:0};u.totalMs+=n.duration,u.count+=1,s.set(l,u)}}return{longFrameCount:t.length,totalLongMs:Math.round(e),unattributedMs:Math.round(Math.max(0,e-o)),scripts:[...s.entries()].map(([r,n])=>({key:r,totalMs:Math.round(n.totalMs),count:n.count})).sort((r,n)=>n.totalMs-r.totalMs).slice(0,8)}}const U=5,L=20;function G(t,s,e){const o=t.filter(i=>i.timestamp>=s&&i.intervalMs>0);if(o.length<U)return null;let r=0,n=0,c=0,a=0;for(const i of o)r+=i.intervalMs,n+=i.cpuMs,i.render.gpuMs!==null&&(c+=i.render.gpuMs,a++);const l=o.length,u=r/l,p=n/l,m=e!==null&&e.sampleCount>=L?Math.max(0,e.busyMs-n)/l:null;return{frames:l,fps:u>0?1e3/u:0,frameMs:u,loopMs:p,otherMainMs:m,pipelineMs:Math.max(0,u-p-(m??0)),gpuDrawMs:a>0?c/a:null}}const w=.05,v=3,O=4;function W(t,s){return t.filter(e=>e.timestamp>=s&&e.intervalMs>0)}function E(t,s){const e=new Map;for(const[r,n]of t)e.set(r,(e.get(r)??0)+n);const o=new Map;for(const[r,n]of e)o.set(r,n/s);return o}function H(t,s){const e=t.length,o=E(t.flatMap(l=>l.phases.map(u=>[u.name,u.ms])),e),r=E(t.flatMap(l=>l.systems.map(u=>[`${u.phase} ${u.name}`,u.ms])),e),n=[];let c=0;for(const[l,u]of[...o.entries()].sort((p,m)=>m[1]-p[1])){c+=u,n.push({label:l,depth:2,ms:u});const p=[...r.entries()].filter(([i])=>i.startsWith(`${l} `)).map(([i,f])=>{const S=i.slice(l.length+1);return[S.split(" / ").at(-1)??S,f]}).sort((i,f)=>f[1]-i[1]);for(const[i,f]of p.slice(0,v))n.push({label:i,depth:3,ms:f});const m=p.slice(v);m.length>0&&n.push({label:`${m.length} more system${m.length===1?"":"s"}`,depth:3,ms:m.reduce((i,[,f])=>i+f,0)})}const a=s-c;return a>w&&n.push({label:"outside the phases",depth:2,ms:a}),n}function V(t,s,e,o){if(t===null)return[];const r=T(s.filter(l=>(l.startTime??0)>=e)),n=[];let c=0;for(const l of r.scripts.slice(0,O)){const u=Math.min(l.totalMs/o,t-c);u<=w||(c+=u,n.push({label:l.key,depth:2,ms:u,note:"named by the browser (long frames)"}))}const a=t-c;return(a>w||n.length===0)&&n.push({label:"unattributed",depth:2,ms:Math.max(0,a),note:"below the browser's 50ms attribution threshold"}),n}function st(t,s,e,o){const r=G(t,s,e);if(r===null)return null;const n=W(t,s),c=[{label:"Frame interval",depth:0,ms:r.frameMs,note:`${r.frames} frames at ${r.fps.toFixed(0)} fps`},{label:"Scene loop (CPU)",depth:1,ms:r.loopMs},...H(n,r.loopMs),{label:"Other main thread",depth:1,ms:r.otherMainMs,note:r.otherMainMs===null?"not sampled yet":"React, timers, observers"},...V(r.otherMainMs,o,s,r.frames),{label:"Display pipeline",depth:1,ms:r.pipelineMs,note:"everything after the main thread — the remainder"}];return r.gpuDrawMs!==null&&(c.push({label:"viewport GPU draw",depth:2,ms:r.gpuDrawMs,note:"measured; runs in parallel with the CPU rows",parallel:!0}),c.push({label:"compositor + vsync wait",depth:2,ms:Math.max(0,r.pipelineMs-r.gpuDrawMs),note:"post-effects, glass chrome, waiting for the next frame slot"})),{rows:c,budget:r}}let M=new D,F=null,g=!1,h=null,k=0;const y=new Set;function d(){k++;for(const t of y)t()}function nt(t){return y.add(t),()=>y.delete(t)}function rt(){return k}function j(t){t!==F&&(F=t,M=new D,h=null,d())}function at(){return M}function ot(){return g}function ct(){return h}function ut(t){M.select(t),d()}function lt(){M.clear(),h=null,d()}async function it(t){if(!(!t||g)){j(t),g=!0,h=null,d();try{const s=await t.captureFrame();M.add(s)}catch(s){h=s instanceof Error?s.message:String(s)}finally{g=!1,d()}}}export{j as a,lt as b,it as c,Y as d,q as e,rt as f,at as g,ut as h,ot as i,Q as j,Z as k,ct as l,J as m,tt as n,et as o,T as p,nt as s,st as t,X as u};
1
+ import{r as b}from"./index-nmcBqr7Y.js";import{gM as R,gN as x,gO as B,gP as I,gQ as P,gR as C,gS as _,gT as $,gU as A,y as N}from"./index-ClgrFOcX.js";function X(){b.useSyncExternalStore(R,x,x),b.useSyncExternalStore(B,I,I),b.useSyncExternalStore(P,C,C);const t=N();return(t==="workspace:game"?_($()):null)??A(t)}function Y(t){return t?{capture:typeof t.captureFrame=="function",memory:typeof t.memorySnapshot=="function"}:null}class D{constructor(s=10){this.capacity=s}captures=[];selectedId=null;add(s){this.captures.push(s),this.captures.length>this.capacity&&this.captures.splice(0,this.captures.length-this.capacity),this.selectedId=s.id}get all(){return this.captures}select(s){this.captures.some(e=>e.id===s)&&(this.selectedId=s)}get selectedIdOrNull(){return this.selectedId}get selected(){return this.selectedId===null?null:this.captures.find(s=>s.id===this.selectedId)??null}clear(){this.captures=[],this.selectedId=null}}function Q(t){const s=new Map,e=[];for(const o of t.drawCalls){const r=o.target.kind==="canvas"?"canvas":o.target.label??"framebuffer";let n=s.get(r);n||(n=[],s.set(r,n),e.push(r)),n.push(o)}return e.map(o=>({target:o,draws:s.get(o)??[]}))}function q(t){const s=new Set;for(const e of t.drawCalls)s.add(e.target.kind==="canvas"?"canvas":e.target.label??"framebuffer");return{id:t.id,drawCalls:t.totals.drawCalls,unattributed:t.totals.unattributed,truncated:t.totals.truncated,targets:s.size}}function J(t,s){let e=Math.max(0,t.cpuMs);for(const a of t.phases)e=Math.max(e,(a.startMs??0)+a.ms);for(const a of t.systems)e=Math.max(e,a.startMs+a.ms);for(const a of t.components)e=Math.max(e,a.startMs+a.ms);const o=e>0?e:1,r=s/o,n=(a,l,u,p)=>({x:Math.max(0,a*r),w:Math.max(0,l*r),depth:u,label:p,ms:l}),c=[n(0,t.cpuMs,0,`frame ${t.id}`)];for(const a of t.phases)c.push(n(a.startMs??0,a.ms,1,a.name));for(const a of t.systems)c.push(n(a.startMs,a.ms,2,a.name));for(const a of t.components)c.push(n(a.startMs,a.ms,3,a.name));return c}function Z(t,s,e){if(t.length===0)return[];const o=Math.max(1,...t.map(n=>n.cpuMs)),r=s/t.length;return t.map((n,c)=>({index:c,frameId:n.id,x:c*r,w:r,h:Math.max(0,n.cpuMs/o*e),cpuMs:n.cpuMs}))}function tt(t){if(!Number.isFinite(t)||t<0)return"—";if(t<1024)return`${t} B`;const s=["KB","MB","GB","TB"];let e=t/1024,o=0;for(;e>=1024&&o<s.length-1;)e/=1024,o++;return`${e<10?e.toFixed(2):e.toFixed(1)} ${s[o]}`}function et(t,s){const e=Math.max(0,t),o=Math.max(0,e-Math.max(0,s));return{frameMs:e,gapMs:o,dominated:e>20&&o>e/2}}function T(t){const s=new Map;let e=0,o=0;for(const r of t){e+=r.duration;for(const n of r.scripts??[]){o+=n.duration;const c=n.sourceURL?n.sourceURL.split("/").slice(-2).join("/"):"",a=n.sourceFunctionName||n.invoker||"(anonymous)",l=c?`${a} @ ${c}`:a,u=s.get(l)??{totalMs:0,count:0};u.totalMs+=n.duration,u.count+=1,s.set(l,u)}}return{longFrameCount:t.length,totalLongMs:Math.round(e),unattributedMs:Math.round(Math.max(0,e-o)),scripts:[...s.entries()].map(([r,n])=>({key:r,totalMs:Math.round(n.totalMs),count:n.count})).sort((r,n)=>n.totalMs-r.totalMs).slice(0,8)}}const U=5,L=20;function G(t,s,e){const o=t.filter(i=>i.timestamp>=s&&i.intervalMs>0);if(o.length<U)return null;let r=0,n=0,c=0,a=0;for(const i of o)r+=i.intervalMs,n+=i.cpuMs,i.render.gpuMs!==null&&(c+=i.render.gpuMs,a++);const l=o.length,u=r/l,p=n/l,m=e!==null&&e.sampleCount>=L?Math.max(0,e.busyMs-n)/l:null;return{frames:l,fps:u>0?1e3/u:0,frameMs:u,loopMs:p,otherMainMs:m,pipelineMs:Math.max(0,u-p-(m??0)),gpuDrawMs:a>0?c/a:null}}const w=.05,v=3,O=4;function W(t,s){return t.filter(e=>e.timestamp>=s&&e.intervalMs>0)}function E(t,s){const e=new Map;for(const[r,n]of t)e.set(r,(e.get(r)??0)+n);const o=new Map;for(const[r,n]of e)o.set(r,n/s);return o}function H(t,s){const e=t.length,o=E(t.flatMap(l=>l.phases.map(u=>[u.name,u.ms])),e),r=E(t.flatMap(l=>l.systems.map(u=>[`${u.phase} ${u.name}`,u.ms])),e),n=[];let c=0;for(const[l,u]of[...o.entries()].sort((p,m)=>m[1]-p[1])){c+=u,n.push({label:l,depth:2,ms:u});const p=[...r.entries()].filter(([i])=>i.startsWith(`${l} `)).map(([i,f])=>{const S=i.slice(l.length+1);return[S.split(" / ").at(-1)??S,f]}).sort((i,f)=>f[1]-i[1]);for(const[i,f]of p.slice(0,v))n.push({label:i,depth:3,ms:f});const m=p.slice(v);m.length>0&&n.push({label:`${m.length} more system${m.length===1?"":"s"}`,depth:3,ms:m.reduce((i,[,f])=>i+f,0)})}const a=s-c;return a>w&&n.push({label:"outside the phases",depth:2,ms:a}),n}function V(t,s,e,o){if(t===null)return[];const r=T(s.filter(l=>(l.startTime??0)>=e)),n=[];let c=0;for(const l of r.scripts.slice(0,O)){const u=Math.min(l.totalMs/o,t-c);u<=w||(c+=u,n.push({label:l.key,depth:2,ms:u,note:"named by the browser (long frames)"}))}const a=t-c;return(a>w||n.length===0)&&n.push({label:"unattributed",depth:2,ms:Math.max(0,a),note:"below the browser's 50ms attribution threshold"}),n}function st(t,s,e,o){const r=G(t,s,e);if(r===null)return null;const n=W(t,s),c=[{label:"Frame interval",depth:0,ms:r.frameMs,note:`${r.frames} frames at ${r.fps.toFixed(0)} fps`},{label:"Scene loop (CPU)",depth:1,ms:r.loopMs},...H(n,r.loopMs),{label:"Other main thread",depth:1,ms:r.otherMainMs,note:r.otherMainMs===null?"not sampled yet":"React, timers, observers"},...V(r.otherMainMs,o,s,r.frames),{label:"Display pipeline",depth:1,ms:r.pipelineMs,note:"everything after the main thread — the remainder"}];return r.gpuDrawMs!==null&&(c.push({label:"viewport GPU draw",depth:2,ms:r.gpuDrawMs,note:"measured; runs in parallel with the CPU rows",parallel:!0}),c.push({label:"compositor + vsync wait",depth:2,ms:Math.max(0,r.pipelineMs-r.gpuDrawMs),note:"post-effects, glass chrome, waiting for the next frame slot"})),{rows:c,budget:r}}let M=new D,F=null,g=!1,h=null,k=0;const y=new Set;function d(){k++;for(const t of y)t()}function nt(t){return y.add(t),()=>y.delete(t)}function rt(){return k}function j(t){t!==F&&(F=t,M=new D,h=null,d())}function at(){return M}function ot(){return g}function ct(){return h}function ut(t){M.select(t),d()}function lt(){M.clear(),h=null,d()}async function it(t){if(!(!t||g)){j(t),g=!0,h=null,d();try{const s=await t.captureFrame();M.add(s)}catch(s){h=s instanceof Error?s.message:String(s)}finally{g=!1,d()}}}export{j as a,lt as b,it as c,Y as d,q as e,rt as f,at as g,ut as h,ot as i,Q as j,Z as k,ct as l,J as m,tt as n,et as o,T as p,nt as s,st as t,X as u};
@@ -1 +1 @@
1
- import{i as e}from"./index-Cjv2Ynte.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";const p=e()({contractVersion:{optional:!1,kind:"value",required:"shape"},root:{optional:!0,kind:"value",required:"effect"},presentation:{optional:!0,kind:"value",required:"effect"},world:{optional:!0,kind:"value",required:"effect"},ready:{optional:!0,kind:"value",required:"effect"},lifecycle:{optional:!0,kind:"value",required:"effect"},scenes:{optional:!0,kind:"value",required:"effect"},systems:{optional:!0,kind:"value",required:"operation"}}),s=e()({start:{optional:!0,kind:"function",required:"effect"},pause:{optional:!0,kind:"function",required:"effect"},resume:{optional:!0,kind:"function",required:"effect"},dispose:{optional:!0,kind:"function",required:"effect"}}),f=e()({list:{optional:!1,kind:"function",required:"operation"},current:{optional:!1,kind:"function",required:"operation"},goTo:{optional:!1,kind:"function",required:"effect"}}),c=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"}}),k=e()({name:{optional:!1,kind:"value",required:"shape"},description:{optional:!0,kind:"value",required:"shape"},argsJsonSchema:{optional:!0,kind:"value",required:"shape"},run:{optional:!1,kind:"function",required:"effect"}}),q=e()({name:{optional:!1,kind:"value",required:"shape"},tier:{optional:!0,kind:"value",required:"shape"},read:{optional:!1,kind:"function",required:"operation"}}),E=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"},count:{optional:!1,kind:"value",required:"operation"}}),v=e()({commands:{optional:!0,kind:"value",required:"operation"},state:{optional:!0,kind:"value",required:"operation"},hierarchy:{optional:!0,kind:"function",required:"operation"},systemAdapters:{optional:!0,kind:"value",required:"operation"}}),A=e()({physics:{optional:!0,kind:"value",required:"effect"},networking:{optional:!0,kind:"value",required:"operation"},navigation:{optional:!0,kind:"value",required:"operation"},audio:{optional:!0,kind:"value",required:"effect"},camera:{optional:!0,kind:"value",required:"effect"},renderDebug:{optional:!0,kind:"value",required:"effect"}}),S=e()({present:{optional:!1,kind:"value",required:"shape"},evidence:{optional:!1,kind:"value",required:"claim"}});export{k as GAME_COMMAND_SHAPE,p as GAME_CONTRACT_SHAPE,E as GAME_HIERARCHY_GROUP_SHAPE,s as GAME_LIFECYCLE_SHAPE,f as GAME_SCENES_SHAPE,c as GAME_SCENE_SHAPE,q as GAME_STATE_PROVIDER_SHAPE,v as GAME_SYSTEMS_SHAPE,A as GAME_SYSTEM_ADAPTERS_SHAPE,S as GAME_SYSTEM_EMPTY_SHAPE};
1
+ import{i as e}from"./index-ClgrFOcX.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";const p=e()({contractVersion:{optional:!1,kind:"value",required:"shape"},root:{optional:!0,kind:"value",required:"effect"},presentation:{optional:!0,kind:"value",required:"effect"},world:{optional:!0,kind:"value",required:"effect"},ready:{optional:!0,kind:"value",required:"effect"},lifecycle:{optional:!0,kind:"value",required:"effect"},scenes:{optional:!0,kind:"value",required:"effect"},systems:{optional:!0,kind:"value",required:"operation"}}),s=e()({start:{optional:!0,kind:"function",required:"effect"},pause:{optional:!0,kind:"function",required:"effect"},resume:{optional:!0,kind:"function",required:"effect"},dispose:{optional:!0,kind:"function",required:"effect"}}),f=e()({list:{optional:!1,kind:"function",required:"operation"},current:{optional:!1,kind:"function",required:"operation"},goTo:{optional:!1,kind:"function",required:"effect"}}),c=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"}}),k=e()({name:{optional:!1,kind:"value",required:"shape"},description:{optional:!0,kind:"value",required:"shape"},argsJsonSchema:{optional:!0,kind:"value",required:"shape"},run:{optional:!1,kind:"function",required:"effect"}}),q=e()({name:{optional:!1,kind:"value",required:"shape"},tier:{optional:!0,kind:"value",required:"shape"},read:{optional:!1,kind:"function",required:"operation"}}),E=e()({id:{optional:!1,kind:"value",required:"shape"},label:{optional:!1,kind:"value",required:"shape"},count:{optional:!1,kind:"value",required:"operation"}}),v=e()({commands:{optional:!0,kind:"value",required:"operation"},state:{optional:!0,kind:"value",required:"operation"},hierarchy:{optional:!0,kind:"function",required:"operation"},systemAdapters:{optional:!0,kind:"value",required:"operation"}}),A=e()({physics:{optional:!0,kind:"value",required:"effect"},networking:{optional:!0,kind:"value",required:"operation"},navigation:{optional:!0,kind:"value",required:"operation"},audio:{optional:!0,kind:"value",required:"effect"},camera:{optional:!0,kind:"value",required:"effect"},renderDebug:{optional:!0,kind:"value",required:"effect"}}),S=e()({present:{optional:!1,kind:"value",required:"shape"},evidence:{optional:!1,kind:"value",required:"claim"}});export{k as GAME_COMMAND_SHAPE,p as GAME_CONTRACT_SHAPE,E as GAME_HIERARCHY_GROUP_SHAPE,s as GAME_LIFECYCLE_SHAPE,f as GAME_SCENES_SHAPE,c as GAME_SCENE_SHAPE,q as GAME_STATE_PROVIDER_SHAPE,v as GAME_SYSTEMS_SHAPE,A as GAME_SYSTEM_ADAPTERS_SHAPE,S as GAME_SYSTEM_EMPTY_SHAPE};
@@ -1,4 +1,4 @@
1
- import{g as Rt}from"./_commonjsHelpers-D6-XlEtG.js";import{jS as N}from"./index-Cjv2Ynte.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";var j={exports:{}},qe;function Ot(){if(qe)return j.exports;qe=1;var d=String,x=function(){return{isColorSupported:!1,reset:d,bold:d,dim:d,italic:d,underline:d,inverse:d,hidden:d,strikethrough:d,black:d,red:d,green:d,yellow:d,blue:d,magenta:d,cyan:d,white:d,gray:d,bgBlack:d,bgRed:d,bgGreen:d,bgYellow:d,bgBlue:d,bgMagenta:d,bgCyan:d,bgWhite:d,blackBright:d,redBright:d,greenBright:d,yellowBright:d,blueBright:d,magentaBright:d,cyanBright:d,whiteBright:d,bgBlackBright:d,bgRedBright:d,bgGreenBright:d,bgYellowBright:d,bgBlueBright:d,bgMagentaBright:d,bgCyanBright:d,bgWhiteBright:d}};return j.exports=x(),j.exports.createColors=x,j.exports}var te,ze;function Ee(){if(ze)return te;ze=1;let d=Ot(),x=N;class v extends Error{constructor(y,b,g,w,S,o){super(y),this.name="CssSyntaxError",this.reason=y,S&&(this.file=S),w&&(this.source=w),o&&(this.plugin=o),typeof b<"u"&&typeof g<"u"&&(typeof b=="number"?(this.line=b,this.column=g):(this.line=b.line,this.column=b.column,this.endLine=g.line,this.endColumn=g.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,v)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(y){if(!this.source)return"";let b=this.source;y==null&&(y=d.isColorSupported);let g=e=>e,w=e=>e,S=e=>e;if(y){let{bold:e,gray:t,red:i}=d.createColors(!0);w=n=>e(i(n)),g=n=>t(n),x&&(S=n=>x(n))}let o=b.split(/\r?\n/),f=Math.max(this.line-3,0),s=Math.min(this.line+2,o.length),r=String(s).length;return o.slice(f,s).map((e,t)=>{let i=f+1+t,n=" "+(" "+i).slice(-r)+" | ";if(i===this.line){if(e.length>160){let c=20,u=Math.max(0,this.column-c),l=Math.max(this.column+c,this.endColumn+c),a=e.slice(u,l),h=g(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,c-1)).replace(/[^\t]/g," ");return w(">")+g(n)+S(a)+`
1
+ import{g as Rt}from"./_commonjsHelpers-D6-XlEtG.js";import{jS as N}from"./index-ClgrFOcX.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";var j={exports:{}},qe;function Ot(){if(qe)return j.exports;qe=1;var d=String,x=function(){return{isColorSupported:!1,reset:d,bold:d,dim:d,italic:d,underline:d,inverse:d,hidden:d,strikethrough:d,black:d,red:d,green:d,yellow:d,blue:d,magenta:d,cyan:d,white:d,gray:d,bgBlack:d,bgRed:d,bgGreen:d,bgYellow:d,bgBlue:d,bgMagenta:d,bgCyan:d,bgWhite:d,blackBright:d,redBright:d,greenBright:d,yellowBright:d,blueBright:d,magentaBright:d,cyanBright:d,whiteBright:d,bgBlackBright:d,bgRedBright:d,bgGreenBright:d,bgYellowBright:d,bgBlueBright:d,bgMagentaBright:d,bgCyanBright:d,bgWhiteBright:d}};return j.exports=x(),j.exports.createColors=x,j.exports}var te,ze;function Ee(){if(ze)return te;ze=1;let d=Ot(),x=N;class v extends Error{constructor(y,b,g,w,S,o){super(y),this.name="CssSyntaxError",this.reason=y,S&&(this.file=S),w&&(this.source=w),o&&(this.plugin=o),typeof b<"u"&&typeof g<"u"&&(typeof b=="number"?(this.line=b,this.column=g):(this.line=b.line,this.column=b.column,this.endLine=g.line,this.endColumn=g.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,v)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(y){if(!this.source)return"";let b=this.source;y==null&&(y=d.isColorSupported);let g=e=>e,w=e=>e,S=e=>e;if(y){let{bold:e,gray:t,red:i}=d.createColors(!0);w=n=>e(i(n)),g=n=>t(n),x&&(S=n=>x(n))}let o=b.split(/\r?\n/),f=Math.max(this.line-3,0),s=Math.min(this.line+2,o.length),r=String(s).length;return o.slice(f,s).map((e,t)=>{let i=f+1+t,n=" "+(" "+i).slice(-r)+" | ";if(i===this.line){if(e.length>160){let c=20,u=Math.max(0,this.column-c),l=Math.max(this.column+c,this.endColumn+c),a=e.slice(u,l),h=g(n.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,c-1)).replace(/[^\t]/g," ");return w(">")+g(n)+S(a)+`
2
2
  `+h+w("^")}let p=g(n.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return w(">")+g(n)+S(e)+`
3
3
  `+p+w("^")}return" "+g(n)+S(e)}).join(`
4
4
  `)}toString(){let y=this.showSourceCode();return y&&(y=`
@@ -1 +1 @@
1
- import{l2 as ht,l3 as be,l4 as gt,df as vt,U as K,l5 as xt,l6 as we,l7 as yt,l8 as Se,a6 as L,a7 as ue,l9 as bt,la as wt,bA as Y,bB as G,lb as St,lc as jt,ab as de,ld as Et,aL as $e,le as Mt,lf as It,ez as Te,aC as ze,g4 as Rt,g5 as Ct,g6 as Dt,g7 as Pt,r as oe,al as h,Z as At,gQ as Ft,gR as je,gT as _t,fA as kt,eJ as Ne,lg as $t,bC as Tt,lh as zt,p as Oe}from"./index-Cjv2Ynte.js";import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{r as i}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{u as Nt,d as Ot,c as Gt}from"./frame-debugger-store-BnZFxjhV.js";import{m as Vt}from"./audio-meter-Cddyq1vI.js";import{p as Ge}from"./utility-view-state-CGlE9NdF.js";import{P as Lt}from"./PlayBar-YdSOe6Mn.js";import{a as Ee,r as Bt,f as Ht,R as Ut}from"./presentation-xDN53iEZ.js";import{setUserData as Ve}from"./user-data-CODoGZqA.js";import{I as pe,J as Wt,K as ne,L as qt,M as Le,O as Be,P as He,Q as Ue,w as Kt,x as Xt,R as me,v as J,S as Jt,T as Qt,U as Yt,V as se,W as We,X as Me,Y as qe,Z as Zt,_ as Ke,a as en,$ as tn,a0 as Ie,a1 as nn,b as Xe,a2 as sn}from"./game-network-Bof-cN2R.js";import{aq as on,cp as Je,aI as rn,bX as an,ey as ln,bh as fe,co as Re,s as cn,fo as U,bV as un,N as Qe,M as Ce,dg as dn,df as pn}from"./three.core-3arARmh6.js";import{e as mn,S as fn}from"./surface-state-C0NqVDj5.js";import{d as hn}from"./surface-content-Dg9Kkazf.js";import{a as gn,R as Ye}from"./active-ingest-CmyN258P.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./configurations-BICGR-Zc.js";import"./run-selection-BdsJXY3k.js";import"./ingest-source-persistence-BNek6mSi.js";import"./capability-coverage-BMuTFU_9.js";import"./game-contract-seams-CzlxJGC2.js";import"./object-marks-BnvSuCTt.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-BUPFKtBc.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-CcTdmLf3.js";import"./contract-system-adapters-D8SzcuZo.js";import"./seeded-random-BVi4_fs4.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./three.module-BLhyNg0e.js";import"./index-DzuOGwVB.js";import"./live-project-verbs-D_8wWaCB.js";import"./edit-mode-authoring-CIXoejcH.js";import"./json-history-resource-C1pGwXuI.js";import"./binding-resolver-4nTdtOpk.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CbgTofeT.js";import"./canvas-entry-runtime-CgJkCzp_.js";import"./three-ingest-runtime-BPTa3ryG.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"./pixi-story-model-DNkfnWUV.js";import"./viewport-root-presentation-Co7zteuS.js";import"./mounted-authoring-DQ0-LgR6.js";import"./entity-object-C6hm5vYx.js";import"./user-data-DxeJHxTz.js";import"./workspace-arrangement-Bq8u7HUK.js";import"./three-contract-Dkt6PmWY.js";import"./three-CAVY58Dv.js";import"./editor-layers-CYVQVJ5O.js";import"./component-instance-root-Ctbx3vOO.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BDMrB8fC.js";import"./source-persistence-backend-BMbXR_WB.js";import"./three-projection-core-BnoDtdZY.js";import"./body-marks-C1LxJtQb.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BRcBDERW.js";import"./deferred-ingest-play-DsV_qXEP.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CTCp7U6C.js";import"./board-guides-Cnfvv0uu.js";import"./relative-import-specifier-CPSPKQKY.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-xUKvX80V.js";import"./inference-diagnostics-DE1P5w14.js";import"./writer-tw6EcuVO.js";import"./three-state-_BZo8PPs.js";import"./editor-shell-store-B76wIXvV.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-CTspfOX-.js";import"./game-surface-defaults-D8S4cRxi.js";const Ze=8,re=1e3/60;function vn(e,t=Ze){return!(e>0)||t<=0?0:Math.min(t,Math.max(1,Math.round(Vt(e)/100*t)))}function De(e,t){const n=e.filter(a=>a.id>t),r=n.at(-1)?.id??t,o=n.map(a=>a.intervalMs).filter(a=>Number.isFinite(a)&&a>0).sort((a,m)=>a-m);if(o.length===0)return{frameId:r,intervalMs:null};const l=Math.floor((o.length-1)*.95);return{frameId:r,intervalMs:o[l]??null}}function xn(e){const t=e.slice(-3);return t.slice(-2).length===2&&t.slice(-2).every(n=>n>=50)?"danger":t.length===3&&t.every(n=>n>re*1.05)?"warning":"normal"}function yn(e,t,n,r=50){if(e.length===0||t<=0||n<=0)return"";const o=Math.max(1,e.length-1);return e.map((l,a)=>{const m=a/o*t,d=Math.min(1,Math.max(0,l/r)),g=n-d*n;return`${m.toFixed(1)},${g.toFixed(1)}`}).join(" ")}const et="muted",Pe={enabled:!1,recording:!1,fps:0,cpuMs:0,p95Ms:0,p99Ms:0,frames:[],phases:[],systems:[],components:[],render:{gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:0}};function Ae(){return St(et)===!0}function bn(e){jt(et,e)}function wn(e,t){const n=t.find(o=>o.id==="master")?.level;if(!e.isMuted()&&n!==void 0)return n;const r=t.filter(o=>o.id!=="master").map(o=>o.level);return r.length>0?Math.max(...r):n??0}function Sn(){const e=K();i.useSyncExternalStore(e.subscribe,e.getShellSnapshot??e.getSnapshot);const t=e.playState==="playing",[n,r]=i.useState(!1),[o,l]=i.useState(0),[a,m]=i.useState(!1),[d,g]=i.useState(!1),[u,T]=i.useState(Ae),R=i.useRef(Ae()),E=i.useRef(new WeakMap),y=i.useRef(null),C=i.useSyncExternalStore(xt,we,we),v=yt();i.useEffect(()=>{const p=R.current||!t;for(const f of Se())E.current.get(f)!==p&&(f.setMuted(p),E.current.set(f,p))},[C,t]),i.useEffect(()=>{if(!v){l(0),m(!1),g(!1);return}const p=v.acquireMeters?.()??null;g(p!==null);const f=()=>{m(v.isMuted()),l(p?wn(v,p.read()):0)};f();const A=setInterval(f,100);return()=>{clearInterval(A),p?.dispose()}},[v]);const M=()=>{const p=!R.current,f=p||!t;for(const A of Se())A.resume?.(),A.setMuted(f),E.current.set(A,f);R.current=p,T(p),bn(p),m(f)},D=vn(o),z=v&&a&&!u&&!t?" (not playing)":"",P=v?a?"Audio muted":o>0?"Audio playing":"Audio quiet":"Audio unavailable";return s.jsxs("div",{className:"volter-header-audio","data-muted":a||void 0,"data-available":!!v,children:[s.jsxs(L,{ref:y,type:"button",variant:"ghost",size:"compact",className:"volter-header-telemetry-button","data-testid":"header-audio-telemetry","aria-label":`${P}; open audio controls`,"aria-haspopup":"menu","aria-expanded":n,title:`${P}${z}${d?"":" · level metering unavailable"}`,onClick:()=>r(p=>!p),children:[s.jsx(ue,{icon:a?bt:wt,size:"sm"}),s.jsx("span",{className:"volter-audio-vu","aria-hidden":"true",children:Array.from({length:Ze},(p,f)=>s.jsx("i",{"data-filled":f<D||void 0},f))})]}),n&&s.jsx(Y,{anchorRef:y,onDismiss:()=>r(!1),gap:3,children:s.jsx(G,{onClick:()=>{M(),r(!1)},children:u?"Unmute audio":"Mute audio"})})]})}function jn(){const e=Nt(),t=e?.profiler??null,[n,r]=i.useState(Pe),[o,l]=i.useState([]);i.useEffect(()=>{if(!t){r(Pe),l([]);return}const R=t.telemetryEnabled;t.telemetryEnabled=!0;const E=t.getSnapshot(),y=De(E.frames,0);let C=y.frameId;r(E),l(y.intervalMs===null?[]:[y.intervalMs]);let v=null;const M=()=>{v=null;const z=t.getSnapshot(),P=De(z.frames,C);C=P.frameId,r(z);const p=P.intervalMs;p!==null&&l(f=>[...f,p].slice(-24))},D=t.subscribe(()=>{v===null&&(v=setTimeout(M,500))});return()=>{D(),v!==null&&clearTimeout(v),R||(t.telemetryEnabled=!1)}},[t]);const a=o.at(-1)??null,m=yn(o,72,18),d=a?Math.round(1e3/a):n.fps>0?Math.round(n.fps):null,g=a??(n.fps>0?1e3/n.fps:null),u=xn(o),T=e?`${e.label}: ${d??"—"} FPS · ${g?.toFixed(1)??"—"} ms frame time · open Profiler`:"The active document has no live render loop to profile";return s.jsxs(L,{type:"button",variant:"ghost",size:"compact",className:"volter-header-telemetry-button volter-header-performance","data-testid":"header-performance-telemetry","data-performance-tone":u,disabled:!e,"aria-label":T,title:T,onClick:()=>Ge.open("profiler"),children:[s.jsxs("svg",{className:"volter-performance-graph","aria-hidden":"true",viewBox:"0 0 72 18",width:"72",height:"18",children:[s.jsx("line",{className:"volter-performance-budget",x1:"0",x2:"72",y1:18-re/50*18,y2:18-re/50*18}),m&&s.jsx("polyline",{className:"volter-performance-sparkline",points:m})]}),s.jsxs("span",{className:"volter-performance-readout",children:[s.jsxs("strong",{className:"volter-header-fps",children:[d??"—"," FPS"]}),s.jsxs("span",{className:"volter-header-frame-ms",children:[g?.toFixed(1)??"—"," ms"]})]})]})}function En(){return i.useSyncExternalStore(ht,be,be),gt().telemetry==="hidden"?null:s.jsxs(vt,{className:"volter-header-telemetry volter-chrome-island volter-glass-island","data-island-scale":"compact",align:"center",gap:1,children:[s.jsx(Sn,{}),s.jsx(jn,{})]})}let Q=!1,ie=0,w=null,N=null;const Mn=new on(1,1,1,16,1,!0),In=new Je({color:2280686,transparent:!0,opacity:.45,side:rn,depthWrite:!1}),Rn=new an({color:16755200,transparent:!0,opacity:.9}),Cn=new ln(.12,12,8),Dn=new Je({color:16755200,depthWrite:!1}),Pn=16724804,An=2280686;let $=[];function Fe(){return Q}function Fn(e){e!==Q&&(Q=e,e?ie=requestAnimationFrame(tt):(cancelAnimationFrame(ie),$n()))}function tt(){if(!Q)return;ie=requestAnimationFrame(tt);const e=pe(),t=e?de().navigation?.crowdAgents?.()??[]:[];if(e!==N&&(N&&w&&N.remove(w),N=e,e&&(w||(w=new fe,w.name="crowd-debug-draw",Ve(w,"editorHelper",!0)),e.add(w))),!(!w||!e)){_n(w,t.length);for(let n=0;n<t.length;n++)kn($[n],t[n])}}function _n(e,t){for(;$.length<t;){const n=new fe,r=In.clone(),o=new Re(Mn,r),l=new cn(new U(1,0,0),new U,1,16755200),a=new un(new Qe,Rn),m=new Re(Cn,Dn);n.add(o),n.add(l),e.add(n),e.add(a),e.add(m),$.push({root:n,cylinder:o,cylinderMaterial:r,arrow:l,path:a,target:m})}for(;$.length>t;){const n=$.pop();e.remove(n.root),e.remove(n.path),e.remove(n.target),n.arrow.dispose(),n.path.geometry.dispose(),n.cylinderMaterial.dispose()}}function kn(e,t){e.root.position.set(t.position.x,t.position.y,t.position.z),e.cylinder.scale.set(t.radius,t.height,t.radius),e.cylinder.position.y=t.height/2,e.cylinderMaterial.color.setHex(t.state==="invalid"?Pn:An);const n=t.corners??[];n.length>0?(e.path.visible=!0,e.path.geometry.setFromPoints([new U(t.position.x,t.position.y+.05,t.position.z),...n.map(o=>new U(o.x,o.y+.05,o.z))])):e.path.visible=!1,t.target&&n.length>0?(e.target.visible=!0,e.target.position.set(t.target.x,t.target.y+.05,t.target.z)):e.target.visible=!1;const r=Math.hypot(t.velocity.x,t.velocity.y,t.velocity.z);r>.01?(e.arrow.visible=!0,e.arrow.position.y=t.height/2,e.arrow.setDirection(new U(t.velocity.x/r,t.velocity.y/r,t.velocity.z/r)),e.arrow.setLength(Math.max(r*.5,.2))):e.arrow.visible=!1}function $n(){if(w){N?.remove(w);for(const e of $)e.arrow.dispose();w.clear()}$=[],w=null,N=null}function Tn({onPresetChange:e}){const[t,n]=i.useState(!1),r=i.useRef(null),o=Le(),l=o.kind==="fit";return s.jsxs("div",{className:"volter-playbar-popover-anchor",children:[s.jsxs(L,{ref:r,variant:"ghost",size:"comfortable","aria-haspopup":"menu","aria-expanded":t,"aria-controls":t?"volter-device-preset-menu":void 0,"data-testid":"device-preset-picker",onClick:()=>n(a=>!a),title:"Device preview — constrain the game to a device resolution + DPR. Phone/tablet presets show the safe area, set --volter-safe-area-inset-top/right/bottom/left CSS vars on the game mount, and send mouse input as touch.",children:[s.jsx(ue,{icon:Et,size:"md"}),s.jsx($e,{variant:"code",children:l?"Device":`${o.width}×${o.height}`})]}),t&&s.jsxs(Y,{id:"volter-device-preset-menu",anchorRef:r,className:"volter-resolution-menu",gap:4,onDismiss:()=>n(!1),children:[Wt.map(a=>s.jsx(G,{role:"menuitemradio","aria-checked":a.id===o.id,"data-testid":`device-preset-${a.id}`,onSelect:()=>{e(a),n(!1)},children:a.label},a.id)),s.jsxs(G,{role:"menuitemcheckbox","aria-checked":ne(),"data-testid":"device-touch-toggle",onSelect:()=>qt(!ne()),children:[ne()?"✓ ":" ","Pointer as touch"]})]})]})}function zn(){const e=Mt(()=>It()??null),n=Ot(e)?.capture===!0;return s.jsx(L,{type:"button",size:"compact",variant:"ghost","data-testid":"game-capture-frame",className:"volter-frame-capture-game-button",disabled:!n,title:n?"Capture one rendered frame and open the Frame debugger":"No render-debug adapter registered for this world — frame capture is unavailable",onClick:()=>{Gt(e),Ge.open("frame")},children:"Capture frame"})}let nt={label:"Fill",width:null,height:null},ae=1,st=0;const le=new Set;function V(){st++;for(const e of le)e()}function ot(e){return le.add(e),()=>{le.delete(e)}}const rt=()=>st;function it(){return nt}function at(e){nt=e,V()}function lt(e,t){return e.width!==null||!t?e:{label:`Project — ${t.width}×${t.height}`,width:t.width,height:t.height}}function Nn(e){return e?[lt({label:"Fill",width:null,height:null},e),...Ee.filter(t=>t.width!==null)]:Ee}function ct(e){Be(e.id),at(e.width===null||e.height===null?{label:"Fill",width:null,height:null}:{label:e.label,width:e.width,height:e.height})}function On(e){e!==ae&&(ae=e,V())}function Gn(){return ae}function ut(e){return Array.from(e.children).filter(t=>t.dataset?.volterRootSurface==="true")}function Vn(e,t,n){for(const r of t)r.contains(e)||e.appendChild(r);if(n)for(const r of ut(n))e.appendChild(r)}function Ln({name:e}){return s.jsx("div",{"data-testid":"game-instance-name",style:{flex:"0 0 auto",padding:"3px 10px",background:h.surface.chrome,color:h.content.primary,borderBottom:`1px solid ${h.boundary.default}`,fontSize:11,fontWeight:600,userSelect:"none"},children:e})}function dt({name:e,testId:t,borderLeft:n,focused:r,onFocus:o,children:l}){return s.jsxs("div",{"data-testid":t,"data-focused":r||void 0,onPointerDownCapture:o,style:{flex:1,minWidth:0,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",cursor:o&&!r?"pointer":void 0,...n?{borderLeft:`1px solid ${h.boundary.default}`}:{}},children:[s.jsx(Ln,{name:e}),s.jsx("div",{style:{flex:1,minHeight:0,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:l}),r&&s.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:40,border:`2px solid ${h.accent.default}`,boxShadow:`inset 0 0 0 1px ${h.accent.default}`}})]})}function Bn({index:e}){const t=i.useRef(null),n=qe(e+1),r=i.useSyncExternalStore(Ke,en),[o,l]=i.useState(null),a=i.useSyncExternalStore(me,J);return i.useEffect(()=>{const m=t.current;if(!m||!r)return;let d=null,g=!1;return tn(m,n).then(u=>{g?Ie(u):(d=u,l(u))},u=>{At.error(`Failed to mount ${n}: ${u}`,"play-mode")}),()=>{g=!0,l(null),d&&Ie(d)}},[e,r]),s.jsx(dt,{name:n,testId:`game-instance-slot-${e+1}`,borderLeft:!0,focused:o!=null&&a===o,onFocus:o?()=>We(o):void 0,children:s.jsx("div",{ref:t,"data-volter-instance-viewport":"",style:{position:"absolute",inset:0}})})}function Hn({style:e}){const t=i.useSyncExternalStore(Te,ze),r=K().playState!=="stopped",o=i.useRef(null);i.useSyncExternalStore(ot,rt),i.useSyncExternalStore(He,Ue);const l=i.useSyncExternalStore(Kt,Xt),a=l>0,m=i.useSyncExternalStore(me,J),d=Le(),g=it(),[u,T]=i.useState({width:0,height:0}),[R,E]=i.useState(0),y=i.useRef(null),C=i.useSyncExternalStore(Rt,Ct),v=i.useSyncExternalStore(Dt,Pt),M=Zt(),D=gn(),z=M.length>0?M.map(c=>c.rootId):D?[D.worldId]:C.filter(c=>c.mechanism==="host-mount").map(c=>c.rootId),P=!!(y.current&&hn(y.current)),p=M.length>0?M.some(c=>c.hasRenderableContent):P,f=M.length>0||D!==null,A=r?mn({surface:"Game",rootIds:z,phase:f?"ready":"loading",content:f?p?"present":"empty":"unknown",readiness:C,failures:v}):null;i.useEffect(()=>{if(!r||!f||p)return;const c=window.setTimeout(()=>E(x=>x+1),250);return()=>window.clearTimeout(c)},[R,p,r,f]),i.useEffect(()=>{const c=o.current;if(!c||typeof MutationObserver>"u")return;const x=new MutationObserver(()=>E(I=>I+1));return x.observe(c,{childList:!0,subtree:!0,characterData:!0}),()=>x.disconnect()},[]),i.useEffect(()=>{const c=Jt();c.width!==null&&(ct(c),V())},[]);const Z=i.useRef([]),he=i.useCallback(c=>{if(c===y.current)return;!c&&y.current&&(Z.current=ut(y.current)),c&&(Vn(c,Z.current,y.current),Z.current=[]);const x=y.current;y.current=c,c?oe().workspace.liveDocument.setContainer(c):x&&oe().workspace.liveDocument.releaseContainer(x),c?Qt(c):x&&Yt(x)},[]);i.useEffect(()=>{const c=o.current;if(!c)return;const x=new ResizeObserver(([I])=>{if(!I)return;const{width:X,height:ye}=I.contentRect;T(te=>te.width===X&&te.height===ye?te:{width:X,height:ye})});return x.observe(c),()=>x.disconnect()},[]);const mt=t?.config.resolution,F=Bt(g,mt),ge=F.kind==="fill",ft=ge||a,B=F.kind==="logical"?F.width:null,H=F.kind==="logical"?F.height:null,ve=d.dpr;i.useEffect(()=>{const c=ve??nn();a?u.width>0&&u.height>0&&se(u.width/(l+1),u.height,c):B===null||H===null?u.width>0&&u.height>0&&se(u.width,u.height,c):se(B,H,c)},[B,H,u.width,u.height,ve,r,a,l]);const ee=Ht(u,{width:B??0,height:H??0},{allowUpscale:F.kind==="logical"&&F.allowUpscale}),_=ge?1:ee.scale;i.useEffect(()=>{On(_)},[_]);const b=d.safeArea,xe={"--volter-safe-area-inset-top":`${b?.top??0}px`,"--volter-safe-area-inset-right":`${b?.right??0}px`,"--volter-safe-area-inset-bottom":`${b?.bottom??0}px`,"--volter-safe-area-inset-left":`${b?.left??0}px`};return s.jsx("div",{style:{overflow:"hidden",position:"relative",flexDirection:"column",...e},children:s.jsxs("div",{ref:o,style:{flex:1,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[(()=>{const c=ft?s.jsx("div",{ref:he,"data-testid":"game-runtime-container","aria-hidden":"true",style:{position:"absolute",inset:0,...r?{}:{visibility:"hidden"},...xe}},"game-mount-fill"):s.jsxs("div",{style:{position:"relative",width:ee.width,height:ee.height,overflow:"hidden",...r?{}:{visibility:"hidden"}},children:[s.jsx("div",{ref:he,"data-testid":"game-runtime-container","aria-hidden":"true",style:{width:B??0,height:H??0,transformOrigin:"top left",transform:`scale(${_})`,...xe}}),b&&s.jsx("div",{"data-testid":"device-safe-area-overlay",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:2},children:[["top",b.top,{top:0,left:0,right:0,height:b.top*_}],["bottom",b.bottom,{bottom:0,left:0,right:0,height:b.bottom*_}],["left",b.left,{top:0,bottom:0,left:0,width:b.left*_}],["right",b.right,{top:0,bottom:0,right:0,width:b.right*_}]].map(([x,I,X])=>I>0?s.jsx("div",{"data-testid":`device-safe-area-${x}`,style:{position:"absolute",...X,background:h.semantic.dangerFaint,boxShadow:`inset 0 0 0 1px ${h.semantic.dangerMuted}`}},x):null)})]},"game-mount-device");return a?s.jsxs(s.Fragment,{children:[s.jsx(dt,{name:qe(0),testId:"game-instance-slot-0",focused:m===Me(),onFocus:()=>We(Me()),children:c}),Array.from({length:l},(x,I)=>s.jsx(Bn,{index:I},I))]}):c})(),!r&&s.jsxs("div",{"data-testid":"game-stopped-placeholder",style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,background:h.surface.shell,color:h.content.dim,fontSize:11,pointerEvents:"none"},children:[s.jsx("span",{style:{color:h.content.primary,fontSize:13},children:"Game is stopped"}),s.jsx("span",{children:"Press Play to start the composed runtime."})]}),r&&s.jsx(fn,{explanation:A,testId:"game-surface-status",style:{zIndex:30,background:h.surface.shell}})]})})}function _e(){return Xe().map(({id:e,name:t})=>`${e}\0${t}`).join("")}function Un({instanceId:e}){const t=K();i.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);const n=i.useSyncExternalStore(me,J,J),[,r]=i.useState(0);i.useEffect(()=>{const g=window.setInterval(()=>r(u=>u+1),250);return()=>window.clearInterval(g)},[]);const o=Ye(e),l=zt(),a=o?(o.loop.activeTimeouts??0)+(o.loop.activeIntervals??0)+(o.loop.activeAnimationFrames??0)+o.loop.pending:0,m=o?o.listeners.window+o.listeners.document:0,d=[["Mount",e],["Simulation",t.playState==="paused"?"Paused":"Running"],["Input",n===e?"Keyboard focus":"Inactive"],["Input events",o?`${o.loop.input??0} observed · ${o.loop.inputBlocked??0} blocked`:"Not measured"],["Network",l?l.getConnectionState?.()??"Not reported by this adapter":"Not registered"],["Owned callbacks",String(a)],["Owned listeners",String(m)],["Realm globals",String(o?.globals??0)],["Browser storage",o?`Shared origin · ${o.storage.local.reads+o.storage.session.reads} reads · ${o.storage.local.writes+o.storage.session.writes} writes`:"Shared origin"]];return s.jsx("div",{role:"none",style:{display:"grid",gridTemplateColumns:"112px minmax(120px, 1fr)",gap:"4px 12px",padding:"8px 10px",fontSize:10,lineHeight:"15px"},children:d.map(([g,u])=>s.jsxs("div",{style:{display:"contents"},children:[s.jsx("span",{style:{color:h.content.dim},children:g}),s.jsx("span",{style:{color:h.content.primary,fontFamily:g==="Mount"?h.typography.mono:void 0,overflow:"hidden",textOverflow:"ellipsis"},children:u})]},g))})}function Wn(){i.useSyncExternalStore(Ke,_e,_e),i.useSyncExternalStore(Ft,je,je);const e=Xe(),t=_t(),n=e.find(d=>d.id===t)??e[0],[r,o]=i.useState(!1),l=i.useRef(null);if(e.length<2||!n)return null;const m=(Ye(n.id)?.loop.firedWhileHeld??0)>0;return s.jsxs("div",{className:"volter-playbar-popover-anchor",children:[s.jsxs(L,{ref:l,variant:"ghost",size:"compact","aria-haspopup":"menu","aria-expanded":r,onClick:()=>o(d=>!d),title:`Runtime instruments inspect ${n.name}; agent-addressed commands are unchanged`,children:[s.jsx(ue,{icon:kt,size:"sm",style:{color:m?h.semantic.warning:void 0}}),s.jsxs($e,{variant:"code",children:["Inspect ",n.name]}),s.jsx(Ne,{direction:"down"})]}),r&&s.jsxs(Y,{anchorRef:l,gap:3,onDismiss:()=>o(!1),style:{minWidth:270},children:[e.map(d=>s.jsxs(G,{role:"menuitemradio","aria-checked":d.id===n.id,onSelect:()=>$t(d.id),children:[d.id===n.id?"✓ ":" ",d.name]},d.id)),s.jsx(Tt,{}),s.jsx(Un,{instanceId:n.id})]})]})}let q=!1,ce=0,S=null,O=null,W=null,j=null,k=0;function ke(){return q}function qn(e){e!==q&&(q=e,e?ce=requestAnimationFrame(pt):(cancelAnimationFrame(ce),W?.setDebugDrawEnabled?.(!1),Qn()))}function pt(){if(!q)return;ce=requestAnimationFrame(pt);const e=pe(),t=e?Oe(de().physics):null;if(t!==W&&(W?.setDebugDrawEnabled?.(!1),W=t,t?.setDebugDrawEnabled?.(!0)),Kn(e),!S||!e)return;const n=t?.contactPoints?.()??null;Xn(S,n)}function Kn(e){e!==O&&(O&&S&&O.remove(S),O=e,e&&(S||(S=new fe,S.name="physics-debug-draw",Ve(S,"editorHelper",!0)),e.add(S)))}function Xn(e,t){const n=t?t.length/3:0;if(!j){k=64;const l=new Qe;l.setAttribute("position",new Ce(new Float32Array(k*3),3));const a=new dn({color:16724821,size:10,sizeAttenuation:!1,depthTest:!1,transparent:!0,opacity:.95});j=new pn(l,a),j.renderOrder=999,j.frustumCulled=!1,e.add(j)}const r=j.geometry;if(n>k){for(;k<n;)k*=2;r.setAttribute("position",new Ce(new Float32Array(k*3),3))}const o=r.getAttribute("position");t&&n>0&&o.array.set(t),o.needsUpdate=!0,r.setDrawRange(0,n),j.visible=n>0}function Jn(){const e=pe(),n=(e?Oe(de().physics):null)?.debugDraw?.()??null;let r=!1;n&&e&&e.traverse(a=>{a===n&&(r=!0)});const o=n?.geometry.getAttribute("position"),l=j?.geometry.drawRange.count??0;return{enabled:q,wireframeInScene:r,wireframeVisible:n?.visible??!1,wireframeVertexCount:o?.count??0,contactMarkerCount:j?.visible&&Number.isFinite(l)?l:0}}typeof window<"u"&&(window.__volterPhysicsDebug=Jn);function Qn(){S&&(O?.remove(S),j&&(j.geometry.dispose(),j.material.dispose()),S.clear()),j=null,k=0,S=null,O=null,W=null}function Yn(){const[e,t]=i.useState(!1),n=i.useRef(null);return s.jsxs("div",{style:{position:"relative"},children:[s.jsxs(L,{ref:n,type:"button",variant:"outline",size:"compact","data-testid":"game-debug-menu","aria-haspopup":"menu","aria-expanded":e,"aria-controls":e?"volter-game-debug-menu":void 0,onClick:()=>t(r=>!r),children:[s.jsx("span",{children:"Debug"}),s.jsx(Ne,{direction:"down"})]}),e&&s.jsxs(Y,{id:"volter-game-debug-menu",anchorRef:n,gap:3,onDismiss:()=>t(!1),style:{minWidth:190},children:[s.jsxs(G,{onClick:()=>{Fn(!Fe()),V()},children:[Fe()?"✓ ":" ","Crowd debug draw"]}),s.jsxs(G,{onClick:()=>{qn(!ke()),V()},children:[ke()?"✓ ":" ","Physics debug draw"]})]})]})}function Zn(e){const t=i.useSyncExternalStore(Te,ze),n=K();return i.useSyncExternalStore(n.subscribe,n.getShellSnapshot??n.getSnapshot),i.useSyncExternalStore(ot,rt),i.useSyncExternalStore(He,Ue),s.jsxs("div",{"data-testid":"game-doc-toolbar",style:{display:"grid",alignItems:"center",gridTemplateColumns:"minmax(0, 1fr) auto minmax(0, 1fr)",width:"100%",gap:6,padding:"2px 8px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",minWidth:0,overflow:"auto"},children:[s.jsx(Wn,{}),s.jsx(Tn,{onPresetChange:r=>{ct(r),V()}}),s.jsx(Ut,{resolution:lt(it(),t?.config.resolution),options:Nn(t?.config.resolution),onResolutionChange:r=>{Be(sn),at(r)},scale:Gn(),title:"Change game resolution"}),s.jsx(Yn,{}),n.playState!=="stopped"&&s.jsx(zn,{})]}),s.jsx(Lt,{placement:"runtime"}),s.jsx("div",{style:{display:"flex",justifyContent:"flex-end",minWidth:0},children:s.jsx(En,{})})]})}function es(e){const t=K();i.useSyncExternalStore(t.subscribe,t.getShellSnapshot??t.getSnapshot);const n=t.playState!=="stopped";return s.jsxs("div",{style:{flex:1,position:"relative",display:"flex",flexDirection:"column"},children:[s.jsx(Hn,{style:{flex:1,position:"relative",display:"flex",flexDirection:"column",pointerEvents:"auto",...t.playState==="playing"?{outline:`2px solid ${h.semantic.success}`,outlineOffset:-2}:n?{outline:`2px solid ${h.semantic.warning}`,outlineOffset:-2}:{}}}),t.playState==="paused"&&s.jsx("div",{"data-testid":"game-paused-notice",style:{position:"absolute",left:"50%",top:12,transform:"translateX(-50%)",padding:"6px 12px",borderRadius:6,background:"rgba(0,0,0,.72)",color:h.content.primary,fontSize:12,letterSpacing:".04em",pointerEvents:"none",zIndex:2},children:"Paused by the editor — press ▶ Play to resume (Escape pauses)"})]})}const To="workspace.service";function zo(){return oe().workspace.liveDocument.register({Content:es,Toolbar:Zn})}export{To as point,zo as start};
1
+ import{l2 as ht,l3 as be,l4 as gt,df as vt,U as K,l5 as xt,l6 as we,l7 as yt,l8 as Se,a6 as L,a7 as ue,l9 as bt,la as wt,bA as Y,bB as G,lb as St,lc as jt,ab as de,ld as Et,aL as $e,le as Mt,lf as It,ez as Te,aC as ze,g4 as Rt,g5 as Ct,g6 as Dt,g7 as Pt,r as oe,al as h,Z as At,gQ as Ft,gR as je,gT as _t,fA as kt,eJ as Ne,lg as $t,bC as Tt,lh as zt,p as Oe}from"./index-ClgrFOcX.js";import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{r as i}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{u as Nt,d as Ot,c as Gt}from"./frame-debugger-store-DwDC0wAm.js";import{m as Vt}from"./audio-meter-Cddyq1vI.js";import{p as Ge}from"./utility-view-state-ghWXsYXq.js";import{P as Lt}from"./PlayBar-CAarfEOh.js";import{a as Ee,r as Bt,f as Ht,R as Ut}from"./presentation-DPfnCjNA.js";import{setUserData as Ve}from"./user-data-CODoGZqA.js";import{I as pe,J as Wt,K as ne,L as qt,M as Le,O as Be,P as He,Q as Ue,w as Kt,x as Xt,R as me,v as J,S as Jt,T as Qt,U as Yt,V as se,W as We,X as Me,Y as qe,Z as Zt,_ as Ke,a as en,$ as tn,a0 as Ie,a1 as nn,b as Xe,a2 as sn}from"./game-network-Deo8lcPw.js";import{aq as on,cp as Je,aI as rn,bX as an,ey as ln,bh as fe,co as Re,s as cn,fo as U,bV as un,N as Qe,M as Ce,dg as dn,df as pn}from"./three.core-3arARmh6.js";import{e as mn,S as fn}from"./surface-state-b_H4iOCJ.js";import{d as hn}from"./surface-content-Dg9Kkazf.js";import{a as gn,R as Ye}from"./active-ingest-CJ2U5L1O.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./configurations-8qaUqMH7.js";import"./run-selection-CNsOQTEG.js";import"./ingest-source-persistence-CVU1rTj0.js";import"./capability-coverage-EnZ99FoT.js";import"./game-contract-seams-C22a4B79.js";import"./object-marks-BnvSuCTt.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-iX2-V5kg.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B2THKz1v.js";import"./contract-system-adapters-BDUpDoKd.js";import"./seeded-random-B6zqGkWP.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./three.module-BLhyNg0e.js";import"./index-DzuOGwVB.js";import"./live-project-verbs-Bqmxbr2o.js";import"./edit-mode-authoring-BDgZD47j.js";import"./json-history-resource-CDEoQe1R.js";import"./binding-resolver-DoOAFM2m.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CqjVBanw.js";import"./canvas-entry-runtime-CLOuJcgT.js";import"./three-ingest-runtime-x9nLmUl-.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"./pixi-story-model-DNkfnWUV.js";import"./viewport-root-presentation-CKqhX3mt.js";import"./mounted-authoring-B697dYuN.js";import"./entity-object-BLJ-I8XT.js";import"./user-data-DL6HsBPf.js";import"./workspace-arrangement-86_8Kk5K.js";import"./three-contract-Dkt6PmWY.js";import"./three-DWy0sZom.js";import"./editor-layers-DwaX5UFy.js";import"./component-instance-root-wO1p-rLr.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-9LcUBPaU.js";import"./source-persistence-backend-Cwy93SmQ.js";import"./three-projection-core-IUovHgg_.js";import"./body-marks-C1LxJtQb.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-DuG97FR9.js";import"./deferred-ingest-play-To3ZratW.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-Dq8NqvWu.js";import"./board-guides-CCiyx8cT.js";import"./relative-import-specifier-CA9mSNXO.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BunjdqX7.js";import"./inference-diagnostics-BmZ5ggEK.js";import"./writer-tw6EcuVO.js";import"./three-state-_ImCbP87.js";import"./editor-shell-store-aKHbAoCV.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-BV_lf5uK.js";import"./game-surface-defaults-D8S4cRxi.js";const Ze=8,re=1e3/60;function vn(e,t=Ze){return!(e>0)||t<=0?0:Math.min(t,Math.max(1,Math.round(Vt(e)/100*t)))}function De(e,t){const n=e.filter(a=>a.id>t),r=n.at(-1)?.id??t,o=n.map(a=>a.intervalMs).filter(a=>Number.isFinite(a)&&a>0).sort((a,m)=>a-m);if(o.length===0)return{frameId:r,intervalMs:null};const l=Math.floor((o.length-1)*.95);return{frameId:r,intervalMs:o[l]??null}}function xn(e){const t=e.slice(-3);return t.slice(-2).length===2&&t.slice(-2).every(n=>n>=50)?"danger":t.length===3&&t.every(n=>n>re*1.05)?"warning":"normal"}function yn(e,t,n,r=50){if(e.length===0||t<=0||n<=0)return"";const o=Math.max(1,e.length-1);return e.map((l,a)=>{const m=a/o*t,d=Math.min(1,Math.max(0,l/r)),g=n-d*n;return`${m.toFixed(1)},${g.toFixed(1)}`}).join(" ")}const et="muted",Pe={enabled:!1,recording:!1,fps:0,cpuMs:0,p95Ms:0,p99Ms:0,frames:[],phases:[],systems:[],components:[],render:{gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:0}};function Ae(){return St(et)===!0}function bn(e){jt(et,e)}function wn(e,t){const n=t.find(o=>o.id==="master")?.level;if(!e.isMuted()&&n!==void 0)return n;const r=t.filter(o=>o.id!=="master").map(o=>o.level);return r.length>0?Math.max(...r):n??0}function Sn(){const e=K();i.useSyncExternalStore(e.subscribe,e.getShellSnapshot??e.getSnapshot);const t=e.playState==="playing",[n,r]=i.useState(!1),[o,l]=i.useState(0),[a,m]=i.useState(!1),[d,g]=i.useState(!1),[u,T]=i.useState(Ae),R=i.useRef(Ae()),E=i.useRef(new WeakMap),y=i.useRef(null),C=i.useSyncExternalStore(xt,we,we),v=yt();i.useEffect(()=>{const p=R.current||!t;for(const f of Se())E.current.get(f)!==p&&(f.setMuted(p),E.current.set(f,p))},[C,t]),i.useEffect(()=>{if(!v){l(0),m(!1),g(!1);return}const p=v.acquireMeters?.()??null;g(p!==null);const f=()=>{m(v.isMuted()),l(p?wn(v,p.read()):0)};f();const A=setInterval(f,100);return()=>{clearInterval(A),p?.dispose()}},[v]);const M=()=>{const p=!R.current,f=p||!t;for(const A of Se())A.resume?.(),A.setMuted(f),E.current.set(A,f);R.current=p,T(p),bn(p),m(f)},D=vn(o),z=v&&a&&!u&&!t?" (not playing)":"",P=v?a?"Audio muted":o>0?"Audio playing":"Audio quiet":"Audio unavailable";return s.jsxs("div",{className:"volter-header-audio","data-muted":a||void 0,"data-available":!!v,children:[s.jsxs(L,{ref:y,type:"button",variant:"ghost",size:"compact",className:"volter-header-telemetry-button","data-testid":"header-audio-telemetry","aria-label":`${P}; open audio controls`,"aria-haspopup":"menu","aria-expanded":n,title:`${P}${z}${d?"":" · level metering unavailable"}`,onClick:()=>r(p=>!p),children:[s.jsx(ue,{icon:a?bt:wt,size:"sm"}),s.jsx("span",{className:"volter-audio-vu","aria-hidden":"true",children:Array.from({length:Ze},(p,f)=>s.jsx("i",{"data-filled":f<D||void 0},f))})]}),n&&s.jsx(Y,{anchorRef:y,onDismiss:()=>r(!1),gap:3,children:s.jsx(G,{onClick:()=>{M(),r(!1)},children:u?"Unmute audio":"Mute audio"})})]})}function jn(){const e=Nt(),t=e?.profiler??null,[n,r]=i.useState(Pe),[o,l]=i.useState([]);i.useEffect(()=>{if(!t){r(Pe),l([]);return}const R=t.telemetryEnabled;t.telemetryEnabled=!0;const E=t.getSnapshot(),y=De(E.frames,0);let C=y.frameId;r(E),l(y.intervalMs===null?[]:[y.intervalMs]);let v=null;const M=()=>{v=null;const z=t.getSnapshot(),P=De(z.frames,C);C=P.frameId,r(z);const p=P.intervalMs;p!==null&&l(f=>[...f,p].slice(-24))},D=t.subscribe(()=>{v===null&&(v=setTimeout(M,500))});return()=>{D(),v!==null&&clearTimeout(v),R||(t.telemetryEnabled=!1)}},[t]);const a=o.at(-1)??null,m=yn(o,72,18),d=a?Math.round(1e3/a):n.fps>0?Math.round(n.fps):null,g=a??(n.fps>0?1e3/n.fps:null),u=xn(o),T=e?`${e.label}: ${d??"—"} FPS · ${g?.toFixed(1)??"—"} ms frame time · open Profiler`:"The active document has no live render loop to profile";return s.jsxs(L,{type:"button",variant:"ghost",size:"compact",className:"volter-header-telemetry-button volter-header-performance","data-testid":"header-performance-telemetry","data-performance-tone":u,disabled:!e,"aria-label":T,title:T,onClick:()=>Ge.open("profiler"),children:[s.jsxs("svg",{className:"volter-performance-graph","aria-hidden":"true",viewBox:"0 0 72 18",width:"72",height:"18",children:[s.jsx("line",{className:"volter-performance-budget",x1:"0",x2:"72",y1:18-re/50*18,y2:18-re/50*18}),m&&s.jsx("polyline",{className:"volter-performance-sparkline",points:m})]}),s.jsxs("span",{className:"volter-performance-readout",children:[s.jsxs("strong",{className:"volter-header-fps",children:[d??"—"," FPS"]}),s.jsxs("span",{className:"volter-header-frame-ms",children:[g?.toFixed(1)??"—"," ms"]})]})]})}function En(){return i.useSyncExternalStore(ht,be,be),gt().telemetry==="hidden"?null:s.jsxs(vt,{className:"volter-header-telemetry volter-chrome-island volter-glass-island","data-island-scale":"compact",align:"center",gap:1,children:[s.jsx(Sn,{}),s.jsx(jn,{})]})}let Q=!1,ie=0,w=null,N=null;const Mn=new on(1,1,1,16,1,!0),In=new Je({color:2280686,transparent:!0,opacity:.45,side:rn,depthWrite:!1}),Rn=new an({color:16755200,transparent:!0,opacity:.9}),Cn=new ln(.12,12,8),Dn=new Je({color:16755200,depthWrite:!1}),Pn=16724804,An=2280686;let $=[];function Fe(){return Q}function Fn(e){e!==Q&&(Q=e,e?ie=requestAnimationFrame(tt):(cancelAnimationFrame(ie),$n()))}function tt(){if(!Q)return;ie=requestAnimationFrame(tt);const e=pe(),t=e?de().navigation?.crowdAgents?.()??[]:[];if(e!==N&&(N&&w&&N.remove(w),N=e,e&&(w||(w=new fe,w.name="crowd-debug-draw",Ve(w,"editorHelper",!0)),e.add(w))),!(!w||!e)){_n(w,t.length);for(let n=0;n<t.length;n++)kn($[n],t[n])}}function _n(e,t){for(;$.length<t;){const n=new fe,r=In.clone(),o=new Re(Mn,r),l=new cn(new U(1,0,0),new U,1,16755200),a=new un(new Qe,Rn),m=new Re(Cn,Dn);n.add(o),n.add(l),e.add(n),e.add(a),e.add(m),$.push({root:n,cylinder:o,cylinderMaterial:r,arrow:l,path:a,target:m})}for(;$.length>t;){const n=$.pop();e.remove(n.root),e.remove(n.path),e.remove(n.target),n.arrow.dispose(),n.path.geometry.dispose(),n.cylinderMaterial.dispose()}}function kn(e,t){e.root.position.set(t.position.x,t.position.y,t.position.z),e.cylinder.scale.set(t.radius,t.height,t.radius),e.cylinder.position.y=t.height/2,e.cylinderMaterial.color.setHex(t.state==="invalid"?Pn:An);const n=t.corners??[];n.length>0?(e.path.visible=!0,e.path.geometry.setFromPoints([new U(t.position.x,t.position.y+.05,t.position.z),...n.map(o=>new U(o.x,o.y+.05,o.z))])):e.path.visible=!1,t.target&&n.length>0?(e.target.visible=!0,e.target.position.set(t.target.x,t.target.y+.05,t.target.z)):e.target.visible=!1;const r=Math.hypot(t.velocity.x,t.velocity.y,t.velocity.z);r>.01?(e.arrow.visible=!0,e.arrow.position.y=t.height/2,e.arrow.setDirection(new U(t.velocity.x/r,t.velocity.y/r,t.velocity.z/r)),e.arrow.setLength(Math.max(r*.5,.2))):e.arrow.visible=!1}function $n(){if(w){N?.remove(w);for(const e of $)e.arrow.dispose();w.clear()}$=[],w=null,N=null}function Tn({onPresetChange:e}){const[t,n]=i.useState(!1),r=i.useRef(null),o=Le(),l=o.kind==="fit";return s.jsxs("div",{className:"volter-playbar-popover-anchor",children:[s.jsxs(L,{ref:r,variant:"ghost",size:"comfortable","aria-haspopup":"menu","aria-expanded":t,"aria-controls":t?"volter-device-preset-menu":void 0,"data-testid":"device-preset-picker",onClick:()=>n(a=>!a),title:"Device preview — constrain the game to a device resolution + DPR. Phone/tablet presets show the safe area, set --volter-safe-area-inset-top/right/bottom/left CSS vars on the game mount, and send mouse input as touch.",children:[s.jsx(ue,{icon:Et,size:"md"}),s.jsx($e,{variant:"code",children:l?"Device":`${o.width}×${o.height}`})]}),t&&s.jsxs(Y,{id:"volter-device-preset-menu",anchorRef:r,className:"volter-resolution-menu",gap:4,onDismiss:()=>n(!1),children:[Wt.map(a=>s.jsx(G,{role:"menuitemradio","aria-checked":a.id===o.id,"data-testid":`device-preset-${a.id}`,onSelect:()=>{e(a),n(!1)},children:a.label},a.id)),s.jsxs(G,{role:"menuitemcheckbox","aria-checked":ne(),"data-testid":"device-touch-toggle",onSelect:()=>qt(!ne()),children:[ne()?"✓ ":" ","Pointer as touch"]})]})]})}function zn(){const e=Mt(()=>It()??null),n=Ot(e)?.capture===!0;return s.jsx(L,{type:"button",size:"compact",variant:"ghost","data-testid":"game-capture-frame",className:"volter-frame-capture-game-button",disabled:!n,title:n?"Capture one rendered frame and open the Frame debugger":"No render-debug adapter registered for this world — frame capture is unavailable",onClick:()=>{Gt(e),Ge.open("frame")},children:"Capture frame"})}let nt={label:"Fill",width:null,height:null},ae=1,st=0;const le=new Set;function V(){st++;for(const e of le)e()}function ot(e){return le.add(e),()=>{le.delete(e)}}const rt=()=>st;function it(){return nt}function at(e){nt=e,V()}function lt(e,t){return e.width!==null||!t?e:{label:`Project — ${t.width}×${t.height}`,width:t.width,height:t.height}}function Nn(e){return e?[lt({label:"Fill",width:null,height:null},e),...Ee.filter(t=>t.width!==null)]:Ee}function ct(e){Be(e.id),at(e.width===null||e.height===null?{label:"Fill",width:null,height:null}:{label:e.label,width:e.width,height:e.height})}function On(e){e!==ae&&(ae=e,V())}function Gn(){return ae}function ut(e){return Array.from(e.children).filter(t=>t.dataset?.volterRootSurface==="true")}function Vn(e,t,n){for(const r of t)r.contains(e)||e.appendChild(r);if(n)for(const r of ut(n))e.appendChild(r)}function Ln({name:e}){return s.jsx("div",{"data-testid":"game-instance-name",style:{flex:"0 0 auto",padding:"3px 10px",background:h.surface.chrome,color:h.content.primary,borderBottom:`1px solid ${h.boundary.default}`,fontSize:11,fontWeight:600,userSelect:"none"},children:e})}function dt({name:e,testId:t,borderLeft:n,focused:r,onFocus:o,children:l}){return s.jsxs("div",{"data-testid":t,"data-focused":r||void 0,onPointerDownCapture:o,style:{flex:1,minWidth:0,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",cursor:o&&!r?"pointer":void 0,...n?{borderLeft:`1px solid ${h.boundary.default}`}:{}},children:[s.jsx(Ln,{name:e}),s.jsx("div",{style:{flex:1,minHeight:0,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:l}),r&&s.jsx("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:40,border:`2px solid ${h.accent.default}`,boxShadow:`inset 0 0 0 1px ${h.accent.default}`}})]})}function Bn({index:e}){const t=i.useRef(null),n=qe(e+1),r=i.useSyncExternalStore(Ke,en),[o,l]=i.useState(null),a=i.useSyncExternalStore(me,J);return i.useEffect(()=>{const m=t.current;if(!m||!r)return;let d=null,g=!1;return tn(m,n).then(u=>{g?Ie(u):(d=u,l(u))},u=>{At.error(`Failed to mount ${n}: ${u}`,"play-mode")}),()=>{g=!0,l(null),d&&Ie(d)}},[e,r]),s.jsx(dt,{name:n,testId:`game-instance-slot-${e+1}`,borderLeft:!0,focused:o!=null&&a===o,onFocus:o?()=>We(o):void 0,children:s.jsx("div",{ref:t,"data-volter-instance-viewport":"",style:{position:"absolute",inset:0}})})}function Hn({style:e}){const t=i.useSyncExternalStore(Te,ze),r=K().playState!=="stopped",o=i.useRef(null);i.useSyncExternalStore(ot,rt),i.useSyncExternalStore(He,Ue);const l=i.useSyncExternalStore(Kt,Xt),a=l>0,m=i.useSyncExternalStore(me,J),d=Le(),g=it(),[u,T]=i.useState({width:0,height:0}),[R,E]=i.useState(0),y=i.useRef(null),C=i.useSyncExternalStore(Rt,Ct),v=i.useSyncExternalStore(Dt,Pt),M=Zt(),D=gn(),z=M.length>0?M.map(c=>c.rootId):D?[D.worldId]:C.filter(c=>c.mechanism==="host-mount").map(c=>c.rootId),P=!!(y.current&&hn(y.current)),p=M.length>0?M.some(c=>c.hasRenderableContent):P,f=M.length>0||D!==null,A=r?mn({surface:"Game",rootIds:z,phase:f?"ready":"loading",content:f?p?"present":"empty":"unknown",readiness:C,failures:v}):null;i.useEffect(()=>{if(!r||!f||p)return;const c=window.setTimeout(()=>E(x=>x+1),250);return()=>window.clearTimeout(c)},[R,p,r,f]),i.useEffect(()=>{const c=o.current;if(!c||typeof MutationObserver>"u")return;const x=new MutationObserver(()=>E(I=>I+1));return x.observe(c,{childList:!0,subtree:!0,characterData:!0}),()=>x.disconnect()},[]),i.useEffect(()=>{const c=Jt();c.width!==null&&(ct(c),V())},[]);const Z=i.useRef([]),he=i.useCallback(c=>{if(c===y.current)return;!c&&y.current&&(Z.current=ut(y.current)),c&&(Vn(c,Z.current,y.current),Z.current=[]);const x=y.current;y.current=c,c?oe().workspace.liveDocument.setContainer(c):x&&oe().workspace.liveDocument.releaseContainer(x),c?Qt(c):x&&Yt(x)},[]);i.useEffect(()=>{const c=o.current;if(!c)return;const x=new ResizeObserver(([I])=>{if(!I)return;const{width:X,height:ye}=I.contentRect;T(te=>te.width===X&&te.height===ye?te:{width:X,height:ye})});return x.observe(c),()=>x.disconnect()},[]);const mt=t?.config.resolution,F=Bt(g,mt),ge=F.kind==="fill",ft=ge||a,B=F.kind==="logical"?F.width:null,H=F.kind==="logical"?F.height:null,ve=d.dpr;i.useEffect(()=>{const c=ve??nn();a?u.width>0&&u.height>0&&se(u.width/(l+1),u.height,c):B===null||H===null?u.width>0&&u.height>0&&se(u.width,u.height,c):se(B,H,c)},[B,H,u.width,u.height,ve,r,a,l]);const ee=Ht(u,{width:B??0,height:H??0},{allowUpscale:F.kind==="logical"&&F.allowUpscale}),_=ge?1:ee.scale;i.useEffect(()=>{On(_)},[_]);const b=d.safeArea,xe={"--volter-safe-area-inset-top":`${b?.top??0}px`,"--volter-safe-area-inset-right":`${b?.right??0}px`,"--volter-safe-area-inset-bottom":`${b?.bottom??0}px`,"--volter-safe-area-inset-left":`${b?.left??0}px`};return s.jsx("div",{style:{overflow:"hidden",position:"relative",flexDirection:"column",...e},children:s.jsxs("div",{ref:o,style:{flex:1,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:[(()=>{const c=ft?s.jsx("div",{ref:he,"data-testid":"game-runtime-container","aria-hidden":"true",style:{position:"absolute",inset:0,...r?{}:{visibility:"hidden"},...xe}},"game-mount-fill"):s.jsxs("div",{style:{position:"relative",width:ee.width,height:ee.height,overflow:"hidden",...r?{}:{visibility:"hidden"}},children:[s.jsx("div",{ref:he,"data-testid":"game-runtime-container","aria-hidden":"true",style:{width:B??0,height:H??0,transformOrigin:"top left",transform:`scale(${_})`,...xe}}),b&&s.jsx("div",{"data-testid":"device-safe-area-overlay",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:2},children:[["top",b.top,{top:0,left:0,right:0,height:b.top*_}],["bottom",b.bottom,{bottom:0,left:0,right:0,height:b.bottom*_}],["left",b.left,{top:0,bottom:0,left:0,width:b.left*_}],["right",b.right,{top:0,bottom:0,right:0,width:b.right*_}]].map(([x,I,X])=>I>0?s.jsx("div",{"data-testid":`device-safe-area-${x}`,style:{position:"absolute",...X,background:h.semantic.dangerFaint,boxShadow:`inset 0 0 0 1px ${h.semantic.dangerMuted}`}},x):null)})]},"game-mount-device");return a?s.jsxs(s.Fragment,{children:[s.jsx(dt,{name:qe(0),testId:"game-instance-slot-0",focused:m===Me(),onFocus:()=>We(Me()),children:c}),Array.from({length:l},(x,I)=>s.jsx(Bn,{index:I},I))]}):c})(),!r&&s.jsxs("div",{"data-testid":"game-stopped-placeholder",style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,background:h.surface.shell,color:h.content.dim,fontSize:11,pointerEvents:"none"},children:[s.jsx("span",{style:{color:h.content.primary,fontSize:13},children:"Game is stopped"}),s.jsx("span",{children:"Press Play to start the composed runtime."})]}),r&&s.jsx(fn,{explanation:A,testId:"game-surface-status",style:{zIndex:30,background:h.surface.shell}})]})})}function _e(){return Xe().map(({id:e,name:t})=>`${e}\0${t}`).join("")}function Un({instanceId:e}){const t=K();i.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);const n=i.useSyncExternalStore(me,J,J),[,r]=i.useState(0);i.useEffect(()=>{const g=window.setInterval(()=>r(u=>u+1),250);return()=>window.clearInterval(g)},[]);const o=Ye(e),l=zt(),a=o?(o.loop.activeTimeouts??0)+(o.loop.activeIntervals??0)+(o.loop.activeAnimationFrames??0)+o.loop.pending:0,m=o?o.listeners.window+o.listeners.document:0,d=[["Mount",e],["Simulation",t.playState==="paused"?"Paused":"Running"],["Input",n===e?"Keyboard focus":"Inactive"],["Input events",o?`${o.loop.input??0} observed · ${o.loop.inputBlocked??0} blocked`:"Not measured"],["Network",l?l.getConnectionState?.()??"Not reported by this adapter":"Not registered"],["Owned callbacks",String(a)],["Owned listeners",String(m)],["Realm globals",String(o?.globals??0)],["Browser storage",o?`Shared origin · ${o.storage.local.reads+o.storage.session.reads} reads · ${o.storage.local.writes+o.storage.session.writes} writes`:"Shared origin"]];return s.jsx("div",{role:"none",style:{display:"grid",gridTemplateColumns:"112px minmax(120px, 1fr)",gap:"4px 12px",padding:"8px 10px",fontSize:10,lineHeight:"15px"},children:d.map(([g,u])=>s.jsxs("div",{style:{display:"contents"},children:[s.jsx("span",{style:{color:h.content.dim},children:g}),s.jsx("span",{style:{color:h.content.primary,fontFamily:g==="Mount"?h.typography.mono:void 0,overflow:"hidden",textOverflow:"ellipsis"},children:u})]},g))})}function Wn(){i.useSyncExternalStore(Ke,_e,_e),i.useSyncExternalStore(Ft,je,je);const e=Xe(),t=_t(),n=e.find(d=>d.id===t)??e[0],[r,o]=i.useState(!1),l=i.useRef(null);if(e.length<2||!n)return null;const m=(Ye(n.id)?.loop.firedWhileHeld??0)>0;return s.jsxs("div",{className:"volter-playbar-popover-anchor",children:[s.jsxs(L,{ref:l,variant:"ghost",size:"compact","aria-haspopup":"menu","aria-expanded":r,onClick:()=>o(d=>!d),title:`Runtime instruments inspect ${n.name}; agent-addressed commands are unchanged`,children:[s.jsx(ue,{icon:kt,size:"sm",style:{color:m?h.semantic.warning:void 0}}),s.jsxs($e,{variant:"code",children:["Inspect ",n.name]}),s.jsx(Ne,{direction:"down"})]}),r&&s.jsxs(Y,{anchorRef:l,gap:3,onDismiss:()=>o(!1),style:{minWidth:270},children:[e.map(d=>s.jsxs(G,{role:"menuitemradio","aria-checked":d.id===n.id,onSelect:()=>$t(d.id),children:[d.id===n.id?"✓ ":" ",d.name]},d.id)),s.jsx(Tt,{}),s.jsx(Un,{instanceId:n.id})]})]})}let q=!1,ce=0,S=null,O=null,W=null,j=null,k=0;function ke(){return q}function qn(e){e!==q&&(q=e,e?ce=requestAnimationFrame(pt):(cancelAnimationFrame(ce),W?.setDebugDrawEnabled?.(!1),Qn()))}function pt(){if(!q)return;ce=requestAnimationFrame(pt);const e=pe(),t=e?Oe(de().physics):null;if(t!==W&&(W?.setDebugDrawEnabled?.(!1),W=t,t?.setDebugDrawEnabled?.(!0)),Kn(e),!S||!e)return;const n=t?.contactPoints?.()??null;Xn(S,n)}function Kn(e){e!==O&&(O&&S&&O.remove(S),O=e,e&&(S||(S=new fe,S.name="physics-debug-draw",Ve(S,"editorHelper",!0)),e.add(S)))}function Xn(e,t){const n=t?t.length/3:0;if(!j){k=64;const l=new Qe;l.setAttribute("position",new Ce(new Float32Array(k*3),3));const a=new dn({color:16724821,size:10,sizeAttenuation:!1,depthTest:!1,transparent:!0,opacity:.95});j=new pn(l,a),j.renderOrder=999,j.frustumCulled=!1,e.add(j)}const r=j.geometry;if(n>k){for(;k<n;)k*=2;r.setAttribute("position",new Ce(new Float32Array(k*3),3))}const o=r.getAttribute("position");t&&n>0&&o.array.set(t),o.needsUpdate=!0,r.setDrawRange(0,n),j.visible=n>0}function Jn(){const e=pe(),n=(e?Oe(de().physics):null)?.debugDraw?.()??null;let r=!1;n&&e&&e.traverse(a=>{a===n&&(r=!0)});const o=n?.geometry.getAttribute("position"),l=j?.geometry.drawRange.count??0;return{enabled:q,wireframeInScene:r,wireframeVisible:n?.visible??!1,wireframeVertexCount:o?.count??0,contactMarkerCount:j?.visible&&Number.isFinite(l)?l:0}}typeof window<"u"&&(window.__volterPhysicsDebug=Jn);function Qn(){S&&(O?.remove(S),j&&(j.geometry.dispose(),j.material.dispose()),S.clear()),j=null,k=0,S=null,O=null,W=null}function Yn(){const[e,t]=i.useState(!1),n=i.useRef(null);return s.jsxs("div",{style:{position:"relative"},children:[s.jsxs(L,{ref:n,type:"button",variant:"outline",size:"compact","data-testid":"game-debug-menu","aria-haspopup":"menu","aria-expanded":e,"aria-controls":e?"volter-game-debug-menu":void 0,onClick:()=>t(r=>!r),children:[s.jsx("span",{children:"Debug"}),s.jsx(Ne,{direction:"down"})]}),e&&s.jsxs(Y,{id:"volter-game-debug-menu",anchorRef:n,gap:3,onDismiss:()=>t(!1),style:{minWidth:190},children:[s.jsxs(G,{onClick:()=>{Fn(!Fe()),V()},children:[Fe()?"✓ ":" ","Crowd debug draw"]}),s.jsxs(G,{onClick:()=>{qn(!ke()),V()},children:[ke()?"✓ ":" ","Physics debug draw"]})]})]})}function Zn(e){const t=i.useSyncExternalStore(Te,ze),n=K();return i.useSyncExternalStore(n.subscribe,n.getShellSnapshot??n.getSnapshot),i.useSyncExternalStore(ot,rt),i.useSyncExternalStore(He,Ue),s.jsxs("div",{"data-testid":"game-doc-toolbar",style:{display:"grid",alignItems:"center",gridTemplateColumns:"minmax(0, 1fr) auto minmax(0, 1fr)",width:"100%",gap:6,padding:"2px 8px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",minWidth:0,overflow:"auto"},children:[s.jsx(Wn,{}),s.jsx(Tn,{onPresetChange:r=>{ct(r),V()}}),s.jsx(Ut,{resolution:lt(it(),t?.config.resolution),options:Nn(t?.config.resolution),onResolutionChange:r=>{Be(sn),at(r)},scale:Gn(),title:"Change game resolution"}),s.jsx(Yn,{}),n.playState!=="stopped"&&s.jsx(zn,{})]}),s.jsx(Lt,{placement:"runtime"}),s.jsx("div",{style:{display:"flex",justifyContent:"flex-end",minWidth:0},children:s.jsx(En,{})})]})}function es(e){const t=K();i.useSyncExternalStore(t.subscribe,t.getShellSnapshot??t.getSnapshot);const n=t.playState!=="stopped";return s.jsxs("div",{style:{flex:1,position:"relative",display:"flex",flexDirection:"column"},children:[s.jsx(Hn,{style:{flex:1,position:"relative",display:"flex",flexDirection:"column",pointerEvents:"auto",...t.playState==="playing"?{outline:`2px solid ${h.semantic.success}`,outlineOffset:-2}:n?{outline:`2px solid ${h.semantic.warning}`,outlineOffset:-2}:{}}}),t.playState==="paused"&&s.jsx("div",{"data-testid":"game-paused-notice",style:{position:"absolute",left:"50%",top:12,transform:"translateX(-50%)",padding:"6px 12px",borderRadius:6,background:"rgba(0,0,0,.72)",color:h.content.primary,fontSize:12,letterSpacing:".04em",pointerEvents:"none",zIndex:2},children:"Paused by the editor — press ▶ Play to resume (Escape pauses)"})]})}const To="workspace.service";function zo(){return oe().workspace.liveDocument.register({Content:es,Toolbar:Zn})}export{To as point,zo as start};
@@ -1,2 +1,2 @@
1
- import{createGameModuleResolver as k,setFocusedInstanceProvider as M}from"./game-module-access-B2UMV47n.js";import{n as d}from"./command-results-CUQD49AB.js";import{i as g}from"./active-ingest-CmyN258P.js";import{a as y,u as h,v as w}from"./game-network-Bof-cN2R.js";import"./index-Cjv2Ynte.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"./game-contract-seams-CzlxJGC2.js";import"./capability-coverage-BMuTFU_9.js";import"./ingest-source-persistence-BNek6mSi.js";import"./contract-system-adapters-D8SzcuZo.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-BUPFKtBc.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-CcTdmLf3.js";import"./seeded-random-BVi4_fs4.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-DzuOGwVB.js";import"./live-project-verbs-D_8wWaCB.js";import"./edit-mode-authoring-CIXoejcH.js";import"./json-history-resource-C1pGwXuI.js";import"./binding-resolver-4nTdtOpk.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CbgTofeT.js";import"./canvas-entry-runtime-CgJkCzp_.js";import"./three-ingest-runtime-BPTa3ryG.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"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-Co7zteuS.js";import"./mounted-authoring-DQ0-LgR6.js";import"./entity-object-C6hm5vYx.js";import"./user-data-DxeJHxTz.js";import"./workspace-arrangement-Bq8u7HUK.js";import"./three-contract-Dkt6PmWY.js";import"./three-CAVY58Dv.js";import"./editor-layers-CYVQVJ5O.js";import"./component-instance-root-Ctbx3vOO.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BDMrB8fC.js";import"./source-persistence-backend-BMbXR_WB.js";import"./three-projection-core-BnoDtdZY.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-BRcBDERW.js";import"./deferred-ingest-play-DsV_qXEP.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CTCp7U6C.js";import"./board-guides-Cnfvv0uu.js";import"./relative-import-specifier-CPSPKQKY.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-xUKvX80V.js";import"./inference-diagnostics-DE1P5w14.js";import"./writer-tw6EcuVO.js";import"./three-state-_BZo8PPs.js";import"./editor-shell-store-B76wIXvV.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-CTspfOX-.js";import"./game-surface-defaults-D8S4cRxi.js";class E extends Error{member;supported;constructor(e,r,o){super(`playwright-shim: ${e}.${r} is not supported by the in-page shim. Supported ${e} members: ${o.join(", ")}. This shim is DOM-only — canvas gameplay input must use game.input.*, while React-only DOM games may use Page keyboard/locator input. See packages/editor-game/src/host/playwright-shim.ts for the full supported subset and the wire's closure-capture limitation.`),this.name="PageShimUnsupportedError",this.member=r,this.supported=o}}function v(t,e){const r=Object.keys(t);return new Proxy(t,{get(o,i,n){if(typeof i=="symbol"||i in o)return Reflect.get(o,i,n);throw new E(e,i,r)}})}function m(t){return t.replace(/\s+/g," ").trim()}function O(t){const e=t.tagName.toLowerCase();if(e==="button")return"button";if(e==="a"&&t.hasAttribute("href"))return"link";if(/^h[1-6]$/.test(e))return"heading";if(e==="textarea")return"textbox";if(e==="select")return"combobox";if(e==="img")return"img";if(e==="input"){const r=(t.getAttribute("type")??"text").toLowerCase();return r==="button"||r==="submit"||r==="reset"?"button":r==="checkbox"?"checkbox":r==="radio"?"radio":"textbox"}return null}function b(t){return t.getAttribute("role")??O(t)}function S(t){const e=t.getAttribute("aria-label");return e&&e.trim()?m(e):m(t.textContent??"")}function T(t,e){if(e===void 0)return!0;const r=S(t);return e instanceof RegExp?e.test(r):r===e}function x(t,e,r){return Array.from(t.querySelectorAll("*")).filter(i=>b(i)===e&&T(i,r?.name))}function I(t,e){const r=Array.from(t.querySelectorAll("*")).filter(n=>n.tagName!=="SCRIPT"&&n.tagName!=="STYLE"),o=n=>{const s=m(n.textContent??"");return s.length===0?!1:e instanceof RegExp?e.test(s):s.includes(e)},i=r.filter(o);return i.filter(n=>!i.some(s=>s!==n&&n.contains(s)))}function C(t,e){return Array.from(t.querySelectorAll("[data-testid]")).filter(r=>{const o=r.getAttribute("data-testid")??"";return e instanceof RegExp?e.test(o):o===e})}function L(t){if(!(t instanceof HTMLElement))return!0;if(t.hidden)return!1;const e=getComputedStyle(t);return e.display!=="none"&&e.visibility!=="hidden"&&e.opacity!=="0"}function _(t){const e=t.getBoundingClientRect?.()??{left:0,top:0,width:0,height:0},r=e.left+e.width/2,o=e.top+e.height/2,i={bubbles:!0,cancelable:!0,clientX:r,clientY:o,button:0};typeof PointerEvent<"u"&&t.dispatchEvent(new PointerEvent("pointerdown",{...i,pointerId:1,isPrimary:!0})),t.dispatchEvent(new MouseEvent("mousedown",i)),typeof PointerEvent<"u"&&t.dispatchEvent(new PointerEvent("pointerup",{...i,pointerId:1,isPrimary:!0})),t.dispatchEvent(new MouseEvent("mouseup",i)),t.dispatchEvent(new MouseEvent("click",i))}function N(t){const e=t instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(e,"value");return o=>{r?.set?r.set.call(t,o):t.value=o}}function G(t,e){if(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLTextAreaElement))throw new Error(`playwright-shim: fill() target is not an <input>/<textarea> (got <${t.tagName.toLowerCase()}>)`);t.focus(),N(t)(e),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))}const l=new Set(["Alt","Control","Meta","Shift"]);function p(t){return t!=="ControlOrMeta"?t:/Mac|iPhone|iPad/.test(navigator.platform)?"Meta":"Control"}function B(t){return/^[a-z]$/i.test(t)?`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?`Digit${t}`:t===" "?"Space":t}function K(t){const e=document.activeElement;return e instanceof HTMLElement&&t.contains(e)?e:t}function f(t,e,r,o){K(t).dispatchEvent(new KeyboardEvent(e,{key:r,code:B(r),bubbles:!0,cancelable:!0,altKey:o.has("Alt"),ctrlKey:o.has("Control"),metaKey:o.has("Meta"),shiftKey:o.has("Shift")}))}function F(t){const e=new Set,r=async i=>{const n=p(i);e.add(n),f(t,"keydown",n,e)},o=async i=>{const n=p(i);f(t,"keyup",n,e),e.delete(n)};return{down:r,up:o,async press(i){const n=i.split("+").map(p),s=n.filter(c=>l.has(c)),a=n.find(c=>!l.has(c));for(const c of s)await r(c);a&&(await r(a),await o(a));for(const c of s.reverse())await o(c)}}}function R(t){const e=[];function r(o,i){const n=b(o);if(n){const a=S(o);e.push(`${" ".repeat(i)}- ${n}${a?` "${a}"`:""}`)}const s=n?i+1:i;for(const a of Array.from(o.children))r(a,s)}for(const o of Array.from(t.children))r(o,0);return e.join(`
1
+ import{createGameModuleResolver as k,setFocusedInstanceProvider as M}from"./game-module-access-BI6oBa8Y.js";import{n as d}from"./command-results-CUQD49AB.js";import{i as g}from"./active-ingest-CJ2U5L1O.js";import{a as y,u as h,v as w}from"./game-network-Deo8lcPw.js";import"./index-ClgrFOcX.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"./game-contract-seams-C22a4B79.js";import"./capability-coverage-EnZ99FoT.js";import"./ingest-source-persistence-CVU1rTj0.js";import"./contract-system-adapters-BDUpDoKd.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-iX2-V5kg.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B2THKz1v.js";import"./seeded-random-B6zqGkWP.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-DzuOGwVB.js";import"./live-project-verbs-Bqmxbr2o.js";import"./edit-mode-authoring-BDgZD47j.js";import"./json-history-resource-CDEoQe1R.js";import"./binding-resolver-DoOAFM2m.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CqjVBanw.js";import"./canvas-entry-runtime-CLOuJcgT.js";import"./three-ingest-runtime-x9nLmUl-.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"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CKqhX3mt.js";import"./mounted-authoring-B697dYuN.js";import"./entity-object-BLJ-I8XT.js";import"./user-data-DL6HsBPf.js";import"./workspace-arrangement-86_8Kk5K.js";import"./three-contract-Dkt6PmWY.js";import"./three-DWy0sZom.js";import"./editor-layers-DwaX5UFy.js";import"./component-instance-root-wO1p-rLr.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-9LcUBPaU.js";import"./source-persistence-backend-Cwy93SmQ.js";import"./three-projection-core-IUovHgg_.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-DuG97FR9.js";import"./deferred-ingest-play-To3ZratW.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-Dq8NqvWu.js";import"./board-guides-CCiyx8cT.js";import"./relative-import-specifier-CA9mSNXO.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BunjdqX7.js";import"./inference-diagnostics-BmZ5ggEK.js";import"./writer-tw6EcuVO.js";import"./three-state-_ImCbP87.js";import"./editor-shell-store-aKHbAoCV.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-BV_lf5uK.js";import"./game-surface-defaults-D8S4cRxi.js";class E extends Error{member;supported;constructor(e,r,o){super(`playwright-shim: ${e}.${r} is not supported by the in-page shim. Supported ${e} members: ${o.join(", ")}. This shim is DOM-only — canvas gameplay input must use game.input.*, while React-only DOM games may use Page keyboard/locator input. See packages/editor-game/src/host/playwright-shim.ts for the full supported subset and the wire's closure-capture limitation.`),this.name="PageShimUnsupportedError",this.member=r,this.supported=o}}function v(t,e){const r=Object.keys(t);return new Proxy(t,{get(o,i,n){if(typeof i=="symbol"||i in o)return Reflect.get(o,i,n);throw new E(e,i,r)}})}function m(t){return t.replace(/\s+/g," ").trim()}function O(t){const e=t.tagName.toLowerCase();if(e==="button")return"button";if(e==="a"&&t.hasAttribute("href"))return"link";if(/^h[1-6]$/.test(e))return"heading";if(e==="textarea")return"textbox";if(e==="select")return"combobox";if(e==="img")return"img";if(e==="input"){const r=(t.getAttribute("type")??"text").toLowerCase();return r==="button"||r==="submit"||r==="reset"?"button":r==="checkbox"?"checkbox":r==="radio"?"radio":"textbox"}return null}function b(t){return t.getAttribute("role")??O(t)}function S(t){const e=t.getAttribute("aria-label");return e&&e.trim()?m(e):m(t.textContent??"")}function T(t,e){if(e===void 0)return!0;const r=S(t);return e instanceof RegExp?e.test(r):r===e}function x(t,e,r){return Array.from(t.querySelectorAll("*")).filter(i=>b(i)===e&&T(i,r?.name))}function I(t,e){const r=Array.from(t.querySelectorAll("*")).filter(n=>n.tagName!=="SCRIPT"&&n.tagName!=="STYLE"),o=n=>{const s=m(n.textContent??"");return s.length===0?!1:e instanceof RegExp?e.test(s):s.includes(e)},i=r.filter(o);return i.filter(n=>!i.some(s=>s!==n&&n.contains(s)))}function C(t,e){return Array.from(t.querySelectorAll("[data-testid]")).filter(r=>{const o=r.getAttribute("data-testid")??"";return e instanceof RegExp?e.test(o):o===e})}function L(t){if(!(t instanceof HTMLElement))return!0;if(t.hidden)return!1;const e=getComputedStyle(t);return e.display!=="none"&&e.visibility!=="hidden"&&e.opacity!=="0"}function _(t){const e=t.getBoundingClientRect?.()??{left:0,top:0,width:0,height:0},r=e.left+e.width/2,o=e.top+e.height/2,i={bubbles:!0,cancelable:!0,clientX:r,clientY:o,button:0};typeof PointerEvent<"u"&&t.dispatchEvent(new PointerEvent("pointerdown",{...i,pointerId:1,isPrimary:!0})),t.dispatchEvent(new MouseEvent("mousedown",i)),typeof PointerEvent<"u"&&t.dispatchEvent(new PointerEvent("pointerup",{...i,pointerId:1,isPrimary:!0})),t.dispatchEvent(new MouseEvent("mouseup",i)),t.dispatchEvent(new MouseEvent("click",i))}function N(t){const e=t instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(e,"value");return o=>{r?.set?r.set.call(t,o):t.value=o}}function G(t,e){if(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLTextAreaElement))throw new Error(`playwright-shim: fill() target is not an <input>/<textarea> (got <${t.tagName.toLowerCase()}>)`);t.focus(),N(t)(e),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))}const l=new Set(["Alt","Control","Meta","Shift"]);function p(t){return t!=="ControlOrMeta"?t:/Mac|iPhone|iPad/.test(navigator.platform)?"Meta":"Control"}function B(t){return/^[a-z]$/i.test(t)?`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?`Digit${t}`:t===" "?"Space":t}function K(t){const e=document.activeElement;return e instanceof HTMLElement&&t.contains(e)?e:t}function f(t,e,r,o){K(t).dispatchEvent(new KeyboardEvent(e,{key:r,code:B(r),bubbles:!0,cancelable:!0,altKey:o.has("Alt"),ctrlKey:o.has("Control"),metaKey:o.has("Meta"),shiftKey:o.has("Shift")}))}function F(t){const e=new Set,r=async i=>{const n=p(i);e.add(n),f(t,"keydown",n,e)},o=async i=>{const n=p(i);f(t,"keyup",n,e),e.delete(n)};return{down:r,up:o,async press(i){const n=i.split("+").map(p),s=n.filter(c=>l.has(c)),a=n.find(c=>!l.has(c));for(const c of s)await r(c);a&&(await r(a),await o(a));for(const c of s.reverse())await o(c)}}}function R(t){const e=[];function r(o,i){const n=b(o);if(n){const a=S(o);e.push(`${" ".repeat(i)}- ${n}${a?` "${a}"`:""}`)}const s=n?i+1:i;for(const a of Array.from(o.children))r(a,s)}for(const o of Array.from(t.children))r(o,0);return e.join(`
2
2
  `)}function u(t,e){const r=i=>{const n=t()[0];if(!n)throw new Error(`playwright-shim: ${i}() found no element for ${e}`);return n};return v({async click(){_(r("click"))},async fill(i){G(r("fill"),i)},async textContent(){const i=t()[0];return i?i.textContent??null:null},async evaluate(i,n){return i(r("evaluate"),n)},async count(){return t().length},async waitFor(i){const n=i?.timeout??5e3,s=i?.state??"visible",a=Date.now()+n;for(;;){const c=t()[0];if(c&&(s==="attached"||L(c)))return;if(Date.now()>=a)throw new Error(`playwright-shim: waitFor() timed out after ${n}ms waiting for ${e} to be ${s}`);await new Promise(P=>setTimeout(P,50))}},first(){return u(()=>t().slice(0,1),`${e}.first()`)},nth(i){return u(()=>{const n=t()[i];return n?[n]:[]},`${e}.nth(${i})`)},async ariaSnapshot(){return R(r("ariaSnapshot"))}},"Locator")}async function D(t,e){if(typeof t=="function")return t(e);if(typeof t=="string")return new Function("arg",`return (${t})(arg)`)(e);throw new Error("playwright-shim: evaluate() requires a function or a function-source string")}function A(t){const e={keyboard:F(t),evaluate:async(r,o)=>D(r,o),locator:r=>u(()=>Array.from(t.querySelectorAll(r)),`locator(${JSON.stringify(r)})`),getByRole:(r,o)=>u(()=>x(t,r,o),`getByRole(${JSON.stringify(r)}${o?.name!==void 0?`, {name: ${JSON.stringify(String(o.name))}}`:""})`),getByText:r=>u(()=>I(t,r),`getByText(${JSON.stringify(String(r))})`),getByTestId:r=>u(()=>C(t,r),`getByTestId(${JSON.stringify(String(r))})`),click:async r=>{await e.locator(r).click()},fill:async(r,o)=>{await e.locator(r).fill(o)},ariaSnapshot:async()=>R(t)};return v(e,"Page")}const he="workspace.command";typeof window<"u"&&(M(w),window.__volterGameEval=async(t,e)=>{const r=await $({src:t,...e===void 0?{}:{instance:e}});if(!r.ok)throw new Error(r.error??"game-eval failed");return r.data?.result??null});async function $(t){if(!y()&&!g())return d();const e=t.src;if(typeof e!="string")return{ok:!1,error:`game-eval requires a string "src" (the step's toString())`};const r=h();if(!r)return{ok:!1,error:"game-eval: no play-mode game container is mounted yet",data:{code:"GAME_EVAL_ERROR"}};const o=t.instance,i=typeof o=="string"?o:void 0;let n;try{n=new Function("scope",`return (${e})(scope)`)}catch(a){return{ok:!1,error:`game-eval: failed to reconstruct the step function from source — ${a instanceof Error?a.message:String(a)}`,data:{code:"GAME_EVAL_ERROR"}}}const s={page:A(r),modules:k(i),instanceId:i??w()};try{const a=await n(s),c=a===void 0?null:a;try{JSON.stringify(c)}catch{return{ok:!1,error:`game-eval: the step returned an unserializable value (${Object.prototype.toString.call(c)}) — return plain data (numbers, strings, arrays, plain objects), not live module objects.`,data:{code:"GAME_EVAL_UNSERIALIZABLE"}}}return{ok:!0,data:{result:c}}}catch(a){return{ok:!1,error:`game-eval step failed: ${a instanceof Error?a.stack??a.message:String(a)}`,data:{code:"GAME_EVAL_ERROR"}}}}async function H(t){if(!y()&&!g())return d();const e=t.src;if(typeof e!="string")return{ok:!1,error:`page-script requires a string "src" (the step's toString())`};const r=h();if(!r)return{ok:!1,error:"page-script: no play-mode game container is mounted yet",data:{code:"PAGE_SCRIPT_ERROR"}};let o;try{o=new Function("page",`return (${e})(page)`)}catch(n){return{ok:!1,error:`page-script: failed to reconstruct the step function from source — ${n instanceof Error?n.message:String(n)}`,data:{code:"PAGE_SCRIPT_ERROR"}}}const i=A(r);try{const n=await o(i);return{ok:!0,data:{result:n===void 0?null:n}}}catch(n){return n instanceof E?{ok:!1,error:n.message,data:{code:"PAGE_SHIM_UNSUPPORTED",member:n.member,supported:[...n.supported]}}:{ok:!1,error:`page-script: step threw — ${n instanceof Error?n.message:String(n)}`,data:{code:"PAGE_SCRIPT_ERROR"}}}}const we={"game-eval":{timeoutMs:6e4,derivedRefresh:"always",handle:$},"page-script":{timeoutMs:6e4,derivedRefresh:"always",handle:H}};export{we as commands,he as point};
@@ -1 +1 @@
1
- import{K as d}from"./index-Cjv2Ynte.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";const l="volter-mount";let i=null;function u(t){return globalThis.__volterGameModuleUrls?.(t)??[]}function S(t){i=t}function h(t){const o=t.replace(/^\/+/,"");if(!o.startsWith("src/")||/[?#]/.test(o))throw new Error(`modules("${t}"): pass the project-relative served path, starting "src/" with its real extension and no query — e.g. modules("src/sim/host.ts").`);return o}function m(t){const o=u(t).flatMap(r=>{const{pathname:e,searchParams:a}=new URL(r);if(a.get(l)!==t)return[];const s=e.lastIndexOf("/src/");return s===-1?[]:[e.slice(s+1)]});return[...new Set(o)].sort()}function b(t){const o=r=>p(r,w(r,t));return Object.defineProperty(o,"loaded",{enumerable:!0,get:()=>{const r=t??i?.();return r?m(r):[]}}),o}const f=new Set(["then","catch","finally","constructor","toJSON"]);function p(t,o){return new Proxy(o,{get(r,e){if(e==="then"||e==="catch"||e==="finally")return Reflect.get(r,e).bind(r);if(typeof e=="symbol"||f.has(e))return Reflect.get(r,e);throw new Error(`modules("${t}") returns a PROMISE — it dynamic-imports the running mount's own copy of that module — so \`.${String(e)}\` reads a promise, not your export. Await it: \`const m = await modules("${t}"); m.${String(e)}\` (and make the \`game.run\` callback \`async\`).`)}})}async function w(t,o){const r=h(t),e=o??i?.();if(!e)throw new Error(`modules(): no play instance is mounted — enter Play first (${d("play")}).`);const a=`/${r}`,s=u(e).find(n=>{const c=new URL(n);return c.pathname.endsWith(a)&&c.searchParams.get(l)===e});if(!s){const n=m(e);throw new Error(`modules("${t}"): the running mount has not loaded that module (nothing to reach — a module the game never imported has no live instance). Loaded project modules (also readable as modules.loaded): ${n.join(", ")||"(none yet — play first)"}`)}try{return await import(s)}catch(n){throw new Error(`modules("${t}") could not load ${s} — the path must be the exact served file (check the extension: .ts vs .tsx). ${n instanceof Error?n.message:String(n)}`)}}export{b as createGameModuleResolver,w as importGameModule,m as loadedGameModulePaths,h as normalizeGameModulePath,S as setFocusedInstanceProvider};
1
+ import{K as d}from"./index-ClgrFOcX.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";const l="volter-mount";let i=null;function u(t){return globalThis.__volterGameModuleUrls?.(t)??[]}function S(t){i=t}function h(t){const o=t.replace(/^\/+/,"");if(!o.startsWith("src/")||/[?#]/.test(o))throw new Error(`modules("${t}"): pass the project-relative served path, starting "src/" with its real extension and no query — e.g. modules("src/sim/host.ts").`);return o}function m(t){const o=u(t).flatMap(r=>{const{pathname:e,searchParams:a}=new URL(r);if(a.get(l)!==t)return[];const s=e.lastIndexOf("/src/");return s===-1?[]:[e.slice(s+1)]});return[...new Set(o)].sort()}function b(t){const o=r=>p(r,w(r,t));return Object.defineProperty(o,"loaded",{enumerable:!0,get:()=>{const r=t??i?.();return r?m(r):[]}}),o}const f=new Set(["then","catch","finally","constructor","toJSON"]);function p(t,o){return new Proxy(o,{get(r,e){if(e==="then"||e==="catch"||e==="finally")return Reflect.get(r,e).bind(r);if(typeof e=="symbol"||f.has(e))return Reflect.get(r,e);throw new Error(`modules("${t}") returns a PROMISE — it dynamic-imports the running mount's own copy of that module — so \`.${String(e)}\` reads a promise, not your export. Await it: \`const m = await modules("${t}"); m.${String(e)}\` (and make the \`game.run\` callback \`async\`).`)}})}async function w(t,o){const r=h(t),e=o??i?.();if(!e)throw new Error(`modules(): no play instance is mounted — enter Play first (${d("play")}).`);const a=`/${r}`,s=u(e).find(n=>{const c=new URL(n);return c.pathname.endsWith(a)&&c.searchParams.get(l)===e});if(!s){const n=m(e);throw new Error(`modules("${t}"): the running mount has not loaded that module (nothing to reach — a module the game never imported has no live instance). Loaded project modules (also readable as modules.loaded): ${n.join(", ")||"(none yet — play first)"}`)}try{return await import(s)}catch(n){throw new Error(`modules("${t}") could not load ${s} — the path must be the exact served file (check the extension: .ts vs .tsx). ${n instanceof Error?n.message:String(n)}`)}}export{b as createGameModuleResolver,w as importGameModule,m as loadedGameModulePaths,h as normalizeGameModulePath,S as setFocusedInstanceProvider};