@volter/game-editor 0.5.67 → 0.5.68

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 (357) hide show
  1. package/BUNDLED_NOTICES +20 -20
  2. package/catalog/entries/blender.json +1 -1
  3. package/catalog/entries/music.json +3 -3
  4. package/catalog/project-source/src/lib/music/music-player.ts +18 -12
  5. package/dist/.vite/manifest.json +2307 -2166
  6. package/dist/assets/{AssetBudgetPanel-x_FNJbfZ.js → AssetBudgetPanel-P2PeL_X5.js} +9 -9
  7. package/dist/assets/{AudioViewer-BDPqHDfU.js → AudioViewer-xFb5Wv7A.js} +1 -1
  8. package/dist/assets/CanvasBoardDocument-BFJdTVGp.js +1 -0
  9. package/dist/assets/CanvasSceneViewport-vqBlOz8P.js +1 -0
  10. package/dist/assets/{ColorInput-QUPS1pEB.js → ColorInput-CX1UZjYO.js} +1 -1
  11. package/dist/assets/{EntityModelDocument-CzUHsH9E.js → EntityModelDocument-Du8wIbyK.js} +1 -1
  12. package/dist/assets/{EnvironmentAssetDocument-ByEB7_4A.js → EnvironmentAssetDocument-_SttfMY_.js} +1 -1
  13. package/dist/assets/{GameplaySessionTimeline-dhG-oiqd.js → GameplaySessionTimeline-CWudWnfd.js} +1 -1
  14. package/dist/assets/{ImageViewer-tlVvkdM4.js → ImageViewer-shZzMd91.js} +1 -1
  15. package/dist/assets/InspectorObjectPreview-BMOvJaOw.js +1 -0
  16. package/dist/assets/{JsonAssetDocument-CPmcWFPW.js → JsonAssetDocument-D_HXneWE.js} +1 -1
  17. package/dist/assets/{LiveModuleDocument-DL8QHSlk.js → LiveModuleDocument-BWjOzO_6.js} +1 -1
  18. package/dist/assets/{LutAssetDocument-BImiug2M.js → LutAssetDocument-DIc6nsht.js} +1 -1
  19. package/dist/assets/ModelAssetDocument-_CqTsX_A.js +1 -0
  20. package/dist/assets/{NonThreeAuthoringBootstrap-B40qmGGS.js → NonThreeAuthoringBootstrap-C-V23E1e.js} +1 -1
  21. package/dist/assets/Object3DDocumentToolbar-BfPH9jz5.js +1 -0
  22. package/dist/assets/Object3DDocumentViewport-BaXWtATg.js +2 -0
  23. package/dist/assets/{Object3DPreview-ClYDoH2L.js → Object3DPreview-BPHEr3vI.js} +1 -1
  24. package/dist/assets/OnlineAssetDetail-BxibUH6K.js +1 -0
  25. package/dist/assets/PlayBar-DRANyO01.js +1 -0
  26. package/dist/assets/{QuarksAssetDocument-B-VOj-n4.js → QuarksAssetDocument-4Dne3EHx.js} +1 -1
  27. package/dist/assets/ReactCanvasControls-K98jOX9b.js +1 -0
  28. package/dist/assets/RootSelectionOverlay-BQC12Gdd.js +1 -0
  29. package/dist/assets/{ShaderAssetDocument-Kn8IvRGV.js → ShaderAssetDocument-W3ZjLCkt.js} +4 -4
  30. package/dist/assets/ShadowEditor-DP1LWynl.js +1 -0
  31. package/dist/assets/{SourceAssetViewer-CLQ95VSD.js → SourceAssetViewer-BGUeDAEv.js} +1 -1
  32. package/dist/assets/StageHost-V_0opXFt.js +2 -0
  33. package/dist/assets/{StoryPreviewMount-D2lg37et.js → StoryPreviewMount-Di8uMovM.js} +1 -1
  34. package/dist/assets/{ThreeBoardDocument-BAgHrbtu.js → ThreeBoardDocument-tgcaZDqQ.js} +2 -2
  35. package/dist/assets/{ThreeIsolationSceneContent-DbYIylZQ.js → ThreeIsolationSceneContent-BAKurKW5.js} +1 -1
  36. package/dist/assets/{ToolObject3DPreview-WEi6C9uU.js → ToolObject3DPreview-CffvGJ1h.js} +1 -1
  37. package/dist/assets/Toolbar-uLgsrB2z.js +1 -0
  38. package/dist/assets/{TransientHint-BpDLhRLd.js → TransientHint-CgmkrmKF.js} +1 -1
  39. package/dist/assets/{VideoViewer-DMV8lf4P.js → VideoViewer-ClUJ6_uy.js} +1 -1
  40. package/dist/assets/ViewportShadingMenu-Bdkc6jcd.js +1 -0
  41. package/dist/assets/{active-ingest-DA426a81.js → active-ingest-CnAeQcuQ.js} +3 -3
  42. package/dist/assets/{animation-clock-Bm80XdqP.js → animation-clock-fLmY_3--.js} +1 -1
  43. package/dist/assets/{animation-mixers.service-DK64IuYq.js → animation-mixers.service-DiecMX_A.js} +1 -1
  44. package/dist/assets/{animation-timeline.utility-D-g0zrOl.js → animation-timeline.utility-C71vPJgs.js} +1 -1
  45. package/dist/assets/{asset-budget-asset.menu-CEgP0Kiw.js → asset-budget-asset.menu-BDRDWrvx.js} +1 -1
  46. package/dist/assets/{asset-budget.action-D4R1c3wi.js → asset-budget.action-tQmNGQHC.js} +1 -1
  47. package/dist/assets/{asset-budget.document-Syzjn1U1.js → asset-budget.document-BthgX37Z.js} +1 -1
  48. package/dist/assets/{asset-budget.menu-BbRiqXeM.js → asset-budget.menu-DfyWVH6p.js} +1 -1
  49. package/dist/assets/{asset-editor-persistence-BGWIqZdk.js → asset-editor-persistence-BQgjOCrm.js} +1 -1
  50. package/dist/assets/{asset-loaders-C0KQI5eY.js → asset-loaders-5PIUVvmH.js} +1 -1
  51. package/dist/assets/{asset-preview-B1tDziF1.js → asset-preview-Cv7tfD98.js} +1 -1
  52. package/dist/assets/{audio-unlock.service-ucMfCVBw.js → audio-unlock.service-BvHvZjzx.js} +1 -1
  53. package/dist/assets/{audio.utility-BmE9WMUg.js → audio.utility-D9Vk_WYS.js} +1 -1
  54. package/dist/assets/autoplay.service-CFJoLPLw.js +1 -0
  55. package/dist/assets/{babylon-authoring-adapter-C8mFMXSr.js → babylon-authoring-adapter-Cg5ALSpr.js} +1 -1
  56. package/dist/assets/binding-resolver-C_9MBSMa.js +2 -0
  57. package/dist/assets/{blender-node-editor.document-C1YmwWls.js → blender-node-editor.document-B92MO51u.js} +1 -1
  58. package/dist/assets/{blender-properties-tab-B8lyjgj3.js → blender-properties-tab-CDVyDAbf.js} +1 -1
  59. package/dist/assets/{blender-runtime-host-CyQlImSR.js → blender-runtime-host-CuniE0sy.js} +1 -1
  60. package/dist/assets/{blender-runtime-skin-BK7ShZ6z.js → blender-runtime-skin-B_tOz5j5.js} +1 -1
  61. package/dist/assets/{blender-runtime.document-B0nVQs0P.js → blender-runtime.document-DxUwLiEW.js} +1 -1
  62. package/dist/assets/{blender-timeline.document-CMcdE2CK.js → blender-timeline.document-BdEEoQbK.js} +1 -1
  63. package/dist/assets/{blender-uv-editor.document-CjqNo4sZ.js → blender-uv-editor.document-EMSUlRh4.js} +1 -1
  64. package/dist/assets/{blender-version.status-OsFoc9SA.js → blender-version.status-DtfwUahB.js} +1 -1
  65. package/dist/assets/{blender.command-C6NmRBo5.js → blender.command-BkBML2SY.js} +1 -1
  66. package/dist/assets/blender.keymap-BmOBRY7p.js +1 -0
  67. package/dist/assets/{board-guides-BEKPgD9M.js → board-guides-_3R1t_-2.js} +1 -1
  68. package/dist/assets/bridge.command-VnplZ81v.js +3 -0
  69. package/dist/assets/{browserAll-lF_dLQVz.js → browserAll-BCmkqg8n.js} +1 -1
  70. package/dist/assets/build-player.document-DV7YcJQt.js +1 -0
  71. package/dist/assets/build-profiles.document-CZxDuhzz.js +2 -0
  72. package/dist/assets/{build-progress.status-Bo1ZgJcb.js → build-progress.status-Dk5u3C67.js} +1 -1
  73. package/dist/assets/build-session-BGe0eGrQ.js +9 -0
  74. package/dist/assets/{build.action-DRX2IcYt.js → build.action-Bdj4ZEL_.js} +1 -1
  75. package/dist/assets/{build.command-BGvLaLG0.js → build.command-DAWiYvPa.js} +1 -1
  76. package/dist/assets/build.header--xqH6uTP.js +1 -0
  77. package/dist/assets/{build.menu-UenrjPWS.js → build.menu-BiRNC_xc.js} +1 -1
  78. package/dist/assets/{build.service-BIUoTY6l.js → build.service-Dw9K6VSF.js} +1 -1
  79. package/dist/assets/{camera-DrvaM47S.js → camera-C-qXzXFf.js} +1 -1
  80. package/dist/assets/{camera-runtime.inspector-CjJALNO8.js → camera-runtime.inspector-BDrwWRlU.js} +1 -1
  81. package/dist/assets/canvas-design-mount-DLn49Zle.js +6 -0
  82. package/dist/assets/canvas-entry-runtime-DVeh71nC.js +2 -0
  83. package/dist/assets/{canvas-preview-frames-C0QTagA3.js → canvas-preview-frames-B5xFRjhQ.js} +1 -1
  84. package/dist/assets/{canvas-story-capture.service-Dgjr-rT1.js → canvas-story-capture.service-DQ_leYyi.js} +2 -2
  85. package/dist/assets/{capability-coverage-DZ-onC5j.js → capability-coverage-DQgg6UJe.js} +3 -3
  86. package/dist/assets/{collaboration-presence-BVIQuN1l.js → collaboration-presence-BOS1t8wI.js} +1 -1
  87. package/dist/assets/{collider-C7SbIYKY.js → collider-Bf4Uk6LW.js} +1 -1
  88. package/dist/assets/{component-board.service-CWFaGMCO.js → component-board.service-CpVXGhz5.js} +2 -2
  89. package/dist/assets/{component-board.service-BEsFAw4_.js → component-board.service-DFSSCaCf.js} +2 -2
  90. package/dist/assets/{component-board.service-q_TM9BCw.js → component-board.service-DgujG90T.js} +2 -2
  91. package/dist/assets/{component-contracts.service-CPbfXE1h.js → component-contracts.service-Bc_2Xxh_.js} +1 -1
  92. package/dist/assets/{component-instance-root-B0C5oNEm.js → component-instance-root-df4ofoOR.js} +1 -1
  93. package/dist/assets/{component-verbs.command-oNtGgzQL.js → component-verbs.command-DGzZAV_Z.js} +1 -1
  94. package/dist/assets/component-verbs.service-D1rVRogp.js +1 -0
  95. package/dist/assets/{config-_wCzzlM_.js → config-D-EAAhqP.js} +4 -4
  96. package/dist/assets/{configurations-BXU4GGbV.js → configurations-_HZOWZPy.js} +1 -1
  97. package/dist/assets/{connection.status-Yvt0bX0r.js → connection.status-CCX-mgmr.js} +1 -1
  98. package/dist/assets/{constraints.inspector-4r8jWq5a.js → constraints.inspector-CwEEREsf.js} +1 -1
  99. package/dist/assets/{content-bounds-BeuIXKYu.js → content-bounds-DKBD7nsv.js} +1 -1
  100. package/dist/assets/{contract-system-adapters-Bic_7sev.js → contract-system-adapters-h6OUBRYA.js} +1 -1
  101. package/dist/assets/{coverage.service-DcpEoBuf.js → coverage.service-CV7b5Sqn.js} +2 -2
  102. package/dist/assets/create-runtime-Bg2uYMfh.js +3 -0
  103. package/dist/assets/{curve-DVd18iAX.js → curve-BKuiAPpj.js} +1 -1
  104. package/dist/assets/{data-asset-DfQ2Pjse.js → data-asset-7Nfmx-28.js} +1 -1
  105. package/dist/assets/{data-ref-CWnkj-HX.js → data-ref-DyFQqqX6.js} +1 -1
  106. package/dist/assets/debug-bridge-CESAxmlz.js +1 -0
  107. package/dist/assets/{debug-registry-P0_YQGWd.js → debug-registry-l7k5Hjc8.js} +1 -1
  108. package/dist/assets/{deferred-ingest-play-BdR4qGk6.js → deferred-ingest-play-Bej67_y9.js} +2 -2
  109. package/dist/assets/{design-time-canvas-mount-DPQeHSN2.js → design-time-canvas-mount-CFW9ZWuk.js} +2 -2
  110. package/dist/assets/{design-time-layers-ChswRUJt.js → design-time-layers-CQgnmqc8.js} +1 -1
  111. package/dist/assets/{design-time-mount.service-Ks-5Wkcs.js → design-time-mount.service-DJeAPUB_.js} +2 -2
  112. package/dist/assets/{design-time-mount.service-Ca-DZGFV.js → design-time-mount.service-_R1UDCw3.js} +2 -2
  113. package/dist/assets/{design-time-react-mount-C85KfXOd.js → design-time-react-mount-CFvIk_rV.js} +1 -1
  114. package/dist/assets/{document-preview-three-DThkjI1S.js → document-preview-three-5cbuuJMH.js} +1 -1
  115. package/dist/assets/{dom-authoring-adapter-BrLU8IJ_.js → dom-authoring-adapter-CoESNvrM.js} +1 -1
  116. package/dist/assets/{draco3d-B2cwv46o.js → draco3d-Sk9K4AUT.js} +1 -1
  117. package/dist/assets/{edit-mode-audio.service-D4ITNbsm.js → edit-mode-audio.service-CH6J-8N7.js} +1 -1
  118. package/dist/assets/{edit-mode-authoring-DeCxPcHM.js → edit-mode-authoring-DBjaBTxM.js} +1 -1
  119. package/dist/assets/{edit-mode-networking.service-BNv-FTRh.js → edit-mode-networking.service-C4o2pGHX.js} +1 -1
  120. package/dist/assets/editor-api-D2azVray.js +1 -0
  121. package/dist/assets/{editor-layers-BDJnAAzj.js → editor-layers-B4oYfpj8.js} +1 -1
  122. package/dist/assets/{editor-shell-store-ChLcVeNB.js → editor-shell-store-Bh1S7M54.js} +1 -1
  123. package/dist/assets/{entity-object-JmYMfLsx.js → entity-object-B_5Gc0Ky.js} +1 -1
  124. package/dist/assets/{extend-Cc-nEa_A.js → extend-DcEyE5jI.js} +1 -1
  125. package/dist/assets/fork-menu-CKjNh3MO.js +1 -0
  126. package/dist/assets/{frame-debugger-store-DaCbAYSW.js → frame-debugger-store-D5YViF_8.js} +1 -1
  127. package/dist/assets/{game-contract-seams-BnPFGLll.js → game-contract-seams-C0AVYwvO.js} +1 -1
  128. package/dist/assets/{game-css-scope-transform-D_p7cVgW.js → game-css-scope-transform-8GOvVu1s.js} +1 -1
  129. package/dist/assets/game-document.service-FdG_gFPU.js +1 -0
  130. package/dist/assets/game-eval.command-4wa9vqWE.js +2 -0
  131. package/dist/assets/{game-module-access-o3iXZpCA.js → game-module-access-DulnT3NH.js} +1 -1
  132. package/dist/assets/game-network-Bo_nlDR5.js +22 -0
  133. package/dist/assets/{gameplay-export-BzYzLZPi.js → gameplay-export-K5AcStVC.js} +1 -1
  134. package/dist/assets/{gameplay-replay-BwdxV4oF.js → gameplay-replay-CnWnlogY.js} +1 -1
  135. package/dist/assets/gameplay.command-DoWqBWhH.js +1 -0
  136. package/dist/assets/{generation-jobs-BZhOMrp-.js → generation-jobs-CiabIfR0.js} +1 -1
  137. package/dist/assets/generation.service-D2yeZaJu.js +1 -0
  138. package/dist/assets/{generations-DVDht_31.js → generations-DU9rCeQR.js} +1 -1
  139. package/dist/assets/{generations.status-BvzgHlyk.js → generations.status-3CrPw_n5.js} +1 -1
  140. package/dist/assets/{hierarchy-marks-Cc_3lxw6.js → hierarchy-marks-C25dY2fR.js} +1 -1
  141. package/dist/assets/{hosted-asset-materialization-BpbnhJac.js → hosted-asset-materialization-DYdcFlDf.js} +1 -1
  142. package/dist/assets/{index-0Lm0Nf1M.css → index-B5WjeCHm.css} +1 -1
  143. package/dist/assets/{index-C1c3eOmm.js → index-BcH5GC3b.js} +1 -1
  144. package/dist/assets/{index-cNc-iFbq.js → index-BsYc2Oyj.js} +1 -1
  145. package/dist/assets/{index-SS9EugVg.js → index-C20Flc1s.js} +2 -2
  146. package/dist/assets/{index-Ck3JFh48.js → index-C4AUQbmq.js} +1 -1
  147. package/dist/assets/{index-DUZeuA7g.js → index-CC1puVjo.js} +1 -1
  148. package/dist/assets/{index-BRJMIUK0.js → index-CaG87ZF-.js} +321 -321
  149. package/dist/assets/index-CwCDkEl1.js +1 -0
  150. package/dist/assets/{index-C3Pw-9So.js → index-Kb9_s5aP.js} +1 -1
  151. package/dist/assets/{index-BeK4RPgj.js → index-n3QdTv-T.js} +1 -1
  152. package/dist/assets/{inference-diagnostics-xecGdohW.js → inference-diagnostics-MGcIHEX6.js} +1 -1
  153. package/dist/assets/{ingest-boot-viewport-DAt8WFSy.js → ingest-boot-viewport-D2okO6JI.js} +1 -1
  154. package/dist/assets/ingest-siblings-CkxW__go.js +1 -0
  155. package/dist/assets/{ingest-source-persistence-Dmdo-UBp.js → ingest-source-persistence-6peGfPAS.js} +1 -1
  156. package/dist/assets/{ingest.service-vbCucMz7.js → ingest.service-Cc73WMIW.js} +1 -1
  157. package/dist/assets/{inspect-Dr4qvDpJ.js → inspect-C8RP8G5F.js} +1 -1
  158. package/dist/assets/instances.command-CxKGnrNl.js +1 -0
  159. package/dist/assets/{json-history-resource-DwS10tqD.js → json-history-resource-CTXRV4GD.js} +1 -1
  160. package/dist/assets/layered-pick-B_-BRrRD.js +1 -0
  161. package/dist/assets/{light-DcFqVCmv.js → light-CskDQ8gF.js} +1 -1
  162. package/dist/assets/{live-project-verbs-C3LzprCe.js → live-project-verbs-BOAQN3ME.js} +1 -1
  163. package/dist/assets/{machine.document-BzZxubYQ.js → machine.document-BxOoCOo9.js} +1 -1
  164. package/dist/assets/{machines.finder-BR02bfVG.js → machines.finder-CqEceWzS.js} +1 -1
  165. package/dist/assets/{material-B_V78pTt.js → material-BwFzKPi0.js} +1 -1
  166. package/dist/assets/{material-factory-COz7qZhC.js → material-factory-qB9pzcQf.js} +1 -1
  167. package/dist/assets/{mesh-DcmO-mWI.js → mesh-5--4qA-C.js} +1 -1
  168. package/dist/assets/model-asset-sections.service-TZ2SaBmH.js +1 -0
  169. package/dist/assets/{model-inspection-CXHxrafK.js → model-inspection-MrJY0U_-.js} +1 -1
  170. package/dist/assets/{model-thumbnail-BEKPWg4l.js → model-thumbnail-uk-2sblh.js} +1 -1
  171. package/dist/assets/{models.finder-c1I0tp2M.js → models.finder-rk8dhgO8.js} +1 -1
  172. package/dist/assets/module-mode-B79jV5tQ.js +2 -0
  173. package/dist/assets/mount-canvas-ingest-root-BhaYNuhY.js +2 -0
  174. package/dist/assets/mount-dom-ingest-root-BQb1u0LX.js +2 -0
  175. package/dist/assets/mount-ingest-root-BC3-1Cw1.js +2 -0
  176. package/dist/assets/mount-manifest-QJOB11Kv.js +1 -0
  177. package/dist/assets/{mount-three-ingest-root-DVbACDUy.js → mount-three-ingest-root-DIDBfvIH.js} +1 -1
  178. package/dist/assets/{mounted-authoring-Clftxx0x.js → mounted-authoring-B7RL_V28.js} +1 -1
  179. package/dist/assets/{mounted-story-viewport-source-B4-eAYGI.js → mounted-story-viewport-source-CnYhX3vW.js} +1 -1
  180. package/dist/assets/{native-debug-module-2_HVupdg.js → native-debug-module-B-rWJfWE.js} +1 -1
  181. package/dist/assets/{navigation-CH3-zr1n.js → navigation-BVu-aVmF.js} +1 -1
  182. package/dist/assets/{navmesh.menu-Dfi-Pk-8.js → navmesh.menu-C3M63eR4.js} +1 -1
  183. package/dist/assets/{navmesh.service-Cz7QFY-M.js → navmesh.service-B0H1fUfn.js} +1 -1
  184. package/dist/assets/network-observer.service-CiR4Q9Q0.js +1 -0
  185. package/dist/assets/network.utility-CNG3eJ0E.js +1 -0
  186. package/dist/assets/{object3d-document-session-registry-DJDEDM0p.js → object3d-document-session-registry-OjqzJ86S.js} +2 -2
  187. package/dist/assets/{oid-transform-D5Kxt6ij.js → oid-transform-Bzc2ZJSH.js} +1 -1
  188. package/dist/assets/{particles-vRp0Lf3o.js → particles-Be7AvO4c.js} +1 -1
  189. package/dist/assets/pixi-authoring-adapter-B42K4md-.js +1 -0
  190. package/dist/assets/{pixi-live-write-target-BjDsBQbp.js → pixi-live-write-target-D56tQEe_.js} +1 -1
  191. package/dist/assets/play.command-CIGRq8ow.js +2 -0
  192. package/dist/assets/presentation-DGBuGP6i.js +1 -0
  193. package/dist/assets/{product-CxmUIxmr.js → product-BN31wSnB.js} +1 -1
  194. package/dist/assets/{profiler.action-Dzy9DuAc.js → profiler.action-D57Kj9ym.js} +1 -1
  195. package/dist/assets/{profiler.menu-jLDO3U6N.js → profiler.menu-Dh9Q5DDx.js} +1 -1
  196. package/dist/assets/{profiler.utility-Do2Bw7MY.js → profiler.utility-DLNySW3w.js} +1 -1
  197. package/dist/assets/{project-authoring-session-C3eusefK.js → project-authoring-session-LCJAwGrD.js} +2 -2
  198. package/dist/assets/{properties-bone-constraints.inspector-B_PbSMV7.js → properties-bone-constraints.inspector-CaIDq5nN.js} +1 -1
  199. package/dist/assets/{properties-bone.inspector-CMDEQuBd.js → properties-bone.inspector-D2fcQGMF.js} +1 -1
  200. package/dist/assets/{properties-collection.inspector-D7Ay8yRj.js → properties-collection.inspector-CF5AtTAd.js} +1 -1
  201. package/dist/assets/{properties-constraints.inspector-DS1fZgXK.js → properties-constraints.inspector-Bj2itDrS.js} +1 -1
  202. package/dist/assets/{properties-data.inspector-k2pGN2Mp.js → properties-data.inspector-BfRqk0Xo.js} +1 -1
  203. package/dist/assets/{properties-material.inspector-Bb3yAGUx.js → properties-material.inspector-Bf8H0mvu.js} +1 -1
  204. package/dist/assets/{properties-modifiers.inspector-BcJfe-Wy.js → properties-modifiers.inspector-BKShc1TH.js} +1 -1
  205. package/dist/assets/{properties-object.inspector-CUSfXJuq.js → properties-object.inspector-YBh8ABnN.js} +1 -1
  206. package/dist/assets/{properties-output.inspector-BTVW2kn1.js → properties-output.inspector-CVkzfs-l.js} +1 -1
  207. package/dist/assets/{properties-particles.inspector-Cw0fxx3B.js → properties-particles.inspector-ChDpAq-2.js} +1 -1
  208. package/dist/assets/{properties-physics.inspector-C-0bD2bu.js → properties-physics.inspector-BLEM7aMj.js} +1 -1
  209. package/dist/assets/{properties-render.inspector-C8D5UpjX.js → properties-render.inspector-vU4D9xLL.js} +1 -1
  210. package/dist/assets/{properties-scene.inspector-HjK6QHGg.js → properties-scene.inspector-C-DoN-kL.js} +1 -1
  211. package/dist/assets/{properties-texture.inspector-CckZgUaI.js → properties-texture.inspector-DySxy1oU.js} +1 -1
  212. package/dist/assets/{properties-view-layer.inspector-C1ajtVSk.js → properties-view-layer.inspector-DEKxMahJ.js} +1 -1
  213. package/dist/assets/{properties-world.inspector-BiT_EdT-.js → properties-world.inspector-m5qL_TQV.js} +1 -1
  214. package/dist/assets/r3f-design-session-C0DPEChS.js +2 -0
  215. package/dist/assets/{r3f-physics-binding-DzrbpqjM.js → r3f-physics-binding-Bgzzd4ol.js} +1 -1
  216. package/dist/assets/{r3f-source-authoring-adapter-DbbeRcvt.js → r3f-source-authoring-adapter-C8oMjdTL.js} +2 -2
  217. package/dist/assets/{react-canvas-navigation-Cp3cOHJa.js → react-canvas-navigation-Jowa_lJq.js} +1 -1
  218. package/dist/assets/react-inspector.service-TfTdj_Qk.js +1 -0
  219. package/dist/assets/{react-story-board-GaXqr03H.js → react-story-board-Bx7qYytV.js} +1 -1
  220. package/dist/assets/{react-three-rapier.esm-U8J7g6tH.js → react-three-rapier.esm-BR2ttgLS.js} +1 -1
  221. package/dist/assets/{react-world-authoring-adapter-DOjv2pYm.js → react-world-authoring-adapter-C1jPW_cN.js} +1 -1
  222. package/dist/assets/{realm-services-CnY105XU.js → realm-services-DefTrXnY.js} +1 -1
  223. package/dist/assets/{reflection-probe-capture.inspector-DqSW9p1v.js → reflection-probe-capture.inspector-C-6zrzZb.js} +1 -1
  224. package/dist/assets/{registry-CaCdF63N.js → registry-Z28XSZHF.js} +1 -1
  225. package/dist/assets/{relative-import-specifier-BFKIWEWs.js → relative-import-specifier-DQzkawgj.js} +1 -1
  226. package/dist/assets/{render-env-BkKZ4uMA.js → render-env-BZ7LsGfk.js} +1 -1
  227. package/dist/assets/{render-features-rxbawsRb.js → render-features-C7QwmhCo.js} +1 -1
  228. package/dist/assets/{render-settings-DS5leCed.js → render-settings-BBvkacR3.js} +1 -1
  229. package/dist/assets/{resolve-three-CVnMRHxw.js → resolve-three-C7zDbK29.js} +9 -9
  230. package/dist/assets/{root-seam-contract-CxLZaRio.js → root-seam-contract-rGNbiX6q.js} +1 -1
  231. package/dist/assets/run-selection-BUeubtHj.js +2 -0
  232. package/dist/assets/{scene-capture-0a-bTjT8.js → scene-capture-BTWgUzhI.js} +1 -1
  233. package/dist/assets/{scene-document.service-CeDwVA7t.js → scene-document.service-DJJp-la1.js} +2 -2
  234. package/dist/assets/{scene-framing-BQt72ZCw.js → scene-framing-PVMqGU8h.js} +1 -1
  235. package/dist/assets/{seeded-random-BgCwIAAU.js → seeded-random-38To73fI.js} +1 -1
  236. package/dist/assets/{setup-renderer-Cwkl1Ar6.js → setup-renderer-OOw1SykJ.js} +1 -1
  237. package/dist/assets/{source-object3d-authoring-adapter-DF679Ncb.js → source-object3d-authoring-adapter-RmutT5Dt.js} +1 -1
  238. package/dist/assets/{source-persistence-backend-CwLYVPXj.js → source-persistence-backend-HviqjKZ2.js} +1 -1
  239. package/dist/assets/{stage-keyboard-B8BEW592.js → stage-keyboard-DDi7S27C.js} +1 -1
  240. package/dist/assets/stage-overlay-set-olkNSZmq.js +1 -0
  241. package/dist/assets/{stage-presence-markers-DIP7YMcO.js → stage-presence-markers-cznMN_qq.js} +1 -1
  242. package/dist/assets/stage-transform-tools-BDUZqRIR.js +1 -0
  243. package/dist/assets/{standard-viewport-dressing-BCA51Tum.js → standard-viewport-dressing-BZyuxyVl.js} +1 -1
  244. package/dist/assets/{state-watch.action-DnR5Zjr-.js → state-watch.action-DEdb1mNa.js} +1 -1
  245. package/dist/assets/{state-watch.menu-wYLCLsAw.js → state-watch.menu-jWbUM3kw.js} +1 -1
  246. package/dist/assets/{state-watch.utility-CFG1Tu1m.js → state-watch.utility-DDmn3G25.js} +1 -1
  247. package/dist/assets/{story-capture-BmnwHGDV.js → story-capture-Dj1xkeKH.js} +1 -1
  248. package/dist/assets/{story-documents-BTo90DiA.js → story-documents-8ehMyYHo.js} +2 -2
  249. package/dist/assets/{story-documents.service-yagl1wGp.js → story-documents.service-BzQCuNBu.js} +1 -1
  250. package/dist/assets/{story-documents.service-B6v7Z-WE.js → story-documents.service-iNP-ORNr.js} +1 -1
  251. package/dist/assets/{story-media-presence-BqRMu572.js → story-media-presence-zTPlU9HR.js} +1 -1
  252. package/dist/assets/{story-pixi-preview-Da6afqLg.js → story-pixi-preview-B7THvSl7.js} +1 -1
  253. package/dist/assets/{story-presentation-DMSYRWaz.js → story-presentation-BLXYPadR.js} +1 -1
  254. package/dist/assets/{story-three-preview-R1JvrggS.js → story-three-preview-B1nNiPwP.js} +2 -2
  255. package/dist/assets/{studio-environment-DRxxq_QX.js → studio-environment-yaKaHPxH.js} +1 -1
  256. package/dist/assets/{surface-state-1lTOi8FD.js → surface-state-D9j6qNu8.js} +1 -1
  257. package/dist/assets/{syntactic-prop-specs-eiQXwMIc.js → syntactic-prop-specs-BTnsMOvH.js} +1 -1
  258. package/dist/assets/team-playtest.service-Ds9tkO4q.js +1 -0
  259. package/dist/assets/{three-authoring-adapter-htbnVej2.js → three-authoring-adapter-BrkGH4cd.js} +1 -1
  260. package/dist/assets/three-authoring.service-DoamZDMx.js +2 -0
  261. package/dist/assets/{three-ingest-runtime-B7rtg3QE.js → three-ingest-runtime-CXKjNysA.js} +1 -1
  262. package/dist/assets/{three-integration-BdN5Nhsg.js → three-integration-CuAnYaTW.js} +2 -2
  263. package/dist/assets/three-integration.service-Db-VabIm.js +1 -0
  264. package/dist/assets/{three-TCuY32m_.js → three-oYrcK5SQ.js} +1 -1
  265. package/dist/assets/{three-projection-core-CG01r5Ta.js → three-projection-core-jBJVt6O0.js} +1 -1
  266. package/dist/assets/{three-state-DwFE3ay2.js → three-state-wXRU3rLr.js} +1 -1
  267. package/dist/assets/{three-story-capture.service-CvpV3v5a.js → three-story-capture.service-DMJRcqjr.js} +2 -2
  268. package/dist/assets/{three-story-model-C2r2BuiA.js → three-story-model-DgiAP-oQ.js} +1 -1
  269. package/dist/assets/{three-viewport-presentation-B0z_cECu.js → three-viewport-presentation-CgO3eWJ-.js} +1 -1
  270. package/dist/assets/transform-mode-request-BnKpgRUW.js +1 -0
  271. package/dist/assets/transport-strip-a9yLoPsI.js +1 -0
  272. package/dist/assets/transport.header-CpfoppXc.js +1 -0
  273. package/dist/assets/{tuples-DfWSY2tr.js → tuples-CKsHOV9T.js} +1 -1
  274. package/dist/assets/ui-board-document-DtTR_mBr.js +2 -0
  275. package/dist/assets/{user-data-Bpj7diUS.js → user-data-CqOoAowZ.js} +1 -1
  276. package/dist/assets/{utility-view-state-CAfbFbKQ.js → utility-view-state-Db97zwDz.js} +1 -1
  277. package/dist/assets/{viewport-door-Bj_ZIP85.js → viewport-door-DVkMQazS.js} +1 -1
  278. package/dist/assets/{viewport-root-presentation-vgxsTyj4.js → viewport-root-presentation-B35t51xX.js} +1 -1
  279. package/dist/assets/{viewport-surface-status-cwCiBGa7.js → viewport-surface-status-D5kZtFW5.js} +1 -1
  280. package/dist/assets/{webworkerAll-Cm3gTjWi.js → webworkerAll-CfKEb4Ao.js} +1 -1
  281. package/dist/assets/{workspace-arrangement-BdAlBwvd.js → workspace-arrangement-DIMM7ska.js} +1 -1
  282. package/dist/assets/world-documents-C4t3iOD-.js +1 -0
  283. package/dist/assets/world-root-stage-binding-ydl3JN1a.js +1 -0
  284. package/dist/assets/{xstate-animation-binding-BGLxcZT_.js → xstate-animation-binding-aQEmNSpm.js} +1 -1
  285. package/dist/assets/{xstate-animation-meta-D_T441Ru.js → xstate-animation-meta-CnMX1Sc1.js} +1 -1
  286. package/dist-node/cli.js +29 -24
  287. package/dist-node/create.js +14 -9
  288. package/package.json +18 -16
  289. package/template/.agents/skills/vgai-music/SKILL.md +28 -4
  290. package/template/package.json +13 -11
  291. package/template/src/input.ts +1 -1
  292. package/template/src/main.ts +74 -3
  293. package/dist/assets/CanvasBoardDocument-mxL0oJ3N.js +0 -1
  294. package/dist/assets/CanvasSceneViewport-C_mapCwC.js +0 -1
  295. package/dist/assets/InspectorObjectPreview-W-y079DS.js +0 -1
  296. package/dist/assets/ModelAssetDocument-De1HKuxG.js +0 -1
  297. package/dist/assets/Object3DDocumentToolbar-Cks81kCS.js +0 -1
  298. package/dist/assets/Object3DDocumentViewport-DCwiSY3O.js +0 -2
  299. package/dist/assets/OnlineAssetDetail-CNuwSQRQ.js +0 -1
  300. package/dist/assets/PlayBar-bT8Xdrap.js +0 -1
  301. package/dist/assets/ReactCanvasControls-CnJrPj-B.js +0 -1
  302. package/dist/assets/RootSelectionOverlay-CpaGluQu.js +0 -1
  303. package/dist/assets/ShadowEditor-CVtMlALn.js +0 -1
  304. package/dist/assets/StageHost-B89HKcvd.js +0 -2
  305. package/dist/assets/Toolbar-DkTHnQto.js +0 -1
  306. package/dist/assets/ViewportShadingMenu-CXPi6fl8.js +0 -1
  307. package/dist/assets/adapter-runtime-bindings-4cmsRvRh.js +0 -2
  308. package/dist/assets/autoplay.service-CjPnv3QW.js +0 -1
  309. package/dist/assets/binding-resolver-dE0GnZT5.js +0 -2
  310. package/dist/assets/blender.keymap-_rF_vRX8.js +0 -1
  311. package/dist/assets/bridge.command-BF00Iefm.js +0 -3
  312. package/dist/assets/build-profiles.document-CqNrDdh9.js +0 -2
  313. package/dist/assets/build-session-GZcSAfPN.js +0 -9
  314. package/dist/assets/build.header-Bt1kwHWl.js +0 -1
  315. package/dist/assets/canvas-design-mount-BbLW_Nci.js +0 -6
  316. package/dist/assets/canvas-entry-runtime-UNYuSfG0.js +0 -2
  317. package/dist/assets/component-verbs.service-CnA11bJq.js +0 -1
  318. package/dist/assets/create-runtime-DBfUy0SO.js +0 -3
  319. package/dist/assets/debug-bridge-D3_-EgRE.js +0 -1
  320. package/dist/assets/editor-api-BFTIRlWa.js +0 -1
  321. package/dist/assets/entry-adjudication-Dc18TIqT.js +0 -1
  322. package/dist/assets/fork-menu-DpKqRhF5.js +0 -1
  323. package/dist/assets/game-document.service-Chmt4065.js +0 -1
  324. package/dist/assets/game-eval.command-DRSvOJ_1.js +0 -2
  325. package/dist/assets/game-network-Ct2FQYmu.js +0 -1
  326. package/dist/assets/gameplay.command-Boqv1hnc.js +0 -1
  327. package/dist/assets/generation.service-o9aXlsx4.js +0 -1
  328. package/dist/assets/index-BHoAKyAC.js +0 -1
  329. package/dist/assets/ingest-siblings-BtiEXLnh.js +0 -1
  330. package/dist/assets/instances.command-BwayrqNm.js +0 -1
  331. package/dist/assets/layered-pick-kiQf53t5.js +0 -1
  332. package/dist/assets/model-asset-sections.service-CqSclZGY.js +0 -1
  333. package/dist/assets/module-mode-BH2R93XP.js +0 -2
  334. package/dist/assets/mount-canvas-ingest-root-D1z9i5B3.js +0 -2
  335. package/dist/assets/mount-dom-ingest-root-BAmmNxlm.js +0 -2
  336. package/dist/assets/mount-ingest-root-DYR0TMIt.js +0 -2
  337. package/dist/assets/mount-manifest-DdkFYdVA.js +0 -1
  338. package/dist/assets/network-observer.service-Ce83TdsU.js +0 -1
  339. package/dist/assets/network.utility-DFDul2Xb.js +0 -1
  340. package/dist/assets/pixi-authoring-adapter-BChknIdC.js +0 -1
  341. package/dist/assets/play-mode-DICV4cKP.js +0 -22
  342. package/dist/assets/play.command-NHyi5rzF.js +0 -2
  343. package/dist/assets/presentation-BeNFBfKg.js +0 -1
  344. package/dist/assets/r3f-design-session-B5GsZI5M.js +0 -2
  345. package/dist/assets/react-inspector.service-Bm0OnanU.js +0 -1
  346. package/dist/assets/run-selection-DzEkGesJ.js +0 -2
  347. package/dist/assets/stage-overlay-set-BGE03mqb.js +0 -1
  348. package/dist/assets/stage-transform-tools-BQB7EY4l.js +0 -1
  349. package/dist/assets/team-playtest.service-hLfjgScx.js +0 -1
  350. package/dist/assets/three-authoring.service-BIQAtVdX.js +0 -2
  351. package/dist/assets/three-integration.service-CS8Nvbd2.js +0 -1
  352. package/dist/assets/transform-mode-request-DzD9aUNA.js +0 -1
  353. package/dist/assets/transport-strip-CUjNltnb.js +0 -1
  354. package/dist/assets/transport.header-Bb4FpQ8J.js +0 -1
  355. package/dist/assets/ui-board-document-CCiiXjX9.js +0 -2
  356. package/dist/assets/world-documents-DBybpBq8.js +0 -1
  357. package/dist/assets/world-root-stage-binding-ZVYIgr74.js +0 -1
