@splinetool/runtime 2.0.6 → 2.0.8

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 (330) hide show
  1. package/build/hana-ui.js +44 -40
  2. package/build/hana-ui.js.br +0 -0
  3. package/build/hana-ui.js.gz +0 -0
  4. package/build/hana-ui.wasm +0 -0
  5. package/build/hana-ui.wasm.br +0 -0
  6. package/build/hana-ui.wasm.gz +0 -0
  7. package/build/{runtime-aiAssistant-KA7ZJ3F6.js → runtime-aiAssistant-KCI2YU3F.js} +1 -1
  8. package/build/runtime-aiAssistant-KCI2YU3F.js.br +0 -0
  9. package/build/runtime-aiAssistant-KCI2YU3F.js.gz +0 -0
  10. package/build/{runtime-apiServices-CGMAW2B4.js → runtime-apiServices-EYRJ5E55.js} +1 -1
  11. package/build/runtime-apiServices-EYRJ5E55.js.br +0 -0
  12. package/build/runtime-apiServices-EYRJ5E55.js.gz +0 -0
  13. package/build/{runtime-audio-GCUGVRQ3.js → runtime-audio-TEHDPDRZ.js} +1 -1
  14. package/build/runtime-audio-TEHDPDRZ.js.br +4 -0
  15. package/build/runtime-audio-TEHDPDRZ.js.gz +0 -0
  16. package/build/{runtime-chunk-HUFJRFTO.js → runtime-chunk-23QXG35G.js} +1 -1
  17. package/build/runtime-chunk-23QXG35G.js.br +0 -0
  18. package/build/runtime-chunk-23QXG35G.js.gz +0 -0
  19. package/build/{runtime-chunk-H7D3VFTJ.js → runtime-chunk-32KZP4YN.js} +1 -1
  20. package/build/runtime-chunk-32KZP4YN.js.br +0 -0
  21. package/build/runtime-chunk-32KZP4YN.js.gz +0 -0
  22. package/build/{runtime-chunk-MM2G3DLE.js → runtime-chunk-3GRN37GY.js} +1 -1
  23. package/build/runtime-chunk-3GRN37GY.js.br +0 -0
  24. package/build/runtime-chunk-3GRN37GY.js.gz +0 -0
  25. package/build/{runtime-chunk-LX3KCQF6.js → runtime-chunk-557KVSJL.js} +1 -1
  26. package/build/runtime-chunk-557KVSJL.js.br +0 -0
  27. package/build/runtime-chunk-557KVSJL.js.gz +0 -0
  28. package/build/{runtime-chunk-CX2MRLZA.js → runtime-chunk-5JEZ42OM.js} +1 -1
  29. package/build/runtime-chunk-5JEZ42OM.js.br +0 -0
  30. package/build/runtime-chunk-5JEZ42OM.js.gz +0 -0
  31. package/build/{runtime-chunk-KYA2CB5O.js → runtime-chunk-5RXW5MNJ.js} +1 -1
  32. package/build/runtime-chunk-5RXW5MNJ.js.br +0 -0
  33. package/build/runtime-chunk-5RXW5MNJ.js.gz +0 -0
  34. package/build/{runtime-chunk-AKWBEROQ.js → runtime-chunk-AELTGHV2.js} +1 -1
  35. package/build/runtime-chunk-AELTGHV2.js.br +0 -0
  36. package/build/runtime-chunk-AELTGHV2.js.gz +0 -0
  37. package/build/{runtime-chunk-NAJSQF6K.js → runtime-chunk-BMA5KYBS.js} +1 -1
  38. package/build/runtime-chunk-BMA5KYBS.js.br +0 -0
  39. package/build/runtime-chunk-BMA5KYBS.js.gz +0 -0
  40. package/build/{runtime-chunk-4KX4KQWR.js → runtime-chunk-CKT62HES.js} +1 -1
  41. package/build/runtime-chunk-CKT62HES.js.br +0 -0
  42. package/build/runtime-chunk-CKT62HES.js.gz +0 -0
  43. package/build/{runtime-chunk-CEAWQBAS.js → runtime-chunk-DHWGP6NU.js} +1 -1
  44. package/build/runtime-chunk-DHWGP6NU.js.br +0 -0
  45. package/build/runtime-chunk-DHWGP6NU.js.gz +0 -0
  46. package/build/{runtime-chunk-SXPM42HJ.js → runtime-chunk-DK66VKWP.js} +1 -1
  47. package/build/runtime-chunk-DK66VKWP.js.br +0 -0
  48. package/build/runtime-chunk-DK66VKWP.js.gz +0 -0
  49. package/build/{runtime-chunk-XUM5HEC6.js → runtime-chunk-E3IEBR27.js} +1 -1
  50. package/build/runtime-chunk-E3IEBR27.js.br +0 -0
  51. package/build/runtime-chunk-E3IEBR27.js.gz +0 -0
  52. package/build/{runtime-chunk-ITLS6YIC.js → runtime-chunk-EJJZJ5MV.js} +1 -1
  53. package/build/runtime-chunk-EJJZJ5MV.js.br +0 -0
  54. package/build/runtime-chunk-EJJZJ5MV.js.gz +0 -0
  55. package/build/{runtime-chunk-NWCLOXDY.js → runtime-chunk-EPHVY3XO.js} +1 -1
  56. package/build/runtime-chunk-EPHVY3XO.js.br +0 -0
  57. package/build/runtime-chunk-EPHVY3XO.js.gz +0 -0
  58. package/build/{runtime-chunk-GN3HDYV2.js → runtime-chunk-F3ZACLZW.js} +1 -1
  59. package/build/runtime-chunk-F3ZACLZW.js.br +0 -0
  60. package/build/runtime-chunk-F3ZACLZW.js.gz +0 -0
  61. package/build/{runtime-chunk-PUBEJSJO.js → runtime-chunk-GZ7C2GJM.js} +1 -1
  62. package/build/runtime-chunk-GZ7C2GJM.js.br +0 -0
  63. package/build/runtime-chunk-GZ7C2GJM.js.gz +0 -0
  64. package/build/{runtime-chunk-BPYFB4BD.js → runtime-chunk-HK23JJVH.js} +1 -1
  65. package/build/runtime-chunk-HK23JJVH.js.br +0 -0
  66. package/build/runtime-chunk-HK23JJVH.js.gz +0 -0
  67. package/build/{runtime-chunk-4DNX5FPP.js → runtime-chunk-HZ6FL5GH.js} +1 -1
  68. package/build/runtime-chunk-HZ6FL5GH.js.br +0 -0
  69. package/build/runtime-chunk-HZ6FL5GH.js.gz +0 -0
  70. package/build/{runtime-chunk-FY3XD5P2.js → runtime-chunk-KE6HNYUL.js} +1 -1
  71. package/build/runtime-chunk-KE6HNYUL.js.br +0 -0
  72. package/build/runtime-chunk-KE6HNYUL.js.gz +0 -0
  73. package/build/runtime-chunk-KNL33WN7.js +1 -0
  74. package/build/runtime-chunk-KNL33WN7.js.br +0 -0
  75. package/build/runtime-chunk-KNL33WN7.js.gz +0 -0
  76. package/build/runtime-chunk-OUXEWX5Z.js +1 -0
  77. package/build/runtime-chunk-OUXEWX5Z.js.br +0 -0
  78. package/build/runtime-chunk-OUXEWX5Z.js.gz +0 -0
  79. package/build/{runtime-chunk-RRXSRYPQ.js → runtime-chunk-PDASWDVC.js} +1 -1
  80. package/build/{runtime-chunk-RRXSRYPQ.js.br → runtime-chunk-PDASWDVC.js.br} +0 -0
  81. package/build/runtime-chunk-PDASWDVC.js.gz +0 -0
  82. package/build/{runtime-chunk-JQ3A6ENO.js → runtime-chunk-RLYG5YBB.js} +1 -1
  83. package/build/runtime-chunk-RLYG5YBB.js.br +1 -0
  84. package/build/runtime-chunk-RLYG5YBB.js.gz +0 -0
  85. package/build/{runtime-chunk-OF7IZ6BI.js → runtime-chunk-TAY7IXEZ.js} +1 -1
  86. package/build/runtime-chunk-TAY7IXEZ.js.br +0 -0
  87. package/build/runtime-chunk-TAY7IXEZ.js.gz +0 -0
  88. package/build/{runtime-chunk-R34HNX2O.js → runtime-chunk-U4QOT2PX.js} +1 -1
  89. package/build/runtime-chunk-U4QOT2PX.js.br +0 -0
  90. package/build/runtime-chunk-U4QOT2PX.js.gz +0 -0
  91. package/build/{runtime-chunk-GO25U5WN.js → runtime-chunk-UIM3XKIT.js} +1 -1
  92. package/build/runtime-chunk-UIM3XKIT.js.br +0 -0
  93. package/build/runtime-chunk-UIM3XKIT.js.gz +0 -0
  94. package/build/{runtime-chunk-4E4NQ6GS.js → runtime-chunk-USGQ26QU.js} +1 -1
  95. package/build/{runtime-chunk-4E4NQ6GS.js.br → runtime-chunk-USGQ26QU.js.br} +0 -0
  96. package/build/runtime-chunk-USGQ26QU.js.gz +0 -0
  97. package/build/{runtime-chunk-RBM3UDQF.js → runtime-chunk-VPEJ5BFD.js} +1 -1
  98. package/build/runtime-chunk-VPEJ5BFD.js.br +0 -0
  99. package/build/{runtime-chunk-RBM3UDQF.js.gz → runtime-chunk-VPEJ5BFD.js.gz} +0 -0
  100. package/build/{runtime-chunk-XXRCB3ME.js → runtime-chunk-YULW5JRE.js} +1 -1
  101. package/build/runtime-chunk-YULW5JRE.js.br +0 -0
  102. package/build/runtime-chunk-YULW5JRE.js.gz +0 -0
  103. package/build/{runtime-classicRuntime-PJ7JLKSY.js → runtime-classicRuntime-U672GAGM.js} +1 -1
  104. package/build/runtime-classicRuntime-U672GAGM.js.br +0 -0
  105. package/build/runtime-classicRuntime-U672GAGM.js.gz +0 -0
  106. package/build/runtime-cloners-2AC7OZRC.js +1 -0
  107. package/build/runtime-cloners-2AC7OZRC.js.br +0 -0
  108. package/build/runtime-cloners-2AC7OZRC.js.gz +0 -0
  109. package/build/{runtime-components-VRLLFORJ.js → runtime-components-L63NUGAO.js} +1 -1
  110. package/build/runtime-components-L63NUGAO.js.br +0 -0
  111. package/build/runtime-components-L63NUGAO.js.gz +0 -0
  112. package/build/{runtime-conditional-VA7AKA6O.js → runtime-conditional-HGOAXTBF.js} +1 -1
  113. package/build/runtime-conditional-HGOAXTBF.js.br +0 -0
  114. package/build/runtime-conditional-HGOAXTBF.js.gz +0 -0
  115. package/build/{runtime-createDestroy-IQVBLQ24.js → runtime-createDestroy-QHHQ6LYS.js} +1 -1
  116. package/build/runtime-createDestroy-QHHQ6LYS.js.br +0 -0
  117. package/build/runtime-createDestroy-QHHQ6LYS.js.gz +0 -0
  118. package/build/{runtime-dragDrop-XFI62H3C.js → runtime-dragDrop-YBSWK3ET.js} +1 -1
  119. package/build/runtime-dragDrop-YBSWK3ET.js.br +0 -0
  120. package/build/runtime-dragDrop-YBSWK3ET.js.gz +0 -0
  121. package/build/{runtime-gameControls-W3YS7OS2.js → runtime-gameControls-DSJRSTW5.js} +1 -1
  122. package/build/runtime-gameControls-DSJRSTW5.js.br +0 -0
  123. package/build/runtime-gameControls-DSJRSTW5.js.gz +0 -0
  124. package/build/runtime-hair-V4RTCES2.js +1 -0
  125. package/build/runtime-hair-V4RTCES2.js.br +2 -0
  126. package/build/runtime-hair-V4RTCES2.js.gz +0 -0
  127. package/build/{runtime-mergeStaticGeometries-KJFDZ7TP.js → runtime-mergeStaticGeometries-VXENKMD4.js} +1 -1
  128. package/build/runtime-mergeStaticGeometries-VXENKMD4.js.br +0 -0
  129. package/build/runtime-mergeStaticGeometries-VXENKMD4.js.gz +0 -0
  130. package/build/{runtime-miscActions-UGVVC2QC.js → runtime-miscActions-RPUPHHGJ.js} +1 -1
  131. package/build/runtime-miscActions-RPUPHHGJ.js.br +0 -0
  132. package/build/runtime-miscActions-RPUPHHGJ.js.gz +0 -0
  133. package/build/{runtime-mouseHover-O7Y26SM5.js → runtime-mouseHover-HG6AHA2L.js} +1 -1
  134. package/build/runtime-mouseHover-HG6AHA2L.js.br +0 -0
  135. package/build/runtime-mouseHover-HG6AHA2L.js.gz +0 -0
  136. package/build/{runtime-particles-GFRULQXO.js → runtime-particles-ZHE2MC33.js} +1 -1
  137. package/build/runtime-particles-ZHE2MC33.js.br +0 -0
  138. package/build/runtime-particles-ZHE2MC33.js.gz +0 -0
  139. package/build/{runtime-paths-Q7I56BAX.js → runtime-paths-GN6E6ZYL.js} +1 -1
  140. package/build/runtime-paths-GN6E6ZYL.js.br +0 -0
  141. package/build/runtime-paths-GN6E6ZYL.js.gz +0 -0
  142. package/build/{runtime-resize-2ZFLSK2M.js → runtime-resize-LACR4RFK.js} +1 -1
  143. package/build/runtime-resize-LACR4RFK.js.br +0 -0
  144. package/build/runtime-resize-LACR4RFK.js.gz +0 -0
  145. package/build/{runtime-sceneTransition-Z65VROHI.js → runtime-sceneTransition-QLPFYHHY.js} +1 -1
  146. package/build/runtime-sceneTransition-QLPFYHHY.js.br +0 -0
  147. package/build/runtime-sceneTransition-QLPFYHHY.js.gz +0 -0
  148. package/build/{runtime-scroll-NWKW6A6L.js → runtime-scroll-WZZBT2XR.js} +1 -1
  149. package/build/runtime-scroll-WZZBT2XR.js.br +0 -0
  150. package/build/runtime-scroll-WZZBT2XR.js.gz +0 -0
  151. package/build/runtime-shapeBlends-O6ATLCCA.js +1 -0
  152. package/build/runtime-shapeBlends-O6ATLCCA.js.br +0 -0
  153. package/build/runtime-shapeBlends-O6ATLCCA.js.gz +0 -0
  154. package/build/{runtime-text-VK3OGBSY.js → runtime-text-UADJSRL4.js} +1 -1
  155. package/build/runtime-text-UADJSRL4.js.br +0 -0
  156. package/build/runtime-text-UADJSRL4.js.gz +0 -0
  157. package/build/{runtime-textInputs-JJQSKO3C.js → runtime-textInputs-7U3TTJ4X.js} +1 -1
  158. package/build/runtime-textInputs-7U3TTJ4X.js.br +0 -0
  159. package/build/runtime-textInputs-7U3TTJ4X.js.gz +0 -0
  160. package/build/runtime-timeline-JXKHKUAC.js +1 -0
  161. package/build/runtime-timeline-JXKHKUAC.js.br +0 -0
  162. package/build/runtime-timeline-JXKHKUAC.js.gz +0 -0
  163. package/build/{runtime-tracking-KYP5WOMH.js → runtime-tracking-MC74576T.js} +1 -1
  164. package/build/runtime-tracking-MC74576T.js.br +0 -0
  165. package/build/runtime-tracking-MC74576T.js.gz +0 -0
  166. package/build/{runtime-transitions-FDRKYMVP.js → runtime-transitions-S22YS7E6.js} +1 -1
  167. package/build/runtime-transitions-S22YS7E6.js.br +0 -0
  168. package/build/runtime-transitions-S22YS7E6.js.gz +0 -0
  169. package/build/{runtime-ui2d-YO6M74VQ.js → runtime-ui2d-EX3RBXPP.js} +1 -1
  170. package/build/runtime-ui2d-EX3RBXPP.js.br +0 -0
  171. package/build/runtime-ui2d-EX3RBXPP.js.gz +0 -0
  172. package/build/{runtime-updater-FS5YHXO4.js → runtime-updater-GOXAMNAK.js} +1 -1
  173. package/build/runtime-updater-GOXAMNAK.js.br +5 -0
  174. package/build/runtime-updater-GOXAMNAK.js.gz +0 -0
  175. package/build/{runtime-variables-CYDDC6HF.js → runtime-variables-36KLHNE5.js} +1 -1
  176. package/build/runtime-variables-36KLHNE5.js.br +0 -0
  177. package/build/runtime-variables-36KLHNE5.js.gz +0 -0
  178. package/build/{runtime-vectorShapes-VMDJ36X2.js → runtime-vectorShapes-J5Y3LMND.js} +1 -1
  179. package/build/runtime-vectorShapes-J5Y3LMND.js.br +0 -0
  180. package/build/runtime-vectorShapes-J5Y3LMND.js.gz +0 -0
  181. package/build/{runtime-video-MTXK33PT.js → runtime-video-XIULR4BY.js} +1 -1
  182. package/build/runtime-video-XIULR4BY.js.br +0 -0
  183. package/build/runtime-video-XIULR4BY.js.gz +0 -0
  184. package/build/runtime-webgpu-LDZ3N2D5.js +1 -0
  185. package/build/runtime-webgpu-LDZ3N2D5.js.br +0 -0
  186. package/build/runtime-webgpu-LDZ3N2D5.js.gz +0 -0
  187. package/build/runtime.cjs +102 -102
  188. package/build/runtime.js +1 -1
  189. package/build/runtime.js.br +0 -0
  190. package/build/runtime.js.gz +0 -0
  191. package/build/runtime.standalone.js +1 -1
  192. package/build/runtime.standalone.js.br +0 -0
  193. package/build/runtime.standalone.js.gz +0 -0
  194. package/build/runtime.standalone.webgl.js +1 -1
  195. package/build/runtime.standalone.webgl.js.br +0 -0
  196. package/build/runtime.standalone.webgl.js.gz +0 -0
  197. package/build/runtime.standalone.webgpu.js +1 -1
  198. package/build/runtime.standalone.webgpu.js.br +0 -0
  199. package/build/runtime.standalone.webgpu.js.gz +0 -0
  200. package/build/runtime.standalone.webgpu.micro.js +1 -1
  201. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  202. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  203. package/build/runtime.standalone.webgpu.min.js +1 -1
  204. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  205. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  206. package/package.json +1 -1
  207. package/build/runtime-aiAssistant-KA7ZJ3F6.js.br +0 -0
  208. package/build/runtime-aiAssistant-KA7ZJ3F6.js.gz +0 -0
  209. package/build/runtime-apiServices-CGMAW2B4.js.br +0 -0
  210. package/build/runtime-apiServices-CGMAW2B4.js.gz +0 -0
  211. package/build/runtime-audio-GCUGVRQ3.js.br +0 -0
  212. package/build/runtime-audio-GCUGVRQ3.js.gz +0 -0
  213. package/build/runtime-chunk-3KIZF7P5.js +0 -1
  214. package/build/runtime-chunk-3KIZF7P5.js.br +0 -0
  215. package/build/runtime-chunk-3KIZF7P5.js.gz +0 -0
  216. package/build/runtime-chunk-4DNX5FPP.js.br +0 -0
  217. package/build/runtime-chunk-4DNX5FPP.js.gz +0 -0
  218. package/build/runtime-chunk-4E4NQ6GS.js.gz +0 -0
  219. package/build/runtime-chunk-4KX4KQWR.js.br +0 -0
  220. package/build/runtime-chunk-4KX4KQWR.js.gz +0 -0
  221. package/build/runtime-chunk-AKWBEROQ.js.br +0 -0
  222. package/build/runtime-chunk-AKWBEROQ.js.gz +0 -0
  223. package/build/runtime-chunk-BPYFB4BD.js.br +0 -0
  224. package/build/runtime-chunk-BPYFB4BD.js.gz +0 -0
  225. package/build/runtime-chunk-CCJD7IX7.js +0 -1
  226. package/build/runtime-chunk-CCJD7IX7.js.br +0 -0
  227. package/build/runtime-chunk-CCJD7IX7.js.gz +0 -0
  228. package/build/runtime-chunk-CEAWQBAS.js.br +0 -0
  229. package/build/runtime-chunk-CEAWQBAS.js.gz +0 -0
  230. package/build/runtime-chunk-CX2MRLZA.js.br +0 -0
  231. package/build/runtime-chunk-CX2MRLZA.js.gz +0 -0
  232. package/build/runtime-chunk-FY3XD5P2.js.br +0 -0
  233. package/build/runtime-chunk-FY3XD5P2.js.gz +0 -0
  234. package/build/runtime-chunk-GN3HDYV2.js.br +0 -0
  235. package/build/runtime-chunk-GN3HDYV2.js.gz +0 -0
  236. package/build/runtime-chunk-GO25U5WN.js.br +0 -0
  237. package/build/runtime-chunk-GO25U5WN.js.gz +0 -0
  238. package/build/runtime-chunk-H7D3VFTJ.js.br +0 -0
  239. package/build/runtime-chunk-H7D3VFTJ.js.gz +0 -0
  240. package/build/runtime-chunk-HUFJRFTO.js.br +0 -0
  241. package/build/runtime-chunk-HUFJRFTO.js.gz +0 -0
  242. package/build/runtime-chunk-ITLS6YIC.js.br +0 -0
  243. package/build/runtime-chunk-ITLS6YIC.js.gz +0 -0
  244. package/build/runtime-chunk-JQ3A6ENO.js.br +0 -1
  245. package/build/runtime-chunk-JQ3A6ENO.js.gz +0 -0
  246. package/build/runtime-chunk-KYA2CB5O.js.br +0 -0
  247. package/build/runtime-chunk-KYA2CB5O.js.gz +0 -0
  248. package/build/runtime-chunk-LX3KCQF6.js.br +0 -0
  249. package/build/runtime-chunk-LX3KCQF6.js.gz +0 -0
  250. package/build/runtime-chunk-MM2G3DLE.js.br +0 -0
  251. package/build/runtime-chunk-MM2G3DLE.js.gz +0 -0
  252. package/build/runtime-chunk-NAJSQF6K.js.br +0 -0
  253. package/build/runtime-chunk-NAJSQF6K.js.gz +0 -0
  254. package/build/runtime-chunk-NWCLOXDY.js.br +0 -0
  255. package/build/runtime-chunk-NWCLOXDY.js.gz +0 -0
  256. package/build/runtime-chunk-OF7IZ6BI.js.br +0 -0
  257. package/build/runtime-chunk-OF7IZ6BI.js.gz +0 -0
  258. package/build/runtime-chunk-PUBEJSJO.js.br +0 -0
  259. package/build/runtime-chunk-PUBEJSJO.js.gz +0 -0
  260. package/build/runtime-chunk-R34HNX2O.js.br +0 -0
  261. package/build/runtime-chunk-R34HNX2O.js.gz +0 -0
  262. package/build/runtime-chunk-RBM3UDQF.js.br +0 -0
  263. package/build/runtime-chunk-RRXSRYPQ.js.gz +0 -0
  264. package/build/runtime-chunk-SXPM42HJ.js.br +0 -0
  265. package/build/runtime-chunk-SXPM42HJ.js.gz +0 -0
  266. package/build/runtime-chunk-XUM5HEC6.js.br +0 -0
  267. package/build/runtime-chunk-XUM5HEC6.js.gz +0 -0
  268. package/build/runtime-chunk-XXRCB3ME.js.br +0 -0
  269. package/build/runtime-chunk-XXRCB3ME.js.gz +0 -0
  270. package/build/runtime-classicRuntime-PJ7JLKSY.js.br +0 -0
  271. package/build/runtime-classicRuntime-PJ7JLKSY.js.gz +0 -0
  272. package/build/runtime-cloners-SM2IKR3Q.js +0 -1
  273. package/build/runtime-cloners-SM2IKR3Q.js.br +0 -3
  274. package/build/runtime-cloners-SM2IKR3Q.js.gz +0 -0
  275. package/build/runtime-components-VRLLFORJ.js.br +0 -0
  276. package/build/runtime-components-VRLLFORJ.js.gz +0 -0
  277. package/build/runtime-conditional-VA7AKA6O.js.br +0 -0
  278. package/build/runtime-conditional-VA7AKA6O.js.gz +0 -0
  279. package/build/runtime-createDestroy-IQVBLQ24.js.br +0 -0
  280. package/build/runtime-createDestroy-IQVBLQ24.js.gz +0 -0
  281. package/build/runtime-dragDrop-XFI62H3C.js.br +0 -0
  282. package/build/runtime-dragDrop-XFI62H3C.js.gz +0 -0
  283. package/build/runtime-gameControls-W3YS7OS2.js.br +0 -0
  284. package/build/runtime-gameControls-W3YS7OS2.js.gz +0 -0
  285. package/build/runtime-hair-CWPDHNZF.js +0 -1
  286. package/build/runtime-hair-CWPDHNZF.js.br +0 -1
  287. package/build/runtime-hair-CWPDHNZF.js.gz +0 -0
  288. package/build/runtime-mergeStaticGeometries-KJFDZ7TP.js.br +0 -0
  289. package/build/runtime-mergeStaticGeometries-KJFDZ7TP.js.gz +0 -0
  290. package/build/runtime-miscActions-UGVVC2QC.js.br +0 -0
  291. package/build/runtime-miscActions-UGVVC2QC.js.gz +0 -0
  292. package/build/runtime-mouseHover-O7Y26SM5.js.br +0 -0
  293. package/build/runtime-mouseHover-O7Y26SM5.js.gz +0 -0
  294. package/build/runtime-particles-GFRULQXO.js.br +0 -0
  295. package/build/runtime-particles-GFRULQXO.js.gz +0 -0
  296. package/build/runtime-paths-Q7I56BAX.js.br +0 -0
  297. package/build/runtime-paths-Q7I56BAX.js.gz +0 -0
  298. package/build/runtime-resize-2ZFLSK2M.js.br +0 -0
  299. package/build/runtime-resize-2ZFLSK2M.js.gz +0 -0
  300. package/build/runtime-sceneTransition-Z65VROHI.js.br +0 -0
  301. package/build/runtime-sceneTransition-Z65VROHI.js.gz +0 -0
  302. package/build/runtime-scroll-NWKW6A6L.js.br +0 -0
  303. package/build/runtime-scroll-NWKW6A6L.js.gz +0 -0
  304. package/build/runtime-shapeBlends-QB7JKEHC.js +0 -1
  305. package/build/runtime-shapeBlends-QB7JKEHC.js.br +0 -5
  306. package/build/runtime-shapeBlends-QB7JKEHC.js.gz +0 -0
  307. package/build/runtime-text-VK3OGBSY.js.br +0 -0
  308. package/build/runtime-text-VK3OGBSY.js.gz +0 -0
  309. package/build/runtime-textInputs-JJQSKO3C.js.br +0 -0
  310. package/build/runtime-textInputs-JJQSKO3C.js.gz +0 -0
  311. package/build/runtime-timeline-WRAEBCRZ.js +0 -1
  312. package/build/runtime-timeline-WRAEBCRZ.js.br +0 -0
  313. package/build/runtime-timeline-WRAEBCRZ.js.gz +0 -0
  314. package/build/runtime-tracking-KYP5WOMH.js.br +0 -0
  315. package/build/runtime-tracking-KYP5WOMH.js.gz +0 -0
  316. package/build/runtime-transitions-FDRKYMVP.js.br +0 -0
  317. package/build/runtime-transitions-FDRKYMVP.js.gz +0 -0
  318. package/build/runtime-ui2d-YO6M74VQ.js.br +0 -0
  319. package/build/runtime-ui2d-YO6M74VQ.js.gz +0 -0
  320. package/build/runtime-updater-FS5YHXO4.js.br +0 -1
  321. package/build/runtime-updater-FS5YHXO4.js.gz +0 -0
  322. package/build/runtime-variables-CYDDC6HF.js.br +0 -0
  323. package/build/runtime-variables-CYDDC6HF.js.gz +0 -0
  324. package/build/runtime-vectorShapes-VMDJ36X2.js.br +0 -0
  325. package/build/runtime-vectorShapes-VMDJ36X2.js.gz +0 -0
  326. package/build/runtime-video-MTXK33PT.js.br +0 -0
  327. package/build/runtime-video-MTXK33PT.js.gz +0 -0
  328. package/build/runtime-webgpu-WDY6L7BV.js +0 -1
  329. package/build/runtime-webgpu-WDY6L7BV.js.br +0 -0
  330. package/build/runtime-webgpu-WDY6L7BV.js.gz +0 -0
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-RRXSRYPQ.js";import{a as e,b as r}from"./runtime-chunk-T53JMQSH.js";import{B as i,n}from"./runtime-chunk-SXPM42HJ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-4KX4KQWR.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-R34HNX2O.js";import{a as s,f as a,h as o}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-RBM3UDQF.js";import{Dc as h,Jd as l,Ld as u,Nd as c,Qd as f,Qe as d,Rd as p,Sd as g,Tc as y}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var m=class{constructor(){this.type="ShapePath",this.color=new y,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new f,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath?.lineTo(t,e),this}quadraticCurveTo(t,e,r,i){return this.currentPath?.quadraticCurveTo(t,e,r,i),this}bezierCurveTo(t,e,r,i,n,s){return this.currentPath?.bezierCurveTo(t,e,r,i,n,s),this}splineThru(t){return this.currentPath?.splineThru(t),this}toShapes(){let t={loc:0,t:0};function e(e,i,n,s){let a=e.x,o=i.x,h=n.x,l=s.x,u=e.y,c=i.y,f=n.y,d=s.y,p=(l-h)*(u-f)-(d-f)*(a-h),g=(d-f)*(o-a)-(l-h)*(c-u),y=p/g,m=((o-a)*(u-f)-(c-u)*(a-h))/g;if(0===g&&0!==p||y<=0||y>=1||m<0||m>1)return null;if(0===p&&0===g){for(let h=0;h<2;h++){if(r(0===h?n:s,e,i),0===t.loc){let e=0===h?n:s;return{x:e.x,y:e.y,t:t.t}}if(2===t.loc)return{x:+(a+t.t*(o-a)).toPrecision(10),y:+(u+t.t*(c-u)).toPrecision(10),t:t.t}}return null}for(let a=0;a<2;a++)if(r(0===a?n:s,e,i),0===t.loc){let e=0===a?n:s;return{x:e.x,y:e.y,t:t.t}}return{x:+(a+y*(o-a)).toPrecision(10),y:+(u+y*(c-u)).toPrecision(10),t:y}}function r(e,r,i){let n,s=i.x-r.x,a=i.y-r.y,o=e.x-r.x,h=e.y-r.y,l=s*h-o*a;return e.x===r.x&&e.y===r.y?(t.loc=0,void(t.t=0)):e.x===i.x&&e.y===i.y?(t.loc=1,void(t.t=1)):void(l<-Number.EPSILON?t.loc=3:l>Number.EPSILON?t.loc=4:s*o<0||a*h<0?t.loc=5:Math.sqrt(s*s+a*a)<Math.sqrt(o*o+h*h)?t.loc=6:(n=0!==s?o/s:h/a,t.loc=2,t.t=n))}let i=0,n=999999999,s=-999999999,a=[];this.subPaths.forEach(t=>{let e=t.getPoints(),r=-999999999,o=999999999,l=-999999999,u=999999999;for(let t=0;t<e.length;t++){let i=e[t];i.y>r&&(r=i.y),i.y<o&&(o=i.y),i.x>l&&(l=i.x),i.x<u&&(u=i.x)}s<=l&&(s=l+1),n>=u&&(n=u-1),e.length&&a.push({curves:t.curves,points:e,isCW:g.isClockWise(e),identifier:i++,boundingBox:new d(new h(u,o),new h(l,r))})});let o=a.map(t=>function(t,r,i,n,s){(null==s||""===s)&&(s="nonzero");let a=new h;t.boundingBox.getCenter(a);let o=function(t,r,i){let n=new h;r.getCenter(n);let s=[];return i.forEach(r=>{r.boundingBox.containsPoint(n)&&function(t,r){let i=[],n=[];for(let s=1;s<t.length;s++){let a=t[s-1],o=t[s];for(let t=1;t<r.length;t++){let s=e(a,o,r[t-1],r[t]);null!==s&&void 0===i.find(t=>t.t<=s.t+Number.EPSILON&&t.t>=s.t-Number.EPSILON)&&(i.push(s),n.push(new h(s.x,s.y)))}}return n}(t,r.points).forEach(t=>{s.push({identifier:r.identifier,isCW:r.isCW,point:t})})}),s.sort((t,e)=>t.point.x-e.point.x),s}([new h(i,a.y),new h(n,a.y)],t.boundingBox,r);o.sort((t,e)=>t.point.x-e.point.x);let l=[],u=[];o.forEach(e=>{e.identifier===t.identifier?l.push(e):u.push(e)});let c=l[0].point.x,f=[],d=0;for(;d<u.length&&u[d].point.x<c;)f.length>0&&f[f.length-1]===u[d].identifier?f.pop():f.push(u[d].identifier),d++;if(f.push(t.identifier),"evenodd"===s){let e=f.length%2==0,r=f[f.length-2];return{identifier:t.identifier,isHole:e,for:r}}if("nonzero"===s){let e=!0,i=null,n=null;for(let t=0;t<f.length;t++){let s=f[t];r[s]&&(e?(n=r[s].isCW,e=!1,i=s):n!==r[s].isCW&&(n=r[s].isCW,e=!0))}return{identifier:t.identifier,isHole:e,for:i}}console.warn('fill-rule: "'+s+'" is currently not implemented.')}(t,a,n,s,this.userData?.style.fillRule)),l=[];return a.forEach(t=>{let e=o[t.identifier];if(e&&!e.isHole){let e=new p;e.curves=t.curves,o.filter(e=>e?.isHole&&e.for===t.identifier).forEach(t=>{if(t){let r=a[t.identifier],i=new f;i.curves=r.curves,e.holes.push(i)}}),l.push(e)}}),l}},x=new class{async load(t,e,i=()=>{}){let{load:n}=await r;n(t,(t,r)=>{t||!r?i(t??"Something went wrong"):e(r)})}async parse(t){let{parse:e,Bidi:i}=await r;try{let r=e(t),n=new i,s=t=>r.charToGlyphIndex(t.char);return n.registerModifier("glyphIndex",null,s),n.applyFeatures(r,r.defaultRenderOptions.features),{font:r,bidi:n}}catch(t){console.error(t)}}};function w(t,e){return e.state.glyphIndex===t||e.state.fina===t||e.state.medi===t||e.state.init===t}a("TextGeometry",(e,r,i)=>new t(e,r,i));var b={create:(t,e)=>new i(t,e)};o("TextGeometry",b),o("InputGeometry",b),n(class{constructor(t){this._arrayBuffer=new ArrayBuffer(1),this._isLoaded=!1,this._intercepted=!1,this._layoutErrorWarned=!1,this._isUserFont=t.isUserFont??!1,this._loadingPromise=this.load(t)}update(t){this._isLoaded=!1,this._isUserFont=t.isUserFont??!1,this._loadingPromise=this.load(t)}async load(t){try{this._layoutErrorWarned=!1;let r=await async function(t){let r,i,n=!1;if(t.url?(r=await async function(t){let e;try{e=await fetch(t)}catch(e){throw new Error(`could not fetch the font at ${t}: ${e}`)}if(!e.ok)throw new Error(`${e.status} ${e.statusText} fetching the font at ${t}`);return await e.arrayBuffer()}(t.url),i=t.url,n=t.url.startsWith("/")):t.data&&(r=t.data.buffer.slice(t.data.byteOffset,t.data.byteOffset+t.data.byteLength)),r){if(!e)return{font:void 0,url:i,intercepted:n,arr:r,bidi:null};{let t=await x.parse(r);if(t)return{font:t.font,url:i,intercepted:n,arr:r,bidi:t.bidi}}}}(t);r&&(this._arrayBuffer=r.arr,this._url=r.url,this.font=r.font,this._intercepted=r.intercepted,this._isLoaded=!0,this._bidi=r.bidi)}catch(e){console.warn(`Could not load the font "${t.url??"(inline data)"}"`,e)}}warnLayoutError(t){this._layoutErrorWarned||(this._layoutErrorWarned=!0,console.warn(`Text layout failed for the font "${this._url??"(inline data)"}"`,t))}get url(){return this._url}get intercepted(){return this._intercepted}get isLoaded(){return this._isLoaded}get loadingPromise(){return this._loadingPromise}reverseLigaturesTable(t,e,r){if(!this._bidi)return[];let i=this._bidi;i.getTextGlyphs(e);let n=i.tokenizer.tokens,s=[],a=0,o=r.length===n.length;for(let i=0;i<r.length;i++){let h=r[i].index,l=String.fromCharCode(r[i].unicode),u=n[a];if(w(h,u)||o)s.push({char:l,index:h,replacements:[u.state.glyphIndex],replacementChars:[u.char]}),a++;else{let r=u.char,i="",n=[u.state.glyphIndex],o=[],c=!1;for(;!c;)a++,i=e.charAt(a),r+=i,n.push(t.charToGlyphIndex(i)),o=t.stringToGlyphs(r),1===o.length&&o[0].index===h&&(c=!0),a>e.length&&(c=!0);s.push({char:l,index:h,replacements:n,replacementChars:Array.from(r)}),a++}}return s}generateShapes(t,e,r){if(!this._isLoaded)return;let i=this.font,n=e.fontSize/this.unitsPerEm,s=e.fontSize*e.lineHeight,a=t.map(t=>this.getTextWidth(t,e)),o="string"==typeof e.width?Number(r.getVariable(e.width)):e.width,h="string"==typeof e.height?Number(r.getVariable(e.height)):e.height,l=this.getCharWidth("\n",e),u=1===e.horizontalAlign?l:0,c=this.getLineInitialOffsetX(a[0],o,e.horizontalAlign,t[0],l),f=this.getLineInitialOffsetY(s,t.length,h,n,e.verticalAlign),d=[],p=t.map(()=>[]),g=t.map(()=>[]);for(let h=0;h<t.length;h++){let y=t[h],m={features:{liga:!0},letterSpacing:e.letterSpacing},x=[];try{x=i.stringToGlyphs(y,m)}catch(t){this.warnLayoutError(t)}c=this.getLineInitialOffsetX(a[h],o,e.horizontalAlign,y,l);let w=[];try{w=this.reverseLigaturesTable(i,y,x)}catch(t){this.warnLayoutError(t)}let b=this.computeSpaceWidthForLine(t,h,e,r),P=0,S=x[0];S&&2===e.horizontalAlign&&void 0!==S.leftSideBearing&&(c-=S.leftSideBearing*n);try{this.font?.forEachGlyph(y,c,f,e.fontSize,m,(t,r,s,a,o)=>{let l=0===t.index?"\n":t.unicode?String.fromCharCode(t.unicode):void 0,c=w[P],f=0;if("\n"===l)f=u;else if(" "===l)f=b;else{let i=this.createPath(t,n,r,s,e);i&&(f=i.offsetX,d.push(i.path))}if(c&&1!==c.replacements.length){let t=c.replacements.map(t=>(i.glyphs.get(t).advanceWidth??0)*n),e=t.reduce((t,e)=>t+e,0),a=t.map(t=>t/e),o=r;for(let t=0;t<a.length;t++){let e=f*a[t];g[h].push([o,s]),p[h].push(e),o+=e}}else g[h].push([r,s]),p[h].push(f);P++})}catch(t){this.warnLayoutError(t)}f-=s}let y=[];for(let t=0,e=d.length;t<e;t++)y.push(...d[t].toShapes());return{shapes:y,charWidths:p,lineWidths:a,charCoords:g}}get isUserFont(){return this._isUserFont}get arrayBuffer(){return this._arrayBuffer}get ascender(){return this.font?.ascender??0}get descender(){return this.font?.descender??0}get familyName(){return this.font?.names.fontFamily??""}get subfamilyName(){return this.font?.names.fontSubfamily??""}get unitsPerEm(){return this.font?.unitsPerEm??1}getLineInitialOffsetX(t,e,r,i,n){return(3===r||2===r)&&i.indexOf("\n")>=0&&(t-=n),3===r?.5*e-.5*t:2===r?e-t:0}getLineInitialOffsetY(t,e,r,i,n){let s=e*t,a=t-Math.abs(this.ascender-this.descender)*i,o=-this.ascender*i-a/2;return 3===n?-(r-s-o):2===n?-(.5*r-.5*s-o):o}createPath(t,e,r,i,n){let s=t.getPath(r,-i,n.fontSize,{kerning:!1,letterSpacing:n.letterSpacing});if(!s)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+this.familyName+".");let a=new m,o=(t.advanceWidth??1)*e;if(t)for(let t of s.commands){let e=a.currentPath?.currentPoint;if(!e||"Z"===t.type||e.x!==t.x||-e.y!==t.y)switch(t.type){case"M":a.moveTo(t.x,-t.y);break;case"L":a.lineTo(t.x,-t.y);break;case"Q":a.quadraticCurveTo(t.x1,-t.y1,t.x,-t.y);break;case"C":a.bezierCurveTo(t.x1,-t.y1,t.x2,-t.y2,t.x,-t.y)}}return a.subPaths.forEach(t=>{let e=function(t){if(t.length){let e=t[0];if(e instanceof u)return e.v1;if(e instanceof l||e instanceof c)return e.v0}}(t.curves);void 0!==e&&t.currentPoint.distanceTo(e)>0&&t.lineTo(e.x,e.y)}),{offsetX:o,path:a}}getCharWidth(t,e){try{return this.font?.getAdvanceWidth(t,e.fontSize,{kerning:!0,letterSpacing:e.letterSpacing})??0}catch(t){return this.warnLayoutError(t),0}}getTextWidth(t,e){try{return this.font?.getAdvanceWidth(t,e.fontSize,{kerning:!0,letterSpacing:e.letterSpacing})??0}catch(t){return this.warnLayoutError(t),0}}computeSpaceWidthForLine(t,e,r,i){let n=this.getCharWidth(" ",r),s=t[e];if(s){let a=this.countSpaces(s.trimEnd());if(4===r.horizontalAlign&&e<t.length-1&&a)return(("string"==typeof r.width?Number(i.getVariable(r.width)):r.width)-(this.getTextWidth(s,r)-a*n))/a}return n}countSpaces(t){return(t.match(/ /g)||[]).length}}),s("text");
1
+ import{a as t}from"./runtime-chunk-PDASWDVC.js";import{a as e,b as r}from"./runtime-chunk-T53JMQSH.js";import{B as i,n}from"./runtime-chunk-DK66VKWP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-CKT62HES.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-U4QOT2PX.js";import{a as s,f as a,h as o}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-VPEJ5BFD.js";import{Dc as h,Jd as l,Ld as u,Nd as c,Qd as f,Qe as d,Rd as p,Sd as g,Tc as y}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var m=class{constructor(){this.type="ShapePath",this.color=new y,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new f,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath?.lineTo(t,e),this}quadraticCurveTo(t,e,r,i){return this.currentPath?.quadraticCurveTo(t,e,r,i),this}bezierCurveTo(t,e,r,i,n,s){return this.currentPath?.bezierCurveTo(t,e,r,i,n,s),this}splineThru(t){return this.currentPath?.splineThru(t),this}toShapes(){let t={loc:0,t:0};function e(e,i,n,s){let a=e.x,o=i.x,h=n.x,l=s.x,u=e.y,c=i.y,f=n.y,d=s.y,p=(l-h)*(u-f)-(d-f)*(a-h),g=(d-f)*(o-a)-(l-h)*(c-u),y=p/g,m=((o-a)*(u-f)-(c-u)*(a-h))/g;if(0===g&&0!==p||y<=0||y>=1||m<0||m>1)return null;if(0===p&&0===g){for(let h=0;h<2;h++){if(r(0===h?n:s,e,i),0===t.loc){let e=0===h?n:s;return{x:e.x,y:e.y,t:t.t}}if(2===t.loc)return{x:+(a+t.t*(o-a)).toPrecision(10),y:+(u+t.t*(c-u)).toPrecision(10),t:t.t}}return null}for(let a=0;a<2;a++)if(r(0===a?n:s,e,i),0===t.loc){let e=0===a?n:s;return{x:e.x,y:e.y,t:t.t}}return{x:+(a+y*(o-a)).toPrecision(10),y:+(u+y*(c-u)).toPrecision(10),t:y}}function r(e,r,i){let n,s=i.x-r.x,a=i.y-r.y,o=e.x-r.x,h=e.y-r.y,l=s*h-o*a;return e.x===r.x&&e.y===r.y?(t.loc=0,void(t.t=0)):e.x===i.x&&e.y===i.y?(t.loc=1,void(t.t=1)):void(l<-Number.EPSILON?t.loc=3:l>Number.EPSILON?t.loc=4:s*o<0||a*h<0?t.loc=5:Math.sqrt(s*s+a*a)<Math.sqrt(o*o+h*h)?t.loc=6:(n=0!==s?o/s:h/a,t.loc=2,t.t=n))}let i=0,n=999999999,s=-999999999,a=[];this.subPaths.forEach(t=>{let e=t.getPoints(),r=-999999999,o=999999999,l=-999999999,u=999999999;for(let t=0;t<e.length;t++){let i=e[t];i.y>r&&(r=i.y),i.y<o&&(o=i.y),i.x>l&&(l=i.x),i.x<u&&(u=i.x)}s<=l&&(s=l+1),n>=u&&(n=u-1),e.length&&a.push({curves:t.curves,points:e,isCW:g.isClockWise(e),identifier:i++,boundingBox:new d(new h(u,o),new h(l,r))})});let o=a.map(t=>function(t,r,i,n,s){(null==s||""===s)&&(s="nonzero");let a=new h;t.boundingBox.getCenter(a);let o=function(t,r,i){let n=new h;r.getCenter(n);let s=[];return i.forEach(r=>{r.boundingBox.containsPoint(n)&&function(t,r){let i=[],n=[];for(let s=1;s<t.length;s++){let a=t[s-1],o=t[s];for(let t=1;t<r.length;t++){let s=e(a,o,r[t-1],r[t]);null!==s&&void 0===i.find(t=>t.t<=s.t+Number.EPSILON&&t.t>=s.t-Number.EPSILON)&&(i.push(s),n.push(new h(s.x,s.y)))}}return n}(t,r.points).forEach(t=>{s.push({identifier:r.identifier,isCW:r.isCW,point:t})})}),s.sort((t,e)=>t.point.x-e.point.x),s}([new h(i,a.y),new h(n,a.y)],t.boundingBox,r);o.sort((t,e)=>t.point.x-e.point.x);let l=[],u=[];o.forEach(e=>{e.identifier===t.identifier?l.push(e):u.push(e)});let c=l[0].point.x,f=[],d=0;for(;d<u.length&&u[d].point.x<c;)f.length>0&&f[f.length-1]===u[d].identifier?f.pop():f.push(u[d].identifier),d++;if(f.push(t.identifier),"evenodd"===s){let e=f.length%2==0,r=f[f.length-2];return{identifier:t.identifier,isHole:e,for:r}}if("nonzero"===s){let e=!0,i=null,n=null;for(let t=0;t<f.length;t++){let s=f[t];r[s]&&(e?(n=r[s].isCW,e=!1,i=s):n!==r[s].isCW&&(n=r[s].isCW,e=!0))}return{identifier:t.identifier,isHole:e,for:i}}console.warn('fill-rule: "'+s+'" is currently not implemented.')}(t,a,n,s,this.userData?.style.fillRule)),l=[];return a.forEach(t=>{let e=o[t.identifier];if(e&&!e.isHole){let e=new p;e.curves=t.curves,o.filter(e=>e?.isHole&&e.for===t.identifier).forEach(t=>{if(t){let r=a[t.identifier],i=new f;i.curves=r.curves,e.holes.push(i)}}),l.push(e)}}),l}},x=new class{async load(t,e,i=()=>{}){let{load:n}=await r;n(t,(t,r)=>{t||!r?i(t??"Something went wrong"):e(r)})}async parse(t){let{parse:e,Bidi:i}=await r;try{let r=e(t),n=new i,s=t=>r.charToGlyphIndex(t.char);return n.registerModifier("glyphIndex",null,s),n.applyFeatures(r,r.defaultRenderOptions.features),{font:r,bidi:n}}catch(t){console.error(t)}}};function w(t,e){return e.state.glyphIndex===t||e.state.fina===t||e.state.medi===t||e.state.init===t}a("TextGeometry",(e,r,i)=>new t(e,r,i));var b={create:(t,e)=>new i(t,e)};o("TextGeometry",b),o("InputGeometry",b),n(class{constructor(t){this._arrayBuffer=new ArrayBuffer(1),this._isLoaded=!1,this._intercepted=!1,this._layoutErrorWarned=!1,this._isUserFont=t.isUserFont??!1,this._loadingPromise=this.load(t)}update(t){this._isLoaded=!1,this._isUserFont=t.isUserFont??!1,this._loadingPromise=this.load(t)}async load(t){try{this._layoutErrorWarned=!1;let r=await async function(t){let r,i,n=!1;if(t.url?(r=await async function(t){let e;try{e=await fetch(t)}catch(e){throw new Error(`could not fetch the font at ${t}: ${e}`)}if(!e.ok)throw new Error(`${e.status} ${e.statusText} fetching the font at ${t}`);return await e.arrayBuffer()}(t.url),i=t.url,n=t.url.startsWith("/")):t.data&&(r=t.data.buffer.slice(t.data.byteOffset,t.data.byteOffset+t.data.byteLength)),r){if(!e)return{font:void 0,url:i,intercepted:n,arr:r,bidi:null};{let t=await x.parse(r);if(t)return{font:t.font,url:i,intercepted:n,arr:r,bidi:t.bidi}}}}(t);r&&(this._arrayBuffer=r.arr,this._url=r.url,this.font=r.font,this._intercepted=r.intercepted,this._isLoaded=!0,this._bidi=r.bidi)}catch(e){console.warn(`Could not load the font "${t.url??"(inline data)"}"`,e)}}warnLayoutError(t){this._layoutErrorWarned||(this._layoutErrorWarned=!0,console.warn(`Text layout failed for the font "${this._url??"(inline data)"}"`,t))}get url(){return this._url}get intercepted(){return this._intercepted}get isLoaded(){return this._isLoaded}get loadingPromise(){return this._loadingPromise}reverseLigaturesTable(t,e,r){if(!this._bidi)return[];let i=this._bidi;i.getTextGlyphs(e);let n=i.tokenizer.tokens,s=[],a=0,o=r.length===n.length;for(let i=0;i<r.length;i++){let h=r[i].index,l=String.fromCharCode(r[i].unicode),u=n[a];if(w(h,u)||o)s.push({char:l,index:h,replacements:[u.state.glyphIndex],replacementChars:[u.char]}),a++;else{let r=u.char,i="",n=[u.state.glyphIndex],o=[],c=!1;for(;!c;)a++,i=e.charAt(a),r+=i,n.push(t.charToGlyphIndex(i)),o=t.stringToGlyphs(r),1===o.length&&o[0].index===h&&(c=!0),a>e.length&&(c=!0);s.push({char:l,index:h,replacements:n,replacementChars:Array.from(r)}),a++}}return s}generateShapes(t,e,r){if(!this._isLoaded)return;let i=this.font,n=e.fontSize/this.unitsPerEm,s=e.fontSize*e.lineHeight,a=t.map(t=>this.getTextWidth(t,e)),o="string"==typeof e.width?Number(r.getVariable(e.width)):e.width,h="string"==typeof e.height?Number(r.getVariable(e.height)):e.height,l=this.getCharWidth("\n",e),u=1===e.horizontalAlign?l:0,c=this.getLineInitialOffsetX(a[0],o,e.horizontalAlign,t[0],l),f=this.getLineInitialOffsetY(s,t.length,h,n,e.verticalAlign),d=[],p=t.map(()=>[]),g=t.map(()=>[]);for(let h=0;h<t.length;h++){let y=t[h],m={features:{liga:!0},letterSpacing:e.letterSpacing},x=[];try{x=i.stringToGlyphs(y,m)}catch(t){this.warnLayoutError(t)}c=this.getLineInitialOffsetX(a[h],o,e.horizontalAlign,y,l);let w=[];try{w=this.reverseLigaturesTable(i,y,x)}catch(t){this.warnLayoutError(t)}let b=this.computeSpaceWidthForLine(t,h,e,r),P=0,S=x[0];S&&2===e.horizontalAlign&&void 0!==S.leftSideBearing&&(c-=S.leftSideBearing*n);try{this.font?.forEachGlyph(y,c,f,e.fontSize,m,(t,r,s,a,o)=>{let l=0===t.index?"\n":t.unicode?String.fromCharCode(t.unicode):void 0,c=w[P],f=0;if("\n"===l)f=u;else if(" "===l)f=b;else{let i=this.createPath(t,n,r,s,e);i&&(f=i.offsetX,d.push(i.path))}if(c&&1!==c.replacements.length){let t=c.replacements.map(t=>(i.glyphs.get(t).advanceWidth??0)*n),e=t.reduce((t,e)=>t+e,0),a=t.map(t=>t/e),o=r;for(let t=0;t<a.length;t++){let e=f*a[t];g[h].push([o,s]),p[h].push(e),o+=e}}else g[h].push([r,s]),p[h].push(f);P++})}catch(t){this.warnLayoutError(t)}f-=s}let y=[];for(let t=0,e=d.length;t<e;t++)y.push(...d[t].toShapes());return{shapes:y,charWidths:p,lineWidths:a,charCoords:g}}get isUserFont(){return this._isUserFont}get arrayBuffer(){return this._arrayBuffer}get ascender(){return this.font?.ascender??0}get descender(){return this.font?.descender??0}get familyName(){return this.font?.names.fontFamily??""}get subfamilyName(){return this.font?.names.fontSubfamily??""}get unitsPerEm(){return this.font?.unitsPerEm??1}getLineInitialOffsetX(t,e,r,i,n){return(3===r||2===r)&&i.indexOf("\n")>=0&&(t-=n),3===r?.5*e-.5*t:2===r?e-t:0}getLineInitialOffsetY(t,e,r,i,n){let s=e*t,a=t-Math.abs(this.ascender-this.descender)*i,o=-this.ascender*i-a/2;return 3===n?-(r-s-o):2===n?-(.5*r-.5*s-o):o}createPath(t,e,r,i,n){let s=t.getPath(r,-i,n.fontSize,{kerning:!1,letterSpacing:n.letterSpacing});if(!s)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+this.familyName+".");let a=new m,o=(t.advanceWidth??1)*e;if(t)for(let t of s.commands){let e=a.currentPath?.currentPoint;if(!e||"Z"===t.type||e.x!==t.x||-e.y!==t.y)switch(t.type){case"M":a.moveTo(t.x,-t.y);break;case"L":a.lineTo(t.x,-t.y);break;case"Q":a.quadraticCurveTo(t.x1,-t.y1,t.x,-t.y);break;case"C":a.bezierCurveTo(t.x1,-t.y1,t.x2,-t.y2,t.x,-t.y)}}return a.subPaths.forEach(t=>{let e=function(t){if(t.length){let e=t[0];if(e instanceof u)return e.v1;if(e instanceof l||e instanceof c)return e.v0}}(t.curves);void 0!==e&&t.currentPoint.distanceTo(e)>0&&t.lineTo(e.x,e.y)}),{offsetX:o,path:a}}getCharWidth(t,e){try{return this.font?.getAdvanceWidth(t,e.fontSize,{kerning:!0,letterSpacing:e.letterSpacing})??0}catch(t){return this.warnLayoutError(t),0}}getTextWidth(t,e){try{return this.font?.getAdvanceWidth(t,e.fontSize,{kerning:!0,letterSpacing:e.letterSpacing})??0}catch(t){return this.warnLayoutError(t),0}}computeSpaceWidthForLine(t,e,r,i){let n=this.getCharWidth(" ",r),s=t[e];if(s){let a=this.countSpaces(s.trimEnd());if(4===r.horizontalAlign&&e<t.length-1&&a)return(("string"==typeof r.width?Number(i.getVariable(r.width)):r.width)-(this.getTextWidth(s,r)-a*n))/a}return n}countSpaces(t){return(t.match(/ /g)||[]).length}}),s("text");
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-RRXSRYPQ.js";import{a as e,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as s}from"./runtime-chunk-VAVYZ35B.js";import{c as n}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-SXPM42HJ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-4KX4KQWR.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-R34HNX2O.js";import{a as r,f as a}from"./runtime-chunk-TZCHGFVF.js";import{D as o,Ha as h}from"./runtime-chunk-RBM3UDQF.js";import{Dc as l,Fc as p,Gc as u,Sc as d,Vc as c,Vd as g,bd as m,dd as x,kd as v,l as y,ld as M,rd as I}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var f=class extends t{constructor(t,e,i){super(t,e,i),this.data=e}},C=class extends d{constructor(){super(),this.caretIndex=0,this._caretVisibleAlpha=1,this._selectionVisibleAlpha=.3,this.current={start:0,end:void 0},this.matrixAutoUpdate=!1,this.caretMesh=new M(new g(1,1),new v({transparent:!0,opacity:0,side:y})),this.add(this.caretMesh),this.selectionMesh=new M(new g(1,1),new v({color:2857471,transparent:!0,depthTest:!1,depthWrite:!1,opacity:0,side:y})),this.add(this.selectionMesh),this.hide()}get caretHeight(){return this.object?.AD??0}show(t){this.visible=!0,this.object=t,this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.y=.5*-this.caretHeight,this.setCaretPosition(this.caretIndex),this.update()}hide(){this.visible=!1}update(){if(void 0===this.object)return;this.updateHelperMatrix();let{depth:t}=this.object.geometry.userData.parameters;this.caretMesh.position.z=t,this.selectionMesh.position.z=t}updateHelperMatrix(){if(void 0===this.object)return;let t=this.object,e=t.parent;null!==e&&e.updateWorldMatrix(!0,!1),t.matrixAutoUpdate&&t.updateMatrix(),null!==e?(this.matrixWorld.multiplyMatrices(e.matrixWorld,t.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,t.matrix)):this.matrixWorld.multiplyMatrices(t.hiddenMatrix,t.matrix),this.matrix.copy(this.matrixWorld);for(let t of this.children)t.matrixWorld.copy(this.matrixWorld);t.updateWorldMatrix(!0,!0)}setCaretColor(t){let e=this.caretMesh.material;e.color.setRGB(t.r,t.g,t.b);let i=this._caretVisibleAlpha===e.opacity;this._caretVisibleAlpha=t.a,i&&(e.opacity=this._caretVisibleAlpha)}setSelectionColor(t){this.selectionMesh.material.color.setRGB(t.r,t.g,t.b)}setCaretPosition(t,e={}){if(void 0===this.object)return;this.caretIndex=t;let i=this.object.wrappedText,[s,n]=_(i,t),[r,a]=t>0?_(i,t-1):[null,null];"\n"===(t>0&&i.length?i[r].charAt(a):null)&&(s++,n=0),this.current.start=t,this.current.end=void 0;let[o,h]=b(this.object,s,n),{AD:l,descender:p}=this.object,u=p+.5*l,{width:d,height:c,depth:g}=this.object.geometry.userData.parameters,m="string"==typeof d?0:d,x="string"==typeof c?0:c;this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.set(o-.5*m,h+u+.5*x,g),this.hideSelectionMesh(),this.showCaretMesh()}setSelection(t,e){if(void 0===this.object)return;let i=this.object.wrappedText;this.current.start=t,this.current.end=e;let s=[],n=[],r=function(t,e,i){let[s,n]=_(t,e),[r,a]=_(t,i),o=[];n>=t[s].length&&(s++,n=0);for(let e=s;e<=r;e++){let i=t[e],h=e===s?n:0,l=e===r?a:i.length;o.push([e,h,l])}return o}(i,t,e),{lineHeight:a,AD:o,descender:h}=this.object,l=h+.5*o-.5*a;for(let[t,e,i]of r)if(e!==i){let[r,o]=b(this.object,t,e),[h,p]=b(this.object,t,i),u=o,d=p;u+=l,d+=l,d+=a;let c=s.length/3;s.push(r,u,0),s.push(h,u,0),s.push(h,d,0),s.push(r,d,0),n.push(c+0,c+1,c+2),n.push(c+2,c+3,c+0)}let p=new x;p.setIndex(n),p.setAttribute("position",new m(s,3));let{width:u,height:d,depth:c}=this.object.geometry.userData.parameters,g="string"==typeof u?0:u,v="string"==typeof d?0:d;this.selectionMesh.geometry.dispose(),this.selectionMesh.geometry=p,this.selectionMesh.position.x=.5*-g,this.selectionMesh.position.y=.5*v,this.selectionMesh.position.z=c,this.showSelectionMesh(),this.hideCaretMesh()}getSelectionFromPosition(t,e,i="previous"){if(void 0===this.object||void 0===this.object.font)return;let s=this.object.wrappedText,n=s.length,r=this.object.lineHeight,a=n*r,{height:o,verticalAlign:h}=this.object.geometry.userData.parameters,l="string"==typeof o?0:o,p=0;3===h?p=l-a:2===h&&(p=.5*l-.5*a);let u=Math.min(Math.floor(Math.max(Math.min(-e-p,a),0)/r),n-1),d=this.object.charCoords[u],c=this.object.charWidths[u],g=0,m=!1;if("previous"===i){for(let e=0;e<d.length;e++)if(d[e][0]+.5*c[e]-t>0){g=e,m=!0;break}}else if("closest"===i){let e=1/0;for(let i=0;i<d.length;i++){let s=d[i][0]+.5*c[i],n=Math.abs(s-t);n<e&&(e=n,g=i,m=!0)}}else for(let e=0;e<d.length;e++){let i=d[e][0],s=d[e][0]+c[e];if(t>=i&&t<s){g=e,m=!0;break}}return m||(g=d.length),{index:this.getGlobalIndexFromLineAndCharIndexes(s,u,g),lineIndex:u,characterIndex:g}}getGlobalIndexFromLineAndCharIndexes(t,e,i){return t.slice(0,e).reduce((t,e)=>t+e.length,0)+i}showSelectionMesh(){this.selectionMesh.material.opacity=this._selectionVisibleAlpha}hideSelectionMesh(){this.selectionMesh.material.opacity=0}showCaretMesh(){this.caretMesh.material.opacity=this._caretVisibleAlpha}hideCaretMesh(){this.caretMesh.material.opacity=0}};function b(t,e,i){let{charCoords:s,charWidths:n,initialOffsetY:r,lineHeight:a}=t;if(s[e]&&0===s[e].length||0===s.length){let i=0,{horizontalAlign:s}=t.data.geometry,n=t.wrappedText,{width:o}=t.geometry.userData.parameters;return 1===n.length&&0===n[0].length&&(3===s?i=.5*o:2===s&&(i=o)),[i,r-a*e]}let o=s[e];if(void 0===o||0===o.length)return[0,0];let[h,l]=o[Math.min(i,o.length-1)],p=h;return i>=o.length&&(p+=n[e][i-1]),[p,l]}function _(t,e){let i=0;for(let s=0;s<t.length;s++){let n=t[s],r=e-i;if(r<=n.length)return[s,r];i+=n.length}return[Math.max(0,t.length-1),t[t.length-1]?.length??0]}function w(t,e){return"string"==typeof t?e.data.colors[t]:t}function k(t){return t.colors[0]}var E=class{constructor(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0],this._delay=500,this._distance=2,this._onMouseDown=t=>{let e=[t.clientX,t.clientY],i=(new Date).getTime();if(this._clickCount>0){let t=e[0]-this._lastPosition[0],i=e[1]-this._lastPosition[1];Math.sqrt(t*t+i*i)>this._distance&&(this._clickCount=0)}this._lastPosition=e,this._clickCount=i-this._lastTime>this._delay?1:this._clickCount+1,this._lastTime=i},this._onMouseUp=t=>{}}start(t,e=500,i=2){this._target&&this.stop(),this.reset(),this._delay=e,this._distance=i,this._target=t,this._target.addEventListener("pointerdown",this._onMouseDown,!1),this._target.addEventListener("pointerup",this._onMouseUp,!1)}stop(){this._target&&(this._target.removeEventListener("pointerdown",this._onMouseDown,!1),this._target.removeEventListener("pointerup",this._onMouseUp,!1),this._target=void 0)}get clickCount(){return this._clickCount}reset(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0]}},j=new p(0,0,1),D=new p,S=new p,T=new u,A=class{constructor(t,e,i,s,n){this.containerScene=t,this.raycaster=e,this.sharedAssets=i,this.requestRender=s,this.onExit=n,this.htmlInput=null,this.virtualInput=null,this.helper=new C,this.doubleClickHandler=new E,this.isDragging=!1,this.plane=new I,this.caretInterval=0,this.planeIntersection=new p,this.projected=new l,this._lastIndex=0,this._isFirstDragMove=!1,this.selectionOnDragStart=0,this.onTextMaterialChanged=()=>{let t=this.virtualInput?.data;if(void 0!==this.virtualInput&&t){let e=t.material,i=function(t,e){let i=o.fromHex(3223857),s=.8;for(let n of t.layers){if("light"===n.data.type||"displace"===n.data.type||"fresnel"===n.data.type||"dust"===n.data.type||"matcap"===n.data.type||"texture"===n.data.type||"toon"===n.data.type||"outline"===n.data.type||"transmission"===n.data.type||"noise"===n.data.type||"vertexColor"===n.data.type)continue;let t="string"==typeof n.data.alpha?Number(e.getVariable(n.data.alpha)):n.data.alpha;if("color"===n.data.type&&t>.3){i=w(n.data.color,e),s=t;break}if(("depth"===n.data.type||"gradient"===n.data.type)&&t>.3){let t=k(n.data);i={r:t[0],g:t[1],b:t[2]},s="string"==typeof n.data.alpha?1:n.data.alpha;break}}return{...i,a:s}}("string"==typeof e?this.sharedAssets.data.materials[e]:e,this.sharedAssets);this.helper.setCaretColor(i)}},this.stopAnimateTextCursor=()=>{clearInterval(this.caretInterval),this.helper&&(this.helper.caretMesh.visible=!1)},this.startAnimateTextCursor=()=>{this.stopAnimateTextCursor(),this.helper&&(this.helper.caretMesh.visible=!0,this.caretInterval=setInterval(()=>{this.helper&&(this.helper.caretMesh.visible=!this.helper.caretMesh.visible),this.requestRender()},600))},this.handleCaretUpdate=t=>{if(!this.htmlInput||!this.virtualInput)return;let e=this.helper,i="ArrowLeft"===t?.key||"ArrowRight"===t?.key,s="ArrowUp"===t?.key||"ArrowDown"===t?.key;this.htmlInput.selectionStart===this.htmlInput.selectionEnd?(e.setCaretPosition(this.htmlInput.selectionStart,{horizontalKeyMove:i,verticalKeyMove:s}),this.startAnimateTextCursor()):e.setSelection(this.htmlInput.selectionStart,this.htmlInput.selectionEnd),this.requestRender()},this.containerScene.add(this.helper)}createInput(){return this.htmlInput=function(){let t=document.createElement("textarea");return t.style.position="fixed",t.style.top="200px",t.style.left="400px",t.style.zIndex="-1",t.style.border="1px solid rgba(255,0,0,0.5)",t.style.width="10px",t.style.height="500px",t.style.color="white",t.style.opacity="0.5",t.style.background="transparent",t.style.display="none",t.style.margin="0px",t.style.padding="0px",t.style.boxSizing="content-box",t.style.pointerEvents="none",t}(),this.htmlInput}connect(){}disconnect(){this.stopAnimateTextCursor(),this.helper.hide(),this.htmlInput?.remove(),this.doubleClickHandler.stop()}handleMouseDown(){if(!this.htmlInput||!this.virtualInput)return!0;this.getPointOnPlane();let t=this.doubleClickHandler.clickCount,e=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,t>1?"inside":"previous")??{index:0,lineIndex:0,characterIndex:0},{lineIndex:i}=e,{index:s,characterIndex:n}=e;this.virtualInput?.wrappedText?.length&&"\n"===this.virtualInput.wrappedText[i][Math.max(0,n-1)]&&(s--,n--),this._lastIndex=s,this._isFirstDragMove=!0;let r=this.checkClickedObject();if(1===t){if(null===r)return this.onExit(this.virtualInput),!0;this.selectionOnDragStart=s,this.isDragging=!0,this.setInputSelection(s)}else r===this.virtualInput&&(2===t?this.selectClosestWord(i,n):t>2&&(this.setInputSelection(0,this.htmlInput.value.length),this.doubleClickHandler.reset()))}handleMouseUp(){this.applyRangeToTextInput(),this.isDragging=!1,this._isFirstDragMove=!1}handleMouseMove(){!this.virtualInput||(this._isFirstDragMove&&this.doubleClickHandler.clickCount>1&&(this.selectionOnDragStart=this._lastIndex,this.isDragging=!0,this.setInputSelection(this._lastIndex)),this._isFirstDragMove=!1,this.getPointOnPlane(),this.applyRangeToTextInput())}focus(t){if(this.virtualInput=t,this.updateTextInputStyles(),this.htmlInput)if(t){let t=this.data?.geometry.text;this.htmlInput.value="string"==typeof t?"":t?.textValue.toString()??""}else this.htmlInput.value=""}blur(){}get data(){let{virtualInput:t}=this;if(t)return t.dataPatched}applyRangeToTextInput(){if(!this.isDragging||!this.virtualInput||!this.htmlInput)return;let t=this.selectionOnDragStart,{index:e,lineIndex:i,characterIndex:s}=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,this.doubleClickHandler.clickCount>2?"inside":"previous")??{index:0},n=e;void 0!==i&&void 0!==s&&"\n"===this.virtualInput?.wrappedText[i][s-1]&&n--,this.htmlInput.setSelectionRange(Math.min(t,n),Math.max(t,n))}checkClickedObject(){if(this.virtualInput){let t=this.raycaster.intersectObject(this.virtualInput,!1);if(t.length>0){let e=t[0];if(e.object instanceof f)return e.object}}return null}selectClosestWord(t,e){if(!this.virtualInput)return;let i=this.virtualInput.wrappedText,s=i[t],n=e+1,r=e;" "!==s[e]&&(n=this.findNextCharOccurence(s,e,"forward"," "),r=this.findNextCharOccurence(s,e,"backward"," "),r>0&&r++,n>=s.length-1&&t===i.length-1&&n++);let a=this.helper,o=a.getGlobalIndexFromLineAndCharIndexes(i,t,r),h=a.getGlobalIndexFromLineAndCharIndexes(i,t,n);this.setInputSelection(o,h)}findNextCharOccurence(t,e,i,s=" "){let n=Math.max(0,t.length-1),r="forward"===i?n:0,a="forward"===i?1:-1,o=Math.max(Math.min(e,n),0);for(;o!==r;)if(o+=a,t.charAt(o)===s)return o;return r}getPointOnPlane(){let t=this.virtualInput?.data;if(this.virtualInput&&t&&this.raycaster.ray.intersectsPlane(this.plane)){null===this.planeIntersection&&(this.planeIntersection=new p);let e=this.raycaster.ray.intersectPlane(this.plane,this.planeIntersection);if(e){this.planeIntersection.copy(this.virtualInput.worldToLocal(e));let i="number"==typeof t.geometry.width?t.geometry.width:1,s="number"==typeof t.geometry.height?t.geometry.height:1;this.projected.set(e.x+.5*i,e.y-.5*s)}}}updatePlane(){let t=this.virtualInput?.data;this.virtualInput&&t&&(T.getNormalMatrix(this.virtualInput.matrixWorld),D.copy(j).applyMatrix3(T).normalize(),this.virtualInput.localToWorld(S.set(0,0,t.geometry.depth)),this.plane.setFromNormalAndCoplanarPoint(D,S))}setInputSelection(t,e=t){this.htmlInput?.setSelectionRange(t,e),n&&this.htmlInput?.focus(),setTimeout(()=>{this.htmlInput?.focus()})}updateTextInputStyles(){let t=this.virtualInput?.data;var e;this.virtualInput&&t&&this.htmlInput&&(this.htmlInput.style.fontSize=t.geometry.fontSize+"px",this.htmlInput.style.letterSpacing=t.geometry.letterSpacing*t.geometry.fontSize+"px",this.htmlInput.style.lineHeight=t.geometry.fontSize*t.geometry.lineHeight+"px",this.htmlInput.style.width=t.geometry.width+"px",this.htmlInput.style.height=t.geometry.height+"px",this.htmlInput.style.textAlign=4===(e=t.geometry.horizontalAlign)?"justify":2===e?"right":3===e?"center":"left")}},L=(t,e)=>{if("string"==typeof t){let i=e.data(t);if(i)return L(i.value,e)}return h.getDisplayedValue(t)};function U(t,e){let i=t.text,s="";if("string"==typeof i){let t=e.variables.data(s);t&&(s=L(t.value,e.variables))}else s=i.textValue.toString();return s}var H=class extends e{constructor(t,e){super(t),this.eventManager=e,this._textInputs=[],this.sceneHelpers=new c,this.helper=new C,this._onMouseDownFocusIn=t=>{if(s.length>1)return;this.eventContext.updateRaycaster(t);let e=null;if(this.eventContext.raycaster)for(let t of this._textInputs)if(this.eventContext.raycaster.intersectObject(t,!0).length>0){e=t;break}this.focusOnTextInput(e),this._onCaretUpdate(),this._onMouseUp(),this.textInputManager.doubleClickHandler.start(this.eventContext.domElement),this.textInputManager.doubleClickHandler._onMouseDown(t),this._onMouseDown(t)},this.onExit=()=>{let{virtualInput:t}=this.textInputManager;if(null===t)return;let e=this.textInputManager.htmlInput;this.helper.hide(),e?.setSelectionRange(e.value.length,e.value.length),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0);let{domElement:i}=this.eventContext;i.removeEventListener("pointerdown",this._onMouseDown,!1),i.removeEventListener("pointerup",this._onMouseUp,!1),i.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.textInputManager.doubleClickHandler.reset(),i.addEventListener("pointerdown",this._onMouseDownFocusIn),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers()},this._onMouseDown=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseDown(),this.textInputManager.virtualInput&&this.eventContext.raycaster.intersectObject(this.textInputManager.virtualInput,!0).length>0&&this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1)},this._onMouseUp=()=>{this.textInputManager.handleMouseUp(),this.eventManager.controlsManager.orbitControls&&!this.eventManager.controlsManager.orbitControls.enabled&&(this.eventManager.controlsManager.orbitControls.enabled=!0)},this._onMouseMove=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseMove()},this._onTextEdit=t=>{let{htmlInput:e,virtualInput:i,helper:s}=this.textInputManager;if(!e||!i)return;let n=e.value;i.textGeometry.setText(n,this.eventContext.sharedAssets).then(()=>{this.eventContext.requestRender()});let r=i.data;s.update();let a=r.geometry.text;if("string"==typeof a){let t=a;this.eventContext.sharedAssets.updateVariable(t,{textValue:n})}this.textInputManager.updateTextInputStyles(),this._onCaretUpdate()},this._onCaretUpdate=t=>{this.textInputManager.handleCaretUpdate(t)},this._onKeyPress=t=>{"Escape"===t.key&&this.onExit()},this.textInputManager=new A(this.sceneHelpers,t.raycaster,t.sharedAssets,t.requestRender,this.onExit)}connect(){let t=[];if(this.eventContext.scene.traverseEntity(e=>{e instanceof f&&t.push(e)}),this._textInputs=t,0===t.length)return;let{domElement:e}=this.eventContext;e.addEventListener("pointerdown",this._onMouseDownFocusIn),this.textInputManager.connect();let i=this.textInputManager.createInput();document.body.appendChild(i),i.style.display="none",i.addEventListener("keyup",this._onCaretUpdate),i.addEventListener("keydown",this._onCaretUpdate),i.addEventListener("beforeinput",this._onCaretUpdate),i.addEventListener("paste",this._onCaretUpdate),i.addEventListener("cut",this._onCaretUpdate),i.addEventListener("select",this._onCaretUpdate),i.addEventListener("selectstart",this._onCaretUpdate)}disconnect(){let t=this.textInputManager.htmlInput,{domElement:e,sharedAssets:i}=this.eventContext;e.removeEventListener("pointerdown",this._onMouseDownFocusIn),t?.removeEventListener("keyup",this._onCaretUpdate),t?.removeEventListener("keydown",this._onCaretUpdate),t?.removeEventListener("beforeinput",this._onCaretUpdate),t?.removeEventListener("paste",this._onCaretUpdate),t?.removeEventListener("cut",this._onCaretUpdate),t?.removeEventListener("select",this._onCaretUpdate),t?.removeEventListener("selectstart",this._onCaretUpdate),this._textInputs.forEach(t=>{let e=U(t.data.geometry,this.eventContext.sharedAssets.data);t.textGeometry.setText(e,i)}),e.removeEventListener("pointerdown",this._onMouseDown,!1),e.removeEventListener("pointerup",this._onMouseUp,!1),e.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers(),this.textInputManager.disconnect()}focusOnTextInput(t){this.textInputManager.focus(t),this.textInputManager.onTextMaterialChanged();let e=this.textInputManager.htmlInput;if(!e||null===t)return;this.textInputManager.updateTextInputStyles(),this.eventContext.renderer.sceneHelpersOnTop=this.sceneHelpers,this.eventContext.renderer.pipeline.enableHelpers(),this.textInputManager.isDragging=!1;let i=U(t.textGeometry.userData.parameters,this.eventContext.sharedAssets.data);e.value=i,e.setSelectionRange(0,0),this.textInputManager.helper.show(t),e.style.display="block",e.addEventListener("input",this._onTextEdit),this.textInputManager.updatePlane();let{domElement:s}=this.eventContext;s.removeEventListener("pointerdown",this._onMouseDownFocusIn),s.addEventListener("pointerdown",this._onMouseDown,!1),s.addEventListener("pointerup",this._onMouseUp,!1),s.addEventListener("pointermove",this._onMouseMove,!1),window.addEventListener("keydown",this._onKeyPress)}};i("Textfields",({eventContext:t,eventManager:e})=>new H(t,e)),a("InputGeometry",(t,e,i)=>new f(t,e,i)),r("textinputs");
1
+ import{a as t}from"./runtime-chunk-PDASWDVC.js";import{a as e,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as s}from"./runtime-chunk-VAVYZ35B.js";import{c as n}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-DK66VKWP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-CKT62HES.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-U4QOT2PX.js";import{a as r,f as a}from"./runtime-chunk-TZCHGFVF.js";import{D as o,Ha as h}from"./runtime-chunk-VPEJ5BFD.js";import{Dc as l,Fc as p,Gc as u,Sc as d,Vc as c,Vd as g,bd as m,dd as x,kd as v,l as y,ld as I,rd as M}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var f=class extends t{constructor(t,e,i){super(t,e,i),this.data=e}},C=class extends d{constructor(){super(),this.caretIndex=0,this._caretVisibleAlpha=1,this._selectionVisibleAlpha=.3,this.current={start:0,end:void 0},this.matrixAutoUpdate=!1,this.caretMesh=new I(new g(1,1),new v({transparent:!0,opacity:0,side:y})),this.add(this.caretMesh),this.selectionMesh=new I(new g(1,1),new v({color:2857471,transparent:!0,depthTest:!1,depthWrite:!1,opacity:0,side:y})),this.add(this.selectionMesh),this.hide()}get caretHeight(){return this.object?.AD??0}show(t){this.visible=!0,this.object=t,this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.y=.5*-this.caretHeight,this.setCaretPosition(this.caretIndex),this.update()}hide(){this.visible=!1}update(){if(void 0===this.object)return;this.updateHelperMatrix();let{depth:t}=this.object.geometry.userData.parameters;this.caretMesh.position.z=t,this.selectionMesh.position.z=t}updateHelperMatrix(){if(void 0===this.object)return;let t=this.object,e=t.parent;null!==e&&e.updateWorldMatrix(!0,!1),t.matrixAutoUpdate&&t.updateMatrix(),null!==e?(this.matrixWorld.multiplyMatrices(e.matrixWorld,t.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,t.matrix)):this.matrixWorld.multiplyMatrices(t.hiddenMatrix,t.matrix),this.matrix.copy(this.matrixWorld);for(let t of this.children)t.matrixWorld.copy(this.matrixWorld);t.updateWorldMatrix(!0,!0)}setCaretColor(t){let e=this.caretMesh.material;e.color.setRGB(t.r,t.g,t.b);let i=this._caretVisibleAlpha===e.opacity;this._caretVisibleAlpha=t.a,i&&(e.opacity=this._caretVisibleAlpha)}setSelectionColor(t){this.selectionMesh.material.color.setRGB(t.r,t.g,t.b)}setCaretPosition(t,e={}){if(void 0===this.object)return;this.caretIndex=t;let i=this.object.wrappedText,[s,n]=_(i,t),[r,a]=t>0?_(i,t-1):[null,null];"\n"===(t>0&&i.length?i[r].charAt(a):null)&&(s++,n=0),this.current.start=t,this.current.end=void 0;let[o,h]=b(this.object,s,n),{AD:l,descender:p}=this.object,u=p+.5*l,{width:d,height:c,depth:g}=this.object.geometry.userData.parameters,m="string"==typeof d?0:d,x="string"==typeof c?0:c;this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.set(o-.5*m,h+u+.5*x,g),this.hideSelectionMesh(),this.showCaretMesh()}setSelection(t,e){if(void 0===this.object)return;let i=this.object.wrappedText;this.current.start=t,this.current.end=e;let s=[],n=[],r=function(t,e,i){let[s,n]=_(t,e),[r,a]=_(t,i),o=[];n>=t[s].length&&(s++,n=0);for(let e=s;e<=r;e++){let i=t[e],h=e===s?n:0,l=e===r?a:i.length;o.push([e,h,l])}return o}(i,t,e),{lineHeight:a,AD:o,descender:h}=this.object,l=h+.5*o-.5*a;for(let[t,e,i]of r)if(e!==i){let[r,o]=b(this.object,t,e),[h,p]=b(this.object,t,i),u=o,d=p;u+=l,d+=l,d+=a;let c=s.length/3;s.push(r,u,0),s.push(h,u,0),s.push(h,d,0),s.push(r,d,0),n.push(c+0,c+1,c+2),n.push(c+2,c+3,c+0)}let p=new x;p.setIndex(n),p.setAttribute("position",new m(s,3));let{width:u,height:d,depth:c}=this.object.geometry.userData.parameters,g="string"==typeof u?0:u,v="string"==typeof d?0:d;this.selectionMesh.geometry.dispose(),this.selectionMesh.geometry=p,this.selectionMesh.position.x=.5*-g,this.selectionMesh.position.y=.5*v,this.selectionMesh.position.z=c,this.showSelectionMesh(),this.hideCaretMesh()}getSelectionFromPosition(t,e,i="previous"){if(void 0===this.object||void 0===this.object.font)return;let s=this.object.wrappedText,n=s.length,r=this.object.lineHeight,a=n*r,{height:o,verticalAlign:h}=this.object.geometry.userData.parameters,l="string"==typeof o?0:o,p=0;3===h?p=l-a:2===h&&(p=.5*l-.5*a);let u=Math.min(Math.floor(Math.max(Math.min(-e-p,a),0)/r),n-1),d=this.object.charCoords[u],c=this.object.charWidths[u],g=0,m=!1;if("previous"===i){for(let e=0;e<d.length;e++)if(d[e][0]+.5*c[e]-t>0){g=e,m=!0;break}}else if("closest"===i){let e=1/0;for(let i=0;i<d.length;i++){let s=d[i][0]+.5*c[i],n=Math.abs(s-t);n<e&&(e=n,g=i,m=!0)}}else for(let e=0;e<d.length;e++){let i=d[e][0],s=d[e][0]+c[e];if(t>=i&&t<s){g=e,m=!0;break}}return m||(g=d.length),{index:this.getGlobalIndexFromLineAndCharIndexes(s,u,g),lineIndex:u,characterIndex:g}}getGlobalIndexFromLineAndCharIndexes(t,e,i){return t.slice(0,e).reduce((t,e)=>t+e.length,0)+i}showSelectionMesh(){this.selectionMesh.material.opacity=this._selectionVisibleAlpha}hideSelectionMesh(){this.selectionMesh.material.opacity=0}showCaretMesh(){this.caretMesh.material.opacity=this._caretVisibleAlpha}hideCaretMesh(){this.caretMesh.material.opacity=0}};function b(t,e,i){let{charCoords:s,charWidths:n,initialOffsetY:r,lineHeight:a}=t;if(s[e]&&0===s[e].length||0===s.length){let i=0,{horizontalAlign:s}=t.data.geometry,n=t.wrappedText,{width:o}=t.geometry.userData.parameters;return 1===n.length&&0===n[0].length&&(3===s?i=.5*o:2===s&&(i=o)),[i,r-a*e]}let o=s[e];if(void 0===o||0===o.length)return[0,0];let[h,l]=o[Math.min(i,o.length-1)],p=h;return i>=o.length&&(p+=n[e][i-1]),[p,l]}function _(t,e){let i=0;for(let s=0;s<t.length;s++){let n=t[s],r=e-i;if(r<=n.length)return[s,r];i+=n.length}return[Math.max(0,t.length-1),t[t.length-1]?.length??0]}function w(t,e){return"string"==typeof t?e.data.colors[t]:t}function k(t){return t.colors[0]}var E=class{constructor(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0],this._delay=500,this._distance=2,this._onMouseDown=t=>{let e=[t.clientX,t.clientY],i=(new Date).getTime();if(this._clickCount>0){let t=e[0]-this._lastPosition[0],i=e[1]-this._lastPosition[1];Math.sqrt(t*t+i*i)>this._distance&&(this._clickCount=0)}this._lastPosition=e,this._clickCount=i-this._lastTime>this._delay?1:this._clickCount+1,this._lastTime=i},this._onMouseUp=t=>{}}start(t,e=500,i=2){this._target&&this.stop(),this.reset(),this._delay=e,this._distance=i,this._target=t,this._target.addEventListener("pointerdown",this._onMouseDown,!1),this._target.addEventListener("pointerup",this._onMouseUp,!1)}stop(){this._target&&(this._target.removeEventListener("pointerdown",this._onMouseDown,!1),this._target.removeEventListener("pointerup",this._onMouseUp,!1),this._target=void 0)}get clickCount(){return this._clickCount}reset(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0]}},j=new p(0,0,1),D=new p,T=new p,S=new u,A=class{constructor(t,e,i,s,n){this.containerScene=t,this.raycaster=e,this.sharedAssets=i,this.requestRender=s,this.onExit=n,this.htmlInput=null,this.virtualInput=null,this.helper=new C,this.doubleClickHandler=new E,this.isDragging=!1,this.plane=new M,this.caretInterval=0,this.planeIntersection=new p,this.projected=new l,this._lastIndex=0,this._isFirstDragMove=!1,this.selectionOnDragStart=0,this.onTextMaterialChanged=()=>{let t=this.virtualInput?.data;if(void 0!==this.virtualInput&&t){let e=t.material,i=function(t,e){let i=o.fromHex(3223857),s=.8;for(let n of t.layers){if("light"===n.data.type||"displace"===n.data.type||"fresnel"===n.data.type||"dust"===n.data.type||"matcap"===n.data.type||"texture"===n.data.type||"toon"===n.data.type||"outline"===n.data.type||"transmission"===n.data.type||"noise"===n.data.type||"vertexColor"===n.data.type)continue;let t="string"==typeof n.data.alpha?Number(e.getVariable(n.data.alpha)):n.data.alpha;if("color"===n.data.type&&t>.3){i=w(n.data.color,e),s=t;break}if(("depth"===n.data.type||"gradient"===n.data.type)&&t>.3){let t=k(n.data);i={r:t[0],g:t[1],b:t[2]},s="string"==typeof n.data.alpha?1:n.data.alpha;break}}return{...i,a:s}}("string"==typeof e?this.sharedAssets.data.materials[e]:e,this.sharedAssets);this.helper.setCaretColor(i)}},this.stopAnimateTextCursor=()=>{clearInterval(this.caretInterval),this.helper&&(this.helper.caretMesh.visible=!1)},this.startAnimateTextCursor=()=>{this.stopAnimateTextCursor(),this.helper&&(this.helper.caretMesh.visible=!0,this.caretInterval=setInterval(()=>{this.helper&&(this.helper.caretMesh.visible=!this.helper.caretMesh.visible),this.requestRender()},600))},this.handleCaretUpdate=t=>{if(!this.htmlInput||!this.virtualInput)return;let e=this.helper,i="ArrowLeft"===t?.key||"ArrowRight"===t?.key,s="ArrowUp"===t?.key||"ArrowDown"===t?.key;this.htmlInput.selectionStart===this.htmlInput.selectionEnd?(e.setCaretPosition(this.htmlInput.selectionStart,{horizontalKeyMove:i,verticalKeyMove:s}),this.startAnimateTextCursor()):e.setSelection(this.htmlInput.selectionStart,this.htmlInput.selectionEnd),this.requestRender()},this.containerScene.add(this.helper)}createInput(){return this.htmlInput=function(){let t=document.createElement("textarea");return t.style.position="fixed",t.style.top="200px",t.style.left="400px",t.style.zIndex="-1",t.style.border="1px solid rgba(255,0,0,0.5)",t.style.width="10px",t.style.height="500px",t.style.color="white",t.style.opacity="0.5",t.style.background="transparent",t.style.display="none",t.style.margin="0px",t.style.padding="0px",t.style.boxSizing="content-box",t.style.pointerEvents="none",t}(),this.htmlInput}connect(){}disconnect(){this.stopAnimateTextCursor(),this.helper.hide(),this.htmlInput?.remove(),this.doubleClickHandler.stop()}handleMouseDown(){if(!this.htmlInput||!this.virtualInput)return!0;this.getPointOnPlane();let t=this.doubleClickHandler.clickCount,e=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,t>1?"inside":"previous")??{index:0,lineIndex:0,characterIndex:0},{lineIndex:i}=e,{index:s,characterIndex:n}=e;this.virtualInput?.wrappedText?.length&&"\n"===this.virtualInput.wrappedText[i][Math.max(0,n-1)]&&(s--,n--),this._lastIndex=s,this._isFirstDragMove=!0;let r=this.checkClickedObject();if(1===t){if(null===r)return this.onExit(this.virtualInput),!0;this.selectionOnDragStart=s,this.isDragging=!0,this.setInputSelection(s)}else r===this.virtualInput&&(2===t?this.selectClosestWord(i,n):t>2&&(this.setInputSelection(0,this.htmlInput.value.length),this.doubleClickHandler.reset()))}handleMouseUp(){this.applyRangeToTextInput(),this.isDragging=!1,this._isFirstDragMove=!1}handleMouseMove(){!this.virtualInput||(this._isFirstDragMove&&this.doubleClickHandler.clickCount>1&&(this.selectionOnDragStart=this._lastIndex,this.isDragging=!0,this.setInputSelection(this._lastIndex)),this._isFirstDragMove=!1,this.getPointOnPlane(),this.applyRangeToTextInput())}focus(t){if(this.virtualInput=t,this.updateTextInputStyles(),this.htmlInput)if(t){let t=this.data?.geometry.text;this.htmlInput.value="string"==typeof t?"":t?.textValue.toString()??""}else this.htmlInput.value=""}blur(){}get data(){let{virtualInput:t}=this;if(t)return t.dataPatched}applyRangeToTextInput(){if(!this.isDragging||!this.virtualInput||!this.htmlInput)return;let t=this.selectionOnDragStart,{index:e,lineIndex:i,characterIndex:s}=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,this.doubleClickHandler.clickCount>2?"inside":"previous")??{index:0},n=e;void 0!==i&&void 0!==s&&"\n"===this.virtualInput?.wrappedText[i][s-1]&&n--,this.htmlInput.setSelectionRange(Math.min(t,n),Math.max(t,n))}checkClickedObject(){if(this.virtualInput){let t=this.raycaster.intersectObject(this.virtualInput,!1);if(t.length>0){let e=t[0];if(e.object instanceof f)return e.object}}return null}selectClosestWord(t,e){if(!this.virtualInput)return;let i=this.virtualInput.wrappedText,s=i[t],n=e+1,r=e;" "!==s[e]&&(n=this.findNextCharOccurence(s,e,"forward"," "),r=this.findNextCharOccurence(s,e,"backward"," "),r>0&&r++,n>=s.length-1&&t===i.length-1&&n++);let a=this.helper,o=a.getGlobalIndexFromLineAndCharIndexes(i,t,r),h=a.getGlobalIndexFromLineAndCharIndexes(i,t,n);this.setInputSelection(o,h)}findNextCharOccurence(t,e,i,s=" "){let n=Math.max(0,t.length-1),r="forward"===i?n:0,a="forward"===i?1:-1,o=Math.max(Math.min(e,n),0);for(;o!==r;)if(o+=a,t.charAt(o)===s)return o;return r}getPointOnPlane(){let t=this.virtualInput?.data;if(this.virtualInput&&t&&this.raycaster.ray.intersectsPlane(this.plane)){null===this.planeIntersection&&(this.planeIntersection=new p);let e=this.raycaster.ray.intersectPlane(this.plane,this.planeIntersection);if(e){this.planeIntersection.copy(this.virtualInput.worldToLocal(e));let i="number"==typeof t.geometry.width?t.geometry.width:1,s="number"==typeof t.geometry.height?t.geometry.height:1;this.projected.set(e.x+.5*i,e.y-.5*s)}}}updatePlane(){let t=this.virtualInput?.data;this.virtualInput&&t&&(S.getNormalMatrix(this.virtualInput.matrixWorld),D.copy(j).applyMatrix3(S).normalize(),this.virtualInput.localToWorld(T.set(0,0,t.geometry.depth)),this.plane.setFromNormalAndCoplanarPoint(D,T))}setInputSelection(t,e=t){this.htmlInput?.setSelectionRange(t,e),n&&this.htmlInput?.focus(),setTimeout(()=>{this.htmlInput?.focus()})}updateTextInputStyles(){let t=this.virtualInput?.data;var e;this.virtualInput&&t&&this.htmlInput&&(this.htmlInput.style.fontSize=t.geometry.fontSize+"px",this.htmlInput.style.letterSpacing=t.geometry.letterSpacing*t.geometry.fontSize+"px",this.htmlInput.style.lineHeight=t.geometry.fontSize*t.geometry.lineHeight+"px",this.htmlInput.style.width=t.geometry.width+"px",this.htmlInput.style.height=t.geometry.height+"px",this.htmlInput.style.textAlign=4===(e=t.geometry.horizontalAlign)?"justify":2===e?"right":3===e?"center":"left")}},L=(t,e)=>{if("string"==typeof t){let i=e.data(t);if(i)return L(i.value,e)}return h.getDisplayedValue(t)};function U(t,e){let i=t.text,s="";if("string"==typeof i){let t=e.variables.data(s);t&&(s=L(t.value,e.variables))}else s=i.textValue.toString();return s}var H=class extends e{constructor(t,e){super(t),this.eventManager=e,this._textInputs=[],this.sceneHelpers=new c,this.helper=new C,this._onMouseDownFocusIn=t=>{if(s.length>1)return;this.eventContext.updateRaycaster(t);let e=null;if(this.eventContext.raycaster)for(let t of this._textInputs)if(this.eventContext.raycaster.intersectObject(t,!0).length>0){e=t;break}this.focusOnTextInput(e),this._onCaretUpdate(),this._onMouseUp(),this.textInputManager.doubleClickHandler.start(this.eventContext.domElement),this.textInputManager.doubleClickHandler._onMouseDown(t),this._onMouseDown(t)},this.onExit=()=>{let{virtualInput:t}=this.textInputManager;if(null===t)return;let e=this.textInputManager.htmlInput;this.helper.hide(),e?.setSelectionRange(e.value.length,e.value.length),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0);let{domElement:i}=this.eventContext;i.removeEventListener("pointerdown",this._onMouseDown,!1),i.removeEventListener("pointerup",this._onMouseUp,!1),i.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.textInputManager.doubleClickHandler.reset(),i.addEventListener("pointerdown",this._onMouseDownFocusIn),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers()},this._onMouseDown=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseDown(),this.textInputManager.virtualInput&&this.eventContext.raycaster.intersectObject(this.textInputManager.virtualInput,!0).length>0&&this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1)},this._onMouseUp=()=>{this.textInputManager.handleMouseUp(),this.eventManager.controlsManager.orbitControls&&!this.eventManager.controlsManager.orbitControls.enabled&&(this.eventManager.controlsManager.orbitControls.enabled=!0)},this._onMouseMove=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseMove()},this._onTextEdit=t=>{let{htmlInput:e,virtualInput:i,helper:s}=this.textInputManager;if(!e||!i)return;let n=e.value;i.textGeometry.setText(n,this.eventContext.sharedAssets).then(()=>{this.eventContext.requestRender()});let r=i.data;s.update();let a=r.geometry.text;if("string"==typeof a){let t=a;this.eventContext.sharedAssets.updateVariable(t,{textValue:n})}this.textInputManager.updateTextInputStyles(),this._onCaretUpdate()},this._onCaretUpdate=t=>{this.textInputManager.handleCaretUpdate(t)},this._onKeyPress=t=>{"Escape"===t.key&&this.onExit()},this.textInputManager=new A(this.sceneHelpers,t.raycaster,t.sharedAssets,t.requestRender,this.onExit)}connect(){let t=[];if(this.eventContext.scene.traverseEntity(e=>{e instanceof f&&t.push(e)}),this._textInputs=t,0===t.length)return;let{domElement:e}=this.eventContext;e.addEventListener("pointerdown",this._onMouseDownFocusIn),this.textInputManager.connect();let i=this.textInputManager.createInput();document.body.appendChild(i),i.style.display="none",i.addEventListener("keyup",this._onCaretUpdate),i.addEventListener("keydown",this._onCaretUpdate),i.addEventListener("beforeinput",this._onCaretUpdate),i.addEventListener("paste",this._onCaretUpdate),i.addEventListener("cut",this._onCaretUpdate),i.addEventListener("select",this._onCaretUpdate),i.addEventListener("selectstart",this._onCaretUpdate)}disconnect(){let t=this.textInputManager.htmlInput,{domElement:e,sharedAssets:i}=this.eventContext;e.removeEventListener("pointerdown",this._onMouseDownFocusIn),t?.removeEventListener("keyup",this._onCaretUpdate),t?.removeEventListener("keydown",this._onCaretUpdate),t?.removeEventListener("beforeinput",this._onCaretUpdate),t?.removeEventListener("paste",this._onCaretUpdate),t?.removeEventListener("cut",this._onCaretUpdate),t?.removeEventListener("select",this._onCaretUpdate),t?.removeEventListener("selectstart",this._onCaretUpdate),this._textInputs.forEach(t=>{let e=U(t.data.geometry,this.eventContext.sharedAssets.data);t.textGeometry.setText(e,i)}),e.removeEventListener("pointerdown",this._onMouseDown,!1),e.removeEventListener("pointerup",this._onMouseUp,!1),e.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers(),this.textInputManager.disconnect()}focusOnTextInput(t){this.textInputManager.focus(t),this.textInputManager.onTextMaterialChanged();let e=this.textInputManager.htmlInput;if(!e||null===t)return;this.textInputManager.updateTextInputStyles(),this.eventContext.renderer.sceneHelpersOnTop=this.sceneHelpers,this.eventContext.renderer.pipeline.enableHelpers(),this.textInputManager.isDragging=!1;let i=U(t.textGeometry.userData.parameters,this.eventContext.sharedAssets.data);e.value=i,e.setSelectionRange(0,0),this.textInputManager.helper.show(t),e.style.display="block",e.addEventListener("input",this._onTextEdit),this.textInputManager.updatePlane();let{domElement:s}=this.eventContext;s.removeEventListener("pointerdown",this._onMouseDownFocusIn),s.addEventListener("pointerdown",this._onMouseDown,!1),s.addEventListener("pointerup",this._onMouseUp,!1),s.addEventListener("pointermove",this._onMouseMove,!1),window.addEventListener("keydown",this._onKeyPress)}};i("Textfields",({eventContext:t,eventManager:e})=>new H(t,e)),a("InputGeometry",(t,e,i)=>new f(t,e,i)),r("textinputs");
@@ -0,0 +1 @@
1
+ import{a as t,b as e,c as i,d as a,e as n,f as s,h as r,i as o}from"./runtime-chunk-OUXEWX5Z.js";import"./runtime-chunk-KE6HNYUL.js";import"./runtime-chunk-NTUTXO7Q.js";import{a as l}from"./runtime-chunk-R43XZP65.js";import{a as d}from"./runtime-chunk-5JEZ42OM.js";import{a as h,b as u}from"./runtime-chunk-F3ZACLZW.js";import"./runtime-chunk-YULW5JRE.js";import"./runtime-chunk-FTVQTRM7.js";import{a as c}from"./runtime-chunk-32KZP4YN.js";import"./runtime-chunk-E3IEBR27.js";import"./runtime-chunk-EJJZJ5MV.js";import"./runtime-chunk-AELTGHV2.js";import{Y as m,ca as p}from"./runtime-chunk-DK66VKWP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as g,e as f}from"./runtime-chunk-EPHVY3XO.js";import"./runtime-chunk-CKT62HES.js";import{d as y}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import{g as v,h as x,i as M}from"./runtime-chunk-U4QOT2PX.js";import{a as b}from"./runtime-chunk-TZCHGFVF.js";import{A as N,B as k,C,D as T,E as j,q as O,z as E}from"./runtime-chunk-VPEJ5BFD.js";import{Bc as w,Cc as F}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var P=0;function A(){P++}function L(t,e){return(e.epoch!==P||e.t!==t.t||e.index!==t.index)&&(e.epoch=P,e.t=t.t,e.index=t.index,!0)}function D(t,e,i,a){if(e){let n={},s=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time);if("data"in t){let e=s[0];e&&i?.(e.data.value,t),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let e={t:0,index:0},r={t:NaN,index:NaN};return{targets:e,...n,update:()=>{if(!L(e,r))return;let n=Math.ceil(e.index),o=n%2==0?e.t:1-e.t,l=s?.[Math.min(n,s.length-1)].data.value,d=s?.[Math.min(n,s.length-1)+1]?.data.value,h={},u={};if(Object.keys(l).length>0&&Object.keys(d).length>0)for(let e in t.data)if(e in l&&e in d){let t=I(l[e],d[e],o,a);void 0!==t&&(h[e]=t,u[e]={start:l,end:d,t:o})}i?.({...h},t,u)}}}}}}function I(t,e,i,a){if("string"==typeof t&&a&&(t=a.color(t)),"string"==typeof e&&a&&(e=a.color(e)),"number"==typeof t)return F.lerp(t,e,i);if(j.is(t))return j.lerp(t,e,i);if(T.is(t))return T.lerp(t,e,i);if(Array.isArray(t))return(t.length>e.length?e:t).map((a,n)=>{if(Array.isArray(a)){let a=t[n].length>e[n].length?e[n].length:t[n].length;return(4===a?k:3===a?N:E).lerp(t[n],e[n],i)}return F.lerp(t[n],e[n],i)});if("object"==typeof t&&null!==t){let n={};for(let s in t){let r=I(t[s],e[s],i,a);void 0!==r&&(n[s]=r)}return n}}var _=new Map,H=new Map,S=class extends w{constructor(s,g,f,b,N,k,T){super(),this.id=s,this.data=g,this.scene=f,this.sharedAssets=b,this.object=N,this.eventType=k,this.actionCondition=T,this.toggleIsForward=!1,this._finished=!1,this.hasPlayedOnce=!1,this._shouldForwardLoop=!1,this._shouldPauseOnNextLoopComplete=!1,this.hiddenMatrixOverrides=[],this._onLoopComplete=()=>{this._shouldPauseOnNextLoopComplete&&(this.timeline.pause(),this._shouldPauseOnNextLoopComplete=!1)};try{let s=r(this.data);"number"==typeof s.loop&&s.loop--,this.timeline=l.timeline({...s,autoplay:!1}),this._shouldForwardLoop=!0===s.loop||"number"==typeof s.loop&&s.loop>1;let g=this.sharedAssets.data.timelineAnimations[this.data.timeline].mapping;Object.entries(g).forEach(([s,r])=>{let o=this.scene.find(s);if(!o)return;let l=o.data.timelineAnimations[r];if(!l)return;let g=o.data.states.data(r);g?.hiddenMatrix&&16===g.hiddenMatrix.length&&!C.isEqual(g.hiddenMatrix,o.data.hiddenMatrix)&&this.hiddenMatrixOverrides.push({objId:s,original:o.hiddenMatrix.clone(),state:g.hiddenMatrix});let N=function(n,s,r,o){let l=[];return s.properties.forEach(s=>{let g=s.data.path?.[0];if(g&&["position","rotation","scale"].includes(g)){let t=function(t,e=()=>{}){let i=[];for(let a of M){let n=[...t.keyframes??[]].filter(t=>void 0!==t.data.value[a]).sort((t,e)=>t.data.time-e.data.time),s=n[0];s&&e?.(s.data.value);let r={index:[],t:[]};for(let t=0;t<n.length-1;t++){let e=n[t],i=n[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*n[0].data.time:0};r.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),r.index.push({...a,value:t,easing:"linear"})}if(n.length>1){let t={t:0,index:0},s={t:NaN,index:NaN};i.push({targets:t,...r,update:()=>{if(!L(t,s))return;let i=Math.ceil(t.index),r=i%2==0?t.t:1-t.t,o=n?.[i].data.value,l=n?.[i+1]?.data.value;void 0!==o&&void 0!==l&&e?.({[a]:o[a]+(l[a]-o[a])*r})}})}}return i}(s.data,r?.[g]);t&&l.push(...t)}if(g&&"shape size"===g&&"geometry"in n){let t=function(t,e,i){let a=[];for(let t of M){let n={},s=[...e.keyframes??[]].filter(e=>void 0!==e.data.value[t]).sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&i?.(r.data.value),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let e={t:0,index:0},r={t:NaN,index:NaN};a.push({targets:e,...n,update:()=>{if(!L(e,r))return;let a=Math.ceil(e.index),n=a%2==0?e.t:1-e.t,o=s?.[a].data.value,l=s?.[a+1]?.data.value;void 0!==o&&void 0!==l&&i?.({[t]:o[t]+(l[t]-o[t])*n})}})}}return a}(0,s.data,r?.shapeSize);t&&l.push(...t)}if(g&&"path extrusion"===g&&y(n)){let e=function(e,i,a){let n={},s=[...i.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&a?.(e,r.data.value),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let i={t:0,index:0},r={t:NaN,index:NaN};return{targets:i,...n,update:()=>{if(!L(i,r))return;let n=Math.ceil(i.index),o=n%2==0?i.t:1-i.t,l=s?.[Math.min(n,s.length-1)].data.value,d=s?.[Math.min(n,s.length-1)+1]?.data.value;a?.(e,t(e,l,d,o))}}}}(n,s.data,r?.pathExtrusion);e&&l.push(e)}if(g&&"path snapping"===g&&n.data.pathSnapping){let t=function(t,i,a){let n={},s=[...i.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&a?.(r.data.value),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let i={t:0,index:0},r={t:NaN,index:NaN};return{targets:i,...n,update:()=>{if(!L(i,r))return;let n=Math.ceil(i.index),o=n%2==0?i.t:1-i.t,l=s?.[Math.min(n,s.length-1)].data.value,d=s?.[Math.min(n,s.length-1)+1]?.data.value;a?.(e(t,l,d,o))}}}}(n,s.data,r?.pathSnapping);t&&l.push(t)}if(g&&"material"===g&&"Mesh"===n.type&&"material"in n){let t=p(n.material)?n.material:void 0;if(t){let e=s.data.id;if(e){let i=(s.data.keyframes??[]).some(t=>m(t.data.value?.noiseStrength)),a=t.ensureRainbowNoiseCompiled,n=e=>{i&&"function"==typeof a&&a.call(t,e)};n(e);let d=t.getLayerByUuid(e);if(d){let t=D(d,s.data,r?.material,o);t&&l.push(t)}else{let e=s.data.type;for(let i of t.getLayersOfType(e))n(i.uuid);let i=t.getLayersOfType(e);if(i)for(let t of i){let e=D(t,s.data,r?.material,o);e&&l.push(e)}}}}}if(g&&"opacity"===g&&"Mesh"===n.type&&"material"in n){let t=function(t,e){if(t){let i={},a=[...t.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),n=a[0];n&&e?.(n.data.value),i={index:[],t:[]};for(let t=0;t<a.length-1;t++){let e=a[t],n=a[t+1]??e,s={duration:1e3*(n?.data?.time-e.data.time),delay:0===t?1e3*a[0].data.time:0};i.t.push({...s,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(n.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),i.index.push({...s,value:t,easing:"linear"})}if(a.length>1){let t={t:0,index:0},n={t:NaN,index:NaN};return{targets:t,...i,update:()=>{if(!L(t,n))return;let i=Math.ceil(t.index),s=i%2==0?t.t:1-t.t,r=a?.[Math.min(i,a.length-1)].data.value,o=a?.[Math.min(i,a.length-1)+1]?.data.value;e?.(F.lerp(r,o,s))}}}}}(s.data,r?.opacity);t&&l.push(t)}if(g&&"cloner"===g){let t=function(t,e,n){let s={},r=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),o=r[0];o&&n?.(t,o.data.value,o.data.value),s={index:[],t:[]};for(let t=0;t<r.length-1;t++){let e=r[t],i=r[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*r[0].data.time:0};s.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),s.index.push({...a,value:t,easing:"linear"})}if(r.length>1){let e={t:0,index:0},o={t:NaN,index:NaN};return{targets:e,...s,update:()=>{if(!L(e,o))return;let s=Math.ceil(e.index),l=s%2==0?e.t:1-e.t,d=r?.[Math.min(s,r.length-1)].data.value,h=r?.[Math.min(s,r.length-1)+1]?.data.value;n?.(t,d.randomnessObject?void 0:i(d,h,l,t),d.randomnessObject?a(d,h,l,t):void 0)}}}}(n,s.data,r?.cloner);t&&l.push(t)}if(g&&"camera"===g&&n instanceof c){let t=function(t,e,i,a){if(e){let n={[a]:[]},s=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&(t[a]=r.data.value,i?.(a,r.data.value));for(let t=0;t<s.length-1;t++){let e=s[t];if(!Number.isFinite(e.data.value))continue;let i=s[t+1]??e;n[a].push({value:i.data.value,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters),duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0})}if(s.length>1)return{targets:t,...n,update:()=>{i?.(a,t[a])}}}}(n,s.data,r?.camera,"zoom");t&&l.push(t)}if(g&&"light"===g&&(n instanceof h||n instanceof d||n instanceof u)){let t=function(t,e,i,a,n){if(e){let s={},r=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),o=r[0];if(o){let e=o.data.value;t[a]=e,i?.(a,e)}s={index:[],t:[]};for(let t=0;t<r.length-1;t++){let e=r[t],i=r[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*r[0].data.time:0};s.t.push({...a,value:t%2==0?1:0,easing:x(e.data.easing.type,{control1:v(e.data.easing.cubicControls?.control1,[0,0]),control2:v(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),s.index.push({...a,value:t,easing:"linear"})}if(r.length>1){let t={t:0,index:0},e={t:NaN,index:NaN};return{targets:t,...s,update:()=>{if(!L(t,e))return;let s=Math.ceil(t.index),o=s%2==0?t.t:1-t.t,l=r?.[Math.min(s,r.length-1)].data.value,d=r?.[Math.min(s,r.length-1)+1]?.data.value;i?.(a,I(l,d,o,n))}}}}}(n,s.data,r?.light,s.data.path[1],o);t&&l.push(t)}}),l}(o,{...l},n(o,{scene:f,shared:b}),this.sharedAssets),k=("start"===this.data.delayDirection?this.data.delay:0)+("start-end"===this.data.delayDirection?this.data.delay:0)+("start-once"===this.data.delayDirection?this.data.delay:0);N.forEach(t=>{this.timeline.add(t,k)}),this.timeline.duration=1e3*l.to+k}),this.timeline.delay=0,this.timeline.duration+=("start"===this.data.delayDirection?this.data.delay:0)+("end"===this.data.delayDirection?this.data.delay:0)+("start-end"===this.data.delayDirection?2*this.data.delay:0)+("start-once"===this.data.delayDirection?2*this.data.delay:0),this.timeline.finished.then(()=>{Object.keys(g).forEach(t=>{let e=this.scene.find(t);e instanceof c&&e.dispatchEvent(o)}),this._finished=!0}),this.timeline.loopComplete=this._onLoopComplete}catch(t){throw new Error("Missing property")}N&&(H.has(N.uuid)?H.get(N.uuid).push(this):H.set(N.uuid,[this])),_.set(s,this)}get playing(){return!1===this.timeline.paused}get finished(){return this._finished}get paused(){return this.timeline.paused}applyStateHiddenMatrices(){for(let{objId:t,state:e}of this.hiddenMatrixOverrides){let i=this.scene.find(t);i&&i.hiddenMatrix.fromArray(e)}}restoreOriginalHiddenMatrices(){for(let{objId:t,original:e}of this.hiddenMatrixOverrides){let i=this.scene.find(t);i&&i.hiddenMatrix.copy(e)}}play(){let t=void 0!==this.eventType&&O(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&this.paused&&this.timeline.currentTime>0&&!this._finished;if(void 0!==this.eventType&&O(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&!t||void 0===this.eventType&&this._finished)return!1;this.hasPlayedOnce=!0,this.applyStateHiddenMatrices();let e=this.sharedAssets.data.timelineAnimations[this.data.timeline].mapping;Object.keys(e).forEach(t=>{let e=this.scene.find(t);e instanceof c&&e.dispatchEvent(s)}),A(),this.paused&&this.timeline.currentTime>0?this.timeline.play():this.timeline.restart()}pauseTimeline(){this.paused||this.timeline.pause()}pause(){this.pauseTimeline()}stop(){this.pauseTimeline(),this.seek(0),this.timeline.reset(),this.restoreOriginalHiddenMatrices(),this._finished=!1}seek(t){this.timeline.seek(t*this.timeline.duration,!0)}toggle(t){let e=this.paused&&this.timeline.currentTime>0&&this.timeline.currentTime<this.timeline.duration;if(void 0!==t?this.toggleIsForward=t:e||(this.toggleIsForward=!this.toggleIsForward),this.playing){if(!this.toggleIsForward&&this.timeline.reversed&&this._shouldForwardLoop&&this.timeline.remaining%2==1)return void(this._shouldPauseOnNextLoopComplete=!0);this.timeline.reverse(this.timeline.duration-this.timeline.currentTime),this._shouldForwardLoop&&this.timeline.loop&&this.timeline.reversed&&(this._shouldPauseOnNextLoopComplete=!0)}else this.applyStateHiddenMatrices(),A(),(!this.toggleIsForward!==this.timeline.reversed||!this.toggleIsForward&&this.timeline.reversed&&"alternate"===this.timeline.direction)&&this.timeline.reverse(),"number"==typeof this.timeline.loop&&"number"==typeof this.timeline.remaining&&this.timeline.remaining<this.timeline.loop&&this.toggleIsForward&&(this.timeline.remaining=this.timeline.loop),this.timeline.play()}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pauseTimeline(),this.restoreOriginalHiddenMatrices()}},Z=class{constructor(t){this.data=t}dispatch(){this.data.playTimeline?this.pauseTimeline(this.data.playTimeline):this.data.object?this.pauseAllTimelinesFromObject(this.data.object):this.pauseAllTimelines()}pauseTimeline(t){let e=this.getTimelineActions(t);!e.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{e.forEach(t=>{t[this.data.interaction]()}),this.disposeDelay()},this.data.delay)):e.forEach(t=>{t[this.data.interaction]()}))}getTimelineActions(t){let e=_.get(t);return e?[e]:[..._.values()].filter(e=>e.data.timeline===t)}pauseAllTimelinesFromObject(t){let e=H.get(t);!e?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{e.forEach(t=>t[this.data.interaction]()),this.disposeDelay()},this.data.delay)):e.forEach(t=>t[this.data.interaction]()))}pauseAllTimelines(){let t=[...H.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},U=class{constructor(t,e,i,a,n,s,r){this.data=e;let o="interaction"in e?e.interaction:"play";if("play"===o||void 0===o)this.interaction=new S(t,e,i,a,n,s,r);else{if("pause"!==o&&"stop"!==o)throw new Error("Missing property");this.interaction=new Z(e)}}get playing(){return this.interaction instanceof S&&this.interaction.playing}get finished(){return!(this.interaction instanceof S)||this.interaction.finished}get paused(){return!(this.interaction instanceof S)||this.interaction.paused}play(){if(this.interaction instanceof S)return this.interaction.play();this.interaction.dispatch()}stop(){this.interaction instanceof S&&this.interaction.stop()}seek(t){this.interaction instanceof S&&this.interaction.seek(t)}toggle(t){this.interaction instanceof S?this.interaction.toggle(t):this.interaction.dispatch()}playFromCurrent(){this.interaction instanceof S?this.interaction.playFromCurrent():this.interaction.dispatch()}dispatchConditional(){this.interaction instanceof S?f(this.interaction.sharedAssets,this.interaction.actionCondition)&&this.interaction.playFromCurrent():this.interaction.dispatch()}reverseFromCurrent(){this.interaction instanceof S&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};g("TimelineAnimation",({id:t,data:e,page:i,shared:a,object:n,eventType:s,actionCondition:r})=>new U(t,e,i.scene,a,n,s,r)),b("timeline");
@@ -1 +1 @@
1
- import{a as e}from"./runtime-chunk-NBYTQLIB.js";import{f as t}from"./runtime-chunk-XXRCB3ME.js";import{a as n,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as s}from"./runtime-chunk-VAVYZ35B.js";import{e as a}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-H7D3VFTJ.js";import"./runtime-chunk-ITLS6YIC.js";import"./runtime-chunk-AKWBEROQ.js";import"./runtime-chunk-SXPM42HJ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as o,g as r}from"./runtime-chunk-NWCLOXDY.js";import{d,v as l}from"./runtime-chunk-4KX4KQWR.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-R34HNX2O.js";import{a as u}from"./runtime-chunk-TZCHGFVF.js";import{s as h,t as c}from"./runtime-chunk-RBM3UDQF.js";import{Ec as p,Fc as m,Oc as v,rd as g}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var f=new m,E=new m,w=new m,y=new m,M=new g,F={type:"requestRender"},L=function(){let e=new m,t=new m;return(n,i,s)=>s>0?(e.subVectors(n,i),e.length()<=s?n:t.copy(i).add(e.normalize().multiplyScalar(s))):i}(),x=function(){let e=new v;return(n,i)=>{n.position.copy(i),null!==n.parent&&(e.copy(n.parent.matrixWorld).invert(),n.position.applyMatrix4(e)),e.copy(n.hiddenMatrix).invert(),n.position.applyMatrix4(e),n.updateMatrix(),n.hasNonUniformScale&&(n.updateMatrixWorld(),n.updateMatrixWorldRigid()),n instanceof l&&t(n.parent)&&n.invalidateDownstreamBooleanData(!0)}}(),D=class{constructor(e,t,n,i,s,a){this.data=e,this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.snapComplete=!1,this.isReset=!1,this.worldPosition0=new m,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...h.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.resetDampingFactor=80/this.data.resetSpeed+1,this.object.getWorldPosition(this.worldPosition0),this.actions=o(e,e.actions,i,s,a,n)}},R=class extends n{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.pairOfEventListeners=[],this.onMouseMove=e=>{if(!(s.length>1)){this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"Follow"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new D(n.data,n.id,t,e,this.eventContext.sharedAssets,this.eventManager))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),a&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents||(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events)if(void 0!==e.target){let t=e.target,n=this.onTargetChange(e);this.pairOfEventListeners.push([t,n]),t.addEventListener("requestRender",n)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),a&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let e of this.events)e.paused=!0,e.isReset=!1,r(e.actions)}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e,!0)}updateSingleEvent(e,t=!1){this.events.forEach(e=>{e.actions.Create.forEach(e=>{e.dispatchThrottled()})});let{plane:n,limitDistance:i,limitDistanceEnabled:s}=e.data;if(e.object.getWorldPosition(w),e.isReset)y.copy(e.worldPosition0);else if(e.target)e.target.getWorldPosition(y);else{let{getCamera:e,raycaster:t}=this.eventContext;if("custom"===n?(e().getWorldDirection(E),E.negate(),f.copy(E)):"xy"===n?f.set(0,0,1):"xz"===n?f.set(0,1,0):"yz"===n&&f.set(1,0,0),M.setFromNormalAndCoplanarPoint(f,w),!t.ray.intersectPlane(M,y))return}if(!e.isReset)if(y.distanceTo(e.worldPosition0)>i&&s&&e.target){if(e.snapComplete=!1,e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;y.copy(e.worldPosition0),e.currentDampingFactor=e.resetDampingFactor}else if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;!1===e.data.enabledTranslation[0]&&(y.x=w.x),!1===e.data.enabledTranslation[1]&&(y.y=w.y),!1===e.data.enabledTranslation[2]&&(y.z=w.z);let a=L(w,y,e.wasOutside?0:e.data.maxDelta);if(e.currentDampingFactor>1){let n=f.subVectors(a,w).divideScalar(e.currentDampingFactor);w.add(n),t&&x(e.object,w),e.paused=n.length()<.01}else x(e.object,a),e.paused=!0;e.object?.dispatchEvent({type:"beginEvent",eventName:"Follow"}),e.object.dispatchEvent(F)}},b=new m,C=new m,j=new v,P=new p,N=new p,S=new m,O=new m,k=new m,Q=new m,z=new g,W={type:"requestRender"},T={type:"changeRotation"},A=function(){let e=new v;return function(n,i){null!==n.parent?e.multiplyMatrices(n.parent.matrixWorld,n.hiddenMatrix):e.copy(n.hiddenMatrix),i.premultiply(d(e).invert()),n.rotation.setFromRotationMatrix(i),n.updateMatrix(),n instanceof l&&t(n.parent)&&n.invalidateDownstreamBooleanData(!0)}}(),V=class{constructor(e,t,n,i){this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.isReset=!1,this.worldQuaternion0=new p,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...c.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.object.getWorldQuaternion(this.worldQuaternion0),isNaN(this.worldQuaternion0.x)&&(this.worldQuaternion0.x=0),isNaN(this.worldQuaternion0.y)&&(this.worldQuaternion0.y=0),isNaN(this.worldQuaternion0.z)&&(this.worldQuaternion0.z=0),isNaN(this.worldQuaternion0.w)&&(this.worldQuaternion0.w=1),this.resetDampingFactor=80/this.data.resetSpeed+1}},B=class extends n{constructor(){super(...arguments),this.events=[],this.pairOfEventListeners=[],this.pairOfUserEventListeners=[],this.onMouseMove=e=>{if(!(s.length>1)){this._lastMouseEvent=e,this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onScroll=e=>{if(this._lastMouseEvent){let e=new PointerEvent("pointermove",{clientX:this._lastMouseEvent.clientX,clientY:this._lastMouseEvent.clientY,bubbles:!0,cancelable:!0,view:window});this.eventContext.eventElement.dispatchEvent(e)}},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)},this.createUserEventListener=t=>({eventName:n,target:i})=>{if(!n||!i)return;let s=e(n);s&&"LookAt"===s&&this.updateSingleEvent(t)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"LookAt"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new V(n.data,n.id,t,e))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),a&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents?n.addEventListener("scroll",this.onScroll):(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events){if(void 0!==e.target){let t=this.onTargetChange(e),n=e.target;this.pairOfEventListeners.push([n,t]),n.addEventListener("requestRender",t)}let t=this.createUserEventListener(e),n=e.object;this.pairOfUserEventListeners.push([n,t]),n.addEventListener("userEvent",t)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),a&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave),t.removeEventListener("scroll",this.onScroll);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let[e,t]of this.pairOfUserEventListeners)e.removeEventListener("userEvent",t);for(let e of this.events)e.paused=!0,e.isReset=!1}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e)}updateSingleEvent(e){let{tilt:t,axis:n,distance:i,plane:s,limitDistance:a,enabledRotation:o,limitDistanceEnabled:r}=e.data,{getCamera:l,raycaster:u}=this.eventContext,{object:h,target:c}=e;if(h.getWorldPosition(S),!e.isReset)if(e.target)e.target.getWorldPosition(O);else{if("custom"===s?(l().getWorldDirection(C),C.negate(),z.setFromNormalAndCoplanarPoint(C,S)):("xy"===s?b.set(0,0,1):"xz"===s?b.set(0,1,0):"yz"===s&&b.set(1,0,0),z.setFromNormalAndCoplanarPoint(b,S)),!u.ray.intersectPlane(z,O))return;i>0&&("custom"===s||void 0===s)&&O.addScaledVector(C,i)}if(e.isReset||(c?"target"===t?k.copy(c.up).applyMatrix4(j.extractRotation(c.matrixWorld)).normalize():o.some(e=>!1===e)?("x"===n?(Q.set(0,0,1),!1===o[2]&&Q.set(0,1,0)):"y"===n?(Q.set(1,0,0),!1===o[0]&&Q.set(0,0,1)):(Q.set(0,1,0),!1===o[1]&&Q.set(1,0,0)),k.copy(Q).applyQuaternion(e.worldQuaternion0).normalize()):k.set(0,1,0):"custom"===s?k.set(0,1,0):k.copy(b)),e.isReset)N.copy(e.worldQuaternion0);else if(S.distanceTo(O)>a&&r&&c){if(e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;N.copy(e.worldQuaternion0),e.currentDampingFactor=e.resetDampingFactor}else{if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;(function(e,t,n,i,s,a){let o=j.elements;X.subVectors(t,n),0===X.lengthSq()&&(X.z=1),X.normalize(),U.crossVectors(i,X),0===U.lengthSq()&&(1===Math.abs(i.z)?X.x+=1e-4:X.z+=1e-4,X.normalize(),U.crossVectors(i,X)),U.normalize(),I.crossVectors(X,U),"x"===s?1===a.z?[U,I,X]=[X,U,I]:(U.negate(),[U,X]=[X,U]):"y"===s?1===a.x?[U,I,X]=[I,X,U]:(U.negate(),[I,X]=[X,I]):1===a.x&&(U.negate(),[U,I]=[I,U]),o[0]=U.x,o[4]=I.x,o[8]=X.x,o[1]=U.y,o[5]=I.y,o[9]=X.y,o[2]=U.z,o[6]=I.z,o[10]=X.z})(0,O,S,k,n,Q),N.setFromRotationMatrix(j),P.setFromUnitVectors(Q.applyQuaternion(N),k),o.some(e=>!1===e)&&"target"!==t&&N.premultiply(P).normalize()}e.currentDampingFactor>1?(h.updateWorldMatrix(!0,!1),P.setFromRotationMatrix(d(h.matrixWorld)),P.slerp(N,1/e.currentDampingFactor),A(h,j.makeRotationFromQuaternion(P)),e.paused=8*(1-P.dot(N))<1e-6):(A(h,j.makeRotationFromQuaternion(N)),e.paused=!0),e.object?.dispatchEvent({type:"beginEvent",eventName:"LookAt"}),h.dispatchEvent(W),h.dispatchEvent(T)}},I=new m,U=new m,X=new m;i("Follow",({eventContext:e,eventManager:t})=>new R(e,t)),i("LookAt",({eventContext:e})=>new B(e)),u("tracking");
1
+ import{a as e}from"./runtime-chunk-NBYTQLIB.js";import{f as t}from"./runtime-chunk-YULW5JRE.js";import{a as n,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as s}from"./runtime-chunk-VAVYZ35B.js";import{e as a}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-32KZP4YN.js";import"./runtime-chunk-EJJZJ5MV.js";import"./runtime-chunk-AELTGHV2.js";import"./runtime-chunk-DK66VKWP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as o,g as r}from"./runtime-chunk-EPHVY3XO.js";import{d,v as l}from"./runtime-chunk-CKT62HES.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-U4QOT2PX.js";import{a as u}from"./runtime-chunk-TZCHGFVF.js";import{s as h,t as c}from"./runtime-chunk-VPEJ5BFD.js";import{Ec as p,Fc as m,Oc as v,rd as g}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var E=new m,f=new m,w=new m,y=new m,L=new g,F={type:"requestRender"},M=function(){let e=new m,t=new m;return(n,i,s)=>s>0?(e.subVectors(n,i),e.length()<=s?n:t.copy(i).add(e.normalize().multiplyScalar(s))):i}(),x=function(){let e=new v;return(n,i)=>{n.position.copy(i),null!==n.parent&&(e.copy(n.parent.matrixWorld).invert(),n.position.applyMatrix4(e)),e.copy(n.hiddenMatrix).invert(),n.position.applyMatrix4(e),n.updateMatrix(),n.hasNonUniformScale&&(n.updateMatrixWorld(),n.updateMatrixWorldRigid()),n instanceof l&&t(n.parent)&&n.invalidateDownstreamBooleanData(!0)}}(),D=class{constructor(e,t,n,i,s,a){this.data=e,this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.snapComplete=!1,this.isReset=!1,this.worldPosition0=new m,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...h.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.resetDampingFactor=80/this.data.resetSpeed+1,this.object.getWorldPosition(this.worldPosition0),this.actions=o(e,e.actions,i,s,a,n)}},P=class extends n{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.pairOfEventListeners=[],this.onMouseMove=e=>{if(!(s.length>1)){this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"Follow"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new D(n.data,n.id,t,e,this.eventContext.sharedAssets,this.eventManager))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),a&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents||(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events)if(void 0!==e.target){let t=e.target,n=this.onTargetChange(e);this.pairOfEventListeners.push([t,n]),t.addEventListener("requestRender",n)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),a&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let e of this.events)e.paused=!0,e.isReset=!1,r(e.actions)}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e,!0)}updateSingleEvent(e,t=!1){this.events.forEach(e=>{e.actions.Create.forEach(e=>{e.dispatchThrottled()})});let{plane:n,limitDistance:i,limitDistanceEnabled:s}=e.data;if(e.object.getWorldPosition(w),e.isReset)y.copy(e.worldPosition0);else if(e.target)e.target.getWorldPosition(y);else{let{getCamera:e,raycaster:t}=this.eventContext;if("custom"===n?(e().getWorldDirection(f),f.negate(),E.copy(f)):"xy"===n?E.set(0,0,1):"xz"===n?E.set(0,1,0):"yz"===n&&E.set(1,0,0),L.setFromNormalAndCoplanarPoint(E,w),!t.ray.intersectPlane(L,y))return}if(!e.isReset)if(y.distanceTo(e.worldPosition0)>i&&s&&e.target){if(e.snapComplete=!1,e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;y.copy(e.worldPosition0),e.currentDampingFactor=e.resetDampingFactor}else if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;!1===e.data.enabledTranslation[0]&&(y.x=w.x),!1===e.data.enabledTranslation[1]&&(y.y=w.y),!1===e.data.enabledTranslation[2]&&(y.z=w.z);let a=M(w,y,e.wasOutside?0:e.data.maxDelta);if(e.currentDampingFactor>1){let n=E.subVectors(a,w).divideScalar(e.currentDampingFactor);w.add(n),t&&x(e.object,w),e.paused=n.length()<.01}else x(e.object,a),e.paused=!0;e.object?.dispatchEvent({type:"beginEvent",eventName:"Follow"}),e.object.dispatchEvent(F)}},b=new m,j=new m,C=new v,R=new p,N=new p,S=new m,k=new m,O=new m,Q=new m,z=new g,T={type:"requestRender"},W={type:"changeRotation"},V=function(){let e=new v;return function(n,i){null!==n.parent?e.multiplyMatrices(n.parent.matrixWorld,n.hiddenMatrix):e.copy(n.hiddenMatrix),i.premultiply(d(e).invert()),n.rotation.setFromRotationMatrix(i),n.updateMatrix(),n instanceof l&&t(n.parent)&&n.invalidateDownstreamBooleanData(!0)}}(),A=class{constructor(e,t,n,i){this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.isReset=!1,this.worldQuaternion0=new p,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...c.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.object.getWorldQuaternion(this.worldQuaternion0),isNaN(this.worldQuaternion0.x)&&(this.worldQuaternion0.x=0),isNaN(this.worldQuaternion0.y)&&(this.worldQuaternion0.y=0),isNaN(this.worldQuaternion0.z)&&(this.worldQuaternion0.z=0),isNaN(this.worldQuaternion0.w)&&(this.worldQuaternion0.w=1),this.resetDampingFactor=80/this.data.resetSpeed+1}},U=class extends n{constructor(){super(...arguments),this.events=[],this.pairOfEventListeners=[],this.pairOfUserEventListeners=[],this.onMouseMove=e=>{if(!(s.length>1)){this._lastMouseEvent=e,this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onScroll=e=>{if(this._lastMouseEvent){let e=new PointerEvent("pointermove",{clientX:this._lastMouseEvent.clientX,clientY:this._lastMouseEvent.clientY,bubbles:!0,cancelable:!0,view:window});this.eventContext.eventElement.dispatchEvent(e)}},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)},this.createUserEventListener=t=>({eventName:n,target:i})=>{if(!n||!i)return;let s=e(n);s&&"LookAt"===s&&this.updateSingleEvent(t)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"LookAt"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new A(n.data,n.id,t,e))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),a&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents?n.addEventListener("scroll",this.onScroll):(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events){if(void 0!==e.target){let t=this.onTargetChange(e),n=e.target;this.pairOfEventListeners.push([n,t]),n.addEventListener("requestRender",t)}let t=this.createUserEventListener(e),n=e.object;this.pairOfUserEventListeners.push([n,t]),n.addEventListener("userEvent",t)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),a&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave),t.removeEventListener("scroll",this.onScroll);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let[e,t]of this.pairOfUserEventListeners)e.removeEventListener("userEvent",t);for(let e of this.events)e.paused=!0,e.isReset=!1}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e)}updateSingleEvent(e){let{tilt:t,axis:n,distance:i,plane:s,limitDistance:a,enabledRotation:o,limitDistanceEnabled:r}=e.data,{getCamera:l,raycaster:u}=this.eventContext,{object:h,target:c}=e;if(h.getWorldPosition(S),!e.isReset)if(e.target)e.target.getWorldPosition(k);else{if("custom"===s?(l().getWorldDirection(j),j.negate(),z.setFromNormalAndCoplanarPoint(j,S)):("xy"===s?b.set(0,0,1):"xz"===s?b.set(0,1,0):"yz"===s&&b.set(1,0,0),z.setFromNormalAndCoplanarPoint(b,S)),!u.ray.intersectPlane(z,k))return;i>0&&("custom"===s||void 0===s)&&k.addScaledVector(j,i)}if(e.isReset||(c?"target"===t?O.copy(c.up).applyMatrix4(C.extractRotation(c.matrixWorld)).normalize():o.some(e=>!1===e)?("x"===n?(Q.set(0,0,1),!1===o[2]&&Q.set(0,1,0)):"y"===n?(Q.set(1,0,0),!1===o[0]&&Q.set(0,0,1)):(Q.set(0,1,0),!1===o[1]&&Q.set(1,0,0)),O.copy(Q).applyQuaternion(e.worldQuaternion0).normalize()):O.set(0,1,0):"custom"===s?O.set(0,1,0):O.copy(b)),e.isReset)N.copy(e.worldQuaternion0);else if(S.distanceTo(k)>a&&r&&c){if(e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;N.copy(e.worldQuaternion0),e.currentDampingFactor=e.resetDampingFactor}else{if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;(function(e,t,n,i,s,a){let o=C.elements;Y.subVectors(t,n),0===Y.lengthSq()&&(Y.z=1),Y.normalize(),I.crossVectors(i,Y),0===I.lengthSq()&&(1===Math.abs(i.z)?Y.x+=1e-4:Y.z+=1e-4,Y.normalize(),I.crossVectors(i,Y)),I.normalize(),B.crossVectors(Y,I),"x"===s?1===a.z?[I,B,Y]=[Y,I,B]:(I.negate(),[I,Y]=[Y,I]):"y"===s?1===a.x?[I,B,Y]=[B,Y,I]:(I.negate(),[B,Y]=[Y,B]):1===a.x&&(I.negate(),[I,B]=[B,I]),o[0]=I.x,o[4]=B.x,o[8]=Y.x,o[1]=I.y,o[5]=B.y,o[9]=Y.y,o[2]=I.z,o[6]=B.z,o[10]=Y.z})(0,k,S,O,n,Q),N.setFromRotationMatrix(C),R.setFromUnitVectors(Q.applyQuaternion(N),O),o.some(e=>!1===e)&&"target"!==t&&N.premultiply(R).normalize()}e.currentDampingFactor>1?(h.updateWorldMatrix(!0,!1),R.setFromRotationMatrix(d(h.matrixWorld)),R.slerp(N,1/e.currentDampingFactor),V(h,C.makeRotationFromQuaternion(R)),e.paused=8*(1-R.dot(N))<1e-6):(V(h,C.makeRotationFromQuaternion(N)),e.paused=!0),e.object?.dispatchEvent({type:"beginEvent",eventName:"LookAt"}),h.dispatchEvent(T),h.dispatchEvent(W)}},B=new m,I=new m,Y=new m;i("Follow",({eventContext:e,eventManager:t})=>new P(e,t)),i("LookAt",({eventContext:e})=>new U(e)),u("tracking");
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-MM2G3DLE.js";import{k as i}from"./runtime-chunk-CCJD7IX7.js";import"./runtime-chunk-FY3XD5P2.js";import"./runtime-chunk-NTUTXO7Q.js";import{a as e,b as n}from"./runtime-chunk-KGZNRID6.js";import"./runtime-chunk-R43XZP65.js";import"./runtime-chunk-CX2MRLZA.js";import"./runtime-chunk-GN3HDYV2.js";import"./runtime-chunk-XXRCB3ME.js";import"./runtime-chunk-FTVQTRM7.js";import"./runtime-chunk-H7D3VFTJ.js";import"./runtime-chunk-XUM5HEC6.js";import"./runtime-chunk-ITLS6YIC.js";import"./runtime-chunk-AKWBEROQ.js";import"./runtime-chunk-SXPM42HJ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as r,e as s}from"./runtime-chunk-NWCLOXDY.js";import"./runtime-chunk-4KX4KQWR.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-R34HNX2O.js";import{a as h}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-RBM3UDQF.js";import{Bc as o,Cc as m}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var a=class extends o{constructor(t,i,n,r,s){super(),this.data=t,this.page=i,this.animationControls=n,this.shared=r,this.condition=s,this.startOnceDelay=0,this.toggleIsForward=!1;let h=t.object,o=i.scene.find(t.object);o&&Array.isArray(o.identity)&&(h=o.identity[0]),this.data={...t,object:h};let m=this.animationControls.clipIdToAction[t.clipId+"/"+h];if(this.duration=m?.getClip()?.duration??1,this.data.crop2){let t=e(m?.getClip());this.leftFrameTime=this.data.crop2[0]/(t-1)*this.duration,this.rightFrameTime=this.data.crop2[1]/(t-1)*this.duration}else{let t=m?.getClip()?.tracks[0]?.times.length;t&&t>1?(this.leftFrameTime=this.data.crop[0]/t*this.duration,this.rightFrameTime=this.data.crop[1]/t*this.duration):(this.leftFrameTime=0,this.rightFrameTime=this.duration)}this.startOnceDelay=t.delay}get playing(){return this.threeAnimAction?.isRunning()??!1}play(t=!1){if(!1===s(this.shared,this.condition))return!1;window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{if(this.threeAnimAction=this.animationControls.play(this.data),!this.threeAnimAction)return;this.threeAnimAction.reset(),this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime;let i=this.data.object;Object.entries(this.animationControls.clipIdToAction).forEach(([e,n])=>{let r=e.split("/")[1];this.threeAnimAction!==n&&r===i&&(t?n.fadeOut(.2):n.stop())}),t&&this.threeAnimAction?.fadeIn(.2)},this.startOnceDelay)}pause(){this.threeAnimAction&&(this.threeAnimAction.paused=!0),window.clearTimeout(this.timeoutId),delete this.timeoutId}stop(){this.threeAnimAction?.fadeOut(.2)}seek(t){this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction&&(this.threeAnimAction.paused=!0,this.threeAnimAction.time=m.clamp(this.threeAnimAction.time+1/60*t,this.leftFrameTime,this.rightFrameTime-16e-5),this.animationControls.needsUpdate=!0,this.animationControls.requestRender())}toggle(t,i=!1){if(!1===s(this.shared,this.condition))return!1;this.toggleIsForward=t??!this.toggleIsForward,this.threeAnimAction&&(this.threeAnimAction._loopCount=0),this.playing?this.threeAnimAction&&(this.threeAnimAction.timeScale=this.toggleIsForward?1:-1,this.toggleIsForward?(this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime)):this.timeoutId=window.setTimeout(()=>{if(this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction){this.toggleIsForward?(this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction.time=this.rightFrameTime,this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime),this.threeAnimAction.paused=!1,this.threeAnimAction.timeScale=this.toggleIsForward?1:-1;let t=this.data.clipId.split("/")[1];Object.entries(this.animationControls.clipIdToAction).forEach(([e,n])=>{let r=e.split("/")[1];this.threeAnimAction!==n&&r===t&&n.isRunning()&&(i?n.fadeOut(.2):n.stop())}),i&&this.threeAnimAction?.fadeIn(.2)}},this.startOnceDelay)}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){let t=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object]?.getClip();t&&(t.duration=this.duration),this.pause()}};n(i),r("Transition",({eventType:i,data:e,page:n,shared:r,actionCondition:s})=>new t(i,e,n,r,s)),r("Animation",({data:t,page:i,eventManager:e,shared:n,actionCondition:r})=>new a(t,i,e.animationControls,n,r)),h("transitions");
1
+ import{a as t}from"./runtime-chunk-3GRN37GY.js";import{k as i}from"./runtime-chunk-OUXEWX5Z.js";import"./runtime-chunk-KE6HNYUL.js";import"./runtime-chunk-NTUTXO7Q.js";import{a as e,b as n}from"./runtime-chunk-KGZNRID6.js";import"./runtime-chunk-R43XZP65.js";import"./runtime-chunk-5JEZ42OM.js";import"./runtime-chunk-F3ZACLZW.js";import"./runtime-chunk-YULW5JRE.js";import"./runtime-chunk-FTVQTRM7.js";import"./runtime-chunk-32KZP4YN.js";import"./runtime-chunk-E3IEBR27.js";import"./runtime-chunk-EJJZJ5MV.js";import"./runtime-chunk-AELTGHV2.js";import"./runtime-chunk-DK66VKWP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as r,e as s}from"./runtime-chunk-EPHVY3XO.js";import"./runtime-chunk-CKT62HES.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-U4QOT2PX.js";import{a as h}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-VPEJ5BFD.js";import{Bc as o,Cc as m}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var a=class extends o{constructor(t,i,n,r,s){super(),this.data=t,this.page=i,this.animationControls=n,this.shared=r,this.condition=s,this.startOnceDelay=0,this.toggleIsForward=!1;let h=t.object,o=i.scene.find(t.object);o&&Array.isArray(o.identity)&&(h=o.identity[0]),this.data={...t,object:h};let m=this.animationControls.clipIdToAction[t.clipId+"/"+h];if(this.duration=m?.getClip()?.duration??1,this.data.crop2){let t=e(m?.getClip());this.leftFrameTime=this.data.crop2[0]/(t-1)*this.duration,this.rightFrameTime=this.data.crop2[1]/(t-1)*this.duration}else{let t=m?.getClip()?.tracks[0]?.times.length;t&&t>1?(this.leftFrameTime=this.data.crop[0]/t*this.duration,this.rightFrameTime=this.data.crop[1]/t*this.duration):(this.leftFrameTime=0,this.rightFrameTime=this.duration)}this.startOnceDelay=t.delay}get playing(){return this.threeAnimAction?.isRunning()??!1}play(t=!1){if(!1===s(this.shared,this.condition))return!1;window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{if(this.threeAnimAction=this.animationControls.play(this.data),!this.threeAnimAction)return;this.threeAnimAction.reset(),this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime;let i=this.data.object;Object.entries(this.animationControls.clipIdToAction).forEach(([e,n])=>{let r=e.split("/")[1];this.threeAnimAction!==n&&r===i&&(t?n.fadeOut(.2):n.stop())}),t&&this.threeAnimAction?.fadeIn(.2)},this.startOnceDelay)}pause(){this.threeAnimAction&&(this.threeAnimAction.paused=!0),window.clearTimeout(this.timeoutId),delete this.timeoutId}stop(){this.threeAnimAction?.fadeOut(.2)}seek(t){this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction&&(this.threeAnimAction.paused=!0,this.threeAnimAction.time=m.clamp(this.threeAnimAction.time+1/60*t,this.leftFrameTime,this.rightFrameTime-16e-5),this.animationControls.needsUpdate=!0,this.animationControls.requestRender())}toggle(t,i=!1){if(!1===s(this.shared,this.condition))return!1;this.toggleIsForward=t??!this.toggleIsForward,this.threeAnimAction&&(this.threeAnimAction._loopCount=0),this.playing?this.threeAnimAction&&(this.threeAnimAction.timeScale=this.toggleIsForward?1:-1,this.toggleIsForward?(this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime)):this.timeoutId=window.setTimeout(()=>{if(this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction){this.toggleIsForward?(this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction.time=this.rightFrameTime,this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime),this.threeAnimAction.paused=!1,this.threeAnimAction.timeScale=this.toggleIsForward?1:-1;let t=this.data.clipId.split("/")[1];Object.entries(this.animationControls.clipIdToAction).forEach(([e,n])=>{let r=e.split("/")[1];this.threeAnimAction!==n&&r===t&&n.isRunning()&&(i?n.fadeOut(.2):n.stop())}),i&&this.threeAnimAction?.fadeIn(.2)}},this.startOnceDelay)}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){let t=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object]?.getClip();t&&(t.duration=this.duration),this.pause()}};n(i),r("Transition",({eventType:i,data:e,page:n,shared:r,actionCondition:s})=>new t(i,e,n,r,s)),r("Animation",({data:t,page:i,eventManager:e,shared:n,actionCondition:r})=>new a(t,i,e.animationControls,n,r)),h("transitions");
@@ -1 +1 @@
1
- import{a as e}from"./runtime-chunk-CVUJ3GMH.js";import{a as t,b as i,c as r,d as a,f as s,g as n,h,i as d,j as o,k as m,l as c,m as u,n as l}from"./runtime-chunk-FY3XD5P2.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-FTVQTRM7.js";import{I as p,ea as f}from"./runtime-chunk-SXPM42HJ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as v}from"./runtime-chunk-4KX4KQWR.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import{e as g,f as y}from"./runtime-chunk-R34HNX2O.js";import{a as w,f as O,j as P}from"./runtime-chunk-TZCHGFVF.js";import{E as j}from"./runtime-chunk-RBM3UDQF.js";import{Ae as b,Ba as R,Bd as x,Cc as S,Lc as F,Le as T,bd as H,ce as D,dd as I,ld as W}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";function M(e,t,i,r){return r?i:2048/Math.max(1,e,t)}var U=new b(-1,1,1,-1,0,1),B=new class extends I{constructor(){super(),this.setAttribute("position",new H([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new H([0,2,0,0,2,0],2))}},E=new D({defines:{},uniforms:{tDiffuse:new T(null)},vertexShader:"\n\tvarying vec2 vUv;\n\tvoid main() {\n\t\tvUv = uv;\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t}",fragmentShader:"\n\tuniform sampler2D tDiffuse;\n\tvarying vec2 vUv;\n\tvoid main() {\n\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\tgl_FragColor = texel;\n\t}"}),z=new class{constructor(e){this._mesh=new W(B,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,U)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}(E),G=null,k=null,_=t.identity(),C=class{constructor(t,i,r,s){var n;this.uuid=t,this.width=i,this.height=r,this.context=s,this.enabled=!0,this.isScreenSpace=!1,this.dpr=window.devicePixelRatio,this.isFrameDirty=!1,this.onRenderRequestedDownstream=()=>{this.isFrameDirty=!0,this.isScreenSpace||e(this),this.context.shared.requestRender()},this._innerApplySize=()=>{let e=this.width,t=this.height;this.renderer.dpr=M(e,t,this.dpr,this.isScreenSpace),this.renderer.setSize(e,t)},this.onFrameOverrideObjectEvent=e=>{if(void 0!==e.target?.uuid){let t=this.frameRoot?.find(e.target.uuid);t&&t.dispatchEvent({...e,target:t})}},this.scene2d=new u(S.generateUUID(),y.defaultData,{dpr:window.devicePixelRatio,shared:s.shared}),this.canvas=(null===G&&(G=document.createElement("canvas")),G),this.renderer=(n=this.canvas,null===k&&(k=new a(n)),k),this.promise=this.init(),this.renderTarget=new F(1,1,{type:R,stencilBuffer:!1,depthBuffer:!1}),s.shared.addUIBuffer(this.uuid,this.renderTarget),this.textureHolder=s.shared.uiBuffer(this.uuid)}get canvasTexture(){return this._canvasTexture||(this._canvasTexture=new x(this.canvas)),this._canvasTexture}async init(){await this.renderer.init(),this.renderer.uiFontReady?.then(()=>{this.frameOverride&&this.onRenderRequestedDownstream()})}render(e){if(this.isFrameDirty){if(this.isFrameDirty=!1,this._innerApplySize(),this.renderer.clear(),this.frameOverride?.draw(this.renderer),this.renderer.render(),this.canvasTexture.needsUpdate=!0,e.blitTextureToTarget)e.blitTextureToTarget(this.canvasTexture,this.renderTarget);else{E.uniforms.tDiffuse.value=this.canvasTexture;let t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.clear(),z.render(e),e.setRenderTarget(t)}this.textureHolder?.setNeedsUpdate(!0)}}updateEntity2DByOp(e,t,i,r){this.scene2d.updateEntityByOp(e,t,i,r),this.applySize()}updateTreeByOp(e,t){this.scene2d.updateTreeByOp(e,t),this.applySize()}applyOverrides(e){if(this.frameOverride&&this.frameRoot){this.frameOverride.position=[0,0],this.frameOverride.rotation=0;let t=e?.width??this.width,i=e?.height??this.height;this.frameOverride.width=t,this.frameOverride.height=i,this.frameOverride.localMatrix=_,this.isScreenSpace&&(this.frameOverride.fill.color=j.from0to1([0,0,0,0])),this.frameOverride.data={...this.frameOverride.data,width:t,height:i},L({objectOverride:this.frameOverride,objectRoot:this.frameRoot,newParentWidth:this.frameOverride.width,newParentHeight:this.frameOverride.height,initialParentWidth:this.frameRoot.width,initialParentHeight:this.frameRoot.height}),this.frameOverride.updateWorldMatrix(!0,!1,!0)}}applySize(e,t=window.devicePixelRatio){let i=Math.max(1,e?.width??this.width),r=Math.max(1,e?.height??this.height);this.dpr=t,this.width=i,this.height=r,this._innerApplySize();let a=function(e,t,i,r){let a=M(e,t,i,r),s=Math.max(i,512/Math.min(e,t)),n=Math.min(s,a);return{width:Math.max(1,Math.ceil(e*n)),height:Math.max(1,Math.ceil(t*n))}}(i,r,t,this.isScreenSpace);this.renderTarget.setSize(a.width,a.height),this._canvasTexture?.dispose(),this._canvasTexture=void 0,this.applyOverrides(e),this.frameOverride?.requestRender()}applyFrame(e){let t=this.context.scene.find2D(e);if(t&&t instanceof o)return this.disposeFrameOverride(),this.frameRoot=t,this.frameOverride=t.clone({dpr:this.renderer.dpr,shared:this.context.shared}),this.scene2d.add(this.frameOverride),this.applySize(),this.frame?.addEventListener("render",this.onRenderRequestedDownstream),this.frameOverride.traverse(e=>{e.addEventListener("beginState",this.onFrameOverrideObjectEvent),e.addEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frame?.requestRender(),t}get frame(){return this.frameOverride}get frameId(){return this.frame?.uuid}find(e){return this.scene2d.find(e)}get texture(){return this.textureHolder?.getTexture(1001)}disposeFrameOverride(){this.frameOverride?.removeEventListener("render",this.onRenderRequestedDownstream),this.frameOverride?.traverse(e=>{e.removeEventListener("beginState",this.onFrameOverrideObjectEvent),e.removeEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frameOverride&&this.scene2d.remove(this.frameOverride)}};function L({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){if(e instanceof o&&t instanceof o||e instanceof d&&t instanceof d)for(let n=0,h=e.children.length;n<h;n++){let h=e.children[n],d=t.children[n];h&&d&&h.uuid===d.uuid&&q({objectOverride:h,objectRoot:d,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s})}}function q({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){let[n,h]=function(e){if(A(e))return[e.width,e.height];if(e instanceof m){let[t,i]=e.getHalfSize();return[2*t,2*i]}if(e instanceof d){let[t,i]=e.recursiveBBox.getHalfSize();return[2*t,2*i]}return[0,0]}(t),{width:o,height:u,position:p}=l({constraints:e.data,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s,objectInitialWidth:n,objectInitialHeight:h,objectInitialPosition:t.position});if(e.position=p,e.data={...e.data,position:p},e.states)for(let n in e.states)X({stateId:n,objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s});if(A(e)||e instanceof d)A(e)&&(e.width=o,e.height=u,e.data={...e.data,width:o,height:u}),L({objectOverride:e,objectRoot:t,newParentWidth:o,newParentHeight:u,initialParentWidth:n,initialParentHeight:h});else if(e instanceof m){let i=t,r=0!==n?o/n:1,a=0!==h?u/h:1;e.path=c(i.path,r,a),e.data={...e.data,path:e.path}}}function X({stateId:e,objectOverride:t,objectRoot:i,newParentWidth:r,newParentHeight:a,initialParentWidth:s,initialParentHeight:n}){let h=t.states?.[e],d=i.states?.[e];if(h&&d){let{width:i,height:o,position:m}=l({constraints:t.data,newParentWidth:r,newParentHeight:a,initialParentWidth:s,initialParentHeight:n,objectInitialWidth:g.isResizeable(d)?d.width:0,objectInitialHeight:g.isResizeable(d)?d.height:0,objectInitialPosition:d.position});Object.assign(t.states[e],{position:m}),g.isResizeable(h)&&Object.assign(t.states[e],{width:i,height:o})}}function A(e){return e instanceof n||e instanceof o||e instanceof s||e instanceof h}var N=class extends f{constructor(e,t,i){super(e,t,i),this.isUIObject=!0,this.uiCanvas=new C(e+"-canvas",t.geometry.width,t.geometry.height,i),this.uiCanvas.promise.then(()=>{this.applyFrame(this.dataPatched.geometry.frame,i.shared)})}updateByPatchedOpGeometry(e,t,i){super.updateByPatchedOpGeometry(e,t,i),0===e.type&&(void 0!==e.props.frame&&this.applyFrame(e.props.frame,i.shared),(void 0!==e.props.width||void 0!==e.props.height)&&this.applySize(e.props,i.shared))}applySize(e,t){let i=e?.width??this.dataPatched.geometry.width,r=e?.height??this.dataPatched.geometry.height;this.uiCanvas.applySize({width:i,height:r}),this.applyGeometryParametersFromFrame(t)}applyFrame(e,t){this.uiCanvas.applyFrame(e),this.applyGeometryParametersFromFrame(t),this.applyMaterialParametersFromFrame({shared:t})}applyGeometryParametersFromFrame(e){let t=this.frame;t&&(Object.assign(this.data,{geometry:Object.assign(this.data.geometry,{cornerRadius:t.cornerRadius,cornerType:0})}),Object.assign(this.dataPatched,{geometry:Object.assign(this.dataPatched.geometry,{cornerRadius:t.cornerRadius,cornerType:0})}),this.localGeometry?.dispose(),this.localGeometry=p(this.dataPatched.geometry,e,this.data.flatShading,this))}applyMaterialParametersFromFrame(e){let t=this.frame;if(t){let i=t.data.backgroundBlur;Object.assign(this.data.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.data.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),Object.assign(this.dataPatched.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.dataPatched.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),this.material.reset?.(this.dataPatched.material,e,!0)}}updateEntity2DByOp(e,t,i,r){this.uiCanvas.updateEntity2DByOp(e,t,i,r),e===this.frameId&&0===t.type&&(void 0!==t.props.cornerRadius?this.applyGeometryParametersFromFrame(r):v(t.path,["backgroundBlur"])&&this.applyMaterialParametersFromFrame({shared:r}))}get frame(){return this.uiCanvas.frame}get frameId(){return this.frame?.uuid}removeInteractionGeometry(e){super.removeInteractionGeometry(e),this.applySize({},e)}updateGeometryInteractions(e,t){super.updateGeometryInteractions(e,t),this.applySize({width:e.width,height:e.height},t);let i={...this.data.geometry,...e};this.localGeometry?.dispose(),this.localGeometry=p(i,t,this.data.flatShading,this)}};O("UIGeometry",(e,t,i)=>new N(e,t,i)),P({Scene2D:u,UICanvas:C,loadHanaUIRUNTIME:r,setHanaUIWasmUrl:i}),w("ui-2d");
1
+ import{a as e}from"./runtime-chunk-CVUJ3GMH.js";import{a as t,b as i,c as r,d as a,f as s,g as n,h,i as d,j as o,k as m,l as c,m as u,n as l}from"./runtime-chunk-KE6HNYUL.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-FTVQTRM7.js";import{I as p,ea as f}from"./runtime-chunk-DK66VKWP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as v}from"./runtime-chunk-CKT62HES.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import{e as g,f as y}from"./runtime-chunk-U4QOT2PX.js";import{a as w,f as O,j as P}from"./runtime-chunk-TZCHGFVF.js";import{E as j}from"./runtime-chunk-VPEJ5BFD.js";import{Ae as b,Ba as x,Bd as R,Cc as S,Lc as T,Le as F,bd as H,ce as D,dd as I,ld as W}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";function E(e,t,i,r){return r?i:2048/Math.max(1,e,t)}var U=new b(-1,1,1,-1,0,1),B=new class extends I{constructor(){super(),this.setAttribute("position",new H([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new H([0,2,0,0,2,0],2))}},M=new D({defines:{},uniforms:{tDiffuse:new F(null)},vertexShader:"\n\tvarying vec2 vUv;\n\tvoid main() {\n\t\tvUv = uv;\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t}",fragmentShader:"\n\tuniform sampler2D tDiffuse;\n\tvarying vec2 vUv;\n\tvoid main() {\n\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\tgl_FragColor = texel;\n\t}"}),z=new class{constructor(e){this._mesh=new W(B,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,U)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}(M),G=null,k=null,_=t.identity(),C=class{constructor(t,i,r,s){var n;this.uuid=t,this.width=i,this.height=r,this.context=s,this.enabled=!0,this.isScreenSpace=!1,this.dpr=window.devicePixelRatio,this.isFrameDirty=!1,this.onRenderRequestedDownstream=()=>{this.isFrameDirty=!0,this.isScreenSpace||e(this),this.context.shared.requestRender()},this._innerApplySize=()=>{let e=this.width,t=this.height;this.renderer.dpr=E(e,t,this.dpr,this.isScreenSpace),this.renderer.setSize(e,t)},this.onFrameOverrideObjectEvent=e=>{if(void 0!==e.target?.uuid){let t=this.frameRoot?.find(e.target.uuid);t&&t.dispatchEvent({...e,target:t})}},this.scene2d=new u(S.generateUUID(),y.defaultData,{dpr:window.devicePixelRatio,shared:s.shared}),this.canvas=(null===G&&(G=document.createElement("canvas")),G),this.renderer=(n=this.canvas,null===k&&(k=new a(n)),k),this.promise=this.init(),this.renderTarget=new T(1,1,{type:x,stencilBuffer:!1,depthBuffer:!1}),s.shared.addUIBuffer(this.uuid,this.renderTarget),this.textureHolder=s.shared.uiBuffer(this.uuid)}get canvasTexture(){return this._canvasTexture||(this._canvasTexture=new R(this.canvas)),this._canvasTexture}async init(){await this.renderer.init(),this.renderer.uiFontReady?.then(()=>{this.frameOverride&&this.onRenderRequestedDownstream()})}render(e){if(this.isFrameDirty){if(this.isFrameDirty=!1,this._innerApplySize(),this.renderer.clear(),this.frameOverride?.draw(this.renderer),this.renderer.render(),this.canvasTexture.needsUpdate=!0,e.blitTextureToTarget)e.blitTextureToTarget(this.canvasTexture,this.renderTarget);else{M.uniforms.tDiffuse.value=this.canvasTexture;let t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.clear(),z.render(e),e.setRenderTarget(t)}this.textureHolder?.setNeedsUpdate(!0)}}updateEntity2DByOp(e,t,i,r){this.scene2d.updateEntityByOp(e,t,i,r),this.applySize()}updateTreeByOp(e,t){this.scene2d.updateTreeByOp(e,t),this.applySize()}applyOverrides(e){if(this.frameOverride&&this.frameRoot){this.frameOverride.position=[0,0],this.frameOverride.rotation=0;let t=e?.width??this.width,i=e?.height??this.height;this.frameOverride.width=t,this.frameOverride.height=i,this.frameOverride.localMatrix=_,this.isScreenSpace&&(this.frameOverride.fill.color=j.from0to1([0,0,0,0])),this.frameOverride.data={...this.frameOverride.data,width:t,height:i},L({objectOverride:this.frameOverride,objectRoot:this.frameRoot,newParentWidth:this.frameOverride.width,newParentHeight:this.frameOverride.height,initialParentWidth:this.frameRoot.width,initialParentHeight:this.frameRoot.height}),this.frameOverride.updateWorldMatrix(!0,!1,!0)}}applySize(e,t=window.devicePixelRatio){let i=Math.max(1,e?.width??this.width),r=Math.max(1,e?.height??this.height);this.dpr=t,this.width=i,this.height=r,this._innerApplySize();let a=function(e,t,i,r){let a=E(e,t,i,r),s=Math.max(i,512/Math.min(e,t)),n=Math.min(s,a);return{width:Math.max(1,Math.ceil(e*n)),height:Math.max(1,Math.ceil(t*n))}}(i,r,t,this.isScreenSpace);this.renderTarget.setSize(a.width,a.height),this._canvasTexture?.dispose(),this._canvasTexture=void 0,this.applyOverrides(e),this.frameOverride?.requestRender()}applyFrame(e){let t=this.context.scene.find2D(e);if(t&&t instanceof o)return this.disposeFrameOverride(),this.frameRoot=t,this.frameOverride=t.clone({dpr:this.renderer.dpr,shared:this.context.shared}),this.scene2d.add(this.frameOverride),this.applySize(),this.frame?.addEventListener("render",this.onRenderRequestedDownstream),this.frameOverride.traverse(e=>{e.addEventListener("beginState",this.onFrameOverrideObjectEvent),e.addEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frame?.requestRender(),t}get frame(){return this.frameOverride}get frameId(){return this.frame?.uuid}find(e){return this.scene2d.find(e)}get texture(){return this.textureHolder?.getTexture(1001)}disposeFrameOverride(){this.frameOverride?.removeEventListener("render",this.onRenderRequestedDownstream),this.frameOverride?.traverse(e=>{e.removeEventListener("beginState",this.onFrameOverrideObjectEvent),e.removeEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frameOverride&&this.scene2d.remove(this.frameOverride)}};function L({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){if(e instanceof o&&t instanceof o||e instanceof d&&t instanceof d)for(let n=0,h=e.children.length;n<h;n++){let h=e.children[n],d=t.children[n];h&&d&&h.uuid===d.uuid&&V({objectOverride:h,objectRoot:d,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s})}}function V({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){let[n,h]=function(e){if(A(e))return[e.width,e.height];if(e instanceof m){let[t,i]=e.getHalfSize();return[2*t,2*i]}if(e instanceof d){let[t,i]=e.recursiveBBox.getHalfSize();return[2*t,2*i]}return[0,0]}(t),{width:o,height:u,position:p}=l({constraints:e.data,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s,objectInitialWidth:n,objectInitialHeight:h,objectInitialPosition:t.position});if(e.position=p,e.data={...e.data,position:p},e.states)for(let n in e.states)q({stateId:n,objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s});if(A(e)||e instanceof d)A(e)&&(e.width=o,e.height=u,e.data={...e.data,width:o,height:u}),L({objectOverride:e,objectRoot:t,newParentWidth:o,newParentHeight:u,initialParentWidth:n,initialParentHeight:h});else if(e instanceof m){let i=t,r=0!==n?o/n:1,a=0!==h?u/h:1;e.path=c(i.path,r,a),e.data={...e.data,path:e.path}}}function q({stateId:e,objectOverride:t,objectRoot:i,newParentWidth:r,newParentHeight:a,initialParentWidth:s,initialParentHeight:n}){let h=t.states?.[e],d=i.states?.[e];if(h&&d){let{width:i,height:o,position:m}=l({constraints:t.data,newParentWidth:r,newParentHeight:a,initialParentWidth:s,initialParentHeight:n,objectInitialWidth:g.isResizeable(d)?d.width:0,objectInitialHeight:g.isResizeable(d)?d.height:0,objectInitialPosition:d.position});Object.assign(t.states[e],{position:m}),g.isResizeable(h)&&Object.assign(t.states[e],{width:i,height:o})}}function A(e){return e instanceof n||e instanceof o||e instanceof s||e instanceof h}var N=class extends f{constructor(e,t,i){super(e,t,i),this.isUIObject=!0,this.uiCanvas=new C(e+"-canvas",t.geometry.width,t.geometry.height,i),this.uiCanvas.promise.then(()=>{this.applyFrame(this.dataPatched.geometry.frame,i.shared)})}updateByPatchedOpGeometry(e,t,i){super.updateByPatchedOpGeometry(e,t,i),0===e.type&&(void 0!==e.props.frame&&this.applyFrame(e.props.frame,i.shared),(void 0!==e.props.width||void 0!==e.props.height)&&this.applySize(e.props,i.shared))}applySize(e,t){let i=e?.width??this.dataPatched.geometry.width,r=e?.height??this.dataPatched.geometry.height;this.uiCanvas.applySize({width:i,height:r}),this.applyGeometryParametersFromFrame(t)}applyFrame(e,t){this.uiCanvas.applyFrame(e),this.applyGeometryParametersFromFrame(t),this.applyMaterialParametersFromFrame({shared:t})}applyGeometryParametersFromFrame(e){let t=this.frame;t&&(Object.assign(this.data,{geometry:Object.assign(this.data.geometry,{cornerRadius:t.cornerRadius,cornerType:0})}),Object.assign(this.dataPatched,{geometry:Object.assign(this.dataPatched.geometry,{cornerRadius:t.cornerRadius,cornerType:0})}),this.localGeometry?.dispose(),this.localGeometry=p(this.dataPatched.geometry,e,this.data.flatShading,this))}applyMaterialParametersFromFrame(e){let t=this.frame;if(t){let i=t.data.backgroundBlur;Object.assign(this.data.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.data.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),Object.assign(this.dataPatched.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.dataPatched.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),this.material.reset?.(this.dataPatched.material,e,!0)}}updateEntity2DByOp(e,t,i,r){this.uiCanvas.updateEntity2DByOp(e,t,i,r),e===this.frameId&&0===t.type&&(void 0!==t.props.cornerRadius?this.applyGeometryParametersFromFrame(r):v(t.path,["backgroundBlur"])&&this.applyMaterialParametersFromFrame({shared:r}))}get frame(){return this.uiCanvas.frame}get frameId(){return this.frame?.uuid}removeInteractionGeometry(e){super.removeInteractionGeometry(e),this.applySize({},e)}updateGeometryInteractions(e,t){super.updateGeometryInteractions(e,t),this.applySize({width:e.width,height:e.height},t);let i={...this.data.geometry,...e};this.localGeometry?.dispose(),this.localGeometry=p(i,t,this.data.flatShading,this)}};O("UIGeometry",(e,t,i)=>new N(e,t,i)),P({Scene2D:u,UICanvas:C,loadHanaUIRUNTIME:r,setHanaUIWasmUrl:i}),w("ui-2d");
@@ -1 +1 @@
1
- import{Ma as a,Na as e,Oa as t,Pa as s,Qa as u,Ra as m,Sa as c}from"./runtime-chunk-RBM3UDQF.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";export{u as updateAllMaterials,c as updateDocumentSchema,m as updateLibSchema,e as updateMaterialSchema,t as updateObjectStateRec,s as updateObjectsSchema,a as updateTextValues};
1
+ import{Ma as a,Na as e,Oa as t,Pa as s,Qa as u,Ra as m,Sa as c}from"./runtime-chunk-VPEJ5BFD.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";export{u as updateAllMaterials,c as updateDocumentSchema,m as updateLibSchema,e as updateMaterialSchema,t as updateObjectStateRec,s as updateObjectsSchema,a as updateTextValues};
@@ -0,0 +1,5 @@
1
+ Z`��tkq7~uf�41�Tw�R܌�!���b��<a #�����w���z��
2
+ >�V
3
+ �������Ý�E�ա0�y_C}�U_'8v%��e/��ڊ�f*�f�I�,ś�y��� 67χ���zRϬ^�P
4
+ 5d�T�>;U��
5
+ ���CE�Ҫ&�
@@ -1 +1 @@
1
- import{b as e}from"./runtime-chunk-TU4KDRKR.js";import{a,b as t}from"./runtime-chunk-DZNU62CT.js";import{a as i,b as s,e as r,f as n,g as d}from"./runtime-chunk-NWCLOXDY.js";import"./runtime-chunk-R34HNX2O.js";import{a as o}from"./runtime-chunk-TZCHGFVF.js";import{Ha as h,Ia as l,v as c}from"./runtime-chunk-RBM3UDQF.js";import{Cc as m,Ec as p,Fc as u,Oc as y,Pc as V}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var b=new y,v=new u,f=new p,g=new u,T=new V,I=class extends a{constructor(a,t,i,s,r){super(a),this.sharedVariables=t,this.eventManager=i,this.needsMouse=s,this.needsRaycast=r,this.dynamicVars=[],this.variablesToWatch=[],this.prevMouseProperty=null,this.prevRaycastProperty=null,this.pauseTime=0,this.isOutOfFocus=!1,this.events=[],this.onFrame=a=>{let t=this.eventContext.sharedAssets;if(this.rafId=window.requestAnimationFrame(this.onFrame),this.isOutOfFocus)return;let i=new Date,s=[],r=[];for(let e=0;e<this.propertiesToWatch.length;e++){let{objectId:a,property:t,prevValue:i}=this.propertiesToWatch[e],s=this.eventContext.scene.find(a),n=c.propertyPaths[t];if("width"===n[0]||"height"===n[0]||"depth"===n[0])s=s.geometry.userData.parameters[n[0]];else if(("position"===n[0]||"rotation"===n[0]&&n.length>1)&&s.getPhysicsLocalMatrix?.(b))b.decompose(v,f,g),"position"===n[0]?s=n.length>1?v[n[1]]:v:(T.setFromQuaternion(f,s.rotation.order),s=T[n[1]]);else for(let e=0;e<n.length;e++)s=s[n[e]];null===i?this.propertiesToWatch[e].prevValue=s instanceof u?s.clone():s:(s instanceof u?!s.equals(i):i!==s)&&(r.push({objId:a,property:t}),s instanceof u?this.propertiesToWatch[e].prevValue.copy(s):this.propertiesToWatch[e].prevValue=s)}for(let e=0;e<this.variablesToWatch.length;e++){let{id:a,prevValue:i}=this.variablesToWatch[e],r=t.getVariable(a);r!==i&&(s.push(a),this.variablesToWatch[e].prevValue=r)}for(let r=0;r<this.dynamicVars.length;r++){let{id:n,expectedTime:d,last:o,data:c,timerSeconds:p,startValue:u}=this.dynamicVars[r],y=1e3;if("timer"!==c.dynamicVariableType&&"stopwatch"!==c.dynamicVariableType||"number3decimal"!==c.format?"counter"===c.dynamicVariableType?y=c.updateInterval:"random"===c.dynamicVariableType&&(y=c.isStatic?1/0:c.updateInterval):y=1,-1!==d){if("Stopped"!==t.getDynamicVariablePlayState(n)&&"Restarted"!==t.getDynamicVariablePlayState(n)||(this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime=a+y,"counter"===c.dynamicVariableType&&t.getVariable(n)!==u&&(t.updateVariable(n,u),this.eventManager.requestRender()),("timer"===c.dynamicVariableType||"stopwatch"===c.dynamicVariableType)&&this.dynamicVars[r].timerSeconds!==u&&(this.dynamicVars[r].timerSeconds=u,t.updateVariable(n,l.getFormattedTimerTime(u,c)),this.eventManager.requestRender()),"Restarted"===t.getDynamicVariablePlayState(n)&&t.setDynamicVariablePlayState(n,"Playing"),"Stopped"!==t.getDynamicVariablePlayState(n))){if("Paused"===t.getDynamicVariablePlayState(n)){void 0===this.dynamicVars[r].deltaToExpectedTime&&(this.dynamicVars[r].deltaToExpectedTime=Math.max(this.dynamicVars[r].expectedTime-a,0)),this.dynamicVars[r].last=a-(y-this.dynamicVars[r].deltaToExpectedTime),this.dynamicVars[r].expectedTime=a+this.dynamicVars[r].deltaToExpectedTime;continue}if(this.dynamicVars[r].deltaToExpectedTime=void 0,a>=d)if(this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime+=y,"random"===c.dynamicVariableType){let e=c.min+Math.random()*(c.max-c.min),a=c.decimals;e=Math.round(e*Math.pow(10,a))/Math.pow(10,a),t.updateVariable(n,e),s.push(n),this.eventManager.requestRender()}else if("counter"===c.dynamicVariableType){let e=t.getVariable(n),a=t.getDynamicVariableToggleIsForward(n)??!0,i=t.getVariable(n)+c.increment*(a?1:-1);c.hasEnd&&(i=c.increment>0?m.clamp(i,u,c.endValue):m.clamp(i,c.endValue,u),i===u&&t.setDynamicVariableToggleIsForward(n,void 0),c.repeat?i===c.endValue&&(i=u):(i===u||i===c.endValue)&&t.setDynamicVariablePlayState(n,"Paused")),i!==e&&(s.push(n),t.updateVariable(n,i),this.eventManager.requestRender())}else if("time"===c.dynamicVariableType){let a=t.getVariable(n),r=e(i,c);if("object"==typeof a&&"textValue"in a&&"object"==typeof r&&"textValue"in r){if(Array.isArray(a.textValue)&&Array.isArray(r.textValue)){if(a.textValue.every((e,a)=>e===r.textValue[a]))continue}else if(a.textValue===r.textValue)continue}else if(a===r)continue;t.updateVariable(n,r),s.push(n),this.eventManager.requestRender()}else{let e=h.isTextValue(c.endValue)?w(c.endValue.textValue):c.endValue,i=t.getDynamicVariableToggleIsForward(n)??!0,d=p+(a-o)/1e3*("timer"===c.dynamicVariableType?-1:1)*(i?1:-1);d=Math.max(d,0),c.hasEnd&&(d="stopwatch"===c.dynamicVariableType?m.clamp(d,u,e):m.clamp(d,e,u),d===u&&t.setDynamicVariableToggleIsForward(n,void 0),c.repeat?Math.abs(d-e)<("number3decimal"===c.format?1e-4:.1)&&(d=u):(Math.abs(d-u)<("number3decimal"===c.format?1e-4:.1)||Math.abs(d-e)<("number3decimal"===c.format?1e-4:.1))&&t.setDynamicVariablePlayState(n,"Paused")),d!==p&&(s.push(n),this.dynamicVars[r].timerSeconds=d,t.updateVariable(n,l.getFormattedTimerTime(d,c)),this.eventManager.requestRender())}}}else this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime=a+y}let n=!1;t.mouseProperty!==this.prevMouseProperty&&(this.prevMouseProperty=t.mouseProperty,n=!0);let d=!1;t.raycastProperty!==this.prevRaycastProperty&&(this.prevRaycastProperty=t.raycastProperty,d=!0),this.events.forEach(e=>{(s.includes(e.data.variableId)||r.find(a=>a.objId===e.data.objectId&&a.property===e.data.property)||"mouseProperty"===e.data.variableId&&n||"raycastProperty"===e.data.variableId&&d)&&(e.dispatch(),this.eventManager.requestRender())})},this.onBlur=()=>{this.pause()},this.onFocus=()=>{this.resume()}}pause(){this.isOutOfFocus||(this.isOutOfFocus=!0,this.pauseTime=Date.now())}resume(){if(!this.isOutOfFocus)return;this.isOutOfFocus=!1;let e=Date.now()-this.pauseTime;for(let a=0;a<this.dynamicVars.length;a++)this.dynamicVars[a].last+=e,this.dynamicVars[a].expectedTime+=e}connect(){this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"VariableChange"===e.data.type&&!e.data.disabled).forEach(a=>{this.events.push(new P(a.id,a.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),this.propertiesToWatch=this.events.filter(e=>"objectProperty"===e.data.variableId&&null!==e.data.objectId).map(e=>({objectId:e.data.objectId,property:e.data.property,prevValue:null}));let a=this.eventContext.sharedAssets;this.sharedVariables.forEach(({id:t,data:i})=>{if(!("dynamicVariableType"in i))return void(this.events.find(e=>e.data.variableId===t)&&this.variablesToWatch.push({id:t,prevValue:a.getVariable(t)}));let s;if("timer"===i.dynamicVariableType||"stopwatch"===i.dynamicVariableType){let e;if(h.isTextValue(i.value)&&Array.isArray(i.value.textValue)){let a=i.value.textValue;e=3===a.length?a[2]+60*a[1]+3600*a[0]:a[1]+60*a[0]}else e=i.value;s=e,this.dynamicVars.push({id:t,last:-1,expectedTime:-1,data:i,timerSeconds:e,startValue:s})}else"time"===i.dynamicVariableType&&a.updateVariable(t,e(new Date,i)),"counter"===i.dynamicVariableType&&(s=h.isTextValue(i.value)?w(i.value.textValue):i.value),this.dynamicVars.push({id:t,last:-1,expectedTime:-1,data:i,startValue:s})}),this.rafId=window.requestAnimationFrame(this.onFrame),window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus)}disconnect(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.rafId&&(window.cancelAnimationFrame(this.rafId),this.rafId=void 0),this.events.forEach(e=>e.dispose())}},P=class{constructor(e,a,t,i,s,r){this.id=e,this.data=a,this.object=t,this.actions=n(a,a.actions,i,s,r,t)}dispatch(){let e=this.actions;e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.TimelineAnimation.forEach(e=>e.dispatchConditional()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}dispose(){d(this.actions)}};function w(e){return 3===e.length?e[2]+60*e[1]+3600*e[0]:e[1]+60*e[0]}var x=class{constructor(e,a,t,i){this.data=e,this.page=a,this.shared=t,this.condition=i,this.evaluatedCondition=!1}checkConditions(){this.evaluatedCondition=r(this.shared,this.condition)}dispatch(){if(!1===this.evaluatedCondition)return!1;let e=this.shared.getVariable(this.data.variableId),a=i(this.data.expression,this.shared,h.typeOfVariable(e));void 0!==a&&this.shared.updateVariable(this.data.variableId,"string"==typeof a?{textValue:a}:a)}dispose(){}},D=class{constructor(e,a,t,i){this.data=e,this.page=a,this.shared=t,this.condition=i,this.timeoutId=null}dispatchInner(){if(!1===r(this.shared,this.condition))return!1;let e=this.shared.getDynamicVariablePlayState(this.data.variableId);if("PlayPause"===this.data.mode)void 0===this.shared.getDynamicVariableToggleIsForward(this.data.variableId)&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"===e?"Paused":"Playing");else if("Play"===this.data.mode&&"Playing"!==e)void 0===this.shared.getDynamicVariableToggleIsForward(this.data.variableId)&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing");else if("Stop"===this.data.mode&&"Stopped"!==e)this.shared.setDynamicVariablePlayState(this.data.variableId,"Stopped");else if("Pause"===this.data.mode&&"Paused"!==e)this.shared.setDynamicVariablePlayState(this.data.variableId,"Paused");else if("Restart"===this.data.mode)this.shared.setDynamicVariablePlayState(this.data.variableId,"Restarted");else if("Toggle"===this.data.mode){let a=this.shared.getDynamicVariableToggleIsForward(this.data.variableId);"Playing"===e?this.shared.setDynamicVariableToggleIsForward(this.data.variableId,void 0!==a&&!a):(this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!a),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"))}}dispatch(){let e=this.data.delay,a=this.shared.getDynamicVariablePlayState(this.data.variableId);"PlayPause"===this.data.mode&&"Playing"===a&&(e=this.data.pauseDelay),0!==e?(this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.dispatchInner()},e)):this.dispatchInner()}dispose(){this.timeoutId&&window.clearTimeout(this.timeoutId)}};t("VariableChange",({eventContext:e,sharedVariables:a,eventManager:t,needsMouse:i,needsRaycast:s})=>new I(e,a,t,i,s)),s("SetVariable",({data:e,page:a,shared:t,actionCondition:i})=>new x(e,a,t,i)),s("DynamicVariablePlay",({data:e,page:a,shared:t,actionCondition:i})=>new D(e,a,t,i)),o("variables");
1
+ import{b as e}from"./runtime-chunk-TU4KDRKR.js";import{a,b as t}from"./runtime-chunk-DZNU62CT.js";import{a as i,b as s,e as r,f as n,g as d}from"./runtime-chunk-EPHVY3XO.js";import"./runtime-chunk-U4QOT2PX.js";import{a as o}from"./runtime-chunk-TZCHGFVF.js";import{Ha as h,Ia as l,v as c}from"./runtime-chunk-VPEJ5BFD.js";import{Cc as m,Ec as p,Fc as u,Oc as y,Pc as V}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var b=new y,v=new u,f=new p,g=new u,T=new V,I=class extends a{constructor(a,t,i,s,r){super(a),this.sharedVariables=t,this.eventManager=i,this.needsMouse=s,this.needsRaycast=r,this.dynamicVars=[],this.variablesToWatch=[],this.prevMouseProperty=null,this.prevRaycastProperty=null,this.pauseTime=0,this.isOutOfFocus=!1,this.events=[],this.onFrame=a=>{let t=this.eventContext.sharedAssets;if(this.rafId=window.requestAnimationFrame(this.onFrame),this.isOutOfFocus)return;let i=new Date,s=[],r=[];for(let e=0;e<this.propertiesToWatch.length;e++){let{objectId:a,property:t,prevValue:i}=this.propertiesToWatch[e],s=this.eventContext.scene.find(a),n=c.propertyPaths[t];if("width"===n[0]||"height"===n[0]||"depth"===n[0])s=s.geometry.userData.parameters[n[0]];else if(("position"===n[0]||"rotation"===n[0]&&n.length>1)&&s.getPhysicsLocalMatrix?.(b))b.decompose(v,f,g),"position"===n[0]?s=n.length>1?v[n[1]]:v:(T.setFromQuaternion(f,s.rotation.order),s=T[n[1]]);else for(let e=0;e<n.length;e++)s=s[n[e]];null===i?this.propertiesToWatch[e].prevValue=s instanceof u?s.clone():s:(s instanceof u?!s.equals(i):i!==s)&&(r.push({objId:a,property:t}),s instanceof u?this.propertiesToWatch[e].prevValue.copy(s):this.propertiesToWatch[e].prevValue=s)}for(let e=0;e<this.variablesToWatch.length;e++){let{id:a,prevValue:i}=this.variablesToWatch[e],r=t.getVariable(a);r!==i&&(s.push(a),this.variablesToWatch[e].prevValue=r)}for(let r=0;r<this.dynamicVars.length;r++){let{id:n,expectedTime:d,last:o,data:c,timerSeconds:p,startValue:u}=this.dynamicVars[r],y=1e3;if("timer"!==c.dynamicVariableType&&"stopwatch"!==c.dynamicVariableType||"number3decimal"!==c.format?"counter"===c.dynamicVariableType?y=c.updateInterval:"random"===c.dynamicVariableType&&(y=c.isStatic?1/0:c.updateInterval):y=1,-1!==d){if("Stopped"!==t.getDynamicVariablePlayState(n)&&"Restarted"!==t.getDynamicVariablePlayState(n)||(this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime=a+y,"counter"===c.dynamicVariableType&&t.getVariable(n)!==u&&(t.updateVariable(n,u),this.eventManager.requestRender()),("timer"===c.dynamicVariableType||"stopwatch"===c.dynamicVariableType)&&this.dynamicVars[r].timerSeconds!==u&&(this.dynamicVars[r].timerSeconds=u,t.updateVariable(n,l.getFormattedTimerTime(u,c)),this.eventManager.requestRender()),"Restarted"===t.getDynamicVariablePlayState(n)&&t.setDynamicVariablePlayState(n,"Playing"),"Stopped"!==t.getDynamicVariablePlayState(n))){if("Paused"===t.getDynamicVariablePlayState(n)){void 0===this.dynamicVars[r].deltaToExpectedTime&&(this.dynamicVars[r].deltaToExpectedTime=Math.max(this.dynamicVars[r].expectedTime-a,0)),this.dynamicVars[r].last=a-(y-this.dynamicVars[r].deltaToExpectedTime),this.dynamicVars[r].expectedTime=a+this.dynamicVars[r].deltaToExpectedTime;continue}if(this.dynamicVars[r].deltaToExpectedTime=void 0,a>=d)if(this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime+=y,"random"===c.dynamicVariableType){let e=c.min+Math.random()*(c.max-c.min),a=c.decimals;e=Math.round(e*Math.pow(10,a))/Math.pow(10,a),t.updateVariable(n,e),s.push(n),this.eventManager.requestRender()}else if("counter"===c.dynamicVariableType){let e=t.getVariable(n),a=t.getDynamicVariableToggleIsForward(n)??!0,i=t.getVariable(n)+c.increment*(a?1:-1);c.hasEnd&&(i=c.increment>0?m.clamp(i,u,c.endValue):m.clamp(i,c.endValue,u),i===u&&t.setDynamicVariableToggleIsForward(n,void 0),c.repeat?i===c.endValue&&(i=u):(i===u||i===c.endValue)&&t.setDynamicVariablePlayState(n,"Paused")),i!==e&&(s.push(n),t.updateVariable(n,i),this.eventManager.requestRender())}else if("time"===c.dynamicVariableType){let a=t.getVariable(n),r=e(i,c);if("object"==typeof a&&"textValue"in a&&"object"==typeof r&&"textValue"in r){if(Array.isArray(a.textValue)&&Array.isArray(r.textValue)){if(a.textValue.every((e,a)=>e===r.textValue[a]))continue}else if(a.textValue===r.textValue)continue}else if(a===r)continue;t.updateVariable(n,r),s.push(n),this.eventManager.requestRender()}else{let e=h.isTextValue(c.endValue)?w(c.endValue.textValue):c.endValue,i=t.getDynamicVariableToggleIsForward(n)??!0,d=p+(a-o)/1e3*("timer"===c.dynamicVariableType?-1:1)*(i?1:-1);d=Math.max(d,0),c.hasEnd&&(d="stopwatch"===c.dynamicVariableType?m.clamp(d,u,e):m.clamp(d,e,u),d===u&&t.setDynamicVariableToggleIsForward(n,void 0),c.repeat?Math.abs(d-e)<("number3decimal"===c.format?1e-4:.1)&&(d=u):(Math.abs(d-u)<("number3decimal"===c.format?1e-4:.1)||Math.abs(d-e)<("number3decimal"===c.format?1e-4:.1))&&t.setDynamicVariablePlayState(n,"Paused")),d!==p&&(s.push(n),this.dynamicVars[r].timerSeconds=d,t.updateVariable(n,l.getFormattedTimerTime(d,c)),this.eventManager.requestRender())}}}else this.dynamicVars[r].last=a,this.dynamicVars[r].expectedTime=a+y}let n=!1;t.mouseProperty!==this.prevMouseProperty&&(this.prevMouseProperty=t.mouseProperty,n=!0);let d=!1;t.raycastProperty!==this.prevRaycastProperty&&(this.prevRaycastProperty=t.raycastProperty,d=!0),this.events.forEach(e=>{(s.includes(e.data.variableId)||r.find(a=>a.objId===e.data.objectId&&a.property===e.data.property)||"mouseProperty"===e.data.variableId&&n||"raycastProperty"===e.data.variableId&&d)&&(e.dispatch(),this.eventManager.requestRender())})},this.onBlur=()=>{this.pause()},this.onFocus=()=>{this.resume()}}pause(){this.isOutOfFocus||(this.isOutOfFocus=!0,this.pauseTime=Date.now())}resume(){if(!this.isOutOfFocus)return;this.isOutOfFocus=!1;let e=Date.now()-this.pauseTime;for(let a=0;a<this.dynamicVars.length;a++)this.dynamicVars[a].last+=e,this.dynamicVars[a].expectedTime+=e}connect(){this.eventContext.page.traverseEntity(e=>{e.data?.events.filter(e=>"VariableChange"===e.data.type&&!e.data.disabled).forEach(a=>{this.events.push(new P(a.id,a.data,e,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),this.propertiesToWatch=this.events.filter(e=>"objectProperty"===e.data.variableId&&null!==e.data.objectId).map(e=>({objectId:e.data.objectId,property:e.data.property,prevValue:null}));let a=this.eventContext.sharedAssets;this.sharedVariables.forEach(({id:t,data:i})=>{if(!("dynamicVariableType"in i))return void(this.events.find(e=>e.data.variableId===t)&&this.variablesToWatch.push({id:t,prevValue:a.getVariable(t)}));let s;if("timer"===i.dynamicVariableType||"stopwatch"===i.dynamicVariableType){let e;if(h.isTextValue(i.value)&&Array.isArray(i.value.textValue)){let a=i.value.textValue;e=3===a.length?a[2]+60*a[1]+3600*a[0]:a[1]+60*a[0]}else e=i.value;s=e,this.dynamicVars.push({id:t,last:-1,expectedTime:-1,data:i,timerSeconds:e,startValue:s})}else"time"===i.dynamicVariableType&&a.updateVariable(t,e(new Date,i)),"counter"===i.dynamicVariableType&&(s=h.isTextValue(i.value)?w(i.value.textValue):i.value),this.dynamicVars.push({id:t,last:-1,expectedTime:-1,data:i,startValue:s})}),this.rafId=window.requestAnimationFrame(this.onFrame),window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus)}disconnect(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.rafId&&(window.cancelAnimationFrame(this.rafId),this.rafId=void 0),this.events.forEach(e=>e.dispose())}},P=class{constructor(e,a,t,i,s,r){this.id=e,this.data=a,this.object=t,this.actions=n(a,a.actions,i,s,r,t)}dispatch(){let e=this.actions;e.Audio.forEach(e=>e.dispatchConditional()),e.Particles.forEach(e=>e.dispatchConditional()),e.Video.forEach(e=>e.dispatchConditional()),e.Create.forEach(e=>e.dispatch()),e.Destroy.forEach(e=>e.dispatch()),e.Reset.forEach(e=>e.dispatch()),e.Transition.forEach(e=>{e.object.currentTransitionEvent!==this&&(e.object.currentTransitionEvent=this),e.init()}),e.Transition.forEach(e=>e.play()),e.Animation.forEach(e=>e.play()),e.TimelineAnimation.forEach(e=>e.dispatchConditional()),e.SwitchCamera.forEach(e=>e.play()),e.SceneTransition.forEach(e=>e.dispatch()),e.SetVariable.forEach(e=>e.checkConditions()),e.SetVariable.forEach(e=>e.dispatch()),e.DynamicVariablePlay.forEach(e=>e.dispatch()),e.ClearLocalStorage.forEach(e=>e.dispatch()),e.UserAPI.forEach(e=>e.dispatch())}dispose(){d(this.actions)}};function w(e){return 3===e.length?e[2]+60*e[1]+3600*e[0]:e[1]+60*e[0]}var x=class{constructor(e,a,t,i){this.data=e,this.page=a,this.shared=t,this.condition=i,this.evaluatedCondition=!1}checkConditions(){this.evaluatedCondition=r(this.shared,this.condition)}dispatch(){if(!1===this.evaluatedCondition)return!1;let e=this.shared.getVariable(this.data.variableId),a=i(this.data.expression,this.shared,h.typeOfVariable(e));void 0!==a&&this.shared.updateVariable(this.data.variableId,"string"==typeof a?{textValue:a}:a)}dispose(){}},D=class{constructor(e,a,t,i){this.data=e,this.page=a,this.shared=t,this.condition=i,this.timeoutId=null}dispatchInner(){if(!1===r(this.shared,this.condition))return!1;let e=this.shared.getDynamicVariablePlayState(this.data.variableId);if("PlayPause"===this.data.mode)void 0===this.shared.getDynamicVariableToggleIsForward(this.data.variableId)&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"===e?"Paused":"Playing");else if("Play"===this.data.mode&&"Playing"!==e)void 0===this.shared.getDynamicVariableToggleIsForward(this.data.variableId)&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing");else if("Stop"===this.data.mode&&"Stopped"!==e)this.shared.setDynamicVariablePlayState(this.data.variableId,"Stopped");else if("Pause"===this.data.mode&&"Paused"!==e)this.shared.setDynamicVariablePlayState(this.data.variableId,"Paused");else if("Restart"===this.data.mode)this.shared.setDynamicVariablePlayState(this.data.variableId,"Restarted");else if("Toggle"===this.data.mode){let a=this.shared.getDynamicVariableToggleIsForward(this.data.variableId);"Playing"===e?this.shared.setDynamicVariableToggleIsForward(this.data.variableId,void 0!==a&&!a):(this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!a),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"))}}dispatch(){let e=this.data.delay,a=this.shared.getDynamicVariablePlayState(this.data.variableId);"PlayPause"===this.data.mode&&"Playing"===a&&(e=this.data.pauseDelay),0!==e?(this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.dispatchInner()},e)):this.dispatchInner()}dispose(){this.timeoutId&&window.clearTimeout(this.timeoutId)}};t("VariableChange",({eventContext:e,sharedVariables:a,eventManager:t,needsMouse:i,needsRaycast:s})=>new I(e,a,t,i,s)),s("SetVariable",({data:e,page:a,shared:t,actionCondition:i})=>new x(e,a,t,i)),s("DynamicVariablePlay",({data:e,page:a,shared:t,actionCondition:i})=>new D(e,a,t,i)),o("variables");
@@ -1 +1 @@
1
- import{ea as t}from"./runtime-chunk-SXPM42HJ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{u as e}from"./runtime-chunk-4KX4KQWR.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-R34HNX2O.js";import{a as r,f as i}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-RBM3UDQF.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var n=class extends t{get forceComputeSize(){return!0}get shape(){return this.geometry.userData.shape}updateEntityBoxSize(t,r){let i=this.geometry.getAttribute("position");void 0!==i?e(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,r):super.updateEntityBoxSize(t,r)}};i("VectorGeometry",(t,e,r)=>new n(t,e,r)),r("vector-shapes");
1
+ import{ea as t}from"./runtime-chunk-DK66VKWP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{u as e}from"./runtime-chunk-CKT62HES.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-U4QOT2PX.js";import{a as r,f as i}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-VPEJ5BFD.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var n=class extends t{get forceComputeSize(){return!0}get shape(){return this.geometry.userData.shape}updateEntityBoxSize(t,r){let i=this.geometry.getAttribute("position");void 0!==i?e(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,r):super.updateEntityBoxSize(t,r)}};i("VectorGeometry",(t,e,r)=>new n(t,e,r)),r("vector-shapes");
@@ -1 +1 @@
1
- import{c as t}from"./runtime-chunk-FQNSP44B.js";import{b as i,e}from"./runtime-chunk-NWCLOXDY.js";import{e as s}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-R34HNX2O.js";import{a}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-RBM3UDQF.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var o=new Map,d=new Map,n=class{constructor(i,e,s){this.data=e,this.isPlayVideoAction=!0,this.delay=0,this.status="stopped";let{layerId:a,loop:n,volume:h,delay:l}=e;if(this.object=s,void 0===a)throw new Error("Missing property");let r=function(t,i){let e;if("material"in t){let s=t.material;e=Array.isArray(s)?t.material[0].layers.find(t=>t.uuid===i):t.material.layers.find(t=>t.uuid===i)}if(!e)return;let s=e.color?.texture?.image?.img??e.holders?.find(t=>t.isVideo)?.img;return s instanceof HTMLVideoElement?s:void 0}(s,a);r&&(this.videoElement=r,this.videoElement.loop=n===1/0,t&&(this.videoElement.autoplay=!0),void 0!==h&&(this.videoElement.volume=h)),void 0!==l&&(this.delay=l),d.has(s.uuid)?d.get(s.uuid).push(this):d.set(s.uuid,[this]),o.set(i,this),this.pause()}mute(){!this.videoElement||(this.videoElement.muted=!0)}unMute(){!this.videoElement||(this.videoElement.muted=!1)}play(t){if(!this.videoElement)return;let i=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);t?(this.mute(),this.delay+=150):i?(this.mute(),window.setTimeout(()=>{this.unMute()},100)):this.unMute(),this.delayTimerId=window.setTimeout(()=>{if(!this.videoElement)return;let t=this.videoElement.play();void 0!==t&&t.then(t=>{}).catch(t=>{this.play()}),this.clearDelay()},this.delay),this.status="playing"}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}pause(){!this.videoElement||(this.videoElement.pause(),this.status="paused")}stop(){!this.videoElement||(this.videoElement.pause(),this.videoElement.currentTime=0,this.status="stopped",this.clearDelay())}seek(t){return new Promise(i=>{if(!this.videoElement)return i();let e=this.videoElement.duration;if(e>0){let i=t%e;this.videoElement.currentTime=i}this.videoElement.addEventListener("seeked",()=>i(),{once:!0})})}playByToggle(){"stop"===this.data.toggle?"playing"===this.status?this.stop():(this.stop(),this.play()):"pause"===this.data.toggle?"playing"===this.status?this.pause():this.play():(this.stop(),this.play())}dispose(){!this.videoElement||(this.stop(),this.videoElement.muted=!0)}},h=class{constructor(t){this.data=t,this.isPauseVideoAction=!0}dispatch(){this.data.playVideo?this.pauseVideo(this.data.playVideo):this.data.object?this.pauseAllVideosFromObject(this.data.object):this.pauseAllVideos()}pauseVideo(t){let i=o.get(t);!i||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i[this.data.interaction](),this.disposeDelay()},this.data.delay)):i[this.data.interaction]())}pauseAllVideosFromObject(t){let i=d.get(t);!i?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.forEach(t=>t[this.data.interaction]()),this.disposeDelay()},this.data.delay)):i.forEach(t=>t[this.data.interaction]()))}pauseAllVideos(){let t=[...d.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},l=class{constructor(t,i,e,s,a){if(this.data=i,this.shared=s,this.condition=a,"play"===i.interaction)this.interaction=new n(t,i,e);else{if("pause"!==i.interaction&&"stop"!==i.interaction)throw new Error("Missing property");this.interaction=new h(i)}}dispatchBasic(){if(!1===e(this.shared,this.condition))return!1;this.interaction instanceof n?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(!1===e(this.shared,this.condition))return!1;this.interaction instanceof n?this.interaction.play():this.interaction.dispatch()}dispose(){this.interaction.dispose()}};i("Video",({id:t,data:i,object:e,shared:a,actionCondition:o})=>s(e)?null:new l(t,i,e,a,o)),a("video");
1
+ import{c as t}from"./runtime-chunk-FQNSP44B.js";import{b as i,e}from"./runtime-chunk-EPHVY3XO.js";import{e as s}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-U4QOT2PX.js";import{a}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-VPEJ5BFD.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var o=new Map,d=new Map,n=class{constructor(i,e,s){this.data=e,this.isPlayVideoAction=!0,this.delay=0,this.status="stopped";let{layerId:a,loop:n,volume:h,delay:l}=e;if(this.object=s,void 0===a)throw new Error("Missing property");let r=function(t,i){let e;if("material"in t){let s=t.material;e=Array.isArray(s)?t.material[0].layers.find(t=>t.uuid===i):t.material.layers.find(t=>t.uuid===i)}if(!e)return;let s=e.color?.texture?.image?.img??e.holders?.find(t=>t.isVideo)?.img;return s instanceof HTMLVideoElement?s:void 0}(s,a);r&&(this.videoElement=r,this.videoElement.loop=n===1/0,t&&(this.videoElement.autoplay=!0),void 0!==h&&(this.videoElement.volume=h)),void 0!==l&&(this.delay=l),d.has(s.uuid)?d.get(s.uuid).push(this):d.set(s.uuid,[this]),o.set(i,this),this.pause()}mute(){!this.videoElement||(this.videoElement.muted=!0)}unMute(){!this.videoElement||(this.videoElement.muted=!1)}play(t){if(!this.videoElement)return;let i=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);t?(this.mute(),this.delay+=150):i?(this.mute(),window.setTimeout(()=>{this.unMute()},100)):this.unMute(),this.delayTimerId=window.setTimeout(()=>{if(!this.videoElement)return;let t=this.videoElement.play();void 0!==t&&t.then(t=>{}).catch(t=>{this.play()}),this.clearDelay()},this.delay),this.status="playing"}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}pause(){!this.videoElement||(this.videoElement.pause(),this.status="paused")}stop(){!this.videoElement||(this.videoElement.pause(),this.videoElement.currentTime=0,this.status="stopped",this.clearDelay())}seek(t){return new Promise(i=>{if(!this.videoElement)return i();let e=this.videoElement.duration;if(e>0){let i=t%e;this.videoElement.currentTime=i}this.videoElement.addEventListener("seeked",()=>i(),{once:!0})})}playByToggle(){"stop"===this.data.toggle?"playing"===this.status?this.stop():(this.stop(),this.play()):"pause"===this.data.toggle?"playing"===this.status?this.pause():this.play():(this.stop(),this.play())}dispose(){!this.videoElement||(this.stop(),this.videoElement.muted=!0)}},h=class{constructor(t){this.data=t,this.isPauseVideoAction=!0}dispatch(){this.data.playVideo?this.pauseVideo(this.data.playVideo):this.data.object?this.pauseAllVideosFromObject(this.data.object):this.pauseAllVideos()}pauseVideo(t){let i=o.get(t);!i||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i[this.data.interaction](),this.disposeDelay()},this.data.delay)):i[this.data.interaction]())}pauseAllVideosFromObject(t){let i=d.get(t);!i?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.forEach(t=>t[this.data.interaction]()),this.disposeDelay()},this.data.delay)):i.forEach(t=>t[this.data.interaction]()))}pauseAllVideos(){let t=[...d.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},l=class{constructor(t,i,e,s,a){if(this.data=i,this.shared=s,this.condition=a,"play"===i.interaction)this.interaction=new n(t,i,e);else{if("pause"!==i.interaction&&"stop"!==i.interaction)throw new Error("Missing property");this.interaction=new h(i)}}dispatchBasic(){if(!1===e(this.shared,this.condition))return!1;this.interaction instanceof n?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(!1===e(this.shared,this.condition))return!1;this.interaction instanceof n?this.interaction.play():this.interaction.dispatch()}dispose(){this.interaction.dispose()}};i("Video",({id:t,data:i,object:e,shared:a,actionCondition:o})=>s(e)?null:new l(t,i,e,a,o)),a("video");