@volter/game-editor 0.5.68 → 0.5.70

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 (551) hide show
  1. package/BUNDLED_NOTICES +10941 -5080
  2. package/LICENSE +9 -10
  3. package/LICENSE-BLENDER +2 -2
  4. package/NOTICE +2 -2
  5. package/additions/canvas/package.json +8 -0
  6. package/additions/canvas/src/canvas-mount.ts +46 -0
  7. package/additions/canvas/src/scene2d.tsx +18 -0
  8. package/catalog/entries/bake.json +1 -1
  9. package/catalog/entries/blender.json +3 -3
  10. package/catalog/entries/music.json +5 -5
  11. package/catalog/project-source/LICENSE +6 -6
  12. package/catalog/project-source/src/contributions/bake.kind.ts +2 -2
  13. package/catalog/project-source/src/contributions/builder-document.tsx +1 -1
  14. package/catalog/project-source/src/contributions/builder-ui.tsx +3 -3
  15. package/catalog/project-source/src/contributions/module-source.ts +4 -4
  16. package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +59 -59
  17. package/catalog/project-source/src/lib/static-batch/Frozen.tsx +1 -1
  18. package/catalog/project-source/src/lib/static-batch/mutation-watch.ts +1 -1
  19. package/catalog/project-source/src/tools/bake-preview.tool.ts +9 -9
  20. package/dist/.vite/manifest.json +4026 -4026
  21. package/dist/assets/{AssetBudgetPanel-P2PeL_X5.js → AssetBudgetPanel-DpXsaQ6w.js} +4 -4
  22. package/dist/assets/AudioViewer-BdTHfNhD.js +1 -0
  23. package/dist/assets/{CanvasBoardDocument-BFJdTVGp.js → CanvasBoardDocument-DY-7zohc.js} +1 -1
  24. package/dist/assets/CanvasSceneViewport-57CEFqSM.js +1 -0
  25. package/dist/assets/ColorInput-Co6tCY9p.js +1 -0
  26. package/dist/assets/{EntityModelDocument-Du8wIbyK.js → EntityModelDocument-C-lhKrxv.js} +1 -1
  27. package/dist/assets/{EnvironmentAssetDocument-_SttfMY_.js → EnvironmentAssetDocument-BNe6ANTN.js} +1 -1
  28. package/dist/assets/{GameplaySessionTimeline-CWudWnfd.js → GameplaySessionTimeline-CryFYfYN.js} +1 -1
  29. package/dist/assets/ImageViewer-DiD2yIG4.js +1 -0
  30. package/dist/assets/{InspectorCanvasPreview-CEr_Kxna.js → InspectorCanvasPreview-BrFjhoiD.js} +1 -1
  31. package/dist/assets/InspectorObjectPreview-BBVO8bDT.js +1 -0
  32. package/dist/assets/JsonAssetDocument-xyXetSbl.js +2 -0
  33. package/dist/assets/{LiveModuleDocument-BWjOzO_6.js → LiveModuleDocument-BiAunjHS.js} +1 -1
  34. package/dist/assets/{LutAssetDocument-DIc6nsht.js → LutAssetDocument-5sW-5rb0.js} +1 -1
  35. package/dist/assets/{ModelAssetDocument-_CqTsX_A.js → ModelAssetDocument-Bdy7x47a.js} +1 -1
  36. package/dist/assets/{NonThreeAuthoringBootstrap-C-V23E1e.js → NonThreeAuthoringBootstrap-BP-1bVEr.js} +1 -1
  37. package/dist/assets/Object3DDocumentToolbar-CvnSLDPI.js +1 -0
  38. package/dist/assets/Object3DDocumentViewport-BE_OPc8T.js +2 -0
  39. package/dist/assets/{Object3DPreview-BPHEr3vI.js → Object3DPreview-D3w_dKrX.js} +1 -1
  40. package/dist/assets/OnlineAssetDetail-BnT8_p1W.js +1 -0
  41. package/dist/assets/PlayBar-C8Mn-EI0.js +1 -0
  42. package/dist/assets/{QuarksAssetDocument-4Dne3EHx.js → QuarksAssetDocument-DLMH5Csk.js} +1 -1
  43. package/dist/assets/ReactCanvasControls-rNz8syVB.js +1 -0
  44. package/dist/assets/RootSelectionOverlay-Cn2Rbr1N.js +1 -0
  45. package/dist/assets/{ShaderAssetDocument-W3ZjLCkt.js → ShaderAssetDocument-CsJCsNfA.js} +4 -4
  46. package/dist/assets/ShadowEditor-jB05hr1W.js +1 -0
  47. package/dist/assets/{SourceAssetViewer-BGUeDAEv.js → SourceAssetViewer-D0NgGrER.js} +1 -1
  48. package/dist/assets/StageHost-B3Yt4I7r.js +2 -0
  49. package/dist/assets/{StoryPreviewMount-Di8uMovM.js → StoryPreviewMount-CzzRn24c.js} +1 -1
  50. package/dist/assets/ThreeBoardDocument-BoHTN4Vl.js +2 -0
  51. package/dist/assets/{ThreeIsolationSceneContent-BAKurKW5.js → ThreeIsolationSceneContent-BM-0S6J5.js} +1 -1
  52. package/dist/assets/{ToolObject3DPreview-CffvGJ1h.js → ToolObject3DPreview-BeM_kx_u.js} +1 -1
  53. package/dist/assets/Toolbar-BZyog9MR.js +1 -0
  54. package/dist/assets/{TransientHint-CgmkrmKF.js → TransientHint-RJEkOJoy.js} +1 -1
  55. package/dist/assets/VideoViewer-CxajgKrf.js +1 -0
  56. package/dist/assets/ViewportShadingMenu-S2lADFJg.js +1 -0
  57. package/dist/assets/active-ingest-CjZtqL7Q.js +3 -0
  58. package/dist/assets/{animation-clock-fLmY_3--.js → animation-clock-CWVW-mqY.js} +1 -1
  59. package/dist/assets/animation-mixers.service-CpoYw8cs.js +1 -0
  60. package/dist/assets/animation-timeline.utility-CEerojaB.js +1 -0
  61. package/dist/assets/{asset-budget-asset.menu-BDRDWrvx.js → asset-budget-asset.menu-Bk6scVWQ.js} +1 -1
  62. package/dist/assets/{asset-budget.action-tQmNGQHC.js → asset-budget.action-DtBDSfDj.js} +1 -1
  63. package/dist/assets/{asset-budget.document-BthgX37Z.js → asset-budget.document-R2zyoJ8E.js} +1 -1
  64. package/dist/assets/{asset-budget.menu-DfyWVH6p.js → asset-budget.menu-D6jza5Bc.js} +1 -1
  65. package/dist/assets/asset-editor-persistence-DrgwOZIW.js +1 -0
  66. package/dist/assets/asset-loaders-CUeYIjeH.js +2 -0
  67. package/dist/assets/{asset-preview-Cv7tfD98.js → asset-preview-CQfnI2cX.js} +1 -1
  68. package/dist/assets/{audio-unlock.service-BvHvZjzx.js → audio-unlock.service-W3UBKsw9.js} +1 -1
  69. package/dist/assets/audio.utility-qrXBdGXg.js +1 -0
  70. package/dist/assets/autoplay.service-DQD3Swo9.js +1 -0
  71. package/dist/assets/{babylon-authoring-adapter-Cg5ALSpr.js → babylon-authoring-adapter-CS9LZNmz.js} +1 -1
  72. package/dist/assets/binding-resolver-B9VI52zt.js +2 -0
  73. package/dist/assets/blender-emscripten-engine-Cd6az4pU.js +2 -0
  74. package/dist/assets/{blender-node-editor.document-B92MO51u.js → blender-node-editor.document-BWLFvA2g.js} +1 -1
  75. package/dist/assets/{blender-properties-tab-CDVyDAbf.js → blender-properties-tab-BSmWG9d0.js} +1 -1
  76. package/dist/assets/{blender-runtime-host-CuniE0sy.js → blender-runtime-host-Cbkie7m4.js} +2 -2
  77. package/dist/assets/{blender-runtime-skin-B_tOz5j5.js → blender-runtime-skin-C_ATCb-z.js} +7 -7
  78. package/dist/assets/{blender-runtime.document-DxUwLiEW.js → blender-runtime.document-P9zdgwMt.js} +7 -7
  79. package/dist/assets/{blender-timeline.document-BdEEoQbK.js → blender-timeline.document-DRwySEJO.js} +1 -1
  80. package/dist/assets/{blender-uv-editor.document-EMSUlRh4.js → blender-uv-editor.document-CmLoL2Vo.js} +1 -1
  81. package/dist/assets/blender-version.status-CP4Jqkry.js +1 -0
  82. package/dist/assets/blender-wali-engine-CZcS3eAd.js +2 -0
  83. package/dist/assets/{blender.command-BkBML2SY.js → blender.command-BYGm0Q_s.js} +1 -1
  84. package/dist/assets/blender.status-BMETIbb2.js +1 -0
  85. package/dist/assets/board-guides-BG-MHK2G.js +1 -0
  86. package/dist/assets/body-marks-C1LxJtQb.js +1 -0
  87. package/dist/assets/{bridge.command-VnplZ81v.js → bridge.command-DpUNErKN.js} +3 -3
  88. package/dist/assets/{browserAll-BCmkqg8n.js → browserAll-DES3i79H.js} +1 -1
  89. package/dist/assets/{build-player.document-DV7YcJQt.js → build-player.document-B42HrdSU.js} +1 -1
  90. package/dist/assets/build-profiles.document-Di5CQoH9.js +2 -0
  91. package/dist/assets/build-progress.status-B4te7-3j.js +1 -0
  92. package/dist/assets/{build-session-BGe0eGrQ.js → build-session-Yw4JoE8T.js} +2 -2
  93. package/dist/assets/{build.action-Bdj4ZEL_.js → build.action-B-DBpUj6.js} +1 -1
  94. package/dist/assets/{build.command-DAWiYvPa.js → build.command-CfWoHNp0.js} +1 -1
  95. package/dist/assets/build.header-BaURztYD.js +1 -0
  96. package/dist/assets/{build.menu-BiRNC_xc.js → build.menu-BFBn-dPJ.js} +1 -1
  97. package/dist/assets/{build.service-Dw9K6VSF.js → build.service-D8gYWB3n.js} +1 -1
  98. package/dist/assets/{camera-C-qXzXFf.js → camera-C-uR_xQp.js} +1 -1
  99. package/dist/assets/{camera-runtime.inspector-BDrwWRlU.js → camera-runtime.inspector-BOGGEqVq.js} +1 -1
  100. package/dist/assets/{canvas-design-mount-DLn49Zle.js → canvas-design-mount-DamLAaWn.js} +4 -4
  101. package/dist/assets/canvas-entry-runtime-a6N7Rsrj.js +2 -0
  102. package/dist/assets/{canvas-preview-frames-B5xFRjhQ.js → canvas-preview-frames-XbrKuyJu.js} +1 -1
  103. package/dist/assets/{canvas-story-capture.service-DQ_leYyi.js → canvas-story-capture.service-DYRdEzkG.js} +2 -2
  104. package/dist/assets/capability-coverage-7wKVA3PF.js +7 -0
  105. package/dist/assets/{collaboration-presence-BOS1t8wI.js → collaboration-presence-DaVKEfxs.js} +1 -1
  106. package/dist/assets/{collider-Bf4Uk6LW.js → collider-BEwlgkG5.js} +1 -1
  107. package/dist/assets/component-board.service-BWSBM2Bb.js +2 -0
  108. package/dist/assets/{component-board.service-DFSSCaCf.js → component-board.service-C9ZouakC.js} +2 -2
  109. package/dist/assets/{component-board.service-CpVXGhz5.js → component-board.service-D2eGKqHf.js} +2 -2
  110. package/dist/assets/component-contracts.service-D0uElctD.js +1 -0
  111. package/dist/assets/component-instance-root-C1Xf4SwR.js +1 -0
  112. package/dist/assets/{component-verbs.command-DGzZAV_Z.js → component-verbs.command-N-Tj8KOS.js} +1 -1
  113. package/dist/assets/{component-verbs.service-D1rVRogp.js → component-verbs.service-CWh4mQ7X.js} +1 -1
  114. package/dist/assets/{config-D-EAAhqP.js → config-hmmj-QHZ.js} +4 -4
  115. package/dist/assets/{configurations-_HZOWZPy.js → configurations-B9Pi_eRN.js} +1 -1
  116. package/dist/assets/connection.status-C2HPxoww.js +1 -0
  117. package/dist/assets/{constraint-5KLYpGm7.js → constraint-Bp1l8hY-.js} +1 -1
  118. package/dist/assets/constraints.inspector-D-h1f3K2.js +1 -0
  119. package/dist/assets/{content-bounds-DKBD7nsv.js → content-bounds-7UyI42Vj.js} +1 -1
  120. package/dist/assets/{contract-system-adapters-h6OUBRYA.js → contract-system-adapters-Bq1LGdjs.js} +1 -1
  121. package/dist/assets/coverage.service-BiBikIsV.js +3 -0
  122. package/dist/assets/{create-runtime-Bg2uYMfh.js → create-runtime-Cx-q5z2y.js} +2 -2
  123. package/dist/assets/curve-Co_mro-I.js +1 -0
  124. package/dist/assets/{data-asset-7Nfmx-28.js → data-asset-Ckx4D_U_.js} +1 -1
  125. package/dist/assets/data-check-core-CHqar_E8.js +1 -0
  126. package/dist/assets/data-ref-70PUrMuT.js +1 -0
  127. package/dist/assets/debug-bridge-CarsgKpm.js +1 -0
  128. package/dist/assets/debug-registry-DgYNlhH_.js +1 -0
  129. package/dist/assets/{deferred-ingest-play-Bej67_y9.js → deferred-ingest-play-Bpdhu2i-.js} +2 -2
  130. package/dist/assets/{design-time-canvas-mount-CFW9ZWuk.js → design-time-canvas-mount-Ca9Q75Ui.js} +2 -2
  131. package/dist/assets/design-time-layers-BIb71snu.js +1 -0
  132. package/dist/assets/{design-time-mount.service-DJeAPUB_.js → design-time-mount.service-DL6ZK2TQ.js} +2 -2
  133. package/dist/assets/{design-time-mount.service-_R1UDCw3.js → design-time-mount.service-zKUVjKAu.js} +2 -2
  134. package/dist/assets/design-time-react-mount-NrWimSxY.js +1 -0
  135. package/dist/assets/{document-preview-three-5cbuuJMH.js → document-preview-three-DoDs6q1q.js} +1 -1
  136. package/dist/assets/{dom-authoring-adapter-CoESNvrM.js → dom-authoring-adapter-adLQog9l.js} +1 -1
  137. package/dist/assets/{draco3d-Sk9K4AUT.js → draco3d-aUvQF1Zx.js} +1 -1
  138. package/dist/assets/{edit-mode-audio.service-CH6J-8N7.js → edit-mode-audio.service-CHZ1ultu.js} +1 -1
  139. package/dist/assets/edit-mode-authoring-ZQuUwc6e.js +1 -0
  140. package/dist/assets/{edit-mode-networking.service-C4o2pGHX.js → edit-mode-networking.service-C7fk2fL1.js} +1 -1
  141. package/dist/assets/editor-api-C8MUOrwt.js +1 -0
  142. package/dist/assets/{editor-layers-B4oYfpj8.js → editor-layers-CGX7iCSP.js} +1 -1
  143. package/dist/assets/editor-presentation-activity-CqJH4G9t.js +1 -0
  144. package/dist/assets/{editor-shell-store-Bh1S7M54.js → editor-shell-store-BRqB1JZO.js} +1 -1
  145. package/dist/assets/{entity-object-B_5Gc0Ky.js → entity-object--ZpqIat7.js} +1 -1
  146. package/dist/assets/{extend-DcEyE5jI.js → extend-BZQIQ18F.js} +1 -1
  147. package/dist/assets/{fork-menu-CKjNh3MO.js → fork-menu-CziehkPx.js} +1 -1
  148. package/dist/assets/{frame-debugger-store-D5YViF_8.js → frame-debugger-store-BOQjrPsh.js} +1 -1
  149. package/dist/assets/game-audio-BeCyd0Ha.js +1 -0
  150. package/dist/assets/{game-contract-seams-C0AVYwvO.js → game-contract-seams-Dgqv6S8X.js} +1 -1
  151. package/dist/assets/{game-css-scope-transform-8GOvVu1s.js → game-css-scope-transform-anfk8vP_.js} +2 -2
  152. package/dist/assets/game-document.service-CqmgrRUA.js +1 -0
  153. package/dist/assets/game-eval.command-CoetFm6_.js +2 -0
  154. package/dist/assets/game-module-access-Cg1EB8Mx.js +1 -0
  155. package/dist/assets/game-network-BqI-Ehz0.js +22 -0
  156. package/dist/assets/{gameplay-export-K5AcStVC.js → gameplay-export-D0hZoeSg.js} +1 -1
  157. package/dist/assets/gameplay-replay-BHz6VAVa.js +1 -0
  158. package/dist/assets/{gameplay.command-DoWqBWhH.js → gameplay.command-CPc9GKuW.js} +1 -1
  159. package/dist/assets/generation-CdOATubd.css +1 -0
  160. package/dist/assets/{generation-jobs-CiabIfR0.js → generation-jobs-D-zXQNZI.js} +1 -1
  161. package/dist/assets/generation.service-Bwt9lQEG.js +1 -0
  162. package/dist/assets/{generations-DU9rCeQR.js → generations-d-U9lCVo.js} +1 -1
  163. package/dist/assets/generations.status-BQ8xhaLN.js +1 -0
  164. package/dist/assets/hierarchy-marks-CndAXtie.js +1 -0
  165. package/dist/assets/hierarchy-marks-CsTaTkc7.js +1 -0
  166. package/dist/assets/hosted-asset-materialization-r2vKfJGY.js +2 -0
  167. package/dist/assets/{ibl-override-material-CiKkaOTW.js → ibl-override-material-CMo_a49U.js} +1 -1
  168. package/dist/assets/index-BMxv2MNV.js +1 -0
  169. package/dist/assets/index-BPVnvJfX.js +1 -0
  170. package/dist/assets/{index-C4AUQbmq.js → index-BqzpzjSB.js} +1 -1
  171. package/dist/assets/{index-CC1puVjo.js → index-CMU7lnXk.js} +1 -1
  172. package/dist/assets/index-CPiRKiDC.css +1 -0
  173. package/dist/assets/{index-CaG87ZF-.js → index-Cr9NTnJp.js} +271 -270
  174. package/dist/assets/index-DSMLYme2.js +1 -0
  175. package/dist/assets/index-DoGlzvsX.js +1 -0
  176. package/dist/assets/{index-BsYc2Oyj.js → index-dlvCCB72.js} +1 -1
  177. package/dist/assets/{index-Kb9_s5aP.js → index-xjc_62Ha.js} +1 -1
  178. package/dist/assets/{index-C20Flc1s.js → index-z0_InXxO.js} +2 -2
  179. package/dist/assets/{inference-diagnostics-MGcIHEX6.js → inference-diagnostics-D5jfxI5p.js} +1 -1
  180. package/dist/assets/{ingest-boot-viewport-D2okO6JI.js → ingest-boot-viewport-Be0v44yf.js} +1 -1
  181. package/dist/assets/ingest-siblings-BowXSozE.js +1 -0
  182. package/dist/assets/ingest-source-persistence-BGIvThcv.js +1 -0
  183. package/dist/assets/ingest.service-wVm-ZcTI.js +1 -0
  184. package/dist/assets/{inspect-C8RP8G5F.js → inspect-CN92MgRT.js} +1 -1
  185. package/dist/assets/inspection-D8fZOHCM.js +1 -0
  186. package/dist/assets/instances.command-B6gJuL1Z.js +1 -0
  187. package/dist/assets/{json-history-resource-CTXRV4GD.js → json-history-resource-C9G_vCX9.js} +1 -1
  188. package/dist/assets/{layered-pick-B_-BRrRD.js → layered-pick-D9tIz_m7.js} +1 -1
  189. package/dist/assets/{light-CskDQ8gF.js → light-BGbl1a8K.js} +1 -1
  190. package/dist/assets/{live-project-verbs-BOAQN3ME.js → live-project-verbs-p1sdTwhF.js} +1 -1
  191. package/dist/assets/{machine.document-BxOoCOo9.js → machine.document-C1acXU7l.js} +1 -1
  192. package/dist/assets/{machines.finder-CqEceWzS.js → machines.finder-sOxNTYPx.js} +1 -1
  193. package/dist/assets/material-D7289cYI.js +1 -0
  194. package/dist/assets/{material-factory-qB9pzcQf.js → material-factory-D0T-DH8c.js} +1 -1
  195. package/dist/assets/{mesh-5--4qA-C.js → mesh-1A-HHxD6.js} +1 -1
  196. package/dist/assets/model-asset-sections-D1uxOu2v.css +1 -0
  197. package/dist/assets/model-asset-sections.service-DF-mllTL.js +1 -0
  198. package/dist/assets/{model-inspection-MrJY0U_-.js → model-inspection-CuVwNVvv.js} +1 -1
  199. package/dist/assets/{model-thumbnail-uk-2sblh.js → model-thumbnail-xm1Fabi2.js} +1 -1
  200. package/dist/assets/{models.finder-rk8dhgO8.js → models.finder-DrvU1qGk.js} +1 -1
  201. package/dist/assets/module-mode-BHOAAbgO.js +2 -0
  202. package/dist/assets/mount-canvas-ingest-root-aVZkVNh4.js +2 -0
  203. package/dist/assets/mount-dom-ingest-root-eOOGPaxi.js +2 -0
  204. package/dist/assets/{mount-ingest-root-BC3-1Cw1.js → mount-ingest-root-BsWbEvr_.js} +2 -2
  205. package/dist/assets/{mount-manifest-QJOB11Kv.js → mount-manifest-t6ipNsoF.js} +1 -1
  206. package/dist/assets/mount-readiness-DyAd17pe.js +4 -0
  207. package/dist/assets/mount-three-ingest-root-DIR0wKrN.js +1 -0
  208. package/dist/assets/{mounted-authoring-B7RL_V28.js → mounted-authoring-DX3DC9PJ.js} +1 -1
  209. package/dist/assets/{mounted-story-viewport-source-CnYhX3vW.js → mounted-story-viewport-source-D8FqGpci.js} +1 -1
  210. package/dist/assets/{native-debug-module-B-rWJfWE.js → native-debug-module-CB738yQu.js} +1 -1
  211. package/dist/assets/{navigation-BVu-aVmF.js → navigation-B9ihB0qU.js} +1 -1
  212. package/dist/assets/{navmesh.menu-C3M63eR4.js → navmesh.menu-CPxr9LPT.js} +1 -1
  213. package/dist/assets/{navmesh.service-B0H1fUfn.js → navmesh.service-BAtili_Y.js} +1 -1
  214. package/dist/assets/network-observer.service-CqTuZNtI.js +1 -0
  215. package/dist/assets/network.utility-CclYEmfV.js +1 -0
  216. package/dist/assets/object-marks-BnvSuCTt.js +1 -0
  217. package/dist/assets/{object3d-authoring-subject-BDrxd1GA.js → object3d-authoring-subject-XccsO0xG.js} +1 -1
  218. package/dist/assets/{object3d-document-session-registry-OjqzJ86S.js → object3d-document-session-registry-BWeuL0nf.js} +2 -2
  219. package/dist/assets/{oid-transform-Bzc2ZJSH.js → oid-transform-BYeAsBKI.js} +1 -1
  220. package/dist/assets/{particles-Be7AvO4c.js → particles-BXiQDiB-.js} +1 -1
  221. package/dist/assets/{performance-profiler-OwnXQX0M.js → performance-profiler-CMbwGBuk.js} +1 -1
  222. package/dist/assets/pixi-authoring-adapter-CPsN0Yk7.js +1 -0
  223. package/dist/assets/pixi-live-write-target-BUbt5ixX.js +1 -0
  224. package/dist/assets/{play.command-CIGRq8ow.js → play.command-Bz5Ra6Uj.js} +2 -2
  225. package/dist/assets/pose-guard-CLabLSzf.js +1 -0
  226. package/dist/assets/presentation-C7ZHYsKF.js +1 -0
  227. package/dist/assets/{product-BN31wSnB.js → product-MSpbAqgo.js} +1 -1
  228. package/dist/assets/{profiler.action-D57Kj9ym.js → profiler.action-1Jbc-7Q4.js} +1 -1
  229. package/dist/assets/{profiler.menu-Dh9Q5DDx.js → profiler.menu-C544DxWZ.js} +1 -1
  230. package/dist/assets/profiler.utility-QnzedS3X.js +1 -0
  231. package/dist/assets/{project-authoring-session-LCJAwGrD.js → project-authoring-session-BhNfg7TY.js} +2 -2
  232. package/dist/assets/project-provenance-BGnJXJwa.js +1 -0
  233. package/dist/assets/{properties-bone-constraints.inspector-CaIDq5nN.js → properties-bone-constraints.inspector-DRCPfugt.js} +1 -1
  234. package/dist/assets/{properties-bone.inspector-D2fcQGMF.js → properties-bone.inspector-CYHeZX0p.js} +1 -1
  235. package/dist/assets/{properties-collection.inspector-CF5AtTAd.js → properties-collection.inspector-DtGhPkiU.js} +1 -1
  236. package/dist/assets/{properties-constraints.inspector-Bj2itDrS.js → properties-constraints.inspector-TIyIV777.js} +1 -1
  237. package/dist/assets/{properties-data.inspector-BfRqk0Xo.js → properties-data.inspector-vA0MTaup.js} +1 -1
  238. package/dist/assets/{properties-material.inspector-Bf8H0mvu.js → properties-material.inspector-C73spBQh.js} +1 -1
  239. package/dist/assets/{properties-modifiers.inspector-BKShc1TH.js → properties-modifiers.inspector-9oyLBBE0.js} +1 -1
  240. package/dist/assets/{properties-object.inspector-YBh8ABnN.js → properties-object.inspector-7BuiUgbd.js} +1 -1
  241. package/dist/assets/{properties-output.inspector-CVkzfs-l.js → properties-output.inspector-CjYAggz2.js} +1 -1
  242. package/dist/assets/{properties-particles.inspector-ChDpAq-2.js → properties-particles.inspector-DpSfjykX.js} +1 -1
  243. package/dist/assets/{properties-physics.inspector-BLEM7aMj.js → properties-physics.inspector-BUTvmfU9.js} +1 -1
  244. package/dist/assets/{properties-render.inspector-vU4D9xLL.js → properties-render.inspector-CEdsDqbI.js} +1 -1
  245. package/dist/assets/{properties-scene.inspector-C-DoN-kL.js → properties-scene.inspector-4kp0sLNw.js} +1 -1
  246. package/dist/assets/{properties-texture.inspector-DySxy1oU.js → properties-texture.inspector-Ckpqy9eo.js} +1 -1
  247. package/dist/assets/{properties-view-layer.inspector-DEKxMahJ.js → properties-view-layer.inspector-CQIFbY8-.js} +1 -1
  248. package/dist/assets/{properties-world.inspector-m5qL_TQV.js → properties-world.inspector-xZgNV6rI.js} +1 -1
  249. package/dist/assets/r3f-design-session-D8VF-hty.js +2 -0
  250. package/dist/assets/{r3f-physics-binding-Bgzzd4ol.js → r3f-physics-binding-oippu1v_.js} +1 -1
  251. package/dist/assets/{r3f-source-authoring-adapter-C8oMjdTL.js → r3f-source-authoring-adapter-CZJX6VLM.js} +1 -1
  252. package/dist/assets/react-canvas-navigation-DuzvnFoN.js +1 -0
  253. package/dist/assets/react-inspector.service-CV4p6nrb.js +1 -0
  254. package/dist/assets/react-story-board-mhldts6w.js +1 -0
  255. package/dist/assets/{react-three-rapier.esm-BR2ttgLS.js → react-three-rapier.esm-Bo9LjrZe.js} +1 -1
  256. package/dist/assets/react-world-authoring-adapter-CuyruDfq.js +1 -0
  257. package/dist/assets/{realm-services-DefTrXnY.js → realm-services-BtiLE3a-.js} +1 -1
  258. package/dist/assets/reflection-probe-capture.inspector-mrrOHs-9.js +1 -0
  259. package/dist/assets/{reflection-probe-BHNGwVyz.js → reflection-probe-sIto9mh0.js} +1 -1
  260. package/dist/assets/registry-DpUr2YIM.js +1 -0
  261. package/dist/assets/{relative-import-specifier-DQzkawgj.js → relative-import-specifier-CyT6yU4l.js} +1 -1
  262. package/dist/assets/{render-env-BZ7LsGfk.js → render-env-C63BGT5v.js} +1 -1
  263. package/dist/assets/{render-features-C7QwmhCo.js → render-features-CBl6rom9.js} +1 -1
  264. package/dist/assets/{render-settings-BBvkacR3.js → render-settings-DjarlnjI.js} +1 -1
  265. package/dist/assets/resolve-three-OiswFiIS.js +702 -0
  266. package/dist/assets/root-seam-contract-BYLQx4CQ.js +1 -0
  267. package/dist/assets/{run-selection-BUeubtHj.js → run-selection-BMu0v3qC.js} +1 -1
  268. package/dist/assets/scene-capture-BLf3lJ44.js +1 -0
  269. package/dist/assets/scene-document.service-CjPDph5k.js +2 -0
  270. package/dist/assets/{scene-framing-PVMqGU8h.js → scene-framing-BhNk0WhI.js} +1 -1
  271. package/dist/assets/{scene-index--lRWLEmW.js → scene-index-DHeKmalD.js} +1 -1
  272. package/dist/assets/{scene-query-s1y04OVB.js → scene-query-ByZtXA2m.js} +1 -1
  273. package/dist/assets/seeded-random-DmdE0u-C.js +1 -0
  274. package/dist/assets/{session-CTXsU1lK.js → session-CeyQA0Dv.js} +35 -35
  275. package/dist/assets/{setup-renderer-OOw1SykJ.js → setup-renderer-Bf8g2S0f.js} +1 -1
  276. package/dist/assets/{source-object3d-authoring-adapter-RmutT5Dt.js → source-object3d-authoring-adapter-IDRws2Nk.js} +1 -1
  277. package/dist/assets/{source-persistence-backend-HviqjKZ2.js → source-persistence-backend-Dzc6MsmN.js} +1 -1
  278. package/dist/assets/{spark-renderer-lifecycle-DfYpvEJa.js → spark-renderer-lifecycle-B6Axb6jm.js} +1 -1
  279. package/dist/assets/{stage-keyboard-DDi7S27C.js → stage-keyboard-CpnIYiph.js} +1 -1
  280. package/dist/assets/stage-overlay-set-BrJzOTCe.js +1 -0
  281. package/dist/assets/stage-presence-markers-BFTl9Djp.js +1 -0
  282. package/dist/assets/stage-transform-tools-QaenmSrC.js +1 -0
  283. package/dist/assets/standard-viewport-dressing-DuKH01r4.js +24 -0
  284. package/dist/assets/{state-watch.action-DEdb1mNa.js → state-watch.action-BaRZ6YII.js} +1 -1
  285. package/dist/assets/{state-watch.menu-jWbUM3kw.js → state-watch.menu-DR2AtQ6r.js} +1 -1
  286. package/dist/assets/state-watch.utility-VW8H9Fgi.js +1 -0
  287. package/dist/assets/{story-capture-Dj1xkeKH.js → story-capture-BEVV48wm.js} +1 -1
  288. package/dist/assets/story-documents-DndjqJ7Y.js +3 -0
  289. package/dist/assets/{story-documents.service-BzQCuNBu.js → story-documents.service-CPrZ7gRM.js} +1 -1
  290. package/dist/assets/{story-documents.service-iNP-ORNr.js → story-documents.service-wCVmBPhh.js} +1 -1
  291. package/dist/assets/{story-media-presence-zTPlU9HR.js → story-media-presence-BSX78yVJ.js} +1 -1
  292. package/dist/assets/{story-pixi-preview-B7THvSl7.js → story-pixi-preview-D4FuH7lJ.js} +1 -1
  293. package/dist/assets/{story-presentation-BLXYPadR.js → story-presentation-2AxtnKGb.js} +1 -1
  294. package/dist/assets/story-three-preview-DjObHSAF.js +2 -0
  295. package/dist/assets/{structural-ids-Br2zjINh.js → structural-ids-BOo2BRoY.js} +1 -1
  296. package/dist/assets/studio-environment-B--4k2mN.js +2 -0
  297. package/dist/assets/{surface-state-D9j6qNu8.js → surface-state-CQHVfsma.js} +1 -1
  298. package/dist/assets/{syntactic-prop-specs-BTnsMOvH.js → syntactic-prop-specs-CewRyC4c.js} +1 -1
  299. package/dist/assets/team-playtest.service-B9m6CNk7.js +1 -0
  300. package/dist/assets/{three-oYrcK5SQ.js → three-B86IzdNg.js} +1 -1
  301. package/dist/assets/three-authoring-adapter-BD8_MtYK.js +1 -0
  302. package/dist/assets/three-authoring.service-BjJ9wetk.js +2 -0
  303. package/dist/assets/{three-ingest-runtime-CXKjNysA.js → three-ingest-runtime-CXySzulx.js} +1 -1
  304. package/dist/assets/{three-integration-CuAnYaTW.js → three-integration-nl5TC6EF.js} +2 -2
  305. package/dist/assets/three-integration.service-BEk5QkKM.js +1 -0
  306. package/dist/assets/three-projection-core-D4m8lsPU.js +1 -0
  307. package/dist/assets/{three-state-wXRU3rLr.js → three-state-C36FeFK4.js} +1 -1
  308. package/dist/assets/{three-story-capture.service-DMJRcqjr.js → three-story-capture.service-C0icETyL.js} +2 -2
  309. package/dist/assets/{three-story-model-DgiAP-oQ.js → three-story-model-CqWu9S2a.js} +1 -1
  310. package/dist/assets/three-viewport-presentation-CCMgGLI2.js +141 -0
  311. package/dist/assets/tools-BnE3UWVA.js +1 -0
  312. package/dist/assets/transform-mode-request-CIgYj1Qb.js +1 -0
  313. package/dist/assets/transport-strip-B1AJKpn-.js +1 -0
  314. package/dist/assets/transport.header-D-n6dQ5n.js +1 -0
  315. package/dist/assets/{trigger-volume-DP0G1VBe.js → trigger-volume-BLkHmfm9.js} +1 -1
  316. package/dist/assets/tuples-uyiMYXrv.js +1 -0
  317. package/dist/assets/ui-board-document-6e4w4a8B.js +2 -0
  318. package/dist/assets/{user-data-CqOoAowZ.js → user-data-BXFD1jg-.js} +1 -1
  319. package/dist/assets/user-data-CODoGZqA.js +1 -0
  320. package/dist/assets/{utility-view-state-Db97zwDz.js → utility-view-state-I_o0WThv.js} +1 -1
  321. package/dist/assets/viewport-door-AsLxGhLN.js +1 -0
  322. package/dist/assets/{viewport-root-presentation-B35t51xX.js → viewport-root-presentation-B1qtThOB.js} +1 -1
  323. package/dist/assets/{viewport-surface-status-D5kZtFW5.js → viewport-surface-status-CWmQeKTO.js} +1 -1
  324. package/dist/assets/{webworkerAll-CfKEb4Ao.js → webworkerAll-DC445ANd.js} +1 -1
  325. package/dist/assets/worker-jepHAPPr.js +2 -0
  326. package/dist/assets/workspace-arrangement-dkubzCff.js +1 -0
  327. package/dist/assets/world-documents-psBK5u_2.js +1 -0
  328. package/dist/assets/world-root-stage-binding-BrvO8VMz.js +1 -0
  329. package/dist/assets/{xstate-animation-binding-aQEmNSpm.js → xstate-animation-binding-ChVFHSlM.js} +1 -1
  330. package/dist/assets/{xstate-animation-meta-CnMX1Sc1.js → xstate-animation-meta-D7xnhyCE.js} +1 -1
  331. package/dist/volter-shared-react.json +10 -0
  332. package/dist/volter-shared-three.json +3 -0
  333. package/dist-node/cli.js +247 -209
  334. package/dist-node/create.js +90 -74
  335. package/package.json +20 -19
  336. package/src/contributions.d.ts +1 -1
  337. package/src/index.ts +10 -10
  338. package/starter/cube.py +1 -1
  339. package/template/.agents/references/project-manual.md +17 -18
  340. package/template/.agents/skills/editor/SKILL.md +6 -6
  341. package/template/.agents/skills/editor/agents/openai.yaml +3 -3
  342. package/template/.agents/skills/editor/references/editor-control.md +62 -62
  343. package/template/.agents/skills/{vgai-3d-models → volter-3d-models}/SKILL.md +3 -3
  344. package/template/.agents/skills/{vgai-ingest-existing-game → volter-ingest-existing-game}/SKILL.md +3 -3
  345. package/template/.agents/skills/{vgai-music → volter-music}/SKILL.md +7 -7
  346. package/template/{.github/skills/vgai-threejs-authoring → .agents/skills/volter-threejs-authoring}/SKILL.md +9 -9
  347. package/template/.agents/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  348. package/template/{.claude/skills/vgai-threejs-authoring → .agents/skills/volter-threejs-authoring}/references/helper-catalog.md +1 -1
  349. package/template/.claude/skills/editor/SKILL.md +6 -6
  350. package/template/.claude/skills/editor/agents/openai.yaml +3 -3
  351. package/template/.claude/skills/editor/references/editor-control.md +62 -62
  352. package/template/{.github/skills/vgai-3d-models → .claude/skills/volter-3d-models}/SKILL.md +3 -3
  353. package/template/{.github/skills/vgai-ingest-existing-game → .claude/skills/volter-ingest-existing-game}/SKILL.md +3 -3
  354. package/template/.claude/skills/{vgai-threejs-authoring → volter-threejs-authoring}/SKILL.md +9 -9
  355. package/template/.claude/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  356. package/template/{.agents/skills/vgai-threejs-authoring → .claude/skills/volter-threejs-authoring}/references/helper-catalog.md +1 -1
  357. package/template/.github/copilot-instructions.md +1 -1
  358. package/template/.github/skills/editor/SKILL.md +6 -6
  359. package/template/.github/skills/editor/agents/openai.yaml +3 -3
  360. package/template/.github/skills/editor/references/editor-control.md +62 -62
  361. package/template/{.claude/skills/vgai-3d-models → .github/skills/volter-3d-models}/SKILL.md +3 -3
  362. package/template/{.claude/skills/vgai-ingest-existing-game → .github/skills/volter-ingest-existing-game}/SKILL.md +3 -3
  363. package/template/{.agents/skills/vgai-threejs-authoring → .github/skills/volter-threejs-authoring}/SKILL.md +9 -9
  364. package/template/.github/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  365. package/template/.github/skills/{vgai-threejs-authoring → volter-threejs-authoring}/references/helper-catalog.md +1 -1
  366. package/template/.mcp.json +3 -3
  367. package/template/AGENTS.md +25 -25
  368. package/template/DEVLOG.md +1 -1
  369. package/template/IDIOMS.md +3 -3
  370. package/template/LICENSE +3 -3
  371. package/template/README.md +12 -13
  372. package/template/check-idioms.ts +71 -95
  373. package/template/manifest-entry-modules-plugin.ts +17 -4
  374. package/template/package.json +13 -15
  375. package/template/server/colyseus-setup.ts +1 -9
  376. package/template/server/main.ts +4 -9
  377. package/template/server/rooms/arena-room.ts +10 -10
  378. package/template/server/rooms/game-room.ts +10 -10
  379. package/template/server/rooms.ts +3 -5
  380. package/template/src/bot/QaTester.tsx +1 -1
  381. package/template/src/bot/bot-station.ts +2 -2
  382. package/template/src/bot/tester-station.ts +1 -1
  383. package/template/src/contributions/README.md +1 -1
  384. package/template/src/contributions/analytics.analytics.tsx +1 -1
  385. package/template/src/contributions/data.document.tsx +2 -2
  386. package/template/src/contributions/pages.finder.ts +1 -1
  387. package/template/src/contributions/tester.inspector.tsx +2 -2
  388. package/template/src/contributions/use-game-modules.ts +1 -1
  389. package/template/src/input.ts +1 -1
  390. package/template/src/lib/reflections/volume-reflection-material.ts +59 -59
  391. package/template/src/lib/static-batch/Frozen.tsx +1 -1
  392. package/template/src/lib/static-batch/mutation-watch.ts +1 -1
  393. package/template/src/main.ts +19 -38
  394. package/template/src/manifest-entry-modules.d.ts +12 -1
  395. package/template/src/net/NetworkedPlayers.tsx +3 -3
  396. package/template/src/prefabs/HeroBox.stories.tsx +1 -1
  397. package/template/src/world.tsx +1 -1
  398. package/template/tsconfig.json +1 -1
  399. package/template/validate-manifest.ts +3 -3
  400. package/template/vite.config.ts +12 -12
  401. package/template/{vgai.adapter.ts → volter.adapter.ts} +1 -1
  402. package/template/{vgai.project.json → volter.project.json} +2 -2
  403. package/template-dotfiles/gitignore +27 -27
  404. package/workbench/src/media/game-cover.css +11 -11
  405. package/workbench/src/product.contribution.ts +28 -28
  406. package/workbench/src/{vgaiGameSkew.ts → volterGameSkew.ts} +16 -16
  407. package/dist/assets/AudioViewer-xFb5Wv7A.js +0 -1
  408. package/dist/assets/CanvasSceneViewport-vqBlOz8P.js +0 -1
  409. package/dist/assets/ColorInput-CX1UZjYO.js +0 -1
  410. package/dist/assets/ImageViewer-shZzMd91.js +0 -1
  411. package/dist/assets/InspectorObjectPreview-BMOvJaOw.js +0 -1
  412. package/dist/assets/JsonAssetDocument-D_HXneWE.js +0 -2
  413. package/dist/assets/Object3DDocumentToolbar-BfPH9jz5.js +0 -1
  414. package/dist/assets/Object3DDocumentViewport-BaXWtATg.js +0 -2
  415. package/dist/assets/OnlineAssetDetail-BxibUH6K.js +0 -1
  416. package/dist/assets/PlayBar-DRANyO01.js +0 -1
  417. package/dist/assets/ReactCanvasControls-K98jOX9b.js +0 -1
  418. package/dist/assets/RootSelectionOverlay-BQC12Gdd.js +0 -1
  419. package/dist/assets/ShadowEditor-DP1LWynl.js +0 -1
  420. package/dist/assets/StageHost-V_0opXFt.js +0 -2
  421. package/dist/assets/ThreeBoardDocument-tgcaZDqQ.js +0 -2
  422. package/dist/assets/Toolbar-uLgsrB2z.js +0 -1
  423. package/dist/assets/VideoViewer-ClUJ6_uy.js +0 -1
  424. package/dist/assets/ViewportShadingMenu-Bdkc6jcd.js +0 -1
  425. package/dist/assets/active-ingest-CnAeQcuQ.js +0 -3
  426. package/dist/assets/animation-mixers.service-DiecMX_A.js +0 -1
  427. package/dist/assets/animation-timeline.utility-C71vPJgs.js +0 -1
  428. package/dist/assets/asset-editor-persistence-BQgjOCrm.js +0 -1
  429. package/dist/assets/asset-loaders-5PIUVvmH.js +0 -2
  430. package/dist/assets/audio.utility-D9Vk_WYS.js +0 -1
  431. package/dist/assets/autoplay.service-CFJoLPLw.js +0 -1
  432. package/dist/assets/binding-resolver-C_9MBSMa.js +0 -2
  433. package/dist/assets/blender-emscripten-engine-BeWFjMn-.js +0 -2
  434. package/dist/assets/blender-version.status-DtfwUahB.js +0 -1
  435. package/dist/assets/blender-wali-engine-da698rDf.js +0 -2
  436. package/dist/assets/blender.status-ujwGU6dU.js +0 -1
  437. package/dist/assets/board-guides-_3R1t_-2.js +0 -1
  438. package/dist/assets/body-marks-RKb_LTwL.js +0 -1
  439. package/dist/assets/build-profiles.document-CZxDuhzz.js +0 -2
  440. package/dist/assets/build-progress.status-Dk5u3C67.js +0 -1
  441. package/dist/assets/build.header--xqH6uTP.js +0 -1
  442. package/dist/assets/canvas-entry-runtime-DVeh71nC.js +0 -2
  443. package/dist/assets/capability-coverage-DQgg6UJe.js +0 -7
  444. package/dist/assets/component-board.service-DgujG90T.js +0 -2
  445. package/dist/assets/component-contracts.service-Bc_2Xxh_.js +0 -1
  446. package/dist/assets/component-instance-root-df4ofoOR.js +0 -1
  447. package/dist/assets/connection.status-CCX-mgmr.js +0 -1
  448. package/dist/assets/constraints.inspector-CwEEREsf.js +0 -1
  449. package/dist/assets/coverage.service-CV7b5Sqn.js +0 -3
  450. package/dist/assets/curve-BKuiAPpj.js +0 -1
  451. package/dist/assets/data-check-core-CQEjuFyt.js +0 -1
  452. package/dist/assets/data-ref-DyFQqqX6.js +0 -1
  453. package/dist/assets/debug-bridge-CESAxmlz.js +0 -1
  454. package/dist/assets/debug-registry-l7k5Hjc8.js +0 -1
  455. package/dist/assets/design-time-layers-CQgnmqc8.js +0 -1
  456. package/dist/assets/design-time-react-mount-CFvIk_rV.js +0 -1
  457. package/dist/assets/edit-mode-authoring-DBjaBTxM.js +0 -1
  458. package/dist/assets/editor-api-D2azVray.js +0 -1
  459. package/dist/assets/editor-presentation-activity-C7SNSmTd.js +0 -1
  460. package/dist/assets/game-audio-CaGKzia4.js +0 -1
  461. package/dist/assets/game-document.service-FdG_gFPU.js +0 -1
  462. package/dist/assets/game-eval.command-4wa9vqWE.js +0 -2
  463. package/dist/assets/game-module-access-DulnT3NH.js +0 -1
  464. package/dist/assets/game-network-Bo_nlDR5.js +0 -22
  465. package/dist/assets/gameplay-replay-CnWnlogY.js +0 -1
  466. package/dist/assets/generation-DhwCUHPf.css +0 -1
  467. package/dist/assets/generation.service-D2yeZaJu.js +0 -1
  468. package/dist/assets/generations.status-3CrPw_n5.js +0 -1
  469. package/dist/assets/hierarchy-marks-BLPfSIym.js +0 -1
  470. package/dist/assets/hierarchy-marks-C25dY2fR.js +0 -1
  471. package/dist/assets/hosted-asset-materialization-DYdcFlDf.js +0 -2
  472. package/dist/assets/index-B5WjeCHm.css +0 -1
  473. package/dist/assets/index-BcH5GC3b.js +0 -1
  474. package/dist/assets/index-CwCDkEl1.js +0 -1
  475. package/dist/assets/index-n3QdTv-T.js +0 -1
  476. package/dist/assets/index.module-Ycad3DJq.js +0 -1
  477. package/dist/assets/ingest-siblings-CkxW__go.js +0 -1
  478. package/dist/assets/ingest-source-persistence-6peGfPAS.js +0 -1
  479. package/dist/assets/ingest.service-Cc73WMIW.js +0 -1
  480. package/dist/assets/inspection-CObLhnrs.js +0 -1
  481. package/dist/assets/instances.command-CxKGnrNl.js +0 -1
  482. package/dist/assets/material-BwFzKPi0.js +0 -1
  483. package/dist/assets/model-asset-sections-CFvvihfx.css +0 -1
  484. package/dist/assets/model-asset-sections.service-TZ2SaBmH.js +0 -1
  485. package/dist/assets/module-mode-B79jV5tQ.js +0 -2
  486. package/dist/assets/mount-canvas-ingest-root-BhaYNuhY.js +0 -2
  487. package/dist/assets/mount-dom-ingest-root-BQb1u0LX.js +0 -2
  488. package/dist/assets/mount-readiness-Ds0HvvLH.js +0 -4
  489. package/dist/assets/mount-three-ingest-root-DIDBfvIH.js +0 -1
  490. package/dist/assets/network-observer.service-CiR4Q9Q0.js +0 -1
  491. package/dist/assets/network.utility-CNG3eJ0E.js +0 -1
  492. package/dist/assets/object-marks-DwvIEBOK.js +0 -1
  493. package/dist/assets/pixi-authoring-adapter-B42K4md-.js +0 -1
  494. package/dist/assets/pixi-live-write-target-D56tQEe_.js +0 -1
  495. package/dist/assets/pose-guard-DILO6gGq.js +0 -1
  496. package/dist/assets/presentation-DGBuGP6i.js +0 -1
  497. package/dist/assets/profiler.utility-DLNySW3w.js +0 -1
  498. package/dist/assets/project-provenance-4ldz-EOG.js +0 -1
  499. package/dist/assets/r3f-design-session-C0DPEChS.js +0 -2
  500. package/dist/assets/react-canvas-navigation-Jowa_lJq.js +0 -1
  501. package/dist/assets/react-inspector.service-TfTdj_Qk.js +0 -1
  502. package/dist/assets/react-story-board-Bx7qYytV.js +0 -1
  503. package/dist/assets/react-world-authoring-adapter-C1jPW_cN.js +0 -1
  504. package/dist/assets/reflection-probe-capture.inspector-C-6zrzZb.js +0 -1
  505. package/dist/assets/registry-Z28XSZHF.js +0 -1
  506. package/dist/assets/resolve-three-C7zDbK29.js +0 -702
  507. package/dist/assets/root-seam-contract-rGNbiX6q.js +0 -1
  508. package/dist/assets/scene-capture-BTWgUzhI.js +0 -1
  509. package/dist/assets/scene-document.service-DJJp-la1.js +0 -2
  510. package/dist/assets/seeded-random-38To73fI.js +0 -1
  511. package/dist/assets/stage-overlay-set-olkNSZmq.js +0 -1
  512. package/dist/assets/stage-presence-markers-cznMN_qq.js +0 -1
  513. package/dist/assets/stage-transform-tools-BDUZqRIR.js +0 -1
  514. package/dist/assets/standard-viewport-dressing-BZyuxyVl.js +0 -24
  515. package/dist/assets/state-watch.utility-DDmn3G25.js +0 -1
  516. package/dist/assets/story-documents-8ehMyYHo.js +0 -3
  517. package/dist/assets/story-three-preview-B1nNiPwP.js +0 -2
  518. package/dist/assets/studio-environment-yaKaHPxH.js +0 -2
  519. package/dist/assets/team-playtest.service-Ds9tkO4q.js +0 -1
  520. package/dist/assets/three-authoring-adapter-BrkGH4cd.js +0 -1
  521. package/dist/assets/three-authoring.service-DoamZDMx.js +0 -2
  522. package/dist/assets/three-integration.service-Db-VabIm.js +0 -1
  523. package/dist/assets/three-projection-core-jBJVt6O0.js +0 -1
  524. package/dist/assets/three-viewport-presentation-CgO3eWJ-.js +0 -141
  525. package/dist/assets/tools-B_NJsk05.js +0 -1
  526. package/dist/assets/transform-mode-request-BnKpgRUW.js +0 -1
  527. package/dist/assets/transport-strip-a9yLoPsI.js +0 -1
  528. package/dist/assets/transport.header-CpfoppXc.js +0 -1
  529. package/dist/assets/tuples-CKsHOV9T.js +0 -1
  530. package/dist/assets/ui-board-document-DtTR_mBr.js +0 -2
  531. package/dist/assets/user-data-dHvLdpwM.js +0 -1
  532. package/dist/assets/viewport-door-DVkMQazS.js +0 -1
  533. package/dist/assets/worker-CC9Ug5Ei.js +0 -2
  534. package/dist/assets/workspace-arrangement-DIMM7ska.js +0 -1
  535. package/dist/assets/world-documents-C4t3iOD-.js +0 -1
  536. package/dist/assets/world-root-stage-binding-ydl3JN1a.js +0 -1
  537. package/dist/vgai-shared-react.json +0 -10
  538. package/dist/vgai-shared-three.json +0 -3
  539. package/template/.agents/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  540. package/template/.claude/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  541. package/template/.github/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  542. package/template/server/loopback.ts +0 -76
  543. /package/dist/assets/{vgai-shared-fontawesome-CU65D4Ij.js → volter-shared-fontawesome-CU65D4Ij.js} +0 -0
  544. /package/dist/assets/{vgai-shared-jsx-dev-runtime-DFDKL7fx.js → volter-shared-jsx-dev-runtime-DFDKL7fx.js} +0 -0
  545. /package/dist/assets/{vgai-shared-jsx-runtime-DIqBpTut.js → volter-shared-jsx-runtime-DIqBpTut.js} +0 -0
  546. /package/dist/assets/{vgai-shared-react-BT7rMc2H.js → volter-shared-react-BT7rMc2H.js} +0 -0
  547. /package/dist/assets/{vgai-shared-react-dom-DFajMqMT.js → volter-shared-react-dom-DFajMqMT.js} +0 -0
  548. /package/dist/assets/{vgai-shared-react-dom-client-S0ozfl6_.js → volter-shared-react-dom-client-S0ozfl6_.js} +0 -0
  549. /package/dist/assets/{vgai-shared-three-DH4yxKwt.js → volter-shared-three-DH4yxKwt.js} +0 -0
  550. /package/template/{.vgai → .volter}/assets.json +0 -0
  551. /package/template/{.vgai → .volter}/provenance.json +0 -0
