@volter/game-editor 0.5.67 → 0.5.69

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 (568) hide show
  1. package/BUNDLED_NOTICES +10954 -5077
  2. package/LICENSE +1 -1
  3. package/LICENSE-BLENDER +2 -2
  4. package/NOTICE +2 -2
  5. package/additions/canvas/package.json +8 -0
  6. package/additions/canvas/src/canvas-mount.ts +46 -0
  7. package/additions/canvas/src/scene2d.tsx +18 -0
  8. package/catalog/entries/bake.json +1 -1
  9. package/catalog/entries/blender.json +3 -3
  10. package/catalog/entries/music.json +6 -6
  11. package/catalog/project-source/LICENSE +1 -1
  12. package/catalog/project-source/src/contributions/bake.kind.ts +2 -2
  13. package/catalog/project-source/src/contributions/builder-document.tsx +1 -1
  14. package/catalog/project-source/src/contributions/builder-ui.tsx +3 -3
  15. package/catalog/project-source/src/contributions/module-source.ts +4 -4
  16. package/catalog/project-source/src/lib/music/music-player.ts +18 -12
  17. package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +59 -59
  18. package/catalog/project-source/src/lib/static-batch/Frozen.tsx +1 -1
  19. package/catalog/project-source/src/lib/static-batch/mutation-watch.ts +1 -1
  20. package/catalog/project-source/src/tools/bake-preview.tool.ts +9 -9
  21. package/dist/.vite/manifest.json +4106 -3965
  22. package/dist/assets/{AssetBudgetPanel-x_FNJbfZ.js → AssetBudgetPanel-BMR3AQhc.js} +10 -10
  23. package/dist/assets/AudioViewer-DESxi7pU.js +1 -0
  24. package/dist/assets/CanvasBoardDocument-Q_nrYFlB.js +1 -0
  25. package/dist/assets/CanvasSceneViewport-WZMoKy_F.js +1 -0
  26. package/dist/assets/ColorInput-C2EK-OnD.js +1 -0
  27. package/dist/assets/{EntityModelDocument-CzUHsH9E.js → EntityModelDocument-B_4ENTCq.js} +1 -1
  28. package/dist/assets/{EnvironmentAssetDocument-ByEB7_4A.js → EnvironmentAssetDocument-BZBp6OFJ.js} +1 -1
  29. package/dist/assets/{GameplaySessionTimeline-dhG-oiqd.js → GameplaySessionTimeline-1ivaucpv.js} +1 -1
  30. package/dist/assets/ImageViewer-D16OExYu.js +1 -0
  31. package/dist/assets/{InspectorCanvasPreview-CEr_Kxna.js → InspectorCanvasPreview-BrFjhoiD.js} +1 -1
  32. package/dist/assets/InspectorObjectPreview-CY5xVsPR.js +1 -0
  33. package/dist/assets/JsonAssetDocument-CvjTlcdr.js +2 -0
  34. package/dist/assets/{LiveModuleDocument-DL8QHSlk.js → LiveModuleDocument-ne1o9giX.js} +1 -1
  35. package/dist/assets/{LutAssetDocument-BImiug2M.js → LutAssetDocument-Cp0v-O7q.js} +1 -1
  36. package/dist/assets/ModelAssetDocument-Ceu7OIN9.js +1 -0
  37. package/dist/assets/{NonThreeAuthoringBootstrap-B40qmGGS.js → NonThreeAuthoringBootstrap-DiElZf-e.js} +1 -1
  38. package/dist/assets/Object3DDocumentToolbar-BLNamqii.js +1 -0
  39. package/dist/assets/Object3DDocumentViewport-D6QoHfa_.js +2 -0
  40. package/dist/assets/{Object3DPreview-ClYDoH2L.js → Object3DPreview-ZVokr044.js} +1 -1
  41. package/dist/assets/OnlineAssetDetail-Dnckd7zB.js +1 -0
  42. package/dist/assets/PlayBar-DsMitSgy.js +1 -0
  43. package/dist/assets/{QuarksAssetDocument-B-VOj-n4.js → QuarksAssetDocument-B5J8uHFM.js} +1 -1
  44. package/dist/assets/ReactCanvasControls-CmfvxJYY.js +1 -0
  45. package/dist/assets/RootSelectionOverlay-BWsNiSuM.js +1 -0
  46. package/dist/assets/{ShaderAssetDocument-Kn8IvRGV.js → ShaderAssetDocument-CT7XzsZq.js} +5 -5
  47. package/dist/assets/ShadowEditor-YO5KEfnz.js +1 -0
  48. package/dist/assets/{SourceAssetViewer-CLQ95VSD.js → SourceAssetViewer-FSLup2km.js} +1 -1
  49. package/dist/assets/StageHost-DYfGYwvq.js +2 -0
  50. package/dist/assets/{StoryPreviewMount-D2lg37et.js → StoryPreviewMount-BhvT5QlB.js} +1 -1
  51. package/dist/assets/ThreeBoardDocument-B-z2nwnH.js +2 -0
  52. package/dist/assets/{ThreeIsolationSceneContent-DbYIylZQ.js → ThreeIsolationSceneContent-B5pU4Y6k.js} +1 -1
  53. package/dist/assets/{ToolObject3DPreview-WEi6C9uU.js → ToolObject3DPreview-VtraiQ4Q.js} +1 -1
  54. package/dist/assets/Toolbar-M62Gob9T.js +1 -0
  55. package/dist/assets/{TransientHint-BpDLhRLd.js → TransientHint-Cc40mHWE.js} +1 -1
  56. package/dist/assets/VideoViewer-BxcUwXQm.js +1 -0
  57. package/dist/assets/ViewportShadingMenu-BoMPnTVh.js +1 -0
  58. package/dist/assets/active-ingest-0QjJWb7i.js +3 -0
  59. package/dist/assets/{animation-clock-Bm80XdqP.js → animation-clock-BXEwUJtz.js} +1 -1
  60. package/dist/assets/animation-mixers.service-C-Ko4KzM.js +1 -0
  61. package/dist/assets/animation-timeline.utility-Bl15-rYb.js +1 -0
  62. package/dist/assets/{asset-budget-asset.menu-CEgP0Kiw.js → asset-budget-asset.menu-BUa3g0Wy.js} +1 -1
  63. package/dist/assets/{asset-budget.action-D4R1c3wi.js → asset-budget.action-Dl5eVPIo.js} +1 -1
  64. package/dist/assets/{asset-budget.document-Syzjn1U1.js → asset-budget.document-DJylQ-0h.js} +1 -1
  65. package/dist/assets/{asset-budget.menu-BbRiqXeM.js → asset-budget.menu-BJtvNMLj.js} +1 -1
  66. package/dist/assets/asset-editor-persistence-BIbf5u0Q.js +1 -0
  67. package/dist/assets/asset-loaders-DoNflsHL.js +2 -0
  68. package/dist/assets/{asset-preview-B1tDziF1.js → asset-preview-DxlSdRZn.js} +1 -1
  69. package/dist/assets/{audio-unlock.service-ucMfCVBw.js → audio-unlock.service-CTaiyXF9.js} +1 -1
  70. package/dist/assets/audio.utility-CEmNc68t.js +1 -0
  71. package/dist/assets/autoplay.service-BZLSUyL8.js +1 -0
  72. package/dist/assets/{babylon-authoring-adapter-C8mFMXSr.js → babylon-authoring-adapter-BZvV2bz_.js} +1 -1
  73. package/dist/assets/binding-resolver-DGbk9_XR.js +2 -0
  74. package/dist/assets/blender-emscripten-engine-B7lfg-RX.js +2 -0
  75. package/dist/assets/{blender-node-editor.document-C1YmwWls.js → blender-node-editor.document-wXJobGNH.js} +1 -1
  76. package/dist/assets/{blender-properties-tab-B8lyjgj3.js → blender-properties-tab-7GFf80ev.js} +1 -1
  77. package/dist/assets/{blender-runtime-host-CyQlImSR.js → blender-runtime-host-CILxrx5T.js} +2 -2
  78. package/dist/assets/{blender-runtime-skin-BK7ShZ6z.js → blender-runtime-skin-Cd5lQYsC.js} +7 -7
  79. package/dist/assets/{blender-runtime.document-B0nVQs0P.js → blender-runtime.document-C0r_R49S.js} +7 -7
  80. package/dist/assets/{blender-timeline.document-CMcdE2CK.js → blender-timeline.document-BaISZMBc.js} +1 -1
  81. package/dist/assets/{blender-uv-editor.document-CjqNo4sZ.js → blender-uv-editor.document-CT_fsyyA.js} +1 -1
  82. package/dist/assets/blender-version.status-DzEx7u7k.js +1 -0
  83. package/dist/assets/blender-wali-engine-DOiQCBXH.js +2 -0
  84. package/dist/assets/{blender.command-C6NmRBo5.js → blender.command-DdiKd8mZ.js} +1 -1
  85. package/dist/assets/blender.keymap-BmOBRY7p.js +1 -0
  86. package/dist/assets/blender.status-BMETIbb2.js +1 -0
  87. package/dist/assets/board-guides-CjHQ9Ynm.js +1 -0
  88. package/dist/assets/body-marks-C1LxJtQb.js +1 -0
  89. package/dist/assets/bridge.command-DXUeavn5.js +3 -0
  90. package/dist/assets/{browserAll-lF_dLQVz.js → browserAll-Dg46xT22.js} +1 -1
  91. package/dist/assets/build-player.document-BHwVV3K0.js +1 -0
  92. package/dist/assets/build-profiles.document-HkpS-Kxa.js +2 -0
  93. package/dist/assets/build-progress.status-u1J0Rm1D.js +1 -0
  94. package/dist/assets/build-session-BLboUUbw.js +9 -0
  95. package/dist/assets/{build.action-DRX2IcYt.js → build.action-C00DL83N.js} +1 -1
  96. package/dist/assets/{build.command-BGvLaLG0.js → build.command-Cjk_NY75.js} +1 -1
  97. package/dist/assets/build.header-BWNmNWFT.js +1 -0
  98. package/dist/assets/{build.menu-UenrjPWS.js → build.menu-BBYtqCIq.js} +1 -1
  99. package/dist/assets/{build.service-BIUoTY6l.js → build.service-DOU15tKN.js} +1 -1
  100. package/dist/assets/{camera-DrvaM47S.js → camera-7DGyYW7Y.js} +1 -1
  101. package/dist/assets/{camera-runtime.inspector-CjJALNO8.js → camera-runtime.inspector-n-jiOR-3.js} +1 -1
  102. package/dist/assets/canvas-design-mount-CSRHU-ag.js +6 -0
  103. package/dist/assets/canvas-entry-runtime-BST8yRuK.js +2 -0
  104. package/dist/assets/{canvas-preview-frames-C0QTagA3.js → canvas-preview-frames-Cja32aW2.js} +1 -1
  105. package/dist/assets/{canvas-story-capture.service-Dgjr-rT1.js → canvas-story-capture.service-D5R5HJ8n.js} +2 -2
  106. package/dist/assets/capability-coverage-ByWftxk4.js +7 -0
  107. package/dist/assets/{collaboration-presence-BVIQuN1l.js → collaboration-presence-D6MC9xJN.js} +1 -1
  108. package/dist/assets/{collider-C7SbIYKY.js → collider-B78EcUc9.js} +1 -1
  109. package/dist/assets/{component-board.service-BEsFAw4_.js → component-board.service-BaQI5Oas.js} +2 -2
  110. package/dist/assets/component-board.service-CkjrsD8x.js +2 -0
  111. package/dist/assets/{component-board.service-CWFaGMCO.js → component-board.service-Dvjz_g-x.js} +2 -2
  112. package/dist/assets/component-contracts.service-C3-AXQp7.js +1 -0
  113. package/dist/assets/component-instance-root-DLI40MiB.js +1 -0
  114. package/dist/assets/{component-verbs.command-oNtGgzQL.js → component-verbs.command-Brr_WcaR.js} +1 -1
  115. package/dist/assets/component-verbs.service-DC2sC3j3.js +1 -0
  116. package/dist/assets/{config-_wCzzlM_.js → config-BI_7osdR.js} +3 -3
  117. package/dist/assets/{configurations-BXU4GGbV.js → configurations-XP9YLkrt.js} +1 -1
  118. package/dist/assets/connection.status-BhRwcFx0.js +1 -0
  119. package/dist/assets/{constraint-5KLYpGm7.js → constraint-Bp1l8hY-.js} +1 -1
  120. package/dist/assets/constraints.inspector-Dm1cycK3.js +1 -0
  121. package/dist/assets/{content-bounds-BeuIXKYu.js → content-bounds-DROIchTa.js} +1 -1
  122. package/dist/assets/{contract-system-adapters-Bic_7sev.js → contract-system-adapters-Cn7OW_ay.js} +1 -1
  123. package/dist/assets/coverage.service-l42ty7lr.js +3 -0
  124. package/dist/assets/create-runtime-B_uTwsmi.js +3 -0
  125. package/dist/assets/curve-THOUsg-j.js +1 -0
  126. package/dist/assets/{data-asset-DfQ2Pjse.js → data-asset-DAANayR6.js} +1 -1
  127. package/dist/assets/data-check-core-CHqar_E8.js +1 -0
  128. package/dist/assets/data-ref-CN34UeVw.js +1 -0
  129. package/dist/assets/debug-bridge-BD1XVAIB.js +1 -0
  130. package/dist/assets/debug-registry-ggQWxtu-.js +1 -0
  131. package/dist/assets/{deferred-ingest-play-BdR4qGk6.js → deferred-ingest-play-B2JUlwlT.js} +2 -2
  132. package/dist/assets/{design-time-canvas-mount-DPQeHSN2.js → design-time-canvas-mount-as9cN9I6.js} +2 -2
  133. package/dist/assets/design-time-layers-BRseeSmV.js +1 -0
  134. package/dist/assets/{design-time-mount.service-Ks-5Wkcs.js → design-time-mount.service-BTVu3yKo.js} +2 -2
  135. package/dist/assets/{design-time-mount.service-Ca-DZGFV.js → design-time-mount.service-DKvc7lVK.js} +2 -2
  136. package/dist/assets/design-time-react-mount-C7rB56QD.js +1 -0
  137. package/dist/assets/{document-preview-three-DThkjI1S.js → document-preview-three-CxmRhCcV.js} +1 -1
  138. package/dist/assets/{dom-authoring-adapter-BrLU8IJ_.js → dom-authoring-adapter-L8OzXfmE.js} +1 -1
  139. package/dist/assets/{draco3d-B2cwv46o.js → draco3d-BjNuXv66.js} +1 -1
  140. package/dist/assets/{edit-mode-audio.service-D4ITNbsm.js → edit-mode-audio.service-BwI5u845.js} +1 -1
  141. package/dist/assets/edit-mode-authoring-D5f7aHHl.js +1 -0
  142. package/dist/assets/{edit-mode-networking.service-BNv-FTRh.js → edit-mode-networking.service-DqP_4lbI.js} +1 -1
  143. package/dist/assets/editor-api-BM7H_F4G.js +1 -0
  144. package/dist/assets/{editor-layers-BDJnAAzj.js → editor-layers-D-CTUqco.js} +1 -1
  145. package/dist/assets/editor-presentation-activity-CqJH4G9t.js +1 -0
  146. package/dist/assets/{editor-shell-store-ChLcVeNB.js → editor-shell-store-DHVWS8cE.js} +1 -1
  147. package/dist/assets/{entity-object-JmYMfLsx.js → entity-object-MKYemTFM.js} +1 -1
  148. package/dist/assets/{extend-Cc-nEa_A.js → extend-BrgqZiMY.js} +1 -1
  149. package/dist/assets/fork-menu-DE2MK3Nq.js +1 -0
  150. package/dist/assets/{frame-debugger-store-DaCbAYSW.js → frame-debugger-store-BXoLKTdZ.js} +1 -1
  151. package/dist/assets/game-audio-BeCyd0Ha.js +1 -0
  152. package/dist/assets/{game-contract-seams-BnPFGLll.js → game-contract-seams-tyKDsfaP.js} +1 -1
  153. package/dist/assets/{game-css-scope-transform-D_p7cVgW.js → game-css-scope-transform-DcjrwtVc.js} +2 -2
  154. package/dist/assets/game-document.service-CTb2itHQ.js +1 -0
  155. package/dist/assets/game-eval.command-CpDKXOQU.js +2 -0
  156. package/dist/assets/game-module-access-BTInp2NG.js +1 -0
  157. package/dist/assets/game-network-DW5ARz4R.js +22 -0
  158. package/dist/assets/{gameplay-export-BzYzLZPi.js → gameplay-export-cHk3v9y-.js} +1 -1
  159. package/dist/assets/gameplay-replay-HRenPTtU.js +1 -0
  160. package/dist/assets/gameplay.command-DcY2lKKX.js +1 -0
  161. package/dist/assets/generation-CdOATubd.css +1 -0
  162. package/dist/assets/{generation-jobs-BZhOMrp-.js → generation-jobs-CJBehuUp.js} +1 -1
  163. package/dist/assets/generation.service-BMOc-C9i.js +1 -0
  164. package/dist/assets/{generations-DVDht_31.js → generations-ssgVOe_6.js} +1 -1
  165. package/dist/assets/generations.status-B_SmPReI.js +1 -0
  166. package/dist/assets/hierarchy-marks-BuCO8Ke-.js +1 -0
  167. package/dist/assets/hierarchy-marks-CsTaTkc7.js +1 -0
  168. package/dist/assets/hosted-asset-materialization-CiXZI85V.js +2 -0
  169. package/dist/assets/{ibl-override-material-CiKkaOTW.js → ibl-override-material-CMo_a49U.js} +1 -1
  170. package/dist/assets/index-B0S4fQQV.js +1 -0
  171. package/dist/assets/{index-C3Pw-9So.js → index-B9bd4k-t.js} +1 -1
  172. package/dist/assets/index-BMxv2MNV.js +1 -0
  173. package/dist/assets/{index-DUZeuA7g.js → index-Bm4_DmRO.js} +1 -1
  174. package/dist/assets/{index-cNc-iFbq.js → index-BvBlIRwM.js} +1 -1
  175. package/dist/assets/{index-Ck3JFh48.js → index-BweKDdi_.js} +1 -1
  176. package/dist/assets/{index-BRJMIUK0.js → index-C5ZAyrKq.js} +346 -345
  177. package/dist/assets/index-CPiRKiDC.css +1 -0
  178. package/dist/assets/index-CfpGZrbC.js +1 -0
  179. package/dist/assets/index-Czvj6whv.js +1 -0
  180. package/dist/assets/{index-SS9EugVg.js → index-DgPDGGSV.js} +2 -2
  181. package/dist/assets/{inference-diagnostics-xecGdohW.js → inference-diagnostics-DLt9ql9I.js} +1 -1
  182. package/dist/assets/{ingest-boot-viewport-DAt8WFSy.js → ingest-boot-viewport-BXVXjYpG.js} +1 -1
  183. package/dist/assets/ingest-siblings-DWJ7OGB_.js +1 -0
  184. package/dist/assets/ingest-source-persistence-6ShMoSCa.js +1 -0
  185. package/dist/assets/ingest.service-BBbX8ibg.js +1 -0
  186. package/dist/assets/{inspect-Dr4qvDpJ.js → inspect-Cz3Zyx_1.js} +1 -1
  187. package/dist/assets/inspection-D8fZOHCM.js +1 -0
  188. package/dist/assets/instances.command-BrdlngrL.js +1 -0
  189. package/dist/assets/{json-history-resource-DwS10tqD.js → json-history-resource-Uqrihfc8.js} +1 -1
  190. package/dist/assets/layered-pick-CAVQMPI7.js +1 -0
  191. package/dist/assets/{light-DcFqVCmv.js → light-CqzsCWeJ.js} +1 -1
  192. package/dist/assets/{live-project-verbs-C3LzprCe.js → live-project-verbs-CdFmLYOo.js} +1 -1
  193. package/dist/assets/{machine.document-BzZxubYQ.js → machine.document-DRIFOVaa.js} +1 -1
  194. package/dist/assets/{machines.finder-BR02bfVG.js → machines.finder-DPCT6few.js} +1 -1
  195. package/dist/assets/material-BVApn1V_.js +1 -0
  196. package/dist/assets/{material-factory-COz7qZhC.js → material-factory-B_75xxFD.js} +1 -1
  197. package/dist/assets/{mesh-DcmO-mWI.js → mesh-DdA3mExo.js} +1 -1
  198. package/dist/assets/model-asset-sections-D1uxOu2v.css +1 -0
  199. package/dist/assets/model-asset-sections.service-CJnSIckZ.js +1 -0
  200. package/dist/assets/{model-inspection-CXHxrafK.js → model-inspection-DvspbmJl.js} +1 -1
  201. package/dist/assets/{model-thumbnail-BEKPWg4l.js → model-thumbnail-BmQs-h6t.js} +1 -1
  202. package/dist/assets/{models.finder-c1I0tp2M.js → models.finder-Qv_Hsccy.js} +1 -1
  203. package/dist/assets/module-mode-MJ4Gbsry.js +2 -0
  204. package/dist/assets/mount-canvas-ingest-root-BxtM8OaB.js +2 -0
  205. package/dist/assets/mount-dom-ingest-root-pGatqO46.js +2 -0
  206. package/dist/assets/mount-ingest-root-C7jb-mCl.js +2 -0
  207. package/dist/assets/mount-manifest-BfoHBuzn.js +1 -0
  208. package/dist/assets/mount-readiness-DyAd17pe.js +4 -0
  209. package/dist/assets/mount-three-ingest-root-Boa5mcaF.js +1 -0
  210. package/dist/assets/{mounted-authoring-Clftxx0x.js → mounted-authoring-DxMISwvR.js} +1 -1
  211. package/dist/assets/{mounted-story-viewport-source-B4-eAYGI.js → mounted-story-viewport-source-DfnLxI1f.js} +1 -1
  212. package/dist/assets/{native-debug-module-2_HVupdg.js → native-debug-module-BlrALjM3.js} +1 -1
  213. package/dist/assets/{navigation-CH3-zr1n.js → navigation-CqG5o5AR.js} +1 -1
  214. package/dist/assets/{navmesh.menu-Dfi-Pk-8.js → navmesh.menu-D4TdVDhe.js} +1 -1
  215. package/dist/assets/{navmesh.service-Cz7QFY-M.js → navmesh.service-DWKT5ruQ.js} +1 -1
  216. package/dist/assets/network-observer.service-ZRAquNq4.js +1 -0
  217. package/dist/assets/network.utility-DjeOEvAY.js +1 -0
  218. package/dist/assets/object-marks-BnvSuCTt.js +1 -0
  219. package/dist/assets/{object3d-authoring-subject-BDrxd1GA.js → object3d-authoring-subject-XccsO0xG.js} +1 -1
  220. package/dist/assets/{object3d-document-session-registry-DJDEDM0p.js → object3d-document-session-registry-CMRJdFp6.js} +2 -2
  221. package/dist/assets/{oid-transform-D5Kxt6ij.js → oid-transform-DaA6yW6o.js} +1 -1
  222. package/dist/assets/{particles-vRp0Lf3o.js → particles-DsQRcDBY.js} +1 -1
  223. package/dist/assets/{performance-profiler-OwnXQX0M.js → performance-profiler-CMbwGBuk.js} +1 -1
  224. package/dist/assets/pixi-authoring-adapter-BoBt8bB5.js +1 -0
  225. package/dist/assets/pixi-live-write-target-CYZgvC6U.js +1 -0
  226. package/dist/assets/play.command-D9JGJP-e.js +2 -0
  227. package/dist/assets/pose-guard-CLabLSzf.js +1 -0
  228. package/dist/assets/presentation-COhHQdmR.js +1 -0
  229. package/dist/assets/{product-CxmUIxmr.js → product-CaRGoiIH.js} +1 -1
  230. package/dist/assets/{profiler.action-Dzy9DuAc.js → profiler.action-Cz7HYWjh.js} +1 -1
  231. package/dist/assets/{profiler.menu-jLDO3U6N.js → profiler.menu-D5aR_FBy.js} +1 -1
  232. package/dist/assets/profiler.utility-KwxlIPKb.js +1 -0
  233. package/dist/assets/{project-authoring-session-C3eusefK.js → project-authoring-session-DKXHVwxO.js} +2 -2
  234. package/dist/assets/project-provenance-BGnJXJwa.js +1 -0
  235. package/dist/assets/{properties-bone-constraints.inspector-B_PbSMV7.js → properties-bone-constraints.inspector-Bo-sU8eR.js} +1 -1
  236. package/dist/assets/{properties-bone.inspector-CMDEQuBd.js → properties-bone.inspector-BQiWplQv.js} +1 -1
  237. package/dist/assets/{properties-collection.inspector-D7Ay8yRj.js → properties-collection.inspector-C5BnR-GE.js} +1 -1
  238. package/dist/assets/{properties-constraints.inspector-DS1fZgXK.js → properties-constraints.inspector-CyheU12R.js} +1 -1
  239. package/dist/assets/{properties-data.inspector-k2pGN2Mp.js → properties-data.inspector-CkycARja.js} +1 -1
  240. package/dist/assets/{properties-material.inspector-Bb3yAGUx.js → properties-material.inspector-Bl_PUmY-.js} +1 -1
  241. package/dist/assets/{properties-modifiers.inspector-BcJfe-Wy.js → properties-modifiers.inspector-j7SnOxQq.js} +1 -1
  242. package/dist/assets/{properties-object.inspector-CUSfXJuq.js → properties-object.inspector-DcR3MGLK.js} +1 -1
  243. package/dist/assets/{properties-output.inspector-BTVW2kn1.js → properties-output.inspector-BLjw6K4b.js} +1 -1
  244. package/dist/assets/{properties-particles.inspector-Cw0fxx3B.js → properties-particles.inspector-BUIm2-Jf.js} +1 -1
  245. package/dist/assets/{properties-physics.inspector-C-0bD2bu.js → properties-physics.inspector-DNvRcxb6.js} +1 -1
  246. package/dist/assets/{properties-render.inspector-C8D5UpjX.js → properties-render.inspector-8FMZ-qoZ.js} +1 -1
  247. package/dist/assets/{properties-scene.inspector-HjK6QHGg.js → properties-scene.inspector-Dx7_z75k.js} +1 -1
  248. package/dist/assets/{properties-texture.inspector-CckZgUaI.js → properties-texture.inspector-WT15951-.js} +1 -1
  249. package/dist/assets/{properties-view-layer.inspector-C1ajtVSk.js → properties-view-layer.inspector-P7VNTdqr.js} +1 -1
  250. package/dist/assets/{properties-world.inspector-BiT_EdT-.js → properties-world.inspector-B3t1q8TF.js} +1 -1
  251. package/dist/assets/r3f-design-session-lsbFnoWH.js +2 -0
  252. package/dist/assets/{r3f-physics-binding-DzrbpqjM.js → r3f-physics-binding-Cx8yhuwt.js} +1 -1
  253. package/dist/assets/{r3f-source-authoring-adapter-DbbeRcvt.js → r3f-source-authoring-adapter-jH3G0TeH.js} +2 -2
  254. package/dist/assets/react-canvas-navigation-B_gOe3CI.js +1 -0
  255. package/dist/assets/react-inspector.service-CZf1vfdX.js +1 -0
  256. package/dist/assets/react-story-board-CCm2Opwn.js +1 -0
  257. package/dist/assets/{react-three-rapier.esm-U8J7g6tH.js → react-three-rapier.esm-CHXGG51p.js} +1 -1
  258. package/dist/assets/react-world-authoring-adapter-CnzxMtYz.js +1 -0
  259. package/dist/assets/{realm-services-CnY105XU.js → realm-services-Do9J6nsb.js} +1 -1
  260. package/dist/assets/reflection-probe-capture.inspector-BAjjIybz.js +1 -0
  261. package/dist/assets/{reflection-probe-BHNGwVyz.js → reflection-probe-sIto9mh0.js} +1 -1
  262. package/dist/assets/registry-Xnduk02T.js +1 -0
  263. package/dist/assets/{relative-import-specifier-BFKIWEWs.js → relative-import-specifier-CPFTrxi4.js} +1 -1
  264. package/dist/assets/{render-env-BkKZ4uMA.js → render-env-YJlI8K0i.js} +1 -1
  265. package/dist/assets/{render-features-rxbawsRb.js → render-features-DMSV2qKJ.js} +1 -1
  266. package/dist/assets/{render-settings-DS5leCed.js → render-settings-CRyDhHyz.js} +1 -1
  267. package/dist/assets/{resolve-three-CVnMRHxw.js → resolve-three-D27rMc37.js} +19 -19
  268. package/dist/assets/root-seam-contract-gjWUd5uu.js +1 -0
  269. package/dist/assets/run-selection-B0jOdyYt.js +2 -0
  270. package/dist/assets/scene-capture-Di9cM1p4.js +1 -0
  271. package/dist/assets/scene-document.service-XxGs4HHE.js +2 -0
  272. package/dist/assets/{scene-framing-BQt72ZCw.js → scene-framing-DkZKDwH3.js} +1 -1
  273. package/dist/assets/{scene-index--lRWLEmW.js → scene-index-DHeKmalD.js} +1 -1
  274. package/dist/assets/{scene-query-s1y04OVB.js → scene-query-ByZtXA2m.js} +1 -1
  275. package/dist/assets/seeded-random-BJthDRMu.js +1 -0
  276. package/dist/assets/{session-CTXsU1lK.js → session-x8E_NJk2.js} +34 -34
  277. package/dist/assets/{setup-renderer-Cwkl1Ar6.js → setup-renderer-F9mG7t6r.js} +1 -1
  278. package/dist/assets/{source-object3d-authoring-adapter-DF679Ncb.js → source-object3d-authoring-adapter-CvmFpSUj.js} +1 -1
  279. package/dist/assets/{source-persistence-backend-CwLYVPXj.js → source-persistence-backend-au3WtEn6.js} +1 -1
  280. package/dist/assets/{spark-renderer-lifecycle-DfYpvEJa.js → spark-renderer-lifecycle-B6Axb6jm.js} +1 -1
  281. package/dist/assets/{stage-keyboard-B8BEW592.js → stage-keyboard-BQkndG_D.js} +1 -1
  282. package/dist/assets/stage-overlay-set-g6eWhuRv.js +1 -0
  283. package/dist/assets/stage-presence-markers-0CDfO5f4.js +1 -0
  284. package/dist/assets/stage-transform-tools-BzPl7OIo.js +1 -0
  285. package/dist/assets/standard-viewport-dressing-BW-dM_1h.js +24 -0
  286. package/dist/assets/{state-watch.action-DnR5Zjr-.js → state-watch.action-Z1nQ5awu.js} +1 -1
  287. package/dist/assets/{state-watch.menu-wYLCLsAw.js → state-watch.menu-CQHGUF3W.js} +1 -1
  288. package/dist/assets/state-watch.utility-DCIg2i79.js +1 -0
  289. package/dist/assets/{story-capture-BmnwHGDV.js → story-capture-BIrjDKeY.js} +1 -1
  290. package/dist/assets/story-documents-BvG2xeaR.js +3 -0
  291. package/dist/assets/{story-documents.service-B6v7Z-WE.js → story-documents.service-DOSEa3ja.js} +1 -1
  292. package/dist/assets/{story-documents.service-yagl1wGp.js → story-documents.service-y1m7XGMJ.js} +1 -1
  293. package/dist/assets/{story-media-presence-BqRMu572.js → story-media-presence-HLV-KaMj.js} +1 -1
  294. package/dist/assets/{story-pixi-preview-Da6afqLg.js → story-pixi-preview-CMhho2gG.js} +1 -1
  295. package/dist/assets/{story-presentation-DMSYRWaz.js → story-presentation-CYhVv8Ku.js} +1 -1
  296. package/dist/assets/story-three-preview-CgcLF5lE.js +2 -0
  297. package/dist/assets/{structural-ids-Br2zjINh.js → structural-ids-BOo2BRoY.js} +1 -1
  298. package/dist/assets/studio-environment-R9qXUUcC.js +2 -0
  299. package/dist/assets/{surface-state-1lTOi8FD.js → surface-state-D8Qnowo6.js} +1 -1
  300. package/dist/assets/{syntactic-prop-specs-eiQXwMIc.js → syntactic-prop-specs-8gkBuc5j.js} +1 -1
  301. package/dist/assets/team-playtest.service-BBMZ2iyk.js +1 -0
  302. package/dist/assets/{three-TCuY32m_.js → three-DiL6vMXq.js} +1 -1
  303. package/dist/assets/three-authoring-adapter-CkLR2zGf.js +1 -0
  304. package/dist/assets/three-authoring.service-CovhlCGx.js +2 -0
  305. package/dist/assets/{three-ingest-runtime-B7rtg3QE.js → three-ingest-runtime-CwTqAHgX.js} +1 -1
  306. package/dist/assets/{three-integration-BdN5Nhsg.js → three-integration-DXOFI88n.js} +2 -2
  307. package/dist/assets/three-integration.service-rCAqpqSp.js +1 -0
  308. package/dist/assets/three-projection-core-B7Lf8tOp.js +1 -0
  309. package/dist/assets/{three-state-DwFE3ay2.js → three-state-BCACvUtm.js} +1 -1
  310. package/dist/assets/{three-story-capture.service-CvpV3v5a.js → three-story-capture.service-rTFKNtHA.js} +2 -2
  311. package/dist/assets/{three-story-model-C2r2BuiA.js → three-story-model-BjKr7OMn.js} +1 -1
  312. package/dist/assets/three-viewport-presentation-CBzvc2v2.js +141 -0
  313. package/dist/assets/tools-DfctM216.js +1 -0
  314. package/dist/assets/transform-mode-request-DlEApNrA.js +1 -0
  315. package/dist/assets/transport-strip-xCg94CuI.js +1 -0
  316. package/dist/assets/transport.header-BRtdky0x.js +1 -0
  317. package/dist/assets/{trigger-volume-DP0G1VBe.js → trigger-volume-BLkHmfm9.js} +1 -1
  318. package/dist/assets/tuples-BDz3wbQL.js +1 -0
  319. package/dist/assets/ui-board-document-DvbK_HVN.js +2 -0
  320. package/dist/assets/{user-data-Bpj7diUS.js → user-data-C84W0V47.js} +1 -1
  321. package/dist/assets/user-data-CODoGZqA.js +1 -0
  322. package/dist/assets/{utility-view-state-CAfbFbKQ.js → utility-view-state-CDRxZSo-.js} +1 -1
  323. package/dist/assets/viewport-door-BARIpMu-.js +1 -0
  324. package/dist/assets/{viewport-root-presentation-vgxsTyj4.js → viewport-root-presentation-hRLF0BeO.js} +1 -1
  325. package/dist/assets/{viewport-surface-status-cwCiBGa7.js → viewport-surface-status-TUfhXKR9.js} +1 -1
  326. package/dist/assets/{webworkerAll-Cm3gTjWi.js → webworkerAll-PJtcQ1FD.js} +1 -1
  327. package/dist/assets/worker-BtXrsgFy.js +2 -0
  328. package/dist/assets/workspace-arrangement-DqG5sUns.js +1 -0
  329. package/dist/assets/world-documents-D69XaqUX.js +1 -0
  330. package/dist/assets/world-root-stage-binding-BgZWZEuD.js +1 -0
  331. package/dist/assets/{xstate-animation-binding-BGLxcZT_.js → xstate-animation-binding-CIyLzGHs.js} +1 -1
  332. package/dist/assets/{xstate-animation-meta-D_T441Ru.js → xstate-animation-meta-CbYWup3R.js} +1 -1
  333. package/dist/volter-shared-react.json +10 -0
  334. package/dist/volter-shared-three.json +3 -0
  335. package/dist-node/cli.js +253 -210
  336. package/dist-node/create.js +103 -82
  337. package/package.json +23 -20
  338. package/src/contributions.d.ts +1 -1
  339. package/src/index.ts +10 -10
  340. package/starter/cube.py +1 -1
  341. package/template/.agents/references/project-manual.md +17 -17
  342. package/template/.agents/skills/editor/SKILL.md +6 -6
  343. package/template/.agents/skills/editor/agents/openai.yaml +3 -3
  344. package/template/.agents/skills/editor/references/editor-control.md +62 -62
  345. package/template/{.claude/skills/vgai-3d-models → .agents/skills/volter-3d-models}/SKILL.md +3 -3
  346. package/template/{.github/skills/vgai-ingest-existing-game → .agents/skills/volter-ingest-existing-game}/SKILL.md +2 -2
  347. package/template/.agents/skills/{vgai-music → volter-music}/SKILL.md +35 -11
  348. package/template/{.claude/skills/vgai-threejs-authoring → .agents/skills/volter-threejs-authoring}/SKILL.md +9 -9
  349. package/template/.agents/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  350. package/template/{.github/skills/vgai-threejs-authoring → .agents/skills/volter-threejs-authoring}/references/helper-catalog.md +1 -1
  351. package/template/.claude/skills/editor/SKILL.md +6 -6
  352. package/template/.claude/skills/editor/agents/openai.yaml +3 -3
  353. package/template/.claude/skills/editor/references/editor-control.md +62 -62
  354. package/template/{.agents/skills/vgai-3d-models → .claude/skills/volter-3d-models}/SKILL.md +3 -3
  355. package/template/{.agents/skills/vgai-ingest-existing-game → .claude/skills/volter-ingest-existing-game}/SKILL.md +2 -2
  356. package/template/{.github/skills/vgai-threejs-authoring → .claude/skills/volter-threejs-authoring}/SKILL.md +9 -9
  357. package/template/.claude/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  358. package/template/.claude/skills/{vgai-threejs-authoring → volter-threejs-authoring}/references/helper-catalog.md +1 -1
  359. package/template/.github/copilot-instructions.md +1 -1
  360. package/template/.github/skills/editor/SKILL.md +6 -6
  361. package/template/.github/skills/editor/agents/openai.yaml +3 -3
  362. package/template/.github/skills/editor/references/editor-control.md +62 -62
  363. package/template/.github/skills/{vgai-3d-models → volter-3d-models}/SKILL.md +3 -3
  364. package/template/{.claude/skills/vgai-ingest-existing-game → .github/skills/volter-ingest-existing-game}/SKILL.md +2 -2
  365. package/template/{.agents/skills/vgai-threejs-authoring → .github/skills/volter-threejs-authoring}/SKILL.md +9 -9
  366. package/template/.github/skills/volter-threejs-authoring/agents/openai.yaml +4 -0
  367. package/template/{.agents/skills/vgai-threejs-authoring → .github/skills/volter-threejs-authoring}/references/helper-catalog.md +1 -1
  368. package/template/.mcp.json +3 -3
  369. package/template/AGENTS.md +24 -23
  370. package/template/DEVLOG.md +1 -1
  371. package/template/IDIOMS.md +3 -3
  372. package/template/LICENSE +3 -3
  373. package/template/README.md +12 -12
  374. package/template/check-idioms.ts +51 -51
  375. package/template/manifest-entry-modules-plugin.ts +17 -4
  376. package/template/package.json +12 -12
  377. package/template/server/loopback.ts +1 -1
  378. package/template/server/main.ts +4 -4
  379. package/template/server/rooms/arena-room.ts +8 -8
  380. package/template/server/rooms/game-room.ts +8 -8
  381. package/template/server/rooms.ts +2 -2
  382. package/template/src/bot/QaTester.tsx +1 -1
  383. package/template/src/bot/bot-station.ts +2 -2
  384. package/template/src/bot/tester-station.ts +1 -1
  385. package/template/src/contributions/README.md +1 -1
  386. package/template/src/contributions/analytics.analytics.tsx +1 -1
  387. package/template/src/contributions/data.document.tsx +2 -2
  388. package/template/src/contributions/pages.finder.ts +1 -1
  389. package/template/src/contributions/tester.inspector.tsx +2 -2
  390. package/template/src/contributions/use-game-modules.ts +1 -1
  391. package/template/src/input.ts +2 -2
  392. package/template/src/lib/reflections/volume-reflection-material.ts +59 -59
  393. package/template/src/lib/static-batch/Frozen.tsx +1 -1
  394. package/template/src/lib/static-batch/mutation-watch.ts +1 -1
  395. package/template/src/main.ts +58 -6
  396. package/template/src/manifest-entry-modules.d.ts +12 -1
  397. package/template/src/prefabs/HeroBox.stories.tsx +1 -1
  398. package/template/src/world.tsx +1 -1
  399. package/template/tsconfig.json +1 -1
  400. package/template/validate-manifest.ts +3 -3
  401. package/template/vite.config.ts +11 -11
  402. package/template/{vgai.adapter.ts → volter.adapter.ts} +1 -1
  403. package/template/{vgai.project.json → volter.project.json} +2 -2
  404. package/template-dotfiles/gitignore +27 -27
  405. package/workbench/src/media/game-cover.css +11 -11
  406. package/workbench/src/product.contribution.ts +28 -28
  407. package/workbench/src/{vgaiGameSkew.ts → volterGameSkew.ts} +16 -16
  408. package/dist/assets/AudioViewer-BDPqHDfU.js +0 -1
  409. package/dist/assets/CanvasBoardDocument-mxL0oJ3N.js +0 -1
  410. package/dist/assets/CanvasSceneViewport-C_mapCwC.js +0 -1
  411. package/dist/assets/ColorInput-QUPS1pEB.js +0 -1
  412. package/dist/assets/ImageViewer-tlVvkdM4.js +0 -1
  413. package/dist/assets/InspectorObjectPreview-W-y079DS.js +0 -1
  414. package/dist/assets/JsonAssetDocument-CPmcWFPW.js +0 -2
  415. package/dist/assets/ModelAssetDocument-De1HKuxG.js +0 -1
  416. package/dist/assets/Object3DDocumentToolbar-Cks81kCS.js +0 -1
  417. package/dist/assets/Object3DDocumentViewport-DCwiSY3O.js +0 -2
  418. package/dist/assets/OnlineAssetDetail-CNuwSQRQ.js +0 -1
  419. package/dist/assets/PlayBar-bT8Xdrap.js +0 -1
  420. package/dist/assets/ReactCanvasControls-CnJrPj-B.js +0 -1
  421. package/dist/assets/RootSelectionOverlay-CpaGluQu.js +0 -1
  422. package/dist/assets/ShadowEditor-CVtMlALn.js +0 -1
  423. package/dist/assets/StageHost-B89HKcvd.js +0 -2
  424. package/dist/assets/ThreeBoardDocument-BAgHrbtu.js +0 -2
  425. package/dist/assets/Toolbar-DkTHnQto.js +0 -1
  426. package/dist/assets/VideoViewer-DMV8lf4P.js +0 -1
  427. package/dist/assets/ViewportShadingMenu-CXPi6fl8.js +0 -1
  428. package/dist/assets/active-ingest-DA426a81.js +0 -3
  429. package/dist/assets/adapter-runtime-bindings-4cmsRvRh.js +0 -2
  430. package/dist/assets/animation-mixers.service-DK64IuYq.js +0 -1
  431. package/dist/assets/animation-timeline.utility-D-g0zrOl.js +0 -1
  432. package/dist/assets/asset-editor-persistence-BGWIqZdk.js +0 -1
  433. package/dist/assets/asset-loaders-C0KQI5eY.js +0 -2
  434. package/dist/assets/audio.utility-BmE9WMUg.js +0 -1
  435. package/dist/assets/autoplay.service-CjPnv3QW.js +0 -1
  436. package/dist/assets/binding-resolver-dE0GnZT5.js +0 -2
  437. package/dist/assets/blender-emscripten-engine-BeWFjMn-.js +0 -2
  438. package/dist/assets/blender-version.status-OsFoc9SA.js +0 -1
  439. package/dist/assets/blender-wali-engine-da698rDf.js +0 -2
  440. package/dist/assets/blender.keymap-_rF_vRX8.js +0 -1
  441. package/dist/assets/blender.status-ujwGU6dU.js +0 -1
  442. package/dist/assets/board-guides-BEKPgD9M.js +0 -1
  443. package/dist/assets/body-marks-RKb_LTwL.js +0 -1
  444. package/dist/assets/bridge.command-BF00Iefm.js +0 -3
  445. package/dist/assets/build-profiles.document-CqNrDdh9.js +0 -2
  446. package/dist/assets/build-progress.status-Bo1ZgJcb.js +0 -1
  447. package/dist/assets/build-session-GZcSAfPN.js +0 -9
  448. package/dist/assets/build.header-Bt1kwHWl.js +0 -1
  449. package/dist/assets/canvas-design-mount-BbLW_Nci.js +0 -6
  450. package/dist/assets/canvas-entry-runtime-UNYuSfG0.js +0 -2
  451. package/dist/assets/capability-coverage-DZ-onC5j.js +0 -7
  452. package/dist/assets/component-board.service-q_TM9BCw.js +0 -2
  453. package/dist/assets/component-contracts.service-CPbfXE1h.js +0 -1
  454. package/dist/assets/component-instance-root-B0C5oNEm.js +0 -1
  455. package/dist/assets/component-verbs.service-CnA11bJq.js +0 -1
  456. package/dist/assets/connection.status-Yvt0bX0r.js +0 -1
  457. package/dist/assets/constraints.inspector-4r8jWq5a.js +0 -1
  458. package/dist/assets/coverage.service-DcpEoBuf.js +0 -3
  459. package/dist/assets/create-runtime-DBfUy0SO.js +0 -3
  460. package/dist/assets/curve-DVd18iAX.js +0 -1
  461. package/dist/assets/data-check-core-CQEjuFyt.js +0 -1
  462. package/dist/assets/data-ref-CWnkj-HX.js +0 -1
  463. package/dist/assets/debug-bridge-D3_-EgRE.js +0 -1
  464. package/dist/assets/debug-registry-P0_YQGWd.js +0 -1
  465. package/dist/assets/design-time-layers-ChswRUJt.js +0 -1
  466. package/dist/assets/design-time-react-mount-C85KfXOd.js +0 -1
  467. package/dist/assets/edit-mode-authoring-DeCxPcHM.js +0 -1
  468. package/dist/assets/editor-api-BFTIRlWa.js +0 -1
  469. package/dist/assets/editor-presentation-activity-C7SNSmTd.js +0 -1
  470. package/dist/assets/entry-adjudication-Dc18TIqT.js +0 -1
  471. package/dist/assets/fork-menu-DpKqRhF5.js +0 -1
  472. package/dist/assets/game-audio-CaGKzia4.js +0 -1
  473. package/dist/assets/game-document.service-Chmt4065.js +0 -1
  474. package/dist/assets/game-eval.command-DRSvOJ_1.js +0 -2
  475. package/dist/assets/game-module-access-o3iXZpCA.js +0 -1
  476. package/dist/assets/game-network-Ct2FQYmu.js +0 -1
  477. package/dist/assets/gameplay-replay-BwdxV4oF.js +0 -1
  478. package/dist/assets/gameplay.command-Boqv1hnc.js +0 -1
  479. package/dist/assets/generation-DhwCUHPf.css +0 -1
  480. package/dist/assets/generation.service-o9aXlsx4.js +0 -1
  481. package/dist/assets/generations.status-BvzgHlyk.js +0 -1
  482. package/dist/assets/hierarchy-marks-BLPfSIym.js +0 -1
  483. package/dist/assets/hierarchy-marks-Cc_3lxw6.js +0 -1
  484. package/dist/assets/hosted-asset-materialization-BpbnhJac.js +0 -2
  485. package/dist/assets/index-0Lm0Nf1M.css +0 -1
  486. package/dist/assets/index-BHoAKyAC.js +0 -1
  487. package/dist/assets/index-BeK4RPgj.js +0 -1
  488. package/dist/assets/index-C1c3eOmm.js +0 -1
  489. package/dist/assets/index.module-Ycad3DJq.js +0 -1
  490. package/dist/assets/ingest-siblings-BtiEXLnh.js +0 -1
  491. package/dist/assets/ingest-source-persistence-Dmdo-UBp.js +0 -1
  492. package/dist/assets/ingest.service-vbCucMz7.js +0 -1
  493. package/dist/assets/inspection-CObLhnrs.js +0 -1
  494. package/dist/assets/instances.command-BwayrqNm.js +0 -1
  495. package/dist/assets/layered-pick-kiQf53t5.js +0 -1
  496. package/dist/assets/material-B_V78pTt.js +0 -1
  497. package/dist/assets/model-asset-sections-CFvvihfx.css +0 -1
  498. package/dist/assets/model-asset-sections.service-CqSclZGY.js +0 -1
  499. package/dist/assets/module-mode-BH2R93XP.js +0 -2
  500. package/dist/assets/mount-canvas-ingest-root-D1z9i5B3.js +0 -2
  501. package/dist/assets/mount-dom-ingest-root-BAmmNxlm.js +0 -2
  502. package/dist/assets/mount-ingest-root-DYR0TMIt.js +0 -2
  503. package/dist/assets/mount-manifest-DdkFYdVA.js +0 -1
  504. package/dist/assets/mount-readiness-Ds0HvvLH.js +0 -4
  505. package/dist/assets/mount-three-ingest-root-DVbACDUy.js +0 -1
  506. package/dist/assets/network-observer.service-Ce83TdsU.js +0 -1
  507. package/dist/assets/network.utility-DFDul2Xb.js +0 -1
  508. package/dist/assets/object-marks-DwvIEBOK.js +0 -1
  509. package/dist/assets/pixi-authoring-adapter-BChknIdC.js +0 -1
  510. package/dist/assets/pixi-live-write-target-BjDsBQbp.js +0 -1
  511. package/dist/assets/play-mode-DICV4cKP.js +0 -22
  512. package/dist/assets/play.command-NHyi5rzF.js +0 -2
  513. package/dist/assets/pose-guard-DILO6gGq.js +0 -1
  514. package/dist/assets/presentation-BeNFBfKg.js +0 -1
  515. package/dist/assets/profiler.utility-Do2Bw7MY.js +0 -1
  516. package/dist/assets/project-provenance-4ldz-EOG.js +0 -1
  517. package/dist/assets/r3f-design-session-B5GsZI5M.js +0 -2
  518. package/dist/assets/react-canvas-navigation-Cp3cOHJa.js +0 -1
  519. package/dist/assets/react-inspector.service-Bm0OnanU.js +0 -1
  520. package/dist/assets/react-story-board-GaXqr03H.js +0 -1
  521. package/dist/assets/react-world-authoring-adapter-DOjv2pYm.js +0 -1
  522. package/dist/assets/reflection-probe-capture.inspector-DqSW9p1v.js +0 -1
  523. package/dist/assets/registry-CaCdF63N.js +0 -1
  524. package/dist/assets/root-seam-contract-CxLZaRio.js +0 -1
  525. package/dist/assets/run-selection-DzEkGesJ.js +0 -2
  526. package/dist/assets/scene-capture-0a-bTjT8.js +0 -1
  527. package/dist/assets/scene-document.service-CeDwVA7t.js +0 -2
  528. package/dist/assets/seeded-random-BgCwIAAU.js +0 -1
  529. package/dist/assets/stage-overlay-set-BGE03mqb.js +0 -1
  530. package/dist/assets/stage-presence-markers-DIP7YMcO.js +0 -1
  531. package/dist/assets/stage-transform-tools-BQB7EY4l.js +0 -1
  532. package/dist/assets/standard-viewport-dressing-BCA51Tum.js +0 -24
  533. package/dist/assets/state-watch.utility-CFG1Tu1m.js +0 -1
  534. package/dist/assets/story-documents-BTo90DiA.js +0 -3
  535. package/dist/assets/story-three-preview-R1JvrggS.js +0 -2
  536. package/dist/assets/studio-environment-DRxxq_QX.js +0 -2
  537. package/dist/assets/team-playtest.service-hLfjgScx.js +0 -1
  538. package/dist/assets/three-authoring-adapter-htbnVej2.js +0 -1
  539. package/dist/assets/three-authoring.service-BIQAtVdX.js +0 -2
  540. package/dist/assets/three-integration.service-CS8Nvbd2.js +0 -1
  541. package/dist/assets/three-projection-core-CG01r5Ta.js +0 -1
  542. package/dist/assets/three-viewport-presentation-B0z_cECu.js +0 -141
  543. package/dist/assets/tools-B_NJsk05.js +0 -1
  544. package/dist/assets/transform-mode-request-DzD9aUNA.js +0 -1
  545. package/dist/assets/transport-strip-CUjNltnb.js +0 -1
  546. package/dist/assets/transport.header-Bb4FpQ8J.js +0 -1
  547. package/dist/assets/tuples-DfWSY2tr.js +0 -1
  548. package/dist/assets/ui-board-document-CCiiXjX9.js +0 -2
  549. package/dist/assets/user-data-dHvLdpwM.js +0 -1
  550. package/dist/assets/viewport-door-Bj_ZIP85.js +0 -1
  551. package/dist/assets/worker-CC9Ug5Ei.js +0 -2
  552. package/dist/assets/workspace-arrangement-BdAlBwvd.js +0 -1
  553. package/dist/assets/world-documents-DBybpBq8.js +0 -1
  554. package/dist/assets/world-root-stage-binding-ZVYIgr74.js +0 -1
  555. package/dist/vgai-shared-react.json +0 -10
  556. package/dist/vgai-shared-three.json +0 -3
  557. package/template/.agents/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  558. package/template/.claude/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  559. package/template/.github/skills/vgai-threejs-authoring/agents/openai.yaml +0 -4
  560. /package/dist/assets/{vgai-shared-fontawesome-CU65D4Ij.js → volter-shared-fontawesome-CU65D4Ij.js} +0 -0
  561. /package/dist/assets/{vgai-shared-jsx-dev-runtime-DFDKL7fx.js → volter-shared-jsx-dev-runtime-DFDKL7fx.js} +0 -0
  562. /package/dist/assets/{vgai-shared-jsx-runtime-DIqBpTut.js → volter-shared-jsx-runtime-DIqBpTut.js} +0 -0
  563. /package/dist/assets/{vgai-shared-react-BT7rMc2H.js → volter-shared-react-BT7rMc2H.js} +0 -0
  564. /package/dist/assets/{vgai-shared-react-dom-DFajMqMT.js → volter-shared-react-dom-DFajMqMT.js} +0 -0
  565. /package/dist/assets/{vgai-shared-react-dom-client-S0ozfl6_.js → volter-shared-react-dom-client-S0ozfl6_.js} +0 -0
  566. /package/dist/assets/{vgai-shared-three-DH4yxKwt.js → volter-shared-three-DH4yxKwt.js} +0 -0
  567. /package/template/{.vgai → .volter}/assets.json +0 -0
  568. /package/template/{.vgai → .volter}/provenance.json +0 -0
