@splinetool/runtime 1.12.98 → 2.0.1

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 (365) hide show
  1. package/README.md +195 -22
  2. package/build/boolean.js +406 -2
  3. package/build/boolean.js.br +0 -0
  4. package/build/boolean.js.gz +0 -0
  5. package/build/boolean.wasm +0 -0
  6. package/build/boolean.wasm.br +0 -0
  7. package/build/boolean.wasm.gz +0 -0
  8. package/build/gaussian-splat-compression.js.br +0 -0
  9. package/build/gaussian-splat-compression.js.gz +0 -0
  10. package/build/hana-ui.js +4299 -0
  11. package/build/hana-ui.js.br +0 -0
  12. package/build/hana-ui.js.gz +0 -0
  13. package/build/hana-ui.wasm +0 -0
  14. package/build/hana-ui.wasm.br +0 -0
  15. package/build/hana-ui.wasm.gz +0 -0
  16. package/build/howler.js.br +0 -0
  17. package/build/howler.js.gz +0 -0
  18. package/build/navmesh.js.br +0 -0
  19. package/build/navmesh.js.gz +0 -0
  20. package/build/navmesh.wasm +0 -0
  21. package/build/navmesh.wasm.br +0 -0
  22. package/build/navmesh.wasm.gz +0 -0
  23. package/build/opentype.js.br +0 -0
  24. package/build/opentype.js.gz +0 -0
  25. package/build/physics.js +1 -1
  26. package/build/physics.js.br +0 -0
  27. package/build/physics.js.gz +0 -0
  28. package/build/physics.wasm +0 -0
  29. package/build/physics.wasm.br +0 -0
  30. package/build/physics.wasm.gz +0 -0
  31. package/build/process.js +2 -2
  32. package/build/process.js.br +0 -0
  33. package/build/process.js.gz +0 -0
  34. package/build/process.wasm +0 -0
  35. package/build/process.wasm.br +0 -0
  36. package/build/process.wasm.gz +0 -0
  37. package/build/runtime-DRACOLoader-TQHJ6SJB.js +1 -0
  38. package/build/runtime-DRACOLoader-TQHJ6SJB.js.br +0 -0
  39. package/build/runtime-DRACOLoader-TQHJ6SJB.js.gz +0 -0
  40. package/build/runtime-Perfs-KMJFDYHU.js +1 -0
  41. package/build/runtime-Perfs-KMJFDYHU.js.br +0 -0
  42. package/build/runtime-Perfs-KMJFDYHU.js.gz +0 -0
  43. package/build/runtime-aiAssistant-XJVJ7TQB.js +1 -0
  44. package/build/runtime-aiAssistant-XJVJ7TQB.js.br +0 -0
  45. package/build/runtime-aiAssistant-XJVJ7TQB.js.gz +0 -0
  46. package/build/runtime-apiServices-KAO5SQJZ.js +1 -0
  47. package/build/runtime-apiServices-KAO5SQJZ.js.br +0 -0
  48. package/build/runtime-apiServices-KAO5SQJZ.js.gz +0 -0
  49. package/build/runtime-audio-Y3GYW4YQ.js +1 -0
  50. package/build/runtime-audio-Y3GYW4YQ.js.br +0 -0
  51. package/build/runtime-audio-Y3GYW4YQ.js.gz +0 -0
  52. package/build/runtime-bloom-XRHHZNNT.js +1 -0
  53. package/build/runtime-bloom-XRHHZNNT.js.br +0 -0
  54. package/build/runtime-bloom-XRHHZNNT.js.gz +0 -0
  55. package/build/runtime-brightnessContrast-RHV6X2Z4.js +1 -0
  56. package/build/runtime-brightnessContrast-RHV6X2Z4.js.br +0 -0
  57. package/build/runtime-brightnessContrast-RHV6X2Z4.js.gz +0 -0
  58. package/build/runtime-chromaticAberration-LSGAMQAK.js +1 -0
  59. package/build/runtime-chromaticAberration-LSGAMQAK.js.br +0 -0
  60. package/build/runtime-chromaticAberration-LSGAMQAK.js.gz +0 -0
  61. package/build/runtime-chunk-23QOKH2J.js +1 -0
  62. package/build/runtime-chunk-23QOKH2J.js.br +0 -0
  63. package/build/runtime-chunk-23QOKH2J.js.gz +0 -0
  64. package/build/runtime-chunk-2VFLTNIU.js +1 -0
  65. package/build/runtime-chunk-2VFLTNIU.js.br +0 -0
  66. package/build/runtime-chunk-2VFLTNIU.js.gz +0 -0
  67. package/build/runtime-chunk-44SAPZDZ.js +1 -0
  68. package/build/runtime-chunk-44SAPZDZ.js.br +0 -0
  69. package/build/runtime-chunk-44SAPZDZ.js.gz +0 -0
  70. package/build/runtime-chunk-4KZXQGUQ.js +1 -0
  71. package/build/runtime-chunk-4KZXQGUQ.js.br +0 -0
  72. package/build/runtime-chunk-4KZXQGUQ.js.gz +0 -0
  73. package/build/runtime-chunk-4YV3EXSU.js +1 -0
  74. package/build/runtime-chunk-4YV3EXSU.js.br +0 -0
  75. package/build/runtime-chunk-4YV3EXSU.js.gz +0 -0
  76. package/build/runtime-chunk-5CH7XRKY.js +1 -0
  77. package/build/runtime-chunk-5CH7XRKY.js.br +0 -0
  78. package/build/runtime-chunk-5CH7XRKY.js.gz +0 -0
  79. package/build/runtime-chunk-5VJGAC3M.js +1 -0
  80. package/build/runtime-chunk-5VJGAC3M.js.br +0 -0
  81. package/build/runtime-chunk-5VJGAC3M.js.gz +0 -0
  82. package/build/runtime-chunk-7NBWIU4W.js +1 -0
  83. package/build/runtime-chunk-7NBWIU4W.js.br +0 -0
  84. package/build/runtime-chunk-7NBWIU4W.js.gz +0 -0
  85. package/build/runtime-chunk-ARTGMJ7O.js +1 -0
  86. package/build/runtime-chunk-ARTGMJ7O.js.br +0 -0
  87. package/build/runtime-chunk-ARTGMJ7O.js.gz +0 -0
  88. package/build/runtime-chunk-BXPWRF47.js +1 -0
  89. package/build/runtime-chunk-BXPWRF47.js.br +0 -0
  90. package/build/runtime-chunk-BXPWRF47.js.gz +0 -0
  91. package/build/runtime-chunk-CRYQVRO6.js +1 -0
  92. package/build/runtime-chunk-CRYQVRO6.js.br +0 -0
  93. package/build/runtime-chunk-CRYQVRO6.js.gz +0 -0
  94. package/build/runtime-chunk-CVUJ3GMH.js +1 -0
  95. package/build/runtime-chunk-CVUJ3GMH.js.br +0 -0
  96. package/build/runtime-chunk-CVUJ3GMH.js.gz +0 -0
  97. package/build/runtime-chunk-DJJZN367.js +1 -0
  98. package/build/runtime-chunk-DJJZN367.js.br +0 -0
  99. package/build/runtime-chunk-DJJZN367.js.gz +0 -0
  100. package/build/runtime-chunk-DZNU62CT.js +1 -0
  101. package/build/runtime-chunk-DZNU62CT.js.br +0 -0
  102. package/build/runtime-chunk-DZNU62CT.js.gz +0 -0
  103. package/build/runtime-chunk-EAXCCTR5.js +1 -0
  104. package/build/runtime-chunk-EAXCCTR5.js.br +0 -0
  105. package/build/runtime-chunk-EAXCCTR5.js.gz +0 -0
  106. package/build/runtime-chunk-EOV2DL2V.js +1 -0
  107. package/build/runtime-chunk-EOV2DL2V.js.br +0 -0
  108. package/build/runtime-chunk-EOV2DL2V.js.gz +0 -0
  109. package/build/runtime-chunk-FDRTCOJ5.js +1 -0
  110. package/build/runtime-chunk-FDRTCOJ5.js.br +0 -0
  111. package/build/runtime-chunk-FDRTCOJ5.js.gz +0 -0
  112. package/build/runtime-chunk-FQNSP44B.js +1 -0
  113. package/build/runtime-chunk-FQNSP44B.js.br +0 -0
  114. package/build/runtime-chunk-FQNSP44B.js.gz +0 -0
  115. package/build/runtime-chunk-FTVQTRM7.js +1 -0
  116. package/build/runtime-chunk-FTVQTRM7.js.br +0 -0
  117. package/build/runtime-chunk-FTVQTRM7.js.gz +0 -0
  118. package/build/runtime-chunk-GFTBNL2W.js +1 -0
  119. package/build/runtime-chunk-GFTBNL2W.js.br +0 -0
  120. package/build/runtime-chunk-GFTBNL2W.js.gz +0 -0
  121. package/build/runtime-chunk-H6BPTR74.js +1 -0
  122. package/build/runtime-chunk-H6BPTR74.js.br +0 -0
  123. package/build/runtime-chunk-H6BPTR74.js.gz +0 -0
  124. package/build/runtime-chunk-H6T5LPRN.js +1 -0
  125. package/build/runtime-chunk-H6T5LPRN.js.br +0 -0
  126. package/build/runtime-chunk-H6T5LPRN.js.gz +0 -0
  127. package/build/runtime-chunk-HER7UVU3.js +1 -0
  128. package/build/runtime-chunk-HER7UVU3.js.br +0 -0
  129. package/build/runtime-chunk-HER7UVU3.js.gz +0 -0
  130. package/build/runtime-chunk-J2I4VBHR.js +1 -0
  131. package/build/runtime-chunk-J2I4VBHR.js.br +0 -0
  132. package/build/runtime-chunk-J2I4VBHR.js.gz +0 -0
  133. package/build/runtime-chunk-JFAQQYSH.js +1 -0
  134. package/build/runtime-chunk-JFAQQYSH.js.br +0 -0
  135. package/build/runtime-chunk-JFAQQYSH.js.gz +0 -0
  136. package/build/runtime-chunk-KGZNRID6.js +1 -0
  137. package/build/runtime-chunk-KGZNRID6.js.br +1 -0
  138. package/build/runtime-chunk-KGZNRID6.js.gz +0 -0
  139. package/build/runtime-chunk-LATYCOUS.js +1 -0
  140. package/build/runtime-chunk-LATYCOUS.js.br +0 -0
  141. package/build/runtime-chunk-LATYCOUS.js.gz +0 -0
  142. package/build/runtime-chunk-MBBODDV7.js +1 -0
  143. package/build/runtime-chunk-MBBODDV7.js.br +0 -0
  144. package/build/runtime-chunk-MBBODDV7.js.gz +0 -0
  145. package/build/runtime-chunk-ML3Z74BL.js +1 -0
  146. package/build/runtime-chunk-ML3Z74BL.js.br +0 -0
  147. package/build/runtime-chunk-ML3Z74BL.js.gz +0 -0
  148. package/build/runtime-chunk-MM75L5X4.js +1 -0
  149. package/build/runtime-chunk-MM75L5X4.js.br +0 -0
  150. package/build/runtime-chunk-MM75L5X4.js.gz +0 -0
  151. package/build/runtime-chunk-N2ZRGNPR.js +1 -0
  152. package/build/runtime-chunk-N2ZRGNPR.js.br +0 -0
  153. package/build/runtime-chunk-N2ZRGNPR.js.gz +0 -0
  154. package/build/runtime-chunk-NBYTQLIB.js +1 -0
  155. package/build/runtime-chunk-NBYTQLIB.js.br +0 -0
  156. package/build/runtime-chunk-NBYTQLIB.js.gz +0 -0
  157. package/build/runtime-chunk-NSD7DU3P.js +1 -0
  158. package/build/runtime-chunk-NSD7DU3P.js.br +0 -0
  159. package/build/runtime-chunk-NSD7DU3P.js.gz +0 -0
  160. package/build/runtime-chunk-NTUTXO7Q.js +1 -0
  161. package/build/runtime-chunk-NTUTXO7Q.js.br +0 -0
  162. package/build/runtime-chunk-NTUTXO7Q.js.gz +0 -0
  163. package/build/runtime-chunk-O5NBGIBR.js +1 -0
  164. package/build/runtime-chunk-O5NBGIBR.js.br +0 -0
  165. package/build/runtime-chunk-O5NBGIBR.js.gz +0 -0
  166. package/build/runtime-chunk-OFPUAZKY.js +1 -0
  167. package/build/runtime-chunk-OFPUAZKY.js.br +0 -0
  168. package/build/runtime-chunk-OFPUAZKY.js.gz +0 -0
  169. package/build/runtime-chunk-OW6T4XFV.js +1 -0
  170. package/build/runtime-chunk-OW6T4XFV.js.br +0 -0
  171. package/build/runtime-chunk-OW6T4XFV.js.gz +0 -0
  172. package/build/runtime-chunk-QZ35BPGB.js +1 -0
  173. package/build/runtime-chunk-QZ35BPGB.js.br +0 -0
  174. package/build/runtime-chunk-QZ35BPGB.js.gz +0 -0
  175. package/build/runtime-chunk-R43XZP65.js +1 -0
  176. package/build/runtime-chunk-R43XZP65.js.br +0 -0
  177. package/build/runtime-chunk-R43XZP65.js.gz +0 -0
  178. package/build/runtime-chunk-T53JMQSH.js +1 -0
  179. package/build/runtime-chunk-T53JMQSH.js.br +0 -0
  180. package/build/runtime-chunk-T53JMQSH.js.gz +0 -0
  181. package/build/runtime-chunk-T6CHRQ6N.js +1 -0
  182. package/build/runtime-chunk-T6CHRQ6N.js.br +0 -0
  183. package/build/runtime-chunk-T6CHRQ6N.js.gz +0 -0
  184. package/build/runtime-chunk-TU4KDRKR.js +1 -0
  185. package/build/runtime-chunk-TU4KDRKR.js.br +0 -0
  186. package/build/runtime-chunk-TU4KDRKR.js.gz +0 -0
  187. package/build/runtime-chunk-TZCHGFVF.js +1 -0
  188. package/build/runtime-chunk-TZCHGFVF.js.br +3 -0
  189. package/build/runtime-chunk-TZCHGFVF.js.gz +0 -0
  190. package/build/runtime-chunk-UK4GQHMO.js +1 -0
  191. package/build/runtime-chunk-UK4GQHMO.js.br +0 -0
  192. package/build/runtime-chunk-UK4GQHMO.js.gz +0 -0
  193. package/build/runtime-chunk-USXMESRF.js +1 -0
  194. package/build/runtime-chunk-USXMESRF.js.br +0 -0
  195. package/build/runtime-chunk-USXMESRF.js.gz +0 -0
  196. package/build/runtime-chunk-VAVYZ35B.js +1 -0
  197. package/build/runtime-chunk-VAVYZ35B.js.br +0 -0
  198. package/build/runtime-chunk-VAVYZ35B.js.gz +0 -0
  199. package/build/runtime-chunk-VGN7YHB7.js +1 -0
  200. package/build/runtime-chunk-VGN7YHB7.js.br +0 -0
  201. package/build/runtime-chunk-VGN7YHB7.js.gz +0 -0
  202. package/build/runtime-chunk-W7QPV37Y.js +1 -0
  203. package/build/runtime-chunk-W7QPV37Y.js.br +1 -0
  204. package/build/runtime-chunk-W7QPV37Y.js.gz +0 -0
  205. package/build/runtime-chunk-WQXDDUFV.js +1 -0
  206. package/build/runtime-chunk-WQXDDUFV.js.br +0 -0
  207. package/build/runtime-chunk-WQXDDUFV.js.gz +0 -0
  208. package/build/runtime-chunk-XLOQIQSS.js +1 -0
  209. package/build/runtime-chunk-XLOQIQSS.js.br +0 -0
  210. package/build/runtime-chunk-XLOQIQSS.js.gz +0 -0
  211. package/build/runtime-chunk-Y3BMDVJ7.js +1 -0
  212. package/build/runtime-chunk-Y3BMDVJ7.js.br +0 -0
  213. package/build/runtime-chunk-Y3BMDVJ7.js.gz +0 -0
  214. package/build/runtime-chunk-YUK55LCN.js +1 -0
  215. package/build/runtime-chunk-YUK55LCN.js.br +0 -0
  216. package/build/runtime-chunk-YUK55LCN.js.gz +0 -0
  217. package/build/runtime-chunk-YVNDW5TV.js +1 -0
  218. package/build/runtime-chunk-YVNDW5TV.js.br +0 -0
  219. package/build/runtime-chunk-YVNDW5TV.js.gz +0 -0
  220. package/build/runtime-chunk-YXATXASV.js +1 -0
  221. package/build/runtime-chunk-YXATXASV.js.br +1 -0
  222. package/build/runtime-chunk-YXATXASV.js.gz +0 -0
  223. package/build/runtime-chunk-Z5OH244S.js +1 -0
  224. package/build/runtime-chunk-Z5OH244S.js.br +0 -0
  225. package/build/runtime-chunk-Z5OH244S.js.gz +0 -0
  226. package/build/runtime-classicRuntime-F5CEZRNL.js +1 -0
  227. package/build/runtime-classicRuntime-F5CEZRNL.js.br +0 -0
  228. package/build/runtime-classicRuntime-F5CEZRNL.js.gz +0 -0
  229. package/build/runtime-cloners-BLAFVALM.js +1 -0
  230. package/build/runtime-cloners-BLAFVALM.js.br +0 -0
  231. package/build/runtime-cloners-BLAFVALM.js.gz +0 -0
  232. package/build/runtime-collisionBVH-KXZNWTEK.js +1 -0
  233. package/build/runtime-collisionBVH-KXZNWTEK.js.br +0 -0
  234. package/build/runtime-collisionBVH-KXZNWTEK.js.gz +0 -0
  235. package/build/runtime-components-DYNXEVOC.js +1 -0
  236. package/build/runtime-components-DYNXEVOC.js.br +0 -0
  237. package/build/runtime-components-DYNXEVOC.js.gz +0 -0
  238. package/build/runtime-conditional-3A423CXW.js +1 -0
  239. package/build/runtime-conditional-3A423CXW.js.br +0 -0
  240. package/build/runtime-conditional-3A423CXW.js.gz +0 -0
  241. package/build/runtime-createDestroy-FUUG7UAK.js +1 -0
  242. package/build/runtime-createDestroy-FUUG7UAK.js.br +0 -0
  243. package/build/runtime-createDestroy-FUUG7UAK.js.gz +0 -0
  244. package/build/runtime-depthOfField-BBWDHJYP.js +1 -0
  245. package/build/runtime-depthOfField-BBWDHJYP.js.br +0 -0
  246. package/build/runtime-depthOfField-BBWDHJYP.js.gz +0 -0
  247. package/build/runtime-dragDrop-GPFMU3ZB.js +1 -0
  248. package/build/runtime-dragDrop-GPFMU3ZB.js.br +0 -0
  249. package/build/runtime-dragDrop-GPFMU3ZB.js.gz +0 -0
  250. package/build/runtime-fxBloom-IGFV4KJD.js +1 -0
  251. package/build/runtime-fxBloom-IGFV4KJD.js.br +0 -0
  252. package/build/runtime-fxBloom-IGFV4KJD.js.gz +0 -0
  253. package/build/runtime-fxDepthOfField-WX7WD3K4.js +1 -0
  254. package/build/runtime-fxDepthOfField-WX7WD3K4.js.br +0 -0
  255. package/build/runtime-fxDepthOfField-WX7WD3K4.js.gz +0 -0
  256. package/build/runtime-gameControls-TGEINRCX.js +1 -0
  257. package/build/runtime-gameControls-TGEINRCX.js.br +0 -0
  258. package/build/runtime-gameControls-TGEINRCX.js.gz +0 -0
  259. package/build/runtime-hair-YOTI2EFL.js +1 -0
  260. package/build/runtime-hair-YOTI2EFL.js.br +0 -0
  261. package/build/runtime-hair-YOTI2EFL.js.gz +0 -0
  262. package/build/runtime-hueSaturation-X3HAZK2G.js +1 -0
  263. package/build/runtime-hueSaturation-X3HAZK2G.js.br +0 -0
  264. package/build/runtime-hueSaturation-X3HAZK2G.js.gz +0 -0
  265. package/build/runtime-mergeStaticGeometries-JI7YWYGH.js +1 -0
  266. package/build/runtime-mergeStaticGeometries-JI7YWYGH.js.br +3 -0
  267. package/build/runtime-mergeStaticGeometries-JI7YWYGH.js.gz +0 -0
  268. package/build/runtime-miscActions-INSZA2CP.js +1 -0
  269. package/build/runtime-miscActions-INSZA2CP.js.br +0 -0
  270. package/build/runtime-miscActions-INSZA2CP.js.gz +0 -0
  271. package/build/runtime-mouseHover-GZW7KW6H.js +1 -0
  272. package/build/runtime-mouseHover-GZW7KW6H.js.br +0 -0
  273. package/build/runtime-mouseHover-GZW7KW6H.js.gz +0 -0
  274. package/build/runtime-navmesh-UJTUAHXM.js +1 -0
  275. package/build/runtime-navmesh-UJTUAHXM.js.br +0 -0
  276. package/build/runtime-navmesh-UJTUAHXM.js.gz +0 -0
  277. package/build/runtime-noise-UF5CMIO3.js +1 -0
  278. package/build/runtime-noise-UF5CMIO3.js.br +0 -0
  279. package/build/runtime-noise-UF5CMIO3.js.gz +0 -0
  280. package/build/runtime-particles-T2CREK6M.js +1 -0
  281. package/build/runtime-particles-T2CREK6M.js.br +0 -0
  282. package/build/runtime-particles-T2CREK6M.js.gz +0 -0
  283. package/build/runtime-paths-PRHQFJ3X.js +1 -0
  284. package/build/runtime-paths-PRHQFJ3X.js.br +0 -0
  285. package/build/runtime-paths-PRHQFJ3X.js.gz +0 -0
  286. package/build/runtime-pixelation-QFSF4L6X.js +1 -0
  287. package/build/runtime-pixelation-QFSF4L6X.js.br +0 -0
  288. package/build/runtime-pixelation-QFSF4L6X.js.gz +0 -0
  289. package/build/runtime-resize-SM6PZWJY.js +1 -0
  290. package/build/runtime-resize-SM6PZWJY.js.br +0 -0
  291. package/build/runtime-resize-SM6PZWJY.js.gz +0 -0
  292. package/build/runtime-sceneTransition-JUZVB2S3.js +1 -0
  293. package/build/runtime-sceneTransition-JUZVB2S3.js.br +0 -0
  294. package/build/runtime-sceneTransition-JUZVB2S3.js.gz +0 -0
  295. package/build/runtime-scroll-Q6NRRL4F.js +1 -0
  296. package/build/runtime-scroll-Q6NRRL4F.js.br +0 -0
  297. package/build/runtime-scroll-Q6NRRL4F.js.gz +0 -0
  298. package/build/runtime-shapeBlends-CPHLT3XC.js +1 -0
  299. package/build/runtime-shapeBlends-CPHLT3XC.js.br +0 -0
  300. package/build/runtime-shapeBlends-CPHLT3XC.js.gz +0 -0
  301. package/build/runtime-text-TBHPCNPL.js +1 -0
  302. package/build/runtime-text-TBHPCNPL.js.br +0 -0
  303. package/build/runtime-text-TBHPCNPL.js.gz +0 -0
  304. package/build/runtime-textInputs-4HQER44D.js +1 -0
  305. package/build/runtime-textInputs-4HQER44D.js.br +0 -0
  306. package/build/runtime-textInputs-4HQER44D.js.gz +0 -0
  307. package/build/runtime-timeline-UKR4DEQS.js +1 -0
  308. package/build/runtime-timeline-UKR4DEQS.js.br +0 -0
  309. package/build/runtime-timeline-UKR4DEQS.js.gz +0 -0
  310. package/build/runtime-tracking-5HISHPEY.js +1 -0
  311. package/build/runtime-tracking-5HISHPEY.js.br +0 -0
  312. package/build/runtime-tracking-5HISHPEY.js.gz +0 -0
  313. package/build/runtime-transitions-FBNOSFXY.js +1 -0
  314. package/build/runtime-transitions-FBNOSFXY.js.br +0 -0
  315. package/build/runtime-transitions-FBNOSFXY.js.gz +0 -0
  316. package/build/runtime-ui2d-3AMS3CSG.js +1 -0
  317. package/build/runtime-ui2d-3AMS3CSG.js.br +0 -0
  318. package/build/runtime-ui2d-3AMS3CSG.js.gz +0 -0
  319. package/build/runtime-updater-3ELP7WMM.js +1 -0
  320. package/build/runtime-updater-3ELP7WMM.js.br +1 -0
  321. package/build/runtime-updater-3ELP7WMM.js.gz +0 -0
  322. package/build/runtime-variables-U36KPJ5V.js +1 -0
  323. package/build/runtime-variables-U36KPJ5V.js.br +0 -0
  324. package/build/runtime-variables-U36KPJ5V.js.gz +0 -0
  325. package/build/runtime-vectorShapes-GIS26ELU.js +1 -0
  326. package/build/runtime-vectorShapes-GIS26ELU.js.br +0 -0
  327. package/build/runtime-vectorShapes-GIS26ELU.js.gz +0 -0
  328. package/build/runtime-video-TZNR7MEM.js +1 -0
  329. package/build/runtime-video-TZNR7MEM.js.br +0 -0
  330. package/build/runtime-video-TZNR7MEM.js.gz +0 -0
  331. package/build/runtime-vignette-3KJD4P5D.js +1 -0
  332. package/build/runtime-vignette-3KJD4P5D.js.br +0 -0
  333. package/build/runtime-vignette-3KJD4P5D.js.gz +0 -0
  334. package/build/runtime-webgpu-LYDFJW3X.js +1 -0
  335. package/build/runtime-webgpu-LYDFJW3X.js.br +0 -0
  336. package/build/runtime-webgpu-LYDFJW3X.js.gz +0 -0
  337. package/build/runtime.cjs +6283 -4577
  338. package/build/runtime.js +1 -8186
  339. package/build/runtime.js.br +0 -0
  340. package/build/runtime.js.gz +0 -0
  341. package/build/runtime.standalone.js +1 -0
  342. package/build/runtime.standalone.js.br +0 -0
  343. package/build/runtime.standalone.js.gz +0 -0
  344. package/build/runtime.standalone.webgl.js +1 -0
  345. package/build/runtime.standalone.webgl.js.br +0 -0
  346. package/build/runtime.standalone.webgl.js.gz +0 -0
  347. package/build/runtime.standalone.webgpu.js +1 -0
  348. package/build/runtime.standalone.webgpu.js.br +0 -0
  349. package/build/runtime.standalone.webgpu.js.gz +0 -0
  350. package/build/runtime.standalone.webgpu.micro.js +1 -0
  351. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  352. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  353. package/build/runtime.standalone.webgpu.min.js +1 -0
  354. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  355. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  356. package/build/sky-alto.png +0 -0
  357. package/build/sky-cirrus.png +0 -0
  358. package/build/smaa-area.png +0 -0
  359. package/build/smaa-node-area.png +0 -0
  360. package/build/smaa-node-search.png +0 -0
  361. package/build/smaa-search.png +0 -0
  362. package/build/snippets/hana-82e9eb82a79dead4/js-imports.js +93 -0
  363. package/package.json +104 -89
  364. package/runtime.d.ts +301 -2
  365. package/build/ui.js +0 -3
