@splinetool/runtime 2.0.92 → 2.0.94

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 (412) hide show
  1. package/build/{runtime-DRACOLoader-GLMRFFK2.js → runtime-DRACOLoader-SDMMLQLV.js} +1 -1
  2. package/build/runtime-DRACOLoader-SDMMLQLV.js.br +0 -0
  3. package/build/runtime-DRACOLoader-SDMMLQLV.js.gz +0 -0
  4. package/build/{runtime-aiAssistant-5ECVEZLI.js → runtime-aiAssistant-MKZQ23BA.js} +1 -1
  5. package/build/runtime-aiAssistant-MKZQ23BA.js.br +0 -0
  6. package/build/runtime-aiAssistant-MKZQ23BA.js.gz +0 -0
  7. package/build/{runtime-apiServices-J4QEEJ2S.js → runtime-apiServices-YYNQCMLP.js} +1 -1
  8. package/build/runtime-apiServices-YYNQCMLP.js.br +0 -0
  9. package/build/runtime-apiServices-YYNQCMLP.js.gz +0 -0
  10. package/build/{runtime-audio-P56XBVSL.js → runtime-audio-GPQ4HYPM.js} +1 -1
  11. package/build/runtime-audio-GPQ4HYPM.js.br +0 -0
  12. package/build/runtime-audio-GPQ4HYPM.js.gz +0 -0
  13. package/build/{runtime-bloom-5BWRSKXE.js → runtime-bloom-UMJG5YKZ.js} +1 -1
  14. package/build/runtime-bloom-UMJG5YKZ.js.br +0 -0
  15. package/build/runtime-bloom-UMJG5YKZ.js.gz +0 -0
  16. package/build/{runtime-brightnessContrast-GBILAHY5.js → runtime-brightnessContrast-LRDMKXC2.js} +1 -1
  17. package/build/runtime-brightnessContrast-LRDMKXC2.js.br +0 -0
  18. package/build/runtime-brightnessContrast-LRDMKXC2.js.gz +0 -0
  19. package/build/{runtime-chromaticAberration-XNVWJQWI.js → runtime-chromaticAberration-X46NQTBB.js} +1 -1
  20. package/build/runtime-chromaticAberration-X46NQTBB.js.br +0 -0
  21. package/build/runtime-chromaticAberration-X46NQTBB.js.gz +0 -0
  22. package/build/{runtime-chunk-J53RQDYR.js → runtime-chunk-32XVU5DS.js} +1 -1
  23. package/build/runtime-chunk-32XVU5DS.js.br +0 -0
  24. package/build/runtime-chunk-32XVU5DS.js.gz +0 -0
  25. package/build/{runtime-chunk-JKFC5GFF.js → runtime-chunk-33EF3BLM.js} +1 -1
  26. package/build/runtime-chunk-33EF3BLM.js.br +0 -0
  27. package/build/runtime-chunk-33EF3BLM.js.gz +0 -0
  28. package/build/runtime-chunk-3Q4J5ROW.js +1 -0
  29. package/build/runtime-chunk-3Q4J5ROW.js.br +0 -0
  30. package/build/runtime-chunk-3Q4J5ROW.js.gz +0 -0
  31. package/build/{runtime-chunk-36CLBSQD.js → runtime-chunk-4Y4AXXPU.js} +1 -1
  32. package/build/runtime-chunk-4Y4AXXPU.js.br +0 -0
  33. package/build/runtime-chunk-4Y4AXXPU.js.gz +0 -0
  34. package/build/{runtime-chunk-MTXG5LUQ.js → runtime-chunk-AEPWABER.js} +1 -1
  35. package/build/runtime-chunk-AEPWABER.js.br +0 -0
  36. package/build/runtime-chunk-AEPWABER.js.gz +0 -0
  37. package/build/{runtime-chunk-R6L7MCY3.js → runtime-chunk-AU3CL3GR.js} +1 -1
  38. package/build/runtime-chunk-AU3CL3GR.js.br +0 -0
  39. package/build/runtime-chunk-AU3CL3GR.js.gz +0 -0
  40. package/build/{runtime-chunk-QSWZYIFB.js → runtime-chunk-BFGZJ4LR.js} +1 -1
  41. package/build/runtime-chunk-BFGZJ4LR.js.br +0 -0
  42. package/build/runtime-chunk-BFGZJ4LR.js.gz +0 -0
  43. package/build/{runtime-chunk-KOR4TIQN.js → runtime-chunk-D3OIGZUW.js} +1 -1
  44. package/build/runtime-chunk-D3OIGZUW.js.br +0 -0
  45. package/build/runtime-chunk-D3OIGZUW.js.gz +0 -0
  46. package/build/runtime-chunk-DCC352GL.js +1 -0
  47. package/build/runtime-chunk-DCC352GL.js.br +0 -0
  48. package/build/runtime-chunk-DCC352GL.js.gz +0 -0
  49. package/build/runtime-chunk-E4UNJ4TR.js +1 -0
  50. package/build/runtime-chunk-E4UNJ4TR.js.br +0 -0
  51. package/build/runtime-chunk-E4UNJ4TR.js.gz +0 -0
  52. package/build/{runtime-chunk-RUQ6SJPM.js → runtime-chunk-EEVK6AD6.js} +1 -1
  53. package/build/runtime-chunk-EEVK6AD6.js.br +0 -0
  54. package/build/runtime-chunk-EEVK6AD6.js.gz +0 -0
  55. package/build/{runtime-chunk-KHCWX7UM.js → runtime-chunk-F6XTFQMZ.js} +1 -1
  56. package/build/runtime-chunk-F6XTFQMZ.js.br +0 -0
  57. package/build/runtime-chunk-F6XTFQMZ.js.gz +0 -0
  58. package/build/{runtime-chunk-HBZCKQBD.js → runtime-chunk-FZVL5H67.js} +1 -1
  59. package/build/runtime-chunk-FZVL5H67.js.br +0 -0
  60. package/build/runtime-chunk-FZVL5H67.js.gz +0 -0
  61. package/build/{runtime-chunk-AUIS3MRY.js → runtime-chunk-GD4SGFHZ.js} +1 -1
  62. package/build/runtime-chunk-GD4SGFHZ.js.br +0 -0
  63. package/build/runtime-chunk-GD4SGFHZ.js.gz +0 -0
  64. package/build/{runtime-chunk-TEGAP3DX.js → runtime-chunk-GSKBI4RN.js} +1 -1
  65. package/build/runtime-chunk-GSKBI4RN.js.br +0 -0
  66. package/build/runtime-chunk-GSKBI4RN.js.gz +0 -0
  67. package/build/{runtime-chunk-3H2EF32R.js → runtime-chunk-HGPSGN65.js} +1 -1
  68. package/build/runtime-chunk-HGPSGN65.js.br +2 -0
  69. package/build/runtime-chunk-HGPSGN65.js.gz +0 -0
  70. package/build/runtime-chunk-HOOQDTK7.js +1 -0
  71. package/build/runtime-chunk-HOOQDTK7.js.br +0 -0
  72. package/build/runtime-chunk-HOOQDTK7.js.gz +0 -0
  73. package/build/{runtime-chunk-CKYSGX2V.js → runtime-chunk-IBVB6UVI.js} +1 -1
  74. package/build/runtime-chunk-IBVB6UVI.js.br +0 -0
  75. package/build/runtime-chunk-IBVB6UVI.js.gz +0 -0
  76. package/build/{runtime-chunk-JPQPMU3J.js → runtime-chunk-JABQRWT5.js} +1 -1
  77. package/build/runtime-chunk-JABQRWT5.js.br +0 -0
  78. package/build/runtime-chunk-JABQRWT5.js.gz +0 -0
  79. package/build/runtime-chunk-JJVEXKEO.js +1 -0
  80. package/build/runtime-chunk-JJVEXKEO.js.br +0 -0
  81. package/build/runtime-chunk-JJVEXKEO.js.gz +0 -0
  82. package/build/{runtime-chunk-HEEYURNH.js → runtime-chunk-JTXN6DIH.js} +1 -1
  83. package/build/runtime-chunk-JTXN6DIH.js.br +0 -0
  84. package/build/runtime-chunk-JTXN6DIH.js.gz +0 -0
  85. package/build/{runtime-chunk-UI6FZJSE.js → runtime-chunk-KJQWLDYH.js} +1 -1
  86. package/build/runtime-chunk-KJQWLDYH.js.br +0 -0
  87. package/build/runtime-chunk-KJQWLDYH.js.gz +0 -0
  88. package/build/runtime-chunk-KPOUV3HD.js +1 -0
  89. package/build/runtime-chunk-KPOUV3HD.js.br +0 -0
  90. package/build/runtime-chunk-KPOUV3HD.js.gz +0 -0
  91. package/build/{runtime-chunk-K7TL4PIJ.js → runtime-chunk-KQTC7OLV.js} +1 -1
  92. package/build/runtime-chunk-KQTC7OLV.js.br +0 -0
  93. package/build/runtime-chunk-KQTC7OLV.js.gz +0 -0
  94. package/build/{runtime-chunk-DSXX6SLP.js → runtime-chunk-PF6YNLMZ.js} +1 -1
  95. package/build/runtime-chunk-PF6YNLMZ.js.br +0 -0
  96. package/build/runtime-chunk-PF6YNLMZ.js.gz +0 -0
  97. package/build/{runtime-chunk-PYCMOG7D.js → runtime-chunk-PWMK5MVJ.js} +1 -1
  98. package/build/runtime-chunk-PWMK5MVJ.js.br +0 -0
  99. package/build/runtime-chunk-PWMK5MVJ.js.gz +0 -0
  100. package/build/runtime-chunk-QJMMF3L2.js +1 -0
  101. package/build/runtime-chunk-QJMMF3L2.js.br +0 -0
  102. package/build/runtime-chunk-QJMMF3L2.js.gz +0 -0
  103. package/build/{runtime-chunk-PONAD3UD.js → runtime-chunk-REXAQKUN.js} +1 -1
  104. package/build/runtime-chunk-REXAQKUN.js.br +0 -0
  105. package/build/runtime-chunk-REXAQKUN.js.gz +0 -0
  106. package/build/{runtime-chunk-LSRIE5CU.js → runtime-chunk-RWYT7G6G.js} +1 -1
  107. package/build/runtime-chunk-RWYT7G6G.js.br +0 -0
  108. package/build/runtime-chunk-RWYT7G6G.js.gz +0 -0
  109. package/build/{runtime-chunk-KARVJCBP.js → runtime-chunk-WYIK4MJQ.js} +1 -1
  110. package/build/runtime-chunk-WYIK4MJQ.js.br +0 -0
  111. package/build/runtime-chunk-WYIK4MJQ.js.gz +0 -0
  112. package/build/runtime-chunk-ZA3HZGIR.js +1 -0
  113. package/build/runtime-chunk-ZA3HZGIR.js.br +0 -0
  114. package/build/runtime-chunk-ZA3HZGIR.js.gz +0 -0
  115. package/build/{runtime-chunk-3AHB3XAD.js → runtime-chunk-ZFM73G2B.js} +1 -1
  116. package/build/runtime-chunk-ZFM73G2B.js.br +0 -0
  117. package/build/runtime-chunk-ZFM73G2B.js.gz +0 -0
  118. package/build/{runtime-chunk-WHEALKAN.js → runtime-chunk-ZJIYRGBK.js} +1 -1
  119. package/build/runtime-chunk-ZJIYRGBK.js.br +0 -0
  120. package/build/runtime-chunk-ZJIYRGBK.js.gz +0 -0
  121. package/build/{runtime-classicRuntime-OKLTCERD.js → runtime-classicRuntime-WIJ56CKR.js} +1 -1
  122. package/build/runtime-classicRuntime-WIJ56CKR.js.br +0 -0
  123. package/build/runtime-classicRuntime-WIJ56CKR.js.gz +0 -0
  124. package/build/runtime-cloners-2S7SALQM.js +1 -0
  125. package/build/runtime-cloners-2S7SALQM.js.br +1 -0
  126. package/build/runtime-cloners-2S7SALQM.js.gz +0 -0
  127. package/build/{runtime-collisionBVH-CQUE6RZV.js → runtime-collisionBVH-JA4BEOA7.js} +1 -1
  128. package/build/runtime-collisionBVH-JA4BEOA7.js.br +0 -0
  129. package/build/runtime-collisionBVH-JA4BEOA7.js.gz +0 -0
  130. package/build/{runtime-components-64WWNUFT.js → runtime-components-3T3QMQUH.js} +1 -1
  131. package/build/runtime-components-3T3QMQUH.js.br +0 -0
  132. package/build/runtime-components-3T3QMQUH.js.gz +0 -0
  133. package/build/{runtime-conditional-SK6JLPTN.js → runtime-conditional-CCGDVDMD.js} +1 -1
  134. package/build/runtime-conditional-CCGDVDMD.js.br +0 -0
  135. package/build/runtime-conditional-CCGDVDMD.js.gz +0 -0
  136. package/build/{runtime-createDestroy-TRMSN4GV.js → runtime-createDestroy-W6FF4RAP.js} +1 -1
  137. package/build/runtime-createDestroy-W6FF4RAP.js.br +0 -0
  138. package/build/runtime-createDestroy-W6FF4RAP.js.gz +0 -0
  139. package/build/{runtime-depthOfField-V2X263JE.js → runtime-depthOfField-DSE6YVZ4.js} +1 -1
  140. package/build/runtime-depthOfField-DSE6YVZ4.js.br +0 -0
  141. package/build/runtime-depthOfField-DSE6YVZ4.js.gz +0 -0
  142. package/build/{runtime-dragDrop-YPF34K77.js → runtime-dragDrop-2TMWDGUQ.js} +1 -1
  143. package/build/runtime-dragDrop-2TMWDGUQ.js.br +0 -0
  144. package/build/runtime-dragDrop-2TMWDGUQ.js.gz +0 -0
  145. package/build/{runtime-fxBloom-4HSWHGBL.js → runtime-fxBloom-4HB5FTK3.js} +1 -1
  146. package/build/runtime-fxBloom-4HB5FTK3.js.br +0 -0
  147. package/build/runtime-fxBloom-4HB5FTK3.js.gz +0 -0
  148. package/build/{runtime-fxDepthOfField-NGC6SATF.js → runtime-fxDepthOfField-URCQCIRP.js} +1 -1
  149. package/build/runtime-fxDepthOfField-URCQCIRP.js.br +0 -0
  150. package/build/runtime-fxDepthOfField-URCQCIRP.js.gz +0 -0
  151. package/build/{runtime-gameControls-TZIFAJNU.js → runtime-gameControls-VAUAOGUW.js} +1 -1
  152. package/build/runtime-gameControls-VAUAOGUW.js.br +0 -0
  153. package/build/runtime-gameControls-VAUAOGUW.js.gz +0 -0
  154. package/build/runtime-hair-NLGIEVG3.js +1 -0
  155. package/build/runtime-hair-NLGIEVG3.js.br +1 -0
  156. package/build/runtime-hair-NLGIEVG3.js.gz +0 -0
  157. package/build/{runtime-hueSaturation-YSHDI5JV.js → runtime-hueSaturation-TZ5VQY72.js} +1 -1
  158. package/build/runtime-hueSaturation-TZ5VQY72.js.br +0 -0
  159. package/build/runtime-hueSaturation-TZ5VQY72.js.gz +0 -0
  160. package/build/{runtime-mergeStaticGeometries-Y65NWJFJ.js → runtime-mergeStaticGeometries-K2YJKZ3C.js} +1 -1
  161. package/build/runtime-mergeStaticGeometries-K2YJKZ3C.js.br +0 -0
  162. package/build/runtime-mergeStaticGeometries-K2YJKZ3C.js.gz +0 -0
  163. package/build/{runtime-miscActions-MOVRBNCH.js → runtime-miscActions-6CUG2JSF.js} +1 -1
  164. package/build/runtime-miscActions-6CUG2JSF.js.br +0 -0
  165. package/build/runtime-miscActions-6CUG2JSF.js.gz +0 -0
  166. package/build/{runtime-mouseHover-GER5PBUZ.js → runtime-mouseHover-CYCSNNZM.js} +1 -1
  167. package/build/runtime-mouseHover-CYCSNNZM.js.br +0 -0
  168. package/build/runtime-mouseHover-CYCSNNZM.js.gz +0 -0
  169. package/build/{runtime-noise-QZ2I3334.js → runtime-noise-FLMWYKTL.js} +1 -1
  170. package/build/runtime-noise-FLMWYKTL.js.br +0 -0
  171. package/build/runtime-noise-FLMWYKTL.js.gz +0 -0
  172. package/build/{runtime-particles-CHBC6DAR.js → runtime-particles-PDPG5E74.js} +1 -1
  173. package/build/runtime-particles-PDPG5E74.js.br +0 -0
  174. package/build/runtime-particles-PDPG5E74.js.gz +0 -0
  175. package/build/{runtime-paths-PVIXWENH.js → runtime-paths-E4GHUGNN.js} +1 -1
  176. package/build/runtime-paths-E4GHUGNN.js.br +0 -0
  177. package/build/runtime-paths-E4GHUGNN.js.gz +0 -0
  178. package/build/{runtime-pixelation-VQFF744B.js → runtime-pixelation-AOFGI5XX.js} +1 -1
  179. package/build/runtime-pixelation-AOFGI5XX.js.br +0 -0
  180. package/build/runtime-pixelation-AOFGI5XX.js.gz +0 -0
  181. package/build/{runtime-resize-BXJTXBND.js → runtime-resize-DAWD3MKG.js} +1 -1
  182. package/build/runtime-resize-DAWD3MKG.js.br +0 -0
  183. package/build/runtime-resize-DAWD3MKG.js.gz +0 -0
  184. package/build/{runtime-sceneTransition-M7OWS6T4.js → runtime-sceneTransition-SFGBWSP3.js} +1 -1
  185. package/build/runtime-sceneTransition-SFGBWSP3.js.br +0 -0
  186. package/build/runtime-sceneTransition-SFGBWSP3.js.gz +0 -0
  187. package/build/{runtime-scroll-XEQZHHLW.js → runtime-scroll-HKLPDE7E.js} +1 -1
  188. package/build/runtime-scroll-HKLPDE7E.js.br +0 -0
  189. package/build/runtime-scroll-HKLPDE7E.js.gz +0 -0
  190. package/build/runtime-shapeBlends-COFJFXT6.js +1 -0
  191. package/build/runtime-shapeBlends-COFJFXT6.js.br +2 -0
  192. package/build/runtime-shapeBlends-COFJFXT6.js.gz +0 -0
  193. package/build/{runtime-text-NV4Q5BBQ.js → runtime-text-NQU4F3KI.js} +1 -1
  194. package/build/runtime-text-NQU4F3KI.js.br +0 -0
  195. package/build/runtime-text-NQU4F3KI.js.gz +0 -0
  196. package/build/{runtime-textInputs-COZOCG5V.js → runtime-textInputs-5WG7OPGO.js} +1 -1
  197. package/build/runtime-textInputs-5WG7OPGO.js.br +0 -0
  198. package/build/runtime-textInputs-5WG7OPGO.js.gz +0 -0
  199. package/build/{runtime-timeline-MPAYKXWO.js → runtime-timeline-EAC5OJEK.js} +1 -1
  200. package/build/runtime-timeline-EAC5OJEK.js.br +0 -0
  201. package/build/runtime-timeline-EAC5OJEK.js.gz +0 -0
  202. package/build/{runtime-tracking-M7CHXAE5.js → runtime-tracking-6CN7PQFK.js} +1 -1
  203. package/build/runtime-tracking-6CN7PQFK.js.br +0 -0
  204. package/build/runtime-tracking-6CN7PQFK.js.gz +0 -0
  205. package/build/{runtime-transitions-OBLPSHIH.js → runtime-transitions-N47Y4AXH.js} +1 -1
  206. package/build/runtime-transitions-N47Y4AXH.js.br +0 -0
  207. package/build/runtime-transitions-N47Y4AXH.js.gz +0 -0
  208. package/build/{runtime-ui2d-OV6PGPLG.js → runtime-ui2d-T3OZFBOE.js} +1 -1
  209. package/build/runtime-ui2d-T3OZFBOE.js.br +0 -0
  210. package/build/runtime-ui2d-T3OZFBOE.js.gz +0 -0
  211. package/build/{runtime-updater-RCOMZLTB.js → runtime-updater-6YEO4WI3.js} +1 -1
  212. package/build/runtime-updater-6YEO4WI3.js.br +2 -0
  213. package/build/runtime-updater-6YEO4WI3.js.gz +0 -0
  214. package/build/{runtime-variables-DJUQPZDB.js → runtime-variables-ICLL7DZV.js} +1 -1
  215. package/build/runtime-variables-ICLL7DZV.js.br +0 -0
  216. package/build/runtime-variables-ICLL7DZV.js.gz +0 -0
  217. package/build/{runtime-vectorShapes-2N52XZYF.js → runtime-vectorShapes-4MX2X2MH.js} +1 -1
  218. package/build/runtime-vectorShapes-4MX2X2MH.js.br +0 -0
  219. package/build/runtime-vectorShapes-4MX2X2MH.js.gz +0 -0
  220. package/build/{runtime-video-U5RS7HHJ.js → runtime-video-KFIFPA6P.js} +1 -1
  221. package/build/runtime-video-KFIFPA6P.js.br +0 -0
  222. package/build/runtime-video-KFIFPA6P.js.gz +0 -0
  223. package/build/{runtime-vignette-TYITST5S.js → runtime-vignette-S4Z7IMQ5.js} +1 -1
  224. package/build/runtime-vignette-S4Z7IMQ5.js.br +0 -0
  225. package/build/runtime-vignette-S4Z7IMQ5.js.gz +0 -0
  226. package/build/runtime-webgpu-JZZF7PVG.js +1 -0
  227. package/build/runtime-webgpu-JZZF7PVG.js.br +0 -0
  228. package/build/runtime-webgpu-JZZF7PVG.js.gz +0 -0
  229. package/build/runtime.cjs +16 -8
  230. package/build/runtime.js +1 -1
  231. package/build/runtime.js.br +0 -0
  232. package/build/runtime.js.gz +0 -0
  233. package/build/runtime.standalone.js +1 -1
  234. package/build/runtime.standalone.js.br +0 -0
  235. package/build/runtime.standalone.js.gz +0 -0
  236. package/build/runtime.standalone.webgl.js +1 -1
  237. package/build/runtime.standalone.webgl.js.br +0 -0
  238. package/build/runtime.standalone.webgl.js.gz +0 -0
  239. package/build/runtime.standalone.webgpu.js +1 -1
  240. package/build/runtime.standalone.webgpu.js.br +0 -0
  241. package/build/runtime.standalone.webgpu.js.gz +0 -0
  242. package/build/runtime.standalone.webgpu.micro.js +1 -1
  243. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  244. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  245. package/build/runtime.standalone.webgpu.min.js +1 -1
  246. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  247. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  248. package/package.json +1 -1
  249. package/build/runtime-DRACOLoader-GLMRFFK2.js.br +0 -0
  250. package/build/runtime-DRACOLoader-GLMRFFK2.js.gz +0 -0
  251. package/build/runtime-aiAssistant-5ECVEZLI.js.br +0 -0
  252. package/build/runtime-aiAssistant-5ECVEZLI.js.gz +0 -0
  253. package/build/runtime-apiServices-J4QEEJ2S.js.br +0 -0
  254. package/build/runtime-apiServices-J4QEEJ2S.js.gz +0 -0
  255. package/build/runtime-audio-P56XBVSL.js.br +0 -7
  256. package/build/runtime-audio-P56XBVSL.js.gz +0 -0
  257. package/build/runtime-bloom-5BWRSKXE.js.br +0 -0
  258. package/build/runtime-bloom-5BWRSKXE.js.gz +0 -0
  259. package/build/runtime-brightnessContrast-GBILAHY5.js.br +0 -0
  260. package/build/runtime-brightnessContrast-GBILAHY5.js.gz +0 -0
  261. package/build/runtime-chromaticAberration-XNVWJQWI.js.br +0 -0
  262. package/build/runtime-chromaticAberration-XNVWJQWI.js.gz +0 -0
  263. package/build/runtime-chunk-36CLBSQD.js.br +0 -0
  264. package/build/runtime-chunk-36CLBSQD.js.gz +0 -0
  265. package/build/runtime-chunk-3AHB3XAD.js.br +0 -0
  266. package/build/runtime-chunk-3AHB3XAD.js.gz +0 -0
  267. package/build/runtime-chunk-3H2EF32R.js.br +0 -2
  268. package/build/runtime-chunk-3H2EF32R.js.gz +0 -0
  269. package/build/runtime-chunk-66HDBRK4.js +0 -1
  270. package/build/runtime-chunk-66HDBRK4.js.br +0 -0
  271. package/build/runtime-chunk-66HDBRK4.js.gz +0 -0
  272. package/build/runtime-chunk-ACJIWRIH.js +0 -1
  273. package/build/runtime-chunk-ACJIWRIH.js.br +0 -0
  274. package/build/runtime-chunk-ACJIWRIH.js.gz +0 -0
  275. package/build/runtime-chunk-AUIS3MRY.js.br +0 -0
  276. package/build/runtime-chunk-AUIS3MRY.js.gz +0 -0
  277. package/build/runtime-chunk-BVVSZMXD.js +0 -1
  278. package/build/runtime-chunk-BVVSZMXD.js.br +0 -0
  279. package/build/runtime-chunk-BVVSZMXD.js.gz +0 -0
  280. package/build/runtime-chunk-CKYSGX2V.js.br +0 -0
  281. package/build/runtime-chunk-CKYSGX2V.js.gz +0 -0
  282. package/build/runtime-chunk-DSXX6SLP.js.br +0 -0
  283. package/build/runtime-chunk-DSXX6SLP.js.gz +0 -0
  284. package/build/runtime-chunk-FAESWIXG.js +0 -1
  285. package/build/runtime-chunk-FAESWIXG.js.br +0 -0
  286. package/build/runtime-chunk-FAESWIXG.js.gz +0 -0
  287. package/build/runtime-chunk-GXEXRQ6S.js +0 -1
  288. package/build/runtime-chunk-GXEXRQ6S.js.br +0 -0
  289. package/build/runtime-chunk-GXEXRQ6S.js.gz +0 -0
  290. package/build/runtime-chunk-HBZCKQBD.js.br +0 -0
  291. package/build/runtime-chunk-HBZCKQBD.js.gz +0 -0
  292. package/build/runtime-chunk-HEEYURNH.js.br +0 -0
  293. package/build/runtime-chunk-HEEYURNH.js.gz +0 -0
  294. package/build/runtime-chunk-J53RQDYR.js.br +0 -0
  295. package/build/runtime-chunk-J53RQDYR.js.gz +0 -0
  296. package/build/runtime-chunk-JKFC5GFF.js.br +0 -0
  297. package/build/runtime-chunk-JKFC5GFF.js.gz +0 -0
  298. package/build/runtime-chunk-JPQPMU3J.js.br +0 -0
  299. package/build/runtime-chunk-JPQPMU3J.js.gz +0 -0
  300. package/build/runtime-chunk-K7TL4PIJ.js.br +0 -0
  301. package/build/runtime-chunk-K7TL4PIJ.js.gz +0 -0
  302. package/build/runtime-chunk-KARVJCBP.js.br +0 -0
  303. package/build/runtime-chunk-KARVJCBP.js.gz +0 -0
  304. package/build/runtime-chunk-KHCWX7UM.js.br +0 -0
  305. package/build/runtime-chunk-KHCWX7UM.js.gz +0 -0
  306. package/build/runtime-chunk-KOR4TIQN.js.br +0 -0
  307. package/build/runtime-chunk-KOR4TIQN.js.gz +0 -0
  308. package/build/runtime-chunk-LSRIE5CU.js.br +0 -0
  309. package/build/runtime-chunk-LSRIE5CU.js.gz +0 -0
  310. package/build/runtime-chunk-MTXG5LUQ.js.br +0 -0
  311. package/build/runtime-chunk-MTXG5LUQ.js.gz +0 -0
  312. package/build/runtime-chunk-NEKALYDS.js +0 -1
  313. package/build/runtime-chunk-NEKALYDS.js.br +0 -0
  314. package/build/runtime-chunk-NEKALYDS.js.gz +0 -0
  315. package/build/runtime-chunk-PONAD3UD.js.br +0 -0
  316. package/build/runtime-chunk-PONAD3UD.js.gz +0 -0
  317. package/build/runtime-chunk-PYCMOG7D.js.br +0 -0
  318. package/build/runtime-chunk-PYCMOG7D.js.gz +0 -0
  319. package/build/runtime-chunk-QSWZYIFB.js.br +0 -0
  320. package/build/runtime-chunk-QSWZYIFB.js.gz +0 -0
  321. package/build/runtime-chunk-R6L7MCY3.js.br +0 -0
  322. package/build/runtime-chunk-R6L7MCY3.js.gz +0 -0
  323. package/build/runtime-chunk-RUQ6SJPM.js.br +0 -0
  324. package/build/runtime-chunk-RUQ6SJPM.js.gz +0 -0
  325. package/build/runtime-chunk-TEGAP3DX.js.br +0 -0
  326. package/build/runtime-chunk-TEGAP3DX.js.gz +0 -0
  327. package/build/runtime-chunk-UI6FZJSE.js.br +0 -0
  328. package/build/runtime-chunk-UI6FZJSE.js.gz +0 -0
  329. package/build/runtime-chunk-WHEALKAN.js.br +0 -0
  330. package/build/runtime-chunk-WHEALKAN.js.gz +0 -0
  331. package/build/runtime-chunk-WMPEU73G.js +0 -1
  332. package/build/runtime-chunk-WMPEU73G.js.br +0 -0
  333. package/build/runtime-chunk-WMPEU73G.js.gz +0 -0
  334. package/build/runtime-chunk-XXDLMDCN.js +0 -1
  335. package/build/runtime-chunk-XXDLMDCN.js.br +0 -0
  336. package/build/runtime-chunk-XXDLMDCN.js.gz +0 -0
  337. package/build/runtime-classicRuntime-OKLTCERD.js.br +0 -0
  338. package/build/runtime-classicRuntime-OKLTCERD.js.gz +0 -0
  339. package/build/runtime-cloners-W6DM7SHL.js +0 -1
  340. package/build/runtime-cloners-W6DM7SHL.js.br +0 -1
  341. package/build/runtime-cloners-W6DM7SHL.js.gz +0 -0
  342. package/build/runtime-collisionBVH-CQUE6RZV.js.br +0 -0
  343. package/build/runtime-collisionBVH-CQUE6RZV.js.gz +0 -0
  344. package/build/runtime-components-64WWNUFT.js.br +0 -0
  345. package/build/runtime-components-64WWNUFT.js.gz +0 -0
  346. package/build/runtime-conditional-SK6JLPTN.js.br +0 -0
  347. package/build/runtime-conditional-SK6JLPTN.js.gz +0 -0
  348. package/build/runtime-createDestroy-TRMSN4GV.js.br +0 -0
  349. package/build/runtime-createDestroy-TRMSN4GV.js.gz +0 -0
  350. package/build/runtime-depthOfField-V2X263JE.js.br +0 -0
  351. package/build/runtime-depthOfField-V2X263JE.js.gz +0 -0
  352. package/build/runtime-dragDrop-YPF34K77.js.br +0 -0
  353. package/build/runtime-dragDrop-YPF34K77.js.gz +0 -0
  354. package/build/runtime-fxBloom-4HSWHGBL.js.br +0 -0
  355. package/build/runtime-fxBloom-4HSWHGBL.js.gz +0 -0
  356. package/build/runtime-fxDepthOfField-NGC6SATF.js.br +0 -0
  357. package/build/runtime-fxDepthOfField-NGC6SATF.js.gz +0 -0
  358. package/build/runtime-gameControls-TZIFAJNU.js.br +0 -0
  359. package/build/runtime-gameControls-TZIFAJNU.js.gz +0 -0
  360. package/build/runtime-hair-ZA7YFZ6E.js +0 -1
  361. package/build/runtime-hair-ZA7YFZ6E.js.br +0 -1
  362. package/build/runtime-hair-ZA7YFZ6E.js.gz +0 -0
  363. package/build/runtime-hueSaturation-YSHDI5JV.js.br +0 -0
  364. package/build/runtime-hueSaturation-YSHDI5JV.js.gz +0 -0
  365. package/build/runtime-mergeStaticGeometries-Y65NWJFJ.js.br +0 -0
  366. package/build/runtime-mergeStaticGeometries-Y65NWJFJ.js.gz +0 -0
  367. package/build/runtime-miscActions-MOVRBNCH.js.br +0 -0
  368. package/build/runtime-miscActions-MOVRBNCH.js.gz +0 -0
  369. package/build/runtime-mouseHover-GER5PBUZ.js.br +0 -0
  370. package/build/runtime-mouseHover-GER5PBUZ.js.gz +0 -0
  371. package/build/runtime-noise-QZ2I3334.js.br +0 -0
  372. package/build/runtime-noise-QZ2I3334.js.gz +0 -0
  373. package/build/runtime-particles-CHBC6DAR.js.br +0 -0
  374. package/build/runtime-particles-CHBC6DAR.js.gz +0 -0
  375. package/build/runtime-paths-PVIXWENH.js.br +0 -0
  376. package/build/runtime-paths-PVIXWENH.js.gz +0 -0
  377. package/build/runtime-pixelation-VQFF744B.js.br +0 -0
  378. package/build/runtime-pixelation-VQFF744B.js.gz +0 -0
  379. package/build/runtime-resize-BXJTXBND.js.br +0 -0
  380. package/build/runtime-resize-BXJTXBND.js.gz +0 -0
  381. package/build/runtime-sceneTransition-M7OWS6T4.js.br +0 -0
  382. package/build/runtime-sceneTransition-M7OWS6T4.js.gz +0 -0
  383. package/build/runtime-scroll-XEQZHHLW.js.br +0 -0
  384. package/build/runtime-scroll-XEQZHHLW.js.gz +0 -0
  385. package/build/runtime-shapeBlends-OPZDOAMP.js +0 -1
  386. package/build/runtime-shapeBlends-OPZDOAMP.js.br +0 -0
  387. package/build/runtime-shapeBlends-OPZDOAMP.js.gz +0 -0
  388. package/build/runtime-text-NV4Q5BBQ.js.br +0 -0
  389. package/build/runtime-text-NV4Q5BBQ.js.gz +0 -0
  390. package/build/runtime-textInputs-COZOCG5V.js.br +0 -0
  391. package/build/runtime-textInputs-COZOCG5V.js.gz +0 -0
  392. package/build/runtime-timeline-MPAYKXWO.js.br +0 -0
  393. package/build/runtime-timeline-MPAYKXWO.js.gz +0 -0
  394. package/build/runtime-tracking-M7CHXAE5.js.br +0 -0
  395. package/build/runtime-tracking-M7CHXAE5.js.gz +0 -0
  396. package/build/runtime-transitions-OBLPSHIH.js.br +0 -0
  397. package/build/runtime-transitions-OBLPSHIH.js.gz +0 -0
  398. package/build/runtime-ui2d-OV6PGPLG.js.br +0 -0
  399. package/build/runtime-ui2d-OV6PGPLG.js.gz +0 -0
  400. package/build/runtime-updater-RCOMZLTB.js.br +0 -3
  401. package/build/runtime-updater-RCOMZLTB.js.gz +0 -0
  402. package/build/runtime-variables-DJUQPZDB.js.br +0 -0
  403. package/build/runtime-variables-DJUQPZDB.js.gz +0 -0
  404. package/build/runtime-vectorShapes-2N52XZYF.js.br +0 -0
  405. package/build/runtime-vectorShapes-2N52XZYF.js.gz +0 -0
  406. package/build/runtime-video-U5RS7HHJ.js.br +0 -0
  407. package/build/runtime-video-U5RS7HHJ.js.gz +0 -0
  408. package/build/runtime-vignette-TYITST5S.js.br +0 -0
  409. package/build/runtime-vignette-TYITST5S.js.gz +0 -0
  410. package/build/runtime-webgpu-CBYAHAHI.js +0 -1
  411. package/build/runtime-webgpu-CBYAHAHI.js.br +0 -0
  412. package/build/runtime-webgpu-CBYAHAHI.js.gz +0 -0
package/build/runtime.js CHANGED
@@ -1 +1 @@
1
- import{c as e,d as t,f as n,g as r}from"./runtime-chunk-HBZCKQBD.js";import{c as i,d as s,f as a}from"./runtime-chunk-GXEXRQ6S.js";import{a as o}from"./runtime-chunk-PONAD3UD.js";import"./runtime-chunk-HD7WF3XN.js";import"./runtime-chunk-XXDLMDCN.js";import{a as l,b as c,c as h,d,e as u}from"./runtime-chunk-TEGAP3DX.js";import{a as p}from"./runtime-chunk-GGSUJEGZ.js";import"./runtime-chunk-66HDBRK4.js";import{a as m,b as f}from"./runtime-chunk-NBYTQLIB.js";import{a as v,c as y}from"./runtime-chunk-DZNU62CT.js";import"./runtime-chunk-DSXX6SLP.js";import{c as b}from"./runtime-chunk-T53JMQSH.js";import{a as g}from"./runtime-chunk-FTVQTRM7.js";import{a as w,b as E,e as _,h as j,j as P,m as M}from"./runtime-chunk-WHEALKAN.js";import"./runtime-chunk-N2ZRGNPR.js";import{a as C,d as O,e as A}from"./runtime-chunk-VAVYZ35B.js";import"./runtime-chunk-FQNSP44B.js";import{h as x}from"./runtime-chunk-UI6FZJSE.js";import"./runtime-chunk-LSRIE5CU.js";import{b as S,d as k,g as R}from"./runtime-chunk-MTXG5LUQ.js";import"./runtime-chunk-TU4KDRKR.js";import"./runtime-chunk-ACJIWRIH.js";import{a as T}from"./runtime-chunk-J53RQDYR.js";import"./runtime-chunk-FAESWIXG.js";import"./runtime-chunk-PYCMOG7D.js";import"./runtime-chunk-3AHB3XAD.js";import{I as D,M as L,O as V,P as I,W as G,b as B,f as U,ga as N,i as K,ia as W,ja as z,k as H,p as F,y as $,z as q}from"./runtime-chunk-WMPEU73G.js";import"./runtime-chunk-4YV3EXSU.js";import{a as X,b as Y}from"./runtime-chunk-NSD7DU3P.js";import{c as Z,d as J,f as Q,g as ee}from"./runtime-chunk-JKFC5GFF.js";import{n as te}from"./runtime-chunk-KARVJCBP.js";import{a as ne,h as re}from"./runtime-chunk-RTLL6WIB.js";import{b as ie,c as se,e as ae,f as oe,h as le}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-QSWZYIFB.js";import{b as ce,c as he,k as de,l as ue}from"./runtime-chunk-TZCHGFVF.js";import{$ as pe,Ba as me,Da as fe,Ea as ve,F as ye,G as be,Ga as ge,H as we,T as Ee,W as _e,X as je,Y as Pe,Z as Me,_ as Ce,aa as Oe,ba as Ae,da as xe,ea as Se,f as ke,fa as Re,g as Te,ga as De,l as Le,na as Ve,o as Ie,w as Ge,wa as Be,x as Ue,xa as Ne,y as Ke,za as We}from"./runtime-chunk-KHCWX7UM.js";import{a as ze}from"./runtime-chunk-CKYSGX2V.js";import{$c as He,Cc as Fe,Dc as $e,Ec as qe,Fc as Xe,Oc as Ye,Pc as Ze,Tc as Je,Xc as Qe,bd as et,dd as tt}from"./runtime-chunk-BVVSZMXD.js";import{a as nt,b as rt}from"./runtime-chunk-ML3Z74BL.js";var it=nt((e,t)=>{t.exports=function(e,t){for(var n=e.split("."),r=t.split("."),i=0;i<3;i++){var s=Number(n[i]),a=Number(r[i]);if(s>a)return 1;if(a>s)return-1;if(!isNaN(s)&&isNaN(a))return 1;if(isNaN(s)&&!isNaN(a))return-1}return 0}}),st=".",at=Symbol("target"),ot=Symbol("unsubscribe");function lt(e){return e instanceof Date||e instanceof Set||e instanceof Map||e instanceof WeakSet||e instanceof WeakMap||ArrayBuffer.isView(e)}var ct=Array.isArray;function ht(e){return"symbol"==typeof e}var dt={after:(e,t)=>ct(e)?e.slice(t.length):""===t?e:e.slice(t.length+1),concat:(e,t)=>ct(e)?(e=[...e],t&&e.push(t),e):t&&void 0!==t.toString?(""!==e&&(e+=st),ht(t)?e+t.toString():e+t):e,initial:e=>{if(ct(e))return e.slice(0,-1);if(""===e)return e;let t=e.lastIndexOf(st);return-1===t?"":e.slice(0,t)},last:e=>{if(ct(e))return e[e.length-1]||"";if(""===e)return e;let t=e.lastIndexOf(st);return-1===t?e:e.slice(t+1)},walk:(e,t)=>{if(ct(e))for(let n of e)t(n);else if(""!==e){let n=0,r=e.indexOf(st);if(-1===r)t(e);else for(;n<e.length;)-1===r&&(r=e.length),t(e.slice(n,r)),n=r+1,r=e.indexOf(st,n)}},get(e,t){return this.walk(t,t=>{e&&(e=e[t])}),e}};function ut(e,t,n){return e.isUnsubscribed||t.ignoreSymbols&&ht(n)||t.ignoreUnderscores&&"_"===n.charAt(0)||"ignoreKeys"in t&&t.ignoreKeys.includes(n)}var pt=class{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return void 0===this._descriptorCache&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){let t=this._getDescriptorCache(),n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n}_getOwnPropertyDescriptor(e,t){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,t);let n=this._getProperties(e),r=n[t];return void 0===r&&(r=Reflect.getOwnPropertyDescriptor(e,t),n[t]=r),r}getProxy(e,t,n,r){if(this.isUnsubscribed)return e;let i=e[r],s=i||e;this._pathCache.set(s,t);let a=this._proxyCache.get(s);return void 0===a&&(a=void 0===i?new Proxy(e,n):e,this._proxyCache.set(s,a)),a}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,t){return!Object.is(e,dt.get(t,this.getPath(e)))}defineProperty(e,t,n){return!!Reflect.defineProperty(e,t,n)&&(this.isUnsubscribed||(this._getProperties(e)[t]=n),!0)}setProperty(e,t,n,r,i){if(!this._equals(i,n)||!(t in e)){let i=this._getOwnPropertyDescriptor(e,t);return void 0!==i&&"set"in i?Reflect.set(e,t,n,r):Reflect.set(e,t,n)}return!0}deleteProperty(e,t,n){if(Reflect.deleteProperty(e,t)){if(!this.isUnsubscribed){let r=this._getDescriptorCache().get(e);r&&(delete r[t],this._pathCache.delete(n))}return!0}return!1}isSameDescriptor(e,t,n){let r=this._getOwnPropertyDescriptor(t,n);return void 0!==e&&void 0!==r&&Object.is(e.value,r.value)&&(e.writable||!1)===(r.writable||!1)&&(e.enumerable||!1)===(r.enumerable||!1)&&(e.configurable||!1)===(r.configurable||!1)&&e.get===r.get&&e.set===r.set}isGetInvariant(e,t){let n=this._getOwnPropertyDescriptor(e,t);return void 0!==n&&!0!==n.configurable&&!0!==n.writable}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}};function mt(e){return"[object Object]"===toString.call(e)}function ft(){return!0}function vt(e,t){return e.length!==t.length||e.some((e,n)=>t[n]!==e)}var yt=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),bt=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),gt={push:ft,pop:ft,shift:ft,unshift:ft,copyWithin:vt,reverse:vt,sort:vt,splice:vt,flat:vt,fill:vt},wt=new Set([...yt,...bt,...Object.keys(gt)]);function Et(e,t){if(e.size!==t.size)return!0;for(let n of e)if(!t.has(n))return!0;return!1}var _t=["keys","values","entries"],jt=new Set(["has","toString"]),Pt={add:Et,clear:Et,delete:Et,forEach:Et},Mt=new Set([...jt,...Object.keys(Pt),..._t]);function Ct(e,t){if(e.size!==t.size)return!0;let n;for(let[r,i]of e)if(n=t.get(r),n!==i||void 0===n&&!t.has(r))return!0;return!1}var Ot=new Set([...jt,"get"]),At={set:Ct,clear:Ct,delete:Ct,forEach:Ct},xt=new Set([...Ot,...Object.keys(At),..._t]),St=class{constructor(e,t,n,r){this._path=t,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=r,this._changes=r?[]:null,this.clone=void 0===t?e:this._shallowClone(e)}static isHandledMethod(e){return yt.has(e)}_shallowClone(e){let t=e;if(mt(e))t={...e};else if(ct(e))t=[...e];else if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set([...e].map(e=>this._shallowClone(e)));else if(e instanceof Map){t=new Map;for(let[n,r]of e.entries())t.set(n,this._shallowClone(r))}return this._clonedCache.add(t),t}preferredThisArg(e,t,n,r){return e?(ct(r)?this._onIsChanged=gt[t]:r instanceof Set?this._onIsChanged=Pt[t]:r instanceof Map&&(this._onIsChanged=At[t]),r):n}update(e,t,n){let r=dt.after(e,this._path);if("length"!==t){let e=this.clone;dt.walk(r,t=>{e&&e[t]&&(this._clonedCache.has(e[t])||(e[t]=this._shallowClone(e[t])),e=e[t])}),this._hasOnValidate&&this._changes.push({path:r,property:t,previous:n}),e&&e[t]&&(e[t]=n)}this._isChanged=!0}undo(e){let t;for(let n=this._changes.length-1;-1!==n;n--)t=this._changes[n],dt.get(e,t.path)[t.property]=t.previous}isChanged(e){return void 0===this._onIsChanged?this._isChanged:this._onIsChanged(this.clone,e)}},kt=class extends St{static isHandledMethod(e){return wt.has(e)}},Rt=class extends St{undo(e){e.setTime(this.clone.getTime())}isChanged(e,t){return!t(this.clone.valueOf(),e.valueOf())}},Tt=class extends St{static isHandledMethod(e){return Mt.has(e)}undo(e){for(let t of this.clone)e.add(t);for(let t of e)this.clone.has(t)||e.delete(t)}},Dt=class extends St{static isHandledMethod(e){return xt.has(e)}undo(e){for(let[t,n]of this.clone.entries())e.set(t,n);for(let t of e.keys())this.clone.has(t)||e.delete(t)}},Lt=class extends St{constructor(e,t,n,r){super(void 0,t,n,r),this._arg1=n[0],this._weakValue=e.has(this._arg1)}isChanged(e){return this._weakValue!==e.has(this._arg1)}undo(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}},Vt=class extends St{constructor(e,t,n,r){super(void 0,t,n,r),this._weakKey=n[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){let t=e.has(this._weakKey);this._weakHas&&!t?e.set(this._weakKey,this._weakValue):!this._weakHas&&t?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}},It=class{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return mt(e)||ct(e)||lt(e)}static isHandledMethod(e,t){return mt(e)?St.isHandledMethod(t):ct(e)?kt.isHandledMethod(t):e instanceof Set?Tt.isHandledMethod(t):e instanceof Map?Dt.isHandledMethod(t):lt(e)}get isCloning(){return this._stack.length>0}start(e,t,n){let r=St;ct(e)?r=kt:e instanceof Date?r=Rt:e instanceof Set?r=Tt:e instanceof Map?r=Dt:e instanceof WeakSet?r=Lt:e instanceof WeakMap&&(r=Vt),this._stack.push(new r(e,t,n,this._hasOnValidate))}update(e,t,n){this._stack[this._stack.length-1].update(e,t,n)}preferredThisArg(e,t,n){let{name:r}=e,i=It.isHandledMethod(n,r);return this._stack[this._stack.length-1].preferredThisArg(i,r,t,n)}isChanged(e,t,n){return this._stack[this._stack.length-1].isChanged(e,t,n)}undo(e){void 0!==this._previousClone&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}},Gt={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},Bt=(e,t,n={})=>{n={...Gt,...n};let r=Symbol("ProxyTarget"),{equals:i,isShallow:s,ignoreDetached:a,details:o}=n,l=new pt(i),c="function"==typeof n.onValidate,h=new It(c),d=(e,t,r,i,s)=>!c||h.isCloning||!0===n.onValidate(dt.concat(l.getPath(e),t),r,i,s),u=(t,r,i,s)=>{!ut(l,n,r)&&(!a||!l.isDetached(t,e))&&p(l.getPath(t),r,i,s)},p=(e,n,r,i,s)=>{h.isCloning?h.update(e,n,i):t(dt.concat(e,n),r,i,s)},m=e=>e&&(e[r]||e),f=(t,i,o,c)=>function(e){return("object"==typeof e?null===e:"function"!=typeof e)||e instanceof RegExp}(t)||"constructor"===o||s&&!It.isHandledMethod(i,o)||ut(l,n,o)||l.isGetInvariant(i,o)||a&&l.isDetached(i,e)?t:(void 0===c&&(c=l.getPath(i)),l.getProxy(t,dt.concat(c,o),v,r)),v={get(e,t,n){if(ht(t)){if(t===r||t===at)return e;if(t===ot&&!l.isUnsubscribed&&0===l.getPath(e).length)return l.unsubscribe(),e}let i=lt(e)?Reflect.get(e,t):Reflect.get(e,t,n);return f(i,e,t)},set(e,t,n,s){n=m(n);let a=e[r]||e,o=a[t];if(i(o,n)&&t in e)return!0;let c=d(e,t,n,o);return c&&l.setProperty(a,t,n,s,o)?(u(e,t,e[t],o),!0):!c},defineProperty(e,t,n){if(!l.isSameDescriptor(n,e,t)){let r=e[t];d(e,t,n.value,r)&&l.defineProperty(e,t,n,r)&&u(e,t,n.value,r)}return!0},deleteProperty(e,t){if(!Reflect.has(e,t))return!0;let n=Reflect.get(e,t),r=d(e,t,void 0,n);return r&&l.deleteProperty(e,t,n)?(u(e,t,void 0,n),!0):!r},apply(t,n,s){let a=n[r]||n;if(l.isUnsubscribed)return Reflect.apply(t,a,s);if((!1===o||!0!==o&&!o.includes(t.name))&&It.isHandledType(a)){let r=dt.initial(l.getPath(t)),o=It.isHandledMethod(a,t.name);h.start(a,r,s);let c=Reflect.apply(t,h.preferredThisArg(t,n,a),o?s.map(e=>m(e)):s),u=h.isChanged(a,i),y=h.stop();if(It.isHandledType(c)&&o&&(n instanceof Map&&"get"===t.name&&(r=dt.concat(r,s[0])),c=l.getProxy(c,r,v)),u){let n={name:t.name,args:s,result:c},i=h.isCloning?dt.initial(r):r,o=h.isCloning?dt.last(r):"";d(dt.get(e,i),o,a,y,n)?p(i,o,a,y,n):h.undo(a)}return(n instanceof Map||n instanceof Set)&&function(e){return"object"==typeof e&&"function"==typeof e.next}(c)?function(e,t,n,r,i){let s=e.next;if("entries"===t.name)e.next=function(){let e=s.call(this);return!1===e.done&&(e.value[0]=i(e.value[0],t,e.value[0],r),e.value[1]=i(e.value[1],t,e.value[0],r)),e};else if("values"===t.name){let a=n[at].keys();e.next=function(){let e=s.call(this);return!1===e.done&&(e.value=i(e.value,t,a.next().value,r)),e}}else e.next=function(){let e=s.call(this);return!1===e.done&&(e.value=i(e.value,t,e.value,r)),e};return e}(c,t,n,r,f):c}return Reflect.apply(t,n,s)}},y=l.getProxy(e,n.pathAsArray?[]:"",v);return t=t.bind(y),c&&(n.onValidate=n.onValidate.bind(y)),y};Bt.target=e=>e&&e[at]||e,Bt.unsubscribe=e=>e[ot]||e;var Ut=Bt,Nt="__splineHtmlContent",Kt=`(function () {\n\t'use strict';\n\tvar MARKER = ${JSON.stringify(Nt)};\n\tvar callSeq = 1;\n\tvar pending = {};\n\tvar listeners = {};\n\tvar acked = false;\n\tvar readyResolve;\n\tvar readyPromise = new Promise(function (resolve) { readyResolve = resolve; });\n\n\tfunction post(msg) {\n\t\tmsg[MARKER] = true;\n\t\ttry {\n\t\t\twindow.parent.postMessage(msg, '*');\n\t\t} catch (e) { /* parent gone — nothing to do */ }\n\t}\n\n\tfunction call(method, args) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tvar id = callSeq++;\n\t\t\tpending[id] = { resolve: resolve, reject: reject };\n\t\t\tpost({ kind: 'call', id: id, method: method, args: args });\n\t\t});\n\t}\n\n\t// ---- the public API ----------------------------------------------------\n\tvar spline = {\n\t\t/** Resolves once the editor has acknowledged the frame. */\n\t\tready: readyPromise,\n\t\tsetVariable: function (name, value) { return call('setVariable', [name, value]); },\n\t\tsetVariables: function (variables) { return call('setVariables', [variables]); },\n\t\tgetVariable: function (name) { return call('getVariable', [name]); },\n\t\tgetVariables: function () { return call('getVariables', []); },\n\t\tgetAllObjects: function () { return call('getAllObjects', []); },\n\t\tfindObjectByName: function (name) { return call('findObjectByName', [name]); },\n\t\tfindObjectById: function (id) { return call('findObjectById', [id]); },\n\t\t/** Read a mesh's live geometry ({vertexCount, triangleCount, indexed, bounds, vertices: Float32Array, indices?, normals?, uvs?}); options {space: 'local'|'world'}. Resolves undefined (with a console warning) when unreadable. */\n\t\tgetGeometry: function (nameOrId, options) { return call('getGeometry', [nameOrId, options || {}]); },\n\t\t/** Runtime-only transform/visibility update ({position,rotation,scale,visible}; rotation in degrees). */\n\t\tupdateObject: function (nameOrId, props) { return call('updateObject', [nameOrId, props]); },\n\t\t/** Runtime-only object creation ('Cube', 'Sphere', …, 'Text', 'Group', lights); resolves to the new object's snapshot. */\n\t\tcreateObject: function (type, options) {\n\t\t\t// A three.js material instance or createCustomMaterial factory can't cross\n\t\t\t// the postMessage boundary (textures/callbacks/functions fail\n\t\t\t// structured clone) — fail loud, not with a cryptic DataCloneError.\n\t\t\tif (options && options.material && (\n\t\t\t\toptions.material.isMaterial === true ||\n\t\t\t\ttypeof options.material === 'function'\n\t\t\t)) {\n\t\t\t\treturn Promise.reject(new Error(\n\t\t\t\t\t'createObject: custom three.js materials need the inline ' +\n\t\t\t\t\t'HTML-content mode (the editor Preview/Play frame and web ' +\n\t\t\t\t\t'exports); this embed runs the sandboxed mode, whose transport ' +\n\t\t\t\t\t'cannot carry them. Use a color/PBR bag or shared material ' +\n\t\t\t\t\t'name here instead.'\n\t\t\t\t));\n\t\t\t}\n\t\t\treturn call('createObject', [type, options || {}]);\n\t\t},\n\t\t/** Custom three.js/TSL materials — inline HTML-content mode only; the\n\t\t * factory function cannot cross this sandboxed transport. */\n\t\tcreateCustomMaterial: function () {\n\t\t\treturn Promise.reject(new Error(\n\t\t\t\t'createCustomMaterial: custom three.js materials need the inline ' +\n\t\t\t\t'HTML-content mode (the editor Preview/Play frame and web ' +\n\t\t\t\t'exports); this embed runs the sandboxed mode, whose transport ' +\n\t\t\t\t'cannot carry the factory function or the material it returns.'\n\t\t\t));\n\t\t},\n\t\t/** The live three texture an object samples — inline HTML-content mode\n\t\t * only; a Texture instance cannot cross this sandboxed transport. */\n\t\tgetTexture: function () {\n\t\t\treturn Promise.reject(new Error(\n\t\t\t\t'getTexture: a three.js texture instance needs the inline ' +\n\t\t\t\t'HTML-content mode (the editor Preview/Play frame and web ' +\n\t\t\t\t'exports); this embed runs the sandboxed mode, whose transport ' +\n\t\t\t\t'cannot carry it.'\n\t\t\t));\n\t\t},\n\t\t/** Replace a mesh's material with a custom three.js material — inline\n\t\t * HTML-content mode only; neither factories nor instances can cross\n\t\t * this sandboxed transport. */\n\t\tsetMaterial: function () {\n\t\t\treturn Promise.reject(new Error(\n\t\t\t\t'setMaterial: custom three.js materials need the inline ' +\n\t\t\t\t'HTML-content mode (the editor Preview/Play frame and web ' +\n\t\t\t\t'exports); this embed runs the sandboxed mode, whose transport ' +\n\t\t\t\t'cannot carry the factory function or the material it returns.'\n\t\t\t));\n\t\t},\n\t\t/** Runtime-only deep clone of an existing object; resolves to the clone's snapshot. */\n\t\tcloneObject: function (nameOrId, options) { return call('cloneObject', [nameOrId, options || {}]); },\n\t\t/** Removes an object (and its subtree); resolves to false when none matched. */\n\t\tremoveObject: function (nameOrId) { return call('removeObject', [nameOrId]); },\n\t\t/** Spawn a runtime-only copy of a template object; resolves to its snapshot ({id,...}) or undefined. */\n\t\tspawnObject: function (templateNameOrId, options) { return call('spawnObject', [templateNameOrId, options || {}]); },\n\t\t/** Remove a spawned copy by id (or assigned name). Spawned objects only. */\n\t\tdestroyObject: function (idOrName) { return call('destroyObject', [idOrName]); },\n\t\t/** Per-copy transform writes on a cloner ([{position,rotation,scale}|null, ...]; degrees); null clears all. Resolves to the copy count. */\n\t\tsetInstanceTransforms: function (nameOrId, transforms) { return call('setInstanceTransforms', [nameOrId, transforms === undefined ? null : transforms]); },\n\t\t/** An imported model's animation clips ([{id, name, duration, object: {id, name}}]) — one object's, or the whole scene's when omitted. */\n\t\tgetAnimations: function (nameOrId) { return call('getAnimations', [nameOrId]); },\n\t\t/** Play an imported clip by name or id (the object's first when omitted); options {loop: true|false|count, pingpong, fade: seconds, speed}. Resolves to the clip, or undefined. */\n\t\tplayAnimation: function (nameOrId, clip, options) { return call('playAnimation', [nameOrId, clip, options]); },\n\t\t/** Hold an object's clips (or one) where they are — every animated object when omitted; playAnimation resumes. */\n\t\tpauseAnimation: function (nameOrId, clip) { return call('pauseAnimation', [nameOrId, clip]); },\n\t\t/** Stop an object's clips (or one) on their first frame — every animated object when omitted. */\n\t\tstopAnimation: function (nameOrId, clip) { return call('stopAnimation', [nameOrId, clip]); },\n\t\t/** Trigger a Spline event on an object (requires Play mode). */\n\t\temitEvent: function (eventName, nameOrUuid) { return call('emitEvent', [eventName, nameOrUuid]); },\n\t\temitEventReverse: function (eventName, nameOrUuid) { return call('emitEventReverse', [eventName, nameOrUuid]); },\n\t\trequestRender: function () { return call('requestRender', []); },\n\t\taddEventListener: function (eventName, cb) {\n\t\t\tif (typeof cb !== 'function') return;\n\t\t\tif (!listeners[eventName]) {\n\t\t\t\tlisteners[eventName] = [];\n\t\t\t\tcall('listenEvent', [eventName]);\n\t\t\t}\n\t\t\tlisteners[eventName].push(cb);\n\t\t},\n\t\tremoveEventListener: function (eventName, cb) {\n\t\t\tvar list = listeners[eventName];\n\t\t\tif (!list) return;\n\t\t\tvar i = list.indexOf(cb);\n\t\t\tif (i !== -1) list.splice(i, 1);\n\t\t\tif (list.length === 0) {\n\t\t\t\tdelete listeners[eventName];\n\t\t\t\tcall('unlistenEvent', [eventName]);\n\t\t\t}\n\t\t},\n\t};\n\twindow.spline = spline;\n\n\t// ---- editor -> frame ---------------------------------------------------\n\twindow.addEventListener('message', function (event) {\n\t\tif (event.source !== window.parent) return;\n\t\tvar data = event.data;\n\t\tif (!data || data[MARKER] !== true) return;\n\t\tif (data.kind === 'ready-ack') {\n\t\t\tacked = true;\n\t\t\treadyResolve();\n\t\t} else if (data.kind === 'result') {\n\t\t\tvar entry = pending[data.id];\n\t\t\tif (!entry) return;\n\t\t\tdelete pending[data.id];\n\t\t\tif (data.ok) entry.resolve(data.value);\n\t\t\telse entry.reject(new Error(data.error || 'spline bridge call failed'));\n\t\t} else if (data.kind === 'event') {\n\t\t\tvar list = listeners[data.eventName];\n\t\t\tif (!list) return;\n\t\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tlist[i](data.payload);\n\t\t\t\t} catch (e) {\n\t\t\t\t\treportError(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\t// ---- console + error capture --------------------------------------------\n\tfunction stringify(value, depth) {\n\t\ttry {\n\t\t\tif (typeof value === 'string') return value;\n\t\t\tif (value instanceof Error) return value.stack || String(value);\n\t\t\tif (typeof value === 'function') return '[function ' + (value.name || 'anonymous') + ']';\n\t\t\tif (value === undefined) return 'undefined';\n\t\t\tvar seen = [];\n\t\t\tvar json = JSON.stringify(value, function (k, v) {\n\t\t\t\tif (typeof v === 'object' && v !== null) {\n\t\t\t\t\tif (seen.indexOf(v) !== -1) return '[circular]';\n\t\t\t\t\tseen.push(v);\n\t\t\t\t}\n\t\t\t\tif (typeof v === 'function') return '[function]';\n\t\t\t\treturn v;\n\t\t\t});\n\t\t\treturn json === undefined ? String(value) : json;\n\t\t} catch (e) {\n\t\t\ttry { return String(value); } catch (e2) { return '[unserializable]'; }\n\t\t}\n\t}\n\n\tfunction sendConsole(level, args) {\n\t\tvar parts = [];\n\t\tfor (var i = 0; i < args.length; i++) parts.push(stringify(args[i]));\n\t\tvar text = parts.join(' ');\n\t\tif (text.length > 4000) text = text.slice(0, 4000) + '…';\n\t\tpost({ kind: 'console', level: level, text: text });\n\t}\n\n\t['log', 'info', 'warn', 'error'].forEach(function (level) {\n\t\tvar original = console[level];\n\t\tconsole[level] = function () {\n\t\t\tsendConsole(level, arguments);\n\t\t\tif (original) original.apply(console, arguments);\n\t\t};\n\t});\n\n\tfunction reportError(error) {\n\t\tsendConsole('error', [error instanceof Error ? error : String(error)]);\n\t}\n\twindow.addEventListener('error', function (event) {\n\t\tsendConsole('error', [event.message + (event.filename ? ' (' + event.filename + ':' + event.lineno + ')' : '')]);\n\t});\n\twindow.addEventListener('unhandledrejection', function (event) {\n\t\tsendConsole('error', ['Unhandled promise rejection: ' + stringify(event.reason)]);\n\t});\n\n\t// ---- input passthrough ---------------------------------------------------\n\t// A pointer that goes DOWN on the page background belongs to the 3D scene\n\t// until it is released; one that goes down on generated UI never forwards.\n\tvar forwardedPointers = {};\n\n\tfunction isBackground(target) {\n\t\tif (!target || target === document || target === document.documentElement || target === document.body) {\n\t\t\treturn true;\n\t\t}\n\t\tif (target.closest && target.closest('[data-spline-passthrough]')) return true;\n\t\treturn false;\n\t}\n\n\tfunction baseInput(e, type) {\n\t\treturn {\n\t\t\ttype: type,\n\t\t\tx: e.clientX,\n\t\t\ty: e.clientY,\n\t\t\tbutton: e.button,\n\t\t\tbuttons: e.buttons,\n\t\t\tpointerId: e.pointerId,\n\t\t\tpointerType: e.pointerType,\n\t\t\tisPrimary: e.isPrimary,\n\t\t\tmovementX: e.movementX,\n\t\t\tmovementY: e.movementY,\n\t\t\tshiftKey: e.shiftKey,\n\t\t\tctrlKey: e.ctrlKey,\n\t\t\taltKey: e.altKey,\n\t\t\tmetaKey: e.metaKey,\n\t\t};\n\t}\n\n\tdocument.addEventListener('pointerdown', function (e) {\n\t\tif (!isBackground(e.target)) return;\n\t\tforwardedPointers[e.pointerId] = true;\n\t\tpost({ kind: 'input', event: baseInput(e, 'pointerdown') });\n\t}, true);\n\n\tdocument.addEventListener('pointermove', function (e) {\n\t\tif (!forwardedPointers[e.pointerId] && !isBackground(e.target)) return;\n\t\tpost({ kind: 'input', event: baseInput(e, 'pointermove') });\n\t}, true);\n\n\t['pointerup', 'pointercancel'].forEach(function (type) {\n\t\tdocument.addEventListener(type, function (e) {\n\t\t\tvar wasForwarded = forwardedPointers[e.pointerId];\n\t\t\tdelete forwardedPointers[e.pointerId];\n\t\t\tif (!wasForwarded && !isBackground(e.target)) return;\n\t\t\tpost({ kind: 'input', event: baseInput(e, type) });\n\t\t}, true);\n\t});\n\n\t['click', 'dblclick'].forEach(function (type) {\n\t\tdocument.addEventListener(type, function (e) {\n\t\t\tif (!isBackground(e.target)) return;\n\t\t\tpost({ kind: 'input', event: baseInput(e, type) });\n\t\t}, true);\n\t});\n\n\tdocument.addEventListener('wheel', function (e) {\n\t\tif (!isBackground(e.target)) return;\n\t\te.preventDefault();\n\t\tvar msg = baseInput(e, 'wheel');\n\t\tmsg.deltaX = e.deltaX;\n\t\tmsg.deltaY = e.deltaY;\n\t\tmsg.deltaMode = e.deltaMode;\n\t\t// The legacy wheelDelta fields carry the trackpad-vs-mouse signature\n\t\t// the editor's pan/zoom discrimination reads (wheelDeltaY === -3*dY\n\t\t// on trackpads) — a reconstructed WheelEvent loses them, turning\n\t\t// two-finger pans into zooms. Forward them verbatim.\n\t\tif (typeof e.wheelDeltaX === 'number') msg.wheelDeltaX = e.wheelDeltaX;\n\t\tif (typeof e.wheelDeltaY === 'number') msg.wheelDeltaY = e.wheelDeltaY;\n\t\tpost({ kind: 'input', event: msg });\n\t}, { capture: true, passive: false });\n\n\t['keydown', 'keyup'].forEach(function (type) {\n\t\tdocument.addEventListener(type, function (e) {\n\t\t\t// Never steal keys from the page's own form fields.\n\t\t\tvar t = e.target;\n\t\t\tif (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return;\n\t\t\tpost({ kind: 'input', event: {\n\t\t\t\ttype: type,\n\t\t\t\tkey: e.key,\n\t\t\t\tcode: e.code,\n\t\t\t\trepeat: e.repeat,\n\t\t\t\tshiftKey: e.shiftKey,\n\t\t\t\tctrlKey: e.ctrlKey,\n\t\t\t\taltKey: e.altKey,\n\t\t\t\tmetaKey: e.metaKey,\n\t\t\t} });\n\t\t}, true);\n\t});\n\n\t// ---- handshake -----------------------------------------------------------\n\t// Announce readiness and KEEP announcing until the editor acks. A single\n\t// 'ready' can race the editor attaching its listener (or land while the\n\t// editor is busy); code that awaits spline.ready would then hang forever.\n\t// The editor acks every 'ready' (and posts a proactive ack on attach), so\n\t// this settles within one round-trip in the normal case.\n\tpost({ kind: 'ready' });\n\tvar readyRetry = setInterval(function () {\n\t\tif (acked) {\n\t\t\tclearInterval(readyRetry);\n\t\t\treturn;\n\t\t}\n\t\tpost({ kind: 'ready' });\n\t}, 250);\n})();`;function Wt(e){return null==e||""===e?void 0:String(e)}var zt=class{constructor(e,t,n){this.deps=e,this.onConsole=t,this.onEvent=n,this.disposed=!1,this.eventUnsubs=new Map,this.variablePollHandle=null,this.lastVariables=null}dispose(){this.disposed=!0;for(let e of this.eventUnsubs.values())e();this.eventUnsubs.clear(),this.stopVariablePolling()}execute(e,t){let n=this.deps;switch(e){case"setVariable":{let e=n.setVariable(String(t[0]),t[1]);return e.warning&&this.onConsole("warn",e.warning),e.ok}case"setVariables":{let e=t[0]??{},r=!0;for(let[t,i]of Object.entries(e)){let e=n.setVariable(t,i);e.warning&&this.onConsole("warn",e.warning),r=r&&e.ok}return r}case"getVariable":return n.getVariable(String(t[0]));case"getVariables":return n.getVariables();case"getAllObjects":return n.getAllObjects();case"findObjectByName":case"findObjectById":return n.findObject(String(t[0]));case"getGeometry":{let e=n.getGeometry(String(t[0]),t[1]??{});return e.warning&&this.onConsole("warn",e.warning),e.data}case"updateObject":return n.updateObject(String(t[0]),t[1]??{});case"createObject":return n.createObject(String(t[0]),t[1]??{});case"createCustomMaterial":if(void 0===n.createCustomMaterial)throw new Error("createCustomMaterial: not available on this surface — custom three.js/TSL materials need the inline HTML-content mode (editor Preview/Play and web exports).");return n.createCustomMaterial(t[0]);case"getTexture":if(void 0===n.getTexture)throw new Error("getTexture: not available on this surface — a three.js texture instance needs the inline HTML-content mode (editor Preview/Play and web exports).");return n.getTexture(String(t[0]),t[1]??{});case"setMaterial":if(void 0===n.setMaterial)throw new Error("setMaterial: not available on this surface — custom three.js/TSL materials need the inline HTML-content mode (editor Preview/Play and web exports).");return n.setMaterial(String(t[0]),t[1]);case"cloneObject":return n.cloneObject(String(t[0]),t[1]??{});case"removeObject":return n.removeObject(String(t[0]));case"spawnObject":{let e=n.spawnObject(String(t[0]),t[1]??{});return e.warning&&this.onConsole("warn",e.warning),e.object}case"destroyObject":return n.destroyObject(String(t[0]));case"setInstanceTransforms":{let e=null===t[1]||void 0===t[1]?null:t[1],r=n.setInstanceTransforms(String(t[0]),e);return r<0&&this.onConsole("warn",`spline.setInstanceTransforms: "${String(t[0])}" has no cloner — make the object a cloner first (its copies are what this drives).`),r}case"getAnimations":{let r=n.getAnimations(Wt(t[0]));return r.warning&&this.onConsole("warn",`spline.${e}: ${r.warning}`),r.clips}case"playAnimation":{let r="object"==typeof t[1]&&null!==t[1],i=n.playAnimation(String(t[0]),r?void 0:Wt(t[1]),(r?t[1]:t[2])??{});return i.warning&&this.onConsole("warn",`spline.${e}: ${i.warning}`),i.clip}case"pauseAnimation":case"stopAnimation":{let r=Wt(t[0]),i=Wt(t[1]),s="pauseAnimation"===e?n.pauseAnimation(r,i):n.stopAnimation(r,i);return s.warning&&this.onConsole("warn",`spline.${e}: ${s.warning}`),s.ok}case"emitEvent":case"emitEventReverse":{let r=n.emitEvent(String(t[0]),String(t[1]),"emitEventReverse"===e);return r.warning&&this.onConsole("warn",r.warning),r.ok}case"requestRender":return n.requestRender(),!0;case"listenEvent":{let e=String(t[0]);return"variableChange"===e?this.startVariablePolling():this.eventUnsubs.has(e)||this.eventUnsubs.set(e,n.addSplineEventListener(e,t=>{this.onEvent(e,t)})),!0}case"unlistenEvent":{let e=String(t[0]);return"variableChange"===e?this.stopVariablePolling():(this.eventUnsubs.get(e)?.(),this.eventUnsubs.delete(e)),!0}default:throw new Error(`Unknown spline bridge method: ${e}`)}}startVariablePolling(){null===this.variablePollHandle&&(this.lastVariables=this.deps.getVariables(),this.variablePollHandle=window.setInterval(()=>{if(this.disposed)return;let e=this.deps.getVariables(),t=function(e,t){let n=[];for(let r of Object.keys(t))e[r]!==t[r]&&n.push({name:r,value:t[r]});return n}(this.lastVariables??{},e);this.lastVariables=e;for(let e of t)this.onEvent("variableChange",e)},100))}stopVariablePolling(){null!==this.variablePollHandle&&(window.clearInterval(this.variablePollHandle),this.variablePollHandle=null),this.lastVariables=null}};function Ht(e,t,n,r){return[e[0]*t+e[4]*n+e[8]*r+e[12],e[1]*t+e[5]*n+e[9]*r+e[13],e[2]*t+e[6]*n+e[10]*r+e[14]]}var Ft=class{constructor(e,t,n){this.iframe=e,this.deps=t,this.onConsole=n,this.disposed=!1,this.handshakeSeen=!1,this.handshakeTimer=null,this.onMessage=e=>{if(this.disposed||e.source!==this.iframe.contentWindow)return;let t=e.data;var n;"object"!=typeof(n=t)||null===n||!0!==n[Nt]||"string"!=typeof n.kind||this.handleMessage(t)},this.host=new zt(t,n,(e,t)=>{this.sendEvent(e,t)})}attach(){window.addEventListener("message",this.onMessage),this.send({[Nt]:!0,kind:"ready-ack"}),this.handshakeTimer=window.setTimeout(()=>{this.handshakeTimer=null,!this.handshakeSeen&&!this.disposed&&this.onConsole("warn","The HTML content frame has not initialized (no signal from its scripts yet) — if the page looks frozen, check for errors in its code.")},6e3)}dispose(){this.disposed=!0,window.removeEventListener("message",this.onMessage),this.host.dispose(),null!==this.handshakeTimer&&(window.clearTimeout(this.handshakeTimer),this.handshakeTimer=null)}handleMessage(e){switch(e.kind){case"ready":this.handshakeSeen=!0,this.send({[Nt]:!0,kind:"ready-ack"});break;case"console":this.onConsole(e.level,e.text);break;case"call":{let t;try{t=Promise.resolve(this.host.execute(e.method,e.args))}catch(e){t=Promise.reject(e)}t.then(t=>{this.send({[Nt]:!0,kind:"result",id:e.id,ok:!0,value:t,error:void 0})},t=>{let n=t instanceof Error?t.message:String(t);this.send({[Nt]:!0,kind:"result",id:e.id,ok:!1,value:void 0,error:n}),this.onConsole("error",n)});break}case"input":this.dispatchInput(e.event)}}send(e){this.iframe.contentWindow?.postMessage(e,"*")}sendEvent(e,t){this.send({[Nt]:!0,kind:"event",eventName:e,payload:t})}dispatchInput(e){let t=this.deps.getCanvas();if(!t)return;let n=this.iframe.getBoundingClientRect(),r={bubbles:!0,cancelable:!0,view:window,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey};switch(e.type){case"pointerdown":case"pointermove":case"pointerup":case"pointercancel":t.dispatchEvent(new PointerEvent(e.type,{...r,clientX:(e.x??0)+n.left,clientY:(e.y??0)+n.top,button:e.button,buttons:e.buttons,pointerId:e.pointerId,pointerType:e.pointerType,isPrimary:e.isPrimary,movementX:e.movementX,movementY:e.movementY}));break;case"click":case"dblclick":t.dispatchEvent(new MouseEvent(e.type,{...r,clientX:(e.x??0)+n.left,clientY:(e.y??0)+n.top,button:e.button,buttons:e.buttons}));break;case"wheel":{let i=new WheelEvent("wheel",{...r,clientX:(e.x??0)+n.left,clientY:(e.y??0)+n.top,deltaX:e.deltaX,deltaY:e.deltaY,deltaMode:e.deltaMode});"number"==typeof e.wheelDeltaX&&Object.defineProperty(i,"wheelDeltaX",{value:e.wheelDeltaX}),"number"==typeof e.wheelDeltaY&&Object.defineProperty(i,"wheelDeltaY",{value:e.wheelDeltaY}),t.dispatchEvent(i);break}case"keydown":case"keyup":t.dispatchEvent(new KeyboardEvent(e.type,{...r,key:e.key,code:e.code,repeat:e.repeat}))}}};function $t(e){let t=e.points.length/7,n=new ke;for(let r=0;r<t;r++){let t=7*r,i=e.points[t+0],s=e.points[t+1],a=e.points[t+2],o=e.points[t+3],l=e.points[t+4],c=e.points[t+5],h=e.points[t+6];n.push({fi:r,id:Fe.generateUUID(),data:{roundness:h,position:[i,s],areControlsDirectionsMirrored:!0,controlPrevious:{position:[a,o]},controlNext:{position:[l,c]}}})}return{points:n,isClosed:e.isClosed,roundness:e.roundness,shapeHoles:e.shapeHoles?.map(e=>$t(e))??[]}}function qt(e){let{userData:t,uuid:n,...r}=e;if(void 0===t||"NonParametricGeometry"===t.type)return function(e){let t,{userData:n,data:r}=e,i=r?.groups,s=r?.attributes??{},a=r?.morphAttributes??{},o=r?.interleavedBuffers,l=r?.arrayBuffers,c=r?.index;void 0!==s.position&&Array.isArray(s.position.array)&&(t=function(e){let t=1/0,n=1/0,r=1/0,i=-1/0,s=-1/0,a=-1/0;for(let o=0;o<e.length;o+=3){let l=e[o],c=e[o+1],h=e[o+2];t=Math.min(t,l),n=Math.min(n,c),r=Math.min(r,h),i=Math.max(i,l),s=Math.max(s,c),a=Math.max(a,h)}return{width:i-t,height:s-n,depth:a-r}}(s.position.array));let h={...void 0===n?{}:n.parameters,data:{attributes:s,morphAttributes:a,interleavedBuffers:o,arrayBuffers:l},...void 0===t?{}:t,type:"NonParametricGeometry"};return void 0!==c&&Object.assign(h.data,{index:c}),void 0!==i&&Object.assign(h.data,{groups:i.map(e=>({...e,materialIndex:e.materialIndex??0}))}),h}(e);if("SubdivGeometry"===t.type){let e="SubdivGeometry",n=r.data?.attributes;if(void 0===n?.positionWASM){let e=new tt;if(void 0===n?.position||void 0===n?.faceMap)return null;let t=n.position.array,i=n.faceMap.array,s=r.data.index.array;e.setAttribute("position",new et(t,3)),e.setIndex(new He(s,1));let a=B(e),o=[],l=new Array(i[i.length-1]+1).fill(3),c=a.getIndex().array;for(let e=0,t=i.length;e<t;)i[e]===i[e+1]?(l[i[e]]++,o.push(...new Set(c.slice(3*e,3*e+6))),e+=2):(o.push(...c.slice(3*e,3*e+3)),e++);n.indexWASM={array:o},n.positionWASM=a.attributes.position,n.verticesPerFaceWASM={array:l}}if(void 0===n?.positionWASM||0===n?.positionWASM.length||void 0===n?.indexWASM||0===n?.indexWASM.length||void 0===n?.verticesPerFaceWASM||0===n?.verticesPerFaceWASM.length)return null;let i={type:e,...Zt(n.positionWASM.array)};i.subdivisions=t.parameters.subdivisions;for(let e in n)"positionWASM"===e?i[e]=new Float32Array(n[e].array):"indexWASM"===e?i[e]=new Int32Array(n[e].array):"verticesPerFaceWASM"===e&&(i[e]=new Int8Array(n[e].array));return i.scaleBaked=[1,1,1],i}let i=t.type,s=t.parameters;return"VectorGeometry"===i?(s.extrudeDepth&&(s.depth=s.extrudeDepth),{...s,width:100,height:100,shape:$t(t.shape),type:i}):"LatheGeometry"===i?{...t.parameters,type:i,points:(t?.parameters.points??[]).map(e=>[e.x,e.y])}:(s.extrudeDepth&&(s.depth=s.extrudeDepth),{...s,type:i})}new Ye,new qe,new Ze,new Xe,new Xe;var Xt=new Qe,Yt=new Xe;function Zt(e){return Xt.setFromArray(e),Xt.getSize(Yt),{width:Yt.x,height:Yt.y,depth:Yt.z}}var Jt=class{constructor(e,t,n,r,i,s){if(this.id=e,this.data=t,this.object=n,this.entered=!1,("KeyDown"===t.type||"KeyUp"===t.type||"KeyPress"===t.type)&&!t.key)throw new Error("Missing property");this.actions=Q(t,t.actions,r,i,s,n)}disconnect(){ee(this.actions)}dispatchHeld(e){this.actions.Create.forEach(t=>{e&&t.dispatchThrottled.cancel(),t.dispatchThrottled()})}dispatch(e=!1){this.actions.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())}),"MousePress"===this.data.type||"KeyPress"===this.data.type?this.entered||(this.entered=!0,this.actions.Transition.forEach(e=>e.playFromCurrent()),this.actions.Animation.forEach(e=>e.playFromCurrent()),this.actions.TimelineAnimation.forEach(e=>e.playFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.playFromCurrent()),this.actions.Create.forEach(e=>e.dispatchStart())):(this.actions.Transition.some(e=>e.playing&&"Toggle"!==e.data.runMode)||this.actions.Transition.forEach(e=>e.play()),this.actions.SwitchCamera.some(e=>e.playing&&"Toggle"!==e.data.runMode)||this.actions.SwitchCamera.forEach(e=>{"Toggle"===e.data.runMode?e.toggle():e.play()}),this.actions.Animation.forEach(e=>{"runMode"in e.data&&"Toggle"===e.data.runMode?e.toggle():e.play()}),this.actions.TimelineAnimation.forEach(e=>{"runMode"in e.data&&"Toggle"===e.data.runMode?e.toggle():e.play()})),this.actions.Link.forEach(e=>{e.dispatch()}),this.actions.SceneTransition.forEach(e=>{e.dispatch()}),!1===e&&this.actions.Create.forEach(e=>{e.dispatch()}),this.actions.Destroy.forEach(e=>{e.dispatch()}),this.actions.Reset.forEach(e=>{e.dispatch()}),this.actions.Audio.forEach(e=>{e.dispatchBasic()}),this.actions.Video.forEach(e=>{e.dispatchBasic()}),this.actions.Particles.forEach(e=>{e.dispatchBasic()}),this.actions.SetVariable.forEach(e=>e.checkConditions()),this.actions.SetVariable.forEach(e=>e.dispatch()),this.actions.DynamicVariablePlay.forEach(e=>e.dispatch()),this.actions.ClearLocalStorage.forEach(e=>e.dispatch()),this.actions.UserAPI.forEach(e=>e.dispatch())}dispatchRelease(){this.entered&&(this.entered=!1,this.actions.Transition.forEach(e=>e.reverseFromCurrent()),this.actions.Particles.forEach(e=>e.reverseFromCurrent()),this.actions.Animation.forEach(e=>e.reverseFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.reverseFromCurrent()),this.actions.Create.forEach(e=>e.dispatchStop()))}dispatchUserEvent(e){this.actions.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())}),e?(this.actions.Transition.forEach(e=>e.reverseFromCurrent()),this.actions.Animation.forEach(e=>e.reverseFromCurrent()),this.actions.TimelineAnimation.forEach(e=>e.reverseFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.reverseFromCurrent())):(this.actions.Transition.forEach(e=>e.playFromCurrent()),this.actions.Animation.forEach(e=>e.playFromCurrent()),this.actions.TimelineAnimation.forEach(e=>e.playFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.playFromCurrent())),this.actions.Link.forEach(e=>{e.dispatch()}),this.actions.SceneTransition.forEach(e=>{e.dispatch()}),this.actions.Create.forEach(e=>{e.dispatch()}),this.actions.Destroy.forEach(e=>{e.dispatch()}),this.actions.Reset.forEach(e=>{e.dispatch()}),this.actions.Audio.forEach(e=>{e.dispatchBasic()}),this.actions.Video.forEach(e=>{e.dispatchBasic()}),this.actions.Particles.forEach(e=>{e.dispatchBasic()}),this.actions.SetVariable.forEach(e=>e.checkConditions()),this.actions.SetVariable.forEach(e=>e.dispatch()),this.actions.DynamicVariablePlay.forEach(e=>e.dispatch()),this.actions.ClearLocalStorage.forEach(e=>e.dispatch()),this.actions.UserAPI.forEach(e=>e.dispatch())}},Qt=class extends v{constructor(e,t,n){super(e),this.eventManager=t,this.useForRaycastProperty=n,this.objectsPerTypes={MouseDown:[],MouseUp:[],MousePress:[],KeyDown:[],KeyUp:[],KeyPress:[]},this.canvasMouseEvents=[],this.eventsPerObjects={MouseDown:{},MouseUp:{},MousePress:{},KeyDown:{},KeyUp:{},KeyPress:{}},this.heldKeys={},this.heldKeysPress={},this._prevObjects=[],this.sceneInterects=null,this.onCanvasRaycast=e=>{if(!0===this.useForRaycastProperty&&null===this.sceneInterects){this.eventContext.updateRaycaster(e);let{raycaster:t,page:n}=this.eventContext,r=l(t,n,[],!0);this.sceneInterects=r,r.length&&(this.eventContext.sharedAssets.raycastProperty={x:r[0].point.x,y:r[0].point.y,z:r[0].point.z,objX:r[0].object.matrixWorld.elements[12],objY:r[0].object.matrixWorld.elements[13],objZ:r[0].object.matrixWorld.elements[14]})}},this.onCanvasMouseDown=e=>{(e.target===this.eventContext.domElement||"SPLINE-VIEWER"===e.target.tagName)&&this.canvasMouseEvents.forEach(t=>{("MouseDown"===t.data.type||"MousePress"===t.data.type)&&(this.onCanvasRaycast(e),t.dispatch())})},this.onCanvasMouseUp=e=>{(e.target===this.eventContext.domElement||"SPLINE-VIEWER"===e.target.tagName)&&this.canvasMouseEvents.forEach(t=>{"MouseUp"===t.data.type?(this.onCanvasRaycast(e),t.dispatch()):"MousePress"===t.data.type&&t.dispatchRelease()})},this.onMouseDown=e=>{C.length>1||(this.eventContext.updateRaycaster(e),this.handleMouseEvent("MouseDown"))},this.onMouseUp=e=>{C.length>1||(this.eventContext.updateRaycaster(e),this.handleMouseEvent("MouseUp"))},this.onMousePressDown=e=>{C.length>1||(this.eventContext.updateRaycaster(e),this.handleMousePressEvent())},this.onMousePressRelease=e=>{C.length>1||(this.eventContext.updateRaycaster(e),this.handleMousePressEvent(!0))},this.onKeyDown=e=>{this.heldKeys[e.key]||(this.handleKeyEvent(e,"KeyDown"),this.handleKeyEventHeld(e,"KeyDown",!0)),this.heldKeys[e.key]=!0},this.onKeyUp=e=>{this.handleKeyEvent(e,"KeyUp"),this.handleKeyEventHeld(e,"KeyUp",!0)},this.onKeyPressDown=e=>{this.heldKeysPress[e.key]?this.handleKeyEventHeld(e,"KeyPress"):(this.handleKeyEvent(e,"KeyPress"),this.handleKeyEventHeld(e,"KeyPress",!0)),this.heldKeysPress[e.key]=!0},this.onKeyPressUp=e=>{this.handleKeyEvent(e,"KeyPress",!0)},this.releaseHeldKey=e=>{delete this.heldKeys[e.key]},this.releaseHeldKeyPress=e=>{delete this.heldKeysPress[e.key]},this._onUserEvent=({eventName:e,target:t,reverse:n})=>{if(!e||!t)return;let r=m(e);r&&("MouseDown"===r||"MouseUp"===r||"MousePress"===r?(t.dispatchEvent({type:"beginEvent",eventName:r}),this.eventsPerObjects[r]?.[t.uuid]?.forEach(e=>{e.dispatchUserEvent(n)}),this.canvasMouseEvents.forEach(e=>{e.dispatchUserEvent(n)})):("KeyDown"===r||"KeyUp"===r||"KeyPress"===r)&&(t.dispatchEvent({type:"beginEvent",eventName:r}),this.eventsPerObjects[r]?.[t.uuid]?.forEach(e=>{e.dispatchUserEvent()})))}}connect(){let{page:e,sharedAssets:t,domElement:n}=this.eventContext,r=(n,r)=>{if(!n.data?.events.length)return;let i=["MouseDown","MouseUp","MousePress","KeyDown","KeyUp","KeyPress"];for(let s of i){let i=this.eventsPerObjects[s];if(n.data.events.filter(({data:e})=>e.type===s&&!0!==e.disabled).forEach(({id:r,data:s})=>{try{let a=new Jt(r,s,n,e,t,this.eventManager);a.actions.Video.length&&(this.hasVideoAction=!0),"MouseDown"!==s.type&&"MouseUp"!==s.type&&"MousePress"!==s.type||"Canvas"!==s.mode&&"Window"!==s.mode?(i[n.uuid]?i[n.uuid].some(e=>e.id===a.id)||i[n.uuid].push(a):i[n.uuid]=[a],se(n)&&n.traverseChildren(e=>{if(!e.visible)return!0;e instanceof z&&"shapeBlendNode"in e.data.geometry&&2!==e.data.geometry.shapeBlendNode?.operation&&(i[e.uuid]?i[e.uuid].push(a):i[e.uuid]=[a])})):this.canvasMouseEvents.push(a)}catch(e){}}),i[n.uuid]?.length&&(this.objectsPerTypes[s].push(!ae(n)||"MouseDown"!==s&&"MouseUp"!==s&&"MousePress"!==s?n:r),se(n))){let e=this.objectsPerTypes[s];n.traverseChildren(t=>{if(!t.visible)return!0;t instanceof z&&-1===e.indexOf(t)&&e.push(t)})}}};e.traverseEntity(e=>{(oe(e)||e instanceof x)&&e.frame?.traverse(t=>{r(t,e)}),r(e)}),this.heldKeys={},this.heldKeysPress={},this.domEventsNeeded.clear(),n.addEventListener("pointerdown",this.onCanvasMouseDown),n.addEventListener("pointerup",this.onCanvasMouseUp),(this.objectsPerTypes.MouseDown?.length||this.useForRaycastProperty)&&(this.domEventsNeeded.add("pointerdown"),n.addEventListener("pointerdown",this.onMouseDown)),this.objectsPerTypes.MouseUp?.length&&(this.domEventsNeeded.add("pointerup"),n.addEventListener("pointerup",this.onMouseUp)),this.objectsPerTypes.MousePress?.length&&(this.domEventsNeeded.add("pointerdown"),n.addEventListener("pointerdown",this.onMousePressDown),this.domEventsNeeded.add("pointerup"),n.addEventListener("pointerup",this.onMousePressRelease)),this.objectsPerTypes.KeyDown?.length&&(this.domEventsNeeded.add("keydown"),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.releaseHeldKey)),this.objectsPerTypes.KeyUp?.length&&(this.domEventsNeeded.add("keyup"),document.addEventListener("keyup",this.onKeyUp)),this.objectsPerTypes.KeyPress?.length&&(this.domEventsNeeded.add("keydown"),document.addEventListener("keydown",this.onKeyPressDown),document.addEventListener("keyup",this.releaseHeldKeyPress),this.domEventsNeeded.add("keyup"),document.addEventListener("keyup",this.onKeyPressUp)),Object.entries(this.objectsPerTypes).forEach(([e,t])=>{t.forEach(e=>{e.addEventListener("userEvent",this._onUserEvent)})}),this.canvasMouseEvents.forEach(e=>{e.object.addEventListener("userEvent",this._onUserEvent)})}disconnect(){let{domElement:e}=this.eventContext;this.domEventsNeeded.clear(),this.heldKeys={},this.heldKeysPress={},e.removeEventListener("pointerdown",this.onCanvasMouseDown),e.removeEventListener("pointerup",this.onCanvasMouseUp),e.removeEventListener("pointerdown",this.onMouseDown),e.removeEventListener("pointerdown",this.onMousePressDown),e.removeEventListener("pointerup",this.onMouseUp),e.removeEventListener("pointerup",this.onMousePressRelease),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("keydown",this.onKeyPressDown),document.removeEventListener("keyup",this.onKeyPressUp),document.removeEventListener("keyup",this.releaseHeldKey),Object.values(this.eventsPerObjects).forEach(e=>{Object.values(e).forEach(e=>{e.forEach(e=>{e.disconnect()})})}),this.canvasMouseEvents.forEach(e=>{e.disconnect()}),Object.entries(this.objectsPerTypes).forEach(([e,t])=>{t.forEach(e=>{e.removeEventListener("userEvent",this._onUserEvent)})}),this.canvasMouseEvents.forEach(e=>{e.object.removeEventListener("userEvent",this._onUserEvent)})}handleMouseEvent(e){let{stopRaycast:t,raycaster:n,page:r,pointerScreen:i}=this.eventContext,s=this.objectsPerTypes[e],a=s.filter(e=>!ae(e));if((s.length||this.useForRaycastProperty)&&(!r.uiCanvas||!h(r,[i.x,i.y],Object.keys(this.eventsPerObjects[e]),t=>{this.handleObjectMouseEventDispatch(t,e)}))){if(t||this.useForRaycastProperty){let i;if(null===this.sceneInterects?i=l(n,r,a,this.useForRaycastProperty):(i=this.sceneInterects,this.sceneInterects=null),this.useForRaycastProperty&&i.length&&(this.eventContext.sharedAssets.raycastProperty={x:i[0].point.x,y:i[0].point.y,z:i[0].point.z,objX:i[0].object.matrixWorld.elements[12],objY:i[0].object.matrixWorld.elements[13],objZ:i[0].object.matrixWorld.elements[14]}),t){let t=[i[0]?.uv?.x??0,i[0]?.uv?.y??0];c(i).forEach(n=>{oe(n)&&h(n,t,Object.keys(this.eventsPerObjects[e]),t=>{this.handleObjectMouseEventDispatch(t,e)}),this.eventsPerObjects[e][n.uuid]&&this.handleObjectMouseEventDispatch(n,e)})}}t||a.forEach(t=>{let r=d(n,t);r&&(this.handleObjectMouseEventDispatch(t,e),oe(t)&&h(t,[r?.uv?.x??0,r?.uv?.y??0],Object.keys(this.eventsPerObjects[e]),t=>{this.handleObjectMouseEventDispatch(t,e)}))})}}handleMousePressEvent(e=!1){let t="MousePress",n=this.objectsPerTypes[t],r=n.filter(e=>!ae(e)),i=[];if(n.length){if(!e){let{stopRaycast:e,raycaster:n,page:s,pointerScreen:a}=this.eventContext,o=!1;if(s.uiCanvas&&(o=h(s,[a.x,a.y],Object.keys(this.eventsPerObjects[t]),e=>{i.push(e)})),e&&!o){let e=l(n,s,r);i=c(e),e.forEach(e=>{oe(e.object)&&h(e.object,[e?.uv?.x??0,e?.uv?.y??0],Object.keys(this.eventsPerObjects[t]),e=>{i.push(e)})})}else r.forEach(e=>{let r=d(n,e);r&&(i.push(e),oe(e)&&h(e,[r?.uv?.x??0,r?.uv?.y??0],Object.keys(this.eventsPerObjects[t]),e=>{i.push(e)}))})}this._prevObjects.length&&this._prevObjects.forEach(e=>{i.includes(e)||this.handleObjectMouseEventDispatchRelease(e,t)}),i.length&&i.forEach(e=>{this.handleObjectMouseEventDispatch(e,t)}),this._prevObjects=i}}handleObjectMouseEventDispatch(e,t){e.dispatchEvent({type:"beginEvent",eventName:t}),this.eventsPerObjects[t]?.[e.uuid]?.forEach(e=>{e.dispatch()})}handleObjectMouseEventDispatchRelease(e,t){e.dispatchEvent({type:"beginEvent",eventName:t}),this.eventsPerObjects[t]?.[e.uuid]?.forEach(e=>{e.dispatchRelease()})}handleKeyEvent(e,t,n=!1){this.objectsPerTypes[t].forEach(r=>{let i=this.eventsPerObjects[t][r.uuid];i.some(({data:t})=>"key"in t&&t.key===e.key)&&r.dispatchEvent({type:"beginEvent",eventName:t}),i.forEach(t=>{"key"in t.data&&t.data.key===e.key&&(n?t.dispatchRelease():t.dispatch(!0))})})}handleKeyEventHeld(e,t,n=!1){this.objectsPerTypes[t].forEach(r=>{this.eventsPerObjects[t][r.uuid].forEach(t=>{"key"in t.data&&t.data.key===e.key&&t.dispatchHeld(n)})})}},en=e=>!0===e?.isPlayAudioAction,tn=e=>!0===e?.isPauseAudioAction,nn=e=>!0===e?.isPlayVideoAction,rn=e=>!0===e?.isPauseVideoAction,sn=class{constructor(e,t,n,r,i,s){this.id=e,this.data=t,this.object=n,this.actions=Q(t,t.actions,r,i,s,n)}disconnect(){ee(this.actions)}dispatch(){this.actions.Transition.forEach(e=>{e.play()}),this.actions.Animation.forEach(e=>{e.play()}),this.actions.TimelineAnimation.forEach(e=>{e.play()}),this.actions.SwitchCamera.forEach(e=>{e.play()}),this.actions.SceneTransition.forEach(e=>{e.dispatch()}),this.actions.Reset.forEach(e=>e.dispatch()),this.actions.SetVariable.forEach(e=>e.checkConditions()),this.actions.SetVariable.forEach(e=>e.dispatch()),this.actions.DynamicVariablePlay.forEach(e=>e.dispatch()),this.actions.ClearLocalStorage.forEach(e=>e.dispatch()),this.actions.UserAPI.forEach(e=>e.dispatch()),this.actions.Create.forEach(e=>{e.dispatchFromStart()}),this.actions.Destroy.forEach(e=>{e.dispatchFromStart()})}dispatchAfter(e){this.actions.Audio.forEach(t=>{(t.interaction.data.triggerAfter??"any")===e&&(en(t.interaction)?t.interaction.audioPlayer?.play():tn(t.interaction)&&t.interaction.dispatch())}),this.actions.Video.forEach(t=>{let n=t.interaction.data.triggerAfter??"autoplay";n===e&&(nn(t.interaction)?t.interaction.play("autoplay"===n):rn(t.interaction)&&t.interaction.dispatch())}),this.actions.Particles.forEach(t=>{(t.data.triggerAfter??"any")===e&&t.dispatchBasic()})}async seekVideos(e){let t=[];this.actions.Video.forEach(n=>{"autoplay"===(n.interaction.data.triggerAfter??"autoplay")&&nn(n.interaction)&&t.push(n.interaction.seek(e))}),await Promise.all(t)}pauseVideos(){this.actions.Video.forEach(e=>{nn(e.interaction)&&e.interaction.pause()})}dispatchUserEvent(e){this.actions.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())}),e?(this.actions.Transition.forEach(e=>e.reverseFromCurrent()),this.actions.Animation.forEach(e=>e.reverseFromCurrent()),this.actions.TimelineAnimation.forEach(e=>e.reverseFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.reverseFromCurrent())):(this.actions.Transition.forEach(e=>e.playFromCurrent()),this.actions.Animation.forEach(e=>e.playFromCurrent()),this.actions.TimelineAnimation.forEach(e=>e.playFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.playFromCurrent())),this.actions.SceneTransition.forEach(e=>e.dispatch()),this.actions.Reset.forEach(e=>e.dispatch()),this.actions.SetVariable.forEach(e=>e.checkConditions()),this.actions.SetVariable.forEach(e=>e.dispatch()),this.actions.DynamicVariablePlay.forEach(e=>e.dispatch()),this.actions.ClearLocalStorage.forEach(e=>e.dispatch()),this.actions.UserAPI.forEach(e=>e.dispatch()),this.actions.Create.forEach(e=>{e.dispatch()}),this.actions.Destroy.forEach(e=>{e.dispatch()}),this.actions.Audio.forEach(e=>{en(e.interaction)?e.interaction.audioPlayer?.play():tn(e.interaction)&&e.interaction.dispatch()}),this.actions.Video.forEach(e=>{nn(e.interaction)?e.interaction.play():rn(e.interaction)&&e.interaction.dispatch()}),this.actions.Particles.forEach(e=>{e.dispatchBasic()})}},an=class extends v{constructor(e,t){super(e),this.eventManager=t,this.eventsPerObject=new Map,this.eventsAfterPerObject=new Map,this.onMouseDown=()=>{[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>{e.dispatchAfter("mouseDown")})})},this.onKeyDown=()=>{[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>{e.dispatchAfter("keyDown")})})},this.onAny=()=>{let{domElement:e,isExport:t}=this.eventContext,n=t?document:e;n.removeEventListener("pointerdown",this.onAny),n.removeEventListener("mousedown",this.onAny),document.removeEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>{e.dispatchAfter("any")})})},this.onSceneTransitionAudioVideoPlay=()=>{[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>{e.actions.Audio.forEach(e=>{en(e.interaction)&&e.interaction.audioPlayer?.play()}),e.actions.Video.forEach(e=>{let t=e.interaction.data.triggerAfter??"autoplay";nn(e.interaction)&&e.interaction.play("autoplay"===t)}),e.actions.Particles.forEach(e=>{e.dispatchBasic()})})})},this.onPlay=()=>{[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>{e.dispatchAfter("autoplay")})})},this.seekVideos=async e=>{let t=[];[...this.eventsAfterPerObject.entries()].forEach(([n,r])=>{!n.data.visible||r.forEach(n=>{t.push(n.seekVideos(e))})}),await Promise.all(t)},this.pauseVideos=()=>{[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{t.forEach(e=>{e.pauseVideos()})})},this.onUserEvent=({eventName:e,target:t,reverse:n})=>{if(!e||!t)return;let r=m(e);r&&"Start"===r&&(ae(t)||t.dispatchEvent({type:"beginEvent",eventName:"Start"}),this.eventsPerObject.get(t)?.forEach(e=>{e.dispatchUserEvent(n)}),this.eventsAfterPerObject.get(t)?.forEach(e=>{e.dispatchUserEvent(n)}))}}connect(){let{sharedAssets:e,page:t}=this.eventContext,n=n=>{if(n.data?.events.length)for(let{id:r,data:i}of n.data.events){if(i.disabled||"Start"!==i.type)continue;let s=new sn(r,i,n,t,e,this.eventManager);(s.actions.Transition.length||s.actions.TimelineAnimation.length||s.actions.Animation.length||s.actions.SwitchCamera.length||s.actions.Create.length||s.actions.Destroy.length||s.actions.SceneTransition.length||s.actions.Reset.length||s.actions.SetVariable.length||s.actions.DynamicVariablePlay.length||s.actions.ClearLocalStorage.length||s.actions.UserAPI.length)&&(this.eventsPerObject.has(n)?this.eventsPerObject.get(n)?.push(s):this.eventsPerObject.set(n,[s])),s.actions.Audio.length&&(this.eventsAfterPerObject.has(n)?this.eventsAfterPerObject.get(n)?.push(s):this.eventsAfterPerObject.set(n,[s])),s.actions.Video.length&&(this.hasVideoAction=!0,this.eventsAfterPerObject.has(n)?this.eventsAfterPerObject.get(n)?.push(s):this.eventsAfterPerObject.set(n,[s])),s.actions.Particles.length&&(this.eventsAfterPerObject.has(n)?this.eventsAfterPerObject.get(n)?.push(s):this.eventsAfterPerObject.set(n,[s]))}};if(t.traverseEntity(e=>{(oe(e)||e instanceof x)&&e.frame?.traverse(e=>{n(e)}),n(e)}),[...this.eventsAfterPerObject.values()].some(e=>e.length)){if(0===this.eventManager.activateCount){let{domElement:e,isExport:t}=this.eventContext,n=t?document:e;n.addEventListener("pointerdown",this.onMouseDown,{once:!0}),n.addEventListener("mousedown",this.onMouseDown,{once:!0}),document.addEventListener("keydown",this.onKeyDown,{once:!0}),n.addEventListener("pointerdown",this.onAny),n.addEventListener("mousedown",this.onAny),document.addEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.addEventListener("userEvent",this.onUserEvent)})}else this.onSceneTransitionAudioVideoPlay();this.onPlay()}[...this.eventsPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>e.dispatch()),e.addEventListener("userEvent",this.onUserEvent)})}disconnect(){if([...this.eventsAfterPerObject.values()].some(e=>e.length)){let{domElement:e,isExport:t}=this.eventContext,n=t?document:e;n.removeEventListener("pointerdown",this.onMouseDown),n.removeEventListener("mousedown",this.onMouseDown),document.removeEventListener("keydown",this.onKeyDown),n.removeEventListener("pointerdown",this.onAny),n.removeEventListener("mousedown",this.onAny),document.removeEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.removeEventListener("userEvent",this.onUserEvent),t.forEach(e=>e.disconnect())})}[...this.eventsPerObject.entries()].forEach(([e,t])=>{e.removeEventListener("userEvent",this.onUserEvent),t.forEach(e=>e.disconnect())}),this.eventsPerObject.clear(),this.eventsAfterPerObject.clear()}},on=class{constructor(e,t,n,r,i){this.publish=e,this.controlsManager=t,this.animationControls=n,this.eventContext=r,this.sharedVariables=i,this.isEnabled=!1,this.activateCount=0,this.needsMouse=!1,this.needsRaycast=!1,this.onTouchMovePreventScroll=e=>{let t=window.parent!==window,n=document.documentElement.scrollHeight>document.documentElement.clientHeight||document.documentElement.scrollWidth>document.documentElement.clientWidth;(e.touches.length>1||this.preventTouchScroll||!1===t&&!1===n)&&e.preventDefault()},this.onMouseWheelPreventScroll=e=>{this.preventScroll&&e.preventDefault()},this.onMouseMove=e=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(e),pressed:e.buttons>0}},this.onMouseDown=e=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(e),pressed:!0}},this.onMouseUp=e=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(e),pressed:!1}},this.getMousePosition=e=>{let{domRect:t}=this.eventContext,{pageX:n,pageY:r}=e.touches?.length>0?e.touches[0]:e;return{x:n-(t.left+window.scrollX),y:r-(t.top+window.scrollY)}},this.stopRaycast=e.stopRaycast,this.preventScroll=e.preventScroll,this.preventTouchScroll=e.preventTouchScroll,this.hideCursor=e.hideCursor,this.requestRender=r.requestRender}warnMissingEventFeatures(){this.eventContext.page.traverseEntity(e=>{for(let t of e.dataPatched.events){if(!0===t.data.disabled)continue;let e=t.data.type;if(void 0!==this.handlers[e])continue;let n=Z[e];void 0!==n&&he(n,`a "${e}" event`)}})}activate(e=!1){if(this.isEnabled)return;this.isEnabled=!0,this.initializeActionsDependentStates(),this.needsMouse&&(this.eventContext.domElement.addEventListener("pointermove",this.onMouseMove),this.eventContext.domElement.addEventListener("pointerdown",this.onMouseDown));let t={eventContext:this.eventContext,eventManager:this,sharedVariables:this.sharedVariables,needsMouse:this.needsMouse,needsRaycast:this.needsRaycast};this.handlers={};let n=(e,n)=>{let r=y(e);void 0!==r?this.handlers[e]=r(t):void 0!==n&&(this.handlers[e]=n())};n("Spline",()=>new f(this.eventContext)),n("VariableChange"),n("API"),n("WEBHOOK"),n("AIAssistantListener"),n("AIAssistantTrigger"),n("Conditional"),n("Start",()=>new an(this.eventContext,this)),n("Basic",()=>new Qt(this.eventContext,this,this.needsRaycast)),n("MouseHover"),n("Scroll"),n("Follow"),n("DragDrop"),n("LookAt"),n("Resize"),n("Textfields"),this.warnMissingEventFeatures();let{page:r,domElement:i}=this.eventContext;this.hideCursor&&(i.style.cursor="none"),r.traverseEntity(e=>{e.addEventListener("requestRender",this.requestRender)}),Object.values(this.handlers).forEach(e=>e.connect()),i.addEventListener("wheel",this.onMouseWheelPreventScroll),i.addEventListener("touchmove",this.onTouchMovePreventScroll),this.activateCount++,e||this.eventContext.sharedAssets.openAIRealtime?.connect()}deactivate(e=!1){if(!this.isEnabled)return;this.isEnabled=!1,this.eventContext.domElement.removeEventListener("pointermove",this.onMouseMove),this.eventContext.domElement.removeEventListener("pointerdown",this.onMouseDown),this.eventContext.domElement.removeEventListener("pointerup",this.onMouseUp),this.eventContext.sharedAssets.mouseProperty=null,this.eventContext.sharedAssets.raycastProperty=null;let{page:t,domElement:n}=this.eventContext;n.style.cursor="",Object.values(this.handlers).forEach(e=>e.disconnect()),this.controlsManager.gameControl?.disposeActions(),this.controlsManager.disconnectEvents(),t.traverseEntity(e=>{e.removeEventListener("requestRender",this.requestRender),e.destroyedInAction=!1}),n.removeEventListener("touchmove",this.onTouchMovePreventScroll),n.removeEventListener("wheel",this.onMouseWheelPreventScroll),this.animationControls.onExitPlayMode(),e||this.eventContext.sharedAssets.openAIRealtime?.disconnect()}dispose(){this.deactivate(),Object.values(this.handlers).forEach(e=>e.dispose())}get isPaused(){return this.isEnabled}pause(){this.deactivate()}resume(){this.activate()}reset(){this.deactivate(!0),this.activate(!0),this.controlsManager.deactivate(),this.controlsManager.activate(this),this.controlsManager.page.updateMatrixWorld(!0),this.controlsManager.rebuildBVH()}updateUseWindowEvents(e){let t=this.isEnabled;t&&this.deactivate(),this.eventContext.useWindowEvents=e,t&&this.activate()}initializeActionsDependentStates(){let e=this.eventContext.sharedAssets;e.resetDynamicVariablePlayState();let t=n=>{if("Conditional"===n.data.type&&(n.data.ifActions.forEach(t),n.data.elseActions.forEach(t)),"Conditional"===n.data.type||"SetVariable"===n.data.type)for(let e of"Conditional"===n.data.type?n.data.condition:n.data.expression)"id"in e&&Array.isArray(e.id)&&("mouse"===e.id[0]&&(this.needsMouse=!0),"raycast"===e.id[0]&&(this.needsRaycast=!0));"DynamicVariablePlay"===n.data.type&&""!==n.data.variableId&&("Play"===n.data.mode||"PlayPause"===n.data.mode||"Toggle"===n.data.mode)&&e.setDynamicVariablePlayState(n.data.variableId,"Stopped")};this.eventContext.page.traverseEntity(e=>{if(e.data?.events.length)for(let n of e.data.events)if("VariableChange"===n.data.type&&("mouseProperty"===n.data.variableId&&(this.needsMouse=!0),"raycastProperty"===n.data.variableId&&(this.needsRaycast=!0)),"Conditional"===n.data.type)for(let e of["inActions","outActions"])n.data[e].forEach(t);else if("DragDrop"===n.data.type)for(let e of["drag","drop"])n.data.dragDropActions[e].forEach(t);else if("GameControl"===n.data.type)for(let e of["idle","move","jump","run"])n.data.gameActions[e].forEach(t);else if("Resize"===n.data.type)for(let e of n.data.breakpoints)e.data.actions.forEach(t);else"LookAt"===n.data.type||"API"===n.data.type||n.data.actions.forEach(t)})}},ln=class{constructor(e,t,n,r){this.enableResponsive=!1,this._renderer=e,this._camera=t,this._frameSize=(new $e).copy(n),this._fov=r??t.fov}set frameSize(e){this._frameSize.copy(e)}setRenderSize(e,t){this._renderSize=void 0===e||void 0===t?void 0:new $e(e,t)}updateRenderer(){if(!this._renderer)return;let e=this._renderSize??this._frameSize;this._renderer.setSize(e.x,e.y)}updateViewport(){if(!this._renderer||!this._camera||"PerspectiveCamera"!==this._camera.cameraType)return;let e=this._renderSize??this._frameSize;this._renderer.setViewport(0,0,e.x,e.y)}updateCamera(){!this._camera||("PerspectiveCamera"===this._camera.cameraType?(this._camera.aspect=this._frameSize.x/this._frameSize.y,this._camera.updateProjectionMatrix()):this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y,this.enableResponsive))}setCamera(e){this._camera=e,this._fov=e.fov}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t,this.enableResponsive),this._camera.updateProjectionMatrix())}},cn=["particles","hair","shape-blends","vector-shapes","3d-paths","cloners","components","text","ui-2d","game-controls","collision-bvh","transitions"];function hn(e,t){if("Page"===e.type){let n=e.timelines;(void 0===n||Object.keys(n).length>0)&&t.add("timeline")}switch(e.type){case"Particle":case"ParticleCollider":t.add("particles");break;case"Hair":t.add("hair");break;case"Page":{null!=e.publish?.gameControlObject&&t.add("game-controls"),(null!=e.uiScene||void 0!==e.uiFrame)&&t.add("ui-2d");let n=e.uiScene?.objects;if(void 0!==n){if("function"!=typeof n.traverse)throw new Error("unrecognized uiScene shape");n.traverse((e,n)=>{hn(n,t)})}break}}switch(e.geometry?.type){case"ShapeBlendGeometry":t.add("shape-blends");break;case"VectorGeometry":t.add("vector-shapes");break;case"PathGeometry":t.add("3d-paths");break;case"UIGeometry":t.add("ui-2d");break;case"TextGeometry":case"InputGeometry":t.add("text")}("Component"===e.type||"Instance"===e.type)&&t.add("components"),null!=e.cloner&&t.add("cloners");let n=e.states;if(null!=n)if(Array.isArray(n))n.length>0&&t.add("transitions");else{if("object"!=typeof n)throw new Error("unrecognized states shape");Object.keys(n).length>0&&t.add("transitions")}}function dn(e,t){if(e&&(e.data&&hn(e.data,t),e.children))for(let n of e.children)dn(n,t)}var un,pn,mn=class{get sharedAssets(){return this.shared}constructor(e,t={},n=!0){this.shared=new N(e.shared,t,!0,n),this.scene=new a(e.scene,this.sharedAssets),this.shared.setEntityOpContext({scene:this.scene,shared:this.shared})}reset(e,t){this.scene.clearScene(),this.sharedAssets.reset(e.shared),this.scene.resetAfterClear(e.scene,this.sharedAssets)}resetPersonalCameraFromDocumentData(){for(let e of this.scene.children)e instanceof x&&!e.uiScene&&e.personalCamera.updateState(e.data.camera,{scene:this.scene,shared:this.shared})}dispose(){this.scene.dispose(),this.shared.dispose()}gc(){this.scene.releaseInstanceGroups(),this.shared.geometryCache.startGc(),this.shared.geometryCache2.startGc(),this.scene.traverseEntity(e=>{e instanceof z&&e.markGeometryAsReachable(this.shared)}),this.shared.geometryCache.endGc(),this.shared.geometryCache2.endGc()}},fn="vertexOrder";function vn(e){return pn||(pn=import("./runtime-DRACOLoader-GLMRFFK2.js").then(({DRACOLoader:t})=>((un=new t).setDecoderPath(void 0!==e?`${e}/`:"https://www.gstatic.com/draco/versioned/decoders/1.5.2/").preload(),un.decoderPending))),pn}async function yn(e){if(un){let t,n={attributeIDs:{...un.defaultAttributeIDs,[fn]:"GENERIC"},attributeTypes:{...un.defaultAttributeTypes,[fn]:"Uint32Array"},useUniqueIDs:!1};try{t=await un.decodeGeometry(new Int8Array(e).buffer,n)}catch(e){console.error(e)}if(t)return function(e){let t=e.attributes.find(e=>e.name===fn);if(!t)return e;let n=t.array,r=n.length,i=0;for(let e=0;e<r;e++)i=Math.max(i,n[e]+1);let s,a=e.attributes.filter(e=>e!==t).map(({name:e,itemSize:t,array:s})=>{let a=new Float32Array(i*t);for(let e=0;e<r;e++){let r=n[e]*t,i=e*t;for(let e=0;e<t;e++)a[r+e]=s[i+e]}return{name:e,itemSize:t,array:a}});if(e.index){let t=e.index.array,r=new Uint32Array(t.length);for(let e=0;e<t.length;e++)r[e]=n[t[e]];s={array:r}}return{index:s,attributes:a}}({index:t.index?{array:t.index.array}:void 0,attributes:Object.entries(t.attributes).map(([e,t])=>({name:e,itemSize:t.itemSize,array:t.array}))})}return null}async function bn(e){for(let t of e){let e=await yn(t.geometry.data.draco);if(e){let n=t.geometry.data;e.index&&(n.index={array:e.index.array,itemSize:1,normalized:!1,type:"Uint32Array"});let r={};e.attributes.forEach(({name:e,array:t,itemSize:n})=>{r[e]={array:t,itemSize:n,type:"Float32Array",normalized:!1}}),n.attributes=r,n.draco=void 0}}}var gn={bloom:()=>import("./runtime-bloom-5BWRSKXE.js"),chromaticAberration:()=>import("./runtime-chromaticAberration-XNVWJQWI.js"),vignette:()=>import("./runtime-vignette-TYITST5S.js"),noise:()=>import("./runtime-noise-QZ2I3334.js"),hueSaturation:()=>import("./runtime-hueSaturation-YSHDI5JV.js"),brightnessContrast:()=>import("./runtime-brightnessContrast-GBILAHY5.js"),depthOfField:()=>import("./runtime-depthOfField-V2X263JE.js"),pixelation:()=>import("./runtime-pixelation-VQFF744B.js")},wn={bloom:()=>import("./runtime-fxBloom-4HSWHGBL.js"),depthOfField:()=>import("./runtime-fxDepthOfField-NGC6SATF.js")};function En(e,t,n){return Promise.all(e.map(e=>t[e]?.().catch(t=>{console.warn(`[spline] Failed to load the ${e} postprocessing effect (${n}); the effect will be skipped.`,t)}))).then(()=>{})}function _n(e){return En(e,gn,"webgl")}var jn=new WeakMap,Pn=new WeakMap;function Mn(e,t,n){let r=i=>{e.removeEventListener(t,r,!0),i.stopImmediatePropagation(),n(i)};return e.addEventListener(t,r,!0),()=>e.removeEventListener(t,r,!0)}var Cn=rt(it(),1);function On(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function An(e){return{id:e.uuid,name:e.name,type:e.object.data?.type??e.object.type,visible:!1!==e.playModeVisible,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x*Fe.RAD2DEG,y:e.rotation.y*Fe.RAD2DEG,z:e.rotation.z*Fe.RAD2DEG},scale:{x:e.scale.x,y:e.scale.y,z:e.scale.z},spawned:!0}}function xn(e){return{id:e.uuid,name:e.name,type:e.type??"Object",visible:e.visible,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x*Fe.RAD2DEG,y:e.rotation.y*Fe.RAD2DEG,z:e.rotation.z*Fe.RAD2DEG},scale:{x:e.scale.x,y:e.scale.y,z:e.scale.z}}}function Sn(e,n,r){let i=t=>e.findObjectById(t)??e.findObjectByName(t),s=new Map,a=e=>{let t=s.get(e);if(t)return t;for(let t of s.values())if(t.name===e)return t};return{setVariable:(t,n)=>t in e.getVariables()?(e.setVariable(t,n),{ok:!0}):{ok:!1,warning:`spline.setVariable: no variable named "${t}" in this scene.`},getVariable:t=>e.getVariable(t),getVariables:()=>e.getVariables(),getAllObjects:()=>e.getAllObjects().map(xn),findObject:e=>{let t=i(e);return t?xn(t):void 0},getGeometry:(e,t)=>{if(!r)return{warning:"spline.getGeometry: not available in this runtime integration."};let n=a(e),s=n?n.object:(()=>{let t=i(e);return t?r.findEntity(t.uuid):void 0})();if(!s)return{warning:`spline.getGeometry: no object named "${e}" (names/ids come from getAllObjects).`};let o,l=n??s;"world"===t.space&&(l.updateWorldMatrix?.(!0,!1),o=l.matrixWorld?.elements);let c=function(e,t){let n=e?.getAttribute("position");if(!n||!n.count)return null;let r=n.count,i=t??null,s=e.getIndex?.()??null,a=Math.floor((s?s.count:r)/3),o=1/0,l=1/0,c=1/0,h=-1/0,d=-1/0,u=-1/0,p=new Float32Array(3*r);for(let e=0;e<r;e++){let t=n.getX(e),r=n.getY(e),s=n.getZ(e);i&&([t,r,s]=Ht(i,t,r,s)),t<o&&(o=t),r<l&&(l=r),s<c&&(c=s),t>h&&(h=t),r>d&&(d=r),s>u&&(u=s),p[3*e]=t,p[3*e+1]=r,p[3*e+2]=s}let m={space:i?"world":"local",vertexCount:r,triangleCount:a,indexed:null!==s,bounds:{min:[o,l,c],max:[h,d,u],size:[h-o,d-l,u-c]},vertices:p};if(s){let e=new Uint32Array(s.count);for(let t=0;t<s.count;t++)e[t]=s.getX(t);m.indices=e}let f=e.getAttribute("normal");if(f&&f.count===r){let e=i?function(e){let t=e[0],n=e[4],r=e[8],i=e[1],s=e[5],a=e[9],o=e[2],l=e[6],c=e[10],h=t*(s*c-a*l)-n*(i*c-a*o)+r*(i*l-s*o);if(!isFinite(h)||Math.abs(h)<1e-12)return null;let d=1/h,u=[(s*c-a*l)*d,(r*l-n*c)*d,(n*a-r*s)*d,(a*o-i*c)*d,(t*c-r*o)*d,(r*i-t*a)*d,(i*l-s*o)*d,(n*o-t*l)*d,(t*s-n*i)*d];return[u[0],u[3],u[6],u[1],u[4],u[7],u[2],u[5],u[8]]}(i):void 0;if(!i||e){let t=new Float32Array(3*r);for(let n=0;n<r;n++){let r=f.getX(n),i=f.getY(n),s=f.getZ(n);if(e){let t=e[0]*r+e[1]*i+e[2]*s,n=e[3]*r+e[4]*i+e[5]*s,a=e[6]*r+e[7]*i+e[8]*s,o=Math.hypot(t,n,a);o>1e-12?(r=t/o,i=n/o,s=a/o):(r=t,i=n,s=a)}t[3*n]=r,t[3*n+1]=i,t[3*n+2]=s}m.normals=t}}let v=e.getAttribute("uv");if(v&&v.count===r){let e=new Float32Array(2*r);for(let t=0;t<r;t++)e[2*t]=v.getX(t),e[2*t+1]=v.getY(t);m.uvs=e}return m}(s.geometry,o);return c?{data:{id:l.uuid,name:l.name,geometry:s.data?.geometry?.type,...c}}:{warning:`spline.getGeometry: "${l.name}" has no readable geometry — only meshes do (lights, cameras and groups have none; read a group's child meshes instead).`}},updateObject:(t,n)=>{let s=a(t);if(s){let{position:t,rotation:r,scale:i,visible:a}=n;return t&&("number"==typeof t.x&&(s.position.x=t.x),"number"==typeof t.y&&(s.position.y=t.y),"number"==typeof t.z&&(s.position.z=t.z)),r&&("number"==typeof r.x&&(s.rotation.x=r.x*Fe.DEG2RAD),"number"==typeof r.y&&(s.rotation.y=r.y*Fe.DEG2RAD),"number"==typeof r.z&&(s.rotation.z=r.z*Fe.DEG2RAD)),i&&("number"==typeof i.x&&(s.scale.x=i.x),"number"==typeof i.y&&(s.scale.y=i.y),"number"==typeof i.z&&(s.scale.z=i.z)),"boolean"==typeof a&&(s.playModeVisible=a),s.updateMatrix(),e.requestRender(),!0}let o=i(t);if(!o)return!1;let{position:l,rotation:c,scale:h,visible:d,geometry:u,material:p}=n;if(u&&"object"==typeof u&&r){let e=r.findEntity(o.uuid);if(e){let{vertices:t,normals:n,uvs:i,indices:s,...a}=u;On(t)&&r.shared.updateEntityGeometryVertices(e,{vertices:t,normals:On(n)?n:void 0,uvs:On(i)?i:void 0,indices:On(s)?s:void 0}),Object.keys(a).length>0&&r.shared.updateEntityGeometryParams(e,a)}}if(p&&"object"==typeof p&&r){let e=r.findEntity(o.uuid);e&&r.shared.updateEntityMaterialParams(e,p)}return l&&("number"==typeof l.x&&(o.position.x=l.x),"number"==typeof l.y&&(o.position.y=l.y),"number"==typeof l.z&&(o.position.z=l.z)),c&&("number"==typeof c.x&&(o.rotation.x=c.x*Fe.DEG2RAD),"number"==typeof c.y&&(o.rotation.y=c.y*Fe.DEG2RAD),"number"==typeof c.z&&(o.rotation.z=c.z*Fe.DEG2RAD)),h&&("number"==typeof h.x&&(o.scale.x=h.x),"number"==typeof h.y&&(o.scale.y=h.y),"number"==typeof h.z&&(o.scale.z=h.z)),"boolean"==typeof d&&(o.visible=d),e.requestRender(),!0},createObject:async(t,n)=>xn(await e.createObject(t,n)),createCustomMaterial:t=>e.createCustomMaterial(t),getTexture:(e,t)=>{if(!r)return null;let n=i(e),s=n?r.findEntity(n.uuid):void 0;if(!s)return null;let a=r.shared.getEntityTexture(s,t??{});return a?{texture:a.texture,width:a.width,height:a.height,layer:a.layerType}:null},setMaterial:(t,n)=>e.setMaterial(t,n),cloneObject:(t,n)=>xn(e.cloneObject(t,n)),removeObject:t=>e.removeObject(t),spawnObject:(t,n)=>{if(!r)return{warning:"spline.spawnObject: not available in this runtime integration."};let a=i(t),o=a?r.findEntity(a.uuid):void 0;if(!o)return{warning:`spline.spawnObject: no object named "${t}" to use as a template.`};if(s.size>=500)return{warning:"spline.spawnObject: spawn budget reached (500 live copies) — destroyObject old copies (or reuse them) instead of spawning more."};let l=r.shared.spawnRuntimeClone(o,n??{});return l?(s.set(l.uuid,l),e.requestRender(),{object:An(l)}):{warning:`spline.spawnObject: "${t}" cannot be spawned from.`}},destroyObject:t=>{let n=a(t);return!(!r||!n||(s.delete(n.uuid),r.shared.destroyRuntimeClone(n),e.requestRender(),0))},setInstanceTransforms:(t,n)=>{if(!r)return-1;let s=i(t),a=s?r.findEntity(s.uuid):void 0;if(!a)return-1;let o=r.shared.setEntityInstanceTransforms(a,n);return o>=0&&e.requestRender(),o},...t(()=>r?.getAnimationControls(),e=>{let t=i(e);return t?r?.findEntity(t.uuid):void 0}),emitEvent:(e,t,n)=>{let r=i(t);return r?(n?r.emitEventReverse(e):r.emitEvent(e),{ok:!0}):{ok:!1,warning:`spline.emitEvent: no object named "${t}".`}},requestRender:()=>e.requestRender(),addSplineEventListener:(t,n)=>{let r=e=>{n({target:{id:e.target?.id??"",name:e.target?.name??""}})};return e.addEventListener(t,r),()=>e.removeEventListener(t,r)},getCanvas:()=>n}}var kn=class{constructor(e,t,n){this.iframe=e,this.bridge=t,this.observer=n}static mount(e,t,n,r){if(typeof document>"u")return null;let i=t.parentElement;if(!i)return null;"static"===getComputedStyle(i).position&&(i.style.position="relative");let s=document.createElement("iframe");s.setAttribute("sandbox","allow-scripts allow-forms allow-pointer-lock"),s.title="Spline HTML content";let a=s.style;a.position="absolute",a.border="0",a.background="transparent",a.pointerEvents="auto",a.colorScheme="normal";let o=()=>{a.left=`${t.offsetLeft}px`,a.top=`${t.offsetTop}px`,a.width=`${t.offsetWidth}px`,a.height=`${t.offsetHeight}px`};o();let l=new ResizeObserver(o);l.observe(t),l.observe(i),s.srcdoc=function(e){let t=`<script>${Kt}<\/script>`,n=/<head(\s[^>]*)?>/i.exec(e);if(n){let r=n.index+n[0].length;return e.slice(0,r)+t+e.slice(r)}let r=/<html(\s[^>]*)?>/i.exec(e);if(r){let n=r.index+r[0].length;return e.slice(0,n)+`<head>${t}</head>`+e.slice(n)}return t+e}(n),i.insertBefore(s,t.nextSibling);let c=new Ft(s,Sn(e,t,r),(e,t)=>{"warn"===e?console.warn(`[spline html] ${t}`):"error"===e&&console.error(`[spline html] ${t}`)});return c.attach(),new kn(s,c,l)}dispose(){this.bridge.dispose(),this.observer.disconnect(),this.iframe.remove()}},Rn="data-spline-html-content",Tn=`\n[${Rn}] { pointer-events: none; }\n[${Rn}] > * { pointer-events: auto; }\n[${Rn}] [data-spline-passthrough] { pointer-events: none; }\n`,Dn=class{constructor(e,t,n,r,i,s){this.container=e,this.host=t,this.observer=n,this.spline=r,this.previousSplineGlobal=i,this.removeLateLifecycleShim=s}static mount(e,t,n,r){if(typeof document>"u")return null;let i=t.parentElement;if(!i)return null;"static"===getComputedStyle(i).position&&(i.style.position="relative");let s=document.createElement("div");s.setAttribute(Rn,"");let a=s.style;a.position="absolute",a.overflow="hidden";let o=()=>{a.left=`${t.offsetLeft}px`,a.top=`${t.offsetTop}px`,a.width=`${t.offsetWidth}px`,a.height=`${t.offsetHeight}px`};o();let l=new ResizeObserver(o);l.observe(t),l.observe(i);let c=document.createElement("style");c.textContent=Tn,s.appendChild(c);let h=(new DOMParser).parseFromString(n,"text/html"),d=Array.from(h.querySelectorAll("script"));for(let e of d)e.remove();for(let e of Array.from(h.head.children))("STYLE"===e.tagName||"LINK"===e.tagName&&"stylesheet"===e.rel)&&s.appendChild(e);for(;h.body.firstChild;)s.appendChild(h.body.firstChild);i.insertBefore(s,t.nextSibling);let u=new Map,p=new zt(Sn(e,t,r),(e,t)=>{"warn"===e?console.warn(`[spline html] ${t}`):"error"===e&&console.error(`[spline html] ${t}`)},(e,t)=>{let n=u.get(e);if(n)for(let e of n)try{e(t)}catch(e){console.error(e)}}),m=(e,t)=>{try{return Promise.resolve(p.execute(e,t))}catch(e){return Promise.reject(e)}},f={ready:Promise.resolve(),setVariable:(e,t)=>m("setVariable",[e,t]),setVariables:e=>m("setVariables",[e]),getVariable:e=>m("getVariable",[e]),getVariables:()=>m("getVariables",[]),getAllObjects:()=>m("getAllObjects",[]),findObjectByName:e=>m("findObjectByName",[e]),findObjectById:e=>m("findObjectById",[e]),getGeometry:(e,t)=>m("getGeometry",[e,t??{}]),updateObject:(e,t)=>m("updateObject",[e,t]),createObject:(e,t)=>m("createObject",[e,t??{}]),createCustomMaterial:e=>m("createCustomMaterial",[e]),getTexture:(e,t)=>m("getTexture",[e,t??{}]),setMaterial:(e,t)=>m("setMaterial",[e,t]),cloneObject:(e,t)=>m("cloneObject",[e,t??{}]),removeObject:e=>m("removeObject",[e]),spawnObject:(e,t)=>m("spawnObject",[e,t??{}]),destroyObject:e=>m("destroyObject",[e]),setInstanceTransforms:(e,t)=>m("setInstanceTransforms",[e,t??null]),getAnimations:e=>m("getAnimations",[e]),playAnimation:(e,t,n)=>m("playAnimation",[e,t,n]),pauseAnimation:(e,t)=>m("pauseAnimation",[e,t]),stopAnimation:(e,t)=>m("stopAnimation",[e,t]),emitEvent:(e,t)=>m("emitEvent",[e,t]),emitEventReverse:(e,t)=>m("emitEventReverse",[e,t]),requestRender:()=>m("requestRender",[]),addEventListener:(e,t)=>{if("function"!=typeof t)return;let n=u.get(e);n||(n=new Set,u.set(e,n),m("listenEvent",[e])),n.add(t)},removeEventListener:(e,t)=>{let n=u.get(e);!n||(n.delete(t),0===n.size&&(u.delete(e),m("unlistenEvent",[e])))}},v=window.spline;window.spline=f;let y=function(){if(typeof document>"u"||"loading"===document.readyState)return()=>{};let e=[],t=(t,n)=>{let r=new Set,i=t.addEventListener.bind(t),s=t.removeEventListener.bind(t);Object.defineProperty(t,"addEventListener",{configurable:!0,writable:!0,value:(e,s,a)=>{if(i(e,s,a),!n.includes(e)||null==s)return;let o={type:e,listener:s};r.add(o),queueMicrotask(()=>{!r.delete(o)||((e,t,n)=>{let r=new Event(n);try{"function"==typeof t?t.call(e,r):t.handleEvent?.(r)}catch(e){console.error(e)}})(t,o.listener,o.type)})}}),Object.defineProperty(t,"removeEventListener",{configurable:!0,writable:!0,value:(e,t,n)=>{s(e,t,n);for(let n of r)n.type===e&&n.listener===t&&r.delete(n)}}),e.push(()=>{delete t.addEventListener,delete t.removeEventListener,r.clear()})};t(document,["DOMContentLoaded"]),t(window,["load"]);let n=Object.getOwnPropertyDescriptor(window,"onload");return Object.defineProperty(window,"onload",{configurable:!0,get:()=>null,set:e=>{"function"==typeof e&&queueMicrotask(()=>{try{e.call(window,new Event("load"))}catch(e){console.error(e)}})}}),e.push(()=>{n?Object.defineProperty(window,"onload",n):delete window.onload}),()=>{for(let t of e)t()}}();for(let e of d){let t=document.createElement("script");for(let n of Array.from(e.attributes))t.setAttribute(n.name,n.value);e.src?t.async=!1:t.textContent=e.textContent,s.appendChild(t)}return new Dn(s,p,l,f,v,y)}dispose(){this.removeLateLifecycleShim(),this.host.dispose(),this.observer.disconnect(),this.container.remove(),window.spline===this.spline&&(window.spline=this.previousSplineGlobal)}};function Ln(e){return"object"==typeof e&&null!==e&&!0===e.isMaterial}function Vn(e){if("function"==typeof e.material)throw new Error("createObject: a (three) => material factory must be resolved to a material instance before object creation — this entry point does not support it.");if(!Ln(e.material))return{options:e};let t=e.material;if(!0===t.isNodeMaterial){let n=G()?.NodeMaterial;if(void 0!==n&&t instanceof n)return{options:{...e,material:void 0},material:t};throw new Error("createObject: this TSL NodeMaterial comes from your own three/webgpu module instance, which cannot compile in the runtime's bundled three. Build it with app.createCustomMaterial((three) => …) instead, or use a built-in material (MeshStandardMaterial, MeshBasicMaterial, …).")}if(!0===t.isShaderMaterial)throw new Error("createObject: a GLSL ShaderMaterial cannot compile on the WebGPU backend — port the shader to TSL with app.createCustomMaterial((three) => …), or use a built-in material (MeshStandardMaterial, …).");return{options:{...e,material:void 0},material:t}}var In=new Set(["name","parent","position","rotation","scale","visible","castShadow","receiveShadow","color","material"]),Gn="'Cube', 'Sphere', 'Plane', 'Rectangle', 'Ellipse', 'Triangle', 'Polygon', 'Star', 'Cone', 'Cylinder', 'Pyramid', 'Torus', 'TorusKnot', 'Dodecahedron', 'Icosahedron', 'Helix', 'Backdrop', 'Lathe', 'Text', 'CustomMesh', 'Group', 'PointLight', 'SpotLight', 'DirectionalLight'",Bn={cube:"CubeGeometry",box:"CubeGeometry",sphere:"SphereGeometry",plane:"PlaneGeometry",rectangle:"RectangleGeometry",ellipse:"EllipseGeometry",circle:"EllipseGeometry",triangle:"TriangleGeometry",polygon:"PolygonGeometry",star:"StarGeometry",cone:"ConeGeometry",cylinder:"CylinderGeometry",pyramid:"PyramidGeometry",torus:"TorusGeometry",torusknot:"TorusKnotGeometry",dodecahedron:"DodecahedronGeometry",icosahedron:"IcosahedronGeometry",helix:"HelixGeometry",backdrop:"BackdropGeometry",lathe:"LatheGeometry",text:"TextGeometry",custommesh:"NonParametricGeometry",nonparametric:"NonParametricGeometry"},Un={group:"Empty",empty:"Empty",pointlight:"PointLight",spotlight:"SpotLight",directionallight:"DirectionalLight"},Nn={shapeblend:"Shape Blends are built from member meshes in the editor and cannot be created empty.",path:"Path shapes need authored path data — clone an existing one with cloneObject() instead.",vector:"Vector shapes need authored shape data — clone an existing one with cloneObject() instead.",shape:"Vector shapes need authored shape data — clone an existing one with cloneObject() instead.",boolean:"Boolean operations are not creatable at runtime — clone an existing Boolean object with cloneObject() instead.",decal:"Decals need a surface to project onto — clone an existing Decal with cloneObject() instead.",ui:"UI objects need a 2D frame — clone an existing one with cloneObject() instead.",input:"Text inputs are not creatable at runtime — clone an existing one with cloneObject() instead.",particle:"Particle emitters are not creatable at runtime — clone an existing one with cloneObject() instead.",particlecollider:"Particle forces are not creatable at runtime — clone an existing one with cloneObject() instead.",hair:"Hair systems are not creatable at runtime — clone an existing one with cloneObject() instead.",camera:"Cameras are not creatable at runtime.",perspectivecamera:"Cameras are not creatable at runtime.",orthographiccamera:"Cameras are not creatable at runtime.",hemispherelight:"Hemisphere lights are not creatable at runtime.",splat:"Splats are not creatable at runtime.",page:"Pages are not creatable at runtime.",component:"Components are authored in the editor.",instance:"Instances are authored in the editor — clone an existing one with cloneObject() instead.",bone:"Bones are not creatable at runtime.",mesh:"pass the shape name directly, e.g. createObject('Cube')."},Kn={CubeGeometry:"Cube",SphereGeometry:"Sphere",PlaneGeometry:"Plane",RectangleGeometry:"Rectangle",EllipseGeometry:"Ellipse",TriangleGeometry:"Triangle",PolygonGeometry:"Pentagon",StarGeometry:"Star",ConeGeometry:"Cone",CylinderGeometry:"Cylinder",PyramidGeometry:"Pyramid",TorusGeometry:"Torus",TorusKnotGeometry:"Torus Knot",DodecahedronGeometry:"Dodecahedron",IcosahedronGeometry:"Icosahedron",HelixGeometry:"Helix",BackdropGeometry:"Backdrop",LatheGeometry:"Lathe",TextGeometry:"Text",NonParametricGeometry:"Custom Mesh"},Wn={Empty:"Group",PointLight:"Point Light",SpotLight:"Spot Light",DirectionalLight:"Directional Light"};function zn(e,t){return void 0===e?[t[0],t[1],t[2]]:Array.isArray(e)?[e[0]??t[0],e[1]??t[1],e[2]??t[2]]:[e.x??t[0],e.y??t[1],e.z??t[2]]}function Hn(e){return"number"==typeof e?[e,e,e]:zn(e,[1,1,1])}function Fn(e){let t=new K(0,0,0,1);return t.setStyle(e),{r:t.r,g:t.g,b:t.b}}function $n(e,t){let n=e.material??(void 0!==e.color?{color:e.color}:void 0);if(void 0===n)return Se.defaultColorMaterial(qn(Ue),"physical","layer1","layer2");if("string"==typeof n){for(let[e,r]of Object.entries(t.shared.materials))if(e===n||r.name===n)return e;if(function(e){let t=e.trim().toLowerCase();return/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)||/^(rgb|hsl)a?\(/.test(t)||void 0!==Je.NAMES[t]}(n))return Se.defaultColorMaterial(Fn(n),"physical","layer1","layer2");throw new Error(`createObject: material '${n}' matches no shared material in this document (available: ${function(e){let t=Object.entries(e.shared.materials).map(([,e])=>`'${e.name}'`).filter(e=>"'undefined'"!==e);return t.length?t.join(", "):"(none)"}(t)}) and is not a valid CSS color.`)}if("function"==typeof n)throw new Error("createObject: a (three) => material factory must be resolved to a material instance before object creation — this entry point does not support it.");if(Ln(n))throw new Error("createObject: a three.js material instance cannot be stored in the document — this entry point does not support it.");let r=void 0!==n.color?Fn(n.color):qn(Ue),i=Se.defaultColorMaterial(r,"physical","layer1","layer2"),s=i.layers.find(e=>"light"===e.data.type);if(s){let e={};void 0!==n.roughness&&(e.roughness=n.roughness),void 0!==n.metalness&&(e.metalness=n.metalness),void 0!==n.reflectivity&&(e.reflectivity=n.reflectivity),Object.assign(s.data,e)}if(void 0!==n.alpha){let e=i.layers.find(e=>"color"===e.data.type);e&&Object.assign(e.data,{alpha:n.alpha})}return i}function qn(e){return{r:(e>>16&255)/255,g:(e>>8&255)/255,b:(255&e)/255}}function Xn(e){let t=Ve.defaultData("TextGeometry"),{text:n,...r}=e,i=r.fontSize;return void 0!==i&&void 0===r.width&&(r.width=350*i/16),void 0!==i&&void 0===r.height&&(r.height=50*i/16),Object.assign(t,r),void 0!==n&&Object.assign(t,{text:{textValue:String(n)}}),t}function Yn(e){return Array.isArray(e)?e:!ArrayBuffer.isView(e)||e instanceof DataView?null:Array.from(e)}function Zn(e,t){return qt({userData:{type:e,...L[e].normalizeInputs({parameters:t})}})}function Jn(e,t,n){let{objectType:r,geometryType:i}=e,s=function(e){let t={};for(let[n,r]of Object.entries(e))!In.has(n)&&void 0!==r&&(t[n]=r);return t}(t),a={states:new ke,events:new ke};if("Mesh"===r&&i){if("NonParametricGeometry"===i){let{geometry:e,doubleSide:r}=function(e){let t=Yn(e.vertices);if(!t||t.length<9||t.length%3!=0)throw new Error("createObject('CustomMesh'): `vertices` must be a flat number[] of x,y,z triples (length a multiple of 3, at least one triangle).");let n=t.length/3;if(n>6e4)throw new Error(`createObject('CustomMesh'): too many vertices (${n}); keep it under 60000.`);let r=Yn(e.indices);if(r&&r.length){let e=r.find(e=>!Number.isInteger(e)||e<0||e>=n);if(void 0!==e)throw new Error(`createObject('CustomMesh'): index ${e} is out of range (mesh has ${n} vertices).`)}else r=null;let i=new tt;i.setAttribute("position",new et(t,3));let s=Yn(e.normals),a=null!==s&&s.length===t.length;a&&i.setAttribute("normal",new et(s,3));let o=Yn(e.uvs);o&&o.length===2*n&&i.setAttribute("uv",new et(o,2));let l=!1;if(!a){let e=r??Array.from({length:n},(e,t)=>t),{closed:i,inverted:s}=function(e,t){let n=e.length/3,r=new Map,i=new Array(n);for(let t=0;t<n;t++){let n=`${Math.round(1e4*e[3*t])},${Math.round(1e4*e[3*t+1])},${Math.round(1e4*e[3*t+2])}`,s=r.get(n);void 0===s?(r.set(n,t),i[t]=t):i[t]=s}let s=new Map;for(let e=0;e+2<t.length;e+=3){let n=i[t[e]],r=i[t[e+1]],a=i[t[e+2]];for(let[e,t]of[[n,r],[r,a],[a,n]]){if(e===t)continue;let n=e<t?e+"_"+t:t+"_"+e;s.set(n,(s.get(n)??0)+1)}}let a=s.size>0;for(let e of s.values())if(2!==e){a=!1;break}if(!a)return{closed:!1,inverted:!1};let o=0;for(let n=0;n+2<t.length;n+=3){let r=3*t[n],i=3*t[n+1],s=3*t[n+2],a=e[r],l=e[r+1],c=e[r+2],h=e[i],d=e[i+1],u=e[i+2],p=e[s],m=e[s+1],f=e[s+2];o+=a*(d*f-u*m)+l*(u*p-h*f)+c*(h*m-d*p)}return{closed:!0,inverted:o<0}}(t,e);if(i&&s){for(let t=0;t+2<e.length;t+=3){let n=e[t+1];e[t+1]=e[t+2],e[t+2]=n}r=e}else i||(l=!0)}return r&&i.setIndex(r),a||i.computeVertexNormals(),{geometry:qt({userData:{type:"NonParametricGeometry",parameters:{subdivisions:0}},data:i.toJSON().data}),doubleSide:l}}(s);Object.assign(a,Ne.defaultData,{geometry:e,materials:[$n(t,n)]}),r&&(a.side=2)}else Object.assign(a,Ne.defaultData,{geometry:"TextGeometry"===i?Xn(s):Zn(i,s),material:$n(t,n)});void 0!==t.castShadow&&(a.castShadow=t.castShadow),void 0!==t.receiveShadow&&(a.receiveShadow=t.receiveShadow)}else"Empty"===r?Object.assign(a,Be.defaultData):(Object.assign(a,We.defaultData(r),s),void 0!==t.color&&(a.color=Fn(t.color)));a.visible=t.visible??!0,a.position=zn(t.position,[0,0,0]),a.rotation=zn(t.rotation,[0,0,0]),a.scale=Hn(t.scale);let o=(i&&Kn[i])??Wn[r]??r;return a.name=t.name??Qn(o,n.scene.objects),a}function Qn(e,t){let n=new Set;if(t.traverse((e,t)=>{n.add(t.name??"")}),!n.has(e))return e;let r=2;for(;n.has(`${e} ${r}`);)r++;return`${e} ${r}`}function er(e,t){let n=Fe.generateUUID();if("Component"===e.data.type)return{data:{...me.fromComponentData(e),name:e.data.name+" Instance"},id:n,fi:e.fi,children:[]};t[e.id]=n;let r=e.data;return"Empty"===r.type&&r.animations?.length&&(r={...r,animations:r.animations.map(([e,t,n])=>{let r=Fe.generateUUID(),i=n.indexOf(e);return[r,t,-1!==i?n.slice(0,i)+r+n.slice(i+e.length):n]})}),{...e,id:n,data:r,children:e.children.map(e=>er(e,t))}}function tr(e){let t={},n=er(e,t);return Te(n,t)}function nr(e){let t=Array.isArray(e)?e[0]:e,n=t.layers?.map(rr)??[],r=t.layers?.find(e=>"light"===e.type);return{layers:n,alpha:r?.node.alphaOverride?.value??1}}function rr(e){return"texture"===e.type||"video"===e.type||"matcap"===e.type?{...e.data,updateTexture:t=>e.color.texture.image.updateSrc(t)}:{...e.data}}var ir=new K(0,0,0,1),sr={color:["color"],cavity:[],dust:["color"],fresnel:["color"],normal:[],gradient:["colors"],depth:["colors"],texture:[],video:[],noise:["colorA","colorB","colorC","colorD"],toon:["colors","shadowColor"],outline:["outlineColor","contourColor"],transmission:["attenuationColor"],reflection:[],matcap:[],pattern:["colorA","colorB"],vertexColor:[],light:[],displace:[],rainbow:[],particle:[]},ar=new $e;function or(e){let t=new K(0,0,0,1);try{t.setStyle(e)}catch(e){console.error(e)}return t}var lr=class{constructor(e,{renderOnDemand:t,renderMode:n="auto",wasmPath:r,renderer:i,htmlContentMode:s="sandbox"}={}){if(this._rendererBackend="webgl",this._rendererAuto=!1,this._rendererConfigured=!1,this._startOrder=0,this._claimedOrder=0,this._viewportMode=1,this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._proxyObjectCache=new Map,this._htmlContentMode="sandbox",this._variablesCache=new Map,this._isPaused=!1,this._renderRequested=!1,this._skipRender=!1,this.time=performance.now(),this.dt=0,this.currentTAAFrame=0,this.disposed=!1,this._requestRenderAutoMode=()=>{this._skipRender=!1},this.requestRender=()=>{this._renderRequested=!0},this.render=e=>{if(this.time=e,this._lastTime&&(this.dt=this.time-this._lastTime),this._lastTime=this.time,this._perfs?.start(),this._renderer)if(this._isPaused||!("manual"===this.renderMode&&!this._renderRequested||"auto"===this.renderMode&&this._skipRender)){if(this._renderRequested=!1,this._skipRender=!0,this._controls&&(this._skipRender=this._controls.update(this.dt)??!1),this._eventManager&&(this._eventManager.handlers?.Start?.hasVideoAction||this._eventManager.handlers?.Basic?.hasVideoAction||this._eventManager.handlers?.Conditional?.hasVideoAction)&&(this._skipRender=!1),this._animationControls?.update(this.dt),this._skipRender?(this.currentTAAFrame++,this.currentTAAFrame<U?this._skipRender=!1:this.currentTAAFrame=0):this.currentTAAFrame=0,this._scene?.traverseVisibleEntity(e=>{"ParticleSystem"===e.type&&(e.update(this.dt),this._skipRender=!1),ie(e)&&(!0!==this._renderer?.isWebGPUSplineRenderer&&e.warnClassicFallbackOnce(),e.isSimulating&&(e.update(this.dt),this._skipRender=!1))}),this._scene&&this._scene.activeCamera!==this._camera&&(this._camera=this._scene.activeCamera),this._eventManager?.isEnabled&&(this._eventManager.handlers?.Follow?.onAnimationFrameDamping(),this._eventManager.handlers?.LookAt?.onAnimationFrameDamping(),this._eventManager.handlers?.DragDrop?.onAnimationFrameDamping()),this._scene&&this._camera){if(this._scene.pathConstraints.applyConstraints(this._scene),this._renderer.sceneTransitionTimeRemaining>0){this._renderer.sceneTransitionTimeRemaining-=this.dt;let e=Math.min(1,1-this._renderer.sceneTransitionTimeRemaining/this._renderer.sceneTransitionDuration);this._renderer.pipeline.sceneTransitionPass.uniforms.mixRatio.value=e,this._skipRender=!1}else this._renderer.pipeline.sceneTransitionFromTexture=null;this._renderer.renderSplineScene(this._scene,this._camera),!0===this._renderer.lastFrameIncomplete&&(this._skipRender=!1),!0===this._renderer.skyAnimationActive&&(this._skipRender=!1)}this.canvas.dispatchEvent(this._renderedEvent),this._perfs?.end()}else this._perfs?.end();else this._perfs?.end()},this._resize=e=>{if(this._renderer){if(1===this._viewportMode&&this._frameView&&(this._frameView.frameSize=ar.set(this._viewportWidth,this._viewportHeight)),e){let e=this._viewportWidth,t=this._viewportHeight;this._renderer.setSize(e-1,t-1,!1),this._renderer.setSize(e,t,!1)}else this._renderer.setSize(this._viewportWidth,this._viewportHeight,!1);this._camera=this._scene?.activeCamera,this._scene?.updateViewPlaneSize(this._frameView?.frameSize?.x??this._viewportWidth,this._frameView?.frameSize?.y??this._viewportHeight,this._frameView?.enableResponsive??!1),this._camera&&(this._frameView?.setCamera(this._camera),this._frameView?.updateCamera(),"PerspectiveCamera"===this._camera.cameraType&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()),this.eventManager&&(this.eventManager.eventContext.domRect=this.canvas.getBoundingClientRect()),this._requestRenderAutoMode()}},this._debouncedResize=ne(this._resize,10),this._onScroll=e=>{this.eventManager&&(this.eventManager.eventContext.domRect=this.canvas.getBoundingClientRect())},this.canvas=e,this._htmlContentMode=s,this.renderMode=t?"auto":n,void 0!==r&&(this._wasmPath=re(r,"/")),this._rendererBackend=i??"webgl",void 0===i){let e=null;try{e=new URLSearchParams(window.location.search).get("renderer")}catch{}"webgpu"===e||"webgl"===e||"webgl2"===e?this._rendererBackend="webgl2"===e?"webgl":e:(this._rendererAuto=!0,this._rendererBackend=typeof navigator<"u"&&"gpu"in navigator?"webgpu":"webgl")}this._renderedEvent=new CustomEvent("rendered",{bubbles:!0}),Object.defineProperty(this._renderedEvent,"target",{writable:!1,value:this}),window.location.search.includes("perfs")&&import("./runtime-Perfs-KMJFDYHU.js").then(({Perfs:e})=>{this._perfs=new e({x:10,y:10})}),O(e)}async _ensureRenderer(){return this._renderer?this._renderer:(this._rendererInit||(this._rendererInit=this._initRenderer().then(e=>(this._rendererInit=void 0,e&&(this._renderer=e),e),e=>{throw this._rendererInit=void 0,e})),this._rendererInit)}async _initRenderer(){if(this.disposed)return null;let e=await this._createRenderer();return this.disposed?(this._disposeRenderer(e),null):e}_disposeRenderer(e){let t=function(e){let t=e.backend;if(void 0!==t)return!0===t.isWebGLBackend?t.gl??null:null;let n=e.getContext,r="function"==typeof n?n.call(e):null;return r&&"function"==typeof r.getExtension?r:null}(e);if(t&&!function(e,t){return Pn.get(e)===t}(this.canvas,this))return n=e,void(!0===n.backend?.isWebGLBackend||e.dispose());var n;let r=t?function(e,t){let n=t.getExtension("WEBGL_lose_context");if(!n||t.isContextLost())return()=>{};let r=()=>{},i=new Promise(t=>{r=Mn(e,"webglcontextlost",e=>{e.preventDefault(),t(n)})});return jn.set(e,{gl:t,lost:i,stopListening:r}),()=>{t.isContextLost()||n.loseContext()}}(this.canvas,t):void 0;try{e.dispose()}finally{r?.()}}async _createRenderer(){if(e=this.canvas,t=this,Pn.set(e,this),await async function(e){let t=jn.get(e);if(t&&(t.restoring??(t.restoring=async function(e,t){if(!t.gl.isContextLost())return void t.stopListening();let n,r=()=>{},i=t.lost.then(t=>new Promise(n=>{r=Mn(e,"webglcontextrestored",()=>n()),t.restoreContext()})),s=new Promise(e=>{n=setTimeout(e,2e3)});await Promise.race([i,s]),clearTimeout(n),r(),t.stopListening()}(e,t).finally(()=>{t.restoring=void 0,!t.gl.isContextLost()&&jn.get(e)===t&&jn.delete(e)})),await t.restoring,t.gl.isContextLost()))throw new Error("[spline] The browser did not restore the WebGL context this canvas had before dispose(); the scene cannot render on it. Use a new canvas.")}(this.canvas),"webgpu"===this._rendererBackend&&this._rendererAuto)try{await(navigator.gpu?.requestAdapter())||(this._rendererBackend="webgl")}catch{this._rendererBackend="webgl"}var e,t;if("webgpu"===this._rendererBackend)try{let{createWebGPUSplineRenderer:e,isWebGPUSupported:t}=await import("./runtime-webgpu-CBYAHAHI.js");t();let n=!0,r=!1;try{let e=new URLSearchParams(window.location.search),t=e.get("bundles");"rerecord"===t?n="rerecord":("off"===t||"0"===t||"false"===t||"no"===t)&&(n=!1),r="1"===e.get("forcegl")}catch{}let i=await e({canvas:this.canvas,antialias:!1,alpha:!0,powerPreference:"high-performance",sceneBundles:!r&&n,forceWebGL:r,asyncCompilation:this._asyncShaderCompilation()});return i.onBackgroundWorkReady=()=>{this._skipRender=!1,this._renderRequested=!0},i.skyAnimationAllowed=!0,i}catch(t){console.error("[spline] Failed to initialize the WebGPU renderer, falling back to WebGL:",t),this._rendererBackend="webgl"}{let{SplineRenderer:e,rendererGlobals:t}=await import("./runtime-classicRuntime-OKLTCERD.js");try{"off"===new URLSearchParams(window.location.search).get("taa")&&(t.taaEnabled.value=!1)}catch{}return new e({canvas:this.canvas,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"})}}_asyncShaderCompilation(){let e=!1!==this._data?.scene.publish?.asyncShaderCompilation;try{let t=new URLSearchParams(window.location.search);if("1"===t.get("forcegl"))return!1;let n=t.get("asynccomp");"off"===n||"0"===n||"false"===n||"no"===n?e=!1:("on"===n||"1"===n||"true"===n||"always"===n)&&(e=!0)}catch{}return e}_failWebGPURequired(){console.error('[spline] This scene was exported for WebGPU only and this browser does not provide a WebGPU adapter. Re-export with renderer "Both" or "WebGL 2" to support this browser.');try{let e=window.devicePixelRatio||1,t=this.canvas.clientWidth||300,n=this.canvas.clientHeight||150;this.canvas.width=t*e,this.canvas.height=n*e;let r=this.canvas.getContext("2d");r&&(r.scale(e,e),r.fillStyle="rgba(127, 127, 127, 0.85)",r.font="13px system-ui, -apple-system, Segoe UI, Roboto, sans-serif",r.textAlign="center",r.textBaseline="middle",r.fillText("This scene requires a WebGPU-capable browser.",t/2,n/2))}catch{}this.canvas.dispatchEvent(new CustomEvent("splineerror",{bubbles:!0,detail:{reason:"webgpu-required"}}))}async load(e,t,n){(function(e){let t="The Spline Runtime only accepts .splinecode files that are generated from Spline export panel.";e.endsWith(".spline")?console.warn(t+" The .spline files are only meant to be used by the Editor."):e.endsWith(".splinecode")||console.warn(t)})(e),this.disposed=!1;let r=await(await fetch(e,n)).arrayBuffer();await this.start(r,{variables:t})}async start(e,t={}){if(this.disposed)return;let n,r=++this._startOrder,i=()=>this._claimedOrder>r;return n=this._start(e,t,i,()=>!i()&&(this._claimedOrder=r,this._claimedStart=n,!0)).then(()=>i()?this._claimedStart:void 0,e=>{if(!i())throw e;return this._claimedStart}),n}async _start(t,{interactive:n=!0,variables:r},a,l){p.init();let c=await async function(e){let[t,n]=Le(Ie.deserialize(new Uint8Array(e)));if(133!==(t.schema??0)){let{updateDocumentSchema:e}=await import("./runtime-updater-RCOMZLTB.js");e(t)}return n.result().data}(t);if(a())return;let h=function(e){let t=[];return e.scene.objects.traverse((e,n)=>{"Mesh"===n.type&&"NonParametricGeometry"===n.geometry.type&&void 0!==n.geometry.data.draco&&t.push(n)}),t}(c);c.version&&(0,Cn.default)(c.version,"2.0.92")>0&&console.warn("Your .splinecode file is more recent than the library. Please upgrade @splinetool/runtime to the latest version."),void 0!==this._wasmPath&&(this.setUIWasmUrl(`${this._wasmPath}/hana-ui.wasm`),ze(this._wasmPath));let d=async function(e){{let t={particles:()=>import("./runtime-particles-CHBC6DAR.js"),hair:()=>import("./runtime-hair-ZA7YFZ6E.js"),"shape-blends":()=>import("./runtime-shapeBlends-OPZDOAMP.js"),"vector-shapes":()=>import("./runtime-vectorShapes-2N52XZYF.js"),"3d-paths":()=>import("./runtime-paths-PVIXWENH.js"),cloners:()=>import("./runtime-cloners-W6DM7SHL.js"),components:()=>import("./runtime-components-64WWNUFT.js"),text:()=>import("./runtime-text-NV4Q5BBQ.js"),"ui-2d":()=>import("./runtime-ui2d-OV6PGPLG.js"),"game-controls":()=>import("./runtime-gameControls-TZIFAJNU.js"),"collision-bvh":()=>import("./runtime-collisionBVH-CQUE6RZV.js"),mousehover:()=>import("./runtime-mouseHover-GER5PBUZ.js"),scroll:()=>import("./runtime-scroll-XEQZHHLW.js"),dragdrop:()=>import("./runtime-dragDrop-YPF34K77.js"),tracking:()=>import("./runtime-tracking-M7CHXAE5.js"),resize:()=>import("./runtime-resize-BXJTXBND.js"),conditional:()=>import("./runtime-conditional-SK6JLPTN.js"),variables:()=>import("./runtime-variables-DJUQPZDB.js"),"api-services":()=>import("./runtime-apiServices-J4QEEJ2S.js"),"ai-assistant":()=>import("./runtime-aiAssistant-5ECVEZLI.js"),textinputs:()=>import("./runtime-textInputs-COZOCG5V.js"),audio:()=>import("./runtime-audio-P56XBVSL.js"),video:()=>import("./runtime-video-U5RS7HHJ.js"),"create-destroy":()=>import("./runtime-createDestroy-TRMSN4GV.js"),"scene-transition":()=>import("./runtime-sceneTransition-M7OWS6T4.js"),timeline:()=>import("./runtime-timeline-MPAYKXWO.js"),transitions:()=>import("./runtime-transitions-OBLPSHIH.js"),"misc-actions":()=>import("./runtime-miscActions-MOVRBNCH.js")},n=function(e){let t=new Set,n=!1,r=!1;for(let i of J(e,e=>{"GameControl"===e&&(n=!0),"Trigger"===e&&(r=!0)}))t.add(i);try{e.scene.objects.traverse((e,n)=>{hn(n,t)});let n=e.shared.lib?.components;if(n){let e=Object.keys(n);e.length>0&&t.add("components");for(let r of e)dn(n[r]?.asset,t)}}catch{for(let e of cn)t.add(e)}return n&&t.add("game-controls"),(r||t.has("game-controls"))&&t.add("collision-bvh"),t}(e);await Promise.all([...n].map(e=>t[e]()))}}(c);if(await Promise.all([d,h.length&&vn(this._wasmPath),S(c)&&te(this._wasmPath),q(c)&&$(this._wasmPath),T(c)&&D(this._wasmPath),ve.physicsEnabled(c.scene.objects)&&E(this._wasmPath),F(c)&&b(),i(c)&&s(),Y(c)&&X(),g(c)&&d.then(()=>ue()?.loadHanaUIRUNTIME()),_(c)&&M(this._wasmPath)].filter(Boolean)),a()||h.length&&(await bn(h),a())||!l())return;this._data=c,this._eventManager?.deactivate(),this._controls?.deactivate(),this._scene?.dispose();let m=c.scene.publish.renderer;if(this._rendererAuto&&"webgl"===m)this._rendererBackend="webgl";else if(this._rendererAuto&&"webgpu"===m){let e="webgpu"===this._rendererBackend&&await(navigator.gpu?.requestAdapter().catch(()=>null));if(a())return;if(!e)return void this._failWebGPURequired();this._rendererAuto=!1}let f=function(e){let t=new Set;return e.scene.objects.traverse((e,n)=>{if("Page"!==n.type)return;let r=n.postprocessing;if(r&&"object"==typeof r&&!0===r.enabled)for(let[e,n]of Object.entries(r))"enabled"!==e&&n&&"object"==typeof n&&!0===n.enabled&&t.add(e)}),[...t]}(c);if("webgpu"===this._rendererBackend)try{await Promise.all([import("./runtime-webgpu-CBYAHAHI.js"),(v=f,En(v,wn,"webgpu"))]);let e=await this._ensureRenderer();if(a()||!e)return}catch(e){console.error("[spline] Failed to load the WebGPU material backend, using WebGL:",e),this._rendererBackend="webgl"}var v;if("webgpu"!==this._rendererBackend&&(await Promise.all([import("./runtime-classicRuntime-OKLTCERD.js"),_n(f)]),a()))return;V("webgpu"===this._rendererBackend?"webgpu":"webgl");let y=new mn(c);if(y.resetPersonalCameraFromDocumentData(),this._scene=y.scene,this._sharedAssetsManager=y.sharedAssets,this._camera=this._scene.activeCamera,window.location.search.includes("merge-geometries")){let{mergeStaticGeometries:e}=await import("./runtime-mergeStaticGeometries-Y65NWJFJ.js");if(a())return;let t=performance.now();e(c,y.scene);let n=performance.now();console.log("Merged geometries in ",n-t," ms")}S(c)&&this._scene.traverse(e=>{R(e)&&e.recomputeBoolean()}),this._sharedAssetsManager.setRequestRender(()=>{this._requestRenderAutoMode(),this._scene?.traverse(e=>{le(e)&&e.pendingMediaLoad&&e.update({scene:this._scene,shared:this._sharedAssetsManager})})}),this._scene?.traverse(e=>{"ParticleSystem"===e.type&&(e.wakeUp(),e.data.autoPlay?e.start():e.stop()),ie(e)&&e.setPlayMode(!0)});let w=Object.keys(c.shared.fonts).flatMap(e=>{let t=this._sharedAssetsManager.getFont(e);return t?[t.loadingPromise]:[]});if(Promise.all(w).then(()=>{this.disposed||(y.scene.markNeedsUpdateRendererDirty(),this._requestRenderAutoMode())}),F(c)&&j(c)&&(await Promise.all(w),a()))return;if(g(c)){let e=[];if(this._scene.traverseEntity(t=>{(oe(t)||t instanceof x)&&t.uiCanvas&&e.push(t.uiCanvas)}),await Promise.all(e.map(e=>e.promise)),a())return}this._scene.rewriteEventsBeforeGoToPlayMode(),o(this._scene.activePage,this._sharedAssetsManager);let C=await this._ensureRenderer();if(a()||!C)return;if(this._rendererConfigured||(this._rendererConfigured=!0,C.pipeline.enableUIOverlay(),C.pipeline.addEventListener("smaaloaded",this._requestRenderAutoMode)),C.hdTransmission=!0===c.scene.publish.hdTransmission,C.setPixelRatio(this._getPixelRatio(/Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?c.scene.publish.settings.web.pixelRatioMobile:c.scene.publish.settings.web.pixelRatioDesktop)),C.setAsyncCompilationPolicy?.(this._asyncShaderCompilation()),c.shared.images.SplineWatermark){let e=this._sharedAssetsManager.getImage("SplineWatermark");if(await e.loadPromise,a())return;let t=e.getTexture(1001);C.pipeline.setWatermark(t)}else C.pipeline.setWatermark(null);i(c)&&this._scene.initializeSplatViewer(),void 0!==c.scene.blueNoiseTextureData&&C.pipeline.updateBlueNoiseTexture(c.scene.blueNoiseTextureData);let O=Object.values(c.frames)[0];if(this._frameView?this._frameView.setCamera(this._camera):("fullscreen"===O.preset?(this._viewportMode=1,this.canvas.style.display="block",this.canvas.parentElement&&(this._viewportWidth=this.canvas.parentElement.clientWidth||300,this.canvas.style.width="100%"),this.canvas.parentElement&&(this._viewportHeight=this.canvas.parentElement.clientHeight||150,this.canvas.style.height="100%")):(this._viewportMode=2,this._viewportWidth=O.size[0],this._viewportHeight=O.size[1],this.canvas.style.width=`${this._viewportWidth}px`,this.canvas.style.height=`${this._viewportHeight}px`),C.setSize(this._viewportWidth,this._viewportHeight,!1),this._frameView=new ln(C,this._camera,new $e(this._viewportWidth,this._viewportHeight)),this._frameView.enableResponsive=(O.allowResponsive??!1)&&"fullscreen"===O.preset),n){let t=new u(C,this.data.scene.publish,this._scene,()=>this._scene.activeCamera,this._sharedAssetsManager,this._requestRenderAutoMode,!0,O);this._scene.updateMatrixWorld(!0),this._controls=new P(t),this._animationControls=new e(this._scene,this._requestRenderAutoMode),this._eventManager=new on(c.scene.publish,this._controls,this._animationControls,t,c.shared.variables),this._eventManager.activate(),this._controls.activate(this._eventManager)}this._resize(),this._scene.activePage.data.postprocessing.depthOfField.enabled&&Promise.all(this._sharedAssetsManager.getImageLoadPromises()).then(()=>{this.disposed||this._resize(!0)}),void 0!==r&&this.setVariables(r),0===this.dt&&(this.render(performance.now()),setTimeout(()=>{this._renderer?.setAnimationLoop(this.render)},0)),this._resizeObserverTimeout=setTimeout(()=>{!this._resizeObserver&&this.canvas.parentElement&&(this._resizeObserver=new ResizeObserver(()=>{this._viewportWidth=this.canvas.clientWidth,this._viewportHeight=this.canvas.clientHeight,this._debouncedResize()}),this._resizeObserver.observe(this.canvas.parentElement))},300),document.addEventListener("scroll",this._onScroll),n&&(this._htmlContentOverlay?.dispose(),this._htmlContentOverlay=void 0);let A=c.scene.publish.htmlContent?.html;if(n&&A&&"none"!==this._htmlContentMode){let e={shared:this._sharedAssetsManager,findEntity:e=>this._scene?.getObjectByProperty("uuid",e)??this._scene?.getObjectByName(e),getAnimationControls:()=>this._animationControls};this._htmlContentOverlay=("inline"===this._htmlContentMode?Dn.mount(this,this.canvas,A,e):kn.mount(this,this.canvas,A,e))??void 0}}setVariables(e){if(void 0!==this._data){let t=Object.entries(e);for(let[e,n]of t)this.setVariable(e,n)}}setVariable(e,t){let n=this._getVariableByName(e);if(n&&!("dynamicVariableType"in n.data)){if(null==t)return void console.warn(`Variable ${e} was not updated: received ${t}. Pass a number, boolean or string.`);let r=t;if("number"==typeof n.data.value){if(r="number"==typeof t?t:"boolean"==typeof t?!0===t?1:0:parseFloat(t),!Number.isFinite(r))return void console.warn(`Variable ${e} is a number variable and ${JSON.stringify(t)} cannot be converted to a number. The variable was not updated.`)}else"boolean"==typeof n.data.value?r="number"==typeof t?!!t:"boolean"==typeof t?t:"false"!==t.toLocaleLowerCase()&&!!t:"string"!=typeof n.data.value&&void 0!==n.data.value.textValue&&(r=t.toString());let i="string"==typeof r?{textValue:r}:r;this._sharedAssetsManager?.updateVariable(n.id,i),this.requestRender(),this._requestRenderAutoMode()}else void 0===n?console.warn(`No variable named ${e} was found in your Spline file. Make sure to create it from Spline editor.`):"dynamicVariableType"in n.data&&console.warn(`Dynamic variables like ${e} cannot be updated from code.`)}getVariables(){let e={};return this._data&&this._data.shared.variables.forEach(t=>{void 0===e[t.data.name]&&(e[t.data.name]=this._getVariableValue(this._sharedAssetsManager.getVariable(t.id)))}),e}getVariable(e){let t=this._getVariableByName(e);if(t){let e=this._sharedAssetsManager.getVariable(t.id);return this._getVariableValue(e)}}_getVariableValue(e){return"string"!=typeof e&&ge.isTextValue(e)?ge.getDisplayedValue(e):e}_getVariableByName(e){if(this._data){if(this._variablesCache.has(e))return this._variablesCache.get(e);let t=this._data.shared.variables.find(t=>t.data.name===e);return t&&this._variablesCache.set(e,t),t}}_getPixelRatio(e){switch(e){case 0:return window.devicePixelRatio;case 1:return 1;case 2:return 2}}findObjectById(e){let t=this._scene?.getObjectByProperty("uuid",e);return this._createProxyObject(t)}findObjectByName(e){let t=this._scene?.getObjectByName(e);return this._createProxyObject(t)}getAllObjects(){let e=[];return this._scene?.traverseEntity(t=>{if(!(t.uuid===Ge||this._scene.isInvisibleObjects(t)||t instanceof x)){let n=this._createProxyObject(t);n&&e.push(n)}}),e}getSplineEvents(){return(this._eventManager?.handlers?.Spline).splineEvents}emitEvent(e,t){(this.findObjectById(t)||this.findObjectByName(t))?.emitEvent(e)}emitEventReverse(e,t){(this.findObjectById(t)||this.findObjectByName(t))?.emitEventReverse(e)}addEventListener(e,t){this.canvas.addEventListener(e,t)}removeEventListener(e,t){this.canvas.removeEventListener(e,t)}setZoom(e){this._controls?.orbitControls instanceof w&&this._controls?.orbitControls.setZoom(e)}get eventManager(){return this._eventManager}get controls(){return this._controls}setSize(e,t){this._viewportWidth=e,this._viewportHeight=t,this._viewportMode=2,this._resize()}setBackgroundColor(e){let t=or(e);this._scene?.activePage.setBackgroundColor(t),this._requestRenderAutoMode()}dispose(){this.disposed=!0,this._claimedOrder=++this._startOrder,this._claimedStart=void 0,this._htmlContentOverlay?.dispose(),this._htmlContentOverlay=void 0,this._eventManager?.dispose(),this._scene?.dispose(),this._scene=void 0,this._camera=void 0,H(),this._sharedAssetsManager?.setRequestRender(()=>{}),this._sharedAssetsManager?.dispose(),this._sharedAssetsManager=void 0,this._proxyObjectCache.forEach(e=>{Ut.unsubscribe(e)}),this._proxyObjectCache.clear(),this._variablesCache.clear(),this._renderer?.pipeline.removeEventListener("smaaloaded",this._requestRenderAutoMode),this._renderer?.setAnimationLoop(null),this._renderer&&this._disposeRenderer(this._renderer),this._renderer=void 0,this._rendererConfigured=!1,this._debouncedResize.cancel(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0),void 0!==this._resizeObserverTimeout&&(clearTimeout(this._resizeObserverTimeout),this._resizeObserverTimeout=void 0),this.canvas.style.width="",this.canvas.style.height="",this.canvas.removeAttribute("width"),this.canvas.removeAttribute("height"),this._frameView=void 0,this._controls?.deactivate(),this._controls=void 0,this._animationControls=void 0,this._eventManager?.eventContext.dispose(),this._eventManager=void 0,this._splatViewer=void 0,this._data=void 0,this._perfs=void 0,this.dt=0,this._lastTime=void 0,A(this.canvas),document.removeEventListener("scroll",this._onScroll),p.dispose()}get isStopped(){return this._isPaused}stop(){this._isPaused||(this._renderer?.setAnimationLoop(null),this._isPaused=!0,this._eventManager?.pause(),this._controls?.orbitControls&&(this._controls.orbitControls.enabled=!1))}play(){!this._isPaused||(this._isPaused=!1,this._eventManager?.resume(),this._controls?.orbitControls&&(this._controls.orbitControls.enabled=!0),this._renderer?.setAnimationLoop(this.render))}setGlobalEvents(e){this._eventManager?.updateUseWindowEvents(e)}get data(){return this._data}_createProxyObject(e){if(!this._scene)return;let t,i=this._scene;if(null==e)return;if(this._proxyObjectCache.has(e.uuid))return this._proxyObjectCache.get(e.uuid);e.traverseAncestors(e=>{e instanceof x&&(t=e.name)});let s=this._sharedAssetsManager,o={shared:s,scene:this._scene},l=t=>{if(null===t||"Base State"===t)return null;if(t&&e.data.states){let n=e.data.states.find(e=>e.data.name===t);return n?n.id:void 0}},c="material"in e?e.material:void 0,h=e.materialOverride,d={name:e.name,uuid:e.uuid,visible:e.visible,intensity:e.intensity,position:e.position,rotation:e.rotation,scale:e.scale,type:e.data.type,page:t,material:h??(c?nr(c):void 0),parentUuid:e.parent instanceof x||e instanceof a?void 0:e.parent?.uuid,emitEvent(t){e.dispatchEvent({type:"userEvent",eventName:t})},emitEventReverse(t){e.dispatchEvent({type:"userEvent",eventName:t,reverse:!0})},hide(){e.visible&&(e.visible=!1,o.shared.requestRender())},show(){e.visible||(e.visible=!0,o.shared.requestRender())},get state(){let t=e.stateSelection;if(null!==t)return e.data.states.find(({id:e})=>e===t)?.data.name},set state(t){let n;if(void 0!==t){let r="string"==typeof t?e.data.states.find(({id:e})=>e===t):e.data.states[t];if(r)n=r.id;else{let e="string"==typeof t?l(t):void 0;e&&(n=e)}}e.changeSelectedState(n??null,o),e.currentState=n??null,e.dispatchEvent({type:"completeState",state:n??null}),o.shared.requestRender()},transition(t){let a=n();if(null===a)return he("transitions","obj.transition()"),{transition(e){return this},play(){return this},pause(){return this},reset(){return this},seek(e){return this}};let o,c,h=this,d=[],u=!1,m=()=>{c=new r({delay:0,delayDirection:"start-once",direction:"normal",repeat:0,runMode:"Repeat"},d.map(e=>e.runner))},f={update(e){c?.update(e),!0!==c?.isPlaying&&p.remove(f)}},v={transition({from:t,to:n,duration:r,delay:c,...u}){let p=l(t);void 0===p&&(p=o);let f=l(n);return o=f,d.push(new a(e,p,f,{state:f,repeat:0,delay:c??0,delayDirection:"start-once",direction:"normal",duration:r??1e3,...u,...6===u.easing?be.defaultData:5===u.easing?we.defaultData:{}},s,!1,i.activePage,{onBegin:()=>{(t&&p||"Base State"===t&&!p)&&(h.state=p??void 0)},onComplete:()=>{h.state=f??void 0}})),m(),this},play(){return c?(u=!0,c.play(p.time),c.isPlaying&&p.add(f),this):this},pause(){return c?.stop(),p.remove(f),this},reset(){return this.pause(),u=!1,m(),c?.seek(0),this},seek(e){let t=d.reduce((e,t)=>e+t.runner.duration,0);return t>0&&c?.seek(e/1e3/t),this}};return v.transition(t),(t.autoPlay??!0)&&queueMicrotask(()=>{u||v.play()}),v},set color(t){let n=or(t);if(k.is(e))return void(e.color=n);if(!("Mesh"===e.type&&"material"in e&&e instanceof W))return;let r={r:n.r,g:n.g,b:n.b,a:n.a},i=e.materialOverride;if(void 0!==i){let e=i.color;return void(!0===e?.isColor&&"function"==typeof e.setStyle&&(e.setStyle(t),o.shared.requestRender()))}let s=Array.isArray(e.material)?e.material[0]:e.material,a=s.data.layers.find(e=>"color"===e.data.type)?.id;if(a)s.updateByOp({type:0,path:["layers",a],props:{color:{...r}}},s.data,o);else{let e=s.data,t=e.layers.find(e=>"light"===e.data.type);if(!t)return;let n=0===e.layers.indexOf(t)?t:null,i=e.layers.at(n?e.layers.indexOf(n)+1:0),a={type:4,fi:n?n.fi+(i?(i.fi-n.fi)/2:1):i?i.fi/2:1,id:Fe.generateUUID(),data:{...xe.defaultData("color"),color:r},localIndex:0},l=e.layers.insertAfterHelper(n?.id??null,1),c=e.layers.runOp({...a,fi:l[0]}).data;Object.assign(s.data,{layers:c}),s.updateByOp({...a,path:["layers"]},s.data,o)}}},u=Ut(d,(t,n)=>{let r=e[t],i=t.split(".");"material"===i[0]&&c&&void 0===h&&function(e,t,n){let r=Array.isArray(n)?n[0]:n;if("layers"===e[0]){let n=parseInt(e[1]),i=r.layers[n],s=e[2];i&&s&&function(e,t,n){let r=e[0];try{if(function(e,t){return!!sr[t]?.includes(e)}(r,n.type,e.slice(1)))if("colors"===r){if(e.length<2)throw new Error("You cannot mutate the colors array, only its items");let i=parseInt(e[1]),s=n.getValue(r)?.[i];if(!s)throw new Error("Color index out of range");ir.setStyle(t),s.set(ir.r,ir.g,ir.b,ir.a)}else n.getValue(r)?.setStyle(t);else if("texture"===r||"video"===r){let r=n.color;!function(e,t,n,r){let i=e[0];if("repeat"===i||"offset"===i||"rotation"===i){let n=r.getNode("mat"),s=n&&"function"==typeof n.updateMatrix?n:r.getValue("mat");if(!s)return;if("rotation"===i)s.rotation=parseFloat(t);else{let n=e[1];if(void 0===n)t instanceof Array&&2===t.length&&Object.assign(s,{[i]:t});else{let e=s[i],r=0===parseInt(n)?[parseFloat(t),e[1]]:[e[0],parseFloat(t)];Object.assign(s,{[i]:r})}}s.updateMatrix()}else"wrapping"===i||"minFilter"===i||"magFilter"===i?"wrapping"===i?n.texture.wrap=t:n.texture[i]=t:"image"===i&&"data"===e[1]&&n.texture.image.updateSrc(t)}(e.slice(1),t,r,n)}else{let i=e[1],s=n.getValue(r);s?.isVector3&&void 0!==i||s?.isVector2&&void 0!==i?s.setComponent(parseInt(i),t):n.setValue(r,t)}}catch(e){console.error("Error setting material value",e)}}(e.slice(2),t,i)}else"alpha"===e[0]&&r.layers.forEach(e=>{"light"===e.type&&void 0!==e.node.alphaOverride&&(e.node.alphaOverride.value=t,t<1&&(r.transparent=!0))})}(i.slice(1),n,c),"object"!=typeof r&&Object.getOwnPropertyDescriptor(e,t)?.writable&&(e[t]=n),this._requestRenderAutoMode(),e.updateMatrix()});return this._proxyObjectCache.set(e.uuid,u),u}setUIWasmUrl(e){de(e)}pauseGameControls(){this._eventManager?.controlsManager.gameControl?.pause()}resumeGameControls(){this._eventManager?.controlsManager.gameControl?.resume()}async swapGeometry(e,t){let n;if("string"==typeof t){if(!t.endsWith(".splinegeometry"))throw new Error("Only .splinegeometry format is supported");{let e=await(await fetch(t)).arrayBuffer();n=new Uint8Array(e)}}else n=t;let r=Ie.deserialize(n),i="data"in r&&void 0!==r.data.draco;i&&await vn(this._wasmPath);let s=this._scene?.getObjectByProperty("uuid",e)??this._scene?.getObjectByName(e);if(!s)return void console.warn(`Object ${e} not found`);if("Mesh"!==s.data.type||!(s instanceof W))return void console.warn(`Object ${e} is not a mesh`);let a=s,o={...a.data,geometry:r};i&&await bn([o]),a.updateByOp({type:0,path:[],props:{geometry:o.geometry}},o,{shared:this._sharedAssetsManager,scene:this._scene},!1);for(let e of a.data.states){let t={...e.data};a.states||(a.states={}),a.states[e.id]=fe.patch(o,t)}return n}_applyDocumentTransaction(e){this._data=e.data,this._scene&&(this._scene.data=this._data.scene),this._sharedAssetsManager&&(this._sharedAssetsManager.data=this._data.shared);for(let t of e.actual){let e=t.path;Array.isArray(e)&&2===e.length&&"scene"===e[0]&&"objects"===e[1]&&this._scene?.updateTreeByOp({...t,path:[]},this._sharedAssetsManager)}}_findEntity(e){return this._scene?.getObjectByProperty("uuid",e)??this._scene?.getObjectByName(e)}_resolveParentId(e){if(void 0===e)return this._scene.activePage.uuid;let t="string"==typeof e?e:e.uuid,n=this._findEntity(t);if(!n)throw new Error(`parent '${t}' — no object with that name or uuid in the scene.`);return n.uuid}async createCustomMaterial(e){if(this.disposed)throw new Error("createCustomMaterial: this Application was disposed.");if("function"!=typeof e)throw new Error("createCustomMaterial: expected a factory function — createCustomMaterial((three) => new three.MeshStandardNodeMaterial()).");let t=G();if(void 0===t&&("webgpu"===this._rendererBackend&&(await import("./runtime-webgpu-CBYAHAHI.js"),t=G()),void 0===t))throw new Error("createCustomMaterial: requires the webgpu backend (the runtime default where WebGPU is available). This Application is on the classic WebGL pipeline — pass { renderer: 'webgpu' } or drop any ?renderer=webgl2 override.");let n=e(t);if("object"!=typeof n||null===n||!0!==n.isMaterial)throw new Error("createCustomMaterial: the factory must return a three.js material built from the namespace it receives — e.g. (three) => new three.MeshStandardNodeMaterial().");return n}async setMaterial(e,t){if(this.disposed)throw new Error("setMaterial: this Application was disposed.");let n=this._scene;if(!n)throw new Error("setMaterial: no scene loaded — call load() or start() first.");let r="string"==typeof e?e:e.uuid,i=this._findEntity(r);if(!i)throw new Error(`setMaterial: '${r}' — no object with that name or uuid in the scene.`);if(!(i instanceof W))throw new Error(`setMaterial: '${r}' is not a mesh — lights, groups, and cameras have no material.`);let s="function"==typeof t?await this.createCustomMaterial(t):t;if("webgpu"!==I())throw new Error("setMaterial: custom three.js materials require the webgpu backend (the runtime default where WebGPU is available). This scene is running the classic WebGL pipeline — pass { renderer: 'webgpu' } or drop any ?renderer=webgl2 override.");let a=Vn({material:s});if(void 0===a.material)throw new Error("setMaterial: expected a three.js material instance or a (three) => material factory.");return i.setMaterialOverride(a.material,{scene:n,shared:this._sharedAssetsManager}),this._proxyObjectCache.delete(i.uuid),this._requestRenderAutoMode(),a.material}async createObject(e,t={}){if(this.disposed)throw new Error("createObject: this Application was disposed.");let n=this._scene,r=this._data;if(!n||!r)throw new Error("createObject: no scene loaded — call load() or start() first.");let i=function(e){if("string"!=typeof e||0===e.length)throw new Error(`createObject: expected a type name string — one of ${Gn}.`);let t=e.replace(/Geometry$/i,"").replace(/[\s_-]/g,"").toLowerCase(),n=Un[t];if(n)return{objectType:n};let r=Bn[t];if(r)return{objectType:"Mesh",geometryType:r};let i=Nn[t];throw i?new Error(`createObject: '${e}' is not supported — ${i}`):new Error(`createObject: '${e}' is not a creatable Spline type — use one of ${Gn}, e.g. createObject('Cube', { width: 200 }).`)}(e);"function"==typeof t.material&&(t={...t,material:await this.createCustomMaterial(t.material)});let s,a,{options:o,material:l}=Vn(t);if(void 0!==l){if("Mesh"!==i.objectType)throw new Error("createObject: a three.js material instance only applies to mesh types — lights and groups have no material.");if("webgpu"!==I())throw new Error("createObject: three.js material instances require the webgpu backend (the runtime default where WebGPU is available). This scene is running the classic WebGL pipeline — pass { renderer: 'webgpu' } to the Application, or drop any ?renderer=webgl2 override.")}if("TextGeometry"===i.geometryType){if(await import("./runtime-text-NV4Q5BBQ.js"),!ce("text"))throw new Error("createObject: this runtime build was compiled without the 'text' feature — re-export the scene with a Text object present, or load the full runtime build.");if(await b(),a=t.font??Re,void 0===r.shared.fonts[a]){if(a!==Re){let e=Object.keys(r.shared.fonts).join(", ");throw new Error(`createObject: font '${a}' is not in this document — available fonts: ${e||"(none)"}.`)}s={name:Re,url:De}}}let c=this._resolveParentId(t.parent),h=Jn(i,o,r),d=Fe.generateUUID(),[u,p]=Le(r);s&&(u.shared.fonts[Re]=s),u.scene.objects.insertAfter(c,null,[{id:d,data:h,children:[]}]);let m=p.result();if(s&&this._sharedAssetsManager.addFont(Re,s),void 0!==a){let e=this._sharedAssetsManager.getFont(a);e&&await e.loadingPromise}this._applyDocumentTransaction(m);let f=n.find(d);return void 0!==l&&f.setMaterialOverride(l,{scene:n,shared:this._sharedAssetsManager}),this._requestRenderAutoMode(),this._createProxyObject(f)}cloneObject(e,t={}){if(this.disposed)throw new Error("cloneObject: this Application was disposed.");let n=this._scene,r=this._data;if(!n||!r)throw new Error("cloneObject: no scene loaded — call load() or start() first.");let i="string"==typeof e?e:e?.uuid,s=i?this._findEntity(i):void 0;if(!s)throw new Error(`cloneObject: '${i}' — no object with that name or uuid in the scene.`);if(s instanceof x)throw new Error("cloneObject: pages cannot be cloned.");let a=r.scene.objects.get(s.uuid);if(!a)throw new Error(`cloneObject: '${i}' is not part of the document tree (expanded clones and instanced children cannot be cloned — clone their source object instead).`);let o=function(e,t,n){let r={...e.data};return void 0!==t.position&&(r.position=zn(t.position,[0,0,0])),void 0!==t.rotation&&(r.rotation=zn(t.rotation,[0,0,0])),void 0!==t.scale&&(r.scale=Hn(t.scale)),void 0!==t.visible&&(r.visible=t.visible),r.name=t.name??Qn(`${e.data.name??"Object"} Copy`,n),{...e,data:r}}(tr(a),t,r.scene.objects),l=void 0!==t.parent?this._resolveParentId(t.parent):r.scene.objects.parent(s.uuid)??null,c=void 0!==t.parent?null:s.uuid,[h,d]=Le(r);h.scene.objects.insertAfter(l,c,[o]),this._applyDocumentTransaction(d.result());let u=n.find(o.id);return this._requestRenderAutoMode(),this._createProxyObject(u)}removeObject(e){let t=this._scene,n=this._data;if(this.disposed||!t||!n)return!1;let r="string"==typeof e?e:e?.uuid,i=r?this._findEntity(r):void 0;if(!i)return!1;if(i instanceof x)throw new Error("removeObject: pages cannot be removed.");if("PerspectiveCamera"===i.data.type||"OrthographicCamera"===i.data.type)throw new Error("removeObject: cameras cannot be removed.");if(void 0===n.scene.objects.get(i.uuid))throw new Error(`removeObject: '${r}' is not part of the document tree (expanded clones and instanced children cannot be removed individually).`);let s=[];i.traverseEntity(e=>{s.push(e.uuid)});let[a,o]=Le(n);a.scene.objects.delete(i.uuid),this._applyDocumentTransaction(o.result());for(let e of s){let t=this._proxyObjectCache.get(e);t&&(Ut.unsubscribe(t),this._proxyObjectCache.delete(e))}return this._requestRenderAutoMode(),!0}};export{lr as Application,Ke as Axis,ye as Easing,_e as GradientType,Ce as NoiseType,Ae as PatternStyle,Me as ProjectionType,Ee as Side,Pe as TextureFilter,Oe as ToonType,pe as VoronoiStyle,je as Wrapping};
1
+ import{c as e,d as t,f as n,g as r}from"./runtime-chunk-FZVL5H67.js";import{c as i,d as s,f as a}from"./runtime-chunk-E4UNJ4TR.js";import{a as o}from"./runtime-chunk-REXAQKUN.js";import"./runtime-chunk-HD7WF3XN.js";import"./runtime-chunk-DCC352GL.js";import{a as l,b as c,c as h,d,e as u}from"./runtime-chunk-GSKBI4RN.js";import{a as p}from"./runtime-chunk-GGSUJEGZ.js";import"./runtime-chunk-QJMMF3L2.js";import{a as m,b as f}from"./runtime-chunk-NBYTQLIB.js";import{a as v,c as y}from"./runtime-chunk-DZNU62CT.js";import"./runtime-chunk-PF6YNLMZ.js";import{c as b}from"./runtime-chunk-T53JMQSH.js";import{a as g}from"./runtime-chunk-FTVQTRM7.js";import{a as w,b as E,e as _,h as j,j as P,m as M}from"./runtime-chunk-ZJIYRGBK.js";import"./runtime-chunk-N2ZRGNPR.js";import{a as C,d as O,e as x}from"./runtime-chunk-VAVYZ35B.js";import"./runtime-chunk-FQNSP44B.js";import{h as A}from"./runtime-chunk-KJQWLDYH.js";import"./runtime-chunk-RWYT7G6G.js";import{b as S,d as k,g as R}from"./runtime-chunk-AEPWABER.js";import"./runtime-chunk-TU4KDRKR.js";import"./runtime-chunk-JJVEXKEO.js";import{a as T}from"./runtime-chunk-32XVU5DS.js";import"./runtime-chunk-HOOQDTK7.js";import"./runtime-chunk-PWMK5MVJ.js";import"./runtime-chunk-ZFM73G2B.js";import{I as D,M as L,O as V,P as I,W as G,b as U,f as K,ga as B,i as N,ia as W,ja as z,k as F,p as H,y as $,z as q}from"./runtime-chunk-ZA3HZGIR.js";import"./runtime-chunk-4YV3EXSU.js";import{a as Y,b as X}from"./runtime-chunk-NSD7DU3P.js";import{c as Z,d as J,f as Q,g as ee}from"./runtime-chunk-33EF3BLM.js";import{n as te}from"./runtime-chunk-WYIK4MJQ.js";import{a as ne,h as re}from"./runtime-chunk-RTLL6WIB.js";import{b as ie,c as se,e as ae,f as oe,h as le}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-BFGZJ4LR.js";import{b as ce,c as he,k as de,l as ue}from"./runtime-chunk-TZCHGFVF.js";import{$ as pe,Ba as me,Da as fe,Ea as ve,F as ye,G as be,Ga as ge,H as we,T as Ee,W as _e,X as je,Y as Pe,Z as Me,_ as Ce,aa as Oe,ba as xe,da as Ae,ea as Se,f as ke,fa as Re,g as Te,ga as De,l as Le,na as Ve,o as Ie,w as Ge,wa as Ue,x as Ke,xa as Be,y as Ne,za as We}from"./runtime-chunk-F6XTFQMZ.js";import{a as ze}from"./runtime-chunk-IBVB6UVI.js";import{Ec as Fe,Fc as He,Gc as $e,Hc as qe,Qc as Ye,Rc as Xe,Vc as Ze,Zc as Je,bd as Qe,dd as et,fd as tt}from"./runtime-chunk-KPOUV3HD.js";import{a as nt,b as rt}from"./runtime-chunk-ML3Z74BL.js";var it=nt((e,t)=>{t.exports=function(e,t){for(var n=e.split("."),r=t.split("."),i=0;i<3;i++){var s=Number(n[i]),a=Number(r[i]);if(s>a)return 1;if(a>s)return-1;if(!isNaN(s)&&isNaN(a))return 1;if(isNaN(s)&&!isNaN(a))return-1}return 0}}),st=".",at=Symbol("target"),ot=Symbol("unsubscribe");function lt(e){return e instanceof Date||e instanceof Set||e instanceof Map||e instanceof WeakSet||e instanceof WeakMap||ArrayBuffer.isView(e)}var ct=Array.isArray;function ht(e){return"symbol"==typeof e}var dt={after:(e,t)=>ct(e)?e.slice(t.length):""===t?e:e.slice(t.length+1),concat:(e,t)=>ct(e)?(e=[...e],t&&e.push(t),e):t&&void 0!==t.toString?(""!==e&&(e+=st),ht(t)?e+t.toString():e+t):e,initial:e=>{if(ct(e))return e.slice(0,-1);if(""===e)return e;let t=e.lastIndexOf(st);return-1===t?"":e.slice(0,t)},last:e=>{if(ct(e))return e[e.length-1]||"";if(""===e)return e;let t=e.lastIndexOf(st);return-1===t?e:e.slice(t+1)},walk:(e,t)=>{if(ct(e))for(let n of e)t(n);else if(""!==e){let n=0,r=e.indexOf(st);if(-1===r)t(e);else for(;n<e.length;)-1===r&&(r=e.length),t(e.slice(n,r)),n=r+1,r=e.indexOf(st,n)}},get(e,t){return this.walk(t,t=>{e&&(e=e[t])}),e}};function ut(e,t,n){return e.isUnsubscribed||t.ignoreSymbols&&ht(n)||t.ignoreUnderscores&&"_"===n.charAt(0)||"ignoreKeys"in t&&t.ignoreKeys.includes(n)}var pt=class{constructor(e){this._equals=e,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return void 0===this._descriptorCache&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(e){let t=this._getDescriptorCache(),n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n}_getOwnPropertyDescriptor(e,t){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(e,t);let n=this._getProperties(e),r=n[t];return void 0===r&&(r=Reflect.getOwnPropertyDescriptor(e,t),n[t]=r),r}getProxy(e,t,n,r){if(this.isUnsubscribed)return e;let i=e[r],s=i||e;this._pathCache.set(s,t);let a=this._proxyCache.get(s);return void 0===a&&(a=void 0===i?new Proxy(e,n):e,this._proxyCache.set(s,a)),a}getPath(e){return this.isUnsubscribed?void 0:this._pathCache.get(e)}isDetached(e,t){return!Object.is(e,dt.get(t,this.getPath(e)))}defineProperty(e,t,n){return!!Reflect.defineProperty(e,t,n)&&(this.isUnsubscribed||(this._getProperties(e)[t]=n),!0)}setProperty(e,t,n,r,i){if(!this._equals(i,n)||!(t in e)){let i=this._getOwnPropertyDescriptor(e,t);return void 0!==i&&"set"in i?Reflect.set(e,t,n,r):Reflect.set(e,t,n)}return!0}deleteProperty(e,t,n){if(Reflect.deleteProperty(e,t)){if(!this.isUnsubscribed){let r=this._getDescriptorCache().get(e);r&&(delete r[t],this._pathCache.delete(n))}return!0}return!1}isSameDescriptor(e,t,n){let r=this._getOwnPropertyDescriptor(t,n);return void 0!==e&&void 0!==r&&Object.is(e.value,r.value)&&(e.writable||!1)===(r.writable||!1)&&(e.enumerable||!1)===(r.enumerable||!1)&&(e.configurable||!1)===(r.configurable||!1)&&e.get===r.get&&e.set===r.set}isGetInvariant(e,t){let n=this._getOwnPropertyDescriptor(e,t);return void 0!==n&&!0!==n.configurable&&!0!==n.writable}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}};function mt(e){return"[object Object]"===toString.call(e)}function ft(){return!0}function vt(e,t){return e.length!==t.length||e.some((e,n)=>t[n]!==e)}var yt=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),bt=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),gt={push:ft,pop:ft,shift:ft,unshift:ft,copyWithin:vt,reverse:vt,sort:vt,splice:vt,flat:vt,fill:vt},wt=new Set([...yt,...bt,...Object.keys(gt)]);function Et(e,t){if(e.size!==t.size)return!0;for(let n of e)if(!t.has(n))return!0;return!1}var _t=["keys","values","entries"],jt=new Set(["has","toString"]),Pt={add:Et,clear:Et,delete:Et,forEach:Et},Mt=new Set([...jt,...Object.keys(Pt),..._t]);function Ct(e,t){if(e.size!==t.size)return!0;let n;for(let[r,i]of e)if(n=t.get(r),n!==i||void 0===n&&!t.has(r))return!0;return!1}var Ot=new Set([...jt,"get"]),xt={set:Ct,clear:Ct,delete:Ct,forEach:Ct},At=new Set([...Ot,...Object.keys(xt),..._t]),St=class{constructor(e,t,n,r){this._path=t,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=r,this._changes=r?[]:null,this.clone=void 0===t?e:this._shallowClone(e)}static isHandledMethod(e){return yt.has(e)}_shallowClone(e){let t=e;if(mt(e))t={...e};else if(ct(e))t=[...e];else if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set([...e].map(e=>this._shallowClone(e)));else if(e instanceof Map){t=new Map;for(let[n,r]of e.entries())t.set(n,this._shallowClone(r))}return this._clonedCache.add(t),t}preferredThisArg(e,t,n,r){return e?(ct(r)?this._onIsChanged=gt[t]:r instanceof Set?this._onIsChanged=Pt[t]:r instanceof Map&&(this._onIsChanged=xt[t]),r):n}update(e,t,n){let r=dt.after(e,this._path);if("length"!==t){let e=this.clone;dt.walk(r,t=>{e&&e[t]&&(this._clonedCache.has(e[t])||(e[t]=this._shallowClone(e[t])),e=e[t])}),this._hasOnValidate&&this._changes.push({path:r,property:t,previous:n}),e&&e[t]&&(e[t]=n)}this._isChanged=!0}undo(e){let t;for(let n=this._changes.length-1;-1!==n;n--)t=this._changes[n],dt.get(e,t.path)[t.property]=t.previous}isChanged(e){return void 0===this._onIsChanged?this._isChanged:this._onIsChanged(this.clone,e)}},kt=class extends St{static isHandledMethod(e){return wt.has(e)}},Rt=class extends St{undo(e){e.setTime(this.clone.getTime())}isChanged(e,t){return!t(this.clone.valueOf(),e.valueOf())}},Tt=class extends St{static isHandledMethod(e){return Mt.has(e)}undo(e){for(let t of this.clone)e.add(t);for(let t of e)this.clone.has(t)||e.delete(t)}},Dt=class extends St{static isHandledMethod(e){return At.has(e)}undo(e){for(let[t,n]of this.clone.entries())e.set(t,n);for(let t of e.keys())this.clone.has(t)||e.delete(t)}},Lt=class extends St{constructor(e,t,n,r){super(void 0,t,n,r),this._arg1=n[0],this._weakValue=e.has(this._arg1)}isChanged(e){return this._weakValue!==e.has(this._arg1)}undo(e){this._weakValue&&!e.has(this._arg1)?e.add(this._arg1):e.delete(this._arg1)}},Vt=class extends St{constructor(e,t,n,r){super(void 0,t,n,r),this._weakKey=n[0],this._weakHas=e.has(this._weakKey),this._weakValue=e.get(this._weakKey)}isChanged(e){return this._weakValue!==e.get(this._weakKey)}undo(e){let t=e.has(this._weakKey);this._weakHas&&!t?e.set(this._weakKey,this._weakValue):!this._weakHas&&t?e.delete(this._weakKey):this._weakValue!==e.get(this._weakKey)&&e.set(this._weakKey,this._weakValue)}},It=class{constructor(e){this._stack=[],this._hasOnValidate=e}static isHandledType(e){return mt(e)||ct(e)||lt(e)}static isHandledMethod(e,t){return mt(e)?St.isHandledMethod(t):ct(e)?kt.isHandledMethod(t):e instanceof Set?Tt.isHandledMethod(t):e instanceof Map?Dt.isHandledMethod(t):lt(e)}get isCloning(){return this._stack.length>0}start(e,t,n){let r=St;ct(e)?r=kt:e instanceof Date?r=Rt:e instanceof Set?r=Tt:e instanceof Map?r=Dt:e instanceof WeakSet?r=Lt:e instanceof WeakMap&&(r=Vt),this._stack.push(new r(e,t,n,this._hasOnValidate))}update(e,t,n){this._stack[this._stack.length-1].update(e,t,n)}preferredThisArg(e,t,n){let{name:r}=e,i=It.isHandledMethod(n,r);return this._stack[this._stack.length-1].preferredThisArg(i,r,t,n)}isChanged(e,t,n){return this._stack[this._stack.length-1].isChanged(e,t,n)}undo(e){void 0!==this._previousClone&&this._previousClone.undo(e)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}},Gt={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},Ut=(e,t,n={})=>{n={...Gt,...n};let r=Symbol("ProxyTarget"),{equals:i,isShallow:s,ignoreDetached:a,details:o}=n,l=new pt(i),c="function"==typeof n.onValidate,h=new It(c),d=(e,t,r,i,s)=>!c||h.isCloning||!0===n.onValidate(dt.concat(l.getPath(e),t),r,i,s),u=(t,r,i,s)=>{!ut(l,n,r)&&(!a||!l.isDetached(t,e))&&p(l.getPath(t),r,i,s)},p=(e,n,r,i,s)=>{h.isCloning?h.update(e,n,i):t(dt.concat(e,n),r,i,s)},m=e=>e&&(e[r]||e),f=(t,i,o,c)=>function(e){return("object"==typeof e?null===e:"function"!=typeof e)||e instanceof RegExp}(t)||"constructor"===o||s&&!It.isHandledMethod(i,o)||ut(l,n,o)||l.isGetInvariant(i,o)||a&&l.isDetached(i,e)?t:(void 0===c&&(c=l.getPath(i)),l.getProxy(t,dt.concat(c,o),v,r)),v={get(e,t,n){if(ht(t)){if(t===r||t===at)return e;if(t===ot&&!l.isUnsubscribed&&0===l.getPath(e).length)return l.unsubscribe(),e}let i=lt(e)?Reflect.get(e,t):Reflect.get(e,t,n);return f(i,e,t)},set(e,t,n,s){n=m(n);let a=e[r]||e,o=a[t];if(i(o,n)&&t in e)return!0;let c=d(e,t,n,o);return c&&l.setProperty(a,t,n,s,o)?(u(e,t,e[t],o),!0):!c},defineProperty(e,t,n){if(!l.isSameDescriptor(n,e,t)){let r=e[t];d(e,t,n.value,r)&&l.defineProperty(e,t,n,r)&&u(e,t,n.value,r)}return!0},deleteProperty(e,t){if(!Reflect.has(e,t))return!0;let n=Reflect.get(e,t),r=d(e,t,void 0,n);return r&&l.deleteProperty(e,t,n)?(u(e,t,void 0,n),!0):!r},apply(t,n,s){let a=n[r]||n;if(l.isUnsubscribed)return Reflect.apply(t,a,s);if((!1===o||!0!==o&&!o.includes(t.name))&&It.isHandledType(a)){let r=dt.initial(l.getPath(t)),o=It.isHandledMethod(a,t.name);h.start(a,r,s);let c=Reflect.apply(t,h.preferredThisArg(t,n,a),o?s.map(e=>m(e)):s),u=h.isChanged(a,i),y=h.stop();if(It.isHandledType(c)&&o&&(n instanceof Map&&"get"===t.name&&(r=dt.concat(r,s[0])),c=l.getProxy(c,r,v)),u){let n={name:t.name,args:s,result:c},i=h.isCloning?dt.initial(r):r,o=h.isCloning?dt.last(r):"";d(dt.get(e,i),o,a,y,n)?p(i,o,a,y,n):h.undo(a)}return(n instanceof Map||n instanceof Set)&&function(e){return"object"==typeof e&&"function"==typeof e.next}(c)?function(e,t,n,r,i){let s=e.next;if("entries"===t.name)e.next=function(){let e=s.call(this);return!1===e.done&&(e.value[0]=i(e.value[0],t,e.value[0],r),e.value[1]=i(e.value[1],t,e.value[0],r)),e};else if("values"===t.name){let a=n[at].keys();e.next=function(){let e=s.call(this);return!1===e.done&&(e.value=i(e.value,t,a.next().value,r)),e}}else e.next=function(){let e=s.call(this);return!1===e.done&&(e.value=i(e.value,t,e.value,r)),e};return e}(c,t,n,r,f):c}return Reflect.apply(t,n,s)}},y=l.getProxy(e,n.pathAsArray?[]:"",v);return t=t.bind(y),c&&(n.onValidate=n.onValidate.bind(y)),y};Ut.target=e=>e&&e[at]||e,Ut.unsubscribe=e=>e[ot]||e;var Kt=Ut,Bt="__splineHtmlContent",Nt=`(function () {\n\t'use strict';\n\tvar MARKER = ${JSON.stringify(Bt)};\n\tvar callSeq = 1;\n\tvar pending = {};\n\tvar listeners = {};\n\tvar acked = false;\n\tvar readyResolve;\n\tvar readyPromise = new Promise(function (resolve) { readyResolve = resolve; });\n\n\tfunction post(msg) {\n\t\tmsg[MARKER] = true;\n\t\ttry {\n\t\t\twindow.parent.postMessage(msg, '*');\n\t\t} catch (e) { /* parent gone — nothing to do */ }\n\t}\n\n\tfunction call(method, args) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tvar id = callSeq++;\n\t\t\tpending[id] = { resolve: resolve, reject: reject };\n\t\t\tpost({ kind: 'call', id: id, method: method, args: args });\n\t\t});\n\t}\n\n\t// ---- the public API ----------------------------------------------------\n\tvar spline = {\n\t\t/** Resolves once the editor has acknowledged the frame. */\n\t\tready: readyPromise,\n\t\tsetVariable: function (name, value) { return call('setVariable', [name, value]); },\n\t\tsetVariables: function (variables) { return call('setVariables', [variables]); },\n\t\tgetVariable: function (name) { return call('getVariable', [name]); },\n\t\tgetVariables: function () { return call('getVariables', []); },\n\t\tgetAllObjects: function () { return call('getAllObjects', []); },\n\t\tfindObjectByName: function (name) { return call('findObjectByName', [name]); },\n\t\tfindObjectById: function (id) { return call('findObjectById', [id]); },\n\t\t/** Read a mesh's live geometry ({vertexCount, triangleCount, indexed, bounds, vertices: Float32Array, indices?, normals?, uvs?}); options {space: 'local'|'world'}. Resolves undefined (with a console warning) when unreadable. */\n\t\tgetGeometry: function (nameOrId, options) { return call('getGeometry', [nameOrId, options || {}]); },\n\t\t/** Runtime-only transform/visibility update ({position,rotation,scale,visible}; rotation in degrees). */\n\t\tupdateObject: function (nameOrId, props) { return call('updateObject', [nameOrId, props]); },\n\t\t/** Runtime-only object creation ('Cube', 'Sphere', …, 'Text', 'Group', lights); resolves to the new object's snapshot. */\n\t\tcreateObject: function (type, options) {\n\t\t\t// A three.js material instance or createCustomMaterial factory can't cross\n\t\t\t// the postMessage boundary (textures/callbacks/functions fail\n\t\t\t// structured clone) — fail loud, not with a cryptic DataCloneError.\n\t\t\tif (options && options.material && (\n\t\t\t\toptions.material.isMaterial === true ||\n\t\t\t\ttypeof options.material === 'function'\n\t\t\t)) {\n\t\t\t\treturn Promise.reject(new Error(\n\t\t\t\t\t'createObject: custom three.js materials need the inline ' +\n\t\t\t\t\t'HTML-content mode (the editor Preview/Play frame and web ' +\n\t\t\t\t\t'exports); this embed runs the sandboxed mode, whose transport ' +\n\t\t\t\t\t'cannot carry them. Use a color/PBR bag or shared material ' +\n\t\t\t\t\t'name here instead.'\n\t\t\t\t));\n\t\t\t}\n\t\t\treturn call('createObject', [type, options || {}]);\n\t\t},\n\t\t/** Custom three.js/TSL materials — inline HTML-content mode only; the\n\t\t * factory function cannot cross this sandboxed transport. */\n\t\tcreateCustomMaterial: function () {\n\t\t\treturn Promise.reject(new Error(\n\t\t\t\t'createCustomMaterial: custom three.js materials need the inline ' +\n\t\t\t\t'HTML-content mode (the editor Preview/Play frame and web ' +\n\t\t\t\t'exports); this embed runs the sandboxed mode, whose transport ' +\n\t\t\t\t'cannot carry the factory function or the material it returns.'\n\t\t\t));\n\t\t},\n\t\t/** The live three texture an object samples — inline HTML-content mode\n\t\t * only; a Texture instance cannot cross this sandboxed transport. */\n\t\tgetTexture: function () {\n\t\t\treturn Promise.reject(new Error(\n\t\t\t\t'getTexture: a three.js texture instance needs the inline ' +\n\t\t\t\t'HTML-content mode (the editor Preview/Play frame and web ' +\n\t\t\t\t'exports); this embed runs the sandboxed mode, whose transport ' +\n\t\t\t\t'cannot carry it.'\n\t\t\t));\n\t\t},\n\t\t/** Replace a mesh's material with a custom three.js material — inline\n\t\t * HTML-content mode only; neither factories nor instances can cross\n\t\t * this sandboxed transport. */\n\t\tsetMaterial: function () {\n\t\t\treturn Promise.reject(new Error(\n\t\t\t\t'setMaterial: custom three.js materials need the inline ' +\n\t\t\t\t'HTML-content mode (the editor Preview/Play frame and web ' +\n\t\t\t\t'exports); this embed runs the sandboxed mode, whose transport ' +\n\t\t\t\t'cannot carry the factory function or the material it returns.'\n\t\t\t));\n\t\t},\n\t\t/** Runtime-only deep clone of an existing object; resolves to the clone's snapshot. */\n\t\tcloneObject: function (nameOrId, options) { return call('cloneObject', [nameOrId, options || {}]); },\n\t\t/** Removes an object (and its subtree); resolves to false when none matched. */\n\t\tremoveObject: function (nameOrId) { return call('removeObject', [nameOrId]); },\n\t\t/** Spawn a runtime-only copy of a template object; resolves to its snapshot ({id,...}) or undefined. */\n\t\tspawnObject: function (templateNameOrId, options) { return call('spawnObject', [templateNameOrId, options || {}]); },\n\t\t/** Remove a spawned copy by id (or assigned name). Spawned objects only. */\n\t\tdestroyObject: function (idOrName) { return call('destroyObject', [idOrName]); },\n\t\t/** Per-copy transform writes on a cloner ([{position,rotation,scale}|null, ...]; degrees); null clears all. Resolves to the copy count. */\n\t\tsetInstanceTransforms: function (nameOrId, transforms) { return call('setInstanceTransforms', [nameOrId, transforms === undefined ? null : transforms]); },\n\t\t/** An imported model's animation clips ([{id, name, duration, object: {id, name}}]) — one object's, or the whole scene's when omitted. */\n\t\tgetAnimations: function (nameOrId) { return call('getAnimations', [nameOrId]); },\n\t\t/** Play an imported clip by name or id (the object's first when omitted); options {loop: true|false|count, pingpong, fade: seconds, speed}. Resolves to the clip, or undefined. */\n\t\tplayAnimation: function (nameOrId, clip, options) { return call('playAnimation', [nameOrId, clip, options]); },\n\t\t/** Hold an object's clips (or one) where they are — every animated object when omitted; playAnimation resumes. */\n\t\tpauseAnimation: function (nameOrId, clip) { return call('pauseAnimation', [nameOrId, clip]); },\n\t\t/** Stop an object's clips (or one) on their first frame — every animated object when omitted. */\n\t\tstopAnimation: function (nameOrId, clip) { return call('stopAnimation', [nameOrId, clip]); },\n\t\t/** Trigger a Spline event on an object (requires Play mode). */\n\t\temitEvent: function (eventName, nameOrUuid) { return call('emitEvent', [eventName, nameOrUuid]); },\n\t\temitEventReverse: function (eventName, nameOrUuid) { return call('emitEventReverse', [eventName, nameOrUuid]); },\n\t\trequestRender: function () { return call('requestRender', []); },\n\t\taddEventListener: function (eventName, cb) {\n\t\t\tif (typeof cb !== 'function') return;\n\t\t\tif (!listeners[eventName]) {\n\t\t\t\tlisteners[eventName] = [];\n\t\t\t\tcall('listenEvent', [eventName]);\n\t\t\t}\n\t\t\tlisteners[eventName].push(cb);\n\t\t},\n\t\tremoveEventListener: function (eventName, cb) {\n\t\t\tvar list = listeners[eventName];\n\t\t\tif (!list) return;\n\t\t\tvar i = list.indexOf(cb);\n\t\t\tif (i !== -1) list.splice(i, 1);\n\t\t\tif (list.length === 0) {\n\t\t\t\tdelete listeners[eventName];\n\t\t\t\tcall('unlistenEvent', [eventName]);\n\t\t\t}\n\t\t},\n\t};\n\twindow.spline = spline;\n\n\t// ---- editor -> frame ---------------------------------------------------\n\twindow.addEventListener('message', function (event) {\n\t\tif (event.source !== window.parent) return;\n\t\tvar data = event.data;\n\t\tif (!data || data[MARKER] !== true) return;\n\t\tif (data.kind === 'ready-ack') {\n\t\t\tacked = true;\n\t\t\treadyResolve();\n\t\t} else if (data.kind === 'result') {\n\t\t\tvar entry = pending[data.id];\n\t\t\tif (!entry) return;\n\t\t\tdelete pending[data.id];\n\t\t\tif (data.ok) entry.resolve(data.value);\n\t\t\telse entry.reject(new Error(data.error || 'spline bridge call failed'));\n\t\t} else if (data.kind === 'event') {\n\t\t\tvar list = listeners[data.eventName];\n\t\t\tif (!list) return;\n\t\t\tfor (var i = 0; i < list.length; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tlist[i](data.payload);\n\t\t\t\t} catch (e) {\n\t\t\t\t\treportError(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\t// ---- console + error capture --------------------------------------------\n\tfunction stringify(value, depth) {\n\t\ttry {\n\t\t\tif (typeof value === 'string') return value;\n\t\t\tif (value instanceof Error) return value.stack || String(value);\n\t\t\tif (typeof value === 'function') return '[function ' + (value.name || 'anonymous') + ']';\n\t\t\tif (value === undefined) return 'undefined';\n\t\t\tvar seen = [];\n\t\t\tvar json = JSON.stringify(value, function (k, v) {\n\t\t\t\tif (typeof v === 'object' && v !== null) {\n\t\t\t\t\tif (seen.indexOf(v) !== -1) return '[circular]';\n\t\t\t\t\tseen.push(v);\n\t\t\t\t}\n\t\t\t\tif (typeof v === 'function') return '[function]';\n\t\t\t\treturn v;\n\t\t\t});\n\t\t\treturn json === undefined ? String(value) : json;\n\t\t} catch (e) {\n\t\t\ttry { return String(value); } catch (e2) { return '[unserializable]'; }\n\t\t}\n\t}\n\n\tfunction sendConsole(level, args) {\n\t\tvar parts = [];\n\t\tfor (var i = 0; i < args.length; i++) parts.push(stringify(args[i]));\n\t\tvar text = parts.join(' ');\n\t\tif (text.length > 4000) text = text.slice(0, 4000) + '…';\n\t\tpost({ kind: 'console', level: level, text: text });\n\t}\n\n\t['log', 'info', 'warn', 'error'].forEach(function (level) {\n\t\tvar original = console[level];\n\t\tconsole[level] = function () {\n\t\t\tsendConsole(level, arguments);\n\t\t\tif (original) original.apply(console, arguments);\n\t\t};\n\t});\n\n\tfunction reportError(error) {\n\t\tsendConsole('error', [error instanceof Error ? error : String(error)]);\n\t}\n\twindow.addEventListener('error', function (event) {\n\t\tsendConsole('error', [event.message + (event.filename ? ' (' + event.filename + ':' + event.lineno + ')' : '')]);\n\t});\n\twindow.addEventListener('unhandledrejection', function (event) {\n\t\tsendConsole('error', ['Unhandled promise rejection: ' + stringify(event.reason)]);\n\t});\n\n\t// ---- input passthrough ---------------------------------------------------\n\t// A pointer that goes DOWN on the page background belongs to the 3D scene\n\t// until it is released; one that goes down on generated UI never forwards.\n\tvar forwardedPointers = {};\n\n\tfunction isBackground(target) {\n\t\tif (!target || target === document || target === document.documentElement || target === document.body) {\n\t\t\treturn true;\n\t\t}\n\t\tif (target.closest && target.closest('[data-spline-passthrough]')) return true;\n\t\treturn false;\n\t}\n\n\tfunction baseInput(e, type) {\n\t\treturn {\n\t\t\ttype: type,\n\t\t\tx: e.clientX,\n\t\t\ty: e.clientY,\n\t\t\tbutton: e.button,\n\t\t\tbuttons: e.buttons,\n\t\t\tpointerId: e.pointerId,\n\t\t\tpointerType: e.pointerType,\n\t\t\tisPrimary: e.isPrimary,\n\t\t\tmovementX: e.movementX,\n\t\t\tmovementY: e.movementY,\n\t\t\tshiftKey: e.shiftKey,\n\t\t\tctrlKey: e.ctrlKey,\n\t\t\taltKey: e.altKey,\n\t\t\tmetaKey: e.metaKey,\n\t\t};\n\t}\n\n\tdocument.addEventListener('pointerdown', function (e) {\n\t\tif (!isBackground(e.target)) return;\n\t\tforwardedPointers[e.pointerId] = true;\n\t\tpost({ kind: 'input', event: baseInput(e, 'pointerdown') });\n\t}, true);\n\n\tdocument.addEventListener('pointermove', function (e) {\n\t\tif (!forwardedPointers[e.pointerId] && !isBackground(e.target)) return;\n\t\tpost({ kind: 'input', event: baseInput(e, 'pointermove') });\n\t}, true);\n\n\t['pointerup', 'pointercancel'].forEach(function (type) {\n\t\tdocument.addEventListener(type, function (e) {\n\t\t\tvar wasForwarded = forwardedPointers[e.pointerId];\n\t\t\tdelete forwardedPointers[e.pointerId];\n\t\t\tif (!wasForwarded && !isBackground(e.target)) return;\n\t\t\tpost({ kind: 'input', event: baseInput(e, type) });\n\t\t}, true);\n\t});\n\n\t['click', 'dblclick'].forEach(function (type) {\n\t\tdocument.addEventListener(type, function (e) {\n\t\t\tif (!isBackground(e.target)) return;\n\t\t\tpost({ kind: 'input', event: baseInput(e, type) });\n\t\t}, true);\n\t});\n\n\tdocument.addEventListener('wheel', function (e) {\n\t\tif (!isBackground(e.target)) return;\n\t\te.preventDefault();\n\t\tvar msg = baseInput(e, 'wheel');\n\t\tmsg.deltaX = e.deltaX;\n\t\tmsg.deltaY = e.deltaY;\n\t\tmsg.deltaMode = e.deltaMode;\n\t\t// The legacy wheelDelta fields carry the trackpad-vs-mouse signature\n\t\t// the editor's pan/zoom discrimination reads (wheelDeltaY === -3*dY\n\t\t// on trackpads) — a reconstructed WheelEvent loses them, turning\n\t\t// two-finger pans into zooms. Forward them verbatim.\n\t\tif (typeof e.wheelDeltaX === 'number') msg.wheelDeltaX = e.wheelDeltaX;\n\t\tif (typeof e.wheelDeltaY === 'number') msg.wheelDeltaY = e.wheelDeltaY;\n\t\tpost({ kind: 'input', event: msg });\n\t}, { capture: true, passive: false });\n\n\t['keydown', 'keyup'].forEach(function (type) {\n\t\tdocument.addEventListener(type, function (e) {\n\t\t\t// Never steal keys from the page's own form fields.\n\t\t\tvar t = e.target;\n\t\t\tif (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return;\n\t\t\tpost({ kind: 'input', event: {\n\t\t\t\ttype: type,\n\t\t\t\tkey: e.key,\n\t\t\t\tcode: e.code,\n\t\t\t\trepeat: e.repeat,\n\t\t\t\tshiftKey: e.shiftKey,\n\t\t\t\tctrlKey: e.ctrlKey,\n\t\t\t\taltKey: e.altKey,\n\t\t\t\tmetaKey: e.metaKey,\n\t\t\t} });\n\t\t}, true);\n\t});\n\n\t// ---- handshake -----------------------------------------------------------\n\t// Announce readiness and KEEP announcing until the editor acks. A single\n\t// 'ready' can race the editor attaching its listener (or land while the\n\t// editor is busy); code that awaits spline.ready would then hang forever.\n\t// The editor acks every 'ready' (and posts a proactive ack on attach), so\n\t// this settles within one round-trip in the normal case.\n\tpost({ kind: 'ready' });\n\tvar readyRetry = setInterval(function () {\n\t\tif (acked) {\n\t\t\tclearInterval(readyRetry);\n\t\t\treturn;\n\t\t}\n\t\tpost({ kind: 'ready' });\n\t}, 250);\n})();`;function Wt(e){return null==e||""===e?void 0:String(e)}var zt=class{constructor(e,t,n){this.deps=e,this.onConsole=t,this.onEvent=n,this.disposed=!1,this.eventUnsubs=new Map,this.variablePollHandle=null,this.lastVariables=null}dispose(){this.disposed=!0;for(let e of this.eventUnsubs.values())e();this.eventUnsubs.clear(),this.stopVariablePolling()}execute(e,t){let n=this.deps;switch(e){case"setVariable":{let e=n.setVariable(String(t[0]),t[1]);return e.warning&&this.onConsole("warn",e.warning),e.ok}case"setVariables":{let e=t[0]??{},r=!0;for(let[t,i]of Object.entries(e)){let e=n.setVariable(t,i);e.warning&&this.onConsole("warn",e.warning),r=r&&e.ok}return r}case"getVariable":return n.getVariable(String(t[0]));case"getVariables":return n.getVariables();case"getAllObjects":return n.getAllObjects();case"findObjectByName":case"findObjectById":return n.findObject(String(t[0]));case"getGeometry":{let e=n.getGeometry(String(t[0]),t[1]??{});return e.warning&&this.onConsole("warn",e.warning),e.data}case"updateObject":return n.updateObject(String(t[0]),t[1]??{});case"createObject":return n.createObject(String(t[0]),t[1]??{});case"createCustomMaterial":if(void 0===n.createCustomMaterial)throw new Error("createCustomMaterial: not available on this surface — custom three.js/TSL materials need the inline HTML-content mode (editor Preview/Play and web exports).");return n.createCustomMaterial(t[0]);case"getTexture":if(void 0===n.getTexture)throw new Error("getTexture: not available on this surface — a three.js texture instance needs the inline HTML-content mode (editor Preview/Play and web exports).");return n.getTexture(String(t[0]),t[1]??{});case"setMaterial":if(void 0===n.setMaterial)throw new Error("setMaterial: not available on this surface — custom three.js/TSL materials need the inline HTML-content mode (editor Preview/Play and web exports).");return n.setMaterial(String(t[0]),t[1]);case"cloneObject":return n.cloneObject(String(t[0]),t[1]??{});case"removeObject":return n.removeObject(String(t[0]));case"spawnObject":{let e=n.spawnObject(String(t[0]),t[1]??{});return e.warning&&this.onConsole("warn",e.warning),e.object}case"destroyObject":return n.destroyObject(String(t[0]));case"setInstanceTransforms":{let e=null===t[1]||void 0===t[1]?null:t[1],r=n.setInstanceTransforms(String(t[0]),e);return r<0&&this.onConsole("warn",`spline.setInstanceTransforms: "${String(t[0])}" has no cloner — make the object a cloner first (its copies are what this drives).`),r}case"getAnimations":{let r=n.getAnimations(Wt(t[0]));return r.warning&&this.onConsole("warn",`spline.${e}: ${r.warning}`),r.clips}case"playAnimation":{let r="object"==typeof t[1]&&null!==t[1],i=n.playAnimation(String(t[0]),r?void 0:Wt(t[1]),(r?t[1]:t[2])??{});return i.warning&&this.onConsole("warn",`spline.${e}: ${i.warning}`),i.clip}case"pauseAnimation":case"stopAnimation":{let r=Wt(t[0]),i=Wt(t[1]),s="pauseAnimation"===e?n.pauseAnimation(r,i):n.stopAnimation(r,i);return s.warning&&this.onConsole("warn",`spline.${e}: ${s.warning}`),s.ok}case"emitEvent":case"emitEventReverse":{let r=n.emitEvent(String(t[0]),String(t[1]),"emitEventReverse"===e);return r.warning&&this.onConsole("warn",r.warning),r.ok}case"requestRender":return n.requestRender(),!0;case"listenEvent":{let e=String(t[0]);return"variableChange"===e?this.startVariablePolling():this.eventUnsubs.has(e)||this.eventUnsubs.set(e,n.addSplineEventListener(e,t=>{this.onEvent(e,t)})),!0}case"unlistenEvent":{let e=String(t[0]);return"variableChange"===e?this.stopVariablePolling():(this.eventUnsubs.get(e)?.(),this.eventUnsubs.delete(e)),!0}default:throw new Error(`Unknown spline bridge method: ${e}`)}}startVariablePolling(){null===this.variablePollHandle&&(this.lastVariables=this.deps.getVariables(),this.variablePollHandle=window.setInterval(()=>{if(this.disposed)return;let e=this.deps.getVariables(),t=function(e,t){let n=[];for(let r of Object.keys(t))e[r]!==t[r]&&n.push({name:r,value:t[r]});return n}(this.lastVariables??{},e);this.lastVariables=e;for(let e of t)this.onEvent("variableChange",e)},100))}stopVariablePolling(){null!==this.variablePollHandle&&(window.clearInterval(this.variablePollHandle),this.variablePollHandle=null),this.lastVariables=null}};function Ft(e,t,n,r){return[e[0]*t+e[4]*n+e[8]*r+e[12],e[1]*t+e[5]*n+e[9]*r+e[13],e[2]*t+e[6]*n+e[10]*r+e[14]]}var Ht=class{constructor(e,t,n){this.iframe=e,this.deps=t,this.onConsole=n,this.disposed=!1,this.handshakeSeen=!1,this.handshakeTimer=null,this.onMessage=e=>{if(this.disposed||e.source!==this.iframe.contentWindow)return;let t=e.data;var n;"object"!=typeof(n=t)||null===n||!0!==n[Bt]||"string"!=typeof n.kind||this.handleMessage(t)},this.host=new zt(t,n,(e,t)=>{this.sendEvent(e,t)})}attach(){window.addEventListener("message",this.onMessage),this.send({[Bt]:!0,kind:"ready-ack"}),this.handshakeTimer=window.setTimeout(()=>{this.handshakeTimer=null,!this.handshakeSeen&&!this.disposed&&this.onConsole("warn","The HTML content frame has not initialized (no signal from its scripts yet) — if the page looks frozen, check for errors in its code.")},6e3)}dispose(){this.disposed=!0,window.removeEventListener("message",this.onMessage),this.host.dispose(),null!==this.handshakeTimer&&(window.clearTimeout(this.handshakeTimer),this.handshakeTimer=null)}handleMessage(e){switch(e.kind){case"ready":this.handshakeSeen=!0,this.send({[Bt]:!0,kind:"ready-ack"});break;case"console":this.onConsole(e.level,e.text);break;case"call":{let t;try{t=Promise.resolve(this.host.execute(e.method,e.args))}catch(e){t=Promise.reject(e)}t.then(t=>{this.send({[Bt]:!0,kind:"result",id:e.id,ok:!0,value:t,error:void 0})},t=>{let n=t instanceof Error?t.message:String(t);this.send({[Bt]:!0,kind:"result",id:e.id,ok:!1,value:void 0,error:n}),this.onConsole("error",n)});break}case"input":this.dispatchInput(e.event)}}send(e){this.iframe.contentWindow?.postMessage(e,"*")}sendEvent(e,t){this.send({[Bt]:!0,kind:"event",eventName:e,payload:t})}dispatchInput(e){let t=this.deps.getCanvas();if(!t)return;let n=this.iframe.getBoundingClientRect(),r={bubbles:!0,cancelable:!0,view:window,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey};switch(e.type){case"pointerdown":case"pointermove":case"pointerup":case"pointercancel":t.dispatchEvent(new PointerEvent(e.type,{...r,clientX:(e.x??0)+n.left,clientY:(e.y??0)+n.top,button:e.button,buttons:e.buttons,pointerId:e.pointerId,pointerType:e.pointerType,isPrimary:e.isPrimary,movementX:e.movementX,movementY:e.movementY}));break;case"click":case"dblclick":t.dispatchEvent(new MouseEvent(e.type,{...r,clientX:(e.x??0)+n.left,clientY:(e.y??0)+n.top,button:e.button,buttons:e.buttons}));break;case"wheel":{let i=new WheelEvent("wheel",{...r,clientX:(e.x??0)+n.left,clientY:(e.y??0)+n.top,deltaX:e.deltaX,deltaY:e.deltaY,deltaMode:e.deltaMode});"number"==typeof e.wheelDeltaX&&Object.defineProperty(i,"wheelDeltaX",{value:e.wheelDeltaX}),"number"==typeof e.wheelDeltaY&&Object.defineProperty(i,"wheelDeltaY",{value:e.wheelDeltaY}),t.dispatchEvent(i);break}case"keydown":case"keyup":t.dispatchEvent(new KeyboardEvent(e.type,{...r,key:e.key,code:e.code,repeat:e.repeat}))}}};function $t(e){let t=e.points.length/7,n=new ke;for(let r=0;r<t;r++){let t=7*r,i=e.points[t+0],s=e.points[t+1],a=e.points[t+2],o=e.points[t+3],l=e.points[t+4],c=e.points[t+5],h=e.points[t+6];n.push({fi:r,id:Fe.generateUUID(),data:{roundness:h,position:[i,s],areControlsDirectionsMirrored:!0,controlPrevious:{position:[a,o]},controlNext:{position:[l,c]}}})}return{points:n,isClosed:e.isClosed,roundness:e.roundness,shapeHoles:e.shapeHoles?.map(e=>$t(e))??[]}}function qt(e){let{userData:t,uuid:n,...r}=e;if(void 0===t||"NonParametricGeometry"===t.type)return function(e){let t,{userData:n,data:r}=e,i=r?.groups,s=r?.attributes??{},a=r?.morphAttributes??{},o=r?.interleavedBuffers,l=r?.arrayBuffers,c=r?.index;void 0!==s.position&&Array.isArray(s.position.array)&&(t=function(e){let t=1/0,n=1/0,r=1/0,i=-1/0,s=-1/0,a=-1/0;for(let o=0;o<e.length;o+=3){let l=e[o],c=e[o+1],h=e[o+2];t=Math.min(t,l),n=Math.min(n,c),r=Math.min(r,h),i=Math.max(i,l),s=Math.max(s,c),a=Math.max(a,h)}return{width:i-t,height:s-n,depth:a-r}}(s.position.array));let h={...void 0===n?{}:n.parameters,data:{attributes:s,morphAttributes:a,interleavedBuffers:o,arrayBuffers:l},...void 0===t?{}:t,type:"NonParametricGeometry"};return void 0!==c&&Object.assign(h.data,{index:c}),void 0!==i&&Object.assign(h.data,{groups:i.map(e=>({...e,materialIndex:e.materialIndex??0}))}),h}(e);if("SubdivGeometry"===t.type){let e="SubdivGeometry",n=r.data?.attributes;if(void 0===n?.positionWASM){let e=new tt;if(void 0===n?.position||void 0===n?.faceMap)return null;let t=n.position.array,i=n.faceMap.array,s=r.data.index.array;e.setAttribute("position",new et(t,3)),e.setIndex(new Qe(s,1));let a=U(e),o=[],l=new Array(i[i.length-1]+1).fill(3),c=a.getIndex().array;for(let e=0,t=i.length;e<t;)i[e]===i[e+1]?(l[i[e]]++,o.push(...new Set(c.slice(3*e,3*e+6))),e+=2):(o.push(...c.slice(3*e,3*e+3)),e++);n.indexWASM={array:o},n.positionWASM=a.attributes.position,n.verticesPerFaceWASM={array:l}}if(void 0===n?.positionWASM||0===n?.positionWASM.length||void 0===n?.indexWASM||0===n?.indexWASM.length||void 0===n?.verticesPerFaceWASM||0===n?.verticesPerFaceWASM.length)return null;let i={type:e,...Zt(n.positionWASM.array)};i.subdivisions=t.parameters.subdivisions;for(let e in n)"positionWASM"===e?i[e]=new Float32Array(n[e].array):"indexWASM"===e?i[e]=new Int32Array(n[e].array):"verticesPerFaceWASM"===e&&(i[e]=new Int8Array(n[e].array));return i.scaleBaked=[1,1,1],i}let i=t.type,s=t.parameters;return"VectorGeometry"===i?(s.extrudeDepth&&(s.depth=s.extrudeDepth),{...s,width:100,height:100,shape:$t(t.shape),type:i}):"LatheGeometry"===i?{...t.parameters,type:i,points:(t?.parameters.points??[]).map(e=>[e.x,e.y])}:(s.extrudeDepth&&(s.depth=s.extrudeDepth),{...s,type:i})}new Ye,new $e,new Xe,new qe,new qe;var Yt=new Je,Xt=new qe;function Zt(e){return Yt.setFromArray(e),Yt.getSize(Xt),{width:Xt.x,height:Xt.y,depth:Xt.z}}var Jt=class{constructor(e,t,n,r,i,s){if(this.id=e,this.data=t,this.object=n,this.entered=!1,("KeyDown"===t.type||"KeyUp"===t.type||"KeyPress"===t.type)&&!t.key)throw new Error("Missing property");this.actions=Q(t,t.actions,r,i,s,n)}disconnect(){ee(this.actions)}dispatchHeld(e){this.actions.Create.forEach(t=>{e&&t.dispatchThrottled.cancel(),t.dispatchThrottled()})}dispatch(e=!1){this.actions.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())}),"MousePress"===this.data.type||"KeyPress"===this.data.type?this.entered||(this.entered=!0,this.actions.Transition.forEach(e=>e.playFromCurrent()),this.actions.Animation.forEach(e=>e.playFromCurrent()),this.actions.TimelineAnimation.forEach(e=>e.playFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.playFromCurrent()),this.actions.Create.forEach(e=>e.dispatchStart())):(this.actions.Transition.some(e=>e.playing&&"Toggle"!==e.data.runMode)||this.actions.Transition.forEach(e=>e.play()),this.actions.SwitchCamera.some(e=>e.playing&&"Toggle"!==e.data.runMode)||this.actions.SwitchCamera.forEach(e=>{"Toggle"===e.data.runMode?e.toggle():e.play()}),this.actions.Animation.forEach(e=>{"runMode"in e.data&&"Toggle"===e.data.runMode?e.toggle():e.play()}),this.actions.TimelineAnimation.forEach(e=>{"runMode"in e.data&&"Toggle"===e.data.runMode?e.toggle():e.play()})),this.actions.Link.forEach(e=>{e.dispatch()}),this.actions.SceneTransition.forEach(e=>{e.dispatch()}),!1===e&&this.actions.Create.forEach(e=>{e.dispatch()}),this.actions.Destroy.forEach(e=>{e.dispatch()}),this.actions.Reset.forEach(e=>{e.dispatch()}),this.actions.Audio.forEach(e=>{e.dispatchBasic()}),this.actions.Video.forEach(e=>{e.dispatchBasic()}),this.actions.Particles.forEach(e=>{e.dispatchBasic()}),this.actions.SetVariable.forEach(e=>e.checkConditions()),this.actions.SetVariable.forEach(e=>e.dispatch()),this.actions.DynamicVariablePlay.forEach(e=>e.dispatch()),this.actions.ClearLocalStorage.forEach(e=>e.dispatch()),this.actions.UserAPI.forEach(e=>e.dispatch())}dispatchRelease(){this.entered&&(this.entered=!1,this.actions.Transition.forEach(e=>e.reverseFromCurrent()),this.actions.Particles.forEach(e=>e.reverseFromCurrent()),this.actions.Animation.forEach(e=>e.reverseFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.reverseFromCurrent()),this.actions.Create.forEach(e=>e.dispatchStop()))}dispatchUserEvent(e){this.actions.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())}),e?(this.actions.Transition.forEach(e=>e.reverseFromCurrent()),this.actions.Animation.forEach(e=>e.reverseFromCurrent()),this.actions.TimelineAnimation.forEach(e=>e.reverseFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.reverseFromCurrent())):(this.actions.Transition.forEach(e=>e.playFromCurrent()),this.actions.Animation.forEach(e=>e.playFromCurrent()),this.actions.TimelineAnimation.forEach(e=>e.playFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.playFromCurrent())),this.actions.Link.forEach(e=>{e.dispatch()}),this.actions.SceneTransition.forEach(e=>{e.dispatch()}),this.actions.Create.forEach(e=>{e.dispatch()}),this.actions.Destroy.forEach(e=>{e.dispatch()}),this.actions.Reset.forEach(e=>{e.dispatch()}),this.actions.Audio.forEach(e=>{e.dispatchBasic()}),this.actions.Video.forEach(e=>{e.dispatchBasic()}),this.actions.Particles.forEach(e=>{e.dispatchBasic()}),this.actions.SetVariable.forEach(e=>e.checkConditions()),this.actions.SetVariable.forEach(e=>e.dispatch()),this.actions.DynamicVariablePlay.forEach(e=>e.dispatch()),this.actions.ClearLocalStorage.forEach(e=>e.dispatch()),this.actions.UserAPI.forEach(e=>e.dispatch())}},Qt=class extends v{constructor(e,t,n){super(e),this.eventManager=t,this.useForRaycastProperty=n,this.objectsPerTypes={MouseDown:[],MouseUp:[],MousePress:[],KeyDown:[],KeyUp:[],KeyPress:[]},this.canvasMouseEvents=[],this.eventsPerObjects={MouseDown:{},MouseUp:{},MousePress:{},KeyDown:{},KeyUp:{},KeyPress:{}},this.heldKeys={},this.heldKeysPress={},this._prevObjects=[],this.sceneInterects=null,this.onCanvasRaycast=e=>{if(!0===this.useForRaycastProperty&&null===this.sceneInterects){this.eventContext.updateRaycaster(e);let{raycaster:t,page:n}=this.eventContext,r=l(t,n,[],!0);this.sceneInterects=r,r.length&&(this.eventContext.sharedAssets.raycastProperty={x:r[0].point.x,y:r[0].point.y,z:r[0].point.z,objX:r[0].object.matrixWorld.elements[12],objY:r[0].object.matrixWorld.elements[13],objZ:r[0].object.matrixWorld.elements[14]})}},this.onCanvasMouseDown=e=>{(e.target===this.eventContext.domElement||"SPLINE-VIEWER"===e.target.tagName)&&this.canvasMouseEvents.forEach(t=>{("MouseDown"===t.data.type||"MousePress"===t.data.type)&&(this.onCanvasRaycast(e),t.dispatch())})},this.onCanvasMouseUp=e=>{(e.target===this.eventContext.domElement||"SPLINE-VIEWER"===e.target.tagName)&&this.canvasMouseEvents.forEach(t=>{"MouseUp"===t.data.type?(this.onCanvasRaycast(e),t.dispatch()):"MousePress"===t.data.type&&t.dispatchRelease()})},this.onMouseDown=e=>{C.length>1||(this.eventContext.updateRaycaster(e),this.handleMouseEvent("MouseDown"))},this.onMouseUp=e=>{C.length>1||(this.eventContext.updateRaycaster(e),this.handleMouseEvent("MouseUp"))},this.onMousePressDown=e=>{C.length>1||(this.eventContext.updateRaycaster(e),this.handleMousePressEvent())},this.onMousePressRelease=e=>{C.length>1||(this.eventContext.updateRaycaster(e),this.handleMousePressEvent(!0))},this.onKeyDown=e=>{this.heldKeys[e.key]||(this.handleKeyEvent(e,"KeyDown"),this.handleKeyEventHeld(e,"KeyDown",!0)),this.heldKeys[e.key]=!0},this.onKeyUp=e=>{this.handleKeyEvent(e,"KeyUp"),this.handleKeyEventHeld(e,"KeyUp",!0)},this.onKeyPressDown=e=>{this.heldKeysPress[e.key]?this.handleKeyEventHeld(e,"KeyPress"):(this.handleKeyEvent(e,"KeyPress"),this.handleKeyEventHeld(e,"KeyPress",!0)),this.heldKeysPress[e.key]=!0},this.onKeyPressUp=e=>{this.handleKeyEvent(e,"KeyPress",!0)},this.releaseHeldKey=e=>{delete this.heldKeys[e.key]},this.releaseHeldKeyPress=e=>{delete this.heldKeysPress[e.key]},this._onUserEvent=({eventName:e,target:t,reverse:n})=>{if(!e||!t)return;let r=m(e);r&&("MouseDown"===r||"MouseUp"===r||"MousePress"===r?(t.dispatchEvent({type:"beginEvent",eventName:r}),this.eventsPerObjects[r]?.[t.uuid]?.forEach(e=>{e.dispatchUserEvent(n)}),this.canvasMouseEvents.forEach(e=>{e.dispatchUserEvent(n)})):("KeyDown"===r||"KeyUp"===r||"KeyPress"===r)&&(t.dispatchEvent({type:"beginEvent",eventName:r}),this.eventsPerObjects[r]?.[t.uuid]?.forEach(e=>{e.dispatchUserEvent()})))}}connect(){let{page:e,sharedAssets:t,domElement:n}=this.eventContext,r=(n,r)=>{if(!n.data?.events.length)return;let i=["MouseDown","MouseUp","MousePress","KeyDown","KeyUp","KeyPress"];for(let s of i){let i=this.eventsPerObjects[s];if(n.data.events.filter(({data:e})=>e.type===s&&!0!==e.disabled).forEach(({id:r,data:s})=>{try{let a=new Jt(r,s,n,e,t,this.eventManager);a.actions.Video.length&&(this.hasVideoAction=!0),"MouseDown"!==s.type&&"MouseUp"!==s.type&&"MousePress"!==s.type||"Canvas"!==s.mode&&"Window"!==s.mode?(i[n.uuid]?i[n.uuid].some(e=>e.id===a.id)||i[n.uuid].push(a):i[n.uuid]=[a],se(n)&&n.traverseChildren(e=>{if(!e.visible)return!0;e instanceof z&&"shapeBlendNode"in e.data.geometry&&2!==e.data.geometry.shapeBlendNode?.operation&&(i[e.uuid]?i[e.uuid].push(a):i[e.uuid]=[a])})):this.canvasMouseEvents.push(a)}catch(e){}}),i[n.uuid]?.length&&(this.objectsPerTypes[s].push(!ae(n)||"MouseDown"!==s&&"MouseUp"!==s&&"MousePress"!==s?n:r),se(n))){let e=this.objectsPerTypes[s];n.traverseChildren(t=>{if(!t.visible)return!0;t instanceof z&&-1===e.indexOf(t)&&e.push(t)})}}};e.traverseEntity(e=>{(oe(e)||e instanceof A)&&e.frame?.traverse(t=>{r(t,e)}),r(e)}),this.heldKeys={},this.heldKeysPress={},this.domEventsNeeded.clear(),n.addEventListener("pointerdown",this.onCanvasMouseDown),n.addEventListener("pointerup",this.onCanvasMouseUp),(this.objectsPerTypes.MouseDown?.length||this.useForRaycastProperty)&&(this.domEventsNeeded.add("pointerdown"),n.addEventListener("pointerdown",this.onMouseDown)),this.objectsPerTypes.MouseUp?.length&&(this.domEventsNeeded.add("pointerup"),n.addEventListener("pointerup",this.onMouseUp)),this.objectsPerTypes.MousePress?.length&&(this.domEventsNeeded.add("pointerdown"),n.addEventListener("pointerdown",this.onMousePressDown),this.domEventsNeeded.add("pointerup"),n.addEventListener("pointerup",this.onMousePressRelease)),this.objectsPerTypes.KeyDown?.length&&(this.domEventsNeeded.add("keydown"),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.releaseHeldKey)),this.objectsPerTypes.KeyUp?.length&&(this.domEventsNeeded.add("keyup"),document.addEventListener("keyup",this.onKeyUp)),this.objectsPerTypes.KeyPress?.length&&(this.domEventsNeeded.add("keydown"),document.addEventListener("keydown",this.onKeyPressDown),document.addEventListener("keyup",this.releaseHeldKeyPress),this.domEventsNeeded.add("keyup"),document.addEventListener("keyup",this.onKeyPressUp)),Object.entries(this.objectsPerTypes).forEach(([e,t])=>{t.forEach(e=>{e.addEventListener("userEvent",this._onUserEvent)})}),this.canvasMouseEvents.forEach(e=>{e.object.addEventListener("userEvent",this._onUserEvent)})}disconnect(){let{domElement:e}=this.eventContext;this.domEventsNeeded.clear(),this.heldKeys={},this.heldKeysPress={},e.removeEventListener("pointerdown",this.onCanvasMouseDown),e.removeEventListener("pointerup",this.onCanvasMouseUp),e.removeEventListener("pointerdown",this.onMouseDown),e.removeEventListener("pointerdown",this.onMousePressDown),e.removeEventListener("pointerup",this.onMouseUp),e.removeEventListener("pointerup",this.onMousePressRelease),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("keydown",this.onKeyPressDown),document.removeEventListener("keyup",this.onKeyPressUp),document.removeEventListener("keyup",this.releaseHeldKey),Object.values(this.eventsPerObjects).forEach(e=>{Object.values(e).forEach(e=>{e.forEach(e=>{e.disconnect()})})}),this.canvasMouseEvents.forEach(e=>{e.disconnect()}),Object.entries(this.objectsPerTypes).forEach(([e,t])=>{t.forEach(e=>{e.removeEventListener("userEvent",this._onUserEvent)})}),this.canvasMouseEvents.forEach(e=>{e.object.removeEventListener("userEvent",this._onUserEvent)})}handleMouseEvent(e){let{stopRaycast:t,raycaster:n,page:r,pointerScreen:i}=this.eventContext,s=this.objectsPerTypes[e],a=s.filter(e=>!ae(e));if((s.length||this.useForRaycastProperty)&&(!r.uiCanvas||!h(r,[i.x,i.y],Object.keys(this.eventsPerObjects[e]),t=>{this.handleObjectMouseEventDispatch(t,e)}))){if(t||this.useForRaycastProperty){let i;if(null===this.sceneInterects?i=l(n,r,a,this.useForRaycastProperty):(i=this.sceneInterects,this.sceneInterects=null),this.useForRaycastProperty&&i.length&&(this.eventContext.sharedAssets.raycastProperty={x:i[0].point.x,y:i[0].point.y,z:i[0].point.z,objX:i[0].object.matrixWorld.elements[12],objY:i[0].object.matrixWorld.elements[13],objZ:i[0].object.matrixWorld.elements[14]}),t){let t=[i[0]?.uv?.x??0,i[0]?.uv?.y??0];c(i).forEach(n=>{oe(n)&&h(n,t,Object.keys(this.eventsPerObjects[e]),t=>{this.handleObjectMouseEventDispatch(t,e)}),this.eventsPerObjects[e][n.uuid]&&this.handleObjectMouseEventDispatch(n,e)})}}t||a.forEach(t=>{let r=d(n,t);r&&(this.handleObjectMouseEventDispatch(t,e),oe(t)&&h(t,[r?.uv?.x??0,r?.uv?.y??0],Object.keys(this.eventsPerObjects[e]),t=>{this.handleObjectMouseEventDispatch(t,e)}))})}}handleMousePressEvent(e=!1){let t="MousePress",n=this.objectsPerTypes[t],r=n.filter(e=>!ae(e)),i=[];if(n.length){if(!e){let{stopRaycast:e,raycaster:n,page:s,pointerScreen:a}=this.eventContext,o=!1;if(s.uiCanvas&&(o=h(s,[a.x,a.y],Object.keys(this.eventsPerObjects[t]),e=>{i.push(e)})),e&&!o){let e=l(n,s,r);i=c(e),e.forEach(e=>{oe(e.object)&&h(e.object,[e?.uv?.x??0,e?.uv?.y??0],Object.keys(this.eventsPerObjects[t]),e=>{i.push(e)})})}else r.forEach(e=>{let r=d(n,e);r&&(i.push(e),oe(e)&&h(e,[r?.uv?.x??0,r?.uv?.y??0],Object.keys(this.eventsPerObjects[t]),e=>{i.push(e)}))})}this._prevObjects.length&&this._prevObjects.forEach(e=>{i.includes(e)||this.handleObjectMouseEventDispatchRelease(e,t)}),i.length&&i.forEach(e=>{this.handleObjectMouseEventDispatch(e,t)}),this._prevObjects=i}}handleObjectMouseEventDispatch(e,t){e.dispatchEvent({type:"beginEvent",eventName:t}),this.eventsPerObjects[t]?.[e.uuid]?.forEach(e=>{e.dispatch()})}handleObjectMouseEventDispatchRelease(e,t){e.dispatchEvent({type:"beginEvent",eventName:t}),this.eventsPerObjects[t]?.[e.uuid]?.forEach(e=>{e.dispatchRelease()})}handleKeyEvent(e,t,n=!1){this.objectsPerTypes[t].forEach(r=>{let i=this.eventsPerObjects[t][r.uuid];i.some(({data:t})=>"key"in t&&t.key===e.key)&&r.dispatchEvent({type:"beginEvent",eventName:t}),i.forEach(t=>{"key"in t.data&&t.data.key===e.key&&(n?t.dispatchRelease():t.dispatch(!0))})})}handleKeyEventHeld(e,t,n=!1){this.objectsPerTypes[t].forEach(r=>{this.eventsPerObjects[t][r.uuid].forEach(t=>{"key"in t.data&&t.data.key===e.key&&t.dispatchHeld(n)})})}},en=e=>!0===e?.isPlayAudioAction,tn=e=>!0===e?.isPauseAudioAction,nn=e=>!0===e?.isPlayVideoAction,rn=e=>!0===e?.isPauseVideoAction,sn=class{constructor(e,t,n,r,i,s){this.id=e,this.data=t,this.object=n,this.actions=Q(t,t.actions,r,i,s,n)}disconnect(){ee(this.actions)}dispatch(){this.actions.Transition.forEach(e=>{e.play()}),this.actions.Animation.forEach(e=>{e.play()}),this.actions.TimelineAnimation.forEach(e=>{e.play()}),this.actions.SwitchCamera.forEach(e=>{e.play()}),this.actions.SceneTransition.forEach(e=>{e.dispatch()}),this.actions.Reset.forEach(e=>e.dispatch()),this.actions.SetVariable.forEach(e=>e.checkConditions()),this.actions.SetVariable.forEach(e=>e.dispatch()),this.actions.DynamicVariablePlay.forEach(e=>e.dispatch()),this.actions.ClearLocalStorage.forEach(e=>e.dispatch()),this.actions.UserAPI.forEach(e=>e.dispatch()),this.actions.Create.forEach(e=>{e.dispatchFromStart()}),this.actions.Destroy.forEach(e=>{e.dispatchFromStart()})}dispatchAfter(e){this.actions.Audio.forEach(t=>{(t.interaction.data.triggerAfter??"any")===e&&(en(t.interaction)?t.interaction.audioPlayer?.play():tn(t.interaction)&&t.interaction.dispatch())}),this.actions.Video.forEach(t=>{let n=t.interaction.data.triggerAfter??"autoplay";n===e&&(nn(t.interaction)?t.interaction.play("autoplay"===n):rn(t.interaction)&&t.interaction.dispatch())}),this.actions.Particles.forEach(t=>{(t.data.triggerAfter??"any")===e&&t.dispatchBasic()})}async seekVideos(e){let t=[];this.actions.Video.forEach(n=>{"autoplay"===(n.interaction.data.triggerAfter??"autoplay")&&nn(n.interaction)&&t.push(n.interaction.seek(e))}),await Promise.all(t)}pauseVideos(){this.actions.Video.forEach(e=>{nn(e.interaction)&&e.interaction.pause()})}dispatchUserEvent(e){this.actions.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this,e.init())}),e?(this.actions.Transition.forEach(e=>e.reverseFromCurrent()),this.actions.Animation.forEach(e=>e.reverseFromCurrent()),this.actions.TimelineAnimation.forEach(e=>e.reverseFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.reverseFromCurrent())):(this.actions.Transition.forEach(e=>e.playFromCurrent()),this.actions.Animation.forEach(e=>e.playFromCurrent()),this.actions.TimelineAnimation.forEach(e=>e.playFromCurrent()),this.actions.SwitchCamera.forEach(e=>e.playFromCurrent())),this.actions.SceneTransition.forEach(e=>e.dispatch()),this.actions.Reset.forEach(e=>e.dispatch()),this.actions.SetVariable.forEach(e=>e.checkConditions()),this.actions.SetVariable.forEach(e=>e.dispatch()),this.actions.DynamicVariablePlay.forEach(e=>e.dispatch()),this.actions.ClearLocalStorage.forEach(e=>e.dispatch()),this.actions.UserAPI.forEach(e=>e.dispatch()),this.actions.Create.forEach(e=>{e.dispatch()}),this.actions.Destroy.forEach(e=>{e.dispatch()}),this.actions.Audio.forEach(e=>{en(e.interaction)?e.interaction.audioPlayer?.play():tn(e.interaction)&&e.interaction.dispatch()}),this.actions.Video.forEach(e=>{nn(e.interaction)?e.interaction.play():rn(e.interaction)&&e.interaction.dispatch()}),this.actions.Particles.forEach(e=>{e.dispatchBasic()})}},an=class extends v{constructor(e,t){super(e),this.eventManager=t,this.eventsPerObject=new Map,this.eventsAfterPerObject=new Map,this.onMouseDown=()=>{[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>{e.dispatchAfter("mouseDown")})})},this.onKeyDown=()=>{[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>{e.dispatchAfter("keyDown")})})},this.onAny=()=>{let{domElement:e,isExport:t}=this.eventContext,n=t?document:e;n.removeEventListener("pointerdown",this.onAny),n.removeEventListener("mousedown",this.onAny),document.removeEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>{e.dispatchAfter("any")})})},this.onSceneTransitionAudioVideoPlay=()=>{[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>{e.actions.Audio.forEach(e=>{en(e.interaction)&&e.interaction.audioPlayer?.play()}),e.actions.Video.forEach(e=>{let t=e.interaction.data.triggerAfter??"autoplay";nn(e.interaction)&&e.interaction.play("autoplay"===t)}),e.actions.Particles.forEach(e=>{e.dispatchBasic()})})})},this.onPlay=()=>{[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>{e.dispatchAfter("autoplay")})})},this.seekVideos=async e=>{let t=[];[...this.eventsAfterPerObject.entries()].forEach(([n,r])=>{!n.data.visible||r.forEach(n=>{t.push(n.seekVideos(e))})}),await Promise.all(t)},this.pauseVideos=()=>{[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{t.forEach(e=>{e.pauseVideos()})})},this.onUserEvent=({eventName:e,target:t,reverse:n})=>{if(!e||!t)return;let r=m(e);r&&"Start"===r&&(ae(t)||t.dispatchEvent({type:"beginEvent",eventName:"Start"}),this.eventsPerObject.get(t)?.forEach(e=>{e.dispatchUserEvent(n)}),this.eventsAfterPerObject.get(t)?.forEach(e=>{e.dispatchUserEvent(n)}))}}connect(){let{sharedAssets:e,page:t}=this.eventContext,n=n=>{if(n.data?.events.length)for(let{id:r,data:i}of n.data.events){if(i.disabled||"Start"!==i.type)continue;let s=new sn(r,i,n,t,e,this.eventManager);(s.actions.Transition.length||s.actions.TimelineAnimation.length||s.actions.Animation.length||s.actions.SwitchCamera.length||s.actions.Create.length||s.actions.Destroy.length||s.actions.SceneTransition.length||s.actions.Reset.length||s.actions.SetVariable.length||s.actions.DynamicVariablePlay.length||s.actions.ClearLocalStorage.length||s.actions.UserAPI.length)&&(this.eventsPerObject.has(n)?this.eventsPerObject.get(n)?.push(s):this.eventsPerObject.set(n,[s])),s.actions.Audio.length&&(this.eventsAfterPerObject.has(n)?this.eventsAfterPerObject.get(n)?.push(s):this.eventsAfterPerObject.set(n,[s])),s.actions.Video.length&&(this.hasVideoAction=!0,this.eventsAfterPerObject.has(n)?this.eventsAfterPerObject.get(n)?.push(s):this.eventsAfterPerObject.set(n,[s])),s.actions.Particles.length&&(this.eventsAfterPerObject.has(n)?this.eventsAfterPerObject.get(n)?.push(s):this.eventsAfterPerObject.set(n,[s]))}};if(t.traverseEntity(e=>{(oe(e)||e instanceof A)&&e.frame?.traverse(e=>{n(e)}),n(e)}),[...this.eventsAfterPerObject.values()].some(e=>e.length)){if(0===this.eventManager.activateCount){let{domElement:e,isExport:t}=this.eventContext,n=t?document:e;n.addEventListener("pointerdown",this.onMouseDown,{once:!0}),n.addEventListener("mousedown",this.onMouseDown,{once:!0}),document.addEventListener("keydown",this.onKeyDown,{once:!0}),n.addEventListener("pointerdown",this.onAny),n.addEventListener("mousedown",this.onAny),document.addEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.addEventListener("userEvent",this.onUserEvent)})}else this.onSceneTransitionAudioVideoPlay();this.onPlay()}[...this.eventsPerObject.entries()].forEach(([e,t])=>{e.dispatchEvent({type:"beginEvent",eventName:"Start"}),t.forEach(e=>e.dispatch()),e.addEventListener("userEvent",this.onUserEvent)})}disconnect(){if([...this.eventsAfterPerObject.values()].some(e=>e.length)){let{domElement:e,isExport:t}=this.eventContext,n=t?document:e;n.removeEventListener("pointerdown",this.onMouseDown),n.removeEventListener("mousedown",this.onMouseDown),document.removeEventListener("keydown",this.onKeyDown),n.removeEventListener("pointerdown",this.onAny),n.removeEventListener("mousedown",this.onAny),document.removeEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach(([e,t])=>{e.removeEventListener("userEvent",this.onUserEvent),t.forEach(e=>e.disconnect())})}[...this.eventsPerObject.entries()].forEach(([e,t])=>{e.removeEventListener("userEvent",this.onUserEvent),t.forEach(e=>e.disconnect())}),this.eventsPerObject.clear(),this.eventsAfterPerObject.clear()}},on=class{constructor(e,t,n,r,i){this.publish=e,this.controlsManager=t,this.animationControls=n,this.eventContext=r,this.sharedVariables=i,this.isEnabled=!1,this.activateCount=0,this.needsMouse=!1,this.needsRaycast=!1,this.onTouchMovePreventScroll=e=>{let t=window.parent!==window,n=document.documentElement.scrollHeight>document.documentElement.clientHeight||document.documentElement.scrollWidth>document.documentElement.clientWidth;(e.touches.length>1||this.preventTouchScroll||!1===t&&!1===n)&&e.preventDefault()},this.onMouseWheelPreventScroll=e=>{this.preventScroll&&e.preventDefault()},this.onMouseMove=e=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(e),pressed:e.buttons>0}},this.onMouseDown=e=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(e),pressed:!0}},this.onMouseUp=e=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(e),pressed:!1}},this.getMousePosition=e=>{let{domRect:t}=this.eventContext,{pageX:n,pageY:r}=e.touches?.length>0?e.touches[0]:e;return{x:n-(t.left+window.scrollX),y:r-(t.top+window.scrollY)}},this.stopRaycast=e.stopRaycast,this.preventScroll=e.preventScroll,this.preventTouchScroll=e.preventTouchScroll,this.hideCursor=e.hideCursor,this.requestRender=r.requestRender}warnMissingEventFeatures(){this.eventContext.page.traverseEntity(e=>{for(let t of e.dataPatched.events){if(!0===t.data.disabled)continue;let e=t.data.type;if(void 0!==this.handlers[e])continue;let n=Z[e];void 0!==n&&he(n,`a "${e}" event`)}})}activate(e=!1){if(this.isEnabled)return;this.isEnabled=!0,this.initializeActionsDependentStates(),this.needsMouse&&(this.eventContext.domElement.addEventListener("pointermove",this.onMouseMove),this.eventContext.domElement.addEventListener("pointerdown",this.onMouseDown));let t={eventContext:this.eventContext,eventManager:this,sharedVariables:this.sharedVariables,needsMouse:this.needsMouse,needsRaycast:this.needsRaycast};this.handlers={};let n=(e,n)=>{let r=y(e);void 0!==r?this.handlers[e]=r(t):void 0!==n&&(this.handlers[e]=n())};n("Spline",()=>new f(this.eventContext)),n("VariableChange"),n("API"),n("WEBHOOK"),n("AIAssistantListener"),n("AIAssistantTrigger"),n("Conditional"),n("Start",()=>new an(this.eventContext,this)),n("Basic",()=>new Qt(this.eventContext,this,this.needsRaycast)),n("MouseHover"),n("Scroll"),n("Follow"),n("DragDrop"),n("LookAt"),n("Resize"),n("Textfields"),this.warnMissingEventFeatures();let{page:r,domElement:i}=this.eventContext;this.hideCursor&&(i.style.cursor="none"),r.traverseEntity(e=>{e.addEventListener("requestRender",this.requestRender)}),Object.values(this.handlers).forEach(e=>e.connect()),i.addEventListener("wheel",this.onMouseWheelPreventScroll),i.addEventListener("touchmove",this.onTouchMovePreventScroll),this.activateCount++,e||this.eventContext.sharedAssets.openAIRealtime?.connect()}deactivate(e=!1){if(!this.isEnabled)return;this.isEnabled=!1,this.eventContext.domElement.removeEventListener("pointermove",this.onMouseMove),this.eventContext.domElement.removeEventListener("pointerdown",this.onMouseDown),this.eventContext.domElement.removeEventListener("pointerup",this.onMouseUp),this.eventContext.sharedAssets.mouseProperty=null,this.eventContext.sharedAssets.raycastProperty=null;let{page:t,domElement:n}=this.eventContext;n.style.cursor="",Object.values(this.handlers).forEach(e=>e.disconnect()),this.controlsManager.gameControl?.disposeActions(),this.controlsManager.disconnectEvents(),t.traverseEntity(e=>{e.removeEventListener("requestRender",this.requestRender),e.destroyedInAction=!1}),n.removeEventListener("touchmove",this.onTouchMovePreventScroll),n.removeEventListener("wheel",this.onMouseWheelPreventScroll),this.animationControls.onExitPlayMode(),e||this.eventContext.sharedAssets.openAIRealtime?.disconnect()}dispose(){this.deactivate(),Object.values(this.handlers).forEach(e=>e.dispose())}get isPaused(){return this.isEnabled}pause(){this.deactivate()}resume(){this.activate()}reset(){this.deactivate(!0),this.activate(!0),this.controlsManager.deactivate(),this.controlsManager.activate(this),this.controlsManager.page.updateMatrixWorld(!0),this.controlsManager.rebuildBVH()}updateUseWindowEvents(e){let t=this.isEnabled;t&&this.deactivate(),this.eventContext.useWindowEvents=e,t&&this.activate()}initializeActionsDependentStates(){let e=this.eventContext.sharedAssets;e.resetDynamicVariablePlayState();let t=n=>{if("Conditional"===n.data.type&&(n.data.ifActions.forEach(t),n.data.elseActions.forEach(t)),"Conditional"===n.data.type||"SetVariable"===n.data.type)for(let e of"Conditional"===n.data.type?n.data.condition:n.data.expression)"id"in e&&Array.isArray(e.id)&&("mouse"===e.id[0]&&(this.needsMouse=!0),"raycast"===e.id[0]&&(this.needsRaycast=!0));"DynamicVariablePlay"===n.data.type&&""!==n.data.variableId&&("Play"===n.data.mode||"PlayPause"===n.data.mode||"Toggle"===n.data.mode)&&e.setDynamicVariablePlayState(n.data.variableId,"Stopped")};this.eventContext.page.traverseEntity(e=>{if(e.data?.events.length)for(let n of e.data.events)if("VariableChange"===n.data.type&&("mouseProperty"===n.data.variableId&&(this.needsMouse=!0),"raycastProperty"===n.data.variableId&&(this.needsRaycast=!0)),"Conditional"===n.data.type)for(let e of["inActions","outActions"])n.data[e].forEach(t);else if("DragDrop"===n.data.type)for(let e of["drag","drop"])n.data.dragDropActions[e].forEach(t);else if("GameControl"===n.data.type)for(let e of["idle","move","jump","run"])n.data.gameActions[e].forEach(t);else if("Resize"===n.data.type)for(let e of n.data.breakpoints)e.data.actions.forEach(t);else"LookAt"===n.data.type||"API"===n.data.type||n.data.actions.forEach(t)})}},ln=class{constructor(e,t,n,r){this.enableResponsive=!1,this._renderer=e,this._camera=t,this._frameSize=(new He).copy(n),this._fov=r??t.fov}set frameSize(e){this._frameSize.copy(e)}setRenderSize(e,t){this._renderSize=void 0===e||void 0===t?void 0:new He(e,t)}updateRenderer(){if(!this._renderer)return;let e=this._renderSize??this._frameSize;this._renderer.setSize(e.x,e.y)}updateViewport(){if(!this._renderer||!this._camera||"PerspectiveCamera"!==this._camera.cameraType)return;let e=this._renderSize??this._frameSize;this._renderer.setViewport(0,0,e.x,e.y)}updateCamera(){!this._camera||("PerspectiveCamera"===this._camera.cameraType?(this._camera.aspect=this._frameSize.x/this._frameSize.y,this._camera.updateProjectionMatrix()):this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y,this.enableResponsive))}setCamera(e){this._camera=e,this._fov=e.fov}revert(){let e=window.innerWidth,t=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,e,t),this._renderer.setSize(e,t)),this._camera&&(this._camera.aspect=e/t,this._camera.fov=this._fov,this._camera.setViewplaneSize(e,t,this.enableResponsive),this._camera.updateProjectionMatrix())}},cn=["particles","hair","shape-blends","vector-shapes","3d-paths","cloners","components","text","ui-2d","game-controls","collision-bvh","transitions"];function hn(e,t){if("Page"===e.type){let n=e.timelines;(void 0===n||Object.keys(n).length>0)&&t.add("timeline")}switch(e.type){case"Particle":case"ParticleCollider":t.add("particles");break;case"Hair":t.add("hair");break;case"Page":{null!=e.publish?.gameControlObject&&t.add("game-controls"),(null!=e.uiScene||void 0!==e.uiFrame)&&t.add("ui-2d");let n=e.uiScene?.objects;if(void 0!==n){if("function"!=typeof n.traverse)throw new Error("unrecognized uiScene shape");n.traverse((e,n)=>{hn(n,t)})}break}}switch(e.geometry?.type){case"ShapeBlendGeometry":t.add("shape-blends");break;case"VectorGeometry":t.add("vector-shapes");break;case"PathGeometry":t.add("3d-paths");break;case"UIGeometry":t.add("ui-2d");break;case"TextGeometry":case"InputGeometry":t.add("text")}("Component"===e.type||"Instance"===e.type)&&t.add("components"),null!=e.cloner&&t.add("cloners");let n=e.states;if(null!=n)if(Array.isArray(n))n.length>0&&t.add("transitions");else{if("object"!=typeof n)throw new Error("unrecognized states shape");Object.keys(n).length>0&&t.add("transitions")}}function dn(e,t){if(e&&(e.data&&hn(e.data,t),e.children))for(let n of e.children)dn(n,t)}var un,pn,mn=class{get sharedAssets(){return this.shared}constructor(e,t={},n=!0){this.shared=new B(e.shared,t,!0,n),this.scene=new a(e.scene,this.sharedAssets),this.shared.setEntityOpContext({scene:this.scene,shared:this.shared})}reset(e,t){this.scene.clearScene(),this.sharedAssets.reset(e.shared),this.scene.resetAfterClear(e.scene,this.sharedAssets)}resetPersonalCameraFromDocumentData(){for(let e of this.scene.children)e instanceof A&&!e.uiScene&&e.personalCamera.updateState(e.data.camera,{scene:this.scene,shared:this.shared})}dispose(){this.scene.dispose(),this.shared.dispose()}gc(){this.scene.releaseInstanceGroups(),this.shared.geometryCache.startGc(),this.shared.geometryCache2.startGc(),this.scene.traverseEntity(e=>{e instanceof z&&e.markGeometryAsReachable(this.shared)}),this.shared.geometryCache.endGc(),this.shared.geometryCache2.endGc()}},fn="vertexOrder";function vn(e){return pn||(pn=import("./runtime-DRACOLoader-SDMMLQLV.js").then(({DRACOLoader:t})=>((un=new t).setDecoderPath(void 0!==e?`${e}/`:"https://www.gstatic.com/draco/versioned/decoders/1.5.2/").preload(),un.decoderPending))),pn}async function yn(e){if(un){let t,n={attributeIDs:{...un.defaultAttributeIDs,[fn]:"GENERIC"},attributeTypes:{...un.defaultAttributeTypes,[fn]:"Uint32Array"},useUniqueIDs:!1};try{t=await un.decodeGeometry(new Int8Array(e).buffer,n)}catch(e){console.error(e)}if(t)return function(e){let t=e.attributes.find(e=>e.name===fn);if(!t)return e;let n=t.array,r=n.length,i=0;for(let e=0;e<r;e++)i=Math.max(i,n[e]+1);let s,a=e.attributes.filter(e=>e!==t).map(({name:e,itemSize:t,array:s})=>{let a=new Float32Array(i*t);for(let e=0;e<r;e++){let r=n[e]*t,i=e*t;for(let e=0;e<t;e++)a[r+e]=s[i+e]}return{name:e,itemSize:t,array:a}});if(e.index){let t=e.index.array,r=new Uint32Array(t.length);for(let e=0;e<t.length;e++)r[e]=n[t[e]];s={array:r}}return{index:s,attributes:a}}({index:t.index?{array:t.index.array}:void 0,attributes:Object.entries(t.attributes).map(([e,t])=>({name:e,itemSize:t.itemSize,array:t.array}))})}return null}async function bn(e){for(let t of e){let e=await yn(t.geometry.data.draco);if(e){let n=t.geometry.data;e.index&&(n.index={array:e.index.array,itemSize:1,normalized:!1,type:"Uint32Array"});let r={};e.attributes.forEach(({name:e,array:t,itemSize:n})=>{r[e]={array:t,itemSize:n,type:"Float32Array",normalized:!1}}),n.attributes=r,n.draco=void 0}}}var gn={bloom:()=>import("./runtime-bloom-UMJG5YKZ.js"),chromaticAberration:()=>import("./runtime-chromaticAberration-X46NQTBB.js"),vignette:()=>import("./runtime-vignette-S4Z7IMQ5.js"),noise:()=>import("./runtime-noise-FLMWYKTL.js"),hueSaturation:()=>import("./runtime-hueSaturation-TZ5VQY72.js"),brightnessContrast:()=>import("./runtime-brightnessContrast-LRDMKXC2.js"),depthOfField:()=>import("./runtime-depthOfField-DSE6YVZ4.js"),pixelation:()=>import("./runtime-pixelation-AOFGI5XX.js")},wn={bloom:()=>import("./runtime-fxBloom-4HB5FTK3.js"),depthOfField:()=>import("./runtime-fxDepthOfField-URCQCIRP.js")};function En(e,t,n){return Promise.all(e.map(e=>t[e]?.().catch(t=>{console.warn(`[spline] Failed to load the ${e} postprocessing effect (${n}); the effect will be skipped.`,t)}))).then(()=>{})}function _n(e){return En(e,gn,"webgl")}var jn=new WeakMap,Pn=new WeakMap;function Mn(e,t,n){let r=i=>{e.removeEventListener(t,r,!0),i.stopImmediatePropagation(),n(i)};return e.addEventListener(t,r,!0),()=>e.removeEventListener(t,r,!0)}var Cn=rt(it(),1);function On(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function xn(e){return{id:e.uuid,name:e.name,type:e.object.data?.type??e.object.type,visible:!1!==e.playModeVisible,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x*Fe.RAD2DEG,y:e.rotation.y*Fe.RAD2DEG,z:e.rotation.z*Fe.RAD2DEG},scale:{x:e.scale.x,y:e.scale.y,z:e.scale.z},spawned:!0}}function An(e){return{id:e.uuid,name:e.name,type:e.type??"Object",visible:e.visible,position:{x:e.position.x,y:e.position.y,z:e.position.z},rotation:{x:e.rotation.x*Fe.RAD2DEG,y:e.rotation.y*Fe.RAD2DEG,z:e.rotation.z*Fe.RAD2DEG},scale:{x:e.scale.x,y:e.scale.y,z:e.scale.z}}}function Sn(e,n,r){let i=t=>e.findObjectById(t)??e.findObjectByName(t),s=new Map,a=e=>{let t=s.get(e);if(t)return t;for(let t of s.values())if(t.name===e)return t};return{setVariable:(t,n)=>t in e.getVariables()?(e.setVariable(t,n),{ok:!0}):{ok:!1,warning:`spline.setVariable: no variable named "${t}" in this scene.`},getVariable:t=>e.getVariable(t),getVariables:()=>e.getVariables(),getAllObjects:()=>e.getAllObjects().map(An),findObject:e=>{let t=i(e);return t?An(t):void 0},getGeometry:(e,t)=>{if(!r)return{warning:"spline.getGeometry: not available in this runtime integration."};let n=a(e),s=n?n.object:(()=>{let t=i(e);return t?r.findEntity(t.uuid):void 0})();if(!s)return{warning:`spline.getGeometry: no object named "${e}" (names/ids come from getAllObjects).`};let o,l=n??s;"world"===t.space&&(l.updateWorldMatrix?.(!0,!1),o=l.matrixWorld?.elements);let c=function(e,t){let n=e?.getAttribute("position");if(!n||!n.count)return null;let r=n.count,i=t??null,s=e.getIndex?.()??null,a=Math.floor((s?s.count:r)/3),o=1/0,l=1/0,c=1/0,h=-1/0,d=-1/0,u=-1/0,p=new Float32Array(3*r);for(let e=0;e<r;e++){let t=n.getX(e),r=n.getY(e),s=n.getZ(e);i&&([t,r,s]=Ft(i,t,r,s)),t<o&&(o=t),r<l&&(l=r),s<c&&(c=s),t>h&&(h=t),r>d&&(d=r),s>u&&(u=s),p[3*e]=t,p[3*e+1]=r,p[3*e+2]=s}let m={space:i?"world":"local",vertexCount:r,triangleCount:a,indexed:null!==s,bounds:{min:[o,l,c],max:[h,d,u],size:[h-o,d-l,u-c]},vertices:p};if(s){let e=new Uint32Array(s.count);for(let t=0;t<s.count;t++)e[t]=s.getX(t);m.indices=e}let f=e.getAttribute("normal");if(f&&f.count===r){let e=i?function(e){let t=e[0],n=e[4],r=e[8],i=e[1],s=e[5],a=e[9],o=e[2],l=e[6],c=e[10],h=t*(s*c-a*l)-n*(i*c-a*o)+r*(i*l-s*o);if(!isFinite(h)||Math.abs(h)<1e-12)return null;let d=1/h,u=[(s*c-a*l)*d,(r*l-n*c)*d,(n*a-r*s)*d,(a*o-i*c)*d,(t*c-r*o)*d,(r*i-t*a)*d,(i*l-s*o)*d,(n*o-t*l)*d,(t*s-n*i)*d];return[u[0],u[3],u[6],u[1],u[4],u[7],u[2],u[5],u[8]]}(i):void 0;if(!i||e){let t=new Float32Array(3*r);for(let n=0;n<r;n++){let r=f.getX(n),i=f.getY(n),s=f.getZ(n);if(e){let t=e[0]*r+e[1]*i+e[2]*s,n=e[3]*r+e[4]*i+e[5]*s,a=e[6]*r+e[7]*i+e[8]*s,o=Math.hypot(t,n,a);o>1e-12?(r=t/o,i=n/o,s=a/o):(r=t,i=n,s=a)}t[3*n]=r,t[3*n+1]=i,t[3*n+2]=s}m.normals=t}}let v=e.getAttribute("uv");if(v&&v.count===r){let e=new Float32Array(2*r);for(let t=0;t<r;t++)e[2*t]=v.getX(t),e[2*t+1]=v.getY(t);m.uvs=e}return m}(s.geometry,o);return c?{data:{id:l.uuid,name:l.name,geometry:s.data?.geometry?.type,...c}}:{warning:`spline.getGeometry: "${l.name}" has no readable geometry — only meshes do (lights, cameras and groups have none; read a group's child meshes instead).`}},updateObject:(t,n)=>{let s=a(t);if(s){let{position:t,rotation:r,scale:i,visible:a}=n;return t&&("number"==typeof t.x&&(s.position.x=t.x),"number"==typeof t.y&&(s.position.y=t.y),"number"==typeof t.z&&(s.position.z=t.z)),r&&("number"==typeof r.x&&(s.rotation.x=r.x*Fe.DEG2RAD),"number"==typeof r.y&&(s.rotation.y=r.y*Fe.DEG2RAD),"number"==typeof r.z&&(s.rotation.z=r.z*Fe.DEG2RAD)),i&&("number"==typeof i.x&&(s.scale.x=i.x),"number"==typeof i.y&&(s.scale.y=i.y),"number"==typeof i.z&&(s.scale.z=i.z)),"boolean"==typeof a&&(s.playModeVisible=a),s.updateMatrix(),e.requestRender(),!0}let o=i(t);if(!o)return!1;let{position:l,rotation:c,scale:h,visible:d,geometry:u,material:p}=n;if(u&&"object"==typeof u&&r){let e=r.findEntity(o.uuid);if(e){let{vertices:t,normals:n,uvs:i,indices:s,...a}=u;On(t)&&r.shared.updateEntityGeometryVertices(e,{vertices:t,normals:On(n)?n:void 0,uvs:On(i)?i:void 0,indices:On(s)?s:void 0}),Object.keys(a).length>0&&r.shared.updateEntityGeometryParams(e,a)}}if(p&&"object"==typeof p&&r){let e=r.findEntity(o.uuid);e&&r.shared.updateEntityMaterialParams(e,p)}return l&&("number"==typeof l.x&&(o.position.x=l.x),"number"==typeof l.y&&(o.position.y=l.y),"number"==typeof l.z&&(o.position.z=l.z)),c&&("number"==typeof c.x&&(o.rotation.x=c.x*Fe.DEG2RAD),"number"==typeof c.y&&(o.rotation.y=c.y*Fe.DEG2RAD),"number"==typeof c.z&&(o.rotation.z=c.z*Fe.DEG2RAD)),h&&("number"==typeof h.x&&(o.scale.x=h.x),"number"==typeof h.y&&(o.scale.y=h.y),"number"==typeof h.z&&(o.scale.z=h.z)),"boolean"==typeof d&&(o.visible=d),e.requestRender(),!0},createObject:async(t,n)=>An(await e.createObject(t,n)),createCustomMaterial:t=>e.createCustomMaterial(t),getTexture:(e,t)=>{if(!r)return null;let n=i(e),s=n?r.findEntity(n.uuid):void 0;if(!s)return null;let a=r.shared.getEntityTexture(s,t??{});return a?{texture:a.texture,width:a.width,height:a.height,layer:a.layerType}:null},setMaterial:(t,n)=>e.setMaterial(t,n),cloneObject:(t,n)=>An(e.cloneObject(t,n)),removeObject:t=>e.removeObject(t),spawnObject:(t,n)=>{if(!r)return{warning:"spline.spawnObject: not available in this runtime integration."};let a=i(t),o=a?r.findEntity(a.uuid):void 0;if(!o)return{warning:`spline.spawnObject: no object named "${t}" to use as a template.`};if(s.size>=500)return{warning:"spline.spawnObject: spawn budget reached (500 live copies) — destroyObject old copies (or reuse them) instead of spawning more."};let l=r.shared.spawnRuntimeClone(o,n??{});return l?(s.set(l.uuid,l),e.requestRender(),{object:xn(l)}):{warning:`spline.spawnObject: "${t}" cannot be spawned from.`}},destroyObject:t=>{let n=a(t);return!(!r||!n||(s.delete(n.uuid),r.shared.destroyRuntimeClone(n),e.requestRender(),0))},setInstanceTransforms:(t,n)=>{if(!r)return-1;let s=i(t),a=s?r.findEntity(s.uuid):void 0;if(!a)return-1;let o=r.shared.setEntityInstanceTransforms(a,n);return o>=0&&e.requestRender(),o},...t(()=>r?.getAnimationControls(),e=>{let t=i(e);return t?r?.findEntity(t.uuid):void 0}),emitEvent:(e,t,n)=>{let r=i(t);return r?(n?r.emitEventReverse(e):r.emitEvent(e),{ok:!0}):{ok:!1,warning:`spline.emitEvent: no object named "${t}".`}},requestRender:()=>e.requestRender(),addSplineEventListener:(t,n)=>{let r=e=>{n({target:{id:e.target?.id??"",name:e.target?.name??""}})};return e.addEventListener(t,r),()=>e.removeEventListener(t,r)},getCanvas:()=>n}}var kn=class{constructor(e,t,n){this.iframe=e,this.bridge=t,this.observer=n}static mount(e,t,n,r){if(typeof document>"u")return null;let i=t.parentElement;if(!i)return null;"static"===getComputedStyle(i).position&&(i.style.position="relative");let s=document.createElement("iframe");s.setAttribute("sandbox","allow-scripts allow-forms allow-pointer-lock"),s.title="Spline HTML content";let a=s.style;a.position="absolute",a.border="0",a.background="transparent",a.pointerEvents="auto",a.colorScheme="normal";let o=()=>{a.left=`${t.offsetLeft}px`,a.top=`${t.offsetTop}px`,a.width=`${t.offsetWidth}px`,a.height=`${t.offsetHeight}px`};o();let l=new ResizeObserver(o);l.observe(t),l.observe(i),s.srcdoc=function(e){let t=`<script>${Nt}<\/script>`,n=/<head(\s[^>]*)?>/i.exec(e);if(n){let r=n.index+n[0].length;return e.slice(0,r)+t+e.slice(r)}let r=/<html(\s[^>]*)?>/i.exec(e);if(r){let n=r.index+r[0].length;return e.slice(0,n)+`<head>${t}</head>`+e.slice(n)}return t+e}(n),i.insertBefore(s,t.nextSibling);let c=new Ht(s,Sn(e,t,r),(e,t)=>{"warn"===e?console.warn(`[spline html] ${t}`):"error"===e&&console.error(`[spline html] ${t}`)});return c.attach(),new kn(s,c,l)}dispose(){this.bridge.dispose(),this.observer.disconnect(),this.iframe.remove()}},Rn="data-spline-html-content",Tn=`\n[${Rn}] { pointer-events: none; }\n[${Rn}] > * { pointer-events: auto; }\n[${Rn}] [data-spline-passthrough] { pointer-events: none; }\n`,Dn=class{constructor(e,t,n,r,i,s){this.container=e,this.host=t,this.observer=n,this.spline=r,this.previousSplineGlobal=i,this.removeLateLifecycleShim=s}static mount(e,t,n,r){if(typeof document>"u")return null;let i=t.parentElement;if(!i)return null;"static"===getComputedStyle(i).position&&(i.style.position="relative");let s=document.createElement("div");s.setAttribute(Rn,"");let a=s.style;a.position="absolute",a.overflow="hidden";let o=()=>{a.left=`${t.offsetLeft}px`,a.top=`${t.offsetTop}px`,a.width=`${t.offsetWidth}px`,a.height=`${t.offsetHeight}px`};o();let l=new ResizeObserver(o);l.observe(t),l.observe(i);let c=document.createElement("style");c.textContent=Tn,s.appendChild(c);let h=(new DOMParser).parseFromString(n,"text/html"),d=Array.from(h.querySelectorAll("script"));for(let e of d)e.remove();for(let e of Array.from(h.head.children))("STYLE"===e.tagName||"LINK"===e.tagName&&"stylesheet"===e.rel)&&s.appendChild(e);for(;h.body.firstChild;)s.appendChild(h.body.firstChild);i.insertBefore(s,t.nextSibling);let u=new Map,p=new zt(Sn(e,t,r),(e,t)=>{"warn"===e?console.warn(`[spline html] ${t}`):"error"===e&&console.error(`[spline html] ${t}`)},(e,t)=>{let n=u.get(e);if(n)for(let e of n)try{e(t)}catch(e){console.error(e)}}),m=(e,t)=>{try{return Promise.resolve(p.execute(e,t))}catch(e){return Promise.reject(e)}},f={ready:Promise.resolve(),setVariable:(e,t)=>m("setVariable",[e,t]),setVariables:e=>m("setVariables",[e]),getVariable:e=>m("getVariable",[e]),getVariables:()=>m("getVariables",[]),getAllObjects:()=>m("getAllObjects",[]),findObjectByName:e=>m("findObjectByName",[e]),findObjectById:e=>m("findObjectById",[e]),getGeometry:(e,t)=>m("getGeometry",[e,t??{}]),updateObject:(e,t)=>m("updateObject",[e,t]),createObject:(e,t)=>m("createObject",[e,t??{}]),createCustomMaterial:e=>m("createCustomMaterial",[e]),getTexture:(e,t)=>m("getTexture",[e,t??{}]),setMaterial:(e,t)=>m("setMaterial",[e,t]),cloneObject:(e,t)=>m("cloneObject",[e,t??{}]),removeObject:e=>m("removeObject",[e]),spawnObject:(e,t)=>m("spawnObject",[e,t??{}]),destroyObject:e=>m("destroyObject",[e]),setInstanceTransforms:(e,t)=>m("setInstanceTransforms",[e,t??null]),getAnimations:e=>m("getAnimations",[e]),playAnimation:(e,t,n)=>m("playAnimation",[e,t,n]),pauseAnimation:(e,t)=>m("pauseAnimation",[e,t]),stopAnimation:(e,t)=>m("stopAnimation",[e,t]),emitEvent:(e,t)=>m("emitEvent",[e,t]),emitEventReverse:(e,t)=>m("emitEventReverse",[e,t]),requestRender:()=>m("requestRender",[]),addEventListener:(e,t)=>{if("function"!=typeof t)return;let n=u.get(e);n||(n=new Set,u.set(e,n),m("listenEvent",[e])),n.add(t)},removeEventListener:(e,t)=>{let n=u.get(e);!n||(n.delete(t),0===n.size&&(u.delete(e),m("unlistenEvent",[e])))}},v=window.spline;window.spline=f;let y=function(){if(typeof document>"u"||"loading"===document.readyState)return()=>{};let e=[],t=(t,n)=>{let r=new Set,i=t.addEventListener.bind(t),s=t.removeEventListener.bind(t);Object.defineProperty(t,"addEventListener",{configurable:!0,writable:!0,value:(e,s,a)=>{if(i(e,s,a),!n.includes(e)||null==s)return;let o={type:e,listener:s};r.add(o),queueMicrotask(()=>{!r.delete(o)||((e,t,n)=>{let r=new Event(n);try{"function"==typeof t?t.call(e,r):t.handleEvent?.(r)}catch(e){console.error(e)}})(t,o.listener,o.type)})}}),Object.defineProperty(t,"removeEventListener",{configurable:!0,writable:!0,value:(e,t,n)=>{s(e,t,n);for(let n of r)n.type===e&&n.listener===t&&r.delete(n)}}),e.push(()=>{delete t.addEventListener,delete t.removeEventListener,r.clear()})};t(document,["DOMContentLoaded"]),t(window,["load"]);let n=Object.getOwnPropertyDescriptor(window,"onload");return Object.defineProperty(window,"onload",{configurable:!0,get:()=>null,set:e=>{"function"==typeof e&&queueMicrotask(()=>{try{e.call(window,new Event("load"))}catch(e){console.error(e)}})}}),e.push(()=>{n?Object.defineProperty(window,"onload",n):delete window.onload}),()=>{for(let t of e)t()}}();for(let e of d){let t=document.createElement("script");for(let n of Array.from(e.attributes))t.setAttribute(n.name,n.value);e.src?t.async=!1:t.textContent=e.textContent,s.appendChild(t)}return new Dn(s,p,l,f,v,y)}dispose(){this.removeLateLifecycleShim(),this.host.dispose(),this.observer.disconnect(),this.container.remove(),window.spline===this.spline&&(window.spline=this.previousSplineGlobal)}};function Ln(e){return"object"==typeof e&&null!==e&&!0===e.isMaterial}function Vn(e){if("function"==typeof e.material)throw new Error("createObject: a (three) => material factory must be resolved to a material instance before object creation — this entry point does not support it.");if(!Ln(e.material))return{options:e};let t=e.material;if(!0===t.isNodeMaterial){let n=G()?.NodeMaterial;if(void 0!==n&&t instanceof n)return{options:{...e,material:void 0},material:t};throw new Error("createObject: this TSL NodeMaterial comes from your own three/webgpu module instance, which cannot compile in the runtime's bundled three. Build it with app.createCustomMaterial((three) => …) instead, or use a built-in material (MeshStandardMaterial, MeshBasicMaterial, …).")}if(!0===t.isShaderMaterial)throw new Error("createObject: a GLSL ShaderMaterial cannot compile on the WebGPU backend — port the shader to TSL with app.createCustomMaterial((three) => …), or use a built-in material (MeshStandardMaterial, …).");return{options:{...e,material:void 0},material:t}}var In=new Set(["name","parent","position","rotation","scale","visible","castShadow","receiveShadow","color","material"]),Gn="'Cube', 'Sphere', 'Plane', 'Rectangle', 'Ellipse', 'Triangle', 'Polygon', 'Star', 'Cone', 'Cylinder', 'Pyramid', 'Torus', 'TorusKnot', 'Dodecahedron', 'Icosahedron', 'Helix', 'Backdrop', 'Lathe', 'Text', 'CustomMesh', 'Group', 'PointLight', 'SpotLight', 'DirectionalLight'",Un={cube:"CubeGeometry",box:"CubeGeometry",sphere:"SphereGeometry",plane:"PlaneGeometry",rectangle:"RectangleGeometry",ellipse:"EllipseGeometry",circle:"EllipseGeometry",triangle:"TriangleGeometry",polygon:"PolygonGeometry",star:"StarGeometry",cone:"ConeGeometry",cylinder:"CylinderGeometry",pyramid:"PyramidGeometry",torus:"TorusGeometry",torusknot:"TorusKnotGeometry",dodecahedron:"DodecahedronGeometry",icosahedron:"IcosahedronGeometry",helix:"HelixGeometry",backdrop:"BackdropGeometry",lathe:"LatheGeometry",text:"TextGeometry",custommesh:"NonParametricGeometry",nonparametric:"NonParametricGeometry"},Kn={group:"Empty",empty:"Empty",pointlight:"PointLight",spotlight:"SpotLight",directionallight:"DirectionalLight"},Bn={shapeblend:"Shape Blends are built from member meshes in the editor and cannot be created empty.",path:"Path shapes need authored path data — clone an existing one with cloneObject() instead.",vector:"Vector shapes need authored shape data — clone an existing one with cloneObject() instead.",shape:"Vector shapes need authored shape data — clone an existing one with cloneObject() instead.",boolean:"Boolean operations are not creatable at runtime — clone an existing Boolean object with cloneObject() instead.",decal:"Decals need a surface to project onto — clone an existing Decal with cloneObject() instead.",ui:"UI objects need a 2D frame — clone an existing one with cloneObject() instead.",input:"Text inputs are not creatable at runtime — clone an existing one with cloneObject() instead.",particle:"Particle emitters are not creatable at runtime — clone an existing one with cloneObject() instead.",particlecollider:"Particle forces are not creatable at runtime — clone an existing one with cloneObject() instead.",hair:"Hair systems are not creatable at runtime — clone an existing one with cloneObject() instead.",camera:"Cameras are not creatable at runtime.",perspectivecamera:"Cameras are not creatable at runtime.",orthographiccamera:"Cameras are not creatable at runtime.",hemispherelight:"Hemisphere lights are not creatable at runtime.",splat:"Splats are not creatable at runtime.",page:"Pages are not creatable at runtime.",component:"Components are authored in the editor.",instance:"Instances are authored in the editor — clone an existing one with cloneObject() instead.",bone:"Bones are not creatable at runtime.",mesh:"pass the shape name directly, e.g. createObject('Cube')."},Nn={CubeGeometry:"Cube",SphereGeometry:"Sphere",PlaneGeometry:"Plane",RectangleGeometry:"Rectangle",EllipseGeometry:"Ellipse",TriangleGeometry:"Triangle",PolygonGeometry:"Pentagon",StarGeometry:"Star",ConeGeometry:"Cone",CylinderGeometry:"Cylinder",PyramidGeometry:"Pyramid",TorusGeometry:"Torus",TorusKnotGeometry:"Torus Knot",DodecahedronGeometry:"Dodecahedron",IcosahedronGeometry:"Icosahedron",HelixGeometry:"Helix",BackdropGeometry:"Backdrop",LatheGeometry:"Lathe",TextGeometry:"Text",NonParametricGeometry:"Custom Mesh"},Wn={Empty:"Group",PointLight:"Point Light",SpotLight:"Spot Light",DirectionalLight:"Directional Light"};function zn(e,t){return void 0===e?[t[0],t[1],t[2]]:Array.isArray(e)?[e[0]??t[0],e[1]??t[1],e[2]??t[2]]:[e.x??t[0],e.y??t[1],e.z??t[2]]}function Fn(e){return"number"==typeof e?[e,e,e]:zn(e,[1,1,1])}function Hn(e){let t=new N(0,0,0,1);return t.setStyle(e),{r:t.r,g:t.g,b:t.b}}function $n(e,t){let n=e.material??(void 0!==e.color?{color:e.color}:void 0);if(void 0===n)return Se.defaultColorMaterial(qn(Ke),"physical","layer1","layer2");if("string"==typeof n){for(let[e,r]of Object.entries(t.shared.materials))if(e===n||r.name===n)return e;if(function(e){let t=e.trim().toLowerCase();return/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)||/^(rgb|hsl)a?\(/.test(t)||void 0!==Ze.NAMES[t]}(n))return Se.defaultColorMaterial(Hn(n),"physical","layer1","layer2");throw new Error(`createObject: material '${n}' matches no shared material in this document (available: ${function(e){let t=Object.entries(e.shared.materials).map(([,e])=>`'${e.name}'`).filter(e=>"'undefined'"!==e);return t.length?t.join(", "):"(none)"}(t)}) and is not a valid CSS color.`)}if("function"==typeof n)throw new Error("createObject: a (three) => material factory must be resolved to a material instance before object creation — this entry point does not support it.");if(Ln(n))throw new Error("createObject: a three.js material instance cannot be stored in the document — this entry point does not support it.");let r=void 0!==n.color?Hn(n.color):qn(Ke),i=Se.defaultColorMaterial(r,"physical","layer1","layer2"),s=i.layers.find(e=>"light"===e.data.type);if(s){let e={};void 0!==n.roughness&&(e.roughness=n.roughness),void 0!==n.metalness&&(e.metalness=n.metalness),void 0!==n.reflectivity&&(e.reflectivity=n.reflectivity),Object.assign(s.data,e)}if(void 0!==n.alpha){let e=i.layers.find(e=>"color"===e.data.type);e&&Object.assign(e.data,{alpha:n.alpha})}return i}function qn(e){return{r:(e>>16&255)/255,g:(e>>8&255)/255,b:(255&e)/255}}function Yn(e){let t=Ve.defaultData("TextGeometry"),{text:n,...r}=e,i=r.fontSize;return void 0!==i&&void 0===r.width&&(r.width=350*i/16),void 0!==i&&void 0===r.height&&(r.height=50*i/16),Object.assign(t,r),void 0!==n&&Object.assign(t,{text:{textValue:String(n)}}),t}function Xn(e){return Array.isArray(e)?e:!ArrayBuffer.isView(e)||e instanceof DataView?null:Array.from(e)}function Zn(e,t){return qt({userData:{type:e,...L[e].normalizeInputs({parameters:t})}})}function Jn(e,t,n){let{objectType:r,geometryType:i}=e,s=function(e){let t={};for(let[n,r]of Object.entries(e))!In.has(n)&&void 0!==r&&(t[n]=r);return t}(t),a={states:new ke,events:new ke};if("Mesh"===r&&i){if("NonParametricGeometry"===i){let{geometry:e,doubleSide:r}=function(e){let t=Xn(e.vertices);if(!t||t.length<9||t.length%3!=0)throw new Error("createObject('CustomMesh'): `vertices` must be a flat number[] of x,y,z triples (length a multiple of 3, at least one triangle).");let n=t.length/3;if(n>6e4)throw new Error(`createObject('CustomMesh'): too many vertices (${n}); keep it under 60000.`);let r=Xn(e.indices);if(r&&r.length){let e=r.find(e=>!Number.isInteger(e)||e<0||e>=n);if(void 0!==e)throw new Error(`createObject('CustomMesh'): index ${e} is out of range (mesh has ${n} vertices).`)}else r=null;let i=new tt;i.setAttribute("position",new et(t,3));let s=Xn(e.normals),a=null!==s&&s.length===t.length;a&&i.setAttribute("normal",new et(s,3));let o=Xn(e.uvs);o&&o.length===2*n&&i.setAttribute("uv",new et(o,2));let l=!1;if(!a){let e=r??Array.from({length:n},(e,t)=>t),{closed:i,inverted:s}=function(e,t){let n=e.length/3,r=new Map,i=new Array(n);for(let t=0;t<n;t++){let n=`${Math.round(1e4*e[3*t])},${Math.round(1e4*e[3*t+1])},${Math.round(1e4*e[3*t+2])}`,s=r.get(n);void 0===s?(r.set(n,t),i[t]=t):i[t]=s}let s=new Map;for(let e=0;e+2<t.length;e+=3){let n=i[t[e]],r=i[t[e+1]],a=i[t[e+2]];for(let[e,t]of[[n,r],[r,a],[a,n]]){if(e===t)continue;let n=e<t?e+"_"+t:t+"_"+e;s.set(n,(s.get(n)??0)+1)}}let a=s.size>0;for(let e of s.values())if(2!==e){a=!1;break}if(!a)return{closed:!1,inverted:!1};let o=0;for(let n=0;n+2<t.length;n+=3){let r=3*t[n],i=3*t[n+1],s=3*t[n+2],a=e[r],l=e[r+1],c=e[r+2],h=e[i],d=e[i+1],u=e[i+2],p=e[s],m=e[s+1],f=e[s+2];o+=a*(d*f-u*m)+l*(u*p-h*f)+c*(h*m-d*p)}return{closed:!0,inverted:o<0}}(t,e);if(i&&s){for(let t=0;t+2<e.length;t+=3){let n=e[t+1];e[t+1]=e[t+2],e[t+2]=n}r=e}else i||(l=!0)}return r&&i.setIndex(r),a||i.computeVertexNormals(),{geometry:qt({userData:{type:"NonParametricGeometry",parameters:{subdivisions:0}},data:i.toJSON().data}),doubleSide:l}}(s);Object.assign(a,Be.defaultData,{geometry:e,materials:[$n(t,n)]}),r&&(a.side=2)}else Object.assign(a,Be.defaultData,{geometry:"TextGeometry"===i?Yn(s):Zn(i,s),material:$n(t,n)});void 0!==t.castShadow&&(a.castShadow=t.castShadow),void 0!==t.receiveShadow&&(a.receiveShadow=t.receiveShadow)}else"Empty"===r?Object.assign(a,Ue.defaultData):(Object.assign(a,We.defaultData(r),s),void 0!==t.color&&(a.color=Hn(t.color)));a.visible=t.visible??!0,a.position=zn(t.position,[0,0,0]),a.rotation=zn(t.rotation,[0,0,0]),a.scale=Fn(t.scale);let o=(i&&Nn[i])??Wn[r]??r;return a.name=t.name??Qn(o,n.scene.objects),a}function Qn(e,t){let n=new Set;if(t.traverse((e,t)=>{n.add(t.name??"")}),!n.has(e))return e;let r=2;for(;n.has(`${e} ${r}`);)r++;return`${e} ${r}`}function er(e,t){let n=Fe.generateUUID();if("Component"===e.data.type)return{data:{...me.fromComponentData(e),name:e.data.name+" Instance"},id:n,fi:e.fi,children:[]};t[e.id]=n;let r=e.data;return"Empty"===r.type&&r.animations?.length&&(r={...r,animations:r.animations.map(([e,t,n])=>{let r=Fe.generateUUID(),i=n.indexOf(e);return[r,t,-1!==i?n.slice(0,i)+r+n.slice(i+e.length):n]})}),{...e,id:n,data:r,children:e.children.map(e=>er(e,t))}}function tr(e){let t={},n=er(e,t);return Te(n,t)}function nr(e){let t=Array.isArray(e)?e[0]:e,n=t.layers?.map(rr)??[],r=t.layers?.find(e=>"light"===e.type);return{layers:n,alpha:r?.node.alphaOverride?.value??1}}function rr(e){return"texture"===e.type||"video"===e.type||"matcap"===e.type?{...e.data,updateTexture:t=>e.color.texture.image.updateSrc(t)}:{...e.data}}var ir=new N(0,0,0,1),sr={color:["color"],cavity:[],dust:["color"],fresnel:["color"],normal:[],gradient:["colors"],depth:["colors"],texture:[],video:[],noise:["colorA","colorB","colorC","colorD"],toon:["colors","shadowColor"],outline:["outlineColor","contourColor"],transmission:["attenuationColor"],reflection:[],matcap:[],pattern:["colorA","colorB"],vertexColor:[],light:[],displace:[],rainbow:[],particle:[]},ar=new He;function or(e){let t=new N(0,0,0,1);try{t.setStyle(e)}catch(e){console.error(e)}return t}var lr=class{constructor(e,{renderOnDemand:t,renderMode:n="auto",wasmPath:r,renderer:i,htmlContentMode:s="sandbox"}={}){if(this._rendererBackend="webgl",this._rendererAuto=!1,this._rendererConfigured=!1,this._startOrder=0,this._claimedOrder=0,this._viewportMode=1,this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._proxyObjectCache=new Map,this._htmlContentMode="sandbox",this._variablesCache=new Map,this._isPaused=!1,this._renderRequested=!1,this._skipRender=!1,this.time=performance.now(),this.dt=0,this.currentTAAFrame=0,this.disposed=!1,this._requestRenderAutoMode=()=>{this._skipRender=!1},this.requestRender=()=>{this._renderRequested=!0},this.render=e=>{if(this.time=e,this._lastTime&&(this.dt=this.time-this._lastTime),this._lastTime=this.time,this._perfs?.start(),this._renderer)if(this._isPaused||!("manual"===this.renderMode&&!this._renderRequested||"auto"===this.renderMode&&this._skipRender)){if(this._renderRequested=!1,this._skipRender=!0,this._controls&&(this._skipRender=this._controls.update(this.dt)??!1),this._eventManager&&(this._eventManager.handlers?.Start?.hasVideoAction||this._eventManager.handlers?.Basic?.hasVideoAction||this._eventManager.handlers?.Conditional?.hasVideoAction)&&(this._skipRender=!1),this._animationControls?.update(this.dt),this._skipRender?(this.currentTAAFrame++,this.currentTAAFrame<K?this._skipRender=!1:this.currentTAAFrame=0):this.currentTAAFrame=0,this._scene?.traverseVisibleEntity(e=>{"ParticleSystem"===e.type&&(e.update(this.dt),this._skipRender=!1),ie(e)&&(!0!==this._renderer?.isWebGPUSplineRenderer&&e.warnClassicFallbackOnce(),e.isSimulating&&(e.update(this.dt),this._skipRender=!1))}),this._scene&&this._scene.activeCamera!==this._camera&&(this._camera=this._scene.activeCamera),this._eventManager?.isEnabled&&(this._eventManager.handlers?.Follow?.onAnimationFrameDamping(),this._eventManager.handlers?.LookAt?.onAnimationFrameDamping(),this._eventManager.handlers?.DragDrop?.onAnimationFrameDamping()),this._scene&&this._camera){if(this._scene.pathConstraints.applyConstraints(this._scene),this._renderer.sceneTransitionTimeRemaining>0){this._renderer.sceneTransitionTimeRemaining-=this.dt;let e=Math.min(1,1-this._renderer.sceneTransitionTimeRemaining/this._renderer.sceneTransitionDuration);this._renderer.pipeline.sceneTransitionPass.uniforms.mixRatio.value=e,this._skipRender=!1}else this._renderer.pipeline.sceneTransitionFromTexture=null;this._renderer.renderSplineScene(this._scene,this._camera),!0===this._renderer.lastFrameIncomplete&&(this._skipRender=!1),!0===this._renderer.skyAnimationActive&&(this._skipRender=!1)}this.canvas.dispatchEvent(this._renderedEvent),this._perfs?.end()}else this._perfs?.end();else this._perfs?.end()},this._resize=e=>{if(this._renderer){if(1===this._viewportMode&&this._frameView&&(this._frameView.frameSize=ar.set(this._viewportWidth,this._viewportHeight)),e){let e=this._viewportWidth,t=this._viewportHeight;this._renderer.setSize(e-1,t-1,!1),this._renderer.setSize(e,t,!1)}else this._renderer.setSize(this._viewportWidth,this._viewportHeight,!1);this._camera=this._scene?.activeCamera,this._scene?.updateViewPlaneSize(this._frameView?.frameSize?.x??this._viewportWidth,this._frameView?.frameSize?.y??this._viewportHeight,this._frameView?.enableResponsive??!1),this._camera&&(this._frameView?.setCamera(this._camera),this._frameView?.updateCamera(),"PerspectiveCamera"===this._camera.cameraType&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()),this.eventManager&&(this.eventManager.eventContext.domRect=this.canvas.getBoundingClientRect()),this._requestRenderAutoMode()}},this._debouncedResize=ne(this._resize,10),this._onScroll=e=>{this.eventManager&&(this.eventManager.eventContext.domRect=this.canvas.getBoundingClientRect())},this.canvas=e,this._htmlContentMode=s,this.renderMode=t?"auto":n,void 0!==r&&(this._wasmPath=re(r,"/")),this._rendererBackend=i??"webgl",void 0===i){let e=null;try{e=new URLSearchParams(window.location.search).get("renderer")}catch{}"webgpu"===e||"webgl"===e||"webgl2"===e?this._rendererBackend="webgl2"===e?"webgl":e:(this._rendererAuto=!0,this._rendererBackend=typeof navigator<"u"&&"gpu"in navigator?"webgpu":"webgl")}this._renderedEvent=new CustomEvent("rendered",{bubbles:!0}),Object.defineProperty(this._renderedEvent,"target",{writable:!1,value:this}),window.location.search.includes("perfs")&&import("./runtime-Perfs-KMJFDYHU.js").then(({Perfs:e})=>{this._perfs=new e({x:10,y:10})}),O(e)}async _ensureRenderer(){return this._renderer?this._renderer:(this._rendererInit||(this._rendererInit=this._initRenderer().then(e=>(this._rendererInit=void 0,e&&(this._renderer=e),e),e=>{throw this._rendererInit=void 0,e})),this._rendererInit)}async _initRenderer(){if(this.disposed)return null;let e=await this._createRenderer();return this.disposed?(this._disposeRenderer(e),null):e}_disposeRenderer(e){let t=function(e){let t=e.backend;if(void 0!==t)return!0===t.isWebGLBackend?t.gl??null:null;let n=e.getContext,r="function"==typeof n?n.call(e):null;return r&&"function"==typeof r.getExtension?r:null}(e);if(t&&!function(e,t){return Pn.get(e)===t}(this.canvas,this))return n=e,void(!0===n.backend?.isWebGLBackend||e.dispose());var n;let r=t?function(e,t){let n=t.getExtension("WEBGL_lose_context");if(!n||t.isContextLost())return()=>{};let r=()=>{},i=new Promise(t=>{r=Mn(e,"webglcontextlost",e=>{e.preventDefault(),t(n)})});return jn.set(e,{gl:t,lost:i,stopListening:r}),()=>{t.isContextLost()||n.loseContext()}}(this.canvas,t):void 0;try{e.dispose()}finally{r?.()}}async _createRenderer(){if(e=this.canvas,t=this,Pn.set(e,this),await async function(e){let t=jn.get(e);if(t&&(t.restoring??(t.restoring=async function(e,t){if(!t.gl.isContextLost())return void t.stopListening();let n,r=()=>{},i=t.lost.then(t=>new Promise(n=>{r=Mn(e,"webglcontextrestored",()=>n()),t.restoreContext()})),s=new Promise(e=>{n=setTimeout(e,2e3)});await Promise.race([i,s]),clearTimeout(n),r(),t.stopListening()}(e,t).finally(()=>{t.restoring=void 0,!t.gl.isContextLost()&&jn.get(e)===t&&jn.delete(e)})),await t.restoring,t.gl.isContextLost()))throw new Error("[spline] The browser did not restore the WebGL context this canvas had before dispose(); the scene cannot render on it. Use a new canvas.")}(this.canvas),"webgpu"===this._rendererBackend&&this._rendererAuto)try{await(navigator.gpu?.requestAdapter())||(this._rendererBackend="webgl")}catch{this._rendererBackend="webgl"}var e,t;if("webgpu"===this._rendererBackend)try{let{createWebGPUSplineRenderer:e,isWebGPUSupported:t}=await import("./runtime-webgpu-JZZF7PVG.js");t();let n=!0,r=!1;try{let e=new URLSearchParams(window.location.search),t=e.get("bundles");"rerecord"===t?n="rerecord":("off"===t||"0"===t||"false"===t||"no"===t)&&(n=!1),r="1"===e.get("forcegl")}catch{}let i=await e({canvas:this.canvas,antialias:!1,alpha:!0,powerPreference:"high-performance",sceneBundles:!r&&n,forceWebGL:r,asyncCompilation:this._asyncShaderCompilation()});return i.onBackgroundWorkReady=()=>{this._skipRender=!1,this._renderRequested=!0},i.skyAnimationAllowed=!0,i}catch(t){console.error("[spline] Failed to initialize the WebGPU renderer, falling back to WebGL:",t),this._rendererBackend="webgl"}{let{SplineRenderer:e,rendererGlobals:t}=await import("./runtime-classicRuntime-WIJ56CKR.js");try{"off"===new URLSearchParams(window.location.search).get("taa")&&(t.taaEnabled.value=!1)}catch{}return new e({canvas:this.canvas,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"})}}_asyncShaderCompilation(){let e=!1!==this._data?.scene.publish?.asyncShaderCompilation;try{let t=new URLSearchParams(window.location.search);if("1"===t.get("forcegl"))return!1;let n=t.get("asynccomp");"off"===n||"0"===n||"false"===n||"no"===n?e=!1:("on"===n||"1"===n||"true"===n||"always"===n)&&(e=!0)}catch{}return e}_failWebGPURequired(){console.error('[spline] This scene was exported for WebGPU only and this browser does not provide a WebGPU adapter. Re-export with renderer "Both" or "WebGL 2" to support this browser.');try{let e=window.devicePixelRatio||1,t=this.canvas.clientWidth||300,n=this.canvas.clientHeight||150;this.canvas.width=t*e,this.canvas.height=n*e;let r=this.canvas.getContext("2d");r&&(r.scale(e,e),r.fillStyle="rgba(127, 127, 127, 0.85)",r.font="13px system-ui, -apple-system, Segoe UI, Roboto, sans-serif",r.textAlign="center",r.textBaseline="middle",r.fillText("This scene requires a WebGPU-capable browser.",t/2,n/2))}catch{}this.canvas.dispatchEvent(new CustomEvent("splineerror",{bubbles:!0,detail:{reason:"webgpu-required"}}))}async load(e,t,n){(function(e){let t="The Spline Runtime only accepts .splinecode files that are generated from Spline export panel.";e.endsWith(".spline")?console.warn(t+" The .spline files are only meant to be used by the Editor."):e.endsWith(".splinecode")||console.warn(t)})(e),this.disposed=!1;let r=await(await fetch(e,n)).arrayBuffer();await this.start(r,{variables:t})}async start(e,t={}){if(this.disposed)return;let n,r=++this._startOrder,i=()=>this._claimedOrder>r;return n=this._start(e,t,i,()=>!i()&&(this._claimedOrder=r,this._claimedStart=n,!0)).then(()=>i()?this._claimedStart:void 0,e=>{if(!i())throw e;return this._claimedStart}),n}async _start(t,{interactive:n=!0,variables:r},a,l){p.init();let c=await async function(e){let[t,n]=Le(Ie.deserialize(new Uint8Array(e)));if(133!==(t.schema??0)){let{updateDocumentSchema:e}=await import("./runtime-updater-6YEO4WI3.js");e(t)}return n.result().data}(t);if(a())return;let h=function(e){let t=[];return e.scene.objects.traverse((e,n)=>{"Mesh"===n.type&&"NonParametricGeometry"===n.geometry.type&&void 0!==n.geometry.data.draco&&t.push(n)}),t}(c);c.version&&(0,Cn.default)(c.version,"2.0.94")>0&&console.warn("Your .splinecode file is more recent than the library. Please upgrade @splinetool/runtime to the latest version."),void 0!==this._wasmPath&&(this.setUIWasmUrl(`${this._wasmPath}/hana-ui.wasm`),ze(this._wasmPath));let d=async function(e){{let t={particles:()=>import("./runtime-particles-PDPG5E74.js"),hair:()=>import("./runtime-hair-NLGIEVG3.js"),"shape-blends":()=>import("./runtime-shapeBlends-COFJFXT6.js"),"vector-shapes":()=>import("./runtime-vectorShapes-4MX2X2MH.js"),"3d-paths":()=>import("./runtime-paths-E4GHUGNN.js"),cloners:()=>import("./runtime-cloners-2S7SALQM.js"),components:()=>import("./runtime-components-3T3QMQUH.js"),text:()=>import("./runtime-text-NQU4F3KI.js"),"ui-2d":()=>import("./runtime-ui2d-T3OZFBOE.js"),"game-controls":()=>import("./runtime-gameControls-VAUAOGUW.js"),"collision-bvh":()=>import("./runtime-collisionBVH-JA4BEOA7.js"),mousehover:()=>import("./runtime-mouseHover-CYCSNNZM.js"),scroll:()=>import("./runtime-scroll-HKLPDE7E.js"),dragdrop:()=>import("./runtime-dragDrop-2TMWDGUQ.js"),tracking:()=>import("./runtime-tracking-6CN7PQFK.js"),resize:()=>import("./runtime-resize-DAWD3MKG.js"),conditional:()=>import("./runtime-conditional-CCGDVDMD.js"),variables:()=>import("./runtime-variables-ICLL7DZV.js"),"api-services":()=>import("./runtime-apiServices-YYNQCMLP.js"),"ai-assistant":()=>import("./runtime-aiAssistant-MKZQ23BA.js"),textinputs:()=>import("./runtime-textInputs-5WG7OPGO.js"),audio:()=>import("./runtime-audio-GPQ4HYPM.js"),video:()=>import("./runtime-video-KFIFPA6P.js"),"create-destroy":()=>import("./runtime-createDestroy-W6FF4RAP.js"),"scene-transition":()=>import("./runtime-sceneTransition-SFGBWSP3.js"),timeline:()=>import("./runtime-timeline-EAC5OJEK.js"),transitions:()=>import("./runtime-transitions-N47Y4AXH.js"),"misc-actions":()=>import("./runtime-miscActions-6CUG2JSF.js")},n=function(e){let t=new Set,n=!1,r=!1;for(let i of J(e,e=>{"GameControl"===e&&(n=!0),"Trigger"===e&&(r=!0)}))t.add(i);try{e.scene.objects.traverse((e,n)=>{hn(n,t)});let n=e.shared.lib?.components;if(n){let e=Object.keys(n);e.length>0&&t.add("components");for(let r of e)dn(n[r]?.asset,t)}}catch{for(let e of cn)t.add(e)}return n&&t.add("game-controls"),(r||t.has("game-controls"))&&t.add("collision-bvh"),t}(e);await Promise.all([...n].map(e=>t[e]()))}}(c);if(await Promise.all([d,h.length&&vn(this._wasmPath),S(c)&&te(this._wasmPath),q(c)&&$(this._wasmPath),T(c)&&D(this._wasmPath),ve.physicsEnabled(c.scene.objects)&&E(this._wasmPath),H(c)&&b(),i(c)&&s(),X(c)&&Y(),g(c)&&d.then(()=>ue()?.loadHanaUIRUNTIME()),_(c)&&M(this._wasmPath)].filter(Boolean)),a()||h.length&&(await bn(h),a())||!l())return;this._data=c,this._eventManager?.deactivate(),this._controls?.deactivate(),this._scene?.dispose();let m=c.scene.publish.renderer;if(this._rendererAuto&&"webgl"===m)this._rendererBackend="webgl";else if(this._rendererAuto&&"webgpu"===m){let e="webgpu"===this._rendererBackend&&await(navigator.gpu?.requestAdapter().catch(()=>null));if(a())return;if(!e)return void this._failWebGPURequired();this._rendererAuto=!1}let f=function(e){let t=new Set;return e.scene.objects.traverse((e,n)=>{if("Page"!==n.type)return;let r=n.postprocessing;if(r&&"object"==typeof r&&!0===r.enabled)for(let[e,n]of Object.entries(r))"enabled"!==e&&n&&"object"==typeof n&&!0===n.enabled&&t.add(e)}),[...t]}(c);if("webgpu"===this._rendererBackend)try{await Promise.all([import("./runtime-webgpu-JZZF7PVG.js"),(v=f,En(v,wn,"webgpu"))]);let e=await this._ensureRenderer();if(a()||!e)return}catch(e){console.error("[spline] Failed to load the WebGPU material backend, using WebGL:",e),this._rendererBackend="webgl"}var v;if("webgpu"!==this._rendererBackend&&(await Promise.all([import("./runtime-classicRuntime-WIJ56CKR.js"),_n(f)]),a()))return;V("webgpu"===this._rendererBackend?"webgpu":"webgl");let y=new mn(c);if(y.resetPersonalCameraFromDocumentData(),this._scene=y.scene,this._sharedAssetsManager=y.sharedAssets,this._camera=this._scene.activeCamera,window.location.search.includes("merge-geometries")){let{mergeStaticGeometries:e}=await import("./runtime-mergeStaticGeometries-K2YJKZ3C.js");if(a())return;let t=performance.now();e(c,y.scene);let n=performance.now();console.log("Merged geometries in ",n-t," ms")}S(c)&&this._scene.traverse(e=>{R(e)&&e.recomputeBoolean()}),this._sharedAssetsManager.setRequestRender(()=>{this._requestRenderAutoMode(),this._scene?.traverse(e=>{le(e)&&e.pendingMediaLoad&&e.update({scene:this._scene,shared:this._sharedAssetsManager})})}),this._scene?.traverse(e=>{"ParticleSystem"===e.type&&(e.wakeUp(),e.data.autoPlay?e.start():e.stop()),ie(e)&&e.setPlayMode(!0)});let w=Object.keys(c.shared.fonts).flatMap(e=>{let t=this._sharedAssetsManager.getFont(e);return t?[t.loadingPromise]:[]});if(Promise.all(w).then(()=>{this.disposed||(y.scene.markNeedsUpdateRendererDirty(),this._requestRenderAutoMode())}),H(c)&&j(c)&&(await Promise.all(w),a()))return;if(g(c)){let e=[];if(this._scene.traverseEntity(t=>{(oe(t)||t instanceof A)&&t.uiCanvas&&e.push(t.uiCanvas)}),await Promise.all(e.map(e=>e.promise)),a())return}this._scene.rewriteEventsBeforeGoToPlayMode(),o(this._scene.activePage,this._sharedAssetsManager);let C=await this._ensureRenderer();if(a()||!C)return;if(this._rendererConfigured||(this._rendererConfigured=!0,C.pipeline.enableUIOverlay(),C.pipeline.addEventListener("smaaloaded",this._requestRenderAutoMode)),C.hdTransmission=!0===c.scene.publish.hdTransmission,C.setPixelRatio(this._getPixelRatio(/Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?c.scene.publish.settings.web.pixelRatioMobile:c.scene.publish.settings.web.pixelRatioDesktop)),C.setAsyncCompilationPolicy?.(this._asyncShaderCompilation()),c.shared.images.SplineWatermark){let e=this._sharedAssetsManager.getImage("SplineWatermark");if(await e.loadPromise,a())return;let t=e.getTexture(1001);C.pipeline.setWatermark(t)}else C.pipeline.setWatermark(null);i(c)&&this._scene.initializeSplatViewer(),void 0!==c.scene.blueNoiseTextureData&&C.pipeline.updateBlueNoiseTexture(c.scene.blueNoiseTextureData);let O=Object.values(c.frames)[0];if(this._frameView?this._frameView.setCamera(this._camera):("fullscreen"===O.preset?(this._viewportMode=1,this.canvas.style.display="block",this.canvas.parentElement&&(this._viewportWidth=this.canvas.parentElement.clientWidth||300,this.canvas.style.width="100%"),this.canvas.parentElement&&(this._viewportHeight=this.canvas.parentElement.clientHeight||150,this.canvas.style.height="100%")):(this._viewportMode=2,this._viewportWidth=O.size[0],this._viewportHeight=O.size[1],this.canvas.style.width=`${this._viewportWidth}px`,this.canvas.style.height=`${this._viewportHeight}px`),C.setSize(this._viewportWidth,this._viewportHeight,!1),this._frameView=new ln(C,this._camera,new He(this._viewportWidth,this._viewportHeight)),this._frameView.enableResponsive=(O.allowResponsive??!1)&&"fullscreen"===O.preset),n){let t=new u(C,this.data.scene.publish,this._scene,()=>this._scene.activeCamera,this._sharedAssetsManager,this._requestRenderAutoMode,!0,O);this._scene.updateMatrixWorld(!0),this._controls=new P(t),this._animationControls=new e(this._scene,this._requestRenderAutoMode),this._eventManager=new on(c.scene.publish,this._controls,this._animationControls,t,c.shared.variables),this._eventManager.activate(),this._controls.activate(this._eventManager)}this._resize(),this._scene.activePage.data.postprocessing.depthOfField.enabled&&Promise.all(this._sharedAssetsManager.getImageLoadPromises()).then(()=>{this.disposed||this._resize(!0)}),void 0!==r&&this.setVariables(r),0===this.dt&&(this.render(performance.now()),setTimeout(()=>{this._renderer?.setAnimationLoop(this.render)},0)),this._resizeObserverTimeout=setTimeout(()=>{!this._resizeObserver&&this.canvas.parentElement&&(this._resizeObserver=new ResizeObserver(()=>{this._viewportWidth=this.canvas.clientWidth,this._viewportHeight=this.canvas.clientHeight,this._debouncedResize()}),this._resizeObserver.observe(this.canvas.parentElement))},300),document.addEventListener("scroll",this._onScroll),n&&(this._htmlContentOverlay?.dispose(),this._htmlContentOverlay=void 0);let x=c.scene.publish.htmlContent?.html;if(n&&x&&"none"!==this._htmlContentMode){let e={shared:this._sharedAssetsManager,findEntity:e=>this._scene?.getObjectByProperty("uuid",e)??this._scene?.getObjectByName(e),getAnimationControls:()=>this._animationControls};this._htmlContentOverlay=("inline"===this._htmlContentMode?Dn.mount(this,this.canvas,x,e):kn.mount(this,this.canvas,x,e))??void 0}}setVariables(e){if(void 0!==this._data){let t=Object.entries(e);for(let[e,n]of t)this.setVariable(e,n)}}setVariable(e,t){let n=this._getVariableByName(e);if(n&&!("dynamicVariableType"in n.data)){if(null==t)return void console.warn(`Variable ${e} was not updated: received ${t}. Pass a number, boolean or string.`);let r=t;if("number"==typeof n.data.value){if(r="number"==typeof t?t:"boolean"==typeof t?!0===t?1:0:parseFloat(t),!Number.isFinite(r))return void console.warn(`Variable ${e} is a number variable and ${JSON.stringify(t)} cannot be converted to a number. The variable was not updated.`)}else"boolean"==typeof n.data.value?r="number"==typeof t?!!t:"boolean"==typeof t?t:"false"!==t.toLocaleLowerCase()&&!!t:"string"!=typeof n.data.value&&void 0!==n.data.value.textValue&&(r=t.toString());let i="string"==typeof r?{textValue:r}:r;this._sharedAssetsManager?.updateVariable(n.id,i),this.requestRender(),this._requestRenderAutoMode()}else void 0===n?console.warn(`No variable named ${e} was found in your Spline file. Make sure to create it from Spline editor.`):"dynamicVariableType"in n.data&&console.warn(`Dynamic variables like ${e} cannot be updated from code.`)}getVariables(){let e={};return this._data&&this._data.shared.variables.forEach(t=>{void 0===e[t.data.name]&&(e[t.data.name]=this._getVariableValue(this._sharedAssetsManager.getVariable(t.id)))}),e}getVariable(e){let t=this._getVariableByName(e);if(t){let e=this._sharedAssetsManager.getVariable(t.id);return this._getVariableValue(e)}}_getVariableValue(e){return"string"!=typeof e&&ge.isTextValue(e)?ge.getDisplayedValue(e):e}_getVariableByName(e){if(this._data){if(this._variablesCache.has(e))return this._variablesCache.get(e);let t=this._data.shared.variables.find(t=>t.data.name===e);return t&&this._variablesCache.set(e,t),t}}_getPixelRatio(e){switch(e){case 0:return window.devicePixelRatio;case 1:return 1;case 2:return 2}}findObjectById(e){let t=this._scene?.getObjectByProperty("uuid",e);return this._createProxyObject(t)}findObjectByName(e){let t=this._scene?.getObjectByName(e);return this._createProxyObject(t)}getAllObjects(){let e=[];return this._scene?.traverseEntity(t=>{if(!(t.uuid===Ge||this._scene.isInvisibleObjects(t)||t instanceof A)){let n=this._createProxyObject(t);n&&e.push(n)}}),e}getSplineEvents(){return(this._eventManager?.handlers?.Spline).splineEvents}emitEvent(e,t){(this.findObjectById(t)||this.findObjectByName(t))?.emitEvent(e)}emitEventReverse(e,t){(this.findObjectById(t)||this.findObjectByName(t))?.emitEventReverse(e)}addEventListener(e,t){this.canvas.addEventListener(e,t)}removeEventListener(e,t){this.canvas.removeEventListener(e,t)}setZoom(e){this._controls?.orbitControls instanceof w&&this._controls?.orbitControls.setZoom(e)}get eventManager(){return this._eventManager}get controls(){return this._controls}setSize(e,t){this._viewportWidth=e,this._viewportHeight=t,this._viewportMode=2,this._resize()}setBackgroundColor(e){let t=or(e);this._scene?.activePage.setBackgroundColor(t),this._requestRenderAutoMode()}dispose(){this.disposed=!0,this._claimedOrder=++this._startOrder,this._claimedStart=void 0,this._htmlContentOverlay?.dispose(),this._htmlContentOverlay=void 0,this._eventManager?.dispose(),this._scene?.dispose(),this._scene=void 0,this._camera=void 0,F(),this._sharedAssetsManager?.setRequestRender(()=>{}),this._sharedAssetsManager?.dispose(),this._sharedAssetsManager=void 0,this._proxyObjectCache.forEach(e=>{Kt.unsubscribe(e)}),this._proxyObjectCache.clear(),this._variablesCache.clear(),this._renderer?.pipeline.removeEventListener("smaaloaded",this._requestRenderAutoMode),this._renderer?.setAnimationLoop(null),this._renderer&&this._disposeRenderer(this._renderer),this._renderer=void 0,this._rendererConfigured=!1,this._debouncedResize.cancel(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0),void 0!==this._resizeObserverTimeout&&(clearTimeout(this._resizeObserverTimeout),this._resizeObserverTimeout=void 0),this.canvas.style.width="",this.canvas.style.height="",this.canvas.removeAttribute("width"),this.canvas.removeAttribute("height"),this._frameView=void 0,this._controls?.deactivate(),this._controls=void 0,this._animationControls=void 0,this._eventManager?.eventContext.dispose(),this._eventManager=void 0,this._splatViewer=void 0,this._data=void 0,this._perfs=void 0,this.dt=0,this._lastTime=void 0,x(this.canvas),document.removeEventListener("scroll",this._onScroll),p.dispose()}get isStopped(){return this._isPaused}stop(){this._isPaused||(this._renderer?.setAnimationLoop(null),this._isPaused=!0,this._eventManager?.pause(),this._controls?.orbitControls&&(this._controls.orbitControls.enabled=!1))}play(){!this._isPaused||(this._isPaused=!1,this._eventManager?.resume(),this._controls?.orbitControls&&(this._controls.orbitControls.enabled=!0),this._renderer?.setAnimationLoop(this.render))}setGlobalEvents(e){this._eventManager?.updateUseWindowEvents(e)}get data(){return this._data}_createProxyObject(e){if(!this._scene)return;let t,i=this._scene;if(null==e)return;if(this._proxyObjectCache.has(e.uuid))return this._proxyObjectCache.get(e.uuid);e.traverseAncestors(e=>{e instanceof A&&(t=e.name)});let s=this._sharedAssetsManager,o={shared:s,scene:this._scene},l=t=>{if(null===t||"Base State"===t)return null;if(t&&e.data.states){let n=e.data.states.find(e=>e.data.name===t);return n?n.id:void 0}},c="material"in e?e.material:void 0,h=e.materialOverride,d={name:e.name,uuid:e.uuid,visible:e.visible,intensity:e.intensity,position:e.position,rotation:e.rotation,scale:e.scale,type:e.data.type,page:t,material:h??(c?nr(c):void 0),parentUuid:e.parent instanceof A||e instanceof a?void 0:e.parent?.uuid,emitEvent(t){e.dispatchEvent({type:"userEvent",eventName:t})},emitEventReverse(t){e.dispatchEvent({type:"userEvent",eventName:t,reverse:!0})},hide(){e.visible&&(e.visible=!1,o.shared.requestRender())},show(){e.visible||(e.visible=!0,o.shared.requestRender())},get state(){let t=e.stateSelection;if(null!==t)return e.data.states.find(({id:e})=>e===t)?.data.name},set state(t){let n;if(void 0!==t){let r="string"==typeof t?e.data.states.find(({id:e})=>e===t):e.data.states[t];if(r)n=r.id;else{let e="string"==typeof t?l(t):void 0;e&&(n=e)}}e.changeSelectedState(n??null,o),e.currentState=n??null,e.dispatchEvent({type:"completeState",state:n??null}),o.shared.requestRender()},transition(t){let a=n();if(null===a)return he("transitions","obj.transition()"),{transition(e){return this},play(){return this},pause(){return this},reset(){return this},seek(e){return this}};let o,c,h=this,d=[],u=!1,m=()=>{c=new r({delay:0,delayDirection:"start-once",direction:"normal",repeat:0,runMode:"Repeat"},d.map(e=>e.runner))},f={update(e){c?.update(e),!0!==c?.isPlaying&&p.remove(f)}},v={transition({from:t,to:n,duration:r,delay:c,...u}){let p=l(t);void 0===p&&(p=o);let f=l(n);return o=f,d.push(new a(e,p,f,{state:f,repeat:0,delay:c??0,delayDirection:"start-once",direction:"normal",duration:r??1e3,...u,...6===u.easing?be.defaultData:5===u.easing?we.defaultData:{}},s,!1,i.activePage,{onBegin:()=>{(t&&p||"Base State"===t&&!p)&&(h.state=p??void 0)},onComplete:()=>{h.state=f??void 0}})),m(),this},play(){return c?(u=!0,c.play(p.time),c.isPlaying&&p.add(f),this):this},pause(){return c?.stop(),p.remove(f),this},reset(){return this.pause(),u=!1,m(),c?.seek(0),this},seek(e){let t=d.reduce((e,t)=>e+t.runner.duration,0);return t>0&&c?.seek(e/1e3/t),this}};return v.transition(t),(t.autoPlay??!0)&&queueMicrotask(()=>{u||v.play()}),v},set color(t){let n=or(t);if(k.is(e))return void(e.color=n);if(!("Mesh"===e.type&&"material"in e&&e instanceof W))return;let r={r:n.r,g:n.g,b:n.b,a:n.a},i=e.materialOverride;if(void 0!==i){let e=i.color;return void(!0===e?.isColor&&"function"==typeof e.setStyle&&(e.setStyle(t),o.shared.requestRender()))}let s=Array.isArray(e.material)?e.material[0]:e.material,a=s.data.layers.find(e=>"color"===e.data.type)?.id;if(a)s.updateByOp({type:0,path:["layers",a],props:{color:{...r}}},s.data,o);else{let e=s.data,t=e.layers.find(e=>"light"===e.data.type);if(!t)return;let n=0===e.layers.indexOf(t)?t:null,i=e.layers.at(n?e.layers.indexOf(n)+1:0),a={type:4,fi:n?n.fi+(i?(i.fi-n.fi)/2:1):i?i.fi/2:1,id:Fe.generateUUID(),data:{...Ae.defaultData("color"),color:r},localIndex:0},l=e.layers.insertAfterHelper(n?.id??null,1),c=e.layers.runOp({...a,fi:l[0]}).data;Object.assign(s.data,{layers:c}),s.updateByOp({...a,path:["layers"]},s.data,o)}}},u=Kt(d,(t,n)=>{let r=e[t],i=t.split(".");"material"===i[0]&&c&&void 0===h&&function(e,t,n){let r=Array.isArray(n)?n[0]:n;if("layers"===e[0]){let n=parseInt(e[1]),i=r.layers[n],s=e[2];i&&s&&function(e,t,n){let r=e[0];try{if(function(e,t){return!!sr[t]?.includes(e)}(r,n.type,e.slice(1)))if("colors"===r){if(e.length<2)throw new Error("You cannot mutate the colors array, only its items");let i=parseInt(e[1]),s=n.getValue(r)?.[i];if(!s)throw new Error("Color index out of range");ir.setStyle(t),s.set(ir.r,ir.g,ir.b,ir.a)}else n.getValue(r)?.setStyle(t);else if("texture"===r||"video"===r){let r=n.color;!function(e,t,n,r){let i=e[0];if("repeat"===i||"offset"===i||"rotation"===i){let n=r.getNode("mat"),s=n&&"function"==typeof n.updateMatrix?n:r.getValue("mat");if(!s)return;if("rotation"===i)s.rotation=parseFloat(t);else{let n=e[1];if(void 0===n)t instanceof Array&&2===t.length&&Object.assign(s,{[i]:t});else{let e=s[i],r=0===parseInt(n)?[parseFloat(t),e[1]]:[e[0],parseFloat(t)];Object.assign(s,{[i]:r})}}s.updateMatrix()}else"wrapping"===i||"minFilter"===i||"magFilter"===i?"wrapping"===i?n.texture.wrap=t:n.texture[i]=t:"image"===i&&"data"===e[1]&&n.texture.image.updateSrc(t)}(e.slice(1),t,r,n)}else{let i=e[1],s=n.getValue(r);s?.isVector3&&void 0!==i||s?.isVector2&&void 0!==i?s.setComponent(parseInt(i),t):n.setValue(r,t)}}catch(e){console.error("Error setting material value",e)}}(e.slice(2),t,i)}else"alpha"===e[0]&&r.layers.forEach(e=>{"light"===e.type&&void 0!==e.node.alphaOverride&&(e.node.alphaOverride.value=t,t<1&&(r.transparent=!0))})}(i.slice(1),n,c),"object"!=typeof r&&Object.getOwnPropertyDescriptor(e,t)?.writable&&(e[t]=n),this._requestRenderAutoMode(),e.updateMatrix()});return this._proxyObjectCache.set(e.uuid,u),u}setUIWasmUrl(e){de(e)}pauseGameControls(){this._eventManager?.controlsManager.gameControl?.pause()}resumeGameControls(){this._eventManager?.controlsManager.gameControl?.resume()}async swapGeometry(e,t){let n;if("string"==typeof t){if(!t.endsWith(".splinegeometry"))throw new Error("Only .splinegeometry format is supported");{let e=await(await fetch(t)).arrayBuffer();n=new Uint8Array(e)}}else n=t;let r=Ie.deserialize(n),i="data"in r&&void 0!==r.data.draco;i&&await vn(this._wasmPath);let s=this._scene?.getObjectByProperty("uuid",e)??this._scene?.getObjectByName(e);if(!s)return void console.warn(`Object ${e} not found`);if("Mesh"!==s.data.type||!(s instanceof W))return void console.warn(`Object ${e} is not a mesh`);let a=s,o={...a.data,geometry:r};i&&await bn([o]),a.updateByOp({type:0,path:[],props:{geometry:o.geometry}},o,{shared:this._sharedAssetsManager,scene:this._scene},!1);for(let e of a.data.states){let t={...e.data};a.states||(a.states={}),a.states[e.id]=fe.patch(o,t)}return n}_applyDocumentTransaction(e){this._data=e.data,this._scene&&(this._scene.data=this._data.scene),this._sharedAssetsManager&&(this._sharedAssetsManager.data=this._data.shared);for(let t of e.actual){let e=t.path;Array.isArray(e)&&2===e.length&&"scene"===e[0]&&"objects"===e[1]&&this._scene?.updateTreeByOp({...t,path:[]},this._sharedAssetsManager)}}_findEntity(e){return this._scene?.getObjectByProperty("uuid",e)??this._scene?.getObjectByName(e)}_resolveParentId(e){if(void 0===e)return this._scene.activePage.uuid;let t="string"==typeof e?e:e.uuid,n=this._findEntity(t);if(!n)throw new Error(`parent '${t}' — no object with that name or uuid in the scene.`);return n.uuid}async createCustomMaterial(e){if(this.disposed)throw new Error("createCustomMaterial: this Application was disposed.");if("function"!=typeof e)throw new Error("createCustomMaterial: expected a factory function — createCustomMaterial((three) => new three.MeshStandardNodeMaterial()).");let t=G();if(void 0===t&&("webgpu"===this._rendererBackend&&(await import("./runtime-webgpu-JZZF7PVG.js"),t=G()),void 0===t))throw new Error("createCustomMaterial: requires the webgpu backend (the runtime default where WebGPU is available). This Application is on the classic WebGL pipeline — pass { renderer: 'webgpu' } or drop any ?renderer=webgl2 override.");let n=e(t);if("object"!=typeof n||null===n||!0!==n.isMaterial)throw new Error("createCustomMaterial: the factory must return a three.js material built from the namespace it receives — e.g. (three) => new three.MeshStandardNodeMaterial().");return n}async setMaterial(e,t){if(this.disposed)throw new Error("setMaterial: this Application was disposed.");let n=this._scene;if(!n)throw new Error("setMaterial: no scene loaded — call load() or start() first.");let r="string"==typeof e?e:e.uuid,i=this._findEntity(r);if(!i)throw new Error(`setMaterial: '${r}' — no object with that name or uuid in the scene.`);if(!(i instanceof W))throw new Error(`setMaterial: '${r}' is not a mesh — lights, groups, and cameras have no material.`);let s="function"==typeof t?await this.createCustomMaterial(t):t;if("webgpu"!==I())throw new Error("setMaterial: custom three.js materials require the webgpu backend (the runtime default where WebGPU is available). This scene is running the classic WebGL pipeline — pass { renderer: 'webgpu' } or drop any ?renderer=webgl2 override.");let a=Vn({material:s});if(void 0===a.material)throw new Error("setMaterial: expected a three.js material instance or a (three) => material factory.");return i.setMaterialOverride(a.material,{scene:n,shared:this._sharedAssetsManager}),this._proxyObjectCache.delete(i.uuid),this._requestRenderAutoMode(),a.material}async createObject(e,t={}){if(this.disposed)throw new Error("createObject: this Application was disposed.");let n=this._scene,r=this._data;if(!n||!r)throw new Error("createObject: no scene loaded — call load() or start() first.");let i=function(e){if("string"!=typeof e||0===e.length)throw new Error(`createObject: expected a type name string — one of ${Gn}.`);let t=e.replace(/Geometry$/i,"").replace(/[\s_-]/g,"").toLowerCase(),n=Kn[t];if(n)return{objectType:n};let r=Un[t];if(r)return{objectType:"Mesh",geometryType:r};let i=Bn[t];throw i?new Error(`createObject: '${e}' is not supported — ${i}`):new Error(`createObject: '${e}' is not a creatable Spline type — use one of ${Gn}, e.g. createObject('Cube', { width: 200 }).`)}(e);"function"==typeof t.material&&(t={...t,material:await this.createCustomMaterial(t.material)});let s,a,{options:o,material:l}=Vn(t);if(void 0!==l){if("Mesh"!==i.objectType)throw new Error("createObject: a three.js material instance only applies to mesh types — lights and groups have no material.");if("webgpu"!==I())throw new Error("createObject: three.js material instances require the webgpu backend (the runtime default where WebGPU is available). This scene is running the classic WebGL pipeline — pass { renderer: 'webgpu' } to the Application, or drop any ?renderer=webgl2 override.")}if("TextGeometry"===i.geometryType){if(await import("./runtime-text-NQU4F3KI.js"),!ce("text"))throw new Error("createObject: this runtime build was compiled without the 'text' feature — re-export the scene with a Text object present, or load the full runtime build.");if(await b(),a=t.font??Re,void 0===r.shared.fonts[a]){if(a!==Re){let e=Object.keys(r.shared.fonts).join(", ");throw new Error(`createObject: font '${a}' is not in this document — available fonts: ${e||"(none)"}.`)}s={name:Re,url:De}}}let c=this._resolveParentId(t.parent),h=Jn(i,o,r),d=Fe.generateUUID(),[u,p]=Le(r);s&&(u.shared.fonts[Re]=s),u.scene.objects.insertAfter(c,null,[{id:d,data:h,children:[]}]);let m=p.result();if(s&&this._sharedAssetsManager.addFont(Re,s),void 0!==a){let e=this._sharedAssetsManager.getFont(a);e&&await e.loadingPromise}this._applyDocumentTransaction(m);let f=n.find(d);return void 0!==l&&f.setMaterialOverride(l,{scene:n,shared:this._sharedAssetsManager}),this._requestRenderAutoMode(),this._createProxyObject(f)}cloneObject(e,t={}){if(this.disposed)throw new Error("cloneObject: this Application was disposed.");let n=this._scene,r=this._data;if(!n||!r)throw new Error("cloneObject: no scene loaded — call load() or start() first.");let i="string"==typeof e?e:e?.uuid,s=i?this._findEntity(i):void 0;if(!s)throw new Error(`cloneObject: '${i}' — no object with that name or uuid in the scene.`);if(s instanceof A)throw new Error("cloneObject: pages cannot be cloned.");let a=r.scene.objects.get(s.uuid);if(!a)throw new Error(`cloneObject: '${i}' is not part of the document tree (expanded clones and instanced children cannot be cloned — clone their source object instead).`);let o=function(e,t,n){let r={...e.data};return void 0!==t.position&&(r.position=zn(t.position,[0,0,0])),void 0!==t.rotation&&(r.rotation=zn(t.rotation,[0,0,0])),void 0!==t.scale&&(r.scale=Fn(t.scale)),void 0!==t.visible&&(r.visible=t.visible),r.name=t.name??Qn(`${e.data.name??"Object"} Copy`,n),{...e,data:r}}(tr(a),t,r.scene.objects),l=void 0!==t.parent?this._resolveParentId(t.parent):r.scene.objects.parent(s.uuid)??null,c=void 0!==t.parent?null:s.uuid,[h,d]=Le(r);h.scene.objects.insertAfter(l,c,[o]),this._applyDocumentTransaction(d.result());let u=n.find(o.id);return this._requestRenderAutoMode(),this._createProxyObject(u)}removeObject(e){let t=this._scene,n=this._data;if(this.disposed||!t||!n)return!1;let r="string"==typeof e?e:e?.uuid,i=r?this._findEntity(r):void 0;if(!i)return!1;if(i instanceof A)throw new Error("removeObject: pages cannot be removed.");if("PerspectiveCamera"===i.data.type||"OrthographicCamera"===i.data.type)throw new Error("removeObject: cameras cannot be removed.");if(void 0===n.scene.objects.get(i.uuid))throw new Error(`removeObject: '${r}' is not part of the document tree (expanded clones and instanced children cannot be removed individually).`);let s=[];i.traverseEntity(e=>{s.push(e.uuid)});let[a,o]=Le(n);a.scene.objects.delete(i.uuid),this._applyDocumentTransaction(o.result());for(let e of s){let t=this._proxyObjectCache.get(e);t&&(Kt.unsubscribe(t),this._proxyObjectCache.delete(e))}return this._requestRenderAutoMode(),!0}};export{lr as Application,Ne as Axis,ye as Easing,_e as GradientType,Ce as NoiseType,xe as PatternStyle,Me as ProjectionType,Ee as Side,Pe as TextureFilter,Oe as ToonType,pe as VoronoiStyle,je as Wrapping};