@@ -1,8 +1,8 @@
1
- import{d as Mt,b as _,r as Lt,o as M,a as re,i as ne}from"./component-instance-root-B0C5oNEm.js";import{e as Ie,b as Ft}from"./live-gesture-lock-DJbrjOqf.js";import{r as Bt,c as jt}from"./relative-import-specifier-BFKIWEWs.js";import{S as Dt,C as Nt,r as Wt}from"./three-projection-core-CG01r5Ta.js";import{el as _t,gq as Ht,kQ as zt,kR as B,kS as Jt,cw as Vt,fm as Ut,bk as ie,bl as oe,di as j,M as Pe,h2 as ke,bm as Kt}from"./index-BRJMIUK0.js";import{w as qt}from"./inference-diagnostics-xecGdohW.js";import{f as Gt,d as Xt,e as Ae,g as Qt,h as Zt,j as Yt,k as er,l as Ee,m as tr,n as rr}from"./instance-fork-actions-D3sRzS3K.js";import{c as nr,T as ir,n as or}from"./three-TCuY32m_.js";import{l as H}from"./oid-transform-D5Kxt6ij.js";import{c as sr,b as ar}from"./r3f-physics-binding-DzrbpqjM.js";import{f as fe,a as Te,i as xe,b as cr,o as lr}from"./writer-tw6EcuVO.js";import{isEditorOwnedObject as me}from"./editor-layers-BDJnAAzj.js";import{object3DAuthoringSubjectOf as Ce}from"./object3d-authoring-subject-BDrxd1GA.js";import{getUserData as ye}from"./user-data-dHvLdpwM.js";import"./three.module-BLhyNg0e.js";import{cj as C,fo as m,eX as ur,ej as dr,cO as hr,dp as Y,I as Me}from"./three.core-3arARmh6.js";import"./user-data-Bpj7diUS.js";import"./workspace-arrangement-BdAlBwvd.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./entity-object-JmYMfLsx.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./object-marks-DwvIEBOK.js";function pr(o){return`${o.code}|${o.file}|${o.line}|${o.col}`}function fr(...o){const e=new Set,t=[];for(const r of o)for(const n of r?.diagnostics??[]){const i=pr(n);e.has(i)||(e.add(i),t.push(n))}return t}const Le=["#7dd3fc","#60a5fa","#818cf8","#a78bfa","#c084fc"],Fe=1e3;function ft(o){return o.lod.updateWorldMatrix(!0,!1),o.lod.getWorldPosition(new m)}function Be(o){return Le[o%Le.length]}function mr(o){const e=ft(o),t=[],r=[];return o.lod.levels.forEach((n,i)=>{!Number.isFinite(n.distance)||n.distance<=0||(t.push({kind:"sphere",center:[e.x,e.y,e.z],radius:n.distance,color:Be(i),opacity:.56}),r.push({id:`lod:${encodeURIComponent(o.key)}:${i}`,label:`LOD ${i} distance`,position:[e.x+n.distance,e.y,e.z],color:Be(i),writable:o.writableDistances.has(i)}))}),{id:`lod:${o.key}`,category:"lod",guides:t,handles:r}}function yr(o){return Math.round(o*Fe)/Fe}function mt(o,e,t){const r=o.lod.levels[e-1]?.distance,n=o.lod.levels[e+1]?.distance,i=r===void 0?0:r+.01,s=n===void 0?Number.POSITIVE_INFINITY:Math.max(i,n-.01);return yr(C.clamp(t,i,s))}function je(o,e,t){const r=/^lod:([^:]+):(\d+)$/.exec(e);if(!r)return null;const n=decodeURIComponent(r[1]),i=Number(r[2]),s=o.find(c=>c.key===n);if(!s||!s.writableDistances.has(i))return null;const a=new m(...t).distanceTo(ft(s));return{binding:s,level:i,value:mt(s,i,a)}}function yt(o){const e=o.binding.lod.levels[o.level];e&&(e.distance=o.value)}const gt="#ff9f43",gr="#ffd166",De=1e3;function wr(o){const e=o.system?.emitterShape;return e&&typeof e.type=="string"?e:null}function $e(o){return encodeURIComponent(o.sourceOid)}function wt(o){return[o.x,o.y,o.z]}function br(o,e){return o.emitter.updateWorldMatrix(!0,!1),wt(e.clone().applyMatrix4(o.emitter.matrixWorld))}function b(o,e,t=.72){o.emitter.updateWorldMatrix(!0,!1);const r=o.emitter.matrixWorld;return{kind:"line",points:e.map(n=>wt(n.clone().applyMatrix4(r))),color:gt,opacity:t}}function k(o,e="xy",t=48,r=Math.PI*2){const n=[];for(let i=0;i<=t;i+=1){const s=i/t*r,a=Math.cos(s)*o,c=Math.sin(s)*o;n.push(e==="xy"?new m(a,c,0):e==="xz"?new m(a,0,c):new m(0,a,c))}return n}function Ne(o,e){return o.map(t=>t.clone().applyAxisAngle(new m(0,0,1),e))}function We(o,e,t=24){const r=[];for(let n=0;n<=t;n+=1){const i=n/t*Math.PI,s=Math.cos(i)*o,a=Math.sin(i)*o;r.push(new m(s,0,a))}return r}function P(o,e,t){const r=o[e];return typeof r=="number"&&Number.isFinite(r)?r:t}function vr(o){const e=o.shape,t=P(e,"radius",10),r=C.clamp(P(e,"arc",Math.PI*2),0,Math.PI*2),n=Math.abs(r-Math.PI*2)<.001;switch(e.type){case"point":return[b(o,[new m(-.2,0,0),new m(.2,0,0)]),b(o,[new m(0,-.2,0),new m(0,.2,0)]),b(o,[new m(0,0,-.2),new m(0,0,.2)])];case"sphere":return[b(o,k(t,"xy",48,r)),b(o,k(t,"xz"),.5),b(o,Ne(k(t,"xz"),n?Math.PI/2:r),.5)];case"hemisphere":return[b(o,k(t,"xy",48,r)),b(o,We(t),.55),b(o,Ne(We(t),n?Math.PI/2:r),.55)];case"cone":{const i=P(e,"angle",Math.PI/6),s=Math.max(t,1),a=[b(o,k(t,"xy",48,r))],c=n?[0,Math.PI/2,Math.PI,3*Math.PI/2]:[0,r/3,r*2/3,r];for(const l of c){const u=new m(Math.cos(l)*t,Math.sin(l)*t,0),d=u.clone().add(new m(Math.cos(l)*Math.sin(i),Math.sin(l)*Math.sin(i),Math.cos(i)).multiplyScalar(s));a.push(b(o,[u,d],.58))}return a}case"circle":return[b(o,k(t,"xy",48,r))];case"donut":{const i=P(e,"donutRadius",t*.2);return[b(o,k(Math.max(0,t-i),"xy",48,r),.45),b(o,k(t,"xy",48,r)),b(o,k(t+i,"xy",48,r),.45),b(o,k(i,"xz").map(s=>s.add(new m(t,0,0))),.45)]}case"rectangle":case"grid":{const i=P(e,"width",e.type==="grid"?1:10),s=P(e,"height",e.type==="grid"?1:10),a=i/2,c=s/2,l=[b(o,[new m(-a,-c,0),new m(a,-c,0),new m(a,c,0),new m(-a,c,0),new m(-a,-c,0)])];if(e.type==="grid"){const u=Math.min(16,Math.max(1,Math.round(P(e,"column",10)))),d=Math.min(16,Math.max(1,Math.round(P(e,"row",10))));for(let h=1;h<u;h+=1){const p=-a+h/u*i;l.push(b(o,[new m(p,-c,0),new m(p,c,0)],.24))}for(let h=1;h<d;h+=1){const p=-c+h/d*s;l.push(b(o,[new m(-a,p,0),new m(a,p,0)],.24))}}return l}}}function z(o,e,t,r){return{id:`particle:${$e(o)}:${e}`,label:t,position:br(o,r),color:e==="angle"?gr:gt,writable:o.writableFields.has(e)}}function Or(o){const e=o.shape,t=P(e,"radius",10),r=[];if(["sphere","hemisphere","cone","circle","donut"].includes(e.type)&&r.push(z(o,"radius","Emitter radius",new m(t,0,0))),e.type==="cone"){const n=P(e,"angle",Math.PI/6),i=Math.max(t,1);r.push(z(o,"angle","Cone angle",new m(t+Math.sin(n)*i,0,Math.cos(n)*i)))}return e.type==="donut"&&r.push(z(o,"donutRadius","Donut tube radius",new m(t,0,P(e,"donutRadius",t*.2)))),(e.type==="rectangle"||e.type==="grid")&&r.push(z(o,"width","Emitter width",new m(P(e,"width",1)/2,0,0)),z(o,"height","Emitter height",new m(0,P(e,"height",1)/2,0))),{id:`particle:${$e(o)}`,category:"particles",guides:vr(o),handles:r}}function se(o){return Math.round(o*De)/De}function bt(o,e){return o==="angle"?se(C.clamp(e,.01,Math.PI/2-.01)):o==="arc"?se(C.clamp(e,0,Math.PI*2)):o==="thickness"?se(C.clamp(e,0,1)):o==="column"||o==="row"?Math.max(1,Math.round(e)):se(Math.max(.01,e))}function Sr(o,e){return bt(o,e)}function _e(o,e,t){const r=/^particle:([^:]+):(radius|angle|donutRadius|width|height)$/.exec(e),n=r?o.find(l=>$e(l)===r[1]):void 0,i=r?.[2];if(!n||!i||!n.writableFields.has(i))return null;n.emitter.updateWorldMatrix(!0,!1);const s=n.emitter.worldToLocal(new m(...t)),a=P(n.shape,"radius",10);let c;return i==="radius"?c=n.shape.type==="sphere"||n.shape.type==="hemisphere"?s.length():Math.hypot(s.x,s.y):i==="angle"?c=Math.atan2(Math.max(0,Math.hypot(s.x,s.y)-a),Math.abs(s.z)||.001):i==="donutRadius"?c=Math.abs(s.z):i==="width"?c=Math.abs(s.x)*2:c=Math.abs(s.y)*2,{binding:n,field:i,value:bt(i,c)}}function vt(o){o.binding.shape[o.field]=o.value}const Ot={Light:"light",Material:"material",Camera:"camera",Audio:"audio"};function y(o,e,t,r,n,i=`${Ot[o]}.${t}`,s){return{prop:t,label:r,type:n,group:o,target:e,path:i,...s?{options:s}:{}}}function D(o,e,t){return{prop:o,label:e,type:"asset",group:"Material",target:"material",path:`${Ot.Material}.${o}`,colorSpace:t}}const Pr=[D("map","Base Color Map","srgb"),D("normalMap","Normal Map","linear"),D("roughnessMap","Roughness Map","linear"),D("metalnessMap","Metalness Map","linear"),D("emissiveMap","Emissive Map","srgb"),D("aoMap","Ambient Occlusion Map","linear")];function xr(o){const e=o;return e&&e.isColor?`#${e.getHexString()}`:void 0}const St="vgaiAssetPath",He=new WeakSet,$r=new ur;function Pt(o){const e=o;if(!e||!e.isTexture)return"";const t=e.userData?.[St];if(typeof t=="string"&&t)return t;if(e.name)return e.name;const r=e.image?.src;return typeof r=="string"?r:""}function Rr(o){return/^(?:[a-z]+:|\/)/i.test(o)?o:`/${o}`}function Ir(o,e,t){if(!o)return null;const r=o,n=r[e.prop],i=t==null?"":String(t);if(n&&He.has(n)&&Pt(n)!==i&&n.dispose(),!i)return r[e.prop]=null,o.needsUpdate=!0,"";const s=$r.load(Rr(i));return s.colorSpace=e.colorSpace==="srgb"?dr:hr,s.userData[St]=i,s.name=i,He.add(s),r[e.prop]=s,o.needsUpdate=!0,i}function kr(o){const e=o,t=[y("Light","self","color","Color","color"),y("Light","self","intensity","Intensity","number")];return(e.isPointLight||e.isSpotLight)&&t.push(y("Light","self","distance","Distance","number"),y("Light","self","decay","Decay","number")),e.isSpotLight&&t.push(y("Light","self","angle","Angle","number"),y("Light","self","penumbra","Penumbra","number")),t}function xt(o){const e=o;return e.isDirectionalLight||e.isPointLight||e.isSpotLight?y("Light","self","castShadow","Cast Shadow","boolean","shadow.cast"):void 0}function Ar(o){const e=o,t=[];e.color?.isColor&&t.push(y("Material","material","color","Color","color")),typeof e.roughness=="number"&&t.push(y("Material","material","roughness","Roughness","number")),typeof e.metalness=="number"&&t.push(y("Material","material","metalness","Metalness","number")),e.emissive?.isColor&&t.push(y("Material","material","emissive","Emissive","color")),t.push(y("Material","material","opacity","Opacity","number"),y("Material","material","transparent","Transparent","boolean")),typeof e.wireframe=="boolean"&&t.push(y("Material","material","wireframe","Wireframe","boolean"));const r=o;for(const n of Pr)n.prop in r&&t.push(n);return t}function Er(o){const e=o;return e.isPerspectiveCamera?[y("Camera","self","fov","FOV","number"),y("Camera","self","near","Near","number"),y("Camera","self","far","Far","number"),y("Camera","self","zoom","Zoom","number")]:e.isOrthographicCamera?[y("Camera","self","zoom","Zoom","number"),y("Camera","self","near","Near","number"),y("Camera","self","far","Far","number"),y("Camera","self","left","Left","number"),y("Camera","self","right","Right","number"),y("Camera","self","top","Top","number"),y("Camera","self","bottom","Bottom","number")]:[]}function ee(o){const e=o;return typeof e.getRefDistance=="function"&&typeof e.setRefDistance=="function"&&!!e.panner}function Tr(o="PositionalAudio"){return[y("Audio","self",o==="PositionalAudio"?"distance":"panner-refDistance","Reference Distance","number","audio.refDistance"),y("Audio","self","panner-distanceModel","Distance Model","enum","audio.distanceModel",["inverse","linear","exponential"]),y("Audio","self","panner-rolloffFactor","Rolloff","number","audio.rolloffFactor"),y("Audio","self","panner-maxDistance","Maximum Distance","number","audio.maxDistance"),y("Audio","self","panner-coneInnerAngle","Inner Cone","number","audio.coneInnerAngle"),y("Audio","self","panner-coneOuterAngle","Outer Cone","number","audio.coneOuterAngle"),y("Audio","self","panner-coneOuterGain","Outside Gain","number","audio.coneOuterGain")]}function $t(o,e,t){const r=o,n=[];return r.isLight&&n.push(...kr(o)),r.isCamera&&n.push(...Er(o)),ee(o)&&n.push(...Tr(t)),e&&n.push(...Ar(e)),n}function Z(o,e,t,r){const n=xt(o);return $t(o,e,r).find(i=>i.path===t)??(n?.path===t?n:void 0)}function Rt(o,e,t){return t.target==="material"?e:o}function J(o,e,t){if(t.group==="Audio"&&ee(o)){const i=o.panner;switch(t.path){case"audio.refDistance":return o.getRefDistance();case"audio.distanceModel":return o.getDistanceModel();case"audio.rolloffFactor":return o.getRolloffFactor();case"audio.maxDistance":return o.getMaxDistance();case"audio.coneInnerAngle":return i.coneInnerAngle;case"audio.coneOuterAngle":return i.coneOuterAngle;case"audio.coneOuterGain":return i.coneOuterGain}}const r=Rt(o,e,t);if(!r)return;const n=r[t.prop];return t.type==="color"?xr(n):t.type==="asset"?Pt(n):n}function Cr(o,e,t){if(e.path==="audio.distanceModel"){const n=String(t);return n!=="inverse"&&n!=="linear"&&n!=="exponential"?null:(o.setDistanceModel(n),n)}const r=Number(t);if(!Number.isFinite(r))return null;switch(e.path){case"audio.refDistance":return o.setRefDistance(Math.max(.01,r)),Math.max(.01,r);case"audio.rolloffFactor":return o.setRolloffFactor(Math.max(0,r)),Math.max(0,r);case"audio.maxDistance":return o.setMaxDistance(Math.max(o.getRefDistance()+.01,r)),Math.max(o.getRefDistance()+.01,r);case"audio.coneInnerAngle":{const n=Math.max(0,Math.min(o.panner.coneOuterAngle,r));return o.setDirectionalCone(n,o.panner.coneOuterAngle,o.panner.coneOuterGain),n}case"audio.coneOuterAngle":{const n=Math.max(o.panner.coneInnerAngle,Math.min(360,r));return o.setDirectionalCone(o.panner.coneInnerAngle,n,o.panner.coneOuterGain),n}case"audio.coneOuterGain":{const n=Math.max(0,Math.min(1,r));return o.setDirectionalCone(o.panner.coneInnerAngle,o.panner.coneOuterAngle,n),n}default:return null}}function T(o,e,t,r){if(t.group==="Audio"&&ee(o))return Cr(o,t,r);if(t.type==="asset")return Ir(e,t,r);const n=Rt(o,e,t);if(!n)return null;if(t.type==="color"){const s=String(r);return n[t.prop]?.set(s),s}if(t.type==="boolean"){const s=!!r;return n[t.prop]=s,ze(o,e,t),s}const i=Number(r);return Number.isFinite(i)?(n[t.prop]=i,ze(o,e,t),i):null}function ze(o,e,t){t.group==="Camera"&&o.updateProjectionMatrix?.(),t.target==="material"&&e&&(t.prop==="transparent"||t.prop==="wireframe")&&(e.needsUpdate=!0)}const Je="#42c8ff",Ve="#287fb8",Ue="#ffd166",Ke="#ff9f43",qe=100;function A(o){return[o.x,o.y,o.z]}function It(o){o.updateWorldMatrix(!0,!1);const e=o.getWorldPosition(new m),t=o.getWorldQuaternion(new Y);return{origin:e,forward:new m(0,0,1).applyQuaternion(t).normalize(),right:new m(1,0,0).applyQuaternion(t).normalize()}}function Ge(o,e,t,r,n){const i=C.degToRad(n/2);return o.clone().addScaledVector(e,Math.cos(i)*r).addScaledVector(t,Math.sin(i)*r)}function Mr(o,e){if(!ee(o))return null;const{origin:t,forward:r,right:n}=It(o),i=o.getRefDistance(),s=o.getMaxDistance(),a=o.getDistanceModel(),c=o.panner.coneInnerAngle,l=o.panner.coneOuterAngle,u=l<359.5,d=Math.max(1,Math.min(8,i*2.5)),h=[{kind:"sphere",center:A(t),radius:i,color:Je,opacity:.75}],p=[{id:"audio-ref-distance",label:"Reference distance",position:A(t.clone().addScaledVector(n,i)),color:Je,writable:e("audio.refDistance")}];return a==="linear"&&(h.push({kind:"sphere",center:A(t),radius:s,color:Ve,opacity:.42,dashed:!0}),p.push({id:"audio-max-distance",label:"Maximum distance",position:A(t.clone().addScaledVector(n,s)),color:Ve,writable:e("audio.maxDistance")})),u&&(h.push({kind:"cone",origin:A(t),direction:A(r),length:d,angle:l,color:Ke,opacity:.72}),p.push({id:"audio-outer-cone",label:"Outer cone angle",position:A(Ge(t,r,n,d,l)),color:Ke,writable:e("audio.coneOuterAngle")}),c<359.5&&(h.push({kind:"cone",origin:A(t),direction:A(r),length:d,angle:c,color:Ue,opacity:.58,dashed:!0}),p.push({id:"audio-inner-cone",label:"Inner cone angle",position:A(Ge(t,r,n,d,c)),color:Ue,writable:e("audio.coneInnerAngle")}))),{id:"positional-audio",category:"audio",guides:h,handles:p}}function ge(o){return Math.round(o*qe)/qe}function Lr(o,e,t,r){if(!ee(o))return null;const{origin:n,forward:i}=It(o),a=new m(...r).sub(n);let c,l;switch(t){case"audio-ref-distance":c="audio.refDistance",l=Math.max(.01,ge(a.length()));break;case"audio-max-distance":c="audio.maxDistance",l=Math.max(o.getRefDistance()+.01,ge(a.length()));break;case"audio-inner-cone":case"audio-outer-cone":{c=t==="audio-inner-cone"?"audio.coneInnerAngle":"audio.coneOuterAngle";const d=a.dot(i),h=Math.sqrt(Math.max(0,a.lengthSq()-d*d));l=ge(C.radToDeg(Math.atan2(h,d))*2);break}default:return null}const u=Z(o,null,c,e);return u?{field:u,value:l}:null}function Fr(o,e){T(o,null,e.field,e.value)}const Br="#00e58a",jr="#c77dff",ae=.01,Xe=1e3;function E(o){return Math.round(o*Xe)/Xe}function Dr(o){return[o.x,o.y,o.z]}function kt(o){return{center:new m(...o.position),rotation:new Y(...o.rotation)}}function ce(o,e){const{center:t,rotation:r}=kt(o);return Dr(new m(...e).applyQuaternion(r).add(t))}function le(o,e){return`collider:${encodeURIComponent(o.sourceOid)}:${e}`}function Nr(o){const{snapshot:e}=o,t=e.sensor?jr:Br,r={color:t,writable:o.writable},n=[],i=[];switch(e.shape.type){case"cuboid":{const s=e.shape.halfExtents;n.push({kind:"box",center:e.position,rotation:e.rotation,halfExtents:s,color:t,opacity:.78});for(const[a,c]of[[0,"X"],[1,"Y"],[2,"Z"]])for(const l of[-1,1]){const u=[0,0,0];u[a]=s[a]*l,i.push({id:le(o,`${a}:${l}`),label:`${c} ${l>0?"positive":"negative"} half extent`,position:ce(e,u),...r})}break}case"ball":n.push({kind:"sphere",center:e.position,radius:e.shape.radius,color:t,opacity:.78}),i.push({id:le(o,"radius"),label:"Collider radius",position:ce(e,[e.shape.radius,0,0]),...r});break;case"capsule":n.push({kind:"capsule",center:e.position,rotation:e.rotation,radius:e.shape.radius,halfHeight:e.shape.halfHeight,color:t,opacity:.78}),i.push({id:le(o,"radius"),label:"Collider radius",position:ce(e,[e.shape.radius,0,0]),...r},{id:le(o,"half-height"),label:"Collider half height",position:ce(e,[0,e.shape.halfHeight+e.shape.radius,0]),...r});break}return{id:`collider:${o.sourceOid}`,category:"colliders",guides:n,handles:i}}function Wr(o){if(!o.startsWith("collider:"))return null;const e=o.slice(9),t=e.indexOf(":");if(t<1)return null;try{return{oid:decodeURIComponent(e.slice(0,t)),part:e.slice(t+1)}}catch{return null}}function _r(o){return o>1e-8?o:1}function Qe(o,e,t){const r=Wr(e),n=r?o.find(u=>u.sourceOid===r.oid):null;if(!n||!r||!n.writable)return null;const{center:i,rotation:s}=kt(n.snapshot),a=new m(...t).sub(i).applyQuaternion(s.clone().invert()),c=n.snapshot.shape,l=n.snapshot.scale.map(_r);if(c.type==="cuboid"&&/^[012]:(?:-1|1)$/.test(r.part)){const u=Number(r.part[0]),d=[...c.halfExtents];return d[u]=Math.max(ae,E(Math.abs(a.getComponent(u)))),{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{type:"cuboid",halfExtents:d},args:d.map((h,p)=>E(h/l[p]))}}if(c.type==="ball"&&r.part==="radius"){const u=Math.max(ae,E(a.length()));return{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{type:"ball",radius:u},args:[E(u/l[0])]}}if(c.type==="capsule"){if(r.part==="radius"){const u=Math.max(ae,E(Math.hypot(a.x,a.z)));return{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{...c,radius:u},args:[E(c.halfHeight/l[0]),E(u/l[1])]}}if(r.part==="half-height"){const u=Math.max(ae,E(Math.abs(a.y)-c.radius));return{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{...c,halfHeight:u},args:[E(u/l[0]),E(c.radius/l[1])]}}}return null}const we="#ffb020",Ze=1e3;function Re(o){return`${o.source.line}:${o.source.col}`}function Ye(o,e){return`joint:${Re(o)}:${e}`}function Hr(o){const e=o.snapshot,t=[{kind:"line",points:[e.worldAnchor1,e.worldAnchor2],color:we,opacity:.9}];if(e.worldAxis){const r=new m(...e.worldAnchor1),n=new m(...e.worldAxis).normalize();t.push({kind:"line",points:[[r.x-n.x,r.y-n.y,r.z-n.z],[r.x+n.x,r.y+n.y,r.z+n.z]],color:"#ffd166",opacity:.82,dashed:!0})}return{id:`joint:${Re(o)}`,category:"joints",guides:t,handles:[{id:Ye(o,0),label:"Joint anchor A",position:e.worldAnchor1,color:we,writable:o.writable},{id:Ye(o,1),label:"Joint anchor B",position:e.worldAnchor2,color:we,writable:o.writable}]}}function be(o){return Math.round(o*Ze)/Ze}function zr(o){const e=/^joint:(\d+:\d+):([01])$/.exec(o);return e?{key:e[1],endpoint:Number(e[2])}:null}function Jr(o,e){return o.source.hook==="useFixedJoint"&&e===1?2:e}function et(o,e,t){const r=zr(e),n=r?o.find(d=>Re(d)===r.key):void 0;if(!n||!r||!n.writable||!n.source.params)return null;const i=n.snapshot,s=r.endpoint===0?i.body1Position:i.body2Position,a=r.endpoint===0?i.body1Rotation:i.body2Rotation,c=new m(...t).sub(new m(...s)).applyQuaternion(new Y(...a).invert()),l=[be(c.x),be(c.y),be(c.z)],u=n.source.params.map(d=>Array.isArray(d)?[...d]:d);return u[Jr(n,r.endpoint)]=l,{binding:n,endpoint:r.endpoint,anchor:l,params:u}}const tt="#ffd166",rt="#ff9f43",nt=1e3;function V(o){return[o.x,o.y,o.z]}function it(o){return Math.round(o*nt)/nt}function At(o){o.updateWorldMatrix(!0,!1);const e=o.getWorldQuaternion(new Y);return{origin:o.getWorldPosition(new m),rangeAxis:new m(1,0,0).applyQuaternion(e).normalize()}}function Et(o){o.updateWorldMatrix(!0,!1),o.target.updateWorldMatrix(!0,!1);const e=o.getWorldPosition(new m),r=o.target.getWorldPosition(new m).sub(e).normalize();r.lengthSq()<1e-8&&r.set(0,0,-1).applyQuaternion(o.getWorldQuaternion(new Y));const n=Math.abs(r.y)>.98?new m(1,0,0):new m(0,1,0),i=new m().crossVectors(r,n).normalize();return{origin:e,direction:r,radial:i}}function Vr(o,e,t,r,n){return o.clone().addScaledVector(e,Math.cos(n)*r).addScaledVector(t,Math.sin(n)*r)}function Ur(o,e){const t=o;if(!t.isPointLight&&!t.isSpotLight)return null;const{origin:r,rangeAxis:n}=At(o),i=typeof t.distance=="number"?t.distance:0,s=[],a=[];if(i>0&&(s.push({kind:"sphere",center:V(r),radius:i,color:tt,opacity:.62}),a.push({id:"light-range",label:"Light range",position:V(r.clone().addScaledVector(n,i)),color:tt,writable:e("light.distance")})),t.isSpotLight){const c=o,{direction:l,radial:u}=Et(c),d=r.distanceTo(c.target.getWorldPosition(new m)),h=i>0?i:Math.max(1,d),p=C.radToDeg(c.angle*2);s.push({kind:"cone",origin:V(r),direction:V(l),length:h,angle:p,color:rt,opacity:.75}),a.push({id:"light-angle",label:"Spot angle",position:V(Vr(r,l,u,h,c.angle)),color:rt,writable:e("light.angle")})}return s.length>0||a.length>0?{id:"light",category:"lights",guides:s,handles:a}:null}function Kr(o,e,t,r){const n=o,i=new m(...r);let s,a;if(t==="light-range"&&(n.isPointLight||n.isSpotLight))s="light.distance",a=Math.max(.01,it(i.distanceTo(At(o).origin)));else if(t==="light-angle"&&n.isSpotLight){s="light.angle";const{origin:l,direction:u}=Et(o),d=i.sub(l),h=d.dot(u),p=Math.sqrt(Math.max(0,d.lengthSq()-h*h));a=it(Math.max(.01,Math.min(Math.PI/2,Math.atan2(p,h))))}else return null;const c=Z(o,null,s,e);return c?{field:c,value:a}:null}function qr(o,e){T(o,null,e.field,e.value)}function Gr(o){const e=(t,r,n)=>{const i=o.object(t);if(!i)return null;const s=o.sourceTag(t),a=Kr(i,s,r,n);if(a)return{field:a.field,value:a.value,preview:()=>qr(i,a)};const c=Lr(i,s,r,n);return c?{field:c.field,value:c.value,preview:()=>Fr(i,c)}:null};return{layers:t=>{const r=o.object(t);if(!r)return[];const n=i=>o.writable(t,i);return[...o.colliderBindings(t).map(Nr),...o.jointBindings(t).map(Hr),...o.particleBindings(t).map(Or),...o.lodBindings(t).map(mr),Ur(r,n),Mr(r,n)].filter(i=>i!==null)},preview:(t,r,n)=>{const i=Qe(o.colliderBindings(t),r,n);if(i){o.previewCollider(i.colliderId,i.shape);return}const s=et(o.jointBindings(t),r,n);if(s){o.previewJointAnchor(s.binding.snapshot.id,s.endpoint,s.anchor);return}const a=_e(o.particleBindings(t),r,n);if(a){vt(a);return}const c=je(o.lodBindings(t),r,n);if(c){yt(c);return}e(t,r,n)?.preview()},commit:(t,r,n)=>{const i=Qe(o.colliderBindings(t),r,n);if(i)return o.commitCollider(t,i.sourceOid,i.args);const s=et(o.jointBindings(t),r,n);if(s)return o.commitJoint(s.binding,s.params);const a=_e(o.particleBindings(t),r,n);if(a)return o.commitParticle(a.binding,a.field,a.value);const c=je(o.lodBindings(t),r,n);if(c)return o.commitLodDistance(c.binding,c.level,c.value);const l=e(t,r,n);if(!(!l||!o.writable(t,l.field.path)))return o.commit(t,l.field.path,l.value)}}}const Q=/^-?\d+(\.\d+)?$/,Xr=/^#[0-9a-fA-F]{3,8}$/,U=1e-6;function $(o){const e=o.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").trim();return e?e[0].toUpperCase()+e.slice(1):o}const Qr=new Set(["key","ref","data-oid","userData-oid","children"]),Zr=o=>Qr.has(o)||/^on[A-Z]/.test(o)||o.startsWith("userData-")||o.startsWith("__vgai"),Yr=new Set(["position","rotation","scale","name","visible"]),en=new Set;function ue(o){return o instanceof Error?o.message:String(o)}function F(o){const e=Math.round(o*1e4)/1e4;return Object.is(e,-0)?"0":String(e)}function K(o){return`[${o.map(F).join(", ")}]`}function ve(o){return o.replace(/^\.?\//,"")}function ot(o){return o.replace(/["\\]/g,"")}function tn(o){return(o.split("/").pop()??o).replace(Ct,"")||"Model"}function rn(o){if(!xe(o))return!1;const e=o.trim().slice(1,-1).split(",").map(t=>t.trim()).filter(t=>t!=="");return e.length===3&&e.every(t=>Q.test(t))}function Oe(o){return o.isCamera===!0&&_(o)!==void 0}function R(o){const e=o.material;return Array.isArray(e)?e[0]??null:e??null}const de="this session has no source-write backend",O="jsx.",he="wrap.",N="collider.",st="joint.",at="particle.",Se="lod.",I="scene.background.",W="scene.environment.",S="scene.fog.",ct={CuboidCollider:"cuboid",BallCollider:"ball",CapsuleCollider:"capsule"},nn={useFixedJoint:"fixed",useSphericalJoint:"spherical",useRevoluteJoint:"revolute",usePrismaticJoint:"prismatic",useRopeJoint:"rope",useSpringJoint:"spring"};function q(o){return!!o&&o.isColor===!0}function on(o){return!!o&&o.isTexture===!0}function L(o){return!!o&&o.isFog===!0}function G(o){return!!o&&o.isFogExp2===!0}function lt(o){return o&&typeof o=="object"?o:null}function sn(o){const e=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());if(!e)return null;const t=e[1].toLowerCase();return t.length===3?t.split("").map(r=>`${r}${r}`).join(""):t}function an(o){return Array.isArray(o)}function Tt(o,e,t,r,n){const i=Array.isArray(e),s=Array.isArray(t),a=an(r);if(i||s||a)return!i||!s||!a||e.length!==t.length||e.length!==r.length?!1:e.every((l,u)=>Tt(o,l,t[u],r[u],n));if(e===t)return!0;const c=o.slice(r.start,r.end);return(typeof e=="number"?Number(c)!==e:c!==String(e))?!1:(n.push({start:r.start,end:r.end,text:typeof t=="number"?F(t):t?"true":"false"}),!0)}function cn(o,e){const t=o.source.params?.[e];if(t!==void 0)return t;const r=o.source.hook,n=o.snapshot;if(e===0)return n.anchor1;if(e===(r==="useFixedJoint"?2:1))return n.anchor2;if(e===2&&(r==="useRevoluteJoint"||r==="usePrismaticJoint"))return n.axis;if(e===3&&n.limits)return[n.limits.min,n.limits.max]}function ln(o,e){return e===void 0?o:Array.isArray(o)?o[e]:void 0}const ut={group:`<group>
1
+ import{d as Mt,b as _,r as Lt,o as M,a as re,i as ne}from"./component-instance-root-DLI40MiB.js";import{e as Ie,b as Ft}from"./live-gesture-lock-DJbrjOqf.js";import{r as Bt,c as jt}from"./relative-import-specifier-CPFTrxi4.js";import{S as Dt,C as Nt,r as Wt}from"./three-projection-core-B7Lf8tOp.js";import{ec as _t,gz as Ht,kT as zt,kU as B,kV as Jt,cy as Vt,fd as Ut,bm as ie,bn as oe,d4 as j,O as Pe,hb as ke,bo as Kt}from"./index-C5ZAyrKq.js";import{w as qt}from"./inference-diagnostics-DLt9ql9I.js";import{f as Gt,d as Xt,e as Ae,g as Zt,h as Qt,j as Yt,k as er,l as Ee,m as tr,n as rr}from"./instance-fork-actions-D3sRzS3K.js";import{c as nr,T as ir,n as or}from"./three-DiL6vMXq.js";import{l as H}from"./oid-transform-DaA6yW6o.js";import{c as sr,b as ar}from"./r3f-physics-binding-Cx8yhuwt.js";import{f as fe,a as Te,i as xe,b as cr,o as lr}from"./writer-tw6EcuVO.js";import{isEditorOwnedObject as me}from"./editor-layers-D-CTUqco.js";import{object3DAuthoringSubjectOf as Ce}from"./object3d-authoring-subject-XccsO0xG.js";import{getUserData as ye}from"./user-data-CODoGZqA.js";import"./three.module-BLhyNg0e.js";import{cj as C,fo as m,eX as ur,ej as dr,cO as hr,dp as Y,I as Me}from"./three.core-3arARmh6.js";import"./user-data-C84W0V47.js";import"./workspace-arrangement-DqG5sUns.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./entity-object-MKYemTFM.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./object-marks-BnvSuCTt.js";function pr(o){return`${o.code}|${o.file}|${o.line}|${o.col}`}function fr(...o){const e=new Set,t=[];for(const r of o)for(const n of r?.diagnostics??[]){const i=pr(n);e.has(i)||(e.add(i),t.push(n))}return t}const Le=["#7dd3fc","#60a5fa","#818cf8","#a78bfa","#c084fc"],Fe=1e3;function ft(o){return o.lod.updateWorldMatrix(!0,!1),o.lod.getWorldPosition(new m)}function Be(o){return Le[o%Le.length]}function mr(o){const e=ft(o),t=[],r=[];return o.lod.levels.forEach((n,i)=>{!Number.isFinite(n.distance)||n.distance<=0||(t.push({kind:"sphere",center:[e.x,e.y,e.z],radius:n.distance,color:Be(i),opacity:.56}),r.push({id:`lod:${encodeURIComponent(o.key)}:${i}`,label:`LOD ${i} distance`,position:[e.x+n.distance,e.y,e.z],color:Be(i),writable:o.writableDistances.has(i)}))}),{id:`lod:${o.key}`,category:"lod",guides:t,handles:r}}function yr(o){return Math.round(o*Fe)/Fe}function mt(o,e,t){const r=o.lod.levels[e-1]?.distance,n=o.lod.levels[e+1]?.distance,i=r===void 0?0:r+.01,s=n===void 0?Number.POSITIVE_INFINITY:Math.max(i,n-.01);return yr(C.clamp(t,i,s))}function je(o,e,t){const r=/^lod:([^:]+):(\d+)$/.exec(e);if(!r)return null;const n=decodeURIComponent(r[1]),i=Number(r[2]),s=o.find(c=>c.key===n);if(!s||!s.writableDistances.has(i))return null;const a=new m(...t).distanceTo(ft(s));return{binding:s,level:i,value:mt(s,i,a)}}function yt(o){const e=o.binding.lod.levels[o.level];e&&(e.distance=o.value)}const gt="#ff9f43",gr="#ffd166",De=1e3;function wr(o){const e=o.system?.emitterShape;return e&&typeof e.type=="string"?e:null}function $e(o){return encodeURIComponent(o.sourceOid)}function wt(o){return[o.x,o.y,o.z]}function br(o,e){return o.emitter.updateWorldMatrix(!0,!1),wt(e.clone().applyMatrix4(o.emitter.matrixWorld))}function b(o,e,t=.72){o.emitter.updateWorldMatrix(!0,!1);const r=o.emitter.matrixWorld;return{kind:"line",points:e.map(n=>wt(n.clone().applyMatrix4(r))),color:gt,opacity:t}}function k(o,e="xy",t=48,r=Math.PI*2){const n=[];for(let i=0;i<=t;i+=1){const s=i/t*r,a=Math.cos(s)*o,c=Math.sin(s)*o;n.push(e==="xy"?new m(a,c,0):e==="xz"?new m(a,0,c):new m(0,a,c))}return n}function Ne(o,e){return o.map(t=>t.clone().applyAxisAngle(new m(0,0,1),e))}function We(o,e,t=24){const r=[];for(let n=0;n<=t;n+=1){const i=n/t*Math.PI,s=Math.cos(i)*o,a=Math.sin(i)*o;r.push(new m(s,0,a))}return r}function P(o,e,t){const r=o[e];return typeof r=="number"&&Number.isFinite(r)?r:t}function vr(o){const e=o.shape,t=P(e,"radius",10),r=C.clamp(P(e,"arc",Math.PI*2),0,Math.PI*2),n=Math.abs(r-Math.PI*2)<.001;switch(e.type){case"point":return[b(o,[new m(-.2,0,0),new m(.2,0,0)]),b(o,[new m(0,-.2,0),new m(0,.2,0)]),b(o,[new m(0,0,-.2),new m(0,0,.2)])];case"sphere":return[b(o,k(t,"xy",48,r)),b(o,k(t,"xz"),.5),b(o,Ne(k(t,"xz"),n?Math.PI/2:r),.5)];case"hemisphere":return[b(o,k(t,"xy",48,r)),b(o,We(t),.55),b(o,Ne(We(t),n?Math.PI/2:r),.55)];case"cone":{const i=P(e,"angle",Math.PI/6),s=Math.max(t,1),a=[b(o,k(t,"xy",48,r))],c=n?[0,Math.PI/2,Math.PI,3*Math.PI/2]:[0,r/3,r*2/3,r];for(const l of c){const u=new m(Math.cos(l)*t,Math.sin(l)*t,0),d=u.clone().add(new m(Math.cos(l)*Math.sin(i),Math.sin(l)*Math.sin(i),Math.cos(i)).multiplyScalar(s));a.push(b(o,[u,d],.58))}return a}case"circle":return[b(o,k(t,"xy",48,r))];case"donut":{const i=P(e,"donutRadius",t*.2);return[b(o,k(Math.max(0,t-i),"xy",48,r),.45),b(o,k(t,"xy",48,r)),b(o,k(t+i,"xy",48,r),.45),b(o,k(i,"xz").map(s=>s.add(new m(t,0,0))),.45)]}case"rectangle":case"grid":{const i=P(e,"width",e.type==="grid"?1:10),s=P(e,"height",e.type==="grid"?1:10),a=i/2,c=s/2,l=[b(o,[new m(-a,-c,0),new m(a,-c,0),new m(a,c,0),new m(-a,c,0),new m(-a,-c,0)])];if(e.type==="grid"){const u=Math.min(16,Math.max(1,Math.round(P(e,"column",10)))),d=Math.min(16,Math.max(1,Math.round(P(e,"row",10))));for(let h=1;h<u;h+=1){const p=-a+h/u*i;l.push(b(o,[new m(p,-c,0),new m(p,c,0)],.24))}for(let h=1;h<d;h+=1){const p=-c+h/d*s;l.push(b(o,[new m(-a,p,0),new m(a,p,0)],.24))}}return l}}}function z(o,e,t,r){return{id:`particle:${$e(o)}:${e}`,label:t,position:br(o,r),color:e==="angle"?gr:gt,writable:o.writableFields.has(e)}}function Or(o){const e=o.shape,t=P(e,"radius",10),r=[];if(["sphere","hemisphere","cone","circle","donut"].includes(e.type)&&r.push(z(o,"radius","Emitter radius",new m(t,0,0))),e.type==="cone"){const n=P(e,"angle",Math.PI/6),i=Math.max(t,1);r.push(z(o,"angle","Cone angle",new m(t+Math.sin(n)*i,0,Math.cos(n)*i)))}return e.type==="donut"&&r.push(z(o,"donutRadius","Donut tube radius",new m(t,0,P(e,"donutRadius",t*.2)))),(e.type==="rectangle"||e.type==="grid")&&r.push(z(o,"width","Emitter width",new m(P(e,"width",1)/2,0,0)),z(o,"height","Emitter height",new m(0,P(e,"height",1)/2,0))),{id:`particle:${$e(o)}`,category:"particles",guides:vr(o),handles:r}}function se(o){return Math.round(o*De)/De}function bt(o,e){return o==="angle"?se(C.clamp(e,.01,Math.PI/2-.01)):o==="arc"?se(C.clamp(e,0,Math.PI*2)):o==="thickness"?se(C.clamp(e,0,1)):o==="column"||o==="row"?Math.max(1,Math.round(e)):se(Math.max(.01,e))}function Sr(o,e){return bt(o,e)}function _e(o,e,t){const r=/^particle:([^:]+):(radius|angle|donutRadius|width|height)$/.exec(e),n=r?o.find(l=>$e(l)===r[1]):void 0,i=r?.[2];if(!n||!i||!n.writableFields.has(i))return null;n.emitter.updateWorldMatrix(!0,!1);const s=n.emitter.worldToLocal(new m(...t)),a=P(n.shape,"radius",10);let c;return i==="radius"?c=n.shape.type==="sphere"||n.shape.type==="hemisphere"?s.length():Math.hypot(s.x,s.y):i==="angle"?c=Math.atan2(Math.max(0,Math.hypot(s.x,s.y)-a),Math.abs(s.z)||.001):i==="donutRadius"?c=Math.abs(s.z):i==="width"?c=Math.abs(s.x)*2:c=Math.abs(s.y)*2,{binding:n,field:i,value:bt(i,c)}}function vt(o){o.binding.shape[o.field]=o.value}const Ot={Light:"light",Material:"material",Camera:"camera",Audio:"audio"};function y(o,e,t,r,n,i=`${Ot[o]}.${t}`,s){return{prop:t,label:r,type:n,group:o,target:e,path:i,...s?{options:s}:{}}}function D(o,e,t){return{prop:o,label:e,type:"asset",group:"Material",target:"material",path:`${Ot.Material}.${o}`,colorSpace:t}}const Pr=[D("map","Base Color Map","srgb"),D("normalMap","Normal Map","linear"),D("roughnessMap","Roughness Map","linear"),D("metalnessMap","Metalness Map","linear"),D("emissiveMap","Emissive Map","srgb"),D("aoMap","Ambient Occlusion Map","linear")];function xr(o){const e=o;return e&&e.isColor?`#${e.getHexString()}`:void 0}const St="volterAssetPath",He=new WeakSet,$r=new ur;function Pt(o){const e=o;if(!e||!e.isTexture)return"";const t=e.userData?.[St];if(typeof t=="string"&&t)return t;if(e.name)return e.name;const r=e.image?.src;return typeof r=="string"?r:""}function Rr(o){return/^(?:[a-z]+:|\/)/i.test(o)?o:`/${o}`}function Ir(o,e,t){if(!o)return null;const r=o,n=r[e.prop],i=t==null?"":String(t);if(n&&He.has(n)&&Pt(n)!==i&&n.dispose(),!i)return r[e.prop]=null,o.needsUpdate=!0,"";const s=$r.load(Rr(i));return s.colorSpace=e.colorSpace==="srgb"?dr:hr,s.userData[St]=i,s.name=i,He.add(s),r[e.prop]=s,o.needsUpdate=!0,i}function kr(o){const e=o,t=[y("Light","self","color","Color","color"),y("Light","self","intensity","Intensity","number")];return(e.isPointLight||e.isSpotLight)&&t.push(y("Light","self","distance","Distance","number"),y("Light","self","decay","Decay","number")),e.isSpotLight&&t.push(y("Light","self","angle","Angle","number"),y("Light","self","penumbra","Penumbra","number")),t}function xt(o){const e=o;return e.isDirectionalLight||e.isPointLight||e.isSpotLight?y("Light","self","castShadow","Cast Shadow","boolean","shadow.cast"):void 0}function Ar(o){const e=o,t=[];e.color?.isColor&&t.push(y("Material","material","color","Color","color")),typeof e.roughness=="number"&&t.push(y("Material","material","roughness","Roughness","number")),typeof e.metalness=="number"&&t.push(y("Material","material","metalness","Metalness","number")),e.emissive?.isColor&&t.push(y("Material","material","emissive","Emissive","color")),t.push(y("Material","material","opacity","Opacity","number"),y("Material","material","transparent","Transparent","boolean")),typeof e.wireframe=="boolean"&&t.push(y("Material","material","wireframe","Wireframe","boolean"));const r=o;for(const n of Pr)n.prop in r&&t.push(n);return t}function Er(o){const e=o;return e.isPerspectiveCamera?[y("Camera","self","fov","FOV","number"),y("Camera","self","near","Near","number"),y("Camera","self","far","Far","number"),y("Camera","self","zoom","Zoom","number")]:e.isOrthographicCamera?[y("Camera","self","zoom","Zoom","number"),y("Camera","self","near","Near","number"),y("Camera","self","far","Far","number"),y("Camera","self","left","Left","number"),y("Camera","self","right","Right","number"),y("Camera","self","top","Top","number"),y("Camera","self","bottom","Bottom","number")]:[]}function ee(o){const e=o;return typeof e.getRefDistance=="function"&&typeof e.setRefDistance=="function"&&!!e.panner}function Tr(o="PositionalAudio"){return[y("Audio","self",o==="PositionalAudio"?"distance":"panner-refDistance","Reference Distance","number","audio.refDistance"),y("Audio","self","panner-distanceModel","Distance Model","enum","audio.distanceModel",["inverse","linear","exponential"]),y("Audio","self","panner-rolloffFactor","Rolloff","number","audio.rolloffFactor"),y("Audio","self","panner-maxDistance","Maximum Distance","number","audio.maxDistance"),y("Audio","self","panner-coneInnerAngle","Inner Cone","number","audio.coneInnerAngle"),y("Audio","self","panner-coneOuterAngle","Outer Cone","number","audio.coneOuterAngle"),y("Audio","self","panner-coneOuterGain","Outside Gain","number","audio.coneOuterGain")]}function $t(o,e,t){const r=o,n=[];return r.isLight&&n.push(...kr(o)),r.isCamera&&n.push(...Er(o)),ee(o)&&n.push(...Tr(t)),e&&n.push(...Ar(e)),n}function Q(o,e,t,r){const n=xt(o);return $t(o,e,r).find(i=>i.path===t)??(n?.path===t?n:void 0)}function Rt(o,e,t){return t.target==="material"?e:o}function J(o,e,t){if(t.group==="Audio"&&ee(o)){const i=o.panner;switch(t.path){case"audio.refDistance":return o.getRefDistance();case"audio.distanceModel":return o.getDistanceModel();case"audio.rolloffFactor":return o.getRolloffFactor();case"audio.maxDistance":return o.getMaxDistance();case"audio.coneInnerAngle":return i.coneInnerAngle;case"audio.coneOuterAngle":return i.coneOuterAngle;case"audio.coneOuterGain":return i.coneOuterGain}}const r=Rt(o,e,t);if(!r)return;const n=r[t.prop];return t.type==="color"?xr(n):t.type==="asset"?Pt(n):n}function Cr(o,e,t){if(e.path==="audio.distanceModel"){const n=String(t);return n!=="inverse"&&n!=="linear"&&n!=="exponential"?null:(o.setDistanceModel(n),n)}const r=Number(t);if(!Number.isFinite(r))return null;switch(e.path){case"audio.refDistance":return o.setRefDistance(Math.max(.01,r)),Math.max(.01,r);case"audio.rolloffFactor":return o.setRolloffFactor(Math.max(0,r)),Math.max(0,r);case"audio.maxDistance":return o.setMaxDistance(Math.max(o.getRefDistance()+.01,r)),Math.max(o.getRefDistance()+.01,r);case"audio.coneInnerAngle":{const n=Math.max(0,Math.min(o.panner.coneOuterAngle,r));return o.setDirectionalCone(n,o.panner.coneOuterAngle,o.panner.coneOuterGain),n}case"audio.coneOuterAngle":{const n=Math.max(o.panner.coneInnerAngle,Math.min(360,r));return o.setDirectionalCone(o.panner.coneInnerAngle,n,o.panner.coneOuterGain),n}case"audio.coneOuterGain":{const n=Math.max(0,Math.min(1,r));return o.setDirectionalCone(o.panner.coneInnerAngle,o.panner.coneOuterAngle,n),n}default:return null}}function T(o,e,t,r){if(t.group==="Audio"&&ee(o))return Cr(o,t,r);if(t.type==="asset")return Ir(e,t,r);const n=Rt(o,e,t);if(!n)return null;if(t.type==="color"){const s=String(r);return n[t.prop]?.set(s),s}if(t.type==="boolean"){const s=!!r;return n[t.prop]=s,ze(o,e,t),s}const i=Number(r);return Number.isFinite(i)?(n[t.prop]=i,ze(o,e,t),i):null}function ze(o,e,t){t.group==="Camera"&&o.updateProjectionMatrix?.(),t.target==="material"&&e&&(t.prop==="transparent"||t.prop==="wireframe")&&(e.needsUpdate=!0)}const Je="#42c8ff",Ve="#287fb8",Ue="#ffd166",Ke="#ff9f43",qe=100;function A(o){return[o.x,o.y,o.z]}function It(o){o.updateWorldMatrix(!0,!1);const e=o.getWorldPosition(new m),t=o.getWorldQuaternion(new Y);return{origin:e,forward:new m(0,0,1).applyQuaternion(t).normalize(),right:new m(1,0,0).applyQuaternion(t).normalize()}}function Ge(o,e,t,r,n){const i=C.degToRad(n/2);return o.clone().addScaledVector(e,Math.cos(i)*r).addScaledVector(t,Math.sin(i)*r)}function Mr(o,e){if(!ee(o))return null;const{origin:t,forward:r,right:n}=It(o),i=o.getRefDistance(),s=o.getMaxDistance(),a=o.getDistanceModel(),c=o.panner.coneInnerAngle,l=o.panner.coneOuterAngle,u=l<359.5,d=Math.max(1,Math.min(8,i*2.5)),h=[{kind:"sphere",center:A(t),radius:i,color:Je,opacity:.75}],p=[{id:"audio-ref-distance",label:"Reference distance",position:A(t.clone().addScaledVector(n,i)),color:Je,writable:e("audio.refDistance")}];return a==="linear"&&(h.push({kind:"sphere",center:A(t),radius:s,color:Ve,opacity:.42,dashed:!0}),p.push({id:"audio-max-distance",label:"Maximum distance",position:A(t.clone().addScaledVector(n,s)),color:Ve,writable:e("audio.maxDistance")})),u&&(h.push({kind:"cone",origin:A(t),direction:A(r),length:d,angle:l,color:Ke,opacity:.72}),p.push({id:"audio-outer-cone",label:"Outer cone angle",position:A(Ge(t,r,n,d,l)),color:Ke,writable:e("audio.coneOuterAngle")}),c<359.5&&(h.push({kind:"cone",origin:A(t),direction:A(r),length:d,angle:c,color:Ue,opacity:.58,dashed:!0}),p.push({id:"audio-inner-cone",label:"Inner cone angle",position:A(Ge(t,r,n,d,c)),color:Ue,writable:e("audio.coneInnerAngle")}))),{id:"positional-audio",category:"audio",guides:h,handles:p}}function ge(o){return Math.round(o*qe)/qe}function Lr(o,e,t,r){if(!ee(o))return null;const{origin:n,forward:i}=It(o),a=new m(...r).sub(n);let c,l;switch(t){case"audio-ref-distance":c="audio.refDistance",l=Math.max(.01,ge(a.length()));break;case"audio-max-distance":c="audio.maxDistance",l=Math.max(o.getRefDistance()+.01,ge(a.length()));break;case"audio-inner-cone":case"audio-outer-cone":{c=t==="audio-inner-cone"?"audio.coneInnerAngle":"audio.coneOuterAngle";const d=a.dot(i),h=Math.sqrt(Math.max(0,a.lengthSq()-d*d));l=ge(C.radToDeg(Math.atan2(h,d))*2);break}default:return null}const u=Q(o,null,c,e);return u?{field:u,value:l}:null}function Fr(o,e){T(o,null,e.field,e.value)}const Br="#00e58a",jr="#c77dff",ae=.01,Xe=1e3;function E(o){return Math.round(o*Xe)/Xe}function Dr(o){return[o.x,o.y,o.z]}function kt(o){return{center:new m(...o.position),rotation:new Y(...o.rotation)}}function ce(o,e){const{center:t,rotation:r}=kt(o);return Dr(new m(...e).applyQuaternion(r).add(t))}function le(o,e){return`collider:${encodeURIComponent(o.sourceOid)}:${e}`}function Nr(o){const{snapshot:e}=o,t=e.sensor?jr:Br,r={color:t,writable:o.writable},n=[],i=[];switch(e.shape.type){case"cuboid":{const s=e.shape.halfExtents;n.push({kind:"box",center:e.position,rotation:e.rotation,halfExtents:s,color:t,opacity:.78});for(const[a,c]of[[0,"X"],[1,"Y"],[2,"Z"]])for(const l of[-1,1]){const u=[0,0,0];u[a]=s[a]*l,i.push({id:le(o,`${a}:${l}`),label:`${c} ${l>0?"positive":"negative"} half extent`,position:ce(e,u),...r})}break}case"ball":n.push({kind:"sphere",center:e.position,radius:e.shape.radius,color:t,opacity:.78}),i.push({id:le(o,"radius"),label:"Collider radius",position:ce(e,[e.shape.radius,0,0]),...r});break;case"capsule":n.push({kind:"capsule",center:e.position,rotation:e.rotation,radius:e.shape.radius,halfHeight:e.shape.halfHeight,color:t,opacity:.78}),i.push({id:le(o,"radius"),label:"Collider radius",position:ce(e,[e.shape.radius,0,0]),...r},{id:le(o,"half-height"),label:"Collider half height",position:ce(e,[0,e.shape.halfHeight+e.shape.radius,0]),...r});break}return{id:`collider:${o.sourceOid}`,category:"colliders",guides:n,handles:i}}function Wr(o){if(!o.startsWith("collider:"))return null;const e=o.slice(9),t=e.indexOf(":");if(t<1)return null;try{return{oid:decodeURIComponent(e.slice(0,t)),part:e.slice(t+1)}}catch{return null}}function _r(o){return o>1e-8?o:1}function Ze(o,e,t){const r=Wr(e),n=r?o.find(u=>u.sourceOid===r.oid):null;if(!n||!r||!n.writable)return null;const{center:i,rotation:s}=kt(n.snapshot),a=new m(...t).sub(i).applyQuaternion(s.clone().invert()),c=n.snapshot.shape,l=n.snapshot.scale.map(_r);if(c.type==="cuboid"&&/^[012]:(?:-1|1)$/.test(r.part)){const u=Number(r.part[0]),d=[...c.halfExtents];return d[u]=Math.max(ae,E(Math.abs(a.getComponent(u)))),{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{type:"cuboid",halfExtents:d},args:d.map((h,p)=>E(h/l[p]))}}if(c.type==="ball"&&r.part==="radius"){const u=Math.max(ae,E(a.length()));return{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{type:"ball",radius:u},args:[E(u/l[0])]}}if(c.type==="capsule"){if(r.part==="radius"){const u=Math.max(ae,E(Math.hypot(a.x,a.z)));return{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{...c,radius:u},args:[E(c.halfHeight/l[0]),E(u/l[1])]}}if(r.part==="half-height"){const u=Math.max(ae,E(Math.abs(a.y)-c.radius));return{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{...c,halfHeight:u},args:[E(u/l[0]),E(c.radius/l[1])]}}}return null}const we="#ffb020",Qe=1e3;function Re(o){return`${o.source.line}:${o.source.col}`}function Ye(o,e){return`joint:${Re(o)}:${e}`}function Hr(o){const e=o.snapshot,t=[{kind:"line",points:[e.worldAnchor1,e.worldAnchor2],color:we,opacity:.9}];if(e.worldAxis){const r=new m(...e.worldAnchor1),n=new m(...e.worldAxis).normalize();t.push({kind:"line",points:[[r.x-n.x,r.y-n.y,r.z-n.z],[r.x+n.x,r.y+n.y,r.z+n.z]],color:"#ffd166",opacity:.82,dashed:!0})}return{id:`joint:${Re(o)}`,category:"joints",guides:t,handles:[{id:Ye(o,0),label:"Joint anchor A",position:e.worldAnchor1,color:we,writable:o.writable},{id:Ye(o,1),label:"Joint anchor B",position:e.worldAnchor2,color:we,writable:o.writable}]}}function be(o){return Math.round(o*Qe)/Qe}function zr(o){const e=/^joint:(\d+:\d+):([01])$/.exec(o);return e?{key:e[1],endpoint:Number(e[2])}:null}function Jr(o,e){return o.source.hook==="useFixedJoint"&&e===1?2:e}function et(o,e,t){const r=zr(e),n=r?o.find(d=>Re(d)===r.key):void 0;if(!n||!r||!n.writable||!n.source.params)return null;const i=n.snapshot,s=r.endpoint===0?i.body1Position:i.body2Position,a=r.endpoint===0?i.body1Rotation:i.body2Rotation,c=new m(...t).sub(new m(...s)).applyQuaternion(new Y(...a).invert()),l=[be(c.x),be(c.y),be(c.z)],u=n.source.params.map(d=>Array.isArray(d)?[...d]:d);return u[Jr(n,r.endpoint)]=l,{binding:n,endpoint:r.endpoint,anchor:l,params:u}}const tt="#ffd166",rt="#ff9f43",nt=1e3;function V(o){return[o.x,o.y,o.z]}function it(o){return Math.round(o*nt)/nt}function At(o){o.updateWorldMatrix(!0,!1);const e=o.getWorldQuaternion(new Y);return{origin:o.getWorldPosition(new m),rangeAxis:new m(1,0,0).applyQuaternion(e).normalize()}}function Et(o){o.updateWorldMatrix(!0,!1),o.target.updateWorldMatrix(!0,!1);const e=o.getWorldPosition(new m),r=o.target.getWorldPosition(new m).sub(e).normalize();r.lengthSq()<1e-8&&r.set(0,0,-1).applyQuaternion(o.getWorldQuaternion(new Y));const n=Math.abs(r.y)>.98?new m(1,0,0):new m(0,1,0),i=new m().crossVectors(r,n).normalize();return{origin:e,direction:r,radial:i}}function Vr(o,e,t,r,n){return o.clone().addScaledVector(e,Math.cos(n)*r).addScaledVector(t,Math.sin(n)*r)}function Ur(o,e){const t=o;if(!t.isPointLight&&!t.isSpotLight)return null;const{origin:r,rangeAxis:n}=At(o),i=typeof t.distance=="number"?t.distance:0,s=[],a=[];if(i>0&&(s.push({kind:"sphere",center:V(r),radius:i,color:tt,opacity:.62}),a.push({id:"light-range",label:"Light range",position:V(r.clone().addScaledVector(n,i)),color:tt,writable:e("light.distance")})),t.isSpotLight){const c=o,{direction:l,radial:u}=Et(c),d=r.distanceTo(c.target.getWorldPosition(new m)),h=i>0?i:Math.max(1,d),p=C.radToDeg(c.angle*2);s.push({kind:"cone",origin:V(r),direction:V(l),length:h,angle:p,color:rt,opacity:.75}),a.push({id:"light-angle",label:"Spot angle",position:V(Vr(r,l,u,h,c.angle)),color:rt,writable:e("light.angle")})}return s.length>0||a.length>0?{id:"light",category:"lights",guides:s,handles:a}:null}function Kr(o,e,t,r){const n=o,i=new m(...r);let s,a;if(t==="light-range"&&(n.isPointLight||n.isSpotLight))s="light.distance",a=Math.max(.01,it(i.distanceTo(At(o).origin)));else if(t==="light-angle"&&n.isSpotLight){s="light.angle";const{origin:l,direction:u}=Et(o),d=i.sub(l),h=d.dot(u),p=Math.sqrt(Math.max(0,d.lengthSq()-h*h));a=it(Math.max(.01,Math.min(Math.PI/2,Math.atan2(p,h))))}else return null;const c=Q(o,null,s,e);return c?{field:c,value:a}:null}function qr(o,e){T(o,null,e.field,e.value)}function Gr(o){const e=(t,r,n)=>{const i=o.object(t);if(!i)return null;const s=o.sourceTag(t),a=Kr(i,s,r,n);if(a)return{field:a.field,value:a.value,preview:()=>qr(i,a)};const c=Lr(i,s,r,n);return c?{field:c.field,value:c.value,preview:()=>Fr(i,c)}:null};return{layers:t=>{const r=o.object(t);if(!r)return[];const n=i=>o.writable(t,i);return[...o.colliderBindings(t).map(Nr),...o.jointBindings(t).map(Hr),...o.particleBindings(t).map(Or),...o.lodBindings(t).map(mr),Ur(r,n),Mr(r,n)].filter(i=>i!==null)},preview:(t,r,n)=>{const i=Ze(o.colliderBindings(t),r,n);if(i){o.previewCollider(i.colliderId,i.shape);return}const s=et(o.jointBindings(t),r,n);if(s){o.previewJointAnchor(s.binding.snapshot.id,s.endpoint,s.anchor);return}const a=_e(o.particleBindings(t),r,n);if(a){vt(a);return}const c=je(o.lodBindings(t),r,n);if(c){yt(c);return}e(t,r,n)?.preview()},commit:(t,r,n)=>{const i=Ze(o.colliderBindings(t),r,n);if(i)return o.commitCollider(t,i.sourceOid,i.args);const s=et(o.jointBindings(t),r,n);if(s)return o.commitJoint(s.binding,s.params);const a=_e(o.particleBindings(t),r,n);if(a)return o.commitParticle(a.binding,a.field,a.value);const c=je(o.lodBindings(t),r,n);if(c)return o.commitLodDistance(c.binding,c.level,c.value);const l=e(t,r,n);if(!(!l||!o.writable(t,l.field.path)))return o.commit(t,l.field.path,l.value)}}}const Z=/^-?\d+(\.\d+)?$/,Xr=/^#[0-9a-fA-F]{3,8}$/,U=1e-6;function $(o){const e=o.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").trim();return e?e[0].toUpperCase()+e.slice(1):o}const Zr=new Set(["key","ref","data-oid","userData-oid","children"]),Qr=o=>Zr.has(o)||/^on[A-Z]/.test(o)||o.startsWith("userData-")||o.startsWith("__volter"),Yr=new Set(["position","rotation","scale","name","visible"]),en=new Set;function ue(o){return o instanceof Error?o.message:String(o)}function F(o){const e=Math.round(o*1e4)/1e4;return Object.is(e,-0)?"0":String(e)}function K(o){return`[${o.map(F).join(", ")}]`}function ve(o){return o.replace(/^\.?\//,"")}function ot(o){return o.replace(/["\\]/g,"")}function tn(o){return(o.split("/").pop()??o).replace(Ct,"")||"Model"}function rn(o){if(!xe(o))return!1;const e=o.trim().slice(1,-1).split(",").map(t=>t.trim()).filter(t=>t!=="");return e.length===3&&e.every(t=>Z.test(t))}function Oe(o){return o.isCamera===!0&&_(o)!==void 0}function R(o){const e=o.material;return Array.isArray(e)?e[0]??null:e??null}const de="this session has no source-write backend",O="jsx.",he="wrap.",N="collider.",st="joint.",at="particle.",Se="lod.",I="scene.background.",W="scene.environment.",S="scene.fog.",ct={CuboidCollider:"cuboid",BallCollider:"ball",CapsuleCollider:"capsule"},nn={useFixedJoint:"fixed",useSphericalJoint:"spherical",useRevoluteJoint:"revolute",usePrismaticJoint:"prismatic",useRopeJoint:"rope",useSpringJoint:"spring"};function q(o){return!!o&&o.isColor===!0}function on(o){return!!o&&o.isTexture===!0}function L(o){return!!o&&o.isFog===!0}function G(o){return!!o&&o.isFogExp2===!0}function lt(o){return o&&typeof o=="object"?o:null}function sn(o){const e=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());if(!e)return null;const t=e[1].toLowerCase();return t.length===3?t.split("").map(r=>`${r}${r}`).join(""):t}function an(o){return Array.isArray(o)}function Tt(o,e,t,r,n){const i=Array.isArray(e),s=Array.isArray(t),a=an(r);if(i||s||a)return!i||!s||!a||e.length!==t.length||e.length!==r.length?!1:e.every((l,u)=>Tt(o,l,t[u],r[u],n));if(e===t)return!0;const c=o.slice(r.start,r.end);return(typeof e=="number"?Number(c)!==e:c!==String(e))?!1:(n.push({start:r.start,end:r.end,text:typeof t=="number"?F(t):t?"true":"false"}),!0)}function cn(o,e){const t=o.source.params?.[e];if(t!==void 0)return t;const r=o.source.hook,n=o.snapshot;if(e===0)return n.anchor1;if(e===(r==="useFixedJoint"?2:1))return n.anchor2;if(e===2&&(r==="useRevoluteJoint"||r==="usePrismaticJoint"))return n.axis;if(e===3&&n.limits)return[n.limits.min,n.limits.max]}function ln(o,e){return e===void 0?o:Array.isArray(o)?o[e]:void 0}const ut={group:`<group>
2
2
  </group>`,mesh:`<mesh position={[0, 0, 0]}>
