@splinetool/runtime 2.0.51 → 2.0.53

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 (302) hide show
  1. package/build/boolean.js +1 -1
  2. package/build/boolean.js.br +0 -0
  3. package/build/boolean.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-DRACOLoader-GLMRFFK2.js +1 -0
  8. package/build/runtime-DRACOLoader-GLMRFFK2.js.br +0 -0
  9. package/build/runtime-DRACOLoader-GLMRFFK2.js.gz +0 -0
  10. package/build/{runtime-chunk-RNV6FGEN.js → runtime-chunk-2UL7M2VW.js} +1 -1
  11. package/build/runtime-chunk-2UL7M2VW.js.br +0 -0
  12. package/build/runtime-chunk-2UL7M2VW.js.gz +0 -0
  13. package/build/{runtime-chunk-QEROHAPW.js → runtime-chunk-42DQ6LLX.js} +1 -1
  14. package/build/runtime-chunk-42DQ6LLX.js.br +0 -0
  15. package/build/runtime-chunk-42DQ6LLX.js.gz +0 -0
  16. package/build/{runtime-chunk-DSYY4PII.js → runtime-chunk-4FY554U4.js} +1 -1
  17. package/build/runtime-chunk-4FY554U4.js.br +0 -0
  18. package/build/runtime-chunk-4FY554U4.js.gz +0 -0
  19. package/build/{runtime-chunk-VIBKLNVW.js → runtime-chunk-4VJSN65D.js} +1 -1
  20. package/build/runtime-chunk-4VJSN65D.js.br +0 -0
  21. package/build/runtime-chunk-4VJSN65D.js.gz +0 -0
  22. package/build/{runtime-chunk-3ZEFAL7T.js → runtime-chunk-5QJOECK2.js} +1 -1
  23. package/build/runtime-chunk-5QJOECK2.js.br +0 -0
  24. package/build/{runtime-chunk-3ZEFAL7T.js.gz → runtime-chunk-5QJOECK2.js.gz} +0 -0
  25. package/build/runtime-chunk-6Z7YLZCH.js +1 -0
  26. package/build/runtime-chunk-6Z7YLZCH.js.br +0 -0
  27. package/build/runtime-chunk-6Z7YLZCH.js.gz +0 -0
  28. package/build/{runtime-chunk-URQHWMRU.js → runtime-chunk-CE3IVQOC.js} +1 -1
  29. package/build/runtime-chunk-CE3IVQOC.js.br +0 -0
  30. package/build/runtime-chunk-CE3IVQOC.js.gz +0 -0
  31. package/build/{runtime-chunk-2LQQPLUM.js → runtime-chunk-CIOJTARL.js} +1 -1
  32. package/build/runtime-chunk-CIOJTARL.js.br +0 -0
  33. package/build/runtime-chunk-CIOJTARL.js.gz +0 -0
  34. package/build/{runtime-chunk-NL5G6WPO.js → runtime-chunk-DAXNYZOU.js} +1 -1
  35. package/build/runtime-chunk-DAXNYZOU.js.br +0 -0
  36. package/build/runtime-chunk-DAXNYZOU.js.gz +0 -0
  37. package/build/{runtime-chunk-6OWJQ2IH.js → runtime-chunk-DQ7IJ33I.js} +1 -1
  38. package/build/runtime-chunk-DQ7IJ33I.js.br +0 -0
  39. package/build/runtime-chunk-DQ7IJ33I.js.gz +0 -0
  40. package/build/runtime-chunk-DWJBFUZW.js +1 -0
  41. package/build/runtime-chunk-DWJBFUZW.js.br +0 -0
  42. package/build/runtime-chunk-DWJBFUZW.js.gz +0 -0
  43. package/build/{runtime-chunk-JHJ46EQQ.js → runtime-chunk-FIGFAP4C.js} +1 -1
  44. package/build/runtime-chunk-FIGFAP4C.js.br +0 -0
  45. package/build/runtime-chunk-FIGFAP4C.js.gz +0 -0
  46. package/build/{runtime-chunk-S7VSAB6U.js → runtime-chunk-FYXIWPEB.js} +1 -1
  47. package/build/runtime-chunk-FYXIWPEB.js.br +0 -0
  48. package/build/runtime-chunk-FYXIWPEB.js.gz +0 -0
  49. package/build/{runtime-chunk-A7ID3ATG.js → runtime-chunk-GWROKMFV.js} +1 -1
  50. package/build/runtime-chunk-GWROKMFV.js.br +0 -0
  51. package/build/runtime-chunk-GWROKMFV.js.gz +0 -0
  52. package/build/{runtime-chunk-NV5AZNLT.js → runtime-chunk-HUAJFVWQ.js} +1 -1
  53. package/build/runtime-chunk-HUAJFVWQ.js.br +0 -0
  54. package/build/runtime-chunk-HUAJFVWQ.js.gz +0 -0
  55. package/build/runtime-chunk-LCYPLCAI.js +1 -0
  56. package/build/runtime-chunk-LCYPLCAI.js.br +0 -0
  57. package/build/runtime-chunk-LCYPLCAI.js.gz +0 -0
  58. package/build/{runtime-chunk-N6XY2NKN.js → runtime-chunk-LWW3TFPR.js} +1 -1
  59. package/build/runtime-chunk-LWW3TFPR.js.br +0 -0
  60. package/build/runtime-chunk-LWW3TFPR.js.gz +0 -0
  61. package/build/runtime-chunk-QK72454A.js +1 -0
  62. package/build/runtime-chunk-QK72454A.js.br +0 -0
  63. package/build/runtime-chunk-QK72454A.js.gz +0 -0
  64. package/build/{runtime-chunk-HTHAK3HS.js → runtime-chunk-RCBIOM5C.js} +1 -1
  65. package/build/runtime-chunk-RCBIOM5C.js.br +0 -0
  66. package/build/runtime-chunk-RCBIOM5C.js.gz +0 -0
  67. package/build/{runtime-chunk-GEW5Z54S.js → runtime-chunk-TGOKOORP.js} +1 -1
  68. package/build/runtime-chunk-TGOKOORP.js.br +0 -0
  69. package/build/runtime-chunk-TGOKOORP.js.gz +0 -0
  70. package/build/{runtime-chunk-XY2BJ3DR.js → runtime-chunk-TN7SLRFX.js} +1 -1
  71. package/build/runtime-chunk-TN7SLRFX.js.br +0 -0
  72. package/build/{runtime-chunk-XY2BJ3DR.js.gz → runtime-chunk-TN7SLRFX.js.gz} +0 -0
  73. package/build/{runtime-chunk-XG7TRRFP.js → runtime-chunk-V2M6LVQI.js} +1 -1
  74. package/build/runtime-chunk-V2M6LVQI.js.br +0 -0
  75. package/build/runtime-chunk-V2M6LVQI.js.gz +0 -0
  76. package/build/{runtime-chunk-CTOS73DK.js → runtime-chunk-WW7RRGKX.js} +1 -1
  77. package/build/runtime-chunk-WW7RRGKX.js.br +0 -0
  78. package/build/runtime-chunk-WW7RRGKX.js.gz +0 -0
  79. package/build/runtime-chunk-YGGUUEFT.js +1 -0
  80. package/build/runtime-chunk-YGGUUEFT.js.br +0 -0
  81. package/build/runtime-chunk-YGGUUEFT.js.gz +0 -0
  82. package/build/{runtime-chunk-LZMIX3RB.js → runtime-chunk-ZMIXFGXT.js} +1 -1
  83. package/build/runtime-chunk-ZMIXFGXT.js.br +3 -0
  84. package/build/runtime-chunk-ZMIXFGXT.js.gz +0 -0
  85. package/build/{runtime-chunk-AVVOSW5G.js → runtime-chunk-ZXOJK5A6.js} +1 -1
  86. package/build/runtime-chunk-ZXOJK5A6.js.br +0 -0
  87. package/build/runtime-chunk-ZXOJK5A6.js.gz +0 -0
  88. package/build/runtime-classicRuntime-PSJWHR3W.js +1 -0
  89. package/build/runtime-classicRuntime-PSJWHR3W.js.br +0 -0
  90. package/build/runtime-classicRuntime-PSJWHR3W.js.gz +0 -0
  91. package/build/{runtime-cloners-5ATCDKMA.js → runtime-cloners-4ZDRWXX2.js} +1 -1
  92. package/build/runtime-cloners-4ZDRWXX2.js.br +0 -0
  93. package/build/runtime-cloners-4ZDRWXX2.js.gz +0 -0
  94. package/build/{runtime-components-AQICYISZ.js → runtime-components-LS75QLT7.js} +1 -1
  95. package/build/runtime-components-LS75QLT7.js.br +0 -0
  96. package/build/runtime-components-LS75QLT7.js.gz +0 -0
  97. package/build/runtime-createDestroy-3DJAEURL.js +1 -0
  98. package/build/runtime-createDestroy-3DJAEURL.js.br +0 -0
  99. package/build/runtime-createDestroy-3DJAEURL.js.gz +0 -0
  100. package/build/{runtime-dragDrop-EU64B7LP.js → runtime-dragDrop-LIYELD7N.js} +1 -1
  101. package/build/runtime-dragDrop-LIYELD7N.js.br +0 -0
  102. package/build/runtime-dragDrop-LIYELD7N.js.gz +0 -0
  103. package/build/{runtime-fxBloom-TCJFKYXA.js → runtime-fxBloom-7MH75D7M.js} +1 -1
  104. package/build/runtime-fxBloom-7MH75D7M.js.br +0 -0
  105. package/build/runtime-fxBloom-7MH75D7M.js.gz +0 -0
  106. package/build/{runtime-fxDepthOfField-5FSKJ3XG.js → runtime-fxDepthOfField-TFTNDBM5.js} +1 -1
  107. package/build/runtime-fxDepthOfField-TFTNDBM5.js.br +0 -0
  108. package/build/runtime-fxDepthOfField-TFTNDBM5.js.gz +0 -0
  109. package/build/runtime-gameControls-BG6EZYET.js +1 -0
  110. package/build/runtime-gameControls-BG6EZYET.js.br +0 -0
  111. package/build/runtime-gameControls-BG6EZYET.js.gz +0 -0
  112. package/build/{runtime-hair-KUB7FSFB.js → runtime-hair-2I5NL5AB.js} +1 -1
  113. package/build/runtime-hair-2I5NL5AB.js.br +2 -0
  114. package/build/runtime-hair-2I5NL5AB.js.gz +0 -0
  115. package/build/{runtime-mergeStaticGeometries-YPTMIIXU.js → runtime-mergeStaticGeometries-2UUVFTQ3.js} +1 -1
  116. package/build/runtime-mergeStaticGeometries-2UUVFTQ3.js.br +0 -0
  117. package/build/runtime-mergeStaticGeometries-2UUVFTQ3.js.gz +0 -0
  118. package/build/{runtime-miscActions-4YVS5IN6.js → runtime-miscActions-OMOZBKVC.js} +1 -1
  119. package/build/runtime-miscActions-OMOZBKVC.js.br +0 -0
  120. package/build/runtime-miscActions-OMOZBKVC.js.gz +0 -0
  121. package/build/{runtime-mouseHover-VYKM5COY.js → runtime-mouseHover-M5IWNDH7.js} +1 -1
  122. package/build/runtime-mouseHover-M5IWNDH7.js.br +0 -0
  123. package/build/runtime-mouseHover-M5IWNDH7.js.gz +0 -0
  124. package/build/{runtime-particles-BEQVJXIP.js → runtime-particles-VNNGHRWB.js} +1 -1
  125. package/build/runtime-particles-VNNGHRWB.js.br +0 -0
  126. package/build/runtime-particles-VNNGHRWB.js.gz +0 -0
  127. package/build/{runtime-paths-JLQQ6VI6.js → runtime-paths-JMJGABOE.js} +1 -1
  128. package/build/runtime-paths-JMJGABOE.js.br +0 -0
  129. package/build/runtime-paths-JMJGABOE.js.gz +0 -0
  130. package/build/{runtime-resize-HY64ZSMY.js → runtime-resize-WI2WKGEB.js} +1 -1
  131. package/build/runtime-resize-WI2WKGEB.js.br +0 -0
  132. package/build/runtime-resize-WI2WKGEB.js.gz +0 -0
  133. package/build/{runtime-sceneTransition-JPRDVBZY.js → runtime-sceneTransition-ANVRIIG2.js} +1 -1
  134. package/build/runtime-sceneTransition-ANVRIIG2.js.br +0 -0
  135. package/build/runtime-sceneTransition-ANVRIIG2.js.gz +0 -0
  136. package/build/{runtime-scroll-VPT3W6DE.js → runtime-scroll-IDJKADT2.js} +1 -1
  137. package/build/runtime-scroll-IDJKADT2.js.br +0 -0
  138. package/build/runtime-scroll-IDJKADT2.js.gz +0 -0
  139. package/build/runtime-shapeBlends-RNRFZRZT.js +1 -0
  140. package/build/runtime-shapeBlends-RNRFZRZT.js.br +2 -0
  141. package/build/runtime-shapeBlends-RNRFZRZT.js.gz +0 -0
  142. package/build/runtime-text-53BT3JCR.js +1 -0
  143. package/build/runtime-text-53BT3JCR.js.br +0 -0
  144. package/build/runtime-text-53BT3JCR.js.gz +0 -0
  145. package/build/{runtime-textInputs-UTJRJRWY.js → runtime-textInputs-XZPFNNAY.js} +1 -1
  146. package/build/runtime-textInputs-XZPFNNAY.js.br +0 -0
  147. package/build/runtime-textInputs-XZPFNNAY.js.gz +0 -0
  148. package/build/{runtime-timeline-CSIGMAFG.js → runtime-timeline-WLUR7ICL.js} +1 -1
  149. package/build/runtime-timeline-WLUR7ICL.js.br +0 -0
  150. package/build/runtime-timeline-WLUR7ICL.js.gz +0 -0
  151. package/build/{runtime-tracking-J5JZAHEH.js → runtime-tracking-KUQBXRKT.js} +1 -1
  152. package/build/runtime-tracking-KUQBXRKT.js.br +0 -0
  153. package/build/runtime-tracking-KUQBXRKT.js.gz +0 -0
  154. package/build/runtime-transitions-YTBVQWF3.js +1 -0
  155. package/build/runtime-transitions-YTBVQWF3.js.br +0 -0
  156. package/build/runtime-transitions-YTBVQWF3.js.gz +0 -0
  157. package/build/{runtime-ui2d-WAJYX2WY.js → runtime-ui2d-L2MIZ4G2.js} +1 -1
  158. package/build/runtime-ui2d-L2MIZ4G2.js.br +0 -0
  159. package/build/runtime-ui2d-L2MIZ4G2.js.gz +0 -0
  160. package/build/{runtime-vectorShapes-WDY22SDV.js → runtime-vectorShapes-Y4HQJY6W.js} +1 -1
  161. package/build/runtime-vectorShapes-Y4HQJY6W.js.br +0 -0
  162. package/build/runtime-vectorShapes-Y4HQJY6W.js.gz +0 -0
  163. package/build/runtime-webgpu-6PJLXU7X.js +1 -0
  164. package/build/runtime-webgpu-6PJLXU7X.js.br +0 -0
  165. package/build/runtime-webgpu-6PJLXU7X.js.gz +0 -0
  166. package/build/runtime.cjs +354 -349
  167. package/build/runtime.js +1 -1
  168. package/build/runtime.js.br +0 -0
  169. package/build/runtime.js.gz +0 -0
  170. package/build/runtime.standalone.js +1 -1
  171. package/build/runtime.standalone.js.br +0 -0
  172. package/build/runtime.standalone.js.gz +0 -0
  173. package/build/runtime.standalone.webgl.js +1 -1
  174. package/build/runtime.standalone.webgl.js.br +0 -0
  175. package/build/runtime.standalone.webgl.js.gz +0 -0
  176. package/build/runtime.standalone.webgpu.js +1 -1
  177. package/build/runtime.standalone.webgpu.js.br +0 -0
  178. package/build/runtime.standalone.webgpu.js.gz +0 -0
  179. package/build/runtime.standalone.webgpu.micro.js +1 -1
  180. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  181. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  182. package/build/runtime.standalone.webgpu.min.js +1 -1
  183. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  184. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  185. package/package.json +2 -1
  186. package/build/runtime-DRACOLoader-5OLRBTT3.js +0 -1
  187. package/build/runtime-DRACOLoader-5OLRBTT3.js.br +0 -0
  188. package/build/runtime-DRACOLoader-5OLRBTT3.js.gz +0 -0
  189. package/build/runtime-chunk-2LQQPLUM.js.br +0 -0
  190. package/build/runtime-chunk-2LQQPLUM.js.gz +0 -0
  191. package/build/runtime-chunk-35FH6BAP.js +0 -1
  192. package/build/runtime-chunk-35FH6BAP.js.br +0 -0
  193. package/build/runtime-chunk-35FH6BAP.js.gz +0 -0
  194. package/build/runtime-chunk-3ZEFAL7T.js.br +0 -0
  195. package/build/runtime-chunk-5RFUYVOU.js +0 -1
  196. package/build/runtime-chunk-5RFUYVOU.js.br +0 -0
  197. package/build/runtime-chunk-5RFUYVOU.js.gz +0 -0
  198. package/build/runtime-chunk-6OWJQ2IH.js.br +0 -0
  199. package/build/runtime-chunk-6OWJQ2IH.js.gz +0 -0
  200. package/build/runtime-chunk-7WETLIII.js +0 -1
  201. package/build/runtime-chunk-7WETLIII.js.br +0 -0
  202. package/build/runtime-chunk-7WETLIII.js.gz +0 -0
  203. package/build/runtime-chunk-A7ID3ATG.js.br +0 -0
  204. package/build/runtime-chunk-A7ID3ATG.js.gz +0 -0
  205. package/build/runtime-chunk-AVVOSW5G.js.br +0 -0
  206. package/build/runtime-chunk-AVVOSW5G.js.gz +0 -0
  207. package/build/runtime-chunk-CTOS73DK.js.br +0 -0
  208. package/build/runtime-chunk-CTOS73DK.js.gz +0 -0
  209. package/build/runtime-chunk-DSYY4PII.js.br +0 -0
  210. package/build/runtime-chunk-DSYY4PII.js.gz +0 -0
  211. package/build/runtime-chunk-GEW5Z54S.js.br +0 -0
  212. package/build/runtime-chunk-GEW5Z54S.js.gz +0 -0
  213. package/build/runtime-chunk-HTHAK3HS.js.br +0 -0
  214. package/build/runtime-chunk-HTHAK3HS.js.gz +0 -0
  215. package/build/runtime-chunk-JHJ46EQQ.js.br +0 -0
  216. package/build/runtime-chunk-JHJ46EQQ.js.gz +0 -0
  217. package/build/runtime-chunk-LZMIX3RB.js.br +0 -2
  218. package/build/runtime-chunk-LZMIX3RB.js.gz +0 -0
  219. package/build/runtime-chunk-N6XY2NKN.js.br +0 -0
  220. package/build/runtime-chunk-N6XY2NKN.js.gz +0 -0
  221. package/build/runtime-chunk-NL5G6WPO.js.br +0 -0
  222. package/build/runtime-chunk-NL5G6WPO.js.gz +0 -0
  223. package/build/runtime-chunk-NV5AZNLT.js.br +0 -0
  224. package/build/runtime-chunk-NV5AZNLT.js.gz +0 -0
  225. package/build/runtime-chunk-QBFBGHK4.js +0 -1
  226. package/build/runtime-chunk-QBFBGHK4.js.br +0 -0
  227. package/build/runtime-chunk-QBFBGHK4.js.gz +0 -0
  228. package/build/runtime-chunk-QEROHAPW.js.br +0 -0
  229. package/build/runtime-chunk-QEROHAPW.js.gz +0 -0
  230. package/build/runtime-chunk-RCOXTVC5.js +0 -1
  231. package/build/runtime-chunk-RCOXTVC5.js.br +0 -0
  232. package/build/runtime-chunk-RCOXTVC5.js.gz +0 -0
  233. package/build/runtime-chunk-RNV6FGEN.js.br +0 -0
  234. package/build/runtime-chunk-RNV6FGEN.js.gz +0 -0
  235. package/build/runtime-chunk-S7VSAB6U.js.br +0 -0
  236. package/build/runtime-chunk-S7VSAB6U.js.gz +0 -0
  237. package/build/runtime-chunk-URQHWMRU.js.br +0 -0
  238. package/build/runtime-chunk-URQHWMRU.js.gz +0 -0
  239. package/build/runtime-chunk-VIBKLNVW.js.br +0 -0
  240. package/build/runtime-chunk-VIBKLNVW.js.gz +0 -0
  241. package/build/runtime-chunk-XG7TRRFP.js.br +0 -0
  242. package/build/runtime-chunk-XG7TRRFP.js.gz +0 -0
  243. package/build/runtime-chunk-XY2BJ3DR.js.br +0 -0
  244. package/build/runtime-classicRuntime-QARWS2QF.js +0 -1
  245. package/build/runtime-classicRuntime-QARWS2QF.js.br +0 -0
  246. package/build/runtime-classicRuntime-QARWS2QF.js.gz +0 -0
  247. package/build/runtime-cloners-5ATCDKMA.js.br +0 -0
  248. package/build/runtime-cloners-5ATCDKMA.js.gz +0 -0
  249. package/build/runtime-components-AQICYISZ.js.br +0 -0
  250. package/build/runtime-components-AQICYISZ.js.gz +0 -0
  251. package/build/runtime-createDestroy-VL7LJCZR.js +0 -1
  252. package/build/runtime-createDestroy-VL7LJCZR.js.br +0 -0
  253. package/build/runtime-createDestroy-VL7LJCZR.js.gz +0 -0
  254. package/build/runtime-dragDrop-EU64B7LP.js.br +0 -0
  255. package/build/runtime-dragDrop-EU64B7LP.js.gz +0 -0
  256. package/build/runtime-fxBloom-TCJFKYXA.js.br +0 -0
  257. package/build/runtime-fxBloom-TCJFKYXA.js.gz +0 -0
  258. package/build/runtime-fxDepthOfField-5FSKJ3XG.js.br +0 -0
  259. package/build/runtime-fxDepthOfField-5FSKJ3XG.js.gz +0 -0
  260. package/build/runtime-gameControls-726UOVEA.js +0 -1
  261. package/build/runtime-gameControls-726UOVEA.js.br +0 -0
  262. package/build/runtime-gameControls-726UOVEA.js.gz +0 -0
  263. package/build/runtime-hair-KUB7FSFB.js.br +0 -1
  264. package/build/runtime-hair-KUB7FSFB.js.gz +0 -0
  265. package/build/runtime-mergeStaticGeometries-YPTMIIXU.js.br +0 -0
  266. package/build/runtime-mergeStaticGeometries-YPTMIIXU.js.gz +0 -0
  267. package/build/runtime-miscActions-4YVS5IN6.js.br +0 -0
  268. package/build/runtime-miscActions-4YVS5IN6.js.gz +0 -0
  269. package/build/runtime-mouseHover-VYKM5COY.js.br +0 -0
  270. package/build/runtime-mouseHover-VYKM5COY.js.gz +0 -0
  271. package/build/runtime-particles-BEQVJXIP.js.br +0 -0
  272. package/build/runtime-particles-BEQVJXIP.js.gz +0 -0
  273. package/build/runtime-paths-JLQQ6VI6.js.br +0 -0
  274. package/build/runtime-paths-JLQQ6VI6.js.gz +0 -0
  275. package/build/runtime-resize-HY64ZSMY.js.br +0 -0
  276. package/build/runtime-resize-HY64ZSMY.js.gz +0 -0
  277. package/build/runtime-sceneTransition-JPRDVBZY.js.br +0 -0
  278. package/build/runtime-sceneTransition-JPRDVBZY.js.gz +0 -0
  279. package/build/runtime-scroll-VPT3W6DE.js.br +0 -0
  280. package/build/runtime-scroll-VPT3W6DE.js.gz +0 -0
  281. package/build/runtime-shapeBlends-BUHYXOK5.js +0 -1
  282. package/build/runtime-shapeBlends-BUHYXOK5.js.br +0 -0
  283. package/build/runtime-shapeBlends-BUHYXOK5.js.gz +0 -0
  284. package/build/runtime-text-64GO52A3.js +0 -1
  285. package/build/runtime-text-64GO52A3.js.br +0 -0
  286. package/build/runtime-text-64GO52A3.js.gz +0 -0
  287. package/build/runtime-textInputs-UTJRJRWY.js.br +0 -0
  288. package/build/runtime-textInputs-UTJRJRWY.js.gz +0 -0
  289. package/build/runtime-timeline-CSIGMAFG.js.br +0 -0
  290. package/build/runtime-timeline-CSIGMAFG.js.gz +0 -0
  291. package/build/runtime-tracking-J5JZAHEH.js.br +0 -0
  292. package/build/runtime-tracking-J5JZAHEH.js.gz +0 -0
  293. package/build/runtime-transitions-LNGLFXWC.js +0 -1
  294. package/build/runtime-transitions-LNGLFXWC.js.br +0 -0
  295. package/build/runtime-transitions-LNGLFXWC.js.gz +0 -0
  296. package/build/runtime-ui2d-WAJYX2WY.js.br +0 -0
  297. package/build/runtime-ui2d-WAJYX2WY.js.gz +0 -0
  298. package/build/runtime-vectorShapes-WDY22SDV.js.br +0 -0
  299. package/build/runtime-vectorShapes-WDY22SDV.js.gz +0 -0
  300. package/build/runtime-webgpu-BAU2RQNF.js +0 -1
  301. package/build/runtime-webgpu-BAU2RQNF.js.br +0 -0
  302. package/build/runtime-webgpu-BAU2RQNF.js.gz +0 -0
