@volter/game-editor 0.5.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (653) hide show
  1. package/BUNDLED_NOTICES +11228 -0
  2. package/LICENSE +686 -0
  3. package/LICENSE-BLENDER +1409 -0
  4. package/LICENSE-MCP +21 -0
  5. package/NOTICE +21 -0
  6. package/catalog/entries/audio.json +14 -0
  7. package/catalog/entries/bake.json +36 -0
  8. package/catalog/entries/blender.json +17 -0
  9. package/catalog/entries/react-root.json +24 -0
  10. package/catalog/entries/reflections.json +29 -0
  11. package/catalog/entries/static-batch.json +25 -0
  12. package/catalog/project-source/LICENSE +37 -0
  13. package/catalog/project-source/src/contributions/bake.kind.ts +40 -0
  14. package/catalog/project-source/src/contributions/builder-document.tsx +65 -0
  15. package/catalog/project-source/src/contributions/builder-state.ts +27 -0
  16. package/catalog/project-source/src/contributions/builder-ui.tsx +61 -0
  17. package/catalog/project-source/src/contributions/module-source.ts +502 -0
  18. package/catalog/project-source/src/contributions/pages.finder.ts +61 -0
  19. package/catalog/project-source/src/lib/audio/sfx.ts +255 -0
  20. package/catalog/project-source/src/lib/bake/asset-seed.ts +128 -0
  21. package/catalog/project-source/src/lib/bake/bake-schema.ts +65 -0
  22. package/catalog/project-source/src/lib/bake/clip-layering.ts +203 -0
  23. package/catalog/project-source/src/lib/bake/gltf-bake.ts +657 -0
  24. package/catalog/project-source/src/lib/bake/mesh-slice.ts +157 -0
  25. package/catalog/project-source/src/lib/bake/node-image.ts +463 -0
  26. package/catalog/project-source/src/lib/bake/object3d-bake.ts +121 -0
  27. package/catalog/project-source/src/lib/bake/object3d-lifecycle.ts +15 -0
  28. package/catalog/project-source/src/lib/bake/object3d-source.ts +8 -0
  29. package/catalog/project-source/src/lib/bake/params.ts +75 -0
  30. package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +217 -0
  31. package/catalog/project-source/src/lib/bake/use-model.ts +95 -0
  32. package/catalog/project-source/src/lib/react-root/index.ts +20 -0
  33. package/catalog/project-source/src/lib/react-root/react-root-adapter.tsx +57 -0
  34. package/catalog/project-source/src/lib/reflections/ReflectionProbe.tsx +201 -0
  35. package/catalog/project-source/src/lib/reflections/index.ts +19 -0
  36. package/catalog/project-source/src/lib/reflections/probe-controller.ts +75 -0
  37. package/catalog/project-source/src/lib/reflections/reflection-probe-registry.ts +402 -0
  38. package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +416 -0
  39. package/catalog/project-source/src/lib/static-batch/Frozen.tsx +91 -0
  40. package/catalog/project-source/src/lib/static-batch/freeze.ts +579 -0
  41. package/catalog/project-source/src/lib/static-batch/index.ts +44 -0
  42. package/catalog/project-source/src/lib/static-batch/mutation-watch.ts +149 -0
  43. package/catalog/project-source/src/lib/static-batch/shadow-cache.ts +171 -0
  44. package/catalog/project-source/src/tools/bake-module.tool.ts +139 -0
  45. package/catalog/project-source/src/tools/bake-preview.tool.ts +475 -0
  46. package/dist/.vite/manifest.json +8304 -0
  47. package/dist/assets/AssetBudgetPanel-J9--TZPU.js +23 -0
  48. package/dist/assets/AudioViewer-CR7333fe.js +1 -0
  49. package/dist/assets/BVHLoader-6bQIXhMX.js +1 -0
  50. package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +1 -0
  51. package/dist/assets/CCDIKSolver-CD7vLpsK.js +1 -0
  52. package/dist/assets/CSS3DRenderer-CL7ABLVK.js +1 -0
  53. package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +1 -0
  54. package/dist/assets/ColladaLoader-aVOPIsCh.js +3 -0
  55. package/dist/assets/ColorInput-DQBNrW-K.js +1 -0
  56. package/dist/assets/ConvexGeometry-CAzXlPVG.js +1 -0
  57. package/dist/assets/ConvexHull-BINCESFp.js +1 -0
  58. package/dist/assets/CopyShader-BzTUYzf6.js +24 -0
  59. package/dist/assets/DecalGeometry-160KRdfg.js +1 -0
  60. package/dist/assets/EXRLoader-Cdans_oJ.js +1 -0
  61. package/dist/assets/EffectComposer-DQxfsXBZ.js +1 -0
  62. package/dist/assets/EntityModelDocument-Ccvw66N9.js +1 -0
  63. package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +1 -0
  64. package/dist/assets/FBXLoader-B4MoUtAn.js +1 -0
  65. package/dist/assets/Fbo-Dz-Soul3.js +1 -0
  66. package/dist/assets/FontLoader-CvGoVI5a.js +2 -0
  67. package/dist/assets/GLTFExporter-HgrCle4L.js +1 -0
  68. package/dist/assets/GameplaySessionTimeline-B52W3FVZ.js +1 -0
  69. package/dist/assets/Gltf-UHVWKz65.js +2 -0
  70. package/dist/assets/HDRLoader-THU88oVD.js +5 -0
  71. package/dist/assets/ImageViewer-Tn7s_MnW.js +1 -0
  72. package/dist/assets/InspectorCanvasPreview-CEr_Kxna.js +1 -0
  73. package/dist/assets/InspectorObjectPreview-CVejvLRg.js +1 -0
  74. package/dist/assets/JsonAssetDocument-C7VGcLhu.js +3 -0
  75. package/dist/assets/LineSegments2-CsOpKSiM.js +370 -0
  76. package/dist/assets/MTLLoader-_Xzd4_0p.js +2 -0
  77. package/dist/assets/MarchingCubes-Bsp4wrzd.js +1 -0
  78. package/dist/assets/MeshBVH-BiDHDcu-.js +1 -0
  79. package/dist/assets/ModelAssetDocument-F5GACirk.js +1 -0
  80. package/dist/assets/NonThreeAuthoringBootstrap-C3woOMxX.js +1 -0
  81. package/dist/assets/OBJLoader-BhIC6Hwo.js +5 -0
  82. package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +2 -0
  83. package/dist/assets/Object3DPreview-DL8oi7Xs.js +2 -0
  84. package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +2 -0
  85. package/dist/assets/OrbitControls-CM3bPray.js +1 -0
  86. package/dist/assets/OrbitControls-DLpayAaK.js +1 -0
  87. package/dist/assets/OrthographicCamera-bQozawrh.js +1 -0
  88. package/dist/assets/PLYLoader-DYQqs5Ik.js +2 -0
  89. package/dist/assets/PerspectiveCamera-CQ2lh01o.js +1 -0
  90. package/dist/assets/PlayBar-BR-Vg3Jb.js +2 -0
  91. package/dist/assets/RGBELoader-BgBcQv8j.js +1 -0
  92. package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +1 -0
  93. package/dist/assets/RenderPass-DPrn-Uky.js +1 -0
  94. package/dist/assets/ResolutionPicker-C67vs1F3.js +1 -0
  95. package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +1 -0
  96. package/dist/assets/RoundedBox-BDGBg6QZ.js +1 -0
  97. package/dist/assets/RoundedBoxGeometry-CyUuYPfW.js +1 -0
  98. package/dist/assets/STLLoader-Dyv3lsxY.js +1 -0
  99. package/dist/assets/SelectionBox-D_75KrNW.js +1 -0
  100. package/dist/assets/ShaderPass-QYRpPuFJ.js +1 -0
  101. package/dist/assets/ShadowEditor-DkImwu1Y.js +1 -0
  102. package/dist/assets/SimplifyModifier-C8ayvRzd.js +1 -0
  103. package/dist/assets/SkeletonUtils-Cps8GOC6.js +1 -0
  104. package/dist/assets/Sky-CQKCgYDs.js +154 -0
  105. package/dist/assets/SourceAssetViewer-2SWQoUut.js +12 -0
  106. package/dist/assets/StageHost-BN-IoTef.js +2 -0
  107. package/dist/assets/StoryPreviewMount-DjyxRCXu.js +1 -0
  108. package/dist/assets/TDSLoader-D_T8XJ81.js +1 -0
  109. package/dist/assets/TextGeometry-DOWAEUV0.js +1 -0
  110. package/dist/assets/ThreeBoardDocument-CVncZyIq.js +2 -0
  111. package/dist/assets/ThreeIsolationSceneContent-C8C8whSF.js +1 -0
  112. package/dist/assets/ToolObject3DPreview-BRoDWe4Q.js +1 -0
  113. package/dist/assets/TrackballControls-DfznuQTh.js +1 -0
  114. package/dist/assets/TransientHint-BB1fwrvK.js +1 -0
  115. package/dist/assets/UnrealBloomPass-CR-cS_K5.js +83 -0
  116. package/dist/assets/VideoViewer-C6kocgIU.js +1 -0
  117. package/dist/assets/_commonjsHelpers-D6-XlEtG.js +1 -0
  118. package/dist/assets/active-ingest-CT6jSGhr.js +3 -0
  119. package/dist/assets/adapter-surface-Y37Nzcyw.js +1 -0
  120. package/dist/assets/after-paint-CB4bz1-e.js +1 -0
  121. package/dist/assets/agx-base-srgb-BjWZJgrZ.lut +0 -0
  122. package/dist/assets/agx-look-medium-high-contrast-D5F_ob1L.lut +0 -0
  123. package/dist/assets/agx-look-punchy-dxsnycNs.lut +0 -0
  124. package/dist/assets/animation-clock-CnjZqfJp.js +1 -0
  125. package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +1 -0
  126. package/dist/assets/asset-budget.action-DCzzcuTh.js +1 -0
  127. package/dist/assets/asset-budget.document-BWU8wnVW.js +1 -0
  128. package/dist/assets/asset-budget.menu-BGZpT_31.js +1 -0
  129. package/dist/assets/asset-editor-persistence-BBaONOJt.js +1 -0
  130. package/dist/assets/asset-loaders-BOy5Ss8k.js +2 -0
  131. package/dist/assets/asset-parse-error-BHMwBRU3.js +3 -0
  132. package/dist/assets/assets-BuSoGjBX.js +1 -0
  133. package/dist/assets/audio-meter-CyiToeUW.js +1 -0
  134. package/dist/assets/audio-unlock.service-CfUgUQVy.js +1 -0
  135. package/dist/assets/audio.utility-C6K6jem8.js +1 -0
  136. package/dist/assets/authoring-CgcOFhGS.js +1 -0
  137. package/dist/assets/autoplay.service-BZBGNSvt.js +1 -0
  138. package/dist/assets/axe-LkjAB6Lv.js +30 -0
  139. package/dist/assets/babylon-authoring-adapter-CL02gWDn.js +1 -0
  140. package/dist/assets/binding-Bmxqznjk.js +1 -0
  141. package/dist/assets/binding-identity-DcTpbvyg.js +1 -0
  142. package/dist/assets/binding-resolver-Dsh-6Vor.js +2 -0
  143. package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +2 -0
  144. package/dist/assets/blender-node-editor.document-iIDkB9sI.js +1 -0
  145. package/dist/assets/blender-properties-tab-C5CyPydi.js +3 -0
  146. package/dist/assets/blender-runtime-host-BpBwGv7r.js +4 -0
  147. package/dist/assets/blender-runtime-skin-DyQ9B6CR.js +7140 -0
  148. package/dist/assets/blender-runtime.document-lIYhhPtv.js +8 -0
  149. package/dist/assets/blender-timeline.document-77fx96N7.js +1 -0
  150. package/dist/assets/blender-uv-editor.document-fsT7B4gV.js +1 -0
  151. package/dist/assets/blender-version.status-o6dBm3n6.js +1 -0
  152. package/dist/assets/blender-wali-engine-wTOcrOMC.js +2 -0
  153. package/dist/assets/blender.command-BtJeWk-A.js +1 -0
  154. package/dist/assets/blender.keymap-GAQgeklK.js +1 -0
  155. package/dist/assets/blender.status-ujwGU6dU.js +1 -0
  156. package/dist/assets/blender.style-Dcem5f_T.js +1 -0
  157. package/dist/assets/board-guides-DziKSTss.js +1 -0
  158. package/dist/assets/body-marks-h_xDxiDE.js +1 -0
  159. package/dist/assets/bridge.command-o5gDNEwa.js +3 -0
  160. package/dist/assets/browserAll-DeWblVez.js +1 -0
  161. package/dist/assets/build-profiles.document-kW8iw8Xj.js +2 -0
  162. package/dist/assets/build-progress.status-BNRLytg2.js +1 -0
  163. package/dist/assets/build-session-C_sg3CEn.js +9 -0
  164. package/dist/assets/build.action-lYjTLb7K.js +1 -0
  165. package/dist/assets/build.command-DIGgUPU_.js +1 -0
  166. package/dist/assets/build.header-CKajx5U3.js +1 -0
  167. package/dist/assets/build.menu-BdU0QXny.js +1 -0
  168. package/dist/assets/build.service-CbBAyeu3.js +1 -0
  169. package/dist/assets/bus-mixer-CGfWDP3C.js +1 -0
  170. package/dist/assets/camera-KEsKvOL7.js +1 -0
  171. package/dist/assets/camera-runtime.inspector-B7unX4g1.js +1 -0
  172. package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +2 -0
  173. package/dist/assets/capability-coverage-Czas4C18.js +7 -0
  174. package/dist/assets/chrome-trace-YZHMz60-.js +1 -0
  175. package/dist/assets/client-DNXj_opT.js +25 -0
  176. package/dist/assets/clip-planes-CnAI6DZn.js +1 -0
  177. package/dist/assets/collaboration-presence-DLoZ7EA3.js +1 -0
  178. package/dist/assets/collider-Bw0mXlsW.js +1 -0
  179. package/dist/assets/collider-dimensions-9xoFADXN.js +1 -0
  180. package/dist/assets/collision-system-DpNUJRJ3.js +1 -0
  181. package/dist/assets/command-results-CUQD49AB.js +1 -0
  182. package/dist/assets/component-board-registry-DrIa2csL.js +1 -0
  183. package/dist/assets/component-board.service-DCwcUssB.js +2 -0
  184. package/dist/assets/component-board.service-DidCyM4O.js +2 -0
  185. package/dist/assets/component-verbs.command-7xzfjGMZ.js +1 -0
  186. package/dist/assets/component-verbs.service-Bv9jId3q.js +1 -0
  187. package/dist/assets/config-CEZk921y.js +6 -0
  188. package/dist/assets/configurations-DTBMdaTL.js +1 -0
  189. package/dist/assets/connection.status-BifnQdOs.js +1 -0
  190. package/dist/assets/console-bridge-CHcb-xk5.js +1 -0
  191. package/dist/assets/constraint-De8f1Uiq.js +1 -0
  192. package/dist/assets/constraints.inspector-B9U9Yj-u.js +1 -0
  193. package/dist/assets/countdown-timer-CUm74dom.js +1 -0
  194. package/dist/assets/coverage.service-VTX5Mcsx.js +3 -0
  195. package/dist/assets/crash-null-boundary-v3a0uEgw.js +1 -0
  196. package/dist/assets/create-runtime-CVCc1BDx.js +1 -0
  197. package/dist/assets/curve-7Q79VgU4.js +1 -0
  198. package/dist/assets/data-asset-4hjS642k.js +5 -0
  199. package/dist/assets/data-check-core-CQEjuFyt.js +1 -0
  200. package/dist/assets/data-ref-CQI28C0D.js +1 -0
  201. package/dist/assets/debug-bridge-CCohG-d-.js +1 -0
  202. package/dist/assets/debug-registry-Dgvitx8M.js +1 -0
  203. package/dist/assets/defaults-DKiBJCPN.js +1 -0
  204. package/dist/assets/deferred-commands-CEMmvL47.js +1 -0
  205. package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +2 -0
  206. package/dist/assets/design-time-layers-wYgOTgni.js +1 -0
  207. package/dist/assets/design-time-mount-registry-DUpXCg1U.js +1 -0
  208. package/dist/assets/design-time-mount.service-BzY21e1F.js +2 -0
  209. package/dist/assets/design-time-react-mount-DM9WLrF2.js +1 -0
  210. package/dist/assets/dev-build-gDYrq68M.js +1 -0
  211. package/dist/assets/directional-shadow-fit-BVkOKAv2.js +1 -0
  212. package/dist/assets/document-preview-three-Kbg2GCLm.js +1 -0
  213. package/dist/assets/dom-authoring-adapter-CY8C7f4T.js +1 -0
  214. package/dist/assets/draco3d-BBUTcNkz.js +1 -0
  215. package/dist/assets/draco_decoder-DsQ12WqX.wasm +0 -0
  216. package/dist/assets/draco_encoder-2Tcju8Ns.wasm +0 -0
  217. package/dist/assets/edit-mode-audio.service-Bzetwd5B.js +1 -0
  218. package/dist/assets/edit-mode-authoring-B47TfLqu.js +1 -0
  219. package/dist/assets/edit-mode-networking.service-YCX6RRb_.js +1 -0
  220. package/dist/assets/editor-api-BoJIcyZG.js +1 -0
  221. package/dist/assets/editor-port-C_FeBdeV.js +1 -0
  222. package/dist/assets/editor-presentation-activity-C7SNSmTd.js +1 -0
  223. package/dist/assets/entry-adjudication-Cq8Yeb74.js +1 -0
  224. package/dist/assets/environment-capture-7himRh2L.js +1 -0
  225. package/dist/assets/esbuild-BHljloGq.wasm +0 -0
  226. package/dist/assets/events-156d8d12.esm-ErOhDXXB.js +36 -0
  227. package/dist/assets/extend-B-eOccUm.js +36 -0
  228. package/dist/assets/extends-CF3RwP-h.js +1 -0
  229. package/dist/assets/eyedropper-session-bjPXnfeX.js +1 -0
  230. package/dist/assets/fflate.module-DPuTF8aG.js +6 -0
  231. package/dist/assets/filmic-srgb-Ct35FIH6.lut +0 -0
  232. package/dist/assets/first-party-audio-system-DxnGJOER.js +1 -0
  233. package/dist/assets/first-party-navigation-system-CL5Bquub.js +1 -0
  234. package/dist/assets/fork-menu-BoVyw2Wu.js +1 -0
  235. package/dist/assets/frame-debugger-store-D1Mf_5up.js +1 -0
  236. package/dist/assets/frame-delta-D2nsw_Ht.js +1 -0
  237. package/dist/assets/frame-pacing-D5acoOzO.js +1 -0
  238. package/dist/assets/frame-selector-cache-cCeUbcjG.js +1 -0
  239. package/dist/assets/game-DHOZVb-7.js +1 -0
  240. package/dist/assets/game-contract-seams-a5YXejOu.js +1 -0
  241. package/dist/assets/game-css-scope-transform-Eng4wS8E.js +33 -0
  242. package/dist/assets/game-document.service-DbRfx2V0.js +1 -0
  243. package/dist/assets/game-eval.command-D-7Dxbj_.js +2 -0
  244. package/dist/assets/game-input-seams-CIQdetRw.js +1 -0
  245. package/dist/assets/game-loop-CZvXlY00.js +1 -0
  246. package/dist/assets/game-module-access-B2mFxv-i.js +1 -0
  247. package/dist/assets/game.layout-CBASrvQu.js +1 -0
  248. package/dist/assets/gameplay-export-BoKXm51x.js +1 -0
  249. package/dist/assets/gameplay-replay-e5umMlXv.js +1 -0
  250. package/dist/assets/gameplay-rng-trap-CTNhm-UW.js +3 -0
  251. package/dist/assets/gameplay.command-DxcVYX6F.js +1 -0
  252. package/dist/assets/generation-DhwCUHPf.css +1 -0
  253. package/dist/assets/generation-jobs-BQrXbGp_.js +1 -0
  254. package/dist/assets/generation.service-CDIgObuw.js +1 -0
  255. package/dist/assets/generations-DzUogZsM.js +1 -0
  256. package/dist/assets/generations.status-CgOUBCum.js +1 -0
  257. package/dist/assets/hierarchy-marks-BLPfSIym.js +1 -0
  258. package/dist/assets/host-pointer-DbGSCjE9.js +1 -0
  259. package/dist/assets/hosted-asset-materialization-CiIvWkGU.js +2 -0
  260. package/dist/assets/ibl-override-material-BlmCxFKq.js +6 -0
  261. package/dist/assets/index-96FBF1Oj.js +1 -0
  262. package/dist/assets/index-BAWkB0dv.js +1 -0
  263. package/dist/assets/index-BDnS2b6S.js +1 -0
  264. package/dist/assets/index-BHp07vN0.js +2 -0
  265. package/dist/assets/index-BMxv2MNV.js +1 -0
  266. package/dist/assets/index-BP6wv2A0.js +5 -0
  267. package/dist/assets/index-BcCBqgM_.js +952 -0
  268. package/dist/assets/index-Bge9JUr6.js +1 -0
  269. package/dist/assets/index-BjTCPEQ7.js +134 -0
  270. package/dist/assets/index-BncK9THk.js +1 -0
  271. package/dist/assets/index-CJbYy-CF.js +3 -0
  272. package/dist/assets/index-CVCb_ImQ.js +1 -0
  273. package/dist/assets/index-CZd9o7Lu.js +1 -0
  274. package/dist/assets/index-CanA16PU.js +2 -0
  275. package/dist/assets/index-CinJrH5C.js +9 -0
  276. package/dist/assets/index-CtzuWnCS.js +1 -0
  277. package/dist/assets/index-D2fNXpHa.css +1 -0
  278. package/dist/assets/index-DUpHH6JR.js +3120 -0
  279. package/dist/assets/index-DUqP1RMl.js +1 -0
  280. package/dist/assets/index-D_NuPfjr.js +9 -0
  281. package/dist/assets/index-Da9JhEvW.js +25 -0
  282. package/dist/assets/index-DgapqSPi.js +7 -0
  283. package/dist/assets/index-FUuS4qwW.js +562 -0
  284. package/dist/assets/index-GIL7oGEO.js +4894 -0
  285. package/dist/assets/index-IEjydI9d.js +1 -0
  286. package/dist/assets/index-OrYXPk3Z.js +487 -0
  287. package/dist/assets/index-V1R-e5Bd.js +1 -0
  288. package/dist/assets/index-bQE2NA0D.js +1 -0
  289. package/dist/assets/index-gHZae-lw.js +13 -0
  290. package/dist/assets/index-mjWQmGhM.js +1 -0
  291. package/dist/assets/index-nmcBqr7Y.js +1 -0
  292. package/dist/assets/inference-diagnostics-Dhmtfbq_.js +1 -0
  293. package/dist/assets/ingest-BbYMC2vQ.js +1 -0
  294. package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +1 -0
  295. package/dist/assets/ingest-siblings-Bop2kqVl.js +1 -0
  296. package/dist/assets/ingest-source-persistence-C_6Hiyra.js +1 -0
  297. package/dist/assets/ingest.service-BTDnQfM1.js +1 -0
  298. package/dist/assets/input-manager-DH_hGW6d.js +1 -0
  299. package/dist/assets/input-router-BNQvtIqw.js +1 -0
  300. package/dist/assets/inspect-BZfi3mmo.js +1 -0
  301. package/dist/assets/inspection-CObLhnrs.js +1 -0
  302. package/dist/assets/instance-fork-actions-D3sRzS3K.js +1 -0
  303. package/dist/assets/instances.command-D6UkZNO8.js +1 -0
  304. package/dist/assets/instruments-CKR02Y8I.js +1 -0
  305. package/dist/assets/json-history-resource-BbxllWfV.js +1 -0
  306. package/dist/assets/jsx-runtime-DPjLkJKQ.js +9 -0
  307. package/dist/assets/light-D-_wsKTq.js +1 -0
  308. package/dist/assets/light-camera-factory-CWbbe9gI.js +1 -0
  309. package/dist/assets/lil-gui.module.min-BF55BEwA.js +10 -0
  310. package/dist/assets/live-behaviors-Bxq49Maz.js +1 -0
  311. package/dist/assets/live-gesture-lock-DJbrjOqf.js +1 -0
  312. package/dist/assets/loader-CaF_I7Yt.js +1 -0
  313. package/dist/assets/logger-Dqis-7W1.js +1 -0
  314. package/dist/assets/loop-gate-report-N52EWFGD.js +1 -0
  315. package/dist/assets/matcap-texture-CVfalpWT.js +1 -0
  316. package/dist/assets/material-CpAdjDxn.js +1 -0
  317. package/dist/assets/material-factory-Bz6h__6g.js +1 -0
  318. package/dist/assets/mesh-B3WPtNKO.js +1 -0
  319. package/dist/assets/mesh-shadow-CZnXrw_l.js +1 -0
  320. package/dist/assets/mikktspace.module-DO88SLib.js +1 -0
  321. package/dist/assets/model-asset-sections-CFvvihfx.css +1 -0
  322. package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +1 -0
  323. package/dist/assets/model.layout-BJUEQYUI.js +1 -0
  324. package/dist/assets/models.finder-G2jQgIRu.js +1 -0
  325. package/dist/assets/module-mode-DVBLT9d-.js +2 -0
  326. package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +2 -0
  327. package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +2 -0
  328. package/dist/assets/mount-game-6t9cKNo4.js +1 -0
  329. package/dist/assets/mount-ingest-root-glv2SSWf.js +2 -0
  330. package/dist/assets/mount-manifest-CGVxhmAw.js +1 -0
  331. package/dist/assets/mount-readiness-Ds0HvvLH.js +4 -0
  332. package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +1 -0
  333. package/dist/assets/mounted-authoring-Dmg5xmhP.js +1 -0
  334. package/dist/assets/mounted-story-viewport-source-DjP6RA9U.js +1 -0
  335. package/dist/assets/native-debug-module-CWicoSGD.js +1 -0
  336. package/dist/assets/native-entry-surface-BE8LJNdu.js +1 -0
  337. package/dist/assets/navigation-CIiCx-SM.js +1 -0
  338. package/dist/assets/navmesh-workflow-store-Cmnm57TB.js +1 -0
  339. package/dist/assets/navmesh.menu-CAKiH8PW.js +1 -0
  340. package/dist/assets/navmesh.service-jgDWlgj1.js +1 -0
  341. package/dist/assets/network.utility-CEu5nHf7.js +1 -0
  342. package/dist/assets/object-marks-DwvIEBOK.js +1 -0
  343. package/dist/assets/object3d-authoring-subject-CH5sI2oP.js +1 -0
  344. package/dist/assets/output-DK8waum9.js +195 -0
  345. package/dist/assets/particles-Y626p22p.js +1 -0
  346. package/dist/assets/particles-factory-DnLOHXT8.js +1 -0
  347. package/dist/assets/pasteboard-materialize-BqSS4QzV.js +20 -0
  348. package/dist/assets/pasteboard.action-DU3UHtJG.js +2 -0
  349. package/dist/assets/performance-profiler-D_Jey87L.js +1 -0
  350. package/dist/assets/physics-registry-B2Jkp8e6.js +1 -0
  351. package/dist/assets/physics-registry-CUB9cT9p.js +1 -0
  352. package/dist/assets/pixi-authoring-adapter-CjibysC3.js +1 -0
  353. package/dist/assets/pixi-live-write-target-DuWydlWb.js +1 -0
  354. package/dist/assets/pixi-primitive-DlWbUPN9.js +1 -0
  355. package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +1 -0
  356. package/dist/assets/pixi-story-model-DNkfnWUV.js +1 -0
  357. package/dist/assets/pixi-transform-channels-VjdohT11.js +1 -0
  358. package/dist/assets/play-mode-BFU2PCkG.js +22 -0
  359. package/dist/assets/play.command-BpqqLqkq.js +2 -0
  360. package/dist/assets/playtest-BXIL1JEF.js +1 -0
  361. package/dist/assets/pose-guard-6Osb2cFu.js +1 -0
  362. package/dist/assets/presentation-BPP5pXeQ.js +1 -0
  363. package/dist/assets/product-DFhyARJj.js +1 -0
  364. package/dist/assets/profiler.action-CaXJDp3t.js +1 -0
  365. package/dist/assets/profiler.menu-BIMF6Bi4.js +1 -0
  366. package/dist/assets/profiler.utility-BExw9wBO.js +1 -0
  367. package/dist/assets/project-authoring-session-Bnt6icLr.js +2 -0
  368. package/dist/assets/project-provenance-BoP3nrle.js +1 -0
  369. package/dist/assets/prompt-labels-DSMdM2_B.js +1 -0
  370. package/dist/assets/properties-bone-constraints.inspector-ByT6p7S-.js +1 -0
  371. package/dist/assets/properties-bone.inspector-z4qJwKO5.js +1 -0
  372. package/dist/assets/properties-collection.inspector-D0_3ijWU.js +1 -0
  373. package/dist/assets/properties-constraints.inspector-CESzjuls.js +1 -0
  374. package/dist/assets/properties-data.inspector-hG8Wgyzb.js +1 -0
  375. package/dist/assets/properties-material.inspector-CzY0JCQ6.js +1 -0
  376. package/dist/assets/properties-modifiers.inspector-3dDhwf7g.js +1 -0
  377. package/dist/assets/properties-object.inspector-CiarfxkT.js +1 -0
  378. package/dist/assets/properties-output.inspector-DKJxmKSD.js +1 -0
  379. package/dist/assets/properties-particles.inspector-CCEdYWGm.js +1 -0
  380. package/dist/assets/properties-physics.inspector-B2c0KUyA.js +1 -0
  381. package/dist/assets/properties-render.inspector-Bcm0HLRW.js +1 -0
  382. package/dist/assets/properties-scene.inspector-PIM_eTb_.js +1 -0
  383. package/dist/assets/properties-texture.inspector-CgFlnyr8.js +1 -0
  384. package/dist/assets/properties-view-layer.inspector-DGjF_Aqo.js +1 -0
  385. package/dist/assets/properties-world.inspector-CrMvaRvB.js +1 -0
  386. package/dist/assets/r3f-design-session-D-4yyDO9.js +2 -0
  387. package/dist/assets/r3f-physics-binding-BBo8oma9.js +1 -0
  388. package/dist/assets/r3f-root-factory-z9llD1OU.js +1 -0
  389. package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +13 -0
  390. package/dist/assets/rapier-physics-adapter-CaZqWLu0.js +1 -0
  391. package/dist/assets/rapier-physics-bridge-CMoeVo3Y.js +1 -0
  392. package/dist/assets/react-18-By2b4xR9.js +1 -0
  393. package/dist/assets/react-inspector.service-B_neRnSK.js +1 -0
  394. package/dist/assets/react-root-CEz5NTck.js +1 -0
  395. package/dist/assets/react-story-board-BDDwiE2H.js +1 -0
  396. package/dist/assets/react-three-fiber.esm-CycrbDlA.js +1 -0
  397. package/dist/assets/react-three-rapier.esm-CEfKpvxT.js +1 -0
  398. package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +1 -0
  399. package/dist/assets/realm-services-CobQsq_X.js +1 -0
  400. package/dist/assets/rebind-controller-Dtq19Vb3.js +1 -0
  401. package/dist/assets/recast-navigation.wasm-compat-Dsoa_MD-.js +1 -0
  402. package/dist/assets/reflection-probe-Don-M3Fj.js +1 -0
  403. package/dist/assets/reflection-probe-capture.inspector-CmFUoJCx.js +1 -0
  404. package/dist/assets/register-render-vitals-BiZk29b2.js +1 -0
  405. package/dist/assets/registry-02YZjMNp.js +1 -0
  406. package/dist/assets/relative-path-guard-GiM7Lsz8.js +1 -0
  407. package/dist/assets/render-audio-control-vMRlePWb.js +1 -0
  408. package/dist/assets/render-batch-system-0vq7p0VC.js +1 -0
  409. package/dist/assets/render-census-BrQX_CXv.js +1 -0
  410. package/dist/assets/render-control-Df3yTiyr.js +1 -0
  411. package/dist/assets/render-env-D2IV2x5k.js +1 -0
  412. package/dist/assets/render-features-CPQ_e568.js +1 -0
  413. package/dist/assets/render-seed-DF4JHy7P.js +1 -0
  414. package/dist/assets/render-settings-Bw4W9SYF.js +1 -0
  415. package/dist/assets/render-vitals-BZ5HtvMi.js +1 -0
  416. package/dist/assets/renderer-config-BqG4O8i9.js +1 -0
  417. package/dist/assets/resolve-three-SZE_WWUM.js +702 -0
  418. package/dist/assets/root-seam-contract-Z0VWX3Bk.js +1 -0
  419. package/dist/assets/rrweb-Cd2ifIRP.js +142 -0
  420. package/dist/assets/run-ticks-settled-C4ksViyA.js +1 -0
  421. package/dist/assets/runtime-inspection-l2iFQSsg.js +1 -0
  422. package/dist/assets/scene-capture-BQKzU0NT.js +1 -0
  423. package/dist/assets/scene-capture-CGYF-Viw.js +1 -0
  424. package/dist/assets/scene-document.service-qkDjUrlP.js +2 -0
  425. package/dist/assets/scene-framing-Cat0GtyJ.js +1 -0
  426. package/dist/assets/scene-index-B6BZOHMk.js +1 -0
  427. package/dist/assets/scene-query-C7_N-TpI.js +1 -0
  428. package/dist/assets/schema-kl9-2B_J.js +1 -0
  429. package/dist/assets/sculpt.layout-zJF55yCR.js +1 -0
  430. package/dist/assets/seeded-random-i3mtgBKZ.js +1 -0
  431. package/dist/assets/session-CZ5JPg-z.js +4877 -0
  432. package/dist/assets/setup-audio-S8GQF91f.js +1 -0
  433. package/dist/assets/setup-particles-GCXlnkj_.js +1 -0
  434. package/dist/assets/setup-physics-BeZ7-LKD.js +1 -0
  435. package/dist/assets/setup-renderer-DVXaSGin.js +1587 -0
  436. package/dist/assets/shading.layout-DULYZV6M.js +1 -0
  437. package/dist/assets/sim-clock-CLflx7kg.js +1 -0
  438. package/dist/assets/sky-precompute-worker-ChN7J87v.js +1 -0
  439. package/dist/assets/soft-particle-depth-DGvfQDi1.js +1 -0
  440. package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +1 -0
  441. package/dist/assets/source-persistence-backend-C-aR-B_Y.js +1 -0
  442. package/dist/assets/spark-renderer-lifecycle-ynWESJcv.js +1 -0
  443. package/dist/assets/spark.module-4pXQoz5d.js +12120 -0
  444. package/dist/assets/stage-invalidation-DBg3C3Ta.js +1 -0
  445. package/dist/assets/stage-keyboard-n-5kKH-m.js +1 -0
  446. package/dist/assets/stage-overlay-set-B9zp2sLB.js +1 -0
  447. package/dist/assets/stage-presence-markers-DiGI6A45.js +1 -0
  448. package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +7 -0
  449. package/dist/assets/state-bridge-DLP1jLRW.js +1 -0
  450. package/dist/assets/state-watch.action-BOvQR2qt.js +1 -0
  451. package/dist/assets/state-watch.menu-CNLvDeeY.js +1 -0
  452. package/dist/assets/state-watch.utility-Bg1tTTQU.js +1 -0
  453. package/dist/assets/static-batch-advisor-B13QEH7d.js +1 -0
  454. package/dist/assets/stats.module-BL02l9NC.js +1 -0
  455. package/dist/assets/story-arg-descriptors-Ek86ExX7.js +1 -0
  456. package/dist/assets/story-capture-_gC8dXV-.js +1 -0
  457. package/dist/assets/story-documents--TDLaPeL.js +3 -0
  458. package/dist/assets/story-documents.service-BiS_YbNQ.js +1 -0
  459. package/dist/assets/story-documents.service-CxOPYJ2j.js +1 -0
  460. package/dist/assets/story-media-presence-BHzk2IV5.js +1 -0
  461. package/dist/assets/story-mount-turn-DFRTj5hi.js +1 -0
  462. package/dist/assets/story-pixi-preview-BUrOJZXS.js +1 -0
  463. package/dist/assets/story-presentation-j2AVN-mK.js +1 -0
  464. package/dist/assets/story-three-preview-BHEDZzcl.js +2 -0
  465. package/dist/assets/structural-ids-Dc-7rEwi.js +1 -0
  466. package/dist/assets/structural-signature-0w-i_ats.js +1 -0
  467. package/dist/assets/surface-content-Dg9Kkazf.js +1 -0
  468. package/dist/assets/surface-state-DaxyruCj.js +3 -0
  469. package/dist/assets/system-adapters-rIC8FSGP.js +1 -0
  470. package/dist/assets/system-runner-DkOjxEBt.js +1 -0
  471. package/dist/assets/system-slot-E2mEdiih.js +1 -0
  472. package/dist/assets/team-playtest.service-DqOinFVA.js +1 -0
  473. package/dist/assets/texture.layout-DASpHVht.js +1 -0
  474. package/dist/assets/three-CDSueJyJ.js +1 -0
  475. package/dist/assets/three-authoring-adapter-CmSQ3Vui.js +1 -0
  476. package/dist/assets/three-authoring.service-iuHLwtf1.js +2 -0
  477. package/dist/assets/three-ingest-runtime-QzDYk6tU.js +1 -0
  478. package/dist/assets/three-projection-core-BmKMZ-nf.js +1 -0
  479. package/dist/assets/three-viewport-presentation-QBQpSdMh.js +1 -0
  480. package/dist/assets/three.module-D396a9Mn.js +3840 -0
  481. package/dist/assets/three.quarks.esm-B1C61jGo.js +1039 -0
  482. package/dist/assets/tools-B_NJsk05.js +1 -0
  483. package/dist/assets/transform-writer-BhBBTx33.js +1 -0
  484. package/dist/assets/transport.header-B-6HQlU2.js +1 -0
  485. package/dist/assets/trigger-volume-BNK2XzPL.js +1 -0
  486. package/dist/assets/tuples-CIQ4Bn1U.js +1 -0
  487. package/dist/assets/tween.module-DciWpAG6.js +1 -0
  488. package/dist/assets/ui-board-document-Bwtt--xp.js +2 -0
  489. package/dist/assets/unexported-game-trap-Dm1JYKHy.js +2 -0
  490. package/dist/assets/unmanaged-root-detector-B8CpbkSN.js +2 -0
  491. package/dist/assets/upstream-pin-BdgRH6ID.js +1 -0
  492. package/dist/assets/use-data-Dzq-MytE.js +1 -0
  493. package/dist/assets/use-live-actor-state-DErbWQWF.js +1 -0
  494. package/dist/assets/use-selection-DbR73-xd.js +1 -0
  495. package/dist/assets/user-data-BB2Of6Ht.js +1 -0
  496. package/dist/assets/utility-view-state-BHypxA33.js +1 -0
  497. package/dist/assets/uv-editing.layout-BEKHxmHw.js +1 -0
  498. package/dist/assets/vgai-shared-fontawesome-CU65D4Ij.js +1 -0
  499. package/dist/assets/vgai-shared-jsx-dev-runtime-DFDKL7fx.js +1 -0
  500. package/dist/assets/vgai-shared-jsx-runtime-DIqBpTut.js +1 -0
  501. package/dist/assets/vgai-shared-react-BT7rMc2H.js +1 -0
  502. package/dist/assets/vgai-shared-react-dom-DFajMqMT.js +1 -0
  503. package/dist/assets/vgai-shared-react-dom-client-S0ozfl6_.js +1 -0
  504. package/dist/assets/vgai-shared-three-Bc5PvpLM.js +1 -0
  505. package/dist/assets/viewport-pick-context-DkawXbEi.js +1 -0
  506. package/dist/assets/viewport-root-presentation-CWsE56K6.js +1 -0
  507. package/dist/assets/viewport-shading-BuA88e_A.js +1 -0
  508. package/dist/assets/viewport-shading-boundary-B_-_gABg.js +82 -0
  509. package/dist/assets/viewport-surface-status-B3om4Kcf.js +1 -0
  510. package/dist/assets/vision_bundle-DX0dWqEa.js +15 -0
  511. package/dist/assets/voxel-surface-DtcsSWRL.js +1 -0
  512. package/dist/assets/wav-encode-D31zWF6O.js +1 -0
  513. package/dist/assets/webgl-frame-capture-FlF9zQmW.js +1 -0
  514. package/dist/assets/webgl-gpu-timer-D3YX7RaD.js +1 -0
  515. package/dist/assets/webworkerAll-CM2o_dnz.js +1 -0
  516. package/dist/assets/worker-UrMcrc5_.js +2 -0
  517. package/dist/assets/world-documents-147tiFZe.js +1 -0
  518. package/dist/assets/world-root-stage-binding-vwTrtBz6.js +1 -0
  519. package/dist/assets/world-state-BWG-IcOd.js +1 -0
  520. package/dist/assets/writer-B-KovzkA.js +5 -0
  521. package/dist/assets/xstate-animation-binding-Brd0NST6.js +1 -0
  522. package/dist/assets/xstate-animation-meta-Q3u9zh_m.js +1 -0
  523. package/dist/assets/xstate-behavior.action-B8UluFBK.js +1 -0
  524. package/dist/assets/xstate-behavior.document-CKAsE45I.js +1 -0
  525. package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +1 -0
  526. package/dist/assets/xstate-behavior.menu-BXbPICIh.js +1 -0
  527. package/dist/assets/xstate-inspection-BsZv8LS9.js +1 -0
  528. package/dist/vgai-shared-react.json +10 -0
  529. package/dist/vgai-shared-three.json +3 -0
  530. package/dist-node/cli.js +9320 -0
  531. package/dist-node/create.js +3239 -0
  532. package/package.json +91 -0
  533. package/presets.mjs +2 -0
  534. package/src/contributions.d.ts +4 -0
  535. package/src/index.ts +38 -0
  536. package/starter/cube.blend +0 -0
  537. package/starter/cube.py +81 -0
  538. package/template/.agents/references/project-manual.md +341 -0
  539. package/template/.agents/skills/editor/SKILL.md +53 -0
  540. package/template/.agents/skills/editor/agents/openai.yaml +4 -0
  541. package/template/.agents/skills/editor/references/editor-control.md +363 -0
  542. package/template/.agents/skills/vgai-3d-models/SKILL.md +64 -0
  543. package/template/.agents/skills/vgai-ingest-existing-game/SKILL.md +112 -0
  544. package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +347 -0
  545. package/template/.agents/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
  546. package/template/.agents/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
  547. package/template/.claude/skills/editor/SKILL.md +53 -0
  548. package/template/.claude/skills/editor/agents/openai.yaml +4 -0
  549. package/template/.claude/skills/editor/references/editor-control.md +363 -0
  550. package/template/.claude/skills/vgai-3d-models/SKILL.md +64 -0
  551. package/template/.claude/skills/vgai-ingest-existing-game/SKILL.md +112 -0
  552. package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +347 -0
  553. package/template/.claude/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
  554. package/template/.claude/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
  555. package/template/.github/copilot-instructions.md +6 -0
  556. package/template/.github/skills/editor/SKILL.md +53 -0
  557. package/template/.github/skills/editor/agents/openai.yaml +4 -0
  558. package/template/.github/skills/editor/references/editor-control.md +363 -0
  559. package/template/.github/skills/vgai-3d-models/SKILL.md +64 -0
  560. package/template/.github/skills/vgai-ingest-existing-game/SKILL.md +112 -0
  561. package/template/.github/skills/vgai-threejs-authoring/SKILL.md +347 -0
  562. package/template/.github/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
  563. package/template/.github/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
  564. package/template/.mcp.json +12 -0
  565. package/template/.vgai/assets.json +1 -0
  566. package/template/.vgai/provenance.json +4 -0
  567. package/template/.volter/tracker/validation/.preset.base.mts +178 -0
  568. package/template/.volter/tracker/validation/preset.mts +186 -0
  569. package/template/.volter/tracker/visualizer/.extension.base.tsx +14 -0
  570. package/template/.volter/tracker/visualizer/extension.tsx +14 -0
  571. package/template/.volter/tracker-config.json +17 -0
  572. package/template/AGENTS.md +176 -0
  573. package/template/CLAUDE.md +1 -0
  574. package/template/DEVLOG.md +20 -0
  575. package/template/IDIOMS.md +118 -0
  576. package/template/LICENSE +30 -0
  577. package/template/README.md +83 -0
  578. package/template/ROADMAP.md +20 -0
  579. package/template/asset-manifest.json +3 -0
  580. package/template/check-idioms.ts +1533 -0
  581. package/template/index.html +18 -0
  582. package/template/manifest-entry-modules-plugin.ts +53 -0
  583. package/template/package.json +62 -0
  584. package/template/public/jsm/libs/basis/basis_transcoder.js +19 -0
  585. package/template/public/jsm/libs/basis/basis_transcoder.wasm +0 -0
  586. package/template/public/jsm/libs/draco/gltf/draco_decoder.js +33 -0
  587. package/template/public/jsm/libs/draco/gltf/draco_decoder.wasm +0 -0
  588. package/template/public/jsm/libs/draco/gltf/draco_encoder.js +33 -0
  589. package/template/public/jsm/libs/draco/gltf/draco_wasm_wrapper.js +116 -0
  590. package/template/public/shaders/daylight-sky.frag.glsl +15 -0
  591. package/template/public/shaders/daylight-sky.vert.glsl +7 -0
  592. package/template/scripts/patch-drei-stats-gl.mjs +35 -0
  593. package/template/server/colyseus-setup.ts +111 -0
  594. package/template/server/loopback.ts +76 -0
  595. package/template/server/main.ts +78 -0
  596. package/template/server/rooms/arena-room.ts +488 -0
  597. package/template/server/rooms/game-room.ts +274 -0
  598. package/template/server/rooms.ts +15 -0
  599. package/template/server/tsconfig.json +19 -0
  600. package/template/src/bot/QaTester.tsx +35 -0
  601. package/template/src/bot/behaviors.ts +203 -0
  602. package/template/src/bot/bot-station.ts +192 -0
  603. package/template/src/bot/tester-run.ts +238 -0
  604. package/template/src/bot/tester-station.ts +193 -0
  605. package/template/src/components/environment/DaylightSky.tsx +54 -0
  606. package/template/src/components/environment/Ground.tsx +129 -0
  607. package/template/src/components/environment/SceneAtmosphere.tsx +14 -0
  608. package/template/src/components/environment/SoftGroundShadow.tsx +62 -0
  609. package/template/src/components/environment/SunShadowFit.tsx +141 -0
  610. package/template/src/contributions/README.md +98 -0
  611. package/template/src/contributions/analytics.analytics.tsx +26 -0
  612. package/template/src/contributions/data.document.tsx +35 -0
  613. package/template/src/contributions/pages.finder.ts +61 -0
  614. package/template/src/contributions/tester.inspector.tsx +64 -0
  615. package/template/src/contributions/use-game-modules.ts +80 -0
  616. package/template/src/data/README.md +17 -0
  617. package/template/src/input.ts +97 -0
  618. package/template/src/lib/audio/capability.json +4 -0
  619. package/template/src/lib/audio/sfx.ts +255 -0
  620. package/template/src/lib/react-root/capability.json +4 -0
  621. package/template/src/lib/react-root/index.ts +20 -0
  622. package/template/src/lib/react-root/react-root-adapter.tsx +57 -0
  623. package/template/src/lib/reflections/ReflectionProbe.tsx +201 -0
  624. package/template/src/lib/reflections/capability.json +4 -0
  625. package/template/src/lib/reflections/index.ts +19 -0
  626. package/template/src/lib/reflections/probe-controller.ts +75 -0
  627. package/template/src/lib/reflections/reflection-probe-registry.ts +402 -0
  628. package/template/src/lib/reflections/volume-reflection-material.ts +416 -0
  629. package/template/src/lib/static-batch/Frozen.tsx +91 -0
  630. package/template/src/lib/static-batch/capability.json +4 -0
  631. package/template/src/lib/static-batch/freeze.ts +579 -0
  632. package/template/src/lib/static-batch/index.ts +44 -0
  633. package/template/src/lib/static-batch/mutation-watch.ts +149 -0
  634. package/template/src/lib/static-batch/shadow-cache.ts +171 -0
  635. package/template/src/main.ts +63 -0
  636. package/template/src/manifest-entry-modules.d.ts +3 -0
  637. package/template/src/prefabs/HeroBox.stories.tsx +23 -0
  638. package/template/src/prefabs/HeroBox.tsx +35 -0
  639. package/template/src/scenes/MainScene.tsx +77 -0
  640. package/template/src/world.tsx +87 -0
  641. package/template/tsconfig.json +35 -0
  642. package/template/tsconfig.node.json +32 -0
  643. package/template/tsconfig.tools.json +22 -0
  644. package/template/validate-asset-content.ts +27 -0
  645. package/template/validate-assets.ts +60 -0
  646. package/template/validate-manifest.ts +55 -0
  647. package/template/vgai.adapter.ts +76 -0
  648. package/template/vgai.project.json +24 -0
  649. package/template/vite.config.ts +247 -0
  650. package/template-dotfiles/gitignore +63 -0
  651. package/workbench/src/media/game-cover.css +83 -0
  652. package/workbench/src/product.contribution.ts +188 -0
  653. package/workbench/src/vgaiGameSkew.ts +276 -0
