@volter/game-editor 0.5.155 → 0.5.157
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.
- package/BUNDLED_NOTICES +22 -22
- package/catalog/entries/blender.json +2 -2
- package/catalog/entries/music.json +2 -2
- package/dist/.vite/manifest.json +2156 -2156
- package/dist/assets/{AssetBudgetPanel-B2Wb7-b1.js → AssetBudgetPanel-X38cPCO3.js} +3 -3
- package/dist/assets/{AudioViewer-gge--M-h.js → AudioViewer-xMM7RZH9.js} +1 -1
- package/dist/assets/{CanvasBoardDocument-CyGiXrEJ.js → CanvasBoardDocument-DCyh4eaO.js} +1 -1
- package/dist/assets/{CanvasSceneViewport-ChG9oRS8.js → CanvasSceneViewport-BA8eRjJY.js} +1 -1
- package/dist/assets/{ColorInput-Dzpqy-J3.js → ColorInput-y8NzQ5q8.js} +1 -1
- package/dist/assets/{ColorPicker-CqJPBHlh.js → ColorPicker-C3HI90eU.js} +1 -1
- package/dist/assets/{EntityModelDocument-D7XDf6uB.js → EntityModelDocument-DrWN0e0N.js} +1 -1
- package/dist/assets/{EnvironmentAssetDocument-BgO7Hl3g.js → EnvironmentAssetDocument-Bv8M7C1O.js} +1 -1
- package/dist/assets/{GameplaySessionTimeline-BBmwHCKA.js → GameplaySessionTimeline-mMVtRemn.js} +1 -1
- package/dist/assets/{ImageViewer-BjxoscVa.js → ImageViewer-D1mswm2G.js} +1 -1
- package/dist/assets/InspectorObjectPreview-DMNRuc0X.js +1 -0
- package/dist/assets/{JsonAssetDocument-D81JuRAm.js → JsonAssetDocument-DxLYMceV.js} +1 -1
- package/dist/assets/{LiveModuleDocument-bgStMiU1.js → LiveModuleDocument-BOO4_ypf.js} +1 -1
- package/dist/assets/{LutAssetDocument-cl9Jq0Zw.js → LutAssetDocument-jf9ogNqN.js} +1 -1
- package/dist/assets/{ModelAssetDocument-CYCLKpxJ.js → ModelAssetDocument-DbtKJsGQ.js} +1 -1
- package/dist/assets/{NonThreeAuthoringBootstrap-DhHjvD5d.js → NonThreeAuthoringBootstrap-ChEoVJQP.js} +1 -1
- package/dist/assets/{Object3DDocumentToolbar-CQbARBIW.js → Object3DDocumentToolbar-Y-jpI3WD.js} +1 -1
- package/dist/assets/Object3DDocumentViewport-BOi94JfA.js +2 -0
- package/dist/assets/{Object3DPreview-BOZYzjz_.js → Object3DPreview-7LnLFpmg.js} +1 -1
- package/dist/assets/{OnlineAssetDetail-DdKHHjxg.js → OnlineAssetDetail-DVdZv1D1.js} +1 -1
- package/dist/assets/{PlayBar-CAarfEOh.js → PlayBar-B-GGRbBB.js} +1 -1
- package/dist/assets/{QuarksAssetDocument-GTbawoy7.js → QuarksAssetDocument-2MqOJHlY.js} +1 -1
- package/dist/assets/{ReactCanvasControls-DIFkxeKv.js → ReactCanvasControls-COp1PvO1.js} +1 -1
- package/dist/assets/{RootSelectionOverlay-Dv_w1D9s.js → RootSelectionOverlay-6M-HHI3M.js} +1 -1
- package/dist/assets/{ShaderAssetDocument-OA-nshNN.js → ShaderAssetDocument-PrwCSYxk.js} +1 -1
- package/dist/assets/{ShadowEditor-Cp1QVCo9.js → ShadowEditor-EXaJ1Kud.js} +1 -1
- package/dist/assets/{SourceAssetViewer-CGGHBzgL.js → SourceAssetViewer-Bk_LGk7S.js} +1 -1
- package/dist/assets/{StageHost-BMgCrIPG.js → StageHost-CK78ezTC.js} +2 -2
- package/dist/assets/{StoryPreviewMount-CyF7FwI7.js → StoryPreviewMount-IbbNNzF4.js} +1 -1
- package/dist/assets/{ThreeBoardDocument-DCJkLWU8.js → ThreeBoardDocument-DUakOh0j.js} +2 -2
- package/dist/assets/{ThreeIsolationSceneContent-CxsM-QHW.js → ThreeIsolationSceneContent-BjAyHzL2.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-lsAoRxtr.js → ToolObject3DPreview-CRb_pBHc.js} +1 -1
- package/dist/assets/{Toolbar-yvFlRv8R.js → Toolbar-Bb7KArdo.js} +1 -1
- package/dist/assets/{TransientHint-Bslncm_l.js → TransientHint-BlB2atrU.js} +1 -1
- package/dist/assets/{VideoViewer-Ba-e91kP.js → VideoViewer-D5fNjrcg.js} +1 -1
- package/dist/assets/{ViewportShadingMenu-CgbuQ0e-.js → ViewportShadingMenu-D_-wHbzW.js} +1 -1
- package/dist/assets/{active-ingest-CJ2U5L1O.js → active-ingest-DJ8FmH5M.js} +2 -2
- package/dist/assets/{animation-clock-CVpGQSVj.js → animation-clock-CINkiVZd.js} +1 -1
- package/dist/assets/{animation-mixers.service-CI0K1tfi.js → animation-mixers.service-BST_khGa.js} +1 -1
- package/dist/assets/{animation-timeline.utility-Wg6WxkxK.js → animation-timeline.utility-X54fMzvE.js} +1 -1
- package/dist/assets/{asset-budget-asset.menu-BbCBxjLY.js → asset-budget-asset.menu-CfJth8-V.js} +1 -1
- package/dist/assets/{asset-budget.action-CK8h0v1A.js → asset-budget.action-ByyoIoUI.js} +1 -1
- package/dist/assets/{asset-budget.document-CYVcDLvH.js → asset-budget.document-CO1NrMEa.js} +1 -1
- package/dist/assets/{asset-budget.menu-BcTijQ2R.js → asset-budget.menu-Cb99KwLd.js} +1 -1
- package/dist/assets/{asset-editor-persistence-DWp0E8cc.js → asset-editor-persistence-BF2Eqt0F.js} +1 -1
- package/dist/assets/{asset-loaders-Bo91oPiL.js → asset-loaders-2LtXp4_y.js} +1 -1
- package/dist/assets/{asset-preview-BUpxsHNd.js → asset-preview-t-7PYPjJ.js} +1 -1
- package/dist/assets/{audio-unlock.service-CyiXe5qk.js → audio-unlock.service-DwkIGA6J.js} +1 -1
- package/dist/assets/{audio.utility-BN4mANCx.js → audio.utility-Mn4GcZIb.js} +1 -1
- package/dist/assets/autoplay.service-D7c8d5PV.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-C-EAsfMr.js → babylon-authoring-adapter-BB5HErRG.js} +1 -1
- package/dist/assets/{binding-resolver-DoOAFM2m.js → binding-resolver-CXF3o1ZX.js} +2 -2
- package/dist/assets/{blender-node-editor.document-BzkGPs0i.js → blender-node-editor.document-djNJTSeo.js} +1 -1
- package/dist/assets/{blender-properties-tab-B1ggqOYB.js → blender-properties-tab-06D6TYA0.js} +1 -1
- package/dist/assets/{blender-runtime-host-MJZEPwHA.js → blender-runtime-host-Cqitl1ZO.js} +1 -1
- package/dist/assets/{blender-runtime-skin-hw-op7Nt.js → blender-runtime-skin-RX6nlrgy.js} +72 -58
- package/dist/assets/{blender-runtime.document-CvTyAou8.js → blender-runtime.document-pgD63Zep.js} +10 -10
- package/dist/assets/{blender-screenshot.menu-C4VXpXVa.js → blender-screenshot.menu-DZ44fIU0.js} +1 -1
- package/dist/assets/{blender-timeline.document-BRFDd7JZ.js → blender-timeline.document-D53mR9D6.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-CM09ITWu.js → blender-uv-editor.document-Dux9ZXaj.js} +1 -1
- package/dist/assets/{blender-version.status-CPyc_-kA.js → blender-version.status-hK0_7tRC.js} +1 -1
- package/dist/assets/{blender.command-ktKz-2Zi.js → blender.command-BF9RHCP_.js} +1 -1
- package/dist/assets/{board-guides-CCiyx8cT.js → board-guides-BYnclES1.js} +1 -1
- package/dist/assets/{bridge.command-tP5j6w72.js → bridge.command-CS12Cp-B.js} +3 -3
- package/dist/assets/{browserAll-BSQVVrNG.js → browserAll-CGQ_uBbB.js} +1 -1
- package/dist/assets/{build-player.document-BwbBXtF5.js → build-player.document-RpeG8U_t.js} +1 -1
- package/dist/assets/{build-profiles.document-UiF_BsjE.js → build-profiles.document-DydU-eTF.js} +1 -1
- package/dist/assets/{build-progress.status-Bf5KpnxC.js → build-progress.status-arvTBGok.js} +1 -1
- package/dist/assets/{build-session-C4jVDt-u.js → build-session-D8B-93_A.js} +1 -1
- package/dist/assets/{build.action-DP2d1Uhj.js → build.action-CYKD0CrB.js} +1 -1
- package/dist/assets/{build.command-D5pyNcoj.js → build.command-BH-4yWaL.js} +1 -1
- package/dist/assets/{build.header-DupBIAOw.js → build.header-B5-bZp5Z.js} +1 -1
- package/dist/assets/{build.menu-DWrKtdoV.js → build.menu-CyOe8xXz.js} +1 -1
- package/dist/assets/{build.service-qnz73gSX.js → build.service-BuhAa1EB.js} +1 -1
- package/dist/assets/{camera-C74U5X7o.js → camera-KM5i-TaU.js} +1 -1
- package/dist/assets/{camera-runtime.inspector-B2l34Xhl.js → camera-runtime.inspector-DA-GqhBI.js} +1 -1
- package/dist/assets/{canvas-design-mount-D4M3E1AX.js → canvas-design-mount-PWQPVLiY.js} +3 -3
- package/dist/assets/{canvas-entry-runtime-CLOuJcgT.js → canvas-entry-runtime-nWfnVKYb.js} +2 -2
- package/dist/assets/{canvas-preview-frames-CSCcu2sG.js → canvas-preview-frames-BwWVTr-u.js} +1 -1
- package/dist/assets/{canvas-story-capture.service-onD_xSpQ.js → canvas-story-capture.service-B1o-VBky.js} +2 -2
- package/dist/assets/{capability-coverage-EnZ99FoT.js → capability-coverage-aT7nf05J.js} +1 -1
- package/dist/assets/{collaboration-presence-1_UMOAkw.js → collaboration-presence-h1Fxju0A.js} +1 -1
- package/dist/assets/{collider-C6R1tHfa.js → collider-BDLEjrr-.js} +1 -1
- package/dist/assets/{component-board.service-Ckl-5tA4.js → component-board.service-CetsHh4L.js} +2 -2
- package/dist/assets/{component-board.service-Cuf_SXeA.js → component-board.service-DAeFLAlB.js} +2 -2
- package/dist/assets/{component-board.service-BX_2bwX3.js → component-board.service-qH45JxuD.js} +2 -2
- package/dist/assets/{component-contracts.service-rI-rbvDG.js → component-contracts.service-nYhZ_ceu.js} +1 -1
- package/dist/assets/{component-instance-root-wO1p-rLr.js → component-instance-root-QYCCyhxU.js} +1 -1
- package/dist/assets/{component-verbs.command-O2bwqmK3.js → component-verbs.command-y1H2CFq-.js} +1 -1
- package/dist/assets/{component-verbs.service-BiiQMtJt.js → component-verbs.service-QvBBdzY3.js} +1 -1
- package/dist/assets/{config-dVnV1cxW.js → config-YwJJtCF0.js} +2 -2
- package/dist/assets/{configurations-8qaUqMH7.js → configurations-B52h5RGp.js} +1 -1
- package/dist/assets/{connection.status-vH9WCDDg.js → connection.status-DnEU1lk4.js} +1 -1
- package/dist/assets/{constraints.inspector-C7UjUxPR.js → constraints.inspector-DgbM_8l2.js} +1 -1
- package/dist/assets/{content-bounds-Dl5Y3LLv.js → content-bounds-BRS42hfD.js} +1 -1
- package/dist/assets/{contract-system-adapters-BDUpDoKd.js → contract-system-adapters-DIpeIRm_.js} +1 -1
- package/dist/assets/{coverage.service-IS7Oklo8.js → coverage.service-Cjy9MO9F.js} +1 -1
- package/dist/assets/{create-runtime-Bucz0XVU.js → create-runtime-ByZWXstA.js} +1 -1
- package/dist/assets/{curve-D0Q6TczG.js → curve-DaFJmPin.js} +1 -1
- package/dist/assets/{data-asset-B0a1y8M-.js → data-asset-DRCqFyxF.js} +1 -1
- package/dist/assets/{data-ref-dRt2Wi5L.js → data-ref-CkvCIusA.js} +1 -1
- package/dist/assets/{debug-bridge-EhDkhrLX.js → debug-bridge-C7NLsHKu.js} +1 -1
- package/dist/assets/{debug-registry-B2THKz1v.js → debug-registry-BzagDrhV.js} +1 -1
- package/dist/assets/{deferred-ingest-play-To3ZratW.js → deferred-ingest-play-DMp_yRhc.js} +2 -2
- package/dist/assets/{design-time-canvas-mount-BnSaRAbS.js → design-time-canvas-mount-kB1ZRIvt.js} +2 -2
- package/dist/assets/{design-time-layers-OMAIxOrv.js → design-time-layers-Dzu3jW_N.js} +1 -1
- package/dist/assets/{design-time-mount.service-RFkiqPIn.js → design-time-mount.service-CLEJHBLW.js} +2 -2
- package/dist/assets/{design-time-mount.service-Bgr_nCDs.js → design-time-mount.service-Dgswmfff.js} +2 -2
- package/dist/assets/{design-time-react-mount-BsSBoX7J.js → design-time-react-mount-B71UACVS.js} +1 -1
- package/dist/assets/{document-preview-three-Qni0oVBw.js → document-preview-three-DxAxdZRF.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-DsUgOtQy.js → dom-authoring-adapter-CQiwffQ4.js} +1 -1
- package/dist/assets/{draco3d-DyZllcka.js → draco3d-CWfPSgkb.js} +1 -1
- package/dist/assets/{edit-mode-audio.service-CjXNAZEs.js → edit-mode-audio.service-CikRAHOi.js} +1 -1
- package/dist/assets/{edit-mode-authoring-BDgZD47j.js → edit-mode-authoring-DthrLbz-.js} +1 -1
- package/dist/assets/{edit-mode-networking.service-3dUr2g_0.js → edit-mode-networking.service-DBmK8YGU.js} +1 -1
- package/dist/assets/{editor-api-DTrNJMXL.js → editor-api-CqqOlRSi.js} +1 -1
- package/dist/assets/{editor-layers-DwaX5UFy.js → editor-layers-k0AjpomL.js} +1 -1
- package/dist/assets/{editor-shell-store-aKHbAoCV.js → editor-shell-store-B3c29A3l.js} +1 -1
- package/dist/assets/{entity-object-BLJ-I8XT.js → entity-object-BOLh6DVA.js} +1 -1
- package/dist/assets/{extend-6LrR7eSL.js → extend-CJ7vLkP1.js} +1 -1
- package/dist/assets/{fork-menu-V-FM6YuY.js → fork-menu-Bzl-5_GA.js} +1 -1
- package/dist/assets/{frame-debugger-store-DwDC0wAm.js → frame-debugger-store-NGsJt0AK.js} +1 -1
- package/dist/assets/{game-contract-seams-C22a4B79.js → game-contract-seams-CuBiefwV.js} +1 -1
- package/dist/assets/{game-css-scope-transform-Wv0ZdTsR.js → game-css-scope-transform-5yv5zl6t.js} +1 -1
- package/dist/assets/{game-document.service-BzvFIWCc.js → game-document.service-DtML_s2L.js} +1 -1
- package/dist/assets/{game-eval.command-DpQn_nY8.js → game-eval.command-Cghc-6r3.js} +1 -1
- package/dist/assets/{game-module-access-BI6oBa8Y.js → game-module-access-DPnqfsy_.js} +1 -1
- package/dist/assets/{game-network-Deo8lcPw.js → game-network-TjOj3K-Z.js} +3 -3
- package/dist/assets/{gameplay-export-BOLhxmII.js → gameplay-export-ebDdiP9T.js} +1 -1
- package/dist/assets/{gameplay-replay-Dkvmv6hf.js → gameplay-replay-B4BPQnTZ.js} +1 -1
- package/dist/assets/{gameplay.command-DCKqLv7C.js → gameplay.command-C__OjBjz.js} +1 -1
- package/dist/assets/{generation-jobs-6D562vMB.js → generation-jobs-C57_oOgx.js} +1 -1
- package/dist/assets/{generation.service-BFRoLb7y.js → generation.service-BJel-Oiy.js} +1 -1
- package/dist/assets/{generations-HwV1btKK.js → generations-DNfmqqzL.js} +1 -1
- package/dist/assets/{generations.status-BLiDcKsg.js → generations.status-nXpY7bFU.js} +1 -1
- package/dist/assets/{hierarchy-marks-DeG4E4Ke.js → hierarchy-marks-C2temlO0.js} +1 -1
- package/dist/assets/{hosted-asset-materialization-Bod7CEMF.js → hosted-asset-materialization-BtbO5pyX.js} +1 -1
- package/dist/assets/{index-CLUA6PYq.js → index-7J5pTwW2.js} +1 -1
- package/dist/assets/{index-KIR4Has5.js → index-B5GZkByz.js} +1 -1
- package/dist/assets/{index-CdLhNxor.js → index-B69_nH5F.js} +1 -1
- package/dist/assets/{index-ClgrFOcX.js → index-BfqJPhFO.js} +7 -7
- package/dist/assets/{index-DkYeh000.js → index-BiH6f3Mk.js} +1 -1
- package/dist/assets/{index-CHOT9sYh.js → index-CFS_B4hc.js} +2 -2
- package/dist/assets/{index-CyLPQ8pY.js → index-DYoPv2Wb.js} +1 -1
- package/dist/assets/{index-4hL3-0yz.js → index-my7iu018.js} +1 -1
- package/dist/assets/{index-jS3rfNkZ.js → index-zXacXllH.js} +1 -1
- package/dist/assets/{inference-diagnostics-BmZ5ggEK.js → inference-diagnostics-NvA3SRR7.js} +1 -1
- package/dist/assets/{ingest-boot-viewport-CipkFljr.js → ingest-boot-viewport-DHhBi66w.js} +1 -1
- package/dist/assets/{ingest-siblings-CEwYp-xg.js → ingest-siblings-CMWO3uRZ.js} +1 -1
- package/dist/assets/{ingest-source-persistence-CVU1rTj0.js → ingest-source-persistence-CrXFBT__.js} +1 -1
- package/dist/assets/{ingest.service-bNqvcqoK.js → ingest.service-BYEo4j1s.js} +1 -1
- package/dist/assets/{inspect-BunjdqX7.js → inspect-UxYR9Ls5.js} +1 -1
- package/dist/assets/instances.command-DDOJ3aWq.js +1 -0
- package/dist/assets/{json-history-resource-CDEoQe1R.js → json-history-resource-De8KJl61.js} +1 -1
- package/dist/assets/{layered-pick-guh6WlA7.js → layered-pick-Dito5b_J.js} +1 -1
- package/dist/assets/{light-BPZivpCK.js → light-BnSS9Nzc.js} +1 -1
- package/dist/assets/{live-project-verbs-Bqmxbr2o.js → live-project-verbs-CDRzC_D1.js} +1 -1
- package/dist/assets/{machine.document-CAFPFq5K.js → machine.document-CVG78EGi.js} +1 -1
- package/dist/assets/{machines.finder-CbUWReMp.js → machines.finder-vrUR_Pb_.js} +1 -1
- package/dist/assets/{material-huG6lNEK.js → material-7mmxSi8g.js} +1 -1
- package/dist/assets/{material-factory-BkyOzJ7B.js → material-factory-CXvJ2goL.js} +1 -1
- package/dist/assets/{mesh-CjCfRcFK.js → mesh-DpK09Vho.js} +1 -1
- package/dist/assets/{model-asset-sections.service-Dt4V2K2v.js → model-asset-sections.service-ByE7kOXW.js} +1 -1
- package/dist/assets/{model-inspection-BDA5jikL.js → model-inspection-PgxfYOnI.js} +1 -1
- package/dist/assets/{model-thumbnail-CF3qGQWb.js → model-thumbnail-Dnv7DCt7.js} +1 -1
- package/dist/assets/{models.finder-yh4YeGrA.js → models.finder-BaD41xeQ.js} +1 -1
- package/dist/assets/{module-mode-D8en13PD.js → module-mode-Bb9fFtEw.js} +2 -2
- package/dist/assets/{mount-canvas-ingest-root-JOkm2Ypj.js → mount-canvas-ingest-root-B0_ckx79.js} +2 -2
- package/dist/assets/{mount-dom-ingest-root-CVXFnJZb.js → mount-dom-ingest-root-BnZQSayp.js} +2 -2
- package/dist/assets/{mount-ingest-root-C3o0o28C.js → mount-ingest-root-DHVNQKHi.js} +2 -2
- package/dist/assets/{mount-manifest-d7WQ9MYp.js → mount-manifest-cYykTsXQ.js} +1 -1
- package/dist/assets/{mount-three-ingest-root-Dqd4XWP1.js → mount-three-ingest-root-CI-gjlh8.js} +1 -1
- package/dist/assets/{mounted-authoring-B697dYuN.js → mounted-authoring-B2dc__pv.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-BvNZ3QQn.js → mounted-story-viewport-source-Ceh05FK8.js} +1 -1
- package/dist/assets/{native-debug-module-iX2-V5kg.js → native-debug-module-L_Ofssyj.js} +1 -1
- package/dist/assets/{navigation-CIl9OY1F.js → navigation-CADCnkrx.js} +1 -1
- package/dist/assets/{navmesh.menu-DrMoj7Ag.js → navmesh.menu-3D6ZEGhB.js} +1 -1
- package/dist/assets/{navmesh.service-CTr1NVfz.js → navmesh.service-D_TdU1xw.js} +1 -1
- package/dist/assets/network-observer.service-D9nUCc15.js +1 -0
- package/dist/assets/{network.utility-Btexm5ao.js → network.utility-B3riF8KT.js} +1 -1
- package/dist/assets/{object3d-document-session-registry-CADiW-LP.js → object3d-document-session-registry-CLizyhis.js} +2 -2
- package/dist/assets/{oid-transform-Ca1oU_Ei.js → oid-transform-CinlfHYa.js} +1 -1
- package/dist/assets/{particles-D1oPwNJh.js → particles--V50tPi5.js} +1 -1
- package/dist/assets/{pixi-authoring-adapter-B1BBfTju.js → pixi-authoring-adapter-qbP0YW7g.js} +1 -1
- package/dist/assets/{pixi-live-write-target-BcUhtqmJ.js → pixi-live-write-target-coTAFFGW.js} +1 -1
- package/dist/assets/{play.command-ScnwcvJr.js → play.command-kc7rzTlg.js} +2 -2
- package/dist/assets/{presentation-DPfnCjNA.js → presentation-jBjhcEq1.js} +1 -1
- package/dist/assets/{product-D_9saRiZ.js → product-DgYRVeaY.js} +1 -1
- package/dist/assets/{profiler.action-PXTw93E5.js → profiler.action-Dj94ZJLY.js} +1 -1
- package/dist/assets/{profiler.menu-DPFV6QQD.js → profiler.menu-BHplCv7a.js} +1 -1
- package/dist/assets/{profiler.utility-eDooJGnI.js → profiler.utility-D32oIOGk.js} +1 -1
- package/dist/assets/{project-authoring-session-BmeutotA.js → project-authoring-session-Cd8SeWEJ.js} +2 -2
- package/dist/assets/{properties-bone-constraints.inspector-BW0V1WXQ.js → properties-bone-constraints.inspector-VPTHP6BI.js} +1 -1
- package/dist/assets/{properties-bone.inspector-DIvTZhY8.js → properties-bone.inspector-4GD1gzCp.js} +1 -1
- package/dist/assets/{properties-collection.inspector-Dbt5XMhs.js → properties-collection.inspector-CehoAair.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-5SvB0GDC.js → properties-constraints.inspector-LgPoqURT.js} +1 -1
- package/dist/assets/{properties-data.inspector-C-SngIsI.js → properties-data.inspector-D3uEJD3t.js} +1 -1
- package/dist/assets/{properties-material.inspector-CYAWsvsX.js → properties-material.inspector-2n9K5IFo.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-XN6BL-Ll.js → properties-modifiers.inspector-B_RsuDyF.js} +1 -1
- package/dist/assets/{properties-object.inspector-CfryU0kN.js → properties-object.inspector-CBZA72yZ.js} +1 -1
- package/dist/assets/{properties-output.inspector-COfgmFUW.js → properties-output.inspector-DxDAmKI-.js} +1 -1
- package/dist/assets/{properties-particles.inspector-BCh0vFr6.js → properties-particles.inspector-pPS920CT.js} +1 -1
- package/dist/assets/{properties-physics.inspector-B6to1u6U.js → properties-physics.inspector-XUnPp5Q3.js} +1 -1
- package/dist/assets/{properties-render.inspector-C4hVfo7j.js → properties-render.inspector-DnC4sgP3.js} +1 -1
- package/dist/assets/{properties-scene.inspector-dKta4xn5.js → properties-scene.inspector-MZ-gCrYM.js} +1 -1
- package/dist/assets/{properties-texture.inspector-ZlNhW25m.js → properties-texture.inspector-B7QGBzm5.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-CIxHmkDR.js → properties-view-layer.inspector-rt2qT9SA.js} +1 -1
- package/dist/assets/{properties-world.inspector-Ce0q2dmK.js → properties-world.inspector-Vg7GD9HK.js} +1 -1
- package/dist/assets/{r3f-design-session-1riISktt.js → r3f-design-session-DfRwB6oN.js} +2 -2
- package/dist/assets/{r3f-physics-binding-DuG97FR9.js → r3f-physics-binding-EfYECbQc.js} +1 -1
- package/dist/assets/{r3f-source-authoring-adapter-B8qqrdwk.js → r3f-source-authoring-adapter-CVupdJt5.js} +1 -1
- package/dist/assets/{react-canvas-navigation-CxBm8iw8.js → react-canvas-navigation-DwiPTVdH.js} +1 -1
- package/dist/assets/{react-inspector.service-BcdePwno.js → react-inspector.service-DffkStxd.js} +1 -1
- package/dist/assets/{react-story-board-CMvkLAkF.js → react-story-board-CynnmKqO.js} +1 -1
- package/dist/assets/{react-three-rapier.esm-D5svf-ME.js → react-three-rapier.esm-DnUfnQnM.js} +1 -1
- package/dist/assets/{react-world-authoring-adapter-Dq8NqvWu.js → react-world-authoring-adapter-Cf1jv2dl.js} +1 -1
- package/dist/assets/{realm-services-CqjVBanw.js → realm-services-CxfLBQQ9.js} +1 -1
- package/dist/assets/{reflection-probe-capture.inspector-uEvyppEj.js → reflection-probe-capture.inspector-DfzDNtJF.js} +1 -1
- package/dist/assets/{registry-D7lFIA8c.js → registry-69pUwZEm.js} +1 -1
- package/dist/assets/{relative-import-specifier-CA9mSNXO.js → relative-import-specifier-J1WeZQaJ.js} +1 -1
- package/dist/assets/{render-env-BHasp-z3.js → render-env-CmR-momj.js} +1 -1
- package/dist/assets/{render-features-sSb1-c5x.js → render-features-D7pQr-dE.js} +1 -1
- package/dist/assets/{render-settings-CUbo4Sw5.js → render-settings-BUT8gPkc.js} +1 -1
- package/dist/assets/{resolve-three-TQ367RQD.js → resolve-three-Dhw2LtAp.js} +3 -3
- package/dist/assets/{root-seam-contract-CneTgNww.js → root-seam-contract-BFs0rvG9.js} +1 -1
- package/dist/assets/{run-selection-CNsOQTEG.js → run-selection-CEuu_sxz.js} +1 -1
- package/dist/assets/{scene-capture-KbdRgsD3.js → scene-capture-DgUSqWTB.js} +1 -1
- package/dist/assets/{scene-document.service-CmPSUocW.js → scene-document.service-BDDoO22G.js} +2 -2
- package/dist/assets/{scene-framing-B5JC4NeG.js → scene-framing-Dm-rCn3G.js} +1 -1
- package/dist/assets/{seeded-random-B6zqGkWP.js → seeded-random-C9256-Ag.js} +1 -1
- package/dist/assets/{setup-renderer-efjIBSGF.js → setup-renderer-CWvtkVDR.js} +1 -1
- package/dist/assets/{source-object3d-authoring-adapter-DeeboYub.js → source-object3d-authoring-adapter-ehtz9UK_.js} +1 -1
- package/dist/assets/{source-persistence-backend-Cwy93SmQ.js → source-persistence-backend-CbCbDOjd.js} +1 -1
- package/dist/assets/{stage-keyboard-GNCaTXLA.js → stage-keyboard-DiRyZTZd.js} +1 -1
- package/dist/assets/{stage-overlay-set-DV3SCzJb.js → stage-overlay-set-6pmCmKpX.js} +1 -1
- package/dist/assets/{stage-presence-markers-CBEU1Kzo.js → stage-presence-markers-mZPecAeK.js} +1 -1
- package/dist/assets/{stage-transform-tools-C9nNDW6n.js → stage-transform-tools-Qc0QjPrc.js} +1 -1
- package/dist/assets/{standard-viewport-dressing-BJkGwiNT.js → standard-viewport-dressing-BhTPIZTQ.js} +1 -1
- package/dist/assets/{state-watch.action-Doz_jrzS.js → state-watch.action-DJfW26od.js} +1 -1
- package/dist/assets/{state-watch.menu-Dj4DUUxN.js → state-watch.menu-B1GRE_HT.js} +1 -1
- package/dist/assets/{state-watch.utility-COPa8xpV.js → state-watch.utility-BQaTOFU-.js} +1 -1
- package/dist/assets/{story-capture-stRSY4PQ.js → story-capture-DZNUtuCH.js} +1 -1
- package/dist/assets/{story-documents-CYzWYY1o.js → story-documents-DArOiGNt.js} +1 -1
- package/dist/assets/{story-documents.service-DJBu4rve.js → story-documents.service-Bi89tZQ5.js} +1 -1
- package/dist/assets/{story-documents.service-C5r8KFEG.js → story-documents.service-DaPhxnzw.js} +1 -1
- package/dist/assets/{story-media-presence-D4AIsAtK.js → story-media-presence-CMJ7U-7_.js} +1 -1
- package/dist/assets/{story-pixi-preview-mPo3OFOd.js → story-pixi-preview-jmF1ab99.js} +1 -1
- package/dist/assets/{story-presentation-Dw4Vw65P.js → story-presentation-DNXF37vS.js} +1 -1
- package/dist/assets/{story-three-preview-CWM0Rj7x.js → story-three-preview-CH6Kk934.js} +2 -2
- package/dist/assets/{studio-environment-Bw9zMFE8.js → studio-environment-BNM-AjAn.js} +1 -1
- package/dist/assets/{surface-state-b_H4iOCJ.js → surface-state-BLuxJ4lb.js} +1 -1
- package/dist/assets/{syntactic-prop-specs-BCdwWi-T.js → syntactic-prop-specs-Coas9J4z.js} +1 -1
- package/dist/assets/{team-playtest.service-CnxdTghn.js → team-playtest.service-C3cEeDBv.js} +1 -1
- package/dist/assets/{three-DWy0sZom.js → three-BvhtsSAr.js} +1 -1
- package/dist/assets/{three-authoring-adapter-9LcUBPaU.js → three-authoring-adapter-K8a5THvW.js} +1 -1
- package/dist/assets/three-authoring.service-D-uSiCHc.js +2 -0
- package/dist/assets/{three-ingest-runtime-x9nLmUl-.js → three-ingest-runtime-QhrURliQ.js} +1 -1
- package/dist/assets/{three-integration-DB-xQHD5.js → three-integration-CaC8ivB7.js} +2 -2
- package/dist/assets/three-integration.service-BvTtbtlD.js +1 -0
- package/dist/assets/{three-projection-core-IUovHgg_.js → three-projection-core-C2Zj6hTy.js} +1 -1
- package/dist/assets/{three-state-_ImCbP87.js → three-state-cYB28OIz.js} +1 -1
- package/dist/assets/{three-story-capture.service-wKwfSnqA.js → three-story-capture.service-H2Z2O7Nz.js} +2 -2
- package/dist/assets/{three-story-model-BxWKcl9d.js → three-story-model-DVfgIOzi.js} +1 -1
- package/dist/assets/{three-viewport-presentation-Bg86EsDJ.js → three-viewport-presentation-DoViPvQB.js} +1 -1
- package/dist/assets/{transform-mode-request-BnV8FSnx.js → transform-mode-request-CflM_ccL.js} +1 -1
- package/dist/assets/{transport-strip-BZQnaxFN.js → transport-strip-DPoEy7PU.js} +1 -1
- package/dist/assets/transport.header-DdI58npA.js +1 -0
- package/dist/assets/{tuples-DR33sMq6.js → tuples-CA3u4T9B.js} +1 -1
- package/dist/assets/{ui-board-document-VJMvm6Ks.js → ui-board-document-CoKY7MDM.js} +2 -2
- package/dist/assets/{user-data-DL6HsBPf.js → user-data-CTT8ZvVB.js} +1 -1
- package/dist/assets/{utility-view-state-ghWXsYXq.js → utility-view-state-BaO3Fx_-.js} +1 -1
- package/dist/assets/{viewport-door-BV_lf5uK.js → viewport-door-BBtilr3V.js} +1 -1
- package/dist/assets/{viewport-root-presentation-CKqhX3mt.js → viewport-root-presentation-DmDBAZ8E.js} +1 -1
- package/dist/assets/{viewport-surface-status-D7M2L2lI.js → viewport-surface-status-BiDiAZ6z.js} +1 -1
- package/dist/assets/{webworkerAll-DDbFvxgB.js → webworkerAll-BCvjBZqG.js} +1 -1
- package/dist/assets/{workspace-arrangement-86_8Kk5K.js → workspace-arrangement-BXM0R-Uu.js} +1 -1
- package/dist/assets/{world-documents-DeNJUefV.js → world-documents-DGk_J8cp.js} +1 -1
- package/dist/assets/{world-root-stage-binding-VOrldLB4.js → world-root-stage-binding-KaIVpo80.js} +1 -1
- package/dist/assets/{xstate-animation-binding-747CfEeB.js → xstate-animation-binding-D_kxRsxS.js} +1 -1
- package/dist/assets/{xstate-animation-meta-DNMlMnr-.js → xstate-animation-meta-CX5oWqQv.js} +1 -1
- package/dist-node/cli.js +16 -16
- package/package.json +16 -16
- package/dist/assets/InspectorObjectPreview-C87CasN_.js +0 -1
- package/dist/assets/Object3DDocumentViewport-BpiyRQ5p.js +0 -2
- package/dist/assets/autoplay.service-CKBqjozr.js +0 -1
- package/dist/assets/instances.command-DzcXdKuG.js +0 -1
- package/dist/assets/network-observer.service-DyzpGKA7.js +0 -1
- package/dist/assets/three-authoring.service-DdTMF4A2.js +0 -2
- package/dist/assets/three-integration.service-DwToRGIc.js +0 -1
- package/dist/assets/transport.header-1SF4ZbEd.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r as B,et as C,al as o,er as c,a6 as k,aS as Y,aN as O,dV as D,eJ as Z,e$ as tt}from"./index-ClgrFOcX.js";import{N as et}from"./game-network-Deo8lcPw.js";import{r as f}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-iX2-V5kg.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B2THKz1v.js";import"./contract-system-adapters-BDUpDoKd.js";import"./game-contract-seams-C22a4B79.js";import"./seeded-random-B6zqGkWP.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-DzuOGwVB.js";import"./live-project-verbs-Bqmxbr2o.js";import"./capability-coverage-EnZ99FoT.js";import"./edit-mode-authoring-BDgZD47j.js";import"./json-history-resource-CDEoQe1R.js";import"./binding-resolver-DoOAFM2m.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CqjVBanw.js";import"./canvas-entry-runtime-CLOuJcgT.js";import"./three-ingest-runtime-x9nLmUl-.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-CJ2U5L1O.js";import"./ingest-source-persistence-CVU1rTj0.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CKqhX3mt.js";import"./mounted-authoring-B697dYuN.js";import"./entity-object-BLJ-I8XT.js";import"./user-data-DL6HsBPf.js";import"./workspace-arrangement-86_8Kk5K.js";import"./three-contract-Dkt6PmWY.js";import"./three-DWy0sZom.js";import"./editor-layers-DwaX5UFy.js";import"./component-instance-root-wO1p-rLr.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-9LcUBPaU.js";import"./source-persistence-backend-Cwy93SmQ.js";import"./three-projection-core-IUovHgg_.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-DuG97FR9.js";import"./deferred-ingest-play-To3ZratW.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-Dq8NqvWu.js";import"./board-guides-CCiyx8cT.js";import"./relative-import-specifier-CA9mSNXO.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BunjdqX7.js";import"./inference-diagnostics-BmZ5ggEK.js";import"./writer-tw6EcuVO.js";import"./three-state-_ImCbP87.js";import"./editor-shell-store-aKHbAoCV.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-BV_lf5uK.js";import"./game-surface-defaults-D8S4cRxi.js";function nt(e){return e?{connectionState:e.getConnectionState?.(),roomInfo:e.getRoomInfo?.(),stats:e.getReplicationStats?.()}:null}function st(e){return e?{stateTree:typeof e.getStateSnapshot=="function",messageLog:typeof e.messageEvents=="function",rates:typeof e.getRates=="function",conditioning:typeof e.getConditioning=="function"&&typeof e.setConditioning=="function",connection:typeof e.getConnectionState=="function",room:typeof e.getRoomInfo=="function",stats:typeof e.getReplicationStats=="function",identity:typeof e.getPlayerIdentity=="function",identitySettable:typeof e.setPlayerIdentity=="function",traffic:typeof e.getTrafficByType=="function",send:typeof e.sendMessage=="function",ping:typeof e.ping=="function",server:typeof e.inspectServer=="function",entityTraffic:typeof e.getTrafficByEntity=="function",recording:typeof e.isRecording=="function"&&typeof e.setRecording=="function"}:null}class _{constructor(n=500){this.capacity=n}entries=[];lastSeq=0;paused=!1;pull(n){if(this.paused||!n?.messageEvents)return 0;const s=n.messageEvents(this.lastSeq);if(s.length===0)return 0;for(const i of s)this.entries.push(i),i.seq>this.lastSeq&&(this.lastSeq=i.seq);return this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),s.length}get all(){return this.entries}clear(){this.entries=[]}}function it(e,n){const s=n.trim().toLowerCase();return s?e.filter(i=>i.type.toLowerCase().includes(s)):[...e]}class P{constructor(n=60){this.capacity=n}values=[];push(n){this.values.push(n),this.values.length>this.capacity&&this.values.shift()}get data(){return this.values}get latest(){return this.values.length>0?this.values[this.values.length-1]:null}}class V{msgsIn=new P;msgsOut=new P;bytesIn=new P;bytesOut=new P;sample(n){this.msgsIn.push(n.msgsInPerSec),this.msgsOut.push(n.msgsOutPerSec),n.bytesInPerSec!==void 0&&this.bytesIn.push(n.bytesInPerSec),n.bytesOutPerSec!==void 0&&this.bytesOut.push(n.bytesOutPerSec)}}function ot(e,n,s,i=1){if(e.length<2)return"";const a=Math.max(1,...e),l=s-i*2,u=n/(e.length-1);return e.map((y,S)=>{const v=S*u,h=i+l*(1-y/a);return`${v.toFixed(1)},${h.toFixed(1)}`}).join(" ")}const rt={disconnected:o.content.muted,connecting:o.semantic.warning,connected:o.semantic.success,error:o.semantic.danger},N={fontFamily:o.typography.mono,fontSize:C.base};function T({children:e,testId:n}){return t.jsx("div",{"data-testid":n,style:{padding:c[4],color:o.content.muted,fontSize:C.base,fontStyle:"italic"},children:e})}function lt(e){return e!==null&&typeof e=="object"}function at(e){return typeof e=="string"?`"${e}"`:typeof e=="number"?Number.isInteger(e)?String(e):e.toFixed(3):String(e)}function J({type:e}){return e?t.jsx("span",{"data-testid":"net-tree-type",style:{color:o.content.dim,marginLeft:6},children:e}):null}function H({name:e,value:n,depth:s,path:i=[],edit:a,remove:l,typeOf:u}){const[y,S]=f.useState(s===0),[v,h]=f.useState(null),[x,m]=f.useState(null),d={...N,paddingLeft:8+s*14,lineHeight:"18px",whiteSpace:"nowrap"};if(!lt(n)){const j=a&&(typeof n=="number"||typeof n=="string"||typeof n=="boolean"),$=p=>{h(null),a?.(i,p).then(()=>m(null),I=>m(I instanceof Error?I.message:String(I)))},E=p=>{if(typeof n=="number"){const I=Number(p);return Number.isFinite(I)?I:n}return p};return t.jsxs("div",{style:d,"data-testid":"net-tree-leaf","data-path":i.join("."),children:[t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsx("span",{style:{color:o.content.muted},children:": "}),v!==null?t.jsx(O,{"data-testid":"net-tree-edit",autoFocus:!0,value:v,onChange:p=>h(p.target.value),onKeyDown:p=>{p.key==="Enter"&&$(E(v)),p.key==="Escape"&&h(null)},onBlur:()=>h(null),style:{width:120}}):t.jsx("span",{"data-testid":j?"net-tree-value":void 0,title:j?typeof n=="boolean"?"Click to toggle on the server":"Click to edit on the server":void 0,style:{color:o.content.primary,cursor:j?"text":void 0},onClick:j?()=>typeof n=="boolean"?$(!n):h(String(n)):void 0,children:at(n)}),t.jsx(J,{type:i.length>0?u?.(i):null}),l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:()=>l(i).then(()=>m(null),p=>m(p instanceof Error?p.message:String(p))),style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null,x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null]})}const g=Object.entries(n);return t.jsxs("div",{children:[t.jsxs("div",{style:{...d,cursor:"pointer",userSelect:"none"},"data-testid":"net-tree-branch","data-expanded":y||void 0,onClick:()=>S(j=>!j),children:[t.jsx("span",{style:{color:o.content.muted,display:"inline-block",width:12},children:t.jsx(Z,{direction:y?"down":"right"})}),t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsxs("span",{style:{color:o.content.dim},children:[" ",Array.isArray(n)?`[${g.length}]`:`{${g.length}}`]}),t.jsx(J,{type:i.length>0?u?.(i):null}),x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null,l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:j=>{j.stopPropagation(),l(i).then(()=>m(null),$=>m($ instanceof Error?$.message:String($)))},style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null]}),y&&g.map(([j,$])=>t.jsx(H,{name:j,value:$,depth:s+1,path:s===0?[j]:[...i,j],edit:a,remove:l,typeOf:u},j))]})}const U=96,G=22,dt=f.memo(function({points:n,color:s}){return t.jsx("svg",{width:U,height:G,style:{display:"block",background:o.surface.inset,borderRadius:o.shape.small},role:"img","aria-label":"rate sparkline",children:n&&t.jsx("polyline",{points:n,fill:"none",stroke:s,strokeWidth:1.2})})});function F({label:e,series:n,unit:s,color:i,testId:a}){const l=n.latest;return t.jsxs("div",{"data-testid":a,style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsxs("div",{style:{fontSize:C.sm,color:o.content.muted},children:[e," ",t.jsx("span",{style:{color:o.content.primary,fontFamily:o.typography.mono},children:l===null?"n/a":`${l}${s}`})]}),t.jsx(dt,{points:ot(n.data,U,G),color:i})]})}function ct({event:e}){const n=e.direction==="in"?o.semantic.success:o.accent.default;return t.jsxs("div",{"data-testid":"net-log-row","data-direction":e.direction,style:{...N,display:"grid",gridTemplateColumns:"64px 24px 1fr 56px",gap:c[2],lineHeight:"17px",padding:`0 ${c[4]}`,opacity:e.dropped?.55:1},children:[t.jsxs("span",{style:{color:o.content.dim},children:[(e.time/1e3).toFixed(2),"s"]}),t.jsx("span",{style:{color:n},children:e.direction==="in"?"↓in":"↑out"}),t.jsxs("span",{style:{color:o.content.primary,textDecoration:e.dropped?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis"},children:[e.type,e.dropped?" (dropped)":""]}),t.jsx("span",{style:{color:o.content.muted,textAlign:"right"},children:e.size!==void 0?`${e.size} B`:"—"})]})}function pt({adapter:e}){const[n,s]=f.useState(()=>e.getConditioning?.()??{latencyMs:0,jitterMs:0,packetLoss:0}),i=e.getConditioningLimits?.()??{},a=l=>{s(l),e.setConditioning?.(l)};return t.jsxs("div",{"data-testid":"net-conditioner",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Conditioner"}),t.jsx(D,{label:"latency ms",value:n.latencyMs,step:10,testId:"net-cond-latency",onChange:l=>a({...n,latencyMs:Math.max(0,l)})}),t.jsx(D,{label:"jitter ms",value:n.jitterMs,step:5,testId:"net-cond-jitter",onChange:l=>a({...n,jitterMs:Math.max(0,l)})}),i.packetLoss?t.jsx("span",{"data-testid":"net-cond-loss-absent",title:i.packetLoss,style:{fontSize:C.sm,color:o.content.muted},children:"loss: not simulated"}):t.jsx(D,{label:"loss %",value:n.packetLoss*100,step:5,testId:"net-cond-loss",onChange:l=>a({...n,packetLoss:Math.min(1,Math.max(0,l/100))})})]})}function ut({adapter:e,settable:n}){const[s,i]=f.useState(()=>e.getPlayerIdentity?.()?.name??""),a=()=>{const l=s.trim();l&&e.setPlayerIdentity?.({name:l})};return t.jsxs("div",{"data-testid":"net-identity",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Player name"}),n?t.jsx(O,{"data-testid":"net-identity-name",value:s,onChange:l=>i(l.target.value),onBlur:a,onKeyDown:l=>{l.key==="Enter"&&l.currentTarget.blur()},style:{width:140}}):t.jsx("span",{"data-testid":"net-identity-name",style:{...N,color:o.content.primary},children:s||"—"})]})}function yt({view:e,caps:n,rates:s}){return t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:c[6],alignItems:"center",padding:`${c[2]} ${c[4]}`,borderBottom:`1px solid ${o.boundary.default}`},children:[e.connectionState!==void 0?t.jsxs("span",{"data-testid":"net-connection-state",style:{color:rt[e.connectionState]},children:["● ",e.connectionState]}):t.jsx(T,{testId:"net-connection-state-absent",children:"Connection state not provided by this adapter."}),e.roomInfo===void 0?t.jsx(T,{testId:"net-room-absent",children:"Room info not provided by this adapter."}):e.roomInfo?t.jsxs("span",{style:{...N,color:o.content.primary},children:[e.roomInfo.roomName," · ",e.roomInfo.roomId," · session ",e.roomInfo.sessionId]}):t.jsx("span",{style:{color:o.content.muted},children:"no room"}),e.stats?t.jsxs("span",{style:{color:o.content.muted},children:["entities ",t.jsx("span",{style:{color:o.content.primary},children:e.stats.entities})]}):t.jsx(T,{testId:"net-stats-absent",children:"Replication stats not provided by this adapter."}),n.rates?t.jsxs("div",{"data-testid":"net-sparklines",style:{display:"flex",gap:c[5]},children:[t.jsx(F,{label:"msgs in",unit:"/s",series:s.msgsIn,color:o.semantic.success,testId:"net-rate-msgs-in"}),t.jsx(F,{label:"msgs out",unit:"/s",series:s.msgsOut,color:o.accent.default,testId:"net-rate-msgs-out"}),t.jsx(F,{label:"bytes in",unit:" B/s",series:s.bytesIn,color:o.semantic.success,testId:"net-rate-bytes-in"}),t.jsx(F,{label:"bytes out",unit:" B/s",series:s.bytesOut,color:o.accent.default,testId:"net-rate-bytes-out"})]}):t.jsx(T,{testId:"net-rates-absent",children:"Rates not provided by this adapter."})]})}const K=et,W="networkMessageDraft";function mt(){const[,e]=f.useReducer(p=>p+1,0),n=f.useRef(new _),s=f.useRef(new V),i=f.useRef(null),[a,l]=f.useState(!1),[u,y]=f.useState(""),[S,v]=f.useState(()=>B().projectLocalState.read(K)??!1),[h,x]=f.useState(()=>B().projectLocalState.read(W)??{type:"message_type",payload:"{}"}),m=p=>{B().projectLocalState.write(W,p),x(p)};f.useEffect(()=>{const p=()=>{const M=B().systems.inspectedNetworking()??null;return M!==i.current&&(i.current=M,n.current=new _,n.current.paused=a,s.current=new V),M},I=()=>{const M=p();n.current.pull(M),e()};I();const L=setInterval(I,250),w=setInterval(()=>{const r=p()?.getRates?.();r&&s.current.sample(r)},1e3),R=B().systems.inspectedNetworking()?.subscribe(()=>e());return()=>{clearInterval(L),clearInterval(w),R?.()}},[a]);const d=i.current??B().systems.inspectedNetworking()??null,g=st(d);if(!d||!g)return t.jsxs("div",{"data-testid":"network-inspector-empty",style:{padding:c[8],color:o.content.muted,fontSize:C.md,lineHeight:"18px"},children:[t.jsx("div",{style:{color:o.content.primary,marginBottom:c[2]},children:"No networking adapter is registered."}),"Games expose replication state to this inspector by registering a"," ",t.jsx("code",{style:N,children:"NetworkingAdapter"})," during setup:"," ",t.jsx("code",{style:N,children:"ctx.registerSystemAdapter?.('networking', adapter)"})," — see the third-person-arena example. Single-player games register none; there is nothing to inspect."]});const j=nt(d),$=g.stateTree?d.getStateSnapshot?.():void 0,E=it(n.current.all,u);return t.jsxs("div",{"data-testid":"network-inspector",className:"volter-content-frost",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",fontSize:C.md},children:[t.jsx(yt,{view:j,caps:g,rates:s.current}),g.identity?t.jsx(ut,{adapter:d,settable:g.identitySettable},d.getPlayerIdentity?.()?.name??""):null,g.conditioning?t.jsx(pt,{adapter:d}):t.jsx(T,{testId:"net-conditioner-absent",children:"Link conditioning not provided by this adapter."}),g.server?t.jsx(vt,{adapter:d,ownSession:j.roomInfo?.sessionId??null,ownRoom:j.roomInfo?.roomId??null,draft:h,setDraft:m}):null,g.recording||g.traffic?t.jsxs("div",{"data-testid":"net-profiler-bar",style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2],borderBottom:`1px solid ${o.boundary.default}`},children:[g.recording?t.jsx(t.Fragment,{children:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-recording","aria-pressed":d.isRecording?.()===!0,onClick:()=>{d.setRecording?.(!d.isRecording?.()),e()},children:d.isRecording?.()?"Stop":"Start"})}):null,t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-clear",onClick:()=>{n.current.clear(),d.clearTraffic?.(),e()},children:"Clear"}),g.recording?t.jsxs("label",{style:{display:"flex",gap:c[1],alignItems:"center",whiteSpace:"nowrap"},children:[t.jsx(Y,{"data-testid":"net-autostart",checked:S,onChange:p=>{const I=p.currentTarget.checked;B().projectLocalState.write(K,I),v(I)}}),"Autostart"]}):null]}):null,g.traffic?t.jsx(bt,{rows:d.getTrafficByType?.()??[]}):null,g.entityTraffic?t.jsx(ht,{rows:d.getTrafficByEntity?.()??[]}):null,g.send?t.jsx(St,{adapter:d,ping:g.ping,draft:h,setDraft:m}):null,t.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[t.jsx("div",{"data-testid":"net-state-tree",style:{flex:1,minWidth:0,overflow:"auto",borderRight:`1px solid ${o.boundary.default}`,padding:`${c[2]} 0`},children:g.stateTree?$!=null?t.jsx(H,{name:"state",value:$,depth:0,edit:d.editServerState?(p,I)=>d.editServerState(p,I):void 0,remove:d.deleteServerState?p=>d.deleteServerState(p):void 0,typeOf:d.stateFieldType?p=>d.stateFieldType(p):void 0}):t.jsx(T,{children:"Not connected — no replicated state to show."}):t.jsx(T,{testId:"net-tree-absent",children:"Replicated-state snapshot not provided by this adapter."})}),t.jsx("div",{"data-testid":"net-message-log",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:g.messageLog?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2]},children:[g.recording?null:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-pause",onClick:()=>{const p=!a;n.current.paused=p,l(p)},children:a?"Resume":"Pause"}),t.jsx(O,{"data-testid":"net-log-filter",placeholder:"Filter by type",value:u,onChange:p=>y(p.target.value),style:{flex:1,minWidth:60}}),t.jsxs("span",{style:{fontSize:C.sm,color:o.content.muted},children:[E.length,"/",n.current.all.length]})]}),t.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto"},children:E.length===0?t.jsx(T,{children:"No messages captured yet."}):E.map(p=>t.jsx(ct,{event:p},p.seq))})]}):t.jsx(T,{testId:"net-log-absent",children:"Message log not provided by this adapter."})})]})]})}function ht({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"};return t.jsx("div",{"data-testid":"net-entity-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx(T,{children:"No state patches yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...N},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Entity"}),t.jsx("th",{style:n,title:"Syncs in - out, as Godot pairs them: the state patches that changed it, and none out, because a Colyseus client sends no state",children:"Count"}),t.jsx("th",{style:n,title:"Field changes those patches carried",children:"Changes"}),t.jsx("th",{style:n,title:"Size in - out: the size range of the patches that carried it (they carried other entities too), and none out",children:"Size"})]})}),t.jsx("tbody",{children:e.map(s=>t.jsxs("tr",{"data-testid":"net-entity-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:s.path}),t.jsx("td",{style:n,children:`${s.syncs} - 0`}),t.jsx("td",{style:n,children:s.changes}),t.jsx("td",{style:n,children:`${s.patchBytesMin===s.patchBytesMax?`${s.patchBytesMin} B`:`${s.patchBytesMin}…${s.patchBytesMax} B`} - 0 B`})]},s.path))})]})})}function gt(e){try{return JSON.parse(e)}catch{return e}}function xt({text:e,onChange:n}){const[s,i]=f.useState("tree");let a;try{a=e.trim()===""?{}:JSON.parse(e)}catch{a=void 0}const l=u=>n(JSON.stringify(u));return t.jsxs("div",{"data-testid":"net-payload-editor",style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("div",{style:{display:"flex",gap:c[1]},children:["tree","text"].map(u=>t.jsx(k,{type:"button",variant:"ghost","aria-pressed":s===u,"data-testid":`net-payload-view-${u}`,onClick:()=>i(u),children:u==="tree"?"Tree":"Text"},u))}),s==="text"||a===void 0?t.jsxs(t.Fragment,{children:[t.jsx(tt,{"data-testid":"net-send-dialog-payload",rows:6,value:e,onChange:u=>n(u.target.value),style:N}),a===void 0?t.jsx("span",{style:{color:o.content.muted},children:"Not JSON yet, so the tree cannot show it."}):null]}):t.jsx("div",{style:{...N,fontSize:C.sm},children:t.jsx(X,{value:a,onChange:l,depth:0})})]})}function X({value:e,onChange:n,depth:s}){const[i,a]=f.useState(""),[l,u]=f.useState(""),y={paddingLeft:s*12};if(e!==null&&typeof e=="object"){const S=Array.isArray(e),v=S?e.map((m,d)=>[String(d),m]):Object.entries(e),h=(m,d)=>{n(S?e.map((g,j)=>String(j)===m?d:g):{...e,[m]:d})},x=m=>{n(S?e.filter((d,g)=>String(g)!==m):Object.fromEntries(Object.entries(e).filter(([d])=>d!==m)))};return t.jsxs("div",{"data-testid":"net-payload-branch",children:[v.map(([m,d])=>t.jsxs("div",{style:y,children:[t.jsxs("span",{style:{color:o.content.muted},children:[m,": "]}),d!==null&&typeof d=="object"?t.jsx("span",{style:{color:o.content.muted},children:Array.isArray(d)?"[":"{"}):null,t.jsx("button",{type:"button","data-testid":"net-payload-remove",title:`Remove ${m}`,onClick:()=>x(m),style:{background:"none",border:0,color:o.content.muted,cursor:"pointer"},children:"×"}),d!==null&&typeof d=="object"?t.jsx(X,{value:d,onChange:g=>h(m,g),depth:s+1}):t.jsx(q,{value:d,onChange:g=>h(m,g)})]},m)),t.jsxs("div",{style:{...y,display:"flex",gap:c[1]},children:[S?null:t.jsx(O,{"data-testid":"net-payload-new-key",placeholder:"key",value:i,onChange:m=>a(m.target.value),style:{width:90}}),t.jsx(O,{"data-testid":"net-payload-new-value",placeholder:"value",value:l,onChange:m=>u(m.target.value),style:{width:110}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-payload-add",disabled:!S&&i.trim()==="",onClick:()=>{const m=gt(l);n(S?[...e,m]:{...e,[i.trim()]:m}),a(""),u("")},children:"Add"})]})]})}return t.jsx(q,{value:e,onChange:n})}function q({value:e,onChange:n}){const s=e===null?"null":typeof e=="number"?"number":typeof e=="boolean"?"boolean":"string",i=s==="string"?String(e):JSON.stringify(e),[a,l]=f.useState(i);f.useEffect(()=>l(i),[i]);const u=(y,S)=>{if(y==="null")return null;if(y==="boolean")return S.trim()==="true";if(y==="number"){const v=Number(S);return Number.isFinite(v)?v:0}return S};return t.jsxs("span",{style:{display:"inline-flex",gap:4},children:[s==="boolean"?t.jsx("input",{type:"checkbox","data-testid":"net-payload-leaf-boolean",checked:e===!0,onChange:y=>n(y.currentTarget.checked)}):s==="null"?t.jsx("span",{style:{color:o.content.muted},children:"null"}):t.jsx(O,{"data-testid":"net-payload-leaf",value:a,onChange:y=>l(y.target.value),onBlur:()=>n(u(s,a)),onKeyDown:y=>{y.key==="Enter"&&n(u(s,a))},style:{width:120}}),t.jsx("select",{"data-testid":"net-payload-leaf-type","aria-label":"Value type",value:s,onChange:y=>n(u(y.currentTarget.value,a)),children:["string","number","boolean","null"].map(y=>t.jsx("option",{value:y,children:y},y))})]})}const ft=[["name","Name"],["roomId","Room"],["clients","Clients"],["locked","Locked"],["elapsedMs","Elapsed"]];function jt(e,n){const s=i=>{const a=i[n.key];return typeof a=="number"?a:typeof a=="boolean"?Number(a):String(a)};return[...e].sort((i,a)=>{const l=s(i),u=s(a),y=l<u?-1:l>u?1:0;return n.descending?-y:y})}function bt({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"},s=i=>i>=1024?`${(i/1024).toFixed(1)} KiB`:`${i} B`;return t.jsx("div",{"data-testid":"net-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx(T,{children:"No traffic yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...N},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Type"}),t.jsx("th",{style:n,children:"In"}),t.jsx("th",{style:n,children:"Bytes in"}),t.jsx("th",{style:n,children:"Out"}),t.jsx("th",{style:n,children:"Bytes out"})]})}),t.jsx("tbody",{children:e.map(i=>t.jsxs("tr",{"data-testid":"net-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:i.type}),t.jsx("td",{style:n,children:i.countIn||"-"}),t.jsx("td",{style:n,children:i.countIn?s(i.bytesIn):"-"}),t.jsx("td",{style:n,children:i.countOut||"-"}),t.jsx("td",{style:n,children:i.countOut?s(i.bytesOut):"-"})]},i.type))})]})})}function Q(e){if(e.type.trim()==="")throw new Error("Name the message type first.");return{type:e.type,payload:e.payload.trim()===""?void 0:JSON.parse(e.payload)}}function St({adapter:e,ping:n,draft:s,setDraft:i}){const[a,l]=f.useState(null),u=()=>{l("…"),e.ping?.().then(h=>l(`${h} ms`),h=>l(h instanceof Error?h.message:String(h)))},[y,S]=f.useState(null),v=()=>{try{const h=Q(s);e.sendMessage?.(h.type,h.payload),S(null)}catch(h){S(h instanceof Error?h.message:String(h))}};return t.jsxs("div",{"data-testid":"net-send",style:{display:"flex",gap:c[2],alignItems:"center",padding:c[2]},children:[t.jsx(O,{"data-testid":"net-send-type",placeholder:"Message type",value:s.type,onChange:h=>i({...s,type:h.target.value}),style:{width:140}}),t.jsx(O,{"data-testid":"net-send-payload",placeholder:'Payload (JSON), e.g. {"x": 1}',value:s.payload,onChange:h=>i({...s,payload:h.target.value}),style:{flex:1,minWidth:80}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-send-button",disabled:s.type.trim()==="",onClick:v,children:"Send as this client"}),n?t.jsxs(t.Fragment,{children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-ping",onClick:u,children:"Ping"}),a?t.jsx("span",{"data-testid":"net-rtt",style:{fontSize:C.sm,...N},children:a}):null]}):null,y?t.jsx("span",{"data-testid":"net-send-error",style:{color:o.semantic.danger,fontSize:C.sm},children:y}):null]})}function vt({adapter:e,ownSession:n,ownRoom:s,draft:i,setDraft:a}){const[l,u]=f.useState(null),[y,S]=f.useState(null),[v,h]=f.useState("clients"),[x,m]=f.useState(void 0),[d,g]=f.useState(void 0),[j,$]=f.useState({key:"elapsedMs",descending:!0}),[E,p]=f.useState(null);f.useEffect(()=>{let r=!0;const b=()=>{e.inspectServer?.(d).then(A=>{r&&m(A)},A=>{r&&p(A instanceof Error?A.message:String(A))})};b();const z=setInterval(b,2e3);return()=>{r=!1,clearInterval(z)}},[e,d]);const I=r=>{try{r()?.then(()=>p(null),b=>p(b instanceof Error?b.message:String(b)))}catch(b){p(b instanceof Error?b.message:String(b))}},L=r=>`${Math.round(r/1e3)} s`,w={padding:`0 ${c[3]}`,whiteSpace:"nowrap"};if(x===void 0)return null;if(x===null)return t.jsx(T,{testId:"net-server-absent",children:"The room server serves no Monitor view (its `server` configuration sets VOLTER_ROOM_MONITOR=1)."});const R=x.room?.roomId,M=(r,b,z)=>t.jsx(k,{type:"button",variant:"ghost","data-testid":r,onClick:()=>I(z),children:b});return t.jsxs("div",{"data-testid":"net-server",style:{padding:`${c[2]} 0`,borderBottom:`1px solid ${o.boundary.default}`,fontSize:C.sm},children:[t.jsxs("div",{"data-testid":"net-server-summary",style:{padding:`0 ${c[3]}`,color:o.content.muted},children:["Server · ",x.rooms.length," room",x.rooms.length===1?"":"s"," · ",x.connections," ","connection",x.connections===1?"":"s",x.cpuPercent!==null?` · CPU ${x.cpuPercent.toFixed(0)}%`:"",x.memory?` · memory ${Math.round(x.memory.usedMb)} / ${Math.round(x.memory.totalMb)} MB`:"",x.room?` · state ${x.room.stateBytes} B`:""]}),t.jsxs("table",{style:{borderCollapse:"collapse",...N},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[ft.map(([r,b])=>t.jsxs("th",{"data-testid":`net-server-sort-${r}`,"aria-sort":j.key===r?j.descending?"descending":"ascending":"none",style:{...w,textAlign:"left",cursor:"pointer",fontWeight:"normal"},onClick:()=>$({key:r,descending:j.key===r?!j.descending:!1}),children:[b,j.key===r?j.descending?" ▾":" ▴":""]},r)),t.jsx("th",{style:w})]})}),t.jsx("tbody",{children:jt(x.rooms,j).map(r=>t.jsxs("tr",{"data-testid":"net-server-room","data-inspected":r.roomId===R||void 0,children:[t.jsx("td",{style:w,children:r.name}),t.jsx("td",{style:w,children:r.roomId}),t.jsxs("td",{style:w,children:[r.clients,r.maxClients!==null?` / ${r.maxClients}`:""," clients"]}),t.jsx("td",{style:w,children:r.locked?"locked":"open"}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,children:[r.roomId===R?t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-broadcast",onClick:()=>{S(null),u({sessionId:null})},children:"Broadcast"}):t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-inspect",onClick:()=>g(r.roomId),children:"Inspect"}),M("net-server-dispose","Dispose",()=>e.disposeRoom?.(r.roomId))]})]},r.roomId))})]}),l?t.jsxs("div",{"data-testid":"net-send-dialog",role:"group","aria-labelledby":"net-send-dialog-title",style:{margin:c[2],padding:c[3],border:`1px solid ${o.boundary.default}`,borderRadius:4},children:[t.jsx("div",{id:"net-send-dialog-title",style:{color:o.content.primary,marginBottom:c[2]},children:l.sessionId?`Send message to client (${l.sessionId})`:"Broadcast message to all clients"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:c[2]},children:[t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message type"}),t.jsx(O,{"data-testid":"net-send-dialog-type",value:i.type,onChange:r=>a({...i,type:r.target.value})})]}),t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message payload (JSON)"}),t.jsx(xt,{text:i.payload,onChange:r=>a({...i,payload:r})})]}),y?t.jsx("span",{"data-testid":"net-send-dialog-error",children:y}):null]}),t.jsxs("div",{style:{display:"flex",gap:c[2],justifyContent:"flex-end",marginTop:c[2]},children:[t.jsx(k,{type:"button",variant:"ghost",onClick:()=>u(null),children:"Cancel"}),t.jsx(k,{type:"button","data-testid":"net-send-dialog-send",onClick:()=>{const r=l;(async()=>{try{const b=Q(i);await(r.sessionId?e.sendToClient?.(r.sessionId,b.type,b.payload,R):e.broadcast?.(b.type,b.payload,R)),S(null),u(null)}catch(b){S(b instanceof Error?b.message:String(b))}})()},children:"Send"})]})]}):null,x.room?t.jsxs("div",{"data-testid":"net-server-room-view",style:{padding:`${c[2]} 0`},children:[t.jsx("div",{role:"tablist",style:{display:"flex",gap:c[2],padding:`0 ${c[3]}`},children:[["clients",`Clients (${x.room.clients.length})`],["state","State"]].map(([r,b])=>t.jsx(k,{type:"button",variant:"ghost",role:"tab","aria-selected":v===r,"data-testid":`net-server-tab-${r}`,onClick:()=>h(r),children:b},r))}),v==="clients"?t.jsx("table",{style:{borderCollapse:"collapse",...N},children:t.jsx("tbody",{children:x.room.clients.map(r=>t.jsxs("tr",{"data-testid":"net-server-client",children:[t.jsx("td",{style:w,children:"client"}),t.jsxs("td",{style:w,children:[r.sessionId,r.sessionId===n?" (this client)":""]}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,colSpan:3,children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-send",onClick:()=>{S(null),u({sessionId:r.sessionId})},children:"Send"}),M("net-server-disconnect","Disconnect",()=>e.disconnectClient?.(r.sessionId,R))]})]},r.sessionId))})}):x.room.state!==void 0?t.jsx("div",{"data-testid":"net-server-room-state",children:t.jsx(H,{name:`room ${x.room.roomId}${x.room.roomId===s?" (this client’s room)":""}`,value:x.room.state,depth:0,edit:e.editServerState?(r,b)=>e.editServerState(r,b,R):void 0,remove:e.deleteServerState?r=>e.deleteServerState(r,R):void 0})}):t.jsx(T,{children:"The server sent no state for this room."})]}):null,E?t.jsx(T,{children:E}):null]})}const Ge="workspace.utility",Xe="Network",Qe=25,Ye=()=>B().systems.inspectedNetworking()!==null;function Ze(){return t.jsx(mt,{})}export{Ye as available,Ze as default,Qe as order,Ge as point,Xe as title};
|
|
1
|
+
import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r as B,et as C,al as o,er as c,a6 as k,aS as Y,aN as O,dV as D,eJ as Z,e$ as tt}from"./index-BfqJPhFO.js";import{N as et}from"./game-network-TjOj3K-Z.js";import{r as f}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-L_Ofssyj.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-BzagDrhV.js";import"./contract-system-adapters-DIpeIRm_.js";import"./game-contract-seams-CuBiefwV.js";import"./seeded-random-C9256-Ag.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-DmeaOP4r.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-DzuOGwVB.js";import"./live-project-verbs-CDRzC_D1.js";import"./capability-coverage-aT7nf05J.js";import"./edit-mode-authoring-DthrLbz-.js";import"./json-history-resource-De8KJl61.js";import"./binding-resolver-CXF3o1ZX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CxfLBQQ9.js";import"./canvas-entry-runtime-nWfnVKYb.js";import"./three-ingest-runtime-QhrURliQ.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-DJ8FmH5M.js";import"./ingest-source-persistence-CrXFBT__.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DmDBAZ8E.js";import"./mounted-authoring-B2dc__pv.js";import"./entity-object-BOLh6DVA.js";import"./user-data-CTT8ZvVB.js";import"./workspace-arrangement-BXM0R-Uu.js";import"./three-contract-Dkt6PmWY.js";import"./three-BvhtsSAr.js";import"./editor-layers-k0AjpomL.js";import"./component-instance-root-QYCCyhxU.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-K8a5THvW.js";import"./source-persistence-backend-CbCbDOjd.js";import"./three-projection-core-C2Zj6hTy.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-EfYECbQc.js";import"./deferred-ingest-play-DMp_yRhc.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-Cf1jv2dl.js";import"./board-guides-BYnclES1.js";import"./relative-import-specifier-J1WeZQaJ.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-UxYR9Ls5.js";import"./inference-diagnostics-NvA3SRR7.js";import"./writer-tw6EcuVO.js";import"./three-state-cYB28OIz.js";import"./editor-shell-store-B3c29A3l.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-BBtilr3V.js";import"./game-surface-defaults-D8S4cRxi.js";function nt(e){return e?{connectionState:e.getConnectionState?.(),roomInfo:e.getRoomInfo?.(),stats:e.getReplicationStats?.()}:null}function st(e){return e?{stateTree:typeof e.getStateSnapshot=="function",messageLog:typeof e.messageEvents=="function",rates:typeof e.getRates=="function",conditioning:typeof e.getConditioning=="function"&&typeof e.setConditioning=="function",connection:typeof e.getConnectionState=="function",room:typeof e.getRoomInfo=="function",stats:typeof e.getReplicationStats=="function",identity:typeof e.getPlayerIdentity=="function",identitySettable:typeof e.setPlayerIdentity=="function",traffic:typeof e.getTrafficByType=="function",send:typeof e.sendMessage=="function",ping:typeof e.ping=="function",server:typeof e.inspectServer=="function",entityTraffic:typeof e.getTrafficByEntity=="function",recording:typeof e.isRecording=="function"&&typeof e.setRecording=="function"}:null}class _{constructor(n=500){this.capacity=n}entries=[];lastSeq=0;paused=!1;pull(n){if(this.paused||!n?.messageEvents)return 0;const s=n.messageEvents(this.lastSeq);if(s.length===0)return 0;for(const i of s)this.entries.push(i),i.seq>this.lastSeq&&(this.lastSeq=i.seq);return this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),s.length}get all(){return this.entries}clear(){this.entries=[]}}function it(e,n){const s=n.trim().toLowerCase();return s?e.filter(i=>i.type.toLowerCase().includes(s)):[...e]}class P{constructor(n=60){this.capacity=n}values=[];push(n){this.values.push(n),this.values.length>this.capacity&&this.values.shift()}get data(){return this.values}get latest(){return this.values.length>0?this.values[this.values.length-1]:null}}class V{msgsIn=new P;msgsOut=new P;bytesIn=new P;bytesOut=new P;sample(n){this.msgsIn.push(n.msgsInPerSec),this.msgsOut.push(n.msgsOutPerSec),n.bytesInPerSec!==void 0&&this.bytesIn.push(n.bytesInPerSec),n.bytesOutPerSec!==void 0&&this.bytesOut.push(n.bytesOutPerSec)}}function ot(e,n,s,i=1){if(e.length<2)return"";const a=Math.max(1,...e),l=s-i*2,u=n/(e.length-1);return e.map((y,S)=>{const v=S*u,h=i+l*(1-y/a);return`${v.toFixed(1)},${h.toFixed(1)}`}).join(" ")}const rt={disconnected:o.content.muted,connecting:o.semantic.warning,connected:o.semantic.success,error:o.semantic.danger},N={fontFamily:o.typography.mono,fontSize:C.base};function T({children:e,testId:n}){return t.jsx("div",{"data-testid":n,style:{padding:c[4],color:o.content.muted,fontSize:C.base,fontStyle:"italic"},children:e})}function lt(e){return e!==null&&typeof e=="object"}function at(e){return typeof e=="string"?`"${e}"`:typeof e=="number"?Number.isInteger(e)?String(e):e.toFixed(3):String(e)}function J({type:e}){return e?t.jsx("span",{"data-testid":"net-tree-type",style:{color:o.content.dim,marginLeft:6},children:e}):null}function H({name:e,value:n,depth:s,path:i=[],edit:a,remove:l,typeOf:u}){const[y,S]=f.useState(s===0),[v,h]=f.useState(null),[x,m]=f.useState(null),d={...N,paddingLeft:8+s*14,lineHeight:"18px",whiteSpace:"nowrap"};if(!lt(n)){const j=a&&(typeof n=="number"||typeof n=="string"||typeof n=="boolean"),$=p=>{h(null),a?.(i,p).then(()=>m(null),I=>m(I instanceof Error?I.message:String(I)))},E=p=>{if(typeof n=="number"){const I=Number(p);return Number.isFinite(I)?I:n}return p};return t.jsxs("div",{style:d,"data-testid":"net-tree-leaf","data-path":i.join("."),children:[t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsx("span",{style:{color:o.content.muted},children:": "}),v!==null?t.jsx(O,{"data-testid":"net-tree-edit",autoFocus:!0,value:v,onChange:p=>h(p.target.value),onKeyDown:p=>{p.key==="Enter"&&$(E(v)),p.key==="Escape"&&h(null)},onBlur:()=>h(null),style:{width:120}}):t.jsx("span",{"data-testid":j?"net-tree-value":void 0,title:j?typeof n=="boolean"?"Click to toggle on the server":"Click to edit on the server":void 0,style:{color:o.content.primary,cursor:j?"text":void 0},onClick:j?()=>typeof n=="boolean"?$(!n):h(String(n)):void 0,children:at(n)}),t.jsx(J,{type:i.length>0?u?.(i):null}),l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:()=>l(i).then(()=>m(null),p=>m(p instanceof Error?p.message:String(p))),style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null,x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null]})}const g=Object.entries(n);return t.jsxs("div",{children:[t.jsxs("div",{style:{...d,cursor:"pointer",userSelect:"none"},"data-testid":"net-tree-branch","data-expanded":y||void 0,onClick:()=>S(j=>!j),children:[t.jsx("span",{style:{color:o.content.muted,display:"inline-block",width:12},children:t.jsx(Z,{direction:y?"down":"right"})}),t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsxs("span",{style:{color:o.content.dim},children:[" ",Array.isArray(n)?`[${g.length}]`:`{${g.length}}`]}),t.jsx(J,{type:i.length>0?u?.(i):null}),x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null,l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:j=>{j.stopPropagation(),l(i).then(()=>m(null),$=>m($ instanceof Error?$.message:String($)))},style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null]}),y&&g.map(([j,$])=>t.jsx(H,{name:j,value:$,depth:s+1,path:s===0?[j]:[...i,j],edit:a,remove:l,typeOf:u},j))]})}const U=96,G=22,dt=f.memo(function({points:n,color:s}){return t.jsx("svg",{width:U,height:G,style:{display:"block",background:o.surface.inset,borderRadius:o.shape.small},role:"img","aria-label":"rate sparkline",children:n&&t.jsx("polyline",{points:n,fill:"none",stroke:s,strokeWidth:1.2})})});function F({label:e,series:n,unit:s,color:i,testId:a}){const l=n.latest;return t.jsxs("div",{"data-testid":a,style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsxs("div",{style:{fontSize:C.sm,color:o.content.muted},children:[e," ",t.jsx("span",{style:{color:o.content.primary,fontFamily:o.typography.mono},children:l===null?"n/a":`${l}${s}`})]}),t.jsx(dt,{points:ot(n.data,U,G),color:i})]})}function ct({event:e}){const n=e.direction==="in"?o.semantic.success:o.accent.default;return t.jsxs("div",{"data-testid":"net-log-row","data-direction":e.direction,style:{...N,display:"grid",gridTemplateColumns:"64px 24px 1fr 56px",gap:c[2],lineHeight:"17px",padding:`0 ${c[4]}`,opacity:e.dropped?.55:1},children:[t.jsxs("span",{style:{color:o.content.dim},children:[(e.time/1e3).toFixed(2),"s"]}),t.jsx("span",{style:{color:n},children:e.direction==="in"?"↓in":"↑out"}),t.jsxs("span",{style:{color:o.content.primary,textDecoration:e.dropped?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis"},children:[e.type,e.dropped?" (dropped)":""]}),t.jsx("span",{style:{color:o.content.muted,textAlign:"right"},children:e.size!==void 0?`${e.size} B`:"—"})]})}function pt({adapter:e}){const[n,s]=f.useState(()=>e.getConditioning?.()??{latencyMs:0,jitterMs:0,packetLoss:0}),i=e.getConditioningLimits?.()??{},a=l=>{s(l),e.setConditioning?.(l)};return t.jsxs("div",{"data-testid":"net-conditioner",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Conditioner"}),t.jsx(D,{label:"latency ms",value:n.latencyMs,step:10,testId:"net-cond-latency",onChange:l=>a({...n,latencyMs:Math.max(0,l)})}),t.jsx(D,{label:"jitter ms",value:n.jitterMs,step:5,testId:"net-cond-jitter",onChange:l=>a({...n,jitterMs:Math.max(0,l)})}),i.packetLoss?t.jsx("span",{"data-testid":"net-cond-loss-absent",title:i.packetLoss,style:{fontSize:C.sm,color:o.content.muted},children:"loss: not simulated"}):t.jsx(D,{label:"loss %",value:n.packetLoss*100,step:5,testId:"net-cond-loss",onChange:l=>a({...n,packetLoss:Math.min(1,Math.max(0,l/100))})})]})}function ut({adapter:e,settable:n}){const[s,i]=f.useState(()=>e.getPlayerIdentity?.()?.name??""),a=()=>{const l=s.trim();l&&e.setPlayerIdentity?.({name:l})};return t.jsxs("div",{"data-testid":"net-identity",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Player name"}),n?t.jsx(O,{"data-testid":"net-identity-name",value:s,onChange:l=>i(l.target.value),onBlur:a,onKeyDown:l=>{l.key==="Enter"&&l.currentTarget.blur()},style:{width:140}}):t.jsx("span",{"data-testid":"net-identity-name",style:{...N,color:o.content.primary},children:s||"—"})]})}function yt({view:e,caps:n,rates:s}){return t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:c[6],alignItems:"center",padding:`${c[2]} ${c[4]}`,borderBottom:`1px solid ${o.boundary.default}`},children:[e.connectionState!==void 0?t.jsxs("span",{"data-testid":"net-connection-state",style:{color:rt[e.connectionState]},children:["● ",e.connectionState]}):t.jsx(T,{testId:"net-connection-state-absent",children:"Connection state not provided by this adapter."}),e.roomInfo===void 0?t.jsx(T,{testId:"net-room-absent",children:"Room info not provided by this adapter."}):e.roomInfo?t.jsxs("span",{style:{...N,color:o.content.primary},children:[e.roomInfo.roomName," · ",e.roomInfo.roomId," · session ",e.roomInfo.sessionId]}):t.jsx("span",{style:{color:o.content.muted},children:"no room"}),e.stats?t.jsxs("span",{style:{color:o.content.muted},children:["entities ",t.jsx("span",{style:{color:o.content.primary},children:e.stats.entities})]}):t.jsx(T,{testId:"net-stats-absent",children:"Replication stats not provided by this adapter."}),n.rates?t.jsxs("div",{"data-testid":"net-sparklines",style:{display:"flex",gap:c[5]},children:[t.jsx(F,{label:"msgs in",unit:"/s",series:s.msgsIn,color:o.semantic.success,testId:"net-rate-msgs-in"}),t.jsx(F,{label:"msgs out",unit:"/s",series:s.msgsOut,color:o.accent.default,testId:"net-rate-msgs-out"}),t.jsx(F,{label:"bytes in",unit:" B/s",series:s.bytesIn,color:o.semantic.success,testId:"net-rate-bytes-in"}),t.jsx(F,{label:"bytes out",unit:" B/s",series:s.bytesOut,color:o.accent.default,testId:"net-rate-bytes-out"})]}):t.jsx(T,{testId:"net-rates-absent",children:"Rates not provided by this adapter."})]})}const K=et,W="networkMessageDraft";function mt(){const[,e]=f.useReducer(p=>p+1,0),n=f.useRef(new _),s=f.useRef(new V),i=f.useRef(null),[a,l]=f.useState(!1),[u,y]=f.useState(""),[S,v]=f.useState(()=>B().projectLocalState.read(K)??!1),[h,x]=f.useState(()=>B().projectLocalState.read(W)??{type:"message_type",payload:"{}"}),m=p=>{B().projectLocalState.write(W,p),x(p)};f.useEffect(()=>{const p=()=>{const M=B().systems.inspectedNetworking()??null;return M!==i.current&&(i.current=M,n.current=new _,n.current.paused=a,s.current=new V),M},I=()=>{const M=p();n.current.pull(M),e()};I();const L=setInterval(I,250),w=setInterval(()=>{const r=p()?.getRates?.();r&&s.current.sample(r)},1e3),R=B().systems.inspectedNetworking()?.subscribe(()=>e());return()=>{clearInterval(L),clearInterval(w),R?.()}},[a]);const d=i.current??B().systems.inspectedNetworking()??null,g=st(d);if(!d||!g)return t.jsxs("div",{"data-testid":"network-inspector-empty",style:{padding:c[8],color:o.content.muted,fontSize:C.md,lineHeight:"18px"},children:[t.jsx("div",{style:{color:o.content.primary,marginBottom:c[2]},children:"No networking adapter is registered."}),"Games expose replication state to this inspector by registering a"," ",t.jsx("code",{style:N,children:"NetworkingAdapter"})," during setup:"," ",t.jsx("code",{style:N,children:"ctx.registerSystemAdapter?.('networking', adapter)"})," — see the third-person-arena example. Single-player games register none; there is nothing to inspect."]});const j=nt(d),$=g.stateTree?d.getStateSnapshot?.():void 0,E=it(n.current.all,u);return t.jsxs("div",{"data-testid":"network-inspector",className:"volter-content-frost",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",fontSize:C.md},children:[t.jsx(yt,{view:j,caps:g,rates:s.current}),g.identity?t.jsx(ut,{adapter:d,settable:g.identitySettable},d.getPlayerIdentity?.()?.name??""):null,g.conditioning?t.jsx(pt,{adapter:d}):t.jsx(T,{testId:"net-conditioner-absent",children:"Link conditioning not provided by this adapter."}),g.server?t.jsx(vt,{adapter:d,ownSession:j.roomInfo?.sessionId??null,ownRoom:j.roomInfo?.roomId??null,draft:h,setDraft:m}):null,g.recording||g.traffic?t.jsxs("div",{"data-testid":"net-profiler-bar",style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2],borderBottom:`1px solid ${o.boundary.default}`},children:[g.recording?t.jsx(t.Fragment,{children:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-recording","aria-pressed":d.isRecording?.()===!0,onClick:()=>{d.setRecording?.(!d.isRecording?.()),e()},children:d.isRecording?.()?"Stop":"Start"})}):null,t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-clear",onClick:()=>{n.current.clear(),d.clearTraffic?.(),e()},children:"Clear"}),g.recording?t.jsxs("label",{style:{display:"flex",gap:c[1],alignItems:"center",whiteSpace:"nowrap"},children:[t.jsx(Y,{"data-testid":"net-autostart",checked:S,onChange:p=>{const I=p.currentTarget.checked;B().projectLocalState.write(K,I),v(I)}}),"Autostart"]}):null]}):null,g.traffic?t.jsx(bt,{rows:d.getTrafficByType?.()??[]}):null,g.entityTraffic?t.jsx(ht,{rows:d.getTrafficByEntity?.()??[]}):null,g.send?t.jsx(St,{adapter:d,ping:g.ping,draft:h,setDraft:m}):null,t.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[t.jsx("div",{"data-testid":"net-state-tree",style:{flex:1,minWidth:0,overflow:"auto",borderRight:`1px solid ${o.boundary.default}`,padding:`${c[2]} 0`},children:g.stateTree?$!=null?t.jsx(H,{name:"state",value:$,depth:0,edit:d.editServerState?(p,I)=>d.editServerState(p,I):void 0,remove:d.deleteServerState?p=>d.deleteServerState(p):void 0,typeOf:d.stateFieldType?p=>d.stateFieldType(p):void 0}):t.jsx(T,{children:"Not connected — no replicated state to show."}):t.jsx(T,{testId:"net-tree-absent",children:"Replicated-state snapshot not provided by this adapter."})}),t.jsx("div",{"data-testid":"net-message-log",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:g.messageLog?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2]},children:[g.recording?null:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-pause",onClick:()=>{const p=!a;n.current.paused=p,l(p)},children:a?"Resume":"Pause"}),t.jsx(O,{"data-testid":"net-log-filter",placeholder:"Filter by type",value:u,onChange:p=>y(p.target.value),style:{flex:1,minWidth:60}}),t.jsxs("span",{style:{fontSize:C.sm,color:o.content.muted},children:[E.length,"/",n.current.all.length]})]}),t.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto"},children:E.length===0?t.jsx(T,{children:"No messages captured yet."}):E.map(p=>t.jsx(ct,{event:p},p.seq))})]}):t.jsx(T,{testId:"net-log-absent",children:"Message log not provided by this adapter."})})]})]})}function ht({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"};return t.jsx("div",{"data-testid":"net-entity-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx(T,{children:"No state patches yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...N},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Entity"}),t.jsx("th",{style:n,title:"Syncs in - out, as Godot pairs them: the state patches that changed it, and none out, because a Colyseus client sends no state",children:"Count"}),t.jsx("th",{style:n,title:"Field changes those patches carried",children:"Changes"}),t.jsx("th",{style:n,title:"Size in - out: the size range of the patches that carried it (they carried other entities too), and none out",children:"Size"})]})}),t.jsx("tbody",{children:e.map(s=>t.jsxs("tr",{"data-testid":"net-entity-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:s.path}),t.jsx("td",{style:n,children:`${s.syncs} - 0`}),t.jsx("td",{style:n,children:s.changes}),t.jsx("td",{style:n,children:`${s.patchBytesMin===s.patchBytesMax?`${s.patchBytesMin} B`:`${s.patchBytesMin}…${s.patchBytesMax} B`} - 0 B`})]},s.path))})]})})}function gt(e){try{return JSON.parse(e)}catch{return e}}function xt({text:e,onChange:n}){const[s,i]=f.useState("tree");let a;try{a=e.trim()===""?{}:JSON.parse(e)}catch{a=void 0}const l=u=>n(JSON.stringify(u));return t.jsxs("div",{"data-testid":"net-payload-editor",style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("div",{style:{display:"flex",gap:c[1]},children:["tree","text"].map(u=>t.jsx(k,{type:"button",variant:"ghost","aria-pressed":s===u,"data-testid":`net-payload-view-${u}`,onClick:()=>i(u),children:u==="tree"?"Tree":"Text"},u))}),s==="text"||a===void 0?t.jsxs(t.Fragment,{children:[t.jsx(tt,{"data-testid":"net-send-dialog-payload",rows:6,value:e,onChange:u=>n(u.target.value),style:N}),a===void 0?t.jsx("span",{style:{color:o.content.muted},children:"Not JSON yet, so the tree cannot show it."}):null]}):t.jsx("div",{style:{...N,fontSize:C.sm},children:t.jsx(X,{value:a,onChange:l,depth:0})})]})}function X({value:e,onChange:n,depth:s}){const[i,a]=f.useState(""),[l,u]=f.useState(""),y={paddingLeft:s*12};if(e!==null&&typeof e=="object"){const S=Array.isArray(e),v=S?e.map((m,d)=>[String(d),m]):Object.entries(e),h=(m,d)=>{n(S?e.map((g,j)=>String(j)===m?d:g):{...e,[m]:d})},x=m=>{n(S?e.filter((d,g)=>String(g)!==m):Object.fromEntries(Object.entries(e).filter(([d])=>d!==m)))};return t.jsxs("div",{"data-testid":"net-payload-branch",children:[v.map(([m,d])=>t.jsxs("div",{style:y,children:[t.jsxs("span",{style:{color:o.content.muted},children:[m,": "]}),d!==null&&typeof d=="object"?t.jsx("span",{style:{color:o.content.muted},children:Array.isArray(d)?"[":"{"}):null,t.jsx("button",{type:"button","data-testid":"net-payload-remove",title:`Remove ${m}`,onClick:()=>x(m),style:{background:"none",border:0,color:o.content.muted,cursor:"pointer"},children:"×"}),d!==null&&typeof d=="object"?t.jsx(X,{value:d,onChange:g=>h(m,g),depth:s+1}):t.jsx(q,{value:d,onChange:g=>h(m,g)})]},m)),t.jsxs("div",{style:{...y,display:"flex",gap:c[1]},children:[S?null:t.jsx(O,{"data-testid":"net-payload-new-key",placeholder:"key",value:i,onChange:m=>a(m.target.value),style:{width:90}}),t.jsx(O,{"data-testid":"net-payload-new-value",placeholder:"value",value:l,onChange:m=>u(m.target.value),style:{width:110}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-payload-add",disabled:!S&&i.trim()==="",onClick:()=>{const m=gt(l);n(S?[...e,m]:{...e,[i.trim()]:m}),a(""),u("")},children:"Add"})]})]})}return t.jsx(q,{value:e,onChange:n})}function q({value:e,onChange:n}){const s=e===null?"null":typeof e=="number"?"number":typeof e=="boolean"?"boolean":"string",i=s==="string"?String(e):JSON.stringify(e),[a,l]=f.useState(i);f.useEffect(()=>l(i),[i]);const u=(y,S)=>{if(y==="null")return null;if(y==="boolean")return S.trim()==="true";if(y==="number"){const v=Number(S);return Number.isFinite(v)?v:0}return S};return t.jsxs("span",{style:{display:"inline-flex",gap:4},children:[s==="boolean"?t.jsx("input",{type:"checkbox","data-testid":"net-payload-leaf-boolean",checked:e===!0,onChange:y=>n(y.currentTarget.checked)}):s==="null"?t.jsx("span",{style:{color:o.content.muted},children:"null"}):t.jsx(O,{"data-testid":"net-payload-leaf",value:a,onChange:y=>l(y.target.value),onBlur:()=>n(u(s,a)),onKeyDown:y=>{y.key==="Enter"&&n(u(s,a))},style:{width:120}}),t.jsx("select",{"data-testid":"net-payload-leaf-type","aria-label":"Value type",value:s,onChange:y=>n(u(y.currentTarget.value,a)),children:["string","number","boolean","null"].map(y=>t.jsx("option",{value:y,children:y},y))})]})}const ft=[["name","Name"],["roomId","Room"],["clients","Clients"],["locked","Locked"],["elapsedMs","Elapsed"]];function jt(e,n){const s=i=>{const a=i[n.key];return typeof a=="number"?a:typeof a=="boolean"?Number(a):String(a)};return[...e].sort((i,a)=>{const l=s(i),u=s(a),y=l<u?-1:l>u?1:0;return n.descending?-y:y})}function bt({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"},s=i=>i>=1024?`${(i/1024).toFixed(1)} KiB`:`${i} B`;return t.jsx("div",{"data-testid":"net-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx(T,{children:"No traffic yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...N},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Type"}),t.jsx("th",{style:n,children:"In"}),t.jsx("th",{style:n,children:"Bytes in"}),t.jsx("th",{style:n,children:"Out"}),t.jsx("th",{style:n,children:"Bytes out"})]})}),t.jsx("tbody",{children:e.map(i=>t.jsxs("tr",{"data-testid":"net-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:i.type}),t.jsx("td",{style:n,children:i.countIn||"-"}),t.jsx("td",{style:n,children:i.countIn?s(i.bytesIn):"-"}),t.jsx("td",{style:n,children:i.countOut||"-"}),t.jsx("td",{style:n,children:i.countOut?s(i.bytesOut):"-"})]},i.type))})]})})}function Q(e){if(e.type.trim()==="")throw new Error("Name the message type first.");return{type:e.type,payload:e.payload.trim()===""?void 0:JSON.parse(e.payload)}}function St({adapter:e,ping:n,draft:s,setDraft:i}){const[a,l]=f.useState(null),u=()=>{l("…"),e.ping?.().then(h=>l(`${h} ms`),h=>l(h instanceof Error?h.message:String(h)))},[y,S]=f.useState(null),v=()=>{try{const h=Q(s);e.sendMessage?.(h.type,h.payload),S(null)}catch(h){S(h instanceof Error?h.message:String(h))}};return t.jsxs("div",{"data-testid":"net-send",style:{display:"flex",gap:c[2],alignItems:"center",padding:c[2]},children:[t.jsx(O,{"data-testid":"net-send-type",placeholder:"Message type",value:s.type,onChange:h=>i({...s,type:h.target.value}),style:{width:140}}),t.jsx(O,{"data-testid":"net-send-payload",placeholder:'Payload (JSON), e.g. {"x": 1}',value:s.payload,onChange:h=>i({...s,payload:h.target.value}),style:{flex:1,minWidth:80}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-send-button",disabled:s.type.trim()==="",onClick:v,children:"Send as this client"}),n?t.jsxs(t.Fragment,{children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-ping",onClick:u,children:"Ping"}),a?t.jsx("span",{"data-testid":"net-rtt",style:{fontSize:C.sm,...N},children:a}):null]}):null,y?t.jsx("span",{"data-testid":"net-send-error",style:{color:o.semantic.danger,fontSize:C.sm},children:y}):null]})}function vt({adapter:e,ownSession:n,ownRoom:s,draft:i,setDraft:a}){const[l,u]=f.useState(null),[y,S]=f.useState(null),[v,h]=f.useState("clients"),[x,m]=f.useState(void 0),[d,g]=f.useState(void 0),[j,$]=f.useState({key:"elapsedMs",descending:!0}),[E,p]=f.useState(null);f.useEffect(()=>{let r=!0;const b=()=>{e.inspectServer?.(d).then(A=>{r&&m(A)},A=>{r&&p(A instanceof Error?A.message:String(A))})};b();const z=setInterval(b,2e3);return()=>{r=!1,clearInterval(z)}},[e,d]);const I=r=>{try{r()?.then(()=>p(null),b=>p(b instanceof Error?b.message:String(b)))}catch(b){p(b instanceof Error?b.message:String(b))}},L=r=>`${Math.round(r/1e3)} s`,w={padding:`0 ${c[3]}`,whiteSpace:"nowrap"};if(x===void 0)return null;if(x===null)return t.jsx(T,{testId:"net-server-absent",children:"The room server serves no Monitor view (its `server` configuration sets VOLTER_ROOM_MONITOR=1)."});const R=x.room?.roomId,M=(r,b,z)=>t.jsx(k,{type:"button",variant:"ghost","data-testid":r,onClick:()=>I(z),children:b});return t.jsxs("div",{"data-testid":"net-server",style:{padding:`${c[2]} 0`,borderBottom:`1px solid ${o.boundary.default}`,fontSize:C.sm},children:[t.jsxs("div",{"data-testid":"net-server-summary",style:{padding:`0 ${c[3]}`,color:o.content.muted},children:["Server · ",x.rooms.length," room",x.rooms.length===1?"":"s"," · ",x.connections," ","connection",x.connections===1?"":"s",x.cpuPercent!==null?` · CPU ${x.cpuPercent.toFixed(0)}%`:"",x.memory?` · memory ${Math.round(x.memory.usedMb)} / ${Math.round(x.memory.totalMb)} MB`:"",x.room?` · state ${x.room.stateBytes} B`:""]}),t.jsxs("table",{style:{borderCollapse:"collapse",...N},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[ft.map(([r,b])=>t.jsxs("th",{"data-testid":`net-server-sort-${r}`,"aria-sort":j.key===r?j.descending?"descending":"ascending":"none",style:{...w,textAlign:"left",cursor:"pointer",fontWeight:"normal"},onClick:()=>$({key:r,descending:j.key===r?!j.descending:!1}),children:[b,j.key===r?j.descending?" ▾":" ▴":""]},r)),t.jsx("th",{style:w})]})}),t.jsx("tbody",{children:jt(x.rooms,j).map(r=>t.jsxs("tr",{"data-testid":"net-server-room","data-inspected":r.roomId===R||void 0,children:[t.jsx("td",{style:w,children:r.name}),t.jsx("td",{style:w,children:r.roomId}),t.jsxs("td",{style:w,children:[r.clients,r.maxClients!==null?` / ${r.maxClients}`:""," clients"]}),t.jsx("td",{style:w,children:r.locked?"locked":"open"}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,children:[r.roomId===R?t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-broadcast",onClick:()=>{S(null),u({sessionId:null})},children:"Broadcast"}):t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-inspect",onClick:()=>g(r.roomId),children:"Inspect"}),M("net-server-dispose","Dispose",()=>e.disposeRoom?.(r.roomId))]})]},r.roomId))})]}),l?t.jsxs("div",{"data-testid":"net-send-dialog",role:"group","aria-labelledby":"net-send-dialog-title",style:{margin:c[2],padding:c[3],border:`1px solid ${o.boundary.default}`,borderRadius:4},children:[t.jsx("div",{id:"net-send-dialog-title",style:{color:o.content.primary,marginBottom:c[2]},children:l.sessionId?`Send message to client (${l.sessionId})`:"Broadcast message to all clients"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:c[2]},children:[t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message type"}),t.jsx(O,{"data-testid":"net-send-dialog-type",value:i.type,onChange:r=>a({...i,type:r.target.value})})]}),t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message payload (JSON)"}),t.jsx(xt,{text:i.payload,onChange:r=>a({...i,payload:r})})]}),y?t.jsx("span",{"data-testid":"net-send-dialog-error",children:y}):null]}),t.jsxs("div",{style:{display:"flex",gap:c[2],justifyContent:"flex-end",marginTop:c[2]},children:[t.jsx(k,{type:"button",variant:"ghost",onClick:()=>u(null),children:"Cancel"}),t.jsx(k,{type:"button","data-testid":"net-send-dialog-send",onClick:()=>{const r=l;(async()=>{try{const b=Q(i);await(r.sessionId?e.sendToClient?.(r.sessionId,b.type,b.payload,R):e.broadcast?.(b.type,b.payload,R)),S(null),u(null)}catch(b){S(b instanceof Error?b.message:String(b))}})()},children:"Send"})]})]}):null,x.room?t.jsxs("div",{"data-testid":"net-server-room-view",style:{padding:`${c[2]} 0`},children:[t.jsx("div",{role:"tablist",style:{display:"flex",gap:c[2],padding:`0 ${c[3]}`},children:[["clients",`Clients (${x.room.clients.length})`],["state","State"]].map(([r,b])=>t.jsx(k,{type:"button",variant:"ghost",role:"tab","aria-selected":v===r,"data-testid":`net-server-tab-${r}`,onClick:()=>h(r),children:b},r))}),v==="clients"?t.jsx("table",{style:{borderCollapse:"collapse",...N},children:t.jsx("tbody",{children:x.room.clients.map(r=>t.jsxs("tr",{"data-testid":"net-server-client",children:[t.jsx("td",{style:w,children:"client"}),t.jsxs("td",{style:w,children:[r.sessionId,r.sessionId===n?" (this client)":""]}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,colSpan:3,children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-send",onClick:()=>{S(null),u({sessionId:r.sessionId})},children:"Send"}),M("net-server-disconnect","Disconnect",()=>e.disconnectClient?.(r.sessionId,R))]})]},r.sessionId))})}):x.room.state!==void 0?t.jsx("div",{"data-testid":"net-server-room-state",children:t.jsx(H,{name:`room ${x.room.roomId}${x.room.roomId===s?" (this client’s room)":""}`,value:x.room.state,depth:0,edit:e.editServerState?(r,b)=>e.editServerState(r,b,R):void 0,remove:e.deleteServerState?r=>e.deleteServerState(r,R):void 0})}):t.jsx(T,{children:"The server sent no state for this room."})]}):null,E?t.jsx(T,{children:E}):null]})}const Ge="workspace.utility",Xe="Network",Qe=25,Ye=()=>B().systems.inspectedNetworking()!==null;function Ze(){return t.jsx(mt,{})}export{Ye as available,Ze as default,Qe as order,Ge as point,Xe as title};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Object3DDocumentToolbar-
|
|
2
|
-
import{z as l,B as p,E as m,F as D,G as g,_ as b}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Object3DDocumentToolbar-Y-jpI3WD.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-BfqJPhFO.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/asset-preview-t-7PYPjJ.js","assets/editor-layers-k0AjpomL.js","assets/workspace-arrangement-BXM0R-Uu.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-C2temlO0.js","assets/studio-environment-BNM-AjAn.js","assets/user-data-CTT8ZvVB.js","assets/KTX2Loader-CaqVE6nY.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/model-inspection-PgxfYOnI.js","assets/viewport-door-BBtilr3V.js","assets/ViewportShadingMenu-D_-wHbzW.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{z as l,B as p,E as m,F as D,G as g,_ as b}from"./index-BfqJPhFO.js";import{r as v}from"./index-nmcBqr7Y.js";const w=v.lazy(()=>b(()=>import("./Object3DDocumentToolbar-Y-jpI3WD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])).then(e=>({default:e.Object3DDocumentToolbar}))),o=new Map,a=new Map;let d=0;const u=new Set;let i=!1;function s(){i||(i=!0,queueMicrotask(()=>{i=!1,d++;for(const e of[...u])e()}))}function O(e,t={}){o.set(e.documentId,e);const r=l(e),n=p(e.documentId,{...S(e),...t});return s(),()=>{n(),r(),o.get(e.documentId)===e&&(o.delete(e.documentId),s())}}const f=([e,t,r])=>({x:e,y:t,z:r});function S(e){return{read:()=>{const t=e.cameraPose(),r=e.presentation();return{camera:{position:f(t.position),target:f(t.target),...t.fov?{fov:t.fov}:{}},diagnostic:r.skeleton?"skeleton":r.mode,grid:g(e.documentId)}},setDiagnostic:t=>{if(t==="preview"||t==="rendered"){const r=m(e.documentId)?.stageKind;if(!r||D(r)?.modes?.[t]?.lighting===void 0)return!1}return e.setSkeleton(t==="skeleton"),e.setBounds(t==="bounds"),e.setMode(t==="skeleton"||t==="bounds"?"solid":t),!0},setCamera:t=>(typeof t!="string"?e.setCameraPose(t.position,t.target,t.fov):t==="perspective"?(e.setProjection("perspective"),e.frame()):e.setViewPreset(t),!0),frame:t=>t==="selection"?e.frameSelection():(e.frame(),!0),selection:{read:()=>e.selection(),apply:t=>e.select(t)},idsNamed:t=>{const r=[];return e.root.traverse(n=>{if(n.name!==t)return;const c=e.idForObject(n);c&&r.push(c)}),r},setTransformMode:t=>e.viewport.setTransformMode(t),capture:t=>e.captureImage(t??512),prepare:()=>j(e.documentId),HeaderControls:w}}function V(e){return o.get(e)??null}function _(e,t){return a.set(e,t),()=>{a.get(e)===t&&a.delete(e)}}async function j(e){await a.get(e)?.()}function I(){return[...o.values()]}function k(e){return u.add(e),()=>u.delete(e)}function M(){return d}export{V as a,O as b,I as c,M as o,_ as r,k as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{aE as i}from"./index-
|
|
1
|
+
import{aE as i}from"./index-BfqJPhFO.js";import"./writer-tw6EcuVO.js";import{p as h,a as M,r as $}from"./r3f-physics-binding-EfYECbQc.js";const x=["position","rotation","scale"],O={"@react-three/rapier":{RigidBody:{root:"single",rootTag:"group",transformProps:[...x]}}},z={"@react-three/rapier":{RigidBodyProps:"group"}};function _(t){const n=new Map;for(const r of t.statements){if(!i.isImportDeclaration(r)||!i.isStringLiteral(r.moduleSpecifier))continue;const e=z[r.moduleSpecifier.text],o=r.importClause?.namedBindings;if(!(!e||!o||!i.isNamedImports(o)))for(const s of o.elements){const a=s.propertyName?.text??s.name.text,l=e[a];l&&n.set(s.name.text,l)}}return n}function D(t){return t?Object.values(O).some(n=>Object.values(n).includes(t)):!1}function j(t,n){return O[t]?.[n]}function Z(t){const n=new Map;if(!i.isStringLiteral(t.moduleSpecifier))return n;const r=t.importClause?.namedBindings;if(!r||!i.isNamedImports(r))return n;for(const e of r.elements){const o=j(t.moduleSpecifier.text,e.propertyName?.text??e.name.text);o&&n.set(e.name.text,o)}return n}function ct(t,n){const r=h(n,t),e=new Map;for(const o of r.statements)if(i.isImportDeclaration(o))for(const[s,a]of Z(o))e.set(s,a);return e}function P(t){let n=t;for(;i.isParenthesizedExpression(n)||i.isAsExpression(n)||i.isSatisfiesExpression(n);)n=n.expression;return n}function k(t){if(!i.isBlock(t))return P(t);const n=t.statements.filter(i.isReturnStatement);if(!(n.length!==1||!n[0]?.expression))return P(n[0].expression)}function K(t,n,r){for(const[e,o]of r)if(o===n&&new RegExp(`\\b${e}\\b`).test(t))return!0;return!1}function b(t,n,r,e,o,s=new Set){if(!t)return!1;const a=t.getText(r),l=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\bThreeElements\\s*\\[\\s*['"]${l}['"]\\s*\\]`).test(a)||K(a,n,o))return!0;if(i.isTypeReferenceNode(t)&&i.isIdentifier(t.typeName)){const u=t.typeName.text;if(s.has(u))return!1;const f=e.get(u);return f?(s.add(u),b(f.type,n,f.sf,e,o,s)):!1}for(const[u,f]of e){if(s.has(u)||!new RegExp(`\\b${u}\\b`).test(a))continue;const p=new Set(s).add(u);if(b(f.type,n,f.sf,e,o,p))return!0}return!1}function L(t){if(i.isJsxSelfClosingElement(t))return t;if(i.isJsxElement(t))return t.openingElement}function U(t,n){return t==="multiple"||n==="multiple"?"multiple":t==="unknown"||n==="unknown"?"unknown":t+n>=2?"multiple":t+n}function I(t,n,r){const o=(i.isJsxElement(t)?t.openingElement:t).tagName.getText(n);if(!/^[A-Z]/.test(o))return B(o)?0:1;const s=r.get(o);return!s||s.root==="unknown"?"unknown":s.root==="non-spatial"?0:s.root==="multiple"?"multiple":1}function V(t,n,r){if(!i.isPropertyAccessExpression(t.expression)||t.expression.name.text!=="map")return;const e=t.arguments[0];if(!e||!i.isArrowFunction(e)&&!i.isFunctionExpression(e))return"unknown";const o=k(e.body);if(!o)return"unknown";const s=v(o,n,r);return s===0?0:s==="unknown"?"unknown":"multiple"}function v(t,n,r){const e=P(t);return e.kind===i.SyntaxKind.NullKeyword||e.kind===i.SyntaxKind.FalseKeyword?0:i.isJsxFragment(e)?y(e,n,r):i.isJsxElement(e)||i.isJsxSelfClosingElement(e)?I(e,n,r):i.isCallExpression(e)?V(e,n,r)??"unknown":"unknown"}function W(t,n,r){return i.isJsxText(t)?t.text.trim()===""?0:"unknown":i.isJsxExpression(t)?t.expression?v(t.expression,n,r):0:i.isJsxElement(t)||i.isJsxSelfClosingElement(t)?I(t,n,r):i.isJsxFragment(t)?y(t,n,r):"unknown"}function y(t,n,r){let e=0;for(const o of t.children)e=U(e,W(o,n,r));return e}function q(t,n,r){const e=y(t,n,r);return e===0?{root:"non-spatial",transformProps:[]}:e==="multiple"?{root:"multiple",transformProps:[]}:{root:"unknown",transformProps:[]}}function B(t){return/^[A-Z]/.test(t)?!1:/(Material|Geometry|Attribute)$/.test(t)||t==="fog"||t==="fogExp2"||t==="color"}function G(t){return x.includes(t)}function F(t){return G(t)||t==="visible"}function Y(t,n,r,e,o){const s={standardRootProps:b(t?.type,n,r,e,o),localBindingByProp:new Map};if(!t)return s;if(i.isIdentifier(t.name))return s.wholePropsName=t.name.text,s;if(!i.isObjectBindingPattern(t.name))return s;for(const a of t.name.elements){if(a.dotDotDotToken&&i.isIdentifier(a.name)){s.restPropsName=a.name.text;continue}if(!i.isIdentifier(a.name))continue;const l=a.propertyName?.getText(r)??a.name.text;F(l)&&s.localBindingByProp.set(l,a.name.text)}return s}function H(t,n,r){if(!t)return!1;const e=t.getText(r).replace(/\s+/g,""),o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^(React\\.)?(Parameters<typeof${o}>\\[0\\]|ComponentProps(WithoutRef|WithRef)?<typeof${o}>)`).test(e)}function Q(t,n){return!n.standardRootProps||!i.isIdentifier(t.expression)?!1:t.expression.text===n.wholePropsName||t.expression.text===n.restPropsName}function X(t,n,r){const e=t.name.getText(r);if(!F(e)||!t.initializer||!i.isJsxExpression(t.initializer))return;const o=t.initializer.expression;if(!o)return;const s=n.localBindingByProp.get(e);if(s&&i.isIdentifier(o)&&o.text===s||n.wholePropsName&&i.isPropertyAccessExpression(o)&&i.isIdentifier(o.expression)&&o.expression.text===n.wholePropsName&&o.name.text===e)return e}function tt(t,n,r){const e=new Set;for(const s of t.attributes.properties){if(i.isJsxSpreadAttribute(s)){if(Q(s,n)){for(const l of x)e.add(l);e.add("visible")}continue}const a=X(s,n,r);a&&e.add(a)}return[...x,"visible"].filter(s=>e.has(s))}const nt=/\b([A-Za-z_$][\w$]*)\.current\??\.(?:position|rotation|quaternion|scale)(?:\??\.[xyzw]+)?\s*(?:[+\-*/]?=|\??\.(?:set|setScalar|copy|add|sub|multiply|lerp|slerp|fromArray)\s*\()/g;function et(t,n){const r=new Set,e=o=>{if(i.isCallExpression(o)&&/(^|\.)useFrame$/.test(o.expression.getText(n)))for(const s of o.getText(n).matchAll(nt))r.add(s[1]);i.forEachChild(o,e)};return e(t),r}function rt(t,n,r){if(n.length>0)return{};const e=$(t);return e&&r.has(e)?{simulationOwnedTransform:!0}:{}}function ot(t,n,r,e,o,s,a,l){const u=k(n);if(!u)return{root:"unknown",transformProps:[]};if(u.kind===i.SyntaxKind.NullKeyword)return{root:"non-spatial",transformProps:[]};if(i.isJsxFragment(u))return q(u,r,s);if(!i.isJsxElement(u)&&!i.isJsxSelfClosingElement(u))return{root:"unknown",transformProps:[]};const f=L(u);if(!f)return{root:"unknown",transformProps:[]};const p=f.tagName.getText(r);if(B(p))return{root:"non-spatial",transformProps:[]};const c=/^[A-Z]/.test(p)?s.get(p):void 0;if(/^[A-Z]/.test(p)&&!c)return{root:"unknown",transformProps:[]};if(c&&c.root!=="single")return c;const d=c?.rootTag??p,g=l.get(f),E=g?.apiDriven??[],T=(g?.forwarded??[]).filter(m=>!E.includes(m)),R=Y(t[0],d,r,e,o),A=!R.standardRootProps&&c&&H(t[0]?.type,p,r)?{...R,standardRootProps:!0}:R,N=tt(f,A,r),S=x.filter(m=>N.includes(m)||T.includes(m)),w=c?S.filter(m=>c.transformProps.includes(m)):S,J=N.includes("visible")&&(!c||c.visibleProp===!0);if(D(c)&&w.length===0)return{root:"unknown",transformProps:[]};const C=w.filter(m=>T.includes(m));return{root:"single",rootTag:d,transformProps:w,...C.length>0?{bodyForwarded:C}:{},...J?{visibleProp:!0}:{},...rt(f,w,a),...E.length>0?{simulationOwnedTransform:!0}:{}}}function it(t){return i.isFunctionDeclaration(t)&&t.name&&t.body?/^[A-Z]/.test(t.name.text)?[{name:t.name.text,parameters:t.parameters,body:t.body}]:[]:i.isVariableStatement(t)?t.declarationList.declarations.flatMap(n=>!i.isIdentifier(n.name)||!/^[A-Z]/.test(n.name.text)||!n.initializer||!i.isArrowFunction(n.initializer)&&!i.isFunctionExpression(n.initializer)?[]:[{name:n.name.text,parameters:n.initializer.parameters,body:n.initializer.body}]):[]}function st(t,n=new Map,r=new Map){const e=new Map(r);for(const f of t.statements)i.isTypeAliasDeclaration(f)&&e.set(f.name.text,{type:f.type,sf:t});const o=_(t),s=t.statements.flatMap(it),a=et(t,t),l=M(t),u=new Map(n);for(let f=0;f<=s.length;f+=1){let p=!1;for(const c of s){const d=ot(c.parameters,c.body,t,e,o,u,a,l),g=u.get(c.name);JSON.stringify(g)!==JSON.stringify(d)&&(u.set(c.name,d),p=!0)}if(!p)break}return u}function lt(t,n,r=new Map,e=new Map){const o=h(n,t);return st(o,r,e)}function pt(t,n,r){let e=0,o=1;for(;o<n;){const s=t.indexOf(`
|
|
2
2
|
`,e);if(s===-1)return t.length;e=s+1,o+=1}return e+r}export{lt as a,ct as b,pt as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Vec3Schema as a}from"./tuples-
|
|
1
|
+
import{Vec3Schema as a}from"./tuples-CA3u4T9B.js";import{dZ as c,u as i,c6 as e,c5 as o,v as n,c4 as s,x as t,w as p}from"./index-BfqJPhFO.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const b=i({type:t("ConstantValue"),value:e()}),h=i({type:t("IntervalValue"),a:e(),b:e()}),u=i({p0:e(),p1:e(),p2:e(),p3:e()}),f=i({type:t("PiecewiseBezier"),functions:n(i({function:u,start:e()}))}),r=c("type",[b,h,f]).describe("Numeric value: constant, random interval, or bezier curve"),l=i({r:e(),g:e(),b:e(),a:e()}),v=i({r:e(),g:e(),b:e()}),S=i({type:t("CLinearFunction"),subType:t("Color"),keys:n(i({value:v,pos:e()}))}),y=i({type:t("CLinearFunction"),subType:t("Number"),keys:n(i({value:e(),pos:e()}))}),g=i({type:t("ConstantColor"),color:l}),C=i({type:t("ColorRange"),a:l,b:l}),d=i({type:t("Gradient"),color:S,alpha:y}),w=i({type:t("RandomColorBetweenGradient"),gradient1:d,gradient2:d}),m=c("type",[g,C,d,w]).describe("Color generator: constant, range, gradient, or random between gradients"),B=i({type:t("point")}),L=i({type:t("sphere"),radius:e().optional().describe("Sphere radius"),arc:e().optional().describe("Arc angle in radians (2π = full sphere)"),thickness:e().optional().describe("Shell thickness 0–1 (1 = solid, 0 = surface only)")}),O=i({type:t("hemisphere"),radius:e().optional().describe("Hemisphere radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Shell thickness 0–1")}),x=i({type:t("cone"),radius:e().optional().describe("Cone base radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Shell thickness 0–1"),angle:e().optional().describe("Cone opening angle in radians")}),F=i({type:t("circle"),radius:e().optional().describe("Circle radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Ring thickness 0–1")}),P=i({type:t("donut"),radius:e().optional().describe("Donut major radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Ring thickness 0–1"),donutRadius:e().optional().describe("Donut tube (minor) radius")}),R=i({type:t("rectangle"),width:e().optional().describe("Rectangle width"),height:e().optional().describe("Rectangle height"),thickness:e().optional().describe("Extrusion depth 0–1")}),T=i({type:t("grid"),width:e().optional().describe("Grid total width"),height:e().optional().describe("Grid total height"),column:e().int().optional().describe("Number of columns"),row:e().int().optional().describe("Number of rows")}),G=c("type",[B,L,O,x,F,P,R,T]).describe("Particle emitter shape"),k=i({type:t("ApplyForce"),direction:a.describe("Force direction vector"),magnitude:r.describe("Force magnitude")}),E=i({type:t("ColorOverLife"),color:m.describe("Color curve over particle lifetime")}),z=i({type:t("SizeOverLife"),size:r.describe("Size curve over particle lifetime")}),A=i({type:t("SpeedOverLife"),speed:r.describe("Speed multiplier curve over lifetime")}),N=i({type:t("RotationOverLife"),angularVelocity:r.describe("Angular velocity in radians/sec")}),D=i({type:t("ForceOverLife"),x:r.describe("Force along X axis over lifetime"),y:r.describe("Force along Y axis over lifetime"),z:r.describe("Force along Z axis over lifetime")}),I=i({type:t("OrbitOverLife"),orbitSpeed:r.describe("Orbit speed over lifetime"),axis:a.optional().describe("Orbit axis. Defaults to [0, 1, 0]")}),V=i({type:t("Noise"),frequency:r.describe("Noise frequency"),power:r.describe("Noise amplitude"),positionAmount:r.optional().describe("Position displacement amount"),rotationAmount:r.optional().describe("Rotation displacement amount")}),H=i({type:t("TurbulenceField"),scale:a.describe("Turbulence field scale"),octaves:e().int().describe("Noise octave count"),velocityMultiplier:a.describe("Velocity multiplier per axis"),timeScale:a.describe("Time scale per axis")}),M=i({type:t("FrameOverLife"),frame:r.describe("Sprite sheet frame index over lifetime")}),W=i({type:t("LimitSpeedOverLife"),speed:r.describe("Maximum speed over lifetime"),dampen:e().describe("Damping factor when speed exceeds limit (0–1)")}),j=i({type:t("ChangeEmitDirection"),angle:r.describe("Angle deviation from original emit direction")}),q=i({type:t("GravityForce"),center:a.describe("Gravity center point"),magnitude:e().describe("Gravity force strength")}),U=i({type:t("WidthOverLength"),width:r.describe("Trail width over trail length")}),Z=c("type",[k,E,z,A,N,D,I,V,H,M,W,j,q,U]).describe("Particle behavior applied over lifetime"),X=s(["billboard","stretchedBillboard","mesh","trail","horizontalBillboard","verticalBillboard"]).describe("How particles are rendered"),Y=i({wrap:s(["clamp","repeat","mirror"]).optional().describe("How UVs outside [0,1] address the sprite image (three wrapS/wrapT)"),filter:s(["linear","nearest"]).optional().describe("Texel interpolation — nearest keeps a pixel-art sprite crisp"),mipmaps:o().optional().describe("Generate and sample a mip chain"),anisotropy:e().optional().describe("Anisotropic filtering samples, for sprites viewed at grazing angles")}).describe("Sprite texture sampler state"),_=i({type:s(["basic","standard"]).optional().describe("Particle material shading model"),color:p().optional().describe("Particle color as CSS hex string"),map:p().optional().describe("Path to particle sprite texture"),mapSampler:Y.optional().describe("Sampler state applied to the sprite texture named by `map`"),blending:s(["normal","additive"]).optional().describe("Blending mode (additive for glowing/fire effects)"),transparent:o().optional().describe("Enable transparency"),depthWrite:o().optional().describe("Write to depth buffer (disable for additive effects)"),side:s(["front","back","double"]).optional().describe("Which face sides to render")}).describe("Particle material settings"),J=i({time:e().describe("Time offset in seconds within the emission cycle"),count:r.describe("Number of particles to emit"),cycle:e().optional().describe("Burst repeat interval in seconds"),interval:e().optional().describe("Delay between burst repetitions"),probability:e().optional().describe("Chance of burst firing (0–1)")}).describe("Timed particle burst"),ne=i({autoDestroy:o().optional().describe("Destroy the particle system when all particles have died"),looping:o().optional().describe("Continuously emit particles"),prewarm:o().optional().describe("Simulate one full cycle on start so particles appear immediately"),duration:e().optional().describe("Total emission duration in seconds"),shape:G.optional().describe("Emitter shape that defines where particles spawn"),startLife:r.optional().describe("Initial particle lifetime in seconds"),startSpeed:r.optional().describe("Initial particle speed"),startSize:r.optional().describe("Initial particle size"),startRotation:r.optional().describe("Initial particle rotation in radians"),startColor:m.optional().describe("Initial particle color"),startLength:r.optional().describe("Initial trail length (trail render mode only)"),startTileIndex:r.optional().describe("Initial sprite sheet tile index"),emissionOverTime:r.optional().describe("Particles emitted per second"),emissionOverDistance:r.optional().describe("Particles emitted per unit of emitter movement"),emissionBursts:n(J).optional().describe("Timed burst emissions"),behaviors:n(Z).optional().describe("Behaviors applied to particles over their lifetime"),renderMode:X.optional().describe("How particles are rendered (billboard, trail, mesh, etc.)"),worldSpace:o().optional().describe("Simulate particles in world space instead of local space"),renderOrder:e().optional().describe("Render order for sorting (higher = rendered later)"),uTileCount:e().int().optional().describe("Horizontal tile count in sprite sheet"),vTileCount:e().int().optional().describe("Vertical tile count in sprite sheet"),blendTiles:o().optional().describe("Blend between sprite sheet tiles for smooth animation"),softParticles:o().optional().describe("Enable soft particle depth fading"),softFarFade:e().optional().describe("Far fade distance for soft particles"),softNearFade:e().optional().describe("Near fade distance for soft particles"),material:_.describe("Particle material settings")}).describe("Particle system configuration");export{Z as BehaviorSchema,m as ColorGeneratorSchema,G as EmitterShapeSchema,ne as ParticlesDescriptorSchema,X as RenderModeSchema,r as ValueGeneratorSchema};
|
package/dist/assets/{pixi-authoring-adapter-B1BBfTju.js → pixi-authoring-adapter-qbP0YW7g.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as G}from"./index-CHOT9sYh.js";import{Z as x,gC as X,bU as k,bV as j,r as _}from"./index-ClgrFOcX.js";import{c as Y}from"./source-persistence-backend-Cwy93SmQ.js";import{c as V}from"./component-instance-root-wO1p-rLr.js";import{J as Z}from"./json-history-resource-CDEoQe1R.js";import{a as Q,b as q}from"./pixi-transform-channels-P4rvmusc.js";function b(i){const t=i.constructor?.name?.toLowerCase()??"container";return t.includes("animatedsprite")?"animatedsprite":t.includes("nineslice")?"nineslicesprite":t.includes("tiling")?"tilingsprite":t.includes("sprite")?"sprite":t.includes("text")?"text":t.includes("graphics")?"graphics":"container"}function J(i){const t=tt(i);if(t)return t;const e=it(i);if(e)return e;const r=rt(i);if(r)return r;const n=g(i);if(n)return n;const o=b(i),s=i.children?.length??0;return s>0?`${o} (${s})`:o}function tt(i){const t=i.label?.trim();if(t){if(N(t)&&t!==i.constructor?.name)return t;if(!$(t))return t}}function N(i){return i.length<=2&&i===i.toLowerCase()}const et=new Set(["container","displayobject","sprite","animatedsprite","nineslicesprite","tilingsprite","text","bitmaptext","htmltext","graphics","mesh"]);function $(i){return N(i)||i==="Object"||i==="Function"?!0:et.has(i.replace(/^_+/,"").toLowerCase())}function rt(i){const e=i.texture?.label?.trim();return!e||/^(_?texture)?(empty|white)$/i.test(e)?void 0:(e.split("/").pop()??e).replace(/\.[a-z0-9]+$/i,"")||void 0}function g(i){const t=i.constructor?.name;if(!(!t||$(t)))return t.replace(/^_+/,"")||void 0}function v(i){const t=i.replace(/^_+/,"");return t.length>0?t:void 0}function F(i){return"addChild"in i&&typeof i.addChild=="function"&&"children"in i}function it(i){const t={seen:new WeakSet,budget:nt};let e=i.parent;for(let r=0;r<8&&e&&typeof e=="object";r++){if(t.budget<=0)return;const n=O(e,i,t)??R(e,i,2,t);if(n)return n;e=e.parent}}const nt=2e3;function S(i){return i.budget<=0?!1:(i.budget-=1,!0)}function I(i){return/^_?[A-Za-z][A-Za-zA-Z0-9]*$/.test(i)?!ot.has(i.replace(/^_+/,"")):!1}const ot=new Set(["parent","children","transform","position","origin","scale","pivot","skew","anchor","worldTransform","localTransform","groupTransform","relativeGroupTransform","renderGroup","parentRenderGroup","parentRenderGroupIndex","parentRenderLayer","relativeRenderGroupDepth","renderPipeId","instructionSet","childrenToUpdate","childrenRenderablesToUpdate","effects","filters","mask","bounds","boundsArea","visualBounds","gpuData","texture","events","eventsCount","updateFlags"]);function O(i,t,e){if(e.seen.has(i))return;e.seen.add(i);const r=E(i,t,void 0,e);if(r)return r;for(const[n,o]of Object.entries(i)){if(!S(e))return;if(!I(n))continue;const s=H(i,n,o,t);if(s)return s;const a=E(o,t,n,e);if(a)return a}}function E(i,t,e,r){const n=dt(i);if(n)for(const[o,s]of n){if(!S(r))return;const a=st(i,s,at(o)??e,t,r);if(a)return a}}function st(i,t,e,r,n){if(e){const o=H(t&&typeof t=="object"?t:i,e,t,r);if(o)return o}else if(t&&typeof t=="object"&&t.view===r){const o=g(t);if(o)return o}if(t&&typeof t=="object"&&!F(t))return O(t,r,n)}function at(i){if(!(!i||/^\d+$/.test(i)))return I(i)||i.includes("-")?v(i)??i:void 0}function*ct(i){for(let t=0;t<i.length;t++)yield[String(t),i[t]]}function*lt(i){for(const[t,e]of i.entries())yield[String(t),e]}function*ut(i){let t=0;for(const e of i)yield[String(t),e],t+=1}function dt(i){if(!(!i||typeof i!="object")){if(Array.isArray(i))return ct(i);if(i instanceof Map)return lt(i);if(i instanceof Set)return ut(i);if(Object.getPrototypeOf(i)===Object.prototype)return Object.entries(i)}}function H(i,t,e,r){if(e===r){const n=v(t);return n&&n.toLowerCase()!=="view"?g(e)??n:g(e)??g(i)??n}if(e&&typeof e=="object"&&e.view===r)return g(e)??v(t)}function R(i,t,e,r){const n=O(i,t,r);if(n)return n;if(!(e<=0))for(const[o,s]of Object.entries(i)){if(!S(r))return;if(!I(o)||!s||typeof s!="object"||F(s))continue;const a=R(s,t,e-1,r);if(a)return a}}const ht={idFor:(i,t)=>`w2d:${t.join("/")}:${b(i)}:${i.label??""}`};class ft{constructor(t,e={}){this.root=t,e.overlay&&(this.overlay=e.overlay),this.identity=e.identity??ht,this.refresh()}byId=new Map;overlay={};dirty=!1;identity;names=new WeakMap;reindex(){this.byId.clear(),this.identity.beginWalk?.();let t=0,e=0;const r=(n,o)=>{const s=this.identity.idFor(n,o);n.__authId=s,this.byId.set(s,n),t++,b(n).includes("sprite")&&e++,n.children.forEach((a,l)=>{r(a,[...o,l])})};return this.root.children.forEach((n,o)=>{r(n,[o])}),{count:t,sprites:e}}refresh(){const t=this.reindex();for(const[e,r]of Object.entries(this.overlay))this.applyOverride(e,r);return t}roots(){return this.root.children.map(t=>this.toNode(t))}node(t){const e=this.byId.get(t);return e?this.toNode(e):null}displayObject(t){return this.byId.get(t)??null}nameOf(t){const e=this.names.get(t),r=t.parent??null,n=t.constructor,o=t.label??null,s=t.texture??null,a=t.children?.length??0;if(e&&e.parent===r&&e.type===n&&e.own===o&&e.texture===s&&e.childCount===a)return e;const l={label:J(t),kind:b(t),parent:r,type:n,own:o,texture:s,childCount:a};return this.names.set(t,l),l}toNode(t){const e=t,{label:r,kind:n}=this.nameOf(t);return{id:e.__authId??"",label:r,kind:n,parentId:t.parent?.__authId??null,childIds:t.children.map(o=>o.__authId??"")}}getTransform(t){const e=this.byId.get(t);return!e||!e.position||!e.scale?null:{position:[e.position.x,e.position.y],rotation:e.rotation,scale:[e.scale.x,e.scale.y]}}setTransform(t,e){const r=this.byId.get(t);if(!r)return;e.position&&r.position.set(e.position[0],e.position[1]),e.rotation!==void 0&&(r.rotation=e.rotation),e.scale&&r.scale.set(e.scale[0],e.scale[1]),this.overlay[t]??={};const n=this.overlay[t];e.position&&(n.position=e.position),e.rotation!==void 0&&(n.rotation=e.rotation),e.scale&&(n.scale=e.scale),this.dirty=!0}properties(t){const e=this.byId.get(t);if(!e)return[];const r=[{path:"label",label:"Name",type:"string",value:e.label??""},{path:"visible",label:"Visible",type:"boolean",value:e.visible},{path:"alpha",label:"Alpha",type:"number",value:e.alpha}];return"tint"in e&&r.push({path:"tint",label:"Tint",type:"color",value:e.tint}),r}set(t,e,r){const n=this.byId.get(t);n&&(n[e]=r,this.overlay[t]??={},e==="label"&&(this.overlay[t].label=r),e==="alpha"&&(this.overlay[t].alpha=r),e==="tint"&&(this.overlay[t].tint=r),e==="visible"&&(this.overlay[t].visible=r),this.dirty=!0)}applyOverride(t,e){const r=this.byId.get(t);r&&(e.label!==void 0&&(r.label=e.label),e.alpha!==void 0&&(r.alpha=e.alpha),e.position&&r.position.set(e.position[0],e.position[1]),e.rotation!==void 0&&(r.rotation=e.rotation),e.scale&&r.scale.set(e.scale[0],e.scale[1]),e.tint!==void 0&&"tint"in r&&(r.tint=e.tint),e.visible!==void 0&&(r.visible=e.visible))}applyOverlay(t){let e=0,r=0;for(const[n,o]of Object.entries(t)){if(!this.byId.has(n)){r++;continue}this.applyOverride(n,o),this.overlay[n]={...this.overlay[n],...o},e++}return{applied:e,orphaned:r}}isDirty(){return this.dirty}serializeOverlay(){return this.overlay}replaceOverlay(t){this.overlay=structuredClone(t);for(const[e,r]of Object.entries(this.overlay))this.applyOverride(e,r);this.dirty=!0}markClean(){this.dirty=!1}}const pt={count:0,sprites:0};class yt{constructor(t,e,r,n=o=>queueMicrotask(o)){this.root=t,this.index=e,this.mapping=r,this.scheduleWindowClose=n,this.refresh()}current={nodes:new Map,rootIds:[],stats:pt};projectionFresh=!1;refresh(){const t=this.index.refresh();return this.current=this.readProjection(t),this.openProjectionWindow(),t}project(){return this.projectionFresh?this.current:this.reproject()}reproject(){const t=this.index.reindex();return this.current=this.readProjection(t),this.openProjectionWindow(),this.current}invalidate(){this.projectionFresh=!1}openProjectionWindow(){this.projectionFresh||(this.projectionFresh=!0,this.scheduleWindowClose(()=>{this.projectionFresh=!1}))}projection(){return this.current}object(t){const e=this.current.nodes.get(t)?.object??null;return e===null||e.destroyed?null:e}node(t){const e=this.current.nodes.get(t);if(!e)return null;const r=this.index.node(t);return r?{...r,parentId:e.parentId,childIds:[...e.childIds]}:null}roots(){return this.current.rootIds.map(t=>this.node(t)).filter(t=>t!==null)}pick(t,e,r){return this.candidates(t,e,r)[0]??null}candidates(t,e,r){const n=this.pointFromClient(t,e);return n?(this.project(),this.hitIds(n,r)):[]}pointFromClient(t,e){const r=this.mapping?.surface()??null;if(!r)return null;const n=r.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;const o=this.mapping?.pointFromClient?.(t,e,n)??null;if(this.mapping?.pointFromClient)return o;const s=Number(r.dataset?.volterStageWidth??n.width),a=Number(r.dataset?.volterStageHeight??n.height);return!(s>0)||!(a>0)?null:{x:(t-n.left)*(s/n.width),y:(e-n.top)*(a/n.height)}}hitIds(t,e){const r=[],n=[];this.collectHits(this.root,t,"visual",r),this.collectHits(this.root,t,"hitArea",n);const o=[],s=new Set;for(const a of[...r,...n]){const l=a.__authId;l&&!e(l)&&!s.has(l)&&(s.add(l),o.push(l))}return o}rect(t){const e=this.object(t);if(!e||typeof e.getBounds!="function")return null;const r=e.getBounds();return!(r.width>0)||!(r.height>0)?null:{x:r.x,y:r.y,width:r.width,height:r.height}}frame(t){const e=this.object(t);if(!e||typeof e.getLocalBounds!="function")return null;const r=e.getLocalBounds();if(!(r.width>0)||!(r.height>0))return null;const n=(o,s)=>{const a=e.toGlobal({x:o,y:s});return{x:a.x,y:a.y}};return{tl:n(r.x,r.y),tr:n(r.x+r.width,r.y),br:n(r.x+r.width,r.y+r.height),bl:n(r.x,r.y+r.height)}}contextRects(t){const e=this.node(t);if(!e)return{siblings:[]};const r=e.parentId?this.node(e.parentId)?.childIds??[]:this.current.rootIds,n=e.parentId?this.rect(e.parentId):null;return{...n?{parent:n}:{},siblings:r.filter(o=>o!==t).map(o=>this.rect(o)).filter(o=>o!==null)}}readProjection(t){const e=new Map,r=[],n=o=>{const s=this.index.displayObject(o.id);if(!s)return;const a={object:s,id:o.id,parentId:o.parentId,childIds:[...o.childIds]};e.set(o.id,a);for(const l of o.childIds){const h=this.index.node(l);h&&n(h)}};for(const o of this.index.roots())r.push(o.id),n(o);return{nodes:e,rootIds:r,stats:t}}collectHits(t,e,r,n){const o=t.children??[];for(let s=o.length-1;s>=0;s--){const a=o[s];if(!a.visible||!a.renderable)continue;a.updateLocalTransform();const l={x:0,y:0};a.localTransform.applyInverse(e,l),this.collectHits(a,l,r,n),this.contains(a,l,r)&&n.push(a)}}contains(t,e,r){if(!t.__authId)return!1;const n=t;return r==="hitArea"?n.hitArea?n.hitArea.contains(e.x,e.y):!1:typeof n.containsPoint=="function"?n.containsPoint(e):!1}}const T="pixi",gt="data-oid",mt="data-authoring-instance",bt="data-authoring-label",xt="data-authoring-component";function vt(i){if(!i||typeof i!="object")return;const t=i[gt];return typeof t=="string"&&t.length>0?t:void 0}function C(i,t){if(!i||typeof i!="object")return;const e=i[t];return typeof e=="string"&&e.length>0?e:void 0}function w(i){return C(i,mt)}function wt(i){return C(i,bt)}function St(i){return C(i,xt)}function D(i){const t=w(i);return t?w(i.parent)!==t:!1}function It(i){return D(i)?w(i):vt(i)}function Ot(i,t,e=0){return V(`${T}:${i}:${t}`,e)}function Tt(i,t){return`${T}:${i}:@${t.join(".")}`}function Qt(i,t){const e=`${T}:${i}:`;if(!t.startsWith(e))return null;const r=t.slice(e.length);if(r.startsWith("@"))return null;const n=r.indexOf("#"),o=n<0?r:r.slice(0,n);return o.length>0?o:null}function qt(i){let t=new Map;return{beginWalk:()=>{t=new Map},idFor:(e,r)=>{const n=It(e);if(n===void 0)return Tt(i,r);const o=t.get(n)??0;return t.set(n,o+1),Ot(i,n,o)}}}const P="#root";function Ct(i){if(!(!i.position||!i.scale||!i.pivot||!i.skew))return{x:i.position.x,y:i.position.y,rotation:i.rotation,scaleX:i.scale.x,scaleY:i.scale.y,pivotX:i.pivot.x,pivotY:i.pivot.y,skewX:i.skew.x,skewY:i.skew.y}}function kt(i,t){!i.position||!i.scale||!i.pivot||!i.skew||(i.position.set(t.x,t.y),i.scale.set(t.scaleX,t.scaleY),i.pivot.set(t.pivotX,t.pivotY),i.skew.set(t.skewX,t.skewY),i.rotation=t.rotation)}class jt{constructor(t,e,r,n){this.root=t,this.onRestored=n;const o=e.shell.projectHistory;this.resource=o?new Z({history:o,kind:"session-state",scope:"session",subject:{...r,id:`${r.id}/world-2d-structure`},displayName:"World 2D structure",capture:()=>this.capture(),conflictIdentity:s=>Object.fromEntries(Object.entries(s.placements).map(([a,l])=>[a,l.parent])),restore:async s=>{this.restore(s)}}):null}byUid=new Map;resource;track(t){return this.uidOf(t)}run(t,e){this.resource?.assertCanMutate();const r=this.capture(),n=e();return this.resource&&this.resource.record(t,r,this.capture()).catch(o=>{x.error(`[canvas] failed to journal "${t}" into project history — the structural edit is applied but has no history entry (it cannot be undone): ${o instanceof Error?o.message:String(o)}`,"authoring")}),n}dispose(){this.resource?.dispose(),this.byUid.clear()}uidOf(t){if(t===this.root)return P;const e=t,r=e.__volterStructUid;if(r&&this.byUid.get(r)===t)return r;const n=r??`s${crypto.randomUUID()}`;return e.__volterStructUid=n,this.byUid.set(n,t),n}capture(){const t={};for(const[e,r]of this.byUid){const n=r.parent??null,o=Ct(r);t[e]={parent:n?this.uidOf(n):null,index:n?n.children?.indexOf(r)??-1:-1,...o?{pose:o}:{}}}return{placements:t}}restore(t){const e=Object.entries(t.placements);for(const[r,n]of e){if(n.parent!==null)continue;const o=this.byUid.get(r);o?.parent?.removeChild(o)}for(const[r,n]of e.filter(([,o])=>o.parent!==null).sort((o,s)=>o[1].index-s[1].index)){const o=this.byUid.get(r);if(!o)continue;const s=n.parent===P?this.root:this.byUid.get(n.parent);if(!s||typeof s.addChildAt!="function")continue;const a=s.children.length-(o.parent===s?1:0);s.addChildAt(o,Math.max(0,Math.min(n.index,a))),n.pose&&kt(o,n.pose)}this.onRestored()}}const Et=[{kind:"container",label:"Container",description:"A general-purpose display object that holds children, and transforms and draws them together."},{kind:"sprite",label:"Sprite",extends:"container",description:"Draws one texture: an image, or a frame of a spritesheet."},{kind:"animatedSprite",label:"AnimatedSprite",extends:"sprite",description:"Plays a list of textures as frames at an animation speed."},{kind:"tilingSprite",label:"TilingSprite",extends:"container",description:"Repeats one texture across its width and height, scrollable by its tile position."},{kind:"nineSliceSprite",label:"NineSliceSprite",extends:"container",description:"Stretches a texture without stretching its corners: the nine-slice panel of a UI."},{kind:"text",label:"Text",extends:"container",description:"Draws a string with a text style (font, size, fill, wrapping)."},{kind:"bitmapText",label:"BitmapText",extends:"container",description:"Draws a string from a bitmap font: fast to change every frame."},{kind:"htmlText",label:"HTMLText",extends:"container",description:"Draws a string of HTML and CSS markup."},{kind:"graphics",label:"Graphics",extends:"container",description:"Draws vector shapes (rectangles, circles, paths) from its draw callback."},{kind:"meshPlane",label:"MeshPlane",extends:"container",description:"A textured grid of vertices that can be bent and deformed."},{kind:"perspectiveMesh",label:"PerspectiveMesh",extends:"meshPlane",description:"A texture drawn in perspective between four corner points."},{kind:"particleContainer",label:"ParticleContainer",extends:"container",description:"Draws many lightweight particles in one batch, added from code with addParticle."}],W="canvasEditLocks";function B(){return _().projectLocalState.read(W)??{}}function Pt(i,t){_().projectLocalState.write(W,{...B(),[i]:t})}const K=Et,L=/\.(png|jpe?g|webp|gif|svg)(\?.*)?$/i,Lt="a canvas structural edit would have to add, delete or move a construction statement in the world's own source, and this lane plans property writes only — an editor-created node has no construction site there at all",M="origin",Mt="#ff2d92",At="this world's write target has no origin write, so the pivot/anchor can be seen here but not dragged";function U(i){const t=i,e=t.anchor,r=t.texture;return e&&r?.orig?{anchor:e,texture:r}:null}function _t(i){const t=U(i);if(!t)return null;const e=i.bounds;return typeof e?.width=="number"&&typeof e.height=="number"?{x:e.width,y:e.height}:{x:t.texture.orig.width,y:t.texture.orig.height}}function Nt(i){return K.find(e=>e.kind===i)?.label??i}function A(i){return!!i&&typeof i.addParticle=="function"}function $t(i,t){switch(t){case"container":return new i.Container;case"sprite":{const e=new i.Sprite(i.Texture.WHITE);return e.setSize(64,64),e}case"text":return new i.Text({text:"Text",style:{fill:16777215,fontSize:24}});case"graphics":return new i.Graphics().rect(0,0,100,100).fill(16777215);case"animatedSprite":{const e=new i.AnimatedSprite([i.Texture.WHITE]);return e.setSize(64,64),e}case"tilingSprite":return new i.TilingSprite({texture:i.Texture.WHITE,width:100,height:100});case"nineSliceSprite":return new i.NineSliceSprite({texture:i.Texture.WHITE,width:100,height:100});case"bitmapText":return new i.BitmapText({text:"BitmapText",style:{fill:16777215,fontSize:24}});case"htmlText":return new i.HTMLText({text:"HTMLText",style:{fill:16777215,fontSize:24}});case"meshPlane":{const e=new i.MeshPlane({texture:i.Texture.WHITE});return e.setSize(100,100),e}case"perspectiveMesh":{const e=new i.PerspectiveMesh({texture:i.Texture.WHITE});return e.setSize(100,100),e}case"particleContainer":return new i.ParticleContainer;default:return null}}function z(i,t){const e=Ft(i,t);Ht(t,e);for(const r of t.children??[])e.addChild(z(i,r));return e}function Ft(i,t){if(t.constructor===i.Container)return new i.Container;if(t.constructor===i.Sprite){const e=t,r=new i.Sprite(e.texture);return r.anchor.set(e.anchor.x,e.anchor.y),r}if(t.constructor===i.Text){const e=t,r=new i.Text({text:e.text,style:e.style.clone()});return r.anchor.set(e.anchor.x,e.anchor.y),r}if(t.constructor===i.Graphics)return t.clone(!0);throw new Error(`"${t.label??t.constructor?.name??"this node"}" cannot be duplicated: a ${t.constructor?.name??"custom"} is constructed by the game's own code, and copying only its display half would put a lookalike with no behaviour into the world.`)}function Ht(i,t){t.label=i.label,t.position.set(i.position.x,i.position.y),t.scale.set(i.scale.x,i.scale.y),t.pivot.set(i.pivot.x,i.pivot.y),t.skew.set(i.skew.x,i.skew.y),t.rotation=i.rotation,t.alpha=i.alpha,t.visible=i.visible,"tint"in i&&"tint"in t&&(t.tint=i.tint)}function Rt(i,t){const e=i.parentLinear;if(!e)return t;const r=e.a*e.d-e.b*e.c;if(Math.abs(r)<1e-9)return t;const[,,n,o]=i.transform.rotation,s=2*Math.atan2(n,o),a=e.a*Math.cos(s)+e.c*Math.sin(s),l=e.b*Math.cos(s)+e.d*Math.sin(s),h=t*Math.PI/180,f=a*Math.cos(h)-l*Math.sin(h),d=a*Math.sin(h)+l*Math.cos(h),c=(e.d*f-e.c*d)/r,u=(-e.b*f+e.a*d)/r,p=r<0?-h:h,y=Math.atan2(u,c)-s-p,m=Math.atan2(Math.sin(y),Math.cos(y));return(p+m)*180/Math.PI}function Dt(i){const t=new Set;return(i.x!==void 0||i.y!==void 0||i.originX!==void 0||i.originY!==void 0)&&t.add("position"),(i.width!==void 0||i.height!==void 0||i.scaleXFactor!==void 0||i.scaleYFactor!==void 0)&&(t.add("scale"),(i.width!==void 0||i.height!==void 0)&&t.add("position")),i.rotate!==void 0&&t.add("rotation"),[...t]}function Wt(i,t){const e=t*Math.PI/180/2,r=Math.sin(e),n=Math.cos(e),[o,s,a,l]=i.rotation;return[o*n+s*r,s*n-o*r,a*n+l*r,l*n-a*r]}function Bt(i,t){const e={position:[...i.transform.position],rotation:[...i.transform.rotation],scale:[...i.transform.scale]},r=t.rotate;if(r!==void 0){let d=Rt(i,r);const c=t.rotationStep;if(c!==void 0&&c>0){const[,,u,p]=i.transform.rotation,y=2*Math.atan2(u,p)*180/Math.PI,m=t.rotationOffset??0;d=Math.round((y+d-m)/c)*c+m-y}e.rotation=Wt(i.transform,d)}const n=t.width;n!==void 0&&i.rect.width>0&&(e.scale[0]=i.transform.scale[0]*Math.max(1e-4,n/i.rect.width));const o=t.height;o!==void 0&&i.rect.height>0&&(e.scale[1]=i.transform.scale[1]*Math.max(1e-4,o/i.rect.height));const s=t.scaleStep,a=d=>s!==void 0&&s>0?Math.round(d/s)*s:d,l=d=>Math.abs(d)>=1e-4?d:d<0?-1e-4:1e-4,h=t.scaleXFactor;h!==void 0&&(e.scale[0]=l(a(i.transform.scale[0]*h)));const f=t.scaleYFactor;return f!==void 0&&(e.scale[1]=l(a(i.transform.scale[1]*f))),e}function Kt(i,t,e,r){return r.originX!==void 0||r.originY!==void 0?{dx:r.originX!==void 0&&i?r.originX-i.x:0,dy:r.originY!==void 0&&i?r.originY-i.y:0}:{dx:t?(r.x??e.x)-t.x:0,dy:t?(r.y??e.y)-t.y:0}}class Ut{constructor(t,e,r){this.root=t,this.store=e,this.target=r.target,this.pixi=r.pixi??G,this.transforms={dimensions:()=>"2d",get:c=>{const u=this.a2d.getTransform(c);return u?q(u):{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]}},editability:(c,u)=>this.target.transformEditability(c,u),beginEdit:c=>this.target.beginTransformEdit(c),apply:(c,u)=>{this.target.writeTransform(c,Q(u)),this.notify()},endEdit:c=>this.target.endTransformEdit(c),...this.target.removeTransform?{remove:(c,u)=>this.target.removeTransform?.(c,u)}:{}},this.loadTexture=r.loadTexture??(c=>this.pixi.Assets.load(c)),this.capturePreview=r.capturePreview,this.structureHistory=new jt(t,e,r.journal,()=>this.afterStructuralChange()),this.a2d=new ft(t,{...r.identity?{identity:r.identity}:{}}),this.projector=new yt(t,this.a2d,{surface:r.surface??(()=>null),...r.pointFromClient?{pointFromClient:r.pointFromClient}:{}}),this.provenance=this.target.provenance,r.surface&&(this.pickable={pick:(c,u)=>{const p=this.projector.pick(c,u,y=>this.isPickLocked(y));return p&&this.groupOf(p)},candidates:(c,u,p)=>this.projector.candidates(c,u,y=>p?.includeLocked?!1:this.isPickLocked(y))},this.rects={rect:c=>this.projector.rect(c),frame:c=>this.projector.frame(c),contextRects:c=>this.projector.contextRects(c)}),r.stories&&(this.stories=r.stories),this.watchStructure(t),this.capabilities={transform:!0,inspectorFields:!0,persist:this.target.provenance.source==="source-code"&&this.target.persistence!==void 0},this.target.bind({a2d:this.a2d,store:e,journal:r.journal,notify:()=>this.notify()}),this.editLockWorld=r.journal.id;const o=B()[this.editLockWorld];this.lockedPaths=new Set(o?.locked??[]),this.groupedPaths=new Set(o?.grouped??[]);const s=this.target.structure??this.liveStructure,a=c=>!!c&&A(this.projector.object(c)),l="a ParticleContainer holds particles added with addParticle, not display objects.";this.structure={...s,create:(c,u,p)=>a(u)?{id:"",ack:this.refuseStructure(l)}:s.create(c,u,p?this.pointInParent(u??null,p):void 0),...s.reparent?{reparent:(c,u)=>a(u)?this.refuseStructure(l):s.reparent(c,u)}:{},...s.paste?{paste:c=>a(c)?this.refuseStructure(l):s.paste(c)}:{},...s.canPaste?{canPaste:c=>!a(c)&&s.canPaste(c)}:{},...s.creatableKinds?{creatableKinds:c=>a(c)?[]:s.creatableKinds(c)}:{}},this.assetDrop=this.target.assetDrop??{accepts:(c,u)=>L.test(u)&&this.containerFor(c||null)!==null,drop:(c,u,p)=>this.dropAsset(c,u,p)};const h=this.target.persistence;h&&(this.persistence=h);const f=this.target.truth?.bind(this.target);f&&(this.truth={resolve:(c,u)=>f(c,u)},this.related=Y(c=>f(c,"position").site)),!r.stories&&this.target.componentIdentity&&(this.stories=X("canvas",e.shell,c=>this.target.componentIdentity?.(c)??null));const d=this.target.instances?.();d&&(this.instances={describe:c=>d.describe(c),...d.openComponent?{openComponent:c=>d.openComponent?.(c)}:{},revert:(c,u)=>d.revert(c,u),applyToComponent:(c,u)=>d.applyToComponent(c,u)})}capabilities;provenance;pickable;rects;persistence;truth;related;structure;stories;instances;transforms;a2d;projector;target;pixi;structureHistory;loadTexture;capturePreview;listeners=new Set;boxEditSessions=new Map;lockedPaths=new Set;groupedPaths=new Set;editLockWorld;pathKeys=new Map;refresh(){return this.projector.refresh()}previewImage(t,e,r){const n=this.projector.object(t);return n&&this.capturePreview?this.capturePreview(n,{width:e,height:r}):Promise.resolve(null)}notify(){for(const t of this.listeners)t()}watchedForStructure=[];structureNotifyQueued=!1;onStructureChanged=()=>{this.projector.invalidate(),!this.structureNotifyQueued&&(this.structureNotifyQueued=!0,queueMicrotask(()=>{this.structureNotifyQueued=!1,this.projector.reproject(),this.pathKeys.clear(),this.watchStructure(this.root),this.target.onReindex(),this.notify(),this.store.shell.notifyIngestEdit()}))};watchStructure(t){for(const r of this.watchedForStructure)r.off("childAdded",this.onStructureChanged),r.off("childRemoved",this.onStructureChanged);this.watchedForStructure=[];const e=r=>{typeof r.on=="function"&&typeof r.off=="function"&&(r.on("childAdded",this.onStructureChanged),r.on("childRemoved",this.onStructureChanged),this.watchedForStructure.push(r));for(const n of r.children??[])e(n)};e(t)}hierarchy={roots:()=>(this.projector.project(),this.projector.roots().map(t=>this.toEditorNode(t.id)).filter(t=>t!==null)),node:t=>this.toEditorNode(t)};toEditorNode(t){const e=this.projector.node(t);if(!e)return null;const r=this.projector.object(t),n=r?D(r):!1,o=n?St(r):void 0;return{id:e.id,label:(n&&r?wt(r):void 0)??e.label,role:n?"component":"entity",kind:e.kind,...o?{typeLabel:o}:{},parentId:e.parentId,childIds:e.childIds}}selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>{this.store.shell.selectMultiple(t),this.notify()}};liveStructure={create:(t,e,r)=>this.createStructuralNode(t,e??null,r),remove:t=>this.removeStructuralNodes([t]),removeMany:t=>this.removeStructuralNodes(t),duplicate:t=>this.duplicateStructuralNode(t),reparent:(t,e)=>this.reparentStructuralNode(t,e),reorder:(t,e)=>this.reorderStructuralNode(t,e),creatableKinds:()=>K.map(t=>({...t}))};containerFor(t){if(!t)return this.root;const e=this.projector.object(t);return!e||typeof e.addChild!="function"||A(e)?null:e}refuseStructure(t){return k({resolve:()=>j(t),record:()=>{},report:e=>x.warn(`[canvas] structural edit refused — ${e}`,"authoring")})}reportStructureLiveOnly(t){return k({resolve:()=>j(Lt),record:()=>{},report:e=>{if(this.target.reportStructureLiveOnly){this.target.reportStructureLiveOnly(t,e);return}x.log(`[canvas] ${t} is live-only — ${e}.`,"authoring")}})}afterStructuralChange(){this.projector.reproject(),this.pathKeys.clear(),this.watchStructure(this.root),this.target.onReindex(),this.notify(),this.store.shell.notifyIngestEdit()}idOf(t){return t.__authId??""}pointInParent(t,e){const r=this.containerFor(t);if(!r||typeof r.updateLocalTransform!="function")return;const n=this.localToRootMatrix(r).clone().invert().apply({x:e.x,y:e.y});return{x:n.x,y:n.y}}createStructuralNode(t,e,r){const n=this.containerFor(e);if(!n)return{id:"",ack:this.refuseStructure(`no node with id "${e}" can hold children.`)};const o=$t(this.pixi,t);if(!o)return{id:"",ack:this.refuseStructure(`"${t}" is not a kind this canvas surface can construct.`)};o.label=Nt(t),r&&o.position.set(r.x,r.y);const s=`Create ${o.label}`;return this.structureHistory.track(n),this.structureHistory.track(o),this.structureHistory.run(s,()=>{n.addChild(o)}),this.afterStructuralChange(),{id:this.idOf(o),ack:this.reportStructureLiveOnly(s)}}removeStructuralNodes(t){const e=[];let r=null;for(const o of t){const s=this.projector.object(o);if(!s?.parent){r=this.refuseStructure(`"${o}" is not a removable node in this tree.`);continue}e.push(s)}if(e.length===0)return r??this.refuseStructure("the selection held no removable node.");const n=e.length===1?`Delete ${e[0].label??"node"}`:`Delete ${e.length} nodes`;for(const o of e)this.structureHistory.track(o),o.parent&&this.structureHistory.track(o.parent);return this.structureHistory.run(n,()=>{for(const o of e)o.parent?.removeChild(o)}),this.afterStructuralChange(),this.reportStructureLiveOnly(n)}duplicateStructuralNode(t){const e=this.projector.object(t),r=e?.parent??null;if(!e||!r)throw new Error(`"${t}" is not a duplicable node in this tree.`);const n=z(this.pixi,e);n.label=`${e.label||"node"} copy`;const o=`Duplicate ${e.label??"node"}`,s=r.children.indexOf(e);return this.structureHistory.track(r),this.structureHistory.track(n),this.structureHistory.run(o,()=>{r.addChildAt(n,s+1)}),this.afterStructuralChange(),{id:this.idOf(n),ack:this.reportStructureLiveOnly(o)}}reparentStructuralNode(t,e){const r=this.projector.object(t);if(!r)return this.refuseStructure(`"${t}" is not a node in this tree.`);const n=this.containerFor(e);if(!n)return this.refuseStructure(`no node with id "${e}" can hold children.`);if(n===r||this.isAncestorOf(r,n))return this.refuseStructure("a node cannot be reparented into itself or its own descendant.");const o=this.localToRootMatrix(r),s=this.localToRootMatrix(n),a=`Move ${r.label??"node"}`;return this.structureHistory.track(r),r.parent&&this.structureHistory.track(r.parent),this.structureHistory.track(n),this.structureHistory.run(a,()=>{n.addChild(r),r.setFromMatrix(s.clone().invert().append(o))}),this.afterStructuralChange(),this.reportStructureLiveOnly(a)}reorderStructuralNode(t,e){const r=this.projector.object(t),n=r?.parent??null;if(!r||!n)return this.refuseStructure(`"${t}" is not a reorderable node in this tree.`);const o=e?this.projector.object(e):null;if(e&&(!o||o.parent!==n))return this.refuseStructure(`"${e}" is not a sibling of "${t}".`);const s=`Reorder ${r.label??"node"}`;return this.structureHistory.track(n),this.structureHistory.track(r),this.structureHistory.run(s,()=>{const a=n.children.indexOf(r),l=o?n.children.indexOf(o):n.children.length;n.addChildAt(r,Math.max(0,a<l?l-1:l))}),this.afterStructuralChange(),this.reportStructureLiveOnly(s)}isAncestorOf(t,e){let r=e.parent;for(;r;){if(r===t)return!0;r=r.parent}return!1}localToRootMatrix(t){const e=[];let r=t;for(;r&&r!==this.root;)e.push(r),r=r.parent;const n=new this.pixi.Matrix;for(let o=e.length-1;o>=0;o--){const s=e[o];s.updateLocalTransform(),n.append(s.localTransform)}return n}assetDrop;async dropAsset(t,e,r){if(!L.test(e))return this.refuseStructure(`${e} is not an image. A canvas world mounts an image as a Sprite; a model or an audio file has no display object to become here.`);const n=this.containerFor(t||null);if(!n)return this.refuseStructure(`no node with id "${t}" can hold a dropped asset.`);let o;try{o=await this.loadTexture(e)}catch(h){return this.refuseStructure(`${e} could not be loaded as a texture: ${h instanceof Error?h.message:String(h)}`)}const s=new this.pixi.Sprite(o);s.anchor.set(.5,.5),s.label=e.split("/").pop()??"Sprite";const a=r?.position;if(a){const h=this.localToRootMatrix(n).clone().invert().apply({x:a[0],y:a[1]});s.position.set(h.x,h.y)}const l=`Add ${s.label}`;return this.structureHistory.track(n),this.structureHistory.track(s),this.structureHistory.run(l,()=>{n.addChild(s)}),this.afterStructuralChange(),this.reportStructureLiveOnly(l)}boxEdit={begin:t=>{const e=this.projector.rect(t);if(!e){this.boxEditSessions.delete(t);return}const r=this.projector.object(t)?.parent?.worldTransform;this.boxEditSessions.set(t,{id:t,rect:e,transform:this.transforms.get(t),...r?{parentLinear:{a:r.a,b:r.b,c:r.c,d:r.d}}:{}}),this.transforms.beginEdit?.(t)},apply:(t,e)=>this.applyBoxEdit(t,e),end:t=>{const e=this.boxEditSessions.get(t);this.boxEditSessions.delete(t),e&&this.transforms.endEdit?.(t)},gizmoOrigin:t=>this.gizmoOriginOf(t)};gizmoOriginOf(t){const e=this.projector.object(t);if(!e||typeof e.getGlobalPosition!="function")return null;const r=e.getGlobalPosition();return{x:r.x,y:r.y}}applyBoxEdit(t,e){const r=this.boxEditSessions.get(t);if(!r||Dt(e).some(o=>this.transforms.editability?.(t,o).writable===!1))return;const n=Bt(r,e);this.transforms.apply(t,n),!(e.x===void 0&&e.y===void 0&&e.originX===void 0&&e.originY===void 0&&e.width===void 0&&e.height===void 0)&&this.repositionBoxEditBounds(t,r,e,n)}repositionBoxEditBounds(t,e,r,n){const o=this.projector.object(t);if(!o)return;const s=this.gizmoOriginOf(t),a=this.projector.rect(t),{dx:l,dy:h}=Kt(s,a,e.rect,r),f=o.parent;if(f&&typeof f.toLocal=="function"){const d=f.toLocal({x:0,y:0}),c=f.toLocal({x:l,y:h});n.position[0]+=c.x-d.x,n.position[1]+=c.y-d.y}else n.position[0]+=l,n.position[1]+=h;this.transforms.apply(t,n)}spatialHandles={layers:t=>{const e=this.originOf(t);if(!e)return[];const r=this.target.transformEditability(t,"position"),n=!!this.target.writeOrigin&&r.writable;return[{id:`origin:${t}`,category:"origin",guides:[],handles:[{id:M,label:e.kind==="anchor"?"Sprite anchor":"Pivot",position:[e.world.x,e.world.y,0],color:Mt,writable:n,...n?{}:{reason:this.target.writeOrigin&&r.reason?r.reason:At}}]}]},preview:(t,e,r)=>{this.moveOrigin(t,e,r,"preview")},commit:(t,e,r)=>this.moveOrigin(t,e,r,"commit")};originEditId=null;originOf(t){const e=this.projector.object(t);if(!e||typeof e.updateLocalTransform!="function")return null;const r=U(e),n=r?"anchor":"pivot",o=r?{x:r.anchor.x,y:r.anchor.y}:{x:e.pivot.x,y:e.pivot.y},s=r?{x:0,y:0}:o,a=this.localToRootMatrix(e).apply({x:s.x,y:s.y});return{kind:n,value:o,world:{x:a.x,y:a.y}}}moveOrigin(t,e,r,n){if(e!==M)return;const o=this.originOf(t),s=this.projector.object(t),a=this.target.writeOrigin;if(!o||!s||!a||!this.target.transformEditability(t,"position").writable)return;this.originEditId!==t&&(this.target.beginTransformEdit(t),this.originEditId=t),s.updateLocalTransform();const l=this.localToRootMatrix(s).clone().invert().apply({x:r[0],y:r[1]}),h=o.kind==="anchor"?{x:0,y:0}:o.value,f={x:l.x-h.x,y:l.y-h.y},d=o.kind==="anchor"?_t(s):null;if(o.kind==="anchor"&&(!d||d.x===0||d.y===0))return;const c=d?[o.value.x+f.x/d.x,o.value.y+f.y/d.y]:[l.x,l.y],u=s.localTransform,p=this.a2d.getTransform(t);if(a(t,o.kind,c),p&&this.target.writeTransform(t,{...p,position:[p.position[0]+u.a*f.x+u.c*f.y,p.position[1]+u.b*f.x+u.d*f.y]}),this.notify(),n==="commit"){const y=this.target.endTransformEdit(t);return this.originEditId=null,y}}inspector={properties:t=>[...this.target.properties(t),{path:"locked",label:"Locked",type:"boolean",group:"Visibility"},{path:"grouped",label:"Grouped",type:"boolean",group:"Visibility"}],get:(t,e)=>e==="locked"?this.lockedPaths.has(this.pathKeyOf(t)):e==="grouped"?this.groupedPaths.has(this.pathKeyOf(t)):this.target.get(t,e),set:(t,e,r)=>{if(e==="locked"||e==="grouped"){const n=e==="locked"?this.lockedPaths:this.groupedPaths;r===!0?n.add(this.pathKeyOf(t)):n.delete(this.pathKeyOf(t)),Pt(this.editLockWorld,{locked:[...this.lockedPaths],grouped:[...this.groupedPaths]}),this.notify();return}return this.target.set(t,e,r)},remove:(t,e)=>this.target.remove?.(t,e)};pathKeyOf(t){const e=this.pathKeys.get(t);if(e!==void 0)return e;const r=a=>this.projector.object(a)?.label??"",n=[];let o=t;for(;o;){const a=this.projector.node(o);if(!a)break;const l=a.parentId?this.projector.node(a.parentId)?.childIds??[]:this.projector.roots().map(d=>d.id),h=r(o),f=l.filter(d=>r(d)===h).indexOf(o);n.unshift(`${h}#${Math.max(0,f)}`),o=a.parentId??null}const s=n.join("/");return this.pathKeys.set(t,s),s}groupOf(t){let e=t,r=t;for(;r;)this.groupedPaths.has(this.pathKeyOf(r))&&(e=r),r=this.projector.node(r)?.parentId??null;return e}isPickLocked(t){let e=t;for(;e;){if(this.lockedPaths.has(this.pathKeyOf(e)))return!0;e=this.projector.node(e)?.parentId??null}return!1}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}dispose(){this.boxEditSessions.clear(),this.pathKeys.clear();for(const t of this.watchedForStructure)t.off("childAdded",this.onStructureChanged),t.off("childRemoved",this.onStructureChanged);this.watchedForStructure=[],this.structureHistory.dispose(),this.target.dispose(),this.listeners.clear()}}const Jt=Object.freeze(Object.defineProperty({__proto__:null,PixiAuthoringAdapter:Ut},Symbol.toStringTag,{value:"Module"}));export{Ut as P,Et as a,It as b,qt as c,D as i,Qt as o,Jt as p,vt as r};
|
|
1
|
+
import{s as G}from"./index-CFS_B4hc.js";import{Z as x,gC as X,bU as k,bV as j,r as _}from"./index-BfqJPhFO.js";import{c as Y}from"./source-persistence-backend-CbCbDOjd.js";import{c as V}from"./component-instance-root-QYCCyhxU.js";import{J as Z}from"./json-history-resource-De8KJl61.js";import{a as Q,b as q}from"./pixi-transform-channels-P4rvmusc.js";function b(i){const t=i.constructor?.name?.toLowerCase()??"container";return t.includes("animatedsprite")?"animatedsprite":t.includes("nineslice")?"nineslicesprite":t.includes("tiling")?"tilingsprite":t.includes("sprite")?"sprite":t.includes("text")?"text":t.includes("graphics")?"graphics":"container"}function J(i){const t=tt(i);if(t)return t;const e=it(i);if(e)return e;const r=rt(i);if(r)return r;const n=g(i);if(n)return n;const o=b(i),s=i.children?.length??0;return s>0?`${o} (${s})`:o}function tt(i){const t=i.label?.trim();if(t){if(N(t)&&t!==i.constructor?.name)return t;if(!$(t))return t}}function N(i){return i.length<=2&&i===i.toLowerCase()}const et=new Set(["container","displayobject","sprite","animatedsprite","nineslicesprite","tilingsprite","text","bitmaptext","htmltext","graphics","mesh"]);function $(i){return N(i)||i==="Object"||i==="Function"?!0:et.has(i.replace(/^_+/,"").toLowerCase())}function rt(i){const e=i.texture?.label?.trim();return!e||/^(_?texture)?(empty|white)$/i.test(e)?void 0:(e.split("/").pop()??e).replace(/\.[a-z0-9]+$/i,"")||void 0}function g(i){const t=i.constructor?.name;if(!(!t||$(t)))return t.replace(/^_+/,"")||void 0}function v(i){const t=i.replace(/^_+/,"");return t.length>0?t:void 0}function F(i){return"addChild"in i&&typeof i.addChild=="function"&&"children"in i}function it(i){const t={seen:new WeakSet,budget:nt};let e=i.parent;for(let r=0;r<8&&e&&typeof e=="object";r++){if(t.budget<=0)return;const n=O(e,i,t)??R(e,i,2,t);if(n)return n;e=e.parent}}const nt=2e3;function S(i){return i.budget<=0?!1:(i.budget-=1,!0)}function I(i){return/^_?[A-Za-z][A-Za-zA-Z0-9]*$/.test(i)?!ot.has(i.replace(/^_+/,"")):!1}const ot=new Set(["parent","children","transform","position","origin","scale","pivot","skew","anchor","worldTransform","localTransform","groupTransform","relativeGroupTransform","renderGroup","parentRenderGroup","parentRenderGroupIndex","parentRenderLayer","relativeRenderGroupDepth","renderPipeId","instructionSet","childrenToUpdate","childrenRenderablesToUpdate","effects","filters","mask","bounds","boundsArea","visualBounds","gpuData","texture","events","eventsCount","updateFlags"]);function O(i,t,e){if(e.seen.has(i))return;e.seen.add(i);const r=E(i,t,void 0,e);if(r)return r;for(const[n,o]of Object.entries(i)){if(!S(e))return;if(!I(n))continue;const s=H(i,n,o,t);if(s)return s;const a=E(o,t,n,e);if(a)return a}}function E(i,t,e,r){const n=dt(i);if(n)for(const[o,s]of n){if(!S(r))return;const a=st(i,s,at(o)??e,t,r);if(a)return a}}function st(i,t,e,r,n){if(e){const o=H(t&&typeof t=="object"?t:i,e,t,r);if(o)return o}else if(t&&typeof t=="object"&&t.view===r){const o=g(t);if(o)return o}if(t&&typeof t=="object"&&!F(t))return O(t,r,n)}function at(i){if(!(!i||/^\d+$/.test(i)))return I(i)||i.includes("-")?v(i)??i:void 0}function*ct(i){for(let t=0;t<i.length;t++)yield[String(t),i[t]]}function*lt(i){for(const[t,e]of i.entries())yield[String(t),e]}function*ut(i){let t=0;for(const e of i)yield[String(t),e],t+=1}function dt(i){if(!(!i||typeof i!="object")){if(Array.isArray(i))return ct(i);if(i instanceof Map)return lt(i);if(i instanceof Set)return ut(i);if(Object.getPrototypeOf(i)===Object.prototype)return Object.entries(i)}}function H(i,t,e,r){if(e===r){const n=v(t);return n&&n.toLowerCase()!=="view"?g(e)??n:g(e)??g(i)??n}if(e&&typeof e=="object"&&e.view===r)return g(e)??v(t)}function R(i,t,e,r){const n=O(i,t,r);if(n)return n;if(!(e<=0))for(const[o,s]of Object.entries(i)){if(!S(r))return;if(!I(o)||!s||typeof s!="object"||F(s))continue;const a=R(s,t,e-1,r);if(a)return a}}const ht={idFor:(i,t)=>`w2d:${t.join("/")}:${b(i)}:${i.label??""}`};class ft{constructor(t,e={}){this.root=t,e.overlay&&(this.overlay=e.overlay),this.identity=e.identity??ht,this.refresh()}byId=new Map;overlay={};dirty=!1;identity;names=new WeakMap;reindex(){this.byId.clear(),this.identity.beginWalk?.();let t=0,e=0;const r=(n,o)=>{const s=this.identity.idFor(n,o);n.__authId=s,this.byId.set(s,n),t++,b(n).includes("sprite")&&e++,n.children.forEach((a,l)=>{r(a,[...o,l])})};return this.root.children.forEach((n,o)=>{r(n,[o])}),{count:t,sprites:e}}refresh(){const t=this.reindex();for(const[e,r]of Object.entries(this.overlay))this.applyOverride(e,r);return t}roots(){return this.root.children.map(t=>this.toNode(t))}node(t){const e=this.byId.get(t);return e?this.toNode(e):null}displayObject(t){return this.byId.get(t)??null}nameOf(t){const e=this.names.get(t),r=t.parent??null,n=t.constructor,o=t.label??null,s=t.texture??null,a=t.children?.length??0;if(e&&e.parent===r&&e.type===n&&e.own===o&&e.texture===s&&e.childCount===a)return e;const l={label:J(t),kind:b(t),parent:r,type:n,own:o,texture:s,childCount:a};return this.names.set(t,l),l}toNode(t){const e=t,{label:r,kind:n}=this.nameOf(t);return{id:e.__authId??"",label:r,kind:n,parentId:t.parent?.__authId??null,childIds:t.children.map(o=>o.__authId??"")}}getTransform(t){const e=this.byId.get(t);return!e||!e.position||!e.scale?null:{position:[e.position.x,e.position.y],rotation:e.rotation,scale:[e.scale.x,e.scale.y]}}setTransform(t,e){const r=this.byId.get(t);if(!r)return;e.position&&r.position.set(e.position[0],e.position[1]),e.rotation!==void 0&&(r.rotation=e.rotation),e.scale&&r.scale.set(e.scale[0],e.scale[1]),this.overlay[t]??={};const n=this.overlay[t];e.position&&(n.position=e.position),e.rotation!==void 0&&(n.rotation=e.rotation),e.scale&&(n.scale=e.scale),this.dirty=!0}properties(t){const e=this.byId.get(t);if(!e)return[];const r=[{path:"label",label:"Name",type:"string",value:e.label??""},{path:"visible",label:"Visible",type:"boolean",value:e.visible},{path:"alpha",label:"Alpha",type:"number",value:e.alpha}];return"tint"in e&&r.push({path:"tint",label:"Tint",type:"color",value:e.tint}),r}set(t,e,r){const n=this.byId.get(t);n&&(n[e]=r,this.overlay[t]??={},e==="label"&&(this.overlay[t].label=r),e==="alpha"&&(this.overlay[t].alpha=r),e==="tint"&&(this.overlay[t].tint=r),e==="visible"&&(this.overlay[t].visible=r),this.dirty=!0)}applyOverride(t,e){const r=this.byId.get(t);r&&(e.label!==void 0&&(r.label=e.label),e.alpha!==void 0&&(r.alpha=e.alpha),e.position&&r.position.set(e.position[0],e.position[1]),e.rotation!==void 0&&(r.rotation=e.rotation),e.scale&&r.scale.set(e.scale[0],e.scale[1]),e.tint!==void 0&&"tint"in r&&(r.tint=e.tint),e.visible!==void 0&&(r.visible=e.visible))}applyOverlay(t){let e=0,r=0;for(const[n,o]of Object.entries(t)){if(!this.byId.has(n)){r++;continue}this.applyOverride(n,o),this.overlay[n]={...this.overlay[n],...o},e++}return{applied:e,orphaned:r}}isDirty(){return this.dirty}serializeOverlay(){return this.overlay}replaceOverlay(t){this.overlay=structuredClone(t);for(const[e,r]of Object.entries(this.overlay))this.applyOverride(e,r);this.dirty=!0}markClean(){this.dirty=!1}}const pt={count:0,sprites:0};class yt{constructor(t,e,r,n=o=>queueMicrotask(o)){this.root=t,this.index=e,this.mapping=r,this.scheduleWindowClose=n,this.refresh()}current={nodes:new Map,rootIds:[],stats:pt};projectionFresh=!1;refresh(){const t=this.index.refresh();return this.current=this.readProjection(t),this.openProjectionWindow(),t}project(){return this.projectionFresh?this.current:this.reproject()}reproject(){const t=this.index.reindex();return this.current=this.readProjection(t),this.openProjectionWindow(),this.current}invalidate(){this.projectionFresh=!1}openProjectionWindow(){this.projectionFresh||(this.projectionFresh=!0,this.scheduleWindowClose(()=>{this.projectionFresh=!1}))}projection(){return this.current}object(t){const e=this.current.nodes.get(t)?.object??null;return e===null||e.destroyed?null:e}node(t){const e=this.current.nodes.get(t);if(!e)return null;const r=this.index.node(t);return r?{...r,parentId:e.parentId,childIds:[...e.childIds]}:null}roots(){return this.current.rootIds.map(t=>this.node(t)).filter(t=>t!==null)}pick(t,e,r){return this.candidates(t,e,r)[0]??null}candidates(t,e,r){const n=this.pointFromClient(t,e);return n?(this.project(),this.hitIds(n,r)):[]}pointFromClient(t,e){const r=this.mapping?.surface()??null;if(!r)return null;const n=r.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;const o=this.mapping?.pointFromClient?.(t,e,n)??null;if(this.mapping?.pointFromClient)return o;const s=Number(r.dataset?.volterStageWidth??n.width),a=Number(r.dataset?.volterStageHeight??n.height);return!(s>0)||!(a>0)?null:{x:(t-n.left)*(s/n.width),y:(e-n.top)*(a/n.height)}}hitIds(t,e){const r=[],n=[];this.collectHits(this.root,t,"visual",r),this.collectHits(this.root,t,"hitArea",n);const o=[],s=new Set;for(const a of[...r,...n]){const l=a.__authId;l&&!e(l)&&!s.has(l)&&(s.add(l),o.push(l))}return o}rect(t){const e=this.object(t);if(!e||typeof e.getBounds!="function")return null;const r=e.getBounds();return!(r.width>0)||!(r.height>0)?null:{x:r.x,y:r.y,width:r.width,height:r.height}}frame(t){const e=this.object(t);if(!e||typeof e.getLocalBounds!="function")return null;const r=e.getLocalBounds();if(!(r.width>0)||!(r.height>0))return null;const n=(o,s)=>{const a=e.toGlobal({x:o,y:s});return{x:a.x,y:a.y}};return{tl:n(r.x,r.y),tr:n(r.x+r.width,r.y),br:n(r.x+r.width,r.y+r.height),bl:n(r.x,r.y+r.height)}}contextRects(t){const e=this.node(t);if(!e)return{siblings:[]};const r=e.parentId?this.node(e.parentId)?.childIds??[]:this.current.rootIds,n=e.parentId?this.rect(e.parentId):null;return{...n?{parent:n}:{},siblings:r.filter(o=>o!==t).map(o=>this.rect(o)).filter(o=>o!==null)}}readProjection(t){const e=new Map,r=[],n=o=>{const s=this.index.displayObject(o.id);if(!s)return;const a={object:s,id:o.id,parentId:o.parentId,childIds:[...o.childIds]};e.set(o.id,a);for(const l of o.childIds){const h=this.index.node(l);h&&n(h)}};for(const o of this.index.roots())r.push(o.id),n(o);return{nodes:e,rootIds:r,stats:t}}collectHits(t,e,r,n){const o=t.children??[];for(let s=o.length-1;s>=0;s--){const a=o[s];if(!a.visible||!a.renderable)continue;a.updateLocalTransform();const l={x:0,y:0};a.localTransform.applyInverse(e,l),this.collectHits(a,l,r,n),this.contains(a,l,r)&&n.push(a)}}contains(t,e,r){if(!t.__authId)return!1;const n=t;return r==="hitArea"?n.hitArea?n.hitArea.contains(e.x,e.y):!1:typeof n.containsPoint=="function"?n.containsPoint(e):!1}}const T="pixi",gt="data-oid",mt="data-authoring-instance",bt="data-authoring-label",xt="data-authoring-component";function vt(i){if(!i||typeof i!="object")return;const t=i[gt];return typeof t=="string"&&t.length>0?t:void 0}function C(i,t){if(!i||typeof i!="object")return;const e=i[t];return typeof e=="string"&&e.length>0?e:void 0}function w(i){return C(i,mt)}function wt(i){return C(i,bt)}function St(i){return C(i,xt)}function D(i){const t=w(i);return t?w(i.parent)!==t:!1}function It(i){return D(i)?w(i):vt(i)}function Ot(i,t,e=0){return V(`${T}:${i}:${t}`,e)}function Tt(i,t){return`${T}:${i}:@${t.join(".")}`}function Qt(i,t){const e=`${T}:${i}:`;if(!t.startsWith(e))return null;const r=t.slice(e.length);if(r.startsWith("@"))return null;const n=r.indexOf("#"),o=n<0?r:r.slice(0,n);return o.length>0?o:null}function qt(i){let t=new Map;return{beginWalk:()=>{t=new Map},idFor:(e,r)=>{const n=It(e);if(n===void 0)return Tt(i,r);const o=t.get(n)??0;return t.set(n,o+1),Ot(i,n,o)}}}const P="#root";function Ct(i){if(!(!i.position||!i.scale||!i.pivot||!i.skew))return{x:i.position.x,y:i.position.y,rotation:i.rotation,scaleX:i.scale.x,scaleY:i.scale.y,pivotX:i.pivot.x,pivotY:i.pivot.y,skewX:i.skew.x,skewY:i.skew.y}}function kt(i,t){!i.position||!i.scale||!i.pivot||!i.skew||(i.position.set(t.x,t.y),i.scale.set(t.scaleX,t.scaleY),i.pivot.set(t.pivotX,t.pivotY),i.skew.set(t.skewX,t.skewY),i.rotation=t.rotation)}class jt{constructor(t,e,r,n){this.root=t,this.onRestored=n;const o=e.shell.projectHistory;this.resource=o?new Z({history:o,kind:"session-state",scope:"session",subject:{...r,id:`${r.id}/world-2d-structure`},displayName:"World 2D structure",capture:()=>this.capture(),conflictIdentity:s=>Object.fromEntries(Object.entries(s.placements).map(([a,l])=>[a,l.parent])),restore:async s=>{this.restore(s)}}):null}byUid=new Map;resource;track(t){return this.uidOf(t)}run(t,e){this.resource?.assertCanMutate();const r=this.capture(),n=e();return this.resource&&this.resource.record(t,r,this.capture()).catch(o=>{x.error(`[canvas] failed to journal "${t}" into project history — the structural edit is applied but has no history entry (it cannot be undone): ${o instanceof Error?o.message:String(o)}`,"authoring")}),n}dispose(){this.resource?.dispose(),this.byUid.clear()}uidOf(t){if(t===this.root)return P;const e=t,r=e.__volterStructUid;if(r&&this.byUid.get(r)===t)return r;const n=r??`s${crypto.randomUUID()}`;return e.__volterStructUid=n,this.byUid.set(n,t),n}capture(){const t={};for(const[e,r]of this.byUid){const n=r.parent??null,o=Ct(r);t[e]={parent:n?this.uidOf(n):null,index:n?n.children?.indexOf(r)??-1:-1,...o?{pose:o}:{}}}return{placements:t}}restore(t){const e=Object.entries(t.placements);for(const[r,n]of e){if(n.parent!==null)continue;const o=this.byUid.get(r);o?.parent?.removeChild(o)}for(const[r,n]of e.filter(([,o])=>o.parent!==null).sort((o,s)=>o[1].index-s[1].index)){const o=this.byUid.get(r);if(!o)continue;const s=n.parent===P?this.root:this.byUid.get(n.parent);if(!s||typeof s.addChildAt!="function")continue;const a=s.children.length-(o.parent===s?1:0);s.addChildAt(o,Math.max(0,Math.min(n.index,a))),n.pose&&kt(o,n.pose)}this.onRestored()}}const Et=[{kind:"container",label:"Container",description:"A general-purpose display object that holds children, and transforms and draws them together."},{kind:"sprite",label:"Sprite",extends:"container",description:"Draws one texture: an image, or a frame of a spritesheet."},{kind:"animatedSprite",label:"AnimatedSprite",extends:"sprite",description:"Plays a list of textures as frames at an animation speed."},{kind:"tilingSprite",label:"TilingSprite",extends:"container",description:"Repeats one texture across its width and height, scrollable by its tile position."},{kind:"nineSliceSprite",label:"NineSliceSprite",extends:"container",description:"Stretches a texture without stretching its corners: the nine-slice panel of a UI."},{kind:"text",label:"Text",extends:"container",description:"Draws a string with a text style (font, size, fill, wrapping)."},{kind:"bitmapText",label:"BitmapText",extends:"container",description:"Draws a string from a bitmap font: fast to change every frame."},{kind:"htmlText",label:"HTMLText",extends:"container",description:"Draws a string of HTML and CSS markup."},{kind:"graphics",label:"Graphics",extends:"container",description:"Draws vector shapes (rectangles, circles, paths) from its draw callback."},{kind:"meshPlane",label:"MeshPlane",extends:"container",description:"A textured grid of vertices that can be bent and deformed."},{kind:"perspectiveMesh",label:"PerspectiveMesh",extends:"meshPlane",description:"A texture drawn in perspective between four corner points."},{kind:"particleContainer",label:"ParticleContainer",extends:"container",description:"Draws many lightweight particles in one batch, added from code with addParticle."}],W="canvasEditLocks";function B(){return _().projectLocalState.read(W)??{}}function Pt(i,t){_().projectLocalState.write(W,{...B(),[i]:t})}const K=Et,L=/\.(png|jpe?g|webp|gif|svg)(\?.*)?$/i,Lt="a canvas structural edit would have to add, delete or move a construction statement in the world's own source, and this lane plans property writes only — an editor-created node has no construction site there at all",M="origin",Mt="#ff2d92",At="this world's write target has no origin write, so the pivot/anchor can be seen here but not dragged";function U(i){const t=i,e=t.anchor,r=t.texture;return e&&r?.orig?{anchor:e,texture:r}:null}function _t(i){const t=U(i);if(!t)return null;const e=i.bounds;return typeof e?.width=="number"&&typeof e.height=="number"?{x:e.width,y:e.height}:{x:t.texture.orig.width,y:t.texture.orig.height}}function Nt(i){return K.find(e=>e.kind===i)?.label??i}function A(i){return!!i&&typeof i.addParticle=="function"}function $t(i,t){switch(t){case"container":return new i.Container;case"sprite":{const e=new i.Sprite(i.Texture.WHITE);return e.setSize(64,64),e}case"text":return new i.Text({text:"Text",style:{fill:16777215,fontSize:24}});case"graphics":return new i.Graphics().rect(0,0,100,100).fill(16777215);case"animatedSprite":{const e=new i.AnimatedSprite([i.Texture.WHITE]);return e.setSize(64,64),e}case"tilingSprite":return new i.TilingSprite({texture:i.Texture.WHITE,width:100,height:100});case"nineSliceSprite":return new i.NineSliceSprite({texture:i.Texture.WHITE,width:100,height:100});case"bitmapText":return new i.BitmapText({text:"BitmapText",style:{fill:16777215,fontSize:24}});case"htmlText":return new i.HTMLText({text:"HTMLText",style:{fill:16777215,fontSize:24}});case"meshPlane":{const e=new i.MeshPlane({texture:i.Texture.WHITE});return e.setSize(100,100),e}case"perspectiveMesh":{const e=new i.PerspectiveMesh({texture:i.Texture.WHITE});return e.setSize(100,100),e}case"particleContainer":return new i.ParticleContainer;default:return null}}function z(i,t){const e=Ft(i,t);Ht(t,e);for(const r of t.children??[])e.addChild(z(i,r));return e}function Ft(i,t){if(t.constructor===i.Container)return new i.Container;if(t.constructor===i.Sprite){const e=t,r=new i.Sprite(e.texture);return r.anchor.set(e.anchor.x,e.anchor.y),r}if(t.constructor===i.Text){const e=t,r=new i.Text({text:e.text,style:e.style.clone()});return r.anchor.set(e.anchor.x,e.anchor.y),r}if(t.constructor===i.Graphics)return t.clone(!0);throw new Error(`"${t.label??t.constructor?.name??"this node"}" cannot be duplicated: a ${t.constructor?.name??"custom"} is constructed by the game's own code, and copying only its display half would put a lookalike with no behaviour into the world.`)}function Ht(i,t){t.label=i.label,t.position.set(i.position.x,i.position.y),t.scale.set(i.scale.x,i.scale.y),t.pivot.set(i.pivot.x,i.pivot.y),t.skew.set(i.skew.x,i.skew.y),t.rotation=i.rotation,t.alpha=i.alpha,t.visible=i.visible,"tint"in i&&"tint"in t&&(t.tint=i.tint)}function Rt(i,t){const e=i.parentLinear;if(!e)return t;const r=e.a*e.d-e.b*e.c;if(Math.abs(r)<1e-9)return t;const[,,n,o]=i.transform.rotation,s=2*Math.atan2(n,o),a=e.a*Math.cos(s)+e.c*Math.sin(s),l=e.b*Math.cos(s)+e.d*Math.sin(s),h=t*Math.PI/180,f=a*Math.cos(h)-l*Math.sin(h),d=a*Math.sin(h)+l*Math.cos(h),c=(e.d*f-e.c*d)/r,u=(-e.b*f+e.a*d)/r,p=r<0?-h:h,y=Math.atan2(u,c)-s-p,m=Math.atan2(Math.sin(y),Math.cos(y));return(p+m)*180/Math.PI}function Dt(i){const t=new Set;return(i.x!==void 0||i.y!==void 0||i.originX!==void 0||i.originY!==void 0)&&t.add("position"),(i.width!==void 0||i.height!==void 0||i.scaleXFactor!==void 0||i.scaleYFactor!==void 0)&&(t.add("scale"),(i.width!==void 0||i.height!==void 0)&&t.add("position")),i.rotate!==void 0&&t.add("rotation"),[...t]}function Wt(i,t){const e=t*Math.PI/180/2,r=Math.sin(e),n=Math.cos(e),[o,s,a,l]=i.rotation;return[o*n+s*r,s*n-o*r,a*n+l*r,l*n-a*r]}function Bt(i,t){const e={position:[...i.transform.position],rotation:[...i.transform.rotation],scale:[...i.transform.scale]},r=t.rotate;if(r!==void 0){let d=Rt(i,r);const c=t.rotationStep;if(c!==void 0&&c>0){const[,,u,p]=i.transform.rotation,y=2*Math.atan2(u,p)*180/Math.PI,m=t.rotationOffset??0;d=Math.round((y+d-m)/c)*c+m-y}e.rotation=Wt(i.transform,d)}const n=t.width;n!==void 0&&i.rect.width>0&&(e.scale[0]=i.transform.scale[0]*Math.max(1e-4,n/i.rect.width));const o=t.height;o!==void 0&&i.rect.height>0&&(e.scale[1]=i.transform.scale[1]*Math.max(1e-4,o/i.rect.height));const s=t.scaleStep,a=d=>s!==void 0&&s>0?Math.round(d/s)*s:d,l=d=>Math.abs(d)>=1e-4?d:d<0?-1e-4:1e-4,h=t.scaleXFactor;h!==void 0&&(e.scale[0]=l(a(i.transform.scale[0]*h)));const f=t.scaleYFactor;return f!==void 0&&(e.scale[1]=l(a(i.transform.scale[1]*f))),e}function Kt(i,t,e,r){return r.originX!==void 0||r.originY!==void 0?{dx:r.originX!==void 0&&i?r.originX-i.x:0,dy:r.originY!==void 0&&i?r.originY-i.y:0}:{dx:t?(r.x??e.x)-t.x:0,dy:t?(r.y??e.y)-t.y:0}}class Ut{constructor(t,e,r){this.root=t,this.store=e,this.target=r.target,this.pixi=r.pixi??G,this.transforms={dimensions:()=>"2d",get:c=>{const u=this.a2d.getTransform(c);return u?q(u):{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]}},editability:(c,u)=>this.target.transformEditability(c,u),beginEdit:c=>this.target.beginTransformEdit(c),apply:(c,u)=>{this.target.writeTransform(c,Q(u)),this.notify()},endEdit:c=>this.target.endTransformEdit(c),...this.target.removeTransform?{remove:(c,u)=>this.target.removeTransform?.(c,u)}:{}},this.loadTexture=r.loadTexture??(c=>this.pixi.Assets.load(c)),this.capturePreview=r.capturePreview,this.structureHistory=new jt(t,e,r.journal,()=>this.afterStructuralChange()),this.a2d=new ft(t,{...r.identity?{identity:r.identity}:{}}),this.projector=new yt(t,this.a2d,{surface:r.surface??(()=>null),...r.pointFromClient?{pointFromClient:r.pointFromClient}:{}}),this.provenance=this.target.provenance,r.surface&&(this.pickable={pick:(c,u)=>{const p=this.projector.pick(c,u,y=>this.isPickLocked(y));return p&&this.groupOf(p)},candidates:(c,u,p)=>this.projector.candidates(c,u,y=>p?.includeLocked?!1:this.isPickLocked(y))},this.rects={rect:c=>this.projector.rect(c),frame:c=>this.projector.frame(c),contextRects:c=>this.projector.contextRects(c)}),r.stories&&(this.stories=r.stories),this.watchStructure(t),this.capabilities={transform:!0,inspectorFields:!0,persist:this.target.provenance.source==="source-code"&&this.target.persistence!==void 0},this.target.bind({a2d:this.a2d,store:e,journal:r.journal,notify:()=>this.notify()}),this.editLockWorld=r.journal.id;const o=B()[this.editLockWorld];this.lockedPaths=new Set(o?.locked??[]),this.groupedPaths=new Set(o?.grouped??[]);const s=this.target.structure??this.liveStructure,a=c=>!!c&&A(this.projector.object(c)),l="a ParticleContainer holds particles added with addParticle, not display objects.";this.structure={...s,create:(c,u,p)=>a(u)?{id:"",ack:this.refuseStructure(l)}:s.create(c,u,p?this.pointInParent(u??null,p):void 0),...s.reparent?{reparent:(c,u)=>a(u)?this.refuseStructure(l):s.reparent(c,u)}:{},...s.paste?{paste:c=>a(c)?this.refuseStructure(l):s.paste(c)}:{},...s.canPaste?{canPaste:c=>!a(c)&&s.canPaste(c)}:{},...s.creatableKinds?{creatableKinds:c=>a(c)?[]:s.creatableKinds(c)}:{}},this.assetDrop=this.target.assetDrop??{accepts:(c,u)=>L.test(u)&&this.containerFor(c||null)!==null,drop:(c,u,p)=>this.dropAsset(c,u,p)};const h=this.target.persistence;h&&(this.persistence=h);const f=this.target.truth?.bind(this.target);f&&(this.truth={resolve:(c,u)=>f(c,u)},this.related=Y(c=>f(c,"position").site)),!r.stories&&this.target.componentIdentity&&(this.stories=X("canvas",e.shell,c=>this.target.componentIdentity?.(c)??null));const d=this.target.instances?.();d&&(this.instances={describe:c=>d.describe(c),...d.openComponent?{openComponent:c=>d.openComponent?.(c)}:{},revert:(c,u)=>d.revert(c,u),applyToComponent:(c,u)=>d.applyToComponent(c,u)})}capabilities;provenance;pickable;rects;persistence;truth;related;structure;stories;instances;transforms;a2d;projector;target;pixi;structureHistory;loadTexture;capturePreview;listeners=new Set;boxEditSessions=new Map;lockedPaths=new Set;groupedPaths=new Set;editLockWorld;pathKeys=new Map;refresh(){return this.projector.refresh()}previewImage(t,e,r){const n=this.projector.object(t);return n&&this.capturePreview?this.capturePreview(n,{width:e,height:r}):Promise.resolve(null)}notify(){for(const t of this.listeners)t()}watchedForStructure=[];structureNotifyQueued=!1;onStructureChanged=()=>{this.projector.invalidate(),!this.structureNotifyQueued&&(this.structureNotifyQueued=!0,queueMicrotask(()=>{this.structureNotifyQueued=!1,this.projector.reproject(),this.pathKeys.clear(),this.watchStructure(this.root),this.target.onReindex(),this.notify(),this.store.shell.notifyIngestEdit()}))};watchStructure(t){for(const r of this.watchedForStructure)r.off("childAdded",this.onStructureChanged),r.off("childRemoved",this.onStructureChanged);this.watchedForStructure=[];const e=r=>{typeof r.on=="function"&&typeof r.off=="function"&&(r.on("childAdded",this.onStructureChanged),r.on("childRemoved",this.onStructureChanged),this.watchedForStructure.push(r));for(const n of r.children??[])e(n)};e(t)}hierarchy={roots:()=>(this.projector.project(),this.projector.roots().map(t=>this.toEditorNode(t.id)).filter(t=>t!==null)),node:t=>this.toEditorNode(t)};toEditorNode(t){const e=this.projector.node(t);if(!e)return null;const r=this.projector.object(t),n=r?D(r):!1,o=n?St(r):void 0;return{id:e.id,label:(n&&r?wt(r):void 0)??e.label,role:n?"component":"entity",kind:e.kind,...o?{typeLabel:o}:{},parentId:e.parentId,childIds:e.childIds}}selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>{this.store.shell.selectMultiple(t),this.notify()}};liveStructure={create:(t,e,r)=>this.createStructuralNode(t,e??null,r),remove:t=>this.removeStructuralNodes([t]),removeMany:t=>this.removeStructuralNodes(t),duplicate:t=>this.duplicateStructuralNode(t),reparent:(t,e)=>this.reparentStructuralNode(t,e),reorder:(t,e)=>this.reorderStructuralNode(t,e),creatableKinds:()=>K.map(t=>({...t}))};containerFor(t){if(!t)return this.root;const e=this.projector.object(t);return!e||typeof e.addChild!="function"||A(e)?null:e}refuseStructure(t){return k({resolve:()=>j(t),record:()=>{},report:e=>x.warn(`[canvas] structural edit refused — ${e}`,"authoring")})}reportStructureLiveOnly(t){return k({resolve:()=>j(Lt),record:()=>{},report:e=>{if(this.target.reportStructureLiveOnly){this.target.reportStructureLiveOnly(t,e);return}x.log(`[canvas] ${t} is live-only — ${e}.`,"authoring")}})}afterStructuralChange(){this.projector.reproject(),this.pathKeys.clear(),this.watchStructure(this.root),this.target.onReindex(),this.notify(),this.store.shell.notifyIngestEdit()}idOf(t){return t.__authId??""}pointInParent(t,e){const r=this.containerFor(t);if(!r||typeof r.updateLocalTransform!="function")return;const n=this.localToRootMatrix(r).clone().invert().apply({x:e.x,y:e.y});return{x:n.x,y:n.y}}createStructuralNode(t,e,r){const n=this.containerFor(e);if(!n)return{id:"",ack:this.refuseStructure(`no node with id "${e}" can hold children.`)};const o=$t(this.pixi,t);if(!o)return{id:"",ack:this.refuseStructure(`"${t}" is not a kind this canvas surface can construct.`)};o.label=Nt(t),r&&o.position.set(r.x,r.y);const s=`Create ${o.label}`;return this.structureHistory.track(n),this.structureHistory.track(o),this.structureHistory.run(s,()=>{n.addChild(o)}),this.afterStructuralChange(),{id:this.idOf(o),ack:this.reportStructureLiveOnly(s)}}removeStructuralNodes(t){const e=[];let r=null;for(const o of t){const s=this.projector.object(o);if(!s?.parent){r=this.refuseStructure(`"${o}" is not a removable node in this tree.`);continue}e.push(s)}if(e.length===0)return r??this.refuseStructure("the selection held no removable node.");const n=e.length===1?`Delete ${e[0].label??"node"}`:`Delete ${e.length} nodes`;for(const o of e)this.structureHistory.track(o),o.parent&&this.structureHistory.track(o.parent);return this.structureHistory.run(n,()=>{for(const o of e)o.parent?.removeChild(o)}),this.afterStructuralChange(),this.reportStructureLiveOnly(n)}duplicateStructuralNode(t){const e=this.projector.object(t),r=e?.parent??null;if(!e||!r)throw new Error(`"${t}" is not a duplicable node in this tree.`);const n=z(this.pixi,e);n.label=`${e.label||"node"} copy`;const o=`Duplicate ${e.label??"node"}`,s=r.children.indexOf(e);return this.structureHistory.track(r),this.structureHistory.track(n),this.structureHistory.run(o,()=>{r.addChildAt(n,s+1)}),this.afterStructuralChange(),{id:this.idOf(n),ack:this.reportStructureLiveOnly(o)}}reparentStructuralNode(t,e){const r=this.projector.object(t);if(!r)return this.refuseStructure(`"${t}" is not a node in this tree.`);const n=this.containerFor(e);if(!n)return this.refuseStructure(`no node with id "${e}" can hold children.`);if(n===r||this.isAncestorOf(r,n))return this.refuseStructure("a node cannot be reparented into itself or its own descendant.");const o=this.localToRootMatrix(r),s=this.localToRootMatrix(n),a=`Move ${r.label??"node"}`;return this.structureHistory.track(r),r.parent&&this.structureHistory.track(r.parent),this.structureHistory.track(n),this.structureHistory.run(a,()=>{n.addChild(r),r.setFromMatrix(s.clone().invert().append(o))}),this.afterStructuralChange(),this.reportStructureLiveOnly(a)}reorderStructuralNode(t,e){const r=this.projector.object(t),n=r?.parent??null;if(!r||!n)return this.refuseStructure(`"${t}" is not a reorderable node in this tree.`);const o=e?this.projector.object(e):null;if(e&&(!o||o.parent!==n))return this.refuseStructure(`"${e}" is not a sibling of "${t}".`);const s=`Reorder ${r.label??"node"}`;return this.structureHistory.track(n),this.structureHistory.track(r),this.structureHistory.run(s,()=>{const a=n.children.indexOf(r),l=o?n.children.indexOf(o):n.children.length;n.addChildAt(r,Math.max(0,a<l?l-1:l))}),this.afterStructuralChange(),this.reportStructureLiveOnly(s)}isAncestorOf(t,e){let r=e.parent;for(;r;){if(r===t)return!0;r=r.parent}return!1}localToRootMatrix(t){const e=[];let r=t;for(;r&&r!==this.root;)e.push(r),r=r.parent;const n=new this.pixi.Matrix;for(let o=e.length-1;o>=0;o--){const s=e[o];s.updateLocalTransform(),n.append(s.localTransform)}return n}assetDrop;async dropAsset(t,e,r){if(!L.test(e))return this.refuseStructure(`${e} is not an image. A canvas world mounts an image as a Sprite; a model or an audio file has no display object to become here.`);const n=this.containerFor(t||null);if(!n)return this.refuseStructure(`no node with id "${t}" can hold a dropped asset.`);let o;try{o=await this.loadTexture(e)}catch(h){return this.refuseStructure(`${e} could not be loaded as a texture: ${h instanceof Error?h.message:String(h)}`)}const s=new this.pixi.Sprite(o);s.anchor.set(.5,.5),s.label=e.split("/").pop()??"Sprite";const a=r?.position;if(a){const h=this.localToRootMatrix(n).clone().invert().apply({x:a[0],y:a[1]});s.position.set(h.x,h.y)}const l=`Add ${s.label}`;return this.structureHistory.track(n),this.structureHistory.track(s),this.structureHistory.run(l,()=>{n.addChild(s)}),this.afterStructuralChange(),this.reportStructureLiveOnly(l)}boxEdit={begin:t=>{const e=this.projector.rect(t);if(!e){this.boxEditSessions.delete(t);return}const r=this.projector.object(t)?.parent?.worldTransform;this.boxEditSessions.set(t,{id:t,rect:e,transform:this.transforms.get(t),...r?{parentLinear:{a:r.a,b:r.b,c:r.c,d:r.d}}:{}}),this.transforms.beginEdit?.(t)},apply:(t,e)=>this.applyBoxEdit(t,e),end:t=>{const e=this.boxEditSessions.get(t);this.boxEditSessions.delete(t),e&&this.transforms.endEdit?.(t)},gizmoOrigin:t=>this.gizmoOriginOf(t)};gizmoOriginOf(t){const e=this.projector.object(t);if(!e||typeof e.getGlobalPosition!="function")return null;const r=e.getGlobalPosition();return{x:r.x,y:r.y}}applyBoxEdit(t,e){const r=this.boxEditSessions.get(t);if(!r||Dt(e).some(o=>this.transforms.editability?.(t,o).writable===!1))return;const n=Bt(r,e);this.transforms.apply(t,n),!(e.x===void 0&&e.y===void 0&&e.originX===void 0&&e.originY===void 0&&e.width===void 0&&e.height===void 0)&&this.repositionBoxEditBounds(t,r,e,n)}repositionBoxEditBounds(t,e,r,n){const o=this.projector.object(t);if(!o)return;const s=this.gizmoOriginOf(t),a=this.projector.rect(t),{dx:l,dy:h}=Kt(s,a,e.rect,r),f=o.parent;if(f&&typeof f.toLocal=="function"){const d=f.toLocal({x:0,y:0}),c=f.toLocal({x:l,y:h});n.position[0]+=c.x-d.x,n.position[1]+=c.y-d.y}else n.position[0]+=l,n.position[1]+=h;this.transforms.apply(t,n)}spatialHandles={layers:t=>{const e=this.originOf(t);if(!e)return[];const r=this.target.transformEditability(t,"position"),n=!!this.target.writeOrigin&&r.writable;return[{id:`origin:${t}`,category:"origin",guides:[],handles:[{id:M,label:e.kind==="anchor"?"Sprite anchor":"Pivot",position:[e.world.x,e.world.y,0],color:Mt,writable:n,...n?{}:{reason:this.target.writeOrigin&&r.reason?r.reason:At}}]}]},preview:(t,e,r)=>{this.moveOrigin(t,e,r,"preview")},commit:(t,e,r)=>this.moveOrigin(t,e,r,"commit")};originEditId=null;originOf(t){const e=this.projector.object(t);if(!e||typeof e.updateLocalTransform!="function")return null;const r=U(e),n=r?"anchor":"pivot",o=r?{x:r.anchor.x,y:r.anchor.y}:{x:e.pivot.x,y:e.pivot.y},s=r?{x:0,y:0}:o,a=this.localToRootMatrix(e).apply({x:s.x,y:s.y});return{kind:n,value:o,world:{x:a.x,y:a.y}}}moveOrigin(t,e,r,n){if(e!==M)return;const o=this.originOf(t),s=this.projector.object(t),a=this.target.writeOrigin;if(!o||!s||!a||!this.target.transformEditability(t,"position").writable)return;this.originEditId!==t&&(this.target.beginTransformEdit(t),this.originEditId=t),s.updateLocalTransform();const l=this.localToRootMatrix(s).clone().invert().apply({x:r[0],y:r[1]}),h=o.kind==="anchor"?{x:0,y:0}:o.value,f={x:l.x-h.x,y:l.y-h.y},d=o.kind==="anchor"?_t(s):null;if(o.kind==="anchor"&&(!d||d.x===0||d.y===0))return;const c=d?[o.value.x+f.x/d.x,o.value.y+f.y/d.y]:[l.x,l.y],u=s.localTransform,p=this.a2d.getTransform(t);if(a(t,o.kind,c),p&&this.target.writeTransform(t,{...p,position:[p.position[0]+u.a*f.x+u.c*f.y,p.position[1]+u.b*f.x+u.d*f.y]}),this.notify(),n==="commit"){const y=this.target.endTransformEdit(t);return this.originEditId=null,y}}inspector={properties:t=>[...this.target.properties(t),{path:"locked",label:"Locked",type:"boolean",group:"Visibility"},{path:"grouped",label:"Grouped",type:"boolean",group:"Visibility"}],get:(t,e)=>e==="locked"?this.lockedPaths.has(this.pathKeyOf(t)):e==="grouped"?this.groupedPaths.has(this.pathKeyOf(t)):this.target.get(t,e),set:(t,e,r)=>{if(e==="locked"||e==="grouped"){const n=e==="locked"?this.lockedPaths:this.groupedPaths;r===!0?n.add(this.pathKeyOf(t)):n.delete(this.pathKeyOf(t)),Pt(this.editLockWorld,{locked:[...this.lockedPaths],grouped:[...this.groupedPaths]}),this.notify();return}return this.target.set(t,e,r)},remove:(t,e)=>this.target.remove?.(t,e)};pathKeyOf(t){const e=this.pathKeys.get(t);if(e!==void 0)return e;const r=a=>this.projector.object(a)?.label??"",n=[];let o=t;for(;o;){const a=this.projector.node(o);if(!a)break;const l=a.parentId?this.projector.node(a.parentId)?.childIds??[]:this.projector.roots().map(d=>d.id),h=r(o),f=l.filter(d=>r(d)===h).indexOf(o);n.unshift(`${h}#${Math.max(0,f)}`),o=a.parentId??null}const s=n.join("/");return this.pathKeys.set(t,s),s}groupOf(t){let e=t,r=t;for(;r;)this.groupedPaths.has(this.pathKeyOf(r))&&(e=r),r=this.projector.node(r)?.parentId??null;return e}isPickLocked(t){let e=t;for(;e;){if(this.lockedPaths.has(this.pathKeyOf(e)))return!0;e=this.projector.node(e)?.parentId??null}return!1}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}dispose(){this.boxEditSessions.clear(),this.pathKeys.clear();for(const t of this.watchedForStructure)t.off("childAdded",this.onStructureChanged),t.off("childRemoved",this.onStructureChanged);this.watchedForStructure=[],this.structureHistory.dispose(),this.target.dispose(),this.listeners.clear()}}const Jt=Object.freeze(Object.defineProperty({__proto__:null,PixiAuthoringAdapter:Ut},Symbol.toStringTag,{value:"Module"}));export{Ut as P,Et as a,It as b,qt as c,D as i,Qt as o,Jt as p,vt as r};
|
package/dist/assets/{pixi-live-write-target-BcUhtqmJ.js → pixi-live-write-target-coTAFFGW.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Z as N,bU as G,bV as Q,q as L,ay as X,bW as ee,bS as te,bT as ne}from"./index-
|
|
1
|
+
import{Z as N,bU as G,bV as Q,q as L,ay as X,bW as ee,bS as te,bT as ne}from"./index-BfqJPhFO.js";import{J as re,c as _}from"./json-history-resource-De8KJl61.js";import{m as ie,p as se}from"./source-persistence-backend-CbCbDOjd.js";import{t as oe}from"./pixi-transform-channels-P4rvmusc.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"./ingest-source-persistence-CrXFBT__.js";function $(u){if(!u||typeof u!="object")return;const c=u;return typeof c.x=="number"&&typeof c.y=="number"?[c.x,c.y]:void 0}function V(u,c,l){const o=u;!l||!$(o[c])||(o[c]={x:l[0],y:l[1]})}function ae(u){return`#${(u&16777215).toString(16).padStart(6,"0")}`}function le(u){return Number.parseInt(u.replace("#",""),16)}const ce=["position","rotation","scale"];function $e(u){const{physics:c}=u,l=u.persistence??null;let o,p=()=>{},h=null,S,T,w=!1,x=!1;const m=()=>{const t={},n=e=>{const r=o.node(e),i=o.displayObject(e);if(!r||!i)return;let s=null;try{s=o.getTransform(e)}catch{}const a=$(i.pivot),d=$(i.anchor);t[e]={label:i.label??"",alpha:i.alpha,visible:i.visible,..."tint"in i?{tint:i.tint}:{},...s?{transform:s}:{},...a?{pivot:a}:{},...d?{anchor:d}:{}};for(const f of r.childIds)n(f)};for(const e of o.roots())n(e.id);return{overlay:structuredClone(o.serializeOverlay()),nodes:t}},F=t=>{for(const[n,e]of Object.entries(t.nodes)){const r=o.displayObject(n);r&&(r.label=e.label,r.alpha=e.alpha,r.visible=e.visible,e.tint!==void 0&&"tint"in r&&(r.tint=e.tint),V(r,"pivot",e.pivot),V(r,"anchor",e.anchor),e.transform&&o.setTransform(n,e.transform))}o.replaceOverlay(t.overlay),p()},v=(t,n)=>{h&&n&&h.record(t,n,m()).catch(e=>{N.error(`[canvas] failed to journal "${t}" into project history — the edit is applied but has no history entry (it cannot be undone): ${e instanceof Error?e.message:String(e)}`,"authoring")})},A=(t,n,e)=>{const r=o.displayObject(t);r&&(n==="name"?o.set(t,"label",e):n==="tint"?o.set(t,"tint",le(e)):n==="visible"?o.set(t,"visible",e):n==="alpha"?o.set(t,"alpha",e):r[n]=e,p())},P=(t,n)=>{const e=o.displayObject(t);if(e)return n==="name"?e.label:n==="tint"?ae(e.tint??16777215):e[n]},b=(t,n)=>{const e=o.getTransform(t);return n==="position"?e?[...e.position]:void 0:n==="rotation"?e?e.rotation:void 0:n==="scale"?e?[...e.scale]:void 0:P(t,n)},I=(t,n,e)=>{if(n==="position"&&Array.isArray(e))o.setTransform(t,{position:[e[0]??0,e[1]??0]});else if(n==="rotation"&&typeof e=="number")o.setTransform(t,{rotation:e});else if(n==="scale"&&Array.isArray(e))o.setTransform(t,{scale:[e[0]??1,e[1]??1]});else{A(t,n,e);return}p()},y=(t,n)=>{const e=te(o.displayObject(t)??null);return{entityId:t,property:n,surface:"pixi",anchor:e,anchorKind:e.anchored?"construction-literal":"live-only",instances:e.anchored&&e.kind==="source"?ne(e):0}},g=t=>o.node(t)?.label??"2D Object",K=(t,n,e,r,i,s)=>{if(l){if(r===null||i===void 0||s===void 0){v(n,e);return}return se({backend:l,subject:()=>y(t,r),baseline:i,next:s,label:n,journal:()=>v(n,e)})}},R=t=>{const n=[{path:"name",label:"Name",type:"string"},{path:"visible",label:"Visible",type:"boolean"},{path:"alpha",label:"Alpha",type:"number"}],e=o.displayObject(t);return e&&"tint"in e&&n.push({path:"tint",label:"Tint",type:"color"}),n},O=new Map,E=new Map,j=t=>t.anchored&&t.kind==="source"?`${t.file}:${t.line}:${t.col}`:null,M=t=>[{path:"position",label:"Position"},{path:"rotation",label:"Rotation"},{path:"scale",label:"Scale"},...R(t).map(n=>({path:n.path,label:n.label}))],C=(t,n,e,r)=>{const i=E.get(n);if(i)return i;const s=l?.readSiteLiterals,a=M(t).map(f=>({property:f.path,live:b(t,f.path)})).filter(f=>f.live!==void 0);if(!s||a.length===0)return Promise.resolve({});const d=s({anchor:e,instances:r,writeScope:"creation-site",surface:"pixi",properties:a}).then(f=>(O.set(n,f),p(),f));return E.set(n,d),d},q=(t,n,e,r)=>{const i=O.get(n);return i||(C(t,n,e,r),null)},z=1e-6,H=(t,n)=>Array.isArray(t)&&Array.isArray(n)?t.length===n.length&&t.every((e,r)=>H(e,n[r])):typeof t=="number"&&typeof n=="number"?Math.abs(t-n)<=z:t===n,k=t=>o.displayObject(t)?.constructor?.name||(o.node(t)?.kind??"2D Object"),J=t=>`${t} ${t===1?"instance":"instances"}`,B=(t,n,e,r)=>{const i=b(t,n.path);if(!e||e.literal===null||i===void 0||H(e.literal,i))return null;const s=l?.gate({...r,property:n.path,writeScope:"creation-site"}),a=e.writable?s?.ok?void 0:s?.reason:e.reason;return{path:n.path,label:n.label,value:i,...e.text?{defaultText:e.text}:{},canApplyToComponent:a===void 0,...a===void 0?{}:{applyUnavailableReason:a},affectedInstanceCount:r.instances}},U=(t,n,e,r)=>{if(!l||!e||e.literal===null||r===void 0)return{ok:!1,message:e?.reason??`The construction site names no ${n} for this object, so there is no default to change.`};if(!e.writable)return{ok:!1,message:e.reason??`The construction site's ${n} cannot be rewritten.`};const i=l.gate({...t,writeScope:"creation-site"});return i.ok?{ok:!0,backend:l,baseline:e.literal,next:r}:{ok:!1,message:i.reason}},D=async t=>{const n=y(t,"position"),e=j(n.anchor);return e?O.get(e)??await C(t,e,n.anchor,n.instances):null},Y={describe:t=>{const n=y(t,"position"),e=j(n.anchor);if(!e||!o.displayObject(t))return null;const r=q(t,e,n.anchor,n.instances);if(!r||Object.keys(r).length===0)return null;const i=M(t).map(s=>B(t,s,r[s.path],n)).filter(s=>s!==null);return{componentName:k(t),...n.anchor.anchored?{sourcePath:n.anchor.display}:{},overrides:i}},revert:async(t,n)=>{const e=await D(t);if(!e)return;const r=m(),i=[];for(const s of n){const a=e[s]?.literal;a!=null&&(I(t,s,a),i.push(s))}if(i.length!==0)return v(i.length===1?`Revert ${g(t)} ${i[0]}`:`Revert ${i.length} ${g(t)} overrides`,r),p(),ee},applyToComponent:async(t,n)=>{const e={...y(t,n),writeScope:"creation-site"},r=j(e.anchor),i=(await D(t))?.[n],s=b(t,n),a=U(e,n,i,s);if(!a.ok)return{changed:!1,message:a.message};const d=`Apply ${n} to ${k(t)} default (${J(e.instances)})`;return await a.backend.write({...e,baseline:a.baseline,next:a.next,label:d})?(r&&O.delete(r),p(),{changed:!0,message:`${n} now reads ${JSON.stringify(s)} for all ${J(e.instances)} at ${e.anchor.anchored?e.anchor.display:"its creation site"}.`,write:{destination:e.anchor.anchored?e.anchor.display:"creation site",persisted:!0}}):{changed:!1,message:`${d} did not land — the editor console names why.`}}};return{provenance:l?{source:"foreign",label:"creation-site",detail:"Live 2D (PixiJS) tree projected directly — an edit is written into the game’s own source at the line that constructed the object, and says why whenever it cannot be."}:{source:"foreign",label:"live-only",detail:"Live 2D (PixiJS) tree projected directly — edits apply for this session only and are never saved."},get persistence(){const t=l;return t?{..._(),get destination(){return t.destination()}}:{..._(),destination:X}},truth:(t,n)=>{const e=y(t,n);if(e.anchorKind==="live-only")return{site:e.anchor,writeAnchorKind:"live-only"};const r=j(e.anchor);if(!r)return{site:e.anchor,writeAnchorKind:"live-only"};const i=O.get(r);if(!i)return C(t,r,e.anchor,e.instances),{site:e.anchor,writeAnchorKind:void 0};const s=i[n];return{site:e.anchor,writeAnchorKind:s?.writable?"construction-literal":"live-only"}},componentIdentity:t=>o.displayObject(t)?{name:k(t)}:null,...l?.readSiteLiterals?{instances:()=>Y}:{},writeOrigin(t,n,e){h?.assertCanMutate();const r=o.displayObject(t);!r||!$(r[n])||(r[n]={x:e[0],y:e[1]},w=!0,p())},bind(t){o=t.a2d,p=t.notify;const n=t.store.shell.projectHistory;h=n?new re({history:n,kind:"session-state",scope:"session",subject:{...t.journal,id:`${t.journal.id}/world-2d-edits`},displayName:"World 2D edits",capture:m,conflictIdentity:e=>e.overlay,restore:async e=>{F(e)}}):null,l?.attach({read:b,apply:I})},onReindex(){},transformEditability(t,n){if(!l)return{writable:!0};const e=y(t,n),r=e.anchorKind!=="live-only"&&l.removal?.available(e)?{removable:!0}:{};return{writable:!0,reason:l.describe(e),...r}},beginTransformEdit(t){h?.assertCanMutate();const n=o.displayObject(t);n&&L(c,n)==="physics"&&c.freeze(n),S=m(),T=l?o.getTransform(t)??void 0:void 0,w=!1},writeTransform(t,n){h?.assertCanMutate();const e=o.displayObject(t);e&&L(c,e)==="physics"&&c.commit(e,n.position,n.rotation),o.setTransform(t,n),p()},endTransformEdit(t){const n=o.displayObject(t);n&&L(c,n)==="physics"&&c.unfreeze(n);const e=`Transform ${g(t)}`,r=S,i=T,s=w;if(S=void 0,T=void 0,w=!1,!l){v(e,r);return}const a=o.getTransform(t)??void 0,d=s?["origin"]:[];i&&a&&d.push(...ce.filter(Z=>oe(Z,i,a))),d.length>1&&l.report(e,ie(d));const f=d.length===1&&d[0]!=="origin"?d[0]:null;return K(t,e,r,f,f?W(i,f):void 0,f?W(a,f):void 0)},removeTransform(t,n){const e=l,r=e?.removal;if(!e||!r)return;const i=`Remove ${g(t)} ${n}`;return G({resolve:()=>{const s=y(t,n);return s.anchorKind==="live-only"||!r.available(s)?Q(e.describe(s)):{reaches:"writer",anchorKind:s.anchorKind,destination:e.destination(),write:()=>r.perform({...s,label:i})}},record:()=>{},report:s=>{e.armed()&&e.report(i,s)}})},reportStructureLiveOnly(t,n){if(l?.armed()){l.report(t,n);return}if(!x){x=!0,N.warn(`[canvas] structural edits in this world are live-only — ${n}. First one: ${t}.`,"authoring");return}N.log(`[canvas] ${t} is live-only — ${n}.`,"authoring")},properties:R,get(t,n){return P(t,n)},set(t,n,e){h?.assertCanMutate();const r=m(),i=`Set ${g(t)} ${n}`;if(!l){A(t,n,e),v(i,r);return}const s=b(t,n);A(t,n,e);const a=b(t,n),d=s!==void 0&&a!==void 0&&JSON.stringify(s)!==JSON.stringify(a);return K(t,i,r,d?n:null,s,a)},dispose(){h?.dispose(),h=null,l?.dispose()}}}function W(u,c){if(u){if(c==="position")return[...u.position];if(c==="rotation")return u.rotation;if(c==="scale")return[...u.scale]}}export{$e as createLiveCanvasWriteTarget};
|