@@ -0,0 +1,3 @@
1
+ import{E as C,eH as E,jD as k,aO as I,aP as A,aw as p,jE as R,jF as L,jG as f,a5 as N,jp as F,jH as x,O as M,r as P}from"./index-Cr9NTnJp.js";import{d as w,S as D,a as _,f as O,u as B}from"./capability-coverage-7wKVA3PF.js";import{p as T,a as S,i as W}from"./live-project-verbs-p1sdTwhF.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-Dgqv6S8X.js";function j(){const t=C();return!t||!E()?null:w({worldId:p()?.config.name??"project",authoringSurface:k(t.scenes,A().map(e=>e.descriptor.id),I().map(e=>e.descriptor.id))})}const G={physics:["@react-three/rapier","@dimforge/rapier3d-compat","@dimforge/rapier2d-compat"],networking:["@colyseus/sdk","colyseus.js"],navigation:["recast-navigation","@recast-navigation/core"],audio:["tone","howler"]};function V(t,e){if(e.dependencies===null)return[];const s=G[t];return s?s.filter(r=>e.dependencies?.includes(r)):[]}function H(t,e){return`this project depends on ${e.join(" + ")}, so "nothing built a ${t} world" is not a settled answer. Reach a terminal state either way: BIND it — declare the game's own ${t} adapter in the root entry's \`systems\` table — or DECLARE the absence with \`absent(reason)\` in that same table. The reason must NAME the dependency and say why it is there while the subsystem is not (a transitive pull, a leftover, a build-only use); a declared absence blind to the shipped dependency grades malformed, not terminal.`}function K(t,e){const s=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(/^[a-z0-9]+$/i.test(e)){if(new RegExp(`\\b${s}\\b`,"i").test(t))return!0}else if(t.toLowerCase().includes(e.toLowerCase()))return!0;const r=new Set(["compat","core","client","server","node","react","three","libs","api","sdk","util","utils","plugin","plugins","tools","types","browser"]),o=c=>c.toLowerCase().split(/[.\-_/]+/).filter(v=>v.length>=4&&!r.has(v)),[a,d]=e.toLowerCase().startsWith("@")?[e.slice(1,e.indexOf("/")),e.slice(e.indexOf("/")+1)]:["",e];let n=o(d);n.length===0&&(n=o(a));const i=n.map(c=>c.replace(/\d+d?$/,"")).filter(c=>c.length>=4);return[...new Set([...n,...i])].some(c=>new RegExp(`\\b${c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"i").test(t))}const Y="this project's volter.project.json declares no `server` block, so there is no room for a NetworkingAdapter to describe",z={physics:"no mounted root built a physics world — the engine seeds this slot from the root that creates one (a `setup` root, or an R3F tree using the Rapier bridge), so nothing in this game simulates bodies",navigation:"no mounted root registered a navigation adapter — the engine seeds this slot from a world's own NavMeshManager registration, so this game has no navmesh",audio:"no mounted root built an audio context — the engine seeds this slot from the root that creates one, so there is no audio graph for the host to mute, meter or graph",camera:"no mounted root registered a camera-ownership system — the engine ships `createCameraOwnershipSystem` for a game that takes camera control (a cutscene rig), so this game's camera is gameplay-owned throughout",renderDebug:"no mounted root captured a real WebGL2 render context to derive one from — the engine seeds this slot only where the root owns the capture wiring (`adapter/setup-three-root-adapter.ts`), so the Frame debugger and the render-memory view have nothing to show for this game"};function b(t,e){return t==="networking"?"register a NetworkingAdapter from the game's own code (`ctx.registerSystemAdapter('networking', …)`) — this project declares a `server` block, so the editor's Network panel is dark for a game that IS networked":`register a ${t} adapter from the game's own code (\`ctx.registerSystemAdapter('${t}', …)\`), or build the subsystem the engine seeds it from`}function U(t,e){const s=new Map(e.declaredAbsences.map(r=>[r.slot,r]));return D.map(r=>{const o=s.get(r);if(t[r]!=null)return o?{slot:r,state:"malformed",evidence:`root "${o.rootId}" declares this slot absent — "${o.reason}" — but a ${r} adapter is bound on the live mount. One of the two is wrong: either the declaration is stale (delete the \`absent()\` marker) or something registers an adapter the game does not mean to have.`}:{slot:r,state:"bound",proof:R({slot:r,adapter:t[r],subject:"game"})};const a=V(r,e);if(o){const n=a.filter(c=>!K(o.reason,c));if(n.length>0)return{slot:r,state:"malformed",evidence:`root "${o.rootId}" declares this slot absent — "${o.reason}" — but this project depends on ${n.join(" + ")} and the reason does not mention it. Either the absence is stale, or it holds and the reason should say why that dependency is present without the subsystem (naming it).`};const i=e.absencesFromLastMount?" — the declaration read at this session’s last play mount; play to re-read it live":"";return{slot:r,state:"empty",attestedBy:"game",evidence:a.length>0?`declared absent by root "${o.rootId}": ${o.reason} (the project does depend on ${a.join(" + ")}; the reason engages with that)${i}`:`declared absent by root "${o.rootId}": ${o.reason}${i}`}}if(r==="networking"&&a.length>0)return{slot:r,state:"empty",attestedBy:"host",evidence:`this project ships ${a.join(" + ")}; the editor observes its room sockets from Play, and nothing is connected while editing`};if(a.length>0)return{slot:r,state:"unanswered",fix:H(r,a)};if(r==="networking")return e.declaresServer?{slot:r,state:"unanswered",fix:b(r)}:{slot:r,state:"empty",attestedBy:"host",evidence:Y};const d=z[r];return d?{slot:r,state:"empty",attestedBy:"host",evidence:d}:{slot:r,state:"unanswered",fix:b(r)}})}function q(){const t=F()?.game,e=p()?.rootPath??null;return t?(e!==null&&(l={projectPath:e,absences:t.declaredSystemAbsences??[]}),{absences:t.declaredSystemAbsences??[],fromLastMount:!1}):l!==null&&l.projectPath===e?{absences:l.absences,fromLastMount:!0}:{absences:[],fromLastMount:!1}}let l=null;function $(){if(L()!==null)return null;const t=p();if(!t)return null;const e=f();if(e.length===0||e.every(r=>r.adapter.provenance?.source==="foreign"))return null;const s=q();return w({worldId:t.config.name,systemAdapters:U(N(),{declaresServer:(t.config.configurations??[]).some(r=>r.kind==="process"&&typeof r.port=="number"),declaredAbsences:s.absences,absencesFromLastMount:s.fromLastMount,dependencies:T()})})}function J(t){const e=w({worldId:t.worldId,reach:_(t.adapter,t.worldId),surface:t.surface,reachMechanism:null});return{worldId:t.worldId,surface:t.surface,report:e}}function g(){return f().map(J)}function Q(t=g()){const e=t.map(a=>({label:a.worldId,report:a.report})),s=$();s&&e.push({label:null,report:s});const r=S();r&&e.push({label:null,report:r});const o=j();return o&&e.push({label:null,report:o}),e}function X(t){const e=Q(t??g());return e.length===0?null:B(p()?.config.name??"session",e)}const y=new Set;let h=null,m=0;function u(){h=null,m=0}function Z(){if(x()){u();return}const t=g(),e=X(t);if(!e||e.summary.gaps===0){u();return}const s=f();if(s.length===0){u();return}const r=C()?.regions??[];if(r.length>1){const n=new Set(s.map(i=>i.worldId));if(r.some(i=>!n.has(i.id))){u();return}}if(t.some(n=>n.report.rows.find(i=>i.seam==="editor.capture")?.status!=="ok")){u();return}const o=`session coverage "${e.summary.worldId}"`,a=O(e,o).filter(n=>n.level==="warn"),d=a.map(n=>n.message).join(`
2
+ ---
3
+ `);if(h===d?m++:(h=d,m=1),!(m<2))for(const n of a)y.has(n.message)||(y.add(n.message),M.warn(n.message,"coverage"))}const ge="workspace.service",ee=["rootCoverage","systemCoverage","projectCoverage","authoringCoverage"];function te(t){if(t)return{rootCoverage:t.rootCoverage??[],systemCoverage:t.systemCoverage??null,projectCoverage:t.projectCoverage??null,authoringCoverage:t.authoringCoverage??null};const e=$(),s=S(),r=j();return{rootCoverage:g().map(o=>({worldId:o.worldId,surface:o.surface,summary:o.report.summary,rows:o.report.rows.map(a=>({...a}))})),systemCoverage:e?{summary:e.summary,rows:e.rows.map(o=>({...o}))}:null,projectCoverage:s?{summary:s.summary,rows:s.rows.map(o=>({...o}))}:null,authoringCoverage:r?{summary:r.summary,rows:r.rows.map(o=>({...o}))}:null}}function he(){const t=P().session,e=t.reportFacet(te,{reusableKeys:ee}),s=t.onSample(Z),r=t.onCommandDispatched(o=>{o==="restart"&&W()});return()=>{e(),s(),r()}}export{ge as point,he as start};
@@ -1,3 +1,3 @@
1
- import{assertNever as le}from"./adapter-surface-Y37Nzcyw.js";import{createRootBinding as ue}from"./binding-Bmxqznjk.js";import{stackOrder as B,resolveClaimingRoot as V}from"./root-stacking-BEd9ZvxC.js";import{createAssetCache as fe}from"./assets-BcrMQHRv.js";import{createHostRenderer as me}from"./setup-renderer-OOw1SykJ.js";import{T as pe}from"./three.module-BLhyNg0e.js";import{T as K,c as he,p as ge,r as we,a as ye,D as be,b as ve}from"./seeded-random-38To73fI.js";import{c as ee,a as Re,r as Ee,D as ke,g as Se}from"./debug-registry-l7k5Hjc8.js";import{formatLoopGateMessage as $e,formatAudioGateMessage as Pe}from"./loop-gate-report-N52EWFGD.js";import{bindScopedSystem as Ae}from"./system-slot-E2mEdiih.js";import{hasUserData as Oe}from"./user-data-dHvLdpwM.js";import{dW as F,ky as _}from"./index-CaG87ZF-.js";import{c as De}from"./performance-profiler-OwnXQX0M.js";const xe=1e3;function Fe(e){const t=e.fixedTimestep??.016666666666666666,n=e.maxSubSteps??8,s=e.externalDrive??!1;let l=0,d=0,f=!1,w=0,g=1,b=!1,r=!1;function o(){s||!r||typeof document>"u"||(document.hidden?f&&(f=!1,cancelAnimationFrame(w),b=!0):b&&(b=!1,f=!0,d=performance.now(),l=0,w=requestAnimationFrame(p)))}function i(){o()}function p(E){if(!f)return;w=requestAnimationFrame(p);const v=(E-d)/1e3;d=E;const $=ge(l,v,g,{fixedDt:t,maxSubSteps:n});l=$.accumulator;for(let A=0;A<$.steps;A++)e.update(t);e.render?.($.alpha,$.displayDt)}return{start(){if(!f&&(f=!0,b=!1,d=performance.now(),l=0,!s)){if(!r&&typeof document<"u"&&(document.addEventListener("visibilitychange",i),r=!0),typeof document<"u"&&document.hidden){f=!1,b=!0;return}w=requestAnimationFrame(p)}},stop(){f=!1,b=!1,cancelAnimationFrame(w),r&&typeof document<"u"&&(document.removeEventListener("visibilitychange",i),r=!1)},get isRunning(){return o(),f},get liveness(){return o(),b||f&&!s&&performance.now()-d>xe?"loop-starved":f?"running":"stopped"},set timeScale(E){const v=he(E);v!==E&&console.warn(`[game-loop] timeScale ${E} is out of range [${K.min}, ${K.max}]; clamped to ${v}.`),g=v},get timeScale(){return g},get fixedDt(){return t}}}const Te={cancel(){}};function j(e){return new DOMException(e,"AbortError")}function H(e,t){if(!Number.isFinite(t)||t<0)throw new RangeError(`SimClock.${e}: seconds must be a finite, non-negative number, got ${t}`)}function Ce(e){const t=e.dispose;let n=0,s=0,l=0,d=!1;const f=new Set,w=new Set;function g(r){r.cancelled||(r.cancelled=!0,f.delete(r),r.detachAbort?.(),r.detachAbort=null)}function b(r,o,i){H("after",r);const p=i?.signal;if(d||p?.aborted)return Te;const E={dueAt:n+r,seq:l++,fn:o,cancelled:!1,detachAbort:null};if(f.add(E),p){const v=()=>g(E);p.addEventListener("abort",v,{once:!0}),E.detachAbort=()=>p.removeEventListener("abort",v)}return{cancel(){g(E)}}}return{now:()=>n,tickNow:()=>s,after:b,delay(r,o){H("delay",r);const i=o?.signal;return i?.aborted?Promise.reject(j("SimClock.delay: aborted before it was scheduled")):d?Promise.reject(j("SimClock.delay: the sim clock is disposed")):new Promise((p,E)=>{let v=null,$=null,A=!1;const D=()=>{A=!0,w.delete(T),$?.(),$=null};function T(C){A||(D(),v?.cancel(),E(j(C)))}if(v=b(r,()=>{A||(D(),p())}),w.add(T),i){const C=()=>T("SimClock.delay: aborted");i.addEventListener("abort",C,{once:!0}),$=()=>i.removeEventListener("abort",C)}})},disposeAfter(r,o){return H("disposeAfter",o),b(o,()=>t(r))},flush(r){if(d||(n=r,s++,f.size===0))return;const o=[];for(const i of f)!i.cancelled&&i.dueAt<=n&&o.push(i);if(o.length!==0){o.sort((i,p)=>i.dueAt-p.dueAt||i.seq-p.seq);for(const i of o)if(!i.cancelled){g(i);try{i.fn()}catch(p){console.error("[sim-clock] timer callback threw:",p)}}}},dispose(){if(d)return;d=!0;for(const o of f)o.detachAbort?.(),o.detachAbort=null,o.cancelled=!0;f.clear();const r=[...w];w.clear();for(const o of r)o("SimClock: disposed while a delay was pending")}}}const Me=ee("sim-clock");function Le(e,t){Me.set(e,t)}function _e(e,t="world"){const n=new Map,s=[],l=new Map;let d=0;for(const r of F)n.set(r,[]);let f=!1;const w=new Map;for(const r of F)w.set(r,new Set);const g=new Set;function b(r,o,i){const p=l.get(r)??r.name??`anonymous-${++d}`;l.set(r,p),e?.beginSystem(t,o,p);try{r(i)}catch(E){const v=r.name?`"${r.name}"`:"(anonymous)";console.error(`[system-runner] system ${v} in phase "${o}" threw:`,E)}finally{e?.endSystem(t,o,p)}}return{add(r,o,i){const p=n.get(r);if(!p)throw new Error(`Unknown phase: ${r}. Valid phases: ${F.join(", ")}`);p.push(o),l.set(o,i?.name??o.name??`anonymous-${++d}`)},remove(r,o){const i=n.get(r);if(!i)return;const p=i.indexOf(o);p!==-1&&i.splice(p,1),w.get(r)?.delete(o)},register(r){const o=n.get(r.phase);if(!o)throw new Error(`Unknown phase: ${r.phase}. Valid phases: ${F.join(", ")}`);o.push(r.update),l.set(r.update,r.name??r.update.name??`anonymous-${++d}`),s.push(r)},unregister(r){const o=n.get(r.phase);if(o){const p=o.indexOf(r.update);p!==-1&&o.splice(p,1)}w.get(r.phase)?.delete(r.update);const i=s.indexOf(r);i!==-1&&s.splice(i,1),g.delete(r),r.dispose?.()},runInit(){const r=[...s].sort((o,i)=>F.indexOf(o.phase)-F.indexOf(i.phase));for(const o of r)o.init?.()},runDispose(){for(const r of s){const o=n.get(r.phase);if(o){const i=o.indexOf(r.update);i!==-1&&o.splice(i,1)}r.dispose?.()}s.length=0},runPhase(r,o){const i=n.get(r);if(!i)throw new Error(`Unknown phase: ${r}. Valid phases: ${F.join(", ")}`);const p=w.get(r),E=[];for(const v of i)f&&!p.has(v)?E.push(v):b(v,r,o);for(const v of E)b(v,r,o)},run(r){for(const o of F)this.runPhase(o,r)},markEngineBoundary(){for(const r of F){const o=w.get(r);for(const i of n.get(r))o.add(i)}for(const r of s)g.add(r);f=!0},removeAllNonEngine(){if(!f)return;const r=s.filter(i=>g.has(i)),o=s.filter(i=>!g.has(i));s.length=0,s.push(...r);for(const i of o)i.dispose?.();for(const i of F){const p=n.get(i),E=w.get(i),v=p.filter($=>E.has($));p.length=0,p.push(...v)}},count(r){if(r)return n.get(r)?.length??0;let o=0;for(const i of n.values())o+=i.length;return o}}}function Ie(e){if(!e)return"<unknown call site — no stack captured>";const t=e.split(`
1
+ import{assertNever as le}from"./adapter-surface-Y37Nzcyw.js";import{createRootBinding as ue}from"./binding-Bmxqznjk.js";import{stackOrder as B,resolveClaimingRoot as V}from"./root-stacking-BEd9ZvxC.js";import{createAssetCache as fe}from"./assets-BcrMQHRv.js";import{createHostRenderer as me}from"./setup-renderer-Bf8g2S0f.js";import{T as pe}from"./three.module-BLhyNg0e.js";import{T as X,c as he,p as ge,r as we,a as ye,D as be,b as ve}from"./seeded-random-DmdE0u-C.js";import{c as ee,a as Re,r as Ee,D as ke,g as Se}from"./debug-registry-DgYNlhH_.js";import{formatLoopGateMessage as $e,formatAudioGateMessage as Pe}from"./loop-gate-report-N52EWFGD.js";import{bindScopedSystem as Ae}from"./system-slot-E2mEdiih.js";import{hasUserData as Oe}from"./user-data-CODoGZqA.js";import{dX as F,kz as _}from"./index-Cr9NTnJp.js";import{c as De}from"./performance-profiler-CMbwGBuk.js";const xe=1e3;function Fe(e){const t=e.fixedTimestep??.016666666666666666,n=e.maxSubSteps??8,s=e.externalDrive??!1;let l=0,d=0,f=!1,w=0,g=1,b=!1,r=!1;function o(){s||!r||typeof document>"u"||(document.hidden?f&&(f=!1,cancelAnimationFrame(w),b=!0):b&&(b=!1,f=!0,d=performance.now(),l=0,w=requestAnimationFrame(p)))}function i(){o()}function p(E){if(!f)return;w=requestAnimationFrame(p);const v=(E-d)/1e3;d=E;const $=ge(l,v,g,{fixedDt:t,maxSubSteps:n});l=$.accumulator;for(let A=0;A<$.steps;A++)e.update(t);e.render?.($.alpha,$.displayDt)}return{start(){if(!f&&(f=!0,b=!1,d=performance.now(),l=0,!s)){if(!r&&typeof document<"u"&&(document.addEventListener("visibilitychange",i),r=!0),typeof document<"u"&&document.hidden){f=!1,b=!0;return}w=requestAnimationFrame(p)}},stop(){f=!1,b=!1,cancelAnimationFrame(w),r&&typeof document<"u"&&(document.removeEventListener("visibilitychange",i),r=!1)},get isRunning(){return o(),f},get liveness(){return o(),b||f&&!s&&performance.now()-d>xe?"loop-starved":f?"running":"stopped"},set timeScale(E){const v=he(E);v!==E&&console.warn(`[game-loop] timeScale ${E} is out of range [${X.min}, ${X.max}]; clamped to ${v}.`),g=v},get timeScale(){return g},get fixedDt(){return t}}}const Te={cancel(){}};function j(e){return new DOMException(e,"AbortError")}function H(e,t){if(!Number.isFinite(t)||t<0)throw new RangeError(`SimClock.${e}: seconds must be a finite, non-negative number, got ${t}`)}function Ce(e){const t=e.dispose;let n=0,s=0,l=0,d=!1;const f=new Set,w=new Set;function g(r){r.cancelled||(r.cancelled=!0,f.delete(r),r.detachAbort?.(),r.detachAbort=null)}function b(r,o,i){H("after",r);const p=i?.signal;if(d||p?.aborted)return Te;const E={dueAt:n+r,seq:l++,fn:o,cancelled:!1,detachAbort:null};if(f.add(E),p){const v=()=>g(E);p.addEventListener("abort",v,{once:!0}),E.detachAbort=()=>p.removeEventListener("abort",v)}return{cancel(){g(E)}}}return{now:()=>n,tickNow:()=>s,after:b,delay(r,o){H("delay",r);const i=o?.signal;return i?.aborted?Promise.reject(j("SimClock.delay: aborted before it was scheduled")):d?Promise.reject(j("SimClock.delay: the sim clock is disposed")):new Promise((p,E)=>{let v=null,$=null,A=!1;const D=()=>{A=!0,w.delete(T),$?.(),$=null};function T(C){A||(D(),v?.cancel(),E(j(C)))}if(v=b(r,()=>{A||(D(),p())}),w.add(T),i){const C=()=>T("SimClock.delay: aborted");i.addEventListener("abort",C,{once:!0}),$=()=>i.removeEventListener("abort",C)}})},disposeAfter(r,o){return H("disposeAfter",o),b(o,()=>t(r))},flush(r){if(d||(n=r,s++,f.size===0))return;const o=[];for(const i of f)!i.cancelled&&i.dueAt<=n&&o.push(i);if(o.length!==0){o.sort((i,p)=>i.dueAt-p.dueAt||i.seq-p.seq);for(const i of o)if(!i.cancelled){g(i);try{i.fn()}catch(p){console.error("[sim-clock] timer callback threw:",p)}}}},dispose(){if(d)return;d=!0;for(const o of f)o.detachAbort?.(),o.detachAbort=null,o.cancelled=!0;f.clear();const r=[...w];w.clear();for(const o of r)o("SimClock: disposed while a delay was pending")}}}const Me=ee("sim-clock");function Le(e,t){Me.set(e,t)}function _e(e,t="world"){const n=new Map,s=[],l=new Map;let d=0;for(const r of F)n.set(r,[]);let f=!1;const w=new Map;for(const r of F)w.set(r,new Set);const g=new Set;function b(r,o,i){const p=l.get(r)??r.name??`anonymous-${++d}`;l.set(r,p),e?.beginSystem(t,o,p);try{r(i)}catch(E){const v=r.name?`"${r.name}"`:"(anonymous)";console.error(`[system-runner] system ${v} in phase "${o}" threw:`,E)}finally{e?.endSystem(t,o,p)}}return{add(r,o,i){const p=n.get(r);if(!p)throw new Error(`Unknown phase: ${r}. Valid phases: ${F.join(", ")}`);p.push(o),l.set(o,i?.name??o.name??`anonymous-${++d}`)},remove(r,o){const i=n.get(r);if(!i)return;const p=i.indexOf(o);p!==-1&&i.splice(p,1),w.get(r)?.delete(o)},register(r){const o=n.get(r.phase);if(!o)throw new Error(`Unknown phase: ${r.phase}. Valid phases: ${F.join(", ")}`);o.push(r.update),l.set(r.update,r.name??r.update.name??`anonymous-${++d}`),s.push(r)},unregister(r){const o=n.get(r.phase);if(o){const p=o.indexOf(r.update);p!==-1&&o.splice(p,1)}w.get(r.phase)?.delete(r.update);const i=s.indexOf(r);i!==-1&&s.splice(i,1),g.delete(r),r.dispose?.()},runInit(){const r=[...s].sort((o,i)=>F.indexOf(o.phase)-F.indexOf(i.phase));for(const o of r)o.init?.()},runDispose(){for(const r of s){const o=n.get(r.phase);if(o){const i=o.indexOf(r.update);i!==-1&&o.splice(i,1)}r.dispose?.()}s.length=0},runPhase(r,o){const i=n.get(r);if(!i)throw new Error(`Unknown phase: ${r}. Valid phases: ${F.join(", ")}`);const p=w.get(r),E=[];for(const v of i)f&&!p.has(v)?E.push(v):b(v,r,o);for(const v of E)b(v,r,o)},run(r){for(const o of F)this.runPhase(o,r)},markEngineBoundary(){for(const r of F){const o=w.get(r);for(const i of n.get(r))o.add(i)}for(const r of s)g.add(r);f=!0},removeAllNonEngine(){if(!f)return;const r=s.filter(i=>g.has(i)),o=s.filter(i=>!g.has(i));s.length=0,s.push(...r);for(const i of o)i.dispose?.();for(const i of F){const p=n.get(i),E=w.get(i),v=p.filter($=>E.has($));p.length=0,p.push(...v)}},count(r){if(r)return n.get(r)?.length??0;let o=0;for(const i of n.values())o+=i.length;return o}}}function Ie(e){if(!e)return"<unknown call site — no stack captured>";const t=e.split(`
2
2
  `);return(t[2]??t[1]??t[0]??"<unknown call site>").trim()}function Ge(e=t=>{console.warn(t)}){const t=new Set;let n;function s(){const l=Ie(new Error().stack);return t.has(l)||(t.add(l),e(`[determinism] the global Math.random generator was drawn from during a gameplay frame while this project declares determinism.seededRandom — use ctx.random() / ctx.random.stream(name) instead. Call site:
3
- ${l}`)),n()}return{enable(){n=Math.random,Math.random=s},disable(){Math.random===s&&n&&(Math.random=n,n=void 0)}}}const te=ee("gameplay-rng-trap");function Ne(e,t){te.set(e,t)}function At(e){return te.get(e)??null}const ze=F.filter(e=>e===_.PRE_RENDER||e===_.RENDER);function U(e){const{id:t,kind:n,pausable:s=!0,adapter:l,mounted:d,scene:f,canvasRoot:w,container:g,physics:b,collisions:r,physics2d:o,camera:i,frame:p,binding:E=null}=e;if(n==="three"&&!f)throw new Error(`RootInstance "${t}" (kind: three): a three world requires a scene — pass \`scene\` in RootInstanceInit.`);if(n==="canvas"&&w==null)throw new Error(`RootInstance "${t}" (kind: canvas): a canvas world requires a native substrate root — pass \`canvasRoot\` in RootInstanceInit.`);if(n==="dom"&&!g)throw new Error(`RootInstance "${t}" (kind: react): a react world requires a container — pass \`container\` in RootInstanceInit.`);let v=!1;const $=d.dispose.bind(d);return d.dispose=()=>{v=!0,$()},{id:t,kind:n,pausable:s,adapter:l,mounted:d,physics:b,collisions:r,physics2d:o,camera:i,frame:p?{runPhase(D,T){v||p.runPhase(D,T)},endFrame(){v||p.endFrame?.()}}:void 0,binding:E,get disposed(){return v},threeScene(){if(n!=="three"||!f)throw new Error(`RootInstance "${t}" (kind: ${n}): threeScene() requested but this world is not a three world`);return f},canvasRoot(){if(n!=="canvas"||w===void 0||w===null)throw new Error(`RootInstance "${t}" (kind: ${n}): canvasRoot() requested but this world is not a canvas world`);return w},reactRoot(){if(n!=="dom"||!g)throw new Error(`RootInstance "${t}" (kind: ${n}): reactRoot() requested but this world is not a react world`);return g}}}function qe(e){const{physics:t,rapierWorld:n}=e;return!t||!n?null:{physics:t,rapierWorld:n}}function je(e,t){const n=[];e.traverse(s=>n.push(s));for(const s of t){const l=qe(s);if(l)for(const d of n){const f=l.physics.get(d);f&&(l.rapierWorld.removeRigidBody(f.body),l.physics.remove(d))}}e.removeFromParent();for(const s of n){const l=s;Oe(s,"__sharedGeometry")||l.geometry?.dispose();const d=l.material;if(Array.isArray(d))for(const f of d)f.dispose();else d?.dispose()}}function He(e){return[]}function Be(e){const t=[],n=De(),s=_e(n.systemObserver,"game"),l=ye(e.seed??be),d=Ge();let f=!1;const w={setEnabled(a){f=a},get enabled(){return f}};let g=0,b=0,r=0;const o=new Set,i=Ce({dispose:a=>je(a,t.flatMap(He))}),p=Re({getTick:()=>g,getSimT:()=>b,getFixedDt:()=>e.loop.fixedDt,getDefaultRootId:()=>t.length>0?v().id:null,getLoopLiveness:()=>e.loop.liveness});let E=!1;function v(){if(t.length===0)throw new Error("Game.defaultRoot: no roots registered yet");return t.find(a=>a.kind==="three")??t[0]}const $=new Set,A=new Set,D=new Map,T=new Map;function C(){const a={debug:p.adapter},h=new Map([["debug","(game)"]]),k=(y,c,R)=>{for(const u of Object.keys(c)){if(c[u]===void 0)continue;const m=h.get(u);if(m!==void 0){if(a[u]===c[u]||R?.has(u))continue;$.has(u)||($.add(u),console.warn(`[game] systemAdapters: "${u}" is registered by both ${m} and ${y} — the FIRST registration (${m}) wins; the later one is shadowed (game-scoped system adapters).`));continue}a[u]=c[u],h.set(u,y)}};for(const y of t){const c=D.get(y.id);c&&k(`world "${y.id}" (declared systems export)`,c);const R=y.mounted.systems;R&&k(`world "${y.id}"`,R,c?new Set(Object.keys(c)):void 0)}return a}let P=!1;const x=new Set;function I(a,h,k){const y=`${a}:${h}`;if(x.has(y))return;x.add(y);const c=a==="loop"?$e({worldId:h,reason:k}):Pe({worldId:h,reason:k});console.warn(c)}const L=new WeakMap;function z(a){for(const h of t){if(h.disposed||!h.pausable)continue;h.mounted.drivesOwnLoop&&(h.mounted.setPaused?h.mounted.setPaused(a):a&&I("loop",h.id,"self-driven world, adapter declares no setPaused capability"));const k=D.get(h.id)?.audio??h.mounted.systems?.audio;k?a?(L.has(k)||L.set(k,k.isMuted()),k.setMuted(!0)):L.has(k)&&(k.setMuted(L.get(k)),L.delete(k)):a&&!T.get(h.id)?.some(y=>y.slot==="audio")&&I("audio",h.id,"no SystemAdapters.audio on this world")}}function G(a,h){f&&d.enable(),n.beginFrame();const k=h?.skipRenderPhases??!1,y=h?.onlyFrozen??!1,c=t.length;E=!1;for(let u=0;u<c;u++){const m=t[u];if(!m.disposed){if(y){if(P&&m.pausable&&!m.mounted.drivesOwnLoop){E=!0;break}}else if(m.mounted.drivesOwnLoop?!P||!m.pausable||!m.mounted.setPaused:!P||!m.pausable){E=!0;break}}}let R=!1;if(!y)for(let u=0;u<c;u++){const m=t[u];if(!m.disposed&&m.mounted.drivesOwnLoop&&(!P||!m.pausable||!m.mounted.setPaused)){R=!0;break}}if(y){for(const u of F){n.beginPhase(),E&&s.runPhase(u,a);for(let m=0;m<c;m++){const S=t[m];if(!S.disposed&&!S.mounted.drivesOwnLoop&&P&&S.pausable)try{S.frame?.runPhase(u,a)}catch(O){console.error(`[game] world "${S.id}" (kind: ${S.kind}) runPhase("${u}") threw (step()):`,O)}}n.endPhase(u)}for(let u=0;u<c;u++){const m=t[u];if(!m.disposed&&!m.mounted.drivesOwnLoop&&P&&m.pausable)if(R=!0,m.frame)try{m.frame.endFrame?.()}catch(S){console.error(`[game] world "${m.id}" (kind: ${m.kind}) endFrame() threw (step()):`,S)}else try{m.mounted.update?.(a)}catch(S){console.error(`[game] world "${m.id}" (kind: ${m.kind}) update() threw (step()):`,S)}}}else{for(const u of F){if(n.beginPhase(),!(k&&(u===_.PRE_RENDER||u===_.RENDER))){s.runPhase(u,a);for(let S=0;S<c;S++){const O=t[S];if(O.disposed||O.mounted.drivesOwnLoop)continue;const W=P&&O.pausable;if(W&&u!==_.RENDER)continue;const de=W?0:a;try{O.frame?.runPhase(u,de)}catch(ce){console.error(`[game] world "${O.id}" (kind: ${O.kind}) runPhase("${u}") threw:`,ce)}}}n.endPhase(u)}for(let u=0;u<c;u++){const m=t[u];if(!(m.disposed||m.mounted.drivesOwnLoop||P&&m.pausable)){if(R=!0,m.frame)try{m.frame.endFrame?.()}catch(O){console.error(`[game] world "${m.id}" (kind: ${m.kind}) endFrame() threw:`,O)}else if(!(k&&m.mounted.updateCadence==="display"))try{m.mounted.update?.(a)}catch(O){console.error(`[game] world "${m.id}" (kind: ${m.kind}) update() threw:`,O)}}}}R&&(g++,b+=a,i.flush(b)),n.endFrame(),f&&d.disable()}function q(a,h){if(r=a,f&&d.enable(),n.beginFrame(),o.size>0)for(const y of[...o])try{y(a,h)}catch(c){console.error("[game] an onRenderStep callback threw:",c)}const k=t.length;for(const y of ze){n.beginPhase(),s.runPhase(y,h);for(let c=0;c<k;c++){const R=t[c];if(R.disposed||R.mounted.drivesOwnLoop)continue;const u=P&&R.pausable;if(!(u&&y!==_.RENDER))try{R.frame?.runPhase(y,u?0:h)}catch(m){console.error(`[game] world "${R.id}" (kind: ${R.kind}) runPhase("${y}") threw (display frame):`,m)}}n.endPhase(y)}for(let y=0;y<k;y++){const c=t[y];if(c.disposed||c.mounted.drivesOwnLoop||c.frame||c.mounted.updateCadence!=="display")continue;const R=P&&c.pausable;try{c.mounted.update?.(R?0:h)}catch(u){console.error(`[game] world "${c.id}" (kind: ${c.kind}) update() threw (display frame):`,u)}}n.endFrame(),f&&d.disable()}const M={loop:e.loop,assets:e.assets,playtest:e.playtest??null,profiler:n,systems:s,get roots(){return t},world(a){return t.find(h=>h.id===a)??null},get defaultRoot(){return v()},get systemAdapters(){return C()},subscribeSystemAdapters(a){return A.add(a),()=>A.delete(a)},notifySystemAdaptersChanged(){for(const a of A)a()},get declaredSystemAbsences(){return[...T.values()].flat()},installDeclaredSystemAdapters(a,h,k=[]){const y=t.find(u=>u.id===a);if(!y)throw new Error(`installDeclaredSystemAdapters: no mounted root is named "${a}" (mounted: ${t.map(u=>`"${u.id}"`).join(", ")||"none"}).`);if(D.has(a))throw new Error(`installDeclaredSystemAdapters: root "${a}" already installed its declared systems — a declaration is static and installs exactly once per mount.`);const c=y.mounted.systemScope??y.mounted,R=Object.fromEntries(Object.entries(h).map(([u,m])=>[u,m===void 0?void 0:Ae(m,c)]));D.set(a,R),T.set(a,k),M.notifySystemAdaptersChanged()},play:{get paused(){return P},pause(){P||(P=!0,z(!0))},resume(){P&&(P=!1,z(!1))},step(a=1/60){if(P)for(const h of t)h.disposed||!h.pausable||!h.mounted.drivesOwnLoop||h.mounted.setPaused&&(h.mounted.step?h.mounted.step():I("loop",h.id,"self-driven world, adapter declares no step capability"));G(a,{onlyFrozen:!0})}},registerRoot(a){if(t.some(h=>h.id===a.id))throw new Error(`Game.registerRoot: duplicate world id "${a.id}"`);if(t.some(h=>h.mounted===a.mounted))throw new Error(`Game.registerRoot: world "${a.id}" shares its \`mounted\` object with an already-registered world ("${t.find(h=>h.mounted===a.mounted).id}") — the same mount cannot be registered twice.`);t.push(a),M.notifySystemAdaptersChanged(),a.mounted.drivesOwnLoop&&a.kind!=="dom"&&!a.mounted.observe&&console.warn(`[game] world "${a.id}" (kind: ${a.kind}, adapter: "${a.adapter.id}"): no state bridge — this mounted game has no \`observe\` (RootStateObserver); the editor's observations cannot subscribe to its state.`)},runFrame(a,h){G(a,h)},runRenderFrame(a,h){q(a,h)},get renderAlpha(){return r},onRenderStep(a,h){const k=h?.signal;if(k?.aborted)return()=>{};o.add(a);let y=null;const c=()=>{o.delete(a),y?.(),y=null};return k&&(k.addEventListener("abort",c,{once:!0}),y=()=>k.removeEventListener("abort",c)),c},runTicks(a,h){if(!Number.isInteger(a)||a<0)throw new RangeError(`Game.runTicks: n must be a non-negative integer, got ${a}`);if(P)throw new ke("RUN_TICKS_PAUSED","Game.runTicks: refused — Game.play.paused is true; stepping the frozen set is Game.play.step()'s contract, not runTicks'");const k=h?.render??"last",y=e.loop.fixedDt;for(let c=0;c<a;c++){const R=c===a-1;G(y,{skipRenderPhases:k==="all"?!1:k==="none"?!0:!R})}},dispose(){i.dispose(),p.strip()}};return Ee(M,p),p.setRunTicksTarget({runTicks:M.runTicks}),we(M,l),Ne(M,w),Le(M,i),M}function Ue(e){B(e).forEach((n,s)=>{n.canvas.style.pointerEvents=s===0?"auto":"none"})}const X=["pointerdown","pointerup","pointermove","click","wheel"];function Ye(e){const t=e,n=["clientX","clientY","screenX","screenY","offsetX","offsetY","button","buttons","ctrlKey","altKey","shiftKey","metaKey","pointerId","pointerType","pressure","isPrimary","deltaX","deltaY","deltaZ","deltaMode"],s={bubbles:!0,cancelable:!0,composed:!0};for(const l of n)l in t&&(s[l]=t[l]);return s}const ne=new WeakSet;function We(e,t){const n=globalThis,s=t.type==="wheel"?n.WheelEvent:t.type.startsWith("pointer")?n.PointerEvent:n.MouseEvent??n.PointerEvent;if(!(!s||typeof e.dispatchEvent!="function"))try{const l=new s(t.type,Ye(t));ne.add(l),e.dispatchEvent(l)}catch{}}function Ve(e,t){Ue(t);const n=new Map(t.map(d=>[d.id,d])),s=B(t)[0]?.id,l=d=>{if(ne.has(d))return;const f=e.getBoundingClientRect?.()??{left:0,top:0},w=d.clientX??0,g=d.clientY??0,b=w-f.left,r=g-f.top,o=V(t,b,r);if(o&&o!==s){const i=n.get(o);i&&(d.stopPropagation(),We(i.canvas,d))}};for(const d of X)e.addEventListener?.(d,l,!0);return{resolveClaim:(d,f)=>V(t,d,f),dispose(){for(const d of X)e.removeEventListener?.(d,l,!0)}}}function re(e){return new URLSearchParams(e.search).get(ve)==="1"}const Ke=[_.PRE_RENDER,_.RENDER];async function Xe(e){const t=Qe(e);for(const n of Ke){e.systems.runPhase(n,0);for(const s of t)s.frame.runPhase(n,0)}await et()}function Qe(e){const t=[];for(const n of e.roots){if(n.mounted.drivesOwnLoop){Q(n.id,"drives its own loop — renderOnce() cannot frame-gate it");continue}if(!n.frame){Q(n.id,`(kind: ${n.kind}) has no phase hooks — renderOnce() cannot drive it (opaque/foreign mount with no frame-gated entry point)`);continue}t.push({id:n.id,frame:n.frame})}return t}function Q(e,t){console.warn(`[render-control] world "${e}" ${t}.`)}function Ze(e){const t=[];for(const n of e.roots){if(n.mounted.drivesOwnLoop){t.push(`world "${n.id}" drives its own loop — cannot be frame-gated for deterministic capture (the policy is to FAIL LOUDLY, or be excluded only by an explicit declared policy).`);continue}n.frame||t.push(`world "${n.id}" (kind: ${n.kind}) has no phase hooks — an opaque/foreign mount with no frame-gated entry point cannot participate in deterministic capture.`)}return t}function Z(e){let t=0,n=0;const s=[...e.children??[]];for(;s.length>0;){const l=s.pop();t++,l.userData?.entityId!==void 0&&n++,l.children&&s.push(...l.children)}return{nodes:t,entities:n}}function Je(e){const t=[];for(const n of e.roots)n.kind==="three"?t.push({id:n.id,kind:n.kind,...Z(n.threeScene())}):n.kind==="canvas"&&n.mounted.kind==="canvas"&&n.mounted.substrate.name==="pixi"&&t.push({id:n.id,kind:n.kind,...Z(n.canvasRoot())});return t}function J(){return new Promise(e=>{requestAnimationFrame(()=>e())})}async function et(){await J(),await J()}async function N(e){if(!e)return{status:"not-applicable"};try{return await e(),{status:"ready"}}catch(t){return{status:"error",detail:t instanceof Error?t.message:String(t)}}}async function tt(){if(typeof document>"u"||!document.fonts)return{status:"not-applicable"};try{return await document.fonts.ready,{status:"ready"}}catch(e){return{status:"error",detail:e instanceof Error?e.message:String(e)}}}async function nt(e){const[t,n,s,l,d,f]=await Promise.all([N(e.assets),N(e.shaders),tt(),N(e.sequences),N(e.tone),N(e.scene)]);return{assets:t,shaders:n,fonts:s,sequences:l,tone:d,scene:f}}function rt(e){const t=e.location??window.location;if(!re(t))return;const{game:n,clock:s,readiness:l={}}=e,d=e.target??window,f=e.frameAdvancers??[],w=e.simulateFixedDt??1/60,g=e.excludedFromDeterminism??[],b={seek(r){s.seek(r)},seekFrame(r,o){s.seekFrame(r,o)},advanceFrame(r){for(const o of f)o(r)},renderOnce(){return Xe(n)},ready(){return nt(l)},simulateSubsteps(r){for(let o=0;o<r;o++)n.runFrame(w)},excludedFromDeterminism(){return[...g,...Ze(n)]},simulateFixedDt(){return w},perfSample(r){const o=n.profiler,i=o.enabled;o.enabled=!0,o.clear();const p=[];try{for(let E=0;E<r;E++){n.runFrame(w);const v=o.getSnapshot(),$=v.frames.at(-1);p.push({cpuMs:$?.cpuMs??0,phases:Object.fromEntries(($?.phases??[]).map(A=>[A.name,A.ms])),render:{...v.render}})}}finally{o.enabled=i}return{frames:p,worlds:Je(n)}}};return d.__vgaiRender=b,b}function oe(e,t,n,s){const l=s?.pausable??!0,d=U({id:s?.id??"main",kind:"three",pausable:l,adapter:t,mounted:n,scene:n.scene,binding:Y(e,s?.declaration,{surface:"three",adapter:t},n,l)});return e.registerRoot(d),d}function Y(e,t,n,s,l){return t?ue({...t,adapter:n,mounted:s,pausable:l,debugRegistry:Se(e)}):null}function se(e,t,n,s){const l=s?.id??"main",d=s?.pausable??!0,f=U({id:l,kind:"canvas",pausable:d,adapter:t,mounted:n,canvasRoot:n.substrate.root,binding:Y(e,s?.declaration,{surface:"canvas",adapter:t},n,d)});return e.registerRoot(f),f}function ie(e,t,n,s,l){const d=l?.pausable??!0,f=U({id:l?.id??"main",kind:"dom",pausable:d,adapter:t,mounted:n,container:s,binding:Y(e,l?.declaration,{surface:"dom",adapter:t},n,d)});return e.registerRoot(f),f}async function ot(e){return mt(e)}function st(e){return{domElement:e,render(){},setPixelRatio(){},setClearColor(){},setSize(){},dispose(){},forceContextLoss(){}}}function ae(e,t){try{e.mounted.dispose()}finally{e.renderer?.dispose(),e.renderer?.forceContextLoss();try{(e.element.parentNode??t).removeChild(e.element)}catch{}}}async function it(e,t){const{game:n,canvas:s,w:l,h:d,dpr:f,isBottom:w,headless:g,assets:b,antialias:r}=t,o=g?st(s):me(s,l,d,r===void 0?void 0:{antialias:r},{alpha:!w,preserveDrawingBuffer:!0});o.setSize(l,d,!1),s.style.width="100%",s.style.height="100%",o.setPixelRatio(f),w||o.setClearColor(0,0);const i={three:pe,surface:{canvas:s,width:l,height:d},renderer:o,assets:b,headless:g,game:n},p=await e.adapter.mount(i);return oe(n,e.adapter,p,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"three",element:s,mounted:p,renderer:o},routerEntry:{id:e.id,zOrder:e.zOrder??0,canvas:s,hitTest:e.hitTest}}}async function at(e,t){const{game:n,canvas:s,w:l,h:d,dpr:f,headless:w,isBottom:g}=t,b={canvas:s,width:l,height:d,game:n,headless:w,dpr:f,transparent:!g,preserveDrawingBuffer:!0},r=await e.adapter.mount(b);return se(n,e.adapter,r,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"canvas",element:s,mounted:r,renderer:void 0},routerEntry:{id:e.id,zOrder:e.zOrder??0,canvas:s,hitTest:e.hitTest??(r.hitTest?(o,i)=>r.hitTest(o,i):void 0)}}}async function dt(e,t,n){n.style.pointerEvents="none",n.style.width="100%",n.style.height="100%";const s={container:n,game:t},l=await e.adapter.mount(s);return ie(t,e.adapter,l,n,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"dom",element:n,mounted:l,renderer:void 0}}}function ct(e){return()=>{}}async function lt(e,t,n){const{surfacesById:s,container:l,...d}=n,f=[],w=[];try{for(const g of e){const b=g.id===t;if(g.kind==="dom"){const E=s.get(g.id),{mountedEntry:v}=await dt(g,d.game,E);f.push(v);continue}const r=s.get(g.id),o={...d,canvas:r,isBottom:b};let i,p;g.kind==="three"?{mountedEntry:i,routerEntry:p}=await it(g,o):g.kind==="canvas"?{mountedEntry:i,routerEntry:p}=await at(g,o):le(g,"create-runtime mount loop"),f.push(i),w.push(p)}}catch(g){for(let b=f.length-1;b>=0;b--){const r=f[b];try{ae(r,l)}catch(o){console.error(`createGameRuntime: rolling back root "${r.id}" after a mount failure threw:`,o)}}throw g}return{mountedEntries:f,routerEntries:w}}function ut(e,t,n){const s=n??(typeof window<"u"?window:void 0);if(s!==void 0)return rt({game:e,clock:{seek(){},seekFrame(){}},readiness:{scene(){}},location:t,target:s}),()=>{delete s.__vgaiRender}}function ft(e,t,n){try{e.dispose()}catch(s){console.error("createGameRuntime: disposing the game after a mount failure threw:",s)}for(const s of t)try{(s.parentNode??n).removeChild(s)}catch{}}async function mt(e){const{container:t,roots:n,width:s,height:l,headless:d=!1,seed:f,playtest:w}=e;if(n.length===0)throw new Error("createGameRuntime: `roots` must contain at least one root.");const g=n,b=Math.max(1,s??t.clientWidth??0),r=Math.max(1,l??t.clientHeight??0),o=d?1:Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);t.style.position||(t.style.position="relative");const i=g.map(c=>({id:c.id,zOrder:c.zOrder??0,hitTest:c.hitTest})),p=B(i),E=p[0]?.id,v=new Map(g.map(c=>[c.id,c.kind])),$=new Map;p.forEach((c,R)=>{const u=v.get(c.id)==="dom",m=document.createElement(u?"div":"canvas");if(m.dataset.vgaiRootSurface="true",m.dataset.vgaiRootId=c.id,!u){const S=m;S.width=b,S.height=r}m.style.cssText=`position:absolute;top:0;left:0;width:100%;height:100%;z-index:${R+1};contain:layout paint;`,t.appendChild(m),$.set(c.id,m)});const A=fe(),D=e.renderControl?.location??(typeof window<"u"?window.location:void 0),T=D!==void 0&&re(D);let C=!1;const P=Fe({fixedTimestep:1/60,maxSubSteps:8,externalDrive:T,update:c=>{C&&x.runFrame(c,{skipRenderPhases:!0})},render:(c,R)=>{C&&x.runRenderFrame(c,R)}}),x=Be({loop:P,assets:A,seed:f,playtest:w});let I;try{I=await lt(g,E,{game:x,surfacesById:$,container:t,w:b,h:r,dpr:o,headless:d,assets:A,antialias:e.antialias})}catch(c){throw ft(x,$.values(),t),c}const{mountedEntries:L,routerEntries:z}=I,G=Ve(t,z);C=!0,P.start();const q=ct(),M=T&&D!==void 0?ut(x,D,e.renderControl?.target):void 0;let a;const h=new Promise(c=>{a=c});let k=!1;function y(){if(k)return;k=!0;const c=[],R=(u,m)=>{try{m()}catch(S){c.push({step:u,error:S})}};try{R("loop.stop",()=>P.stop()),R("router.dispose",()=>G.dispose());for(const u of L)R(`root "${u.id}"`,()=>ae(u,t));R("game.dispose",()=>x.dispose()),R("dev globals",()=>q()),R("render harness",()=>M?.())}finally{Promise.allSettled(L.map(u=>u.mounted.disposeComplete??Promise.resolve())).then(()=>a())}if(c.length>0)throw new AggregateError(c.map(u=>u.error),`Game session teardown failed in ${c.length} step(s): ${c.map(u=>u.step).join(", ")}. Every other step still ran.`)}return{stop:y,stopComplete:h,pause(){x.play.pause()},resume(){x.play.resume()},step(){x.play.step()},resize(c,R,u){const m=Math.max(1,c),S=Math.max(1,R);for(const O of L)u!==void 0&&O.renderer?.setPixelRatio(u),O.renderer?.setSize(m,S,!1),O.mounted.resize?.(m,S)},game:x}}const Ot=Object.freeze(Object.defineProperty({__proto__:null,createGameRuntime:ot,registerCanvasRoot:se,registerReactRoot:ie,registerThreeRoot:oe},Symbol.toStringTag,{value:"Module"}));export{Be as a,Fe as b,ot as c,oe as d,Ot as e,At as g,se as r};
3
+ ${l}`)),n()}return{enable(){n=Math.random,Math.random=s},disable(){Math.random===s&&n&&(Math.random=n,n=void 0)}}}const te=ee("gameplay-rng-trap");function ze(e,t){te.set(e,t)}function At(e){return te.get(e)??null}const Ne=F.filter(e=>e===_.PRE_RENDER||e===_.RENDER);function U(e){const{id:t,kind:n,pausable:s=!0,adapter:l,mounted:d,scene:f,canvasRoot:w,container:g,physics:b,collisions:r,physics2d:o,camera:i,frame:p,binding:E=null}=e;if(n==="three"&&!f)throw new Error(`RootInstance "${t}" (kind: three): a three world requires a scene — pass \`scene\` in RootInstanceInit.`);if(n==="canvas"&&w==null)throw new Error(`RootInstance "${t}" (kind: canvas): a canvas world requires a native substrate root — pass \`canvasRoot\` in RootInstanceInit.`);if(n==="dom"&&!g)throw new Error(`RootInstance "${t}" (kind: react): a react world requires a container — pass \`container\` in RootInstanceInit.`);let v=!1;const $=d.dispose.bind(d);return d.dispose=()=>{v=!0,$()},{id:t,kind:n,pausable:s,adapter:l,mounted:d,physics:b,collisions:r,physics2d:o,camera:i,frame:p?{runPhase(D,T){v||p.runPhase(D,T)},endFrame(){v||p.endFrame?.()}}:void 0,binding:E,get disposed(){return v},threeScene(){if(n!=="three"||!f)throw new Error(`RootInstance "${t}" (kind: ${n}): threeScene() requested but this world is not a three world`);return f},canvasRoot(){if(n!=="canvas"||w===void 0||w===null)throw new Error(`RootInstance "${t}" (kind: ${n}): canvasRoot() requested but this world is not a canvas world`);return w},reactRoot(){if(n!=="dom"||!g)throw new Error(`RootInstance "${t}" (kind: ${n}): reactRoot() requested but this world is not a react world`);return g}}}function qe(e){const{physics:t,rapierWorld:n}=e;return!t||!n?null:{physics:t,rapierWorld:n}}function je(e,t){const n=[];e.traverse(s=>n.push(s));for(const s of t){const l=qe(s);if(l)for(const d of n){const f=l.physics.get(d);f&&(l.rapierWorld.removeRigidBody(f.body),l.physics.remove(d))}}e.removeFromParent();for(const s of n){const l=s;Oe(s,"__sharedGeometry")||l.geometry?.dispose();const d=l.material;if(Array.isArray(d))for(const f of d)f.dispose();else d?.dispose()}}function He(e){return[]}function Be(e){const t=[],n=De(),s=_e(n.systemObserver,"game"),l=ye(e.seed??be),d=Ge();let f=!1;const w={setEnabled(a){f=a},get enabled(){return f}};let g=0,b=0,r=0;const o=new Set,i=Ce({dispose:a=>je(a,t.flatMap(He))}),p=Re({getTick:()=>g,getSimT:()=>b,getFixedDt:()=>e.loop.fixedDt,getDefaultRootId:()=>t.length>0?v().id:null,getLoopLiveness:()=>e.loop.liveness});let E=!1;function v(){if(t.length===0)throw new Error("Game.defaultRoot: no roots registered yet");return t.find(a=>a.kind==="three")??t[0]}const $=new Set,A=new Set,D=new Map,T=new Map;function C(){const a={debug:p.adapter},h=new Map([["debug","(game)"]]),k=(y,c,R)=>{for(const u of Object.keys(c)){if(c[u]===void 0)continue;const m=h.get(u);if(m!==void 0){if(a[u]===c[u]||R?.has(u))continue;$.has(u)||($.add(u),console.warn(`[game] systemAdapters: "${u}" is registered by both ${m} and ${y} — the FIRST registration (${m}) wins; the later one is shadowed (game-scoped system adapters).`));continue}a[u]=c[u],h.set(u,y)}};for(const y of t){const c=D.get(y.id);c&&k(`world "${y.id}" (declared systems export)`,c);const R=y.mounted.systems;R&&k(`world "${y.id}"`,R,c?new Set(Object.keys(c)):void 0)}return a}let P=!1;const x=new Set;function I(a,h,k){const y=`${a}:${h}`;if(x.has(y))return;x.add(y);const c=a==="loop"?$e({worldId:h,reason:k}):Pe({worldId:h,reason:k});console.warn(c)}const L=new WeakMap;function N(a){for(const h of t){if(h.disposed||!h.pausable)continue;h.mounted.drivesOwnLoop&&(h.mounted.setPaused?h.mounted.setPaused(a):a&&I("loop",h.id,"self-driven world, adapter declares no setPaused capability"));const k=D.get(h.id)?.audio??h.mounted.systems?.audio;k?a?(L.has(k)||L.set(k,k.isMuted()),k.setMuted(!0)):L.has(k)&&(k.setMuted(L.get(k)),L.delete(k)):a&&!T.get(h.id)?.some(y=>y.slot==="audio")&&I("audio",h.id,"no SystemAdapters.audio on this world")}}function G(a,h){f&&d.enable(),n.beginFrame();const k=h?.skipRenderPhases??!1,y=h?.onlyFrozen??!1,c=t.length;E=!1;for(let u=0;u<c;u++){const m=t[u];if(!m.disposed){if(y){if(P&&m.pausable&&!m.mounted.drivesOwnLoop){E=!0;break}}else if(m.mounted.drivesOwnLoop?!P||!m.pausable||!m.mounted.setPaused:!P||!m.pausable){E=!0;break}}}let R=!1;if(!y)for(let u=0;u<c;u++){const m=t[u];if(!m.disposed&&m.mounted.drivesOwnLoop&&(!P||!m.pausable||!m.mounted.setPaused)){R=!0;break}}if(y){for(const u of F){n.beginPhase(),E&&s.runPhase(u,a);for(let m=0;m<c;m++){const S=t[m];if(!S.disposed&&!S.mounted.drivesOwnLoop&&P&&S.pausable)try{S.frame?.runPhase(u,a)}catch(O){console.error(`[game] world "${S.id}" (kind: ${S.kind}) runPhase("${u}") threw (step()):`,O)}}n.endPhase(u)}for(let u=0;u<c;u++){const m=t[u];if(!m.disposed&&!m.mounted.drivesOwnLoop&&P&&m.pausable)if(R=!0,m.frame)try{m.frame.endFrame?.()}catch(S){console.error(`[game] world "${m.id}" (kind: ${m.kind}) endFrame() threw (step()):`,S)}else try{m.mounted.update?.(a)}catch(S){console.error(`[game] world "${m.id}" (kind: ${m.kind}) update() threw (step()):`,S)}}}else{for(const u of F){if(n.beginPhase(),!(k&&(u===_.PRE_RENDER||u===_.RENDER))){s.runPhase(u,a);for(let S=0;S<c;S++){const O=t[S];if(O.disposed||O.mounted.drivesOwnLoop)continue;const W=P&&O.pausable;if(W&&u!==_.RENDER)continue;const de=W?0:a;try{O.frame?.runPhase(u,de)}catch(ce){console.error(`[game] world "${O.id}" (kind: ${O.kind}) runPhase("${u}") threw:`,ce)}}}n.endPhase(u)}for(let u=0;u<c;u++){const m=t[u];if(!(m.disposed||m.mounted.drivesOwnLoop||P&&m.pausable)){if(R=!0,m.frame)try{m.frame.endFrame?.()}catch(O){console.error(`[game] world "${m.id}" (kind: ${m.kind}) endFrame() threw:`,O)}else if(!(k&&m.mounted.updateCadence==="display"))try{m.mounted.update?.(a)}catch(O){console.error(`[game] world "${m.id}" (kind: ${m.kind}) update() threw:`,O)}}}}R&&(g++,b+=a,i.flush(b)),n.endFrame(),f&&d.disable()}function q(a,h){if(r=a,f&&d.enable(),n.beginFrame(),o.size>0)for(const y of[...o])try{y(a,h)}catch(c){console.error("[game] an onRenderStep callback threw:",c)}const k=t.length;for(const y of Ne){n.beginPhase(),s.runPhase(y,h);for(let c=0;c<k;c++){const R=t[c];if(R.disposed||R.mounted.drivesOwnLoop)continue;const u=P&&R.pausable;if(!(u&&y!==_.RENDER))try{R.frame?.runPhase(y,u?0:h)}catch(m){console.error(`[game] world "${R.id}" (kind: ${R.kind}) runPhase("${y}") threw (display frame):`,m)}}n.endPhase(y)}for(let y=0;y<k;y++){const c=t[y];if(c.disposed||c.mounted.drivesOwnLoop||c.frame||c.mounted.updateCadence!=="display")continue;const R=P&&c.pausable;try{c.mounted.update?.(R?0:h)}catch(u){console.error(`[game] world "${c.id}" (kind: ${c.kind}) update() threw (display frame):`,u)}}n.endFrame(),f&&d.disable()}const M={loop:e.loop,assets:e.assets,playtest:e.playtest??null,profiler:n,systems:s,get roots(){return t},world(a){return t.find(h=>h.id===a)??null},get defaultRoot(){return v()},get systemAdapters(){return C()},subscribeSystemAdapters(a){return A.add(a),()=>A.delete(a)},notifySystemAdaptersChanged(){for(const a of A)a()},get declaredSystemAbsences(){return[...T.values()].flat()},installDeclaredSystemAdapters(a,h,k=[]){const y=t.find(u=>u.id===a);if(!y)throw new Error(`installDeclaredSystemAdapters: no mounted root is named "${a}" (mounted: ${t.map(u=>`"${u.id}"`).join(", ")||"none"}).`);if(D.has(a))throw new Error(`installDeclaredSystemAdapters: root "${a}" already installed its declared systems — a declaration is static and installs exactly once per mount.`);const c=y.mounted.systemScope??y.mounted,R=Object.fromEntries(Object.entries(h).map(([u,m])=>[u,m===void 0?void 0:Ae(m,c)]));D.set(a,R),T.set(a,k),M.notifySystemAdaptersChanged()},play:{get paused(){return P},pause(){P||(P=!0,N(!0))},resume(){P&&(P=!1,N(!1))},step(a=1/60){if(P)for(const h of t)h.disposed||!h.pausable||!h.mounted.drivesOwnLoop||h.mounted.setPaused&&(h.mounted.step?h.mounted.step():I("loop",h.id,"self-driven world, adapter declares no step capability"));G(a,{onlyFrozen:!0})}},registerRoot(a){if(t.some(h=>h.id===a.id))throw new Error(`Game.registerRoot: duplicate world id "${a.id}"`);if(t.some(h=>h.mounted===a.mounted))throw new Error(`Game.registerRoot: world "${a.id}" shares its \`mounted\` object with an already-registered world ("${t.find(h=>h.mounted===a.mounted).id}") — the same mount cannot be registered twice.`);t.push(a),M.notifySystemAdaptersChanged(),a.mounted.drivesOwnLoop&&a.kind!=="dom"&&!a.mounted.observe&&console.warn(`[game] world "${a.id}" (kind: ${a.kind}, adapter: "${a.adapter.id}"): no state bridge — this mounted game has no \`observe\` (RootStateObserver); the editor's observations cannot subscribe to its state.`)},runFrame(a,h){G(a,h)},runRenderFrame(a,h){q(a,h)},get renderAlpha(){return r},onRenderStep(a,h){const k=h?.signal;if(k?.aborted)return()=>{};o.add(a);let y=null;const c=()=>{o.delete(a),y?.(),y=null};return k&&(k.addEventListener("abort",c,{once:!0}),y=()=>k.removeEventListener("abort",c)),c},runTicks(a,h){if(!Number.isInteger(a)||a<0)throw new RangeError(`Game.runTicks: n must be a non-negative integer, got ${a}`);if(P)throw new ke("RUN_TICKS_PAUSED","Game.runTicks: refused — Game.play.paused is true; stepping the frozen set is Game.play.step()'s contract, not runTicks'");const k=h?.render??"last",y=e.loop.fixedDt;for(let c=0;c<a;c++){const R=c===a-1;G(y,{skipRenderPhases:k==="all"?!1:k==="none"?!0:!R})}},dispose(){i.dispose(),p.strip()}};return Ee(M,p),p.setRunTicksTarget({runTicks:M.runTicks}),we(M,l),ze(M,w),Le(M,i),M}function Ue(e){B(e).forEach((n,s)=>{n.canvas.style.pointerEvents=s===0?"auto":"none"})}const K=["pointerdown","pointerup","pointermove","click","wheel"];function Ye(e){const t=e,n=["clientX","clientY","screenX","screenY","offsetX","offsetY","button","buttons","ctrlKey","altKey","shiftKey","metaKey","pointerId","pointerType","pressure","isPrimary","deltaX","deltaY","deltaZ","deltaMode"],s={bubbles:!0,cancelable:!0,composed:!0};for(const l of n)l in t&&(s[l]=t[l]);return s}const ne=new WeakSet;function We(e,t){const n=globalThis,s=t.type==="wheel"?n.WheelEvent:t.type.startsWith("pointer")?n.PointerEvent:n.MouseEvent??n.PointerEvent;if(!(!s||typeof e.dispatchEvent!="function"))try{const l=new s(t.type,Ye(t));ne.add(l),e.dispatchEvent(l)}catch{}}function Ve(e,t){Ue(t);const n=new Map(t.map(d=>[d.id,d])),s=B(t)[0]?.id,l=d=>{if(ne.has(d))return;const f=e.getBoundingClientRect?.()??{left:0,top:0},w=d.clientX??0,g=d.clientY??0,b=w-f.left,r=g-f.top,o=V(t,b,r);if(o&&o!==s){const i=n.get(o);i&&(d.stopPropagation(),We(i.canvas,d))}};for(const d of K)e.addEventListener?.(d,l,!0);return{resolveClaim:(d,f)=>V(t,d,f),dispose(){for(const d of K)e.removeEventListener?.(d,l,!0)}}}function re(e){return new URLSearchParams(e.search).get(ve)==="1"}const Xe=[_.PRE_RENDER,_.RENDER];async function Ke(e){const t=Qe(e);for(const n of Xe){e.systems.runPhase(n,0);for(const s of t)s.frame.runPhase(n,0)}await et()}function Qe(e){const t=[];for(const n of e.roots){if(n.mounted.drivesOwnLoop){Q(n.id,"drives its own loop — renderOnce() cannot frame-gate it");continue}if(!n.frame){Q(n.id,`(kind: ${n.kind}) has no phase hooks — renderOnce() cannot drive it (opaque/foreign mount with no frame-gated entry point)`);continue}t.push({id:n.id,frame:n.frame})}return t}function Q(e,t){console.warn(`[render-control] world "${e}" ${t}.`)}function Ze(e){const t=[];for(const n of e.roots){if(n.mounted.drivesOwnLoop){t.push(`world "${n.id}" drives its own loop — cannot be frame-gated for deterministic capture (the policy is to FAIL LOUDLY, or be excluded only by an explicit declared policy).`);continue}n.frame||t.push(`world "${n.id}" (kind: ${n.kind}) has no phase hooks — an opaque/foreign mount with no frame-gated entry point cannot participate in deterministic capture.`)}return t}function Z(e){let t=0,n=0;const s=[...e.children??[]];for(;s.length>0;){const l=s.pop();t++,l.userData?.entityId!==void 0&&n++,l.children&&s.push(...l.children)}return{nodes:t,entities:n}}function Je(e){const t=[];for(const n of e.roots)n.kind==="three"?t.push({id:n.id,kind:n.kind,...Z(n.threeScene())}):n.kind==="canvas"&&n.mounted.kind==="canvas"&&n.mounted.substrate.name==="pixi"&&t.push({id:n.id,kind:n.kind,...Z(n.canvasRoot())});return t}function J(){return new Promise(e=>{requestAnimationFrame(()=>e())})}async function et(){await J(),await J()}async function z(e){if(!e)return{status:"not-applicable"};try{return await e(),{status:"ready"}}catch(t){return{status:"error",detail:t instanceof Error?t.message:String(t)}}}async function tt(){if(typeof document>"u"||!document.fonts)return{status:"not-applicable"};try{return await document.fonts.ready,{status:"ready"}}catch(e){return{status:"error",detail:e instanceof Error?e.message:String(e)}}}async function nt(e){const[t,n,s,l,d,f]=await Promise.all([z(e.assets),z(e.shaders),tt(),z(e.sequences),z(e.tone),z(e.scene)]);return{assets:t,shaders:n,fonts:s,sequences:l,tone:d,scene:f}}function rt(e){const t=e.location??window.location;if(!re(t))return;const{game:n,clock:s,readiness:l={}}=e,d=e.target??window,f=e.frameAdvancers??[],w=e.simulateFixedDt??1/60,g=e.excludedFromDeterminism??[],b={seek(r){s.seek(r)},seekFrame(r,o){s.seekFrame(r,o)},advanceFrame(r){for(const o of f)o(r)},renderOnce(){return Ke(n)},ready(){return nt(l)},simulateSubsteps(r){for(let o=0;o<r;o++)n.runFrame(w)},excludedFromDeterminism(){return[...g,...Ze(n)]},simulateFixedDt(){return w},perfSample(r){const o=n.profiler,i=o.enabled;o.enabled=!0,o.clear();const p=[];try{for(let E=0;E<r;E++){n.runFrame(w);const v=o.getSnapshot(),$=v.frames.at(-1);p.push({cpuMs:$?.cpuMs??0,phases:Object.fromEntries(($?.phases??[]).map(A=>[A.name,A.ms])),render:{...v.render}})}}finally{o.enabled=i}return{frames:p,worlds:Je(n)}}};return d.__volterRender=b,b}function oe(e,t,n,s){const l=s?.pausable??!0,d=U({id:s?.id??"main",kind:"three",pausable:l,adapter:t,mounted:n,scene:n.scene,binding:Y(e,s?.declaration,{surface:"three",adapter:t},n,l)});return e.registerRoot(d),d}function Y(e,t,n,s,l){return t?ue({...t,adapter:n,mounted:s,pausable:l,debugRegistry:Se(e)}):null}function se(e,t,n,s){const l=s?.id??"main",d=s?.pausable??!0,f=U({id:l,kind:"canvas",pausable:d,adapter:t,mounted:n,canvasRoot:n.substrate.root,binding:Y(e,s?.declaration,{surface:"canvas",adapter:t},n,d)});return e.registerRoot(f),f}function ie(e,t,n,s,l){const d=l?.pausable??!0,f=U({id:l?.id??"main",kind:"dom",pausable:d,adapter:t,mounted:n,container:s,binding:Y(e,l?.declaration,{surface:"dom",adapter:t},n,d)});return e.registerRoot(f),f}async function ot(e){return mt(e)}function st(e){return{domElement:e,render(){},setPixelRatio(){},setClearColor(){},setSize(){},dispose(){},forceContextLoss(){}}}function ae(e,t){try{e.mounted.dispose()}finally{e.renderer?.dispose(),e.renderer?.forceContextLoss();try{(e.element.parentNode??t).removeChild(e.element)}catch{}}}async function it(e,t){const{game:n,canvas:s,w:l,h:d,dpr:f,isBottom:w,headless:g,assets:b,antialias:r}=t,o=g?st(s):me(s,l,d,r===void 0?void 0:{antialias:r},{alpha:!w,preserveDrawingBuffer:!0});o.setSize(l,d,!1),s.style.width="100%",s.style.height="100%",o.setPixelRatio(f),w||o.setClearColor(0,0);const i={three:pe,surface:{canvas:s,width:l,height:d},renderer:o,assets:b,headless:g,game:n},p=await e.adapter.mount(i);return oe(n,e.adapter,p,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"three",element:s,mounted:p,renderer:o},routerEntry:{id:e.id,zOrder:e.zOrder??0,canvas:s,hitTest:e.hitTest}}}async function at(e,t){const{game:n,canvas:s,w:l,h:d,dpr:f,headless:w,isBottom:g}=t,b={canvas:s,width:l,height:d,game:n,headless:w,dpr:f,transparent:!g,preserveDrawingBuffer:!0},r=await e.adapter.mount(b);return se(n,e.adapter,r,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"canvas",element:s,mounted:r,renderer:void 0},routerEntry:{id:e.id,zOrder:e.zOrder??0,canvas:s,hitTest:e.hitTest??(r.hitTest?(o,i)=>r.hitTest(o,i):void 0)}}}async function dt(e,t,n){n.style.pointerEvents="none",n.style.width="100%",n.style.height="100%";const s={container:n,game:t},l=await e.adapter.mount(s);return ie(t,e.adapter,l,n,{id:e.id,pausable:e.pausable,declaration:e.declaration}),{mountedEntry:{id:e.id,kind:"dom",element:n,mounted:l,renderer:void 0}}}function ct(e){return()=>{}}async function lt(e,t,n){const{surfacesById:s,container:l,...d}=n,f=[],w=[];try{for(const g of e){const b=g.id===t;if(g.kind==="dom"){const E=s.get(g.id),{mountedEntry:v}=await dt(g,d.game,E);f.push(v);continue}const r=s.get(g.id),o={...d,canvas:r,isBottom:b};let i,p;g.kind==="three"?{mountedEntry:i,routerEntry:p}=await it(g,o):g.kind==="canvas"?{mountedEntry:i,routerEntry:p}=await at(g,o):le(g,"create-runtime mount loop"),f.push(i),w.push(p)}}catch(g){for(let b=f.length-1;b>=0;b--){const r=f[b];try{ae(r,l)}catch(o){console.error(`createGameRuntime: rolling back root "${r.id}" after a mount failure threw:`,o)}}throw g}return{mountedEntries:f,routerEntries:w}}function ut(e,t,n){const s=n??(typeof window<"u"?window:void 0);if(s!==void 0)return rt({game:e,clock:{seek(){},seekFrame(){}},readiness:{scene(){}},location:t,target:s}),()=>{delete s.__volterRender}}function ft(e,t,n){try{e.dispose()}catch(s){console.error("createGameRuntime: disposing the game after a mount failure threw:",s)}for(const s of t)try{(s.parentNode??n).removeChild(s)}catch{}}async function mt(e){const{container:t,roots:n,width:s,height:l,headless:d=!1,seed:f,playtest:w}=e;if(n.length===0)throw new Error("createGameRuntime: `roots` must contain at least one root.");const g=n,b=Math.max(1,s??t.clientWidth??0),r=Math.max(1,l??t.clientHeight??0),o=d?1:Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);t.style.position||(t.style.position="relative");const i=g.map(c=>({id:c.id,zOrder:c.zOrder??0,hitTest:c.hitTest})),p=B(i),E=p[0]?.id,v=new Map(g.map(c=>[c.id,c.kind])),$=new Map;p.forEach((c,R)=>{const u=v.get(c.id)==="dom",m=document.createElement(u?"div":"canvas");if(m.dataset.volterRootSurface="true",m.dataset.volterRootId=c.id,!u){const S=m;S.width=b,S.height=r}m.style.cssText=`position:absolute;top:0;left:0;width:100%;height:100%;z-index:${R+1};contain:layout paint;`,t.appendChild(m),$.set(c.id,m)});const A=fe(),D=e.renderControl?.location??(typeof window<"u"?window.location:void 0),T=D!==void 0&&re(D);let C=!1;const P=Fe({fixedTimestep:1/60,maxSubSteps:8,externalDrive:T,update:c=>{C&&x.runFrame(c,{skipRenderPhases:!0})},render:(c,R)=>{C&&x.runRenderFrame(c,R)}}),x=Be({loop:P,assets:A,seed:f,playtest:w});let I;try{I=await lt(g,E,{game:x,surfacesById:$,container:t,w:b,h:r,dpr:o,headless:d,assets:A,antialias:e.antialias})}catch(c){throw ft(x,$.values(),t),c}const{mountedEntries:L,routerEntries:N}=I,G=Ve(t,N);C=!0,P.start();const q=ct(),M=T&&D!==void 0?ut(x,D,e.renderControl?.target):void 0;let a;const h=new Promise(c=>{a=c});let k=!1;function y(){if(k)return;k=!0;const c=[],R=(u,m)=>{try{m()}catch(S){c.push({step:u,error:S})}};try{R("loop.stop",()=>P.stop()),R("router.dispose",()=>G.dispose());for(const u of L)R(`root "${u.id}"`,()=>ae(u,t));R("game.dispose",()=>x.dispose()),R("dev globals",()=>q()),R("render harness",()=>M?.())}finally{Promise.allSettled(L.map(u=>u.mounted.disposeComplete??Promise.resolve())).then(()=>a())}if(c.length>0)throw new AggregateError(c.map(u=>u.error),`Game session teardown failed in ${c.length} step(s): ${c.map(u=>u.step).join(", ")}. Every other step still ran.`)}return{stop:y,stopComplete:h,pause(){x.play.pause()},resume(){x.play.resume()},step(){x.play.step()},resize(c,R,u){const m=Math.max(1,c),S=Math.max(1,R);for(const O of L)u!==void 0&&O.renderer?.setPixelRatio(u),O.renderer?.setSize(m,S,!1),O.mounted.resize?.(m,S)},game:x}}const Ot=Object.freeze(Object.defineProperty({__proto__:null,createGameRuntime:ot,registerCanvasRoot:se,registerReactRoot:ie,registerThreeRoot:oe},Symbol.toStringTag,{value:"Module"}));export{Be as a,Fe as b,ot as c,oe as d,Ot as e,At as g,se as r};
@@ -0,0 +1 @@
1
+ import{d_ as f,bA as d,u as x,by as y}from"./index-Cr9NTnJp.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 g="x-volter-curve";function p(r,n){return r[n].label??n}function v(r,n,e){const s=r.points;for(let t=0;t<s.length;t++){const o=s[t];for(const a of["x","y"]){const{min:u,max:c}=n[a];(o[a]<u||o[a]>c)&&e.addIssue({code:"custom",path:["points",t,a],message:`${o[a]} is outside this curve's ${p(n,a)} domain [${u}, ${c}] — move the point inside the domain, or widen the axis in the schema (curve({ ${a}: { min, max } })).`})}if(t===0)continue;const i=s[t-1];o.x<=i.x&&e.addIssue({code:"custom",path:["points",t,"x"],message:`${o.x} must be strictly greater than the previous point's x (${i.x}) — curve points run left to right along x, with no duplicate x. Sort the points, or nudge this one.`})}}function K(r){const n=f({x:d().describe(`Position along ${p(r,"x")}.`),y:d().describe(`Value at that position, along ${p(r,"y")}.`)});return f({interpolation:y(["linear","smooth"]).describe('How the value moves between points: "linear" for straight segments, "smooth" for a monotone cubic that never overshoots them.'),points:x(n).min(2,{message:'a curve needs at least two points — add another { "x": …, "y": … } so the value has somewhere to travel between.'}).describe("Keys in increasing x order; the value is clamped outside the first/last x.")}).superRefine((e,s)=>v(e,r,s)).meta({[g]:r})}function M(r){let n=r;for(let e=0;e<5&&n;e++){const t=n.meta?.()?.[g];if(t&&typeof t=="object"&&"x"in t&&"y"in t)return t;n=n.def?.innerType}}function b(r){const n=r.length,e=[];for(let t=0;t<n-1;t++){const o=r[t],i=r[t+1];e.push((i.y-o.y)/(i.x-o.x))}const s=[e[0]];for(let t=1;t<n-1;t++)s.push((e[t-1]+e[t])/2);s.push(e[n-2]);for(let t=0;t<n-1;t++){const o=e[t];if(o===0){s[t]=0,s[t+1]=0;continue}let i=s[t]/o,a=s[t+1]/o;i<0&&(s[t]=0,i=0),a<0&&(s[t+1]=0,a=0);const u=i*i+a*a;if(u>9){const c=3/Math.sqrt(u);s[t]=c*i*o,s[t+1]=c*a*o}}return s}function O(r,n){const e=r.points;if(e.length===0)return 0;const s=e[0],t=e[e.length-1];if(e.length===1||n<=s.x)return s.y;if(n>=t.x)return t.y;let o=0;for(;o<e.length-2&&n>=e[o+1].x;)o++;const i=e[o],a=e[o+1],u=a.x-i.x;if(u<=0)return i.y;const c=(n-i.x)/u;if(r.interpolation==="linear")return i.y+(a.y-i.y)*c;const m=b(e),h=c*c,l=h*c;return(2*l-3*h+1)*i.y+(l-2*h+c)*u*m[o]+(-2*l+3*h)*a.y+(l-h)*u*m[o+1]}export{K as curve,M as curveAxesOf,O as sampleCurve};
@@ -1,4 +1,4 @@
1
- import{d_ as p}from"./index-CaG87ZF-.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 y(o,e,t){let i=c(o,e,t);const s=new Set;return{get:()=>i,sourcePath:t,subscribe(r){return s.add(r),()=>s.delete(r)},hotSwap(r){let n;try{n=c(o,r,t)}catch(a){console.error(`[data] hot edit rejected, keeping previous values.
1
+ import{d$ as p}from"./index-Cr9NTnJp.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 y(o,e,t){let i=c(o,e,t);const s=new Set;return{get:()=>i,sourcePath:t,subscribe(r){return s.add(r),()=>s.delete(r)},hotSwap(r){let n;try{n=c(o,r,t)}catch(a){console.error(`[data] hot edit rejected, keeping previous values.
2
2
  ${String(a)}`);return}i=n;for(const a of s)a(i)}}}function S(o){const e=p(o,{io:"input"});if(e.type==="object"){const t=e.properties??{};t.$schema??={type:"string"},e.properties=t}return e}function c(o,e,t){const i=e!==null&&typeof e=="object"&&!Array.isArray(e)&&"$schema"in e?Object.fromEntries(Object.entries(e).filter(([r])=>r!=="$schema")):e,s=o.safeParse(i);if(!s.success){const r=s.error.issues.map(n=>` - ${n.path.join(".")||"(root)"}: ${n.message}`).join(`
