@volter/game-editor 0.5.86 → 0.5.88

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 (298) hide show
  1. package/BUNDLED_NOTICES +22 -22
  2. package/catalog/entries/blender.json +2 -2
  3. package/catalog/entries/music.json +2 -2
  4. package/dist/.vite/manifest.json +2147 -2147
  5. package/dist/assets/{AssetBudgetPanel-Cz9Gmn90.js → AssetBudgetPanel-CdkS1Xs4.js} +3 -3
  6. package/dist/assets/{AudioViewer-DNVS05h0.js → AudioViewer-RsskTkfZ.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-TIOZa5VD.js → CanvasBoardDocument-zY4MnB9B.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-DH9S3AK2.js → CanvasSceneViewport-FWTLV2go.js} +1 -1
  9. package/dist/assets/{ColorInput-B4TJB4j0.js → ColorInput-Bq0dzTgw.js} +1 -1
  10. package/dist/assets/{EntityModelDocument-DInLudyi.js → EntityModelDocument-Csvwz5Rk.js} +1 -1
  11. package/dist/assets/{EnvironmentAssetDocument-Cn2EOcUP.js → EnvironmentAssetDocument-BM9If9eg.js} +1 -1
  12. package/dist/assets/{GameplaySessionTimeline-BAGmiZ7l.js → GameplaySessionTimeline-g31tocs6.js} +1 -1
  13. package/dist/assets/{ImageViewer-zBabH42e.js → ImageViewer-DECPuMtz.js} +1 -1
  14. package/dist/assets/InspectorObjectPreview-TAousKDF.js +1 -0
  15. package/dist/assets/{JsonAssetDocument-Bvi2OLcK.js → JsonAssetDocument-CZa7HazC.js} +1 -1
  16. package/dist/assets/{LiveModuleDocument-BtkoQot2.js → LiveModuleDocument-DXkBfp08.js} +1 -1
  17. package/dist/assets/{LutAssetDocument-DCpGUoFg.js → LutAssetDocument-Bqzb8J6J.js} +1 -1
  18. package/dist/assets/{ModelAssetDocument-BoEdmK4x.js → ModelAssetDocument-BtaHlPgk.js} +1 -1
  19. package/dist/assets/{NonThreeAuthoringBootstrap-DLxobtKG.js → NonThreeAuthoringBootstrap-TZ7JrDra.js} +1 -1
  20. package/dist/assets/{Object3DDocumentToolbar-C7wA4SZl.js → Object3DDocumentToolbar-Bdsl73Fq.js} +1 -1
  21. package/dist/assets/Object3DDocumentViewport-BC8oKgYP.js +2 -0
  22. package/dist/assets/{Object3DPreview-7dkQ-ozJ.js → Object3DPreview-DqDdGnuH.js} +1 -1
  23. package/dist/assets/{OnlineAssetDetail-y08xFDbC.js → OnlineAssetDetail-CULtv9vV.js} +1 -1
  24. package/dist/assets/{PlayBar-D6qMfUOT.js → PlayBar-BPGB1NqU.js} +1 -1
  25. package/dist/assets/{QuarksAssetDocument-C5AgnVlm.js → QuarksAssetDocument-Bjx23ycV.js} +1 -1
  26. package/dist/assets/{ReactCanvasControls-DBSKf04T.js → ReactCanvasControls-CCecL7nm.js} +1 -1
  27. package/dist/assets/{RootSelectionOverlay-BLUee6Us.js → RootSelectionOverlay-CXUguLVy.js} +1 -1
  28. package/dist/assets/{ShaderAssetDocument-B0SkrWeD.js → ShaderAssetDocument-U0fsOnKS.js} +1 -1
  29. package/dist/assets/{ShadowEditor-m7LkQXyA.js → ShadowEditor-BsN8F4iX.js} +1 -1
  30. package/dist/assets/{SourceAssetViewer-DSqt4J4X.js → SourceAssetViewer-CU1CZuNN.js} +1 -1
  31. package/dist/assets/StageHost-xZVAh3cY.js +2 -0
  32. package/dist/assets/{StoryPreviewMount-XHCeJVUK.js → StoryPreviewMount-oz6W1PJD.js} +1 -1
  33. package/dist/assets/{ThreeBoardDocument-1h8GKR-k.js → ThreeBoardDocument-DqiAAttG.js} +2 -2
  34. package/dist/assets/{ThreeIsolationSceneContent-B2BM5lGT.js → ThreeIsolationSceneContent-cJKCf-rJ.js} +1 -1
  35. package/dist/assets/{ToolObject3DPreview-DhhnWveX.js → ToolObject3DPreview-D5goc207.js} +1 -1
  36. package/dist/assets/{Toolbar-DUdd7Vku.js → Toolbar-DDD3tB-R.js} +1 -1
  37. package/dist/assets/{TransientHint-BVaIXyI6.js → TransientHint-Cb03grQX.js} +1 -1
  38. package/dist/assets/{VideoViewer-8wjwSQob.js → VideoViewer-DEnQ6g8S.js} +1 -1
  39. package/dist/assets/{ViewportShadingMenu-BxEJ1oZ3.js → ViewportShadingMenu-BWT6-t89.js} +1 -1
  40. package/dist/assets/{active-ingest-CR8Om_4L.js → active-ingest-DGO0y3XU.js} +2 -2
  41. package/dist/assets/{animation-clock-C8xuRYtY.js → animation-clock-BRlxJ_wI.js} +1 -1
  42. package/dist/assets/{animation-mixers.service-Dhc_pHj0.js → animation-mixers.service-BJeRFTqk.js} +1 -1
  43. package/dist/assets/{animation-timeline.utility-ByBlEQbw.js → animation-timeline.utility-B1_tajB0.js} +1 -1
  44. package/dist/assets/{asset-budget-asset.menu-tLAS-J30.js → asset-budget-asset.menu-9uYJcukv.js} +1 -1
  45. package/dist/assets/{asset-budget.action-D0xcnGHW.js → asset-budget.action-Dyc_oXwX.js} +1 -1
  46. package/dist/assets/{asset-budget.document-B1v93lAS.js → asset-budget.document-BHOgaNVy.js} +1 -1
  47. package/dist/assets/{asset-budget.menu-C8cMC0S7.js → asset-budget.menu-C7sJPvT9.js} +1 -1
  48. package/dist/assets/{asset-editor-persistence-l5bSUF0E.js → asset-editor-persistence-BOiFbzua.js} +1 -1
  49. package/dist/assets/{asset-loaders-DrK7b3Yn.js → asset-loaders-CWOC8ifM.js} +1 -1
  50. package/dist/assets/{asset-preview-h_hjp_z2.js → asset-preview-B7JSYjLt.js} +1 -1
  51. package/dist/assets/{audio-unlock.service-ChDgJk4k.js → audio-unlock.service-DfscDf4E.js} +1 -1
  52. package/dist/assets/{audio.utility-BkS-afdu.js → audio.utility-OzIVkHj0.js} +1 -1
  53. package/dist/assets/autoplay.service-CvJv65oc.js +1 -0
  54. package/dist/assets/{babylon-authoring-adapter-VKwBs6dc.js → babylon-authoring-adapter-B7iXKjWx.js} +1 -1
  55. package/dist/assets/{binding-resolver-5udpegkM.js → binding-resolver-C532IojL.js} +2 -2
  56. package/dist/assets/{blender-emscripten-engine-3RrRUwov.js → blender-emscripten-engine-CbHHZuUu.js} +1 -1
  57. package/dist/assets/{blender-node-editor.document-DjWUfDIp.js → blender-node-editor.document-M5YEd_rw.js} +1 -1
  58. package/dist/assets/{blender-properties-tab-DSEPtbl-.js → blender-properties-tab-BtXNKlTw.js} +1 -1
  59. package/dist/assets/{blender-runtime-host-h9lSshSs.js → blender-runtime-host-m4O1J_bJ.js} +2 -2
  60. package/dist/assets/{blender-runtime-skin-y_wwrS0i.js → blender-runtime-skin-BGW3tNPx.js} +2 -2
  61. package/dist/assets/{blender-runtime.document-B7ZMqGJk.js → blender-runtime.document-BthTkd84.js} +1 -1
  62. package/dist/assets/{blender-screenshot.menu-BnLFgrq6.js → blender-screenshot.menu-Bb1rROUA.js} +1 -1
  63. package/dist/assets/{blender-timeline.document-CZnj7Tkm.js → blender-timeline.document-Bhb3FDyY.js} +1 -1
  64. package/dist/assets/{blender-uv-editor.document-CsDdrijK.js → blender-uv-editor.document-BrJlFS_x.js} +1 -1
  65. package/dist/assets/{blender-version.status-M7FZzsVm.js → blender-version.status-D4dSpBgs.js} +1 -1
  66. package/dist/assets/{blender-wali-engine-DGwF1KiV.js → blender-wali-engine-uH9q2l3f.js} +1 -1
  67. package/dist/assets/{blender.command-BhldgwJg.js → blender.command-CgmxI4HC.js} +1 -1
  68. package/dist/assets/{board-guides-B8EV-uXc.js → board-guides-BbxdQwDR.js} +1 -1
  69. package/dist/assets/{bridge.command-CZuqqoDd.js → bridge.command-C6a1qW8i.js} +3 -3
  70. package/dist/assets/{browserAll-CZk4fv-f.js → browserAll-D-uA9_gL.js} +1 -1
  71. package/dist/assets/{build-player.document-D7z4ZxMc.js → build-player.document-BbPISXDt.js} +1 -1
  72. package/dist/assets/{build-profiles.document-BYX1iirt.js → build-profiles.document-ZoiwjncN.js} +1 -1
  73. package/dist/assets/{build-progress.status-BMSbOsd2.js → build-progress.status-O5IcCNy5.js} +1 -1
  74. package/dist/assets/{build-session-BiNA1pwa.js → build-session-40AAGBMb.js} +1 -1
  75. package/dist/assets/{build.action-BxUirWPy.js → build.action-mVthKzS3.js} +1 -1
  76. package/dist/assets/{build.command-XOu5w0Fm.js → build.command-DNK4YWMI.js} +1 -1
  77. package/dist/assets/{build.header-BI5bOKkD.js → build.header-BRGOAcow.js} +1 -1
  78. package/dist/assets/{build.menu-C-3Xs3_d.js → build.menu-CR9xGYQS.js} +1 -1
  79. package/dist/assets/{build.service-BqgWqVhi.js → build.service-BQeB_lp_.js} +1 -1
  80. package/dist/assets/{camera-D3ubsp35.js → camera-Cp-u0aai.js} +1 -1
  81. package/dist/assets/{camera-runtime.inspector-DLQrf88i.js → camera-runtime.inspector-Bhjsk4WC.js} +1 -1
  82. package/dist/assets/{canvas-design-mount-59p9JzRq.js → canvas-design-mount-5hkqj04A.js} +3 -3
  83. package/dist/assets/{canvas-entry-runtime-DwrywTc9.js → canvas-entry-runtime-DpLvnmdF.js} +2 -2
  84. package/dist/assets/{canvas-preview-frames-Bq4sE7ij.js → canvas-preview-frames-DN9sJFYk.js} +1 -1
  85. package/dist/assets/{canvas-story-capture.service-vRpZ5fZG.js → canvas-story-capture.service-CMaecfgo.js} +2 -2
  86. package/dist/assets/{capability-coverage-CXl6Odkw.js → capability-coverage-C0oxesm2.js} +1 -1
  87. package/dist/assets/{collaboration-presence-DY1ZefcY.js → collaboration-presence-L-M4ah4j.js} +1 -1
  88. package/dist/assets/{collider-BjMOFzaq.js → collider-Zw2yun1J.js} +1 -1
  89. package/dist/assets/{component-board.service-BqmpwVOE.js → component-board.service-BIqVblfH.js} +2 -2
  90. package/dist/assets/{component-board.service-CoDU8yTI.js → component-board.service-C1W04t0E.js} +2 -2
  91. package/dist/assets/{component-board.service-CuMBoOJm.js → component-board.service-ZrEOuEst.js} +2 -2
  92. package/dist/assets/{component-contracts.service-BPl-U3eP.js → component-contracts.service-CeHzENw7.js} +1 -1
  93. package/dist/assets/{component-instance-root-BuWShEF6.js → component-instance-root-BkqCh7zR.js} +1 -1
  94. package/dist/assets/{component-verbs.command-DTyeqzgR.js → component-verbs.command-HQH0Ap8h.js} +1 -1
  95. package/dist/assets/{component-verbs.service-BFqJw7Kt.js → component-verbs.service-xsDTHLNn.js} +1 -1
  96. package/dist/assets/{config-DhflY5Yu.js → config-CdUB8Mjo.js} +2 -2
  97. package/dist/assets/{configurations-C2Betud5.js → configurations-BNgpfZe6.js} +1 -1
  98. package/dist/assets/{connection.status-BQMFuCO7.js → connection.status-DtLcYtCz.js} +1 -1
  99. package/dist/assets/{constraints.inspector-CQVGVM3B.js → constraints.inspector-D9KBohgl.js} +1 -1
  100. package/dist/assets/{content-bounds-W1659ao-.js → content-bounds-Chky2vxw.js} +1 -1
  101. package/dist/assets/{contract-system-adapters-BFftL7th.js → contract-system-adapters-DVHYkFup.js} +1 -1
  102. package/dist/assets/{coverage.service-C1yq7VkJ.js → coverage.service-C-W0KXwb.js} +1 -1
  103. package/dist/assets/{create-runtime-DFEYelas.js → create-runtime-C37oguj9.js} +1 -1
  104. package/dist/assets/{curve-DwaGEjxR.js → curve-Dib5dMOW.js} +1 -1
  105. package/dist/assets/{data-asset-1qJhAjYJ.js → data-asset-BAudA4ti.js} +1 -1
  106. package/dist/assets/{data-ref-D2F_5czg.js → data-ref-3Yu9wKge.js} +1 -1
  107. package/dist/assets/{debug-bridge-BWLCtg3j.js → debug-bridge-CZX-ljqR.js} +1 -1
  108. package/dist/assets/{debug-registry-BEwTz1TC.js → debug-registry-DdwtMFYW.js} +1 -1
  109. package/dist/assets/{deferred-ingest-play-CSLZoAGE.js → deferred-ingest-play-CaqbqSLz.js} +2 -2
  110. package/dist/assets/{design-time-canvas-mount-B_N9CT5I.js → design-time-canvas-mount-GXYJOMQI.js} +2 -2
  111. package/dist/assets/{design-time-layers-B7vrNiQ1.js → design-time-layers-BSKHk449.js} +1 -1
  112. package/dist/assets/{design-time-mount.service-BasZNarL.js → design-time-mount.service-40jouQYZ.js} +2 -2
  113. package/dist/assets/{design-time-mount.service-DNLaET1-.js → design-time-mount.service-BnZgRMn_.js} +2 -2
  114. package/dist/assets/{design-time-react-mount-B_-FPtL9.js → design-time-react-mount-CegVFpmK.js} +1 -1
  115. package/dist/assets/{document-preview-three-CWOYkdUu.js → document-preview-three-CU0bwSvk.js} +1 -1
  116. package/dist/assets/{dom-authoring-adapter-Dskjm96_.js → dom-authoring-adapter-BEhHdbiU.js} +1 -1
  117. package/dist/assets/{draco3d-C48VdmnM.js → draco3d-BLVRrC63.js} +1 -1
  118. package/dist/assets/{edit-mode-audio.service-BODX7lSQ.js → edit-mode-audio.service-1mAiEWvL.js} +1 -1
  119. package/dist/assets/{edit-mode-authoring-Bwbko9HU.js → edit-mode-authoring-C4Rf-CAq.js} +1 -1
  120. package/dist/assets/{edit-mode-networking.service-I5--hRQ5.js → edit-mode-networking.service-QkThudAU.js} +1 -1
  121. package/dist/assets/{editor-api-RuoKAbJe.js → editor-api-p33H-aUm.js} +1 -1
  122. package/dist/assets/{editor-layers-CtzgRn6E.js → editor-layers-IL32ACAu.js} +1 -1
  123. package/dist/assets/{editor-shell-store-CdiZaE3q.js → editor-shell-store-bGLFKgrE.js} +1 -1
  124. package/dist/assets/{entity-object-Dd555Jkc.js → entity-object--sePwyoN.js} +1 -1
  125. package/dist/assets/{extend-ELdxJfF3.js → extend-DqjQxfSo.js} +1 -1
  126. package/dist/assets/{fork-menu-Br45so5D.js → fork-menu-DRl1kdaG.js} +1 -1
  127. package/dist/assets/{frame-debugger-store-QU6kN-iA.js → frame-debugger-store-BfMVf3Pr.js} +1 -1
  128. package/dist/assets/{game-contract-seams-BSaovR7J.js → game-contract-seams-CMu6U1FR.js} +1 -1
  129. package/dist/assets/{game-css-scope-transform-voctdSMR.js → game-css-scope-transform-BadWLPK_.js} +1 -1
  130. package/dist/assets/{game-document.service-BhrYDH1e.js → game-document.service-CEPSJY5u.js} +1 -1
  131. package/dist/assets/{game-eval.command-ByisNZEW.js → game-eval.command-Dh4sZYRW.js} +1 -1
  132. package/dist/assets/{game-module-access-CAOIdtrL.js → game-module-access-CMF-Wxv9.js} +1 -1
  133. package/dist/assets/{game-network-BI9UA1te.js → game-network-DT1YwPOr.js} +3 -3
  134. package/dist/assets/{gameplay-export-BRGMYdix.js → gameplay-export-DlXo3wiQ.js} +1 -1
  135. package/dist/assets/{gameplay-replay-BDSniLPH.js → gameplay-replay-B4aWrdjh.js} +1 -1
  136. package/dist/assets/{gameplay.command-BZJc-MSo.js → gameplay.command-rWmsM2gL.js} +1 -1
  137. package/dist/assets/{generation-jobs-mYgLreBY.js → generation-jobs-Dhh4Jpef.js} +1 -1
  138. package/dist/assets/{generation.service--JVrEHkM.js → generation.service-CS7r3TTX.js} +1 -1
  139. package/dist/assets/{generations-BeJYyF_R.js → generations-Cj-71WbR.js} +1 -1
  140. package/dist/assets/{generations.status-DnoDI989.js → generations.status-Cx9MuboF.js} +1 -1
  141. package/dist/assets/{hierarchy-marks-B4v87a-a.js → hierarchy-marks-C1458mSW.js} +1 -1
  142. package/dist/assets/{hosted-asset-materialization-B228iJSV.js → hosted-asset-materialization-DUYXmsXT.js} +1 -1
  143. package/dist/assets/{index-C7LsKJ26.js → index-6c6r_wd1.js} +1 -1
  144. package/dist/assets/{index-B1AOJYZg.js → index-C3mVjHft.js} +1 -1
  145. package/dist/assets/{index-BzjcrVSU.js → index-CI8yan5G.js} +1 -1
  146. package/dist/assets/{index-BU1ZI9y7.js → index-CQ3-cFeq.js} +1 -1
  147. package/dist/assets/{index-DjSxgR_P.js → index-CT_NNxU3.js} +2 -2
  148. package/dist/assets/{index-_C3Iq5Wd.js → index-CiMxwJph.js} +1 -1
  149. package/dist/assets/{index-B4Rmo_fB.js → index-Cn4qrFLf.js} +1 -1
  150. package/dist/assets/{index-Dk9-JaLH.js → index-DJFmAvfp.js} +1 -1
  151. package/dist/assets/{index-CXHgcixX.js → index-Jv2cn0dw.js} +265 -265
  152. package/dist/assets/{inference-diagnostics-C7uqhs36.js → inference-diagnostics-BJHv0C45.js} +1 -1
  153. package/dist/assets/{ingest-boot-viewport-DxpPCN8-.js → ingest-boot-viewport-B-rF8eJR.js} +1 -1
  154. package/dist/assets/{ingest-siblings-CARy1NoH.js → ingest-siblings-C5Lqfijr.js} +1 -1
  155. package/dist/assets/{ingest-source-persistence-DvuQc3sT.js → ingest-source-persistence-BD9m8F8w.js} +1 -1
  156. package/dist/assets/{ingest.service-NgfReuZ2.js → ingest.service-BjDe3kFD.js} +1 -1
  157. package/dist/assets/{inspect-DvD15kGQ.js → inspect-CWR3GeHr.js} +1 -1
  158. package/dist/assets/instances.command-IyzB10Q4.js +1 -0
  159. package/dist/assets/{json-history-resource-CIzD7_uf.js → json-history-resource-Bvitw3b8.js} +1 -1
  160. package/dist/assets/{layered-pick-D9Jk9372.js → layered-pick-CVDHRF7S.js} +1 -1
  161. package/dist/assets/{light-DU95nCAj.js → light-BH4YRcll.js} +1 -1
  162. package/dist/assets/{live-project-verbs-B9ZVwEHj.js → live-project-verbs-DCqrCaUl.js} +1 -1
  163. package/dist/assets/{machine.document-m153T0gi.js → machine.document-Bz4dncfJ.js} +1 -1
  164. package/dist/assets/{machines.finder-i8KdO38L.js → machines.finder-BnMNGE96.js} +1 -1
  165. package/dist/assets/{material-ZrXVPO79.js → material-Bj8yhLSu.js} +1 -1
  166. package/dist/assets/{material-factory-BZvcmTXu.js → material-factory-CFB-dYmn.js} +1 -1
  167. package/dist/assets/{mesh-z9Ve8ByN.js → mesh-03uiEpcm.js} +1 -1
  168. package/dist/assets/{model-asset-sections.service-D_002KGV.js → model-asset-sections.service-sNfxczVz.js} +1 -1
  169. package/dist/assets/{model-inspection-2ROxDplj.js → model-inspection--xDGDuZZ.js} +1 -1
  170. package/dist/assets/{model-thumbnail-DDlpcMuI.js → model-thumbnail-Bi2S8InM.js} +1 -1
  171. package/dist/assets/{models.finder-BjJtkzqN.js → models.finder-BOQQBPPw.js} +1 -1
  172. package/dist/assets/{module-mode-BEtFhnYJ.js → module-mode-COwSkiW4.js} +2 -2
  173. package/dist/assets/{mount-canvas-ingest-root-Co_yxM8i.js → mount-canvas-ingest-root-DGQeHbDX.js} +2 -2
  174. package/dist/assets/{mount-dom-ingest-root-BDAlNEA9.js → mount-dom-ingest-root-DPjGx2gF.js} +2 -2
  175. package/dist/assets/{mount-ingest-root-DEMXnGgZ.js → mount-ingest-root-WGGmgJch.js} +2 -2
  176. package/dist/assets/{mount-manifest-Bq6LppmN.js → mount-manifest-CE0s-ge6.js} +1 -1
  177. package/dist/assets/{mount-three-ingest-root-CGfvusY_.js → mount-three-ingest-root-BD5tSDgk.js} +1 -1
  178. package/dist/assets/{mounted-authoring-BsgktNOd.js → mounted-authoring-C2E9ulka.js} +1 -1
  179. package/dist/assets/{mounted-story-viewport-source-sgRhon56.js → mounted-story-viewport-source-DnfoEI3A.js} +1 -1
  180. package/dist/assets/{native-debug-module-BZceulci.js → native-debug-module-CnxR6pkG.js} +1 -1
  181. package/dist/assets/{navigation-CDLfCWut.js → navigation-BjbG8_us.js} +1 -1
  182. package/dist/assets/{navmesh.menu-DSzXEzaQ.js → navmesh.menu-BJDEgTPU.js} +1 -1
  183. package/dist/assets/{navmesh.service-Egi9Y7BV.js → navmesh.service-Bz8Kfvog.js} +1 -1
  184. package/dist/assets/network-observer.service-5X666WPP.js +1 -0
  185. package/dist/assets/{network.utility-CVeoSZPo.js → network.utility-nmvsK-jM.js} +1 -1
  186. package/dist/assets/{object3d-document-session-registry-WhzLeDh8.js → object3d-document-session-registry-Cu3gspL4.js} +2 -2
  187. package/dist/assets/{oid-transform-DYf7FDwX.js → oid-transform-BIqDmJzm.js} +1 -1
  188. package/dist/assets/{particles-DLcXJDRm.js → particles-CAttQ2OR.js} +1 -1
  189. package/dist/assets/{pixi-authoring-adapter-ByEspABW.js → pixi-authoring-adapter-DavRy6uM.js} +1 -1
  190. package/dist/assets/{pixi-live-write-target-DX5jfQGc.js → pixi-live-write-target-3yydoX09.js} +1 -1
  191. package/dist/assets/{play.command-BLp7FDsh.js → play.command-Dv4oSavy.js} +2 -2
  192. package/dist/assets/{presentation-DI-8dWZm.js → presentation-CmkD7R6D.js} +1 -1
  193. package/dist/assets/{product-l0bGYRpT.js → product-Cb5N4L94.js} +1 -1
  194. package/dist/assets/{profiler.action-D65LYxnG.js → profiler.action-BAzS2h5g.js} +1 -1
  195. package/dist/assets/{profiler.menu-eBjg8qgR.js → profiler.menu-B0YvkJiy.js} +1 -1
  196. package/dist/assets/{profiler.utility-yYD2sV12.js → profiler.utility--7N4uJcY.js} +1 -1
  197. package/dist/assets/{project-authoring-session-TaUQdZXZ.js → project-authoring-session-CnkMxRsf.js} +2 -2
  198. package/dist/assets/{properties-bone-constraints.inspector-CCt9aEId.js → properties-bone-constraints.inspector-4LKFXIZO.js} +1 -1
  199. package/dist/assets/{properties-bone.inspector-BaVMOQEw.js → properties-bone.inspector-CsTalTpa.js} +1 -1
  200. package/dist/assets/{properties-collection.inspector-vhfuF5TZ.js → properties-collection.inspector-CmiIp-Pb.js} +1 -1
  201. package/dist/assets/{properties-constraints.inspector-DM3s7ro_.js → properties-constraints.inspector-sGA4fmAV.js} +1 -1
  202. package/dist/assets/{properties-data.inspector-srEJYSuS.js → properties-data.inspector-BkcJPRrE.js} +1 -1
  203. package/dist/assets/{properties-material.inspector-BCSthc2B.js → properties-material.inspector-0fhp5v3e.js} +1 -1
  204. package/dist/assets/{properties-modifiers.inspector-CDSwk14l.js → properties-modifiers.inspector-BYD86fCi.js} +1 -1
  205. package/dist/assets/{properties-object.inspector-CHBOT6vc.js → properties-object.inspector-CjtijsZv.js} +1 -1
  206. package/dist/assets/{properties-output.inspector-B8NPLrls.js → properties-output.inspector-BWdxRk_0.js} +1 -1
  207. package/dist/assets/{properties-particles.inspector-ByDU9k9z.js → properties-particles.inspector-RLw5vaLA.js} +1 -1
  208. package/dist/assets/{properties-physics.inspector-BRAK6FMW.js → properties-physics.inspector-BAd6wUOU.js} +1 -1
  209. package/dist/assets/{properties-render.inspector-CZ2fvH46.js → properties-render.inspector-4UBrp351.js} +1 -1
  210. package/dist/assets/{properties-scene.inspector-kIDP2MRO.js → properties-scene.inspector-DZniwe8r.js} +1 -1
  211. package/dist/assets/{properties-texture.inspector-BJTOT2lN.js → properties-texture.inspector-DSJtxn15.js} +1 -1
  212. package/dist/assets/{properties-view-layer.inspector-Dgr4N1je.js → properties-view-layer.inspector-DhmcdIGf.js} +1 -1
  213. package/dist/assets/{properties-world.inspector-Dy_S7h-I.js → properties-world.inspector-DHtnv9CT.js} +1 -1
  214. package/dist/assets/{r3f-design-session-Cl6GuUDN.js → r3f-design-session-D0LsNbsU.js} +2 -2
  215. package/dist/assets/{r3f-physics-binding-BDuldzGh.js → r3f-physics-binding-C2C7Lqqo.js} +1 -1
  216. package/dist/assets/{r3f-source-authoring-adapter-IsFmEUAU.js → r3f-source-authoring-adapter-Te6-Uyap.js} +1 -1
  217. package/dist/assets/{react-canvas-navigation-DcPiNmpA.js → react-canvas-navigation-DEB2y1Gk.js} +1 -1
  218. package/dist/assets/{react-inspector.service-DbXwK8IG.js → react-inspector.service-D3TU8zjD.js} +1 -1
  219. package/dist/assets/{react-story-board-CCjC3Sfg.js → react-story-board-OVE7uPCF.js} +1 -1
  220. package/dist/assets/{react-three-rapier.esm-t2mx-0mg.js → react-three-rapier.esm-C10K0HOL.js} +1 -1
  221. package/dist/assets/{react-world-authoring-adapter-BBXbYv0n.js → react-world-authoring-adapter-C7DVbZNj.js} +1 -1
  222. package/dist/assets/{realm-services-BymYlP3S.js → realm-services-BlOmSSbH.js} +1 -1
  223. package/dist/assets/{reflection-probe-capture.inspector-DLlXdnXS.js → reflection-probe-capture.inspector-DYz6wGdX.js} +1 -1
  224. package/dist/assets/{registry-INSzNWv4.js → registry-4TyuV009.js} +1 -1
  225. package/dist/assets/{relative-import-specifier-CnN2yw6s.js → relative-import-specifier-CqJlAxmC.js} +1 -1
  226. package/dist/assets/{render-env-8JX42PDK.js → render-env-0TzPw4z-.js} +1 -1
  227. package/dist/assets/{render-features-AwYh2Mpx.js → render-features-CDeY5m0a.js} +1 -1
  228. package/dist/assets/{render-settings-8uws0GJZ.js → render-settings-DHCLrqcs.js} +1 -1
  229. package/dist/assets/{resolve-three-mgzVynt7.js → resolve-three-B93P4d2e.js} +3 -3
  230. package/dist/assets/{root-seam-contract-BH7IVghy.js → root-seam-contract-BEJC2uWZ.js} +1 -1
  231. package/dist/assets/{run-selection-BLaKmcmt.js → run-selection-Dz1-ki4E.js} +1 -1
  232. package/dist/assets/{scene-capture-B-mdtoSx.js → scene-capture-M3ExvLdr.js} +1 -1
  233. package/dist/assets/{scene-document.service-Br4Afobn.js → scene-document.service-DMQvwY9z.js} +2 -2
  234. package/dist/assets/{scene-framing-C_IT4HeE.js → scene-framing-Bedr6rnM.js} +1 -1
  235. package/dist/assets/{seeded-random-BCcI3cdi.js → seeded-random-CO62LPQA.js} +1 -1
  236. package/dist/assets/{session-kSIjcXJT.js → session-kTroQqmY.js} +19 -0
  237. package/dist/assets/{setup-renderer-puL8wA5Q.js → setup-renderer-BN9PTM2C.js} +1 -1
  238. package/dist/assets/{source-object3d-authoring-adapter-G8RsSkDG.js → source-object3d-authoring-adapter-C6XyaNg9.js} +1 -1
  239. package/dist/assets/{source-persistence-backend-BNmh-8qW.js → source-persistence-backend-Ca_ygGuX.js} +1 -1
  240. package/dist/assets/{stage-keyboard-D8-cWRr2.js → stage-keyboard-CcHbixKo.js} +1 -1
  241. package/dist/assets/{stage-overlay-set-B6mrZlgh.js → stage-overlay-set-BILkW5HG.js} +1 -1
  242. package/dist/assets/{stage-presence-markers-5xyQjkaM.js → stage-presence-markers-BR08J6N2.js} +1 -1
  243. package/dist/assets/{stage-transform-tools-ChWaCiOj.js → stage-transform-tools-frDy3KMH.js} +1 -1
  244. package/dist/assets/{standard-viewport-dressing-BXZtCD_J.js → standard-viewport-dressing-D-4BRBZ3.js} +1 -1
  245. package/dist/assets/{state-watch.action-DNYgv9-9.js → state-watch.action-DbVib0Wm.js} +1 -1
  246. package/dist/assets/{state-watch.menu-DfnCJLNu.js → state-watch.menu-4VkWv-gs.js} +1 -1
  247. package/dist/assets/{state-watch.utility-Dk8GG70_.js → state-watch.utility-vWluRyuM.js} +1 -1
  248. package/dist/assets/{story-capture-BOeJxmag.js → story-capture-CpoJJCuL.js} +1 -1
  249. package/dist/assets/{story-documents-ncrvtbLw.js → story-documents-By2L5gU8.js} +1 -1
  250. package/dist/assets/{story-documents.service-BzqRctJi.js → story-documents.service-ChmwH33Z.js} +1 -1
  251. package/dist/assets/{story-documents.service-BsDX5Kzs.js → story-documents.service-FA_djPl0.js} +1 -1
  252. package/dist/assets/{story-media-presence-Bxc_ozc_.js → story-media-presence-DXbFsHrM.js} +1 -1
  253. package/dist/assets/{story-pixi-preview-Z_Qrgjco.js → story-pixi-preview-RoiPi8ej.js} +1 -1
  254. package/dist/assets/{story-presentation-C8RuK7ZP.js → story-presentation-B7fxblSi.js} +1 -1
  255. package/dist/assets/{story-three-preview-Dbk9HTMU.js → story-three-preview-DEBqMpBA.js} +2 -2
  256. package/dist/assets/{studio-environment-Dd9-Ng-9.js → studio-environment-DNVPPj7V.js} +1 -1
  257. package/dist/assets/{surface-state-Dc_KHusm.js → surface-state-DXwVLc-X.js} +1 -1
  258. package/dist/assets/{syntactic-prop-specs-BqVhzbso.js → syntactic-prop-specs-DXwoBLk8.js} +1 -1
  259. package/dist/assets/{team-playtest.service-De283D8C.js → team-playtest.service-OcAV2nwa.js} +1 -1
  260. package/dist/assets/{three-DRLL_AH_.js → three-GDqSlMPl.js} +1 -1
  261. package/dist/assets/{three-authoring-adapter-Bi-8Y2uL.js → three-authoring-adapter-eXBXu7dw.js} +1 -1
  262. package/dist/assets/three-authoring.service-DqwgrrGt.js +2 -0
  263. package/dist/assets/{three-ingest-runtime-Ds2jGVty.js → three-ingest-runtime-8KxeujxF.js} +1 -1
  264. package/dist/assets/{three-integration-Bu8jiWKw.js → three-integration-BDMIyZ1k.js} +2 -2
  265. package/dist/assets/three-integration.service-kBCs4oqg.js +1 -0
  266. package/dist/assets/{three-projection-core-DYNkd_UM.js → three-projection-core-yOq-vtpg.js} +1 -1
  267. package/dist/assets/{three-state-tSumB-N7.js → three-state-BB7dX-S2.js} +1 -1
  268. package/dist/assets/{three-story-capture.service-CNvkCbRR.js → three-story-capture.service-Csi9EhMX.js} +2 -2
  269. package/dist/assets/{three-story-model-CPPsdgfA.js → three-story-model-BzNDU7Zm.js} +1 -1
  270. package/dist/assets/{three-viewport-presentation-DHl0wniy.js → three-viewport-presentation-CpZGpMNr.js} +1 -1
  271. package/dist/assets/{transform-mode-request-z9la1xr5.js → transform-mode-request-B1jY6tFK.js} +1 -1
  272. package/dist/assets/{transport-strip--Kv6Gndt.js → transport-strip-DDeKZtN7.js} +1 -1
  273. package/dist/assets/transport.header-3IJvdavx.js +1 -0
  274. package/dist/assets/{tuples-DaZ7i9Ix.js → tuples-DJrYHRKk.js} +1 -1
  275. package/dist/assets/{ui-board-document-B7iGu_Ze.js → ui-board-document-BBD4GP8h.js} +2 -2
  276. package/dist/assets/{user-data-BZvgpwTm.js → user-data-9mnmz1dz.js} +1 -1
  277. package/dist/assets/{utility-view-state-BOjCwlj-.js → utility-view-state-BaYGnM9D.js} +1 -1
  278. package/dist/assets/{viewport-door-BOXLjEUk.js → viewport-door-CB8QJb0X.js} +1 -1
  279. package/dist/assets/{viewport-root-presentation-Cf9klnI_.js → viewport-root-presentation-1Rf0H32M.js} +1 -1
  280. package/dist/assets/{viewport-surface-status-Pfba7R7y.js → viewport-surface-status-DhqT8THw.js} +1 -1
  281. package/dist/assets/{webworkerAll-DFHFFrDz.js → webworkerAll-BYi0pf4E.js} +1 -1
  282. package/dist/assets/{worker-BRY0I3XJ.js → worker-DLnISz0i.js} +1 -1
  283. package/dist/assets/{workspace-arrangement-BmOIOEhR.js → workspace-arrangement-C27jX2ps.js} +1 -1
  284. package/dist/assets/{world-documents-CisaULkC.js → world-documents-BudRV8Yy.js} +1 -1
  285. package/dist/assets/{world-root-stage-binding-DDL5gwb0.js → world-root-stage-binding-DL21dVA2.js} +1 -1
  286. package/dist/assets/{xstate-animation-binding-CxU3XPUU.js → xstate-animation-binding-DMO5uz3F.js} +1 -1
  287. package/dist/assets/{xstate-animation-meta-DrlSAelK.js → xstate-animation-meta-D2a-1xiq.js} +1 -1
  288. package/dist-node/cli.js +16 -16
  289. package/package.json +16 -16
  290. package/dist/assets/InspectorObjectPreview-CfUaeAaa.js +0 -1
  291. package/dist/assets/Object3DDocumentViewport-sN0s5xrP.js +0 -2
  292. package/dist/assets/StageHost-Djic_5-c.js +0 -2
  293. package/dist/assets/autoplay.service-Dd5Zy1tg.js +0 -1
  294. package/dist/assets/instances.command-DPiLpDyF.js +0 -1
  295. package/dist/assets/network-observer.service-BI6u2j_-.js +0 -1
  296. package/dist/assets/three-authoring.service-DHplh6o3.js +0 -2
  297. package/dist/assets/three-integration.service-NrpAC6Gc.js +0 -1
  298. package/dist/assets/transport.header-CtQ-30Cy.js +0 -1
