@splinetool/runtime 2.0.105 → 2.0.106

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 (311) hide show
  1. package/build/{runtime-bloom-PRPXZIUW.js → runtime-bloom-4JZ7HOTK.js} +1 -1
  2. package/build/runtime-bloom-4JZ7HOTK.js.br +0 -0
  3. package/build/runtime-bloom-4JZ7HOTK.js.gz +0 -0
  4. package/build/{runtime-brightnessContrast-KDB5RYJA.js → runtime-brightnessContrast-YW3RKS7M.js} +1 -1
  5. package/build/runtime-brightnessContrast-YW3RKS7M.js.br +0 -0
  6. package/build/runtime-brightnessContrast-YW3RKS7M.js.gz +0 -0
  7. package/build/{runtime-chromaticAberration-PZW4SDDS.js → runtime-chromaticAberration-AFGG7C77.js} +1 -1
  8. package/build/runtime-chromaticAberration-AFGG7C77.js.br +0 -0
  9. package/build/runtime-chromaticAberration-AFGG7C77.js.gz +0 -0
  10. package/build/{runtime-chunk-ZXAHJ75S.js → runtime-chunk-2T5DLKXC.js} +1 -1
  11. package/build/runtime-chunk-2T5DLKXC.js.br +0 -0
  12. package/build/runtime-chunk-2T5DLKXC.js.gz +0 -0
  13. package/build/{runtime-chunk-SPW5ZAC2.js → runtime-chunk-52UAJL6O.js} +1 -1
  14. package/build/{runtime-chunk-SPW5ZAC2.js.br → runtime-chunk-52UAJL6O.js.br} +0 -0
  15. package/build/runtime-chunk-52UAJL6O.js.gz +0 -0
  16. package/build/{runtime-chunk-IAUJFHKI.js → runtime-chunk-5LYLGPHY.js} +1 -1
  17. package/build/runtime-chunk-5LYLGPHY.js.br +0 -0
  18. package/build/runtime-chunk-5LYLGPHY.js.gz +0 -0
  19. package/build/{runtime-chunk-CPUOTSE4.js → runtime-chunk-5VS473SV.js} +1 -1
  20. package/build/runtime-chunk-5VS473SV.js.br +0 -0
  21. package/build/runtime-chunk-5VS473SV.js.gz +0 -0
  22. package/build/{runtime-chunk-P2SCYWSA.js → runtime-chunk-6EL6ZZJK.js} +1 -1
  23. package/build/runtime-chunk-6EL6ZZJK.js.br +0 -0
  24. package/build/runtime-chunk-6EL6ZZJK.js.gz +0 -0
  25. package/build/{runtime-chunk-MKF4O6NE.js → runtime-chunk-6JJKS7QG.js} +1 -1
  26. package/build/runtime-chunk-6JJKS7QG.js.br +0 -0
  27. package/build/runtime-chunk-6JJKS7QG.js.gz +0 -0
  28. package/build/{runtime-chunk-TRWD4WLH.js → runtime-chunk-7NQHVLP6.js} +1 -1
  29. package/build/runtime-chunk-7NQHVLP6.js.br +0 -0
  30. package/build/runtime-chunk-7NQHVLP6.js.gz +0 -0
  31. package/build/{runtime-chunk-OOOV6H7H.js → runtime-chunk-BZ4VO3MK.js} +1 -1
  32. package/build/{runtime-chunk-OOOV6H7H.js.br → runtime-chunk-BZ4VO3MK.js.br} +0 -0
  33. package/build/{runtime-chunk-OOOV6H7H.js.gz → runtime-chunk-BZ4VO3MK.js.gz} +0 -0
  34. package/build/{runtime-chunk-EXQOXWMA.js → runtime-chunk-FVUQHHQH.js} +1 -1
  35. package/build/runtime-chunk-FVUQHHQH.js.br +0 -0
  36. package/build/runtime-chunk-FVUQHHQH.js.gz +0 -0
  37. package/build/{runtime-chunk-FE6LJAWO.js → runtime-chunk-FYTLJRD3.js} +1 -1
  38. package/build/runtime-chunk-FYTLJRD3.js.br +0 -0
  39. package/build/runtime-chunk-FYTLJRD3.js.gz +0 -0
  40. package/build/{runtime-chunk-PYIDRIXX.js → runtime-chunk-IIUJPB2W.js} +1 -1
  41. package/build/runtime-chunk-IIUJPB2W.js.br +0 -0
  42. package/build/runtime-chunk-IIUJPB2W.js.gz +0 -0
  43. package/build/{runtime-chunk-OXRGQN3K.js → runtime-chunk-ILIED624.js} +1 -1
  44. package/build/runtime-chunk-ILIED624.js.br +0 -0
  45. package/build/runtime-chunk-ILIED624.js.gz +0 -0
  46. package/build/{runtime-chunk-3JDUKLJO.js → runtime-chunk-JGTITG6S.js} +1 -1
  47. package/build/runtime-chunk-JGTITG6S.js.br +0 -0
  48. package/build/runtime-chunk-JGTITG6S.js.gz +0 -0
  49. package/build/{runtime-chunk-6NCR62TU.js → runtime-chunk-KV42CU62.js} +1 -1
  50. package/build/runtime-chunk-KV42CU62.js.br +0 -0
  51. package/build/runtime-chunk-KV42CU62.js.gz +0 -0
  52. package/build/{runtime-chunk-OGKACVH6.js → runtime-chunk-L57YYJGQ.js} +1 -1
  53. package/build/runtime-chunk-L57YYJGQ.js.br +0 -0
  54. package/build/runtime-chunk-L57YYJGQ.js.gz +0 -0
  55. package/build/{runtime-chunk-7XPMJMA4.js → runtime-chunk-NJKTZTDX.js} +1 -1
  56. package/build/runtime-chunk-NJKTZTDX.js.br +0 -0
  57. package/build/runtime-chunk-NJKTZTDX.js.gz +0 -0
  58. package/build/{runtime-chunk-J5V6MXHA.js → runtime-chunk-NNQURPFM.js} +1 -1
  59. package/build/runtime-chunk-NNQURPFM.js.br +0 -0
  60. package/build/runtime-chunk-NNQURPFM.js.gz +0 -0
  61. package/build/{runtime-chunk-UVOO7ZT4.js → runtime-chunk-NOK7R6GP.js} +1 -1
  62. package/build/runtime-chunk-NOK7R6GP.js.br +0 -0
  63. package/build/{runtime-chunk-UVOO7ZT4.js.gz → runtime-chunk-NOK7R6GP.js.gz} +0 -0
  64. package/build/runtime-chunk-QKFDUMB2.js +1 -0
  65. package/build/runtime-chunk-QKFDUMB2.js.br +0 -0
  66. package/build/runtime-chunk-QKFDUMB2.js.gz +0 -0
  67. package/build/{runtime-chunk-SYERXJET.js → runtime-chunk-RVGJEWPE.js} +1 -1
  68. package/build/{runtime-chunk-SYERXJET.js.br → runtime-chunk-RVGJEWPE.js.br} +0 -0
  69. package/build/runtime-chunk-RVGJEWPE.js.gz +0 -0
  70. package/build/{runtime-chunk-MNNEA4BS.js → runtime-chunk-RZOAA43R.js} +1 -1
  71. package/build/{runtime-chunk-MNNEA4BS.js.br → runtime-chunk-RZOAA43R.js.br} +0 -0
  72. package/build/runtime-chunk-RZOAA43R.js.gz +0 -0
  73. package/build/{runtime-chunk-3SMB7GWC.js → runtime-chunk-WCIC2MX5.js} +1 -1
  74. package/build/runtime-chunk-WCIC2MX5.js.br +0 -0
  75. package/build/runtime-chunk-WCIC2MX5.js.gz +0 -0
  76. package/build/{runtime-chunk-4V5TXNXJ.js → runtime-chunk-WROLNIUK.js} +1 -1
  77. package/build/runtime-chunk-WROLNIUK.js.br +0 -0
  78. package/build/runtime-chunk-WROLNIUK.js.gz +0 -0
  79. package/build/{runtime-chunk-LCBCIXFO.js → runtime-chunk-XJYXLKBS.js} +1 -1
  80. package/build/runtime-chunk-XJYXLKBS.js.br +0 -0
  81. package/build/runtime-chunk-XJYXLKBS.js.gz +0 -0
  82. package/build/{runtime-chunk-SYMB7MAJ.js → runtime-chunk-XR6V2H6H.js} +1 -1
  83. package/build/runtime-chunk-XR6V2H6H.js.br +0 -0
  84. package/build/runtime-chunk-XR6V2H6H.js.gz +0 -0
  85. package/build/{runtime-chunk-HHD6T7VQ.js → runtime-chunk-YLJ4YXOT.js} +1 -1
  86. package/build/runtime-chunk-YLJ4YXOT.js.br +0 -0
  87. package/build/runtime-chunk-YLJ4YXOT.js.gz +0 -0
  88. package/build/{runtime-chunk-KL4ASGPT.js → runtime-chunk-YTSGUVIY.js} +1 -1
  89. package/build/runtime-chunk-YTSGUVIY.js.br +0 -0
  90. package/build/runtime-chunk-YTSGUVIY.js.gz +0 -0
  91. package/build/{runtime-classicRuntime-SLXBBQD6.js → runtime-classicRuntime-PPA5TZNP.js} +1 -1
  92. package/build/runtime-classicRuntime-PPA5TZNP.js.br +0 -0
  93. package/build/{runtime-classicRuntime-SLXBBQD6.js.gz → runtime-classicRuntime-PPA5TZNP.js.gz} +0 -0
  94. package/build/{runtime-cloners-GSRVTDMO.js → runtime-cloners-KETZQLM4.js} +1 -1
  95. package/build/runtime-cloners-KETZQLM4.js.br +0 -0
  96. package/build/runtime-cloners-KETZQLM4.js.gz +0 -0
  97. package/build/{runtime-components-Y56CTYTL.js → runtime-components-MHNY44SK.js} +1 -1
  98. package/build/runtime-components-MHNY44SK.js.br +0 -0
  99. package/build/runtime-components-MHNY44SK.js.gz +0 -0
  100. package/build/{runtime-createDestroy-SFX2RTKV.js → runtime-createDestroy-HXLMIXBG.js} +1 -1
  101. package/build/runtime-createDestroy-HXLMIXBG.js.br +0 -0
  102. package/build/runtime-createDestroy-HXLMIXBG.js.gz +0 -0
  103. package/build/{runtime-depthOfField-FSCU6657.js → runtime-depthOfField-B6PLOS2Q.js} +1 -1
  104. package/build/runtime-depthOfField-B6PLOS2Q.js.br +0 -0
  105. package/build/runtime-depthOfField-B6PLOS2Q.js.gz +0 -0
  106. package/build/{runtime-dragDrop-27SBMNBE.js → runtime-dragDrop-BSN24WCD.js} +1 -1
  107. package/build/runtime-dragDrop-BSN24WCD.js.br +0 -0
  108. package/build/runtime-dragDrop-BSN24WCD.js.gz +0 -0
  109. package/build/{runtime-gameControls-5YZGQGXP.js → runtime-gameControls-OSOVSUK3.js} +1 -1
  110. package/build/runtime-gameControls-OSOVSUK3.js.br +0 -0
  111. package/build/runtime-gameControls-OSOVSUK3.js.gz +0 -0
  112. package/build/{runtime-hair-ZIM6UNV4.js → runtime-hair-EDFQEP4D.js} +1 -1
  113. package/build/runtime-hair-EDFQEP4D.js.br +2 -0
  114. package/build/runtime-hair-EDFQEP4D.js.gz +0 -0
  115. package/build/{runtime-hueSaturation-XQ5EL5BG.js → runtime-hueSaturation-ZWWBRA2R.js} +1 -1
  116. package/build/runtime-hueSaturation-ZWWBRA2R.js.br +0 -0
  117. package/build/runtime-hueSaturation-ZWWBRA2R.js.gz +0 -0
  118. package/build/{runtime-mergeStaticGeometries-ZRBFU54U.js → runtime-mergeStaticGeometries-7LQL6WZB.js} +1 -1
  119. package/build/runtime-mergeStaticGeometries-7LQL6WZB.js.br +0 -0
  120. package/build/runtime-mergeStaticGeometries-7LQL6WZB.js.gz +0 -0
  121. package/build/{runtime-miscActions-XMK3TZBH.js → runtime-miscActions-CEYXAXDV.js} +1 -1
  122. package/build/runtime-miscActions-CEYXAXDV.js.br +0 -0
  123. package/build/runtime-miscActions-CEYXAXDV.js.gz +0 -0
  124. package/build/{runtime-mouseHover-AGKPVIUM.js → runtime-mouseHover-HORUNS6J.js} +1 -1
  125. package/build/runtime-mouseHover-HORUNS6J.js.br +0 -0
  126. package/build/runtime-mouseHover-HORUNS6J.js.gz +0 -0
  127. package/build/{runtime-noise-TDWTUDHY.js → runtime-noise-PE2P74UD.js} +1 -1
  128. package/build/runtime-noise-PE2P74UD.js.br +0 -0
  129. package/build/runtime-noise-PE2P74UD.js.gz +0 -0
  130. package/build/{runtime-particles-ZRFSOSEG.js → runtime-particles-GB4DYI4K.js} +1 -1
  131. package/build/runtime-particles-GB4DYI4K.js.br +0 -0
  132. package/build/runtime-particles-GB4DYI4K.js.gz +0 -0
  133. package/build/{runtime-paths-6RNGGV7E.js → runtime-paths-JTMNBPTJ.js} +1 -1
  134. package/build/runtime-paths-JTMNBPTJ.js.br +0 -0
  135. package/build/runtime-paths-JTMNBPTJ.js.gz +0 -0
  136. package/build/{runtime-pixelation-5KEV5HW3.js → runtime-pixelation-4QRDKQKA.js} +1 -1
  137. package/build/runtime-pixelation-4QRDKQKA.js.br +0 -0
  138. package/build/runtime-pixelation-4QRDKQKA.js.gz +0 -0
  139. package/build/{runtime-resize-MY642YD3.js → runtime-resize-QBSVXM7M.js} +1 -1
  140. package/build/runtime-resize-QBSVXM7M.js.br +0 -0
  141. package/build/runtime-resize-QBSVXM7M.js.gz +0 -0
  142. package/build/{runtime-sceneTransition-NX27VMTV.js → runtime-sceneTransition-MRAFDCQ2.js} +1 -1
  143. package/build/runtime-sceneTransition-MRAFDCQ2.js.br +0 -0
  144. package/build/runtime-sceneTransition-MRAFDCQ2.js.gz +0 -0
  145. package/build/{runtime-scroll-TYLUXBDA.js → runtime-scroll-HEDDT762.js} +1 -1
  146. package/build/runtime-scroll-HEDDT762.js.br +0 -0
  147. package/build/runtime-scroll-HEDDT762.js.gz +0 -0
  148. package/build/runtime-shapeBlends-2BCFXDHR.js +1 -0
  149. package/build/runtime-shapeBlends-2BCFXDHR.js.br +2 -0
  150. package/build/runtime-shapeBlends-2BCFXDHR.js.gz +0 -0
  151. package/build/{runtime-text-S7OY5BUY.js → runtime-text-T54MADRT.js} +1 -1
  152. package/build/runtime-text-T54MADRT.js.br +0 -0
  153. package/build/runtime-text-T54MADRT.js.gz +0 -0
  154. package/build/{runtime-textInputs-LWQLRFYB.js → runtime-textInputs-XKBBNUFQ.js} +1 -1
  155. package/build/runtime-textInputs-XKBBNUFQ.js.br +0 -0
  156. package/build/runtime-textInputs-XKBBNUFQ.js.gz +0 -0
  157. package/build/{runtime-timeline-ILU3EFT3.js → runtime-timeline-7PCZWFUZ.js} +1 -1
  158. package/build/runtime-timeline-7PCZWFUZ.js.br +0 -0
  159. package/build/runtime-timeline-7PCZWFUZ.js.gz +0 -0
  160. package/build/{runtime-tracking-A5IUWTDB.js → runtime-tracking-JT4EEV5L.js} +1 -1
  161. package/build/runtime-tracking-JT4EEV5L.js.br +0 -0
  162. package/build/runtime-tracking-JT4EEV5L.js.gz +0 -0
  163. package/build/{runtime-transitions-3AZHFSE7.js → runtime-transitions-NGVJ6WRW.js} +1 -1
  164. package/build/runtime-transitions-NGVJ6WRW.js.br +0 -0
  165. package/build/runtime-transitions-NGVJ6WRW.js.gz +0 -0
  166. package/build/{runtime-ui2d-STGPA3ZZ.js → runtime-ui2d-WUCMENWX.js} +1 -1
  167. package/build/runtime-ui2d-WUCMENWX.js.br +0 -0
  168. package/build/runtime-ui2d-WUCMENWX.js.gz +0 -0
  169. package/build/{runtime-vectorShapes-XAORLE2Z.js → runtime-vectorShapes-R324J5CP.js} +1 -1
  170. package/build/runtime-vectorShapes-R324J5CP.js.br +0 -0
  171. package/build/runtime-vectorShapes-R324J5CP.js.gz +0 -0
  172. package/build/{runtime-vignette-64Z4S2UX.js → runtime-vignette-C32LL7QR.js} +1 -1
  173. package/build/runtime-vignette-C32LL7QR.js.br +0 -0
  174. package/build/runtime-vignette-C32LL7QR.js.gz +0 -0
  175. package/build/runtime-webgpu-XT2AJYZY.js +1 -0
  176. package/build/runtime-webgpu-XT2AJYZY.js.br +0 -0
  177. package/build/runtime-webgpu-XT2AJYZY.js.gz +0 -0
  178. package/build/runtime.cjs +7 -7
  179. package/build/runtime.js +1 -1
  180. package/build/runtime.js.br +0 -0
  181. package/build/runtime.js.gz +0 -0
  182. package/build/runtime.standalone.js +1 -1
  183. package/build/runtime.standalone.js.br +0 -0
  184. package/build/runtime.standalone.js.gz +0 -0
  185. package/build/runtime.standalone.webgl.js +1 -1
  186. package/build/runtime.standalone.webgl.js.br +0 -0
  187. package/build/runtime.standalone.webgl.js.gz +0 -0
  188. package/build/runtime.standalone.webgpu.js +1 -1
  189. package/build/runtime.standalone.webgpu.js.br +0 -0
  190. package/build/runtime.standalone.webgpu.js.gz +0 -0
  191. package/build/runtime.standalone.webgpu.micro.js +1 -1
  192. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  193. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  194. package/build/runtime.standalone.webgpu.min.js +1 -1
  195. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  196. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  197. package/package.json +1 -1
  198. package/build/runtime-bloom-PRPXZIUW.js.br +0 -0
  199. package/build/runtime-bloom-PRPXZIUW.js.gz +0 -0
  200. package/build/runtime-brightnessContrast-KDB5RYJA.js.br +0 -0
  201. package/build/runtime-brightnessContrast-KDB5RYJA.js.gz +0 -0
  202. package/build/runtime-chromaticAberration-PZW4SDDS.js.br +0 -0
  203. package/build/runtime-chromaticAberration-PZW4SDDS.js.gz +0 -0
  204. package/build/runtime-chunk-3JDUKLJO.js.br +0 -1
  205. package/build/runtime-chunk-3JDUKLJO.js.gz +0 -0
  206. package/build/runtime-chunk-3SMB7GWC.js.br +0 -0
  207. package/build/runtime-chunk-3SMB7GWC.js.gz +0 -0
  208. package/build/runtime-chunk-4V5TXNXJ.js.br +0 -0
  209. package/build/runtime-chunk-4V5TXNXJ.js.gz +0 -0
  210. package/build/runtime-chunk-6NCR62TU.js.br +0 -0
  211. package/build/runtime-chunk-6NCR62TU.js.gz +0 -0
  212. package/build/runtime-chunk-7XPMJMA4.js.br +0 -0
  213. package/build/runtime-chunk-7XPMJMA4.js.gz +0 -0
  214. package/build/runtime-chunk-ACYKJPOE.js +0 -1
  215. package/build/runtime-chunk-ACYKJPOE.js.br +0 -0
  216. package/build/runtime-chunk-ACYKJPOE.js.gz +0 -0
  217. package/build/runtime-chunk-CPUOTSE4.js.br +0 -0
  218. package/build/runtime-chunk-CPUOTSE4.js.gz +0 -0
  219. package/build/runtime-chunk-EXQOXWMA.js.br +0 -0
  220. package/build/runtime-chunk-EXQOXWMA.js.gz +0 -0
  221. package/build/runtime-chunk-FE6LJAWO.js.br +0 -0
  222. package/build/runtime-chunk-FE6LJAWO.js.gz +0 -0
  223. package/build/runtime-chunk-HHD6T7VQ.js.br +0 -0
  224. package/build/runtime-chunk-HHD6T7VQ.js.gz +0 -0
  225. package/build/runtime-chunk-IAUJFHKI.js.br +0 -0
  226. package/build/runtime-chunk-IAUJFHKI.js.gz +0 -0
  227. package/build/runtime-chunk-J5V6MXHA.js.br +0 -0
  228. package/build/runtime-chunk-J5V6MXHA.js.gz +0 -0
  229. package/build/runtime-chunk-KL4ASGPT.js.br +0 -0
  230. package/build/runtime-chunk-KL4ASGPT.js.gz +0 -0
  231. package/build/runtime-chunk-LCBCIXFO.js.br +0 -0
  232. package/build/runtime-chunk-LCBCIXFO.js.gz +0 -0
  233. package/build/runtime-chunk-MKF4O6NE.js.br +0 -0
  234. package/build/runtime-chunk-MKF4O6NE.js.gz +0 -0
  235. package/build/runtime-chunk-MNNEA4BS.js.gz +0 -0
  236. package/build/runtime-chunk-OGKACVH6.js.br +0 -0
  237. package/build/runtime-chunk-OGKACVH6.js.gz +0 -0
  238. package/build/runtime-chunk-OXRGQN3K.js.br +0 -0
  239. package/build/runtime-chunk-OXRGQN3K.js.gz +0 -0
  240. package/build/runtime-chunk-P2SCYWSA.js.br +0 -0
  241. package/build/runtime-chunk-P2SCYWSA.js.gz +0 -0
  242. package/build/runtime-chunk-PYIDRIXX.js.br +0 -0
  243. package/build/runtime-chunk-PYIDRIXX.js.gz +0 -0
  244. package/build/runtime-chunk-SPW5ZAC2.js.gz +0 -0
  245. package/build/runtime-chunk-SYERXJET.js.gz +0 -0
  246. package/build/runtime-chunk-SYMB7MAJ.js.br +0 -0
  247. package/build/runtime-chunk-SYMB7MAJ.js.gz +0 -0
  248. package/build/runtime-chunk-TRWD4WLH.js.br +0 -0
  249. package/build/runtime-chunk-TRWD4WLH.js.gz +0 -0
  250. package/build/runtime-chunk-UVOO7ZT4.js.br +0 -0
  251. package/build/runtime-chunk-ZXAHJ75S.js.br +0 -0
  252. package/build/runtime-chunk-ZXAHJ75S.js.gz +0 -0
  253. package/build/runtime-classicRuntime-SLXBBQD6.js.br +0 -0
  254. package/build/runtime-cloners-GSRVTDMO.js.br +0 -0
  255. package/build/runtime-cloners-GSRVTDMO.js.gz +0 -0
  256. package/build/runtime-components-Y56CTYTL.js.br +0 -0
  257. package/build/runtime-components-Y56CTYTL.js.gz +0 -0
  258. package/build/runtime-createDestroy-SFX2RTKV.js.br +0 -0
  259. package/build/runtime-createDestroy-SFX2RTKV.js.gz +0 -0
  260. package/build/runtime-depthOfField-FSCU6657.js.br +0 -0
  261. package/build/runtime-depthOfField-FSCU6657.js.gz +0 -0
  262. package/build/runtime-dragDrop-27SBMNBE.js.br +0 -0
  263. package/build/runtime-dragDrop-27SBMNBE.js.gz +0 -0
  264. package/build/runtime-gameControls-5YZGQGXP.js.br +0 -0
  265. package/build/runtime-gameControls-5YZGQGXP.js.gz +0 -0
  266. package/build/runtime-hair-ZIM6UNV4.js.br +0 -2
  267. package/build/runtime-hair-ZIM6UNV4.js.gz +0 -0
  268. package/build/runtime-hueSaturation-XQ5EL5BG.js.br +0 -0
  269. package/build/runtime-hueSaturation-XQ5EL5BG.js.gz +0 -0
  270. package/build/runtime-mergeStaticGeometries-ZRBFU54U.js.br +0 -0
  271. package/build/runtime-mergeStaticGeometries-ZRBFU54U.js.gz +0 -0
  272. package/build/runtime-miscActions-XMK3TZBH.js.br +0 -0
  273. package/build/runtime-miscActions-XMK3TZBH.js.gz +0 -0
  274. package/build/runtime-mouseHover-AGKPVIUM.js.br +0 -0
  275. package/build/runtime-mouseHover-AGKPVIUM.js.gz +0 -0
  276. package/build/runtime-noise-TDWTUDHY.js.br +0 -0
  277. package/build/runtime-noise-TDWTUDHY.js.gz +0 -0
  278. package/build/runtime-particles-ZRFSOSEG.js.br +0 -0
  279. package/build/runtime-particles-ZRFSOSEG.js.gz +0 -0
  280. package/build/runtime-paths-6RNGGV7E.js.br +0 -0
  281. package/build/runtime-paths-6RNGGV7E.js.gz +0 -0
  282. package/build/runtime-pixelation-5KEV5HW3.js.br +0 -0
  283. package/build/runtime-pixelation-5KEV5HW3.js.gz +0 -0
  284. package/build/runtime-resize-MY642YD3.js.br +0 -0
  285. package/build/runtime-resize-MY642YD3.js.gz +0 -0
  286. package/build/runtime-sceneTransition-NX27VMTV.js.br +0 -0
  287. package/build/runtime-sceneTransition-NX27VMTV.js.gz +0 -0
  288. package/build/runtime-scroll-TYLUXBDA.js.br +0 -0
  289. package/build/runtime-scroll-TYLUXBDA.js.gz +0 -0
  290. package/build/runtime-shapeBlends-KK5ZO6TU.js +0 -1
  291. package/build/runtime-shapeBlends-KK5ZO6TU.js.br +0 -3
  292. package/build/runtime-shapeBlends-KK5ZO6TU.js.gz +0 -0
  293. package/build/runtime-text-S7OY5BUY.js.br +0 -0
  294. package/build/runtime-text-S7OY5BUY.js.gz +0 -0
  295. package/build/runtime-textInputs-LWQLRFYB.js.br +0 -0
  296. package/build/runtime-textInputs-LWQLRFYB.js.gz +0 -0
  297. package/build/runtime-timeline-ILU3EFT3.js.br +0 -0
  298. package/build/runtime-timeline-ILU3EFT3.js.gz +0 -0
  299. package/build/runtime-tracking-A5IUWTDB.js.br +0 -0
  300. package/build/runtime-tracking-A5IUWTDB.js.gz +0 -0
  301. package/build/runtime-transitions-3AZHFSE7.js.br +0 -0
  302. package/build/runtime-transitions-3AZHFSE7.js.gz +0 -0
  303. package/build/runtime-ui2d-STGPA3ZZ.js.br +0 -0
  304. package/build/runtime-ui2d-STGPA3ZZ.js.gz +0 -0
  305. package/build/runtime-vectorShapes-XAORLE2Z.js.br +0 -0
  306. package/build/runtime-vectorShapes-XAORLE2Z.js.gz +0 -0
  307. package/build/runtime-vignette-64Z4S2UX.js.br +0 -0
  308. package/build/runtime-vignette-64Z4S2UX.js.gz +0 -0
  309. package/build/runtime-webgpu-SJAKZ2XK.js +0 -1
  310. package/build/runtime-webgpu-SJAKZ2XK.js.br +0 -0
  311. package/build/runtime-webgpu-SJAKZ2XK.js.gz +0 -0
