@holoscript/core 7.0.0 → 8.0.0

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 (345) hide show
  1. package/README.md +2 -2
  2. package/bin/holoscript.cjs +3 -0
  3. package/dist/GLTFPipeline-276GE64O.js +16 -0
  4. package/dist/GLTFPipeline-M7WSSJED.cjs +37 -0
  5. package/dist/HoloScriptPlusParser-7FBIFUFC.js +693 -0
  6. package/dist/HoloScriptPlusParser-A2W7OCN2.cjs +698 -0
  7. package/dist/HoloScriptPlusParser-F2Z56FJR.js +10 -0
  8. package/dist/HoloScriptPlusParser-WKHRIH6T.cjs +27 -0
  9. package/dist/HoloScriptRuntime-3URVTKPJ.js +10 -0
  10. package/dist/HoloScriptRuntime-SXEAEU2N.cjs +19 -0
  11. package/dist/USDZExporter-3FWJ25JI.cjs +1037 -0
  12. package/dist/USDZExporter-D2HQLQYK.js +1035 -0
  13. package/dist/agents/index.cjs +19 -0
  14. package/dist/agents/index.d.ts +100 -0
  15. package/dist/agents/index.js +17 -0
  16. package/dist/chunk-23J755AR.js +1046 -0
  17. package/dist/chunk-253GBQZY.cjs +627 -0
  18. package/dist/chunk-25IQCHTO.cjs +781 -0
  19. package/dist/chunk-2BSMSUCE.js +1941 -0
  20. package/dist/chunk-2M2DPHKB.js +762 -0
  21. package/dist/chunk-2YSNA2F2.cjs +1274 -0
  22. package/dist/chunk-3AO425MZ.cjs +886 -0
  23. package/dist/chunk-3FOKASKO.cjs +348 -0
  24. package/dist/chunk-3HYYMEXI.cjs +56578 -0
  25. package/dist/chunk-3NFFOWGG.js +4287 -0
  26. package/dist/chunk-3WZEJHUQ.cjs +116 -0
  27. package/dist/chunk-4C57PR42.js +468 -0
  28. package/dist/chunk-4N4SXXWF.js +769 -0
  29. package/dist/chunk-4PDEPEQW.cjs +41 -0
  30. package/dist/chunk-4R6SBXDB.js +45 -0
  31. package/dist/chunk-4V2E7U7Q.cjs +2015 -0
  32. package/dist/chunk-5FSKKMR7.cjs +2092 -0
  33. package/dist/chunk-5GLCTO44.js +161 -0
  34. package/dist/chunk-5JEU52DW.js +382 -0
  35. package/dist/chunk-5S7RKFGR.cjs +446 -0
  36. package/dist/chunk-5WUNN6ZN.cjs +428 -0
  37. package/dist/chunk-62FBK3B7.js +70 -0
  38. package/dist/chunk-6CTRH7HT.cjs +1985 -0
  39. package/dist/chunk-6DPSFNJB.cjs +847 -0
  40. package/dist/chunk-6EX3I5P4.cjs +130 -0
  41. package/dist/chunk-73FELZVJ.cjs +611 -0
  42. package/dist/chunk-7CUEMLDZ.cjs +6445 -0
  43. package/dist/chunk-7HIASF7S.cjs +814 -0
  44. package/dist/chunk-A6KINLZJ.js +236 -0
  45. package/dist/chunk-AIA52I7T.cjs +543 -0
  46. package/dist/chunk-ANXZFVY2.js +113 -0
  47. package/dist/chunk-AYBXB26F.js +2176 -0
  48. package/dist/chunk-B4TFTDG4.js +449 -0
  49. package/dist/chunk-BE4UJCQT.js +623 -0
  50. package/dist/chunk-BRQJKJGT.cjs +20 -0
  51. package/dist/chunk-C2A5DUMF.cjs +689 -0
  52. package/dist/chunk-C37BHB7N.cjs +636 -0
  53. package/dist/chunk-CBJY23VL.js +126 -0
  54. package/dist/chunk-CIWWXYHZ.cjs +50 -0
  55. package/dist/chunk-CXFDRBQU.cjs +672 -0
  56. package/dist/chunk-D54CNIAJ.cjs +413 -0
  57. package/dist/chunk-DAJXW4KX.js +725 -0
  58. package/dist/chunk-DTGBOSEM.cjs +319 -0
  59. package/dist/chunk-E7JP3BS3.cjs +61 -0
  60. package/dist/chunk-EKBKLK7P.js +1169 -0
  61. package/dist/chunk-EKYL4PE3.cjs +404 -0
  62. package/dist/chunk-EUDQTK7N.cjs +4310 -0
  63. package/dist/chunk-EXKSFGSX.cjs +274 -0
  64. package/dist/chunk-EXUP2BUM.cjs +1173 -0
  65. package/dist/chunk-F43YAA34.js +623 -0
  66. package/dist/chunk-FDSGHPAK.js +130 -0
  67. package/dist/chunk-FEWUHQNM.cjs +144 -0
  68. package/dist/chunk-FGGJQRLZ.js +270 -0
  69. package/dist/chunk-FHP6LXJS.js +415 -0
  70. package/dist/chunk-FJPADH77.cjs +666 -0
  71. package/dist/chunk-FYSPZT4V.cjs +169 -0
  72. package/dist/chunk-GIOYPNTH.js +5575 -0
  73. package/dist/chunk-GJNCFRJU.cjs +125 -0
  74. package/dist/chunk-GMP623FG.cjs +1508 -0
  75. package/dist/chunk-GQHQOPXZ.cjs +5580 -0
  76. package/dist/chunk-GQT4TYKY.cjs +4381 -0
  77. package/dist/chunk-GTU2Z2WW.cjs +262 -0
  78. package/dist/chunk-GYZE55MO.js +2007 -0
  79. package/dist/chunk-GZG4KA4E.js +529 -0
  80. package/dist/chunk-H652NHX5.js +600 -0
  81. package/dist/chunk-HCCQLAA4.cjs +74 -0
  82. package/dist/chunk-HINXWAOD.cjs +1049 -0
  83. package/dist/chunk-HYNTS5CP.js +422 -0
  84. package/dist/chunk-HZSPDCXV.cjs +457 -0
  85. package/dist/chunk-HZTDET3N.js +1399 -0
  86. package/dist/chunk-I6XZ5DZF.cjs +488 -0
  87. package/dist/chunk-ILRBGFVD.cjs +72 -0
  88. package/dist/chunk-IPWSXCCN.js +1183 -0
  89. package/dist/chunk-IUTY5WQ2.cjs +424 -0
  90. package/dist/chunk-IVSZDECV.js +882 -0
  91. package/dist/chunk-IVY74O6C.js +247 -0
  92. package/dist/chunk-IZM5VQZD.js +714 -0
  93. package/dist/chunk-J32ZJZJH.js +554 -0
  94. package/dist/chunk-J6M4FPK5.js +421 -0
  95. package/dist/chunk-JC5YBPSF.cjs +984 -0
  96. package/dist/chunk-JCLBKPMX.js +3813 -0
  97. package/dist/chunk-JD7CIZ33.js +1949 -0
  98. package/dist/chunk-JIYN45TV.cjs +2525 -0
  99. package/dist/chunk-JJBE3TIH.cjs +1189 -0
  100. package/dist/chunk-JX7YL6ZE.js +2252 -0
  101. package/dist/chunk-K4VVR7CN.cjs +2433 -0
  102. package/dist/chunk-KEFNV2WM.cjs +2257 -0
  103. package/dist/chunk-KH4CNH66.cjs +424 -0
  104. package/dist/chunk-KJLB4OPV.js +5731 -0
  105. package/dist/chunk-KKFZ3B6J.cjs +557 -0
  106. package/dist/chunk-KKP7JKN4.cjs +6002 -0
  107. package/dist/chunk-KPJL34Y7.cjs +186 -0
  108. package/dist/chunk-KQCN6AKJ.cjs +3042 -0
  109. package/dist/chunk-KVRSTFNH.cjs +72 -0
  110. package/dist/chunk-LICPB5HZ.cjs +1409 -0
  111. package/dist/chunk-LM2VU56C.cjs +37 -0
  112. package/dist/chunk-M56JSP4A.js +400 -0
  113. package/dist/chunk-MBOOR7X4.js +18 -0
  114. package/dist/chunk-MGE5Z4GS.js +608 -0
  115. package/dist/chunk-MXFUTKCO.js +56 -0
  116. package/dist/chunk-MYY4PMWX.cjs +264 -0
  117. package/dist/chunk-N75IH2HY.js +258 -0
  118. package/dist/chunk-NBMHU6SW.js +669 -0
  119. package/dist/chunk-NG77ATEW.cjs +778 -0
  120. package/dist/chunk-NGKREZ36.js +6384 -0
  121. package/dist/chunk-NHWSN2SD.cjs +718 -0
  122. package/dist/chunk-NV4VMVXU.js +421 -0
  123. package/dist/chunk-NW5G5FBQ.js +215 -0
  124. package/dist/chunk-NXZFOPVD.cjs +5737 -0
  125. package/dist/chunk-OBIYPYYS.cjs +1993 -0
  126. package/dist/chunk-OIQYIIO3.cjs +473 -0
  127. package/dist/chunk-OL46QLBJ.js +61 -0
  128. package/dist/chunk-OMXII44L.js +5386 -0
  129. package/dist/chunk-OR4Q2BGL.cjs +759 -0
  130. package/dist/chunk-OSYNRVOV.cjs +243 -0
  131. package/dist/chunk-PGANYCAG.cjs +220 -0
  132. package/dist/chunk-PHENW4MQ.js +65 -0
  133. package/dist/chunk-PHVRG4I2.js +844 -0
  134. package/dist/chunk-Q56TT7IL.js +483 -0
  135. package/dist/chunk-QPOQ7VPI.js +1491 -0
  136. package/dist/chunk-QPSKHBJP.js +5963 -0
  137. package/dist/chunk-QXH7QDSZ.js +1989 -0
  138. package/dist/chunk-R75BSDH7.cjs +50 -0
  139. package/dist/chunk-RARB3MBR.js +207 -0
  140. package/dist/chunk-RVBHAXFG.js +56160 -0
  141. package/dist/chunk-S3MDHNKB.cjs +490 -0
  142. package/dist/chunk-S4W6Z2MN.js +2426 -0
  143. package/dist/chunk-S6YWHCKV.cjs +410 -0
  144. package/dist/chunk-SIEXCILW.js +229 -0
  145. package/dist/chunk-SJBGLS25.cjs +2196 -0
  146. package/dist/chunk-SLU6UPJI.cjs +410 -0
  147. package/dist/chunk-SMIWS6DE.cjs +212 -0
  148. package/dist/chunk-T2QCTZMO.js +811 -0
  149. package/dist/chunk-T5J7ZKP3.cjs +4885 -0
  150. package/dist/chunk-TDCNJHWO.js +341 -0
  151. package/dist/chunk-TG7O4WBC.js +406 -0
  152. package/dist/chunk-THCK6ECW.js +2085 -0
  153. package/dist/chunk-TJHVSBP2.js +439 -0
  154. package/dist/chunk-TVHSPJ4N.cjs +606 -0
  155. package/dist/chunk-U44IKGG7.cjs +5390 -0
  156. package/dist/chunk-UJXISJBN.js +487 -0
  157. package/dist/chunk-UM6C3CGK.js +4375 -0
  158. package/dist/chunk-UMABK6SI.js +686 -0
  159. package/dist/chunk-UOIGFQXC.cjs +9750 -0
  160. package/dist/chunk-URG2SJLK.js +2521 -0
  161. package/dist/chunk-V6MKC2FZ.js +979 -0
  162. package/dist/chunk-VECQYRXL.js +474 -0
  163. package/dist/chunk-VJ3L7CHT.cjs +169 -0
  164. package/dist/chunk-VMLKSV26.js +1216 -0
  165. package/dist/chunk-VVKVQZI6.js +55 -0
  166. package/dist/chunk-W6RW64BB.cjs +1219 -0
  167. package/dist/chunk-W7VDOASB.cjs +639 -0
  168. package/dist/chunk-WDT3JTGM.cjs +483 -0
  169. package/dist/chunk-WJIHFLMJ.js +404 -0
  170. package/dist/chunk-WKX5AMOY.js +309 -0
  171. package/dist/chunk-WNNE3PO3.js +34 -0
  172. package/dist/chunk-WRKUDAZJ.js +3038 -0
  173. package/dist/chunk-WRLUBRKS.cjs +1943 -0
  174. package/dist/chunk-WRNEH5MO.js +3169 -0
  175. package/dist/chunk-WRWEX5ZF.js +658 -0
  176. package/dist/chunk-X3GJPRVK.cjs +3246 -0
  177. package/dist/chunk-XHIV6326.cjs +793 -0
  178. package/dist/chunk-XIVIE43A.cjs +729 -0
  179. package/dist/chunk-XJAN7CZG.cjs +432 -0
  180. package/dist/chunk-XKTPFXGA.js +164 -0
  181. package/dist/chunk-XL6INWKT.js +121 -0
  182. package/dist/chunk-XSFNHP2E.js +632 -0
  183. package/dist/chunk-XT6JY5W5.js +9684 -0
  184. package/dist/chunk-XUILI4KB.cjs +430 -0
  185. package/dist/chunk-XUUVDHIF.cjs +3962 -0
  186. package/dist/chunk-YF2I3MV3.js +46 -0
  187. package/dist/chunk-YIMN575O.js +4847 -0
  188. package/dist/chunk-YIVFJNYV.js +176 -0
  189. package/dist/chunk-YKGPCZEE.cjs +237 -0
  190. package/dist/chunk-YN6V7R3L.cjs +327 -0
  191. package/dist/chunk-YQELFNJV.js +39 -0
  192. package/dist/chunk-YYXH45E2.js +426 -0
  193. package/dist/chunk-ZBQXLH2L.js +756 -0
  194. package/dist/chunk-ZDSYWBIE.cjs +69 -0
  195. package/dist/chunk-ZU7NIRT6.js +325 -0
  196. package/dist/chunk-ZZ7RO2UQ.js +1243 -0
  197. package/dist/chunk-ZZEI7MV4.js +778 -0
  198. package/dist/cli/holoscript-runner.cjs +2255 -0
  199. package/dist/cli/holoscript-runner.js +2230 -0
  200. package/dist/codebase/index.cjs +336 -0
  201. package/dist/codebase/index.js +331 -0
  202. package/dist/compiler/agent-inference.cjs +31 -0
  203. package/dist/compiler/agent-inference.js +8 -0
  204. package/dist/compiler/android-xr.cjs +24 -0
  205. package/dist/compiler/android-xr.js +14 -0
  206. package/dist/compiler/android.cjs +24 -0
  207. package/dist/compiler/android.js +14 -0
  208. package/dist/compiler/ar.cjs +23 -0
  209. package/dist/compiler/ar.js +11 -0
  210. package/dist/compiler/babylon.cjs +21 -0
  211. package/dist/compiler/babylon.js +15 -0
  212. package/dist/compiler/business-quest.cjs +43 -0
  213. package/dist/compiler/business-quest.js +4 -0
  214. package/dist/compiler/coco.cjs +27 -0
  215. package/dist/compiler/coco.js +4 -0
  216. package/dist/compiler/context.cjs +25 -0
  217. package/dist/compiler/context.d.ts +28 -0
  218. package/dist/compiler/context.js +8 -0
  219. package/dist/compiler/domain-block-utils.cjs +605 -0
  220. package/dist/compiler/domain-block-utils.js +11 -0
  221. package/dist/compiler/dtdl.cjs +27 -0
  222. package/dist/compiler/dtdl.js +11 -0
  223. package/dist/compiler/gltf-pipeline.cjs +39 -0
  224. package/dist/compiler/gltf-pipeline.js +4 -0
  225. package/dist/compiler/godot.cjs +18 -0
  226. package/dist/compiler/godot.js +12 -0
  227. package/dist/compiler/incremental.cjs +34 -0
  228. package/dist/compiler/incremental.js +9 -0
  229. package/dist/compiler/index.cjs +5860 -0
  230. package/dist/compiler/index.d.ts +322 -21
  231. package/dist/compiler/index.js +5525 -0
  232. package/dist/compiler/ios.cjs +23 -0
  233. package/dist/compiler/ios.js +13 -0
  234. package/dist/compiler/llm-provider-capabilities.cjs +25 -0
  235. package/dist/compiler/llm-provider-capabilities.d.ts +43 -0
  236. package/dist/compiler/llm-provider-capabilities.js +8 -0
  237. package/dist/compiler/multi-layer.cjs +24 -0
  238. package/dist/compiler/multi-layer.js +15 -0
  239. package/dist/compiler/nodetoy.cjs +23 -0
  240. package/dist/compiler/nodetoy.js +4 -0
  241. package/dist/compiler/openxr.cjs +19 -0
  242. package/dist/compiler/openxr.js +13 -0
  243. package/dist/compiler/playcanvas.cjs +19 -0
  244. package/dist/compiler/playcanvas.js +13 -0
  245. package/dist/compiler/r3f.cjs +38 -0
  246. package/dist/compiler/r3f.d.ts +22 -0
  247. package/dist/compiler/r3f.js +16 -0
  248. package/dist/compiler/remotion.cjs +23 -0
  249. package/dist/compiler/remotion.js +4 -0
  250. package/dist/compiler/reproducibility.cjs +39 -0
  251. package/dist/compiler/reproducibility.js +4 -0
  252. package/dist/compiler/sdf.cjs +24 -0
  253. package/dist/compiler/sdf.js +12 -0
  254. package/dist/compiler/semantic-scene.cjs +31 -0
  255. package/dist/compiler/semantic-scene.js +4 -0
  256. package/dist/compiler/state.cjs +21 -0
  257. package/dist/compiler/state.js +11 -0
  258. package/dist/compiler/trait-composition.cjs +30 -0
  259. package/dist/compiler/trait-composition.js +9 -0
  260. package/dist/compiler/unity.cjs +19 -0
  261. package/dist/compiler/unity.js +13 -0
  262. package/dist/compiler/unreal.cjs +23 -0
  263. package/dist/compiler/unreal.js +13 -0
  264. package/dist/compiler/urdf.cjs +52 -0
  265. package/dist/compiler/urdf.js +12 -0
  266. package/dist/compiler/usd-physics.cjs +26 -0
  267. package/dist/compiler/usd-physics.js +9 -0
  268. package/dist/compiler/visionos.cjs +19 -0
  269. package/dist/compiler/visionos.js +13 -0
  270. package/dist/compiler/vrchat.cjs +22 -0
  271. package/dist/compiler/vrchat.js +12 -0
  272. package/dist/compiler/vrr.cjs +24 -0
  273. package/dist/compiler/vrr.js +12 -0
  274. package/dist/compiler/wasm.cjs +36 -0
  275. package/dist/compiler/wasm.js +12 -0
  276. package/dist/compiler/webgpu.cjs +18 -0
  277. package/dist/compiler/webgpu.js +12 -0
  278. package/dist/coordinators/index.cjs +1266 -0
  279. package/dist/coordinators/index.d.ts +72 -1
  280. package/dist/coordinators/index.js +1259 -0
  281. package/dist/debugger.cjs +24 -0
  282. package/dist/debugger.js +11 -0
  283. package/dist/entries/interop.cjs +64 -0
  284. package/dist/entries/interop.js +7 -0
  285. package/dist/entries/scripting.cjs +55 -0
  286. package/dist/entries/scripting.js +10 -0
  287. package/dist/hololand/index.cjs +146 -0
  288. package/dist/hololand/index.d.ts +70 -0
  289. package/dist/hololand/index.js +5 -0
  290. package/dist/index.cjs +43233 -0
  291. package/dist/index.d.ts +976 -21
  292. package/dist/index.js +39995 -0
  293. package/dist/math/tropical-spmv.cjs +45 -0
  294. package/dist/math/tropical-spmv.js +4 -0
  295. package/dist/math/vec3.cjs +57 -0
  296. package/dist/math/vec3.js +4 -0
  297. package/dist/ml-dsa-FSKBTE3W.cjs +1265 -0
  298. package/dist/ml-dsa-Z7JDKW4L.js +1265 -0
  299. package/dist/paper-0c-spike/index.cjs +150 -0
  300. package/dist/paper-0c-spike/index.js +141 -0
  301. package/dist/parser.cjs +61 -0
  302. package/dist/parser.d.ts +11 -0
  303. package/dist/parser.js +12 -0
  304. package/dist/playwright-3AT3AKTV.cjs +98673 -0
  305. package/dist/playwright-VZPDVUEQ.js +98660 -0
  306. package/dist/reconstruction/index.cjs +153 -0
  307. package/dist/reconstruction/index.d.ts +29 -2
  308. package/dist/reconstruction/index.js +8 -0
  309. package/dist/runtime.cjs +316 -0
  310. package/dist/runtime.d.ts +61 -0
  311. package/dist/runtime.js +31 -0
  312. package/dist/self-improvement/index.cjs +563 -0
  313. package/dist/self-improvement/index.js +545 -0
  314. package/dist/storage/index.cjs +38 -0
  315. package/dist/storage/index.js +5 -0
  316. package/dist/testing.cjs +25 -0
  317. package/dist/testing.d.ts +70 -0
  318. package/dist/testing.js +4 -0
  319. package/dist/traitDocs/traitDocs.cjs +33 -0
  320. package/dist/traitDocs/traitDocs.js +7 -0
  321. package/dist/traits/botanical-lotus.cjs +41 -0
  322. package/dist/traits/botanical-lotus.d.ts +172 -0
  323. package/dist/traits/botanical-lotus.js +4 -0
  324. package/dist/traits/engines/index.cjs +520 -0
  325. package/dist/traits/engines/index.js +380 -0
  326. package/dist/traits/index.cjs +24409 -0
  327. package/dist/traits/index.d.ts +171 -35
  328. package/dist/traits/index.js +21634 -0
  329. package/dist/traits/simulation-solver-factory.cjs +13 -0
  330. package/dist/traits/simulation-solver-factory.d.ts +23 -0
  331. package/dist/traits/simulation-solver-factory.js +4 -0
  332. package/dist/traits/webcam-gaze.cjs +35 -0
  333. package/dist/traits/webcam-gaze.d.ts +17 -0
  334. package/dist/traits/webcam-gaze.js +4 -0
  335. package/dist/type-checker.cjs +19 -0
  336. package/dist/type-checker.js +6 -0
  337. package/dist/world/index.cjs +947 -0
  338. package/dist/world/index.d.ts +147 -0
  339. package/dist/world/index.js +939 -0
  340. package/dist/world-model/index.cjs +1446 -0
  341. package/dist/world-model/index.d.ts +119 -0
  342. package/dist/world-model/index.js +1414 -0
  343. package/dist/wot/index.cjs +29 -0
  344. package/dist/wot/index.js +4 -0
  345. package/package.json +93 -49