@@ -1 +0,0 @@
1
- import{a as e}from"./runtime-chunk-5RFUYVOU.js";import"./runtime-chunk-URQHWMRU.js";import"./runtime-chunk-HTHAK3HS.js";import"./runtime-chunk-NV5AZNLT.js";import{$ as t}from"./runtime-chunk-35FH6BAP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as i,e as a}from"./runtime-chunk-UOHC2OET.js";import"./runtime-chunk-3ZEFAL7T.js";import{b as o}from"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-BPWKE4TV.js";import{a as r}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-NMRQ6IV4.js";import{Cc as s,Ec as d,Fc as n}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var l=(()=>{let e,t,i,a,o=!1;function r(i){!e&&!h()&&(t?.sharedGameControlGlobals.createdObjects.length??0)>0&&(e=requestAnimationFrame(s)),i&&(t=i,a=i.requestRender,!o&&typeof document<"u"&&(document.addEventListener("visibilitychange",d),o=!0))}function s(o){if(!t||!a)return e=void 0,void(i=void 0);let r=i?o-i:0,d=t.sharedGameControlGlobals.createdObjects,n=t.sharedGameControlGlobals.nCreatedPerAction,l=d.length,h=0;for(;h<l;){let e=d[h];void 0===e.userData.createdTime&&(e.userData.createdTime=o),void 0===e.userData.lifetime&&void 0===e.userData.quantity||e.userData.lifetime&&o-e.userData.createdTime<e.userData.lifetime||e.userData.quantity&&n[e.userData.actionId]<=e.userData.quantity?(e.userData.velocity&&(e.position.addScaledVector(e.userData.velocity,r/1e3),e.updateMatrix(),a()),h++):(n[e.userData.actionId]>e.userData.quantity&&n[e.userData.actionId]--,d.splice(h,1),e.removeFromParent(),t.sharedGameControlGlobals.rapierWorld&&e.rigidBody?(t.sharedGameControlGlobals.colliderToEntity.delete(e.rigidBody.collider(0).handle),t.sharedGameControlGlobals.rapierWorld.removeRigidBody(e.rigidBody)):(e.bvhGeometry=void 0,t.sharedGameControlGlobals.entitiesWithTransformAnim=t.sharedGameControlGlobals.entitiesWithTransformAnim.filter(e=>void 0!==e.bvhGeometry)),l--,a())}e=h>0?requestAnimationFrame(s):void 0,i=h>0?o:void 0}function d(){h()?e&&(cancelAnimationFrame(e),e=void 0,i=void 0):r()}return{play:r,dispose:function(){e&&(cancelAnimationFrame(e),e=void 0),o&&typeof document<"u"&&(document.removeEventListener("visibilitychange",d),o=!1),t=void 0,a=void 0,i=void 0}}})();function h(){return!!document&&document.hidden}var c=new d,u=new n,m=new n,y=class{constructor(i,r,d,h,y){this.data=i,this.page=r,this.controlsManager=d,this.shared=h,this.condition=y,this.intervalId=null,this.timeoutIdQueue=[],this.uniqueId=s.generateUUID(),this.dispatch=()=>{if(!1===a(this.shared,this.condition))return!1;this.data.delay?this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay)):this.dispatchInner()},this.dispatchFromStart=()=>{if(!1===a(this.shared,this.condition))return!1;this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay))},this.dispatchThrottled=o(this.dispatch,1e3/this.data.creationSpeed),this.dispatchStart=()=>{null===this.intervalId&&(this.intervalId=window.setInterval(this.dispatch,1e3/this.data.creationSpeed))},this.dispatchStop=()=>{null!==this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null)},this.dispatchInner=()=>{this.timeoutIdQueue.shift();let e=new t(this.object);if(e.playModeVisible=!0,e.expand(),"world"!==this.data.coordinateSystem){let t=this.data.coordinateSystem,i=this.page.scene.find(t);i&&(i.updateMatrixWorldRigid(),e.hiddenMatrix.copy(i.matrixWorldRigid))}e.scale.copy(this.object.scale),e.position.fromArray(this.data.position.map(e=>"number"==typeof e?e:0)),e.rotation.fromArray(this.data.rotation.map(e=>"number"==typeof e?e:0)),e.updateMatrix(),this.page.add(e);let i=this.controlsManager.sharedGameControlGlobals;i.createdObjects.push(e),void 0===i.nCreatedPerAction[this.uniqueId]?i.nCreatedPerAction[this.uniqueId]=1:i.nCreatedPerAction[this.uniqueId]++,e.updateWorldMatrix(!0,!0),e.traverseObject(this.traverseObjectCB),l.play(),this.controlsManager.requestRender()},this.traverseObjectCB=i=>{let a;if(i.hasNonUniformScale&&i.updateMatrixWorldRigid(),this.controlsManager.sharedGameControlGlobals.rapierWorld){if(i instanceof e){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;a=i.object}else if(i instanceof t)a=i.object;else if(a=i,a.dataPatched.cloner?.hideBase)return!0}else{if(i instanceof e)return;a=i instanceof t?i.object:i}"Time"===this.data.destroy?i.userData.lifetime=1e3*this.data.lifetime:"Quantity"===this.data.destroy&&(i.userData.quantity=this.data.destroyAfterQuantity,i.userData.actionId=this.uniqueId);let o=(new n).fromArray(this.data.velocity.map(e=>"number"==typeof e?e:0)),r=a.dataPatched;if(!("visibility"===r.physics.enabled?!r.visible:!r.physics.enabled)&&(this.controlsManager.sharedGameControlGlobals.rapierWorld?(this.controlsManager.addRigidBody(i,a,{fromCreate:!0,dynamic:this.data.dynamic}),"Collision"===this.data.destroy&&(i.rigidBody?.collider(0).setActiveEvents(1),i.userData.hasCollisionDestroy=!0),i.matrixWorld.decompose(u,c,m),o.applyQuaternion(c),this.data.velocity.some(e=>0!==e)&&this.data.dynamic&&i.rigidBody?.setLinvel(o.divideScalar(this.controlsManager.pixelsPerMeter),!0)):("geometry"in i.object&&this.controlsManager.addBoundsTree(i),this.data.velocity.some(e=>0!==e)&&this.data.dynamic&&(i.userData.velocity=o)),!0===a.dataPatched.physics?.fusedBody))return!0};let p=this.page.scene.find(this.data.object);if(!p)throw new Error("Missing Property");if(this.object=p,"world"!==this.data.coordinateSystem&&!this.page.scene.find(this.data.coordinateSystem))throw new Error("Missing Property");l.play(d)}dispose(){null!==this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null),this.timeoutIdQueue.forEach(e=>window.clearTimeout(e)),this.timeoutIdQueue=[],this.dispatchThrottled.cancel(),this.page.remove(...this.controlsManager.sharedGameControlGlobals.createdObjects),this.controlsManager.sharedGameControlGlobals.createdObjects=[],l.dispose()}},p=class{constructor(e,t,i,a,o){this.data=e,this.page=t,this.controlsManager=i,this.shared=a,this.condition=o,this.timeoutIdQueue=[],this.dispatchInner=()=>{this.objects.forEach(this.destroyCallback)},this.destroyCallback=e=>{this.timeoutIdQueue.shift();let t=this.page.scene.find(e);if(void 0===t)return;let i=this.controlsManager.sharedGameControlGlobals.rapierWorld,a=!i||t.dataPatched.physics?.fusedBody;if(t.cloner){for(let e of t.cloner.children)a?(e.playModeVisible=!1,e.rigidBody&&"positioned"===t.dataPatched.physics?.rigidBody&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(e.rigidBody.collider(0).handle),i.removeRigidBody(e.rigidBody),e.rigidBody=void 0),e.bvhGeometry&&(e.bvhGeometry=void 0)):void 0===this.clone||this.clone===e?(e.playModeVisible=!1,e.rigidBody&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(e.rigidBody.collider(0).handle),i.removeRigidBody(e.rigidBody),e.rigidBody=void 0)):void 0===e.playModeVisible&&(e.playModeVisible=!0);t.cloner.syncInstanceMatrices(),(a||void 0===this.clone||!1===this.clone)&&(t.visible=!1,t.rigidBody&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(t.rigidBody.collider(0).handle),i.removeRigidBody(t.rigidBody),t.rigidBody=void 0),t.bvhGeometry&&(t.bvhGeometry=void 0))}else t.rigidBody&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(t.rigidBody.collider(0).handle),i.removeRigidBody(t.rigidBody),t.rigidBody=void 0),t.bvhGeometry&&(t.bvhGeometry=void 0),t.visible=!1;this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim=void 0===i?this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.filter(e=>void 0!==e.bvhGeometry):this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.filter(e=>void 0!==e.rigidBody),t.destroyedInAction=!0,this.controlsManager.requestRender()},this.objects=[...e.objects]}dispatch(e){if(!1===a(this.shared,this.condition))return!1;this.clone=e,this.data.delay?this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay)):this.dispatchInner()}dispatchFromStart(){if(!1===a(this.shared,this.condition))return!1;this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,1e3*this.data.delay))}dispose(){this.timeoutIdQueue.forEach(e=>window.clearTimeout(e))}};i("Create",({data:e,page:t,eventManager:i,shared:a,actionCondition:o})=>new y(e,t,i.controlsManager,a,o)),i("Destroy",({data:e,page:t,eventManager:i,shared:a,actionCondition:o})=>new p(e,t,i.controlsManager,a,o)),r("create-destroy");
@@ -1 +0,0 @@
1
- import{a as t}from"./runtime-chunk-5RFUYVOU.js";import"./runtime-chunk-URQHWMRU.js";import{c as e,d as i,f as o,g as s,i as n,k as r,l as a}from"./runtime-chunk-QEROHAPW.js";import"./runtime-chunk-N2ZRGNPR.js";import{a as h}from"./runtime-chunk-VAVYZ35B.js";import{e as l,f as c,g as d}from"./runtime-chunk-FQNSP44B.js";import{a as m}from"./runtime-chunk-DSYY4PII.js";import"./runtime-chunk-LZMIX3RB.js";import"./runtime-chunk-HTHAK3HS.js";import"./runtime-chunk-NV5AZNLT.js";import"./runtime-chunk-2LQQPLUM.js";import"./runtime-chunk-RNV6FGEN.js";import{$ as p,G as u,N as y,a as g,p as f}from"./runtime-chunk-35FH6BAP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as v,g as b}from"./runtime-chunk-UOHC2OET.js";import{h as x}from"./runtime-chunk-3ZEFAL7T.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-BPWKE4TV.js";import{a as w}from"./runtime-chunk-TZCHGFVF.js";import{La as P,Ma as M,ca as E,f as S,sa as j}from"./runtime-chunk-NMRQ6IV4.js";import{Bc as T,Cc as A,Dc as k,Ec as D,Fc as C,Oc as O,Pc as z,Re as R,Xc as F,Zc as _,dd as W,ld as X}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";var N=(t,e)=>{let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)},V=t=>t*(Math.PI/180),L=new Map,I=(t,e,i)=>{let o,s=e.split(/[ ,]+/g);for(let e=0;e<s.length;e+=1)o=s[e],t.addEventListener?t.addEventListener(o,i,!1):t.attachEvent&&t.attachEvent(o,i)},Q=(t,e,i)=>{let o,s=e.split(/[ ,]+/g);for(let e=0;e<s.length;e+=1)o=s[e],t.removeEventListener?t.removeEventListener(o,i):t.detachEvent&&t.detachEvent(o,i)},B=t=>(t.preventDefault(),t.type.match(/^touch/)?t.changedTouches:t),Y=()=>{if(!(typeof window>"u"))return{x:void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,y:void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop}},Z=(t,e)=>{e.top||e.right||e.bottom||e.left?(t.style.top=e.top,t.style.right=e.right,t.style.bottom=e.bottom,t.style.left=e.left):(t.style.left=e.x+"px",t.style.top=e.y+"px")},G=(t,e,i)=>{let o=q(t);for(let t in o)if(Object.prototype.hasOwnProperty.call(o,t))if("string"==typeof e)o[t]=e+" "+i;else{let s="";for(let t=0,o=e.length;t<o;t+=1)s+=e[t]+" "+i+", ";o[t]=s.slice(0,-2)}return o},q=t=>{let e={};return e[t]="",["webkit","Moz","o"].forEach(function(i){e[i+t.charAt(0).toUpperCase()+t.slice(1)]=""}),e},U=(t,e)=>{for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},H=(t,e)=>{if(t.length)for(let i=0,o=t.length;i<o;i+=1)e(t[i]);else e(t)};typeof window<"u"&&(K="ontouchstart"in window,J=!!window.PointerEvent,$=!!window.MSPointerEvent);var K,J,$,tt,et={start:"mousedown",move:"mousemove",end:"mouseup"},it={};function ot(){}J?tt={start:"pointerdown",move:"pointermove",end:"pointerup, pointercancel"}:$?tt={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:K?(tt={start:"touchstart",move:"touchmove",end:"touchend, touchcancel"},it=et):tt=et,ot.prototype.on=function(t,e){var i,o=this,s=t.split(/[ ,]+/g);o._handlers_=o._handlers_||{};for(var n=0;n<s.length;n+=1)i=s[n],o._handlers_[i]=o._handlers_[i]||[],o._handlers_[i].push(e);return o},ot.prototype.off=function(t,e){var i=this;return i._handlers_=i._handlers_||{},void 0===t?i._handlers_={}:void 0===e?i._handlers_[t]=null:i._handlers_[t]&&i._handlers_[t].indexOf(e)>=0&&i._handlers_[t].splice(i._handlers_[t].indexOf(e),1),i},ot.prototype.trigger=function(t,e){var i,o=this,s=t.split(/[ ,]+/g);o._handlers_=o._handlers_||{};for(var n=0;n<s.length;n+=1)i=s[n],o._handlers_[i]&&o._handlers_[i].length&&o._handlers_[i].forEach(function(t){t.call(o,{type:i,target:o},e)})},ot.prototype.config=function(t){var e=this;e.options=e.defaults||{},t&&(e.options=((t,e)=>{let i={};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&Object.prototype.hasOwnProperty.call(e,o)?i[o]=e[o]:Object.prototype.hasOwnProperty.call(t,o)&&(i[o]=t[o]);return i})(e.options,t))},ot.prototype.bindEvt=function(t,e){var i=this;return i._domHandlers_=i._domHandlers_||{},i._domHandlers_[e]=function(){"function"==typeof i["on"+e]?i["on"+e].apply(i,arguments):console.warn('[WARNING] : Missing "on'+e+'" handler.')},I(t,tt[e],i._domHandlers_[e]),it[e]&&I(t,it[e],i._domHandlers_[e]),i},ot.prototype.unbindEvt=function(t,e){var i=this;return i._domHandlers_=i._domHandlers_||{},Q(t,tt[e],i._domHandlers_[e]),it[e]&&Q(t,it[e],i._domHandlers_[e]),delete i._domHandlers_[e],this};var st=ot;function nt(t,e){return this.identifier=e.identifier,this.position=e.position,this.frontPosition=e.frontPosition,this.collection=t,this.defaults={size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:1,mode:"dynamic",zone:document.body,lockX:!1,lockY:!1,shape:"circle"},this.config(e),"dynamic"===this.options.mode&&(this.options.restOpacity=0),this.id=nt.id,nt.id+=1,this.buildEl().stylize(),this.instance={el:this.ui.el,on:this.on.bind(this),off:this.off.bind(this),show:this.show.bind(this),hide:this.hide.bind(this),add:this.addToDom.bind(this),remove:this.removeFromDom.bind(this),destroy:this.destroy.bind(this),setPosition:this.setPosition.bind(this),resetDirection:this.resetDirection.bind(this),computeDirection:this.computeDirection.bind(this),trigger:this.trigger.bind(this),position:this.position,frontPosition:this.frontPosition,ui:this.ui,identifier:this.identifier,id:this.id,options:this.options},this.instance}nt.prototype=new st,nt.constructor=nt,nt.id=0,nt.prototype.buildEl=function(t){return this.ui={},this.options.dataOnly||(this.ui.el=document.createElement("div"),this.ui.back=document.createElement("div"),this.ui.front=document.createElement("div"),this.ui.el.className="nipple collection_"+this.collection.id,this.ui.back.className="back",this.ui.front.className="front",this.ui.el.setAttribute("id","nipple_"+this.collection.id+"_"+this.id),this.ui.el.appendChild(this.ui.back),this.ui.el.appendChild(this.ui.front)),this},nt.prototype.stylize=function(){if(this.options.dataOnly)return this;var t=this.options.fadeTime+"ms",e=(()=>{let t=q("borderRadius");for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e]="50%");return t})(),i=G("transition","opacity",t),o={};return o.el={position:"absolute",opacity:this.options.restOpacity,display:"block",zIndex:999},o.back={position:"absolute",display:"block",width:this.options.size+"px",height:this.options.size+"px",marginLeft:-this.options.size/2+"px",marginTop:-this.options.size/2+"px",background:"rgba(255, 255, 255, .4)",border:"solid 2px rgba(0, 0, 0, .1)"},o.front={width:this.options.size/2+"px",height:this.options.size/2+"px",position:"absolute",display:"block",marginLeft:-this.options.size/4+"px",marginTop:-this.options.size/4+"px",background:"rgba(255, 255, 255, .8)",border:"solid 2px rgba(0, 0, 0, .1)"},U(o.el,i),"circle"===this.options.shape&&U(o.back,e),U(o.front,e),this.applyStyles(o),this},nt.prototype.applyStyles=function(t){for(var e in this.ui)if(Object.prototype.hasOwnProperty.call(this.ui,e))for(var i in t[e])this.ui[e].style[i]=t[e][i];return this},nt.prototype.addToDom=function(){return this.options.dataOnly||document.body.contains(this.ui.el)||this.options.zone.appendChild(this.ui.el),this},nt.prototype.removeFromDom=function(){return this.options.dataOnly||!document.body.contains(this.ui.el)||this.options.zone.removeChild(this.ui.el),this},nt.prototype.destroy=function(){clearTimeout(this.removeTimeout),clearTimeout(this.showTimeout),clearTimeout(this.restTimeout),this.trigger("destroyed",this.instance),this.removeFromDom(),this.off(),this.ui=null,this.instance=null,this.collection=null,this.options=null},nt.prototype.show=function(t){var e=this;return e.options.dataOnly||(clearTimeout(e.removeTimeout),clearTimeout(e.showTimeout),clearTimeout(e.restTimeout),e.addToDom(),e.restCallback(),setTimeout(function(){e.ui.el.style.opacity=1},0),e.showTimeout=setTimeout(function(){e.trigger("shown",e.instance),"function"==typeof t&&t.call(this)},e.options.fadeTime)),e},nt.prototype.hide=function(t){var e=this;if(e.options.dataOnly)return e;if(e.ui.el.style.opacity=e.options.restOpacity,clearTimeout(e.removeTimeout),clearTimeout(e.showTimeout),clearTimeout(e.restTimeout),e.removeTimeout=setTimeout(function(){var i="dynamic"===e.options.mode?"none":"block";e.ui.el.style.display=i,"function"==typeof t&&t.call(e),e.trigger("hidden",e.instance)},e.options.fadeTime),e.options.restJoystick){let i=e.options.restJoystick,o={};o.x=!0===i||!1!==i.x?0:e.instance.frontPosition.x,o.y=!0===i||!1!==i.y?0:e.instance.frontPosition.y,e.setPosition(t,o)}return e},nt.prototype.setPosition=function(t,e){var i=this;i.frontPosition={x:e.x,y:e.y};var o=i.options.fadeTime+"ms",s={};s.front=G("transition",["top","left"],o);var n={front:{}};n.front={left:i.frontPosition.x+"px",top:i.frontPosition.y+"px"},i.applyStyles(s),i.applyStyles(n),i.restTimeout=setTimeout(function(){"function"==typeof t&&t.call(i),i.restCallback()},i.options.fadeTime)},nt.prototype.restCallback=function(){var t=this,e={};e.front=G("transition","none",""),t.applyStyles(e),t.trigger("rested",t.instance)},nt.prototype.resetDirection=function(){this.direction={x:!1,y:!1,angle:!1}},nt.prototype.computeDirection=function(t){var e,i,o,s=t.angle.radian,n=Math.PI/4,r=Math.PI/2;if(s>n&&s<3*n&&!t.lockX?e="up":s>-n&&s<=n&&!t.lockY?e="left":s>3*-n&&s<=-n&&!t.lockX?e="down":t.lockY||(e="right"),t.lockY||(i=s>-r&&s<r?"left":"right"),t.lockX||(o=s>0?"up":"down"),t.force>this.options.threshold){var a,h={};for(a in this.direction)Object.prototype.hasOwnProperty.call(this.direction,a)&&(h[a]=this.direction[a]);var l={};for(a in this.direction={x:i,y:o,angle:e},t.direction=this.direction,h)h[a]===this.direction[a]&&(l[a]=!0);if(l.x&&l.y&&l.angle)return t;(!l.x||!l.y)&&this.trigger("plain",t),l.x||this.trigger("plain:"+i,t),l.y||this.trigger("plain:"+o,t),l.angle||this.trigger("dir dir:"+e,t)}else this.resetDirection();return t};var rt=nt;function at(t,e){var i=this;i.nipples=[],i.idles=[],i.actives=[],i.ids=[],i.pressureIntervals={},i.manager=t,i.id=at.id,at.id+=1,i.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:1,lockX:!1,lockY:!1,shape:"circle",dynamicPage:!1,follow:!1},i.config(e),("static"===i.options.mode||"semi"===i.options.mode)&&(i.options.multitouch=!1),i.options.multitouch||(i.options.maxNumberOfNipples=1);let o=getComputedStyle(i.options.zone.parentElement);return o&&"flex"===o.display&&(i.parentIsFlex=!0),i.updateBox(),i.prepareNipples(),i.bindings(),i.begin(),i.nipples}at.prototype=new st,at.constructor=at,at.id=0,at.prototype.prepareNipples=function(){var t=this,e=t.nipples;e.on=t.on.bind(t),e.off=t.off.bind(t),e.options=t.options,e.destroy=t.destroy.bind(t),e.ids=t.ids,e.id=t.id,e.processOnMove=t.processOnMove.bind(t),e.processOnEnd=t.processOnEnd.bind(t),e.get=function(t){if(void 0===t)return e[0];for(var i=0,o=e.length;i<o;i+=1)if(e[i].identifier===t)return e[i];return!1}},at.prototype.bindings=function(){var t=this;t.bindEvt(t.options.zone,"start"),t.options.zone.style.touchAction="none",t.options.zone.style.msTouchAction="none"},at.prototype.begin=function(){var t=this,e=t.options;if("static"===e.mode){var i=t.createNipple(e.position,t.manager.getIdentifier());i.add(),t.idles.push(i)}},at.prototype.createNipple=function(t,e){var i=this,o=i.manager.scroll,s={},n=i.options,r=i.parentIsFlex?o.x:o.x+i.box.left,a=i.parentIsFlex?o.y:o.y+i.box.top;if(t.x&&t.y)s={x:t.x-r,y:t.y-a};else if(t.top||t.right||t.bottom||t.left){var h=document.createElement("DIV");h.style.display="hidden",h.style.top=t.top,h.style.right=t.right,h.style.bottom=t.bottom,h.style.left=t.left,h.style.position="absolute",n.zone.appendChild(h);var l=h.getBoundingClientRect();n.zone.removeChild(h),s=t,t={x:l.left+o.x,y:l.top+o.y}}var c=new rt(i,{color:n.color,size:n.size,threshold:n.threshold,fadeTime:n.fadeTime,dataOnly:n.dataOnly,restJoystick:n.restJoystick,restOpacity:n.restOpacity,mode:n.mode,identifier:e,position:t,zone:n.zone,frontPosition:{x:0,y:0},shape:n.shape});return n.dataOnly||(Z(c.ui.el,s),Z(c.ui.front,c.frontPosition)),i.nipples.push(c),i.trigger("added "+c.identifier+":added",c),i.manager.trigger("added "+c.identifier+":added",c),i.bindNipple(c),c},at.prototype.updateBox=function(){this.box=this.options.zone.getBoundingClientRect()},at.prototype.bindNipple=function(t){var e,i=this,o=function(t,o){e=t.type+" "+o.id+":"+t.type,i.trigger(e,o)};t.on("destroyed",i.onDestroyed.bind(i)),t.on("shown hidden rested dir plain",o),t.on("dir:up dir:right dir:down dir:left",o),t.on("plain:up plain:right plain:down plain:left",o)},at.prototype.pressureFn=function(t,e,i){var o=this,s=0;clearInterval(o.pressureIntervals[i]),o.pressureIntervals[i]=setInterval(function(){var i=t.force||t.pressure||t.webkitForce||0;i!==s&&(e.trigger("pressure",i),o.trigger("pressure "+e.identifier+":pressure",i),s=i)}.bind(o),100)},at.prototype.onstart=function(t){var e=this,i=e.options,o=t;return t=B(t),e.updateBox(),H(t,function(s){e.actives.length<i.maxNumberOfNipples?e.processOnStart(s):o.type.match(/^touch/)&&(Object.keys(e.manager.ids).forEach(function(i){if(Object.values(o.touches).findIndex(function(t){return t.identifier===i})<0){var s=[t[0]];s.identifier=i,e.processOnEnd(s)}}),e.actives.length<i.maxNumberOfNipples&&e.processOnStart(s))}),e.manager.bindDocument(),!1},at.prototype.processOnStart=function(t){var e,i=this,o=i.options,s=i.manager.getIdentifier(t),n=t.force||t.pressure||t.webkitForce||0,r={x:t.pageX,y:t.pageY},a=i.getOrCreate(s,r);a.identifier!==s&&i.manager.removeIdentifier(a.identifier),a.identifier=s;var h=function(e){e.trigger("start",e),i.trigger("start "+e.id+":start",e),e.show(),n>0&&i.pressureFn(t,e,e.identifier),i.processOnMove(t)};if((e=i.idles.indexOf(a))>=0&&i.idles.splice(e,1),i.actives.push(a),i.ids.push(a.identifier),"semi"!==o.mode)h(a);else{if(!(N(r,a.position)<=o.catchDistance))return a.destroy(),void i.processOnStart(t);h(a)}return a},at.prototype.getOrCreate=function(t,e){var i,o=this,s=o.options;return/(semi|static)/.test(s.mode)?(i=o.idles[0])?(o.idles.splice(0,1),i):"semi"===s.mode?o.createNipple(e,t):(console.warn("Coudln't find the needed nipple."),!1):i=o.createNipple(e,t)},at.prototype.processOnMove=function(t){var e=this,i=e.options,o=e.manager.getIdentifier(t),s=e.nipples.get(o),n=e.manager.scroll;if((t=>isNaN(t.buttons)?0!==t.pressure:0!==t.buttons)(t)){if(!s)return console.error("Found zombie joystick with ID "+o),void e.manager.removeIdentifier(o);if(i.dynamicPage){var r=s.el.getBoundingClientRect();s.position={x:n.x+r.left,y:n.y+r.top}}s.identifier=o;var a=s.options.size/2,h={x:t.pageX,y:t.pageY};i.lockX&&(h.y=s.position.y),i.lockY&&(h.x=s.position.x);var l,c,d=N(h,s.position),m=((t,e)=>{let i=e.x-t.x,o=e.y-t.y;return(t=>t*(180/Math.PI))(Math.atan2(o,i))})(h,s.position),p=V(m),u=d/a,y={distance:d,position:h};if("circle"===s.options.shape?(l=Math.min(d,a),c=((t,e,i)=>{let o={x:0,y:0};return i=V(i),o.x=t.x-e*Math.cos(i),o.y=t.y-e*Math.sin(i),o})(s.position,l,m)):(c=((t,e,i)=>({x:Math.min(Math.max(t.x,e.x-i),e.x+i),y:Math.min(Math.max(t.y,e.y-i),e.y+i)}))(h,s.position,a),l=N(c,s.position)),i.follow){if(d>a){let t=h.x-c.x,i=h.y-c.y;s.position.x+=t,s.position.y+=i,s.el.style.top=s.position.y-(e.box.top+n.y)+"px",s.el.style.left=s.position.x-(e.box.left+n.x)+"px",d=N(h,s.position)}}else h=c,d=l;var g=h.x-s.position.x,f=h.y-s.position.y;s.frontPosition={x:g,y:f},i.dataOnly||Z(s.ui.front,s.frontPosition);var v={identifier:s.identifier,position:h,force:u,pressure:t.force||t.pressure||t.webkitForce||0,distance:d,angle:{radian:p,degree:m},vector:{x:g/a,y:-f/a},raw:y,instance:s,lockX:i.lockX,lockY:i.lockY};(v=s.computeDirection(v)).angle={radian:V(180-m),degree:180-m},s.trigger("move",v),e.trigger("move "+s.id+":move",v)}else this.processOnEnd(t)},at.prototype.processOnEnd=function(t){var e=this,i=e.options,o=e.manager.getIdentifier(t),s=e.nipples.get(o),n=e.manager.removeIdentifier(s.identifier);!s||(i.dataOnly||s.hide(function(){"dynamic"===i.mode&&(s.trigger("removed",s),e.trigger("removed "+s.id+":removed",s),e.manager.trigger("removed "+s.id+":removed",s),s.destroy())}),clearInterval(e.pressureIntervals[s.identifier]),s.resetDirection(),s.trigger("end",s),e.trigger("end "+s.id+":end",s),e.ids.indexOf(s.identifier)>=0&&e.ids.splice(e.ids.indexOf(s.identifier),1),e.actives.indexOf(s)>=0&&e.actives.splice(e.actives.indexOf(s),1),/(semi|static)/.test(i.mode)?e.idles.push(s):e.nipples.indexOf(s)>=0&&e.nipples.splice(e.nipples.indexOf(s),1),e.manager.unbindDocument(),/(semi|static)/.test(i.mode)&&(e.manager.ids[n.id]=n.identifier))},at.prototype.onDestroyed=function(t,e){var i=this;i.nipples.indexOf(e)>=0&&i.nipples.splice(i.nipples.indexOf(e),1),i.actives.indexOf(e)>=0&&i.actives.splice(i.actives.indexOf(e),1),i.idles.indexOf(e)>=0&&i.idles.splice(i.idles.indexOf(e),1),i.ids.indexOf(e.identifier)>=0&&i.ids.splice(i.ids.indexOf(e.identifier),1),i.manager.removeIdentifier(e.identifier),i.manager.unbindDocument()},at.prototype.destroy=function(){var t=this;for(var e in t.unbindEvt(t.options.zone,"start"),t.nipples.forEach(function(t){t.destroy()}),t.pressureIntervals)Object.prototype.hasOwnProperty.call(t.pressureIntervals,e)&&clearInterval(t.pressureIntervals[e]);t.trigger("destroyed",t.nipples),t.manager.unbindDocument(),t.off(),t.pressureIntervals={},t.nipples=[],t.idles=[],t.actives=[],t.ids=[],t.manager=null};var ht=at;function lt(t){var e=this;e.ids={},e.index=0,e.collections=[],e.scroll=Y(),e._windowBound=!1,e.config(t),e.prepareCollections();var i=function(){var t;e.collections.forEach(function(i){i.forEach(function(i){t=i.el.getBoundingClientRect(),i.position={x:e.scroll.x+t.left,y:e.scroll.y+t.top}})})};return e._onResize=function(){(t=>{L.has(t)&&clearTimeout(L.get(t)),L.set(t,setTimeout(function(){L.delete(t),t()},100))})(i)},e._onScroll=function(){e.scroll=Y()},e.collections}lt.prototype=new st,lt.constructor=lt,lt.prototype.prepareCollections=function(){var t=this;t.collections.create=t.create.bind(t),t.collections.on=t.on.bind(t),t.collections.off=t.off.bind(t),t.collections.destroy=t.destroy.bind(t),t.collections.get=function(e){var i;return t.collections.every(function(t){return!(i=t.get(e))}),i}},lt.prototype.create=function(t){return this.createCollection(t)},lt.prototype.bindWindowEvents=function(){var t=this;t._windowBound||typeof window>"u"||(t._windowBound=!0,I(window,"resize",t._onResize),I(window,"scroll",t._onScroll))},lt.prototype.unbindWindowEvents=function(){var t=this;!t._windowBound||typeof window>"u"||(t._windowBound=!1,Q(window,"resize",t._onResize),Q(window,"scroll",t._onScroll))},lt.prototype.createCollection=function(t){var e=this,i=new ht(e,t);return e.bindCollection(i),e.collections.push(i),e.bindWindowEvents(),i},lt.prototype.bindCollection=function(t){var e,i=this,o=function(t,o){e=t.type+" "+o.id+":"+t.type,i.trigger(e,o)};t.on("destroyed",i.onDestroyed.bind(i)),t.on("shown hidden rested dir plain",o),t.on("dir:up dir:right dir:down dir:left",o),t.on("plain:up plain:right plain:down plain:left",o)},lt.prototype.bindDocument=function(){var t=this;t.binded||(t.bindEvt(document,"move").bindEvt(document,"end"),t.binded=!0)},lt.prototype.unbindDocument=function(t){var e=this;(!Object.keys(e.ids).length||!0===t)&&(e.unbindEvt(document,"move").unbindEvt(document,"end"),e.binded=!1)},lt.prototype.getIdentifier=function(t){var e;return t?void 0===(e=void 0===t.identifier?t.pointerId:t.identifier)&&(e=this.latest||0):e=this.index,void 0===this.ids[e]&&(this.ids[e]=this.index,this.index+=1),this.latest=e,this.ids[e]},lt.prototype.removeIdentifier=function(t){var e={};for(var i in this.ids)if(this.ids[i]===t){e.id=i,e.identifier=this.ids[i],delete this.ids[i];break}return e},lt.prototype.onmove=function(t){return this.onAny("move",t),!1},lt.prototype.onend=function(t){return this.onAny("end",t),!1},lt.prototype.oncancel=function(t){return this.onAny("end",t),!1},lt.prototype.onAny=function(t,e){var i,o=this,s="processOn"+t.charAt(0).toUpperCase()+t.slice(1);e=B(e);var n=function(t,e,i){i.ids.indexOf(e)>=0&&(i[s](t),t._found_=!0)};return H(e,function(t){i=o.getIdentifier(t),H(o.collections,n.bind(null,t,i)),t._found_||o.removeIdentifier(i)}),!1},lt.prototype.destroy=function(){var t=this;t.unbindDocument(!0),t.unbindWindowEvents(),t.ids={},t.index=0,t.collections.forEach(function(t){t.destroy()}),t.collections=[],t.off()},lt.prototype.onDestroyed=function(t,e){var i=this;if(i.collections.indexOf(e)<0)return!1;i.collections.splice(i.collections.indexOf(e),1),0===i.collections.length&&i.unbindWindowEvents()};var ct=lt,dt=null;function mt(){return dt||(dt=new ct),dt}var pt={create:function(t){return mt().create(t)},destroy:function(){dt&&(dt.destroy(),dt=null)},get factory(){return mt()}},ut=.02,yt=new C,gt=new C,ft=new C,vt=new C,bt=new C,xt=new C,wt=new O,Pt=new O,Mt=new O,Et=new D,St=new D,jt=new z(0,0,0,"YXZ"),Tt=new C(1,0,0),At=new C(0,1,0),kt=new C(0,0,1),Dt=new C(1,1,1),Ct=[],Ot=t=>Ct[t]??(Ct[t]=new C),zt=new C,Rt=new C,Ft=new C,_t=new C,Wt=new D,Xt=new C,Nt=new D,Vt=new R,Lt=new F,It={type:"requestRender"},Qt={type:"updateMatrix"},Bt=class extends T{constructor(t,i,o,s,n,r,a,h,p){super(),this.object=t,this.domElement=i,this.data=o,this.gloabalPhysics=s,this.controlsManager=n,this.cameraFollow=r,this.camera=a,this.page=h,this.sharedAssets=p,this.enableDamping=!0,this.hiddenMatrix0=new O,this.target0=new C,this.zoom0=1,this.rotForce=1,this.moveForce=1,this.pixelsPerMeter=e,this.euler0=new z(0,0,0,"YXZ"),this.position0Cam=new C,this.quat0Cam=new D,this.scale0Cam=new C,this.hiddenMatrix0Cam=new O,this.threshEndTranslate=.01,this.threshEndRotate=1e-8,this.threshEndRotVel=.005,this.collider={type:"capsule",radius:40,segment:new R(new C(0,-40,0),new C(0,40,0)),matrix:new O,position:new C,rotation:new D},this.euler=new z(0,0,0,"YXZ"),this.eulerDelta=new C,this.lastPosition=new C,this.lastCameraQuaternion=new D,this.lastCameraPosition=new C,this.PI_2=Math.PI/2,this.prevMouse=new k,this.velocityTarget=new C,this.velocity=new C,this.directionXZ=new C,this.rotVelocityStick=new C,this.rotVelocityTarget=new C,this.rotVelocity=new C,this.rotDirection=new C,this.nonColliderRotOffset=new O,this.nonColliderPosOffset=new O,this.firstPointerId=-1,this.rot=new C,this.path=[],this.movementState={moveNegZ:0,movePosZ:0,moveNegX:0,movePosX:0,moveNegY:0,movePosY:0,rotPosX:0,rotNegX:0,rotPosY:0,rotNegY:0,jump:0,run:0},this.onObject=!1,this.actionState={},this.keyAssignments=[["moveNegZ","W"],["moveNegX","A"],["movePosZ","S"],["movePosX","D"],["rotPosX","ArrowUp"],["rotPosY","ArrowLeft"],["rotNegX","ArrowDown"],["rotNegY","ArrowRight"],["jump"," "]],this.collisionEnabled=!0,this.offsetMatrix=new O,this.objectToTarget=new C,this.objectToTarget0=new C,this.objectToCamXZ=new C,this.objectToCamXZ0=new C,this.targetToCamera=new C,this.targetToCamera0=new C,this.cameraPolarAxis0=new C,this.targetPos=new C,this.targetQuat=new D,this.lerpFactorPos=(new C).setScalar(.3),this.lerpFactorPosStart=.3,this.lerpFactorPosEnd=.3,this.lerpFactorRotStart=.3,this.lerpFactorRotEnd=.3,this.lerpFactorPosCamera=.3,this.lerpFactorRotCamera=.3,this.objXZQuat=new D,this.objXZQuatInv=new D,this.objXZRotMat=new O,this.isFirstPerson=!1,this.didHit=!1,this.groundVelocity=new C,this.pushedVelocity=new C,this.groundYRotation=0,this.objectRealQuat=new D,this.colliderWorldQuat=new D,this.groundNormal=new C,this.groundTilt=new D,this.groundTiltInv=new D,this.lastHitObj=null,this.isFirstFrame=!0,this.rotationAccumWhenOrientWithCamera=0,this.navMeshPathDest=null,this.position=new C,this.quaternion=new D,this.scale=new C,this.initialAction=!0,this.onPointerDown=t=>{!(t.target===this.domElement||t.target instanceof HTMLElement&&"SPLINE-VIEWER"===t.target.tagName&&t.target.shadowRoot?.contains(this.domElement))||-1!==this.firstPointerId||(this.firstPointerId=t.pointerId,this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp),"keys"!==this.rotBy&&!l&&!c&&this.domElement.requestPointerLock(),this.prevMouse.set(t.clientX,t.clientY))},this.onPointerUp=t=>{this.firstPointerId=-1,this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp),"mouse"===t.pointerType&&this.domElement.ownerDocument.exitPointerLock()},this.onPointerMove=t=>{if(t.pointerId!==this.firstPointerId)return;let e=t.clientX-this.prevMouse.x,i=t.clientY-this.prevMouse.y;this.prevMouse.set(t.clientX,t.clientY),"mouse"===t.pointerType&&"keys"!==this.rotBy&&(c&&d<15.5&&!l?(this.eulerDelta.y=-e*this.mouseOrbitSensitivity,this.eulerDelta.x=-i*this.mouseOrbitSensitivity):(this.eulerDelta.y=-t.movementX*this.mouseOrbitSensitivity,this.eulerDelta.x=-t.movementY*this.mouseOrbitSensitivity)),"mouse"!==t.pointerType&&"drag"===this.rotByTouch&&(this.eulerDelta.y=-e*this.mouseOrbitSensitivity*5,this.eulerDelta.x=-i*this.mouseOrbitSensitivity*5),this.controlsManager.requestRender()},this.onPointerlockChange=t=>{this.domElement.ownerDocument.pointerLockElement===this.domElement?Bt.isLocked=!0:Bt.isLocked=!1},this.onPointerlockError=()=>{console.error("SPE.GameControls: Unable to use Pointer Lock API")},this.handleVisibilityChange=()=>{if(document?.hidden)for(let t in this.movementState)this.movementState[t]=0},this.onKeyDown=t=>{!(t.target instanceof HTMLInputElement)&&("ArrowLeft"===t.code||"ArrowUp"===t.code||"ArrowRight"===t.code||"ArrowDown"===t.code||"Space"===t.code)&&t.preventDefault();for(let e of this.keyAssignments)if(t.key.toUpperCase()===e[1]||t.key===e[1]){this.movementState[e[0]]=1;break}this.controlsManager.requestRender()},this.onKeyUp=t=>{for(let e of this.keyAssignments)if(t.key.toUpperCase()===e[1]||t.key===e[1]||t.code.slice(3,t.code.length).toUpperCase()===e[1]){this.movementState[e[0]]=0;break}},this.copyVRGamePadValues=(t,e)=>{for(let i=2;i<4;i++){let o=t.axes[i];0===e?2===i?this.movementState.movePosX=o:this.movementState.movePosZ=o:(t.buttons[3].pressed?this.movementState.jump=1:this.movementState.jump=0,2===i?this.movementState.rotPosY=o:"fly"===this.moveMode&&(this.movementState.moveNegY=o))}},this.sharedGameControlGlobals=n.sharedGameControlGlobals,t===a&&(this.isFirstPerson=!0),this.hiddenMatrix0.copy(this.object.hiddenMatrix),this.object.parent?this.object.hiddenMatrix.copy(this.object.parent.matrixWorld).invert():this.object.hiddenMatrix.identity(),this.object.matrix.copy(this.object.matrixWorld),this.object.matrix.decompose(this.position,this.quaternion,this.scale),this.euler0.setFromQuaternion(this.quaternion,"YXZ");let u=this.euler0.clone(),g=u.y;if(this.objectRealQuat.copy(this.quaternion),u.y=0,this.quaternion.setFromEuler(u),this.objXZQuat.copy(this.quaternion),this.objXZQuatInv.copy(this.objXZQuat).invert(),this.objXZRotMat.makeRotationFromQuaternion(this.quaternion),u.set(0,g,0),this.quaternion.setFromEuler(u),this.rot.setFromEuler(u),this.object.matrixAutoUpdate=!1,(this.isFirstPerson||!0===this.cameraFollow)&&(this.target0.copy(this.camera.getTarget()),this.zoom0=this.camera.zoom),!0===this.cameraFollow){this.position0Cam.copy(this.camera.position),this.quat0Cam.copy(this.camera.quaternion),this.scale0Cam.copy(this.camera.scale),this.hiddenMatrix0Cam.copy(this.camera.hiddenMatrix),this.camera.parent?(this.camera.hiddenMatrix.copy(this.camera?.parent.matrixWorld),this.camera.matrix.copy(this.camera.matrixWorld)):this.camera.hiddenMatrix.identity(),this.camera.matrix.copy(this.camera.matrixWorld),this.camera.matrix.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.matrixAutoUpdate=!1,this.offsetMatrix.copy(this.object.matrix).invert().multiply(this.camera.matrix);let t,e=new C(0,0,-1).applyQuaternion(this.camera.quaternion),i=(new C).subVectors(this.position,this.camera.position);this.objectToCamXZ.copy(i),this.objectToCamXZ.y=0,this.objectToCamXZ0.copy(this.objectToCamXZ),Math.abs(e.y)<1e-6?(i.y=0,e.y=0,t=i.projectOnVector(e)):t=i.y/e.y>0?e.multiplyScalar(i.y/e.y):e.multiplyScalar(i.length()),this.targetToCamera0.copy(t).negate();let o=this.camera.position.clone().add(t);this.objectToTarget0.subVectors(o,this.position);let s=(new z).setFromQuaternion(this.camera.quaternion,"YXZ");this.cameraPolarOffset=-s.x,s.x=0,s.z=0,s.y-=Math.PI/2,this.cameraPolarAxis0.set(0,0,-1).applyEuler(s)}if(this.object instanceof m&&(this.object.matrixAutoUpdate=!1),this.euler.setFromQuaternion(this.quaternion,"YXZ"),this.rotByTouch=o.rotByTouch??"joystick",this.rotBy=o.rotBy??"keys",this.rotationMode=o.rotationMode??"normal",this.moveMode=o.moveMode??"walk",this.collisionEnabled=o.collisionEnabled,this.speedTranslate=1*(o.speedTranslate??250),this.speedOrbit=.025*(o.speedRotate??100),this.mouseOrbitSensitivity=16e-6*(o.speedRotate??100),this.keyAssignments=o.keyAssignments.map(t=>{let e=[t[0],t[1]];return"▲"===e[1]?e[1]="ArrowUp":"◀"===e[1]?e[1]="ArrowLeft":"▼"===e[1]?e[1]="ArrowDown":"▶"===e[1]?e[1]="ArrowRight":"⇧"===e[1]?e[1]="Shift":"↵"===e[1]?e[1]="Enter":"Space"===e[1]?e[1]=" ":"⌘"===e[1]?e[1]="Meta":"Ctrl"===e[1]?e[1]="Control":"Esc"===e[1]&&(e[1]="Escape"),e}),"mouse"===o.rotBy){let t;t=this.keyAssignments.findIndex(t=>"rotNegX"===t[0]),-1!==t&&(this.keyAssignments[t][1]=""),t=this.keyAssignments.findIndex(t=>"rotPosX"===t[0]),-1!==t&&(this.keyAssignments[t][1]=""),t=this.keyAssignments.findIndex(t=>"rotPosY"===t[0]),-1!==t&&(this.keyAssignments[t][1]=""),t=this.keyAssignments.findIndex(t=>"rotNegY"===t[0]),-1!==t&&(this.keyAssignments[t][1]="")}this.lerpFactorPosStart=1-.02**(1/(60*(o.delayPos[0]??.3))),this.lerpFactorPosEnd=1-.02**(1/(60*(o.delayPos[1]??.3))),this.lerpFactorPos.setScalar(this.lerpFactorPosStart),this.lerpFactorRotStart=1-.02**(1/(60*(o.delayRot[0]??.3))),this.lerpFactorRotEnd=1-.02**(1/(60*(o.delayRot[1]??.3))),this.lerpFactorPosCamera=1-.02**(1/(60*(o.delayPosCamera??.3))),this.lerpFactorRotCamera=1-.02**(1/(60*(o.delayRotCamera??.3))),this.gravity=12*(this.gloabalPhysics.gravity??j.defaultData.gravity),this.usePhysics=this.gloabalPhysics.usePhysics??j.defaultData.usePhysics,this.jumpPower=20*o.jumpPower,this.resetYPosition=this.position.y+Math.abs(o.resetYPosition)*(this.gravity>0?1:-1),this.alignToGround=o.alignToGround??!1,this.orientMode=o.autoOrientMove?o.orientMode:"none",this.orientWith=o.orientWith??M.defaultDataThirdPerson.orientWith,this.slopeThresh=65*Math.PI/180,"capsule"===o.collider.type?(this.collider.radius=o.collider.radius,this.collider.segment.start.y=o.collider.height/2-o.collider.radius,this.collider.segment.end.y=-this.collider.segment.start.y,this.offset=o.collider.height*ut/this.pixelsPerMeter,this.stepThresh=.3*o.collider.height/this.pixelsPerMeter,this.colliderHeight=o.collider.height):"sphere"===o.collider.type?(this.collider.radius=o.collider.radius,this.collider.segment.start.y=0,this.collider.segment.end.y=0,this.offset=2*o.collider.radius*ut/this.pixelsPerMeter,this.stepThresh=2*o.collider.radius*.3/this.pixelsPerMeter,this.colliderHeight=2*o.collider.radius):(this.offset=o.collider.height*ut/this.pixelsPerMeter,this.stepThresh=.3*o.collider.height/this.pixelsPerMeter,this.colliderHeight=o.collider.height),this.collider.type=o.collider.type;let v=(new C).fromArray(o.collider.position.map(t=>"number"==typeof t?t:0)),b=(new D).setFromEuler((new z).fromArray([...o.collider.rotation.map(t=>"number"==typeof t?t:0),"XYZ"]));this.collider.position.copy(v).multiply(this.scale),this.collider.rotation.copy(b),this.collider.matrix.compose(v,b,Dt),void 0!==o.cameraXAxis&&(this.cameraXAxis=o.cameraXAxis,this.cameraYAxis=o.cameraYAxis,this.minPolarAngle=o.cameraRotXLimits[0],this.maxPolarAngle=o.cameraRotXLimits[1],this.minAzimuthAngleRel=o.cameraRotYLimits[0],this.maxAzimuthAngleRel=o.cameraRotYLimits[1]),this.forwardDir=o.forwardDirection??"-z",this.isFirstPerson&&(this.forwardDir="-z"),this.runMultiplier=o.runMultiplier??2;let x=2*o.navmesh.destinationHelperRadius;if(x>0){let t=new S;t.push({fi:0,data:{...E.defaultData("light","phong"),alpha:0},id:"layer1"}),t.push({fi:0,data:{...E.defaultData("color"),color:o.navmesh.destinationHelperColor,alpha:o.navmesh.destinationHelperColor.a},id:"layer2"});let e=y({layers:t},{scene:this.page.scene,shared:this.sharedAssets});this.navMeshPathDest=new X(f.create({parameters:{width:x,height:x/10,hollow:.7}}),e),this.navMeshPathDest.material.userData.opacity0=o.navmesh.destinationHelperColor.a}this.activate()}reset(t=!1){if(this.object.hiddenMatrix.copy(this.hiddenMatrix0),t){this.object.updateMatrix(),this.object.updateMatrixWorld(),this.object.matrix.copy(this.object.matrixWorld),this.object.matrix.decompose(this.position,this.quaternion,this.scale),this.object.parent?this.object.hiddenMatrix.copy(this.object.parent.matrixWorld).invert():this.object.hiddenMatrix.identity();let t=(new z).setFromQuaternion(this.quaternion,"YXZ"),e=t.y;this.objectRealQuat.copy(this.quaternion),t.y=0,this.quaternion.setFromEuler(t),this.objXZQuat.copy(this.quaternion),this.objXZQuatInv.copy(this.objXZQuat).invert(),this.objXZRotMat.makeRotationFromQuaternion(this.quaternion),t.set(0,e,0),this.quaternion.setFromEuler(t),this.rot.setFromEuler(t),this.euler.setFromQuaternion(this.quaternion,"YXZ"),this.velocityTarget.set(0,0,0),this.velocity.set(0,0,0)}else this.object instanceof m?this.object.matrixAutoUpdate=!0:this.object.updateMatrix();!0===this.cameraFollow&&(this.camera.quaternion.copy(this.quat0Cam),this.camera.position.copy(this.position0Cam),this.camera.scale.copy(this.scale0Cam),this.camera.hiddenMatrix.copy(this.hiddenMatrix0Cam),this.camera.matrixAutoUpdate=!0),this.controlsManager.requestRender()}activate(){this.instantiateActions(),this.domElement.ownerDocument.addEventListener("pointerdown",this.onPointerDown),this.domElement.ownerDocument.addEventListener("keydown",this.onKeyDown),this.domElement.ownerDocument.addEventListener("keyup",this.onKeyUp),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError),this.domElement.ownerDocument.addEventListener("visibilitychange",this.handleVisibilityChange)}deactivate(){this.disposeActions(),this.domElement.ownerDocument.removeEventListener("pointerdown",this.onPointerDown),this.domElement.ownerDocument.removeEventListener("keydown",this.onKeyDown),this.domElement.ownerDocument.removeEventListener("keyup",this.onKeyUp),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError),this.domElement.ownerDocument.removeEventListener("visibilitychange",this.handleVisibilityChange)}dispose(){this.deactivate(),this.navMeshPathDest?.parent&&this.page.remove(this.navMeshPathDest)}instantiateActions(){let t=this.data,e=this.sharedAssets;void 0!==t.gameActions&&(this.actions={},P.list.forEach(i=>{this.actions[i]=v({...t,disabled:!1,type:"GameControl"},t.gameActions[i],this.page,e,this.controlsManager.eventManager,this.object)})),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),this.dispatchStartEvent("idle"),this.initialAction&&(this.initialAction=!1)}disposeActions(){this.initialAction=!1,this.dispatchStopEvent("idle"),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),b(this.actions.idle),b(this.actions.move),b(this.actions.run),b(this.actions.jump)}dispatchStartEvent(t){void 0!==this.actions[t]&&(this.actionState[t]||(this.actionState[t]=!0,this.actions[t].Transition.forEach(t=>{t.play()}),this.actions[t].Animation.forEach(t=>{t.play(!1===this.initialAction)}),this.actions[t].TimelineAnimation.forEach(t=>{t.play()}),this.actions[t].Create.forEach(t=>{t.dispatchStart()}),this.actions[t].Audio.forEach(t=>{t.dispatchGameControl("start")}),this.actions[t].Particles.forEach(t=>{t.dispatchGameControl("start")})))}dispatchStopEvent(t){void 0!==this.actions[t]&&(!this.actionState[t]||(this.actionState[t]=!1,this.actions[t].Transition.forEach(t=>{t.stop(),null!==t.object.currentState&&t.object.changeSelectedState(null,{scene:this.page.scene,shared:this.sharedAssets})}),this.actions[t].TimelineAnimation.forEach(t=>{t.stop()}),this.actions[t].Create.forEach(t=>{t.dispatchStop()}),this.actions[t].Audio.forEach(t=>{t.dispatchGameControl("stop")}),this.actions[t].Particles.forEach(t=>{t.dispatchGameControl("stop")})))}get colliderWorldPosition(){return vt.copy(this.collider.position).applyQuaternion(this.objectRealQuat).add(this.position)}update(t){if(this.gravity<0?this.position.y<this.resetYPosition:this.position.y>this.resetYPosition)return this.reset(!0),!0;this.sharedGameControlGlobals.gamePads.forEach(this.copyVRGamePadValues);let e=(this.isFirstFrame?16.6:t)/1e3;this.isFirstFrame&&(this.isFirstFrame=!1);let i=60*e,o=!1;if(this.groundYRotation=0,this.groundVelocity.set(0,0,0),this.usePhysics&&this.collisionEnabled&&this.object.rigidBody?.collider(0).shape){let t=bt.set(0,(0===this.velocity.y?this.pixelsPerMeter*Math.max(Math.abs(this.gravity)/120,1)*(this.gravity>0?1:-1):this.velocity.y)*e,0).divideScalar(this.pixelsPerMeter),i=this.sharedGameControlGlobals.rapierWorld.castShape(this.colliderWorldPosition.divideScalar(this.pixelsPerMeter),this.colliderWorldQuat,t,this.object.rigidBody?.collider(0).shape,0,1,!1,8,void 0,void 0,this.object.rigidBody);if(i){this.onObject=!0,this.groundNormal.set(i.normal2.x,i.normal2.y,i.normal2.z).applyQuaternion(this.colliderWorldQuat).negate(),this.alignToGround&&this.groundTiltAdjustment(this.groundNormal),Math.acos(this.groundNormal.y)<this.slopeThresh&&(o=!0),0===i.collider.parent()?.bodyType()&&Math.acos(this.groundNormal.y)*(180/Math.PI)>45&&(this.onObject=!1);let t=i.collider.parent(),s=null!==t&&t.isKinematic()?t:null,n=null===s?void 0:this.sharedGameControlGlobals.kinematicBodyToEntity.get(s.handle);if(null!==s&&n?.userData.isFollowingObj!==this.object.uuid){let t=this.object.getWorldPosition(vt).add(this.collider.position).divideScalar(this.pixelsPerMeter),i=s.velocityAtPoint(t);this.groundVelocity.set(i.x,i.y,i.z).multiplyScalar(this.pixelsPerMeter),this.groundYRotation=s.angvel().y*e}}else this.onObject=!1}if("walk"===this.moveMode&&this.collisionEnabled&&(1===this.movementState.jump&&this.onObject&&(this.velocityTarget.y=this.jumpPower,this.movementState.jump=0,this.dispatchStopEvent("idle"),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),this.dispatchStartEvent("jump"),this.onObject=!1),this.onObject?this.velocityTarget.y/=2:this.velocityTarget.y+=this.gravity*i),"fly"===this.moveMode&&(this.velocityTarget.y=(this.movementState.movePosY-this.movementState.moveNegY)*this.speedTranslate),this.directionXZ.z=this.movementState.movePosZ-this.movementState.moveNegZ,this.directionXZ.x=this.movementState.movePosX-this.movementState.moveNegX,"+z"===this.forwardDir&&this.directionXZ.multiplyScalar(-1),this.directionXZ.manhattanLength()>0&&(this.path=[]),this.navMeshPathDest){let t=this.navMeshPathDest.material;if("walk"===this.moveMode&&this.path.length>1){this.navMeshPathDest.position.copy(this.path[this.path.length-1]),this.navMeshPathDest.parent||this.page.add(this.navMeshPathDest);let e=vt.subVectors(this.path[1],this.position),i=bt.subVectors(this.path[1],this.path[0]);e.dot(i)<0?this.path.shift():(this.directionXZ.x=i.x,this.directionXZ.z=i.z),t.opacity=t.userData.opacity0}else t.opacity-=.05*t.userData.opacity0,this.navMeshPathDest.material.opacity<=0&&this.navMeshPathDest.parent&&this.page.remove(this.navMeshPathDest)}this.directionXZ.normalize(),this.movementState.run?this.moveForce=this.runMultiplier:this.moveForce=1,this.velocityTarget.z=this.directionXZ.z*this.speedTranslate*this.moveForce,this.velocityTarget.x=this.directionXZ.x*this.speedTranslate*this.moveForce,("walk"===this.moveMode?this.velocityTarget.x+this.velocityTarget.z===0:0===this.velocityTarget.manhattanLength())?this.lerpFactorPos.setScalar(this.lerpFactorPosEnd):this.lerpFactorPos.setScalar(this.lerpFactorPosStart),"walk"===this.moveMode&&(this.lerpFactorPos.y=1),!1===this.didHit&&0===this.pushedVelocity.manhattanLength()||!1===this.usePhysics?(this.velocity.x+=(this.velocityTarget.x-this.velocity.x)*(1-(1-this.lerpFactorPos.x)**i),this.velocity.y+=(this.velocityTarget.y-this.velocity.y)*(1-(1-this.lerpFactorPos.y)**i),this.velocity.z+=(this.velocityTarget.z-this.velocity.z)*(1-(1-this.lerpFactorPos.z)**i)):this.velocity.copy(this.velocityTarget),("walk"===this.moveMode?this.velocity.x**2+this.velocity.z**2<this.speedTranslate:this.velocity.lengthSq()<this.speedTranslate)?(this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.onObject&&(this.dispatchStopEvent("jump"),this.dispatchStartEvent("idle"))):(this.dispatchStopEvent("idle"),(this.onObject||"fly"===this.moveMode)&&(this.dispatchStopEvent("jump"),this.movementState.run?(this.dispatchStopEvent("move"),this.dispatchStartEvent("run")):(this.dispatchStopEvent("run"),this.dispatchStartEvent("move"))));let n=ft.copy(this.velocity);if("none"!==this.orientMode&&!1===this.isFirstPerson){let t=bt.copy(n);t.y=0,n.set(0,n.y,t.length()*("+z"===this.forwardDir?1:-1))}if(this.directionXZ.manhattanLength()>0&&"none"!==this.orientMode&&!1===this.isFirstPerson)if("camera"===this.orientWith&&this.path.length<=1){let t=vt;this.camera.getWorldDirection(t);let e=xt.copy(At).multiplyScalar(t.dot(At));t.sub(e);let i=bt.copy(this.directionXZ);i.x*=-1,this.rot.y=t.angleTo(i)*(t.cross(i).y>0?-1:1)+this.rotationAccumWhenOrientWithCamera}else this.rot.y=(this.path.length>1?0:this.euler.y)+Math.atan2(-this.directionXZ.z,this.directionXZ.x)+Math.PI/2*("+z"===this.forwardDir?1:-1);if(jt.setFromVector3(this.rot),"walk"===this.moveMode&&(jt.x=0),n.applyEuler(jt),o&&(St.setFromUnitVectors(At,this.groundNormal),n.applyQuaternion(St)),!0===this.usePhysics&&this.object.rigidBody){this.pushedVelocity.set(0,0,0);let t=0;for(let i of this.sharedGameControlGlobals.entitiesWithTransformAnim){if(void 0===i.rigidBody||void 0===i.prevQ)continue;(i.hasNonUniformScale?i.matrixWorldRigid:i.matrixWorld).decompose(zt,Wt,Rt);let o=this.object.getWorldPosition(Ft).add(this.collider.position).sub(zt);Nt.copy(i.prevQ).invert().premultiply(Wt);let r=xt.subVectors(zt,i.prevT).add(_t.copy(o).applyQuaternion(Nt).sub(o)).divideScalar(e).divideScalar(this.pixelsPerMeter),a=i.rigidBody.collider(0).castCollider(r,this.object.rigidBody.collider(0),vt.copy(n).divideScalar(this.pixelsPerMeter),0,e,!1);r.multiplyScalar(this.pixelsPerMeter);let h=x.is(i)?i:i.object;if(null!==a&&this.lastHitObj!==h){let t;i instanceof p&&(t=i);let e=this.sharedGameControlGlobals.entityToCollisionEvents[h.uuid];if(e)for(let i of e)"character"===i.data.target&&(i.dispatch(t),h.dispatchEvent(s));this.lastHitObj=h}null!==a&&(Math.abs(r.x)>Math.abs(this.pushedVelocity.x)&&(this.pushedVelocity.x=r.x),Math.abs(r.y)>Math.abs(this.pushedVelocity.y)&&(this.pushedVelocity.y=r.y),Math.abs(r.z)>Math.abs(this.pushedVelocity.z)&&(this.pushedVelocity.z=r.z),Ot(t++).copy(a.normal1).applyQuaternion(i.quaternion))}if(t>0){for(let e=0;e<t;e++){let t=Ot(e),i=t.dot(n);i<0&&n.addScaledVector(t,-i)}n.add(this.pushedVelocity)}else n.add(this.groundVelocity)}if(this.rotDirection.y=Number(this.movementState.rotPosY)-Number(this.movementState.rotNegY),this.rotDirection.x=Number(this.movementState.rotPosX)-Number(this.movementState.rotNegX),this.rotDirection.normalize(),"normal"===this.rotationMode&&(this.movementState.rotPosX||this.movementState.rotNegX)||"steer"===this.rotationMode&&(this.movementState.rotPosX||this.movementState.rotNegX)&&(this.movementState.movePosZ||this.movementState.moveNegZ||"walk"===this.moveMode)?this.rotVelocityStick.x=-this.rotDirection.x*this.speedOrbit*this.rotForce:this.rotVelocityStick.x=0,"normal"===this.rotationMode&&(this.movementState.rotPosY||this.movementState.rotNegY)||"steer"===this.rotationMode&&(this.movementState.rotPosY||this.movementState.rotNegY)&&(this.movementState.movePosZ||this.movementState.moveNegZ)?this.rotVelocityStick.y=-this.rotDirection.y*this.speedOrbit*this.rotForce:this.rotVelocityStick.y=0,this.rotVelocityTarget.subVectors(this.eulerDelta.divideScalar(e),this.rotVelocityStick),0===this.rotVelocityTarget.manhattanLength()?this.rotVelocity.lerp(this.rotVelocityTarget,1-(1-this.lerpFactorRotEnd)**i):this.rotVelocity.lerp(this.rotVelocityTarget,1-(1-this.lerpFactorRotStart)**i),this.euler.x+=this.rotVelocity.x*e,this.euler.y+=this.rotVelocity.y*e+this.groundYRotation,0===this.rotVelocityTarget.y&&0===this.directionXZ.manhattanLength()?this.rotationAccumWhenOrientWithCamera=0:(!1===this.cameraFollow||"Locked"===this.cameraYAxis)&&(this.rotationAccumWhenOrientWithCamera+=this.rotVelocity.y*e),!1===this.isFirstPerson&&"none"!==this.orientMode&&this.directionXZ.manhattanLength()>0){if("radial"===this.orientMode){this.objectToCamXZ.copy(this.objectToCamXZ0).applyAxisAngle(At,this.euler.y-this.euler0.y);let t=bt.copy(this.objectToCamXZ).normalize(),i=xt.copy(n).multiplyScalar(e);i.y=0;let o=i.sub(vt.copy(t).multiplyScalar(i.dot(t))).cross(t).y;this.euler.y-=Math.atan2(o,this.objectToCamXZ.length())}}else this.rot.y+=this.rotVelocity.y*e+this.groundYRotation,0!==this.rotVelocityTarget.y&&(!1===this.cameraFollow||"Locked"===this.cameraYAxis)&&(this.euler.y=this.rot.y);if(!0===this.cameraFollow&&("walk"===this.moveMode?"Limit"===this.cameraXAxis?this.euler.x=A.clamp(this.euler.x,-this.maxPolarAngle+this.cameraPolarOffset+1e-6,-this.minPolarAngle+this.cameraPolarOffset-1e-6):this.euler.x=A.clamp(this.euler.x,-this.PI_2+this.cameraPolarOffset,this.PI_2+this.cameraPolarOffset):"Limit"===this.cameraXAxis&&(this.euler.x=A.clamp(this.euler.x,-this.PI_2,this.PI_2))),"fly"===this.moveMode?this.rot.x=this.euler.x:this.isFirstPerson&&(jt.copy(this.euler),jt.y=0,this.nonColliderRotOffset.makeRotationFromEuler(jt)),Et.setFromAxisAngle(Tt,this.rot.x),St.setFromAxisAngle(At,this.rot.y),St.multiply(Et),Et.setFromAxisAngle(kt,this.rot.z),St.multiply(Et),this.quaternion.copy(St),this.objectRealQuat.multiplyQuaternions(this.quaternion,this.objXZQuat),this.colliderWorldQuat.copy(this.objectRealQuat).multiply(this.collider.rotation),this.collisionEnabled)if(this.usePhysics&&this.object.rigidBody?.collider(0).shape){let t=bt.copy(n).multiplyScalar(e/this.pixelsPerMeter),i=null;this.didHit=!1;let o=new C;for(let e=0;e<5;e++){let n=t.length(),r=xt.copy(t).normalize();if(i=this.sharedGameControlGlobals.rapierWorld.castShape(this.colliderWorldPosition.divideScalar(this.pixelsPerMeter).add(o),this.colliderWorldQuat,r,this.object.rigidBody.collider(0).shape,0,n,!1,12,void 0,void 0,this.object.rigidBody),null===i){0===e&&0!==this.directionXZ.manhattanLength()&&(this.lastHitObj=null),o.add(t);break}{this.didHit=!0;let a=this.sharedGameControlGlobals.colliderToEntity.get(i.collider.handle);if(a!==this.lastHitObj&&0===e){this.lastHitObj=a;let t=this.sharedGameControlGlobals.entityToCollisionEvents[a?.uuid];if(t)for(let e of t)if("character"===e.data.target){let t,o=(this.sharedGameControlGlobals.rapierWorld?.getCollider(i.collider.handle))._parent;if(a.cloner)for(let e of a.cloner.children)if(e.rigidBody===o){t=e;break}e.dispatch(t),a.dispatchEvent(s)}}let h=yt.set(i.normal2.x,i.normal2.y,i.normal2.z).applyQuaternion(this.colliderWorldQuat),l=gt.copy(r).multiplyScalar(i.time_of_impact).dot(h),c=i.time_of_impact;if(0===c&&(this.position.y+=this.offset*this.pixelsPerMeter),l>this.offset&&(c=i.time_of_impact*(l-this.offset)/l,o.addScaledVector(r,c)),t.copy(r).multiplyScalar(n-c),Math.acos(-h.y)>this.slopeThresh){let e=this.colliderWorldPosition.divideScalar(this.pixelsPerMeter).add(o),s=xt.copy(i.witness2).applyQuaternion(this.colliderWorldQuat);s.y=0;let n=e.add(s);n.y+=this.stepThresh;let r=this.sharedGameControlGlobals.rapierWorld.castShape(n,this.colliderWorldQuat,t,this.object.rigidBody?.collider(0).shape,0,1,!1,12,void 0,void 0,this.object.rigidBody);null!==r&&0===r.time_of_impact&&(h.y=0,h.normalize())}t.addScaledVector(h,-t.dot(h))}}this.position.addScaledVector(o,this.pixelsPerMeter),vt.copy(this.position).divideScalar(this.pixelsPerMeter),Et.copy(this.quaternion).premultiply(this.groundTilt).multiply(this.objXZQuat);let r=this.object.rigidBody,a=void 0!==r&&Xt.copy(vt).sub(r.translation()).lengthSq()>1;void 0!==r&&(a?(r.setTranslation(vt,!0),r.setRotation(Et,!0)):(r.setNextKinematicTranslation(vt),r.setNextKinematicRotation(Et)))}else{let t=this.onObject?1:5,i=n.multiplyScalar(e/t);for(let o=0;o<t;o++)this.position.add(i),this.collisionAdjustment(e/t)}else this.position.addScaledVector(n,e);if("walk"===this.moveMode&&this.onObject&&(this.velocityTarget.y=0,this.velocity.y=0),this.quaternion.premultiply(this.groundTilt).multiply(this.objXZQuat),this.object.matrix.compose(this.position,this.quaternion,this.scale),this.object.matrixWorldNeedsUpdate=!0,this.object.matrix.multiply(this.nonColliderPosOffset).multiply(this.nonColliderRotOffset),this.quaternion.premultiply(this.groundTiltInv).multiply(this.objXZQuatInv),!0===this.cameraFollow){this.updateFollowArms();let t=this.objectToTarget.add(this.position),e=this.targetToCamera.add(t);wt.lookAt(e,t,At).setPosition(e),wt.decompose(this.targetPos,this.targetQuat,vt),this.camera.quaternion.slerp(this.targetQuat,1-(1-this.lerpFactorRotCamera)**i),this.camera.position.lerp(this.targetPos,1-(1-this.lerpFactorPosCamera)**i),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),"Limit"===this.cameraYAxis&&"cartesian"===this.orientMode&&(this.euler.y=A.clamp(this.euler.y,this.minAzimuthAngleRel,this.maxAzimuthAngleRel)),this.euler.x=A.clamp(this.euler.x,-this.PI_2+(this.cameraPolarOffset<0?this.cameraPolarOffset:0),this.PI_2+(this.cameraPolarOffset>0?this.cameraPolarOffset:0))}return this.eulerDelta.set(0,0,0),this.object.dispatchEvent(Qt),!(this.path.length<2&&this.lastPosition.distanceToSquared(this.position)<this.threshEndTranslate&&Math.abs(this.rotVelocity.x)<this.threshEndRotVel&&Math.abs(this.rotVelocity.y)<this.threshEndRotVel&&(void 0===this.camera||this.isFirstPerson||this.lastCameraPosition.distanceToSquared(this.camera.position)<this.threshEndTranslate&&8*(1-this.lastCameraQuaternion.dot(this.camera.quaternion))<this.threshEndRotate)&&("fly"===this.moveMode||!0===this.onObject||!1===this.collisionEnabled)&&(null===this.navMeshPathDest||this.navMeshPathDest.material.opacity<-.04*this.navMeshPathDest?.material?.userData.opacity0)||(this.camera&&(this.lastCameraPosition.copy(this.camera.position),this.lastCameraQuaternion.copy(this.camera.quaternion)),this.lastPosition.copy(this.position),this.object.dispatchEvent(It),0))}updateFollowArms(){this.objectToTarget.copy(this.objectToTarget0),this.targetToCamera.copy(this.targetToCamera0);let t,e=Et.setFromAxisAngle(At,"Limit"===this.cameraYAxis&&"radial"!==this.orientMode?A.clamp(this.euler.y-this.euler0.y,this.minAzimuthAngleRel,this.maxAzimuthAngleRel):this.euler.y-this.euler0.y);("Locked"!==this.cameraYAxis||"radial"===this.orientMode)&&this.objectToTarget.applyQuaternion(e),t="Limit"===this.cameraXAxis?A.clamp(this.euler.x,-this.maxPolarAngle+this.cameraPolarOffset+1e-6,-this.minPolarAngle+this.cameraPolarOffset-1e-6):A.clamp(this.euler.x,-this.PI_2+this.cameraPolarOffset+1e-6,this.PI_2+this.cameraPolarOffset-1e-6);let i=vt.copy(this.cameraPolarAxis0);("Locked"!==this.cameraYAxis||"radial"===this.orientMode)&&i.applyQuaternion(e);let o=St.setFromAxisAngle(i,t);"Locked"!==this.cameraYAxis&&this.targetToCamera.applyQuaternion(e),"Locked"!==this.cameraXAxis&&this.targetToCamera.applyQuaternion(o)}groundTiltAdjustment(t){180*At.angleTo(t)/Math.PI<15||180*At.angleTo(t)/Math.PI>85?Et.identity():Et.setFromUnitVectors(At,t),this.groundTilt.slerp(Et,.06),this.groundTiltInv.copy(this.groundTilt).invert()}collisionAdjustment(t){let e=gt.set(0,0,0);this.object.matrix.compose(this.position,this.quaternion,this.scale);let i=wt.multiplyMatrices(this.object.matrix,this.objXZRotMat).multiply(this.collider.matrix).decompose(vt,Et,bt).compose(vt,Et,Dt);this.sharedGameControlGlobals.entitiesWithTransformAnim.forEach(t=>{if(t===this.object||t.isDescendantOf(this.object)||!t.bvhGeometry||!t.bvhGeometry.boundsTree)return;Lt.makeEmpty(),t.updateMatrixWorldRigid();let o=t.matrixWorldRigid,s=Pt.copy(o).invert(),n=Mt.copy(Pt).multiply(i);Vt.copy(this.collider.segment),Vt.start.applyMatrix4(n),Vt.end.applyMatrix4(n);let r=yt.copy(this.position).applyMatrix4(s);Lt.expandByPoint(Vt.start),Lt.expandByPoint(Vt.end),Lt.min.addScalar(-this.collider.radius),Lt.max.addScalar(this.collider.radius),t.bvhGeometry.boundsTree.shapecast({boundsTraverseOrder:t=>t.distanceToPoint(Vt.end),intersectsBounds:t=>t.intersectsBox(Lt),intersectsTriangle:t=>{let i=vt,s=bt,n=t.closestPointToSegment(Vt,i,s);if(n<this.collider.radius){let t=this.collider.radius-n,a=s.sub(i).normalize(),h=xt.copy(r);h.addScaledVector(a,t);let l=h.applyMatrix4(o).sub(this.position);e.add(l),Vt.start.addScaledVector(a,t),Vt.end.addScaledVector(a,t)}}})}),Lt.makeEmpty(),Vt.copy(this.collider.segment),Vt.start.applyMatrix4(i),Vt.end.applyMatrix4(i),Lt.expandByPoint(Vt.start),Lt.expandByPoint(Vt.end),Lt.min.addScalar(-this.collider.radius),Lt.max.addScalar(this.collider.radius),this.sharedGameControlGlobals.staticMeshBVH?.shapecast({boundsTraverseOrder:t=>t.distanceToPoint(Vt.end),intersectsBounds:t=>t.intersectsBox(Lt),intersectsTriangle:t=>{let i=vt,o=bt,s=t.closestPointToSegment(Vt,i,o);if(s<this.collider.radius){let t=this.collider.radius-s,n=o.sub(i).normalize();this.alignToGround&&this.groundTiltAdjustment(n),e.addScaledVector(n,t),Vt.start.addScaledVector(n,t),Vt.end.addScaledVector(n,t)}}}),this.onObject=Math.abs(e.y)>Math.abs(t*this.velocity.y*.25),this.onObject&&this.dispatchStopEvent("jump");let o=Math.max(0,e.length()-1e-5);e.normalize().multiplyScalar(o),this.position.add(e)}pause(){this.firstPointerId=-1,this.movementState={moveNegZ:0,movePosZ:0,moveNegX:0,movePosX:0,moveNegY:0,movePosY:0,rotPosX:0,rotNegX:0,rotPosY:0,rotNegY:0,jump:0,run:0},this.deactivate()}resume(){this.activate()}},Yt=Bt;Yt.isLocked=!1;var Zt,Gt,qt,Ut={cs:6,ch:2,walkableSlopeAngle:90,walkableHeight:20,walkableClimb:5,walkableRadius:0,maxEdgeLen:12,maxSimplificationError:1.3,minRegionArea:8,mergeRegionArea:20,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1};r.then(t=>{Zt=t,Gt=new t.Vec3,qt=new t.Vec3});var Ht=new C,Kt=class{constructor(e=!1,i=!1){var s;this.usePhysics=e,this.isExport=i,this.onPointerDown=t=>{if(1!==h.length)return;let{raycaster:e,page:i}=this.eventContext;this.eventContext.updateRaycaster(t);let o=i.raycastWithClones(e);if(0!==o.length){if(this.gameControl){let t=Ht.copy(this.gameControl.colliderWorldPosition);t.y-=this.gameControl.colliderHeight/2,this.gameControl.path=this.computePath(t,o[0].point)}this.eventContext.requestRender()}},this.traverseWithPhysics=(e,i)=>s=>{let r;if(s instanceof t){if(!s.objectForSample)return!0===s.object.dataPatched.physics.fusedBody&&"dynamic"===s.object.dataPatched.physics.rigidBody||void 0;if(s.objectForSample.dataPatched.physics.fusedBody)return;r=s.object}else if(s instanceof p)r=s.object;else if(r=s,!1===r.dataPatched.cloner?.disabled&&r.dataPatched.cloner?.hideBase&&!0!==r.dataPatched.physics?.fusedBody)return!0;if(i&&!r.userData.navmesh)return;let a=r.dataPatched;if(!a.visible&&!0!==a.physics?.enabled)return!0;s.updateMatrixWorldRigid();let h=n(a),l=r.userData.hasDestroy,c=r.userData.hasDrag,d=!1,m=!1;for(let t of a.events)!0!==t.data.disabled&&("GameControl"===t.data.type?d=!0:"Follow"===t.data.type&&(m=!0));if(d||h||m||l||c)return!0;if(this.usePhysics&&"dynamic"===a.physics?.rigidBody){if(this.usePhysics&&a.physics?.fusedBody)return!0}else if("geometry"in s&&s.geometry&&e.push(o(s.geometry,s.matrixWorld)),this.usePhysics&&a.physics?.fusedBody)return s.traverseObject((i,s)=>{if(0===s)return;let n;if(i instanceof t){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;n=i.object}else if(i instanceof p)n=i.object;else if(n=i,i.dataPatched.cloner?.hideBase)return!0;let r=n.dataPatched;if(!r.visible&&!0!==r.physics?.enabled)return!0;"geometry"in i&&i.geometry&&e.push(o(i.geometry,i.matrixWorld))}),!0},this.traverseNoPhysics=(e,i)=>s=>{let r;if(s instanceof t)return;r=s instanceof p?s.object:s;let a=r.dataPatched;if("visibility"===a.physics.enabled?!a.visible:!a.physics.enabled)return!0;if(i&&!r.userData.navmesh)return;let h=s.geometry,l=!0===r.userData.hasDestroy,c=!0===r.userData.hasDrag;if(n(a)||l||c||r.dataPatched.events.some(t=>!0!==t.data.disabled&&"GameControl"===t.data.type))return!0;h&&e.push(o(h,s.matrixWorld))},this.navmeshWasm=Zt,this.navMesh=new this.navmeshWasm.NavMesh,this._workerURL=URL.createObjectURL(new Blob([(i?(s=a??"https://cdn.spline.design/@splinetool/runtime@2.0.51/build/",`\n(async function() {\n\tconst [wasmImport, wasmBinary] = await Promise.all([\n\t\timport('${s}' + 'navmesh.js'),\n\t\tfetch('${s}' + 'navmesh.wasm').then((res) => res.arrayBuffer()),\n\t]);\n\tconst wasmModule = wasmImport.default;\n\tself.module = await wasmModule({ wasmBinary });\n\tpostMessage('ready');\n})();\n`):"\n(async function() {\n\tconst [wasmImport, wasmBinary] = await Promise.all([\n\t\timport(self.location.origin + '/_libraries/navmesh.js'),\n\t\tfetch(self.location.origin + '/_libraries/navmesh.wasm').then((res) => res.arrayBuffer()),\n\t]);\n\tconst wasmModule = wasmImport.default;\n\tself.module = await wasmModule({ wasmBinary });\n\tpostMessage('ready');\n})();\n")+"\n\nonmessage = function(messageEvent) {\n\tconst meshData = messageEvent.data;\n\tconst positions = meshData[0];\n\tconst offset = meshData[1];\n\tconst indices = meshData[2];\n\tconst indicesLength = meshData[3];\n\tconst parameters = meshData[4];\n\n\tconst module = self.module;\n\tconst rc = new module.rcConfig();\n\trc.cs = parameters.cs;\n\trc.ch = parameters.ch;\n\trc.borderSize = parameters.borderSize ? parameters.borderSize : 0;\n\trc.tileSize = parameters.tileSize ? parameters.tileSize : 0;\n\trc.walkableSlopeAngle = parameters.walkableSlopeAngle;\n\trc.walkableHeight = parameters.walkableHeight;\n\trc.walkableClimb = parameters.walkableClimb;\n\trc.walkableRadius = parameters.walkableRadius;\n\trc.maxEdgeLen = parameters.maxEdgeLen;\n\trc.maxSimplificationError = parameters.maxSimplificationError;\n\trc.minRegionArea = parameters.minRegionArea;\n\trc.mergeRegionArea = parameters.mergeRegionArea;\n\trc.maxVertsPerPoly = parameters.maxVertsPerPoly;\n\trc.detailSampleDist = parameters.detailSampleDist;\n\trc.detailSampleMaxError = parameters.detailSampleMaxError;\n\n\tif (!self.navMesh) {\n\t\tself.navMesh = new module.NavMesh();\n\t}\n\tself.navMesh.build(positions, offset, indices, indicesLength, rc);\n\n\tconst navmeshData = navMesh.getNavmeshData();\n\tconst arrView = new Uint8Array(module.HEAPU8.buffer, navmeshData.dataPointer, navmeshData.size);\n\tconst ret = new Uint8Array(navmeshData.size);\n\tret.set(arrView);\n\tnavMesh.freeNavmeshData(navmeshData);\n\n\tpostMessage(ret);\n}\n"])),this._worker=new Worker(this._workerURL),this.whenWorkerReady=new Promise(t=>{this._worker.addEventListener("message",()=>t(),{once:!0})})}init(t,e,i){this.gameControl=e,this.eventContext=i,this.setDefaultQueryExtent((new C).setScalar(t.ch*t.walkableRadius*1.2)),this._worker.onmessage=()=>{this.createNavMesh(i.page,t,t=>{this.buildFromNavmeshData(t.data)})},this.eventContext.renderer.domElement.addEventListener("pointerdown",this.onPointerDown)}createNavMesh(t,e,i){e.objects.forEach(e=>{let i=t.scene.find(e);i.traverseEntity(t=>{t.userData.navmesh=!0}),i.cloner?.traverseObject(t=>{t.userData.navmesh=!0})});let o=[],s=(this.usePhysics?this.traverseWithPhysics:this.traverseNoPhysics)(o,"custom"===e.zones);if(t.traverseChildren(s),e.objects.forEach(e=>{let i=t.scene.find(e);i.traverseEntity(t=>{t.userData.navmesh=void 0}),i.cloner?.traverseObject(t=>{t.userData.navmesh=void 0})}),0===o.length)return!1;let n=g(o),{positions:r,triIndices:a}=u(n.getAttribute("position"),n.getIndex());return this._worker.postMessage([r,r.length/3,a,a.length,{...Ut,...e}]),this._worker.onmessage=i,!0}createDebugNavGeometry(){let t,e,i=this.navMesh.getDebugNavMesh(),o=i.getTriangleCount(),s=new Uint32Array(3*o),n=new Float32Array(3*o*3);for(t=0;t<3*o;t++)s[t]=t;for(t=0;t<o;t++)for(e=0;e<3;e++){let o=i.getTriangle(t).getPoint(e);n[9*t+3*e+0]=o.x,n[9*t+3*e+1]=o.y,n[9*t+3*e+2]=o.z}let r=new W;return r.setIndex(new _(s,1)),r.setAttribute("position",new _(n,3)),r}getClosestPoint(t){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,this.navMesh.getClosestPoint(Gt)}getClosestPointToRef(t,e){Gt.x=t.x,Gt.y=t.y,Gt.z=t.z;let i=this.navMesh.getClosestPoint(Gt);e.set(i.x,i.y,i.z)}getRandomPointAround(t,e){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,this.navMesh.getRandomPointAround(Gt,e)}getRandomPointAroundToRef(t,e,i){Gt.x=t.x,Gt.y=t.y,Gt.z=t.z;let o=this.navMesh.getRandomPointAround(Gt,e);i.set(o.x,o.y,o.z)}moveAlong(t,e){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,qt.x=e.x,qt.y=e.y,qt.z=e.z,this.navMesh.moveAlong(Gt,qt)}moveAlongToRef(t,e,i){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,qt.x=e.x,qt.y=e.y,qt.z=e.z,this.navMesh.moveAlong(Gt,qt)}computePath(t,e){let i=this.getClosestPoint(e);if(qt.x=i.x,qt.y=i.y,qt.z=i.z,Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)+Math.pow(e.z-i.z,2))>this.getDefaultQueryExtent().y)return[];this.getClosestPoint(t);let o=this.navMesh.computePath(Gt,qt),s=o.getPointCount(),n=[];for(let t=0;t<s;t++){let e=o.getPoint(t);n.push(new C(e.x,e.y,e.z))}return n}createCrowd(t,e){return new Jt(this,t,e)}setDefaultQueryExtent(t){Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,this.navMesh.setDefaultQueryExtent(Gt)}getDefaultQueryExtent(){return this.navMesh.getDefaultQueryExtent()}buildFromNavmeshData(t){let e=t.length*t.BYTES_PER_ELEMENT,i=this.navmeshWasm._malloc(e),o=new Uint8Array(this.navmeshWasm.HEAPU8.buffer,i,e);o.set(t);let s=new this.navmeshWasm.NavmeshData;s.dataPointer=o.byteOffset,s.size=t.length,this.navMesh.buildFromNavmeshData(s),this.navmeshWasm._free(o.byteOffset)}getNavmeshData(){let t=this.navMesh.getNavmeshData(),e=new Uint8Array(this.navmeshWasm.HEAPU8.buffer,t.dataPointer,t.size),i=new Uint8Array(t.size);return i.set(e),this.navMesh.freeNavmeshData(t),i}getDefaultQueryExtentToRef(t){let e=this.navMesh.getDefaultQueryExtent();t.set(e.x,e.y,e.z)}dispose(){this.navMesh.destroy(),this._worker.terminate(),URL.revokeObjectURL(this._workerURL),this.eventContext?.renderer.domElement.removeEventListener("pointerdown",this.onPointerDown)}addCylinderObstacle(t,e,i){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,this.navMesh.addCylinderObstacle(Gt,e,i)}addBoxObstacle(t,e,i){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,qt.x=e.x,qt.y=e.y,qt.z=e.z,this.navMesh.addBoxObstacle(Gt,qt,i)}removeObstacle(t){this.navMesh.removeObstacle(t)}isSupported(){return void 0!==this.navmeshWasm}},Jt=class{constructor(t,e,i){this.navmeshWasmWrapper=t,this.transforms=[],this.agents=new Array,this.reachRadii=new Array,this._agentDestinationArmed=new Array,this._agentDestination=new Array,this.crowd=new this.navmeshWasmWrapper.navmeshWasm.Crowd(e,i,this.navmeshWasmWrapper.navMesh.getNavMesh())}onReachTarget(t,e){}addAgent(t,e,i){let o=new this.navmeshWasmWrapper.navmeshWasm.dtCrowdAgentParams;o.radius=e.radius,o.height=e.height,o.maxAcceleration=e.maxAcceleration,o.maxSpeed=e.maxSpeed,o.collisionQueryRange=e.collisionQueryRange,o.pathOptimizationRange=e.pathOptimizationRange,o.separationWeight=e.separationWeight,o.updateFlags=7,o.obstacleAvoidanceType=0,o.queryFilterType=0,o.userData=0;let s=this.crowd.addAgent(new this.navmeshWasmWrapper.navmeshWasm.Vec3(t.x,t.y,t.z),o);return this.transforms.push(i),this.agents.push(s),this.reachRadii.push(e.reachRadius?e.reachRadius:e.radius),this._agentDestinationArmed.push(!1),this._agentDestination.push(new C(0,0,0)),s}getAgentPosition(t){return this.crowd.getAgentPosition(t)}getAgentPositionToRef(t,e){let i=this.crowd.getAgentPosition(t);e.set(i.x,i.y,i.z)}getAgentVelocity(t){return this.crowd.getAgentVelocity(t)}getAgentVelocityToRef(t,e){let i=this.crowd.getAgentVelocity(t);e.set(i.x,i.y,i.z)}getAgentNextTargetPath(t){return this.crowd.getAgentNextTargetPath(t)}getAgentNextTargetPathToRef(t,e){let i=this.crowd.getAgentNextTargetPath(t);e.set(i.x,i.y,i.z)}getAgentState(t){return this.crowd.getAgentState(t)}overOffmeshConnection(t){return this.crowd.overOffmeshConnection(t)}agentGoto(t,e){this.crowd.agentGoto(t,new this.navmeshWasmWrapper.navmeshWasm.Vec3(e.x,e.y,e.z));let i=this.agents.indexOf(t);i>-1&&(this._agentDestinationArmed[i]=!0,this._agentDestination[i].set(e.x,e.y,e.z))}agentTeleport(t,e){this.crowd.agentTeleport(t,new this.navmeshWasmWrapper.navmeshWasm.Vec3(e.x,e.y,e.z))}updateAgentParameters(t,e){let i=this.crowd.getAgentParameters(t);void 0!==e.radius&&(i.radius=e.radius),void 0!==e.height&&(i.height=e.height),void 0!==e.maxAcceleration&&(i.maxAcceleration=e.maxAcceleration),void 0!==e.maxSpeed&&(i.maxSpeed=e.maxSpeed),void 0!==e.collisionQueryRange&&(i.collisionQueryRange=e.collisionQueryRange),void 0!==e.pathOptimizationRange&&(i.pathOptimizationRange=e.pathOptimizationRange),void 0!==e.separationWeight&&(i.separationWeight=e.separationWeight),this.crowd.setAgentParameters(t,i)}removeAgent(t){this.crowd.removeAgent(t);let e=this.agents.indexOf(t);e>-1&&(this.agents.splice(e,1),this.transforms.splice(e,1),this.reachRadii.splice(e,1),this._agentDestinationArmed.splice(e,1),this._agentDestination.splice(e,1))}getAgents(){return this.agents}update(t){if(this.navmeshWasmWrapper.navMesh.update(),t<=.001)return;let e=1/60;{let i=Math.floor(t/e);i>10&&(i=10),i<1&&(i=1);let o=t/i;for(let t=0;t<i;t++)this.crowd.update(o)}for(let t=0;t<this.agents.length;t++){let e=this.agents[t],i=this.getAgentPosition(e);if(this.transforms[t].copy(i),this._agentDestinationArmed[t]){let o=i.x-this._agentDestination[t].x,s=i.z-this._agentDestination[t].z,n=this.reachRadii[t],r=this._agentDestination[t].y-this.reachRadii[t],a=this._agentDestination[t].y+this.reachRadii[t],h=o*o+s*s;i.y>r&&i.y<a&&h<n*n&&(this.onReachTarget(e,this._agentDestination[t]),this._agentDestinationArmed[t]=!1)}}}setDefaultQueryExtent(t){let e=new this.navmeshWasmWrapper.navmeshWasm.Vec3(t.x,t.y,t.z);this.crowd.setDefaultQueryExtent(e)}getDefaultQueryExtent(){return this.crowd.getDefaultQueryExtent()}getDefaultQueryExtentToRef(t){let e=this.crowd.getDefaultQueryExtent();t.set(e.x,e.y,e.z)}getCorners(t){let e,i=this.crowd.getCorners(t),o=i.getPointCount(),s=[];for(e=0;e<o;e++){let t=i.getPoint(e);s.push(new C(t.x,t.y,t.z))}return s}dispose(){this.crowd.destroy()}};i({setup:function(t){let{manager:e,camera:i}=t,o=!1,s=5,n=8,r=9,a="drag",h=e.page.data.publish.gameControlObject,c=null!==h?e.page.find(h):null,d=null;if(c)for(let t of c.data.events){if(t.data.disabled||"GameControl"!==t.data.type)continue;let i=c;for(;e.usePhysics&&null!==(i=i.parent)?.parent;)i.data.physics;t.data.collisionEnabled&&(e.needsCollisionDetection=!0),null===d&&(d=t.data)}if(c&&d&&(!0===c.data.visible||!0===c.data.physics.enabled)){o=o||d.camera===i.uuid||c.uuid===i.uuid;let h=new Yt(c,t.renderer.domElement,d,t.eventContext.page.data.globalPhysics,e,c.uuid!==i.uuid&&d.camera===i.uuid,i,e.page,t.sharedAssets);e.gameControl=h,s=d.joystickPosLoc,n=d.joystickRotLoc,r=d.jumpTouchButtonLoc,a=d.rotByTouch,l&&d.touchControl&&(e.joystickToGameControls[s]="pos","walk"===d.moveMode&&(e.joystickToGameControls[r]="jmp"),"joystick"===a&&(e.joystickToGameControls[n]="rot"))}if(e.gameControl&&e.gameControl.data.navmesh.enabled){let i=e.gameControl.data;if(!e.navigationMeshWrapper){let o;e.navigationMeshWrapper=new Kt(e.usePhysics,t.isExport),o="sphere"===i.collider.type?2*i.collider.radius:i.collider.height,o=Math.floor(o/i.navmesh.ch-1),e.navigationMeshWrapper.init({...i.navmesh,walkableHeight:o},e.gameControl,t.eventContext)}}return o},createJoysticks:function(t,e,i){t.joystickToGameControls.forEach((o,s)=>{let n=document.body.appendChild(document.createElement("div")),[r,a,h]=t.eventManager.eventContext.publish.joystickSizeAndXYOffset[s],l=(e-5*r)/4+r,c={},d="jmp"===o,m=d?0:r;s<10?(s<5?c.top=m/2:c.bottom=m/2,c.left=m/2+s%5*l):10===s?(c.left=m/2,c.top=i/2):(c.right=m/2,c.top=i/2),c.top?c.top-=a[1]:c.bottom+=a[1],c.left?c.left+=a[0]:c.right-=a[0];for(let t in c)c[t]+="px";if(d){let e=n.appendChild(document.createElement("div"));Object.assign(e.style,c,{position:"absolute",width:r+"px",height:r+"px",backgroundColor:`rgba(255,255,255,${"show"===h?.4:0})`,zIndex:"9999",borderRadius:r+"px",border:"show"===h?"solid 2px rgba(0, 0, 0, .1)":"none",display:"flex",alignItems:"center",justifyContent:"center",touchAction:"none"});let i=r/16*16*.4;return"show"===h&&(e.innerHTML=`\n\t\t\t\t\t\t<svg width="${i}" height="${.4*r}" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t<path d="M2 10L8 4L14 10" stroke="black" stroke-opacity="40%" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t`),e.addEventListener("pointerdown",()=>{t.gameControl.movementState.jump=1,t.requestRender()}),e.addEventListener("touchend",t=>t.preventDefault()),void(t.joysticks[s]=[void 0,n])}let p={zone:n,mode:"static",position:c,size:r};"hide"===h&&(p.restOpacity=0);let u=pt.create(p);u.on("move",(e,i)=>{let s=t.gameControl;"pos"===o?i.force<.2?s.moveForce=0:(s.movementState.movePosZ=Math.sin(-i.angle.radian),s.movementState.movePosX=Math.cos(-i.angle.radian),i.force>1.2?s.movementState.run=1:s.movementState.run=0,i.force<.3?s.moveForce=(i.force-.2)/.1:s.moveForce=1):"rot"===o&&(i.force<.2?s.rotForce=0:(s.movementState.rotPosX=i.vector.y,s.movementState.rotPosY=-i.vector.x,i.force<.3?s.rotForce=(i.force-.2)/.1:s.rotForce=1)),t.requestRender()}),u.on("end",(e,i)=>{let s=t.gameControl;"pos"===o?(s.movementState.movePosZ=0,s.movementState.movePosX=0,s.moveForce=1):"rot"===o&&(s.movementState.rotPosX=0,s.movementState.rotPosY=0,s.rotForce=1)}),t.joysticks[s]=[u,n]})}}),w("game-controls");
@@ -1 +0,0 @@
1
- �@�ø��\�C5�
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{k as m}from"./runtime-chunk-RCOXTVC5.js";import"./runtime-chunk-5RFUYVOU.js";import"./runtime-chunk-URQHWMRU.js";import"./runtime-chunk-LZMIX3RB.js";import"./runtime-chunk-HTHAK3HS.js";import"./runtime-chunk-NV5AZNLT.js";import"./runtime-chunk-2LQQPLUM.js";import"./runtime-chunk-RNV6FGEN.js";import"./runtime-chunk-35FH6BAP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-3ZEFAL7T.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-BPWKE4TV.js";import{a as n,f as r}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-NMRQ6IV4.js";import"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";r("ShapeBlendGeometry",(n,r,t)=>new m(n,r,t)),n("shape-blends");
@@ -1 +0,0 @@
1
- import{a as t}from"./runtime-chunk-URQHWMRU.js";import{a as e,b as r}from"./runtime-chunk-T53JMQSH.js";import{B as i,n}from"./runtime-chunk-35FH6BAP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-3ZEFAL7T.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-BPWKE4TV.js";import{a as s,f as a,h as o}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-NMRQ6IV4.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-BVVSZMXD.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,T=x[0];T&&2===e.horizontalAlign&&void 0!==T.leftSideBearing&&(c-=T.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");
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{i as t,k as i,l as e}from"./runtime-chunk-7WETLIII.js";import"./runtime-chunk-XG7TRRFP.js";import"./runtime-chunk-NTUTXO7Q.js";import{a as s,b as r,d as n}from"./runtime-chunk-NLZXZNT5.js";import"./runtime-chunk-HD7WF3XN.js";import{a}from"./runtime-chunk-GGSUJEGZ.js";import"./runtime-chunk-6OWJQ2IH.js";import"./runtime-chunk-FTVQTRM7.js";import{a as h}from"./runtime-chunk-DSYY4PII.js";import"./runtime-chunk-HTHAK3HS.js";import"./runtime-chunk-NV5AZNLT.js";import"./runtime-chunk-RNV6FGEN.js";import"./runtime-chunk-35FH6BAP.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as o,e as c}from"./runtime-chunk-UOHC2OET.js";import"./runtime-chunk-3ZEFAL7T.js";import"./runtime-chunk-RTLL6WIB.js";import{e as m}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-BPWKE4TV.js";import{a as d}from"./runtime-chunk-TZCHGFVF.js";import{p as u}from"./runtime-chunk-NMRQ6IV4.js";import{Bc as l,Cc as p}from"./runtime-chunk-BVVSZMXD.js";import"./runtime-chunk-ML3Z74BL.js";function A(t){let i=t.tweens[0]?.data;return{delay:i?.delay??t.delay,delayDirection:i?.delayDirection??"start-once",direction:i?.direction??t.direction,repeat:i?.repeat??t.repeat}}var g={state:null,duration:0,delay:0,delayDirection:"start-once",direction:"normal",repeat:0,easing:0},j=class extends l{constructor(t,i,e,s,r,n){if(super(),this.eventType=t,this.data=i,this.page=e,this.shared=s,this.condition=r,this.runModeOverride=n,this.tweens=[],this.hasPlayedOnce=!1,!i.object)throw new Error("Missing property");let a=this.page.scene.find(i.object)??this.page.uiCanvas?.find(i.object)??this.page.scene.find2DInUIObjects(i.object);if(!a)throw new Error("Missing property");if(!a.states)throw new Error("Missing property");if(this.object=a,i.tweens.length<2)throw new Error("Missing property");this.init()}get playing(){return!0===this.runner?.isPlaying}get animating(){return!0===this.runner?.isAnimating}get contested(){let t=this.object.previousAction;return null!==t&&t!==this&&t.animating}init(){this.initialCurrentState=i(this.object,this.object.currentState).id,this.build()}get runMode(){return void 0!==this.runModeOverride?this.runModeOverride:u(this.eventType)?this.data.runMode:"Repeat"}get currentState(){return"Toggle"===this.runMode?this.initialCurrentState:this.object.currentState}build(){let i=this.data.tweens,s=[];try{let t=i[0].data.state;void 0!==t&&s.push(new e(this.object,t,t,g,this.shared,this.data.allowSlerp??!1,this.page));for(let t=1;t<i.length;t++){let r=i[t-1],n=i[t];s.push(new e(this.object,void 0===r.data.state?this.currentState:r.data.state,void 0===n.data.state?this.currentState:n.data.state,n.data,this.shared,this.data.allowSlerp??!1,this.page))}}catch(t){return void(t instanceof Error&&console.error(t.message))}this.tweens=s,this.runner=new n({...t(A(this.data)),runMode:this.runMode},s.map(t=>t.runner),{claim:()=>this.claimObject(),assignCurrentState:()=>this.rebindTweens(),isOwner:()=>this.object.previousAction===this})}claimObject(){return this.object.previousAction!==this&&(!0===this.object.previousAction?.animating&&this.object.previousAction.pause(),this.object.previousAction=this,!0)}rebindTweens(){for(let t of this.tweens)try{t.rebind()}catch(t){t instanceof Error&&console.error(t.message)}this.object instanceof h&&this.object.wasMovedByUser&&(this.object.wasMovedByUser=!1)}update(t){this.runner?.update(t),!0!==this.runner?.isPlaying&&a.remove(this)}play(){if(!1===c(this.shared,this.condition)||"Once"===this.runMode&&this.hasPlayedOnce)return!1;this.hasPlayedOnce=!0,this.start()}start(){!this.runner||(this.runner.play(a.time),this.runner.isPlaying&&a.add(this))}pause(){this.runner?.stop(),a.remove(this)}stop(){this.pause();let t=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;m(this.object)?this.object.changeSelectedState(t,{shared:this.shared}):this.object.changeSelectedState(t,{scene:this.page.scene,shared:this.shared}),this.object.currentState=t}seek(t){if(!1===c(this.shared,this.condition))return!1;this.runner?.seek(t)}playDirected(t){if(!1===c(this.shared,this.condition))return!1;!this.runner||(this.runner.playDirected(a.time,t),this.runner.isPlaying&&a.add(this))}playFromCurrent(){this.playDirected(!0)}reverseFromCurrent(){this.playDirected(!1)}dispose(){this.pause()}},T=class extends l{constructor(t,i,e,r,n){super(),this.data=t,this.page=i,this.animationControls=e,this.shared=r,this.condition=n,this.startOnceDelay=0,this.toggleIsForward=!1;let a=t.object,h=i.scene.find(t.object);h&&Array.isArray(h.identity)&&(a=h.identity[0]),this.data={...t,object:a};let o=this.animationControls.clipIdToAction[t.clipId+"/"+a];if(this.duration=o?.getClip()?.duration??1,this.data.crop2){let t=s(o?.getClip());this.leftFrameTime=this.data.crop2[0]/(t-1)*this.duration,this.rightFrameTime=this.data.crop2[1]/(t-1)*this.duration}else{let t=o?.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===c(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,s])=>{let r=e.split("/")[1];this.threeAnimAction!==s&&r===i&&(t?s.fadeOut(.2):s.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=p.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===c(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,s])=>{let r=e.split("/")[1];this.threeAnimAction!==s&&r===t&&s.isRunning()&&(i?s.fadeOut(.2):s.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()}};r(e),o("Transition",({eventType:t,data:i,page:e,shared:s,actionCondition:r,runModeOverride:n})=>new j(t,i,e,s,r,n)),o("Animation",({data:t,page:i,eventManager:e,shared:s,actionCondition:r})=>new T(t,i,e.animationControls,s,r)),d("transitions");
Binary file
Binary file