@@ -0,0 +1 @@
1
+ import{m as Y}from"./capability-coverage-Czas4C18.js";import{V as h,aC as Z,aE as Q,jT as ee,jU as k,jV as j,jW as te,aF as D,jX as re,jY as ne,jZ as oe,j_ as se,fJ as ae,j$ as ie,bW as ce,b_ as de,bX as ue,bY as le,bZ as me}from"./index-GIL7oGEO.js";import{A as fe,G as pe,B as he,C as ge,D as v,E as W,F as ye,H as we,I as be,J as ve,K as M,L as Se,s as Ie,c as Re,M as Ee,j as ke,k as $e,l as Ce,N as Me,u as Pe,y as Le,z as Ge,O as Te,r as Ae,P as je,Q as De,p as We,o as Oe}from"./active-ingest-CT6jSGhr.js";import{p as _e}from"./scene-framing-Cat0GtyJ.js";import{w as ze,c as U,h as Fe,i as Ue,a as Ve,b as He,r as xe,e as Ne}from"./resolve-three-SZE_WWUM.js";import{s as Be}from"./ingest-source-persistence-C_6Hiyra.js";import{a as O}from"./json-history-resource-BbxllWfV.js";import{r as qe}from"./three-ingest-runtime-QzDYk6tU.js";import{describeMountFailure as Je}from"./mount-readiness-Ds0HvvLH.js";import{formatLoopGateMessage as Ke}from"./loop-gate-report-N52EWFGD.js";import{a as Xe,s as Ye}from"./three-authoring-adapter-CmSQ3Vui.js";import{installSceneCapture as Ze}from"./scene-capture-BQKzU0NT.js";import{s as Qe}from"./mount-ingest-root-glv2SSWf.js";import{landIngestBootInEdit as et}from"./ingest-boot-viewport-D5rI_Kk_.js";import{b as tt,c as _,e as rt,g as V}from"./registry-02YZjMNp.js";import"./game-contract-seams-a5YXejOu.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"./three.module-D396a9Mn.js";import"./playtest-BXIL1JEF.js";import"./dom-authoring-adapter-CY8C7f4T.js";import"./react-world-authoring-adapter-DmrwM3py.js";import"./board-guides-DziKSTss.js";import"./writer-B-KovzkA.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";import"./debug-registry-Dgvitx8M.js";import"./webgl-frame-capture-FlF9zQmW.js";import"./EffectComposer-DQxfsXBZ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-QYRpPuFJ.js";import"./CSS3DRenderer-CL7ABLVK.js";import"./source-persistence-backend-C-aR-B_Y.js";import"./three-projection-core-BmKMZ-nf.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./body-marks-h_xDxiDE.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Dc-7rEwi.js";import"./object3d-authoring-subject-CH5sI2oP.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-BBo8oma9.js";const nt="contract-hierarchy:group:",I="contract-hierarchy:render-tree";function H(t){return`${nt}${encodeURIComponent(t)}`}function z(t){return{id:H(t.id),label:t.label,secondaryLabel:`${t.count} ${t.count===1?"item":"items"}`,role:"folder",kind:"group",parentId:null,childIds:[]}}function ot(t){if(!Array.isArray(t))throw new Error("hierarchy() did not return an array");const e=new Set;for(const r of t){if(typeof r!="object"||r===null||typeof r.id!="string"||r.id.trim().length===0||typeof r.label!="string"||r.label.trim().length===0||typeof r.count!="number"||!Number.isInteger(r.count)||r.count<0)throw new Error("hierarchy() returned an invalid { id, label, count } group");if(e.has(r.id))throw new Error(`hierarchy() returned duplicate id "${r.id}"`);e.add(r.id)}return t}function st(t,e){if(!e)return t;let r=!1;const o=()=>{try{return ot(e())}catch(a){return r||(r=!0,h.warn(`Ignored invalid game-contract hierarchy: ${a instanceof Error?a.message:String(a)}`,"ingest")),[]}},n=()=>{const a=o(),i=t.hierarchy.roots();return a.length===0?i:[...a.map(z),{id:I,label:"Rendered objects",secondaryLabel:"live tree",role:"folder",kind:"group",parentId:null,childIds:i.map(d=>d.id)}]},s=a=>{const i=o(),d=i.find(w=>H(w.id)===a);if(d)return z(d);if(i.length>0&&a===I){const w=t.hierarchy.roots();return{id:I,label:"Rendered objects",secondaryLabel:"live tree",role:"folder",kind:"group",parentId:null,childIds:w.map(g=>g.id)}}const p=t.hierarchy.node(a);return i.length>0&&p?.parentId===null?{...p,parentId:I}:p},l=new Proxy(t.hierarchy,{get(a,i){if(i==="roots")return n;if(i==="node")return s;const d=Reflect.get(a,i,a);return typeof d=="function"?d.bind(a):d}}),m=a=>{const i=t.subscribe?.(a),d=e.subscribe?.(a);return()=>{i?.(),d?.()}};return new Proxy(t,{get(a,i){if(i==="hierarchy")return l;if(i==="subscribe")return m;const d=Reflect.get(a,i,a);return typeof d=="function"?d.bind(a):d}})}const at="vgaiDomStub";let F=null;function x(t){for(const e of fe())if(e.surface.contains(t))return e;return null}function it(){if(F!==null||typeof Element>"u")return;const t=Element.prototype,e=t.requestPointerLock;typeof e=="function"&&(F=e,t.requestPointerLock=function(r){const o=x(this);return o&&!o.gate()?(console.error("Ingested game requested pointer lock while its input gate is closed — refused. A game only captures the mouse while play is running AND the Game tab is active (the same predicate that gates its keyboard listeners); the editor viewport owns pointer lock otherwise. See packages/editor/src/ingest/game-pointer-lock.ts."),Promise.reject(new Error("pointer lock refused: game input gate is closed"))):e.call(this,r)})}function N(){if(typeof document>"u")return;const t=document.pointerLockElement;t&&x(t)&&document.exitPointerLock()}function ct(t,e,r,o,n={}){let s=null;return{setPaused(l){if(!l){o.resume(),n.realmGate?.release();return}o.pause(),n.realmGate?.hold(),be({gate:n.realmGate??null,progress:()=>e.info?.render.frame??t.getDrawCount(),...n.verifyWindowMs!==void 0?{windowMs:n.verifyWindowMs}:{},...n.sleep!==void 0?{sleep:n.sleep}:{}}).then(m=>{s=m,n.onVerdict?.(m),m.loop!=="gated"&&console.warn(Ke({worldId:r,reason:t.getAnimationLoop(e)?m.reason:`${m.reason} (this game also never called renderer.setAnimationLoop)`}))})},lastVerdict:()=>s}}function dt(t){let e=0;return t.traverse(r=>{ae(r)!==void 0&&e++}),e}async function ut(t,e=2500,r=o=>new Promise(n=>setTimeout(n,o))){const o=performance.now();for(;;){const n=dt(t);if(n>0)return n;if(performance.now()-o>=e)return 0;await r(100)}}function lt(t,e){const r=e.replace(/\\/g,"/"),o=r.startsWith("/")?"":t.replace(/\\/g,"/"),n=[];for(const s of`${o}/${r}`.split("/"))s===""||s==="."||(s===".."?n.pop():n.push(s));return`/${n.join("/")}`}function mt(t,e){if(!t)return[];const r=t.replace(/\\/g,"/").replace(/\/+$/,""),o=new Set([r]);for(const n of e??[]){const s=lt(r,n),l=s.slice(0,s.lastIndexOf("/"));l&&o.add(l)}return[...o]}function ft(t,e){if(!t||e.length===0)return!1;for(const r of Object.values(t)){const o=r?.file;if(typeof o!="string")continue;const n=o.replace(/\\/g,"/");if(e.some(s=>n===s||n.startsWith(`${s}/`)))return!0}return!1}function pt(t){return t.servedStampedSource||t.graphStamps>0?"oid-source":"structural"}async function ht(){if(!await re())return null;try{return await ne().index?.()??null}catch{return null}}function gt(t){return h.getEntries().filter(e=>e.level==="error"&&e.source==="runtime"&&e.timestamp>=t).slice(-10).map(e=>e.count>1?`${e.message} (×${e.count})`:e.message)}async function yt(t,e,r){if(r)try{return await r(),"declared"}catch(o){h.error(`Ingest game "${t}" declared \`window.vgaiGame.ready\` and it REJECTED (${String(o)}) — the world was already captured, so the host fell back to the measured settle wait. This root now reports readiness as measured.`,"ingest")}return await wt(e),"measured"}async function wt(t,e=5e3){const r=performance.now();let o=-1,n=0;return new Promise(s=>{const l=()=>{const m=t.children.length;if(n=m===o?n+1:0,o=m,n>=3||performance.now()-r>e)return s();setTimeout(l,120)};l()})}function bt(t,e){const r=we(),o=v()?.root??r.__vgaiGameRoot,n=o instanceof HTMLElement&&o.contains(e)?o:e;return n.contains(t)?t:(n.parentElement!==t&&t.contains(n)||(U(n),n.parentElement!==t&&t.appendChild(n)),n)}async function vt(t,e,r,o={}){const n=document.createElement("div");n.id="container",n.style.cssText=`position:absolute;inset:0;width:100%;height:100%;overflow:hidden;${pe}`,r.appendChild(n);const s=he(n);Z(n);const l=D();l&&await Q(l.rootPath);const m=[];for(const c of e.domStubs??[]){if(document.getElementById(c))continue;const f=document.createElement("div");f.id=c,f.style.display="none",f.dataset[at]="",n.appendChild(f),m.push(f)}const a=await qe(),i=a.three,d=Ze(i,a.EffectComposer,{isHostRenderer:ie,additionalRendererCtors:[a.CSS3DRenderer],declaredScene:()=>{const c=Se(v());return c.malformed!==null&&h.error(`Ingest game "${e.id}" ${c.malformed} — falling back to the MEASURED first-render adoption.`,"ingest"),c.world},onWorldAdoption:ee(e.id)});if(e.assets){const c=e.assets;i.DefaultLoadingManager.setURLModifier(f=>{for(const y of Object.keys(c))if(f.includes(y))return c[y];return f})}window.__vgaiMountCold=!0;const p=Date.now();await e.load();const w=o.captureTimeoutMs??1e4,g=ge(v());g.malformed!==null&&h.error(`Ingest game "${e.id}" ${g.malformed} — the host is measuring readiness instead.`,"ingest");const b=g.ready===null?"measured":"declared";k({rootId:e.id,mechanism:g.ready===null?"measured-wait":"contract-ready",source:b,state:"waiting"});let u;try{u=await d.waitForCapture({timeoutMs:w,onWait:c=>Qe(e.id,c)})}catch(c){d.uninstall(),i.DefaultLoadingManager.setURLModifier(y=>y);for(const y of m)y.remove();W(),n.remove(),j(e.id);const f=Je({gameId:e.id,timeoutMs:w,readinessSource:b,pageErrors:gt(p),cause:String(c)});throw k({rootId:e.id,mechanism:g.ready===null?"measured-wait":"contract-ready",source:b,state:"failed",failure:f.kind}),new Error(f.message)}const R=bt(n,u.renderer.domElement),S=ye(v());S.malformed!==null&&h.error(`Ingest game "${e.id}" ${S.malformed} — the host is using the captured renderer’s canvas instead.`,"ingest"),te(e.id,S.canvas??u.renderer.domElement,S.canvas?"declared":"measured"),it();const P=await yt(e.id,u.scene,g.ready);k({rootId:e.id,mechanism:P==="declared"?"contract-ready":"measured-wait",source:P,state:"ready"});const E={pause:()=>u.renderer.setAnimationLoop?.(null),resume:()=>{const c=d.getAnimationLoop(u.renderer);c&&u.renderer.setAnimationLoop?.(c)}};Be(e.dataWriter??null);const q=mt(D()?.rootPath,e.sourceModules),L=ft(await ht(),q),J=L?0:await ut(u.scene),G=pt({servedStampedSource:L,graphStamps:J})==="oid-source"?Xe(t,u.scene,{worldId:e.id,loop:E,camera:u.camera,journal:O(e.id)}):Ye(t,u.scene,{loop:E,camera:u.camera,journal:O(e.id)}),T=ct(d,u.renderer,e.id,E,{realmGate:M(),onVerdict:()=>t.notifyIngestEdit()}),{systems:A,renderDebug:K,debugCollisions:X}=ze({contractSystems:v()?.systems,surface:"three",runtime:u,setRenderPassHooks:c=>d.setRenderPassHooks(c)});for(const c of X)h.error(`Ingest game "${e.id}" — ${c}; it will refuse`,"ingest");return{game:{kind:"three",scene:u.scene,camera:u.camera,drivesOwnLoop:!0,...Object.keys(A).length>0?{systems:A}:{},setPaused:c=>T.setPaused(c),resize:(c,f)=>{if(s.gameResizesItself){s.dispatchResize();return}const y=Fe(c,f);u.renderer.setSize(y.width,y.height,!1),d.resizeComposers(y.width,y.height),U(R)},dispose:()=>{d.setRenderPassHooks(null),ve(),K?.dispose();try{u.renderer.setAnimationLoop?.(null),u.renderer.dispose?.()}catch{}d.uninstall(),i.DefaultLoadingManager.setURLModifier(c=>c);for(const c of m)c.remove();N(),W(),oe(e.id),se(e.id),j(e.id),n.remove()},authoring:G},authoring:G,hostEl:n,capture:d,scene:u.scene,realmLoopVerdict:()=>T.lastVerdict()}}function St(t,e){const r={};for(const[o,n]of Object.entries(e)){const s=V(t,n),l=_[s];if(!l)throw new Error(`ingest discovery: "${t}"'s asset "${n}" did not match any served asset (looked for glob key "${s}" — available: ${Object.keys(_).join(", ")})`);r[o]=l}return r}function $(t,e){const r=V(t,e),o=rt[r];if(!o)throw new Error(`ingest discovery: "${t}"'s module "${e}" did not match any game module (looked for glob key "${r}").`);return o}function It({folderId:t,manifest:e,root:r}){const{adapter:o}=r;if(!r.entry)throw new Error(`ingest discovery: "${t}" has no \`entry\` — an ingest root mounts the game's own entry module.`);return{...{id:r.id,name:e.name,description:r.description??"",gameVersion:e.version,sourceModules:Ve(r.entry,r.world?.entry),...Ue(o.dataWriter,s=>$(t,s)),...o.assets!==void 0?{assets:St(t,o.assets)}:{},...o.domStubs!==void 0?{domStubs:o.domStubs}:{},...o.captureTimeoutMs!==void 0?{captureTimeoutMs:o.captureTimeoutMs}:{}},load:He($(t,r.entry),o.contractShim===void 0?void 0:$(t,o.contractShim))}}let C=null;function Rt(){return C||(C=tt("three").map(It).sort((t,e)=>t.id.localeCompare(e.id))),C}function Et(t){return Rt().find(e=>e.id===t)}function kt(t){return t==="devtools-observer"?"this game runs its OWN copy of three; the host reached its renderer through three's `__THREE_DEVTOOLS__` observation seam":"this game imports the host's three directly, in the editor's own realm"}function $t(t){const{store:e,session:r,sessionId:o}=t,n=r.mount;if(!n)return;const s=n.authoring,l=Ge(),m=st(s,l?.systems?.hierarchy),a=Ne({primary:m,worldId:o,hostEl:n.hostEl,...l?.root?{declaredRoot:l.root}:{},store:e}),i=n.scene,d=new ResizeObserver(()=>{const u=t.gameContainer.getBoundingClientRect();u.width>0&&u.height>0&&n.game.resize?.(u.width,u.height)});d.observe(t.gameContainer),r.resizeObserver=d;const p=s.refresh(),w=s.measureWriteReach();h.log(`Captured live scene (${i.children.length} top-level children, ${n.capture.getDrawCount()} draws); ingested ${p.count} objects (${p.meshes} meshes, ${p.lights} lights`+(p.instancedMeshes>0?`, incl. ${p.instancedMeshes} InstancedMesh drawing ${p.instances} units`:"")+`); ${w.addressable} of ${w.total} have a source address — edits go to ${w.destination}`,"ingest"),Te(o,n.realmLoopVerdict?.()??void 0),ue(a),le(n.game.systems??{}),e.enterPlayScene(i,void 0,s.objectMapSnapshot()),e.focusOnScene(()=>_e(n.capture.captured?.camera,i)),et(e),e.notifyIngestEdit(),me();const g=Y({authoring:a});Ae({reach:g,reachMechanism:kt(n.capture.capturedVia),loop:()=>je(n),writeReach:()=>s.measureWriteReach()});const b={gameId:o,...Oe(a),drawCount:()=>n.capture.getDrawCount(),get reflected(){return s.refresh()},get sceneChildren(){return i.children.length},reach:g,resize:(u,R)=>n.game.resize?.(u,R),...r.lifecycle.setPaused?{setPaused:r.lifecycle.setPaused}:{}};De(b,n),We("__vgaiIngest",b)}async function Ct(t,e,r){Re(),Ee(r),await ce();const o=de();if(!o){h.error("Game container not mounted — cannot ingest","ingest");return}t.setPlayState("playing"),h.log(`Ingesting unmodified game: ${e.name}`,"ingest");const n=()=>t.playState==="playing"&&t.activeViewportTab==="play";try{const s={captureTimeoutMs:e.captureTimeoutMs},l=await vt(t,e,o,s),m=l.game.setPaused,a={store:t,mount:l,lifecycle:ke(m?{setPaused:i=>m(i),step:()=>M()?.step(1),canStep:()=>l.realmLoopVerdict?.()?.loop==="gated"&&M()!==null}:{pauseGap:"the captured Three root exposes no mounted setPaused capability"})};$e({kind:"three",session:a,siblings:[],worldId:r}),Ce(n),a.inputGateUnsubscribe=t.subscribe(()=>{n()||N()}),Me(Pe()),$t({store:t,session:a,gameContainer:o,sessionId:r})}catch(s){throw h.error(`Ingest failed: ${s}`,"ingest"),Le(),s}}function B(t,e,r){return Ie(()=>Ct(t,e,r))}async function kr(t,e){const r=Et(e);if(!r){h.error(`Unknown ingest game: ${e}`,"ingest");return}return B(t,r,e)}async function $r(t,e,r){const o=xe(e,r);return B(t,o,e.id)}export{B as mountThreeIngestRoot,kr as mountThreeIngestRootById,$r as mountThreeIngestRootFromManifest};
@@ -0,0 +1 @@
1
+ import{O as o}from"./index-GIL7oGEO.js";function f(t,i){if(t.selection)return t;const s={get:()=>[...i.selectedEntityIds],set:e=>i.selectMultiple(e)};return new Proxy(t,{get(e,n){if(n==="selection")return s;const c=Reflect.get(e,n,e);return typeof c=="function"?c.bind(e):c}})}function l(t,i){const s=i.hierarchy.idForObject3D;s&&t.traverse(e=>{const n=s(e);n&&o(e,n)})}export{l as s,f as w};
@@ -0,0 +1 @@
1
+ import{disposeStoryObject3D as l}from"./story-three-preview-BHEDZzcl.js";function u(e){let o=!1,r=!1,t=0;const s=()=>{!o||t!==0||r||(r=!0,l(e))};return{build:()=>{if(r)throw new Error("This story source has already been released.");t++;let i=!1;return{root:e.root,hierarchyRoots:[...e.root.children],update:a=>e.advance(a),dispose:()=>{i||(i=!0,t--,s())}}},dispose:()=>{o=!0,s()}}}export{u as m};
@@ -0,0 +1 @@
1
+ import{NATIVE_INPUT_VALUE_TYPES as l}from"./native-entry-surface-BE8LJNdu.js";import{g as E,D as h}from"./debug-registry-Dgvitx8M.js";import{p as T,C as A}from"./playtest-BXIL1JEF.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./game-contract-seams-a5YXejOu.js";function p(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function g(t,n,o){const e=Object.keys(t).filter(r=>!n.includes(r));if(e.length>0)throw new Error(`${o} has unknown ${e.length===1?"key":"keys"}: ${e.join(", ")}`)}function y(t,n){if(!p(t))throw new Error(`${n} must be an object of named functions.`);const o={};for(const[e,r]of Object.entries(t)){if(!e)throw new Error(`${n} contains an empty name.`);if(typeof r!="function")throw new Error(`${n}.${e} must be a function.`);o[e]=r}return o}function j(t){if(!p(t))throw new Error("debug.input.actions must be an object mapping action names to value types.");const n={};for(const[o,e]of Object.entries(t)){if(!o)throw new Error("debug.input.actions contains an empty action name.");if(!l.includes(e))throw new Error(`debug.input.actions.${o} must be one of ${l.join(", ")}.`);n[o]=e}return n}function $(t){if(!p(t))throw new Error("debug.input must be an object.");if(g(t,["actions","set","clear","tap","scheduleAtTick"],"debug.input"),typeof t.actions=="function"){const s=t.set,m=t.clear;if(typeof s!="function")throw new Error("debug.input.set must be a function.");if(typeof m!="function")throw new Error("debug.input.clear must be a function.");return t}const n=t.set,o=t.clear,e=t.tap,r=t.scheduleAtTick;if(typeof n!="function")throw new Error("debug.input.set must be a function.");if(typeof o!="function")throw new Error("debug.input.clear must be a function.");if(e!==void 0&&typeof e!="function")throw new Error("debug.input.tap must be a function when provided.");if(r!==void 0&&typeof r!="function")throw new Error("debug.input.scheduleAtTick must be a function when provided.");return{actions:j(t.actions),set:n,clear:o,...typeof e=="function"?{tap:e}:{},...typeof r=="function"?{scheduleAtTick:r}:{}}}function K(t,n){if(!p(n)||n.debug===void 0)return null;if(!p(n.debug))throw new Error(`Root "${t}" exports \`debug\`, but it is not an object.`);const o=n.debug;g(o,["commands","state","input","events","settled"],`Root "${t}" debug export`);const e=(u,i)=>{if(u!==void 0)return typeof u=="function"?u:y(u,i)},s=((u,i)=>{if(u!==void 0){if(typeof u=="function")return u;if(!p(u))throw new Error(`${i} must be an object of named commands.`);return u}})(o.commands,"debug.commands"),m=e(o.state,"debug.state"),f=o.input===void 0?void 0:$(o.input),c=o.events===void 0?void 0:N(o.events),d=o.settled;if(d!==void 0&&typeof d!="function")throw new Error("debug.settled must be a function returning a boolean.");if(!s&&!m&&!f&&!c&&!d)throw new Error(`Root "${t}" exports an empty \`debug\` object.`);return{rootId:t,debug:{...s?{commands:s}:{},...m?{state:m}:{},...f?{input:f}:{},...c?{events:c}:{},...d?{settled:d}:{}}}}function N(t){if(!p(t)||typeof t.subscribe!="function")throw new Error("debug.events must be an object with a subscribe(listener) function.");return t}function I(t,n){if(t===void 0)return{};const o=typeof t=="function"?t():t;if(!p(o))throw new Error(`${n} must be an object of named commands.`);for(const[e,r]of Object.entries(o)){if(!e)throw new Error(`${n} contains an empty name.`);if(!(typeof r=="function"||p(r)&&typeof r.run=="function"))throw new Error(`${n}.${e} must be a function or { description?, run }.`)}return o}function P(t,n){return t===void 0?{}:typeof t=="function"?y(t(),n):t}function R(t,n){return t==="digital"?typeof n=="boolean":t==="scalar"?typeof n=="number"&&Number.isFinite(n):typeof n=="object"&&n!==null&&typeof n.x=="number"&&Number.isFinite(n.x)&&typeof n.y=="number"&&Number.isFinite(n.y)}function S(t,n,o,e){const r=[];let s=!1;const m=()=>typeof e.actions=="function"?e.actions():e.actions,f=(i,a)=>{const w=m(),b=w[i];if(!b)throw new h("INPUT_ACTION_NOT_FOUND",`Native input has no action named "${i}".`,{registered:Object.keys(w)});if(!R(b,a))throw new h("INPUT_ACTION_VALUE_TYPE",`Native input action "${i}" expects ${b}, not ${typeof a}.`,{action:i,expected:b});return b},c=(i,a,w)=>{f(i,a),e.set(i,a),s&&r.push({tick:w,action:i,value:a})},d=i=>{throw new h("NATIVE_INPUT_SOURCE_UNSUPPORTED",`${i} addresses an engine test source, but this game exposes an app-owned action store. Drive it by action name instead.`)},u={setVirtualAction(i,a){return c(i,a,n.getGameTick()),{delivered:!0}},tapVirtualAction(i){if(!e.tap)throw new h("NATIVE_INPUT_TAP_UNSUPPORTED",`Native input for root "${o.rootId}" does not export tap(); use setVirtualAction through the app-owned store.`);return f(i,!0),e.tap(i),{delivered:!0}},clearVirtualActions(){e.clear()},scheduleActionAtTick(i,a,w){const b=n.getGameTick();if(!Number.isInteger(i)||i<b)throw new h("TICK_ALREADY_PASSED",`Cannot schedule native input for tick ${i}; current tick is ${b}.`,{tick:i,currentTick:b});if(f(a,w),!e.scheduleAtTick)throw new h("NATIVE_INPUT_SCHEDULE_UNSUPPORTED",`Native input for root "${o.rootId}" does not export scheduleAtTick(); the adapter will not create a host scheduler for it.`);e.scheduleAtTick(i,a,w)},startInputRecording(){r.length=0,s=!0},stopInputRecording(){s=!1},isInputRecording(){return s},injectAxis(){d("injectAxis")},injectVector2(){d("injectVector2")},injectPointerDelta(){d("injectPointerDelta")},injectPointerPosition(){d("injectPointerPosition")}};n.setInputActionsSource(o.rootId,()=>Object.entries(m()).map(([i,a])=>({name:i,valueType:a}))),n.setInputTraceSource(o.rootId,()=>({version:1,seed:null,fixedDt:t.loop.fixedDt,ticks:[...r]})),n.setVirtualInputTarget(o.rootId,u)}function q(t,n){if(n.length===0)return;const o=E(t);if(!o)throw new Error("Cannot install native debug bindings: mounted Game has no debug registry.");for(const e of n){if(!t.world(e.rootId))throw new Error(`Native debug binding names unmounted root "${e.rootId}".`);const r=o.forRoot(e.rootId),s=P(e.debug.state,`Root "${e.rootId}" debug.state`);for(const[f,c]of Object.entries(s))r.registerStateProvider(f,c,{tier:"assisted"});const m=I(e.debug.commands,`Root "${e.rootId}" debug.commands`);for(const[f,c]of Object.entries(m)){const d=typeof c=="function"?c:c.run,u=typeof c=="function"?void 0:c.description;r.registerCommand(f,{locus:"client",...u===void 0?{}:{description:u}},d)}e.debug.input&&S(t,o,e,e.debug.input),e.debug.events?.subscribe((f,c)=>r.emit(f,c)),e.debug.settled&&o.registerWorldSettledProbe(e.debug.settled)}}function H(t,n,o){if(!p(n)||n.systems===void 0)return null;const e=n.systems;if(!p(e))throw new Error(`Root "${t}" exports \`systems\`, but it is not an object.`);g(e,A,`Root "${t}" systems export`);const r=T({systemAdapters:e},o);if(r.malformed.length>0)throw new Error(`Root "${t}" systems export is malformed: `+r.malformed.map(s=>`${s.slot} — ${s.reason}`).join("; "));if(Object.keys(r.bound).length===0&&r.empty.length===0)throw new Error(`Root "${t}" exports an empty \`systems\` object.`);return{rootId:t,slots:r.bound,absent:r.empty}}function W(t,n){if(n.length===0)return;const o=t.installDeclaredSystemAdapters;if(!o)throw new Error("Cannot install native systems bindings: this Game does not implement installDeclaredSystemAdapters.");for(const e of n)Object.keys(e.slots).length===0&&e.absent.length===0||o.call(t,e.rootId,e.slots,e.absent.map(r=>({rootId:e.rootId,slot:r.slot,reason:r.evidence})))}export{l as NATIVE_INPUT_VALUE_TYPES,q as installNativeDebugBindings,W as installNativeSystemsBindings,K as nativeDebugBindingFromEntryModule,H as nativeSystemsBindingFromEntryModule};
@@ -0,0 +1 @@
1
+ const t=["digital","scalar","vector2","pointerDelta","pointerPosition"];export{t as NATIVE_INPUT_VALUE_TYPES};
@@ -0,0 +1 @@
1
+ import{_ as Ge}from"./index-GIL7oGEO.js";import{O as ke,aB as Ve,z as We,M as j,aC as ie,V as Ye,C as Qe,a as ne,bt as Xe}from"./three.module-D396a9Mn.js";import{DEFAULTS as le}from"./defaults-DKiBJCPN.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 $e=["Recast","Detour","DetourNavMeshBuilder","DetourTileCacheBuilder","NavMeshImporter","NavMeshExporter","CrowdUtils","ChunkyTriMeshUtils","RecastDebugDraw","DetourDebugDraw"],qe=["rcConfig","rcContext","dtNavMeshParams","dtNavMeshCreateParams","RecastLinearAllocator","RecastFastLZCompressor","rcChunkyTriMesh","dtTileCacheParams","dtTileCacheLayerHeader","Vec3","BoolRef","IntRef","UnsignedIntRef","UnsignedCharRef","UnsignedShortRef","FloatRef","IntArray","UnsignedIntArray","UnsignedCharArray","UnsignedShortArray","FloatArray"],s={isNull:a=>s.Module.getPointer(a)===0,destroy:a=>{s.Module.destroy(a)}},g={},f={},Ke=async a=>{if(s.Module===void 0){{const e=(await Ge(async()=>{const{default:t}=await import("./recast-navigation.wasm-compat-Dsoa_MD-.js");return{default:t}},[])).default;s.Module=await e()}for(const e of $e)s[e]=new s.Module[e];for(const e of qe)s[e]=s.Module[e];g.RC_BORDER_REG=s.Recast.BORDER_REG,g.RC_MULTIPLE_REGS=s.Recast.MULTIPLE_REGS,g.RC_BORDER_VERTEX=s.Recast.BORDER_VERTEX,g.RC_AREA_BORDER=s.Recast.AREA_BORDER,g.RC_CONTOUR_REG_MASK=s.Recast.CONTOUR_REG_MASK,g.RC_MESH_NULL_IDX=s.Recast.MESH_NULL_IDX,g.RC_NULL_AREA=s.Recast.NULL_AREA,g.RC_WALKABLE_AREA=s.Recast.WALKABLE_AREA,g.RC_NOT_CONNECTED=s.Recast.NOT_CONNECTED,g.RC_CONTOUR_TESS_WALL_EDGES=s.Module.RC_CONTOUR_TESS_WALL_EDGES,g.RC_CONTOUR_TESS_AREA_EDGES=s.Module.RC_CONTOUR_TESS_AREA_EDGES,g.RC_LOG_PROGRESS=s.Module.RC_LOG_PROGRESS,g.RC_LOG_WARNING=s.Module.RC_LOG_WARNING,g.RC_LOG_ERROR=s.Module.RC_LOG_ERROR,g.RC_TIMER_TOTAL=s.Module.RC_TIMER_TOTAL,g.RC_TIMER_TEMP=s.Module.RC_TIMER_TEMP,g.RC_TIMER_RASTERIZE_TRIANGLES=s.Module.RC_TIMER_RASTERIZE_TRIANGLES,g.RC_TIMER_BUILD_COMPACTHEIGHTFIELD=s.Module.RC_TIMER_BUILD_COMPACTHEIGHTFIELD,g.RC_TIMER_BUILD_CONTOURS=s.Module.RC_TIMER_BUILD_CONTOURS,g.RC_TIMER_BUILD_CONTOURS_TRACE=s.Module.RC_TIMER_BUILD_CONTOURS_TRACE,g.RC_TIMER_BUILD_CONTOURS_SIMPLIFY=s.Module.RC_TIMER_BUILD_CONTOURS_SIMPLIFY,g.RC_TIMER_FILTER_BORDER=s.Module.RC_TIMER_FILTER_BORDER,g.RC_TIMER_FILTER_WALKABLE=s.Module.RC_TIMER_FILTER_WALKABLE,g.RC_TIMER_MEDIAN_AREA=s.Module.RC_TIMER_MEDIAN_AREA,g.RC_TIMER_FILTER_LOW_OBSTACLES=s.Module.RC_TIMER_FILTER_LOW_OBSTACLES,g.RC_TIMER_BUILD_POLYMESH=s.Module.RC_TIMER_BUILD_POLYMESH,g.RC_TIMER_MERGE_POLYMESH=s.Module.RC_TIMER_MERGE_POLYMESH,g.RC_TIMER_ERODE_AREA=s.Module.RC_TIMER_ERODE_AREA,g.RC_TIMER_MARK_BOX_AREA=s.Module.RC_TIMER_MARK_BOX_AREA,g.RC_TIMER_MARK_CYLINDER_AREA=s.Module.RC_TIMER_MARK_CYLINDER_AREA,g.RC_TIMER_MARK_CONVEXPOLY_AREA=s.Module.RC_TIMER_MARK_CONVEXPOLY_AREA,g.RC_TIMER_BUILD_DISTANCEFIELD=s.Module.RC_TIMER_BUILD_DISTANCEFIELD,g.RC_TIMER_BUILD_DISTANCEFIELD_DIST=s.Module.RC_TIMER_BUILD_DISTANCEFIELD_DIST,g.RC_TIMER_BUILD_DISTANCEFIELD_BLUR=s.Module.RC_TIMER_BUILD_DISTANCEFIELD_BLUR,g.RC_TIMER_BUILD_REGIONS=s.Module.RC_TIMER_BUILD_REGIONS,g.RC_TIMER_BUILD_REGIONS_WATERSHED=s.Module.RC_TIMER_BUILD_REGIONS_WATERSHED,g.RC_TIMER_BUILD_REGIONS_EXPAND=s.Module.RC_TIMER_BUILD_REGIONS_EXPAND,g.RC_TIMER_BUILD_REGIONS_FLOOD=s.Module.RC_TIMER_BUILD_REGIONS_FLOOD,g.RC_TIMER_BUILD_REGIONS_FILTER=s.Module.RC_TIMER_BUILD_REGIONS_FILTER,g.RC_TIMER_BUILD_LAYERS=s.Module.RC_TIMER_BUILD_LAYERS,g.RC_TIMER_BUILD_POLYMESHDETAIL=s.Module.RC_TIMER_BUILD_POLYMESHDETAIL,g.RC_TIMER_MERGE_POLYMESHDETAIL=s.Module.RC_TIMER_MERGE_POLYMESHDETAIL,g.RC_MAX_TIMERS=s.Module.RC_MAX_TIMERS,f.DT_FAILURE=s.Detour.FAILURE,f.DT_SUCCESS=s.Detour.SUCCESS,f.DT_IN_PROGRESS=s.Detour.IN_PROGRESS,f.DT_STATUS_DETAIL_MASK=s.Detour.STATUS_DETAIL_MASK,f.DT_WRONG_MAGIC=s.Detour.WRONG_MAGIC,f.DT_WRONG_VERSION=s.Detour.WRONG_VERSION,f.DT_OUT_OF_MEMORY=s.Detour.OUT_OF_MEMORY,f.DT_INVALID_PARAM=s.Detour.INVALID_PARAM,f.DT_BUFFER_TOO_SMALL=s.Detour.BUFFER_TOO_SMALL,f.DT_OUT_OF_NODES=s.Detour.OUT_OF_NODES,f.DT_PARTIAL_RESULT=s.Detour.PARTIAL_RESULT,f.DT_ALREADY_OCCUPIED=s.Detour.ALREADY_OCCUPIED,f.DT_VERTS_PER_POLYGON=s.Detour.VERTS_PER_POLYGON,f.DT_NAVMESH_MAGIC=s.Detour.NAVMESH_MAGIC,f.DT_NAVMESH_VERSION=s.Detour.NAVMESH_VERSION,f.DT_NAVMESH_STATE_MAGIC=s.Detour.NAVMESH_STATE_MAGIC,f.DT_NAVMESH_STATE_VERSION=s.Detour.NAVMESH_STATE_VERSION,f.DT_TILECACHE_MAGIC=s.Detour.TILECACHE_MAGIC,f.DT_TILECACHE_VERSION=s.Detour.TILECACHE_VERSION,f.DT_TILECACHE_NULL_AREA=s.Detour.TILECACHE_NULL_AREA,f.DT_TILECACHE_WALKABLE_AREA=s.Detour.TILECACHE_WALKABLE_AREA,f.DT_TILECACHE_NULL_IDX=s.Detour.TILECACHE_NULL_IDX,f.DT_NULL_LINK=s.Detour.NULL_LINK,f.DT_NULL_LINK=s.Detour.NULL_LINK,f.DT_EXT_LINK=s.Detour.EXT_LINK,f.DT_OFFMESH_CON_BIDIR=s.Detour.OFFMESH_CON_BIDIR,f.DT_STRAIGHTPATH_START=s.Module.DT_STRAIGHTPATH_START,f.DT_STRAIGHTPATH_END=s.Module.DT_STRAIGHTPATH_END,f.DT_STRAIGHTPATH_OFFMESH_CONNECTION=s.Module.DT_STRAIGHTPATH_OFFMESH_CONNECTION,f.DT_STRAIGHTPATH_AREA_CROSSINGS=s.Module.DT_STRAIGHTPATH_AREA_CROSSINGS,f.DT_STRAIGHTPATH_ALL_CROSSINGS=s.Module.DT_STRAIGHTPATH_ALL_CROSSINGS,f.DT_FINDPATH_ANY_ANGLE=s.Module.DT_FINDPATH_ANY_ANGLE,f.DT_RAYCAST_USE_COSTS=s.Module.DT_RAYCAST_USE_COSTS,f.DT_CROWDAGENT_STATE_INVALID=s.Module.DT_CROWDAGENT_STATE_INVALID,f.DT_CROWDAGENT_STATE_WALKING=s.Module.DT_CROWDAGENT_STATE_WALKING,f.DT_CROWDAGENT_STATE_OFFMESH=s.Module.DT_CROWDAGENT_STATE_OFFMESH,f.DT_CROWDAGENT_TARGET_NONE=s.Module.DT_CROWDAGENT_TARGET_NONE,f.DT_CROWDAGENT_TARGET_FAILED=s.Module.DT_CROWDAGENT_TARGET_FAILED,f.DT_CROWDAGENT_TARGET_VALID=s.Module.DT_CROWDAGENT_TARGET_VALID,f.DT_CROWDAGENT_TARGET_REQUESTING=s.Module.DT_CROWDAGENT_TARGET_REQUESTING,f.DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE=s.Module.DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE,f.DT_CROWDAGENT_TARGET_WAITING_FOR_PATH=s.Module.DT_CROWDAGENT_TARGET_WAITING_FOR_PATH,f.DT_CROWDAGENT_TARGET_VELOCITY=s.Module.DT_CROWDAGENT_TARGET_VELOCITY,f.DT_COMPRESSEDTILE_FREE_DATA=s.Module.DT_COMPRESSEDTILE_FREE_DATA,f.DT_TILE_FREE_DATA=s.Module.DT_TILE_FREE_DATA}};class K{get size(){return this.raw.size}constructor(e){this.raw=e}get(e){return this.raw.get(e)}set(e,t){this.raw.set(e,t)}resize(e){this.raw.resize(e)}copy(e){this.raw.resize(e.length),this.getHeapView().set(e)}destroy(){s.destroy(this.raw)}getHeapView(){const e=this.getHeap();return new this.ArrayConstructor(e.buffer,this.raw.getDataPointer(),this.size)}toTypedArray(){const e=this.getHeapView(),t=new this.ArrayConstructor(new ArrayBuffer(this.size*e.BYTES_PER_ELEMENT),0,this.size);return t.set(e),t}}class W extends K{ArrayConstructor=Int32Array;constructor(e){super(e??new s.Module.IntArray)}getHeap(){return s.Module.HEAP32}static fromRaw(e){return new W(e)}}class z extends K{ArrayConstructor=Uint32Array;constructor(e){super(e??new s.Module.UnsignedIntArray)}getHeap(){return s.Module.HEAPU32}static fromRaw(e){return new z(e)}}class Y extends K{ArrayConstructor=Uint8Array;constructor(e){super(e??new s.Module.UnsignedCharArray)}getHeap(){return s.Module.HEAPU8}static fromRaw(e){return new Y(e)}}class k extends K{ArrayConstructor=Float32Array;constructor(e){super(e??new s.Module.FloatArray)}getHeap(){return s.Module.HEAPF32}static fromRaw(e){return new k(e)}}const ue=k,he=W,Z=Y,je=W,m={toRaw:({x:a,y:e,z:t},r)=>r?(r.x=a,r.y=e,r.z=t,r):new s.Module.Vec3(a,e,t),fromRaw:a=>{const{x:e,y:t,z:r}=a;return{x:e,y:t,z:r}},fromArray:([a,e,t])=>({x:a,y:e,z:t}),toArray:({x:a,y:e,z:t})=>[a,e,t],lerp:(a,e,t,r={x:0,y:0,z:0})=>{r.x=a.x+(e.x-a.x)*t,r.y=a.y+(e.y-a.y)*t,r.z=a.z+(e.z-a.z)*t},copy:(a,e={x:0,y:0,z:0})=>{e.x=a.x,e.y=a.y,e.z=a.z}},v=(a,e)=>{const t=[];for(let r=0;r<e;r++)t.push(a(r));return t},L=a=>s.Detour.statusSucceed(a),Ze=a=>s.Detour.statusFailed(a),Je=a=>{if(s.Detour.statusSucceed(a))return"success";if(s.Detour.statusInProgress(a))return"in progress";if(s.Detour.statusFailed(a)){let e;const t={DT_WRONG_MAGIC:f.DT_WRONG_MAGIC,DT_WRONG_VERSION:f.DT_WRONG_VERSION,DT_OUT_OF_MEMORY:f.DT_OUT_OF_MEMORY,DT_INVALID_PARAM:f.DT_INVALID_PARAM,DT_BUFFER_TOO_SMALL:f.DT_BUFFER_TOO_SMALL,DT_OUT_OF_NODES:f.DT_OUT_OF_NODES,DT_PARTIAL_RESULT:f.DT_PARTIAL_RESULT,DT_ALREADY_OCCUPIED:f.DT_ALREADY_OCCUPIED};for(const[r,i]of Object.entries(t))if(s.Detour.statusDetail(a,i)){e=r;break}return e?`failed - ${e}`:"failed - unknown"}return"unknown"};class et{constructor(e){this.raw=e}vertBase(){return this.raw.vertBase}triBase(){return this.raw.triBase}vertCount(){return this.raw.vertCount}triCount(){return this.raw.triCount}}class tt{constructor(e){this.raw=e}ref(){return this.raw.ref}next(){return this.raw.next}edge(){return this.raw.edge}side(){return this.raw.side}bmin(){return this.raw.bmin}bmax(){return this.raw.bmax}}class rt{constructor(e){this.raw=e}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}i(){return this.raw.i}}class ce{constructor(e){this.raw=e}pos(e){return this.raw.get_pos(e)}rad(){return this.raw.rad}poly(){return this.raw.poly}flags(){return this.raw.flags}side(){return this.raw.side}userId(){return this.raw.userId}}class st{constructor(e){this.raw=e}magic(){return this.raw.magic}version(){return this.raw.version}x(){return this.raw.x}y(){return this.raw.y}layer(){return this.raw.layer}userId(){return this.raw.userId}polyCount(){return this.raw.polyCount}vertCount(){return this.raw.vertCount}maxLinkCount(){return this.raw.maxLinkCount}detailMeshCount(){return this.raw.detailMeshCount}detailVertCount(){return this.raw.detailVertCount}detailTriCount(){return this.raw.detailTriCount}bvNodeCount(){return this.raw.bvNodeCount}offMeshConCount(){return this.raw.offMeshConCount}offMeshBase(){return this.raw.offMeshBase}walkableHeight(){return this.raw.walkableHeight}walkableRadius(){return this.raw.walkableRadius}walkableClimb(){return this.raw.walkableClimb}bmin(e){return this.raw.get_bmin(e)}bmax(e){return this.raw.get_bmax(e)}bvQuantFactor(){return this.raw.bvQuantFactor}}class J{constructor(e){this.raw=e}firstLink(){return this.raw.firstLink}verts(e){return this.raw.get_verts(e)}neis(e){return this.raw.get_neis(e)}flags(){return this.raw.flags}vertCount(){return this.raw.vertCount}areaAndType(){return this.raw.get_areaAndtype()}getType(){return this.raw.getType()}}class B{constructor(e){this.raw=e}salt(){return this.raw.salt}linksFreeList(){return this.raw.linksFreeList}header(){return s.isNull(this.raw.header)?null:new st(this.raw.header)}polys(e){return new J(this.raw.get_polys(e))}verts(e){return this.raw.get_verts(e)}links(e){return new tt(this.raw.get_links(e))}detailMeshes(e){return new et(this.raw.get_detailMeshes(e))}detailVerts(e){return this.raw.get_detailVerts(e)}detailTris(e){return this.raw.get_detailTris(e)}bvTree(e){return new rt(this.raw.get_bvTree(e))}offMeshCons(e){return new ce(this.raw.get_offMeshCons(e))}data(e){return this.raw.get_data(e)}dataSize(){return this.raw.dataSize}flags(){return this.raw.flags}next(){return new B(this.raw.next)}}const de=a=>{const e=s.DetourNavMeshBuilder.createNavMeshData(a.raw);return{success:e.success,navMeshData:Y.fromRaw(e.navMeshData)}};class we{constructor(e){this.raw=e??new s.Module.dtNavMeshCreateParams}setPolyMeshCreateParams(e){s.DetourNavMeshBuilder.setPolyMeshCreateParams(this.raw,e.raw)}setPolyMeshDetailCreateParams(e){s.DetourNavMeshBuilder.setPolyMeshDetailCreateParams(this.raw,e.raw)}setOffMeshConnections(e){if(e.length<=0)return;const t=[],r=[],i=[],o=[],l=[],n=[];for(let u=0;u<e.length;u++){const d=e[u];t.push(d.startPosition.x,d.startPosition.y,d.startPosition.z),t.push(d.endPosition.x,d.endPosition.y,d.endPosition.z),r.push(d.radius),i.push(d.bidirectional?1:0),o.push(d.area??0),l.push(d.flags??1),n.push(d.userId??1e3+u)}s.DetourNavMeshBuilder.setOffMeshConnections(this.raw,e.length,t,r,i,o,l,n)}verts(e){return this.raw.get_verts(e)}setVerts(e,t){this.raw.set_verts(e,t)}vertCount(){return this.raw.vertCount}polys(e){return this.raw.get_polys(e)}setPolys(e,t){this.raw.set_polys(e,t)}polyAreas(e){return this.raw.get_polyAreas(e)}setPolyAreas(e,t){this.raw.set_polyAreas(e,t)}polyFlags(e){return this.raw.get_polyFlags(e)}setPolyFlags(e,t){this.raw.set_polyFlags(e,t)}polyCount(){return this.raw.polyCount}nvp(){return this.raw.nvp}setNvp(e){this.raw.nvp=e}detailMeshes(e){return this.raw.get_detailMeshes(e)}setDetailMeshes(e,t){this.raw.set_detailMeshes(e,t)}detailVerts(e){return this.raw.get_detailVerts(e)}setDetailVerts(e,t){this.raw.set_detailVerts(e,t)}detailVertsCount(){return this.raw.detailVertsCount}detailTris(e){return this.raw.get_detailTris(e)}setDetailTris(e,t){this.raw.set_detailTris(e,t)}detailTriCount(){return this.raw.detailTriCount}offMeshConVerts(e){return this.raw.get_offMeshConVerts(e)}offMeshConRad(e){return this.raw.get_offMeshConRad(e)}offMeshConDir(e){return this.raw.get_offMeshConDir(e)}offMeshConAreas(e){return this.raw.get_offMeshConAreas(e)}offMeshConFlags(e){return this.raw.get_offMeshConFlags(e)}offMeshConUserID(e){return this.raw.get_offMeshConUserID(e)}offMeshConCount(){return this.raw.offMeshConCount}userId(){return this.raw.userId}tileX(){return this.raw.tileX}setTileX(e){this.raw.tileX=e}tileY(){return this.raw.tileY}setTileY(e){this.raw.tileY=e}tileLayer(){return this.raw.tileLayer}setTileLayer(e){this.raw.tileLayer=e}boundsMin(){return v(e=>this.raw.get_bmin(e),3)}setBoundsMin(e){this.raw.set_bmin(0,e[0]),this.raw.set_bmin(1,e[1]),this.raw.set_bmin(2,e[2])}boundsMax(){return v(e=>this.raw.get_bmax(e),3)}setBoundsMax(e){this.raw.set_bmax(0,e[0]),this.raw.set_bmax(1,e[1]),this.raw.set_bmax(2,e[2])}walkableHeight(){return this.raw.walkableHeight}setWalkableHeight(e){this.raw.walkableHeight=e}walkableRadius(){return this.raw.walkableRadius}setWalkableRadius(e){this.raw.walkableRadius=e}walkableClimb(){return this.raw.walkableClimb}setWalkableClimb(e){this.raw.walkableClimb=e}cellSize(){return this.raw.cs}setCellSize(e){this.raw.cs=e}cellHeight(){return this.raw.ch}setCellHeight(e){this.raw.ch=e}buildBvTree(){return this.raw.buildBvTree}setBuildBvTree(e){this.raw.buildBvTree=e}}class ge{get includeFlags(){return this.raw.getIncludeFlags()}set includeFlags(e){this.raw.setIncludeFlags(e)}get excludeFlags(){return this.raw.getExcludeFlags()}set excludeFlags(e){this.raw.setExcludeFlags(e)}constructor(e){this.raw=e??new s.Module.dtQueryFilter}getAreaCost(e){return this.raw.getAreaCost(e)}setAreaCost(e,t){this.raw.setAreaCost(e,t)}}class ee{defaultQueryHalfExtents={x:1,y:1,z:1};constructor(e,t){e instanceof s.Module.NavMeshQuery?this.raw=e:(this.raw=new s.Module.NavMeshQuery,this.raw.init(e.raw,t?.maxNodes??2048)),t?.defaultQueryFilter?this.defaultFilter=t.defaultQueryFilter:(this.defaultFilter=new ge,this.defaultFilter.includeFlags=65535,this.defaultFilter.excludeFlags=0)}findNearestPoly(e,t){const r=new s.UnsignedIntRef,i=new s.Vec3,o=new s.BoolRef,l=this.raw.findNearestPoly(m.toArray(e),m.toArray(t?.halfExtents??this.defaultQueryHalfExtents),t?.filter?.raw??this.defaultFilter.raw,r,i,o),n=m.fromRaw(i);s.destroy(i);const u=r.value;s.destroy(r);const d=o.value;return s.destroy(o),{success:L(l),status:l,nearestRef:u,nearestPoint:n,isOverPoly:d}}findPolysAroundCircle(e,t,r,i){const o=i?.filter??this.defaultFilter,l=i?.maxPolys??256,n=new z,u=new z,d=new k;n.resize(l),u.resize(l),d.resize(l);const _=new s.IntRef,h=this.raw.findPolysAroundCircle(e,m.toArray(t),r,o.raw,n.raw,u.raw,d.raw,_,l),y=[...n.getHeapView()];n.destroy();const M=[...u.getHeapView()];u.destroy();const p=[...d.getHeapView()];d.destroy();const C=_.value;return s.destroy(_),{success:L(h),status:h,resultRefs:y,resultParents:M,resultCost:p,resultCount:C}}queryPolygons(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.maxPolys??256,l=new z;l.resize(o);const n=new s.IntRef,u=this.raw.queryPolygons(m.toArray(e),m.toArray(t),i.raw,l.raw,n,o),d=n.value;s.destroy(n);const _=[...l.getHeapView()].slice(0,d);return l.destroy(),{success:L(u),status:u,polyRefs:_}}closestPointOnPoly(e,t){const r=new s.Vec3,i=new s.BoolRef,o=this.raw.closestPointOnPoly(e,m.toArray(t),r,i),l=m.fromRaw(r);s.destroy(r);const n=i.value;return s.destroy(i),{success:L(o),status:o,closestPoint:l,isPointOverPoly:n}}findClosestPoint(e,t){const r=t?.filter??this.defaultFilter,i=t?.halfExtents??this.defaultQueryHalfExtents,o=new s.UnsignedIntRef,l=new s.Vec3,n=new s.BoolRef,u=this.raw.findClosestPoint(m.toArray(e),m.toArray(i),r.raw,o,l,n),d=o.value;s.destroy(o);const _=m.fromRaw(l);s.destroy(l);const h=n.value;return s.destroy(n),{success:L(u),status:u,polyRef:d,point:_,isPointOverPoly:h}}findRandomPointAroundCircle(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.halfExtents??this.defaultQueryHalfExtents;let l;if(r?.startRef)l=r.startRef;else{const y=this.findNearestPoly(e,{filter:i,halfExtents:o});if(!y.success)return{success:!1,status:y.status,randomPolyRef:0,randomPoint:{x:0,y:0,z:0}};l=y.nearestRef}const n=new s.UnsignedIntRef,u=new s.Vec3,d=this.raw.findRandomPointAroundCircle(l,m.toArray(e),t,i.raw,n,u),_=n.value;s.destroy(n);const h=m.fromRaw(u);return s.destroy(u),{success:L(d),status:d,randomPolyRef:_,randomPoint:h}}moveAlongSurface(e,t,r,i){const o=i?.maxVisitedSize??256,l=new s.Vec3,n=new z,u=i?.filter?.raw??this.defaultFilter.raw,d=this.raw.moveAlongSurface(e,m.toArray(t),m.toArray(r),u,l,n.raw,o),_=m.fromRaw(l);s.destroy(l);const h=[...n.getHeapView()];return n.destroy(),{success:L(d),status:d,resultPosition:_,visited:h}}findRandomPoint(e){const t=new s.UnsignedIntRef,r=new s.Vec3,i=this.raw.findRandomPoint(e?.filter?.raw??this.defaultFilter.raw,t,r),o=t.value;s.destroy(t);const l=m.fromRaw(r);return s.destroy(r),{success:L(i),status:i,randomPolyRef:o,randomPoint:l}}getPolyHeight(e,t){const r=new s.FloatRef,i=this.raw.getPolyHeight(e,m.toArray(t),r),o=r.value;return s.destroy(r),{success:L(i),status:i,height:o}}computePath(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.halfExtents??this.defaultQueryHalfExtents,l=this.findNearestPoly(e,{filter:i,halfExtents:o});if(!l.success)return{success:!1,error:{name:"findNearestPoly for start position failed",status:l.status},path:[]};const n=this.findNearestPoly(t,{filter:i,halfExtents:o});if(!n.success)return{success:!1,error:{name:"findNearestPoly for end position failed",status:n.status},path:[]};const u=l.nearestRef,d=n.nearestRef,_=r?.maxPathPolys??256,h=this.findPath(u,d,e,t,{filter:i,maxPathPolys:_});if(!h.success)return{success:!1,error:{name:"findPath unsuccessful",status:h.status},path:[]};if(h.polys.size<=0)return{success:!1,error:{name:"no polygon path found"},path:[]};const y=h.polys.get(h.polys.size-1);let M={x:t.x,y:t.y,z:t.z};if(y!==d){const A=this.closestPointOnPoly(y,t);if(!A.success)return{success:!1,error:{name:"no closest point on last polygon found",status:A.status},path:[]};M=A.closestPoint}const p=r?.maxStraightPathPoints,C=this.findStraightPath(e,M,h.polys,{maxStraightPathPoints:p});if(!C.success)return{success:!1,error:{name:"findStraightPath unsuccessful",status:C.status},path:[]};const{straightPath:I,straightPathCount:w}=C,P=[];for(let A=0;A<w;A++)P.push({x:I.get(A*3),y:I.get(A*3+1),z:I.get(A*3+2)});return h.polys.destroy(),C.straightPath.destroy(),C.straightPathFlags.destroy(),C.straightPathRefs.destroy(),{success:!0,path:P}}findPath(e,t,r,i,o){const l=o?.filter??this.defaultFilter,n=o?.maxPathPolys??256,u=new z;u.resize(n);const d=this.raw.findPath(e,t,m.toArray(r),m.toArray(i),l.raw,u.raw,n);return{success:L(d),status:d,polys:u}}findStraightPath(e,t,r,i){const o=i?.maxStraightPathPoints??256,l=i?.straightPathOptions??0;let n;Array.isArray(r)?(n=new z,n.copy(r)):n=r;const u=new k;u.resize(o*3);const d=new Y;d.resize(o);const _=new z;_.resize(o);const h=new s.IntRef,y=this.raw.findStraightPath(m.toArray(e),m.toArray(t),n.raw,u.raw,d.raw,_.raw,h,o,l),M=h.value;return s.destroy(h),Array.isArray(r)&&n.destroy(),{success:L(y),status:y,straightPath:u,straightPathFlags:d,straightPathRefs:_,straightPathCount:M}}raycast(e,t,r,i){const o=new s.Module.dtRaycastHit,l=i?.raycastOptions??0,n=i?.prevRef??0,u=i?.filter?.raw??this.defaultFilter.raw,d=this.raw.raycast(e,m.toArray(t),m.toArray(r),u,l,o,n),_={success:L(d),status:d,t:o.t,hitNormal:m.fromArray(v(h=>o.get_hitNormal(h),3)),hitEdgeIndex:o.hitEdgeIndex,path:v(h=>o.get_path(h),o.pathCount),maxPath:o.maxPath,pathCost:o.pathCost};return s.destroy(o),_}destroy(){this.raw.destroy()}}const _e={radius:.5,height:1,maxAcceleration:20,maxSpeed:6,collisionQueryRange:2.5,pathOptimizationRange:0,separationWeight:0,updateFlags:7,obstacleAvoidanceType:0,queryFilterType:0,userData:0};class at{get radius(){return this.raw.params.radius}set radius(e){this.raw.params.radius=e}get height(){return this.raw.params.height}set height(e){this.raw.params.height=e}get maxAcceleration(){return this.raw.params.maxAcceleration}set maxAcceleration(e){this.raw.params.maxAcceleration=e}get maxSpeed(){return this.raw.params.maxSpeed}set maxSpeed(e){this.raw.params.maxSpeed=e}get collisionQueryRange(){return this.raw.params.collisionQueryRange}set collisionQueryRange(e){this.raw.params.collisionQueryRange=e}get pathOptimizationRange(){return this.raw.params.pathOptimizationRange}set pathOptimizationRange(e){this.raw.params.pathOptimizationRange=e}get separationWeight(){return this.raw.params.separationWeight}set separationWeight(e){this.raw.params.separationWeight=e}get updateFlags(){return this.raw.params.updateFlags}set updateFlags(e){this.raw.params.updateFlags=e}get obstacleAvoidanceType(){return this.raw.params.obstacleAvoidanceType}set obstacleAvoidanceType(e){this.raw.params.obstacleAvoidanceType=e}get queryFilterType(){return this.raw.params.queryFilterType}set queryFilterType(e){this.raw.params.queryFilterType=e}get userData(){return this.raw.params.userData}set userData(e){this.raw.params.userData=e}interpolatedPosition={x:0,y:0,z:0};constructor(e,t){this.crowd=e,this.agentIndex=t,this.raw=e.raw.getEditableAgent(t),this.interpolatedPosition=this.position()}requestMoveTarget(e){const{nearestPoint:t,nearestRef:r}=this.crowd.navMeshQuery.findNearestPoly(e,{halfExtents:this.crowd.navMeshQuery.defaultQueryHalfExtents,filter:this.crowd.navMeshQuery.defaultFilter});return this.crowd.raw.requestMoveTarget(this.agentIndex,r,m.toArray(t))}requestMoveVelocity(e){return this.crowd.raw.requestMoveVelocity(this.agentIndex,m.toArray(e))}resetMoveTarget(){this.crowd.raw.resetMoveTarget(this.agentIndex)}teleport(e){s.CrowdUtils.agentTeleport(this.crowd.raw,this.agentIndex,m.toArray(e),m.toArray(this.crowd.navMeshQuery.defaultQueryHalfExtents),this.crowd.navMeshQuery.defaultFilter.raw),m.copy(e,this.interpolatedPosition)}position(){return{x:this.raw.get_npos(0),y:this.raw.get_npos(1),z:this.raw.get_npos(2)}}velocity(){return{x:this.raw.get_vel(0),y:this.raw.get_vel(1),z:this.raw.get_vel(2)}}desiredVelocity(){return{x:this.raw.get_dvel(0),y:this.raw.get_dvel(1),z:this.raw.get_dvel(2)}}desiredVelocityObstacleAdjusted(){return{x:this.raw.get_nvel(0),y:this.raw.get_nvel(1),z:this.raw.get_nvel(2)}}state(){return this.raw.state}target(){return{x:this.raw.get_targetPos(0),y:this.raw.get_targetPos(1),z:this.raw.get_targetPos(2)}}nextTargetInPath(){return{x:this.raw.get_cornerVerts(0),y:this.raw.get_cornerVerts(1),z:this.raw.get_cornerVerts(2)}}corners(){const e=[];for(let t=0;t<this.raw.ncorners;t++)e.push({x:this.raw.get_cornerVerts(t*3),y:this.raw.get_cornerVerts(t*3+1),z:this.raw.get_cornerVerts(t*3+2)});return e}parameters(){const{params:e}=this.raw;return{radius:e.radius,height:e.height,maxAcceleration:e.maxAcceleration,maxSpeed:e.maxSpeed,collisionQueryRange:e.collisionQueryRange,pathOptimizationRange:e.pathOptimizationRange,separationWeight:e.separationWeight,updateFlags:e.updateFlags,obstacleAvoidanceType:e.obstacleAvoidanceType,queryFilterType:e.queryFilterType,userData:e.userData}}updateParameters(e){const t={...this.parameters(),...e};this.setParameters(t)}setParameters(e){const t={..._e,...e},r=new s.Module.dtCrowdAgentParams;r.radius=t.radius,r.height=t.height,r.maxAcceleration=t.maxAcceleration,r.maxSpeed=t.maxSpeed,r.collisionQueryRange=t.collisionQueryRange,r.pathOptimizationRange=t.pathOptimizationRange,r.separationWeight=t.separationWeight,r.updateFlags=t.updateFlags,r.obstacleAvoidanceType=t.obstacleAvoidanceType,r.queryFilterType=t.queryFilterType,r.userData=t.userData,this.crowd.raw.updateAgentParameters(this.agentIndex,r)}overOffMeshConnection(){return s.CrowdUtils.overOffMeshConnection(this.crowd.raw,this.agentIndex)}}class it{agents={};accumulator=0;constructor(e,{maxAgents:t,maxAgentRadius:r}){this.navMesh=e,this.raw=s.Detour.allocCrowd(),this.raw.init(t,r,e.raw.getNavMesh()),this.navMeshQuery=new ee(new s.Module.NavMeshQuery(this.raw.getNavMeshQuery()))}update(e,t,r=10){if(t===void 0)this.raw.update(e,void 0);else{this.accumulator+=t;let i=0;for(;this.accumulator>=e&&i<r;)this.raw.update(e,void 0),this.accumulator-=e,i++;const o=this.accumulator%e/e,l=this.getAgents();for(const n of l)m.lerp(n.interpolatedPosition,n.position(),o,n.interpolatedPosition)}}addAgent(e,t){const r={..._e,...t},i=new s.Module.dtCrowdAgentParams;i.radius=r.radius,i.height=r.height,i.maxAcceleration=r.maxAcceleration,i.maxSpeed=r.maxSpeed,i.collisionQueryRange=r.collisionQueryRange,i.pathOptimizationRange=r.pathOptimizationRange,i.separationWeight=r.separationWeight,i.updateFlags=r.updateFlags,i.obstacleAvoidanceType=r.obstacleAvoidanceType,i.queryFilterType=r.queryFilterType,i.userData=r.userData;const o=this.raw.addAgent(m.toArray(e),i),l=new at(this,o);return this.agents[o]=l,l}getAgent(e){const t=this.agents[e];return t||null}removeAgent(e){const t=typeof e=="number"?e:e.agentIndex;this.raw.removeAgent(t),delete this.agents[t]}getAgentCount(){return this.raw.getAgentCount()}getActiveAgentCount(){return s.CrowdUtils.getActiveAgentCount(this.raw)}getAgents(){return Object.values(this.agents)}getFilter(e){return new ge(this.raw.getEditableFilter(e))}destroy(){s.Detour.freeCrowd(this.raw)}}class nt{constructor(e){this.raw=e}tiles(e){return new B(this.raw.get_tiles(e))}tileCount(){return this.raw.tileCount}}class ot{constructor(e){this.raw=e}data(){return v(e=>this.raw.get_data(e),this.raw.dataSize)}dataSize(){return this.raw.dataSize}}class lt{constructor(e){this.raw=e}tileX(){return this.raw.tileX}tileY(){return this.raw.tileY}}class ut{constructor(e){this.raw=e}data(){return v(e=>this.raw.get_data(e),this.raw.dataSize)}dataSize(){return this.raw.dataSize}}class Q{constructor(e){this.raw=e}static create(e){const t=new s.Module.dtNavMeshParams;return t.set_orig(0,e.orig.x),t.set_orig(1,e.orig.y),t.set_orig(2,e.orig.z),t.tileWidth=e.tileWidth,t.tileHeight=e.tileHeight,t.maxTiles=e.maxTiles,t.maxPolys=e.maxPolys,new Q(t)}clone(){return Q.create({orig:{x:this.raw.get_orig(0),y:this.raw.get_orig(1),z:this.raw.get_orig(2)},tileWidth:this.raw.tileWidth,tileHeight:this.raw.tileHeight,maxTiles:this.raw.maxTiles,maxPolys:this.raw.maxPolys})}}class te{constructor(e){this.raw=e??new s.Module.NavMesh}initSolo(e){return this.raw.initSolo(e.raw)}initTiled(e){return this.raw.initTiled(e.raw)}addTile(e,t,r){const i=new s.UnsignedIntRef,o=this.raw.addTile(e.raw,t,r,i),l=i.value;return s.destroy(i),{status:o,tileRef:l}}decodePolyId(e){const t=new s.UnsignedIntRef,r=new s.UnsignedIntRef,i=new s.UnsignedIntRef;this.raw.decodePolyId(e,t,r,i);const o=t.value;s.destroy(t);const l=r.value;s.destroy(r);const n=i.value;return s.destroy(i),{tileSalt:o,tileIndex:l,tilePolygonIndex:n}}encodePolyId(e,t,r){return this.raw.encodePolyId(e,t,r)}removeTile(e){return new ot(this.raw.removeTile(e))}calcTileLoc(e){return new lt(this.raw.calcTileLoc(m.toArray(e)))}getTileAt(e,t,r){const i=this.raw.getTileAt(e,t,r);return s.isNull(i)?null:new B(i)}getTilesAt(e,t,r){return new nt(this.raw.getTilesAt(e,t,r))}getTileRefAt(e,t,r){return this.raw.getTileRefAt(e,t,r)}getTileRef(e){return this.raw.getTileRef(e.raw)}getTileByRef(e){const t=this.raw.getTileByRef(e);return s.isNull(t)?null:new B(t)}getMaxTiles(){return this.raw.getMaxTiles()}getTile(e){return new B(this.raw.getTile(e))}getTileAndPolyByRef(e){const t=this.raw.getTileAndPolyByRef(e),r=new B(t.tile),i=new J(t.poly);return{success:L(t.status),status:t.status,tile:r,poly:i}}getTileAndPolyByRefUnsafe(e){const t=this.raw.getTileAndPolyByRef(e),r=new B(t.tile),i=new J(t.poly);return{tile:r,poly:i}}isValidPolyRef(e){return this.raw.isValidPolyRef(e)}getPolyRefBase(e){return this.raw.getPolyRefBase(e.raw)}getOffMeshConnectionPolyEndPoints(e,t){const r=new s.Vec3,i=new s.Vec3,o=this.raw.getOffMeshConnectionPolyEndPoints(e,t,r,i),l=m.fromRaw(r);s.destroy(r);const n=m.fromRaw(i);return s.destroy(i),{success:L(o),status:o,start:l,end:n}}getOffMeshConnectionByRef(e){return new ce(this.raw.getOffMeshConnectionByRef(e))}setPolyFlags(e,t){return this.raw.setPolyFlags(e,t)}getPolyFlags(e){const t=new s.UnsignedShortRef,r=this.raw.getPolyFlags(e,t),i=t.value;return s.destroy(t),{status:r,flags:i}}setPolyArea(e,t){return this.raw.setPolyArea(e,t)}getPolyArea(e){const t=new s.UnsignedCharRef,r=this.raw.getPolyArea(e,t),i=t.value;return s.destroy(t),{status:r,area:i}}getTileStateSize(e){return this.raw.getTileStateSize(e.raw)}storeTileState(e,t){return new ut(this.raw.storeTileState(e.raw,t))}restoreTileState(e,t,r){return this.raw.restoreTileState(e.raw,t,r)}destroy(){this.raw.destroy(),s.Module.destroy(this.raw)}}const ht=(a,e)=>{const t=[],r=[];let i=0;const o=a.getMaxTiles();for(let l=0;l<o;l++){const n=a.getTile(l),u=n.header();if(!u)continue;const d=u.polyCount();for(let _=0;_<d;++_){const h=n.polys(_);if(h.getType()===1)continue;const y=h.vertCount(),M=n.detailMeshes(_),p=M.triBase(),C=M.triCount();for(let I=0;I<C;++I){const w=(p+I)*4;for(let P=0;P<3;++P){if(n.detailTris(w+P)<y){const A=h.verts(n.detailTris(w+P))*3;t.push(n.verts(A),n.verts(A+1),n.verts(A+2))}else{const A=(M.vertBase()+n.detailTris(w+P)-h.vertCount())*3;t.push(n.detailVerts(A),n.detailVerts(A+1),n.detailVerts(A+2))}r.push(i++)}}}}return[t,r]},re={borderSize:0,tileSize:0,cs:.2,ch:.2,walkableSlopeAngle:60,walkableHeight:2,walkableClimb:2,walkableRadius:.5,maxEdgeLen:12,maxSimplificationError:1.3,minRegionArea:8,mergeRegionArea:20,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1},fe=a=>{const e={...re,...a},t=new s.Module.rcConfig;return t.borderSize=e.borderSize,t.tileSize=e.tileSize,t.cs=e.cs,t.ch=e.ch,t.walkableSlopeAngle=e.walkableSlopeAngle,t.walkableHeight=e.walkableHeight,t.walkableClimb=e.walkableClimb,t.walkableRadius=e.walkableRadius,t.maxEdgeLen=e.maxEdgeLen,t.maxSimplificationError=e.maxSimplificationError,t.minRegionArea=e.minRegionArea,t.mergeRegionArea=e.mergeRegionArea,t.maxVertsPerPoly=e.maxVertsPerPoly,t.detailSampleDist=e.detailSampleDist,t.detailSampleMaxError=e.detailSampleMaxError,t},ct=a=>{const e=new s.Module.rcConfig;return e.set_bmin(0,a.get_bmin(0)),e.set_bmin(1,a.get_bmin(1)),e.set_bmin(2,a.get_bmin(2)),e.set_bmax(0,a.get_bmax(0)),e.set_bmax(1,a.get_bmax(1)),e.set_bmax(2,a.get_bmax(2)),e.width=a.width,e.height=a.height,e.borderSize=a.borderSize,e.tileSize=a.tileSize,e.cs=a.cs,e.ch=a.ch,e.walkableSlopeAngle=a.walkableSlopeAngle,e.walkableHeight=a.walkableHeight,e.walkableClimb=a.walkableClimb,e.walkableRadius=a.walkableRadius,e.maxEdgeLen=a.maxEdgeLen,e.maxSimplificationError=a.maxSimplificationError,e.minRegionArea=a.minRegionArea,e.mergeRegionArea=a.mergeRegionArea,e.maxVertsPerPoly=a.maxVertsPerPoly,e.detailSampleDist=a.detailSampleDist,e.detailSampleMaxError=a.detailSampleMaxError,e};class se{logs=[];startTimes={};accumulatedTimes={};constructor(e=!0){const t=new s.Module.RecastBuildContextJsImpl;t.log=(r,i,o)=>{if(!this.raw.logEnabled())return;const l=i,n=new Uint8Array(s.Module.HEAPU8.buffer,l,o),u=new Uint8Array(o);u.set(n);const d=new TextDecoder().decode(u);this.log(r,d)},t.resetLog=()=>{this.resetLog()},t.startTimer=r=>{this.raw.timerEnabled()&&this.startTimer(r)},t.stopTimer=r=>{this.raw.timerEnabled()&&this.stopTimer(r)},t.getAccumulatedTime=r=>this.raw.timerEnabled()?this.getAccumulatedTime(r):-1,t.resetTimers=()=>{this.raw.timerEnabled()&&(this.startTimes={},this.accumulatedTimes={})},this.raw=new s.Module.RecastBuildContext(t),this.raw.enableTimer(e),this.raw.enableLog(e),this.resetTimers()}log(e,t){this.logs.push({category:e,msg:t})}resetLog(){this.logs=[]}startTimer(e){this.startTimes[e]=performance.now()}stopTimer(e){const r=performance.now()-this.startTimes[e];this.accumulatedTimes[e]===-1?this.accumulatedTimes[e]=r:this.accumulatedTimes[e]+=r}getAccumulatedTime(e){return this.accumulatedTimes[e]}resetTimers(){for(let e=0;e<g.RC_MAX_TIMERS;e++)this.startTimes[e]=-1,this.accumulatedTimes[e]=-1}}class dt{constructor(e){this.raw=e??new s.rcChunkyTriMesh}init(e,t,r,i){return s.ChunkyTriMeshUtils.createChunkyTriMesh(e.raw,t.raw,r,i,this.raw)}getChunksOverlappingRect(e,t,r,i){return s.ChunkyTriMeshUtils.getChunksOverlappingRect(this.raw,e,t,r.raw,i)}getNodeTris(e){return W.fromRaw(s.ChunkyTriMeshUtils.getChunkyTriMeshNodeTris(this.raw,e))}nodes(e){return this.raw.get_nodes(e)}maxTrisPerChunk(){return this.raw.maxTrisPerChunk}}class V{constructor(e){this.raw=e}smin(){return this.raw.smin}smax(){return this.raw.smax}area(){return this.raw.area}next(){return s.isNull(this.raw.next)?null:new V(this.raw.next)}}class ae{constructor(e){this.raw=e}next(){return s.isNull(this.raw.next)?null:new ae(this.raw.next)}items(e){return new V(this.raw.get_items(e))}}class wt{constructor(e){this.raw=e}width(){return this.raw.width}height(){return this.raw.height}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}spans(e){return new V(this.raw.get_spans(e))}pools(e){return new ae(this.raw.get_pools(e))}freelist(e){return new V(this.raw.get_freelist(e))}}class gt{constructor(e){this.raw=e}index(){return this.raw.get_index()}count(){return this.raw.get_count()}}class _t{constructor(e){this.raw=e}y(){return this.raw.get_y()}reg(){return this.raw.get_reg()}con(){return this.raw.get_con()}h(){return this.raw.get_h()}}class ft{constructor(e){this.raw=e}width(){return this.raw.width}height(){return this.raw.height}spanCount(){return this.raw.spanCount}walkableHeight(){return this.raw.walkableHeight}walkableClimb(){return this.raw.walkableClimb}borderSize(){return this.raw.borderSize}maxDistance(){return this.raw.maxDistance}maxRegions(){return this.raw.maxRegions}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}cells(e){return new gt(this.raw.get_cells(e))}spans(e){return new _t(this.raw.get_spans(e))}dist(e){return this.raw.get_dist(e)}areas(e){return this.raw.get_areas(e)}}class Rt{constructor(e){this.raw=e}verts(e){return this.raw.get_verts(e)}nverts(){return this.raw.nverts}rverts(e){return this.raw.get_rverts(e)}nrverts(){return this.raw.nrverts}reg(){return this.raw.reg}area(){return this.raw.area}}class Tt{constructor(e){this.raw=e}conts(e){return new Rt(this.raw.get_conts(e))}nconts(){return this.raw.nconts}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}width(){return this.raw.width}height(){return this.raw.height}borderSize(){return this.raw.borderSize}maxError(){return this.raw.maxError}}class mt{constructor(e){this.raw=e}verts(e){return this.raw.get_verts(e)}polys(e){return this.raw.get_polys(e)}regs(e){return this.raw.get_regs(e)}flags(e){return this.raw.get_flags(e)}setFlags(e,t){this.raw.set_flags(e,t)}areas(e){return this.raw.get_areas(e)}setAreas(e,t){this.raw.set_areas(e,t)}nverts(){return this.raw.nverts}npolys(){return this.raw.npolys}maxpolys(){return this.raw.maxpolys}nvp(){return this.raw.nvp}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}borderSize(){return this.raw.borderSize}maxEdgeError(){return this.raw.maxEdgeError}}class yt{constructor(e){this.raw=e}meshes(e){return this.raw.get_meshes(e)}verts(e){return this.raw.get_verts(e)}tris(e){return this.raw.get_tris(e)}nmeshes(){return this.raw.nmeshes}nverts(){return this.raw.nverts}ntris(){return this.raw.ntris}}const Re=(a,e,t)=>s.Recast.calcGridSize(a,e,t),Te=(a,e,t,r,i,o,l,n)=>s.Recast.createHeightfield(a.raw,e.raw,t,r,i,o,l,n),me=(a,e,t,r,i,o,l)=>s.Recast.markWalkableTriangles(a.raw,e,t.raw,r,i.raw,o,l.raw),ye=(a,e,t,r,i,o,l,n=1)=>s.Recast.rasterizeTriangles(a.raw,e.raw,t,r.raw,i.raw,o,l.raw,n),Ae=(a,e,t)=>s.Recast.filterLowHangingWalkableObstacles(a.raw,e,t.raw),Me=(a,e,t,r)=>s.Recast.filterLedgeSpans(a.raw,e,t,r.raw),Ee=(a,e,t)=>s.Recast.filterWalkableLowHeightSpans(a.raw,e,t.raw),pe=(a,e,t,r,i)=>s.Recast.buildCompactHeightfield(a.raw,e,t,r.raw,i.raw),Ce=(a,e,t)=>s.Recast.erodeWalkableArea(a.raw,e,t.raw),Se=(a,e)=>s.Recast.buildDistanceField(a.raw,e.raw),Ie=(a,e,t,r,i)=>s.Recast.buildRegions(a.raw,e.raw,t,r,i),De=(a,e,t,r,i,o=g.RC_CONTOUR_TESS_WALL_EDGES)=>s.Recast.buildContours(a.raw,e.raw,t,r,i.raw,o),be=(a,e,t,r)=>s.Recast.buildPolyMesh(a.raw,e.raw,t,r.raw),Pe=(a,e,t,r,i,o)=>s.Recast.buildPolyMeshDetail(a.raw,e.raw,t.raw,r,i,o.raw),xe=()=>new wt(s.Recast.allocHeightfield()),X=a=>s.Recast.freeHeightfield(a.raw),ve=()=>new ft(s.Recast.allocCompactHeightfield()),$=a=>s.Recast.freeCompactHeightfield(a.raw),Ne=()=>new Tt(s.Recast.allocContourSet()),q=a=>s.Recast.freeContourSet(a.raw),Oe=()=>new mt(s.Recast.allocPolyMesh()),Le=a=>s.Recast.freePolyMesh(a.raw),Fe=()=>new yt(s.Recast.allocPolyMeshDetail()),He=a=>s.Recast.freePolyMeshDetail(a.raw),At=(a,e)=>{const t=s.NavMeshExporter.exportNavMesh(a.raw,e?.raw),r=new Uint8Array(s.Module.HEAPU8.buffer,t.dataPointer,t.size),i=new Uint8Array(t.size);return i.set(r),s.NavMeshExporter.freeNavMeshExport(t),i},Mt=a=>At(a),Et=a=>{const e=a.length*a.BYTES_PER_ELEMENT,t=s.Module._malloc(e),r=new Uint8Array(s.Module.HEAPU8.buffer,t,e);r.set(a);const i=new s.Module.NavMeshExport;return i.dataPointer=r.byteOffset,i.size=a.length,{navMeshExport:i,dataHeap:r}},pt=a=>{const{navMeshExport:e,dataHeap:t}=Et(a),r=s.NavMeshImporter.importNavMesh(e,void 0);return s.Module._free(t.byteOffset),{navMesh:new te(r.navMesh)}},ze=(a,e)=>{const t={x:1/0,y:1/0,z:1/0},r={x:-1/0,y:-1/0,z:-1/0};for(let i=0;i<e.length;i++){const o=e[i],l=a[o*3],n=a[o*3+1],u=a[o*3+2];t.x=Math.min(t.x,l),t.y=Math.min(t.y,n),t.z=Math.min(t.z,u),r.x=Math.max(r.x,l),r.y=Math.max(r.y,n),r.z=Math.max(r.z,u)}return{bbMin:m.toArray(t),bbMax:m.toArray(r)}},Ct=a=>{let e=0,t=0;return e=+(a>65535)<<4,a>>=e,t=+(a>255)<<3,a>>=t,e|=t,t=+(a>15)<<2,a>>=t,e|=t,t=+(a>3)<<1,a>>=t,e|=t,e|=a>>1,e},St=a=>(a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a),It={...re,buildBvTree:!0},Dt=(a,e,t={},r=!1)=>{const i=new se,o={type:"solo",buildContext:i},l=()=>{r||(o.heightfield&&(X(o.heightfield),o.heightfield=void 0),o.compactHeightfield&&($(o.compactHeightfield),o.compactHeightfield=void 0),o.contourSet&&(q(o.contourSet),o.contourSet=void 0),o.polyMesh&&(Le(o.polyMesh),o.polyMesh=void 0),o.polyMeshDetail&&(He(o.polyMeshDetail),o.polyMeshDetail=void 0))},n=T=>(l(),{navMeshData:void 0,success:!1,intermediates:o,error:T}),u=a,d=e.length,_=new ue;_.copy(u);const h=e,y=e.length/3,M=new he;M.copy(h);let p,C;if(t.bounds)p=t.bounds[0],C=t.bounds[1];else{const T=ze(a,e);p=T.bbMin,C=T.bbMax}const I={...It,...t},w=fe(I);w.minRegionArea=w.minRegionArea*w.minRegionArea,w.mergeRegionArea=w.mergeRegionArea*w.mergeRegionArea,w.detailSampleDist=w.detailSampleDist<.9?0:w.cs*w.detailSampleDist,w.detailSampleMaxError=w.ch*w.detailSampleMaxError;const P=Re(p,C,w.cs);w.width=P.width,w.height=P.height;const A=xe();if(o.heightfield=A,!Te(i,A,w.width,w.height,p,C,w.cs,w.ch))return n("Could not create heightfield");const E=new Z;if(E.resize(y),me(i,w.walkableSlopeAngle,_,d,M,y,E),!ye(i,_,d,M,E,y,A,w.walkableClimb))return n("Could not rasterize triangles");E.destroy(),_.destroy(),M.destroy(),Ae(i,w.walkableClimb,A),Me(i,w.walkableHeight,w.walkableClimb,A),Ee(i,w.walkableHeight,A);const D=ve();if(o.compactHeightfield=D,!pe(i,w.walkableHeight,w.walkableClimb,A,D))return n("Failed to build compact data");if(r||(X(A),o.heightfield=void 0),!Ce(i,w.walkableRadius,D))return n("Failed to erode walkable area");if(!Se(i,D))return n("Failed to build distance field");if(!Ie(i,D,w.borderSize,w.minRegionArea,w.mergeRegionArea))return n("Failed to build regions");const b=Ne();if(o.contourSet=b,!De(i,D,w.maxSimplificationError,w.maxEdgeLen,b,g.RC_CONTOUR_TESS_WALL_EDGES))return n("Failed to create contours");const S=Oe();if(o.polyMesh=S,!be(i,b,w.maxVertsPerPoly,S))return n("Failed to triangulate contours");const N=Fe();if(o.polyMeshDetail=N,!Pe(i,S,D,w.detailSampleDist,w.detailSampleMaxError,N))return n("Failed to build detail mesh");r||($(D),o.compactHeightfield=void 0,q(b),o.contourSet=void 0);for(let T=0;T<S.npolys();T++)S.areas(T)===g.RC_WALKABLE_AREA&&S.setAreas(T,0),S.areas(T)===0&&S.setFlags(T,1);const c=new we;c.setPolyMeshCreateParams(S),c.setPolyMeshDetailCreateParams(N),c.setWalkableHeight(w.walkableHeight*w.ch),c.setWalkableRadius(w.walkableRadius*w.cs),c.setWalkableClimb(w.walkableClimb*w.ch),c.setCellSize(w.cs),c.setCellHeight(w.ch),c.setBuildBvTree(I.buildBvTree),t.offMeshConnections&&c.setOffMeshConnections(t.offMeshConnections);const R=de(c);return R.success?(l(),{navMeshData:R.navMeshData,success:!0,intermediates:o}):n("Failed to create Detour navmesh data")},bt=(a,e,t={},r=!1)=>{if(!s.Module)throw new Error('"init" must be called before using any recast-navigation-js APIs. See: https://github.com/isaac-mason/recast-navigation-js?tab=readme-ov-file#initialization');const i=Dt(a,e,t,r);if(!i.success)return{navMesh:void 0,success:!1,intermediates:i.intermediates,error:i.error};const{navMeshData:o}=i,l=new te;return l.initSolo(o)?{success:!0,navMesh:l,intermediates:i.intermediates}:(o.destroy(),{navMesh:void 0,success:!1,intermediates:i.intermediates,error:"Failed to initialize solo NavMesh"})},Pt=({recastConfig:a,navMeshBounds:[e,t]})=>{const r=fe(a),i=Re(e,t,r.cs);r.width=i.width,r.height=i.height,r.minRegionArea=r.minRegionArea*r.minRegionArea,r.mergeRegionArea=r.mergeRegionArea*r.mergeRegionArea,r.tileSize=Math.floor(r.tileSize),r.borderSize=r.walkableRadius+3,r.width=r.tileSize+r.borderSize*2,r.height=r.tileSize+r.borderSize*2,r.detailSampleDist=r.detailSampleDist<.9?0:r.cs*r.detailSampleDist,r.detailSampleMaxError=r.ch*r.detailSampleMaxError;const o=Math.floor(r.tileSize),l=Math.floor((i.width+o-1)/o),n=Math.floor((i.height+o-1)/o),u=r.tileSize*r.cs,d=m.fromArray(e);let _=Math.min(Math.floor(Ct(St(l*n))),14);_>14&&(_=14);const h=22-_,y=1<<_,M=1<<h;return{config:r,gridSize:i,tileSize:o,tileWidth:l,tileHeight:n,tcs:u,orig:d,maxTiles:y,maxPolysPerTile:M}},Be={...re,chunkyTriMeshTrisPerChunk:256,buildBvTree:!0},xt=(a,e,t,r,i,o={},l=!1,n=new se)=>{const u={x:i.x,y:i.y},d=()=>{l||(u.compactHeightfield&&($(u.compactHeightfield),u.compactHeightfield=void 0),u.heightfield&&(X(u.heightfield),u.heightfield=void 0),u.contourSet&&(q(u.contourSet),u.contourSet=void 0),u.polyMesh&&(Le(u.polyMesh),u.polyMesh=void 0),u.polyMeshDetail&&(He(u.polyMeshDetail),u.polyMeshDetail=void 0))},_=T=>(n.log(g.RC_LOG_ERROR,T),d(),{success:!1,error:T,intermediates:u}),h=ct(t),y=[...i.bmin],M=[...i.bmax];y[0]-=h.borderSize*h.cs,y[2]-=h.borderSize*h.cs,M[0]+=h.borderSize*h.cs,M[2]+=h.borderSize*h.cs,h.set_bmin(0,y[0]),h.set_bmin(1,y[1]),h.set_bmin(2,y[2]),h.set_bmax(0,M[0]),h.set_bmax(1,M[1]),h.set_bmax(2,M[2]),n.resetTimers(),n.startTimer(g.RC_TIMER_TOTAL),n.log(g.RC_LOG_PROGRESS,`Building tile at x: ${i.x}, y: ${i.y}`),n.log(g.RC_LOG_PROGRESS,` - ${h.width} x ${h.height} cells`),n.log(g.RC_LOG_PROGRESS,` - ${a.size/3/1e3}K verts, ${e.size/3/1e3}K tris`);const p=xe();if(u.heightfield=p,!Te(n,p,h.width,h.height,y,M,h.cs,h.ch))return _("Could not create heightfield");new Z().resize(r.maxTrisPerChunk());const I=[y[0],y[2]],w=[M[0],M[2]],P=512,A=new je;A.resize(P);const E=r.getChunksOverlappingRect(I,w,A,P);if(E===0)return{success:!0,intermediates:u};for(let T=0;T<E;++T){const x=A.get(T),H=r.nodes(x).n,U=r.getNodeTris(x),F=new Z;F.resize(H),me(n,h.walkableSlopeAngle,a,e.size,U,H,F);const G=ye(n,a,e.size,U,F,H,p,h.walkableClimb);if(F.destroy(),!G)return _("Could not rasterize triangles")}Ae(n,h.walkableClimb,p),Me(n,h.walkableHeight,h.walkableClimb,p),Ee(n,h.walkableHeight,p);const D=ve();if(u.compactHeightfield=D,!pe(n,h.walkableHeight,h.walkableClimb,p,D))return _("Could not build compact heightfield");if(l||(X(u.heightfield),u.heightfield=void 0),!Ce(n,h.walkableRadius,D))return _("Could not erode walkable area");if(!Se(n,D))return _("Failed to build distance field");if(!Ie(n,D,h.borderSize,h.minRegionArea,h.mergeRegionArea))return _("Failed to build regions");const b=Ne();if(u.contourSet=b,!De(n,D,h.maxSimplificationError,h.maxEdgeLen,b,g.RC_CONTOUR_TESS_WALL_EDGES))return _("Failed to create contours");const S=Oe();if(u.polyMesh=S,!be(n,b,h.maxVertsPerPoly,S))return _("Failed to triangulate contours");const N=Fe();if(u.polyMeshDetail=N,!Pe(n,S,D,h.detailSampleDist,h.detailSampleMaxError,N))return _("Failed to build detail mesh");l||($(D),u.compactHeightfield=void 0,q(b),u.contourSet=void 0);for(let T=0;T<S.npolys();T++)S.areas(T)===g.RC_WALKABLE_AREA&&S.setAreas(T,0),S.areas(T)===0&&S.setFlags(T,1);const c=new we;c.setPolyMeshCreateParams(S),c.setPolyMeshDetailCreateParams(N),c.setWalkableHeight(h.walkableHeight*h.ch),c.setWalkableRadius(h.walkableRadius*h.cs),c.setWalkableClimb(h.walkableClimb*h.ch),c.setCellSize(h.cs),c.setCellHeight(h.ch),c.setBuildBvTree(o.buildBvTree??Be.buildBvTree),o.offMeshConnections&&c.setOffMeshConnections(o.offMeshConnections),c.setTileX(i.x),c.setTileY(i.y);const R=de(c);return R.success?(n.log(g.RC_LOG_PROGRESS,`>> Polymesh: ${S.nverts()} vertices ${S.npolys()} polygons`),{success:!0,data:R.navMeshData,intermediates:u}):_("Failed to create Detour navmesh data")},vt=(a,e,t={},r=!1)=>{if(!s.Module)throw new Error('"init" must be called before using any recast-navigation-js APIs. See: https://github.com/isaac-mason/recast-navigation-js?tab=readme-ov-file#initialization');const i=new se,o={type:"tiled",buildContext:i,chunkyTriMesh:void 0,tileIntermediates:[]},l=new te,n=a,u=new ue;u.copy(n);const d=e,_=e.length/3,h=new he;h.copy(d);const y=()=>{u.destroy(),h.destroy(),!r&&o.chunkyTriMesh&&(o.chunkyTriMesh=void 0)},M=x=>(y(),l.destroy(),{success:!1,navMesh:void 0,intermediates:o,error:x}),p={...Be,...t};let C,I;if(t.bounds)C=t.bounds[0],I=t.bounds[1];else{const x=ze(a,e);C=x.bbMin,I=x.bbMax}const{config:w,tileWidth:P,tileHeight:A,tcs:E,orig:D,maxTiles:b,maxPolysPerTile:S}=Pt({recastConfig:p,navMeshBounds:[C,I]}),N=Q.create({orig:D,tileWidth:p.tileSize*p.cs,tileHeight:p.tileSize*p.cs,maxTiles:b,maxPolys:S});if(!l.initTiled(N))return M("Could not init nav mesh for tiled use");const c=new dt;if(o.chunkyTriMesh=c,!c.init(u,h,_,p.chunkyTriMeshTrisPerChunk))return M("Failed to build chunky triangle mesh");i.startTimer(g.RC_TIMER_TEMP);const R=[0,0,0],T=[0,0,0];for(let x=0;x<A;x++)for(let O=0;O<P;O++){R[0]=C[0]+O*E,R[1]=C[1],R[2]=C[2]+x*E,T[0]=C[0]+(O+1)*E,T[1]=I[1],T[2]=C[2]+(x+1)*E;const H={x:O,y:x,bmin:R,bmax:T},U={offMeshConnections:p.offMeshConnections,buildBvTree:p.buildBvTree},F=xt(u,h,w,c,H,U,r,i);if(o.tileIntermediates.push(F.intermediates),F.success&&F.data){l.removeTile(l.getTileRefAt(O,x,0));const G=l.addTile(F.data,f.DT_TILE_FREE_DATA,0);Ze(G.status)&&(i.log(g.RC_LOG_WARNING,`Failed to add tile to nav mesh tx: ${O}, ty: ${x}, status: ${Je(G.status)} (${G.status})`),F.data.destroy())}}return i.stopTimer(g.RC_TIMER_TEMP),r||y(),{success:!0,navMesh:l,intermediates:o}},Nt=a=>{const e=[],t=[],r={};let i=0;for(const{positions:o,indices:l}of a)for(let n=0;n<l.length;n++){const u=l[n]*3,d=o[u],_=o[u+1],h=o[u+2],y=`${d}_${_}_${h}`;let M=r[y];M||(r[y]=M=i,e.push(d,_,h),i++),t.push(M)}return[Float32Array.from(e),Uint32Array.from(t)]};new Qe;class Ot extends ke{constructor(e,t){super(),this.navMesh=e,this.navMeshGeometry=new Ve,this.navMeshMaterial=t?.navMeshMaterial?t.navMeshMaterial:new We({color:"orange",transparent:!0,opacity:.7,depthWrite:!1}),this.update(),this.mesh=new j(this.navMeshGeometry,this.navMeshMaterial),this.add(this.mesh)}update(){const[e,t]=ht(this.navMesh);this.navMeshGeometry.setAttribute("position",new ie(Float32Array.from(e),3)),this.navMeshGeometry.setIndex(new ie(Uint32Array.from(t),1)),this.navMeshGeometry.computeVertexNormals()}}const Lt=new Ye,Ue=a=>{const e=[];for(const t of a){const r=t.geometry.attributes.position;if(!r||r.itemSize!==3)continue;t.updateMatrixWorld();const i=new Float32Array(r.array);for(let l=0;l<i.length;l+=3){const n=Lt.set(i[l],i[l+1],i[l+2]);t.localToWorld(n),i[l]=n.x,i[l+1]=n.y,i[l+2]=n.z}let o=t.geometry.getIndex()?.array;if(o===void 0){const l=[];for(let n=0;n<r.count;n++)l.push(n);o=l}e.push({positions:i,indices:o})}return Nt(e)},Ft=(a,e={},t=!1)=>{const[r,i]=Ue(a);return bt(r,i,e,t)},Ht=(a,e={},t=!1)=>{const[r,i]=Ue(a);return vt(r,i,e,t)},zt=["invalid","walking","offmesh"];let oe=!1;async function ir(){oe||(await Ke(),oe=!0)}function Bt(a){const e=a.getIndex();if(e===null){const t=a.getAttribute("position").clone();for(let r=0;r+2<t.count;r+=3)for(let i=0;i<t.itemSize;i+=1){const o=t.getComponent(r+1,i);t.setComponent(r+1,i,t.getComponent(r+2,i)),t.setComponent(r+2,i,o)}a.setAttribute("position",t);return}for(let t=0;t+2<e.count;t+=3){const r=e.getX(t+1);e.setX(t+1,e.getX(t+2)),e.setX(t+2,r)}e.needsUpdate=!0}function Ut(a){const e=a.getAttribute("position"),t=a.getIndex(),r=l=>t?.getX(l)??l;let i=0;const o=t?.count??e.count;for(let l=0;l+2<o;l+=3){const n=r(l),u=r(l+1),d=r(l+2),_=e.getX(u)-e.getX(n),h=e.getZ(u)-e.getZ(n),y=e.getX(d)-e.getX(n),M=e.getZ(d)-e.getZ(n);i+=h*y-_*M}return i}function Gt(a){const e=[],t=(l,n)=>{if(n.determinant()<0){const d=l.clone().applyMatrix4(n);return Ut(d)<0&&Bt(d),e.push(d),new j(d)}const u=new j(l);return u.matrixAutoUpdate=!1,u.matrix.copy(n),u.matrixWorldNeedsUpdate=!0,u},r=[],i=new ne,o=new ne;for(const l of a){if(l.updateWorldMatrix(!0,!1),l instanceof Xe){for(let n=0;n<l.count;n+=1)l.getMatrixAt(n,i),o.multiplyMatrices(l.matrixWorld,i),r.push(t(l.geometry,o));continue}r.push(l.matrixWorld.determinant()>=0?l:t(l.geometry,l.matrixWorld))}return{meshes:r,temporaryGeometries:e}}const kt=1297302868,Vt=1,Wt=1145979222,Yt=7;function Qt(a){let e=1;for(;e<a;)e*=2;return e}function Xt(a,e){const t=a.vertices.length,r=a.polygons.length;if(t===0||r===0)throw new Error("NavMeshManager.buildFromPolygons: vertices and polygons must be non-empty");if(t>65535)throw new Error(`NavMeshManager.buildFromPolygons: ${t} vertices exceed Detour's uint16 tile index`);if(a.detailMeshes.length!==r)throw new Error(`NavMeshManager.buildFromPolygons: ${r} polygons require the same number of detail rows`);const i=a.polygons.map(c=>c.vertices.map(()=>0)),o=new Map;let l=0;for(let c=0;c<r;c+=1){const R=a.polygons[c];if(R.vertices.length<3||R.vertices.length>6)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${c} has ${R.vertices.length} vertices; Detour permits 3..6`);l+=R.vertices.length;for(let T=0;T<R.vertices.length;T+=1){const x=R.vertices[T],O=R.vertices[(T+1)%R.vertices.length];if(!Number.isInteger(x)||!Number.isInteger(O)||x<0||O<0||x>=t||O>=t)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${c} references an invalid vertex`);const H=`${x},${O}`;if(o.has(H))throw new Error(`NavMeshManager.buildFromPolygons: directed edge ${H} occurs more than once`);const U=o.get(`${O},${x}`);if(U===void 0)o.set(H,[c,T]);else{const[F,G]=U;i[c][T]=F+1,i[F][G]=c+1}}}for(let c=0;c<r;c+=1){const R=a.detailMeshes[c];if(R.vertexBase<0||R.vertexCount<0||R.vertexBase+R.vertexCount>a.detailVertices.length||R.triangleBase<0||R.triangleCount<0||R.triangleBase+R.triangleCount>a.detailTriangles.length||R.vertexCount>255||R.triangleCount>255)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${c} has an invalid detail row`)}for(const c of a.detailTriangles)if(c.some(R=>!Number.isInteger(R)||R<0||R>255))throw new Error("NavMeshManager.buildFromPolygons: detail triangles must contain uint8 values");const n=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],u=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const c of[...a.vertices,...a.detailVertices])for(let R=0;R<3;R+=1){const T=c[R];if(!Number.isFinite(T))throw new Error("NavMeshManager.buildFromPolygons: every vertex component must be finite");n[R]=Math.min(n[R],T),u[R]=Math.max(u[R],T)}const d=100,_=32,h=12,p=d+t*12+r*_+l*h+r*12+a.detailVertices.length*12+a.detailTriangles.length*4,C=new Uint8Array(48+p),I=new DataView(C.buffer);let w=0;const P=c=>{I.setUint8(w,c),w+=1},A=c=>{I.setUint16(w,c,!0),w+=2},E=c=>{I.setUint32(w,c,!0),w+=4},D=c=>{I.setInt32(w,c,!0),w+=4},b=c=>{I.setFloat32(w,c,!0),w+=4},S=Qt(r);E(kt),E(Vt),E(1);for(const c of n)b(c);b(Math.max(u[0]-n[0],Number.EPSILON)),b(Math.max(u[2]-n[2],Number.EPSILON)),E(1),E(S),E(S),E(p),E(Wt),E(Yt),D(0),D(0),D(0),E(0),E(r),E(t),E(l),E(r),E(a.detailVertices.length),E(a.detailTriangles.length),E(0),E(0),E(r);const N=le.navigation;b(e?.walkableHeight??N.walkableHeight),b(e?.walkableRadius??N.walkableRadius),b(e?.walkableClimb??N.walkableClimb);for(const c of n)b(c);for(const c of u)b(c);b(1/(e?.cellSize??N.cellSize));for(const c of a.vertices)for(const R of c)b(R);for(let c=0;c<r;c+=1){const R=a.polygons[c];E(4294967295);for(let T=0;T<6;T+=1)A(R.vertices[T]??0);for(let T=0;T<6;T+=1)A(i[c]?.[T]??0);A(R.flags??1),P(R.vertices.length),P((R.area??0)&63)}w+=l*h;for(const c of a.detailMeshes)E(c.vertexBase),E(c.triangleBase),P(c.vertexCount),P(c.triangleCount),A(0);for(const c of a.detailVertices)for(const R of c)b(R);for(const c of a.detailTriangles)for(const R of c)P(R);if(w!==C.length)throw new Error(`NavMeshManager.buildFromPolygons: encoded ${w} bytes into a ${C.length}-byte allocation`);return C}class nr{navMesh=null;query=null;crowd=null;helper=null;buildFromMeshes(e,t){const r=le.navigation,i=Gt(e),o=i.meshes.reduce((u,d)=>{const _=d.geometry.getIndex(),h=d.geometry.getAttribute("position").count;return u+Math.floor((_?.count??h)/3)},0),l={cs:t?.cellSize??r.cellSize,ch:t?.cellHeight??r.cellHeight,walkableSlopeAngle:t?.walkableSlopeAngle??r.walkableSlopeAngle,walkableHeight:t?.walkableHeight??r.walkableHeight,walkableClimb:t?.walkableClimb??r.walkableClimb,walkableRadius:t?.walkableRadius??r.walkableRadius,maxEdgeLen:t?.maxEdgeLen??r.maxEdgeLen,maxSimplificationError:t?.maxSimplificationError??r.maxSimplificationError,minRegionArea:t?.minRegionArea??r.minRegionArea,mergeRegionArea:t?.mergeRegionArea??r.mergeRegionArea,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1};let n;try{n=t?.tiled===!0||i.meshes.length>256||o>1e4?Ht(i.meshes,{...l,tileSize:t?.tileSize??256}):Ft(i.meshes,l)}finally{for(const u of i.temporaryGeometries)u.dispose()}return!n.success||!n.navMesh?!1:(this.destroyRecast(),this.navMesh=n.navMesh,this.query=new ee(this.navMesh),!0)}buildFromPolygons(e,t){try{return this.loadFromData(Xt(e,t)),!0}catch{return!1}}destroyRecast(){this.helper&&(this.helper.parent?.remove(this.helper),this.helper.dispose?.(),this.helper=null),this.crowd&&(this.crowd.destroy(),this.crowd=null),this.query&&(this.query.destroy(),this.query=null),this.navMesh&&(this.navMesh.destroy(),this.navMesh=null)}hasNavMesh(){return this.navMesh!==null}findPath(e,t){if(!this.query)throw new Error("NavMeshManager.findPath: no navmesh has been built, so no path can be queried. Build one first (buildFromMeshes/importNavMesh) — gate on hasNavMesh() if the caller can run before a bake.");const r=this.query.computePath(e,t);if(!r.success&&r.error)throw new Error(`NavMeshManager.findPath: recast could not complete the query (${r.error.name}${r.error.status===void 0?"":`, status ${r.error.status}`}).`);return r.path}createCrowd(e){if(!this.navMesh)throw new Error("Build navmesh first");return this.crowd=new it(this.navMesh,{maxAgents:e,maxAgentRadius:.6}),this.crowd}updateCrowd(e){this.crowd?.update(e)}getCrowdAgents(){return this.crowd?this.crowd.getAgents().map(e=>{const t=e.interpolatedPosition,r=e.velocity(),i=e.target(),o=zt[e.state()]??"invalid",l=o==="invalid"?[]:e.corners().map(n=>({x:n.x,y:n.y,z:n.z}));return{position:{x:t.x,y:t.y,z:t.z},velocity:{x:r.x,y:r.y,z:r.z},radius:e.radius,height:e.height,state:o,target:{x:i.x,y:i.y,z:i.z},corners:l}}):[]}getDebugMesh(e){return this.navMesh?(this.helper||(this.helper=new Ot(this.navMesh),e.add(this.helper)),this.helper):null}exportData(){if(!this.navMesh)throw new Error("No navmesh to export");return Mt(this.navMesh)}loadFromData(e){const{navMesh:t}=pt(e);this.destroyRecast(),this.navMesh=t,this.query=new ee(this.navMesh)}dispose(e){this.helper&&e.remove(this.helper),this.destroyRecast()}}export{nr as NavMeshManager,ir as initNavigation};
@@ -0,0 +1 @@
1
+ const s="editor:bake-navmesh",i="editor:clear-navmesh";function r(){window.dispatchEvent(new CustomEvent(s))}function u(){window.dispatchEvent(new CustomEvent(i))}let e=!1,t=!1;const o=new Set;function n(){for(const a of[...o])a()}function f(){return e}function c(){e||(e=!0,n())}function d(){e&&(e=!1,n())}function v(){return t}function l(){t=!0,n()}function E(a){t=!1,a===null&&(e=!0),n()}export{s as N,u as a,f as b,i as c,r as d,l as e,E as f,c as m,v as n,d as r};
@@ -0,0 +1 @@
1
+ import{ad as e}from"./index-GIL7oGEO.js";import{d as s,a as i,n as a,b as t}from"./navmesh-workflow-store-Cmnm57TB.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"./three.module-D396a9Mn.js";const k="workspace.menu",u={menu:"debug",items:[{id:"navmesh-bake",label:()=>t()?"Rebake NavMesh":"Bake NavMesh",testId:"navmesh-bake",disabled:()=>a()||!e().navigation?.bake,execute:s},{id:"navmesh-clear",label:"Clear NavMesh",testId:"navmesh-clear",disabled:()=>a()||!t()||!e().navigation?.clear,execute:i}]};export{u as menu,k as point};
@@ -0,0 +1 @@
1
+ import{q as e,ad as d}from"./index-GIL7oGEO.js";import{getUserData as E}from"./user-data-BB2Of6Ht.js";import{N as k,c as M,e as B,f as i,m as A,r as u,n as H}from"./navmesh-workflow-store-Cmnm57TB.js";import{z as T,w as $}from"./three.module-D396a9Mn.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"./object-marks-DwvIEBOK.js";function j(){let c=null;const g=new T({color:3900150,transparent:!0,opacity:.5,depthWrite:!1});function p(a){a.traverse(n=>{n.isMesh&&(n.material=g)})}function h(a){const n=new Set;for(const[r,o]of e().hierarchy.objects())E(o,"navRole")===a&&n.add(r);return n}function l(){e().viewport.setHelper("navmesh",null)}function f(){const a=d().navigation??null;if(a!==c&&(c=a,l()),!a){u();return}let n=!1;try{n=a.hasNavMesh()}catch(s){e().console.error(`Navigation adapter failed to report its state: ${s}`,"navigation")}if(!n){u();return}A();const r=e().viewport.rig()?.scene;if(!r)return;let o=null;try{o=a.debugMesh(r)}catch(s){e().console.error(`Navigation adapter failed to create its debug mesh: ${s}`,"navigation")}o&&(p(o),e().viewport.setHelper("navmesh",o))}const m=async()=>{if(H())return;B(),await new Promise(t=>requestAnimationFrame(()=>t(null)));const a=d().navigation;if(!a){const t="The mounted game has no NavigationAdapter";e().console.warn(`${t} — nothing can be baked`,"navigation"),i(t);return}if(!a.bake){const t="The mounted NavigationAdapter is inspect-only and does not support baking";e().console.warn(t,"navigation"),i(t);return}const n=h("walkable");if(n.size===0){e().console.warn('No walkable entities found — tag meshes as "walkable" in the Navigation section',"navigation"),i("No walkable-tagged entities in the scene");return}const r=[];for(const t of[...n,...h("obstacle")]){const w=e().hierarchy.objects().get(t);w&&w.traverse(N=>{N.isMesh&&r.push(N)})}if(r.length===0){e().console.error("NavMesh bake failed: the walkable-tagged entities have no meshes","navigation"),i("Walkable entities have no meshes");return}let o=!1;try{o=a.bake(r)}catch(t){e().console.error(`NavMesh bake failed: ${t}`,"navigation"),i(`Bake failed: ${t}`);return}if(!o){e().console.error("NavMesh bake failed","navigation"),i("Bake failed (recast rejected the input geometry)");return}c=a;const s=e().viewport.rig()?.scene,v=s?a.debugMesh(s):null;v&&(p(v),e().viewport.setHelper("navmesh",v)),i(null)},b=()=>{const a=d().navigation;if(!a){e().console.warn("The mounted game has no NavigationAdapter to clear","navigation");return}if(!a.clear){e().console.warn("The mounted NavigationAdapter is inspect-only and does not support clearing","navigation");return}try{a.clear(e().viewport.rig()?.scene??new $)}catch(n){e().console.error(`NavMesh clear failed: ${n}`,"navigation");return}l(),u()};window.addEventListener(k,m),window.addEventListener(M,b);const y=e().systems.subscribe(f);return f(),()=>{window.removeEventListener(k,m),window.removeEventListener(M,b),y(),l(),g.dispose()}}const F="workspace.service";function K(){return j()}export{F as point,K as start};
@@ -0,0 +1 @@
1
+ import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{q as I,dR as g,ao as s,dP as a,a4 as N,bo as M,b5 as w,e6 as F}from"./index-GIL7oGEO.js";import{r as p}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"./three.module-D396a9Mn.js";function T(t){return t?{connectionState:t.getConnectionState?.(),roomInfo:t.getRoomInfo?.(),stats:t.getReplicationStats?.()}:null}function q(t){return t?{stateTree:typeof t.getStateSnapshot=="function",messageLog:typeof t.messageEvents=="function",rates:typeof t.getRates=="function",conditioning:typeof t.getConditioning=="function"&&typeof t.setConditioning=="function",connection:typeof t.getConnectionState=="function",room:typeof t.getRoomInfo=="function",stats:typeof t.getReplicationStats=="function",identity:typeof t.getPlayerIdentity=="function",identitySettable:typeof t.setPlayerIdentity=="function"}:null}class P{constructor(n=500){this.capacity=n}entries=[];lastSeq=0;paused=!1;pull(n){if(this.paused||!n?.messageEvents)return 0;const i=n.messageEvents(this.lastSeq);if(i.length===0)return 0;for(const o of i)this.entries.push(o),o.seq>this.lastSeq&&(this.lastSeq=o.seq);return this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),i.length}get all(){return this.entries}clear(){this.entries=[]}}function B(t,n){const i=n.trim().toLowerCase();return i?t.filter(o=>o.type.toLowerCase().includes(i)):[...t]}class j{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 ${msgsIn=new j;msgsOut=new j;bytesIn=new j;bytesOut=new j;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 D(t,n,i,o=1){if(t.length<2)return"";const r=Math.max(1,...t),l=i-o*2,h=n/(t.length-1);return t.map((m,d)=>{const u=d*h,S=o+l*(1-m/r);return`${u.toFixed(1)},${S.toFixed(1)}`}).join(" ")}const W={disconnected:s.content.muted,connecting:s.semantic.warning,connected:s.semantic.success,error:s.semantic.danger},x={fontFamily:s.typography.mono,fontSize:g.base};function y({children:t,testId:n}){return e.jsx("div",{"data-testid":n,style:{padding:a[4],color:s.content.muted,fontSize:g.base,fontStyle:"italic"},children:t})}function V(t){return t!==null&&typeof t=="object"}function K(t){return typeof t=="string"?`"${t}"`:typeof t=="number"?Number.isInteger(t)?String(t):t.toFixed(3):String(t)}function O({name:t,value:n,depth:i}){const[o,r]=p.useState(i===0),l={...x,paddingLeft:8+i*14,lineHeight:"18px",whiteSpace:"nowrap"};if(!V(n))return e.jsxs("div",{style:l,"data-testid":"net-tree-leaf",children:[e.jsx("span",{style:{color:s.content.primary},children:t}),e.jsx("span",{style:{color:s.content.muted},children:": "}),e.jsx("span",{style:{color:s.content.primary},children:K(n)})]});const h=Object.entries(n);return e.jsxs("div",{children:[e.jsxs("div",{style:{...l,cursor:"pointer",userSelect:"none"},"data-testid":"net-tree-branch","data-expanded":o||void 0,onClick:()=>r(m=>!m),children:[e.jsx("span",{style:{color:s.content.muted,display:"inline-block",width:12},children:e.jsx(F,{direction:o?"down":"right"})}),e.jsx("span",{style:{color:s.content.primary},children:t}),e.jsxs("span",{style:{color:s.content.dim},children:[" ",Array.isArray(n)?`[${h.length}]`:`{${h.length}}`]})]}),o&&h.map(([m,d])=>e.jsx(O,{name:m,value:d,depth:i+1},m))]})}const L=96,z=22,_=p.memo(function({points:n,color:i}){return e.jsx("svg",{width:L,height:z,style:{display:"block",background:s.surface.inset,borderRadius:s.shape.small},role:"img","aria-label":"rate sparkline",children:n&&e.jsx("polyline",{points:n,fill:"none",stroke:i,strokeWidth:1.2})})});function b({label:t,series:n,unit:i,color:o,testId:r}){const l=n.latest;return e.jsxs("div",{"data-testid":r,style:{display:"flex",flexDirection:"column",gap:a[1]},children:[e.jsxs("div",{style:{fontSize:g.sm,color:s.content.muted},children:[t," ",e.jsx("span",{style:{color:s.content.primary,fontFamily:s.typography.mono},children:l===null?"n/a":`${l}${i}`})]}),e.jsx(_,{points:D(n.data,L,z),color:o})]})}function G({event:t}){const n=t.direction==="in"?s.semantic.success:s.accent.default;return e.jsxs("div",{"data-testid":"net-log-row","data-direction":t.direction,style:{...x,display:"grid",gridTemplateColumns:"64px 24px 1fr 56px",gap:a[2],lineHeight:"17px",padding:`0 ${a[4]}`,opacity:t.dropped?.55:1},children:[e.jsxs("span",{style:{color:s.content.dim},children:[(t.time/1e3).toFixed(2),"s"]}),e.jsx("span",{style:{color:n},children:t.direction==="in"?"↓in":"↑out"}),e.jsxs("span",{style:{color:s.content.primary,textDecoration:t.dropped?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis"},children:[t.type,t.dropped?" (dropped)":""]}),e.jsx("span",{style:{color:s.content.muted,textAlign:"right"},children:t.size!==void 0?`${t.size} B`:"—"})]})}function U({adapter:t}){const[n,i]=p.useState(()=>t.getConditioning?.()??{latencyMs:0,jitterMs:0,packetLoss:0}),o=r=>{i(r),t.setConditioning?.(r)};return e.jsxs("div",{"data-testid":"net-conditioner",style:{display:"flex",gap:a[4],alignItems:"center",padding:`${a[2]} ${a[4]}`},children:[e.jsx("span",{style:{fontSize:g.sm,color:s.content.muted},children:"Conditioner"}),e.jsx(w,{label:"latency ms",value:n.latencyMs,step:10,testId:"net-cond-latency",onChange:r=>o({...n,latencyMs:Math.max(0,r)})}),e.jsx(w,{label:"jitter ms",value:n.jitterMs,step:5,testId:"net-cond-jitter",onChange:r=>o({...n,jitterMs:Math.max(0,r)})}),e.jsx(w,{label:"loss %",value:n.packetLoss*100,step:5,testId:"net-cond-loss",onChange:r=>o({...n,packetLoss:Math.min(1,Math.max(0,r/100))})})]})}function X({adapter:t,settable:n}){const[i,o]=p.useState(()=>t.getPlayerIdentity?.()?.name??""),r=()=>{const l=i.trim();l&&t.setPlayerIdentity?.({name:l})};return e.jsxs("div",{"data-testid":"net-identity",style:{display:"flex",gap:a[4],alignItems:"center",padding:`${a[2]} ${a[4]}`},children:[e.jsx("span",{style:{fontSize:g.sm,color:s.content.muted},children:"Player name"}),n?e.jsx(M,{"data-testid":"net-identity-name",value:i,onChange:l=>o(l.target.value),onBlur:r,onKeyDown:l=>{l.key==="Enter"&&l.currentTarget.blur()},style:{width:140}}):e.jsx("span",{"data-testid":"net-identity-name",style:{...x,color:s.content.primary},children:i||"—"})]})}function J({view:t,caps:n,rates:i}){return e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:a[6],alignItems:"center",padding:`${a[2]} ${a[4]}`,borderBottom:`1px solid ${s.boundary.default}`},children:[t.connectionState!==void 0?e.jsxs("span",{"data-testid":"net-connection-state",style:{color:W[t.connectionState]},children:["● ",t.connectionState]}):e.jsx(y,{testId:"net-connection-state-absent",children:"Connection state not provided by this adapter."}),t.roomInfo===void 0?e.jsx(y,{testId:"net-room-absent",children:"Room info not provided by this adapter."}):t.roomInfo?e.jsxs("span",{style:{...x,color:s.content.primary},children:[t.roomInfo.roomName," · ",t.roomInfo.roomId," · session ",t.roomInfo.sessionId]}):e.jsx("span",{style:{color:s.content.muted},children:"no room"}),t.stats?e.jsxs("span",{style:{color:s.content.muted},children:["entities ",e.jsx("span",{style:{color:s.content.primary},children:t.stats.entities})]}):e.jsx(y,{testId:"net-stats-absent",children:"Replication stats not provided by this adapter."}),n.rates?e.jsxs("div",{"data-testid":"net-sparklines",style:{display:"flex",gap:a[5]},children:[e.jsx(b,{label:"msgs in",unit:"/s",series:i.msgsIn,color:s.semantic.success,testId:"net-rate-msgs-in"}),e.jsx(b,{label:"msgs out",unit:"/s",series:i.msgsOut,color:s.accent.default,testId:"net-rate-msgs-out"}),e.jsx(b,{label:"bytes in",unit:" B/s",series:i.bytesIn,color:s.semantic.success,testId:"net-rate-bytes-in"}),e.jsx(b,{label:"bytes out",unit:" B/s",series:i.bytesOut,color:s.accent.default,testId:"net-rate-bytes-out"})]}):e.jsx(y,{testId:"net-rates-absent",children:"Rates not provided by this adapter."})]})}function Q(){const[,t]=p.useReducer(c=>c+1,0),n=p.useRef(new P),i=p.useRef(new $),o=p.useRef(null),[r,l]=p.useState(!1),[h,m]=p.useState("");p.useEffect(()=>{const c=()=>{const f=I().systems.inspectedNetworking()??null;return f!==o.current&&(o.current=f,n.current=new P,n.current.paused=r,i.current=new $),f},R=()=>{const f=c();n.current.pull(f),t()};R();const H=setInterval(R,250),A=setInterval(()=>{const C=c()?.getRates?.();C&&i.current.sample(C)},1e3),E=I().systems.inspectedNetworking()?.subscribe(()=>t());return()=>{clearInterval(H),clearInterval(A),E?.()}},[r]);const d=o.current??I().systems.inspectedNetworking()??null,u=q(d);if(!d||!u)return e.jsxs("div",{"data-testid":"network-inspector-empty",style:{padding:a[8],color:s.content.muted,fontSize:g.md,lineHeight:"18px"},children:[e.jsx("div",{style:{color:s.content.primary,marginBottom:a[2]},children:"No networking adapter is registered."}),"Games expose replication state to this inspector by registering a"," ",e.jsx("code",{style:x,children:"NetworkingAdapter"})," during setup:"," ",e.jsx("code",{style:x,children:"ctx.registerSystemAdapter?.('networking', adapter)"})," — see the third-person-arena example. Single-player games register none; there is nothing to inspect."]});const S=T(d),k=u.stateTree?d.getStateSnapshot?.():void 0,v=B(n.current.all,h);return e.jsxs("div",{"data-testid":"network-inspector",className:"vgai-content-frost",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",fontSize:g.md},children:[e.jsx(J,{view:S,caps:u,rates:i.current}),u.identity?e.jsx(X,{adapter:d,settable:u.identitySettable},d.getPlayerIdentity?.()?.name??""):null,u.conditioning?e.jsx(U,{adapter:d}):e.jsx(y,{testId:"net-conditioner-absent",children:"Link conditioning not provided by this adapter."}),e.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[e.jsx("div",{"data-testid":"net-state-tree",style:{flex:1,minWidth:0,overflow:"auto",borderRight:`1px solid ${s.boundary.default}`,padding:`${a[2]} 0`},children:u.stateTree?k!=null?e.jsx(O,{name:"state",value:k,depth:0}):e.jsx(y,{children:"Not connected — no replicated state to show."}):e.jsx(y,{testId:"net-tree-absent",children:"Replicated-state snapshot not provided by this adapter."})}),e.jsx("div",{"data-testid":"net-message-log",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:u.messageLog?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",gap:a[3],alignItems:"center",padding:a[2]},children:[e.jsx(N,{type:"button",variant:"ghost","data-testid":"net-log-pause",onClick:()=>{const c=!r;n.current.paused=c,l(c)},children:r?"Resume":"Pause"}),e.jsx(N,{type:"button",variant:"ghost","data-testid":"net-log-clear",onClick:()=>{n.current.clear(),t()},children:"Clear"}),e.jsx(M,{"data-testid":"net-log-filter",placeholder:"Filter by type",value:h,onChange:c=>m(c.target.value),style:{flex:1,minWidth:60}}),e.jsxs("span",{style:{fontSize:g.sm,color:s.content.muted},children:[v.length,"/",n.current.all.length]})]}),e.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto"},children:v.length===0?e.jsx(y,{children:"No messages captured yet."}):v.map(c=>e.jsx(G,{event:c},c.seq))})]}):e.jsx(y,{testId:"net-log-absent",children:"Message log not provided by this adapter."})})]})]})}const lt="workspace.utility",ct="Network",dt=25,pt=()=>I().systems.inspectedNetworking()!==null;function ut(){return e.jsx(Q,{})}export{pt as available,ut as default,dt as order,lt as point,ct as title};
@@ -0,0 +1 @@
1
+ const n={editorHelperType:"editorHelperType",skeletonVisible:"skeletonVisible",skeletonEnabled:"skeletonEnabled",engineInternal:"engineInternal",editorHelper:"editorHelper",vgaiComponentRoot:"vgaiComponentRoot",vgaiBuiltInternal:"vgaiBuiltInternal"};function r(e,t){return e?e.userData[n[t]]:void 0}function i(e,t,o){e.userData[n[t]]=o}export{n as ObjectMarkKeys,r as getObjectMark,i as setObjectMark};
@@ -0,0 +1 @@
1
+ import{getUserData as r,deleteUserData as n,setUserData as o}from"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";function i(e){const t=r(e,"authoringSubject");return t&&typeof t.label=="string"&&typeof t.kind=="string"?t:null}function a(e,t){o(e,"authoringSubject",t)}function b(e){n(e,"authoringSubject")}export{b as clearObject3DAuthoringSubject,i as object3DAuthoringSubjectOf,a as setObject3DAuthoringSubject};