@@ -0,0 +1,4375 @@
1
+ import { init_material_properties_visual, init_surface_texture_visual, init_lighting_visual, init_gems_minerals_visual, init_fabric_cloth_visual, init_visual_effects_visual, init_age_condition_visual, init_water_fluid_visual, init_weather_phenomena_visual, init_emotion_mood_visual, init_size_scale_visual, init_environmental_biome_visual, init_magic_fantasy_visual, init_scifi_technology_visual, init_creatures_mythical_visual, init_nature_life_visual, init_furniture_decor_visual, init_construction_building_visual, init_containers_storage_visual, init_shape_form_visual, init_animals_visual, init_maritime_naval_visual, init_time_period_visual, init_accessibility_visual, init_accessibility_extended_visual, init_architecture_realestate_visual, init_audio_visual, init_cooking_food_visual, init_core_vr_interaction_visual, init_data_visualization_visual, init_education_learning_visual, init_environment_input_visual, init_game_mechanics_visual, init_geospatial_web3_visual, init_healthcare_medical_visual, init_humanoid_avatar_visual, init_intelligence_behavior_visual, init_interop_copresence_visual, init_iot_autonomous_agents_visual, init_locomotion_movement_visual, init_measurement_sensing_visual, init_media_analytics_visual, init_multisensory_haptic_visual, init_musical_sound_visual, init_music_performance_visual, init_narrative_storytelling_visual, init_networking_ai_visual, init_npc_roles_visual, init_object_interaction_visual, init_parser_core_ui_visual, init_physical_affordances_visual, init_physics_expansion_visual, init_procedural_generation_visual, init_resource_gathering_visual, init_safety_boundaries_visual, init_signs_communication_visual, init_simple_modifiers_visual, init_social_commerce_visual, init_social_effects_visual, init_sports_fitness_visual, init_state_persistence_visual, init_transportation_vehicles_visual, init_volumetric_webgpu_visual, init_weather_particles_visual, init_xr_platform_visual, MATERIAL_PROPERTIES_VISUALS, SURFACE_TEXTURE_VISUALS, LIGHTING_VISUALS, GEMS_MINERALS_VISUALS, FABRIC_CLOTH_VISUALS, VISUAL_EFFECTS_VISUALS, AGE_CONDITION_VISUALS, WATER_FLUID_VISUALS, WEATHER_PHENOMENA_VISUALS, EMOTION_MOOD_VISUALS, SIZE_SCALE_VISUALS, ENVIRONMENTAL_BIOME_VISUALS, MAGIC_FANTASY_VISUALS, SCIFI_TECHNOLOGY_VISUALS, CREATURES_MYTHICAL_VISUALS, NATURE_LIFE_VISUALS, FURNITURE_DECOR_VISUALS, CONSTRUCTION_BUILDING_VISUALS, CONTAINERS_STORAGE_VISUALS, SHAPE_FORM_VISUALS, ANIMALS_VISUALS, MARITIME_NAVAL_VISUALS, TIME_PERIOD_VISUALS, ACCESSIBILITY_VISUALS, ACCESSIBILITY_EXTENDED_VISUALS, ARCHITECTURE_REALESTATE_VISUALS, AUDIO_VISUALS, COOKING_FOOD_VISUALS, CORE_VR_INTERACTION_VISUALS, DATA_VISUALIZATION_VISUALS, EDUCATION_LEARNING_VISUALS, ENVIRONMENT_INPUT_VISUALS, GAME_MECHANICS_VISUALS, GEOSPATIAL_WEB3_VISUALS, HEALTHCARE_MEDICAL_VISUALS, HUMANOID_AVATAR_VISUALS, INTELLIGENCE_BEHAVIOR_VISUALS, INTEROP_COPRESENCE_VISUALS, IOT_AUTONOMOUS_AGENTS_VISUALS, LOCOMOTION_MOVEMENT_VISUALS, MEASUREMENT_SENSING_VISUALS, MEDIA_ANALYTICS_VISUALS, MULTISENSORY_HAPTIC_VISUALS, MUSICAL_SOUND_VISUALS, MUSIC_PERFORMANCE_VISUALS, NARRATIVE_STORYTELLING_VISUALS, NETWORKING_AI_VISUALS, NPC_ROLES_VISUALS, OBJECT_INTERACTION_VISUALS, PARSER_CORE_UI_VISUALS, PHYSICAL_AFFORDANCES_VISUALS, PHYSICS_EXPANSION_VISUALS, PROCEDURAL_GENERATION_VISUALS, RESOURCE_GATHERING_VISUALS, SAFETY_BOUNDARIES_VISUALS, SIGNS_COMMUNICATION_VISUALS, SIMPLE_MODIFIERS_VISUALS, SOCIAL_COMMERCE_VISUALS, SOCIAL_EFFECTS_VISUALS, SPORTS_FITNESS_VISUALS, STATE_PERSISTENCE_VISUALS, TRANSPORTATION_VEHICLES_VISUALS, VOLUMETRIC_WEBGPU_VISUALS, WEATHER_PARTICLES_VISUALS, XR_PLATFORM_VISUALS } from './chunk-XT6JY5W5.js';
2
+ import { init_ProvenanceSemiring, ProvenanceSemiring } from './chunk-TJHVSBP2.js';
3
+ import { init_TraitVisualRegistry, init_types, init_TraitCompositor, TraitCompositor, TraitVisualRegistry } from './chunk-4C57PR42.js';
4
+ import { init_PlatformConditionalCompilerMixin, createPlatformTarget, PlatformConditionalCompilerMixin } from './chunk-GZG4KA4E.js';
5
+ import { init_DomainBlockCompilerMixin, compileDomainBlocks, compileSimulationBlock, simulationToR3F, compileWeatherBlock, weatherToR3F, compileAudioSourceBlock, audioSourceToR3F, compilePostProcessingBlock, postProcessingToR3F, compileParticleBlock, particlesToR3F, compilePhysicsBlock, physicsToR3F, compileMaterialBlock, materialToR3F } from './chunk-JCLBKPMX.js';
6
+ import { init_AgentRBAC, init_CompilerBase, getRBAC, UnauthorizedCompilerAccessError, escapeStringValue } from './chunk-QPSKHBJP.js';
7
+ import { __esm, __export } from './chunk-OL46QLBJ.js';
8
+
9
+ // src/traits/visual/presets/hologram-media.visual.ts
10
+ var HOLOGRAM_MEDIA_VISUALS;
11
+ var init_hologram_media_visual = __esm({
12
+ "src/traits/visual/presets/hologram-media.visual.ts"() {
13
+ HOLOGRAM_MEDIA_VISUALS = {
14
+ depth_estimation: {
15
+ material: { roughness: 0.3 },
16
+ emissive: { color: "#6644FF", intensity: 0.2 },
17
+ tags: ["ai", "depth", "hologram"],
18
+ layer: "visual_effect"
19
+ },
20
+ displacement: {
21
+ material: { roughness: 0.4 },
22
+ emissive: { color: "#8866FF", intensity: 0.15 },
23
+ tags: ["3d", "depth", "mesh"],
24
+ layer: "visual_effect"
25
+ },
26
+ segment: {
27
+ material: { roughness: 0.3 },
28
+ emissive: { color: "#FF44AA", intensity: 0.15 },
29
+ tags: ["ai", "segmentation", "mask"],
30
+ layer: "visual_effect"
31
+ },
32
+ animated_texture: {
33
+ material: { roughness: 0.3 },
34
+ emissive: { color: "#44FFAA", intensity: 0.15 },
35
+ tags: ["animation", "texture", "gif"],
36
+ layer: "visual_effect"
37
+ },
38
+ holographic_sprite: {
39
+ material: { roughness: 0.2 },
40
+ emissive: { color: "#AA44FF", intensity: 0.3 },
41
+ tags: ["hologram", "sprite", "3d"],
42
+ layer: "visual_effect"
43
+ },
44
+ quilt: {
45
+ material: { roughness: 0.3 },
46
+ emissive: { color: "#44AAFF", intensity: 0.2 },
47
+ tags: ["hologram", "multiview", "looking-glass"],
48
+ layer: "visual_effect"
49
+ },
50
+ gaussian_splatting: {
51
+ material: { roughness: 0.2 },
52
+ emissive: { color: "#AACCFF", intensity: 0.15 },
53
+ tags: ["3d", "photorealistic", "splat"],
54
+ layer: "visual_effect"
55
+ },
56
+ spatial_video: {
57
+ material: { roughness: 0.3 },
58
+ emissive: { color: "#FF8844", intensity: 0.15 },
59
+ tags: ["video", "stereo", "spatial"],
60
+ layer: "visual_effect"
61
+ },
62
+ image: {
63
+ material: { roughness: 0.4 },
64
+ tags: ["media", "texture", "source"],
65
+ layer: "base_material"
66
+ },
67
+ depth_sequence: {
68
+ material: { roughness: 0.3 },
69
+ emissive: { color: "#6644FF", intensity: 0.1 },
70
+ tags: ["video", "depth", "temporal"],
71
+ layer: "visual_effect"
72
+ },
73
+ temporal_smoothing: {
74
+ material: { roughness: 0.3 },
75
+ tags: ["processing", "temporal"],
76
+ layer: "visual_effect"
77
+ },
78
+ depth_to_normal: {
79
+ material: { roughness: 0.3 },
80
+ emissive: { color: "#8888FF", intensity: 0.1 },
81
+ tags: ["processing", "normal-map"],
82
+ layer: "visual_effect"
83
+ }
84
+ };
85
+ }
86
+ });
87
+
88
+ // src/traits/visual/presets/gaps-physics.visual.ts
89
+ var GAPS_PHYSICS_VISUALS;
90
+ var init_gaps_physics_visual = __esm({
91
+ "src/traits/visual/presets/gaps-physics.visual.ts"() {
92
+ GAPS_PHYSICS_VISUALS = /* @__PURE__ */ new Map([
93
+ // --- Pillar A: Unified Physics ---
94
+ [
95
+ "fluid",
96
+ {
97
+ material: {
98
+ type: "physical",
99
+ color: "#1a6fc4",
100
+ metalness: 0,
101
+ roughness: 0.05,
102
+ transmission: 0.95,
103
+ ior: 1.33,
104
+ thickness: 0.5
105
+ },
106
+ layers: [
107
+ {
108
+ type: "effect",
109
+ name: "ssfr",
110
+ priority: 50,
111
+ config: {
112
+ resolutionScale: 0.5,
113
+ absorptionColor: [0.4, 0.04, 0],
114
+ absorptionStrength: 2,
115
+ fresnelPower: 0.02,
116
+ refractionStrength: 0.1
117
+ }
118
+ }
119
+ ]
120
+ }
121
+ ],
122
+ [
123
+ "soft_body_pro",
124
+ {
125
+ material: {
126
+ type: "physical",
127
+ color: "#e8a87c",
128
+ metalness: 0,
129
+ roughness: 0.6
130
+ },
131
+ layers: [
132
+ {
133
+ type: "deformation",
134
+ name: "pbd_tearing",
135
+ priority: 45,
136
+ config: { tearThreshold: 0.8, tearColor: "#8b0000" }
137
+ }
138
+ ]
139
+ }
140
+ ],
141
+ [
142
+ "crowd_sim",
143
+ {
144
+ material: {
145
+ type: "standard",
146
+ color: "#7b68ee"
147
+ },
148
+ layers: [
149
+ {
150
+ type: "instanced",
151
+ name: "crowd_instances",
152
+ priority: 30,
153
+ config: { maxInstances: 1e4, lodLevels: 3 }
154
+ }
155
+ ]
156
+ }
157
+ ],
158
+ [
159
+ "deformable_terrain",
160
+ {
161
+ material: {
162
+ type: "standard",
163
+ color: "#8b7355",
164
+ roughness: 0.9
165
+ },
166
+ layers: [
167
+ {
168
+ type: "displacement",
169
+ name: "heightmap_erosion",
170
+ priority: 40,
171
+ config: { displacementScale: 5 }
172
+ }
173
+ ]
174
+ }
175
+ ],
176
+ [
177
+ "volumetric_clouds",
178
+ {
179
+ material: {
180
+ type: "shader",
181
+ color: "#ffffff"
182
+ },
183
+ layers: [
184
+ {
185
+ type: "volumetric",
186
+ name: "cloud_raymarcher",
187
+ priority: 80,
188
+ config: {
189
+ absorptionCoeff: 0.04,
190
+ scatteringCoeff: 0.06,
191
+ phaseG: 0.3,
192
+ maxSteps: 64
193
+ }
194
+ }
195
+ ]
196
+ }
197
+ ],
198
+ [
199
+ "god_rays",
200
+ {
201
+ material: {
202
+ type: "shader",
203
+ color: "#fffde7"
204
+ },
205
+ layers: [
206
+ {
207
+ type: "post_process",
208
+ name: "volumetric_light",
209
+ priority: 85,
210
+ config: { decay: 0.96, weight: 0.5, exposure: 0.3, samples: 100 }
211
+ }
212
+ ]
213
+ }
214
+ ],
215
+ // --- Weather Hub ---
216
+ [
217
+ "weather",
218
+ {
219
+ material: {
220
+ type: "none",
221
+ color: "#87ceeb"
222
+ },
223
+ layers: [
224
+ {
225
+ type: "ambient",
226
+ name: "weather_atmosphere",
227
+ priority: 90,
228
+ config: { affectsLighting: true, affectsFog: true }
229
+ }
230
+ ]
231
+ }
232
+ ],
233
+ // --- Pillar B: Persistent World ---
234
+ [
235
+ "world_state",
236
+ {
237
+ material: {
238
+ type: "none",
239
+ color: "#4a90d9"
240
+ },
241
+ layers: []
242
+ }
243
+ ],
244
+ [
245
+ "spatial_voice",
246
+ {
247
+ material: {
248
+ type: "none",
249
+ color: "#90ee90"
250
+ },
251
+ layers: [
252
+ {
253
+ type: "indicator",
254
+ name: "voice_range",
255
+ priority: 10,
256
+ config: { showRadius: true, radiusColor: "#90ee9040" }
257
+ }
258
+ ]
259
+ }
260
+ ],
261
+ [
262
+ "lip_sync",
263
+ {
264
+ material: {
265
+ type: "none",
266
+ color: "#ffb6c1"
267
+ },
268
+ layers: [
269
+ {
270
+ type: "morph",
271
+ name: "viseme_blendshapes",
272
+ priority: 60,
273
+ config: { blendShapePrefix: "viseme_" }
274
+ }
275
+ ]
276
+ }
277
+ ],
278
+ // --- Pillar C: Living Economy ---
279
+ [
280
+ "ai_companion",
281
+ {
282
+ material: {
283
+ type: "standard",
284
+ color: "#dda0dd",
285
+ emissive: "#330033",
286
+ emissiveIntensity: 0.2
287
+ },
288
+ layers: [
289
+ {
290
+ type: "indicator",
291
+ name: "ai_thinking",
292
+ priority: 15,
293
+ config: { pulseColor: "#9b59b6", pulseSpeed: 1.5 }
294
+ }
295
+ ]
296
+ }
297
+ ],
298
+ [
299
+ "token_gated",
300
+ {
301
+ material: {
302
+ type: "standard",
303
+ color: "#ffd700",
304
+ metalness: 0.8,
305
+ roughness: 0.2
306
+ },
307
+ layers: [
308
+ {
309
+ type: "barrier",
310
+ name: "token_gate_barrier",
311
+ priority: 70,
312
+ config: { barrierColor: "#ffd70060", shimmer: true }
313
+ }
314
+ ]
315
+ }
316
+ ],
317
+ [
318
+ "moderation",
319
+ {
320
+ material: {
321
+ type: "none",
322
+ color: "#ff6347"
323
+ },
324
+ layers: []
325
+ }
326
+ ],
327
+ [
328
+ "anti_grief",
329
+ {
330
+ material: {
331
+ type: "none",
332
+ color: "#32cd32"
333
+ },
334
+ layers: [
335
+ {
336
+ type: "shield",
337
+ name: "grief_shield",
338
+ priority: 95,
339
+ config: { shieldColor: "#32cd3230" }
340
+ }
341
+ ]
342
+ }
343
+ ]
344
+ ]);
345
+ }
346
+ });
347
+
348
+ // src/traits/visual/presets/phone-sleeve-vr.visual.ts
349
+ var PHONE_SLEEVE_VR_VISUALS;
350
+ var init_phone_sleeve_vr_visual = __esm({
351
+ "src/traits/visual/presets/phone-sleeve-vr.visual.ts"() {
352
+ PHONE_SLEEVE_VR_VISUALS = {
353
+ // --- Hardware Form Factor ---
354
+ phone_sleeve: {
355
+ material: { roughness: 0.3, metalness: 0.6 },
356
+ emissive: { color: "#00CCFF", intensity: 0.2 },
357
+ tags: ["vr", "phone", "sleeve", "headset"],
358
+ layer: "visual_effect"
359
+ },
360
+ sleeve_nfc_trigger: {
361
+ material: { roughness: 0.4 },
362
+ emissive: { color: "#FFD700", intensity: 0.15 },
363
+ tags: ["nfc", "trigger", "hardware"],
364
+ layer: "visual_effect"
365
+ },
366
+ sleeve_lens_profile: {
367
+ material: { roughness: 0.1, metalness: 0 },
368
+ opacity: 0.6,
369
+ tags: ["lens", "optics"],
370
+ layer: "visual_effect"
371
+ },
372
+ phone_detection: {
373
+ material: { roughness: 0.4 },
374
+ emissive: { color: "#44FF88", intensity: 0.1 },
375
+ tags: ["detection", "calibration"],
376
+ layer: "visual_effect"
377
+ },
378
+ // --- Display ---
379
+ stereo_split: {
380
+ material: { roughness: 0.2 },
381
+ emissive: { color: "#FF44AA", intensity: 0.2 },
382
+ tags: ["stereoscopic", "display", "split"],
383
+ layer: "visual_effect"
384
+ },
385
+ barrel_distortion: {
386
+ material: { roughness: 0.3 },
387
+ emissive: { color: "#AA44FF", intensity: 0.15 },
388
+ tags: ["distortion", "shader", "lens"],
389
+ layer: "visual_effect"
390
+ },
391
+ chromatic_aberration_fix: {
392
+ material: { roughness: 0.3 },
393
+ emissive: { color: "#FF8800", intensity: 0.1 },
394
+ tags: ["color", "correction", "lens"],
395
+ layer: "visual_effect"
396
+ },
397
+ ipd_adjust: {
398
+ material: { roughness: 0.4 },
399
+ emissive: { color: "#44CCFF", intensity: 0.1 },
400
+ tags: ["calibration", "ipd", "comfort"],
401
+ layer: "visual_effect"
402
+ },
403
+ // --- Sensor / Tracking ---
404
+ gyro_head_tracking: {
405
+ material: { roughness: 0.4 },
406
+ emissive: { color: "#00FF88", intensity: 0.15 },
407
+ tags: ["tracking", "gyroscope", "3dof"],
408
+ layer: "visual_effect"
409
+ },
410
+ accel_sensor_fusion: {
411
+ material: { roughness: 0.4 },
412
+ emissive: { color: "#00CC66", intensity: 0.1 },
413
+ tags: ["sensor", "accelerometer", "fusion"],
414
+ layer: "visual_effect"
415
+ },
416
+ mag_drift_correction: {
417
+ material: { roughness: 0.4 },
418
+ emissive: { color: "#8844FF", intensity: 0.1 },
419
+ tags: ["magnetometer", "drift", "correction"],
420
+ layer: "visual_effect"
421
+ },
422
+ positional_estimation: {
423
+ material: { roughness: 0.4 },
424
+ emissive: { color: "#FFAA00", intensity: 0.15 },
425
+ tags: ["6dof", "vio", "tracking"],
426
+ layer: "visual_effect"
427
+ },
428
+ // --- Interaction ---
429
+ gaze_cursor: {
430
+ material: { roughness: 0.2 },
431
+ emissive: { color: "#FFFFFF", intensity: 0.3 },
432
+ tags: ["gaze", "cursor", "reticle"],
433
+ layer: "visual_effect"
434
+ },
435
+ gaze_dwell_select: {
436
+ material: { roughness: 0.3 },
437
+ emissive: { color: "#FFFF44", intensity: 0.2 },
438
+ tags: ["gaze", "dwell", "selection"],
439
+ layer: "visual_effect"
440
+ },
441
+ bt_controller: {
442
+ material: { roughness: 0.5, metalness: 0.3 },
443
+ tags: ["bluetooth", "controller", "input"],
444
+ layer: "visual_effect"
445
+ },
446
+ tap_select: {
447
+ material: { roughness: 0.4 },
448
+ emissive: { color: "#44FF44", intensity: 0.1 },
449
+ tags: ["tap", "capacitive", "input"],
450
+ layer: "visual_effect"
451
+ },
452
+ voice_command: {
453
+ material: { roughness: 0.4 },
454
+ emissive: { color: "#4488FF", intensity: 0.1 },
455
+ tags: ["voice", "speech", "command"],
456
+ layer: "visual_effect"
457
+ },
458
+ // --- Performance ---
459
+ thermal_throttle: {
460
+ material: { roughness: 0.6 },
461
+ emissive: { color: "#FF4400", intensity: 0.2 },
462
+ tags: ["thermal", "throttle", "performance"],
463
+ layer: "visual_effect"
464
+ },
465
+ battery_aware_lod: {
466
+ material: { roughness: 0.5 },
467
+ emissive: { color: "#44FF00", intensity: 0.1 },
468
+ tags: ["battery", "lod", "adaptive"],
469
+ layer: "visual_effect"
470
+ },
471
+ sleeve_foveated: {
472
+ material: { roughness: 0.3 },
473
+ emissive: { color: "#CC44FF", intensity: 0.15 },
474
+ tags: ["foveated", "rendering", "performance"],
475
+ layer: "visual_effect"
476
+ },
477
+ low_persistence: {
478
+ material: { roughness: 0.2 },
479
+ emissive: { color: "#88CCFF", intensity: 0.1 },
480
+ tags: ["display", "persistence", "blur"],
481
+ layer: "visual_effect"
482
+ },
483
+ // --- Comfort ---
484
+ vr_comfort_vignette: {
485
+ material: { roughness: 0.5 },
486
+ opacity: 0.7,
487
+ tags: ["comfort", "vignette", "motion"],
488
+ layer: "visual_effect"
489
+ },
490
+ reorient_snap: {
491
+ material: { roughness: 0.4 },
492
+ emissive: { color: "#44FFCC", intensity: 0.1 },
493
+ tags: ["snap", "recenter", "comfort"],
494
+ layer: "visual_effect"
495
+ },
496
+ static_horizon: {
497
+ material: { roughness: 0.4 },
498
+ emissive: { color: "#88FF88", intensity: 0.1 },
499
+ tags: ["horizon", "stability", "nausea"],
500
+ layer: "visual_effect"
501
+ },
502
+ session_timer: {
503
+ material: { roughness: 0.4 },
504
+ emissive: { color: "#FFCC00", intensity: 0.15 },
505
+ tags: ["timer", "health", "breaks"],
506
+ layer: "visual_effect"
507
+ }
508
+ };
509
+ }
510
+ });
511
+
512
+ // src/traits/visual/index.ts
513
+ function registerAllPresets() {
514
+ const registry = TraitVisualRegistry.getInstance();
515
+ for (const presetMap of ALL_PRESETS) {
516
+ registry.registerBatch(presetMap);
517
+ }
518
+ }
519
+ var ALL_PRESETS;
520
+ var init_visual = __esm({
521
+ "src/traits/visual/index.ts"() {
522
+ init_TraitVisualRegistry();
523
+ init_types();
524
+ init_TraitVisualRegistry();
525
+ init_material_properties_visual();
526
+ init_surface_texture_visual();
527
+ init_lighting_visual();
528
+ init_gems_minerals_visual();
529
+ init_fabric_cloth_visual();
530
+ init_visual_effects_visual();
531
+ init_age_condition_visual();
532
+ init_water_fluid_visual();
533
+ init_weather_phenomena_visual();
534
+ init_emotion_mood_visual();
535
+ init_size_scale_visual();
536
+ init_environmental_biome_visual();
537
+ init_magic_fantasy_visual();
538
+ init_scifi_technology_visual();
539
+ init_creatures_mythical_visual();
540
+ init_nature_life_visual();
541
+ init_furniture_decor_visual();
542
+ init_construction_building_visual();
543
+ init_containers_storage_visual();
544
+ init_shape_form_visual();
545
+ init_animals_visual();
546
+ init_maritime_naval_visual();
547
+ init_time_period_visual();
548
+ init_accessibility_visual();
549
+ init_accessibility_extended_visual();
550
+ init_architecture_realestate_visual();
551
+ init_audio_visual();
552
+ init_cooking_food_visual();
553
+ init_core_vr_interaction_visual();
554
+ init_data_visualization_visual();
555
+ init_education_learning_visual();
556
+ init_environment_input_visual();
557
+ init_game_mechanics_visual();
558
+ init_geospatial_web3_visual();
559
+ init_healthcare_medical_visual();
560
+ init_humanoid_avatar_visual();
561
+ init_intelligence_behavior_visual();
562
+ init_interop_copresence_visual();
563
+ init_iot_autonomous_agents_visual();
564
+ init_locomotion_movement_visual();
565
+ init_measurement_sensing_visual();
566
+ init_media_analytics_visual();
567
+ init_multisensory_haptic_visual();
568
+ init_musical_sound_visual();
569
+ init_music_performance_visual();
570
+ init_narrative_storytelling_visual();
571
+ init_networking_ai_visual();
572
+ init_npc_roles_visual();
573
+ init_object_interaction_visual();
574
+ init_parser_core_ui_visual();
575
+ init_physical_affordances_visual();
576
+ init_physics_expansion_visual();
577
+ init_procedural_generation_visual();
578
+ init_resource_gathering_visual();
579
+ init_safety_boundaries_visual();
580
+ init_signs_communication_visual();
581
+ init_simple_modifiers_visual();
582
+ init_social_commerce_visual();
583
+ init_social_effects_visual();
584
+ init_sports_fitness_visual();
585
+ init_state_persistence_visual();
586
+ init_transportation_vehicles_visual();
587
+ init_volumetric_webgpu_visual();
588
+ init_weather_particles_visual();
589
+ init_xr_platform_visual();
590
+ init_hologram_media_visual();
591
+ init_gaps_physics_visual();
592
+ init_phone_sleeve_vr_visual();
593
+ ALL_PRESETS = [
594
+ // Original 12
595
+ MATERIAL_PROPERTIES_VISUALS,
596
+ SURFACE_TEXTURE_VISUALS,
597
+ LIGHTING_VISUALS,
598
+ GEMS_MINERALS_VISUALS,
599
+ FABRIC_CLOTH_VISUALS,
600
+ VISUAL_EFFECTS_VISUALS,
601
+ AGE_CONDITION_VISUALS,
602
+ WATER_FLUID_VISUALS,
603
+ WEATHER_PHENOMENA_VISUALS,
604
+ EMOTION_MOOD_VISUALS,
605
+ SIZE_SCALE_VISUALS,
606
+ ENVIRONMENTAL_BIOME_VISUALS,
607
+ // Expansion wave 1
608
+ MAGIC_FANTASY_VISUALS,
609
+ SCIFI_TECHNOLOGY_VISUALS,
610
+ CREATURES_MYTHICAL_VISUALS,
611
+ NATURE_LIFE_VISUALS,
612
+ FURNITURE_DECOR_VISUALS,
613
+ CONSTRUCTION_BUILDING_VISUALS,
614
+ CONTAINERS_STORAGE_VISUALS,
615
+ SHAPE_FORM_VISUALS,
616
+ ANIMALS_VISUALS,
617
+ MARITIME_NAVAL_VISUALS,
618
+ TIME_PERIOD_VISUALS,
619
+ // Expansion wave 2 — full coverage
620
+ ACCESSIBILITY_VISUALS,
621
+ ACCESSIBILITY_EXTENDED_VISUALS,
622
+ ARCHITECTURE_REALESTATE_VISUALS,
623
+ AUDIO_VISUALS,
624
+ COOKING_FOOD_VISUALS,
625
+ CORE_VR_INTERACTION_VISUALS,
626
+ DATA_VISUALIZATION_VISUALS,
627
+ EDUCATION_LEARNING_VISUALS,
628
+ ENVIRONMENT_INPUT_VISUALS,
629
+ GAME_MECHANICS_VISUALS,
630
+ GEOSPATIAL_WEB3_VISUALS,
631
+ HEALTHCARE_MEDICAL_VISUALS,
632
+ HUMANOID_AVATAR_VISUALS,
633
+ INTELLIGENCE_BEHAVIOR_VISUALS,
634
+ INTEROP_COPRESENCE_VISUALS,
635
+ IOT_AUTONOMOUS_AGENTS_VISUALS,
636
+ LOCOMOTION_MOVEMENT_VISUALS,
637
+ MEASUREMENT_SENSING_VISUALS,
638
+ MEDIA_ANALYTICS_VISUALS,
639
+ MULTISENSORY_HAPTIC_VISUALS,
640
+ MUSICAL_SOUND_VISUALS,
641
+ MUSIC_PERFORMANCE_VISUALS,
642
+ NARRATIVE_STORYTELLING_VISUALS,
643
+ NETWORKING_AI_VISUALS,
644
+ NPC_ROLES_VISUALS,
645
+ OBJECT_INTERACTION_VISUALS,
646
+ PARSER_CORE_UI_VISUALS,
647
+ PHYSICAL_AFFORDANCES_VISUALS,
648
+ PHYSICS_EXPANSION_VISUALS,
649
+ PROCEDURAL_GENERATION_VISUALS,
650
+ RESOURCE_GATHERING_VISUALS,
651
+ SAFETY_BOUNDARIES_VISUALS,
652
+ SIGNS_COMMUNICATION_VISUALS,
653
+ SIMPLE_MODIFIERS_VISUALS,
654
+ SOCIAL_COMMERCE_VISUALS,
655
+ SOCIAL_EFFECTS_VISUALS,
656
+ SPORTS_FITNESS_VISUALS,
657
+ STATE_PERSISTENCE_VISUALS,
658
+ TRANSPORTATION_VEHICLES_VISUALS,
659
+ VOLUMETRIC_WEBGPU_VISUALS,
660
+ WEATHER_PARTICLES_VISUALS,
661
+ XR_PLATFORM_VISUALS,
662
+ // Hologram Media Pipeline
663
+ HOLOGRAM_MEDIA_VISUALS,
664
+ // GAPS Feature Roadmap — Phase 1
665
+ GAPS_PHYSICS_VISUALS,
666
+ // Phone Sleeve VR — smartphone-as-headset
667
+ PHONE_SLEEVE_VR_VISUALS
668
+ ];
669
+ registerAllPresets();
670
+ }
671
+ });
672
+
673
+ // src/compiler/ObjectPool.ts
674
+ var ASTNodePool;
675
+ var init_ObjectPool = __esm({
676
+ "src/compiler/ObjectPool.ts"() {
677
+ ASTNodePool = class {
678
+ /**
679
+ * @param factory Creates a fresh instance of the node.
680
+ * @param resetter Resets the node state before it is handed out again.
681
+ * @param initialCapacity How many nodes to pre-allocate.
682
+ */
683
+ constructor(factory, resetter, initialCapacity = 1e4) {
684
+ this.pool = [];
685
+ this.factory = factory;
686
+ this.resetter = resetter;
687
+ for (let i = 0; i < initialCapacity; i++) {
688
+ this.pool.push(this.factory());
689
+ }
690
+ }
691
+ /**
692
+ * Acquire a node from the pool, or create a new one if the pool is empty.
693
+ */
694
+ acquire() {
695
+ if (this.pool.length > 0) {
696
+ const node = this.pool.pop();
697
+ this.resetter(node);
698
+ return node;
699
+ }
700
+ return this.factory();
701
+ }
702
+ /**
703
+ * Release a node back to the pool to be reused.
704
+ */
705
+ release(node) {
706
+ this.pool.push(node);
707
+ }
708
+ /**
709
+ * Release an array of nodes back to the pool.
710
+ */
711
+ releaseAll(nodes) {
712
+ for (const node of nodes) {
713
+ this.pool.push(node);
714
+ }
715
+ }
716
+ /**
717
+ * Clear the pool, allowing garbage collection.
718
+ */
719
+ clear() {
720
+ this.pool.length = 0;
721
+ }
722
+ };
723
+ }
724
+ });
725
+
726
+ // src/compiler/R3FCompiler.ts
727
+ var R3FCompiler_exports = {};
728
+ __export(R3FCompiler_exports, {
729
+ ENVIRONMENT_PRESETS: () => ENVIRONMENT_PRESETS,
730
+ MATERIAL_PRESETS: () => MATERIAL_PRESETS,
731
+ QUALITY_TIER_SCALES: () => QUALITY_TIER_SCALES,
732
+ R3FCompiler: () => R3FCompiler,
733
+ UI_COMPONENT_PRESETS: () => UI_COMPONENT_PRESETS
734
+ });
735
+ function isVfxParticleTraitName(name) {
736
+ return name.startsWith("vfx_particle_");
737
+ }
738
+ function vfxParticleEffect(name) {
739
+ return name.replace("vfx_particle_", "");
740
+ }
741
+ function gemResonanceConfig(config) {
742
+ return {
743
+ max_distance: 0.5,
744
+ base_frequencies: "auto",
745
+ blend_mode: "harmonic",
746
+ output: "spatial_audio",
747
+ ...config || {}
748
+ };
749
+ }
750
+ var r3fNodePool, MATERIAL_PRESETS, ENVIRONMENT_PRESETS, MESH_TYPES, UI_COMPONENT_PRESETS, QUALITY_TIER_SCALES, R3FCompiler;
751
+ var init_R3FCompiler = __esm({
752
+ "src/compiler/R3FCompiler.ts"() {
753
+ init_TraitCompositor();
754
+ init_ProvenanceSemiring();
755
+ init_visual();
756
+ init_DomainBlockCompilerMixin();
757
+ init_PlatformConditionalCompilerMixin();
758
+ init_AgentRBAC();
759
+ init_CompilerBase();
760
+ init_ObjectPool();
761
+ r3fNodePool = new ASTNodePool(
762
+ () => ({ type: "", props: {} }),
763
+ (node) => {
764
+ node.type = "";
765
+ node.id = void 0;
766
+ node.props = {};
767
+ node.children = void 0;
768
+ node.traits = void 0;
769
+ node.directives = void 0;
770
+ node.assetMaturity = void 0;
771
+ },
772
+ 0
773
+ // Was 20000 — demand-allocate instead of pre-allocating
774
+ );
775
+ MATERIAL_PRESETS = {
776
+ plastic: { roughness: 0.5, metalness: 0, clearcoat: 0.1 },
777
+ metal: { roughness: 0.2, metalness: 1 },
778
+ chrome: { roughness: 0.05, metalness: 1, envMapIntensity: 1.5 },
779
+ gold: { roughness: 0.3, metalness: 1, color: "#ffd700" },
780
+ copper: { roughness: 0.4, metalness: 1, color: "#b87333" },
781
+ glass: {
782
+ roughness: 0,
783
+ metalness: 0,
784
+ transmission: 0.95,
785
+ ior: 1.5,
786
+ thickness: 0.5,
787
+ transparent: true
788
+ },
789
+ crystal: {
790
+ roughness: 0,
791
+ metalness: 0.1,
792
+ transmission: 0.9,
793
+ ior: 2,
794
+ iridescence: 1,
795
+ iridescenceIOR: 1.3
796
+ },
797
+ wood: { roughness: 0.8, metalness: 0 },
798
+ fabric: {
799
+ roughness: 0.95,
800
+ metalness: 0,
801
+ sheen: 0.5,
802
+ sheenRoughness: 0.8,
803
+ sheenColor: "#ffffff"
804
+ },
805
+ rubber: { roughness: 0.9, metalness: 0 },
806
+ leather: {
807
+ roughness: 0.7,
808
+ metalness: 0,
809
+ sheen: 0.3,
810
+ sheenRoughness: 0.6,
811
+ sheenColor: "#3d2b1f"
812
+ },
813
+ water: {
814
+ roughness: 0,
815
+ metalness: 0,
816
+ transmission: 0.9,
817
+ ior: 1.33,
818
+ transparent: true,
819
+ color: "#006994"
820
+ },
821
+ emissive: { roughness: 0.5, metalness: 0, emissiveIntensity: 2 },
822
+ hologram: {
823
+ roughness: 0,
824
+ metalness: 0.3,
825
+ transparent: true,
826
+ opacity: 0.6,
827
+ emissiveIntensity: 1
828
+ },
829
+ stone: { roughness: 0.85, metalness: 0, color: "#808080" },
830
+ marble: { roughness: 0.15, metalness: 0, color: "#F0EDE6", envMapIntensity: 0.8 },
831
+ shiny: { roughness: 0.05, metalness: 0.3, envMapIntensity: 1.5, clearcoat: 0.8 },
832
+ neon: {
833
+ roughness: 0,
834
+ metalness: 0,
835
+ emissiveIntensity: 3,
836
+ transparent: true,
837
+ opacity: 0.9
838
+ },
839
+ toon: { roughness: 1, metalness: 0 },
840
+ wireframe: { roughness: 0.5, metalness: 0.5, wireframe: true },
841
+ velvet: {
842
+ roughness: 1,
843
+ metalness: 0,
844
+ sheen: 1,
845
+ sheenRoughness: 0.8,
846
+ sheenColor: "#ffffff",
847
+ clearcoat: 0.3
848
+ },
849
+ xray: { roughness: 0, metalness: 0, transparent: true, opacity: 0.3, emissiveIntensity: 0.5 },
850
+ gradient: { roughness: 0.5, metalness: 0 },
851
+ matte: { roughness: 1, metalness: 0 },
852
+ // ===========================================================================
853
+ // REALISTIC FABRICS — differentiated by sheen, roughness, and anisotropy
854
+ // ===========================================================================
855
+ cotton: {
856
+ roughness: 0.95,
857
+ metalness: 0,
858
+ sheen: 0.6,
859
+ sheenRoughness: 0.9,
860
+ sheenColor: "#ffffff"
861
+ },
862
+ polyester: {
863
+ roughness: 0.7,
864
+ metalness: 0,
865
+ sheen: 0.8,
866
+ sheenRoughness: 0.4,
867
+ sheenColor: "#e8e8e8"
868
+ },
869
+ silk: {
870
+ roughness: 0.3,
871
+ metalness: 0,
872
+ sheen: 1,
873
+ sheenRoughness: 0.2,
874
+ sheenColor: "#fffaf0",
875
+ anisotropy: 0.8,
876
+ anisotropyRotation: 0
877
+ },
878
+ satin: {
879
+ roughness: 0.25,
880
+ metalness: 0,
881
+ sheen: 0.9,
882
+ sheenRoughness: 0.15,
883
+ sheenColor: "#fff5ee",
884
+ anisotropy: 0.6,
885
+ anisotropyRotation: 0
886
+ },
887
+ linen: {
888
+ roughness: 0.9,
889
+ metalness: 0,
890
+ sheen: 0.4,
891
+ sheenRoughness: 0.85,
892
+ sheenColor: "#f5f0e8"
893
+ },
894
+ wool: {
895
+ roughness: 1,
896
+ metalness: 0,
897
+ sheen: 0.7,
898
+ sheenRoughness: 1,
899
+ sheenColor: "#e8dcc8"
900
+ },
901
+ denim: {
902
+ roughness: 0.85,
903
+ metalness: 0,
904
+ color: "#2b4570",
905
+ sheen: 0.5,
906
+ sheenRoughness: 0.7,
907
+ sheenColor: "#4a6fa5"
908
+ },
909
+ canvas: {
910
+ roughness: 0.95,
911
+ metalness: 0,
912
+ color: "#c8b88a",
913
+ sheen: 0.3,
914
+ sheenRoughness: 0.9,
915
+ sheenColor: "#d4c9a8"
916
+ },
917
+ burlap: {
918
+ roughness: 1,
919
+ metalness: 0,
920
+ color: "#8b7355",
921
+ sheen: 0.2,
922
+ sheenRoughness: 1,
923
+ sheenColor: "#a08060"
924
+ },
925
+ // ===========================================================================
926
+ // SKIN & ORGANIC — differentiated by subsurface scattering
927
+ // ===========================================================================
928
+ skin: {
929
+ roughness: 0.5,
930
+ metalness: 0,
931
+ color: "#e8b89d",
932
+ thickness: 0.8,
933
+ attenuationColor: "#cc4422",
934
+ attenuationDistance: 0.5
935
+ },
936
+ skin_dark: {
937
+ roughness: 0.45,
938
+ metalness: 0,
939
+ color: "#8d5524",
940
+ thickness: 1,
941
+ attenuationColor: "#661111",
942
+ attenuationDistance: 0.3
943
+ },
944
+ // Dragon / creature material presets
945
+ dragon_bone: {
946
+ roughness: 0.35,
947
+ metalness: 0.15,
948
+ color: "#e8dcc8"
949
+ },
950
+ dragon_leather: {
951
+ roughness: 0.8,
952
+ metalness: 0,
953
+ color: "#5c3a21"
954
+ },
955
+ dragon_scale: {
956
+ roughness: 0.25,
957
+ metalness: 0.4,
958
+ color: "#1a0d3d"
959
+ },
960
+ obsidian: {
961
+ roughness: 0.05,
962
+ metalness: 0.1,
963
+ color: "#0d0d0d",
964
+ clearcoat: 0.9,
965
+ clearcoatRoughness: 0.1,
966
+ envMapIntensity: 1.2
967
+ },
968
+ skin_pale: {
969
+ roughness: 0.55,
970
+ metalness: 0,
971
+ color: "#fde0c8",
972
+ thickness: 0.6,
973
+ attenuationColor: "#ee5533",
974
+ attenuationDistance: 0.6
975
+ },
976
+ candle_wax: {
977
+ roughness: 0.7,
978
+ metalness: 0,
979
+ color: "#fff8dc",
980
+ thickness: 2,
981
+ attenuationColor: "#ffaa44",
982
+ attenuationDistance: 0.3,
983
+ transmission: 0.15
984
+ },
985
+ jade: {
986
+ roughness: 0.2,
987
+ metalness: 0,
988
+ color: "#00a86b",
989
+ thickness: 1.5,
990
+ attenuationColor: "#004d32",
991
+ attenuationDistance: 1,
992
+ transmission: 0.1
993
+ },
994
+ milk: {
995
+ roughness: 0.3,
996
+ metalness: 0,
997
+ color: "#fdfff5",
998
+ thickness: 1,
999
+ attenuationColor: "#fff5d6",
1000
+ attenuationDistance: 0.2,
1001
+ transmission: 0.6,
1002
+ ior: 1.35
1003
+ },
1004
+ leaf: {
1005
+ roughness: 0.6,
1006
+ metalness: 0,
1007
+ color: "#228b22",
1008
+ thickness: 0.3,
1009
+ attenuationColor: "#44cc22",
1010
+ attenuationDistance: 0.5
1011
+ },
1012
+ honey: {
1013
+ roughness: 0.1,
1014
+ metalness: 0,
1015
+ color: "#eb9605",
1016
+ thickness: 1.5,
1017
+ attenuationColor: "#cc6600",
1018
+ attenuationDistance: 0.4,
1019
+ transmission: 0.7,
1020
+ ior: 1.5
1021
+ },
1022
+ // ===========================================================================
1023
+ // MUD & EARTH — differentiated by roughness, color, and subtle properties
1024
+ // ===========================================================================
1025
+ clay_mud: {
1026
+ roughness: 0.95,
1027
+ metalness: 0,
1028
+ color: "#8b4513",
1029
+ thickness: 0.5,
1030
+ attenuationColor: "#663311",
1031
+ attenuationDistance: 0.8
1032
+ },
1033
+ sandy_mud: {
1034
+ roughness: 0.85,
1035
+ metalness: 0.02,
1036
+ color: "#c2a66b"
1037
+ },
1038
+ wet_mud: {
1039
+ roughness: 0.4,
1040
+ metalness: 0,
1041
+ color: "#3d2b1f",
1042
+ clearcoat: 0.6,
1043
+ clearcoatRoughness: 0.2
1044
+ },
1045
+ dry_earth: {
1046
+ roughness: 1,
1047
+ metalness: 0,
1048
+ color: "#9b7653"
1049
+ },
1050
+ peat: {
1051
+ roughness: 0.9,
1052
+ metalness: 0,
1053
+ color: "#2d1f0e"
1054
+ },
1055
+ red_clay: {
1056
+ roughness: 0.95,
1057
+ metalness: 0,
1058
+ color: "#cc4b2e",
1059
+ thickness: 0.4,
1060
+ attenuationColor: "#993322",
1061
+ attenuationDistance: 0.6
1062
+ },
1063
+ volcanic_ash: {
1064
+ roughness: 0.8,
1065
+ metalness: 0.05,
1066
+ color: "#3c3c3c"
1067
+ },
1068
+ wet_sand: {
1069
+ roughness: 0.6,
1070
+ metalness: 0.02,
1071
+ color: "#c2b280",
1072
+ clearcoat: 0.3,
1073
+ clearcoatRoughness: 0.4
1074
+ },
1075
+ dry_sand: {
1076
+ roughness: 0.95,
1077
+ metalness: 0.02,
1078
+ color: "#e0cc8e"
1079
+ },
1080
+ // ===========================================================================
1081
+ // METALS (BRUSHED/ANISOTROPIC) — directional roughness
1082
+ // ===========================================================================
1083
+ brushed_steel: {
1084
+ roughness: 0.35,
1085
+ metalness: 1,
1086
+ color: "#c0c0c0",
1087
+ anisotropy: 0.7,
1088
+ anisotropyRotation: 0
1089
+ },
1090
+ brushed_aluminum: {
1091
+ roughness: 0.3,
1092
+ metalness: 1,
1093
+ color: "#d0d0d0",
1094
+ anisotropy: 0.8,
1095
+ anisotropyRotation: 0
1096
+ },
1097
+ brushed_copper: {
1098
+ roughness: 0.35,
1099
+ metalness: 1,
1100
+ color: "#b87333",
1101
+ anisotropy: 0.6,
1102
+ anisotropyRotation: 0
1103
+ },
1104
+ cast_iron: {
1105
+ roughness: 0.7,
1106
+ metalness: 0.9,
1107
+ color: "#3a3a3a"
1108
+ },
1109
+ bronze: {
1110
+ roughness: 0.45,
1111
+ metalness: 1,
1112
+ color: "#cd7f32"
1113
+ },
1114
+ silver: {
1115
+ roughness: 0.15,
1116
+ metalness: 1,
1117
+ color: "#c0c0c0",
1118
+ envMapIntensity: 1.3
1119
+ },
1120
+ platinum: {
1121
+ roughness: 0.2,
1122
+ metalness: 1,
1123
+ color: "#e5e4e2",
1124
+ envMapIntensity: 1.2
1125
+ },
1126
+ rust: {
1127
+ roughness: 0.9,
1128
+ metalness: 0.3,
1129
+ color: "#8b3a15"
1130
+ },
1131
+ // ===========================================================================
1132
+ // HAIR & FIBERS — anisotropy-driven
1133
+ // ===========================================================================
1134
+ hair_dark: {
1135
+ roughness: 0.35,
1136
+ metalness: 0,
1137
+ color: "#1a1209",
1138
+ anisotropy: 1,
1139
+ anisotropyRotation: Math.PI / 2,
1140
+ sheen: 0.3,
1141
+ sheenRoughness: 0.3,
1142
+ sheenColor: "#2a2219"
1143
+ },
1144
+ hair_blonde: {
1145
+ roughness: 0.3,
1146
+ metalness: 0,
1147
+ color: "#c8a55a",
1148
+ anisotropy: 1,
1149
+ anisotropyRotation: Math.PI / 2,
1150
+ sheen: 0.4,
1151
+ sheenRoughness: 0.25,
1152
+ sheenColor: "#d4b86a"
1153
+ },
1154
+ hair_red: {
1155
+ roughness: 0.35,
1156
+ metalness: 0,
1157
+ color: "#8b3a15",
1158
+ anisotropy: 1,
1159
+ anisotropyRotation: Math.PI / 2,
1160
+ sheen: 0.35,
1161
+ sheenRoughness: 0.3,
1162
+ sheenColor: "#a04520"
1163
+ },
1164
+ // ===========================================================================
1165
+ // WET SURFACES — clearcoat simulates water film
1166
+ // ===========================================================================
1167
+ wet_stone: {
1168
+ roughness: 0.3,
1169
+ metalness: 0,
1170
+ color: "#606060",
1171
+ clearcoat: 0.8,
1172
+ clearcoatRoughness: 0.1
1173
+ },
1174
+ wet_wood: {
1175
+ roughness: 0.4,
1176
+ metalness: 0,
1177
+ color: "#5a3a1a",
1178
+ clearcoat: 0.7,
1179
+ clearcoatRoughness: 0.15
1180
+ },
1181
+ wet_concrete: {
1182
+ roughness: 0.5,
1183
+ metalness: 0,
1184
+ color: "#707070",
1185
+ clearcoat: 0.5,
1186
+ clearcoatRoughness: 0.2
1187
+ },
1188
+ // ===========================================================================
1189
+ // FOOD & ORGANIC — SSS-heavy
1190
+ // ===========================================================================
1191
+ fruit: {
1192
+ roughness: 0.4,
1193
+ metalness: 0,
1194
+ color: "#ff4444",
1195
+ thickness: 0.8,
1196
+ attenuationColor: "#cc2200",
1197
+ attenuationDistance: 0.5,
1198
+ clearcoat: 0.3,
1199
+ clearcoatRoughness: 0.2
1200
+ },
1201
+ cheese: {
1202
+ roughness: 0.7,
1203
+ metalness: 0,
1204
+ color: "#ffc125",
1205
+ thickness: 1.2,
1206
+ attenuationColor: "#cc9900",
1207
+ attenuationDistance: 0.4
1208
+ },
1209
+ bread: {
1210
+ roughness: 0.95,
1211
+ metalness: 0,
1212
+ color: "#c4a35a",
1213
+ thickness: 0.3,
1214
+ attenuationColor: "#8b6914",
1215
+ attenuationDistance: 0.8
1216
+ },
1217
+ chocolate: {
1218
+ roughness: 0.5,
1219
+ metalness: 0,
1220
+ color: "#3b1e08",
1221
+ clearcoat: 0.2,
1222
+ clearcoatRoughness: 0.3
1223
+ },
1224
+ // ===========================================================================
1225
+ // COATED SURFACES — clearcoat-driven
1226
+ // ===========================================================================
1227
+ car_paint: {
1228
+ roughness: 0.1,
1229
+ metalness: 0,
1230
+ clearcoat: 1,
1231
+ clearcoatRoughness: 0.05
1232
+ },
1233
+ lacquer: {
1234
+ roughness: 0.05,
1235
+ metalness: 0,
1236
+ clearcoat: 1,
1237
+ clearcoatRoughness: 0.02
1238
+ },
1239
+ varnished_wood: {
1240
+ roughness: 0.3,
1241
+ metalness: 0,
1242
+ color: "#8b5e3c",
1243
+ clearcoat: 0.9,
1244
+ clearcoatRoughness: 0.1
1245
+ },
1246
+ glazed_ceramic: {
1247
+ roughness: 0.15,
1248
+ metalness: 0,
1249
+ color: "#f0ede6",
1250
+ clearcoat: 0.8,
1251
+ clearcoatRoughness: 0.05
1252
+ },
1253
+ enamel: {
1254
+ roughness: 0.1,
1255
+ metalness: 0,
1256
+ clearcoat: 0.9,
1257
+ clearcoatRoughness: 0.03
1258
+ },
1259
+ // ===========================================================================
1260
+ // IRIDESCENT — thin-film interference
1261
+ // ===========================================================================
1262
+ soap_bubble: {
1263
+ roughness: 0,
1264
+ metalness: 0,
1265
+ transmission: 0.9,
1266
+ ior: 1.33,
1267
+ transparent: true,
1268
+ opacity: 0.3,
1269
+ iridescence: 1,
1270
+ iridescenceIOR: 1.5
1271
+ },
1272
+ oil_slick: {
1273
+ roughness: 0,
1274
+ metalness: 0.1,
1275
+ color: "#1a1a2e",
1276
+ iridescence: 1,
1277
+ iridescenceIOR: 1.8
1278
+ },
1279
+ beetle_shell: {
1280
+ roughness: 0.2,
1281
+ metalness: 0.3,
1282
+ color: "#0a3d0a",
1283
+ iridescence: 0.8,
1284
+ iridescenceIOR: 1.6,
1285
+ clearcoat: 0.5,
1286
+ clearcoatRoughness: 0.1
1287
+ },
1288
+ pearl: {
1289
+ roughness: 0.15,
1290
+ metalness: 0,
1291
+ color: "#fdeef4",
1292
+ iridescence: 0.6,
1293
+ iridescenceIOR: 1.3,
1294
+ sheen: 0.3,
1295
+ sheenRoughness: 0.2,
1296
+ sheenColor: "#fff0f5"
1297
+ },
1298
+ abalone: {
1299
+ roughness: 0.1,
1300
+ metalness: 0.1,
1301
+ color: "#e0f0e8",
1302
+ iridescence: 1,
1303
+ iridescenceIOR: 1.5
1304
+ },
1305
+ // ===========================================================================
1306
+ // GEMSTONES — transmission + IOR + iridescence
1307
+ // ===========================================================================
1308
+ diamond: {
1309
+ roughness: 0,
1310
+ metalness: 0,
1311
+ color: "#ffffff",
1312
+ transmission: 0.95,
1313
+ ior: 2.417,
1314
+ thickness: 0.5,
1315
+ transparent: true
1316
+ },
1317
+ ruby: {
1318
+ roughness: 0.05,
1319
+ metalness: 0,
1320
+ color: "#e0115f",
1321
+ transmission: 0.4,
1322
+ ior: 1.76,
1323
+ thickness: 1
1324
+ },
1325
+ sapphire: {
1326
+ roughness: 0.05,
1327
+ metalness: 0,
1328
+ color: "#0f52ba",
1329
+ transmission: 0.4,
1330
+ ior: 1.77,
1331
+ thickness: 1
1332
+ },
1333
+ emerald: {
1334
+ roughness: 0.1,
1335
+ metalness: 0,
1336
+ color: "#50c878",
1337
+ transmission: 0.3,
1338
+ ior: 1.57,
1339
+ thickness: 1.2
1340
+ },
1341
+ amber: {
1342
+ roughness: 0.1,
1343
+ metalness: 0,
1344
+ color: "#ffbf00",
1345
+ transmission: 0.6,
1346
+ ior: 1.55,
1347
+ thickness: 2,
1348
+ transparent: true,
1349
+ attenuationColor: "#cc6600",
1350
+ attenuationDistance: 1
1351
+ },
1352
+ opal: {
1353
+ roughness: 0.15,
1354
+ metalness: 0,
1355
+ color: "#e8e0d0",
1356
+ iridescence: 0.9,
1357
+ iridescenceIOR: 1.45,
1358
+ transmission: 0.1,
1359
+ ior: 1.45
1360
+ },
1361
+ amethyst: {
1362
+ roughness: 0.05,
1363
+ metalness: 0,
1364
+ color: "#9966cc",
1365
+ transmission: 0.5,
1366
+ ior: 1.54,
1367
+ thickness: 1,
1368
+ transparent: true
1369
+ },
1370
+ topaz: {
1371
+ roughness: 0.02,
1372
+ metalness: 0,
1373
+ color: "#ffc87c",
1374
+ transmission: 0.7,
1375
+ ior: 1.63,
1376
+ thickness: 0.8,
1377
+ transparent: true
1378
+ },
1379
+ turquoise: {
1380
+ roughness: 0.6,
1381
+ metalness: 0,
1382
+ color: "#40e0d0"
1383
+ },
1384
+ lapis_lazuli: {
1385
+ roughness: 0.4,
1386
+ metalness: 0,
1387
+ color: "#26619c",
1388
+ clearcoat: 0.3,
1389
+ clearcoatRoughness: 0.1
1390
+ },
1391
+ // ===========================================================================
1392
+ // MORE METALS — extended metallic palette
1393
+ // ===========================================================================
1394
+ titanium: {
1395
+ roughness: 0.25,
1396
+ metalness: 1,
1397
+ color: "#878681"
1398
+ },
1399
+ tungsten: {
1400
+ roughness: 0.3,
1401
+ metalness: 1,
1402
+ color: "#696969"
1403
+ },
1404
+ tin: {
1405
+ roughness: 0.35,
1406
+ metalness: 1,
1407
+ color: "#b0b0b0",
1408
+ envMapIntensity: 0.8
1409
+ },
1410
+ lead: {
1411
+ roughness: 0.6,
1412
+ metalness: 0.9,
1413
+ color: "#595959"
1414
+ },
1415
+ brass: {
1416
+ roughness: 0.35,
1417
+ metalness: 1,
1418
+ color: "#b5a642"
1419
+ },
1420
+ wrought_iron: {
1421
+ roughness: 0.7,
1422
+ metalness: 0.85,
1423
+ color: "#2c2c2c"
1424
+ },
1425
+ mercury: {
1426
+ roughness: 0,
1427
+ metalness: 1,
1428
+ color: "#d4d4d4",
1429
+ envMapIntensity: 2
1430
+ },
1431
+ // ===========================================================================
1432
+ // NATURAL / WEATHER — environmental surfaces
1433
+ // ===========================================================================
1434
+ snow: {
1435
+ roughness: 0.8,
1436
+ metalness: 0,
1437
+ color: "#f0f8ff",
1438
+ thickness: 0.5,
1439
+ attenuationColor: "#c8e0ff",
1440
+ attenuationDistance: 2
1441
+ },
1442
+ fresh_snow: {
1443
+ roughness: 0.6,
1444
+ metalness: 0,
1445
+ color: "#ffffff",
1446
+ sheen: 0.3,
1447
+ sheenRoughness: 0.5,
1448
+ sheenColor: "#e8f0ff"
1449
+ },
1450
+ frost: {
1451
+ roughness: 0.3,
1452
+ metalness: 0,
1453
+ color: "#e8f4f8",
1454
+ transmission: 0.15,
1455
+ ior: 1.31,
1456
+ clearcoat: 0.4,
1457
+ clearcoatRoughness: 0.1
1458
+ },
1459
+ ice: {
1460
+ roughness: 0.1,
1461
+ metalness: 0,
1462
+ color: "#d6eaf8",
1463
+ transmission: 0.8,
1464
+ ior: 1.31,
1465
+ transparent: true
1466
+ },
1467
+ moss: {
1468
+ roughness: 1,
1469
+ metalness: 0,
1470
+ color: "#4a7c3f",
1471
+ sheen: 0.2,
1472
+ sheenRoughness: 1,
1473
+ sheenColor: "#5a9c4f"
1474
+ },
1475
+ lichen: {
1476
+ roughness: 0.9,
1477
+ metalness: 0,
1478
+ color: "#8fa37a"
1479
+ },
1480
+ bark: {
1481
+ roughness: 0.95,
1482
+ metalness: 0,
1483
+ color: "#5c4033"
1484
+ },
1485
+ dried_leaves: {
1486
+ roughness: 0.9,
1487
+ metalness: 0,
1488
+ color: "#8b6914",
1489
+ thickness: 0.1,
1490
+ attenuationColor: "#664400",
1491
+ attenuationDistance: 0.3
1492
+ },
1493
+ // ===========================================================================
1494
+ // AGED / WEATHERED — patina, tarnish, wear
1495
+ // ===========================================================================
1496
+ patina: {
1497
+ roughness: 0.6,
1498
+ metalness: 0.4,
1499
+ color: "#4a9c7e"
1500
+ },
1501
+ tarnished_silver: {
1502
+ roughness: 0.5,
1503
+ metalness: 0.7,
1504
+ color: "#8a8a7a"
1505
+ },
1506
+ aged_bronze: {
1507
+ roughness: 0.55,
1508
+ metalness: 0.6,
1509
+ color: "#6b8e5a"
1510
+ },
1511
+ weathered_wood: {
1512
+ roughness: 0.95,
1513
+ metalness: 0,
1514
+ color: "#8a8070"
1515
+ },
1516
+ cracked_paint: {
1517
+ roughness: 0.8,
1518
+ metalness: 0,
1519
+ color: "#c8c0b0"
1520
+ },
1521
+ oxidized_copper: {
1522
+ roughness: 0.65,
1523
+ metalness: 0.5,
1524
+ color: "#2e8b57"
1525
+ },
1526
+ // ===========================================================================
1527
+ // CONSTRUCTION — architectural materials
1528
+ // ===========================================================================
1529
+ asphalt: {
1530
+ roughness: 0.9,
1531
+ metalness: 0,
1532
+ color: "#3a3a3a"
1533
+ },
1534
+ cement: {
1535
+ roughness: 0.85,
1536
+ metalness: 0,
1537
+ color: "#a0a0a0"
1538
+ },
1539
+ tile_ceramic: {
1540
+ roughness: 0.2,
1541
+ metalness: 0,
1542
+ color: "#e8e0d0",
1543
+ clearcoat: 0.6,
1544
+ clearcoatRoughness: 0.05
1545
+ },
1546
+ tile_porcelain: {
1547
+ roughness: 0.1,
1548
+ metalness: 0,
1549
+ color: "#f5f5f5",
1550
+ clearcoat: 0.8,
1551
+ clearcoatRoughness: 0.02
1552
+ },
1553
+ linoleum: {
1554
+ roughness: 0.6,
1555
+ metalness: 0,
1556
+ color: "#c0b090",
1557
+ clearcoat: 0.2,
1558
+ clearcoatRoughness: 0.3
1559
+ },
1560
+ drywall: {
1561
+ roughness: 1,
1562
+ metalness: 0,
1563
+ color: "#f0ece0"
1564
+ },
1565
+ rebar: {
1566
+ roughness: 0.6,
1567
+ metalness: 0.9,
1568
+ color: "#5a4a3a"
1569
+ },
1570
+ stucco: {
1571
+ roughness: 0.95,
1572
+ metalness: 0,
1573
+ color: "#e8dcc8"
1574
+ },
1575
+ gravel: {
1576
+ roughness: 1,
1577
+ metalness: 0.02,
1578
+ color: "#8a8070"
1579
+ },
1580
+ // ===========================================================================
1581
+ // LEATHER VARIANTS — sheen + clearcoat differentiation
1582
+ // ===========================================================================
1583
+ suede: {
1584
+ roughness: 1,
1585
+ metalness: 0,
1586
+ color: "#8b6914",
1587
+ sheen: 0.6,
1588
+ sheenRoughness: 1,
1589
+ sheenColor: "#a07828"
1590
+ },
1591
+ patent_leather: {
1592
+ roughness: 0.05,
1593
+ metalness: 0,
1594
+ color: "#1a1a1a",
1595
+ clearcoat: 1,
1596
+ clearcoatRoughness: 0.02
1597
+ },
1598
+ distressed_leather: {
1599
+ roughness: 0.8,
1600
+ metalness: 0,
1601
+ color: "#5a3a1a",
1602
+ sheen: 0.15,
1603
+ sheenRoughness: 0.8,
1604
+ sheenColor: "#4a3010"
1605
+ },
1606
+ nubuck: {
1607
+ roughness: 0.95,
1608
+ metalness: 0,
1609
+ color: "#c8a882",
1610
+ sheen: 0.5,
1611
+ sheenRoughness: 0.9,
1612
+ sheenColor: "#d4b892"
1613
+ },
1614
+ // ===========================================================================
1615
+ // RUBBER VARIANTS
1616
+ // ===========================================================================
1617
+ tire_rubber: {
1618
+ roughness: 0.85,
1619
+ metalness: 0,
1620
+ color: "#1a1a1a"
1621
+ },
1622
+ silicone: {
1623
+ roughness: 0.6,
1624
+ metalness: 0,
1625
+ color: "#e0e0e0",
1626
+ thickness: 0.5,
1627
+ attenuationColor: "#cccccc",
1628
+ attenuationDistance: 1,
1629
+ transmission: 0.05
1630
+ },
1631
+ latex: {
1632
+ roughness: 0.3,
1633
+ metalness: 0,
1634
+ color: "#ffefd5",
1635
+ clearcoat: 0.5,
1636
+ clearcoatRoughness: 0.1,
1637
+ thickness: 0.3,
1638
+ attenuationColor: "#ffcc88",
1639
+ attenuationDistance: 0.5
1640
+ },
1641
+ eraser: {
1642
+ roughness: 0.95,
1643
+ metalness: 0,
1644
+ color: "#ff6b81"
1645
+ },
1646
+ // ===========================================================================
1647
+ // LIQUIDS — transmission + animated surface hints
1648
+ // ===========================================================================
1649
+ lava: {
1650
+ roughness: 0.8,
1651
+ metalness: 0,
1652
+ color: "#ff4400",
1653
+ emissive: "#ff2200",
1654
+ emissiveIntensity: 3
1655
+ },
1656
+ blood: {
1657
+ roughness: 0.2,
1658
+ metalness: 0,
1659
+ color: "#8b0000",
1660
+ clearcoat: 0.7,
1661
+ clearcoatRoughness: 0.05,
1662
+ thickness: 1,
1663
+ attenuationColor: "#440000",
1664
+ attenuationDistance: 0.3
1665
+ },
1666
+ oil_liquid: {
1667
+ roughness: 0.05,
1668
+ metalness: 0,
1669
+ color: "#1a1a0a",
1670
+ clearcoat: 0.9,
1671
+ clearcoatRoughness: 0.02
1672
+ },
1673
+ molten_metal: {
1674
+ roughness: 0.15,
1675
+ metalness: 0.8,
1676
+ color: "#ff8c00",
1677
+ emissive: "#ff6600",
1678
+ emissiveIntensity: 5
1679
+ },
1680
+ syrup: {
1681
+ roughness: 0.1,
1682
+ metalness: 0,
1683
+ color: "#8b4513",
1684
+ transmission: 0.4,
1685
+ ior: 1.49,
1686
+ thickness: 2,
1687
+ attenuationColor: "#663300",
1688
+ attenuationDistance: 0.5
1689
+ },
1690
+ // ===========================================================================
1691
+ // BLACKBODY / THERMAL — temperature-driven emission
1692
+ // ===========================================================================
1693
+ heated_metal_low: {
1694
+ roughness: 0.5,
1695
+ metalness: 0.9,
1696
+ color: "#4a4a4a",
1697
+ emissive: "#ff1a00",
1698
+ emissiveIntensity: 1.5
1699
+ },
1700
+ heated_metal_mid: {
1701
+ roughness: 0.4,
1702
+ metalness: 0.8,
1703
+ color: "#5a5a5a",
1704
+ emissive: "#ff6600",
1705
+ emissiveIntensity: 3
1706
+ },
1707
+ heated_metal_hot: {
1708
+ roughness: 0.3,
1709
+ metalness: 0.7,
1710
+ color: "#6a6a6a",
1711
+ emissive: "#ffcc00",
1712
+ emissiveIntensity: 5
1713
+ },
1714
+ heated_metal_white: {
1715
+ roughness: 0.2,
1716
+ metalness: 0.6,
1717
+ color: "#8a8a8a",
1718
+ emissive: "#ffffff",
1719
+ emissiveIntensity: 8
1720
+ },
1721
+ ember: {
1722
+ roughness: 0.9,
1723
+ metalness: 0,
1724
+ color: "#2a0a00",
1725
+ emissive: "#ff4400",
1726
+ emissiveIntensity: 2
1727
+ },
1728
+ coal: {
1729
+ roughness: 0.85,
1730
+ metalness: 0,
1731
+ color: "#1a1a1a",
1732
+ emissive: "#cc2200",
1733
+ emissiveIntensity: 0.5
1734
+ },
1735
+ // ===========================================================================
1736
+ // SPECIAL EFFECTS — sparkle, glow, energy
1737
+ // ===========================================================================
1738
+ glitter: {
1739
+ roughness: 0.2,
1740
+ metalness: 0.8,
1741
+ color: "#ffd700",
1742
+ envMapIntensity: 2
1743
+ },
1744
+ sequin: {
1745
+ roughness: 0.05,
1746
+ metalness: 1,
1747
+ envMapIntensity: 2.5,
1748
+ iridescence: 0.3
1749
+ },
1750
+ mica: {
1751
+ roughness: 0.3,
1752
+ metalness: 0.2,
1753
+ color: "#c8b888",
1754
+ iridescence: 0.4,
1755
+ iridescenceIOR: 1.58,
1756
+ sheen: 0.2,
1757
+ sheenRoughness: 0.3,
1758
+ sheenColor: "#d4c498"
1759
+ },
1760
+ fluorescent_green: {
1761
+ roughness: 0.5,
1762
+ metalness: 0,
1763
+ color: "#39ff14",
1764
+ emissive: "#39ff14",
1765
+ emissiveIntensity: 1.5
1766
+ },
1767
+ fluorescent_orange: {
1768
+ roughness: 0.5,
1769
+ metalness: 0,
1770
+ color: "#ff6700",
1771
+ emissive: "#ff6700",
1772
+ emissiveIntensity: 1.5
1773
+ },
1774
+ fluorescent_pink: {
1775
+ roughness: 0.5,
1776
+ metalness: 0,
1777
+ color: "#ff1493",
1778
+ emissive: "#ff1493",
1779
+ emissiveIntensity: 1.5
1780
+ },
1781
+ glow_in_dark: {
1782
+ roughness: 0.7,
1783
+ metalness: 0,
1784
+ color: "#2a3a2a",
1785
+ emissive: "#44ff44",
1786
+ emissiveIntensity: 0.8
1787
+ },
1788
+ plasma: {
1789
+ roughness: 0,
1790
+ metalness: 0,
1791
+ color: "#4400ff",
1792
+ emissive: "#8844ff",
1793
+ emissiveIntensity: 4,
1794
+ transparent: true,
1795
+ opacity: 0.7
1796
+ },
1797
+ energy_field: {
1798
+ roughness: 0,
1799
+ metalness: 0,
1800
+ emissive: "#00ccff",
1801
+ emissiveIntensity: 3,
1802
+ transparent: true,
1803
+ opacity: 0.4,
1804
+ transmission: 0.6
1805
+ },
1806
+ force_field: {
1807
+ roughness: 0,
1808
+ metalness: 0,
1809
+ emissive: "#00ff88",
1810
+ emissiveIntensity: 2,
1811
+ transparent: true,
1812
+ opacity: 0.2,
1813
+ iridescence: 0.8,
1814
+ iridescenceIOR: 1.5
1815
+ },
1816
+ // ===========================================================================
1817
+ // RETROREFLECTIVE — safety, signage
1818
+ // ===========================================================================
1819
+ safety_vest: {
1820
+ roughness: 0.6,
1821
+ metalness: 0,
1822
+ color: "#ccff00",
1823
+ emissive: "#ccff00",
1824
+ emissiveIntensity: 0.3
1825
+ },
1826
+ road_sign: {
1827
+ roughness: 0.4,
1828
+ metalness: 0.1,
1829
+ color: "#ffffff",
1830
+ envMapIntensity: 1.8,
1831
+ emissive: "#ffffff",
1832
+ emissiveIntensity: 0.2
1833
+ },
1834
+ reflective_tape: {
1835
+ roughness: 0.2,
1836
+ metalness: 0.3,
1837
+ color: "#e0e0e0",
1838
+ envMapIntensity: 2.5
1839
+ },
1840
+ // ===========================================================================
1841
+ // MISC — everything else in the real world
1842
+ // ===========================================================================
1843
+ chalkboard: {
1844
+ roughness: 0.9,
1845
+ metalness: 0,
1846
+ color: "#2a3a2a"
1847
+ },
1848
+ chalk: {
1849
+ roughness: 1,
1850
+ metalness: 0,
1851
+ color: "#ffffff"
1852
+ },
1853
+ charcoal: {
1854
+ roughness: 0.9,
1855
+ metalness: 0,
1856
+ color: "#1a1a1a"
1857
+ },
1858
+ cork: {
1859
+ roughness: 0.95,
1860
+ metalness: 0,
1861
+ color: "#b88a50"
1862
+ },
1863
+ felt: {
1864
+ roughness: 1,
1865
+ metalness: 0,
1866
+ color: "#5a8a5a",
1867
+ sheen: 0.4,
1868
+ sheenRoughness: 1,
1869
+ sheenColor: "#6a9a6a"
1870
+ },
1871
+ sponge: {
1872
+ roughness: 1,
1873
+ metalness: 0,
1874
+ color: "#e8c840"
1875
+ },
1876
+ porcelain: {
1877
+ roughness: 0.1,
1878
+ metalness: 0,
1879
+ color: "#f8f4f0",
1880
+ clearcoat: 0.7,
1881
+ clearcoatRoughness: 0.02
1882
+ },
1883
+ terracotta: {
1884
+ roughness: 0.85,
1885
+ metalness: 0,
1886
+ color: "#cc6644"
1887
+ },
1888
+ concrete_polished: {
1889
+ roughness: 0.3,
1890
+ metalness: 0,
1891
+ color: "#a0a0a0",
1892
+ clearcoat: 0.3,
1893
+ clearcoatRoughness: 0.15
1894
+ },
1895
+ rope: {
1896
+ roughness: 1,
1897
+ metalness: 0,
1898
+ color: "#c4a35a",
1899
+ sheen: 0.2,
1900
+ sheenRoughness: 1,
1901
+ sheenColor: "#b89848"
1902
+ },
1903
+ wicker: {
1904
+ roughness: 0.9,
1905
+ metalness: 0,
1906
+ color: "#a08050"
1907
+ },
1908
+ parchment: {
1909
+ roughness: 0.8,
1910
+ metalness: 0,
1911
+ color: "#f0e6c8",
1912
+ thickness: 0.1,
1913
+ attenuationColor: "#d4c0a0",
1914
+ attenuationDistance: 0.2
1915
+ },
1916
+ // ===========================================================================
1917
+ // ANIMATED MATERIALS — time-driven surface effects (wired to scene.time)
1918
+ // These set metadata flags that the runtime uses to drive animated shaders.
1919
+ // ===========================================================================
1920
+ flowing_water: {
1921
+ roughness: 0,
1922
+ metalness: 0,
1923
+ color: "#006994",
1924
+ transmission: 0.85,
1925
+ ior: 1.33,
1926
+ transparent: true,
1927
+ _animated: { pattern: "flow", speed: 0.8, amplitude: 0.3 }
1928
+ },
1929
+ rippling_water: {
1930
+ roughness: 0.05,
1931
+ metalness: 0,
1932
+ color: "#005577",
1933
+ transmission: 0.8,
1934
+ ior: 1.33,
1935
+ transparent: true,
1936
+ _animated: { pattern: "ripple", speed: 1, amplitude: 0.4 }
1937
+ },
1938
+ flickering_fire: {
1939
+ roughness: 0.8,
1940
+ metalness: 0,
1941
+ color: "#ff4400",
1942
+ emissive: "#ff2200",
1943
+ emissiveIntensity: 3,
1944
+ _animated: { pattern: "flicker", speed: 3, amplitude: 0.6 }
1945
+ },
1946
+ pulsing_glow: {
1947
+ roughness: 0.5,
1948
+ metalness: 0,
1949
+ emissive: "#00ff88",
1950
+ emissiveIntensity: 2,
1951
+ _animated: { pattern: "pulse", speed: 1.5, amplitude: 0.5 }
1952
+ },
1953
+ breathing_light: {
1954
+ roughness: 0.3,
1955
+ metalness: 0,
1956
+ emissive: "#4488ff",
1957
+ emissiveIntensity: 1.5,
1958
+ _animated: { pattern: "breathe", speed: 0.5, amplitude: 0.8 }
1959
+ },
1960
+ scrolling_lava: {
1961
+ roughness: 0.8,
1962
+ metalness: 0,
1963
+ color: "#ff4400",
1964
+ emissive: "#ff2200",
1965
+ emissiveIntensity: 4,
1966
+ _animated: { pattern: "scroll", speed: 0.3, amplitude: 1 }
1967
+ },
1968
+ waving_grass: {
1969
+ roughness: 0.9,
1970
+ metalness: 0,
1971
+ color: "#228b22",
1972
+ sheen: 0.2,
1973
+ sheenRoughness: 0.8,
1974
+ sheenColor: "#44cc22",
1975
+ _animated: { pattern: "wave", speed: 0.8, amplitude: 0.2 }
1976
+ },
1977
+ flickering_neon: {
1978
+ roughness: 0,
1979
+ metalness: 0,
1980
+ emissive: "#ff00ff",
1981
+ emissiveIntensity: 3.5,
1982
+ transparent: true,
1983
+ opacity: 0.9,
1984
+ _animated: { pattern: "flicker", speed: 5, amplitude: 0.4 }
1985
+ },
1986
+ pulsing_crystal: {
1987
+ roughness: 0,
1988
+ metalness: 0.1,
1989
+ transmission: 0.8,
1990
+ ior: 2,
1991
+ iridescence: 0.8,
1992
+ iridescenceIOR: 1.3,
1993
+ emissive: "#8844ff",
1994
+ emissiveIntensity: 1,
1995
+ _animated: { pattern: "pulse", speed: 0.8, amplitude: 0.6 }
1996
+ },
1997
+ animated_hologram: {
1998
+ roughness: 0,
1999
+ metalness: 0.3,
2000
+ transparent: true,
2001
+ opacity: 0.5,
2002
+ emissive: "#00ccff",
2003
+ emissiveIntensity: 1.5,
2004
+ _animated: { pattern: "scroll", speed: 1.5, amplitude: 0.3 }
2005
+ },
2006
+ boiling_surface: {
2007
+ roughness: 0.7,
2008
+ metalness: 0,
2009
+ color: "#cc4400",
2010
+ emissive: "#ff6600",
2011
+ emissiveIntensity: 2,
2012
+ _animated: { pattern: "noise", speed: 2, amplitude: 0.5 }
2013
+ },
2014
+ shimmer_heat: {
2015
+ roughness: 0,
2016
+ metalness: 0,
2017
+ transparent: true,
2018
+ opacity: 0.15,
2019
+ _animated: { pattern: "wave", speed: 2, amplitude: 0.1 }
2020
+ },
2021
+ // ===========================================================================
2022
+ // VOLUMETRIC MATERIALS — metadata for ray-marched volume rendering
2023
+ // These presets describe volumetric phenomena; the runtime renders them via
2024
+ // a ray marching pass on a bounding box/sphere geometry.
2025
+ // ===========================================================================
2026
+ fog: {
2027
+ roughness: 0,
2028
+ metalness: 0,
2029
+ color: "#c0c0c0",
2030
+ transparent: true,
2031
+ opacity: 0.3,
2032
+ _volumetric: { type: "fog", density: 0.3, scattering: 0.8, absorption: 0.05 }
2033
+ },
2034
+ dense_fog: {
2035
+ roughness: 0,
2036
+ metalness: 0,
2037
+ color: "#a0a0a0",
2038
+ transparent: true,
2039
+ opacity: 0.5,
2040
+ _volumetric: { type: "fog", density: 0.7, scattering: 0.9, absorption: 0.1 }
2041
+ },
2042
+ smoke: {
2043
+ roughness: 0,
2044
+ metalness: 0,
2045
+ color: "#404040",
2046
+ transparent: true,
2047
+ opacity: 0.4,
2048
+ _volumetric: {
2049
+ type: "smoke",
2050
+ density: 0.5,
2051
+ scattering: 0.3,
2052
+ absorption: 0.4,
2053
+ riseSpeed: 0.5,
2054
+ turbulence: 0.6
2055
+ }
2056
+ },
2057
+ campfire_smoke: {
2058
+ roughness: 0,
2059
+ metalness: 0,
2060
+ color: "#505050",
2061
+ transparent: true,
2062
+ opacity: 0.35,
2063
+ _volumetric: {
2064
+ type: "smoke",
2065
+ density: 0.4,
2066
+ scattering: 0.25,
2067
+ absorption: 0.5,
2068
+ riseSpeed: 0.8,
2069
+ turbulence: 0.4
2070
+ }
2071
+ },
2072
+ fire_volume: {
2073
+ roughness: 0,
2074
+ metalness: 0,
2075
+ color: "#ff4400",
2076
+ emissive: "#ff2200",
2077
+ emissiveIntensity: 4,
2078
+ transparent: true,
2079
+ opacity: 0.7,
2080
+ _volumetric: {
2081
+ type: "fire",
2082
+ density: 0.6,
2083
+ scattering: 0.1,
2084
+ absorption: 0.2,
2085
+ riseSpeed: 1.2,
2086
+ turbulence: 0.7,
2087
+ temperature: 2500
2088
+ }
2089
+ },
2090
+ candle_flame: {
2091
+ roughness: 0,
2092
+ metalness: 0,
2093
+ color: "#ffaa33",
2094
+ emissive: "#ff8800",
2095
+ emissiveIntensity: 3,
2096
+ transparent: true,
2097
+ opacity: 0.6,
2098
+ _volumetric: {
2099
+ type: "fire",
2100
+ density: 0.4,
2101
+ scattering: 0.05,
2102
+ absorption: 0.1,
2103
+ riseSpeed: 0.3,
2104
+ turbulence: 0.2,
2105
+ temperature: 1800
2106
+ }
2107
+ },
2108
+ clouds: {
2109
+ roughness: 0,
2110
+ metalness: 0,
2111
+ color: "#ffffff",
2112
+ transparent: true,
2113
+ opacity: 0.6,
2114
+ _volumetric: {
2115
+ type: "clouds",
2116
+ density: 0.4,
2117
+ scattering: 0.95,
2118
+ absorption: 0.02,
2119
+ noiseScale: 2,
2120
+ octaves: 6
2121
+ }
2122
+ },
2123
+ storm_clouds: {
2124
+ roughness: 0,
2125
+ metalness: 0,
2126
+ color: "#3a3a4a",
2127
+ transparent: true,
2128
+ opacity: 0.8,
2129
+ _volumetric: {
2130
+ type: "clouds",
2131
+ density: 0.7,
2132
+ scattering: 0.6,
2133
+ absorption: 0.15,
2134
+ noiseScale: 1.5,
2135
+ octaves: 6
2136
+ }
2137
+ },
2138
+ dust_motes: {
2139
+ roughness: 0,
2140
+ metalness: 0,
2141
+ color: "#c8b888",
2142
+ transparent: true,
2143
+ opacity: 0.15,
2144
+ _volumetric: { type: "dust", density: 0.1, scattering: 0.5, absorption: 0.02 }
2145
+ },
2146
+ mist: {
2147
+ roughness: 0,
2148
+ metalness: 0,
2149
+ color: "#e0e8f0",
2150
+ transparent: true,
2151
+ opacity: 0.25,
2152
+ _volumetric: {
2153
+ type: "mist",
2154
+ density: 0.2,
2155
+ scattering: 0.85,
2156
+ absorption: 0.03,
2157
+ heightFalloff: 1.5
2158
+ }
2159
+ },
2160
+ steam: {
2161
+ roughness: 0,
2162
+ metalness: 0,
2163
+ color: "#e8e8e8",
2164
+ transparent: true,
2165
+ opacity: 0.3,
2166
+ _volumetric: {
2167
+ type: "steam",
2168
+ density: 0.35,
2169
+ scattering: 0.7,
2170
+ absorption: 0.05,
2171
+ riseSpeed: 1,
2172
+ turbulence: 0.3
2173
+ }
2174
+ },
2175
+ aurora_borealis: {
2176
+ roughness: 0,
2177
+ metalness: 0,
2178
+ emissive: "#00ff88",
2179
+ emissiveIntensity: 2,
2180
+ transparent: true,
2181
+ opacity: 0.3,
2182
+ _volumetric: {
2183
+ type: "aurora",
2184
+ density: 0.15,
2185
+ scattering: 0.1,
2186
+ absorption: 0.01,
2187
+ emissionIntensity: 2
2188
+ }
2189
+ },
2190
+ nebula: {
2191
+ roughness: 0,
2192
+ metalness: 0,
2193
+ emissive: "#ff44aa",
2194
+ emissiveIntensity: 1.5,
2195
+ transparent: true,
2196
+ opacity: 0.4,
2197
+ _volumetric: {
2198
+ type: "nebula",
2199
+ density: 0.25,
2200
+ scattering: 0.3,
2201
+ absorption: 0.05,
2202
+ emissionIntensity: 1.5,
2203
+ noiseScale: 1
2204
+ }
2205
+ },
2206
+ underwater_caustics: {
2207
+ roughness: 0,
2208
+ metalness: 0,
2209
+ color: "#003366",
2210
+ transparent: true,
2211
+ opacity: 0.2,
2212
+ _volumetric: { type: "underwater", density: 0.15, scattering: 0.6, absorption: 0.1 }
2213
+ },
2214
+ god_rays: {
2215
+ roughness: 0,
2216
+ metalness: 0,
2217
+ color: "#ffffd0",
2218
+ transparent: true,
2219
+ opacity: 0.15,
2220
+ emissive: "#ffff88",
2221
+ emissiveIntensity: 0.5,
2222
+ _volumetric: { type: "god_rays", density: 0.1, scattering: 0.9, absorption: 0.01 }
2223
+ },
2224
+ neon_gas: {
2225
+ roughness: 0,
2226
+ metalness: 0,
2227
+ emissive: "#ff4400",
2228
+ emissiveIntensity: 3,
2229
+ transparent: true,
2230
+ opacity: 0.5,
2231
+ _volumetric: {
2232
+ type: "neon_gas",
2233
+ density: 0.3,
2234
+ scattering: 0.2,
2235
+ absorption: 0.05,
2236
+ emissionIntensity: 3
2237
+ }
2238
+ },
2239
+ explosion: {
2240
+ roughness: 0,
2241
+ metalness: 0,
2242
+ color: "#ff6600",
2243
+ emissive: "#ff4400",
2244
+ emissiveIntensity: 6,
2245
+ transparent: true,
2246
+ opacity: 0.8,
2247
+ _volumetric: {
2248
+ type: "fire",
2249
+ density: 0.8,
2250
+ scattering: 0.15,
2251
+ absorption: 0.3,
2252
+ riseSpeed: 2,
2253
+ turbulence: 1,
2254
+ temperature: 4e3
2255
+ }
2256
+ },
2257
+ toxic_gas: {
2258
+ roughness: 0,
2259
+ metalness: 0,
2260
+ color: "#44cc00",
2261
+ emissive: "#33aa00",
2262
+ emissiveIntensity: 1,
2263
+ transparent: true,
2264
+ opacity: 0.35,
2265
+ _volumetric: {
2266
+ type: "smoke",
2267
+ density: 0.3,
2268
+ scattering: 0.4,
2269
+ absorption: 0.2,
2270
+ riseSpeed: 0.2,
2271
+ turbulence: 0.3
2272
+ }
2273
+ },
2274
+ magical_mist: {
2275
+ roughness: 0,
2276
+ metalness: 0,
2277
+ emissive: "#8844ff",
2278
+ emissiveIntensity: 1.5,
2279
+ transparent: true,
2280
+ opacity: 0.3,
2281
+ iridescence: 0.6,
2282
+ iridescenceIOR: 1.5,
2283
+ _volumetric: {
2284
+ type: "mist",
2285
+ density: 0.2,
2286
+ scattering: 0.5,
2287
+ absorption: 0.03,
2288
+ emissionIntensity: 1.5
2289
+ }
2290
+ },
2291
+ // --- Architectural & Natural Stone ---
2292
+ brick: { roughness: 0.9, metalness: 0, color: "#a6523c" },
2293
+ concrete: { roughness: 0.88, metalness: 0, color: "#8a8a8a" },
2294
+ granite: { roughness: 0.6, metalness: 0, color: "#666670" },
2295
+ sandstone: { roughness: 0.85, metalness: 0, color: "#cca66e" },
2296
+ slate: { roughness: 0.7, metalness: 0, color: "#3f4450" },
2297
+ adobe: { roughness: 0.95, metalness: 0, color: "#bf9160" },
2298
+ plaster: { roughness: 0.82, metalness: 0, color: "#ebe8de" },
2299
+ // --- Plant & Cellulose ---
2300
+ bamboo: { roughness: 0.65, metalness: 0, color: "#b3a84d" },
2301
+ paper: { roughness: 0.9, metalness: 0, color: "#f3f0e5" },
2302
+ cardboard: { roughness: 0.88, metalness: 0, color: "#b88c58" },
2303
+ // --- Organic & Animal ---
2304
+ bone: { roughness: 0.7, metalness: 0, color: "#e0d4b5" },
2305
+ ivory: { roughness: 0.35, metalness: 0, color: "#f0e8c5", envMapIntensity: 0.4 },
2306
+ coral: { roughness: 0.75, metalness: 0, color: "#f2614d" },
2307
+ shell: {
2308
+ roughness: 0.25,
2309
+ metalness: 0.05,
2310
+ color: "#f5ede0",
2311
+ iridescence: 0.8,
2312
+ iridescenceIOR: 1.5,
2313
+ envMapIntensity: 0.6
2314
+ },
2315
+ thatch: { roughness: 0.95, metalness: 0, color: "#c0a84a" },
2316
+ // --- Synthetic & Engineered ---
2317
+ resin: {
2318
+ roughness: 0.08,
2319
+ metalness: 0,
2320
+ transmission: 0.75,
2321
+ ior: 1.5,
2322
+ color: "#e8c46a",
2323
+ transparent: true,
2324
+ opacity: 0.88
2325
+ },
2326
+ foam: { roughness: 0.95, metalness: 0, color: "#f0f0f0" },
2327
+ composite: { roughness: 0.5, metalness: 0.25, color: "#333338" },
2328
+ carbon_fiber: {
2329
+ roughness: 0.28,
2330
+ metalness: 0.6,
2331
+ color: "#111114",
2332
+ envMapIntensity: 1.2,
2333
+ clearcoat: 0.6,
2334
+ clearcoatRoughness: 0.1
2335
+ },
2336
+ kevlar: { roughness: 0.82, metalness: 0, color: "#ccbb66" },
2337
+ fiberglass: {
2338
+ roughness: 0.3,
2339
+ metalness: 0.05,
2340
+ transmission: 0.4,
2341
+ ior: 1.45,
2342
+ color: "#e0ede0",
2343
+ transparent: true,
2344
+ opacity: 0.92
2345
+ },
2346
+ stained_glass: {
2347
+ roughness: 0.05,
2348
+ metalness: 0,
2349
+ transmission: 0.85,
2350
+ ior: 1.52,
2351
+ color: "#cc44ff",
2352
+ transparent: true,
2353
+ opacity: 0.75,
2354
+ thickness: 0.3
2355
+ }
2356
+ };
2357
+ ENVIRONMENT_PRESETS = {
2358
+ forest_sunset: {
2359
+ background: true,
2360
+ envPreset: "sunset",
2361
+ fog: { color: "#ff9966", near: 10, far: 100 },
2362
+ ground: { color: "#2d5a27" },
2363
+ lighting: {
2364
+ ambient: { color: "#ffa366", intensity: 0.3 },
2365
+ directional: { color: "#ff7700", intensity: 1.5, position: [10, 20, 5], shadows: true }
2366
+ }
2367
+ },
2368
+ cyberpunk_city: {
2369
+ background: true,
2370
+ envPreset: "night",
2371
+ fog: { color: "#0a0020", near: 5, far: 60 },
2372
+ ground: { color: "#1a1a2e" },
2373
+ lighting: {
2374
+ ambient: { color: "#220044", intensity: 0.2 },
2375
+ directional: { color: "#ff00ff", intensity: 0.5, position: [5, 15, 5], shadows: true },
2376
+ points: [
2377
+ { color: "#00ffff", intensity: 3, position: [-5, 3, -5], distance: 15 },
2378
+ { color: "#ff00ff", intensity: 3, position: [5, 3, 5], distance: 15 }
2379
+ ]
2380
+ },
2381
+ postprocessing: { bloom: { intensity: 1.5, luminanceThreshold: 0.1 } }
2382
+ },
2383
+ space_void: {
2384
+ background: true,
2385
+ envPreset: "night",
2386
+ lighting: {
2387
+ ambient: { color: "#111133", intensity: 0.1 },
2388
+ directional: { color: "#ffffff", intensity: 0.5, position: [0, 10, 0], shadows: false }
2389
+ }
2390
+ },
2391
+ studio: {
2392
+ background: true,
2393
+ envPreset: "studio",
2394
+ ground: { color: "#cccccc" },
2395
+ lighting: {
2396
+ ambient: { color: "#ffffff", intensity: 0.4 },
2397
+ directional: { color: "#ffffff", intensity: 1, position: [5, 10, 5], shadows: true }
2398
+ }
2399
+ },
2400
+ underwater: {
2401
+ background: true,
2402
+ envPreset: "dawn",
2403
+ fog: { color: "#003366", near: 2, far: 40 },
2404
+ ground: { color: "#1a3a4a" },
2405
+ lighting: {
2406
+ ambient: { color: "#004488", intensity: 0.3 },
2407
+ directional: { color: "#66aacc", intensity: 0.8, position: [0, 20, 0], shadows: true }
2408
+ }
2409
+ },
2410
+ desert: {
2411
+ background: true,
2412
+ envPreset: "sunset",
2413
+ fog: { color: "#d4a574", near: 20, far: 150 },
2414
+ ground: { color: "#c4a35a" },
2415
+ lighting: {
2416
+ ambient: { color: "#f5deb3", intensity: 0.4 },
2417
+ directional: { color: "#ffffcc", intensity: 2, position: [15, 30, 10], shadows: true }
2418
+ }
2419
+ }
2420
+ };
2421
+ MESH_TYPES = /* @__PURE__ */ new Set([
2422
+ "orb",
2423
+ "sphere",
2424
+ "cube",
2425
+ "box",
2426
+ "cylinder",
2427
+ "pyramid",
2428
+ "cone",
2429
+ "plane",
2430
+ "torus",
2431
+ "ring",
2432
+ "capsule",
2433
+ "object",
2434
+ "avatar",
2435
+ "dna",
2436
+ "gaussian_splat",
2437
+ "splat",
2438
+ "nerf",
2439
+ "volumetric_video",
2440
+ // Procedural geometry types (hull/spline/membrane/blob/metaball)
2441
+ "hull",
2442
+ "spline",
2443
+ "membrane",
2444
+ "blob",
2445
+ "metaball"
2446
+ ]);
2447
+ UI_COMPONENT_PRESETS = {
2448
+ UIPanel: {
2449
+ component: "Container",
2450
+ // @react-three/uikit Container
2451
+ defaultProps: {
2452
+ flexDirection: "column",
2453
+ padding: 16,
2454
+ backgroundColor: "rgba(0, 0, 0, 0.8)",
2455
+ borderRadius: 8
2456
+ }
2457
+ },
2458
+ UIText: {
2459
+ component: "Text",
2460
+ // @react-three/uikit Text
2461
+ defaultProps: {
2462
+ fontSize: 16,
2463
+ color: "white"
2464
+ }
2465
+ },
2466
+ UIButton: {
2467
+ component: "Button",
2468
+ // Custom button using Container with hover
2469
+ defaultProps: {
2470
+ padding: 12,
2471
+ paddingX: 24,
2472
+ backgroundColor: "#4a90d9",
2473
+ borderRadius: 4,
2474
+ cursor: "pointer"
2475
+ }
2476
+ },
2477
+ UISlider: {
2478
+ component: "Slider",
2479
+ // Custom slider implementation
2480
+ defaultProps: {
2481
+ width: 200,
2482
+ height: 20,
2483
+ trackColor: "#333",
2484
+ fillColor: "#4a90d9",
2485
+ thumbSize: 16
2486
+ }
2487
+ },
2488
+ UIInput: {
2489
+ component: "Input",
2490
+ // @react-three/uikit Input
2491
+ defaultProps: {
2492
+ width: 200,
2493
+ padding: 8,
2494
+ backgroundColor: "#222",
2495
+ borderColor: "#444",
2496
+ borderWidth: 1,
2497
+ borderRadius: 4,
2498
+ color: "white"
2499
+ }
2500
+ },
2501
+ UIImage: {
2502
+ component: "Image",
2503
+ // @react-three/uikit Image
2504
+ defaultProps: {
2505
+ objectFit: "contain"
2506
+ }
2507
+ },
2508
+ UIChart: {
2509
+ component: "Chart",
2510
+ // Custom chart component
2511
+ defaultProps: {
2512
+ width: 300,
2513
+ height: 200,
2514
+ backgroundColor: "#1a1a2e"
2515
+ }
2516
+ },
2517
+ UIGauge: {
2518
+ component: "Gauge",
2519
+ // Custom gauge component
2520
+ defaultProps: {
2521
+ size: 100,
2522
+ strokeWidth: 8,
2523
+ trackColor: "#333",
2524
+ fillColor: "#4a90d9"
2525
+ }
2526
+ }
2527
+ };
2528
+ QUALITY_TIER_SCALES = {
2529
+ low: {
2530
+ particleScale: 0.25,
2531
+ lodLevel: "draft",
2532
+ maxLights: 2,
2533
+ shadowMapSize: 512,
2534
+ shaderComplexity: "basic"
2535
+ },
2536
+ med: {
2537
+ particleScale: 0.6,
2538
+ lodLevel: "mesh",
2539
+ maxLights: 4,
2540
+ shadowMapSize: 1024,
2541
+ shaderComplexity: "standard"
2542
+ },
2543
+ high: {
2544
+ particleScale: 1,
2545
+ lodLevel: "final",
2546
+ maxLights: 8,
2547
+ shadowMapSize: 2048,
2548
+ shaderComplexity: "physical"
2549
+ },
2550
+ ultra: {
2551
+ particleScale: 1.5,
2552
+ lodLevel: "final",
2553
+ maxLights: 16,
2554
+ shadowMapSize: 4096,
2555
+ shaderComplexity: "physical"
2556
+ }
2557
+ };
2558
+ R3FCompiler = class {
2559
+ constructor(options = {}) {
2560
+ // ─── RBAC Enforcement ─────────────────────────────────────────────────
2561
+ this.compilerName = "R3FCompiler";
2562
+ this.rbac = getRBAC();
2563
+ this.qualityTier = options.qualityTier ?? "high";
2564
+ this.tierScales = QUALITY_TIER_SCALES[this.qualityTier];
2565
+ this._defaultLighting = options.defaultLighting ?? true;
2566
+ this._holomapPointCloud = options.holomapPointCloud;
2567
+ if (options.platformTarget) {
2568
+ this._platformTarget = typeof options.platformTarget === "string" ? createPlatformTarget(options.platformTarget) : options.platformTarget;
2569
+ }
2570
+ }
2571
+ /**
2572
+ * Validate agent permissions before compilation.
2573
+ * Skips validation when no token is provided (backwards compatibility).
2574
+ *
2575
+ * Checks:
2576
+ * 1. AST read access (can the agent read AST?)
2577
+ * 2. Code generation access (can the agent generate code?)
2578
+ * 3. Output path scope (if outputPath provided)
2579
+ *
2580
+ * @param agentToken - Agent JWT token (optional for backwards compat)
2581
+ * @param outputPath - Optional output file path for scope validation
2582
+ * @throws UnauthorizedCompilerAccessError if token is provided but invalid/unauthorized
2583
+ */
2584
+ validateCompilerAccess(agentToken, outputPath) {
2585
+ if (!agentToken) return;
2586
+ const astDecision = this.rbac.checkAccess({
2587
+ token: agentToken,
2588
+ resourceType: "ast" /* AST */,
2589
+ operation: "read",
2590
+ expectedWorkflowStep: "generate_assembly" /* GENERATE_ASSEMBLY */
2591
+ });
2592
+ if (!astDecision.allowed) {
2593
+ throw new UnauthorizedCompilerAccessError(astDecision, "AST access", this.compilerName);
2594
+ }
2595
+ const codeDecision = this.rbac.checkAccess({
2596
+ token: agentToken,
2597
+ resourceType: "code" /* CODE */,
2598
+ operation: "write",
2599
+ expectedWorkflowStep: "generate_assembly" /* GENERATE_ASSEMBLY */
2600
+ });
2601
+ if (!codeDecision.allowed) {
2602
+ throw new UnauthorizedCompilerAccessError(codeDecision, "code generation", this.compilerName);
2603
+ }
2604
+ if (outputPath) {
2605
+ const outputDecision = this.rbac.checkAccess({
2606
+ token: agentToken,
2607
+ resourceType: "output" /* OUTPUT */,
2608
+ operation: "write",
2609
+ resourcePath: outputPath,
2610
+ expectedWorkflowStep: "serialize" /* SERIALIZE */
2611
+ });
2612
+ if (!outputDecision.allowed) {
2613
+ throw new UnauthorizedCompilerAccessError(
2614
+ outputDecision,
2615
+ `output write to '${outputPath}'`,
2616
+ this.compilerName
2617
+ );
2618
+ }
2619
+ }
2620
+ }
2621
+ // ─── Spread Expansion Utility ─────────────────────────────────────────
2622
+ /**
2623
+ * Expands spread expressions in a properties object.
2624
+ * Spreads are stored with keys like `__spread_0`, `__spread_1` and have
2625
+ * the structure: { type: 'spread', argument: <value> }
2626
+ *
2627
+ * @param props - The properties object potentially containing spreads
2628
+ * @param context - Optional context for resolving references (templates, state)
2629
+ * @returns A new object with spreads expanded and merged
2630
+ */
2631
+ expandSpreads(props, context) {
2632
+ const result = {};
2633
+ const spreadKeys = [];
2634
+ for (const [key, value] of Object.entries(props)) {
2635
+ if (key.startsWith("__spread_")) {
2636
+ spreadKeys.push(key);
2637
+ } else if (value && typeof value === "object" && value.type === "spread") {
2638
+ spreadKeys.push(key);
2639
+ } else {
2640
+ if (value && typeof value === "object" && !Array.isArray(value) && !("__ref" in value) && !("__expr" in value)) {
2641
+ result[key] = this.expandSpreads(value, context);
2642
+ } else if (Array.isArray(value)) {
2643
+ result[key] = this.expandArraySpreads(value, context);
2644
+ } else {
2645
+ result[key] = value;
2646
+ }
2647
+ }
2648
+ }
2649
+ for (const spreadKey of spreadKeys) {
2650
+ const spreadValue = props[spreadKey];
2651
+ if (spreadValue && typeof spreadValue === "object" && spreadValue.type === "spread") {
2652
+ const resolved = this.resolveSpreadArgument(
2653
+ spreadValue.argument,
2654
+ context
2655
+ );
2656
+ if (resolved && typeof resolved === "object" && !Array.isArray(resolved)) {
2657
+ Object.assign(result, this.expandSpreads(resolved, context));
2658
+ }
2659
+ }
2660
+ }
2661
+ for (const [key, value] of Object.entries(props)) {
2662
+ if (!key.startsWith("__spread_") && !(value && typeof value === "object" && value.type === "spread")) {
2663
+ if (value && typeof value === "object" && !Array.isArray(value) && !("__ref" in value) && !("__expr" in value)) {
2664
+ result[key] = this.expandSpreads(value, context);
2665
+ } else if (Array.isArray(value)) {
2666
+ result[key] = this.expandArraySpreads(value, context);
2667
+ } else {
2668
+ result[key] = value;
2669
+ }
2670
+ }
2671
+ }
2672
+ return result;
2673
+ }
2674
+ /**
2675
+ * Expands spread expressions within an array.
2676
+ * Spread elements have { type: 'spread', argument: <value> }
2677
+ */
2678
+ expandArraySpreads(arr, context) {
2679
+ const result = [];
2680
+ for (const item of arr) {
2681
+ if (item && typeof item === "object" && item.type === "spread") {
2682
+ const resolved = this.resolveSpreadArgument(
2683
+ item.argument,
2684
+ context
2685
+ );
2686
+ if (Array.isArray(resolved)) {
2687
+ result.push(...resolved);
2688
+ } else if (resolved !== void 0 && resolved !== null) {
2689
+ result.push(resolved);
2690
+ }
2691
+ } else if (item && typeof item === "object" && !Array.isArray(item)) {
2692
+ result.push(this.expandSpreads(item, context));
2693
+ } else {
2694
+ result.push(item);
2695
+ }
2696
+ }
2697
+ return result;
2698
+ }
2699
+ /**
2700
+ * Resolves a spread argument to its value.
2701
+ * Handles: direct values, __ref references, template references
2702
+ */
2703
+ resolveSpreadArgument(argument, context) {
2704
+ if (argument === null || argument === void 0) {
2705
+ return void 0;
2706
+ }
2707
+ if (typeof argument === "object" && !("__ref" in argument)) {
2708
+ return argument;
2709
+ }
2710
+ if (typeof argument === "object" && "__ref" in argument) {
2711
+ const ref = argument.__ref;
2712
+ if (context?.templates) {
2713
+ const template = context.templates.get(ref);
2714
+ if (template) {
2715
+ return template.properties || template;
2716
+ }
2717
+ }
2718
+ if (context?.state && ref in context.state) {
2719
+ return context.state[ref];
2720
+ }
2721
+ if (context?.state && ref.includes(".")) {
2722
+ const parts = ref.split(".");
2723
+ let value = context.state;
2724
+ for (const part of parts) {
2725
+ if (value && typeof value === "object" && part in value) {
2726
+ value = value[part];
2727
+ } else {
2728
+ value = void 0;
2729
+ break;
2730
+ }
2731
+ }
2732
+ if (value !== void 0) {
2733
+ return value;
2734
+ }
2735
+ }
2736
+ return argument;
2737
+ }
2738
+ if (typeof argument === "string") {
2739
+ if (context?.templates) {
2740
+ const template = context.templates.get(argument);
2741
+ if (template) {
2742
+ return template.properties || template;
2743
+ }
2744
+ }
2745
+ return { __ref: argument };
2746
+ }
2747
+ return argument;
2748
+ }
2749
+ // ─── HSPlusAST Compilation ────────────────────────────────────────────
2750
+ compile(ast, agentToken, outputPath) {
2751
+ this.validateCompilerAccess(agentToken, outputPath);
2752
+ const root = this.compileNode(ast.root);
2753
+ if (this.hasPostProcessing(root)) {
2754
+ root.children?.unshift({
2755
+ type: "EffectComposer",
2756
+ props: {},
2757
+ children: this.extractPostProcessingNodes(root)
2758
+ });
2759
+ }
2760
+ this.injectDefaultLighting(root);
2761
+ const domainBlocks = ast.domainBlocks ?? [];
2762
+ if (domainBlocks.length > 0) {
2763
+ const compiled = compileDomainBlocks(
2764
+ domainBlocks,
2765
+ {
2766
+ material: (block) => {
2767
+ const mat = compileMaterialBlock(block);
2768
+ return {
2769
+ type: "DomainBlockOutput",
2770
+ props: {
2771
+ __raw: materialToR3F(mat, this.tierScales),
2772
+ __domain: "material",
2773
+ __name: mat.name
2774
+ },
2775
+ children: []
2776
+ };
2777
+ },
2778
+ physics: (block) => {
2779
+ const phys = compilePhysicsBlock(block);
2780
+ return {
2781
+ type: "DomainBlockOutput",
2782
+ props: {
2783
+ __raw: physicsToR3F(phys),
2784
+ __domain: "physics",
2785
+ __name: phys.name || phys.keyword
2786
+ },
2787
+ children: []
2788
+ };
2789
+ },
2790
+ vfx: (block) => {
2791
+ const ps = compileParticleBlock(block);
2792
+ return {
2793
+ type: "DomainBlockOutput",
2794
+ props: {
2795
+ __raw: particlesToR3F(ps, this.tierScales),
2796
+ __domain: "vfx",
2797
+ __name: ps.name
2798
+ },
2799
+ children: []
2800
+ };
2801
+ },
2802
+ postfx: (block) => {
2803
+ const pp = compilePostProcessingBlock(block);
2804
+ return {
2805
+ type: "DomainBlockOutput",
2806
+ props: {
2807
+ __raw: postProcessingToR3F(pp),
2808
+ __domain: "postfx",
2809
+ __name: pp.name || "PostProcessing"
2810
+ },
2811
+ children: []
2812
+ };
2813
+ },
2814
+ audio: (block) => {
2815
+ const audio = compileAudioSourceBlock(block);
2816
+ return {
2817
+ type: "DomainBlockOutput",
2818
+ props: { __raw: audioSourceToR3F(audio), __domain: "audio", __name: audio.name },
2819
+ children: []
2820
+ };
2821
+ },
2822
+ weather: (block) => {
2823
+ const weather = compileWeatherBlock(block);
2824
+ return {
2825
+ type: "DomainBlockOutput",
2826
+ props: {
2827
+ __raw: weatherToR3F(weather),
2828
+ __domain: "weather",
2829
+ __name: weather.name || "Weather"
2830
+ },
2831
+ children: []
2832
+ };
2833
+ },
2834
+ simulation: (block) => {
2835
+ const sim = compileSimulationBlock(block);
2836
+ return {
2837
+ type: "DomainBlockOutput",
2838
+ props: {
2839
+ __raw: simulationToR3F(sim),
2840
+ __domain: "simulation",
2841
+ __name: sim.name || "Simulation"
2842
+ },
2843
+ children: []
2844
+ };
2845
+ }
2846
+ }
2847
+ );
2848
+ if (!root.children) root.children = [];
2849
+ for (const c of compiled) {
2850
+ if (typeof c === "object") root.children.push(c);
2851
+ }
2852
+ }
2853
+ return root;
2854
+ }
2855
+ /**
2856
+ * Compiles a declarative 'world' node into R3F scene nodes.
2857
+ * Nested `world.children` (objects) are compiled via the same path as top-level objects.
2858
+ */
2859
+ compileWorldNode(world, templateMap) {
2860
+ const nodes = [];
2861
+ const props = {};
2862
+ if (world.properties) {
2863
+ for (const prop of world.properties) {
2864
+ props[prop.key] = prop.value;
2865
+ }
2866
+ }
2867
+ if (props.ambient_light !== void 0) {
2868
+ nodes.push(
2869
+ this.createNode("ambientLight", {
2870
+ intensity: Number(props.ambient_light)
2871
+ })
2872
+ );
2873
+ }
2874
+ if (props.skybox_color !== void 0) {
2875
+ nodes.push(
2876
+ this.createNode("Environment", {
2877
+ background: true,
2878
+ preset: "sunset"
2879
+ // Default preset if just color is given
2880
+ })
2881
+ );
2882
+ nodes.push(
2883
+ this.createNode("color", {
2884
+ attach: "background",
2885
+ args: [props.skybox_color]
2886
+ })
2887
+ );
2888
+ }
2889
+ if (props.gravity !== void 0) {
2890
+ nodes.push(
2891
+ this.createNode("Physics", {
2892
+ gravity: [0, -Number(props.gravity), 0]
2893
+ })
2894
+ );
2895
+ }
2896
+ const childNodes = [];
2897
+ if (world.children && world.children.length > 0) {
2898
+ for (const child of world.children) {
2899
+ childNodes.push(this.compileObjectDecl(child, templateMap));
2900
+ }
2901
+ }
2902
+ if (childNodes.length === 0) {
2903
+ return nodes;
2904
+ }
2905
+ const group = this.createNode(
2906
+ "group",
2907
+ {},
2908
+ world.name ? escapeStringValue(world.name, "JSX") : void 0
2909
+ );
2910
+ group.children = [...nodes, ...childNodes];
2911
+ return [group];
2912
+ }
2913
+ createNode(type, props = {}, id) {
2914
+ const node = r3fNodePool.acquire();
2915
+ node.type = type;
2916
+ node.id = id;
2917
+ node.props = props;
2918
+ node.children = [];
2919
+ node.traits = /* @__PURE__ */ new Map();
2920
+ node.directives = [];
2921
+ return node;
2922
+ }
2923
+ compileNode(node) {
2924
+ if (node.type === "system") {
2925
+ return this.compileSystemNode(node);
2926
+ }
2927
+ if (node.type === "component") {
2928
+ return this.compileComponentNode(node);
2929
+ }
2930
+ const rawProps = node.properties || {};
2931
+ const type = this.mapType(node.type, rawProps);
2932
+ const r3fNode = r3fNodePool.acquire();
2933
+ r3fNode.type = type;
2934
+ const rawId = node.id || node.name;
2935
+ r3fNode.id = rawId ? escapeStringValue(rawId, "JSX") : void 0;
2936
+ r3fNode.props = this.compileProperties(node, rawProps);
2937
+ r3fNode.children = [];
2938
+ r3fNode.traits = /* @__PURE__ */ new Map();
2939
+ r3fNode.directives = node.directives || [];
2940
+ if (node.directives) {
2941
+ for (const directive of node.directives) {
2942
+ if (directive.type === "trait") {
2943
+ r3fNode.traits?.set(
2944
+ directive.name,
2945
+ directive.config
2946
+ );
2947
+ }
2948
+ }
2949
+ }
2950
+ const enhanced = node;
2951
+ if (enhanced.graphics) {
2952
+ this.applyGraphicsConfig(r3fNode, enhanced.graphics);
2953
+ }
2954
+ if (enhanced.children && Array.isArray(enhanced.children)) {
2955
+ r3fNode.children = enhanced.children.map(
2956
+ (child) => this.compileNode(child)
2957
+ );
2958
+ }
2959
+ return r3fNode;
2960
+ }
2961
+ // ─── HoloComposition Compilation (.holo files) ────────────────────────
2962
+ compileComposition(composition, agentToken, outputPath) {
2963
+ this.validateCompilerAccess(agentToken, outputPath);
2964
+ if (this._platformTarget) {
2965
+ const platformMixin = new PlatformConditionalCompilerMixin();
2966
+ composition = platformMixin.filterForPlatform(composition, this._platformTarget);
2967
+ }
2968
+ const root = r3fNodePool.acquire();
2969
+ root.type = "group";
2970
+ root.id = composition.name ? escapeStringValue(composition.name, "JSX") : void 0;
2971
+ root.props = {};
2972
+ root.children = [];
2973
+ root.traits = /* @__PURE__ */ new Map();
2974
+ root.directives = [];
2975
+ const templateMap = /* @__PURE__ */ new Map();
2976
+ if (Array.isArray(composition.templates)) {
2977
+ for (const tmpl of composition.templates) {
2978
+ templateMap.set(tmpl.name, tmpl);
2979
+ }
2980
+ }
2981
+ if (composition.children && Array.isArray(composition.children)) {
2982
+ for (const child of composition.children) {
2983
+ if (child.type === "template" && child.name) {
2984
+ templateMap.set(child.name, child);
2985
+ }
2986
+ }
2987
+ for (const child of composition.children) {
2988
+ root.children.push(this.compileChildNode(child, templateMap));
2989
+ }
2990
+ }
2991
+ if (composition.environment) {
2992
+ root.children.push(
2993
+ ...this.compileEnvironmentBlock(composition.environment)
2994
+ );
2995
+ }
2996
+ if (Array.isArray(composition.lights)) {
2997
+ for (const light of composition.lights) {
2998
+ root.children.push(this.compileLightBlock(light));
2999
+ }
3000
+ }
3001
+ if (Array.isArray(composition.objects)) {
3002
+ for (const obj of composition.objects) {
3003
+ root.children.push(this.compileObjectDecl(obj, templateMap));
3004
+ }
3005
+ }
3006
+ if (Array.isArray(composition.spatialGroups)) {
3007
+ for (const group of composition.spatialGroups) {
3008
+ root.children.push(this.compileSpatialGroup(group, templateMap));
3009
+ }
3010
+ }
3011
+ if (Array.isArray(composition.timelines)) {
3012
+ for (const timeline of composition.timelines) {
3013
+ root.children.push(this.compileTimelineBlock(timeline));
3014
+ }
3015
+ }
3016
+ if (Array.isArray(composition.audio)) {
3017
+ for (const audio of composition.audio) {
3018
+ root.children.push(this.compileAudioBlock(audio));
3019
+ }
3020
+ }
3021
+ if (Array.isArray(composition.zones)) {
3022
+ for (const zone of composition.zones) {
3023
+ root.children.push(this.compileZoneBlock(zone));
3024
+ }
3025
+ }
3026
+ if (Array.isArray(composition.worlds)) {
3027
+ for (const world of composition.worlds) {
3028
+ root.children.push(
3029
+ ...this.compileWorldNode(
3030
+ world,
3031
+ templateMap
3032
+ )
3033
+ );
3034
+ }
3035
+ }
3036
+ if (composition.ui) {
3037
+ root.children.push(this.compileUIBlock(composition.ui));
3038
+ }
3039
+ if (Array.isArray(composition.transitions)) {
3040
+ for (const transition of composition.transitions) {
3041
+ root.children.push(this.compileTransitionBlock(transition));
3042
+ }
3043
+ }
3044
+ if (Array.isArray(composition.conditionals)) {
3045
+ for (const cond of composition.conditionals) {
3046
+ root.children.push(this.compileConditionalBlock(cond, templateMap));
3047
+ }
3048
+ }
3049
+ if (Array.isArray(composition.iterators)) {
3050
+ for (const iter of composition.iterators) {
3051
+ root.children.push(this.compileForEachBlock(iter, templateMap));
3052
+ }
3053
+ }
3054
+ if (composition.camera) {
3055
+ root.children.push(this.compileCameraBlock(composition.camera));
3056
+ }
3057
+ if (composition.effects) {
3058
+ root.children.unshift(
3059
+ this.compileEffectsBlock(composition.effects)
3060
+ );
3061
+ } else if (this.hasPostProcessing(root)) {
3062
+ root.children.unshift({
3063
+ type: "EffectComposer",
3064
+ props: {},
3065
+ children: this.extractPostProcessingNodes(root)
3066
+ });
3067
+ }
3068
+ this.injectHolomapPointCloud(root);
3069
+ this.injectDefaultLighting(root);
3070
+ return root;
3071
+ }
3072
+ /** R3F host apps can map this node to BufferGeometry + pointsMaterial from base64 buffers. */
3073
+ injectHolomapPointCloud(root) {
3074
+ const h = this._holomapPointCloud;
3075
+ if (!h || h.pointCount < 1 || !h.positionsB64 || !h.colorsB64) return;
3076
+ if (!root.children) root.children = [];
3077
+ root.children.push({
3078
+ type: "holomapPointCloud",
3079
+ props: {
3080
+ positionsB64: h.positionsB64,
3081
+ colorsB64: h.colorsB64,
3082
+ pointCount: h.pointCount
3083
+ }
3084
+ });
3085
+ }
3086
+ compileLightBlock(light) {
3087
+ const lightMapping = {
3088
+ directional: "directionalLight",
3089
+ point: "pointLight",
3090
+ spot: "spotLight",
3091
+ hemisphere: "hemisphereLight",
3092
+ ambient: "ambientLight",
3093
+ area: "rectAreaLight"
3094
+ };
3095
+ const type = lightMapping[light.lightType] || "directionalLight";
3096
+ const props = {};
3097
+ if (Array.isArray(light.properties)) {
3098
+ for (const prop of light.properties) {
3099
+ const key = prop.key;
3100
+ const value = prop.value;
3101
+ if (key === "cast_shadow" || key === "castShadow") {
3102
+ props.castShadow = value;
3103
+ } else if (key === "ground_color" || key === "groundColor") {
3104
+ props.groundColor = value;
3105
+ } else if (key === "shadow_map_size") {
3106
+ props["shadow-mapSize"] = Array.isArray(value) ? value : [value, value];
3107
+ } else {
3108
+ props[key] = value;
3109
+ }
3110
+ }
3111
+ }
3112
+ if ((light.lightType === "directional" || light.lightType === "spot") && props.castShadow === void 0) {
3113
+ props.castShadow = true;
3114
+ }
3115
+ const r3fNode = r3fNodePool.acquire();
3116
+ r3fNode.type = type;
3117
+ r3fNode.id = light.name ? escapeStringValue(light.name, "JSX") : void 0;
3118
+ r3fNode.props = props;
3119
+ r3fNode.children = [];
3120
+ r3fNode.traits = /* @__PURE__ */ new Map();
3121
+ r3fNode.directives = [];
3122
+ return r3fNode;
3123
+ }
3124
+ compileEffectsBlock(effects) {
3125
+ const children = [];
3126
+ if (Array.isArray(effects.effects)) {
3127
+ for (const effect of effects.effects) {
3128
+ const effectMapping = {
3129
+ bloom: "Bloom",
3130
+ ssao: "SSAO",
3131
+ vignette: "Vignette",
3132
+ dof: "DepthOfField",
3133
+ chromatic_aberration: "ChromaticAberration",
3134
+ tone_mapping: "ToneMapping",
3135
+ noise: "Noise"
3136
+ };
3137
+ const effectType = effect.effectType;
3138
+ const type = effectMapping[effectType] || effectType;
3139
+ children.push(
3140
+ this.createNode(type, { ...effect.properties || {} })
3141
+ );
3142
+ }
3143
+ }
3144
+ const composer = this.createNode("EffectComposer", {});
3145
+ composer.children = children;
3146
+ return composer;
3147
+ }
3148
+ compileCameraBlock(camera) {
3149
+ const props = {};
3150
+ if (Array.isArray(camera.properties)) {
3151
+ for (const prop of camera.properties) {
3152
+ if (prop.key === "field_of_view" || prop.key === "fov") {
3153
+ props.fov = prop.value;
3154
+ } else if (prop.key === "look_at" || prop.key === "lookAt") {
3155
+ props.lookAt = prop.value;
3156
+ } else {
3157
+ props[prop.key] = prop.value;
3158
+ }
3159
+ }
3160
+ }
3161
+ props.cameraType = camera.cameraType;
3162
+ return this.createNode("Camera", props, "__camera");
3163
+ }
3164
+ compileEnvironmentBlock(env) {
3165
+ const nodes = [];
3166
+ const envProps = {};
3167
+ if (env.properties) {
3168
+ for (const prop of env.properties) {
3169
+ envProps[prop.key] = prop.value;
3170
+ }
3171
+ }
3172
+ const presetName = envProps.skybox || envProps.preset;
3173
+ if (presetName) {
3174
+ const preset = ENVIRONMENT_PRESETS[presetName];
3175
+ if (preset) {
3176
+ nodes.push(
3177
+ this.createNode("Environment", {
3178
+ background: true,
3179
+ preset: preset.envPreset || presetName
3180
+ })
3181
+ );
3182
+ const lighting = preset.lighting;
3183
+ if (lighting?.ambient) {
3184
+ nodes.push(
3185
+ this.createNode("ambientLight", {
3186
+ color: lighting.ambient.color,
3187
+ intensity: lighting.ambient.intensity
3188
+ })
3189
+ );
3190
+ }
3191
+ if (lighting?.directional) {
3192
+ const dl = lighting.directional;
3193
+ nodes.push(
3194
+ this.createNode("directionalLight", {
3195
+ color: dl.color,
3196
+ intensity: dl.intensity,
3197
+ position: dl.position,
3198
+ castShadow: dl.shadows !== false,
3199
+ "shadow-mapSize": [2048, 2048]
3200
+ })
3201
+ );
3202
+ }
3203
+ if (Array.isArray(lighting?.points)) {
3204
+ for (const pl of lighting.points) {
3205
+ nodes.push(
3206
+ this.createNode("pointLight", {
3207
+ color: pl.color,
3208
+ intensity: pl.intensity,
3209
+ position: pl.position,
3210
+ distance: pl.distance
3211
+ })
3212
+ );
3213
+ }
3214
+ }
3215
+ const presetMap = preset;
3216
+ if (presetMap.fog) {
3217
+ const fogMap = presetMap.fog;
3218
+ nodes.push(
3219
+ this.createNode("fog", {
3220
+ attach: "fog",
3221
+ color: fogMap.color,
3222
+ near: fogMap.near,
3223
+ far: fogMap.far
3224
+ })
3225
+ );
3226
+ }
3227
+ if (presetMap.ground) {
3228
+ const groundMap = presetMap.ground;
3229
+ nodes.push(
3230
+ this.createNode(
3231
+ "mesh",
3232
+ {
3233
+ hsType: "plane",
3234
+ rotation: [-Math.PI / 2, 0, 0],
3235
+ position: [0, -0.01, 0],
3236
+ receiveShadow: true,
3237
+ args: [200, 200],
3238
+ color: groundMap.color,
3239
+ materialProps: { roughness: 0.8, metalness: 0 }
3240
+ },
3241
+ "__ground"
3242
+ )
3243
+ );
3244
+ }
3245
+ } else {
3246
+ nodes.push(this.createNode("Environment", { background: true, preset: presetName }));
3247
+ }
3248
+ }
3249
+ if (envProps.ambient_light !== void 0) {
3250
+ nodes.push(
3251
+ this.createNode("ambientLight", {
3252
+ intensity: typeof envProps.ambient_light === "number" ? envProps.ambient_light : 0.5
3253
+ })
3254
+ );
3255
+ }
3256
+ const explicitFog = envProps.fog;
3257
+ if (explicitFog && typeof explicitFog === "object") {
3258
+ nodes.push(
3259
+ this.createNode("fog", {
3260
+ attach: "fog",
3261
+ color: explicitFog.color || "#cccccc",
3262
+ near: explicitFog.near || 10,
3263
+ far: explicitFog.far || 100
3264
+ })
3265
+ );
3266
+ }
3267
+ return nodes;
3268
+ }
3269
+ compileObjectDecl(obj, templateMap) {
3270
+ const props = {};
3271
+ let geometryType = "cube";
3272
+ if (obj.template && templateMap) {
3273
+ const tmpl = templateMap.get(obj.template);
3274
+ if (tmpl) {
3275
+ const tmplTraits = tmpl.traits;
3276
+ if (tmplTraits && Array.isArray(tmplTraits)) {
3277
+ const existingTraitNames = new Set(
3278
+ (obj.traits || []).map(
3279
+ (t) => t.name
3280
+ )
3281
+ );
3282
+ obj.traits = [
3283
+ ...tmplTraits.filter(
3284
+ (t) => !existingTraitNames.has(t.name)
3285
+ ),
3286
+ ...obj.traits || []
3287
+ ];
3288
+ }
3289
+ const tmplProps = tmpl.properties;
3290
+ if (tmplProps && Array.isArray(tmplProps)) {
3291
+ const existingKeys = new Set(
3292
+ (obj.properties || []).map(
3293
+ (p) => p.key
3294
+ )
3295
+ );
3296
+ const mergedProps = tmplProps.filter((p) => !existingKeys.has(p.key)).map((p) => ({
3297
+ type: "ObjectProperty",
3298
+ key: p.key,
3299
+ value: p.value
3300
+ }));
3301
+ obj.properties = [...mergedProps, ...obj.properties || []];
3302
+ }
3303
+ }
3304
+ }
3305
+ if (obj.properties && Array.isArray(obj.properties)) {
3306
+ const expandedProperties = [];
3307
+ for (const p of obj.properties) {
3308
+ const prop = p;
3309
+ if (prop && prop.type === "spread") {
3310
+ const resolved = this.resolveSpreadArgument(
3311
+ prop.target || prop.argument,
3312
+ {
3313
+ templates: templateMap
3314
+ }
3315
+ );
3316
+ if (resolved && typeof resolved === "object" && !Array.isArray(resolved)) {
3317
+ for (const [key, value] of Object.entries(resolved)) {
3318
+ expandedProperties.push({ key, value });
3319
+ }
3320
+ } else if (Array.isArray(resolved)) {
3321
+ expandedProperties.push(...resolved);
3322
+ }
3323
+ } else {
3324
+ expandedProperties.push(prop);
3325
+ }
3326
+ }
3327
+ obj.properties = expandedProperties;
3328
+ }
3329
+ if (obj.properties) {
3330
+ for (const p of obj.properties) {
3331
+ const key = p.key;
3332
+ const value = p.value;
3333
+ if (key === "geometry" || key === "mesh") {
3334
+ geometryType = value;
3335
+ } else if (key === "type") {
3336
+ const valStr = value;
3337
+ if (["text", "sparkles", "portal", "audio"].includes(valStr)) {
3338
+ geometryType = valStr;
3339
+ } else if (["directional", "point", "spot", "hemisphere", "ambient", "area"].includes(valStr)) {
3340
+ geometryType = "light";
3341
+ props.lightType = valStr;
3342
+ } else {
3343
+ props[key] = value;
3344
+ }
3345
+ } else if (key === "light_type") {
3346
+ props.lightType = value;
3347
+ } else if (key === "position" && Array.isArray(value)) {
3348
+ props.position = value;
3349
+ } else if (key === "rotation" && Array.isArray(value)) {
3350
+ props.rotation = value;
3351
+ } else if (key === "scale") {
3352
+ props.scale = Array.isArray(value) ? value : [value, value, value];
3353
+ } else if (key === "color") {
3354
+ props.color = value;
3355
+ } else if (key === "src" || key === "model" || key === "source") {
3356
+ props.src = value;
3357
+ geometryType = "model";
3358
+ } else if (key === "text") {
3359
+ props.children = this.resolveValue(value);
3360
+ props.text = this.resolveValue(value);
3361
+ } else if (key === "font_size") {
3362
+ props.fontSize = value;
3363
+ } else if (key === "material") {
3364
+ const currentMaterialProps = props.materialProps || {};
3365
+ if (typeof value === "string" && MATERIAL_PRESETS[value]) {
3366
+ props.materialProps = { ...MATERIAL_PRESETS[value], ...currentMaterialProps };
3367
+ } else if (typeof value === "object" && value !== null) {
3368
+ const valObj = value;
3369
+ if (valObj.preset && typeof valObj.preset === "string" && MATERIAL_PRESETS[valObj.preset]) {
3370
+ const { preset: _, ...rest } = valObj;
3371
+ props.materialProps = {
3372
+ ...MATERIAL_PRESETS[valObj.preset],
3373
+ ...rest,
3374
+ ...currentMaterialProps
3375
+ };
3376
+ } else {
3377
+ props.materialProps = { ...currentMaterialProps, ...valObj };
3378
+ }
3379
+ }
3380
+ } else if (key === "roughness" || key === "metalness" || key === "metallic") {
3381
+ const mProps = props.materialProps || {};
3382
+ mProps[key === "metallic" ? "metalness" : key] = value;
3383
+ props.materialProps = mProps;
3384
+ } else if (key === "opacity") {
3385
+ const mProps = props.materialProps || {};
3386
+ mProps.opacity = value;
3387
+ mProps.transparent = value < 1;
3388
+ props.materialProps = mProps;
3389
+ } else if (key === "emissive") {
3390
+ props.materialProps = {
3391
+ ...props.materialProps || {},
3392
+ emissive: value
3393
+ };
3394
+ } else if (key === "emissiveIntensity" || key === "emissive_intensity") {
3395
+ props.materialProps = {
3396
+ ...props.materialProps || {},
3397
+ emissiveIntensity: value
3398
+ };
3399
+ } else if (key === "size") {
3400
+ if (Array.isArray(value)) {
3401
+ props.args = value;
3402
+ }
3403
+ props.size = value;
3404
+ } else if (key === "radius") {
3405
+ props.size = value * 2;
3406
+ } else if (key === "intensity") {
3407
+ props.intensity = value;
3408
+ } else if (key === "cast_shadow" || key === "castShadow") {
3409
+ props.castShadow = value;
3410
+ } else if (key === "receiveShadow" || key === "receive_shadow") {
3411
+ props.receiveShadow = value;
3412
+ } else if (key === "visible") {
3413
+ props[key] = value;
3414
+ } else if (key === "maturity") {
3415
+ props.maturityOverride = value;
3416
+ } else if (key === "promoteUrl" || key === "promote_url") {
3417
+ props.promoteUrl = value;
3418
+ } else if (key === "collisionShape" || key === "collision_shape") {
3419
+ props.collisionShape = value;
3420
+ } else {
3421
+ props[key] = this.resolveValue(value);
3422
+ }
3423
+ }
3424
+ }
3425
+ if (obj.traits && Array.isArray(obj.traits)) {
3426
+ const semiring = new ProvenanceSemiring();
3427
+ const physicsApplications = obj.traits.filter((t) => t.name === "physics" || t.name === "collidable").map((t) => {
3428
+ let baseConfig = t.config || {};
3429
+ if (t.name === "collidable" && !baseConfig.type)
3430
+ baseConfig = { ...baseConfig, type: "fixed" };
3431
+ if (t.name === "physics" && !baseConfig.type)
3432
+ baseConfig = { ...baseConfig, type: "dynamic" };
3433
+ return {
3434
+ name: t.name,
3435
+ config: baseConfig,
3436
+ context: obj.provenance?.context
3437
+ };
3438
+ });
3439
+ if (physicsApplications.length > 0) {
3440
+ const { config: mergedPhysics } = semiring.add(physicsApplications);
3441
+ props.rigidBody = { ...mergedPhysics };
3442
+ props.collider = { type: "auto" };
3443
+ if (props.rigidBody?.type === "fixed") {
3444
+ props.castShadow = true;
3445
+ props.receiveShadow = true;
3446
+ }
3447
+ }
3448
+ for (const trait of obj.traits) {
3449
+ const name = trait.name;
3450
+ if (name === "physics" || name === "collidable") {
3451
+ continue;
3452
+ } else if (name === "grabbable") {
3453
+ props.castShadow = true;
3454
+ props.grabbable = trait.config || true;
3455
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3456
+ if (!props.collider) props.collider = { type: "auto" };
3457
+ } else if (name === "hoverable") {
3458
+ props.hoverable = trait.config || true;
3459
+ } else if (name === "animated") {
3460
+ props.animated = trait.config || true;
3461
+ } else if (name === "positional" || name === "spatial_audio") {
3462
+ props.spatial = true;
3463
+ } else if (name === "gem_resonance") {
3464
+ props.gemResonance = gemResonanceConfig(trait.config);
3465
+ props.spatial = true;
3466
+ } else if (name === "shadow") {
3467
+ props.castShadow = true;
3468
+ if (trait.config?.mapSize)
3469
+ props["shadow-mapSize"] = [trait.config.mapSize, trait.config.mapSize];
3470
+ } else if (name === "material") {
3471
+ const presetName = trait.config?.preset;
3472
+ if (presetName && typeof presetName === "string" && MATERIAL_PRESETS[presetName]) {
3473
+ const { preset: _, ...rest } = trait.config;
3474
+ props.materialProps = {
3475
+ ...MATERIAL_PRESETS[presetName],
3476
+ ...rest,
3477
+ ...props.materialProps
3478
+ };
3479
+ } else {
3480
+ props.materialProps = {
3481
+ ...props.materialProps,
3482
+ ...trait.config
3483
+ };
3484
+ }
3485
+ } else if (name === "networked") {
3486
+ props.networked = trait.config || true;
3487
+ } else if (name === "moldable") {
3488
+ props.moldable = trait.config || true;
3489
+ } else if (name === "stretchable") {
3490
+ props.stretchable = trait.config || true;
3491
+ } else if (name === "bloom") {
3492
+ props.bloom = trait.config || { intensity: 1 };
3493
+ } else if (name === "portal") {
3494
+ props.portal = trait.config || true;
3495
+ } else if (name === "attach") {
3496
+ props.attach = trait.config || true;
3497
+ } else if (name === "orbit") {
3498
+ props.orbit = trait.config || true;
3499
+ } else if (name === "look_at") {
3500
+ props.lookAtTarget = trait.config || true;
3501
+ } else if (name === "follow") {
3502
+ props.follow = trait.config || true;
3503
+ } else if (name === "plane_detection") {
3504
+ props.planeDetection = trait.config || { mode: "all" };
3505
+ } else if (name === "mesh_detection") {
3506
+ props.meshDetection = trait.config || { classification: true };
3507
+ } else if (name === "anchor") {
3508
+ props.anchor = trait.config || { type: "spatial" };
3509
+ } else if (name === "persistent_anchor") {
3510
+ props.persistentAnchor = trait.config || { storage: "local" };
3511
+ } else if (name === "shared_anchor") {
3512
+ props.sharedAnchor = trait.config || { authority: "creator" };
3513
+ } else if (name === "occlusion") {
3514
+ props.occlusionMode = trait.config?.mode || "environment";
3515
+ props.occlusion = trait.config || true;
3516
+ } else if (name === "light_estimation") {
3517
+ props.lightEstimation = trait.config || { auto_apply: true };
3518
+ } else if (name === "geospatial") {
3519
+ props.geospatial = trait.config || true;
3520
+ } else if (name === "gaussian_splat") {
3521
+ props.gaussianSplat = trait.config || true;
3522
+ } else if (name === "nerf") {
3523
+ props.nerf = trait.config || true;
3524
+ } else if (name === "volumetric_video") {
3525
+ props.volumetricVideo = trait.config || true;
3526
+ } else if (name === "point_cloud") {
3527
+ props.pointCloud = trait.config || true;
3528
+ } else if (name === "photogrammetry") {
3529
+ props.photogrammetry = trait.config || true;
3530
+ } else if (name === "web_surface") {
3531
+ props.webSurface = trait.config || true;
3532
+ } else if (name === "cloth") {
3533
+ props.cloth = trait.config || { stiffness: 0.8 };
3534
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3535
+ } else if (name === "fluid") {
3536
+ props.fluid = trait.config || { viscosity: 0.01 };
3537
+ props.__gapsComponents = props.__gapsComponents || [];
3538
+ props.__gapsComponents.push("FluidRenderer");
3539
+ } else if (name === "soft_body") {
3540
+ props.softBody = trait.config || { elasticity: 0.5 };
3541
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3542
+ } else if (name === "rope") {
3543
+ props.rope = trait.config || { segments: 20 };
3544
+ } else if (name === "chain") {
3545
+ props.chain = trait.config || { link_count: 20 };
3546
+ } else if (name === "wind") {
3547
+ props.wind = trait.config || { strength: 5 };
3548
+ } else if (name === "buoyancy") {
3549
+ props.buoyancy = trait.config || { water_level: 0 };
3550
+ } else if (name === "destruction") {
3551
+ props.destruction = trait.config || { health: 100 };
3552
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3553
+ if (!props.collider) props.collider = { type: "auto" };
3554
+ } else if (name === "soft_body_pro") {
3555
+ props.softBodyPro = trait.config || { tear_threshold: 0.5 };
3556
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3557
+ } else if (name === "crowd_sim") {
3558
+ props.crowdSim = trait.config || { max_agents: 1e3 };
3559
+ } else if (name === "deformable_terrain") {
3560
+ props.deformableTerrain = trait.config || { resolution: 256 };
3561
+ } else if (name === "volumetric_clouds") {
3562
+ props.volumetricClouds = trait.config || { coverage: 0.5 };
3563
+ props.__gapsComponents = props.__gapsComponents || [];
3564
+ props.__gapsComponents.push("CloudRenderer");
3565
+ } else if (name === "god_rays") {
3566
+ props.godRays = trait.config || { intensity: 1 };
3567
+ props.__gapsComponents = props.__gapsComponents || [];
3568
+ props.__gapsComponents.push("GodRaysEffect");
3569
+ } else if (name === "spatial_voice") {
3570
+ props.spatialVoice = trait.config || { max_distance: 30 };
3571
+ props.spatial = true;
3572
+ } else if (name === "ai_companion") {
3573
+ props.aiCompanion = trait.config || { personality: "friendly" };
3574
+ } else if (name === "moderation") {
3575
+ props.moderation = trait.config || { sensitivity: "medium" };
3576
+ } else if (name === "anti_grief") {
3577
+ props.antiGrief = trait.config || { detection_window: 30 };
3578
+ } else if (name === "world_state") {
3579
+ props.worldState = trait.config || { sync_rate: 10 };
3580
+ } else if (name === "token_gated") {
3581
+ props.tokenGated = trait.config || { token_contract: "", min_balance: 1 };
3582
+ } else if (name === "ambisonics") {
3583
+ props.ambisonics = trait.config || { order: 1 };
3584
+ props.spatial = true;
3585
+ } else if (name === "hrtf") {
3586
+ props.hrtf = trait.config || true;
3587
+ props.spatial = true;
3588
+ } else if (name === "reverb_zone") {
3589
+ props.reverbZone = trait.config || { preset: "room" };
3590
+ } else if (name === "audio_occlusion") {
3591
+ props.audioOcclusion = trait.config || true;
3592
+ } else if (name === "audio_portal") {
3593
+ props.audioPortal = trait.config || true;
3594
+ } else if (name === "head_tracked_audio") {
3595
+ props.headTrackedAudio = trait.config || true;
3596
+ props.spatial = true;
3597
+ } else if (name === "accessible") {
3598
+ props.accessible = trait.config || { role: "generic" };
3599
+ } else if (name === "alt_text") {
3600
+ props.altText = trait.config?.text || "";
3601
+ } else if (name === "magnifiable") {
3602
+ props.magnifiable = trait.config || { max_scale: 3 };
3603
+ } else if (name === "high_contrast") {
3604
+ props.highContrast = trait.config || { mode: "outline" };
3605
+ } else if (name === "motion_reduced") {
3606
+ props.motionReduced = trait.config || true;
3607
+ if (props.animated) props.animated = false;
3608
+ } else if (name === "compute") {
3609
+ props.compute = trait.config || true;
3610
+ } else if (name === "gpu_particle") {
3611
+ props.gpuParticle = trait.config || { count: 1e4 };
3612
+ } else if (isVfxParticleTraitName(name)) {
3613
+ const particleConfig = {
3614
+ effect: vfxParticleEffect(name),
3615
+ ...trait.config || {}
3616
+ };
3617
+ const gpuParticles = props.gpuParticles ?? [];
3618
+ props.gpuParticles = [...gpuParticles, particleConfig];
3619
+ if (!props.gpuParticle) props.gpuParticle = particleConfig;
3620
+ } else if (name === "gpu_physics") {
3621
+ props.gpuPhysics = trait.config || true;
3622
+ } else if (name === "digital_twin") {
3623
+ props.digitalTwin = trait.config || true;
3624
+ } else if (name === "sensor") {
3625
+ props.sensor = trait.config || true;
3626
+ } else if (name === "data_binding") {
3627
+ props.dataBinding = trait.config || true;
3628
+ } else if (name === "behavior_tree") {
3629
+ props.behaviorTree = trait.config || true;
3630
+ } else if (name === "llm_agent") {
3631
+ props.llmAgent = trait.config || true;
3632
+ } else if (name === "neural_link") {
3633
+ props.neuralLink = trait.config || { model: "brittney-v4.gguf", temperature: 0.7 };
3634
+ } else if (name === "perception") {
3635
+ props.perception = trait.config || { sight_range: 20 };
3636
+ } else if (name === "patrol") {
3637
+ props.patrol = trait.config || true;
3638
+ } else if (name === "co_located") {
3639
+ props.coLocated = trait.config || true;
3640
+ } else if (name === "shared_world") {
3641
+ props.sharedWorld = trait.config || true;
3642
+ } else if (name === "voice_proximity") {
3643
+ props.voiceProximity = trait.config || { max_distance: 20 };
3644
+ props.spatial = true;
3645
+ } else if (name === "spatial_persona") {
3646
+ props.spatialPersona = trait.config || { style: "realistic" };
3647
+ } else if (name === "shareplay") {
3648
+ props.sharePlay = trait.config || { activity_type: "custom" };
3649
+ } else if (name === "object_tracking") {
3650
+ props.objectTracking = trait.config || true;
3651
+ } else if (name === "scene_reconstruction") {
3652
+ props.sceneReconstruction = trait.config || { mode: "mesh" };
3653
+ } else if (name === "eye_tracked") {
3654
+ props.eyeTracked = true;
3655
+ } else if (name === "eye_hand_fusion") {
3656
+ props.eyeHandFusion = true;
3657
+ } else if (name === "controlnet") {
3658
+ props.controlNet = trait.config || { model: "canny" };
3659
+ } else if (name === "ai_texture_gen") {
3660
+ props.aiTextureGen = trait.config || { style: "photorealistic" };
3661
+ } else if (name === "diffusion_realtime") {
3662
+ props.diffusionRealtime = trait.config || { backend: "cuda" };
3663
+ } else if (name === "ai_upscaling") {
3664
+ props.aiUpscaling = trait.config || { factor: 2 };
3665
+ } else if (name === "ai_inpainting") {
3666
+ props.aiInpainting = trait.config || true;
3667
+ } else if (name === "neural_forge") {
3668
+ props.neuralForge = trait.config || true;
3669
+ } else if (name === "embedding_search") {
3670
+ props.embeddingSearch = trait.config || { dimensions: 1536 };
3671
+ } else if (name === "ai_npc_brain") {
3672
+ props.aiNpcBrain = trait.config || { model: "llm" };
3673
+ } else if (name === "vector_db") {
3674
+ props.vectorDb = trait.config || true;
3675
+ } else if (name === "vision" || name === "ai_vision") {
3676
+ props.vision = trait.config || { task: "detection" };
3677
+ } else if (name === "spatial_awareness") {
3678
+ props.spatialAwareness = trait.config || true;
3679
+ } else if (name === "neural_animation") {
3680
+ props.neuralAnimation = trait.config || { style: "motion_matching" };
3681
+ } else if (name === "draft") {
3682
+ props.draftMode = true;
3683
+ props.draftShape = trait.config?.shape || "box";
3684
+ props.draftColor = trait.config?.color || "#88aaff";
3685
+ props.draftOpacity = trait.config?.opacity ?? 1;
3686
+ props.draftWireframe = trait.config?.wireframe || false;
3687
+ if (trait.config?.collision !== false) {
3688
+ if (!props.rigidBody) props.rigidBody = { type: "fixed" };
3689
+ if (!props.collider) props.collider = { type: "auto" };
3690
+ }
3691
+ } else {
3692
+ props[name] = trait.config || true;
3693
+ if (!props.__unrecognizedTraits) {
3694
+ props.__unrecognizedTraits = [];
3695
+ }
3696
+ props.__unrecognizedTraits.push(name);
3697
+ }
3698
+ }
3699
+ }
3700
+ if (obj.traits && Array.isArray(obj.traits)) {
3701
+ const traitNames = obj.traits.map(
3702
+ (t) => t.name
3703
+ );
3704
+ const compositor = new TraitCompositor();
3705
+ const composedMaterial = compositor.compose(traitNames);
3706
+ if (Object.keys(composedMaterial).length > 0) {
3707
+ props.materialProps = {
3708
+ ...props.materialProps,
3709
+ ...composedMaterial
3710
+ };
3711
+ }
3712
+ }
3713
+ let type;
3714
+ if (geometryType === "model" && props.src) {
3715
+ type = "gltfModel";
3716
+ } else if (geometryType === "light") {
3717
+ const lightType = props.lightType || props.type || "directional";
3718
+ const lightMapping = {
3719
+ directional: "directionalLight",
3720
+ point: "pointLight",
3721
+ spot: "spotLight",
3722
+ hemisphere: "hemisphereLight",
3723
+ ambient: "ambientLight",
3724
+ area: "rectAreaLight"
3725
+ };
3726
+ type = lightMapping[lightType] || "directionalLight";
3727
+ delete props.lightType;
3728
+ } else if (geometryType === "text") {
3729
+ type = "Text";
3730
+ } else if (geometryType === "sparkles") {
3731
+ type = "Sparkles";
3732
+ } else if (geometryType === "portal") {
3733
+ type = "Portal";
3734
+ } else {
3735
+ type = "mesh";
3736
+ props.hsType = geometryType;
3737
+ if (!props.args) {
3738
+ const size = typeof props.size === "number" ? props.size : 1;
3739
+ props.args = this.getGeometryArgs(geometryType, { size });
3740
+ }
3741
+ }
3742
+ const r3fNode = this.createNode(type, props, obj.name);
3743
+ if (props.draftMode) {
3744
+ r3fNode.assetMaturity = "draft";
3745
+ } else if (props.maturityOverride) {
3746
+ const m = props.maturityOverride;
3747
+ if (m === "draft" || m === "mesh" || m === "final") {
3748
+ r3fNode.assetMaturity = m;
3749
+ }
3750
+ }
3751
+ delete props.maturityOverride;
3752
+ if (obj.children && Array.isArray(obj.children)) {
3753
+ for (const child of obj.children) {
3754
+ r3fNode.children.push(this.compileObjectDecl(child));
3755
+ }
3756
+ }
3757
+ if (props.__gapsComponents && Array.isArray(props.__gapsComponents)) {
3758
+ for (const componentType of props.__gapsComponents) {
3759
+ const componentProps = {};
3760
+ if (componentType === "CloudRenderer" && props.volumetricClouds) {
3761
+ const vc = props.volumetricClouds;
3762
+ componentProps.coverage = vc.coverage ?? 0.5;
3763
+ componentProps.altitude = vc.altitude ?? 500;
3764
+ componentProps.windOffset = vc.wind ?? [0, 0, 0];
3765
+ componentProps.layers = vc.layers ?? 3;
3766
+ } else if (componentType === "GodRaysEffect" && props.godRays) {
3767
+ const gr = props.godRays;
3768
+ componentProps.intensity = gr.intensity ?? 1;
3769
+ componentProps.decay = gr.decay ?? 0.96;
3770
+ componentProps.lightColor = gr.color ?? "#fffde7";
3771
+ } else if (componentType === "FluidRenderer" && props.fluid) {
3772
+ const fl = props.fluid;
3773
+ componentProps.color = fl.color ?? "#1a6fc4";
3774
+ componentProps.particleSize = fl.particle_radius ?? 0.02;
3775
+ componentProps.renderMode = fl.render_mode ?? "points";
3776
+ }
3777
+ r3fNode.children.push(
3778
+ this.createNode(componentType, componentProps, `${obj.name}-${componentType}`)
3779
+ );
3780
+ }
3781
+ delete props.__gapsComponents;
3782
+ }
3783
+ return r3fNode;
3784
+ }
3785
+ /**
3786
+ * Compile a SystemNode into an R3FNode.
3787
+ *
3788
+ * Systems are logical containers with state, actions, lifecycle hooks,
3789
+ * and optionally child objects/UI. In the R3F tree, a system compiles
3790
+ * to a group node annotated with its rich metadata (state, actions,
3791
+ * hooks) so the runtime/renderer can wire up behavior.
3792
+ */
3793
+ compileSystemNode(node, templateMap) {
3794
+ const props = {};
3795
+ if (node.state) {
3796
+ props.systemState = node.state;
3797
+ }
3798
+ if (node.actions) {
3799
+ props.systemActions = node.actions;
3800
+ }
3801
+ if (node.hooks) {
3802
+ props.systemHooks = node.hooks;
3803
+ }
3804
+ if (node.properties && typeof node.properties === "object") {
3805
+ for (const [key, value] of Object.entries(node.properties)) {
3806
+ props[key] = value;
3807
+ }
3808
+ }
3809
+ const r3fNode = this.createNode("System", props, node.id || node.name);
3810
+ if (node.directives) {
3811
+ r3fNode.directives = node.directives;
3812
+ }
3813
+ if (node.directives) {
3814
+ for (const d of node.directives) {
3815
+ if (d.type === "trait") {
3816
+ r3fNode.traits?.set(d.name, d.config || {});
3817
+ }
3818
+ }
3819
+ }
3820
+ if (node.children && Array.isArray(node.children)) {
3821
+ for (const child of node.children) {
3822
+ r3fNode.children.push(this.compileChildNode(child, templateMap));
3823
+ }
3824
+ }
3825
+ if (node.ui && Array.isArray(node.ui)) {
3826
+ for (const uiNode of node.ui) {
3827
+ r3fNode.children.push(this.compileNode(uiNode));
3828
+ }
3829
+ }
3830
+ return r3fNode;
3831
+ }
3832
+ /**
3833
+ * Compile a ComponentNode into an R3FNode.
3834
+ *
3835
+ * Components are UI-focused containers with props, state, actions,
3836
+ * and render/UI blocks. They compile to a group node annotated with
3837
+ * component metadata for the runtime.
3838
+ */
3839
+ compileComponentNode(node, templateMap) {
3840
+ const props = {};
3841
+ if (node.props) {
3842
+ props.componentProps = node.props;
3843
+ }
3844
+ if (node.state) {
3845
+ props.componentState = node.state;
3846
+ }
3847
+ if (node.actions) {
3848
+ props.componentActions = node.actions;
3849
+ }
3850
+ if (node.hooks) {
3851
+ props.componentHooks = node.hooks;
3852
+ }
3853
+ if (node.properties && typeof node.properties === "object") {
3854
+ for (const [key, value] of Object.entries(node.properties)) {
3855
+ props[key] = value;
3856
+ }
3857
+ }
3858
+ const r3fNode = this.createNode(
3859
+ "Component",
3860
+ props,
3861
+ node.id || node.name
3862
+ );
3863
+ if (node.directives) {
3864
+ r3fNode.directives = node.directives;
3865
+ }
3866
+ if (node.directives) {
3867
+ for (const d of node.directives) {
3868
+ if (d.type === "trait") {
3869
+ r3fNode.traits?.set(d.name, d.config || {});
3870
+ }
3871
+ }
3872
+ }
3873
+ if (node.children && Array.isArray(node.children)) {
3874
+ for (const child of node.children) {
3875
+ r3fNode.children.push(this.compileChildNode(child, templateMap));
3876
+ }
3877
+ }
3878
+ if (node.ui && Array.isArray(node.ui)) {
3879
+ for (const uiNode of node.ui) {
3880
+ r3fNode.children.push(this.compileNode(uiNode));
3881
+ }
3882
+ }
3883
+ return r3fNode;
3884
+ }
3885
+ /**
3886
+ * Dispatch a child node to the appropriate compile method based on its type.
3887
+ * Used by compileSystemNode, compileComponentNode, and compileComposition
3888
+ * when processing the parser's children array.
3889
+ */
3890
+ compileChildNode(child, templateMap) {
3891
+ switch (child.type) {
3892
+ case "system":
3893
+ return this.compileSystemNode(child, templateMap);
3894
+ case "component":
3895
+ return this.compileComponentNode(child, templateMap);
3896
+ case "object":
3897
+ return this.compileObjectDecl(child, templateMap);
3898
+ case "template":
3899
+ if (templateMap && typeof child.name === "string") {
3900
+ templateMap.set(child.name, child);
3901
+ }
3902
+ return this.compileTemplateNode(child, templateMap);
3903
+ case "spatial_group":
3904
+ return this.compileSpatialGroup(child, templateMap);
3905
+ default:
3906
+ return this.compileNode(child);
3907
+ }
3908
+ }
3909
+ /**
3910
+ * Compile a template node. Templates define reusable types.
3911
+ * In the R3F tree, they compile to an empty group (they're not
3912
+ * rendered directly — objects "using" them inherit their properties).
3913
+ */
3914
+ compileTemplateNode(node, _templateMap) {
3915
+ const props = {};
3916
+ if (node.state || node.properties?.state) {
3917
+ props.templateState = node.state || node.properties?.state;
3918
+ }
3919
+ if (node.properties) {
3920
+ for (const [key, value] of Object.entries(node.properties)) {
3921
+ if (key !== "state") {
3922
+ props[key] = value;
3923
+ }
3924
+ }
3925
+ }
3926
+ return this.createNode("Template", props, node.name);
3927
+ }
3928
+ compileSpatialGroup(group, templateMap) {
3929
+ const props = {};
3930
+ if (group.properties) {
3931
+ for (const prop of group.properties) {
3932
+ if (prop.key === "position") props.position = prop.value;
3933
+ else if (prop.key === "rotation") props.rotation = prop.value;
3934
+ else if (prop.key === "scale")
3935
+ props.scale = Array.isArray(prop.value) ? prop.value : [prop.value, prop.value, prop.value];
3936
+ }
3937
+ }
3938
+ const node = this.createNode("group", props, group.name);
3939
+ if (group.objects) {
3940
+ for (const obj of group.objects)
3941
+ node.children.push(this.compileObjectDecl(obj, templateMap));
3942
+ }
3943
+ if (group.groups) {
3944
+ for (const sub of group.groups)
3945
+ node.children.push(this.compileSpatialGroup(sub, templateMap));
3946
+ }
3947
+ return node;
3948
+ }
3949
+ compileTimelineBlock(timeline) {
3950
+ const entries = [];
3951
+ if (timeline.entries) {
3952
+ for (const entry of timeline.entries) {
3953
+ const action = entry.action;
3954
+ const entryProps = { time: entry.time, actionKind: action.kind };
3955
+ if (action.kind === "animate") {
3956
+ entryProps.target = action.target;
3957
+ entryProps.properties = action.properties;
3958
+ } else if (action.kind === "emit") {
3959
+ entryProps.event = action.event;
3960
+ if (action.data !== void 0) entryProps.data = action.data;
3961
+ } else if (action.kind === "call") {
3962
+ entryProps.method = action.method;
3963
+ if (action.args) entryProps.args = action.args;
3964
+ }
3965
+ entries.push(this.createNode("TimelineEntry", entryProps));
3966
+ }
3967
+ }
3968
+ const safeName = timeline.name ? escapeStringValue(timeline.name, "JSX") : void 0;
3969
+ const timelineNode = this.createNode(
3970
+ "Timeline",
3971
+ { autoplay: timeline.autoplay, loop: timeline.loop },
3972
+ safeName
3973
+ );
3974
+ timelineNode.children = entries;
3975
+ return timelineNode;
3976
+ }
3977
+ compileAudioBlock(audio) {
3978
+ const props = {};
3979
+ if (audio.properties) {
3980
+ for (const prop of audio.properties) {
3981
+ if (prop.key === "src" || prop.key === "source") {
3982
+ props.src = prop.value;
3983
+ } else if (prop.key === "rolloff") {
3984
+ props.rolloffFactor = prop.value;
3985
+ } else {
3986
+ props[prop.key] = prop.value;
3987
+ }
3988
+ }
3989
+ }
3990
+ const safeName = audio.name ? escapeStringValue(audio.name, "JSX") : void 0;
3991
+ return this.createNode("Audio", props, safeName);
3992
+ }
3993
+ compileZoneBlock(zone) {
3994
+ const props = {};
3995
+ if (zone.properties) {
3996
+ for (const prop of zone.properties) {
3997
+ props[prop.key] = prop.value;
3998
+ }
3999
+ }
4000
+ if (zone.handlers && zone.handlers.length > 0) {
4001
+ props.handlers = zone.handlers.map(
4002
+ (h) => ({
4003
+ event: h.event,
4004
+ parameters: h.parameters,
4005
+ body: h.body
4006
+ })
4007
+ );
4008
+ }
4009
+ const safeName = zone.name ? escapeStringValue(zone.name, "JSX") : void 0;
4010
+ return this.createNode("Zone", props, safeName);
4011
+ }
4012
+ compileUIBlock(ui) {
4013
+ const children = [];
4014
+ if (ui.elements) {
4015
+ for (const el of ui.elements) {
4016
+ const elProps = {};
4017
+ if (el.properties) {
4018
+ for (const prop of el.properties) {
4019
+ if (prop.key === "font_size") {
4020
+ elProps.fontSize = prop.value;
4021
+ } else {
4022
+ elProps[prop.key] = this.resolveValue(prop.value);
4023
+ }
4024
+ }
4025
+ }
4026
+ const safeElName = el.name ? escapeStringValue(el.name, "JSX") : void 0;
4027
+ children.push(this.createNode("UIElement", elProps, safeElName));
4028
+ }
4029
+ }
4030
+ const uiNode = this.createNode("UI", {}, "__ui");
4031
+ uiNode.children = children;
4032
+ return uiNode;
4033
+ }
4034
+ compileTransitionBlock(transition) {
4035
+ const props = {};
4036
+ if (transition.properties) {
4037
+ for (const prop of transition.properties) {
4038
+ props[prop.key] = prop.value;
4039
+ }
4040
+ }
4041
+ const safeName = transition.name ? escapeStringValue(transition.name, "JSX") : void 0;
4042
+ return this.createNode("Transition", props, safeName);
4043
+ }
4044
+ compileConditionalBlock(cond, templateMap) {
4045
+ const children = [];
4046
+ if (cond.objects) {
4047
+ for (const obj of cond.objects)
4048
+ children.push(this.compileObjectDecl(obj, templateMap));
4049
+ }
4050
+ if (cond.spatialGroups) {
4051
+ for (const g of cond.spatialGroups)
4052
+ children.push(this.compileSpatialGroup(g, templateMap));
4053
+ }
4054
+ const elseChildren = [];
4055
+ if (cond.elseObjects) {
4056
+ for (const obj of cond.elseObjects)
4057
+ elseChildren.push(this.compileObjectDecl(obj, templateMap));
4058
+ }
4059
+ if (cond.elseSpatialGroups) {
4060
+ for (const g of cond.elseSpatialGroups)
4061
+ elseChildren.push(this.compileSpatialGroup(g, templateMap));
4062
+ }
4063
+ const conditionalNode = this.createNode("ConditionalGroup", {
4064
+ condition: cond.condition,
4065
+ elseChildren: elseChildren.length > 0 ? elseChildren : void 0
4066
+ });
4067
+ conditionalNode.children = children;
4068
+ return conditionalNode;
4069
+ }
4070
+ compileForEachBlock(iter, templateMap) {
4071
+ const templateChildren = [];
4072
+ if (iter.objects) {
4073
+ for (const obj of iter.objects)
4074
+ templateChildren.push(this.compileObjectDecl(obj, templateMap));
4075
+ }
4076
+ if (iter.spatialGroups) {
4077
+ for (const g of iter.spatialGroups)
4078
+ templateChildren.push(this.compileSpatialGroup(g, templateMap));
4079
+ }
4080
+ const forEachNode = this.createNode("ForEachGroup", {
4081
+ variable: iter.variable,
4082
+ iterable: iter.iterable
4083
+ });
4084
+ forEachNode.children = templateChildren;
4085
+ return forEachNode;
4086
+ }
4087
+ /**
4088
+ * Resolve a property value, converting bind expressions into runtime-reactive markers.
4089
+ */
4090
+ resolveValue(value) {
4091
+ if (value && typeof value === "object" && value.__bind) {
4092
+ return {
4093
+ __bind: true,
4094
+ source: value.source,
4095
+ transform: value.transform
4096
+ };
4097
+ }
4098
+ return value;
4099
+ }
4100
+ // ─── Shared Helpers ───────────────────────────────────────────────────
4101
+ injectDefaultLighting(root) {
4102
+ if (!this._defaultLighting) return;
4103
+ if (!this.treeHasLights(root)) {
4104
+ const shadowSize = this.tierScales.shadowMapSize;
4105
+ root.children?.unshift(
4106
+ this.createNode("ambientLight", { intensity: 0.4, color: "#ffffff" }),
4107
+ this.createNode("directionalLight", {
4108
+ intensity: 1,
4109
+ position: [5, 10, 5],
4110
+ castShadow: true,
4111
+ "shadow-mapSize": [shadowSize, shadowSize],
4112
+ color: "#ffffff"
4113
+ })
4114
+ );
4115
+ }
4116
+ }
4117
+ treeHasLights(node) {
4118
+ if (node.type.toLowerCase().includes("light")) return true;
4119
+ return node.children?.some((c) => this.treeHasLights(c)) || false;
4120
+ }
4121
+ hasPostProcessing(node) {
4122
+ if (node.traits?.has("bloom") || node.traits?.has("postprocessing"))
4123
+ return true;
4124
+ if (node.props.bloom) return true;
4125
+ return node.children?.some((c) => this.hasPostProcessing(c)) || false;
4126
+ }
4127
+ extractPostProcessingNodes(node) {
4128
+ const effects = [];
4129
+ const ppTrait = node.traits?.get(
4130
+ "postprocessing"
4131
+ );
4132
+ if (ppTrait) {
4133
+ if (ppTrait.bloom)
4134
+ effects.push(this.createNode("Bloom", ppTrait.bloom));
4135
+ if (ppTrait.ssao)
4136
+ effects.push(this.createNode("SSAO", ppTrait.ssao));
4137
+ if (ppTrait.vignette)
4138
+ effects.push(this.createNode("Vignette", ppTrait.vignette));
4139
+ }
4140
+ if (node.props.bloom) {
4141
+ const bloom = node.props.bloom;
4142
+ const bloomProps = typeof bloom === "object" && bloom !== null ? bloom : { intensity: 1 };
4143
+ effects.push(this.createNode("Bloom", bloomProps));
4144
+ }
4145
+ node.children?.forEach((child) => effects.push(...this.extractPostProcessingNodes(child)));
4146
+ return effects;
4147
+ }
4148
+ mapType(type, props) {
4149
+ if (type === "environment") {
4150
+ if (props.name && typeof props.name === "string" && ENVIRONMENT_PRESETS[props.name]) {
4151
+ Object.assign(props, ENVIRONMENT_PRESETS[props.name]);
4152
+ }
4153
+ return "Environment";
4154
+ }
4155
+ if (type === "light") {
4156
+ const lightType = props.type || "directional";
4157
+ const lightMapping = {
4158
+ directional: "directionalLight",
4159
+ point: "pointLight",
4160
+ spot: "spotLight",
4161
+ hemisphere: "hemisphereLight",
4162
+ ambient: "ambientLight",
4163
+ area: "rectAreaLight"
4164
+ };
4165
+ return lightMapping[lightType] || "directionalLight";
4166
+ }
4167
+ if (type === "portal") return "Portal";
4168
+ if (type === "sparkles") return "Sparkles";
4169
+ if (MESH_TYPES.has(type)) {
4170
+ props.hsType = type;
4171
+ return "mesh";
4172
+ }
4173
+ const mapping = {
4174
+ ambient_light: "ambientLight",
4175
+ model: "gltfModel",
4176
+ audio: "positionalAudio",
4177
+ composition: "group",
4178
+ scale: "group",
4179
+ focus: "group",
4180
+ spatial_agent: "SpatialAgent",
4181
+ spatial_container: "group",
4182
+ ui_panel: "UIPanel",
4183
+ ui_text: "UIText",
4184
+ ui_button: "UIButton",
4185
+ ui_slider: "UISlider",
4186
+ ui_input: "UIInput",
4187
+ ui_image: "UIImage",
4188
+ ui_chart: "UIChart",
4189
+ ui_gauge: "UIGauge",
4190
+ ui_value: "UIValue",
4191
+ ui_status_indicator: "UIStatusIndicator",
4192
+ tool_slot: "ToolSlot",
4193
+ behavior: "group",
4194
+ system: "System",
4195
+ component: "Component",
4196
+ dna: "DNA",
4197
+ gaussian_splat: "GaussianSplat",
4198
+ splat: "GaussianSplat",
4199
+ nerf: "NeRF",
4200
+ volumetric_video: "VolumetricVideo",
4201
+ world: "group"
4202
+ };
4203
+ return mapping[type] || type;
4204
+ }
4205
+ compileProperties(node, rawProps) {
4206
+ const expandedProps = this.expandSpreads(rawProps);
4207
+ const props = { ...expandedProps };
4208
+ if (node.position) {
4209
+ props.position = node.position;
4210
+ }
4211
+ if (rawProps.position && Array.isArray(rawProps.position)) {
4212
+ props.position = rawProps.position;
4213
+ }
4214
+ if (node.hologram) {
4215
+ const h = node.hologram;
4216
+ if (h.color) props.color = h.color;
4217
+ if (MESH_TYPES.has(node.type)) {
4218
+ props.args = this.getGeometryArgs(node.type, h);
4219
+ props.hsType = node.type;
4220
+ }
4221
+ }
4222
+ if (rawProps.scale !== void 0 && !props.scale) {
4223
+ props.scale = Array.isArray(rawProps.scale) ? rawProps.scale : [rawProps.scale, rawProps.scale, rawProps.scale];
4224
+ }
4225
+ if (rawProps.geometry && !props.hsType) {
4226
+ props.hsType = rawProps.geometry;
4227
+ props.args = this.getGeometryArgs(rawProps.geometry, { size: rawProps.size || 1 });
4228
+ }
4229
+ if (rawProps.material && typeof rawProps.material === "string" && MATERIAL_PRESETS[rawProps.material]) {
4230
+ props.materialProps = {
4231
+ ...MATERIAL_PRESETS[rawProps.material],
4232
+ ...props.materialProps
4233
+ };
4234
+ }
4235
+ if (node.directives) {
4236
+ for (const d of node.directives) {
4237
+ if (d.type === "trait") {
4238
+ if (d.name === "grabbable") {
4239
+ props.castShadow = true;
4240
+ props.grabbable = d.config || true;
4241
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
4242
+ if (!props.collider) props.collider = { type: "auto" };
4243
+ } else if (d.name === "animated") {
4244
+ props.animated = d.config || true;
4245
+ } else if (d.name === "spatial_audio" || d.name === "voice") {
4246
+ props.spatial = true;
4247
+ } else if (d.name === "gem_resonance") {
4248
+ props.gemResonance = gemResonanceConfig(d.config);
4249
+ props.spatial = true;
4250
+ } else if (d.name === "networked") {
4251
+ props.networked = d.config || true;
4252
+ } else if (d.name === "moldable") {
4253
+ props.moldable = d.config || true;
4254
+ } else if (d.name === "stretchable") {
4255
+ props.stretchable = d.config || true;
4256
+ } else if (d.name === "ai_driven") {
4257
+ props.ai_driven = d.config || true;
4258
+ } else if (d.name === "dialogue") {
4259
+ props.dialogue = d.config || true;
4260
+ } else if (d.name === "gesture") {
4261
+ props.gesture = d.config || true;
4262
+ } else if (d.name === "haptic") {
4263
+ props.haptic = d.config || true;
4264
+ } else if (d.name === "avatar_embodiment") {
4265
+ props.avatarEmbodiment = d.config || true;
4266
+ } else if (d.name === "lip_sync") {
4267
+ props.lipSync = d.config || true;
4268
+ } else if (d.name === "emotion_directive") {
4269
+ props.emotionDirective = d.config || true;
4270
+ } else if (d.name === "stt") {
4271
+ props.stt = d.config || true;
4272
+ } else if (d.name === "tts") {
4273
+ props.tts = d.config || true;
4274
+ } else if (d.name === "generate") {
4275
+ props.generate = d.config;
4276
+ } else if (d.name === "skeleton") {
4277
+ props.skeleton = d.config || true;
4278
+ } else if (d.name === "body") {
4279
+ props.body = d.config || true;
4280
+ } else if (d.name === "gaussian_splat") {
4281
+ props.gaussianSplat = d.config || true;
4282
+ } else if (d.name === "nerf") {
4283
+ props.nerf = d.config || true;
4284
+ } else if (d.name === "volumetric_video") {
4285
+ props.volumetricVideo = d.config || true;
4286
+ } else if (d.name === "web_surface") {
4287
+ props.webSurface = d.config || true;
4288
+ }
4289
+ }
4290
+ }
4291
+ }
4292
+ delete props.type;
4293
+ delete props.geometry;
4294
+ return props;
4295
+ }
4296
+ applyGraphicsConfig(r3fNode, graphics) {
4297
+ if (graphics.material) {
4298
+ const m = graphics.material;
4299
+ const materialProps = {};
4300
+ if (m.preset && MATERIAL_PRESETS[m.preset]) {
4301
+ Object.assign(materialProps, MATERIAL_PRESETS[m.preset]);
4302
+ }
4303
+ if (m.type === "pbr" && m.pbr) {
4304
+ if (m.pbr.baseColor) materialProps["color"] = this.mapColor(m.pbr.baseColor);
4305
+ if (m.pbr.metallic !== void 0) materialProps["metalness"] = m.pbr.metallic;
4306
+ if (m.pbr.roughness !== void 0) materialProps["roughness"] = m.pbr.roughness;
4307
+ if (m.pbr.emission) materialProps["emissive"] = this.mapColor(m.pbr.emission);
4308
+ if (m.pbr.emissionStrength) materialProps["emissiveIntensity"] = m.pbr.emissionStrength;
4309
+ if (m.pbr.clearcoat !== void 0) materialProps["clearcoat"] = m.pbr.clearcoat;
4310
+ if (m.pbr.transmission !== void 0) materialProps["transmission"] = m.pbr.transmission;
4311
+ if (m.pbr.ior !== void 0) materialProps["ior"] = m.pbr.ior;
4312
+ if (m.pbr.iridescence !== void 0) materialProps["iridescence"] = m.pbr.iridescence;
4313
+ }
4314
+ const prior = r3fNode.props.materialProps ?? {};
4315
+ r3fNode.props.materialProps = { ...prior, ...materialProps };
4316
+ }
4317
+ if (graphics.lighting) {
4318
+ const l = graphics.lighting;
4319
+ if (r3fNode.type.toLowerCase().includes("light")) {
4320
+ if (l.shadows) r3fNode.props.castShadow = true;
4321
+ if (l.intensity !== void 0) r3fNode.props.intensity = l.intensity;
4322
+ if (l.color) r3fNode.props.color = this.mapColor(l.color);
4323
+ }
4324
+ if (r3fNode.type === "Environment" && l.preset) {
4325
+ r3fNode.props.preset = l.preset;
4326
+ }
4327
+ }
4328
+ if (graphics.networked) {
4329
+ r3fNode.props.networked = graphics.networked;
4330
+ }
4331
+ }
4332
+ mapColor(c) {
4333
+ if (typeof c === "string") return c;
4334
+ if (typeof c === "number") return `#${c.toString(16).padStart(6, "0")}`;
4335
+ if (c.r !== void 0) {
4336
+ const r = c.r > 1 ? c.r : Math.floor(c.r * 255);
4337
+ const g = c.g > 1 ? c.g : Math.floor(c.g * 255);
4338
+ const b = c.b > 1 ? c.b : Math.floor(c.b * 255);
4339
+ return `rgb(${r}, ${g}, ${b})`;
4340
+ }
4341
+ return "#ffffff";
4342
+ }
4343
+ getGeometryArgs(type, hologram) {
4344
+ const size = hologram.size || 1;
4345
+ switch (type) {
4346
+ case "sphere":
4347
+ case "orb":
4348
+ return [size * 0.5, 32, 32];
4349
+ case "cube":
4350
+ case "box":
4351
+ return [size, size, size];
4352
+ case "cylinder":
4353
+ return [size * 0.5, size * 0.5, size, 32];
4354
+ case "pyramid":
4355
+ case "cone":
4356
+ return [size * 0.5, 0, size, 4];
4357
+ case "plane":
4358
+ return [size, size];
4359
+ case "torus":
4360
+ return [size * 0.5, size * 0.15, 16, 32];
4361
+ case "ring":
4362
+ return [size * 0.3, size * 0.5, 32];
4363
+ case "capsule":
4364
+ return [size * 0.3, size * 0.5, 4, 16];
4365
+ default:
4366
+ return [size, size, size];
4367
+ }
4368
+ }
4369
+ };
4370
+ }
4371
+ });
4372
+
4373
+ export { ASTNodePool, ENVIRONMENT_PRESETS, MATERIAL_PRESETS, QUALITY_TIER_SCALES, R3FCompiler, R3FCompiler_exports, UI_COMPONENT_PRESETS, init_ObjectPool, init_R3FCompiler, init_visual, registerAllPresets };
4374
+ //# sourceMappingURL=chunk-UM6C3CGK.js.map
4375
+ //# sourceMappingURL=chunk-UM6C3CGK.js.map