@@ -1 +1 @@
1
- import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{EDITOR_LAYER as Ke}from"./editor-layers-CtzgRn6E.js";import{df as Oe,a7 as V,bN as Ye,aL as te,bw as $,aM as G,kI as Je,bM as Ze,bP as et,a6 as Q,g$ as tt,hF as rt,j_ as nt,kJ as ot,Z as j,K as st,ci as at,kK as Se,cx as it,kL as ct,kM as lt,kN as ut,kO as Ce,kP as xe,aD as x,cU as dt,kQ as mt,cq as pt,cv as ft,kR as Pe,kS as Ee,kT as je,kU as ht,al as gt,kV as bt,kW as ke,dI as vt,kX as wt,kY as yt,j3 as St,iV as Ct,iW as xt,gK as Pt,gL as Et,j1 as jt,g2 as kt,g3 as Tt,g4 as At,g5 as Rt}from"./index-CXHgcixX.js";import{s as Mt,o as Vt}from"./object3d-document-session-registry-WhzLeDh8.js";import{R as Ot}from"./RootSelectionOverlay-BLUee6Us.js";import{e as Lt,S as Ft}from"./surface-state-Dc_KHusm.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as It}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{s as zt,d as Te,c as U,t as Wt,p as Le,v as Ae,b as Nt,e as _t,l as Dt,i as Qt}from"./camera-authoring-DYjhU5Zp.js";import{c as $t}from"./performance-profiler-CMbwGBuk.js";import{m as Gt}from"./renderer-ownership-BovSEcLv.js";import{applyWorldRendererConfig as Ut}from"./renderer-config-CaPR4dB_.js";import{getUserData as Fe}from"./user-data-CODoGZqA.js";import{detectKtx2Support as Bt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as Ht}from"./render-settings-8uws0GJZ.js";import{createSoftParticleDepthPass as qt}from"./soft-particle-depth-DNGwWJ8c.js";import{ViewportShadingRenderer as Xt}from"./viewport-shading-D9BMDb1N.js";import{applyRendererSettings as Kt,applySceneRenderPipeline as Yt}from"./setup-renderer-puL8wA5Q.js";import{EffectComposer as Jt,EffectPass as Zt,BlendFunction as er,KernelSize as tr,OutlineEffect as rr}from"./index-DHhMOs_s.js";import{W as nr,T as or}from"./three.module-BLhyNg0e.js";import{d as sr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as ar}from"./project-authoring-session-TaUQdZXZ.js";import"./three-integration-Bu8jiWKw.js";import{registerPresentedCanvasFrame as ir}from"./canvas-preview-frames-Bq4sE7ij.js";import{i as cr}from"./editor-presentation-activity-CqJH4G9t.js";import{E as lr,s as ur,a as dr,t as mr,b as pr,c as fr,d as hr,r as gr,i as br}from"./three-viewport-presentation-DHl0wniy.js";import{a as Z}from"./entity-object-Dd555Jkc.js";import{w as vr}from"./editor-shell-store-CdiZaE3q.js";import{p as wr}from"./viewport-root-presentation-Cf9klnI_.js";import{d as yr}from"./asset-editor-persistence-l5bSUF0E.js";import{bindStagePresenceMarkers as Sr}from"./stage-presence-markers-5xyQjkaM.js";import{el as Cr,_ as ee,fo as D,d7 as xr,dp as Re}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./workspace-arrangement-BmOIOEhR.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-D9Jk9372.js";import"./root-stacking-BEd9ZvxC.js";import"./react-story-board-CCjC3Sfg.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-DvD15kGQ.js";import"./inference-diagnostics-C7uqhs36.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-AwYh2Mpx.js";import"./matcap-texture-Dm2c-VQa.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-Bwbko9HU.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-BZvgpwTm.js";import"./model-thumbnail-DDlpcMuI.js";import"./studio-environment-Dd9-Ng-9.js";import"./three-state-tSumB-N7.js";import"./hierarchy-marks-B4v87a-a.js";import"./component-instance-root-BuWShEF6.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-door-BOXLjEUk.js";import"./content-bounds-W1659ao-.js";import"./asset-preview-h_hjp_z2.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-DjSxgR_P.js";import"./standard-viewport-dressing-BXZtCD_J.js";import"./clip-planes-CnAI6DZn.js";import"./three-DRLL_AH_.js";import"./model-inspection-2ROxDplj.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-C_IT4HeE.js";import"./live-mixers-B-bwLZ7c.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./mounted-authoring-BsgktNOd.js";import"./collaboration-presence-DY1ZefcY.js";function Pr({previewRef:r}){const{preview:e,previewPinned:s}=U(),[o,c]=f.useState(!1),a=f.useRef(null);if(f.useEffect(()=>{if(!o)return;const u=E=>{a.current?.contains(E.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[o]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return i.jsxs("div",{className:"volter-camera-preview","data-testid":"camera-preview",children:[i.jsxs(Oe,{className:"volter-camera-preview-header",gap:4,align:"center",children:[i.jsx(V,{icon:Ye,size:"sm"}),i.jsx(te,{variant:"label",truncate:!0,className:"volter-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),i.jsx($,{text:s?"Unpin camera preview":"Pin camera preview",children:i.jsx(G,{"aria-label":s?"Unpin camera preview":"Pin camera preview","aria-pressed":s,size:"compact",onClick:Wt,children:i.jsx(V,{icon:Je,size:"sm"})})}),i.jsxs("div",{ref:a,className:"volter-camera-preview-menu-anchor",children:[i.jsx($,{text:"Camera actions",children:i.jsx(G,{"aria-label":"Camera actions","aria-expanded":o,size:"compact",onClick:()=>c(u=>!u),children:i.jsx(V,{icon:Ze,size:"sm"})})}),o?i.jsxs(et,{className:"volter-camera-preview-menu",children:[i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Le(e)},children:"Pilot Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",onClick:()=>{c(!1),Ae(e)},children:"View Through Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Nt(e)},children:"Align Camera to Current View"})]}):null]})]}),i.jsx("div",{ref:r,className:"volter-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>Ae(e)})]})}function Er(){return i.jsxs("div",{className:"volter-camera-guides","aria-hidden":"true",children:[i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v2"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h2"}),i.jsx("div",{className:"volter-camera-safe-frame"}),i.jsx("div",{className:"volter-camera-center-mark"})]})}function jr(){const{view:r,guidesVisible:e}=U();if(!r)return null;const s=r.mode==="pilot";return i.jsxs(i.Fragment,{children:[e?i.jsx(Er,{}):null,i.jsx(tt,{variant:"overlay",border:!0,className:"volter-camera-view-banner volter-chrome-island volter-glass-island","data-testid":"camera-view-banner",children:i.jsxs(Oe,{gap:6,align:"center",children:[i.jsx(rt,{children:s?"PILOTING":"CAMERA VIEW"}),i.jsx(te,{variant:"label",children:r.subject.name}),i.jsx(te,{variant:"caption",tone:"muted",children:"Exact camera view"}),i.jsx($,{text:e?"Hide composition guides":"Show composition guides",children:i.jsx(G,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:_t,children:i.jsx(V,{icon:nt,size:"sm"})})}),s?null:i.jsx(Q,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Le(r.subject),children:"Pilot"}),i.jsx($,{text:"Exit camera view",children:i.jsx(G,{"aria-label":"Exit camera view",size:"compact",onClick:Dt,children:i.jsx(V,{icon:ot,size:"sm"})})})]})})]})}function kr({previewRef:r}){return f.useSyncExternalStore(zt,Te,Te),i.jsxs(i.Fragment,{children:[i.jsx(Pr,{previewRef:r}),i.jsx(jr,{})]})}function Tr(r){const e=r,s=e.getExtension("EXT_disjoint_timer_query_webgl2"),o=s!==null&&typeof e.createQuery=="function",c=[];let a=null,m=null;return{begin(){!o||a||(a=e.createQuery(),a&&e.beginQuery(s.TIME_ELAPSED_EXT,a))},end(){!o||!a||(e.endQuery(s.TIME_ELAPSED_EXT),c.push(a),a=null)},poll(){if(!o)return null;if(e.getParameter(s.GPU_DISJOINT_EXT)){for(const u of c.splice(0))e.deleteQuery(u);return null}for(;c.length>0;){const u=c[0];if(!e.getQueryParameter(u,e.QUERY_RESULT_AVAILABLE))break;c.shift(),m=e.getQueryParameter(u,e.QUERY_RESULT)/1e6,e.deleteQuery(u)}return m},dispose(){a&&(e.endQuery(s.TIME_ELAPSED_EXT),e.deleteQuery(a),a=null);for(const u of c.splice(0))e.deleteQuery(u)}}}const Ar=2e4,Rr=250,Mr=5e3;class Vr{#e=0;#t=0;#r=0;#n;constructor(e){this.#n=e}get pending(){return this.#e>0||this.#t>0}begin(e,s){this.#e=e+Ar,this.#t=s?e+Mr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+Rr,this.#t>0&&this.#n.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#n.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const Me=new WeakMap;function Or(r,e){if(!r)return e(),!0;if(Me.has(r))return!1;try{return e(),!0}catch(s){const o=s instanceof Error?s.message:String(s);return Me.set(r,o),j.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${o}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${st("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Lr(){const r=at();r.addEventListener("server-log",s=>{try{Se(JSON.parse(s.data))}catch{}});let e=!1;return(async()=>{try{const s=await it();if(e)return;for(const o of s)Se(o)}catch{}})(),()=>{e=!0,r.close()}}const Ie="viewportPose";function Fr(){const r=ct(Ie);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Ir(r,e){lt(Ie,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}const Ve={id:"world",title:"World",lights:[{color:"#ffffff",intensity:1,direction:[-10,-20,-10],space:"world"}],ambient:{color:"#ffffff",intensity:.5},environmentIntensity:0};yt(Ve),St("world",{all:{lighting:{source:"studio",studioPreset:Ve.id,auto:{takeover:["light"],overridable:!0}}}});function zr(r,e,s){const o=document.createElement("canvas");o.setAttribute("aria-label",`${s} authoring viewport`),o.setAttribute("data-testid","editor-canvas"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.pointerEvents="auto",r.appendChild(o);const c=Math.max(1,e.clientWidth),a=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);o.width=Math.ceil(c*m),o.height=Math.ceil(a*m);const u=Gt(new nr({canvas:o,antialias:!!Ht(void 0).antialias,powerPreference:"high-performance"}));return Kt(u,void 0,m),u.setSize(c,a),u.shadowMap.type=xr,u.info.autoReset=!1,Bt(u),{canvas:o,renderer:u,lease:null}}async function Wr(r){const e=pt(r.source,r.id);if(e)return e;let s=r.url,o=r.format??"gltf",c=r.includes;if(!s){const u=(await ft(r.source,r.id))[0];if(!u)return j.error(`No downloadable files for ${r.name}.`,"asset"),null;s=u.url,o=u.format,c=u.includes}const a={source:r.source,id:r.id,name:r.name,url:s,format:o};c&&(a.includes=c);const m=await yr(a);return m.ok&&m.path?`/${m.path}`:(j.error(`Could not download ${r.name}.`,"asset"),null)}function Nr(r){if(r.isCamera)return r;const e=Fe(r,"_camera");return e?.isCamera?e:null}function _r(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const s=r;return s.isOrthographicCamera?`Orthographic · ${s.zoom.toFixed(2)}×`:r.type}function Dr(r,e){const s=r.transforms;if(!s)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const o=s.editability?.(e,"position")??{writable:!0},c=s.editability?.(e,"rotation")??{writable:!0};return o.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:o.reason??c.reason??"This camera pose is read-only."}}function Qr(r,e,s){const o=e.get(s)??null;if(!o)return null;const c=Nr(o);return c?{id:s,name:o.name||c.name||"Camera",camera:c,lens:_r(c),...Dr(r,s)}:null}function $r(r){const e=new Map;for(const[s,o]of r.objectMap){const c=Fe(o,"tags");Array.isArray(c)&&c.length>0&&e.set(s,c)}return e}function Gr(r){const{store:e,documentId:s,container:o,canvas:c,renderer:a,stats:m}=r,u=new Jt(a),E=qt(),O=new Xt,g=$t(),L=Tr(a.getContext()),ze=t=>{g.enabled&&L.begin();try{t()}finally{L.end()}},We=()=>g.enabled?L.poll():null,Ne=ut({id:s,label:"Scene viewport",kind:"scene",profiler:g}),b=new Cr,re=11184810;let B=Ce(c).background??re;b.background=new ee(B);const _e=xe(c,()=>{const t=Ce(c).background??re,l=b.background;l instanceof ee&&l.getHex()===B&&(b.background=new ee(t)),B=t});e.bindScene(b,a);const n=new lr(c,b,e,o,{renderer:a,onlineAssetResolver:Wr,onProjectionChange:ur}),De=n.bindPresentation(s,"world");e.bindScene(b,a,n.batchedRenderer,n.camera),e.setOrbitTarget(n.orbitControls.target);const H=new D,F=new D,ne=new D,oe=()=>{const t=n.renderCamera;t.getWorldPosition(H),n.cameraViewMode==="pilot"?F.copy(n.orbitControls.target):n.cameraViewMode?(t.getWorldDirection(ne),F.copy(H).add(ne.multiplyScalar(10))):F.copy(n.orbitControls.target);const l=t.fov;return{position:H,target:F,fov:typeof l=="number"?l:0}},k=Sr({scene:b,store:e,documentId:s,container:o,canvas:c,viewport:n,readVisibleCameraPose:oe});let se="",q=null,h=null,S=null,I=null;const ae=()=>{h&&fr(h,ke(a.domElement))},Qe=xe(a.domElement,ae),ie=()=>{if(!h)return;const t=x(e.shell),l=[...e.shell.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>Z(t,e.objectMap,d)).filter(d=>d!==null);hr(h,l);const p=h.selection.size>0;S&&(S.enabled=p,S.renderToScreen=p),I&&(I.renderToScreen=!p)};function T(){bt(e.shell),q?.(),q=null,h&&gr(a,h,S),h=null,S=null,I=null,Yt(u,a,e.scene??b,n.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:$r(e)}),h=pr({BlendFunction:er,KernelSize:tr,OutlineEffect:rr},a,e.scene??b,n.renderCamera,ke(a.domElement)),ae(),I=u.passes.at(-1)??null,S=new Zt(n.renderCamera,h),S.enabled=!1,u.addPass(S),ie();const t=e.adoptedImageConfig;t&&(q=Ut(or,a,t))}const ce=()=>{n.setProjection(mr().projection),e.setViewportCamera(n.freeCamera),T()},$e=dr(ce);ce();const X=t=>Qr(x(e.shell),e.objectMap,t);let v=null;const A=()=>{v&&(je(x(e.shell),v),v=null)},le=()=>{const t=U().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(v=t.subject.id,Pe(x(e.shell),v))},ue=()=>{if(!v||n.cameraViewMode!=="pilot")return;const t=X(v),l=x(e.shell),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(v)}catch(w){j.error(w instanceof Error?w.message:String(w),"camera-authoring"),A();return}Ee(l,v,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.shell.notifyIngestEdit()};n.orbitControls.addEventListener("start",le),n.orbitControls.addEventListener("change",ue),n.orbitControls.addEventListener("end",A);const Ge=Qt({active:()=>e.shell.playState==="stopped"&&e.shell.activeViewportTab==="edit",selected:()=>{const t=e.shell.selectedEntityId;return t?X(t):null},resolve:X,showView:(t,l)=>{A(),n.setCameraView(t.camera,l),T(),k.reportCamera()},leaveView:()=>{A(),n.clearCameraView(),T(),k.reportCamera()},alignToViewport:t=>{const l=x(e.shell),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const w=n.camera.getWorldPosition(new D),C=n.camera.getWorldQuaternion(new Re),y=w.clone(),R=C.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(y);const M=d.parent.getWorldQuaternion(new Re);R.premultiply(M.invert())}let ye;try{ye=p.get(t.id)}catch(M){j.error(M instanceof Error?M.message:String(M),"camera-authoring");return}Pe(l,t.id),Ee(l,t.id,{position:y.toArray(),rotation:R.toArray(),scale:ye.scale}),e.shell.notifyIngestEdit(),je(l,t.id)},subscribe:e.shell.subscribe});let de=null;const me=()=>{const t=ht(e.shell);t!==de&&(de=t,c.style.opacity=t?"1":"0",o.style.backgroundColor=t?"":gt.surface.raised,o.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",o.style.backgroundPosition=t?"":"0 0, 8px 8px",o.style.backgroundSize=t?"":"16px 16px")};me();let pe=e.composerVersion;const Ue=e.shell.subscribe(()=>{me();const t=e.scene;t&&t!==n.currentScene&&n.setScene(t),n.objectMap=e.objectMap,n.syncFromStore(),e.composerVersion!==pe?(pe=e.composerVersion,T()):ie()});let z=null;const K=new Vr({seedFromGameCamera:()=>{const t=z?.()??null;return!!t&&n.seedFromGameCamera(t)},frameContent:()=>n.focusOnScene()}),fe=()=>{K.cancel(),z=null};n.orbitControls.addEventListener("start",fe);const he=()=>Ir(n.camera,n.orbitControls.target);n.orbitControls.addEventListener("end",he);const Be=e.shell.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=Z(x(e.shell),e.objectMap,t.id);l&&n.focusOn(l);break}case"focus-scene":{{const l=Fr();if(l){n.camera.position.set(...l.position),n.orbitControls.target.set(...l.target),n.orbitControls.update();break}}z=e.sceneCameraLookup,K.begin(performance.now(),z!==null);break}case"focus-selection":{const l=x(e.shell),p=[...e.shell.selectedEntityIds].map(d=>Z(l,e.objectMap,d)).filter(d=>d!==null);n.focusOnMultiple(p);break}case"snap-selection-to-floor":n.snapSelectionToFloor();break;case"set-view-preset":n.setViewPreset(t.preset);break;case"step-view":n.stepView(t.step);break;case"frame-all":n.focusOnScene();break;case"zoom-view":n.zoomStep(t.direction);break;case"set-camera-pose":n.setPose(t.position,t.target,t.fov);break}});Lr();const ge=new ResizeObserver(()=>{const t=Math.max(1,o.clientWidth),l=Math.max(1,o.clientHeight);a.setSize(t,l),u.setSize(t,l),n.resize(t,l)});ge.observe(o);let W=performance.now(),N=!0,P=!1,be=!1;function ve(t){return Or(n.currentScene,()=>{E.render(a,n.currentScene,n.renderCamera),n.renderWithInfrastructure(()=>{vr(n.currentScene,()=>O.render(n.currentScene,e.shadingMode,()=>u.render(t),br)),n.renderViewCube(a),n.renderCameraPreview(a,U().preview?.camera??null,r.cameraPreview())})})}const He=ir(c,async()=>{if(P||!cr()||!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ve(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),Y=()=>wt(e.shell)===e.shell;function qe(t,l){if(P)return;if(l&&(W=t),!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){W=t,N=!0,n.resolvePresentation();return}g.beginFrame();const p=t-W,d=p/1e3;Y()&&(m.frameTime=p,m.fps=1e3/p),W=t,k.syncMarkers(d),K.tick(t),g.beginPhase(),n.update(d),r.runFrame(d),n.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),a.info.reset(),ze(()=>{ve(d)}),g.reportRender({gpuMs:We(),drawCalls:a.info.render.calls,triangles:a.info.render.triangles,geometries:a.info.memory.geometries,textures:a.info.memory.textures}),g.endPhase("render"),Y()&&(m.drawCalls=a.info.render.calls,m.triangles=a.info.render.triangles),N&&be&&(N=!1,vt(s)),g.endFrame();const w=oe(),C=w.position,y=w.target;Y()&&(m.cameraPosition.x=C.x,m.cameraPosition.y=C.y,m.cameraPosition.z=C.z,m.cameraTarget.x=y.x,m.cameraTarget.y=y.y,m.cameraTarget.z=y.z);const R=`${C.x},${C.y},${C.z},${y.x},${y.y},${y.z},${w.fov}`;R!==se&&(se=R,k.reportCamera())}n.objectMap=e.objectMap,n.syncFromStore(),T();let J,_;async function Xe(t){if(P)return;r.onMountStatus("mounting"),_?.(),_=void 0,J=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=sr("three");if(P||J!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:a}):()=>{};if(P||J!==t){p();return}_=p,P||r.onMountStatus("ready")}const we=ar(e.shell,Xe);return we.ready.then(()=>dt(mt(e.shell))).catch(t=>{j.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{be=!0,N=!0}),{scene:b,viewport:n,frame:qe,present:t=>wr(e,t),setHelper:(t,l)=>n.setHelper(t,l),dispose:()=>{P=!0,Ne(),He(),ge.disconnect(),Ue(),Be(),Ge(),n.orbitControls.removeEventListener("start",le),n.orbitControls.removeEventListener("change",ue),n.orbitControls.removeEventListener("end",A),n.orbitControls.removeEventListener("start",fe),n.orbitControls.removeEventListener("end",he),we.dispose(),_?.(),k.dispose(),O.dispose(),L.dispose(),$e(),Qe(),_e(),De(),h?.selection.clear(),E.dispose(),u.dispose()}}}function Ur({store:r,rootIds:e,mountStatus:s}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getSnapshot);const o=f.useSyncExternalStore(kt,Tt),c=f.useSyncExternalStore(At,Rt),a=r.scene?.background,m=a!==null&&!(a?.isColor===!0&&a.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&It(r.scene,{includeBackground:!1,ignoredLayer:Ke})),[r.scene,r.shell.contentVersion]),E=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:s==="mounting"?"loading":"ready",content:E?"present":s==="mounting"?"unknown":"empty",readiness:o,failures:c});return i.jsx(Ft,{explanation:O,testId:"scene-viewport-status"})}function Br({store:r,documentId:e,cameraPreviewRef:s,mountStatus:o,rootIds:c}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getShellSnapshot??r.shell.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(Mt,Vt),f.useSyncExternalStore(Pt,Et);const a=jt(r.shell,e,"document");return i.jsxs(i.Fragment,{children:[a.surface!==null?i.jsx(Ot,{}):null,a.surface==="three"?i.jsx(kr,{previewRef:s}):null,i.jsx(Ur,{store:r,rootIds:c,mountStatus:o})]})}const ko={mountWorldRootSurface:zr,installWorldRootStage:Gr,Overlays:Br};export{ko as worldRootStageBinding};
1
+ import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{EDITOR_LAYER as Ke}from"./editor-layers-IL32ACAu.js";import{df as Oe,a7 as V,bN as Ye,aL as te,bw as $,aM as G,kI as Je,bM as Ze,bP as et,a6 as Q,g$ as tt,hF as rt,j_ as nt,kJ as ot,Z as j,K as st,ci as at,kK as Se,cx as it,kL as ct,kM as lt,kN as ut,kO as Ce,kP as xe,aD as x,cU as dt,kQ as mt,cq as pt,cv as ft,kR as Pe,kS as Ee,kT as je,kU as ht,al as gt,kV as bt,kW as ke,dI as vt,kX as wt,kY as yt,j3 as St,iV as Ct,iW as xt,gK as Pt,gL as Et,j1 as jt,g2 as kt,g3 as Tt,g4 as At,g5 as Rt}from"./index-Jv2cn0dw.js";import{s as Mt,o as Vt}from"./object3d-document-session-registry-Cu3gspL4.js";import{R as Ot}from"./RootSelectionOverlay-CXUguLVy.js";import{e as Lt,S as Ft}from"./surface-state-DXwVLc-X.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as It}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{s as zt,d as Te,c as U,t as Wt,p as Le,v as Ae,b as Nt,e as _t,l as Dt,i as Qt}from"./camera-authoring-DYjhU5Zp.js";import{c as $t}from"./performance-profiler-CMbwGBuk.js";import{m as Gt}from"./renderer-ownership-BovSEcLv.js";import{applyWorldRendererConfig as Ut}from"./renderer-config-CaPR4dB_.js";import{getUserData as Fe}from"./user-data-CODoGZqA.js";import{detectKtx2Support as Bt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as Ht}from"./render-settings-DHCLrqcs.js";import{createSoftParticleDepthPass as qt}from"./soft-particle-depth-DNGwWJ8c.js";import{ViewportShadingRenderer as Xt}from"./viewport-shading-D9BMDb1N.js";import{applyRendererSettings as Kt,applySceneRenderPipeline as Yt}from"./setup-renderer-BN9PTM2C.js";import{EffectComposer as Jt,EffectPass as Zt,BlendFunction as er,KernelSize as tr,OutlineEffect as rr}from"./index-DHhMOs_s.js";import{W as nr,T as or}from"./three.module-BLhyNg0e.js";import{d as sr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as ar}from"./project-authoring-session-CnkMxRsf.js";import"./three-integration-BDMIyZ1k.js";import{registerPresentedCanvasFrame as ir}from"./canvas-preview-frames-DN9sJFYk.js";import{i as cr}from"./editor-presentation-activity-CqJH4G9t.js";import{E as lr,s as ur,a as dr,t as mr,b as pr,c as fr,d as hr,r as gr,i as br}from"./three-viewport-presentation-CpZGpMNr.js";import{a as Z}from"./entity-object--sePwyoN.js";import{w as vr}from"./editor-shell-store-bGLFKgrE.js";import{p as wr}from"./viewport-root-presentation-1Rf0H32M.js";import{d as yr}from"./asset-editor-persistence-BOiFbzua.js";import{bindStagePresenceMarkers as Sr}from"./stage-presence-markers-BR08J6N2.js";import{el as Cr,_ as ee,fo as D,d7 as xr,dp as Re}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./workspace-arrangement-C27jX2ps.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-CVDHRF7S.js";import"./root-stacking-BEd9ZvxC.js";import"./react-story-board-OVE7uPCF.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-CWR3GeHr.js";import"./inference-diagnostics-BJHv0C45.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-CDeY5m0a.js";import"./matcap-texture-Dm2c-VQa.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-C4Rf-CAq.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./user-data-9mnmz1dz.js";import"./model-thumbnail-Bi2S8InM.js";import"./studio-environment-DNVPPj7V.js";import"./three-state-BB7dX-S2.js";import"./hierarchy-marks-C1458mSW.js";import"./component-instance-root-BkqCh7zR.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-door-CB8QJb0X.js";import"./content-bounds-Chky2vxw.js";import"./asset-preview-B7JSYjLt.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-CT_NNxU3.js";import"./standard-viewport-dressing-D-4BRBZ3.js";import"./clip-planes-CnAI6DZn.js";import"./three-GDqSlMPl.js";import"./model-inspection--xDGDuZZ.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-Bedr6rnM.js";import"./live-mixers-B-bwLZ7c.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./mounted-authoring-C2E9ulka.js";import"./collaboration-presence-L-M4ah4j.js";function Pr({previewRef:r}){const{preview:e,previewPinned:s}=U(),[o,c]=f.useState(!1),a=f.useRef(null);if(f.useEffect(()=>{if(!o)return;const u=E=>{a.current?.contains(E.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[o]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return i.jsxs("div",{className:"volter-camera-preview","data-testid":"camera-preview",children:[i.jsxs(Oe,{className:"volter-camera-preview-header",gap:4,align:"center",children:[i.jsx(V,{icon:Ye,size:"sm"}),i.jsx(te,{variant:"label",truncate:!0,className:"volter-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),i.jsx($,{text:s?"Unpin camera preview":"Pin camera preview",children:i.jsx(G,{"aria-label":s?"Unpin camera preview":"Pin camera preview","aria-pressed":s,size:"compact",onClick:Wt,children:i.jsx(V,{icon:Je,size:"sm"})})}),i.jsxs("div",{ref:a,className:"volter-camera-preview-menu-anchor",children:[i.jsx($,{text:"Camera actions",children:i.jsx(G,{"aria-label":"Camera actions","aria-expanded":o,size:"compact",onClick:()=>c(u=>!u),children:i.jsx(V,{icon:Ze,size:"sm"})})}),o?i.jsxs(et,{className:"volter-camera-preview-menu",children:[i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Le(e)},children:"Pilot Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",onClick:()=>{c(!1),Ae(e)},children:"View Through Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Nt(e)},children:"Align Camera to Current View"})]}):null]})]}),i.jsx("div",{ref:r,className:"volter-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>Ae(e)})]})}function Er(){return i.jsxs("div",{className:"volter-camera-guides","aria-hidden":"true",children:[i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v2"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h2"}),i.jsx("div",{className:"volter-camera-safe-frame"}),i.jsx("div",{className:"volter-camera-center-mark"})]})}function jr(){const{view:r,guidesVisible:e}=U();if(!r)return null;const s=r.mode==="pilot";return i.jsxs(i.Fragment,{children:[e?i.jsx(Er,{}):null,i.jsx(tt,{variant:"overlay",border:!0,className:"volter-camera-view-banner volter-chrome-island volter-glass-island","data-testid":"camera-view-banner",children:i.jsxs(Oe,{gap:6,align:"center",children:[i.jsx(rt,{children:s?"PILOTING":"CAMERA VIEW"}),i.jsx(te,{variant:"label",children:r.subject.name}),i.jsx(te,{variant:"caption",tone:"muted",children:"Exact camera view"}),i.jsx($,{text:e?"Hide composition guides":"Show composition guides",children:i.jsx(G,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:_t,children:i.jsx(V,{icon:nt,size:"sm"})})}),s?null:i.jsx(Q,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Le(r.subject),children:"Pilot"}),i.jsx($,{text:"Exit camera view",children:i.jsx(G,{"aria-label":"Exit camera view",size:"compact",onClick:Dt,children:i.jsx(V,{icon:ot,size:"sm"})})})]})})]})}function kr({previewRef:r}){return f.useSyncExternalStore(zt,Te,Te),i.jsxs(i.Fragment,{children:[i.jsx(Pr,{previewRef:r}),i.jsx(jr,{})]})}function Tr(r){const e=r,s=e.getExtension("EXT_disjoint_timer_query_webgl2"),o=s!==null&&typeof e.createQuery=="function",c=[];let a=null,m=null;return{begin(){!o||a||(a=e.createQuery(),a&&e.beginQuery(s.TIME_ELAPSED_EXT,a))},end(){!o||!a||(e.endQuery(s.TIME_ELAPSED_EXT),c.push(a),a=null)},poll(){if(!o)return null;if(e.getParameter(s.GPU_DISJOINT_EXT)){for(const u of c.splice(0))e.deleteQuery(u);return null}for(;c.length>0;){const u=c[0];if(!e.getQueryParameter(u,e.QUERY_RESULT_AVAILABLE))break;c.shift(),m=e.getQueryParameter(u,e.QUERY_RESULT)/1e6,e.deleteQuery(u)}return m},dispose(){a&&(e.endQuery(s.TIME_ELAPSED_EXT),e.deleteQuery(a),a=null);for(const u of c.splice(0))e.deleteQuery(u)}}}const Ar=2e4,Rr=250,Mr=5e3;class Vr{#e=0;#t=0;#r=0;#n;constructor(e){this.#n=e}get pending(){return this.#e>0||this.#t>0}begin(e,s){this.#e=e+Ar,this.#t=s?e+Mr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+Rr,this.#t>0&&this.#n.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#n.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const Me=new WeakMap;function Or(r,e){if(!r)return e(),!0;if(Me.has(r))return!1;try{return e(),!0}catch(s){const o=s instanceof Error?s.message:String(s);return Me.set(r,o),j.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${o}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${st("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Lr(){const r=at();r.addEventListener("server-log",s=>{try{Se(JSON.parse(s.data))}catch{}});let e=!1;return(async()=>{try{const s=await it();if(e)return;for(const o of s)Se(o)}catch{}})(),()=>{e=!0,r.close()}}const Ie="viewportPose";function Fr(){const r=ct(Ie);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Ir(r,e){lt(Ie,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}const Ve={id:"world",title:"World",lights:[{color:"#ffffff",intensity:1,direction:[-10,-20,-10],space:"world"}],ambient:{color:"#ffffff",intensity:.5},environmentIntensity:0};yt(Ve),St("world",{all:{lighting:{source:"studio",studioPreset:Ve.id,auto:{takeover:["light"],overridable:!0}}}});function zr(r,e,s){const o=document.createElement("canvas");o.setAttribute("aria-label",`${s} authoring viewport`),o.setAttribute("data-testid","editor-canvas"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.pointerEvents="auto",r.appendChild(o);const c=Math.max(1,e.clientWidth),a=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);o.width=Math.ceil(c*m),o.height=Math.ceil(a*m);const u=Gt(new nr({canvas:o,antialias:!!Ht(void 0).antialias,powerPreference:"high-performance"}));return Kt(u,void 0,m),u.setSize(c,a),u.shadowMap.type=xr,u.info.autoReset=!1,Bt(u),{canvas:o,renderer:u,lease:null}}async function Wr(r){const e=pt(r.source,r.id);if(e)return e;let s=r.url,o=r.format??"gltf",c=r.includes;if(!s){const u=(await ft(r.source,r.id))[0];if(!u)return j.error(`No downloadable files for ${r.name}.`,"asset"),null;s=u.url,o=u.format,c=u.includes}const a={source:r.source,id:r.id,name:r.name,url:s,format:o};c&&(a.includes=c);const m=await yr(a);return m.ok&&m.path?`/${m.path}`:(j.error(`Could not download ${r.name}.`,"asset"),null)}function Nr(r){if(r.isCamera)return r;const e=Fe(r,"_camera");return e?.isCamera?e:null}function _r(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const s=r;return s.isOrthographicCamera?`Orthographic · ${s.zoom.toFixed(2)}×`:r.type}function Dr(r,e){const s=r.transforms;if(!s)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const o=s.editability?.(e,"position")??{writable:!0},c=s.editability?.(e,"rotation")??{writable:!0};return o.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:o.reason??c.reason??"This camera pose is read-only."}}function Qr(r,e,s){const o=e.get(s)??null;if(!o)return null;const c=Nr(o);return c?{id:s,name:o.name||c.name||"Camera",camera:c,lens:_r(c),...Dr(r,s)}:null}function $r(r){const e=new Map;for(const[s,o]of r.objectMap){const c=Fe(o,"tags");Array.isArray(c)&&c.length>0&&e.set(s,c)}return e}function Gr(r){const{store:e,documentId:s,container:o,canvas:c,renderer:a,stats:m}=r,u=new Jt(a),E=qt(),O=new Xt,g=$t(),L=Tr(a.getContext()),ze=t=>{g.enabled&&L.begin();try{t()}finally{L.end()}},We=()=>g.enabled?L.poll():null,Ne=ut({id:s,label:"Scene viewport",kind:"scene",profiler:g}),b=new Cr,re=11184810;let B=Ce(c).background??re;b.background=new ee(B);const _e=xe(c,()=>{const t=Ce(c).background??re,l=b.background;l instanceof ee&&l.getHex()===B&&(b.background=new ee(t)),B=t});e.bindScene(b,a);const n=new lr(c,b,e,o,{renderer:a,onlineAssetResolver:Wr,onProjectionChange:ur}),De=n.bindPresentation(s,"world");e.bindScene(b,a,n.batchedRenderer,n.camera),e.setOrbitTarget(n.orbitControls.target);const H=new D,F=new D,ne=new D,oe=()=>{const t=n.renderCamera;t.getWorldPosition(H),n.cameraViewMode==="pilot"?F.copy(n.orbitControls.target):n.cameraViewMode?(t.getWorldDirection(ne),F.copy(H).add(ne.multiplyScalar(10))):F.copy(n.orbitControls.target);const l=t.fov;return{position:H,target:F,fov:typeof l=="number"?l:0}},k=Sr({scene:b,store:e,documentId:s,container:o,canvas:c,viewport:n,readVisibleCameraPose:oe});let se="",q=null,h=null,S=null,I=null;const ae=()=>{h&&fr(h,ke(a.domElement))},Qe=xe(a.domElement,ae),ie=()=>{if(!h)return;const t=x(e.shell),l=[...e.shell.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>Z(t,e.objectMap,d)).filter(d=>d!==null);hr(h,l);const p=h.selection.size>0;S&&(S.enabled=p,S.renderToScreen=p),I&&(I.renderToScreen=!p)};function T(){bt(e.shell),q?.(),q=null,h&&gr(a,h,S),h=null,S=null,I=null,Yt(u,a,e.scene??b,n.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:$r(e)}),h=pr({BlendFunction:er,KernelSize:tr,OutlineEffect:rr},a,e.scene??b,n.renderCamera,ke(a.domElement)),ae(),I=u.passes.at(-1)??null,S=new Zt(n.renderCamera,h),S.enabled=!1,u.addPass(S),ie();const t=e.adoptedImageConfig;t&&(q=Ut(or,a,t))}const ce=()=>{n.setProjection(mr().projection),e.setViewportCamera(n.freeCamera),T()},$e=dr(ce);ce();const X=t=>Qr(x(e.shell),e.objectMap,t);let v=null;const A=()=>{v&&(je(x(e.shell),v),v=null)},le=()=>{const t=U().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(v=t.subject.id,Pe(x(e.shell),v))},ue=()=>{if(!v||n.cameraViewMode!=="pilot")return;const t=X(v),l=x(e.shell),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(v)}catch(w){j.error(w instanceof Error?w.message:String(w),"camera-authoring"),A();return}Ee(l,v,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.shell.notifyIngestEdit()};n.orbitControls.addEventListener("start",le),n.orbitControls.addEventListener("change",ue),n.orbitControls.addEventListener("end",A);const Ge=Qt({active:()=>e.shell.playState==="stopped"&&e.shell.activeViewportTab==="edit",selected:()=>{const t=e.shell.selectedEntityId;return t?X(t):null},resolve:X,showView:(t,l)=>{A(),n.setCameraView(t.camera,l),T(),k.reportCamera()},leaveView:()=>{A(),n.clearCameraView(),T(),k.reportCamera()},alignToViewport:t=>{const l=x(e.shell),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const w=n.camera.getWorldPosition(new D),C=n.camera.getWorldQuaternion(new Re),y=w.clone(),R=C.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(y);const M=d.parent.getWorldQuaternion(new Re);R.premultiply(M.invert())}let ye;try{ye=p.get(t.id)}catch(M){j.error(M instanceof Error?M.message:String(M),"camera-authoring");return}Pe(l,t.id),Ee(l,t.id,{position:y.toArray(),rotation:R.toArray(),scale:ye.scale}),e.shell.notifyIngestEdit(),je(l,t.id)},subscribe:e.shell.subscribe});let de=null;const me=()=>{const t=ht(e.shell);t!==de&&(de=t,c.style.opacity=t?"1":"0",o.style.backgroundColor=t?"":gt.surface.raised,o.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",o.style.backgroundPosition=t?"":"0 0, 8px 8px",o.style.backgroundSize=t?"":"16px 16px")};me();let pe=e.composerVersion;const Ue=e.shell.subscribe(()=>{me();const t=e.scene;t&&t!==n.currentScene&&n.setScene(t),n.objectMap=e.objectMap,n.syncFromStore(),e.composerVersion!==pe?(pe=e.composerVersion,T()):ie()});let z=null;const K=new Vr({seedFromGameCamera:()=>{const t=z?.()??null;return!!t&&n.seedFromGameCamera(t)},frameContent:()=>n.focusOnScene()}),fe=()=>{K.cancel(),z=null};n.orbitControls.addEventListener("start",fe);const he=()=>Ir(n.camera,n.orbitControls.target);n.orbitControls.addEventListener("end",he);const Be=e.shell.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=Z(x(e.shell),e.objectMap,t.id);l&&n.focusOn(l);break}case"focus-scene":{{const l=Fr();if(l){n.camera.position.set(...l.position),n.orbitControls.target.set(...l.target),n.orbitControls.update();break}}z=e.sceneCameraLookup,K.begin(performance.now(),z!==null);break}case"focus-selection":{const l=x(e.shell),p=[...e.shell.selectedEntityIds].map(d=>Z(l,e.objectMap,d)).filter(d=>d!==null);n.focusOnMultiple(p);break}case"snap-selection-to-floor":n.snapSelectionToFloor();break;case"set-view-preset":n.setViewPreset(t.preset);break;case"step-view":n.stepView(t.step);break;case"frame-all":n.focusOnScene();break;case"zoom-view":n.zoomStep(t.direction);break;case"set-camera-pose":n.setPose(t.position,t.target,t.fov);break}});Lr();const ge=new ResizeObserver(()=>{const t=Math.max(1,o.clientWidth),l=Math.max(1,o.clientHeight);a.setSize(t,l),u.setSize(t,l),n.resize(t,l)});ge.observe(o);let W=performance.now(),N=!0,P=!1,be=!1;function ve(t){return Or(n.currentScene,()=>{E.render(a,n.currentScene,n.renderCamera),n.renderWithInfrastructure(()=>{vr(n.currentScene,()=>O.render(n.currentScene,e.shadingMode,()=>u.render(t),br)),n.renderViewCube(a),n.renderCameraPreview(a,U().preview?.camera??null,r.cameraPreview())})})}const He=ir(c,async()=>{if(P||!cr()||!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ve(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),Y=()=>wt(e.shell)===e.shell;function qe(t,l){if(P)return;if(l&&(W=t),!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){W=t,N=!0,n.resolvePresentation();return}g.beginFrame();const p=t-W,d=p/1e3;Y()&&(m.frameTime=p,m.fps=1e3/p),W=t,k.syncMarkers(d),K.tick(t),g.beginPhase(),n.update(d),r.runFrame(d),n.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),a.info.reset(),ze(()=>{ve(d)}),g.reportRender({gpuMs:We(),drawCalls:a.info.render.calls,triangles:a.info.render.triangles,geometries:a.info.memory.geometries,textures:a.info.memory.textures}),g.endPhase("render"),Y()&&(m.drawCalls=a.info.render.calls,m.triangles=a.info.render.triangles),N&&be&&(N=!1,vt(s)),g.endFrame();const w=oe(),C=w.position,y=w.target;Y()&&(m.cameraPosition.x=C.x,m.cameraPosition.y=C.y,m.cameraPosition.z=C.z,m.cameraTarget.x=y.x,m.cameraTarget.y=y.y,m.cameraTarget.z=y.z);const R=`${C.x},${C.y},${C.z},${y.x},${y.y},${y.z},${w.fov}`;R!==se&&(se=R,k.reportCamera())}n.objectMap=e.objectMap,n.syncFromStore(),T();let J,_;async function Xe(t){if(P)return;r.onMountStatus("mounting"),_?.(),_=void 0,J=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=sr("three");if(P||J!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:a}):()=>{};if(P||J!==t){p();return}_=p,P||r.onMountStatus("ready")}const we=ar(e.shell,Xe);return we.ready.then(()=>dt(mt(e.shell))).catch(t=>{j.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{be=!0,N=!0}),{scene:b,viewport:n,frame:qe,present:t=>wr(e,t),setHelper:(t,l)=>n.setHelper(t,l),dispose:()=>{P=!0,Ne(),He(),ge.disconnect(),Ue(),Be(),Ge(),n.orbitControls.removeEventListener("start",le),n.orbitControls.removeEventListener("change",ue),n.orbitControls.removeEventListener("end",A),n.orbitControls.removeEventListener("start",fe),n.orbitControls.removeEventListener("end",he),we.dispose(),_?.(),k.dispose(),O.dispose(),L.dispose(),$e(),Qe(),_e(),De(),h?.selection.clear(),E.dispose(),u.dispose()}}}function Ur({store:r,rootIds:e,mountStatus:s}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getSnapshot);const o=f.useSyncExternalStore(kt,Tt),c=f.useSyncExternalStore(At,Rt),a=r.scene?.background,m=a!==null&&!(a?.isColor===!0&&a.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&It(r.scene,{includeBackground:!1,ignoredLayer:Ke})),[r.scene,r.shell.contentVersion]),E=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:s==="mounting"?"loading":"ready",content:E?"present":s==="mounting"?"unknown":"empty",readiness:o,failures:c});return i.jsx(Ft,{explanation:O,testId:"scene-viewport-status"})}function Br({store:r,documentId:e,cameraPreviewRef:s,mountStatus:o,rootIds:c}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getShellSnapshot??r.shell.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(Mt,Vt),f.useSyncExternalStore(Pt,Et);const a=jt(r.shell,e,"document");return i.jsxs(i.Fragment,{children:[a.surface!==null?i.jsx(Ot,{}):null,a.surface==="three"?i.jsx(kr,{previewRef:s}):null,i.jsx(Ur,{store:r,rootIds:c,mountStatus:o})]})}const ko={mountWorldRootSurface:zr,installWorldRootStage:Gr,Overlays:Br};export{ko as worldRootStageBinding};
@@ -1 +1 @@
1
- import{collectMachineAnimationMeta as V,clipNamesOf as L,isBlendTreeAnimationMeta as S,asBlendTreeDef as z}from"./xstate-animation-meta-DrlSAelK.js";import{cW as J,p as Z,c as _,cQ as ee,l as te,dk as ne,cf as ie,cd as oe}from"./three.core-3arARmh6.js";import"./index-CXHgcixX.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";class M extends Error{constructor(i,c){super(i),this.stateId=c,this.name="AnimationBindingError"}}function ae(n){const i=n.logic;if(i?.root)return i;const c=n.getSnapshot();if(c?.machine?.root)return c.machine;throw new M("[bindXStateAnimation] the actor exposes no state machine — only a state-machine actor carries the `meta.animation` this binder reads")}const W=n=>n.layer??"base",B=n=>n.weight??1,I=n=>n.blendMode??"override";function T(n){try{return ne.parseTrackName(n.name).nodeName??""}catch{const i=n.name.indexOf(".");return i<0?n.name:n.name.slice(0,i)}}function C(n,i,c){const o=new Set,l=[];for(const f of i){let u=!1;n.traverse(m=>{m.name===f&&(u=!0,m.traverse(d=>{d.name&&o.add(d.name)}))}),c.has(f)&&(u=!0,o.add(f)),u||l.push(f)}return{names:o,missing:l}}function se(n,i,c,o){const l=new Set(n.tracks.map(T)),f=i.include?C(c,i.include,l):void 0,u=i.exclude?C(c,i.exclude,l):void 0,m=[...f?.missing??[],...u?.missing??[]];if(m.length)throw new M(`[bindXStateAnimation] state "${o}" boneMask names unknown bones/objects: ${m.join(", ")}`,o);const d=n.tracks.filter(p=>{const w=T(p);return(!f||f.names.has(w))&&!u?.names.has(w)});if(d.length===0)throw new M(`[bindXStateAnimation] state "${o}" boneMask removes every track from clip "${n.name}"`,o);return new te(n.name,n.duration,d.map(p=>p.clone()))}function re(n){return n.reduce((i,c)=>c.weight>i.weight?c:i,n[0])}function Se(n,i,c,o={}){const l=i.getRoot(),f=o.root??(l instanceof J?l:void 0);if(!f)throw new M("[bindXStateAnimation] a THREE.Object3D `root` option is required when the mixer uses AnimationObjectGroup");const u=ae(n).root,m=V(u),d=new Map(m.map(t=>[t.stateId,t.meta]));for(const t of m)for(const e of L(t.meta))if(!c.has(e))throw new M(`[bindXStateAnimation] state "${t.stateId}" references clip "${e}", which is not present in the supplied clips map. Known clips: ${[...c.keys()].join(", ")||"(none)"}`,t.stateId);const p=new Map;function w(t,e,s){return W(e)!=="base"||!!e.boneMask||I(e)==="additive"?`${t}\0${s}`:s}for(const{stateId:t,meta:e}of m)for(const s of L(e)){const a=w(t,e,s);if(p.has(a))continue;const r=c.get(s);let h=e.boneMask?se(r,e.boneMask,f,t):r;(h!==r||a!==s)&&(h===r&&(h=r.clone()),h.name=`${r.name}@${W(e)}:${t}`),I(e)==="additive"?(Z.makeClipAdditive(h),h.blendMode=_):h.blendMode=ee,p.set(a,h)}const g=new Map;function K(t,e,s,a){let r=g.get(t);if(!r){const h=p.get(t);if(!h)throw new M(`[bindXStateAnimation] prepared clip "${t}" not found`);const v=i.clipAction(h);v.setEffectiveWeight(0),v.play(),r={action:v,clip:h},g.set(t,r)}return r.action.setLoop(e?ie:oe,1/0),r.action.clampWhenFinished=!e,r.action.timeScale=s,r.action.weight=a,r.action}function N(t){const e=o.selectParameters?o.selectParameters(t):t;return new Map(Object.entries(e??{}))}function D(t,e,s){return(S(e)?ce(z(e.blendTree),N(s)):[{clip:e.clip,weight:1}]).map(({clip:r,weight:h})=>({clip:r,weight:h,actionKey:w(t,e,r)}))}const y=new Map;let O=!1;function R(t,e,s){for(const a of t){if(a.actionKey===e)continue;const r=g.get(a.actionKey)?.action;r&&(s>0?r.fadeOut(s):r.setEffectiveWeight(0))}}function k(t,e){if(!S(t.meta))return;t.natural=D(t.stateId,t.meta,e);const s=B(t.meta);for(const a of t.natural)g.get(a.actionKey)?.action.setEffectiveWeight(a.weight*s)}function P(t,e,s){const a=W(e),r=y.get(a)??null,h=D(t,e,s),v=re(h),H=S(e)?!0:e.loop,Q=S(e)?1:e.speed,x=B(e);for(const b of h)K(b.actionKey,H,Q,x);const $=g.get(v.actionKey).action;$.reset().setEffectiveWeight(x);for(const b of h)b.actionKey!==v.actionKey&&g.get(b.actionKey).action.reset().setEffectiveWeight(0);const A=e.crossfade?.duration??0,U=e.crossfade?.warp??!1;if(!r)A>0&&$.fadeIn(A);else{R(r.natural,r.dominantActionKey,A);const b=g.get(r.dominantActionKey)?.action;b&&A>0?b.crossFadeTo($,A,U):(b?.setEffectiveWeight(0),$.setEffectiveWeight(x))}const j={layer:a,stateId:t,meta:e,natural:h,dominantActionKey:v.actionKey,crossfadeRemaining:A};y.set(a,j),S(e)&&A<=0&&k(j,s)}function q(t){return Object.keys(t.getMeta()).filter(e=>d.has(e))}function X(t){const e=new Map;for(const s of q(t)){const a=d.get(s),r=W(a),h=e.get(r);if(h)throw new M(`[bindXStateAnimation] animated states "${h}" and "${s}" are both active on layer "${r}". Give parallel regions distinct meta.animation.layer names.`,s);e.set(r,s)}for(const[s,a]of y)e.has(s)||(R(a.natural,void 0,0),y.delete(s));for(const[s,a]of e)y.get(s)?.stateId!==a&&P(a,d.get(a),t.context)}const F=n.getSnapshot();X(F);const G=n.subscribe(t=>{O||X(t)});function E(t){if(O)return;const e=t,s=n.getSnapshot().context;for(const a of y.values())a.crossfadeRemaining>0?(a.crossfadeRemaining=Math.max(0,a.crossfadeRemaining-e),a.crossfadeRemaining<=0&&k(a,s)):k(a,s);i.update(e)}const Y={tick:E,actor:n,getParameters:()=>N(n.getSnapshot().context),getActiveLayers:()=>[...y.values()].map(t=>({layer:t.layer,stateId:t.stateId,clips:t.natural.map(e=>e.clip),clipWeights:t.natural.map(e=>({clip:e.clip,weight:g.get(e.actionKey)?.action.getEffectiveWeight()??0})),weight:B(t.meta),blendMode:I(t.meta),...t.meta.boneMask?{boneMask:t.meta.boneMask}:{}})),dispose(){if(!O){O=!0,o.systems?.remove("animation",E),G.unsubscribe();for(const{action:t,clip:e}of g.values())t.stop(),i.uncacheAction(e,t.getRoot());g.clear(),y.clear()}}};return o.systems?.add("animation",E),Y}function ce(n,i){switch(n.type){case"1D":return le(n,i);case"2D":return fe(n,i);case"direct":return de(n);default:return n.children.map(c=>({clip:c.clip,weight:1/n.children.length}))}}function le(n,i){const c=Number(i.get(n.parameter)??0),o=[...n.children].sort((f,u)=>f.threshold-u.threshold),l=o.map(f=>({clip:f.clip,weight:0}));if(o.length===0)return l;if(o.length===1||c<=o[0].threshold)return l[0].weight=1,l;if(c>=o[o.length-1].threshold)return l[l.length-1].weight=1,l;for(let f=0;f<o.length-1;f++){const u=o[f],m=o[f+1];if(c>=u.threshold&&c<=m.threshold){const d=m.threshold-u.threshold,p=d>0?(c-u.threshold)/d:0;return l[f].weight=1-p,l[f+1].weight=p,l}}return l}function fe(n,i){const c=Number(i.get(n.parameter)??0),o=Number(i.get(n.parameterY??"")??0),l=n.children,f=l.map(d=>({clip:d.clip,weight:0}));let u=0;const m=[];for(const d of l){const p=c-d.threshold,w=o-(d.thresholdY??0),g=Math.sqrt(p*p+w*w),K=g<.001?1e3:1/g;m.push(K),u+=K}if(u>0)for(let d=0;d<f.length;d++)f[d].weight=m[d]/u;return f}function de(n){const i=n.children.map(o=>({clip:o.clip,weight:o.weight??0})),c=i.reduce((o,l)=>o+l.weight,0);if(c>0)for(const o of i)o.weight/=c;return i}export{M as AnimationBindingError,Se as bindXStateAnimation,ce as evaluateBlendTree,ae as machineOfXStateActor};
1
+ import{collectMachineAnimationMeta as V,clipNamesOf as L,isBlendTreeAnimationMeta as S,asBlendTreeDef as z}from"./xstate-animation-meta-D2a-1xiq.js";import{cW as J,p as Z,c as _,cQ as ee,l as te,dk as ne,cf as ie,cd as oe}from"./three.core-3arARmh6.js";import"./index-Jv2cn0dw.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";class M extends Error{constructor(i,c){super(i),this.stateId=c,this.name="AnimationBindingError"}}function ae(n){const i=n.logic;if(i?.root)return i;const c=n.getSnapshot();if(c?.machine?.root)return c.machine;throw new M("[bindXStateAnimation] the actor exposes no state machine — only a state-machine actor carries the `meta.animation` this binder reads")}const W=n=>n.layer??"base",B=n=>n.weight??1,I=n=>n.blendMode??"override";function T(n){try{return ne.parseTrackName(n.name).nodeName??""}catch{const i=n.name.indexOf(".");return i<0?n.name:n.name.slice(0,i)}}function C(n,i,c){const o=new Set,l=[];for(const f of i){let u=!1;n.traverse(m=>{m.name===f&&(u=!0,m.traverse(d=>{d.name&&o.add(d.name)}))}),c.has(f)&&(u=!0,o.add(f)),u||l.push(f)}return{names:o,missing:l}}function se(n,i,c,o){const l=new Set(n.tracks.map(T)),f=i.include?C(c,i.include,l):void 0,u=i.exclude?C(c,i.exclude,l):void 0,m=[...f?.missing??[],...u?.missing??[]];if(m.length)throw new M(`[bindXStateAnimation] state "${o}" boneMask names unknown bones/objects: ${m.join(", ")}`,o);const d=n.tracks.filter(p=>{const w=T(p);return(!f||f.names.has(w))&&!u?.names.has(w)});if(d.length===0)throw new M(`[bindXStateAnimation] state "${o}" boneMask removes every track from clip "${n.name}"`,o);return new te(n.name,n.duration,d.map(p=>p.clone()))}function re(n){return n.reduce((i,c)=>c.weight>i.weight?c:i,n[0])}function Se(n,i,c,o={}){const l=i.getRoot(),f=o.root??(l instanceof J?l:void 0);if(!f)throw new M("[bindXStateAnimation] a THREE.Object3D `root` option is required when the mixer uses AnimationObjectGroup");const u=ae(n).root,m=V(u),d=new Map(m.map(t=>[t.stateId,t.meta]));for(const t of m)for(const e of L(t.meta))if(!c.has(e))throw new M(`[bindXStateAnimation] state "${t.stateId}" references clip "${e}", which is not present in the supplied clips map. Known clips: ${[...c.keys()].join(", ")||"(none)"}`,t.stateId);const p=new Map;function w(t,e,s){return W(e)!=="base"||!!e.boneMask||I(e)==="additive"?`${t}\0${s}`:s}for(const{stateId:t,meta:e}of m)for(const s of L(e)){const a=w(t,e,s);if(p.has(a))continue;const r=c.get(s);let h=e.boneMask?se(r,e.boneMask,f,t):r;(h!==r||a!==s)&&(h===r&&(h=r.clone()),h.name=`${r.name}@${W(e)}:${t}`),I(e)==="additive"?(Z.makeClipAdditive(h),h.blendMode=_):h.blendMode=ee,p.set(a,h)}const g=new Map;function K(t,e,s,a){let r=g.get(t);if(!r){const h=p.get(t);if(!h)throw new M(`[bindXStateAnimation] prepared clip "${t}" not found`);const v=i.clipAction(h);v.setEffectiveWeight(0),v.play(),r={action:v,clip:h},g.set(t,r)}return r.action.setLoop(e?ie:oe,1/0),r.action.clampWhenFinished=!e,r.action.timeScale=s,r.action.weight=a,r.action}function N(t){const e=o.selectParameters?o.selectParameters(t):t;return new Map(Object.entries(e??{}))}function D(t,e,s){return(S(e)?ce(z(e.blendTree),N(s)):[{clip:e.clip,weight:1}]).map(({clip:r,weight:h})=>({clip:r,weight:h,actionKey:w(t,e,r)}))}const y=new Map;let O=!1;function R(t,e,s){for(const a of t){if(a.actionKey===e)continue;const r=g.get(a.actionKey)?.action;r&&(s>0?r.fadeOut(s):r.setEffectiveWeight(0))}}function k(t,e){if(!S(t.meta))return;t.natural=D(t.stateId,t.meta,e);const s=B(t.meta);for(const a of t.natural)g.get(a.actionKey)?.action.setEffectiveWeight(a.weight*s)}function P(t,e,s){const a=W(e),r=y.get(a)??null,h=D(t,e,s),v=re(h),H=S(e)?!0:e.loop,Q=S(e)?1:e.speed,x=B(e);for(const b of h)K(b.actionKey,H,Q,x);const $=g.get(v.actionKey).action;$.reset().setEffectiveWeight(x);for(const b of h)b.actionKey!==v.actionKey&&g.get(b.actionKey).action.reset().setEffectiveWeight(0);const A=e.crossfade?.duration??0,U=e.crossfade?.warp??!1;if(!r)A>0&&$.fadeIn(A);else{R(r.natural,r.dominantActionKey,A);const b=g.get(r.dominantActionKey)?.action;b&&A>0?b.crossFadeTo($,A,U):(b?.setEffectiveWeight(0),$.setEffectiveWeight(x))}const j={layer:a,stateId:t,meta:e,natural:h,dominantActionKey:v.actionKey,crossfadeRemaining:A};y.set(a,j),S(e)&&A<=0&&k(j,s)}function q(t){return Object.keys(t.getMeta()).filter(e=>d.has(e))}function X(t){const e=new Map;for(const s of q(t)){const a=d.get(s),r=W(a),h=e.get(r);if(h)throw new M(`[bindXStateAnimation] animated states "${h}" and "${s}" are both active on layer "${r}". Give parallel regions distinct meta.animation.layer names.`,s);e.set(r,s)}for(const[s,a]of y)e.has(s)||(R(a.natural,void 0,0),y.delete(s));for(const[s,a]of e)y.get(s)?.stateId!==a&&P(a,d.get(a),t.context)}const F=n.getSnapshot();X(F);const G=n.subscribe(t=>{O||X(t)});function E(t){if(O)return;const e=t,s=n.getSnapshot().context;for(const a of y.values())a.crossfadeRemaining>0?(a.crossfadeRemaining=Math.max(0,a.crossfadeRemaining-e),a.crossfadeRemaining<=0&&k(a,s)):k(a,s);i.update(e)}const Y={tick:E,actor:n,getParameters:()=>N(n.getSnapshot().context),getActiveLayers:()=>[...y.values()].map(t=>({layer:t.layer,stateId:t.stateId,clips:t.natural.map(e=>e.clip),clipWeights:t.natural.map(e=>({clip:e.clip,weight:g.get(e.actionKey)?.action.getEffectiveWeight()??0})),weight:B(t.meta),blendMode:I(t.meta),...t.meta.boneMask?{boneMask:t.meta.boneMask}:{}})),dispose(){if(!O){O=!0,o.systems?.remove("animation",E),G.unsubscribe();for(const{action:t,clip:e}of g.values())t.stop(),i.uncacheAction(e,t.getRoot());g.clear(),y.clear()}}};return o.systems?.add("animation",E),Y}function ce(n,i){switch(n.type){case"1D":return le(n,i);case"2D":return fe(n,i);case"direct":return de(n);default:return n.children.map(c=>({clip:c.clip,weight:1/n.children.length}))}}function le(n,i){const c=Number(i.get(n.parameter)??0),o=[...n.children].sort((f,u)=>f.threshold-u.threshold),l=o.map(f=>({clip:f.clip,weight:0}));if(o.length===0)return l;if(o.length===1||c<=o[0].threshold)return l[0].weight=1,l;if(c>=o[o.length-1].threshold)return l[l.length-1].weight=1,l;for(let f=0;f<o.length-1;f++){const u=o[f],m=o[f+1];if(c>=u.threshold&&c<=m.threshold){const d=m.threshold-u.threshold,p=d>0?(c-u.threshold)/d:0;return l[f].weight=1-p,l[f+1].weight=p,l}}return l}function fe(n,i){const c=Number(i.get(n.parameter)??0),o=Number(i.get(n.parameterY??"")??0),l=n.children,f=l.map(d=>({clip:d.clip,weight:0}));let u=0;const m=[];for(const d of l){const p=c-d.threshold,w=o-(d.thresholdY??0),g=Math.sqrt(p*p+w*w),K=g<.001?1e3:1/g;m.push(K),u+=K}if(u>0)for(let d=0;d<f.length;d++)f[d].weight=m[d]/u;return f}function de(n){const i=n.children.map(o=>({clip:o.clip,weight:o.weight??0})),c=i.reduce((o,l)=>o+l.weight,0);if(c>0)for(const o of i)o.weight/=c;return i}export{M as AnimationBindingError,Se as bindXStateAnimation,ce as evaluateBlendTree,ae as machineOfXStateActor};
@@ -1 +1 @@
1
- import{dZ as b,d_ as u,u as o,v as c,w as n,x as l,c6 as r,c5 as m,c4 as f}from"./index-CXHgcixX.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 d=o({clip:n().min(1).describe("Animation clip name this child plays"),threshold:r().describe("1D/2D blend position on the primary parameter axis"),thresholdY:r().optional().describe("2D blend position on the secondary parameter axis (2D blend trees only)"),weight:r().min(0).optional().describe('Explicit weight for "direct" blend trees (ignored by 1D/2D)')}).strict(),y=o({type:l("1D").describe("Interpolates linearly between sorted children by threshold"),parameter:n().min(1).describe("Context/selector value driving the blend"),children:c(d).min(2,"1D blend tree needs at least 2 children to interpolate between")}).strict(),v=o({type:l("2D").describe("Inverse-distance-weights children by (parameter, parameterY) position"),parameter:n().min(1).describe("Primary axis context/selector value"),parameterY:n().min(1).describe("Secondary axis context/selector value"),children:c(d.extend({thresholdY:r()})).min(1,"2D blend tree needs at least 1 child")}).strict(),g=o({type:l("direct").describe("Each child has an explicit weight, normalized to sum to 1"),parameter:n().default(""),children:c(d.extend({weight:r().min(0)})).min(1,"direct blend tree needs at least 1 child")}).strict(),A=b("type",[y,v,g]);function Y(e){return e}const p=o({duration:r().min(0).default(0).describe("Seconds to blend from the previously active clip into this state on entry, applied via native `AnimationAction.crossFadeTo`/`fadeIn` (E2). 0 = instant activation, no fade."),warp:m().default(!1).describe("Passed through to AnimationAction.crossFadeTo's `warp` param — linearly warps timeScale across the two clips during the blend so differing clip lengths line up. Default false.")}).strict().describe("Blend-in/out/crossfade timing for entering this state"),x=o({include:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are retained"),exclude:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are removed")}).strict().refine(e=>!!(e.include?.length||e.exclude?.length),{message:"boneMask needs at least one include or exclude bone name"}).describe("Filters animation tracks by named Object3D/Bone subtrees"),h={layer:n().min(1).optional().describe("Composition layer name; omitted means the single base layer"),weight:r().min(0).max(1).optional().describe("Layer weight multiplier from 0 to 1; defaults to 1"),blendMode:f(["override","additive"]).optional().describe("Native Three normal/override or additive action blending; defaults to override"),boneMask:x.optional().describe("Optional include/exclude filter applied to every clip track in this state")},w=o({clip:n().min(1).describe("Single clip to play while this XState state is active"),loop:m().default(!0).describe("Loop the clip (THREE.LoopRepeat) vs play once (THREE.LoopOnce, clamped on last frame)"),speed:r().positive().default(1).describe("Playback speed multiplier (AnimationAction.timeScale)"),crossfade:p.optional(),...h}).strict(),S=o({blendTree:A.describe("Multiple clips blended by a live context/selector-driven parameter"),crossfade:p.optional(),...h}).strict(),D=u([w,S]);function M(e){return"clip"in e}function $(e){return"blendTree"in e}class T extends Error{constructor(a,i,t){super(a),this.stateId=i,this.issues=t,this.name="AnimationMetaValidationError"}}function B(e,a){const i=D.safeParse(a);if(!i.success){const t=i.error.issues.map(s=>`${s.path.length?s.path.join("."):"(root)"}: ${s.message}`).join("; ");throw new T(`[xstate-animation] invalid meta.animation for state "${e}": ${t}`,e,i.error.issues)}return i.data}function R(e){const a=[],i=t=>{t.meta&&"animation"in t.meta&&t.meta.animation!==void 0&&a.push({stateId:t.id,meta:B(t.id,t.meta.animation)});for(const s of Object.values(t.states??{}))i(s)};return i(e),a}function H(e){return M(e)?[e.clip]:e.blendTree.children.map(a=>a.clip)}export{A as AnimationBlendTreeSchema,T as AnimationMetaValidationError,D as StateAnimationMetaSchema,Y as asBlendTreeDef,H as clipNamesOf,R as collectMachineAnimationMeta,$ as isBlendTreeAnimationMeta,M as isClipAnimationMeta,B as parseStateAnimationMeta};
1
+ import{dZ as b,d_ as u,u as o,v as c,w as n,x as l,c6 as r,c5 as m,c4 as f}from"./index-Jv2cn0dw.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 d=o({clip:n().min(1).describe("Animation clip name this child plays"),threshold:r().describe("1D/2D blend position on the primary parameter axis"),thresholdY:r().optional().describe("2D blend position on the secondary parameter axis (2D blend trees only)"),weight:r().min(0).optional().describe('Explicit weight for "direct" blend trees (ignored by 1D/2D)')}).strict(),y=o({type:l("1D").describe("Interpolates linearly between sorted children by threshold"),parameter:n().min(1).describe("Context/selector value driving the blend"),children:c(d).min(2,"1D blend tree needs at least 2 children to interpolate between")}).strict(),v=o({type:l("2D").describe("Inverse-distance-weights children by (parameter, parameterY) position"),parameter:n().min(1).describe("Primary axis context/selector value"),parameterY:n().min(1).describe("Secondary axis context/selector value"),children:c(d.extend({thresholdY:r()})).min(1,"2D blend tree needs at least 1 child")}).strict(),g=o({type:l("direct").describe("Each child has an explicit weight, normalized to sum to 1"),parameter:n().default(""),children:c(d.extend({weight:r().min(0)})).min(1,"direct blend tree needs at least 1 child")}).strict(),A=b("type",[y,v,g]);function Y(e){return e}const p=o({duration:r().min(0).default(0).describe("Seconds to blend from the previously active clip into this state on entry, applied via native `AnimationAction.crossFadeTo`/`fadeIn` (E2). 0 = instant activation, no fade."),warp:m().default(!1).describe("Passed through to AnimationAction.crossFadeTo's `warp` param — linearly warps timeScale across the two clips during the blend so differing clip lengths line up. Default false.")}).strict().describe("Blend-in/out/crossfade timing for entering this state"),x=o({include:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are retained"),exclude:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are removed")}).strict().refine(e=>!!(e.include?.length||e.exclude?.length),{message:"boneMask needs at least one include or exclude bone name"}).describe("Filters animation tracks by named Object3D/Bone subtrees"),h={layer:n().min(1).optional().describe("Composition layer name; omitted means the single base layer"),weight:r().min(0).max(1).optional().describe("Layer weight multiplier from 0 to 1; defaults to 1"),blendMode:f(["override","additive"]).optional().describe("Native Three normal/override or additive action blending; defaults to override"),boneMask:x.optional().describe("Optional include/exclude filter applied to every clip track in this state")},w=o({clip:n().min(1).describe("Single clip to play while this XState state is active"),loop:m().default(!0).describe("Loop the clip (THREE.LoopRepeat) vs play once (THREE.LoopOnce, clamped on last frame)"),speed:r().positive().default(1).describe("Playback speed multiplier (AnimationAction.timeScale)"),crossfade:p.optional(),...h}).strict(),S=o({blendTree:A.describe("Multiple clips blended by a live context/selector-driven parameter"),crossfade:p.optional(),...h}).strict(),D=u([w,S]);function M(e){return"clip"in e}function $(e){return"blendTree"in e}class T extends Error{constructor(a,i,t){super(a),this.stateId=i,this.issues=t,this.name="AnimationMetaValidationError"}}function B(e,a){const i=D.safeParse(a);if(!i.success){const t=i.error.issues.map(s=>`${s.path.length?s.path.join("."):"(root)"}: ${s.message}`).join("; ");throw new T(`[xstate-animation] invalid meta.animation for state "${e}": ${t}`,e,i.error.issues)}return i.data}function R(e){const a=[],i=t=>{t.meta&&"animation"in t.meta&&t.meta.animation!==void 0&&a.push({stateId:t.id,meta:B(t.id,t.meta.animation)});for(const s of Object.values(t.states??{}))i(s)};return i(e),a}function H(e){return M(e)?[e.clip]:e.blendTree.children.map(a=>a.clip)}export{A as AnimationBlendTreeSchema,T as AnimationMetaValidationError,D as StateAnimationMetaSchema,Y as asBlendTreeDef,H as clipNamesOf,R as collectMachineAnimationMeta,$ as isBlendTreeAnimationMeta,M as isClipAnimationMeta,B as parseStateAnimationMeta};
package/dist-node/cli.js CHANGED
@@ -2313,7 +2313,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
2313
2313
  var package_default = {
2314
2314
  name: "@volter/game-editor",
2315
2315
  author: "Volter AI, Inc.",
2316
- version: "0.5.86",
2316
+ version: "0.5.88",
2317
2317
  publishConfig: {
2318
2318
  access: "public"
2319
2319
  },
@@ -2362,22 +2362,22 @@ var package_default = {
2362
2362
  }
2363
2363
  },
2364
2364
  dependencies: {
2365
- "@volter/editor-core": "0.5.86",
2366
- "@volter/editor-game": "0.5.86",
2367
- "@volter/editor-react": "0.5.86",
2368
- "@volter/editor-threejs": "0.5.86",
2369
- "@volter/editor-xstate": "0.5.86",
2370
- "@volter/editor-blender": "0.1.26",
2371
- "@volter/dawproject": "0.5.86",
2372
- "@volter/editor-dawproject": "0.5.86",
2373
- "@volter/blender-engine": "0.1.24",
2374
- "@volter/editor-project": "0.5.86",
2375
- "@volter/editor-sdk": "0.5.86",
2376
- "@volter/editor-live": "0.5.86",
2377
- "@volter/game-live": "0.5.86",
2365
+ "@volter/editor-core": "0.5.88",
2366
+ "@volter/editor-game": "0.5.88",
2367
+ "@volter/editor-react": "0.5.88",
2368
+ "@volter/editor-threejs": "0.5.88",
2369
+ "@volter/editor-xstate": "0.5.88",
2370
+ "@volter/editor-blender": "0.1.28",
2371
+ "@volter/dawproject": "0.5.88",
2372
+ "@volter/editor-dawproject": "0.5.88",
2373
+ "@volter/blender-engine": "0.1.26",
2374
+ "@volter/editor-project": "0.5.88",
2375
+ "@volter/editor-sdk": "0.5.88",
2376
+ "@volter/editor-live": "0.5.88",
2377
+ "@volter/game-live": "0.5.88",
2378
2378
  "@modelcontextprotocol/sdk": "1.30.0",
2379
- "@volter/game-runtime": "0.5.86",
2380
- "@volter/threejs-runtime": "0.5.86",
2379
+ "@volter/game-runtime": "0.5.88",
2380
+ "@volter/threejs-runtime": "0.5.88",
2381
2381
  undici: "7.29.1",
2382
2382
  typescript: "5.9.3",
2383
2383
  "@colyseus/schema": "^4.0.14",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/game-editor",
3
3
  "author": "Volter AI, Inc.",
4
- "version": "0.5.86",
4
+ "version": "0.5.88",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -50,22 +50,22 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "@volter/editor-core": "0.5.86",
54
- "@volter/editor-game": "0.5.86",
55
- "@volter/editor-react": "0.5.86",
56
- "@volter/editor-threejs": "0.5.86",
57
- "@volter/editor-xstate": "0.5.86",
58
- "@volter/editor-blender": "0.1.26",
59
- "@volter/dawproject": "0.5.86",
60
- "@volter/editor-dawproject": "0.5.86",
61
- "@volter/blender-engine": "0.1.24",
62
- "@volter/editor-project": "0.5.86",
63
- "@volter/editor-sdk": "0.5.86",
64
- "@volter/editor-live": "0.5.86",
65
- "@volter/game-live": "0.5.86",
53
+ "@volter/editor-core": "0.5.88",
54
+ "@volter/editor-game": "0.5.88",
55
+ "@volter/editor-react": "0.5.88",
56
+ "@volter/editor-threejs": "0.5.88",
57
+ "@volter/editor-xstate": "0.5.88",
58
+ "@volter/editor-blender": "0.1.28",
59
+ "@volter/dawproject": "0.5.88",
60
+ "@volter/editor-dawproject": "0.5.88",
61
+ "@volter/blender-engine": "0.1.26",
62
+ "@volter/editor-project": "0.5.88",
63
+ "@volter/editor-sdk": "0.5.88",
64
+ "@volter/editor-live": "0.5.88",
65
+ "@volter/game-live": "0.5.88",
66
66
  "@modelcontextprotocol/sdk": "1.30.0",
67
- "@volter/game-runtime": "0.5.86",
68
- "@volter/threejs-runtime": "0.5.86",
67
+ "@volter/game-runtime": "0.5.88",
68
+ "@volter/threejs-runtime": "0.5.88",
69
69
  "undici": "7.29.1",
70
70
  "typescript": "5.9.3",
71
71
  "@colyseus/schema": "^4.0.14",
@@ -1 +0,0 @@
1
- import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{Object3DSnapshotDocument as m}from"./EntityModelDocument-DInLudyi.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./editor-shell-store-CdiZaE3q.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-CtzgRn6E.js";import"./workspace-arrangement-BmOIOEhR.js";import"./index-CXHgcixX.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";import"./user-data-BZvgpwTm.js";import"./entity-object-Dd555Jkc.js";import"./three-contract-Dkt6PmWY.js";import"./live-mixers-B-bwLZ7c.js";import"./asset-preview-h_hjp_z2.js";import"./renderer-ownership-BovSEcLv.js";import"./hierarchy-marks-B4v87a-a.js";import"./studio-environment-Dd9-Ng-9.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./bitmap-label-Ct4k6ehY.js";import"./StageHost-Djic_5-c.js";import"./three-state-tSumB-N7.js";import"./standard-viewport-dressing-BXZtCD_J.js";import"./content-bounds-W1659ao-.js";import"./preview-renderer-BrYNFV1p.js";import"./live-gesture-lock-DJbrjOqf.js";import"./three-integration-Bu8jiWKw.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-D9Jk9372.js";import"./root-stacking-BEd9ZvxC.js";import"./model-thumbnail-DDlpcMuI.js";import"./object3d-document-session-registry-WhzLeDh8.js";import"./component-instance-root-BuWShEF6.js";import"./viewport-door-BOXLjEUk.js";import"./model-inspection-2ROxDplj.js";import"./three-viewport-presentation-DHl0wniy.js";import"./clip-planes-CnAI6DZn.js";import"./three-DRLL_AH_.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./scene-framing-C_IT4HeE.js";import"./source-object3d-authoring-adapter-G8RsSkDG.js";import"./three-projection-core-DYNkd_UM.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./transport-strip--Kv6Gndt.js";import"./viewport-surface-status-Pfba7R7y.js";function ut({previewKey:o,object:r,displayName:i,fill:p=!1}){return t.jsx("div",{"data-testid":"inspector-object-preview",style:p?{position:"absolute",inset:0,overflow:"hidden"}:{width:"100%",height:220,minHeight:220,borderBottom:"1px solid var(--volter-structural-divider)",overflow:"hidden",position:"relative"},children:t.jsx(m,{documentId:`inspector-preview:${o}`,source:r,displayName:i,active:!0,chromeless:!0})})}export{ut as InspectorObjectPreview};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StageHost-Djic_5-c.js","assets/index-CXHgcixX.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/three-state-tSumB-N7.js","assets/editor-shell-store-CdiZaE3q.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-CtzgRn6E.js","assets/workspace-arrangement-BmOIOEhR.js","assets/user-data-BZvgpwTm.js","assets/entity-object-Dd555Jkc.js","assets/three-contract-Dkt6PmWY.js","assets/standard-viewport-dressing-BXZtCD_J.js","assets/content-bounds-W1659ao-.js","assets/hierarchy-marks-B4v87a-a.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/preview-renderer-BrYNFV1p.js","assets/renderer-ownership-BovSEcLv.js","assets/live-mixers-B-bwLZ7c.js","assets/live-gesture-lock-DJbrjOqf.js","assets/three-integration-Bu8jiWKw.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/layered-pick-D9Jk9372.js","assets/root-stacking-BEd9ZvxC.js","assets/model-thumbnail-DDlpcMuI.js","assets/studio-environment-Dd9-Ng-9.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/object3d-document-session-registry-WhzLeDh8.js","assets/component-instance-root-BuWShEF6.js","assets/viewport-door-BOXLjEUk.js","assets/asset-preview-h_hjp_z2.js","assets/bitmap-label-Ct4k6ehY.js","assets/model-inspection-2ROxDplj.js","assets/three-viewport-presentation-DHl0wniy.js","assets/clip-planes-CnAI6DZn.js","assets/three-DRLL_AH_.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/OrbitControls-B13MKuwC.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/scene-framing-C_IT4HeE.js","assets/source-object3d-authoring-adapter-G8RsSkDG.js","assets/three-projection-core-DYNkd_UM.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/transport-strip--Kv6Gndt.js","assets/viewport-surface-status-Pfba7R7y.js"])))=>i.map(i=>d[i]);
2
- import{ak as r,_ as a}from"./index-CXHgcixX.js";import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{r as n}from"./index-nmcBqr7Y.js";import{V as c,O as u}from"./viewport-surface-status-Pfba7R7y.js";const s=n.lazy(async()=>({default:(await a(()=>import("./StageHost-Djic_5-c.js").then(e=>e.S),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]))).Object3DDocumentViewport}));function l(t){return i(t.documentId,t.chromeless),o.jsx(n.Suspense,{fallback:o.jsx(c,{testId:"object3d-document-loading",children:u}),children:o.jsx(s,{...t})})}function i(t,e=!1){n.useEffect(()=>{if(!e)return r(t)},[t,e])}export{l as O};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DHhMOs_s.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/stage-transform-tools-ChWaCiOj.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-CXHgcixX.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-CPiRKiDC.css","assets/editor-shell-store-CdiZaE3q.js","assets/output-pass-HurwNl0G.js","assets/Pass-D1MRT672.js","assets/editor-layers-CtzgRn6E.js","assets/workspace-arrangement-BmOIOEhR.js","assets/user-data-BZvgpwTm.js","assets/entity-object-Dd555Jkc.js","assets/three-contract-Dkt6PmWY.js","assets/Toolbar-DUdd7Vku.js","assets/transform-mode-request-z9la1xr5.js","assets/three-state-tSumB-N7.js","assets/standard-viewport-dressing-BXZtCD_J.js","assets/content-bounds-W1659ao-.js","assets/hierarchy-marks-B4v87a-a.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/preview-renderer-BrYNFV1p.js","assets/renderer-ownership-BovSEcLv.js","assets/live-mixers-B-bwLZ7c.js","assets/live-gesture-lock-DJbrjOqf.js","assets/three-integration-Bu8jiWKw.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/layered-pick-D9Jk9372.js","assets/root-stacking-BEd9ZvxC.js","assets/model-thumbnail-DDlpcMuI.js","assets/studio-environment-Dd9-Ng-9.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/object3d-document-session-registry-WhzLeDh8.js","assets/component-instance-root-BuWShEF6.js","assets/viewport-door-BOXLjEUk.js","assets/asset-preview-h_hjp_z2.js","assets/bitmap-label-Ct4k6ehY.js","assets/model-inspection-2ROxDplj.js","assets/three-viewport-presentation-DHl0wniy.js","assets/clip-planes-CnAI6DZn.js","assets/three-DRLL_AH_.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/OrbitControls-B13MKuwC.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/scene-framing-C_IT4HeE.js","assets/source-object3d-authoring-adapter-G8RsSkDG.js","assets/three-projection-core-DYNkd_UM.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/transport-strip--Kv6Gndt.js","assets/viewport-surface-status-Pfba7R7y.js","assets/stage-overlay-set-B6mrZlgh.js","assets/TransientHint-BVaIXyI6.js","assets/ViewportShadingMenu-BxEJ1oZ3.js","assets/stage-keyboard-D8-cWRr2.js","assets/camera-authoring-DYjhU5Zp.js","assets/stage-presence-markers-5xyQjkaM.js","assets/collaboration-presence-DY1ZefcY.js"])))=>i.map(i=>d[i]);
2
- import{kP as Sr,lo as lr,kW as Ie,Z as os,eV as Fn,lt as Dn,_ as Ke,G as Hn,lu as Bn,j1 as Ns,bw as qe,aM as Te,a7 as we,bz as _n,bN as zn,a6 as Ne,lv as Wn,bP as In,de as Nn,aL as as,df as cs,lw as $s,lx as $n,iX as Gn,bq as fr,br as ls,bs as ct,al as Ue,eo as qn,ly as Un,lz as Kn,a8 as ve,ak as Xn,lA as Yn,lB as Zn,lC as Qn,lD as Jn,lE as ei,hj as ti,lF as ri,b5 as si,lG as Gs,aQ as ni,gK as ii,lH as us,lI as hs,lJ as ds,b1 as ps,kO as fs,fA as ms,lK as oi,F as ai,bu as ci,bt as gs,lL as li,bK as ui,j4 as hi,gk as vs,lM as di,lN as pi,lO as fi,he as mi,dI as gi,kX as vi,kN as wi,fV as bi,ge as yi,lP as ws,B as Si,lQ as xi,bR as Pi}from"./index-CXHgcixX.js";import{a as d}from"./jsx-runtime-DPjLkJKQ.js";import{t as mr,a as Ci}from"./three-state-tSumB-N7.js";import{i as _,b as ki,a as Ei,w as Oi,c as Mi,s as bs}from"./standard-viewport-dressing-BXZtCD_J.js";import{r as f}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{a as gr}from"./content-bounds-W1659ao-.js";import{EDITOR_LAYER as qs,isInEditorOwnedSubtree as Ri}from"./editor-layers-CtzgRn6E.js";import{createStandardEnvironment as ji}from"./environment-Dg-YaLsA.js";import{a as Ti}from"./preview-renderer-BrYNFV1p.js";import{s as Us}from"./user-data-BZvgpwTm.js";import{s as Vi,a as Ai}from"./live-mixers-B-bwLZ7c.js";import{n as Li,bh as At,N as Ks,M as Xs,dg as Ys,df as Zs,fo as D,_ as me,d5 as vr,d9 as Fi,L as ys,I as wr,ez as Di,dp as Ss,cj as br,em as Hi,cp as Bi,c0 as _i,aO as zi,bX as Wi,fx as xs,bi as Ii,eu as Ni,cg as fe,T as $i,ej as Qs,el as Js,A as Gi,d7 as qi,eW as Ps,fd as Tt,e6 as Cs,cm as ks}from"./three.core-3arARmh6.js";import{l as Ui,w as Ki}from"./live-gesture-lock-DJbrjOqf.js";import{v as Xi}from"./output-pass-HurwNl0G.js";import{V as Yi,a as Zi}from"./three-integration-Bu8jiWKw.js";import{a as Ve}from"./three-contract-Dkt6PmWY.js";import{d as Lt,f as Qi}from"./model-inspection-2ROxDplj.js";import{c as Ji,p as Vt,d as Es,i as Os,r as eo,b as to,a as ro,t as Ms,s as Rs,C as so,e as no,f as io,E as oo}from"./three-viewport-presentation-DHl0wniy.js";import{s as yr}from"./workspace-arrangement-BmOIOEhR.js";import{a as ao,b as co,L as lo}from"./LineSegments2-DN9pUfWA.js";import{s as uo,o as ho,a as po,b as fo}from"./object3d-document-session-registry-WhzLeDh8.js";import{S as mo}from"./source-object3d-authoring-adapter-G8RsSkDG.js";import{s as go,i as ur}from"./editor-presentation-activity-CqJH4G9t.js";import{r as js,c as Ts}from"./viewport-door-BOXLjEUk.js";import{T as vo}from"./transport-strip--Kv6Gndt.js";import{V as wo,O as bo}from"./viewport-surface-status-Pfba7R7y.js";import{t as en}from"./editor-shell-store-CdiZaE3q.js";const tn=30;function rn(n,e,t){return n<e?e:n>t?t:n}function yo(n,e){const t=n.animations;if(t.length===0)return null;const s=new Li(n);let i=t[0];if(!i)return null;const a=o=>{s.stopAllAction();const l=s.clipAction(o);l.paused=!1,l.play(),i=o};a(i);const c=e.attach({id:n.uuid,label:n.name||i.name||"Clip",range:()=>({start:0,end:i?.duration??0,fps:tn}),seek:o=>{s.setTime(rn(o,0,i?.duration??0))},clips:()=>t.map(o=>({id:o.name,label:o.name})),setClip:o=>{const l=t.find(p=>p.name===o);l&&a(l)}});return()=>{c(),s.stopAllAction(),s.uncacheRoot(n)}}function So(n,e){const t=Ai(n);if(!t)return null;let s=t.clips.values().next().value;if(!s)return null;const i=c=>{t.mixer.stopAllAction();const o=t.mixer.clipAction(c);o.paused=!1,o.play(),s=c};return e.attach({id:n.uuid,label:n.name||s.name||"Animation",range:()=>({start:0,end:s?.duration??0,fps:tn}),seek:c=>{t.mixer.setTime(rn(c,0,s?.duration??0))},clips:()=>[...t.clips.entries()].map(([c,o])=>({id:c,label:o.name||c})),setClip:c=>{const o=t.clips.get(c);o&&i(o)}})}function Vs(n,e,t={}){const s=new Map,i=()=>{const o=new Set;(typeof n=="function"?n():n)?.traverse(p=>{if(s.has(p.uuid)){o.add(p.uuid);return}const P=So(p,e)??yo(p,e);P&&(s.set(p.uuid,P),o.add(p.uuid))});for(const[p,P]of[...s])o.has(p)||(P(),s.delete(p))};i();const a=t.rescanOnLiveMixers,c=a?Vi(()=>{a()&&i()}):()=>{};return{refresh:i,dispose:()=>{c();for(const o of s.values())o();s.clear()}}}const ke=()=>globalThis.performance?.now()??Date.now();function xo(n,e){return n.length===0?0:n[Math.min(n.length-1,Math.floor((n.length-1)*e))]??0}function Po(n=!1){const e=new Set,t=[],s=new Map,i=new Map,a=new Map;let c=[],o=[],l=n,p=!1,P=!1,v=0,x=0,S=0;const z=[];let H=0,E=0,C={gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:null},W={enabled:l,recording:P,fps:0,cpuMs:0,p95Ms:0,p99Ms:0,frames:[],phases:[],systems:[],components:[],render:C};function Q(){const y=t.at(-1),$=t.slice();let B;const K=L=>(B??=$.map(X=>X.intervalMs).filter(X=>X>0).sort((X,V)=>X-V),xo(B,L));W={enabled:l,recording:P,fps:y?.intervalMs?1e3/y.intervalMs:0,cpuMs:y?.cpuMs??0,get p95Ms(){return K(.95)},get p99Ms(){return K(.99)},frames:$,phases:y?.phases??[],systems:[...i].map(([L,X])=>({name:L,ms:X})).sort((L,X)=>X.ms-L.ms),components:[...a].map(([L,X])=>({name:L,ms:X})).sort((L,X)=>X.ms-L.ms),render:C};for(const L of e)L()}return{get enabled(){return l},set enabled(y){l!==y&&(l=y,y&&!p&&(S=0),Q())},get telemetryEnabled(){return p},set telemetryEnabled(y){if(p===y)return;const $=!l&&!p;p=y,y&&$&&(S=0),Q()},get recording(){return P},startRecording(){const y=!l&&!p;l=!0,y&&(S=0),P=!0,t.length=0,Q()},stopRecording(){P=!1,Q()},clear(){t.length=0,Q()},beginFrame(){!l&&!p||(s.clear(),i.clear(),a.clear(),c=[],o=[],z.length=0,C={gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:null},x=ke())},beginPhase(){l&&z.push(ke())},endPhase(y){if(!l)return;const $=z.pop()??x,B=ke()-$,K=s.get(y);s.set(y,{ms:(K?.ms??0)+B,startMs:K?.startMs??$-x}),P&&performance.measure(`volter.phase.${y}`,{start:$,duration:B})},systemObserver:{beginSystem(){l&&(H=ke())},endSystem(y,$,B){if(!l)return;const K=ke(),L=`${y} / ${$} / ${B}`;i.set(L,(i.get(L)??0)+K-H),c.push({name:L,phase:$,startMs:H-x,ms:K-H})}},beginComponent(){P&&(E=ke())},endComponent(y,$=""){if(!P)return;const B=ke();a.set(y,(a.get(y)??0)+B-E),o.push({name:y,phase:$,startMs:E-x,ms:B-E})},reportRender(y){l&&(C={gpuMs:y.gpuMs??C.gpuMs,drawCalls:C.drawCalls+y.drawCalls,triangles:C.triangles+y.triangles,geometries:C.geometries+y.geometries,textures:C.textures+y.textures,renderPasses:y.renderPasses===void 0?C.renderPasses:(C.renderPasses??0)+y.renderPasses})},endFrame(){if(!l&&!p)return;const y=ke(),$=S===0?0:x-S;S=x;const B={id:++v,timestamp:y,intervalMs:$,cpuMs:y-x,phases:[...s].map(([K,{ms:L,startMs:X}])=>({name:K,ms:L,startMs:X})).sort((K,L)=>L.ms-K.ms),systems:c.slice(),components:o.slice(),render:{...C}};t.push(B),t.length>600&&t.splice(0,t.length-600),P&&performance.measure("volter.frame",{start:x,duration:B.cpuMs}),Q()},subscribe(y){return e.add(y),()=>{e.delete(y)}},getSnapshot(){return W},exportJSON(){return JSON.stringify({version:2,capturedAt:new Date().toISOString(),frames:t},null,2)}}}class Co extends At{constructor(e,t){super(),this.bones=e;const s=new Set;for(const o of e){const l=o.parent;l?.isBone&&this.addSegment(l,o,s);for(const p of o.children)p.isBone&&this.addSegment(o,p,s)}this.linePositions=new Float32Array(Math.max(this.segments.length*6,6));const i=new ao;i.setPositions(this.linePositions),this.lineMaterial=new co({color:t,linewidth:5,worldUnits:!1,depthTest:!1,depthWrite:!1,toneMapped:!1,alphaToCoverage:!0}),this.lines=new lo(i,this.lineMaterial),this.lines.onBeforeRender=o=>{o.getSize(this.lineMaterial.resolution)},this.lines.frustumCulled=!1,this.lines.renderOrder=1001,this.add(this.lines),this.pointPositions=new Float32Array(Math.max(e.length*3,3));const a=new Ks;a.setAttribute("position",new Xs(this.pointPositions,3));const c=new Ys({color:t,size:11,sizeAttenuation:!1,depthTest:!1,depthWrite:!1,toneMapped:!1});this.points=new Zs(a,c),this.points.frustumCulled=!1,this.points.renderOrder=1002,this.add(this.points),this.name="__object3d_document_bone_selection",yr(this,"editorHelper",!0),this.traverse(o=>o.layers.set(qs)),this.update()}segments=[];linePositions;pointPositions;lines;lineMaterial;points;worldPosition=new D;setColor(e){this.lineMaterial.color.setHex(e),this.points.material.color.setHex(e)}update(){let e=0;for(const[i,a]of this.segments)i.getWorldPosition(this.worldPosition),this.linePositions.set(this.worldPosition.toArray(),e),a.getWorldPosition(this.worldPosition),this.linePositions.set(this.worldPosition.toArray(),e+3),e+=6;const t=this.lines.geometry.getAttribute("instanceStart");t&&(t.data.needsUpdate=!0),e=0;for(const i of this.bones)i.getWorldPosition(this.worldPosition),this.pointPositions.set(this.worldPosition.toArray(),e),e+=3;const s=this.points.geometry.getAttribute("position");s&&(s.needsUpdate=!0)}dispose(){this.lines.geometry.dispose(),this.lineMaterial.dispose(),this.points.geometry.dispose(),this.points.material.dispose()}addSegment(e,t,s){const i=`${e.uuid}:${t.uuid}`;s.has(i)||(s.add(i),this.segments.push([e,t]))}}const ko="skeletons",hr=new me(58879),dr=new me(16756736);function Eo(n){const e=n.geometry.getAttribute("color");for(let s=0;s<e.count;s+=2)e.setXYZ(s,hr.r,hr.g,hr.b),s+1<e.count&&e.setXYZ(s+1,dr.r,dr.g,dr.b);e.needsUpdate=!0,n.renderOrder=999;const t=n.material;t.depthTest=!1,t.depthWrite=!1,t.toneMapped=!1,yr(n,"editorHelper",!0),yr(n,"editorHelperType",ko),n.traverse(s=>s.layers.set(qs))}const Oo=1,Mo=700,Ro=.001,jo=Math.PI-.001,To=n=>n<.5?4*n*n*n:1-(-2*n+2)**3/2,Vo=n=>n;function $e(n,e){return typeof n=="number"&&Number.isFinite(n)?n:e}const As={mode:"solid",background:"neutral",projection:"perspective",skeleton:!1,bounds:!1},Ls=1119773;class Ao{constructor(e,t,s,i,a,c,o=new me(2106410),l=null){this.documentId=e,this.root=t,this.scene=s,this.renderer=i,this.viewport=a,this.authoring=c,this.neutralBackground=o,this.frameBox=l,this.unsubscribeSelectionTheme=Sr(i.domElement,this.syncSelectionTheme),a.orbitControls.addEventListener("start",this.cancelLookForHuman),this.unsubscribeRotateStart=a.onRotateStart(this.autoPerspective),this.unsubscribeAxisView=a.onAxisView(this.axisView)}profiler=Po();shading=new Yi;helpers=[];skeletonHelper=null;boundsHelper=null;boneSelectionHighlight=null;boneSelectionSignature="";composer=null;composerLoading=!1;disposed=!1;sceneRenderPass=null;selectionOutline=null;selectionOutlinePass=null;selectedObjects=[];selectionOrigins=null;renderWidth=1;renderHeight=1;orthographicCamera=new vr;captureAspect=null;cameraOverride=null;cameraViewSource=null;through=null;leaving=!1;viewMemo=null;throughPerspective=new Fi;throughOrthographic=new vr;beforeRender=null;state=As;version=0;listeners=new Set;unsubscribeSelectionTheme=()=>{};flight=null;flightPose=new D;topologyOverlay=null;topologyFollowers=[];unsubscribeRotateStart;unsubscribeAxisView;axisView=()=>(this.leaveCameraView(!1),this.settleFlight("superseded"),lr().autoPerspective&&this.setProjection("orthographic"),!0);autoPerspective=()=>{if(!lr().autoPerspective||this.cameraView()!==null||this.state.projection!=="orthographic")return;const e=this.viewport.camera,t=e.position.clone().sub(this.viewport.orbitControls.target),s=new D(0,1,0).applyQuaternion(e.quaternion);Lt(t,s)!==null&&this.setProjection("perspective")};replaceContent(e,t){_(),this.selectionOutline?.selection.clear(),this.selectedObjects=[],this.boneSelectionSignature="",this.clearBoneSelectionHighlight(),this.clearSkeletonHelper(),this.clearBoundsHelper(),this.clearTopologyOverlay(),this.root=e,this.authoring=t,this.state.mode==="wireframe"&&this.buildTopologyOverlay(),this.state.bounds&&(this.boundsHelper=new ys(e,16757844),this.addHelper(this.boundsHelper,"bounds")),this.syncSelectionPresentation(),this.refreshSkeletonHelper(),this.notify()}cancelLookForHuman=()=>{this.settleFlight("human")};selectionColors=null;syncSelectionTheme=()=>{this.selectionColors=Ie(this.renderer.domElement);const e=this.selectionColors.visible;this.selectionOutline&&Ji(this.selectionOutline,Ie(this.renderer.domElement)),this.boneSelectionHighlight?.setColor(e)};subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.version;presentation(){return this.state}resolveFrameBounds(e="selection"){const t=e==="all"?[]:this.authoring?.selection?.get()??[];if(t.length>0){const s=new wr;let i=!1;for(const a of t){const c=this.authoring?Ve(this.authoring.hierarchy,a):null;if(!c)continue;const o=gr(c);o.isEmpty()||(s.union(o),i=!0)}if(i)return s}return this.frameBox&&!this.frameBox.isEmpty()?this.frameBox:gr(this.root)}frame(e=1,t="selection"){this.leaveCameraView(!1);const s=this.resolveFrameBounds(t);if(s.isEmpty()){let l=0,p=0;return this.root.traverse(P=>{const v=P.geometry;v&&(l+=1,p+=v.getAttribute("position")?.count??0)}),os.warn(`frame: nothing to frame — root "${this.root.name}" (${this.root.children.length} children, ${l} meshes, ${p} positions), selection ${JSON.stringify(this.authoring?.selection?.get()??[])}, frameBox ${this.frameBox?this.frameBox.isEmpty()?"empty":"set":"none"}`,"document"),!1}this.settleFlight("superseded");const i=s.getCenter(new D),a=this.viewport.camera.position.clone().sub(this.viewport.orbitControls.target).normalize();a.lengthSq()===0&&a.set(.8,.5,-1).normalize();const c=Math.min(10,Math.max(.1,$e(e,1))),o=Vt(s,this.viewport.camera,a)*c;return this.viewport.setPose(i.clone().addScaledVector(a,o),i),!0}orbit(e){return this.launchFlight($e(e.azimuth,0),$e(e.elevation,0),Math.min(60,Math.max(0,$e(e.duration,.6))),To)}turntable(e){const t=$e(e.revolutions,1);return this.launchFlight(t*Math.PI*2,0,Math.min(60,Math.max(0,$e(e.seconds,6))),Vo)}looking(){return this.flight!==null}launchFlight(e,t,s,i){this.settleFlight("superseded");const a=this.viewport.camera,c=this.viewport.orbitControls.target.clone(),o=new Di().setFromVector3(a.position.clone().sub(c)),l=o.radius>1e-4?o.radius:Math.max(this.resolveFrameBounds().getSize(new D).length(),1),p={pivot:c,radius:l,startTheta:o.theta,startPhi:o.phi,deltaTheta:e,deltaPhi:-t,duration:s,ease:i,elapsed:0,theta:o.theta,phi:o.phi,settle:null};this.flight=p;const P=new Promise(v=>{p.settle=v});return this.applyFlightPose(p,0),s<=0&&this.settleFlight(null),P}applyFlightPose(e,t){const s=e.ease(t);e.theta=e.startTheta+e.deltaTheta*s,e.phi=Math.min(jo,Math.max(Ro,e.startPhi+e.deltaPhi*s));const i=this.viewport.camera;i.position.setFromSphericalCoords(e.radius,e.phi,e.theta).add(e.pivot),this.viewport.orbitControls.target.copy(e.pivot),i.lookAt(e.pivot),i.updateMatrixWorld(),this.flightPose.copy(i.position)}advanceLook(e){const t=this.flight;if(!t)return;const s=Math.max(1e-4,t.radius*.001);if(this.viewport.camera.position.distanceToSquared(this.flightPose)>s*s){this.settleFlight("human");return}e>0&&Number.isFinite(e)&&(t.elapsed+=e);const i=t.duration<=0?1:Math.min(1,t.elapsed/t.duration);this.applyFlightPose(t,i),i>=1&&this.settleFlight(null)}settleFlight(e){const t=this.flight;if(!t)return;this.flight=null;const s={completed:e===null,azimuth:t.theta,elevation:Math.PI/2-t.phi,seconds:Math.min(t.elapsed,t.duration)};t.settle?.(e===null?s:{...s,cancelledBy:e})}select(e){_(),this.authoring&&Fn(this.authoring,[...e])}selection(){return[...this.authoring?.selection?.get()??[]]}idForObject(e){return this.authoring?.hierarchy.idForObject3D?.(e)??null}syncSelectionPresentation(){_();const e=(this.authoring?.selection?.get()??[]).map(i=>this.authoring?Ve(this.authoring.hierarchy,i):null).filter(i=>i!==null);if(this.selectedObjects=e,this.selectionOutline&&(Es(this.selectionOutline,this.selectionOutlineWanted?e:[]),this.syncComposerOutput()),this.selectionOrigins){const i=Ie(this.renderer.domElement);this.selectionOrigins.update(e,{visible:i.visible,...i.active?{active:i.active.visible}:{}})}const t=e.filter(i=>!!i.isBone),s=t.map(i=>i.uuid).join("\0");s!==this.boneSelectionSignature&&(this.boneSelectionSignature=s,this.clearBoneSelectionHighlight(),t.length>0&&(this.boneSelectionHighlight=new Co(t,Ie(this.renderer.domElement).visible),this.scene.add(this.boneSelectionHighlight)),this.refreshSkeletonHelper())}frameSelection(){return this.frameIds(this.authoring?.selection?.get()??[])}frameIds(e){this.leaveCameraView(!1),this.settleFlight("superseded");const t=e.map(s=>this.authoring?Ve(this.authoring.hierarchy,s):null).filter(s=>s!==null);return t.length===0?!1:t.every(s=>s.isBone)?(this.frameBones(t),!0):(this.viewport.focusOnMultiple(t),!0)}setViewPreset(e,t="bounds"){_(),this.leaveCameraView(!1),this.settleFlight("superseded");const s=Qi(e);let i,a;if(t==="view")i=this.viewport.orbitControls.target.clone(),a=this.viewport.camera.position.distanceTo(i);else{const l=this.resolveFrameBounds();if(l.isEmpty())return;i=l.getCenter(new D),a=Vt(l,this.viewport.camera,s)}const c=i.clone().addScaledVector(s,a),o=e==="top"?{x:0,y:0,z:-1}:e==="bottom"?{x:0,y:0,z:1}:{x:0,y:1,z:0};this.viewport.setPose(c,i,void 0,o),this.setProjection(e==="isometric"?"perspective":"orthographic")}setCameraPose(e,t,s){_(),this.leaveCameraView(!1),this.settleFlight("superseded"),this.viewport.setPose(e,t,s)}cameraPose(){return{position:this.viewport.camera.position.toArray(),target:this.viewport.orbitControls.target.toArray(),fov:this.viewport.camera.fov}}camera(){if(this.cameraOverride)return this.cameraOverride;const e=this.drawnCamera();return this.viewport.setGizmoCamera(e===this.viewport.camera?null:e),e}drawnCamera(){const e=this.through?this.cameraView():null;return e?this.throughCamera(e):(this.through&&!this.leaving&&(this.leaving=!0,queueMicrotask(()=>{this.leaving=!1,this.through&&!this.cameraView()&&this.leaveCameraView(!1)})),this.state.projection==="perspective"?this.viewport.camera:(this.syncOrthographicCamera(),this.orthographicCamera))}setCameraViewSource(e){this.cameraViewSource!==e&&(this.cameraViewSource=e,e||this.leaveCameraView(!1),this.notify())}hasCameraView(){return this.cameraViewSource!==null}cameraView(){const e=this.through,t=this.cameraViewSource;if(!e||!t)return null;const s=this.renderer.domElement,i=this.captureAspect?{width:this.captureAspect,height:1}:{width:s.clientWidth,height:s.clientHeight},a=this.viewport.camera,c=e.locked?`${a.position.toArray().join(",")}|${a.quaternion.toArray().join(",")}`:"",o=`${e.camera}|${i.width}|${i.height}|${e.zoom}|${e.offset.join(",")}|${c}`;if(this.viewMemo?.key===o)return this.viewMemo.view;const l=t.view(e.camera,i,e.zoom,e.offset),p=l&&e.locked?{...l,position:a.position.toArray(),quaternion:a.quaternion.toArray()}:l;return this.viewMemo={key:o,view:p},queueMicrotask(()=>{this.viewMemo=null}),p}toggleCameraView(){if(this.through)return this.leaveCameraView(!0),!0;const e=this.cameraViewSource,t=e?.camera()??null;if(!e)return!1;if(t===null)return os.warn("camera view: No active camera — the scene has no camera to look through","document"),!1;_(),this.settleFlight("superseded");const s=this.viewport,i=s.orbitControls,a=i.enableDamping;return i.enableDamping=!1,i.update(),i.enableDamping=a,this.through={camera:t,zoom:e.zoom.opening,offset:[0,0],left:{position:s.camera.position.clone(),target:s.orbitControls.target.clone(),up:s.camera.up.clone(),projection:this.state.projection},release:this.captureCameraViewInput(),locked:!1},e.showing?.(t),this.notify(),!0}cameraViewLocked(){return!this.through||!this.cameraViewSource?.setPose?null:this.through.locked}toggleCameraViewLock(){const e=this.through,t=this.cameraViewSource;if(!(!e||!t?.setPose)){if(e.release(),e.locked=!e.locked,!e.locked)e.release=this.captureCameraViewInput();else{const s=this.cameraView(),i=this.viewport.orbitControls,a=this.viewport.camera;if(s){const E=new D(...s.position),C=new Ss(...s.quaternion),W=e.left.position.distanceTo(e.left.target);a.up.set(0,1,0).applyQuaternion(C),a.position.copy(E),a.quaternion.copy(C),i.target.copy(E).addScaledVector(new D(0,0,-1).applyQuaternion(C),W),i.update()}const c=i.enabled;i.enabled=!0;const o=i.enableDamping;i.enableDamping=!1;const l=e.camera,p=E=>({position:a.position.toArray(),quaternion:a.quaternion.toArray(),final:E});let P=!1,v=null,x=!1;const S=E=>{if(P){v={...E,final:E.final||(v?.final??!1)};return}P=!0,v=null,Promise.resolve(t.setPose(l,E.position,E.quaternion,E.final)).catch(()=>{}).finally(()=>{P=!1,v&&S(v)})},z=()=>{x=!0,_(),this.notify(),S(p(!1))},H=()=>{x&&(x=!1,S(p(!0)))};i.addEventListener("change",z),i.addEventListener("end",H),e.release=()=>{H(),i.removeEventListener("change",z),i.removeEventListener("end",H),i.enabled=c,i.enableDamping=o}}this.viewMemo=null,_(),this.notify()}}cameraViewZoom(){return this.through?.zoom??null}setCameraViewZoom(e){const t=this.through,s=this.cameraViewSource;!t||!s||!Number.isFinite(e)||e<=0||(t.zoom=Math.min(s.zoom.max,Math.max(s.zoom.min,e)),_(),this.notify())}zoomCameraView(e){this.through&&this.setCameraViewZoom(this.through.zoom*e)}panCameraView(e,t){const s=this.through,i=this.cameraViewSource;if(!s||!i)return;const[a,c]=i.pan(s.offset,s.zoom,e,t);s.offset=[a,c],_(),this.notify()}leaveCameraView(e){const t=this.through;if(!t)return;const s=this.cameraView();t.release(),this.through=null,this.viewMemo=null,this.cameraViewSource?.showing?.(null),this.viewport.setGizmoCamera(null);const i=this.viewport;if(e)i.camera.position.copy(t.left.position),i.camera.up.copy(t.left.up),i.orbitControls.target.copy(t.left.target),this.state={...this.state,projection:t.left.projection};else if(s){const a=t.left.position.distanceTo(t.left.target),c=new D(...s.position),o=new Ss(...s.quaternion),l=new D(0,0,-1).applyQuaternion(o);i.camera.up.set(0,1,0).applyQuaternion(o),i.camera.position.copy(c),i.orbitControls.target.copy(c).addScaledVector(l,a);const p=Lt(t.left.position.clone().sub(t.left.target),t.left.up)!==null,P=lr().autoPerspective&&p?"perspective":t.left.projection;this.state={...this.state,projection:P}}i.camera.lookAt(i.orbitControls.target),i.orbitControls.update(),_(),this.notify()}throughCamera(e){const{left:t,right:s,top:i,bottom:a}=e.window,c=this.viewport.camera.layers.mask;if(e.projection==="orthographic"){const l=this.throughOrthographic;return Object.assign(l,{left:t,right:s,top:i,bottom:a,near:e.near,far:e.far,zoom:1}),l.position.set(...e.position),l.quaternion.set(...e.quaternion),l.layers.mask=c,l.updateProjectionMatrix(),l.updateMatrixWorld(!0),l}const o=this.throughPerspective;return o.near=e.near,o.far=e.far,o.fov=br.radToDeg(2*Math.atan((i-a)/2)),o.aspect=(s-t)/(i-a),o.zoom=1,o.position.set(...e.position),o.quaternion.set(...e.quaternion),o.layers.mask=c,o.projectionMatrix.makePerspective(t*e.near,s*e.near,i*e.near,a*e.near,e.near,e.far),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.updateMatrixWorld(!0),o}captureCameraViewInput(){const e=this.viewport.orbitControls,t=this.renderer.domElement,s=t.parentElement??t,i=e.enabled;e.enabled=!1;const a=o=>{o.target!==t||o.deltaY===0||(o.preventDefault(),this.zoomCameraView(o.deltaY<0?1.2:1/1.2))},c=o=>{if(o.target!==t)return;const l=e.mouseButtons;let p=[l.LEFT,l.MIDDLE,l.RIGHT][o.button]??null;const P=o.ctrlKey||o.metaKey||o.shiftKey;if(o.button===1&&(o.ctrlKey||o.metaKey)&&p===fe.ROTATE?p=fe.DOLLY:P&&p===fe.ROTATE?p=fe.PAN:P&&p===fe.PAN&&(p=fe.ROTATE),p===fe.ROTATE){this.leaveCameraView(!1);return}if(p!==fe.PAN&&p!==fe.DOLLY)return;o.preventDefault();const v=t.getBoundingClientRect();let x=o.clientX,S=o.clientY;const z=this.through?.zoom??1,H=Math.max(5+o.clientY-v.top,1),E=W=>{if(p===fe.PAN){this.panCameraView((W.clientX-x)/Math.max(v.width,1),(W.clientY-S)/Math.max(v.height,1)),x=W.clientX,S=W.clientY;return}const Q=Math.max(.01,2*((5+W.clientY-v.top)/H-1)+1);this.setCameraViewZoom(z/Q)},C=()=>{window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",C),window.removeEventListener("pointercancel",C)};window.addEventListener("pointermove",E),window.addEventListener("pointerup",C),window.addEventListener("pointercancel",C)};return s.addEventListener("wheel",a,{capture:!0,passive:!1}),s.addEventListener("pointerdown",c,{capture:!0}),()=>{s.removeEventListener("wheel",a,{capture:!0}),s.removeEventListener("pointerdown",c,{capture:!0}),e.enabled=i}}projection(){return this.state.projection}setProjection(e){_(),this.state.projection!==e&&(this.state={...this.state,projection:e},this.notify())}setMode(e){_(),this.state.mode!==e&&(this.clearDiagnosticPresentation(),this.state={...this.state,mode:e},e==="uv"?this.scene.overrideMaterial=new Hi({vertexShader:"varying vec2 vUv; void main(){ vUv=uv; gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.0); }",fragmentShader:"varying vec2 vUv; void main(){ gl_FragColor=vec4(vUv,0.0,1.0); }"}):e==="vertex-colors"?this.scene.overrideMaterial=new Bi({vertexColors:!0}):e==="wireframe"&&this.buildTopologyOverlay(),this.notify())}buildTopologyOverlay(){const e=new At,t=[];this.root.updateMatrixWorld(!0),this.root.traverse(s=>{const i=s;if(!i.isMesh||!i.geometry)return;const a=new _i(new zi(i.geometry,Oo),new Wi({color:Ls,toneMapped:!1,transparent:!0,opacity:.85,depthTest:!1,depthWrite:!1}));a.matrixAutoUpdate=!1,a.matrixWorldAutoUpdate=!1,a.matrixWorld.copy(i.matrixWorld),a.frustumCulled=!1,a.renderOrder=2,e.add(a),t.push({line:a,source:i})}),t.length!==0&&(this.topologyOverlay=e,this.topologyFollowers=t,this.addHelper(e,"topology"))}syncTopologyOverlay(){this.topologyFollowers.some(({source:i})=>i.parent===null)&&(this.clearTopologyOverlay(),this.buildTopologyOverlay()),this.selectionColors??=Ie(this.renderer.domElement);const e=this.selectionColors,t=this.selectedObjects.at(-1)??null,s=(i,a)=>{for(let c=i;c;c=c.parent)if(c===a)return!0;return!1};for(const{line:i,source:a}of this.topologyFollowers){i.matrixWorld.copy(a.matrixWorld),i.visible=a.visible;const c=i.material,o=t!==null&&s(a,t),l=o||this.selectedObjects.some(P=>s(a,P)),p=o?e.active?.visible??e.visible:l?e.visible:null;c.color.setHex(p??Ls)}}clearTopologyOverlay(){for(const{line:s}of this.topologyFollowers.splice(0))s.geometry.dispose(),s.material.dispose();const e=this.topologyOverlay;if(this.topologyOverlay=null,!e)return;e.removeFromParent();const t=this.helpers.indexOf(e);t>=0&&this.helpers.splice(t,1)}setBounds(e){_(),this.state.bounds!==e&&(this.state={...this.state,bounds:e},e?(this.boundsHelper=new ys(this.root,16757844),this.addHelper(this.boundsHelper,"bounds")):this.clearBoundsHelper(),this.notify())}setSkeleton(e){_(),this.state.skeleton!==e&&(this.state={...this.state,skeleton:e},this.refreshSkeletonHelper(),this.notify())}neutralBackgroundTexture(){return this.neutralBackground}setNeutralBackground(e){_();const t=this.scene.background,s=this.neutralBackground,i=t===s||t instanceof me&&s instanceof me&&t.equals(s);this.neutralBackground=e,i&&(this.scene.background=e)}setBackground(e){_(),this.state.background!==e&&(this.scene.background=e==="transparent"?null:this.neutralBackground,this.state={...this.state,background:e},this.notify())}resetPresentation(){_(),Dn(this.documentId),this.clearDiagnosticPresentation(),this.state=As,this.refreshSkeletonHelper(),this.clearBoundsHelper(),this.scene.background=this.neutralBackground,this.viewport.camera.up.set(0,1,0),this.frame(),this.notify()}setBeforeRender(e){this.beforeRender=e}presentedFrameWaiters=[];presentsFrames=!1;setPresentsFrames(e){this.presentsFrames=e,e||this.resolvePresentedFrame(null)}requestPresentedFrame(){return this.presentsFrames?new Promise(e=>{let t=!1;const s=i=>{t||(t=!0,e(i))};this.presentedFrameWaiters.push(s),_(),setTimeout(()=>s(null),Mo)}):Promise.resolve(null)}needsFrame(){return this.flight!==null||this.presentedFrameWaiters.length>0}servePresentedFrame(){if(this.presentedFrameWaiters.length===0)return;const e=this.renderer.domElement,t=document.createElement("canvas");t.width=Math.max(1,e.width),t.height=Math.max(1,e.height);const s=t.getContext("2d");if(!s){this.resolvePresentedFrame(null);return}s.drawImage(e,0,0),this.resolvePresentedFrame(t)}resolvePresentedFrame(e){const t=this.presentedFrameWaiters;this.presentedFrameWaiters=[];for(const s of t)s(e)}render(e){this.beforeRender?.(),this.boneSelectionHighlight?.update();const t=this.camera(),s=this.state.mode;if(this.boundsHelper?.update(),this.selectionOrigins?.place(),s==="uv"||s==="vertex-colors"){e(t);return}if(s==="wireframe"&&this.topologyOverlay){if(this.syncTopologyOverlay(),this.xray.enabled&&this.xray.alpha<=0){const i=new Set;this.root.traverse(a=>{const c=a;if(c.isMesh)for(const o of Array.isArray(c.material)?c.material:[c.material])o?.visible&&(o.visible=!1,i.add(o))});try{e(t)}finally{for(const a of i)a.visible=!0}return}this.shading.render(this.scene,"clay",()=>e(t),Os);return}this.shading.render(this.scene,s,()=>e(t),Os)}renderViewport(e=0){this.advanceLook(e),this.ensureComposer(),this.render(t=>{const s=this.composer;if(!s){this.renderer.render(this.scene,t);return}s.setMainScene(this.scene),s.setMainCamera(t),s.render(e)})}resize(e,t){_(),this.renderWidth=Math.max(1,e),this.renderHeight=Math.max(1,t),this.composer?.setSize(this.renderWidth,this.renderHeight)}renderCapture(e,t){this.render(s=>{if(!t){e(s);return}const i=this.scene.background,a=this.renderer.getClearColor(new me),c=this.renderer.getClearAlpha();try{this.scene.background=null,this.renderer.setClearColor(0,0),e(s)}finally{this.scene.background=i,this.renderer.setClearColor(a,c)}})}captureImage(e=512){const t=typeof e=="number"?e:e.width,s=typeof e=="number"?e:e.height;if(!Number.isFinite(t)||t<1||!Number.isFinite(s)||s<1)return null;const i=Math.min(2048,Math.round(t)),a=Math.min(2048,Math.round(s)),c=i*2,o=a*2,l=new xs(c,o,{type:Ii}),p=new xs(c,o),P=this.renderer.getRenderTarget(),v=this.renderer.getPixelRatio(),x=this.viewport.camera,S=x.aspect;try{this.captureAspect=i/a;const z=typeof e=="number"?void 0:e.camera;z?this.cameraOverride=z:(x.aspect=i/a,x.updateProjectionMatrix()),this.renderer.setPixelRatio(1),this.renderer.setRenderTarget(l),this.renderCapture(B=>this.renderSolidForCapture(B,l,c,o),typeof e!="number"&&e.transparent===!0),Xi(typeof e!="number"&&e.transparent===!0).render(this.renderer,p,l,0,!1);const H=c*4,E=new Uint8Array(H*o);this.renderer.readRenderTargetPixels(p,0,0,c,o,E);const C=document.createElement("canvas");C.width=c,C.height=o;const W=C.getContext("2d");if(!W)return null;const Q=W.createImageData(c,o);for(let B=0;B<o;B++){const K=(o-1-B)*H,L=B*H;Q.data.set(E.subarray(K,K+H),L)}W.putImageData(Q,0,0);const y=document.createElement("canvas");y.width=i,y.height=a;const $=y.getContext("2d");return $?($.drawImage(C,0,0,i,a),y.toDataURL("image/png")):null}finally{this.captureAspect=null,this.cameraOverride=null,x.aspect=S,x.updateProjectionMatrix(),this.renderer.setRenderTarget(P),this.renderer.setPixelRatio(v),this.composer?.setSize(this.renderWidth,this.renderHeight,!1),p.dispose(),l.dispose()}}dispose(){this.disposed=!0,this.leaveCameraView(!1),this.selectionOrigins?.dispose(),this.selectionOrigins=null,this.settleFlight("closed"),this.viewport.orbitControls.removeEventListener("start",this.cancelLookForHuman),this.unsubscribeRotateStart(),this.unsubscribeAxisView(),this.unsubscribeSelectionTheme(),this.clearDiagnosticPresentation(),this.clearBoneSelectionHighlight(),this.clearBoundsHelper(),this.clearSkeletonHelper(),this.selectionOutline&&eo(this.renderer,this.selectionOutline,this.selectionOutlinePass),this.composer?.dispose(),this.sceneRenderPass=null,this.selectionOutline=null,this.selectionOutlinePass=null,this.composer=null,this.shading.dispose(),this.listeners.clear()}addHelper(e,t){e.name=`__object3d_document_${t}`,Us(e,"editorHelper",!0),this.scene.add(e),this.helpers.push(e)}get selectionOutlineEnabled(){return this.selectionOutlineWanted}set selectionOutlineEnabled(e){e!==this.selectionOutlineWanted&&(this.selectionOutlineWanted=e,e?this.syncSelectionPresentation():(this.selectionOutline?.selection.clear(),this.syncComposerOutput()))}selectionOutlineWanted=!0;xray={enabled:!1,alpha:1};setXray(e){this.xray.enabled===e.enabled&&this.xray.alpha===e.alpha||(this.xray=e,_())}set selectionOriginsEnabled(e){e!==(this.selectionOrigins!==null)&&(e?(this.selectionOrigins=new Do,this.scene.add(this.selectionOrigins),this.syncSelectionPresentation()):(this.selectionOrigins?.dispose(),this.selectionOrigins=null,_()))}ensureComposer(){this.selectionOutlineWanted&&(this.composer||this.composerLoading||this.disposed||(this.composerLoading=!0,Ke(()=>import("./index-DHhMOs_s.js"),__vite__mapDeps([0,1,2])).then(e=>{if(this.composerLoading=!1,this.disposed||this.composer)return;const t=this.camera(),s=new e.EffectComposer(this.renderer);this.sceneRenderPass=new e.RenderPass(this.scene,t),s.addPass(this.sceneRenderPass),this.selectionOutline=to(e,this.renderer,this.scene,t,Ie(this.renderer.domElement)),this.syncSelectionTheme(),Es(this.selectionOutline,this.selectedObjects),this.selectionOutlinePass=new e.EffectPass(t,this.selectionOutline),s.addPass(this.selectionOutlinePass),this.composer=s,this.syncComposerOutput(),s.setSize(this.renderWidth,this.renderHeight),_()}).catch(()=>{this.composerLoading=!1})))}renderSolidForCapture(e,t,s,i){const a=this.composer,c=(this.selectionOutline?.selection.size??0)>0;if(!a||!c||!this.sceneRenderPass||!this.selectionOutlinePass){this.renderer.render(this.scene,e);return}const o=this.renderWidth,l=this.renderHeight;try{this.sceneRenderPass.renderToScreen=!1,this.selectionOutlinePass.renderToScreen=!1,a.setSize(s,i,!1),this.sceneRenderPass.render(this.renderer,a.inputBuffer,a.outputBuffer,0),this.selectionOutlinePass.render(this.renderer,a.inputBuffer,t,0)}finally{a.setSize(o,l,!1),this.syncComposerOutput(),this.renderer.setRenderTarget(t)}}syncComposerOutput(){const e=(this.selectionOutline?.selection.size??0)>0;this.sceneRenderPass&&(this.sceneRenderPass.renderToScreen=!e),this.selectionOutlinePass&&(this.selectionOutlinePass.enabled=e,this.selectionOutlinePass.renderToScreen=e)}refreshSkeletonHelper(){const e=this.state.skeleton||this.boneSelectionHighlight!==null;e&&!this.skeletonHelper?(this.skeletonHelper=new Ni(this.root),Eo(this.skeletonHelper),this.scene.add(this.skeletonHelper)):e||this.clearSkeletonHelper()}clearSkeletonHelper(){this.skeletonHelper&&(this.skeletonHelper.removeFromParent(),this.skeletonHelper.dispose(),this.skeletonHelper=null)}clearBoneSelectionHighlight(){this.boneSelectionHighlight&&(this.boneSelectionHighlight.removeFromParent(),this.boneSelectionHighlight.dispose(),this.boneSelectionHighlight=null)}clearBoundsHelper(){if(!this.boundsHelper)return;const e=this.boundsHelper;this.boundsHelper=null;const t=this.helpers.indexOf(e);t>=0&&this.helpers.splice(t,1),e.removeFromParent(),e.geometry.dispose(),Array.isArray(e.material)?e.material.forEach(s=>{s.dispose()}):e.material.dispose()}frameBones(e){const t=new wr,s=new D;for(const l of e){t.expandByPoint(l.getWorldPosition(s)),l.parent?.isBone&&t.expandByPoint(l.parent.getWorldPosition(s));for(const p of l.children)p.isBone&&t.expandByPoint(p.getWorldPosition(s))}const i=t.getCenter(new D),a=Math.max(t.getSize(new D).length(),.2);t.expandByScalar(a*.35);const c=this.viewport.camera.position.clone().sub(this.viewport.orbitControls.target).normalize(),o=Vt(t,this.viewport.camera,c);this.viewport.setPose(i.clone().addScaledVector(c,o),i)}syncOrthographicCamera(){const e=this.viewport.camera,t=this.viewport.orbitControls.target,s=Math.max(e.position.distanceTo(t),.001),i=Math.max(s*Math.tan(br.degToRad(e.fov)/2),.001),a=Math.max(this.renderer.domElement.clientWidth,1),c=Math.max(this.renderer.domElement.clientHeight,1),o=this.captureAspect??a/c;this.orthographicCamera.left=-i*o,this.orthographicCamera.right=i*o,this.orthographicCamera.top=i,this.orthographicCamera.bottom=-i,this.orthographicCamera.near=e.near,this.orthographicCamera.far=e.far,this.orthographicCamera.position.copy(e.position),this.orthographicCamera.quaternion.copy(e.quaternion),this.orthographicCamera.up.copy(e.up),this.orthographicCamera.layers.mask=e.layers.mask,this.orthographicCamera.updateProjectionMatrix(),this.orthographicCamera.updateMatrixWorld(!0)}clearDiagnosticPresentation(){this.clearTopologyOverlay(),this.scene.overrideMaterial?.dispose(),this.scene.overrideMaterial=null;for(const e of this.helpers.splice(0)){e.removeFromParent();const t=e;t.geometry?.dispose();const s=t.material;Array.isArray(s)?s.forEach(i=>{i.dispose()}):s?.dispose()}}notify(){this.version++;for(const e of this.listeners)e()}}const Lo=7;let at=null;function Fo(){if(at)return at;const n=64,e=document.createElement("canvas");e.width=n,e.height=n;const t=e.getContext("2d");return t.beginPath(),t.arc(n/2,n/2,n/2-1,0,Math.PI*2),t.fillStyle="rgba(0, 0, 0, 0.75)",t.fill(),t.beginPath(),t.arc(n/2,n/2,n/2-8,0,Math.PI*2),t.fillStyle="#ffffff",t.fill(),at=new $i(e),at.colorSpace=Qs,at}class Do extends Zs{objects=[];origin=new D;constructor(){super(new Ks,new Ys({map:Fo(),size:Lo,sizeAttenuation:!1,transparent:!0,alphaTest:.05,depthTest:!1,depthWrite:!1,toneMapped:!1})),this.name="volter:selection-origins",this.userData.editorHelper=!0,this.renderOrder=1e3,this.frustumCulled=!1,this.raycast=()=>{}}update(e,t){this.objects=e,this.material.color.setHex(e.length===1&&t.active!==void 0?t.active:t.visible),this.visible=e.length>0}place(){const e=this.objects.length;let t=this.geometry.getAttribute("position");(t===void 0||t.count<e)&&(this.geometry.dispose(),t=new Xs(new Float32Array(Math.max(e,8)*3),3),this.geometry.setAttribute("position",t)),this.geometry.setDrawRange(0,e),this.objects.forEach((s,i)=>{s.getWorldPosition(this.origin),t.setXYZ(i,this.origin.x,this.origin.y,this.origin.z)}),t.needsUpdate=!0}dispose(){this.removeFromParent(),this.geometry.dispose(),this.material.dispose()}}class Ho{constructor(e){this.options=e}active=null;settling=!1;idleWaiters=new Set;begin(e){if(this.active||this.settling)return!1;try{const t=this.options.begin(e);return t?(this.active={pointerId:e.pointerId,gesture:t},!0):!1}catch(t){return this.options.reportError(t),!1}}update(e){if(!(!this.active||this.active.pointerId!==e.pointerId))try{this.active.gesture.update(e)}catch(t){this.cancelWithError(t)}}async commit(e){const t=this.take(e.pointerId);if(!t)return!1;this.settling=!0;try{return await t.commit(e),await this.options.persist(t.label),!0}catch(s){try{await t.cancel()}catch(i){return this.options.reportError({operationError:s,rollbackError:i}),!1}return this.options.reportError(s),!1}finally{this.settling=!1;for(const s of this.idleWaiters)s();this.idleWaiters.clear()}}async cancel(e){const t=this.take(e);if(!t)return!1;this.settling=!0;try{return await t.cancel(),!0}catch(s){return this.options.reportError(s),!1}finally{this.settling=!1;for(const s of this.idleWaiters)s();this.idleWaiters.clear()}}async settle(){this.active&&await this.cancel(),this.settling&&await new Promise(e=>this.idleWaiters.add(e))}hasActiveGesture(){return this.active!==null}take(e){if(!this.active||e!==void 0&&this.active.pointerId!==e)return null;const t=this.active.gesture;return this.active=null,t}async cancelWithError(e){const t=this.take();if(t){this.settling=!0;try{await t.cancel(),this.options.reportError(e)}catch(s){this.options.reportError({operationError:e,rollbackError:s})}finally{this.settling=!1;for(const s of this.idleWaiters)s();this.idleWaiters.clear()}}}}class Bo{constructor(e,t){this.frame=e,this.releaseRenderer=t,this.unsubscribeActivity=go(()=>this.syncActivity())}rafId=0;running=!1;disposed=!1;active=!1;unsubscribeActivity;get isDisposed(){return this.disposed}get isRunning(){return this.running}setActive(e){this.disposed||(this.active=e,this.syncActivity())}syncActivity(){this.active&&ur()?this.start():this.stop()}redraw(){this.running&&!this.disposed&&ur()&&this.guardedFrame(performance.now())}dispose(){this.stop(),!this.disposed&&(this.disposed=!0,this.unsubscribeActivity(),this.releaseRenderer())}start(){this.disposed||this.running||(this.running=!0,this.guardedFrame(performance.now(),!0),!(!this.running||this.disposed)&&(this.rafId=requestAnimationFrame(this.tick)))}lastFrameFailure=null;guardedFrame(e,t=!1){try{this.frame(e,t),this.lastFrameFailure=null}catch(s){const i=s instanceof Error?s.message:String(s);i!==this.lastFrameFailure&&(this.lastFrameFailure=i,console.error("[document renderer] a frame threw; the loop continues:",s))}}stop(){this.running=!1,this.rafId!==0&&(cancelAnimationFrame(this.rafId),this.rafId=0)}tick=e=>{if(!(!this.running||this.disposed)){if(!ur()){this.stop();return}this.guardedFrame(e),!(!this.running||this.disposed)&&(this.rafId=requestAnimationFrame(this.tick))}}}const _o=new Set(["solid","clay","unlit","wireframe","normals","overdraw"]);function zo(n,e){return{read:()=>{const t=n.cameraPose;if(!t)return null;const{position:s,target:i}=t;return{camera:{position:{x:s.x,y:s.y,z:s.z},target:{x:i.x,y:i.y,z:i.z},...t.fov?{fov:t.fov}:{}},diagnostic:n.shadingMode,grid:Hn(e)}},setDiagnostic:t=>_o.has(t)?(n.setShadingMode(t),!0):!1,setCamera:t=>typeof t!="string"?(n.shell.setCameraPose(t.position,t.target,t.fov),!0):t==="isometric"?!1:(n.shell.setViewPreset(t),!0),frame:t=>t==="document"?!1:(n.shell.focusOnSelection(),!0)}}function Wo(n){const e=mr();return e?Bn(Ns(e.shell,n)):"none"}const Io=f.lazy(()=>Ke(()=>import("./stage-transform-tools-ChWaCiOj.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,1,2,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63])).then(n=>({default:n.ThreeStageTransformTools}))),No=f.lazy(()=>Ke(()=>import("./stage-transform-tools-ChWaCiOj.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,1,2,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63])).then(n=>({default:n.ThreeStageTransformControls})));function Fs(n){return{transformTools:()=>Wo(n),TransformTools:Io,TransformControls:No}}class $o{constructor(e,t,s){this.create=e,this.isOpen=t,this.subscribe=s}states=new Map;generations=new WeakMap;unsubscribe=null;claim(e){const t=this.states.get(e)??[];let s=t.find(i=>!i.inUse);return s||(s=this.create(e),t.push(s),this.states.set(e,t)),s.inUse=!0,this.generations.set(s,this.generation(s)+1),this.unsubscribe??=this.subscribe(()=>this.discardClosed()),s}generation(e){return this.generations.get(e)??0}release(e,t=this.generation(e)){this.generation(e)===t&&(e.inUse=!1,queueMicrotask(()=>this.discardClosed()))}retain(e,t,s){if(!this.isOpen(e.documentId)||!this.states.get(e.documentId)?.includes(e)||this.generation(e)!==s){t.dispose();return}const i=e.source;e.source=t,i!==t&&i?.dispose()}discardClosed(){const e=[];for(const[s,i]of this.states){if(this.isOpen(s))continue;const a=i.filter(c=>c.inUse);e.push(...i.filter(c=>!c.inUse)),a.length?this.states.set(s,a):this.states.delete(s)}this.states.size===0&&(this.unsubscribe?.(),this.unsubscribe=null);const t=[];for(const s of e){const i=s.source;s.source=null;try{i?.dispose()}catch(a){t.push(a)}}if(t.length)throw new AggregateError(t,"Retained document cleanup failed")}}const Go=f.lazy(async()=>({default:(await Ke(()=>import("./stage-overlay-set-B6mrZlgh.js"),__vite__mapDeps([64,4,5,7,8,6,9,10,11,12,13,45,65,66,24,14,15,1,2,16,17,18,19,20,21,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63]))).StageOverlaySet}));function qo(n){return d.jsx(f.Suspense,{fallback:null,children:d.jsx(Go,{...n})})}function Ds(n,e,t){if(e==="orthographic"){const s=Lt(n.camera.position.clone().sub(n.orbitControls.target),new D(0,1,0).applyQuaternion(n.camera.quaternion));return s!==null?s:t==="short"?"Iso":"Orthographic"}return t==="short"?"Persp":"Perspective"}const Uo=()=>()=>{},Hs=()=>0;function Ko({shell:n,documentId:e,label:t,kebab:s=!1}){const i=f.useSyncExternalStore(ro,Ms,Ms);f.useSyncExternalStore(uo,ho);const a=e?po(e):null;f.useSyncExternalStore(a?.subscribe??Uo,a?.getSnapshot??Hs,a?.getSnapshot??Hs);const c=a?a.projection():i.projection,o=x=>{a?a.setProjection(x):Rs(x)},[l,p]=f.useState(!1),P=f.useRef(null);f.useEffect(()=>{if(!l)return;const x=S=>{P.current?.contains(S.target)||p(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[l]);const v=x=>{if(a){a.setViewPreset(x,"view");return}Rs("orthographic"),n.setViewPreset(x)};return d.jsxs("div",{ref:P,className:"volter-viewport-popover-anchor",children:[t===void 0?d.jsx(qe,{text:c==="perspective"?"Perspective":"Orthographic",children:d.jsx(Te,{"aria-label":"Viewport views","aria-expanded":l,size:"comfortable",onClick:()=>p(x=>!x),children:d.jsx(we,{icon:l?_n:zn,size:"md"})})}):d.jsxs(Ne,{size:"comfortable",variant:"ghost","aria-label":"Viewport views","aria-expanded":l,"data-testid":"viewport-view-name",onClick:()=>p(x=>!x),children:[s?d.jsx(we,{icon:Wn,size:"sm"}):null,t]}),l?d.jsx(In,{style:{minWidth:230},children:d.jsxs(Nn,{gap:3,children:[d.jsx(as,{variant:"caption",tone:"muted",children:"Projection"}),d.jsxs(cs,{gap:1,children:[d.jsx(Ne,{size:"compact",variant:c==="perspective"?"primary":"ghost",onClick:()=>o("perspective"),children:"Perspective"}),d.jsx(Ne,{size:"compact",variant:c==="orthographic"?"primary":"ghost",onClick:()=>o("orthographic"),children:"Orthographic"})]}),d.jsx(as,{variant:"caption",tone:"muted",children:"Axis View"}),d.jsxs(cs,{gap:1,children:[d.jsx(Ne,{size:"compact",variant:"ghost",onClick:()=>v("top"),children:"Top"}),d.jsx(Ne,{size:"compact",variant:"ghost",onClick:()=>v("front"),children:"Front"}),d.jsx(Ne,{size:"compact",variant:"ghost",onClick:()=>v("right"),children:"Right"})]})]})}):null]})}const Xo=io;function Bs(n){return Sr(null,n)}const Yo=()=>()=>{},_s=()=>0,Zo=5,Qo=58;function Jo(n,e){const t=e?.camera()??n.renderCamera,s=n.camera.position,i=n.orbitControls.target,a=t.isOrthographicCamera?sn(t,n,e):0;return[s.x,s.y,s.z,i.x,i.y,i.z,a].map(c=>c.toPrecision(6)).join(",")}function sn(n,e,t){const s=e.orbitControls.domElement,i=Math.max(1,t?.renderer.domElement.height??(s?.clientHeight??1)*(s?.ownerDocument.defaultView?.devicePixelRatio??1));return(n.top-n.bottom)/n.zoom/i}function ea({viewport:n,documentId:e,session:t,store:s,projection:i,displayName:a,objectName:c,statistics:o,subject:l,gridScale:p}){f.useSyncExternalStore(s.subscribe,s.getShellSnapshot??s.getSnapshot),f.useSyncExternalStore(f.useCallback(V=>{const F=n?.orbitControls;return F?.addEventListener("change",V),()=>F?.removeEventListener("change",V)},[n]),()=>n?Jo(n,t):""),f.useSyncExternalStore(t?.subscribe??Yo,t?.getSnapshot??_s,t?.getSnapshot??_s);const P=f.useSyncExternalStore(Bs,$s),v=f.useSyncExternalStore(Bs,$n),x=P&&!v?Ue.content.onAccent:Ue.content.primary,S=Gn();f.useSyncExternalStore(fr,ls,ls);const z=ct(e).overlays.navigationControls;if(!n)return null;const H=Lt(n.camera.position.clone().sub(n.orbitControls.target),new D(0,1,0).applyQuaternion(n.camera.quaternion))??"User",E=t?.projection()??i,C=t?.cameraView()??null,W=C?`Camera ${C.projection==="perspective"?"Perspective":"Orthographic"}`:`${H} ${E==="perspective"?"Perspective":"Orthographic"}`,Q=s.selectedEntityId,y=(Q===null?null:c(Q))||null,$=l??(y===null||y===a?a:`${a} | ${y}`),B=t?.camera()??n.renderCamera,K=p&&!C&&H!=="User"&&B.isOrthographicCamera?p(sn(B,n,t)):null,L=V=>{V.preventDefault();const F=V.currentTarget;F.setPointerCapture(V.pointerId);const be=n.orbitControls.domElement?.getBoundingClientRect().top??0,Ee=Math.max(5+V.clientY-be,1),oe=n.camera,le=n.orbitControls.target,ae=oe.position.clone().sub(le),te=!t&&n.renderCamera instanceof vr?n.renderCamera:null,se=te?.zoom??1,Oe=t?.cameraViewZoom()??null,ue=he=>{const Ae=5+he.clientY-be,ye=Math.max(.01,2*(Ae/Ee-1)+1);Oe!==null&&t?.cameraView()?t.setCameraViewZoom(Oe/ye):te?(te.zoom=se/ye,te.updateProjectionMatrix()):oe.position.copy(le).addScaledVector(ae,ye),n.orbitControls.update()},J=()=>{F.removeEventListener("pointermove",ue),F.removeEventListener("pointerup",J),F.removeEventListener("pointercancel",J),F.removeEventListener("lostpointercapture",J)};F.addEventListener("pointermove",ue),F.addEventListener("pointerup",J),F.addEventListener("pointercancel",J),F.addEventListener("lostpointercapture",J)},X=V=>{V.preventDefault();const F=V.currentTarget;F.setPointerCapture(V.pointerId);let be=V.clientX,Ee=V.clientY;const oe=new D,le=new D,ae=se=>{const Oe=se.clientX-be,ue=se.clientY-Ee;if(be=se.clientX,Ee=se.clientY,t?.cameraView()){const Ye=t.renderer.domElement;t.panCameraView(Oe/Math.max(Ye.clientWidth,1),ue/Math.max(Ye.clientHeight,1));return}const J=n.camera,he=n.orbitControls.target,Ae=J.position.distanceTo(he),ye=Math.max(1,F.ownerDocument.defaultView?.innerHeight??1),Xe=2*Ae*Math.tan(br.degToRad(J.fov/2))/ye;oe.setFromMatrixColumn(J.matrixWorld,0).multiplyScalar(-Oe*Xe),le.setFromMatrixColumn(J.matrixWorld,1).multiplyScalar(ue*Xe),J.position.add(oe).add(le),he.add(oe).add(le),n.orbitControls.update()},te=()=>{F.removeEventListener("pointermove",ae),F.removeEventListener("pointerup",te),F.removeEventListener("pointercancel",te),F.removeEventListener("lostpointercapture",te)};F.addEventListener("pointermove",ae),F.addEventListener("pointerup",te),F.addEventListener("pointercancel",te),F.addEventListener("lostpointercapture",te)};return d.jsxs(d.Fragment,{children:[S.viewName==="text"?d.jsxs("div",{"data-testid":"viewport-view-text","aria-hidden":"true",style:{position:"absolute",top:"var(--volter-space-3)",left:"calc(var(--volter-space-4) + var(--volter-control-comfortable-height) * 2 + var(--volter-space-4))",display:"flex",flexDirection:"column",gap:"var(--volter-space-1)",fontSize:"var(--volter-font-sm)",color:x,textShadow:"var(--volter-content-text-shadow, none)",pointerEvents:"none",userSelect:"none"},children:[d.jsx("span",{children:W}),d.jsx("span",{children:$}),K?d.jsx("span",{"data-testid":"viewport-grid-scale",children:K}):null,o&&o.length>0?d.jsx("div",{"data-testid":"viewport-statistics",style:{display:"grid",gridTemplateColumns:`${Qo}px auto`,rowGap:"var(--volter-space-1)",marginTop:qn[Zo]},children:o.map(V=>d.jsxs(f.Fragment,{children:[d.jsx("span",{children:V.label}),d.jsx("span",{children:V.value})]},V.id))}):null]}):null,S.viewName==="menu"?d.jsx("div",{className:"volter-viewport-view-pill",style:{position:"absolute",top:"var(--volter-viewport-overlay-top, var(--volter-space-4))",left:"var(--volter-stage-name-left, calc(var(--volter-space-4) + var(--volter-control-comfortable-height) * 2 + var(--volter-space-4)))",zIndex:"calc(var(--volter-z-dropdown, 1000) - 1)",pointerEvents:"auto"},children:d.jsx(Ko,{shell:s,documentId:e,label:Ds(n,E,"long"),kebab:!0})}):null,S.viewName==="gizmo"?d.jsxs("button",{type:"button","data-testid":"viewport-view-name",className:"volter-viewport-gizmo-label","aria-label":E==="perspective"?"Switch to orthographic":"Switch to perspective",onClick:()=>{const V=E==="perspective"?"orthographic":"perspective";t?t.setProjection(V):n.setProjection(V)},style:{position:"absolute",top:no+4,right:so,transform:"translateX(50%)",display:"inline-flex",alignItems:"center",gap:"var(--volter-space-1)",padding:0,border:0,background:"none",fontSize:"var(--volter-font-sm)",color:x,textShadow:"var(--volter-content-text-shadow, none)",cursor:"pointer",pointerEvents:"auto"},children:[d.jsx(we,{size:"xs",icon:E==="perspective"?Un:Kn}),Ds(n,E,"short")]}):null,z?d.jsxs("div",{"data-testid":"viewport-navigation",role:"toolbar","aria-label":"Navigation","aria-orientation":"vertical",className:"volter-chrome-island volter-viewport-navigation",style:{position:"absolute",top:Xo,right:"var(--volter-space-6)",display:"flex",flexDirection:"column",gap:"var(--volter-space-1)",padding:"var(--volter-space-1) 0",borderRadius:"var(--volter-radius-full)",background:"var(--volter-island-surface, var(--volter-surface-overlay))",pointerEvents:"auto"},children:[d.jsx(qe,{text:"Zoom (drag)",children:d.jsx(Te,{size:"comfortable","aria-label":"Zoom the view",onPointerDown:L,children:d.jsx(we,{size:"2xl",icon:ve.viewport.zoomIn})})}),d.jsx(qe,{text:"Pan (drag)",children:d.jsx(Te,{size:"comfortable","aria-label":"Pan the view",onPointerDown:X,children:d.jsx(we,{size:"2xl",icon:ve.viewport.pan})})}),t?.hasCameraView()?d.jsx(qe,{text:C?"Leave the camera view":"Look through the camera",children:d.jsx(Te,{size:"comfortable","aria-label":"Toggle the camera view",onClick:()=>t.toggleCameraView(),children:d.jsx(we,{size:"2xl",icon:C?ve.viewport.cameraView:ve.viewport.camera})})}):null,C&&t?.cameraViewLocked()!==null?d.jsx(qe,{text:t?.cameraViewLocked()?"Unlock the camera from the view":"Lock the camera to the view",children:d.jsx(Te,{size:"comfortable","aria-label":"Lock the camera to the view",onClick:()=>t?.toggleCameraViewLock(),children:d.jsx(we,{size:"2xl",icon:t?.cameraViewLocked()?ve.viewport.cameraLocked:ve.viewport.cameraUnlocked})})}):null,C||S.viewName==="gizmo"?null:d.jsx(qe,{text:E==="perspective"?"Orthographic":"Perspective",children:d.jsx(Te,{size:"comfortable","aria-label":"Toggle perspective and orthographic",onClick:()=>{const V=E==="perspective"?"orthographic":"perspective";t?t.setProjection(V):n.setProjection(V)},children:d.jsx(we,{size:"2xl",icon:E==="orthographic"?ve.viewport.projectionOrthographic:ve.viewport.projection})})})]}):null,C&&t?d.jsx(ta,{view:C,canvas:t.renderer.domElement,locked:t.cameraViewLocked()===!0}):null]})}function ta({view:n,canvas:e,locked:t}){const[s,i]=f.useState(null),[,a]=f.useState(0);f.useEffect(()=>{const E=new ResizeObserver(()=>a(C=>C+1));return E.observe(e),()=>E.disconnect()},[e]);const c=e.clientWidth,o=e.clientHeight,l=e.ownerDocument.defaultView?.devicePixelRatio??1,p=e.getBoundingClientRect(),P=s?.getBoundingClientRect(),v=1/l,x=n.frame.left*c-v,S=n.frame.top*o-v,z=n.frame.width*c+2*v,H=n.frame.height*o+2*v;return d.jsx("div",{ref:i,"aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none"},children:P?d.jsxs("svg",{"data-testid":"viewport-camera-frame",width:c,height:o,style:{position:"absolute",left:p.left-P.left,top:p.top-P.top},children:[n.passepartout.opacity>0?d.jsx("path",{d:`M0 0H${c}V${o}H0Z M${x} ${S}V${S+H}H${x+z}V${S}Z`,fill:n.passepartout.color,fillOpacity:n.passepartout.opacity,fillRule:"evenodd"}):null,n.passepartout.opacity>0?d.jsx("rect",{x,y:S,width:z,height:H,fill:"none",stroke:n.border.solid,strokeWidth:v,shapeRendering:"crispEdges"}):null,d.jsx("rect",{x,y:S,width:z,height:H,fill:"none",stroke:n.border.dashed,strokeWidth:v,strokeDasharray:`${3*v} ${3*v}`,shapeRendering:"crispEdges"}),t?d.jsx("rect",{x:x-v,y:S-v,width:z+2*v,height:H+2*v,fill:"none",stroke:n.border.locked,strokeWidth:v,strokeDasharray:`${3*v} ${3*v}`,shapeRendering:"crispEdges"}):null]}):null})}const ra=f.lazy(async()=>({default:(await Ke(()=>import("./stage-keyboard-D8-cWRr2.js"),__vite__mapDeps([67,7,5,8,68,6,4,9,10,11,12,13,45,23]))).StageKeyboardBinding})),sa=n=>{const e=n.split(":");return(e[0]==="document"?e[1]:e[0])??n},zs=()=>Pi(),pr=12;function Ws(n){if(!n)return null;const e=new wr(new D(n.min[0],n.min[1],n.min[2]),new D(n.max[0],n.max[1],n.max[2]));return e.isEmpty()?null:e}const na=500;function ia(n){return Sr(null,n)}const oa=["solid","preview","rendered","clay","unlit","wireframe","matcap","normals","overdraw"];let aa=0;const Ge=new $o(n=>({documentId:n,store:en(new Gs),inUse:!1,source:null,camera:null,presentation:null,transport:null,contentSeconds:0,transportAdvances:0}),n=>ni().some(e=>e.descriptor.id===n),ii);function ca({canvasHostRef:n}){return d.jsx("div",{ref:n,style:{position:"absolute",inset:0}})}function la(n,e,t,s,i){if(e==="inspector-preview"){const l=Ti();return l.canvas.setAttribute("aria-label",`${t} authoring viewport`),n.appendChild(l.canvas),{canvas:l.canvas,renderer:l.renderer,lease:l}}const a=Zi(s.width,s.height,i),{canvas:c,renderer:o}=a;return c.setAttribute("aria-label",`${t} authoring viewport`),n.appendChild(c),{canvas:c,renderer:o,lease:a}}class Is{constructor(e,t,s){this.lane=e,this.surface=t,this.store=s??en(new Gs),this.transport=new xi(this.store.shell)}scene=new Js;store;cleanups=[];rendererSession=new Bo((e,t)=>this.frame?.(e,t),()=>{});viewport=null;session=null;dressing=null;presentationRig=null;applyPresentation=null;backdropOverridden=!1;documentStudio=null;contentLights=[];contentHas={light:!1,"directional-light":!1};darkened=[];darkenContentLights(){for(const t of this.contentLights)t.visible&&(t.visible=!1,this.darkened.push(t));if(this.darkened.length===0)return 0;const e=this.darkened.length;return this.scene.onAfterRender=()=>{for(const t of this.darkened)t.visible=!0;this.darkened=[],this.scene.onAfterRender=()=>{}},e}defaultEnvironment=null;defaultBackground=null;adapter=null;presentationAdapter=null;content=null;frame=null;syncHostScene=null;presence=null;initialized=!1;contentSeconds=0;transportAdvances=0;users=0;closed=!1;released=!1;get isClosed(){return this.closed}transport;borrow(){this.users++;let e=!1;return()=>{e||(e=!0,this.users--,this.releaseIfClosed())}}close(){this.closed=!0,this.frame=null,this.syncHostScene=null,this.session?.setBeforeRender(null),this.session?.setPresentsFrames(!1),this.rendererSession.setActive(!1),this.content?.dispose(),this.transport.dispose(),this.releaseIfClosed()}releaseIfClosed(){if(!this.closed||this.users!==0||this.released)return;this.released=!0;const{lease:e,renderer:t,canvas:s}=this.surface;for(const i of[...this.cleanups.splice(0),()=>this.session?.dispose(),()=>this.viewport?.dispose(),()=>this.rendererSession.dispose(),()=>this.dressing?.dispose(),...e?[()=>e.release()]:[()=>t.dispose(),()=>t.forceContextLoss(),()=>s.remove()]])try{i()}catch(a){console.error("Object3D document cleanup failed.",a)}}}function nn({documentId:n,sourcePath:e,build:t,displayName:s="Source Object3D",background:i,cameraDirection:a,persistence:c,documentSource:o,authoring:l,interaction:p,selectionOutline:P=!0,active:v=!0,audit:x=!0,chromeless:S=!1,modelSource:z,assetType:H,sourceAuthoring:E,dressing:C,rendererLane:W="own",onOpenNode:Q,frameBounds:y,openingFrameBounds:$,openingFit:B,openingView:K,presentation:L,cameraView:X,stageKind:V,statistics:F,subject:be,gridScale:Ee,content:oe}){const le=V??sa(n);f.useEffect(()=>{if(!S)return Xn(n)},[n,S]);const ae=Ci(Yn()),te=ae??mr(),se=te?Ns(te.shell,n,S?"embedded":"document"):null,Oe=f.useSyncExternalStore(ia,$s),ue=se!==null&&Zn(se,Oe),J=f.useRef(ue);J.current=ue;const he=se!==null&&Qn(se),Ae=f.useRef(he);Ae.current=he;const ye=se!==null&&Jn(se),Xe=f.useRef(ye);Xe.current=ye;const Ye=ei(),Ft=f.useRef(Ye);Ft.current=Ye;const Dt=f.useRef(null),Ht=f.useRef(null),G=f.useRef(null),Me=f.useRef(null);(!Me.current||Me.current.documentId!==n)&&(Me.current&&Ge.release(Me.current),Me.current=Ge.claim(n)),f.useEffect(()=>{const M=Me.current,de=Ge.generation(M);return()=>Ge.release(M,de)},[n]);const I=Me.current,Le=oe?.kind==="world-root",Bt=v||Le,xr=f.useRef(oe?.kind==="world-root"?oe.load:null);xr.current=oe?.kind==="world-root"?oe.load:null;const[Fe,_t]=f.useState(Bt);f.useEffect(()=>_t(Bt),[Bt]);const zt=f.useRef(P);f.useEffect(()=>{zt.current=P;const M=G.current?.session;M&&(M.selectionOutlineEnabled=W!=="inspector-preview"&&P),G.current?.applyPresentation?.()},[P,W]);const Pr=f.useRef(Promise.resolve()),Wt=f.useRef(!1);f.useEffect(()=>{if(Fe)return Ze.current=!1,Gt("building"),()=>{const M=G.current;if(M&&!Le){Wt.current=!lt.current;const de=M.store.cameraPose;I.camera=de&&M.viewport?{...de,up:M.viewport.camera.up.clone()}:null,I.presentation=M.session?.presentation()??null,I.transport=M.transport.snapshot(),I.contentSeconds=M.contentSeconds,I.transportAdvances=M.transportAdvances}dt.current=null,pt.current=null,ht.current=null,ut.current=null,M?.close(),G.current=null}},[n,W,I,Fe,Le]);const Cr=f.useRef(Q);Cr.current=Q;const kr=f.useRef(y);kr.current=y;const Er=f.useRef($);Er.current=$;const It=f.useRef(K);It.current=K;const Or=f.useRef(L);Or.current=L;const Mr=f.useRef(X);Mr.current=X;const lt=f.useRef(v);lt.current=v;const Rr=f.useRef(v),jr=f.useRef({build:t,sourcePath:e});f.useEffect(()=>{const M=jr.current;jr.current={build:t,sourcePath:e},!(M.build===t&&M.sourcePath===e)&&!Fe&&I.source&&(I.source.dispose(),I.source=null)},[t,I,e,Fe]);const ut=f.useRef(null),Ze=f.useRef(!1),ht=f.useRef(null),dt=f.useRef(null),pt=f.useRef(null),[Nt,ne]=f.useState(null),[$t,Gt]=f.useState("building"),[Tr,on]=f.useState(null),[an,cn]=f.useState("mounting"),[ln,un]=f.useState([]),Vr=f.useRef(null),[Ar,hn]=f.useState("perspective"),[dn,Lr]=f.useState(null),ft=f.useRef(null);ft.current=dn;const qt=a?.[0],Ut=a?.[1],Kt=a?.[2],Qe=z?.kind,Xt=z?.kind==="project-file"?z.path:void 0,mt=z?.kind==="entity"?z.entityId:void 0,Fr=C?.environment,Dr=C?.background,Hr=C?.keyLight,Yt=C?.grid,Je=C?.viewLocked,Zt=C?.toneMapping;v&&ti(n),f.useEffect(()=>{let M=!1;if(!Fe)return;const de=async Se=>{const N=Dt.current,et=Ht.current;if(!N||!et||G.current)return;const O=Ft.current;if(!O){ne("The world root needs the editor shell above it; this host has none.");return}const tt=await Se();if(M||G.current)return;on(()=>tt),us();const r=new Is("own",tt.mountWorldRootSurface(et,N,s),mr()??void 0);G.current=r,r.cleanups.push(hs(n,r.store.shell)),r.cleanups.push(ds(n,r.transport)),r.cleanups.push(Si(n,{...zo(r.store,n),...Fs(n)}));const ie=tt.installWorldRootStage({store:r.store,documentId:n,container:N,canvas:r.surface.canvas,renderer:r.surface.renderer,stats:O,cameraPreview:()=>Vr.current,onMountStatus:cn,onRootIds:un,runFrame:xe=>js(n,xe)});r.viewport=ie.viewport,r.frame=ie.frame,r.content={scene:ie.scene,settle:()=>Promise.resolve(),dispose:async()=>ie.dispose()};const j=Vs(()=>r.store.scene??ie.scene,r.transport,{rescanOnLiveMixers:()=>r.store.shell.playState==="stopped"});let re=0;r.cleanups.push(()=>j.dispose()),r.cleanups.push(r.store.shell.subscribe(()=>{if(r.store.shell.playState!=="stopped")return;const xe=performance.now();xe-re<na||(re=xe,j.refresh())})),r.cleanups.push(Ts({camera:ie.viewport.camera,drawCamera:()=>ie.viewport.renderCamera,orbit:ie.viewport.orbitControls,scene:ie.scene},ie.present,ie.setHelper,{documentId:n})),ut.current=r.rendererSession,r.initialized=!0,ws(),Gt("ready"),r.rendererSession.setActive(!0)},fn=async()=>{for(await G.current?.content?.settle();Ui();)await Ki();if(M)return;const Se=xr.current;if(Se)return de(Se);const N=Dt.current,et=Ht.current;if(!N||!et)return;if(!t||e===void 0){ne("This stage shows `build` content and was given no `build()`/`sourcePath`.");return}let O;const tt=Ge.generation(I);try{O=I.source??t(),I.source=null}catch(ee){ne(ee instanceof Error?ee.message:String(ee));return}try{G.current||(us(),G.current=new Is(W,la(et,W,s,{width:Math.max(1,N.clientWidth),height:Math.max(1,N.clientHeight)},()=>{_t(!1),window.setTimeout(()=>{lt.current&&_t(!0)},0)}),I.store),G.current.contentSeconds=I.contentSeconds,G.current.transportAdvances=I.transportAdvances)}catch(ee){throw O.dispose(),ee}const r=G.current,ie=r.borrow(),{renderer:j,canvas:re,lease:xe}=r.surface,T=r.store;S||(r.cleanups.push(hs(n,T.shell)),r.cleanups.push(ds(n,r.transport)));const vt=ps();vt&&T.shell.attachHistory(vt);const Jt=W==="inspector-preview",De=J.current,_r=Ae.current,zr=Xe.current,A=new Js,wt=O.root.parent;A.add(O.root),O.animations&&(O.root.animations=[...O.animations]);const er={root:O.root,animations:O.root.animations};let He=null,Be=null,_e=null,Pe=null,ce=null,bt=null,yt=null,St=null,xt=null,Pt=null,tr=null,Wr=null,Ir=null,Nr=!1,Ct=!1,kt=null;const rr={scene:A,settle:()=>ce?.settle()??Promise.resolve(),dispose:()=>{if(kt)return kt;Ct=!0;const ee=Wt.current;return Wt.current=!1,bt&&N.removeEventListener("pointerdown",bt,!0),yt&&N.removeEventListener("pointermove",yt,!0),St&&N.removeEventListener("pointerup",St,!0),xt&&N.removeEventListener("pointercancel",xt,!0),Pt&&window.removeEventListener("keydown",Pt),tr?.(),tr=null,kt=(async()=>{await ce?.settle();const rt=[];for(const Et of[()=>Pe?.dispose(),()=>Be?.dispose?.(),()=>He?.dispose(),()=>A.removeFromParent(),()=>{ee?Ge.retain(I,O,tt):O.dispose()},ie])try{Et()}catch(pe){rt.push(pe)}rt.length&&console.error("Object3D source cleanup failed.",...rt)})(),kt}};try{const ee=async u=>{try{const g=er;if(o&&!c){if(!g)throw new Error("Project history is unavailable; the edit was not saved.");const h=ps();if(!h)throw new Error("Project history is unavailable; the edit was not saved.");const m=o.serialize(g);if(m===null)return ne(null),!1;const w=await zs().replaceSource(h,{file:o.path,source:m,label:u??o.label??`Edit ${s}`});return ne(null),w}if(!c)throw new Error("This Asset Lab document has no persistence binding.");if(!_e||!g)throw new Error("Project history is unavailable; the edit was not saved.");const{persisted:k}=await(await _e).commit(g,u);return ne(null),k}catch(g){throw ne(g instanceof Error?g.message:JSON.stringify(g)),g}};He=new mo(T,A,{documentId:n,title:s,sourcePath:e,documentKind:zr?"asset":"source",audit:x,...O.hierarchyRoots?{hierarchyRoots:O.hierarchyRoots}:{},...Qe==="project-file"&&Xt?{modelSource:{kind:Qe,path:Xt}}:Qe==="entity"&&mt?{modelSource:{kind:Qe,entityId:mt}}:{}});const rt={documentId:n,sourcePath:e,root:O.root,animations:O.root.animations,scene:A,defaultAdapter:He,commit:ee};Be=l?.(rt)??null;const Et=Be?He:null;!Be&&E&&(Be=E({store:T,scene:A,...O.hierarchyRoots?{hierarchyRoots:O.hierarchyRoots}:{}}),He.dispose()),_e=c&&vt?zs().openPersistence({binding:c,document:er,history:vt}):null,_e&&_e.catch(u=>{!Ct&&G.current?.content===rr&&ne(u instanceof Error?u.message:JSON.stringify(u))});const pe=Be?.adapter??He;if(!r.dressing){j.outputColorSpace=Qs,j.toneMapping=Zt??Gi,j.shadowMap.enabled=!0,j.shadowMap.type=qi,j.info.autoReset=!1,j.setPixelRatio(Math.min(window.devicePixelRatio,2)),De&&j.setClearColor(0,0);const u=Fr===!1?null:xe&&"environment"in xe?xe.environment():ji(j),g=fs(re);r.dressing=ki(r.scene,{environment:u,background:!De&&i===void 0&&Dr!==!1,keyLight:!1,grid:Yt===!0,content:O.root}),!De&&i!==void 0?r.scene.background=new me(i):!De&&g.background!==null&&(r.scene.background=new me(g.background)),r.defaultEnvironment=r.scene.environment,r.defaultBackground=r.scene.background;{const k=new Ei(r.scene,_);r.presentationRig=k,ms(n,le);const h=()=>{const m=ct(n);if(k.apply(m,j,Zt),r.viewport?.setStageFunction(m.world,m.interaction),r.viewport?.setFieldOfView(m.camera.fov),r.viewport?.setSelectionMarks(m.overlays.selection),r.viewport?.setGridMajorEvery(m.overlays.grid.majorEvery),r.viewport?.setAxisLines(m.overlays.axes),r.viewport?.setNavigation(m.overlays.navigation),r.viewport?.setGridVisible(m.overlays.grid.visible),r.session){const w=r.session.presentation().mode==="wireframe"&&m.xray.enabled&&m.xray.alpha<=0;r.session.selectionOutlineEnabled=!Jt&&zt.current&&m.overlays.selection.outline&&!w,r.session.selectionOriginsEnabled=!Jt&&m.overlays.selection.origins,r.session.setXray(m.xray)}_()};r.applyPresentation=h,h(),r.cleanups.push(fr(h)),r.cleanups.push(oi(()=>{k.forgetFailedImages(),h()})),r.cleanups.push(()=>{k.dispose(),r.presentationRig===k&&(r.presentationRig=null)})}r.cleanups.push(()=>{r.defaultBackground instanceof Ps&&r.defaultBackground!==r.dressing?.backgroundTexture&&r.defaultBackground.dispose()})}const $r=(u,g)=>{const k=r.adapter,h=r.viewport;if(!k||!h)return null;const m=re.getBoundingClientRect(),w=new Tt((u-m.left)/Math.max(m.width,1)*2-1,-((g-m.top)/Math.max(m.height,1))*2+1),R=new Cs;R.layers.enableAll(),R.params.Line2={threshold:4},R.setFromCamera(w,r.session?.camera()??h.camera);const Z=r.presentationAdapter,ge=U=>{for(let Y=U;Y;Y=Y.parent){const it=Z?.hierarchy.idForObject3D?.(Y)??k.hierarchy.idForObject3D?.(Y);if(it)return it}return null};let je=null;for(const U of R.intersectObjects([...T.objectMap.values()],!0)){if(Ri(U.object))continue;const Y=ge(U.object);if(Y){je={distance:U.distance,id:Y};break}}const jt=h.visibleHelpers().filter(U=>U.userData.volterPickable===!0);for(const U of R.intersectObjects(jt,!0)){let Y=null,it=!0;for(let ot=U.object;ot;ot=ot.parent)ot.visible||(it=!1),Y??=ot.userData.volterPicksAs??null;if(!it)continue;const is=Y?ge(Y):null;if(is){(!je||U.distance<je.distance)&&(je={distance:U.distance,id:is});break}}return je?.id??null};if(!r.viewport){r.viewport=new oo(re,r.scene,T,N,{renderer:j,authoring:()=>r.adapter??pe,pick:$r,drawCamera:()=>r.session?.camera()??r.viewport.camera,publishPickContext:!1,onProjectionChange:hn,chromeInsetPx:S||_r?0:pr,lightRig:!1}),Yt===!0&&r.viewport.grid.removeFromParent();const u=g=>{const k=$r(g.clientX,g.clientY),h=k&&r.adapter?Ve(r.adapter.hierarchy,k):null;h&&Cr.current?.(h)};N.addEventListener("dblclick",u),r.cleanups.push(()=>N.removeEventListener("dblclick",u))}const b=r.viewport;if(Je){const u=b.camera;r.scene.add(u);const g=new At;g.name="volter:document-studio",g.add(Je),u.add(g),r.documentStudio=g,r.cleanups.push(()=>{Je.removeFromParent(),g.removeFromParent(),r.documentStudio===g&&(r.documentStudio=null),u.removeFromParent()})}if(p){const u=new At;u.name="__object3d_document_overlay",Us(u,"editorHelper",!0),A.add(u),Pe=p.setup({root:O.root,scene:A,renderer:j,overlay:u,camera:()=>r.session?.camera()??b.camera,writable:c!==void 0||o!==void 0});const g=h=>{const m=re.getBoundingClientRect(),w=new Tt((h.clientX-m.left)/Math.max(m.width,1)*2-1,-((h.clientY-m.top)/Math.max(m.height,1))*2+1),R=new Cs;return R.layers.enableAll(),R.setFromCamera(w,r.session?.camera()??b.camera),{pointerId:h.pointerId,button:h.button,buttons:h.buttons,clientX:h.clientX,clientY:h.clientY,altKey:h.altKey,ctrlKey:h.ctrlKey,metaKey:h.metaKey,shiftKey:h.shiftKey,ray:R.ray.clone(),hits:R.intersectObjects([O.root,u],!0)}};ce=new Ho({begin:h=>{if(!c&&!o)throw new Error("This Asset Lab document has no persistence binding; project gestures are read-only.");return Pe.begin(h)},persist:async h=>{await ee(h)},reportError:h=>ne(h instanceof Error?h.message:JSON.stringify(h))});const k=h=>{h.preventDefault(),h.stopPropagation()};bt=h=>{h.target instanceof Element&&h.target.closest('[role="alert"], [role="toolbar"]')!==null||ce?.begin(g(h))&&(k(h),h.isTrusted&&re.setPointerCapture?.(h.pointerId))},yt=h=>{ce?.hasActiveGesture()&&(k(h),ce.update(g(h)))},St=h=>{ce?.hasActiveGesture()&&(k(h),re.hasPointerCapture?.(h.pointerId)&&re.releasePointerCapture?.(h.pointerId),ce.commit(g(h)))},xt=h=>{ce?.hasActiveGesture()&&(k(h),ce.cancel(h.pointerId))},Pt=h=>{h.key!=="Escape"||!ce?.hasActiveGesture()||(h.preventDefault(),ce.cancel())},Wr=()=>{N.addEventListener("pointerdown",bt,!0),N.addEventListener("pointermove",yt,!0),N.addEventListener("pointerup",St,!0),N.addEventListener("pointercancel",xt,!0),window.addEventListener("keydown",Pt)}}const Re=r.content,Gr=[...T.shell.selectedEntityIds],st=r.adapter,gn=r.presentationAdapter,vn=new Map(T.objectMap),ze=r.session?.root,wn=r.frame,bn=r.syncHostScene,yn=dt.current,Sn=pt.current,xn=ht.current,qr=r.session?.neutralBackgroundTexture(),Pn=r.dressing.lights.map(u=>u.visible),Cn=r.cleanups.length,kn=r.initialized;if(Ir=()=>{A.removeFromParent(),wt&&wt.add(O.root),Re&&r.scene.add(Re.scene),r.adapter=st,r.presentationAdapter=gn,r.content=Re,r.frame=wn,r.syncHostScene=bn,r.initialized=kn;for(const u of r.cleanups.splice(Cn))u();!ze&&r.session&&(r.session.dispose(),r.session=null),T.objectMap.clear();for(const[u,g]of vn)T.objectMap.set(u,g);Re&&T.bindScene(Re.scene,j,b.batchedRenderer,b.camera),ze&&st&&r.session?.replaceContent(ze,st),dt.current=yn,pt.current=Sn,ht.current=xn,ft.current=st,Lr(st),qr!==void 0&&r.session?.setNeutralBackground(qr),r.dressing?.lights.forEach((u,g)=>{u.visible=Pn[g]??!0}),ze&&(r.dressing?.frameContent(ze),r.presentationRig?.placeFloor(ze)),T.shell.selectMultiple(Gr),T.notifyIngestObjectMapEdit()},Re?.scene.removeFromParent(),r.scene.add(A),r.adapter=pe,r.presentationAdapter=Et,r.content=rr,T.bindScene(A,j,b.batchedRenderer,b.camera),T.setOrbitTarget(b.orbitControls.target),T.objectMap.clear(),A.traverse(u=>{const g=Et?.hierarchy.idForObject3D?.(u)??pe.hierarchy.idForObject3D?.(u);g&&T.objectMap.set(g,u)}),r.session)r.session.replaceContent(O.root,pe);else{const u=Ws(kr.current),g=Ws(Er.current)??u,k=ct(n).camera;b.setFieldOfView(k.fov);const h=It.current,m=qt!==void 0&&Ut!==void 0&&Kt!==void 0;if(!h&&!m){const w=b.orbitControls.target,R=b.camera.position.distanceTo(w);b.camera.position.copy(w).addScaledVector(new D(...k.opening).normalize(),R)}if(g||b.focusOn(O.root),h){const w=new D(...h.target),R=new D(...h.direction).normalize();b.camera.position.copy(w).addScaledVector(R,h.distance),b.camera.up.set(0,1,0),h.up&&b.camera.up.set(...h.up),b.orbitControls.target.copy(w)}else if(m){const w=g??gr(O.root),R=w.getCenter(new D),Z=new D(qt,Ut,Kt).normalize(),ge=Vt(w,b.camera,Z)*Math.min(10,Math.max(.1,B??1));b.camera.position.copy(R).add(Z.multiplyScalar(ge)),b.orbitControls.target.copy(R)}if(r.session=new Ao(n,O.root,r.scene,j,b,pe,De?null:i===void 0?r.dressing.backgroundTexture:new me(i),u),r.session.selectionOutlineEnabled=!Jt&&zt.current,r.session.setCameraViewSource(Mr.current??null),r.applyPresentation?.(),It.current?.projection==="orthographic"&&r.session.setProjection("orthographic"),!De&&i===void 0&&r.dressing.backgroundTexture){const w=r.session;r.cleanups.push(Oi(()=>{const R=fs(re).background,Z=r.defaultBackground;r.defaultBackground=R!==null?new me(R):Mi(),w.neutralBackgroundTexture()===Z&&w.setNeutralBackground(r.defaultBackground),Z instanceof Ps&&Z!==r.dressing?.backgroundTexture&&Z.dispose()}))}}const nt=I.camera;nt&&(b.setPose(nt.position,nt.target,nt.fov||void 0,nt.up),b.setProjection(Ar),I.camera=null);const q=r.session;dt.current=er,pt.current=_e,ht.current=Pe,ft.current=pe,Lr(pe);const sr=ai(le)?.all?.lighting!==void 0||ci(le)?null:Je?{all:{lighting:{source:"studio",studioPreset:gs.id,auto:null}}}:Hr===!1?{all:{lighting:{source:"scene"}}}:null,nr=Or.current??null;ms(n,le,sr&&nr?li(sr,nr):nr??sr);const ir=new Set(oa);let Ur;const Kr=()=>{const u=r.session?.presentation().mode;u!==Ur&&(Ur=u,r.applyPresentation?.()),!(u===void 0||!ir.has(u))&&ct(n).drawMode!==u&&ui(n,{drawMode:u})},or=hi(n).drawMode;or!==void 0&&ir.has(or)&&r.session?r.session.setMode(or):Kr();const En=r.session?.subscribe(Kr),On=fr(()=>{const u=r.session,g=ct(n).drawMode;u&&u.presentation().mode!==g&&ir.has(u.presentation().mode)&&u.setMode(g)});r.cleanups.push(()=>{En?.(),On()});const Ot=[];O.root.traverse(u=>{u.isLight&&Ot.push(u)});const Mn={light:Ot.length>0,"directional-light":Ot.some(u=>u.isDirectionalLight)};r.contentLights=Ot,r.contentHas=Mn,r.dressing.frameContent(O.root),r.presentationRig?.placeFloor(O.root),r.cleanups.push(T.shell.subscribe(()=>r.presentationRig?.placeFloor(O.root)));const Xr=new Set;T.shell.selectMultiple(Gr.filter(u=>{const g=T.objectMap.get(u)??Ve(pe.hierarchy,u);if(g===null&&!T.objectMap.has(u))return!1;const k=g??u;return Xr.has(k)?!1:(Xr.add(k),!0)})),T.notifyIngestObjectMapEdit(),q.syncSelectionPresentation(),Wr?.(),ne(null),S||vs(n);let Mt=A.background;q.setNeutralBackground(Mt??r.defaultBackground);const We=I.presentation;We&&(q.setMode(We.mode),q.setBackground(We.background),q.setProjection(We.projection),q.setSkeleton(We.skeleton),q.setBounds(We.bounds),I.presentation=null);const Rn=()=>{r.viewport?.alignGridToView(q.camera(),j.domElement.width),r.scene.environment=A.environment??r.defaultEnvironment,r.scene.fog=A.fog,r.scene.environmentIntensity=A.environmentIntensity,r.scene.environmentRotation.copy(A.environmentRotation),r.scene.backgroundIntensity=A.backgroundIntensity,r.scene.backgroundBlurriness=A.backgroundBlurriness,r.scene.backgroundRotation.copy(A.backgroundRotation);const u=r.presentationRig;if(u){const g=u.resolveSource({...r.contentHas,environment:A.environment!==null}),k=u.environment();k&&(r.scene.environment=k.texture??r.defaultEnvironment,r.scene.environmentIntensity=k.intensity,r.scene.environmentRotation.set(0,k.rotation,0));const h=u.backdrop();h!=="keep"?(r.scene.background=h.value,r.scene.backgroundBlurriness=h.blur,r.scene.backgroundIntensity=h.intensity,r.scene.backgroundRotation.set(0,h.rotation,0),r.backdropOverridden=!0):r.backdropOverridden&&(r.scene.background=q.neutralBackgroundTexture(),r.scene.backgroundBlurriness=A.backgroundBlurriness,r.scene.backgroundIntensity=A.backgroundIntensity,r.backdropOverridden=!1);const m=g==="studio"&&u.presetId()===gs.id;r.documentStudio&&(r.documentStudio.visible=m);const w=g==="studio"&&!m||g==="preview"&&!u.sceneLightsShown()?r.darkenContentLights():0;u.update(q.camera()),di(n,{source:g,presetId:u.presetId(),presetLights:u.lightsVisible(),documentStudio:r.documentStudio?r.documentStudio.visible:null,contentLights:r.contentLights.length,contentLightsDarkened:w,environmentIntensity:r.scene.environmentIntensity,environmentImage:u.imageReport().shown,environmentImagePending:u.imageReport().pending,toneMapping:String(j.toneMapping)})}Mt!==A.background&&(Mt=A.background,q.setNeutralBackground(Mt??r.defaultBackground))};r.syncHostScene=Rn,q.setBeforeRender(()=>r.syncHostScene?.()),q.setPresentsFrames(!0);const jn=u=>{Ct||!(u>0)||!Number.isFinite(u)||(r.contentSeconds+=u,r.transportAdvances++,O.update?.(u))},Tn=Vs(O.root,r.transport);r.cleanups.push(()=>Tn.dispose());const Ce=I.transport;Ce&&(Ce.activeSubject&&r.transport.setActiveSubject(Ce.activeSubject),r.transport.setLoop(Ce.range.loop),r.transport.setTimeScale(Ce.timeScale),r.transport.seek(Ce.time),Ce.playbackState==="playing"?r.transport.play():Ce.playbackState==="paused"&&r.transport.pause(),I.transport=null);let ar=performance.now();const Yr=typeof O.onChange=="function";let cr=!0;const Rt=()=>{cr=!0};if(Yr){const u=O.onChange(Rt),g=T.shell.subscribe(Rt),k=["pointerdown","pointermove","pointerup","pointerleave","wheel","keydown","keyup"];for(const h of k)N.addEventListener(h,Rt,{capture:!0,passive:!0});tr=()=>{u(),g();for(const h of k)N.removeEventListener(h,Rt,{capture:!0})}}let Zr=-1;const Qr=new ks,Jr=new ks,es=new Tt,ts=new Tt;let rs,ss=null,ns=Number.NaN;const Vn=u=>{if(!Yr||cr||u>0||bs()!==Zr||q.needsFrame()||r.presence?.live()||Pe?.prepareFrame||Pe?.update||(b.batchedRenderer.batches?.length??0)>0)return!0;const g=q.camera();return g.updateMatrixWorld(),j.getDrawingBufferSize(ts),!g.matrixWorld.equals(Qr)||!g.projectionMatrix.equals(Jr)||!ts.equals(es)||r.scene.background!==rs||j.toneMapping!==ss||j.toneMappingExposure!==ns},An=()=>{cr=!1,Zr=bs();const u=q.camera();Qr.copy(u.matrixWorld),Jr.copy(u.projectionMatrix),j.getDrawingBufferSize(es),rs=r.scene.background,ss=j.toneMapping,ns=j.toneMappingExposure},Ln=(u,g)=>{if(Ct||!j||!b)return;const k=j,h=b,m=q?.profiler;m?.beginFrame(),g&&(ar=u);const w=Math.min((u-ar)/1e3,.1);ar=u,m?.beginPhase();const R=r.transport.tick(w);if(R>0&&jn(R),Pe?.prepareFrame?.(w),Pe?.update?.(w),m?.endPhase("animation"),m?.beginPhase(),r.presence?.syncMarkers(w),b.update(w),S||js(n,w),b.batchedRenderer.update(w),m?.endPhase("editor"),!g&&!Vn(R)){m?.endFrame();return}m?.beginPhase(),k.info.reset();const Z=!Ze.current&&pi()===n;Z&&fi(n);const ge=Z?Date.now():0,je=r.scene.overrideMaterial,jt=q.presentation().mode;jt!=="uv"&&jt!=="vertex-colors"&&(r.scene.overrideMaterial=A.overrideMaterial);try{h.renderWithInfrastructure(()=>{q.renderViewport(w),h.renderViewCube(k)})}finally{r.scene.overrideMaterial=je}q.servePresentedFrame(),An(),Ze.current||(Ze.current=!0,Z&&mi("first-render",Date.now()-ge),gi(n),Gt("ready")),m?.reportRender({gpuMs:null,drawCalls:k.info.render.calls,triangles:k.info.render.triangles,geometries:k.info.memory.geometries,textures:k.info.memory.textures}),m?.endPhase("render"),m?.endFrame();const U=Ft.current;if(U&&ae&&vi(ae.shell)===T.shell){const Y=q.cameraPose();U.frameTime=w*1e3,U.fps=w>0?1/w:0,U.drawCalls=k.info.render.calls,U.triangles=k.info.render.triangles,U.cameraPosition.x=Y.position[0],U.cameraPosition.y=Y.position[1],U.cameraPosition.z=Y.position[2],U.cameraTarget.x=Y.target[0],U.cameraTarget.y=Y.target[1],U.cameraTarget.z=Y.target[2]}};if(r.frame=Ln,ut.current=r.rendererSession,!r.initialized){S||(r.cleanups.push(Ts({camera:b.camera,drawCamera:()=>r.session?.camera()??b.camera,orbit:b.orbitControls,scene:r.scene},()=>null,(m,w)=>b.setHelper(m,w),{documentId:n})),Ke(()=>import("./stage-presence-markers-5xyQjkaM.js"),__vite__mapDeps([69,4,5,7,8,9,10,6,11,12,13,26,27,18,2,70])).then(m=>{if(r.isClosed||G.current!==r||r.presence)return;const w=m.bindStagePresenceMarkers({scene:r.scene,store:T,documentId:n,container:N,canvas:re,viewport:b,readVisibleCameraPose:()=>{const R=r.session?.camera()??b.renderCamera,Z=R.getWorldPosition(new D),ge=R.fov;return{position:Z,target:b.orbitControls.target,fov:typeof ge=="number"?ge:0}}});r.presence=w,r.cleanups.push(()=>w.dispose())}),r.cleanups.push(fo(q,Fs(n))),r.cleanups.push(wi({id:n,label:s,kind:zr?"asset":"source",profiler:q.profiler}))),!S&&!_r&&r.cleanups.push(bi(n,()=>({adapter:r.adapter,nodeId:r.adapter?.selection?.get()[0]??null})));const u=S?`${n}#chromeless-${++aa}`:n;r.cleanups.push(yi({id:u,label:s,contentClock:()=>r.contentSeconds,transportAdvances:()=>r.transportAdvances})),r.cleanups.push(T.shell.onViewportAction(m=>{switch(m.type){case"focus-selection":case"focus-scene":!r.session?.frame()&&r.session?.root&&b.focusOn(r.session.root);break;case"focus-entity":{const w=r.adapter?Ve(r.adapter.hierarchy,m.id):null;w&&b.focusOn(w);break}case"snap-selection-to-floor":b.snapSelectionToFloor();break;case"set-view-preset":r.session?r.session.setViewPreset(m.preset==="perspective"?"isometric":m.preset,"view"):b.setViewPreset(m.preset);break;case"toggle-camera-view":r.session?.toggleCameraView();break;case"frame-all":!r.session?.frame(1,"all")&&r.session?.root?b.focusOn(r.session.root):r.session||b.focusOnScene();break;case"zoom-view":r.session?.cameraView()&&!r.session.cameraViewLocked()?r.session.zoomCameraView(m.direction>0?1.2:1/1.2):b.zoomStep(m.direction);break;case"step-view":if(r.session?.cameraView()&&!r.session.cameraViewLocked())break;b.stepView(m.step);break;case"toggle-projection":{const w=r.session;if(w?.cameraView())break;const Z=(w?w.projection():b.projection)==="perspective"?"orthographic":"perspective";w?w.setProjection(Z):b.setProjection(Z);break}case"set-camera-pose":b.setPose(m.position,m.target,m.fov);break}}));let g="";r.cleanups.push(T.shell.subscribe(()=>{b.objectMap=T.objectMap,b.syncFromStore(),r.session?.syncSelectionPresentation();const m=(r.adapter?.selection?.get()??[]).join("\0");m!==g&&(g=m,S||vs(n))}));const k=()=>{const m=Math.max(1,N.clientWidth),w=Math.max(1,N.clientHeight),R=j.getPixelRatio();(re.width!==Math.floor(m*R)||re.height!==Math.floor(w*R))&&j.setSize(m,w,!1),b.resize(m,w),r.session?.resize(m,w),r.rendererSession.redraw()},h=new ResizeObserver(k);h.observe(N),r.cleanups.push(()=>h.disconnect()),k(),r.initialized=!0,ws()}b.objectMap=T.objectMap,b.syncFromStore(),r.rendererSession.setActive(lt.current),r.rendererSession.redraw(),Nr=!0,Re?.dispose()}catch(ee){if(!Nr)try{Ir?.()}finally{wt&&O.root.parent===A&&wt.add(O.root),rr.dispose()}console.error(`[object3d document] ${s}: source update failed`,ee),ne(ee instanceof Error?ee.message:String(ee))}},mn=Pr.current.then(fn);return Pr.current=mn.catch(Se=>{M||ne(Se instanceof Error?Se.message:String(Se))}),()=>{M=!0}},[l,i,t,qt,Ut,Kt,s,n,ue,Dr,Fr,Yt,Hr,Je,Zt,S,mt,Qe,Xt,p,c,o,W,I,Fe,E,e,Le]),f.useEffect(()=>{const M=ut.current,de=v&&!Rr.current;Rr.current=v,M&&(de&&(Ze.current=!1,ri(n)),M.setActive(v||Le))},[v,n,Le]);const gt=G.current,Qt=$t==="ready"&&gt?.viewport?{store:gt.store,viewport:gt.viewport,canvas:gt.surface.canvas}:null,pn=f.useCallback(()=>{const M=ft.current;return M?{adapter:M,nodeId:M.selection?.get()[0]??M.hierarchy.roots()[0]?.id??null}:null},[]),Br=d.jsx("div",{"data-testid":"tool-object3d-authoring","data-volter-chromeless":S||void 0,className:ue?"volter-object3d-studio-stage":void 0,style:{position:S||he?"relative":"absolute",...S?{width:"100%",height:"100%"}:he?{flex:1,minHeight:0}:{inset:-pr},overflow:"hidden",background:ue?void 0:Ue.surface.raised,pointerEvents:"auto"},children:d.jsxs("div",{ref:Dt,style:{position:"absolute",inset:0,minHeight:0,overflow:"hidden"},children:[d.jsx(ca,{canvasHostRef:Ht}),v&&Qt&&!S?d.jsx(f.Suspense,{fallback:null,children:d.jsx(ra,{stage:Qt})}):null,ae&&!S?d.jsx(qo,{store:ae,documentId:n,stage:Qt,active:v,chrome:"document"}):null,ae&&Tr?d.jsx(Tr.Overlays,{store:ae,documentId:n,cameraPreviewRef:Vr,mountStatus:an,rootIds:ln}):null,Nt&&d.jsx("div",{role:"alert",style:{position:"absolute",insetInline:0,top:0,display:"flex",justifyContent:"center",padding:"var(--volter-space-3)",pointerEvents:"none"},children:d.jsxs("div",{className:"volter-chrome-island",style:{display:"flex",alignItems:"center",gap:"var(--volter-space-3)",maxWidth:"80%",padding:"var(--volter-space-2) var(--volter-space-3)",borderRadius:"var(--volter-radius-md)",border:`var(--volter-stroke-resting) solid ${Ue.semantic.danger}`,background:Ue.surface.raised,color:Ue.semantic.danger,pointerEvents:"auto"},children:[d.jsx("span",{children:Nt}),d.jsx(Te,{size:"compact","aria-label":"Dismiss",onClick:()=>ne(null),"data-testid":"object3d-document-error-dismiss",children:d.jsx(we,{icon:ve.action.close})})]})}),!Nt&&$t==="building"&&d.jsx(wo,{testId:"object3d-document-status",children:bo}),d.jsx("div",{style:{position:"absolute",inset:S||he?0:pr,pointerEvents:"none"},children:!S&&$t==="ready"&&G.current&&d.jsx(ea,{viewport:G.current.viewport,documentId:n,session:G.current.session,store:G.current.store.shell,projection:Ar,displayName:s,...F?{statistics:F}:{},...be!==void 0?{subject:be}:{},...Ee?{gridScale:Ee}:{},objectName:M=>(de=>de?Ve(de.hierarchy,M)?.name:void 0)(G.current?.adapter)??G.current?.store.objectMap.get(M)?.name??null})})]})});return he?d.jsx(si,{documentId:n,active:v,type:H??(mt?"entity":"model"),title:s,status:e,selection:pn,fill:!0,children:d.jsxs("div",{className:"volter-object3d-asset-workspace",children:[Br,d.jsx(vo,{transport:G.current?.transport??null})]})}):Br}function ua(n){return d.jsx(nn,{...n})}const za=Object.freeze(Object.defineProperty({__proto__:null,Object3DDocumentViewport:nn,ToolObject3DAuthoring:ua},Symbol.toStringTag,{value:"Module"}));export{nn as O,za as S,Ko as V,Ds as s,Wo as t};
@@ -1 +0,0 @@
1
- import{T as i,r as m}from"./index-CXHgcixX.js";import{e as p}from"./game-network-BI9UA1te.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-BZceulci.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-BEwTz1TC.js";import"./contract-system-adapters-BFftL7th.js";import"./game-contract-seams-BSaovR7J.js";import"./seeded-random-BCcI3cdi.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-B9ZVwEHj.js";import"./capability-coverage-CXl6Odkw.js";import"./edit-mode-authoring-Bwbko9HU.js";import"./json-history-resource-CIzD7_uf.js";import"./binding-resolver-5udpegkM.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-BymYlP3S.js";import"./canvas-entry-runtime-DwrywTc9.js";import"./three-ingest-runtime-Ds2jGVty.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CR8Om_4L.js";import"./ingest-source-persistence-DvuQc3sT.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-Cf9klnI_.js";import"./mounted-authoring-BsgktNOd.js";import"./entity-object-Dd555Jkc.js";import"./user-data-BZvgpwTm.js";import"./workspace-arrangement-BmOIOEhR.js";import"./three-contract-Dkt6PmWY.js";import"./three-DRLL_AH_.js";import"./editor-layers-CtzgRn6E.js";import"./component-instance-root-BuWShEF6.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-Bi-8Y2uL.js";import"./source-persistence-backend-BNmh-8qW.js";import"./three-projection-core-DYNkd_UM.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BDuldzGh.js";import"./deferred-ingest-play-CSLZoAGE.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BBXbYv0n.js";import"./board-guides-B8EV-uXc.js";import"./relative-import-specifier-CnN2yw6s.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DvD15kGQ.js";import"./inference-diagnostics-C7uqhs36.js";import"./writer-tw6EcuVO.js";import"./three-state-tSumB-N7.js";import"./editor-shell-store-CdiZaE3q.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-BOXLjEUk.js";import"./game-surface-defaults-D8S4cRxi.js";const Ut="workspace.service";function e(o){p().catch(t=>{m().console.error(`${o}: ${t instanceof Error?t.message:String(t)}`,"play")})}function bt(){let o,t=!1;const r=i(()=>{t||new URLSearchParams(window.location.search).get("play")==="1"&&(t=!0,o=window.setTimeout(()=>e("Could not enter requested Play mode"),0))});return()=>{o!==void 0&&window.clearTimeout(o),r()}}export{Ut as point,bt as start};
@@ -1 +0,0 @@
1
- import{ah as m}from"./index-CXHgcixX.js";import{b as p,a as e,c as n,s}from"./game-network-BI9UA1te.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-BZceulci.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-BEwTz1TC.js";import"./contract-system-adapters-BFftL7th.js";import"./game-contract-seams-BSaovR7J.js";import"./seeded-random-BCcI3cdi.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-B9ZVwEHj.js";import"./capability-coverage-CXl6Odkw.js";import"./edit-mode-authoring-Bwbko9HU.js";import"./json-history-resource-CIzD7_uf.js";import"./binding-resolver-5udpegkM.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-BymYlP3S.js";import"./canvas-entry-runtime-DwrywTc9.js";import"./three-ingest-runtime-Ds2jGVty.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CR8Om_4L.js";import"./ingest-source-persistence-DvuQc3sT.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-Cf9klnI_.js";import"./mounted-authoring-BsgktNOd.js";import"./entity-object-Dd555Jkc.js";import"./user-data-BZvgpwTm.js";import"./workspace-arrangement-BmOIOEhR.js";import"./three-contract-Dkt6PmWY.js";import"./three-DRLL_AH_.js";import"./editor-layers-CtzgRn6E.js";import"./component-instance-root-BuWShEF6.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-Bi-8Y2uL.js";import"./source-persistence-backend-BNmh-8qW.js";import"./three-projection-core-DYNkd_UM.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BDuldzGh.js";import"./deferred-ingest-play-CSLZoAGE.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BBXbYv0n.js";import"./board-guides-B8EV-uXc.js";import"./relative-import-specifier-CnN2yw6s.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DvD15kGQ.js";import"./inference-diagnostics-C7uqhs36.js";import"./writer-tw6EcuVO.js";import"./three-state-tSumB-N7.js";import"./editor-shell-store-CdiZaE3q.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-BOXLjEUk.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.command",a=()=>({ok:!1,error:"not in play mode — start play before using the debug seam"}),Bt={"set-instance-count":{derivedRefresh:"always",handle:o=>{if(!e())return a();const r=o.names;if(Array.isArray(r)&&r.every(i=>typeof i=="string"))return r.length<1?{ok:!1,error:'set-instance-count "names" must have at least one entry.'}:(n(r),{ok:!0});const t=o.count;return typeof t!="number"||!Number.isFinite(t)||t<1?{ok:!1,error:`set-instance-count requires a whole "count" >= 1 (or a "names" array), got ${String(t)}.`}:(s(Math.floor(t)-1),{ok:!0})}},"list-instances":{derivedRefresh:"if-content-changed",handle:()=>({ok:!0,data:{instances:m(),named:p()}})}};export{Bt as commands,zt as point};
@@ -1 +0,0 @@
1
- import{i as t}from"./game-network-BI9UA1te.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CXHgcixX.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./native-debug-module-BZceulci.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-BEwTz1TC.js";import"./contract-system-adapters-BFftL7th.js";import"./game-contract-seams-BSaovR7J.js";import"./seeded-random-BCcI3cdi.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-B9ZVwEHj.js";import"./capability-coverage-CXl6Odkw.js";import"./edit-mode-authoring-Bwbko9HU.js";import"./json-history-resource-CIzD7_uf.js";import"./binding-resolver-5udpegkM.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-BymYlP3S.js";import"./canvas-entry-runtime-DwrywTc9.js";import"./three-ingest-runtime-Ds2jGVty.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CR8Om_4L.js";import"./ingest-source-persistence-DvuQc3sT.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-Cf9klnI_.js";import"./mounted-authoring-BsgktNOd.js";import"./entity-object-Dd555Jkc.js";import"./user-data-BZvgpwTm.js";import"./workspace-arrangement-BmOIOEhR.js";import"./three-contract-Dkt6PmWY.js";import"./three-DRLL_AH_.js";import"./editor-layers-CtzgRn6E.js";import"./component-instance-root-BuWShEF6.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-Bi-8Y2uL.js";import"./source-persistence-backend-BNmh-8qW.js";import"./three-projection-core-DYNkd_UM.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-BDuldzGh.js";import"./deferred-ingest-play-CSLZoAGE.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BBXbYv0n.js";import"./board-guides-B8EV-uXc.js";import"./relative-import-specifier-CnN2yw6s.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DvD15kGQ.js";import"./inference-diagnostics-C7uqhs36.js";import"./writer-tw6EcuVO.js";import"./three-state-tSumB-N7.js";import"./editor-shell-store-CdiZaE3q.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-BOXLjEUk.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.service";function At(){t()}export{zt as point,At as start};