@@ -0,0 +1 @@
1
+ import{c as t}from"./runtime-chunk-NSD7DU3P.js";import{b as i,e as a}from"./runtime-chunk-MM75L5X4.js";import"./runtime-chunk-Z5OH244S.js";import{a as s}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-OW6T4XFV.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var e=new Map,o=new Map,d=class{constructor(i,a,s,d){this.data=a,this.isPlayAudioAction=!0;let{audio:n,volume:r,delay:h,loop:u}=a;if(!n)throw new Error("Missing property");try{let i="string"==typeof n?d.getAudio(n).src:n.data;this.audioPlayer=new t({src:i,volume:r,delay:h,loop:u})}catch{console.warn(`Could not create an audio player for this object: "${s.name}" and this audio: "${n}"`)}o.has(s.uuid)?o.get(s.uuid).push(this):o.set(s.uuid,[this]),e.set(i,this)}playByToggle(){"stop"===this.data.toggle?"playing"===this.audioPlayer?.status?this.audioPlayer.stop():(this.audioPlayer?.stop(),this.audioPlayer?.play()):"pause"===this.data.toggle?"playing"===this.audioPlayer?.status?this.audioPlayer?.pause():this.audioPlayer?.play():(this.audioPlayer?.stop(),this.audioPlayer?.play())}dispose(){this.audioPlayer?.stop()}},n=class{constructor(t){this.data=t,this.isPauseAudioAction=!0}dispatch(){this.data.playAudio?this.pauseAudio(this.data.playAudio):this.data.object?this.pauseAllAudiosFromObject(this.data.object):this.pauseAllAudios()}pauseAudio(t){let i=e.get(t);!i||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.audioPlayer?.[this.data.interaction](),this.disposeDelay()},this.data.delay)):i.audioPlayer?.[this.data.interaction]())}pauseAllAudiosFromObject(t){let i=o.get(t);!i?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.forEach(t=>t.audioPlayer?.[this.data.interaction]()),this.disposeDelay()},this.data.delay)):i.forEach(t=>t.audioPlayer?.[this.data.interaction]()))}pauseAllAudios(){let t=[...o.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(t=>{t.forEach(t=>{t.audioPlayer?.[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(t=>{t.forEach(t=>{t.audioPlayer?.[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},r=class{constructor(t,i,a,s,e){if(this.data=i,this.shared=s,this.condition=e,"play"===i.interaction)this.interaction=new d(t,i,a,s);else{if("pause"!==i.interaction&&"stop"!==i.interaction)throw new Error("Missing property");this.interaction=new n(i)}}dispatchBasic(){if(!1===a(this.shared,this.condition))return!1;this.interaction instanceof d?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(!1===a(this.shared,this.condition))return!1;this.interaction instanceof d?this.interaction.audioPlayer?.play():this.interaction.dispatch()}dispatchGameControl(t){if(!1===a(this.shared,this.condition))return!1;this.interaction instanceof d&&("start"===t?this.interaction.audioPlayer?.play():this.interaction.audioPlayer?.stop())}dispose(){this.interaction.dispose()}};i("Audio",({id:t,data:i,object:a,shared:s,actionCondition:e})=>new r(t,i,a,s,e)),s("audio");
@@ -0,0 +1 @@
1
+ import{a as e}from"./runtime-chunk-YXATXASV.js";import"./runtime-chunk-OFPUAZKY.js";import{a as t}from"./runtime-chunk-EOV2DL2V.js";import"./runtime-chunk-Y3BMDVJ7.js";import{Bc as n,Db as r,Dc as i,Fc as s,Ib as a,Lc as l,Le as h,Oc as o,Tc as u,Vc as c,Zc as d,a as g,ce as y,dd as f,ld as p,m as v,qa as m,ua as w,we as b}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var x=class extends y{constructor(e=new i){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new h(null),texelSize:new h(new i),halfTexelSize:new h(new i),kernel:new h(0),scale:new h(1)},blending:v,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#include <dithering_pars_fragment>\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;\n#include <colorspace_fragment>\n#include <dithering_fragment>\n}",vertexShader:"uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.setTexelSize(e.x,e.y)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.inputBuffer=e}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(){return this.uniforms.scale.value}setScale(e){this.uniforms.scale.value=e}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(e){this.uniforms.kernel.value=e}setKernel(e){this.kernel=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t),this.uniforms.halfTexelSize.value.set(e,t).multiplyScalar(.5)}setSize(e,t){let n=this.uniforms;n.texelSize.value.set(1/e,1/t),n.halfTexelSize.value.copy(n.texelSize.value).multiplyScalar(.5)}},A=class extends y{constructor(e=!1,t=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:g.replace(/\D+/g,"")},uniforms:{inputBuffer:new h(null),threshold:new h(0),smoothing:new h(1),range:new h(null)},blending:v,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#if THREE_REVISION < 143\n#define luminance(v) linearToRelativeLuminance(v)\n#endif\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef RANGE\nuniform vec2 range;\n#elif defined(THRESHOLD)\nuniform float threshold;uniform float smoothing;\n#endif\nvarying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);\n#ifdef RANGE\nfloat low=step(range.x,l);float high=step(l,range.y);l*=low*high;\n#elif defined(THRESHOLD)\nl=smoothstep(threshold,threshold+smoothing,l);\n#endif\n#ifdef COLOR\ngl_FragColor=vec4(texel.rgb*l,l);\n#else\ngl_FragColor=vec4(l);\n#endif\n}",vertexShader:"varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.colorOutput=e,this.luminanceRange=t}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get threshold(){return this.uniforms.threshold.value}set threshold(e){this.smoothing>0||e>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=e}getThreshold(){return this.threshold}setThreshold(e){this.threshold=e}get smoothing(){return this.uniforms.smoothing.value}set smoothing(e){this.threshold>0||e>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=e}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(e){this.smoothing=e}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(e){}get colorOutput(){return void 0!==this.defines.COLOR}set colorOutput(e){e?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(e){return this.colorOutput}setColorOutputEnabled(e){this.colorOutput=e}get useRange(){return null!==this.luminanceRange}set useRange(e){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(e){null!==e?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=e,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(e){this.luminanceRange=e}},S=new b,F=null,T=class{constructor(e="Pass",t=new c,n=S){this.name=e,this.renderer=null,this.scene=t,this.camera=n,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){let t=this.getFullscreenMaterial();null!==t&&(t.needsUpdate=!0),this.rtt=!e}}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return null!==this.screen?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;null!==t?t.material=e:(t=new p(function(){if(null===F){let e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]);void 0!==(F=new f).setAttribute?(F.setAttribute("position",new d(e,3)),F.setAttribute("uv",new d(t,2))):(F.addAttribute("position",new d(e,3)),F.addAttribute("uv",new d(t,2)))}return F}(),e),t.frustumCulled=!1,null===this.scene&&(this.scene=new c),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=r){}render(e,t,n,r,i){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,n){}dispose(){for(let e of Object.keys(this)){let t=this[e];if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose){if(t instanceof c||t===this.renderer)continue;this[e].dispose()}}}},z=(new u,-1),U=class extends n{constructor(e,t=z,n=z,r=1){super(),this.resizable=e,this.base=new i(1,1),this.preferred=new i(t,n),this.target=this.preferred,this.s=r}get width(){let e,{base:t,preferred:n,scale:r}=this;return e=n.width!==z?n.width:n.height!==z?Math.round(n.height*(t.width/Math.max(t.height,1))):Math.round(t.width*r),e}set width(e){this.preferredWidth=e}get height(){let e,{base:t,preferred:n,scale:r}=this;return e=n.height!==z?n.height:n.width!==z?Math.round(n.width/Math.max(t.width/Math.max(t.height,1),1)):Math.round(t.height*r),e}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferred.setScalar(z),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.base.width}set baseWidth(e){this.base.width!==e&&(this.base.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseWidth(){return this.base.width}setBaseWidth(e){this.base.width!==e&&(this.base.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get baseHeight(){return this.base.height}set baseHeight(e){this.base.height!==e&&(this.base.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){(this.base.width!==e||this.base.height!==t)&&(this.base.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get preferredWidth(){return this.preferred.width}set preferredWidth(e){this.preferred.width!==e&&(this.preferred.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferred.height}set preferredHeight(e){this.preferred.height!==e&&(this.preferred.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){(this.preferred.width!==e||this.preferred.height!==t)&&(this.preferred.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}copy(e){this.base.set(e.getBaseWidth(),e.getBaseHeight()),this.preferred.set(e.getPreferredWidth(),e.getPreferredHeight()),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height)}static get AUTO_SIZE(){return z}},E=(new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]),16),M=new Map([[0,null],[1,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}"],[2,"vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}"],[3,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}"],[4,"float blend(const in float x,const in float y){return(y==0.0)?y:max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[5,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[6,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}"],[7,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}"],[8,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}"],[9,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}"],[10,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}"],[11,"float blend(const in float x,const in float y){return(y>0.0)?min(x/y,1.0):1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[12,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}"],[13,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}"],[14,"float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[15,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[E,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}"],[17,"float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[18,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}"]]),B=class extends n{constructor(e,t=1){super(),this.f=e,this.opacity=new h(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this.f}set blendFunction(e){this.f=e,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return M.get(this.blendFunction)}},R=class extends n{constructor(e,t,{attributes:n=0,blendFunction:r=E,defines:i=new Map,uniforms:s=new Map,extensions:a=null,vertexShader:l=null}={}){super(),this.name=e,this.renderer=null,this.attributes=n,this.fragmentShader=t,this.vertexShader=l,this.defines=i,this.uniforms=s,this.extensions=a,this.blendMode=new B(r),this.blendMode.addEventListener("change",e=>this.setChanged())}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e,t=r){}update(e,t,n){}setSize(e,t){}initialize(e,t,n){}dispose(){for(let e of Object.keys(this)){let t=this[e];if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose){if(t instanceof c||t===this.renderer)continue;this[e].dispose()}}}},H=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],O=class extends T{constructor({resolutionScale:e=.5,width:t=U.AUTO_SIZE,height:n=U.AUTO_SIZE,kernelSize:r=I.LARGE}={}){super("KawaseBlurPass"),this.renderTargetA=new l(1,1,{minFilter:m,magFilter:m,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";let i=this.resolution=new U(this,t,n,e);i.addEventListener("change",e=>this.setSize(i.baseWidth,i.baseHeight)),this.blurMaterial=new x,this.ditheredBlurMaterial=new x,this.ditheredBlurMaterial.uniforms.scale=this.blurMaterial.uniforms.scale,this.ditheredBlurMaterial.dithering=!0,this.dithering=!1,this.kernelSize=r}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get scale(){return this.blurMaterial.scale}set scale(e){this.blurMaterial.scale=e}getScale(){return this.blurMaterial.scale}setScale(e){this.blurMaterial.scale=e}getKernelSize(){return this.kernelSize}setKernelSize(e){this.kernelSize=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,n,r,i){let s,a,l=this.scene,h=this.camera,o=this.renderTargetA,u=this.renderTargetB,c=H[this.kernelSize],d=this.blurMaterial,g=t;for(this.fullscreenMaterial=d,s=0,a=c.length-1;s<a;++s){let t=1&s?u:o;d.kernel=c[s],d.inputBuffer=g.texture,e.setRenderTarget(t),e.render(l,h),g=t}this.dithering&&(d=this.ditheredBlurMaterial,this.fullscreenMaterial=d),d.kernel=c[s],d.inputBuffer=g.texture,e.setRenderTarget(this.renderToScreen?null:n),e.render(l,h)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t);let r=n.width,i=n.height;this.renderTargetA.setSize(r,i),this.renderTargetB.setSize(r,i),this.blurMaterial.setSize(r,i),this.ditheredBlurMaterial.setSize(r,i)}initialize(e,t,n){void 0!==n&&(this.renderTargetA.texture.type=n,this.renderTargetB.texture.type=n,n!==w?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.ditheredBlurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):e.outputColorSpace===a&&(this.renderTargetA.texture.colorSpace=a,this.renderTargetB.texture.colorSpace=a))}static get AUTO_SIZE(){return U.AUTO_SIZE}},P=class extends T{constructor({width:e=U.AUTO_SIZE,height:t=U.AUTO_SIZE,renderTarget:n,luminanceRange:r,colorOutput:i}={}){super("LuminancePass"),this.fullscreenMaterial=new A(i,r),this.needsSwap=!1,this.renderTarget=n,void 0===this.renderTarget&&(this.renderTarget=new l(1,1,{minFilter:m,magFilter:m,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1);let s=this.resolution=new U(this,e,t);s.addEventListener("change",e=>this.setSize(s.baseWidth,s.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(e,t,n,r,i){this.fullscreenMaterial.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height)}initialize(e,t,n){void 0!==n&&n!==w&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},I={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},L=class extends R{constructor({blendFunction:e=E,luminanceThreshold:t=.9,luminanceSmoothing:n=.025,resolutionScale:r=.5,intensity:i=1,width:s=U.AUTO_SIZE,height:a=U.AUTO_SIZE,kernelSize:o=I.LARGE}={}){super("BloomEffect","#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D map;\n#else\nuniform lowp sampler2D map;\n#endif\nuniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}",{blendFunction:e,uniforms:new Map([["map",new h(null)],["intensity",new h(i)]])}),this.renderTarget=new l(1,1,{minFilter:m,magFilter:m,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.luminancePass=new P({renderTarget:this.renderTarget,colorOutput:!0}),this.luminanceMaterial.threshold=t,this.luminanceMaterial.smoothingFactor=n,this.blurPass=new O({resolutionScale:r,width:s,height:a,kernelSize:o});let u=this.blurPass.getResolution();u.addEventListener("change",e=>this.setSize(u.baseWidth,u.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get dithering(){return this.blurPass.dithering}set dithering(e){this.blurPass.dithering=e}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(e){this.blurPass.kernelSize=e}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(e){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(e){this.uniforms.get("intensity").value=e}getIntensity(){return this.intensity}setIntensity(e){this.intensity=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}update(e,t,n){let r=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(e,t,r),this.blurPass.render(e,r,r)):this.blurPass.render(e,t,r)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height),this.luminancePass.resolution.copy(n)}initialize(e,t,n){this.blurPass.initialize(e,t,n),void 0!==n&&(this.renderTarget.texture.type=n,e.outputColorSpace===a&&(this.renderTarget.texture.colorSpace=a))}};function _(e,t,n){return e+(t-e)*n}function k(e,t,n,r){let i=_(e,t,.75),s=_(n,r,.75);return _(i,s,.875)}new s,new o,new u,Math.PI,new s,new s,new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),new Map([[k(0,0,0,0),new Float32Array([0,0,0,0])],[k(0,0,0,1),new Float32Array([0,0,0,1])],[k(0,0,1,0),new Float32Array([0,0,1,0])],[k(0,0,1,1),new Float32Array([0,0,1,1])],[k(0,1,0,0),new Float32Array([0,1,0,0])],[k(0,1,0,1),new Float32Array([0,1,0,1])],[k(0,1,1,0),new Float32Array([0,1,1,0])],[k(0,1,1,1),new Float32Array([0,1,1,1])],[k(1,0,0,0),new Float32Array([1,0,0,0])],[k(1,0,0,1),new Float32Array([1,0,0,1])],[k(1,0,1,0),new Float32Array([1,0,1,0])],[k(1,0,1,1),new Float32Array([1,0,1,1])],[k(1,1,0,0),new Float32Array([1,1,0,0])],[k(1,1,0,1),new Float32Array([1,1,0,1])],[k(1,1,1,0),new Float32Array([1,1,1,0])],[k(1,1,1,1),new Float32Array([1,1,1,1])]]);var D=class extends e{constructor(){super(L),this.blendFunction=E}set intensity(e){this.effect.intensity=e}get intensity(){return this.effect.intensity}set luminanceThreshold(e){this.effect.luminanceMaterial.threshold=e}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(e){this.effect.luminanceMaterial.smoothing=e}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(e){this.effect.blurPass.scale=e}get blurScale(){return this.effect.blurPass.scale}set kernelSize(e){this.effect.blurPass.kernelSize=e}get kernelSize(){return this.effect.blurPass.kernelSize}};t("bloom",()=>new D);
@@ -0,0 +1 @@
1
+ import{a as t}from"./runtime-chunk-YXATXASV.js";import"./runtime-chunk-OFPUAZKY.js";import{a as n}from"./runtime-chunk-EOV2DL2V.js";import"./runtime-chunk-Y3BMDVJ7.js";import{Bc as e,Db as r,Fc as a,Le as o,Oc as i,Tc as s,Vc as c,we as y}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";new y,new s,new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]);var l=new Map([[0,null],[1,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}"],[2,"vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}"],[3,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}"],[4,"float blend(const in float x,const in float y){return(y==0.0)?y:max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[5,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[6,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}"],[7,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}"],[8,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}"],[9,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}"],[10,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}"],[11,"float blend(const in float x,const in float y){return(y>0.0)?min(x/y,1.0):1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[12,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}"],[13,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}"],[14,"float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[15,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[16,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}"],[17,"float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[18,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}"]]),u=class extends e{constructor(t,n=1){super(),this.f=t,this.opacity=new o(n)}getOpacity(){return this.opacity.value}setOpacity(t){this.opacity.value=t}get blendFunction(){return this.f}set blendFunction(t){this.f=t,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(t){this.blendFunction=t}getShaderCode(){return l.get(this.blendFunction)}},x=class extends e{constructor(t,n,{attributes:e=0,blendFunction:r=16,defines:a=new Map,uniforms:o=new Map,extensions:i=null,vertexShader:s=null}={}){super(),this.name=t,this.renderer=null,this.attributes=e,this.fragmentShader=n,this.vertexShader=s,this.defines=a,this.uniforms=o,this.extensions=i,this.blendMode=new u(r),this.blendMode.addEventListener("change",t=>this.setChanged())}getName(){return this.name}setRenderer(t){this.renderer=t}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(t){this.attributes=t,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(t){this.fragmentShader=t,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(t){this.vertexShader=t,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(t,n=r){}update(t,n,e){}setSize(t,n){}initialize(t,n,e){}dispose(){for(let t of Object.keys(this)){let n=this[t];if(null!==n&&"object"==typeof n&&"function"==typeof n.dispose){if(n instanceof c||n===this.renderer)continue;this[t].dispose()}}}},w=(new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10]),class extends x{constructor({blendFunction:t=13,brightness:n=0,contrast:e=0}={}){super("BrightnessContrastEffect","uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",{blendFunction:t,uniforms:new Map([["brightness",new o(n)],["contrast",new o(e)]])})}get brightness(){return this.uniforms.get("brightness").value}set brightness(t){this.uniforms.get("brightness").value=t}getBrightness(t){return this.brightness}setBrightness(t){this.brightness=t}get contrast(){return this.uniforms.get("contrast").value}set contrast(t){this.uniforms.get("contrast").value=t}getContrast(t){return this.contrast}setContrast(t){this.contrast=t}});function d(t,n,e){return t+(n-t)*e}function b(t,n,e,r){let a=d(t,n,.75),o=d(e,r,.75);return d(a,o,.875)}new a,new i,new s,Math.PI,new a,new a,new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),new Map([[b(0,0,0,0),new Float32Array([0,0,0,0])],[b(0,0,0,1),new Float32Array([0,0,0,1])],[b(0,0,1,0),new Float32Array([0,0,1,0])],[b(0,0,1,1),new Float32Array([0,0,1,1])],[b(0,1,0,0),new Float32Array([0,1,0,0])],[b(0,1,0,1),new Float32Array([0,1,0,1])],[b(0,1,1,0),new Float32Array([0,1,1,0])],[b(0,1,1,1),new Float32Array([0,1,1,1])],[b(1,0,0,0),new Float32Array([1,0,0,0])],[b(1,0,0,1),new Float32Array([1,0,0,1])],[b(1,0,1,0),new Float32Array([1,0,1,0])],[b(1,0,1,1),new Float32Array([1,0,1,1])],[b(1,1,0,0),new Float32Array([1,1,0,0])],[b(1,1,0,1),new Float32Array([1,1,0,1])],[b(1,1,1,0),new Float32Array([1,1,1,0])],[b(1,1,1,1),new Float32Array([1,1,1,1])]]);var h=class extends t{constructor(){super(w)}set contrast(t){this.effect.uniforms.get("contrast").value=t}get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(t){this.effect.uniforms.get("brightness").value=t}get brightness(){return this.effect.uniforms.get("brightness").value}};n("brightnessContrast",()=>new h);
@@ -0,0 +1 @@
1
+ import{a as t}from"./runtime-chunk-YXATXASV.js";import"./runtime-chunk-OFPUAZKY.js";import{a as e}from"./runtime-chunk-EOV2DL2V.js";import"./runtime-chunk-Y3BMDVJ7.js";import{Bc as n,Db as r,Dc as a,Fc as o,Le as i,Oc as c,Tc as y,Vc as s,we as l}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";new l,new y,new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]);var v=new Map([[0,null],[1,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}"],[2,"vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}"],[3,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}"],[4,"float blend(const in float x,const in float y){return(y==0.0)?y:max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[5,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[6,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}"],[7,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}"],[8,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}"],[9,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}"],[10,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}"],[11,"float blend(const in float x,const in float y){return(y>0.0)?min(x/y,1.0):1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[12,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}"],[13,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}"],[14,"float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[15,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[16,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}"],[17,"float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[18,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}"]]),f=class extends n{constructor(t,e=1){super(),this.f=t,this.opacity=new i(e)}getOpacity(){return this.opacity.value}setOpacity(t){this.opacity.value=t}get blendFunction(){return this.f}set blendFunction(t){this.f=t,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(t){this.blendFunction=t}getShaderCode(){return v.get(this.blendFunction)}},u=class extends n{constructor(t,e,{attributes:n=0,blendFunction:r=16,defines:a=new Map,uniforms:o=new Map,extensions:i=null,vertexShader:c=null}={}){super(),this.name=t,this.renderer=null,this.attributes=n,this.fragmentShader=e,this.vertexShader=c,this.defines=a,this.uniforms=o,this.extensions=i,this.blendMode=new f(r),this.blendMode.addEventListener("change",t=>this.setChanged())}getName(){return this.name}setRenderer(t){this.renderer=t}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(t){this.attributes=t,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(t){this.fragmentShader=t,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(t){this.vertexShader=t,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(t,e=r){}update(t,e,n){}setSize(t,e){}initialize(t,e,n){}dispose(){for(let t of Object.keys(this)){let e=this[t];if(null!==e&&"object"==typeof e&&"function"==typeof e.dispose){if(e instanceof s||e===this.renderer)continue;this[t].dispose()}}}},x=(new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10]),class extends u{constructor({blendFunction:t=13,offset:e=new a(.001,5e-4)}={}){super("ChromaticAberrationEffect","varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;outputColor=vec4(ra.x,inputColor.g,ba.x,max(max(ra.y,ba.y),inputColor.a));}",{vertexShader:"uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vec2 shift=offset*vec2(1.0,aspect);vUvR=uv+shift;vUvB=uv-shift;}",blendFunction:t,attributes:2,uniforms:new Map([["offset",new i(e)]])})}get offset(){return this.uniforms.get("offset").value}set offset(t){this.uniforms.get("offset").value=t}getOffset(){return this.offset}setOffset(t){this.offset=t}});function w(t,e,n){return t+(e-t)*n}function d(t,e,n,r){let a=w(t,e,.75),o=w(n,r,.75);return w(a,o,.875)}new o,new c,new y,Math.PI,new o,new o,new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),new Map([[d(0,0,0,0),new Float32Array([0,0,0,0])],[d(0,0,0,1),new Float32Array([0,0,0,1])],[d(0,0,1,0),new Float32Array([0,0,1,0])],[d(0,0,1,1),new Float32Array([0,0,1,1])],[d(0,1,0,0),new Float32Array([0,1,0,0])],[d(0,1,0,1),new Float32Array([0,1,0,1])],[d(0,1,1,0),new Float32Array([0,1,1,0])],[d(0,1,1,1),new Float32Array([0,1,1,1])],[d(1,0,0,0),new Float32Array([1,0,0,0])],[d(1,0,0,1),new Float32Array([1,0,0,1])],[d(1,0,1,0),new Float32Array([1,0,1,0])],[d(1,0,1,1),new Float32Array([1,0,1,1])],[d(1,1,0,0),new Float32Array([1,1,0,0])],[d(1,1,0,1),new Float32Array([1,1,0,1])],[d(1,1,1,0),new Float32Array([1,1,1,0])],[d(1,1,1,1),new Float32Array([1,1,1,1])]]);var A=class extends t{constructor(){super(x),this.effect.offset=new a(.01,.01)}set offset(t){this.effect.offset.set(t[0]/1e3,t[1]/1e3)}get offset(){return[1e3*this.effect.offset.x,1e3*this.effect.offset.y]}};e("chromaticAberration",()=>new A);
@@ -0,0 +1 @@
1
+ import{a as e,b as t}from"./runtime-chunk-ARTGMJ7O.js";import{c as s,d as o}from"./runtime-chunk-FDRTCOJ5.js";import{da as r}from"./runtime-chunk-YUK55LCN.js";import{h as a,o as i,p as n,q as h,r as d,t as l}from"./runtime-chunk-DJJZN367.js";import{Oc as m,bd as p,dd as u,ue as c}from"./runtime-chunk-VGN7YHB7.js";var g=new m,y=new m;function b(e){let t=!1;return e.scene.objects.traverse((e,s)=>{"BooleanGeometry"===s.geometry?.type&&(t=!0)}),t}var f,A=class extends r{constructor(e,t,s){super(e,t),this.data=t,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new u,this.onAfterRender=(e,t,s,o,r,a)=>{super.onAfterRender(e,t,s,o,r,a),this.recomputeBoolean()},this.geometry.userData.parameters={width:0,height:0,depth:0}}get booleanOp(){return this.data.geometry.operation}get phongAngle(){return this.data.geometry.phongAngle??45}get isLOD(){return this.recomputeBoolean(),!1}updateByPatchedOp(e,t,s){super.updateByPatchedOp(e,t,s),1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&void 0!==e.props.operation&&(this.freeBooleanPointer(),this.resetBBoxNeedsUpdate())}freeBooleanPointer(){super.freeBooleanPointer(),this.geometry.dispose()}recomputeBoolean(s,o=!0){if(-1!==this.booleanMeshSetAddress&&!s)return;for(let e=0;e<this.children.length;e++){let t=this.children[e];t instanceof A&&!0===t.dataPatched.visible&&t.recomputeBoolean(!0===s,o)}this.meshSetAddresses=[];for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t instanceof l&&!0===t.dataPatched.visible&&t.geometry.attributes.position?.count>0&&t.geometry.drawRange.count>0&&0!==t.booleanMeshSetAddress){g.multiplyMatrices(t.hiddenMatrix,t.matrix).multiply(t.pivotMatrix);try{if(-1===t.booleanMeshSetAddress){if((t.geometry.index??t.geometry.getAttribute("position")).count/3<15e5&&(t.booleanMeshSetAddress=i(t.geometry,!0===s,o)),-1===t.booleanMeshSetAddress)return;d(t.booleanMeshSetAddress,g),t.booleanMatrixInvOld.copy(g).invert(),t.booleanWasTransformed=!1}else t instanceof A&&!0===t.needsTransformForDownstream?(d(t.booleanMeshSetAddress,g),t.needsTransformForDownstream=!1):!0===t.booleanWasTransformed&&(d(t.booleanMeshSetAddress,y.multiplyMatrices(g,t.booleanMatrixInvOld)),t.booleanMatrixInvOld.copy(g).invert(),t.booleanWasTransformed=!1)}catch(e){console.error(e),t.booleanMeshSetAddress=0,t.geometry.userData.booleanOperationDidFail=!0;continue}this.meshSetAddresses.push(t.booleanMeshSetAddress),t.geometry.userData.booleanOperationDidFail=!1}}if(0===this.meshSetAddresses.length){if(0!==this.geometry.getAttribute("position")?.array.length){let e=this.geometry;e.dispose(),this.geometry=new u,this.geometry.userData=e.userData,this.geometry.boundingSphere=e.boundingSphere,this.geometry.setAttribute("position",new p([],3))}return void this.geometry.setDrawRange(0,0)}if(!0===s)return h(this.meshSetAddresses,this.booleanOp);let r=this.geometry;r.dispose(),this.geometry=new u,this.geometry.userData=r.userData,this.geometry.boundingSphere=r.boundingSphere;try{this.booleanMeshSetAddress=n(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(e){this.booleanMeshSetAddress=0,this.geometry.userData.booleanOperationDidFail=!0,console.error(e)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0,e(this),t(this)}dispose(){super.dispose(),this.geometry.dispose()}};(f||(f={})).is=function(e){return a.is(e)&&e instanceof c};var S=(e,t)=>class extends(o(e,t)){updateState_Light(e,t){if(this.updateState_Entity(e,t),void 0!==e.color&&(this.color=t.shared.color(e.color)),void 0!==e.intensity&&(this.intensity=e.intensity*Math.PI),void 0!==e.depth){let t=this.shadow;t.camera.far=e.depth,t.needsUpdate=!0}void 0!==e.shadows&&(this.castShadow=e.shadows)}},M=e=>e instanceof l,v=e=>null!==e&&e instanceof A,D=e=>s.is(e);export{b as a,A as b,f as c,S as d,M as e,v as f,D as g};
@@ -0,0 +1 @@
1
+ import{t as e}from"./runtime-chunk-DJJZN367.js";import{Ec as t,Fc as a,Fd as s,Gc as i,Ge as r,Ib as n,Oc as h,Tc as o,Wd as l,Xd as d,Zc as c,kd as u,ld as g}from"./runtime-chunk-VGN7YHB7.js";var p=null;function b(e){p=e}function m(){return p}var S=null;function f(e){S=e}function M(){return S}var y=new o;function x(e,t,a){return y.setRGB(e,t,a,n),{r:y.r,g:y.g,b:y.b}}var R=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t,w=e=>Array.isArray(e)&&"number"==typeof e[0]&&"number"==typeof e[1]?[e[0],e[1]]:[0,0];function v(e,t,a){let s,i=R(e.angle,0),[r,n]=w(e.offset),[h,o]=w(e.morph),l=e.colors??[],d=e.steps??[],c=Math.min(10,l.length,d.length);if(0===c)return[1,1,1,1];if(1===e.gradientType){let e=3*(t+h)-(t+r)-1,l=3*(a+o)-(a+n)-1;s=Math.hypot(e,l)+i}else if(2===e.gradientType){let e=-1*Math.atan2(t+h-.5+r,a+o-.5+n),l=i/Math.PI/-2+.5*e/Math.PI;s=l-Math.floor(l)}else{let e=.5+h/(0!==t?t:1e-6),l=o/(0!==a?a:1e-6),d=Math.cos(i)*e-Math.sin(i)*l,c=Math.sin(i)*e+Math.cos(i)*l,u=d*d+c*c;s=u>1e-12?(((t-.5+r)/2+d/2)*d+((a-.5+n)/2+c/2)*c)/u:0}let u=l[0][0],g=l[0][1],p=l[0][2],b=l[0][3];for(let t=1;t<c;t++){let a=d[t-1],i=d[t]-a,r=0!==i?Math.min(1,Math.max(0,(s-a)/i)):s>=a?1:0;e.smooth&&(r=r*r*(3-2*r)),u+=(l[t][0]-u)*r,g+=(l[t][1]-g)*r,p+=(l[t][2]-p)*r,b+=(l[t][3]-b)*r}return[u,g,p,b]}function A(e,t){let a=e,s=a?.data?.layers;if(s&&"function"==typeof s.forEach){let e=t,a=[];return s.forEach(t=>{let s=t.data;if(!1===s.visible||!0===s.isMask)return;let i=R(s.alpha,1);if(!(i<=0))if("color"===s.type){let t,r=s.color;"string"==typeof r?t="function"==typeof e?.color?e.color(r):void 0:r&&"number"==typeof r.r&&(t=r),t&&a.push({kind:"color",layer:s,rgb:{...x(t.r,t.g,t.b),a:t.a??1},alpha:i})}else"gradient"===s.type&&a.push({kind:"gradient",layer:s,alpha:i})}),0===a.length?null:(e,t)=>{let s=1,i=1,r=1,n=!0;for(let h of a){let a,o,l,d;if("color"===h.kind)({r:a,g:o,b:l}=h.rgb),d=h.rgb.a;else{let[s,i,r,n]=v(h.layer,e,t);({r:a,g:o,b:l}=x(s,i,r)),d=n}let c=n?1:Math.min(1,Math.max(0,d*h.alpha));s+=(a-s)*c,i+=(o-i)*c,r+=(l-r)*c,n=!1}return{r:s,g:i,b:r}}}if(a?.color&&!0===a.color.isColor){let{r:e,g:t,b:s}=a.color;return()=>({r:e,g:t,b:s})}return null}var j=32,I=16384,W=32*I,H=100;function C(e,t){if("torus"===e){let e=t()*Math.PI*2,a=t()*Math.PI*2,s=Math.cos(e),i=Math.sin(e),r=Math.cos(a),n=Math.sin(a);return{x:(1.4+.7*r)*s,y:-(1.4+.7*r)*i,z:.7*n,nx:r*s,ny:-r*i,nz:n,cr:1,cg:1,cb:1}}if("cylinder"===e){let e=t()*Math.PI*2,a=Math.cos(e),s=Math.sin(e);return{x:.8*a,y:1.6*(t()-.5),z:.8*s,nx:a,ny:0,nz:s,cr:1,cg:1,cb:1}}let a=t()*Math.PI*2,s=2*t()-1,i=Math.acos(s),r=Math.sin(i)*Math.cos(a),n=Math.cos(i),h=Math.sin(i)*Math.sin(a);return{x:r,y:n,z:h,nx:r,ny:n,nz:h,cr:1,cg:1,cb:1}}function O(e){let{geometry:t,matrix:a}=e,s=t.getAttribute("position");if(!s||s.count<3)return null;let r=t.getAttribute("normal"),n=t.getAttribute("uv"),h=t.getAttribute("color"),o=t.getIndex(),l=o?o.count/3:s.count/3;if(l<1)return null;let d=(e,t)=>o?o.getX(3*e+t):3*e+t,c=a?a.elements:null,u=a?(new i).getNormalMatrix(a).elements:null,g=e=>{let t=s.getX(e),a=s.getY(e),i=s.getZ(e);return c?c[0]*t+c[4]*a+c[8]*i+c[12]:t},p=e=>{let t=s.getX(e),a=s.getY(e),i=s.getZ(e);return c?c[1]*t+c[5]*a+c[9]*i+c[13]:a},b=e=>{let t=s.getX(e),a=s.getY(e),i=s.getZ(e);return c?c[2]*t+c[6]*a+c[10]*i+c[14]:i},m=new Float64Array(l),S=0;for(let e=0;e<l;e++){let t=d(e,0),a=d(e,1),s=d(e,2),i=g(t),r=p(t),n=b(t),h=g(a)-i,o=p(a)-r,l=b(a)-n,c=g(s)-i,u=p(s)-r,f=b(s)-n,M=o*f-l*u,y=l*c-h*f,x=h*u-o*c;S+=.5*Math.sqrt(M*M+y*y+x*x),m[e]=S}return S<=0?null:{total:S,sample:(t,a)=>{let s=0,i=l-1;for(;s<i;){let e=s+i>>1;m[e]<t?s=e+1:i=e}let o=s,c=d(o,0),S=d(o,1),f=d(o,2),M=a(),y=a();M+y>1&&(M=1-M,y=1-y);let x,R,w,v=1-M-y,A=g(c)*v+g(S)*M+g(f)*y,j=p(c)*v+p(S)*M+p(f)*y,I=b(c)*v+b(S)*M+b(f)*y;if(r){if(x=r.getX(c)*v+r.getX(S)*M+r.getX(f)*y,R=r.getY(c)*v+r.getY(S)*M+r.getY(f)*y,w=r.getZ(c)*v+r.getZ(S)*M+r.getZ(f)*y,u){let e=u[0]*x+u[3]*R+u[6]*w,t=u[1]*x+u[4]*R+u[7]*w,a=u[2]*x+u[5]*R+u[8]*w;x=e,R=t,w=a}}else{let e=g(c),t=p(c),a=b(c),s=g(S)-e,i=p(S)-t,r=b(S)-a,n=g(f)-e,h=p(f)-t,o=b(f)-a;x=i*o-r*h,R=r*n-s*o,w=s*h-i*n}let W=Math.sqrt(x*x+R*R+w*w)||1,H=1,C=1,O=1;if(h)H=h.getX(c)*v+h.getX(S)*M+h.getX(f)*y,C=h.getY(c)*v+h.getY(S)*M+h.getY(f)*y,O=h.getZ(c)*v+h.getZ(S)*M+h.getZ(f)*y;else if(e.sampleColor){let t=n?n.getX(c)*v+n.getX(S)*M+n.getX(f)*y:.5,a=n?n.getY(c)*v+n.getY(S)*M+n.getY(f)*y:.5,s=e.sampleColor(t,a);s&&(H=s.r,C=s.g,O=s.b)}return{x:A,y:j,z:I,nx:x/W,ny:R/W,nz:w/W,cr:H,cg:C,cb:O}}}}function F(e){let t=Math.min(Math.max(1,Math.floor(e.guideStrands)),I),a=function(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}(e.seed??1337),s="object"===e.shape&&e.sampler,i=s?e.samplerRadius??H:H,r=new Float32Array(4*W),n=new Float32Array(W),h=new Float32Array(4*I).fill(1);for(let o=0;o<t;o++){let t=s?e.sampler(a):C(e.shape,a),l=s?t.x:t.x*i,d=s?t.y:t.y*i,c=s?t.z:t.z*i,{nx:u,ny:g,nz:p}=t;h[4*o+0]=t.cr,h[4*o+1]=t.cg,h[4*o+2]=t.cb;let b,m,S,f=32*o,M=(1.8+.8*a())*e.hairLength*i/31,y=.5+1.5*a(),x=(.02+.06*a())*i;Math.abs(g)<.99?(b=-p,m=0,S=u):(b=1,m=0,S=0);let R=Math.sqrt(b*b+m*m+S*S)||1;for(let e=0;e<32;e++){let t=e/31,a=t*t*.4*i,s=x*Math.sin(t*y*Math.PI*2),h=4*(f+e);r[h+0]=l+u*M*e+s*b/R,r[h+1]=d+g*M*e-a+s*m/R,r[h+2]=c+p*M*e+s*S/R,r[h+3]=0===e?0:1,e<31&&(n[f+e]=M)}}return{initialPositions:r,restLengths:n,unitScale:i,rootColors:h}}var k=1/60,z=4,P=new h,G=new t,L=new a,X=new a,B=class extends e{constructor(e,t,a){super(e,t),this.type="HairSystem",this.isHairSystem=!0,this.simRunning=!1,this.previewRequested=!1,this.playModeActive=!1,this.pendingSimSeconds=0,this.simTime=0,this.resetRequested=!0,this.generation=0,this.baseFoundAtRegen=!1,this.baseSourceGeomsAtRegen=[],this.baseSourceHashesAtRegen=[],this.baseColorHashAtRegen=0,this.baseScaleAtRegen=0,this.classicFallbackWarned=!1,this.regenSnapshot=null,this.context=a,this.data=t,this.geometry.setAttribute("position",new c(new Float32Array(0),3)),this.material=new u({colorWrite:!1,depthWrite:!1}),this.frustumCulled=!1,this.scalpMesh=new g(new l(H,48,32),new u({color:5448477})),this.scalpMesh.name="HairScalp",this.add(this.scalpMesh);let s=new r;s.setAttribute("position",new c(new Float32Array(12),3)),s.setIndex([0,2,1,2,3,1]),s.instanceCount=0,this.ribbonMesh=new g(s,new u({visible:!1})),this.ribbonMesh.name="HairRibbons",this.ribbonMesh.frustumCulled=!1,this.ribbonMesh.visible=!1,this.ribbonMesh.matrixAutoUpdate=!1,this.ribbonMesh.updateMatrixWorld=()=>{this.ribbonMesh.matrixWorld.identity()},this.ribbonMesh.updateWorldMatrix=()=>{this.ribbonMesh.matrixWorld.identity()},this.add(this.ribbonMesh),this.activeGuideStrands=t.guideStrands,this.roots=this.buildRoots(),this.regenSnapshot={guideStrands:t.guideStrands,hairLength:t.hairLength,spreadRadius:t.spreadRadius,headShape:t.headShape,baseObjectId:t.baseObjectId},this.applyScalpState(),this.applyShadowState(),this.syncSimRunning()}update(e){!this.simRunning||(this.pendingSimSeconds=Math.min(this.pendingSimSeconds+e/1e3,4*k*2))}get isSimulating(){return(this.simRunning||this.resetRequested)&&this.visible}startPreview(){this.previewRequested=!0,this.syncSimRunning()}stopPreview(){this.previewRequested=!1,this.syncSimRunning()}setPlayMode(e){this.playModeActive=e,e&&this.resetSimulation(),this.syncSimRunning()}resetSimulation(){this.resetRequested=!0,this.pendingSimSeconds=0,this.simTime=0}warnClassicFallbackOnce(){this.classicFallbackWarned||(this.classicFallbackWarned=!0,console.warn("[spline] Hair System strands require the WebGPU renderer — the WebGL fallback shows only the scalp. Reload with ?renderer=webgpu in a WebGPU-capable browser."))}syncSimRunning(){this.simRunning=this.playModeActive||this.previewRequested||this.data.autoPlay}updateState(e,t){super.updateState(e,t),this.updateHairState(e)}updateHairState(e){if((void 0!==e.guideStrands||void 0!==e.hairLength||void 0!==e.spreadRadius||void 0!==e.headShape||void 0!==e.baseObjectId)&&this.regenerate(),(void 0!==e.headShape||void 0!==e.baseObjectId)&&this.applyScalpState(),void 0!==e.headColor){let t=this.scalpMesh.material;!0===t.isMeshBasicMaterial&&t.color.setRGB(e.headColor.r,e.headColor.g,e.headColor.b,n)}(void 0!==e.castShadow||void 0!==e.receiveShadow)&&this.applyShadowState(),void 0!==e.autoPlay&&this.syncSimRunning()}applyShadowState(){let e=this.data.castShadow??!0,t=this.data.receiveShadow??!0;this.scalpMesh.castShadow=e,this.scalpMesh.receiveShadow=t,this.ribbonMesh.castShadow=e,this.ribbonMesh.receiveShadow=t}regenerate(){this.activeGuideStrands=Math.max(1,Math.min(Math.floor(this.data.guideStrands),16384)),this.roots=this.buildRoots(),this.generation++,this.regenSnapshot={guideStrands:this.data.guideStrands,hairLength:this.data.hairLength,spreadRadius:this.data.spreadRadius,headShape:this.data.headShape,baseObjectId:this.data.baseObjectId},this.resetSimulation()}checkDataDrift(){let e=this.data,t=this.regenSnapshot;if(null===t||t.guideStrands!==e.guideStrands||t.hairLength!==e.hairLength||t.spreadRadius!==e.spreadRadius||t.headShape!==e.headShape||t.baseObjectId!==e.baseObjectId){let a=null===t||t.headShape!==e.headShape||t.baseObjectId!==e.baseObjectId;this.regenerate(),a&&this.applyScalpState()}this.syncSimRunning(),this.applyShadowState(),this.checkBaseDrift()}buildRoots(){let{headShape:e,baseObjectId:t,guideStrands:a,hairLength:s}=this.data;if(this.baseFoundAtRegen=!1,this.baseSourceGeomsAtRegen=[],this.baseSourceHashesAtRegen=[],this.baseColorHashAtRegen=0,this.baseScaleAtRegen=0,"object"===e&&t){let e=this.context.scene.find(t);if(e){this.baseFoundAtRegen=!0,e.updateWorldMatrix(!0,!0);let t=this.collectBaseSources(e),i=t?function(e){let t=[];for(let a of e){let e=O(a);e&&t.push(e)}if(0===t.length)return null;let a=new Float64Array(t.length),s=0;for(let e=0;e<t.length;e++)s+=t[e].total,a[e]=s;return s<=0?null:e=>{let i=e()*s,r=0,n=t.length-1;for(;r<n;){let e=r+n>>1;a[e]<i?r=e+1:n=e}let h=0===r?i:i-a[r-1];return t[r].sample(h,e)}}(t.sources):null;if(this.baseSourceGeomsAtRegen=t?.sources.map(e=>e.geometry)??[],this.baseSourceHashesAtRegen=t?.hashes??[],this.baseColorHashAtRegen=t?.colorHash??0,t&&i){let r=this.baseWorldScale(e),n=Math.max(t.radius*r,.001);this.baseScaleAtRegen=r;let h=r;return F({shape:"object",guideStrands:a,hairLength:s,sampler:e=>{let t=i(e);return{...t,x:t.x*h,y:t.y*h,z:t.z*h}},samplerRadius:n})}}}return F({shape:"object"===e?"sphere":e,guideStrands:a,hairLength:s})}collectBaseSources(e){let t=[],a=[],s=0,i=0;P.copy(e.matrixWorld).invert();let r=P.clone(),n=o=>{if(!0===o.isHairSystem||o!==e&&!1===o.visible)return;let l=o.geometry;if(!0===o.isMesh&&l&&(l.getAttribute("position")?.count??0)>=3){let n=o===e?void 0:(new h).multiplyMatrices(r,o.matrixWorld),d=Array.isArray(o.material)?o.material[0]:o.material;t.push({geometry:l,matrix:n,sampleColor:A(d,this.context.shared)??void 0}),a.push(B.matrixHash(n)),i+=function(e,t){let a=e,s=0,i=1,r=e=>{s+=e*i,i+=1},n=a?.data?.layers;if(n&&"function"==typeof n.forEach){let e=t;n.forEach(t=>{let a=t.data;if(!1!==a.visible)if("color"===a.type){let t=a.color,s="string"==typeof t?"function"==typeof e?.color?e.color(t):void 0:t;s&&"number"==typeof s.r&&(r(s.r),r(s.g),r(s.b)),r(R(a.alpha,1))}else if("gradient"===a.type){let e=a;for(let t of e.colors??[])r(t[0]),r(t[1]),r(t[2]),r(t[3]);for(let t of e.steps??[])r(t);r(R(e.angle,0)),r(e.gradientType),r(e.smooth?1:0)}})}else a?.color&&!0===a.color.isColor&&(r(a.color.r),r(a.color.g),r(a.color.b));return s}(d,this.context.shared),null===l.boundingSphere&&l.computeBoundingSphere();let c=l.boundingSphere;if(c){let e=0,t=1;n?(L.copy(c.center).applyMatrix4(n),e=L.length(),t=B.matrixMaxScale(n)):e=c.center.length(),s=Math.max(s,e+c.radius*t)}}for(let e of o.children)n(e)};return n(e),0===t.length?null:{sources:t,hashes:a,radius:Math.max(s,.001),colorHash:i}}static matrixHash(e){if(!e)return 0;let t=e.elements,a=0;for(let e=0;e<16;e++)a+=t[e]*(e+1);return a}static matrixMaxScale(e){let t=e.elements,a=Math.hypot(t[0],t[1],t[2]),s=Math.hypot(t[4],t[5],t[6]),i=Math.hypot(t[8],t[9],t[10]);return Math.max(a,s,i,1e-6)}baseWorldScale(e){return P.copy(e.matrixWorld).decompose(L,G,X),Math.max(Math.abs(X.x),Math.abs(X.y),Math.abs(X.z),1e-6)}get widthWorldScale(){return"object"===this.data.headShape&&this.data.baseObjectId&&this.baseScaleAtRegen>0?this.baseScaleAtRegen:1}checkBaseDrift(){if("object"!==this.data.headShape||!this.data.baseObjectId)return;let e=this.context.scene.find(this.data.baseObjectId);if(!e)return;if(!this.baseFoundAtRegen)return void this.regenerate();e.updateWorldMatrix(!0,!0);let t=this.collectBaseSources(e),a=t?.sources??[],s=t?.hashes??[],i=this.baseSourceGeomsAtRegen,r=this.baseSourceHashesAtRegen,n=a.length!==i.length;if(!n)for(let e=0;e<a.length;e++)if(a[e].geometry!==i[e]||Math.abs(s[e]-r[e])>1e-4*Math.max(Math.abs(r[e]),1)){n=!0;break}if(!n&&"object"===this.data.hairColorSource&&(t?.colorHash??0)!==this.baseColorHashAtRegen&&(n=!0),!n&&a.length>0){let t=this.baseWorldScale(e);n=Math.abs(t-this.baseScaleAtRegen)>.001*Math.max(this.baseScaleAtRegen,1e-6)}n&&this.regenerate()}applyScalpState(){let e=this.data.headShape,t="object"===e&&null!==this.data.baseObjectId;this.scalpMesh.visible=!t,!t&&(this.scalpMesh.geometry.dispose(),this.scalpMesh.geometry="torus"===e?new d(140,70,24,48):"cylinder"===e?new s(80,80,160,48,1):new l(H,48,32))}boneTransform(e,t){let a=this.matrixWorld;if("object"===this.data.headShape&&this.data.baseObjectId){let e=this.context.scene.find(this.data.baseObjectId)?.matrixWorld;e&&(a=e)}P.copy(a).decompose(t,e,X)}raycast(e,t){if(!this.scalpMesh.visible)return;let a=[];this.scalpMesh.raycast(e,a);for(let e of a)e.object=this,t.push(e)}get shadowBoundsRadius(){return this.roots.unitScale*(1.5+2.6*Math.max(this.data.hairLength,0))}updateEntityBoxSize(e,t){let a=this.shadowBoundsRadius;e.set(0,0,0),t.set(a,a,a)}dispose(){super.dispose(),this.scalpMesh.geometry.dispose(),this.scalpMesh.material.dispose(),this.ribbonMesh.geometry.dispose(),this.ribbonMesh.material.dispose?.(),M()?.release(this)}};export{b as a,m as b,f as c,M as d,j as e,I as f,W as g,H as h,k as i,z as j,B as k};
@@ -0,0 +1 @@
1
+ import{ea as t}from"./runtime-chunk-YUK55LCN.js";import{Fc as e,Oc as r,jd as i}from"./runtime-chunk-VGN7YHB7.js";var s=new e,n=new r,a=new i,h=class extends t{constructor(t,e,r){super(t,e,r),this.data=e}get textGeometry(){return this.geometry}get charWidths(){return this.textGeometry.charWidths}get charCoords(){return this.textGeometry.charCoords}get wrappedText(){return this.textGeometry.wrappedText}get font(){return this.textGeometry.font}get initialOffsetY(){let t=this.dataPatched;return this.font?.getLineInitialOffsetY(this.lineHeight,this.wrappedText.length,"number"==typeof t.geometry.height?t.geometry.height:1,this.fontScale,t.geometry.verticalAlign)??0}get fontScale(){let t=this.dataPatched;return this.font?t.geometry.fontSize/this.font.unitsPerEm:1}get AD(){return Math.abs(this.ascender-this.descender)}get ascender(){return(this.font?.ascender??1)*this.fontScale}get descender(){return(this.font?.descender??1)*this.fontScale}get lineHeight(){let t=this.dataPatched;return t.geometry.fontSize*t.geometry.lineHeight}raycast(t,e){let{matrixWorld:r}=this;if(!isNaN(t.ray.origin.x)&&0!==this.scale.x&&0!==this.scale.y&&0!==this.scale.z&&(n.copy(r).invert(),a.copy(t.ray).applyMatrix4(n),a.intersectBox(this.singleBBox,s))){let i=s.applyMatrix4(r),n=t.ray.origin.distanceTo(i);e.push({distance:n,point:i.clone(),object:this})}}};export{h as a};
@@ -0,0 +1 @@
1
+ function e(e,t=0,r={}){let n,i,f,a,o,s=!0===r.leading,u=!1!==r.trailing,c=void 0!==r.maxWait?Math.max(r.maxWait,t):void 0,l=0,g=t=>{let r=i,n=f;return i=f=void 0,l=t,a=e.apply(n,r),a},y=e=>{if(void 0===o)return!0;let r=e-o;return r>=t||r<0||void 0!==c&&e-l>=c},d=e=>(n=void 0,u&&i?g(e):(i=f=void 0,a)),p=()=>{let e=Date.now();y(e)?d(e):n=setTimeout(p,(e=>{let r=t-(e-o);return void 0!==c?Math.min(r,c-(e-l)):r})(e))},h=function(...e){let r=Date.now(),u=y(r);if(i=e,f=this,o=r,u){if(void 0===n)return l=r,n=setTimeout(p,t),s?g(r):a;if(void 0!==c)return n=setTimeout(p,t),g(r)}return void 0===n&&(n=setTimeout(p,t)),a};return h.cancel=()=>{void 0!==n&&clearTimeout(n),l=0,i=o=f=n=void 0},h.flush=()=>void 0===n?a:d(Date.now()),h}function t(t,r=0,n={}){return e(t,r,{leading:!1!==n.leading,trailing:!1!==n.trailing,maxWait:r})}function r(e){return n(e,new Map)}function n(e,t){if(null===e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof ArrayBuffer)return e.slice(0);if(ArrayBuffer.isView(e))return new e.constructor(e.buffer.slice(0),e.byteOffset,e instanceof DataView?e.byteLength:e.length);if(e instanceof Map){let r=new Map;return t.set(e,r),e.forEach((e,i)=>r.set(n(i,t),n(e,t))),r}if(e instanceof Set){let r=new Set;return t.set(e,r),e.forEach(e=>r.add(n(e,t))),r}if(Array.isArray(e)){let r=new e.constructor(e.length);t.set(e,r);for(let[i,f]of Object.entries(e))r[i]=n(f,t);return r}let r=Object.create(Object.getPrototypeOf(e));t.set(e,r);for(let[i,f]of Object.entries(e))r[i]=n(f,t);return r}function i(e,t){if(Object.is(e,t)||e!=e&&t!=t)return!0;if(null===e||null===t||"object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime();if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.source===t.source&&e.flags===t.flags;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)&&e.every((e,r)=>i(e,t[r]));if(ArrayBuffer.isView(e)||ArrayBuffer.isView(t))return!(!ArrayBuffer.isView(e)||!ArrayBuffer.isView(t)||e.constructor!==t.constructor||e.length!==t.length)&&e.every((e,r)=>Object.is(e,t[r]));if(e instanceof Map||t instanceof Map){if(!(e instanceof Map&&t instanceof Map&&e.size===t.size))return!1;for(let[r,n]of e)if(!t.has(r)||!i(n,t.get(r)))return!1;return!0}if(e instanceof Set||t instanceof Set){if(!(e instanceof Set&&t instanceof Set&&e.size===t.size))return!1;for(let r of e)if(!t.has(r))return!1;return!0}let r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&i(e[r],t[r]))}function f(e){let t=[];for(let r in e)t.push(r);return t}function a(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}function o(e,t){let r=new Set(t),n={};for(let[t,i]of Object.entries(e))r.has(t)||(n[t]=i);return n}function s(e){if(!e||0===e.length)return;let t;for(let r of e)r==r&&(void 0===t||r>t)&&(t=r);return t}function u(e,t){if(void 0===t)return e.replace(/\s+$/,"");let r=e.length;for(;r>0&&t.includes(e[r-1]);)r--;return e.slice(0,r)}export{e as a,t as b,r as c,i as d,f as e,a as f,o as g,s as h,u as i};
@@ -0,0 +1 @@
1
+ var n=null,u=null;function t(u){n=u}function r(){return n}function c(n){u=n}function o(){return u}export{t as a,r as b,c,o as d};
@@ -0,0 +1 @@
1
+ import{a as t}from"./runtime-chunk-LATYCOUS.js";import{d as e}from"./runtime-chunk-FDRTCOJ5.js";import{Sc as s}from"./runtime-chunk-VGN7YHB7.js";var r=class extends(e(s,t)){constructor(t,e){super(),this.super_Entity(t,e),this.objectHelper.update(),"Empty"===this.data.type&&(this.objectHelper.visible=!1)}updateState(t,e){this.updateState_Entity(t,e),"buffer"in t&&1===Object.keys(t).length&&e.scene.reloadSplats()}};export{r as a};
@@ -0,0 +1 @@
1
+ import{d as s}from"./runtime-chunk-23QOKH2J.js";import{a as t,b as i}from"./runtime-chunk-FDRTCOJ5.js";import{Fc as a,Tc as o,Te as e,We as h,Xc as r,ze as d}from"./runtime-chunk-VGN7YHB7.js";var n=class extends(t(e)){constructor(s,t=15,i=6710886){super(s,t,i),this.object=s,this.name=`PointLightHelper: ${s.uuid}`}raycast(s,t){i(this.object,n.geometryHelper,s,t)}},p=class extends(s(d,n)){constructor(s,t,i){super(),this.super_Entity(s,t),this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024,this.shadow.normalBias=1,this.layers.enable(3);let e=this.shadow.camera;e.fov=90,e.aspect=1,e.near=100,e.far=2500;let d=new a(-e.far+this.position.x,-e.far+this.position.y,-e.far+this.position.z),n=new a(e.far+this.position.x,e.far+this.position.y,e.far+this.position.z),p=new r(d,n),c=new h(p,new o(16755200));c.visible=!1,this.gizmos.shadowmap=c,this.update()}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this.gizmos))for(let s in this.gizmos){let t=this.gizmos[s];if(t instanceof h){let s=this.shadow.camera,i=new a(-s.far+this.position.x,-s.far+this.position.y,-s.far+this.position.z),o=new a(s.far+this.position.x,s.far+this.position.y,s.far+this.position.z);t.box.set(i,o),t.updateMatrixWorld(!0)}}}updateMatrixWorld(s){super.updateMatrixWorld(s),this.objectHelper&&this.objectHelper.update()}updateState(s,t){this.updateState_Light(s,t),void 0!==s.distance&&(this.distance=s.distance),void 0!==s.decay&&(this.decay=s.decay),void 0!==s.shadowRadius&&(this.shadow.radius=s.shadowRadius),void 0!==s.shadowResolution&&(this.shadow.mapSize.set(s.shadowResolution,s.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}};export{p as a};
@@ -0,0 +1 @@
1
+ import{a as t}from"./runtime-chunk-5CH7XRKY.js";import{e}from"./runtime-chunk-23QOKH2J.js";import{c as i}from"./runtime-chunk-YUK55LCN.js";import{i as r}from"./runtime-chunk-DJJZN367.js";import{i as s}from"./runtime-chunk-QZ35BPGB.js";import{Fc as n,Ne as o,dd as a,ud as h,vd as c}from"./runtime-chunk-VGN7YHB7.js";var d=class extends o{constructor(){super(),i(this.layers)}setFromCamera(t,e){e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):e.isPerspectiveCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(e),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(t,e=!0,i=[]){return t.forEach(t=>{t.visible&&this.intersectObject(t,e,i)}),i}createRaycastLineHelper(){let t=new h({color:65280,linewidth:10}),e=new n(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),i=new n(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),r=this.camera.far-this.camera.near,s=(new n).addVectors(e,i.multiplyScalar(r)),o=new a;return o.setFromPoints([e,s]),new c(o,t)}},u=e=>e instanceof t||s(e);function l(t,e){return t.distance-e.distance}function m(t,i,s){if(r(i)&&i.visible){e(i)&&i.raycast(t,s);for(let e of i.children)m(t,e,s)}}function f(t,e,i,r=!1){if(!r&&!i.some(e=>void 0!==w(t,e)))return[];let s=[];return e.children.forEach(e=>m(t,e,s)),s.sort(l),s}function p(t){let e=[];if(t.length){let i=t[0].object;r(i)&&e.push(i);let s=i.parent;for(;s;)u(s)&&e.push(s),s=s.parent}return e}function y(t,e,i,r){let s=t.frame;if(s){let t=e[0]*s.width,n=(1-e[1])*s.height;for(let e of i){let i=e===s.uuid?s:s.find(e);if(i?.intersects(t,n))return r(i),!0}}return!1}function w(t,i){if(e(i)){if(i.visible){let e=[];return i.raycast(t,e),e.length?e[0]:void 0}}else if(u(i))return g(t,i)}function g(t,i){if(r(i)&&i.visible){if(e(i)){let e=[];if(i.raycast(t,e),e.length)return e[0]}for(let e of i.children){let i=g(t,e);if(i)return i}}}var v=class{constructor(t,e,i,r,s,n,o,a){this.renderer=t,this.publish=e,this.scene=i,this.getCamera=r,this.sharedAssets=s,this.requestRender=n,this.isExport=o,this.frame=a,this.raycaster=new d,this._useWindowEvents=!1,this.pointerWorld={x:0,y:0},this.pointerScreen={x:0,y:0},this._useWindowEvents="window"===e.mouseEventTarget,this.domElement=t.domElement,this.eventElement=this._useWindowEvents?window:t.domElement,this._domRect=this.domElement.getBoundingClientRect()}get stopRaycast(){return this.publish.stopRaycast}get page(){return this.scene.activePage}set useWindowEvents(t){this._useWindowEvents=t,this.eventElement=t?window:this.renderer.domElement}get useWindowEvents(){return this._useWindowEvents}set domRect(t){this._domRect=t}get domRect(){return this._domRect}updateRaycaster(t){let{pageX:e,pageY:i}=t.touches?.length>0?t.touches[0]:t;this.pointerWorld=function(t,e,i){return{x:(t-(i.left+window.scrollX))/i.width*2-1,y:-(e-(i.top+window.scrollY))/i.height*2+1}}(e,i,this._domRect),this.pointerScreen=function(t,e,i){return{x:(t-(i.left+window.scrollX))/i.width,y:1-(e-(i.top+window.scrollY))/i.height}}(e,i,this._domRect),this.raycaster.setFromCamera(this.pointerWorld,this.getCamera())}dispose(){this.scene=void 0,this.sharedAssets=void 0,this.publish=void 0,this.getCamera=void 0,this.requestRender=void 0,this.frame=void 0,this.isExport=void 0}};export{f as a,p as b,y as c,w as d,v as e};
@@ -0,0 +1 @@
1
+ import{ea as e,g as t}from"./runtime-chunk-YUK55LCN.js";import{Cc as r,Fc as a,Zc as o,bd as n}from"./runtime-chunk-VGN7YHB7.js";function i(r){if(Array.isArray(r.material)){for(let e of r.material)if(0===e.getLayersOfType("outline").length)return}else if(!t(r.material)||0===r.material.getLayersOfType("outline").length)return;r instanceof e&&r.is2DAndNoDepth?function(e){if(e.geometry.attributes.extrudeNormals||!e.geometry.attributes.position)return;let t=e.geometry.attributes.position.array,r=new Float32Array(t.length),o=new a;for(let e=0;e<t.length;e+=3)o.set(t[e],t[e+1],t[e+2]).normalize(),r[e]=o.x,r[e+1]=o.y,r[e+2]=o.z;e.geometry.setAttribute("extrudeNormal",new n(r,3))}(r):function(e){if(e.geometry.attributes.extrudeNormal||!e.geometry.attributes.position||!e.geometry.attributes.normal)return;let t=new Map,r=e.geometry.attributes,o=r.position.array,i=r.normal.array,l=new Float32Array(o.length);for(let e=0;e<o.length;e+=3){let r=`${o[e]}_${o[e+1]}_${o[e+2]}`,n=new a(i[e],i[e+1],i[e+2]);t.has(r)?t.get(r)?.normals.push(n):t.set(r,{normals:[n],result:new a})}t.forEach((e,t)=>{for(let t of e.normals)e.result.add(t);e.result.divideScalar(e.normals.length)});for(let e=0;e<o.length;e+=3){let r=`${o[e]}_${o[e+1]}_${o[e+2]}`,a=t.get(r)?.result;a&&(l[e]=a.x,l[e+1]=a.y,l[e+2]=a.z)}e.geometry.setAttribute("extrudeNormal",new n(l,3))}(r)}function l(e){return Math.min(2047,Math.max(1,Math.round(2048*e)))/2048}function s(e){if(!e.geometry.attributes.position)return;let t=e.geometry.attributes,a=t.position.array,n=t.randomColor;if(void 0!==n&&3*n.count===a.length)return;let i=new Float32Array(a.length),s=parseInt(e.uuid.replace(/\D/g,"")),u=[l(r.seededRandom(s)),l(r.seededRandom(s+1e4)),l(r.seededRandom(s+2e4))];for(let e=0;e<a.length;e++)i[e]=u[e%3];e.geometry.setAttribute("randomColor",new o(i,3))}export{i as a,s as b};
@@ -0,0 +1 @@
1
+ import{a as e,b as t}from"./runtime-chunk-O5NBGIBR.js";import{b as a,e as i,g as r}from"./runtime-chunk-23QOKH2J.js";import{a as s}from"./runtime-chunk-TU4KDRKR.js";import{a as n}from"./runtime-chunk-HER7UVU3.js";import{a as l,b as o}from"./runtime-chunk-ARTGMJ7O.js";import{T as h,d as u,da as c,e as d,h as p}from"./runtime-chunk-YUK55LCN.js";import{b as y,h as m,j as g,t as f}from"./runtime-chunk-DJJZN367.js";import{c as b}from"./runtime-chunk-QZ35BPGB.js";import{c as v,l as C}from"./runtime-chunk-TZCHGFVF.js";import{qa as k,ta as S,w as A,za as w}from"./runtime-chunk-OW6T4XFV.js";import{Ne as F,Oc as L,Tc as O,Uc as j,Vc as B,cd as H,jd as T,ld as U,ve as M}from"./runtime-chunk-VGN7YHB7.js";function D(e){return e instanceof c&&e.needsAO&&!b(e)&&!0!==e.isDecalObject}function z(e){let t=e.cloner;if(t&&Array.isArray(t.children))for(let a of t.children)a?.layers&&(a.layers.mask=e.layers.mask)}function x(e){return e.getLayersOfType("reflection").filter(e=>e.data.visible).length}function E(e){return e.getLayersOfType("reflection").some(e=>e.data.visible&&1===e.data.mirror)}function I(e){let t=1/0,a=-1/0;for(let i of e.getLayersOfType("reflection")){let e=i.data;if(!e.visible||1===e.mirror)continue;let r="number"==typeof e.blur?e.blur:null;t=Math.min(t,r??0),a=Math.max(a,r??10)}return t===1/0?null:{min:t,max:a}}function P(e){for(let t of e.getLayersOfType("reflection")){let e=t.data;if(!e.visible)continue;let{blur:a,thickness:i,steps:r,stepSize:s}=e;return"number"!=typeof a||"number"!=typeof i||"number"!=typeof r||"number"!=typeof s?"variable":{blur:a,thickness:i,steps:r,stepSize:s,tracingMode:1===e.tracingMode?1:0}}return null}function G(e,t){let a={outline:!1,cavity:!1},i=512&e.layers.mask,r=t.getLayersOfType("transmission"),s=t.getLayersOfType("outline"),n=x(t),h=t.getLayersOfType("cavity");return(s.length>0||h.length>0)&&(e.layers.set(8),r.length>0&&e.layers.enable(3),n>0&&e.layers.enable(4),a.outline=s.length>0,a.cavity=h.length>0,o(e),l(e)),0===r.length&&0===s.length&&0===h.length&&0===n&&e.layers.set(0),i&&e.layers.set(9),!i&&D(e)&&e.layers.enable(5),z(e),a}function V(e,t){if(!t.layers)return!1;let a=512&e.layers.mask,i=!1,r=t.getLayersOfType("transmission").filter(e=>e.data.visible),s=t.getLayersOfType("outline").filter(e=>e.data.visible),n=x(t),l=t.getLayersOfType("cavity").filter(e=>e.data.visible);return r.length>0&&(e.layers.set(3),(s.length>0||l.length>0)&&e.layers.enable(8),n>0&&e.layers.enable(4),i=!0),0===r.length&&0===s.length&&0===l.length&&0===n&&e.layers.set(0),a&&e.layers.set(9),!a&&D(e)&&e.layers.enable(5),z(e),i}function R(e,t){var a;if(!t.layers)return!1;let i=512&e.layers.mask,r=!1,s=x(t),n=t.getLayersOfType("transmission").filter(e=>e.data.visible),l=t.getLayersOfType("outline").filter(e=>e.data.visible),o=t.getLayersOfType("cavity").filter(e=>e.data.visible);return s>0&&((a=e.userData).__splinePlanarMirror??(a.__splinePlanarMirror=0),e.layers.set(4),n.length>0&&e.layers.enable(3),(l.length>0||o.length>0)&&e.layers.enable(8),r=!0),0===s&&0===n.length&&0===l.length&&0===o.length&&e.layers.set(0),i&&e.layers.set(9),!i&&D(e)&&e.layers.enable(5),z(e),r}function W(e){let t={outline:!1,cavity:!1},a=e=>{t.outline=t.outline||e.outline,t.cavity=t.cavity||e.cavity};return e.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let t=0;t<e.material.length;t++)a(G(e,e.material[t]));else a(G(e,e.material))}),t}function _(e){let t=!1;return e.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let a=0;a<e.material.length;a++)V(e,e.material[a])&&(t=!0);else V(e,e.material)&&(t=!0)}),t}function N(e){let t=!1;return e.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let a=0;a<e.material.length;a++)R(e,e.material[a])&&(t=!0);else R(e,e.material)&&(t=!0)}),t}var J=new F,K=new L,Q=new T,Z=new H;function Y(e,t,a,i=!1){let r=e.cloner;if(r){let s=null;if(e.raycast===U.prototype.raycast||e.raycast===f.prototype.raycast){let t=e.geometry;t&&(null===t.boundingSphere&&t.computeBoundingSphere(),s=t.boundingSphere)}for(let n of r.children){if(null!==s&&(Z.copy(s).applyMatrix4(n.matrixWorld),!t.ray.intersectsSphere(Z)))continue;let r=K.copy(n.matrixWorld).invert(),l=Q.copy(t.ray).applyMatrix4(r),o=e.matrixWorld;l.applyMatrix4(o);let h=J;h.set(l.origin,l.direction),h.near=t.near,h.far=t.far,h.layers.mask=t.layers.mask;let u=h.intersectObject(e,!1);u.length>0&&a.push({...u[0],object:i?n:e})}}}var q=class extends(g(B)){constructor(e,t,a){if(super(),this.data=t,this.bgColor=new p(1,1,1,1),this.fog=null,this.backupFog=new j(16777215,.1,2e3),this.fogUseBGColor=!1,this.fogMode="linear",this.fogDensity=k.getDensity({}),this.fogHeightFalloff=k.getHeightFalloff({}),this.fogHeightBase=k.getHeightBase({}),this.isActive=!1,this.skyState=null,this.skyStateVersion=0,this.gradingState=null,this.skyHdriHolder=null,this.aoColor=new O,this.penumbraSizeArrayCache=null,this.super_Entity(e,t),this.personalCamera=new n(A,{...w.defaultData,...t.camera,name:"Personal Camera"}),this.personalCamera.objectHelper.visible=!1,this.add(this.personalCamera),this.activeCamera=this.personalCamera,this.ambientLight=new M(13882323,8553090,.75*Math.PI),this.ambientLight.name="Default Ambient Light",this.ambientLight.layers.enable(3),this.ambientLight.removeFromParent(),this.add(this.ambientLight),t.uiScene){let i=C();null===i?v("ui-2d","a page's 2D scene"):this.uiScene=new i.Scene2D((Array.isArray(e)?e[0]:e)+"-ui",t.uiScene,{dpr:window.devicePixelRatio,shared:a.shared})}else t.uiFrame&&this.createUICanvas(t.uiFrame,a)}get scene(){return this.parent}get postprocessing(){return this.data.postprocessing}get frameId(){return this.data.uiFrame}get frame(){return this.uiCanvas?.frame}createUICanvas(e,t){let a=C();null!==a?(this.uiCanvas=new a.UICanvas(this.uuid+"-uiscreen",window.innerWidth,window.innerHeight,t),this.uiCanvas.isScreenSpace=!0,this.uiCanvas.promise.then(()=>{this.uiCanvas?.applyFrame(e),this.uiCanvas?.applySize()})):v("ui-2d","a page's UI canvas")}updateVisible(){}setBackgroundColor(e){this.bgColor=e,!0===this.fogUseBGColor&&(this.backupFog.color=e)}entityChildrenCount(){return this.uiScene?this.uiScene.children.length:super.entityChildrenCount()}updateAmbientLight(e,t){void 0!==e.color&&(this.ambientLight.color=s(e.color,t)),void 0!==e.intensity&&(this.ambientLight.intensity=e.intensity*Math.PI),void 0!==e.enabled&&(e.enabled?this.add(this.ambientLight):this.remove(this.ambientLight))}onDeactive(){this.isActive=!1}onActive(e){this.isActive=!0,e.fog=this.fog,this.traverseEntity(e=>{e instanceof a&&e.recomputeBoolean()}),this.updateShadow(this.data.shadow)}forceMaterialsUpdate(){this.traverseEntity(e=>{if(e instanceof c)if(Array.isArray(e.material))for(let t of e.material)t.needsUpdate=!0;else e.material.needsUpdate=!0,e.material.dispose()})}updateShadow(e){if(void 0===e.softShadowQuality&&void 0===e.type||!this.isActive)return;let t=this.data.shadow,a=S.isSoft(t);h(a,t?.softShadowQuality)&&this.forceMaterialsUpdate()}updateFog(e,t){e.enabled?this.fog=this.backupFog:this.fog=null,this.isActive&&(this.scene.fog=this.fog),this.fogUseBGColor=e.useBackgroundColor,e.useBackgroundColor?this.backupFog.color.set(this.bgColor):this.backupFog.color=s(e.color,t),this.backupFog.near=e.near,this.backupFog.far=e.far,this.fogMode=k.getMode(e),this.fogDensity=k.getDensity(e),this.fogHeightFalloff=k.getHeightFalloff(e),this.fogHeightBase=k.getHeightBase(e)}updateSky(e,t){this.skyState=e??null,this.skyStateVersion++;let a=e?.hdri?.image;this.skyHdriHolder=null!=a?t.image(a):null}updateAo(e,t){void 0!==e.aoColor&&(this.aoColor=s(e.aoColor,t))}updateByOp(e,t,a,i){let r=this.data.uiFrame;super.updateByOp(e,t,a,i);let s=t;y(e.path,["fog"])?this.updateFog(s.fog,a.shared):y(e.path,["sky"])?this.updateSky(s.sky,a.shared):y(e.path,["grading"])?this.gradingState=s.grading??null:y(e.path,["ao"])?this.updateAo(s.ao,a.shared):y(e.path,["ambient"])?this.updateAmbientLight(s.ambient,a.shared):y(e.path,["shadow"])?this.updateShadow(s.shadow):0===e.type&&0===e.path.length&&(void 0!==e.props.uiFrame||r!==s.uiFrame)&&this.updateUIFrame(e.props.uiFrame,a)}updateUIFrame(e,t){e?(this.uiCanvas||this.createUICanvas(e,t),this.uiCanvas.enabled=!0,this.uiCanvas.applyFrame(e)):this.uiCanvas&&(this.uiCanvas.enabled=!1)}updateState(e,t){this.updateState_Entity(e,t),void 0!==e.backgroundColor&&this.setBackgroundColor(s(e.backgroundColor,t.shared)),void 0!==e.fog&&this.updateFog(e.fog,t.shared),void 0!==e.sky&&this.updateSky(e.sky,t.shared),void 0!==e.grading&&(this.gradingState=e.grading),void 0!==e.ambient&&this.updateAmbientLight(e.ambient,t.shared),void 0!==e.ao&&this.updateAo(e.ao,t.shared),void 0!==e.shadow&&this.updateShadow(e.shadow)}createFrame(e,t){}raycast(e,t){super.raycast(e,t)}switchActiveCamera(e){e&&e.isDescendantOf(this)&&(this.activeCamera!==this.personalCamera&&(this.activeCamera.objectHelper.visible=!0),this.activeCamera=e,e.objectHelper.visible=!1)}get playCamera(){return this.scene?.find(this.data.publish.playCamera)??this.personalCamera}switchToPlayCamera(){this.switchActiveCamera(this.playCamera)}get penumbraSizeArray(){return null===this.penumbraSizeArrayCache&&this.updatePenumbraSizeArray(),this.penumbraSizeArrayCache}updatePenumbraSizeArray(){this.penumbraSizeArrayCache=new Array(u).fill(.5);let a=0,i=0;this.traverseEntity(r=>{if(!r.visible)return!0;r instanceof e&&r.visible&&a<d&&(this.penumbraSizeArrayCache[a]=r.data.penumbraSize??.5,a+=1),r instanceof t&&r.visible&&a<u-d&&(this.penumbraSizeArrayCache[d+i]=r.data.penumbraSize??.5,i+=1)})}raycastWithClones(e){let t=[],a=s=>{for(let n of s.children){let s=n.cloner;m.is(n)&&(n.visible||s?.object.data.visible)&&((i(n)||r(n)&&this.scene.enableHelpers&&n.objectHelper.visible)&&(e.intersectObject(n,!1,t),Y(n,e,t,!0)),a(n))}};return a(this),t}updateEntity2DByOp(e,t,a,i){this.uiCanvas?.updateEntity2DByOp(e,t,a,i)}};export{E as a,I as b,P as c,W as d,_ as e,N as f,Y as g,q as h};
@@ -0,0 +1 @@
1
+ import{b as t}from"./runtime-chunk-N2ZRGNPR.js";import{a as e,c as i}from"./runtime-chunk-VAVYZ35B.js";import{b as s,c as o,d as a,e as n}from"./runtime-chunk-FQNSP44B.js";import{a as r}from"./runtime-chunk-W7QPV37Y.js";import{G as h,a as l}from"./runtime-chunk-YUK55LCN.js";import{f as d,g as c}from"./runtime-chunk-MM75L5X4.js";import{h as p}from"./runtime-chunk-DJJZN367.js";import{a as m,g as u,h as y}from"./runtime-chunk-QZ35BPGB.js";import{a as v}from"./runtime-chunk-4KZXQGUQ.js";import{a as g}from"./runtime-chunk-Z5OH244S.js";import{c as f}from"./runtime-chunk-TZCHGFVF.js";import{Fa as b}from"./runtime-chunk-OW6T4XFV.js";import{Bc as E,Dc as P,Ec as C,Fc as M,Oc as x,Oe as T,Pc as S,Rc as D,Xc as w,b as R,bd as j,cd as G,dd as L}from"./runtime-chunk-VGN7YHB7.js";var B=200,A=null;function W(t){A=t}function O(){return A}function I(t){let e=!1;return t.scene.objects.forEach(i=>{"Page"===i.data.type&&!e&&i.data.publish.gameControlObject&&b.traverseModuleInstances(t,i.id,(t,i,s)=>{for(let t of s)"GameControl"===t.data.type&&t.data.navmesh.enabled&&(e=!0)})}),e}function F(t){return s?t.metaKey:t.ctrlKey}function k(t,e){return Math.abs(t+3*e)<=2||Math.abs(t+3*window.devicePixelRatio*e)<=2}var V={type:"change"},z={type:"start"},H={type:"end",nonOrbit:!0},Z={type:"end",nonOrbit:!1},U={type:"end",isZoom:!0,nonOrbit:!0},Y={type:"end",changed:!1},X={type:"cameraAnimatingInTimeline"},N=new C,K=new P,_=2*Math.PI,Q=new M,q=new P,J=new M,$=new C,tt=new x,et={type:"requestRender"},it=class extends E{constructor(t,i,s={isPlayMode:!1,isExport:!1},a){super(),this.object=t,this.domElement=i,this.options=s,this.timelineState=a,this.enabled=!0,this.useKeyEvents=!0,this.enableDamping=!1,this.enableZoom=!0,this.enableRotate=!0,this.enablePan=!0,this.autoRotate=!1,this.rotationLimitsMode=0,this.panLimitsMode=0,this.rotationSoftLimit=2,this.panSoftLimit=2,this.hoverRotatePanMode=0,this.zoomLimitsEnabled=!1,this.mouseButtons=[0,5],this.mouseButtonsPlay=[3,4,5],this.touches=[null,R.DOLLY_ROTATE,R.PAN],this.offset=new M,this.eye=new M,this.lastPosition=new M,this.lastQuaternion=new C,this.current=new P,this.overShoot=new P,this.overRatio=new P,this.spherical=new T,this.sphericalDelta=new T,this.panOffset=new M,this.panLeftV=new M,this.panUpV=new M,this.panV=new M,this.rotateStart=new P,this.rotateEnd=new P,this.rotateDelta=new P,this.panStart=new P,this.panEnd=new P,this.panDelta=new P,this.dollyStart=new P,this.dollyEnd=new P,this.dollyDelta=new P,this.rotationRangeFactor=new P,this.panRangeFactor=new P,this.state=-1,this.zoomChanged=!1,this.isPointerDown=!1,this.isThetaFlipped=!1,this.prevScale=0,this.scale=1,this.gesture=!1,this.lastTrackpadPanTime=-1/0,this.lastMouseWheelZoomTime=-1/0,this.timer=-1,this.timerHover=-1,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPhi=0,this.maxPhi=Math.PI,this.minTheta=-1/0,this.maxTheta=1/0,this.minH=0,this.maxH=Math.PI,this.minV=-1/0,this.maxV=1/0,this.autoRotateClockwise=!0,this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.resetHoverEffectOnPointerLeave=!1,this.hasChange=!1,this.useWindowEvents=!1,this.isTouchZoom=!0,this.autoRotateSpeed=2,this.dampingFactor=.125,this.zoomSpeed=2,this.rotateSpeed=1,this.rotateFactor=1,this.panSpeed=1,this.hoverRotatePanStrength=.1,this.hoverRotateDamping=this.dampingFactor,this.isCurrentlyDamping=!1,this.thetaIsFree=!1,this.phiIsFree=!1,this.needsUpdate=!0,this.onCameraChange=t=>{this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange),this.object=t.camera,this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)},this.update=()=>{this.object.updateWorldMatrix(!0,!1),this.object.matrixWorld.decompose(J,$,Q),this.offset.copy(J).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.autoRotate&&-1===this.state&&this.rotateLeft((!0===this.autoRotateClockwise?1:-1)*this.getAutoRotationAngle()),0!==this.rotationLimitsMode&&this.applyLimits(this.sphericalDelta,this.rotationLimitsMode,this.rotationSoftLimit,this.maxTheta,this.minTheta,this.maxPhi,this.minPhi,this.rotationRangeFactor),2!==this.rotationLimitsMode&&(this.spherical.phi+=this.sphericalDelta.phi),(1!==this.rotationLimitsMode||!0===this.autoRotate)&&(this.spherical.theta+=this.sphericalDelta.theta),this.spherical.radius*=this.scale,this.zoomLimitsEnabled&&this.object.isPerspectiveCamera&&(this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius))),0!==this.panLimitsMode&&(this.target.applyQuaternion(N.copy($).invert()),this.panOffset.applyQuaternion(N),this.applyLimits(this.panOffset,this.panLimitsMode,this.panSoftLimit,this.maxH,this.minH,this.maxV,this.minV,this.panRangeFactor),this.target.applyQuaternion($),this.panOffset.applyQuaternion($)),2===this.panLimitsMode&&(this.panOffset.y=0),1===this.panLimitsMode&&(this.panOffset.x=0),-1!==this.state||this.gesture?(this.target.add(this.panOffset),this.panOffset.set(0,0,0)):(this.panOffset.multiplyScalar(1-this.dampingFactor),this.target.add(this.panOffset)),this.offset.setFromSpherical(this.spherical),J.copy(this.target).add(this.offset),this.object.position.copy(this.target).add(this.offset),this.object.parent&&(tt.copy(this.object.parent.matrixWorld).invert(),this.object.position.applyMatrix4(tt));let t=this.spherical.phi%_;if(this.eye.copy(this.offset).normalize(),this.object.up.copy(D.DEFAULT_UP).applyAxisAngle(this.eye,this.object.angleOffsetFromUp),t>0&&t>Math.PI||t<0&&t>-Math.PI?(this.object.up.negate(),this.object.lookAt(this.target),this.object.isUpVectorFlipped=!0):(this.object.lookAt(this.target),this.object.isUpVectorFlipped=!1),-1===this.state||!0===this.enableDamping){let t=1===this.hoverRotatePanMode?this.hoverRotateDamping:this.dampingFactor;this.sphericalDelta.theta*=1-t,this.sphericalDelta.phi*=1-t}else this.sphericalDelta.set(0,0,0);if(this.scale=1,this.lastPosition.distanceToSquared(this.object.position)>.01||8*(1-this.lastQuaternion.dot(this.object.quaternion))>1e-8)return this.dispatchEvent(V),this.object.dispatchEvent(et),this.lastPosition.copy(this.object.position),this.lastQuaternion.copy(this.object.quaternion),void(this.isCurrentlyDamping=!0);this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.object.wasMovedBySwitchCameraAction=!1,this.sphericalDelta.set(0,0,0),this.panOffset.set(0,0,0),this.isCurrentlyDamping=!1},this.onPointerDown=t=>{!1!==this.enabled&&("touch"===t.pointerType||"pen"===t.pointerType&&n?this.onPointerDownTouch(t):this.onPointerDownMouse(t),-1!==this.state&&(this.isPointerDown=!0,this.dispatchEvent(z),this.domElement.addEventListener("pointermove",this.onPointerMove),this.domElement.addEventListener("pointerup",this.onPointerUp),t.stopPropagation(),"touch"===t.pointerType||"pen"===t.pointerType&&n||this.domElement.setPointerCapture(t.pointerId)))},this.onPointerLeave=t=>{this.resetHoverEffectOnPointerLeave&&!this.useWindowEvents?(1===this.hoverRotatePanMode?(this.sphericalDelta.theta=-this.spherical.theta,this.sphericalDelta.phi=-this.spherical.phi,Q.subVectors(this.position0,this.target0),this.spherical.setFromVector3(Q),this.sphericalDelta.theta+=this.spherical.theta,this.sphericalDelta.phi+=this.spherical.phi,this.sphericalDelta.theta/=8,this.sphericalDelta.phi/=8):2===this.hoverRotatePanMode&&this.panOffset.subVectors(this.target0,this.target).divideScalar(8),this.update()):this.pointerLeaveEvent=t},this.onPointerEnter=t=>{this.resetHoverEffectOnPointerLeave||void 0===this.pointerLeaveEvent?q.set(t.clientX-this.domElement.clientWidth/2,t.clientY-this.domElement.clientHeight/2):q.set(t.clientX-this.pointerLeaveEvent.clientX,t.clientY-this.pointerLeaveEvent.clientY),1===this.hoverRotatePanMode?(this.rotateDelta.copy(q).multiplyScalar(this.rotateSpeed*this.hoverRotatePanStrength).rotateAround(K,-this.object.angleOffsetFromUp),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.domElement.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.domElement.clientHeight),this.rotateStart.set(t.clientX,t.clientY)):2===this.hoverRotatePanMode&&(this.panDelta.copy(q).multiplyScalar(this.panSpeed*this.hoverRotatePanStrength),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.set(t.clientX,t.clientY)),this.update()},this.onPointerMove=t=>{this.timelineState?.isPlayingCameraAnimation?this.dispatchEvent(X):!1!==this.enabled&&(this.checkRaycastLock()||("touch"===t.pointerType||"pen"===t.pointerType&&n?this.onPointerMoveTouch(t):this.onPointerMoveMouse(t),t.stopPropagation()))},this.onPointerUp=t=>{this.isPointerDown=!1,0===e.length&&(this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)),e.length>1&&t.preventDefault(),this.hasChange?this.dispatchEvent(0===this.state?Z:H):this.dispatchEvent(Y),this.state=-1,t&&(t.stopPropagation(),"touch"===t.pointerType||"pen"===t.pointerType&&n||this.domElement.releasePointerCapture(t.pointerId))},this.onPointerDownMouse=t=>{let e;switch(e=this.useKeyEvents?this.mouseButtons[t.button]:this.mouseButtonsPlay[t.button],e){case 0:if(!0!==t.altKey||t.shiftKey||F(t)){if(" "===this.key){if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2}}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(t),this.state=0}break;case 4:if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2;break;case 3:if(F(t)||t.shiftKey){if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2}else{if(!1===this.enableRotate)return;this.handleMouseDownRotate(t),this.state=0}break;case 5:if(F(t)||t.shiftKey){if(!1===this.enableRotate)return;this.handleMouseDownRotate(t),this.state=0}else{if(!1===this.enablePan)return;this.handleMouseDownPan(t),this.state=2}break;default:this.state=-1}},this.onPointerMoveMouse=t=>{switch(this.state){case 0:if(!1===this.enableRotate)return;this.handleMouseMoveRotate(t);break;case 1:if(!1===this.enableZoom)return;this.handleMouseMoveDolly(t);break;case 2:if(!1===this.enablePan)return;this.handleMouseMovePan(t)}this.object.wasMovedByUser=!0},this.onPointerDownTouch=t=>{switch(e.length>1&&t.preventDefault(),this.touches[e.length-1]){case R.ROTATE:if(!1===this.enableRotate)return void(this.state=-1);this.handleTouchStartRotate(),this.state=3;break;case R.PAN:if(!1===this.enablePan)return void(this.state=-1);this.handleTouchStartPan(),this.state=4;break;case R.DOLLY_PAN:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchStartDollyPan(),this.state=5;break;case R.DOLLY_ROTATE:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchStartDollyRotate(),this.state=6;break;default:this.state=-1}},this.onPointerMoveTouch=t=>{switch(e.length>1&&t.preventDefault(),this.state){case 3:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(t),this.update();break;case 4:if(!1===this.enablePan)return;this.handleTouchMovePan(t),this.update();break;case 5:if(!1===this.enableZoom&&!1===this.enablePan)return;this.handleTouchMoveDollyPan(t),this.update();break;case 6:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchMoveDollyRotate(t),this.update();break;default:this.state=-1}this.object.wasMovedByUser=!0},this.dispatchEndDebounced=v(()=>{this.zoomChanged?this.dispatchEvent(U):this.dispatchEvent(H),this.zoomChanged=!1},33),this.onMouseWheel=t=>{if(!1!==this.enabled&&(!1!==this.enableZoom||!1!==this.enablePan)&&!this.checkRaycastLock()){if(!this.options.isExport&&this.domElement.clientHeight===document.body.clientHeight&&this.domElement.clientWidth===document.body.clientWidth&&t.preventDefault(),this.dispatchEvent(z),this.timelineState?.isPlayingCameraAnimation)return void this.dispatchEvent(X);this.handleMouseWheel(t),this.dispatchEndDebounced(),this.object.wasMovedByUser=!0}},this.onGesture=t=>{if(t.preventDefault(),!1!==this.enabled&&!this.checkRaycastLock()&&!o){if(this.timelineState?.isPlayingCameraAnimation)return void this.dispatchEvent(X);if("gesturechange"===t.type){if(!1===this.enableZoom||!1===this.isTouchZoom)return;this.dispatchEvent(z),t.scale>this.prevScale?this.dollyIn(this.getZoomScale()):t.scale<this.prevScale&&this.dollyOut(this.getZoomScale()),this.prevScale=t.scale,this.update(),this.object.wasMovedByUser=!0}else this.dispatchEvent(H)}},this.onContextMenu=t=>{t.preventDefault()},this.onTouchEnd=t=>{t.preventDefault()},this.onKeyDown=t=>{!1!==this.enabled&&(this.key=t.key," "===t.key&&this.dispatchEvent(z))},this.onKeyUp=t=>{this.key=void 0,!1!==this.enabled&&(-1!==this.state&&"Alt"===t.key&&this.onPointerUp(e[0])," "===t.key&&this.dispatchEvent(H))},this.onPointerHover=t=>{"mouse"!==t.pointerType||!1===this.enabled||-1!==this.state||2===this.hoverRotatePanMode&&this.isPanOverShoot||1===this.hoverRotatePanMode&&this.isRotateOverShoot||(this.isPointerDown=!0,2===this.hoverRotatePanMode?this.handleMouseMovePan(t,this.hoverRotatePanStrength):1===this.hoverRotatePanMode&&this.handleMouseMoveRotate(t,this.hoverRotatePanStrength))},this.onBeginState=()=>{this.enabled=!1,this.needsUpdate=!1},this.onCompleteState=t=>{t.isfromEntity&&this.options.isPlayMode||(this.enabled=!0,this.needsUpdate=!0,this.object.updateUp(),this.object.getTarget(this.target))},this.target=this.object.getTarget(),this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.quat0=this.object.quaternion.clone(),this.isUpVectorFlipped0=this.object.isUpVectorFlipped,this.object.updateWorldMatrix(!0,!1),this.object.matrixWorld.decompose(J,$,Q),this.offset.copy(J).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.initialSphericalRadius=this.spherical.radius,this.addEventListenersToCamera()}dispatchEvent(t){"start"===t.type?this.hasChange=!1:this.hasChange=!0,super.dispatchEvent(t)}addEventListenersToCamera(){this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)}removeEventListenersFromCamera(){this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange)}updateUseWindowEvents(t){if(window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("pointermove",this.onPointerHover),this.useWindowEvents=t,0!==this.hoverRotatePanMode&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover)),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),0!==this.hoverRotatePanMode&&!this.useWindowEvents){let t=this.useWindowEvents?window:this.domElement;t.addEventListener("pointerleave",this.onPointerLeave),t.addEventListener("pointerenter",this.onPointerEnter)}}fromJSON(t,e){this.rotateFactor=t.rotationSpeed??1,this.setEnableDampingSpeed(t.enableDamping),this.enablePan=t.enablePan,this.enableZoom=t.enableZoom,this.enableRotate=t.enableRotate,this.rotationLimitsMode=t.rotationLimitsMode,this.thetaIsFree=t.rotationHorizontalOffset.min===t.rotationHorizontalOffset.max&&t.rotationHorizontalOffset.min===Math.PI,this.phiIsFree=t.rotationVerticalOffset.min===t.rotationVerticalOffset.max&&t.rotationVerticalOffset.min===Math.PI,this.panLimitsMode=t.panLimitsMode,this.panSoftLimit=t.panSoftLimit,this.rotationSoftLimit=t.rotationSoftLimit,this.hoverRotatePanMode=t.hoverRotatePanMode,this.hoverRotateDamping=t.hoverRotateDamping??this.dampingFactor,this.useWindowEvents="window"===e,0!==this.hoverRotatePanMode&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover));let i=t.hoverRotatePanStrength/100;this.hoverRotatePanStrength=i**2,this.zoomLimitsEnabled=t.zoomLimitsEnabled,this.minZoom=t.zoomLimits.min,this.maxZoom=Math.max(t.zoomLimits.min,t.zoomLimits.max),this.minDistance=1e3/this.maxZoom,this.maxDistance=Math.max(this.minDistance,1e3/t.zoomLimits.min),this.autoRotate=t.autoRotate,this.autoRotateSpeed=t.autoRotateSpeed,this.autoRotateClockwise=t.autoRotateClockwise;let s=this.object.getTarget().applyQuaternion(N.copy(this.object.quaternion).invert());this.minV=-t.panVerticalOffset.min+s.y,this.maxV=t.panVerticalOffset.max+s.y,this.minH=-t.panHorizontalOffset.min+s.x,this.maxH=t.panHorizontalOffset.max+s.x,this.panRangeFactor.set(this.maxH-this.minH,this.maxV-this.minV).divideScalar(2),this.rotationRangeFactor.setScalar(Math.PI).divideScalar(4),this.minPhi=st(this.spherical.phi-t.rotationVerticalOffset.min),this.maxPhi=st(this.spherical.phi+t.rotationVerticalOffset.max),this.minTheta=st(st(this.spherical.theta)-t.rotationHorizontalOffset.min),this.maxTheta=st(st(this.spherical.theta)+t.rotationHorizontalOffset.max),this.isThetaFlipped=this.minTheta>this.maxTheta,1===t.orbitTouches&&(this.touches[0]=R.ROTATE),1===t.panTouches&&(this.touches[0]=R.PAN),2===t.orbitTouches&&(this.touches[1]=R.DOLLY_ROTATE),2===t.panTouches&&(this.touches[1]=R.DOLLY_PAN),3===t.orbitTouches&&(this.touches[2]=R.ROTATE),3===t.panTouches&&(this.touches[2]=R.PAN),this.isTouchZoom=t.isTouchZoom,this.resetHoverEffectOnPointerLeave=t.resetHoverEffectOnPointerLeave??!1}connect(){if(this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("wheel",this.onMouseWheel),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keyup",this.onKeyUp,!1),this.domElement.addEventListener("gesturestart",this.onGesture),this.domElement.addEventListener("gesturechange",this.onGesture),this.domElement.addEventListener("gestureend",this.onGesture),this.domElement.addEventListener("touchend",this.onTouchEnd),0!==this.hoverRotatePanMode&&!this.useWindowEvents){let t=this.useWindowEvents?window:this.domElement;t.addEventListener("pointerleave",this.onPointerLeave),t.addEventListener("pointerenter",this.onPointerEnter)}this.pointerLeaveEvent=void 0}dispose(){this.removeEventListenersFromCamera(),this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("wheel",this.onMouseWheel),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keyup",this.onKeyUp,!1),this.domElement.removeEventListener("pointermove",this.onPointerHover),window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("gesturestart",this.onGesture),this.domElement.removeEventListener("gesturechange",this.onGesture),this.domElement.removeEventListener("gestureend",this.onGesture),this.domElement.removeEventListener("touchend",this.onTouchEnd),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)}applyLimits(t,e,i,s,o,a,n,r){let h,l,d;this.overShoot.set(0,0),t instanceof M?(h=t.x,l=t.y,this.current.set(this.target.x,this.target.y),d=!0):(h=t.theta,l=t.phi,this.current.set(st(this.spherical.theta),st(this.spherical.phi)),d=!1),0===i&&(this.current.x+=h,this.current.y+=l),(3===e||2===e)&&(!d&&this.isThetaFlipped?this.current.x>s&&this.current.x<0?this.overShoot.x=s-this.current.x:this.current.x<o&&this.current.x>0&&(this.overShoot.x=o-this.current.x):this.current.x>s?this.overShoot.x=s-this.current.x:this.current.x<o&&(this.overShoot.x=o-this.current.x)),(3===e||1===e)&&(this.current.y>a?this.overShoot.y=a-this.current.y:this.current.y<n&&(this.overShoot.y=n-this.current.y)),d||(this.overShoot.x=st(this.overShoot.x),this.overShoot.y=st(this.overShoot.y)),0!==i?(this.overRatio.copy(this.overShoot).divide(r),this.overRatio.x=Math.min(Math.abs(this.overRatio.x),1),this.overRatio.y=Math.min(Math.abs(this.overRatio.y),1),1===i&&(this.overRatio.x=ot(Math.abs(this.overRatio.x)),this.overRatio.y=ot(Math.abs(this.overRatio.y))),this.isPointerDown||1===i?2===i&&(this.overRatio.x>.9&&!this.thetaIsFree||this.overRatio.y>.9&&!this.phiIsFree)?this.isPointerDown=!1:(h*this.overShoot.x<0&&!this.thetaIsFree&&(h*=1-this.overRatio.x),l*this.overShoot.y<0&&!this.phiIsFree&&(l*=1-this.overRatio.y)):2===i&&(!d&&(this.overRatio.x>.002&&!this.thetaIsFree||this.overRatio.y>.002&&!this.phiIsFree)||d&&(Math.abs(this.overShoot.x)>2||Math.abs(this.overShoot.y)>2)?(this.thetaIsFree||(h=.05*this.overShoot.x),this.phiIsFree||(l=.05*this.overShoot.y),d?this.isPanOverShoot=!0:this.isRotateOverShoot=!0):d?this.isPanOverShoot=!1:this.isRotateOverShoot=!1)):(h+=this.overShoot.x,l+=this.overShoot.y),t instanceof M?(t.x=h,t.y=l):(this.thetaIsFree||(t.theta=h),this.phiIsFree||(t.phi=l))}setEnableDampingSpeed(t){this.enableDamping=t,this.rotateSpeed=(!0===t?.2:1)*this.rotateFactor}stopDamping(){this.sphericalDelta.theta=0,this.sphericalDelta.phi=0,this.panOffset.set(0,0,0)}setTarget(t,e,i){this.stopDamping(),this.target.set(t,e,i)}getAutoRotationAngle(){return 2*Math.PI/60/60*this.autoRotateSpeed}getZoomScale(){return Math.pow(.95,this.zoomSpeed)}rotateLeft(t){this.sphericalDelta.theta-=t}rotateUp(t){this.sphericalDelta.phi-=t}panLeft(t,e){this.panLeftV.setFromMatrixColumn(e,0),this.panLeftV.multiplyScalar(-t),this.panOffset.add(this.panLeftV)}panUp(t,e){this.panUpV.setFromMatrixColumn(e,1),this.panUpV.multiplyScalar(t),this.panOffset.add(this.panUpV)}pan(t,e){let i=this.domElement;if(i&&this.object.isPerspectiveCamera){let s=this.object.position;this.panV.copy(s).sub(this.target);let o=this.panV.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*t*o/i.clientHeight,this.object.matrixWorld),this.panUp(2*e*o/i.clientHeight,this.object.matrixWorld)}else i&&this.object.isOrthographicCamera&&(this.panLeft(t*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrixWorld),this.panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrixWorld));this.dispatchEvent(V)}dollyOut(t){this.object.isPerspectiveCamera?this.scale/=t:this.object.isOrthographicCamera&&(this.object.zoom*=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(V)}dollyIn(t){this.object.isPerspectiveCamera?this.scale*=t:this.object.isOrthographicCamera&&(this.object.zoom/=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(V)}setZoom(t){if(this.dispatchEvent(z),this.object.isPerspectiveCamera){let e=this.initialSphericalRadius/t/this.spherical.radius;this.scale=e}else this.object.isOrthographicCamera&&(this.object.zoom=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0);this.dispatchEvent(H)}handleMouseDownRotate(t){this.rotateStart.set(t.clientX,t.clientY)}handleMouseDownDolly(t){this.dollyStart.set(t.clientX,t.clientY)}handleMouseDownPan(t){this.panStart.set(t.clientX,t.clientY)}handleMouseMoveRotate(t,e=1){void 0!==t.movementX?this.rotateDelta.set(t.movementX,t.movementY):(this.rotateEnd.set(t.clientX,t.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd)),this.rotateDelta.multiplyScalar(this.rotateSpeed*e).rotateAround(K,-this.object.angleOffsetFromUp);let i=this.domElement,s=this.useWindowEvents?window.innerHeight:i.clientHeight,o=2*Math.PI*this.rotateDelta.x/s,a=2*Math.PI*this.rotateDelta.y/s;this.rotateLeft(o),this.rotateUp(a),this.update()}handleMouseMoveDolly(t){this.dollyEnd.set(t.clientX,t.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}handleMouseMovePan(t,e=1){void 0!==t.movementX?this.panDelta.set(t.movementX,t.movementY):(this.panEnd.set(t.clientX,t.clientY),this.panDelta.subVectors(this.panEnd,this.panStart),this.panStart.copy(this.panEnd)),this.panDelta.multiplyScalar(this.panSpeed*e),this.pan(this.panDelta.x,this.panDelta.y),this.update()}handleMouseWheel(t){if(0===t.deltaX&&0===t.deltaY)return;let e=!0===t.ctrlKey||!0===F(t),i=!1===F(t)&&!0===(0===(r=t).wheelDeltaY||0===r.deltaY?!(s&&r.shiftKey&&Math.abs(r.wheelDeltaX)>=120)&&(r.wheelDeltaX?k(r.wheelDeltaX,r.deltaX):0===r.deltaMode):r.wheelDeltaY?k(r.wheelDeltaY,r.deltaY):0===r.deltaMode),o=!1===e&&(!0===this.gesture||t.timeStamp-this.lastTrackpadPanTime<300),n=!1===e&&!1===o&&t.timeStamp-this.lastMouseWheelZoomTime<300;var r;if(!1!==a||!1!==n||!0!==i&&!0!==o){if(!1===this.enableZoom)return;this.gesture&&(window.clearTimeout(this.timer),this.gesture=!1,this.isPointerDown=!1,this.dispatchEvent(H)),!1===e&&!1===i&&(this.lastMouseWheelZoomTime=t.timeStamp),0===t.deltaY?t.deltaX<0?this.dollyIn(this.getZoomScale()):t.deltaX>0&&this.dollyOut(this.getZoomScale()):t.deltaY<0?this.dollyIn(this.getZoomScale()):t.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update(),this.gesture=!1,this.isPointerDown=!1}else{if(!1===this.enablePan)return;let e=!1===this.gesture&&!1===o;this.lastTrackpadPanTime=t.timeStamp,this.gesture||(this.gesture=!0,this.isPointerDown=!0),!1===e&&(this.panDelta.set(-t.deltaX,-t.deltaY).multiplyScalar(this.panSpeed),this.panDelta.x=Math.min(Math.abs(this.panDelta.x),100)*(this.panDelta.x<0?-1:1),this.panDelta.y=Math.min(Math.abs(this.panDelta.y),100)*(this.panDelta.y<0?-1:1),t.altKey?this.pan(0,this.panDelta.y):t.shiftKey?this.pan(this.panDelta.x,0):this.pan(this.panDelta.x,this.panDelta.y),this.update()),window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.gesture=!1,this.isPointerDown=!1,this.dispatchEvent(H)},100)}}handleTouchStartRotate(){if(2===e.length){let t=.5*(e[0].pageX+e[1].pageX),i=.5*(e[0].pageY+e[1].pageY);this.rotateStart.set(t,i)}else this.rotateStart.set(e[0].pageX,e[0].pageY)}handleTouchStartPan(){if(2===e.length){let t=.5*(e[0].pageX+e[1].pageX),i=.5*(e[0].pageY+e[1].pageY);this.panStart.set(t,i)}else this.panStart.set(e[0].pageX,e[0].pageY)}handleTouchStartDolly(){let t=e[0].pageX-e[1].pageX,i=e[0].pageY-e[1].pageY,s=Math.sqrt(t*t+i*i);this.dollyStart.set(0,s)}handleTouchStartDollyPan(){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchStartDolly(),this.enablePan&&this.handleTouchStartPan()}handleTouchStartDollyRotate(){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchStartDolly(),this.enableRotate&&this.handleTouchStartRotate()}handleTouchMoveRotate(t){if(2===e.length){let e=i(t),s=.5*(t.pageX+e.x),o=.5*(t.pageY+e.y);this.rotateEnd.set(s,o)}else{if(t.pointerId!==e[0].pointerId)return;this.rotateEnd.set(t.pageX,t.pageY)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);let s=this.domElement;s&&(this.rotateLeft(2*Math.PI*this.rotateDelta.x/s.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/s.clientHeight)),this.rotateStart.copy(this.rotateEnd)}handleTouchMovePan(t){if(2===e.length){let e=i(t),s=.5*(t.pageX+e.x),o=.5*(t.pageY+e.y);this.panEnd.set(s,o)}else{if(t.pointerId!==e[0].pointerId)return;this.panEnd.set(t.pageX,t.pageY)}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}handleTouchMoveDolly(t){let e=i(t),s=t.pageX-e.x,o=t.pageY-e.y,a=Math.sqrt(s*s+o*o);this.dollyEnd.set(0,a),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}handleTouchMoveDollyPan(t){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchMoveDolly(t),this.enablePan&&this.handleTouchMovePan(t)}handleTouchMoveDollyRotate(t){this.enableZoom&&!0===this.isTouchZoom&&this.handleTouchMoveDolly(t),this.enableRotate&&this.handleTouchMoveRotate(t)}checkRaycastLock(){if(this.object.data.raycastLock){if(this.options.isPlayMode)return!1;{let t=this.options?.showCameraLock;return t&&t(),!0}}return!1}};function st(t){let e=2*Math.PI;for(;t<=-Math.PI;)t+=e;for(;t>Math.PI;)t-=e;return t}function ot(t){return 1-Math.pow(1-t,4)}var at,nt,rt=new Promise(t=>{at=t});function ht(t){return nt||(nt=async function(){let e=t??(g?".":"https://cdn.spline.design/@splinetool/runtime@2.0.1/build"),i=import("./physics.js"),[s,o]=await Promise.all([i,fetch(`${e}/physics.wasm`).then(t=>t.arrayBuffer())]);await s.init(o),at(s)}())}function lt(t){let e=t.elements,i=e[0]**2+e[1]**2+e[2]**2,s=e[4]**2+e[5]**2+e[6]**2,o=e[8]**2+e[9]**2+e[10]**2,a=e[0]**2+e[4]**2+e[8]**2,n=e[1]**2+e[5]**2+e[9]**2,r=e[2]**2+e[6]**2+e[10]**2,h=1e-8;return i<h||s<h||o<h||a<h||n<h||r<h}function dt(t,e){let i=new L;if(e&&lt(e))return i.setAttribute("position",new j([],3)),i.setIndex([]),i;if(!t.getAttribute("position"))return i.setAttribute("position",new j([],3)),i.setIndex([]),i;let{positions:s,triIndices:o}=h(t.getAttribute("position"),t.getIndex());return i.setAttribute("position",new j(s,3)),i.setIndex(o),e&&i.applyMatrix4(e),i}var ct,pt=class{constructor(t,e,i,s,o,a){this.id=t,this.data=e,this.object=i,this.initialDisabled=!1,this.actions=d(e,e.actions,s,o,a,i),this.target=e.target}disconnect(){c(this.actions)}dispatch(t){this.initialDisabled||(this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.object.dispatchEvent({type:"beginEvent",eventName:"Collision"}),this.actions.Transition.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.Animation.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.TimelineAnimation.forEach(t=>{"runMode"in t.data&&"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.Reset.forEach(t=>{t.dispatch()}),this.actions.Link.forEach(t=>{t.dispatch()}),this.actions.Reset.forEach(t=>{t.dispatch()}),this.actions.Create.forEach(t=>{t.dispatch()}),this.actions.Destroy.forEach(e=>{e.dispatch(t??!1)}),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.Audio.forEach(t=>{t.dispatchBasic()}),this.actions.Particles.forEach(t=>{t.dispatchBasic()}),this.actions.Video.forEach(t=>{t.dispatchBasic()}),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch()))}},mt=class{constructor(t,e,i,s,o,a){this.id=t,this.data=e,this.object=i,this.page=s,this.currentIntersectedObjects=[],this.actions=d(e,e.actions,s,o,a,i),this.target=e.target,this.triggeringObjects=[];for(let t of e.triggeringObjects){let e=s.scene.find(t);e&&this.triggeringObjects.push(e)}}isValidTriggeringObject(t){return"all"===this.target||this.triggeringObjects.some(e=>e===t||e.isAncestorOf(t.uuid)||t.isAncestorOf(e.uuid))}disconnect(){c(this.actions)}dispatch(){this.object.destroyedInAction||(this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.object.dispatchEvent({type:"beginEvent",eventName:"Trigger"}),this.actions.Transition.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.SwitchCamera.forEach(t=>{"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.TimelineAnimation.forEach(t=>{"runMode"in t.data&&"Toggle"===t.data.runMode?t.toggle():t.play()}),this.actions.Link.forEach(t=>{t.dispatch()}),this.actions.Reset.forEach(t=>{t.dispatch()}),this.actions.Create.forEach(t=>{t.dispatch()}),this.actions.Destroy.forEach(t=>{t.dispatch(!1)}),this.actions.Audio.forEach(t=>{t.dispatchBasic()}),this.actions.Particles.forEach(t=>{t.dispatchBasic()}),this.actions.Video.forEach(t=>{t.dispatchBasic()}),this.actions.SceneTransition.forEach(t=>{t.dispatch()}),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch()))}};rt.then(t=>ct=t);var ut=new M,yt=new C,vt=new M,gt=(new S(0,0,0,"YXZ"),new S(0,0,0,"XYZ")),ft=new M,bt=new M,Et=new M(1,1,1),Pt=new C,Ct=new x,Mt=new x,xt={type:"updateMatrix"},Tt=new C,St=new G,Dt=.01,wt={type:"beginEvent",eventName:"Collision"},Rt={type:"beginEvent",eventName:"Trigger"};function jt(t){if(b.physicsEnabled(t.scene.objects))return!0;let e=!1;return t.scene.objects.traverse((t,i)=>{if(i.events)if(Array.isArray(i.events)){for(let t of i.events)if(!0!==t.data.disabled&&"GameControl"===t.data.type&&t.data.collisionEnabled){e=!0;break}}else for(let t of Object.values(i.events))if(!0!==t.disabled&&"GameControl"===t.type&&t.collisionEnabled){e=!0;break}}),e}var Gt,Lt,Bt=t=>t.states.some(t=>void 0!==t.data.position||void 0!==t.data.rotation||void 0!==t.data.hiddenMatrix||void 0!==t.data.cloner||void 0!==t.data.pathSnapping),At=class{constructor(t){this.eventContext=t,this.isEnabled=!1,this.gameControl=null,this.joysticks=[],this.joystickToGameControls=[],this.sharedGameControlGlobals={entitiesWithTransformAnim:[],entityToCollisionEvents:{},colliderToEntity:new Map,kinematicBodyToEntity:new Map,triggers:[],gamePads:[],createdObjects:[],nCreatedPerAction:{}},this.sensorToTriggerEvent={},this.eventManager=void 0,this.needsCollisionDetection=!1,this.initializationCounter=-1,this.fixedBodiesToWatch=[],this.rigidBodyToMesh=new Map,this.nActiveRigidBodies=0,this.collisionEvents=[],this.isExport=!1,this.skipRender=!0,this._staticBVHAttrIds=new WeakMap,this._staticBVHNextAttrId=1,this.processRigidBody=t=>{if(t.bodyType()!==ct.RigidBodyType.Dynamic)return;t.isSleeping()||this.nActiveRigidBodies++;let[e,i,s]=this.rigidBodyToMesh.get(t.handle);if(ut.copy(t.translation()).multiplyScalar(this.pixelsPerMeter),yt.copy(t.rotation()),e.matrixWorld.compose(ut,yt,i),e.hasNonUniformScale&&e.matrixWorld.multiply(e.shearScale),e.dispatchEvent(xt),s){let t=e.cloner;if(t&&void 0===t.objectForSample){t.matrixWorld.copy(e.matrixWorld);for(let e of t.children)e.updateMatrixWorld(!0)}for(let t of e.children)t.updateMatrixWorld(!0)}},this.accumulator=0,this.handleCollisionEvents=(t,e,i)=>{if(!1===i)return;let s,o;if(this.sensorToTriggerEvent[t]?(s=this.sensorToTriggerEvent[t],o=this.sharedGameControlGlobals.colliderToEntity.get(e)):this.sensorToTriggerEvent[e]&&(s=this.sensorToTriggerEvent[e],o=this.sharedGameControlGlobals.colliderToEntity.get(t)),s&&o&&s.isValidTriggeringObject(o))s.dispatch();else{for(let i=this.sharedGameControlGlobals.createdObjects.length-1;i>=0;i--){let s=this.sharedGameControlGlobals.createdObjects[i];if(s.userData.hasCollisionDestroy&&(s.rigidBody?.collider(0).handle===t||s.rigidBody?.collider(0).handle===e)){this.sharedGameControlGlobals.createdObjects.splice(i,1),s.removeFromParent(),requestAnimationFrame(()=>this.sharedGameControlGlobals.rapierWorld?.removeRigidBody(s.rigidBody));break}}if(void 0!==this.gameControl?.object&&this.gameControl.object===this.sharedGameControlGlobals.colliderToEntity.get(t)){let t=this.sharedGameControlGlobals.colliderToEntity.get(e),i=this.sharedGameControlGlobals.entityToCollisionEvents[t.uuid];if(void 0===i)return;for(let s of i)"character"===s.data.target&&this.dispatchCollisionEvent(s,t,e)}else if(void 0!==this.gameControl?.object&&this.gameControl.object===this.sharedGameControlGlobals.colliderToEntity.get(e)){let e=this.sharedGameControlGlobals.colliderToEntity.get(t),i=this.sharedGameControlGlobals.entityToCollisionEvents[e.uuid];if(void 0===i)return;for(let s of i)"character"===s.data.target&&this.dispatchCollisionEvent(s,e,t)}else{let i=this.sharedGameControlGlobals.colliderToEntity.get(t),s=this.sharedGameControlGlobals.entityToCollisionEvents[i.uuid];if(void 0!==s)for(let e of s)"scene"===e.data.target&&this.dispatchCollisionEvent(e,i,t);let o=this.sharedGameControlGlobals.colliderToEntity.get(e),a=this.sharedGameControlGlobals.entityToCollisionEvents[o?.uuid];if(void 0!==a)for(let t of a)"scene"===t.data.target&&this.dispatchCollisionEvent(t,o,e)}}},this.isExport=t.isExport,this.sharedAssets=t.sharedAssets,this.renderer=t.renderer,this.requestRender=t.requestRender,this.domElement=this.renderer.domElement,this.pixelsPerMeter=200,this.gravity=this.page.data.globalPhysics.gravity}get page(){return this.eventContext.page}markIsDestroyTarget(){this.page.traverseVisibleEntity(t=>{let e=t.dataPatched;for(let t of e.events){if(!0===t.data.disabled)continue;let e=t.data.actions?.find(t=>"Destroy"===t.data.type)?.data;if(e)for(let t of e.objects){let e=this.page.scene.find(t);e&&(e.userData.hasDestroy=!0)}}})}markIsDragObject(){this.page.traverseVisibleEntity(t=>{let e=t.dataPatched;for(let t of e.events)if(!0!==t.data.disabled&&"DragDrop"===t.data.type)for(let e of t.data.objects){let t=this.page.scene.find(e);t&&(t.userData.hasDrag=!0)}})}_staticBVHIdOf(t){let e=this._staticBVHAttrIds.get(t);return void 0===e&&(e=this._staticBVHNextAttrId++,this._staticBVHAttrIds.set(t,e)),e}initBVH(){if(null===t())return void f("collision-bvh","trigger/collision detection");let e=[],i=[];if(this.page.traverseChildren(t=>{let s,o=t instanceof r,a=m(t);if(u(t)||o||a)return;s=y(t)?t.object:t;let n=s.dataPatched;if("visibility"===n.physics?.enabled?!n.visible:!n.physics?.enabled)return!0;let h=t.geometry,l=!0===s.userData.hasDestroy,d=!0===s.userData.hasDrag;if(Bt(n)||l||d||s.dataPatched.events.some(t=>!0!==t.data.disabled&&("GameControl"===t.data.type||"Follow"===t.data.type)))return t.updateMatrixWorldRigid(),this.addBoundsTree(t),!0;if(h){let s=h.getAttribute("position");if(void 0!==s&&s.count>0){e.push({geometry:h,matrixWorld:t.matrixWorld}),i.push(h.id,this._staticBVHIdOf(s),s.version,null!==h.index?this._staticBVHIdOf(h.index):-1,null!==h.index?h.index.version:-1);for(let e of t.matrixWorld.elements)i.push(e)}}}),e.length>0){let s=this._staticBVHCache;if(void 0!==s&&s.signature.length===i.length&&s.signature.every((t,e)=>t===i[e]))return void(this.sharedGameControlGlobals.staticMeshBVH=s.bvh);let o=e.map(t=>dt(t.geometry,t.matrixWorld)),a=l(o,!1),n=new(t())(a);this._staticBVHCache={signature:i,bvh:n},this.sharedGameControlGlobals.staticMeshBVH=n}}addRigidBody(t,e,i){if(lt(t.matrixWorld))return;let s=[],o="geometry"in t?t.geometry:void 0,a=e.dataPatched;if(void 0!==o?.getAttribute("position")&&s.push(dt(o,t.shearScale)),a.physics.fusedBody){let e=this.gatherChildrenGeom(t,s);t.traverseObject(e),t.children.forEach(t=>t.updateMatrixWorld(!0));let i=t.cloner;i&&void 0===i.objectForSample&&"dynamic"===a.physics.rigidBody&&(i.traverseObject(e),i.children.forEach(t=>t.updateMatrixWorld(!0)))}if(s.length>0){let n,r=!1,h=!i.fromCreate&&"dynamic"===a.physics.rigidBody||i.fromCreate&&i.dynamic;h?(n=ct.RigidBodyDesc.dynamic(),n.setLinearDamping(a.physics.damping).setAngularDamping(a.physics.damping).setAdditionalMass(1e-9).setGravityScale(a.physics.gravityScale).enabledRotations(...a.physics.enabledRotation).enabledTranslations(...a.physics.enabledTranslation)):(i.hasTransformAnim||i.hasFollow||i.hasDrag)&&!i.fromCreate?(n=ct.RigidBodyDesc.kinematicPositionBased(),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(t),r=!0):n=ct.RigidBodyDesc.fixed();let d=l(s);(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).decompose(ut,yt,vt),t.position0=ut.clone().divideScalar(this.pixelsPerMeter),t.rotation0=yt.clone(),ut.divideScalar(this.pixelsPerMeter),n.setTranslation(ut.x,ut.y,ut.z).setRotation(yt),o?d?.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter):d?.scale(vt.x/this.pixelsPerMeter,vt.y/this.pixelsPerMeter,vt.z/this.pixelsPerMeter);let c=this.sharedGameControlGlobals.rapierWorld.createRigidBody(n);h?this.rigidBodyToMesh.set(c.handle,[t,vt.clone(),a.physics.fusedBody]):r?this.sharedGameControlGlobals.kinematicBodyToEntity.set(c.handle,t):this.fixedBodiesToWatch.push([t,c,(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).clone()]);let p=!(void 0===a.geometry||"SubdivGeometry"===a.geometry.type||"NonParametricGeometry"===a.geometry.type||"BooleanGeometry"===a.geometry.type||"VectorGeometry"===a.geometry.type||"StarGeometry"===a.geometry.type||"RectangleGeometry"===a.geometry.type||"EllipseGeometry"===a.geometry.type||"TriangleGeometry"===a.geometry.type||"TorusGeometry"===a.geometry.type||"HelixGeometry"===a.geometry.type);try{this.addCollider(c,a.physics,d,e,p)}catch{try{this.addCollider(c,a.physics,d,e,!1)}catch(t){console.error(t)}}t.rigidBody=c}}addBoundsTree(e){let i=[];if(void 0!==e.geometry?.getAttribute("position")&&e.geometry?.getAttribute("position").count>0&&i.push(dt(e.geometry,e.shearScale)),e.traverseObject(this.gatherChildrenGeom(e,i)),e.children.forEach(t=>t.updateMatrixWorld(!0)),i.length>0){let s=l(i,!1);e.bvhGeometry=s,s.getAttribute("position").count>0?(e.bvhGeometry.boundsTree=new(t())(s),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(e)):g&&console.warn(`ControlsManager.addBoundsTree: object "${e.name}" has empty geometry`)}}addCollider(t,e,i,s,o=!0){if(0===i?.getAttribute("position").count||0===i?.getIndex()?.count)return;let a;i&&(a="trimesh"===e.colliderType?ct.ColliderDesc.trimesh(i.getAttribute("position").array,i.getIndex().array):ct.ColliderDesc.convexMesh(i.getAttribute("position").array,o?i.getIndex().array:void 0)),a.setFrictionCombineRule(ct.CoefficientCombineRule.Average).setRestitutionCombineRule(ct.CoefficientCombineRule.Average).setDensity(e.density).setFriction(e.friction).setRestitution(e.restitution);let n=this.sharedGameControlGlobals.rapierWorld.createCollider(a,t);this.sharedGameControlGlobals.colliderToEntity.set(n.handle,s),this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid]?.some(t=>"scene"===t.target)&&n.setActiveEvents(ct.ActiveEvents.COLLISION_EVENTS)}gatherChildrenGeom(t,e){return(i,s)=>{if(0===s)return;let o;if(u(i)){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;o=i.object}else if(y(i))o=i.object;else if(o=i,o.dataPatched.cloner?.hideBase)return!0;let a=o.dataPatched;if("visibility"===a.physics.enabled?!a.visible:!a.physics.enabled)return!0;1===s?t.hasNonUniformScale?i.matrixWorld.multiplyMatrices(t.shearScale,i.hiddenMatrix):i.matrixWorld.copy(i.hiddenMatrix):i.matrixWorld.multiplyMatrices(i.parent.matrixWorld,i.hiddenMatrix),i.matrixWorld.multiply(i.matrix);let n=i.geometry;void 0!==n?.getAttribute("position")&&e.push(dt(n,i.matrixWorld))}}activate(t){if(this.isEnabled)return;this.isEnabled=!0,this.eventManager=t,this.usePhysics=this.page.data.globalPhysics.usePhysics;let e=this.page.playCamera,i=!1;this.page.traverseEntity(t=>{for(let e of t.dataPatched.events)if(!1===e.data.disabled&&"Trigger"===e.data.type)return this.needsCollisionDetection=!0,!0});let s=O();if(null!==s?i=s.setup({manager:this,camera:e,renderer:this.renderer,sharedAssets:this.sharedAssets,eventContext:this.eventContext,isExport:this.isExport})||i:null!==this.page.data.publish.gameControlObject&&f("game-controls","the scene's game controls"),!1===i){let{enableRotate:t,enablePan:i,enableZoom:s,autoRotate:o,hoverRotatePanMode:a}=this.eventManager.publish.orbitControls;(t||i||s||o||0!==a)&&(this.orbitControls=new it(e,this.renderer.domElement,{isExport:this.isExport,isPlayMode:!0}),this.orbitControls.addEventListener("change",this.requestRender),this.orbitControls.addEventListener("end",this.requestRender),this.orbitControls.addEventListener("start",this.requestRender),this.orbitControls.fromJSON(this.eventManager.publish.orbitControls,this.eventManager.publish.mouseEventTarget),this.orbitControls.useKeyEvents=!1,this.orbitControls.addEventListenersToCamera(),this.orbitControls.connect(),this.orbitControls.update())}let o=this.renderer.domElement.width/this.renderer.getPixelRatio(),a=this.renderer.domElement.height/this.renderer.getPixelRatio();O()?.createJoysticks(this,o,a),this.markIsDestroyTarget(),this.markIsDragObject(),this.rebuildBVH(),this.initializationCounter++,window.setTimeout(()=>{this.collisionEvents.forEach(t=>t.initialDisabled=!1)},80)}initPhysics(){this.sharedGameControlGlobals.rapierWorld?.free(),this.sharedGameControlGlobals.rapierWorld=new ct.World(new ct.Vector3(0,this.gravity,0)),this.events=new ct.EventQueue(!0);let t=[],e=[];if(this.page.traverseChildren(i=>{let s;if(u(i)){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;s=i.object}else if(y(i))s=i.object;else{if(m(i)||i instanceof r)return;if(s=i,!1===s.dataPatched.cloner?.disabled&&s.dataPatched.cloner?.hideBase&&!0!==s.dataPatched.physics?.fusedBody)return!0}let o,a=s.dataPatched;for(let t of a.events)!0!==t.data.disabled&&"GameControl"===t.data.type&&(o=t.data);if(!a.physics||("visibility"===a.physics.enabled?!a.visible:!a.physics.enabled))return!0;i.updateMatrixWorldRigid();let n=Bt(a),h=!1,l=s.userData.hasDestroy,d=s.userData.hasDrag,c=!1;for(let t of a.events)if(!0!==t.data.disabled)if("Collision"===t.data.type){h=!0;let e=new pt(t.id,t.data,s,this.page,this.sharedAssets,this.eventManager);e.initialDisabled=!0,this.collisionEvents.push(e),this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid]&&this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid].every(e=>e.id!==t.id)?this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid].push(e):this.sharedGameControlGlobals.entityToCollisionEvents[s.uuid]=[e]}else if("Follow"===t.data.type){c=!0;let e=t.data.target;i.traverseVisible(t=>{t.userData.isFollowingObj=e})}"dynamic"===a.physics.rigidBody&&!1===a.physics.fusedBody&&(i.matrixWorldFusedFalse=i.matrixWorld.clone());let p=i.geometry;if(void 0!==o){let t=ct.RigidBodyDesc.kinematicPositionBased();(i.hasNonUniformScale?i.matrixWorldRigid:i.matrixWorld).decompose(ut,yt,vt),i.position0=ut.clone().divideScalar(this.pixelsPerMeter),i.rotation0=yt.clone(),ut.divideScalar(this.pixelsPerMeter),t.setTranslation(ut.x,ut.y,ut.z).setRotation(yt);let e,n=this.sharedGameControlGlobals.rapierWorld.createRigidBody(t);i.rigidBody=n,e="sphere"===o.collider.type?ct.ColliderDesc.ball(o.collider.radius/this.pixelsPerMeter):"capsule"===o.collider.type?ct.ColliderDesc.capsule((o.collider.height/2-o.collider.radius)/this.pixelsPerMeter,o.collider.radius/this.pixelsPerMeter):ct.ColliderDesc.cuboid(o.collider.width/this.pixelsPerMeter/2,o.collider.height/this.pixelsPerMeter/2,o.collider.depth/this.pixelsPerMeter/2),e.setFrictionCombineRule(ct.CoefficientCombineRule.Average).setDensity(a.physics.density).setFriction(a.physics.friction).setRestitution(0).setRestitutionCombineRule(ct.CoefficientCombineRule.Min);let r=this.sharedGameControlGlobals.rapierWorld.createCollider(e,n);this.sharedGameControlGlobals.colliderToEntity.set(r.handle,s),ut.fromArray(o.collider.position.map(t=>"number"==typeof t?t:0)).multiply(vt.setFromMatrixScale(s.matrixWorld)).divideScalar(this.pixelsPerMeter),r.setTranslationWrtParent(ut);let h=(new C).setFromEuler((new S).setFromVector3((new M).fromArray(o.collider.rotation.map(t=>"number"==typeof t?t:0))));r.setRotationWrtParent(h),r.setActiveEvents(ct.ActiveEvents.COLLISION_EVENTS),this.generateSensorColliderDescs(s,!0)}else"dynamic"===a.physics.rigidBody||n||c||l||d||h?(this.addRigidBody(i,s,{hasFollow:c,hasTransformAnim:n,hasDrag:d}),this.generateSensorColliderDescs(s,a.physics.fusedBody)):(p&&t.push(dt(p,i.matrixWorld)),a.physics.fusedBody&&i.traverseObject((e,i)=>{if(0===i)return;let s;if(u(e)){if(!e.objectForSample)return!0===e.object.dataPatched.physics.fusedBody&&"dynamic"===e.object.dataPatched.physics.rigidBody||void 0;if(e.objectForSample.dataPatched.physics.fusedBody)return;s=e.object}else{if(m(e)||e instanceof r)return;if(y(e))s=e.object;else if(s=e,s.dataPatched.cloner?.hideBase)return!0}let o=s.dataPatched;if("visibility"===o.physics.enabled?!o.visible:!o.physics.enabled)return!0;let a=e.geometry;void 0!==a?.getAttribute("position")&&t.push(dt(a,e.matrixWorld))}),this.generateSensorColliderDescs(s,a.physics.fusedBody,e));return!(!0!==a.physics?.fusedBody&&!o)||void 0}),0===t.length)return;let i=l(t);i.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter);let s=ct.RigidBodyDesc.fixed(),o=this.sharedGameControlGlobals.rapierWorld.createRigidBody(s),a=ct.ColliderDesc.trimesh(i.getAttribute("position").array,i.getIndex().array).setFrictionCombineRule(ct.CoefficientCombineRule.Multiply).setRestitutionCombineRule(ct.CoefficientCombineRule.Multiply).setFriction(1).setRestitution(1);this.sharedGameControlGlobals.rapierWorld.createCollider(a,o);for(let[t,i]of e){let e=this.sharedGameControlGlobals.rapierWorld.createCollider(t,o);this.sensorToTriggerEvent[e.handle]=i}}updatePositions(){return this.nActiveRigidBodies=0,this.sharedGameControlGlobals.rapierWorld.forEachRigidBody(this.processRigidBody),this.nActiveRigidBodies>0}rebuildBVH(){this.usePhysics?this.initPhysics():(this.page.traverseEntity(t=>{for(let e of t.dataPatched.events)if("Trigger"===e.data.type&&!0!==e.data.disabled){let i=new mt(e.id,e.data,t,this.page,this.sharedAssets,this.eventManager),s=(new x).compose(ft.fromArray(e.data.position.map(t=>"number"==typeof t?t:0)),Pt.setFromEuler(gt.fromArray(e.data.rotation.map(t=>"number"==typeof t?t:0))),Et);if("box"===e.data.triggerZone){let o=new w;o.min.fromArray(e.data.size.map(t=>"number"==typeof t?t:0)).multiplyScalar(-.5),o.max.fromArray(e.data.size.map(t=>"number"==typeof t?t:0)).multiplyScalar(.5),this.sharedGameControlGlobals.triggers.push([o,s,t,i])}else this.sharedGameControlGlobals.triggers.push([e.data.radius,s,t,i])}}),this.needsCollisionDetection&&this.initBVH())}disconnectEvents(){this.collisionEvents.forEach(t=>t.disconnect()),this.sharedGameControlGlobals.triggers.forEach(t=>t[3].disconnect()),this.sharedGameControlGlobals.triggers.length=0}deactivate(){if(this.isEnabled){this.isEnabled=!1,this.page.traverse(t=>{let e=t;e.matrixWorldFusedFalse&&(e.matrixWorldFusedFalse=void 0),e.rigidBody&&(e.rigidBody=void 0),e.position0&&(e.position0=void 0),e.rotation0&&(e.rotation0=void 0)}),this.sharedGameControlGlobals.rapierWorld?.free(),this.sharedGameControlGlobals.rapierWorld=void 0,this.sharedGameControlGlobals.staticMeshBVH=void 0,this.accumulator=0,this.sharedGameControlGlobals.entitiesWithTransformAnim=[],this.sharedGameControlGlobals.kinematicBodyToEntity.clear(),this.fixedBodiesToWatch=[],this.disconnectEvents(),this.gameControl?.reset(),this.gameControl?.dispose(),this.gameControl=null,this.initializationCounter=-1,this.joysticks.forEach(([t,e])=>{t?.destroy(),e.remove()}),this.joystickToGameControls=[],this.joysticks=[],this.orbitControls&&(this.orbitControls.dispose(),this.orbitControls=void 0),this.navigationMeshWrapper?.dispose(),this.navigationMeshWrapper=void 0;for(let t of Object.values(this.sharedGameControlGlobals.entityToCollisionEvents))t.forEach(t=>t.disconnect());this.sharedGameControlGlobals.entityToCollisionEvents={},this.page.updateMatrixWorld(!0)}}update(t){if(!this.isEnabled)return!0;let e=!0;if(void 0!==this.orbitControls&&this.orbitControls.needsUpdate&&(this.orbitControls.update(),e=!this.orbitControls.isCurrentlyDamping),this.initializationCounter>=0&&this.initializationCounter<2?(this.initializationCounter++,e=!1):2===this.initializationCounter&&this.gameControl&&(e=!this.gameControl.update(t)&&e),!1===this.usePhysics&&this.checkTrigger(),this.usePhysics){let i=.016666666666666666;if(0===t)e=this.stepPhysics()&&e;else{let s=t/1e3;s<i&&s>.55*i&&(s=i),this.accumulator+=s;let o=performance.now(),a=0,n=6;for(;this.accumulator>=i&&a<n&&(e=this.stepPhysics()&&e,this.accumulator-=i,a++,!(performance.now()-o>1e3*i)););this.accumulator=this.accumulator%i}}this.skipRender=e}recordPhysicsPose(t){(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).decompose(ut,yt,vt);let e=t;void 0===e.prevQ?(e.prevQ=yt.clone(),e.prevT=ut.clone()):(e.prevQ.copy(yt),e.prevT.copy(ut))}promoteMovedFixedBodies(){for(let t=this.fixedBodiesToWatch.length-1;t>=0;t--){let[e,i,s]=this.fixedBodiesToWatch[t];(e.hasNonUniformScale?e.matrixWorldRigid:e.matrixWorld).equals(s)||(i.setBodyType(ct.RigidBodyType.KinematicPositionBased,!0),this.sharedGameControlGlobals.kinematicBodyToEntity.set(i.handle,e),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(e),this.fixedBodiesToWatch.splice(t,1))}}clampPushedBodies(){let t=this.gameControl?.object.rigidBody;if(void 0===t)return;let e=this.sharedGameControlGlobals.rapierWorld,i=t.linvel(),s=t.translation(),o=Math.hypot(i.x,i.z);for(let a=0;a<t.numColliders();a++){let n=t.collider(a);e.contactPairsWith(n,t=>{let a=t.parent();if(null===a||!a.isDynamic())return;let r=a.translation(),h=-1/0,l=0,d=0;if(e.contactPair(n,t,t=>{let e=t.normal(),o=e.x*(r.x-s.x)+e.y*(r.y-s.y)+e.z*(r.z-s.z)<0?-1:1;if(Math.abs(e.y)>.7)return;let a=o*e.x,n=o*e.z,c=Math.hypot(a,n);if(c<1e-4)return;let p=(i.x*a+i.z*n)/c;p>h&&(h=p,l=a/c,d=n/c)}),h===-1/0)return;let c=i.x*l+i.z*d;if(c<-Dt)return;let p=a.linvel();if(o>Dt&&c>Dt){let t=p.x*l+p.z*d;if(t<=0)return;let e=Math.min(t,c);return void a.setLinvel({x:l*e,y:p.y,z:d*e},!0)}let m=p.x*l+p.z*d-Math.max(0,c);if(m<=0)return;let u=.5*m;a.setLinvel({x:p.x-l*u,y:p.y,z:p.z-d*u},!0)})}}stepPhysics(){this.promoteMovedFixedBodies();for(let t of this.sharedGameControlGlobals.kinematicBodyToEntity.values())this.recordPhysicsPose(t),t.rigidBody.setNextKinematicTranslation(ut.divideScalar(this.pixelsPerMeter)),t.rigidBody.setNextKinematicRotation(yt);for(let t of this.sharedGameControlGlobals.entitiesWithTransformAnim)!0!==t.rigidBody?.isKinematic()&&this.recordPhysicsPose(t);return this.sharedGameControlGlobals.rapierWorld.step(this.events),this.clampPushedBodies(),this.events?.drainCollisionEvents(this.handleCollisionEvents),!this.updatePositions()}dispatchCollisionEvent(t,e,i){let s,o=(this.sharedGameControlGlobals.rapierWorld?.getCollider(i))._parent;if(e.cloner)for(let t of e.cloner.children)if(t.rigidBody===o){s=t;break}t.dispatch(s),e.dispatchEvent(wt)}updateUseWindowEvents(t){this.orbitControls?.updateUseWindowEvents(t)}generateSensorColliderDescs(t,e,i){let s=Mt.copy(t.matrixWorld).invert();t.traverseEntity((o,a)=>{if(!1===e&&1===a)return!0;for(let e of o.dataPatched.events)if("Trigger"===e.data.type&&!0!==e.data.disabled){let a,n=new mt(e.id,e.data,o,this.page,this.sharedAssets,this.eventManager);if(a="box"===e.data.triggerZone?ct.ColliderDesc.cuboid(...e.data.size.map(t=>("number"==typeof t?t:1)/(2*this.pixelsPerMeter))):ct.ColliderDesc.ball(e.data.radius/this.pixelsPerMeter),a.setDensity(0).setSensor(!0).setActiveEvents(ct.ActiveEvents.COLLISION_EVENTS),ft.fromArray(e.data.position.map(t=>"number"==typeof t?t:0)),Pt.setFromEuler(gt.fromArray(e.data.rotation.map(t=>"number"==typeof t?t:0))),Ct.compose(ft,Pt,Et).premultiply(o.matrixWorld),i?(Ct.decompose(ft,Pt,bt),a.setActiveCollisionTypes(ct.ActiveCollisionTypes.KINEMATIC_FIXED|ct.ActiveCollisionTypes.DYNAMIC_FIXED)):(Ct.premultiply(s).decompose(ft,Pt,bt),t.rigidBody.bodyType()===ct.RigidBodyType.Dynamic||(t.rigidBody.bodyType()===ct.RigidBodyType.Fixed?a.setActiveCollisionTypes(ct.ActiveCollisionTypes.KINEMATIC_FIXED|ct.ActiveCollisionTypes.DYNAMIC_FIXED):a.setActiveCollisionTypes(ct.ActiveCollisionTypes.KINEMATIC_KINEMATIC|ct.ActiveCollisionTypes.DYNAMIC_KINEMATIC))),ft.divideScalar(this.pixelsPerMeter),a.setTranslation(ft.x,ft.y,ft.z),a.setRotation(Pt),i)i.push([a,n]);else{let e=this.sharedGameControlGlobals.rapierWorld.createCollider(a,t.rigidBody);this.sensorToTriggerEvent[e.handle]=n}}})}checkTrigger(){let t;for(let e=0;e<this.sharedGameControlGlobals.triggers.length;e++){let[i,s,o,a]=this.sharedGameControlGlobals.triggers[e];for(let e=0;e<this.sharedGameControlGlobals.entitiesWithTransformAnim.length;e++){let n=this.sharedGameControlGlobals.entitiesWithTransformAnim[e];if(o===n||!1===a.isValidTriggeringObject(p.is(n)?n:n.object))continue;let r=Mt.copy(o.matrixWorld).decompose(ft,Tt,bt).compose(ft,Tt,Et).multiply(s),h=Ct.copy(n.matrixWorld).invert().multiply(r),l=n.bvhGeometry.boundsTree;i instanceof w?t=l.intersectsBox(i,h):(St.radius=i,St.center.setFromMatrixPosition(h),t=l.intersectsSphere(St)),t?-1===a.currentIntersectedObjects.indexOf(n)&&(a.currentIntersectedObjects.push(n),a.dispatch(),o.dispatchEvent(Rt)):a.currentIntersectedObjects=a.currentIntersectedObjects.filter(t=>t!==n)}}}},Wt=new Promise(t=>{Gt=t});function Ot(t){return Lt||(Lt=async function(){let e=t??(g?".":"https://cdn.spline.design/@splinetool/runtime@2.0.1/build"),i=import("./navmesh.js"),[s,o]=await Promise.all([i,fetch(`${e}/navmesh.wasm`).then(t=>t.arrayBuffer())]),a=s.default,n=await a({wasmBinary:o});Gt(n)}())}export{it as a,ht as b,B as c,W as d,I as e,dt as f,wt as g,jt as h,Bt as i,At as j,Wt as k,Ot as l};
@@ -0,0 +1 @@
1
+ var r=new Set;function e(e){r.add(e)}function n(e){if(0===r.size)return;let n=Array.from(r);r.clear();for(let r of n)r.render(e)}export{e as a,n as b};
@@ -0,0 +1 @@
1
+ import{g as t}from"./runtime-chunk-QZ35BPGB.js";import{g as e}from"./runtime-chunk-4KZXQGUQ.js";import{a as i}from"./runtime-chunk-Z5OH244S.js";import{c as r}from"./runtime-chunk-TZCHGFVF.js";import{Ba as s,C as a,Ca as n,Ea as o,K as l,j as h,k as p,l as d,o as c}from"./runtime-chunk-OW6T4XFV.js";import{$c as u,Cc as m,Ec as f,Fc as y,Kd as g,Oc as v,Pc as x,Pd as S,Rc as w,Re as M,Xc as b,bd as B,cd as P,dd as E,kd as A,ld as C}from"./runtime-chunk-VGN7YHB7.js";var D={Cloner:null,changeEntityProptotype:()=>{},createEntity:()=>{}};function O(t,e){let i=[];if(e.length!==t.length)return null;{let r=0;for(;r<t.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}function V(t,e){let i=[];if(!(e.length<=t.length))return null;{let r=0;for(;r<e.length;){if("*"===e[r])i.push(t[r]);else if(t[r]!==e[r])return null;r+=1}}return i}var W=new y,_=new y,T=new v,U=[new y(-1,1,1),new y(-1,-1,1),new y(1,-1,1),new y(1,1,1),new y(-1,1,-1),new y(-1,-1,-1),new y(1,-1,-1),new y(1,1,-1)],R=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],z=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],I=(t,e,i)=>{t.updateEntityBoxSize(W,_),T.copy(e).multiply(t.matrixWorld),0===_.x&&0===_.y&&0===_.z?i.push(new y(W.x,W.y,W.z).applyMatrix4(T)):U.forEach(t=>{i.push(t.clone().multiply(_).add(W).applyMatrix4(T))})},L=class extends b{constructor(){super(...arguments),this.matrix=new v,this.vertices=[],this.faces=[],this.edges=[],this.centerEdges=[]}copy(t){return super.copy(t),this.matrix.copy(t.matrix),this.vertices=t.vertices.map(t=>t.clone()),this.faces=t.faces.map(t=>t.clone()),this.edges=t.edges.map(t=>t.clone()),this.centerEdges=t.centerEdges.map(t=>t.clone()),this}setFromObjectSize(t,e=!1){t.updateWorldMatrix(!1,e),this.makeEmpty(),this.matrix.copy(t.matrixWorld);let i=(new v).copy(t.matrixWorld).invert();return this.expandByObjectSize(t,i,e)}expandByObjectSize(t,e,i=!1){let r=[];if(!0===i){let i=[];t.traverseEntity(t=>{if(t.visible||t.cloner&&t.data.visible){if(!("geometry"in t))return T.copy(e).multiply(t.matrixWorld),void i.push((new y).applyMatrix4(T));I(t,e,r)}}),0===r.length&&r.push(...i)}else I(t,e,r);return this.setFromPoints(r)}getCenter(t){return(t=super.getCenter(t)).applyMatrix4(this.matrix),t}getPositionToCenter(t){return(t=super.getCenter(t)).applyMatrix4(T.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(_).multiplyScalar(.5),this.getCenter(W),T.copy(this.matrix).setPosition(W),this.vertices=U.map(t=>t.clone().multiply(_).applyMatrix4(T))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=R.map(([t,e])=>new M(this.vertices[t],this.vertices[e])),this.centerEdges=this.edges.map(t=>t.getCenter(new y))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=z.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},N=new y,j=new y,F=new y,k=new y,q=new y,G=new y,H=new v,Z=1e-12,X=.01;function $(t){let e=t.elements;N.set(e[0],e[1],e[2]),j.set(e[4],e[5],e[6]),F.set(e[8],e[9],e[10])}function K(){let t=Math.max(N.lengthSq(),j.lengthSq(),F.lengthSq());N.lengthSq()>Z*t?k.copy(N).normalize():k.set(1,0,0),q.crossVectors(F,k),q.lengthSq()<=Z*t&&(q.copy(j).addScaledVector(k,-j.dot(k)),q.lengthSq()<=Z*t&&function(t,e){t.set(1,0,0).cross(e),t.lengthSq()<=Z&&t.set(0,1,0).cross(e),t.normalize()}(q,k)),q.normalize(),G.crossVectors(k,q)}function Q(t){return $(t),K(),H.makeBasis(k,q,G)}var Y,J=new v;(Y||(Y={})).is=function(t){return t&&t.__isSPEObject};var tt=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new v,this.copyPreviousMatrix=!0,this.hiddenMatrix=new v,this.pivotMatrix=new v,this.matrixWorldRigid=new v,this.shearScale=new v,this.shearScaleInv=new v}get __isSPEObject(){return!0}getPhysicsLocalMatrix(t){return!!this.rigidBody?.isDynamic()&&(t.copy(this.matrixWorld),this.hasNonUniformScale&&t.multiply(this.shearScaleInv),this.parent&&t.premultiply(J.copy(this.parent.matrixWorld).invert()),t.premultiply(J.copy(this.hiddenMatrix).invert()),t.multiply(J.copy(this.pivotMatrix).invert()),!0)}isDescendantOf(t){t instanceof w&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(let e of this.children)e.updateMatrixWorld(t)}updateWorldMatrix(t,e){let i=this.parent;if(t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorld.multiply(this.pivotMatrix),e)for(let t of this.children)t.updateWorldMatrix(!1,!0)}traverseChildren(t,e=0){for(let i of this.children)Y.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)Y.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=function(t,e,i){return $(t),K(),e.makeBasis(k,q,G),i.set(k.dot(N),k.dot(j),k.dot(F),0,q.dot(N),q.dot(j),q.dot(F),0,G.dot(N),G.dot(j),G.dot(F),0,0,0,0,1),function(){let t=N.length(),e=j.length(),i=F.length(),r=Math.max(t,e,i);if(r-t>X||r-e>X||r-i>X)return!0;let s=X*r*r;return Math.abs(N.dot(j))>s||Math.abs(N.dot(F))>s||Math.abs(j.dot(F))>s}()}(this.matrixWorld,this.matrixWorldRigid,this.shearScale),this.matrixWorldRigid.copyPosition(this.matrixWorld),this.shearScaleInv.copy(this.shearScale).invert()}attach(t,e){this.updateWorldMatrix(!0,!1);let i=(new v).copy(this.matrixWorld).invert();return null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),i.multiply(t.parent.matrixWorld)),"hiddenMatrix"in t&&t.hiddenMatrix instanceof v?t.hiddenMatrix.premultiply(i):t.applyMatrix4(i),t.updateWorldMatrix(!1,!1),this.add(t),void 0!==e&&(this.children.pop(),this.children.splice(e,0,t)),this}copy(t,e=!1){return super.copy(t,e),this.hasNonUniformScale=t.hasNonUniformScale,this}onAfterRender(t,e,i,r,s,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},et=class extends S{constructor(){super()}getPoints(t=12){let e,i=[],r=this.getCurveLengths(),s=r[r.length-1]/r.length;for(let a=0,n=this.curves;a<n.length;a++){let o=n[a],l=0===a?r[a]:r[a]-r[a-1],h=Math.ceil(t*l/s),p=o.getPoints(h);for(let t=0;t<p.length;t++){let r=p[t];e&&e.equals(r)||(i.push(r),e=r)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},it=.001,rt=new y,st=new y,at=new y,nt=new y,ot=new y,lt=new y,ht=new y,pt=new y,dt=new y;function ct(t,e,i){return rt.subVectors(e,t),st.subVectors(e,i),rt.cross(st).length()<=it}var ut,mt=new WeakMap;function ft(t){let e=mt.get(t.points);if(void 0!==e&&e.isClosed===t.isClosed)return e.curve;let i=function(t){let e=t.points,i=[e[0]],r=[new y(...e[0].data.position)];at.copy(r[0]);for(let t=0;t<e.length-1;t++)rt.fromArray(e[t].data.position),st.fromArray(e[t+1].data.position),ot.subVectors(rt,at),ht.subVectors(rt,st),ot.cross(ht).length()>it&&(i.push(e[t]),r.push((new y).copy(rt)),at.copy(rt));let s=e[e.length-1];i.push(s),r.push(new y(...s.data.position));let a=t.isClosed,n=i.length-(a?0:1),o=i.length,l=[],h=[];for(let t=0;t<o;t++){let e=i[t].data;l.push(new y(...e.controlPrevious.position)),h.push(new y(...e.controlNext.position))}let p=[];for(let t=0;t<n;t++){let e=t===o-1?0:t+1;p.push(ct(r[t],h[t],r[e])&&ct(r[t],l[e],r[e]))}let d=[];for(let t=0;t<o;t++){let e=i[t].data,s=r[t],n={position:s,prevDir:void 0,nextDir:void 0,controlPrevious:l[t],controlNext:h[t],tan:void 0,baseRoundness:e.roundness,removedLength:0};if(d.push(n),0===e.roundness||!a&&(0===t||t===o-1))continue;let c=a&&0==t?o-1:t-1,u=a&&t==o-1?0:t+1,m=(new y).subVectors(r[c],s).normalize(),f=(new y).subVectors(r[u],s).normalize();n.prevDir=m,n.nextDir=f;let g=p[a&&0===t?o-1:t-1],v=p[t];if(g&&v){nt.addVectors(m,f).normalize();let t=at.crossVectors(nt,m).length()/m.dot(nt);n.tan=t,n.removedLength=e.roundness/t}}for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],r=d[e];if(0!==i.removedLength||0!==r.removedLength){let t=i.position.distanceTo(r.position);i.removedLength=Math.min(i.removedLength,t/2),r.removedLength=Math.min(r.removedLength,t/2)}}let c=new Array(2*o).fill(null);for(let t=0;t<n;t++){let e=a&&t===o-1?0:t+1,i=d[t],r=d[e],s=null;if(p[t]){let t=i.position.clone(),e=r.position.clone();(0!==i.removedLength||0!==r.removedLength)&&(i.nextDir&&t.add(at.copy(i.nextDir).setLength(i.removedLength)),r.prevDir&&e.add(at.copy(r.prevDir).setLength(r.removedLength))),t.distanceTo(e)>it&&(s=new g(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(r.position)>it&&(s=new g(i.position,i.controlNext,r.controlPrevious,r.position));c[2*t+1]=s}for(let t=0;t<o;t++){let e=d[t];if(0===e.removedLength)continue;let i=e.position,r=e.prevDir.clone().multiplyScalar(e.removedLength).add(i),s=e.nextDir.clone().multiplyScalar(e.removedLength).add(i),a=e.tan*e.removedLength;nt.addVectors(e.prevDir,e.nextDir).normalize(),ot.copy(r).lerp(s,.5);let n=r.distanceTo(s)/2;dt.copy(nt).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(ot),lt.copy(nt).multiplyScalar(-a).add(dt);let o=i.distanceTo(lt)/i.distanceTo(ot);ht.copy(e.prevDir).multiplyScalar(o*i.distanceTo(r)).add(i),pt.copy(ht).lerp(lt,2);let l=r.clone().lerp(ht,4/3),h=s.clone().lerp(pt,4/3);c[2*t]=new g(r,l,h,s)}let u=new et;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return mt.set(t.points,{isClosed:t.isClosed,curve:i}),i}(ut||(ut={})).is=function(t){return t&&t.__isEntity};var yt=t=>ut.is(t),gt={type:"completeState",isfromEntity:!0},vt=["x","y","z"],xt=new y,St=new y(1,1,1),wt=new f,Mt=new x,bt=(new y).set(0,1,0),Bt=new v,Pt=new v,Et=u=>class extends(tt(u)){constructor(){super(...arguments),this.raycastLock=!1,this.scaleLock=!1,this.disposed=!1,this.stateSelection=null,this.destroyedInAction=!1,this.instances=[],this.prevState=null,this.currentState=null,this.currentAnimationAction=null,this.reversibleToState=null,this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new L,this._recursiveBBox=new L,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this._needApplyPathSnapping=!0,this.attachedPaths=new Set}get __isEntity(){return!0}entityChildren(t){let e=this.children[t];if(ut.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(ut.is(this.children[t]))return t+1;return 0}get isConcreteEntity(){return"string"==typeof this.identity}get isVirtualEntity(){return"string"!=typeof this.identity}get isInstanceRoot(){return this.isConcreteEntity&&"Instance"===this.data.type}nearestInstanceSelfOrParent(){let t=this;for(;"Instance"!==t.data.type;){let e=t.parent;if(!ut.is(e))return;t=e}return t}forInstancesRec(t){this.instances.forEach(e=>{e.disposed||t(e),e.forInstancesRec(t)})}super_Entity(t,e){"string"==typeof t&&(this.uuid=t),this.identity=t,this.data=e,this.matrixAutoUpdate=!1,this.dataPatched=this.data}changeSelectedState(t,e,i=!1){if(0!==this.data.states.length||i){for(let t of this.data.states)o.toOps(this.data,t.data).forEach(t=>{let i=p.replaceProps(t,this.data);this.dataPatched=this.data,this.updateByPatchedOp(i,this.data,e)});if(null!==t){let i=this.data.states.data(t);i&&(this.dataPatched=o.patch(this.data,i),o.toOps(this.data,i).forEach(t=>{this.updateByPatchedOp(t,this.dataPatched,e)}))}i&&this.updateTransformState(this.dataPatched,e),this.stateSelection=t,this.updatePathSnapping(this.dataPatched.pathSnapping)}}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}updateEntityBoxSize(t,e){t.setScalar(0),e.setScalar(0)}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{yt(t)&&t.resetBBoxNeedsUpdateSelf()}),this.traverseEntity(t=>{t.resetBBoxNeedsUpdateSelf()})}find(t){let e;return this.traverseEntity(i=>{i.uuid===t&&(e=i)}),e}traverseSortNextHelper(){let t=this.parent;if(t){let e=t.children,i=e.indexOf(this)+1;if(ut.is(e[i]))return e[i];if(ut.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&ut.is(this.children[0])?t[0]:this.traverseSortNextHelper()}goUp(t){let e=this;for(;t>0&&null!==e;)e=e.parent,t-=1;return e}hasAnccestorOrSelf(t){return this===t||this.hasAnccestor(t)}hasAnccestor(t){let e=this.parent;for(;e;){if(t===e)return!0;e=e.parent}return!1}countToAccestor(t){let e=0,i=this;for(;i!==t;){if(null===i)return-1;i=i.parent,e+=1}return e}forEachEntity(t){for(let e of this.children)yt(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{ut.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)yt(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)yt(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)yt(e)&&e.visible&&e.traverseVisibleEntity(t)}updateMatrix(){super.updateMatrix(),this.cloner&&this.cloner.onObjUpdateMatrix(),this.dispatchEvent({type:"updateMatrix"})}updateMatrixWorld(t){super.updateMatrixWorld(t),this.dispatchEvent({type:"updateMatrixWorld"})}copy(t,e=!1){return super.copy(t,e),this.dataPatched=t.dataPatched,this.raycastLock=t.raycastLock,this.scaleLock=t.scaleLock,this.hiddenMatrix.copy(t.hiddenMatrix),this}hasEntityChild(){return this.children.some(t=>yt(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(t=[]){this.updateWorldMatrix(!0,!1);let i={position:this.position.toArray(),rotation:[this.rotation.x*m.RAD2DEG,this.rotation.y*m.RAD2DEG,this.rotation.z*m.RAD2DEG],scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray(),pivot:[0,0,0],pivotRotation:[0,0,0]};return e(i,t)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,vt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(xt.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(m.DEG2RAD),this.rotation.setFromVector3(xt),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),void 0!==t.hiddenMatrix&&(i=!0,this.hiddenMatrix.fromArray(t.hiddenMatrix??a.identity)),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(xt.fromArray(t.pivot).negate(),wt.setFromEuler(Mt.fromArray(t.pivotRotation.map(t=>t*m.DEG2RAD))).invert(),St);else if(void 0!==t.pivot)this.pivotMatrix.setPosition(-t.pivot[0],-t.pivot[1],-t.pivot[2]);else if(void 0!==t.pivotRotation){let e=xt.setFromMatrixPosition(this.pivotMatrix);wt.setFromEuler(Mt.fromArray(t.pivotRotation.map(t=>t*m.DEG2RAD))).invert(),this.pivotMatrix.compose(e,wt,St)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&void 0!==t.hiddenMatrix&&this.updateWorldMatrix(!1,!0),i}onVariableUpdate(t=!1){t?this.resetBBoxNeedsUpdate():(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)}),this.requestRender())}dispose(){this.disposed=!0,this.cloner&&(this.cloner.dispose(),this.cloner=void 0)}disposeChildrenRecursively(){for(let t of this.children)ut.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{ut.is(t)&&t.disposeRecursively()})}toState(t=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(t)};return e(i,t)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,r){let a=this.data;this.data=e;let l=t,p=V(t.path,["states","*"]);if(null!==p){if(0===t.type){let[e]=p;if(this?.stateSelection===e){let e={...t.props};if(delete e.name,Object.values(t.props).some(t=>void 0===t)){let i=this.data;if(void 0!==i){let r=c.zoom(i,t.path.slice(2));if(r)for(let i in t.props)void 0===t.props[i]&&i in r&&(e[i]=r[i])}}l={...t,props:e,path:t.path.slice(2)}}}}else if(0===t.type){let e=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(void 0!==e){if(void 0!==t.props.name&&e.name){let{name:t,...i}=e;e=i}if(void 0!==t.props.material&&"material"in e){let{material:t,...i}=e;e=i}let i=c.removeOverridden(t.path,t.props,e);l={...t,props:i}}}if(this.updateByPatchedOpBase(l,o.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),V(t.path,["overrides"])){let r=[],a=[...t.path];for(r.push(a[1]),a.splice(0,2);a.length>0&&"descendants"===a[0];)r.push(a[1]),a.splice(0,2);if(void 0===r[r.length-1]){if(0===t.type)for(let e of Object.keys(t.props)){r[r.length-1]=e;let s=i.scene.findInstance([this.uuid,...r]);s&&(s.overrideData=t.props[e],s.updateState(h.apply(s.component.data,s.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...r]);if(n){let o=c.zoom(n.component.data,a);if(0===(t={...t,path:a}).type){let e=t.props;if(o)for(let[i,r]of Object.entries(t.props))void 0===r&&(e===t.props&&(e={...t.props}),e[i]=o[i]);t={...t,props:e}}n.overrideData=s.resolve(e.overrides,r),n.updateByOp(t,d.applySimple(n.data,t),i,!1)}}}else if(this.instances.length>0){let r;if(0===t.path.length&&0===t.type){let e;for(let i of n.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(r={...t,props:e})}else for(let e of n.rootOverrideProps)if(V(t.path,[e])){r=t;break}void 0!==r&&this.instances.forEach(t=>{if(t.isInstanceRoot){let e=h.filterOp(t.overrideData,r);e&&t.updateByOp(e,d.applySimple(t.data,e),i,!0)}}),this.instances.forEach(r=>{if(!r.isInstanceRoot){let s=h.filterOp(r.overrideData,t);if(s){let n;n=a===r.data&&t===s?e:d.applySimple(r.data,s),r.updateByOp(s,n,i,!0)}}})}}updateByPatchedOpBase(t,e,i){if(this.dataPatched=e,0===t.path.length&&0===t.type)void 0!==t.props.type&&!l.is(t.props.type)&&D.changeEntityProptotype(this,e,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){D.changeEntityProptotype(this,e,i);for(let t of this.children)ut.is(t)&&t.updateVisible(i.scene)}this.updateByPatchedOp(t,e,i)}updateByPatchedOp(t,e,i){if(0===t.path.length&&0===t.type?this.updateState(t.props,i):0===t.type&&("resolutionLevel"in t.props||"useChildrenColors"in t.props)&&this.updateState(e,i),"morphTargetInfluences"===t.path[0]&&0===t.type){let r=e.morphTargetInfluences.get(t.path[1])?.data.name;r&&this.updateMorphInfluences(r,i.shared.getVariable(t.props.value,[this.uuid,"morphTargetInfluences",r]))}if(null!==V(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==V(t.path,["cloner"])){let r=d.drop(t,1);0===r.path.length&&0===r.type&&!0===r.props.disabled?this.setFromClonerState(null,i):this.cloner?this.cloner.updateState(e.cloner,i):(this.setFromClonerState(e.cloner,i),this.expandCloner(i)),this.updateVisible(i.scene)}}updatePathSnapping(t=this.dataPatched.pathSnapping){this._updatedPathSnapping=t,this._needApplyPathSnapping=!0}get updatedPathSnapping(){return this._updatedPathSnapping}applyPathSnapping(t){if(!1===this._needApplyPathSnapping)return;let e=this._updatedPathSnapping?.pathId??this.dataPatched.pathSnapping.pathId,r=this._updatedPathSnapping?.slide??this.dataPatched.pathSnapping.slide??0,s=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,a=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let n=t.find(e);if(!n)return;this._needApplyPathSnapping=!1;let o=n.data;if(o.geometry.path.points.length<=1)return;let l=ft(o.geometry.path),h=(r+s)%1;r+s===1&&0===h&&(h=1);let p=null;try{p=l.curves.length?l.getPointAt(h):null}catch(t){i&&(console.warn(`The aligned path on ${this.name} is invalid. (${n.name})`),console.error(t))}if(null===p)return;n.updateMatrixWorld();let d=this.parent?Bt.copy(this.parent.matrixWorld).invert():Bt.identity();d.multiply(n.matrixWorld),p.applyMatrix4(d);let c={position:p.toArray(),rotation:o.rotation};if("tangential"===a){let t=Pt.extractRotation(n.matrixWorld),e=l.getTangentAt(h).applyMatrix4(t).add(p),i=Pt.lookAt(p,e,bt),r=xt.setFromEuler(Mt.setFromRotationMatrix(i)).multiplyScalar(m.RAD2DEG);c={...c,rotation:r.toArray()}}this.updateTransformState(c),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(gt)})}updateVisible(t){if(this.visible=this.dataPatched.visible&&(!this.dataPatched.cloner||(this.dataPatched.cloner.disabled??!1)||!0!==this.dataPatched.cloner?.hideBase),!t)return;let e=!1;this.traverseEntity(t=>{if("Splat"===t.data.type)return e=!0,!0}),e&&t.reloadSplats()}updateState_Entity(t,e){void 0!==t.name&&(this.name=t.name),void 0!==t.raycastLock&&(this.raycastLock=t.raycastLock),void 0!==t.visible&&(this.updateVisible(e?.scene),this.resetBBoxNeedsUpdate()),e&&"cloner"in t&&void 0!==t.cloner&&(this.setFromClonerState(t.cloner,e),this.updateVisible(e.scene)),this.updateTransformState(t,e)}get attachedSurfaceCloners(){return this.children.filter(e=>t(e)&&"toObject"===e.parameters.type)}setFromClonerState(t,e){if(!this.disposed)if(null===t||t.disabled)this.cloner&&this.cloner.dispose(),this.cloner=void 0;else if(void 0===this.cloner){if(null===D.Cloner)return void r("cloners","a cloner");this.cloner=new D.Cloner(this,t),e.scene.addPendingExpandCloner(this)}else this.cloner.updateState(t,e)}expandCloner(t){!this.disposed&&this.cloner&&this.cloner.expandClones(t)}invalidateClonerTransform(t){this.cloner&&this.cloner.invalidateTransform(t)}requestRender(){this.dispatchEvent({type:"requestRender"})}},At=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,e){let i=Object.assign({},e?.parameters??{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},t.parameters),r=Math.abs(i.width),s=Math.abs(i.height??r),a=Math.abs(i.depth??r),n=Math.abs(Math.min(r,a))/2;return{parameters:Object.assign(i,{width:r,height:s,depth:a,radius:n,segments:Math.round(i.segments),pathSegments:Math.round(i.pathSegments),cornerSegments:Math.round(i.cornerSegments)})}}static build(t){let{width:e,height:i,depth:r,radius:s,revolutions:a,segments:n,pathRadius:o,pathType:l,pathSegments:h,cornerRadius:p,cornerSegments:d}=t.parameters,c=new Wt(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},Ct=new u([0,0,0],1);function Dt(t){return"TorusGeometry"===t.type&&360===t.arc}var Ot,Vt,Wt=class extends E{constructor(t=!0,e=1,i=1,r=1,s=1,a=1,n=1,o=1,l=1,h=1,p=1,d=1){if(super(),0===a)return;let c=t&&1===a;c&&(d=0),p>100&&(p=100),0===p&&(d=0);let u,m,f,g,v,x,S,w,M=()=>new y,b=new y,P=M(),E=M(),A=M(),C=M(),D=M(),O=M(),V=M(),W=M(),_=M(),T=M(),U=M(),R=i-2*o+.001,z=R/a,I=Math.ceil(n*a),L=I+1,N=R/I,j=-R/2,F=h+1,k=2*Math.PI/h,q=Math.PI/2/d,G=Math.min((1-p/100)*o,o-.01),H=o-G,Z=0,X=2*d+2,$=F*X/2,K=$+F*L,Q=Math.max(0,F*(L+X)),[Y,J,tt]=[3,3,2].map(t=>Array(Q*t).fill(0)),et=[],it=s-o;function rt(e,i){let r=Math.PI/2;x=i*N,w=2*Math.PI*(x%z)/z+r,x+=j,S=Math.sin(w)*it,v=Math.cos(w)*it,t?e.set(v,S,x):e.set(v,x,S)}rt(b,-1e-10),rt(P,0),C.copy(b),rt(b,1);let st=b.distanceTo(P),at=c?0:H+G,nt=st*I+2*at,ot=G,lt=nt-at;for(let e=0;e<=I;e++){rt(E,e),U.subVectors(E,C).normalize(),C.copy(E),_.copy(E).setComponent(+t+1,0).normalize(),T.crossVectors(U,_).normalize();let i=0===e,r=e===I,s=i?3*Math.PI/2:q,a=i?ot:lt,n=i?F:K,l=i?0:Q-F,p=U.clone().multiplyScalar(i?-H:H).add(E),u=U.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<F;t++){let m=t*k;if(D.addVectors(b.copy(_).multiplyScalar(o*Math.cos(m)),P.copy(T).multiplyScalar(o*Math.sin(m))),O.copy(D).normalize(),i||r){c||(Z=l+t,[0,1,2].forEach(t=>{Y[3*Z+t]=p.getComponent(t),J[3*Z+t]=u.getComponent(t)}),tt[2*Z]=+r,tt[2*Z+1]=t/h),P.copy(O).multiplyScalar(G),A.addVectors(E,P);for(let e=0;e<d;e++){let r=e*q+s;V.addVectors(b.copy(U).multiplyScalar(H*Math.sin(r)),P.copy(O).multiplyScalar(H*Math.cos(r))),W.copy(V).normalize(),P.addVectors(A,V),V.normalize(),Z=n+e*F+t,[0,1,2].forEach(t=>{Y[3*Z+t]=P.getComponent(t),J[3*Z+t]=W.getComponent(t)});let o=+i+Math.sin(r);tt[2*Z]=(a+H*o)/nt,tt[2*Z+1]=t/h}}P.addVectors(E,D),Z=$+e*F+t,[0,1,2].forEach(t=>{Y[3*Z+t]=P.getComponent(t),J[3*Z+t]=O.getComponent(t)}),tt[2*Z]=(at+e*st)/nt,tt[2*Z+1]=t/h}}let ht=L+2*d+2,[pt,dt]=[+c,ht-1];for(let t=pt;t<=dt-1;t++){let e=c&&t===dt-1;for(let i=0;i<F-1;i++)u=t*F+i,m=u+1,f=(e?i:u)+F,g=(e?i+1:m)+F,0===t?et.push(m,g,f):t===ht-2?et.push(u,m,f):et.push(u,m,f,m,g,f)}this.setIndex(et),this.setAttribute("position",new B(Y,3)),this.setAttribute("normal",new B(J,3)),this.setAttribute("uv",new B(tt,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let t,e,i,r,s=this.userData.parameters,a=Math.ceil(s.tubularSegments),n=s.radialSegments,o=n+1,l=[];for(let s=1;s<a;s++)for(let a=0;a<n;a++)t=s*o+a,e=t+1,i=t+o,r=e+o,l.push(t,e,i,e,r,i);for(let s=0;s<n;s++)t=a*o+s,e=t+1,i=s+o,r=s+1+o,l.push(t,e,i,e,r,i);return Ct.array=new Uint32Array(l),Ct.count=l.length,Ct}},_t=new Map,Tt=0;function Ut(t){return Vt||(Vt=async function(){let e=t??(i?".":"https://cdn.spline.design/@splinetool/runtime@2.0.1/build"),r=import("./boolean.js"),[s,a]=await Promise.all([r,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await s.default({module_or_path:a}),Ot=s}())}function Rt(){if(void 0===Ot)throw new Error("boolean-wasm is not loaded");return Ot}function zt(t){let e=_t.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function It(t){return _t.set(++Tt,t),Tt}var Lt={0:0,1:1,2:2};function Nt(t,e,i){if(void 0===Ot)return-1;let{positions:r,indices:s,normals:a}=function(t,e){if(e&&void 0!==t.userData.positions){let e=t.userData,i=[];for(let t=0,r=0;t<e.verticesPerFace.length;t++){let s=e.verticesPerFace[t];for(let t=1;t<s-1;t++)i.push(e.indices[r],e.indices[r+t],e.indices[r+t+1]);r+=s}return{positions:e.positions instanceof Float32Array?e.positions:new Float32Array(e.positions),indices:new Uint32Array(i)}}let i;i=Dt(t.userData.parameters)?t.getClosedTorusIndicesForBooleanOrSubdiv():t.getIndex();let r,s=t.getAttribute("position");if(null===i){r=new Uint32Array(s.count);for(let t=0;t<r.length;t++)r[t]=t}else r=i.array instanceof Uint32Array?i.array:new Uint32Array(i.array);let a=t.getAttribute("normal"),n=void 0!==a&&3===a.itemSize&&a.count===s.count&&a.array instanceof Float32Array&&!0!==a.isInterleavedBufferAttribute?a.array:void 0;return{positions:s.array,indices:r,normals:n}}(t,e);return It(new Ot.CsgMesh(r,s,a))}function jt(t,e){let i=Rt(),r=Lt[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(zt);if(1===s.length)return i.clone_mesh(s[0]);let a,n=[];if(2===e&&s.length>2){let t=s[0];for(let e=1;e<s.length-1;e++)t=i.boolean_mesh(t,s[e],0),n.push(t);a=i.boolean_mesh(s[s.length-1],t,2)}else if(2===e)a=i.boolean_mesh(s[1],s[0],2);else{let t=s[s.length-1];for(let e=0;e<s.length-1&&(t=i.boolean_mesh(t,s[e],r),n.push(t),0!==t.tri_count());e++);a=t,n.pop()}for(let t of n)t.free();return a}function Ft(t,e,i,r){let s=Rt(),a=jt(t,e),n=s.mesh_render_data(a,Math.max(r,0));if(i.setAttribute("position",new B(n.positions(),3)),i.setAttribute("normal",new B(n.normals(),3)),n.free(),null===i.boundingSphere&&(i.boundingSphere=new P),0===a.tri_count())i.boundingSphere.center.set(0,0,0),i.boundingSphere.radius=0,i.userData.parameters={width:0,height:0,depth:0};else{let t=a.bounds();i.boundingSphere.center.set(t[0],t[1],t[2]),i.boundingSphere.radius=(t[3]**2+t[4]**2+t[5]**2)**.5,i.userData.parameters={width:2*t[3],height:2*t[4],depth:2*t[5]}}return It(a)}function kt(t,e){let i=Rt(),r=jt(t,e),s=i.mesh_topological_data(r),a=s.positions(),n=s.indices();return s.free(),r.free(),{positions:a,indices:n,verticesPerFace:new Uint8Array(n.length/3).fill(3)}}function qt(t,e){zt(t).transform(new Float32Array(e.elements))}function Gt(t){return null!==t&&"booleanOp"in t}var Ht=class extends(Et(C)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new v}updateVisible(t){super.updateVisible(t),this.visible=!Gt(this.parent)&&this.visible,Gt(this.parent)&&this.parent.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(function(t){let e=_t.get(t);void 0!==e&&(e.free(),_t.delete(t))}(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Gt(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof Ht&&(t.freeBooleanPointer(),Gt(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&Gt(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),Gt(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},Zt=new b;function Xt(t,e=0,i=t.count,r,s){let a=1/0,n=1/0,o=1/0,l=-1/0,h=-1/0,p=-1/0;for(let r=e;r<i;r++){let e=t.getX(r),i=t.getY(r),s=t.getZ(r);e<a&&(a=e),i<n&&(n=i),s<o&&(o=s),e>l&&(l=e),i>h&&(h=i),s>p&&(p=s)}Zt.min.set(a,n,o),Zt.max.set(l,h,p),Zt.getCenter(r),Zt.getSize(s).multiplyScalar(.5)}var $t=new E,Kt=new A,Qt=class extends Ht{constructor(t,e){super($t,Kt),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){super.raycast(t,e)}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Xt(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,e):super.updateEntityBoxSize(t,e)}};export{O as a,V as b,D as c,Q as d,Y as e,tt as f,ft as g,ut as h,yt as i,Et as j,At as k,Dt as l,Wt as m,Ut as n,Nt as o,Ft as p,kt as q,qt as r,Xt as s,Qt as t};
@@ -0,0 +1 @@
1
+ var t=new Map;function e(e,n){t.set(e,n)}function n(e){return t.get(e)}var s=class{constructor(t){this.eventContext=t,this.domEventsNeeded=new Set,this.hasVideoAction=!1}connect(){}disconnect(){}dispose(){this.disconnect(),this.eventContext=void 0}};export{s as a,e as b,n as c};
@@ -0,0 +1 @@
1
+ import{h as t,j as e,k as i}from"./runtime-chunk-YVNDW5TV.js";import{a as s}from"./runtime-chunk-R43XZP65.js";import{a}from"./runtime-chunk-HER7UVU3.js";import{e as n}from"./runtime-chunk-MM75L5X4.js";import{e as r}from"./runtime-chunk-QZ35BPGB.js";import{q as o}from"./runtime-chunk-OW6T4XFV.js";import{Bc as h}from"./runtime-chunk-VGN7YHB7.js";var d=class extends h{constructor(t,e,i,s,a){if(super(),this.eventType=t,this.data=e,this.page=i,this.shared=s,this.condition=a,this.toggleIsForward=!1,this.timelineNeedsRebuild=!1,this.hasPlayedOnce=!1,this.pauseOnNextLoopEnd=!1,this.onTimelineChangeComplete=()=>{if(this.pauseOnNextLoopEnd)return this.pauseOnNextLoopEnd=!1,void this.timeline?.pause();"normal"!==this.data.tweens[0].data.direction&&(this.toggleIsForward=!this.toggleIsForward),!1!==this.timelineNeedsRebuild&&(this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!1,isRebuild:!0}),this.timeline.play())},!e.object)throw new Error("Missing property");let n=this.page.scene.find(e.object)??this.page.uiCanvas?.find(e.object)??this.page.scene.find2DInUIObjects(e.object);if(!n)throw new Error("Missing property");if(!n.states)throw new Error("Missing property");if(this.object=n,e.tweens.length<2)throw new Error("Missing property");this.tweens=Array(this.data.tweens.length-1),this.startOnceDelay="start-once"===e.tweens[0].data.delayDirection?e.tweens[0].data.delay:0,this.init()}get playing(){return!1===this.timeline?.paused}get changeBegan(){return this.tweens.some(t=>t.changeBegan)??!1}init(){this.initialCurrentState=e(this.object,this.object.currentState).id,this.toggleIsForward=!1}get currentState(){return"Toggle"===this.data.runMode&&o(this.eventType)?this.initialCurrentState:this.object.currentState}buildTimeline({isForward:e=!0,needsRebuild:n=!1,isRebuild:r=!1}={}){try{let o=t(this.data.tweens[0].data);r&&"number"==typeof o.loop&&o.loop--,this.timeline?.pause(),this.timeline=s.timeline({autoplay:!1,...o,...!0===o.loop||o.loop>1?{timelineChangeComplete:this.onTimelineChangeComplete}:{}});let h=this.tweens.findIndex(t=>t?.changeBegan);if(!0===n&&(this.timelineNeedsRebuild=!0),e){let t=-1===h?0:h;for(let e=t;e<this.data.tweens.length-1;e++){let s,n=this.data.tweens[e],r=this.data.tweens[e+1];e!==t||!0!==this.object.wasMovedByUser&&!0!==this.object.previousAction?.changeBegan?s=void 0===n.data.state?this.currentState:n.data.state:(s=void 0,this.object instanceof a&&(this.object.wasMovedByUser=!1));let d=new i(this.object,s,void 0===r.data.state?this.currentState:r.data.state,r.data,this.shared,this.data.allowSlerp??!1,this.page);-1!==h&&e===t&&Object.assign(d.params,{startOnceDelay:0}),this.tweens[e]=d,this.timeline.add(d.params,this.timeline.duration+(e===t?o.delay:0))}this.timeline.duration+=o.endDelay}else{let t=-1===h?this.data.tweens.length-1:h+1;for(let e=t;e>0;e--){let s,n=this.data.tweens[e],r=this.data.tweens[e-1];e!==t||!0!==this.object.wasMovedByUser&&!0!==this.object.previousAction?.changeBegan?s=void 0===n.data.state?this.currentState:n.data.state:(s=void 0,this.object instanceof a&&(this.object.wasMovedByUser=!1));let d=new i(this.object,s,void 0===r.data.state?this.currentState:r.data.state,n.data,this.shared,this.data.allowSlerp??!1,this.page);-1!==h&&e===t&&Object.assign(d.params,{startOnceDelay:0}),this.tweens[e-1]=d,this.timeline.add(d.params,this.timeline.duration+(e===t?o.endDelay:0))}this.timeline.duration+=o.delay}}catch(t){t instanceof Error&&console.error(t.message)}!0===this.object.previousAction?.playing&&this.object.previousAction.pause(),this.object.previousAction=this}play(){if(!1===n(this.shared,this.condition)||o(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce||(this.hasPlayedOnce=!0,this.playing))return!1;this.startTimeout?.pause();let e=t(this.data.tweens[0].data).pingPongDelayCorrection;this.startTimeout=s({targets:{},duration:this.startOnceDelay+e,easing:"linear",complete:()=>{this.startTimeout=void 0;try{this.buildTimeline(),this.timeline.play()}catch(t){t instanceof Error&&console.error(t.message)}}})}pause(){this.timeline?.pause(),this.startTimeout?.pause(),this.tweens=Array(this.data.tweens.length-1),delete this.startTimeout}stop(){this.pause();let t=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;r(this.object)?this.object.changeSelectedState(t,{shared:this.shared}):this.object.changeSelectedState(t,{scene:this.page.scene,shared:this.shared}),this.object.currentState=t}seek(t){if(!1===n(this.shared,this.condition))return!1;void 0===this.timeline&&this.buildTimeline(),this.timeline?.seek(t*this.timeline.duration,!0)}toggle(t){if(!1===n(this.shared,this.condition))return!1;this.startTimeout?.pause(),this.toggleIsForward=t??!this.toggleIsForward,this.playing?(this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!0}),this.pauseOnNextLoopEnd=!0,this.timeline.play()):this.startTimeout=s({targets:{},duration:this.startOnceDelay,easing:"linear",complete:()=>{this.startTimeout=void 0,this.timeline?.pause(),this.buildTimeline({isForward:this.toggleIsForward}),this.timeline.play()}})}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}};export{d as a};