3
3
  <boxGeometry />
4
4
  <meshStandardMaterial color="#8888ff" />
5
- </mesh>`,pointLight:"<pointLight position={[0, 2, 0]} intensity={1} />",ambientLight:"<ambientLight intensity={0.5} />",directionalLight:"<directionalLight position={[5, 10, 5]} intensity={1} />",reflectionProbe:"<ReflectionProbe position={[0, 2, 0]} size={[10, 6, 10]} blendDistance={1} />"},Ct=/\.(glb|gltf)$/i,dt=new Set(["name","position","rotation","scale","children"]),pe="@react-three/drei",X="Gltf",ht={group:"Group",mesh:"Mesh (box)",pointLight:"Point Light",ambientLight:"Ambient Light",directionalLight:"Directional Light",reflectionProbe:"Reflection Probe"};class _n{constructor(e,t,r){this.store=e,this.options=r,this.scene=t,this.documentNodeId=`r3f-document:${r.worldId}`,this.identity=nr(r.worldId),this.projector=new ir(this.identity,{pickScope:"store-object-map"}),this.writeBackend=_t(r.writeBackend,e.shell.projectHistory),this.capabilities={transform:!0,inspectorFields:!0,persist:this.writeBackend!==void 0},this.writeBackend&&(this.persistence={isDirty:()=>!1,save:async()=>{},destination:r.entryPath,lastError:()=>{const n=e.shell.projectHistory?.getSnapshot().lastError;return n&&(n.code==="apply-failed"||n.code==="compensation-failed"||n.code==="history-limit")?n.message:null}}),this.selectionState=new Dt({store:e.shell,owns:n=>this.byId.has(n),initial:[this.documentNodeId]}),this.indexGraph(),this.definitionRootIds=(r.hierarchyRoots??this.projectedChildren(this.scene)).map(n=>this.idByObject.get(n)).filter(n=>n!==void 0),this.definitionView=new Nt({projector:this.projector,scene:this.scene,documentNodeId:this.documentNodeId,rootIds:this.definitionRootIds}),this.stories=Ht("three",e.shell,n=>this.storyComponent(n)),this.refreshSourceState()}documentNodeId;scene;identity;projector;definitionRootIds;definitionView;selectionState;oidIndex=new Map;sourceRefreshId=0;sourceRefreshPending=!1;sources=new Map;valueEcho=new Map;dynamicPaths=new Set;reflectionProbeAvailable=!1;lockedIds=new Set;structureClipboard=null;writeBackend;transformEdits=new Map;completedTransformEdits=[];transformCommitQueue=Promise.resolve();stories;capabilities;persistence;provenance={source:"source-code",label:"R3F source",detail:"Live react-three-fiber scene; literal JSX props write back to the .tsx source (expression-bound props are read-only)."};get byId(){return this.projector.objects}get idByObject(){return this.projector.idsByObject}get instanceRoots(){return this.identity.instanceRoots}get oidRepresentative(){return this.identity.representatives}indexGraph(){this.projector.project(this.scene),this.watchStructure()}disposed=!1;dispose(){if(!this.disposed){this.disposed=!0;for(const e of this.watchedForStructure)e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[]}}watchedForStructure=[];structureReindexQueued=!1;staleOidRefreshes=new Set;onStructureChanged=e=>{me(e.child)||this.scheduleStructureReindex()};watchStructure(){const e=r=>r;for(const r of this.watchedForStructure)e(r).removeEventListener("childadded",this.onStructureChanged),e(r).removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[];const t=r=>{e(r).addEventListener("childadded",this.onStructureChanged),e(r).addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.push(r)};t(this.scene);for(const[,r]of this.byId)t(r)}scheduleStructureReindex(){this.disposed||this.structureReindexQueued||(this.structureReindexQueued=!0,queueMicrotask(()=>{if(this.structureReindexQueued=!1,this.disposed)return;this.indexGraph();let e=!1;for(const t of this.liveOids()){const r=this.oidIndex.get(t);if(r===void 0||!this.sources.has(r.file)){e=!0;break}}e&&this.refreshSourceState(),this.syncAdoptedObjectMap(),this.store.shell.notifyIngestEdit()}))}syncAdoptedObjectMap(){if(this.store.scene!==this.scene)return;const e=this.store.objectMap;e.clear();for(const[r,n]of this.byId)e.set(r,n);const t=[...this.store.shell.selectedEntityIds].filter(r=>e.has(r));t.length!==this.store.shell.selectedEntityIds.size&&this.store.shell.selectMultiple(t)}liveInstanceCount(e){const t=this.oidOf(e);return t?this.instanceRoots.get(t):void 0}borrowsRepresentativeCallsite(e){if(!Mt(e))return!1;const t=this.byId.get(e),r=t?_(t):void 0,n=r?this.oidRepresentative.get(r):void 0;return!n||!Lt(t,n)}adoptScene(e){this.scene=e,this.valueEcho.clear(),this.dynamicPaths.clear(),this.pendingDuplicateLabels.clear(),this.pendingDuplicateCounts.clear(),this.indexGraph(),setTimeout(()=>this.applyPendingCreatedSelection(),0),this.refreshSourceState()}pendingCreatedSelection=null;recordPendingCreatedSelection(e,t){this.pendingCreatedSelection={parentId:e,before:new Set(this.hierarchy.node(e)?.childIds??[]),selectionAtWrite:new Set(this.store.shell.selectedEntityIds),...t?{afterId:t}:{}}}applyPendingCreatedSelection(){const e=this.pendingCreatedSelection;if(this.pendingCreatedSelection=null,!e)return;const t=this.store.shell.selectedEntityIds;if(!(t.size===e.selectionAtWrite.size&&[...t].every(a=>e.selectionAtWrite.has(a))))return;const n=this.hierarchy.node(e.parentId)?.childIds??[],i=e.afterId?this.childWrittenAfter(n,e.afterId):null;if(i){this.store.shell.selectMultiple([i]);return}const s=n.filter(a=>!e.before.has(a));s.length>0&&this.store.shell.selectMultiple(s)}childWrittenAfter(e,t){const r=this.sourceLocation(t);if(!r)return null;let n=null;for(const i of e){if(i===t)continue;const s=this.sourceLocation(i);!s||s.file!==r.file||!(s.line>r.line||s.line===r.line&&s.col>r.col)||(!n||s.line<n.line||s.line===n.line&&s.col<n.col)&&(n={id:i,line:s.line,col:s.col})}return n?.id??null}async refreshSourceState(){const e=this.writeBackend;if(this.disposed||!e?.index||!e.readSource)return;const t=++this.sourceRefreshId;this.sourceRefreshPending=!0;try{const r=await e.index();if(this.disposed||t!==this.sourceRefreshId)return;const n=new Map(Object.entries(r)),i=new Set;for(const c of this.liveOids()){const l=n.get(c);l&&i.add(l.file)}const s=new Map;if(await Promise.all([...i].map(async c=>{const l=await e.readSource(c);s.set(c,l.source)})),this.disposed||t!==this.sourceRefreshId)return;const a=await zt().exists("src/lib/reflections/index.ts").catch(()=>!1);if(this.disposed||t!==this.sourceRefreshId)return;this.oidIndex=n,this.sources=s,this.reflectionProbeAvailable=a,this.store.shell.notifyIngestEdit()}catch{}finally{t===this.sourceRefreshId&&(this.sourceRefreshPending=!1)}}liveOids(){const e=new Set;for(const[,t]of this.byId){const r=_(t);r!==void 0&&e.add(r)}for(const t of[this.scene.background,this.scene.environment,this.scene.fog]){const r=M(lt(t));r!==void 0&&e.add(r)}return e}oidOf(e){return _(this.byId.get(e))??null}attrsOf(e){const t=this.oidOf(e);if(!t)return null;const r=this.oidIndex.get(t);if(!r)return null;const n=this.sources.get(r.file);if(n===void 0)return null;const i=H(n,r.line,r.col);if(n[i]!=="<")return null;const s=fe(n,i);return s<0?null:Te(n,i,s)}sourceLocation(e){const t=this.oidOf(e);return t?this.oidIndex.get(t):void 0}definitionLocation(e){const t=this.definitionOid(e);return t?this.oidIndex.get(t):void 0}storyComponent(e){const t=this.hierarchy.node(e);if(t?.role!=="component")return null;const r=this.definitionLocation(e),n=this.sourceLocation(e),i=r?.component??n?.tag??t.typeLabel??t.label;return r?.file?{name:i,sourcePath:r.file}:{name:i}}definitionOid(e){const t=this.byId.get(e);if(!t||!re(t))return null;const r=ne(t),n=M(t);return n===void 0||n===r?null:n}canForkComponent(e){return typeof this.writeBackend?.forkComponent!="function"?!1:!!this.oidOf(e)&&!!this.definitionOid(e)}async forkComponent(e){const t=this.sourceLocation(e),r=this.oidOf(e),n=this.definitionOid(e),i=t?.tag??"component";if(!r||!n||!t)return Gt(i);const s=this.writeBackend,a=this.store.shell.projectHistory;if(!s?.forkComponent||!s.readSource||!s.applySource||!a)return Xt(i);let c;try{c=await s.forkComponent(r,n,this.forkNameSeed(e))}catch(p){return Ae(ue(p))}const{newName:l,newResourcePath:u,callsiteFile:d,callsiteNewSource:h}=c;if(!c.ok||!l||!u||!d||!h)return Ae(c.error??"the fork was refused without a reason.");try{await B(s,a,{file:d,source:h,label:c.label??`Fork ${i} → ${l}`})}catch(p){return Qt(i,l,u,ue(p))}return await this.refreshSourceState(),Zt(c.tag??i,l,u)}forkNameSeed(e){const t=this.attrsOf(e)?.find(r=>r.name==="name");return t?.isLiteral&&t.rawValue?t.rawValue:this.byId.get(e)?.name||void 0}canExtractComponent(e){return!!(this.oidOf(e)&&this.writeBackend?.extractComponent)}async extractComponent(e,t){const r=this.sourceLocation(e),n=this.oidOf(e),i=r?.tag??"element";if(!n||!r)return Yt(i);const s=this.writeBackend,a=this.store.shell.projectHistory;if(!s?.extractComponent||!s.readSource||!s.applySource||!a)return er(i);let c;try{c=await s.extractComponent(n,t??this.forkNameSeed(e))}catch(f){return Ee(ue(f))}const{newName:l,componentResourcePath:u,storyResourcePath:d,callsiteFile:h,callsiteNewSource:p}=c;if(!c.ok||!l||!u||!d||!h||!p)return Ee(c.error??"the extraction was refused without a reason.");try{await B(s,a,{file:h,source:p,label:c.label??`Extract ${l}`})}catch(f){return tr(i,l,u,ue(f))}return await this.refreshSourceState(),rr(c.tag??i,l,u,d)}diagnosticsFor(e){const t=this.borrowsRepresentativeCallsite(e)?void 0:this.sourceLocation(e);return fr(t,this.definitionLocation(e))}internalChildren(e){if(this.options.hierarchyMode==="definition")return;const t=this.byId.get(e);if(t)return this.internalChildObjects(t).map(r=>({...this.objectNode(r),parentId:e}))}hasInternals(e){if(this.options.hierarchyMode==="definition")return!1;const t=this.byId.get(e);return t?this.internalChildObjects(t).length>0:!1}internalChildObjects(e){return e.children.filter(t=>this.idByObject.has(t)&&!this.isProjectedRow(t))}objectNode(e){const t=this.idByObject.get(e),r=this.projectedParentId(e),n=this.borrowsRepresentativeCallsite(t),i=this.isComponentBoundary(e)&&!n,s=n?void 0:this.oidEntryOf(e)?.tag;return{id:t,label:i?ye(e,"authoringLabel")||e.name||s||"Component":e.name||e.type||"Object3D",role:i?"component":"entity",kind:or(this.transformObject(t)??e),...i&&s&&/^[A-Z]/.test(s)?{typeLabel:s}:{},parentId:r,childIds:this.projector.childIdsOf(this.projectedChildren(e))}}isComponentBoundary(e){return re(e)&&ye(e,"authoringRoot")!==!0}spatialTargetOf(e){return e}transformObject(e){const t=this.byId.get(e);return t?this.isComponentBoundary(t)?this.spatialTargetOf(t):t:null}oidEntryOf(e){const t=this.idByObject.get(e);return t?this.sourceLocation(t):void 0}componentOwnerChain(e){const t=[];let r=e;for(;r&&r!==this.scene;){for(;r&&r!==this.scene&&!this.isComponentBoundary(r);)r=r.parent;if(!r||r===this.scene)break;const n=ne(r);let i=r;for(;i.parent&&i.parent!==this.scene&&ne(i.parent)===n;)i=i.parent;t.push(i),r=i.parent}return t.reverse()}selectionOwnerObject(e,t=this.componentOwnerChain(e)){return t.at(-1)??this.stampedOwnerObject(e)}stampedOwnerObject(e){let t=e;for(;t&&t!==this.scene&&this.oidOf(this.idByObject.get(t)??"")===null;)t=t.parent??void 0;return!t||t===this.scene?null:t}insideTransparentTopLevel(e){return this.componentOwnerChain(e).length===1}isProjectedRow(e){if(e===this.scene||me(e))return!1;const t=this.idByObject.get(e);if(t===void 0)return!1;if(Oe(e))return!0;const r=this.componentOwnerChain(e);return this.selectionOwnerObject(e,r)===e?!0:r.length===1&&this.oidOf(t)!==null}projectedChildren(e){const t=[],r=new Set,n=i=>{if(!me(i)){if(this.isProjectedRow(i)){r.has(i)||(r.add(i),t.push(i));return}for(const s of i.children)n(s)}};for(const i of e.children)n(i);return t}projectedParentId(e){let t=e.parent;for(;t&&t!==this.scene;){if(this.isProjectedRow(t))return this.idByObject.get(t);t=t.parent}return this.documentNodeId}selectionOwnerId(e){const t=this.byId.get(e);if(!t)return null;if(Oe(t))return e;const n=this.componentOwnerChain(t).slice(1).at(-1)??this.stampedOwnerObject(t);return n?this.idByObject.get(n)??null:null}hierarchy={roots:()=>[this.hierarchy.node(this.documentNodeId)],node:e=>{if(e===this.documentNodeId)return{id:e,label:this.options.worldId,secondaryLabel:this.options.entryPath,role:"document",kind:"three-source",parentId:null,childIds:this.options.hierarchyMode==="definition"?this.definitionView.rootIds():this.projector.childIdsOf(this.projectedChildren(this.scene))};const t=this.byId.get(e);return t?this.options.hierarchyMode==="definition"?this.definitionView.node(t):this.objectNode(t):null},object3D:e=>this.transformObject(e),idForObject3D:e=>this.idByObject.get(e)??null};truth={resolve:e=>{const t=this.oidOf(e);if(!t)return{site:{anchored:!1,reason:e===this.documentNodeId?"The World document is a composition, not a source element.":"This rendered object has no authored source identity."},writeAnchorKind:this.transformWriteAnchorKind(e)};const r=this.oidIndex.get(t);if(!r)return{site:{anchored:!1,reason:"Source metadata is still loading or unavailable."},writeAnchorKind:this.transformWriteAnchorKind(e)};const n=this.projectRelativeSourceFile(r.file);return{site:{anchored:!0,kind:"source",file:n,line:r.line,col:r.col,display:`${n}:${r.line}`},writeAnchorKind:this.transformWriteAnchorKind(e)}}};transformWriteAnchorKind(e){if(!this.byId.has(e))return;const t=this.oidOf(e);return!t||!this.writeBackend?.writeProp?"live-only":sr(this.oidIndex.get(t),"position")?"physics-binding":"source-prop"}pickable={pick:(e,t)=>this.projector.pick(this.store,e,t,r=>this.isPickLocked(r)),candidates:(e,t)=>this.projector.candidates(this.store,e,t,r=>this.isPickLocked(r))};isPickLocked(e){let t=e,r=0;for(;t&&r++<1e3;){if(this.lockedIds.has(t))return!0;t=this.hierarchy.node(t)?.parentId??null}return!1}selection={get:()=>this.selectionState.current(),set:(e,t)=>this.selectionState.publish(e.map(r=>this.options.hierarchyMode==="definition"||t?.intent==="exact"||r===this.documentNodeId?r:this.selectionOwnerId(r)??r).filter(r=>r===this.documentNodeId||this.byId.has(r))),resolve:(e,t)=>{const r=this.byId.get(e);if(!r)return null;if(this.options.hierarchyMode==="definition")return{id:e};if(Oe(r))return{id:e};const n=this.componentOwnerChain(r),i=t?.scopeId?n.findIndex(u=>this.idByObject.get(u)===t.scopeId):-1,s=i>=0?i+1:1,a=t?.intent==="deep"?s+1:s,c=n[a]??n[s]??this.stampedOwnerObject(r),l=c?this.idByObject.get(c)??null:null;return l?{id:l}:null}};related={links:e=>{const t=ye(this.byId.get(e),"authoringDocument");return!t||t.kind!=="project-tool"?[]:[{id:`definition:project-tool:${t.name}`,title:t.title,open:()=>{Jt(t.name)}}]}};instanceProp(e,t){if(!t.startsWith(O))return null;const r=t.slice(O.length),n=this.declaredPropsOf(e).find(s=>s.name===r),i=this.attrsOf(e)?.find(s=>s.name===r);return n&&i?{prop:r,spec:n,attr:i}:null}affectedInstances(e,t){const r=this.definitionLocation(e);if(!r)return 0;let n=0;for(const[i,s]of this.byId){if(!re(s))continue;const a=this.definitionLocation(i);a?.file!==r.file||a.component!==r.component||this.attrsOf(i)?.some(c=>c.name===t)||(n+=1)}return n+1}instances={openComponent:()=>{Vt(Ut)},describe:e=>{const t=this.storyComponent(e);if(!t||this.stories.storiesFor(e).length===0)return null;const r=this.inspector.properties(e).filter(n=>n.resettable&&n.path.startsWith(O)).map(n=>{const i=this.instanceProp(e,n.path),s=!!i?.attr.isLiteral&&i.spec.defaultValue!==void 0&&!!this.definitionOid(e)&&!!this.writeBackend?.runGesture&&!!this.writeBackend.writeComponentDefault&&!!this.writeBackend.removeProp;return{path:n.path,label:n.label,value:this.inspector.get(e,n.path),...n.revertsTo===void 0?{}:{defaultText:n.revertsTo},canApplyToComponent:s,affectedInstanceCount:i?this.affectedInstances(e,i.prop):0,...s?{}:{applyUnavailableReason:i?.spec.defaultValue===void 0?"The component default is computed or absent, so source cannot be changed safely.":"This session cannot atomically update the component and its callsite."}}});return{componentName:t.name,...t.sourcePath?{sourcePath:this.projectRelativeSourceFile(t.sourcePath)}:{},overrides:r}},revert:async(e,t)=>{const r=this.oidOf(e),n=this.writeBackend;if(!r||!n?.removeProp)return;const i=t.map(c=>this.instanceProp(e,c)?.prop).filter(c=>!!c);let s=!1;const a=async c=>{for(const l of i){const u=await c.removeProp?.(r,l);s||=u?.changed===!0}};return i.length>1&&n.runGesture?await n.runGesture(`Revert ${i.length} Overrides`,a):await a(n),await this.refreshSourceState(),s?{destination:this.destinationOf(e),persisted:!0}:void 0},applyToComponent:async(e,t)=>{const r=this.instanceProp(e,t),n=this.definitionOid(e),i=this.oidOf(e),s=this.writeBackend;if(!r||r.spec.defaultValue===void 0||!n||!i||!s?.runGesture||!s.writeComponentDefault||!s.removeProp)return{changed:!1,message:"Apply was refused because both literal source writes are not available."};const a=this.inspector.get(e,t);return await s.runGesture(`Apply ${r.prop} to ${this.storyComponent(e)?.name??"Component"}`,async c=>{const l=await c.writeComponentDefault?.(n,r.prop,this.serializeValue(a));if(!l?.changed)throw new Error(l?.error??"The component default did not change.");const u=await c.removeProp?.(i,r.prop);if(!u?.changed)throw new Error(u?.error??"The callsite override was not removed.")}),await this.refreshSourceState(),{changed:!0,message:`${r.prop} now defaults to ${String(a)} in ${this.storyComponent(e)?.name??"the component"}.`,write:{destination:this.destinationOf(e),persisted:!0}}}};transforms={dimensions:e=>this.transformObject(e)?"3d":null,get:e=>Wt(this.transformObject(e)),editability:(e,t)=>this.transformEditability(e,t),beginEdit:e=>{if(!this.transformEditability(e,"position").writable&&!this.transformEditability(e,"rotation").writable&&!this.transformEditability(e,"scale").writable)return;const t=this.transformObject(e);t&&(this.transformEdits.has(e)||this.transformEdits.set(e,{id:e,position:t.position.toArray(),quaternion:t.quaternion.toArray(),euler:[t.rotation.x,t.rotation.y,t.rotation.z],scale:t.scale.toArray()}))},apply:(e,t)=>{const r=this.transformObject(e);r&&(r.position.fromArray(t.position),r.quaternion.fromArray(t.rotation),r.scale.fromArray(t.scale))},endEdit:e=>{const t=this.transformEdits.get(e);if(!t||(this.transformEdits.delete(e),this.completedTransformEdits.push(t),this.transformEdits.size>0))return;const r=this.completedTransformEdits.splice(0);Ft();const n=this.transformCommitQueue.then(()=>ie(this.pipedTransformCommit(r)));return n.then(Ie,Ie),this.transformCommitQueue=n.then(()=>{},i=>{console.error("[R3fSourceAuthoringAdapter] transform commit failed",i)}),n},remove:(e,t)=>{const r=this.oidOf(e);if(r)return this.pipedJsxRemove(()=>this.removeTransformChannel(e,r,t),this.destinationOf(e))}};async removeTransformChannel(e,t,r){const n=this.transformEditability(e,r);return!n.writable||n.removable!==!0?(console.warn(`[R3fSourceAuthoringAdapter] cannot drop "${r}" on "${e}": ${n.reason??"this callsite authors no such attribute"}.`),!1):this.removeOidProp(e,t,`${O}${r}`,r)}destinationOf(e){const t=this.sourceLocation(e);return t?this.projectRelativeSourceFile(t.file):this.options.entryPath}pipedJsxWrite(e,t=this.writeBackend?.writeProp!==void 0,r=this.options.entryPath){return ie({resolve:()=>t?{reaches:"writer",anchorKind:"source-prop",destination:r,write:e}:oe(de),record:()=>{},report:n=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${n}.`)})}pipedSourceTokenWrite(e){return ie({resolve:()=>this.writeBackend&&this.store.shell.projectHistory?{reaches:"writer",anchorKind:"construction-literal",destination:this.options.entryPath,write:()=>e().catch(t=>(console.error("[R3fSourceAuthoringAdapter] source token write failed",t),!1))}:oe(de),record:()=>{},report:t=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${t}.`)})}pipedTransformCommit(e){return{resolve:()=>this.writeBackend?.writeProp?{reaches:"writer",anchorKind:"source-prop",destination:this.destinationOf(e[0]?.id??""),write:()=>this.commitTransformEdits(e).catch(t=>(console.error("[R3fSourceAuthoringAdapter] transform commit failed",t),!1))}:oe(de),record:()=>{},report:t=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${t}.`)}}transformEditability(e,t){if(this.borrowsRepresentativeCallsite(e)){const c=this.byId.get(e),l=c?this.oidEntryOf(c)?.tag:void 0;return{writable:!1,reason:`Rendered by ${l?`<${l}>`:"its component"} — this object has no writable source transform of its own.`}}const r=this.oidOf(e);if(!r){const c=ne(this.byId.get(e)),l=c!==void 0?this.oidIndex.get(c)?.tag:void 0;return{writable:!1,reason:l?`Rendered by <${l}> — this object has no writable source transform of its own.`:"This rendered part has no authored source identity."}}if(!this.writeBackend?.writeProp)return{writable:!1,reason:"This session has no source writer."};const n=ar(this.oidIndex.get(r),t);if(n)return{writable:!1,reason:n};const i=this.attrsOf(e);if(!i)return this.staleOidRefreshes.has(r)||(this.staleOidRefreshes.add(r),this.refreshSourceState()),this.sourceRefreshPending?{writable:!1,reason:"Source metadata for this element is being refreshed — try again in a moment."}:(un(e),{writable:!1,reason:"Source metadata is missing for this element — an element added by hot reload is not in the OID index until the page reloads. Reload the editor page to author it."});const s=i.find(c=>c.name===t),a=this.byId.get(e);if(a&&this.isComponentBoundary(a)){const c=this.oidEntryOf(a)?.r3fAuthoring,l=c?.transformProps.includes(t)??!1,u=c?.simulationOwnedTransform===!0;if(u)return{writable:!1,reason:`${this.oidEntryOf(a)?.tag??"This component"} drives its own ${t} every frame — this instance is placed by the simulation, not by the editor.`};if(!s){if(l)return{writable:!0};const h=u?`drives its own ${t} every frame — this instance is placed by the simulation, not by the editor`:c?.root==="multiple"?"renders multiple roots":c?.root==="non-spatial"?"has no spatial root":c?.root==="unknown"?"has no statically provable native root":c?.root==="single"?`does not forward ${t} to its ${c.rootTag??"native"} root`:`does not expose a ${t} prop`;return{writable:!1,reason:`${this.oidEntryOf(a)?.tag??"This component"} ${h}.`}}if(c&&!l)return{writable:!1,reason:`${this.oidEntryOf(a)?.tag??"This component"} does not forward ${t} to its ${c.rootTag??"native"} root.`};if(!(s.isExpression&&(rn(s.rawValue)||t==="scale"&&Q.test(s.rawValue))))return{writable:!1,reason:t==="scale"?"scale is not exposed as a number or three-number tuple by this component.":`${t} is not exposed as a three-number tuple by this component.`}}return s?.isExpression&&!s.isLiteral?{writable:!1,reason:`${t} is controlled by the JSX expression {${s.rawValue}}.`}:{writable:!0,...s&&this.writeBackend?.removeProp?{removable:!0}:{}}}async commitTransformEdits(e){if(e.length===0)return!1;const t=this.writeBackend;let r=!1;const n=async i=>{for(const s of e)await this.commitTransformEdit(s,i,!1)&&(r=!0)};return e.length>1&&t?.runGesture?await t.runGesture("Transform Selection",i=>n(i)):await n(t),r}async commitTransformEdit(e,t,r=!0){const n=this.transformObject(e.id);if(!n)return!1;const i=this.oidOf(e.id),s=i?this.attrsOf(e.id):null,a={position:!this.nearlyEqual(n.position.toArray(),e.position),rotation:!this.nearlyEqual([n.rotation.x,n.rotation.y,n.rotation.z],e.euler),scale:!this.nearlyEqual(n.scale.toArray(),e.scale)};if(!a.position&&!a.rotation&&!a.scale)return!1;const c=p=>{p==="position"?n.position.fromArray(e.position):p==="rotation"?n.quaternion.fromArray(e.quaternion):n.scale.fromArray(e.scale),this.store.shell.notifyIngestEdit()},l=t??this.writeBackend;if(!i||!l?.writeProp){console.warn(`[R3fSourceAuthoringAdapter] transform on "${e.id}" is not persistable (${i?"no source-write backend":"node has no source stamp"}) — reverting.`);for(const p of["position","rotation","scale"])a[p]&&c(p);return!1}const u=[];for(const p of["position","rotation","scale"]){if(!a[p])continue;const f=p==="position"?n.position.toArray():p==="rotation"?[n.rotation.x,n.rotation.y,n.rotation.z]:n.scale.toArray(),g=s?.find(v=>v.name===p);if(g&&g.isExpression&&!g.isLiteral){console.warn(`[R3fSourceAuthoringAdapter] "${p}" on "${e.id}" is expression-bound (guarded) — reverting the live object.`),this.dynamicPaths.add(`${e.id}|${p}`),c(p);continue}if(p==="scale"&&g&&Q.test(g.rawValue)){const[v,x,w]=f;Math.abs(v-x)<U&&Math.abs(x-w)<U?u.push({channel:p,value:F(v)}):u.push({channel:p,value:K(f),shapeUpgrade:!0});continue}u.push({channel:p,value:K(f)})}if(u.length===0)return!1;let d=!1;const h=async p=>{for(const f of u){const g=await p.writeProp(i,f.channel,f.value,{addIfMissing:!0,...f.shapeUpgrade?{allowShapeUpgrade:!0}:{}});g.changed&&(d=!0),g.changed||(g.dynamic&&this.dynamicPaths.add(`${e.id}|${f.channel}`),console.warn(`[R3fSourceAuthoringAdapter] ${f.channel} write refused for oid "${i}": ${g.dynamic?"dynamic expression (guarded)":g.error??"no change"} — reverting.`),c(f.channel))}};return r&&u.length>1&&l.runGesture?await l.runGesture("Transform",p=>h(p)):await h(l),this.store.shell.notifyIngestEdit(),d}nearlyEqual(e,t){return e.length===t.length&&e.every((r,n)=>Math.abs(r-(t[n]??0))<U)}materialOidOf(e){return M(R(e))??null}attrsOfOid(e){const t=this.oidIndex.get(e);if(!t)return null;const r=this.sources.get(t.file);if(r===void 0)return null;const n=H(r,t.line,t.col);if(r[n]!=="<")return null;const i=fe(r,n);return i<0?null:Te(r,n,i)}descriptorTypeFor(e,t,r,n){const i=(()=>{if(!e.isLiteral)return"string";const c=e.rawValue;if(c==="true"||c==="false")return"boolean";if(e.isExpression&&Q.test(c))return"number";if(e.isExpression&&xe(c))return"json";const l=e.isExpression?c.replace(/^['"]|['"]$/g,""):c;return Xr.test(l)?"color":"string"})(),s=this.oidIndex.get(t.oid);return n===void 0&&s?.propsResolved===!0&&/^[A-Z]/.test(s.tag??"")&&qt(s?.file??this.options.entryPath,r,i),i}literalValueOf(e){if(!e.isLiteral)return`{${e.rawValue}}`;const t=e.rawValue;if(!e.isExpression)return t;if(t==="true")return!0;if(t==="false")return!1;if(Q.test(t))return Number(t);if(xe(t))try{return JSON.parse(t.replace(/,\s*\]$/,"]"))}catch{return t}return t.replace(/^['"]|['"]$/g,"")}parseWrapperPropertyPath(e){if(!e.startsWith(he))return null;const t=e.slice(he.length),r=t.indexOf(".");if(r<1)return null;try{return{oid:decodeURIComponent(t.slice(0,r)),prop:t.slice(r+1)}}catch{return null}}declaredPropsOf(e){const t=this.oidOf(e);return(t?this.oidIndex.get(t)?.props:void 0)??[]}nodeSubject(e){const t=this.oidOf(e);return t?{oid:t,declared:this.declaredPropsOf(e),pathFor:r=>`${O}${r}`,keyFor:r=>`${e}|${O}${r}`}:null}wrapperSubject(e){const t=r=>`${he}${encodeURIComponent(e)}.${r}`;return{oid:e,declared:this.oidIndex.get(e)?.props??[],pathFor:t,keyFor:t}}collapsedWrappersOf(e){const t=this.oidOf(e);if(!t)return[];const r=this.liveOids(),n=[];let i=this.oidIndex.get(t)?.parentOid;for(let s=0;i&&s<16&&!r.has(i);s+=1){const a=this.oidIndex.get(i);if(!a)break;/^[A-Z]/.test(a.tag)&&n.push({oid:i,tag:a.tag}),i=a.parentOid}return n.reverse()}rigidBodyOidOf(e){const t=this.byId.get(e),r=[this.definitionOid(e),M(t),this.oidOf(e)].filter(n=>typeof n=="string");for(const n of r){let i=n;for(let s=0;i&&s<32;s+=1){const a=this.oidIndex.get(i);if(!a)break;if(a.tag==="RigidBody")return i;i=a.parentOid}}return null}explicitColliderOids(e){const t=r=>{let n=this.oidIndex.get(r)?.parentOid;for(let i=0;n&&i<32;i+=1){if(n===e)return!0;const s=this.oidIndex.get(n);if(!s||s.tag==="RigidBody")return!1;n=s.parentOid}return!1};return[...this.oidIndex.entries()].filter(([r,n])=>n.tag in ct&&t(r)).sort(([,r],[,n])=>r.file===n.file?r.line-n.line||r.col-n.col:r.file.localeCompare(n.file)).map(([r])=>r)}physicsRead(e){const t=this.options.physics?.();if(!t)return[];try{return[...e(t)??[]]}catch{return[]}}colliderBindingsOf(e){const t=this.rigidBodyOidOf(e);if(!t)return[];const r=this.explicitColliderOids(t),n=this.physicsRead(s=>s.colliders?.(e));if(r.length===0||r.length!==n.length)return[];const i=[];for(let s=0;s<r.length;s+=1){const a=r[s],c=this.oidIndex.get(a)?.tag,l=n[s];if(!c||ct[c]!==l.shape.type)return[];const u=this.attrsOfOid(a)?.find(d=>d.name==="args");i.push({sourceOid:a,sourceTag:c,snapshot:l,writable:!!this.writeBackend?.writeProp&&!!u?.isLiteral&&!this.dynamicPaths.has(`${N}${encodeURIComponent(a)}.args`)})}return i}parseColliderArgPath(e){if(!e.startsWith(N))return null;const t=/^collider\.([^.]*)\.arg\.(\d+)$/.exec(e);if(!t)return null;try{return{oid:decodeURIComponent(t[1]),index:Number(t[2])}}catch{return null}}colliderArgs(e){const t=this.valueEcho.get(`${N}${encodeURIComponent(e)}.args`);if(Array.isArray(t)&&t.every(i=>typeof i=="number"))return[...t];const r=this.attrsOfOid(e)?.find(i=>i.name==="args"),n=r?this.literalValueOf(r):null;return Array.isArray(n)&&n.every(i=>typeof i=="number")?[...n]:null}colliderDimensionRows(e){const t=e.sourceTag==="CuboidCollider"?["Half extent X","Half extent Y","Half extent Z"]:e.sourceTag==="CapsuleCollider"?["Half height","Radius"]:["Radius"],r=this.attrsOfOid(e.sourceOid)?.find(i=>i.name==="args"),n=e.writable?null:this.writeBackend?.writeProp?r?.isLiteral?"This size is computed while the game runs; edit it in source.":`\`<${e.sourceTag} args>\` is an expression in source, not a number list; edit it there.`:"Source writes are unavailable in this session.";return t.map((i,s)=>({path:`${N}${encodeURIComponent(e.sourceOid)}.arg.${s}`,label:i,type:"number",group:$(e.sourceTag),readonly:!e.writable,...n?{readonlyReason:n}:{}}))}jointBindingsOf(e){const t=this.rigidBodyOidOf(e),r=t?this.oidIndex.get(t):void 0;if(!t||!r?.jointBindings)return[];const n=this.physicsRead(s=>s.joints?.(e));if(r.jointBindings.length!==n.length)return[];const i=[];for(let s=0;s<r.jointBindings.length;s+=1){const a=r.jointBindings[s],c=n[s];if(nn[a.hook]!==c.type)return[];i.push({sourceOid:t,sourceFile:r.file,source:a,snapshot:c,writable:!!a.params&&!!a.paramRanges&&!!this.writeBackend?.readSource&&!!this.writeBackend.applySource&&!!this.store.shell.projectHistory})}return i}jointKey(e){return`${e.source.line}:${e.source.col}`}jointPath(e,t){return`${st}${this.jointKey(e)}.${t}`}jointBindingForPath(e,t){const r=/^joint\.(\d+:\d+)\./.exec(t);return r?this.jointBindingsOf(e).find(n=>this.jointKey(n)===r[1])??null:null}jointParamPath(e){const t=/^joint\.\d+:\d+\.param\.(\d+)(?:\.(\d+))?$/.exec(e);return t?{param:Number(t[1]),...t[2]===void 0?{}:{part:Number(t[2])}}:null}jointTupleRows(e,t,r,n=["X","Y","Z"]){const i=$(e.source.hook.replace(/^use/,""));return n.map((s,a)=>({path:this.jointPath(e,`param.${r}.${a}`),label:`${t} ${s}`,type:"number",readonly:!e.writable,group:i}))}jointScalarRow(e,t,r){return{path:this.jointPath(e,`param.${r}`),label:t,type:"number",readonly:!e.writable,group:$(e.source.hook.replace(/^use/,""))}}jointDetailRows(e){switch(e.source.hook){case"useFixedJoint":return e.source.params?[...this.jointTupleRows(e,"Local Frame A",1,["X","Y","Z","W"]),...this.jointTupleRows(e,"Local Frame B",3,["X","Y","Z","W"])]:[];case"useRevoluteJoint":case"usePrismaticJoint":return[...this.jointTupleRows(e,"Axis",2),...e.source.params?.[3]||e.snapshot.limits?[...this.jointTupleRows(e,"Limit",3,["Min","Max"])]:[]];case"useRopeJoint":return e.source.params?[this.jointScalarRow(e,"Length",2)]:[];case"useSpringJoint":return e.source.params?[this.jointScalarRow(e,"Rest Length",2),this.jointScalarRow(e,"Stiffness",3),this.jointScalarRow(e,"Damping",4)]:[];default:return[]}}jointRows(e){const t=$(e.source.hook.replace(/^use/,""));return[{path:this.jointPath(e,"body1"),label:"Body A",type:"string",readonly:!0,group:t},{path:this.jointPath(e,"body2"),label:"Body B",type:"string",readonly:!0,group:t},...this.jointTupleRows(e,"Anchor A",0),...this.jointTupleRows(e,"Anchor B",e.source.hook==="useFixedJoint"?2:1),...this.jointDetailRows(e),{path:this.jointPath(e,"contacts"),label:"Contacts Enabled",type:"boolean",readonly:!0,group:t}]}jointValue(e,t){const r=this.jointBindingForPath(e,t);if(!r)return;if(t.endsWith(".body1"))return r.source.body1Ref;if(t.endsWith(".body2"))return r.source.body2Ref;if(t.endsWith(".contacts"))return r.snapshot.contactsEnabled;const n=this.jointParamPath(t);if(n)return ln(cn(r,n.param),n.part)}particleBindingsOf(e){const t=this.byId.get(e);if(!t)return[];const r=[];t.traverse(i=>{const s=M(i)??_(i);!s||!this.oidIndex.get(s)?.particleBinding||r.push({emitter:i,sourceOid:s})});const n=[];for(const{emitter:i,sourceOid:s}of r){const a=this.oidIndex.get(s),c=a?.particleBinding,l=wr(i);!a||!c||!l||c.shape!==l.type||n.push({sourceOid:s,sourceFile:a.file,source:c,emitter:i,shape:l,writableFields:new Set(Object.keys(c.fields).filter(()=>!!this.writeBackend?.readSource&&!!this.writeBackend.applySource&&!!this.store.shell.projectHistory))})}return n}particleKey(e){return encodeURIComponent(e.sourceOid)}particlePath(e,t){return`${at}${this.particleKey(e)}.${t}`}particleBindingForPath(e,t){const r=/^particle\.([^.]+)\./.exec(t);return r?this.particleBindingsOf(e).find(n=>this.particleKey(n)===r[1])??null:null}particleFieldPath(e){return/^particle\.[^.]+\.([A-Za-z][A-Za-z0-9]*)$/.exec(e)?.[1]??null}particleRows(e){const t=$(e.source.constructor),r={radius:"Radius",arc:"Arc",thickness:"Thickness",angle:"Angle",donutRadius:"Donut Radius",width:"Width",height:"Height",column:"Columns",row:"Rows"},n={point:[],sphere:["radius","arc","thickness"],hemisphere:["radius","arc","thickness"],cone:["radius","arc","thickness","angle"],circle:["radius","arc","thickness"],donut:["radius","arc","thickness","donutRadius"],rectangle:["width","height","thickness"],grid:["width","height","column","row"]};return[{path:this.particlePath(e,"type"),label:"Shape",type:"string",readonly:!0,group:t},...(n[e.shape.type]??[]).map(i=>({path:this.particlePath(e,i),label:r[i]??$(i),type:"number",readonly:!e.writableFields.has(i),group:t}))]}particleValue(e,t){const r=this.particleBindingForPath(e,t),n=this.particleFieldPath(t);if(!(!r||!n))return n==="type"?r.shape.type:r.shape[n]}async writeParticleField(e,t,r){const n=this.writeBackend,i=this.store.shell.projectHistory,s=e.source.fields[t],a=this.sources.get(e.sourceFile);if(!n||!i||!s||!e.writableFields.has(t)||a===void 0||s.start<0||s.end>a.length||Number(a.slice(s.start,s.end))!==s.value)return!1;const c=Sr(t,r),l=e.shape[t];vt({binding:e,field:t,value:c}),this.store.shell.notifyIngestEdit();const u=`${a.slice(0,s.start)}${F(c)}${a.slice(s.end)}`;try{return await B(n,i,{file:e.sourceFile,source:u,label:`Edit ${$(e.source.constructor)} ${$(t)}`}),this.sources.set(e.sourceFile,u),await this.refreshSourceState(),!0}catch(d){throw e.shape[t]=l,this.store.shell.notifyIngestEdit(),d}}lodBindingsOf(e){const t=this.byId.get(e);if(!t)return[];const r=[];t.traverse(i=>{i.isLOD&&r.push(i)});const n=!!this.writeBackend?.readSource&&!!this.writeBackend.applySource&&!!this.store.shell.projectHistory;return r.map((i,s)=>{const a=M(i)??_(i),c=a?this.oidIndex.get(a):void 0,l=c?.lodBinding,u=!!l?.distances&&l.distances.length===i.levels.length&&l.distances.every((h,p)=>Math.abs(h.value-i.levels[p].distance)<U),d=!!l?.hysteresis&&i.levels.every(h=>Math.abs(h.hysteresis-l.hysteresis.value)<U);return{key:a??`${e}:${s}`,...a?{sourceOid:a}:{},...c?{sourceFile:c.file}:{},...l?{source:l}:{},lod:i,writableDistances:new Set(n&&u?i.levels.map((h,p)=>p):[]),writableHysteresis:n&&d}})}lodPath(e,t){return`${Se}${encodeURIComponent(e.key)}.${t}`}lodBindingForPath(e,t){const r=/^lod\.([^.]+)\./.exec(t);if(!r)return null;const n=decodeURIComponent(r[1]);return this.lodBindingsOf(e).find(i=>i.key===n)??null}lodPreviewOption(e,t){const r=e.lod.levels[t]?.object,n=r?r.name||r.type:"";return`Level ${t}${n?` — ${n}`:""}`}lodRows(e){const t="Level of Detail",r=[{path:this.lodPath(e,"preview"),label:"Preview Level",type:"enum",options:["Auto",...e.lod.levels.map((n,i)=>this.lodPreviewOption(e,i))],group:t},{path:this.lodPath(e,"active"),label:"Active Level",type:"string",readonly:!0,group:t}];return e.lod.levels.forEach((n,i)=>{r.push({path:this.lodPath(e,`level.${i}.object`),label:`Level ${i} Object`,type:"string",readonly:!0,group:t},{path:this.lodPath(e,`level.${i}.distance`),label:`Level ${i} Distance`,type:"number",readonly:!e.writableDistances.has(i),group:t})}),e.lod.levels.length>0&&r.push({path:this.lodPath(e,"hysteresis"),label:"Hysteresis",type:"number",readonly:!e.writableHysteresis,group:t}),r}lodValue(e,t){const r=this.lodBindingForPath(e,t);if(!r)return;if(t.endsWith(".preview")){const s=this.store.getLodForcedLevel(e);return s===null?"Auto":this.lodPreviewOption(r,s)}if(t.endsWith(".active")){const s=this.store.getLodForcedLevel(e);return this.lodPreviewOption(r,s??r.lod.getCurrentLevel())}if(t.endsWith(".hysteresis"))return r.lod.levels[0]?.hysteresis;const n=/\.level\.(\d+)\.(object|distance)$/.exec(t);if(!n)return;const i=r.lod.levels[Number(n[1])];if(i)return n[2]==="distance"?i.distance:i.object.name||i.object.type||`Level ${n[1]}`}async writeLodToken(e,t,r,n,i,s){const a=this.writeBackend,c=this.store.shell.projectHistory,l=e.sourceFile,u=l?this.sources.get(l):void 0;if(!a||!c||!l||u===void 0||t.start<0||t.end>u.length||Number(u.slice(t.start,t.end))!==t.value)return!1;i(),this.store.shell.notifyIngestEdit();const d=`${u.slice(0,t.start)}${F(r)}${u.slice(t.end)}`;try{return await B(a,c,{file:l,source:d,label:n}),this.sources.set(l,d),await this.refreshSourceState(),!0}catch(h){throw s(),this.store.shell.notifyIngestEdit(),h}}writeLodDistance(e,t,r){const n=e.source?.distances?.[t];if(!n||!e.writableDistances.has(t))return Promise.resolve(!1);const i=mt(e,t,r),s=e.lod.levels[t]?.distance;return this.writeLodToken(e,n,i,`Edit LOD ${t} distance`,()=>yt({binding:e,level:t,value:i}),()=>{const a=e.lod.levels[t];a&&s!==void 0&&(a.distance=s)})}writeLodHysteresis(e,t){const r=e.source?.hysteresis;if(!r||!e.writableHysteresis)return Promise.resolve(!1);const n=Math.round(Math.max(0,Math.min(1,t))*1e3)/1e3,i=e.lod.levels.map(s=>s.hysteresis);return this.writeLodToken(e,r,n,"Edit LOD hysteresis",()=>{for(const s of e.lod.levels)s.hysteresis=n},()=>{e.lod.levels.forEach((s,a)=>{s.hysteresis=i[a]??s.hysteresis})})}async writeJointParams(e,t){const r=this.writeBackend,n=this.store.shell.projectHistory,i=this.sources.get(e.sourceFile),s=e.source.params,a=e.source.paramRanges;if(!r||!n||i===void 0||!s||!a)return!1;const c=[];if(!Tt(i,s,t,a,c)||c.length===0)return!1;c.sort((u,d)=>d.start-u.start);let l=i;for(const u of c){if(u.start<0||u.end>l.length)return!1;l=`${l.slice(0,u.start)}${u.text}${l.slice(u.end)}`}return await B(r,n,{file:e.sourceFile,source:l,label:`Edit ${$(e.source.hook.replace(/^use/,""))}`}),this.sources.set(e.sourceFile,l),await this.refreshSourceState(),!0}isOverride(e,t,r){return!e?.isLiteral||this.dynamicPaths.has(r)||!t?.optional?!1:!!this.writeBackend?.removeProp}measuredTypeFor(e,t){if(!e)return null;const r=e[t];return typeof r=="number"?"number":typeof r=="boolean"?"boolean":typeof r=="object"&&r!==null&&r.isColor?"color":null}componentProperties(e,t,r,n=en,i=null){const s=new Map(r.map(d=>[d.name,d])),a=e.declared,c=[],l=(d,h)=>{if(Zr(d)||Yr.has(d)||n.has(d))return;const p=s.get(d),f=!p&&h?.defaultText!==void 0&&h.defaultValue===void 0,g=h?.type??null,v=e.pathFor(d),x=this.isOverride(p,h,e.keyFor(d));c.push({path:v,label:$(d),type:f?"string":g??this.measuredTypeFor(i,d)??(p?this.descriptorTypeFor(p,e,d,h):"string"),...h?.options?{options:[...h.options]}:{},readonly:f||(p?!p.isLiteral:!1)||this.dynamicPaths.has(e.keyFor(d)),...p?{}:{defaulted:!0},...x?{resettable:!0}:{},...x&&h?.defaultText!==void 0?{revertsTo:h.defaultText}:{},group:t})};for(const d of a)l(d.name,d);const u=new Set(a.map(d=>d.name));for(const d of r)u.has(d.name)||l(d.name,void 0);return c}nativeEnvironmentSource(e,t){const r=M(lt(e)),n=r?this.oidIndex.get(r):void 0;return r&&n?.environmentBinding?.kind===t?{oid:r,file:n.file,binding:n.environmentBinding}:null}canWriteEnvironmentToken(e,t){if(!e||!t||!this.writeBackend?.readSource||!this.writeBackend.applySource||!this.store.shell.projectHistory)return!1;const r=this.sources.get(e.file);if(r===void 0||t.start<0||t.end>r.length)return!1;const n=r.slice(t.start,t.end);return"quote"in t?n===`${t.quote}${t.value}${t.quote}`:Number(n)===t.value}backgroundSource(){return q(this.scene.background)?this.nativeEnvironmentSource(this.scene.background,"background-color"):null}fogSource(){return L(this.scene.fog)?this.nativeEnvironmentSource(this.scene.fog,"fog"):G(this.scene.fog)?this.nativeEnvironmentSource(this.scene.fog,"fog-exp2"):null}textureLabel(e){return e?e.isCubeTexture?e.name||"Cube Texture":e.name||"Texture":"None"}worldProperties(){const e=[{path:"name",label:"World",type:"string",readonly:!0,group:"World"},{path:"source.path",label:"Entry",type:"string",readonly:!0,group:"World"}],t=this.scene.background,r=this.backgroundSource();if(e.push({path:`${I}type`,label:"Background",type:"string",readonly:!0,group:"Environment"}),q(t)){const s=r?.binding.kind==="background-color"?r.binding.color:void 0;e.push({path:`${I}color`,label:"Background Color",type:"color",readonly:!this.canWriteEnvironmentToken(r,s),group:"Environment"})}else on(t)&&e.push({path:`${I}intensity`,label:"Background Intensity",type:"number",readonly:!0,group:"Environment"},{path:`${I}blurriness`,label:"Background Blur",type:"number",readonly:!0,group:"Environment"},{path:`${I}rotation`,label:"Background Rotation Y",type:"number",readonly:!0,group:"Environment"});e.push({path:`${W}map`,label:"Lighting Environment",type:"string",readonly:!0,group:"Environment"}),this.scene.environment&&e.push({path:`${W}intensity`,label:"Environment Intensity",type:"number",readonly:!0,group:"Environment"},{path:`${W}rotation`,label:"Environment Rotation Y",type:"number",readonly:!0,group:"Environment"});const n=this.scene.fog,i=this.fogSource();if(e.push({path:`${S}mode`,label:"Mode",type:"string",readonly:!0,group:"Fog"}),n){const s=i?.binding.color;e.push({path:`${S}color`,label:"Color",type:"color",readonly:!this.canWriteEnvironmentToken(i,s),group:"Fog"})}if(L(n)){const s=i?.binding.kind==="fog"?i.binding:void 0;e.push({path:`${S}near`,label:"Near",type:"number",readonly:!this.canWriteEnvironmentToken(i,s?.near),group:"Fog"},{path:`${S}far`,label:"Far",type:"number",readonly:!this.canWriteEnvironmentToken(i,s?.far),group:"Fog"})}else if(G(n)){const s=i?.binding.kind==="fog-exp2"?i.binding:void 0;e.push({path:`${S}density`,label:"Density",type:"number",readonly:!this.canWriteEnvironmentToken(i,s?.density),group:"Fog"})}return e}worldValue(e){const t=this.scene.background,r=this.scene.fog;if(e==="name")return this.options.worldId;if(e==="source.path")return this.options.entryPath;if(e===`${I}type`)return t?q(t)?"Color":this.textureLabel(t):"None";if(e===`${I}color`&&q(t))return`#${t.getHexString()}`;if(e===`${I}intensity`)return this.scene.backgroundIntensity;if(e===`${I}blurriness`)return this.scene.backgroundBlurriness;if(e===`${I}rotation`)return this.scene.backgroundRotation.y*180/Math.PI;if(e===`${W}map`)return this.textureLabel(this.scene.environment);if(e===`${W}intensity`)return this.scene.environmentIntensity;if(e===`${W}rotation`)return this.scene.environmentRotation.y*180/Math.PI;if(e===`${S}mode`)return L(r)?"Linear":G(r)?"Exponential":"None";if(e===`${S}color`&&r)return`#${r.color.getHexString()}`;if(e===`${S}near`&&L(r))return r.near;if(e===`${S}far`&&L(r))return r.far;if(e===`${S}density`&&G(r))return r.density}setWorldValue(e,t){const r=this.scene.background,n=this.scene.fog;if(e===`${I}color`&&q(r)){const s=this.backgroundSource(),a=s?.binding.kind==="background-color"?s.binding.color:void 0;if(typeof t!="string"||!s||!a)return!1;const c=`#${r.getHexString()}`;return this.writeEnvironmentToken(s,a,t,"Edit background color",()=>r.set(t),()=>r.set(c))}const i=this.fogSource();if(!n||!i)return!1;if(e===`${S}color`&&typeof t=="string"){const s=i.binding.color;if(!s)return!1;const a=`#${n.color.getHexString()}`;return this.writeEnvironmentToken(i,s,t,"Edit fog color",()=>n.color.set(t),()=>n.color.set(a))}if(typeof t!="number")return!1;if(e===`${S}near`&&L(n)){const s=i.binding.kind==="fog"?i.binding.near:void 0;if(!s)return!1;const a=n.near,c=Math.max(0,Math.min(t,n.far-.01));return this.writeEnvironmentToken(i,s,c,"Edit fog near",()=>{n.near=c},()=>{n.near=a})}else if(e===`${S}far`&&L(n)){const s=i.binding.kind==="fog"?i.binding.far:void 0;if(!s)return!1;const a=n.far,c=Math.max(n.near+.01,t);return this.writeEnvironmentToken(i,s,c,"Edit fog far",()=>{n.far=c},()=>{n.far=a})}else if(e===`${S}density`&&G(n)){const s=i.binding.kind==="fog-exp2"?i.binding.density:void 0;if(!s)return!1;const a=n.density,c=Math.max(0,t);return this.writeEnvironmentToken(i,s,c,"Edit fog density",()=>{n.density=c},()=>{n.density=a})}return!1}async writeEnvironmentToken(e,t,r,n,i,s){const a=this.writeBackend,c=this.store.shell.projectHistory,l=this.sources.get(e.file);if(!a||!c||l===void 0||!this.canWriteEnvironmentToken(e,t))return!1;let u;if("quote"in t){if(typeof r!="string"||sn(r)===null)return!1;const h=r.replaceAll("\\","\\\\").replaceAll(t.quote,`\\${t.quote}`);u=`${t.quote}${h}${t.quote}`}else{if(typeof r!="number"||!Number.isFinite(r))return!1;u=F(r)}i(),this.store.shell.notifyIngestEdit();const d=`${l.slice(0,t.start)}${u}${l.slice(t.end)}`;try{return await B(a,c,{file:e.file,source:d,label:n}),this.sources.set(e.file,d),await this.refreshSourceState(),!0}catch(h){throw s(),this.store.shell.notifyIngestEdit(),h}}visibilityEditability(e){if(this.borrowsRepresentativeCallsite(e))return{writable:!1,reason:"This rendered part has no visibility prop of its own."};if(!this.oidOf(e))return{writable:!1,reason:"This rendered part has no authored source identity."};if(!this.writeBackend?.writeProp)return{writable:!1,reason:"This session has no source writer."};const r=this.attrsOf(e);if(!r)return{writable:!1,reason:"Source metadata is still loading or unavailable."};const n=r.find(a=>a.name==="visible"),i=this.byId.get(e);if(i&&this.isComponentBoundary(i)){const a=this.oidEntryOf(i),c=a?.r3fAuthoring;if(c?.visibleProp!==!0)return{writable:!1,reason:`${a?.tag??"This component"} does not prove that visible reaches its ${c?.rootTag??"native"} root.`}}return n?n.isLiteral?n.valueStart<0||n.isExpression&&(n.rawValue==="true"||n.rawValue==="false")?{writable:!0}:{writable:!1,reason:"visible is not exposed as a boolean JSX literal."}:{writable:!1,reason:`visible is controlled by the JSX expression {${n.rawValue}}.`}:{writable:!0}}async writeVisibility(e,t,r){const n=this.visibilityEditability(e),i=this.oidOf(e),s=this.writeBackend;if(!n.writable||!i||!s?.writeProp){const l=n.reason??"No native visibility write is available.";return console.warn(`[R3fSourceAuthoringAdapter] visibility write refused: ${l}`),j(l),!1}const a=t.visible,c=this.echoKey(e,"visible");t.visible=r,this.valueEcho.set(c,r),this.store.shell.notifyIngestEdit();try{const l=await s.writeProp(i,"visible",this.serializeValue(r),{addIfMissing:!0});return l.changed?!0:(l.dynamic&&this.dynamicPaths.add(c),t.visible=a,this.valueEcho.delete(c),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] visibility write refused for oid "${i}": ${l.dynamic?"dynamic expression (guarded)":l.error??"no change"} — reverting.`),!1)}catch(l){return t.visible=a,this.valueEcho.delete(c),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] visibility write failed for oid "${i}": ${String(l)} — reverting.`),!1}}inspector={preview:(e,t,r)=>{const n=this.transformObject(e);if(!n)return;const i=Z(n,R(n),t,this.sourceLocation(e)?.tag);!i||i.type==="asset"||(T(n,R(n),i,r),this.store.shell.notifyIngestEdit())},properties:e=>{if(e===this.documentNodeId)return this.worldProperties();const t=this.byId.get(e),r=this.transformObject(e);if(!t||!r)return[];const n=this.attrsOf(e)?.find(f=>f.name==="visible"),i=this.visibilityEditability(e),s=this.attrsOf(e)?.find(f=>f.name==="name"),a=[{path:"name",label:"Name",type:"string",readonly:!this.writeBackend?.writeProp||s?.isLiteral===!1},{path:"visible",label:"Visible",type:"boolean",readonly:!i.writable,...!i.writable&&i.reason?{readonlyReason:i.reason}:{},...n?{}:{defaulted:!0}},{path:"locked",label:"Locked",type:"boolean"}],c=Ce(r);c?.fields&&a.push(...c.fields().filter(f=>!["name","visible","locked"].includes(f.path)).map(({value:f,...g})=>g));const l=xt(r),u=[...$t(r,R(r),this.sourceLocation(e)?.tag),...l?[l]:[]],d=new Set(u.filter(f=>f.target==="self").map(f=>f.prop)),h=this.lodBindingsOf(e);h.length>0&&(d.add("distances"),d.add("hysteresis"));for(const f of h)a.push(...this.lodRows(f));const p=this.attrsOf(e);if(p){for(const w of this.collapsedWrappersOf(e))a.push(...this.componentProperties(this.wrapperSubject(w.oid),$(w.tag),this.attrsOfOid(w.oid)??[]));for(const w of this.colliderBindingsOf(e))a.push(...this.colliderDimensionRows(w)),a.push(...this.componentProperties(this.wrapperSubject(w.sourceOid),$(w.sourceTag),this.attrsOfOid(w.sourceOid)??[],new Set(["args"])));for(const w of this.jointBindingsOf(e))a.push(...this.jointRows(w));for(const w of this.particleBindingsOf(e))a.push(...this.particleRows(w));const f=this.oidEntryOf(t),g=f?.tag?$(f.tag):"Properties";this.sourceLocation(e)&&a.push({path:"source.location",label:"Source",type:"string",readonly:!0,group:g});const x=this.nodeSubject(e);x&&a.push(...this.componentProperties(x,g,p,d,r))}for(const f of u)a.push(this.typedThreeRow(e,r,f));return a},editability:(e,t)=>t==="visible"?this.visibilityEditability(e):t==="locked"?{writable:this.byId.has(e)}:{writable:!0},get:(e,t)=>{if(e===this.documentNodeId)return this.worldValue(t);const r=this.byId.get(e),n=this.transformObject(e);if(!r||!n)return;const i=this.valueEcho.get(this.echoKey(e,t));if(i!==void 0)return i;if(t==="name")return this.oidEntryOf(r)?.tag||n.name||n.type;if(t==="visible")return n.visible;if(t==="locked")return this.lockedIds.has(e);if(t==="object.type")return n.type;const s=Ce(n)?.fields?.().find(u=>u.path===t);if(s)return s.value();if(t==="source.location"){const u=this.sourceLocation(e);return u?`${u.file.split("/").slice(-2).join("/")}:${u.line}`:""}const a=Z(n,R(n),t,this.sourceLocation(e)?.tag);if(a)return this.readTypedThree(n,a);const c=this.parseColliderArgPath(t);if(c)return this.colliderArgs(c.oid)?.[c.index];if(t.startsWith(st))return this.jointValue(e,t);if(t.startsWith(at))return this.particleValue(e,t);if(t.startsWith(Se))return this.lodValue(e,t);const l=this.parseWrapperPropertyPath(t);if(l)return this.propValue(this.attrsOfOid(l.oid),this.oidIndex.get(l.oid)?.props??[],l.prop);if(t.startsWith(O)){const u=t.slice(O.length);return this.propValue(this.attrsOf(e),this.declaredPropsOf(e),u)}},set:(e,t,r)=>{if(e===this.documentNodeId)return this.pipedSourceTokenWrite(async()=>this.setWorldValue(t,r));const n=this.byId.get(e),i=this.transformObject(e);if(!n||!i)return;if(t==="visible")return this.pipedJsxWrite(()=>this.writeVisibility(e,i,!!r),void 0,this.destinationOf(e));if(t==="name"){const d=String(r??"").trim();return!d||d===i.name?void 0:this.pipedJsxWrite(()=>this.writeJsxProp(e,"name","name",d),void 0,this.destinationOf(e))}if(t==="locked"){r?this.lockedIds.add(e):this.lockedIds.delete(e),this.store.shell.notifyIngestEdit();return}const s=Z(i,R(i),t,this.sourceLocation(e)?.tag);if(s)return s.type==="asset"?this.setTypedAsset(e,i,s,r):this.pipedJsxWrite(()=>this.writeTypedThree(e,i,s,r),void 0,this.destinationOf(e));const a=this.parseColliderArgPath(t);if(a&&typeof r=="number"){const d=this.colliderArgs(a.oid);return!d||a.index>=d.length?void 0:(d[a.index]=Math.max(.01,r),this.pipedJsxWrite(()=>this.writeOidProp(e,a.oid,`${N}${encodeURIComponent(a.oid)}.args`,"args",d),void 0,this.destinationOf(e)))}const c=this.jointParamPath(t);if(c&&typeof r=="number"){const d=this.jointBindingForPath(e,t);if(!d?.writable||!d.source.params)return;const h=d.source.params.map(f=>Array.isArray(f)?[...f]:f),p=h[c.param];if(c.part===void 0){if(typeof p!="number")return;h[c.param]=r}else{if(!Array.isArray(p)||typeof p[c.part]!="number")return;p[c.part]=r}return this.pipedSourceTokenWrite(()=>this.writeJointParams(d,h))}const l=this.particleFieldPath(t);if(l&&typeof r=="number"){const d=this.particleBindingForPath(e,t);return!d||!d.writableFields.has(l)?void 0:this.pipedSourceTokenWrite(()=>this.writeParticleField(d,l,r))}if(t.startsWith(Se)){const d=this.lodBindingForPath(e,t);if(!d)return;if(t.endsWith(".preview")){const p=typeof r=="string"?/^Level (\d+)/.exec(r):null,f=r==="Auto"?null:p?Number(p[1]):Number.NaN;(f===null||Number.isInteger(f)&&f>=0&&f<d.lod.levels.length)&&this.store.setLodForcedLevel(e,f);return}const h=/\.level\.(\d+)\.distance$/.exec(t);if(h&&typeof r=="number")return this.pipedSourceTokenWrite(()=>this.writeLodDistance(d,Number(h[1]),r));if(t.endsWith(".hysteresis")&&typeof r=="number")return this.pipedSourceTokenWrite(()=>this.writeLodHysteresis(d,r))}const u=this.parseWrapperPropertyPath(t);if(u)return this.pipedJsxWrite(()=>this.writeOidProp(e,u.oid,t,u.prop,r),void 0,this.destinationOf(e));if(t.startsWith(O))return this.pipedJsxWrite(()=>this.writeJsxProp(e,t,t.slice(O.length),r),void 0,this.destinationOf(e))},remove:(e,t)=>{const r=this.parseWrapperPropertyPath(t);if(r)return this.pipedJsxRemove(()=>this.removeOidProp(e,r.oid,t,r.prop),this.destinationOf(e));if(!t.startsWith(O))return;const n=this.oidOf(e);if(n)return this.pipedJsxRemove(()=>this.removeOidProp(e,n,t,t.slice(O.length)),this.destinationOf(e))}};spatialHandles=Gr({object:e=>this.transformObject(e),sourceTag:e=>this.sourceLocation(e)?.tag,writable:(e,t)=>{const r=this.inspector.properties(e).find(n=>n.path===t);return!!r&&r.readonly!==!0},commit:(e,t,r)=>this.inspector.set(e,t,r),colliderBindings:e=>this.colliderBindingsOf(e),previewCollider:(e,t)=>this.options.physics?.()?.previewCollider?.(e,t),commitCollider:(e,t,r)=>this.pipedJsxWrite(()=>this.writeOidProp(e,t,`${N}${encodeURIComponent(t)}.args`,"args",r),void 0,this.destinationOf(e)),jointBindings:e=>this.jointBindingsOf(e),previewJointAnchor:(e,t,r)=>this.options.physics?.()?.previewJointAnchor?.(e,t,r),commitJoint:(e,t)=>this.pipedSourceTokenWrite(()=>this.writeJointParams(e,t)),particleBindings:e=>this.particleBindingsOf(e),commitParticle:(e,t,r)=>this.pipedSourceTokenWrite(()=>this.writeParticleField(e,t,r)),lodBindings:e=>this.lodBindingsOf(e),commitLodDistance:(e,t,r)=>this.pipedSourceTokenWrite(()=>this.writeLodDistance(e,t,r))});serializeValue(e){return Array.isArray(e)?K(e.map(t=>Number(t))):typeof e=="number"?F(e):typeof e=="boolean"?e?"true":"false":String(e)}propValue(e,t,r){const n=e?.find(s=>s.name===r);if(n)return this.literalValueOf(n);const i=t.find(s=>s.name===r);return i?i.defaultValue??i.defaultText:void 0}echoKey(e,t){return t.startsWith(he)?t:`${e}|${t}`}projectRelativeSourceFile(e){const t=e.replaceAll("\\","/"),r=this.options.entryPath.replaceAll("\\","/").replace(/^\.\//,"");if(!t.startsWith("/")&&!/^[A-Za-z]:\//.test(t))return t;for(const n of this.oidIndex.values()){const i=n.file.replaceAll("\\","/");if(i!==r&&!i.endsWith(`/${r}`))continue;const s=i.slice(0,-r.length);if(t.startsWith(s))return t.slice(s.length)}return r}pipedJsxRemove(e,t=this.options.entryPath){return this.pipedJsxWrite(e,this.writeBackend?.removeProp!==void 0,t)}async removeOidProp(e,t,r,n){if(!this.writeBackend?.removeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot revert "${n}": no source-write backend.`),!1;this.valueEcho.delete(this.echoKey(e,r));const i=await this.writeBackend.removeProp(t,n);return i.changed?(await this.refreshSourceState(),!0):(this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] revert refused/no-op for oid "${t}" prop "${n}": ${i.dynamic?"dynamic expression (guarded)":i.error??"no change"}`),!1)}async writeOidProp(e,t,r,n,i){if(!this.writeBackend?.writeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot write "${n}": no source-write backend.`),!1;const s=this.echoKey(e,r);this.valueEcho.set(s,i),this.store.shell.notifyIngestEdit();let a;try{a=await this.writeBackend.writeProp(t,n,this.serializeValue(i),{addIfMissing:!0})}catch(c){return this.valueEcho.delete(s),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write failed for oid "${t}" prop "${n}": ${String(c)}`),!1}return a.changed?!0:(this.valueEcho.delete(s),a.dynamic&&this.dynamicPaths.add(s),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write refused/no-op for oid "${t}" prop "${n}": ${a.dynamic?"dynamic expression (guarded)":a.error??"no change"}`),!1)}async writeJsxProp(e,t,r,n){const i=this.oidOf(e);if(!i||!this.writeBackend?.writeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot write "${r}" on "${e}": ${i?"no source-write backend in this session":"node has no source stamp"}.`),!1;const s=`${e}|${t}`;this.valueEcho.set(s,n),this.store.shell.notifyIngestEdit();let a;try{a=await this.writeBackend.writeProp(i,r,this.serializeValue(n),{addIfMissing:r==="name"||this.declaredPropsOf(e).some(c=>c.name===r)})}catch(c){return this.valueEcho.delete(s),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write failed for oid "${i}" prop "${r}": ${String(c)}`),!1}return a.changed?!0:(this.valueEcho.delete(s),a.dynamic&&this.dynamicPaths.add(s),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write refused/no-op for oid "${i}" prop "${r}": ${a.dynamic?"dynamic expression (guarded)":a.error??"no change"}`),!1)}typedFieldOid(e,t,r){return r.target==="material"?this.materialOidOf(t):this.oidOf(e)}propDrivingTypedField(e,t,r){if(r.target!=="material")return null;const n=this.materialOidOf(t);if(!n)return null;const i=this.attrsOfOid(n)?.find(a=>a.name===r.prop);if(!i||i.isLiteral)return null;const s=i.rawValue.trim();return/^[A-Za-z_$][\w$]*$/.test(s)&&this.declaredPropsOf(e).some(a=>a.name===s)?s:null}typedThreeRow(e,t,r){if(r.type==="asset")return{path:r.path,label:r.label,type:r.type,group:r.group,readonly:!R(t),...R(t)?{}:{readonlyReason:"This object has no material to assign a texture to."}};const n=this.typedFieldOid(e,t,r),s=(r.target==="material"?n?this.attrsOfOid(n):null:this.attrsOf(e))?.find(u=>u.name===r.prop)??null,a=this.propDrivingTypedField(e,t,r),c=(s?!s.isLiteral:!1)&&!a||this.dynamicPaths.has(`${e}|${r.path}`),l=!!n&&!!this.writeBackend?.writeProp&&!c;return{path:r.path,label:r.label,type:r.type,...r.options?{options:[...r.options]}:{},group:r.group,readonly:!l,...s?{}:{defaulted:!0}}}readTypedThree(e,t){return J(e,R(e),t)}setTypedAsset(e,t,r,n){const i=R(t),s=T(t,i,r,n);return s!==null&&(this.valueEcho.set(`${e}|${r.path}`,J(t,i,r)),this.store.shell.notifyIngestEdit()),ie({resolve:()=>oe(s===null?`"${r.label}" has no material on "${e}" to assign to`:`a texture slot binds a loaded THREE.Texture, not a JSX attribute literal — assigning "${r.prop}" in source means adding a useTexture() binding to the component, which this adapter's attribute writer cannot author`),record:()=>{},report:a=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${a}.`)})}async writeTypedThree(e,t,r,n){const i=this.propDrivingTypedField(e,t,r);if(i){const h=R(t),p=J(t,h,r),f=T(t,h,r,n);if(f===null)return!1;this.store.shell.notifyIngestEdit();const g=await this.writeJsxProp(e,`${O}${i}`,i,f);return!g&&p!==null&&p!==void 0&&(T(t,h,r,p),this.store.shell.notifyIngestEdit()),g}const s=this.typedFieldOid(e,t,r),a=R(t);if(!s||!this.writeBackend?.writeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot write "${r.path}" on "${e}": ${s?"no source-write backend in this session":"no source stamp for this field"}.`),!1;const c=J(t,a,r),l=T(t,a,r,n);if(l===null)return!1;const u=`${e}|${r.path}`;this.valueEcho.set(u,J(t,a,r)),this.store.shell.notifyIngestEdit();let d;try{d=await this.writeBackend.writeProp(s,r.prop,this.serializeValue(l),{addIfMissing:!0})}catch(h){return this.valueEcho.delete(u),await this.refreshSourceState(),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] typed "${r.prop}" write failed for oid "${s}": ${String(h)}`),!1}return d.changed||d.dynamic&&this.declaredPropsOf(e).some(h=>h.name===r.prop)&&(this.valueEcho.delete(u),await this.writeJsxProp(e,`${O}${r.prop}`,r.prop,l))?!0:(this.valueEcho.delete(u),d.dynamic&&this.dynamicPaths.add(u),c!=null&&T(t,a,r,c),this.store.shell.notifyIngestEdit(),Pe.warn(`“${r.prop}” on “${this.hierarchy.node(e)?.label??e}” is ${d.dynamic?"bound to an expression in the component’s own source, so a direct edit cannot land — the preview was reverted. Edit the prop that drives it (or the component source) instead.":`not writable here (${d.error??"no change"}) — the preview was reverted.`}`,"editor"),!1)}structureClipboardPayload(e){const t=new Set(e),r=[...new Set(e)].filter(l=>{let u=this.hierarchy.node(l)?.parentId??null;for(;u;){if(t.has(u))return!1;u=this.hierarchy.node(u)?.parentId??null}return!0}),n=[],i=new Set;for(const l of r){const u=this.oidOf(l);if(!u||i.has(u))continue;i.add(u);const d=this.oidIndex.get(u),h=d?this.sources.get(d.file):void 0;if(!d||h===void 0)return null;const p=H(h,d.line,d.col),f=cr(h,p);if(h[p]!=="<"||f<=p)return null;const g=h.slice(h.lastIndexOf(`
5
+ </mesh>`,pointLight:"<pointLight position={[0, 2, 0]} intensity={1} />",ambientLight:"<ambientLight intensity={0.5} />",directionalLight:"<directionalLight position={[5, 10, 5]} intensity={1} />",reflectionProbe:"<ReflectionProbe position={[0, 2, 0]} size={[10, 6, 10]} blendDistance={1} />"},Ct=/\.(glb|gltf)$/i,dt=new Set(["name","position","rotation","scale","children"]),pe="@react-three/drei",X="Gltf",ht={group:"Group",mesh:"Mesh (box)",pointLight:"Point Light",ambientLight:"Ambient Light",directionalLight:"Directional Light",reflectionProbe:"Reflection Probe"};class _n{constructor(e,t,r){this.store=e,this.options=r,this.scene=t,this.documentNodeId=`r3f-document:${r.worldId}`,this.identity=nr(r.worldId),this.projector=new ir(this.identity,{pickScope:"store-object-map"}),this.writeBackend=_t(r.writeBackend,e.shell.projectHistory),this.capabilities={transform:!0,inspectorFields:!0,persist:this.writeBackend!==void 0},this.writeBackend&&(this.persistence={isDirty:()=>!1,save:async()=>{},destination:r.entryPath,lastError:()=>{const n=e.shell.projectHistory?.getSnapshot().lastError;return n&&(n.code==="apply-failed"||n.code==="compensation-failed"||n.code==="history-limit")?n.message:null}}),this.selectionState=new Dt({store:e.shell,owns:n=>this.byId.has(n),initial:[this.documentNodeId]}),this.indexGraph(),this.definitionRootIds=(r.hierarchyRoots??this.projectedChildren(this.scene)).map(n=>this.idByObject.get(n)).filter(n=>n!==void 0),this.definitionView=new Nt({projector:this.projector,scene:this.scene,documentNodeId:this.documentNodeId,rootIds:this.definitionRootIds}),this.stories=Ht("three",e.shell,n=>this.storyComponent(n)),this.refreshSourceState()}documentNodeId;scene;identity;projector;definitionRootIds;definitionView;selectionState;oidIndex=new Map;sourceRefreshId=0;sourceRefreshPending=!1;sources=new Map;valueEcho=new Map;dynamicPaths=new Set;reflectionProbeAvailable=!1;lockedIds=new Set;structureClipboard=null;writeBackend;transformEdits=new Map;completedTransformEdits=[];transformCommitQueue=Promise.resolve();stories;capabilities;persistence;provenance={source:"source-code",label:"R3F source",detail:"Live react-three-fiber scene; literal JSX props write back to the .tsx source (expression-bound props are read-only)."};get byId(){return this.projector.objects}get idByObject(){return this.projector.idsByObject}get instanceRoots(){return this.identity.instanceRoots}get oidRepresentative(){return this.identity.representatives}indexGraph(){this.projector.project(this.scene),this.watchStructure()}disposed=!1;dispose(){if(!this.disposed){this.disposed=!0;for(const e of this.watchedForStructure)e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[]}}watchedForStructure=[];structureReindexQueued=!1;staleOidRefreshes=new Set;onStructureChanged=e=>{me(e.child)||this.scheduleStructureReindex()};watchStructure(){const e=r=>r;for(const r of this.watchedForStructure)e(r).removeEventListener("childadded",this.onStructureChanged),e(r).removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[];const t=r=>{e(r).addEventListener("childadded",this.onStructureChanged),e(r).addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.push(r)};t(this.scene);for(const[,r]of this.byId)t(r)}scheduleStructureReindex(){this.disposed||this.structureReindexQueued||(this.structureReindexQueued=!0,queueMicrotask(()=>{if(this.structureReindexQueued=!1,this.disposed)return;this.indexGraph();let e=!1;for(const t of this.liveOids()){const r=this.oidIndex.get(t);if(r===void 0||!this.sources.has(r.file)){e=!0;break}}e&&this.refreshSourceState(),this.syncAdoptedObjectMap(),this.store.shell.notifyIngestEdit()}))}syncAdoptedObjectMap(){if(this.store.scene!==this.scene)return;const e=this.store.objectMap;e.clear();for(const[r,n]of this.byId)e.set(r,n);const t=[...this.store.shell.selectedEntityIds].filter(r=>e.has(r));t.length!==this.store.shell.selectedEntityIds.size&&this.store.shell.selectMultiple(t)}liveInstanceCount(e){const t=this.oidOf(e);return t?this.instanceRoots.get(t):void 0}borrowsRepresentativeCallsite(e){if(!Mt(e))return!1;const t=this.byId.get(e),r=t?_(t):void 0,n=r?this.oidRepresentative.get(r):void 0;return!n||!Lt(t,n)}adoptScene(e){this.scene=e,this.valueEcho.clear(),this.dynamicPaths.clear(),this.pendingDuplicateLabels.clear(),this.pendingDuplicateCounts.clear(),this.indexGraph(),setTimeout(()=>this.applyPendingCreatedSelection(),0),this.refreshSourceState()}pendingCreatedSelection=null;recordPendingCreatedSelection(e,t){this.pendingCreatedSelection={parentId:e,before:new Set(this.hierarchy.node(e)?.childIds??[]),selectionAtWrite:new Set(this.store.shell.selectedEntityIds),...t?{afterId:t}:{}}}applyPendingCreatedSelection(){const e=this.pendingCreatedSelection;if(this.pendingCreatedSelection=null,!e)return;const t=this.store.shell.selectedEntityIds;if(!(t.size===e.selectionAtWrite.size&&[...t].every(a=>e.selectionAtWrite.has(a))))return;const n=this.hierarchy.node(e.parentId)?.childIds??[],i=e.afterId?this.childWrittenAfter(n,e.afterId):null;if(i){this.store.shell.selectMultiple([i]);return}const s=n.filter(a=>!e.before.has(a));s.length>0&&this.store.shell.selectMultiple(s)}childWrittenAfter(e,t){const r=this.sourceLocation(t);if(!r)return null;let n=null;for(const i of e){if(i===t)continue;const s=this.sourceLocation(i);!s||s.file!==r.file||!(s.line>r.line||s.line===r.line&&s.col>r.col)||(!n||s.line<n.line||s.line===n.line&&s.col<n.col)&&(n={id:i,line:s.line,col:s.col})}return n?.id??null}async refreshSourceState(){const e=this.writeBackend;if(this.disposed||!e?.index||!e.readSource)return;const t=++this.sourceRefreshId;this.sourceRefreshPending=!0;try{const r=await e.index();if(this.disposed||t!==this.sourceRefreshId)return;const n=new Map(Object.entries(r)),i=new Set;for(const c of this.liveOids()){const l=n.get(c);l&&i.add(l.file)}const s=new Map;if(await Promise.all([...i].map(async c=>{const l=await e.readSource(c);s.set(c,l.source)})),this.disposed||t!==this.sourceRefreshId)return;const a=await zt().exists("src/lib/reflections/index.ts").catch(()=>!1);if(this.disposed||t!==this.sourceRefreshId)return;this.oidIndex=n,this.sources=s,this.reflectionProbeAvailable=a,this.store.shell.notifyIngestEdit()}catch{}finally{t===this.sourceRefreshId&&(this.sourceRefreshPending=!1)}}liveOids(){const e=new Set;for(const[,t]of this.byId){const r=_(t);r!==void 0&&e.add(r)}for(const t of[this.scene.background,this.scene.environment,this.scene.fog]){const r=M(lt(t));r!==void 0&&e.add(r)}return e}oidOf(e){return _(this.byId.get(e))??null}attrsOf(e){const t=this.oidOf(e);if(!t)return null;const r=this.oidIndex.get(t);if(!r)return null;const n=this.sources.get(r.file);if(n===void 0)return null;const i=H(n,r.line,r.col);if(n[i]!=="<")return null;const s=fe(n,i);return s<0?null:Te(n,i,s)}sourceLocation(e){const t=this.oidOf(e);return t?this.oidIndex.get(t):void 0}definitionLocation(e){const t=this.definitionOid(e);return t?this.oidIndex.get(t):void 0}storyComponent(e){const t=this.hierarchy.node(e);if(t?.role!=="component")return null;const r=this.definitionLocation(e),n=this.sourceLocation(e),i=r?.component??n?.tag??t.typeLabel??t.label;return r?.file?{name:i,sourcePath:r.file}:{name:i}}definitionOid(e){const t=this.byId.get(e);if(!t||!re(t))return null;const r=ne(t),n=M(t);return n===void 0||n===r?null:n}canForkComponent(e){return typeof this.writeBackend?.forkComponent!="function"?!1:!!this.oidOf(e)&&!!this.definitionOid(e)}async forkComponent(e){const t=this.sourceLocation(e),r=this.oidOf(e),n=this.definitionOid(e),i=t?.tag??"component";if(!r||!n||!t)return Gt(i);const s=this.writeBackend,a=this.store.shell.projectHistory;if(!s?.forkComponent||!s.readSource||!s.applySource||!a)return Xt(i);let c;try{c=await s.forkComponent(r,n,this.forkNameSeed(e))}catch(p){return Ae(ue(p))}const{newName:l,newResourcePath:u,callsiteFile:d,callsiteNewSource:h}=c;if(!c.ok||!l||!u||!d||!h)return Ae(c.error??"the fork was refused without a reason.");try{await B(s,a,{file:d,source:h,label:c.label??`Fork ${i} → ${l}`})}catch(p){return Zt(i,l,u,ue(p))}return await this.refreshSourceState(),Qt(c.tag??i,l,u)}forkNameSeed(e){const t=this.attrsOf(e)?.find(r=>r.name==="name");return t?.isLiteral&&t.rawValue?t.rawValue:this.byId.get(e)?.name||void 0}canExtractComponent(e){return!!(this.oidOf(e)&&this.writeBackend?.extractComponent)}async extractComponent(e,t){const r=this.sourceLocation(e),n=this.oidOf(e),i=r?.tag??"element";if(!n||!r)return Yt(i);const s=this.writeBackend,a=this.store.shell.projectHistory;if(!s?.extractComponent||!s.readSource||!s.applySource||!a)return er(i);let c;try{c=await s.extractComponent(n,t??this.forkNameSeed(e))}catch(f){return Ee(ue(f))}const{newName:l,componentResourcePath:u,storyResourcePath:d,callsiteFile:h,callsiteNewSource:p}=c;if(!c.ok||!l||!u||!d||!h||!p)return Ee(c.error??"the extraction was refused without a reason.");try{await B(s,a,{file:h,source:p,label:c.label??`Extract ${l}`})}catch(f){return tr(i,l,u,ue(f))}return await this.refreshSourceState(),rr(c.tag??i,l,u,d)}diagnosticsFor(e){const t=this.borrowsRepresentativeCallsite(e)?void 0:this.sourceLocation(e);return fr(t,this.definitionLocation(e))}internalChildren(e){if(this.options.hierarchyMode==="definition")return;const t=this.byId.get(e);if(t)return this.internalChildObjects(t).map(r=>({...this.objectNode(r),parentId:e}))}hasInternals(e){if(this.options.hierarchyMode==="definition")return!1;const t=this.byId.get(e);return t?this.internalChildObjects(t).length>0:!1}internalChildObjects(e){return e.children.filter(t=>this.idByObject.has(t)&&!this.isProjectedRow(t))}objectNode(e){const t=this.idByObject.get(e),r=this.projectedParentId(e),n=this.borrowsRepresentativeCallsite(t),i=this.isComponentBoundary(e)&&!n,s=n?void 0:this.oidEntryOf(e)?.tag;return{id:t,label:i?ye(e,"authoringLabel")||e.name||s||"Component":e.name||e.type||"Object3D",role:i?"component":"entity",kind:or(this.transformObject(t)??e),...i&&s&&/^[A-Z]/.test(s)?{typeLabel:s}:{},parentId:r,childIds:this.projector.childIdsOf(this.projectedChildren(e))}}isComponentBoundary(e){return re(e)&&ye(e,"authoringRoot")!==!0}spatialTargetOf(e){return e}transformObject(e){const t=this.byId.get(e);return t?this.isComponentBoundary(t)?this.spatialTargetOf(t):t:null}oidEntryOf(e){const t=this.idByObject.get(e);return t?this.sourceLocation(t):void 0}componentOwnerChain(e){const t=[];let r=e;for(;r&&r!==this.scene;){for(;r&&r!==this.scene&&!this.isComponentBoundary(r);)r=r.parent;if(!r||r===this.scene)break;const n=ne(r);let i=r;for(;i.parent&&i.parent!==this.scene&&ne(i.parent)===n;)i=i.parent;t.push(i),r=i.parent}return t.reverse()}selectionOwnerObject(e,t=this.componentOwnerChain(e)){return t.at(-1)??this.stampedOwnerObject(e)}stampedOwnerObject(e){let t=e;for(;t&&t!==this.scene&&this.oidOf(this.idByObject.get(t)??"")===null;)t=t.parent??void 0;return!t||t===this.scene?null:t}insideTransparentTopLevel(e){return this.componentOwnerChain(e).length===1}isProjectedRow(e){if(e===this.scene||me(e))return!1;const t=this.idByObject.get(e);if(t===void 0)return!1;if(Oe(e))return!0;const r=this.componentOwnerChain(e);return this.selectionOwnerObject(e,r)===e?!0:r.length===1&&this.oidOf(t)!==null}projectedChildren(e){const t=[],r=new Set,n=i=>{if(!me(i)){if(this.isProjectedRow(i)){r.has(i)||(r.add(i),t.push(i));return}for(const s of i.children)n(s)}};for(const i of e.children)n(i);return t}projectedParentId(e){let t=e.parent;for(;t&&t!==this.scene;){if(this.isProjectedRow(t))return this.idByObject.get(t);t=t.parent}return this.documentNodeId}selectionOwnerId(e){const t=this.byId.get(e);if(!t)return null;if(Oe(t))return e;const n=this.componentOwnerChain(t).slice(1).at(-1)??this.stampedOwnerObject(t);return n?this.idByObject.get(n)??null:null}hierarchy={roots:()=>[this.hierarchy.node(this.documentNodeId)],node:e=>{if(e===this.documentNodeId)return{id:e,label:this.options.worldId,secondaryLabel:this.options.entryPath,role:"document",kind:"three-source",parentId:null,childIds:this.options.hierarchyMode==="definition"?this.definitionView.rootIds():this.projector.childIdsOf(this.projectedChildren(this.scene))};const t=this.byId.get(e);return t?this.options.hierarchyMode==="definition"?this.definitionView.node(t):this.objectNode(t):null},object3D:e=>this.transformObject(e),idForObject3D:e=>this.idByObject.get(e)??null};truth={resolve:e=>{const t=this.oidOf(e);if(!t)return{site:{anchored:!1,reason:e===this.documentNodeId?"The World document is a composition, not a source element.":"This rendered object has no authored source identity."},writeAnchorKind:this.transformWriteAnchorKind(e)};const r=this.oidIndex.get(t);if(!r)return{site:{anchored:!1,reason:"Source metadata is still loading or unavailable."},writeAnchorKind:this.transformWriteAnchorKind(e)};const n=this.projectRelativeSourceFile(r.file);return{site:{anchored:!0,kind:"source",file:n,line:r.line,col:r.col,display:`${n}:${r.line}`},writeAnchorKind:this.transformWriteAnchorKind(e)}}};transformWriteAnchorKind(e){if(!this.byId.has(e))return;const t=this.oidOf(e);return!t||!this.writeBackend?.writeProp?"live-only":sr(this.oidIndex.get(t),"position")?"physics-binding":"source-prop"}pickable={pick:(e,t)=>this.projector.pick(this.store,e,t,r=>this.isPickLocked(r)),candidates:(e,t)=>this.projector.candidates(this.store,e,t,r=>this.isPickLocked(r))};isPickLocked(e){let t=e,r=0;for(;t&&r++<1e3;){if(this.lockedIds.has(t))return!0;t=this.hierarchy.node(t)?.parentId??null}return!1}selection={get:()=>this.selectionState.current(),set:(e,t)=>this.selectionState.publish(e.map(r=>this.options.hierarchyMode==="definition"||t?.intent==="exact"||r===this.documentNodeId?r:this.selectionOwnerId(r)??r).filter(r=>r===this.documentNodeId||this.byId.has(r))),resolve:(e,t)=>{const r=this.byId.get(e);if(!r)return null;if(this.options.hierarchyMode==="definition")return{id:e};if(Oe(r))return{id:e};const n=this.componentOwnerChain(r),i=t?.scopeId?n.findIndex(u=>this.idByObject.get(u)===t.scopeId):-1,s=i>=0?i+1:1,a=t?.intent==="deep"?s+1:s,c=n[a]??n[s]??this.stampedOwnerObject(r),l=c?this.idByObject.get(c)??null:null;return l?{id:l}:null}};related={links:e=>{const t=ye(this.byId.get(e),"authoringDocument");return!t||t.kind!=="project-tool"?[]:[{id:`definition:project-tool:${t.name}`,title:t.title,open:()=>{Jt(t.name)}}]}};instanceProp(e,t){if(!t.startsWith(O))return null;const r=t.slice(O.length),n=this.declaredPropsOf(e).find(s=>s.name===r),i=this.attrsOf(e)?.find(s=>s.name===r);return n&&i?{prop:r,spec:n,attr:i}:null}affectedInstances(e,t){const r=this.definitionLocation(e);if(!r)return 0;let n=0;for(const[i,s]of this.byId){if(!re(s))continue;const a=this.definitionLocation(i);a?.file!==r.file||a.component!==r.component||this.attrsOf(i)?.some(c=>c.name===t)||(n+=1)}return n+1}instances={openComponent:()=>{Vt(Ut)},describe:e=>{const t=this.storyComponent(e);if(!t||this.stories.storiesFor(e).length===0)return null;const r=this.inspector.properties(e).filter(n=>n.resettable&&n.path.startsWith(O)).map(n=>{const i=this.instanceProp(e,n.path),s=!!i?.attr.isLiteral&&i.spec.defaultValue!==void 0&&!!this.definitionOid(e)&&!!this.writeBackend?.runGesture&&!!this.writeBackend.writeComponentDefault&&!!this.writeBackend.removeProp;return{path:n.path,label:n.label,value:this.inspector.get(e,n.path),...n.revertsTo===void 0?{}:{defaultText:n.revertsTo},canApplyToComponent:s,affectedInstanceCount:i?this.affectedInstances(e,i.prop):0,...s?{}:{applyUnavailableReason:i?.spec.defaultValue===void 0?"The component default is computed or absent, so source cannot be changed safely.":"This session cannot atomically update the component and its callsite."}}});return{componentName:t.name,...t.sourcePath?{sourcePath:this.projectRelativeSourceFile(t.sourcePath)}:{},overrides:r}},revert:async(e,t)=>{const r=this.oidOf(e),n=this.writeBackend;if(!r||!n?.removeProp)return;const i=t.map(c=>this.instanceProp(e,c)?.prop).filter(c=>!!c);let s=!1;const a=async c=>{for(const l of i){const u=await c.removeProp?.(r,l);s||=u?.changed===!0}};return i.length>1&&n.runGesture?await n.runGesture(`Revert ${i.length} Overrides`,a):await a(n),await this.refreshSourceState(),s?{destination:this.destinationOf(e),persisted:!0}:void 0},applyToComponent:async(e,t)=>{const r=this.instanceProp(e,t),n=this.definitionOid(e),i=this.oidOf(e),s=this.writeBackend;if(!r||r.spec.defaultValue===void 0||!n||!i||!s?.runGesture||!s.writeComponentDefault||!s.removeProp)return{changed:!1,message:"Apply was refused because both literal source writes are not available."};const a=this.inspector.get(e,t);return await s.runGesture(`Apply ${r.prop} to ${this.storyComponent(e)?.name??"Component"}`,async c=>{const l=await c.writeComponentDefault?.(n,r.prop,this.serializeValue(a));if(!l?.changed)throw new Error(l?.error??"The component default did not change.");const u=await c.removeProp?.(i,r.prop);if(!u?.changed)throw new Error(u?.error??"The callsite override was not removed.")}),await this.refreshSourceState(),{changed:!0,message:`${r.prop} now defaults to ${String(a)} in ${this.storyComponent(e)?.name??"the component"}.`,write:{destination:this.destinationOf(e),persisted:!0}}}};transforms={dimensions:e=>this.transformObject(e)?"3d":null,get:e=>Wt(this.transformObject(e)),editability:(e,t)=>this.transformEditability(e,t),beginEdit:e=>{if(!this.transformEditability(e,"position").writable&&!this.transformEditability(e,"rotation").writable&&!this.transformEditability(e,"scale").writable)return;const t=this.transformObject(e);t&&(this.transformEdits.has(e)||this.transformEdits.set(e,{id:e,position:t.position.toArray(),quaternion:t.quaternion.toArray(),euler:[t.rotation.x,t.rotation.y,t.rotation.z],scale:t.scale.toArray()}))},apply:(e,t)=>{const r=this.transformObject(e);r&&(r.position.fromArray(t.position),r.quaternion.fromArray(t.rotation),r.scale.fromArray(t.scale))},endEdit:e=>{const t=this.transformEdits.get(e);if(!t||(this.transformEdits.delete(e),this.completedTransformEdits.push(t),this.transformEdits.size>0))return;const r=this.completedTransformEdits.splice(0);Ft();const n=this.transformCommitQueue.then(()=>ie(this.pipedTransformCommit(r)));return n.then(Ie,Ie),this.transformCommitQueue=n.then(()=>{},i=>{console.error("[R3fSourceAuthoringAdapter] transform commit failed",i)}),n},remove:(e,t)=>{const r=this.oidOf(e);if(r)return this.pipedJsxRemove(()=>this.removeTransformChannel(e,r,t),this.destinationOf(e))}};async removeTransformChannel(e,t,r){const n=this.transformEditability(e,r);return!n.writable||n.removable!==!0?(console.warn(`[R3fSourceAuthoringAdapter] cannot drop "${r}" on "${e}": ${n.reason??"this callsite authors no such attribute"}.`),!1):this.removeOidProp(e,t,`${O}${r}`,r)}destinationOf(e){const t=this.sourceLocation(e);return t?this.projectRelativeSourceFile(t.file):this.options.entryPath}pipedJsxWrite(e,t=this.writeBackend?.writeProp!==void 0,r=this.options.entryPath){return ie({resolve:()=>t?{reaches:"writer",anchorKind:"source-prop",destination:r,write:e}:oe(de),record:()=>{},report:n=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${n}.`)})}pipedSourceTokenWrite(e){return ie({resolve:()=>this.writeBackend&&this.store.shell.projectHistory?{reaches:"writer",anchorKind:"construction-literal",destination:this.options.entryPath,write:()=>e().catch(t=>(console.error("[R3fSourceAuthoringAdapter] source token write failed",t),!1))}:oe(de),record:()=>{},report:t=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${t}.`)})}pipedTransformCommit(e){return{resolve:()=>this.writeBackend?.writeProp?{reaches:"writer",anchorKind:"source-prop",destination:this.destinationOf(e[0]?.id??""),write:()=>this.commitTransformEdits(e).catch(t=>(console.error("[R3fSourceAuthoringAdapter] transform commit failed",t),!1))}:oe(de),record:()=>{},report:t=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${t}.`)}}transformEditability(e,t){if(this.borrowsRepresentativeCallsite(e)){const c=this.byId.get(e),l=c?this.oidEntryOf(c)?.tag:void 0;return{writable:!1,reason:`Rendered by ${l?`<${l}>`:"its component"} — this object has no writable source transform of its own.`}}const r=this.oidOf(e);if(!r){const c=ne(this.byId.get(e)),l=c!==void 0?this.oidIndex.get(c)?.tag:void 0;return{writable:!1,reason:l?`Rendered by <${l}> — this object has no writable source transform of its own.`:"This rendered part has no authored source identity."}}if(!this.writeBackend?.writeProp)return{writable:!1,reason:"This session has no source writer."};const n=ar(this.oidIndex.get(r),t);if(n)return{writable:!1,reason:n};const i=this.attrsOf(e);if(!i)return this.staleOidRefreshes.has(r)||(this.staleOidRefreshes.add(r),this.refreshSourceState()),this.sourceRefreshPending?{writable:!1,reason:"Source metadata for this element is being refreshed — try again in a moment."}:(un(e),{writable:!1,reason:"Source metadata is missing for this element — an element added by hot reload is not in the OID index until the page reloads. Reload the editor page to author it."});const s=i.find(c=>c.name===t),a=this.byId.get(e);if(a&&this.isComponentBoundary(a)){const c=this.oidEntryOf(a)?.r3fAuthoring,l=c?.transformProps.includes(t)??!1,u=c?.simulationOwnedTransform===!0;if(u)return{writable:!1,reason:`${this.oidEntryOf(a)?.tag??"This component"} drives its own ${t} every frame — this instance is placed by the simulation, not by the editor.`};if(!s){if(l)return{writable:!0};const h=u?`drives its own ${t} every frame — this instance is placed by the simulation, not by the editor`:c?.root==="multiple"?"renders multiple roots":c?.root==="non-spatial"?"has no spatial root":c?.root==="unknown"?"has no statically provable native root":c?.root==="single"?`does not forward ${t} to its ${c.rootTag??"native"} root`:`does not expose a ${t} prop`;return{writable:!1,reason:`${this.oidEntryOf(a)?.tag??"This component"} ${h}.`}}if(c&&!l)return{writable:!1,reason:`${this.oidEntryOf(a)?.tag??"This component"} does not forward ${t} to its ${c.rootTag??"native"} root.`};if(!(s.isExpression&&(rn(s.rawValue)||t==="scale"&&Z.test(s.rawValue))))return{writable:!1,reason:t==="scale"?"scale is not exposed as a number or three-number tuple by this component.":`${t} is not exposed as a three-number tuple by this component.`}}return s?.isExpression&&!s.isLiteral?{writable:!1,reason:`${t} is controlled by the JSX expression {${s.rawValue}}.`}:{writable:!0,...s&&this.writeBackend?.removeProp?{removable:!0}:{}}}async commitTransformEdits(e){if(e.length===0)return!1;const t=this.writeBackend;let r=!1;const n=async i=>{for(const s of e)await this.commitTransformEdit(s,i,!1)&&(r=!0)};return e.length>1&&t?.runGesture?await t.runGesture("Transform Selection",i=>n(i)):await n(t),r}async commitTransformEdit(e,t,r=!0){const n=this.transformObject(e.id);if(!n)return!1;const i=this.oidOf(e.id),s=i?this.attrsOf(e.id):null,a={position:!this.nearlyEqual(n.position.toArray(),e.position),rotation:!this.nearlyEqual([n.rotation.x,n.rotation.y,n.rotation.z],e.euler),scale:!this.nearlyEqual(n.scale.toArray(),e.scale)};if(!a.position&&!a.rotation&&!a.scale)return!1;const c=p=>{p==="position"?n.position.fromArray(e.position):p==="rotation"?n.quaternion.fromArray(e.quaternion):n.scale.fromArray(e.scale),this.store.shell.notifyIngestEdit()},l=t??this.writeBackend;if(!i||!l?.writeProp){console.warn(`[R3fSourceAuthoringAdapter] transform on "${e.id}" is not persistable (${i?"no source-write backend":"node has no source stamp"}) — reverting.`);for(const p of["position","rotation","scale"])a[p]&&c(p);return!1}const u=[];for(const p of["position","rotation","scale"]){if(!a[p])continue;const f=p==="position"?n.position.toArray():p==="rotation"?[n.rotation.x,n.rotation.y,n.rotation.z]:n.scale.toArray(),g=s?.find(v=>v.name===p);if(g&&g.isExpression&&!g.isLiteral){console.warn(`[R3fSourceAuthoringAdapter] "${p}" on "${e.id}" is expression-bound (guarded) — reverting the live object.`),this.dynamicPaths.add(`${e.id}|${p}`),c(p);continue}if(p==="scale"&&g&&Z.test(g.rawValue)){const[v,x,w]=f;Math.abs(v-x)<U&&Math.abs(x-w)<U?u.push({channel:p,value:F(v)}):u.push({channel:p,value:K(f),shapeUpgrade:!0});continue}u.push({channel:p,value:K(f)})}if(u.length===0)return!1;let d=!1;const h=async p=>{for(const f of u){const g=await p.writeProp(i,f.channel,f.value,{addIfMissing:!0,...f.shapeUpgrade?{allowShapeUpgrade:!0}:{}});g.changed&&(d=!0),g.changed||(g.dynamic&&this.dynamicPaths.add(`${e.id}|${f.channel}`),console.warn(`[R3fSourceAuthoringAdapter] ${f.channel} write refused for oid "${i}": ${g.dynamic?"dynamic expression (guarded)":g.error??"no change"} — reverting.`),c(f.channel))}};return r&&u.length>1&&l.runGesture?await l.runGesture("Transform",p=>h(p)):await h(l),this.store.shell.notifyIngestEdit(),d}nearlyEqual(e,t){return e.length===t.length&&e.every((r,n)=>Math.abs(r-(t[n]??0))<U)}materialOidOf(e){return M(R(e))??null}attrsOfOid(e){const t=this.oidIndex.get(e);if(!t)return null;const r=this.sources.get(t.file);if(r===void 0)return null;const n=H(r,t.line,t.col);if(r[n]!=="<")return null;const i=fe(r,n);return i<0?null:Te(r,n,i)}descriptorTypeFor(e,t,r,n){const i=(()=>{if(!e.isLiteral)return"string";const c=e.rawValue;if(c==="true"||c==="false")return"boolean";if(e.isExpression&&Z.test(c))return"number";if(e.isExpression&&xe(c))return"json";const l=e.isExpression?c.replace(/^['"]|['"]$/g,""):c;return Xr.test(l)?"color":"string"})(),s=this.oidIndex.get(t.oid);return n===void 0&&s?.propsResolved===!0&&/^[A-Z]/.test(s.tag??"")&&qt(s?.file??this.options.entryPath,r,i),i}literalValueOf(e){if(!e.isLiteral)return`{${e.rawValue}}`;const t=e.rawValue;if(!e.isExpression)return t;if(t==="true")return!0;if(t==="false")return!1;if(Z.test(t))return Number(t);if(xe(t))try{return JSON.parse(t.replace(/,\s*\]$/,"]"))}catch{return t}return t.replace(/^['"]|['"]$/g,"")}parseWrapperPropertyPath(e){if(!e.startsWith(he))return null;const t=e.slice(he.length),r=t.indexOf(".");if(r<1)return null;try{return{oid:decodeURIComponent(t.slice(0,r)),prop:t.slice(r+1)}}catch{return null}}declaredPropsOf(e){const t=this.oidOf(e);return(t?this.oidIndex.get(t)?.props:void 0)??[]}nodeSubject(e){const t=this.oidOf(e);return t?{oid:t,declared:this.declaredPropsOf(e),pathFor:r=>`${O}${r}`,keyFor:r=>`${e}|${O}${r}`}:null}wrapperSubject(e){const t=r=>`${he}${encodeURIComponent(e)}.${r}`;return{oid:e,declared:this.oidIndex.get(e)?.props??[],pathFor:t,keyFor:t}}collapsedWrappersOf(e){const t=this.oidOf(e);if(!t)return[];const r=this.liveOids(),n=[];let i=this.oidIndex.get(t)?.parentOid;for(let s=0;i&&s<16&&!r.has(i);s+=1){const a=this.oidIndex.get(i);if(!a)break;/^[A-Z]/.test(a.tag)&&n.push({oid:i,tag:a.tag}),i=a.parentOid}return n.reverse()}rigidBodyOidOf(e){const t=this.byId.get(e),r=[this.definitionOid(e),M(t),this.oidOf(e)].filter(n=>typeof n=="string");for(const n of r){let i=n;for(let s=0;i&&s<32;s+=1){const a=this.oidIndex.get(i);if(!a)break;if(a.tag==="RigidBody")return i;i=a.parentOid}}return null}explicitColliderOids(e){const t=r=>{let n=this.oidIndex.get(r)?.parentOid;for(let i=0;n&&i<32;i+=1){if(n===e)return!0;const s=this.oidIndex.get(n);if(!s||s.tag==="RigidBody")return!1;n=s.parentOid}return!1};return[...this.oidIndex.entries()].filter(([r,n])=>n.tag in ct&&t(r)).sort(([,r],[,n])=>r.file===n.file?r.line-n.line||r.col-n.col:r.file.localeCompare(n.file)).map(([r])=>r)}physicsRead(e){const t=this.options.physics?.();if(!t)return[];try{return[...e(t)??[]]}catch{return[]}}colliderBindingsOf(e){const t=this.rigidBodyOidOf(e);if(!t)return[];const r=this.explicitColliderOids(t),n=this.physicsRead(s=>s.colliders?.(e));if(r.length===0||r.length!==n.length)return[];const i=[];for(let s=0;s<r.length;s+=1){const a=r[s],c=this.oidIndex.get(a)?.tag,l=n[s];if(!c||ct[c]!==l.shape.type)return[];const u=this.attrsOfOid(a)?.find(d=>d.name==="args");i.push({sourceOid:a,sourceTag:c,snapshot:l,writable:!!this.writeBackend?.writeProp&&!!u?.isLiteral&&!this.dynamicPaths.has(`${N}${encodeURIComponent(a)}.args`)})}return i}parseColliderArgPath(e){if(!e.startsWith(N))return null;const t=/^collider\.([^.]*)\.arg\.(\d+)$/.exec(e);if(!t)return null;try{return{oid:decodeURIComponent(t[1]),index:Number(t[2])}}catch{return null}}colliderArgs(e){const t=this.valueEcho.get(`${N}${encodeURIComponent(e)}.args`);if(Array.isArray(t)&&t.every(i=>typeof i=="number"))return[...t];const r=this.attrsOfOid(e)?.find(i=>i.name==="args"),n=r?this.literalValueOf(r):null;return Array.isArray(n)&&n.every(i=>typeof i=="number")?[...n]:null}colliderDimensionRows(e){const t=e.sourceTag==="CuboidCollider"?["Half extent X","Half extent Y","Half extent Z"]:e.sourceTag==="CapsuleCollider"?["Half height","Radius"]:["Radius"],r=this.attrsOfOid(e.sourceOid)?.find(i=>i.name==="args"),n=e.writable?null:this.writeBackend?.writeProp?r?.isLiteral?"This size is computed while the game runs; edit it in source.":`\`<${e.sourceTag} args>\` is an expression in source, not a number list; edit it there.`:"Source writes are unavailable in this session.";return t.map((i,s)=>({path:`${N}${encodeURIComponent(e.sourceOid)}.arg.${s}`,label:i,type:"number",group:$(e.sourceTag),readonly:!e.writable,...n?{readonlyReason:n}:{}}))}jointBindingsOf(e){const t=this.rigidBodyOidOf(e),r=t?this.oidIndex.get(t):void 0;if(!t||!r?.jointBindings)return[];const n=this.physicsRead(s=>s.joints?.(e));if(r.jointBindings.length!==n.length)return[];const i=[];for(let s=0;s<r.jointBindings.length;s+=1){const a=r.jointBindings[s],c=n[s];if(nn[a.hook]!==c.type)return[];i.push({sourceOid:t,sourceFile:r.file,source:a,snapshot:c,writable:!!a.params&&!!a.paramRanges&&!!this.writeBackend?.readSource&&!!this.writeBackend.applySource&&!!this.store.shell.projectHistory})}return i}jointKey(e){return`${e.source.line}:${e.source.col}`}jointPath(e,t){return`${st}${this.jointKey(e)}.${t}`}jointBindingForPath(e,t){const r=/^joint\.(\d+:\d+)\./.exec(t);return r?this.jointBindingsOf(e).find(n=>this.jointKey(n)===r[1])??null:null}jointParamPath(e){const t=/^joint\.\d+:\d+\.param\.(\d+)(?:\.(\d+))?$/.exec(e);return t?{param:Number(t[1]),...t[2]===void 0?{}:{part:Number(t[2])}}:null}jointTupleRows(e,t,r,n=["X","Y","Z"]){const i=$(e.source.hook.replace(/^use/,""));return n.map((s,a)=>({path:this.jointPath(e,`param.${r}.${a}`),label:`${t} ${s}`,type:"number",readonly:!e.writable,group:i}))}jointScalarRow(e,t,r){return{path:this.jointPath(e,`param.${r}`),label:t,type:"number",readonly:!e.writable,group:$(e.source.hook.replace(/^use/,""))}}jointDetailRows(e){switch(e.source.hook){case"useFixedJoint":return e.source.params?[...this.jointTupleRows(e,"Local Frame A",1,["X","Y","Z","W"]),...this.jointTupleRows(e,"Local Frame B",3,["X","Y","Z","W"])]:[];case"useRevoluteJoint":case"usePrismaticJoint":return[...this.jointTupleRows(e,"Axis",2),...e.source.params?.[3]||e.snapshot.limits?[...this.jointTupleRows(e,"Limit",3,["Min","Max"])]:[]];case"useRopeJoint":return e.source.params?[this.jointScalarRow(e,"Length",2)]:[];case"useSpringJoint":return e.source.params?[this.jointScalarRow(e,"Rest Length",2),this.jointScalarRow(e,"Stiffness",3),this.jointScalarRow(e,"Damping",4)]:[];default:return[]}}jointRows(e){const t=$(e.source.hook.replace(/^use/,""));return[{path:this.jointPath(e,"body1"),label:"Body A",type:"string",readonly:!0,group:t},{path:this.jointPath(e,"body2"),label:"Body B",type:"string",readonly:!0,group:t},...this.jointTupleRows(e,"Anchor A",0),...this.jointTupleRows(e,"Anchor B",e.source.hook==="useFixedJoint"?2:1),...this.jointDetailRows(e),{path:this.jointPath(e,"contacts"),label:"Contacts Enabled",type:"boolean",readonly:!0,group:t}]}jointValue(e,t){const r=this.jointBindingForPath(e,t);if(!r)return;if(t.endsWith(".body1"))return r.source.body1Ref;if(t.endsWith(".body2"))return r.source.body2Ref;if(t.endsWith(".contacts"))return r.snapshot.contactsEnabled;const n=this.jointParamPath(t);if(n)return ln(cn(r,n.param),n.part)}particleBindingsOf(e){const t=this.byId.get(e);if(!t)return[];const r=[];t.traverse(i=>{const s=M(i)??_(i);!s||!this.oidIndex.get(s)?.particleBinding||r.push({emitter:i,sourceOid:s})});const n=[];for(const{emitter:i,sourceOid:s}of r){const a=this.oidIndex.get(s),c=a?.particleBinding,l=wr(i);!a||!c||!l||c.shape!==l.type||n.push({sourceOid:s,sourceFile:a.file,source:c,emitter:i,shape:l,writableFields:new Set(Object.keys(c.fields).filter(()=>!!this.writeBackend?.readSource&&!!this.writeBackend.applySource&&!!this.store.shell.projectHistory))})}return n}particleKey(e){return encodeURIComponent(e.sourceOid)}particlePath(e,t){return`${at}${this.particleKey(e)}.${t}`}particleBindingForPath(e,t){const r=/^particle\.([^.]+)\./.exec(t);return r?this.particleBindingsOf(e).find(n=>this.particleKey(n)===r[1])??null:null}particleFieldPath(e){return/^particle\.[^.]+\.([A-Za-z][A-Za-z0-9]*)$/.exec(e)?.[1]??null}particleRows(e){const t=$(e.source.constructor),r={radius:"Radius",arc:"Arc",thickness:"Thickness",angle:"Angle",donutRadius:"Donut Radius",width:"Width",height:"Height",column:"Columns",row:"Rows"},n={point:[],sphere:["radius","arc","thickness"],hemisphere:["radius","arc","thickness"],cone:["radius","arc","thickness","angle"],circle:["radius","arc","thickness"],donut:["radius","arc","thickness","donutRadius"],rectangle:["width","height","thickness"],grid:["width","height","column","row"]};return[{path:this.particlePath(e,"type"),label:"Shape",type:"string",readonly:!0,group:t},...(n[e.shape.type]??[]).map(i=>({path:this.particlePath(e,i),label:r[i]??$(i),type:"number",readonly:!e.writableFields.has(i),group:t}))]}particleValue(e,t){const r=this.particleBindingForPath(e,t),n=this.particleFieldPath(t);if(!(!r||!n))return n==="type"?r.shape.type:r.shape[n]}async writeParticleField(e,t,r){const n=this.writeBackend,i=this.store.shell.projectHistory,s=e.source.fields[t],a=this.sources.get(e.sourceFile);if(!n||!i||!s||!e.writableFields.has(t)||a===void 0||s.start<0||s.end>a.length||Number(a.slice(s.start,s.end))!==s.value)return!1;const c=Sr(t,r),l=e.shape[t];vt({binding:e,field:t,value:c}),this.store.shell.notifyIngestEdit();const u=`${a.slice(0,s.start)}${F(c)}${a.slice(s.end)}`;try{return await B(n,i,{file:e.sourceFile,source:u,label:`Edit ${$(e.source.constructor)} ${$(t)}`}),this.sources.set(e.sourceFile,u),await this.refreshSourceState(),!0}catch(d){throw e.shape[t]=l,this.store.shell.notifyIngestEdit(),d}}lodBindingsOf(e){const t=this.byId.get(e);if(!t)return[];const r=[];t.traverse(i=>{i.isLOD&&r.push(i)});const n=!!this.writeBackend?.readSource&&!!this.writeBackend.applySource&&!!this.store.shell.projectHistory;return r.map((i,s)=>{const a=M(i)??_(i),c=a?this.oidIndex.get(a):void 0,l=c?.lodBinding,u=!!l?.distances&&l.distances.length===i.levels.length&&l.distances.every((h,p)=>Math.abs(h.value-i.levels[p].distance)<U),d=!!l?.hysteresis&&i.levels.every(h=>Math.abs(h.hysteresis-l.hysteresis.value)<U);return{key:a??`${e}:${s}`,...a?{sourceOid:a}:{},...c?{sourceFile:c.file}:{},...l?{source:l}:{},lod:i,writableDistances:new Set(n&&u?i.levels.map((h,p)=>p):[]),writableHysteresis:n&&d}})}lodPath(e,t){return`${Se}${encodeURIComponent(e.key)}.${t}`}lodBindingForPath(e,t){const r=/^lod\.([^.]+)\./.exec(t);if(!r)return null;const n=decodeURIComponent(r[1]);return this.lodBindingsOf(e).find(i=>i.key===n)??null}lodPreviewOption(e,t){const r=e.lod.levels[t]?.object,n=r?r.name||r.type:"";return`Level ${t}${n?` — ${n}`:""}`}lodRows(e){const t="Level of Detail",r=[{path:this.lodPath(e,"preview"),label:"Preview Level",type:"enum",options:["Auto",...e.lod.levels.map((n,i)=>this.lodPreviewOption(e,i))],group:t},{path:this.lodPath(e,"active"),label:"Active Level",type:"string",readonly:!0,group:t}];return e.lod.levels.forEach((n,i)=>{r.push({path:this.lodPath(e,`level.${i}.object`),label:`Level ${i} Object`,type:"string",readonly:!0,group:t},{path:this.lodPath(e,`level.${i}.distance`),label:`Level ${i} Distance`,type:"number",readonly:!e.writableDistances.has(i),group:t})}),e.lod.levels.length>0&&r.push({path:this.lodPath(e,"hysteresis"),label:"Hysteresis",type:"number",readonly:!e.writableHysteresis,group:t}),r}lodValue(e,t){const r=this.lodBindingForPath(e,t);if(!r)return;if(t.endsWith(".preview")){const s=this.store.getLodForcedLevel(e);return s===null?"Auto":this.lodPreviewOption(r,s)}if(t.endsWith(".active")){const s=this.store.getLodForcedLevel(e);return this.lodPreviewOption(r,s??r.lod.getCurrentLevel())}if(t.endsWith(".hysteresis"))return r.lod.levels[0]?.hysteresis;const n=/\.level\.(\d+)\.(object|distance)$/.exec(t);if(!n)return;const i=r.lod.levels[Number(n[1])];if(i)return n[2]==="distance"?i.distance:i.object.name||i.object.type||`Level ${n[1]}`}async writeLodToken(e,t,r,n,i,s){const a=this.writeBackend,c=this.store.shell.projectHistory,l=e.sourceFile,u=l?this.sources.get(l):void 0;if(!a||!c||!l||u===void 0||t.start<0||t.end>u.length||Number(u.slice(t.start,t.end))!==t.value)return!1;i(),this.store.shell.notifyIngestEdit();const d=`${u.slice(0,t.start)}${F(r)}${u.slice(t.end)}`;try{return await B(a,c,{file:l,source:d,label:n}),this.sources.set(l,d),await this.refreshSourceState(),!0}catch(h){throw s(),this.store.shell.notifyIngestEdit(),h}}writeLodDistance(e,t,r){const n=e.source?.distances?.[t];if(!n||!e.writableDistances.has(t))return Promise.resolve(!1);const i=mt(e,t,r),s=e.lod.levels[t]?.distance;return this.writeLodToken(e,n,i,`Edit LOD ${t} distance`,()=>yt({binding:e,level:t,value:i}),()=>{const a=e.lod.levels[t];a&&s!==void 0&&(a.distance=s)})}writeLodHysteresis(e,t){const r=e.source?.hysteresis;if(!r||!e.writableHysteresis)return Promise.resolve(!1);const n=Math.round(Math.max(0,Math.min(1,t))*1e3)/1e3,i=e.lod.levels.map(s=>s.hysteresis);return this.writeLodToken(e,r,n,"Edit LOD hysteresis",()=>{for(const s of e.lod.levels)s.hysteresis=n},()=>{e.lod.levels.forEach((s,a)=>{s.hysteresis=i[a]??s.hysteresis})})}async writeJointParams(e,t){const r=this.writeBackend,n=this.store.shell.projectHistory,i=this.sources.get(e.sourceFile),s=e.source.params,a=e.source.paramRanges;if(!r||!n||i===void 0||!s||!a)return!1;const c=[];if(!Tt(i,s,t,a,c)||c.length===0)return!1;c.sort((u,d)=>d.start-u.start);let l=i;for(const u of c){if(u.start<0||u.end>l.length)return!1;l=`${l.slice(0,u.start)}${u.text}${l.slice(u.end)}`}return await B(r,n,{file:e.sourceFile,source:l,label:`Edit ${$(e.source.hook.replace(/^use/,""))}`}),this.sources.set(e.sourceFile,l),await this.refreshSourceState(),!0}isOverride(e,t,r){return!e?.isLiteral||this.dynamicPaths.has(r)||!t?.optional?!1:!!this.writeBackend?.removeProp}measuredTypeFor(e,t){if(!e)return null;const r=e[t];return typeof r=="number"?"number":typeof r=="boolean"?"boolean":typeof r=="object"&&r!==null&&r.isColor?"color":null}componentProperties(e,t,r,n=en,i=null){const s=new Map(r.map(d=>[d.name,d])),a=e.declared,c=[],l=(d,h)=>{if(Qr(d)||Yr.has(d)||n.has(d))return;const p=s.get(d),f=!p&&h?.defaultText!==void 0&&h.defaultValue===void 0,g=h?.type??null,v=e.pathFor(d),x=this.isOverride(p,h,e.keyFor(d));c.push({path:v,label:$(d),type:f?"string":g??this.measuredTypeFor(i,d)??(p?this.descriptorTypeFor(p,e,d,h):"string"),...h?.options?{options:[...h.options]}:{},readonly:f||(p?!p.isLiteral:!1)||this.dynamicPaths.has(e.keyFor(d)),...p?{}:{defaulted:!0},...x?{resettable:!0}:{},...x&&h?.defaultText!==void 0?{revertsTo:h.defaultText}:{},group:t})};for(const d of a)l(d.name,d);const u=new Set(a.map(d=>d.name));for(const d of r)u.has(d.name)||l(d.name,void 0);return c}nativeEnvironmentSource(e,t){const r=M(lt(e)),n=r?this.oidIndex.get(r):void 0;return r&&n?.environmentBinding?.kind===t?{oid:r,file:n.file,binding:n.environmentBinding}:null}canWriteEnvironmentToken(e,t){if(!e||!t||!this.writeBackend?.readSource||!this.writeBackend.applySource||!this.store.shell.projectHistory)return!1;const r=this.sources.get(e.file);if(r===void 0||t.start<0||t.end>r.length)return!1;const n=r.slice(t.start,t.end);return"quote"in t?n===`${t.quote}${t.value}${t.quote}`:Number(n)===t.value}backgroundSource(){return q(this.scene.background)?this.nativeEnvironmentSource(this.scene.background,"background-color"):null}fogSource(){return L(this.scene.fog)?this.nativeEnvironmentSource(this.scene.fog,"fog"):G(this.scene.fog)?this.nativeEnvironmentSource(this.scene.fog,"fog-exp2"):null}textureLabel(e){return e?e.isCubeTexture?e.name||"Cube Texture":e.name||"Texture":"None"}worldProperties(){const e=[{path:"name",label:"World",type:"string",readonly:!0,group:"World"},{path:"source.path",label:"Entry",type:"string",readonly:!0,group:"World"}],t=this.scene.background,r=this.backgroundSource();if(e.push({path:`${I}type`,label:"Background",type:"string",readonly:!0,group:"Environment"}),q(t)){const s=r?.binding.kind==="background-color"?r.binding.color:void 0;e.push({path:`${I}color`,label:"Background Color",type:"color",readonly:!this.canWriteEnvironmentToken(r,s),group:"Environment"})}else on(t)&&e.push({path:`${I}intensity`,label:"Background Intensity",type:"number",readonly:!0,group:"Environment"},{path:`${I}blurriness`,label:"Background Blur",type:"number",readonly:!0,group:"Environment"},{path:`${I}rotation`,label:"Background Rotation Y",type:"number",readonly:!0,group:"Environment"});e.push({path:`${W}map`,label:"Lighting Environment",type:"string",readonly:!0,group:"Environment"}),this.scene.environment&&e.push({path:`${W}intensity`,label:"Environment Intensity",type:"number",readonly:!0,group:"Environment"},{path:`${W}rotation`,label:"Environment Rotation Y",type:"number",readonly:!0,group:"Environment"});const n=this.scene.fog,i=this.fogSource();if(e.push({path:`${S}mode`,label:"Mode",type:"string",readonly:!0,group:"Fog"}),n){const s=i?.binding.color;e.push({path:`${S}color`,label:"Color",type:"color",readonly:!this.canWriteEnvironmentToken(i,s),group:"Fog"})}if(L(n)){const s=i?.binding.kind==="fog"?i.binding:void 0;e.push({path:`${S}near`,label:"Near",type:"number",readonly:!this.canWriteEnvironmentToken(i,s?.near),group:"Fog"},{path:`${S}far`,label:"Far",type:"number",readonly:!this.canWriteEnvironmentToken(i,s?.far),group:"Fog"})}else if(G(n)){const s=i?.binding.kind==="fog-exp2"?i.binding:void 0;e.push({path:`${S}density`,label:"Density",type:"number",readonly:!this.canWriteEnvironmentToken(i,s?.density),group:"Fog"})}return e}worldValue(e){const t=this.scene.background,r=this.scene.fog;if(e==="name")return this.options.worldId;if(e==="source.path")return this.options.entryPath;if(e===`${I}type`)return t?q(t)?"Color":this.textureLabel(t):"None";if(e===`${I}color`&&q(t))return`#${t.getHexString()}`;if(e===`${I}intensity`)return this.scene.backgroundIntensity;if(e===`${I}blurriness`)return this.scene.backgroundBlurriness;if(e===`${I}rotation`)return this.scene.backgroundRotation.y*180/Math.PI;if(e===`${W}map`)return this.textureLabel(this.scene.environment);if(e===`${W}intensity`)return this.scene.environmentIntensity;if(e===`${W}rotation`)return this.scene.environmentRotation.y*180/Math.PI;if(e===`${S}mode`)return L(r)?"Linear":G(r)?"Exponential":"None";if(e===`${S}color`&&r)return`#${r.color.getHexString()}`;if(e===`${S}near`&&L(r))return r.near;if(e===`${S}far`&&L(r))return r.far;if(e===`${S}density`&&G(r))return r.density}setWorldValue(e,t){const r=this.scene.background,n=this.scene.fog;if(e===`${I}color`&&q(r)){const s=this.backgroundSource(),a=s?.binding.kind==="background-color"?s.binding.color:void 0;if(typeof t!="string"||!s||!a)return!1;const c=`#${r.getHexString()}`;return this.writeEnvironmentToken(s,a,t,"Edit background color",()=>r.set(t),()=>r.set(c))}const i=this.fogSource();if(!n||!i)return!1;if(e===`${S}color`&&typeof t=="string"){const s=i.binding.color;if(!s)return!1;const a=`#${n.color.getHexString()}`;return this.writeEnvironmentToken(i,s,t,"Edit fog color",()=>n.color.set(t),()=>n.color.set(a))}if(typeof t!="number")return!1;if(e===`${S}near`&&L(n)){const s=i.binding.kind==="fog"?i.binding.near:void 0;if(!s)return!1;const a=n.near,c=Math.max(0,Math.min(t,n.far-.01));return this.writeEnvironmentToken(i,s,c,"Edit fog near",()=>{n.near=c},()=>{n.near=a})}else if(e===`${S}far`&&L(n)){const s=i.binding.kind==="fog"?i.binding.far:void 0;if(!s)return!1;const a=n.far,c=Math.max(n.near+.01,t);return this.writeEnvironmentToken(i,s,c,"Edit fog far",()=>{n.far=c},()=>{n.far=a})}else if(e===`${S}density`&&G(n)){const s=i.binding.kind==="fog-exp2"?i.binding.density:void 0;if(!s)return!1;const a=n.density,c=Math.max(0,t);return this.writeEnvironmentToken(i,s,c,"Edit fog density",()=>{n.density=c},()=>{n.density=a})}return!1}async writeEnvironmentToken(e,t,r,n,i,s){const a=this.writeBackend,c=this.store.shell.projectHistory,l=this.sources.get(e.file);if(!a||!c||l===void 0||!this.canWriteEnvironmentToken(e,t))return!1;let u;if("quote"in t){if(typeof r!="string"||sn(r)===null)return!1;const h=r.replaceAll("\\","\\\\").replaceAll(t.quote,`\\${t.quote}`);u=`${t.quote}${h}${t.quote}`}else{if(typeof r!="number"||!Number.isFinite(r))return!1;u=F(r)}i(),this.store.shell.notifyIngestEdit();const d=`${l.slice(0,t.start)}${u}${l.slice(t.end)}`;try{return await B(a,c,{file:e.file,source:d,label:n}),this.sources.set(e.file,d),await this.refreshSourceState(),!0}catch(h){throw s(),this.store.shell.notifyIngestEdit(),h}}visibilityEditability(e){if(this.borrowsRepresentativeCallsite(e))return{writable:!1,reason:"This rendered part has no visibility prop of its own."};if(!this.oidOf(e))return{writable:!1,reason:"This rendered part has no authored source identity."};if(!this.writeBackend?.writeProp)return{writable:!1,reason:"This session has no source writer."};const r=this.attrsOf(e);if(!r)return{writable:!1,reason:"Source metadata is still loading or unavailable."};const n=r.find(a=>a.name==="visible"),i=this.byId.get(e);if(i&&this.isComponentBoundary(i)){const a=this.oidEntryOf(i),c=a?.r3fAuthoring;if(c?.visibleProp!==!0)return{writable:!1,reason:`${a?.tag??"This component"} does not prove that visible reaches its ${c?.rootTag??"native"} root.`}}return n?n.isLiteral?n.valueStart<0||n.isExpression&&(n.rawValue==="true"||n.rawValue==="false")?{writable:!0}:{writable:!1,reason:"visible is not exposed as a boolean JSX literal."}:{writable:!1,reason:`visible is controlled by the JSX expression {${n.rawValue}}.`}:{writable:!0}}async writeVisibility(e,t,r){const n=this.visibilityEditability(e),i=this.oidOf(e),s=this.writeBackend;if(!n.writable||!i||!s?.writeProp){const l=n.reason??"No native visibility write is available.";return console.warn(`[R3fSourceAuthoringAdapter] visibility write refused: ${l}`),j(l),!1}const a=t.visible,c=this.echoKey(e,"visible");t.visible=r,this.valueEcho.set(c,r),this.store.shell.notifyIngestEdit();try{const l=await s.writeProp(i,"visible",this.serializeValue(r),{addIfMissing:!0});return l.changed?!0:(l.dynamic&&this.dynamicPaths.add(c),t.visible=a,this.valueEcho.delete(c),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] visibility write refused for oid "${i}": ${l.dynamic?"dynamic expression (guarded)":l.error??"no change"} — reverting.`),!1)}catch(l){return t.visible=a,this.valueEcho.delete(c),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] visibility write failed for oid "${i}": ${String(l)} — reverting.`),!1}}inspector={preview:(e,t,r)=>{const n=this.transformObject(e);if(!n)return;const i=Q(n,R(n),t,this.sourceLocation(e)?.tag);!i||i.type==="asset"||(T(n,R(n),i,r),this.store.shell.notifyIngestEdit())},properties:e=>{if(e===this.documentNodeId)return this.worldProperties();const t=this.byId.get(e),r=this.transformObject(e);if(!t||!r)return[];const n=this.attrsOf(e)?.find(f=>f.name==="visible"),i=this.visibilityEditability(e),s=this.attrsOf(e)?.find(f=>f.name==="name"),a=[{path:"name",label:"Name",type:"string",readonly:!this.writeBackend?.writeProp||s?.isLiteral===!1},{path:"visible",label:"Visible",type:"boolean",readonly:!i.writable,...!i.writable&&i.reason?{readonlyReason:i.reason}:{},...n?{}:{defaulted:!0}},{path:"locked",label:"Locked",type:"boolean"}],c=Ce(r);c?.fields&&a.push(...c.fields().filter(f=>!["name","visible","locked"].includes(f.path)).map(({value:f,...g})=>g));const l=xt(r),u=[...$t(r,R(r),this.sourceLocation(e)?.tag),...l?[l]:[]],d=new Set(u.filter(f=>f.target==="self").map(f=>f.prop)),h=this.lodBindingsOf(e);h.length>0&&(d.add("distances"),d.add("hysteresis"));for(const f of h)a.push(...this.lodRows(f));const p=this.attrsOf(e);if(p){for(const w of this.collapsedWrappersOf(e))a.push(...this.componentProperties(this.wrapperSubject(w.oid),$(w.tag),this.attrsOfOid(w.oid)??[]));for(const w of this.colliderBindingsOf(e))a.push(...this.colliderDimensionRows(w)),a.push(...this.componentProperties(this.wrapperSubject(w.sourceOid),$(w.sourceTag),this.attrsOfOid(w.sourceOid)??[],new Set(["args"])));for(const w of this.jointBindingsOf(e))a.push(...this.jointRows(w));for(const w of this.particleBindingsOf(e))a.push(...this.particleRows(w));const f=this.oidEntryOf(t),g=f?.tag?$(f.tag):"Properties";this.sourceLocation(e)&&a.push({path:"source.location",label:"Source",type:"string",readonly:!0,group:g});const x=this.nodeSubject(e);x&&a.push(...this.componentProperties(x,g,p,d,r))}for(const f of u)a.push(this.typedThreeRow(e,r,f));return a},editability:(e,t)=>t==="visible"?this.visibilityEditability(e):t==="locked"?{writable:this.byId.has(e)}:{writable:!0},get:(e,t)=>{if(e===this.documentNodeId)return this.worldValue(t);const r=this.byId.get(e),n=this.transformObject(e);if(!r||!n)return;const i=this.valueEcho.get(this.echoKey(e,t));if(i!==void 0)return i;if(t==="name")return this.oidEntryOf(r)?.tag||n.name||n.type;if(t==="visible")return n.visible;if(t==="locked")return this.lockedIds.has(e);if(t==="object.type")return n.type;const s=Ce(n)?.fields?.().find(u=>u.path===t);if(s)return s.value();if(t==="source.location"){const u=this.sourceLocation(e);return u?`${u.file.split("/").slice(-2).join("/")}:${u.line}`:""}const a=Q(n,R(n),t,this.sourceLocation(e)?.tag);if(a)return this.readTypedThree(n,a);const c=this.parseColliderArgPath(t);if(c)return this.colliderArgs(c.oid)?.[c.index];if(t.startsWith(st))return this.jointValue(e,t);if(t.startsWith(at))return this.particleValue(e,t);if(t.startsWith(Se))return this.lodValue(e,t);const l=this.parseWrapperPropertyPath(t);if(l)return this.propValue(this.attrsOfOid(l.oid),this.oidIndex.get(l.oid)?.props??[],l.prop);if(t.startsWith(O)){const u=t.slice(O.length);return this.propValue(this.attrsOf(e),this.declaredPropsOf(e),u)}},set:(e,t,r)=>{if(e===this.documentNodeId)return this.pipedSourceTokenWrite(async()=>this.setWorldValue(t,r));const n=this.byId.get(e),i=this.transformObject(e);if(!n||!i)return;if(t==="visible")return this.pipedJsxWrite(()=>this.writeVisibility(e,i,!!r),void 0,this.destinationOf(e));if(t==="name"){const d=String(r??"").trim();return!d||d===i.name?void 0:this.pipedJsxWrite(()=>this.writeJsxProp(e,"name","name",d),void 0,this.destinationOf(e))}if(t==="locked"){r?this.lockedIds.add(e):this.lockedIds.delete(e),this.store.shell.notifyIngestEdit();return}const s=Q(i,R(i),t,this.sourceLocation(e)?.tag);if(s)return s.type==="asset"?this.setTypedAsset(e,i,s,r):this.pipedJsxWrite(()=>this.writeTypedThree(e,i,s,r),void 0,this.destinationOf(e));const a=this.parseColliderArgPath(t);if(a&&typeof r=="number"){const d=this.colliderArgs(a.oid);return!d||a.index>=d.length?void 0:(d[a.index]=Math.max(.01,r),this.pipedJsxWrite(()=>this.writeOidProp(e,a.oid,`${N}${encodeURIComponent(a.oid)}.args`,"args",d),void 0,this.destinationOf(e)))}const c=this.jointParamPath(t);if(c&&typeof r=="number"){const d=this.jointBindingForPath(e,t);if(!d?.writable||!d.source.params)return;const h=d.source.params.map(f=>Array.isArray(f)?[...f]:f),p=h[c.param];if(c.part===void 0){if(typeof p!="number")return;h[c.param]=r}else{if(!Array.isArray(p)||typeof p[c.part]!="number")return;p[c.part]=r}return this.pipedSourceTokenWrite(()=>this.writeJointParams(d,h))}const l=this.particleFieldPath(t);if(l&&typeof r=="number"){const d=this.particleBindingForPath(e,t);return!d||!d.writableFields.has(l)?void 0:this.pipedSourceTokenWrite(()=>this.writeParticleField(d,l,r))}if(t.startsWith(Se)){const d=this.lodBindingForPath(e,t);if(!d)return;if(t.endsWith(".preview")){const p=typeof r=="string"?/^Level (\d+)/.exec(r):null,f=r==="Auto"?null:p?Number(p[1]):Number.NaN;(f===null||Number.isInteger(f)&&f>=0&&f<d.lod.levels.length)&&this.store.setLodForcedLevel(e,f);return}const h=/\.level\.(\d+)\.distance$/.exec(t);if(h&&typeof r=="number")return this.pipedSourceTokenWrite(()=>this.writeLodDistance(d,Number(h[1]),r));if(t.endsWith(".hysteresis")&&typeof r=="number")return this.pipedSourceTokenWrite(()=>this.writeLodHysteresis(d,r))}const u=this.parseWrapperPropertyPath(t);if(u)return this.pipedJsxWrite(()=>this.writeOidProp(e,u.oid,t,u.prop,r),void 0,this.destinationOf(e));if(t.startsWith(O))return this.pipedJsxWrite(()=>this.writeJsxProp(e,t,t.slice(O.length),r),void 0,this.destinationOf(e))},remove:(e,t)=>{const r=this.parseWrapperPropertyPath(t);if(r)return this.pipedJsxRemove(()=>this.removeOidProp(e,r.oid,t,r.prop),this.destinationOf(e));if(!t.startsWith(O))return;const n=this.oidOf(e);if(n)return this.pipedJsxRemove(()=>this.removeOidProp(e,n,t,t.slice(O.length)),this.destinationOf(e))}};spatialHandles=Gr({object:e=>this.transformObject(e),sourceTag:e=>this.sourceLocation(e)?.tag,writable:(e,t)=>{const r=this.inspector.properties(e).find(n=>n.path===t);return!!r&&r.readonly!==!0},commit:(e,t,r)=>this.inspector.set(e,t,r),colliderBindings:e=>this.colliderBindingsOf(e),previewCollider:(e,t)=>this.options.physics?.()?.previewCollider?.(e,t),commitCollider:(e,t,r)=>this.pipedJsxWrite(()=>this.writeOidProp(e,t,`${N}${encodeURIComponent(t)}.args`,"args",r),void 0,this.destinationOf(e)),jointBindings:e=>this.jointBindingsOf(e),previewJointAnchor:(e,t,r)=>this.options.physics?.()?.previewJointAnchor?.(e,t,r),commitJoint:(e,t)=>this.pipedSourceTokenWrite(()=>this.writeJointParams(e,t)),particleBindings:e=>this.particleBindingsOf(e),commitParticle:(e,t,r)=>this.pipedSourceTokenWrite(()=>this.writeParticleField(e,t,r)),lodBindings:e=>this.lodBindingsOf(e),commitLodDistance:(e,t,r)=>this.pipedSourceTokenWrite(()=>this.writeLodDistance(e,t,r))});serializeValue(e){return Array.isArray(e)?K(e.map(t=>Number(t))):typeof e=="number"?F(e):typeof e=="boolean"?e?"true":"false":String(e)}propValue(e,t,r){const n=e?.find(s=>s.name===r);if(n)return this.literalValueOf(n);const i=t.find(s=>s.name===r);return i?i.defaultValue??i.defaultText:void 0}echoKey(e,t){return t.startsWith(he)?t:`${e}|${t}`}projectRelativeSourceFile(e){const t=e.replaceAll("\\","/"),r=this.options.entryPath.replaceAll("\\","/").replace(/^\.\//,"");if(!t.startsWith("/")&&!/^[A-Za-z]:\//.test(t))return t;for(const n of this.oidIndex.values()){const i=n.file.replaceAll("\\","/");if(i!==r&&!i.endsWith(`/${r}`))continue;const s=i.slice(0,-r.length);if(t.startsWith(s))return t.slice(s.length)}return r}pipedJsxRemove(e,t=this.options.entryPath){return this.pipedJsxWrite(e,this.writeBackend?.removeProp!==void 0,t)}async removeOidProp(e,t,r,n){if(!this.writeBackend?.removeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot revert "${n}": no source-write backend.`),!1;this.valueEcho.delete(this.echoKey(e,r));const i=await this.writeBackend.removeProp(t,n);return i.changed?(await this.refreshSourceState(),!0):(this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] revert refused/no-op for oid "${t}" prop "${n}": ${i.dynamic?"dynamic expression (guarded)":i.error??"no change"}`),!1)}async writeOidProp(e,t,r,n,i){if(!this.writeBackend?.writeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot write "${n}": no source-write backend.`),!1;const s=this.echoKey(e,r);this.valueEcho.set(s,i),this.store.shell.notifyIngestEdit();let a;try{a=await this.writeBackend.writeProp(t,n,this.serializeValue(i),{addIfMissing:!0})}catch(c){return this.valueEcho.delete(s),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write failed for oid "${t}" prop "${n}": ${String(c)}`),!1}return a.changed?!0:(this.valueEcho.delete(s),a.dynamic&&this.dynamicPaths.add(s),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write refused/no-op for oid "${t}" prop "${n}": ${a.dynamic?"dynamic expression (guarded)":a.error??"no change"}`),!1)}async writeJsxProp(e,t,r,n){const i=this.oidOf(e);if(!i||!this.writeBackend?.writeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot write "${r}" on "${e}": ${i?"no source-write backend in this session":"node has no source stamp"}.`),!1;const s=`${e}|${t}`;this.valueEcho.set(s,n),this.store.shell.notifyIngestEdit();let a;try{a=await this.writeBackend.writeProp(i,r,this.serializeValue(n),{addIfMissing:r==="name"||this.declaredPropsOf(e).some(c=>c.name===r)})}catch(c){return this.valueEcho.delete(s),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write failed for oid "${i}" prop "${r}": ${String(c)}`),!1}return a.changed?!0:(this.valueEcho.delete(s),a.dynamic&&this.dynamicPaths.add(s),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write refused/no-op for oid "${i}" prop "${r}": ${a.dynamic?"dynamic expression (guarded)":a.error??"no change"}`),!1)}typedFieldOid(e,t,r){return r.target==="material"?this.materialOidOf(t):this.oidOf(e)}propDrivingTypedField(e,t,r){if(r.target!=="material")return null;const n=this.materialOidOf(t);if(!n)return null;const i=this.attrsOfOid(n)?.find(a=>a.name===r.prop);if(!i||i.isLiteral)return null;const s=i.rawValue.trim();return/^[A-Za-z_$][\w$]*$/.test(s)&&this.declaredPropsOf(e).some(a=>a.name===s)?s:null}typedThreeRow(e,t,r){if(r.type==="asset")return{path:r.path,label:r.label,type:r.type,group:r.group,readonly:!R(t),...R(t)?{}:{readonlyReason:"This object has no material to assign a texture to."}};const n=this.typedFieldOid(e,t,r),s=(r.target==="material"?n?this.attrsOfOid(n):null:this.attrsOf(e))?.find(u=>u.name===r.prop)??null,a=this.propDrivingTypedField(e,t,r),c=(s?!s.isLiteral:!1)&&!a||this.dynamicPaths.has(`${e}|${r.path}`),l=!!n&&!!this.writeBackend?.writeProp&&!c;return{path:r.path,label:r.label,type:r.type,...r.options?{options:[...r.options]}:{},group:r.group,readonly:!l,...s?{}:{defaulted:!0}}}readTypedThree(e,t){return J(e,R(e),t)}setTypedAsset(e,t,r,n){const i=R(t),s=T(t,i,r,n);return s!==null&&(this.valueEcho.set(`${e}|${r.path}`,J(t,i,r)),this.store.shell.notifyIngestEdit()),ie({resolve:()=>oe(s===null?`"${r.label}" has no material on "${e}" to assign to`:`a texture slot binds a loaded THREE.Texture, not a JSX attribute literal — assigning "${r.prop}" in source means adding a useTexture() binding to the component, which this adapter's attribute writer cannot author`),record:()=>{},report:a=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${a}.`)})}async writeTypedThree(e,t,r,n){const i=this.propDrivingTypedField(e,t,r);if(i){const h=R(t),p=J(t,h,r),f=T(t,h,r,n);if(f===null)return!1;this.store.shell.notifyIngestEdit();const g=await this.writeJsxProp(e,`${O}${i}`,i,f);return!g&&p!==null&&p!==void 0&&(T(t,h,r,p),this.store.shell.notifyIngestEdit()),g}const s=this.typedFieldOid(e,t,r),a=R(t);if(!s||!this.writeBackend?.writeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot write "${r.path}" on "${e}": ${s?"no source-write backend in this session":"no source stamp for this field"}.`),!1;const c=J(t,a,r),l=T(t,a,r,n);if(l===null)return!1;const u=`${e}|${r.path}`;this.valueEcho.set(u,J(t,a,r)),this.store.shell.notifyIngestEdit();let d;try{d=await this.writeBackend.writeProp(s,r.prop,this.serializeValue(l),{addIfMissing:!0})}catch(h){return this.valueEcho.delete(u),await this.refreshSourceState(),this.store.shell.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] typed "${r.prop}" write failed for oid "${s}": ${String(h)}`),!1}return d.changed||d.dynamic&&this.declaredPropsOf(e).some(h=>h.name===r.prop)&&(this.valueEcho.delete(u),await this.writeJsxProp(e,`${O}${r.prop}`,r.prop,l))?!0:(this.valueEcho.delete(u),d.dynamic&&this.dynamicPaths.add(u),c!=null&&T(t,a,r,c),this.store.shell.notifyIngestEdit(),Pe.warn(`“${r.prop}” on “${this.hierarchy.node(e)?.label??e}” is ${d.dynamic?"bound to an expression in the component’s own source, so a direct edit cannot land — the preview was reverted. Edit the prop that drives it (or the component source) instead.":`not writable here (${d.error??"no change"}) — the preview was reverted.`}`,"editor"),!1)}structureClipboardPayload(e){const t=new Set(e),r=[...new Set(e)].filter(l=>{let u=this.hierarchy.node(l)?.parentId??null;for(;u;){if(t.has(u))return!1;u=this.hierarchy.node(u)?.parentId??null}return!0}),n=[],i=new Set;for(const l of r){const u=this.oidOf(l);if(!u||i.has(u))continue;i.add(u);const d=this.oidIndex.get(u),h=d?this.sources.get(d.file):void 0;if(!d||h===void 0)return null;const p=H(h,d.line,d.col),f=cr(h,p);if(h[p]!=="<"||f<=p)return null;const g=h.slice(h.lastIndexOf(`
6
6
  `,p-1)+1,p),v=h.slice(p,f),x=/^\s*$/.test(g)?v.split(`
7
7
  `).map((w,te)=>te>0&&w.startsWith(g)?w.slice(g.length):w).join(`
8
8
  `):v;n.push({file:d.file,offset:p,text:x})}if(n.length===0)return null;const s=n[0].file;if(n.some(l=>l.file!==s))return null;n.sort((l,u)=>l.offset-u.offset);const a=this.transformObject(r[0]??""),c=a?new Me().setFromObject(a).getSize(new m).x:Number.NaN;return{sourceFile:s,text:n.map(l=>l.text).join(`
@@ -0,0 +1 @@
1
+ import{cA as L}from"./index-C5ZAyrKq.js";const Y=.1,w=4,x=.02,X=32,b=.002,P=4;function g(t,o,i){return o===1?t*16:o===2?t*i:t}function D(t,o){let i=g(o.deltaX,o.deltaMode,o.bounds.width),s=g(o.deltaY,o.deltaMode,o.bounds.height);if(o.ctrlKey||o.metaKey){const n=Math.min(w,Math.max(Y,t.zoom*Math.exp(-s*b))),a=o.clientX-o.bounds.left,d=o.clientY-o.bounds.top,c=(a-t.x)/t.zoom,u=(d-t.y)/t.zoom;return{x:a-c*n,y:d-u*n,zoom:n}}return o.shiftKey&&i===0&&(i=s,s=0),{x:t.x-i,y:t.y-s,zoom:t.zoom}}function I(t,o){const i=g(o.deltaY,o.deltaMode,o.bounds.height),s=Math.min(X,Math.max(x,t.zoom*Math.exp(-i*b))),n=o.clientX-o.bounds.left,a=o.clientY-o.bounds.top,d=(n-t.x)/t.zoom,c=(a-t.y)/t.zoom;return{x:n-d*s,y:a-c*s,zoom:s}}function p(t){return t instanceof Element&&t.closest('[data-volter-canvas-navigation-ignore="true"]')!==null}function C(t,o,i,s={}){let n=null,a=!1,d="";const c=()=>t.querySelector('[data-testid="world-selection-overlay-interaction"]'),u=e=>{t.dataset.canvasPanning=e?"true":"false",t.style.cursor=e?"grabbing":"";const r=c();r&&(e?(d=r.style.cursor,r.style.cursor="grabbing"):r.style.cursor=d)},m=e=>{if(!n||e.pointerId!==n.pointerId)return;const r=n.button===1?4:2;if((e.buttons&r)===0){l(e);return}const f=e.clientX-n.startClientX,v=e.clientY-n.startClientY;if(!n.moved){if(Math.hypot(f,v)<=P)return;n.moved=!0,u(!0)}o.setPan(n.startPan.x+f,n.startPan.y+v)},l=e=>{if(!n||e.pointerId!==n.pointerId)return;const r=n.pointerId;n.button===2&&n.moved&&(a=!0),n=null,u(!1),t.hasPointerCapture?.(r)&&t.releasePointerCapture(r),window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)},h=e=>{const r=e.button===1,f=s.rightDragPans===!0&&e.button===2;!r&&!f||p(e.target)||(f&&(a=!1),e.preventDefault(),r&&e.stopPropagation(),n={pointerId:e.pointerId,button:e.button,startClientX:e.clientX,startClientY:e.clientY,startPan:o.get(),moved:r},t.setPointerCapture?.(e.pointerId),u(r),window.addEventListener("pointermove",m),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l))},E=e=>{e.button===1&&!p(e.target)&&e.preventDefault()},M=e=>{s.rightDragPans!==!0||!(n?.button===2&&n.moved)&&!a||(a=!1,e.preventDefault(),e.stopPropagation())},y=e=>{if(p(e.target))return;e.preventDefault(),e.stopPropagation();const r=i(o.get(),{clientX:e.clientX,clientY:e.clientY,deltaX:e.deltaX,deltaY:e.deltaY,deltaMode:e.deltaMode,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,bounds:t.getBoundingClientRect()});o.setView(r.x,r.y,r.zoom)};return t.addEventListener("pointerdown",h,!0),t.addEventListener("lostpointercapture",l,!0),t.addEventListener("mousedown",E,!0),t.addEventListener("contextmenu",M,!0),t.addEventListener("wheel",y,{capture:!0,passive:!1}),()=>{n=null,u(!1),t.removeEventListener("pointerdown",h,!0),t.removeEventListener("lostpointercapture",l,!0),t.removeEventListener("mousedown",E,!0),t.removeEventListener("contextmenu",M,!0),t.removeEventListener("wheel",y,!0),window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)}}function z(t,o=L){return C(t,o,D)}function N(t,o){return C(t,o,I,{rightDragPans:!0})}export{X as S,x as a,N as b,z as i};
@@ -0,0 +1 @@
1
+ import{a as n}from"./jsx-runtime-DPjLkJKQ.js";import{eI as ye,eJ as ne,eK as xe,eL as be,eM as je,eN as Se,du as ve,eO as Ce,eP as Re,eQ as ke,eR as we,aA as Ee,eS as m,en as u,ep as j,a0 as k,eT as O,eU as $e,eV as H,dh as K,K as B,et as Te,aM as Y,eW as se,eX as Ie,eY as Ne,aR as Me,ar as ie,eZ as Oe,e_ as Ae}from"./index-C5ZAyrKq.js";import{r as v}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{p as re,G as ae,c as M,B as Be,A as Fe,S as A,a as _e,b as De,F as Le,d as J,e as ze,f as Pe,T as We,g as X,h as Ge,C as He,i as Ue,j as Ke}from"./ShadowEditor-YO5KEfnz.js";import{s as oe,a as U,b as Ve}from"./board-guides-CjHQ9Ynm.js";import{b as Ye}from"./eyedropper-session-bjPXnfeX.js";import{k as Je,l as Xe}from"./inspect-Cz3Zyx_1.js";import{D as Qe}from"./dom-authoring-adapter-L8OzXfmE.js";import{R as D,c as Ze}from"./react-world-authoring-adapter-CnzxMtYz.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"./inference-diagnostics-DLt9ql9I.js";import"./json-history-resource-Uqrihfc8.js";import"./relative-import-specifier-CPFTrxi4.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./writer-tw6EcuVO.js";function le(e,t){if(!e)return null;const s=(()=>{if(!(t instanceof Ee))return t;const i=t.ownerOf(e.id);return i===null?null:t.childAdapters().find(a=>a.worldId===i)?.adapter??null})();return s instanceof D||s instanceof Qe?s:null}const qe=(e,t)=>le(e,t)!==null,et="element",tt=1500,nt="story",st=1600;function T(e){const t=e.indexOf(".");return t===-1?e:e.slice(t+1)}function it(e){const t=T(e.path);return e.type==="color"?"color":/^fontFamily$/i.test(t)?"font":t==="background"||t==="backgroundImage"?"gradient":t==="boxShadow"?"shadow":t==="textShadow"?"text-shadow":t==="filter"?"filter":t==="backdropFilter"?"backdrop-filter":t==="borderRadius"?"radius":e.type==="string"&&t==="transform"?"transform":e.type==="boolean"?"checkbox":e.type==="enum"?"select":e.type==="json"?"json":e.type==="number"?"scrub":"text"}function rt(e,t,s,i){if(!(e.path==="style.borderWidth"||e.path==="style.borderStyle"||e.path==="style.borderColor"))return!1;const o=t.get("style.borderWidth"),c=t.get("style.borderStyle"),r=t.get("style.borderColor");return!o||!c||!r?!1:(i.push({kind:"border",width:o,style:c,color:r}),s.add(o.path),s.add(c.path),s.add(r.path),!0)}function at(e,t,s,i){if(!(e.path==="style.justifyContent"||e.path==="style.alignItems"))return!1;const o=t.get("style.justifyContent"),c=t.get("style.alignItems");return!o||!c?!1:(i.push({kind:"align",justify:o,align:c}),s.add(o.path),s.add(c.path),!0)}function ce(e){const t=new Map(e.map(a=>[a.path,a])),s=new Set,i=[];for(const a of e)s.has(a.path)||rt(a,t,s,i)||at(a,t,s,i)||i.push({kind:"single",prop:a});return i}function L(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function F(e){return`react-prop-${e.replace(/\./g,"-")}`}const de={type:"linear",angle:180,stops:[{color:"#ffffff",position:0},{color:"#000000",position:1}]};function w({label:e,testId:t,children:s}){return n.jsxs("div",{"data-testid":t?`${t}-row`:void 0,style:{...Oe,padding:`${u[2]} ${u[4]}`},children:[n.jsx("span",{style:{width:Ae,flexShrink:0,fontSize:j.base,color:m.textMuted},children:e}),n.jsx("div",{style:{flex:1,minWidth:0},children:s})]})}function ot({prop:e,raw:t,disabled:s,testId:i,commit:a}){return n.jsx(w,{label:e.label,testId:i,children:n.jsx(He,{testId:i,value:String(t??"#ffffff"),disabled:s,onChange:o=>a(e.path,o),onChangeEnd:o=>a(e.path,o),eyedropperFallback:()=>Xe([String(t??"")]),onEyedropperPick:o=>Ye(o)})})}function lt({prop:e,raw:t,disabled:s,fonts:i,testId:a,commit:o}){return n.jsx(w,{label:e.label,testId:a,children:n.jsx(Ge,{testId:a,value:String(t??""),fonts:i,disabled:s,onChange:c=>o(e.path,c)})})}function ct({prop:e,raw:t,disabled:s,testId:i,commit:a}){const o=re(String(t??"none"));return o?n.jsx(w,{label:e.label,testId:i,children:n.jsx(ae,{testId:i,value:o,disabled:s,onChange:c=>a(e.path,M(c)),onChangeEnd:c=>a(e.path,M(c))})}):n.jsx(w,{label:e.label,testId:i,children:n.jsx(k,{type:"button",variant:"secondary",className:"volter-field-trigger","data-testid":i,disabled:s,onClick:()=>a(e.path,M(de)),children:"No gradient — click to add"})})}function Q({prop:e,raw:t,disabled:s,testId:i,commit:a,withSpreadInset:o}){const c=ze(String(t??"none"),o),r=o?Pe:We;return n.jsx(w,{label:e.label,testId:i,children:n.jsx(r,{value:c,disabled:s,onChange:l=>a(e.path,X(l,o)),onChangeEnd:l=>a(e.path,X(l,o))})})}function Z({prop:e,raw:t,disabled:s,testId:i,commit:a,label:o}){const c=De(String(t??"none"));return n.jsx(w,{label:e.label,testId:i,children:n.jsx(Le,{testId:i,label:o,value:c,disabled:s,onChange:r=>a(e.path,J(r)),onChangeEnd:r=>a(e.path,J(r))})})}const G=[{key:"topLeft",suffix:"TopLeft"},{key:"topRight",suffix:"TopRight"},{key:"bottomLeft",suffix:"BottomLeft"},{key:"bottomRight",suffix:"BottomRight"}];function dt({adapter:e,id:t,prop:s,raw:i,disabled:a,testId:o,commit:c,removeStyle:r}){const l=L(i),d=G.reduce((g,{key:f,suffix:S})=>{const x=e.inspector?.get(t,`style.border${S}Radius`);return g[f]=ie(x)??l,g},{}),y=g=>{if(Ke(g)){c(s.path,g.topLeft);for(const{suffix:f}of G)r(`style.border${f}Radius`);return}for(const{key:f,suffix:S}of G)c(`style.border${S}Radius`,g[f])};return n.jsx(w,{label:s.label,testId:o,children:n.jsx(_e,{value:d,disabled:a,onChange:y,onChangeEnd:y})})}function ut({prop:e,raw:t,disabled:s,testId:i,commit:a}){const o=se.has(T(e.path))?"":"px";return n.jsx(A,{testId:i,label:e.label,value:L(t),unit:o,disabled:s,onChange:c=>a(e.path,c),onChangeEnd:c=>a(e.path,c),style:{padding:`${u[2]} ${u[4]}`}})}function pt({prop:e,raw:t,disabled:s,testId:i,commit:a}){return n.jsx(w,{label:e.label,testId:i,children:n.jsx(K,{"data-testid":i,value:String(t??""),disabled:s,"data-dynamic":s||void 0,onChange:o=>a(e.path,o.target.value),style:{width:"100%"},children:(e.options??[]).map(o=>n.jsx("option",{value:String(o),children:String(o)},String(o)))})})}function gt({prop:e,raw:t,disabled:s,testId:i,commit:a}){return n.jsxs("label",{style:{display:"flex",gap:u[3],alignItems:"center",padding:`${u[3]} ${u[4]}`,fontSize:j.md},children:[n.jsx(Me,{className:"volter-checkbox","data-testid":i,checked:t!==!1,disabled:s,onChange:o=>a(e.path,o.target.checked)}),e.label]})}function ht({prop:e,raw:t,disabled:s,testId:i,commit:a}){return n.jsx(w,{label:e.label,testId:i,children:n.jsx(Ne,{"data-testid":i,defaultValue:JSON.stringify(t??null),disabled:s,"data-dynamic":s||void 0,"data-variant":"code",style:{width:"100%",minHeight:40},onBlur:o=>{try{a(e.path,JSON.parse(o.target.value))}catch{}}})})}function ue({prop:e,raw:t,disabled:s,testId:i,commit:a}){return n.jsx(w,{label:e.label,testId:i,children:n.jsx(Ie,{type:"text","data-testid":i,readOnly:s,"data-dynamic":s||void 0,value:String(t??""),onCommit:o=>a(e.path,o),style:{width:"100%"}})})}const ft=/^rotate\(\s*(-?[\d.]+)deg\s*\)\s*scale\(\s*(-?[\d.]+)\s*\)$/i,mt=/^scale\(\s*(-?[\d.]+)\s*\)\s*rotate\(\s*(-?[\d.]+)deg\s*\)$/i,yt=/^rotate\(\s*(-?[\d.]+)deg\s*\)$/i,xt=/^scale\(\s*(-?[\d.]+)\s*\)$/i,bt=/^matrix\(\s*(-?[\d.eE+-]+)\s*,\s*(-?[\d.eE+-]+)\s*,\s*(-?[\d.eE+-]+)\s*,\s*(-?[\d.eE+-]+)\s*,\s*(-?[\d.eE+-]+)\s*,\s*(-?[\d.eE+-]+)\s*\)$/,_=1e-4;function jt(e){const t=e.trim();if(t===""||t==="none")return{rotateDeg:0,scale:1};const s=ft.exec(t);if(s)return{rotateDeg:Number(s[1]),scale:Number(s[2])};const i=mt.exec(t);if(i)return{rotateDeg:Number(i[2]),scale:Number(i[1])};const a=yt.exec(t);if(a)return{rotateDeg:Number(a[1]),scale:1};const o=xt.exec(t);if(o)return{rotateDeg:0,scale:Number(o[1])};const c=bt.exec(t);if(!c)return null;const[r,l,d,y,g,f]=c.slice(1,7).map(Number);if(Math.abs(g)>_||Math.abs(f)>_||Math.abs(d+l)>_||Math.abs(y-r)>_)return null;const S=Math.hypot(r,l);if(S<_)return null;const x=Math.atan2(l,r)*180/Math.PI;return{rotateDeg:Math.round(x*100)/100,scale:Math.round(S*1e3)/1e3}}function St(e){return`rotate(${e.rotateDeg}deg) scale(${e.scale})`}function vt(e){const{prop:t,raw:s,disabled:i,testId:a,commit:o}=e,c=jt(String(s??"none"));if(!c)return n.jsx(ue,{...e});const r=l=>o(t.path,St(l));return n.jsx(w,{label:t.label,testId:a,children:n.jsxs("div",{style:{display:"flex",gap:u[3]},children:[n.jsx(A,{testId:`${a}-rotate`,label:"Rotate",value:c.rotateDeg,unit:"deg",disabled:i,onChange:l=>r({...c,rotateDeg:l}),onChangeEnd:l=>r({...c,rotateDeg:l}),style:{flex:1}}),n.jsx(A,{testId:`${a}-scale`,label:"Scale",value:c.scale,unit:"x",step:.1,disabled:i,onChange:l=>r({...c,scale:l}),onChangeEnd:l=>r({...c,scale:l}),style:{flex:1}})]})})}function $({adapter:e,id:t,prop:s,fonts:i}){const a=B(),o=(l,d)=>{e.inspector?.set(t,l,d),a.notifyIngestEdit()},c=l=>{e.inspector?.remove?.(t,l),a.notifyIngestEdit()},r={prop:s,raw:e.inspector?.get(t,s.path),disabled:s.readonly,testId:F(s.path),commit:o,fonts:i};switch(it(s)){case"color":return n.jsx(ot,{...r});case"font":return n.jsx(lt,{...r});case"gradient":return n.jsx(ct,{...r});case"shadow":return n.jsx(Q,{...r,withSpreadInset:!0});case"text-shadow":return n.jsx(Q,{...r,withSpreadInset:!1});case"filter":return n.jsx(Z,{...r,label:"Filter"});case"backdrop-filter":return n.jsx(Z,{...r,label:"Backdrop Filter"});case"radius":return n.jsx(dt,{...r,adapter:e,id:t,removeStyle:c});case"transform":return n.jsx(vt,{...r});case"scrub":return n.jsx(ut,{...r});case"select":return n.jsx(pt,{...r});case"checkbox":return n.jsx(gt,{...r});case"json":return n.jsx(ht,{...r});default:return n.jsx(ue,{...r})}}function pe({adapter:e,id:t,row:s}){const i=B(),a=(r,l)=>{e.inspector?.set(t,r,l),i.notifyIngestEdit()},o=r=>{e.inspector?.remove?.(t,r),i.notifyIngestEdit()};if(s.kind==="border"){const r={width:L(e.inspector?.get(t,s.width.path)),style:String(e.inspector?.get(t,s.style.path)??"solid"),color:String(e.inspector?.get(t,s.color.path)??"#000000")},l=f=>{const S=ie(e.inspector?.get(t,`style.border${f}Width`)),x=e.inspector?.get(t,`style.border${f}Style`),C=e.inspector?.get(t,`style.border${f}Color`),p=typeof C=="string"?Ze(C):void 0;return{width:S??r.width,style:typeof x=="string"&&x?x:r.style,color:p??r.color}},d={top:l("Top"),right:l("Right"),bottom:l("Bottom"),left:l("Left")},y=["Top","Right","Bottom","Left"],g=f=>{if(Ue(f)){a(s.width.path,f.top.width),a(s.style.path,f.top.style),a(s.color.path,f.top.color);for(const x of y)o(`style.border${x}Width`),o(`style.border${x}Style`),o(`style.border${x}Color`);return}const S=y.map(x=>({suffix:x,side:f[x.toLowerCase()]}));for(const{suffix:x,side:C}of S)a(`style.border${x}Width`,C.width),a(`style.border${x}Style`,C.style),a(`style.border${x}Color`,C.color)};return n.jsx(w,{label:"Border",testId:"react-prop-border",children:n.jsx(Be,{value:d,onChange:g,onChangeEnd:g})})}const c={justify:e.inspector?.get(t,s.justify.path)??"flex-start",align:e.inspector?.get(t,s.align.path)??"flex-start"};return n.jsx(w,{label:"Align",testId:"react-prop-align",children:n.jsx(Fe,{value:c,onChange:r=>{a(s.justify.path,r.justify),a(s.align.path,r.align)}})})}function z(e){return e.kind==="single"?e.prop.path:e.kind==="border"?`border:${e.width.path}`:`align:${e.justify.path}`}function E(e,t,s,i,a){if(!s)return null;const o=se.has(T(s.path))?"":"px",c=F(s.path);return n.jsx(A,{testId:c,label:i,value:L(e.inspector?.get(t,s.path)),unit:o,disabled:s.readonly,onChange:r=>a(s.path,r),onChangeEnd:r=>a(s.path,r),style:{flex:1,minWidth:0}},s.path)}function Ct({adapter:e,id:t,props:s,fonts:i,showConstraints:a,onToggleConstraints:o}){const c=B(),r=new Map(s.map(p=>[T(p.path),p])),l=(p,P)=>{e.inspector?.set(t,p,P),c.notifyIngestEdit()},d=String(e.inspector?.get(t,r.get("display")?.path??"style.display")??""),y=d==="flex"||d==="inline-flex",g=d==="grid"||d==="inline-grid",f=r.get("display"),S=r.get("gap"),x=ce(s.filter(p=>["justifyContent","alignItems"].includes(T(p.path)))),C=["flexDirection","flexWrap","overflow"].map(p=>r.get(p)).filter(p=>!!p);return n.jsxs("div",{style:{padding:"2px 8px 7px"},children:[n.jsxs("div",{style:{display:"flex",gap:u[3]},children:[E(e,t,r.get("width"),"W",l),E(e,t,r.get("height"),"H",l)]}),a&&n.jsxs("div",{"data-testid":"react-layout-constraints",style:{marginTop:5},children:[n.jsxs("div",{style:{display:"flex",gap:u[3]},children:[E(e,t,r.get("minWidth"),"Min W",l),E(e,t,r.get("minHeight"),"Min H",l)]}),n.jsxs("div",{style:{display:"flex",gap:u[3],marginTop:u[2]},children:[E(e,t,r.get("maxWidth"),"Max W",l),E(e,t,r.get("maxHeight"),"Max H",l)]})]}),n.jsx(k,{type:"button",variant:"ghost",size:"compact","data-testid":"react-layout-toggle-constraints",onClick:o,style:{display:"flex",margin:"2px auto 5px"},children:a?"− constraints":"··· constraints"}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1.35fr) minmax(0, 1fr)",gap:u[3]},children:[f&&n.jsx(K,{"data-testid":F(f.path),value:d,disabled:f.readonly,"data-dynamic":f.readonly||void 0,onChange:p=>l(f.path,p.target.value),style:{width:"100%"},children:(f.options??[]).map(p=>n.jsx("option",{value:String(p),children:String(p)},String(p)))}),E(e,t,S,"Gap",l)]}),y&&n.jsxs("div",{"data-testid":"react-layout-flex-controls",style:{marginTop:5},children:[C.filter(p=>T(p.path)!=="overflow").map(p=>n.jsx($,{adapter:e,id:t,prop:p,fonts:i},p.path)),x.map(p=>p.kind==="single"?n.jsx($,{adapter:e,id:t,prop:p.prop,fonts:i},z(p)):n.jsx(pe,{adapter:e,id:t,row:p},z(p)))]}),g&&n.jsxs("div",{"data-testid":"react-layout-grid-controls",style:{marginTop:5},children:[n.jsxs("div",{style:{display:"flex",gap:u[3]},children:[q(e,t,r.get("gridTemplateColumns"),"Cols",l),q(e,t,r.get("gridTemplateRows"),"Rows",l)]}),[r.get("gridTemplateColumns"),r.get("gridTemplateRows")].filter(p=>!!p).map(p=>n.jsx($,{adapter:e,id:t,prop:p,fonts:i},p.path)),n.jsxs("div",{style:{display:"flex",gap:u[3],marginTop:u[1]},children:[E(e,t,r.get("rowGap"),"Row Gap",l),E(e,t,r.get("columnGap"),"Col Gap",l)]}),r.get("gridAutoFlow")&&n.jsx($,{adapter:e,id:t,prop:r.get("gridAutoFlow"),fonts:i})]}),C.filter(p=>T(p.path)==="overflow").map(p=>n.jsx($,{adapter:e,id:t,prop:p,fonts:i},p.path)),n.jsx(Rt,{adapter:e,id:t,byName:r,fonts:i})]})}function ge(e){const t=e.trim();if(!t||t==="none")return 0;const s=[];let i=0,a=0;for(let c=0;c<t.length;c++){const r=t[c];r==="("||r==="["?i++:r===")"||r==="]"?i--:r===" "&&i===0&&(c>a&&s.push(t.slice(a,c)),a=c+1)}a<t.length&&s.push(t.slice(a));let o=0;for(const c of s){const r=/^repeat\(\s*(\d+)\s*,([\s\S]*)\)$/.exec(c);o+=r?.[1]&&r[2]!==void 0?Number(r[1])*ge(r[2]):1}return o}function q(e,t,s,i,a){if(!s)return null;let o=null;const c=r=>{const d=`repeat(${Math.max(1,Math.round(r))}, 1fr)`;d!==o&&(o=d,a(s.path,d))};return n.jsx(A,{testId:`${F(s.path)}-count`,label:i,value:ge(String(e.inspector?.get(t,s.path)??"")),min:1,disabled:s.readonly,onChange:c,onChangeEnd:c,style:{flex:1,minWidth:0}},`${s.path}-count`)}function Rt({adapter:e,id:t,byName:s,fonts:i}){const[a,o]=v.useState(!1),c=["gridColumn","gridRow","justifySelf"].map(r=>s.get(r)).filter(r=>!!r);return c.length===0?null:n.jsxs(n.Fragment,{children:[n.jsx(k,{type:"button",variant:"ghost",size:"compact","data-testid":"react-layout-toggle-grid-item",onClick:()=>o(r=>!r),style:{display:"flex",margin:"2px auto 0"},children:a?"− grid item":"··· grid item"}),a&&n.jsx("div",{"data-testid":"react-layout-grid-item",children:c.map(r=>n.jsx($,{adapter:e,id:t,prop:r,fonts:i},r.path))})]})}function kt(e){const t=e.trim();if(!t||t==="none")return[];const s=[];let i=0,a=0;for(let o=0;o<t.length;o++){const c=t[o];c==="("?i++:c===")"?i--:c===","&&i===0&&(s.push(t.slice(a,o).trim()),a=o+1)}return s.push(t.slice(a).trim()),s.filter(Boolean)}function ee(e){return/^url\((['"]?)([\s\S]*)\1\)$/.exec(e.trim())?.[2]??null}function wt({adapter:e,id:t,props:s,fonts:i}){const a=B(),o=new Map(s.map(h=>[T(h.path),h])),c=(h,b)=>{e.inspector?.set(t,h,b),a.notifyIngestEdit()},r=o.get("backgroundImage"),l=o.get("backgroundColor"),[d,y]=v.useState(null),[g,f]=v.useState(null),S=String(r?e.inspector?.get(t,r.path)??"":""),x=kt(S),C=h=>{if(r){if(h.length>0){c(r.path,h.join(", "));return}e.inspector?.remove?.(t,r.path),a.notifyIngestEdit()}},p=(h,b)=>C(x.map((R,I)=>I===h?b:R)),P=h=>{y(null),C(x.filter((b,R)=>R!==h))},V=(h,b)=>{const R=[...x],I=R[h+b];I===void 0||R[h]===void 0||(R[h+b]=R[h],R[h]=I,y(null),C(R))},W={background:"none",border:"none",color:m.textMuted,cursor:"pointer",fontSize:j.base,padding:`${u[2]} ${u[3]}`,lineHeight:O.tight};return n.jsxs("div",{"data-testid":"react-fill-list",style:{padding:"2px 8px 7px"},children:[x.map((h,b)=>{const R=re(h),I=ee(h),me=R?`${R.type} gradient`:I!==null?I.split("/").pop()??"image":h.slice(0,22);return n.jsxs("div",{style:{marginBottom:3},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[n.jsxs("button",{type:"button","data-testid":`react-fill-layer-${b}`,title:h,onClick:()=>y(d===b?null:b),style:{display:"flex",alignItems:"center",gap:u[3],flex:1,minWidth:0,background:"none",border:"none",cursor:"pointer",padding:`${u[1]} 0`,color:m.text,fontSize:j.base,textAlign:"left"},children:[n.jsx("span",{style:{width:16,height:16,flexShrink:0,borderRadius:Te.sm,border:`1px solid ${m.border}`,background:h,backgroundSize:"cover"}}),n.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:me})]}),b>0&&n.jsx("button",{type:"button","data-testid":`react-fill-up-${b}`,title:"Raise this fill",onClick:()=>V(b,-1),style:W,children:"↑"}),b<x.length-1&&n.jsx("button",{type:"button","data-testid":`react-fill-down-${b}`,title:"Lower this fill",onClick:()=>V(b,1),style:W,children:"↓"}),n.jsx("button",{type:"button","data-testid":`react-fill-remove-${b}`,title:"Remove this fill (CSS has no hidden-layer state — removing is Figma's eye)",onClick:()=>P(b),style:W,children:"✕"})]}),d===b&&R&&n.jsx(ae,{testId:`react-fill-gradient-${b}`,value:R,onChange:N=>p(b,M(N)),onChangeEnd:N=>p(b,M(N))}),d===b&&I!==null&&n.jsx(Y,{"data-testid":`react-fill-url-${b}`,defaultValue:I,placeholder:"image url",onBlur:N=>p(b,`url("${N.target.value.trim()}")`),onKeyDown:N=>{N.key==="Enter"&&p(b,`url("${N.currentTarget.value.trim()}")`)},style:{width:"100%",marginTop:u[1]}})]},`${b}-${h.slice(0,24)}`)}),g!==null&&n.jsx(Y,{"data-testid":"react-fill-image-draft",value:g,placeholder:"image url — Enter to add",autoFocus:!0,onChange:h=>f(h.target.value),onKeyDown:h=>{h.key==="Enter"&&g.trim()&&(C([`url("${g.trim()}")`,...x]),f(null)),h.key==="Escape"&&f(null)},style:{width:"100%",marginBottom:3}}),n.jsxs("div",{style:{display:"flex",gap:u[2]},children:[n.jsx(k,{type:"button",variant:"ghost",size:"compact","data-testid":"react-fill-add-gradient",onClick:()=>{C([M(de),...x]),y(0)},children:"+ gradient"}),n.jsx(k,{type:"button",variant:"ghost",size:"compact","data-testid":"react-fill-add-image",onClick:()=>f(""),children:"+ image"})]}),x.some(h=>ee(h)!==null)&&["backgroundSize","backgroundPosition","backgroundRepeat"].map(h=>o.get(h)).filter(h=>!!h).map(h=>n.jsx($,{adapter:e,id:t,prop:h,fonts:i},h.path)),l&&n.jsx($,{adapter:e,id:t,prop:l,fonts:i})]})}function Et({adapter:e,id:t,props:s,fonts:i}){const a=B(),o=new Map(s.map(g=>[T(g.path),g])),c=o.get("position"),r=String(c?e.inspector?.get(t,c.path)??"static":"static"),l=(g,f)=>{e.inspector?.set(t,g,f),a.notifyIngestEdit()},d=["top","right","bottom","left"],y=["zIndex","flexGrow","flexShrink","flexBasis","alignSelf"].map(g=>o.get(g)).filter(g=>!!g);return n.jsxs("div",{style:{padding:"2px 8px 7px"},children:[c&&n.jsx("div",{"data-testid":F(c.path),style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:u[1]},children:(c.options??[]).map(g=>{const f=String(g),S=f===r;return n.jsx(k,{type:"button",variant:S?"primary":"secondary",size:"compact","aria-pressed":S,title:f,disabled:c.readonly,onClick:()=>l(c.path,f),children:f.slice(0,3)},f)})}),r!=="static"&&n.jsx("div",{"data-testid":"react-position-offsets",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:u[2],marginTop:u[3]},children:d.map(g=>E(e,t,o.get(g),g[0].toUpperCase(),l))}),y.length>0&&n.jsxs("div",{style:{borderTop:`1px solid ${m.border}`,marginTop:7,paddingTop:3},children:[n.jsx("div",{style:{color:m.textMuted,fontSize:j.xs,padding:"2px 0 1px"},children:"STACKING & FLEX ITEM"}),y.map(g=>n.jsx($,{adapter:e,id:t,prop:g,fonts:i},g.path))]})]})}function $t({adapter:e,id:t,props:s}){const i=B(),a=new Map(s.map(d=>[T(d.path),d])),o=(d,y)=>{e.inspector?.set(t,d,y),i.notifyIngestEdit()},c=d=>{const y=a.get(d);return y?n.jsx(A,{testId:F(y.path),label:"",value:L(e.inspector?.get(t,y.path)),unit:"px",disabled:y.readonly,onChange:g=>o(y.path,g),onChangeEnd:g=>o(y.path,g),style:{width:46,minWidth:0,flex:"none"}},y.path):n.jsx("span",{},d)},r=d=>n.jsx("span",{style:{position:"absolute",top:2,left:6,fontSize:8,letterSpacing:".08em",color:m.textMuted,pointerEvents:"none"},children:d}),l={display:"flex",alignItems:"center",justifyContent:"center"};return n.jsx("div",{style:{padding:`${u[1]} ${u[4]} ${u[4]}`},"data-testid":"react-spacing-box",children:n.jsxs("div",{style:{position:"relative",border:`1px solid ${m.border}`,borderRadius:4,padding:"11px 4px 3px"},children:[r("MARGIN"),n.jsx("div",{style:l,children:c("marginTop")}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:u[1]},children:[c("marginLeft"),n.jsxs("div",{style:{position:"relative",flex:1,minWidth:0,border:`1px dashed ${m.border}`,borderRadius:4,padding:"11px 4px 3px"},children:[r("PADDING"),n.jsx("div",{style:l,children:c("paddingTop")}),n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u[1]},children:[c("paddingLeft"),c("paddingRight")]}),n.jsx("div",{style:l,children:c("paddingBottom")})]}),c("marginRight")]}),n.jsx("div",{style:l,children:c("marginBottom")})]})})}function Tt({name:e,groupId:t,props:s,adapter:i,id:a,fonts:o}){const[c,r]=v.useState(!1),l=ce(s);return n.jsxs("div",{"data-testid":`react-inspector-group-${t}`,children:[e==="Layout"&&n.jsx(Ct,{adapter:i,id:a,props:s,fonts:o,showConstraints:c,onToggleConstraints:()=>r(d=>!d)}),e==="Position"&&n.jsx(Et,{adapter:i,id:a,props:s,fonts:o}),e==="Spacing"&&n.jsx($t,{adapter:i,id:a,props:s}),e==="Fill"&&n.jsx(wt,{adapter:i,id:a,props:s,fonts:o}),e!=="Layout"&&e!=="Position"&&e!=="Spacing"&&e!=="Fill"&&l.map(d=>d.kind==="single"?n.jsx($,{adapter:i,id:a,prop:d.prop,fonts:o},z(d)):n.jsx(pe,{adapter:i,id:a,row:d},z(d)))]})}function It({adapter:e,node:t}){const s=[];let i=t,a=0;for(;i&&a++<100;)s.unshift(i),i=i.parentId?e.hierarchy.node(i.parentId):null;return n.jsx("nav",{"aria-label":"Selection ancestry","data-testid":"react-inspector-breadcrumbs",style:{display:"flex",alignItems:"center",gap:3,padding:`${u[3]} ${u[4]}`,overflowX:"auto",borderBottom:`1px solid ${m.border}`,whiteSpace:"nowrap"},children:s.map((o,c)=>n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:3},children:[c>0&&n.jsx("span",{style:{color:m.textMuted},children:"/"}),n.jsx(k,{type:"button",variant:"ghost",size:"compact","aria-current":o.id===t.id?"page":void 0,title:o.secondaryLabel??o.label,onClick:()=>$e(e,[o.id]),children:o.label})]},o.id))})}function Nt({owner:e,node:t}){const s=e.portableArgs(t.id),[i,a]=v.useState("idle"),[o,c]=v.useState(""),[r,l]=v.useState(null),d=async y=>{const g=await e.writeStory(t.id,y);l(g.changed?null:g.error??"refused"),g.changed&&(a("idle"),c(""))};return n.jsxs("div",{"data-testid":"react-story-controls-header",style:{borderBottom:`1px solid ${m.border}`},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u[4],padding:"7px 8px"},children:[n.jsxs("div",{style:{minWidth:0},children:[n.jsx("div",{style:{color:m.text,fontSize:j.md,fontWeight:600},children:t.label}),n.jsx("div",{style:{color:m.textMuted,fontSize:j.sm},children:s?`${Object.keys(s).length} args · session controls`:"Portable CSF story"})]}),n.jsx(k,{type:"button",variant:"secondary",size:"compact","data-testid":"react-story-reset-args",onClick:()=>e.resetPortableArgs(t.id),children:"Reset"})]}),n.jsxs("div",{style:{display:"flex",gap:u[2],padding:`0 ${u[4]} ${u[3]}`,flexWrap:"wrap"},children:[n.jsx(k,{type:"button",variant:"ghost",size:"compact","data-testid":"react-story-save-as",title:"Write the CURRENT session args as a new story export in this file",onClick:()=>{l(null),c(""),a(i==="save-as"?"idle":"save-as")},children:"Save as…"}),n.jsx(k,{type:"button",variant:"ghost",size:"compact","data-testid":"react-story-rename",onClick:()=>{l(null),c(""),a(i==="rename"?"idle":"rename")},children:"Rename…"}),i==="confirm-delete"?n.jsx(k,{type:"button",variant:"secondary",size:"compact","data-testid":"react-story-delete-confirm",onClick:()=>void d({kind:"delete"}),children:"Delete story?"}):n.jsx(k,{type:"button",variant:"ghost",size:"compact","data-testid":"react-story-delete",onClick:()=>{l(null),a("confirm-delete")},children:"Delete"})]}),(i==="save-as"||i==="rename")&&n.jsxs("div",{style:{display:"flex",gap:u[2],padding:`0 ${u[4]} ${u[4]}`,alignItems:"center"},children:[n.jsx("input",{"data-testid":"react-story-name-input",autoFocus:!0,value:o,placeholder:i==="save-as"?"NewStoryName":`Rename ${t.label}`,onChange:y=>c(y.target.value),onKeyDown:y=>{y.key==="Enter"&&o.trim()&&d(i==="save-as"?{kind:"save-as",name:o.trim()}:{kind:"rename",newName:o.trim()}),y.key==="Escape"&&a("idle")},style:{flex:1,minWidth:0,background:m.neutralHover,border:`1px solid ${m.border}`,borderRadius:4,color:m.text,fontSize:j.base,padding:"3px 6px"}}),n.jsx(k,{type:"button",variant:"secondary",size:"compact","data-testid":"react-story-name-commit",onClick:()=>void d(i==="save-as"?{kind:"save-as",name:o.trim()}:{kind:"rename",newName:o.trim()}),children:i==="save-as"?"Save":"Rename"})]}),r&&n.jsx("div",{"data-testid":"react-story-write-notice",style:{padding:`0 ${u[4]} ${u[4]}`,color:fe(),fontSize:j.sm,lineHeight:O.normal},children:r})]})}function Mt({owner:e,nodeId:t}){const s=e.elementClasses(t),[i,a]=v.useState(""),[o,c]=v.useState(null),r=async()=>{const l=i.trim().replace(/^\./,"");if(!l)return;const d=await e.writeNamedStyle(t,{kind:"set",className:l});c(d.changed?null:d.error??"refused"),d.changed&&a("")};return n.jsxs("div",{"data-testid":"react-element-classes",style:{padding:`${u[3]} ${u[4]}`,borderBottom:`1px solid ${m.border}`},children:[n.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:u[2],alignItems:"center"},children:[n.jsx("span",{style:{fontSize:j.sm,color:m.textMuted,marginRight:u[1]},children:"Style class"}),s.map(l=>n.jsxs("span",{"data-testid":`react-class-chip-${l.name}`,title:l.styledIn?`.${l.name} — ${l.count} element${l.count===1?"":"s"} in this game share this style (${l.styledIn.split("/").pop()??l.styledIn})`:`.${l.name} — utility/generated class (no first-party rule to edit)`,style:{display:"inline-flex",alignItems:"center",gap:3,fontFamily:H,fontSize:j.sm,color:l.styledIn?m.text:m.textMuted,background:m.neutralHover,border:`1px solid ${m.border}`,borderRadius:4,padding:"1px 4px"},children:[".",l.name,l.count>1&&n.jsxs("span",{style:{color:m.textMuted,fontSize:j.xs},children:["×",l.count]}),n.jsx("button",{type:"button","data-testid":`react-class-remove-${l.name}`,title:`Remove .${l.name} from this element`,onClick:()=>void e.writeNamedStyle(t,{kind:"remove",className:l.name}).then(d=>c(d.changed?null:d.error??"refused")),style:{background:"none",border:"none",color:m.textMuted,cursor:"pointer",fontSize:j.base,padding:"3px 5px",margin:"-3px -4px -3px -1px",lineHeight:O.tight},children:"✕"})]},l.name)),n.jsx("input",{"data-testid":"react-class-input",value:i,placeholder:s.length===0?"create style…":"add class…",title:"Type a class name — an existing first-party class is applied; a new name creates a style from this element's inline declarations",onChange:l=>{a(l.target.value),o&&c(null)},onKeyDown:l=>{l.key==="Enter"&&r(),l.key==="Escape"&&a("")},style:{flex:1,minWidth:72,background:"transparent",border:`1px dashed ${m.border}`,borderRadius:4,color:m.text,fontSize:j.sm,fontFamily:H,padding:"2px 5px"}})]}),o&&n.jsx("div",{"data-testid":"react-class-notice",style:{paddingTop:u[2],color:fe(),fontSize:j.sm,lineHeight:O.normal},children:o}),n.jsx(Ot,{})]})}function Ot(){const e=v.useSyncExternalStore(Ve,U);return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,paddingTop:5},children:[n.jsx("span",{style:{fontSize:j.sm,color:m.textMuted},children:"Breakpoint"}),n.jsx(K,{"data-testid":"react-breakpoint-select",value:e??"",onChange:t=>oe(t.target.value||null),style:{fontSize:j.sm,flex:1,...e?{color:m.accent,borderColor:m.accent}:{}},children:he.map(t=>n.jsx("option",{value:t.media??"",children:t.label},t.label))})]}),e&&n.jsxs("div",{"data-testid":"react-breakpoint-note",style:{paddingTop:3,color:m.textMuted,fontSize:j.xs,lineHeight:O.normal},children:["Style edits write @media ",e," — previewed live by frame width."]})]})}const he=[{label:"Base",media:null},{label:"Tablet ≤991",media:"(max-width: 991px)"},{label:"Phone L ≤767",media:"(max-width: 767px)"},{label:"Phone ≤479",media:"(max-width: 479px)"}];function fe(){return"#e06c75"}function At({entry:e}){const[t,s]=v.useState(!1),i=`${e.file}:${e.line}`,a=`${e.file.split("/").pop()??e.file}:${e.line}`,o=async()=>{try{await navigator.clipboard.writeText(i),s(!0),setTimeout(()=>s(!1),1500)}catch{}};return n.jsx("button",{type:"button","data-testid":"react-source-location",title:`${i} — click to copy the path`,onClick:()=>void o(),style:{fontFamily:H,fontSize:"inherit",color:m.textMuted,cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,background:"none",border:"none",padding:0,textAlign:"left"},children:t?"Copied":a})}function Bt({owner:e,node:t,nodeId:s}){const i=e instanceof D,a=i?e.sourceLocation(s):void 0,o=t?.role==="story"?`Story · ${t.label}`:t?.role==="document"?`CSF · ${t.secondaryLabel??t.label}`:i?"Source":"Session overlay — not written to source",c=t?.role==="story"?`${t.label} is the active portable CSF design state.`:t?.role==="document"?`${t.secondaryLabel??t.label} owns this root's design states.`:i?`Edits change ${t?.label??"this component"}'s source — every rendered instance updates.`:"This is an ingested game: edits persist as a per-project overlay only, never written to source.";return n.jsxs("div",{"data-testid":i?"react-lane-b-disclosure":"react-overlay-disclosure",title:c,style:{display:"flex",alignItems:"center",gap:u[3],padding:`${u[1]} ${u[4]} ${u[3]}`,borderBottom:`1px solid ${m.border}`,color:m.textMuted,fontSize:j.sm,lineHeight:O.normal,minWidth:0},children:[n.jsx("span",{style:{flexShrink:0,...i?{}:{color:m.accent}},children:o}),a&&n.jsx(At,{entry:a})]})}function Ft({adapter:e,node:t,nodeId:s,owner:i}){return n.jsxs("div",{"data-testid":"react-inspector-section",children:[n.jsx(It,{adapter:e,node:t}),i instanceof D&&n.jsx(Mt,{owner:i,nodeId:s}),n.jsx(Bt,{owner:i,node:t,nodeId:s})]})}function te({adapter:e,id:t,name:s,groupId:i,props:a}){const o=v.useMemo(()=>Je(),[]);return n.jsx(Tt,{name:s,groupId:i,props:a,adapter:e,id:t,fonts:o})}function _t(e,t){const s=le(e,t);if(!s||!e)return[];const i=e.id,a=(t.inspector?.properties(i)??[]).filter(l=>l.path!=="name"),{ungrouped:o,groups:c}=be(a),r=[{id:et,title:"Element",icon:je,order:tt,body:{kind:"custom",render:()=>v.createElement(Ft,{adapter:t,node:e,nodeId:i,owner:s}),...s instanceof D?{data:{classes:s.elementClasses(i),breakpoint:U()},editable:{fields:[{path:"element.breakpoint",label:"Breakpoint",type:"enum",options:he.map(l=>l.media??"")}],io:{get:l=>l==="element.breakpoint"?U()??"":void 0,set:(l,d)=>{l==="element.breakpoint"&&oe(typeof d=="string"&&d?d:null)}}}}:{}}}];return e.role==="story"&&s instanceof D&&r.push({id:nt,title:"Story",icon:Se,order:st,body:{kind:"custom",render:()=>v.createElement(Nt,{owner:s,node:e})}}),o.length>0&&r.push({id:ne,title:"Style",icon:Ce,order:ve,defaultOpen:!0,body:{kind:"custom",render:()=>v.createElement(te,{adapter:t,id:i,name:"Style",groupId:"style",props:o})}}),c.forEach((l,d)=>{r.push({id:we(l.groupId),title:l.name,icon:ke(l.name),order:Re+d,defaultOpen:!0,body:{kind:"custom",render:()=>v.createElement(te,{adapter:t,id:i,name:l.name,groupId:l.groupId,props:l.properties})}})}),r}const Dt=xe();function Lt(){Dt.ensure(e=>{e(ye({match:qe,sections:_t,claims:[ne]}))})}const on="workspace.service";function ln(){return Lt(),()=>{}}export{on as point,ln as start};