@@ -1 +1 @@
1
- import{i as e}from"./index-BRJMIUK0.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const p=e()({id:{optional:!1,kind:"value",required:"shape"},mount:{optional:!1,kind:"function",required:"effect"}}),f=e()({drivesOwnLoop:{optional:!1,kind:"value",required:"shape"},updateCadence:{optional:!0,kind:"value",required:"shape"},update:{optional:!0,kind:"function",required:"effect"},fixedUpdate:{optional:!0,kind:"function",required:"effect"},setPaused:{optional:!0,kind:"function",required:"effect"},step:{optional:!0,kind:"function",required:"effect"},resize:{optional:!0,kind:"function",required:"effect"},dispose:{optional:!1,kind:"function",required:"effect"},disposeComplete:{optional:!0,kind:"value",required:"effect"},authoring:{optional:!0,kind:"value",required:"operation"},systems:{optional:!0,kind:"value",required:"operation"},systemScope:{optional:!0,kind:"value",required:"operation"},observe:{optional:!0,kind:"value",required:"effect"}}),s=e()({subscribe:{optional:!1,kind:"function",required:"effect"},snapshot:{optional:!1,kind:"function",required:"operation"}}),c=e()({kind:{optional:!1,kind:"value",required:"shape"},scene:{optional:!1,kind:"value",required:"effect"},camera:{optional:!1,kind:"value",required:"effect"},rendererConfig:{optional:!0,kind:"value",required:"shape"}}),k=e()({kind:{optional:!1,kind:"value",required:"shape"},canvas:{optional:!1,kind:"value",required:"effect"},substrate:{optional:!1,kind:"value",required:"effect"}}),q=e()({kind:{optional:!1,kind:"value",required:"shape"},container:{optional:!1,kind:"value",required:"effect"}});export{k as MOUNTED_CANVAS_SURFACE_SHAPE,q as MOUNTED_DOM_SURFACE_SHAPE,f as MOUNTED_ROOT_BASE_SHAPE,c as MOUNTED_THREE_SURFACE_SHAPE,p as ROOT_ADAPTER_SHAPE,s as ROOT_STATE_OBSERVER_SHAPE};
1
+ import{i as e}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";const p=e()({id:{optional:!1,kind:"value",required:"shape"},mount:{optional:!1,kind:"function",required:"effect"}}),f=e()({drivesOwnLoop:{optional:!1,kind:"value",required:"shape"},updateCadence:{optional:!0,kind:"value",required:"shape"},update:{optional:!0,kind:"function",required:"effect"},fixedUpdate:{optional:!0,kind:"function",required:"effect"},setPaused:{optional:!0,kind:"function",required:"effect"},step:{optional:!0,kind:"function",required:"effect"},resize:{optional:!0,kind:"function",required:"effect"},dispose:{optional:!1,kind:"function",required:"effect"},disposeComplete:{optional:!0,kind:"value",required:"effect"},authoring:{optional:!0,kind:"value",required:"operation"},systems:{optional:!0,kind:"value",required:"operation"},systemScope:{optional:!0,kind:"value",required:"operation"},observe:{optional:!0,kind:"value",required:"effect"}}),s=e()({subscribe:{optional:!1,kind:"function",required:"effect"},snapshot:{optional:!1,kind:"function",required:"operation"}}),c=e()({kind:{optional:!1,kind:"value",required:"shape"},scene:{optional:!1,kind:"value",required:"effect"},camera:{optional:!1,kind:"value",required:"effect"},rendererConfig:{optional:!0,kind:"value",required:"shape"}}),k=e()({kind:{optional:!1,kind:"value",required:"shape"},canvas:{optional:!1,kind:"value",required:"effect"},substrate:{optional:!1,kind:"value",required:"effect"}}),q=e()({kind:{optional:!1,kind:"value",required:"shape"},container:{optional:!1,kind:"value",required:"effect"}});export{k as MOUNTED_CANVAS_SURFACE_SHAPE,q as MOUNTED_DOM_SURFACE_SHAPE,f as MOUNTED_ROOT_BASE_SHAPE,c as MOUNTED_THREE_SURFACE_SHAPE,p as ROOT_ADAPTER_SHAPE,s as ROOT_STATE_OBSERVER_SHAPE};
@@ -0,0 +1,2 @@
1
+ import{q as s}from"./index-CaG87ZF-.js";import{s as l,l as d,a as f}from"./configurations-_HZOWZPy.js";import{s as g}from"./game-network-Bo_nlDR5.js";const a="play",u="runSelection";function p(){return s().projectLocalState.read(u)??null}function y(n){s().projectLocalState.write(u,n)}function m(n,o=p()){return o??n.find(t=>t.role==="run"&&t.kind==="compound"&&t.run?.includes(a))?.id??a}let r=null;async function h(){const n=await d().catch(()=>[]),o=m(n),t=n.find(i=>i.id===o);if(!t||o===a)return{ok:!0,started:null};let e;try{e=await f(t.id)}catch(i){return{ok:!1,title:`Run "${t.id}"`,detail:i instanceof Error?i.message:String(i)}}return e.ready?(t.kind==="compound"&&t.instances!=null&&g(Math.max(0,t.instances-1)),r=t.id,{ok:!0,started:t.id}):{ok:!1,title:`Run "${t.id}" is not ready`,detail:Object.entries(e.logs).map(([i,c])=>`${i}: ${c.slice(-3).join(" | ")||"no output"}`).join(`
2
+ `)}}async function k(){const n=r;r=null,n&&await l(n).catch(o=>s().notify({tone:"error",title:`Stop "${n}"`,detail:o instanceof Error?o.message:String(o)}))}export{a as P,h as a,m as b,p as c,y as d,k as s};
@@ -1 +1 @@
1
- import{s as z,d as N}from"./resolve-three-CVnMRHxw.js";import"./index-BRJMIUK0.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"./capability-coverage-DZ-onC5j.js";import"./game-contract-seams-BnPFGLll.js";import"./json-history-resource-DwS10tqD.js";import"./dom-authoring-adapter-BrLU8IJ_.js";import"./react-world-authoring-adapter-DOjv2pYm.js";import"./board-guides-BEKPgD9M.js";import"./relative-import-specifier-BFKIWEWs.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-Dr4qvDpJ.js";import"./inference-diagnostics-xecGdohW.js";import"./writer-tw6EcuVO.js";import"./debug-registry-P0_YQGWd.js";import"./contract-system-adapters-Bic_7sev.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./three.core-3arARmh6.js";import"./active-ingest-DA426a81.js";import"./ingest-source-persistence-Dmdo-UBp.js";const F=8;function _(l){const d=l,c=typeof d?.type=="string"?d.type:"unknown",w=typeof d?.uuid=="string"?d.uuid:"(no uuid)";return`${c}:${w}`}function q(l){const d=globalThis;if(typeof EventTarget!="function")return()=>{};const c=d.__THREE_DEVTOOLS__===void 0;c&&(d.__THREE_DEVTOOLS__=new EventTarget);const w=d.__THREE_DEVTOOLS__;if(!w)return()=>{};const u=[];function f(p,o,h){const m=p[o];Object.defineProperty(p,o,{configurable:!0,writable:!0,value:h}),u.push(()=>{Object.defineProperty(p,o,{configurable:!0,writable:!0,value:m})})}const n=p=>{const o=p.detail;if(!o||typeof o!="object"||typeof o.render!="function"||!o.domElement||l.alreadyTrapped(o)||l.isHostRenderer(o))return;const h=o.render;f(o,"render",function(...b){return l.observeRender(o,h,b)});const m=o.setAnimationLoop;if(typeof m=="function"){const b=m;f(o,"setAnimationLoop",function(E){return typeof E=="function"&&l.recordLoop(o,E),b.call(o,E)})}};return w.addEventListener("observe",n),()=>{w.removeEventListener("observe",n);for(const p of u.splice(0))p();c&&delete d.__THREE_DEVTOOLS__}}function Re(l,d,c){const u=l.WebGLRenderer.prototype,f=Symbol("vgai.realRender");let n=null,p=0,o=null;const h=new Set;let m=null;const b=[],E=Object.getOwnPropertyDescriptor(u,"render"),S=Symbol("vgai.realSetAnimationLoop"),A=new WeakMap,j=new Set;let v=null;const H=Object.getOwnPropertyDescriptor(u,"setAnimationLoop");function D(){if(!(n||!v||!(v.suspended?.()??v.hidden())))for(const e of j){try{A.get(e)?.(0)}catch{}if(n)return}}Object.defineProperty(u,"setAnimationLoop",{configurable:!0,set(e){this[S]=e},get(){const e=this;return function(t){t&&k(e,t);const i=e[S];return typeof i=="function"?i.call(e,t):void 0}}});function C(e,r,t){const i=m;if(i===null||!n||e!==n.renderer)return r.apply(e,t);i.before();try{return r.apply(e,t)}finally{i.after()}}function W(e,r){return C(e,e[f],r)}function k(e,r){A.set(e,r),j.add(e),queueMicrotask(D)}function V(e,r,t){if(o===null&&(o=c?.declaredScene?.()??null),!(o!==null&&o!==r)){n={scene:r,camera:t,renderer:e},c?.onWorldAdoption?.({phase:"adopted",source:o===null?"measured":"declared",sceneId:_(r),cameraId:_(t)});for(const i of b.splice(0))i(n)}}function I(e,r,t){if(!n||h.size>=F||r===n.scene&&t===n.camera)return;const i=e===n.renderer,a=`${_(r)}|${_(t)}|${i}`;h.has(a)||(h.add(a),c?.onWorldAdoption?.({phase:"alternate",sceneId:_(r),cameraId:_(t),sameRenderer:i,drawCount:p}))}function L(e,r,t){(!n||e===n.renderer)&&p++,c?.isHostRenderer?.(e)!==!0&&r?.isScene&&(n?I(e,r,t):V(e,r,t))}Object.defineProperty(u,"render",{configurable:!0,set(e){this[f]=e},get(){const e=this;return function(...t){const[i,a]=t;return L(e,i,a),W(e,t)}}});const M=new WeakSet,$=q({alreadyTrapped:e=>e[f]!==void 0,isHostRenderer:e=>c?.isHostRenderer?.(e)===!0,observeRender:(e,r,t)=>(M.add(e),L(e,t[0],t[1]),C(e,r,t)),recordLoop:k}),T=[];for(const e of c?.additionalRendererCtors??[]){const t=e?.prototype;if(!t||t===u)continue;const i=t.render;if(typeof i=="function"){t.render=function(...s){L(this,s[0],s[1]);const R=m;if(R===null||!n||this!==n.renderer)return i.apply(this,s);R.before();try{return i.apply(this,s)}finally{R.after()}},T.push(()=>{t.render=i});continue}const a=Object.getOwnPropertyDescriptor(t,"render");Object.defineProperty(t,"render",{configurable:!0,set(s){this[f]=s},get(){const s=this;return function(...y){return L(s,y[0],y[1]),W(s,y)}}}),T.push(()=>{a?Object.defineProperty(t,"render",a):delete t.render})}const P=new Set;let O,g;d&&(O=d.prototype,g=O.render,O.render=function(...r){const t=g?.apply(this,r);return n&&this.renderer===n.renderer&&P.add(this),t});function x(){O&&(g?O.render=g:delete O.render)}return{get captured(){return n},get capturedVia(){return n?M.has(n.renderer)?"devtools-observer":"shared-three":null},getDrawCount(){return p},setRenderPassHooks(e){m=e},getAnimationLoop(e){return A.get(e)??null},resizeComposers(e,r){if(!n||P.size===0)return;const t=n.renderer.getPixelRatio?.();if(t!==void 0)for(const i of P)i.setSize(e,r),i.setPixelRatio(t)},waitForCapture(e){const r=typeof e=="number"?{timeoutMs:e}:e??{},t=r.timeoutMs??1e4;return n?Promise.resolve(n):new Promise((i,a)=>{const s=z({budgetMs:t,...r.visibility!==void 0?{clock:r.visibility}:{},onExpire:()=>{const y=b.indexOf(R);y>=0&&b.splice(y,1),v=null,r.onWait?.(null),a(new Error(`Scene capture timed out after ${t}ms of VISIBLE time (${Math.round(s.elapsedHiddenMs())}ms browser-suspended, which is not counted because no frame can be presented) — no three renderer of ANY instance drew a scene: neither the host's own \`three\` (the shared prototype trap) nor a renderer announcing itself on three's \`__THREE_DEVTOOLS__\` seam, which is what reaches a game that bundles its own copy. The game never rendered.`))}}),R=y=>{s.cancel(),v=null,r.onWait?.(null),i(y)};b.push(R),v=r.visibility??N(),r.onWait?.(s),queueMicrotask(D)})},uninstall(){if(n){const r=n.renderer[f];typeof r=="function"&&Object.defineProperty(n.renderer,"render",{configurable:!0,writable:!0,value:r})}if(E?Object.defineProperty(u,"render",E):delete u.render,n){const r=n.renderer[S];typeof r=="function"&&Object.defineProperty(n.renderer,"setAnimationLoop",{configurable:!0,writable:!0,value:r})}H?Object.defineProperty(u,"setAnimationLoop",H):delete u.setAnimationLoop,x(),$();for(const e of T)e()}}}export{F as MAX_RECORDED_ALTERNATES,Re as installSceneCapture};
1
+ import{s as z,d as N}from"./resolve-three-C7zDbK29.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";import"./capability-coverage-DQgg6UJe.js";import"./game-contract-seams-C0AVYwvO.js";import"./json-history-resource-CTXRV4GD.js";import"./dom-authoring-adapter-CoESNvrM.js";import"./react-world-authoring-adapter-C1jPW_cN.js";import"./board-guides-_3R1t_-2.js";import"./relative-import-specifier-DQzkawgj.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-C8RP8G5F.js";import"./inference-diagnostics-MGcIHEX6.js";import"./writer-tw6EcuVO.js";import"./debug-registry-l7k5Hjc8.js";import"./contract-system-adapters-h6OUBRYA.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./three.core-3arARmh6.js";import"./active-ingest-CnAeQcuQ.js";import"./ingest-source-persistence-6peGfPAS.js";const F=8;function _(l){const d=l,c=typeof d?.type=="string"?d.type:"unknown",w=typeof d?.uuid=="string"?d.uuid:"(no uuid)";return`${c}:${w}`}function q(l){const d=globalThis;if(typeof EventTarget!="function")return()=>{};const c=d.__THREE_DEVTOOLS__===void 0;c&&(d.__THREE_DEVTOOLS__=new EventTarget);const w=d.__THREE_DEVTOOLS__;if(!w)return()=>{};const u=[];function f(p,o,h){const m=p[o];Object.defineProperty(p,o,{configurable:!0,writable:!0,value:h}),u.push(()=>{Object.defineProperty(p,o,{configurable:!0,writable:!0,value:m})})}const n=p=>{const o=p.detail;if(!o||typeof o!="object"||typeof o.render!="function"||!o.domElement||l.alreadyTrapped(o)||l.isHostRenderer(o))return;const h=o.render;f(o,"render",function(...b){return l.observeRender(o,h,b)});const m=o.setAnimationLoop;if(typeof m=="function"){const b=m;f(o,"setAnimationLoop",function(E){return typeof E=="function"&&l.recordLoop(o,E),b.call(o,E)})}};return w.addEventListener("observe",n),()=>{w.removeEventListener("observe",n);for(const p of u.splice(0))p();c&&delete d.__THREE_DEVTOOLS__}}function Re(l,d,c){const u=l.WebGLRenderer.prototype,f=Symbol("vgai.realRender");let n=null,p=0,o=null;const h=new Set;let m=null;const b=[],E=Object.getOwnPropertyDescriptor(u,"render"),S=Symbol("vgai.realSetAnimationLoop"),A=new WeakMap,j=new Set;let v=null;const H=Object.getOwnPropertyDescriptor(u,"setAnimationLoop");function D(){if(!(n||!v||!(v.suspended?.()??v.hidden())))for(const e of j){try{A.get(e)?.(0)}catch{}if(n)return}}Object.defineProperty(u,"setAnimationLoop",{configurable:!0,set(e){this[S]=e},get(){const e=this;return function(t){t&&k(e,t);const i=e[S];return typeof i=="function"?i.call(e,t):void 0}}});function C(e,r,t){const i=m;if(i===null||!n||e!==n.renderer)return r.apply(e,t);i.before();try{return r.apply(e,t)}finally{i.after()}}function W(e,r){return C(e,e[f],r)}function k(e,r){A.set(e,r),j.add(e),queueMicrotask(D)}function V(e,r,t){if(o===null&&(o=c?.declaredScene?.()??null),!(o!==null&&o!==r)){n={scene:r,camera:t,renderer:e},c?.onWorldAdoption?.({phase:"adopted",source:o===null?"measured":"declared",sceneId:_(r),cameraId:_(t)});for(const i of b.splice(0))i(n)}}function I(e,r,t){if(!n||h.size>=F||r===n.scene&&t===n.camera)return;const i=e===n.renderer,a=`${_(r)}|${_(t)}|${i}`;h.has(a)||(h.add(a),c?.onWorldAdoption?.({phase:"alternate",sceneId:_(r),cameraId:_(t),sameRenderer:i,drawCount:p}))}function L(e,r,t){(!n||e===n.renderer)&&p++,c?.isHostRenderer?.(e)!==!0&&r?.isScene&&(n?I(e,r,t):V(e,r,t))}Object.defineProperty(u,"render",{configurable:!0,set(e){this[f]=e},get(){const e=this;return function(...t){const[i,a]=t;return L(e,i,a),W(e,t)}}});const M=new WeakSet,$=q({alreadyTrapped:e=>e[f]!==void 0,isHostRenderer:e=>c?.isHostRenderer?.(e)===!0,observeRender:(e,r,t)=>(M.add(e),L(e,t[0],t[1]),C(e,r,t)),recordLoop:k}),T=[];for(const e of c?.additionalRendererCtors??[]){const t=e?.prototype;if(!t||t===u)continue;const i=t.render;if(typeof i=="function"){t.render=function(...s){L(this,s[0],s[1]);const R=m;if(R===null||!n||this!==n.renderer)return i.apply(this,s);R.before();try{return i.apply(this,s)}finally{R.after()}},T.push(()=>{t.render=i});continue}const a=Object.getOwnPropertyDescriptor(t,"render");Object.defineProperty(t,"render",{configurable:!0,set(s){this[f]=s},get(){const s=this;return function(...y){return L(s,y[0],y[1]),W(s,y)}}}),T.push(()=>{a?Object.defineProperty(t,"render",a):delete t.render})}const P=new Set;let O,g;d&&(O=d.prototype,g=O.render,O.render=function(...r){const t=g?.apply(this,r);return n&&this.renderer===n.renderer&&P.add(this),t});function x(){O&&(g?O.render=g:delete O.render)}return{get captured(){return n},get capturedVia(){return n?M.has(n.renderer)?"devtools-observer":"shared-three":null},getDrawCount(){return p},setRenderPassHooks(e){m=e},getAnimationLoop(e){return A.get(e)??null},resizeComposers(e,r){if(!n||P.size===0)return;const t=n.renderer.getPixelRatio?.();if(t!==void 0)for(const i of P)i.setSize(e,r),i.setPixelRatio(t)},waitForCapture(e){const r=typeof e=="number"?{timeoutMs:e}:e??{},t=r.timeoutMs??1e4;return n?Promise.resolve(n):new Promise((i,a)=>{const s=z({budgetMs:t,...r.visibility!==void 0?{clock:r.visibility}:{},onExpire:()=>{const y=b.indexOf(R);y>=0&&b.splice(y,1),v=null,r.onWait?.(null),a(new Error(`Scene capture timed out after ${t}ms of VISIBLE time (${Math.round(s.elapsedHiddenMs())}ms browser-suspended, which is not counted because no frame can be presented) — no three renderer of ANY instance drew a scene: neither the host's own \`three\` (the shared prototype trap) nor a renderer announcing itself on three's \`__THREE_DEVTOOLS__\` seam, which is what reaches a game that bundles its own copy. The game never rendered.`))}}),R=y=>{s.cancel(),v=null,r.onWait?.(null),i(y)};b.push(R),v=r.visibility??N(),r.onWait?.(s),queueMicrotask(D)})},uninstall(){if(n){const r=n.renderer[f];typeof r=="function"&&Object.defineProperty(n.renderer,"render",{configurable:!0,writable:!0,value:r})}if(E?Object.defineProperty(u,"render",E):delete u.render,n){const r=n.renderer[S];typeof r=="function"&&Object.defineProperty(n.renderer,"setAnimationLoop",{configurable:!0,writable:!0,value:r})}H?Object.defineProperty(u,"setAnimationLoop",H):delete u.setAnimationLoop,x(),$();for(const e of T)e()}}}export{F as MAX_RECORDED_ALTERNATES,Re as installSceneCapture};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreeIsolationSceneContent-DbYIylZQ.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-BRJMIUK0.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-0Lm0Nf1M.css","assets/document-preview-three-DThkjI1S.js","assets/content-bounds-BeuIXKYu.js","assets/hierarchy-marks-Cc_3lxw6.js","assets/workspace-arrangement-BdAlBwvd.js","assets/three.core-3arARmh6.js","assets/editor-layers-BDJnAAzj.js","assets/renderer-ownership-BovSEcLv.js","assets/three.module-BLhyNg0e.js","assets/scene-framing-BQt72ZCw.js","assets/mounted-story-viewport-source-B4-eAYGI.js","assets/story-three-preview-R1JvrggS.js","assets/asset-preview-B1tDziF1.js","assets/studio-environment-DRxxq_QX.js","assets/user-data-Bpj7diUS.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/crash-null-boundary-v3a0uEgw.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/index-bQE2NA0D.js","assets/story-mount-turn-DFRTj5hi.js","assets/Object3DDocumentViewport-DCwiSY3O.js","assets/viewport-surface-status-cwCiBGa7.js","assets/world-root-stage-binding-ZVYIgr74.js","assets/object3d-document-session-registry-DJDEDM0p.js","assets/RootSelectionOverlay-CpaGluQu.js","assets/eyedropper-session-bjPXnfeX.js","assets/layered-pick-kiQf53t5.js","assets/root-stacking-BEd9ZvxC.js","assets/react-story-board-GaXqr03H.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/inspect-Dr4qvDpJ.js","assets/inference-diagnostics-xecGdohW.js","assets/surface-state-1lTOi8FD.js","assets/surface-content-Dg9Kkazf.js","assets/camera-authoring-DYjhU5Zp.js","assets/performance-profiler-OwnXQX0M.js","assets/renderer-config-CaPR4dB_.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/loader-BTUKnX5Q.js","assets/render-settings-DS5leCed.js","assets/render-features-rxbawsRb.js","assets/soft-particle-depth-DNGwWJ8c.js","assets/viewport-shading-D9BMDb1N.js","assets/matcap-texture-Dm2c-VQa.js","assets/setup-renderer-Cwkl1Ar6.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/design-time-mount-registry-DUpXCg1U.js","assets/project-authoring-session-C3eusefK.js","assets/edit-mode-authoring-DeCxPcHM.js","assets/three-integration-BdN5Nhsg.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/preview-renderer-BrYNFV1p.js","assets/model-thumbnail-BEKPWg4l.js","assets/three-state-DwFE3ay2.js","assets/editor-shell-store-ChLcVeNB.js","assets/output-pass-HurwNl0G.js","assets/Pass-D1MRT672.js","assets/entity-object-JmYMfLsx.js","assets/three-contract-Dkt6PmWY.js","assets/component-instance-root-B0C5oNEm.js","assets/viewport-door-Bj_ZIP85.js","assets/canvas-preview-frames-C0QTagA3.js","assets/index-SS9EugVg.js","assets/editor-presentation-activity-C7SNSmTd.js","assets/three-viewport-presentation-B0z_cECu.js","assets/standard-viewport-dressing-BCA51Tum.js","assets/clip-planes-CnAI6DZn.js","assets/three-TCuY32m_.js","assets/model-inspection-CXHxrafK.js","assets/OrbitControls-B13MKuwC.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/live-gesture-lock-DJbrjOqf.js","assets/live-mixers-B-bwLZ7c.js","assets/viewport-root-presentation-vgxsTyj4.js","assets/mounted-authoring-Clftxx0x.js","assets/asset-editor-persistence-BGWIqZdk.js","assets/stage-presence-markers-DIP7YMcO.js","assets/collaboration-presence-BVIQuN1l.js"])))=>i.map(i=>d[i]);
2
- import{F as m,aC as c,au as g,E as h,eI as T,G as y,dy as b,eJ as R,eK as f,w as S,cw as w,eL as P,eM as E,_ as v,M as D,ad as u,Z as _,eN as N}from"./index-BRJMIUK0.js";import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{O as x}from"./Object3DDocumentViewport-DCwiSY3O.js";import{r as p}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{s as C}from"./after-paint-CB4bz1-e.js";import{o as k}from"./three-state-DwFE3ay2.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./viewport-surface-status-cwCiBGa7.js";import"./editor-shell-store-ChLcVeNB.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-BDJnAAzj.js";import"./workspace-arrangement-BdAlBwvd.js";import"./user-data-Bpj7diUS.js";import"./entity-object-JmYMfLsx.js";import"./three-contract-Dkt6PmWY.js";const d="Scene";function A(e){const t=()=>{const r=h()?.scenes,n=(r?y(r).find(l=>l.plan.kind==="root-document"):void 0)?.entry.source,i=n?.path??e.sourcePath??e.savePath;return i?{path:i,...n?.export===void 0?{}:{exportName:n.export}}:null};return{revision:()=>{const r=t();return r?`${r.path}:${r.exportName??"default"}`:"unavailable"},subscribe:r=>{let o=JSON.stringify(t());const n=()=>{const a=JSON.stringify(t());a!==o&&(o=a,r())},i=e.subscribe(n),l=m(n);return()=>{i(),l()}},capture:async r=>{const o=t();if(!o)throw new Error("The Scene has no declared source module to preview.");return(await v(()=>import("./ThreeIsolationSceneContent-DbYIylZQ.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]))).captureThreeIsolationScenePreview({path:o.path,exportName:o.exportName,label:d},r)}}}const I=/creating WebGL context/i,j=/null \(reading 'precision'\)/;function V(e){return I.test(e.message)||j.test(e.message)}const O=3;class M extends p.Component{state={error:null,autoRetryPending:!1};autoRetryCount=0;retryTimer=null;static getDerivedStateFromError(t){return{error:t,autoRetryPending:!1}}clearPendingRetry(){this.retryTimer!==null&&(window.clearTimeout(this.retryTimer),this.retryTimer=null)}componentDidCatch(t,r){if(D.error(`Viewport failed to start: ${t.message}`,"editor"),console.error("[vgai] Viewport failed to start",t,r.componentStack),V(t)&&this.autoRetryCount<O){this.clearPendingRetry();const o=500*2**this.autoRetryCount;this.autoRetryCount++,this.retryTimer=window.setTimeout(()=>{this.retryTimer=null,this.setState({error:null,autoRetryPending:!1})},o),this.setState({autoRetryPending:!0})}}componentWillUnmount(){this.clearPendingRetry()}handleManualRetry=()=>{this.clearPendingRetry(),this.setState({error:null,autoRetryPending:!1})};render(){if(!this.state.error)return this.props.children;const t=this.state.autoRetryPending;return s.jsxs("div",{"data-testid":"viewport-startup-error",role:"alert",style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:24,background:u.surface.shell,color:u.content.muted,textAlign:"center"},children:[s.jsx("div",{style:{color:u.content.primary,fontSize:14},children:t?"Viewport unavailable — retrying…":"Viewport unavailable"}),s.jsx("div",{style:{maxWidth:520,color:u.content.dim,fontSize:11},children:this.state.error.message}),s.jsx(_,{type:"button",className:"vgai-btn","data-testid":"retry-viewport",onClick:this.handleManualRetry,children:"Retry Viewport"})]})}}const W={kind:"world-root",load:()=>v(()=>import("./world-root-stage-binding-ZVYIgr74.js"),__vite__mapDeps([39,1,2,16,14,3,4,5,6,7,8,9,10,40,41,42,43,44,45,46,47,48,49,50,51,52,17,53,54,55,56,25,18,15,26,27,57,58,59,60,61,62,63,64,65,66,67,68,69,70,28,29,30,31,24,71,23,72,73,74,75,76,77,13,78,79,12,22,32,80,81,82,83,84,85,86,87,88,89,90,91,19,92,93,94,95,96,97])).then(e=>e.worldRootStageBinding)};function L({documentId:e,active:t}){const[r,o]=p.useState(!1);return p.useEffect(()=>C(()=>o(!0)),[]),s.jsx(M,{children:r?s.jsx(x,{documentId:e,active:t,content:W,displayName:d}):null})}function U(e){const t=e.sourcePath??e.savePath;return{scene:{id:c,title:d,kind:"scene",workspaceRole:"authored-subject",...t?{provenance:{sourcePath:t}}:{},Content:L,preview:A(e),presentation:()=>e.savePath?{kind:"scene",path:e.savePath}:{kind:"workspace",id:c}}}}function F(e,t,r=!0){const o=h()?.scenes;if(r&&!(o&&T(o))){const n=o?y(o).find(i=>i.plan.kind==="root-document"):void 0;b({...t.scene,title:n?.plan.kind==="root-document"?n.plan.title:t.scene.title,provenance:{...t.scene.provenance,...n?.entry.source?.path?{sourcePath:n.entry.source.path}:{},...n?.plan.kind==="root-document"?{rootId:n.plan.regionId}:{}}},{category:"scene",rootId:n?.plan.kind==="root-document"?n.plan.regionId:void 0,default:o!==void 0&&(n?.isDefault??o.entries.length===0)}),R(c,e.isDirty)}else f(c);r&&S()===null&&w(c)}function B(e){let t=null;const r={subscribe:a=>e.shell.subscribe(a),get playState(){return e.shell.playState},get activeViewportTab(){return e.shell.activeViewportTab},get savePath(){return E(e.shell)},get sourcePath(){const a=P(e.shell);return a&&(t=a),t},get isDirty(){return N(e.shell)==="unsaved"}},o=U(r),n=()=>F(r,o,g()?.config.hasThreeRoot!==!1);n();const i=e.shell.subscribe(n),l=m(n);return()=>{i(),l()}}const de="workspace.service";function me(){let e=null;const t=k(r=>{e?.(),e=B(r)});return()=>{t(),e?.(),e=null,f(c)}}export{de as point,me as start};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreeIsolationSceneContent-BAKurKW5.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-CaG87ZF-.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-B5WjeCHm.css","assets/document-preview-three-5cbuuJMH.js","assets/content-bounds-DKBD7nsv.js","assets/hierarchy-marks-C25dY2fR.js","assets/workspace-arrangement-DIMM7ska.js","assets/three.core-3arARmh6.js","assets/editor-layers-B4oYfpj8.js","assets/renderer-ownership-BovSEcLv.js","assets/three.module-BLhyNg0e.js","assets/scene-framing-PVMqGU8h.js","assets/mounted-story-viewport-source-CnYhX3vW.js","assets/story-three-preview-B1nNiPwP.js","assets/asset-preview-Cv7tfD98.js","assets/studio-environment-yaKaHPxH.js","assets/user-data-CqOoAowZ.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/crash-null-boundary-v3a0uEgw.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/index-bQE2NA0D.js","assets/story-mount-turn-DFRTj5hi.js","assets/Object3DDocumentViewport-BaXWtATg.js","assets/viewport-surface-status-D5kZtFW5.js","assets/world-root-stage-binding-ydl3JN1a.js","assets/object3d-document-session-registry-OjqzJ86S.js","assets/RootSelectionOverlay-BQC12Gdd.js","assets/eyedropper-session-bjPXnfeX.js","assets/layered-pick-B_-BRrRD.js","assets/root-stacking-BEd9ZvxC.js","assets/react-story-board-Bx7qYytV.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/inspect-C8RP8G5F.js","assets/inference-diagnostics-MGcIHEX6.js","assets/surface-state-D9j6qNu8.js","assets/surface-content-Dg9Kkazf.js","assets/camera-authoring-DYjhU5Zp.js","assets/performance-profiler-OwnXQX0M.js","assets/renderer-config-CaPR4dB_.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/loader-BTUKnX5Q.js","assets/render-settings-BBvkacR3.js","assets/render-features-C7QwmhCo.js","assets/soft-particle-depth-DNGwWJ8c.js","assets/viewport-shading-D9BMDb1N.js","assets/matcap-texture-Dm2c-VQa.js","assets/setup-renderer-OOw1SykJ.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/design-time-mount-registry-DUpXCg1U.js","assets/project-authoring-session-LCJAwGrD.js","assets/edit-mode-authoring-DBjaBTxM.js","assets/three-integration-CuAnYaTW.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/preview-renderer-BrYNFV1p.js","assets/model-thumbnail-uk-2sblh.js","assets/three-state-wXRU3rLr.js","assets/editor-shell-store-Bh1S7M54.js","assets/output-pass-HurwNl0G.js","assets/Pass-D1MRT672.js","assets/entity-object-B_5Gc0Ky.js","assets/three-contract-Dkt6PmWY.js","assets/component-instance-root-df4ofoOR.js","assets/viewport-door-DVkMQazS.js","assets/canvas-preview-frames-B5xFRjhQ.js","assets/index-C20Flc1s.js","assets/editor-presentation-activity-C7SNSmTd.js","assets/three-viewport-presentation-CgO3eWJ-.js","assets/standard-viewport-dressing-BZyuxyVl.js","assets/clip-planes-CnAI6DZn.js","assets/three-oYrcK5SQ.js","assets/model-inspection-MrJY0U_-.js","assets/OrbitControls-B13MKuwC.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/live-gesture-lock-DJbrjOqf.js","assets/live-mixers-B-bwLZ7c.js","assets/viewport-root-presentation-B35t51xX.js","assets/mounted-authoring-B7RL_V28.js","assets/asset-editor-persistence-BQgjOCrm.js","assets/stage-presence-markers-cznMN_qq.js","assets/collaboration-presence-BOS1t8wI.js"])))=>i.map(i=>d[i]);
2
+ import{E as m,aD as c,av as g,B as h,ey as T,F as y,dl as b,ez as R,eA as v,w as S,cx as w,eB as P,eC as E,_ as f,M as D,ae as u,$ as _,eD as x}from"./index-CaG87ZF-.js";import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import{O as N}from"./Object3DDocumentViewport-BaXWtATg.js";import{r as p}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{s as C}from"./after-paint-CB4bz1-e.js";import{o as k}from"./three-state-wXRU3rLr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./viewport-surface-status-D5kZtFW5.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";const d="Scene";function A(e){const t=()=>{const r=h()?.scenes,n=(r?y(r).find(l=>l.plan.kind==="root-document"):void 0)?.entry.source,i=n?.path??e.sourcePath??e.savePath;return i?{path:i,...n?.export===void 0?{}:{exportName:n.export}}:null};return{revision:()=>{const r=t();return r?`${r.path}:${r.exportName??"default"}`:"unavailable"},subscribe:r=>{let o=JSON.stringify(t());const n=()=>{const a=JSON.stringify(t());a!==o&&(o=a,r())},i=e.subscribe(n),l=m(n);return()=>{i(),l()}},capture:async r=>{const o=t();if(!o)throw new Error("The Scene has no declared source module to preview.");return(await f(()=>import("./ThreeIsolationSceneContent-BAKurKW5.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]))).captureThreeIsolationScenePreview({path:o.path,exportName:o.exportName,label:d},r)}}}const I=/creating WebGL context/i,j=/null \(reading 'precision'\)/;function V(e){return I.test(e.message)||j.test(e.message)}const O=3;class W extends p.Component{state={error:null,autoRetryPending:!1};autoRetryCount=0;retryTimer=null;static getDerivedStateFromError(t){return{error:t,autoRetryPending:!1}}clearPendingRetry(){this.retryTimer!==null&&(window.clearTimeout(this.retryTimer),this.retryTimer=null)}componentDidCatch(t,r){if(D.error(`Viewport failed to start: ${t.message}`,"editor"),console.error("[vgai] Viewport failed to start",t,r.componentStack),V(t)&&this.autoRetryCount<O){this.clearPendingRetry();const o=500*2**this.autoRetryCount;this.autoRetryCount++,this.retryTimer=window.setTimeout(()=>{this.retryTimer=null,this.setState({error:null,autoRetryPending:!1})},o),this.setState({autoRetryPending:!0})}}componentWillUnmount(){this.clearPendingRetry()}handleManualRetry=()=>{this.clearPendingRetry(),this.setState({error:null,autoRetryPending:!1})};render(){if(!this.state.error)return this.props.children;const t=this.state.autoRetryPending;return s.jsxs("div",{"data-testid":"viewport-startup-error",role:"alert",style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:24,background:u.surface.shell,color:u.content.muted,textAlign:"center"},children:[s.jsx("div",{style:{color:u.content.primary,fontSize:14},children:t?"Viewport unavailable — retrying…":"Viewport unavailable"}),s.jsx("div",{style:{maxWidth:520,color:u.content.dim,fontSize:11},children:this.state.error.message}),s.jsx(_,{type:"button",className:"vgai-btn","data-testid":"retry-viewport",onClick:this.handleManualRetry,children:"Retry Viewport"})]})}}const M={kind:"world-root",load:()=>f(()=>import("./world-root-stage-binding-ydl3JN1a.js"),__vite__mapDeps([39,1,2,16,14,3,4,5,6,7,8,9,10,40,41,42,43,44,45,46,47,48,49,50,51,52,17,53,54,55,56,25,18,15,26,27,57,58,59,60,61,62,63,64,65,66,67,68,69,70,28,29,30,31,24,71,23,72,73,74,75,76,77,13,78,79,12,22,32,80,81,82,83,84,85,86,87,88,89,90,91,19,92,93,94,95,96,97])).then(e=>e.worldRootStageBinding)};function U({documentId:e,active:t}){const[r,o]=p.useState(!1);return p.useEffect(()=>C(()=>o(!0)),[]),s.jsx(W,{children:r?s.jsx(N,{documentId:e,active:t,content:M,displayName:d}):null})}function B(e){const t=e.sourcePath??e.savePath;return{scene:{id:c,title:d,kind:"scene",workspaceRole:"authored-subject",...t?{provenance:{sourcePath:t}}:{},Content:U,preview:A(e),presentation:()=>e.savePath?{kind:"scene",path:e.savePath}:{kind:"workspace",id:c}}}}function F(e,t,r=!0){const o=h()?.scenes;if(r&&!(o&&T(o))){const n=o?y(o).find(i=>i.plan.kind==="root-document"):void 0;b({...t.scene,title:n?.plan.kind==="root-document"?n.plan.title:t.scene.title,provenance:{...t.scene.provenance,...n?.entry.source?.path?{sourcePath:n.entry.source.path}:{},...n?.plan.kind==="root-document"?{rootId:n.plan.regionId}:{}}},{category:"scene",rootId:n?.plan.kind==="root-document"?n.plan.regionId:void 0,default:o!==void 0&&(n?.isDefault??o.entries.length===0)}),R(c,e.isDirty)}else v(c);r&&S()===null&&w(c)}function L(e){let t=null;const r={subscribe:a=>e.shell.subscribe(a),get playState(){return e.shell.playState},get activeViewportTab(){return e.shell.activeViewportTab},get savePath(){return E(e.shell)},get sourcePath(){const a=P(e.shell);return a&&(t=a),t},get isDirty(){return x(e.shell)==="unsaved"}},o=B(r),n=()=>F(r,o,g()?.config.hasThreeRoot!==!1);n();const i=e.shell.subscribe(n),l=m(n);return()=>{i(),l()}}const de="workspace.service";function me(){let e=null;const t=k(r=>{e?.(),e=L(r)});return()=>{t(),e?.(),e=null,v(c)}}export{de as point,me as start};
@@ -1 +1 @@
1
- import{isEditorOwnedObject as w}from"./editor-layers-BDJnAAzj.js";import{fo as d,ex as O,fd as x,e6 as F,I as C}from"./three.core-3arARmh6.js";const E={maxOutlierFraction:.1,minGapFraction:.2,minSampleSize:8,maxPasses:8},_=10,I=.01,v=["x","y","z"];function p(r,t){const e=new C;for(const n of t)e.union(r[n]);return e}function N(r,t,e){let n=null;for(const a of v)for(const s of["min","max"]){const i=[];for(const o of t)i.push({i:o,v:r[o][s][a]});i.sort((o,l)=>s==="min"?o.v-l.v:l.v-o.v);const c=Math.min(e,i.length-1);for(let o=0;o<c;o++){const l=Math.abs(i[o+1].v-i[o].v);n&&l<=n.gap||(n={gap:l,discard:i.slice(0,o+1).map(f=>f.i)})}}return n}function P(r,t={}){const e={...E,...t},n=r.filter(f=>!f.isEmpty()),a=n.map((f,u)=>u),s=p(n,a);if(n.length<e.minSampleSize)return s;let i=Math.floor(n.length*e.maxOutlierFraction);if(i<1)return s;const c=new Set(a);let o=s;const l=new d;for(let f=0;f<e.maxPasses&&i>0;f++){const u=o.getSize(l).length();if(!(u>0))break;const m=N(n,c,i);if(!m||m.gap<=e.minGapFraction*u)break;for(const b of m.discard)c.delete(b);i-=m.discard.length,o=p(n,c)}return o.isEmpty()?s:o}function k(r,t){const e=r.getWorldDirection(new d),n=new d().setFromMatrixPosition(r.matrixWorld);if(!Number.isFinite(n.lengthSq())||e.lengthSq()===0)return null;if(t.isEmpty())return{position:n,target:n.clone().addScaledVector(e,_)};const a=t.getBoundingSphere(new O),s=a.center.clone().sub(n).dot(e);return s>a.radius*I?{position:n,target:n.clone().addScaledVector(e,s)}:null}const T=[[0,0],[-.6,.6],[.6,.6],[-.6,-.6],[.6,-.6],[0,.6],[0,-.6],[-.6,0],[.6,0]],A=.02,h=new F,g=new x;function V(r){for(let t=r;t;t=t.parent)if(!t.visible)return!1;return!0}function z(r,t,e){if(!(e>0)||t.length===0)return!0;const n=e*A;for(const[a,s]of T){g.set(a,s),h.setFromCamera(g,r);const c=h.intersectObjects(t,!0).find(o=>V(o.object));if(!c||c.distance>n)return!0}return!1}function S(r,t=[]){if(w(r))return t;r.isCamera&&t.push(r);for(const e of r.children)S(e,t);return t}function G(r,t){const e=S(t);return e.length===0?null:r&&e.includes(r)?r:e[0]}export{P as f,G as p,z as s,k as v};
1
+ import{isEditorOwnedObject as w}from"./editor-layers-B4oYfpj8.js";import{fo as d,ex as O,fd as x,e6 as F,I as C}from"./three.core-3arARmh6.js";const E={maxOutlierFraction:.1,minGapFraction:.2,minSampleSize:8,maxPasses:8},_=10,I=.01,v=["x","y","z"];function p(r,t){const e=new C;for(const n of t)e.union(r[n]);return e}function N(r,t,e){let n=null;for(const a of v)for(const s of["min","max"]){const i=[];for(const o of t)i.push({i:o,v:r[o][s][a]});i.sort((o,l)=>s==="min"?o.v-l.v:l.v-o.v);const c=Math.min(e,i.length-1);for(let o=0;o<c;o++){const l=Math.abs(i[o+1].v-i[o].v);n&&l<=n.gap||(n={gap:l,discard:i.slice(0,o+1).map(f=>f.i)})}}return n}function P(r,t={}){const e={...E,...t},n=r.filter(f=>!f.isEmpty()),a=n.map((f,u)=>u),s=p(n,a);if(n.length<e.minSampleSize)return s;let i=Math.floor(n.length*e.maxOutlierFraction);if(i<1)return s;const c=new Set(a);let o=s;const l=new d;for(let f=0;f<e.maxPasses&&i>0;f++){const u=o.getSize(l).length();if(!(u>0))break;const m=N(n,c,i);if(!m||m.gap<=e.minGapFraction*u)break;for(const b of m.discard)c.delete(b);i-=m.discard.length,o=p(n,c)}return o.isEmpty()?s:o}function k(r,t){const e=r.getWorldDirection(new d),n=new d().setFromMatrixPosition(r.matrixWorld);if(!Number.isFinite(n.lengthSq())||e.lengthSq()===0)return null;if(t.isEmpty())return{position:n,target:n.clone().addScaledVector(e,_)};const a=t.getBoundingSphere(new O),s=a.center.clone().sub(n).dot(e);return s>a.radius*I?{position:n,target:n.clone().addScaledVector(e,s)}:null}const T=[[0,0],[-.6,.6],[.6,.6],[-.6,-.6],[.6,-.6],[0,.6],[0,-.6],[-.6,0],[.6,0]],A=.02,h=new F,g=new x;function V(r){for(let t=r;t;t=t.parent)if(!t.visible)return!1;return!0}function z(r,t,e){if(!(e>0)||t.length===0)return!0;const n=e*A;for(const[a,s]of T){g.set(a,s),h.setFromCamera(g,r);const c=h.intersectObjects(t,!0).find(o=>V(o.object));if(!c||c.distance>n)return!0}return!1}function S(r,t=[]){if(w(r))return t;r.isCamera&&t.push(r);for(const e of r.children)S(e,t);return t}function G(r,t){const e=S(t);return e.length===0?null:r&&e.includes(r)?r:e[0]}export{P as f,G as p,z as s,k as v};
@@ -1 +1 @@
1
- import{c as f}from"./debug-registry-P0_YQGWd.js";function E(t,e){if(!Number.isFinite(t)||!Number.isFinite(e)||e<=0||t<=0)return 0;const a=t/e;return a>=1?1:a}const m={min:0,max:8};function M(t){return Number.isFinite(t)?Math.min(m.max,Math.max(m.min,t)):m.min}function R(t,e,a,n){const{fixedDt:i,maxSubSteps:c}=n,s=i*c,o=Math.min(e,s)*a;let r=t+o;r>s&&(r=s);let u=0;for(;r>=i&&u<c;)r-=i,u++;return{steps:u,accumulator:r,alpha:E(r,i),displayDt:o}}function l(t){let e=t>>>0;return function(){e=e+1831565813|0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}const b="vgai-render",h="vgai-seed",g="gameplay",A=2654435769;function p(t){let e=2166136261;for(let a=0;a<t.length;a++)e^=t.charCodeAt(a),e=Math.imul(e,16777619);return e>>>0}function _(t){let e=t>>>0;const a=new Map;function n(o){return(p(o)^e)>>>0}function i(o){let r=a.get(o);return r||(r={gen:l(n(o))},a.set(o,r)),r}function c(o){const r=i(o);return()=>r.gen()}const s=(()=>i(g).gen());return Object.defineProperties(s,{stream:{value:c,enumerable:!0},reseed:{value:o=>{e=o>>>0;for(const[r,u]of a)u.gen=l(n(r))},enumerable:!0},seed:{get:()=>e,enumerable:!0}}),s}const d=f("seeded-random");function x(t,e){d.set(t,e)}function D(t){return d.get(t)??null}export{A as D,h as R,m as T,_ as a,b,M as c,D as g,R as p,x as r};
1
+ import{c as f}from"./debug-registry-l7k5Hjc8.js";function E(t,e){if(!Number.isFinite(t)||!Number.isFinite(e)||e<=0||t<=0)return 0;const a=t/e;return a>=1?1:a}const m={min:0,max:8};function M(t){return Number.isFinite(t)?Math.min(m.max,Math.max(m.min,t)):m.min}function R(t,e,a,n){const{fixedDt:i,maxSubSteps:c}=n,s=i*c,o=Math.min(e,s)*a;let r=t+o;r>s&&(r=s);let u=0;for(;r>=i&&u<c;)r-=i,u++;return{steps:u,accumulator:r,alpha:E(r,i),displayDt:o}}function l(t){let e=t>>>0;return function(){e=e+1831565813|0;let n=e;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}const b="vgai-render",h="vgai-seed",g="gameplay",A=2654435769;function p(t){let e=2166136261;for(let a=0;a<t.length;a++)e^=t.charCodeAt(a),e=Math.imul(e,16777619);return e>>>0}function _(t){let e=t>>>0;const a=new Map;function n(o){return(p(o)^e)>>>0}function i(o){let r=a.get(o);return r||(r={gen:l(n(o))},a.set(o,r)),r}function c(o){const r=i(o);return()=>r.gen()}const s=(()=>i(g).gen());return Object.defineProperties(s,{stream:{value:c,enumerable:!0},reseed:{value:o=>{e=o>>>0;for(const[r,u]of a)u.gen=l(n(r))},enumerable:!0},seed:{get:()=>e,enumerable:!0}}),s}const d=f("seeded-random");function x(t,e){d.set(t,e)}function D(t){return d.get(t)??null}export{A as D,h as R,m as T,_ as a,b,M as c,D as g,R as p,x as r};
@@ -1,4 +1,4 @@
1
- import{S as O,a as q,W as st}from"./three.module-BLhyNg0e.js";import{Pass as H,Effect as ue,Selection as ot,RenderPass as re,NormalPass as We,EffectPass as nt,SMAAPreset as ie,SMAAEffect as lt,SSAOEffect as ct,BloomEffect as ut,DepthOfFieldEffect as ft,TiltShiftEffect as dt,GodRaysEffect as ht,OutlineEffect as pt,ChromaticAberrationEffect as mt,LensDistortionEffect as vt,ShockWaveEffect as gt,BrightnessContrastEffect as xt,HueSaturationEffect as Tt,SepiaEffect as St,ColorDepthEffect as bt,NoiseEffect as Dt,ScanlineEffect as yt,DotScreenEffect as wt,GridEffect as Mt,PixelationEffect as Pt,GlitchEffect as Rt,VignetteEffect as Ct}from"./index-DHhMOs_s.js";import{_ as N,cm as h,em as C,fx as z,dw as B,c1 as x,bi as V,au as J,cO as fe,ed as j,cE as b,fd as m,e8 as pe,b0 as E,aC as Te,fj as Nt,fo as U,co as Qe,d5 as Lt,N as It,ex as zt,M as Ce,du as Et,d9 as Ke,ff as Ye,b3 as At,fb as u,cP as Xe,ej as Ge,c3 as ce,eX as Se,b9 as _,fe as se,cl as Ze,eW as Ft,cN as ne,Y as Ne,aT as Ut,dv as me,C as Vt,cq as Bt,eU as Ot,Z as jt,dp as kt,ew as Ht,B as Wt,e as Qt,A as be,W as Kt,ea as Yt,c8 as Xt,d7 as Gt,df as Zt}from"./three.core-3arARmh6.js";import{DEFAULTS as ae}from"./defaults-DKiBJCPN.js";import{detectKtx2Support as qt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as De}from"./render-settings-DS5leCed.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-rxbawsRb.js";import"./index-BRJMIUK0.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";class Jt extends It{boundingSphere=new zt;constructor(){super(),this.setAttribute("position",new Ce(new Float32Array([-1,-1,3,-1,-1,3]),2)),this.setAttribute("uv",new Ce(new Float32Array([0,0,2,0,0,2]),2))}computeBoundingSphere(){}}const _t=new Jt,$t=new Lt;class W{constructor(e){this._mesh=new Qe(_t,e),this._mesh.frustumCulled=!1}render(e){e.render(this._mesh,$t)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}dispose(){this._mesh.material.dispose(),this._mesh.geometry.dispose()}}const ei={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},sceneNormal:{value:null},projMat:{value:new h},viewMat:{value:new h},projViewMat:{value:new h},projectionMatrixInv:{value:new h},viewMatrixInv:{value:new h},cameraPos:{value:new U},resolution:{value:new m},biasAdjustment:{value:new m},time:{value:0},samples:{value:[]},bluenoise:{value:null},distanceFalloff:{value:1},radius:{value:5},near:{value:.1},far:{value:1e3},ortho:{value:!1},screenSpaceRadius:{value:!1},frame:{value:0}},depthWrite:!1,depthTest:!1,vertexShader:`
1
+ import{S as O,a as q,W as st}from"./three.module-BLhyNg0e.js";import{Pass as H,Effect as ue,Selection as ot,RenderPass as re,NormalPass as We,EffectPass as nt,SMAAPreset as ie,SMAAEffect as lt,SSAOEffect as ct,BloomEffect as ut,DepthOfFieldEffect as ft,TiltShiftEffect as dt,GodRaysEffect as ht,OutlineEffect as pt,ChromaticAberrationEffect as mt,LensDistortionEffect as vt,ShockWaveEffect as gt,BrightnessContrastEffect as xt,HueSaturationEffect as Tt,SepiaEffect as St,ColorDepthEffect as bt,NoiseEffect as Dt,ScanlineEffect as yt,DotScreenEffect as wt,GridEffect as Mt,PixelationEffect as Pt,GlitchEffect as Rt,VignetteEffect as Ct}from"./index-DHhMOs_s.js";import{_ as N,cm as h,em as C,fx as z,dw as B,c1 as x,bi as V,au as J,cO as fe,ed as j,cE as b,fd as m,e8 as pe,b0 as E,aC as Te,fj as Nt,fo as U,co as Qe,d5 as Lt,N as It,ex as zt,M as Ce,du as Et,d9 as Ke,ff as Ye,b3 as At,fb as u,cP as Xe,ej as Ge,c3 as ce,eX as Se,b9 as _,fe as se,cl as Ze,eW as Ft,cN as ne,Y as Ne,aT as Ut,dv as me,C as Vt,cq as Bt,eU as Ot,Z as jt,dp as kt,ew as Ht,B as Wt,e as Qt,A as be,W as Kt,ea as Yt,c8 as Xt,d7 as Gt,df as Zt}from"./three.core-3arARmh6.js";import{DEFAULTS as ae}from"./defaults-DKiBJCPN.js";import{detectKtx2Support as qt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as De}from"./render-settings-BBvkacR3.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-C7QwmhCo.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";class Jt extends It{boundingSphere=new zt;constructor(){super(),this.setAttribute("position",new Ce(new Float32Array([-1,-1,3,-1,-1,3]),2)),this.setAttribute("uv",new Ce(new Float32Array([0,0,2,0,0,2]),2))}computeBoundingSphere(){}}const _t=new Jt,$t=new Lt;class W{constructor(e){this._mesh=new Qe(_t,e),this._mesh.frustumCulled=!1}render(e){e.render(this._mesh,$t)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}dispose(){this._mesh.material.dispose(),this._mesh.geometry.dispose()}}const ei={uniforms:{sceneDiffuse:{value:null},sceneDepth:{value:null},sceneNormal:{value:null},projMat:{value:new h},viewMat:{value:new h},projViewMat:{value:new h},projectionMatrixInv:{value:new h},viewMatrixInv:{value:new h},cameraPos:{value:new U},resolution:{value:new m},biasAdjustment:{value:new m},time:{value:0},samples:{value:[]},bluenoise:{value:null},distanceFalloff:{value:1},radius:{value:5},near:{value:.1},far:{value:1e3},ortho:{value:!1},screenSpaceRadius:{value:!1},frame:{value:0}},depthWrite:!1,depthTest:!1,vertexShader:`
2
2
  varying vec2 vUv;
3
3
  void main() {
4
4
  vUv = uv;
@@ -1 +1 @@
1
- import{isEditorOwnedObject as f}from"./editor-layers-BDJnAAzj.js";import{T as y,d as b,o as a}from"./three-TCuY32m_.js";import{g}from"./user-data-Bpj7diUS.js";import{i as S,a as v,c as I}from"./model-inspection-CXHxrafK.js";import{C as j,S as w,r as R}from"./three-projection-core-CG01r5Ta.js";const u=new WeakMap;function E(d){let t=!1;if(d.traverse(s=>{g(s,"gaussianSplat")&&(t=!0)}),t)return"Gaussian splat";const r=S(d),e=v(d);return{static:"Static model",animated:"Animated model",rigged:"Rigged model",skinned:"Skinned model"}[I(r,e)]}function h(d){const t=d.material;return Array.isArray(t)?t[0]??null:t??null}function l(d){return d?.color??null}class p{constructor(t,r,e){if(this.store=t,this.scene=r,this.options=e,this.provenance=e.provenance??(e.documentKind==="asset"?{source:"document",label:"derived asset",detail:"Loaded from an ordinary project asset. Edit its source or import recipe."}:{source:"source-code",label:"source",detail:"Instantiated from project TypeScript. Edit source or exposed parameters, then rebuild."}),this.documentNodeId=`object3d-document:${e.documentId}`,this.projector=new y(b(e.documentId)),this.indexGraph(),e.hierarchyRoots&&new Set(e.hierarchyRoots).size!==e.hierarchyRoots.length)throw new Error(`Object3D document "${e.title}" declared the same hierarchy root twice.`);const s=new Set(e.hierarchyRoots??[]);for(const o of s){let i=o.parent;for(;i&&i!==r;){if(s.has(i))throw new Error(`Object3D document "${e.title}" declared nested hierarchy roots; roots must be non-overlapping.`);i=i.parent}}this.hierarchyRootIds=e.hierarchyRoots?e.hierarchyRoots.map(o=>{const i=this.idByObject.get(o);if(!i)throw new Error(`Object3D document "${e.title}" declared a hierarchy root outside its native graph.`);return i}):[...this.projector.rootIds],this.view=new j({projector:this.projector,scene:r,documentNodeId:this.documentNodeId,rootIds:this.hierarchyRootIds}),this.selectionState=new w({store:t.shell,owns:o=>this.byId.has(o),initial:[this.documentNodeId],onChange:o=>this.syncMarkedSelection(o)})}documentNodeId;projector;hierarchyRootIds;view;selectionState;markedSelection=new Set;capabilities={transform:!1,inspectorFields:!0,persist:!1};provenance;disposed=!1;dispose(){if(!this.disposed){this.disposed=!0;for(const t of this.watchedForStructure)t.removeEventListener("childadded",this.onStructureChanged),t.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[]}}watchedForStructure=[];structureReindexQueued=!1;onStructureChanged=t=>{f(t.child)||this.scheduleStructureReindex()};indexGraph(){this.projector.project(this.scene),this.watchStructure()}watchStructure(){const t=e=>e;for(const e of this.watchedForStructure)t(e).removeEventListener("childadded",this.onStructureChanged),t(e).removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[];const r=e=>{t(e).addEventListener("childadded",this.onStructureChanged),t(e).addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.push(e)};r(this.scene);for(const[,e]of this.byId)r(e)}scheduleStructureReindex(){this.disposed||this.structureReindexQueued||(this.structureReindexQueued=!0,queueMicrotask(()=>{if(this.structureReindexQueued=!1,this.disposed||(this.indexGraph(),this.store.scene!==this.scene))return;const t=this.store.objectMap;t.clear();for(const[e,s]of this.byId)t.set(e,s);const r=[...this.store.shell.selectedEntityIds].filter(e=>e===this.documentNodeId||this.byId.has(e));r.length!==this.store.shell.selectedEntityIds.size&&this.store.shell.selectMultiple(r),this.store.notifyIngestObjectMapEdit()}))}get byId(){return this.projector.objects}get idByObject(){return this.projector.idsByObject}documentTypeLabel(){if(this.options.documentKind!=="asset")return;const t=this.scene.children.find(s=>this.idByObject.has(s))??null;if(!t)return;const r=u.get(t);if(r!==void 0)return r;const e=E(t);return u.set(t,e),e}hierarchy={roots:()=>[this.hierarchy.node(this.documentNodeId)],node:t=>{if(t===this.documentNodeId){const e=this.documentTypeLabel();return{id:t,label:this.options.title,secondaryLabel:this.options.sourcePath,role:"document",kind:this.options.documentKind==="asset"?"model-asset":"three-source",...e?{typeLabel:e}:{},parentId:null,childIds:this.view.rootIds()}}const r=this.byId.get(t);return r?this.view.node(r):null},object3D:t=>this.byId.get(t)??null,idForObject3D:t=>this.idByObject.get(t)??null};selection={get:()=>this.selectionState.current(),set:t=>this.selectionState.publish(t.filter(r=>r===this.documentNodeId||this.byId.has(r)))};static READ_ONLY_REASON="This document shows what the module builds; its properties are read-only here. Edit the module.";readOnly=()=>({writable:!1,reason:p.READ_ONLY_REASON});transforms={get:t=>R(this.byId.get(t)??null),beginEdit:()=>{},apply:()=>{},endEdit:()=>{}};inspector={properties:t=>{if(t===this.documentNodeId)return this.options.audit===!1?[]:[{path:"name",label:"Name",type:"string",readonly:!0},{path:"source.path",label:"Source",type:"string",readonly:!0}];const r=this.byId.get(t);if(!r)return[];const e=a(r);if(e?.fields)return e.fields().map(({value:n,...m})=>m);const s=[{path:"name",label:"Name",type:"string",readonly:!0},{path:"visible",label:"Visible",type:"boolean",readonly:!0},{path:"object.type",label:"Native type",type:"string",readonly:!0}],o=r;if(o.isMesh&&o.geometry){const n=o.geometry.getAttribute("position");s.push({path:"mesh.vertices",label:"Vertices",type:"number",readonly:!0,group:"Mesh"}),n&&s.push({path:"mesh.triangles",label:"Triangles",type:"number",readonly:!0,group:"Mesh"})}const i=h(r);i&&(s.push({path:"material.type",label:"Material",type:"string",readonly:!0,group:"Material"}),l(i)&&s.push({path:"material.color",label:"Color",type:"color",readonly:!0,group:"Material"}));const c=r;return c.isSkinnedMesh&&c.skeleton&&s.push({path:"skin.bones",label:"Bones",type:"number",readonly:!0,group:"Skin"}),s},get:(t,r)=>{if(t===this.documentNodeId)return r==="name"?this.options.title:r==="source.path"?this.options.sourcePath:void 0;const e=this.byId.get(t);if(!e)return;const o=a(e)?.fields?.().find(n=>n.path===r);if(o)return o.value();if(r==="name")return e.name||e.type;if(r==="visible")return e.visible;if(r==="object.type")return e.type;const i=e;if(r==="mesh.vertices")return i.geometry?.getAttribute("position")?.count??0;if(r==="mesh.triangles"){const n=i.geometry;return(n?.index?.count??n?.getAttribute("position")?.count??0)/3}const c=h(e);if(r==="material.type")return c?.type;if(r==="material.color"){const n=l(c);return n?`#${n.getHexString()}`:void 0}if(r==="skin.bones")return e.skeleton?.bones.length??0},set:()=>{},editability:()=>this.readOnly()};subscribe(t){return this.store.shell.subscribe(t)}get documentId(){return this.documentNodeId}get documentRootObject(){const t=this.hierarchy.node(this.documentNodeId)?.childIds[0];return t?this.byId.get(t)??null:null}syncMarkedSelection(t){const r=new Set(t.map(e=>this.byId.get(e)??null).filter(e=>e!==null).filter(e=>a(e)?.selectionChanged!==void 0));for(const e of this.markedSelection)r.has(e)||a(e)?.selectionChanged?.(!1);for(const e of r)this.markedSelection.has(e)||a(e)?.selectionChanged?.(!0);this.markedSelection=r}}export{p as S};
1
+ import{isEditorOwnedObject as f}from"./editor-layers-B4oYfpj8.js";import{T as y,d as b,o as a}from"./three-oYrcK5SQ.js";import{g}from"./user-data-CqOoAowZ.js";import{i as S,a as v,c as I}from"./model-inspection-MrJY0U_-.js";import{C as j,S as w,r as R}from"./three-projection-core-jBJVt6O0.js";const u=new WeakMap;function E(d){let t=!1;if(d.traverse(s=>{g(s,"gaussianSplat")&&(t=!0)}),t)return"Gaussian splat";const r=S(d),e=v(d);return{static:"Static model",animated:"Animated model",rigged:"Rigged model",skinned:"Skinned model"}[I(r,e)]}function h(d){const t=d.material;return Array.isArray(t)?t[0]??null:t??null}function l(d){return d?.color??null}class p{constructor(t,r,e){if(this.store=t,this.scene=r,this.options=e,this.provenance=e.provenance??(e.documentKind==="asset"?{source:"document",label:"derived asset",detail:"Loaded from an ordinary project asset. Edit its source or import recipe."}:{source:"source-code",label:"source",detail:"Instantiated from project TypeScript. Edit source or exposed parameters, then rebuild."}),this.documentNodeId=`object3d-document:${e.documentId}`,this.projector=new y(b(e.documentId)),this.indexGraph(),e.hierarchyRoots&&new Set(e.hierarchyRoots).size!==e.hierarchyRoots.length)throw new Error(`Object3D document "${e.title}" declared the same hierarchy root twice.`);const s=new Set(e.hierarchyRoots??[]);for(const o of s){let i=o.parent;for(;i&&i!==r;){if(s.has(i))throw new Error(`Object3D document "${e.title}" declared nested hierarchy roots; roots must be non-overlapping.`);i=i.parent}}this.hierarchyRootIds=e.hierarchyRoots?e.hierarchyRoots.map(o=>{const i=this.idByObject.get(o);if(!i)throw new Error(`Object3D document "${e.title}" declared a hierarchy root outside its native graph.`);return i}):[...this.projector.rootIds],this.view=new j({projector:this.projector,scene:r,documentNodeId:this.documentNodeId,rootIds:this.hierarchyRootIds}),this.selectionState=new w({store:t.shell,owns:o=>this.byId.has(o),initial:[this.documentNodeId],onChange:o=>this.syncMarkedSelection(o)})}documentNodeId;projector;hierarchyRootIds;view;selectionState;markedSelection=new Set;capabilities={transform:!1,inspectorFields:!0,persist:!1};provenance;disposed=!1;dispose(){if(!this.disposed){this.disposed=!0;for(const t of this.watchedForStructure)t.removeEventListener("childadded",this.onStructureChanged),t.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[]}}watchedForStructure=[];structureReindexQueued=!1;onStructureChanged=t=>{f(t.child)||this.scheduleStructureReindex()};indexGraph(){this.projector.project(this.scene),this.watchStructure()}watchStructure(){const t=e=>e;for(const e of this.watchedForStructure)t(e).removeEventListener("childadded",this.onStructureChanged),t(e).removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[];const r=e=>{t(e).addEventListener("childadded",this.onStructureChanged),t(e).addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.push(e)};r(this.scene);for(const[,e]of this.byId)r(e)}scheduleStructureReindex(){this.disposed||this.structureReindexQueued||(this.structureReindexQueued=!0,queueMicrotask(()=>{if(this.structureReindexQueued=!1,this.disposed||(this.indexGraph(),this.store.scene!==this.scene))return;const t=this.store.objectMap;t.clear();for(const[e,s]of this.byId)t.set(e,s);const r=[...this.store.shell.selectedEntityIds].filter(e=>e===this.documentNodeId||this.byId.has(e));r.length!==this.store.shell.selectedEntityIds.size&&this.store.shell.selectMultiple(r),this.store.notifyIngestObjectMapEdit()}))}get byId(){return this.projector.objects}get idByObject(){return this.projector.idsByObject}documentTypeLabel(){if(this.options.documentKind!=="asset")return;const t=this.scene.children.find(s=>this.idByObject.has(s))??null;if(!t)return;const r=u.get(t);if(r!==void 0)return r;const e=E(t);return u.set(t,e),e}hierarchy={roots:()=>[this.hierarchy.node(this.documentNodeId)],node:t=>{if(t===this.documentNodeId){const e=this.documentTypeLabel();return{id:t,label:this.options.title,secondaryLabel:this.options.sourcePath,role:"document",kind:this.options.documentKind==="asset"?"model-asset":"three-source",...e?{typeLabel:e}:{},parentId:null,childIds:this.view.rootIds()}}const r=this.byId.get(t);return r?this.view.node(r):null},object3D:t=>this.byId.get(t)??null,idForObject3D:t=>this.idByObject.get(t)??null};selection={get:()=>this.selectionState.current(),set:t=>this.selectionState.publish(t.filter(r=>r===this.documentNodeId||this.byId.has(r)))};static READ_ONLY_REASON="This document shows what the module builds; its properties are read-only here. Edit the module.";readOnly=()=>({writable:!1,reason:p.READ_ONLY_REASON});transforms={get:t=>R(this.byId.get(t)??null),beginEdit:()=>{},apply:()=>{},endEdit:()=>{}};inspector={properties:t=>{if(t===this.documentNodeId)return this.options.audit===!1?[]:[{path:"name",label:"Name",type:"string",readonly:!0},{path:"source.path",label:"Source",type:"string",readonly:!0}];const r=this.byId.get(t);if(!r)return[];const e=a(r);if(e?.fields)return e.fields().map(({value:n,...m})=>m);const s=[{path:"name",label:"Name",type:"string",readonly:!0},{path:"visible",label:"Visible",type:"boolean",readonly:!0},{path:"object.type",label:"Native type",type:"string",readonly:!0}],o=r;if(o.isMesh&&o.geometry){const n=o.geometry.getAttribute("position");s.push({path:"mesh.vertices",label:"Vertices",type:"number",readonly:!0,group:"Mesh"}),n&&s.push({path:"mesh.triangles",label:"Triangles",type:"number",readonly:!0,group:"Mesh"})}const i=h(r);i&&(s.push({path:"material.type",label:"Material",type:"string",readonly:!0,group:"Material"}),l(i)&&s.push({path:"material.color",label:"Color",type:"color",readonly:!0,group:"Material"}));const c=r;return c.isSkinnedMesh&&c.skeleton&&s.push({path:"skin.bones",label:"Bones",type:"number",readonly:!0,group:"Skin"}),s},get:(t,r)=>{if(t===this.documentNodeId)return r==="name"?this.options.title:r==="source.path"?this.options.sourcePath:void 0;const e=this.byId.get(t);if(!e)return;const o=a(e)?.fields?.().find(n=>n.path===r);if(o)return o.value();if(r==="name")return e.name||e.type;if(r==="visible")return e.visible;if(r==="object.type")return e.type;const i=e;if(r==="mesh.vertices")return i.geometry?.getAttribute("position")?.count??0;if(r==="mesh.triangles"){const n=i.geometry;return(n?.index?.count??n?.getAttribute("position")?.count??0)/3}const c=h(e);if(r==="material.type")return c?.type;if(r==="material.color"){const n=l(c);return n?`#${n.getHexString()}`:void 0}if(r==="skin.bones")return e.skeleton?.bones.length??0},set:()=>{},editability:()=>this.readOnly()};subscribe(t){return this.store.shell.subscribe(t)}get documentId(){return this.documentNodeId}get documentRootObject(){const t=this.hierarchy.node(this.documentNodeId)?.childIds[0];return t?this.byId.get(t)??null:null}syncMarkedSelection(t){const r=new Set(t.map(e=>this.byId.get(e)??null).filter(e=>e!==null).filter(e=>a(e)?.selectionChanged!==void 0));for(const e of this.markedSelection)r.has(e)||a(e)?.selectionChanged?.(!1);for(const e of r)this.markedSelection.has(e)||a(e)?.selectionChanged?.(!0);this.markedSelection=r}}export{p as S};
@@ -1 +1 @@
1
- import{gt as d,di as u,bk as f,bl as a,aq as p,eg as l,M as c,gu as g}from"./index-BRJMIUK0.js";import{r as s,I as h,i as w}from"./ingest-source-persistence-Dmdo-UBp.js";function y(n){const t={sourceLocation:e=>{const r=n(e);if(!(!r.anchored||r.kind!=="source"))return{file:r.file,line:r.line}}};return{links:e=>{const r=n(e);return!r.anchored||r.kind!=="source"?[]:[{id:`creation-site:${r.file}:${r.line}:${r.col}`,title:`Constructed at ${r.display}`,open:()=>{d(t,e,"callsite").then(u)}}]}}}function $(n){return`this gesture changed ${n.length} properties at once (${n.join(", ")}), and creation-site write-back plans one property per gesture`}function v(n){const{backend:t,label:e}=n;return f({resolve:()=>{const r=n.subject(),i=t.gate(r);if(!i.ok)return a(i.reason);const o=r.anchorKind;return o==="live-only"?a(t.describe(r)):{reaches:"writer",anchorKind:o,destination:t.destination(),write:()=>t.write({...r,baseline:n.baseline,next:n.next,label:e})}},record:r=>{r||n.journal()},report:r=>{t.armed()&&t.report(e,r)}})}function k(n){let t=null;return{attach(e){t=n.writer??(g("An ingest root’s source persistence")?new h({history:n.history,live:e}):null)},describe({anchor:e,instances:r,property:i,writeScope:o}){return t?t.describe(e,r,i,o):e.anchored?e.kind==="data"?`Live-only edit — this object is ${e.display}.`:`Live-only edit — this object is created at ${e.display}.`:`Live-only edit — ${e.reason}.`},gate({anchor:e,instances:r,property:i,writeScope:o}){return t?t.gate(e,r,i,o):{ok:!1,reason:"this editor tier cannot write project source"}},armed:()=>t!==null&&l(),readSiteLiterals:e=>t?t.inspect(e):Promise.resolve({}),report:(e,r)=>s(e,r),async write(e){if(!t)return!1;try{const r=await t.persist(e);return r.persisted?(c.log(`[ingest] ${e.label} written to the game's own source — ${r.detail}`),!0):(s(e.label,r.reason),!1)}catch(r){return s(e.label,`the write failed: ${r instanceof Error?r.message:String(r)}`),!1}},removal:{available(e){return t?t.gate(e.anchor,e.instances,e.property,e.writeScope).ok:!1},async perform(e){if(!t)return!1;try{const r=await t.remove({property:e.property,surface:e.surface,anchor:e.anchor,instances:e.instances,writeScope:e.writeScope,label:e.label});return r.persisted?(c.log(`[ingest] ${e.label} — dropped from the game's own source (${r.detail})`),!0):(s(e.label,r.reason),!1)}catch(r){return s(e.label,`the removal failed: ${r instanceof Error?r.message:String(r)}`),!1}}},destination(){const e=w();return l()&&e?.writable&&t?"the game's own source (creation-site write-back)":p},dispose(){t?.dispose(),t=null}}}export{k as a,y as c,$ as m,v as p};
1
+ import{gB as d,d3 as u,bl as f,bm as a,ar as p,e6 as l,M as c,gC as g}from"./index-CaG87ZF-.js";import{r as s,I as h,i as w}from"./ingest-source-persistence-6peGfPAS.js";function y(n){const t={sourceLocation:e=>{const r=n(e);if(!(!r.anchored||r.kind!=="source"))return{file:r.file,line:r.line}}};return{links:e=>{const r=n(e);return!r.anchored||r.kind!=="source"?[]:[{id:`creation-site:${r.file}:${r.line}:${r.col}`,title:`Constructed at ${r.display}`,open:()=>{d(t,e,"callsite").then(u)}}]}}}function $(n){return`this gesture changed ${n.length} properties at once (${n.join(", ")}), and creation-site write-back plans one property per gesture`}function v(n){const{backend:t,label:e}=n;return f({resolve:()=>{const r=n.subject(),i=t.gate(r);if(!i.ok)return a(i.reason);const o=r.anchorKind;return o==="live-only"?a(t.describe(r)):{reaches:"writer",anchorKind:o,destination:t.destination(),write:()=>t.write({...r,baseline:n.baseline,next:n.next,label:e})}},record:r=>{r||n.journal()},report:r=>{t.armed()&&t.report(e,r)}})}function S(n){let t=null;return{attach(e){t=n.writer??(g("An ingest root’s source persistence")?new h({history:n.history,live:e}):null)},describe({anchor:e,instances:r,property:i,writeScope:o}){return t?t.describe(e,r,i,o):e.anchored?e.kind==="data"?`Live-only edit — this object is ${e.display}.`:`Live-only edit — this object is created at ${e.display}.`:`Live-only edit — ${e.reason}.`},gate({anchor:e,instances:r,property:i,writeScope:o}){return t?t.gate(e,r,i,o):{ok:!1,reason:"this editor tier cannot write project source"}},armed:()=>t!==null&&l(),readSiteLiterals:e=>t?t.inspect(e):Promise.resolve({}),report:(e,r)=>s(e,r),async write(e){if(!t)return!1;try{const r=await t.persist(e);return r.persisted?(c.log(`[ingest] ${e.label} written to the game's own source — ${r.detail}`),!0):(s(e.label,r.reason),!1)}catch(r){return s(e.label,`the write failed: ${r instanceof Error?r.message:String(r)}`),!1}},removal:{available(e){return t?t.gate(e.anchor,e.instances,e.property,e.writeScope).ok:!1},async perform(e){if(!t)return!1;try{const r=await t.remove({property:e.property,surface:e.surface,anchor:e.anchor,instances:e.instances,writeScope:e.writeScope,label:e.label});return r.persisted?(c.log(`[ingest] ${e.label} — dropped from the game's own source (${r.detail})`),!0):(s(e.label,r.reason),!1)}catch(r){return s(e.label,`the removal failed: ${r instanceof Error?r.message:String(r)}`),!1}}},destination(){const e=w();return l()&&e?.writable&&t?"the game's own source (creation-site write-back)":p},dispose(){t?.dispose(),t=null}}}export{S as a,y as c,$ as m,v as p};
@@ -1 +1 @@
1
- import{r as h}from"./index-nmcBqr7Y.js";import{s as b,c as f,l as V,a as x,t as S,v as P,p as T,b as y}from"./camera-authoring-DYjhU5Zp.js";import{g_ as L,aF as A,cH as C,aH as k,w as g,q as O,di as M,g$ as E,fX as R,h0 as z}from"./index-BRJMIUK0.js";import{a as D}from"./object3d-document-session-registry-DJDEDM0p.js";import{r as s}from"./transform-mode-request-DzD9aUNA.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 H(){const e=f();if(e.view)return[{id:"camera.exitView",label:"Exit Camera View",execute:V}];const i=x();return i?[{id:"camera.viewThrough",label:`View Through ${i.name}`,execute:()=>P(i)},...i.canAuthorPose?[{id:"camera.pilot",label:`Pilot ${i.name}`,execute:()=>T(i)},{id:"camera.alignToView",label:`Align ${i.name} to Current View`,execute:()=>y(i)}]:[],{id:"camera.pinPreview",label:e.previewPinned?"Unpin Camera Preview":"Pin Camera Preview",execute:S}]:[]}function $(){const e=g();return e?D(e):null}function a(e,i){const o=$();o?o.setMode(i):e.setShadingMode(i)}function j(e){const i=[{id:"mode.select",label:"Select Tool (no gizmo)",shortcut:"transform.select",execute:()=>s(e.shell,"select")},{id:"mode.combined",label:"Transform Mode (all handles)",shortcut:"transform.combined",execute:()=>s(e.shell,"combined")},{id:"mode.translate",label:"Translate Mode",shortcut:"transform.translate",execute:()=>s(e.shell,"translate")},{id:"mode.rotate",label:"Rotate Mode",shortcut:"transform.rotate",execute:()=>s(e.shell,"rotate")},{id:"mode.scale",label:"Scale Mode",shortcut:"transform.scale",execute:()=>s(e.shell,"scale")},{id:"mode.world",label:"World Space",execute:()=>e.shell.setTransformSpace("world")},{id:"mode.local",label:"Local Space",execute:()=>e.shell.setTransformSpace("local")},{id:"toggle.grid",label:"Toggle Grid",execute:()=>{const l=g();l&&A(l)&&C(l,!k(l))}},{id:"toggle.helpers",label:"Toggle Helpers",execute:()=>e.shell.toggleHelpers()},{id:"toggle.stats",label:"Toggle Stats Overlay",execute:()=>e.toggleStats()},{id:"toggle.snap",label:"Toggle Snap",shortcut:"viewport.toggleSnap",execute:()=>e.shell.toggleSnap()},{id:"toggle.surface-snap",label:"Toggle Surface Snap",execute:()=>e.shell.toggleSnapToSurface()},{id:"shading.solid",label:"Material Shading",execute:()=>a(e,"solid")},{id:"shading.clay",label:"Solid Shading",execute:()=>a(e,"clay")},{id:"shading.wireframe",label:"Wireframe Shading",execute:()=>a(e,"wireframe")},{id:"shading.unlit",label:"Unlit Shading",execute:()=>a(e,"unlit")},{id:"shading.normals",label:"Normal Shading",execute:()=>a(e,"normals")},{id:"shading.overdraw",label:"Overdraw Shading",execute:()=>a(e,"overdraw")},{id:"view.top",label:"Top View",shortcut:"view.top",execute:()=>e.shell.setViewPreset("top")},{id:"view.front",label:"Front View",shortcut:"view.front",execute:()=>e.shell.setViewPreset("front")},{id:"view.right",label:"Right View",shortcut:"view.right",execute:()=>e.shell.setViewPreset("right")},{id:"view.bottom",label:"Bottom View",shortcut:"view.bottom",execute:()=>e.shell.setViewPreset("bottom")},{id:"view.back",label:"Back View",shortcut:"view.back",execute:()=>e.shell.setViewPreset("back")},{id:"view.left",label:"Left View",shortcut:"view.left",execute:()=>e.shell.setViewPreset("left")},{id:"view.orbitLeft",label:"Orbit Left",shortcut:"view.orbitLeft",execute:()=>e.shell.stepView("orbit-left")},{id:"view.orbitRight",label:"Orbit Right",shortcut:"view.orbitRight",execute:()=>e.shell.stepView("orbit-right")},{id:"view.orbitUp",label:"Orbit Up",shortcut:"view.orbitUp",execute:()=>e.shell.stepView("orbit-up")},{id:"view.orbitDown",label:"Orbit Down",shortcut:"view.orbitDown",execute:()=>e.shell.stepView("orbit-down")},{id:"view.opposite",label:"Opposite View",shortcut:"view.opposite",execute:()=>e.shell.stepView("opposite")},{id:"view.rollLeft",label:"Roll Left",shortcut:"view.rollLeft",execute:()=>e.shell.stepView("roll-left")},{id:"view.rollRight",label:"Roll Right",shortcut:"view.rollRight",execute:()=>e.shell.stepView("roll-right")},{id:"view.all",label:"Frame All",shortcut:"view.all",execute:()=>e.shell.frameAll()},{id:"view.zoomIn",label:"Zoom In",shortcut:"view.zoomIn",execute:()=>e.shell.zoomView(1)},{id:"view.zoomOut",label:"Zoom Out",shortcut:"view.zoomOut",execute:()=>e.shell.zoomView(-1)},{id:"view.perspective",label:"Perspective View",shortcut:"view.perspective",execute:()=>e.shell.setViewPreset("perspective")},{id:"view.projection",label:"Perspective/Orthographic",shortcut:"view.projection",execute:()=>e.shell.toggleProjection()},{id:"view.camera",label:"Camera View",shortcut:"view.camera",execute:()=>e.shell.toggleCameraView()},{id:"focus.selected",label:"Focus Selected",shortcut:"viewport.frameSelection",execute:()=>e.shell.focusOnSelection()}];return L({actions:()=>[...i,...H()],subscribe:b})}function F(e,i,o){const{keyboard:l}=O(),r=t=>()=>{i.isFlying||s(e.shell,t)},v=l.bindActions([{id:"transform.select",scope:"stage",run:r("select")},{id:"transform.combined",scope:"stage",run:r("combined")},{id:"transform.translate",scope:"stage",run:r("translate")},{id:"transform.rotate",scope:"stage",run:r("rotate")},{id:"transform.scale",scope:"stage",run:r("scale")},{id:"viewport.toggleSnap",scope:"stage",run:()=>{e.shell.toggleSnap();const{translate:t,rotate:n,scale:m}=e.shell.snapValues,p=`${l.shortcutFor("viewport.toggleSnap")??""} toggles; hold Ctrl while dragging to snap once`;M(e.shell.snapEnabled?`Snap on — ${t} units, ${n}°, ×${m} (${p})`:`Snap off (${p})`)}},{id:"viewport.frameSelection",scope:"stage",run:()=>e.shell.focusOnSelection()},{id:"viewport.cyclePivot",scope:"stage",run:()=>{const t=["active-element","median-point","individual-origins"],n=t.indexOf(e.shell.pivotMode);e.shell.setPivotMode(t[(n+1)%t.length])}},{id:"view.top",scope:"stage",run:()=>e.shell.setViewPreset("top")},{id:"view.front",scope:"stage",run:()=>e.shell.setViewPreset("front")},{id:"view.right",scope:"stage",run:()=>e.shell.setViewPreset("right")},{id:"view.bottom",scope:"stage",run:()=>e.shell.setViewPreset("bottom")},{id:"view.back",scope:"stage",run:()=>e.shell.setViewPreset("back")},{id:"view.left",scope:"stage",run:()=>e.shell.setViewPreset("left")},{id:"view.orbitLeft",scope:"stage",run:()=>e.shell.stepView("orbit-left")},{id:"view.orbitRight",scope:"stage",run:()=>e.shell.stepView("orbit-right")},{id:"view.orbitUp",scope:"stage",run:()=>e.shell.stepView("orbit-up")},{id:"view.orbitDown",scope:"stage",run:()=>e.shell.stepView("orbit-down")},{id:"view.opposite",scope:"stage",run:()=>e.shell.stepView("opposite")},{id:"view.rollLeft",scope:"stage",run:()=>e.shell.stepView("roll-left")},{id:"view.rollRight",scope:"stage",run:()=>e.shell.stepView("roll-right")},{id:"view.all",scope:"stage",run:()=>e.shell.frameAll()},{id:"view.zoomIn",scope:"stage",run:()=>e.shell.zoomView(1)},{id:"view.zoomOut",scope:"stage",run:()=>e.shell.zoomView(-1)},{id:"view.perspective",scope:"stage",run:()=>e.shell.setViewPreset("perspective")},{id:"view.projection",scope:"stage",run:()=>e.shell.toggleProjection()},{id:"view.camera",scope:"stage",run:()=>e.shell.toggleCameraView()},{id:"viewport.snapToFloor",scope:"stage",run:()=>i.snapSelectionToFloor()}]),c=()=>R("viewport");o.addEventListener("pointerdown",c),E();const d=t=>l.chordsFor("viewport.vertexSnapHold").some(n=>n.key===t.key.toLowerCase()),u=t=>{if(d(t)&&!t.metaKey&&!t.ctrlKey&&!t.repeat){if(z()!=="viewport"||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement)return;e.setVertexSnapActive(!0),i.activateVertexSnap()}},w=t=>{d(t)&&!t.metaKey&&!t.ctrlKey&&(e.setVertexSnapActive(!1),i.deactivateVertexSnap())};return window.addEventListener("keydown",u),window.addEventListener("keyup",w),()=>{v(),o.removeEventListener("pointerdown",c),window.removeEventListener("keydown",u),window.removeEventListener("keyup",w)}}function Q({stage:e}){return h.useEffect(()=>F(e.store,e.viewport,e.canvas),[e.store,e.viewport,e.canvas]),h.useEffect(()=>j(e.store),[e.store]),null}export{Q as StageKeyboardBinding};
1
+ import{r as h}from"./index-nmcBqr7Y.js";import{s as b,c as f,l as V,a as x,t as S,v as P,p as T,b as y}from"./camera-authoring-DYjhU5Zp.js";import{h6 as L,aG as A,dQ as C,aI as k,w as g,q as O,d3 as M,h7 as E,g3 as R,h8 as z}from"./index-CaG87ZF-.js";import{a as D}from"./object3d-document-session-registry-OjqzJ86S.js";import{r as s}from"./transform-mode-request-BnKpgRUW.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 j(){const e=f();if(e.view)return[{id:"camera.exitView",label:"Exit Camera View",execute:V}];const i=x();return i?[{id:"camera.viewThrough",label:`View Through ${i.name}`,execute:()=>P(i)},...i.canAuthorPose?[{id:"camera.pilot",label:`Pilot ${i.name}`,execute:()=>T(i)},{id:"camera.alignToView",label:`Align ${i.name} to Current View`,execute:()=>y(i)}]:[],{id:"camera.pinPreview",label:e.previewPinned?"Unpin Camera Preview":"Pin Camera Preview",execute:S}]:[]}function H(){const e=g();return e?D(e):null}function a(e,i){const o=H();o?o.setMode(i):e.setShadingMode(i)}function I(e){const i=[{id:"mode.select",label:"Select Tool (no gizmo)",shortcut:"transform.select",execute:()=>s(e.shell,"select")},{id:"mode.combined",label:"Transform Mode (all handles)",shortcut:"transform.combined",execute:()=>s(e.shell,"combined")},{id:"mode.translate",label:"Translate Mode",shortcut:"transform.translate",execute:()=>s(e.shell,"translate")},{id:"mode.rotate",label:"Rotate Mode",shortcut:"transform.rotate",execute:()=>s(e.shell,"rotate")},{id:"mode.scale",label:"Scale Mode",shortcut:"transform.scale",execute:()=>s(e.shell,"scale")},{id:"mode.world",label:"World Space",execute:()=>e.shell.setTransformSpace("world")},{id:"mode.local",label:"Local Space",execute:()=>e.shell.setTransformSpace("local")},{id:"toggle.grid",label:"Toggle Grid",execute:()=>{const l=g();l&&A(l)&&C(l,!k(l))}},{id:"toggle.helpers",label:"Toggle Helpers",execute:()=>e.shell.toggleHelpers()},{id:"toggle.stats",label:"Toggle Stats Overlay",execute:()=>e.toggleStats()},{id:"toggle.snap",label:"Toggle Snap",shortcut:"viewport.toggleSnap",execute:()=>e.shell.toggleSnap()},{id:"toggle.surface-snap",label:"Toggle Surface Snap",execute:()=>e.shell.toggleSnapToSurface()},{id:"shading.solid",label:"Material Shading",execute:()=>a(e,"solid")},{id:"shading.clay",label:"Solid Shading",execute:()=>a(e,"clay")},{id:"shading.wireframe",label:"Wireframe Shading",execute:()=>a(e,"wireframe")},{id:"shading.unlit",label:"Unlit Shading",execute:()=>a(e,"unlit")},{id:"shading.normals",label:"Normal Shading",execute:()=>a(e,"normals")},{id:"shading.overdraw",label:"Overdraw Shading",execute:()=>a(e,"overdraw")},{id:"view.top",label:"Top View",shortcut:"view.top",execute:()=>e.shell.setViewPreset("top")},{id:"view.front",label:"Front View",shortcut:"view.front",execute:()=>e.shell.setViewPreset("front")},{id:"view.right",label:"Right View",shortcut:"view.right",execute:()=>e.shell.setViewPreset("right")},{id:"view.bottom",label:"Bottom View",shortcut:"view.bottom",execute:()=>e.shell.setViewPreset("bottom")},{id:"view.back",label:"Back View",shortcut:"view.back",execute:()=>e.shell.setViewPreset("back")},{id:"view.left",label:"Left View",shortcut:"view.left",execute:()=>e.shell.setViewPreset("left")},{id:"view.orbitLeft",label:"Orbit Left",shortcut:"view.orbitLeft",execute:()=>e.shell.stepView("orbit-left")},{id:"view.orbitRight",label:"Orbit Right",shortcut:"view.orbitRight",execute:()=>e.shell.stepView("orbit-right")},{id:"view.orbitUp",label:"Orbit Up",shortcut:"view.orbitUp",execute:()=>e.shell.stepView("orbit-up")},{id:"view.orbitDown",label:"Orbit Down",shortcut:"view.orbitDown",execute:()=>e.shell.stepView("orbit-down")},{id:"view.opposite",label:"Opposite View",shortcut:"view.opposite",execute:()=>e.shell.stepView("opposite")},{id:"view.rollLeft",label:"Roll Left",shortcut:"view.rollLeft",execute:()=>e.shell.stepView("roll-left")},{id:"view.rollRight",label:"Roll Right",shortcut:"view.rollRight",execute:()=>e.shell.stepView("roll-right")},{id:"view.all",label:"Frame All",shortcut:"view.all",execute:()=>e.shell.frameAll()},{id:"view.zoomIn",label:"Zoom In",shortcut:"view.zoomIn",execute:()=>e.shell.zoomView(1)},{id:"view.zoomOut",label:"Zoom Out",shortcut:"view.zoomOut",execute:()=>e.shell.zoomView(-1)},{id:"view.perspective",label:"Perspective View",shortcut:"view.perspective",execute:()=>e.shell.setViewPreset("perspective")},{id:"view.projection",label:"Perspective/Orthographic",shortcut:"view.projection",execute:()=>e.shell.toggleProjection()},{id:"view.camera",label:"Camera View",shortcut:"view.camera",execute:()=>e.shell.toggleCameraView()},{id:"focus.selected",label:"Focus Selected",shortcut:"viewport.frameSelection",execute:()=>e.shell.focusOnSelection()}];return L({actions:()=>[...i,...j()],subscribe:b})}function $(e,i,o){const{keyboard:l}=O(),r=t=>()=>{i.isFlying||s(e.shell,t)},v=l.bindActions([{id:"transform.select",scope:"stage",run:r("select")},{id:"transform.combined",scope:"stage",run:r("combined")},{id:"transform.translate",scope:"stage",run:r("translate")},{id:"transform.rotate",scope:"stage",run:r("rotate")},{id:"transform.scale",scope:"stage",run:r("scale")},{id:"viewport.toggleSnap",scope:"stage",run:()=>{e.shell.toggleSnap();const{translate:t,rotate:n,scale:m}=e.shell.snapValues,p=`${l.shortcutFor("viewport.toggleSnap")??""} toggles; hold Ctrl while dragging to snap once`;M(e.shell.snapEnabled?`Snap on — ${t} units, ${n}°, ×${m} (${p})`:`Snap off (${p})`)}},{id:"viewport.frameSelection",scope:"stage",run:()=>e.shell.focusOnSelection()},{id:"viewport.cyclePivot",scope:"stage",run:()=>{const t=["active-element","median-point","individual-origins"],n=t.indexOf(e.shell.pivotMode);e.shell.setPivotMode(t[(n+1)%t.length])}},{id:"view.top",scope:"stage",run:()=>e.shell.setViewPreset("top")},{id:"view.front",scope:"stage",run:()=>e.shell.setViewPreset("front")},{id:"view.right",scope:"stage",run:()=>e.shell.setViewPreset("right")},{id:"view.bottom",scope:"stage",run:()=>e.shell.setViewPreset("bottom")},{id:"view.back",scope:"stage",run:()=>e.shell.setViewPreset("back")},{id:"view.left",scope:"stage",run:()=>e.shell.setViewPreset("left")},{id:"view.orbitLeft",scope:"stage",run:()=>e.shell.stepView("orbit-left")},{id:"view.orbitRight",scope:"stage",run:()=>e.shell.stepView("orbit-right")},{id:"view.orbitUp",scope:"stage",run:()=>e.shell.stepView("orbit-up")},{id:"view.orbitDown",scope:"stage",run:()=>e.shell.stepView("orbit-down")},{id:"view.opposite",scope:"stage",run:()=>e.shell.stepView("opposite")},{id:"view.rollLeft",scope:"stage",run:()=>e.shell.stepView("roll-left")},{id:"view.rollRight",scope:"stage",run:()=>e.shell.stepView("roll-right")},{id:"view.all",scope:"stage",run:()=>e.shell.frameAll()},{id:"view.zoomIn",scope:"stage",run:()=>e.shell.zoomView(1)},{id:"view.zoomOut",scope:"stage",run:()=>e.shell.zoomView(-1)},{id:"view.perspective",scope:"stage",run:()=>e.shell.setViewPreset("perspective")},{id:"view.projection",scope:"stage",run:()=>e.shell.toggleProjection()},{id:"view.camera",scope:"stage",run:()=>e.shell.toggleCameraView()},{id:"viewport.snapToFloor",scope:"stage",run:()=>i.snapSelectionToFloor()}]),c=()=>R("viewport");o.addEventListener("pointerdown",c),E();const d=t=>l.chordsFor("viewport.vertexSnapHold").some(n=>n.key===t.key.toLowerCase()),u=t=>{if(d(t)&&!t.metaKey&&!t.ctrlKey&&!t.repeat){if(z()!=="viewport"||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement)return;e.setVertexSnapActive(!0),i.activateVertexSnap()}},w=t=>{d(t)&&!t.metaKey&&!t.ctrlKey&&(e.setVertexSnapActive(!1),i.deactivateVertexSnap())};return window.addEventListener("keydown",u),window.addEventListener("keyup",w),()=>{v(),o.removeEventListener("pointerdown",c),window.removeEventListener("keydown",u),window.removeEventListener("keyup",w)}}function Y({stage:e}){return h.useEffect(()=>$(e.store,e.viewport,e.canvas),[e.store,e.viewport,e.canvas]),h.useEffect(()=>I(e.store),[e.store]),null}export{Y as StageKeyboardBinding};
@@ -0,0 +1 @@
1
+ import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as s}from"./index-nmcBqr7Y.js";import{iS as w,gZ as D,cL as L,aJ as v,ae as f,iT as R,gI as E,gJ as k,iU as V,iV as T,d1 as A,dF as C,dG as b,aI as N,iW as H,iX as I,cC as U,cD as F,aK as z,a0 as M,iY as $,dQ as W,iZ as G,i_ as _,a3 as q,i$ as J,j0 as Z,j1 as K,dH as Q}from"./index-CaG87ZF-.js";import{s as B,o as O,a as X}from"./object3d-document-session-registry-OjqzJ86S.js";import{r as Y}from"./index-CtzuWnCS.js";import{T as ee}from"./TransientHint-CgmkrmKF.js";import{d as te,b as se}from"./ViewportShadingMenu-Bdkc6jcd.js";import{V as j,s as oe}from"./StageHost-V_0opXFt.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-CinJrH5C.js";import"./three-state-wXRU3rLr.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";import"./standard-viewport-dressing-BZyuxyVl.js";import"./content-bounds-DKBD7nsv.js";import"./hierarchy-marks-C25dY2fR.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./preview-renderer-BrYNFV1p.js";import"./renderer-ownership-BovSEcLv.js";import"./live-mixers-B-bwLZ7c.js";import"./live-gesture-lock-DJbrjOqf.js";import"./model-inspection-MrJY0U_-.js";import"./three-viewport-presentation-CgO3eWJ-.js";import"./clip-planes-CnAI6DZn.js";import"./three-oYrcK5SQ.js";import"./component-instance-root-df4ofoOR.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./model-thumbnail-uk-2sblh.js";import"./studio-environment-yaKaHPxH.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./three-integration-CuAnYaTW.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-B_-BRrRD.js";import"./root-stacking-BEd9ZvxC.js";import"./viewport-door-DVkMQazS.js";import"./asset-preview-Cv7tfD98.js";import"./bitmap-label-Ct4k6ehY.js";import"./scene-framing-PVMqGU8h.js";import"./source-object3d-authoring-adapter-RmutT5Dt.js";import"./three-projection-core-jBJVt6O0.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./transport-strip-a9yLoPsI.js";import"./viewport-surface-status-D5kZtFW5.js";function h(t){return t.toFixed(2)}function re(){const t=w(),[o,r]=s.useState({x:0,y:0,z:0}),[i,n]=s.useState({x:0,y:0,z:0}),a=s.useRef(0);return s.useEffect(()=>{function u(){const m=t.cameraPosition,p=t.cameraTarget;r(l=>l.x!==m.x||l.y!==m.y||l.z!==m.z?{x:m.x,y:m.y,z:m.z}:l),n(l=>l.x!==p.x||l.y!==p.y||l.z!==p.z?{x:p.x,y:p.y,z:p.z}:l),a.current=requestAnimationFrame(u)}return a.current=requestAnimationFrame(u),()=>cancelAnimationFrame(a.current)},[t]),e.jsx(D,{variant:"overlay",border:!0,className:"vgai-camera-info vgai-chrome-island vgai-glass-island","data-island-scale":"compact",children:e.jsxs(L,{gap:8,align:"center",style:{whiteSpace:"nowrap"},children:[e.jsxs(v,{variant:"code",children:["Pos ",h(o.x)," ",h(o.y)," ",h(o.z)]}),e.jsxs(v,{variant:"code",children:["Target ",h(i.x)," ",h(i.y)," ",h(i.z)]})]})})}function ie(){const t=w(),[,o]=s.useState(0),r=R();return s.useEffect(()=>{const i=setInterval(()=>o(n=>n+1),200);return()=>clearInterval(i)},[]),e.jsxs("div",{className:"vgai-hud-overlay vgai-chrome-island vgai-glass-island","data-island-scale":"compact","data-hud-border":"strong",style:{position:"absolute",top:"var(--vgai-viewport-overlay-hud-top, 48px)",right:8,padding:"6px 10px",pointerEvents:"auto",fontSize:"var(--vgai-font-base)",color:f.content.primary,fontFamily:f.typography.mono,lineHeight:"16px"},children:[e.jsxs("div",{children:["FPS: ",t.fps.toFixed(0)]}),e.jsxs("div",{children:["Draw: ",t.drawCalls]}),e.jsxs("div",{children:["Tris: ",t.triangles.toLocaleString()]}),e.jsxs("div",{children:["Frame: ",t.frameTime.toFixed(1),"ms"]}),r!==null&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:["Heap: ",r.heapUsedMB===null?"n/a":`${r.heapUsedMB.toFixed(0)}MB`,r.heapLimitMB===null?"":` / ${r.heapLimitMB.toFixed(0)}MB`]}),e.jsxs("div",{children:["Mount epochs: ",r.mountEpochs]}),e.jsxs("div",{children:["Canvas: ",r.canvasMB.toFixed(1),"MB ×",r.canvases]}),r.textures!==void 0&&e.jsxs("div",{children:["GPU: ",r.textures," tex, ",r.geometries??0," geo",r.programs===void 0?"":`, ${r.programs} prog`]})]})]})}function ae({store:t,documentId:o}){s.useSyncExternalStore(t.shell.subscribe,t.shell.getSnapshot),s.useSyncExternalStore(E,k),s.useSyncExternalStore(V,T),s.useSyncExternalStore(B,O);const{adapter:r}=A(t.shell),i=X(o);s.useSyncExternalStore(i?.subscribe??le,i?.getSnapshot??ce),s.useSyncExternalStore(C,b);const n=N(o),a=H(),u=I(),m=a.viewName==="bar"||a.viewName==="menu",[p,l]=s.useState(null),y=()=>p?.closest(".vgai-dock-document-content")?.querySelector(':scope > .vgai-stage-bar [data-stage-bar-slot="display"]')??null,g=s.useId(),x=y(),d=x&&(x.dataset.owner===void 0||x.dataset.owner===g)?x:null,[,P]=s.useReducer(c=>c+1,0);s.useEffect(()=>{const c=y();c&&c.dataset.owner===void 0&&(c.dataset.owner=g),(c&&c.dataset.owner===g?c:null)!==d&&P()}),s.useEffect(()=>()=>{d?.dataset.owner===g&&delete d.dataset.owner},[d,g]);const S=e.jsxs(U,{label:"Viewport display",className:"vgai-viewport-toolbar vgai-viewport-toolbar-right vgai-stage-display",children:[a.viewName==="bar"&&i?e.jsx(j,{shell:t.shell,documentId:o,label:oe(i.viewport,i.projection(),"long")}):null,e.jsx(F,{text:`Grid: ${n?"On":"Off"}`,children:e.jsx(z,{"aria-label":"Toggle grid","aria-pressed":n,size:"comfortable",onClick:()=>W(o,!n),children:e.jsx(M,{icon:$,size:"md"})})}),e.jsx(pe,{store:t,word:u.helpers}),e.jsx(te,{mode:ne(i)??t.shadingMode,onChange:c=>i?i.setMode(c):t.setShadingMode(c),words:u.shading}),m?null:e.jsx(j,{shell:t.shell,documentId:o}),e.jsx(me,{adapter:r,store:t})]});return e.jsxs(e.Fragment,{children:[e.jsx("span",{ref:l,hidden:!0}),d?Y.createPortal(S,d):S]})}function ne(t){return t?.presentation().mode??null}const le=()=>()=>{},ce=()=>0,me=s.memo(function({adapter:o,store:r}){const[,i]=s.useReducer(a=>a+1,0);s.useEffect(()=>o.subscribe?.(i),[o]);const n=s.useMemo(()=>G(o),[o,r.shell.contentVersion]);return n===0?null:e.jsx(F,{text:`Open Light Explorer · ${n} ${n===1?"light":"lights"}`,children:e.jsx(z,{"aria-label":"Open Light Explorer",size:"comfortable",onClick:()=>q(J.lightExplorer.id),children:e.jsx(M,{icon:_,size:"md"})})})});function pe({store:t,word:o}){const r=[{key:"bounds",label:"Bounds"},{key:"lights",label:"Lights"},{key:"cameras",label:"Cameras"},{key:"colliders",label:"Colliders"},{key:"joints",label:"Joints"},{key:"particles",label:"Particle Emitters"},{key:"lod",label:"LOD"},{key:"audio",label:"Audio"},{key:"splines",label:"Splines"},{key:"navmesh",label:"NavMesh"},{key:"constraints",label:"Constraints"},{key:"reflectionProbes",label:"Reflection Probes"},{key:"triggerVolumes",label:"Trigger Volumes"},{key:"skeletons",label:"Skeletons"},{key:"weights",label:"Weights"},{key:"cursor",label:"3D Cursor"},{key:"empties",label:"Empties"}];return e.jsx(se,{label:"Helpers",...o!==void 0?{word:o}:{},master:{enabled:t.shell.showHelpers,onToggle:()=>t.shell.toggleHelpers()},choices:r.map(i=>({id:i.key,label:i.label,enabled:t.shell.helperVisibility[i.key],onToggle:()=>t.shell.toggleHelperType(i.key)}))})}function ft({store:t,documentId:o,stage:r,active:i,chrome:n}){const a=r?.store??t;s.useSyncExternalStore(t.shell.subscribe,t.shell.getShellSnapshot??t.shell.getSnapshot),s.useSyncExternalStore(a.shell.subscribe,a.shell.getShellSnapshot??a.shell.getSnapshot),s.useSyncExternalStore(V,T),s.useSyncExternalStore(B,O),s.useSyncExternalStore(E,k);const u=Z(t.shell,o,n),m=K(u);s.useSyncExternalStore(C,b,b);const p=Q(o).overlays.cameraReadout;return e.jsxs(e.Fragment,{children:[m?e.jsxs(e.Fragment,{children:[e.jsx(ae,{store:a,documentId:o}),p?e.jsx(re,{}):null]}):null,u.surface==="three"&&a.showStats&&e.jsx(ie,{}),i?e.jsx(ee,{}):null]})}export{ft as StageOverlaySet};
@@ -1 +1 @@
1
- import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{dl as Y,ah as j,w as Q,dm as V,dn as _}from"./index-BRJMIUK0.js";import{a as O}from"./content-bounds-BeuIXKYu.js";import{r as w}from"./collaboration-presence-BVIQuN1l.js";import{e6 as G,fd as W,d9 as H,S as U,_ as M,T as k,ej as J,eE as K,eF as ee,dp as te,fo as x,cW as oe,J as ne,a$ as re,N as ie,bX as ae,bV as se}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./hierarchy-marks-Cc_3lxw6.js";import"./workspace-arrangement-BdAlBwvd.js";function ce(){const e=document.querySelector(`.${V}`);return(e?getComputedStyle(e).getPropertyValue("--vgai-content-on-accent").trim():"")||_.color.content.onAccent}function Z(e,r){const o=e.image,n=o.getContext("2d");if(!n)return;n.clearRect(0,0,o.width,o.height),n.fillStyle=r.color,n.beginPath(),n.roundRect(2,2,o.width-4,o.height-4,16),n.fill(),n.fillStyle=ce(),n.font="600 22px system-ui, sans-serif",n.textAlign="center",n.textBaseline="middle";const c=r.kind==="agent"?" · AI":"";n.fillText(`${r.displayName}${c}`,o.width/2,o.height/2,238),e.needsUpdate=!0}function le(e){const r=new H(50,1,.2,1.4),o=new U(r),n=new M(e.color);o.setColors(n,n,n,n,n),o.name=`Collaboration camera: ${e.displayName}`,o.userData.editorOnly=!0;const c=document.createElement("canvas");c.width=256,c.height=64;const p=new k(c);p.colorSpace=J;const d=new K(new ee({map:p,depthTest:!1,transparent:!0}));return d.name=`Collaboration label: ${e.displayName}`,d.userData.editorOnly=!0,d.scale.set(1.8,.45,1),d.renderOrder=1e4,Z(p,e),{camera:r,helper:o,label:d,texture:p,signature:"",targetPosition:new x,targetQuaternion:new te,targetFov:50,initialized:!1}}function de(e,r){const o=r.presence.camera;if(!o)return;e.targetPosition.set(o.x,o.y,o.z);const n=new oe;n.position.copy(e.targetPosition),n.lookAt(o.targetX,o.targetY,o.targetZ),e.targetQuaternion.copy(n.quaternion),e.targetFov=o.fov,e.initialized||(e.initialized=!0,e.camera.position.copy(e.targetPosition),e.camera.quaternion.copy(e.targetQuaternion),e.camera.fov=e.targetFov);const c=`${r.displayName}|${r.kind}|${r.color}|${r.status}`;c!==e.signature&&(e.signature=c,Z(e.texture,r))}function pe(e,r){const o=1-Math.exp(-12*Math.max(0,r));e.camera.position.lerp(e.targetPosition,o),e.camera.quaternion.slerp(e.targetQuaternion,o),e.camera.fov+=(e.targetFov-e.camera.fov)*o,e.camera.updateProjectionMatrix(),e.camera.updateMatrixWorld(!0),e.helper.update(),e.label.position.copy(e.camera.position),e.label.position.y+=.55}function A(e){e.helper.removeFromParent(),e.label.removeFromParent(),e.helper.dispose(),e.texture.dispose(),e.label.material.dispose()}function ue(e,r){const o=O(e),n=new ne(o,new M(r));return n.name=`Collaboration selection: ${e.name||e.uuid}`,n.userData.editorOnly=!0,n.renderOrder=9999,n.material.depthTest=!1,{object:e,box:o,helper:n}}function b(e){e.helper.removeFromParent(),e.helper.geometry.dispose(),e.helper.material.dispose()}function me(e){if(!e||e.type!=="pointer-ray"||!["originX","originY","originZ","directionX","directionY","directionZ","length"].every(p=>typeof e[p]=="number"&&Number.isFinite(e[p])))return null;const o=new x(e.originX,e.originY,e.originZ),n=new x(e.directionX,e.directionY,e.directionZ),c=Math.min(1e3,Math.max(.1,e.length));return n.lengthSq()<1e-6?null:{origin:o,end:o.clone().add(n.normalize().multiplyScalar(c))}}function Le(e){const{scene:r,store:o,documentId:n,container:c,canvas:p,viewport:d,readVisibleCameraPose:R}=e,y=()=>Q()===n,v=()=>{if(!y())return;const i=R();w({camera:{x:i.position.x,y:i.position.y,z:i.position.z,targetX:i.target.x,targetY:i.target.y,targetZ:i.target.z,fov:i.fov}})};d.orbitControls.addEventListener("change",v);let C=!1;const I=i=>{const s=i.value===!0;C=s,y()&&w({gesture:s?{type:"transform",selection:[...o.shell.selectedEntityIds]}:null})};d.transformControls.addEventListener("dragging-changed",I);const S=new G,P=new W,z=i=>{if(C||i.buttons!==0||!y())return;const s=p.getBoundingClientRect();if(s.width<=0||s.height<=0)return;P.set((i.clientX-s.left)/s.width*2-1,-((i.clientY-s.top)/s.height)*2+1),S.setFromCamera(P,d.renderCamera);const l=S.ray,g=R();w({gesture:{type:"pointer-ray",originX:l.origin.x,originY:l.origin.y,originZ:l.origin.z,directionX:l.direction.x,directionY:l.direction.y,directionZ:l.direction.z,length:Math.max(2,g.position.distanceTo(g.target))}})},E=()=>{!C&&y()&&w({gesture:null})};c.addEventListener("pointermove",z),c.addEventListener("pointerleave",E),v();const m=new Map,u=new Map,f=new Map;let L=-1;const q=()=>{const i=Y();if(!i||i.sequence===L)return;L=i.sequence;const s=i.participants.filter(t=>t.participantId!==j&&t.presence.document===n),l=s.filter(t=>t.presence.camera),g=new Set(l.map(t=>t.participantId));for(const[t,a]of m)g.has(t)||(A(a),m.delete(t));for(const t of l){let a=m.get(t.participantId);a||(a=le(t),m.set(t.participantId,a),r.add(a.helper,a.label)),de(a,t)}const F=s.flatMap(t=>t.presence.selection.slice(0,20).map(a=>({key:`${t.participantId}:${a}`,objectId:a,color:t.color}))),B=new Set(F.map(t=>t.key));for(const[t,a]of u)B.has(t)||(b(a),u.delete(t));for(const t of F){const a=o.objectMap.get(t.objectId),h=u.get(t.key);if(!a){h&&(b(h),u.delete(t.key));continue}if(h?.object===a)continue;h&&b(h);const $=ue(a,t.color);u.set(t.key,$),r.add($.helper)}const X=s.flatMap(t=>{const a=me(t.presence.gesture);return a?[{participantId:t.participantId,color:t.color,ray:a}]:[]}),N=new Set(X.map(t=>t.participantId));for(const[t,a]of f)N.has(t)||(D(a),f.delete(t));for(const t of X){let a=f.get(t.participantId);a||(a=fe(t.color),f.set(t.participantId,a),r.add(a.line)),ge(a,t.ray)}},T=i=>{if(!y())return;const s=i.detail?.participantId;if(typeof s!="string")return;const l=Y()?.participants.find(g=>g.participantId===s)?.presence.camera;l&&o.shell.setCameraPose({x:l.x,y:l.y,z:l.z},{x:l.targetX,y:l.targetY,z:l.targetZ},l.fov)};return window.addEventListener("editor:collaboration-join",T),{reportCamera:v,syncMarkers:i=>{q();for(const s of m.values())pe(s,i);for(const s of u.values())O(s.object,s.box)},live:()=>m.size+u.size+f.size>0,dispose:()=>{d.orbitControls.removeEventListener("change",v),d.transformControls.removeEventListener("dragging-changed",I),c.removeEventListener("pointermove",z),c.removeEventListener("pointerleave",E),window.removeEventListener("editor:collaboration-join",T);for(const i of m.values())A(i);m.clear();for(const i of u.values())b(i);u.clear();for(const i of f.values())D(i);f.clear()}}}function fe(e){const r=new re(new Float32Array(6),3),o=new ie;o.setAttribute("position",r);const n=new ae({color:new M(e),depthTest:!1,transparent:!0,opacity:.9}),c=new se(o,n);return c.name="Collaboration pointer ray",c.userData.editorOnly=!0,c.renderOrder=10001,{line:c,positions:r}}function ge(e,r){e.positions.setXYZ(0,r.origin.x,r.origin.y,r.origin.z),e.positions.setXYZ(1,r.end.x,r.end.y,r.end.z),e.positions.needsUpdate=!0,e.line.geometry.computeBoundingSphere()}function D(e){e.line.removeFromParent(),e.line.geometry.dispose(),e.line.material.dispose()}export{Le as bindStagePresenceMarkers};
1
+ import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{d6 as Y,ai as j,w as Q,d7 as V,d8 as _}from"./index-CaG87ZF-.js";import{a as O}from"./content-bounds-DKBD7nsv.js";import{r as w}from"./collaboration-presence-BOS1t8wI.js";import{e6 as G,fd as W,d9 as H,S as U,_ as M,T as k,ej as J,eE as K,eF as ee,dp as te,fo as x,cW as oe,J as ne,a$ as re,N as ie,bX as ae,bV as se}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./hierarchy-marks-C25dY2fR.js";import"./workspace-arrangement-DIMM7ska.js";function ce(){const e=document.querySelector(`.${V}`);return(e?getComputedStyle(e).getPropertyValue("--vgai-content-on-accent").trim():"")||_.color.content.onAccent}function Z(e,r){const o=e.image,n=o.getContext("2d");if(!n)return;n.clearRect(0,0,o.width,o.height),n.fillStyle=r.color,n.beginPath(),n.roundRect(2,2,o.width-4,o.height-4,16),n.fill(),n.fillStyle=ce(),n.font="600 22px system-ui, sans-serif",n.textAlign="center",n.textBaseline="middle";const c=r.kind==="agent"?" · AI":"";n.fillText(`${r.displayName}${c}`,o.width/2,o.height/2,238),e.needsUpdate=!0}function le(e){const r=new H(50,1,.2,1.4),o=new U(r),n=new M(e.color);o.setColors(n,n,n,n,n),o.name=`Collaboration camera: ${e.displayName}`,o.userData.editorOnly=!0;const c=document.createElement("canvas");c.width=256,c.height=64;const p=new k(c);p.colorSpace=J;const d=new K(new ee({map:p,depthTest:!1,transparent:!0}));return d.name=`Collaboration label: ${e.displayName}`,d.userData.editorOnly=!0,d.scale.set(1.8,.45,1),d.renderOrder=1e4,Z(p,e),{camera:r,helper:o,label:d,texture:p,signature:"",targetPosition:new x,targetQuaternion:new te,targetFov:50,initialized:!1}}function de(e,r){const o=r.presence.camera;if(!o)return;e.targetPosition.set(o.x,o.y,o.z);const n=new oe;n.position.copy(e.targetPosition),n.lookAt(o.targetX,o.targetY,o.targetZ),e.targetQuaternion.copy(n.quaternion),e.targetFov=o.fov,e.initialized||(e.initialized=!0,e.camera.position.copy(e.targetPosition),e.camera.quaternion.copy(e.targetQuaternion),e.camera.fov=e.targetFov);const c=`${r.displayName}|${r.kind}|${r.color}|${r.status}`;c!==e.signature&&(e.signature=c,Z(e.texture,r))}function pe(e,r){const o=1-Math.exp(-12*Math.max(0,r));e.camera.position.lerp(e.targetPosition,o),e.camera.quaternion.slerp(e.targetQuaternion,o),e.camera.fov+=(e.targetFov-e.camera.fov)*o,e.camera.updateProjectionMatrix(),e.camera.updateMatrixWorld(!0),e.helper.update(),e.label.position.copy(e.camera.position),e.label.position.y+=.55}function A(e){e.helper.removeFromParent(),e.label.removeFromParent(),e.helper.dispose(),e.texture.dispose(),e.label.material.dispose()}function ue(e,r){const o=O(e),n=new ne(o,new M(r));return n.name=`Collaboration selection: ${e.name||e.uuid}`,n.userData.editorOnly=!0,n.renderOrder=9999,n.material.depthTest=!1,{object:e,box:o,helper:n}}function b(e){e.helper.removeFromParent(),e.helper.geometry.dispose(),e.helper.material.dispose()}function me(e){if(!e||e.type!=="pointer-ray"||!["originX","originY","originZ","directionX","directionY","directionZ","length"].every(p=>typeof e[p]=="number"&&Number.isFinite(e[p])))return null;const o=new x(e.originX,e.originY,e.originZ),n=new x(e.directionX,e.directionY,e.directionZ),c=Math.min(1e3,Math.max(.1,e.length));return n.lengthSq()<1e-6?null:{origin:o,end:o.clone().add(n.normalize().multiplyScalar(c))}}function Le(e){const{scene:r,store:o,documentId:n,container:c,canvas:p,viewport:d,readVisibleCameraPose:R}=e,y=()=>Q()===n,v=()=>{if(!y())return;const i=R();w({camera:{x:i.position.x,y:i.position.y,z:i.position.z,targetX:i.target.x,targetY:i.target.y,targetZ:i.target.z,fov:i.fov}})};d.orbitControls.addEventListener("change",v);let C=!1;const I=i=>{const s=i.value===!0;C=s,y()&&w({gesture:s?{type:"transform",selection:[...o.shell.selectedEntityIds]}:null})};d.transformControls.addEventListener("dragging-changed",I);const S=new G,P=new W,z=i=>{if(C||i.buttons!==0||!y())return;const s=p.getBoundingClientRect();if(s.width<=0||s.height<=0)return;P.set((i.clientX-s.left)/s.width*2-1,-((i.clientY-s.top)/s.height)*2+1),S.setFromCamera(P,d.renderCamera);const l=S.ray,g=R();w({gesture:{type:"pointer-ray",originX:l.origin.x,originY:l.origin.y,originZ:l.origin.z,directionX:l.direction.x,directionY:l.direction.y,directionZ:l.direction.z,length:Math.max(2,g.position.distanceTo(g.target))}})},E=()=>{!C&&y()&&w({gesture:null})};c.addEventListener("pointermove",z),c.addEventListener("pointerleave",E),v();const m=new Map,u=new Map,f=new Map;let L=-1;const q=()=>{const i=Y();if(!i||i.sequence===L)return;L=i.sequence;const s=i.participants.filter(t=>t.participantId!==j&&t.presence.document===n),l=s.filter(t=>t.presence.camera),g=new Set(l.map(t=>t.participantId));for(const[t,a]of m)g.has(t)||(A(a),m.delete(t));for(const t of l){let a=m.get(t.participantId);a||(a=le(t),m.set(t.participantId,a),r.add(a.helper,a.label)),de(a,t)}const F=s.flatMap(t=>t.presence.selection.slice(0,20).map(a=>({key:`${t.participantId}:${a}`,objectId:a,color:t.color}))),B=new Set(F.map(t=>t.key));for(const[t,a]of u)B.has(t)||(b(a),u.delete(t));for(const t of F){const a=o.objectMap.get(t.objectId),h=u.get(t.key);if(!a){h&&(b(h),u.delete(t.key));continue}if(h?.object===a)continue;h&&b(h);const $=ue(a,t.color);u.set(t.key,$),r.add($.helper)}const X=s.flatMap(t=>{const a=me(t.presence.gesture);return a?[{participantId:t.participantId,color:t.color,ray:a}]:[]}),N=new Set(X.map(t=>t.participantId));for(const[t,a]of f)N.has(t)||(D(a),f.delete(t));for(const t of X){let a=f.get(t.participantId);a||(a=fe(t.color),f.set(t.participantId,a),r.add(a.line)),ge(a,t.ray)}},T=i=>{if(!y())return;const s=i.detail?.participantId;if(typeof s!="string")return;const l=Y()?.participants.find(g=>g.participantId===s)?.presence.camera;l&&o.shell.setCameraPose({x:l.x,y:l.y,z:l.z},{x:l.targetX,y:l.targetY,z:l.targetZ},l.fov)};return window.addEventListener("editor:collaboration-join",T),{reportCamera:v,syncMarkers:i=>{q();for(const s of m.values())pe(s,i);for(const s of u.values())O(s.object,s.box)},live:()=>m.size+u.size+f.size>0,dispose:()=>{d.orbitControls.removeEventListener("change",v),d.transformControls.removeEventListener("dragging-changed",I),c.removeEventListener("pointermove",z),c.removeEventListener("pointerleave",E),window.removeEventListener("editor:collaboration-join",T);for(const i of m.values())A(i);m.clear();for(const i of u.values())b(i);u.clear();for(const i of f.values())D(i);f.clear()}}}function fe(e){const r=new re(new Float32Array(6),3),o=new ie;o.setAttribute("position",r);const n=new ae({color:new M(e),depthTest:!1,transparent:!0,opacity:.9}),c=new se(o,n);return c.name="Collaboration pointer ray",c.userData.editorOnly=!0,c.renderOrder=10001,{line:c,positions:r}}function ge(e,r){e.positions.setXYZ(0,r.origin.x,r.origin.y,r.origin.z),e.positions.setXYZ(1,r.end.x,r.end.y,r.end.z),e.positions.needsUpdate=!0,e.line.geometry.computeBoundingSphere()}function D(e){e.line.removeFromParent(),e.line.geometry.dispose(),e.line.material.dispose()}export{Le as bindStagePresenceMarkers};
@@ -0,0 +1 @@
1
+ import{a}from"./jsx-runtime-DPjLkJKQ.js";import{dC as n,dD as m,J as l,dE as f,e1 as c,dH as S}from"./index-CaG87ZF-.js";import{r as e}from"./index-nmcBqr7Y.js";import{t as T}from"./StageHost-V_0opXFt.js";import{t as u}from"./editor-shell-store-Bh1S7M54.js";import{T as h,a as g}from"./Toolbar-uLgsrB2z.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three-state-wXRU3rLr.js";import"./standard-viewport-dressing-BZyuxyVl.js";import"./content-bounds-DKBD7nsv.js";import"./hierarchy-marks-C25dY2fR.js";import"./workspace-arrangement-DIMM7ska.js";import"./three.core-3arARmh6.js";import"./editor-layers-B4oYfpj8.js";import"./environment-Dg-YaLsA.js";import"./three.module-BLhyNg0e.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-CqOoAowZ.js";import"./preview-renderer-BrYNFV1p.js";import"./renderer-ownership-BovSEcLv.js";import"./live-mixers-B-bwLZ7c.js";import"./live-gesture-lock-DJbrjOqf.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./three-contract-Dkt6PmWY.js";import"./model-inspection-MrJY0U_-.js";import"./three-viewport-presentation-CgO3eWJ-.js";import"./clip-planes-CnAI6DZn.js";import"./three-oYrcK5SQ.js";import"./component-instance-root-df4ofoOR.js";import"./entity-object-B_5Gc0Ky.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./model-thumbnail-uk-2sblh.js";import"./studio-environment-yaKaHPxH.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./three-integration-CuAnYaTW.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-B_-BRrRD.js";import"./root-stacking-BEd9ZvxC.js";import"./object3d-document-session-registry-OjqzJ86S.js";import"./viewport-door-DVkMQazS.js";import"./asset-preview-Cv7tfD98.js";import"./bitmap-label-Ct4k6ehY.js";import"./scene-framing-PVMqGU8h.js";import"./source-object3d-authoring-adapter-RmutT5Dt.js";import"./three-projection-core-jBJVt6O0.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./transport-strip-a9yLoPsI.js";import"./viewport-surface-status-D5kZtFW5.js";import"./transform-mode-request-BnKpgRUW.js";const s=new WeakMap;function x(r,t){if(r===null)return;const o=s.get(r)??new Set;if(s.set(r,o),o.has(t))return;o.add(t);const i={select:"select",transform:"combined",move:"translate",rotate:"rotate",scale:"scale"};r.shell.setTransformMode(i[S(t).interaction.bootTool])}function yr({documentId:r}){e.useSyncExternalStore(n,m,m);const t=l(),o=T(r),i=f(r);if(e.useEffect(()=>{o==="gizmo"&&x(i&&u(i),r)},[o,i,r]),o==="none")return null;const p=o==="modal"?c(r):null;return a.jsx(g,{store:i??t,...p?{door:p}:{}})}function Hr({documentId:r}){e.useSyncExternalStore(n,m,m);const t=l();return a.jsx(h,{store:f(r)??t})}export{Hr as ThreeStageTransformControls,yr as ThreeStageTransformTools};
@@ -1,4 +1,4 @@
1
- import{a as nt}from"./content-bounds-BeuIXKYu.js";import{EDITOR_LAYER as bt}from"./editor-layers-BDJnAAzj.js";import{loadEnvironmentImage as St}from"./environment-Dg-YaLsA.js";import{s as Y}from"./user-data-Bpj7diUS.js";import{P as J,S as Z}from"./three.module-BLhyNg0e.js";import{fv as xt,fw as kt,M as It}from"./index-BRJMIUK0.js";import{aE as q,bh as tt,j as Ft,I as Pt,co as Ct,db as Gt,fo as et,ap as Tt,e as Et,A as Rt,cP as _t,cj as d,_ as f,au as it,dw as rt,bi as Dt,aT as $t,c7 as Ot,c1 as z,ej as st,bg as At,aw as Bt,cx as Lt}from"./three.core-3arARmh6.js";let at=0;function zt(){at++}function se(){return at}const Ht=[.8,.5,-1],N=new f(1975600),U=new f(5004144);function lt(){const i=typeof document>"u"?null:document.querySelector("[data-vgai-palette]");if(!i)return{bottom:N.clone(),top:U.clone()};const t=getComputedStyle(i),o=document.createElement("canvas");o.width=o.height=1;const e=o.getContext("2d"),r=(s,u)=>{const p=t.getPropertyValue(s).trim();if(!e||!p||!CSS.supports("color",p))return u.clone();e.fillStyle=u.getStyle(),e.fillRect(0,0,1,1),e.fillStyle=t.getPropertyValue("--vgai-surface-shell").trim(),e.fillRect(0,0,1,1),e.fillStyle=p,e.fillRect(0,0,1,1);const[y,l,M]=e.getImageData(0,0,1,1).data;return new f().setRGB(y/255,l/255,M/255,st)},n=r("--vgai-surface-panel",N),a=r("--vgai-surface-raised",U),h=n.lerp(N,.25).lerp(new f(16777215),.03),c=a.lerp(U,.25).lerp(new f(16777215),.04);return{bottom:h,top:c}}function Nt(i){if(typeof document>"u"||typeof MutationObserver>"u")return()=>{};const t=document.querySelector("[data-vgai-palette]");if(!t)return()=>{};const o=new MutationObserver(()=>{i(),zt()});return o.observe(t,{attributes:!0,attributeFilter:["data-vgai-palette","data-vgai-material"]}),()=>o.disconnect()}function ct(i=lt()){const o=new Uint8Array(512),e=new f;for(let n=0;n<128;n++)e.copy(i.bottom).lerp(i.top,n/127).convertLinearToSRGB(),o[n*4]=Math.round(e.r*255),o[n*4+1]=Math.round(e.g*255),o[n*4+2]=Math.round(e.b*255),o[n*4+3]=255;const r=new it(o,1,128,rt);return r.colorSpace=st,r.magFilter=z,r.minFilter=z,r.needsUpdate=!0,r}function Ut(i){const t=nt(i);if(t.isEmpty())return{size:50,centre:[0,0]};const o=Math.max(t.max.x-t.min.x,t.max.z-t.min.z);return{size:Math.min(Math.max(Math.ceil(o/10)*10+20,50),1e3),centre:[(t.min.x+t.max.x)/2,(t.min.z+t.max.z)/2]}}function Wt(i){for(const t of[1,2,5,10])if(i/t<=60)return Math.round(i/t);return Math.round(i/10)}function ut(i,t){const o=t/2,e=o*.55,r=o;i.onBeforeCompile=n=>{n.uniforms.uGridFadeStart={value:e},n.uniforms.uGridFadeEnd={value:r},n.vertexShader=n.vertexShader.replace("#include <common>",`#include <common>
1
+ import{a as nt}from"./content-bounds-DKBD7nsv.js";import{EDITOR_LAYER as bt}from"./editor-layers-B4oYfpj8.js";import{loadEnvironmentImage as St}from"./environment-Dg-YaLsA.js";import{s as Y}from"./user-data-CqOoAowZ.js";import{P as J,S as Z}from"./three.module-BLhyNg0e.js";import{fl as xt,fm as kt,M as It}from"./index-CaG87ZF-.js";import{aE as q,bh as tt,j as Ft,I as Pt,co as Ct,db as Gt,fo as et,ap as Tt,e as Et,A as Rt,cP as _t,cj as d,_ as f,au as it,dw as rt,bi as Dt,aT as $t,c7 as Ot,c1 as z,ej as st,bg as At,aw as Bt,cx as Lt}from"./three.core-3arARmh6.js";let at=0;function zt(){at++}function se(){return at}const Ht=[.8,.5,-1],N=new f(1975600),U=new f(5004144);function lt(){const i=typeof document>"u"?null:document.querySelector("[data-vgai-palette]");if(!i)return{bottom:N.clone(),top:U.clone()};const t=getComputedStyle(i),o=document.createElement("canvas");o.width=o.height=1;const e=o.getContext("2d"),r=(s,u)=>{const p=t.getPropertyValue(s).trim();if(!e||!p||!CSS.supports("color",p))return u.clone();e.fillStyle=u.getStyle(),e.fillRect(0,0,1,1),e.fillStyle=t.getPropertyValue("--vgai-surface-shell").trim(),e.fillRect(0,0,1,1),e.fillStyle=p,e.fillRect(0,0,1,1);const[y,l,M]=e.getImageData(0,0,1,1).data;return new f().setRGB(y/255,l/255,M/255,st)},n=r("--vgai-surface-panel",N),a=r("--vgai-surface-raised",U),h=n.lerp(N,.25).lerp(new f(16777215),.03),c=a.lerp(U,.25).lerp(new f(16777215),.04);return{bottom:h,top:c}}function Nt(i){if(typeof document>"u"||typeof MutationObserver>"u")return()=>{};const t=document.querySelector("[data-vgai-palette]");if(!t)return()=>{};const o=new MutationObserver(()=>{i(),zt()});return o.observe(t,{attributes:!0,attributeFilter:["data-vgai-palette","data-vgai-material"]}),()=>o.disconnect()}function ct(i=lt()){const o=new Uint8Array(512),e=new f;for(let n=0;n<128;n++)e.copy(i.bottom).lerp(i.top,n/127).convertLinearToSRGB(),o[n*4]=Math.round(e.r*255),o[n*4+1]=Math.round(e.g*255),o[n*4+2]=Math.round(e.b*255),o[n*4+3]=255;const r=new it(o,1,128,rt);return r.colorSpace=st,r.magFilter=z,r.minFilter=z,r.needsUpdate=!0,r}function Ut(i){const t=nt(i);if(t.isEmpty())return{size:50,centre:[0,0]};const o=Math.max(t.max.x-t.min.x,t.max.z-t.min.z);return{size:Math.min(Math.max(Math.ceil(o/10)*10+20,50),1e3),centre:[(t.min.x+t.max.x)/2,(t.min.z+t.max.z)/2]}}function Wt(i){for(const t of[1,2,5,10])if(i/t<=60)return Math.round(i/t);return Math.round(i/10)}function ut(i,t){const o=t/2,e=o*.55,r=o;i.onBeforeCompile=n=>{n.uniforms.uGridFadeStart={value:e},n.uniforms.uGridFadeEnd={value:r},n.vertexShader=n.vertexShader.replace("#include <common>",`#include <common>
2
2
  varying vec2 vGridPlanePosition;`).replace("#include <begin_vertex>",`#include <begin_vertex>
3
3
  vGridPlanePosition = position.xz;`),n.fragmentShader=n.fragmentShader.replace("#include <common>",`#include <common>
4
4
  varying vec2 vGridPlanePosition;
@@ -1 +1 @@
1
- import{q as t}from"./index-BRJMIUK0.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 n="workspace.action",l=[{id:"state-watch",label:"Open State Watch",execute:()=>t().workspace.showUtility("tool:state-watch.utility")}];export{l as actions,n as point};
1
+ import{q as t}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";const n="workspace.action",l=[{id:"state-watch",label:"Open State Watch",execute:()=>t().workspace.showUtility("tool:state-watch.utility")}];export{l as actions,n as point};
@@ -1 +1 @@
1
- import{q as t,ae as e}from"./index-BRJMIUK0.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const l="workspace.menu",n={menu:"debug",items:[{id:"state-watch",label:"State Watch",testId:"menu-state-watch",disabled:()=>e()==null,execute:()=>t().workspace.showUtility("tool:state-watch.utility")}]};export{n as menu,l as point};
1
+ import{q as t,af as e}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";const l="workspace.menu",n={menu:"debug",items:[{id:"state-watch",label:"State Watch",testId:"menu-state-watch",disabled:()=>e()==null,execute:()=>t().workspace.showUtility("tool:state-watch.utility")}]};export{n as menu,l as point};
@@ -1 +1 @@
1
- import{a as n}from"./jsx-runtime-DPjLkJKQ.js";import{ae as S,ad as o,aK as B,Z as L,q as $,eO as H}from"./index-BRJMIUK0.js";import{r as d}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const F=250,M=200,P=500,z="stateWatchPins";function x(e){return JSON.stringify([e.provider,...e.path])}function y(e){return[e.provider,...e.path].join(".")}function D(){return $().projectLocalState.projectRootPath()??"__unscoped__"}function k(e){const t=$().projectLocalState.read(z);return Array.isArray(t)?t.filter(r=>typeof r?.provider=="string"&&Array.isArray(r.path)&&r.path.every(s=>typeof s=="string")):[]}function N(e,t){$().projectLocalState.write(z,t.map(r=>({provider:r.provider,path:[...r.path]})))}function j(e){return e!==null&&typeof e=="object"}function A(e){if(typeof e=="string")return`“${e}”`;if(typeof e=="number")return Number.isInteger(e)?String(e):e.toFixed(3);if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="bigint")return`${e}n`;if(typeof e=="function")return"[Function]";if(j(e))try{return Array.isArray(e)?`Array(${e.length})`:`Object(${Object.keys(e).length})`}catch{return"[Unreadable object]"}return String(e)}function _(e){try{return Object.entries(e)}catch{return[]}}function V(e,t){try{if(!Object.hasOwn(e,t.provider))return{available:!1,value:void 0};let r=e[t.provider];for(const s of t.path){if(!j(r)||!Object.hasOwn(r,s))return{available:!1,value:void 0};r=r[s]}return{available:!0,value:r}}catch{return{available:!1,value:void 0}}}function R(e,t,r,s,l,c){if(l.length>=P)return;const g=j(t)&&c.includes(t);if(!j(t)||g){const a={provider:e,path:r,value:g?"[Circular]":t};(y(a).toLowerCase().includes(s)||A(a.value).toLowerCase().includes(s))&&l.push(a);return}const p=[...c,t],m=_(t);if(m.length===0){const a={provider:e,path:r,value:t};y(a).toLowerCase().includes(s)&&l.push(a);return}for(const[a,v]of m)if(R(e,v,[...r,a],s,l,p),l.length>=P)return}const C={fontFamily:o.typography.mono,fontSize:11};function T({leaf:e,pinned:t,onTogglePin:r,depth:s=0}){const l=e.path.at(-1)??e.provider;return n.jsxs("div",{style:{...C,minHeight:22,display:"grid",gridTemplateColumns:"minmax(100px, 0.65fr) minmax(120px, 1fr) auto",alignItems:"center",gap:8,paddingLeft:8+s*14,paddingRight:8,borderBottom:`1px solid ${o.boundary.default}`},title:y(e),children:[n.jsx("span",{style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:l}),n.jsx("span",{style:{color:o.content.muted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:A(e.value)}),n.jsx(L,{type:"button",size:"compact",variant:t?"primary":"secondary","aria-pressed":t,title:t?`Remove ${y(e)} from watches`:`Watch ${y(e)}`,onClick:()=>r(e),children:t?"Pinned":"Pin"})]})}function W({provider:e,name:t,value:r,path:s,depth:l,ancestors:c,pinnedKeys:g,onTogglePin:p}){const m=j(r)&&c.includes(r),[a,v]=d.useState(l===0);if(!j(r)||m){const f={provider:e,path:s,value:m?"[Circular]":r};return n.jsx(T,{leaf:f,depth:l,pinned:g.has(x(f)),onTogglePin:p})}const h=_(r),b=h.slice(0,M);return n.jsxs("div",{children:[n.jsxs("button",{type:"button",onClick:()=>v(f=>!f),style:{...C,width:"100%",minHeight:22,display:"flex",alignItems:"center",gap:4,padding:`0 8px 0 ${8+l*14}px`,color:o.content.primary,background:"transparent",border:0,borderBottom:`1px solid ${o.boundary.default}`,textAlign:"left",cursor:"pointer"},children:[n.jsx("span",{style:{width:12,color:o.content.muted},children:n.jsx(H,{direction:a?"down":"right"})}),n.jsx("span",{children:t}),n.jsx("span",{style:{color:o.content.dim},children:Array.isArray(r)?`[${h.length}]`:`{${h.length}}`})]}),a&&b.map(([f,i])=>n.jsx(W,{provider:e,name:f,value:i,path:[...s,f],depth:l+1,ancestors:[...c,r],pinnedKeys:g,onTogglePin:p},f)),a&&h.length>b.length&&n.jsxs("div",{style:{...C,padding:`3px 8px 3px ${8+(l+1)*14}px`,color:o.content.dim},children:[h.length-b.length," more values — narrow with search"]})]})}function E(e){if(!e)return{providers:[],state:{},error:null};let t;try{t=e.providers()}catch(r){return{providers:[],state:{},error:r instanceof Error?r.message:String(r)}}try{return{providers:t,state:e.stateAll(),error:null}}catch(r){return{providers:t,state:{},error:r instanceof Error?r.message:String(r)}}}function K(){const e=D(),[t,r]=d.useState(()=>E(S())),[s,l]=d.useState(!1),[c,g]=d.useState(""),[p,m]=d.useState(()=>k());d.useEffect(()=>m(k()),[e]);const a=d.useCallback(()=>r(E(S())),[]);d.useEffect(()=>{if(a(),s)return;const i=window.setInterval(a,F);return()=>window.clearInterval(i)},[s,a]);const v=d.useMemo(()=>new Set(p.map(x)),[p]),h=d.useCallback(i=>{m(u=>{const w=x(i),I=u.some(O=>x(O)===w)?u.filter(O=>x(O)!==w):[...u,{provider:i.provider,path:[...i.path]}];return N(e,I),I})},[e]),b=d.useMemo(()=>{const i=c.trim().toLowerCase();if(!i)return[];const u=[];for(const w of t.providers)R(w.name,t.state[w.name],[],i,u,[]);return u},[c,t]);return S()?n.jsxs("div",{style:{height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:[n.jsxs("div",{style:{minHeight:34,display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx(B,{value:c,onChange:i=>g(i.target.value),placeholder:"Filter state paths or values…","aria-label":"Filter state watches",style:{width:240}}),n.jsx(L,{type:"button",size:"compact",onClick:()=>l(i=>!i),children:s?"Resume":"Pause"}),n.jsx(L,{type:"button",size:"compact",disabled:!s,onClick:a,children:"Refresh"}),n.jsxs("span",{style:{color:o.content.dim,fontSize:10},children:[t.providers.length," provider",t.providers.length===1?"":"s"," ·"," ",p.length," pinned",s?" · paused":""]}),t.error&&n.jsx("span",{style:{color:o.semantic.danger,fontSize:10},children:t.error})]}),n.jsxs("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:"minmax(280px, 1fr) minmax(240px, 0.65fr)"},children:[n.jsxs("section",{"aria-label":"Live state",style:{minWidth:0,overflow:"auto"},children:[c.trim()?b.length>0?b.map(i=>n.jsx(T,{leaf:i,pinned:v.has(x(i)),onTogglePin:h},x(i))):n.jsxs("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:["No state values match “",c.trim(),"”."]}):t.providers.map(i=>n.jsx(W,{provider:i.name,name:`${i.name} · ${i.tier}`,value:t.state[i.name],path:[],depth:0,ancestors:[],pinnedKeys:v,onTogglePin:h},i.name)),t.providers.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"The running game has not registered any state providers."})]}),n.jsxs("aside",{"aria-label":"Pinned watches",style:{minWidth:0,overflow:"auto",borderLeft:`1px solid ${o.boundary.default}`},children:[n.jsx("div",{style:{position:"sticky",top:0,zIndex:1,padding:"6px 8px",color:o.content.muted,background:o.surface.panel,borderBottom:`1px solid ${o.boundary.default}`,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Watches"}),p.map(i=>{const u=V(t.state,i);return n.jsxs("div",{style:{...C,display:"grid",gridTemplateColumns:"minmax(130px, 1fr) minmax(100px, 0.7fr) auto",alignItems:"center",gap:8,minHeight:24,padding:"2px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx("span",{title:y(i),style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:y(i)}),n.jsx("span",{style:{color:u.available?o.content.muted:o.content.dim,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.available?A(u.value):"unavailable"}),n.jsx(L,{type:"button",size:"compact",onClick:()=>h(i),children:"Remove"})]},x(i))}),p.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"Pin values from the live tree to keep them visible while you inspect the game."})]})]})]}):n.jsx("div",{style:{padding:12,color:o.content.muted,fontSize:11},children:"State Watch is available while a game with debug providers is running."})}const te="workspace.utility",re="State Watch",ne=19,ie=()=>S()!=null;function oe(){return n.jsx(K,{})}export{ie as available,oe as default,ne as order,te as point,re as title};
1
+ import{a as n}from"./jsx-runtime-DPjLkJKQ.js";import{af as S,ae as o,aL as B,$ as L,q as A,eE as H}from"./index-CaG87ZF-.js";import{r as d}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const F=250,M=200,P=500,z="stateWatchPins";function x(e){return JSON.stringify([e.provider,...e.path])}function y(e){return[e.provider,...e.path].join(".")}function D(){return A().projectLocalState.projectRootPath()??"__unscoped__"}function E(e){const t=A().projectLocalState.read(z);return Array.isArray(t)?t.filter(r=>typeof r?.provider=="string"&&Array.isArray(r.path)&&r.path.every(s=>typeof s=="string")):[]}function N(e,t){A().projectLocalState.write(z,t.map(r=>({provider:r.provider,path:[...r.path]})))}function j(e){return e!==null&&typeof e=="object"}function O(e){if(typeof e=="string")return`“${e}”`;if(typeof e=="number")return Number.isInteger(e)?String(e):e.toFixed(3);if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="bigint")return`${e}n`;if(typeof e=="function")return"[Function]";if(j(e))try{return Array.isArray(e)?`Array(${e.length})`:`Object(${Object.keys(e).length})`}catch{return"[Unreadable object]"}return String(e)}function _(e){try{return Object.entries(e)}catch{return[]}}function V(e,t){try{if(!Object.hasOwn(e,t.provider))return{available:!1,value:void 0};let r=e[t.provider];for(const s of t.path){if(!j(r)||!Object.hasOwn(r,s))return{available:!1,value:void 0};r=r[s]}return{available:!0,value:r}}catch{return{available:!1,value:void 0}}}function R(e,t,r,s,l,c){if(l.length>=P)return;const g=j(t)&&c.includes(t);if(!j(t)||g){const a={provider:e,path:r,value:g?"[Circular]":t};(y(a).toLowerCase().includes(s)||O(a.value).toLowerCase().includes(s))&&l.push(a);return}const p=[...c,t],m=_(t);if(m.length===0){const a={provider:e,path:r,value:t};y(a).toLowerCase().includes(s)&&l.push(a);return}for(const[a,v]of m)if(R(e,v,[...r,a],s,l,p),l.length>=P)return}const C={fontFamily:o.typography.mono,fontSize:11};function T({leaf:e,pinned:t,onTogglePin:r,depth:s=0}){const l=e.path.at(-1)??e.provider;return n.jsxs("div",{style:{...C,minHeight:22,display:"grid",gridTemplateColumns:"minmax(100px, 0.65fr) minmax(120px, 1fr) auto",alignItems:"center",gap:8,paddingLeft:8+s*14,paddingRight:8,borderBottom:`1px solid ${o.boundary.default}`},title:y(e),children:[n.jsx("span",{style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:l}),n.jsx("span",{style:{color:o.content.muted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:O(e.value)}),n.jsx(L,{type:"button",size:"compact",variant:t?"primary":"secondary","aria-pressed":t,title:t?`Remove ${y(e)} from watches`:`Watch ${y(e)}`,onClick:()=>r(e),children:t?"Pinned":"Pin"})]})}function W({provider:e,name:t,value:r,path:s,depth:l,ancestors:c,pinnedKeys:g,onTogglePin:p}){const m=j(r)&&c.includes(r),[a,v]=d.useState(l===0);if(!j(r)||m){const f={provider:e,path:s,value:m?"[Circular]":r};return n.jsx(T,{leaf:f,depth:l,pinned:g.has(x(f)),onTogglePin:p})}const h=_(r),b=h.slice(0,M);return n.jsxs("div",{children:[n.jsxs("button",{type:"button",onClick:()=>v(f=>!f),style:{...C,width:"100%",minHeight:22,display:"flex",alignItems:"center",gap:4,padding:`0 8px 0 ${8+l*14}px`,color:o.content.primary,background:"transparent",border:0,borderBottom:`1px solid ${o.boundary.default}`,textAlign:"left",cursor:"pointer"},children:[n.jsx("span",{style:{width:12,color:o.content.muted},children:n.jsx(H,{direction:a?"down":"right"})}),n.jsx("span",{children:t}),n.jsx("span",{style:{color:o.content.dim},children:Array.isArray(r)?`[${h.length}]`:`{${h.length}}`})]}),a&&b.map(([f,i])=>n.jsx(W,{provider:e,name:f,value:i,path:[...s,f],depth:l+1,ancestors:[...c,r],pinnedKeys:g,onTogglePin:p},f)),a&&h.length>b.length&&n.jsxs("div",{style:{...C,padding:`3px 8px 3px ${8+(l+1)*14}px`,color:o.content.dim},children:[h.length-b.length," more values — narrow with search"]})]})}function k(e){if(!e)return{providers:[],state:{},error:null};let t;try{t=e.providers()}catch(r){return{providers:[],state:{},error:r instanceof Error?r.message:String(r)}}try{return{providers:t,state:e.stateAll(),error:null}}catch(r){return{providers:t,state:{},error:r instanceof Error?r.message:String(r)}}}function U(){const e=D(),[t,r]=d.useState(()=>k(S())),[s,l]=d.useState(!1),[c,g]=d.useState(""),[p,m]=d.useState(()=>E());d.useEffect(()=>m(E()),[e]);const a=d.useCallback(()=>r(k(S())),[]);d.useEffect(()=>{if(a(),s)return;const i=window.setInterval(a,F);return()=>window.clearInterval(i)},[s,a]);const v=d.useMemo(()=>new Set(p.map(x)),[p]),h=d.useCallback(i=>{m(u=>{const w=x(i),I=u.some($=>x($)===w)?u.filter($=>x($)!==w):[...u,{provider:i.provider,path:[...i.path]}];return N(e,I),I})},[e]),b=d.useMemo(()=>{const i=c.trim().toLowerCase();if(!i)return[];const u=[];for(const w of t.providers)R(w.name,t.state[w.name],[],i,u,[]);return u},[c,t]);return S()?n.jsxs("div",{style:{height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:[n.jsxs("div",{style:{minHeight:34,display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx(B,{value:c,onChange:i=>g(i.target.value),placeholder:"Filter state paths or values…","aria-label":"Filter state watches",style:{width:240}}),n.jsx(L,{type:"button",size:"compact",onClick:()=>l(i=>!i),children:s?"Resume":"Pause"}),n.jsx(L,{type:"button",size:"compact",disabled:!s,onClick:a,children:"Refresh"}),n.jsxs("span",{style:{color:o.content.dim,fontSize:10},children:[t.providers.length," provider",t.providers.length===1?"":"s"," ·"," ",p.length," pinned",s?" · paused":""]}),t.error&&n.jsx("span",{style:{color:o.semantic.danger,fontSize:10},children:t.error})]}),n.jsxs("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:"minmax(280px, 1fr) minmax(240px, 0.65fr)"},children:[n.jsxs("section",{"aria-label":"Live state",style:{minWidth:0,overflow:"auto"},children:[c.trim()?b.length>0?b.map(i=>n.jsx(T,{leaf:i,pinned:v.has(x(i)),onTogglePin:h},x(i))):n.jsxs("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:["No state values match “",c.trim(),"”."]}):t.providers.map(i=>n.jsx(W,{provider:i.name,name:`${i.name} · ${i.tier}`,value:t.state[i.name],path:[],depth:0,ancestors:[],pinnedKeys:v,onTogglePin:h},i.name)),t.providers.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"The running game has not registered any state providers."})]}),n.jsxs("aside",{"aria-label":"Pinned watches",style:{minWidth:0,overflow:"auto",borderLeft:`1px solid ${o.boundary.default}`},children:[n.jsx("div",{style:{position:"sticky",top:0,zIndex:1,padding:"6px 8px",color:o.content.muted,background:o.surface.panel,borderBottom:`1px solid ${o.boundary.default}`,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Watches"}),p.map(i=>{const u=V(t.state,i);return n.jsxs("div",{style:{...C,display:"grid",gridTemplateColumns:"minmax(130px, 1fr) minmax(100px, 0.7fr) auto",alignItems:"center",gap:8,minHeight:24,padding:"2px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx("span",{title:y(i),style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:y(i)}),n.jsx("span",{style:{color:u.available?o.content.muted:o.content.dim,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.available?O(u.value):"unavailable"}),n.jsx(L,{type:"button",size:"compact",onClick:()=>h(i),children:"Remove"})]},x(i))}),p.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"Pin values from the live tree to keep them visible while you inspect the game."})]})]})]}):n.jsx("div",{style:{padding:12,color:o.content.muted,fontSize:11},children:"State Watch is available while a game with debug providers is running."})}const te="workspace.utility",re="State Watch",ne=19,ie=()=>S()!=null;function oe(){return n.jsx(U,{})}export{ie as available,oe as default,ne as order,te as point,re as title};
@@ -1 +1 @@
1
- import{r as T}from"./react-story-board-GaXqr03H.js";import{d as P}from"./bitmap-label-Ct4k6ehY.js";import{b6 as S,b7 as M,am as $,b8 as C,b9 as E,ba as j,bb as I,Q as v,bc as D,bd as R,be as O,au as L,an as U}from"./index-BRJMIUK0.js";import{m as k}from"./StoryPreviewMount-D2lg37et.js";import{s as B}from"./story-presentation-DMSYRWaz.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";async function ae(s,o){await S();const r=U(),c=M().filter(e=>$({modulePath:e.modulePath,regions:r}).medium==="dom"),t=document.createElement("canvas");t.width=s,t.height=o;const l=t.getContext("2d");if(!l)throw new Error("UI Canvas preview could not create a 2D output context.");if(c.length===0)return t.toDataURL("image/png");const m=B(c),d=L()?.config.resolution,u={width:d?.width??640,height:d?.height??400},h=new Map,f=new Map;for(const e of c){const n=m.resolve(e,u),[y]=await x(e.modulePath,[e],{width:n.width,height:n.height,capture:v,cropToContent:n.layout!=="fullscreen",layout:n.layout,transparent:!0});if(!y)throw new Error(`No preview rendered for ${e.id}.`);const g=new Image;g.src=`data:${y.mimeType};base64,${y.base64}`,await g.decode(),h.set(e.id,g),f.set(e.id,{width:g.naturalWidth,height:g.naturalHeight})}const i=T(c,m.index,e=>f.get(e.id)),a=Math.min(s/i.width,o/i.height),p=(s-i.width*a)/2,w=(o-i.height*a)/2;for(const[e,n]of i.layouts)l.drawImage(h.get(e),p+n.x*a,w+n.y*a,n.width*a,n.height*a);return t.toDataURL("image/png")}const A="#ffffff",H="#14171c";async function oe(s,o){const{modulePath:r,width:c,height:t}=o;if(!s)throw new Error(`No project is open, so '${r}' cannot be loaded. Open the project first.`);const l=await C(s),m=l.find(e=>e.modulePath===r);if(!m)throw new Error(`'${r}' is not a story file of this project. `+(l.length===0?"This project has no *.stories.tsx / *.stories.ts under src/.":`This project's story files are: ${l.map(e=>e.modulePath).join(", ")}.`));await E(await j(s));let d;try{d=await m.load()}catch(e){throw new Error(`'${r}' failed to import — ${e instanceof Error?e.message:String(e)}`)}const u=await I(r,d);if(!u.ok)throw new Error(u.error);const h=N(r,u.stories,o.story),f=o.capture??v,i=D("three"),a=o.captureThree??(i?(e,n)=>i(e,{...n,...o.camera===void 0?{}:{camera:o.camera},...o.pose===void 0?{}:{pose:o.pose}}):void 0);if((o.camera||o.pose)&&!a)throw new Error(`'${r}': camera/clip parameters need the three capture leg, which this environment cannot provide (no WebGL).`);const p=await x(r,h,{width:c,height:t,capture:f,...a?{captureThree:a}:{},requireThree:!!(o.camera||o.pose)}),w=await _(p,c,t);return{modulePath:r,width:c,height:t,variants:p,contactSheet:w}}function N(s,o,r){if(r===void 0)return o;const c=o.find(t=>t.name===r);if(!c)throw new Error(`'${s}' exports no story named '${r}'. It exports: ${o.map(t=>t.name).join(", ")}.`);return[c]}async function x(s,o,r){const{width:c,height:t,capture:l,captureThree:m,requireThree:d,cropToContent:u=!0}=r,h=document.createElement("div");h.setAttribute("style",`position:fixed;left:-20000px;top:0;width:${c}px;height:${t}px;overflow:hidden;contain:strict;pointer-events:none;background:${r.transparent?"transparent":A};`),document.body.appendChild(h);const f=[];try{for(const i of o){if(m){const e=await m(i.Component,{width:c,height:t}).catch(n=>(R(n)||console.warn(`[story-capture] three mount for '${i.name}' failed — falling back to the DOM leg:`,n instanceof Error?n.stack??n.message:String(n)),null));if(e===null&&d)throw new Error(`story '${i.name}' did not render on the three leg — --azimuth/--elevation/--distance/--clip/--time apply to three (R3F) stories only, and falling back to the DOM leg would silently ignore them. Narrow to a three story with --story <export>, or drop the camera/clip flags.`);if(e!==null){const n=e.indexOf(",");f.push({name:i.name,label:i.label,base64:n>=0?e.slice(n+1):e,mimeType:"image/png"});continue}}const a=document.createElement("div");a.setAttribute("style",`position:relative;width:${c}px;height:${t}px;overflow:hidden;`),r.layout==="padded"&&(a.style.padding="16px"),r.layout==="centered"&&(a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center"),a.style.boxSizing="border-box",h.replaceChildren(a);const p=await O(async()=>{const e=await k(a,s,i.name,i.Component);return await W(a),e});await p.settled();const w=p.result;try{const e=await l(h,{canvasFrame:p.frame,cropToContent:u,...r.transparent?{allowTransparent:!0}:{}});f.push({name:i.name,label:i.label,base64:e.base64,mimeType:"image/png"})}finally{w?.unmount(),await new Promise(e=>setTimeout(e,0)),a.remove()}}}finally{h.remove()}return f}async function W(s,o=10){for(let t=0;t<o&&!(s.childNodes.length>0);t++)await new Promise(l=>setTimeout(l,0));if(s.childNodes.length===0)return;const r=200,c=5e3;await new Promise(t=>{let l=null,m=!1;const d=new MutationObserver(()=>{l!==null&&clearTimeout(l),l=setTimeout(h,r)}),u=setTimeout(h,c);function h(){m||(m=!0,d.disconnect(),l!==null&&clearTimeout(l),clearTimeout(u),t())}d.observe(s,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),l=setTimeout(h,r)})}async function _(s,o,r,c={}){const t=Math.min(Math.max(1,s.length),Math.max(1,Math.floor(c.columns??2))),l=Math.max(1,Math.ceil(s.length/t)),m=[];for(const e of s){const n=new Image;n.src=`data:${e.mimeType};base64,${e.base64}`,await n.decode(),m.push(n)}const d=Math.max(1,...m.map(e=>e.naturalWidth),m.length?0:o),u=Math.max(1,...m.map(e=>e.naturalHeight),m.length?0:r),h=d*t,f=u*l,i=document.createElement("canvas");i.width=h,i.height=f;const a=i.getContext("2d");if(!a)throw new Error("Unable to create the story variant sheet.");a.fillStyle=H,a.fillRect(0,0,h,f);for(const[e,n]of s.entries()){const y=e%t*d,g=Math.floor(e/t)*u,b=m[e];a.drawImage(b,y+Math.floor((d-b.naturalWidth)/2),g+Math.floor((u-b.naturalHeight)/2)),c.labels!==!1&&P(a,n.name.toUpperCase(),y,g,d,u)}const p=i.toDataURL("image/png"),w=p.indexOf(",");return{width:h,height:f,base64:w>=0?p.slice(w+1):p,mimeType:"image/png"}}export{ae as captureDomStoryBoardPreview,oe as captureProjectStoryVariants,_ as composeVariantSheet,x as renderStoryVariants};
1
+ import{r as T}from"./react-story-board-Bx7qYytV.js";import{d as P}from"./bitmap-label-Ct4k6ehY.js";import{b7 as S,b8 as M,an as $,b9 as C,ba as E,bb as j,bc as I,Q as v,bd as D,be as R,bf as O,av as L,ao as U}from"./index-CaG87ZF-.js";import{m as k}from"./StoryPreviewMount-Di8uMovM.js";import{s as B}from"./story-presentation-BLXYPadR.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";async function ae(s,o){await S();const r=U(),c=M().filter(e=>$({modulePath:e.modulePath,regions:r}).medium==="dom"),t=document.createElement("canvas");t.width=s,t.height=o;const l=t.getContext("2d");if(!l)throw new Error("UI Canvas preview could not create a 2D output context.");if(c.length===0)return t.toDataURL("image/png");const m=B(c),d=L()?.config.resolution,u={width:d?.width??640,height:d?.height??400},h=new Map,f=new Map;for(const e of c){const n=m.resolve(e,u),[y]=await x(e.modulePath,[e],{width:n.width,height:n.height,capture:v,cropToContent:n.layout!=="fullscreen",layout:n.layout,transparent:!0});if(!y)throw new Error(`No preview rendered for ${e.id}.`);const g=new Image;g.src=`data:${y.mimeType};base64,${y.base64}`,await g.decode(),h.set(e.id,g),f.set(e.id,{width:g.naturalWidth,height:g.naturalHeight})}const i=T(c,m.index,e=>f.get(e.id)),a=Math.min(s/i.width,o/i.height),p=(s-i.width*a)/2,w=(o-i.height*a)/2;for(const[e,n]of i.layouts)l.drawImage(h.get(e),p+n.x*a,w+n.y*a,n.width*a,n.height*a);return t.toDataURL("image/png")}const A="#ffffff",H="#14171c";async function oe(s,o){const{modulePath:r,width:c,height:t}=o;if(!s)throw new Error(`No project is open, so '${r}' cannot be loaded. Open the project first.`);const l=await C(s),m=l.find(e=>e.modulePath===r);if(!m)throw new Error(`'${r}' is not a story file of this project. `+(l.length===0?"This project has no *.stories.tsx / *.stories.ts under src/.":`This project's story files are: ${l.map(e=>e.modulePath).join(", ")}.`));await E(await j(s));let d;try{d=await m.load()}catch(e){throw new Error(`'${r}' failed to import — ${e instanceof Error?e.message:String(e)}`)}const u=await I(r,d);if(!u.ok)throw new Error(u.error);const h=N(r,u.stories,o.story),f=o.capture??v,i=D("three"),a=o.captureThree??(i?(e,n)=>i(e,{...n,...o.camera===void 0?{}:{camera:o.camera},...o.pose===void 0?{}:{pose:o.pose}}):void 0);if((o.camera||o.pose)&&!a)throw new Error(`'${r}': camera/clip parameters need the three capture leg, which this environment cannot provide (no WebGL).`);const p=await x(r,h,{width:c,height:t,capture:f,...a?{captureThree:a}:{},requireThree:!!(o.camera||o.pose)}),w=await _(p,c,t);return{modulePath:r,width:c,height:t,variants:p,contactSheet:w}}function N(s,o,r){if(r===void 0)return o;const c=o.find(t=>t.name===r);if(!c)throw new Error(`'${s}' exports no story named '${r}'. It exports: ${o.map(t=>t.name).join(", ")}.`);return[c]}async function x(s,o,r){const{width:c,height:t,capture:l,captureThree:m,requireThree:d,cropToContent:u=!0}=r,h=document.createElement("div");h.setAttribute("style",`position:fixed;left:-20000px;top:0;width:${c}px;height:${t}px;overflow:hidden;contain:strict;pointer-events:none;background:${r.transparent?"transparent":A};`),document.body.appendChild(h);const f=[];try{for(const i of o){if(m){const e=await m(i.Component,{width:c,height:t}).catch(n=>(R(n)||console.warn(`[story-capture] three mount for '${i.name}' failed — falling back to the DOM leg:`,n instanceof Error?n.stack??n.message:String(n)),null));if(e===null&&d)throw new Error(`story '${i.name}' did not render on the three leg — --azimuth/--elevation/--distance/--clip/--time apply to three (R3F) stories only, and falling back to the DOM leg would silently ignore them. Narrow to a three story with --story <export>, or drop the camera/clip flags.`);if(e!==null){const n=e.indexOf(",");f.push({name:i.name,label:i.label,base64:n>=0?e.slice(n+1):e,mimeType:"image/png"});continue}}const a=document.createElement("div");a.setAttribute("style",`position:relative;width:${c}px;height:${t}px;overflow:hidden;`),r.layout==="padded"&&(a.style.padding="16px"),r.layout==="centered"&&(a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center"),a.style.boxSizing="border-box",h.replaceChildren(a);const p=await O(async()=>{const e=await k(a,s,i.name,i.Component);return await W(a),e});await p.settled();const w=p.result;try{const e=await l(h,{canvasFrame:p.frame,cropToContent:u,...r.transparent?{allowTransparent:!0}:{}});f.push({name:i.name,label:i.label,base64:e.base64,mimeType:"image/png"})}finally{w?.unmount(),await new Promise(e=>setTimeout(e,0)),a.remove()}}}finally{h.remove()}return f}async function W(s,o=10){for(let t=0;t<o&&!(s.childNodes.length>0);t++)await new Promise(l=>setTimeout(l,0));if(s.childNodes.length===0)return;const r=200,c=5e3;await new Promise(t=>{let l=null,m=!1;const d=new MutationObserver(()=>{l!==null&&clearTimeout(l),l=setTimeout(h,r)}),u=setTimeout(h,c);function h(){m||(m=!0,d.disconnect(),l!==null&&clearTimeout(l),clearTimeout(u),t())}d.observe(s,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),l=setTimeout(h,r)})}async function _(s,o,r,c={}){const t=Math.min(Math.max(1,s.length),Math.max(1,Math.floor(c.columns??2))),l=Math.max(1,Math.ceil(s.length/t)),m=[];for(const e of s){const n=new Image;n.src=`data:${e.mimeType};base64,${e.base64}`,await n.decode(),m.push(n)}const d=Math.max(1,...m.map(e=>e.naturalWidth),m.length?0:o),u=Math.max(1,...m.map(e=>e.naturalHeight),m.length?0:r),h=d*t,f=u*l,i=document.createElement("canvas");i.width=h,i.height=f;const a=i.getContext("2d");if(!a)throw new Error("Unable to create the story variant sheet.");a.fillStyle=H,a.fillRect(0,0,h,f);for(const[e,n]of s.entries()){const y=e%t*d,g=Math.floor(e/t)*u,b=m[e];a.drawImage(b,y+Math.floor((d-b.naturalWidth)/2),g+Math.floor((u-b.naturalHeight)/2)),c.labels!==!1&&P(a,n.name.toUpperCase(),y,g,d,u)}const p=i.toDataURL("image/png"),w=p.indexOf(",");return{width:h,height:f,base64:w>=0?p.slice(w+1):p,mimeType:"image/png"}}export{ae as captureDomStoryBoardPreview,oe as captureProjectStoryVariants,_ as composeVariantSheet,x as renderStoryVariants};