@@ -1 +1 @@
1
- import{v as e}from"./runtime-chunk-OOOV6H7H.js";import{$c as t,Gc as s,Hc as a,Hd as i,Ib as r,Ic as n,Ie as h,Qc as o,Vc as l,Yd as d,Zd as c,md as u,nd as g}from"./runtime-chunk-KPOUV3HD.js";var p=null;function b(e){p=e}function S(){return p}var m=null;function f(e){m=e}function M(){return m}var y=new l;function R(e,t,s){return y.setRGB(e,t,s,r),{r:y.r,g:y.g,b:y.b}}var w=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t,x=e=>Array.isArray(e)&&"number"==typeof e[0]&&"number"==typeof e[1]?[e[0],e[1]]:[0,0];function v(e,t,s){let a,i=w(e.angle,0),[r,n]=x(e.offset),[h,o]=x(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*(s+o)-(s+n)-1;a=Math.hypot(e,l)+i}else if(2===e.gradientType){let e=-1*Math.atan2(t+h-.5+r,s+o-.5+n),l=i/Math.PI/-2+.5*e/Math.PI;a=l-Math.floor(l)}else{let e=.5+h/(0!==t?t:1e-6),l=o/(0!==s?s: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;a=u>1e-12?(((t-.5+r)/2+d/2)*d+((s-.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 s=d[t-1],i=d[t]-s,r=0!==i?Math.min(1,Math.max(0,(a-s)/i)):a>=s?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 s=e,a=s?.data?.layers;if(a&&"function"==typeof a.forEach){let e=t,s=[];return a.forEach(t=>{let a=t.data;if(!1===a.visible||!0===a.isMask)return;let i=w(a.alpha,1);if(!(i<=0))if("color"===a.type){let t,r=a.color;"string"==typeof r?t="function"==typeof e?.color?e.color(r):void 0:r&&"number"==typeof r.r&&(t=r),t&&s.push({kind:"color",layer:a,rgb:{...R(t.r,t.g,t.b),a:t.a??1},alpha:i})}else"gradient"===a.type&&s.push({kind:"gradient",layer:a,alpha:i})}),0===s.length?null:(e,t)=>{let a=1,i=1,r=1,n=!0;for(let h of s){let s,o,l,d;if("color"===h.kind)({r:s,g:o,b:l}=h.rgb),d=h.rgb.a;else{let[a,i,r,n]=v(h.layer,e,t);({r:s,g:o,b:l}=R(a,i,r)),d=n}let c=n?1:Math.min(1,Math.max(0,d*h.alpha));a+=(s-a)*c,i+=(o-i)*c,r+=(l-r)*c,n=!1}return{r:a,g:i,b:r}}}if(s?.color&&!0===s.color.isColor){let{r:e,g:t,b:a}=s.color;return()=>({r:e,g:t,b:a})}return null}var j=32,I=16384,H=32*I,B=100;function F(e,t){if("torus"===e){let e=t()*Math.PI*2,s=t()*Math.PI*2,a=Math.cos(e),i=Math.sin(e),r=Math.cos(s),n=Math.sin(s);return{x:(1.4+.7*r)*a,y:-(1.4+.7*r)*i,z:.7*n,nx:r*a,ny:-r*i,nz:n,cr:1,cg:1,cb:1}}if("cylinder"===e){let e=t()*Math.PI*2,s=Math.cos(e),a=Math.sin(e);return{x:.8*s,y:1.6*(t()-.5),z:.8*a,nx:s,ny:0,nz:a,cr:1,cg:1,cb:1}}let s=t()*Math.PI*2,a=2*t()-1,i=Math.acos(a),r=Math.sin(i)*Math.cos(s),n=Math.cos(i),h=Math.sin(i)*Math.sin(s);return{x:r,y:n,z:h,nx:r,ny:n,nz:h,cr:1,cg:1,cb:1}}function W(e){let{geometry:t,matrix:s}=e,a=t.getAttribute("position");if(!a||a.count<3)return null;let i=t.getAttribute("normal"),r=t.getAttribute("uv"),h=t.getAttribute("color"),o=t.getIndex(),l=o?o.count/3:a.count/3;if(l<1)return null;let d=(e,t)=>o?o.getX(3*e+t):3*e+t,c=s?s.elements:null,u=s?(new n).getNormalMatrix(s).elements:null,g=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[0]*t+c[4]*s+c[8]*i+c[12]:t},p=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[1]*t+c[5]*s+c[9]*i+c[13]:s},b=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[2]*t+c[6]*s+c[10]*i+c[14]:i},S=new Float64Array(l),m=0;for(let e=0;e<l;e++){let t=d(e,0),s=d(e,1),a=d(e,2),i=g(t),r=p(t),n=b(t),h=g(s)-i,o=p(s)-r,l=b(s)-n,c=g(a)-i,u=p(a)-r,f=b(a)-n,M=o*f-l*u,y=l*c-h*f,R=h*u-o*c;m+=.5*Math.sqrt(M*M+y*y+R*R),S[e]=m}return m<=0?null:{total:m,sample:(t,s)=>{let a=0,n=l-1;for(;a<n;){let e=a+n>>1;S[e]<t?a=e+1:n=e}let o=a,c=d(o,0),m=d(o,1),f=d(o,2),M=s(),y=s();M+y>1&&(M=1-M,y=1-y);let R,w,x,v=1-M-y,A=g(c)*v+g(m)*M+g(f)*y,j=p(c)*v+p(m)*M+p(f)*y,I=b(c)*v+b(m)*M+b(f)*y;if(i){if(R=i.getX(c)*v+i.getX(m)*M+i.getX(f)*y,w=i.getY(c)*v+i.getY(m)*M+i.getY(f)*y,x=i.getZ(c)*v+i.getZ(m)*M+i.getZ(f)*y,u){let e=u[0]*R+u[3]*w+u[6]*x,t=u[1]*R+u[4]*w+u[7]*x,s=u[2]*R+u[5]*w+u[8]*x;R=e,w=t,x=s}}else{let e=g(c),t=p(c),s=b(c),a=g(m)-e,i=p(m)-t,r=b(m)-s,n=g(f)-e,h=p(f)-t,o=b(f)-s;R=i*o-r*h,w=r*n-a*o,x=a*h-i*n}let H=Math.sqrt(R*R+w*w+x*x)||1,B=1,F=1,W=1;if(h)B=h.getX(c)*v+h.getX(m)*M+h.getX(f)*y,F=h.getY(c)*v+h.getY(m)*M+h.getY(f)*y,W=h.getZ(c)*v+h.getZ(m)*M+h.getZ(f)*y;else if(e.sampleColor){let t=r?r.getX(c)*v+r.getX(m)*M+r.getX(f)*y:.5,s=r?r.getY(c)*v+r.getY(m)*M+r.getY(f)*y:.5,a=e.sampleColor(t,s);a&&(B=a.r,F=a.g,W=a.b)}return{x:A,y:j,z:I,nx:R/H,ny:w/H,nz:x/H,cr:B,cg:F,cb:W}}}}function k(e){let t=Math.min(Math.max(1,Math.floor(e.guideStrands)),I),s=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),a="object"===e.shape&&e.sampler,i=a?e.samplerRadius??B:B,r=new Float32Array(4*H),n=new Float32Array(H),h=new Float32Array(4*I).fill(1);for(let o=0;o<t;o++){let t=a?e.sampler(s):F(e.shape,s),l=a?t.x:t.x*i,d=a?t.y:t.y*i,c=a?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,S,m,f=32*o,M=(1.8+.8*s())*e.hairLength*i/31,y=.5+1.5*s(),R=(.02+.06*s())*i;Math.abs(g)<.99?(b=-p,S=0,m=u):(b=1,S=0,m=0);let w=Math.sqrt(b*b+S*S+m*m)||1;for(let e=0;e<32;e++){let t=e/31,s=t*t*.4*i,a=R*Math.sin(t*y*Math.PI*2),h=4*(f+e);r[h+0]=l+u*M*e+a*b/w,r[h+1]=d+g*M*e-s+a*S/w,r[h+2]=c+p*M*e+a*m/w,r[h+3]=0===e?0:1,e<31&&(n[f+e]=M)}}return{initialPositions:r,restLengths:n,unitScale:i,rootColors:h}}var O=1/60,C=4,P=new o,L=new s,z=new a,q=new a,X=class extends e{constructor(e,i,r){super(e,i),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.settledSimSeconds=0,this.lastMotionFingerprint=0,this.lastBoneQuat=new s,this.lastBonePos=new a,this.hasLastBone=!1,this.baseFoundAtRegen=!1,this.baseSourceGeomsAtRegen=[],this.baseSourceHashesAtRegen=[],this.baseColorHashAtRegen=0,this.baseScaleAtRegen=0,this.classicFallbackWarned=!1,this.regenSnapshot=null,this.context=r,this.data=i,this.geometry.setAttribute("position",new t(new Float32Array(0),3)),this.material=new u({colorWrite:!1,depthWrite:!1}),this.frustumCulled=!1,this.scalpMesh=new g(new d(B,48,32),new u({color:5448477})),this.scalpMesh.name="HairScalp",this.add(this.scalpMesh);let n=new h;n.setAttribute("position",new t(new Float32Array(12),3)),n.setIndex([0,2,1,2,3,1]),n.instanceCount=0,this.ribbonMesh=new g(n,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=i.guideStrands,this.roots=this.buildRoots(),this.regenSnapshot={guideStrands:i.guideStrands,hairLength:i.hairLength,spreadRadius:i.spreadRadius,headShape:i.headShape,baseObjectId:i.baseObjectId},this.applyScalpState(),this.applyShadowState(),this.syncSimRunning()}update(e){!this.simRunning||(this.pendingSimSeconds=Math.min(this.pendingSimSeconds+e/1e3,4*O*2),this.trackMotionRest(e/1e3))}trackMotionRest(e){this.boneTransform(L,z);let t=this.hasLastBone&&(Math.abs(this.lastBoneQuat.dot(L))<.9999995||this.lastBonePos.distanceToSquared(z)>1e-8),s=this.motionFingerprint(),a=!this.hasLastBone||t||this.resetRequested||s!==this.lastMotionFingerprint||this.data.windStrength>.001;this.lastBoneQuat.copy(L),this.lastBonePos.copy(z),this.lastMotionFingerprint=s,this.hasLastBone=!0,this.settledSimSeconds=a?0:this.settledSimSeconds+e}motionFingerprint(){let e=this.data;return e.gravity+2*e.damping+3*e.localStiffness+4*e.globalStiffness+5*e.globalRange+6*e.stiffnessFalloff+7*e.windStrength+8*e.vspCoefficient+9*e.kink+10*e.kinkFrequency+11*e.clumpStrength+12*e.clumpSize+13*e.clumpTipScale}get isSimulating(){return(this.simRunning||this.resetRequested)&&this.visible}get isMotionSettled(){return this.settledSimSeconds>6}get isVisiblyAnimating(){return this.isSimulating&&!this.isMotionSettled}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,this.settledSimSeconds=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,r)}(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.castShadow=e,this.receiveShadow=t,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 s=null===t||t.headShape!==e.headShape||t.baseObjectId!==e.baseObjectId;this.regenerate(),s&&this.applyScalpState()}this.syncSimRunning(),this.applyShadowState(),this.checkBaseDrift()}buildRoots(){let{headShape:e,baseObjectId:t,guideStrands:s,hairLength:a}=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 s of e){let e=W(s);e&&t.push(e)}if(0===t.length)return null;let s=new Float64Array(t.length),a=0;for(let e=0;e<t.length;e++)a+=t[e].total,s[e]=a;return a<=0?null:e=>{let i=e()*a,r=0,n=t.length-1;for(;r<n;){let e=r+n>>1;s[e]<i?r=e+1:n=e}let h=0===r?i:i-s[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 k({shape:"object",guideStrands:s,hairLength:a,sampler:e=>{let t=i(e);return{...t,x:t.x*h,y:t.y*h,z:t.z*h}},samplerRadius:n})}}}return k({shape:"object"===e?"sphere":e,guideStrands:s,hairLength:a})}collectBaseSources(e){let t=[],s=[],a=0,i=0;P.copy(e.matrixWorld).invert();let r=P.clone(),n=h=>{if(!0===h.isHairSystem||h!==e&&!1===h.visible)return;let l=h.geometry;if(!0===h.isMesh&&l&&(l.getAttribute("position")?.count??0)>=3){let n=h===e?void 0:(new o).multiplyMatrices(r,h.matrixWorld),d=Array.isArray(h.material)?h.material[0]:h.material;t.push({geometry:l,matrix:n,sampleColor:A(d,this.context.shared)??void 0}),s.push(X.matrixHash(n)),i+=function(e,t){let s=e,a=0,i=1,r=e=>{a+=e*i,i+=1},n=s?.data?.layers;if(n&&"function"==typeof n.forEach){let e=t;n.forEach(t=>{let s=t.data;if(!1!==s.visible)if("color"===s.type){let t=s.color,a="string"==typeof t?"function"==typeof e?.color?e.color(t):void 0:t;a&&"number"==typeof a.r&&(r(a.r),r(a.g),r(a.b)),r(w(s.alpha,1))}else if("gradient"===s.type){let e=s;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(w(e.angle,0)),r(e.gradientType),r(e.smooth?1:0)}})}else s?.color&&!0===s.color.isColor&&(r(s.color.r),r(s.color.g),r(s.color.b));return a}(d,this.context.shared),null===l.boundingSphere&&l.computeBoundingSphere();let c=l.boundingSphere;if(c){let e=0,t=1;n?(z.copy(c.center).applyMatrix4(n),e=z.length(),t=X.matrixMaxScale(n)):e=c.center.length(),a=Math.max(a,e+c.radius*t)}}for(let e of h.children)n(e)};return n(e),0===t.length?null:{sources:t,hashes:s,radius:Math.max(a,.001),colorHash:i}}static matrixHash(e){if(!e)return 0;let t=e.elements,s=0;for(let e=0;e<16;e++)s+=t[e]*(e+1);return s}static matrixMaxScale(e){let t=e.elements,s=Math.hypot(t[0],t[1],t[2]),a=Math.hypot(t[4],t[5],t[6]),i=Math.hypot(t[8],t[9],t[10]);return Math.max(s,a,i,1e-6)}baseWorldScale(e){return P.copy(e.matrixWorld).decompose(z,L,q),Math.max(Math.abs(q.x),Math.abs(q.y),Math.abs(q.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),s=t?.sources??[],a=t?.hashes??[],i=this.baseSourceGeomsAtRegen,r=this.baseSourceHashesAtRegen,n=s.length!==i.length;if(!n)for(let e=0;e<s.length;e++)if(s[e].geometry!==i[e]||Math.abs(a[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&&s.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 c(140,70,24,48):"cylinder"===e?new i(80,80,160,48,1):new d(B,48,32))}boneTransform(e,t){let s=this.matrixWorld;if("object"===this.data.headShape&&this.data.baseObjectId){let e=this.context.scene.find(this.data.baseObjectId)?.matrixWorld;e&&(s=e)}P.copy(s).decompose(t,e,q)}raycast(e,t){if(!this.scalpMesh.visible)return;let s=[];this.scalpMesh.raycast(e,s);for(let e of s)e.object=this,t.push(e)}get shadowBoundsRadius(){let e="torus"===this.data.headShape?2.6:1.5;return this.roots.unitScale*(e+2.6*Math.max(this.data.hairLength,0))}getShadowBoundsCenter(e){return this.boneTransform(L,e),e}updateEntityBoxSize(e,t){let s=this.shadowBoundsRadius;e.set(0,0,0),t.set(s,s,s)}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,S as b,f as c,M as d,j as e,I as f,H as g,B as h,O as i,C as j,X as k};
1
+ import{v as e}from"./runtime-chunk-BZ4VO3MK.js";import{$c as t,Gc as s,Hc as a,Hd as i,Ib as r,Ic as n,Ie as h,Qc as o,Vc as l,Yd as d,Zd as c,md as u,nd as g}from"./runtime-chunk-KPOUV3HD.js";var p=null;function b(e){p=e}function S(){return p}var m=null;function f(e){m=e}function M(){return m}var y=new l;function R(e,t,s){return y.setRGB(e,t,s,r),{r:y.r,g:y.g,b:y.b}}var w=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t,x=e=>Array.isArray(e)&&"number"==typeof e[0]&&"number"==typeof e[1]?[e[0],e[1]]:[0,0];function v(e,t,s){let a,i=w(e.angle,0),[r,n]=x(e.offset),[h,o]=x(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*(s+o)-(s+n)-1;a=Math.hypot(e,l)+i}else if(2===e.gradientType){let e=-1*Math.atan2(t+h-.5+r,s+o-.5+n),l=i/Math.PI/-2+.5*e/Math.PI;a=l-Math.floor(l)}else{let e=.5+h/(0!==t?t:1e-6),l=o/(0!==s?s: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;a=u>1e-12?(((t-.5+r)/2+d/2)*d+((s-.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 s=d[t-1],i=d[t]-s,r=0!==i?Math.min(1,Math.max(0,(a-s)/i)):a>=s?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 s=e,a=s?.data?.layers;if(a&&"function"==typeof a.forEach){let e=t,s=[];return a.forEach(t=>{let a=t.data;if(!1===a.visible||!0===a.isMask)return;let i=w(a.alpha,1);if(!(i<=0))if("color"===a.type){let t,r=a.color;"string"==typeof r?t="function"==typeof e?.color?e.color(r):void 0:r&&"number"==typeof r.r&&(t=r),t&&s.push({kind:"color",layer:a,rgb:{...R(t.r,t.g,t.b),a:t.a??1},alpha:i})}else"gradient"===a.type&&s.push({kind:"gradient",layer:a,alpha:i})}),0===s.length?null:(e,t)=>{let a=1,i=1,r=1,n=!0;for(let h of s){let s,o,l,d;if("color"===h.kind)({r:s,g:o,b:l}=h.rgb),d=h.rgb.a;else{let[a,i,r,n]=v(h.layer,e,t);({r:s,g:o,b:l}=R(a,i,r)),d=n}let c=n?1:Math.min(1,Math.max(0,d*h.alpha));a+=(s-a)*c,i+=(o-i)*c,r+=(l-r)*c,n=!1}return{r:a,g:i,b:r}}}if(s?.color&&!0===s.color.isColor){let{r:e,g:t,b:a}=s.color;return()=>({r:e,g:t,b:a})}return null}var j=32,I=16384,B=32*I,H=100;function F(e,t){if("torus"===e){let e=t()*Math.PI*2,s=t()*Math.PI*2,a=Math.cos(e),i=Math.sin(e),r=Math.cos(s),n=Math.sin(s);return{x:(1.4+.7*r)*a,y:-(1.4+.7*r)*i,z:.7*n,nx:r*a,ny:-r*i,nz:n,cr:1,cg:1,cb:1}}if("cylinder"===e){let e=t()*Math.PI*2,s=Math.cos(e),a=Math.sin(e);return{x:.8*s,y:1.6*(t()-.5),z:.8*a,nx:s,ny:0,nz:a,cr:1,cg:1,cb:1}}let s=t()*Math.PI*2,a=2*t()-1,i=Math.acos(a),r=Math.sin(i)*Math.cos(s),n=Math.cos(i),h=Math.sin(i)*Math.sin(s);return{x:r,y:n,z:h,nx:r,ny:n,nz:h,cr:1,cg:1,cb:1}}function W(e){let{geometry:t,matrix:s}=e,a=t.getAttribute("position");if(!a||a.count<3)return null;let i=t.getAttribute("normal"),r=t.getAttribute("uv"),h=t.getAttribute("color"),o=t.getIndex(),l=o?o.count/3:a.count/3;if(l<1)return null;let d=(e,t)=>o?o.getX(3*e+t):3*e+t,c=s?s.elements:null,u=s?(new n).getNormalMatrix(s).elements:null,g=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[0]*t+c[4]*s+c[8]*i+c[12]:t},p=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[1]*t+c[5]*s+c[9]*i+c[13]:s},b=e=>{let t=a.getX(e),s=a.getY(e),i=a.getZ(e);return c?c[2]*t+c[6]*s+c[10]*i+c[14]:i},S=new Float64Array(l),m=0;for(let e=0;e<l;e++){let t=d(e,0),s=d(e,1),a=d(e,2),i=g(t),r=p(t),n=b(t),h=g(s)-i,o=p(s)-r,l=b(s)-n,c=g(a)-i,u=p(a)-r,f=b(a)-n,M=o*f-l*u,y=l*c-h*f,R=h*u-o*c;m+=.5*Math.sqrt(M*M+y*y+R*R),S[e]=m}return m<=0?null:{total:m,sample:(t,s)=>{let a=0,n=l-1;for(;a<n;){let e=a+n>>1;S[e]<t?a=e+1:n=e}let o=a,c=d(o,0),m=d(o,1),f=d(o,2),M=s(),y=s();M+y>1&&(M=1-M,y=1-y);let R,w,x,v=1-M-y,A=g(c)*v+g(m)*M+g(f)*y,j=p(c)*v+p(m)*M+p(f)*y,I=b(c)*v+b(m)*M+b(f)*y;if(i){if(R=i.getX(c)*v+i.getX(m)*M+i.getX(f)*y,w=i.getY(c)*v+i.getY(m)*M+i.getY(f)*y,x=i.getZ(c)*v+i.getZ(m)*M+i.getZ(f)*y,u){let e=u[0]*R+u[3]*w+u[6]*x,t=u[1]*R+u[4]*w+u[7]*x,s=u[2]*R+u[5]*w+u[8]*x;R=e,w=t,x=s}}else{let e=g(c),t=p(c),s=b(c),a=g(m)-e,i=p(m)-t,r=b(m)-s,n=g(f)-e,h=p(f)-t,o=b(f)-s;R=i*o-r*h,w=r*n-a*o,x=a*h-i*n}let B=Math.sqrt(R*R+w*w+x*x)||1,H=1,F=1,W=1;if(h)H=h.getX(c)*v+h.getX(m)*M+h.getX(f)*y,F=h.getY(c)*v+h.getY(m)*M+h.getY(f)*y,W=h.getZ(c)*v+h.getZ(m)*M+h.getZ(f)*y;else if(e.sampleColor){let t=r?r.getX(c)*v+r.getX(m)*M+r.getX(f)*y:.5,s=r?r.getY(c)*v+r.getY(m)*M+r.getY(f)*y:.5,a=e.sampleColor(t,s);a&&(H=a.r,F=a.g,W=a.b)}return{x:A,y:j,z:I,nx:R/B,ny:w/B,nz:x/B,cr:H,cg:F,cb:W}}}}function k(e){let t=Math.min(Math.max(1,Math.floor(e.guideStrands)),I),s=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),a="object"===e.shape&&e.sampler,i=a?e.samplerRadius??H:H,r=new Float32Array(4*B),n=new Float32Array(B),h=new Float32Array(4*I).fill(1);for(let o=0;o<t;o++){let t=a?e.sampler(s):F(e.shape,s),l=a?t.x:t.x*i,d=a?t.y:t.y*i,c=a?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,S,m,f=32*o,M=(1.8+.8*s())*e.hairLength*i/31,y=.5+1.5*s(),R=(.02+.06*s())*i;Math.abs(g)<.99?(b=-p,S=0,m=u):(b=1,S=0,m=0);let w=Math.sqrt(b*b+S*S+m*m)||1;for(let e=0;e<32;e++){let t=e/31,s=t*t*.4*i,a=R*Math.sin(t*y*Math.PI*2),h=4*(f+e);r[h+0]=l+u*M*e+a*b/w,r[h+1]=d+g*M*e-s+a*S/w,r[h+2]=c+p*M*e+a*m/w,r[h+3]=0===e?0:1,e<31&&(n[f+e]=M)}}return{initialPositions:r,restLengths:n,unitScale:i,rootColors:h}}var C=1/60,O=4,P=new o,L=new s,z=new a,q=new a,X=class extends e{constructor(e,i,r){super(e,i),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.settledSimSeconds=0,this.lastMotionFingerprint=0,this.lastBoneQuat=new s,this.lastBonePos=new a,this.hasLastBone=!1,this.baseFoundAtRegen=!1,this.baseSourceGeomsAtRegen=[],this.baseSourceHashesAtRegen=[],this.baseColorHashAtRegen=0,this.baseScaleAtRegen=0,this.classicFallbackWarned=!1,this.regenSnapshot=null,this.context=r,this.data=i,this.geometry.setAttribute("position",new t(new Float32Array(0),3)),this.material=new u({colorWrite:!1,depthWrite:!1}),this.frustumCulled=!1,this.scalpMesh=new g(new d(H,48,32),new u({color:5448477})),this.scalpMesh.name="HairScalp",this.add(this.scalpMesh);let n=new h;n.setAttribute("position",new t(new Float32Array(12),3)),n.setIndex([0,2,1,2,3,1]),n.instanceCount=0,this.ribbonMesh=new g(n,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=i.guideStrands,this.roots=this.buildRoots(),this.regenSnapshot={guideStrands:i.guideStrands,hairLength:i.hairLength,spreadRadius:i.spreadRadius,headShape:i.headShape,baseObjectId:i.baseObjectId},this.applyScalpState(),this.applyShadowState(),this.syncSimRunning()}update(e){!this.simRunning||(this.pendingSimSeconds=Math.min(this.pendingSimSeconds+e/1e3,4*C*2),this.trackMotionRest(e/1e3))}trackMotionRest(e){this.boneTransform(L,z);let t=this.hasLastBone&&(Math.abs(this.lastBoneQuat.dot(L))<.9999995||this.lastBonePos.distanceToSquared(z)>1e-8),s=this.motionFingerprint(),a=!this.hasLastBone||t||this.resetRequested||s!==this.lastMotionFingerprint||this.data.windStrength>.001;this.lastBoneQuat.copy(L),this.lastBonePos.copy(z),this.lastMotionFingerprint=s,this.hasLastBone=!0,this.settledSimSeconds=a?0:this.settledSimSeconds+e}motionFingerprint(){let e=this.data;return e.gravity+2*e.damping+3*e.localStiffness+4*e.globalStiffness+5*e.globalRange+6*e.stiffnessFalloff+7*e.windStrength+8*e.vspCoefficient+9*e.kink+10*e.kinkFrequency+11*e.clumpStrength+12*e.clumpSize+13*e.clumpTipScale}get isSimulating(){return(this.simRunning||this.resetRequested)&&this.visible}get isMotionSettled(){return this.settledSimSeconds>6}get isVisiblyAnimating(){return this.isSimulating&&!this.isMotionSettled}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,this.settledSimSeconds=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,r)}(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.castShadow=e,this.receiveShadow=t,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 s=null===t||t.headShape!==e.headShape||t.baseObjectId!==e.baseObjectId;this.regenerate(),s&&this.applyScalpState()}this.syncSimRunning(),this.applyShadowState(),this.checkBaseDrift()}buildRoots(){let{headShape:e,baseObjectId:t,guideStrands:s,hairLength:a}=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 s of e){let e=W(s);e&&t.push(e)}if(0===t.length)return null;let s=new Float64Array(t.length),a=0;for(let e=0;e<t.length;e++)a+=t[e].total,s[e]=a;return a<=0?null:e=>{let i=e()*a,r=0,n=t.length-1;for(;r<n;){let e=r+n>>1;s[e]<i?r=e+1:n=e}let h=0===r?i:i-s[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 k({shape:"object",guideStrands:s,hairLength:a,sampler:e=>{let t=i(e);return{...t,x:t.x*h,y:t.y*h,z:t.z*h}},samplerRadius:n})}}}return k({shape:"object"===e?"sphere":e,guideStrands:s,hairLength:a})}collectBaseSources(e){let t=[],s=[],a=0,i=0;P.copy(e.matrixWorld).invert();let r=P.clone(),n=h=>{if(!0===h.isHairSystem||h!==e&&!1===h.visible)return;let l=h.geometry;if(!0===h.isMesh&&l&&(l.getAttribute("position")?.count??0)>=3){let n=h===e?void 0:(new o).multiplyMatrices(r,h.matrixWorld),d=Array.isArray(h.material)?h.material[0]:h.material;t.push({geometry:l,matrix:n,sampleColor:A(d,this.context.shared)??void 0}),s.push(X.matrixHash(n)),i+=function(e,t){let s=e,a=0,i=1,r=e=>{a+=e*i,i+=1},n=s?.data?.layers;if(n&&"function"==typeof n.forEach){let e=t;n.forEach(t=>{let s=t.data;if(!1!==s.visible)if("color"===s.type){let t=s.color,a="string"==typeof t?"function"==typeof e?.color?e.color(t):void 0:t;a&&"number"==typeof a.r&&(r(a.r),r(a.g),r(a.b)),r(w(s.alpha,1))}else if("gradient"===s.type){let e=s;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(w(e.angle,0)),r(e.gradientType),r(e.smooth?1:0)}})}else s?.color&&!0===s.color.isColor&&(r(s.color.r),r(s.color.g),r(s.color.b));return a}(d,this.context.shared),null===l.boundingSphere&&l.computeBoundingSphere();let c=l.boundingSphere;if(c){let e=0,t=1;n?(z.copy(c.center).applyMatrix4(n),e=z.length(),t=X.matrixMaxScale(n)):e=c.center.length(),a=Math.max(a,e+c.radius*t)}}for(let e of h.children)n(e)};return n(e),0===t.length?null:{sources:t,hashes:s,radius:Math.max(a,.001),colorHash:i}}static matrixHash(e){if(!e)return 0;let t=e.elements,s=0;for(let e=0;e<16;e++)s+=t[e]*(e+1);return s}static matrixMaxScale(e){let t=e.elements,s=Math.hypot(t[0],t[1],t[2]),a=Math.hypot(t[4],t[5],t[6]),i=Math.hypot(t[8],t[9],t[10]);return Math.max(s,a,i,1e-6)}baseWorldScale(e){return P.copy(e.matrixWorld).decompose(z,L,q),Math.max(Math.abs(q.x),Math.abs(q.y),Math.abs(q.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),s=t?.sources??[],a=t?.hashes??[],i=this.baseSourceGeomsAtRegen,r=this.baseSourceHashesAtRegen,n=s.length!==i.length;if(!n)for(let e=0;e<s.length;e++)if(s[e].geometry!==i[e]||Math.abs(a[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&&s.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 c(140,70,24,48):"cylinder"===e?new i(80,80,160,48,1):new d(H,48,32))}boneTransform(e,t){let s=this.matrixWorld;if("object"===this.data.headShape&&this.data.baseObjectId){let e=this.context.scene.find(this.data.baseObjectId)?.matrixWorld;e&&(s=e)}P.copy(s).decompose(t,e,q)}raycast(e,t){if(!this.scalpMesh.visible)return;let s=[];this.scalpMesh.raycast(e,s);for(let e of s)e.object=this,t.push(e)}get shadowBoundsRadius(){let e="torus"===this.data.headShape?2.6:1.5;return this.roots.unitScale*(e+2.6*Math.max(this.data.hairLength,0))}getShadowBoundsCenter(e){return this.boneTransform(L,e),e}updateEntityBoxSize(e,t){let s=this.shadowBoundsRadius;e.set(0,0,0),t.set(s,s,s)}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,S as b,f as c,M as d,j as e,I as f,B as g,H as h,C as i,O as j,X as k};
@@ -1 +1 @@
1
- import{a as e,b as t}from"./runtime-chunk-7XPMJMA4.js";import{a as r,b as i,c as s,d as o}from"./runtime-chunk-TRWD4WLH.js";import{ia as a}from"./runtime-chunk-UVOO7ZT4.js";import{h as n,o as h,p,q as c,r as m,s as d,t as l,v as u}from"./runtime-chunk-OOOV6H7H.js";import{f}from"./runtime-chunk-RTLL6WIB.js";import{i as g}from"./runtime-chunk-2PT2WH66.js";import{K as y,za as v}from"./runtime-chunk-NY4SLVL4.js";import{Ce as C,Gc as T,Hc as b,Qc as j,Tc as w,Vc as M,dd as P,fd as x,wd as O,we as A,yd as _,ye as S,ze as F}from"./runtime-chunk-KPOUV3HD.js";var D=new b,W=new S,V=class extends _{constructor(e){let t=new x,r=new O({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],o={},a=new M(15711266),n=new M(15711266),h=new M(2857471);function p(e,t,r){c(e,r),c(t,r)}function c(e,t){i.push(0,0,0),s.push(t.r,t.g,t.b),void 0===o[e]&&(o[e]=[]),o[e].push(i.length/3-1)}p("n1","n2",a),p("n2","n4",a),p("n4","n3",a),p("n3","n1",a),p("f1","f2",a),p("f2","f4",a),p("f4","f3",a),p("f3","f1",a),p("n1","f1",a),p("n2","f2",a),p("n3","f3",a),p("n4","f4",a),p("p","n1",n),p("p","n2",n),p("p","n3",n),p("p","n4",n),p("u1","u2",h),p("u2","u3",h),p("u3","u1",h),t.setAttribute("position",new P(i,3)),t.setAttribute("color",new P(s,3)),super(t,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){let e=this.geometry,t=this.pointMap;W.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let r=.8;U("n1",t,e,W,-1,-1,r),U("n2",t,e,W,1,-1,r),U("n3",t,e,W,-1,1,r),U("n4",t,e,W,1,1,r);let i=r;U("f1",t,e,W,-1,-1,i),U("f2",t,e,W,1,-1,i),U("f3",t,e,W,-1,1,i),U("f4",t,e,W,1,1,i);let s=i;U("u1",t,e,W,.35,1.1,s),U("u2",t,e,W,-.35,1.1,s),U("u3",t,e,W,0,1.55,s),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function U(e,t,r,i,s,o,a){D.set(s,o,a).unproject(i);let n=t[e];if(void 0!==n){let e=r.getAttribute("position");for(let t=0,r=n.length;t<r;t++)e.setXYZ(n[t],D.x,D.y,D.z)}}var z=class extends(r(V)){constructor(e){super(e),this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e)}raycast(e,t){i(this.object,this.geometry,e,t,!0)}};function I(e){return 1-Math.pow(1-e,3)}var B=new b,H=new b,L=new T,R=new b,k=new b,q=new b,E=class extends(o(S,z)){constructor(e="",t={...v.defaultData,name:""}){super(),this._cameraType="OrthographicCamera",this.targetOffset=y.DefaultTargetOffset,this.isUpVectorFlipped=!1,this.angleOffsetFromUp=0,this.wasMovedByUser=!1,this.wasMovedBySwitchCameraAction=!1,this._createdAt=typeof performance<"u"?performance.now():0,this._tickProjectionTransition=()=>{let e=this._projectionTransition;if(void 0===e)return;if(this.disposed)return void this._endProjectionTransition();e.raf=requestAnimationFrame(this._tickProjectionTransition);let t=E.projectionTransitionRequestRender??e.requestRender;this.updateProjectionMatrix(),t?.()},this.super_Entity(e,t),this.previousProjectionMatrix=new j,this.matrixAutoUpdate=!0,this.width=window.innerWidth,this.height=window.innerHeight;let r=this.width,i=this.height;this.orthoCamera=new C(-.5*r,.5*r,.5*i,-.5*i,-5e4,1e4),this.perspCamera=new F(45,r/i,50,1e4),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.objectHelper.update()}static withoutProjectionTransition(e){let t=E.projectionTransitionsEnabled;E.projectionTransitionsEnabled=!1;try{return e()}finally{E.projectionTransitionsEnabled=t}}get isPerspectiveCamera(){return"PerspectiveCamera"===this.cameraType}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set fov(e){this.perspCamera.fov=e}get fov(){return this.perspCamera.fov}setNear(e,t){"PerspectiveCamera"===e?this.perspCamera.near=t:this.orthoCamera.near=t}setZoom(e,t){t>=0&&("PerspectiveCamera"===e?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}set cameraType(e){"PerspectiveCamera"===e?this.toPerspective():"OrthographicCamera"===e&&this.toOrthographic()}get near(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.near:this.orthoCamera.near}set near(e){"PerspectiveCamera"===this._cameraType?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&("PerspectiveCamera"===this._cameraType?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e,t,r){"number"==typeof e&&(e=new b(e,t,r)),super.lookAt(e),this.getWorldPosition(B),this.targetOffset=B.distanceTo(e)}getTarget(e=new b){return this.getWorldDirection(H),this.getWorldPosition(B),H.multiplyScalar(this.targetOffset),e.copy(B).add(H),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(B),B.distanceTo(e)}updateUp(){this.getWorldQuaternion(L),R.set(0,0,1).applyQuaternion(L),k.copy(w.DEFAULT_UP),this.isUpVectorFlipped&&k.negate(),k.applyQuaternion(L),q.copy(w.DEFAULT_UP).projectOnPlane(R),this.angleOffsetFromUp=q.angleTo(k),this.angleOffsetFromUp*=q.cross(k).dot(R)>=0?1:-1}updateTransformState(e,t){let r=super.updateTransformState(e,t);return void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateUp(),r}getViewFrontToObject(e){let t=e.getWorldPosition(new b),r=e.getWorldDirection(new b).multiplyScalar(this.targetOffset);return{position:t.clone().add(r),target:t}}getViewToTarget(e){let t=this.getWorldDirection(new b).multiplyScalar(this.targetOffset);return{position:e.clone().sub(t),target:e}}getViewToObject(e){let t=new b;return e.getWorldPosition(t),this.getViewToTarget(t)}setViewplaneSize(e,t,r=!1){if(this.aspect=e/t,r){let r=e>t?this.aspect:1,i=e>t?1:this.aspect;this.left=-395*r,this.right=395*r,this.top=1/i*395,this.bottom=1/i*-395}else this.left=.5*-e,this.right=.5*e,this.top=.5*t,this.bottom=.5*-t;this.updateProjectionMatrix()}copyViewPlaneSize(e){this.aspect=e.aspect,this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.updateProjectionMatrix()}toOrthographic(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}toPerspective(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}get isProjectionTransitioning(){return void 0!==this._projectionTransition}get projectionTransitionProgress(){let e=this._projectionTransition;if(void 0===e)return 1;let t=(performance.now()-e.start)/e.duration;return t>=1?1:t<=0?0:I(t)}get _activeSubCamera(){return"PerspectiveCamera"===this._cameraType?this.perspCamera:this.orthoCamera}_canAnimateProjection(){return E.projectionTransitionsEnabled&&"function"==typeof requestAnimationFrame&&typeof performance<"u"&&performance.now()-this._createdAt>=E.projectionTransitionMinAgeMs}_beginProjectionTransition(e){let t=this._projectionTransition;void 0===t&&(t={from:new j,blend:new j,blendInverse:new j,start:0,duration:E.projectionTransitionDuration,referenceDepth:1,raf:0,requestRender:e},this._projectionTransition=t),t.from.copy(this.projectionMatrix),t.start=performance.now(),t.duration=E.projectionTransitionDuration,t.referenceDepth=Number.isFinite(this.targetOffset)?Math.max(1,this.targetOffset):1,e&&(t.requestRender=e),0!==t.raf&&cancelAnimationFrame(t.raf),t.raf=requestAnimationFrame(this._tickProjectionTransition)}_applyProjectionTransition(){let e=this._projectionTransition;if(void 0===e)return;let t=(performance.now()-e.start)/e.duration;if(t>=1)return void this._endProjectionTransition();let r=I(t),i=e.from.elements,s=this._activeSubCamera.projectionMatrix.elements,o=e.blend.elements,a=e.referenceDepth,n=Math.max(1e-6,i[15]-i[11]*a),h=r*n/(r*n+(1-r)*Math.max(1e-6,s[15]-s[11]*a));for(let e=0;e<16;e++)o[e]=i[e]+(s[e]-i[e])*h;e.blendInverse.copy(e.blend).invert(),this.projectionMatrix=e.blend,this.projectionMatrixInverse=e.blendInverse}_endProjectionTransition(){let e=this._projectionTransition;if(void 0===e)return;0!==e.raf&&cancelAnimationFrame(e.raf),this._projectionTransition=void 0;let t=this._activeSubCamera;this.projectionMatrix=t.projectionMatrix,this.projectionMatrixInverse=t.projectionMatrixInverse}_syncProjectionTransition(e){let t=e._projectionTransition;if(void 0===t)return void(void 0!==this._projectionTransition&&this._endProjectionTransition());let r=this._projectionTransition;void 0===r?(r={from:new j,blend:new j,blendInverse:new j,start:0,duration:1,referenceDepth:1,raf:0,requestRender:void 0},this._projectionTransition=r):0!==r.raf&&(cancelAnimationFrame(r.raf),r.raf=0),r.requestRender=void 0,r.from.copy(t.from),r.start=t.start,r.duration=t.duration,r.referenceDepth=t.referenceDepth,this._applyProjectionTransition()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,r,i,s,o){"PerspectiveCamera"===this._cameraType?this.perspCamera.setViewOffset(e,t,r,i,s,o):this.orthoCamera.setViewOffset(e,t,r,i,s,o),this._applyProjectionTransition()}clearViewOffset(){"PerspectiveCamera"===this._cameraType?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}copyHistory(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}updateProjectionMatrix(){"PerspectiveCamera"===this._cameraType?this.toPerspective():"OrthographicCamera"===this._cameraType&&this.toOrthographic()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.parent=e.parent,this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=null===e.view?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=y.sanitizeTargetOffset(e.targetOffset),this.updateProjectionMatrix(),this._syncProjectionTransition(e),this}toCameraState(e=[]){let t={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return f(t,e)}updateCameraSubtype(e,t){let r="perspective"===e?"PerspectiveCamera":"OrthographicCamera";void 0!==t.zoom&&this.setZoom(r,t.zoom),void 0!==t.near&&this.setNear(r,t.near),void 0!==t.fov&&"PerspectiveCamera"===r&&(this.fov=t.fov)}updateState(e,t){this.updateCameraState(e,t)}updateCameraState(e,t){this.updateState_Entity(e,t),void 0!==e.far&&(this.far=e.far),void 0!==e.orthographic&&this.updateCameraSubtype("orthographic",e.orthographic),void 0!==e.perspective&&this.updateCameraSubtype("perspective",e.perspective),void 0!==e.type&&(e.type!==this._cameraType&&this._canAnimateProjection()&&this._beginProjectionTransition(t?.shared.requestRender),this.cameraType=e.type),void 0!==e.up&&this.up.fromArray(e.up.map(e=>"number"==typeof e?e:0)),void 0!==e.targetOffset&&(this.targetOffset=y.sanitizeTargetOffset(e.targetOffset)),void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateProjectionMatrix()}updateByPatchedOp(e,t,r){super.updateByPatchedOp(e,t,r),1===e.path.length&&0===e.type&&this.updateCameraSubtype(e.path[0],e.props)}toState(e){return{...super.toState(e),...this.toCameraState(e),type:this.cameraType}}},G=E;G.projectionTransitionsEnabled=!1,G.projectionTransitionDuration=350,G.projectionTransitionMinAgeMs=1e3;var N=new j,Q=new j,Z=new j,K=new j,X=new j;function Y(e){let t=!1;return e.scene.objects.traverse((e,r)=>{"BooleanGeometry"===r.geometry?.type&&(t=!0)}),t}function J(e,t){let r=e.cloner;return void 0!==r&&r.parent===t?r:void 0}var $=new Float32Array(0);function ee(e,t,r,i){let s=16*(t.children.length+1);$.length<s&&($=new Float32Array(s));let o=0,a=e=>{e.toArray($,16*o),o++},n=!0!==t.parameters.hideBase;n&&a(i),Z.copy(e.matrix);for(let e of t.children)!g(e)||!1===e.playModeVisible||(K.copy(e.matrix).multiply(e.pivotMatrix),X.multiplyMatrices(Z,K),(!n||!X.equals(i))&&a(X));try{return 0===o?0:l(r,$.subarray(0,16*o))}finally{d(r)}}var te,re=class extends a{constructor(e,t,r){super(e,t),this.data=t,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new x,this.onAfterRender=(e,t,r,i,s,o)=>{super.onAfterRender(e,t,r,i,s,o),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,r){super.updateByPatchedOp(e,t,r),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(r,i=!0){if(-1!==this.booleanMeshSetAddress&&!r)return;for(let e=0;e<this.children.length;e++){let t=this.children[e];t instanceof re&&!0===t.dataPatched.visible&&t.recomputeBoolean(!0===r,i)}this.meshSetAddresses=[];for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t instanceof u&&!0===t.dataPatched.visible&&t.geometry.attributes.position?.count>0&&t.geometry.drawRange.count>0&&0!==t.booleanMeshSetAddress){N.copy(t.matrix).multiply(t.pivotMatrix);try{let e=J(t,this);if(-1===t.booleanMeshSetAddress){if((t.geometry.index??t.geometry.getAttribute("position")).count/3<15e5){let s=h(t.geometry,!0===r,i);t.booleanMeshSetAddress=void 0===e||-1===s?s:ee(t,e,s,N)}if(-1===t.booleanMeshSetAddress)return;void 0===e&&m(t.booleanMeshSetAddress,N),t.booleanMatrixInvOld.copy(N).invert(),t.booleanWasTransformed=!1}else t instanceof re&&!0===t.needsTransformForDownstream?(void 0===e?m(t.booleanMeshSetAddress,N):t.booleanMeshSetAddress=ee(t,e,t.booleanMeshSetAddress,N),t.needsTransformForDownstream=!1):!0===t.booleanWasTransformed&&(m(t.booleanMeshSetAddress,Q.multiplyMatrices(N,t.booleanMatrixInvOld)),t.booleanMatrixInvOld.copy(N).invert(),t.booleanWasTransformed=!1)}catch(e){console.error(e),t.booleanMeshSetAddress=0,t.geometry.userData.booleanOperationDidFail=!0;continue}if(0===t.booleanMeshSetAddress)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 x,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===r)return c(this.meshSetAddresses,this.booleanOp);let s=this.geometry;s.dispose(),this.geometry=new x,this.geometry.userData=s.userData,this.geometry.boundingSphere=s.boundingSphere;try{this.booleanMeshSetAddress=p(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()}};(te||(te={})).is=function(e){return n.is(e)&&e instanceof A};var ie=(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)}},se=e=>e instanceof u,oe=e=>null!==e&&e instanceof re,ae=e=>s.is(e);export{G as a,Y as b,re as c,te as d,ie as e,se as f,oe as g,ae as h};
1
+ import{a as e,b as t}from"./runtime-chunk-NJKTZTDX.js";import{a as r,b as i,c as s,d as o}from"./runtime-chunk-7NQHVLP6.js";import{ia as a}from"./runtime-chunk-NOK7R6GP.js";import{h as n,o as h,p,q as c,r as m,s as d,t as l,v as u}from"./runtime-chunk-BZ4VO3MK.js";import{f}from"./runtime-chunk-RTLL6WIB.js";import{i as g}from"./runtime-chunk-2PT2WH66.js";import{K as y,za as v}from"./runtime-chunk-NY4SLVL4.js";import{Ce as C,Gc as T,Hc as b,Qc as j,Tc as w,Vc as P,dd as M,fd as x,wd as O,we as A,yd as _,ye as S,ze as F}from"./runtime-chunk-KPOUV3HD.js";var D=new b,V=new S,W=class extends _{constructor(e){let t=new x,r=new O({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],o={},a=new P(15711266),n=new P(15711266),h=new P(2857471);function p(e,t,r){c(e,r),c(t,r)}function c(e,t){i.push(0,0,0),s.push(t.r,t.g,t.b),void 0===o[e]&&(o[e]=[]),o[e].push(i.length/3-1)}p("n1","n2",a),p("n2","n4",a),p("n4","n3",a),p("n3","n1",a),p("f1","f2",a),p("f2","f4",a),p("f4","f3",a),p("f3","f1",a),p("n1","f1",a),p("n2","f2",a),p("n3","f3",a),p("n4","f4",a),p("p","n1",n),p("p","n2",n),p("p","n3",n),p("p","n4",n),p("u1","u2",h),p("u2","u3",h),p("u3","u1",h),t.setAttribute("position",new M(i,3)),t.setAttribute("color",new M(s,3)),super(t,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){let e=this.geometry,t=this.pointMap;V.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let r=.8;U("n1",t,e,V,-1,-1,r),U("n2",t,e,V,1,-1,r),U("n3",t,e,V,-1,1,r),U("n4",t,e,V,1,1,r);let i=r;U("f1",t,e,V,-1,-1,i),U("f2",t,e,V,1,-1,i),U("f3",t,e,V,-1,1,i),U("f4",t,e,V,1,1,i);let s=i;U("u1",t,e,V,.35,1.1,s),U("u2",t,e,V,-.35,1.1,s),U("u3",t,e,V,0,1.55,s),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function U(e,t,r,i,s,o,a){D.set(s,o,a).unproject(i);let n=t[e];if(void 0!==n){let e=r.getAttribute("position");for(let t=0,r=n.length;t<r;t++)e.setXYZ(n[t],D.x,D.y,D.z)}}var z=class extends(r(W)){constructor(e){super(e),this.object=e,this.name=`CombinedCameraHelper: ${e.uuid}`}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateTarget()}updateTarget(){let e=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(e)}raycast(e,t){i(this.object,this.geometry,e,t,!0)}};function I(e){return 1-Math.pow(1-e,3)}var B=new b,H=new b,L=new T,R=new b,k=new b,q=new b,E=class extends(o(S,z)){constructor(e="",t={...v.defaultData,name:""}){super(),this._cameraType="OrthographicCamera",this.targetOffset=y.DefaultTargetOffset,this.isUpVectorFlipped=!1,this.angleOffsetFromUp=0,this.wasMovedByUser=!1,this.wasMovedBySwitchCameraAction=!1,this._createdAt=typeof performance<"u"?performance.now():0,this._tickProjectionTransition=()=>{let e=this._projectionTransition;if(void 0===e)return;if(this.disposed)return void this._endProjectionTransition();e.raf=requestAnimationFrame(this._tickProjectionTransition);let t=E.projectionTransitionRequestRender??e.requestRender;this.updateProjectionMatrix(),t?.()},this.super_Entity(e,t),this.previousProjectionMatrix=new j,this.matrixAutoUpdate=!0,this.width=window.innerWidth,this.height=window.innerHeight;let r=this.width,i=this.height;this.orthoCamera=new C(-.5*r,.5*r,.5*i,-.5*i,-5e4,1e4),this.perspCamera=new F(45,r/i,50,1e4),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.objectHelper.update()}static withoutProjectionTransition(e){let t=E.projectionTransitionsEnabled;E.projectionTransitionsEnabled=!1;try{return e()}finally{E.projectionTransitionsEnabled=t}}get isPerspectiveCamera(){return"PerspectiveCamera"===this.cameraType}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set fov(e){this.perspCamera.fov=e}get fov(){return this.perspCamera.fov}setNear(e,t){"PerspectiveCamera"===e?this.perspCamera.near=t:this.orthoCamera.near=t}setZoom(e,t){t>=0&&("PerspectiveCamera"===e?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}set cameraType(e){"PerspectiveCamera"===e?this.toPerspective():"OrthographicCamera"===e&&this.toOrthographic()}get near(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.near:this.orthoCamera.near}set near(e){"PerspectiveCamera"===this._cameraType?this.perspCamera.near=e:this.orthoCamera.near=e}get zoom(){return"PerspectiveCamera"===this._cameraType?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(e){e>=0&&("PerspectiveCamera"===this._cameraType?this.perspCamera.zoom=e:this.orthoCamera.zoom=e)}lookAt(e,t,r){"number"==typeof e&&(e=new b(e,t,r)),super.lookAt(e),this.getWorldPosition(B),this.targetOffset=B.distanceTo(e)}getTarget(e=new b){return this.getWorldDirection(H),this.getWorldPosition(B),H.multiplyScalar(this.targetOffset),e.copy(B).add(H),e}getDistanceToTarget(){let e=this.getTarget();return this.getWorldPosition(B),B.distanceTo(e)}updateUp(){this.getWorldQuaternion(L),R.set(0,0,1).applyQuaternion(L),k.copy(w.DEFAULT_UP),this.isUpVectorFlipped&&k.negate(),k.applyQuaternion(L),q.copy(w.DEFAULT_UP).projectOnPlane(R),this.angleOffsetFromUp=q.angleTo(k),this.angleOffsetFromUp*=q.cross(k).dot(R)>=0?1:-1}updateTransformState(e,t){let r=super.updateTransformState(e,t);return void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateUp(),r}getViewFrontToObject(e){let t=e.getWorldPosition(new b),r=e.getWorldDirection(new b).multiplyScalar(this.targetOffset);return{position:t.clone().add(r),target:t}}getViewToTarget(e){let t=this.getWorldDirection(new b).multiplyScalar(this.targetOffset);return{position:e.clone().sub(t),target:e}}getViewToObject(e){let t=new b;return e.getWorldPosition(t),this.getViewToTarget(t)}setViewplaneSize(e,t,r=!1){if(this.aspect=e/t,r){let r=e>t?this.aspect:1,i=e>t?1:this.aspect;this.left=-395*r,this.right=395*r,this.top=1/i*395,this.bottom=1/i*-395}else this.left=.5*-e,this.right=.5*e,this.top=.5*t,this.bottom=.5*-t;this.updateProjectionMatrix()}copyViewPlaneSize(e){this.aspect=e.aspect,this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.updateProjectionMatrix()}toOrthographic(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}toPerspective(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this._applyProjectionTransition(),this.objectHelper&&this.objectHelper.update()}get isProjectionTransitioning(){return void 0!==this._projectionTransition}get projectionTransitionProgress(){let e=this._projectionTransition;if(void 0===e)return 1;let t=(performance.now()-e.start)/e.duration;return t>=1?1:t<=0?0:I(t)}get _activeSubCamera(){return"PerspectiveCamera"===this._cameraType?this.perspCamera:this.orthoCamera}_canAnimateProjection(){return E.projectionTransitionsEnabled&&"function"==typeof requestAnimationFrame&&typeof performance<"u"&&performance.now()-this._createdAt>=E.projectionTransitionMinAgeMs}_beginProjectionTransition(e){let t=this._projectionTransition;void 0===t&&(t={from:new j,blend:new j,blendInverse:new j,start:0,duration:E.projectionTransitionDuration,referenceDepth:1,raf:0,requestRender:e},this._projectionTransition=t),t.from.copy(this.projectionMatrix),t.start=performance.now(),t.duration=E.projectionTransitionDuration,t.referenceDepth=Number.isFinite(this.targetOffset)?Math.max(1,this.targetOffset):1,e&&(t.requestRender=e),0!==t.raf&&cancelAnimationFrame(t.raf),t.raf=requestAnimationFrame(this._tickProjectionTransition)}_applyProjectionTransition(){let e=this._projectionTransition;if(void 0===e)return;let t=(performance.now()-e.start)/e.duration;if(t>=1)return void this._endProjectionTransition();let r=I(t),i=e.from.elements,s=this._activeSubCamera.projectionMatrix.elements,o=e.blend.elements,a=e.referenceDepth,n=Math.max(1e-6,i[15]-i[11]*a),h=r*n/(r*n+(1-r)*Math.max(1e-6,s[15]-s[11]*a));for(let e=0;e<16;e++)o[e]=i[e]+(s[e]-i[e])*h;e.blendInverse.copy(e.blend).invert(),this.projectionMatrix=e.blend,this.projectionMatrixInverse=e.blendInverse}_endProjectionTransition(){let e=this._projectionTransition;if(void 0===e)return;0!==e.raf&&cancelAnimationFrame(e.raf),this._projectionTransition=void 0;let t=this._activeSubCamera;this.projectionMatrix=t.projectionMatrix,this.projectionMatrixInverse=t.projectionMatrixInverse}_syncProjectionTransition(e){let t=e._projectionTransition;if(void 0===t)return void(void 0!==this._projectionTransition&&this._endProjectionTransition());let r=this._projectionTransition;void 0===r?(r={from:new j,blend:new j,blendInverse:new j,start:0,duration:1,referenceDepth:1,raf:0,requestRender:void 0},this._projectionTransition=r):0!==r.raf&&(cancelAnimationFrame(r.raf),r.raf=0),r.requestRender=void 0,r.from.copy(t.from),r.start=t.start,r.duration=t.duration,r.referenceDepth=t.referenceDepth,this._applyProjectionTransition()}setFocalLength(e){this.perspCamera.setFocalLength(e),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(e,t,r,i,s,o){"PerspectiveCamera"===this._cameraType?this.perspCamera.setViewOffset(e,t,r,i,s,o):this.orthoCamera.setViewOffset(e,t,r,i,s,o),this._applyProjectionTransition()}clearViewOffset(){"PerspectiveCamera"===this._cameraType?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}copyHistory(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}updateProjectionMatrix(){"PerspectiveCamera"===this._cameraType?this.toPerspective():"OrthographicCamera"===this._cameraType&&this.toOrthographic()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(e,t){return super.copy(e,t),this.parent=e.parent,this.orthoCamera.copy(e.orthoCamera),this.perspCamera.copy(e.perspCamera),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.far=e.far,this.view=null===e.view?null:Object.assign({},e.view),this._cameraType=e._cameraType,this.aspect=e.aspect,this.fov=e.fov,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.targetOffset=y.sanitizeTargetOffset(e.targetOffset),this.updateProjectionMatrix(),this._syncProjectionTransition(e),this}toCameraState(e=[]){let t={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return f(t,e)}updateCameraSubtype(e,t){let r="perspective"===e?"PerspectiveCamera":"OrthographicCamera";void 0!==t.zoom&&this.setZoom(r,t.zoom),void 0!==t.near&&this.setNear(r,t.near),void 0!==t.fov&&"PerspectiveCamera"===r&&(this.fov=t.fov)}updateState(e,t){this.updateCameraState(e,t)}updateCameraState(e,t){this.updateState_Entity(e,t),void 0!==e.far&&(this.far=e.far),void 0!==e.orthographic&&this.updateCameraSubtype("orthographic",e.orthographic),void 0!==e.perspective&&this.updateCameraSubtype("perspective",e.perspective),void 0!==e.type&&(e.type!==this._cameraType&&this._canAnimateProjection()&&this._beginProjectionTransition(t?.shared.requestRender),this.cameraType=e.type),void 0!==e.up&&this.up.fromArray(e.up.map(e=>"number"==typeof e?e:0)),void 0!==e.targetOffset&&(this.targetOffset=y.sanitizeTargetOffset(e.targetOffset)),void 0!==e.isUpVectorFlipped&&(this.isUpVectorFlipped=e.isUpVectorFlipped),this.updateProjectionMatrix()}updateByPatchedOp(e,t,r){super.updateByPatchedOp(e,t,r),1===e.path.length&&0===e.type&&this.updateCameraSubtype(e.path[0],e.props)}toState(e){return{...super.toState(e),...this.toCameraState(e),type:this.cameraType}}},N=E;N.projectionTransitionsEnabled=!1,N.projectionTransitionDuration=350,N.projectionTransitionMinAgeMs=1e3;var G=new j,K=new j,Q=new j,Z=new j,X=new j;function Y(e){let t=!1;return e.scene.objects.traverse((e,r)=>{"BooleanGeometry"===r.geometry?.type&&(t=!0)}),t}function J(e,t){let r=e.cloner;return void 0!==r&&r.parent===t?r:void 0}var $=new Float32Array(0);function ee(e,t,r,i){let s=16*(t.children.length+1);$.length<s&&($=new Float32Array(s));let o=0,a=e=>{e.toArray($,16*o),o++},n=!0!==t.parameters.hideBase;n&&a(i),Q.copy(e.matrix);for(let e of t.children)!g(e)||!1===e.playModeVisible||(Z.copy(e.matrix).multiply(e.pivotMatrix),X.multiplyMatrices(Q,Z),(!n||!X.equals(i))&&a(X));try{return 0===o?0:l(r,$.subarray(0,16*o))}finally{d(r)}}var te,re=class extends a{constructor(e,t,r){super(e,t),this.data=t,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new x,this.onAfterRender=(e,t,r,i,s,o)=>{super.onAfterRender(e,t,r,i,s,o),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,r){super.updateByPatchedOp(e,t,r),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(r,i=!0){if(-1!==this.booleanMeshSetAddress&&!r)return;for(let e=0;e<this.children.length;e++){let t=this.children[e];t instanceof re&&!0===t.dataPatched.visible&&t.recomputeBoolean(!0===r,i)}this.meshSetAddresses=[];for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t instanceof u&&!0===t.dataPatched.visible&&t.geometry.attributes.position?.count>0&&t.geometry.drawRange.count>0&&0!==t.booleanMeshSetAddress){G.copy(t.matrix).multiply(t.pivotMatrix);try{let e=J(t,this);if(-1===t.booleanMeshSetAddress){if((t.geometry.index??t.geometry.getAttribute("position")).count/3<15e5){let s=h(t.geometry,!0===r,i);t.booleanMeshSetAddress=void 0===e||-1===s?s:ee(t,e,s,G)}if(-1===t.booleanMeshSetAddress)return;void 0===e&&m(t.booleanMeshSetAddress,G),t.booleanMatrixInvOld.copy(G).invert(),t.booleanWasTransformed=!1}else t instanceof re&&!0===t.needsTransformForDownstream?(void 0===e?m(t.booleanMeshSetAddress,G):t.booleanMeshSetAddress=ee(t,e,t.booleanMeshSetAddress,G),t.needsTransformForDownstream=!1):!0===t.booleanWasTransformed&&(m(t.booleanMeshSetAddress,K.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}if(0===t.booleanMeshSetAddress)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 x,this.geometry.userData=e.userData,this.geometry.boundingSphere=e.boundingSphere,this.geometry.setAttribute("position",new M([],3))}return void this.geometry.setDrawRange(0,0)}if(!0===r)return c(this.meshSetAddresses,this.booleanOp);let s=this.geometry;s.dispose(),this.geometry=new x,this.geometry.userData=s.userData,this.geometry.boundingSphere=s.boundingSphere;try{this.booleanMeshSetAddress=p(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()}};(te||(te={})).is=function(e){return n.is(e)&&e instanceof A};var ie=(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)}},se=e=>e instanceof u,oe=e=>null!==e&&e instanceof re,ae=e=>s.is(e);export{N as a,Y as b,re as c,te as d,ie as e,se as f,oe as g,ae as h};
@@ -1 +1 @@
1
- import{j as e}from"./runtime-chunk-OOOV6H7H.js";import{Gd as t,Hc as r,Qc as i,Ye as n,ed as a,ld as o}from"./runtime-chunk-KPOUV3HD.js";var s;(s||(s={})).is=e=>"objectHelper"in e;var l=(r,i)=>class extends(e(r)){constructor(){super(...arguments),this.objectHelper=new i(this),this.gizmos={}}get geometryHelper(){return i.geometryHelper}raycast(e,t){this.objectHelper.raycast(e,t)}showGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!0)}}updateEntityBoxSize(e,r){this.objectHelper.visible&&this.geometryHelper instanceof t?(e.setScalar(0),r.set(this.geometryHelper.parameters.width,this.geometryHelper.parameters.height,this.geometryHelper.parameters.height).multiplyScalar(.5)):super.updateEntityBoxSize(e,r)}hideGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!1)}}},c=e=>{var r;return(r=class extends e{}).geometryHelper=new t(30,30,30),r},p=new o,u=new a,m=new i,f=(e,t,i,n,a=!1,o=e)=>{let s=t,l=o.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),u.copy(s.boundingSphere),u.applyMatrix4(l),!1===i.ray.intersectsSphere(u)||(m.copy(l).invert(),p.copy(i.ray).applyMatrix4(m),null!==s.boundingBox&&!1===p.intersectsBox(s.boundingBox)))return;let c,f,h,d,g,y,x=s.index,b=s.attributes.position,w=s.drawRange;if(!1===a){for(g=Math.max(0,w.start),y=Math.min(x.count,w.start+w.count);g<y;g+=3)if(f=x.getX(g),h=x.getX(g+1),d=x.getX(g+2),c=H(e,i,p,b,f,h,d),c)return c.faceIndex=Math.floor(g/3),void n.push(c)}else{let t=s.attributes.position,a=new r,l=new r,c=new r,u=new r,m=2,f=1/((o.scale.x+o.scale.y+o.scale.z)/3),h=f*f;for(let r=Math.max(0,w.start),s=Math.min(t.count,w.start+w.count)-1;r<s;r+=m){if(a.fromBufferAttribute(t,r),l.fromBufferAttribute(t,r+1),p.distanceSqToSegment(a,l,u,c)>h)continue;u.applyMatrix4(o.matrixWorld);let s=i.ray.origin.distanceTo(u);s<i.near||s>i.far||n.push({distance:s,point:c.clone().applyMatrix4(o.matrixWorld),object:e})}}function H(e,t,i,n,a,o,s){let l=new r,c=new r,p=new r,u=new r,m=new r;if(l.fromBufferAttribute(n,a),c.fromBufferAttribute(n,o),p.fromBufferAttribute(n,s),null===i.intersectTriangle(l,c,p,!1,u))return null;m.copy(u),m.applyMatrix4(e.matrixWorld);let f=t.ray.origin.distanceTo(m);return f<t.near||f>t.far?null:{faceIndex:1,distance:f,point:m.clone(),object:e}}};export{c as a,f as b,s as c,l as d};
1
+ import{j as e}from"./runtime-chunk-BZ4VO3MK.js";import{Gd as t,Hc as r,Qc as i,Ye as n,ed as a,ld as o}from"./runtime-chunk-KPOUV3HD.js";var s;(s||(s={})).is=e=>"objectHelper"in e;var l=(r,i)=>class extends(e(r)){constructor(){super(...arguments),this.objectHelper=new i(this),this.gizmos={}}get geometryHelper(){return i.geometryHelper}raycast(e,t){this.objectHelper.raycast(e,t)}showGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!0)}}updateEntityBoxSize(e,r){this.objectHelper.visible&&this.geometryHelper instanceof t?(e.setScalar(0),r.set(this.geometryHelper.parameters.width,this.geometryHelper.parameters.height,this.geometryHelper.parameters.height).multiplyScalar(.5)):super.updateEntityBoxSize(e,r)}hideGizmos(){for(let e in this.gizmos){let t=this.gizmos[e];t instanceof n&&(t.visible=!1)}}},c=e=>{var r;return(r=class extends e{}).geometryHelper=new t(30,30,30),r},p=new o,u=new a,m=new i,f=(e,t,i,n,a=!1,o=e)=>{let s=t,l=o.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),u.copy(s.boundingSphere),u.applyMatrix4(l),!1===i.ray.intersectsSphere(u)||(m.copy(l).invert(),p.copy(i.ray).applyMatrix4(m),null!==s.boundingBox&&!1===p.intersectsBox(s.boundingBox)))return;let c,f,h,d,g,y,x=s.index,b=s.attributes.position,w=s.drawRange;if(!1===a){for(g=Math.max(0,w.start),y=Math.min(x.count,w.start+w.count);g<y;g+=3)if(f=x.getX(g),h=x.getX(g+1),d=x.getX(g+2),c=H(e,i,p,b,f,h,d),c)return c.faceIndex=Math.floor(g/3),void n.push(c)}else{let t=s.attributes.position,a=new r,l=new r,c=new r,u=new r,m=2,f=1/((o.scale.x+o.scale.y+o.scale.z)/3),h=f*f;for(let r=Math.max(0,w.start),s=Math.min(t.count,w.start+w.count)-1;r<s;r+=m){if(a.fromBufferAttribute(t,r),l.fromBufferAttribute(t,r+1),p.distanceSqToSegment(a,l,u,c)>h)continue;u.applyMatrix4(o.matrixWorld);let s=i.ray.origin.distanceTo(u);s<i.near||s>i.far||n.push({distance:s,point:c.clone().applyMatrix4(o.matrixWorld),object:e})}}function H(e,t,i,n,a,o,s){let l=new r,c=new r,p=new r,u=new r,m=new r;if(l.fromBufferAttribute(n,a),c.fromBufferAttribute(n,o),p.fromBufferAttribute(n,s),null===i.intersectTriangle(l,c,p,!1,u))return null;m.copy(u),m.applyMatrix4(e.matrixWorld);let f=t.ray.origin.distanceTo(m);return f<t.near||f>t.far?null:{faceIndex:1,distance:f,point:m.clone(),object:e}}};export{c as a,f as b,s as c,l as d};
@@ -1 +1 @@
1
- import{f as t}from"./runtime-chunk-RTLL6WIB.js";import{h as e}from"./runtime-chunk-2PT2WH66.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{Ba as r,C as s,Ca as a,Ea as n,J as o,Pa as l,i as h,j as p,k as d,n as c}from"./runtime-chunk-NY4SLVL4.js";import{Ec as u,Gc as m,Hc as f,Md as y,Qc as v,Rc as g,Rd as x,Tc as S,Te as w,Zc as M,bd as b,dd as B,ed as P,fd as E,md as A,nd as D}from"./runtime-chunk-KPOUV3HD.js";var C={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 _(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 R=new f,T=new f,V=new v,W=[new f(-1,1,1),new f(-1,-1,1),new f(1,-1,1),new f(1,1,1),new f(-1,1,-1),new f(-1,-1,-1),new f(1,-1,-1),new f(1,1,-1)],U=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],L=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],I=(t,e,i)=>{t.updateEntityBoxSize(R,T),V.copy(e).multiply(t.matrixWorld),0===T.x&&0===T.y&&0===T.z?i.push(new f(R.x,R.y,R.z).applyMatrix4(V)):W.forEach(t=>{i.push(t.clone().multiply(T).add(R).applyMatrix4(V))})},z=class extends M{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 V.copy(e).multiply(t.matrixWorld),void i.push((new f).applyMatrix4(V));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(V.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(T).multiplyScalar(.5),this.getCenter(R),V.copy(this.matrix).setPosition(R),this.vertices=W.map(t=>t.clone().multiply(T).applyMatrix4(V))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=U.map(([t,e])=>new w(this.vertices[t],this.vertices[e])),this.centerEdges=this.edges.map(t=>t.getCenter(new f))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=L.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},F=new f(1,1,1);function N(t,e,i,r,s=new v){return s.compose(t,e,F).multiply(i).scale(r)}var j,k=new v;(j||(j={})).is=function(t){return t&&t.__isSPEObject};var G=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new v,this.copyPreviousMatrix=!0,this.pivotMatrix=new v,this.matrixWorldRigid=new v,this.shearScale=new v,this.shearScaleInv=new v,this.shearMatrix=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(k.copy(this.parent.matrixWorld).invert()),t.multiply(k.copy(this.pivotMatrix).invert()),!0)}isDescendantOf(t){t instanceof S&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}updateMatrix(){!this.shearMatrix||(N(this.position,this.quaternion,this.shearMatrix,this.scale,this.matrix),this.matrixWorldNeedsUpdate=!0)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.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.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.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)j.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)j.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=l(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)),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}onAfterRender(t,e,i,r,s,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},q=class extends x{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}},H=.001,Z=new f,Q=new f,Y=new f,J=new f,K=new f,X=new f,$=new f,tt=new f,et=new f;function it(t,e,i){return Z.subVectors(e,t),Q.subVectors(e,i),Z.cross(Q).length()<=H}var rt=new WeakMap;function st(t){let e=rt.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 f(...e[0].data.position)];Y.copy(r[0]);for(let t=0;t<e.length-1;t++)Z.fromArray(e[t].data.position),Q.fromArray(e[t+1].data.position),K.subVectors(Z,Y),$.subVectors(Z,Q),K.cross($).length()>H&&(i.push(e[t]),r.push((new f).copy(Z)),Y.copy(Z));let s=e[e.length-1];i.push(s),r.push(new f(...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 f(...e.controlPrevious.position)),h.push(new f(...e.controlNext.position))}let p=[];for(let t=0;t<n;t++){let e=t===o-1?0:t+1;p.push(it(r[t],h[t],r[e])&&it(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 f).subVectors(r[c],s).normalize(),y=(new f).subVectors(r[u],s).normalize();n.prevDir=m,n.nextDir=y;let v=p[a&&0===t?o-1:t-1],g=p[t];if(v&&g){J.addVectors(m,y).normalize();let t=Y.crossVectors(J,m).length()/m.dot(J);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(Y.copy(i.nextDir).setLength(i.removedLength)),r.prevDir&&e.add(Y.copy(r.prevDir).setLength(r.removedLength))),t.distanceTo(e)>H&&(s=new y(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(r.position)>H&&(s=new y(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;J.addVectors(e.prevDir,e.nextDir).normalize(),K.copy(r).lerp(s,.5);let n=r.distanceTo(s)/2;et.copy(J).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(K),X.copy(J).multiplyScalar(-a).add(et);let o=i.distanceTo(X)/i.distanceTo(K);$.copy(e.prevDir).multiplyScalar(o*i.distanceTo(r)).add(i),tt.copy($).lerp(X,2);let l=r.clone().lerp($,4/3),h=s.clone().lerp(tt,4/3);c[2*t]=new y(r,l,h,s)}let u=new q;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return rt.set(t.points,{isClosed:t.isClosed,curve:i}),i}var at,nt=new v,ot=new m,lt=new m,ht=new g,pt=new f,dt=new f(0,1,0);(at||(at={})).is=function(t){return t&&t.__isEntity};var ct=t=>at.is(t),ut={type:"completeState",isfromEntity:!0},mt=["x","y","z"],ft=new f,yt=new f(1,1,1),vt=new m,gt=new g,xt=new v,St=l=>class extends(G(l)){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.transitionState={settled:!0,state:null},this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new z,this._recursiveBBox=new z,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(at.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(at.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(!at.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)n.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=n.patch(this.data,i),n.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=>{ct(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(at.is(e[i]))return e[i];if(at.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&at.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)ct(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{at.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ct(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ct(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)ct(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}hasEntityChild(){return this.children.some(t=>ct(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(e=[]){this.updateWorldMatrix(!0,!1);let i={position:this.position.toArray(),rotation:[this.rotation.x*u.RAD2DEG,this.rotation.y*u.RAD2DEG,this.rotation.z*u.RAD2DEG],scale:this.scale.toArray(),shear:s.fromMatrix(this.shearMatrix.toArray()),pivot:[0,0,0],pivotRotation:[0,0,0]};return t(i,e)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,mt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(ft.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(ft),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),t.shear&&(this.shearMatrix.fromArray(s.toMatrix(t.shear)),i=!0),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(ft.fromArray(t.pivot).negate(),vt.setFromEuler(gt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),yt);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=ft.setFromMatrixPosition(this.pivotMatrix);vt.setFromEuler(gt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,vt,yt)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&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)at.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{at.is(t)&&t.disposeRecursively()})}toState(e=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(e)};return t(i,e)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,s){let o=this.data;this.data=e;let l=t,p=_(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,n.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),_(t.path,["overrides"])){let s=[],a=[...t.path];for(s.push(a[1]),a.splice(0,2);a.length>0&&"descendants"===a[0];)s.push(a[1]),a.splice(0,2);if(void 0===s[s.length-1]){if(0===t.type)for(let e of Object.keys(t.props)){s[s.length-1]=e;let r=i.scene.findInstance([this.uuid,...s]);r&&(r.overrideData=t.props[e],r.updateState(h.apply(r.component.data,r.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...s]);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=r.resolve(e.overrides,s),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 a.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(r={...t,props:e})}else for(let e of a.rootOverrideProps)if(_(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 a;a=o===r.data&&t===s?e:d.applySimple(r.data,s),r.updateByOp(s,a,i,!0)}}})}}updateByPatchedOpBase(t,e,i){if(this.dataPatched=e,0===t.path.length&&0===t.type)void 0!==t.props.type&&!o.is(t.props.type)&&C.changeEntityProptotype(this,e,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){C.changeEntityProptotype(this,e,i);for(let t of this.children)at.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!==_(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==_(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,i=this._updatedPathSnapping?.slide??this.dataPatched.pathSnapping.slide??0,r=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,s=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let a=t.find(e);if(!a)return;this._needApplyPathSnapping=!1;let n=a.data;if(n.geometry.path.points.length<=1)return;let o=st(n.geometry.path),l=function(t){let e=t%1;return e<0?e+1:0===e&&t>0?1:e}(i+r),h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?xt.copy(this.parent.matrixWorld):xt.identity(),d=function(t,e,i,r){ot.setFromRotationMatrix(nt.extractRotation(r));let s=t.clone().applyMatrix4(nt.copy(r).invert().multiply(i));if(null===e)lt.setFromRotationMatrix(nt.extractRotation(i));else{let t=e.clone().applyMatrix4(nt.extractRotation(i));lt.setFromRotationMatrix(nt.lookAt(pt.set(0,0,0),t,dt))}return{position:s,rotation:(new f).setFromEuler(ht.setFromQuaternion(ot.invert().multiply(lt))).multiplyScalar(u.RAD2DEG)}}(h,"tangential"===s?o.getTangentAt(l):null,a.matrixWorld,p);this.updateTransformState({position:d.position.toArray(),rotation:d.rotation.toArray()}),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(ut)})}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(t=>e(t)&&"toObject"===t.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===C.Cloner)return void i("cloners","a cloner");this.cloner=new C.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"})}},wt=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 Et(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},Mt=new b([0,0,0],1);function bt(t){return"TorusGeometry"===t.type&&360===t.arc}var Bt,Pt,Et=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,y,v,g,x,S,w,M=()=>new f,b=new f,P=M(),E=M(),A=M(),D=M(),C=M(),O=M(),_=M(),R=M(),T=M(),V=M(),W=M(),U=i-2*o+.001,L=U/a,I=Math.ceil(n*a),z=I+1,F=U/I,N=-U/2,j=h+1,k=2*Math.PI/h,G=Math.PI/2/d,q=Math.min((1-p/100)*o,o-.01),H=o-q,Z=0,Q=2*d+2,Y=j*Q/2,J=Y+j*z,K=Math.max(0,j*(z+Q)),[X,$,tt]=[3,3,2].map(t=>Array(K*t).fill(0)),et=[],it=s-o;function rt(e,i){let r=Math.PI/2;x=i*F,w=2*Math.PI*(x%L)/L+r,x+=N,S=Math.sin(w)*it,g=Math.cos(w)*it,t?e.set(g,S,x):e.set(g,x,S)}rt(b,-1e-10),rt(P,0),D.copy(b),rt(b,1);let st=b.distanceTo(P),at=c?0:H+q,nt=st*I+2*at,ot=q,lt=nt-at;for(let e=0;e<=I;e++){rt(E,e),W.subVectors(E,D).normalize(),D.copy(E),T.copy(E).setComponent(+t+1,0).normalize(),V.crossVectors(W,T).normalize();let i=0===e,r=e===I,s=i?3*Math.PI/2:G,a=i?ot:lt,n=i?j:J,l=i?0:K-j,p=W.clone().multiplyScalar(i?-H:H).add(E),u=W.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<j;t++){let m=t*k;if(C.addVectors(b.copy(T).multiplyScalar(o*Math.cos(m)),P.copy(V).multiplyScalar(o*Math.sin(m))),O.copy(C).normalize(),i||r){c||(Z=l+t,[0,1,2].forEach(t=>{X[3*Z+t]=p.getComponent(t),$[3*Z+t]=u.getComponent(t)}),tt[2*Z]=+r,tt[2*Z+1]=t/h),P.copy(O).multiplyScalar(q),A.addVectors(E,P);for(let e=0;e<d;e++){let r=e*G+s;_.addVectors(b.copy(W).multiplyScalar(H*Math.sin(r)),P.copy(O).multiplyScalar(H*Math.cos(r))),R.copy(_).normalize(),P.addVectors(A,_),_.normalize(),Z=n+e*j+t,[0,1,2].forEach(t=>{X[3*Z+t]=P.getComponent(t),$[3*Z+t]=R.getComponent(t)});let o=+i+Math.sin(r);tt[2*Z]=(a+H*o)/nt,tt[2*Z+1]=t/h}}P.addVectors(E,C),Z=Y+e*j+t,[0,1,2].forEach(t=>{X[3*Z+t]=P.getComponent(t),$[3*Z+t]=O.getComponent(t)}),tt[2*Z]=(at+e*st)/nt,tt[2*Z+1]=t/h}}let ht=z+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<j-1;i++)u=t*j+i,m=u+1,y=(e?i:u)+j,v=(e?i+1:m)+j,0===t?et.push(m,v,y):t===ht-2?et.push(u,m,y):et.push(u,m,y,m,v,y)}this.setIndex(et),this.setAttribute("position",new B(X,3)),this.setAttribute("normal",new B($,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 Mt.array=new Uint32Array(l),Mt.count=l.length,Mt}},At=new Map,Dt=0;function Ct(t){return Pt||(Pt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.105/build",i=import("./boolean.js"),[r,s]=await Promise.all([i,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await r.default({module_or_path:s}),Bt=r}())}function Ot(){if(void 0===Bt)throw new Error("boolean-wasm is not loaded");return Bt}function _t(t){let e=At.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function Rt(t){return At.set(++Dt,t),Dt}var Tt={0:0,1:1,2:2};function Vt(t,e,i){if(void 0===Bt)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=bt(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 Rt(new Bt.CsgMesh(r,s,a))}function Wt(t,e){let i=Ot(),r=Tt[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(_t);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 Ut(t,e,i,r){let s=Ot(),a=Wt(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 Rt(a)}function Lt(t,e){let i=Ot(),r=Wt(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 It(t,e){_t(t).transform(new Float32Array(e.elements))}function zt(t){let e=At.get(t);void 0!==e&&(e.free(),At.delete(t))}function Ft(t,e){return Rt(Ot().instanced_union(_t(t),e))}function Nt(t){return null!==t&&"booleanOp"in t}var jt=class extends(St(D)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new v}updateVisible(t){super.updateVisible(t),this.visible=!Nt(this.parent)&&this.visible,Nt(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){Nt(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(zt(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Nt(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof jt&&(t.freeBooleanPointer(),Nt(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&Nt(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),Nt(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},kt=new M;function Gt(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)}kt.min.set(a,n,o),kt.max.set(l,h,p),kt.getCenter(r),kt.getSize(s).multiplyScalar(.5)}var qt=new E,Ht=new A,Zt=class extends jt{constructor(t,e){super(qt,Ht),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){if(this.raycastDeformed(t,e))return;super.raycast(t,e)}raycastDeformed(t,e){return!1}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Gt(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,_ as b,C as c,N as d,j as e,G as f,st as g,at as h,ct as i,St as j,wt as k,bt as l,Et as m,Ct as n,Vt as o,Ut as p,Lt as q,It as r,zt as s,Ft as t,Gt as u,Zt as v};
1
+ import{f as t}from"./runtime-chunk-RTLL6WIB.js";import{h as e}from"./runtime-chunk-2PT2WH66.js";import{c as i}from"./runtime-chunk-TZCHGFVF.js";import{Ba as r,C as s,Ca as a,Ea as n,J as o,Pa as l,i as h,j as p,k as d,n as c}from"./runtime-chunk-NY4SLVL4.js";import{Ec as u,Gc as m,Hc as f,Md as y,Qc as v,Rc as g,Rd as x,Tc as S,Te as w,Zc as M,bd as b,dd as B,ed as P,fd as E,md as A,nd as D}from"./runtime-chunk-KPOUV3HD.js";var C={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 _(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 R=new f,T=new f,V=new v,W=[new f(-1,1,1),new f(-1,-1,1),new f(1,-1,1),new f(1,1,1),new f(-1,1,-1),new f(-1,-1,-1),new f(1,-1,-1),new f(1,1,-1)],U=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],L=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],I=(t,e,i)=>{t.updateEntityBoxSize(R,T),V.copy(e).multiply(t.matrixWorld),0===T.x&&0===T.y&&0===T.z?i.push(new f(R.x,R.y,R.z).applyMatrix4(V)):W.forEach(t=>{i.push(t.clone().multiply(T).add(R).applyMatrix4(V))})},z=class extends M{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 V.copy(e).multiply(t.matrixWorld),void i.push((new f).applyMatrix4(V));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(V.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(T).multiplyScalar(.5),this.getCenter(R),V.copy(this.matrix).setPosition(R),this.vertices=W.map(t=>t.clone().multiply(T).applyMatrix4(V))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=U.map(([t,e])=>new w(this.vertices[t],this.vertices[e])),this.centerEdges=this.edges.map(t=>t.getCenter(new f))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=L.map(([t,e])=>this.vertices[t].clone().add(this.vertices[e]).multiplyScalar(.5))}},F=new f(1,1,1);function N(t,e,i,r,s=new v){return s.compose(t,e,F).multiply(i).scale(r)}var j,k=new v;(j||(j={})).is=function(t){return t&&t.__isSPEObject};var G=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new v,this.copyPreviousMatrix=!0,this.pivotMatrix=new v,this.matrixWorldRigid=new v,this.shearScale=new v,this.shearScaleInv=new v,this.shearMatrix=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(k.copy(this.parent.matrixWorld).invert()),t.multiply(k.copy(this.pivotMatrix).invert()),!0)}isDescendantOf(t){t instanceof S&&(t=t.uuid);let e=this;for(;e.parent;){if(e.parent.uuid===t)return!0;e=e.parent}return!1}updateMatrix(){!this.shearMatrix||(N(this.position,this.quaternion,this.shearMatrix,this.scale,this.matrix),this.matrixWorldNeedsUpdate=!0)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.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.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.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)j.is(i)&&i.traverseObject(t,e+1)}traverseObject(t,e=0){if(!0!==t(this,e))for(let i of this.children)j.is(i)&&i.traverseObject(t,e+1)}updateMatrixWorldRigid(){this.hasNonUniformScale=l(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)),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}onAfterRender(t,e,i,r,s,a){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},q=class extends x{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}},H=.001,Z=new f,Q=new f,Y=new f,J=new f,K=new f,X=new f,$=new f,tt=new f,et=new f;function it(t,e,i){return Z.subVectors(e,t),Q.subVectors(e,i),Z.cross(Q).length()<=H}var rt=new WeakMap;function st(t){let e=rt.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 f(...e[0].data.position)];Y.copy(r[0]);for(let t=0;t<e.length-1;t++)Z.fromArray(e[t].data.position),Q.fromArray(e[t+1].data.position),K.subVectors(Z,Y),$.subVectors(Z,Q),K.cross($).length()>H&&(i.push(e[t]),r.push((new f).copy(Z)),Y.copy(Z));let s=e[e.length-1];i.push(s),r.push(new f(...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 f(...e.controlPrevious.position)),h.push(new f(...e.controlNext.position))}let p=[];for(let t=0;t<n;t++){let e=t===o-1?0:t+1;p.push(it(r[t],h[t],r[e])&&it(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 f).subVectors(r[c],s).normalize(),y=(new f).subVectors(r[u],s).normalize();n.prevDir=m,n.nextDir=y;let v=p[a&&0===t?o-1:t-1],g=p[t];if(v&&g){J.addVectors(m,y).normalize();let t=Y.crossVectors(J,m).length()/m.dot(J);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(Y.copy(i.nextDir).setLength(i.removedLength)),r.prevDir&&e.add(Y.copy(r.prevDir).setLength(r.removedLength))),t.distanceTo(e)>H&&(s=new y(t,t.clone().lerp(e,.3),e.clone().lerp(t,.3),e))}else i.position.distanceTo(r.position)>H&&(s=new y(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;J.addVectors(e.prevDir,e.nextDir).normalize(),K.copy(r).lerp(s,.5);let n=r.distanceTo(s)/2;et.copy(J).multiplyScalar(Math.sqrt(Math.pow(a,2)-Math.pow(n,2))).add(K),X.copy(J).multiplyScalar(-a).add(et);let o=i.distanceTo(X)/i.distanceTo(K);$.copy(e.prevDir).multiplyScalar(o*i.distanceTo(r)).add(i),tt.copy($).lerp(X,2);let l=r.clone().lerp($,4/3),h=s.clone().lerp(tt,4/3);c[2*t]=new y(r,l,h,s)}let u=new q;for(let t=0;t<c.length;t++){let e=c[t];e&&u.add(e)}return u}(t);return rt.set(t.points,{isClosed:t.isClosed,curve:i}),i}var at,nt=new v,ot=new m,lt=new m,ht=new g,pt=new f,dt=new f(0,1,0);(at||(at={})).is=function(t){return t&&t.__isEntity};var ct=t=>at.is(t),ut={type:"completeState",isfromEntity:!0},mt=["x","y","z"],ft=new f,yt=new f(1,1,1),vt=new m,gt=new g,xt=new v,St=l=>class extends(G(l)){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.transitionState={settled:!0,state:null},this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new z,this._recursiveBBox=new z,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(at.is(e))return e}entityChildrenCount(){let t=this.children.length;for(;t--;)if(at.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(!at.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)n.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=n.patch(this.data,i),n.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=>{ct(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(at.is(e[i]))return e[i];if(at.is(t))return t.traverseSortNextHelper()}}sortNext(){let t=this.children;return this.children.length>0&&at.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)ct(e)&&t(e)}traverseEntityAncestors(t){this.traverseAncestors(e=>{at.is(e)&&t(e)})}traverseConcreteEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ct(i)&&i.isConcreteEntity&&i.traverseEntity(t,e+1)}traverseEntity(t,e=0){if(!0!==t(this,e))for(let i of this.children)ct(i)&&i.traverseEntity(t,e+1)}traverseVisibleEntity(t){t(this);for(let e of this.children)ct(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}hasEntityChild(){return this.children.some(t=>ct(t))}isAncestorOf(t){if(this.uuid===t)return!1;let e=!1;return this.traverseEntity(i=>{i.uuid===t&&(e=!0)}),e}toObjectTransformState(e=[]){this.updateWorldMatrix(!0,!1);let i={position:this.position.toArray(),rotation:[this.rotation.x*u.RAD2DEG,this.rotation.y*u.RAD2DEG,this.rotation.z*u.RAD2DEG],scale:this.scale.toArray(),shear:s.fromMatrix(this.shearMatrix.toArray()),pivot:[0,0,0],pivotRotation:[0,0,0]};return t(i,e)}getTransformValues(t,e,i){return e[t].map((e,r)=>i?.shared.getVariable(e,[this.uuid,t,mt[r]])??e)}updateTransformState(t,e){let i=!1;if(t.position&&(this.position.fromArray(this.getTransformValues("position",t,e)),i=!0),t.rotation&&(ft.fromArray(this.getTransformValues("rotation",t,e)).multiplyScalar(u.DEG2RAD),this.rotation.setFromVector3(ft),i=!0),t.scale&&(this.scale.fromArray(this.getTransformValues("scale",t,e)),i=!0),t.shear&&(this.shearMatrix.fromArray(s.toMatrix(t.shear)),i=!0),void 0!==t.pivot||void 0!==t.pivotRotation)if(i=!0,void 0!==t.pivot&&void 0!==t.pivotRotation)this.pivotMatrix.compose(ft.fromArray(t.pivot).negate(),vt.setFromEuler(gt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),yt);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=ft.setFromMatrixPosition(this.pivotMatrix);vt.setFromEuler(gt.fromArray(t.pivotRotation.map(t=>t*u.DEG2RAD))).invert(),this.pivotMatrix.compose(e,vt,yt)}return i&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(t=>{t.invalidateClonerTransform(this)})),t.position&&t.rotation&&t.scale&&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)at.is(t)&&t.disposeRecursively()}disposeRecursively(){this.dispose(),this.children.forEach(t=>{at.is(t)&&t.disposeRecursively()})}toState(e=[]){let i={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(e)};return t(i,e)}updateByObjUpdateOp(t,e){void 0!==t&&this.updateByOp({type:0,props:t,path:[]},{...this.data,...t},e,!1)}updateByOp(t,e,i,s){let o=this.data;this.data=e;let l=t,p=_(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,n.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),i),_(t.path,["overrides"])){let s=[],a=[...t.path];for(s.push(a[1]),a.splice(0,2);a.length>0&&"descendants"===a[0];)s.push(a[1]),a.splice(0,2);if(void 0===s[s.length-1]){if(0===t.type)for(let e of Object.keys(t.props)){s[s.length-1]=e;let r=i.scene.findInstance([this.uuid,...s]);r&&(r.overrideData=t.props[e],r.updateState(h.apply(r.component.data,r.overrideData),i))}}else{let n=i.scene.findInstance([this.uuid,...s]);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=r.resolve(e.overrides,s),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 a.rootOverrideProps)i in t.props&&(void 0===e&&(e={}),e[i]=t.props[i]);e&&(r={...t,props:e})}else for(let e of a.rootOverrideProps)if(_(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 a;a=o===r.data&&t===s?e:d.applySimple(r.data,s),r.updateByOp(s,a,i,!0)}}})}}updateByPatchedOpBase(t,e,i){if(this.dataPatched=e,0===t.path.length&&0===t.type)void 0!==t.props.type&&!o.is(t.props.type)&&C.changeEntityProptotype(this,e,i);else if(1===t.path.length&&"geometry"===t.path[0]&&0===t.type&&"type"in t.props){C.changeEntityProptotype(this,e,i);for(let t of this.children)at.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!==_(t.path,["pathSnapping"])&&this.updatePathSnapping(e.pathSnapping),null!==_(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,i=this._updatedPathSnapping?.slide??this.dataPatched.pathSnapping.slide??0,r=this._updatedPathSnapping?.offset??this.dataPatched.pathSnapping.offset??0,s=this._updatedPathSnapping?.orientation??this.dataPatched.pathSnapping.orientation;if(null===e)return;let a=t.find(e);if(!a)return;this._needApplyPathSnapping=!1;let n=a.data;if(n.geometry.path.points.length<=1)return;let o=st(n.geometry.path),l=function(t){let e=t%1;return e<0?e+1:0===e&&t>0?1:e}(i+r),h=null;try{h=o.curves.length?o.getPointAt(l):null}catch(t){}if(null===h)return;a.updateMatrixWorld();let p=this.parent?xt.copy(this.parent.matrixWorld):xt.identity(),d=function(t,e,i,r){ot.setFromRotationMatrix(nt.extractRotation(r));let s=t.clone().applyMatrix4(nt.copy(r).invert().multiply(i));if(null===e)lt.setFromRotationMatrix(nt.extractRotation(i));else{let t=e.clone().applyMatrix4(nt.extractRotation(i));lt.setFromRotationMatrix(nt.lookAt(pt.set(0,0,0),t,dt))}return{position:s,rotation:(new f).setFromEuler(ht.setFromQuaternion(ot.invert().multiply(lt))).multiplyScalar(u.RAD2DEG)}}(h,"tangential"===s?o.getTangentAt(l):null,a.matrixWorld,p);this.updateTransformState({position:d.position.toArray(),rotation:d.rotation.toArray()}),this.traverseEntity(t=>{t._cameraType&&t.dispatchEvent(ut)})}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(t=>e(t)&&"toObject"===t.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===C.Cloner)return void i("cloners","a cloner");this.cloner=new C.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"})}},wt=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 Et(!1,e,i,r,s,a,n,o,l,h,p,d);return Object.assign(c,{userData:{...t,type:"HelixGeometry"}})}},Mt=new b([0,0,0],1);function bt(t){return"TorusGeometry"===t.type&&360===t.arc}var Bt,Pt,Et=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,y,v,g,x,S,w,M=()=>new f,b=new f,P=M(),E=M(),A=M(),D=M(),C=M(),O=M(),_=M(),R=M(),T=M(),V=M(),W=M(),U=i-2*o+.001,L=U/a,I=Math.ceil(n*a),z=I+1,F=U/I,N=-U/2,j=h+1,k=2*Math.PI/h,G=Math.PI/2/d,q=Math.min((1-p/100)*o,o-.01),H=o-q,Z=0,Q=2*d+2,Y=j*Q/2,J=Y+j*z,K=Math.max(0,j*(z+Q)),[X,$,tt]=[3,3,2].map(t=>Array(K*t).fill(0)),et=[],it=s-o;function rt(e,i){let r=Math.PI/2;x=i*F,w=2*Math.PI*(x%L)/L+r,x+=N,S=Math.sin(w)*it,g=Math.cos(w)*it,t?e.set(g,S,x):e.set(g,x,S)}rt(b,-1e-10),rt(P,0),D.copy(b),rt(b,1);let st=b.distanceTo(P),at=c?0:H+q,nt=st*I+2*at,ot=q,lt=nt-at;for(let e=0;e<=I;e++){rt(E,e),W.subVectors(E,D).normalize(),D.copy(E),T.copy(E).setComponent(+t+1,0).normalize(),V.crossVectors(W,T).normalize();let i=0===e,r=e===I,s=i?3*Math.PI/2:G,a=i?ot:lt,n=i?j:J,l=i?0:K-j,p=W.clone().multiplyScalar(i?-H:H).add(E),u=W.clone().multiplyScalar(i?-1:1).normalize();for(let t=0;t<j;t++){let m=t*k;if(C.addVectors(b.copy(T).multiplyScalar(o*Math.cos(m)),P.copy(V).multiplyScalar(o*Math.sin(m))),O.copy(C).normalize(),i||r){c||(Z=l+t,[0,1,2].forEach(t=>{X[3*Z+t]=p.getComponent(t),$[3*Z+t]=u.getComponent(t)}),tt[2*Z]=+r,tt[2*Z+1]=t/h),P.copy(O).multiplyScalar(q),A.addVectors(E,P);for(let e=0;e<d;e++){let r=e*G+s;_.addVectors(b.copy(W).multiplyScalar(H*Math.sin(r)),P.copy(O).multiplyScalar(H*Math.cos(r))),R.copy(_).normalize(),P.addVectors(A,_),_.normalize(),Z=n+e*j+t,[0,1,2].forEach(t=>{X[3*Z+t]=P.getComponent(t),$[3*Z+t]=R.getComponent(t)});let o=+i+Math.sin(r);tt[2*Z]=(a+H*o)/nt,tt[2*Z+1]=t/h}}P.addVectors(E,C),Z=Y+e*j+t,[0,1,2].forEach(t=>{X[3*Z+t]=P.getComponent(t),$[3*Z+t]=O.getComponent(t)}),tt[2*Z]=(at+e*st)/nt,tt[2*Z+1]=t/h}}let ht=z+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<j-1;i++)u=t*j+i,m=u+1,y=(e?i:u)+j,v=(e?i+1:m)+j,0===t?et.push(m,v,y):t===ht-2?et.push(u,m,y):et.push(u,m,y,m,v,y)}this.setIndex(et),this.setAttribute("position",new B(X,3)),this.setAttribute("normal",new B($,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 Mt.array=new Uint32Array(l),Mt.count=l.length,Mt}},At=new Map,Dt=0;function Ct(t){return Pt||(Pt=async function(){let e=t??"https://cdn.spline.design/@splinetool/runtime@2.0.106/build",i=import("./boolean.js"),[r,s]=await Promise.all([i,fetch(`${e}/boolean.wasm`).then(t=>t.arrayBuffer())]);await r.default({module_or_path:s}),Bt=r}())}function Ot(){if(void 0===Bt)throw new Error("boolean-wasm is not loaded");return Bt}function _t(t){let e=At.get(t);if(void 0===e)throw new Error("Unknown csg mesh set handle "+t);return e}function Rt(t){return At.set(++Dt,t),Dt}var Tt={0:0,1:1,2:2};function Vt(t,e,i){if(void 0===Bt)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=bt(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 Rt(new Bt.CsgMesh(r,s,a))}function Wt(t,e){let i=Ot(),r=Tt[e];if(void 0===r)throw new Error("Unknown boolean operation "+e);let s=t.map(_t);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 Ut(t,e,i,r){let s=Ot(),a=Wt(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 Rt(a)}function Lt(t,e){let i=Ot(),r=Wt(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 It(t,e){_t(t).transform(new Float32Array(e.elements))}function zt(t){let e=At.get(t);void 0!==e&&(e.free(),At.delete(t))}function Ft(t,e){return Rt(Ot().instanced_union(_t(t),e))}function Nt(t){return null!==t&&"booleanOp"in t}var jt=class extends(St(D)){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new v}updateVisible(t){super.updateVisible(t),this.visible=!Nt(this.parent)&&this.visible,Nt(this.parent)&&this.parent.invalidateDownstreamBooleanData()}onClonerLayoutUpdated(){Nt(this.parent)&&this.invalidateDownstreamBooleanData()}freeBooleanPointer(){-1!==this.booleanMeshSetAddress&&(zt(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Nt(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof jt&&(t.freeBooleanPointer(),Nt(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,e){let i=super.updateTransformState(t,e);return i&&Nt(this.parent)&&this.invalidateDownstreamBooleanData(!0),i}onVariableUpdate(t=!1){super.onVariableUpdate(t),Nt(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},kt=new M;function Gt(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)}kt.min.set(a,n,o),kt.max.set(l,h,p),kt.getCenter(r),kt.getSize(s).multiplyScalar(.5)}var qt=new E,Ht=new A,Zt=class extends jt{constructor(t,e){super(qt,Ht),this.super_Entity(t,e)}updateState(t,e){this.updateState_Entity(t,e)}raycast(t,e){if(this.raycastDeformed(t,e))return;super.raycast(t,e)}raycastDeformed(t,e){return!1}updateEntityBoxSize(t,e){let i=this.geometry.getAttribute("position");void 0!==i?Gt(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,_ as b,C as c,N as d,j as e,G as f,st as g,at as h,ct as i,St as j,wt as k,bt as l,Et as m,Ct as n,Vt as o,Ut as p,Lt as q,It as r,zt as s,Ft as t,Gt as u,Zt as v};