@volter/game-editor 0.5.96 → 0.5.98

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 +2144 -2144
  5. package/dist/assets/{AssetBudgetPanel-Cg3ZgY6c.js → AssetBudgetPanel-CYUJjJ94.js} +3 -3
  6. package/dist/assets/{AudioViewer-DktyBjEF.js → AudioViewer-D3cfg4ml.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-6LfuyZ9M.js → CanvasBoardDocument-D8sK_xyG.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-Cgblv27V.js → CanvasSceneViewport-CEXxZv3P.js} +1 -1
  9. package/dist/assets/{ColorInput-C9pM9Ack.js → ColorInput-CZnenbqt.js} +1 -1
  10. package/dist/assets/{ColorPicker-DZp2DDNf.js → ColorPicker-Bc9BzljY.js} +1 -1
  11. package/dist/assets/{EntityModelDocument-CTwEjo1V.js → EntityModelDocument-DckIPX3c.js} +1 -1
  12. package/dist/assets/{EnvironmentAssetDocument-nqRRG-Zh.js → EnvironmentAssetDocument-CDPBYiSJ.js} +1 -1
  13. package/dist/assets/{GameplaySessionTimeline-_0PHvjl0.js → GameplaySessionTimeline-CuVrbEQL.js} +1 -1
  14. package/dist/assets/{ImageViewer-ECmZrqvX.js → ImageViewer-DfXYDb1X.js} +1 -1
  15. package/dist/assets/InspectorObjectPreview-DL4-l2Ag.js +1 -0
  16. package/dist/assets/{JsonAssetDocument-CImgOAjn.js → JsonAssetDocument-BEKGk2nb.js} +1 -1
  17. package/dist/assets/{LiveModuleDocument-9Q9SgYes.js → LiveModuleDocument-CpmVed1N.js} +1 -1
  18. package/dist/assets/{LutAssetDocument-HgjH-EY6.js → LutAssetDocument-BIapcD5V.js} +1 -1
  19. package/dist/assets/{ModelAssetDocument-DHZ2aORc.js → ModelAssetDocument-UwH6Ng58.js} +1 -1
  20. package/dist/assets/{NonThreeAuthoringBootstrap-BO2-Q6YJ.js → NonThreeAuthoringBootstrap-CTkF_Fjw.js} +1 -1
  21. package/dist/assets/{Object3DDocumentToolbar-xd9aaIBH.js → Object3DDocumentToolbar-C0bsqmKv.js} +1 -1
  22. package/dist/assets/Object3DDocumentViewport-C1joQKk8.js +2 -0
  23. package/dist/assets/{Object3DPreview-D0x1eQke.js → Object3DPreview-rEJMq5PW.js} +1 -1
  24. package/dist/assets/{OnlineAssetDetail-BWt7vSPW.js → OnlineAssetDetail-BOPfM7Y2.js} +1 -1
  25. package/dist/assets/{PlayBar-0E5F4BgY.js → PlayBar-MxWuZDbI.js} +1 -1
  26. package/dist/assets/{QuarksAssetDocument-BCRDy-6Y.js → QuarksAssetDocument-wB8wcf2f.js} +1 -1
  27. package/dist/assets/{ReactCanvasControls-B6jRxIe_.js → ReactCanvasControls-DeKZZILw.js} +1 -1
  28. package/dist/assets/{RootSelectionOverlay-5La9--nb.js → RootSelectionOverlay-DYanTBYE.js} +1 -1
  29. package/dist/assets/{ShaderAssetDocument-BHm5q-hT.js → ShaderAssetDocument-CyDKdN5b.js} +1 -1
  30. package/dist/assets/{ShadowEditor-BzmiAFrO.js → ShadowEditor-DbTzN2mf.js} +1 -1
  31. package/dist/assets/{SourceAssetViewer-B09TUqjG.js → SourceAssetViewer-BymSraDS.js} +1 -1
  32. package/dist/assets/{StageHost-qw48oLl3.js → StageHost-DeO574tC.js} +2 -2
  33. package/dist/assets/{StoryPreviewMount-CIYRIX82.js → StoryPreviewMount-DvSkOR4Z.js} +1 -1
  34. package/dist/assets/{ThreeBoardDocument-DpCrNLzA.js → ThreeBoardDocument-CHB3u0xE.js} +2 -2
  35. package/dist/assets/{ThreeIsolationSceneContent-BtC0lT-1.js → ThreeIsolationSceneContent-BY8vG3kV.js} +1 -1
  36. package/dist/assets/{ToolObject3DPreview-CgUThBOG.js → ToolObject3DPreview-CtfgzNns.js} +1 -1
  37. package/dist/assets/{Toolbar-RWmWORSC.js → Toolbar-BfhP5BUg.js} +1 -1
  38. package/dist/assets/{TransientHint-BX8vPTJO.js → TransientHint-Byhdm3Od.js} +1 -1
  39. package/dist/assets/{VideoViewer-B6XQUMXi.js → VideoViewer-DW1zETUK.js} +1 -1
  40. package/dist/assets/{ViewportShadingMenu-sWqCMh3f.js → ViewportShadingMenu-BL9v8N9j.js} +1 -1
  41. package/dist/assets/{active-ingest-CITIHbLE.js → active-ingest-_WDvM24r.js} +2 -2
  42. package/dist/assets/{animation-clock-ZGMb7-HX.js → animation-clock-Gep7Un-B.js} +1 -1
  43. package/dist/assets/{animation-mixers.service-C8z7JOIy.js → animation-mixers.service-DGJIQnos.js} +1 -1
  44. package/dist/assets/{animation-timeline.utility-CESa9Kgp.js → animation-timeline.utility-CVbfCvgY.js} +1 -1
  45. package/dist/assets/{asset-budget-asset.menu-Bax8IXfi.js → asset-budget-asset.menu-gyAKeUNd.js} +1 -1
  46. package/dist/assets/{asset-budget.action-DB0a3C6H.js → asset-budget.action-BghNaV-4.js} +1 -1
  47. package/dist/assets/{asset-budget.document-CLkxGAK0.js → asset-budget.document-B7wUAdpI.js} +1 -1
  48. package/dist/assets/{asset-budget.menu-BGa44oiO.js → asset-budget.menu-OkiblnyF.js} +1 -1
  49. package/dist/assets/{asset-editor-persistence-TN3cepVq.js → asset-editor-persistence-B4oTV3TQ.js} +1 -1
  50. package/dist/assets/{asset-loaders-BIcSq7_V.js → asset-loaders-C_-GHTQo.js} +1 -1
  51. package/dist/assets/{asset-preview-Dl1bPkcG.js → asset-preview-Di8vxUY8.js} +1 -1
  52. package/dist/assets/{audio-unlock.service-goE6TE-5.js → audio-unlock.service-BtqFiL1X.js} +1 -1
  53. package/dist/assets/{audio.utility-By58Wr5x.js → audio.utility-viua3_CA.js} +1 -1
  54. package/dist/assets/autoplay.service-C6DfzGKJ.js +1 -0
  55. package/dist/assets/{babylon-authoring-adapter-elixM5zg.js → babylon-authoring-adapter-CxbL-7dI.js} +1 -1
  56. package/dist/assets/{binding-resolver-B2E0gMnP.js → binding-resolver-B1NT5eZp.js} +2 -2
  57. package/dist/assets/{blender-emscripten-engine-CbHHZuUu.js → blender-emscripten-engine-BUt1MIRn.js} +1 -1
  58. package/dist/assets/{blender-node-editor.document-Dj1QtUeq.js → blender-node-editor.document-C2QdPHaS.js} +1 -1
  59. package/dist/assets/{blender-properties-tab-DWvixv5O.js → blender-properties-tab-BatuUyQ6.js} +1 -1
  60. package/dist/assets/{blender-runtime-host-BzE_zWLm.js → blender-runtime-host-BUl0kiMb.js} +1 -1
  61. package/dist/assets/{blender-runtime-skin-BbDYZ2Le.js → blender-runtime-skin-CCKkESgo.js} +9 -9
  62. package/dist/assets/{blender-runtime.document-DOfv3Agv.js → blender-runtime.document-CqDEiey6.js} +8 -8
  63. package/dist/assets/{blender-screenshot.menu-CD0KRdkk.js → blender-screenshot.menu-D6z3j9Z0.js} +1 -1
  64. package/dist/assets/{blender-timeline.document-DOD0_s2a.js → blender-timeline.document-BfvX9HD8.js} +1 -1
  65. package/dist/assets/{blender-uv-editor.document-Dq9T9o6A.js → blender-uv-editor.document-9zFVMreH.js} +1 -1
  66. package/dist/assets/{blender-version.status-JSBtE67I.js → blender-version.status-B31FeHyZ.js} +1 -1
  67. package/dist/assets/{blender-wali-engine-uH9q2l3f.js → blender-wali-engine--CAT1JcK.js} +1 -1
  68. package/dist/assets/{blender.command-CgfYdBkh.js → blender.command-q5Ss5U4v.js} +1 -1
  69. package/dist/assets/{board-guides-Dz0A1_-b.js → board-guides-DLC77TC2.js} +1 -1
  70. package/dist/assets/{bridge.command-D50Rnkri.js → bridge.command-Ca9_9Usm.js} +3 -3
  71. package/dist/assets/{browserAll-CffBwOYH.js → browserAll-V5qUB869.js} +1 -1
  72. package/dist/assets/{build-player.document-CzmRQ73r.js → build-player.document-Dihw3ECY.js} +1 -1
  73. package/dist/assets/{build-profiles.document-C18JTqQw.js → build-profiles.document-BX9nb42H.js} +1 -1
  74. package/dist/assets/{build-progress.status-C8JifSS5.js → build-progress.status-D-0oRNyH.js} +1 -1
  75. package/dist/assets/{build-session-C3VOyFVt.js → build-session-Dvt7pd00.js} +1 -1
  76. package/dist/assets/{build.action-BhmTxJsU.js → build.action-C0ockeu9.js} +1 -1
  77. package/dist/assets/{build.command-Bs7czHYD.js → build.command-CSW_MD00.js} +1 -1
  78. package/dist/assets/{build.header-BmGeyN2T.js → build.header-BczTqYb_.js} +1 -1
  79. package/dist/assets/{build.menu-0Y2a0Uz5.js → build.menu-DBAU85mK.js} +1 -1
  80. package/dist/assets/{build.service-iPOzEje7.js → build.service-BjwUe_ye.js} +1 -1
  81. package/dist/assets/{camera-0ir8KbAU.js → camera-BThd0DYj.js} +1 -1
  82. package/dist/assets/{camera-runtime.inspector-Dkl_2EgP.js → camera-runtime.inspector-c51thcIe.js} +1 -1
  83. package/dist/assets/{canvas-design-mount-DA6hRasU.js → canvas-design-mount-Dg1jk7P9.js} +3 -3
  84. package/dist/assets/{canvas-entry-runtime-61G6MXeu.js → canvas-entry-runtime-D4UUWHHS.js} +2 -2
  85. package/dist/assets/{canvas-preview-frames-VdxToN-E.js → canvas-preview-frames-8g_T28jt.js} +1 -1
  86. package/dist/assets/{canvas-story-capture.service-D6iCLQD1.js → canvas-story-capture.service-BD2ZDfgb.js} +2 -2
  87. package/dist/assets/{capability-coverage-4anHr2zy.js → capability-coverage-D1AjR_LI.js} +1 -1
  88. package/dist/assets/{collaboration-presence-Bt4vcOOx.js → collaboration-presence-B1-ixzD4.js} +1 -1
  89. package/dist/assets/{collider-DRyNTB24.js → collider-D_MStfz8.js} +1 -1
  90. package/dist/assets/{component-board.service-Ds4uyTuF.js → component-board.service-BCJDbWJO.js} +2 -2
  91. package/dist/assets/{component-board.service-CbpEY5gZ.js → component-board.service-CNfcy4re.js} +2 -2
  92. package/dist/assets/{component-board.service-8jvudtjT.js → component-board.service-kpvKo8AX.js} +2 -2
  93. package/dist/assets/{component-contracts.service-CXv8vcaz.js → component-contracts.service-DOq7Uz8X.js} +1 -1
  94. package/dist/assets/{component-instance-root-CYKiTDK5.js → component-instance-root-BVjTH0AO.js} +1 -1
  95. package/dist/assets/{component-verbs.command-ziX5CIRx.js → component-verbs.command-BJ7vPc7n.js} +1 -1
  96. package/dist/assets/{component-verbs.service-4d2cu2Jc.js → component-verbs.service-A7JUNMTN.js} +1 -1
  97. package/dist/assets/{config-BqdL2Gqg.js → config-DXbdl8V5.js} +2 -2
  98. package/dist/assets/{configurations-C023DrJ_.js → configurations-CUnfG7ZO.js} +1 -1
  99. package/dist/assets/{connection.status-1AAvWdrK.js → connection.status-B-cxZwYA.js} +1 -1
  100. package/dist/assets/{constraints.inspector-C2HXln56.js → constraints.inspector-Crmp8_cu.js} +1 -1
  101. package/dist/assets/{content-bounds-BRefqVK8.js → content-bounds-DzkikRBl.js} +1 -1
  102. package/dist/assets/{contract-system-adapters-23-Ibs-k.js → contract-system-adapters-BTeuY0Wz.js} +1 -1
  103. package/dist/assets/{coverage.service-Dleh7C_n.js → coverage.service-B8ThvM6U.js} +1 -1
  104. package/dist/assets/{create-runtime-DFQGV0c4.js → create-runtime-DTWZzn1t.js} +1 -1
  105. package/dist/assets/{curve-CYn4Ls1p.js → curve-CpzFB8qh.js} +1 -1
  106. package/dist/assets/{data-asset-qDK0zLE4.js → data-asset-CIxV9JTk.js} +1 -1
  107. package/dist/assets/{data-ref-CM5NbFD-.js → data-ref-DrNnlhsi.js} +1 -1
  108. package/dist/assets/{debug-bridge-CcMIQkia.js → debug-bridge-B43FSMW-.js} +1 -1
  109. package/dist/assets/{debug-registry-CE39Isrd.js → debug-registry-DZXSvvn0.js} +1 -1
  110. package/dist/assets/{deferred-ingest-play-DBja8BUs.js → deferred-ingest-play-DtbBSsch.js} +2 -2
  111. package/dist/assets/{design-time-canvas-mount-DVJXvruF.js → design-time-canvas-mount-BNJucWC9.js} +2 -2
  112. package/dist/assets/{design-time-layers-CHkfJxfx.js → design-time-layers-DSk4tElq.js} +1 -1
  113. package/dist/assets/{design-time-mount.service-BhgQ3Si2.js → design-time-mount.service-B1uT1tYo.js} +2 -2
  114. package/dist/assets/{design-time-mount.service-mSVpLrcR.js → design-time-mount.service-mqzVtqAw.js} +2 -2
  115. package/dist/assets/{design-time-react-mount-BFELiNWh.js → design-time-react-mount-BfdKL8vZ.js} +1 -1
  116. package/dist/assets/{document-preview-three-BXmcj_8V.js → document-preview-three-BZmgWaSO.js} +1 -1
  117. package/dist/assets/{dom-authoring-adapter-2BWFmwKb.js → dom-authoring-adapter-DoX9DoiD.js} +1 -1
  118. package/dist/assets/{draco3d-BuKo-tLn.js → draco3d-DucG06PU.js} +1 -1
  119. package/dist/assets/{edit-mode-audio.service-CmTZuGlR.js → edit-mode-audio.service-DdZc2jfs.js} +1 -1
  120. package/dist/assets/{edit-mode-authoring-DTqQCASO.js → edit-mode-authoring-Ch6v9PnO.js} +1 -1
  121. package/dist/assets/{edit-mode-networking.service-BYRPl0NW.js → edit-mode-networking.service-BpnwwS06.js} +1 -1
  122. package/dist/assets/{editor-api-BSo_LbeA.js → editor-api-DUY4XF3E.js} +1 -1
  123. package/dist/assets/{editor-layers-BysX9O4Z.js → editor-layers-DJwy9H_k.js} +1 -1
  124. package/dist/assets/{editor-shell-store-BypZykYh.js → editor-shell-store-B87W2cjm.js} +1 -1
  125. package/dist/assets/{entity-object-DxbTsF4x.js → entity-object-BpsV3ox5.js} +1 -1
  126. package/dist/assets/{extend-hYAsKlZ9.js → extend-CC4illCZ.js} +1 -1
  127. package/dist/assets/{fork-menu-BcCUn_dU.js → fork-menu-DMGtk-df.js} +1 -1
  128. package/dist/assets/{frame-debugger-store-CZa9acGZ.js → frame-debugger-store-DJdnRJUk.js} +1 -1
  129. package/dist/assets/{game-contract-seams-JpSu__9J.js → game-contract-seams-leXTqnUS.js} +1 -1
  130. package/dist/assets/{game-css-scope-transform-CYZYslnW.js → game-css-scope-transform-B2GgkZOW.js} +1 -1
  131. package/dist/assets/{game-document.service-W-VHzRVV.js → game-document.service-DU8RzyUd.js} +1 -1
  132. package/dist/assets/{game-eval.command-CKfIp80c.js → game-eval.command-CXeVgR1j.js} +1 -1
  133. package/dist/assets/{game-module-access-3qKP7cZ7.js → game-module-access-BdrsVQdv.js} +1 -1
  134. package/dist/assets/{game-network-COhEosfx.js → game-network-CBHt-_DV.js} +3 -3
  135. package/dist/assets/{gameplay-export-BFLDThEI.js → gameplay-export-CBGX3vzm.js} +1 -1
  136. package/dist/assets/{gameplay-replay-CMx0MQMj.js → gameplay-replay-pGsdN2b-.js} +1 -1
  137. package/dist/assets/{gameplay.command-Cf26fPaj.js → gameplay.command-CU-k64Ab.js} +1 -1
  138. package/dist/assets/{generation-jobs-DlJB5NvR.js → generation-jobs-CTnSvyBa.js} +1 -1
  139. package/dist/assets/{generation.service-dFaPb74k.js → generation.service-BZwHj9AP.js} +1 -1
  140. package/dist/assets/{generations-BEltXqkS.js → generations-D2YCnWwG.js} +1 -1
  141. package/dist/assets/{generations.status-Bjb2LoF8.js → generations.status--hCUPMhD.js} +1 -1
  142. package/dist/assets/{hierarchy-marks-CXAL7mT0.js → hierarchy-marks-D1HxcOXp.js} +1 -1
  143. package/dist/assets/{hosted-asset-materialization-CoH0EK18.js → hosted-asset-materialization-Djmv6uo-.js} +1 -1
  144. package/dist/assets/{index-CqREkEUK.js → index-BMchyFVg.js} +1 -1
  145. package/dist/assets/{index-BJUzb-B4.js → index-C5cL2IUJ.js} +7 -7
  146. package/dist/assets/{index-Sxw1QE9s.js → index-CS5UDFWT.js} +1 -1
  147. package/dist/assets/{index-B988pIAV.js → index-D4HAbSY1.js} +2 -2
  148. package/dist/assets/{index-D8uz0oQq.js → index-DVJePnKE.js} +1 -1
  149. package/dist/assets/{index-BRrf7fUc.js → index-DXBXE0hk.js} +1 -1
  150. package/dist/assets/{index-OvIsueBq.js → index-Dp7eO4yU.js} +1 -1
  151. package/dist/assets/{index-he3dOnyZ.js → index-W7hnJutR.js} +1 -1
  152. package/dist/assets/{index-BBni9rZB.js → index-r5GMjI4u.js} +1 -1
  153. package/dist/assets/{inference-diagnostics-wOrQB5Rh.js → inference-diagnostics-BI3pXsTw.js} +1 -1
  154. package/dist/assets/{ingest-boot-viewport-C_xBzo4V.js → ingest-boot-viewport--RER68Hf.js} +1 -1
  155. package/dist/assets/{ingest-siblings-DAJlNLvR.js → ingest-siblings-D-acEhl8.js} +1 -1
  156. package/dist/assets/{ingest-source-persistence-BjGuaJE_.js → ingest-source-persistence-CCGS4Nxy.js} +1 -1
  157. package/dist/assets/{ingest.service-BpLuJf-Z.js → ingest.service-BJNrvg1w.js} +1 -1
  158. package/dist/assets/{inspect-k-9pRW-H.js → inspect-Czr75mkK.js} +1 -1
  159. package/dist/assets/instances.command-CX8PxYgi.js +1 -0
  160. package/dist/assets/{json-history-resource-Cd5RhBjv.js → json-history-resource-DS16aq7M.js} +1 -1
  161. package/dist/assets/{layered-pick-BYnMPvYe.js → layered-pick-6TWdZ7gI.js} +1 -1
  162. package/dist/assets/{light-CMiH2kz2.js → light-RsKoPui1.js} +1 -1
  163. package/dist/assets/{live-project-verbs-DBxI8KM5.js → live-project-verbs-Xdg6cat1.js} +1 -1
  164. package/dist/assets/{machine.document-Ck5QmF-4.js → machine.document-DcQb_OIY.js} +1 -1
  165. package/dist/assets/{machines.finder-DVQLjNsH.js → machines.finder-Bqq1wtq5.js} +1 -1
  166. package/dist/assets/{material-DQjYSYnk.js → material-B_D7n6mb.js} +1 -1
  167. package/dist/assets/{material-factory-f4DrI6YD.js → material-factory-CuXmyLzp.js} +1 -1
  168. package/dist/assets/{mesh-CCg5xumT.js → mesh-CahLLFyU.js} +1 -1
  169. package/dist/assets/{model-asset-sections.service-DIiEPRbf.js → model-asset-sections.service-DCf6Ptug.js} +1 -1
  170. package/dist/assets/{model-inspection-BzvFVcfv.js → model-inspection-BSCcC5V2.js} +1 -1
  171. package/dist/assets/{model-thumbnail-BmnE3c2Z.js → model-thumbnail-D73YMcQe.js} +1 -1
  172. package/dist/assets/{models.finder-D1KML7f9.js → models.finder-DRzo0vrh.js} +1 -1
  173. package/dist/assets/{module-mode-DSflDC6u.js → module-mode-BoKe-JQH.js} +2 -2
  174. package/dist/assets/{mount-canvas-ingest-root-CFvkGMH4.js → mount-canvas-ingest-root-DtbPPM9b.js} +2 -2
  175. package/dist/assets/{mount-dom-ingest-root-DbCXhKAF.js → mount-dom-ingest-root-4b8yowH1.js} +2 -2
  176. package/dist/assets/{mount-ingest-root-Bqlvurw7.js → mount-ingest-root-B6iHB5JJ.js} +2 -2
  177. package/dist/assets/{mount-manifest-DJXJdxFb.js → mount-manifest-DXoBRN_6.js} +1 -1
  178. package/dist/assets/{mount-three-ingest-root-BCxbyAjI.js → mount-three-ingest-root-B4FVx_e1.js} +1 -1
  179. package/dist/assets/{mounted-authoring-BM-WDzvM.js → mounted-authoring-D3ZR7cVq.js} +1 -1
  180. package/dist/assets/{mounted-story-viewport-source-B0UhPV1k.js → mounted-story-viewport-source-CU0H0HM-.js} +1 -1
  181. package/dist/assets/{native-debug-module-D4wQCZeU.js → native-debug-module-BcCIQlpj.js} +1 -1
  182. package/dist/assets/{navigation-w5qahiEy.js → navigation-BN6Z9E73.js} +1 -1
  183. package/dist/assets/{navmesh.menu-BTwqLTa4.js → navmesh.menu-B-fi8IMb.js} +1 -1
  184. package/dist/assets/{navmesh.service-Cx3YLDXo.js → navmesh.service-BX4QWfzb.js} +1 -1
  185. package/dist/assets/network-observer.service-B_OThTzb.js +1 -0
  186. package/dist/assets/{network.utility-DFSSa7OB.js → network.utility-CARO54yd.js} +1 -1
  187. package/dist/assets/{object3d-document-session-registry-Dl2A-iiM.js → object3d-document-session-registry-ZvPc6hyy.js} +2 -2
  188. package/dist/assets/{oid-transform-P7eOTpyE.js → oid-transform-BUbpXU6R.js} +1 -1
  189. package/dist/assets/{particles-DzN_x8Z3.js → particles-BQuXnAL_.js} +1 -1
  190. package/dist/assets/{pixi-authoring-adapter-BpCwVYFY.js → pixi-authoring-adapter-DaWrJsOF.js} +1 -1
  191. package/dist/assets/{pixi-live-write-target-CNPtXg0f.js → pixi-live-write-target-DN3QCjnE.js} +1 -1
  192. package/dist/assets/{play.command-CtJ1movR.js → play.command-DG5pGZ5K.js} +2 -2
  193. package/dist/assets/{presentation-BfBkM3yP.js → presentation-CcaWOOPX.js} +1 -1
  194. package/dist/assets/{product-CXKZL031.js → product-u_v6pdNh.js} +1 -1
  195. package/dist/assets/{profiler.action-Wi1kEKbt.js → profiler.action-BgKedBf4.js} +1 -1
  196. package/dist/assets/{profiler.menu-CweGFtuA.js → profiler.menu-_HSBT8qW.js} +1 -1
  197. package/dist/assets/{profiler.utility-BZRKj0c-.js → profiler.utility-BLxsScYH.js} +1 -1
  198. package/dist/assets/{project-authoring-session-BuLhej_Q.js → project-authoring-session-CnTuJBJD.js} +2 -2
  199. package/dist/assets/{properties-bone-constraints.inspector-Bydz93VD.js → properties-bone-constraints.inspector-BS3WyCdl.js} +1 -1
  200. package/dist/assets/{properties-bone.inspector-hhyIKPTu.js → properties-bone.inspector-ClRnj5zf.js} +1 -1
  201. package/dist/assets/{properties-collection.inspector-D4ZFpsKx.js → properties-collection.inspector-zVB_Ikpf.js} +1 -1
  202. package/dist/assets/{properties-constraints.inspector-D8EOVBWh.js → properties-constraints.inspector-BI3f2IGZ.js} +1 -1
  203. package/dist/assets/{properties-data.inspector-XAgxp3Jb.js → properties-data.inspector-CrzMpdOd.js} +1 -1
  204. package/dist/assets/{properties-material.inspector-bMqiMCaU.js → properties-material.inspector-DV0YU-Ni.js} +1 -1
  205. package/dist/assets/{properties-modifiers.inspector-fcShIdGy.js → properties-modifiers.inspector-DO2RFWS-.js} +1 -1
  206. package/dist/assets/{properties-object.inspector-B3kdkt5J.js → properties-object.inspector-DCcGMMN5.js} +1 -1
  207. package/dist/assets/{properties-output.inspector-CSgIQdu5.js → properties-output.inspector-CIsc-G2d.js} +1 -1
  208. package/dist/assets/{properties-particles.inspector-z3EVNLXS.js → properties-particles.inspector-DiPs9mU5.js} +1 -1
  209. package/dist/assets/{properties-physics.inspector-B25wyETR.js → properties-physics.inspector-OgDZCroI.js} +1 -1
  210. package/dist/assets/{properties-render.inspector-hve0fhPE.js → properties-render.inspector-ERcM3P1l.js} +1 -1
  211. package/dist/assets/{properties-scene.inspector-DeLcNeGG.js → properties-scene.inspector-e1YmvWIj.js} +1 -1
  212. package/dist/assets/{properties-texture.inspector-Do_m4yB5.js → properties-texture.inspector-1X6LXH3l.js} +1 -1
  213. package/dist/assets/{properties-view-layer.inspector-BhWIi9w4.js → properties-view-layer.inspector-DpcNCgss.js} +1 -1
  214. package/dist/assets/{properties-world.inspector-BGIhZWuV.js → properties-world.inspector-CzopHMsM.js} +1 -1
  215. package/dist/assets/{r3f-design-session-BbOTpmKn.js → r3f-design-session-CvXShgBI.js} +2 -2
  216. package/dist/assets/{r3f-physics-binding-6LLNeaJD.js → r3f-physics-binding-uhCRHed5.js} +1 -1
  217. package/dist/assets/{r3f-source-authoring-adapter-DA5XNxih.js → r3f-source-authoring-adapter-C3V3ODnr.js} +1 -1
  218. package/dist/assets/{react-canvas-navigation-SO8CyICB.js → react-canvas-navigation-Awf5f-km.js} +1 -1
  219. package/dist/assets/{react-inspector.service-Ch5GXDV-.js → react-inspector.service-DvgKi8qm.js} +1 -1
  220. package/dist/assets/{react-story-board-BOsvNV8b.js → react-story-board-D2pwwUUp.js} +1 -1
  221. package/dist/assets/{react-three-rapier.esm-BA8atn-l.js → react-three-rapier.esm-JEarqnso.js} +1 -1
  222. package/dist/assets/{react-world-authoring-adapter-CmgJykGK.js → react-world-authoring-adapter-CJSmvs_1.js} +1 -1
  223. package/dist/assets/{realm-services-DxtH74UW.js → realm-services-CqGTAk9D.js} +1 -1
  224. package/dist/assets/{reflection-probe-capture.inspector-CvssBo9p.js → reflection-probe-capture.inspector-BKXle-FB.js} +1 -1
  225. package/dist/assets/{registry-pnUk0-Uc.js → registry-rFk05JpG.js} +1 -1
  226. package/dist/assets/{relative-import-specifier-BtK486es.js → relative-import-specifier-OJ1nkBV9.js} +1 -1
  227. package/dist/assets/{render-env-dR6Cf6NY.js → render-env-DekK9VA2.js} +1 -1
  228. package/dist/assets/{render-features-XMOLNZ7A.js → render-features-CMMNCiUj.js} +1 -1
  229. package/dist/assets/{render-settings-B3gxSJOb.js → render-settings-Dy89f95W.js} +1 -1
  230. package/dist/assets/{resolve-three-CKHlx0wE.js → resolve-three-CYk0C9L7.js} +3 -3
  231. package/dist/assets/{root-seam-contract-CV9oeozb.js → root-seam-contract-ctxfAQZR.js} +1 -1
  232. package/dist/assets/{run-selection-Cjrr54DA.js → run-selection-D-MXhzyH.js} +1 -1
  233. package/dist/assets/{scene-capture-BvjHIaVm.js → scene-capture-BHFvkGDv.js} +1 -1
  234. package/dist/assets/{scene-document.service-CDhvWvsd.js → scene-document.service-ZzG8QUXr.js} +2 -2
  235. package/dist/assets/{scene-framing-CByN5sqI.js → scene-framing-Visz22um.js} +1 -1
  236. package/dist/assets/{seeded-random-W0DzZZXq.js → seeded-random-31t3Hhi7.js} +1 -1
  237. package/dist/assets/{session-kTroQqmY.js → session-DA-J0Ee6.js} +11 -6
  238. package/dist/assets/{setup-renderer-C2_VQWWo.js → setup-renderer-DAvDM3La.js} +1 -1
  239. package/dist/assets/{source-object3d-authoring-adapter-zneuhKa_.js → source-object3d-authoring-adapter-BiLtZNLQ.js} +1 -1
  240. package/dist/assets/{source-persistence-backend-DtIoAQk7.js → source-persistence-backend-Mw40F3bc.js} +1 -1
  241. package/dist/assets/{stage-keyboard-CgqVV7FV.js → stage-keyboard-BwQBp0X8.js} +1 -1
  242. package/dist/assets/{stage-overlay-set-CnRtzR3i.js → stage-overlay-set-BsUb7Fv4.js} +1 -1
  243. package/dist/assets/{stage-presence-markers-DU-yJgbo.js → stage-presence-markers-CIMlMmNr.js} +1 -1
  244. package/dist/assets/{stage-transform-tools-FKUB2XWj.js → stage-transform-tools-vwCY4rbA.js} +1 -1
  245. package/dist/assets/{standard-viewport-dressing-takf9csh.js → standard-viewport-dressing-YsNQjtKv.js} +1 -1
  246. package/dist/assets/{state-watch.action-C2GLQN0c.js → state-watch.action-DsN9G3xj.js} +1 -1
  247. package/dist/assets/{state-watch.menu-CC53vZss.js → state-watch.menu-CmF_Au9t.js} +1 -1
  248. package/dist/assets/{state-watch.utility-BlRip_AD.js → state-watch.utility-MpUll9xe.js} +1 -1
  249. package/dist/assets/{story-capture-CutvrNfq.js → story-capture-yOsfM7Wp.js} +1 -1
  250. package/dist/assets/{story-documents-DE38NSg5.js → story-documents-DyV9TmgX.js} +1 -1
  251. package/dist/assets/{story-documents.service-DnUb3MSs.js → story-documents.service-Cm_r4rSP.js} +1 -1
  252. package/dist/assets/{story-documents.service-Dv0N2DSh.js → story-documents.service-DR-8Nax9.js} +1 -1
  253. package/dist/assets/{story-media-presence-BN3dVJDv.js → story-media-presence-PjJsx64u.js} +1 -1
  254. package/dist/assets/{story-pixi-preview-afRgNNtR.js → story-pixi-preview-CBCJhgCw.js} +1 -1
  255. package/dist/assets/{story-presentation-DQuPoeTD.js → story-presentation-fpxUtjMs.js} +1 -1
  256. package/dist/assets/{story-three-preview-B9IWt0HC.js → story-three-preview-D2OfeC1l.js} +2 -2
  257. package/dist/assets/{studio-environment-D4Ww0XaR.js → studio-environment-BFOzO9xW.js} +1 -1
  258. package/dist/assets/{surface-state-C_1um-Wp.js → surface-state-DeXIPWuS.js} +1 -1
  259. package/dist/assets/{syntactic-prop-specs-D-YmW9Vh.js → syntactic-prop-specs-D3_Hyv1m.js} +1 -1
  260. package/dist/assets/{team-playtest.service-Btw-cnvE.js → team-playtest.service-QqTIBuBd.js} +1 -1
  261. package/dist/assets/{three-authoring-adapter-CHDct57X.js → three-authoring-adapter-BEDQRs2B.js} +1 -1
  262. package/dist/assets/three-authoring.service-DcLaapAT.js +2 -0
  263. package/dist/assets/{three-ingest-runtime-qW1EAcgm.js → three-ingest-runtime-C2ruwAa_.js} +1 -1
  264. package/dist/assets/{three-integration-DbHWm0eB.js → three-integration-BjghFioV.js} +2 -2
  265. package/dist/assets/three-integration.service-CDnke_Eh.js +1 -0
  266. package/dist/assets/{three-projection-core-temFVWhi.js → three-projection-core-BAO-45fo.js} +1 -1
  267. package/dist/assets/{three-state-CEr-N3dP.js → three-state-CouynZOV.js} +1 -1
  268. package/dist/assets/{three-story-capture.service-BUJzpEaW.js → three-story-capture.service-YYAt9aQX.js} +2 -2
  269. package/dist/assets/{three-story-model-BgRJitdl.js → three-story-model-DrH7Vzo5.js} +1 -1
  270. package/dist/assets/{three-viewport-presentation-DxGf9T16.js → three-viewport-presentation-cnzAiIdI.js} +1 -1
  271. package/dist/assets/{three-CNJ_R-VX.js → three-z0dIVVct.js} +1 -1
  272. package/dist/assets/{transform-mode-request-BebirGMs.js → transform-mode-request-BEHHgfb9.js} +1 -1
  273. package/dist/assets/{transport-strip-BbllNSy0.js → transport-strip-CKFa9Kx2.js} +1 -1
  274. package/dist/assets/transport.header-BLN3lUBy.js +1 -0
  275. package/dist/assets/{tuples-BeZuu0ja.js → tuples-QLLPE1Xl.js} +1 -1
  276. package/dist/assets/{ui-board-document-DVb7od9f.js → ui-board-document-mjuhM-FJ.js} +2 -2
  277. package/dist/assets/{user-data-CgbG1QjJ.js → user-data-BYUf0wLn.js} +1 -1
  278. package/dist/assets/{utility-view-state-ePusx7HX.js → utility-view-state-CGImpCGD.js} +1 -1
  279. package/dist/assets/{viewport-door-jA1iIQtm.js → viewport-door-_El1wx2N.js} +1 -1
  280. package/dist/assets/{viewport-root-presentation-CPXs2J_S.js → viewport-root-presentation-DBSTTcWY.js} +1 -1
  281. package/dist/assets/{viewport-surface-status-BftLjQdz.js → viewport-surface-status-86lP1z8H.js} +1 -1
  282. package/dist/assets/{webworkerAll-Bgbhshxv.js → webworkerAll-CBkNGoTW.js} +1 -1
  283. package/dist/assets/{worker-DLnISz0i.js → worker-BUhehstd.js} +1 -1
  284. package/dist/assets/{workspace-arrangement-B8dQHuWm.js → workspace-arrangement-Bx5PVUVK.js} +1 -1
  285. package/dist/assets/{world-documents-CpOamXhu.js → world-documents-BOMYFyua.js} +1 -1
  286. package/dist/assets/{world-root-stage-binding-D9VmuPLh.js → world-root-stage-binding-xZZlhfra.js} +1 -1
  287. package/dist/assets/{xstate-animation-binding-DCcu92mq.js → xstate-animation-binding-BPoA569V.js} +1 -1
  288. package/dist/assets/{xstate-animation-meta-ChSrE0VR.js → xstate-animation-meta-BCxFKr-g.js} +1 -1
  289. package/dist-node/cli.js +16 -16
  290. package/package.json +16 -16
  291. package/dist/assets/InspectorObjectPreview-BcWNRA19.js +0 -1
  292. package/dist/assets/Object3DDocumentViewport-CVBg106-.js +0 -2
  293. package/dist/assets/autoplay.service-D3XYc8r5.js +0 -1
  294. package/dist/assets/instances.command-BFCCEvS9.js +0 -1
  295. package/dist/assets/network-observer.service-DdQw3qES.js +0 -1
  296. package/dist/assets/three-authoring.service-B7wuDeF_.js +0 -2
  297. package/dist/assets/three-integration.service-trYxVbJk.js +0 -1
  298. package/dist/assets/transport.header-B0TApFuZ.js +0 -1
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/spark.module-Byplgb8G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js"])))=>i.map(i=>d[i]);
2
- import{kQ as Oi,kX as ht,lj as De,lk as Re,ll as je,kP as ki,lm as Di,ln as Fe,d7 as Ri,lo as Z,eX as Lt,dv as V,Z as It,lp as te,aH as ji,fC as Fi,bq as Gi,kS as Ge,kT as Be,kU as Ve,dp as We,al as Ot,lq as Bi,lr as Vi,ls as Xe,jT as Ne,bs as Wi,_ as Xi}from"./index-BJUzb-B4.js";import{a as Ni,i as st}from"./standard-viewport-dressing-takf9csh.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{E as Ye,a as qe,f as Yi}from"./clip-planes-CnAI6DZn.js";import{b as qi,a as Vt,C as Qe,e as Qi,d as Zi}from"./content-bounds-BRefqVK8.js";import{EDITOR_LAYER as P,isInEditorOwnedSubtree as J,EDITOR_SELECTION_LAYER as _e,isEditorOwnedObject as Ui}from"./editor-layers-BysX9O4Z.js";import{e as ge,r as Wt,f as Ze}from"./three-CNJ_R-VX.js";import{g as tt,s as W}from"./user-data-CgbG1QjJ.js";import{d as Ki,s as $i,a as Ji}from"./model-thumbnail-BmnE3c2Z.js";import{d as Ue,e as ts}from"./model-inspection-BzvFVcfv.js";import{OrbitControls as es}from"./OrbitControls-B13MKuwC.js";import"./three.module-BLhyNg0e.js";import{a8 as is,fo as p,dp as L,e6 as nt,cW as qt,cp as R,bX as lt,aq as O,K as I,N as mt,a$ as Mt,co as y,cZ as at,bV as Y,e$ as yt,ey as U,aV as bi,cm as ft,db as xi,aI as Qt,bh as K,eV as ss,_ as C,cj as j,aO as Si,c0 as Zt,b_ as Ci,I as xt,cP as os,c8 as ns,e as rs,ap as as,A as ls,c7 as Ee,b$ as cs,da as Ke,fd as et,el as hs,d9 as ds,d5 as $e,j as ps,aE as us,eg as fs,cg as dt,fA as ms,aF as _s,de as gs,eD as ys,bk as vs,S as ws,ex as bs,a5 as xs,ej as it,eE as Je,eF as ti,em as Ss,T as Mi,c1 as Ai}from"./three.core-3arARmh6.js";import{L as ye,a as ve,b as we}from"./LineSegments2-DN9pUfWA.js";import{B as Cs}from"./three.quarks.esm-C_HmSKXo.js";import{b as Ms,e as As}from"./live-gesture-lock-DJbrjOqf.js";import{f as Ps}from"./editor-shell-store-BypZykYh.js";import{a as Hs,e as Es}from"./entity-object-DxbTsF4x.js";import{e as Ts,v as kt,i as zs,d as Ls}from"./three-integration-DbHWm0eB.js";import{f as ei,v as Is,s as Os}from"./scene-framing-CByN5sqI.js";import{a as ks}from"./live-mixers-B-bwLZ7c.js";function be(c){const t=tt(c,"triggerVolume");if(!t||typeof t!="object")return null;const{radius:e}=t;return typeof e=="number"&&Number.isFinite(e)&&e>0?{radius:e}:null}const ot=new nt,k=new p,$=new p,T=new L,ii={X:new p(1,0,0),Y:new p(0,1,0),Z:new p(0,0,1)},ee={type:"change"},si={type:"mouseDown",mode:null},oi={type:"mouseUp",mode:null},ni={type:"objectChange"};class ie extends is{constructor(t,e=null){super(void 0,e);const i=new Bs(this);this._root=i;const s=new Vs;this._gizmo=s,i.add(s);const o=new Ws;this._plane=o,i.add(o);const n=this;function r(w,S){let z=S;Object.defineProperty(n,w,{get:function(){return z!==void 0?z:S},set:function(x){z!==x&&(z=x,o[w]=x,s[w]=x,n.dispatchEvent({type:w+"-changed",value:x}),n.dispatchEvent(ee))}}),n[w]=S,o[w]=S,s[w]=S}r("camera",t),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0),r("minX",-1/0),r("maxX",1/0),r("minY",-1/0),r("maxY",1/0),r("minZ",-1/0),r("maxZ",1/0);const l=new p,a=new p,h=new L,d=new L,f=new p,u=new L,m=new p,_=new p,g=new p,v=0,b=new p;r("worldPosition",l),r("worldPositionStart",a),r("worldQuaternion",h),r("worldQuaternionStart",d),r("cameraPosition",f),r("cameraQuaternion",u),r("pointStart",m),r("pointEnd",_),r("rotationAxis",g),r("rotationAngle",v),r("eye",b),this._offset=new p,this._startNorm=new p,this._endNorm=new p,this._cameraScale=new p,this._parentPosition=new p,this._parentQuaternion=new L,this._parentQuaternionInv=new L,this._parentScale=new p,this._worldScaleStart=new p,this._worldQuaternionInv=new L,this._worldScale=new p,this._positionStart=new p,this._quaternionStart=new L,this._scaleStart=new p,this._getPointer=Ds.bind(this),this._onPointerDown=js.bind(this),this._onPointerHover=Rs.bind(this),this._onPointerMove=Fs.bind(this),this._onPointerUp=Gs.bind(this),e!==null&&this.connect(e)}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&&ot.setFromCamera(t,this.camera);const e=se(this._gizmo.picker[this.mode],ot);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&&ot.setFromCamera(t,this.camera);const e=se(this._plane,ot,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,si.mode=this.mode,this.dispatchEvent(si)}}pointerMove(t){const e=this.axis,i=this.mode,s=this.object;let o=this.space;if(i==="scale"?o="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(o="world"),s===void 0||e===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&&ot.setFromCamera(t,this.camera);const n=se(this._plane,ot,!0);if(n){if(this.pointEnd.copy(n.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),o==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),o==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(o==="local"&&(s.position.applyQuaternion(T.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),o==="world"&&(s.parent&&s.position.add(k.setFromMatrixPosition(s.parent.matrixWorld)),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(k.setFromMatrixPosition(s.parent.matrixWorld)))),s.position.x=Math.max(this.minX,Math.min(this.maxX,s.position.x)),s.position.y=Math.max(this.minY,Math.min(this.maxY,s.position.y)),s.position.z=Math.max(this.minZ,Math.min(this.maxZ,s.position.z));else if(i==="scale"){if(e.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),$.set(r,r,r)}else k.copy(this.pointStart),$.copy(this.pointEnd),k.applyQuaternion(this._worldQuaternionInv),$.applyQuaternion(this._worldQuaternionInv),$.divide(k),e.search("X")===-1&&($.x=1),e.search("Y")===-1&&($.y=1),e.search("Z")===-1&&($.z=1);s.scale.copy(this._scaleStart).multiply($),this.scaleSnap&&(e.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(k.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(k.copy(this.rotationAxis).cross(this.eye))*r):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(ii[e]),k.copy(ii[e]),o==="local"&&k.applyQuaternion(this.worldQuaternion),k.cross(this.eye),k.length()===0?l=!0:this.rotationAngle=this._offset.dot(k.normalize())*r),(e==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),o==="local"&&e!=="E"&&e!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(T.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(T.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(ee),this.dispatchEvent(ni)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(oi.mode=this.mode,this.dispatchEvent(oi)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(t){return this.object=t,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(ee),this.dispatchEvent(ni),this.pointStart.copy(this.pointEnd))}getRaycaster(){return ot}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}setColors(t,e,i,s){const o=this._gizmo.materialLib;o.xAxis.color.set(t),o.yAxis.color.set(e),o.zAxis.color.set(i),o.active.color.set(s),o.xAxisTransparent.color.set(t),o.yAxisTransparent.color.set(e),o.zAxisTransparent.color.set(i),o.activeTransparent.color.set(s),o.xAxis._color&&o.xAxis._color.set(t),o.yAxis._color&&o.yAxis._color.set(e),o.zAxis._color&&o.zAxis._color.set(i),o.active._color&&o.active._color.set(s),o.xAxisTransparent._color&&o.xAxisTransparent._color.set(t),o.yAxisTransparent._color&&o.yAxisTransparent._color.set(e),o.zAxisTransparent._color&&o.zAxisTransparent._color.set(i),o.activeTransparent._color&&o.activeTransparent._color.set(s)}}function Ds(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const t=this.domElement.getBoundingClientRect();return{x:(c.clientX-t.left)/t.width*2-1,y:-(c.clientY-t.top)/t.height*2+1,button:c.button}}}function Rs(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function js(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function Fs(c){this.enabled&&this.pointerMove(this._getPointer(c))}function Gs(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function se(c,t,e){const i=t.intersectObject(c,!0);for(let s=0;s<i.length;s++)if(i[s].object.visible||e)return i[s];return!1}const Dt=new bi,H=new p(0,1,0),ri=new p(0,0,0),ai=new ft,Rt=new L,Xt=new L,N=new p,li=new ft,St=new p(1,0,0),rt=new p(0,1,0),Ct=new p(0,0,1),jt=new p,vt=new p,wt=new p;class Bs extends qt{constructor(t){super(),this.isTransformControlsRoot=!0,this.controls=t,this.visible=!1}updateMatrixWorld(t){const e=this.controls;e.object!==void 0&&(e.object.updateMatrixWorld(),e.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):e.object.parent.matrixWorld.decompose(e._parentPosition,e._parentQuaternion,e._parentScale),e.object.matrixWorld.decompose(e.worldPosition,e.worldQuaternion,e._worldScale),e._parentQuaternionInv.copy(e._parentQuaternion).invert(),e._worldQuaternionInv.copy(e.worldQuaternion).invert()),e.camera.updateMatrixWorld(),e.camera.matrixWorld.decompose(e.cameraPosition,e.cameraQuaternion,e._cameraScale),e.camera.isOrthographicCamera?e.camera.getWorldDirection(e.eye).negate():e.eye.copy(e.cameraPosition).sub(e.worldPosition).normalize(),super.updateMatrixWorld(t)}dispose(){this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}}class Vs extends qt{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const t=new R({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=new lt({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=t.clone();i.opacity=.15;const s=e.clone();s.opacity=.5;const o=t.clone();o.color.setHex(16711680);const n=t.clone();n.color.setHex(65280);const r=t.clone();r.color.setHex(255);const l=t.clone();l.color.setHex(16711680),l.opacity=.5;const a=t.clone();a.color.setHex(65280),a.opacity=.5;const h=t.clone();h.color.setHex(255),h.opacity=.5;const d=t.clone();d.opacity=.25;const f=t.clone();f.color.setHex(16776960),f.opacity=.25;const u=t.clone();u.color.setHex(16776960);const m=t.clone();m.color.setHex(7895160),this.materialLib={xAxis:o,yAxis:n,zAxis:r,active:u,xAxisTransparent:l,yAxisTransparent:a,zAxisTransparent:h,activeTransparent:f};const _=new O(0,.04,.1,12);_.translate(0,.05,0);const g=new I(.08,.08,.08);g.translate(0,.04,0);const v=new mt;v.setAttribute("position",new Mt([0,0,0,1,0,0],3));const b=new O(.0075,.0075,.5,3);b.translate(0,.25,0);function w(F,Ht){const B=new yt(F,.0075,3,64,Ht*Math.PI*2);return B.rotateY(Math.PI/2),B.rotateX(Math.PI/2),B}function S(){const F=new mt;return F.setAttribute("position",new Mt([0,0,0,1,1,1],3)),F}const z={X:[[new y(_,o),[.5,0,0],[0,0,-Math.PI/2]],[new y(_,o),[-.5,0,0],[0,0,Math.PI/2]],[new y(b,o),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new y(_,n),[0,.5,0]],[new y(_,n),[0,-.5,0],[Math.PI,0,0]],[new y(b,n)]],Z:[[new y(_,r),[0,0,.5],[Math.PI/2,0,0]],[new y(_,r),[0,0,-.5],[-Math.PI/2,0,0]],[new y(b,r),null,[Math.PI/2,0,0]]],XYZ:[[new y(new at(.1,0),d),[0,0,0]]],XY:[[new y(new I(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new y(new I(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.15,.15,.01),a),[.15,0,.15],[-Math.PI/2,0,0]]]},x={X:[[new y(new O(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new y(new O(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y(new O(.2,0,.6,4),i),[0,.3,0]],[new y(new O(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y(new O(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new y(new O(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new y(new at(.2,0),i)]],XY:[[new y(new I(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new y(new I(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},A={START:[[new y(new at(.01,2),s),null,null,null,"helper"]],END:[[new y(new at(.01,2),s),null,null,null,"helper"]],DELTA:[[new Y(S(),s),null,null,null,"helper"]],X:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Y(v,s),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Y(v,s),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},M={XYZE:[[new y(w(.5,1),m),null,[0,Math.PI/2,0]]],X:[[new y(w(.5,.5),o)]],Y:[[new y(w(.5,.5),n),null,[0,0,-Math.PI/2]]],Z:[[new y(w(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new y(w(.75,1),f),null,[0,Math.PI/2,0]]]},E={AXIS:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]]},G={XYZE:[[new y(new U(.25,10,8),i)]],X:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new y(new yt(.75,.1,2,24),i)]]},$t={X:[[new y(g,o),[.5,0,0],[0,0,-Math.PI/2]],[new y(b,o),[0,0,0],[0,0,-Math.PI/2]],[new y(g,o),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new y(g,n),[0,.5,0]],[new y(b,n)],[new y(g,n),[0,-.5,0],[0,0,Math.PI]]],Z:[[new y(g,r),[0,0,.5],[Math.PI/2,0,0]],[new y(b,r),[0,0,0],[Math.PI/2,0,0]],[new y(g,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new y(new I(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new y(new I(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.15,.15,.01),a),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y(new I(.1,.1,.1),d)]]},Pt={X:[[new y(new O(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new y(new O(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y(new O(.2,0,.6,4),i),[0,.3,0]],[new y(new O(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y(new O(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new y(new O(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new y(new I(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new y(new I(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y(new I(.2,.2,.2),i),[0,0,0]]]},Jt={X:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Y(v,s),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Y(v,s),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function Q(F){const Ht=new qt;for(const B in F)for(let ct=F[B].length;ct--;){const D=F[B][ct][0].clone(),Et=F[B][ct][1],Tt=F[B][ct][2],zt=F[B][ct][3],Ii=F[B][ct][4];D.name=B,D.tag=Ii,Et&&D.position.set(Et[0],Et[1],Et[2]),Tt&&D.rotation.set(Tt[0],Tt[1],Tt[2]),zt&&D.scale.set(zt[0],zt[1],zt[2]),D.updateMatrix();const ke=D.geometry.clone();ke.applyMatrix4(D.matrix),D.geometry=ke,D.renderOrder=1/0,D.position.set(0,0,0),D.rotation.set(0,0,0),D.scale.set(1,1,1),Ht.add(D)}return Ht}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=Q(z)),this.add(this.gizmo.rotate=Q(M)),this.add(this.gizmo.scale=Q($t)),this.add(this.picker.translate=Q(x)),this.add(this.picker.rotate=Q(G)),this.add(this.picker.scale=Q(Pt)),this.add(this.helper.translate=Q(A)),this.add(this.helper.rotate=Q(E)),this.add(this.helper.scale=Q(Jt)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(t){const i=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Xt;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let o=0;o<s.length;o++){const n=s[o];n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition);let r;if(this.camera.isOrthographicCamera?r=(this.camera.top-this.camera.bottom)/this.camera.zoom:r=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(r*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(T.setFromEuler(Dt.set(0,0,0)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(T.setFromEuler(Dt.set(0,0,Math.PI/2)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(T.setFromEuler(Dt.set(0,Math.PI/2,0)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(T.setFromEuler(Dt.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(ai.lookAt(ri,H,rt)),n.quaternion.multiply(T),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),k.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),k.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(k),n.visible=this.dragging):(n.quaternion.copy(i),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Rt.copy(i),H.copy(this.eye).applyQuaternion(T.copy(i).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(ai.lookAt(this.eye,ri,rt)),n.name==="X"&&(T.setFromAxisAngle(St,Math.atan2(-H.y,H.z)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T)),n.name==="Y"&&(T.setFromAxisAngle(rt,Math.atan2(H.x,H.z)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T)),n.name==="Z"&&(T.setFromAxisAngle(Ct,Math.atan2(H.y,H.x)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis?(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1):this.axis.split("").some(function(l){return n.name===l})&&(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1))}super.updateMatrixWorld(t)}}class Ws extends y{constructor(){super(new xi(1e5,1e5,2,2),new R({visible:!1,wireframe:!0,side:Qt,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),jt.copy(St).applyQuaternion(e==="local"?this.worldQuaternion:Xt),vt.copy(rt).applyQuaternion(e==="local"?this.worldQuaternion:Xt),wt.copy(Ct).applyQuaternion(e==="local"?this.worldQuaternion:Xt),H.copy(vt),this.mode){case"translate":case"scale":switch(this.axis){case"X":H.copy(this.eye).cross(jt),N.copy(jt).cross(H);break;case"Y":H.copy(this.eye).cross(vt),N.copy(vt).cross(H);break;case"Z":H.copy(this.eye).cross(wt),N.copy(wt).cross(H);break;case"XY":N.copy(wt);break;case"YZ":N.copy(jt);break;case"XZ":H.copy(wt),N.copy(vt);break;case"XYZ":case"E":N.set(0,0,0);break}break;case"rotate":default:N.set(0,0,0)}N.length()===0?this.quaternion.copy(this.cameraQuaternion):(li.lookAt(k.set(0,0,0),N,H),this.quaternion.setFromRotationMatrix(li)),super.updateMatrixWorld(t)}}const oe=new C(4441855),Ft=new C(16758858),Gt=new C(14185983),Xs=new C(16731496),ci=new C(16777215);function ne(c){return new Y(new mt,new lt({color:c,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function re(c,t){return new y(c,new R({color:t,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function ae(c,t){if(c.visible=t.length>1,!c.visible)return;let e=c.geometry.getAttribute("position");(!e||e.count!==t.length)&&(e=new Mt(t.length*3,3),c.geometry.setAttribute("position",e));for(let i=0;i<t.length;i++)e.setXYZ(i,t[i].x,t[i].y,t[i].z);e.needsUpdate=!0,c.geometry.computeBoundingSphere()}class Ns extends K{constructor(t){super(),this.source=t,this.name="Constraint Helper",this.renderOrder=999,W(this,"editorHelper",!0),W(this,"editorHelperType","constraints"),this.layers.set(P),this.refreshStructure()}selected=!1;hoveredControl=null;selectedObjects=new Set;visuals=[];setSelected(t){this.selected=t}setSelectedObjects(t){this.selectedObjects=t}controlMeshes(){return this.visuals.flatMap(t=>[t.targetHit,t.poleHit].filter(e=>e.visible))}presents(t){return t===this.source?!0:this.visuals.some(e=>{const i=e.mark.getSnapshot();return t===i.target||t===i.pole})}controlFor(t){for(const e of this.visuals){const i=e.mark.getSnapshot();if((t===e.target||t===e.targetHit)&&i.target)return{kind:"target",label:i.target.name||`${e.mark.config.label} target`,object:i.target,mesh:e.target};if((t===e.pole||t===e.poleHit)&&i.pole)return{kind:"pole",label:i.pole.name||`${e.mark.config.label} pole`,object:i.pole,mesh:e.pole}}return null}setHoveredControl(t){this.hoveredControl=t}update(t){this.refreshStructure();for(const e of this.visuals)this.updateVisual(e,t)}dispose(){this.clearVisuals(),this.removeFromParent()}refreshStructure(){const t=ge(this.source);t.length===this.visuals.length&&t.every((i,s)=>{const o=i.getSnapshot(),n=o.chain.length>0?o.chain.length:o.constrained?1:0;return this.visuals[s]?.mark===i&&this.visuals[s]?.positions.length===n})||(this.clearVisuals(),this.visuals=t.map(i=>this.makeVisual(i)))}makeVisual(t){const e=t.getSnapshot(),i=e.chain.length>0?e.chain:e.constrained?[e.constrained]:[],s=ne(oe),o=ne(Ft),n=ne(Gt),r=i.map(()=>re(new U(.035,10,7),oe)),l=re(new at(.085),Ft),a=re(new ss(.075),Gt),h=new R({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1,colorWrite:!1}),d=new y(new U(.16,10,7),h),f=new y(new U(.15,10,7),h.clone());for(const u of[s,o,n,...r,l,a,d,f])u.renderOrder=this.renderOrder,u.layers.set(P),this.add(u);return{mark:t,chain:s,targetLine:o,poleLine:n,joints:r,target:l,pole:a,targetHit:d,poleHit:f,positions:i.map(()=>new p),targetPosition:new p,polePosition:new p}}updateVisual(t,e){const i=t.mark.getSnapshot(),s=i.chain.length>0?i.chain:i.constrained?[i.constrained]:[];for(let f=0;f<s.length;f++)s[f].getWorldPosition(t.positions[f]);ae(t.chain,t.positions);for(let f=0;f<t.joints.length;f++){const u=t.joints[f],m=t.positions[f];u.visible=!!m,m&&(u.position.copy(m),u.scale.setScalar(this.handleScale(e,m)))}const o=t.positions.at(-1),n=i.target?.getWorldPosition(t.targetPosition)??null,r=i.pole?.getWorldPosition(t.polePosition)??null;ae(t.targetLine,o&&n?[o,n]:[]),ae(t.poleLine,t.positions[0]&&r?[t.positions[0],r]:[]),t.target.visible=n!==null,n&&(t.target.position.copy(n),t.target.scale.setScalar(this.handleScale(e,n)*(this.hoveredControl===t.target?1.22:1))),t.targetHit.visible=n!==null,n&&(t.targetHit.position.copy(n),t.targetHit.scale.copy(t.target.scale)),t.pole.visible=r!==null,r&&(t.pole.position.copy(r),t.pole.scale.setScalar(this.handleScale(e,r)*(this.hoveredControl===t.pole?1.22:1))),t.poleHit.visible=r!==null,r&&(t.poleHit.position.copy(r),t.poleHit.scale.copy(t.pole.scale));const l=i.status==="error"||i.status==="unresolved",a=this.selected?1:.52;for(const f of[t.chain,...t.joints]){const u=f.material;u.color.copy(l?Xs:oe),u.opacity=a}const h=this.hoveredControl===t.target||i.target!==null&&this.selectedObjects.has(i.target),d=this.hoveredControl===t.pole||i.pole!==null&&this.selectedObjects.has(i.pole);t.target.material.color.copy(h?ci:Ft),t.pole.material.color.copy(d?ci:Gt),t.targetLine.material.color.copy(Ft),t.poleLine.material.color.copy(Gt),t.targetLine.material.opacity=a,t.poleLine.material.opacity=a,t.target.material.opacity=h?1:a,t.pole.material.opacity=d?1:a}handleScale(t,e){return j.clamp(t.position.distanceTo(e)/8,.65,4)}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry.dispose();const i=Array.isArray(e.material)?e.material:[e.material];for(const s of i)s.dispose()}this.visuals=[],this.hoveredControl=null}}const Ys=new C(4892927),qs=new C(7718143),Qs=new C(16758858),Zs=new C(16777215);class Us extends K{constructor(t){super(),this.source=t,this.name="Reflection Probe Helper",this.matrixAutoUpdate=!1,this.renderOrder=998,W(this,"editorHelper",!0),W(this,"editorHelperType","reflection-probes"),this.layers.set(P),this.refresh(!0)}signature="";selected=!1;setSelected(t){this.selected!==t&&(this.selected=t,this.refresh(!0))}update(){this.refresh(!1),this.source.updateWorldMatrix(!0,!1),this.matrix.copy(this.source.matrixWorld),this.matrixWorldNeedsUpdate=!0}dispose(){this.clearVisuals(),this.removeFromParent()}refresh(t){const e=Wt(this.source);if(!e)return;const i=e.config,s=JSON.stringify(i);if(!t&&s===this.signature)return;this.signature=s,this.clearVisuals();const o=this.selected?qs:Ys,n=this.selected?1:.62,r=Math.max(0,i.blendDistance);if(i.shape==="sphere"){const a=Math.max(.01,i.radius);this.addWire(new U(a,24,16),o,n),r>0&&a-r>.01&&this.addWire(new U(a-r,20,12),o,this.selected?.55:.28)}else{const[a,h,d]=i.size.map(u=>Math.max(.01,u));this.addWire(new I(a,h,d),o,n);const f=[a-r*2,h-r*2,d-r*2];r>0&&f.every(u=>u>.01)&&this.addWire(new I(f[0],f[1],f[2]),o,this.selected?.55:.28)}if(i.parallaxProjection){const[a,h,d]=i.parallaxSize.map(u=>Math.max(.01,u));this.addWire(new I(a,h,d),Qs,this.selected?.9:.45).position.fromArray(i.parallaxOffset)}this.addWire(new at(this.selected?.16:.11),Zs,this.selected?1:.72).position.fromArray(i.captureOffset),this.traverse(a=>a.layers.set(P))}addWire(t,e,i){const s=new Si(t);t.dispose();const o=new lt({color:e,depthTest:!1,transparent:!0,opacity:i,toneMapped:!1}),n=new Zt(s,o);return n.renderOrder=this.renderOrder,this.add(n),n}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry?.dispose();const i=Array.isArray(e.material)?e.material:[e.material];for(const s of i)s?.dispose()}}}const Te=new WeakMap,Pi=new U(1,12,8);function _t(c){return new p(c[0],c[1],c[2])}function At(c){const t={color:c.color,transparent:!0,opacity:c.opacity??.68,depthTest:!1};return c.dashed?new Ci({...t,dashSize:.18,gapSize:.12}):new lt(t)}function X(c,t,e,i=!1){const s=i&&t.length>0?[...t,t[0]]:[...t],o=new Y(new mt().setFromPoints(s),e);o.renderOrder=997,o.layers.set(P),e instanceof Ci&&o.computeLineDistances(),c.add(o)}function Nt(c,t,e,i,s=64){const o=[];for(let n=0;n<s;n++){const r=n/s*Math.PI*2;o.push(c.clone().addScaledVector(e,Math.cos(r)*t).addScaledVector(i,Math.sin(r)*t))}return o}function Ks(c){const t=new K,e=_t(c.center),i=At(c);return X(t,Nt(e,c.radius,new p(1,0,0),new p(0,1,0)),i,!0),X(t,Nt(e,c.radius,new p(1,0,0),new p(0,0,1)),i,!0),X(t,Nt(e,c.radius,new p(0,1,0),new p(0,0,1)),i,!0),t}function $s(c){const t=new K;return X(t,c.points.map(_t),At(c)),t}function Js(c){const t=new K,e=_t(c.origin),i=_t(c.direction).normalize(),s=Math.abs(i.y)<.9?new p(0,1,0):new p(1,0,0),o=new p().crossVectors(s,i).normalize(),n=new p().crossVectors(i,o).normalize(),r=j.degToRad(Math.max(0,Math.min(360,c.angle))/2),l=At(c),a=[];for(let h=0;h<64;h++){const d=h/64*Math.PI*2,f=o.clone().multiplyScalar(Math.cos(d)).addScaledVector(n,Math.sin(d));a.push(e.clone().addScaledVector(i,Math.cos(r)*c.length).addScaledVector(f,Math.sin(r)*c.length))}X(t,a,l,!0);for(const h of[0,16,32,48])X(t,[e,a[h]],l);return t}function to(c,t,e){return c.applyQuaternion(new L(...e)).add(new p(...t))}function eo(c){const t=new K,e=At(c),[i,s,o]=c.halfExtents,n=[[-i,-s,-o],[i,-s,-o],[i,s,-o],[-i,s,-o],[-i,-s,o],[i,-s,o],[i,s,o],[-i,s,o]].map(([r,l,a])=>to(new p(r,l,a),c.center,c.rotation));for(const[r,l]of[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]])X(t,[n[r],n[l]],e);return t}function io(c){const t=new K,e=At(c),i=new L(...c.rotation),s=_t(c.center),o=r=>r.applyQuaternion(i).add(s),n=(r,l,a)=>Nt(new p(0,r,0),c.radius,l,a).map(o);X(t,n(c.halfHeight,new p(1,0,0),new p(0,0,1)),e,!0),X(t,n(-c.halfHeight,new p(1,0,0),new p(0,0,1)),e,!0);for(const[r,l]of[[c.radius,0],[-c.radius,0],[0,c.radius],[0,-c.radius]])X(t,[o(new p(r,-c.halfHeight,l)),o(new p(r,c.halfHeight,l))],e);for(const r of["x","z"]){const l=[];for(let a=0;a<=32;a++){const h=a/32*Math.PI,d=new p(0,c.halfHeight+Math.sin(h)*c.radius,0);d[r]=Math.cos(h)*c.radius,l.push(o(d))}for(let a=0;a<=32;a++){const h=Math.PI+a/32*Math.PI,d=new p(0,-c.halfHeight+Math.sin(h)*c.radius,0);d[r]=Math.cos(h)*c.radius,l.push(o(d))}X(t,l,e)}return t}function so(c){const t=c.kind==="line"?$s(c):c.kind==="sphere"?Ks(c):c.kind==="cone"?Js(c):c.kind==="box"?eo(c):io(c);return t.layers.set(P),t.traverse(e=>e.layers.set(P)),t}function oo(c,t){const e=new R({color:t.color,depthTest:!1,transparent:!0,opacity:t.writable?.92:.35}),i=new y(Pi,e);return Object.defineProperty(i,"isSpatialHandleMesh",{value:!0}),i.position.copy(_t(t.position)),i.renderOrder=998,i.layers.set(P),Te.set(i,{nodeId:c,handle:t}),i}function no(c,t){const e=[],i=[];for(const s of t){for(const o of s.guides)e.push(so(o));for(const o of s.handles){const n=oo(c,o);e.push(n),i.push(n)}}return{roots:e,handles:i}}function hi(c){return Te.get(c)??null}function le(c,t){const e=Te.get(c);c.material.color.set(t&&e?.handle.writable?"#ffffff":e?.handle.color??"#ffffff")}function di(c,t){const e=c.position.distanceTo(t.position);c.scale.setScalar(Math.max(.025,e*.012))}function ro(c,t,e){const i=c,s=i.geometry;s&&s!==Pi&&!t.has(s)&&(s.dispose(),t.add(s));const o=Array.isArray(i.material)?i.material:i.material?[i.material]:[];for(const n of o)e.has(n)||(n.dispose(),e.add(n))}function pi(c){const t=new Set,e=new Set;for(const i of c)i.removeFromParent(),i.traverse(s=>ro(s,t,e))}function ce(c,t,e,i=1.15){if(c.isEmpty())return 3;const s=e.clone().normalize(),o=Math.abs(s.dot(t.up))>.999?new p(0,0,1):t.up,n=new p().crossVectors(o,s).normalize(),r=new p().crossVectors(s,n).normalize(),l=c.getCenter(new p);let a=0,h=0,d=0;for(const _ of[c.min.x,c.max.x])for(const g of[c.min.y,c.max.y])for(const v of[c.min.z,c.max.z]){const b=new p(_,g,v).sub(l);d=Math.max(d,Math.abs(b.dot(n))),h=Math.max(h,Math.abs(b.dot(r))),a=Math.max(a,Math.abs(b.dot(s)))}const f=j.degToRad(t.fov*.5),u=Math.atan(Math.tan(f)*Math.max(t.aspect,.01)),m=Math.max(h/Math.tan(f),d/Math.tan(u));return Math.max(m*i+a,t.near*4,.01)}const ao=3,lo=.05,co=.03,ho=.6,po=.15,uo=.08,fo=3,mo=.45,Hi=.001,_o=24,go=6,yo=[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]];function vo(c){const t=j.clamp(c*po,uo,fo);return Math.max(Math.min(t,c*mo),Hi)}function he(c){return j.clamp(c*lo,co,ho)}function wo(c,t,e=!1){const{min:i,max:s}=c,o=h=>e?Math.max(h/2,Hi):vo(h),n=o(s.x-i.x),r=o(s.y-i.y),l=o(s.z-i.z);let a=0;for(const[h,d,f]of yo){const u=h===0?i.x:s.x,m=d===0?i.y:s.y,_=f===0?i.z:s.z,g=h===0?n:-n,v=d===0?r:-r,b=f===0?l:-l;t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u+g,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m+v,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_+b}}class de extends ye{entityObject;_fixedSize;_edges;_objectFrame;_toObject=new ft;_point=new p;_axisX=new p;_axisY=new p;_axisZ=new p;_scale=new p;_positions=new Float32Array(_o*go);_box=new xt;_worldPos=new p;_fixedExtent=new p;_standoff=new p;_lastRootMatrix=new Float32Array(16);_requiresContinuousBounds;constructor(t,e){const i=new ve,s=new we({color:e.color,linewidth:e.lineWidth??ao,worldUnits:!1,alphaToCoverage:!0,toneMapped:!1,depthTest:!1,depthWrite:!1});super(i,s),this.entityObject=t,this._fixedSize=e.fixedSize,this._edges=e.edges===!0,this._objectFrame=e.frame==="object";let o=!1;t.traverse(n=>{const r=n;(n.isSkinnedMesh||Array.isArray(r.morphTargetInfluences)&&r.morphTargetInfluences.length>0||ks(n)!==null)&&(o=!0)}),this._requiresContinuousBounds=o,this.renderOrder=1,this.frustumCulled=!1,i.setPositions(this._positions),this.update()}setColor(t){this.material.color.setHex(t)}updateIfNeeded(){this.entityObject.updateWorldMatrix(!0,!1);const t=this.entityObject.matrixWorld.elements;let e=!1;for(let i=0;i<t.length;i++)if(t[i]!==this._lastRootMatrix[i]){e=!0;break}(e||this._requiresContinuousBounds)&&this.update()}update(){this.entityObject.updateWorldMatrix(!0,!1);const t=this._objectFrame&&this._fixedSize===void 0&&Math.abs(this.entityObject.matrixWorld.determinant())>1e-30;this.entityObject.matrixWorld.extractBasis(this._axisX,this._axisY,this._axisZ);const e=t?this._scale.set(this._axisX.length(),this._axisY.length(),this._axisZ.length()):this._scale.set(1,1,1);if(this._fixedSize!==void 0)this.entityObject.getWorldPosition(this._worldPos),this._fixedExtent.setScalar(this._fixedSize),this._box.setFromCenterAndSize(this._worldPos,this._fixedExtent);else if(t?(this._toObject.copy(this.entityObject.matrixWorld).invert(),qi(this.entityObject,this._toObject,this._box)):Vt(this.entityObject,this._box),this._box.isEmpty())return;if(this._box.getSize(this._standoff).multiply(e),this._standoff.set(he(this._standoff.x),he(this._standoff.y),he(this._standoff.z)).divide(e),this._box.expandByVector(this._standoff),wo(this._box,this._positions,this._edges),t){const s=this.entityObject.matrixWorld;for(let o=0;o<this._positions.length;o+=3)this._point.set(this._positions[o],this._positions[o+1],this._positions[o+2]).applyMatrix4(s),this._positions[o]=this._point.x,this._positions[o+1]=this._point.y,this._positions[o+2]=this._point.z}const i=this.geometry.getAttribute("instanceStart");i&&(i.data.needsUpdate=!0),this._lastRootMatrix.set(this.entityObject.matrixWorld.elements)}dispose(){this.geometry.dispose(),this.material.dispose()}}function bo({BlendFunction:c,KernelSize:t,OutlineEffect:e},i,s,o){const n=new e(i,s,{blendFunction:c.ALPHA,visibleEdgeColor:o.visible,hiddenEdgeColor:o.hidden,edgeStrength:5,pulseSpeed:0,blur:!0,kernelSize:t.MEDIUM,resolutionScale:.5,xRay:!0});n.selectionLayer=_e,s.layers.disable(_e);const r=n.getFragmentShader(),l="vec3 color=edge.x*visibleEdgeColor+edge.y*hiddenEdgeColor;",a="edge*=(edgeStrength*mask.x*pulse);";r.includes(l)&&r.includes(a)&&(n.setFragmentShader(r.replace("uniform float edgeStrength;","uniform float edgeStrength;uniform float volterCrisp;").replace(a,"edge*=(edgeStrength*(volterCrisp>0.5?1.0:mask.x)*pulse);").replace(l,`${l}if(volterCrisp>0.5){float volterSum=edge.x+edge.y;if(volterSum>0.0)color/=volterSum;edge=min(edge,vec2(1.0));}`)),n.uniforms.set("volterCrisp",{value:0}));const h=n.update.bind(n);return n.update=(d,f,u)=>{const m=n.camera,_=m.layers.isEnabled(P);m.layers.disable(P);try{h(d,f,u)}finally{_&&m.layers.enable(P)}},gt.set(n,{colors:o,roots:0}),Kt(n),n}const xe=new WeakMap;function An(c,t,e,i,s){const o=xe.get(t)?.pop();return o?(o.mainScene=e,o.mainCamera=i,i.layers.disable(_e),gt.set(o,{colors:s,roots:0}),Kt(o),o):bo(c,e,i,s)}function Pn(c,t,e){t.selection.clear(),e?.setEffects([]);const i=xe.get(c)??[];i.includes(t)||i.push(t),xe.set(c,i)}const xo=`uniform lowp sampler2D inputBuffer;uniform vec2 texelSize;uniform float volterReach;
2
+ import{kQ as Oi,kX as ht,lj as De,lk as Re,ll as je,kP as ki,lm as Di,ln as Fe,d7 as Ri,lo as Z,eX as Lt,dv as V,Z as It,lp as te,aH as ji,fC as Fi,bq as Gi,kS as Ge,kT as Be,kU as Ve,dp as We,al as Ot,lq as Bi,lr as Vi,ls as Xe,jT as Ne,bs as Wi,_ as Xi}from"./index-C5cL2IUJ.js";import{a as Ni,i as st}from"./standard-viewport-dressing-YsNQjtKv.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{E as Ye,a as qe,f as Yi}from"./clip-planes-CnAI6DZn.js";import{b as qi,a as Vt,C as Qe,e as Qi,d as Zi}from"./content-bounds-DzkikRBl.js";import{EDITOR_LAYER as P,isInEditorOwnedSubtree as J,EDITOR_SELECTION_LAYER as _e,isEditorOwnedObject as Ui}from"./editor-layers-DJwy9H_k.js";import{e as ge,r as Wt,f as Ze}from"./three-z0dIVVct.js";import{g as tt,s as W}from"./user-data-BYUf0wLn.js";import{d as Ki,s as $i,a as Ji}from"./model-thumbnail-D73YMcQe.js";import{d as Ue,e as ts}from"./model-inspection-BSCcC5V2.js";import{OrbitControls as es}from"./OrbitControls-B13MKuwC.js";import"./three.module-BLhyNg0e.js";import{a8 as is,fo as p,dp as L,e6 as nt,cW as qt,cp as R,bX as lt,aq as O,K as I,N as mt,a$ as Mt,co as y,cZ as at,bV as Y,e$ as yt,ey as U,aV as bi,cm as ft,db as xi,aI as Qt,bh as K,eV as ss,_ as C,cj as j,aO as Si,c0 as Zt,b_ as Ci,I as xt,cP as os,c8 as ns,e as rs,ap as as,A as ls,c7 as Ee,b$ as cs,da as Ke,fd as et,el as hs,d9 as ds,d5 as $e,j as ps,aE as us,eg as fs,cg as dt,fA as ms,aF as _s,de as gs,eD as ys,bk as vs,S as ws,ex as bs,a5 as xs,ej as it,eE as Je,eF as ti,em as Ss,T as Mi,c1 as Ai}from"./three.core-3arARmh6.js";import{L as ye,a as ve,b as we}from"./LineSegments2-DN9pUfWA.js";import{B as Cs}from"./three.quarks.esm-C_HmSKXo.js";import{b as Ms,e as As}from"./live-gesture-lock-DJbrjOqf.js";import{f as Ps}from"./editor-shell-store-B87W2cjm.js";import{a as Hs,e as Es}from"./entity-object-BpsV3ox5.js";import{e as Ts,v as kt,i as zs,d as Ls}from"./three-integration-BjghFioV.js";import{f as ei,v as Is,s as Os}from"./scene-framing-Visz22um.js";import{a as ks}from"./live-mixers-B-bwLZ7c.js";function be(c){const t=tt(c,"triggerVolume");if(!t||typeof t!="object")return null;const{radius:e}=t;return typeof e=="number"&&Number.isFinite(e)&&e>0?{radius:e}:null}const ot=new nt,k=new p,$=new p,T=new L,ii={X:new p(1,0,0),Y:new p(0,1,0),Z:new p(0,0,1)},ee={type:"change"},si={type:"mouseDown",mode:null},oi={type:"mouseUp",mode:null},ni={type:"objectChange"};class ie extends is{constructor(t,e=null){super(void 0,e);const i=new Bs(this);this._root=i;const s=new Vs;this._gizmo=s,i.add(s);const o=new Ws;this._plane=o,i.add(o);const n=this;function r(w,S){let z=S;Object.defineProperty(n,w,{get:function(){return z!==void 0?z:S},set:function(x){z!==x&&(z=x,o[w]=x,s[w]=x,n.dispatchEvent({type:w+"-changed",value:x}),n.dispatchEvent(ee))}}),n[w]=S,o[w]=S,s[w]=S}r("camera",t),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0),r("minX",-1/0),r("maxX",1/0),r("minY",-1/0),r("maxY",1/0),r("minZ",-1/0),r("maxZ",1/0);const l=new p,a=new p,h=new L,d=new L,f=new p,u=new L,m=new p,_=new p,g=new p,v=0,b=new p;r("worldPosition",l),r("worldPositionStart",a),r("worldQuaternion",h),r("worldQuaternionStart",d),r("cameraPosition",f),r("cameraQuaternion",u),r("pointStart",m),r("pointEnd",_),r("rotationAxis",g),r("rotationAngle",v),r("eye",b),this._offset=new p,this._startNorm=new p,this._endNorm=new p,this._cameraScale=new p,this._parentPosition=new p,this._parentQuaternion=new L,this._parentQuaternionInv=new L,this._parentScale=new p,this._worldScaleStart=new p,this._worldQuaternionInv=new L,this._worldScale=new p,this._positionStart=new p,this._quaternionStart=new L,this._scaleStart=new p,this._getPointer=Ds.bind(this),this._onPointerDown=js.bind(this),this._onPointerHover=Rs.bind(this),this._onPointerMove=Fs.bind(this),this._onPointerUp=Gs.bind(this),e!==null&&this.connect(e)}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&&ot.setFromCamera(t,this.camera);const e=se(this._gizmo.picker[this.mode],ot);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&&ot.setFromCamera(t,this.camera);const e=se(this._plane,ot,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,si.mode=this.mode,this.dispatchEvent(si)}}pointerMove(t){const e=this.axis,i=this.mode,s=this.object;let o=this.space;if(i==="scale"?o="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(o="world"),s===void 0||e===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&&ot.setFromCamera(t,this.camera);const n=se(this._plane,ot,!0);if(n){if(this.pointEnd.copy(n.point).sub(this.worldPositionStart),i==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),o==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),o==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(o==="local"&&(s.position.applyQuaternion(T.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),o==="world"&&(s.parent&&s.position.add(k.setFromMatrixPosition(s.parent.matrixWorld)),e.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(k.setFromMatrixPosition(s.parent.matrixWorld)))),s.position.x=Math.max(this.minX,Math.min(this.maxX,s.position.x)),s.position.y=Math.max(this.minY,Math.min(this.maxY,s.position.y)),s.position.z=Math.max(this.minZ,Math.min(this.maxZ,s.position.z));else if(i==="scale"){if(e.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),$.set(r,r,r)}else k.copy(this.pointStart),$.copy(this.pointEnd),k.applyQuaternion(this._worldQuaternionInv),$.applyQuaternion(this._worldQuaternionInv),$.divide(k),e.search("X")===-1&&($.x=1),e.search("Y")===-1&&($.y=1),e.search("Z")===-1&&($.z=1);s.scale.copy(this._scaleStart).multiply($),this.scaleSnap&&(e.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(i==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(k.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(k.copy(this.rotationAxis).cross(this.eye))*r):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(ii[e]),k.copy(ii[e]),o==="local"&&k.applyQuaternion(this.worldQuaternion),k.cross(this.eye),k.length()===0?l=!0:this.rotationAngle=this._offset.dot(k.normalize())*r),(e==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),o==="local"&&e!=="E"&&e!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(T.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(T.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(ee),this.dispatchEvent(ni)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(oi.mode=this.mode,this.dispatchEvent(oi)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(t){return this.object=t,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(ee),this.dispatchEvent(ni),this.pointStart.copy(this.pointEnd))}getRaycaster(){return ot}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}setColors(t,e,i,s){const o=this._gizmo.materialLib;o.xAxis.color.set(t),o.yAxis.color.set(e),o.zAxis.color.set(i),o.active.color.set(s),o.xAxisTransparent.color.set(t),o.yAxisTransparent.color.set(e),o.zAxisTransparent.color.set(i),o.activeTransparent.color.set(s),o.xAxis._color&&o.xAxis._color.set(t),o.yAxis._color&&o.yAxis._color.set(e),o.zAxis._color&&o.zAxis._color.set(i),o.active._color&&o.active._color.set(s),o.xAxisTransparent._color&&o.xAxisTransparent._color.set(t),o.yAxisTransparent._color&&o.yAxisTransparent._color.set(e),o.zAxisTransparent._color&&o.zAxisTransparent._color.set(i),o.activeTransparent._color&&o.activeTransparent._color.set(s)}}function Ds(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const t=this.domElement.getBoundingClientRect();return{x:(c.clientX-t.left)/t.width*2-1,y:-(c.clientY-t.top)/t.height*2+1,button:c.button}}}function Rs(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function js(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function Fs(c){this.enabled&&this.pointerMove(this._getPointer(c))}function Gs(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function se(c,t,e){const i=t.intersectObject(c,!0);for(let s=0;s<i.length;s++)if(i[s].object.visible||e)return i[s];return!1}const Dt=new bi,H=new p(0,1,0),ri=new p(0,0,0),ai=new ft,Rt=new L,Xt=new L,N=new p,li=new ft,St=new p(1,0,0),rt=new p(0,1,0),Ct=new p(0,0,1),jt=new p,vt=new p,wt=new p;class Bs extends qt{constructor(t){super(),this.isTransformControlsRoot=!0,this.controls=t,this.visible=!1}updateMatrixWorld(t){const e=this.controls;e.object!==void 0&&(e.object.updateMatrixWorld(),e.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):e.object.parent.matrixWorld.decompose(e._parentPosition,e._parentQuaternion,e._parentScale),e.object.matrixWorld.decompose(e.worldPosition,e.worldQuaternion,e._worldScale),e._parentQuaternionInv.copy(e._parentQuaternion).invert(),e._worldQuaternionInv.copy(e.worldQuaternion).invert()),e.camera.updateMatrixWorld(),e.camera.matrixWorld.decompose(e.cameraPosition,e.cameraQuaternion,e._cameraScale),e.camera.isOrthographicCamera?e.camera.getWorldDirection(e.eye).negate():e.eye.copy(e.cameraPosition).sub(e.worldPosition).normalize(),super.updateMatrixWorld(t)}dispose(){this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}}class Vs extends qt{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const t=new R({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=new lt({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=t.clone();i.opacity=.15;const s=e.clone();s.opacity=.5;const o=t.clone();o.color.setHex(16711680);const n=t.clone();n.color.setHex(65280);const r=t.clone();r.color.setHex(255);const l=t.clone();l.color.setHex(16711680),l.opacity=.5;const a=t.clone();a.color.setHex(65280),a.opacity=.5;const h=t.clone();h.color.setHex(255),h.opacity=.5;const d=t.clone();d.opacity=.25;const f=t.clone();f.color.setHex(16776960),f.opacity=.25;const u=t.clone();u.color.setHex(16776960);const m=t.clone();m.color.setHex(7895160),this.materialLib={xAxis:o,yAxis:n,zAxis:r,active:u,xAxisTransparent:l,yAxisTransparent:a,zAxisTransparent:h,activeTransparent:f};const _=new O(0,.04,.1,12);_.translate(0,.05,0);const g=new I(.08,.08,.08);g.translate(0,.04,0);const v=new mt;v.setAttribute("position",new Mt([0,0,0,1,0,0],3));const b=new O(.0075,.0075,.5,3);b.translate(0,.25,0);function w(F,Ht){const B=new yt(F,.0075,3,64,Ht*Math.PI*2);return B.rotateY(Math.PI/2),B.rotateX(Math.PI/2),B}function S(){const F=new mt;return F.setAttribute("position",new Mt([0,0,0,1,1,1],3)),F}const z={X:[[new y(_,o),[.5,0,0],[0,0,-Math.PI/2]],[new y(_,o),[-.5,0,0],[0,0,Math.PI/2]],[new y(b,o),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new y(_,n),[0,.5,0]],[new y(_,n),[0,-.5,0],[Math.PI,0,0]],[new y(b,n)]],Z:[[new y(_,r),[0,0,.5],[Math.PI/2,0,0]],[new y(_,r),[0,0,-.5],[-Math.PI/2,0,0]],[new y(b,r),null,[Math.PI/2,0,0]]],XYZ:[[new y(new at(.1,0),d),[0,0,0]]],XY:[[new y(new I(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new y(new I(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.15,.15,.01),a),[.15,0,.15],[-Math.PI/2,0,0]]]},x={X:[[new y(new O(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new y(new O(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y(new O(.2,0,.6,4),i),[0,.3,0]],[new y(new O(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y(new O(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new y(new O(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new y(new at(.2,0),i)]],XY:[[new y(new I(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new y(new I(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},A={START:[[new y(new at(.01,2),s),null,null,null,"helper"]],END:[[new y(new at(.01,2),s),null,null,null,"helper"]],DELTA:[[new Y(S(),s),null,null,null,"helper"]],X:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Y(v,s),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Y(v,s),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},M={XYZE:[[new y(w(.5,1),m),null,[0,Math.PI/2,0]]],X:[[new y(w(.5,.5),o)]],Y:[[new y(w(.5,.5),n),null,[0,0,-Math.PI/2]]],Z:[[new y(w(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new y(w(.75,1),f),null,[0,Math.PI/2,0]]]},E={AXIS:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]]},G={XYZE:[[new y(new U(.25,10,8),i)]],X:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new y(new yt(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new y(new yt(.75,.1,2,24),i)]]},$t={X:[[new y(g,o),[.5,0,0],[0,0,-Math.PI/2]],[new y(b,o),[0,0,0],[0,0,-Math.PI/2]],[new y(g,o),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new y(g,n),[0,.5,0]],[new y(b,n)],[new y(g,n),[0,-.5,0],[0,0,Math.PI]]],Z:[[new y(g,r),[0,0,.5],[Math.PI/2,0,0]],[new y(b,r),[0,0,0],[Math.PI/2,0,0]],[new y(g,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new y(new I(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new y(new I(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.15,.15,.01),a),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y(new I(.1,.1,.1),d)]]},Pt={X:[[new y(new O(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new y(new O(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new y(new O(.2,0,.6,4),i),[0,.3,0]],[new y(new O(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new y(new O(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new y(new O(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new y(new I(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new y(new I(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new y(new I(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new y(new I(.2,.2,.2),i),[0,0,0]]]},Jt={X:[[new Y(v,s),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Y(v,s),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Y(v,s),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function Q(F){const Ht=new qt;for(const B in F)for(let ct=F[B].length;ct--;){const D=F[B][ct][0].clone(),Et=F[B][ct][1],Tt=F[B][ct][2],zt=F[B][ct][3],Ii=F[B][ct][4];D.name=B,D.tag=Ii,Et&&D.position.set(Et[0],Et[1],Et[2]),Tt&&D.rotation.set(Tt[0],Tt[1],Tt[2]),zt&&D.scale.set(zt[0],zt[1],zt[2]),D.updateMatrix();const ke=D.geometry.clone();ke.applyMatrix4(D.matrix),D.geometry=ke,D.renderOrder=1/0,D.position.set(0,0,0),D.rotation.set(0,0,0),D.scale.set(1,1,1),Ht.add(D)}return Ht}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=Q(z)),this.add(this.gizmo.rotate=Q(M)),this.add(this.gizmo.scale=Q($t)),this.add(this.picker.translate=Q(x)),this.add(this.picker.rotate=Q(G)),this.add(this.picker.scale=Q(Pt)),this.add(this.helper.translate=Q(A)),this.add(this.helper.rotate=Q(E)),this.add(this.helper.scale=Q(Jt)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(t){const i=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:Xt;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let o=0;o<s.length;o++){const n=s[o];n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition);let r;if(this.camera.isOrthographicCamera?r=(this.camera.top-this.camera.bottom)/this.camera.zoom:r=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(r*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(T.setFromEuler(Dt.set(0,0,0)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(T.setFromEuler(Dt.set(0,0,Math.PI/2)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(T.setFromEuler(Dt.set(0,Math.PI/2,0)),n.quaternion.copy(i).multiply(T),Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(T.setFromEuler(Dt.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(ai.lookAt(ri,H,rt)),n.quaternion.multiply(T),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),k.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),k.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(k),n.visible=this.dragging):(n.quaternion.copy(i),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(H.copy(Ct).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(H.copy(St).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(H.copy(rt).applyQuaternion(i).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Rt.copy(i),H.copy(this.eye).applyQuaternion(T.copy(i).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(ai.lookAt(this.eye,ri,rt)),n.name==="X"&&(T.setFromAxisAngle(St,Math.atan2(-H.y,H.z)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T)),n.name==="Y"&&(T.setFromAxisAngle(rt,Math.atan2(H.x,H.z)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T)),n.name==="Z"&&(T.setFromAxisAngle(Ct,Math.atan2(H.y,H.x)),T.multiplyQuaternions(Rt,T),n.quaternion.copy(T))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis?(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1):this.axis.split("").some(function(l){return n.name===l})&&(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1))}super.updateMatrixWorld(t)}}class Ws extends y{constructor(){super(new xi(1e5,1e5,2,2),new R({visible:!1,wireframe:!0,side:Qt,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),jt.copy(St).applyQuaternion(e==="local"?this.worldQuaternion:Xt),vt.copy(rt).applyQuaternion(e==="local"?this.worldQuaternion:Xt),wt.copy(Ct).applyQuaternion(e==="local"?this.worldQuaternion:Xt),H.copy(vt),this.mode){case"translate":case"scale":switch(this.axis){case"X":H.copy(this.eye).cross(jt),N.copy(jt).cross(H);break;case"Y":H.copy(this.eye).cross(vt),N.copy(vt).cross(H);break;case"Z":H.copy(this.eye).cross(wt),N.copy(wt).cross(H);break;case"XY":N.copy(wt);break;case"YZ":N.copy(jt);break;case"XZ":H.copy(wt),N.copy(vt);break;case"XYZ":case"E":N.set(0,0,0);break}break;case"rotate":default:N.set(0,0,0)}N.length()===0?this.quaternion.copy(this.cameraQuaternion):(li.lookAt(k.set(0,0,0),N,H),this.quaternion.setFromRotationMatrix(li)),super.updateMatrixWorld(t)}}const oe=new C(4441855),Ft=new C(16758858),Gt=new C(14185983),Xs=new C(16731496),ci=new C(16777215);function ne(c){return new Y(new mt,new lt({color:c,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function re(c,t){return new y(c,new R({color:t,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function ae(c,t){if(c.visible=t.length>1,!c.visible)return;let e=c.geometry.getAttribute("position");(!e||e.count!==t.length)&&(e=new Mt(t.length*3,3),c.geometry.setAttribute("position",e));for(let i=0;i<t.length;i++)e.setXYZ(i,t[i].x,t[i].y,t[i].z);e.needsUpdate=!0,c.geometry.computeBoundingSphere()}class Ns extends K{constructor(t){super(),this.source=t,this.name="Constraint Helper",this.renderOrder=999,W(this,"editorHelper",!0),W(this,"editorHelperType","constraints"),this.layers.set(P),this.refreshStructure()}selected=!1;hoveredControl=null;selectedObjects=new Set;visuals=[];setSelected(t){this.selected=t}setSelectedObjects(t){this.selectedObjects=t}controlMeshes(){return this.visuals.flatMap(t=>[t.targetHit,t.poleHit].filter(e=>e.visible))}presents(t){return t===this.source?!0:this.visuals.some(e=>{const i=e.mark.getSnapshot();return t===i.target||t===i.pole})}controlFor(t){for(const e of this.visuals){const i=e.mark.getSnapshot();if((t===e.target||t===e.targetHit)&&i.target)return{kind:"target",label:i.target.name||`${e.mark.config.label} target`,object:i.target,mesh:e.target};if((t===e.pole||t===e.poleHit)&&i.pole)return{kind:"pole",label:i.pole.name||`${e.mark.config.label} pole`,object:i.pole,mesh:e.pole}}return null}setHoveredControl(t){this.hoveredControl=t}update(t){this.refreshStructure();for(const e of this.visuals)this.updateVisual(e,t)}dispose(){this.clearVisuals(),this.removeFromParent()}refreshStructure(){const t=ge(this.source);t.length===this.visuals.length&&t.every((i,s)=>{const o=i.getSnapshot(),n=o.chain.length>0?o.chain.length:o.constrained?1:0;return this.visuals[s]?.mark===i&&this.visuals[s]?.positions.length===n})||(this.clearVisuals(),this.visuals=t.map(i=>this.makeVisual(i)))}makeVisual(t){const e=t.getSnapshot(),i=e.chain.length>0?e.chain:e.constrained?[e.constrained]:[],s=ne(oe),o=ne(Ft),n=ne(Gt),r=i.map(()=>re(new U(.035,10,7),oe)),l=re(new at(.085),Ft),a=re(new ss(.075),Gt),h=new R({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1,colorWrite:!1}),d=new y(new U(.16,10,7),h),f=new y(new U(.15,10,7),h.clone());for(const u of[s,o,n,...r,l,a,d,f])u.renderOrder=this.renderOrder,u.layers.set(P),this.add(u);return{mark:t,chain:s,targetLine:o,poleLine:n,joints:r,target:l,pole:a,targetHit:d,poleHit:f,positions:i.map(()=>new p),targetPosition:new p,polePosition:new p}}updateVisual(t,e){const i=t.mark.getSnapshot(),s=i.chain.length>0?i.chain:i.constrained?[i.constrained]:[];for(let f=0;f<s.length;f++)s[f].getWorldPosition(t.positions[f]);ae(t.chain,t.positions);for(let f=0;f<t.joints.length;f++){const u=t.joints[f],m=t.positions[f];u.visible=!!m,m&&(u.position.copy(m),u.scale.setScalar(this.handleScale(e,m)))}const o=t.positions.at(-1),n=i.target?.getWorldPosition(t.targetPosition)??null,r=i.pole?.getWorldPosition(t.polePosition)??null;ae(t.targetLine,o&&n?[o,n]:[]),ae(t.poleLine,t.positions[0]&&r?[t.positions[0],r]:[]),t.target.visible=n!==null,n&&(t.target.position.copy(n),t.target.scale.setScalar(this.handleScale(e,n)*(this.hoveredControl===t.target?1.22:1))),t.targetHit.visible=n!==null,n&&(t.targetHit.position.copy(n),t.targetHit.scale.copy(t.target.scale)),t.pole.visible=r!==null,r&&(t.pole.position.copy(r),t.pole.scale.setScalar(this.handleScale(e,r)*(this.hoveredControl===t.pole?1.22:1))),t.poleHit.visible=r!==null,r&&(t.poleHit.position.copy(r),t.poleHit.scale.copy(t.pole.scale));const l=i.status==="error"||i.status==="unresolved",a=this.selected?1:.52;for(const f of[t.chain,...t.joints]){const u=f.material;u.color.copy(l?Xs:oe),u.opacity=a}const h=this.hoveredControl===t.target||i.target!==null&&this.selectedObjects.has(i.target),d=this.hoveredControl===t.pole||i.pole!==null&&this.selectedObjects.has(i.pole);t.target.material.color.copy(h?ci:Ft),t.pole.material.color.copy(d?ci:Gt),t.targetLine.material.color.copy(Ft),t.poleLine.material.color.copy(Gt),t.targetLine.material.opacity=a,t.poleLine.material.opacity=a,t.target.material.opacity=h?1:a,t.pole.material.opacity=d?1:a}handleScale(t,e){return j.clamp(t.position.distanceTo(e)/8,.65,4)}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry.dispose();const i=Array.isArray(e.material)?e.material:[e.material];for(const s of i)s.dispose()}this.visuals=[],this.hoveredControl=null}}const Ys=new C(4892927),qs=new C(7718143),Qs=new C(16758858),Zs=new C(16777215);class Us extends K{constructor(t){super(),this.source=t,this.name="Reflection Probe Helper",this.matrixAutoUpdate=!1,this.renderOrder=998,W(this,"editorHelper",!0),W(this,"editorHelperType","reflection-probes"),this.layers.set(P),this.refresh(!0)}signature="";selected=!1;setSelected(t){this.selected!==t&&(this.selected=t,this.refresh(!0))}update(){this.refresh(!1),this.source.updateWorldMatrix(!0,!1),this.matrix.copy(this.source.matrixWorld),this.matrixWorldNeedsUpdate=!0}dispose(){this.clearVisuals(),this.removeFromParent()}refresh(t){const e=Wt(this.source);if(!e)return;const i=e.config,s=JSON.stringify(i);if(!t&&s===this.signature)return;this.signature=s,this.clearVisuals();const o=this.selected?qs:Ys,n=this.selected?1:.62,r=Math.max(0,i.blendDistance);if(i.shape==="sphere"){const a=Math.max(.01,i.radius);this.addWire(new U(a,24,16),o,n),r>0&&a-r>.01&&this.addWire(new U(a-r,20,12),o,this.selected?.55:.28)}else{const[a,h,d]=i.size.map(u=>Math.max(.01,u));this.addWire(new I(a,h,d),o,n);const f=[a-r*2,h-r*2,d-r*2];r>0&&f.every(u=>u>.01)&&this.addWire(new I(f[0],f[1],f[2]),o,this.selected?.55:.28)}if(i.parallaxProjection){const[a,h,d]=i.parallaxSize.map(u=>Math.max(.01,u));this.addWire(new I(a,h,d),Qs,this.selected?.9:.45).position.fromArray(i.parallaxOffset)}this.addWire(new at(this.selected?.16:.11),Zs,this.selected?1:.72).position.fromArray(i.captureOffset),this.traverse(a=>a.layers.set(P))}addWire(t,e,i){const s=new Si(t);t.dispose();const o=new lt({color:e,depthTest:!1,transparent:!0,opacity:i,toneMapped:!1}),n=new Zt(s,o);return n.renderOrder=this.renderOrder,this.add(n),n}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry?.dispose();const i=Array.isArray(e.material)?e.material:[e.material];for(const s of i)s?.dispose()}}}const Te=new WeakMap,Pi=new U(1,12,8);function _t(c){return new p(c[0],c[1],c[2])}function At(c){const t={color:c.color,transparent:!0,opacity:c.opacity??.68,depthTest:!1};return c.dashed?new Ci({...t,dashSize:.18,gapSize:.12}):new lt(t)}function X(c,t,e,i=!1){const s=i&&t.length>0?[...t,t[0]]:[...t],o=new Y(new mt().setFromPoints(s),e);o.renderOrder=997,o.layers.set(P),e instanceof Ci&&o.computeLineDistances(),c.add(o)}function Nt(c,t,e,i,s=64){const o=[];for(let n=0;n<s;n++){const r=n/s*Math.PI*2;o.push(c.clone().addScaledVector(e,Math.cos(r)*t).addScaledVector(i,Math.sin(r)*t))}return o}function Ks(c){const t=new K,e=_t(c.center),i=At(c);return X(t,Nt(e,c.radius,new p(1,0,0),new p(0,1,0)),i,!0),X(t,Nt(e,c.radius,new p(1,0,0),new p(0,0,1)),i,!0),X(t,Nt(e,c.radius,new p(0,1,0),new p(0,0,1)),i,!0),t}function $s(c){const t=new K;return X(t,c.points.map(_t),At(c)),t}function Js(c){const t=new K,e=_t(c.origin),i=_t(c.direction).normalize(),s=Math.abs(i.y)<.9?new p(0,1,0):new p(1,0,0),o=new p().crossVectors(s,i).normalize(),n=new p().crossVectors(i,o).normalize(),r=j.degToRad(Math.max(0,Math.min(360,c.angle))/2),l=At(c),a=[];for(let h=0;h<64;h++){const d=h/64*Math.PI*2,f=o.clone().multiplyScalar(Math.cos(d)).addScaledVector(n,Math.sin(d));a.push(e.clone().addScaledVector(i,Math.cos(r)*c.length).addScaledVector(f,Math.sin(r)*c.length))}X(t,a,l,!0);for(const h of[0,16,32,48])X(t,[e,a[h]],l);return t}function to(c,t,e){return c.applyQuaternion(new L(...e)).add(new p(...t))}function eo(c){const t=new K,e=At(c),[i,s,o]=c.halfExtents,n=[[-i,-s,-o],[i,-s,-o],[i,s,-o],[-i,s,-o],[-i,-s,o],[i,-s,o],[i,s,o],[-i,s,o]].map(([r,l,a])=>to(new p(r,l,a),c.center,c.rotation));for(const[r,l]of[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]])X(t,[n[r],n[l]],e);return t}function io(c){const t=new K,e=At(c),i=new L(...c.rotation),s=_t(c.center),o=r=>r.applyQuaternion(i).add(s),n=(r,l,a)=>Nt(new p(0,r,0),c.radius,l,a).map(o);X(t,n(c.halfHeight,new p(1,0,0),new p(0,0,1)),e,!0),X(t,n(-c.halfHeight,new p(1,0,0),new p(0,0,1)),e,!0);for(const[r,l]of[[c.radius,0],[-c.radius,0],[0,c.radius],[0,-c.radius]])X(t,[o(new p(r,-c.halfHeight,l)),o(new p(r,c.halfHeight,l))],e);for(const r of["x","z"]){const l=[];for(let a=0;a<=32;a++){const h=a/32*Math.PI,d=new p(0,c.halfHeight+Math.sin(h)*c.radius,0);d[r]=Math.cos(h)*c.radius,l.push(o(d))}for(let a=0;a<=32;a++){const h=Math.PI+a/32*Math.PI,d=new p(0,-c.halfHeight+Math.sin(h)*c.radius,0);d[r]=Math.cos(h)*c.radius,l.push(o(d))}X(t,l,e)}return t}function so(c){const t=c.kind==="line"?$s(c):c.kind==="sphere"?Ks(c):c.kind==="cone"?Js(c):c.kind==="box"?eo(c):io(c);return t.layers.set(P),t.traverse(e=>e.layers.set(P)),t}function oo(c,t){const e=new R({color:t.color,depthTest:!1,transparent:!0,opacity:t.writable?.92:.35}),i=new y(Pi,e);return Object.defineProperty(i,"isSpatialHandleMesh",{value:!0}),i.position.copy(_t(t.position)),i.renderOrder=998,i.layers.set(P),Te.set(i,{nodeId:c,handle:t}),i}function no(c,t){const e=[],i=[];for(const s of t){for(const o of s.guides)e.push(so(o));for(const o of s.handles){const n=oo(c,o);e.push(n),i.push(n)}}return{roots:e,handles:i}}function hi(c){return Te.get(c)??null}function le(c,t){const e=Te.get(c);c.material.color.set(t&&e?.handle.writable?"#ffffff":e?.handle.color??"#ffffff")}function di(c,t){const e=c.position.distanceTo(t.position);c.scale.setScalar(Math.max(.025,e*.012))}function ro(c,t,e){const i=c,s=i.geometry;s&&s!==Pi&&!t.has(s)&&(s.dispose(),t.add(s));const o=Array.isArray(i.material)?i.material:i.material?[i.material]:[];for(const n of o)e.has(n)||(n.dispose(),e.add(n))}function pi(c){const t=new Set,e=new Set;for(const i of c)i.removeFromParent(),i.traverse(s=>ro(s,t,e))}function ce(c,t,e,i=1.15){if(c.isEmpty())return 3;const s=e.clone().normalize(),o=Math.abs(s.dot(t.up))>.999?new p(0,0,1):t.up,n=new p().crossVectors(o,s).normalize(),r=new p().crossVectors(s,n).normalize(),l=c.getCenter(new p);let a=0,h=0,d=0;for(const _ of[c.min.x,c.max.x])for(const g of[c.min.y,c.max.y])for(const v of[c.min.z,c.max.z]){const b=new p(_,g,v).sub(l);d=Math.max(d,Math.abs(b.dot(n))),h=Math.max(h,Math.abs(b.dot(r))),a=Math.max(a,Math.abs(b.dot(s)))}const f=j.degToRad(t.fov*.5),u=Math.atan(Math.tan(f)*Math.max(t.aspect,.01)),m=Math.max(h/Math.tan(f),d/Math.tan(u));return Math.max(m*i+a,t.near*4,.01)}const ao=3,lo=.05,co=.03,ho=.6,po=.15,uo=.08,fo=3,mo=.45,Hi=.001,_o=24,go=6,yo=[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]];function vo(c){const t=j.clamp(c*po,uo,fo);return Math.max(Math.min(t,c*mo),Hi)}function he(c){return j.clamp(c*lo,co,ho)}function wo(c,t,e=!1){const{min:i,max:s}=c,o=h=>e?Math.max(h/2,Hi):vo(h),n=o(s.x-i.x),r=o(s.y-i.y),l=o(s.z-i.z);let a=0;for(const[h,d,f]of yo){const u=h===0?i.x:s.x,m=d===0?i.y:s.y,_=f===0?i.z:s.z,g=h===0?n:-n,v=d===0?r:-r,b=f===0?l:-l;t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u+g,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m+v,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_,t[a++]=u,t[a++]=m,t[a++]=_+b}}class de extends ye{entityObject;_fixedSize;_edges;_objectFrame;_toObject=new ft;_point=new p;_axisX=new p;_axisY=new p;_axisZ=new p;_scale=new p;_positions=new Float32Array(_o*go);_box=new xt;_worldPos=new p;_fixedExtent=new p;_standoff=new p;_lastRootMatrix=new Float32Array(16);_requiresContinuousBounds;constructor(t,e){const i=new ve,s=new we({color:e.color,linewidth:e.lineWidth??ao,worldUnits:!1,alphaToCoverage:!0,toneMapped:!1,depthTest:!1,depthWrite:!1});super(i,s),this.entityObject=t,this._fixedSize=e.fixedSize,this._edges=e.edges===!0,this._objectFrame=e.frame==="object";let o=!1;t.traverse(n=>{const r=n;(n.isSkinnedMesh||Array.isArray(r.morphTargetInfluences)&&r.morphTargetInfluences.length>0||ks(n)!==null)&&(o=!0)}),this._requiresContinuousBounds=o,this.renderOrder=1,this.frustumCulled=!1,i.setPositions(this._positions),this.update()}setColor(t){this.material.color.setHex(t)}updateIfNeeded(){this.entityObject.updateWorldMatrix(!0,!1);const t=this.entityObject.matrixWorld.elements;let e=!1;for(let i=0;i<t.length;i++)if(t[i]!==this._lastRootMatrix[i]){e=!0;break}(e||this._requiresContinuousBounds)&&this.update()}update(){this.entityObject.updateWorldMatrix(!0,!1);const t=this._objectFrame&&this._fixedSize===void 0&&Math.abs(this.entityObject.matrixWorld.determinant())>1e-30;this.entityObject.matrixWorld.extractBasis(this._axisX,this._axisY,this._axisZ);const e=t?this._scale.set(this._axisX.length(),this._axisY.length(),this._axisZ.length()):this._scale.set(1,1,1);if(this._fixedSize!==void 0)this.entityObject.getWorldPosition(this._worldPos),this._fixedExtent.setScalar(this._fixedSize),this._box.setFromCenterAndSize(this._worldPos,this._fixedExtent);else if(t?(this._toObject.copy(this.entityObject.matrixWorld).invert(),qi(this.entityObject,this._toObject,this._box)):Vt(this.entityObject,this._box),this._box.isEmpty())return;if(this._box.getSize(this._standoff).multiply(e),this._standoff.set(he(this._standoff.x),he(this._standoff.y),he(this._standoff.z)).divide(e),this._box.expandByVector(this._standoff),wo(this._box,this._positions,this._edges),t){const s=this.entityObject.matrixWorld;for(let o=0;o<this._positions.length;o+=3)this._point.set(this._positions[o],this._positions[o+1],this._positions[o+2]).applyMatrix4(s),this._positions[o]=this._point.x,this._positions[o+1]=this._point.y,this._positions[o+2]=this._point.z}const i=this.geometry.getAttribute("instanceStart");i&&(i.data.needsUpdate=!0),this._lastRootMatrix.set(this.entityObject.matrixWorld.elements)}dispose(){this.geometry.dispose(),this.material.dispose()}}function bo({BlendFunction:c,KernelSize:t,OutlineEffect:e},i,s,o){const n=new e(i,s,{blendFunction:c.ALPHA,visibleEdgeColor:o.visible,hiddenEdgeColor:o.hidden,edgeStrength:5,pulseSpeed:0,blur:!0,kernelSize:t.MEDIUM,resolutionScale:.5,xRay:!0});n.selectionLayer=_e,s.layers.disable(_e);const r=n.getFragmentShader(),l="vec3 color=edge.x*visibleEdgeColor+edge.y*hiddenEdgeColor;",a="edge*=(edgeStrength*mask.x*pulse);";r.includes(l)&&r.includes(a)&&(n.setFragmentShader(r.replace("uniform float edgeStrength;","uniform float edgeStrength;uniform float volterCrisp;").replace(a,"edge*=(edgeStrength*(volterCrisp>0.5?1.0:mask.x)*pulse);").replace(l,`${l}if(volterCrisp>0.5){float volterSum=edge.x+edge.y;if(volterSum>0.0)color/=volterSum;edge=min(edge,vec2(1.0));}`)),n.uniforms.set("volterCrisp",{value:0}));const h=n.update.bind(n);return n.update=(d,f,u)=>{const m=n.camera,_=m.layers.isEnabled(P);m.layers.disable(P);try{h(d,f,u)}finally{_&&m.layers.enable(P)}},gt.set(n,{colors:o,roots:0}),Kt(n),n}const xe=new WeakMap;function An(c,t,e,i,s){const o=xe.get(t)?.pop();return o?(o.mainScene=e,o.mainCamera=i,i.layers.disable(_e),gt.set(o,{colors:s,roots:0}),Kt(o),o):bo(c,e,i,s)}function Pn(c,t,e){t.selection.clear(),e?.setEffects([]);const i=xe.get(c)??[];i.includes(t)||i.push(t),xe.set(c,i)}const xo=`uniform lowp sampler2D inputBuffer;uniform vec2 texelSize;uniform float volterReach;
3
3
  varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;
4
4
  void main(){
5
5
  vec2 uv=(vUv0+vUv1)*0.5;
@@ -1 +1 @@
1
- import{isInEditorOwnedSubtree as V,isEditorOwnedObject as P}from"./editor-layers-BysX9O4Z.js";import{g as k}from"./user-data-CgbG1QjJ.js";import{b as E,c as S}from"./component-instance-root-CYKiTDK5.js";import{n as K,e as $,s as A}from"./entity-object-DxbTsF4x.js";import{s as W}from"./viewport-editor-controls-BYaAZ_Ku.js";import{fd as z,e6 as G,B as U}from"./three.core-3arARmh6.js";function q(n){const t=k(n,"constraints");return Array.isArray(t)?t.filter(e=>!!e&&typeof e=="object"&&typeof e.getSnapshot=="function"&&!!e.config):[]}const M="ingest:camera",J=1<<31;function Q(n){return(n.layers.mask&J)!==0}function Y(n,t){const e=new Map;let r=0,s=0,f=0;const u=(i,c)=>{const o=`ingest:${c}:${i.type}:${i.name||""}`;e.set(o,i),r++,i.isLight?f++:i.isMesh&&s++,d(i,c)},d=(i,c)=>{let o=0;for(const h of i.children)Q(h)||(u(h,c?`${c}/${o}`:`${o}`),o++)};return d(n,""),t&&(e.set(M,t),r++),{byId:e,count:r,meshes:s,lights:f}}function Z(n){const t=k(n,"authoringSubject");return t&&typeof t.label=="string"&&typeof t.kind=="string"?t:null}function X(n){const t=k(n,"reflectionProbe");if(!t||typeof t!="object")return null;const e=t;return e.config&&typeof e.recapture=="function"&&typeof e.getSnapshot=="function"?t:null}let D=null;function ht(n){D=n,W(n?.editorControls??null)}function tt(){return D}function C(n){return n.depthWrite===!1&&n.side===U}function et(n){const t=n.material;return t?Array.isArray(t)?t.length>0&&t.every(C):C(t):!1}function L(n,t,e,r=()=>!1,s){const f=tt();if(!f)return[];const u=f.canvas.getBoundingClientRect();if(u.width<=0||u.height<=0||!Number.isFinite(t)||!Number.isFinite(e)||t<u.left||e<u.top||t>=u.left+u.width||e>=u.top+u.height)return[];const d=new z((t-u.left)/u.width*2-1,-((e-u.top)/u.height)*2+1),i=new G;i.layers.enableAll(),i.setFromCamera(d,f.camera);const c=new Set(s?.objects??n.objectMap.values()),o=[...c].filter(b=>{for(let I=b.parent;I;I=I.parent)if(c.has(I))return!1;return!0});for(const b of o)b.traverse(I=>{const m=I;m.isSkinnedMesh&&(m.boundingBox=null,m.boundingSphere=null)});const h=i.intersectObjects(o,!0),p=[],v=new Set;for(const b of h){if(V(b.object)||et(b.object))continue;let I=b.object,m=null;if(s)for(;I&&m===null;)m=s.idForObject3D(I),I=I.parent;else{const a=K(I);m=a?$(a)??null:null}m!==null&&!r(m)&&!v.has(m)&&(v.add(m),p.push(m))}return nt(p,o,h.length,t,e),p}function nt(n,t,e,r,s){n.length>0||r===0&&s===0||console.info(`[viewport-pick] click selected nothing (candidates ${t.length}, rayHits ${e}, resolvedIds 0)`)}function st(n,t,e,r=()=>!1,s){return L(n,t,e,r,s)[0]??null}const R={count:0,meshes:0,lights:0,instancedMeshes:0,instances:0};let x=0;function H(n){let t=0,e=0;for(const r of n.values()){const s=r.object;s.isInstancedMesh&&(t++,e+=typeof s.count=="number"?s.count:0)}return{instancedMeshes:t,instances:e}}function F(n){let t=0,e=0;for(const r of n.values()){const s=r.object;s.isLight?e++:s.isMesh&&t++}return{count:n.size,meshes:t,lights:e,...H(n)}}function T(n,t){const e=new Map,r=[],s=t.skip??P;t.begin?.(n);const f=(u,d,i,c)=>{if(s(u))return;const o=t.identify(u,{path:d,ownerId:i,ownedByAncestor:c});o!==null&&(A(u,o),e.set(o,{object:u,id:o,parentId:i,childIds:[]}),i===null?r.push(o):e.get(i)?.childIds.push(o));const h=c||o!==null;u.children.forEach((p,v)=>{f(p,[...d,v],o??i,h)}),t.leave?.(u,o)};return n.children.forEach((u,d)=>{f(u,[d],null,!1)}),{nodes:e,rootIds:r,stats:F(e)}}const it="r3f:";function O(n,t){return`${it}${n}:${t}`}function rt(n){const t=new Map,e=new Map,r=(d,i)=>d===i||d.startsWith(`${i}#`)&&/^\d+$/u.test(d.slice(i.length+1)),s=d=>{e.clear();const i=c=>{if(P(c))return;const o=E(c),h=$(c);if(o!==void 0&&h!==void 0){const p=O(n,o);r(h,p)&&!e.has(h)&&e.set(h,c)}for(const p of c.children)i(p)};for(const c of d.children)i(c)},f=(d,i)=>{const c=$(d);if(c===void 0||i===void 0)return c;const o=O(n,i);return r(c,o)?e.get(c)===d?c:void 0:c},u=(d,i)=>{const c=O(n,i);let o=t.get(i)??0,h=S(c,o);for(;e.has(h);)o+=1,h=S(c,o);return t.set(i,o+1),e.set(h,d),h};return{begin:d=>{t.clear(),s(d)},identify:(d,i)=>{const c=E(d),o=f(d,c);if(o!==void 0)return o;const h=c===void 0?void 0:u(d,c);return h!==void 0||!i.ownedByAncestor||k(d,"authoringRoot")===!0?h??`live:${n}:${x++}`:null}}}function N(n,t){return T(n,rt(t))}function pt(n,t){const{nodes:e}=N(n,t),r=new Map;for(const[s,f]of e)r.set(s,f.object);return r}function yt(n,t={}){const e=t.camera;return{incremental:{kind:"live-oid",worldId:n},project:r=>{const s=N(r,n);return!e||[...s.nodes.values()].some(f=>f.object===e)?s:(A(e,M),s.nodes.set(M,{object:e,id:M,parentId:null,childIds:[]}),s.rootIds.push(M),{...s,stats:{...s.stats,count:s.nodes.size}})}}}function gt(n={}){const t=n.camera;return{project:e=>{const r=Y(e,t),s=new Map;for(const[d,i]of r.byId)s.set(i,d);const f=new Map,u=[];for(const[d,i]of r.byId){const c=i.parent,o=(c&&c!==e?s.get(c):void 0)??null,h=i.children.map(p=>s.get(p)).filter(p=>p!==void 0);f.set(d,{object:i,id:d,parentId:o,childIds:h}),o===null&&u.push(d)}return{nodes:f,rootIds:u,stats:{count:r.count,meshes:r.meshes,lights:r.lights,...H(f)}}}}}function It(n){let t=new Map,e=new Map;return{get instanceRoots(){return t},get representatives(){return e},project:r=>{const s=new Map,f=new Map,u=new Map,d=new Set,i=new Map,c=T(r,{identify:(o,h)=>{const p=E(o);if(p===void 0)return O(n,`@${h.path.join(".")}`);const v=s.get(p)??0;return s.set(p,v+1),v===0&&u.set(p,o),d.has(p)||(f.set(p,(f.get(p)??0)+1),d.add(p),i.set(o,p)),S(O(n,p),v)},leave:o=>{const h=i.get(o);h!==void 0&&(d.delete(h),i.delete(o))}});return t=f,e=u,c}}}function mt(n){return{project:t=>T(t,{skip:e=>!!k(e,"editorHelper")||e.isSkeletonHelper===!0,identify:(e,r)=>`source-object:${n}:${r.path.join(".")}`})}}function vt(n){const t=Z(n);return t?t.kind:q(n).length>0?"constraint-owner":X(n)?"reflection-probe":n.isSkinnedMesh?"skinned-mesh":n.isBone?"bone":n.isLight?"light":n.isCamera?"camera":n.type==="Audio"||n.type==="PositionalAudio"||n.type==="AudioListener"?"audio":n.isMesh?"mesh":n.children.length>0?"group":"object"}function ot(n,t){for(let e=n.parent;e!==null;e=e.parent)if(e===t)return!0;return!1}function _(n,t){if(n===t)return!0;for(let e=n.parent;e!==null;e=e.parent)if(e===t)return!0;return!1}class wt{constructor(t,e={}){this.identity=t,this.options=e}nodesById=new Map;objectsById=new Map;idsByObjectIndex=new Map;roots=[];walkStats=R;project(t){if(!t)return this.nodesById=new Map,this.objectsById=new Map,this.idsByObjectIndex=new Map,this.roots=[],this.walkStats=R,this.walkStats;const{nodes:e,rootIds:r,stats:s}=this.identity.project(t);return this.nodesById=e,this.objectsById=new Map([...e].map(([f,u])=>[f,u.object])),this.idsByObjectIndex=new Map([...e].map(([f,u])=>[u.object,f])),this.roots=r,this.walkStats=s,s}projectSubtrees(t,e){const r=this.identity.incremental;if(t===null||r?.kind!=="live-oid")return null;const s=e.filter((a,l)=>e.indexOf(a)===l&&!e.some(y=>y!==a&&ot(a,y))),f=this.roots,u=new Set,d=new Set,i=new Set;for(const a of s)a.traverse(l=>{const y=this.idsByObjectIndex.get(l);if(y===void 0)return;const g=this.nodesById.get(y);g?.parentId!==null&&g?.parentId!==void 0&&i.add(g.parentId),u.add(y),this.nodesById.delete(y),this.objectsById.delete(y),this.idsByObjectIndex.delete(l)});const c=P,o=(a,l)=>{const y=this.objectsById.get(a);return y===void 0||y===l},h=(a,l)=>{const y=$(a);if(y!==void 0&&o(y,a))return y;const g=E(a);if(g!==void 0){const w=O(r.worldId,g);let B=0,j=S(w,B);for(;!o(j,a);)j=S(w,++B);return j}if(!l||k(a,"authoringRoot")===!0){let w=`live:${r.worldId}:${x++}`;for(;!o(w,a);)w=`live:${r.worldId}:${x++}`;return w}return null},p=(a,l,y)=>{if(c(a))return;const g=h(a,y);g!==null&&(A(a,g),this.nodesById.set(g,{object:a,id:g,parentId:l,childIds:[]}),this.objectsById.set(g,a),this.idsByObjectIndex.set(a,g),d.add(g),l!==null&&i.add(l));const w=g??l,B=y||g!==null;for(const j of a.children)p(j,w,B)};for(const a of s){if(!_(a,t))continue;let l=a.parent,y=null;for(;l!==null&&l!==t;){const g=this.idsByObjectIndex.get(l);if(g!==void 0){y=g;break}l=l.parent}p(a,y,y!==null)}const v=a=>{const l=[],y=g=>{if(c(g))return;const w=this.idsByObjectIndex.get(g);if(w!==void 0){l.push(w);return}for(const B of g.children)y(B)};for(const g of a.children)y(g);return l};for(const a of i){const l=this.nodesById.get(a);l!==void 0&&l.childIds.splice(0,l.childIds.length,...v(l.object))}for(const a of d){const l=this.nodesById.get(a);l!==void 0&&l.childIds.splice(0,l.childIds.length,...v(l.object))}const b=v(t),I=this.roots.filter(a=>{const l=this.objectsById.get(a);return l!==void 0&&!_(l,t)&&!u.has(a)});this.roots=[...b,...I],this.walkStats=F(this.nodesById);const m=f.length!==this.roots.length||f.some((a,l)=>a!==this.roots[l]);return{removedIds:u,addedIds:d,changedParentIds:i,rootsChanged:m}}get nodes(){return this.nodesById}get objects(){return this.objectsById}get idsByObject(){return this.idsByObjectIndex}get rootIds(){return this.roots}get stats(){return this.walkStats}node(t){return this.nodesById.get(t)??null}rootNodes(){return this.roots.map(t=>this.nodesById.get(t)).filter(t=>t!==void 0)}objectOf(t){return this.objectsById.get(t)??null}idOf(t){return this.idsByObjectIndex.get(t)??null}childIdsOf(t){const e=[];for(const r of t){const s=this.idsByObjectIndex.get(r);s!==void 0&&e.push(s)}return e}objectMapSnapshot(){return new Map(this.objectsById)}pick(t,e,r,s){return st(t,e,r,s,this.pickProjection())}candidates(t,e,r,s){return L(t,e,r,s,this.pickProjection())}pickProjection(){if(this.options.pickScope!=="store-object-map")return{objects:this.objectsById.values(),idForObject3D:t=>this.idOf(t)}}}export{wt as T,yt as a,gt as b,It as c,mt as d,q as e,ht as f,vt as n,Z as o,X as r,pt as s};
1
+ import{isInEditorOwnedSubtree as V,isEditorOwnedObject as P}from"./editor-layers-DJwy9H_k.js";import{g as k}from"./user-data-BYUf0wLn.js";import{b as E,c as S}from"./component-instance-root-BVjTH0AO.js";import{n as K,e as $,s as A}from"./entity-object-BpsV3ox5.js";import{s as W}from"./viewport-editor-controls-BYaAZ_Ku.js";import{fd as z,e6 as G,B as U}from"./three.core-3arARmh6.js";function q(n){const t=k(n,"constraints");return Array.isArray(t)?t.filter(e=>!!e&&typeof e=="object"&&typeof e.getSnapshot=="function"&&!!e.config):[]}const M="ingest:camera",J=1<<31;function Q(n){return(n.layers.mask&J)!==0}function Y(n,t){const e=new Map;let r=0,s=0,f=0;const u=(i,c)=>{const o=`ingest:${c}:${i.type}:${i.name||""}`;e.set(o,i),r++,i.isLight?f++:i.isMesh&&s++,d(i,c)},d=(i,c)=>{let o=0;for(const h of i.children)Q(h)||(u(h,c?`${c}/${o}`:`${o}`),o++)};return d(n,""),t&&(e.set(M,t),r++),{byId:e,count:r,meshes:s,lights:f}}function Z(n){const t=k(n,"authoringSubject");return t&&typeof t.label=="string"&&typeof t.kind=="string"?t:null}function X(n){const t=k(n,"reflectionProbe");if(!t||typeof t!="object")return null;const e=t;return e.config&&typeof e.recapture=="function"&&typeof e.getSnapshot=="function"?t:null}let D=null;function ht(n){D=n,W(n?.editorControls??null)}function tt(){return D}function C(n){return n.depthWrite===!1&&n.side===U}function et(n){const t=n.material;return t?Array.isArray(t)?t.length>0&&t.every(C):C(t):!1}function L(n,t,e,r=()=>!1,s){const f=tt();if(!f)return[];const u=f.canvas.getBoundingClientRect();if(u.width<=0||u.height<=0||!Number.isFinite(t)||!Number.isFinite(e)||t<u.left||e<u.top||t>=u.left+u.width||e>=u.top+u.height)return[];const d=new z((t-u.left)/u.width*2-1,-((e-u.top)/u.height)*2+1),i=new G;i.layers.enableAll(),i.setFromCamera(d,f.camera);const c=new Set(s?.objects??n.objectMap.values()),o=[...c].filter(b=>{for(let I=b.parent;I;I=I.parent)if(c.has(I))return!1;return!0});for(const b of o)b.traverse(I=>{const m=I;m.isSkinnedMesh&&(m.boundingBox=null,m.boundingSphere=null)});const h=i.intersectObjects(o,!0),p=[],v=new Set;for(const b of h){if(V(b.object)||et(b.object))continue;let I=b.object,m=null;if(s)for(;I&&m===null;)m=s.idForObject3D(I),I=I.parent;else{const a=K(I);m=a?$(a)??null:null}m!==null&&!r(m)&&!v.has(m)&&(v.add(m),p.push(m))}return nt(p,o,h.length,t,e),p}function nt(n,t,e,r,s){n.length>0||r===0&&s===0||console.info(`[viewport-pick] click selected nothing (candidates ${t.length}, rayHits ${e}, resolvedIds 0)`)}function st(n,t,e,r=()=>!1,s){return L(n,t,e,r,s)[0]??null}const R={count:0,meshes:0,lights:0,instancedMeshes:0,instances:0};let x=0;function H(n){let t=0,e=0;for(const r of n.values()){const s=r.object;s.isInstancedMesh&&(t++,e+=typeof s.count=="number"?s.count:0)}return{instancedMeshes:t,instances:e}}function F(n){let t=0,e=0;for(const r of n.values()){const s=r.object;s.isLight?e++:s.isMesh&&t++}return{count:n.size,meshes:t,lights:e,...H(n)}}function T(n,t){const e=new Map,r=[],s=t.skip??P;t.begin?.(n);const f=(u,d,i,c)=>{if(s(u))return;const o=t.identify(u,{path:d,ownerId:i,ownedByAncestor:c});o!==null&&(A(u,o),e.set(o,{object:u,id:o,parentId:i,childIds:[]}),i===null?r.push(o):e.get(i)?.childIds.push(o));const h=c||o!==null;u.children.forEach((p,v)=>{f(p,[...d,v],o??i,h)}),t.leave?.(u,o)};return n.children.forEach((u,d)=>{f(u,[d],null,!1)}),{nodes:e,rootIds:r,stats:F(e)}}const it="r3f:";function O(n,t){return`${it}${n}:${t}`}function rt(n){const t=new Map,e=new Map,r=(d,i)=>d===i||d.startsWith(`${i}#`)&&/^\d+$/u.test(d.slice(i.length+1)),s=d=>{e.clear();const i=c=>{if(P(c))return;const o=E(c),h=$(c);if(o!==void 0&&h!==void 0){const p=O(n,o);r(h,p)&&!e.has(h)&&e.set(h,c)}for(const p of c.children)i(p)};for(const c of d.children)i(c)},f=(d,i)=>{const c=$(d);if(c===void 0||i===void 0)return c;const o=O(n,i);return r(c,o)?e.get(c)===d?c:void 0:c},u=(d,i)=>{const c=O(n,i);let o=t.get(i)??0,h=S(c,o);for(;e.has(h);)o+=1,h=S(c,o);return t.set(i,o+1),e.set(h,d),h};return{begin:d=>{t.clear(),s(d)},identify:(d,i)=>{const c=E(d),o=f(d,c);if(o!==void 0)return o;const h=c===void 0?void 0:u(d,c);return h!==void 0||!i.ownedByAncestor||k(d,"authoringRoot")===!0?h??`live:${n}:${x++}`:null}}}function N(n,t){return T(n,rt(t))}function pt(n,t){const{nodes:e}=N(n,t),r=new Map;for(const[s,f]of e)r.set(s,f.object);return r}function yt(n,t={}){const e=t.camera;return{incremental:{kind:"live-oid",worldId:n},project:r=>{const s=N(r,n);return!e||[...s.nodes.values()].some(f=>f.object===e)?s:(A(e,M),s.nodes.set(M,{object:e,id:M,parentId:null,childIds:[]}),s.rootIds.push(M),{...s,stats:{...s.stats,count:s.nodes.size}})}}}function gt(n={}){const t=n.camera;return{project:e=>{const r=Y(e,t),s=new Map;for(const[d,i]of r.byId)s.set(i,d);const f=new Map,u=[];for(const[d,i]of r.byId){const c=i.parent,o=(c&&c!==e?s.get(c):void 0)??null,h=i.children.map(p=>s.get(p)).filter(p=>p!==void 0);f.set(d,{object:i,id:d,parentId:o,childIds:h}),o===null&&u.push(d)}return{nodes:f,rootIds:u,stats:{count:r.count,meshes:r.meshes,lights:r.lights,...H(f)}}}}}function It(n){let t=new Map,e=new Map;return{get instanceRoots(){return t},get representatives(){return e},project:r=>{const s=new Map,f=new Map,u=new Map,d=new Set,i=new Map,c=T(r,{identify:(o,h)=>{const p=E(o);if(p===void 0)return O(n,`@${h.path.join(".")}`);const v=s.get(p)??0;return s.set(p,v+1),v===0&&u.set(p,o),d.has(p)||(f.set(p,(f.get(p)??0)+1),d.add(p),i.set(o,p)),S(O(n,p),v)},leave:o=>{const h=i.get(o);h!==void 0&&(d.delete(h),i.delete(o))}});return t=f,e=u,c}}}function mt(n){return{project:t=>T(t,{skip:e=>!!k(e,"editorHelper")||e.isSkeletonHelper===!0,identify:(e,r)=>`source-object:${n}:${r.path.join(".")}`})}}function vt(n){const t=Z(n);return t?t.kind:q(n).length>0?"constraint-owner":X(n)?"reflection-probe":n.isSkinnedMesh?"skinned-mesh":n.isBone?"bone":n.isLight?"light":n.isCamera?"camera":n.type==="Audio"||n.type==="PositionalAudio"||n.type==="AudioListener"?"audio":n.isMesh?"mesh":n.children.length>0?"group":"object"}function ot(n,t){for(let e=n.parent;e!==null;e=e.parent)if(e===t)return!0;return!1}function _(n,t){if(n===t)return!0;for(let e=n.parent;e!==null;e=e.parent)if(e===t)return!0;return!1}class wt{constructor(t,e={}){this.identity=t,this.options=e}nodesById=new Map;objectsById=new Map;idsByObjectIndex=new Map;roots=[];walkStats=R;project(t){if(!t)return this.nodesById=new Map,this.objectsById=new Map,this.idsByObjectIndex=new Map,this.roots=[],this.walkStats=R,this.walkStats;const{nodes:e,rootIds:r,stats:s}=this.identity.project(t);return this.nodesById=e,this.objectsById=new Map([...e].map(([f,u])=>[f,u.object])),this.idsByObjectIndex=new Map([...e].map(([f,u])=>[u.object,f])),this.roots=r,this.walkStats=s,s}projectSubtrees(t,e){const r=this.identity.incremental;if(t===null||r?.kind!=="live-oid")return null;const s=e.filter((a,l)=>e.indexOf(a)===l&&!e.some(y=>y!==a&&ot(a,y))),f=this.roots,u=new Set,d=new Set,i=new Set;for(const a of s)a.traverse(l=>{const y=this.idsByObjectIndex.get(l);if(y===void 0)return;const g=this.nodesById.get(y);g?.parentId!==null&&g?.parentId!==void 0&&i.add(g.parentId),u.add(y),this.nodesById.delete(y),this.objectsById.delete(y),this.idsByObjectIndex.delete(l)});const c=P,o=(a,l)=>{const y=this.objectsById.get(a);return y===void 0||y===l},h=(a,l)=>{const y=$(a);if(y!==void 0&&o(y,a))return y;const g=E(a);if(g!==void 0){const w=O(r.worldId,g);let B=0,j=S(w,B);for(;!o(j,a);)j=S(w,++B);return j}if(!l||k(a,"authoringRoot")===!0){let w=`live:${r.worldId}:${x++}`;for(;!o(w,a);)w=`live:${r.worldId}:${x++}`;return w}return null},p=(a,l,y)=>{if(c(a))return;const g=h(a,y);g!==null&&(A(a,g),this.nodesById.set(g,{object:a,id:g,parentId:l,childIds:[]}),this.objectsById.set(g,a),this.idsByObjectIndex.set(a,g),d.add(g),l!==null&&i.add(l));const w=g??l,B=y||g!==null;for(const j of a.children)p(j,w,B)};for(const a of s){if(!_(a,t))continue;let l=a.parent,y=null;for(;l!==null&&l!==t;){const g=this.idsByObjectIndex.get(l);if(g!==void 0){y=g;break}l=l.parent}p(a,y,y!==null)}const v=a=>{const l=[],y=g=>{if(c(g))return;const w=this.idsByObjectIndex.get(g);if(w!==void 0){l.push(w);return}for(const B of g.children)y(B)};for(const g of a.children)y(g);return l};for(const a of i){const l=this.nodesById.get(a);l!==void 0&&l.childIds.splice(0,l.childIds.length,...v(l.object))}for(const a of d){const l=this.nodesById.get(a);l!==void 0&&l.childIds.splice(0,l.childIds.length,...v(l.object))}const b=v(t),I=this.roots.filter(a=>{const l=this.objectsById.get(a);return l!==void 0&&!_(l,t)&&!u.has(a)});this.roots=[...b,...I],this.walkStats=F(this.nodesById);const m=f.length!==this.roots.length||f.some((a,l)=>a!==this.roots[l]);return{removedIds:u,addedIds:d,changedParentIds:i,rootsChanged:m}}get nodes(){return this.nodesById}get objects(){return this.objectsById}get idsByObject(){return this.idsByObjectIndex}get rootIds(){return this.roots}get stats(){return this.walkStats}node(t){return this.nodesById.get(t)??null}rootNodes(){return this.roots.map(t=>this.nodesById.get(t)).filter(t=>t!==void 0)}objectOf(t){return this.objectsById.get(t)??null}idOf(t){return this.idsByObjectIndex.get(t)??null}childIdsOf(t){const e=[];for(const r of t){const s=this.idsByObjectIndex.get(r);s!==void 0&&e.push(s)}return e}objectMapSnapshot(){return new Map(this.objectsById)}pick(t,e,r,s){return st(t,e,r,s,this.pickProjection())}candidates(t,e,r,s){return L(t,e,r,s,this.pickProjection())}pickProjection(){if(this.options.pickScope!=="store-object-map")return{objects:this.objectsById.values(),idForObject3D:t=>this.idOf(t)}}}export{wt as T,yt as a,gt as b,It as c,mt as d,q as e,ht as f,vt as n,Z as o,X as r,pt as s};
@@ -1 +1 @@
1
- import{dr as c,ds as u,dt as l,du as f,dv as m}from"./index-BJUzb-B4.js";function g(t,r){if(t.setTransformMode(r),r==="select")return;const n=[...t.selectedEntityIds];if(n.length===0)return;const s=c(t),a=((s===null?null:u(s)?.adapter)??l(t).adapter).transforms?.editability;if(!a)return;let e;for(const i of n){const o=f(d=>a(i,d));if(!o.locked)return;e??=o.reason}e&&m(e)}export{g as r};
1
+ import{dr as c,ds as u,dt as l,du as f,dv as m}from"./index-C5cL2IUJ.js";function g(t,r){if(t.setTransformMode(r),r==="select")return;const n=[...t.selectedEntityIds];if(n.length===0)return;const s=c(t),a=((s===null?null:u(s)?.adapter)??l(t).adapter).transforms?.editability;if(!a)return;let e;for(const i of n){const o=f(d=>a(i,d));if(!o.locked)return;e??=o.reason}e&&m(e)}export{g as r};
@@ -1 +1 @@
1
- import{a as l}from"./jsx-runtime-DPjLkJKQ.js";import{r as c}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{al as b,aM as v,a7 as x,a8 as r,aN as j,aL as i}from"./index-BJUzb-B4.js";const S=[.25,.5,1,2];function y(a,s){const t=Math.round(a*s);return`${a.toFixed(2)}s · f${t}`}function E({transport:a}){const s=c.useSyncExternalStore(c.useCallback(e=>a?a.subscribe(e):()=>{},[a]),c.useCallback(()=>a?.snapshot()??null,[a]));if(!a||!s||s.activeSubject===null)return null;const t=s.driver==="world",n=s.playbackState==="playing",{start:h,end:m,fps:o,loop:g}=s.range,d=s.subjects.find(e=>e.id===s.activeSubject),p=s.subjects.length>1?s.subjects:null,u=a.activeClips();return l.jsxs("section",{"aria-label":"Transport","data-testid":"stage-transport-strip",style:{display:"flex",alignItems:"center",gap:"var(--volter-space-2)",padding:"var(--volter-space-1) var(--volter-space-3)",borderTop:`var(--volter-stroke-resting) solid ${b.boundary.default}`,background:b.surface.raised},children:[l.jsx(v,{size:"compact","aria-label":n?"Pause":"Play",disabled:t,onClick:()=>n?a.pause():a.play(),children:l.jsx(x,{icon:n?r.transport.pause:r.transport.play})}),l.jsx(v,{size:"compact","aria-label":"Stop",disabled:t,onClick:()=>a.stop(),children:l.jsx(x,{icon:r.transport.stop})}),l.jsx(j,{"aria-label":"Playhead",type:"range",min:h,max:m,step:1/o,value:s.time,disabled:t,onChange:e=>a.seek(Number(e.target.value)),style:{flex:1}}),l.jsx(i,{as:"span",variant:"caption",children:y(s.time,o)}),p?l.jsx("select",{"aria-label":"Subject",value:s.activeSubject,disabled:t,onChange:e=>a.setActiveSubject(e.target.value),children:p.map(e=>l.jsx("option",{value:e.id,children:e.label},e.id))}):null,u?l.jsx("select",{"aria-label":"Clip",disabled:t,onChange:e=>a.setActiveClip(e.target.value),children:u.map(e=>l.jsx("option",{value:e.id,children:e.label},e.id))}):null,l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"var(--volter-space-1)"},children:[l.jsx("input",{type:"checkbox",checked:g,disabled:t,onChange:e=>a.setLoop(e.target.checked)}),l.jsx(i,{as:"span",variant:"caption",children:"Loop"})]}),l.jsx("select",{"aria-label":"Speed",value:String(s.timeScale),disabled:t,onChange:e=>a.setTimeScale(Number(e.target.value)),children:S.map(e=>l.jsxs("option",{value:String(e),children:[e,"×"]},e))}),t?l.jsx(i,{as:"span",variant:"caption",children:"The world is driving time (Play); pause the game to scrub"}):d?l.jsx(i,{as:"span",variant:"caption",children:d.label}):null]})}export{E as T};
1
+ import{a as l}from"./jsx-runtime-DPjLkJKQ.js";import{r as c}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{al as b,aM as v,a7 as x,a8 as r,aN as j,aL as i}from"./index-C5cL2IUJ.js";const S=[.25,.5,1,2];function y(a,s){const t=Math.round(a*s);return`${a.toFixed(2)}s · f${t}`}function E({transport:a}){const s=c.useSyncExternalStore(c.useCallback(e=>a?a.subscribe(e):()=>{},[a]),c.useCallback(()=>a?.snapshot()??null,[a]));if(!a||!s||s.activeSubject===null)return null;const t=s.driver==="world",n=s.playbackState==="playing",{start:h,end:m,fps:o,loop:g}=s.range,d=s.subjects.find(e=>e.id===s.activeSubject),p=s.subjects.length>1?s.subjects:null,u=a.activeClips();return l.jsxs("section",{"aria-label":"Transport","data-testid":"stage-transport-strip",style:{display:"flex",alignItems:"center",gap:"var(--volter-space-2)",padding:"var(--volter-space-1) var(--volter-space-3)",borderTop:`var(--volter-stroke-resting) solid ${b.boundary.default}`,background:b.surface.raised},children:[l.jsx(v,{size:"compact","aria-label":n?"Pause":"Play",disabled:t,onClick:()=>n?a.pause():a.play(),children:l.jsx(x,{icon:n?r.transport.pause:r.transport.play})}),l.jsx(v,{size:"compact","aria-label":"Stop",disabled:t,onClick:()=>a.stop(),children:l.jsx(x,{icon:r.transport.stop})}),l.jsx(j,{"aria-label":"Playhead",type:"range",min:h,max:m,step:1/o,value:s.time,disabled:t,onChange:e=>a.seek(Number(e.target.value)),style:{flex:1}}),l.jsx(i,{as:"span",variant:"caption",children:y(s.time,o)}),p?l.jsx("select",{"aria-label":"Subject",value:s.activeSubject,disabled:t,onChange:e=>a.setActiveSubject(e.target.value),children:p.map(e=>l.jsx("option",{value:e.id,children:e.label},e.id))}):null,u?l.jsx("select",{"aria-label":"Clip",disabled:t,onChange:e=>a.setActiveClip(e.target.value),children:u.map(e=>l.jsx("option",{value:e.id,children:e.label},e.id))}):null,l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"var(--volter-space-1)"},children:[l.jsx("input",{type:"checkbox",checked:g,disabled:t,onChange:e=>a.setLoop(e.target.checked)}),l.jsx(i,{as:"span",variant:"caption",children:"Loop"})]}),l.jsx("select",{"aria-label":"Speed",value:String(s.timeScale),disabled:t,onChange:e=>a.setTimeScale(Number(e.target.value)),children:S.map(e=>l.jsxs("option",{value:String(e),children:[e,"×"]},e))}),t?l.jsx(i,{as:"span",variant:"caption",children:"The world is driving time (Play); pause the game to scrub"}):d?l.jsx(i,{as:"span",variant:"caption",children:d.label}):null]})}export{E as T};
@@ -0,0 +1 @@
1
+ import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{r as t}from"./index-C5cL2IUJ.js";import{r as m}from"./index-nmcBqr7Y.js";import{P as p}from"./PlayBar-MxWuZDbI.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./configurations-CUnfG7ZO.js";import"./run-selection-D-MXhzyH.js";import"./game-network-CBHt-_DV.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-BcCIQlpj.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-DZXSvvn0.js";import"./contract-system-adapters-BTeuY0Wz.js";import"./game-contract-seams-leXTqnUS.js";import"./seeded-random-31t3Hhi7.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-Xdg6cat1.js";import"./capability-coverage-D1AjR_LI.js";import"./edit-mode-authoring-Ch6v9PnO.js";import"./json-history-resource-DS16aq7M.js";import"./binding-resolver-B1NT5eZp.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CqGTAk9D.js";import"./canvas-entry-runtime-D4UUWHHS.js";import"./three-ingest-runtime-C2ruwAa_.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-_WDvM24r.js";import"./ingest-source-persistence-CCGS4Nxy.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DBSTTcWY.js";import"./mounted-authoring-D3ZR7cVq.js";import"./entity-object-BpsV3ox5.js";import"./user-data-BYUf0wLn.js";import"./workspace-arrangement-Bx5PVUVK.js";import"./three-contract-Dkt6PmWY.js";import"./three-z0dIVVct.js";import"./editor-layers-DJwy9H_k.js";import"./component-instance-root-BVjTH0AO.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BEDQRs2B.js";import"./source-persistence-backend-Mw40F3bc.js";import"./three-projection-core-BAO-45fo.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-uhCRHed5.js";import"./deferred-ingest-play-DtbBSsch.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CJSmvs_1.js";import"./board-guides-DLC77TC2.js";import"./relative-import-specifier-OJ1nkBV9.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-Czr75mkK.js";import"./inference-diagnostics-BI3pXsTw.js";import"./writer-tw6EcuVO.js";import"./three-state-CouynZOV.js";import"./editor-shell-store-B87W2cjm.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-_El1wx2N.js";import"./game-surface-defaults-D8S4cRxi.js";const Dr="workspace.header",Fr=0;function Gr(){const{project:r}=t();return m.useSyncExternalStore(r.subscribe,r.mounts,r.mounts)?o.jsx(p,{}):null}export{Gr as default,Fr as order,Dr as point};
@@ -1 +1 @@
1
- import{e2 as e,c6 as o,u as r}from"./index-BJUzb-B4.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 t=e([o(),o(),o()]).describe("3D vector as [x, y, z]"),i=e([o(),o(),o(),o()]).describe("Quaternion as [x, y, z, w]"),u=r({position:t.optional().describe("World-space position [x, y, z]"),rotation:i.optional().describe("Rotation quaternion [x, y, z, w]"),scale:t.optional().describe("Scale factor per axis [x, y, z]. Defaults to [1, 1, 1]")}).describe("Local transform relative to parent entity");export{i as QuatSchema,u as TransformSchema,t as Vec3Schema};
1
+ import{e2 as e,c6 as o,u as r}from"./index-C5cL2IUJ.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 t=e([o(),o(),o()]).describe("3D vector as [x, y, z]"),i=e([o(),o(),o(),o()]).describe("Quaternion as [x, y, z, w]"),u=r({position:t.optional().describe("World-space position [x, y, z]"),rotation:i.optional().describe("Rotation quaternion [x, y, z, w]"),scale:t.optional().describe("Scale factor per axis [x, y, z]. Defaults to [1, 1, 1]")}).describe("Local transform relative to parent entity");export{i as QuatSchema,u as TransformSchema,t as Vec3Schema};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-capture-CutvrNfq.js","assets/react-story-board-BOsvNV8b.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-BJUzb-B4.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/bitmap-label-Ct4k6ehY.js","assets/StoryPreviewMount-CIYRIX82.js","assets/story-presentation-DQuPoeTD.js"])))=>i.map(i=>d[i]);
2
- import{dK as s,as as m,dL as p,aC as n,_ as c,ba as d}from"./index-BJUzb-B4.js";import{a as u}from"./jsx-runtime-DPjLkJKQ.js";import{d as l,p as v,r as P}from"./design-time-layers-CHkfJxfx.js";import{RootDocumentContent as _}from"./world-documents-CpOamXhu.js";import{U as w}from"./component-board.service-8jvudtjT.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./root-stacking-BEd9ZvxC.js";import"./edit-mode-authoring-DTqQCASO.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./react-story-board-BOsvNV8b.js";import"./game-surface-defaults-D8S4cRxi.js";import"./react-canvas-navigation-SO8CyICB.js";import"./component-board-registry-DrIa2csL.js";import"./surface-state-C_1um-Wp.js";import"./board-guides-Dz0A1_-b.js";import"./CanvasSceneViewport-Cgblv27V.js";import"./RootSelectionOverlay-5La9--nb.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-BYnMPvYe.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-k-9pRW-H.js";import"./inference-diagnostics-wOrQB5Rh.js";import"./Toolbar-RWmWORSC.js";import"./transform-mode-request-BebirGMs.js";import"./TransientHint-BX8vPTJO.js";import"./ReactCanvasControls-B6jRxIe_.js";import"./story-media-presence-BN3dVJDv.js";const y={revision:()=>JSON.stringify(d().map(({id:i,modulePath:t})=>[i,t])),subscribe:m,capture:async({width:i,height:t})=>{const{captureDomStoryBoardPreview:o}=await c(async()=>{const{captureDomStoryBoardPreview:e}=await import("./story-capture-CutvrNfq.js");return{captureDomStoryBoardPreview:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]));return o(i,t)}};function Z({store:i,composite:t}){const o=l(t).find(r=>r.kind==="dom")??v(),e=r=>u.jsx(_,{...r,composite:t,descriptor:o,store:i});s({id:p,title:w,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:o.worldId,...o.path?{sourcePath:o.path}:{}},Content:e,preview:y,presentation:()=>{const r=n()?.rootPath,a=r?P(r,o.worldId):void 0;return{kind:"workspace",id:p,...a?{story:a}:{}}}},{category:"canvas",default:!t.childAdapters().some(r=>r.kind==="three"||r.kind==="canvas")})}export{Z as installUiBoard};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-capture-yOsfM7Wp.js","assets/react-story-board-D2pwwUUp.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-C5cL2IUJ.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/bitmap-label-Ct4k6ehY.js","assets/StoryPreviewMount-DvSkOR4Z.js","assets/story-presentation-fpxUtjMs.js"])))=>i.map(i=>d[i]);
2
+ import{dK as s,as as m,dL as p,aC as n,_ as c,ba as d}from"./index-C5cL2IUJ.js";import{a as u}from"./jsx-runtime-DPjLkJKQ.js";import{d as l,p as v,r as P}from"./design-time-layers-DSk4tElq.js";import{RootDocumentContent as _}from"./world-documents-BOMYFyua.js";import{U as w}from"./component-board.service-kpvKo8AX.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./root-stacking-BEd9ZvxC.js";import"./edit-mode-authoring-Ch6v9PnO.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./react-story-board-D2pwwUUp.js";import"./game-surface-defaults-D8S4cRxi.js";import"./react-canvas-navigation-Awf5f-km.js";import"./component-board-registry-DrIa2csL.js";import"./surface-state-DeXIPWuS.js";import"./board-guides-DLC77TC2.js";import"./CanvasSceneViewport-CEXxZv3P.js";import"./RootSelectionOverlay-DYanTBYE.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-6TWdZ7gI.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-Czr75mkK.js";import"./inference-diagnostics-BI3pXsTw.js";import"./Toolbar-BfhP5BUg.js";import"./transform-mode-request-BEHHgfb9.js";import"./TransientHint-Byhdm3Od.js";import"./ReactCanvasControls-DeKZZILw.js";import"./story-media-presence-PjJsx64u.js";const y={revision:()=>JSON.stringify(d().map(({id:i,modulePath:t})=>[i,t])),subscribe:m,capture:async({width:i,height:t})=>{const{captureDomStoryBoardPreview:o}=await c(async()=>{const{captureDomStoryBoardPreview:e}=await import("./story-capture-yOsfM7Wp.js");return{captureDomStoryBoardPreview:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]));return o(i,t)}};function Z({store:i,composite:t}){const o=l(t).find(r=>r.kind==="dom")??v(),e=r=>u.jsx(_,{...r,composite:t,descriptor:o,store:i});s({id:p,title:w,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:o.worldId,...o.path?{sourcePath:o.path}:{}},Content:e,preview:y,presentation:()=>{const r=n()?.rootPath,a=r?P(r,o.worldId):void 0;return{kind:"workspace",id:p,...a?{story:a}:{}}}},{category:"canvas",default:!t.childAdapters().some(r=>r.kind==="three"||r.kind==="canvas")})}export{Z as installUiBoard};
@@ -1 +1 @@
1
- import{O as n}from"./workspace-arrangement-B8dQHuWm.js";const r={...n,entityId:"entityId",forward:"forward",tags:"tags",attributes:"attributes",navRole:"navRole",pivot:"pivot",splineCurve:"splineCurve",splineControlPoint:"splineControlPoint",_camera:"_camera",_particleSystem:"_particleSystem",gaussianSplat:"gaussianSplat",__sharedGeometry:"__sharedGeometry",__shadeOrig:"__shadeOrig",__shadeUnlit:"__shadeUnlit",__ingest:"__ingest",__ingestNextId:"__ingestNextId",authoringRoot:"authoringRoot",authoringInstance:"authoringInstance",authoringLabel:"authoringLabel",authoringComponent:"authoringComponent",authoringDocument:"authoringDocument",authoringHierarchyId:"authoringHierarchyId",authoringHierarchyParentId:"authoringHierarchyParentId",authoringHierarchyOrder:"authoringHierarchyOrder",editorIcon:"editorIcon",envObject:"envObject",constraints:"constraints",authoringSubject:"authoringSubject",reflectionProbe:"reflectionProbe",triggerVolume:"triggerVolume",vcDirIdx:"vcDirIdx"};function o(t,e){return t?t.userData[r[e]]:void 0}function s(t,e,a){t.userData[r[e]]=a}function u(t,e){return t?t.userData[r[e]]!==void 0:!1}export{o as g,u as h,s};
1
+ import{O as n}from"./workspace-arrangement-Bx5PVUVK.js";const r={...n,entityId:"entityId",forward:"forward",tags:"tags",attributes:"attributes",navRole:"navRole",pivot:"pivot",splineCurve:"splineCurve",splineControlPoint:"splineControlPoint",_camera:"_camera",_particleSystem:"_particleSystem",gaussianSplat:"gaussianSplat",__sharedGeometry:"__sharedGeometry",__shadeOrig:"__shadeOrig",__shadeUnlit:"__shadeUnlit",__ingest:"__ingest",__ingestNextId:"__ingestNextId",authoringRoot:"authoringRoot",authoringInstance:"authoringInstance",authoringLabel:"authoringLabel",authoringComponent:"authoringComponent",authoringDocument:"authoringDocument",authoringHierarchyId:"authoringHierarchyId",authoringHierarchyParentId:"authoringHierarchyParentId",authoringHierarchyOrder:"authoringHierarchyOrder",editorIcon:"editorIcon",envObject:"envObject",constraints:"constraints",authoringSubject:"authoringSubject",reflectionProbe:"reflectionProbe",triggerVolume:"triggerVolume",vcDirIdx:"vcDirIdx"};function o(t,e){return t?t.userData[r[e]]:void 0}function s(t,e,a){t.userData[r[e]]=a}function u(t,e){return t?t.userData[r[e]]!==void 0:!1}export{o as g,u as h,s};
@@ -1 +1 @@
1
- import{aa as l}from"./index-BJUzb-B4.js";function a(c,i){let t=i,s=0;const r=new Set,o=()=>{s++;for(const e of r)e()},n=e=>{t!==e&&(t=e,o())};return{subscribe(e){return r.add(e),()=>{r.delete(e)}},version:()=>s,active:()=>t,select:n,open(e){n(e),l(c)},notify:o,reset(){t=i,o()}}}const p=a("tool:profiler.utility","profiler");export{p};
1
+ import{aa as l}from"./index-C5cL2IUJ.js";function a(c,i){let t=i,s=0;const r=new Set,o=()=>{s++;for(const e of r)e()},n=e=>{t!==e&&(t=e,o())};return{subscribe(e){return r.add(e),()=>{r.delete(e)}},version:()=>s,active:()=>t,select:n,open(e){n(e),l(c)},notify:o,reset(){t=i,o()}}}const p=a("tool:profiler.utility","profiler");export{p};
@@ -1 +1 @@
1
- import{y as w}from"./index-BJUzb-B4.js";const s=new Map,f=new Map;function g(e){let t=f.get(e);return t||(t={frameListeners:new Set,helpers:new Map},f.set(e,t)),t}const l=new Set,c=new Set;function i(){for(const t of s.values())if(t.presenting)return t;const e=w();if(e!==null){const t=s.get(e);if(t)return t}return s.values().next().value??null}let a=null;function p(){a=null;const e=v();for(const t of c)t(e)}function h(e,t){const n=g(e);return{documentId:e,rig:()=>s.get(e)?.rig??t,setHelper:(r,o)=>{n.helpers.set(r,o),s.get(e)?.setHelper(r,o)},onFrame:r=>(n.frameListeners.add(r),()=>{n.frameListeners.delete(r)})}}function S(e,t,n,r){const o=g(r.documentId),u={documentId:r.documentId,rig:e,present:t,setHelper:n,frameListeners:o.frameListeners,helpers:o.helpers,presenting:!1};s.set(r.documentId,u);for(const[d,m]of u.helpers)n(d,m);return p(),()=>{s.get(r.documentId)===u&&(s.delete(r.documentId),p())}}function I(e,t){const n=i();n&&(n.helpers.set(e,t),n.setHelper(e,t))}function V(){return i()?.rig??null}function y(e){const t=i();if(!t)return null;const n=t.present(e);if(!n)return null;t.presenting=!0;let r=!1;return{worldId:n.worldId,dispose:()=>{r||(r=!0,t.presenting=!1),n.dispose()}}}function F(e){return l.add(e),()=>{l.delete(e)}}function v(){return a||(a=[...s.values()].map(e=>h(e.documentId,e.rig))),a}function H(e){const t=f.get(e);return t?[...t.helpers].filter(([,n])=>n!==null).map(([n])=>n):[]}function b(e){return c.add(e),()=>{c.delete(e)}}function x(e,t){const n=s.get(e);if(n){for(const r of n.frameListeners)r(t);if(i()===n)for(const r of l)r(t)}}export{V as a,v as b,S as c,F as d,b as o,y as p,x as r,I as s,H as v};
1
+ import{y as w}from"./index-C5cL2IUJ.js";const s=new Map,f=new Map;function g(e){let t=f.get(e);return t||(t={frameListeners:new Set,helpers:new Map},f.set(e,t)),t}const l=new Set,c=new Set;function i(){for(const t of s.values())if(t.presenting)return t;const e=w();if(e!==null){const t=s.get(e);if(t)return t}return s.values().next().value??null}let a=null;function p(){a=null;const e=v();for(const t of c)t(e)}function h(e,t){const n=g(e);return{documentId:e,rig:()=>s.get(e)?.rig??t,setHelper:(r,o)=>{n.helpers.set(r,o),s.get(e)?.setHelper(r,o)},onFrame:r=>(n.frameListeners.add(r),()=>{n.frameListeners.delete(r)})}}function S(e,t,n,r){const o=g(r.documentId),u={documentId:r.documentId,rig:e,present:t,setHelper:n,frameListeners:o.frameListeners,helpers:o.helpers,presenting:!1};s.set(r.documentId,u);for(const[d,m]of u.helpers)n(d,m);return p(),()=>{s.get(r.documentId)===u&&(s.delete(r.documentId),p())}}function I(e,t){const n=i();n&&(n.helpers.set(e,t),n.setHelper(e,t))}function V(){return i()?.rig??null}function y(e){const t=i();if(!t)return null;const n=t.present(e);if(!n)return null;t.presenting=!0;let r=!1;return{worldId:n.worldId,dispose:()=>{r||(r=!0,t.presenting=!1),n.dispose()}}}function F(e){return l.add(e),()=>{l.delete(e)}}function v(){return a||(a=[...s.values()].map(e=>h(e.documentId,e.rig))),a}function H(e){const t=f.get(e);return t?[...t.helpers].filter(([,n])=>n!==null).map(([n])=>n):[]}function b(e){return c.add(e),()=>{c.delete(e)}}function x(e,t){const n=s.get(e);if(n){for(const r of n.frameListeners)r(t);if(i()===n)for(const r of l)r(t)}}export{V as a,v as b,S as c,F as d,b as o,y as p,x as r,I as s,H as v};
@@ -1 +1 @@
1
- import{s}from"./mounted-authoring-BM-WDzvM.js";import{s as u}from"./three-CNJ_R-VX.js";import{t as m}from"./three-contract-Dkt6PmWY.js";function c(t,d){const e=d.find(i=>i.mounted.kind==="three");if(!e||e.mounted.kind!=="three")return null;const n=m(e.mounted).scene,o=e.mounted.authoring;o&&s(n,o),u(n,a(e.id)),t.enterPlayScene(n,e.mounted.rendererConfig);let r=!1;return{worldId:e.id,dispose(){r||(r=!0,t.releaseAdoptedScene(n))}}}function a(t){return t??"main"}export{a as l,c as p};
1
+ import{s}from"./mounted-authoring-D3ZR7cVq.js";import{s as u}from"./three-z0dIVVct.js";import{t as m}from"./three-contract-Dkt6PmWY.js";function c(t,d){const e=d.find(i=>i.mounted.kind==="three");if(!e||e.mounted.kind!=="three")return null;const n=m(e.mounted).scene,o=e.mounted.authoring;o&&s(n,o),u(n,a(e.id)),t.enterPlayScene(n,e.mounted.rendererConfig);let r=!1;return{worldId:e.id,dispose(){r||(r=!0,t.releaseAdoptedScene(n))}}}function a(t){return t??"main"}export{a as l,c as p};
@@ -1 +1 @@
1
- import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{al as i}from"./index-BJUzb-B4.js";const m="Preparing the viewport…",n="Preparing 3D component previews…";function c(e){return!Number.isFinite(e)||e<1?n:e===1?"Preparing 1 component preview…":`Preparing ${e} component previews…`}function u({testId:e,children:t}){return r.jsx("div",{"data-testid":e,style:{position:"absolute",inset:0,padding:16,fontSize:12,color:i.content.muted,pointerEvents:"none"},children:t})}export{m as O,u as V,c as t};
1
+ import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{al as i}from"./index-C5cL2IUJ.js";const m="Preparing the viewport…",n="Preparing 3D component previews…";function c(e){return!Number.isFinite(e)||e<1?n:e===1?"Preparing 1 component preview…":`Preparing ${e} component previews…`}function u({testId:e,children:t}){return r.jsx("div",{"data-testid":e,style:{position:"absolute",inset:0,padding:16,fontSize:12,color:i.content.muted,pointerEvents:"none"},children:t})}export{m as O,u as V,c as t};
@@ -1 +1 @@
1
- import{e as t,d as i,f as r,g as m}from"./index-B988pIAV.js";import"./index-BJUzb-B4.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";t.add(i,r);t.add(m);
1
+ import{e as t,d as i,f as r,g as m}from"./index-D4HAbSY1.js";import"./index-C5cL2IUJ.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";t.add(i,r);t.add(m);
@@ -1,2 +1,2 @@
1
- const d="/work/.volter-session",ae=`${d}/session.py`,se=[`${d}/in`,`${d}/reply`],L="/__editor/blender-wasm";function ie(e){return e.startsWith("@@VOLTER-ERROR")?"error":e.startsWith("@@VOLTER-WARN")?"warn":"log"}function D(e){return new URL(`${L}/${e}`,import.meta.url).href}async function M(){const e=await fetch(D("status"));return e.ok?await e.json():{available:!1,skew:null,dir:null,sizes:{},encoded:{},missing:[`${L}/status answered ${e.status}`]}}async function W(e){const t=await M();if(!t.available)throw new Error(`The headless Blender WebAssembly build is not served by this editor: ${t.missing.join("; ")}`);if(t.skew==="wali"){const{startWaliBlenderEngine:n}=await import("./blender-wali-engine-uH9q2l3f.js");return n(e,t)}const{startEmscriptenBlenderEngine:r}=await import("./blender-emscripten-engine-CbHHZuUu.js");return r(e,t)}function J(e){return e<200?1:e<5e3?5:25}const U=e=>new Promise(t=>setTimeout(t,e)),B=new TextDecoder;function ce(e,t,r){let n=0,a=0;const o=new Set;async function s(u){for(const l of o)u.has(`${l}.done`)||(await e.unlink(`${d}/reply/${l}.json`),await e.unlink(`${d}/reply/${l}.done`),o.delete(l))}async function i(){let u;try{u=await e.readdir(`${d}/ask`)}catch{return}const l=new Set(u.filter(w=>w.endsWith(".done")));await s(l);for(const w of l){const h=w.slice(0,-5);if(Number(h)<=a)continue;a=Number(h);const $=JSON.parse(B.decode(await e.readFile(`${d}/ask/${h}.json`)));let p;try{p=await t.ask($)}catch(v){p={error:v instanceof Error?v.message:String(v)}}await Promise.all([e.writeFile(`${d}/reply/${h}.json`,JSON.stringify(p??null)),e.writeFile(`${d}/reply/${h}.done`,"1")]),o.add(h)}}async function c(u){const l=String(++n);await Promise.all([e.writeFile(`${d}/in/${l}.json`,JSON.stringify(u)),e.writeFile(`${d}/in/${l}.done`,"1")]);const w=performance.now();for(;;){if(await i(),await e.stat(`${d}/out/${l}.done`)){const p=JSON.parse(B.decode(await e.readFile(`${d}/out/${l}.json`)));if(await e.unlink(`${d}/in/${l}.json`),await e.unlink(`${d}/in/${l}.done`),p.error)throw new Error(p.error);return p.result}const h=r?.();if(h)throw new Error(`Blender is gone, so this call will never be answered: ${h}. The session keeps its directory and its cached banner, so every later call would wait on the same missing answer; start a new program with \`blender-start {fresh: true}\` (\`VOLTER_BLENDER_FRESH_SESSION=1\` for the battery harness).`);const $=J(performance.now()-w);await(e.changed?e.changed($):U($))}}return{request:c}}const I=e=>typeof e=="object"&&e!==null&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.dtype=="string"&&typeof e.count=="number"&&typeof e.stride=="number",C={f32:e=>new Float32Array(e.buffer,e.byteOffset,e.byteLength>>2),f64:e=>new Float64Array(e.buffer,e.byteOffset,e.byteLength>>3),u32:e=>new Uint32Array(e.buffer,e.byteOffset,e.byteLength>>2),i32:e=>new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u16:e=>new Uint16Array(e.buffer,e.byteOffset,e.byteLength>>1),i16:e=>new Int16Array(e.buffer,e.byteOffset,e.byteLength>>1),u8:e=>e,i8:e=>new Int8Array(e.buffer,e.byteOffset,e.byteLength)};function z(e,t,r){const n=C[r.dtype];if(!n)throw new Error(`Blender frame column ${t}: unknown dtype ${r.dtype}`);const{offset:a,length:o}=r;if(a<0||o<0||a+o>e.byteLength)throw new Error(`Blender frame column ${t}: bytes ${a}..${a+o} lie outside the ${e.byteLength}-byte export arena`);const s=e.subarray(a,a+o).slice(),i=n(s),c=r.count*r.stride;if(i.length!==c)throw new Error(`Blender frame column ${t}: ${i.length} values, ${c} declared (${r.count} x ${r.stride})`);return i}function V(e,t){const r=(n,a)=>{if(I(n)){const o=z(e,a,n);return a==="co"?Float64Array.from(o):o}if(Array.isArray(n))return n.map(o=>r(o,a));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=r(i,s);return o}return n};return r(t,"")}async function H(e,t){const r=async(n,a)=>{if(I(n)){const{offset:o,length:s,dtype:i}=n;if(o<0||s<0||o+s>e.byteLength)throw new Error(`Blender frame column ${a}: bytes ${o}..${o+s} lie outside the ${e.byteLength}-byte export arena`);const c=e.subarray(o,o+s).slice(),u=await crypto.subtle.digest("SHA-256",c),l=[...new Uint8Array(u)].map(w=>w.toString(16).padStart(2,"0")).join("");return{dtype:i,length:s,sha256:l}}if(Array.isArray(n))return Promise.all(n.map(o=>r(o,a)));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=await r(i,s);return o}return n};return r(t,"")}const m=e=>self.postMessage(e),k=(e,t)=>m({op:"log",level:e,text:t});let b=null,S=null,G=0;const j=new Map;function K(e,t,r){const n=++G,a=[],o=e;for(const s of[o?.meshes??{},o?.images??{}])for(const i of Object.values(s))for(const c of Object.values(i))ArrayBuffer.isView(c)&&c.buffer instanceof ArrayBuffer&&!a.includes(c.buffer)&&a.push(c.buffer);return new Promise((s,i)=>{j.set(n,{resolve:s,reject:i}),self.postMessage({op:"present",id:n,frame:e,description:t,...r?{capture:r}:{}},a)})}let f=null,E=null,T=!1,A=Promise.resolve();function Q(e){const t=A.then(e);return A=t.catch(()=>{}),t}function P(e){T=e,m({op:"document-dirty",dirty:e})}async function N(){if(!f||E===null)return;const e=E;let t;try{t=await f.request({op:"save-document"})}catch(n){throw new Error(`The Blender document ${e} could not be saved: ${g(n)}`)}if(!t?.saved||typeof t.path!="string")throw new Error(`Blender did not save the document ${e}`);let r;try{r=await f.files.readFile(t.path)}catch(n){throw new Error(`The Blender document ${e} could not be read back out of the engine: ${g(n)}`)}y.delete(t.path);try{const n=await fetch(`/__editor/blender-document?path=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([r])});if(!n.ok){const a=await n.text().catch(()=>"");throw new Error(`HTTP ${n.status} ${a}`)}}catch(n){throw new Error(`The Blender document ${e} was not written to the project: ${g(n)}`)}P(!1),k("log",`@@VOLTER-DOCUMENT ${JSON.stringify({path:e,bytes:r.length})}`)}async function X(e,t){const r={engine:null},n=await W({project:e,log:k,ask:async({frame:o,capture:s,saveDue:i})=>{if(!r.engine)throw new Error("The Blender session presented before it started");i&&E!==null&&P(!0);const c=await r.engine.readArena(),u=await H(c,o),l=await K(V(c,o),u,s);return{...typeof l.capture=="object"&&l.capture!==null?l.capture:{},..."held"in l?{held:l.held}:{}}}});r.engine=n,f=n,t&&await _(n.files,e);const a=await n.request({op:"start",project:e,...t?{document:t}:{}});return t&&(E=t),b={start:async()=>a,execute:async o=>{const s=await n.request({op:"execute",code:o});return s.error?`Error executing code: ${s.error}`:`Code executed successfully: ${s.result}`},sceneInfo:async()=>JSON.stringify(await n.request({op:"scene-info"}),null,2),objectInfo:async o=>JSON.stringify(await n.request({op:"object-info",name:o}),null,2),screenshotView:async o=>(await n.request({op:"present",capture:{size:o}}),JSON.stringify({view:{size:o}}))},{...a,engine:"blender-wasm",skew:n.skew,bootMs:Math.round(n.bootMs),releasedPayloadMB:n.releasedPayloadBytes===null?null:Math.round(n.releasedPayloadBytes/1048576)}}async function Y(){try{const e=await fetch("/__editor/blender-wasm/status");return e.ok?await e.json():{available:!1,missing:[`status answered ${e.status}`]}}catch(e){return{available:!1,missing:[String(e)]}}}async function Z(e,t){if(b)throw new Error("The Blender session is already started");if(!e.startsWith("/"))throw new Error("The Blender session needs the project's absolute path");if(t!==void 0&&!q(t))throw new Error(`The Blender document must be a project-relative .blend path with no traversal (models/model.blend); got ${JSON.stringify(t)}`);const r=await Y();if(!r.available)throw new Error(`Headless Blender is not served by this editor, so there is no modeling engine: ${r.missing.join("; ")}. The engine is Blender compiled to WebAssembly (packages/blender-engine/wasm, or the directory VOLTER_BLENDER_WASM_DIR names); nothing stands in for it.`);return S=e,X(e,t)}function q(e){return!e.endsWith(".blend")||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(r=>r!==""&&r!=="."&&r!=="..")}const x=new Set;function O(e){x.has(e)||(x.add(e),k("error",e))}async function ee(e){const t=s=>(O(`The project's files are not readable from Python: ${s}`),null);let r;try{r=await fetch("/__editor/blender-project-index")}catch(s){return t(String(s))}if(!r.ok)return t(`/__editor/blender-project-index answered ${r.status}`);let n;try{if(n=await r.json(),typeof n?.root!="string"||!Array.isArray(n.files))return t("invalid project index")}catch(s){return t(String(s))}const{root:a,files:o}=n;return a!==e&&O(`The editor serving this tab has ${a} open, not ${e}; its files are mounted at ${e}, which is where Python is looking.`),o}const y=new Map;async function te(e,t){const r=await e.stat(t);return r?`${r.size}:${r.mtimeMs}`:""}async function _(e,t){const r=await ee(t);if(!r)return;const n=new Set(r.map(a=>`${t}/${a.path}`));for(const a of[...y.keys()])if(!n.has(a)){try{await e.unlink(a)}catch{}y.delete(a)}for(const a of r){const o=`${t}/${a.path}`,s=`${a.size}:${a.mtime}`;if(y.get(o)?.host===s||!y.has(o)&&await e.stat(o)!==null)continue;const i=await fetch(`/__editor/blender-project-file?path=${encodeURIComponent(a.path)}`);if(!i.ok){O(`${a.path}: HTTP ${i.status}`);continue}const c=o.slice(0,o.lastIndexOf("/"));c&&await e.mkdirTree(c),await e.writeFile(o,new Uint8Array(await i.arrayBuffer())),y.set(o,{host:s,engine:await te(e,o)})}}async function ne(e,t){const r=[],n=async a=>{let o;try{o=await e.readdir(a)}catch{return}for(const s of o){if(s==="."||s==="..")continue;const i=`${a.replace(/\/$/,"")}/${s}`,c=await e.stat(i);if(c){if((c.mode&61440)===16384){await n(i);continue}y.get(i)?.engine!==`${c.size}:${c.mtimeMs}`&&r.push({path:i,size:c.size,mtime:c.mtimeMs})}}};return await n(t),r}async function F(e){switch(e.op){case"start":return Z(e.project,e.document);case"present-result":{const n=j.get(e.id);j.delete(e.id),n&&(e.error?n.reject(new Error(e.error)):n.resolve({...e.capture===void 0?{}:{capture:e.capture},..."held"in e?{held:e.held}:{}}));return}}if(!b||!S||!f)throw new Error("The Blender session has not started");const t=f.files,r=f.request.bind(f);switch(e.op){case"flush-document":return T?(await N(),{saved:!0}):{saved:!1};case"history-begin":case"history-end":return r({op:e.op});case"history-step":return r({op:"history-step",token:e.token,direction:e.direction});case"execute":await _(t,S);{const n=await r({op:"execute",code:e.code,history:e.history??!0,label:e.label??"Blender Python"});return n.error?`Error executing code: ${n.error}`:`Code executed successfully: ${n.result}`}case"present":return r({op:"present"});case"scene-info":return b.sceneInfo();case"object-info":return b.objectInfo(e.name);case"rna":return r({op:"rna",path:e.path,...e.names===void 0?{}:{names:e.names}});case"rna-context":return r({op:"rna-context",...e.object===void 0?{}:{object:e.object},...e.collection===void 0?{}:{collection:e.collection}});case"rna-set":return r({op:"rna-set",history:e.history!==!1,path:e.path,property:e.property,value:e.value,...e.index===void 0?{}:{index:e.index}});case"outliner":return r({op:"outliner",...e.selected===void 0?{}:{selected:[...e.selected]}});case"node-tree":return r({op:"node-tree",...e.path===void 0?{}:{path:e.path},...e.material===void 0?{}:{material:e.material}});case"uv-layout":return r({op:"uv-layout",...e.object===void 0?{}:{object:e.object},...e.uvLayer===void 0?{}:{uvLayer:e.uvLayer}});case"rig":return r({op:"rig",...e.object===void 0?{}:{object:e.object}});case"action-clip":return r({op:"action-clip",...e.object===void 0?{}:{object:e.object},...e.bake===void 0?{}:{bake:e.bake}});case"outliner-set":return r({op:"outliner-set",path:e.path,column:e.column,value:e.value});case"screenshot-view":return JSON.parse(await b.screenshotView(e.maxSize));case"read-file":return t.readFile(e.path);case"write-file":{const n=e.path.slice(0,e.path.lastIndexOf("/"));n&&await t.mkdirTree(n),await t.writeFile(e.path,e.bytes),y.delete(e.path);return}case"list-files":return ne(t,e.path)}throw new Error(`Unknown Blender worker request ${e.op}`)}function g(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return typeof t.name=="string"?`${t.name}: ${t.message}`:t.message;try{return JSON.stringify(e)??Object.prototype.toString.call(e)}catch{return Object.prototype.toString.call(e)}}return String(e)}function re(){if(!f)return;const e=f.memoryBytes();e!==null&&m({op:"memory",bytes:e})}self.onmessage=e=>{const t=e.data;if(t.op==="present-result"){F(t);return}Q(()=>oe(t))};async function oe(e){try{const t=await F(e);T&&await N(),await R(),m({id:e.id,result:t})}catch(t){let r=g(t);try{await R()}catch(n){r+=`
1
+ const d="/work/.volter-session",ae=`${d}/session.py`,se=[`${d}/in`,`${d}/reply`],L="/__editor/blender-wasm";function ie(e){return e.startsWith("@@VOLTER-ERROR")?"error":e.startsWith("@@VOLTER-WARN")?"warn":"log"}function D(e){return new URL(`${L}/${e}`,import.meta.url).href}async function M(){const e=await fetch(D("status"));return e.ok?await e.json():{available:!1,skew:null,dir:null,sizes:{},encoded:{},missing:[`${L}/status answered ${e.status}`]}}async function W(e){const t=await M();if(!t.available)throw new Error(`The headless Blender WebAssembly build is not served by this editor: ${t.missing.join("; ")}`);if(t.skew==="wali"){const{startWaliBlenderEngine:n}=await import("./blender-wali-engine--CAT1JcK.js");return n(e,t)}const{startEmscriptenBlenderEngine:r}=await import("./blender-emscripten-engine-BUt1MIRn.js");return r(e,t)}function J(e){return e<200?1:e<5e3?5:25}const U=e=>new Promise(t=>setTimeout(t,e)),B=new TextDecoder;function ce(e,t,r){let n=0,a=0;const o=new Set;async function s(u){for(const l of o)u.has(`${l}.done`)||(await e.unlink(`${d}/reply/${l}.json`),await e.unlink(`${d}/reply/${l}.done`),o.delete(l))}async function i(){let u;try{u=await e.readdir(`${d}/ask`)}catch{return}const l=new Set(u.filter(w=>w.endsWith(".done")));await s(l);for(const w of l){const h=w.slice(0,-5);if(Number(h)<=a)continue;a=Number(h);const $=JSON.parse(B.decode(await e.readFile(`${d}/ask/${h}.json`)));let p;try{p=await t.ask($)}catch(v){p={error:v instanceof Error?v.message:String(v)}}await Promise.all([e.writeFile(`${d}/reply/${h}.json`,JSON.stringify(p??null)),e.writeFile(`${d}/reply/${h}.done`,"1")]),o.add(h)}}async function c(u){const l=String(++n);await Promise.all([e.writeFile(`${d}/in/${l}.json`,JSON.stringify(u)),e.writeFile(`${d}/in/${l}.done`,"1")]);const w=performance.now();for(;;){if(await i(),await e.stat(`${d}/out/${l}.done`)){const p=JSON.parse(B.decode(await e.readFile(`${d}/out/${l}.json`)));if(await e.unlink(`${d}/in/${l}.json`),await e.unlink(`${d}/in/${l}.done`),p.error)throw new Error(p.error);return p.result}const h=r?.();if(h)throw new Error(`Blender is gone, so this call will never be answered: ${h}. The session keeps its directory and its cached banner, so every later call would wait on the same missing answer; start a new program with \`blender-start {fresh: true}\` (\`VOLTER_BLENDER_FRESH_SESSION=1\` for the battery harness).`);const $=J(performance.now()-w);await(e.changed?e.changed($):U($))}}return{request:c}}const I=e=>typeof e=="object"&&e!==null&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.dtype=="string"&&typeof e.count=="number"&&typeof e.stride=="number",C={f32:e=>new Float32Array(e.buffer,e.byteOffset,e.byteLength>>2),f64:e=>new Float64Array(e.buffer,e.byteOffset,e.byteLength>>3),u32:e=>new Uint32Array(e.buffer,e.byteOffset,e.byteLength>>2),i32:e=>new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u16:e=>new Uint16Array(e.buffer,e.byteOffset,e.byteLength>>1),i16:e=>new Int16Array(e.buffer,e.byteOffset,e.byteLength>>1),u8:e=>e,i8:e=>new Int8Array(e.buffer,e.byteOffset,e.byteLength)};function z(e,t,r){const n=C[r.dtype];if(!n)throw new Error(`Blender frame column ${t}: unknown dtype ${r.dtype}`);const{offset:a,length:o}=r;if(a<0||o<0||a+o>e.byteLength)throw new Error(`Blender frame column ${t}: bytes ${a}..${a+o} lie outside the ${e.byteLength}-byte export arena`);const s=e.subarray(a,a+o).slice(),i=n(s),c=r.count*r.stride;if(i.length!==c)throw new Error(`Blender frame column ${t}: ${i.length} values, ${c} declared (${r.count} x ${r.stride})`);return i}function V(e,t){const r=(n,a)=>{if(I(n)){const o=z(e,a,n);return a==="co"?Float64Array.from(o):o}if(Array.isArray(n))return n.map(o=>r(o,a));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=r(i,s);return o}return n};return r(t,"")}async function H(e,t){const r=async(n,a)=>{if(I(n)){const{offset:o,length:s,dtype:i}=n;if(o<0||s<0||o+s>e.byteLength)throw new Error(`Blender frame column ${a}: bytes ${o}..${o+s} lie outside the ${e.byteLength}-byte export arena`);const c=e.subarray(o,o+s).slice(),u=await crypto.subtle.digest("SHA-256",c),l=[...new Uint8Array(u)].map(w=>w.toString(16).padStart(2,"0")).join("");return{dtype:i,length:s,sha256:l}}if(Array.isArray(n))return Promise.all(n.map(o=>r(o,a)));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=await r(i,s);return o}return n};return r(t,"")}const m=e=>self.postMessage(e),k=(e,t)=>m({op:"log",level:e,text:t});let b=null,S=null,G=0;const j=new Map;function K(e,t,r){const n=++G,a=[],o=e;for(const s of[o?.meshes??{},o?.images??{}])for(const i of Object.values(s))for(const c of Object.values(i))ArrayBuffer.isView(c)&&c.buffer instanceof ArrayBuffer&&!a.includes(c.buffer)&&a.push(c.buffer);return new Promise((s,i)=>{j.set(n,{resolve:s,reject:i}),self.postMessage({op:"present",id:n,frame:e,description:t,...r?{capture:r}:{}},a)})}let f=null,E=null,T=!1,A=Promise.resolve();function Q(e){const t=A.then(e);return A=t.catch(()=>{}),t}function P(e){T=e,m({op:"document-dirty",dirty:e})}async function N(){if(!f||E===null)return;const e=E;let t;try{t=await f.request({op:"save-document"})}catch(n){throw new Error(`The Blender document ${e} could not be saved: ${g(n)}`)}if(!t?.saved||typeof t.path!="string")throw new Error(`Blender did not save the document ${e}`);let r;try{r=await f.files.readFile(t.path)}catch(n){throw new Error(`The Blender document ${e} could not be read back out of the engine: ${g(n)}`)}y.delete(t.path);try{const n=await fetch(`/__editor/blender-document?path=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([r])});if(!n.ok){const a=await n.text().catch(()=>"");throw new Error(`HTTP ${n.status} ${a}`)}}catch(n){throw new Error(`The Blender document ${e} was not written to the project: ${g(n)}`)}P(!1),k("log",`@@VOLTER-DOCUMENT ${JSON.stringify({path:e,bytes:r.length})}`)}async function X(e,t){const r={engine:null},n=await W({project:e,log:k,ask:async({frame:o,capture:s,saveDue:i})=>{if(!r.engine)throw new Error("The Blender session presented before it started");i&&E!==null&&P(!0);const c=await r.engine.readArena(),u=await H(c,o),l=await K(V(c,o),u,s);return{...typeof l.capture=="object"&&l.capture!==null?l.capture:{},..."held"in l?{held:l.held}:{}}}});r.engine=n,f=n,t&&await _(n.files,e);const a=await n.request({op:"start",project:e,...t?{document:t}:{}});return t&&(E=t),b={start:async()=>a,execute:async o=>{const s=await n.request({op:"execute",code:o});return s.error?`Error executing code: ${s.error}`:`Code executed successfully: ${s.result}`},sceneInfo:async()=>JSON.stringify(await n.request({op:"scene-info"}),null,2),objectInfo:async o=>JSON.stringify(await n.request({op:"object-info",name:o}),null,2),screenshotView:async o=>(await n.request({op:"present",capture:{size:o}}),JSON.stringify({view:{size:o}}))},{...a,engine:"blender-wasm",skew:n.skew,bootMs:Math.round(n.bootMs),releasedPayloadMB:n.releasedPayloadBytes===null?null:Math.round(n.releasedPayloadBytes/1048576)}}async function Y(){try{const e=await fetch("/__editor/blender-wasm/status");return e.ok?await e.json():{available:!1,missing:[`status answered ${e.status}`]}}catch(e){return{available:!1,missing:[String(e)]}}}async function Z(e,t){if(b)throw new Error("The Blender session is already started");if(!e.startsWith("/"))throw new Error("The Blender session needs the project's absolute path");if(t!==void 0&&!q(t))throw new Error(`The Blender document must be a project-relative .blend path with no traversal (models/model.blend); got ${JSON.stringify(t)}`);const r=await Y();if(!r.available)throw new Error(`Headless Blender is not served by this editor, so there is no modeling engine: ${r.missing.join("; ")}. The engine is Blender compiled to WebAssembly (packages/blender-engine/wasm, or the directory VOLTER_BLENDER_WASM_DIR names); nothing stands in for it.`);return S=e,X(e,t)}function q(e){return!e.endsWith(".blend")||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(r=>r!==""&&r!=="."&&r!=="..")}const x=new Set;function O(e){x.has(e)||(x.add(e),k("error",e))}async function ee(e){const t=s=>(O(`The project's files are not readable from Python: ${s}`),null);let r;try{r=await fetch("/__editor/blender-project-index")}catch(s){return t(String(s))}if(!r.ok)return t(`/__editor/blender-project-index answered ${r.status}`);let n;try{if(n=await r.json(),typeof n?.root!="string"||!Array.isArray(n.files))return t("invalid project index")}catch(s){return t(String(s))}const{root:a,files:o}=n;return a!==e&&O(`The editor serving this tab has ${a} open, not ${e}; its files are mounted at ${e}, which is where Python is looking.`),o}const y=new Map;async function te(e,t){const r=await e.stat(t);return r?`${r.size}:${r.mtimeMs}`:""}async function _(e,t){const r=await ee(t);if(!r)return;const n=new Set(r.map(a=>`${t}/${a.path}`));for(const a of[...y.keys()])if(!n.has(a)){try{await e.unlink(a)}catch{}y.delete(a)}for(const a of r){const o=`${t}/${a.path}`,s=`${a.size}:${a.mtime}`;if(y.get(o)?.host===s||!y.has(o)&&await e.stat(o)!==null)continue;const i=await fetch(`/__editor/blender-project-file?path=${encodeURIComponent(a.path)}`);if(!i.ok){O(`${a.path}: HTTP ${i.status}`);continue}const c=o.slice(0,o.lastIndexOf("/"));c&&await e.mkdirTree(c),await e.writeFile(o,new Uint8Array(await i.arrayBuffer())),y.set(o,{host:s,engine:await te(e,o)})}}async function ne(e,t){const r=[],n=async a=>{let o;try{o=await e.readdir(a)}catch{return}for(const s of o){if(s==="."||s==="..")continue;const i=`${a.replace(/\/$/,"")}/${s}`,c=await e.stat(i);if(c){if((c.mode&61440)===16384){await n(i);continue}y.get(i)?.engine!==`${c.size}:${c.mtimeMs}`&&r.push({path:i,size:c.size,mtime:c.mtimeMs})}}};return await n(t),r}async function F(e){switch(e.op){case"start":return Z(e.project,e.document);case"present-result":{const n=j.get(e.id);j.delete(e.id),n&&(e.error?n.reject(new Error(e.error)):n.resolve({...e.capture===void 0?{}:{capture:e.capture},..."held"in e?{held:e.held}:{}}));return}}if(!b||!S||!f)throw new Error("The Blender session has not started");const t=f.files,r=f.request.bind(f);switch(e.op){case"flush-document":return T?(await N(),{saved:!0}):{saved:!1};case"history-begin":case"history-end":return r({op:e.op});case"history-step":return r({op:"history-step",token:e.token,direction:e.direction});case"execute":await _(t,S);{const n=await r({op:"execute",code:e.code,history:e.history??!0,label:e.label??"Blender Python"});return n.error?`Error executing code: ${n.error}`:`Code executed successfully: ${n.result}`}case"present":return r({op:"present"});case"scene-info":return b.sceneInfo();case"object-info":return b.objectInfo(e.name);case"rna":return r({op:"rna",path:e.path,...e.names===void 0?{}:{names:e.names}});case"rna-context":return r({op:"rna-context",...e.object===void 0?{}:{object:e.object},...e.collection===void 0?{}:{collection:e.collection}});case"rna-set":return r({op:"rna-set",history:e.history!==!1,path:e.path,property:e.property,value:e.value,...e.index===void 0?{}:{index:e.index}});case"outliner":return r({op:"outliner",...e.selected===void 0?{}:{selected:[...e.selected]}});case"node-tree":return r({op:"node-tree",...e.path===void 0?{}:{path:e.path},...e.material===void 0?{}:{material:e.material}});case"uv-layout":return r({op:"uv-layout",...e.object===void 0?{}:{object:e.object},...e.uvLayer===void 0?{}:{uvLayer:e.uvLayer}});case"rig":return r({op:"rig",...e.object===void 0?{}:{object:e.object}});case"action-clip":return r({op:"action-clip",...e.object===void 0?{}:{object:e.object},...e.bake===void 0?{}:{bake:e.bake}});case"outliner-set":return r({op:"outliner-set",path:e.path,column:e.column,value:e.value});case"screenshot-view":return JSON.parse(await b.screenshotView(e.maxSize));case"read-file":return t.readFile(e.path);case"write-file":{const n=e.path.slice(0,e.path.lastIndexOf("/"));n&&await t.mkdirTree(n),await t.writeFile(e.path,e.bytes),y.delete(e.path);return}case"list-files":return ne(t,e.path)}throw new Error(`Unknown Blender worker request ${e.op}`)}function g(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return typeof t.name=="string"?`${t.name}: ${t.message}`:t.message;try{return JSON.stringify(e)??Object.prototype.toString.call(e)}catch{return Object.prototype.toString.call(e)}}return String(e)}function re(){if(!f)return;const e=f.memoryBytes();e!==null&&m({op:"memory",bytes:e})}self.onmessage=e=>{const t=e.data;if(t.op==="present-result"){F(t);return}Q(()=>oe(t))};async function oe(e){try{const t=await F(e);T&&await N(),await R(),m({id:e.id,result:t})}catch(t){let r=g(t);try{await R()}catch(n){r+=`
2
2
  Unable to deliver Blender history: ${g(n)}`}m({id:e.id,error:r})}re()}async function R(){if(!f||!b)return;const e=await f.request({op:"history-events"});e.length&&m({op:"history",entries:e})}export{L as A,se as P,d as S,D as a,ae as b,ie as c,ce as o,U as s};
@@ -1 +1 @@
1
- import{ty as n,tz as l,tA as a,tB as _,tC as i,tD as s,tE as d,tF as u,tG as c,tH as b,tI as p}from"./index-BJUzb-B4.js";const f=Object.freeze(Object.defineProperty({__proto__:null,EDITOR_VIEW_BUILT_IN_UTILITY_IDS:n,EDITOR_VIEW_DOCUMENT_KINDS:l,EDITOR_VIEW_KEYS:a,EDITOR_VIEW_TOOL_UTILITY_PREFIX:_,EDITOR_VIEW_WORKSPACE_DOCUMENT_IDS:i,EditorClient:s,EditorCommandError:d,editorViewFromUrl:u,editorViewUrl:c,isEditorViewDocumentKind:b,isEditorViewUtility:p},Symbol.toStringTag,{value:"Module"})),o={editorHelperType:"editorHelperType",skeletonVisible:"skeletonVisible",skeletonEnabled:"skeletonEnabled",engineInternal:"engineInternal",editorHelper:"editorHelper",volterComponentRoot:"volterComponentRoot",volterBuiltInternal:"volterBuiltInternal"};function y(e,t){return e?e.userData[o[t]]:void 0}function g(e,t,r){e.userData[o[t]]=r}const S=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),j=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),m=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),I=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),E=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),M=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),v=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),P=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),D=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),R=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),C=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{o as O,m as a,P as b,E as c,S as d,j as e,T as f,y as g,I as h,f as i,z as j,D as k,M as p,v as r,g as s,R as t,C as w};
1
+ import{ty as n,tz as l,tA as a,tB as _,tC as i,tD as s,tE as d,tF as u,tG as c,tH as b,tI as p}from"./index-C5cL2IUJ.js";const f=Object.freeze(Object.defineProperty({__proto__:null,EDITOR_VIEW_BUILT_IN_UTILITY_IDS:n,EDITOR_VIEW_DOCUMENT_KINDS:l,EDITOR_VIEW_KEYS:a,EDITOR_VIEW_TOOL_UTILITY_PREFIX:_,EDITOR_VIEW_WORKSPACE_DOCUMENT_IDS:i,EditorClient:s,EditorCommandError:d,editorViewFromUrl:u,editorViewUrl:c,isEditorViewDocumentKind:b,isEditorViewUtility:p},Symbol.toStringTag,{value:"Module"})),o={editorHelperType:"editorHelperType",skeletonVisible:"skeletonVisible",skeletonEnabled:"skeletonEnabled",engineInternal:"engineInternal",editorHelper:"editorHelper",volterComponentRoot:"volterComponentRoot",volterBuiltInternal:"volterBuiltInternal"};function y(e,t){return e?e.userData[o[t]]:void 0}function g(e,t,r){e.userData[o[t]]=r}const S=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),j=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),m=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),I=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),E=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),M=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),v=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),P=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),D=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),R=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),C=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{o as O,m as a,P as b,E as c,S as d,j as e,T as f,y as g,I as h,f as i,z as j,D as k,M as p,v as r,g as s,R as t,C as w};
@@ -1 +1 @@
1
- import{a as c}from"./jsx-runtime-DPjLkJKQ.js";import{dB as W,dC as K,e4 as j,fo as H,aK as E,f_ as $,f$ as Y,d3 as A,g0 as q,d4 as M,eF as N,dK as Q,y as J,g1 as Z,aQ as ee,g2 as te,g3 as oe,g4 as ne,g5 as re,g6 as se,g7 as ae,fX as ie,d6 as ce,g8 as le,aD as de,g9 as P,ga as ue,dI as pe}from"./index-BJUzb-B4.js";import{r as p}from"./index-nmcBqr7Y.js";import{d as fe,m as me}from"./design-time-layers-CHkfJxfx.js";import{I as be,B as xe}from"./edit-mode-authoring-DTqQCASO.js";import{b as he,i as ge}from"./react-canvas-navigation-SO8CyICB.js";import{R as z,i as ve}from"./react-story-board-BOsvNV8b.js";import{s as ye,c as we,a as Se,b as ke}from"./component-board-registry-DrIa2csL.js";import{e as Re,S as Ie}from"./surface-state-C_1um-Wp.js";import"./index-CtzuWnCS.js";import{c as Ce,d as Ee,r as F,e as G,f as Ae,m as O,b as De,a as je,s as Be}from"./board-guides-Dz0A1_-b.js";import{C as V,a as $e,b as Me}from"./CanvasSceneViewport-Cgblv27V.js";import{R as _e}from"./ReactCanvasControls-B6jRxIe_.js";import{R as ze}from"./RootSelectionOverlay-5La9--nb.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./root-stacking-BEd9ZvxC.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./game-surface-defaults-D8S4cRxi.js";import"./Toolbar-RWmWORSC.js";import"./transform-mode-request-BebirGMs.js";import"./TransientHint-BX8vPTJO.js";import"./layered-pick-BYnMPvYe.js";import"./eyedropper-session-bjPXnfeX.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-k-9pRW-H.js";import"./inference-diagnostics-wOrQB5Rh.js";const y=16,_="rgba(255, 82, 82, 0.9)",U="rgba(18, 22, 26, 0.92)",D="rgba(255, 255, 255, 0.28)";function Te(s){return[10,25,50,100,250,500,1e3,2500,5e3].find(n=>n*s>=60)??1e4}function L(s){return Math.abs(s)>=1e3?`${s/1e3}k`:String(s)}function Ne({docId:s,containerRef:l}){const n=p.useSyncExternalStore(W,K),x=p.useSyncExternalStore(Ce,()=>Ee(s)),[r,d]=p.useState(null),v=p.useRef(null);p.useEffect(()=>{const t=l.current;if(!t)return;const o=t.getBoundingClientRect();return F(s,{originX:o.left,originY:o.top,panX:n.x,panY:n.y,zoom:n.zoom}),()=>F(s,null)},[s,l,n.x,n.y,n.zoom]);const f=(t,o)=>Math.round((t-(o==="x"?n.x:n.y))/n.zoom),u=(t,o)=>(o==="x"?n.x:n.y)+t*n.zoom,m=t=>{const o=l.current?.getBoundingClientRect();return o?{x:t.clientX-o.left,y:t.clientY-o.top}:{x:0,y:0}},k=t=>o=>{o.preventDefault(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"place",axis:t,id:null,at:t==="x"?e.x:e.y})},S=t=>o=>{o.preventDefault(),o.stopPropagation(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"move",axis:t.axis,id:t.id,at:t.axis==="x"?e.x:e.y})},R=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y;d({...r,at:e}),r.kind==="move"&&r.id&&O(s,r.id,f(e,r.axis))},I=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y,i=e<=y;r.kind==="place"?i||Ae(s,r.axis,f(e,r.axis)):r.id&&(i?G(s,r.id):O(s,r.id,f(e,r.axis))),d(null)},a=t=>{const o=l.current,e=o?t==="x"?o.clientWidth:o.clientHeight:0,i=Te(n.zoom),g=Math.ceil(f(y,t)/i)*i,w=f(e,t),b=[];for(let C=g;C<=w&&b.length<200;C+=i)b.push(C);return b},h={position:"absolute",background:U,zIndex:61,userSelect:"none",touchAction:"none",overflow:"hidden"};return c.jsxs("div",{ref:v,"data-testid":"board-rulers",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:60},onPointerMove:R,onPointerUp:I,children:[x.map(t=>{const o=u(t.value,t.axis),e=t.axis==="x";return c.jsx("div",{"data-testid":`board-guide-${t.axis}-${t.value}`,title:`${t.axis} = ${t.value} — drag to move, drop on the ruler or double-click to remove`,onPointerDown:S(t),onPointerMove:R,onPointerUp:I,onDoubleClick:()=>G(s,t.id),style:{position:"absolute",pointerEvents:"auto",cursor:e?"col-resize":"row-resize",zIndex:60,...e?{left:o-2,top:0,bottom:0,width:5}:{top:o-2,left:0,right:0,height:5}},children:c.jsx("div",{style:{position:"absolute",background:_,...e?{left:2,top:0,bottom:0,width:1}:{top:2,left:0,right:0,height:1}}})},t.id)}),r&&c.jsx("div",{style:{position:"absolute",background:_,zIndex:62,...r.axis==="x"?{left:r.at,top:0,bottom:0,width:1}:{top:r.at,left:0,right:0,height:1}},children:c.jsx("span",{style:{position:"absolute",...r.axis==="x"?{top:y+4,left:4}:{left:y+4,top:4},fontSize:9,fontFamily:"ui-monospace, monospace",color:_,background:U,padding:"1px 3px",borderRadius:3,whiteSpace:"nowrap"},children:f(r.at,r.axis)})}),c.jsx("div",{"data-testid":"board-ruler-top",onPointerDown:k("y"),style:{...h,top:0,left:y,right:0,height:y,cursor:"row-resize",pointerEvents:"auto"},children:a("x").map(t=>c.jsx("span",{style:{position:"absolute",left:u(t,"x"),bottom:0,borderLeft:`1px solid ${D}`,height:5},children:c.jsx("span",{style:{position:"absolute",left:2,bottom:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace"},children:L(t)})},t))}),c.jsx("div",{"data-testid":"board-ruler-left",onPointerDown:k("x"),style:{...h,top:y,left:0,bottom:0,width:y,cursor:"col-resize",pointerEvents:"auto"},children:a("y").map(t=>c.jsx("span",{style:{position:"absolute",top:u(t,"y"),right:0,borderTop:`1px solid ${D}`,width:5},children:c.jsx("span",{style:{position:"absolute",top:1,right:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace",writingMode:"vertical-rl"},children:L(t)})},t))}),c.jsx(Pe,{}),c.jsx("div",{style:{...h,top:0,left:0,width:y,height:y,borderRight:`1px solid ${j.border}`,borderBottom:`1px solid ${j.border}`}})]})}function Pe(){const s=p.useSyncExternalStore(De,je);return s?c.jsxs("button",{type:"button","data-testid":"board-breakpoint-pill",title:"Style edits are scoped to this breakpoint — click to return to Base",onClick:()=>Be(null),style:{position:"absolute",top:y+8,right:12,zIndex:62,pointerEvents:"auto",background:"rgba(18, 22, 26, 0.92)",color:j.accent,border:`1px solid ${j.accent}`,borderRadius:999,fontSize:10,padding:"3px 10px",cursor:"pointer"},children:["@ ",s," · editing this breakpoint — click to clear"]}):null}const Fe="Scene";function Ge({active:s,composite:l,descriptor:n,documentId:x,store:r}){const d=p.useRef(null),v=p.useRef(null),[f]=p.useState(oe),u=n.kind==="canvas",m=u?f:ce;p.useSyncExternalStore(r.subscribe,r.getSnapshot);const k=p.useSyncExternalStore(ne,re),S=p.useSyncExternalStore(se,ae),[R,I]=p.useState(null),a=l.childAdapters().find(b=>b.worldId===n.worldId)?.adapter??R??void 0,h=u&&a?.provenance?.label==="babylon",t=a?.hierarchy.roots()??[],o=new Set(a?.rects?.emptyContainers?.().map(b=>b.id)??[]),e=t.some(b=>!o.has(b.id)),i=Re({surface:u?"Scene":n.kind==="dom"?"UI":"World",rootIds:[n.worldId],playSuspended:r.playState!=="stopped"&&(!a||a.provenance?.source==="boundary"),phase:!a||a.provenance?.source==="boundary"?"loading":"ready",content:!a||a.provenance?.source==="boundary"?"unknown":e?"present":"empty",readiness:k,failures:S,disclosure:a instanceof xe?a.disclosure:null});p.useEffect(()=>{if(a)return ie(x,()=>({adapter:a,nodeId:[...r.selectedEntityIds].find(b=>a.hierarchy.node(b))??null}))},[l,a,x,r]),p.useEffect(()=>{const b=d.current;if(b&&!h)return u?he(b,m):ge(b,m)},[m,h,u]),p.useEffect(()=>{if(!s)return;if(!!!v.current&&d.current){v.current=me(d.current,l,r,[n],(Ve,X)=>I(X),u?{canvasSceneView:f}:void 0,x);return}let C=0,B=0;const T=()=>{if(C+=1,C<2){B=requestAnimationFrame(T);return}pe(x)};return B=requestAnimationFrame(T),()=>cancelAnimationFrame(B)},[s,f,l,n,x,u,r]),p.useEffect(()=>()=>{v.current?.(),v.current=null},[]);const g=le(de(r),r.selectedEntityIds),w=g?.worldId===n.worldId?g:a?.rects?{worldId:n.worldId,kind:"dom",adapter:a}:null;return c.jsxs("div",{ref:d,"data-testid":`world-document:${n.worldId}`,"data-volter-backdrop-color":s?h?"#111827":u?V:z:void 0,"data-volter-backdrop-policy":s?"dark-frost":void 0,onPointerDown:()=>ue("viewport"),style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"auto",backgroundColor:h?"#111827":u?V:z,touchAction:"none"},children:[h?null:u?c.jsx($e,{view:f,documentId:x}):c.jsx(Oe,{}),c.jsx(ze,{...a?{adapter:a}:{},...u&&!h?{view:f,transformModeAware:!0,presentationId:x}:{}},`selection:${P(a)}`),c.jsx(Ie,{explanation:i,testId:`world-surface-status:${n.worldId}`,style:{zIndex:20}}),h?null:u?c.jsx(Me,{active:s,...a?{adapter:a}:{},containerRef:d,view:f,documentId:x},`controls:${P(a)}`):c.jsxs(c.Fragment,{children:[c.jsx(Ne,{docId:n.worldId,containerRef:d}),c.jsx(_e,{containerRef:d,context:w})]})]})}function Oe(){const s=p.useSyncExternalStore(W,K),l=Math.max(8,24*s.zoom),n=Math.max(.7,Math.min(1.4,s.zoom));return c.jsx("div",{"data-testid":"react-design-canvas-backdrop","aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:z,backgroundImage:`radial-gradient(circle, ${ve} ${n}px, transparent ${n}px)`,backgroundPosition:`${s.x}px ${s.y}px`,backgroundSize:`${l}px ${l}px`}})}function vt(s,l){const n=J(),x=l.childAdapters().some(e=>e.role==="world"&&e.kind==="three"),r=l.childAdapters().some(e=>e.kind===be);!x&&!r&&H(E,{discardDirty:!0});const d=new Set,v=[];let f=!1;for(const e of l.childAdapters())e.role==="world"&&e.kind==="three"&&v.push($(e.worldId,E));const u=fe(l),m=u.find(e=>e.kind==="canvas");m&&v.push($(m.worldId,A));const k=new Set([...l.childAdapters().filter(e=>e.role==="world"&&e.kind==="three"),...m?[m]:[]].map(e=>e.worldId)),S=new Map;function R(){for(const e of u){if(k.has(e.worldId)||S.has(e.worldId))continue;const i=Se(e.kind);if(!i)continue;const g=$(e.worldId,i.documentId),w=Z(e.worldId,()=>i.presence()==="absent"?`Root "${e.worldId}" has no document of its own: its design surface is the project's ${i.title} board (${i.documentId}). ${i.absentReason()}`:null);S.set(e.worldId,()=>{w(),g()})}}v.push(Y(e=>{const i=ee();if(i.some(w=>w.descriptor.id===e))return null;const g=ke(e);return g?g.presence()==="absent"?g.absentReason():null:`No workspace document is named "${e}". Open in this session: ${i.map(w=>w.descriptor.id).join(", ")||"(none)"}. A component board is present only when the package that owns its medium says this project has one, so a board id can be absent for this project and present for another.`}));function I(e){const i=g=>c.jsx(Ge,{...g,composite:l,descriptor:e,store:s});Q({id:A,title:Fe,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:e.worldId,...e.path?{sourcePath:e.path}:{}},Content:i,presentation:()=>({kind:"world",id:e.worldId})},{category:"scene",default:!x,rootId:e.worldId})}function a(e){d.add(e.documentId);const i=()=>{d.delete(e.documentId)};try{Promise.resolve(e.install({store:s,composite:l})).catch(i)}catch{i()}}function h(){if(!f){R();for(const e of we()){const i=e.presence();if(i===null)continue;const g=d.has(e.documentId);i==="present"!==g&&(i==="present"?a(e):(N(e.documentId),d.delete(e.documentId)))}}}m&&(I(m),d.add(A)),h();const t=ye(h),o=m?A:[...d][0];return te()||(!x&&o!==void 0&&(n===null||n===E||n===q)?M(o):n?M(n):x&&M(E)),()=>{f=!0,t();for(const e of v)e();for(const e of S.values())e();S.clear();for(const e of d)N(e)}}export{Ge as RootDocumentContent,vt as installRootDocuments};
1
+ import{a as c}from"./jsx-runtime-DPjLkJKQ.js";import{dB as W,dC as K,e4 as j,fo as H,aK as E,f_ as $,f$ as Y,d3 as A,g0 as q,d4 as M,eF as N,dK as Q,y as J,g1 as Z,aQ as ee,g2 as te,g3 as oe,g4 as ne,g5 as re,g6 as se,g7 as ae,fX as ie,d6 as ce,g8 as le,aD as de,g9 as P,ga as ue,dI as pe}from"./index-C5cL2IUJ.js";import{r as p}from"./index-nmcBqr7Y.js";import{d as fe,m as me}from"./design-time-layers-DSk4tElq.js";import{I as be,B as xe}from"./edit-mode-authoring-Ch6v9PnO.js";import{b as he,i as ge}from"./react-canvas-navigation-Awf5f-km.js";import{R as z,i as ve}from"./react-story-board-D2pwwUUp.js";import{s as ye,c as we,a as Se,b as ke}from"./component-board-registry-DrIa2csL.js";import{e as Re,S as Ie}from"./surface-state-DeXIPWuS.js";import"./index-CtzuWnCS.js";import{c as Ce,d as Ee,r as F,e as G,f as Ae,m as O,b as De,a as je,s as Be}from"./board-guides-DLC77TC2.js";import{C as V,a as $e,b as Me}from"./CanvasSceneViewport-CEXxZv3P.js";import{R as _e}from"./ReactCanvasControls-DeKZZILw.js";import{R as ze}from"./RootSelectionOverlay-DYanTBYE.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./root-stacking-BEd9ZvxC.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./game-surface-defaults-D8S4cRxi.js";import"./Toolbar-BfhP5BUg.js";import"./transform-mode-request-BEHHgfb9.js";import"./TransientHint-Byhdm3Od.js";import"./layered-pick-6TWdZ7gI.js";import"./eyedropper-session-bjPXnfeX.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-Czr75mkK.js";import"./inference-diagnostics-BI3pXsTw.js";const y=16,_="rgba(255, 82, 82, 0.9)",U="rgba(18, 22, 26, 0.92)",D="rgba(255, 255, 255, 0.28)";function Te(s){return[10,25,50,100,250,500,1e3,2500,5e3].find(n=>n*s>=60)??1e4}function L(s){return Math.abs(s)>=1e3?`${s/1e3}k`:String(s)}function Ne({docId:s,containerRef:l}){const n=p.useSyncExternalStore(W,K),x=p.useSyncExternalStore(Ce,()=>Ee(s)),[r,d]=p.useState(null),v=p.useRef(null);p.useEffect(()=>{const t=l.current;if(!t)return;const o=t.getBoundingClientRect();return F(s,{originX:o.left,originY:o.top,panX:n.x,panY:n.y,zoom:n.zoom}),()=>F(s,null)},[s,l,n.x,n.y,n.zoom]);const f=(t,o)=>Math.round((t-(o==="x"?n.x:n.y))/n.zoom),u=(t,o)=>(o==="x"?n.x:n.y)+t*n.zoom,m=t=>{const o=l.current?.getBoundingClientRect();return o?{x:t.clientX-o.left,y:t.clientY-o.top}:{x:0,y:0}},k=t=>o=>{o.preventDefault(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"place",axis:t,id:null,at:t==="x"?e.x:e.y})},S=t=>o=>{o.preventDefault(),o.stopPropagation(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"move",axis:t.axis,id:t.id,at:t.axis==="x"?e.x:e.y})},R=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y;d({...r,at:e}),r.kind==="move"&&r.id&&O(s,r.id,f(e,r.axis))},I=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y,i=e<=y;r.kind==="place"?i||Ae(s,r.axis,f(e,r.axis)):r.id&&(i?G(s,r.id):O(s,r.id,f(e,r.axis))),d(null)},a=t=>{const o=l.current,e=o?t==="x"?o.clientWidth:o.clientHeight:0,i=Te(n.zoom),g=Math.ceil(f(y,t)/i)*i,w=f(e,t),b=[];for(let C=g;C<=w&&b.length<200;C+=i)b.push(C);return b},h={position:"absolute",background:U,zIndex:61,userSelect:"none",touchAction:"none",overflow:"hidden"};return c.jsxs("div",{ref:v,"data-testid":"board-rulers",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:60},onPointerMove:R,onPointerUp:I,children:[x.map(t=>{const o=u(t.value,t.axis),e=t.axis==="x";return c.jsx("div",{"data-testid":`board-guide-${t.axis}-${t.value}`,title:`${t.axis} = ${t.value} — drag to move, drop on the ruler or double-click to remove`,onPointerDown:S(t),onPointerMove:R,onPointerUp:I,onDoubleClick:()=>G(s,t.id),style:{position:"absolute",pointerEvents:"auto",cursor:e?"col-resize":"row-resize",zIndex:60,...e?{left:o-2,top:0,bottom:0,width:5}:{top:o-2,left:0,right:0,height:5}},children:c.jsx("div",{style:{position:"absolute",background:_,...e?{left:2,top:0,bottom:0,width:1}:{top:2,left:0,right:0,height:1}}})},t.id)}),r&&c.jsx("div",{style:{position:"absolute",background:_,zIndex:62,...r.axis==="x"?{left:r.at,top:0,bottom:0,width:1}:{top:r.at,left:0,right:0,height:1}},children:c.jsx("span",{style:{position:"absolute",...r.axis==="x"?{top:y+4,left:4}:{left:y+4,top:4},fontSize:9,fontFamily:"ui-monospace, monospace",color:_,background:U,padding:"1px 3px",borderRadius:3,whiteSpace:"nowrap"},children:f(r.at,r.axis)})}),c.jsx("div",{"data-testid":"board-ruler-top",onPointerDown:k("y"),style:{...h,top:0,left:y,right:0,height:y,cursor:"row-resize",pointerEvents:"auto"},children:a("x").map(t=>c.jsx("span",{style:{position:"absolute",left:u(t,"x"),bottom:0,borderLeft:`1px solid ${D}`,height:5},children:c.jsx("span",{style:{position:"absolute",left:2,bottom:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace"},children:L(t)})},t))}),c.jsx("div",{"data-testid":"board-ruler-left",onPointerDown:k("x"),style:{...h,top:y,left:0,bottom:0,width:y,cursor:"col-resize",pointerEvents:"auto"},children:a("y").map(t=>c.jsx("span",{style:{position:"absolute",top:u(t,"y"),right:0,borderTop:`1px solid ${D}`,width:5},children:c.jsx("span",{style:{position:"absolute",top:1,right:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace",writingMode:"vertical-rl"},children:L(t)})},t))}),c.jsx(Pe,{}),c.jsx("div",{style:{...h,top:0,left:0,width:y,height:y,borderRight:`1px solid ${j.border}`,borderBottom:`1px solid ${j.border}`}})]})}function Pe(){const s=p.useSyncExternalStore(De,je);return s?c.jsxs("button",{type:"button","data-testid":"board-breakpoint-pill",title:"Style edits are scoped to this breakpoint — click to return to Base",onClick:()=>Be(null),style:{position:"absolute",top:y+8,right:12,zIndex:62,pointerEvents:"auto",background:"rgba(18, 22, 26, 0.92)",color:j.accent,border:`1px solid ${j.accent}`,borderRadius:999,fontSize:10,padding:"3px 10px",cursor:"pointer"},children:["@ ",s," · editing this breakpoint — click to clear"]}):null}const Fe="Scene";function Ge({active:s,composite:l,descriptor:n,documentId:x,store:r}){const d=p.useRef(null),v=p.useRef(null),[f]=p.useState(oe),u=n.kind==="canvas",m=u?f:ce;p.useSyncExternalStore(r.subscribe,r.getSnapshot);const k=p.useSyncExternalStore(ne,re),S=p.useSyncExternalStore(se,ae),[R,I]=p.useState(null),a=l.childAdapters().find(b=>b.worldId===n.worldId)?.adapter??R??void 0,h=u&&a?.provenance?.label==="babylon",t=a?.hierarchy.roots()??[],o=new Set(a?.rects?.emptyContainers?.().map(b=>b.id)??[]),e=t.some(b=>!o.has(b.id)),i=Re({surface:u?"Scene":n.kind==="dom"?"UI":"World",rootIds:[n.worldId],playSuspended:r.playState!=="stopped"&&(!a||a.provenance?.source==="boundary"),phase:!a||a.provenance?.source==="boundary"?"loading":"ready",content:!a||a.provenance?.source==="boundary"?"unknown":e?"present":"empty",readiness:k,failures:S,disclosure:a instanceof xe?a.disclosure:null});p.useEffect(()=>{if(a)return ie(x,()=>({adapter:a,nodeId:[...r.selectedEntityIds].find(b=>a.hierarchy.node(b))??null}))},[l,a,x,r]),p.useEffect(()=>{const b=d.current;if(b&&!h)return u?he(b,m):ge(b,m)},[m,h,u]),p.useEffect(()=>{if(!s)return;if(!!!v.current&&d.current){v.current=me(d.current,l,r,[n],(Ve,X)=>I(X),u?{canvasSceneView:f}:void 0,x);return}let C=0,B=0;const T=()=>{if(C+=1,C<2){B=requestAnimationFrame(T);return}pe(x)};return B=requestAnimationFrame(T),()=>cancelAnimationFrame(B)},[s,f,l,n,x,u,r]),p.useEffect(()=>()=>{v.current?.(),v.current=null},[]);const g=le(de(r),r.selectedEntityIds),w=g?.worldId===n.worldId?g:a?.rects?{worldId:n.worldId,kind:"dom",adapter:a}:null;return c.jsxs("div",{ref:d,"data-testid":`world-document:${n.worldId}`,"data-volter-backdrop-color":s?h?"#111827":u?V:z:void 0,"data-volter-backdrop-policy":s?"dark-frost":void 0,onPointerDown:()=>ue("viewport"),style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"auto",backgroundColor:h?"#111827":u?V:z,touchAction:"none"},children:[h?null:u?c.jsx($e,{view:f,documentId:x}):c.jsx(Oe,{}),c.jsx(ze,{...a?{adapter:a}:{},...u&&!h?{view:f,transformModeAware:!0,presentationId:x}:{}},`selection:${P(a)}`),c.jsx(Ie,{explanation:i,testId:`world-surface-status:${n.worldId}`,style:{zIndex:20}}),h?null:u?c.jsx(Me,{active:s,...a?{adapter:a}:{},containerRef:d,view:f,documentId:x},`controls:${P(a)}`):c.jsxs(c.Fragment,{children:[c.jsx(Ne,{docId:n.worldId,containerRef:d}),c.jsx(_e,{containerRef:d,context:w})]})]})}function Oe(){const s=p.useSyncExternalStore(W,K),l=Math.max(8,24*s.zoom),n=Math.max(.7,Math.min(1.4,s.zoom));return c.jsx("div",{"data-testid":"react-design-canvas-backdrop","aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:z,backgroundImage:`radial-gradient(circle, ${ve} ${n}px, transparent ${n}px)`,backgroundPosition:`${s.x}px ${s.y}px`,backgroundSize:`${l}px ${l}px`}})}function vt(s,l){const n=J(),x=l.childAdapters().some(e=>e.role==="world"&&e.kind==="three"),r=l.childAdapters().some(e=>e.kind===be);!x&&!r&&H(E,{discardDirty:!0});const d=new Set,v=[];let f=!1;for(const e of l.childAdapters())e.role==="world"&&e.kind==="three"&&v.push($(e.worldId,E));const u=fe(l),m=u.find(e=>e.kind==="canvas");m&&v.push($(m.worldId,A));const k=new Set([...l.childAdapters().filter(e=>e.role==="world"&&e.kind==="three"),...m?[m]:[]].map(e=>e.worldId)),S=new Map;function R(){for(const e of u){if(k.has(e.worldId)||S.has(e.worldId))continue;const i=Se(e.kind);if(!i)continue;const g=$(e.worldId,i.documentId),w=Z(e.worldId,()=>i.presence()==="absent"?`Root "${e.worldId}" has no document of its own: its design surface is the project's ${i.title} board (${i.documentId}). ${i.absentReason()}`:null);S.set(e.worldId,()=>{w(),g()})}}v.push(Y(e=>{const i=ee();if(i.some(w=>w.descriptor.id===e))return null;const g=ke(e);return g?g.presence()==="absent"?g.absentReason():null:`No workspace document is named "${e}". Open in this session: ${i.map(w=>w.descriptor.id).join(", ")||"(none)"}. A component board is present only when the package that owns its medium says this project has one, so a board id can be absent for this project and present for another.`}));function I(e){const i=g=>c.jsx(Ge,{...g,composite:l,descriptor:e,store:s});Q({id:A,title:Fe,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:e.worldId,...e.path?{sourcePath:e.path}:{}},Content:i,presentation:()=>({kind:"world",id:e.worldId})},{category:"scene",default:!x,rootId:e.worldId})}function a(e){d.add(e.documentId);const i=()=>{d.delete(e.documentId)};try{Promise.resolve(e.install({store:s,composite:l})).catch(i)}catch{i()}}function h(){if(!f){R();for(const e of we()){const i=e.presence();if(i===null)continue;const g=d.has(e.documentId);i==="present"!==g&&(i==="present"?a(e):(N(e.documentId),d.delete(e.documentId)))}}}m&&(I(m),d.add(A)),h();const t=ye(h),o=m?A:[...d][0];return te()||(!x&&o!==void 0&&(n===null||n===E||n===q)?M(o):n?M(n):x&&M(E)),()=>{f=!0,t();for(const e of v)e();for(const e of S.values())e();S.clear();for(const e of d)N(e)}}export{Ge as RootDocumentContent,vt as installRootDocuments};