@uptimizr/dashboard 0.4.7 → 1.0.0

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 (389) hide show
  1. package/out/404.html +1 -1
  2. package/out/__next.__PAGE__.txt +9 -9
  3. package/out/__next._full.txt +10 -10
  4. package/out/__next._tree.txt +1 -1
  5. package/out/_next/static/chunks/{209sxygecny37.js → 0-6mdj5wxsfid.js} +1 -1
  6. package/out/_next/static/chunks/{0ybs1u66q26su.js → 0-qthfqvm1jyj.js} +1 -1
  7. package/out/_next/static/chunks/01viyuclp2gm9.js +1 -0
  8. package/out/_next/static/chunks/02aym4t2hgo5c.js +1 -0
  9. package/out/_next/static/chunks/02ic9b5ejugow.js +1 -0
  10. package/out/_next/static/chunks/03p70i4c7qt0v.js +1 -0
  11. package/out/_next/static/chunks/{33i36o_l69sm5.js → 03pjr-ivdicng.js} +1 -1
  12. package/out/_next/static/chunks/041a06-lxipy5.js +1 -0
  13. package/out/_next/static/chunks/{1zm6eo861i3c8.js → 06dzkwetqis-5.js} +1 -1
  14. package/out/_next/static/chunks/{3ipx7xbxchsq9.js → 06kvanz5-fo52.js} +1 -1
  15. package/out/_next/static/chunks/07y8ke_iy59dn.js +1 -0
  16. package/out/_next/static/chunks/09jukc-4jl735.js +1 -0
  17. package/out/_next/static/chunks/{35sne1llxnc-m.js → 09khmdgez3t0a.js} +18 -18
  18. package/out/_next/static/chunks/{02qk_wmkf9at-.js → 0_dca4876jshu.js} +38 -38
  19. package/out/_next/static/chunks/0axcgnl5qzr6e.js +1 -0
  20. package/out/_next/static/chunks/0ay4fjomijs3n.js +1 -0
  21. package/out/_next/static/chunks/0c7fy79wlccat.js +1 -0
  22. package/out/_next/static/chunks/0cqe4-l3imct3.js +1 -0
  23. package/out/_next/static/chunks/0cssvelju788j.js +1 -0
  24. package/out/_next/static/chunks/{0-_j1khfoib6l.js → 0ctain5xq2wsd.js} +12 -12
  25. package/out/_next/static/chunks/{22yqh0zlo_vwr.js → 0df-dr3otg_4w.js} +1 -1
  26. package/out/_next/static/chunks/{26y9sv8_-ykxf.js → 0endw997j7ao9.js} +1 -1
  27. package/out/_next/static/chunks/0ev_pbit1v_qg.js +1 -0
  28. package/out/_next/static/chunks/0eyw9oiwipywb.js +1 -0
  29. package/out/_next/static/chunks/0fkzbuo1tex4u.js +1 -0
  30. package/out/_next/static/chunks/0govas0u0t4w3.js +1 -0
  31. package/out/_next/static/chunks/{0grasqqf5dw7r.js → 0guzhnususp3-.js} +2 -2
  32. package/out/_next/static/chunks/0h7bq_ysu17q7.js +3 -0
  33. package/out/_next/static/chunks/0hneh_3xzlo28.js +1 -0
  34. package/out/_next/static/chunks/0iaqwme19z_0s.js +1 -0
  35. package/out/_next/static/chunks/0ibmar10xndpn.js +1 -0
  36. package/out/_next/static/chunks/0ii8mqoteppgh.js +11 -0
  37. package/out/_next/static/chunks/{1uh9zgsy69g92.js → 0ip6v64di_l6x.js} +1 -1
  38. package/out/_next/static/chunks/{267prao6fyt22.js → 0ixymgjgz3grn.js} +10 -10
  39. package/out/_next/static/chunks/0kuah8g7lt5ox.js +1 -0
  40. package/out/_next/static/chunks/0l3k4j19vxm17.js +1 -0
  41. package/out/_next/static/chunks/0l6hg0ohwh9-m.js +1 -0
  42. package/out/_next/static/chunks/0m4um4ylhlfan.js +1 -0
  43. package/out/_next/static/chunks/0mj837d4h0ddq.js +1 -0
  44. package/out/_next/static/chunks/0nyn-f4905o91.js +1 -0
  45. package/out/_next/static/chunks/0og6i9rsgkuif.js +1 -0
  46. package/out/_next/static/chunks/0os1x-fxzgnxs.js +1 -0
  47. package/out/_next/static/chunks/0otnra7mp0hog.js +1 -0
  48. package/out/_next/static/chunks/{1gttu-n9am66k.js → 0oyf2xzv8ofkk.js} +21 -21
  49. package/out/_next/static/chunks/0qvsy3gcqjm12.js +1 -0
  50. package/out/_next/static/chunks/{1qg1l7t00nyib.js → 0rl4ddh2vgxyl.js} +14 -14
  51. package/out/_next/static/chunks/0rwpttmsmqvn_.js +1 -0
  52. package/out/_next/static/chunks/0so3wjp9ch93y.js +1 -0
  53. package/out/_next/static/chunks/{43fp64xnfy646.js → 0te4g160_rb5d.js} +1 -1
  54. package/out/_next/static/chunks/0uby-zvu799ef.js +1 -0
  55. package/out/_next/static/chunks/{3h6akt2uu05ku.js → 0uvn0op2mlr2u.js} +12 -12
  56. package/out/_next/static/chunks/0vwj4hxjm0igv.js +1 -0
  57. package/out/_next/static/chunks/{1m9zc5gm-327d.js → 0w7c30w07uct2.js} +10 -10
  58. package/out/_next/static/chunks/0wm38z3u2133a.js +1 -0
  59. package/out/_next/static/chunks/0y7yk5al7_p8q.js +4 -0
  60. package/out/_next/static/chunks/0ywvahq9t0tki.js +1 -0
  61. package/out/_next/static/chunks/0zh6nslagkby-.js +1 -0
  62. package/out/_next/static/chunks/{3vbamaoiuk9yj.js → 0zo8xa0nej3ex.js} +1 -1
  63. package/out/_next/static/chunks/{2of8q0kaeqpf0.js → 0zsir95gpf3xw.js} +1 -1
  64. package/out/_next/static/chunks/0zu6ryyj0ig-j.js +3 -0
  65. package/out/_next/static/chunks/{2c721vfva711t.js → 1-jv8k10q_1uw.js} +1 -1
  66. package/out/_next/static/chunks/1-s5ioie9a94e.js +1 -0
  67. package/out/_next/static/chunks/{13zcn4lv0qj76.js → 1-yos1h0qws5e.js} +11 -11
  68. package/out/_next/static/chunks/10o7brc3x027r.js +1 -0
  69. package/out/_next/static/chunks/{060iult6f68_e.js → 10pae4gb9i929.js} +29 -29
  70. package/out/_next/static/chunks/13p93itm8a3ym.js +1 -0
  71. package/out/_next/static/chunks/{0btmk0wmekl02.js → 147s8i_lktp4_.js} +2 -2
  72. package/out/_next/static/chunks/{3njwfothmmg7u.js → 14tgo5xt_3j4w.js} +1 -1
  73. package/out/_next/static/chunks/1699hx-vlak0n.js +22 -0
  74. package/out/_next/static/chunks/16d6n9e77rqti.js +1 -0
  75. package/out/_next/static/chunks/{3zs7l4362msjd.js → 16f3d5dv83rsr.js} +1 -1
  76. package/out/_next/static/chunks/16i_tpwn_cmr-.js +1 -0
  77. package/out/_next/static/chunks/{1by60_b14x-3o.js → 16rfr165nbha0.js} +1 -1
  78. package/out/_next/static/chunks/{0zqgq0lwtz9tn.js → 16sl51pvzo4tf.js} +1 -1
  79. package/out/_next/static/chunks/{2n-pveub8b_5t.js → 1760s-32qpwgg.js} +1 -1
  80. package/out/_next/static/chunks/{1u8snlm6a7uhi.js → 18kq07c5xy_4g.js} +4 -4
  81. package/out/_next/static/chunks/{1rcdimhu0qhlu.js → 190tbzt861ao3.js} +39 -39
  82. package/out/_next/static/chunks/19bhv6cupnnyj.js +1 -0
  83. package/out/_next/static/chunks/1_14pn2wwebxy.js +1 -0
  84. package/out/_next/static/chunks/{3huu0tqmxwowu.js → 1_kikmeubh0wq.js} +30 -30
  85. package/out/_next/static/chunks/1ay3z6agelsvz.js +1 -0
  86. package/out/_next/static/chunks/1b-fi3bfmpe31.js +1 -0
  87. package/out/_next/static/chunks/1bae3tqv53x9_.js +1 -0
  88. package/out/_next/static/chunks/1bf421g4peccx.js +2 -0
  89. package/out/_next/static/chunks/1bfony5qsc5tp.js +1 -0
  90. package/out/_next/static/chunks/{1e8_jl2cxd3rp.js → 1ddt0ot7kl8vq.js} +40 -40
  91. package/out/_next/static/chunks/1emz2vjkgck4z.js +1 -0
  92. package/out/_next/static/chunks/1eogzzw8i1wsg.js +1 -0
  93. package/out/_next/static/chunks/{2apihn9ra2ufp.js → 1g9p2h1-31q8o.js} +1 -1
  94. package/out/_next/static/chunks/1gcz1k1v1woca.js +1 -0
  95. package/out/_next/static/chunks/{3v-0c2aj6c0on.js → 1h8lyicgqhpxa.js} +1 -1
  96. package/out/_next/static/chunks/{3772oce1n3t_g.js → 1hot663akaepl.js} +1 -1
  97. package/out/_next/static/chunks/1i7pgl3ks5ye0.js +1 -0
  98. package/out/_next/static/chunks/{2sys9nj8lo3uk.js → 1i8sk_qgpdjhs.js} +1 -1
  99. package/out/_next/static/chunks/1k8erl2uygr8g.js +1 -0
  100. package/out/_next/static/chunks/{30bhz7czzs4mf.js → 1kk3ct7pkpf3b.js} +1 -1
  101. package/out/_next/static/chunks/{33hp-khdfohdq.js → 1kq9o8del67le.js} +1 -1
  102. package/out/_next/static/chunks/{3d-i_skta_wes.js → 1l7tzyx2mumlq.js} +1 -1
  103. package/out/_next/static/chunks/1n_uwed9o--go.js +1 -0
  104. package/out/_next/static/chunks/1o351eldttogn.js +1 -0
  105. package/out/_next/static/chunks/1ogs4_aj84bfn.js +1 -0
  106. package/out/_next/static/chunks/{0sw-8gxbg4x0l.js → 1p206txlluipi.js} +18 -18
  107. package/out/_next/static/chunks/1p2bt1w845v6c.js +1 -0
  108. package/out/_next/static/chunks/1p3rgz4aef1gk.js +1 -0
  109. package/out/_next/static/chunks/{41b5gpyqbj58m.js → 1qcgdx9yl0gfx.js} +4 -4
  110. package/out/_next/static/chunks/1ql3mm2w5r-m8.js +1 -0
  111. package/out/_next/static/chunks/1qvcyuyshi3ll.js +53 -0
  112. package/out/_next/static/chunks/1r0yyg5a_0knc.js +1 -0
  113. package/out/_next/static/chunks/{15o4_2t-l3rj5.js → 1sa6qiidtcyk2.js} +1 -1
  114. package/out/_next/static/chunks/1t-9vrdrsi8le.js +1 -0
  115. package/out/_next/static/chunks/{1rlfg62jxqj3z.js → 1t97zo0tlpbnz.js} +1 -1
  116. package/out/_next/static/chunks/1te2tinzqnwck.js +1 -0
  117. package/out/_next/static/chunks/{3sa_hlx3konc7.js → 1trt-m2nrck0v.js} +1 -1
  118. package/out/_next/static/chunks/1ty9jpwr3o_st.js +1 -0
  119. package/out/_next/static/chunks/1u6w6veke8rze.js +1 -0
  120. package/out/_next/static/chunks/1u900urmrbv73.js +1 -0
  121. package/out/_next/static/chunks/{3_dgblylldcgb.js → 1vz2gd8k74lpi.js} +1 -1
  122. package/out/_next/static/chunks/1wkpl9bfb0wn7.js +1 -0
  123. package/out/_next/static/chunks/1wrly9a9c3teq.js +1 -0
  124. package/out/_next/static/chunks/1x0m05155yy4e.js +1 -0
  125. package/out/_next/static/chunks/{3xl-op0hwxytg.js → 1xf1wfow43ekc.js} +5 -5
  126. package/out/_next/static/chunks/1y10o40v9odam.js +1 -0
  127. package/out/_next/static/chunks/{2s6kpclh6ie7o.js → 1y_zykt3fpen4.js} +29 -29
  128. package/out/_next/static/chunks/1ye6xtbm16pg4.js +1 -0
  129. package/out/_next/static/chunks/{1t5oynmttpfsw.js → 1z6_57k5h31u7.js} +1 -1
  130. package/out/_next/static/chunks/{0lep3_bqwfuin.js → 1zboqft0h6mop.js} +1 -1
  131. package/out/_next/static/chunks/{43v4y2gu5z9_h.js → 1zr3c351x0ri5.js} +1 -1
  132. package/out/_next/static/chunks/2-5p2lcedvrli.js +1 -0
  133. package/out/_next/static/chunks/206hxrq60f1_e.js +1 -0
  134. package/out/_next/static/chunks/20r05k3-studj.js +1 -0
  135. package/out/_next/static/chunks/221j_mhvdpitn.js +1 -0
  136. package/out/_next/static/chunks/22gs24kj2du56.js +1 -0
  137. package/out/_next/static/chunks/22x5pd1gyp7sf.js +1 -0
  138. package/out/_next/static/chunks/{2a07so920b6aa.js → 22z-2t_yp1jzs.js} +1 -1
  139. package/out/_next/static/chunks/{30n4y_uu8chbh.js → 23hmfdw6z5zfy.js} +30 -30
  140. package/out/_next/static/chunks/23y1krqnc-8sm.js +1 -0
  141. package/out/_next/static/chunks/{3f8qelpscqfym.js → 24tbkj1qkux88.js} +2 -2
  142. package/out/_next/static/chunks/{2ao-3jzz7yw3p.js → 26cmri51v7497.js} +11 -11
  143. package/out/_next/static/chunks/27jalbk9zu-2b.js +1 -0
  144. package/out/_next/static/chunks/285d2s9096ryc.js +1 -0
  145. package/out/_next/static/chunks/296ykep2nvppv.js +1 -0
  146. package/out/_next/static/chunks/29nehg5cal-ug.js +1 -0
  147. package/out/_next/static/chunks/2_a56_k3x7to6.js +1 -0
  148. package/out/_next/static/chunks/2a-0l6eb1blh3.js +4 -0
  149. package/out/_next/static/chunks/{3qn6r8-0u6dij.js → 2a31-txop1jzg.js} +38 -38
  150. package/out/_next/static/chunks/2aanowvpmkmvj.js +1 -0
  151. package/out/_next/static/chunks/2bse5vll1o-x0.js +1 -0
  152. package/out/_next/static/chunks/2ct40spu9wfj7.js +1 -0
  153. package/out/_next/static/chunks/{2kok6zedeeltw.js → 2ept01b7t-e03.js} +1 -1
  154. package/out/_next/static/chunks/{3w59kt5ztyvoq.js → 2ey5dqelco_g5.js} +1 -1
  155. package/out/_next/static/chunks/2fd_009hw7y0m.js +1 -0
  156. package/out/_next/static/chunks/{0fd-0i1yt23kz.js → 2ftz9kaxrsgxh.js} +1 -1
  157. package/out/_next/static/chunks/2gefdnozflr7p.js +1 -0
  158. package/out/_next/static/chunks/{2izok2otbk8-2.js → 2gs-u1n5uv7iz.js} +37 -37
  159. package/out/_next/static/chunks/{2r96kyeehsji9.js → 2hizqql79u-54.js} +1 -1
  160. package/out/_next/static/chunks/2iqf2dpdg_vfl.js +1 -0
  161. package/out/_next/static/chunks/2j7z127s_ycjd.js +1 -0
  162. package/out/_next/static/chunks/2kax7uslfxdnx.js +31 -0
  163. package/out/_next/static/chunks/2lh_w9rzy3vek.js +1 -0
  164. package/out/_next/static/chunks/{0rracz73p38mo.js → 2ln1na26qwp-3.js} +9 -9
  165. package/out/_next/static/chunks/2n08l1q5o_27e.js +1 -0
  166. package/out/_next/static/chunks/2n7268gyd9z-6.js +1 -0
  167. package/out/_next/static/chunks/2nq9cgjmtqwvp.js +1 -0
  168. package/out/_next/static/chunks/{005bbq_px7lke.js → 2oj8qc_pv14nk.js} +2 -2
  169. package/out/_next/static/chunks/2q24e72-olbe8.js +1 -0
  170. package/out/_next/static/chunks/2qc4hscs26cro.js +1 -0
  171. package/out/_next/static/chunks/{0gf-ztg86zd80.js → 2qe46redkqhfg.js} +1 -1
  172. package/out/_next/static/chunks/2qtc0nbl_521e.js +1 -0
  173. package/out/_next/static/chunks/{0e1jfrmioeuws.js → 2rofu6gu1xzuq.js} +1 -1
  174. package/out/_next/static/chunks/2tdi94rkq739i.js +1 -0
  175. package/out/_next/static/chunks/2u_2sacqa9xa7.js +1 -0
  176. package/out/_next/static/chunks/2ujqz6088shm5.js +1 -0
  177. package/out/_next/static/chunks/{1l_3oidssbhns.js → 2urh9qafp3fiw.js} +17 -17
  178. package/out/_next/static/chunks/{05v-nubi896jg.js → 2v06n4z8wsmn9.js} +1 -1
  179. package/out/_next/static/chunks/2vp-5skbk1nfu.js +1 -0
  180. package/out/_next/static/chunks/2vu973j_n6cpx.js +1 -0
  181. package/out/_next/static/chunks/{37cnbm5ft1mqf.js → 2wwra56rehfcj.js} +1 -1
  182. package/out/_next/static/chunks/2xpwr97h2asal.js +1 -0
  183. package/out/_next/static/chunks/3000-0b8n9t_2.js +1 -0
  184. package/out/_next/static/chunks/30t3203d7p2da.js +1 -0
  185. package/out/_next/static/chunks/31kto7-dxkt3z.js +1 -0
  186. package/out/_next/static/chunks/{2lsvk7xcfkarc.js → 32oflcl79d8mu.js} +1 -1
  187. package/out/_next/static/chunks/32ovg81ae0l03.js +1 -0
  188. package/out/_next/static/chunks/{0z9erbl3llr_b.js → 331kthnvoma7n.js} +16 -16
  189. package/out/_next/static/chunks/{0q75860p8u_ii.js → 337kn1mn34rc6.js} +1 -1
  190. package/out/_next/static/chunks/{2tc3e-iqv71y_.js → 33xug8kf0-a1o.js} +1 -1
  191. package/out/_next/static/chunks/{1-ogak5u00kwa.js → 34dcb7_flbrvo.js} +1 -1
  192. package/out/_next/static/chunks/34g070edw165e.js +3 -0
  193. package/out/_next/static/chunks/34zotyeqrz_nq.js +1 -0
  194. package/out/_next/static/chunks/351wsmi75l8db.js +1 -0
  195. package/out/_next/static/chunks/{15jlgfcaeaki9.js → 36yv-ialtpx98.js} +1 -1
  196. package/out/_next/static/chunks/37hwasxtee5e0.js +1 -0
  197. package/out/_next/static/chunks/37t0iclgxes05.js +1 -0
  198. package/out/_next/static/chunks/{1q4lkgxfnqnew.js → 37xnvnx1jxfaf.js} +1 -1
  199. package/out/_next/static/chunks/{2z_iab7ozohhq.js → 38w74ixqt-9co.js} +16 -16
  200. package/out/_next/static/chunks/{2h249uvhh2sij.js → 39t2x_9zd2rst.js} +10 -10
  201. package/out/_next/static/chunks/{2n3xu_wbvtj7h.js → 3_xqc3658d8sw.js} +12 -12
  202. package/out/_next/static/chunks/3ba8eudvlczwe.js +1 -0
  203. package/out/_next/static/chunks/{2q6l-xdqzgmpf.js → 3buezhxqc8n6n.js} +1 -1
  204. package/out/_next/static/chunks/{1zt1xxovnjhkm.js → 3c5iwwj-fhbue.js} +1 -1
  205. package/out/_next/static/chunks/{2urx6fow8c8c9.js → 3d8ot2tw6yqfq.js} +12 -12
  206. package/out/_next/static/chunks/3dc057ffe7ij-.js +1 -0
  207. package/out/_next/static/chunks/3djnlzwj9869o.js +1 -0
  208. package/out/_next/static/chunks/{2y8i7_nxm4r05.js → 3fuqxjjf8o1v9.js} +5 -5
  209. package/out/_next/static/chunks/{0z004fn14pbcu.js → 3gt6rzg9qw-an.js} +1 -1
  210. package/out/_next/static/chunks/{1tgj55b305g4h.js → 3h_05w5j8x538.js} +1 -1
  211. package/out/_next/static/chunks/{3j9xvdz55bi4p.js → 3hkhd1_k8xohv.js} +33 -33
  212. package/out/_next/static/chunks/{42ymanq326mo7.js → 3ijcc5tfisfnj.js} +1 -1
  213. package/out/_next/static/chunks/3j0dbpd9zop3p.js +1 -0
  214. package/out/_next/static/chunks/{1zkd8v-qka--j.js → 3ju83xk-ca7ma.js} +21 -21
  215. package/out/_next/static/chunks/3jxhl4apmhbm1.js +13 -0
  216. package/out/_next/static/chunks/{302qk2fjdrthp.js → 3la99oz_0p0r6.js} +5 -5
  217. package/out/_next/static/chunks/3n1b34fd5fdrh.js +1 -0
  218. package/out/_next/static/chunks/{2j120dkh7q3uf.js → 3nq_hq4x3rn3r.js} +1 -1
  219. package/out/_next/static/chunks/3pgb1kkqrdl9t.js +1 -0
  220. package/out/_next/static/chunks/3pik_-jj-zkfl.js +1 -0
  221. package/out/_next/static/chunks/{2w99knknr5i8c.js → 3q38kdbzd2nbd.js} +1 -1
  222. package/out/_next/static/chunks/3q5zl4ks17au2.js +1 -0
  223. package/out/_next/static/chunks/{2uo6vm7mfgrbf.js → 3qr10445lte-n.js} +1 -1
  224. package/out/_next/static/chunks/3r-8bnguvxsyo.js +1 -0
  225. package/out/_next/static/chunks/3sg56j8boe-3o.js +1 -0
  226. package/out/_next/static/chunks/{2q8yg63br2jc9.js → 3u7zj1-jdg781.js} +1 -1
  227. package/out/_next/static/chunks/{32_c4mbb6j1l6.js → 3wj5dmf6cywz8.js} +22 -22
  228. package/out/_next/static/chunks/{3oqxl46ukaojj.js → 3wr_oijfsq8lr.js} +11 -11
  229. package/out/_next/static/chunks/3xu0dh1ikzwj2.js +1 -0
  230. package/out/_next/static/chunks/3y5tpixt23-fl.js +1 -0
  231. package/out/_next/static/chunks/40gjf-_jt8upu.js +5 -0
  232. package/out/_next/static/chunks/41f12o_5lf-i9.js +1 -0
  233. package/out/_next/static/chunks/42ma8lqduohlc.js +1 -0
  234. package/out/_next/static/chunks/{0ai0zgbgjqb92.js → 43usshq2nc125.js} +1 -1
  235. package/out/_next/static/chunks/{0hajwk2yd-rwr.js → 44bl4ufopbmyh.js} +1 -1
  236. package/out/_next/static/chunks/44iutzkw9r21x.js +1 -0
  237. package/out/_next/static/chunks/turbopack-1xrxa3noq196-.js +1 -0
  238. package/out/_not-found/__next._full.txt +8 -8
  239. package/out/_not-found/__next._not-found.__PAGE__.txt +7 -7
  240. package/out/_not-found/__next._tree.txt +1 -1
  241. package/out/_not-found.html +1 -1
  242. package/out/_not-found.txt +8 -8
  243. package/out/index.html +1 -1
  244. package/out/index.txt +10 -10
  245. package/package.json +10 -10
  246. package/out/_next/static/chunks/00fbhtmui-yxg.js +0 -1
  247. package/out/_next/static/chunks/017pn-pen381_.js +0 -1
  248. package/out/_next/static/chunks/01vov6inx1zzt.js +0 -1
  249. package/out/_next/static/chunks/03bd5plut08tg.js +0 -1
  250. package/out/_next/static/chunks/03dwfqmo73w_z.js +0 -1
  251. package/out/_next/static/chunks/03sn4419dam-h.js +0 -5
  252. package/out/_next/static/chunks/05ere0-228syf.js +0 -1
  253. package/out/_next/static/chunks/05h8u5lrypn5m.js +0 -1
  254. package/out/_next/static/chunks/05z79zh625ezu.js +0 -1
  255. package/out/_next/static/chunks/08lvtnv7b1cxp.js +0 -1
  256. package/out/_next/static/chunks/0_v2luu_qmeid.js +0 -1
  257. package/out/_next/static/chunks/0boov9mwycanf.js +0 -1
  258. package/out/_next/static/chunks/0d8x8m2x6ca_m.js +0 -1
  259. package/out/_next/static/chunks/0dmrdrwtd093b.js +0 -1
  260. package/out/_next/static/chunks/0e7nlxmneb2j_.js +0 -1
  261. package/out/_next/static/chunks/0es97pusfxupl.js +0 -1
  262. package/out/_next/static/chunks/0fxdyvb1w23d1.js +0 -1
  263. package/out/_next/static/chunks/0fxhc24djjcgq.js +0 -1
  264. package/out/_next/static/chunks/0hk1wg7h4araz.js +0 -1
  265. package/out/_next/static/chunks/0j74ipw4fps-n.js +0 -1
  266. package/out/_next/static/chunks/0kj-vckdn7t5p.js +0 -1
  267. package/out/_next/static/chunks/0lbs5xdyjuzuo.js +0 -1
  268. package/out/_next/static/chunks/0mp0jh1gj7290.js +0 -1
  269. package/out/_next/static/chunks/0ngpoj2g5i4kz.js +0 -1
  270. package/out/_next/static/chunks/0nhljhguceh66.js +0 -1
  271. package/out/_next/static/chunks/0p6z73afb9dj2.js +0 -1
  272. package/out/_next/static/chunks/0p9zfmidzqkps.js +0 -1
  273. package/out/_next/static/chunks/0sx-6rf3eteqn.js +0 -1
  274. package/out/_next/static/chunks/0thw099xk3_0p.js +0 -3
  275. package/out/_next/static/chunks/0u85f0dhb4i8e.js +0 -1
  276. package/out/_next/static/chunks/0uk7kigzm4vi2.js +0 -31
  277. package/out/_next/static/chunks/0ulufxnsrou61.js +0 -1
  278. package/out/_next/static/chunks/0xa9dyg6ezzyd.js +0 -2
  279. package/out/_next/static/chunks/0xvrfvur0p534.js +0 -1
  280. package/out/_next/static/chunks/0ydfhk-p6zvm0.js +0 -1
  281. package/out/_next/static/chunks/0zcsxvcvog9ue.js +0 -1
  282. package/out/_next/static/chunks/10_5p5-xf2aoo.js +0 -1
  283. package/out/_next/static/chunks/118qlrzdwpfmo.js +0 -1
  284. package/out/_next/static/chunks/11km5p4gd0ut4.js +0 -1
  285. package/out/_next/static/chunks/120rl4l29q9xs.js +0 -1
  286. package/out/_next/static/chunks/129m5i93ltoym.js +0 -1
  287. package/out/_next/static/chunks/12n73o884lyyl.js +0 -1
  288. package/out/_next/static/chunks/133glnfos64oo.js +0 -1
  289. package/out/_next/static/chunks/175st2ogkg_1o.js +0 -1
  290. package/out/_next/static/chunks/19rsodtu91ja_.js +0 -1
  291. package/out/_next/static/chunks/1a2ouhup611bz.js +0 -1
  292. package/out/_next/static/chunks/1cyq7i39885sl.js +0 -1
  293. package/out/_next/static/chunks/1d9it6yocgt54.js +0 -1
  294. package/out/_next/static/chunks/1dp1s1t-y7gal.js +0 -1
  295. package/out/_next/static/chunks/1dr7gh6xgypl8.js +0 -1
  296. package/out/_next/static/chunks/1dt30s_sp8415.js +0 -1
  297. package/out/_next/static/chunks/1f1rek_fxk3of.js +0 -1
  298. package/out/_next/static/chunks/1f2mna0k5efeq.js +0 -1
  299. package/out/_next/static/chunks/1gfz3sxwkkg3d.js +0 -1
  300. package/out/_next/static/chunks/1gr35qeguuws0.js +0 -1
  301. package/out/_next/static/chunks/1imi0xwi9hd99.js +0 -1
  302. package/out/_next/static/chunks/1ka5v5zu0cstt.js +0 -1
  303. package/out/_next/static/chunks/1n9nhz-6azcp3.js +0 -3
  304. package/out/_next/static/chunks/1ncqwe81t_9_x.js +0 -1
  305. package/out/_next/static/chunks/1nix_lulkpklo.js +0 -1
  306. package/out/_next/static/chunks/1ntqovuz2c217.js +0 -1
  307. package/out/_next/static/chunks/1pgs-98tfkq9_.js +0 -1
  308. package/out/_next/static/chunks/1q2z0aeopo8t8.js +0 -1
  309. package/out/_next/static/chunks/1ses023uud001.js +0 -1
  310. package/out/_next/static/chunks/1t9i20i5-f8ze.js +0 -1
  311. package/out/_next/static/chunks/1ug4k-1zhr63a.js +0 -1
  312. package/out/_next/static/chunks/1vrpzlif-z_p0.js +0 -1
  313. package/out/_next/static/chunks/1vurgl6oz2qey.js +0 -17
  314. package/out/_next/static/chunks/1w-qc09n9ijtq.js +0 -1
  315. package/out/_next/static/chunks/1ycqxcht6x54p.js +0 -1
  316. package/out/_next/static/chunks/1zj4307ugq0qz.js +0 -1
  317. package/out/_next/static/chunks/1zm52cjrfrq7c.js +0 -1
  318. package/out/_next/static/chunks/1zp9363yfhpom.js +0 -1
  319. package/out/_next/static/chunks/2-3hk_db5fpok.js +0 -1
  320. package/out/_next/static/chunks/2-bv9a_0zgw1f.js +0 -1
  321. package/out/_next/static/chunks/216uiih3_vdfd.js +0 -1
  322. package/out/_next/static/chunks/21kfpd_bityxt.js +0 -1
  323. package/out/_next/static/chunks/24ecas0m9tao7.js +0 -3
  324. package/out/_next/static/chunks/24pq9210rng3f.js +0 -1
  325. package/out/_next/static/chunks/26skkagvj1z96.js +0 -1
  326. package/out/_next/static/chunks/2701xfv_07wz_.js +0 -1
  327. package/out/_next/static/chunks/271333m8y3k0e.js +0 -1
  328. package/out/_next/static/chunks/29rkmguzky-bp.js +0 -1
  329. package/out/_next/static/chunks/2a2oy8ryz2tsk.js +0 -1
  330. package/out/_next/static/chunks/2apnpj0-fs9ks.js +0 -1
  331. package/out/_next/static/chunks/2b481pitl4k85.js +0 -1
  332. package/out/_next/static/chunks/2bettxaqt3d2p.js +0 -1
  333. package/out/_next/static/chunks/2d2kl_m64j9cb.js +0 -1
  334. package/out/_next/static/chunks/2droqjmvmgj13.js +0 -1
  335. package/out/_next/static/chunks/2dxbvwbbgpzoq.js +0 -1
  336. package/out/_next/static/chunks/2eqbsut829r5l.js +0 -1
  337. package/out/_next/static/chunks/2f3_mzxjh3gso.js +0 -1
  338. package/out/_next/static/chunks/2fsde0jwi5qtt.js +0 -1
  339. package/out/_next/static/chunks/2j2ynchpqh34-.js +0 -1
  340. package/out/_next/static/chunks/2kj6pzs_wap1v.js +0 -1
  341. package/out/_next/static/chunks/2lnj9jruy4nrv.js +0 -1
  342. package/out/_next/static/chunks/2ofwtw6p08sfz.js +0 -1
  343. package/out/_next/static/chunks/2phl5ta4iim7l.js +0 -12
  344. package/out/_next/static/chunks/2r5qgieqldcd9.js +0 -1
  345. package/out/_next/static/chunks/2r7y401cvjc1s.js +0 -1
  346. package/out/_next/static/chunks/2rmc6ru7mc-kg.js +0 -1
  347. package/out/_next/static/chunks/2w2k1gveljyb7.js +0 -1
  348. package/out/_next/static/chunks/2w_ptlw-ad8-9.js +0 -4
  349. package/out/_next/static/chunks/2ws1s9d52ayv8.js +0 -1
  350. package/out/_next/static/chunks/2x7enks3ydgai.js +0 -1
  351. package/out/_next/static/chunks/2ydub0t01728d.js +0 -1
  352. package/out/_next/static/chunks/3-m_vzabs1uez.js +0 -1
  353. package/out/_next/static/chunks/3527r3jo5fj3i.js +0 -1
  354. package/out/_next/static/chunks/355dg8yaa94hr.js +0 -1
  355. package/out/_next/static/chunks/35ntbr_c-yx44.js +0 -1
  356. package/out/_next/static/chunks/36enkx1skkv2-.js +0 -4
  357. package/out/_next/static/chunks/38xdo3cifphut.js +0 -1
  358. package/out/_next/static/chunks/3beawo-qwuk8k.js +0 -1
  359. package/out/_next/static/chunks/3cj_6sl9kr3e9.js +0 -1
  360. package/out/_next/static/chunks/3df_l2we755bb.js +0 -1
  361. package/out/_next/static/chunks/3eve5y7fpzx2h.js +0 -1
  362. package/out/_next/static/chunks/3ewgyb4y19w-3.js +0 -1
  363. package/out/_next/static/chunks/3f3789eh18_oy.js +0 -1
  364. package/out/_next/static/chunks/3g3-e9m1en45q.js +0 -1
  365. package/out/_next/static/chunks/3i239y-1hbkm-.js +0 -1
  366. package/out/_next/static/chunks/3kp8qmhoi24oz.js +0 -1
  367. package/out/_next/static/chunks/3ksq69yq-40_r.js +0 -1
  368. package/out/_next/static/chunks/3qye1lytea2i8.js +0 -1
  369. package/out/_next/static/chunks/3rlp9yr75liz7.js +0 -1
  370. package/out/_next/static/chunks/3tyo643l62h3m.js +0 -1
  371. package/out/_next/static/chunks/3tz2tpqa9uvwm.js +0 -1
  372. package/out/_next/static/chunks/3utpc-fc6_y0f.js +0 -1
  373. package/out/_next/static/chunks/3v6nxa28rxngq.js +0 -1
  374. package/out/_next/static/chunks/3vv99btjc-mky.js +0 -1
  375. package/out/_next/static/chunks/3x02lxdo28u9i.js +0 -1
  376. package/out/_next/static/chunks/3ydnxyc4rvad_.js +0 -1
  377. package/out/_next/static/chunks/3ylg4gfetwgxw.js +0 -1
  378. package/out/_next/static/chunks/3zdtteq-r2fs5.js +0 -62
  379. package/out/_next/static/chunks/3zkwt0gybqtgm.js +0 -1
  380. package/out/_next/static/chunks/40etabvml_71y.js +0 -1
  381. package/out/_next/static/chunks/417jkzz0slv9m.js +0 -1
  382. package/out/_next/static/chunks/41u2-5jayyajf.js +0 -22
  383. package/out/_next/static/chunks/42gcpy51w7lk1.js +0 -1
  384. package/out/_next/static/chunks/44cer242u-f8v.js +0 -1
  385. package/out/_next/static/chunks/44zi0gl0a6a8w.js +0 -1
  386. package/out/_next/static/chunks/turbopack-0n2o5_bkskckx.js +0 -1
  387. /package/out/_next/static/{A1hxMz783bIWo0Q9qqV3L → ThV8NNsoOCsJ6Q9-7H2dV}/_buildManifest.js +0 -0
  388. /package/out/_next/static/{A1hxMz783bIWo0Q9qqV3L → ThV8NNsoOCsJ6Q9-7H2dV}/_clientMiddlewareManifest.js +0 -0
  389. /package/out/_next/static/{A1hxMz783bIWo0Q9qqV3L → ThV8NNsoOCsJ6Q9-7H2dV}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12552,t=>{"use strict";var e=t.i(97991),i=t.i(56173),n=t.i(28215);class a{get currentFrame(){return this._currentFrame}get weight(){return this._weight}get currentValue(){return this._currentValue}get targetPath(){return this._targetPath}get target(){return this._currentActiveTarget}get isAdditive(){return this._host&&this._host.isAdditive}constructor(t,e,a,s){if(this._events=[],this._currentFrame=0,this._originalValue=[],this._originalBlendValue=null,this._offsetsCache={},this._highLimitsCache={},this._stopped=!1,this._blendingFactor=0,this._currentValue=null,this._currentActiveTarget=null,this._directTarget=null,this._targetPath="",this._weight=1,this._absoluteFrameOffset=0,this._previousElapsedTime=0,this._yoyoDirection=1,this._previousAbsoluteFrame=0,this._targetIsArray=!1,this._coreRuntimeAnimation=null,this._animation=e,this._target=t,this._scene=a,this._host=s,this._activeTargets=[],e._runtimeAnimations.push(this),this._animationState={key:0,repeatCount:0,loopMode:this._getCorrectLoopMode()},this._animation.dataType===n.Animation.ANIMATIONTYPE_MATRIX&&(this._animationState.workValue=i.Matrix.Zero()),this._keys=this._animation.getKeys(),this._minFrame=this._keys[0].frame,this._maxFrame=this._keys[this._keys.length-1].frame,0!==this._minFrame){const t={frame:0,value:this._keys[0].value};this._keys.splice(0,0,t)}if(this._target instanceof Array){let t=0;for(const e of this._target)this._preparePath(e,t),this._getOriginalValues(t),t++;this._targetIsArray=!0}else this._preparePath(this._target),this._getOriginalValues(),this._targetIsArray=!1,this._directTarget=this._activeTargets[0];const o=e.getEvents();if(o&&o.length>0)for(const t of o)this._events.push(t._clone());this._enableBlending=t&&t.animationPropertiesOverride?t.animationPropertiesOverride.enableBlending:this._animation.enableBlending}_preparePath(t,e=0){let i=this._animation.targetPropertyPath;if(i.length>1){let n=t;for(let t=0;t<i.length-1;t++){let e=i[t];if(void 0===(n=n[e]))throw Error(`Invalid property (${e}) in property path (${i.join(".")})`)}this._targetPath=i[i.length-1],this._activeTargets[e]=n}else this._targetPath=i[0],this._activeTargets[e]=t;if(void 0===this._activeTargets[e][this._targetPath])throw Error(`Invalid property (${this._targetPath}) in property path (${i.join(".")})`)}get animation(){return this._animation}reset(t=!1){if(t)if(this._target instanceof Array){let t=0;for(let e of this._target)void 0!==this._originalValue[t]&&this._setValue(e,this._activeTargets[t],this._originalValue[t],-1,t),t++}else void 0!==this._originalValue[0]&&this._setValue(this._target,this._directTarget,this._originalValue[0],-1,0);this._offsetsCache={},this._highLimitsCache={},this._currentFrame=0,this._blendingFactor=0;for(let t=0;t<this._events.length;t++)this._events[t].isDone=!1}isStopped(){return this._stopped}dispose(){let t=this._animation.runtimeAnimations.indexOf(this);t>-1&&this._animation.runtimeAnimations.splice(t,1)}setValue(t,e){if(this._targetIsArray){for(let i=0;i<this._target.length;i++){let n=this._target[i];this._setValue(n,this._activeTargets[i],t,e,i)}return}this._setValue(this._target,this._directTarget,t,e,0)}_getOriginalValues(t=0){let e,i=this._activeTargets[t];if(n.Animation.InheritOriginalValueFromActiveAnimations){let e=this._scene._activeAnimatables;for(let n=0;n<e.length;n++){let a=e[n]._runtimeAnimations;for(let e=0;e<a.length;e++){let n=a[e];if(n!==this&&n._targetPath===this._targetPath){for(let e=0;e<n._activeTargets.length;e++)if(n._activeTargets[e]===i&&void 0!==n._originalValue[e])return void(n._originalValue[e]&&n._originalValue[e].clone?this._originalValue[t]=n._originalValue[e].clone():this._originalValue[t]=n._originalValue[e])}}}}(e=i.getLocalMatrix&&"_matrix"===this._targetPath?i.getLocalMatrix():i[this._targetPath])&&e.clone?this._originalValue[t]=e.clone():this._originalValue[t]=e}_registerTargetForLateAnimationBinding(t,e){let i=t.target;this._scene._registeredForLateAnimationBindings.pushNoDuplicate(i),i._lateAnimationHolders||(i._lateAnimationHolders={}),i._lateAnimationHolders[t.targetPath]||(i._lateAnimationHolders[t.targetPath]={totalWeight:0,totalAdditiveWeight:0,animations:[],additiveAnimations:[],originalValue:e}),t.isAdditive?(i._lateAnimationHolders[t.targetPath].additiveAnimations.push(t),i._lateAnimationHolders[t.targetPath].totalAdditiveWeight+=t.weight):(i._lateAnimationHolders[t.targetPath].animations.push(t),i._lateAnimationHolders[t.targetPath].totalWeight+=t.weight)}_setValue(t,e,a,s,o){if(this._currentActiveTarget=e,this._weight=s,this._enableBlending&&this._blendingFactor<=1){if(!this._originalBlendValue){let t=e[this._targetPath];t.clone?this._originalBlendValue=t.clone():this._originalBlendValue=t}this._originalBlendValue.m?n.Animation.AllowMatrixDecomposeForInterpolation?this._currentValue?i.Matrix.DecomposeLerpToRef(this._originalBlendValue,a,this._blendingFactor,this._currentValue):this._currentValue=i.Matrix.DecomposeLerp(this._originalBlendValue,a,this._blendingFactor):this._currentValue?i.Matrix.LerpToRef(this._originalBlendValue,a,this._blendingFactor,this._currentValue):this._currentValue=i.Matrix.Lerp(this._originalBlendValue,a,this._blendingFactor):this._currentValue=n.Animation._UniversalLerp(this._originalBlendValue,a,this._blendingFactor);let s=t&&t.animationPropertiesOverride?t.animationPropertiesOverride.blendingSpeed:this._animation.blendingSpeed;this._blendingFactor+=s}else this._currentValue?this._currentValue.copyFrom?this._currentValue.copyFrom(a):this._currentValue=a:a?.clone?this._currentValue=a.clone():this._currentValue=a;-1!==s?this._registerTargetForLateAnimationBinding(this,this._originalValue[o]):this._animationState.loopMode===n.Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT?this._currentValue.addToRef?this._currentValue.addToRef(this._originalValue[o],e[this._targetPath]):e[this._targetPath]=this._originalValue[o]+this._currentValue:e[this._targetPath]=this._currentValue,t.markAsDirty&&t.markAsDirty(this._animation.targetProperty)}_getCorrectLoopMode(){return this._target&&this._target.animationPropertiesOverride?this._target.getClassName?.()==="MorphTarget"&&null==this._target._animationPropertiesOverride?this._animation.loopMode:this._target.animationPropertiesOverride.loopMode:this._animation.loopMode}goToFrame(t,e=-1){let i=this._animation.getKeys();t<i[0].frame?t=i[0].frame:t>i[i.length-1].frame&&(t=i[i.length-1].frame);let n=this._events;if(n.length)for(let e=0;e<n.length;e++)n[e].onlyOnce||(n[e].isDone=n[e].frame<t);this._currentFrame=t;let a=this._animation._interpolate(t,this._animationState);this.setValue(a,e)}_prepareForSpeedRatioChange(t){let e=this._previousElapsedTime*(this._animation.framePerSecond*t)/1e3;this._absoluteFrameOffset=this._previousAbsoluteFrame-e}animate(t,e,i,a,s,o=-1){let r,l,h=this._animation,m=h.targetPropertyPath;if(!m||m.length<1)return this._stopped=!0,!1;let _=!0,g=this._events;if(this._coreRuntimeAnimation)l=i-e,r=this._coreRuntimeAnimation.currentFrame,this._currentFrame=r,this._animationState.repeatCount=this._coreRuntimeAnimation._animationState.repeatCount,this._animationState.highLimitValue=this._coreRuntimeAnimation._animationState.highLimitValue,this._animationState.offsetValue=this._coreRuntimeAnimation._animationState.offsetValue;else{let o;(e<this._minFrame||e>this._maxFrame)&&(e=this._minFrame),(i<this._minFrame||i>this._maxFrame)&&(i=this._maxFrame),l=i-e;let m=t*(h.framePerSecond*s)/1e3+this._absoluteFrameOffset,u=0,d=!1,p=a&&this._animationState.loopMode===n.Animation.ANIMATIONLOOPMODE_YOYO;if(p){let t=Math.sin((m-e)/l*Math.PI);m=Math.abs(t)*l+e;let i=t>=0?1:-1;this._yoyoDirection!==i&&(d=!0),this._yoyoDirection=i}if(this._previousElapsedTime=t,this._previousAbsoluteFrame=m,!a&&i>=e&&(m>=l&&s>0||m<=0&&s<0))_=!1,u=h.evaluate(i);else if(!a&&e>=i&&(m<=l&&s<0||m>=0&&s>0))_=!1,u=h.evaluate(e);else if(this._animationState.loopMode!==n.Animation.ANIMATIONLOOPMODE_CYCLE){let t=i.toString()+e.toString();if(!this._offsetsCache[t]){this._animationState.repeatCount=0,this._animationState.loopMode=n.Animation.ANIMATIONLOOPMODE_CYCLE;let a=h._interpolate(e,this._animationState),s=h._interpolate(i,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),h.dataType){case n.Animation.ANIMATIONTYPE_FLOAT:this._offsetsCache[t]=s-a;break;case n.Animation.ANIMATIONTYPE_QUATERNION:case n.Animation.ANIMATIONTYPE_VECTOR3:case n.Animation.ANIMATIONTYPE_VECTOR2:case n.Animation.ANIMATIONTYPE_SIZE:case n.Animation.ANIMATIONTYPE_COLOR3:case n.Animation.ANIMATIONTYPE_COLOR4:this._offsetsCache[t]=s.subtract(a)}this._highLimitsCache[t]=s}u=this._highLimitsCache[t],o=this._offsetsCache[t]}if(void 0===o)switch(h.dataType){case n.Animation.ANIMATIONTYPE_FLOAT:o=0;break;case n.Animation.ANIMATIONTYPE_QUATERNION:o=n._StaticOffsetValueQuaternion;break;case n.Animation.ANIMATIONTYPE_VECTOR3:o=n._StaticOffsetValueVector3;break;case n.Animation.ANIMATIONTYPE_VECTOR2:o=n._StaticOffsetValueVector2;break;case n.Animation.ANIMATIONTYPE_SIZE:o=n._StaticOffsetValueSize;break;case n.Animation.ANIMATIONTYPE_COLOR3:o=n._StaticOffsetValueColor3;break;case n.Animation.ANIMATIONTYPE_COLOR4:o=n._StaticOffsetValueColor4}if(this._host&&this._host.syncRoot){let t=this._host.syncRoot,i=(t.masterFrame-t.fromFrame)/(t.toFrame-t.fromFrame);r=e+l*i}else r=m>0&&e>i||m<0&&e<i?_&&0!==l?i+m%l:e:_&&0!==l?e+m%l:i;if(!p&&(s>0&&this.currentFrame>r||s<0&&this.currentFrame<r)||p&&d){this._onLoop();for(let t=0;t<g.length;t++)g[t].onlyOnce||(g[t].isDone=!1);this._animationState.key=s>0?0:h.getKeys().length-1}this._currentFrame=r,this._animationState.repeatCount=0===l?0:m/l|0,this._animationState.highLimitValue=u,this._animationState.offsetValue=o}let u=h._interpolate(r,this._animationState);if(this.setValue(u,o),g.length){for(let t=0;t<g.length;t++)if(l>=0&&r>=g[t].frame&&g[t].frame>=e||l<0&&r<=g[t].frame&&g[t].frame<=e){let e=g[t];e.isDone||(e.onlyOnce&&(g.splice(t,1),t--),e.isDone=!0,e.action(r))}}return _||(this._stopped=!0),_}}var s=t.i(2103);class o{get syncRoot(){return this._syncRoot}get masterFrame(){return 0===this._runtimeAnimations.length?0:this._runtimeAnimations[0].currentFrame}get weight(){return this._weight}set weight(t){if(-1===t){this._weight=-1;return}this._weight=Math.min(Math.max(t,0),1)}get speedRatio(){return this._speedRatio}set speedRatio(t){for(let e=0;e<this._runtimeAnimations.length;e++)this._runtimeAnimations[e]._prepareForSpeedRatioChange(t);this._speedRatio=t,null!==this._goToFrame&&this.goToFrame(this._goToFrame)}get elapsedTime(){return null===this._localDelayOffset?0:this._scene._animationTime-this._localDelayOffset}constructor(t,i,n=0,a=100,s=!1,o=1,r,l,h,m=!1,_=0){this.target=i,this.fromFrame=n,this.toFrame=a,this.loopAnimation=s,this.onAnimationEnd=r,this.onAnimationLoop=h,this.isAdditive=m,this.playOrder=_,this._localDelayOffset=null,this._pausedDelay=null,this._manualJumpDelay=null,this._runtimeAnimations=[],this._paused=!1,this._speedRatio=1,this._weight=-1,this._previousWeight=-1,this._syncRoot=null,this._frameToSyncFromJump=null,this._goToFrame=null,this.disposeOnEnd=!0,this.animationStarted=!1,this.onAnimationEndObservable=new e.Observable,this.onAnimationLoopObservable=new e.Observable,this._scene=t,l&&this.appendAnimations(i,l),this._speedRatio=o,t._activeAnimatables.push(this)}syncWith(t){if(this._syncRoot=t,t){let t=this._scene._activeAnimatables.indexOf(this);t>-1&&(this._scene._activeAnimatables.splice(t,1),this._scene._activeAnimatables.push(this))}return this}getAnimations(){return this._runtimeAnimations}appendAnimations(t,e){for(let i=0;i<e.length;i++){let n=new a(t,e[i],this._scene,this);n._onLoop=()=>{this.onAnimationLoopObservable.notifyObservers(this),this.onAnimationLoop&&this.onAnimationLoop()},this._runtimeAnimations.push(n)}}getAnimationByTargetProperty(t){let e=this._runtimeAnimations;for(let i=0;i<e.length;i++)if(e[i].animation.targetProperty===t)return e[i].animation;return null}getRuntimeAnimationByTargetProperty(t){let e=this._runtimeAnimations;for(let i=0;i<e.length;i++)if(e[i].animation.targetProperty===t)return e[i];return null}reset(){let t=this._runtimeAnimations;for(let e=0;e<t.length;e++)t[e].reset(!0);this._localDelayOffset=null,this._pausedDelay=null}enableBlending(t){let e=this._runtimeAnimations;for(let i=0;i<e.length;i++)e[i].animation.enableBlending=!0,e[i].animation.blendingSpeed=t}disableBlending(){let t=this._runtimeAnimations;for(let e=0;e<t.length;e++)t[e].animation.enableBlending=!1}goToFrame(t,e=!1){let i=this._runtimeAnimations;if(i[0]){let e=i[0].animation.framePerSecond;this._frameToSyncFromJump=this._frameToSyncFromJump??i[0].currentFrame;let n=0===this.speedRatio?0:(t-this._frameToSyncFromJump)/e*1e3/this.speedRatio;this._manualJumpDelay=-n}for(let n=0;n<i.length;n++)i[n].goToFrame(t,e?this._weight:-1);this._goToFrame=t}get paused(){return this._paused}pause(){this._paused||(this._paused=!0)}restart(){this._paused=!1}_raiseOnAnimationEnd(){this.onAnimationEnd&&this.onAnimationEnd(),this.onAnimationEndObservable.notifyObservers(this)}stop(t,e,i=!1,n=!1){if(t||e){let a=this._scene._activeAnimatables.indexOf(this);if(a>-1){let s=this._runtimeAnimations;for(let i=s.length-1;i>=0;i--){let n=s[i];(!t||n.animation.name==t)&&(!e||e(n.target))&&(n.dispose(),s.splice(i,1))}0==s.length&&(i||this._scene._activeAnimatables.splice(a,1),n||this._raiseOnAnimationEnd())}}else{let t=this._scene._activeAnimatables.indexOf(this);if(t>-1){i||this._scene._activeAnimatables.splice(t,1);let e=this._runtimeAnimations;for(let t=0;t<e.length;t++)e[t].dispose();this._runtimeAnimations.length=0,n||this._raiseOnAnimationEnd()}}}async waitAsync(){return await new Promise(t=>{this.onAnimationEndObservable.add(()=>{t(this)},void 0,void 0,this,!0)})}_animate(t){let e;if(this._paused)return this.animationStarted=!1,null===this._pausedDelay&&(this._pausedDelay=t),!0;if(null===this._localDelayOffset?(this._localDelayOffset=t,this._pausedDelay=null):null!==this._pausedDelay&&(this._localDelayOffset+=t-this._pausedDelay,this._pausedDelay=null),null!==this._manualJumpDelay&&(this._localDelayOffset+=this.speedRatio<0?-this._manualJumpDelay:this._manualJumpDelay,this._manualJumpDelay=null,this._frameToSyncFromJump=null),this._goToFrame=null,!o.ProcessPausedAnimatables&&0===this._weight&&0===this._previousWeight)return!0;this._previousWeight=this._weight;let i=!1,n=this._runtimeAnimations;for(e=0;e<n.length;e++){let a=n[e].animate(t-this._localDelayOffset,this.fromFrame,this.toFrame,this.loopAnimation,this._speedRatio,this._weight);i=i||a}if(this.animationStarted=i,!i){if(this.disposeOnEnd)for(e=this._scene._activeAnimatables.indexOf(this),this._scene._activeAnimatables.splice(e,1),e=0;e<n.length;e++)n[e].dispose();this._raiseOnAnimationEnd(),this.disposeOnEnd&&(this.onAnimationEnd=null,this.onAnimationLoop=null,this.onAnimationLoopObservable.clear(),this.onAnimationEndObservable.clear())}return i}}o.ProcessPausedAnimatables=!1;var r=t.i(97372),l=t.i(17188);let h=!1;var m=t.i(71829),_=t.i(88362),g=t.i(72291);class u{getClassName(){return"TargetedAnimation"}constructor(t){this.parent=t,this.uniqueId=g.UniqueIdGenerator.UniqueId}serialize(){let t={};return t.animation=this.animation.serialize(),t.targetId=this.target.id,t.targetUniqueId=this.target.uniqueId,t}}class d{get mask(){return this._mask}set mask(t){this._mask!==t&&(this._mask=t,this.syncWithMask(!0))}syncWithMask(t=!1){if(!this.mask&&!t){this._numActiveAnimatables=this._targetedAnimations.length;return}this._numActiveAnimatables=0;for(let t=0;t<this._animatables.length;++t){let e=this._animatables[t];!this.mask||this.mask.disabled||this.mask.retainsTarget(e.target.name)?(this._numActiveAnimatables++,e.paused&&e.restart()):e.paused||e.pause()}}removeUnmaskedAnimations(){if(this.mask&&!this.mask.disabled){for(let t=0;t<this._animatables.length;++t){let e=this._animatables[t];!this.mask.retainsTarget(e.target.name)&&(e.stop(),this._animatables.splice(t,1),--t)}for(let t=0;t<this._targetedAnimations.length;t++){let e=this._targetedAnimations[t];!this.mask.retainsTarget(e.target.name)&&(this._targetedAnimations.splice(t,1),--t)}}}get from(){return this._from}set from(t){if(this._from!==t){this._from=t;for(let t=0;t<this._animatables.length;t++)this._animatables[t].fromFrame=this._from}}get to(){return this._to}set to(t){if(this._to!==t){this._to=t;for(let t=0;t<this._animatables.length;t++)this._animatables[t].toFrame=this._to}}get isStarted(){return this._isStarted}get isPlaying(){return this._isStarted&&!this._isPaused}get speedRatio(){return this._speedRatio}set speedRatio(t){if(this._speedRatio!==t){this._speedRatio=t;for(let t=0;t<this._animatables.length;t++)this._animatables[t].speedRatio=this._speedRatio}}get loopAnimation(){return this._loopAnimation}set loopAnimation(t){if(this._loopAnimation!==t){this._loopAnimation=t;for(let t=0;t<this._animatables.length;t++)this._animatables[t].loopAnimation=this._loopAnimation}}get isAdditive(){return this._isAdditive}set isAdditive(t){if(this._isAdditive!==t){this._isAdditive=t;for(let t=0;t<this._animatables.length;t++)this._animatables[t].isAdditive=this._isAdditive}}get weight(){return this._weight}set weight(t){this._weight!==t&&(this._weight=t,this.setWeightForAllAnimatables(this._weight))}get targetedAnimations(){return this._targetedAnimations}get animatables(){return this._animatables}get children(){return this._targetedAnimations}get playOrder(){return this._playOrder}set playOrder(t){if(this._playOrder!==t&&(this._playOrder=t,this._animatables.length>0)){for(let t=0;t<this._animatables.length;t++)this._animatables[t].playOrder=this._playOrder;this._scene.sortActiveAnimatables()}}get enableBlending(){return this._enableBlending}set enableBlending(t){if(this._enableBlending!==t&&(this._enableBlending=t,null!==t))for(let e=0;e<this._targetedAnimations.length;++e)this._targetedAnimations[e].animation.enableBlending=t}get blendingSpeed(){return this._blendingSpeed}set blendingSpeed(t){if(this._blendingSpeed!==t&&(this._blendingSpeed=t,null!==t))for(let e=0;e<this._targetedAnimations.length;++e)this._targetedAnimations[e].animation.blendingSpeed=t}getLength(t,e){t=t??this._from,e=e??this._to;let i=this.targetedAnimations[0].animation.framePerSecond*this._speedRatio;return(e-t)/i}getScene(){return this._scene}constructor(t,a=null,_=-1,g=0){this.name=t,this._targetedAnimations=[],this._animatables=[],this._from=Number.MAX_VALUE,this._to=-Number.MAX_VALUE,this._speedRatio=1,this._loopAnimation=!1,this._isAdditive=!1,this._weight=-1,this._playOrder=0,this._enableBlending=null,this._blendingSpeed=null,this._numActiveAnimatables=0,this._shouldStart=!0,this._parentContainer=null,this.onAnimationEndObservable=new e.Observable,this.onAnimationLoopObservable=new e.Observable,this.onAnimationGroupLoopObservable=new e.Observable,this.onAnimationGroupEndObservable=new e.Observable,this.onAnimationGroupPauseObservable=new e.Observable,this.onAnimationGroupPlayObservable=new e.Observable,this.metadata=null,this._mask=null,this._animationLoopFlags=[],this._scene=a||m.EngineStore.LastCreatedScene,this._weight=_,this._playOrder=g,this.uniqueId=this._scene.getUniqueId(),function(){if(!h){var t,e;h=!0,t=l.Scene,(e=r.Bone)&&(e.prototype.copyAnimationRange=function(t,e,i,a=!1,s=null){let o,r,l;0===this.animations.length&&(this.animations.push(new n.Animation(this.name,"_matrix",t.animations[0].framePerSecond,n.Animation.ANIMATIONTYPE_MATRIX,0)),this.animations[0].setKeys([]));let h=t.animations[0].getRange(e);if(!h)return!1;let m=h.from,_=h.to,g=t.animations[0].getKeys(),u=t.length,d=t.getParent(),p=this.getParent(),A=a&&d&&u&&this.length&&u!==this.length,c=A&&p&&d?p.length/d.length:1,f=a&&!p&&s&&(1!==s.x||1!==s.y||1!==s.z),b=this.animations[0].getKeys();for(let t=0,e=g.length;t<e;t++)(o=g[t]).frame>=m&&o.frame<=_&&(a?(l=o.value.clone(),A?(r=l.getTranslation(),l.setTranslation(r.scaleInPlace(c))):f&&s?(r=l.getTranslation(),l.setTranslation(r.multiplyInPlace(s))):l=o.value):l=o.value,b.push({frame:o.frame+i,value:l}));return this.animations[0].createRange(e,m+i,_+i),!0}),t&&(t.prototype._animate=function(t){if(!this.animationsEnabled)return;let e=s.PrecisionDate.Now;if(!this._animationTimeLast){if(this._pendingData.length>0)return;this._animationTimeLast=e}this.deltaTime=void 0!==t?t:this.useConstantAnimationDeltaTime?16:(e-this._animationTimeLast)*this.animationTimeScale,this._animationTimeLast=e;let a=this._activeAnimatables;if(0===a.length)return;this._animationTime+=this.deltaTime;let o=this._animationTime;for(let t=0;t<a.length;t++){let e=a[t];!e._animate(o)&&e.disposeOnEnd&&t--}!function(t){if(t._registeredForLateAnimationBindings.length){for(let e=0;e<t._registeredForLateAnimationBindings.length;e++){let a=t._registeredForLateAnimationBindings.data[e];for(let t in a._lateAnimationHolders){let e=a._lateAnimationHolders[t],s=e.animations[0],o=e.originalValue;if(null==o)continue;let r=n.Animation.AllowMatrixDecomposeForInterpolation&&o.m,l=a[t];if(r)l=function(t){let e;if(0===t.totalWeight&&0===t.totalAdditiveWeight)return t.originalValue;let n=1,a=i.TmpVectors.Vector3[0],s=i.TmpVectors.Vector3[1],o=i.TmpVectors.Quaternion[0],r=0,l=t.animations[0],h=t.originalValue,m=!1;if(t.totalWeight<1)e=1-t.totalWeight,h.decompose(s,o,a);else{if(r=1,n=t.totalWeight,1==(e=l.weight/n))if(!t.totalAdditiveWeight)return l.currentValue;else m=!0;l.currentValue.decompose(s,o,a)}if(!m){s.scaleInPlace(e),a.scaleInPlace(e),o.scaleInPlace(e);for(let l=r;l<t.animations.length;l++){let r=t.animations[l];if(0===r.weight)continue;e=r.weight/n;let h=i.TmpVectors.Vector3[2],m=i.TmpVectors.Vector3[3],_=i.TmpVectors.Quaternion[1];r.currentValue.decompose(m,_,h),m.scaleAndAddToRef(e,s),_.scaleAndAddToRef(i.Quaternion.Dot(o,_)>0?e:-e,o),h.scaleAndAddToRef(e,a)}o.normalize()}for(let e=0;e<t.additiveAnimations.length;e++){let n=t.additiveAnimations[e];if(0===n.weight)continue;let r=i.TmpVectors.Vector3[2],l=i.TmpVectors.Vector3[3],h=i.TmpVectors.Quaternion[1];n.currentValue.decompose(l,h,r),l.multiplyToRef(s,l),i.Vector3.LerpToRef(s,l,n.weight,s),o.multiplyToRef(h,h),i.Quaternion.SlerpToRef(o,h,n.weight,o),r.scaleAndAddToRef(n.weight,a)}let _=l?l._animationState.workValue:i.TmpVectors.Matrix[0].clone();return i.Matrix.ComposeToRef(s,o,a,_),_}(e);else if(void 0!==o.w)l=function(t,e){if(0===t.totalWeight&&0===t.totalAdditiveWeight)return e;let n=t.animations[0],a=t.originalValue,s=e;if(0===t.totalWeight&&t.totalAdditiveWeight>0)s.copyFrom(a);else if(1===t.animations.length){if(i.Quaternion.SlerpToRef(a,n.currentValue,Math.min(1,t.totalWeight),s),0===t.totalAdditiveWeight)return s}else if(t.animations.length>1){let n,o,r=1;if(t.totalWeight<1){let e=1-t.totalWeight;o=[],(n=[]).push(a),o.push(e)}else{if(2===t.animations.length&&(i.Quaternion.SlerpToRef(t.animations[0].currentValue,t.animations[1].currentValue,t.animations[1].weight/t.totalWeight,e),0===t.totalAdditiveWeight))return e;n=[],o=[],r=t.totalWeight}for(let e=0;e<t.animations.length;e++){let i=t.animations[e];n.push(i.currentValue),o.push(i.weight/r)}let l=0;for(let t=0;t<n.length;){if(!t){i.Quaternion.SlerpToRef(n[t],n[t+1],o[t+1]/(o[t]+o[t+1]),e),s=e,l=o[t]+o[t+1],t+=2;continue}l+=o[t],i.Quaternion.SlerpToRef(s,n[t],o[t]/l,s),t++}}for(let e=0;e<t.additiveAnimations.length;e++){let n=t.additiveAnimations[e];0!==n.weight&&(s.multiplyToRef(n.currentValue,i.TmpVectors.Quaternion[0]),i.Quaternion.SlerpToRef(s,i.TmpVectors.Quaternion[0],n.weight,s))}return s}(e,l||i.Quaternion.Identity());else{let t=0,i=1,a=s&&s._animationState.loopMode===n.Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT;if(e.totalWeight<1)l=a?o.clone?o.clone():o:s&&o.scale?o.scale(1-e.totalWeight):s?o*(1-e.totalWeight):o.clone?o.clone():o;else if(s){i=e.totalWeight;let n=s.weight/i;l=1!==n?s.currentValue.scale?s.currentValue.scale(n):s.currentValue*n:s.currentValue,a&&(l.addToRef?l.addToRef(o,l):l+=o),t=1}for(let n=t;n<e.animations.length;n++){let t=e.animations[n],a=t.weight/i;a&&(t.currentValue.scaleAndAddToRef?t.currentValue.scaleAndAddToRef(a,l):l+=t.currentValue*a)}for(let t=0;t<e.additiveAnimations.length;t++){let i=e.additiveAnimations[t],n=i.weight;n&&(i.currentValue.scaleAndAddToRef?i.currentValue.scaleAndAddToRef(n,l):l+=i.currentValue*n)}}a[t]=l}a._lateAnimationHolders={}}t._registeredForLateAnimationBindings.reset()}}(this)},t.prototype.sortActiveAnimatables=function(){this._activeAnimatables.sort((t,e)=>t.playOrder-e.playOrder)},t.prototype.beginWeightedAnimation=function(t,e,i,n=1,a,s=1,o,r,l,h,m=!1){let _=this.beginAnimation(t,e,i,a,s,o,r,!1,l,h,m);return _.weight=n,_},t.prototype.beginAnimation=function(t,e,i,n,a=1,s,r,l=!0,h,m,_=!1){if(a<0){let t=e;e=i,i=t,a=-a}e>i&&(a=-a),l&&this.stopAnimation(t,void 0,h),r||(r=new o(this,t,e,i,n,a,s,void 0,m,_));let g=!h||h(t);if(t.animations&&g&&r.appendAnimations(t,t.animations),t.getAnimatables){let o=t.getAnimatables();for(let t=0;t<o.length;t++)this.beginAnimation(o[t],e,i,n,a,s,r,l,h,m)}return r.reset(),r},t.prototype.beginHierarchyAnimation=function(t,e,i,n,a,s=1,o,r,l=!0,h,m,_=!1){let g=t.getDescendants(e),u=[];for(let e of(u.push(this.beginAnimation(t,i,n,a,s,o,r,l,h,void 0,_)),g))u.push(this.beginAnimation(e,i,n,a,s,o,r,l,h,void 0,_));return u},t.prototype.beginDirectAnimation=function(t,e,i,n,a,s=1,r,l,h=!1){if(s<0){let t=i;i=n,n=t,s=-s}return i>n&&(s=-s),new o(this,t,i,n,a,s,r,e,l,h)},t.prototype.beginDirectHierarchyAnimation=function(t,e,i,n,a,s,o,r,l,h=!1){let m=t.getDescendants(e),_=[];for(let e of(_.push(this.beginDirectAnimation(t,i,n,a,s,o,r,l,h)),m))_.push(this.beginDirectAnimation(e,i,n,a,s,o,r,l,h));return _},t.prototype.getAnimatableByTarget=function(t){for(let e=0;e<this._activeAnimatables.length;e++)if(this._activeAnimatables[e].target===t)return this._activeAnimatables[e];return null},t.prototype.getAllAnimatablesByTarget=function(t){let e=[];for(let i=0;i<this._activeAnimatables.length;i++)this._activeAnimatables[i].target===t&&e.push(this._activeAnimatables[i]);return e},t.prototype.stopAnimation=function(t,e,i){for(let n of this.getAllAnimatablesByTarget(t))n.stop(e,i)},t.prototype.stopAllAnimations=function(){if(this._activeAnimatables){for(let t=0;t<this._activeAnimatables.length;t++)this._activeAnimatables[t].stop(void 0,void 0,!0);this._activeAnimatables.length=0}for(let t of this.animationGroups)t.stop()})}}(),this._scene.addAnimationGroup(this)}addTargetedAnimation(t,e){let i=new u(this);i.animation=t,i.target=e;let n=t.getKeys();return this._from>n[0].frame&&(this._from=n[0].frame),this._to<n[n.length-1].frame&&(this._to=n[n.length-1].frame),null!==this._enableBlending&&(t.enableBlending=this._enableBlending),null!==this._blendingSpeed&&(t.blendingSpeed=this._blendingSpeed),this._targetedAnimations.push(i),this._shouldStart=!0,i}removeTargetedAnimation(t){for(let e=this._targetedAnimations.length-1;e>-1;e--)this._targetedAnimations[e].animation===t&&this._targetedAnimations.splice(e,1)}normalize(t=null,e=null){null==t&&(t=this._from),null==e&&(e=this._to);for(let i=0;i<this._targetedAnimations.length;i++){let n=this._targetedAnimations[i].animation.getKeys(),a=n[0],s=n[n.length-1];if(a.frame>t){let e={frame:t,value:a.value,inTangent:a.inTangent,outTangent:a.outTangent,interpolation:a.interpolation};n.splice(0,0,e)}if(s.frame<e){let t={frame:e,value:s.value,inTangent:s.inTangent,outTangent:s.outTangent,interpolation:s.interpolation};n.push(t)}}return this._from=t,this._to=e,this}_processLoop(t,e,i){t.onAnimationLoop=()=>{this.onAnimationLoopObservable.notifyObservers(e),this._animationLoopFlags[i]||(this._animationLoopFlags[i]=!0,this._animationLoopCount++,this._animationLoopCount===this._numActiveAnimatables&&(this.onAnimationGroupLoopObservable.notifyObservers(this),this._animationLoopCount=0,this._animationLoopFlags.length=0))}}start(t=!1,e=1,i,n,a){if(this._isStarted||0===this._targetedAnimations.length)return this;this._loopAnimation=t,this._shouldStart=!1,this._animationLoopCount=0,this._animationLoopFlags.length=0;for(let s=0;s<this._targetedAnimations.length;s++){let o=this._targetedAnimations[s],r=this._scene.beginDirectAnimation(o.target,[o.animation],void 0!==i?i:this._from,void 0!==n?n:this._to,t,e,void 0,void 0,void 0!==a?a:this._isAdditive);r.weight=this._weight,r.playOrder=this._playOrder,r.onAnimationEnd=()=>{this.onAnimationEndObservable.notifyObservers(o),this._checkAnimationGroupEnded(r)},this._processLoop(r,o,s),this._animatables.push(r)}return this.syncWithMask(),this._scene.sortActiveAnimatables(),this._speedRatio=e,this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this}pause(){if(!this._isStarted)return this;this._isPaused=!0;for(let t=0;t<this._animatables.length;t++)this._animatables[t].pause();return this.onAnimationGroupPauseObservable.notifyObservers(this),this}play(t){return this.isStarted&&this._animatables.length&&!this._shouldStart?(void 0!==t&&(this.loopAnimation=t),this.restart()):(this.stop(),this.start(t,this._speedRatio)),this}reset(){if(!this._isStarted)return this.play(),this.goToFrame(0),this.stop(!0),this;for(let t=0;t<this._animatables.length;t++)this._animatables[t].reset();return this}restart(){if(!this._isStarted)return this;for(let t=0;t<this._animatables.length;t++)this._animatables[t].restart();return this.syncWithMask(),this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this}stop(t=!1){if(!this._isStarted)return this;let e=this._animatables.slice();for(let i=0;i<e.length;i++)e[i].stop(void 0,void 0,!0,t);let i=0;for(let e=0;e<this._scene._activeAnimatables.length;e++){let n=this._scene._activeAnimatables[e];n._runtimeAnimations.length>0?this._scene._activeAnimatables[i++]=n:t&&this._checkAnimationGroupEnded(n,t)}return this._scene._activeAnimatables.length=i,this._isStarted=!1,this}setWeightForAllAnimatables(t){for(let e=0;e<this._animatables.length;e++)this._animatables[e].weight=t;return this}syncAllAnimationsWith(t){for(let e=0;e<this._animatables.length;e++)this._animatables[e].syncWith(t);return this}goToFrame(t,e=!1){if(!this._isStarted)return this;for(let i=0;i<this._animatables.length;i++)this._animatables[i].goToFrame(t,e);return this}getCurrentFrame(){return this.animatables[0]?.masterFrame||0}dispose(){if(this.isStarted&&this.stop(),this._targetedAnimations.length=0,this._animatables.length=0,this._scene.removeAnimationGroup(this),this._parentContainer){let t=this._parentContainer.animationGroups.indexOf(this);t>-1&&this._parentContainer.animationGroups.splice(t,1),this._parentContainer=null}this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear(),this.onAnimationGroupLoopObservable.clear()}_checkAnimationGroupEnded(t,e=!1){let i=this._animatables.indexOf(t);i>-1&&this._animatables.splice(i,1),this._animatables.length===this._targetedAnimations.length-this._numActiveAnimatables&&(this._isStarted=!1,e||this.onAnimationGroupEndObservable.notifyObservers(this),this._animatables.length=0)}clone(t,e,i=!1,n=!1){let a=new d(t||this.name,this._scene,this._weight,this._playOrder);for(let t of(a._from=this.from,a._to=this.to,a._speedRatio=this.speedRatio,a._loopAnimation=this.loopAnimation,a._isAdditive=this.isAdditive,a._enableBlending=this.enableBlending,a._blendingSpeed=this.blendingSpeed,a.metadata=this.metadata,a.mask=this.mask,this._targetedAnimations))a.addTargetedAnimation(i?t.animation.clone(n):t.animation,e?e(t.target):t.target);return a}serialize(){let t={};t.name=this.name,t.from=this.from,t.to=this.to,t.speedRatio=this.speedRatio,t.loopAnimation=this.loopAnimation,t.isAdditive=this.isAdditive,t.weight=this.weight,t.playOrder=this.playOrder,t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed,t.targetedAnimations=[];for(let e=0;e<this.targetedAnimations.length;e++){let i=this.targetedAnimations[e];t.targetedAnimations[e]=i.serialize()}return _.Tags&&_.Tags.HasTags(this)&&(t.tags=_.Tags.GetTags(this)),this.metadata&&(t.metadata=this.metadata),t}getClassName(){return"AnimationGroup"}toString(t){let e="Name: "+this.name;return e+=", type: "+this.getClassName(),t&&(e+=", from: "+this._from+", to: "+this._to+", isStarted: "+this._isStarted+", speedRatio: "+this._speedRatio+", targetedAnimations length: "+this._targetedAnimations.length+", animatables length: "+this._animatables.length),e}}function p(t,e=!0,i=!1,n){if(0===t.length)return null;n=n??t[0].weight;let a=Number.MAX_VALUE,s=-Number.MAX_VALUE;if(i)for(let e of t)e.from<a&&(a=e.from),e.to>s&&(s=e.to);let o=new d(t[0].name+"_merged",t[0].getScene(),n);for(let n of t){for(let t of(i&&n.normalize(a,s),n.targetedAnimations))o.addTargetedAnimation(t.animation,t.target);e&&n.dispose()}return o}function A(t,e,i){let a=new d(t.name,e,t.weight,t.playOrder);for(let s=0;s<t.targetedAnimations.length;s++){let o=t.targetedAnimations[s],r=(0,n.AnimationParse)(o.animation),l=i?i(o):"influence"===o.animation.property?e.getMorphTargetById(o.targetId):e.getNodeById(o.targetId);l&&a.addTargetedAnimation(r,l)}return _.Tags&&_.Tags.AddTagsTo(a,t.tags),null!==t.from&&null!==t.to&&a.normalize(t.from,t.to),void 0!==t.speedRatio&&(a._speedRatio=t.speedRatio),void 0!==t.loopAnimation&&(a._loopAnimation=t.loopAnimation),void 0!==t.isAdditive&&(a._isAdditive=t.isAdditive),void 0!==t.weight&&(a._weight=t.weight),void 0!==t.playOrder&&(a._playOrder=t.playOrder),void 0!==t.enableBlending&&(a._enableBlending=t.enableBlending),void 0!==t.blendingSpeed&&(a._blendingSpeed=t.blendingSpeed),void 0!==t.metadata&&(a.metadata=t.metadata),a}function c(t,e,i,a=!1,s){let o,r=t;(o="object"==typeof e?e:{referenceFrame:e,range:i,cloneOriginalAnimationGroup:a,clonedAnimationName:s}).cloneOriginalAnimationGroup&&(r=t.clone(o.clonedAnimationGroupName||r.name));let l=r.targetedAnimations;for(let t=0;t<l.length;t++){let e=l[t];e.animation=(0,n.AnimationMakeAnimationAdditive)(e.animation,o)}if(r.isAdditive=!0,o.clipKeys){let t=Number.MAX_VALUE,e=-Number.MAX_VALUE,i=r.targetedAnimations;for(let n=0;n<i.length;n++){let a=i[n].animation.getKeys();t>a[0].frame&&(t=a[0].frame),e<a[a.length-1].frame&&(e=a[a.length-1].frame)}let n=r;n._from=t,n._to=e}return r}function f(t,e,i,n,a){return b(t.clone(n||t.name),e,i,a)}function b(t,e,i,n){return y(t,e,i,n,!1)}function v(t,e,i,n,a){return T(t.clone(n||t.name),e,i,a)}function T(t,e,i,n){return y(t,e,i,n,!0)}function y(t,e,i,n,a=!1){let s=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=t.targetedAnimations;for(let t=0;t<r.length;t++){let l=r[t],h=n?l.animation:l.animation.clone();a&&(h.createKeyForFrame(e),h.createKeyForFrame(i));let m=h.getKeys(),_=[],g=Number.MAX_VALUE;for(let t=0;t<m.length;t++){let n=m[t];if(!a&&t>=e&&t<=i||a&&n.frame>=e&&n.frame<=i){let t={frame:n.frame,value:n.value.clone?n.value.clone():n.value,inTangent:n.inTangent,outTangent:n.outTangent,interpolation:n.interpolation,lockedTangent:n.lockedTangent};g===Number.MAX_VALUE&&(g=t.frame),t.frame-=g,_.push(t)}}if(0===_.length){r.splice(t,1),t--;continue}s>_[0].frame&&(s=_[0].frame),o<_[_.length-1].frame&&(o=_[_.length-1].frame),h.setKeys(_,!0),l.animation=h}return t._from=s,t._to=o,t}let O=!1;t.s(["AnimationGroup",0,d,"AnimationGroupClipFrames",0,v,"AnimationGroupClipFramesInPlace",0,T,"AnimationGroupClipInPlace",0,y,"AnimationGroupClipKeys",0,f,"AnimationGroupClipKeysInPlace",0,b,"AnimationGroupMakeAnimationAdditive",0,c,"AnimationGroupMergeAnimationGroups",0,p,"AnimationGroupParse",0,A,"RegisterAnimationGroup",0,function(){O||(O=!0,d.MergeAnimationGroups=p,d.Parse=A,d.MakeAnimationAdditive=c,d.ClipKeys=f,d.ClipKeysInPlace=b,d.ClipFrames=v,d.ClipFramesInPlace=T,d.ClipInPlace=y)},"TargetedAnimation",0,u],12552)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29251,t=>{"use strict";var e=t.i(97009),i=t.i(20552),o=t.i(99493);class s extends i.FlowGraphExecutionBlockWithOutSignal{constructor(t){super(t),this.count=this.registerDataOutput("count",e.RichTypeNumber),this.reset=this._registerSignalInput("reset")}_execute(t,e){if(e===this.reset){t._setExecutionVariable(this,"count",0),this.count.setValue(0,t);return}let i=t._getExecutionVariable(this,"count",0)+1;t._setExecutionVariable(this,"count",i),this.count.setValue(i,t),this.out._activateSignal(t)}getClassName(){return"FlowGraphCallCounterBlock"}}let l=!1;function r(){l||(l=!0,(0,o.RegisterClass)("FlowGraphCallCounterBlock",s))}t.s(["FlowGraphCallCounterBlock",0,s,"RegisterFlowGraphCounterBlock",0,r],51515),r(),t.s([],13022),t.i(13022),t.i(51515),t.s(["FlowGraphCallCounterBlock",0,s],29251)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33401,t=>{"use strict";var e=t.i(65678),i=t.i(23422),s=t.i(68282);class o extends i.FlowGraphExecutionBlockWithOutSignal{constructor(t){super(t),this.count=this.registerDataOutput("count",e.RichTypeNumber),this.reset=this._registerSignalInput("reset")}_execute(t,e){if(e===this.reset){t._setExecutionVariable(this,"count",0),this.count.setValue(0,t);return}let i=t._getExecutionVariable(this,"count",0)+1;t._setExecutionVariable(this,"count",i),this.count.setValue(i,t),this.out._activateSignal(t)}getClassName(){return"FlowGraphCallCounterBlock"}}let r=!1;t.s(["FlowGraphCallCounterBlock",0,o,"RegisterFlowGraphCounterBlock",0,function(){r||(r=!0,(0,s.RegisterClass)("FlowGraphCallCounterBlock",o))}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,23816,80713,e=>{"use strict";let t,r,s,i,a,o,n,u,l,h,c,_,f,m,p,g;var x,d,T,R,C,b,y,A=e.i(24617);(0,A.RegisterMathColor)(),e.s([],80713);var W=e.i(73403),w=e.i(5207),S=e.i(97991),B=e.i(10977),E=e.i(63044),M=e.i(13279),v=e.i(80603),D=e.i(93414),G=e.i(17814);class I{constructor(e){this.name=E.SceneComponentConstants.NAME_PROCEDURALTEXTURE,this.scene=e}register(){this.scene._beforeClearStage.registerStep(E.SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE,this,this._beforeClear)}rebuild(){}dispose(){}_beforeClear(){if(this.scene.proceduralTexturesEnabled){G.Tools.StartPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0);for(let e=0;e<this.scene.proceduralTextures.length;e++){let t=this.scene.proceduralTextures[e];t._shouldRender()&&t.render()}G.Tools.EndPerformanceCounter("Procedural textures",this.scene.proceduralTextures.length>0)}}}var O=e.i(71829),k=e.i(61133);let F=(o=v.Texture,n=[],u=[],l=[],h=[],c=[],_=[],f=[],m=[],p=[],x=class extends o{get shaderLanguage(){return this._shaderLanguage}constructor(e,t,r,s,i=null,a=!0,o=!1,g=0){super(null,s,!a),this.isEnabled=((0,W.__runInitializers)(this,n),(0,W.__runInitializers)(this,u,!0)),this.autoClear=((0,W.__runInitializers)(this,l),(0,W.__runInitializers)(this,h,!0)),this.onGenerated=(0,W.__runInitializers)(this,c),this.onGeneratedObservable=new S.Observable,this.onBeforeGenerationObservable=new S.Observable,this.nodeMaterialSource=null,this.defines="",this._generateMipMaps=(0,W.__runInitializers)(this,_,void 0),this._drawWrapper=(0,W.__runInitializers)(this,f),this._textures={},this._size=(0,W.__runInitializers)(this,m,void 0),this._textureType=(0,W.__runInitializers)(this,p),this._currentRefreshId=-1,this._frameId=-1,this._refreshRate=1,this._vertexBuffers={},this._uniforms=[],this._samplers=[],this._floats={},this._ints={},this._floatsArrays={},this._colors3={},this._colors4={},this._vectors2={},this._vectors3={},this._vectors4={},this._matrices={},this._fallbackTextureUsed=!1,this._cachedDefines=null,this._contentUpdateId=-1,this._rtWrapper=null,null===i||i instanceof v.Texture?(this._options={},this._fallbackTexture=i):(this._options=i,this._fallbackTexture=i.fallbackTexture??null),this._shaderLanguage=this._options.shaderLanguage??0;let x=(s=this.getScene()||O.EngineStore.LastCreatedScene)._getComponent(E.SceneComponentConstants.NAME_PROCEDURALTEXTURE);x||(x=new I(s),s._addComponent(x)),this._options.skipSceneRegistration||s.proceduralTextures.push(this),this._fullEngine=s.getEngine(),this.name=e,this.isRenderTarget=!0,this._size=t,this._textureType=g,this._generateMipMaps=a,this._drawWrapper=new k.DrawWrapper(this._fullEngine),this.setFragment(r);const d=this._createRtWrapper(o,t,a,g);this._texture=d.texture;const T=[];T.push(1,1),T.push(-1,1),T.push(-1,-1),T.push(1,-1),this._vertexBuffers[B.VertexBuffer.PositionKind]=new B.VertexBuffer(this._fullEngine,T,B.VertexBuffer.PositionKind,!1,!1,2),this._createIndexBuffer()}_createRtWrapper(e,t,r,s){return e?(this._rtWrapper=this._fullEngine.createRenderTargetCubeTexture(t,{generateMipMaps:r,generateDepthBuffer:!1,generateStencilBuffer:!1,type:s,...this._options}),this.setFloat("face",0)):(this._rtWrapper=this._fullEngine.createRenderTargetTexture(t,{generateMipMaps:r,generateDepthBuffer:!1,generateStencilBuffer:!1,type:s,...this._options}),this._rtWrapper.is3D&&(this.setFloat("layer",0),this.setInt("layerNum",0))),this._rtWrapper}getEffect(){return this._drawWrapper.effect}_setEffect(e){this._drawWrapper.effect=e}getContent(){return this._contentData&&this._frameId===this._contentUpdateId||(this._contentData?this._contentData.then(e=>{this._contentData=this.readPixels(0,0,e),this._contentUpdateId=this._frameId}):(this._contentData=this.readPixels(0,0),this._contentUpdateId=this._frameId)),this._contentData}_createIndexBuffer(){let e=this._fullEngine,t=[];t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),this._indexBuffer=e.createIndexBuffer(t)}_rebuild(){let e=this._vertexBuffers[B.VertexBuffer.PositionKind];e&&e._rebuild(),this._createIndexBuffer(),this.refreshRate===D.RenderTargetTexture.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=D.RenderTargetTexture.REFRESHRATE_RENDER_ONCE)}reset(){this._drawWrapper.effect?.dispose(),this._drawWrapper.effect=null,this._cachedDefines=null}_getDefines(){return this.defines}executeWhenReady(e){if(this.isReady())return void e(this);let t=this.getEffect();t&&t.executeWhenCompiled(()=>{e(this)})}isReady(){let t=this._fullEngine;if(this.nodeMaterialSource)return this._drawWrapper.effect?.isReady()??!1;if(!this._fragment)return!1;if(this._fallbackTextureUsed)return!0;if(!this._texture)return!1;let r=this._getDefines();if(this._drawWrapper.effect&&r===this._cachedDefines&&this._drawWrapper.effect.isReady())return!0;let s={vertex:"procedural",fragmentElement:this._fragment.fragmentElement,fragmentSource:this._fragment.fragmentSource,fragment:"string"==typeof this._fragment?this._fragment:void 0};return this._cachedDefines!==r&&(this._cachedDefines=r,this._drawWrapper.effect=t.createEffect(s,[B.VertexBuffer.PositionKind],this._uniforms,this._samplers,r,void 0,void 0,()=>{this._rtWrapper?.dispose(),this._rtWrapper=this._texture=null,this._fallbackTexture&&(this._texture=this._fallbackTexture._texture,this._texture&&this._texture.incrementReferences()),this._fallbackTextureUsed=!0},void 0,this._shaderLanguage,async()=>{this._options.extraInitializationsAsync?1===this.shaderLanguage?await Promise.all([e.A(11089),this._options.extraInitializationsAsync()]):await Promise.all([e.A(23928),this._options.extraInitializationsAsync()]):1===this.shaderLanguage?await e.A(11089):await e.A(23928)})),this._drawWrapper.effect.isReady()}resetRefreshCounter(){this._currentRefreshId=-1}setFragment(e){this._fragment=e}get refreshRate(){return this._refreshRate}set refreshRate(e){this._refreshRate=e,this.resetRefreshCounter()}_shouldRender(){return this.isEnabled&&this.isReady()&&this._texture?!this._fallbackTextureUsed&&(-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,this._frameId++,!0):(this._currentRefreshId++,!1)):(this._texture&&(this._texture.isReady=!1),!1)}getRenderSize(){return this._size}resize(e,t){if(this._fallbackTextureUsed||!this._rtWrapper||!this._texture)return;let r=this._texture.isCube;this._rtWrapper.dispose();let s=this._createRtWrapper(r,e,t,this._textureType);this._texture=s.texture,this._size=e,this._generateMipMaps=t}_checkUniform(e){-1===this._uniforms.indexOf(e)&&this._uniforms.push(e)}setTexture(e,t){return -1===this._samplers.indexOf(e)&&this._samplers.push(e),this._textures[e]=t,this}setFloat(e,t){return this._checkUniform(e),this._floats[e]=t,this}setInt(e,t){return this._checkUniform(e),this._ints[e]=t,this}setFloats(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this}setColor3(e,t){return this._checkUniform(e),this._colors3[e]=t,this}setColor4(e,t){return this._checkUniform(e),this._colors4[e]=t,this}setVector2(e,t){return this._checkUniform(e),this._vectors2[e]=t,this}setVector3(e,t){return this._checkUniform(e),this._vectors3[e]=t,this}setVector4(e,t){return this._checkUniform(e),this._vectors4[e]=t,this}setMatrix(e,t){return this._checkUniform(e),this._matrices[e]=t,this}render(e){let t=this.getScene();if(!t)return;let r=this._fullEngine;if(r.enableEffect(this._drawWrapper),this.onBeforeGenerationObservable.notifyObservers(this),r.setState(!1),!this.nodeMaterialSource){for(let e in this._textures)this._drawWrapper.effect.setTexture(e,this._textures[e]);for(let e in this._ints)this._drawWrapper.effect.setInt(e,this._ints[e]);for(let e in this._floats)this._drawWrapper.effect.setFloat(e,this._floats[e]);for(let e in this._floatsArrays)this._drawWrapper.effect.setArray(e,this._floatsArrays[e]);for(let e in this._colors3)this._drawWrapper.effect.setColor3(e,this._colors3[e]);for(let e in this._colors4){let t=this._colors4[e];this._drawWrapper.effect.setFloat4(e,t.r,t.g,t.b,t.a)}for(let e in this._vectors2)this._drawWrapper.effect.setVector2(e,this._vectors2[e]);for(let e in this._vectors3)this._drawWrapper.effect.setVector3(e,this._vectors3[e]);for(let e in this._vectors4)this._drawWrapper.effect.setVector4(e,this._vectors4[e]);for(let e in this._matrices)this._drawWrapper.effect.setMatrix(e,this._matrices[e])}if(!this._texture||!this._rtWrapper)return;r._enableGPUDebugMarkers&&r._debugPushGroup?.(`procedural texture generation for ${this.name}`);let s=r.currentViewport;if(this.isCube)for(let e=0;e<6;e++)r.bindFramebuffer(this._rtWrapper,e,void 0,void 0,!0),r.bindBuffers(this._vertexBuffers,this._indexBuffer,this._drawWrapper.effect),this._drawWrapper.effect.setFloat("face",e),this.autoClear&&r.clear(t.clearColor,!0,!1,!1),r.drawElementsType(M.Material.TriangleFillMode,0,6),r.unBindFramebuffer(this._rtWrapper,!0);else{let e=1;this._rtWrapper.is3D?e=this._rtWrapper.depth:this._rtWrapper.is2DArray&&(e=this._rtWrapper.layers);for(let s=0;s<e;s++){if(r.bindFramebuffer(this._rtWrapper,0,void 0,void 0,!0,0,s),r.bindBuffers(this._vertexBuffers,this._indexBuffer,this._drawWrapper.effect),this._rtWrapper.is3D||this._rtWrapper.is2DArray)for(let t in this._drawWrapper.effect?.setFloat("layer",1!==e?s/(e-1):0),this._drawWrapper.effect?.setInt("layerNum",s),this._textures)this._drawWrapper.effect.setTexture(t,this._textures[t]);this.autoClear&&r.clear(t.clearColor,!0,!1,!1),r.drawElementsType(M.Material.TriangleFillMode,0,6),r.unBindFramebuffer(this._rtWrapper,!this._generateMipMaps)}}s&&r.setViewport(s),this.isCube&&r.generateMipMapsForCubemap(this._texture,!0),r._enableGPUDebugMarkers&&r._debugPopGroup?.(),this.onGenerated&&this.onGenerated(),this.onGeneratedObservable.notifyObservers(this)}clone(){let e=this.getSize(),t=new x(this.name,e.width,this._fragment,this.getScene(),this._fallbackTexture,this._generateMipMaps);return t.hasAlpha=this.hasAlpha,t.level=this.level,t.coordinatesMode=this.coordinatesMode,t}dispose(){let e=this.getScene();if(!e)return;let t=e.proceduralTextures.indexOf(this);t>=0&&e.proceduralTextures.splice(t,1);let r=this._vertexBuffers[B.VertexBuffer.PositionKind];r&&(r.dispose(),this._vertexBuffers[B.VertexBuffer.PositionKind]=null),this._indexBuffer&&this._fullEngine._releaseBuffer(this._indexBuffer)&&(this._indexBuffer=null),this.onGeneratedObservable.clear(),this.onBeforeGenerationObservable.clear(),super.dispose()}},g="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0,t=[(0,w.serialize)()],r=[(0,w.serialize)()],s=[(0,w.serialize)()],i=[(0,w.serialize)()],a=[(0,w.serialize)()],(0,W.__esDecorate)(x,null,a,{kind:"getter",name:"refreshRate",static:!1,private:!1,access:{has:e=>"refreshRate"in e,get:e=>e.refreshRate},metadata:g},null,n),(0,W.__esDecorate)(null,null,t,{kind:"field",name:"isEnabled",static:!1,private:!1,access:{has:e=>"isEnabled"in e,get:e=>e.isEnabled,set:(e,t)=>{e.isEnabled=t}},metadata:g},u,l),(0,W.__esDecorate)(null,null,r,{kind:"field",name:"autoClear",static:!1,private:!1,access:{has:e=>"autoClear"in e,get:e=>e.autoClear,set:(e,t)=>{e.autoClear=t}},metadata:g},h,c),(0,W.__esDecorate)(null,null,s,{kind:"field",name:"_generateMipMaps",static:!1,private:!1,access:{has:e=>"_generateMipMaps"in e,get:e=>e._generateMipMaps,set:(e,t)=>{e._generateMipMaps=t}},metadata:g},_,f),(0,W.__esDecorate)(null,null,i,{kind:"field",name:"_size",static:!1,private:!1,access:{has:e=>"_size"in e,get:e=>e._size,set:(e,t)=>{e._size=t}},metadata:g},m,p),g&&Object.defineProperty(x,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g}),x);function z(e,t,r,s){let i={texture:e,factor:t};return r&&(i.channel=r),s&&(i.colorSpace=s),i}function P(e){return e.factor??new A.Color4(1,1,1,1)}function U(e){let t=0,r=512;for(let s of e)if(s.texture){let e=s.texture.getSize(),i=Math.max(e.width,e.height);i>t&&(t=i,r=e.width===e.height?i:e)}return r}function N(e){return!e.getTextureMatrix().isIdentity()}function L(e){if(e.length<=1)return!0;let t=e[0].getTextureMatrix();for(let r=1;r<e.length;r++)if(!t.equals(e[r].getTextureMatrix()))return!1;return!0}function V(e,t,r){t.coordinatesIndex=e.coordinatesIndex,t.wrapU=e.wrapU,t.wrapV=e.wrapV,r&&(t.uOffset=e.uOffset??0,t.vOffset=e.vOffset??0,t.uScale=e.uScale??1,t.vScale=e.vScale??1,t.wAng=e.wAng??0)}function K(e){switch(e){case y.R:return"R";case y.G:return"G";case y.B:return"B";case y.A:return"A";default:return""}}function X(e){let t=[];return e&b.R||t.push("OUTPUT_MASK_R_ZERO"),e&b.G||t.push("OUTPUT_MASK_G_ZERO"),e&b.B||t.push("OUTPUT_MASK_B_ZERO"),e&b.A||t.push("OUTPUT_MASK_A_ONE"),t}function $(e,t){return new A.Color4(t&b.R?e.r:0,t&b.G?e.g:0,t&b.B?e.b:0,t&b.A?e.a:1)}function H(e,t,r){let s=[];return e.texture&&(s.push(`OPERAND_${t}_TEXTURE`),r&&N(e.texture)&&s.push(`OPERAND_${t}_MATRIX`),e.colorSpace&&s.push(`OPERAND_${t}_SRGB`),e.channel&&s.push(`OPERAND_${t}_CHANNEL_${K(e.channel)}`)),void 0===e.factor&&e.texture||s.push(`OPERAND_${t}_FACTOR`),s}function j(e,t,r,s,i){t.texture&&(e.setTexture(r,t.texture),i&&N(t.texture)&&e.setMatrix(`${r}Matrix`,t.texture.getTextureMatrix())),void 0===t.factor&&t.texture||e.setColor4(s,P(t))}function q(t,r,s,i,a=C.Linear){let o={type:0,format:5,samplingMode:2,generateDepthBuffer:!1,generateMipMaps:!1,gammaSpace:a===C.SRGB,shaderLanguage:+!!i.getEngine().isWebGPU,extraInitializationsAsync:async()=>{i.getEngine().isWebGPU?await Promise.all([e.A(44713)]):await Promise.all([e.A(9242)])},skipSceneRegistration:!0},n=new F(t,s,"textureProcessor",i,o);return n.refreshRate=-1,n.defines=r.length>0?"#define "+r.join("\n#define ")+"\n":"",n}async function Z(e){return await new Promise((t,r)=>{e.executeWhenReady(()=>{try{e.render(),t()}catch(e){r(e instanceof Error?e:Error(String(e)))}})})}async function J(e,t,r,s,i,a){if(!t.texture&&!r.texture){var o,n;let e=(o=P(t),n=P(r),new A.Color4(o.r*n.r,o.g*n.g,o.b*n.b,o.a*n.a));return{texture:null,factor:a?$(e,a):e}}let u=[];t.texture&&u.push(t.texture),r.texture&&u.push(r.texture);let l=L(u),h=!l,c=[...H(t,"A",h),...H(r,"B",h),...a?X(a):[]];i&&c.push("OUTPUT_SRGB");let _=q(e,c,U([t,r]),s,i);j(_,t,"textureA","factorA",h),j(_,r,"textureB","factorB",h);try{await Z(_)}catch(e){throw t.dispose?.(),r.dispose?.(),e}t.dispose?.(),r.dispose?.(),V(u[0],_,l);let f={texture:_,dispose:()=>_.dispose()};return i&&(f.colorSpace=i),f}async function Q(e,t,r,s,i,a,o){var n,u,l;let h;if(!t.texture&&!r.texture&&!s.texture){let e=(n=P(t),u=P(r),l=P(s),new A.Color4(n.r+(u.r-n.r)*l.r,n.g+(u.g-n.g)*l.g,n.b+(u.b-n.b)*l.b,n.a+(u.a-n.a)*l.a));return{texture:null,factor:o?$(e,o):e}}let c=[];t.texture&&c.push(t.texture),r.texture&&c.push(r.texture),s.texture&&c.push(s.texture);let _=L(c),f=!_,m=["OP_LERP",...H(t,"A",f),...H(r,"B",f),...(h=[],s.texture&&(h.push("LERP_T_TEXTURE"),f&&N(s.texture)&&h.push("LERP_T_MATRIX"),void 0!==s.factor&&h.push("LERP_T_FACTOR"),s.colorSpace&&h.push("LERP_T_SRGB"),s.channel&&h.push(`LERP_T_CHANNEL_${K(s.channel)}`)),h),...o?X(o):[]];a&&m.push("OUTPUT_SRGB");let p=q(e,m,U([t,r,s]),i,a);j(p,t,"textureA","factorA",f),j(p,r,"textureB","factorB",f),s.texture?(p.setTexture("textureT",s.texture),f&&N(s.texture)&&p.setMatrix("textureTMatrix",s.texture.getTextureMatrix()),void 0!==s.factor&&p.setColor4("factorT",s.factor)):p.setColor4("factorT",P(s));try{await Z(p)}catch(e){throw t.dispose?.(),r.dispose?.(),s.dispose?.(),e}t.dispose?.(),r.dispose?.(),s.dispose?.(),V(c[0],p,_);let g={texture:p,dispose:()=>p.dispose()};return a&&(g.colorSpace=a),g}async function Y(e,t,r,s=b.RGBA,i,a){let o;if(!t.texture){let e=P(t),r=new A.Color4(s&b.R?1-e.r:e.r,s&b.G?1-e.g:e.g,s&b.B?1-e.b:e.b,s&b.A?1-e.a:e.a);return{texture:null,factor:a?$(r,a):r}}let n=[...H(t,"A",!1),...(o=["OP_INVERT"],s&b.R&&o.push("INVERT_R"),s&b.G&&o.push("INVERT_G"),s&b.B&&o.push("INVERT_B"),s&b.A&&o.push("INVERT_A"),o),...a?X(a):[]];i&&n.push("OUTPUT_SRGB");let u=q(e,n,U([t]),r,i);j(u,t,"textureA","factorA",!1);try{await Z(u)}catch(e){throw t.dispose?.(),e}t.dispose?.(),V(t.texture,u,!0);let l={texture:u,dispose:()=>u.dispose()};return i&&(l.colorSpace=i),l}async function ee(e,t,r,s=!1,i,a){if(!t.texture){let e=P(t),r=s?Math.max(e.r,e.g,e.b,e.a):Math.max(e.r,e.g,e.b),i=new A.Color4(r,r,r,s?r:e.a);return{texture:null,factor:a?$(i,a):i}}let o=[...H(t,"A",!1),"OP_CHANNEL_MAX",...a?X(a):[]];s&&o.push("CHANNEL_MAX_INCLUDE_ALPHA"),i&&o.push("OUTPUT_SRGB");let n=q(e,o,U([t]),r,i);j(n,t,"textureA","factorA",!1);try{await Z(n)}catch(e){throw t.dispose?.(),e}t.dispose?.(),V(t.texture,n,!0);let u={texture:n,dispose:()=>n.dispose()};return i&&(u.colorSpace=i),u}async function et(e,t,r,s,i,a){if(!t.texture){let e=function(e,t){switch(t){case y.R:return new A.Color4(e.r,e.r,e.r,e.a);case y.G:return new A.Color4(e.g,e.g,e.g,e.a);case y.B:return new A.Color4(e.b,e.b,e.b,e.a);case y.A:return new A.Color4(e.a,e.a,e.a,e.a);default:return e}}(P(t),r);return{texture:null,factor:a?$(e,a):e}}return await J(e,{...t,channel:r},{texture:null,factor:new A.Color4(1,1,1,1)},s,i,a)}(d=C||(C={}))[d.Linear=0]="Linear",d[d.SRGB=1]="SRGB",(T=b||(b={}))[T.R=1]="R",T[T.G=2]="G",T[T.B=4]="B",T[T.A=8]="A",T[T.RGB=7]="RGB",T[T.RGBA=15]="RGBA",(R=y||(y={}))[R.RGBA=0]="RGBA",R[R.R=1]="R",R[R.G=2]="G",R[R.B=3]="B",R[R.A=4]="A",e.s(["OpenPBRMaterialLoadingAdapter",0,class{constructor(e){this._specWorkflow=!1,this._diffuseTransmissionTint=A.Color3.White(),this._diffuseTransmissionTintTexture=null,this._material=e}get material(){return this._material}get isUnlit(){return this._material.unlit}set isUnlit(e){this._material.unlit=e}set backFaceCulling(e){this._material.backFaceCulling=e}get backFaceCulling(){return this._material.backFaceCulling}set twoSidedLighting(e){this._material.twoSidedLighting=e}get twoSidedLighting(){return this._material.twoSidedLighting}set alphaCutOff(e){this._material.alphaCutOff=e}get alphaCutOff(){return this._material.alphaCutOff}set useAlphaFromBaseColorTexture(e){this._material._useAlphaFromBaseColorTexture=e}get useAlphaFromBaseColorTexture(){return this._material._useAlphaFromBaseColorTexture}get transparencyAsAlphaCoverage(){return!1}set transparencyAsAlphaCoverage(e){}set baseColor(e){this._material.baseColor=e}get baseColor(){return this._material.baseColor}set baseColorTexture(e){this._material.baseColorTexture=e}get baseColorTexture(){return this._material.baseColorTexture}set baseDiffuseRoughness(e){this._material.baseDiffuseRoughness=e}get baseDiffuseRoughness(){return this._material.baseDiffuseRoughness}set baseDiffuseRoughnessTexture(e){this._material.baseDiffuseRoughnessTexture=e}get baseDiffuseRoughnessTexture(){return this._material.baseDiffuseRoughnessTexture}set baseMetalness(e){this._material.baseMetalness=e}get baseMetalness(){return this._material.baseMetalness}set baseMetalnessTexture(e){this._material.baseMetalnessTexture=e}get baseMetalnessTexture(){return this._material.baseMetalnessTexture}set useRoughnessFromMetallicTextureGreen(e){this._material._useRoughnessFromMetallicTextureGreen=e}set useMetallicFromMetallicTextureBlue(e){this._material._useMetallicFromMetallicTextureBlue=e}enableSpecularEdgeColor(e=!1){}configureSpecularGlossiness(){this._specWorkflow=!0}set specularWeight(e){this._material.specularWeight=e}get specularWeight(){return this._material.specularWeight}set specularWeightTexture(e){this._material.specularColorTexture===e?(this._material.specularWeightTexture=null,this._material._useSpecularWeightFromSpecularColorTexture=!0,this._material._useSpecularWeightFromAlpha=!0):this._material.specularWeightTexture=e}get specularWeightTexture(){return this._material.specularWeightTexture}set specularColor(e){this._material.specularColor=e}get specularColor(){return this._material.specularColor}set specularColorTexture(e){this._material.specularColorTexture=e,this._material.specularWeightTexture===this._material.specularColorTexture&&(this._material.specularWeightTexture=null,this._material._useSpecularWeightFromSpecularColorTexture=!0,this._material._useSpecularWeightFromAlpha=!0)}get specularColorTexture(){return this._material.specularColorTexture}set specularRoughness(e){this._material.specularRoughness=e}get specularRoughness(){return this._material.specularRoughness}set specularRoughnessTexture(e){this._material.specularRoughnessTexture=e}get specularRoughnessTexture(){return this._material.specularRoughnessTexture}set specularIor(e){this._material.specularIor=e}get specularIor(){return this._material.specularIor}set glossiness(e){this._material.specularRoughness=Math.max(1-e,0)}get glossiness(){return 1-this._material.specularRoughness}set emissionColor(e){this._material.emissionColor=e}get emissionColor(){return this._material.emissionColor}set emissionLuminance(e){this._material.emissionLuminance=e}get emissionLuminance(){return this._material.emissionLuminance}set emissionColorTexture(e){this._material.emissionColorTexture=e}get emissionColorTexture(){return this._material.emissionColorTexture}set ambientOcclusionTexture(e){this._material.ambientOcclusionTexture=e}get ambientOcclusionTexture(){return this._material.ambientOcclusionTexture}set ambientOcclusionTextureStrength(e){let t=this._material.ambientOcclusionTexture;t&&(t.level=e)}get ambientOcclusionTextureStrength(){let e=this._material.ambientOcclusionTexture;return e?.level??1}configureCoat(){}set coatWeight(e){this._material.coatWeight=e}get coatWeight(){return this._material.coatWeight}set coatWeightTexture(e){this._material.coatWeightTexture=e}get coatWeightTexture(){return this._material.coatWeightTexture}set coatColor(e){this._material.coatColor=e}get coatColor(){return this._material.coatColor}set coatColorTexture(e){this._material.coatColorTexture=e}set coatRoughness(e){this._material.coatRoughness=e}get coatRoughness(){return this._material.coatRoughness}set coatRoughnessTexture(e){this._material.coatRoughnessTexture=e,e&&(this._material._useCoatRoughnessFromGreenChannel=!0)}get coatRoughnessTexture(){return this._material.coatRoughnessTexture}set coatIor(e){this._material.coatIor=e}get coatIor(){return this._material.coatIor}set coatDarkening(e){this._material.coatDarkening=e}get coatDarkening(){return this._material.coatDarkening}set coatDarkeningTexture(e){this._material.coatDarkeningTexture=e}set coatRoughnessAnisotropy(e){this._material.coatRoughnessAnisotropy=e}get coatRoughnessAnisotropy(){return this._material.coatRoughnessAnisotropy}set geometryCoatTangentAngle(e){this._material.geometryCoatTangentAngle=e}set geometryCoatTangentTexture(e){this._material.geometryCoatTangentTexture=e,e&&(this._material._useCoatRoughnessAnisotropyFromTangentTexture=!0)}get geometryCoatTangentTexture(){return this._material.geometryCoatTangentTexture}configureTransmission(){this._material.geometryThinWalled=1,this._material.transmissionDepth=0}set transmissionWeight(e){this._material.transmissionWeight=e}set transmissionWeightTexture(e){this._material.transmissionWeightTexture=e}get transmissionWeightTexture(){return this._material.transmissionWeightTexture}get transmissionWeight(){return this._material.transmissionWeight}set transmissionScatter(e){this._material.transmissionScatter=e}get transmissionScatter(){return this._material.transmissionScatter}set transmissionScatterTexture(e){this._material.transmissionScatterTexture=e}get transmissionScatterTexture(){return this._material.transmissionScatterTexture}set transmissionScatterAnisotropy(e){this._material.transmissionScatterAnisotropy=e}set transmissionDispersionAbbeNumber(e){this._material.transmissionDispersionAbbeNumber=e}set transmissionDispersionScale(e){this._material.transmissionDispersionScale=e}set transmissionDepth(e){e!==Number.MAX_VALUE||0!==this._material.transmissionDepth?this._material.transmissionDepth=e:this._material.transmissionDepth=0}get transmissionDepth(){return this._material.transmissionDepth}set transmissionColor(e){e.equals(A.Color3.White())||(this._material.transmissionColor=e)}get transmissionColor(){return this._material.transmissionColor}get refractionBackgroundTexture(){return this._material.backgroundRefractionTexture}set refractionBackgroundTexture(e){this._material.backgroundRefractionTexture=e}configureVolume(){this._material.geometryThinWalled=0}set geometryThinWalled(e){this._material.geometryThinWalled=+!!e}get geometryThinWalled(){return!!this._material.geometryThinWalled}set volumeThicknessTexture(e){this._material.geometryThicknessTexture=e,this._material._useGeometryThicknessFromGreenChannel=!0}set volumeThickness(e){this._material.geometryThickness=e}configureSubsurface(){this._material.geometryThinWalled=1,this._material.subsurfaceScatterAnisotropy=1}set subsurfaceWeight(e){this._material.subsurfaceWeight=e}get subsurfaceWeight(){return this._material.subsurfaceWeight}set subsurfaceWeightTexture(e){this._material.subsurfaceWeightTexture=e,this._material._useSubsurfaceWeightFromTextureAlpha=!0}get subsurfaceWeightTexture(){return this._material.subsurfaceWeightTexture}set subsurfaceColor(e){this._material.subsurfaceColor=e}set subsurfaceColorTexture(e){this._material.subsurfaceColorTexture=e}set diffuseTransmissionTint(e){this._diffuseTransmissionTint=e}get diffuseTransmissionTint(){return this._diffuseTransmissionTint}set diffuseTransmissionTintTexture(e){this._diffuseTransmissionTintTexture=e}get subsurfaceRadius(){return this._material.subsurfaceRadius}set subsurfaceRadius(e){this._material.subsurfaceRadius=e}get subsurfaceRadiusScale(){return this._material.subsurfaceRadiusScale}set subsurfaceRadiusScale(e){this._material.subsurfaceRadiusScale=e}set subsurfaceScatterAnisotropy(e){this._material.subsurfaceScatterAnisotropy=e}isTranslucent(){return this.transmissionWeight>0||this.subsurfaceWeight>0}configureFuzz(){}set fuzzWeight(e){this._material.fuzzWeight=e}set fuzzWeightTexture(e){this._material.fuzzWeightTexture=e}set fuzzColor(e){this._material.fuzzColor=e}set fuzzColorTexture(e){this._material.fuzzColorTexture=e}set fuzzRoughness(e){this._material.fuzzRoughness=e}set fuzzRoughnessTexture(e){this._material.fuzzRoughnessTexture=e,this._material._useFuzzRoughnessFromTextureAlpha=!0}set specularRoughnessAnisotropy(e){this._material.specularRoughnessAnisotropy=e}get specularRoughnessAnisotropy(){return this._material.specularRoughnessAnisotropy}set geometryTangentAngle(e){this._material.geometryTangentAngle=e}set geometryTangentTexture(e){this._material.geometryTangentTexture=e,this._material._useSpecularRoughnessAnisotropyFromTangentTexture=!0}get geometryTangentTexture(){return this._material.geometryTangentTexture}configureGltfStyleAnisotropy(e=!0){this._material._useGltfStyleAnisotropy=e}set thinFilmWeight(e){this._material.thinFilmWeight=e}set thinFilmIor(e){this._material.thinFilmIor=e}set thinFilmThicknessMinimum(e){this._material.thinFilmThicknessMin=e/1e3}set thinFilmThicknessMaximum(e){this._material.thinFilmThickness=e/1e3}set thinFilmWeightTexture(e){this._material.thinFilmWeightTexture=e}set thinFilmThicknessTexture(e){this._material.thinFilmThicknessTexture=e,this._material._useThinFilmThicknessFromTextureGreen=!0}set unlit(e){this._material.unlit=e}set geometryOpacity(e){this._material.geometryOpacity=e}get geometryOpacity(){return this._material.geometryOpacity}set geometryNormalTexture(e){this._material.geometryNormalTexture=e}get geometryNormalTexture(){return this._material.geometryNormalTexture}setNormalMapInversions(e,t){}set geometryCoatNormalTexture(e){this._material.geometryCoatNormalTexture=e}get geometryCoatNormalTexture(){return this._material.geometryCoatNormalTexture}set geometryCoatNormalTextureScale(e){this._material.geometryCoatNormalTexture&&(this._material.geometryCoatNormalTexture.level=e)}async finalizeAsync(e){if(this._diffuseTransmissionTint&&!this._diffuseTransmissionTint.equals(A.Color3.White())||this._diffuseTransmissionTintTexture){if(this._material.geometryThinWalled)this.subsurfaceColor=this._diffuseTransmissionTint,this.subsurfaceColorTexture=this._diffuseTransmissionTintTexture;else if(await this.copySurfaceToCoatAsync(e,this.subsurfaceWeight,this.subsurfaceWeightTexture,y.A,this._diffuseTransmissionTint,this._diffuseTransmissionTintTexture,!0),e._disposed)return}if(this.transmissionWeight>0){if(this._material.geometryThinWalled||0===this._material.transmissionDepth)this._material.transmissionColor=this._material.baseColor,this._material.transmissionColorTexture=this._material.baseColorTexture;else if((!this.baseColor.equals(A.Color3.White())||null!==this.baseColorTexture)&&(await this.copySurfaceToCoatAsync(e,this.transmissionWeight,this.transmissionWeightTexture,y.R,this.baseColor,this.baseColorTexture,!1),e._disposed))return}if(this._specWorkflow){let t=await Y("newRoughnessTexture ("+this._material.name+")",await et("glossiness ("+this._material.name+")",z(this.specularColorTexture,new A.Color4(this.specularColor.r,this.specularColor.g,this.specularColor.b,this.glossiness),y.A,C.Linear),y.A,this._material.getScene(),C.Linear,b.R),this._material.getScene(),b.R,C.Linear,b.R);if(e._disposed)return void t.texture?.dispose();this.specularRoughnessTexture=t.texture,this.specularRoughness=t.factor?t.factor.r:1;let r=await ee("metallicTexture ("+this._material.name+")",z(this.specularColorTexture,this.specularColor.toColor4(),y.RGBA,C.Linear),this._material.getScene(),!1,C.SRGB,b.RGB);if(e._disposed)return void r.texture?.dispose();this.baseMetalnessTexture=r.texture,this.baseMetalness=r.factor?r.factor.r:1;let s=await Q("newBaseColor ("+this._material.name+")",z(this.baseColorTexture,this.baseColor.toColor4(),y.RGBA,C.Linear),z(this.specularColorTexture,this.specularColor.toColor4(),y.RGBA,C.Linear),{...r,dispose:void 0,colorSpace:C.Linear},this._material.getScene(),C.SRGB,b.RGB);if(e._disposed)return void s.texture?.dispose();let i=this.baseColorTexture;i?.dispose(),this.baseColorTexture=s.texture,this.baseColor=s.factor?new A.Color3(s.factor.r,s.factor.g,s.factor.b):A.Color3.White();let a=this.specularColorTexture;a?.dispose(),this.specularColorTexture=null}}async copySurfaceToCoatAsync(e,t,r,s,i,a,o=!1){let n=this._material.coatWeight,u=this._material.coatWeightTexture,l=this._material.coatColor.clone(),h=this._material.coatColorTexture,c=this._material.geometryCoatNormalTexture,_=new A.Color4(n,n,n,n),f=new A.Color4(t,t,t,t);this.coatWeightTexture=null,this.coatWeight=1;let m=await Promise.allSettled([Q("lerpExistingCoat",z(null,new A.Color4(1,1,1,1)),z(h,l.toColor4(),y.RGBA,C.SRGB),z(u,_,y.R),this._material.getScene(),C.SRGB),Q("lerpSurfaceColor",z(null,new A.Color4(1,1,1,1)),z(a,i.toColor4(),y.RGBA,C.SRGB),z(r,f,s),this._material.getScene(),C.SRGB)]),p=m.find(e=>"rejected"===e.status);if(p){for(let e of m)"fulfilled"===e.status&&e.value.texture?.dispose();throw p.reason}let[g,x]=m.map(e=>e.value);if(e._disposed){g.texture?.dispose(),x.texture?.dispose();return}let d=await J("newCoatColor ("+this._material.name+")",g,x,this._material.getScene(),C.SRGB);if(e._disposed)return void d.texture?.dispose();d.texture?(this.coatColorTexture=d.texture,this.coatColor=A.Color3.White()):d.factor&&(this.coatColorTexture=null,this.coatColor.fromArray([d.factor.r,d.factor.g,d.factor.b]));let T=await Q("newCoatIor ("+this._material.name+")",z(null,new A.Color4(this._material.specularIor,this._material.specularIor,this._material.specularIor,1),y.R),z(null,new A.Color4(this.coatIor,this.coatIor,this.coatIor,1),y.R),z(u,_,y.R),this._material.getScene());if(e._disposed)return void T.texture?.dispose();this.coatIor=T.factor?T.factor.r:this.coatIor;let R=await Q("newCoatRoughness ("+this._material.name+")",z(this.specularRoughnessTexture,new A.Color4(this.specularRoughness,this.specularRoughness,this.specularRoughness,1),y.G),z(this.coatRoughnessTexture,new A.Color4(this.coatRoughness,this.coatRoughness,this.coatRoughness,1),y.G),z(u,_,y.R),this._material.getScene());if(e._disposed)return void R.texture?.dispose();this.coatRoughness=R.factor?R.factor.r:1,this.coatRoughnessTexture=R.texture;let b=await Q("newCoatDarkening ("+this._material.name+")",z(null,new A.Color4(0,0,0,1),y.R),z(null,new A.Color4(this.coatDarkening,this.coatDarkening,this.coatDarkening,1),y.R),z(u,_,y.R),this._material.getScene());if(e._disposed)return void b.texture?.dispose();if(this.coatDarkening=b.factor?b.factor.r:this.coatDarkening,o){let t=await Q("newSpecularRoughness ("+this._material.name+")",z(this.specularRoughnessTexture,new A.Color4(this._material.specularRoughness,this._material.specularRoughness,this._material.specularRoughness,1),y.G),z(null,new A.Color4(1,1,1,1),y.R),z(r,f,s),this._material.getScene());if(e._disposed)return void t.texture?.dispose();this.specularRoughness=t.factor?t.factor.r:1,this.specularRoughnessTexture=t.texture}if(c||this.geometryNormalTexture){let t=await Q("newCoatNormal ("+this._material.name+")",z(this.geometryNormalTexture,this.geometryNormalTexture?new A.Color4(1,1,1,1):new A.Color4(.5,.5,1,1),y.RGBA),z(c,c?new A.Color4(1,1,1,1):new A.Color4(.5,.5,1,1),y.RGBA),z(u,_,y.R),this._material.getScene());if(e._disposed)return void t.texture?.dispose();t.texture&&(this.geometryCoatNormalTexture=t.texture)}}}],23816)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89438,t=>{"use strict";var e=t.i(20552),i=t.i(97009),o=t.i(99493);class r extends e.FlowGraphExecutionBlockWithOutSignal{constructor(t){super(t),this.config=t,this.object=this.registerDataInput("object",i.RichTypeAny,t.target),this.value=this.registerDataInput("value",i.RichTypeAny),this.propertyName=this.registerDataInput("propertyName",i.RichTypeString,t.propertyName),this.customSetFunction=this.registerDataInput("customSetFunction",i.RichTypeAny)}_execute(t,e){try{let e=this.object.getValue(t),i=this.value.getValue(t),o=this.propertyName.getValue(t);this._stopRunningAnimations(t,e,o);let r=this.customSetFunction.getValue(t);r?r(e,o,i,t):this._setPropertyValue(e,o,i)}catch(e){this._reportError(t,e)}this.out._activateSignal(t)}_stopRunningAnimations(t,e,i){let o=t._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);for(let r of o){let n=t.assetsContext.animationGroups.find(t=>t.uniqueId===r);if(n){for(let s of n.targetedAnimations)if(s.target===e&&s.animation.targetProperty===i){n.stop(!0),n.dispose();let e=o.indexOf(r);-1!==e&&(o.splice(e,1),t._setGlobalContextVariable("currentlyRunningAnimationGroups",o))}}}}_setPropertyValue(t,e,i){let o=e.split("."),r=t;for(let t=0;t<o.length-1;t++){let e=o[t];void 0===r[e]&&(r[e]={}),r=r[e]}r[o[o.length-1]]=i}getClassName(){return"FlowGraphSetPropertyBlock"}}let n=!1;function s(){n||(n=!0,(0,o.RegisterClass)("FlowGraphSetPropertyBlock",r))}t.s(["FlowGraphSetPropertyBlock",0,r,"RegisterFlowGraphSetPropertyBlock",0,s],10827),s(),t.s([],4577),t.i(4577),t.i(10827),t.s(["FlowGraphSetPropertyBlock",0,r],89438)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,84131,t=>{"use strict";var e=t.i(23422),i=t.i(65678),o=t.i(68282);class r extends e.FlowGraphExecutionBlockWithOutSignal{constructor(t){super(t),this.config=t,this.object=this.registerDataInput("object",i.RichTypeAny,t.target),this.value=this.registerDataInput("value",i.RichTypeAny),this.propertyName=this.registerDataInput("propertyName",i.RichTypeString,t.propertyName),this.customSetFunction=this.registerDataInput("customSetFunction",i.RichTypeAny)}_execute(t,e){try{let e=this.object.getValue(t),i=this.value.getValue(t),o=this.propertyName.getValue(t);this._stopRunningAnimations(t,e,o);let r=this.customSetFunction.getValue(t);r?r(e,o,i,t):this._setPropertyValue(e,o,i)}catch(e){this._reportError(t,e)}this.out._activateSignal(t)}_stopRunningAnimations(t,e,i){let o=t._getGlobalContextVariable("currentlyRunningAnimationGroups",[]);for(let r of o){let n=t.assetsContext.animationGroups.find(t=>t.uniqueId===r);if(n){for(let s of n.targetedAnimations)if(s.target===e&&s.animation.targetProperty===i){n.stop(!0),n.dispose();let e=o.indexOf(r);-1!==e&&(o.splice(e,1),t._setGlobalContextVariable("currentlyRunningAnimationGroups",o))}}}}_setPropertyValue(t,e,i){let o=e.split("."),r=t;for(let t=0;t<o.length-1;t++){let e=o[t];void 0===r[e]&&(r[e]={}),r=r[e]}r[o[o.length-1]]=i}getClassName(){return"FlowGraphSetPropertyBlock"}}let n=!1;t.s(["FlowGraphSetPropertyBlock",0,r,"RegisterFlowGraphSetPropertyBlock",0,function(){n||(n=!0,(0,o.RegisterClass)("FlowGraphSetPropertyBlock",r))}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68987,e=>{"use strict";var t=e.i(56173),s=e.i(10977);e.s(["PickingInfo",0,class{constructor(){this.hit=!1,this.distance=0,this.pickedPoint=null,this.pickedMesh=null,this.bu=0,this.bv=0,this.faceId=-1,this.subMeshFaceId=-1,this.subMeshId=0,this.pickedSprite=null,this.thinInstanceIndex=-1,this.ray=null,this.originMesh=null,this.aimTransform=null,this.gripTransform=null}getNormal(e=!1,i=!0){let r;if(!this.pickedMesh||i&&!this.pickedMesh.isVerticesDataPresent(s.VertexBuffer.NormalKind))return null;let a=this.pickedMesh.getIndices();a?.length===0&&(a=null);let n=t.TmpVectors.Vector3[0],o=t.TmpVectors.Vector3[1],h=t.TmpVectors.Vector3[2];if(i){let e=this.pickedMesh.getVerticesData(s.VertexBuffer.NormalKind),i=a?t.Vector3.FromArrayToRef(e,3*a[3*this.faceId],n):n.copyFromFloats(e[3*this.faceId*3],e[3*this.faceId*3+1],e[3*this.faceId*3+2]),l=a?t.Vector3.FromArrayToRef(e,3*a[3*this.faceId+1],o):o.copyFromFloats(e[(3*this.faceId+1)*3],e[(3*this.faceId+1)*3+1],e[(3*this.faceId+1)*3+2]),c=a?t.Vector3.FromArrayToRef(e,3*a[3*this.faceId+2],h):h.copyFromFloats(e[(3*this.faceId+2)*3],e[(3*this.faceId+2)*3+1],e[(3*this.faceId+2)*3+2]);i=i.scale(this.bu),l=l.scale(this.bv),c=c.scale(1-this.bu-this.bv),r=new t.Vector3(i.x+l.x+c.x,i.y+l.y+c.y,i.z+l.z+c.z)}else{let e=this.pickedMesh.getVerticesData(s.VertexBuffer.PositionKind),i=a?t.Vector3.FromArrayToRef(e,3*a[3*this.faceId],n):n.copyFromFloats(e[3*this.faceId*3],e[3*this.faceId*3+1],e[3*this.faceId*3+2]),l=a?t.Vector3.FromArrayToRef(e,3*a[3*this.faceId+1],o):o.copyFromFloats(e[(3*this.faceId+1)*3],e[(3*this.faceId+1)*3+1],e[(3*this.faceId+1)*3+2]),c=a?t.Vector3.FromArrayToRef(e,3*a[3*this.faceId+2],h):h.copyFromFloats(e[(3*this.faceId+2)*3],e[(3*this.faceId+2)*3+1],e[(3*this.faceId+2)*3+2]),u=i.subtract(l),d=c.subtract(l);r=t.Vector3.Cross(u,d)}let l=(e,s)=>{if(-1!==this.thinInstanceIndex){let i=e._thinInstanceDataStorage.matrixData,r=this.thinInstanceIndex<<4;if(i&&i.length>r){let e=t.TmpVectors.Matrix[0];t.Matrix.FromArrayToRef(i,r,e),t.Vector3.TransformNormalToRef(s,e,s)}}let i=e.getWorldMatrix();e.nonUniformScaling&&(t.TmpVectors.Matrix[0].copyFrom(i),(i=t.TmpVectors.Matrix[0]).setTranslationFromFloats(0,0,0),i.invert(),i.transposeToRef(t.TmpVectors.Matrix[1]),i=t.TmpVectors.Matrix[1]),t.Vector3.TransformNormalToRef(s,i,s)};if(e&&l(this.pickedMesh,r),this.ray){let s=t.TmpVectors.Vector3[0].copyFrom(r);e||l(this.pickedMesh,s),t.Vector3.Dot(s,this.ray.direction)>0&&r.negateInPlace()}return r.normalize(),r}getTextureCoordinates(e=s.VertexBuffer.UVKind){if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(e))return null;let i=this.pickedMesh.getIndices();if(!i)return null;let r=this.pickedMesh.getVerticesData(e);if(!r)return null;let a=t.Vector2.FromArray(r,2*i[3*this.faceId]),n=t.Vector2.FromArray(r,2*i[3*this.faceId+1]),o=t.Vector2.FromArray(r,2*i[3*this.faceId+2]);return a=a.scale(this.bu),n=n.scale(this.bv),o=o.scale(1-this.bu-this.bv),new t.Vector2(a.x+n.x+o.x,a.y+n.y+o.y)}}])},40672,e=>{"use strict";e.s(["useOpenGLOrientationForUV",()=>!1])},95284,e=>{"use strict";var t,s;(s=t||(t={}))[s.PointerMove=0]="PointerMove",s[s.PointerDown=1]="PointerDown",s[s.PointerUp=2]="PointerUp";class i{}i.DOM_DELTA_PIXEL=0,i.DOM_DELTA_LINE=1,i.DOM_DELTA_PAGE=2,e.s(["EventConstants",0,i])},97021,e=>{"use strict";class t{}t.KEYDOWN=1,t.KEYUP=2;class s{constructor(e,t){this.type=e,this.event=t}}e.s(["KeyboardEventTypes",0,t,"KeyboardInfo",0,s,"KeyboardInfoPre",0,class extends s{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(e){this.skipOnKeyboardObservable=e}constructor(e,t){super(e,t),this.type=e,this.event=t,this.skipOnKeyboardObservable=!1}}])},84289,e=>{"use strict";var t=e.i(56173);class s{}s.POINTERDOWN=1,s.POINTERUP=2,s.POINTERMOVE=4,s.POINTERWHEEL=8,s.POINTERPICK=16,s.POINTERTAP=32,s.POINTERDOUBLETAP=64;class i{constructor(e,t){this.type=e,this.event=t}}e.s(["PointerEventTypes",0,s,"PointerInfo",0,class extends i{get pickInfo(){return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(e,t,s,i=null){super(e,t),this._pickInfo=s,this._inputManager=i}_generatePickInfo(){this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}},"PointerInfoPre",0,class extends i{constructor(e,s,i,r){super(e,s),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new t.Vector2(i,r)}}])},80603,21771,e=>{"use strict";let t,s,i,r,a,n,o,h,l,c,u,d,_,f,p,m,g,R,S,T,M,x,I,b,O,v,P,E,A,y,C,B,D,F,V,G,N,L,w,U;var z,k=e.i(73403),W=e.i(5207),q=e.i(97991),Y=e.i(56173),K=e.i(65042),j=e.i(68282),X=e.i(49399),Z=e.i(89435),H=e.i(93561),$=e.i(38450),J=e.i(64781);function Q(e,t,s=!1){let i=t.width,r=t.height;if(e instanceof Float32Array){let t=e.byteLength/e.BYTES_PER_ELEMENT,s=new Uint8Array(t);for(;--t>=0;){let i=e[t];i<0?i=0:i>1&&(i=1),s[t]=255*i}e=s}let a=document.createElement("canvas");a.width=i,a.height=r;let n=a.getContext("2d");if(!n)return null;let o=n.createImageData(i,r);if(o.data.set(e),n.putImageData(o,0,0),s){let e=document.createElement("canvas");e.width=i,e.height=r;let t=e.getContext("2d");return t?(t.translate(0,r),t.scale(1,-1),t.drawImage(a,0,0),e.toDataURL("image/png")):null}return a.toDataURL("image/png")}function ee(e,t=0,s=0){let i=e.getInternalTexture();if(!i)return null;let r=e._readPixelsSync(t,s);return r?Q(r,e.getSize(),i.invertY):null}async function et(e,t=0,s=0){let i=e.getInternalTexture();if(!i)return null;let r=await e.readPixels(t,s);return r?Q(r,e.getSize(),i.invertY):null}e.s(["GenerateBase64StringFromTexture",0,ee,"GenerateBase64StringFromTextureAsync",0,et],21771);var es=e.i(40672),ei=e.i(69552);let er=(f=K.BaseTexture,p=[],m=[],g=[],R=[],S=[],T=[],M=[],x=[],I=[],b=[],O=[],v=[],P=[],E=[],A=[],y=[],C=[],B=[],D=[],F=[],V=[],G=[],N=[],L=[],w=[],z=class extends f{static _CreateVideoTexture(e,t,s,i=!1,r=!1,a=z.TRILINEAR_SAMPLINGMODE,n={},o,h=5){throw(0,X._WarnImport)("VideoTexture")}get noMipmap(){return this._noMipmap}get mimeType(){return this._mimeType}set isBlocking(e){this._isBlocking=e}get isBlocking(){return this._isBlocking}get invertY(){return this._invertY}constructor(e,t,s,i,r=z.TRILINEAR_SAMPLINGMODE,a=null,n=null,o=null,h=!1,l,c,u,d,_){let f;super(t),this.url=((0,k.__runInitializers)(this,p),(0,k.__runInitializers)(this,m,null)),this.uOffset=((0,k.__runInitializers)(this,g),(0,k.__runInitializers)(this,R,0)),this.vOffset=((0,k.__runInitializers)(this,S),(0,k.__runInitializers)(this,T,0)),this.uScale=((0,k.__runInitializers)(this,M),(0,k.__runInitializers)(this,x,1)),this.vScale=((0,k.__runInitializers)(this,I),(0,k.__runInitializers)(this,b,1)),this.uAng=((0,k.__runInitializers)(this,O),(0,k.__runInitializers)(this,v,0)),this.vAng=((0,k.__runInitializers)(this,P),(0,k.__runInitializers)(this,E,0)),this.wAng=((0,k.__runInitializers)(this,A),(0,k.__runInitializers)(this,y,0)),this.uRotationCenter=((0,k.__runInitializers)(this,C),(0,k.__runInitializers)(this,B,.5)),this.vRotationCenter=((0,k.__runInitializers)(this,D),(0,k.__runInitializers)(this,F,.5)),this.wRotationCenter=((0,k.__runInitializers)(this,V),(0,k.__runInitializers)(this,G,.5)),this.homogeneousRotationInUVTransform=((0,k.__runInitializers)(this,N),(0,k.__runInitializers)(this,L,!1)),this.inspectableCustomProperties=((0,k.__runInitializers)(this,w),null),this._noMipmap=!1,this._invertY=!1,this._rowGenerationMatrix=null,this._cachedTextureMatrix=null,this._projectionModeMatrix=null,this._t0=null,this._t1=null,this._t2=null,this._cachedUOffset=-1,this._cachedVOffset=-1,this._cachedUScale=0,this._cachedVScale=0,this._cachedUAng=-1,this._cachedVAng=-1,this._cachedWAng=-1,this._cachedReflectionProjectionMatrixId=-1,this._cachedURotationCenter=-1,this._cachedVRotationCenter=-1,this._cachedWRotationCenter=-1,this._cachedHomogeneousRotationInUVTransform=!1,this._cachedIdentity3x2=!0,this._cachedReflectionTextureMatrix=null,this._cachedReflectionUOffset=-1,this._cachedReflectionVOffset=-1,this._cachedReflectionUScale=0,this._cachedReflectionVScale=0,this._cachedReflectionCoordinatesMode=-1,this._buffer=null,this._deleteBuffer=!1,this._format=null,this._delayedOnLoad=null,this._delayedOnError=null,this.onLoadObservable=new q.Observable,this._isBlocking=!0,this.name=e||"",this.url=e;let U=!1,W=null,Y=!0;"object"==typeof s&&null!==s?(f=s.noMipmap??!1,i=s.invertY??!es.useOpenGLOrientationForUV,r=s.samplingMode??z.TRILINEAR_SAMPLINGMODE,a=s.onLoad??null,n=s.onError??null,o=s.buffer??null,h=s.deleteBuffer??!1,l=s.format,c=s.mimeType,u=s.loaderOptions,d=s.creationFlags,U=s.useSRGBBuffer??!1,W=s.internalTexture??null,Y=s.gammaSpace??Y,_=s.forcedExtension??_):f=!!s,this._gammaSpace=Y,this._noMipmap=f,this._invertY=void 0===i?!es.useOpenGLOrientationForUV:i,this._initialSamplingMode=r,this._buffer=o,this._deleteBuffer=h,this._mimeType=c,this._loaderOptions=u,this._creationFlags=d,this._useSRGBBuffer=U,this._forcedExtension=_,void 0!==l&&(this._format=l);const K=this.getScene(),j=this._getEngine();if(!j)return;j.onBeforeTextureInitObservable.notifyObservers(this);const X=()=>{this._texture&&(this._texture._invertVScale&&(this.vScale*=-1,this.vOffset+=1),null!==this._texture._cachedWrapU&&(this.wrapU=this._texture._cachedWrapU,this._texture._cachedWrapU=null),null!==this._texture._cachedWrapV&&(this.wrapV=this._texture._cachedWrapV,this._texture._cachedWrapV=null),null!==this._texture._cachedWrapR&&(this.wrapR=this._texture._cachedWrapR,this._texture._cachedWrapR=null)),this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),a&&a(),!this.isBlocking&&K&&K.resetCachedMaterial()},H=(e,t)=>{this._loadingError=!0,this._errorObject={message:e,exception:t},n&&n(e,t),z.OnTextureLoadErrorObservable.notifyObservers(this)};if(!this.url&&!W){this._delayedOnLoad=X,this._delayedOnError=H;return}if(this._texture=W??this._getFromCache(this.url,f,r,this._invertY,U,this.isCube),this._texture)if(this._texture.isReady)Z.TimingTools.SetImmediate(()=>X());else{const e=this._texture.onLoadedObservable.add(X);this._texture.onErrorObservable.add(t=>{H(t.message,t.exception),this._texture?.onLoadedObservable.remove(e)})}else if(K&&K.useDelayedTextureLoading)this.delayLoadState=4,this._delayedOnLoad=X,this._delayedOnError=H;else{try{this._texture=j.createTexture(this.url,f,this._invertY,K,r,X,H,this._buffer,void 0,this._format,this._forcedExtension,c,u,d,U)}catch(e){throw H("error loading",e),e}h&&(this._buffer=null)}}updateURL(e,t=null,s,i){this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(1,e=>e.hasTexture(this))),(!this.name||this.name.startsWith("data:"))&&(this.name=e),this.url=e,this._buffer=t,this._forcedExtension=i,this.delayLoadState=4;let r=this._delayedOnLoad,a=()=>{r?r():this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),s&&s()};this._delayedOnLoad=a,this.delayLoad()}delayLoad(){if(4!==this.delayLoadState)return;let e=this.getScene();if(!e)return;let t=this.url;!t&&(this.name.indexOf("://")>0||this.name.startsWith("data:"))&&(t=this.name),this.delayLoadState=1,this._texture=this._getFromCache(t,this._noMipmap,this.samplingMode,this._invertY,this._useSRGBBuffer,this.isCube),this._texture?this._delayedOnLoad&&(this._texture.isReady?Z.TimingTools.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=e.getEngine().createTexture(t,this._noMipmap,this._invertY,e,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,this._forcedExtension,this._mimeType,this._loaderOptions,this._creationFlags,this._useSRGBBuffer),this._deleteBuffer&&(this._buffer=null)),this._delayedOnLoad=null,this._delayedOnError=null}_prepareRowForTextureGeneration(e,t,s,i){e*=this._cachedUScale,t*=this._cachedVScale,e-=this.uRotationCenter*this._cachedUScale,t-=this.vRotationCenter*this._cachedVScale,s-=this.wRotationCenter,Y.Vector3.TransformCoordinatesFromFloatsToRef(e,t,s,this._rowGenerationMatrix,i),i.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,i.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,i.z+=this.wRotationCenter}getTextureMatrix(e=1){if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*e===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng&&this.uRotationCenter===this._cachedURotationCenter&&this.vRotationCenter===this._cachedVRotationCenter&&this.wRotationCenter===this._cachedWRotationCenter&&this.homogeneousRotationInUVTransform===this._cachedHomogeneousRotationInUVTransform)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*e,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedURotationCenter=this.uRotationCenter,this._cachedVRotationCenter=this.vRotationCenter,this._cachedWRotationCenter=this.wRotationCenter,this._cachedHomogeneousRotationInUVTransform=this.homogeneousRotationInUVTransform,this._cachedTextureMatrix&&this._rowGenerationMatrix||(this._cachedTextureMatrix=Y.Matrix.Zero(),this._rowGenerationMatrix=new Y.Matrix,this._t0=Y.Vector3.Zero(),this._t1=Y.Vector3.Zero(),this._t2=Y.Vector3.Zero()),Y.Matrix.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this.homogeneousRotationInUVTransform?(Y.Matrix.TranslationToRef(-this._cachedURotationCenter,-this._cachedVRotationCenter,-this._cachedWRotationCenter,Y.TmpVectors.Matrix[0]),Y.Matrix.TranslationToRef(this._cachedURotationCenter,this._cachedVRotationCenter,this._cachedWRotationCenter,Y.TmpVectors.Matrix[1]),Y.Matrix.ScalingToRef(this._cachedUScale,this._cachedVScale,0,Y.TmpVectors.Matrix[2]),Y.Matrix.TranslationToRef(this._cachedUOffset,this._cachedVOffset,0,Y.TmpVectors.Matrix[3]),Y.TmpVectors.Matrix[0].multiplyToRef(this._rowGenerationMatrix,this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(Y.TmpVectors.Matrix[1],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(Y.TmpVectors.Matrix[2],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(Y.TmpVectors.Matrix[3],this._cachedTextureMatrix),this._cachedTextureMatrix.setRowFromFloats(2,this._cachedTextureMatrix.m[12],this._cachedTextureMatrix.m[13],this._cachedTextureMatrix.m[14],1)):(this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),Y.Matrix.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix));let t=this.getScene();if(!t)return this._cachedTextureMatrix;let s=this._cachedIdentity3x2;return this._cachedIdentity3x2=this._cachedTextureMatrix.isIdentityAs3x2(),this.optimizeUVAllocation&&s!==this._cachedIdentity3x2&&t.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)),this._cachedTextureMatrix}getReflectionTextureMatrix(){let e=this.getScene();if(!e)return this._cachedReflectionTextureMatrix;if(this.uOffset===this._cachedReflectionUOffset&&this.vOffset===this._cachedReflectionVOffset&&this.uScale===this._cachedReflectionUScale&&this.vScale===this._cachedReflectionVScale&&this.coordinatesMode===this._cachedReflectionCoordinatesMode){if(this.coordinatesMode!==z.PROJECTION_MODE)return this._cachedReflectionTextureMatrix;else if(this._cachedReflectionProjectionMatrixId===e.getProjectionMatrix().updateFlag)return this._cachedReflectionTextureMatrix}this._cachedReflectionTextureMatrix||(this._cachedReflectionTextureMatrix=Y.Matrix.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=Y.Matrix.Zero());let t=this._cachedReflectionCoordinatesMode!==this.coordinatesMode;switch(this._cachedReflectionUOffset=this.uOffset,this._cachedReflectionVOffset=this.vOffset,this._cachedReflectionUScale=this.uScale,this._cachedReflectionVScale=this.vScale,this._cachedReflectionCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case z.PLANAR_MODE:Y.Matrix.IdentityToRef(this._cachedReflectionTextureMatrix),this._cachedReflectionTextureMatrix[0]=this.uScale,this._cachedReflectionTextureMatrix[5]=this.vScale,this._cachedReflectionTextureMatrix[12]=this.uOffset,this._cachedReflectionTextureMatrix[13]=this.vOffset;break;case z.PROJECTION_MODE:{Y.Matrix.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);let t=e.getProjectionMatrix();this._cachedReflectionProjectionMatrixId=t.updateFlag,t.multiplyToRef(this._projectionModeMatrix,this._cachedReflectionTextureMatrix);break}default:Y.Matrix.IdentityToRef(this._cachedReflectionTextureMatrix)}return t&&e.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)),this._cachedReflectionTextureMatrix}clone(){let e={noMipmap:this._noMipmap,invertY:this._invertY,samplingMode:this.samplingMode,onLoad:void 0,onError:void 0,buffer:this._texture?this._texture._buffer:void 0,deleteBuffer:this._deleteBuffer,format:this.textureFormat,mimeType:this.mimeType,loaderOptions:this._loaderOptions,creationFlags:this._creationFlags,useSRGBBuffer:this._useSRGBBuffer};return ei.SerializationHelper.Clone(()=>new z(this._texture?this._texture.url:null,this.getScene(),e),this)}serialize(){let e=this.name;!z.SerializeBuffers&&this.name.startsWith("data:")&&(this.name=""),this.name.startsWith("data:")&&this.url===this.name&&(this.url="");let t=super.serialize(z._SerializeInternalTextureUniqueId);if(!t)return null;if(z.SerializeBuffers||z.ForceSerializeBuffers)if("string"==typeof this._buffer&&this._buffer.startsWith("data:"))t.base64String=this._buffer,t.name=t.name.replace("data:","");else if(this.url&&this.url.startsWith("data:")&&this._buffer instanceof Uint8Array){let e=this.mimeType||"image/png";t.base64String=`data:${e};base64,${(0,J.EncodeArrayBufferToBase64)(this._buffer)}`}else(z.ForceSerializeBuffers||this.url&&this.url.startsWith("blob:")||this._forceSerialize)&&(t.base64String=!this._engine||this._engine._features.supportSyncTextureRead?ee(this):et(this));return t.invertY=this._invertY,t.samplingMode=this.samplingMode,t._creationFlags=this._creationFlags,t._useSRGBBuffer=this._useSRGBBuffer,z._SerializeInternalTextureUniqueId&&(t.internalTextureUniqueId=this._texture?.uniqueId),t.internalTextureLabel=this._texture?.label,t.noMipmap=this._noMipmap,this.name=e,t}getClassName(){return"Texture"}dispose(){super.dispose(),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null,this._buffer=null}static Parse(e,t,s){let i;if(e.customType){let i=H.InstantiationTools.Instantiate(e.customType).Parse(e,t,s);return e.samplingMode&&i.updateSamplingMode&&i._samplingMode&&i._samplingMode!==e.samplingMode&&i.updateSamplingMode(e.samplingMode),i}if(e.isCube&&!e.isRenderTarget)return z._CubeTextureParser(e,t,s);let r=void 0!==e.internalTextureUniqueId;if(!e.name&&!e.isRenderTarget&&!r)return null;if(r){for(let s of t.getEngine().getLoadedTexturesCache())if(s.uniqueId===e.internalTextureUniqueId){i=s;break}}let a=t=>{if(t&&t._texture&&(t._texture._cachedWrapU=null,t._texture._cachedWrapV=null,t._texture._cachedWrapR=null),e.samplingMode){let s=e.samplingMode;t&&t.samplingMode!==s&&t.updateSamplingMode(s)}if(t&&e.animations)for(let s=0;s<e.animations.length;s++){let i=e.animations[s],r=(0,j.GetClass)("BABYLON.Animation");r&&t.animations.push(r.Parse(i))}t&&t._texture&&(r&&!i&&t._texture._setUniqueId(e.internalTextureUniqueId),t._texture.label=e.internalTextureLabel)};return ei.SerializationHelper.Parse(()=>{let r=!0;if(e.noMipmap&&(r=!1),e.mirrorPlane){let s=z._CreateMirror(e.name,e.renderTargetSize,t,r);return s._waitingRenderList=e.renderList,s.mirrorPlane=$.Plane.FromArray(e.mirrorPlane),a(s),s}if(e.isRenderTarget&&!e.base64String){let s=null;if(e.isCube){if(t.reflectionProbes)for(let s=0;s<t.reflectionProbes.length;s++){let i=t.reflectionProbes[s];if(i.name===e.name)return i.cubeTexture}}else(s=z._CreateRenderTargetTexture(e.name,e.renderTargetSize,t,r,e._creationFlags??0))._waitingRenderList=e.renderList;return a(s),s}if(e.isVideo){let i=z._CreateVideoTexture(s+(e.url||e.name),s+(e.src||e.url),t,r,e.invertY,e.samplingMode,e.settings||{});return a(i),i}{let n;if("string"==typeof e.base64String&&e.base64String&&!i){let s={buffer:e.base64String,noMipmap:!r,invertY:e.invertY,samplingMode:e.samplingMode,useSRGBBuffer:e._useSRGBBuffer??!1,creationFlags:e._creationFlags??0,onLoad:()=>{a(n)}},i=e.base64String,o=i.startsWith("data:")?i.substring(5):i;(n=z.CreateFromBase64String("",o,t,s)).name=e.name}else{let o;o=e.name&&(e.name.indexOf("://")>0||e.name.startsWith("data:"))?e.name:s+e.name,e.url&&(e.url.startsWith("data:")||z.UseSerializedUrlIfAny)&&(o=e.url);let h={noMipmap:!r,invertY:e.invertY,samplingMode:e.samplingMode,useSRGBBuffer:e._useSRGBBuffer??!1,creationFlags:e._creationFlags??0,onLoad:()=>{a(n)},internalTexture:i};n=new z(o,t,h)}return n}},e,t)}static CreateFromBase64String(e,t,s,i,r,a=z.TRILINEAR_SAMPLINGMODE,n=null,o=null,h=5,l,c){return new z("data:"+t,s,i,r,a,n,o,e,!1,h,void 0,void 0,l,c)}static LoadFromDataString(e,t,s,i=!1,r,a=!0,n=z.TRILINEAR_SAMPLINGMODE,o=null,h=null,l=5,c,u){return"data:"!==e.substring(0,5)&&(e="data:"+e),new z(e,s,r,a,n,o,h,t,i,l,void 0,void 0,c,u)}},U="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0,t=[(0,W.serialize)()],s=[(0,W.serialize)()],i=[(0,W.serialize)()],r=[(0,W.serialize)()],a=[(0,W.serialize)()],n=[(0,W.serialize)()],o=[(0,W.serialize)()],h=[(0,W.serialize)()],l=[(0,W.serialize)()],c=[(0,W.serialize)()],u=[(0,W.serialize)()],d=[(0,W.serialize)()],_=[(0,W.serialize)()],(0,k.__esDecorate)(z,null,_,{kind:"getter",name:"isBlocking",static:!1,private:!1,access:{has:e=>"isBlocking"in e,get:e=>e.isBlocking},metadata:U},null,p),(0,k.__esDecorate)(null,null,t,{kind:"field",name:"url",static:!1,private:!1,access:{has:e=>"url"in e,get:e=>e.url,set:(e,t)=>{e.url=t}},metadata:U},m,g),(0,k.__esDecorate)(null,null,s,{kind:"field",name:"uOffset",static:!1,private:!1,access:{has:e=>"uOffset"in e,get:e=>e.uOffset,set:(e,t)=>{e.uOffset=t}},metadata:U},R,S),(0,k.__esDecorate)(null,null,i,{kind:"field",name:"vOffset",static:!1,private:!1,access:{has:e=>"vOffset"in e,get:e=>e.vOffset,set:(e,t)=>{e.vOffset=t}},metadata:U},T,M),(0,k.__esDecorate)(null,null,r,{kind:"field",name:"uScale",static:!1,private:!1,access:{has:e=>"uScale"in e,get:e=>e.uScale,set:(e,t)=>{e.uScale=t}},metadata:U},x,I),(0,k.__esDecorate)(null,null,a,{kind:"field",name:"vScale",static:!1,private:!1,access:{has:e=>"vScale"in e,get:e=>e.vScale,set:(e,t)=>{e.vScale=t}},metadata:U},b,O),(0,k.__esDecorate)(null,null,n,{kind:"field",name:"uAng",static:!1,private:!1,access:{has:e=>"uAng"in e,get:e=>e.uAng,set:(e,t)=>{e.uAng=t}},metadata:U},v,P),(0,k.__esDecorate)(null,null,o,{kind:"field",name:"vAng",static:!1,private:!1,access:{has:e=>"vAng"in e,get:e=>e.vAng,set:(e,t)=>{e.vAng=t}},metadata:U},E,A),(0,k.__esDecorate)(null,null,h,{kind:"field",name:"wAng",static:!1,private:!1,access:{has:e=>"wAng"in e,get:e=>e.wAng,set:(e,t)=>{e.wAng=t}},metadata:U},y,C),(0,k.__esDecorate)(null,null,l,{kind:"field",name:"uRotationCenter",static:!1,private:!1,access:{has:e=>"uRotationCenter"in e,get:e=>e.uRotationCenter,set:(e,t)=>{e.uRotationCenter=t}},metadata:U},B,D),(0,k.__esDecorate)(null,null,c,{kind:"field",name:"vRotationCenter",static:!1,private:!1,access:{has:e=>"vRotationCenter"in e,get:e=>e.vRotationCenter,set:(e,t)=>{e.vRotationCenter=t}},metadata:U},F,V),(0,k.__esDecorate)(null,null,u,{kind:"field",name:"wRotationCenter",static:!1,private:!1,access:{has:e=>"wRotationCenter"in e,get:e=>e.wRotationCenter,set:(e,t)=>{e.wRotationCenter=t}},metadata:U},G,N),(0,k.__esDecorate)(null,null,d,{kind:"field",name:"homogeneousRotationInUVTransform",static:!1,private:!1,access:{has:e=>"homogeneousRotationInUVTransform"in e,get:e=>e.homogeneousRotationInUVTransform,set:(e,t)=>{e.homogeneousRotationInUVTransform=t}},metadata:U},L,w),U&&Object.defineProperty(z,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:U}),z.SerializeBuffers=!0,z.ForceSerializeBuffers=!1,z.OnTextureLoadErrorObservable=new q.Observable,z._SerializeInternalTextureUniqueId=!1,z._CubeTextureParser=(e,t,s)=>{throw(0,X._WarnImport)("CubeTexture")},z._CreateMirror=(e,t,s,i)=>{throw(0,X._WarnImport)("MirrorTexture")},z._CreateRenderTargetTexture=(e,t,s,i,r)=>{throw(0,X._WarnImport)("RenderTargetTexture")},z.NEAREST_SAMPLINGMODE=1,z.NEAREST_NEAREST_MIPLINEAR=8,z.BILINEAR_SAMPLINGMODE=2,z.LINEAR_LINEAR_MIPNEAREST=11,z.TRILINEAR_SAMPLINGMODE=3,z.LINEAR_LINEAR_MIPLINEAR=3,z.NEAREST_NEAREST_MIPNEAREST=4,z.NEAREST_LINEAR_MIPNEAREST=5,z.NEAREST_LINEAR_MIPLINEAR=6,z.NEAREST_LINEAR=7,z.NEAREST_NEAREST=1,z.LINEAR_NEAREST_MIPNEAREST=9,z.LINEAR_NEAREST_MIPLINEAR=10,z.LINEAR_LINEAR=2,z.LINEAR_NEAREST=12,z.EXPLICIT_MODE=0,z.SPHERICAL_MODE=1,z.PLANAR_MODE=2,z.CUBIC_MODE=3,z.PROJECTION_MODE=4,z.SKYBOX_MODE=5,z.INVCUBIC_MODE=6,z.EQUIRECTANGULAR_MODE=7,z.FIXED_EQUIRECTANGULAR_MODE=8,z.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,z.CLAMP_ADDRESSMODE=0,z.WRAP_ADDRESSMODE=1,z.MIRROR_ADDRESSMODE=2,z.UseSerializedUrlIfAny=!1,z),ea=!1;e.s(["RegisterTexture",0,function(){ea||(ea=!0,(0,j.RegisterClass)("BABYLON.Texture",er),ei.SerializationHelper._TextureParser=er.Parse)},"Texture",0,er],80603)},38788,e=>{"use strict";var t=e.i(38450);class s{static GetPlanes(e){let i=[];for(let e=0;e<6;e++)i.push(new t.Plane(0,0,0,0));return s.GetPlanesToRef(e,i),i}static GetNearPlaneToRef(e,t){let s=e.m;t.normal.x=s[3]+s[2],t.normal.y=s[7]+s[6],t.normal.z=s[11]+s[10],t.d=s[15]+s[14],t.normalize()}static GetFarPlaneToRef(e,t){let s=e.m;t.normal.x=s[3]-s[2],t.normal.y=s[7]-s[6],t.normal.z=s[11]-s[10],t.d=s[15]-s[14],t.normalize()}static GetLeftPlaneToRef(e,t){let s=e.m;t.normal.x=s[3]+s[0],t.normal.y=s[7]+s[4],t.normal.z=s[11]+s[8],t.d=s[15]+s[12],t.normalize()}static GetRightPlaneToRef(e,t){let s=e.m;t.normal.x=s[3]-s[0],t.normal.y=s[7]-s[4],t.normal.z=s[11]-s[8],t.d=s[15]-s[12],t.normalize()}static GetTopPlaneToRef(e,t){let s=e.m;t.normal.x=s[3]-s[1],t.normal.y=s[7]-s[5],t.normal.z=s[11]-s[9],t.d=s[15]-s[13],t.normalize()}static GetBottomPlaneToRef(e,t){let s=e.m;t.normal.x=s[3]+s[1],t.normal.y=s[7]+s[5],t.normal.z=s[11]+s[9],t.d=s[15]+s[13],t.normalize()}static GetPlanesToRef(e,t){s.GetNearPlaneToRef(e,t[0]),s.GetFarPlaneToRef(e,t[1]),s.GetLeftPlaneToRef(e,t[2]),s.GetRightPlaneToRef(e,t[3]),s.GetTopPlaneToRef(e,t[4]),s.GetBottomPlaneToRef(e,t[5])}static IsPointInFrustum(e,t){for(let s=0;s<6;s++)if(0>t[s].dotCoordinate(e))return!1;return!0}}e.s(["Frustum",0,s])},55179,40839,e=>{"use strict";var t=e.i(10977),s=e.i(97991);e.s(["PostProcessManager",0,class{constructor(e){this._vertexBuffers={},this._activePostProcesses=[],this.onBeforeRenderObservable=new s.Observable,this._scene=e}_prepareBuffers(){if(this._vertexBuffers[t.VertexBuffer.PositionKind])return;let e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[t.VertexBuffer.PositionKind]=new t.VertexBuffer(this._scene.getEngine(),e,t.VertexBuffer.PositionKind,!1,!1,2),this._buildIndexBuffer()}_buildIndexBuffer(){let e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)}_getActivePostProcesses(e){let t=this._activePostProcesses;t.length=0;for(let s=0;s<e.length;s++){let i=e[s];i&&t.push(i)}return t}_rebuild(){let e=this._vertexBuffers[t.VertexBuffer.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())}_prepareFrame(e=null,t=null){let s=this._scene.activeCamera;return!!s&&!!(t=t||this._getActivePostProcesses(s._postProcesses))&&0!==t.length&&!!this._scene.postProcessesEnabled&&(t[0].activate(s,e,null!=t),!0)}directRender(e,t=null,s=!1,i=0,r=0,a=!1,n=e.length){let o=this._scene.getEngine();for(let h=0;h<n;h++){h<e.length-1?e[h+1].activate(this._scene.activeCamera||this._scene,t?.texture):(t?o.bindFramebuffer(t,i,void 0,void 0,s,r):a||o.restoreDefaultFramebuffer(),o._debugInsertMarker?.(`post process ${e[h].name} output`));let n=e[h],l=n.apply();l&&(n.onBeforeRenderObservable.notifyObservers(l),this._prepareBuffers(),o.bindBuffers(this._vertexBuffers,this._indexBuffer,l),o.drawElementsType(0,0,6),n.onAfterRenderObservable.notifyObservers(l))}o.setDepthBuffer(!0),o.setDepthWrite(!0)}_finalizeFrame(e,t,s,i,r=!1){let a=this._scene.activeCamera;if(!a||(this.onBeforeRenderObservable.notifyObservers(this),0===(i=i||this._getActivePostProcesses(a._postProcesses)).length||!this._scene.postProcessesEnabled))return;let n=this._scene.getEngine();for(let o=0,h=i.length;o<h;o++){let l=i[o];if(o<h-1?l._outputTexture=i[o+1].activate(a,t?.texture):(t?(n.bindFramebuffer(t,s,void 0,void 0,r),l._outputTexture=t):(n.restoreDefaultFramebuffer(),l._outputTexture=null),n._debugInsertMarker?.(`post process ${i[o].name} output`)),e)break;let c=l.apply();c&&(l.onBeforeRenderObservable.notifyObservers(c),this._prepareBuffers(),n.bindBuffers(this._vertexBuffers,this._indexBuffer,c),n.drawElementsType(0,0,6),l.onAfterRenderObservable.notifyObservers(c))}n.setDepthBuffer(!0),n.setDepthWrite(!0),n.setAlphaMode(0)}dispose(){let e=this._vertexBuffers[t.VertexBuffer.PositionKind];e&&(e.dispose(),this._vertexBuffers[t.VertexBuffer.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null)}}],55179);var i=e.i(6895),r=e.i(56173);class a{set opaqueSortCompareFn(e){e?this._opaqueSortCompareFn=e:this._opaqueSortCompareFn=a.PainterSortCompare,this._renderOpaque=this._renderOpaqueSorted}set alphaTestSortCompareFn(e){e?this._alphaTestSortCompareFn=e:this._alphaTestSortCompareFn=a.PainterSortCompare,this._renderAlphaTest=this._renderAlphaTestSorted}set transparentSortCompareFn(e){e?this._transparentSortCompareFn=e:this._transparentSortCompareFn=a.defaultTransparentSortCompare,this._renderTransparent=this._renderTransparentSorted}constructor(e,t,s=null,r=null,a=null){this.index=e,this._opaqueSubMeshes=new i.SmartArray(256),this._transparentSubMeshes=new i.SmartArray(256),this._alphaTestSubMeshes=new i.SmartArray(256),this._depthOnlySubMeshes=new i.SmartArray(256),this._particleSystems=new i.SmartArray(256),this._spriteManagers=new i.SmartArray(256),this._empty=!0,this._edgesRenderers=new i.SmartArrayNoDuplicate(16),this.disableDepthPrePass=!1,this._scene=t,this.opaqueSortCompareFn=s,this.alphaTestSortCompareFn=r,this.transparentSortCompareFn=a}render(e,t,s,i,r=!0,a=!0,n=!0,o=!0,h){if(e)return void e(this._opaqueSubMeshes,this._alphaTestSubMeshes,this._transparentSubMeshes,this._depthOnlySubMeshes);let l=this._scene.getEngine();r&&0!==this._depthOnlySubMeshes.length&&(l.setColorWrite(!1),this._renderAlphaTest(this._depthOnlySubMeshes),l.setColorWrite(!0)),a&&0!==this._opaqueSubMeshes.length&&this._renderOpaque(this._opaqueSubMeshes),n&&0!==this._alphaTestSubMeshes.length&&this._renderAlphaTest(this._alphaTestSubMeshes);let c=l.getStencilBuffer();if(l.setStencilBuffer(!1),t&&this._renderSprites(),s&&this._renderParticles(i),this.onBeforeTransparentRendering&&this.onBeforeTransparentRendering(),o&&(h||0!==this._transparentSubMeshes.length||this._scene.useOrderIndependentTransparency)){if(l.setStencilBuffer(c),h)h(this._transparentSubMeshes,this);else if(this._scene.useOrderIndependentTransparency){let e=this._scene.depthPeelingRenderer.render(this._transparentSubMeshes);e.length&&this._renderTransparent(e)}else this._renderTransparent(this._transparentSubMeshes);l.setAlphaMode(0)}if(l.setStencilBuffer(!1),a&&this._edgesRenderers.length){for(let e=0;e<this._edgesRenderers.length;e++)this._edgesRenderers.data[e].render();l.setAlphaMode(0)}l.setStencilBuffer(c)}_renderOpaqueSorted(e){a._RenderSorted(e,this._opaqueSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderAlphaTestSorted(e){a._RenderSorted(e,this._alphaTestSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderTransparentSorted(e){a._RenderSorted(e,this._transparentSortCompareFn,this._scene.activeCamera,!0,this.disableDepthPrePass)}static _RenderSorted(e,t,s,i,n){let o,h=0,l=s?s.globalPosition:a._ZeroVector;if(i)for(;h<e.length;h++)(o=e.data[h])._alphaIndex=o.getMesh().alphaIndex,o._distanceToCamera=r.Vector3.Distance(o.getBoundingInfo().boundingSphere.centerWorld,l);let c=e.length===e.data.length?e.data:e.data.slice(0,e.length);t&&c.sort(t);let u=c[0].getMesh().getScene();for(h=0;h<c.length;h++)if(o=c[h],!u._activeMeshesFrozenButKeepClipping||o.isInFrustum(u._frustumPlanes)){if(i){let e=o.getMaterial();if(e&&e.needDepthPrePass&&!n){let t=e.getScene().getEngine();t.setColorWrite(!1),t.setAlphaMode(0),o.render(!1),t.setColorWrite(!0)}}o.render(i)}}static defaultTransparentSortCompare(e,t){return e._alphaIndex>t._alphaIndex?1:e._alphaIndex<t._alphaIndex?-1:a.backToFrontSortCompare(e,t)}static backToFrontSortCompare(e,t){return e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0}static frontToBackSortCompare(e,t){return e._distanceToCamera<t._distanceToCamera?-1:+(e._distanceToCamera>t._distanceToCamera)}static PainterSortCompare(e,t){let s=e.getMesh(),i=t.getMesh();return s.material&&i.material?s.material.uniqueId-i.material.uniqueId:s.uniqueId-i.uniqueId}prepare(){this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this.prepareSprites(),this._edgesRenderers.reset(),this._empty=!0}prepareSprites(){this._spriteManagers.reset()}dispose(){this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()}dispatch(e,t,s){void 0===t&&(t=e.getMesh()),void 0===s&&(s=e.getMaterial()),null!=s&&(s.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):s.needAlphaTestingForMesh(t)?(s.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(s.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t.isEnabled()&&t.isVisible&&t._edgesRenderer.isEnabled&&this._edgesRenderers.pushNoDuplicate(t._edgesRenderer),this._empty=!1)}dispatchSprites(e){this._spriteManagers.push(e),this._empty=!1}dispatchParticles(e){this._particleSystems.push(e),this._empty=!1}_renderParticles(e){if(0===this._particleSystems.length)return;let t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(let s=0;s<this._particleSystems.length;s++){let i=this._particleSystems.data[s];if(0===(t&&t.layerMask&i.layerMask))continue;let r=i.emitter;r.position&&e&&-1===e.indexOf(r)||this._scene._activeParticles.addCount(i.render(),!1)}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}_renderSprites(){if(!this._scene.spritesEnabled||0===this._spriteManagers.length)return;let e=this._scene.activeCamera;this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);for(let t=0;t<this._spriteManagers.length;t++){let s=this._spriteManagers.data[t];0!==(e&&e.layerMask&s.layerMask)&&s.render()}this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene)}}a._ZeroVector=r.Vector3.Zero();class n{}class o{get disableDepthPrePass(){return this._disableDepthPrePass}set disableDepthPrePass(e){for(let t of(this._disableDepthPrePass=e,this._renderingGroups))t.disableDepthPrePass=e}get maintainStateBetweenFrames(){return this._maintainStateBetweenFrames}set maintainStateBetweenFrames(e){e!==this._maintainStateBetweenFrames&&(this._maintainStateBetweenFrames=e,this._maintainStateBetweenFrames||this.restoreDispachedFlags())}restoreDispachedFlags(){for(let e of this._scene.meshes)if(e.subMeshes)for(let t of e.subMeshes)t._wasDispatched=!1;if(this._scene.spriteManagers)for(let e of this._scene.spriteManagers)e._wasDispatched=!1;for(let e of this._scene.particleSystems)e._wasDispatched=!1}constructor(e){this._useSceneAutoClearSetup=!1,this._disableDepthPrePass=!1,this._renderingGroups=[],this._autoClearDepthStencil={},this._customOpaqueSortCompareFn={},this._customAlphaTestSortCompareFn={},this._customTransparentSortCompareFn={},this._renderingGroupInfo=new n,this._maintainStateBetweenFrames=!1,this._scene=e;for(let e=o.MIN_RENDERINGGROUPS;e<o.MAX_RENDERINGGROUPS;e++)this._autoClearDepthStencil[e]={autoClear:!0,depth:!0,stencil:!0}}get renderingGroups(){return this._renderingGroups}getRenderingGroup(e){let t=e||0;return this._prepareRenderingGroup(t),this._renderingGroups[t]}_clearDepthStencilBuffer(e=!0,t=!0){this._depthStencilBufferAlreadyCleaned||(this._scene.getEngine().clear(null,!1,e,t),this._depthStencilBufferAlreadyCleaned=!0)}render(e,t,s,i,r=!0,a=!0,n=!0,h=!0,l){let c=this._renderingGroupInfo;if(c.scene=this._scene,c.camera=this._scene.activeCamera,c.renderingManager=this,this._scene.spriteManagers&&i)for(let e=0;e<this._scene.spriteManagers.length;e++){let t=this._scene.spriteManagers[e];this.dispatchSprites(t)}for(let u=o.MIN_RENDERINGGROUPS;u<o.MAX_RENDERINGGROUPS;u++){this._depthStencilBufferAlreadyCleaned=u===o.MIN_RENDERINGGROUPS;let d=this._renderingGroups[u];if(!d||d._empty)continue;let _=1<<u;if(c.renderingGroupId=u,this._scene.onBeforeRenderingGroupObservable.notifyObservers(c,_),o.AUTOCLEAR){let e=this._useSceneAutoClearSetup?this._scene.getAutoClearDepthStencilSetup(u):this._autoClearDepthStencil[u];e&&e.autoClear&&this._clearDepthStencilBuffer(e.depth,e.stencil)}for(let e of this._scene._beforeRenderingGroupDrawStage)e.action(u);for(let o of(d.render(e,i,s,t,r,a,n,h,l),this._scene._afterRenderingGroupDrawStage))o.action(u);this._scene.onAfterRenderingGroupObservable.notifyObservers(c,_)}}reset(){if(!this.maintainStateBetweenFrames)for(let e=o.MIN_RENDERINGGROUPS;e<o.MAX_RENDERINGGROUPS;e++){let t=this._renderingGroups[e];t&&t.prepare()}}resetSprites(){if(!this.maintainStateBetweenFrames)for(let e=o.MIN_RENDERINGGROUPS;e<o.MAX_RENDERINGGROUPS;e++){let t=this._renderingGroups[e];t&&t.prepareSprites()}}dispose(){this.freeRenderingGroups(),this._renderingGroups.length=0,this._renderingGroupInfo=null}freeRenderingGroups(){for(let e=o.MIN_RENDERINGGROUPS;e<o.MAX_RENDERINGGROUPS;e++){let t=this._renderingGroups[e];t&&t.dispose()}}_prepareRenderingGroup(e){void 0===this._renderingGroups[e]&&(this._renderingGroups[e]=new a(e,this._scene,this._customOpaqueSortCompareFn[e],this._customAlphaTestSortCompareFn[e],this._customTransparentSortCompareFn[e]),this._renderingGroups[e].disableDepthPrePass=this._disableDepthPrePass)}dispatchSprites(e){this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchSprites(e))}dispatchParticles(e){this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchParticles(e))}dispatch(e,t,s){void 0===t&&(t=e.getMesh()),this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(t.renderingGroupId).dispatch(e,t,s))}setRenderingOrder(e,t=null,s=null,i=null){if(this._customOpaqueSortCompareFn[e]=t,this._customAlphaTestSortCompareFn[e]=s,this._customTransparentSortCompareFn[e]=i,this._renderingGroups[e]){let t=this._renderingGroups[e];t.opaqueSortCompareFn=this._customOpaqueSortCompareFn[e],t.alphaTestSortCompareFn=this._customAlphaTestSortCompareFn[e],t.transparentSortCompareFn=this._customTransparentSortCompareFn[e]}}setRenderingAutoClearDepthStencil(e,t,s=!0,i=!0){this._autoClearDepthStencil[e]={autoClear:t,depth:s,stencil:i}}getAutoClearDepthStencilSetup(e){return this._autoClearDepthStencil[e]}}o.MAX_RENDERINGGROUPS=4,o.MIN_RENDERINGGROUPS=0,o.AUTOCLEAR=!0,e.s(["RenderingManager",0,o],40839)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88344,e=>{"use strict";var t,s,r=e.i(56173),i=e.i(10332),a=e.i(10977),o=e.i(82901),n=e.i(40672);function l(e){let t,s,r,i,l,h,u,c,d,p,f,x,g,m=e.pathArray,V=e.closeArray||!1,O=e.closePath||!1,_=e.invertUV||!1,M=Math.floor(m[0].length/2),y=e.offset||M;y=y>M?M:Math.floor(y);let T=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,b=e.uvs,v=e.colors,D=[],A=[],I=[],w=[],F=[],C=[],P=[],L=[],B=[],z=[];if(m.length<2){let e=[],t=[];for(r=0;r<m[0].length-y;r++)e.push(m[0][r]),t.push(m[0][r+y]);m=[e,t]}let E=0,S=+!!O,R=+!!V;for(t=m[0].length,s=0;s<m.length+R;s++){for(P[s]=0,F[s]=[0],t=t<(h=(l=s===m.length?m[0]:m[s]).length)?t:h,i=0;i<h;)D.push(l[i].x,l[i].y,l[i].z),i>0&&(u=l[i].subtract(l[i-1]).length()+P[s],F[s].push(u),P[s]=u),i++;O&&(i--,D.push(l[0].x,l[0].y,l[0].z),u=l[i].subtract(l[0]).length()+P[s],F[s].push(u),P[s]=u),B[s]=h+S,z[s]=E,E+=h+S}for(r=0;r<t+S;r++)for(L[r]=0,C[r]=[0],s=0;s<m.length-1+R;s++)c=m[s],d=s===m.length-1?m[0]:m[s+1],r===t?(p=c[0],f=d[0]):(p=c[r],f=d[r]),u=f.subtract(p).length()+L[r],C[r].push(u),L[r]=u;if(b)for(s=0;s<b.length;s++)w.push(b[s].x,n.useOpenGLOrientationForUV?1-b[s].y:b[s].y);else for(s=0;s<m.length+R;s++)for(r=0;r<t+S;r++)x=0!=P[s]?F[s][r]/P[s]:0,g=0!=L[r]?C[r][s]/L[r]:0,_?w.push(g,x):w.push(x,n.useOpenGLOrientationForUV?1-g:g);let U=0,N=B[s=0]-1,W=B[s+1]-1,G=N<W?N:W,H=z[1]-z[0],Z=B.length-1;for(;U<=G&&s<Z;)A.push(U,U+H,U+1),A.push(U+H+1,U+1,U+H),(U+=1)===G&&(H=z[++s+1]-z[s],N=B[s]-1,W=B[s+1]-1,U=z[s],G=N<W?N+U:W+U);if(o.VertexData.ComputeNormals(D,A,I),O){let e,t;for(s=0;s<m.length;s++){e=3*z[s],t=s+1<m.length?(z[s+1]-1)*3:I.length-3,I[e]=(I[e]+I[t])*.5,I[e+1]=(I[e+1]+I[t+1])*.5,I[e+2]=(I[e+2]+I[t+2])*.5;let r=Math.sqrt(I[e]*I[e]+I[e+1]*I[e+1]+I[e+2]*I[e+2]);I[e]/=r,I[e+1]/=r,I[e+2]/=r,I[t]=I[e],I[t+1]=I[e+1],I[t+2]=I[e+2]}}if(V){let e=3*z[0],s=3*z[m.length];for(r=0;r<t+S;r++){I[e]=(I[e]+I[s])*.5,I[e+1]=(I[e+1]+I[s+1])*.5,I[e+2]=(I[e+2]+I[s+2])*.5;let t=Math.sqrt(I[e]*I[e]+I[e+1]*I[e+1]+I[e+2]*I[e+2]);I[e]/=t,I[e+1]/=t,I[e+2]/=t,I[s]=I[e],I[s+1]=I[e+1],I[s+2]=I[e+2],e+=3,s+=3}}o.VertexData._ComputeSides(T,D,A,I,w,e.frontUVs,e.backUVs);let X=null;if(v){X=new Float32Array(4*v.length);for(let e=0;e<v.length;e++)X[4*e]=v[e].r,X[4*e+1]=v[e].g,X[4*e+2]=v[e].b,X[4*e+3]=v[e].a}let k=new o.VertexData,Y=new Float32Array(D),K=new Float32Array(I),Q=new Float32Array(w);return k.indices=A,k.positions=Y,k.normals=K,k.uvs=Q,X&&k.set(X,a.VertexBuffer.ColorKind),O&&(k._idx=z),k}function h(e,t,s=null){let u=t.pathArray,c=t.closeArray,d=t.closePath,p=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),f=t.instance,x=t.updatable;if(f){let e=r.TmpVectors.Vector3[0].setAll(Number.MAX_VALUE),s=r.TmpVectors.Vector3[1].setAll(-Number.MAX_VALUE),l=f.getVerticesData(a.VertexBuffer.PositionKind);if((t=>{let r=u[0].length,a=0,o=f._originalBuilderSideOrientation===i.Mesh.DOUBLESIDE?2:1;for(let i=1;i<=o;++i)for(let i=0;i<u.length;++i){let o=u[i],n=o.length;r=r<n?r:n;for(let i=0;i<r;++i){let r=o[i];t[a]=r.x,t[a+1]=r.y,t[a+2]=r.z,e.minimizeInPlaceFromFloats(r.x,r.y,r.z),s.maximizeInPlaceFromFloats(r.x,r.y,r.z),a+=3}if(f._creationDataStorage&&f._creationDataStorage.closePath){let e=o[0];t[a]=e.x,t[a+1]=e.y,t[a+2]=e.z,a+=3}}})(l),f.hasBoundingInfo?f.getBoundingInfo().reConstruct(e,s,f._worldMatrix):f.buildBoundingInfo(e,s,f._worldMatrix),f.updateVerticesData(a.VertexBuffer.PositionKind,l,!1,!1),t.colors){let e=f.getVerticesData(a.VertexBuffer.ColorKind);for(let s=0,r=0;s<t.colors.length;s++,r+=4){let i=t.colors[s];e[r]=i.r,e[r+1]=i.g,e[r+2]=i.b,e[r+3]=i.a}f.updateVerticesData(a.VertexBuffer.ColorKind,e,!1,!1)}if(t.uvs){let e=f.getVerticesData(a.VertexBuffer.UVKind);for(let s=0;s<t.uvs.length;s++)e[2*s]=t.uvs[s].x,e[2*s+1]=n.useOpenGLOrientationForUV?1-t.uvs[s].y:t.uvs[s].y;f.updateVerticesData(a.VertexBuffer.UVKind,e,!1,!1)}if(!f.areNormalsFrozen||f.isFacetDataEnabled){let e=f.getIndices(),t=f.getVerticesData(a.VertexBuffer.NormalKind),s=f.isFacetDataEnabled?f.getFacetDataParameters():null;if(o.VertexData.ComputeNormals(l,e,t,s),f._creationDataStorage&&f._creationDataStorage.closePath){let e,s;for(let r=0;r<u.length;r++)e=3*f._creationDataStorage.idx[r],s=r+1<u.length?(f._creationDataStorage.idx[r+1]-1)*3:t.length-3,t[e]=(t[e]+t[s])*.5,t[e+1]=(t[e+1]+t[s+1])*.5,t[e+2]=(t[e+2]+t[s+2])*.5,t[s]=t[e],t[s+1]=t[e+1],t[s+2]=t[e+2]}f.areNormalsFrozen||f.updateVerticesData(a.VertexBuffer.NormalKind,t,!1,!1)}return f}{let r=new i.Mesh(e,s);r._originalBuilderSideOrientation=p,r._creationDataStorage=new i._CreationDataStorage;let a=l(t);return d&&(r._creationDataStorage.idx=a._idx),r._creationDataStorage.closePath=d,r._creationDataStorage.closeArray=c,a.applyToMesh(r,x),r}}let u=!1;function c(e){let t=[],s=[],r=[],i=[],a=e.radius||.5,l=e.tessellation||64,h=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,u=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE;t.push(0,0,0),i.push(.5,.5);let c=2*Math.PI*h,d=1===h?c/l:c/(l-1),p=0;for(let e=0;e<l;e++){let e=Math.cos(p),s=Math.sin(p),r=(e+1)/2,o=(1-s)/2;t.push(a*e,a*s,0),i.push(r,n.useOpenGLOrientationForUV?1-o:o),p+=d}1===h&&(t.push(t[3],t[4],t[5]),i.push(i[2],n.useOpenGLOrientationForUV?1-i[3]:i[3]));let f=t.length/3;for(let e=1;e<f-1;e++)s.push(e+1,0,e);o.VertexData.ComputeNormals(t,s,r),o.VertexData._ComputeSides(u,t,s,r,i,e.frontUVs,e.backUVs);let x=new o.VertexData;return x.indices=s,x.positions=t,x.normals=r,x.uvs=i,x}function d(e,t={},s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,c(t).applyToMesh(r,t.updatable),r}u=!0,o.VertexData.CreateRibbon=l,i.Mesh.CreateRibbon=(e,t,s=!1,r,i,a,o=!1,n,l)=>h(e,{pathArray:t,closeArray:s,closePath:r,offset:i,updatable:o,sideOrientation:n,instance:l},a);let p=!1;p=!0,o.VertexData.CreateDisc=c,i.Mesh.CreateDisc=(e,t,s,r=null,i,a)=>d(e,{radius:t,tessellation:s,sideOrientation:a,updatable:i},r);var f=e.i(24617);function x(e){let t=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23],s=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],i=[],a=e.width||e.size||1,l=e.height||e.size||1,h=e.depth||e.size||1,u=e.wrap||!1,c=void 0===e.topBaseAt?1:e.topBaseAt,d=void 0===e.bottomBaseAt?0:e.bottomBaseAt;c=(c+4)%4,d=(d+4)%4;let p=[2,0,3,1][c],x=[2,0,1,3][d],g=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(u){t=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],g=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];let e=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],s=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]],r=[17,18,19,16],i=[22,23,20,21];for(;p>0;)e.unshift(e.pop()),r.unshift(r.pop()),p--;for(;x>0;)s.unshift(s.pop()),i.unshift(i.pop()),x--;e=e.flat(),s=s.flat(),g=g.concat(e).concat(s),t.push(r[0],r[2],r[3],r[0],r[1],r[2]),t.push(i[0],i[2],i[3],i[0],i[1],i[2])}let m=[a/2,l/2,h/2],V=g.reduce((e,t,s)=>e.concat(t*m[s%3]),[]),O=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,_=e.faceUV||Array(6),M=e.faceColors,y=[];for(let e=0;e<6;e++)void 0===_[e]&&(_[e]=new r.Vector4(0,0,1,1)),M&&void 0===M[e]&&(M[e]=new f.Color4(1,1,1,1));for(let e=0;e<6;e++)if(i.push(_[e].z,n.useOpenGLOrientationForUV?1-_[e].w:_[e].w),i.push(_[e].x,n.useOpenGLOrientationForUV?1-_[e].w:_[e].w),i.push(_[e].x,n.useOpenGLOrientationForUV?1-_[e].y:_[e].y),i.push(_[e].z,n.useOpenGLOrientationForUV?1-_[e].y:_[e].y),M)for(let t=0;t<4;t++)y.push(M[e].r,M[e].g,M[e].b,M[e].a);o.VertexData._ComputeSides(O,V,t,s,i,e.frontUVs,e.backUVs);let T=new o.VertexData;return T.indices=t,T.positions=V,T.normals=s,T.uvs=i,M&&(T.colors=O===o.VertexData.DOUBLESIDE?y.concat(y):y),T}function g(e,t={},s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,x(t).applyToMesh(r,t.updatable),r}let m=!1;function V(e){let t=e.pattern||i.Mesh.NO_FLIP,s=e.tileWidth||e.tileSize||1,r=e.tileHeight||e.tileSize||1,a=e.alignHorizontal||0,n=e.alignVertical||0,l=e.width||e.size||1,h=Math.floor(l/s),u=l-h*s,c=e.height||e.size||1,d=Math.floor(c/r),p=c-d*r,f=s*h/2,x=r*d/2,g=0,m=0,V=0,O=0,_=0,M=0;if(u>0||p>0){switch(V=-f,O=-x,_=f,M=x,a){case i.Mesh.CENTER:u/=2,V-=u,_+=u;break;case i.Mesh.LEFT:_+=u,g=-u/2;break;case i.Mesh.RIGHT:V-=u,g=u/2}switch(n){case i.Mesh.CENTER:p/=2,O-=p,M+=p;break;case i.Mesh.BOTTOM:M+=p,m=-p/2;break;case i.Mesh.TOP:O-=p,m=p/2}}let y=[],T=[],b=[];b[0]=[0,0,1,0,1,1,0,1],b[1]=[0,0,1,0,1,1,0,1],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(b[1]=[1,1,0,1,0,0,1,0]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(b[1]=[1,0,0,0,0,1,1,1]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(b[1]=[0,1,1,1,1,0,0,0]);let v=[],D=[],A=[],I=0;for(let e=0;e<d;e++)for(let a=0;a<h;a++)y.push(-f+a*s+g,-x+e*r+m,0),y.push(-f+(a+1)*s+g,-x+e*r+m,0),y.push(-f+(a+1)*s+g,-x+(e+1)*r+m,0),y.push(-f+a*s+g,-x+(e+1)*r+m,0),A.push(I,I+1,I+3,I+1,I+2,I+3),v=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?v.concat(b[(a%2+e%2)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?v.concat(b[e%2]):v.concat(b[0]),D.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1),I+=4;if(u>0||p>0){let e,o,l,c,b,w=p>0&&(n===i.Mesh.CENTER||n===i.Mesh.TOP),F=p>0&&(n===i.Mesh.CENTER||n===i.Mesh.BOTTOM),C=u>0&&(a===i.Mesh.CENTER||a===i.Mesh.RIGHT),P=u>0&&(a===i.Mesh.CENTER||a===i.Mesh.LEFT);if(w&&C&&(y.push(V+g,O+m,0),y.push(-f+g,O+m,0),y.push(-f+g,O+p+m,0),y.push(V+g,O+p+m,0),A.push(I,I+1,I+3,I+1,I+2,I+3),I+=4,c=1,b=1,e=[o=1-u/s,l=1-p/r,c,l,c,b,o,b],t===i.Mesh.ROTATE_ROW&&(e=[1-o,1-l,1-c,1-l,1-c,1-b,1-o,1-b]),t===i.Mesh.FLIP_ROW&&(e=[1-o,l,1-c,l,1-c,b,1-o,b]),t===i.Mesh.FLIP_N_ROTATE_ROW&&(e=[o,1-l,c,1-l,c,1-b,o,1-b]),v=v.concat(e),D.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),w&&P&&(y.push(f+g,O+m,0),y.push(_+g,O+m,0),y.push(_+g,O+p+m,0),y.push(f+g,O+p+m,0),A.push(I,I+1,I+3,I+1,I+2,I+3),I+=4,b=1,e=[o=0,l=1-p/r,c=u/s,l,c,b,o,b],(t===i.Mesh.ROTATE_ROW||t===i.Mesh.ROTATE_TILE&&h%2==0)&&(e=[1-o,1-l,1-c,1-l,1-c,1-b,1-o,1-b]),(t===i.Mesh.FLIP_ROW||t===i.Mesh.FLIP_TILE&&h%2==0)&&(e=[1-o,l,1-c,l,1-c,b,1-o,b]),(t===i.Mesh.FLIP_N_ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_TILE&&h%2==0)&&(e=[o,1-l,c,1-l,c,1-b,o,1-b]),v=v.concat(e),D.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),F&&C&&(y.push(V+g,x+m,0),y.push(-f+g,x+m,0),y.push(-f+g,M+m,0),y.push(V+g,M+m,0),A.push(I,I+1,I+3,I+1,I+2,I+3),I+=4,l=0,c=1,e=[o=1-u/s,l,c,l,c,b=p/r,o,b],(t===i.Mesh.ROTATE_ROW&&d%2==1||t===i.Mesh.ROTATE_TILE&&d%1==0)&&(e=[1-o,1-l,1-c,1-l,1-c,1-b,1-o,1-b]),(t===i.Mesh.FLIP_ROW&&d%2==1||t===i.Mesh.FLIP_TILE&&d%2==0)&&(e=[1-o,l,1-c,l,1-c,b,1-o,b]),(t===i.Mesh.FLIP_N_ROTATE_ROW&&d%2==1||t===i.Mesh.FLIP_N_ROTATE_TILE&&d%2==0)&&(e=[o,1-l,c,1-l,c,1-b,o,1-b]),v=v.concat(e),D.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),F&&P&&(y.push(f+g,x+m,0),y.push(_+g,x+m,0),y.push(_+g,M+m,0),y.push(f+g,M+m,0),A.push(I,I+1,I+3,I+1,I+2,I+3),I+=4,e=[o=0,l=0,c=u/s,l,c,b=p/r,o,b],(t===i.Mesh.ROTATE_ROW&&d%2==1||t===i.Mesh.ROTATE_TILE&&(d+h)%2==1)&&(e=[1-o,1-l,1-c,1-l,1-c,1-b,1-o,1-b]),(t===i.Mesh.FLIP_ROW&&d%2==1||t===i.Mesh.FLIP_TILE&&(d+h)%2==1)&&(e=[1-o,l,1-c,l,1-c,b,1-o,b]),(t===i.Mesh.FLIP_N_ROTATE_ROW&&d%2==1||t===i.Mesh.FLIP_N_ROTATE_TILE&&(d+h)%2==1)&&(e=[o,1-l,c,1-l,c,1-b,o,1-b]),v=v.concat(e),D.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),w){let e=[];o=0,l=1-p/r,c=1,b=1,e[0]=[o,l,c,l,c,b,o,b],e[1]=[o,l,c,l,c,b,o,b],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-c,1-l,1-c,1-b,1-o,1-b]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-c,l,1-c,b,1-o,b]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,c,1-l,c,1-b,o,1-b]);for(let r=0;r<h;r++)y.push(-f+r*s+g,O+m,0),y.push(-f+(r+1)*s+g,O+m,0),y.push(-f+(r+1)*s+g,O+p+m,0),y.push(-f+r*s+g,O+p+m,0),A.push(I,I+1,I+3,I+1,I+2,I+3),I+=4,v=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?v.concat(e[(r+1)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?v.concat(e[1]):v.concat(e[0]),D.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(F){let e=[];o=0,l=0,c=1,b=p/r,e[0]=[o,l,c,l,c,b,o,b],e[1]=[o,l,c,l,c,b,o,b],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-c,1-l,1-c,1-b,1-o,1-b]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-c,l,1-c,b,1-o,b]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,c,1-l,c,1-b,o,1-b]);for(let r=0;r<h;r++)y.push(-f+r*s+g,M-p+m,0),y.push(-f+(r+1)*s+g,M-p+m,0),y.push(-f+(r+1)*s+g,M+m,0),y.push(-f+r*s+g,M+m,0),A.push(I,I+1,I+3,I+1,I+2,I+3),I+=4,v=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?v.concat(e[(r+d)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?v.concat(e[d%2]):v.concat(e[0]),D.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(C){let e=[];o=1-u/s,l=0,c=1,b=1,e[0]=[o,l,c,l,c,b,o,b],e[1]=[o,l,c,l,c,b,o,b],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-c,1-l,1-c,1-b,1-o,1-b]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-c,l,1-c,b,1-o,b]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,c,1-l,c,1-b,o,1-b]);for(let s=0;s<d;s++)y.push(V+g,-x+s*r+m,0),y.push(V+u+g,-x+s*r+m,0),y.push(V+u+g,-x+(s+1)*r+m,0),y.push(V+g,-x+(s+1)*r+m,0),A.push(I,I+1,I+3,I+1,I+2,I+3),I+=4,v=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?v.concat(e[(s+1)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?v.concat(e[s%2]):v.concat(e[0]),D.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(P){let e=[];o=0,l=0,c=u/r,b=1,e[0]=[o,l,c,l,c,b,o,b],e[1]=[o,l,c,l,c,b,o,b],(t===i.Mesh.ROTATE_TILE||t===i.Mesh.ROTATE_ROW)&&(e[1]=[1-o,1-l,1-c,1-l,1-c,1-b,1-o,1-b]),(t===i.Mesh.FLIP_TILE||t===i.Mesh.FLIP_ROW)&&(e[1]=[1-o,l,1-c,l,1-c,b,1-o,b]),(t===i.Mesh.FLIP_N_ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_ROW)&&(e[1]=[o,1-l,c,1-l,c,1-b,o,1-b]);for(let s=0;s<d;s++)y.push(_-u+g,-x+s*r+m,0),y.push(_+g,-x+s*r+m,0),y.push(_+g,-x+(s+1)*r+m,0),y.push(_-u+g,-x+(s+1)*r+m,0),A.push(I,I+1,I+3,I+1,I+2,I+3),I+=4,v=t===i.Mesh.FLIP_TILE||t===i.Mesh.ROTATE_TILE||t===i.Mesh.FLIP_N_ROTATE_TILE?v.concat(e[(s+h)%2]):t===i.Mesh.FLIP_ROW||t===i.Mesh.ROTATE_ROW||t===i.Mesh.FLIP_N_ROTATE_ROW?v.concat(e[s%2]):v.concat(e[0]),D.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),T.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}}let w=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE;o.VertexData._ComputeSides(w,y,A,T,v,e.frontUVs,e.backUVs);let F=new o.VertexData;return F.indices=A,F.positions=y,F.normals=T,F.uvs=v,F.colors=w===o.VertexData.DOUBLESIDE?D.concat(D):D,F}m=!0,o.VertexData.CreateBox=x,i.Mesh.CreateBox=(e,t,s=null,r,i)=>g(e,{size:t,sideOrientation:i,updatable:r},s);let O=!1;function _(){O||(O=!0,o.VertexData.CreateTiledPlane=V)}function M(e){let t,s=e.faceUV||Array(6),a=e.faceColors,l=e.pattern||i.Mesh.NO_FLIP,h=e.width||e.size||1,u=e.height||e.size||1,c=e.depth||e.size||1,d=e.tileWidth||e.tileSize||1,p=e.tileHeight||e.tileSize||1,x=e.alignHorizontal||0,g=e.alignVertical||0,m=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE;for(let e=0;e<6;e++)void 0===s[e]&&(s[e]=new r.Vector4(0,0,1,1)),a&&void 0===a[e]&&(a[e]=new f.Color4(1,1,1,1));let O=h/2,_=u/2,M=c/2,y=[];for(let e=0;e<2;e++)y[e]=V({pattern:l,tileWidth:d,tileHeight:p,width:h,height:u,alignVertical:g,alignHorizontal:x,sideOrientation:m});for(let e=2;e<4;e++)y[e]=V({pattern:l,tileWidth:d,tileHeight:p,width:c,height:u,alignVertical:g,alignHorizontal:x,sideOrientation:m});let T=g;g===i.Mesh.BOTTOM?T=i.Mesh.TOP:g===i.Mesh.TOP&&(T=i.Mesh.BOTTOM);for(let e=4;e<6;e++)y[e]=V({pattern:l,tileWidth:d,tileHeight:p,width:h,height:c,alignVertical:T,alignHorizontal:x,sideOrientation:m});let b=[],v=[],D=[],A=[],I=[],w=[],F=[],C=[],P=0;for(let e=0;e<6;e++){let i=y[e].positions.length;w[e]=[],F[e]=[];for(let t=0;t<i/3;t++)w[e].push(new r.Vector3(y[e].positions[3*t],y[e].positions[3*t+1],y[e].positions[3*t+2])),F[e].push(new r.Vector3(y[e].normals[3*t],y[e].normals[3*t+1],y[e].normals[3*t+2]));t=y[e].uvs.length,C[e]=[];for(let r=0;r<t;r+=2)C[e][r]=s[e].x+(s[e].z-s[e].x)*y[e].uvs[r],C[e][r+1]=s[e].y+(s[e].w-s[e].y)*y[e].uvs[r+1],n.useOpenGLOrientationForUV&&(C[e][r+1]=1-C[e][r+1]);if(D=D.concat(C[e]),A=A.concat(y[e].indices.map(e=>e+P)),P+=w[e].length,a){let t=a[e];for(let s=0;s<w[e].length;s++)I.push(t.r,t.g,t.b,t.a)}}let L=[{m:r.Matrix.RotationY(Math.PI),t:new r.Vector3(0,0,M),op:1},{m:r.Matrix.Identity(),t:new r.Vector3(0,0,M),op:-1},{m:r.Matrix.RotationY(-Math.PI/2),t:new r.Vector3(O,0,0),op:1},{m:r.Matrix.RotationY(Math.PI/2),t:new r.Vector3(O,0,0),op:-1},{m:r.Matrix.RotationX(Math.PI/2),t:new r.Vector3(0,_,0),op:1},{m:r.Matrix.RotationX(-Math.PI/2),t:new r.Vector3(0,_,0),op:-1}];for(let e=0;e<6;e++){let{m:t,t:s,op:i}=L[e];for(let a of w[e]){let e=r.Vector3.TransformCoordinates(a,t),o=1===i?e.add(s):e.subtract(s);b.push(o.x,o.y,o.z)}for(let s of F[e]){let e=r.Vector3.TransformNormal(s,t);v.push(e.x,e.y,e.z)}}let B=new o.VertexData;return B.indices=A,B.positions=b,B.normals=v,B.uvs=D,a&&(B.colors=m===o.VertexData.DOUBLESIDE?I.concat(I):I),B}let y=!1;function T(e){let t=0|(e.segments||32),s=e.diameterX||e.diameter||1,i=e.diameterY||e.diameter||1,a=e.diameterZ||e.diameter||1,l=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,h=e.slice&&e.slice<=0?1:e.slice||1,u=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,c=!!e.dedupTopBottomIndices,d=new r.Vector3(s/2,i/2,a/2),p=2+t,f=2*p,x=[],g=[],m=[],V=[];for(let e=0;e<=p;e++){let t=e/p,s=t*Math.PI*h;for(let e=0;e<=f;e++){let i=e/f,a=i*Math.PI*2*l,o=r.Matrix.RotationZ(-s),h=r.Matrix.RotationY(a),u=r.Vector3.TransformCoordinates(r.Vector3.Up(),o),c=r.Vector3.TransformCoordinates(u,h),p=c.multiply(d),x=c.divide(d).normalize();g.push(p.x,p.y,p.z),m.push(x.x,x.y,x.z),V.push(i,n.useOpenGLOrientationForUV?1-t:t)}if(e>0){let t=g.length/3;for(let s=t-2*(f+1);s+f+2<t;s++)c?(e>1&&(x.push(s),x.push(s+1),x.push(s+f+1)),(e<p||h<1)&&(x.push(s+f+1),x.push(s+1),x.push(s+f+2))):(x.push(s),x.push(s+1),x.push(s+f+1),x.push(s+f+1),x.push(s+1),x.push(s+f+2))}}o.VertexData._ComputeSides(u,g,x,m,V,e.frontUVs,e.backUVs);let O=new o.VertexData;return O.indices=x,O.positions=g,O.normals=m,O.uvs=V,O}function b(e,t={},s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,T(t).applyToMesh(r,t.updatable),r}y=!0,_(),o.VertexData.CreateTiledBox=M;let v=!1;v=!0,o.VertexData.CreateSphere=T,i.Mesh.CreateSphere=(e,t,s,r,i,a)=>b(e,{segments:t,diameterX:s,diameterY:s,diameterZ:s,sideOrientation:a,updatable:i},r);var D=e.i(17188),A=e.i(93663);function I(e){let t,s,a,l,h,u,c,d,p,x=e.height||2,g=0===e.diameterTop?0:e.diameterTop||e.diameter||1,m=0===e.diameterBottom?0:e.diameterBottom||e.diameter||1;g=g||1e-5,m=m||1e-5;let V=0|(e.tessellation||24),O=0|(e.subdivisions||1),_=!!e.hasRings,M=!!e.enclose,y=0===e.cap?0:e.cap||i.Mesh.CAP_ALL,T=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1,b=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,v=e.faceUV||[,,,],D=e.faceColors,I=2+(1+(1!==T&&M?2:0))*(_?O:1);for(t=0;t<I;t++)D&&void 0===D[t]&&(D[t]=new f.Color4(1,1,1,1));for(t=0;t<I;t++)v&&void 0===v[t]&&(v[t]=new r.Vector4(0,0,1,1));let w=[],F=[],C=[],P=[],L=[],B=2*Math.PI*T/V,z=(m-g)/2/x,E=r.Vector3.Zero(),S=r.Vector3.Zero(),R=r.Vector3.Zero(),U=r.Vector3.Zero(),N=r.Vector3.Zero(),W=A.Axis.Y,G=1,H=0;for(h=0;h<=O;h++)for(l=((a=h/O)*(g-m)+m)/2,d=_&&0!==h&&h!==O?2:1,c=0;c<d;c++){for(_&&(G+=c),M&&(G+=2*c),u=0;u<=V;u++)E.x=Math.cos(-(s=u*B))*l,E.y=-x/2+a*x,E.z=Math.sin(-s)*l,0===g&&h===O?(S.x=C[C.length-(V+1)*3],S.y=C[C.length-(V+1)*3+1],S.z=C[C.length-(V+1)*3+2]):(S.x=E.x,S.z=E.z,S.y=Math.sqrt(S.x*S.x+S.z*S.z)*z,S.normalize()),0===u&&(R.copyFrom(E),U.copyFrom(S)),F.push(E.x,E.y,E.z),C.push(S.x,S.y,S.z),p=_?H!==G?v[G].y:v[G].w:v[G].y+(v[G].w-v[G].y)*a,P.push(v[G].x+(v[G].z-v[G].x)*u/V,n.useOpenGLOrientationForUV?1-p:p),D&&L.push(D[G].r,D[G].g,D[G].b,D[G].a);1!==T&&M&&(F.push(E.x,E.y,E.z),F.push(0,E.y,0),F.push(0,E.y,0),F.push(R.x,R.y,R.z),r.Vector3.CrossToRef(W,S,N),N.normalize(),C.push(N.x,N.y,N.z,N.x,N.y,N.z),r.Vector3.CrossToRef(U,W,N),N.normalize(),C.push(N.x,N.y,N.z,N.x,N.y,N.z),p=_?H!==G?v[G+1].y:v[G+1].w:v[G+1].y+(v[G+1].w-v[G+1].y)*a,P.push(v[G+1].x,n.useOpenGLOrientationForUV?1-p:p),P.push(v[G+1].z,n.useOpenGLOrientationForUV?1-p:p),p=_?H!==G?v[G+2].y:v[G+2].w:v[G+2].y+(v[G+2].w-v[G+2].y)*a,P.push(v[G+2].x,n.useOpenGLOrientationForUV?1-p:p),P.push(v[G+2].z,n.useOpenGLOrientationForUV?1-p:p),D&&(L.push(D[G+1].r,D[G+1].g,D[G+1].b,D[G+1].a),L.push(D[G+1].r,D[G+1].g,D[G+1].b,D[G+1].a),L.push(D[G+2].r,D[G+2].g,D[G+2].b,D[G+2].a),L.push(D[G+2].r,D[G+2].g,D[G+2].b,D[G+2].a))),H!==G&&(H=G)}let Z=1!==T&&M?V+4:V;for(G=0,h=0;G<O;G++){let e=0,t=0,s=0,r=0;for(u=0;u<V;u++)e=h*(Z+1)+u,t=(h+1)*(Z+1)+u,s=h*(Z+1)+(u+1),r=(h+1)*(Z+1)+(u+1),w.push(e,t,s),w.push(r,s,t);1!==T&&M&&(w.push(e+2,t+2,s+2),w.push(r+2,s+2,t+2),w.push(e+4,t+4,s+4),w.push(r+4,s+4,t+4)),h=_?h+2:h+1}let X=e=>{let t,s,i,a=e?g/2:m/2;if(0===a)return;let o=e?v[I-1]:v[0],l=null;D&&(l=e?D[I-1]:D[0]);let h=F.length/3,u=e?x/2:-x/2,c=new r.Vector3(0,u,0);F.push(c.x,c.y,c.z),C.push(0,e?1:-1,0);let d=o.y+(o.w-o.y)*.5;P.push(o.x+(o.z-o.x)*.5,n.useOpenGLOrientationForUV?1-d:d),l&&L.push(l.r,l.g,l.b,l.a);let p=new r.Vector2(.5,.5);for(i=0;i<=V;i++){let h=Math.cos(-(t=2*Math.PI*i*T/V)),c=Math.sin(-t);s=new r.Vector3(h*a,u,c*a);let d=new r.Vector2(h*p.x+.5,c*p.y+.5);F.push(s.x,s.y,s.z),C.push(0,e?1:-1,0);let f=o.y+(o.w-o.y)*d.y;P.push(o.x+(o.z-o.x)*d.x,n.useOpenGLOrientationForUV?1-f:f),l&&L.push(l.r,l.g,l.b,l.a)}for(i=0;i<V;i++)e?(w.push(h),w.push(h+(i+2)),w.push(h+(i+1))):(w.push(h),w.push(h+(i+1)),w.push(h+(i+2)))};(y===i.Mesh.CAP_START||y===i.Mesh.CAP_ALL)&&X(!1),(y===i.Mesh.CAP_END||y===i.Mesh.CAP_ALL)&&X(!0),o.VertexData._ComputeSides(b,F,w,C,P,e.frontUVs,e.backUVs);let k=new o.VertexData;return k.indices=w,k.positions=F,k.normals=C,k.uvs=P,D&&(k.colors=L),k}function w(e,t={},s){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,I(t).applyToMesh(r,t.updatable),r}let F=!1;function C(e){let t=[],s=[],i=[],a=[],l=e.diameter||1,h=e.thickness||.5,u=0|(e.tessellation||16),c=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,d=u+1;for(let e=0;e<=u;e++){let o=e/u,c=e*Math.PI*2/u-Math.PI/2,p=r.Matrix.Translation(l/2,0,0).multiply(r.Matrix.RotationY(c));for(let l=0;l<=u;l++){let c=1-l/u,f=l*Math.PI*2/u+Math.PI,x=Math.cos(f),g=Math.sin(f),m=new r.Vector3(x,g,0),V=m.scale(h/2),O=new r.Vector2(o,c);V=r.Vector3.TransformCoordinates(V,p),m=r.Vector3.TransformNormal(m,p),s.push(V.x,V.y,V.z),i.push(m.x,m.y,m.z),a.push(O.x,n.useOpenGLOrientationForUV?1-O.y:O.y);let _=(e+1)%d,M=(l+1)%d;t.push(e*d+l),t.push(e*d+M),t.push(_*d+l),t.push(e*d+M),t.push(_*d+M),t.push(_*d+l)}}o.VertexData._ComputeSides(c,s,t,i,a,e.frontUVs,e.backUVs);let p=new o.VertexData;return p.indices=t,p.positions=s,p.normals=i,p.uvs=a,p}function P(e,t={},s){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,C(t).applyToMesh(r,t.updatable),r}F=!0,o.VertexData.CreateCylinder=I,i.Mesh.CreateCylinder=(e,t,s,r,a,o,n,l,h)=>(void 0!==n&&n instanceof D.Scene||(void 0!==n&&(h=l||i.Mesh.DEFAULTSIDE,l=n),n=o,o=1),w(e,{height:t,diameterTop:s,diameterBottom:r,tessellation:a,subdivisions:o,sideOrientation:h,updatable:l},n));let L=!1;function B(e){let t,s,i=[],a=[],l=[],h=[],u=e.radius||2,c=e.tube||.5,d=e.radialSegments||32,p=e.tubularSegments||32,f=e.p||2,x=e.q||3,g=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,m=e=>{let t=Math.cos(e),s=Math.sin(e),i=x/f*e,a=Math.cos(i),o=u*Math.sin(i)*.5;return new r.Vector3(u*(2+a)*.5*t,u*(2+a)*s*.5,o)};for(t=0;t<=d;t++){let e=t%d/d*2*f*Math.PI,i=m(e),o=m(e+.01),l=o.subtract(i),u=o.add(i),x=r.Vector3.Cross(l,u);for(u=r.Vector3.Cross(x,l),x.normalize(),u.normalize(),s=0;s<p;s++){let e=s%p/p*2*Math.PI,r=-c*Math.cos(e),o=c*Math.sin(e);a.push(i.x+r*u.x+o*x.x),a.push(i.y+r*u.y+o*x.y),a.push(i.z+r*u.z+o*x.z),h.push(t/d),h.push(n.useOpenGLOrientationForUV?1-s/p:s/p)}}for(t=0;t<d;t++)for(s=0;s<p;s++){let e=(s+1)%p,r=t*p+s,a=(t+1)*p+s,o=(t+1)*p+e,n=t*p+e;i.push(n),i.push(a),i.push(r),i.push(n),i.push(o),i.push(a)}o.VertexData.ComputeNormals(a,i,l),o.VertexData._ComputeSides(g,a,i,l,h,e.frontUVs,e.backUVs);let V=new o.VertexData;return V.indices=i,V.positions=a,V.normals=l,V.uvs=h,V}function z(e,t={},s){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,B(t).applyToMesh(r,t.updatable),r}L=!0,o.VertexData.CreateTorus=C,i.Mesh.CreateTorus=(e,t,s,r,i,a,o)=>P(e,{diameter:t,thickness:s,tessellation:r,sideOrientation:o,updatable:a},i);let E=!1;E=!0,o.VertexData.CreateTorusKnot=B,i.Mesh.CreateTorusKnot=(e,t,s,r,i,a,o,n,l,h)=>z(e,{radius:t,tube:s,radialSegments:r,tubularSegments:i,p:a,q:o,sideOrientation:h,updatable:l},n);var S=i,R=e.i(88229),U=e.i(13279),N=e.i(28054),W=e.i(49399);class G extends S.Mesh{_isShaderMaterial(e){return!!e&&"ShaderMaterial"===e.getClassName()}constructor(t,s=null,r=null,i=null,o,n,l,h){super(t,s,r,i,o),this.useVertexColor=n,this.useVertexAlpha=l,this.color=new f.Color3(1,1,1),this.alpha=1,this._shaderLanguage=0,this._ownsMaterial=!1,i&&(this.color=i.color.clone(),this.alpha=i.alpha,this.useVertexColor=i.useVertexColor,this.useVertexAlpha=i.useVertexAlpha),this.intersectionThreshold=.1;const u={attributes:[a.VertexBuffer.PositionKind],uniforms:["world","viewProjection"],needAlphaBlending:!0,defines:[],useClipPlane:null,shaderLanguage:0};if(this.useVertexAlpha?u.defines.push("#define VERTEXALPHA"):u.needAlphaBlending=!1,this.useVertexColor?(u.defines.push("#define VERTEXCOLOR"),u.attributes.push(a.VertexBuffer.ColorKind)):(u.uniforms.push("color"),this._color4=new f.Color4),h)this.material=h;else{this.getScene().getEngine().isWebGPU&&!G.ForceGLSL&&(this._shaderLanguage=1),u.shaderLanguage=this._shaderLanguage,u.extraInitializationsAsync=async()=>{1===this._shaderLanguage?await Promise.all([e.A(13878),e.A(61137)]):await Promise.all([e.A(37117),e.A(83550)])};const t=new N.ShaderMaterial("colorShader",this.getScene(),"color",u,!1);t.doNotSerialize=!0,this._ownsMaterial=!0,this._setInternalMaterial(t)}}getClassName(){return"LinesMesh"}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){let t=this.material;if(t===e)return;let s=t&&this._ownsMaterial;this._ownsMaterial=!1,this._setInternalMaterial(e),s&&t?.dispose()}_setInternalMaterial(e){this._setMaterial(e),this.material&&(this.material.fillMode=U.Material.LineListDrawMode,this.material.disableLighting=!0)}get checkCollisions(){return!1}set checkCollisions(e){}_bind(e,t){if(!this._geometry)return this;let s=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(t,s):this._geometry._bind(t,s,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),!this.useVertexColor&&this._isShaderMaterial(this.material)){let{r:e,g:t,b:s}=this.color;this._color4.set(e,t,s,this.alpha),this.material.setColor4("color",this._color4)}return this}_draw(e,t,s){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;let r=this.getScene().getEngine();return this._unIndexed?r.drawArraysType(U.Material.LineListDrawMode,e.verticesStart,e.verticesCount,s):r.drawElementsType(U.Material.LineListDrawMode,e.indexStart,e.indexCount,s),this}dispose(e,t=!1,s){!s&&(this._ownsMaterial?this.material?.dispose(!1,!1,!0):t&&this.material?.dispose(!1,!1,!0)),super.dispose(e)}clone(e,t=null,s){return t&&void 0===t._addToSceneRootNodes?(t.source=this,new G(e,this.getScene(),t.parent,t.source,t.doNotCloneChildren)):new G(e,this.getScene(),t,this,s)}createInstance(e){let t=new H(e,this);if(this.instancedBuffers)for(let e in t.instancedBuffers={},this.instancedBuffers)t.instancedBuffers[e]=this.instancedBuffers[e];return t}serialize(e){super.serialize(e),e.color=this.color.asArray(),e.alpha=this.alpha}static Parse(e,t){let s=new G(e.name,t);return s.color=f.Color3.FromArray(e.color),s.alpha=e.alpha,s}}G.ForceGLSL=!1;class H extends R.InstancedMesh{constructor(e,t){super(e,t),this.intersectionThreshold=t.intersectionThreshold}getClassName(){return"InstancedLinesMesh"}}(t=G.prototype).enableEdgesRendering??(t.enableEdgesRendering=(0,W._MissingSideEffect)("LinesMesh","enableEdgesRendering")),(s=H.prototype).enableEdgesRendering??(s.enableEdgesRendering=(0,W._MissingSideEffect)("InstancedLinesMesh","enableEdgesRendering"));var Z=e.i(8697);function X(e){let t=[],s=[],r=e.lines,i=e.colors,a=[],n=0;for(let e=0;e<r.length;e++){let o=r[e];for(let r=0;r<o.length;r++){let{x:l,y:h,z:u}=o[r];if(s.push(l,h,u),i){let{r:t,g:s,b:o,a:n}=i[e][r];a.push(t,s,o,n)}r>0&&(t.push(n-1),t.push(n)),n++}}let l=new o.VertexData;return l.indices=t,l.positions=s,i&&(l.colors=a),l}function k(e){let t,s,i,a=e.dashSize||3,n=e.gapSize||1,l=e.dashNb||200,h=e.points,u=[],c=[],d=r.Vector3.Zero(),p=0,f=0;for(i=0;i<h.length-1;i++)h[i+1].subtractToRef(h[i],d),p+=d.length();let x=p/l,g=a*x/(a+n);for(i=0;i<h.length-1;i++){h[i+1].subtractToRef(h[i],d),t=Math.floor(d.length()/x),d.normalize();for(let e=0;e<t;e++)s=x*e,u.push(h[i].x+s*d.x,h[i].y+s*d.y,h[i].z+s*d.z),u.push(h[i].x+(s+g)*d.x,h[i].y+(s+g)*d.y,h[i].z+(s+g)*d.z),c.push(f,f+1),f+=2}let m=new o.VertexData;return m.positions=u,m.indices=c,m}function Y(e,t,s=null){let r=t.instance,i=t.lines,o=t.colors;if(r){let e,t,s=r.getVerticesData(a.VertexBuffer.PositionKind);o&&(e=r.getVerticesData(a.VertexBuffer.ColorKind));let n=0,l=0;for(let r=0;r<i.length;r++){let a=i[r];for(let i=0;i<a.length;i++)s[n]=a[i].x,s[n+1]=a[i].y,s[n+2]=a[i].z,o&&e&&(t=o[r],e[l]=t[i].r,e[l+1]=t[i].g,e[l+2]=t[i].b,e[l+3]=t[i].a,l+=4),n+=3}return r.updateVerticesData(a.VertexBuffer.PositionKind,s,!1,!1),o&&e&&r.updateVerticesData(a.VertexBuffer.ColorKind,e,!1,!1),r.refreshBoundingInfo(),r}let n=new G(e,s,null,void 0,void 0,!!o,t.useVertexAlpha,t.material);return X(t).applyToMesh(n,t.updatable),n}function K(e,t,s=null){let r=t.colors?[t.colors]:null;return Y(e,{lines:[t.points],updatable:t.updatable,instance:t.instance,colors:r,useVertexAlpha:t.useVertexAlpha,material:t.material},s)}function Q(e,t,s=null){let a=t.points,o=t.instance,n=t.gapSize||1,l=t.dashSize||3;if(o)return(t.dashNb||t.dashSize||t.gapSize||t.useVertexAlpha||t.material)&&Z.Logger.Warn("You have used an option other than points with the instance option. Please be aware that these other options will be ignored."),o.updateMeshPositions(e=>{let t,s,i,n,l=r.Vector3.Zero(),h=e.length/6,u=0,c=0;for(i=0;i<a.length-1;i++)a[i+1].subtractToRef(a[i],l),u+=l.length();let d=u/h,p=o._creationDataStorage.dashSize,f=p*d/(p+o._creationDataStorage.gapSize);for(i=0;i<a.length-1;i++)for(a[i+1].subtractToRef(a[i],l),t=Math.floor(l.length()/d),l.normalize(),n=0;n<t&&c<e.length;)s=d*n,e[c]=a[i].x+s*l.x,e[c+1]=a[i].y+s*l.y,e[c+2]=a[i].z+s*l.z,e[c+3]=a[i].x+(s+f)*l.x,e[c+4]=a[i].y+(s+f)*l.y,e[c+5]=a[i].z+(s+f)*l.z,c+=6,n++;for(;c<e.length;)e[c]=a[i].x,e[c+1]=a[i].y,e[c+2]=a[i].z,c+=3},!1),o;let h=new G(e,s,null,void 0,void 0,void 0,t.useVertexAlpha,t.material);return k(t).applyToMesh(h,t.updatable),h._creationDataStorage=new i._CreationDataStorage,h._creationDataStorage.dashSize=l,h._creationDataStorage.gapSize=n,h}let q=!1;q=!0,o.VertexData.CreateLineSystem=X,o.VertexData.CreateDashedLines=k,i.Mesh.CreateLines=(e,t,s=null,r=!1,i=null)=>K(e,{points:t,updatable:r,instance:i},s),i.Mesh.CreateDashedLines=(e,t,s,r,i,a=null,o,n)=>Q(e,{points:t,dashSize:s,gapSize:r,dashNb:i,updatable:o,instance:n},a);var j=r,J=e.i(62399),$=e.i(33491),ee=e.i(71829);class et extends j.Vector2{constructor(e,t){super(e.x,e.y),this.index=t}}class es{constructor(){this.elements=[]}add(e){let t=[];for(let s of e){let e=new et(s,this.elements.length);t.push(e),this.elements.push(e)}return t}computeBounds(){let e=new j.Vector2(this.elements[0].x,this.elements[0].y),t=new j.Vector2(this.elements[0].x,this.elements[0].y);for(let s of this.elements)s.x<e.x?e.x=s.x:s.x>t.x&&(t.x=s.x),s.y<e.y?e.y=s.y:s.y>t.y&&(t.y=s.y);return{min:e,max:t,width:t.x-e.x,height:t.y-e.y}}}class er{_addToepoint(e){for(let t of e)this._epoints.push(t.x,t.y)}constructor(e,t,s,r=earcut){let i;this._points=new es,this._outlinepoints=new es,this._holes=[],this._epoints=[],this._eholes=[],this.bjsEarcut=r,this._name=e,this._scene=s||ee.EngineStore.LastCreatedScene,i=t instanceof J.Path2?t.getPoints():t,this._addToepoint(i),this._points.add(i),this._outlinepoints.add(i),void 0===this.bjsEarcut&&Z.Logger.Warn("Earcut was not found, the polygon will not be built.")}addHole(e){this._points.add(e);let t=new es;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this}build(e=!1,t=0,s=2){let r=new i.Mesh(this._name,this._scene),o=this.buildVertexData(t,s);return r.setVerticesData(a.VertexBuffer.PositionKind,o.positions,e),r.setVerticesData(a.VertexBuffer.NormalKind,o.normals,e),r.setVerticesData(a.VertexBuffer.UVKind,o.uvs,e),r.setIndices(o.indices),r}buildVertexData(e=0,t=2){let s=new o.VertexData,r=[],i=[],a=[],n=this._points.computeBounds();for(let e of this._points.elements)r.push(0,1,0),i.push(e.x,0,e.y),a.push((e.x-n.min.x)/n.width,(e.y-n.min.y)/n.height);let l=[],h=this.bjsEarcut(this._epoints,this._eholes,2);for(let e=0;e<h.length;e++)l.push(h[e]);if(e>0){let s=i.length/3;for(let t of this._points.elements)r.push(0,-1,0),i.push(t.x,-e,t.y),a.push(1-(t.x-n.min.x)/n.width,1-(t.y-n.min.y)/n.height);let o=l.length;for(let e=0;e<o;e+=3){let t=l[e+0],r=l[e+1],i=l[e+2];l.push(i+s),l.push(r+s),l.push(t+s)}for(let s of(this._addSide(i,r,a,l,n,this._outlinepoints,e,!1,t),this._holes))this._addSide(i,r,a,l,n,s,e,!0,t)}return s.indices=l,s.positions=i,s.normals=r,s.uvs=a,s}_addSide(e,t,s,r,i,a,o,n,l){let h=e.length/3,u=0;for(let c=0;c<a.elements.length;c++){let d,p=a.elements[c],f=a.elements[(c+1)%a.elements.length];e.push(p.x,0,p.y),e.push(p.x,-o,p.y),e.push(f.x,0,f.y),e.push(f.x,-o,f.y);let x=a.elements[(c+a.elements.length-1)%a.elements.length],g=a.elements[(c+2)%a.elements.length],m=new j.Vector3(-(f.y-p.y),0,f.x-p.x),V=new j.Vector3(-(p.y-x.y),0,p.x-x.x),O=new j.Vector3(-(g.y-f.y),0,g.x-f.x);n||(m=m.scale(-1),V=V.scale(-1),O=O.scale(-1));let _=m.normalizeToNew(),M=V.normalizeToNew(),y=j.Vector3.Dot(M,_);M=y>l?y<$.Epsilon-1?new j.Vector3(p.x,0,p.y).subtract(new j.Vector3(f.x,0,f.y)).normalize():V.add(m).normalize():_;let T=j.Vector3.Dot(O,m);d=T>l?T<$.Epsilon-1?new j.Vector3(f.x,0,f.y).subtract(new j.Vector3(p.x,0,p.y)).normalize():O.add(m).normalize():_,s.push(u/i.width,0),s.push(u/i.width,1),u+=m.length(),s.push(u/i.width,0),s.push(u/i.width,1),t.push(M.x,M.y,M.z),t.push(M.x,M.y,M.z),t.push(d.x,d.y,d.z),t.push(d.x,d.y,d.z),n?(r.push(h),r.push(h+2),r.push(h+1),r.push(h+1),r.push(h+2),r.push(h+3)):(r.push(h),r.push(h+1),r.push(h+2),r.push(h+1),r.push(h+3),r.push(h+2)),h+=4}}}function ei(e,t,s,i,l,h,u){let c,d,p,x,g=s||[,,,],m=[],V=u||!1;for(let e=0;e<3;e++)void 0===g[e]&&(g[e]=new r.Vector4(0,0,1,1)),i&&void 0===i[e]&&(i[e]=new f.Color4(1,1,1,1));let O=e.getVerticesData(a.VertexBuffer.PositionKind),_=e.getVerticesData(a.VertexBuffer.NormalKind),M=e.getVerticesData(a.VertexBuffer.UVKind),y=e.getIndices(),T=O.length/9,b=0,v=[0];if(V)for(let e=T;e<O.length/3;e+=4)v.push(b+=Math.sqrt((d=O[3*(e+2)]-O[3*e])*d+(p=O[3*(e+2)+2]-O[3*e+2])*p));let D=0;for(let e=0;e<_.length;e+=3).001>Math.abs(_[e+1])&&(D=1),.001>Math.abs(_[e+1]-1)&&(D=0),.001>Math.abs(_[e+1]+1)&&(D=2),x=e/3,1===D?((c=x-T)%4<1.5?V?M[2*x]=g[D].x+(g[D].z-g[D].x)*v[Math.floor(c/4)]/b:M[2*x]=g[D].x:V?M[2*x]=g[D].x+(g[D].z-g[D].x)*v[Math.floor(c/4)+1]/b:M[2*x]=g[D].z,c%2==0?M[2*x+1]=n.useOpenGLOrientationForUV?1-g[D].w:g[D].w:M[2*x+1]=n.useOpenGLOrientationForUV?1-g[D].y:g[D].y):(M[2*x]=(1-M[2*x])*g[D].x+M[2*x]*g[D].z,M[2*x+1]=(1-M[2*x+1])*g[D].y+M[2*x+1]*g[D].w,n.useOpenGLOrientationForUV&&(M[2*x+1]=1-M[2*x+1])),i&&m.push(i[D].r,i[D].g,i[D].b,i[D].a);o.VertexData._ComputeSides(t,O,y,_,M,l,h);let A=new o.VertexData;return A.indices=y,A.positions=O,A.normals=_,A.uvs=M,i&&(A.colors=t===o.VertexData.DOUBLESIDE?m.concat(m):m),A}function ea(e,t,s=null,a=earcut){let o;t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation);let n=t.shape,l=t.holes||[],h=t.depth||0,u=t.smoothingThreshold||2,c=[];for(let e=0;e<n.length;e++)c[e]=new r.Vector2(n[e].x,n[e].z);c[0].equalsWithEpsilon(c[c.length-1],1e-8)&&c.pop();let d=new er(e,c,s||ee.EngineStore.LastCreatedScene,a);for(let e=0;e<l.length;e++){o=[];for(let t=0;t<l[e].length;t++)o.push(new r.Vector2(l[e][t].x,l[e][t].z));d.addHole(o)}let p=d.build(!1,h,u);return p._originalBuilderSideOrientation=t.sideOrientation,ei(p,t.sideOrientation,t.faceUV,t.faceColors,t.frontUVs,t.backUVs,t.wrap).applyToMesh(p,t.updatable),p}function eo(e,t,s=null,r=earcut){return ea(e,t,s,r)}let en=!1;function el(e,t,s=null){let r=t.path,a=t.shape,o=t.scale||1,n=t.rotation||0,l=0===t.cap?0:t.cap||i.Mesh.NO_CAP,h=t.updatable,u=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),c=t.instance||null,d=t.invertUV||!1,p=t.closeShape||!1,f=t.closePath||!1,x=t.capFunction||null;return eu(e,a,r,o,n,null,null,f,p,l,!1,s,!!h,u,c,d,t.frontUVs||null,t.backUVs||null,t.firstNormal||null,!!t.adjustFrame,x)}function eh(e,t,s=null){let a=t.path,o=t.shape,n=r.Vector3.Zero(),l=t.rotationFunction||(()=>0),h=t.closePath||t.ribbonCloseArray||!1,u=t.closeShape||t.ribbonClosePath||!1,c=0===t.cap?0:t.cap||i.Mesh.NO_CAP,d=t.updatable,p=t.firstNormal||null,f=t.adjustFrame||!1,x=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),g=t.instance,m=t.invertUV||!1,V=t.capFunction||null;return eu(e,o,a,null,null,t.scaleVectorFunction??((e,s)=>{let r=t.scaleFunction?.(e,s)??1;return n.copyFromFloats(r,r,r)}),l,h,u,c,!0,s,!!d,x,g||null,m,t.frontUVs||null,t.backUVs||null,p,f,V||null)}function eu(e,t,s,a,o,n,l,u,c,d,p,f,x,g,m,V,O,_,M,y,T){let b,v=(e,t,s,a,o,n,l,h,u,c,d)=>{let p=s.getTangents(),f=s.getNormals(),x=s.getBinormals(),g=s.getDistances();if(d){for(let e=0;e<p.length;e++)if(0==p[e].x&&0==p[e].y&&0==p[e].z&&p[e].copyFrom(p[e-1]),0==f[e].x&&0==f[e].y&&0==f[e].z&&f[e].copyFrom(f[e-1]),0==x[e].x&&0==x[e].y&&0==x[e].z&&x[e].copyFrom(x[e-1]),e>0){let t=p[e-1];0>r.Vector3.Dot(t,p[e])&&p[e].scaleInPlace(-1),t=f[e-1],0>r.Vector3.Dot(t,f[e])&&f[e].scaleInPlace(-1),t=x[e-1],0>r.Vector3.Dot(t,x[e])&&x[e].scaleInPlace(-1)}}let m=0,V=c&&h?h:()=>null!==n?n:0,O=c&&l?l:()=>null!==o?o:r.Vector3.OneReadOnly,_=2*(u!==i.Mesh.NO_CAP&&u!==i.Mesh.CAP_END),M=r.TmpVectors.Matrix[0];for(let s=0;s<t.length;s++){let i=[],o=V(s,g[s]),n=O(s,g[s]);r.Matrix.RotationAxisToRef(p[s],m,M);for(let a=0;a<e.length;a++){let o=p[s].scale(e[a].z).add(f[s].scale(e[a].x)).add(x[s].scale(e[a].y)),l=r.Vector3.Zero();r.Vector3.TransformCoordinatesToRef(o,M,l),l.multiplyInPlace(n).addInPlace(t[s]),i[a]=l}a[_]=i,m+=o,_++}let y=T||(e=>{let t,s=[],i=r.Vector3.Zero();for(t=0;t<e.length;t++)i.addInPlace(e[t]);for(i.scaleInPlace(1/e.length),t=0;t<e.length;t++)s.push(i);return s});switch(u){case i.Mesh.NO_CAP:break;case i.Mesh.CAP_START:a[0]=y(a[2]),a[1]=a[2];break;case i.Mesh.CAP_END:a[_]=a[_-1],a[_+1]=y(a[_-1]);break;case i.Mesh.CAP_ALL:a[0]=y(a[2]),a[1]=a[2],a[_]=a[_-1],a[_+1]=y(a[_-1])}return a},D=null!==a?new r.Vector3(a,a,a):null;if(m){let e=m._creationDataStorage;return M?e.path3D.update(s,M):e.path3D.update(s),m=h("",{pathArray:b=v(t,s,e.path3D,e.pathArray,D,o,n,l,e.cap,p,y),closeArray:!1,closePath:!1,offset:0,updatable:!1,sideOrientation:0,instance:m},f||void 0)}let A=M?new J.Path3D(s,M):new J.Path3D(s),I=h(e,{pathArray:b=v(t,s,A,[],D,o,n,l,d=d<0||d>3?0:d,p,y),closeArray:u,closePath:c,updatable:x,sideOrientation:g,invertUV:V,frontUVs:O||void 0,backUVs:_||void 0},f);return I._creationDataStorage.pathArray=b,I._creationDataStorage.path3D=A,I._creationDataStorage.cap=d,I}en=!0,o.VertexData.CreatePolygon=ei,i.Mesh.CreatePolygon=(e,t,s,r,i,a,o=earcut)=>ea(e,{shape:t,holes:r,updatable:i,sideOrientation:a},s,o),i.Mesh.ExtrudePolygon=(e,t,s,r,i,a,o,n=earcut)=>eo(e,{shape:t,holes:i,depth:s,updatable:a,sideOrientation:o},r,n);let ec=!1;function ed(e,t,s=null){let a,o,n,l,u=t.arc?t.arc<=0||t.arc>1?1:t.arc:1,c=void 0===t.closed||t.closed,d=t.shape,p=t.radius||1,f=t.tessellation||64,x=t.clip||0,g=t.updatable,m=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),V=t.cap||i.Mesh.NO_CAP,O=2*Math.PI,_=[],M=t.invertUV||!1,y=O/f*u;for(a=0;a<=f-x;a++){for(l=[],(V==i.Mesh.CAP_START||V==i.Mesh.CAP_ALL)&&(l.push(new r.Vector3(0,d[0].y,0)),l.push(new r.Vector3(Math.cos(a*y)*d[0].x*p,d[0].y,Math.sin(a*y)*d[0].x*p))),o=0;o<d.length;o++)n=new r.Vector3(Math.cos(a*y)*d[o].x*p,d[o].y,Math.sin(a*y)*d[o].x*p),l.push(n);(V==i.Mesh.CAP_END||V==i.Mesh.CAP_ALL)&&(l.push(new r.Vector3(Math.cos(a*y)*d[d.length-1].x*p,d[d.length-1].y,Math.sin(a*y)*d[d.length-1].x*p)),l.push(new r.Vector3(0,d[d.length-1].y,0))),_.push(l)}return h(e,{pathArray:_,closeArray:c,sideOrientation:m,updatable:g,invertUV:M,frontUVs:t.frontUVs,backUVs:t.backUVs},s)}ec=!0,i.Mesh.ExtrudeShape=(e,t,s,r,a,o,n=null,l,h,u)=>el(e,{shape:t,path:s,scale:r,rotation:a,cap:0===o?0:o||i.Mesh.NO_CAP,sideOrientation:h,instance:u,updatable:l},n),i.Mesh.ExtrudeShapeCustom=(e,t,s,r,a,o,n,l,h,u,c,d)=>eh(e,{shape:t,path:s,scaleFunction:r,rotationFunction:a,ribbonCloseArray:o,ribbonClosePath:n,cap:0===l?0:l||i.Mesh.NO_CAP,sideOrientation:c,instance:d,updatable:u},h);let ep=!1;function ef(e){let t=[],s=[],r=[],i=[],a=void 0!==e.width?e.width:void 0!==e.size?e.size:1,l=void 0!==e.height?e.height:void 0!==e.size?e.size:1,h=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,u=a/2,c=l/2;s.push(-u,-c,0),r.push(0,0,-1),i.push(0,+!!n.useOpenGLOrientationForUV),s.push(u,-c,0),r.push(0,0,-1),i.push(1,+!!n.useOpenGLOrientationForUV),s.push(u,c,0),r.push(0,0,-1),i.push(1,+!n.useOpenGLOrientationForUV),s.push(-u,c,0),r.push(0,0,-1),i.push(0,+!n.useOpenGLOrientationForUV),t.push(0),t.push(1),t.push(2),t.push(0),t.push(2),t.push(3),o.VertexData._ComputeSides(h,s,t,r,i,e.frontUVs,e.backUVs);let d=new o.VertexData;return d.indices=t,d.positions=s,d.normals=r,d.uvs=i,d}function ex(e,t={},s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,ef(t).applyToMesh(r,t.updatable),t.sourcePlane&&(r.translate(t.sourcePlane.normal,-t.sourcePlane.d),r.setDirection(t.sourcePlane.normal.scale(-1))),r}ep=!0,i.Mesh.CreateLathe=(e,t,s,r,i,a,o)=>ed(e,{shape:t,radius:s,tessellation:r,sideOrientation:o,updatable:a},i);let eg=!1;eg=!0,o.VertexData.CreatePlane=ef,i.Mesh.CreatePlane=(e,t,s,r,i)=>ex(e,{size:t,width:t,height:t,sideOrientation:i,updatable:r},s),_();var em=i;class eV extends em.Mesh{constructor(e,t){super(e,t),this.generateOctree=!1}getClassName(){return"GroundMesh"}get subdivisions(){return Math.min(this._subdivisionsX,this._subdivisionsY)}get subdivisionsX(){return this._subdivisionsX}get subdivisionsY(){return this._subdivisionsY}optimize(e,t=32){this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e),(0,W._IsSideEffectImplemented)(this.createOrUpdateSubmeshesOctree)&&this.createOrUpdateSubmeshesOctree(t)}getHeightAtCoordinates(e,t){let s=this.getWorldMatrix(),i=r.TmpVectors.Matrix[5];s.invertToRef(i);let a=r.TmpVectors.Vector3[8];if(r.Vector3.TransformCoordinatesFromFloatsToRef(e,0,t,i,a),e=a.x,t=a.z,e<this._minX||e>=this._maxX||t<=this._minZ||t>this._maxZ)return this.position.y;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());let o=this._getFacetAt(e,t),n=-(o.x*e+o.z*t+o.w)/o.y;return r.Vector3.TransformCoordinatesFromFloatsToRef(0,n,0,s,a),a.y}getNormalAtCoordinates(e,t){let s=new r.Vector3(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,s),s}getNormalAtCoordinatesToRef(e,t,s){let i=this.getWorldMatrix(),a=r.TmpVectors.Matrix[5];i.invertToRef(a);let o=r.TmpVectors.Vector3[8];if(r.Vector3.TransformCoordinatesFromFloatsToRef(e,0,t,a,o),e=o.x,t=o.z,e<this._minX||e>=this._maxX||t<=this._minZ||t>this._maxZ)return this;this._heightQuads&&0!=this._heightQuads.length||(this._initHeightQuads(),this._computeHeightQuads());let n=this._getFacetAt(e,t);return r.Vector3.TransformNormalFromFloatsToRef(n.x,n.y,n.z,i,s),this}updateCoordinateHeights(){return this._heightQuads&&0!=this._heightQuads.length||this._initHeightQuads(),this._computeHeightQuads(),this}_getFacetAt(e,t){let s=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),r=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),i=this._heightQuads[r*this._subdivisionsX+s];return t<i.slope.x*e+i.slope.y?i.facet1:i.facet2}_initHeightQuads(){let e=this._subdivisionsX,t=this._subdivisionsY;this._heightQuads=[];for(let s=0;s<t;s++)for(let t=0;t<e;t++){let i={slope:r.Vector2.Zero(),facet1:new r.Vector4(0,0,0,0),facet2:new r.Vector4(0,0,0,0)};this._heightQuads[s*e+t]=i}return this}_computeHeightQuads(){let e,t,s,i,o,n,l,h=this.getVerticesData(a.VertexBuffer.PositionKind);if(!h)return this;let u=r.TmpVectors.Vector3[3],c=r.TmpVectors.Vector3[2],d=r.TmpVectors.Vector3[1],p=r.TmpVectors.Vector3[0],f=r.TmpVectors.Vector3[4],x=r.TmpVectors.Vector3[5],g=r.TmpVectors.Vector3[6],m=r.TmpVectors.Vector3[7],V=r.TmpVectors.Vector3[8],O=this._subdivisionsX,_=this._subdivisionsY;for(let a=0;a<_;a++)for(let _=0;_<O;_++){e=3*_,t=a*(O+1)*3,s=(a+1)*(O+1)*3,u.x=h[t+e],u.y=h[t+e+1],u.z=h[t+e+2],c.x=h[t+e+3],c.y=h[t+e+4],c.z=h[t+e+5],d.x=h[s+e],d.y=h[s+e+1],d.z=h[s+e+2],p.x=h[s+e+3],p.y=h[s+e+4],p.z=h[s+e+5],i=(p.z-u.z)/(p.x-u.x),o=u.z-i*u.x,c.subtractToRef(u,f),d.subtractToRef(u,x),p.subtractToRef(u,g),r.Vector3.CrossToRef(g,x,m),r.Vector3.CrossToRef(f,g,V),m.normalize(),V.normalize(),n=-(m.x*u.x+m.y*u.y+m.z*u.z),l=-(V.x*c.x+V.y*c.y+V.z*c.z);let M=this._heightQuads[a*O+_];M.slope.copyFromFloats(i,o),M.facet1.copyFromFloats(m.x,m.y,m.z,n),M.facet2.copyFromFloats(V.x,V.y,V.z,l)}return this}serialize(e){super.serialize(e),e.subdivisionsX=this._subdivisionsX,e.subdivisionsY=this._subdivisionsY,e.minX=this._minX,e.maxX=this._maxX,e.minZ=this._minZ,e.maxZ=this._maxZ,e.width=this._width,e.height=this._height}static Parse(e,t){let s=new eV(e.name,t);return s._subdivisionsX=e.subdivisionsX||1,s._subdivisionsY=e.subdivisionsY||1,s._minX=e.minX,s._maxX=e.maxX,s._minZ=e.minZ,s._maxZ=e.maxZ,s._width=e.width,s._height=e.height,s}}var eO=e.i(17814);function e_(e){let t,s,i=[],a=[],l=[],h=[],u=e.width||e.size||1,c=e.height||e.size||1,d=0|(e.subdivisionsX||e.subdivisions||1),p=0|(e.subdivisionsY||e.subdivisions||1);for(t=0;t<=p;t++)for(s=0;s<=d;s++){let e=new r.Vector3(s*u/d-u/2,0,(p-t)*c/p-c/2),i=new r.Vector3(0,1,0);a.push(e.x,e.y,e.z),l.push(i.x,i.y,i.z),h.push(s/d,n.useOpenGLOrientationForUV?t/p:1-t/p)}for(t=0;t<p;t++)for(s=0;s<d;s++)i.push(s+1+(t+1)*(d+1)),i.push(s+1+t*(d+1)),i.push(s+t*(d+1)),i.push(s+(t+1)*(d+1)),i.push(s+1+(t+1)*(d+1)),i.push(s+t*(d+1));let f=new o.VertexData;return f.indices=i,f.positions=a,f.normals=l,f.uvs=h,f}function eM(e){let t,s,i,a,n=void 0!==e.xmin&&null!==e.xmin?e.xmin:-1,l=void 0!==e.zmin&&null!==e.zmin?e.zmin:-1,h=void 0!==e.xmax&&null!==e.xmax?e.xmax:1,u=void 0!==e.zmax&&null!==e.zmax?e.zmax:1,c=e.subdivisions||{w:1,h:1},d=e.precision||{w:1,h:1},p=[],f=[],x=[],g=[];c.h=c.h<1?1:c.h,c.w=c.w<1?1:c.w,d.w=d.w<1?1:d.w,d.h=d.h<1?1:d.h;let m={w:(h-n)/c.w,h:(u-l)/c.h};for(i=0;i<c.h;i++)for(a=0;a<c.w;a++)!function(e,i,a,o){let n=f.length/3,l=d.w+1;for(t=0;t<d.h;t++)for(s=0;s<d.w;s++){let e=[n+s+t*l,n+(s+1)+t*l,n+(s+1)+(t+1)*l,n+s+(t+1)*l];p.push(e[1]),p.push(e[2]),p.push(e[3]),p.push(e[0]),p.push(e[1]),p.push(e[3])}let h=r.Vector3.Zero(),u=new r.Vector3(0,1,0);for(t=0;t<=d.h;t++)for(h.z=t*(o-i)/d.h+i,s=0;s<=d.w;s++)h.x=s*(a-e)/d.w+e,h.y=0,f.push(h.x,h.y,h.z),x.push(u.x,u.y,u.z),g.push(s/d.w,t/d.h)}(n+a*m.w,l+i*m.h,n+(a+1)*m.w,l+(i+1)*m.h);let V=new o.VertexData;return V.indices=p,V.positions=f,V.normals=x,V.uvs=g,V}function ey(e){let t,s,i=[],a=[],n=[],l=[],h=e.colorFilter||new f.Color3(.3,.59,.11),u=e.alphaFilter||0,c=!1;if(e.minHeight>e.maxHeight){c=!0;let t=e.maxHeight;e.maxHeight=e.minHeight,e.minHeight=t}for(t=0;t<=e.subdivisions;t++)for(s=0;s<=e.subdivisions;s++){let i=new r.Vector3(s*e.width/e.subdivisions-e.width/2,0,(e.subdivisions-t)*e.height/e.subdivisions-e.height/2),o=(((i.x+e.width/2)/e.width*(e.bufferWidth-1)|0)+((1-(i.z+e.height/2)/e.height)*(e.bufferHeight-1)|0)*e.bufferWidth)*4,d=e.buffer[o]/255,p=e.buffer[o+1]/255,f=e.buffer[o+2]/255,x=e.buffer[o+3]/255;c&&(d=1-d,p=1-p,f=1-f);let g=d*h.r+p*h.g+f*h.b;x>=u?i.y=e.minHeight+(e.maxHeight-e.minHeight)*g:i.y=e.minHeight-$.Epsilon,e.heightBuffer&&(e.heightBuffer[t*(e.subdivisions+1)+s]=i.y),a.push(i.x,i.y,i.z),n.push(0,0,0),l.push(s/e.subdivisions,1-t/e.subdivisions)}for(t=0;t<e.subdivisions;t++)for(s=0;s<e.subdivisions;s++){let r=s+1+(t+1)*(e.subdivisions+1),o=s+1+t*(e.subdivisions+1),n=s+t*(e.subdivisions+1),l=s+(t+1)*(e.subdivisions+1),h=a[3*r+1]>=e.minHeight,u=a[3*o+1]>=e.minHeight,c=a[3*n+1]>=e.minHeight;h&&u&&c&&(i.push(r),i.push(o),i.push(n)),a[3*l+1]>=e.minHeight&&h&&c&&(i.push(l),i.push(r),i.push(n))}o.VertexData.ComputeNormals(a,i,n);let d=new o.VertexData;return d.indices=i,d.positions=a,d.normals=n,d.uvs=l,d}function eT(e,t={},s){let r=new eV(e,s);return r._setReady(!1),r._subdivisionsX=t.subdivisionsX||t.subdivisions||1,r._subdivisionsY=t.subdivisionsY||t.subdivisions||1,r._width=t.width||1,r._height=t.height||1,r._maxX=r._width/2,r._maxZ=r._height/2,r._minX=-r._maxX,r._minZ=-r._maxZ,e_(t).applyToMesh(r,t.updatable),r._setReady(!0),r}function eb(e,t,s=null){let r=new i.Mesh(e,s);return eM(t).applyToMesh(r,t.updatable),r}function ev(e,t,s={},r=null){let i,a=s.width||10,o=s.height||10,n=s.subdivisions||1,l=s.minHeight||0,h=s.maxHeight||1,u=s.colorFilter||new f.Color3(.3,.59,.11),c=s.alphaFilter||0,d=s.updatable,p=s.onReady,x=new eV(e,r=r||ee.EngineStore.LastCreatedScene);x._subdivisionsX=n,x._subdivisionsY=n,x._width=a,x._height=o,x._maxX=x._width/2,x._maxZ=x._height/2,x._minX=-x._maxX,x._minZ=-x._maxZ,x._setReady(!1),s.passHeightBufferInCallback&&(i=new Float32Array((n+1)*(n+1)));let g=(e,t,s)=>{ey({width:a,height:o,subdivisions:n,minHeight:l,maxHeight:h,colorFilter:u,buffer:e,bufferWidth:t,bufferHeight:s,alphaFilter:c,heightBuffer:i}).applyToMesh(x,d),p&&p(x,i),x._setReady(!0)};return"string"==typeof t?(r.addPendingData(x),eO.Tools.LoadImage(t,e=>{let t=e.width,s=e.height;r.isDisposed||g(r?.getEngine().resizeImageBitmap(e,t,s),t,s),r.removePendingData(x)},(e,t)=>{r.removePendingData(x),s.onError&&s.onError(e,t)},r.offlineProvider)):g(t.data,t.width,t.height),x}let eD=!1;function eA(e,t,s=null){let a,o,n=t.path,l=t.instance,u=1;void 0!==t.radius?u=t.radius:l&&(u=l._creationDataStorage.radius);let c=t.tessellation||64,d=t.radiusFunction||null,p=t.cap||i.Mesh.NO_CAP,f=t.invertUV||!1,x=t.updatable,g=i.Mesh._GetDefaultSideOrientation(t.sideOrientation);t.arc=t.arc&&(t.arc<=0||t.arc>1)?1:t.arc||1;let m=(e,t,s,a,o,n,l,h)=>{let u,c,d,p,f=t.getTangents(),x=t.getNormals(),g=t.getDistances(),m=2*Math.PI/o*h,V=n||(()=>a),O=r.TmpVectors.Matrix[0],_=2*(l!==i.Mesh.NO_CAP&&l!==i.Mesh.CAP_END);for(let t=0;t<e.length;t++){c=V(t,g[t]),u=[],d=x[t];for(let s=0;s<o;s++)r.Matrix.RotationAxisToRef(f[t],m*s,O),p=u[s]?u[s]:r.Vector3.Zero(),r.Vector3.TransformCoordinatesToRef(d,O,p),p.scaleInPlace(c).addInPlace(e[t]),u[s]=p;s[_]=u,_++}let M=(t,s)=>{let r=[];for(let i=0;i<t;i++)r.push(e[s]);return r};switch(l){case i.Mesh.NO_CAP:break;case i.Mesh.CAP_START:s[0]=M(o,0),s[1]=s[2].slice(0);break;case i.Mesh.CAP_END:s[_]=s[_-1].slice(0),s[_+1]=M(o,e.length-1);break;case i.Mesh.CAP_ALL:s[0]=M(o,0),s[1]=s[2].slice(0),s[_]=s[_-1].slice(0),s[_+1]=M(o,e.length-1)}return s};if(l){let e=l._creationDataStorage,s=t.arc||e.arc;return a=e.path3D.update(n),l=h("",{pathArray:o=m(n,a,e.pathArray,u,e.tessellation,d,e.cap,s),instance:l}),e.path3D=a,e.pathArray=o,e.arc=s,e.radius=u,l}a=new J.Path3D(n);let V=h(e,{pathArray:o=m(n,a,[],u,c,d,p=p<0||p>3?0:p,t.arc),closePath:!0,closeArray:!1,updatable:x,sideOrientation:g,invertUV:f,frontUVs:t.frontUVs,backUVs:t.backUVs},s);return V._creationDataStorage.pathArray=o,V._creationDataStorage.path3D=a,V._creationDataStorage.tessellation=c,V._creationDataStorage.cap=p,V._creationDataStorage.arc=t.arc,V._creationDataStorage.radius=u,V}eD=!0,o.VertexData.CreateGround=e_,o.VertexData.CreateTiledGround=eM,o.VertexData.CreateGroundFromHeightMap=ey,i.Mesh.CreateGround=(e,t,s,r,i,a)=>eT(e,{width:t,height:s,subdivisions:r,updatable:a},i),i.Mesh.CreateTiledGround=(e,t,s,r,i,a,o,n,l)=>eb(e,{xmin:t,zmin:s,xmax:r,zmax:i,subdivisions:a,precision:o,updatable:l},n),i.Mesh.CreateGroundFromHeightMap=(e,t,s,r,i,a,o,n,l,h,u)=>ev(e,t,{width:s,height:r,subdivisions:i,minHeight:a,maxHeight:o,updatable:l,onReady:h,alphaFilter:u},n);let eI=!1;function ew(e){let t,s,i,a,l,h,u,c,d=[];d[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},d[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},d[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},d[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},d[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},d[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},d[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},d[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},d[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},d[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},d[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},d[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},d[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},d[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},d[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};let p=e.type&&(e.type<0||e.type>=d.length)?0:e.type||0,x=e.size,g=e.sizeX||x||1,m=e.sizeY||x||1,V=e.sizeZ||x||1,O=e.custom||d[p],_=O.face.length,M=e.faceUV||Array(_),y=e.faceColors,T=void 0===e.flat||e.flat,b=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,v=[],D=[],A=[],I=[],w=[],F=0,C=0,P=[];if(T)for(s=0;s<_;s++)y&&void 0===y[s]&&(y[s]=new f.Color4(1,1,1,1)),M&&void 0===M[s]&&(M[s]=new r.Vector4(0,0,1,1));if(T)for(s=0;s<_;s++){let e=O.face[s].length;for(h=.5*Math.tan((l=2*Math.PI/e)/2),u=.5,t=0;t<e;t++)v.push(O.vertex[O.face[s][t]][0]*g,O.vertex[O.face[s][t]][1]*m,O.vertex[O.face[s][t]][2]*V),P.push(F),F++,i=M[s].x+(M[s].z-M[s].x)*(.5+h),a=M[s].y+(M[s].w-M[s].y)*(u-.5),I.push(i,n.useOpenGLOrientationForUV?1-a:a),c=h*Math.cos(l)-u*Math.sin(l),u=h*Math.sin(l)+u*Math.cos(l),h=c,y&&w.push(y[s].r,y[s].g,y[s].b,y[s].a);for(t=0;t<e-2;t++)D.push(P[0+C],P[t+2+C],P[t+1+C]);C+=e}else{for(t=0;t<O.vertex.length;t++)v.push(O.vertex[t][0]*g,O.vertex[t][1]*m,O.vertex[t][2]*V),I.push(0,+!!n.useOpenGLOrientationForUV);for(s=0;s<_;s++)for(t=0;t<O.face[s].length-2;t++)D.push(O.face[s][0],O.face[s][t+2],O.face[s][t+1])}o.VertexData.ComputeNormals(v,D,A),o.VertexData._ComputeSides(b,v,D,A,I,e.frontUVs,e.backUVs);let L=new o.VertexData;return L.positions=v,L.indices=D,L.normals=A,L.uvs=I,y&&T&&(L.colors=w),L}function eF(e,t={},s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,ew(t).applyToMesh(r,t.updatable),r}eI=!0,i.Mesh.CreateTube=(e,t,s,r,i,a,o,n,l,h)=>eA(e,{path:t,radius:s,tessellation:r,radiusFunction:i,arc:1,cap:a,updatable:n,sideOrientation:l,instance:h},o);let eC=!1;function eP(e){let t,s=e.sideOrientation||o.VertexData.DEFAULTSIDE,i=e.radius||1,a=void 0===e.flat||e.flat,l=0|(e.subdivisions||4),h=e.radiusX||i,u=e.radiusY||i,c=e.radiusZ||i,d=(1+Math.sqrt(5))/2,p=[-1,d,-0,1,d,0,-1,-d,0,1,-d,0,0,-1,-d,0,1,-d,0,-1,d,0,1,d,d,0,1,d,0,-1,-d,0,1,-d,0,-1],f=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],x=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],g=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],m=138/1024,V=239/1024,O=60/1024,_=26/1024,M=-40/1024,y=20/1024,T=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],b=[],v=[],D=[],A=[],I=0,w=[,,,],F=[,,,];for(t=0;t<3;t++)w[t]=r.Vector3.Zero(),F[t]=r.Vector2.Zero();for(let e=0;e<20;e++){for(t=0;t<3;t++){let s=f[3*e+t];w[t].copyFromFloats(p[3*x[s]],p[3*x[s]+1],p[3*x[s]+2]),w[t].normalize(),F[t].copyFromFloats(g[2*s]*m+O+T[e]*M,g[2*s+1]*V+_+T[e]*y)}let s=(e,t,s,i)=>{let o,d=r.Vector3.Lerp(w[0],w[2],t/l),p=r.Vector3.Lerp(w[1],w[2],t/l),f=l===t?w[2]:r.Vector3.Lerp(d,p,e/(l-t));if(f.normalize(),a){let e=r.Vector3.Lerp(w[0],w[2],i/l),t=r.Vector3.Lerp(w[1],w[2],i/l);o=r.Vector3.Lerp(e,t,s/(l-i))}else o=new r.Vector3(f.x,f.y,f.z);o.x/=h,o.y/=u,o.z/=c,o.normalize();let x=r.Vector2.Lerp(F[0],F[2],t/l),g=r.Vector2.Lerp(F[1],F[2],t/l),m=l===t?F[2]:r.Vector2.Lerp(x,g,e/(l-t));v.push(f.x*h,f.y*u,f.z*c),D.push(o.x,o.y,o.z),A.push(m.x,n.useOpenGLOrientationForUV?1-m.y:m.y),b.push(I),I++};for(let e=0;e<l;e++)for(let t=0;t+e<l;t++)s(t,e,t+1/3,e+1/3),s(t+1,e,t+1/3,e+1/3),s(t,e+1,t+1/3,e+1/3),t+e+1<l&&(s(t+1,e,t+2/3,e+2/3),s(t+1,e+1,t+2/3,e+2/3),s(t,e+1,t+2/3,e+2/3))}o.VertexData._ComputeSides(s,v,b,D,A,e.frontUVs,e.backUVs);let C=new o.VertexData;return C.indices=b,C.positions=v,C.normals=D,C.uvs=A,C}function eL(e,t={},s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,eP(t).applyToMesh(r,t.updatable),r}eC=!0,o.VertexData.CreatePolyhedron=ew,i.Mesh.CreatePolyhedron=(e,t,s)=>eF(e,t,s);let eB=!1;eB=!0,o.VertexData.CreateIcoSphere=eP,i.Mesh.CreateIcoSphere=(e,t,s)=>eL(e,t,s);var ez=e.i(76197);let eE=new r.Vector3(1,0,0),eS=new r.Vector3(-1,0,0),eR=new r.Vector3(0,1,0),eU=new r.Vector3(0,-1,0),eN=new r.Vector3(0,0,1),eW=new r.Vector3(0,0,-1);class eG{constructor(e=r.Vector3.Zero(),t=r.Vector3.Up(),s=r.Vector2.Zero(),i=0,a=0,o=null,n=null,l=null,h=null){this.position=e,this.normal=t,this.uv=s,this.vertexIdx=i,this.vertexIdxForBones=a,this.localPositionOverride=o,this.localNormalOverride=n,this.matrixIndicesOverride=l,this.matrixWeightsOverride=h}clone(){return new eG(this.position.clone(),this.normal.clone(),this.uv.clone(),this.vertexIdx,this.vertexIdxForBones,this.localPositionOverride?.slice(),this.localNormalOverride?.slice(),this.matrixIndicesOverride?.slice(),this.matrixWeightsOverride?.slice())}}function eH(e,t,s){let l=!!t.skeleton,h=!!t.morphTargetManager?.numTargets,u=s.localMode||l,c=t.getIndices(),d=l||h?t.getPositionData(!0,!0):t.getVerticesData(a.VertexBuffer.PositionKind),p=l||h?t.getNormalsData(!0,!0):t.getVerticesData(a.VertexBuffer.NormalKind),f=u?l?t.getVerticesData(a.VertexBuffer.PositionKind):d:null,x=u?l?t.getVerticesData(a.VertexBuffer.NormalKind):p:null,g=t.getVerticesData(a.VertexBuffer.UVKind),m=l?t.getVerticesData(a.VertexBuffer.MatricesIndicesKind):null,V=l?t.getVerticesData(a.VertexBuffer.MatricesWeightsKind):null,O=l?t.getVerticesData(a.VertexBuffer.MatricesIndicesExtraKind):null,_=l?t.getVerticesData(a.VertexBuffer.MatricesWeightsExtraKind):null,M=s.position||r.Vector3.Zero(),y=s.normal||r.Vector3.Up(),T=s.size||r.Vector3.One(),b=s.angle||0;if(!y){let e=new r.Vector3(0,0,1),s=t.getScene().activeCamera,i=r.Vector3.TransformCoordinates(e,s.getWorldMatrix());y=s.globalPosition.subtract(i)}let v=-Math.atan2(y.z,y.x)-Math.PI/2,D=Math.sqrt(y.x*y.x+y.z*y.z),A=Math.atan2(y.y,D),I=new o.VertexData;I.indices=[],I.positions=[],I.normals=[],I.uvs=[],I.matricesIndices=l?[]:null,I.matricesWeights=l?[]:null,I.matricesIndicesExtra=O?[]:null,I.matricesWeightsExtra=_?[]:null;let w=0,F=(e,t)=>{let i=new eG;if(!c||!d||!p)return i;let a=c[e];if(i.vertexIdx=3*a,i.vertexIdxForBones=4*a,i.position=new r.Vector3(d[3*a],d[3*a+1],d[3*a+2]),r.Vector3.TransformCoordinatesToRef(i.position,t,i.position),i.normal=new r.Vector3(p[3*a],p[3*a+1],p[3*a+2]),r.Vector3.TransformNormalToRef(i.normal,t,i.normal),s.captureUVS&&g){let e=g[2*a+1];i.uv=new r.Vector2(g[2*a],n.useOpenGLOrientationForUV?1-e:e)}return i},C=[0,0,0,0],P=(e,t)=>{if(0===e.length)return e;let s=.5*Math.abs(r.Vector3.Dot(T,t)),i=(e,t,s,r)=>{for(let i=0;i<r;++i)if(e[s+i]===t)return s+i;return -1},a=(e,a)=>{let o=r.Vector3.GetClipFactor(e.position,a.position,t,s),n=C,l=C;if(m&&V){let t=e.matrixIndicesOverride?0:e.vertexIdxForBones,s=e.matrixIndicesOverride??m,r=e.matrixWeightsOverride??V,h=a.matrixIndicesOverride?0:a.vertexIdxForBones,u=a.matrixIndicesOverride??m,c=a.matrixWeightsOverride??V;n=[0,0,0,0],l=[0,0,0,0];let d=0;for(let e=0;e<4;++e)if(r[t+e]>0){let a=i(u,s[t+e],h,4);n[d]=s[t+e],l[d]=(0,ez.Lerp)(r[t+e],a>=0?c[a]:0,o),d++}for(let e=0;e<4&&d<4;++e){let r=u[h+e];-1===i(s,r,t,4)&&(n[d]=r,l[d]=(0,ez.Lerp)(0,c[h+e],o),d++)}let p=l[0]+l[1]+l[2]+l[3];l[0]/=p,l[1]/=p,l[2]/=p,l[3]/=p}let h=e.localPositionOverride?e.localPositionOverride[0]:f?.[e.vertexIdx]??0,u=e.localPositionOverride?e.localPositionOverride[1]:f?.[e.vertexIdx+1]??0,c=e.localPositionOverride?e.localPositionOverride[2]:f?.[e.vertexIdx+2]??0,d=a.localPositionOverride?a.localPositionOverride[0]:f?.[a.vertexIdx]??0,p=a.localPositionOverride?a.localPositionOverride[1]:f?.[a.vertexIdx+1]??0,g=a.localPositionOverride?a.localPositionOverride[2]:f?.[a.vertexIdx+2]??0,O=e.localNormalOverride?e.localNormalOverride[0]:x?.[e.vertexIdx]??0,_=e.localNormalOverride?e.localNormalOverride[1]:x?.[e.vertexIdx+1]??0,M=e.localNormalOverride?e.localNormalOverride[2]:x?.[e.vertexIdx+2]??0,y=a.localNormalOverride?a.localNormalOverride[0]:x?.[a.vertexIdx]??0,T=a.localNormalOverride?a.localNormalOverride[1]:x?.[a.vertexIdx+1]??0,b=a.localNormalOverride?a.localNormalOverride[2]:x?.[a.vertexIdx+2]??0,v=O+(y-O)*o,D=_+(T-_)*o,A=M+(b-M)*o,I=Math.sqrt(v*v+D*D+A*A);return new eG(r.Vector3.Lerp(e.position,a.position,o),r.Vector3.Lerp(e.normal,a.normal,o).normalize(),r.Vector2.Lerp(e.uv,a.uv,o),-1,-1,f?[h+(d-h)*o,u+(p-u)*o,c+(g-c)*o]:null,x?[v/I,D/I,A/I]:null,n,l)},o=null;e.length>3&&(o=[]);for(let i=0;i<e.length;i+=3){let n=null,l=null,h=null,u=null,c=r.Vector3.Dot(e[i].position,t)-s,d=r.Vector3.Dot(e[i+1].position,t)-s,p=r.Vector3.Dot(e[i+2].position,t)-s,f=c>0,x=d>0,g=p>0;switch(+!!f+ +!!x+ +!!g){case 0:e.length>3?(o.push(e[i]),o.push(e[i+1]),o.push(e[i+2])):o=e;break;case 1:if(o=o??[],f&&(n=e[i+1],l=e[i+2],h=a(e[i],n),u=a(e[i],l)),x){n=e[i],l=e[i+2],h=a(e[i+1],n),u=a(e[i+1],l),o.push(h),o.push(l.clone()),o.push(n.clone()),o.push(l.clone()),o.push(h.clone()),o.push(u);break}g&&(n=e[i],l=e[i+1],h=a(e[i+2],n),u=a(e[i+2],l)),n&&l&&h&&u&&(o.push(n.clone()),o.push(l.clone()),o.push(h),o.push(u),o.push(h.clone()),o.push(l.clone()));break;case 2:o=o??[],f||(l=a(n=e[i].clone(),e[i+1]),h=a(n,e[i+2]),o.push(n),o.push(l),o.push(h)),x||(l=a(n=e[i+1].clone(),e[i+2]),h=a(n,e[i]),o.push(n),o.push(l),o.push(h)),g||(l=a(n=e[i+2].clone(),e[i]),h=a(n,e[i+1]),o.push(n),o.push(l),o.push(h))}}return o},L=t instanceof i.Mesh?t:null,B=L?._thinInstanceDataStorage.matrixData,z=L?.thinInstanceCount||1,E=r.TmpVectors.Matrix[0];E.copyFrom(r.Matrix.IdentityReadOnly);for(let e=0;e<z;++e){if(L?.hasThinInstances&&B){let t=16*e;E.setRowFromFloats(0,B[t+0],B[t+1],B[t+2],B[t+3]),E.setRowFromFloats(1,B[t+4],B[t+5],B[t+6],B[t+7]),E.setRowFromFloats(2,B[t+8],B[t+9],B[t+10],B[t+11]),E.setRowFromFloats(3,B[t+12],B[t+13],B[t+14],B[t+15])}let i=r.Matrix.RotationYawPitchRoll(v,A,b).multiply(r.Matrix.Translation(M.x,M.y,M.z)),a=r.Matrix.Invert(i),o=t.getWorldMatrix(),l=E.multiply(o).multiply(a),h=[,,,];for(let e=0;e<c.length;e+=3){let t=h;if((t[0]=F(e,l),t[1]=F(e+1,l),t[2]=F(e+2,l),!(s.cullBackFaces&&0>=-t[0].normal.z&&0>=-t[1].normal.z&&0>=-t[2].normal.z)&&(t=P(t,eE))&&(t=P(t,eS))&&(t=P(t,eR))&&(t=P(t,eU))&&(t=P(t,eN)))&&(t=P(t,eW)))for(let e=0;e<t.length;e++){let r=t[e];if(I.indices.push(w),u?(r.localPositionOverride?(I.positions[3*w]=r.localPositionOverride[0],I.positions[3*w+1]=r.localPositionOverride[1],I.positions[3*w+2]=r.localPositionOverride[2]):f&&(I.positions[3*w]=f[r.vertexIdx],I.positions[3*w+1]=f[r.vertexIdx+1],I.positions[3*w+2]=f[r.vertexIdx+2]),r.localNormalOverride?(I.normals[3*w]=r.localNormalOverride[0],I.normals[3*w+1]=r.localNormalOverride[1],I.normals[3*w+2]=r.localNormalOverride[2]):x&&(I.normals[3*w]=x[r.vertexIdx],I.normals[3*w+1]=x[r.vertexIdx+1],I.normals[3*w+2]=x[r.vertexIdx+2])):(r.position.toArray(I.positions,3*w),r.normal.toArray(I.normals,3*w)),I.matricesIndices&&I.matricesWeights&&(r.matrixIndicesOverride?(I.matricesIndices[4*w]=r.matrixIndicesOverride[0],I.matricesIndices[4*w+1]=r.matrixIndicesOverride[1],I.matricesIndices[4*w+2]=r.matrixIndicesOverride[2],I.matricesIndices[4*w+3]=r.matrixIndicesOverride[3]):(m&&(I.matricesIndices[4*w]=m[r.vertexIdxForBones],I.matricesIndices[4*w+1]=m[r.vertexIdxForBones+1],I.matricesIndices[4*w+2]=m[r.vertexIdxForBones+2],I.matricesIndices[4*w+3]=m[r.vertexIdxForBones+3]),O&&I.matricesIndicesExtra&&(I.matricesIndicesExtra[4*w]=O[r.vertexIdxForBones],I.matricesIndicesExtra[4*w+1]=O[r.vertexIdxForBones+1],I.matricesIndicesExtra[4*w+2]=O[r.vertexIdxForBones+2],I.matricesIndicesExtra[4*w+3]=O[r.vertexIdxForBones+3])),r.matrixWeightsOverride?(I.matricesWeights[4*w]=r.matrixWeightsOverride[0],I.matricesWeights[4*w+1]=r.matrixWeightsOverride[1],I.matricesWeights[4*w+2]=r.matrixWeightsOverride[2],I.matricesWeights[4*w+3]=r.matrixWeightsOverride[3]):(V&&(I.matricesWeights[4*w]=V[r.vertexIdxForBones],I.matricesWeights[4*w+1]=V[r.vertexIdxForBones+1],I.matricesWeights[4*w+2]=V[r.vertexIdxForBones+2],I.matricesWeights[4*w+3]=V[r.vertexIdxForBones+3]),_&&I.matricesWeightsExtra&&(I.matricesWeightsExtra[4*w]=_[r.vertexIdxForBones],I.matricesWeightsExtra[4*w+1]=_[r.vertexIdxForBones+1],I.matricesWeightsExtra[4*w+2]=_[r.vertexIdxForBones+2],I.matricesWeightsExtra[4*w+3]=_[r.vertexIdxForBones+3]))),s.captureUVS)r.uv.toArray(I.uvs,2*w);else{I.uvs.push(.5+r.position.x/T.x);let e=.5+r.position.y/T.y;I.uvs.push(n.useOpenGLOrientationForUV?1-e:e)}w++}}}0===I.indices.length&&(I.indices=null),0===I.positions.length&&(I.positions=null),0===I.normals.length&&(I.normals=null),0===I.uvs.length&&(I.uvs=null),I.matricesIndices?.length===0&&(I.matricesIndices=null),I.matricesWeights?.length===0&&(I.matricesWeights=null),I.matricesIndicesExtra?.length===0&&(I.matricesIndicesExtra=null),I.matricesWeightsExtra?.length===0&&(I.matricesWeightsExtra=null);let S=new i.Mesh(e,t.getScene());return I.applyToMesh(S),u?(S.skeleton=t.skeleton,S.parent=t):(S.position=M.clone(),S.rotation=new r.Vector3(A,v,b)),S.computeWorldMatrix(!0),S.refreshBoundingInfo(!0,!0),S}let eZ=!1;function eX(e={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){let t,s,i=0|Math.max(e.subdivisions?e.subdivisions:2,1),a=0|Math.max(e.tessellation?e.tessellation:16,3),l=Math.max(e.height?e.height:1,0),h=Math.max(e.radius?e.radius:.25,0),u=0|Math.max(e.capSubdivisions?e.capSubdivisions:6,1),c=Math.max(e.radiusTop?e.radiusTop:h,0),d=Math.max(e.radiusBottom?e.radiusBottom:h,0),p=2*Math.PI,f=Math.max(e.topCapSubdivisions?e.topCapSubdivisions:u,1),x=Math.max(e.bottomCapSubdivisions?e.bottomCapSubdivisions:u,1),g=Math.acos((d-c)/l),m=[],V=[],O=[],_=[],M=0,y=[],T=.5*(l-(c+d)),b=.5*Math.PI,v=r.Vector3.Zero(),D=r.Vector3.Zero(),A=Math.cos(g),I=Math.sin(g),w=new r.Vector2(c*I,T+c*A).subtract(new r.Vector2(d*I,-T+d*A)).length(),F=c*g+w+d*(b-g),C=0;for(s=0;s<=f;s++){let e=[],r=b-s/f*g;C+=c*g/f;let i=Math.cos(r),o=Math.sin(r),l=i*c;for(t=0;t<=a;t++){let s=t/a,r=s*p+0,h=Math.sin(r),u=Math.cos(r);D.x=l*h,D.y=T+o*c,D.z=l*u,V.push(D.x,D.y,D.z),v.set(i*h,o,i*u),O.push(v.x,v.y,v.z),_.push(s,n.useOpenGLOrientationForUV?C/F:1-C/F),e.push(M),M++}y.push(e)}let P=l-c-d+A*c-A*d,L=I*(d-c)/P;for(s=1;s<=i;s++){let e=[];C+=w/i;let r=I*(s*(d-c)/i+c);for(t=0;t<=a;t++){let o=t/a,l=o*p+0,h=Math.sin(l),u=Math.cos(l);D.x=r*h,D.y=T+A*c-s*P/i,D.z=r*u,V.push(D.x,D.y,D.z),v.set(h,L,u).normalize(),O.push(v.x,v.y,v.z),_.push(o,n.useOpenGLOrientationForUV?C/F:1-C/F),e.push(M),M++}y.push(e)}for(s=1;s<=x;s++){let e=[],r=b-g-s/x*(Math.PI-g);C+=d*g/x;let i=Math.cos(r),o=Math.sin(r),l=i*d;for(t=0;t<=a;t++){let s=t/a,r=s*p+0,h=Math.sin(r),u=Math.cos(r);D.x=l*h,D.y=-T+o*d,D.z=l*u,V.push(D.x,D.y,D.z),v.set(i*h,o,i*u),O.push(v.x,v.y,v.z),_.push(s,n.useOpenGLOrientationForUV?C/F:1-C/F),e.push(M),M++}y.push(e)}for(t=0;t<a;t++)for(s=0;s<f+i+x;s++){let e=y[s][t],r=y[s+1][t],i=y[s+1][t+1],a=y[s][t+1];m.push(e),m.push(r),m.push(a),m.push(r),m.push(i),m.push(a)}if(m=m.reverse(),e.orientation&&!e.orientation.equals(r.Vector3.Up())){let t=new r.Matrix;e.orientation.clone().scale(.5*Math.PI).cross(r.Vector3.Up()).toQuaternion().toRotationMatrix(t);let s=r.Vector3.Zero();for(let e=0;e<V.length;e+=3)s.set(V[e],V[e+1],V[e+2]),r.Vector3.TransformCoordinatesToRef(s.clone(),t,s),V[e]=s.x,V[e+1]=s.y,V[e+2]=s.z}let B=new o.VertexData;return B.positions=V,B.normals=O,B.uvs=_,B.indices=m,B}function ek(e,t={orientation:r.Vector3.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6,updatable:!1},s=null){let a=new i.Mesh(e,s);return eX(t).applyToMesh(a,t.updatable),a}eZ=!0,i.Mesh.CreateDecal=(e,t,s,r,i,a)=>eH(e,t,{position:s,normal:r,size:i,angle:a});let eY=!1;eY=!0,i.Mesh.CreateCapsule=(e,t,s)=>ek(e,t,s),o.VertexData.CreateCapsule=eX,e.s([],23568),e.i(23568);class eK{constructor(e=0,t=0){this.x=e,this.y=t,e!==Math.floor(e)&&(e=Math.floor(e),Z.Logger.Warn("x is not an integer, floor(x) used")),t!==Math.floor(t)&&(t=Math.floor(t),Z.Logger.Warn("y is not an integer, floor(y) used"))}clone(){return new eK(this.x,this.y)}rotate60About(e){let t=this.x;return this.x=e.x+e.y-this.y,this.y=t+this.y-e.x,this}rotateNeg60About(e){let t=this.x;return this.x=t+this.y-e.y,this.y=e.x+e.y-t,this}rotate120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),Z.Logger.Warn("m not an integer only floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),Z.Logger.Warn("n not an integer only floor(n) used"));let s=this.x;return this.x=e-s-this.y,this.y=t+s,this}rotateNeg120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),Z.Logger.Warn("m is not an integer, floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),Z.Logger.Warn("n is not an integer, floor(n) used"));let s=this.x;return this.x=this.y-t,this.y=e+t-s-this.y,this}toCartesianOrigin(e,t){let s=r.Vector3.Zero();return s.x=e.x+2*this.x*t+this.y*t,s.y=e.y+Math.sqrt(3)*this.y*t,s}static Zero(){return new eK(0,0)}}class eQ{constructor(){this.cartesian=[],this.vertices=[],this.max=[],this.min=[],this.closestTo=[],this.innerFacets=[],this.isoVecsABOB=[],this.isoVecsOBOA=[],this.isoVecsBAOA=[],this.vertexTypes=[],this.IDATA=new eq("icosahedron","Regular",[[0,$.PHI,-1],[-$.PHI,1,0],[-1,0,-$.PHI],[1,0,-$.PHI],[$.PHI,1,0],[0,$.PHI,1],[-1,0,$.PHI],[-$.PHI,-1,0],[0,-$.PHI,-1],[$.PHI,-1,0],[1,0,$.PHI],[0,-$.PHI,1]],[[0,2,1],[0,3,2],[0,4,3],[0,5,4],[0,1,5],[7,6,1],[8,7,2],[9,8,3],[10,9,4],[6,10,5],[2,7,1],[3,8,2],[4,9,3],[5,10,4],[1,6,5],[11,6,7],[11,7,8],[11,8,9],[11,9,10],[11,10,6]])}setIndices(){let e,t,s,r,i,a,o,n,l=12,h={},u=this.m,c=this.n,d=u;0!==c&&(d=(0,ez.HighestCommonFactor)(u,c));let p=u/d,f=c/d,x=eK.Zero(),g=new eK(u,c),m=new eK(-c,u+c),V=eK.Zero(),O=eK.Zero(),_=eK.Zero(),M=[],y=[],T=this.vertByDist,b=(e,t,s,r)=>{a=e+"|"+s,o=t+"|"+r,a in h||o in h?a in h&&!(o in h)?h[o]=h[a]:o in h&&!(a in h)&&(h[a]=h[o]):(h[a]=l,h[o]=l,l++),T[s][0]>2?y[h[a]]=[-T[s][0],T[s][1],h[a]]:y[h[a]]=[M[T[s][0]],T[s][1],h[a]]};this.IDATA.edgematch=[[1,"B"],[2,"B"],[3,"B"],[4,"B"],[0,"B"],[10,"O",14,"A"],[11,"O",10,"A"],[12,"O",11,"A"],[13,"O",12,"A"],[14,"O",13,"A"],[0,"O"],[1,"O"],[2,"O"],[3,"O"],[4,"O"],[19,"B",5,"A"],[15,"B",6,"A"],[16,"B",7,"A"],[17,"B",8,"A"],[18,"B",9,"A"]];for(let o=0;o<20;o++){if(s=(M=this.IDATA.face[o])[2],r=M[1],i=M[0],(a=o+"|"+(n=x.x+"|"+x.y))in h||(h[a]=s,y[s]=[M[T[n][0]],T[n][1]]),(a=o+"|"+(n=g.x+"|"+g.y))in h||(h[a]=r,y[r]=[M[T[n][0]],T[n][1]]),(a=o+"|"+(n=m.x+"|"+m.y))in h||(h[a]=i,y[i]=[M[T[n][0]],T[n][1]]),e=this.IDATA.edgematch[o][0],"B"===(t=this.IDATA.edgematch[o][1]))for(let t=1;t<d;t++)O.x=u-t*(p+f),O.y=c+t*p,_.x=-t*f,_.y=t*(p+f),b(o,e,n=O.x+"|"+O.y,_.x+"|"+_.y);if("O"===t)for(let t=1;t<d;t++)_.x=-t*f,_.y=t*(p+f),V.x=t*p,V.y=t*f,b(o,e,n=_.x+"|"+_.y,V.x+"|"+V.y);if(e=this.IDATA.edgematch[o][2],(t=this.IDATA.edgematch[o][3])&&"A"===t)for(let t=1;t<d;t++)V.x=t*p,V.y=t*f,O.x=u-(d-t)*(p+f),O.y=c+(d-t)*p,b(o,e,n=V.x+"|"+V.y,O.x+"|"+O.y);for(let e=0;e<this.vertices.length;e++)(a=o+"|"+(n=this.vertices[e].x+"|"+this.vertices[e].y))in h||(h[a]=l++,T[n][0]>2?y[h[a]]=[-T[n][0],T[n][1],h[a]]:y[h[a]]=[M[T[n][0]],T[n][1],h[a]])}this.closestTo=y,this.vecToidx=h}calcCoeffs(){let e=this.m,t=this.n,s=Math.sqrt(3)/3,r=e*e+t*t+e*t;this.coau=(e+t)/r,this.cobu=-t/r,this.coav=-s*(e-t)/r,this.cobv=s*(2*e+t)/r}createInnerFacets(){let e=this.m,t=this.n;for(let s=0;s<t+e+1;s++)for(let e=this.min[s];e<this.max[s]+1;e++)e<this.max[s]&&e<this.max[s+1]+1&&this.innerFacets.push(["|"+e+"|"+s,"|"+e+"|"+(s+1),"|"+(e+1)+"|"+s]),s>0&&e<this.max[s-1]&&e+1<this.max[s]+1&&this.innerFacets.push(["|"+e+"|"+s,"|"+(e+1)+"|"+s,"|"+(e+1)+"|"+(s-1)])}edgeVecsABOB(){let e=this.m,t=this.n,s=new eK(-t,e+t);for(let r=1;r<e+t;r++){let e=new eK(this.min[r],r),t=new eK(this.min[r-1],r-1),i=new eK(this.min[r+1],r+1),a=e.clone(),o=t.clone(),n=i.clone();a.rotate60About(s),o.rotate60About(s),n.rotate60About(s);let l=new eK(this.max[a.y],a.y),h=new eK(this.max[a.y-1],a.y-1),u=new eK(this.max[a.y-1]-1,a.y-1);(a.x!==l.x||a.y!==l.y)&&(a.x!==h.x?(this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,h,u]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,u,l])):a.y===n.y?(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([e,t,h]),this.vertexTypes.push([1,0,1]),this.isoVecsABOB.push([e,h,i])):(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([e,t,h]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([e,h,l])))}}mapABOBtoOBOA(){let e=new eK(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){let s=[];for(let r=0;r<3;r++)e.x=this.isoVecsABOB[t][r].x,e.y=this.isoVecsABOB[t][r].y,0===this.vertexTypes[t][r]&&e.rotateNeg120(this.m,this.n),s.push(e.clone());this.isoVecsOBOA.push(s)}}mapABOBtoBAOA(){let e=new eK(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){let s=[];for(let r=0;r<3;r++)e.x=this.isoVecsABOB[t][r].x,e.y=this.isoVecsABOB[t][r].y,1===this.vertexTypes[t][r]&&e.rotate120(this.m,this.n),s.push(e.clone());this.isoVecsBAOA.push(s)}}MapToFace(e,t){let s,i,a=this.IDATA.face[e],o=a[2],n=a[1],l=a[0],h=r.Vector3.FromArray(this.IDATA.vertex[o]),u=r.Vector3.FromArray(this.IDATA.vertex[n]),c=r.Vector3.FromArray(this.IDATA.vertex[l]),d=u.subtract(h),p=c.subtract(h),f=d.scale(this.coau).add(p.scale(this.cobu)),x=d.scale(this.coav).add(p.scale(this.cobv)),g=[];for(let r=0;r<this.cartesian.length;r++)i=f.scale(this.cartesian[r].x).add(x.scale(this.cartesian[r].y)).add(h),g[r]=[i.x,i.y,i.z],s=e+"|"+this.vertices[r].x+"|"+this.vertices[r].y,t.vertex[this.vecToidx[s]]=[i.x,i.y,i.z]}build(e,t){let s,r,i=[],a=eK.Zero(),o=new eK(e,t),n=new eK(-t,e+t);i.push(a,o,n);for(let s=t;s<e+1;s++)for(let t=0;t<e+1-s;t++)i.push(new eK(t,s));if(t>0){let s=(0,ez.HighestCommonFactor)(e,t),r=e/s,a=t/s;for(let o=1;o<s;o++)i.push(new eK(o*r,o*a)),i.push(new eK(-o*a,o*(r+a))),i.push(new eK(e-o*(r+a),t+o*r));let o=e/t;for(let s=1;s<t;s++)for(let r=0;r<s*o;r++)i.push(new eK(r,s)),i.push(new eK(r,s).rotate120(e,t)),i.push(new eK(r,s).rotateNeg120(e,t))}i.sort((e,t)=>e.x-t.x),i.sort((e,t)=>e.y-t.y);let l=Array(e+t+1),h=Array(e+t+1);for(let e=0;e<l.length;e++)l[e]=1/0,h[e]=-1/0;let u=i.length;for(let e=0;e<u;e++)r=i[e].x,l[s=i[e].y]=Math.min(r,l[s]),h[s]=Math.max(r,h[s]);let c=(s,r)=>{let i=s.clone();return("A"===r&&i.rotateNeg120(e,t),"B"===r&&i.rotate120(e,t),i.x<0)?i.y:i.x+i.y},d=[],p=[],f=[],x=[],g={},m=[],V=-1,O=-1;for(let e=0;e<u;e++)d[e]=i[e].toCartesianOrigin(new eK(0,0),.5),p[e]=c(i[e],"O"),f[e]=c(i[e],"A"),x[e]=c(i[e],"B"),p[e]===f[e]&&f[e]===x[e]?(V=3,O=p[e]):p[e]===f[e]?(V=4,O=p[e]):f[e]===x[e]?(V=5,O=f[e]):x[e]===p[e]&&(V=6,O=p[e]),p[e]<f[e]&&p[e]<x[e]&&(V=2,O=p[e]),f[e]<p[e]&&f[e]<x[e]&&(V=1,O=f[e]),x[e]<f[e]&&x[e]<p[e]&&(V=0,O=x[e]),m.push([V,O,i[e].x,i[e].y]);m.sort((e,t)=>e[2]-t[2]),m.sort((e,t)=>e[3]-t[3]),m.sort((e,t)=>e[1]-t[1]),m.sort((e,t)=>e[0]-t[0]);for(let e=0;e<m.length;e++)g[m[e][2]+"|"+m[e][3]]=[m[e][0],m[e][1],e];return this.m=e,this.n=t,this.vertices=i,this.vertByDist=g,this.cartesian=d,this.min=l,this.max=h,this}}class eq{constructor(e,t,s,r){this.name=e,this.category=t,this.vertex=s,this.face=r}}class ej extends eq{innerToData(e,t){for(let s=0;s<t.innerFacets.length;s++)this.face.push(t.innerFacets[s].map(s=>t.vecToidx[e+s]))}mapABOBtoDATA(e,t){let s=t.IDATA.edgematch[e][0];for(let r=0;r<t.isoVecsABOB.length;r++){let i=[];for(let a=0;a<3;a++)0===t.vertexTypes[r][a]?i.push(e+"|"+t.isoVecsABOB[r][a].x+"|"+t.isoVecsABOB[r][a].y):i.push(s+"|"+t.isoVecsABOB[r][a].x+"|"+t.isoVecsABOB[r][a].y);this.face.push([t.vecToidx[i[0]],t.vecToidx[i[1]],t.vecToidx[i[2]]])}}mapOBOAtoDATA(e,t){let s=t.IDATA.edgematch[e][0];for(let r=0;r<t.isoVecsOBOA.length;r++){let i=[];for(let a=0;a<3;a++)1===t.vertexTypes[r][a]?i.push(e+"|"+t.isoVecsOBOA[r][a].x+"|"+t.isoVecsOBOA[r][a].y):i.push(s+"|"+t.isoVecsOBOA[r][a].x+"|"+t.isoVecsOBOA[r][a].y);this.face.push([t.vecToidx[i[0]],t.vecToidx[i[1]],t.vecToidx[i[2]]])}}mapBAOAtoDATA(e,t){let s=t.IDATA.edgematch[e][2];for(let r=0;r<t.isoVecsBAOA.length;r++){let i=[];for(let a=0;a<3;a++)1===t.vertexTypes[r][a]?i.push(e+"|"+t.isoVecsBAOA[r][a].x+"|"+t.isoVecsBAOA[r][a].y):i.push(s+"|"+t.isoVecsBAOA[r][a].x+"|"+t.isoVecsBAOA[r][a].y);this.face.push([t.vecToidx[i[0]],t.vecToidx[i[1]],t.vecToidx[i[2]]])}}orderData(e){let t=[];for(let e=0;e<13;e++)t[e]=[];let s=e.closestTo;for(let e=0;e<s.length;e++)s[e][0]>-1?s[e][1]>0&&t[s[e][0]].push([e,s[e][1]]):t[12].push([e,s[e][0]]);let r=[];for(let e=0;e<12;e++)r[e]=e;let i=12;for(let e=0;e<12;e++){t[e].sort((e,t)=>e[1]-t[1]);for(let s=0;s<t[e].length;s++)r[t[e][s][0]]=i++}for(let e=0;e<t[12].length;e++)r[t[12][e][0]]=i++;for(let e=0;e<this.vertex.length;e++)this.vertex[e].push(r[e]);this.vertex.sort((e,t)=>e[3]-t[3]);for(let e=0;e<this.vertex.length;e++)this.vertex[e].pop();for(let e=0;e<this.face.length;e++)for(let t=0;t<this.face[e].length;t++)this.face[e][t]=r[this.face[e][t]];this.sharedNodes=t[12].length,this.poleNodes=this.vertex.length-this.sharedNodes}setOrder(e,t){let s=[],r=[],i=t.pop();r.push(i);let a=this.face[i].indexOf(e);a=(a+2)%3;let o=this.face[i][a];s.push(o);let n=0;for(;t.length>0;)i=t[n],this.face[i].indexOf(o)>-1?(a=(this.face[i].indexOf(o)+1)%3,o=this.face[i][a],s.push(o),r.push(i),t.splice(n,1),n=0):n++;return this.adjacentFaces.push(s),r}toGoldbergPolyhedronData(){let e,t,s,r,i,a=new eq("GeoDual","Goldberg",[],[]);a.name="GD dual";let o=this.vertex.length,n=Array(o);for(let e=0;e<o;e++)n[e]=[];for(let e=0;e<this.face.length;e++)for(let t=0;t<3;t++)n[this.face[e][t]].push(e);this.adjacentFaces=[];for(let o=0;o<n.length;o++)for(let l of(a.face[o]=this.setOrder(o,n[o].concat([])),n[o])){e=0,t=0,s=0,r=this.face[l];for(let a=0;a<3;a++)e+=(i=this.vertex[r[a]])[0],t+=i[1],s+=i[2];a.vertex[l]=[e/3,t/3,s/3]}return a}static BuildGeodesicData(e){let t=new ej("Geodesic-m-n","Geodesic",[[0,$.PHI,-1],[-$.PHI,1,0],[-1,0,-$.PHI],[1,0,-$.PHI],[$.PHI,1,0],[0,$.PHI,1],[-1,0,$.PHI],[-$.PHI,-1,0],[0,-$.PHI,-1],[$.PHI,-1,0],[1,0,$.PHI],[0,-$.PHI,1]],[]);e.setIndices(),e.calcCoeffs(),e.createInnerFacets(),e.edgeVecsABOB(),e.mapABOBtoOBOA(),e.mapABOBtoBAOA();for(let s=0;s<e.IDATA.face.length;s++)e.MapToFace(s,t),t.innerToData(s,e),"B"===e.IDATA.edgematch[s][1]&&t.mapABOBtoDATA(s,e),"O"===e.IDATA.edgematch[s][1]&&t.mapOBOAtoDATA(s,e),"A"===e.IDATA.edgematch[s][3]&&t.mapBAOAtoDATA(s,e);return t.orderData(e),t.vertex=t.vertex.map(function(e){let t=e[0],s=e[1],r=e[2],i=Math.sqrt(t*t+s*s+r*r);return e[0]*=1/i,e[1]*=1/i,e[2]*=1/i,e}),t}}var eJ=i;class e$ extends eJ.Mesh{constructor(){super(...arguments),this.goldbergData={faceColors:[],faceCenters:[],faceZaxis:[],faceXaxis:[],faceYaxis:[],nbSharedFaces:0,nbUnsharedFaces:0,nbFaces:0,nbFacesAtPole:0,adjacentFaces:[]}}relatedGoldbergFace(e,t){return void 0===t?(e>this.goldbergData.nbUnsharedFaces-1&&(Z.Logger.Warn("Maximum number of unshared faces used"),e=this.goldbergData.nbUnsharedFaces-1),this.goldbergData.nbUnsharedFaces+e):(e>11&&(Z.Logger.Warn("Last pole used"),e=11),t>this.goldbergData.nbFacesAtPole-1&&(Z.Logger.Warn("Maximum number of faces at a pole used"),t=this.goldbergData.nbFacesAtPole-1),12+e*this.goldbergData.nbFacesAtPole+t)}_changeGoldbergFaceColors(e){for(let t=0;t<e.length;t++){let s=e[t][0],r=e[t][1],i=e[t][2];for(let e=s;e<r+1;e++)this.goldbergData.faceColors[e]=i}let t=[];for(let e=0;e<12;e++)for(let s=0;s<5;s++)t.push(this.goldbergData.faceColors[e].r,this.goldbergData.faceColors[e].g,this.goldbergData.faceColors[e].b,this.goldbergData.faceColors[e].a);for(let e=12;e<this.goldbergData.faceColors.length;e++)for(let s=0;s<6;s++)t.push(this.goldbergData.faceColors[e].r,this.goldbergData.faceColors[e].g,this.goldbergData.faceColors[e].b,this.goldbergData.faceColors[e].a);return t}setGoldbergFaceColors(e){let t=this._changeGoldbergFaceColors(e);this.setVerticesData(a.VertexBuffer.ColorKind,t)}updateGoldbergFaceColors(e){let t=this._changeGoldbergFaceColors(e);this.updateVerticesData(a.VertexBuffer.ColorKind,t)}_changeGoldbergFaceUVs(e){let t=this.getVerticesData(a.VertexBuffer.UVKind);for(let s=0;s<e.length;s++){let r,i,a=e[s][0],o=e[s][1],n=e[s][2],l=e[s][3],h=e[s][4],u=[],c=[];for(let e=0;e<5;e++)r=n.x+l*Math.cos(h+e*Math.PI/2.5),i=n.y+l*Math.sin(h+e*Math.PI/2.5),r<0&&(r=0),r>1&&(r=1),u.push(r,i);for(let e=0;e<6;e++)r=n.x+l*Math.cos(h+e*Math.PI/3),i=n.y+l*Math.sin(h+e*Math.PI/3),r<0&&(r=0),r>1&&(r=1),c.push(r,i);for(let e=a;e<Math.min(12,o+1);e++)for(let s=0;s<5;s++)t[10*e+2*s]=u[2*s],t[10*e+2*s+1]=u[2*s+1];for(let e=Math.max(12,a);e<o+1;e++)for(let s=0;s<6;s++)t[12*e-24+2*s]=c[2*s],t[12*e-23+2*s]=c[2*s+1]}return t}setGoldbergFaceUVs(e){let t=this._changeGoldbergFaceUVs(e);this.setVerticesData(a.VertexBuffer.UVKind,t)}updateGoldbergFaceUVs(e){let t=this._changeGoldbergFaceUVs(e);this.updateVerticesData(a.VertexBuffer.UVKind,t)}placeOnGoldbergFaceAt(e,t,s){e.rotation=r.Vector3.RotationFromAxis(this.goldbergData.faceXaxis[t],this.goldbergData.faceYaxis[t],this.goldbergData.faceZaxis[t]),e.position=this.goldbergData.faceCenters[t].add(this.goldbergData.faceXaxis[t].scale(s.x)).add(this.goldbergData.faceYaxis[t].scale(s.y)).add(this.goldbergData.faceZaxis[t].scale(s.z))}serialize(e){super.serialize(e),e.type="GoldbergMesh";let t={};if(t.adjacentFaces=this.goldbergData.adjacentFaces,t.nbSharedFaces=this.goldbergData.nbSharedFaces,t.nbUnsharedFaces=this.goldbergData.nbUnsharedFaces,t.nbFaces=this.goldbergData.nbFaces,t.nbFacesAtPole=this.goldbergData.nbFacesAtPole,this.goldbergData.faceColors)for(let e of(t.faceColors=[],this.goldbergData.faceColors))t.faceColors.push(e.asArray());if(this.goldbergData.faceCenters)for(let e of(t.faceCenters=[],this.goldbergData.faceCenters))t.faceCenters.push(e.asArray());if(this.goldbergData.faceZaxis)for(let e of(t.faceZaxis=[],this.goldbergData.faceZaxis))t.faceZaxis.push(e.asArray());if(this.goldbergData.faceYaxis)for(let e of(t.faceYaxis=[],this.goldbergData.faceYaxis))t.faceYaxis.push(e.asArray());if(this.goldbergData.faceXaxis)for(let e of(t.faceXaxis=[],this.goldbergData.faceXaxis))t.faceXaxis.push(e.asArray());e.goldbergData=t}static Parse(e,t){let s=e.goldbergData;s.faceColors=s.faceColors.map(e=>f.Color4.FromArray(e)),s.faceCenters=s.faceCenters.map(e=>r.Vector3.FromArray(e)),s.faceZaxis=s.faceZaxis.map(e=>r.Vector3.FromArray(e)),s.faceXaxis=s.faceXaxis.map(e=>r.Vector3.FromArray(e)),s.faceYaxis=s.faceYaxis.map(e=>r.Vector3.FromArray(e));let i=new e$(e.name,t);return i.goldbergData=s,i}}var e1=e.i(59136);class e0{constructor(e){this._paths=[],this._tempPaths=[],this._holes=[],this._resolution=e}moveTo(e,t){this._currentPath=new J.Path2(e,t),this._tempPaths.push(this._currentPath)}lineTo(e,t){this._currentPath.addLineTo(e,t)}quadraticCurveTo(e,t,s,r){this._currentPath.addQuadraticCurveTo(e,t,s,r,this._resolution)}bezierCurveTo(e,t,s,r,i,a){this._currentPath.addBezierCurveTo(e,t,s,r,i,a,this._resolution)}extractHoles(){for(let e of this._tempPaths)e.area()>0?this._holes.push(e):this._paths.push(e);if(!this._paths.length&&this._holes.length){let e=this._holes;this._holes=this._paths,this._paths=e}this._tempPaths.length=0}get paths(){return this._paths}get holes(){return this._holes}}let e2={CreateBox:g,CreateTiledBox:function(e,t,s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,M(t).applyToMesh(r,t.updatable),r},CreateSphere:b,CreateDisc:d,CreateIcoSphere:eL,CreateRibbon:h,CreateCylinder:w,CreateTorus:P,CreateTorusKnot:z,CreateLineSystem:Y,CreateLines:K,CreateDashedLines:Q,ExtrudeShape:el,ExtrudeShapeCustom:eh,CreateLathe:ed,CreateTiledPlane:function(e,t,s=null){let r=new i.Mesh(e,s);return t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),r._originalBuilderSideOrientation=t.sideOrientation,V(t).applyToMesh(r,t.updatable),r},CreatePlane:ex,CreateGround:eT,CreateTiledGround:eb,CreateGroundFromHeightMap:ev,CreatePolygon:ea,ExtrudePolygon:eo,CreateTube:eA,CreatePolyhedron:eF,CreateGeodesic:function(e,t,s=null){let r=t.m||1;r!==Math.floor(r)&&(r=Math.floor(r),Z.Logger.Warn("m not an integer only floor(m) used"));let i=t.n||0;if(i!==Math.floor(i)&&(i=Math.floor(i),Z.Logger.Warn("n not an integer only floor(n) used")),i>r){let e=i;i=r,r=e,Z.Logger.Warn("n > m therefore m and n swapped")}let a=new eQ;return a.build(r,i),eF(e,{custom:ej.BuildGeodesicData(a),size:t.size,sizeX:t.sizeX,sizeY:t.sizeY,sizeZ:t.sizeZ,faceUV:t.faceUV,faceColors:t.faceColors,flat:t.flat,updatable:t.updatable,sideOrientation:t.sideOrientation,frontUVs:t.frontUVs,backUVs:t.backUVs},s)},CreateGoldberg:function(e,t,s=null){let a=t.size,l=t.sizeX||a||1,h=t.sizeY||a||1,u=t.sizeZ||a||1,c=t.m||1;c!==Math.floor(c)&&(c=Math.floor(c),Z.Logger.Warn("m not an integer only floor(m) used"));let d=t.n||0;if(d!==Math.floor(d)&&(d=Math.floor(d),Z.Logger.Warn("n not an integer only floor(n) used")),d>c){let e=d;d=c,c=e,Z.Logger.Warn("n > m therefore m and n swapped")}let p=new eQ;p.build(c,d);let x=ej.BuildGeodesicData(p),g=x.toGoldbergPolyhedronData(),m=new e$(e,s);t.sideOrientation=i.Mesh._GetDefaultSideOrientation(t.sideOrientation),m._originalBuilderSideOrientation=t.sideOrientation,(function(e,t){let s=e.size,i=e.sizeX||s||1,a=e.sizeY||s||1,l=e.sizeZ||s||1,h=0===e.sideOrientation?0:e.sideOrientation||o.VertexData.DEFAULTSIDE,u=[],c=[],d=[],p=[],f=1/0,x=-1/0,g=1/0,m=-1/0;for(let e=0;e<t.vertex.length;e++)f=Math.min(f,t.vertex[e][0]*i),x=Math.max(x,t.vertex[e][0]*i),g=Math.min(g,t.vertex[e][1]*a),m=Math.max(m,t.vertex[e][1]*a);let V=0;for(let e=0;e<t.face.length;e++){let s=t.face[e],o=r.Vector3.FromArray(t.vertex[s[0]]),h=r.Vector3.FromArray(t.vertex[s[2]]),O=r.Vector3.FromArray(t.vertex[s[1]]),_=h.subtract(o),M=O.subtract(o),y=r.Vector3.Cross(M,_).normalize();for(let e=0;e<s.length;e++){d.push(y.x,y.y,y.z);let r=t.vertex[s[e]];u.push(r[0]*i,r[1]*a,r[2]*l);let o=(r[1]*a-g)/(m-g);p.push((r[0]*i-f)/(x-f),n.useOpenGLOrientationForUV?1-o:o)}for(let e=0;e<s.length-2;e++)c.push(V,V+e+2,V+e+1);V+=s.length}o.VertexData._ComputeSides(h,u,c,d,p);let O=new o.VertexData;return O.positions=u,O.indices=c,O.normals=d,O.uvs=p,O})(t,g).applyToMesh(m,t.updatable),m.goldbergData.nbSharedFaces=x.sharedNodes,m.goldbergData.nbUnsharedFaces=x.poleNodes,m.goldbergData.adjacentFaces=x.adjacentFaces,m.goldbergData.nbFaces=m.goldbergData.nbSharedFaces+m.goldbergData.nbUnsharedFaces,m.goldbergData.nbFacesAtPole=(m.goldbergData.nbUnsharedFaces-12)/12;for(let e=0;e<x.vertex.length;e++)m.goldbergData.faceCenters.push(r.Vector3.FromArray(x.vertex[e])),m.goldbergData.faceCenters[e].x*=l,m.goldbergData.faceCenters[e].y*=h,m.goldbergData.faceCenters[e].z*=u,m.goldbergData.faceColors.push(new f.Color4(1,1,1,1));for(let e=0;e<g.face.length;e++){let t=g.face[e],s=r.Vector3.FromArray(g.vertex[t[0]]),i=r.Vector3.FromArray(g.vertex[t[2]]),a=r.Vector3.FromArray(g.vertex[t[1]]),o=i.subtract(s),n=a.subtract(s),l=r.Vector3.Cross(n,o).normalize(),h=r.Vector3.Cross(n,l).normalize();m.goldbergData.faceXaxis.push(n.normalize()),m.goldbergData.faceYaxis.push(l),m.goldbergData.faceZaxis.push(h)}return m},CreateDecal:eH,CreateCapsule:ek,CreateText:function(e,t,s,a={size:50,resolution:8,depth:1},o=null,n=earcut){let l=function(e,t,s,r){let i=Array.from(e),a=t/r.resolution,o=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*a,n=[],l=0,h=0;for(let e=0;e<i.length;e++){let t=i[e];if("\n"===t)l=0,h-=o;else{let e=function(e,t,s,r,i,a){let o=a.glyphs[e]||a.glyphs["?"];if(!o)return null;let n=new e0(i);if(o.o){let e=o.o.split(" ");for(let i=0,a=e.length;i<a;)switch(e[i++]){case"m":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r;n.moveTo(a,o);break}case"l":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r;n.lineTo(a,o);break}case"q":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r,l=parseInt(e[i++])*t+s,h=parseInt(e[i++])*t+r;n.quadraticCurveTo(l,h,a,o);break}case"b":{let a=parseInt(e[i++])*t+s,o=parseInt(e[i++])*t+r,l=parseInt(e[i++])*t+s,h=parseInt(e[i++])*t+r,u=parseInt(e[i++])*t+s,c=parseInt(e[i++])*t+r;n.bezierCurveTo(l,h,u,c,a,o)}}}return n.extractHoles(),{offsetX:o.ha*t,shapePath:n}}(t,a,l,h,s,r);e&&(l+=e.offsetX,n.push(e.shapePath))}}return n}(t,a.size||50,a.resolution||8,s),h=[],u=0;for(let t of l){if(!t.paths.length)continue;let s=t.holes.slice();for(let l of t.paths){let t=[],c=[];for(let e of l.getPoints())c.push(new r.Vector3(e.x,0,e.y));for(let e of s.slice()){let i=e.getPoints(),a=!1;for(let e of i)if(l.isPointInside(e)){a=!0;break}if(!a)continue;let o=[];for(let e of i)o.push(new r.Vector3(e.x,0,e.y));t.push(o),s.splice(s.indexOf(e),1)}if(!t.length&&s.length)for(let e of s){let s=e.getPoints(),i=[];for(let e of s)i.push(new r.Vector3(e.x,0,e.y));t.push(i)}let d=eo(e,{shape:c,holes:t.length?t:void 0,depth:a.depth||1,faceUV:a.faceUV||a.perLetterFaceUV?.(u),faceColors:a.faceColors||a.perLetterFaceColors?.(u),sideOrientation:i.Mesh._GetDefaultSideOrientation(a.sideOrientation||i.Mesh.DOUBLESIDE)},o,n);h.push(d),u++}}let c=i.Mesh.MergeMeshes(h,!0,!0);if(c){let t=c.getBoundingInfo().boundingBox;c.position.x+=-(t.minimumWorld.x+t.maximumWorld.x)/2,c.position.y+=-(t.minimumWorld.y+t.maximumWorld.y)/2,c.position.z+=-(t.minimumWorld.z+t.maximumWorld.z)/2+t.extendSize.z,c.name=e;let s=new e1.TransformNode("pivot",o);s.rotation.x=-Math.PI/2,c.parent=s,c.bakeCurrentTransformIntoVertices(),c.parent=null,s.dispose()}return c}};e.s(["MeshBuilder",0,e2],17867),e.i(17867),e.s(["MeshBuilder",0,e2],88344)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41876,e=>{"use strict";var t=e.i(95358),o=e.i(28341),a=e.i(79452);let r=!1;e.s(["_ENVTextureLoader",0,class{constructor(){this.supportCascades=!1}loadCubeData(e,l,i,n,s){if(Array.isArray(e))return;let c=(0,t.GetEnvInfo)(e);if(c){l.width=c.width,l.height=c.width;try{r||(r=!0,a.BaseTexture.prototype._sphericalPolynomialTargetSize=0,a.BaseTexture.prototype.forceSphericalPolynomialsRecompute=function(){this._texture&&(this._texture._sphericalPolynomial=null,this._texture._sphericalPolynomialPromise=null,this._texture._sphericalPolynomialComputed=!1)},Object.defineProperty(a.BaseTexture.prototype,"sphericalPolynomial",{get:function(){if(this._texture){if(this._texture._sphericalPolynomial||this._texture._sphericalPolynomialComputed)return this._texture._sphericalPolynomial;this._texture.isReady&&(this._texture._sphericalPolynomialPromise||(this._texture._sphericalPolynomialPromise=o.CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial(this),null===this._texture._sphericalPolynomialPromise?this._texture._sphericalPolynomialComputed=!0:this._texture._sphericalPolynomialPromise.then(e=>{this._texture._sphericalPolynomial=e,this._texture._sphericalPolynomialComputed=!0})))}return null},set:function(e){this._texture&&(this._texture._sphericalPolynomial=e)},enumerable:!0,configurable:!0})),(0,t.UploadEnvSpherical)(l,c),(0,t.UploadEnvLevelsAsync)(l,e,c).then(()=>{l.isReady=!0,l.onLoadedObservable.notifyObservers(l),l.onLoadedObservable.clear(),n&&n()},e=>{s?.("Can not upload environment levels",e)})}catch(e){s?.("Can not upload environment file",e)}}else s&&s("Can not parse the environment file",null)}loadData(){throw".env not supported in 2d."}}],41876)},28341,e=>{"use strict";var t=e.i(72003),o=e.i(46202),a=e.i(27952),r=e.i(26747),l=e.i(64073);class i{constructor(e,t,o,a){this.name=e,this.worldAxisForNormal=t,this.worldAxisForFileX=o,this.worldAxisForFileY=a}}class n{static _NearestPow2Floor(e){return e<=1?1:1<<Math.floor(Math.log2(e))}static ConvertCubeMapTextureToSphericalPolynomial(e){let t,o;if(!e.isCube)return null;e.getScene()?.getEngine().flushFramebuffer();let a=e.getSize().width,r=e._sphericalPolynomialTargetSize,l=r>0?this._NearestPow2Floor(r):0,i=!e.noMipmap&&e._texture?.generateMipMaps===!0,n=l>0&&l<a&&i,s=n?Math.max(0,Math.round(Math.log2(a/l))):0,c=n?Math.max(1,Math.floor(a/Math.pow(2,s))):a,h=e.readPixels(0,s,void 0,!1),p=e.readPixels(1,s,void 0,!1);e.isRenderTarget?(t=e.readPixels(3,s,void 0,!1),o=e.readPixels(2,s,void 0,!1)):(t=e.readPixels(2,s,void 0,!1),o=e.readPixels(3,s,void 0,!1));let m=e.readPixels(4,s,void 0,!1),u=e.readPixels(5,s,void 0,!1),d=e.gammaSpace,_=l>0&&l<a&&!n;return new Promise(e=>{Promise.all([p,h,t,o,m,u]).then(([t,o,r,i,n,s])=>{let h=c;_&&(t=this._DownsampleFace(t,a,l,4),o=this._DownsampleFace(o,a,l,4),r=this._DownsampleFace(r,a,l,4),i=this._DownsampleFace(i,a,l,4),n=this._DownsampleFace(n,a,l,4),s=this._DownsampleFace(s,a,l,4),h=l);let p={size:h,right:o,left:t,up:r,down:i,front:n,back:s,format:5,type:+(t instanceof Float32Array),gammaSpace:d};e(this.ConvertCubeMapToSphericalPolynomial(p))})})}static _AreaElement(e,t){return Math.atan2(e*t,Math.sqrt(e*e+t*t+1))}static _DownsampleFace(e,t,o,a){let r=e instanceof Float32Array?e:Float32Array.from(e),l=o*o*a,i=new Float32Array(l),n=t/o,s=1/(n*n);for(let e=0;e<o;e++){let l=Math.floor(e*n),c=Math.floor((e+1)*n);for(let h=0;h<o;h++){let p=Math.floor(h*n),m=Math.floor((h+1)*n),u=(e*o+h)*a;for(let e=0;e<a;e++){let o=0;for(let i=l;i<c;i++)for(let l=p;l<m;l++)o+=r[(i*t+l)*a+e];i[u+e]=o*s}}}if(e instanceof Float32Array)return i;let c=new e.constructor(l);for(let e=0;e<l;e++)c[e]=i[e]+.5|0;return c}static ConvertCubeMapToSphericalPolynomial(e,t=0){let i=t>0?this._NearestPow2Floor(t):0;if(i>0&&e.size>i){let t=5===e.format?4:3,o={};for(let a of["right","left","up","down","front","back"])o[a]=this._DownsampleFace(e[a],e.size,i,t);e={...e,...o,size:i}}let n=new a.SphericalHarmonics,s=0,c=2/e.size,h=.5*c,p=h-1;for(let t=0;t<6;t++){let a=this._FileFaces[t],i=e[a.name],m=p,u=5===e.format?4:3;for(let t=0;t<e.size;t++){let d=p;for(let p=0;p<e.size;p++){let _=a.worldAxisForFileX.scale(d).add(a.worldAxisForFileY.scale(m)).add(a.worldAxisForNormal);_.normalize();let w=this._AreaElement(d-h,m-h)-this._AreaElement(d-h,m+h)-this._AreaElement(d+h,m-h)+this._AreaElement(d+h,m+h),P=i[t*e.size*u+p*u+0],f=i[t*e.size*u+p*u+1],y=i[t*e.size*u+p*u+2];isNaN(P)&&(P=0),isNaN(f)&&(f=0),isNaN(y)&&(y=0),0===e.type&&(P/=255,f/=255,y/=255),e.gammaSpace&&(P=Math.pow((0,o.Clamp)(P),r.ToLinearSpace),f=Math.pow((0,o.Clamp)(f),r.ToLinearSpace),y=Math.pow((0,o.Clamp)(y),r.ToLinearSpace));let x=this.MAX_HDRI_VALUE;if(this.PRESERVE_CLAMPED_COLORS){let e=Math.max(P,f,y);if(e>x){let t=x/e;P*=t,f*=t,y*=t}}else P=(0,o.Clamp)(P,0,x),f=(0,o.Clamp)(f,0,x),y=(0,o.Clamp)(y,0,x);let C=new l.Color3(P,f,y);n.addLight(_,C,w),s+=w,d+=c}m+=c}}let m=4*Math.PI*6/6/s;return n.scaleInPlace(m),n.convertIncidentRadianceToIrradiance(),n.convertIrradianceToLambertianRadiance(),a.SphericalPolynomial.FromHarmonics(n)}}n._FileFaces=[new i("right",new t.Vector3(1,0,0),new t.Vector3(0,0,-1),new t.Vector3(0,-1,0)),new i("left",new t.Vector3(-1,0,0),new t.Vector3(0,0,1),new t.Vector3(0,-1,0)),new i("up",new t.Vector3(0,1,0),new t.Vector3(1,0,0),new t.Vector3(0,0,1)),new i("down",new t.Vector3(0,-1,0),new t.Vector3(1,0,0),new t.Vector3(0,0,-1)),new i("front",new t.Vector3(0,0,1),new t.Vector3(1,0,0),new t.Vector3(0,-1,0)),new i("back",new t.Vector3(0,0,-1),new t.Vector3(-1,0,0),new t.Vector3(0,-1,0))],n.MAX_HDRI_VALUE=4096,n.PRESERVE_CLAMPED_COLORS=!1,e.s(["CubeMapToSphericalPolynomialTools",0,n])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98391,e=>{"use strict";var t=e.i(79916),o=e.i(99373),a=e.i(65042);let r=!1;e.s(["_ENVTextureLoader",0,class{constructor(){this.supportCascades=!1}loadCubeData(e,l,i,n,s){if(Array.isArray(e))return;let c=(0,t.GetEnvInfo)(e);if(c){l.width=c.width,l.height=c.width;try{r||(r=!0,a.BaseTexture.prototype._sphericalPolynomialTargetSize=0,a.BaseTexture.prototype.forceSphericalPolynomialsRecompute=function(){this._texture&&(this._texture._sphericalPolynomial=null,this._texture._sphericalPolynomialPromise=null,this._texture._sphericalPolynomialComputed=!1)},Object.defineProperty(a.BaseTexture.prototype,"sphericalPolynomial",{get:function(){if(this._texture){if(this._texture._sphericalPolynomial||this._texture._sphericalPolynomialComputed)return this._texture._sphericalPolynomial;this._texture.isReady&&(this._texture._sphericalPolynomialPromise||(this._texture._sphericalPolynomialPromise=o.CubeMapToSphericalPolynomialTools.ConvertCubeMapTextureToSphericalPolynomial(this),null===this._texture._sphericalPolynomialPromise?this._texture._sphericalPolynomialComputed=!0:this._texture._sphericalPolynomialPromise.then(e=>{this._texture._sphericalPolynomial=e,this._texture._sphericalPolynomialComputed=!0})))}return null},set:function(e){this._texture&&(this._texture._sphericalPolynomial=e)},enumerable:!0,configurable:!0})),(0,t.UploadEnvSpherical)(l,c),(0,t.UploadEnvLevelsAsync)(l,e,c).then(()=>{l.isReady=!0,l.onLoadedObservable.notifyObservers(l),l.onLoadedObservable.clear(),n&&n()},e=>{s?.("Can not upload environment levels",e)})}catch(e){s?.("Can not upload environment file",e)}}else s&&s("Can not parse the environment file",null)}loadData(){throw".env not supported in 2d."}}],98391)},99373,e=>{"use strict";var t=e.i(56173),o=e.i(76197),a=e.i(81705),r=e.i(33491),l=e.i(24617);class i{constructor(e,t,o,a){this.name=e,this.worldAxisForNormal=t,this.worldAxisForFileX=o,this.worldAxisForFileY=a}}class n{static _NearestPow2Floor(e){return e<=1?1:1<<Math.floor(Math.log2(e))}static ConvertCubeMapTextureToSphericalPolynomial(e){let t,o;if(!e.isCube)return null;e.getScene()?.getEngine().flushFramebuffer();let a=e.getSize().width,r=e._sphericalPolynomialTargetSize,l=r>0?this._NearestPow2Floor(r):0,i=!e.noMipmap&&e._texture?.generateMipMaps===!0,n=l>0&&l<a&&i,s=n?Math.max(0,Math.round(Math.log2(a/l))):0,c=n?Math.max(1,Math.floor(a/Math.pow(2,s))):a,h=e.readPixels(0,s,void 0,!1),p=e.readPixels(1,s,void 0,!1);e.isRenderTarget?(t=e.readPixels(3,s,void 0,!1),o=e.readPixels(2,s,void 0,!1)):(t=e.readPixels(2,s,void 0,!1),o=e.readPixels(3,s,void 0,!1));let m=e.readPixels(4,s,void 0,!1),u=e.readPixels(5,s,void 0,!1),d=e.gammaSpace,_=l>0&&l<a&&!n;return new Promise(e=>{Promise.all([p,h,t,o,m,u]).then(([t,o,r,i,n,s])=>{let h=c;_&&(t=this._DownsampleFace(t,a,l,4),o=this._DownsampleFace(o,a,l,4),r=this._DownsampleFace(r,a,l,4),i=this._DownsampleFace(i,a,l,4),n=this._DownsampleFace(n,a,l,4),s=this._DownsampleFace(s,a,l,4),h=l);let p={size:h,right:o,left:t,up:r,down:i,front:n,back:s,format:5,type:+(t instanceof Float32Array),gammaSpace:d};e(this.ConvertCubeMapToSphericalPolynomial(p))})})}static _AreaElement(e,t){return Math.atan2(e*t,Math.sqrt(e*e+t*t+1))}static _DownsampleFace(e,t,o,a){let r=e instanceof Float32Array?e:Float32Array.from(e),l=o*o*a,i=new Float32Array(l),n=t/o,s=1/(n*n);for(let e=0;e<o;e++){let l=Math.floor(e*n),c=Math.floor((e+1)*n);for(let h=0;h<o;h++){let p=Math.floor(h*n),m=Math.floor((h+1)*n),u=(e*o+h)*a;for(let e=0;e<a;e++){let o=0;for(let i=l;i<c;i++)for(let l=p;l<m;l++)o+=r[(i*t+l)*a+e];i[u+e]=o*s}}}if(e instanceof Float32Array)return i;let c=new e.constructor(l);for(let e=0;e<l;e++)c[e]=i[e]+.5|0;return c}static ConvertCubeMapToSphericalPolynomial(e,t=0){let i=t>0?this._NearestPow2Floor(t):0;if(i>0&&e.size>i){let t=5===e.format?4:3,o={};for(let a of["right","left","up","down","front","back"])o[a]=this._DownsampleFace(e[a],e.size,i,t);e={...e,...o,size:i}}let n=new a.SphericalHarmonics,s=0,c=2/e.size,h=.5*c,p=h-1;for(let t=0;t<6;t++){let a=this._FileFaces[t],i=e[a.name],m=p,u=5===e.format?4:3;for(let t=0;t<e.size;t++){let d=p;for(let p=0;p<e.size;p++){let _=a.worldAxisForFileX.scale(d).add(a.worldAxisForFileY.scale(m)).add(a.worldAxisForNormal);_.normalize();let w=this._AreaElement(d-h,m-h)-this._AreaElement(d-h,m+h)-this._AreaElement(d+h,m-h)+this._AreaElement(d+h,m+h),P=i[t*e.size*u+p*u+0],f=i[t*e.size*u+p*u+1],y=i[t*e.size*u+p*u+2];isNaN(P)&&(P=0),isNaN(f)&&(f=0),isNaN(y)&&(y=0),0===e.type&&(P/=255,f/=255,y/=255),e.gammaSpace&&(P=Math.pow((0,o.Clamp)(P),r.ToLinearSpace),f=Math.pow((0,o.Clamp)(f),r.ToLinearSpace),y=Math.pow((0,o.Clamp)(y),r.ToLinearSpace));let x=this.MAX_HDRI_VALUE;if(this.PRESERVE_CLAMPED_COLORS){let e=Math.max(P,f,y);if(e>x){let t=x/e;P*=t,f*=t,y*=t}}else P=(0,o.Clamp)(P,0,x),f=(0,o.Clamp)(f,0,x),y=(0,o.Clamp)(y,0,x);let C=new l.Color3(P,f,y);n.addLight(_,C,w),s+=w,d+=c}m+=c}}let m=4*Math.PI*6/6/s;return n.scaleInPlace(m),n.convertIncidentRadianceToIrradiance(),n.convertIrradianceToLambertianRadiance(),a.SphericalPolynomial.FromHarmonics(n)}}n._FileFaces=[new i("right",new t.Vector3(1,0,0),new t.Vector3(0,0,-1),new t.Vector3(0,-1,0)),new i("left",new t.Vector3(-1,0,0),new t.Vector3(0,0,1),new t.Vector3(0,-1,0)),new i("up",new t.Vector3(0,1,0),new t.Vector3(1,0,0),new t.Vector3(0,0,1)),new i("down",new t.Vector3(0,-1,0),new t.Vector3(1,0,0),new t.Vector3(0,0,-1)),new i("front",new t.Vector3(0,0,1),new t.Vector3(1,0,0),new t.Vector3(0,-1,0)),new i("back",new t.Vector3(0,0,-1),new t.Vector3(-1,0,0),new t.Vector3(0,-1,0))],n.MAX_HDRI_VALUE=4096,n.PRESERVE_CLAMPED_COLORS=!1,e.s(["CubeMapToSphericalPolynomialTools",0,n])}]);