3
3
  `);throw new Error(`Data asset "${t}" failed its schema:
4
4
  ${r}
@@ -0,0 +1 @@
1
+ const u=/^([A-Za-z0-9_-]+)#([A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*)$/;function f(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function l(t,e,r){const n=[];return c(e,"",!0,(s,i)=>{const o=g(t,s,i,r);o&&n.push(o)}),n}function c(t,e,r,n){if(typeof t=="string"){n(t,e);return}if(Array.isArray(t)){t.forEach((s,i)=>{c(s,`${e}[${i}]`,!1,n)});return}if(f(t))for(const[s,i]of Object.entries(t))r&&s==="$schema"||c(i,e?`${e}.${s}`:s,!1,n)}function g(t,e,r,n){const s=u.exec(e);return!s||!n.has(s[1])?null:{inAsset:t,atPath:r||"(root)",ref:e,targetAsset:s[1],targetKeyPath:s[2].split(".")}}function A(t){const e=new Set(t.keys()),r=[];for(const[n,s]of t)for(const i of l(n,s,e)){const o=m(t.get(i.targetAsset),i);o!==null&&r.push({...i,missingSegment:o})}return r}function m(t,e){let r=t;for(const n of e.targetKeyPath){if(!f(r)||!(n in r))return n;r=r[n]}return null}function y(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function d(t){const e=[];return a(t,"",e),e}function a(t,e,r){const n=y(t);if(n){if(typeof n["x-volter-ref"]=="string"){r.push({fieldPath:e||"(root)",targetStem:n["x-volter-ref"]});return}if(f(n.properties))for(const[s,i]of Object.entries(n.properties))s!=="$schema"&&a(i,e?`${e}.${s}`:s,r);f(n.additionalProperties)&&a(n.additionalProperties,e,r)}}function h(t,e){return t.filter(r=>!e.has(r.targetStem)).map(r=>({fieldPath:r.fieldPath,targetStem:r.targetStem}))}export{u as DATA_REF_PATTERN,l as collectDataRefs,d as collectDeclaredRefFields,A as findDanglingDataRefs,h as findMissingRefTargets};
@@ -0,0 +1 @@
1
+ import{DATA_REF_PATTERN as p}from"./data-check-core-CHqar_E8.js";import{v as l}from"./index-Cr9NTnJp.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 g(e){return new RegExp(`^${e}#[A-Za-z0-9_-]+(?:\\.[A-Za-z0-9_-]+)*$`)}function E(e){return l().regex(g(e),{message:`must be a "${e}#<key>" reference — expected the target asset stem "${e}", e.g. "${e}#some-key".`}).meta({"x-volter-ref":e})}function u(e,o){let t=e;for(const r of o){if(t===null||typeof t!="object"||Array.isArray(t)||!(r in t))return r;t=t[r]}return null}function j(e,o){const t=p.exec(o);if(!t)throw new Error(`getRef: "${o}" is not a "file#key" reference — expected a string shaped like "some-file#some-key".`);const r=t[1],m=t[2],n=e.sourcePath?.split("\\").join("/").split("/").pop()?.replace(/\.data\.json$/,"");if(n!==void 0&&n!==r)throw new Error(`getRef: ref "${o}" names target asset "${r}", but the handle passed in is "${n}" (${e.sourcePath}). Pass the handle "${r}#..." actually names — getRef(${r}, ...), not getRef(${n}, ...).`);const i=m.split("."),a=e.get(),f=u(a,i);if(f!==null)throw new Error(`getRef: dangling ref "${o}" — "${f}" does not exist`+(n?` in ${n}.data.json`:"")+'. Fix the key or remove the ref (refs are "file#key" strings).');let s=a;for(const c of i)s=s[c];return s}export{E as dataRef,j as getRef};
@@ -0,0 +1 @@
1
+ import{D as v}from"./debug-registry-DgYNlhH_.js";import{r as _}from"./game-network-BqI-Ehz0.js";const D="volter-debug",T=100,E=50,k=100,P=60,b=2e3,V="the host loop reported liveness 'loop-starved' and this session has no way to drive ticks — no recent rAF progress was observed. Check `volter-game-editor status` for the separate visibility readings; foreground/reload the editor, or start play to wire the run-ticks target, then retry.";async function L(n,s,d){const i=()=>n.state("time"),c=i();let l=c.tick,u=0,g=0;for(;;){const r=i();if(r.simSeconds-c.simSeconds>=s)return{stalled:!1};if(r.loopLiveness==="loop-starved"){if(!d)return{stalled:!0,starvedWithoutDriver:!0};if(g>=b)return{stalled:!0};g+=1;const e=s-(r.simSeconds-c.simSeconds),t=r.fixedDt,o=t!==void 0&&Number.isFinite(t)&&t>0?Math.max(1,Math.ceil(e/t-1e-9)):1;d(Math.min(P,o));const a=i();if(a.tick===r.tick&&a.simSeconds===r.simSeconds)return{stalled:!0};l=a.tick,u=0,await Promise.resolve();continue}if(u=r.tick===l?u+1:0,l=r.tick,u>=k)return{stalled:!0};await new Promise(e=>setTimeout(e,E))}}function h(){return typeof window<"u"}function S(n){return new URLSearchParams(n.search).get(D)==="1"}function A(n){return n.debug?.allowInProduction===!0}function I(n){const{registry:s,manifest:d}=n,i=s.adapter,c=[];function l(e){c.push(e),c.length>T&&c.shift()}const u=e=>{l(e.message||String(e.error))},g=e=>{l(`Unhandled promise rejection: ${String(e.reason)}`)};n.window.addEventListener?.("error",u),n.window.addEventListener?.("unhandledrejection",g);function r(e,t){const o=s.getVirtualInputTarget(t);if(!o)throw new v("DEBUG_INPUT_UNAVAILABLE",`debug bridge: ${e}() has no virtual-input target wired — no root entry exports \`debug.input\` (the game's own input door), or none has mounted yet`);return o}return{version:1,providers:i.providers,state:i.state,stateAll:i.stateAll,commands:i.commands,events:i.events,async invoke(e,t){if(!A(d))throw new v("DEBUG_COMMANDS_UNSUPPORTED",`debug: command "${e}" invocation refused — production build without debug.allowInProduction (D18)`,{name:e});return i.invoke(e,t)},input:{setVirtualAction:(e,t,o)=>r("setVirtualAction",o).setVirtualAction(e,t),tapVirtualAction:(e,t)=>r("tapVirtualAction",t).tapVirtualAction(e),clearVirtualActions:e=>r("clearVirtualActions",e).clearVirtualActions(),scheduleActionAtTick:(e,t,o,a)=>r("scheduleActionAtTick",a).scheduleActionAtTick(e,t,o),startRecording:e=>r("startRecording",e).startInputRecording(),stopRecording:e=>r("stopRecording",e).stopInputRecording(),isRecording:e=>r("isRecording",e).isInputRecording(),injectPointerDelta:(e,t,o)=>r("injectPointerDelta",o).injectPointerDelta(e,t),injectPointerPosition:(e,t,o)=>r("injectPointerPosition",o).injectPointerPosition(e,t)},snapshot(e){return{time:i.state("time"),state:i.stateAll(),events:i.events(e),pageErrors:c.slice()}},runTicks(e,t){const o=s.getRunTicksTarget();if(!o)throw new v("DEBUG_RUN_TICKS_UNAVAILABLE","debug bridge: runTicks() has no run-ticks target wired — no Game has mounted yet");o.runTicks(e,t)},runTicksSettled(e,t){return _(s,e,t)},async holdFor(e,t,o){const a=r("holdFor",o),w=a.setVirtualAction(e,!0);if(!w.delivered)return a.clearVirtualActions(),w.reason!==void 0?{delivered:!1,reason:w.reason}:{delivered:!1};const f=s.getRunTicksTarget(),{stalled:m,starvedWithoutDriver:p}=await L(i,t,f?R=>f.runTicks(R,{render:"last"}):void 0);return a.clearVirtualActions(),m?{delivered:!1,reason:p?V:"play stopped during hold"}:{delivered:!0}},uninstall(){n.window.removeEventListener?.("error",u),n.window.removeEventListener?.("unhandledrejection",g),delete n.window.__volter}}}function U(n){const s=n.url??(h()?window.location:void 0);if(!s||!S(s))return;const d=n.window??(h()?window:void 0);if(!d)return;if(!A(n.manifest)){console.warn("[debug] ?volter-debug=1 ignored: production build without debug.allowInProduction (D18)");return}const i=I({registry:n.registry,manifest:n.manifest,window:d});return d.__volter=i,i}export{V as H,U as m,L as w};
@@ -0,0 +1 @@
1
+ import{d$ as L}from"./index-Cr9NTnJp.js";function B(o){const s=Symbol.for(`@volter/game-runtime/game-scoped/${o}`);return{set(u,d){Object.defineProperty(u,s,{configurable:!0,enumerable:!1,value:d})},get(u){return u[s]??null}}}class c extends Error{code;data;constructor(s,u,d){super(u),this.name="DebugError",this.code=s,this.data=d}}const T="ctx.debug.registerStateProvider(name, fn) — see the template example component";function P(o){if(o instanceof Error){const s={causeName:o.name,causeMessage:o.message};return o.stack===void 0?s:{...s,causeStack:o.stack}}return{causeName:typeof o,causeMessage:String(o)}}const q=1e4;function y(o,s,u,d){o.has(s)||(o.add(s),console.warn(`[debug] ${u} "${s}" re-registered (world "${d}")`))}function V(o){const s=new Map,u=new Map,d=new Set,S=new Set,m=[],R=500;let p=0,I=!1;const _=new Map,w=new Map,l=new Map;let E=null;const D=new Set;let b=null;const g=new Map;let N=0;function C(e){if(e!==void 0){if(!l.has(e))throw new c("DEBUG_INPUT_WORLD_NOT_FOUND",`debug: no input door wired for world "${e}" — registered: `+(l.size?[...l.keys()].join(", "):"(none)"),{worldId:e,registered:[...l.keys()]});return e}return h(l.keys())}function h(e){const t=[...e];if(t.length===0)return null;const r=o.getDefaultRootId?.()??null;return r!==null&&t.includes(r)?r:t[0]}s.set("time",{fn:()=>({simSeconds:o.getSimT(),tick:o.getTick(),loopLiveness:o.getLoopLiveness?.()??null,...o.getFixedDt===void 0?{}:{fixedDt:o.getFixedDt()}}),tier:"observable",worldId:"__engine__",builtin:!0}),s.set("input.actions",{fn:()=>{const e=h(_.keys());return(e?_.get(e):void 0)?.()??[]},tier:"observable",worldId:"__engine__",builtin:!0}),s.set("input.trace",{fn:()=>{const e=h(w.keys());return(e?w.get(e):void 0)?.()??{version:1,seed:null,fixedDt:null,ticks:[]}},tier:"observable",worldId:"__engine__",builtin:!0});function O(e,t,r,i){const n=s.get(t);if(n?.builtin)throw new c("DEBUG_BUILTIN_RESERVED",`debug: "${t}" is a built-in state provider (registered by "${n.worldId}") — built-in names cannot be registered over from a world`,{name:t,registered:n.worldId});if(n){if(n.worldId!==e)throw new c("DEBUG_NAME_COLLISION",`debug: state provider "${t}" is registered by both world "${n.worldId}" and world "${e}" — each provider name must be unique across live roots`,{name:t,roots:[n.worldId,e]});y(d,t,"provider",e)}s.set(t,{fn:r,tier:i,worldId:e,builtin:!1})}function A(e,t,r,i){if(r.locus===void 0&&I)throw new c("DEBUG_COMMAND_LOCUS_REQUIRED","this project declares a Colyseus room — declare locus: 'client' | 'server' so fixtures mutate authoritative state, not client prediction",{name:t,worldId:e});const n=u.get(t);if(n){if(n.worldId!==e)throw new c("DEBUG_NAME_COLLISION",`debug: command "${t}" is registered by both world "${n.worldId}" and world "${e}" — each command name must be unique across live roots`,{name:t,roots:[n.worldId,e]});y(S,t,"command",e)}u.set(t,{description:r.description,argsSchema:r.args,locus:r.locus,fn:i,worldId:e})}function $(e,t){p+=1,m.push({tick:o.getTick(),simT:o.getSimT(),event:e,detail:t,seq:p}),m.length>R&&m.shift()}function k(e){return e===void 0?m.slice():m.filter(t=>t.seq>e)}function G(e,t){if(!b)throw new c("DEBUG_COMMAND_FAILED",`debug: command "${e}" is locus:'server' but no Colyseus room is attached (call ctx.debug.attachRoom(room) once your game joins its room)`,{reason:"no room connection"});const r=`dbg-${++N}`,i=b;return new Promise((n,a)=>{const f=setTimeout(()=>{g.delete(r),a(new c("DEBUG_COMMAND_FAILED",`debug: command "${e}" (requestId "${r}") timed out waiting for the server`,{reason:"server timeout"}))},q);g.set(r,{resolve:n,reject:a,timer:f}),i.send("__volter:debugCommand",{name:e,args:t,requestId:r})})}let v=null;function U(e){v?.(),b=e;const t=e.onMessage("__volter:debugCommandResult",i=>{const n=i,a=n?.requestId;if(a===void 0)return;const f=g.get(a);f&&(g.delete(a),clearTimeout(f.timer),n?.ok?f.resolve(n.result):f.reject(new c("DEBUG_COMMAND_FAILED",`debug: server command failed: ${String(n?.error)}`,{cause:n?.error})))}),r=()=>{if(v===r){v=null,b===e&&(b=null),typeof t=="function"&&t();for(const[i,n]of g)clearTimeout(n.timer),n.reject(new c("DEBUG_COMMAND_FAILED",`debug: command (requestId "${i}") failed — its room was detached before a reply arrived`,{reason:"no room connection"}));g.clear()}};return v=r,r}return{adapter:{providers(){return[...s.entries()].map(([e,t])=>({name:e,tier:t.tier}))},state(e){const t=s.get(e);if(!t)throw new c("STATE_PROVIDER_NOT_FOUND",`debug: no state provider registered under "${e}"`,{registered:[...s.keys()],registrationHint:T});return t.fn()},stateAll(){const e={};for(const[t,r]of s)try{e[t]=r.fn()}catch(i){e[t]={__error:String(i)}}return e},commands(){return[...u.entries()].map(([e,t])=>({name:e,description:t.description,argsJsonSchema:t.argsSchema?L(t.argsSchema,{unrepresentable:"any"}):void 0,locus:t.locus??"client"}))},async invoke(e,t){const r=u.get(e);if(!r)throw new c("DEBUG_COMMAND_NOT_REGISTERED",`debug: no command registered under "${e}"`,{registered:[...u.keys()],registrationHint:T});let i=t;if(r.argsSchema){const n=r.argsSchema.safeParse(t);if(!n.success)throw new c("DEBUG_COMMAND_ARGS_INVALID",`debug: command "${e}" received invalid args`,{issues:n.error.issues});i=n.data}if((r.locus??"client")==="server")return G(e,i);try{return await r.fn(...i)}catch(n){const a=P(n);throw new c("DEBUG_COMMAND_FAILED",`debug: command "${e}" threw: ${a.causeMessage}`,{cause:n,...a})}},events(e){return k(e)}},forRoot(e){return{registerStateProvider(t,r,i){O(e,t,r,i?.tier??"observable")},registerCommand(t,r,i){A(e,t,r,i)},emit(t,r){$(t,r)},attachRoom(t){return U(t)}}},strip(e){for(const[t,r]of s)r.builtin||e!==void 0&&r.worldId!==e||(s.delete(t),d.delete(t));for(const[t,r]of u)e!==void 0&&r.worldId!==e||(u.delete(t),S.delete(t))},setRoomDeclared(e){I=e},setInputActionsSource(e,t){_.set(e,t)},setInputTraceSource(e,t){w.set(e,t)},setVirtualInputTarget(e,t){l.set(e,t)},getVirtualInputTarget(e){const t=C(e);return t!==null?l.get(t)??null:null},setRunTicksTarget(e){E=e},getRunTicksTarget(){return E},registerWorldSettledProbe(e){return D.add(e),()=>{D.delete(e)}},worldSettled(){for(const e of D)try{if(!e())return!1}catch{return!1}return!0},getGameTick(){return o.getTick()}}}const M=B("debug-registry");function j(o,s){M.set(o,s)}function H(o){return M.get(o)??null}export{c as D,V as a,B as c,H as g,j as r};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/canvas-entry-runtime-DVeh71nC.js","assets/index-CaG87ZF-.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-B5WjeCHm.css","assets/debug-registry-l7k5Hjc8.js","assets/mount-ingest-root-BC3-1Cw1.js","assets/active-ingest-CnAeQcuQ.js","assets/game-contract-seams-C0AVYwvO.js","assets/capability-coverage-DQgg6UJe.js","assets/ingest-source-persistence-6peGfPAS.js","assets/contract-system-adapters-h6OUBRYA.js","assets/three-state-wXRU3rLr.js","assets/editor-shell-store-Bh1S7M54.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-B4oYfpj8.js","assets/workspace-arrangement-DIMM7ska.js","assets/user-data-CqOoAowZ.js","assets/entity-object-B_5Gc0Ky.js","assets/three-contract-Dkt6PmWY.js"])))=>i.map(i=>d[i]);
2
- import{x as u,y as f,_ as i,z as d,B as n,E as m,F as p,G as g}from"./index-CaG87ZF-.js";import{q as v}from"./edit-mode-authoring-DBjaBTxM.js";import{d as P,a as c,b as y,g as w,e as _,c as I}from"./active-ingest-CnAeQcuQ.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-C0AVYwvO.js";import"./capability-coverage-DQgg6UJe.js";import"./ingest-source-persistence-6peGfPAS.js";import"./contract-system-adapters-h6OUBRYA.js";async function h(){const e=await u().catch(()=>null);if(!e)return!1;const t=f(e);if(t.length!==1)return!1;if(t[0].world!==void 0)return!0;const a=await E();return R(a)}const D=4e3;function E(){const e=n();return e?Promise.resolve(e):new Promise(t=>{const a=setTimeout(()=>{s(),t(n())},D),s=m(()=>{const r=n();r&&(clearTimeout(a),s(),t(r))})})}function R(e){return e?p(e.scenes).some(t=>t.plan.kind==="isolation-document"):!1}async function k(e){if(!await h())return!1;const t=await u().catch(()=>null);if((t?f(t).some(r=>r.adapter.surface==="canvas"):!1)&&!c()){const{resolveCanvasPixiForEditor:r}=await i(async()=>{const{resolveCanvasPixiForEditor:l}=await import("./canvas-entry-runtime-DVeh71nC.js");return{resolveCanvasPixiForEditor:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]));(await r()).Assets.reset()}const{launchIngestRoutes:s}=await i(async()=>{const{launchIngestRoutes:r}=await import("./mount-ingest-root-BC3-1Cw1.js").then(o=>o.m);return{launchIngestRoutes:r}},__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]));if(await s(e),!c())throw new Error(`Play could not start: this project's ingest root failed to mount — see the mount failure reported above (and in ${d("status")}).`);return y(),g(),w()?.play(),!0}function z(e){return P()?(_(),I(),e.shell.setPlayState("stopped"),v(),!0):!1}export{P as deferredIngestPlayActive,z as exitDeferredIngestPlay,h as ingestMountIsDeferredToPlay,k as mountDeferredIngestForPlay};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/canvas-entry-runtime-a6N7Rsrj.js","assets/index-Cr9NTnJp.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/debug-registry-DgYNlhH_.js","assets/mount-ingest-root-BsWbEvr_.js","assets/active-ingest-CjZtqL7Q.js","assets/game-contract-seams-Dgqv6S8X.js","assets/capability-coverage-7wKVA3PF.js","assets/ingest-source-persistence-BGIvThcv.js","assets/contract-system-adapters-Bq1LGdjs.js","assets/three-state-C36FeFK4.js","assets/editor-shell-store-BRqB1JZO.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-CGX7iCSP.js","assets/workspace-arrangement-dkubzCff.js","assets/user-data-BXFD1jg-.js","assets/entity-object--ZpqIat7.js","assets/three-contract-Dkt6PmWY.js"])))=>i.map(i=>d[i]);
2
+ import{y as u,z as f,_ as i,B as d,E as n,F as m,G as p,I as g}from"./index-Cr9NTnJp.js";import{q as v}from"./edit-mode-authoring-ZQuUwc6e.js";import{d as P,a as c,b as y,g as w,e as I,c as _}from"./active-ingest-CjZtqL7Q.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-Dgqv6S8X.js";import"./capability-coverage-7wKVA3PF.js";import"./ingest-source-persistence-BGIvThcv.js";import"./contract-system-adapters-Bq1LGdjs.js";async function h(){const e=await u().catch(()=>null);if(!e)return!1;const t=f(e);if(t.length!==1)return!1;if(t[0].world!==void 0)return!0;const a=await E();return R(a)}const D=4e3;function E(){const e=n();return e?Promise.resolve(e):new Promise(t=>{const a=setTimeout(()=>{s(),t(n())},D),s=m(()=>{const r=n();r&&(clearTimeout(a),s(),t(r))})})}function R(e){return e?p(e.scenes).some(t=>t.plan.kind==="isolation-document"):!1}async function k(e){if(!await h())return!1;const t=await u().catch(()=>null);if((t?f(t).some(r=>r.adapter.surface==="canvas"):!1)&&!c()){const{resolveCanvasPixiForEditor:r}=await i(async()=>{const{resolveCanvasPixiForEditor:l}=await import("./canvas-entry-runtime-a6N7Rsrj.js");return{resolveCanvasPixiForEditor:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]));(await r()).Assets.reset()}const{launchIngestRoutes:s}=await i(async()=>{const{launchIngestRoutes:r}=await import("./mount-ingest-root-BsWbEvr_.js").then(o=>o.m);return{launchIngestRoutes:r}},__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]));if(await s(e),!c())throw new Error(`Play could not start: this project's ingest root failed to mount — see the mount failure reported above (and in ${d("status")}).`);return y(),g(),w()?.play(),!0}function z(e){return P()?(I(),_(),e.shell.setPlayState("stopped"),v(),!0):!1}export{P as deferredIngestPlayActive,z as exitDeferredIngestPlay,h as ingestMountIsDeferredToPlay,k as mountDeferredIngestForPlay};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/canvas-design-mount-DLn49Zle.js","assets/index-CaG87ZF-.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-B5WjeCHm.css","assets/babylon-authoring-adapter-Cg5ALSpr.js","assets/json-history-resource-CTXRV4GD.js","assets/source-persistence-backend-HviqjKZ2.js","assets/ingest-source-persistence-6peGfPAS.js","assets/pixi-authoring-adapter-B42K4md-.js","assets/index-C20Flc1s.js","assets/component-instance-root-df4ofoOR.js","assets/user-data-CqOoAowZ.js","assets/workspace-arrangement-DIMM7ska.js","assets/pixi-transform-channels-P4rvmusc.js","assets/relative-import-specifier-DQzkawgj.js","assets/oid-transform-Bzc2ZJSH.js","assets/writer-tw6EcuVO.js","assets/r3f-physics-binding-Bgzzd4ol.js","assets/canvas-preview-frames-B5xFRjhQ.js","assets/canvas-entry-runtime-DVeh71nC.js","assets/debug-registry-l7k5Hjc8.js","assets/realm-services-DefTrXnY.js","assets/three-ingest-runtime-CXKjNysA.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/native-debug-module-B-rWJfWE.js","assets/native-entry-surface-BE8LJNdu.js","assets/contract-system-adapters-h6OUBRYA.js","assets/game-contract-seams-C0AVYwvO.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/create-runtime-Bg2uYMfh.js","assets/adapter-surface-Y37Nzcyw.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/setup-renderer-OOw1SykJ.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-BBvkacR3.js","assets/render-features-C7QwmhCo.js","assets/seeded-random-38To73fI.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/performance-profiler-OwnXQX0M.js"])))=>i.map(i=>d[i]);
2
- import{_ as u,dj as c,dk as l}from"./index-CaG87ZF-.js";import{t as d}from"./three-state-wXRU3rLr.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"./editor-shell-store-Bh1S7M54.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-B4oYfpj8.js";import"./workspace-arrangement-DIMM7ska.js";import"./user-data-CqOoAowZ.js";import"./entity-object-B_5Gc0Ky.js";import"./three-contract-Dkt6PmWY.js";async function W(o,t,e){const{mountCanvasDesignLayer:r}=await u(async()=>{const{mountCanvasDesignLayer:p}=await import("./canvas-design-mount-DLn49Zle.js");return{mountCanvasDesignLayer:p}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60])),{projectRootPath:s,view:a,activationDocumentId:i}=e,n=d();if(!n)throw new Error(`canvas root "${o.worldId}": the editor store is not bound yet.`);const m=await r(o.worldId,o.path,t,s,n,a,i?()=>c(i):void 0);return{adapter:m.adapter,dispose:()=>m.dispose()}}function $(o){let t=null;const e=l(r=>{r!==""&&!/^src\/.+\.(?:[cm]?tsx?|jsx?)$/.test(r)||(t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,o()},150))});return()=>{t!==null&&clearTimeout(t),t=null,e()}}export{W as mountCanvasDesignTimeLayer,$ as remountWhenSourceIsWritten};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/canvas-design-mount-DamLAaWn.js","assets/index-Cr9NTnJp.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/babylon-authoring-adapter-CS9LZNmz.js","assets/json-history-resource-C9G_vCX9.js","assets/source-persistence-backend-Dzc6MsmN.js","assets/ingest-source-persistence-BGIvThcv.js","assets/pixi-authoring-adapter-CPsN0Yk7.js","assets/index-z0_InXxO.js","assets/component-instance-root-C1Xf4SwR.js","assets/user-data-BXFD1jg-.js","assets/workspace-arrangement-dkubzCff.js","assets/pixi-transform-channels-P4rvmusc.js","assets/relative-import-specifier-CyT6yU4l.js","assets/oid-transform-BYeAsBKI.js","assets/writer-tw6EcuVO.js","assets/r3f-physics-binding-oippu1v_.js","assets/canvas-preview-frames-XbrKuyJu.js","assets/canvas-entry-runtime-a6N7Rsrj.js","assets/debug-registry-DgYNlhH_.js","assets/realm-services-BtiLE3a-.js","assets/three-ingest-runtime-CXySzulx.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/native-debug-module-CB738yQu.js","assets/native-entry-surface-BE8LJNdu.js","assets/contract-system-adapters-Bq1LGdjs.js","assets/game-contract-seams-Dgqv6S8X.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/create-runtime-Cx-q5z2y.js","assets/adapter-surface-Y37Nzcyw.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/setup-renderer-Bf8g2S0f.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-DjarlnjI.js","assets/render-features-CBl6rom9.js","assets/seeded-random-DmdE0u-C.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/performance-profiler-CMbwGBuk.js"])))=>i.map(i=>d[i]);
2
+ import{_ as u,dk as c,dl as l}from"./index-Cr9NTnJp.js";import{t as d}from"./three-state-C36FeFK4.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"./editor-shell-store-BRqB1JZO.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-CGX7iCSP.js";import"./workspace-arrangement-dkubzCff.js";import"./user-data-BXFD1jg-.js";import"./entity-object--ZpqIat7.js";import"./three-contract-Dkt6PmWY.js";async function W(o,t,e){const{mountCanvasDesignLayer:r}=await u(async()=>{const{mountCanvasDesignLayer:p}=await import("./canvas-design-mount-DamLAaWn.js");return{mountCanvasDesignLayer:p}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60])),{projectRootPath:s,view:a,activationDocumentId:i}=e,n=d();if(!n)throw new Error(`canvas root "${o.worldId}": the editor store is not bound yet.`);const m=await r(o.worldId,o.path,t,s,n,a,i?()=>c(i):void 0);return{adapter:m.adapter,dispose:()=>m.dispose()}}function $(o){let t=null;const e=l(r=>{r!==""&&!/^src\/.+\.(?:[cm]?tsx?|jsx?)$/.test(r)||(t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,o()},150))});return()=>{t!==null&&clearTimeout(t),t=null,e()}}export{W as mountCanvasDesignTimeLayer,$ as remountWhenSourceIsWritten};
@@ -0,0 +1 @@
1
+ import{stackOrder as se}from"./root-stacking-BEd9ZvxC.js";import{dp as ie,dq as de,dr as le,da as ae,aw as ue,ds as L,bq as fe,O as P,bp as pe,aB as ce,dt as we,dd as he,db as ye}from"./index-Cr9NTnJp.js";import{B as S,q as N}from"./edit-mode-authoring-ZQuUwc6e.js";import{s as ge,d as I,a as me}from"./design-time-mount-registry-DUpXCg1U.js";import{d as Ie,s as be,g as ve,e as Se}from"./react-story-board-mhldts6w.js";const H=new Map;function J(n,r){return`${n}\0${r}`}function Be(n,r){return H.get(J(n,r))}function $e(n,r,o){H.set(J(n,r),o)}const ke=1;function K(n){const r=[];for(const{worldId:o,adapter:d}of n.childAdapters()){if(!(d instanceof S))continue;const a=d.inspector.get(o,"kind");if(a!=="dom"&&a!=="canvas"||d.inspector.get(o,"reason")!==void 0)continue;const b=d.inspector.get(o,"adapter");b?.startsWith("ingest")||b?.startsWith("module")||r.push({worldId:o,kind:a,path:d.inspector.get(o,"path"),zOrder:Number(d.inspector.get(o,"zOrder")??0),pausable:d.inspector.get(o,"pausable")!==!1})}return r}function je(n){return K(n)}const Ce="ui-components-board";function $(n,r){return n.childAdapters().some(o=>o.worldId===r)}function De(){return{worldId:Ce,kind:"dom",path:void 0,zOrder:0,pausable:!0}}function U(n,r,o="dom"){const d=ce(r)?"none":"block";n.style.display=d,n.style.pointerEvents=I(o)?.alwaysInteractive||we(r)?"auto":"none";for(const a of Array.from(n.parentElement?.children??[]))a instanceof HTMLElement&&a.dataset.volterStoryBoardChromeFor===r&&(a.style.display=d)}function Oe(n,r,o,d){const{worldId:a}=r,s=document.createElement("div");return s.dataset.worldId=a,s.dataset.volterRootSurface="true",d&&(s.dataset.volterCanvasScene="true"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.zIndex=String(o),s.style.contain="layout paint",s.style.cssText+="font: initial; color: initial; letter-spacing: normal; word-spacing: normal; text-align: start; text-indent: 0; text-transform: none; white-space: normal; direction: ltr;",U(s,a,r.kind),j(s),n.appendChild(s),s}function j(n){if(n.dataset.volterCanvasScene==="true"){n.style.transform="",n.style.width="100%",n.style.height="100%";return}if(n.style.transform=he(ye())??"",n.style.transformOrigin="0 0",n.dataset.volterReactStoryBoard==="true")return;const r=ve();n.style.width=r.width===null?"100%":`${r.width}px`,n.style.height=r.height===null?"100%":`${r.height}px`}const E=new Map;function Ve(n,r,o,d,a,s,b){s?s.canvasSceneView.reset():ie(),Se();const k=ue();if(!s&&k?.config.resolution&&Ie(k.config.resolution.width,k.config.resolution.height),o.playState!=="stopped"){let e=!1,t=!1;const i=o.subscribe(()=>{e||t||o.playState!=="stopped"||(t=!0,e||N())});return()=>{e=!0,i()}}const D=k?.rootPath,z=d?[...d]:K(r);if(z.length===0||!D)return()=>{};const X=D,y=se(z.map(e=>({id:e.worldId,zOrder:e.zOrder}))).map(e=>z.find(t=>t.worldId===e.id)),V=new Map(y.map(e=>[e.worldId,e])),u=new Map,g=new Map,C=new Map,O=new Set,R=new Set,T=new Set;let h=!1,p=!1,W=!1;function q(){for(const e of g.values())try{e()}catch(t){P.error(`[design-time-layers] dispose failed: ${t}`,"authoring")}g.clear();for(const e of u.values())e.remove();u.clear();for(const e of y)a?.(e.worldId,null)}function Y(){q();for(const e of O){const t=V.get(e);if(!t)continue;const i={id:t.worldId,kind:t.kind,entryOrScenePath:t.path,zOrder:t.zOrder,pausable:t.pausable};r.replaceChild(e,new S(o,i,"Design-time layer suspended by play mode — Stop restores it."))}O.clear(),o.notifyIngestEdit()}function M(e,t,i){const l=I(e.kind);if(!l){R.add(e.worldId);return}R.delete(e.worldId);const f=(C.get(e.worldId)??0)+1;C.set(e.worldId,f);const c=Oe(n,e,ke+t,!!s);u.set(e.worldId,c);const x={projectRootPath:X,store:o,...s?{view:s.canvasSceneView}:{},...b?{activationDocumentId:b}:{}},_=E.get(e.worldId),B=(async()=>(_&&await _,l.mount(e,c,x)))().then(w=>{if(h||p||C.get(e.worldId)!==f){w.dispose();return}if(w.adapter)$(r,e.worldId)&&(r.replaceChild(e.worldId,w.adapter),O.add(e.worldId)),a?.(e.worldId,w.adapter);else if(w.pick){const v={id:e.worldId,kind:e.kind,entryOrScenePath:e.path,zOrder:e.zOrder,pausable:e.pausable};r.replaceChild(e.worldId,new S(o,v,void 0,w.pick)),O.add(e.worldId)}g.set(e.worldId,w.dispose),L(e.worldId),o.notifyIngestEdit(),i?.()}).catch(w=>{if(C.get(e.worldId)!==f||(i?.(),c.remove(),u.get(e.worldId)===c&&u.delete(e.worldId),h||p))return;const v=fe(w);P.error(`[design-time-layers] world "${e.worldId}" (${e.kind}) failed to mount: ${v}`,"authoring");const ne={id:e.worldId,kind:e.kind,entryOrScenePath:e.path,zOrder:e.zOrder,pausable:e.pausable};a?.(e.worldId,null),$(r,e.worldId)&&r.replaceChild(e.worldId,new S(o,ne,v)),pe({worldId:e.worldId,kind:e.kind,identity:l.identity,message:v}),o.notifyIngestEdit()});E.set(e.worldId,B),B.then(()=>{E.get(e.worldId)===B&&E.delete(e.worldId)})}y.forEach((e,t)=>{M(e,t)});function Z(e,t){const i=g.get(e.worldId);g.delete(e.worldId);const l=u.get(e.worldId);u.delete(e.worldId),M(e,t,()=>{const c=u.get(e.worldId);if(c&&(c.style.visibility=""),i)try{i()}catch(x){P.error(`[design-time-layers] re-projection dispose failed: ${x}`,"authoring")}l?.remove()});const f=u.get(e.worldId);f&&f!==l&&(f.style.visibility="hidden")}function G(e,t){const i=g.get(e.worldId);if(g.delete(e.worldId),i)try{i()}catch(f){P.error(`[design-time-layers] remount dispose failed: ${f}`,"authoring")}const l=u.get(e.worldId);l&&(l.remove(),u.delete(e.worldId)),M(e,t)}const m=new Map;function A(){for(const[e,t]of m)I(e.kind)!==e&&(t(),m.delete(e));for(const e of me()){if(m.has(e)||I(e.kind)!==e||!y.some(l=>l.kind===e.kind))continue;const t=[],i=l=>()=>{h||p||o.playState!=="stopped"||y.forEach((f,c)=>{f.kind===e.kind&&l(f,c)})};e.remountWhen&&t.push(e.remountWhen(i(G))),e.reprojectWhen&&t.push(e.reprojectWhen(i(Z))),m.set(e,()=>{for(const l of t)l()})}}A();const Q=ge(()=>{h||p||o.playState!=="stopped"||(y.forEach((e,t)=>{R.has(e.worldId)&&I(e.kind)&&(T.delete(e.worldId),L(e.worldId),M(e,t))}),A())}),F=()=>{if(h||p)return;let e=!1;for(const t of y){if(!R.has(t.worldId)||T.has(t.worldId)||I(t.kind)||(T.add(t.worldId),!$(r,t.worldId)))continue;const i={id:t.worldId,kind:t.kind,entryOrScenePath:t.path,zOrder:t.zOrder,pausable:t.pausable};r.replaceChild(t.worldId,new S(o,i,`No package in this editor registered a design-time mount for a "${t.kind}" world, so there is nothing here to author it with.`)),e=!0}e&&o.notifyIngestEdit()},ee=de(F);le()&&F();const te=ae(()=>{for(const e of u.values())j(e)}),oe=be(()=>{for(const e of u.values())j(e)}),re=o.subscribe(()=>{if(!p&&o.playState!=="stopped"){p=!0,Y();return}if(p&&!W&&o.playState==="stopped"&&!h){W=!0,h||N();return}if(!p)for(const[e,t]of u)U(t,e,V.get(e)?.kind??"dom")});return()=>{h=!0;for(const e of m.values())e();m.clear(),Q(),ee(),re(),te(),oe(),q()}}export{$e as a,je as d,Ve as m,De as p,Be as r};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/design-time-canvas-mount-CFW9ZWuk.js","assets/index-CaG87ZF-.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-B5WjeCHm.css","assets/three-state-wXRU3rLr.js","assets/editor-shell-store-Bh1S7M54.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-B4oYfpj8.js","assets/workspace-arrangement-DIMM7ska.js","assets/user-data-CqOoAowZ.js","assets/entity-object-B_5Gc0Ky.js","assets/three-contract-Dkt6PmWY.js"])))=>i.map(i=>d[i]);
2
- import{_ as n}from"./index-CaG87ZF-.js";import{r as a}from"./design-time-mount-registry-DUpXCg1U.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 g="workspace.service";function y(){return a({kind:"canvas",owner:"@volter/editor-game/canvas/design-time-mount",identity:"default-pixi",alwaysInteractive:!0,mount:async(r,e,t)=>{const{mountCanvasDesignTimeLayer:i}=await n(async()=>{const{mountCanvasDesignTimeLayer:o}=await import("./design-time-canvas-mount-CFW9ZWuk.js");return{mountCanvasDesignTimeLayer:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]));return i(r,e,t)},remountWhen:r=>{let e=!1,t=null;return n(()=>import("./design-time-canvas-mount-CFW9ZWuk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(i=>{e||(t=i.remountWhenSourceIsWritten(r))}),()=>{e=!0,t?.(),t=null}}})}export{g as point,y as start};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/design-time-canvas-mount-Ca9Q75Ui.js","assets/index-Cr9NTnJp.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/three-state-C36FeFK4.js","assets/editor-shell-store-BRqB1JZO.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-CGX7iCSP.js","assets/workspace-arrangement-dkubzCff.js","assets/user-data-BXFD1jg-.js","assets/entity-object--ZpqIat7.js","assets/three-contract-Dkt6PmWY.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n}from"./index-Cr9NTnJp.js";import{r as a}from"./design-time-mount-registry-DUpXCg1U.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 g="workspace.service";function y(){return a({kind:"canvas",owner:"@volter/editor-game/canvas/design-time-mount",identity:"default-pixi",alwaysInteractive:!0,mount:async(r,e,t)=>{const{mountCanvasDesignTimeLayer:i}=await n(async()=>{const{mountCanvasDesignTimeLayer:o}=await import("./design-time-canvas-mount-Ca9Q75Ui.js");return{mountCanvasDesignTimeLayer:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]));return i(r,e,t)},remountWhen:r=>{let e=!1,t=null;return n(()=>import("./design-time-canvas-mount-Ca9Q75Ui.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(i=>{e||(t=i.remountWhenSourceIsWritten(r))}),()=>{e=!0,t?.(),t=null}}})}export{g as point,y as start};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/design-time-react-mount-CFvIk_rV.js","assets/design-time-layers-CQgnmqc8.js","assets/root-stacking-BEd9ZvxC.js","assets/index-CaG87ZF-.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-B5WjeCHm.css","assets/edit-mode-authoring-DBjaBTxM.js","assets/design-time-mount-registry-DUpXCg1U.js","assets/react-story-board-Bx7qYytV.js","assets/crash-null-boundary-v3a0uEgw.js","assets/realm-services-DefTrXnY.js","assets/canvas-entry-runtime-DVeh71nC.js","assets/debug-registry-l7k5Hjc8.js","assets/three-ingest-runtime-CXKjNysA.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/react-root-BHA-cdrW.js","assets/StoryPreviewMount-Di8uMovM.js","assets/story-presentation-BLXYPadR.js","assets/three-story-model-DgiAP-oQ.js","assets/inspect-C8RP8G5F.js","assets/inference-diagnostics-MGcIHEX6.js","assets/react-world-authoring-adapter-C1jPW_cN.js","assets/board-guides-_3R1t_-2.js","assets/relative-import-specifier-DQzkawgj.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/writer-tw6EcuVO.js"])))=>i.map(i=>d[i]);
2
- import{_ as i}from"./index-CaG87ZF-.js";import{r as m}from"./design-time-mount-registry-DUpXCg1U.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 v="workspace.service";function y(){return m({kind:"dom",owner:"@volter/editor-game/react/design-time-mount",identity:"default-react",mount:async(r,e,t)=>{const{mountReactDesignLayer:o}=await i(async()=>{const{mountReactDesignLayer:n}=await import("./design-time-react-mount-CFvIk_rV.js");return{mountReactDesignLayer:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38]));return o(r,e,t)},reprojectWhen:r=>{let e=!1,t=null;return i(()=>import("./design-time-react-mount-CFvIk_rV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38])).then(o=>{e||(t=o.reprojectWhenStoriesRepublish(r))}),()=>{e=!0,t?.(),t=null}}})}export{v as point,y as start};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/design-time-react-mount-NrWimSxY.js","assets/design-time-layers-BIb71snu.js","assets/root-stacking-BEd9ZvxC.js","assets/index-Cr9NTnJp.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/edit-mode-authoring-ZQuUwc6e.js","assets/design-time-mount-registry-DUpXCg1U.js","assets/react-story-board-mhldts6w.js","assets/crash-null-boundary-v3a0uEgw.js","assets/realm-services-BtiLE3a-.js","assets/canvas-entry-runtime-a6N7Rsrj.js","assets/debug-registry-DgYNlhH_.js","assets/three-ingest-runtime-CXySzulx.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/react-root-BHA-cdrW.js","assets/StoryPreviewMount-CzzRn24c.js","assets/story-presentation-2AxtnKGb.js","assets/three-story-model-CqWu9S2a.js","assets/inspect-CN92MgRT.js","assets/inference-diagnostics-D5jfxI5p.js","assets/react-world-authoring-adapter-CuyruDfq.js","assets/board-guides-BG-MHK2G.js","assets/relative-import-specifier-CyT6yU4l.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/writer-tw6EcuVO.js"])))=>i.map(i=>d[i]);
2
+ import{_ as i}from"./index-Cr9NTnJp.js";import{r as m}from"./design-time-mount-registry-DUpXCg1U.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 v="workspace.service";function y(){return m({kind:"dom",owner:"@volter/editor-game/react/design-time-mount",identity:"default-react",mount:async(r,e,t)=>{const{mountReactDesignLayer:o}=await i(async()=>{const{mountReactDesignLayer:n}=await import("./design-time-react-mount-NrWimSxY.js");return{mountReactDesignLayer:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38]));return o(r,e,t)},reprojectWhen:r=>{let e=!1,t=null;return i(()=>import("./design-time-react-mount-NrWimSxY.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38])).then(o=>{e||(t=o.reprojectWhenStoriesRepublish(r))}),()=>{e=!0,t?.(),t=null}}})}export{v as point,y as start};
@@ -0,0 +1 @@
1
+ import{r as it,a as at}from"./design-time-layers-BIb71snu.js";import{f8 as st,b9 as lt,g5 as ut,g6 as dt,O as E,g7 as mt,g8 as L,bq as Y,dk as H,am as ct,eH as U,an as $,d5 as pt,ch as ht,g9 as z}from"./index-Cr9NTnJp.js";import{h as ft,d as gt,g as bt}from"./react-story-board-mhldts6w.js";import{C as wt}from"./crash-null-boundary-v3a0uEgw.js";import{r as yt,a as St}from"./realm-services-BtiLE3a-.js";import{r as It}from"./react-root-BHA-cdrW.js";import{m as Rt}from"./StoryPreviewMount-CzzRn24c.js";import{c as vt,s as Pt}from"./story-presentation-2AxtnKGb.js";import{d as Mt}from"./three-story-model-CqWu9S2a.js";import{c as Ct}from"./inspect-CN92MgRT.js";import{R as J}from"./react-world-authoring-adapter-CuyruDfq.js";import"./root-stacking-BEd9ZvxC.js";import"./edit-mode-authoring-ZQuUwc6e.js";import"./design-time-mount-registry-DUpXCg1U.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"./canvas-entry-runtime-a6N7Rsrj.js";import"./debug-registry-DgYNlhH_.js";import"./three-ingest-runtime-CXySzulx.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./inference-diagnostics-D5jfxI5p.js";import"./board-guides-BG-MHK2G.js";import"./relative-import-specifier-CyT6yU4l.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./writer-tw6EcuVO.js";function Et(e){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="svg"||o==="SVG"||o==="PICTURE")return!0;const r=getComputedStyle(e);if(r.visibility==="hidden"||r.display==="none")return!1;if(xt(r.backgroundColor)||r.backgroundImage&&r.backgroundImage!=="none"||r.boxShadow&&r.boxShadow!=="none"||r.borderStyle!=="none"&&r.borderStyle!==""&&(parseFloat(r.borderTopWidth)>0||parseFloat(r.borderRightWidth)>0||parseFloat(r.borderBottomWidth)>0||parseFloat(r.borderLeftWidth)>0))return!0;for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE&&(n.textContent??"").trim()!=="")return!0;return!1}function xt(e){if(!e||e==="transparent")return!1;const o=/^rgba\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/.exec(e);return o?parseFloat(o[1])>0:!0}function Nt(e,o=r=>r.getBoundingClientRect()){const r=o(e),n=e.offsetWidth;if(r.width<=0||n<=0)return null;const s=r.width/n;let d=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,y=Number.NEGATIVE_INFINITY;for(const p of e.querySelectorAll("*")){if(!Et(p))continue;const m=o(p);m.width<=0||m.height<=0||(d=Math.min(d,(m.left-r.left)/s),c=Math.min(c,(m.top-r.top)/s),i=Math.max(i,(m.right-r.left)/s),y=Math.max(y,(m.bottom-r.top)/s))}return i<=d||y<=c?null:{x:d,y:c,width:i-d,height:y-c}}let x=!1;function kt(e,o){if(!e)return;z({adapter:e,seam:"editor.stories.apply",stage:"effect",detail:`the design board applied portable story ${o}`,run:()=>e.stories.apply(o,o)});const r=e.selection;r&&z({adapter:e,seam:"editor.selection.set",stage:"effect",detail:`the design board selected portable story ${o}`,run:()=>r.set([o])})}let X=!1;async function Ft(){if(X)return;X=!0;const e=bt();if(!(e.width!==null||e.height!==null))try{const o=await ht("volter.project.json");if(!o)return;const r=JSON.parse(o),n=r.resolution?.width,s=r.resolution?.height;if(typeof n!="number"||typeof s!="number"||n<64||s<64||n>4096||s>4096)return;gt(n,s)}catch{}}function Tt(e,o){return{id:e,surface:"dom",description:void 0,adapter:{type:"builtin",identity:"dom",surface:"dom"},entry:o,zOrder:0,pausable:!0,loop:"gated"}}async function At(e,o){try{const r=await St(o,pt());return{ok:!0,Entry:await It(e,r)}}catch(r){return{ok:!1,error:r}}}async function be(e,o,r){const{projectRootPath:n,store:s,activationDocumentId:d}=r;x?x=!1:await st({rootPath:n});const c=lt(),i=Mt(c),y=e.path,p=y?await At(Tt(e.worldId,y),n):{ok:!1,error:new Error(`design-time react layer "${e.worldId}": no \`entry\` declared — nothing to mount.`)},m=p.ok?ut(p.Entry):void 0,Q=m?dt(m,e.path):null,j=i.find(g=>g.id===Q?.id)??null;if(i.length>0){const g=it(n,e.worldId),R=i.find(t=>t.id===g)??j??i[0];e.path&&!j&&E.warn(`[design-time-layers] React root "${e.worldId}" has no story naming its entry component${m?` "${m}"`:""} — the board opens on "${R.label}". Give a *.stories.tsx a \`meta.component\` of this root's entry component to choose its default preview.`,"authoring");let k=!1,M=null,F=null;const T=new Map,D=vt(i);await Ft();const l=ft(o,i.map(t=>({id:t.id,label:t.label,modulePath:t.modulePath,...t.title?{title:t.title}:{},parameters:t.parameters,...t.globals?{globals:t.globals}:{},...t.viewportLocked!==void 0?{viewportLocked:t.viewportLocked}:{}})),R.id,(t,u)=>{F=u,kt(M,t)},Pt(i,D)),_=t=>{if(k)return;const u=l.frames.get(t.id);if(!u)return;if(t.parameters?.layout==="fullscreen"){l.setMeasuredFrame(t.id,null);return}const a={width:u.content.offsetWidth,height:u.content.offsetHeight},f=a.width>0?Nt(u.content):null;if(!f){l.setMeasuredFrame(t.id,null);return}const C=8,S=48;let b=Math.max(0,f.x-C),w=Math.max(0,f.y-C),v=Math.min(a.width,f.x+f.width+C),P=Math.min(a.height,f.y+f.height+C);if(v-b<S){const A=(S-(v-b))/2;b=Math.max(0,b-A),v=Math.min(a.width,b+S)}if(P-w<S){const A=(S-(P-w))/2;w=Math.max(0,w-A),P=Math.min(a.height,w+S)}if(v-b>=a.width*.9&&P-w>=a.height*.9){l.setMeasuredFrame(t.id,null);return}l.setMeasuredFrame(t.id,{frame:{width:Math.round(v-b),height:Math.round(P-w)},mount:a,offset:{x:Math.round(b),y:Math.round(w)}})},rt=t=>{setTimeout(()=>_(t),0),setTimeout(()=>_(t),1e3)},G=async(t,u=t.args)=>{const h=l.frames.get(t.id)?.content;if(h){try{const a=await Rt(h,t.modulePath,t.name,t.Component,u);if(!a)return;if(k){a.unmount();return}T.set(t.id,a),l.clearError(t.id),rt(t)}catch(a){const f=Y(a);l.setError(t.id,f),E.error(`[design-time-layers] React root "${e.worldId}" failed mounting portable story "${t.name}": ${f}`,"authoring")}s.notifyIngestEdit()}};await Promise.all(i.map(t=>G(t))),l.setNote(mt().note),g&&l.activate(R.id,!0);const O=new Map(i.map(t=>[t.id,t])),nt={tagName:"DIV",get children(){return l.activeContent().children},getAttribute:t=>o.getAttribute(t),getBoundingClientRect:()=>o.getBoundingClientRect(),get style(){return o.style},get textContent(){return l.activeContent().textContent}},q=await L();return M=new J(nt,s,{...q?{writeBackend:q}:{},designTokens:()=>{const t=l.activeContent(),u=t.closest?.("[data-volter-game-styles]")??t.querySelector?.("[data-volter-game-styles]")??t;return Ct(getComputedStyle(u))},assetRoot:o,portableStories:i.map(t=>({id:t.id,label:t.label,args:t.args,name:t.name,modulePath:t.modulePath})),portableHierarchy:D,activePortableStoryId:R.id,onPortableStoryApplied:t=>{const u=(t?O.get(t):null)??R;at(n,e.worldId,u.id);const h=F;F=null,l.activate(u.id,h===null||h==="zoom")},onPortableStoryArgsChanged:(t,u)=>{const h=O.get(t);h&&G(h,u).catch(a=>{E.error(`[design-time-layers] React root "${e.worldId}" failed updating portable story "${h.name}" args: ${Y(a)}`,"authoring")})}}),d&&requestAnimationFrame(()=>H(d)),{adapter:M,dispose:()=>{k=!0,M.disposeReactRootAdapter();for(const t of T.values())t.unmount();T.clear(),l.dispose()}}}if(!p.ok)throw p.error instanceof Error?p.error:new Error(String(p.error));E.warn(`[design-time-layers] React root "${e.worldId}" has no portable CSF preview — the project declares no UI stories. Add a *.stories.tsx; give it a \`meta.component\` of this root's entry component${m?` (${m}, ${e.path})`:""} to make it this root’s default preview. Falling back to rendering the entry bare.`,"authoring");const Z=p.Entry,{createElement:B,createRoot:tt,flushSync:et}=await yt(),N=tt(o),ot=g=>{N.render(B(wt,{key:"__entry__",onCaught:g,children:B(Z)}))};let I=null;if(et(()=>{ot(g=>{I=g})}),I!==null)throw N.unmount(),I instanceof Error?I:new Error(String(I));const V=await L(),W=new J(o,s,{...V?{writeBackend:V}:{}});return d&&requestAnimationFrame(()=>H(d)),{adapter:W,dispose:()=>{W.disposeReactRootAdapter(),N.unmount()}}}function K(){return $().map(e=>e.ok?e.stories.map(o=>o.id).join(","):`!${e.modulePath}`).join("|")}function we(e){let o=U()?$():null,r=o===null?null:K(),n=null;const s=ct(()=>{if(!U())return;const d=$(),c=K();if(o===null){o=d,r=c;return}const i=c!==r;o=d,r=c,i&&(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,x=!0,e(),setTimeout(()=>{x=!1},0)},250))});return()=>{n!==null&&clearTimeout(n),n=null,s()}}export{be as mountReactDesignLayer,we as reprojectWhenStoriesRepublish};
@@ -1 +1 @@
1
- import{c as g}from"./content-bounds-DKBD7nsv.js";import{isEditorOwnedObject as u}from"./editor-layers-B4oYfpj8.js";import{m as x}from"./renderer-ownership-BovSEcLv.js";import{W as w}from"./three.module-BLhyNg0e.js";import{f as C}from"./scene-framing-PVMqGU8h.js";import{ej as y,A as M,d9 as d,fo as s,ex as v,cj as S}from"./three.core-3arARmh6.js";import"./hierarchy-marks-C25dY2fR.js";import"./workspace-arrangement-DIMM7ska.js";import"./index-CaG87ZF-.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 W(n){const e=[];return n.traverse(a=>{!u(a)&&a.isCamera&&e.push(a)}),e}function R(n,e){const a=[];n.traverse(r=>{r.parent&&u(r)&&a.push({object:r,parent:r.parent})});for(const{object:r}of a)r.removeFromParent();let t;try{t=g(n)}finally{for(const{object:r,parent:h}of a)h.add(r)}const o=t.filter(r=>!r.overlay&&!r.enclosure),c=C(o.map(r=>r.box)),i=new d(42,e,.01,1e5),f=c.isEmpty()?new s:c.getCenter(new s),m=c.isEmpty()?1:Math.max(.01,c.getBoundingSphere(new v).radius),p=m/Math.sin(S.degToRad(i.fov/2));return i.position.copy(f).addScaledVector(new s(1,.75,1).normalize(),p*1.15),i.lookAt(f),i.near=Math.max(.001,p-m*2.5),i.far=p+m*3,i.updateProjectionMatrix(),i.updateMatrixWorld(!0),i}function P(n,e){if(e.camera){const t=new d(e.camera.fov??42,e.width/e.height,.01,1e5);return t.position.set(e.camera.position.x,e.camera.position.y,e.camera.position.z),t.lookAt(e.camera.target.x,e.camera.target.y,e.camera.target.z),t.updateMatrixWorld(!0),t}const a=W(n);if(a.length===1){const t=a[0].clone();return t.matrixWorld.copy(a[0].matrixWorld),t.matrixWorld.decompose(t.position,t.quaternion,t.scale),t instanceof d&&(t.aspect=e.width/e.height,t.updateProjectionMatrix()),t}return R(n,e.width/e.height)}function I(n,e,a,t){e.updateMatrixWorld(!0);const l=P(n,a),o=x(new w({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));let c;try{return c=t?.(o),o.setPixelRatio(1),o.setSize(a.width,a.height,!1),o.outputColorSpace=y,o.toneMapping=M,o.setClearColor(2106411,e.background===null?0:1),o.render(e,l),o.domElement.toDataURL("image/png")}finally{c?.(),o.dispose(),o.forceContextLoss()}}export{I as captureAuthoredThreeScenePreview};
1
+ import{c as g}from"./content-bounds-7UyI42Vj.js";import{isEditorOwnedObject as u}from"./editor-layers-CGX7iCSP.js";import{m as x}from"./renderer-ownership-BovSEcLv.js";import{W as w}from"./three.module-BLhyNg0e.js";import{f as C}from"./scene-framing-BhNk0WhI.js";import{ej as y,A as M,d9 as d,fo as s,ex as v,cj as S}from"./three.core-3arARmh6.js";import"./hierarchy-marks-CndAXtie.js";import"./workspace-arrangement-dkubzCff.js";import"./index-Cr9NTnJp.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 W(n){const e=[];return n.traverse(a=>{!u(a)&&a.isCamera&&e.push(a)}),e}function R(n,e){const a=[];n.traverse(r=>{r.parent&&u(r)&&a.push({object:r,parent:r.parent})});for(const{object:r}of a)r.removeFromParent();let t;try{t=g(n)}finally{for(const{object:r,parent:h}of a)h.add(r)}const o=t.filter(r=>!r.overlay&&!r.enclosure),c=C(o.map(r=>r.box)),i=new d(42,e,.01,1e5),f=c.isEmpty()?new s:c.getCenter(new s),m=c.isEmpty()?1:Math.max(.01,c.getBoundingSphere(new v).radius),p=m/Math.sin(S.degToRad(i.fov/2));return i.position.copy(f).addScaledVector(new s(1,.75,1).normalize(),p*1.15),i.lookAt(f),i.near=Math.max(.001,p-m*2.5),i.far=p+m*3,i.updateProjectionMatrix(),i.updateMatrixWorld(!0),i}function P(n,e){if(e.camera){const t=new d(e.camera.fov??42,e.width/e.height,.01,1e5);return t.position.set(e.camera.position.x,e.camera.position.y,e.camera.position.z),t.lookAt(e.camera.target.x,e.camera.target.y,e.camera.target.z),t.updateMatrixWorld(!0),t}const a=W(n);if(a.length===1){const t=a[0].clone();return t.matrixWorld.copy(a[0].matrixWorld),t.matrixWorld.decompose(t.position,t.quaternion,t.scale),t instanceof d&&(t.aspect=e.width/e.height,t.updateProjectionMatrix()),t}return R(n,e.width/e.height)}function I(n,e,a,t){e.updateMatrixWorld(!0);const l=P(n,a),o=x(new w({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));let c;try{return c=t?.(o),o.setPixelRatio(1),o.setSize(a.width,a.height,!1),o.outputColorSpace=y,o.toneMapping=M,o.setClearColor(2106411,e.background===null?0:1),o.render(e,l),o.domElement.toDataURL("image/png")}finally{c?.(),o.dispose(),o.forceContextLoss()}}export{I as captureAuthoredThreeScenePreview};
@@ -1 +1 @@
1
- import{aq as y,ar as v}from"./index-CaG87ZF-.js";import{J as R,c as x}from"./json-history-resource-CTXRV4GD.js";import{D as C,s as w,a as b,c as k,m as T}from"./react-world-authoring-adapter-C1jPW_cN.js";import{g as p,b as u}from"./inspect-C8RP8G5F.js";function H(a){const e=(typeof a=="string"?a:a?.baseVal)?.trim()??"";if(e)return e.split(/\s+/)[0]}function S(a,t){if(a.id)return`${t}#${a.id}`;const e=H(a.className??"");return e?`${t}.${e}`:t}function j(a){const t=new Map;for(const[e,s]of a.nodes)t.set(e,{id:e,tag:s.object.tagName.toLowerCase(),el:s.object,parentId:s.parentId,childIds:[...s.childIds]});return{nodes:t,rootIds:[...a.rootIds]}}const g=[{prop:"color",label:"Color",type:"color"},{prop:"backgroundColor",label:"Background",type:"color"},{prop:"borderColor",label:"Border Color",type:"color"},{prop:"fontSize",label:"Font Size",type:"number"},{prop:"width",label:"Width",type:"number"},{prop:"height",label:"Height",type:"number"},{prop:"padding",label:"Padding",type:"number"},{prop:"margin",label:"Margin",type:"number"},{prop:"borderRadius",label:"Border Radius",type:"number"},{prop:"gap",label:"Gap",type:"number"},{prop:"display",label:"Display",type:"enum",options:["flex","block","none","grid"]},{prop:"textAlign",label:"Text Align",type:"enum",options:["left","center","right"]},{prop:"flexDirection",label:"Flex Direction",type:"enum",options:["row","column"]}],f="style.",M=new Map(g.map(({prop:a,type:t})=>[a,t]));class D{constructor(t,e,s){this.root=t,this.store=e;const o=e.shell.projectHistory;this.historyResource=o?new R({history:o,kind:"session-state",scope:"session",subject:{...s.journal,id:`${s.journal.id}/react-dom-edits`},displayName:"React DOM edits",capture:()=>this.captureHistoryState(),restore:async i=>{this.restoreHistoryState(i)}}):null}capabilities={transform:!1,inspectorFields:!0,persist:!1};provenance={source:"foreign",label:"live-only",detail:"Unmodified ingested React game — style edits apply for this session only and are never saved."};doc={};historyResource;projector=new C(w());snapCache=null;snapInvalidationScheduled=!1;boxEditSession=null;lockedIds=new Set;snapshot(){if(this.snapCache)return this.snapCache;this.projector.project(this.root);const t=j(this.projector);return this.snapCache=t,this.snapInvalidationScheduled||(this.snapInvalidationScheduled=!0,queueMicrotask(()=>{this.snapCache=null,this.snapInvalidationScheduled=!1})),t}nodeCount(){return this.snapshot().nodes.size}toEditorNode(t){return{id:t.id,label:S(t.el,t.tag),role:"element",kind:t.tag,parentId:t.parentId,childIds:t.childIds}}applyStyleToElement(t,e,s){t.style&&(t.style[e]=s)}recordStyleEdit(t,e,s){const o=this.doc[t]??{};o[e]=s,this.doc[t]=o}hierarchy={roots:()=>{const{nodes:t,rootIds:e}=this.snapshot();return e.map(s=>this.toEditorNode(t.get(s)))},node:t=>{const e=this.snapshot().nodes.get(t);return e?this.toEditorNode(e):null}};selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>this.store.shell.selectMultiple(t)};pickable={pick:(t,e)=>{const{nodes:s}=this.snapshot();let o=null,i=Number.POSITIVE_INFINITY,r=-1,l=-1;for(const c of s.values()){if(l++,this.lockedIds.has(c.id)||c.el.style?.pointerEvents==="none")continue;const n=c.el.getBoundingClientRect?.();if(!n||t<n.left||t>n.right||e<n.top||e>n.bottom)continue;const h=n.width*n.height;(h<i||h===i&&l>r)&&(o=c.id,i=h,r=l)}return o}};hostRect(){const t=this.root.getBoundingClientRect?.();return{left:t?.left??0,top:t?.top??0}}toHostRelative(t){const e=this.hostRect();return{x:t.left-e.left,y:t.top-e.top,width:t.width,height:t.height}}rects={rect:t=>{const s=this.snapshot().nodes.get(t)?.el.getBoundingClientRect?.();return s?this.toHostRelative(s):null},contextRects:t=>{const{nodes:e}=this.snapshot(),s=e.get(t);if(!s)return{};const o=s.parentId?e.get(s.parentId):void 0,i=o?.el.getBoundingClientRect?.(),l=(o?o.childIds:this.snapshot().rootIds).filter(d=>d!==t).map(d=>e.get(d)?.el.getBoundingClientRect?.()).filter(d=>d!=null).map(d=>this.toHostRelative(d)),c=s.el,n=c.getBoundingClientRect?.();let h;if(n){const d=y(p(c,"borderTopWidth",u))??0,I=y(p(c,"borderRightWidth",u))??0,E=y(p(c,"borderBottomWidth",u))??0,m=y(p(c,"borderLeftWidth",u))??0;h=this.toHostRelative({left:n.left+m,top:n.top+d,width:Math.max(0,n.width-m-I),height:Math.max(0,n.height-d-E)})}return{...i?{parent:this.toHostRelative(i)}:{},...l.length?{siblings:l}:{},...h?{paddingBox:h}:{}}}};colorSample={backgroundChainAt:(t,e)=>{const s=this.pickable.pick(t,e);if(!s)return null;const{nodes:o}=this.snapshot(),i=[];let r=o.get(s);for(;r;)i.push(p(r.el,"backgroundColor",u)),r=r.parentId?o.get(r.parentId):void 0;return i}};boxEdit={begin:t=>{this.historyResource?.assertCanMutate(),this.boxEditSession={id:t,touched:new Map,priorInline:new Map}},apply:(t,e)=>{this.historyResource?.assertCanMutate();const s=this.boxEditSession;if(!s||s.id!==t)return;const o=this.snapshot().nodes.get(t);if(!o)return;const i=p(o.el,"position",u),r=i==="absolute"||i==="fixed";for(const[l,c]of Object.entries(e)){const n=T(l,r);if(!n){console.warn(`[DomAuthoringAdapter] boxEdit: dropping patch key "${l}" for "${t}" — `+(l==="x"||l==="y"?`node is not absolutely/fixed positioned (computed position: "${i}"), no left/top to move`:"unrecognized box-edit patch key"));continue}if(!s.priorInline.has(n.prop)){const d=b(o.el.style,n.prop);s.priorInline.set(n.prop,d==null?"":String(d))}const h=n.cssValue(c);this.applyStyleToElement(o.el,n.prop,h),s.touched.set(n.prop,h)}},end:t=>{const e=this.boxEditSession;this.boxEditSession=null,!(!e||e.id!==t||e.touched.size===0)&&this.commitBoxEdit(t,e.touched,e.priorInline)}};commitBoxEdit(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState(),i=o.styles[t]??{};o.styles[t]=i;for(const[l,c]of s)i[l]=c;let r=!1;for(const[l,c]of e)r=this.writeStyleEntry(t,l,c)||r;r&&this.historyResource&&this.historyResource.record(`Edit ${e.size} Styles`,o,this.captureHistoryState()).catch(()=>{})}inspector={properties:()=>g.map(({prop:t,label:e,type:s,options:o})=>({path:`${f}${t}`,label:e,type:s,...o?{options:o}:{}})),get:(t,e)=>{if(e==="locked")return this.lockedIds.has(t);if(e==="visible"){const l=this.snapshot().nodes.get(t);return l?b(l.el.style,"visibility")!=="hidden":void 0}if(!e.startsWith(f))return;const s=e.slice(f.length),o=this.snapshot().nodes.get(t);if(!o)return;const i=b(o.el.style,s),r=M.get(s);return r==="number"?y(i):r==="color"?k(i):i},set:(t,e,s)=>{if(e==="locked"){s?this.lockedIds.add(t):this.lockedIds.delete(t),this.store.shell.notifyIngestEdit();return}if(e==="visible"){this.writeStyle(t,"visibility",s?"visible":"hidden");return}if(!e.startsWith(f))return;const o=e.slice(f.length);this.writeStyle(t,o,String(s))}};assetSubject={get:t=>this.assetSubjectForNode(this.snapshot(),t),entries:()=>{const t=this.snapshot();return[...t.nodes.keys()].flatMap(e=>{const s=this.assetSubjectForNode(t,e);return s?[{id:e,subject:s}]:[]})}};assetSubjectForNode(t,e){const s=t.nodes.get(e);return!s||s.tag!=="svg"||!s.el.outerHTML?null:{kind:"image",name:S(s.el,s.tag),mediaType:"image/svg+xml",text:s.el.outerHTML}}writeStyleEntry(t,e,s){const o=this.snapshot().nodes.get(t);return o?(this.applyStyleToElement(o.el,e,s),this.recordStyleEdit(t,e,s),this.store.shell.notifyIngestEdit(),!0):!1}writeStyle(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState();this.writeStyleEntry(t,e,s)&&this.historyResource&&this.historyResource.record(`Set ${e}`,o,this.captureHistoryState()).catch(()=>{})}dispose(){this.historyResource?.dispose()}captureHistoryState(){const t={};for(const[e,s]of this.snapshot().nodes){const o={};for(const{prop:i}of g){const r=b(s.el.style,i);r!==""&&(o[i]=String(r))}t[e]=o}return{edits:structuredClone(this.doc),styles:t}}restoreHistoryState(t){for(const s of Object.keys(this.doc))delete this.doc[s];Object.assign(this.doc,structuredClone(t.edits));const{nodes:e}=this.snapshot();for(const[s,o]of e){const i=t.styles[s]??{};for(const{prop:r}of g)this.applyStyleToElement(o.el,r,i[r]??"")}this.store.shell.notifyIngestEdit()}subscribe(t){return this.store.shell.subscribe(t)}get persistence(){return{...x(),destination:v}}}export{D};
1
+ import{ar as y,as as v}from"./index-Cr9NTnJp.js";import{J as R,c as x}from"./json-history-resource-C9G_vCX9.js";import{D as C,s as w,a as b,c as k,m as T}from"./react-world-authoring-adapter-CuyruDfq.js";import{g as p,b as u}from"./inspect-CN92MgRT.js";function H(a){const e=(typeof a=="string"?a:a?.baseVal)?.trim()??"";if(e)return e.split(/\s+/)[0]}function S(a,t){if(a.id)return`${t}#${a.id}`;const e=H(a.className??"");return e?`${t}.${e}`:t}function j(a){const t=new Map;for(const[e,s]of a.nodes)t.set(e,{id:e,tag:s.object.tagName.toLowerCase(),el:s.object,parentId:s.parentId,childIds:[...s.childIds]});return{nodes:t,rootIds:[...a.rootIds]}}const g=[{prop:"color",label:"Color",type:"color"},{prop:"backgroundColor",label:"Background",type:"color"},{prop:"borderColor",label:"Border Color",type:"color"},{prop:"fontSize",label:"Font Size",type:"number"},{prop:"width",label:"Width",type:"number"},{prop:"height",label:"Height",type:"number"},{prop:"padding",label:"Padding",type:"number"},{prop:"margin",label:"Margin",type:"number"},{prop:"borderRadius",label:"Border Radius",type:"number"},{prop:"gap",label:"Gap",type:"number"},{prop:"display",label:"Display",type:"enum",options:["flex","block","none","grid"]},{prop:"textAlign",label:"Text Align",type:"enum",options:["left","center","right"]},{prop:"flexDirection",label:"Flex Direction",type:"enum",options:["row","column"]}],f="style.",M=new Map(g.map(({prop:a,type:t})=>[a,t]));class D{constructor(t,e,s){this.root=t,this.store=e;const o=e.shell.projectHistory;this.historyResource=o?new R({history:o,kind:"session-state",scope:"session",subject:{...s.journal,id:`${s.journal.id}/react-dom-edits`},displayName:"React DOM edits",capture:()=>this.captureHistoryState(),restore:async i=>{this.restoreHistoryState(i)}}):null}capabilities={transform:!1,inspectorFields:!0,persist:!1};provenance={source:"foreign",label:"live-only",detail:"Unmodified ingested React game — style edits apply for this session only and are never saved."};doc={};historyResource;projector=new C(w());snapCache=null;snapInvalidationScheduled=!1;boxEditSession=null;lockedIds=new Set;snapshot(){if(this.snapCache)return this.snapCache;this.projector.project(this.root);const t=j(this.projector);return this.snapCache=t,this.snapInvalidationScheduled||(this.snapInvalidationScheduled=!0,queueMicrotask(()=>{this.snapCache=null,this.snapInvalidationScheduled=!1})),t}nodeCount(){return this.snapshot().nodes.size}toEditorNode(t){return{id:t.id,label:S(t.el,t.tag),role:"element",kind:t.tag,parentId:t.parentId,childIds:t.childIds}}applyStyleToElement(t,e,s){t.style&&(t.style[e]=s)}recordStyleEdit(t,e,s){const o=this.doc[t]??{};o[e]=s,this.doc[t]=o}hierarchy={roots:()=>{const{nodes:t,rootIds:e}=this.snapshot();return e.map(s=>this.toEditorNode(t.get(s)))},node:t=>{const e=this.snapshot().nodes.get(t);return e?this.toEditorNode(e):null}};selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>this.store.shell.selectMultiple(t)};pickable={pick:(t,e)=>{const{nodes:s}=this.snapshot();let o=null,i=Number.POSITIVE_INFINITY,r=-1,l=-1;for(const c of s.values()){if(l++,this.lockedIds.has(c.id)||c.el.style?.pointerEvents==="none")continue;const n=c.el.getBoundingClientRect?.();if(!n||t<n.left||t>n.right||e<n.top||e>n.bottom)continue;const h=n.width*n.height;(h<i||h===i&&l>r)&&(o=c.id,i=h,r=l)}return o}};hostRect(){const t=this.root.getBoundingClientRect?.();return{left:t?.left??0,top:t?.top??0}}toHostRelative(t){const e=this.hostRect();return{x:t.left-e.left,y:t.top-e.top,width:t.width,height:t.height}}rects={rect:t=>{const s=this.snapshot().nodes.get(t)?.el.getBoundingClientRect?.();return s?this.toHostRelative(s):null},contextRects:t=>{const{nodes:e}=this.snapshot(),s=e.get(t);if(!s)return{};const o=s.parentId?e.get(s.parentId):void 0,i=o?.el.getBoundingClientRect?.(),l=(o?o.childIds:this.snapshot().rootIds).filter(d=>d!==t).map(d=>e.get(d)?.el.getBoundingClientRect?.()).filter(d=>d!=null).map(d=>this.toHostRelative(d)),c=s.el,n=c.getBoundingClientRect?.();let h;if(n){const d=y(p(c,"borderTopWidth",u))??0,I=y(p(c,"borderRightWidth",u))??0,E=y(p(c,"borderBottomWidth",u))??0,m=y(p(c,"borderLeftWidth",u))??0;h=this.toHostRelative({left:n.left+m,top:n.top+d,width:Math.max(0,n.width-m-I),height:Math.max(0,n.height-d-E)})}return{...i?{parent:this.toHostRelative(i)}:{},...l.length?{siblings:l}:{},...h?{paddingBox:h}:{}}}};colorSample={backgroundChainAt:(t,e)=>{const s=this.pickable.pick(t,e);if(!s)return null;const{nodes:o}=this.snapshot(),i=[];let r=o.get(s);for(;r;)i.push(p(r.el,"backgroundColor",u)),r=r.parentId?o.get(r.parentId):void 0;return i}};boxEdit={begin:t=>{this.historyResource?.assertCanMutate(),this.boxEditSession={id:t,touched:new Map,priorInline:new Map}},apply:(t,e)=>{this.historyResource?.assertCanMutate();const s=this.boxEditSession;if(!s||s.id!==t)return;const o=this.snapshot().nodes.get(t);if(!o)return;const i=p(o.el,"position",u),r=i==="absolute"||i==="fixed";for(const[l,c]of Object.entries(e)){const n=T(l,r);if(!n){console.warn(`[DomAuthoringAdapter] boxEdit: dropping patch key "${l}" for "${t}" — `+(l==="x"||l==="y"?`node is not absolutely/fixed positioned (computed position: "${i}"), no left/top to move`:"unrecognized box-edit patch key"));continue}if(!s.priorInline.has(n.prop)){const d=b(o.el.style,n.prop);s.priorInline.set(n.prop,d==null?"":String(d))}const h=n.cssValue(c);this.applyStyleToElement(o.el,n.prop,h),s.touched.set(n.prop,h)}},end:t=>{const e=this.boxEditSession;this.boxEditSession=null,!(!e||e.id!==t||e.touched.size===0)&&this.commitBoxEdit(t,e.touched,e.priorInline)}};commitBoxEdit(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState(),i=o.styles[t]??{};o.styles[t]=i;for(const[l,c]of s)i[l]=c;let r=!1;for(const[l,c]of e)r=this.writeStyleEntry(t,l,c)||r;r&&this.historyResource&&this.historyResource.record(`Edit ${e.size} Styles`,o,this.captureHistoryState()).catch(()=>{})}inspector={properties:()=>g.map(({prop:t,label:e,type:s,options:o})=>({path:`${f}${t}`,label:e,type:s,...o?{options:o}:{}})),get:(t,e)=>{if(e==="locked")return this.lockedIds.has(t);if(e==="visible"){const l=this.snapshot().nodes.get(t);return l?b(l.el.style,"visibility")!=="hidden":void 0}if(!e.startsWith(f))return;const s=e.slice(f.length),o=this.snapshot().nodes.get(t);if(!o)return;const i=b(o.el.style,s),r=M.get(s);return r==="number"?y(i):r==="color"?k(i):i},set:(t,e,s)=>{if(e==="locked"){s?this.lockedIds.add(t):this.lockedIds.delete(t),this.store.shell.notifyIngestEdit();return}if(e==="visible"){this.writeStyle(t,"visibility",s?"visible":"hidden");return}if(!e.startsWith(f))return;const o=e.slice(f.length);this.writeStyle(t,o,String(s))}};assetSubject={get:t=>this.assetSubjectForNode(this.snapshot(),t),entries:()=>{const t=this.snapshot();return[...t.nodes.keys()].flatMap(e=>{const s=this.assetSubjectForNode(t,e);return s?[{id:e,subject:s}]:[]})}};assetSubjectForNode(t,e){const s=t.nodes.get(e);return!s||s.tag!=="svg"||!s.el.outerHTML?null:{kind:"image",name:S(s.el,s.tag),mediaType:"image/svg+xml",text:s.el.outerHTML}}writeStyleEntry(t,e,s){const o=this.snapshot().nodes.get(t);return o?(this.applyStyleToElement(o.el,e,s),this.recordStyleEdit(t,e,s),this.store.shell.notifyIngestEdit(),!0):!1}writeStyle(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState();this.writeStyleEntry(t,e,s)&&this.historyResource&&this.historyResource.record(`Set ${e}`,o,this.captureHistoryState()).catch(()=>{})}dispose(){this.historyResource?.dispose()}captureHistoryState(){const t={};for(const[e,s]of this.snapshot().nodes){const o={};for(const{prop:i}of g){const r=b(s.el.style,i);r!==""&&(o[i]=String(r))}t[e]=o}return{edits:structuredClone(this.doc),styles:t}}restoreHistoryState(t){for(const s of Object.keys(this.doc))delete this.doc[s];Object.assign(this.doc,structuredClone(t.edits));const{nodes:e}=this.snapshot();for(const[s,o]of e){const i=t.styles[s]??{};for(const{prop:r}of g)this.applyStyleToElement(o.el,r,i[r]??"")}this.store.shell.notifyIngestEdit()}subscribe(t){return this.store.shell.subscribe(t)}get persistence(){return{...x(),destination:v}}}export{D};