@uptimizr/dashboard 0.1.2 → 0.2.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 (240) hide show
  1. package/out/404.html +1 -1
  2. package/out/__next.__PAGE__.txt +4 -4
  3. package/out/__next._full.txt +11 -11
  4. package/out/__next._head.txt +4 -4
  5. package/out/__next._index.txt +4 -4
  6. package/out/__next._tree.txt +2 -2
  7. package/out/_next/static/chunks/002cjeoit6-up.js +1 -0
  8. package/out/_next/static/chunks/02n1uiltexy3w.js +1 -0
  9. package/out/_next/static/chunks/03ab2khhe8-x5.js +1 -0
  10. package/out/_next/static/chunks/04_yytpc2paxy.js +1 -0
  11. package/out/_next/static/chunks/06qot1qvlsqaz.js +1 -0
  12. package/out/_next/static/chunks/07eeopuufsqp-.js +1501 -0
  13. package/out/_next/static/chunks/08a5xek662n8n.js +1 -0
  14. package/out/_next/static/chunks/08wuc9--s8zn_.js +1 -0
  15. package/out/_next/static/chunks/0927l-ygd5c8d.js +1 -0
  16. package/out/_next/static/chunks/09510356f0lad.js +1 -0
  17. package/out/_next/static/chunks/0_eu72k69lxj7.js +1 -0
  18. package/out/_next/static/chunks/0beajlqy8p8b5.js +1 -0
  19. package/out/_next/static/chunks/0c83pe1mpx456.js +1 -0
  20. package/out/_next/static/chunks/0echnagbkyx79.js +1198 -0
  21. package/out/_next/static/chunks/0eh1ml86u8dh7.js +1 -0
  22. package/out/_next/static/chunks/0fh-9h9ylxskr.js +674 -0
  23. package/out/_next/static/chunks/0fzmc1up21g1i.js +1 -0
  24. package/out/_next/static/chunks/0g_v2zswo4l6f.js +1 -0
  25. package/out/_next/static/chunks/0grlb9lo8e502.js +1 -0
  26. package/out/_next/static/chunks/0h22pg-0xrxnm.js +1 -0
  27. package/out/_next/static/chunks/0j6p1pmc14t96.js +1 -0
  28. package/out/_next/static/chunks/0j_6dx-sttgsy.js +1 -0
  29. package/out/_next/static/chunks/0j__xaq_8_di1.js +1 -0
  30. package/out/_next/static/chunks/0kfd-cvj5fvtz.js +1 -0
  31. package/out/_next/static/chunks/0o_mp98xzqfyf.js +1 -0
  32. package/out/_next/static/chunks/0otsec99kdkt7.js +213 -0
  33. package/out/_next/static/chunks/0ql-s-tsmel_u.js +151 -0
  34. package/out/_next/static/chunks/0r47gs_e93cka.js +1 -0
  35. package/out/_next/static/chunks/0sqys6o2pbe1q.js +1328 -0
  36. package/out/_next/static/chunks/0titqrn1qmcsv.js +1 -0
  37. package/out/_next/static/chunks/0tnlbw78tgaxp.js +4 -0
  38. package/out/_next/static/chunks/0tw4dyl-cp-hd.js +1 -0
  39. package/out/_next/static/chunks/0vbce-8omgurc.js +1 -0
  40. package/out/_next/static/chunks/0vfsg5byzep_0.js +1 -0
  41. package/out/_next/static/chunks/{0gv7mblzv3dl3.js → 0w8_1yjvol1f0.js} +20 -20
  42. package/out/_next/static/chunks/0xh144a5fz58h.js +1 -0
  43. package/out/_next/static/chunks/0xjltg_pph0c8.js +1 -0
  44. package/out/_next/static/chunks/0yeqgh0dnas8d.js +1 -0
  45. package/out/_next/static/chunks/101-7e_7up7rk.js +1 -0
  46. package/out/_next/static/chunks/128e51hj_04r0.js +1 -0
  47. package/out/_next/static/chunks/{10fnxpln_5xfd.js → 12kv810lohbsx.js} +2 -2
  48. package/out/_next/static/chunks/137xbvd4nd41j.js +3 -0
  49. package/out/_next/static/chunks/14bws-suyy5zu.js +1 -0
  50. package/out/_next/static/chunks/14ggsmqwej_tt.js +1656 -0
  51. package/out/_next/static/chunks/17genz6pkmty_.js +1 -0
  52. package/out/_next/static/chunks/17xd8hnazzr0g.js +1454 -0
  53. package/out/_next/static/chunks/18dczy9ylt2s_.js +1 -0
  54. package/out/_next/static/chunks/18xs_kvsaolb0.js +1 -0
  55. package/out/_next/static/chunks/19016f8-ry0z6.js +1 -0
  56. package/out/_next/static/chunks/1_6oejyxj39li.js +1 -0
  57. package/out/_next/static/chunks/1_aon8nz9p1fr.js +1 -0
  58. package/out/_next/static/chunks/1_qzlkuxukhpq.js +779 -0
  59. package/out/_next/static/chunks/1akaj5rhgitn3.js +1 -0
  60. package/out/_next/static/chunks/1bvl1ws7b_3gn.js +1 -0
  61. package/out/_next/static/chunks/1cdbk6kxyr1c9.js +1 -0
  62. package/out/_next/static/chunks/1fbjkk55uu4_g.js +1 -0
  63. package/out/_next/static/chunks/1furcfsgrw_3g.js +1 -0
  64. package/out/_next/static/chunks/1g0-f1g3gn_rs.js +1 -0
  65. package/out/_next/static/chunks/1g7emwu85bifo.js +557 -0
  66. package/out/_next/static/chunks/{37vzwr3ciejf1.js → 1gs-5722l4u59.js} +1 -1
  67. package/out/_next/static/chunks/1gt4kh0_xmigy.js +1 -0
  68. package/out/_next/static/chunks/1h8xzuuhhglu9.js +1 -0
  69. package/out/_next/static/chunks/1hatz-jlztrn0.js +1 -0
  70. package/out/_next/static/chunks/1iioifo7i0t0_.js +1 -0
  71. package/out/_next/static/chunks/{0impkpmxx3ttp.js → 1iiz7jqgj20z0.js} +1 -1
  72. package/out/_next/static/chunks/1kujmd5n0j9nk.js +1 -0
  73. package/out/_next/static/chunks/{2kazjq29jeamx.js → 1ltux4lwz7muf.js} +160 -372
  74. package/out/_next/static/chunks/1m_buecgcq67j.js +740 -0
  75. package/out/_next/static/chunks/1n9sy0yt5d2vq.js +1 -0
  76. package/out/_next/static/chunks/1p1gz6dseck--.js +1 -0
  77. package/out/_next/static/chunks/1p1xtsfwvpuqo.js +1 -0
  78. package/out/_next/static/chunks/1p8f6okk2ewbz.js +1 -0
  79. package/out/_next/static/chunks/1qg_etglhvp9h.js +740 -0
  80. package/out/_next/static/chunks/1th_t5ujeqlkf.js +1 -0
  81. package/out/_next/static/chunks/1thr-mdzbu96v.js +1 -0
  82. package/out/_next/static/chunks/1tta1a064979p.js +1 -0
  83. package/out/_next/static/chunks/1u_riwm0nfww7.js +1 -0
  84. package/out/_next/static/chunks/1ua15kzid0_8p.js +2560 -0
  85. package/out/_next/static/chunks/1uu-rt_8p1edp.js +2712 -0
  86. package/out/_next/static/chunks/1uu93wuxigx4k.js +1 -0
  87. package/out/_next/static/chunks/{1flb8adpj6_2o.js → 1xpwp4m1tqugp.js} +1 -1
  88. package/out/_next/static/chunks/1ynju1jqfrcv0.js +1 -0
  89. package/out/_next/static/chunks/1zfojlgb15okk.js +1 -0
  90. package/out/_next/static/chunks/1zj8x5wbgnzz-.js +1 -0
  91. package/out/_next/static/chunks/1zl6t15gh34nn.js +1 -0
  92. package/out/_next/static/chunks/{1thjncpj7u6pq.js → 223vrr_4sfhsj.js} +1 -1
  93. package/out/_next/static/chunks/22cr2b04btguf.js +1 -0
  94. package/out/_next/static/chunks/242xhzxxetctz.js +1 -0
  95. package/out/_next/static/chunks/24essz5mmvx-6.js +1 -0
  96. package/out/_next/static/chunks/256k1jw1m--l7.js +146 -0
  97. package/out/_next/static/chunks/259obyrpxcv6r.js +1 -0
  98. package/out/_next/static/chunks/26v9yqicofqba.js +1 -0
  99. package/out/_next/static/chunks/290d93hmm_e8b.js +1 -0
  100. package/out/_next/static/chunks/2_2fk7iddrs43.js +1 -0
  101. package/out/_next/static/chunks/{00k_j_r7bv_eb.js → 2bjlls8-qe05r.js} +9 -9
  102. package/out/_next/static/chunks/2ckd7f1wbfod-.js +1 -0
  103. package/out/_next/static/chunks/{163fa70v4mgxj.js → 2d6hru4qo23tt.js} +1 -1
  104. package/out/_next/static/chunks/2ejvntxtvf5o9.js +1 -0
  105. package/out/_next/static/chunks/2f7_3tzf7xhps.js +1 -0
  106. package/out/_next/static/chunks/2gxd_o1g89_bv.js +1 -0
  107. package/out/_next/static/chunks/2hd2txb4-m9k1.js +1 -0
  108. package/out/_next/static/chunks/2hpxou_cnp4f_.js +1 -0
  109. package/out/_next/static/chunks/2izioctrfc0s5.js +1 -0
  110. package/out/_next/static/chunks/2jhnk4h4n0udv.js +1 -0
  111. package/out/_next/static/chunks/2jpkhkk9zi8-f.js +1 -0
  112. package/out/_next/static/chunks/2kpet_l1kq2sx.js +1 -0
  113. package/out/_next/static/chunks/2mdbvf1b5h00_.css +3 -0
  114. package/out/_next/static/chunks/2nck5w4c7leb7.js +1 -0
  115. package/out/_next/static/chunks/2our10fwtj87e.js +1 -0
  116. package/out/_next/static/chunks/2qq3uzsbiicw3.js +1194 -0
  117. package/out/_next/static/chunks/2qqqpu0ahfdda.js +1 -0
  118. package/out/_next/static/chunks/2u-f7mmxvk8wj.js +1 -0
  119. package/out/_next/static/chunks/2ue1wo4ryk87z.js +1 -0
  120. package/out/_next/static/chunks/2uk-vwlxe9-xr.js +1 -0
  121. package/out/_next/static/chunks/2ur5-lxdvv1jm.js +1 -0
  122. package/out/_next/static/chunks/2veqsohwfhfqc.js +1 -0
  123. package/out/_next/static/chunks/2vqlv9wnewhu9.js +1 -0
  124. package/out/_next/static/chunks/{1zvc1tv--w8nn.js → 2wzshintp5lf8.js} +1 -1
  125. package/out/_next/static/chunks/2x-00glogc485.js +1 -0
  126. package/out/_next/static/chunks/2yfxy0f5fqs4o.js +1 -0
  127. package/out/_next/static/chunks/2z88mt3ixktu3.js +1 -0
  128. package/out/_next/static/chunks/2z_jn9ud28fk7.js +1 -0
  129. package/out/_next/static/chunks/3-eswqjobiqk1.js +1 -0
  130. package/out/_next/static/chunks/30-tbi7pys6fp.js +4 -0
  131. package/out/_next/static/chunks/30c-nsedy_ce0.js +1 -0
  132. package/out/_next/static/chunks/31u5lbu1vxznh.js +1 -0
  133. package/out/_next/static/chunks/{2feca0xcipcyt.js → 32ahba5ezp467.js} +156 -156
  134. package/out/_next/static/chunks/337hn35kts7ud.js +1 -0
  135. package/out/_next/static/chunks/33dgpebv-tf73.js +1 -0
  136. package/out/_next/static/chunks/36jkdhq6kb-cf.js +1 -0
  137. package/out/_next/static/chunks/37epa8fz59vba.js +1166 -0
  138. package/out/_next/static/chunks/3833xfnz0a-ub.js +1 -0
  139. package/out/_next/static/chunks/38awrh_qxn22k.js +1 -0
  140. package/out/_next/static/chunks/{0wrm9jr-9bw0e.js → 38x3c1ra5slhe.js} +383 -913
  141. package/out/_next/static/chunks/39idqlqlcp5b9.js +1 -0
  142. package/out/_next/static/chunks/{2a3spdq-m8drh.js → 3_gku1pwluoo0.js} +1 -1
  143. package/out/_next/static/chunks/3_mu-4rdjajna.js +1450 -0
  144. package/out/_next/static/chunks/3coacc4-g-g5c.js +1 -0
  145. package/out/_next/static/chunks/3e00fzdfkclzq.js +1 -0
  146. package/out/_next/static/chunks/3e8fmlq0k5wkg.js +1 -0
  147. package/out/_next/static/chunks/3e9tzyrt4_98z.js +1 -0
  148. package/out/_next/static/chunks/3edelqkq92pil.js +1 -0
  149. package/out/_next/static/chunks/3figbil1t4ssj.js +593 -0
  150. package/out/_next/static/chunks/3gimb3z_mteou.js +1 -0
  151. package/out/_next/static/chunks/{2p2vv6cc9i-3q.js → 3idaz_s77e-j_.js} +9 -9
  152. package/out/_next/static/chunks/3j-4wuhs5weba.js +1 -0
  153. package/out/_next/static/chunks/3jjfnwvybayy7.js +1 -0
  154. package/out/_next/static/chunks/3jwm5dfk_78gc.js +1 -0
  155. package/out/_next/static/chunks/3k9d4ylc3li2t.js +1352 -0
  156. package/out/_next/static/chunks/3l3_0ack3gy4k.js +1 -0
  157. package/out/_next/static/chunks/3lwhs5ja7tun3.js +1 -0
  158. package/out/_next/static/chunks/3m6nmp2dca6un.js +1342 -0
  159. package/out/_next/static/chunks/3mbnfpufs2-7e.js +7 -0
  160. package/out/_next/static/chunks/3mcd08gmt038z.js +1 -0
  161. package/out/_next/static/chunks/3mt5th7b1i_u9.js +1 -0
  162. package/out/_next/static/chunks/3ne77mjdz2y7o.js +1 -0
  163. package/out/_next/static/chunks/3puhrqtujktyv.js +1 -0
  164. package/out/_next/static/chunks/3rdifucupcgkg.js +1 -0
  165. package/out/_next/static/chunks/3riekaxl3uxfb.js +1195 -0
  166. package/out/_next/static/chunks/3sdoskq_buttj.js +1 -0
  167. package/out/_next/static/chunks/3tg-ma9tv9xu4.js +1 -0
  168. package/out/_next/static/chunks/3tm-pqpmq_ppw.js +1 -0
  169. package/out/_next/static/chunks/3w9go565cjhq3.js +1636 -0
  170. package/out/_next/static/chunks/3wi9gzq2mtr_q.js +8 -0
  171. package/out/_next/static/chunks/3xagd_2_9zft2.js +1 -0
  172. package/out/_next/static/chunks/3xsq_anpad-fb.js +1 -0
  173. package/out/_next/static/chunks/3ycv2qq7vpbua.js +1 -0
  174. package/out/_next/static/chunks/3z84au-mitjjw.js +1 -0
  175. package/out/_next/static/chunks/4030dhur2h70-.js +1 -0
  176. package/out/_next/static/chunks/40ffffml4h_3r.js +4 -0
  177. package/out/_next/static/chunks/{3-shckrcpvbxu.js → 41wt50z9tx9cx.js} +108 -711
  178. package/out/_next/static/chunks/431slrqh0wa0g.js +1 -0
  179. package/out/_next/static/chunks/43s_lbd1i2krj.js +1 -0
  180. package/out/_next/static/chunks/{0-2y-_oomza2l.js → 44nxswtahaq4w.js} +18 -18
  181. package/out/_next/static/chunks/45bwefvdpztfs.js +1 -0
  182. package/out/_next/static/chunks/{turbopack-0sgd6pfbe1fy6.js → turbopack-19105pdhzxp1x.js} +1 -1
  183. package/out/_not-found/__next._full.txt +9 -9
  184. package/out/_not-found/__next._head.txt +4 -4
  185. package/out/_not-found/__next._index.txt +4 -4
  186. package/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
  187. package/out/_not-found/__next._not-found.txt +3 -3
  188. package/out/_not-found/__next._tree.txt +2 -2
  189. package/out/_not-found.html +1 -1
  190. package/out/_not-found.txt +9 -9
  191. package/out/index.html +1 -1
  192. package/out/index.txt +11 -11
  193. package/package.json +5 -4
  194. package/out/_next/static/chunks/068j6934u8j16.js +0 -1
  195. package/out/_next/static/chunks/09e4adtr6w0xe.js +0 -1
  196. package/out/_next/static/chunks/0_rf76jneiwal.js +0 -176
  197. package/out/_next/static/chunks/0aznt7717miff.js +0 -1
  198. package/out/_next/static/chunks/0cu-q5q3a7uf3.js +0 -1
  199. package/out/_next/static/chunks/0fskcfh9vbhtv.js +0 -1
  200. package/out/_next/static/chunks/0gg-ii7i6d_p6.js +0 -1
  201. package/out/_next/static/chunks/0tx1j_ghpz7rc.css +0 -3
  202. package/out/_next/static/chunks/0ufbyo1x3qkmo.js +0 -1
  203. package/out/_next/static/chunks/0wwcfw8i3j_zx.js +0 -1
  204. package/out/_next/static/chunks/0wwkrsvxwi57d.js +0 -1
  205. package/out/_next/static/chunks/0ys9-ozuluawt.js +0 -1
  206. package/out/_next/static/chunks/1-61zh4waha61.js +0 -1
  207. package/out/_next/static/chunks/10r_824wzt8hj.js +0 -1
  208. package/out/_next/static/chunks/123xxske5c9na.js +0 -1
  209. package/out/_next/static/chunks/13isnf0--pmx1.js +0 -1
  210. package/out/_next/static/chunks/157d9euci08yu.js +0 -1
  211. package/out/_next/static/chunks/18u58lorfahxi.js +0 -4
  212. package/out/_next/static/chunks/1_aahautsz2v_.js +0 -1
  213. package/out/_next/static/chunks/1o1d0p-v1z8ty.js +0 -1
  214. package/out/_next/static/chunks/1vdjn0pkoyypn.js +0 -1
  215. package/out/_next/static/chunks/1yehxf-fmeicg.js +0 -1
  216. package/out/_next/static/chunks/1zx2q-r32thv1.js +0 -4
  217. package/out/_next/static/chunks/2-sjjedfr0kfq.js +0 -1
  218. package/out/_next/static/chunks/25b9x-li-tvk2.js +0 -1
  219. package/out/_next/static/chunks/2aelw3far6rii.js +0 -1
  220. package/out/_next/static/chunks/2aor7m-wbis85.js +0 -1
  221. package/out/_next/static/chunks/2clzipqap01hp.js +0 -1
  222. package/out/_next/static/chunks/2fh-_9b6tqhvb.js +0 -1
  223. package/out/_next/static/chunks/2g5gecypj0rqe.js +0 -1
  224. package/out/_next/static/chunks/2szdcpl41-kzv.js +0 -1
  225. package/out/_next/static/chunks/2u6shh3oeycm-.js +0 -1
  226. package/out/_next/static/chunks/2unhhuv0arlcv.js +0 -1
  227. package/out/_next/static/chunks/2z5eqx5do5std.js +0 -1
  228. package/out/_next/static/chunks/310uz81hnnzsu.js +0 -1
  229. package/out/_next/static/chunks/3aqbf_wkg2sih.js +0 -3
  230. package/out/_next/static/chunks/3i3gbhccmhu7j.js +0 -210
  231. package/out/_next/static/chunks/3mqy-84_ul3t2.js +0 -1
  232. package/out/_next/static/chunks/3nz-dh9d7cehk.js +0 -1
  233. package/out/_next/static/chunks/3pufs8g4ui943.js +0 -1
  234. package/out/_next/static/chunks/3t06schbtqonl.js +0 -1
  235. package/out/_next/static/chunks/3v3-7fio3nw_t.js +0 -1
  236. package/out/_next/static/chunks/3v5ha25nxo43j.js +0 -1
  237. package/out/_next/static/chunks/3zskk1hxu3-_o.js +0 -1
  238. /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_buildManifest.js +0 -0
  239. /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_clientMiddlewareManifest.js +0 -0
  240. /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41342,e=>{"use strict";var t=e.i(68179),r=e.i(96265),s=e.i(46703),i=e.i(14953),n=e.i(84201),a=e.i(52153),o=(e.i(66749),e.i(10272)),h=e.i(45707),d=e.i(99267),l=e.i(37143),c=e.i(80871),u=e.i(77052),_=e.i(518);class p{static get ForceGLSL(){return _.EffectWrapper.ForceGLSL}static set ForceGLSL(e){_.EffectWrapper.ForceGLSL=e}static RegisterShaderCodeProcessing(e,t){_.EffectWrapper.RegisterShaderCodeProcessing(e,t)}get name(){return this._effectWrapper.name}set name(e){this._effectWrapper.name=e}get alphaMode(){return this._effectWrapper.alphaMode}set alphaMode(e){this._effectWrapper.alphaMode=e}get samples(){return this._samples}set samples(e){this._samples=Math.min(e,this._engine.getCaps().maxMSAASamples),this._textures.forEach(e=>{e.setSamples(this._samples)})}get shaderLanguage(){return this._shaderLanguage}getEffectName(){return this._fragmentUrl}set onActivate(e){this._onActivateObserver&&this.onActivateObservable.remove(this._onActivateObserver),e&&(this._onActivateObserver=this.onActivateObservable.add(e))}set onSizeChanged(e){this._onSizeChangedObserver&&this.onSizeChangedObservable.remove(this._onSizeChangedObserver),this._onSizeChangedObserver=this.onSizeChangedObservable.add(e)}set onApply(e){this._onApplyObserver&&this.onApplyObservable.remove(this._onApplyObserver),this._onApplyObserver=this.onApplyObservable.add(e)}set onBeforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}set onAfterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}get inputTexture(){return this._textures.data[this._currentRenderTextureInd]}set inputTexture(e){this._forcedOutputTexture=e}restoreDefaultInputTexture(){this._forcedOutputTexture&&(this._forcedOutputTexture=null,this.markTextureDirty())}getCamera(){return this._camera}get texelSize(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.texelSize:(this._forcedOutputTexture&&this._texelSize.copyFromFloats(1/this._forcedOutputTexture.width,1/this._forcedOutputTexture.height),this._texelSize)}constructor(e,t,s,i,n,a,o=1,l,c,u=null,g=0,f="postprocess",b,R=!1,m=5,O,v){let P;this._parentContainer=null,this.width=-1,this.height=-1,this.nodeMaterialSource=null,this._outputTexture=null,this.autoClear=!0,this.forceAutoClearInAlphaMode=!1,this.animations=[],this.enablePixelPerfectMode=!1,this.forceFullscreenViewport=!0,this.scaleMode=1,this.alwaysForcePOT=!1,this._samples=1,this.adaptScaleToCurrentViewport=!1,this.doNotSerialize=!1,this._webGPUReady=!1,this._reusable=!1,this._renderId=0,this.externalTextureSamplerBinding=!1,this._textures=new h.SmartArray(2),this._textureCache=[],this._currentRenderTextureInd=0,this._scaleRatio=new r.Vector2(1,1),this._texelSize=r.Vector2.Zero(),this.onActivateObservable=new d.Observable,this.onSizeChangedObservable=new d.Observable,this.onApplyObservable=new d.Observable,this.onBeforeRenderObservable=new d.Observable,this.onAfterRenderObservable=new d.Observable,this.onDisposeObservable=new d.Observable;let x=1,T=null;if(s&&!Array.isArray(s)){const e=s;s=e.uniforms??null,i=e.samplers??null,x=e.size??1,a=e.camera??null,o=e.samplingMode??1,l=e.engine,c=e.reusable,u=Array.isArray(e.defines)?e.defines.join("\n"):e.defines??null,g=e.textureType??0,f=e.vertexUrl??"postprocess",b=e.indexParameters,R=e.blockCompilation??!1,m=e.textureFormat??5,O=e.shaderLanguage??0,T=e.uniformBuffers??null,v=e.extraInitializations,P=e.effectWrapper}else n&&(x="number"==typeof n?n:{width:n.width,height:n.height});if(this._useExistingThinPostProcess=!!P,this._effectWrapper=P??new _.EffectWrapper({name:e,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:t,engine:l||a?.getScene().getEngine(),uniforms:s,samplers:i,uniformBuffers:T,defines:u,vertexUrl:f,indexParameters:b,blockCompilation:!0,shaderLanguage:O,extraInitializations:void 0}),this.name=e,this.onEffectCreatedObservable=this._effectWrapper.onEffectCreatedObservable,null!=a?(this._camera=a,this._scene=a.getScene(),a.attachPostProcess(this),this._engine=this._scene.getEngine(),this._scene.addPostProcess(this),this.uniqueId=this._scene.getUniqueId()):l&&(this._engine=l,this._engine.postProcesses.push(this)),this._options=x,this.renderTargetSamplingMode=o||1,this._reusable=c||!1,this._textureType=g,this._textureFormat=m,this._shaderLanguage=O||0,this._samplers=i||[],-1===this._samplers.indexOf("textureSampler")&&this._samplers.push("textureSampler"),this._fragmentUrl=t,this._vertexUrl=f,this._parameters=s||[],-1===this._parameters.indexOf("scale")&&this._parameters.push("scale"),this._uniformBuffers=T||[],this._indexParameters=b,!this._useExistingThinPostProcess){this._webGPUReady=1===this._shaderLanguage;const e=[];this._gatherImports(this._engine.isWebGPU&&!p.ForceGLSL,e),this._effectWrapper._webGPUReady=this._webGPUReady,this._effectWrapper._postConstructor(R,u,v,e)}}_gatherImports(t=!1,r){t&&this._webGPUReady?r.push(Promise.all([e.A(37828)])):r.push(Promise.all([e.A(35413)]))}getClassName(){return"PostProcess"}getEngine(){return this._engine}getEffect(){return this._effectWrapper.drawWrapper.effect}shareOutputWith(e){return this._disposeTextures(),this._shareOutputWithPostProcess=e,this}useOwnOutput(){0==this._textures.length&&(this._textures=new h.SmartArray(2)),this._shareOutputWithPostProcess=null}updateEffect(e=null,t=null,r=null,s,i,n,a,o){this._effectWrapper.updateEffect(e,t,r,s,i,n,a,o),this._postProcessDefines=Array.isArray(this._effectWrapper.options.defines)?this._effectWrapper.options.defines.join("\n"):this._effectWrapper.options.defines}isReusable(){return this._reusable}markTextureDirty(){this.width=-1}_createRenderTargetTexture(e,t,r=0){for(let s=0;s<this._textureCache.length;s++)if(this._textureCache[s].texture.width===e.width&&this._textureCache[s].texture.height===e.height&&this._textureCache[s].postProcessChannel===r&&this._textureCache[s].texture._generateDepthBuffer===t.generateDepthBuffer&&this._textureCache[s].texture.samples===t.samples)return this._textureCache[s].texture;let s=this._engine.createRenderTargetTexture(e,t);return this._textureCache.push({texture:s,postProcessChannel:r,lastUsedRenderId:-1}),s}_flushTextureCache(){let e=this._renderId;for(let t=this._textureCache.length-1;t>=0;t--)if(e-this._textureCache[t].lastUsedRenderId>100){let e=!1;for(let r=0;r<this._textures.length;r++)if(this._textures.data[r]===this._textureCache[t].texture){e=!0;break}e||(this._textureCache[t].texture.dispose(),this._textureCache.splice(t,1))}}resize(e,t,r=null,s=!1,i=!1){this._textures.length>0&&this._textures.reset(),this.width=e,this.height=t;let n=null;if(r){for(let e=0;e<r._postProcesses.length;e++)if(null!==r._postProcesses[e]){n=r._postProcesses[e];break}}let a={width:this.width,height:this.height},o={generateMipMaps:s,generateDepthBuffer:i||n===this,generateStencilBuffer:(i||n===this)&&this._engine.isStencilEnable,samplingMode:this.renderTargetSamplingMode,type:this._textureType,format:this._textureFormat,samples:this._samples,label:"PostProcessRTT-"+this.name};this._textures.push(this._createRenderTargetTexture(a,o,0)),this._reusable&&this._textures.push(this._createRenderTargetTexture(a,o,1)),this._texelSize.copyFromFloats(1/this.width,1/this.height),this.onSizeChangedObservable.notifyObservers(this)}_getTarget(){let e;if(this._shareOutputWithPostProcess)e=this._shareOutputWithPostProcess.inputTexture;else if(this._forcedOutputTexture)e=this._forcedOutputTexture,this.width=this._forcedOutputTexture.width,this.height=this._forcedOutputTexture.height;else{let t;e=this.inputTexture;for(let r=0;r<this._textureCache.length;r++)if(this._textureCache[r].texture===e){t=this._textureCache[r];break}t&&(t.lastUsedRenderId=this._renderId)}return e}activate(e,r=null,s){let i=null===e||void 0!==e.cameraRigMode?e||this._camera:null,n=i?.getScene()??e,a=n.getEngine(),o=a.getCaps().maxTextureSize,h=(r?r.width:this._engine.getRenderWidth(!0))*this._options|0,d=(r?r.height:this._engine.getRenderHeight(!0))*this._options|0,l=this._options.width||h,c=this._options.height||d,u=7!==this.renderTargetSamplingMode&&1!==this.renderTargetSamplingMode&&2!==this.renderTargetSamplingMode,_=null;if(!this._shareOutputWithPostProcess&&!this._forcedOutputTexture){if(this.adaptScaleToCurrentViewport){let e=a.currentViewport;e&&(l*=e.width,c*=e.height)}(u||this.alwaysForcePOT)&&(this._options.width||(l=a.needPOTTextures?(0,t.GetExponentOfTwo)(l,o,this.scaleMode):l),this._options.height||(c=a.needPOTTextures?(0,t.GetExponentOfTwo)(c,o,this.scaleMode):c)),this.width===l&&this.height===c&&(_=this._getTarget())||this.resize(l,c,i,u,s),this._textures.forEach(e=>{e.samples!==this.samples&&this._engine.updateRenderTargetTextureSampleCount(e,this.samples)}),this._flushTextureCache(),this._renderId++}return _||(_=this._getTarget()),this.enablePixelPerfectMode?(this._scaleRatio.copyFromFloats(h/l,d/c),this._engine.bindFramebuffer(_,0,h,d,this.forceFullscreenViewport)):(this._scaleRatio.copyFromFloats(1,1),this._engine.bindFramebuffer(_,0,void 0,void 0,this.forceFullscreenViewport)),this._engine._debugInsertMarker?.(`post process ${this.name} input`),this.onActivateObservable.notifyObservers(i),this.autoClear&&(0===this.alphaMode||this.forceAutoClearInAlphaMode)&&this._engine.clear(this.clearColor?this.clearColor:n.clearColor,n._allowPostProcessClearColor,!0,!0),this._reusable&&(this._currentRenderTextureInd=(this._currentRenderTextureInd+1)%2),_}get isSupported(){return this._effectWrapper.drawWrapper.effect.isSupported}get aspectRatio(){return this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.aspectRatio:this._forcedOutputTexture?this._forcedOutputTexture.width/this._forcedOutputTexture.height:this.width/this.height}isReady(){return this._effectWrapper.isReady()}apply(){let e;return this._effectWrapper.isReady()?(this._engine.enableEffect(this._effectWrapper.drawWrapper),this._engine.setState(!1),this._engine.setDepthBuffer(!1),this._engine.setDepthWrite(!1),this.alphaConstants&&this.getEngine().setAlphaConstants(this.alphaConstants.r,this.alphaConstants.g,this.alphaConstants.b,this.alphaConstants.a),this._engine.setAlphaMode(this.alphaMode),e=this._shareOutputWithPostProcess?this._shareOutputWithPostProcess.inputTexture:this._forcedOutputTexture?this._forcedOutputTexture:this.inputTexture,this.externalTextureSamplerBinding||this._effectWrapper.drawWrapper.effect._bindTexture("textureSampler",e?.texture),this._effectWrapper.drawWrapper.effect.setVector2("scale",this._scaleRatio),this.onApplyObservable.notifyObservers(this._effectWrapper.drawWrapper.effect),this._effectWrapper.bind(!0),this._effectWrapper.drawWrapper.effect):null}_disposeTextures(){this._shareOutputWithPostProcess||this._forcedOutputTexture?this._disposeTextureCache():(this._disposeTextureCache(),this._textures.dispose())}_disposeTextureCache(){for(let e=this._textureCache.length-1;e>=0;e--)this._textureCache[e].texture.dispose();this._textureCache.length=0}setPrePassRenderer(e){return!!this._prePassEffectConfiguration&&(this._prePassEffectConfiguration=e.addEffectConfiguration(this._prePassEffectConfiguration),this._prePassEffectConfiguration.enabled=!0,!0)}dispose(e){let t;if(e=e||this._camera,this._useExistingThinPostProcess||this._effectWrapper.dispose(),this._disposeTextures(),this._scene&&this._scene.removePostProcess(this),this._parentContainer&&((t=this._parentContainer.postProcesses.indexOf(this))>-1&&this._parentContainer.postProcesses.splice(t,1),this._parentContainer=null),-1!==(t=this._engine.postProcesses.indexOf(this))&&this._engine.postProcesses.splice(t,1),this.onDisposeObservable.notifyObservers(),e){if(e.detachPostProcess(this),0===(t=e._postProcesses.indexOf(this))&&e._postProcesses.length>0){let e=this._camera._getFirstPostProcess();e&&e.markTextureDirty()}this.onActivateObservable.clear(),this.onAfterRenderObservable.clear(),this.onApplyObservable.clear(),this.onBeforeRenderObservable.clear(),this.onSizeChangedObservable.clear(),this.onEffectCreatedObservable.clear()}}serialize(){let e=c.SerializationHelper.Serialize(this),t=this.getCamera()||this._scene&&this._scene.activeCamera;return e.customType="BABYLON."+this.getClassName(),e.cameraId=t?t.id:null,e.reusable=this._reusable,e.textureType=this._textureType,e.fragmentUrl=this._fragmentUrl,e.parameters=this._parameters,e.samplers=this._samplers,e.uniformBuffers=this._uniformBuffers,e.options=this._options,e.defines=this._postProcessDefines,e.textureFormat=this._textureFormat,e.vertexUrl=this._vertexUrl,e.indexParameters=this._indexParameters,e}clone(){let e=this.serialize();e._engine=this._engine,e.cameraId=null;let t=p.Parse(e,this._scene,"");return t?(t.onActivateObservable=this.onActivateObservable.clone(),t.onSizeChangedObservable=this.onSizeChangedObservable.clone(),t.onApplyObservable=this.onApplyObservable.clone(),t.onBeforeRenderObservable=this.onBeforeRenderObservable.clone(),t.onAfterRenderObservable=this.onAfterRenderObservable.clone(),t._prePassEffectConfiguration=this._prePassEffectConfiguration,t):null}static Parse(e,t,r){let s=(0,u.GetClass)(e.customType);if(!s||!s._Parse)return null;let i=t?t.getCameraById(e.cameraId):null;return s._Parse(e,i,t,r)}static _Parse(e,t,r,s){return c.SerializationHelper.Parse(()=>new p(e.name,e.fragmentUrl,e.parameters,e.samplers,e.options,t,e.renderTargetSamplingMode,e._engine,e.reusable,e.defines,e.textureType,e.vertexUrl,e.indexParameters,!1,e.textureFormat),e,r,s)}}(0,o.__decorate)([(0,l.serialize)()],p.prototype,"uniqueId",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"name",null),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"width",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"height",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"renderTargetSamplingMode",void 0),(0,o.__decorate)([(0,l.serializeAsColor4)()],p.prototype,"clearColor",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"autoClear",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"forceAutoClearInAlphaMode",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"alphaMode",null),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"alphaConstants",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"enablePixelPerfectMode",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"forceFullscreenViewport",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"scaleMode",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"alwaysForcePOT",void 0),(0,o.__decorate)([(0,l.serialize)("samples")],p.prototype,"_samples",void 0),(0,o.__decorate)([(0,l.serialize)()],p.prototype,"adaptScaleToCurrentViewport",void 0);var g=e.i(13379),f=e.i(58720),b=f,R=e.i(63132),m=e.i(33855),O=e.i(72161),v=e.i(48657),P=e.i(23240),x=e.i(21823);class T{get renderList(){return this._renderList}set renderList(e){this._renderList!==e&&(this._unObserveRenderList&&(this._unObserveRenderList(),this._unObserveRenderList=null),e&&(this._unObserveRenderList=(0,v._ObserveArray)(e,this._renderListHasChanged)),this._renderList=e)}get disableImageProcessing(){return this._disableImageProcessing}set disableImageProcessing(e){e!==this._disableImageProcessing&&(this._disableImageProcessing=e,this._scene.markAllMaterialsAsDirty(64))}get disableDepthPrePass(){return this._disableDepthPrePass}set disableDepthPrePass(e){this._disableDepthPrePass=e,this._renderingManager.disableDepthPrePass=e}get name(){return this._name}set name(e){if(this._name!==e){if(this._name=e,this._sceneUBOs)for(let e=0;e<this._sceneUBOs.length;++e)this._sceneUBOs[e].name=`Scene ubo #${e} for ${this.name}`;if(this._scene)for(let e=0;e<this._renderPassIds.length;++e){let t=this._renderPassIds[e];this._engine._renderPassNames[t]=`${this._name}#${e}`}}}get renderPassIds(){return this._renderPassIds}get currentRefreshId(){return this._currentRefreshId}getActiveMeshes(){return this._activeMeshes}setMaterialForRendering(e,t){let r;r=Array.isArray(e)?e:[e];for(let e=0;e<r.length;++e)for(let s=0;s<this.options.numPasses;++s){let i=r[e];r[e].isAnInstance&&(i=r[e].sourceMesh),i.setMaterialForRenderPass(this._renderPassIds[s],void 0!==t?Array.isArray(t)?t[s]:t:void 0)}}_freezeActiveMeshes(e){this._freezeActiveMeshesCancel=(0,P._RetryWithInterval)(()=>this._checkReadiness(),()=>{if(this._freezeActiveMeshesCancel=null,e)for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._freeze();this._prepareRenderingManager(0,!0),this._isFrozen=!0},(e,t)=>{this._freezeActiveMeshesCancel=null,t?(g.Logger.Error("ObjectRenderer: Timeout while waiting for the renderer to be ready."),e&&g.Logger.Error(e)):(g.Logger.Error("ObjectRenderer: An unexpected error occurred while waiting for the renderer to be ready."),e&&(g.Logger.Error(e),e.stack&&g.Logger.Error(e.stack)))})}_unfreezeActiveMeshes(){this._freezeActiveMeshesCancel?.(),this._freezeActiveMeshesCancel=null;for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._unFreeze();this._isFrozen=!1}constructor(e,t,r){this._unObserveRenderList=null,this._renderListHasChanged=(e,t)=>{let r=this._renderList?this._renderList.length:0;if(0===t&&r>0||0===r)for(let e of this._scene.meshes)e._markSubMeshesAsLightDirty()},this.particleSystemList=null,this.getCustomRenderList=null,this.renderMeshes=!0,this.renderDepthOnlyMeshes=!0,this.renderOpaqueMeshes=!0,this.renderAlphaTestMeshes=!0,this.renderTransparentMeshes=!0,this.renderParticles=!0,this.renderSprites=!1,this.forceLayerMaskCheck=!1,this.enableBoundingBoxRendering=!1,this.enableOutlineRendering=!0,this._disableImageProcessing=!1,this.dontSetTransformationMatrix=!1,this._disableDepthPrePass=!1,this.onBeforeRenderObservable=new d.Observable,this.onAfterRenderObservable=new d.Observable,this.onBeforeRenderingManagerRenderObservable=new d.Observable,this.onAfterRenderingManagerRenderObservable=new d.Observable,this.onInitRenderingObservable=new d.Observable,this.onFinishRenderingObservable=new d.Observable,this.onFastPathRenderObservable=new d.Observable,this._currentRefreshId=-1,this._refreshRate=1,this._currentApplyByPostProcessSetting=!1,this._activeMeshes=new h.SmartArray(256),this._activeBoundingBoxes=new h.SmartArray(32),this._currentFrameId=-1,this._currentSceneUBOIndex=0,this._isFrozen=!1,this._freezeActiveMeshesCancel=null,this._currentSceneCamera=null,this.name=e,this._scene=t,this._engine=this._scene.getEngine(),this._useUBO=this._engine.supportsUniformBuffers,this.renderList=[],this._renderPassIds=[],this.options={numPasses:1,doNotChangeAspectRatio:!0,enableClusteredLights:!1,...r},this._createRenderPassId(),this.renderPassId=this._renderPassIds[0],this._renderingManager=new O.RenderingManager(t),this._renderingManager._useSceneAutoClearSetup=!0,this.options.enableClusteredLights&&this.onInitRenderingObservable.add(()=>{for(let e of this._scene.lights)e.getTypeID()===x.LightConstants.LIGHTTYPEID_CLUSTERED_CONTAINER&&e.isSupported&&e._updateBatches(this.activeCamera).render()}),this._scene.addObjectRenderer(this)}_releaseRenderPassId(){for(let e=0;e<this.options.numPasses;++e)this._engine.releaseRenderPassId(this._renderPassIds[e]);this._renderPassIds.length=0}_createRenderPassId(){this._releaseRenderPassId();for(let e=0;e<this.options.numPasses;++e)this._renderPassIds[e]=this._engine.createRenderPassId(`${this.name}#${e}`)}_createSceneUBO(e,t){let r=this._scene.getEngine(),s=new m.UniformBuffer(r,void 0,t,e,void 0,!1);return s.addUniform("viewProjection",16),t&&s.addUniform("viewProjectionR",16),s.addUniform("view",16),s.addUniform("projection",16),s.addUniform("vEyePosition",4),s.addUniform("inverseProjection",16),s}_getSceneUBO(){this._currentFrameId!==this._engine.frameId&&(this._currentSceneUBOIndex=0,this._currentFrameId=this._engine.frameId),this._sceneUBOs||(this._sceneUBOs=[],this._sceneUBOIsMultiview=[]);let e=this._engine._currentRenderTarget,t=!!(e&&e.texture?.isMultiview)||!!this._scene._multiviewSceneUboIsActive;if(this._currentSceneUBOIndex>=this._sceneUBOs.length){let e=this._sceneUBOs.length;this._sceneUBOs.push(this._createSceneUBO(`Scene ubo #${e} for ${this.name}`,t)),this._sceneUBOIsMultiview.push(t)}else this._sceneUBOIsMultiview[this._currentSceneUBOIndex]!==t&&(this._sceneUBOs[this._currentSceneUBOIndex].dispose(),this._sceneUBOs[this._currentSceneUBOIndex]=this._createSceneUBO(`Scene ubo #${this._currentSceneUBOIndex} for ${this.name}`,t),this._sceneUBOIsMultiview[this._currentSceneUBOIndex]=t);let r=this._sceneUBOs[this._currentSceneUBOIndex++];return r.unbindEffect(),r}resetRefreshCounter(){this._currentRefreshId=-1}get refreshRate(){return this._refreshRate}set refreshRate(e){this._refreshRate=e,this.resetRefreshCounter()}shouldRender(){return!!this._engine.snapshotRendering||(-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1))}isReadyForRendering(e,t){this.prepareRenderList(),this.initRender(e,t);let r=this._checkReadiness();return this.finishRender(),r}prepareRenderList(){let e=this._scene;if(this._waitingRenderList){if(!this.renderListPredicate){this.renderList=[];for(let t=0;t<this._waitingRenderList.length;t++){let r=this._waitingRenderList[t],s=e.getMeshById(r);s&&this.renderList.push(s)}}this._waitingRenderList=void 0}if(this.renderListPredicate){this.renderList?this.renderList.length=0:this.renderList=[];let e=this._scene.meshes;for(let t=0;t<e.length;t++){let r=e[t];this.renderListPredicate(r)&&this.renderList.push(r)}}this._currentApplyByPostProcessSetting=this._scene.imageProcessingConfiguration.applyByPostProcess,this._disableImageProcessing&&(this._scene.imageProcessingConfiguration._applyByPostProcess=this._disableImageProcessing)}initRender(e,t){let r=this.activeCamera??this._scene.activeCamera;this._currentSceneCamera=this._scene.activeCamera,this._useUBO&&(this._currentSceneUBO=this._scene.getSceneUniformBuffer(),this._currentSceneUBO.unbindEffect(),this._scene.setSceneUniformBuffer(this._getSceneUBO())),this.onInitRenderingObservable.notifyObservers(this),r&&(this.dontSetTransformationMatrix||this._scene.setTransformMatrix(r.getViewMatrix(),r.getProjectionMatrix(!0)),this._scene._activeCamera=r,this._engine.setViewport(r.rigParent?r.rigParent.viewport:r.viewport,e,t)),this._useUBO&&this._scene.finalizeSceneUbo(),this._defaultRenderListPrepared=!1}finishRender(){let e=this._scene;this._useUBO&&this._scene.setSceneUniformBuffer(this._currentSceneUBO),this._disableImageProcessing&&(e.imageProcessingConfiguration._applyByPostProcess=this._currentApplyByPostProcessSetting),e._activeCamera=this._currentSceneCamera,this._currentSceneCamera&&(this.activeCamera&&this.activeCamera!==e.activeCamera&&e.setTransformMatrix(this._currentSceneCamera.getViewMatrix(),this._currentSceneCamera.getProjectionMatrix(!0)),this._engine.setViewport(this._currentSceneCamera.viewport)),e.resetCachedMaterial(),this.onFinishRenderingObservable.notifyObservers(this)}render(e=0,t=!1){let r=this._engine.currentRenderPassId;if(this._engine.currentRenderPassId=this._renderPassIds[e],this.onBeforeRenderObservable.notifyObservers(e),this._engine.snapshotRendering&&1===this._engine.snapshotRenderingMode)this.onFastPathRenderObservable.notifyObservers(e);else{let t=this._prepareRenderingManager(e),r=this._scene.getOutlineRenderer?.(),s=r?.enabled;r&&(r.enabled=this.enableOutlineRendering),this.onBeforeRenderingManagerRenderObservable.notifyObservers(e),this._renderingManager.render(this.customRenderFunction,t,this.renderParticles,this.renderSprites,this.renderDepthOnlyMeshes,this.renderOpaqueMeshes,this.renderAlphaTestMeshes,this.renderTransparentMeshes,this.customRenderTransparentSubMeshes),this.onAfterRenderingManagerRenderObservable.notifyObservers(e),r&&(r.enabled=s)}t||this.onAfterRenderObservable.notifyObservers(e),this._engine.currentRenderPassId=r}_checkReadiness(){let e=this._scene,t=this._engine.currentRenderPassId,r=!0;e.getViewMatrix()||e.updateTransformMatrix();let s=this.options.numPasses;for(let t=0;t<s&&r;t++){let i=this.renderList?this.renderList:e.frameGraph?e.meshes:e.getActiveMeshes().data,n=this.renderList||e.frameGraph?i.length:e.getActiveMeshes().length;this._engine.currentRenderPassId=this._renderPassIds[t],this.onBeforeRenderObservable.notifyObservers(t);let a=null,o=n;this.getCustomRenderList&&(a=this.getCustomRenderList(t,i,n))&&(o=a.length),a||(a=i),this.options.doNotChangeAspectRatio||e.updateTransformMatrix(!0);for(let e=0;e<o&&r;++e){let t=a[e];if(t.isEnabled()&&!t.isBlocked&&t.isVisible&&t.subMeshes){if(this.customIsReadyFunction){if(!this.customIsReadyFunction(t,this.refreshRate,!0)){r=!1;continue}}else if(!t.isReady(!0)){r=!1;continue}}}this.onAfterRenderObservable.notifyObservers(t),s>1&&(e.incrementRenderId(),e.resetCachedMaterial())}for(let t of this.particleSystemList||e.particleSystems)t.isReady()||(r=!1);return this._engine.currentRenderPassId=t,r}_prepareRenderingManager(e=0,t=!1){let r,s,i=this._scene,n=null,a=this.renderList?this.renderList:i.frameGraph?i.meshes:i.getActiveMeshes().data,o=this.renderList||i.frameGraph?a.length:i.getActiveMeshes().length;if(this.getCustomRenderList&&(n=this.getCustomRenderList(e,a,o)),n)r=n.length,s=this.forceLayerMaskCheck;else{if(this._defaultRenderListPrepared&&!t&&!this._engine.isWebGPU)return a;this._defaultRenderListPrepared=!0,n=a,r=o,s=!this.renderList||this.forceLayerMaskCheck}let h=i.activeCamera,d=this.cameraForLOD??h,l=i.getBoundingBoxRenderer?.();if(i._activeMeshesFrozen&&this._isFrozen){if(this._renderingManager.resetSprites(),this.enableBoundingBoxRendering&&l){l.reset();for(let e=0;e<this._activeBoundingBoxes.length;e++){let t=this._activeBoundingBoxes.data[e];l.renderList.push(t)}}return n}if(this._renderingManager.reset(),this._activeMeshes.reset(),this._activeBoundingBoxes.reset(),l&&l.reset(),this.renderMeshes){let e=i.getRenderId(),t=i.getFrameId();for(let a=0;a<r;a++){let r=n[a];if(r&&!r.isBlocked){let n,a;if(this.customIsReadyFunction){if(!this.customIsReadyFunction(r,this.refreshRate,!1)){this.resetRefreshCounter();continue}}else if(!r.isReady(0===this.refreshRate)){this.resetRefreshCounter();continue}if(d){let e=r._internalAbstractMeshDataInfo._currentLOD.get(d);e&&e[1]===t?n=e[0]:(n=i.customLODSelector?i.customLODSelector(r,d):r.getLOD(d),e?(e[0]=n,e[1]=t):r._internalAbstractMeshDataInfo._currentLOD.set(d,[n,t]))}else n=r;if(!n)continue;if(n!==r&&0!==n.billboardMode&&n.computeWorldMatrix(),n._preActivateForIntermediateRendering(e),a=!!s&&!!h&&(r.layerMask&h.layerMask)==0,r.isEnabled()&&r.isVisible&&r.subMeshes&&!a){if(this._activeMeshes.push(r),n._internalAbstractMeshDataInfo._wasActiveLastFrame=!0,n!==r&&n._activate(e,!0),this.enableBoundingBoxRendering&&l&&l._preActiveMesh(r),r._activate(e,!0)&&r.subMeshes.length){r.isAnInstance?r._internalAbstractMeshDataInfo._actAsRegularMesh&&(n=r):n._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!1,n._internalAbstractMeshDataInfo._isActiveIntermediate=!0,i._prepareSkeleton(n);for(let e=0;e<n.subMeshes.length;e++){let t=n.subMeshes[e];this.enableBoundingBoxRendering&&l&&l._evaluateSubMesh(r,t),this._renderingManager.dispatch(t,n)}}r._postActivate()}}}}if(this.enableBoundingBoxRendering&&l&&t)for(let e=0;e<l.renderList.length;e++){let t=l.renderList.data[e];this._activeBoundingBoxes.push(t)}if(this._scene.particlesEnabled&&this.renderParticles){this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);let e=this.particleSystemList||i.particleSystems;for(let t=0;t<e.length;t++){let r=e[t],s=r.emitter;r.isStarted()&&s&&(!s.position||s.isEnabled())&&this._renderingManager.dispatchParticles(r)}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}return n}get renderingManager(){return this._renderingManager}setRenderingOrder(e,t=null,r=null,s=null){this._renderingManager.setRenderingOrder(e,t,r,s)}setRenderingAutoClearDepthStencil(e,t,r=!0,s=!0){this._renderingManager.setRenderingAutoClearDepthStencil(e,t,r,s),this._renderingManager._useSceneAutoClearSetup=!1}clone(){let e=new T(this.name,this._scene,this.options);return this.renderList&&(e.renderList=this.renderList.slice(0)),e}dispose(){let e=this.renderList?this.renderList:this._scene.getActiveMeshes().data,t=this.renderList?this.renderList.length:this._scene.getActiveMeshes().length;for(let r=0;r<t;r++){let t=e[r];t&&void 0!==t.getMaterialForRenderPass(this.renderPassId)&&t.setMaterialForRenderPass(this.renderPassId,void 0)}if(this.onInitRenderingObservable.clear(),this.onFinishRenderingObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderingManagerRenderObservable.clear(),this.onAfterRenderingManagerRenderObservable.clear(),this.onFastPathRenderObservable.clear(),this._releaseRenderPassId(),this.renderList=null,this._sceneUBOs)for(let e of this._sceneUBOs)e.dispose();this._sceneUBOs=void 0,this._scene.removeObjectRenderer(this)}_rebuild(){this.refreshRate===T.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=T.REFRESHRATE_RENDER_ONCE)}freeRenderingGroups(){this._renderingManager&&this._renderingManager.freeRenderingGroups()}}T.REFRESHRATE_RENDER_ONCE=0,T.REFRESHRATE_RENDER_ONEVERYFRAME=1,T.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2;var y=e.i(75405);class M extends b.Texture{get renderListPredicate(){return this._objectRenderer.renderListPredicate}set renderListPredicate(e){this._objectRenderer.renderListPredicate=e}get renderList(){return this._objectRenderer.renderList}set renderList(e){this._objectRenderer.renderList=e}get particleSystemList(){return this._objectRenderer.particleSystemList}set particleSystemList(e){this._objectRenderer.particleSystemList=e}get getCustomRenderList(){return this._objectRenderer.getCustomRenderList}set getCustomRenderList(e){this._objectRenderer.getCustomRenderList=e}get renderParticles(){return this._objectRenderer.renderParticles}set renderParticles(e){this._objectRenderer.renderParticles=e}get renderSprites(){return this._objectRenderer.renderSprites}set renderSprites(e){this._objectRenderer.renderSprites=e}get enableBoundingBoxRendering(){return this._objectRenderer.enableBoundingBoxRendering}set enableBoundingBoxRendering(e){this._objectRenderer.enableBoundingBoxRendering=e}get enableOutlineRendering(){return this._objectRenderer.enableOutlineRendering}set enableOutlineRendering(e){this._objectRenderer.enableOutlineRendering=e}get forceLayerMaskCheck(){return this._objectRenderer.forceLayerMaskCheck}set forceLayerMaskCheck(e){this._objectRenderer.forceLayerMaskCheck=e}get activeCamera(){return this._objectRenderer.activeCamera}set activeCamera(e){this._objectRenderer.activeCamera=e}get cameraForLOD(){return this._objectRenderer.cameraForLOD}set cameraForLOD(e){this._objectRenderer.cameraForLOD=e}get disableImageProcessing(){return this._objectRenderer.disableImageProcessing}set disableImageProcessing(e){this._objectRenderer.disableImageProcessing=e}get customIsReadyFunction(){return this._objectRenderer.customIsReadyFunction}set customIsReadyFunction(e){this._objectRenderer.customIsReadyFunction=e}get customRenderFunction(){return this._objectRenderer.customRenderFunction}set customRenderFunction(e){this._objectRenderer.customRenderFunction=e}get postProcesses(){return this._postProcesses}get _prePassEnabled(){return!!this._prePassRenderTarget&&this._prePassRenderTarget.enabled}set onAfterUnbind(e){this._onAfterUnbindObserver&&this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=this.onAfterUnbindObservable.add(e)}get onBeforeRenderObservable(){return this._objectRenderer.onBeforeRenderObservable}set onBeforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}get onAfterRenderObservable(){return this._objectRenderer.onAfterRenderObservable}set onAfterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}set onClear(e){this._onClearObserver&&this.onClearObservable.remove(this._onClearObserver),this._onClearObserver=this.onClearObservable.add(e)}get _waitingRenderList(){return this._objectRenderer._waitingRenderList}set _waitingRenderList(e){this._objectRenderer._waitingRenderList=e}get renderPassId(){return this._objectRenderer.renderPassId}get renderPassIds(){return this._objectRenderer.renderPassIds}get currentRefreshId(){return this._objectRenderer.currentRefreshId}setMaterialForRendering(e,t){this._objectRenderer.setMaterialForRendering(e,t)}get isMulti(){return this._renderTarget?.isMulti??!1}get renderTargetOptions(){return this._renderTargetOptions}get renderTarget(){return this._renderTarget}_onRatioRescale(){this._sizeRatio&&this.resize(this._initialSizeParameter)}set boundingBoxSize(e){if(this._boundingBoxSize&&this._boundingBoxSize.equals(e))return;this._boundingBoxSize=e;let t=this.getScene();t&&t.markAllMaterialsAsDirty(1)}get boundingBoxSize(){return this._boundingBoxSize}get depthStencilTexture(){return this._renderTarget?._depthStencilTexture??null}constructor(e,t,s,i=!1,n=!0,a=0,o=!1,h=b.Texture.TRILINEAR_SAMPLINGMODE,l=!0,c=!1,u=!1,_=5,p=!1,f,R,m=!1,O=!1){let v,P,x=!0,y=!1;if("object"==typeof i){const e=i;i=!!e.generateMipMaps,n=e.doNotChangeAspectRatio??!0,a=e.type??0,o=!!e.isCube,h=e.samplingMode??b.Texture.TRILINEAR_SAMPLINGMODE,l=e.generateDepthBuffer??!0,c=!!e.generateStencilBuffer,u=!!e.isMulti,_=e.format??5,p=!!e.delayAllocation,f=e.samples,R=e.creationFlags,m=!!e.noColorAttachment,O=!!e.useSRGBBuffer,v=e.colorAttachment,x=e.gammaSpace??x,P=e.existingObjectRenderer,y=!!e.enableClusteredLights}if(super(null,s,!i,void 0,h,void 0,void 0,void 0,void 0,_),this.ignoreCameraViewport=!1,this.onBeforeBindObservable=new d.Observable,this.onAfterUnbindObservable=new d.Observable,this.onClearObservable=new d.Observable,this.onResizeObservable=new d.Observable,this._cleared=!1,this.skipInitialClear=!1,this._samples=1,this._canRescale=!0,this._renderTarget=null,this._dontDisposeObjectRenderer=!1,this.boundingBoxPosition=r.Vector3.Zero(),this._disableEngineStages=!1,this._dumpToolsLoading=!1,!(s=this.getScene()))return;const M=this.getScene().getEngine();if(this._gammaSpace=x,this._coordinatesMode=b.Texture.PROJECTION_MODE,this.name=e,this.isRenderTarget=!0,this._initialSizeParameter=t,this._dontDisposeObjectRenderer=!!P,this._processSizeParameter(t),this._objectRenderer=P??new T(e,s,{numPasses:o?6:this.getRenderLayers()||1,doNotChangeAspectRatio:n,enableClusteredLights:y}),this._onBeforeRenderingManagerRenderObserver=this._objectRenderer.onBeforeRenderingManagerRenderObservable.add(()=>{let e=this._scene;if(!this._disableEngineStages)for(let t of e._beforeRenderTargetClearStage)t.action(this,this._currentFaceIndex,this._currentLayer);if(this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(M):this.skipInitialClear||M.clear(this.clearColor??e.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||e.updateTransformMatrix(!0),!this._disableEngineStages)for(let t of e._beforeRenderTargetDrawStage)t.action(this,this._currentFaceIndex,this._currentLayer);M._debugPushGroup&&M._debugPushGroup(`Render to ${this.name} (face #${this._currentFaceIndex} layer #${this._currentLayer})`)}),this._onAfterRenderingManagerRenderObserver=this._objectRenderer.onAfterRenderingManagerRenderObservable.add(()=>{if(M._debugPopGroup&&M._debugPopGroup(),!this._disableEngineStages)for(let e of this._scene._afterRenderTargetDrawStage)e.action(this,this._currentFaceIndex,this._currentLayer);let e=this._texture?.generateMipMaps??!1;if(this._texture&&(this._texture.generateMipMaps=!1),this._postProcessManager?this._postProcessManager._finalizeFrame(!1,this._renderTarget??void 0,this._currentFaceIndex,this._postProcesses,this.ignoreCameraViewport):this._currentUseCameraPostProcess&&this._scene.postProcessManager._finalizeFrame(!1,this._renderTarget??void 0,this._currentFaceIndex),!this._disableEngineStages)for(let e of this._scene._afterRenderTargetPostProcessStage)e.action(this,this._currentFaceIndex,this._currentLayer);this._texture&&(this._texture.generateMipMaps=e),this._doNotChangeAspectRatio||this._scene.updateTransformMatrix(!0),this._currentDumpForDebug&&(this._dumpTools?this._dumpTools.DumpFramebuffer(this.getRenderWidth(),this.getRenderHeight(),M):g.Logger.Error("dumpTools module is still being loaded. To speed up the process import dump tools directly in your project"))}),this._onFastPathRenderObserver=this._objectRenderer.onFastPathRenderObservable.add(()=>{this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(M):this.skipInitialClear||M.clear(this.clearColor||this._scene.clearColor,!0,!0,!0)}),this._resizeObserver=M.onResizeObservable.add(()=>{}),this._generateMipMaps=!!i,this._doNotChangeAspectRatio=n,u)return;this._renderTargetOptions={generateMipMaps:i,type:a,format:this._format??void 0,samplingMode:this.samplingMode,generateDepthBuffer:l,generateStencilBuffer:c,samples:f,creationFlags:R,noColorAttachment:m,useSRGBBuffer:O,colorAttachment:v,label:this.name},this.samplingMode===b.Texture.NEAREST_SAMPLINGMODE&&(this.wrapU=b.Texture.CLAMP_ADDRESSMODE,this.wrapV=b.Texture.CLAMP_ADDRESSMODE),p||(o?(this._renderTarget=s.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions),this.coordinatesMode=b.Texture.INVCUBIC_MODE,this._textureMatrix=r.Matrix.Identity()):this._renderTarget=s.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,void 0!==f&&(this.samples=f))}createDepthStencilTexture(e=0,t=!0,r=!1,s=1,i=14,n){this._renderTarget?.createDepthStencilTexture(e,t,r,s,i,n)}_processSizeParameter(e){if(e.ratio){this._sizeRatio=e.ratio;let t=this._getEngine();this._size={width:this._bestReflectionRenderTargetDimension(t.getRenderWidth(),this._sizeRatio),height:this._bestReflectionRenderTargetDimension(t.getRenderHeight(),this._sizeRatio)}}else this._size=e}get samples(){return this._renderTarget?.samples??this._samples}set samples(e){this._renderTarget&&(this._samples=this._renderTarget.setSamples(e))}addPostProcess(e){if(!this._postProcessManager){let e=this.getScene();if(!e)return;this._postProcessManager=new R.PostProcessManager(e),this._postProcesses=[]}this._postProcesses.push(e),this._postProcesses[0].autoClear=!1}clearPostProcesses(e=!1){if(this._postProcesses){if(e)for(let e of this._postProcesses)e.dispose();this._postProcesses=[]}}removePostProcess(e){if(!this._postProcesses)return;let t=this._postProcesses.indexOf(e);-1!==t&&(this._postProcesses.splice(t,1),this._postProcesses.length>0&&(this._postProcesses[0].autoClear=!1))}resetRefreshCounter(){this._objectRenderer.resetRefreshCounter()}get refreshRate(){return this._objectRenderer.refreshRate}set refreshRate(e){this._objectRenderer.refreshRate=e}_shouldRender(){return this._objectRenderer.shouldRender()}getRenderSize(){return this.getRenderWidth()}getRenderWidth(){return this._size.width?this._size.width:this._size}getRenderHeight(){return this._size.width?this._size.height:this._size}getRenderLayers(){let e=this._size.layers;if(e)return e;let t=this._size.depth;return t||0}disableRescaling(){this._canRescale=!1}get canRescale(){return this._canRescale}scale(e){let t=Math.max(1,this.getRenderSize()*e);this.resize(t)}getReflectionTextureMatrix(){return this.isCube?this._textureMatrix:super.getReflectionTextureMatrix()}resize(e){let t=this.isCube;this._renderTarget?.dispose(),this._renderTarget=null;let r=this.getScene();r&&(this._processSizeParameter(e),t?this._renderTarget=r.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):this._renderTarget=r.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,void 0!==this._renderTargetOptions.samples&&(this.samples=this._renderTargetOptions.samples),this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this))}render(e=!1,t=!1){this._render(e,t)}isReadyForRendering(){this._dumpToolsLoading||(this._dumpToolsLoading=!0,e.A(49950).then(e=>this._dumpTools=e)),this._objectRenderer.prepareRenderList(),this.onBeforeBindObservable.notifyObservers(this),this._objectRenderer.initRender(this.getRenderWidth(),this.getRenderHeight());let t=this._objectRenderer._checkReadiness();return this.onAfterUnbindObservable.notifyObservers(this),this._objectRenderer.finishRender(),t}_render(e=!1,t=!1){let r=this.getScene();if(!r)return;void 0!==this.useCameraPostProcesses&&(e=this.useCameraPostProcesses);let s=r.getEngine();if(s._debugPushGroup&&s._debugPushGroup(`Render to ${this.name}`),this._objectRenderer.prepareRenderList(),this.onBeforeBindObservable.notifyObservers(this),this._objectRenderer.initRender(this.getRenderWidth(),this.getRenderHeight()),(this.is2DArray||this.is3D)&&!this.isMulti)for(let s=0;s<this.getRenderLayers();s++)this._renderToTarget(0,e,t,s),r.incrementRenderId(),r.resetCachedMaterial();else if(this.isCube&&!this.isMulti)for(let s=0;s<6;s++)this._renderToTarget(s,e,t),r.incrementRenderId(),r.resetCachedMaterial();else this._renderToTarget(0,e,t);this.onAfterUnbindObservable.notifyObservers(this),this._objectRenderer.finishRender(),s._debugPopGroup&&s._debugPopGroup()}_bestReflectionRenderTargetDimension(e,r){let s=e*r,i=(0,t.NearestPOT)(s+16384/(128+s));return Math.min((0,t.FloorPOT)(e),i)}_bindFrameBuffer(e=0,t=0){let r=this.getScene();if(!r)return;let s=r.getEngine();this._renderTarget&&s.bindFramebuffer(this._renderTarget,this.isCube?e:void 0,void 0,void 0,this.ignoreCameraViewport,0,t)}_unbindFrameBuffer(e,t){this._renderTarget&&e.unBindFramebuffer(this._renderTarget,this.isCube,()=>{this.onAfterRenderObservable.notifyObservers(t)})}_prepareFrame(e,t,r,s){this._postProcessManager?this._prePassEnabled||this._postProcessManager._prepareFrame(this._texture,this._postProcesses)||this._bindFrameBuffer(t,r):s&&e.postProcessManager._prepareFrame(this._texture)||this._bindFrameBuffer(t,r)}_renderToTarget(e,t,r,s=0){let i=this.getScene();if(!i)return;let n=i.getEngine();this._currentFaceIndex=e,this._currentLayer=s,this._currentUseCameraPostProcess=t,this._currentDumpForDebug=r,this._prepareFrame(i,e,s,t),this._objectRenderer.render(e+s,!0),this._unbindFrameBuffer(n,e),this._texture&&this.isCube&&5===e&&n.generateMipMapsForCubemap(this._texture,!0)}setRenderingOrder(e,t=null,r=null,s=null){this._objectRenderer.setRenderingOrder(e,t,r,s)}setRenderingAutoClearDepthStencil(e,t){this._objectRenderer.setRenderingAutoClearDepthStencil(e,t)}clone(){let e=this.getSize(),t=new M(this.name,e,this.getScene(),this._renderTargetOptions.generateMipMaps,this._doNotChangeAspectRatio,this._renderTargetOptions.type,this.isCube,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer,this._renderTargetOptions.generateStencilBuffer,void 0,this._renderTargetOptions.format,void 0,this._renderTargetOptions.samples);return t.hasAlpha=this.hasAlpha,t.level=this.level,t.coordinatesMode=this.coordinatesMode,this.renderList&&(t.renderList=this.renderList.slice(0)),t}serialize(){if(!this.name)return null;let e=super.serialize();if(e.renderTargetSize=this.getRenderSize(),e.renderList=[],this.renderList)for(let t=0;t<this.renderList.length;t++)e.renderList.push(this.renderList[t].id);return e}disposeFramebufferObjects(){this._renderTarget?.dispose(!0)}releaseInternalTexture(){this._renderTarget?.releaseTextures(),this._texture=null}dispose(){this.onResizeObservable.clear(),this.onClearObservable.clear(),this.onAfterUnbindObservable.clear(),this.onBeforeBindObservable.clear(),this._postProcessManager&&(this._postProcessManager.dispose(),this._postProcessManager=null),this._prePassRenderTarget&&this._prePassRenderTarget.dispose(),this._objectRenderer.onBeforeRenderingManagerRenderObservable.remove(this._onBeforeRenderingManagerRenderObserver),this._objectRenderer.onAfterRenderingManagerRenderObservable.remove(this._onAfterRenderingManagerRenderObserver),this._objectRenderer.onFastPathRenderObservable.remove(this._onFastPathRenderObserver),this._dontDisposeObjectRenderer||this._objectRenderer.dispose(),this.clearPostProcesses(!0),this._resizeObserver&&(this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null);let e=this.getScene();if(!e)return;let t=e.customRenderTargets.indexOf(this);for(let r of(t>=0&&e.customRenderTargets.splice(t,1),e.cameras))(t=r.customRenderTargets.indexOf(this))>=0&&r.customRenderTargets.splice(t,1);this._renderTarget?.dispose(),this._renderTarget=null,this._texture=null,super.dispose()}_rebuild(){this._objectRenderer._rebuild(),this._postProcessManager&&this._postProcessManager._rebuild()}freeRenderingGroups(){this._objectRenderer.freeRenderingGroups()}getViewCount(){return 1}}M.REFRESHRATE_RENDER_ONCE=T.REFRESHRATE_RENDER_ONCE,M.REFRESHRATE_RENDER_ONEVERYFRAME=T.REFRESHRATE_RENDER_ONEVERYFRAME,M.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=T.REFRESHRATE_RENDER_ONEVERYTWOFRAMES,Object.getOwnPropertyDescriptor(M.prototype,"noPrePassRenderer")||Object.defineProperty(M.prototype,"noPrePassRenderer",(0,y._MissingSideEffectProperty)("RenderTargetTexture","noPrePassRenderer"));var C=_,S=e.i(81623);class A extends C.EffectWrapper{_gatherImports(t,r){t?(this._webGPUReady=!0,r.push(Promise.all([e.A(78398)]))):r.push(Promise.all([e.A(21236)])),super._gatherImports(t,r)}constructor(e,t=null,r){const s={name:e,engine:t||S.EngineStore.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:A.FragmentUrl,...r};s.engine||(s.engine=S.EngineStore.LastCreatedEngine),super(s)}}A.FragmentUrl="pass";class E extends C.EffectWrapper{_gatherImports(t,r){t?(this._webGPUReady=!0,r.push(Promise.all([e.A(7133)]))):r.push(Promise.all([e.A(26167)])),super._gatherImports(t,r)}constructor(e,t=null,r){super({...r,name:e,engine:t||S.EngineStore.LastCreatedEngine,useShaderStore:!0,useAsPostProcess:!0,fragmentShader:E.FragmentUrl,defines:"#define POSITIVEX"}),this._face=0}get face(){return this._face}set face(e){if(!(e<0)&&!(e>5))switch(this._face=e,this._face){case 0:this.updateEffect("#define POSITIVEX");break;case 1:this.updateEffect("#define NEGATIVEX");break;case 2:this.updateEffect("#define POSITIVEY");break;case 3:this.updateEffect("#define NEGATIVEY");break;case 4:this.updateEffect("#define POSITIVEZ");break;case 5:this.updateEffect("#define NEGATIVEZ")}}}E.FragmentUrl="passCube";class I extends p{get face(){return this._effectWrapper.face}set face(e){this._effectWrapper.face=e}getClassName(){return"PassCubePostProcess"}constructor(e,t,r=null,s,i,n,a=0,o=!1){const h={size:"number"==typeof t?t:void 0,camera:r,samplingMode:s,engine:i,reusable:n,textureType:a,blockCompilation:o,...t};super(e,A.FragmentUrl,{effectWrapper:"number"!=typeof t&&t.effectWrapper?void 0:new E(e,i,h),...h})}static _Parse(e,t,r,s){return c.SerializationHelper.Parse(()=>new I(e.name,e.options,t,e.renderTargetSamplingMode,e._engine,e.reusable),e,r,s)}}(0,o.__decorate)([(0,l.serialize)()],I.prototype,"face",null);var L=e.i(96704);L.ToHalfFloat,L.FromHalfFloat;var B=e.i(37348),w=e.i(38118);let F="image/png",z=[134,22,135,150,246,214,150,54];function U(e){if(e.version>2)throw Error(`Unsupported babylon environment map version "${e.version}". Latest supported version is "2".`);return 2===e.version?e:e={...e,version:2,imageType:F}}async function D(e,t,r,s,i,n,a,o,h,d,l){return await new Promise((c,u)=>{if(r){let r=t.createTexture(null,!0,!0,null,1,null,e=>{u(e)},e);s?.onEffectCreatedObservable.addOnce(o=>{o.executeWhenCompiled(()=>{s.externalTextureSamplerBinding=!0,s.onApply=s=>{s._bindTexture("textureSampler",r),s.setFloat2("scale",1,t._features.needsInvertingBitmap&&e instanceof ImageBitmap?-1:1)},t.scenes.length&&(t.scenes[0].postProcessManager.directRender([s],d,!0,n,a),t.restoreDefaultFramebuffer(),r.dispose(),URL.revokeObjectURL(i),c())})})}else{if(t._uploadImageToTexture(l,e,n,a),o){let r=h[a];r&&t._uploadImageToTexture(r._texture,e,n,0)}c()}})}async function j(e,t,r=F){let s=e.getEngine();e.format=5,e.type=0,e.generateMipMaps=!0,e._cachedAnisotropicFilteringLevel=null,s.updateTextureSamplingMode(3,e),await N(e,t,!0,r),e.isReady=!0}async function W(e,t,r,s=F,i=null){let o=e.getEngine(),h=new n.InternalTexture(o,5),d=new a.BaseTexture(o,h);e._irradianceTexture=d,d._dominantDirection=i,h.isCube=!0,h.format=5,h.type=0,h.generateMipMaps=!0,h._cachedAnisotropicFilteringLevel=null,h.generateMipMaps=!0,h.width=r,h.height=r,o.updateTextureSamplingMode(3,h),await N(h,[t],!1,s),o.generateMipMapsForCubemap(h),h.isReady=!0}async function N(r,i,o,h=F){if(!(0,t.IsExponentOfTwo)(r.width))throw Error("Texture size must be a power of two");let d=(0,s.ILog2)(r.width)+1,l=r.getEngine(),c=!1,u=!1,_=null,g=null,f=null,b=l.getCaps();b.textureLOD?l._features.supportRenderAndCopyToLodForFloatTextures?b.textureHalfFloatRender&&b.textureHalfFloatLinearFiltering?(c=!0,r.type=2):b.textureFloatRender&&b.textureFloatLinearFiltering&&(c=!0,r.type=1):c=!1:(c=!1,u=o);let R=0;if(c)l.isWebGPU?(R=1,await e.A(35527)):await e.A(19392),_=new p("rgbdDecode","rgbdDecode",null,null,1,null,3,l,!1,void 0,r.type,void 0,null,!1,void 0,R),r._isRGBD=!1,r.invertY=!1,g=l.createRenderTargetCubeTexture(r.width,{generateDepthBuffer:!1,generateMipMaps:!0,generateStencilBuffer:!1,samplingMode:3,type:r.type,format:5});else if(r._isRGBD=!0,r.invertY=!0,u){f={};let e=r._lodGenerationScale,t=r._lodGenerationOffset;for(let s=0;s<3;s++){let i=(d-1)*e+t,o=Math.round(Math.min(Math.max(t+(i-t)*(1-s/2),0),i)),h=new n.InternalTexture(l,2);h.isCube=!0,h.invertY=!0,h.generateMipMaps=!1,l.updateTextureSamplingMode(2,h);let c=new a.BaseTexture(null);switch(c._isCube=!0,c._texture=h,f[o]=c,s){case 0:r._lodTextureLow=c;break;case 1:r._lodTextureMid=c;break;case 2:r._lodTextureHigh=c}}}let m=[];for(let e=0;e<i.length;e++)for(let t=0;t<6;t++){let s,n=i[e][t],a=new Blob([(0,w.GetBlobBufferSource)(n)],{type:h}),o=URL.createObjectURL(a);if(l._features.forceBitmapOverHTMLImageElement)s=l.createImageBitmap(a,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(async s=>await D(s,l,c,_,o,t,e,u,f,g,r));else{let i=new Image;i.src=o,s=new Promise((s,n)=>{i.onload=()=>{D(i,l,c,_,o,t,e,u,f,g,r).then(()=>s()).catch(e=>{n(e)})},i.onerror=e=>{n(e)}})}m.push(s)}if(await Promise.all(m),i.length<d){let e,t=Math.pow(2,d-1-i.length),s=t*t*4;switch(r.type){case 0:e=new Uint8Array(s);break;case 2:e=new Uint16Array(s);break;case 1:e=new Float32Array(s)}for(let t=i.length;t<d;t++)for(let s=0;s<6;s++)l._uploadArrayBufferViewToTexture(g?.texture||r,e,s,t)}if(g){let e=r._irradianceTexture;r._irradianceTexture=null,l._releaseTexture(r),g._swapAndDie(r),r._irradianceTexture=e}_&&_.dispose(),u&&(r._lodTextureHigh&&r._lodTextureHigh._texture&&(r._lodTextureHigh._texture.isReady=!0),r._lodTextureMid&&r._lodTextureMid._texture&&(r._lodTextureMid._texture.isReady=!0),r._lodTextureLow&&r._lodTextureLow._texture&&(r._lodTextureLow._texture.isReady=!0))}var G=e.i(20461);let V=!1;e.s(["_ENVTextureLoader",0,class{constructor(){this.supportCascades=!1}loadCubeData(e,t,s,n,o){if(Array.isArray(e))return;let h=function(e){let t,r=new DataView(e.buffer,e.byteOffset,e.byteLength),s=0;for(let e=0;e<z.length;e++)if(r.getUint8(s++)!==z[e])return g.Logger.Error("Not a babylon environment map"),null;let i="";for(;t=r.getUint8(s++);)i+=String.fromCharCode(t);let n=JSON.parse(i);return(n=U(n)).binaryDataPosition=s,n.specular&&(n.specular.lodGenerationScale=n.specular.lodGenerationScale||.8),n}(e);if(h){t.width=h.width,t.height=h.width;try{V||(V=!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=G.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})),function(e,t){let s=(t=U(t)).irradiance;if(!s)return;let n=new i.SphericalPolynomial;r.Vector3.FromArrayToRef(s.x,0,n.x),r.Vector3.FromArrayToRef(s.y,0,n.y),r.Vector3.FromArrayToRef(s.z,0,n.z),r.Vector3.FromArrayToRef(s.xx,0,n.xx),r.Vector3.FromArrayToRef(s.yy,0,n.yy),r.Vector3.FromArrayToRef(s.zz,0,n.zz),r.Vector3.FromArrayToRef(s.yz,0,n.yz),r.Vector3.FromArrayToRef(s.zx,0,n.zx),r.Vector3.FromArrayToRef(s.xy,0,n.xy),e._sphericalPolynomial=n}(t,h),(function(e,t,s){let i=(s=U(s)).specular;if(!i)return Promise.resolve([]);e._lodGenerationScale=i.lodGenerationScale;let n=[],a=function(e,t){let r=(t=U(t)).specular,s=Math.log2(t.width);if(s=Math.round(s)+1,r.mipmaps.length!==6*s)throw Error(`Unsupported specular mipmaps number "${r.mipmaps.length}"`);let i=Array(s);for(let n=0;n<s;n++){i[n]=Array(6);for(let s=0;s<6;s++){let a=r.mipmaps[6*n+s];i[n][s]=new Uint8Array(e.buffer,e.byteOffset+t.binaryDataPosition+a.position,a.length)}}return i}(t,s);n.push(j(e,a,s.imageType));let o=s.irradiance?.irradianceTexture;if(o){let i=function(e,t){t=U(t);let r=Array(6),s=t.irradiance?.irradianceTexture;if(s){if(6!==s.faces.length)throw Error(`Incorrect irradiance texture faces number "${s.faces.length}"`);for(let i=0;i<6;i++){let n=s.faces[i];r[i]=new Uint8Array(e.buffer,e.byteOffset+t.binaryDataPosition+n.position,n.length)}}return r}(t,s),a=null;s.irradiance?.irradianceTexture?.dominantDirection&&(a=r.Vector3.FromArray(s.irradiance.irradianceTexture.dominantDirection)),n.push(W(e,i,o.size,s.imageType,a))}return Promise.all(n)})(t,e,h).then(()=>{t.isReady=!0,t.onLoadedObservable.notifyObservers(t),t.onLoadedObservable.clear(),n&&n()},e=>{o?.("Can not upload environment levels",e)})}catch(e){o?.("Can not upload environment file",e)}}else o&&o("Can not parse the environment file",null)}loadData(){throw".env not supported in 2d."}}],41342)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12423,t=>{"use strict";class e{static GetShadersRepository(t=0){return 0===t?e.ShadersRepository:e.ShadersRepositoryWGSL}static GetShadersStore(t=0){return 0===t?e.ShadersStore:e.ShadersStoreWGSL}static GetIncludesShadersStore(t=0){return 0===t?e.IncludesShadersStore:e.IncludesShadersStoreWGSL}}e.ShadersRepository="src/Shaders/",e.ShadersStore={},e.IncludesShadersStore={},e.ShadersRepositoryWGSL="src/ShadersWGSL/",e.ShadersStoreWGSL={},e.IncludesShadersStoreWGSL={},t.s(["ShaderStore",0,e])},85531,t=>{"use strict";var e=t.i(65002);class i{static GetPlanes(t){let o=[];for(let t=0;t<6;t++)o.push(new e.Plane(0,0,0,0));return i.GetPlanesToRef(t,o),o}static GetNearPlaneToRef(t,e){let i=t.m;e.normal.x=i[3]+i[2],e.normal.y=i[7]+i[6],e.normal.z=i[11]+i[10],e.d=i[15]+i[14],e.normalize()}static GetFarPlaneToRef(t,e){let i=t.m;e.normal.x=i[3]-i[2],e.normal.y=i[7]-i[6],e.normal.z=i[11]-i[10],e.d=i[15]-i[14],e.normalize()}static GetLeftPlaneToRef(t,e){let i=t.m;e.normal.x=i[3]+i[0],e.normal.y=i[7]+i[4],e.normal.z=i[11]+i[8],e.d=i[15]+i[12],e.normalize()}static GetRightPlaneToRef(t,e){let i=t.m;e.normal.x=i[3]-i[0],e.normal.y=i[7]-i[4],e.normal.z=i[11]-i[8],e.d=i[15]-i[12],e.normalize()}static GetTopPlaneToRef(t,e){let i=t.m;e.normal.x=i[3]-i[1],e.normal.y=i[7]-i[5],e.normal.z=i[11]-i[9],e.d=i[15]-i[13],e.normalize()}static GetBottomPlaneToRef(t,e){let i=t.m;e.normal.x=i[3]+i[1],e.normal.y=i[7]+i[5],e.normal.z=i[11]+i[9],e.d=i[15]+i[13],e.normalize()}static GetPlanesToRef(t,e){i.GetNearPlaneToRef(t,e[0]),i.GetFarPlaneToRef(t,e[1]),i.GetLeftPlaneToRef(t,e[2]),i.GetRightPlaneToRef(t,e[3]),i.GetTopPlaneToRef(t,e[4]),i.GetBottomPlaneToRef(t,e[5])}static IsPointInFrustum(t,e){for(let i=0;i<6;i++)if(0>e[i].dotCoordinate(t))return!1;return!0}}t.s(["Frustum",0,i])},45707,t=>{"use strict";class e{constructor(t){this.length=0,this.data=Array(t),this._id=e._GlobalId++}push(t){this.data[this.length++]=t,this.length>this.data.length&&(this.data.length*=2)}forEach(t){for(let e=0;e<this.length;e++)t(this.data[e])}sort(t){this.data.sort(t)}reset(){this.length=0}dispose(){this.reset(),this.data&&(this.data.length=0)}concat(t){if(0!==t.length){this.length+t.length>this.data.length&&(this.data.length=(this.length+t.length)*2);for(let e=0;e<t.length;e++)this.data[this.length++]=(t.data||t)[e]}}indexOf(t){let e=this.data.indexOf(t);return e>=this.length?-1:e}contains(t){return -1!==this.indexOf(t)}}e._GlobalId=0,t.s(["SmartArray",0,e,"SmartArrayNoDuplicate",0,class extends e{constructor(){super(...arguments),this._duplicateId=0}push(t){super.push(t),t.__smartArrayFlags||(t.__smartArrayFlags={}),t.__smartArrayFlags[this._id]=this._duplicateId}pushNoDuplicate(t){return(!t.__smartArrayFlags||t.__smartArrayFlags[this._id]!==this._duplicateId)&&(this.push(t),!0)}reset(){super.reset(),this._duplicateId++}concatWithNoDuplicate(t){if(0!==t.length){this.length+t.length>this.data.length&&(this.data.length=(this.length+t.length)*2);for(let e=0;e<t.length;e++){let i=(t.data||t)[e];this.pushNoDuplicate(i)}}}}])},36365,t=>{"use strict";class e{}e.KEYDOWN=1,e.KEYUP=2;class i{constructor(t,e){this.type=t,this.event=e}}t.s(["KeyboardEventTypes",0,e,"KeyboardInfo",0,i,"KeyboardInfoPre",0,class extends i{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(t){this.skipOnKeyboardObservable=t}constructor(t,e){super(t,e),this.type=t,this.event=e,this.skipOnKeyboardObservable=!1}}])},21222,t=>{"use strict";var e=t.i(96265);class i{}i.POINTERDOWN=1,i.POINTERUP=2,i.POINTERMOVE=4,i.POINTERWHEEL=8,i.POINTERPICK=16,i.POINTERTAP=32,i.POINTERDOUBLETAP=64;class o{constructor(t,e){this.type=t,this.event=e}}t.s(["PointerEventTypes",0,i,"PointerInfo",0,class extends o{get pickInfo(){return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(t,e,i,o=null){super(t,e),this._pickInfo=i,this._inputManager=o}_generatePickInfo(){this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}},"PointerInfoPre",0,class extends o{constructor(t,i,o,a){super(t,i),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new e.Vector2(o,a)}}])},76696,t=>{"use strict";var e,i;(i=e||(e={}))[i.PointerMove=0]="PointerMove",i[i.PointerDown=1]="PointerDown",i[i.PointerUp=2]="PointerUp";class o{}o.DOM_DELTA_PIXEL=0,o.DOM_DELTA_LINE=1,o.DOM_DELTA_PAGE=2,t.s(["EventConstants",0,o])},25348,t=>{"use strict";class e{constructor(t,e,i,o){this.x=t,this.y=e,this.width=i,this.height=o}toGlobal(t,i){return new e(this.x*t,this.y*i,this.width*t,this.height*i)}toGlobalToRef(t,e,i){return i.x=this.x*t,i.y=this.y*e,i.width=this.width*t,i.height=this.height*e,this}clone(){return new e(this.x,this.y,this.width,this.height)}}t.s(["Viewport",0,e])},70247,t=>{"use strict";var e,i,o,a,s=t.i(96265);(e=o||(o={}))[e.LOCAL=0]="LOCAL",e[e.WORLD=1]="WORLD",e[e.BONE=2]="BONE";class r{}r.X=new s.Vector3(1,0,0),r.Y=new s.Vector3(0,1,0),r.Z=new s.Vector3(0,0,1),(i=a||(a={}))[i.X=0]="X",i[i.Y=1]="Y",i[i.Z=2]="Z",t.s(["Axis",0,r,"Coordinate",0,a,"Space",0,o])},58302,16074,63764,95190,t=>{"use strict";var e=t.i(10272),i=t.i(37143),o=t.i(59576),a=t.i(96265),s=t.i(89030),r=t.i(70247);class n{constructor(t,e,i){this._cameraPosition=e,this._behavior=i,this.activeInput=!1,this.speed=1,this.zoomSpeed=1,this.panSpeed=1,this.rotationXSpeed=1,this.rotationYSpeed=1,this._zoomSpeedMultiplier=1,this._panSpeedMultiplier=1,this.zoomInertia=.9,this.panInertia=.9,this.rotationInertia=.9,this.zoomAccumulatedPixels=0,this.panAccumulatedPixels=new a.Vector3,this.rotationAccumulatedPixels=new a.Vector3,this.zoomDeltaCurrentFrame=0,this.panDeltaCurrentFrame=a.Vector3.Zero(),this.rotationDeltaCurrentFrame=a.Vector3.Zero(),this._zoomVelocity=0,this._panVelocity=new a.Vector3,this.referenceFrameRate=60,this._rotationVelocity=new a.Vector3,this._prevFrameTimeMs=0,this._scene=t}computeCurrentFrameDeltas(){let t=this._scene.getEngine().getDeltaTime(),e=this._getEffectiveDeltaMs(t);if(0===this._zoomVelocity&&0===this.zoomAccumulatedPixels&&0===this._panVelocity.x&&0===this._panVelocity.y&&0===this._panVelocity.z&&0===this.panAccumulatedPixels.x&&0===this.panAccumulatedPixels.y&&0===this.panAccumulatedPixels.z&&0===this._rotationVelocity.x&&0===this._rotationVelocity.y&&0===this._rotationVelocity.z&&0===this.rotationAccumulatedPixels.x&&0===this.rotationAccumulatedPixels.y&&0===this.rotationAccumulatedPixels.z&&!this.activeInput){this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,t>0&&(this._prevFrameTimeMs=t);return}this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,(this.panAccumulatedPixels.lengthSquared()>0||this.rotationAccumulatedPixels.lengthSquared()>0||0!==this.zoomAccumulatedPixels)&&this._behavior?.isInterpolating&&this._behavior.stopAllAnimations(),this._panVelocity.copyFromFloats(this._calculateCurrentVelocity(this._panVelocity.x,this.panAccumulatedPixels.x,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.y,this.panAccumulatedPixels.y,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.z,this.panAccumulatedPixels.z,this.panInertia)),this._panVelocity.scaleToRef(this.speed*this.panSpeed*this._panSpeedMultiplier*e,this.panDeltaCurrentFrame),this._rotationVelocity.copyFromFloats(this._calculateCurrentVelocity(this._rotationVelocity.x,this.rotationAccumulatedPixels.x,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.y,this.rotationAccumulatedPixels.y,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.z,this.rotationAccumulatedPixels.z,this.rotationInertia)),this.rotationDeltaCurrentFrame.copyFromFloats(this._rotationVelocity.x*this.speed*this.rotationXSpeed*e,this._rotationVelocity.y*this.speed*this.rotationYSpeed*e,0),this._zoomVelocity=this._calculateCurrentVelocity(this._zoomVelocity,this.zoomAccumulatedPixels,this.zoomInertia),this.zoomDeltaCurrentFrame=this._zoomVelocity*(this.speed*this.zoomSpeed*this._zoomSpeedMultiplier)*e,t>0&&(this._prevFrameTimeMs=t),this.zoomAccumulatedPixels=0,this.panAccumulatedPixels.setAll(0),this.rotationAccumulatedPixels.setAll(0),this.activeInput=!1}resetRotationVelocity(){this._rotationVelocity.setAll(0),this.rotationAccumulatedPixels.setAll(0)}resetPanVelocity(){this._panVelocity.setAll(0),this.panAccumulatedPixels.setAll(0)}resetZoomVelocity(){this._zoomVelocity=0,this.zoomAccumulatedPixels=0}get isInterpolating(){return!!this._behavior?.isInterpolating}getFrameIndependentDecay(t){let e=this._scene.getEngine().getDeltaTime();return Math.pow(t,this._getEffectiveDeltaMs(e)/(1e3/this.referenceFrameRate))}getFrameIndependentInputScale(t){let e=1-t;return e<=0?1:(1-this.getFrameIndependentDecay(t))/e}_getEffectiveDeltaMs(t){return t>0?t:this._prevFrameTimeMs>0?this._prevFrameTimeMs:1e3/this.referenceFrameRate}_calculateCurrentVelocity(t,e,i){let o=t,a=this._scene.getEngine().getDeltaTime(),s=this._getEffectiveDeltaMs(a);if(0===s)return o;let r=this.getFrameIndependentDecay(i);if(o*=r,0!==e||this.activeInput){let t=1-i;o+=e/s*(t>0?(1-r)/t:1)}else 1e-6>Math.abs(o)&&(o=0);return o}}t.s(["CameraMovement",0,n],16074);class h{constructor(t,e){this.inputMap=[],this.handlers=t,this._createDefaultEntries=e,this.resetInputMap()}resolveInteraction(t,e){for(let i of this.inputMap)if(i.source===t&&this._entryMatches(i,e))return i;return null}resetInputMap(){this.inputMap=this._createDefaultEntries?.()??[]}getEntry(t,e,i){let o=this.inputMap;for(let a=0;a<o.length;a++){let s=o[a];if(s.source===t&&s.interaction===e&&this._entryConditionsMatch(s,i))return s}}getEntries(t,e,i){let o=[],a=this.inputMap;for(let s=0;s<a.length;s++){let r=a[s];r.source===t&&r.interaction===e&&this._entryConditionsMatch(r,i)&&o.push(r)}return o}addEntry(t){let e=this._entrySpecificity(t),i=this.inputMap.length;for(let t=0;t<this.inputMap.length;t++)if(this._entrySpecificity(this.inputMap[t])<e){i=t;break}this.inputMap.splice(i,0,t)}setInteraction(t,e,i){let o=this.resolveInteraction(t,e);return o&&this._entryCoversAllConditionsOf(o,e)?o.interaction=i:this.addEntry({source:t,...e??{},interaction:i}),!0}_entryCoversAllConditionsOf(t,e){if(!e)return!0;for(let i of Object.keys(e)){let o=e[i];if(void 0!==o){if("modifiers"===i){let e=t.modifiers??{};for(let t of Object.keys(o))if(void 0!==o[t]&&void 0===e[t])return!1}else if(void 0===t[i])return!1}}return!0}setInteractions(t,e,i){let o=0,a=this.inputMap;for(let s=0;s<a.length;s++){let r=a[s];r.source===t&&this._entryMatches(r,e)&&(r.interaction=i,o++)}return o}_entryMatches(t,e){switch(t.source){case"pointer":if(void 0!==t.button&&t.button!==e?.button)return!1;return this._matchModifiers(t.modifiers,e?.modifiers);case"wheel":return this._matchModifiers(t.modifiers,e?.modifiers);case"touch":if(void 0!==t.touchCount&&t.touchCount!==e?.touchCount)return!1;return!0;case"keyboard":if(void 0!==t.key&&(Array.isArray(t.key)?-1===t.key.indexOf(e?.key??-1):t.key!==e?.key))return!1;return this._matchModifiers(t.modifiers,e?.modifiers)}}_entryConditionsMatch(t,e){if(!e)return!0;switch(t.source){case"pointer":if("button"in e&&t.button!==e.button)return!1;return!("modifiers"in e)||this._entryModifiersMatch(t.modifiers,e.modifiers);case"wheel":return!("modifiers"in e)||this._entryModifiersMatch(t.modifiers,e.modifiers);case"touch":return!("touchCount"in e)||t.touchCount===e.touchCount;case"keyboard":if("key"in e){if(void 0===t.key)return void 0===e.key;if(void 0===e.key||(Array.isArray(t.key)?-1===t.key.indexOf(e.key):t.key!==e.key))return!1}return!("modifiers"in e)||this._entryModifiersMatch(t.modifiers,e.modifiers)}}_entrySpecificity(t){let e=0;return"button"in t&&void 0!==t.button&&e++,"key"in t&&void 0!==t.key&&e++,"touchCount"in t&&void 0!==t.touchCount&&e++,"modifiers"in t&&t.modifiers&&e++,e}_matchModifiers(t,e){return!t||(void 0===t.ctrl||t.ctrl===(e?.ctrl??!1))&&(void 0===t.shift||t.shift===(e?.shift??!1))&&(void 0===t.alt||t.alt===(e?.alt??!1))}_entryModifiersMatch(t,e){return e?void 0===e.ctrl&&void 0===e.shift&&void 0===e.alt?!t||void 0===t.ctrl&&void 0===t.shift&&void 0===t.alt:(void 0===e.ctrl||t?.ctrl===e.ctrl)&&(void 0===e.shift||t?.shift===e.shift)&&(void 0===e.alt||t?.alt===e.alt):!t}}t.s(["InputMapper",0,h],63764);class l extends n{constructor(t,e,i){super(t,e,i),this.input=new h({translate:(t,e,i)=>{this.panAccumulatedPixels.x+=t,this.panAccumulatedPixels.y+=e,this.panAccumulatedPixels.z+=i},rotate:(t,e)=>{this.rotationAccumulatedPixels.x+=t,this.rotationAccumulatedPixels.y+=e}},()=>this._createDefaultInputMap())}_createDefaultInputMap(){return[{source:"pointer",interaction:"rotate"},{source:"keyboard",interaction:"translate"},{source:"keyboard",interaction:"rotate"},{source:"touch",interaction:"rotate"},{source:"touch",interaction:"translate"}]}}let c=a.Matrix.Zero(),d=a.Quaternion.Identity();class u extends o.Camera{get inertia(){return this._targetInertia}set inertia(t){this._targetInertia=t,this.movement&&(this.movement.panInertia=t,this.movement.rotationInertia=t)}constructor(t,e,i,o=!0){super(t,e,i,o),this.cameraDirection=new a.Vector3(0,0,0),this.cameraRotation=new a.Vector2(0,0),this._targetInertia=.9,this.updateUpVectorFromRotation=!1,this.speed=2,this.noRotationConstraint=!1,this.invertRotation=!1,this.inverseRotationSpeed=.2,this._panningEpsilon=s.Epsilon,this._rotationEpsilon=s.Epsilon,this.lockedTarget=null,this._currentTarget=a.Vector3.Zero(),this._initialFocalDistance=1,this._viewMatrix=a.Matrix.Zero(),this._cameraTransformMatrix=a.Matrix.Zero(),this._cameraRotationMatrix=a.Matrix.Zero(),this._transformedReferencePoint=a.Vector3.Zero(),this._deferredPositionUpdate=new a.Vector3,this._deferredRotationQuaternionUpdate=new a.Quaternion,this._deferredRotationUpdate=new a.Vector3,this._deferredUpdated=!1,this._deferOnly=!1,this._cachedRotationZ=0,this._cachedQuaternionRotationZ=0,this._referencePoint=a.Vector3.Forward(this.getScene().useRightHandedSystem),this.rotation=new a.Vector3(0,this.getScene().useRightHandedSystem?Math.PI:0,0),this.movement=new l(this.getScene(),this.position),this.movement.panInertia=this.inertia,this.movement.rotationInertia=this.inertia}getFrontPosition(t){this.getWorldMatrix();let e=a.TmpVectors.Vector3[0],i=a.TmpVectors.Vector3[1];return i.set(0,0,this._scene.useRightHandedSystem?-1:1),this.getDirectionToRef(i,e),e.scaleInPlace(t),this.globalPosition.add(e)}_getLockedTargetPosition(){if(!this.lockedTarget)return null;if(this.lockedTarget.absolutePosition){let t=this.lockedTarget;t.computeWorldMatrix().getTranslationToRef(t.absolutePosition)}return this.lockedTarget.absolutePosition||this.lockedTarget}storeState(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),super.storeState()}_restoreStateValues(){return!!super._restoreStateValues()&&(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&this._storedRotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0)}_initCache(){super._initCache(),this._cache.lockedTarget=new a.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new a.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new a.Quaternion(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}_updateCache(t){t||super._updateCache();let e=this._getLockedTargetPosition();e?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(e):this._cache.lockedTarget=e.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)}_isSynchronizedViewMatrix(){if(!super._isSynchronizedViewMatrix())return!1;let t=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(t):!t)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))}_computeLocalCameraSpeed(){let t=this.getEngine();return this.speed*Math.sqrt(t.getDeltaTime()/(100*t.getFps()))}setTarget(t){this.upVector.normalize(),this._initialFocalDistance=t.subtract(this.position).length(),this.position.z===t.z&&(this.position.z+=s.Epsilon),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),this.getScene().useRightHandedSystem?a.Matrix.LookAtRHToRef(this.position,t,a.Vector3.UpReadOnly,c):a.Matrix.LookAtLHToRef(this.position,t,a.Vector3.UpReadOnly,c),c.invert();let e=this.rotationQuaternion||d;a.Quaternion.FromRotationMatrixToRef(c,e),e.toEulerAnglesToRef(this.rotation),this.rotation.z=0}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this._currentTarget}_decideIfNeedsToMove(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){if(this.parent){this.parent.getWorldMatrix().invertToRef(a.TmpVectors.Matrix[0]),a.Vector3.TransformNormalToRef(this.cameraDirection,a.TmpVectors.Matrix[0],a.TmpVectors.Vector3[0]),this._deferredPositionUpdate.addInPlace(a.TmpVectors.Vector3[0]),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate);return}this._deferredPositionUpdate.addInPlace(this.cameraDirection),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate)}_checkInputs(){let t=this.movement,e=0!==this.cameraDirection.x||0!==this.cameraDirection.y||0!==this.cameraDirection.z,i=0!==this.cameraRotation.x||0!==this.cameraRotation.y;t.panAccumulatedPixels.addInPlace(this.cameraDirection),t.rotationAccumulatedPixels.x+=this.cameraRotation.x,t.rotationAccumulatedPixels.y+=this.cameraRotation.y,t.computeCurrentFrameDeltas(),this.cameraDirection.copyFrom(t.panDeltaCurrentFrame),this.cameraRotation.set(t.rotationDeltaCurrentFrame.x,t.rotationDeltaCurrentFrame.y);let o=this.speed*this._panningEpsilon;!e&&Math.abs(this.cameraDirection.x)<o&&Math.abs(this.cameraDirection.y)<o&&Math.abs(this.cameraDirection.z)<o&&(this.cameraDirection.setAll(0),t.resetPanVelocity());let s=this.speed*this._rotationEpsilon;!i&&Math.abs(this.cameraRotation.x)<s&&Math.abs(this.cameraRotation.y)<s&&(this.cameraRotation.set(0,0),t.resetRotationVelocity());let r=this.invertRotation?-this.inverseRotationSpeed:1,n=this._decideIfNeedsToMove(),h=!!(this.cameraRotation.x||this.cameraRotation.y);this._deferredUpdated=!1,this._deferredRotationUpdate.copyFrom(this.rotation),this._deferredPositionUpdate.copyFrom(this.position),this.rotationQuaternion&&this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion),n&&this._updatePosition(),h&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate),this._deferredRotationUpdate.x+=this.cameraRotation.x*r,this._deferredRotationUpdate.y+=this.cameraRotation.y*r,!this.noRotationConstraint&&(this._deferredRotationUpdate.x>1.570796&&(this._deferredRotationUpdate.x=1.570796),this._deferredRotationUpdate.x<-1.570796&&(this._deferredRotationUpdate.x=-1.570796)),this._deferOnly?this._deferredUpdated=!0:this.rotation.copyFrom(this._deferredRotationUpdate),this.rotationQuaternion&&this._deferredRotationUpdate.lengthSquared()&&(a.Quaternion.RotationYawPitchRollToRef(this._deferredRotationUpdate.y,this._deferredRotationUpdate.x,this._deferredRotationUpdate.z,this._deferredRotationQuaternionUpdate),this._deferOnly?this._deferredUpdated=!0:this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate))),this.cameraDirection.setAll(0),this.cameraRotation.set(0,0),super._checkInputs()}_updateCameraRotationMatrix(){this.rotationQuaternion?this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix):a.Matrix.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this._cameraRotationMatrix)}_rotateUpVectorWithCameraRotationMatrix(){return a.Vector3.TransformNormalToRef(a.Vector3.UpReadOnly,this._cameraRotationMatrix,this.upVector),this}_getViewMatrix(){return this.lockedTarget&&this.setTarget(this._getLockedTargetPosition()),this._updateCameraRotationMatrix(),this.rotationQuaternion&&this._cachedQuaternionRotationZ!=this.rotationQuaternion.z?(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedQuaternionRotationZ=this.rotationQuaternion.z):this._cachedRotationZ!==this.rotation.z&&(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedRotationZ=this.rotation.z),a.Vector3.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),this.updateUpVectorFromRotation&&(this.rotationQuaternion?r.Axis.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(a.Quaternion.FromEulerVectorToRef(this.rotation,d),r.Axis.Y.rotateByQuaternionToRef(d,this.upVector))),this._computeViewMatrix(this.position,this._currentTarget,this.upVector),this._viewMatrix}_computeViewMatrix(t,e,i){if(this.getScene().useRightHandedSystem?a.Matrix.LookAtRHToRef(t,e,i,this._viewMatrix):a.Matrix.LookAtLHToRef(t,e,i,this._viewMatrix),this.parent){let t=this.parent.getWorldMatrix();this._viewMatrix.invert(),this._viewMatrix.multiplyToRef(t,this._viewMatrix),this._viewMatrix.invert(),this._markSyncedWithParent()}}createRigCamera(t,e){if(this.cameraRigMode!==o.Camera.RIG_MODE_NONE){let e=new u(t,this.position.clone(),this.getScene());return e.isRigCamera=!0,e.rigParent=this,this.cameraRigMode===o.Camera.RIG_MODE_VR&&(this.rotationQuaternion||(this.rotationQuaternion=new a.Quaternion),e._cameraRigParams={},e.rotationQuaternion=new a.Quaternion),e.mode=this.mode,e.orthoLeft=this.orthoLeft,e.orthoRight=this.orthoRight,e.orthoTop=this.orthoTop,e.orthoBottom=this.orthoBottom,e}return null}_updateRigCameras(){let t=this._rigCameras[0],e=this._rigCameras[1];switch(this.computeWorldMatrix(),this.cameraRigMode){case o.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case o.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case o.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case o.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:case o.Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:{let i=this.cameraRigMode===o.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?1:-1,a=this.cameraRigMode===o.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?-1:1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*i,t),this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*a,e);break}case o.Camera.RIG_MODE_VR:t.rotationQuaternion&&e.rotationQuaternion&&this.rotationQuaternion?(t.rotationQuaternion.copyFrom(this.rotationQuaternion),e.rotationQuaternion.copyFrom(this.rotationQuaternion)):(t.rotation.copyFrom(this.rotation),e.rotation.copyFrom(this.rotation)),t.position.copyFrom(this.position),e.position.copyFrom(this.position)}super._updateRigCameras()}_getRigCamPositionAndTarget(t,e){this.getTarget().subtractToRef(this.position,u._TargetFocalPoint),u._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);let i=u._TargetFocalPoint.addInPlace(this.position);a.Matrix.TranslationToRef(-i.x,-i.y,-i.z,u._TargetTransformMatrix),u._TargetTransformMatrix.multiplyToRef(a.Matrix.RotationAxis(e.upVector,t),u._RigCamTransformMatrix),a.Matrix.TranslationToRef(i.x,i.y,i.z,u._TargetTransformMatrix),u._RigCamTransformMatrix.multiplyToRef(u._TargetTransformMatrix,u._RigCamTransformMatrix),a.Vector3.TransformCoordinatesToRef(this.position,u._RigCamTransformMatrix,e.position),e.setTarget(i)}getClassName(){return"TargetCamera"}}u._RigCamTransformMatrix=new a.Matrix,u._TargetTransformMatrix=new a.Matrix,u._TargetFocalPoint=new a.Vector3,(0,e.__decorate)([(0,i.serialize)()],u.prototype,"updateUpVectorFromRotation",void 0),(0,e.__decorate)([(0,i.serializeAsVector3)()],u.prototype,"rotation",void 0),(0,e.__decorate)([(0,i.serialize)()],u.prototype,"speed",void 0),(0,e.__decorate)([(0,i.serializeAsMeshReference)("lockedTargetId")],u.prototype,"lockedTarget",void 0),t.s(["TargetCamera",0,u],58302);var p=t.i(13379),_=t.i(80871),m={};t.s(["CameraInputTypes",0,m,"CameraInputsManager",0,class{constructor(t){this.attachedToElement=!1,this.attached={},this.camera=t,this.checkInputs=()=>{}}add(t){let e=t.getSimpleName();this.attached[e]?p.Logger.Warn("camera input of type "+e+" already exists on camera"):(this.attached[e]=t,t.camera=this.camera,t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t))),this.attachedToElement&&t.attachControl(this.noPreventDefault))}remove(t){for(let e in this.attached){let i=this.attached[e];if(i===t){i.detachControl(),i.camera=null,delete this.attached[e],this.rebuildInputCheck();return}}}removeByType(t){for(let e in this.attached){let i=this.attached[e];i.getClassName()===t&&(i.detachControl(),i.camera=null,delete this.attached[e],this.rebuildInputCheck())}}_addCheckInputs(t){let e=this.checkInputs;return()=>{e(),t()}}attachInput(t){this.attachedToElement&&t.attachControl(this.noPreventDefault)}attachElement(t=!1){if(!this.attachedToElement)for(let e in t=!o.Camera.ForceAttachControlToAlwaysPreventDefault&&t,this.attachedToElement=!0,this.noPreventDefault=t,this.attached)this.attached[e].attachControl(t)}detachElement(t=!1){for(let e in this.attached)this.attached[e].detachControl(),t&&(this.attached[e].camera=null);this.attachedToElement=!1}rebuildInputCheck(){for(let t in this.checkInputs=()=>{},this.attached){let e=this.attached[t];e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e)))}}clear(){this.attachedToElement&&this.detachElement(!0),this.attached={},this.attachedToElement=!1,this.checkInputs=()=>{}}serialize(t){let e={};for(let t in this.attached){let i=this.attached[t],o=_.SerializationHelper.Serialize(i);e[i.getClassName()]=o}t.inputsmgr=e}parse(t){let e=t.inputsmgr;if(e)for(let t in this.clear(),e){let i=m[t];if(i){let o=e[t],a=_.SerializationHelper.Parse(()=>new i,o,null);this.add(a)}}else for(let e in this.attached){let i=m[this.attached[e].getClassName()];if(i){let o=_.SerializationHelper.Parse(()=>new i,t,null);this.remove(this.attached[e]),this.add(o)}}}}],95190)},30118,t=>{"use strict";var e,i,o,a,s,r=t.i(10272),n=t.i(37143),h=t.i(96265),l=t.i(58302),c=t.i(95190),d=t.i(36365),u=t.i(65740);class p{constructor(){this.keysUp=[38],this.keysUpward=[33],this.keysDown=[40],this.keysDownward=[34],this.keysLeft=[37],this.keysRight=[39],this.rotationSpeed=.5,this.keysRotateLeft=[],this.keysRotateRight=[],this.keysRotateUp=[],this.keysRotateDown=[],this._keys=[]}attachControl(t){t=u.Tools.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(e=>{let i=e.event;if(!i.metaKey){if(e.type===d.KeyboardEventTypes.KEYDOWN)(-1!==this.keysUp.indexOf(i.keyCode)||-1!==this.keysDown.indexOf(i.keyCode)||-1!==this.keysLeft.indexOf(i.keyCode)||-1!==this.keysRight.indexOf(i.keyCode)||-1!==this.keysUpward.indexOf(i.keyCode)||-1!==this.keysDownward.indexOf(i.keyCode)||-1!==this.keysRotateLeft.indexOf(i.keyCode)||-1!==this.keysRotateRight.indexOf(i.keyCode)||-1!==this.keysRotateUp.indexOf(i.keyCode)||-1!==this.keysRotateDown.indexOf(i.keyCode))&&(-1===this._keys.indexOf(i.keyCode)&&this._keys.push(i.keyCode),t||i.preventDefault());else if(-1!==this.keysUp.indexOf(i.keyCode)||-1!==this.keysDown.indexOf(i.keyCode)||-1!==this.keysLeft.indexOf(i.keyCode)||-1!==this.keysRight.indexOf(i.keyCode)||-1!==this.keysUpward.indexOf(i.keyCode)||-1!==this.keysDownward.indexOf(i.keyCode)||-1!==this.keysRotateLeft.indexOf(i.keyCode)||-1!==this.keysRotateRight.indexOf(i.keyCode)||-1!==this.keysRotateUp.indexOf(i.keyCode)||-1!==this.keysRotateDown.indexOf(i.keyCode)){let e=this._keys.indexOf(i.keyCode);e>=0&&this._keys.splice(e,1),t||i.preventDefault()}}}))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){if(this._onKeyboardObserver){let t=this.camera,e=t.movement.input,i=e.getEntry("keyboard","translate"),o=e.getEntry("keyboard","rotate"),a=o?.sensitivity??1;for(let e=0;e<this._keys.length;e++){let s=this._keys[e],r=t._computeLocalCameraSpeed()*(i?.sensitivity??1);-1!==this.keysLeft.indexOf(s)?t._localDirection.copyFromFloats(-r,0,0):-1!==this.keysUp.indexOf(s)?t._localDirection.copyFromFloats(0,0,r):-1!==this.keysRight.indexOf(s)?t._localDirection.copyFromFloats(r,0,0):-1!==this.keysDown.indexOf(s)?t._localDirection.copyFromFloats(0,0,-r):-1!==this.keysUpward.indexOf(s)?t._localDirection.copyFromFloats(0,r,0):-1!==this.keysDownward.indexOf(s)?t._localDirection.copyFromFloats(0,-r,0):-1!==this.keysRotateLeft.indexOf(s)?(t._localDirection.copyFromFloats(0,0,0),o&&(t.cameraRotation.y-=this._getLocalRotation()*a)):-1!==this.keysRotateRight.indexOf(s)?(t._localDirection.copyFromFloats(0,0,0),o&&(t.cameraRotation.y+=this._getLocalRotation()*a)):-1!==this.keysRotateUp.indexOf(s)?(t._localDirection.copyFromFloats(0,0,0),o&&(t.cameraRotation.x-=this._getLocalRotation()*a)):-1!==this.keysRotateDown.indexOf(s)&&(t._localDirection.copyFromFloats(0,0,0),o&&(t.cameraRotation.x+=this._getLocalRotation()*a)),i||t._localDirection.copyFromFloats(0,0,0),t.getScene().useRightHandedSystem&&(t._localDirection.z*=-1),t.getViewMatrix().invertToRef(t._cameraTransformMatrix),h.Vector3.TransformNormalToRef(t._localDirection,t._cameraTransformMatrix,t._transformedDirection),t.cameraDirection.addInPlace(t._transformedDirection)}}}getClassName(){return"FreeCameraKeyboardMoveInput"}_onLostFocus(){this._keys.length=0}getSimpleName(){return"keyboard"}_getLocalRotation(){let t=this.camera._calculateHandednessMultiplier();return this.rotationSpeed*this._engine.getDeltaTime()/1e3*t}}(0,r.__decorate)([(0,n.serialize)()],p.prototype,"keysUp",void 0),(0,r.__decorate)([(0,n.serialize)()],p.prototype,"keysUpward",void 0),(0,r.__decorate)([(0,n.serialize)()],p.prototype,"keysDown",void 0),(0,r.__decorate)([(0,n.serialize)()],p.prototype,"keysDownward",void 0),(0,r.__decorate)([(0,n.serialize)()],p.prototype,"keysLeft",void 0),(0,r.__decorate)([(0,n.serialize)()],p.prototype,"keysRight",void 0),(0,r.__decorate)([(0,n.serialize)()],p.prototype,"rotationSpeed",void 0),(0,r.__decorate)([(0,n.serialize)()],p.prototype,"keysRotateLeft",void 0),(0,r.__decorate)([(0,n.serialize)()],p.prototype,"keysRotateRight",void 0),(0,r.__decorate)([(0,n.serialize)()],p.prototype,"keysRotateUp",void 0),(0,r.__decorate)([(0,n.serialize)()],p.prototype,"keysRotateDown",void 0),c.CameraInputTypes.FreeCameraKeyboardMoveInput=p;var _=t.i(99267),m=t.i(21222);class y{_applyPointerRotation(t,e){this._pointerConditions.button=this._currentActiveButton;let i=this.camera.movement.input.resolveInteraction("pointer",this._pointerConditions);if(!i||"rotate"!==i.interaction)return;let o=i.sensitivityX??i.sensitivity??1/this.angularSensibility,a=i.sensitivityY??i.sensitivity??1/this.angularSensibility;this.camera.cameraRotation.y+=t*o,this.camera.cameraRotation.x+=e*a}constructor(t=!0){this.touchEnabled=t,this.buttons=[0,1,2],this.angularSensibility=2e3,this._previousPosition=null,this.onPointerMovedObservable=new _.Observable,this._allowCameraRotation=!0,this._currentActiveButton=-1,this._activePointerId=-1,this._pointerConditions={}}attachControl(t){t=u.Tools.BackCompatCameraNoPreventDefault(arguments);let e=this.camera.getEngine(),i=e.getInputElement();this._pointerInput||(this._pointerInput=o=>{let a=o.event,s="touch"===a.pointerType;if(!this.touchEnabled&&s||o.type!==m.PointerEventTypes.POINTERMOVE&&-1===this.buttons.indexOf(a.button))return;let r=a.target;if(o.type===m.PointerEventTypes.POINTERDOWN){if(s&&-1!==this._activePointerId||!s&&-1!==this._currentActiveButton)return;this._activePointerId=a.pointerId;try{r?.setPointerCapture(a.pointerId)}catch(t){}-1===this._currentActiveButton&&(this._currentActiveButton=a.button),this._previousPosition={x:a.clientX,y:a.clientY},!t&&(a.preventDefault(),i&&i.focus()),e.isPointerLock&&this._onMouseMove&&this._onMouseMove(o.event)}else if(o.type===m.PointerEventTypes.POINTERUP){if(s&&this._activePointerId!==a.pointerId||!s&&this._currentActiveButton!==a.button)return;try{r?.releasePointerCapture(a.pointerId)}catch(t){}this._currentActiveButton=-1,this._previousPosition=null,t||a.preventDefault(),this._activePointerId=-1}else if(o.type===m.PointerEventTypes.POINTERMOVE&&(this._activePointerId===a.pointerId||!s)){if(e.isPointerLock&&this._onMouseMove)this._onMouseMove(o.event);else if(this._previousPosition){let e=this.camera._calculateHandednessMultiplier(),i=(a.clientX-this._previousPosition.x)*e,o=(a.clientY-this._previousPosition.y)*e;this._allowCameraRotation&&this._applyPointerRotation(i,o),this.onPointerMovedObservable.notifyObservers({offsetX:i,offsetY:o}),this._previousPosition={x:a.clientX,y:a.clientY},t||a.preventDefault()}}}),this._onMouseMove=i=>{if(!e.isPointerLock)return;let o=this.camera._calculateHandednessMultiplier();this._applyPointerRotation(i.movementX*o,i.movementY*o),this._previousPosition=null,t||i.preventDefault()},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,m.PointerEventTypes.POINTERDOWN|m.PointerEventTypes.POINTERUP|m.PointerEventTypes.POINTERMOVE),i&&(this._contextMenuBind=t=>this.onContextMenu(t),i.addEventListener("contextmenu",this._contextMenuBind,!1))}onContextMenu(t){t.preventDefault()}detachControl(){if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._contextMenuBind){let t=this.camera.getEngine().getInputElement();t&&t.removeEventListener("contextmenu",this._contextMenuBind)}this.onPointerMovedObservable&&this.onPointerMovedObservable.clear(),this._observer=null,this._onMouseMove=null,this._previousPosition=null}this._activePointerId=-1,this._currentActiveButton=-1}getClassName(){return"FreeCameraMouseInput"}getSimpleName(){return"mouse"}}(0,r.__decorate)([(0,n.serialize)()],y.prototype,"buttons",void 0),(0,r.__decorate)([(0,n.serialize)()],y.prototype,"angularSensibility",void 0),c.CameraInputTypes.FreeCameraMouseInput=y;var f=t.i(76696);class v{constructor(){this.wheelPrecisionX=3,this.wheelPrecisionY=3,this.wheelPrecisionZ=3,this.onChangedObservable=new _.Observable,this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0,this._ffMultiplier=12,this._normalize=120}attachControl(t){t=u.Tools.BackCompatCameraNoPreventDefault(arguments),this._wheel=e=>{if(e.type!==m.PointerEventTypes.POINTERWHEEL)return;let i=e.event,o=i.deltaMode===f.EventConstants.DOM_DELTA_LINE?this._ffMultiplier:1;this._wheelDeltaX+=this.wheelPrecisionX*o*i.deltaX/this._normalize,this._wheelDeltaY-=this.wheelPrecisionY*o*i.deltaY/this._normalize,this._wheelDeltaZ+=this.wheelPrecisionZ*o*i.deltaZ/this._normalize,i.preventDefault&&!t&&i.preventDefault()},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,m.PointerEventTypes.POINTERWHEEL)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null),this.onChangedObservable&&this.onChangedObservable.clear()}checkInputs(){this.onChangedObservable.notifyObservers({wheelDeltaX:this._wheelDeltaX,wheelDeltaY:this._wheelDeltaY,wheelDeltaZ:this._wheelDeltaZ}),this._wheelDeltaX=0,this._wheelDeltaY=0,this._wheelDeltaZ=0}getClassName(){return"BaseCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}}(0,r.__decorate)([(0,n.serialize)()],v.prototype,"wheelPrecisionX",void 0),(0,r.__decorate)([(0,n.serialize)()],v.prototype,"wheelPrecisionY",void 0),(0,r.__decorate)([(0,n.serialize)()],v.prototype,"wheelPrecisionZ",void 0),(e=i||(i={}))[e.MoveRelative=0]="MoveRelative",e[e.RotateRelative=1]="RotateRelative",e[e.MoveScene=2]="MoveScene";class R extends v{constructor(){super(...arguments),this._moveRelative=h.Vector3.Zero(),this._rotateRelative=h.Vector3.Zero(),this._moveScene=h.Vector3.Zero(),this._wheelXAction=i.MoveRelative,this._wheelXActionCoordinate=0,this._wheelYAction=i.MoveRelative,this._wheelYActionCoordinate=2,this._wheelZAction=null,this._wheelZActionCoordinate=null}getClassName(){return"FreeCameraMouseWheelInput"}set wheelXMoveRelative(t){(null!==t||this._wheelXAction===i.MoveRelative)&&(this._wheelXAction=i.MoveRelative,this._wheelXActionCoordinate=t)}get wheelXMoveRelative(){return this._wheelXAction!==i.MoveRelative?null:this._wheelXActionCoordinate}set wheelYMoveRelative(t){(null!==t||this._wheelYAction===i.MoveRelative)&&(this._wheelYAction=i.MoveRelative,this._wheelYActionCoordinate=t)}get wheelYMoveRelative(){return this._wheelYAction!==i.MoveRelative?null:this._wheelYActionCoordinate}set wheelZMoveRelative(t){(null!==t||this._wheelZAction===i.MoveRelative)&&(this._wheelZAction=i.MoveRelative,this._wheelZActionCoordinate=t)}get wheelZMoveRelative(){return this._wheelZAction!==i.MoveRelative?null:this._wheelZActionCoordinate}set wheelXRotateRelative(t){(null!==t||this._wheelXAction===i.RotateRelative)&&(this._wheelXAction=i.RotateRelative,this._wheelXActionCoordinate=t)}get wheelXRotateRelative(){return this._wheelXAction!==i.RotateRelative?null:this._wheelXActionCoordinate}set wheelYRotateRelative(t){(null!==t||this._wheelYAction===i.RotateRelative)&&(this._wheelYAction=i.RotateRelative,this._wheelYActionCoordinate=t)}get wheelYRotateRelative(){return this._wheelYAction!==i.RotateRelative?null:this._wheelYActionCoordinate}set wheelZRotateRelative(t){(null!==t||this._wheelZAction===i.RotateRelative)&&(this._wheelZAction=i.RotateRelative,this._wheelZActionCoordinate=t)}get wheelZRotateRelative(){return this._wheelZAction!==i.RotateRelative?null:this._wheelZActionCoordinate}set wheelXMoveScene(t){(null!==t||this._wheelXAction===i.MoveScene)&&(this._wheelXAction=i.MoveScene,this._wheelXActionCoordinate=t)}get wheelXMoveScene(){return this._wheelXAction!==i.MoveScene?null:this._wheelXActionCoordinate}set wheelYMoveScene(t){(null!==t||this._wheelYAction===i.MoveScene)&&(this._wheelYAction=i.MoveScene,this._wheelYActionCoordinate=t)}get wheelYMoveScene(){return this._wheelYAction!==i.MoveScene?null:this._wheelYActionCoordinate}set wheelZMoveScene(t){(null!==t||this._wheelZAction===i.MoveScene)&&(this._wheelZAction=i.MoveScene,this._wheelZActionCoordinate=t)}get wheelZMoveScene(){return this._wheelZAction!==i.MoveScene?null:this._wheelZActionCoordinate}checkInputs(){if(0===this._wheelDeltaX&&0===this._wheelDeltaY&&0==this._wheelDeltaZ)return;this._moveRelative.setAll(0),this._rotateRelative.setAll(0),this._moveScene.setAll(0),this._updateCamera(),this.camera.getScene().useRightHandedSystem&&(this._moveRelative.z*=-1);let t=h.Matrix.Zero();this.camera.getViewMatrix().invertToRef(t);let e=h.Vector3.Zero();h.Vector3.TransformNormalToRef(this._moveRelative,t,e),this.camera.cameraRotation.x+=this._rotateRelative.x/200,this.camera.cameraRotation.y+=this._rotateRelative.y/200,this.camera.cameraDirection.addInPlace(e),this.camera.cameraDirection.addInPlace(this._moveScene),super.checkInputs()}_updateCamera(){this._updateCameraProperty(this._wheelDeltaX,this._wheelXAction,this._wheelXActionCoordinate),this._updateCameraProperty(this._wheelDeltaY,this._wheelYAction,this._wheelYActionCoordinate),this._updateCameraProperty(this._wheelDeltaZ,this._wheelZAction,this._wheelZActionCoordinate)}_updateCameraProperty(t,e,o){if(0===t||null===e||null===o)return;let a=null;switch(e){case i.MoveRelative:a=this._moveRelative;break;case i.RotateRelative:a=this._rotateRelative;break;case i.MoveScene:a=this._moveScene}switch(o){case 0:a.set(t,0,0);break;case 1:a.set(0,t,0);break;case 2:a.set(0,0,t)}}}(0,r.__decorate)([(0,n.serialize)()],R.prototype,"wheelXMoveRelative",null),(0,r.__decorate)([(0,n.serialize)()],R.prototype,"wheelYMoveRelative",null),(0,r.__decorate)([(0,n.serialize)()],R.prototype,"wheelZMoveRelative",null),(0,r.__decorate)([(0,n.serialize)()],R.prototype,"wheelXRotateRelative",null),(0,r.__decorate)([(0,n.serialize)()],R.prototype,"wheelYRotateRelative",null),(0,r.__decorate)([(0,n.serialize)()],R.prototype,"wheelZRotateRelative",null),(0,r.__decorate)([(0,n.serialize)()],R.prototype,"wheelXMoveScene",null),(0,r.__decorate)([(0,n.serialize)()],R.prototype,"wheelYMoveScene",null),(0,r.__decorate)([(0,n.serialize)()],R.prototype,"wheelZMoveScene",null),c.CameraInputTypes.FreeCameraMouseWheelInput=R;class g{constructor(t=!1){this.allowMouse=t,this.touchAngularSensibility=2e5,this.touchMoveSensibility=250,this.singleFingerRotate=!1,this._offsetX=null,this._offsetY=null,this._pointerPressed=[],this._isSafari=u.Tools.IsSafari()}attachControl(t){t=u.Tools.BackCompatCameraNoPreventDefault(arguments);let e=null;if(void 0===this._pointerInput&&(this._onLostFocus=()=>{this._offsetX=null,this._offsetY=null},this._pointerInput=i=>{let o=i.event,a="mouse"===o.pointerType||this._isSafari&&void 0===o.pointerType;if(this.allowMouse||!a){if(i.type===m.PointerEventTypes.POINTERDOWN){if(t||o.preventDefault(),this._pointerPressed.push(o.pointerId),1!==this._pointerPressed.length)return;e={x:o.clientX,y:o.clientY}}else if(i.type===m.PointerEventTypes.POINTERUP){t||o.preventDefault();let i=this._pointerPressed.indexOf(o.pointerId);if(-1===i||(this._pointerPressed.splice(i,1),0!=i))return;e=null,this._offsetX=null,this._offsetY=null}else if(i.type===m.PointerEventTypes.POINTERMOVE){if(t||o.preventDefault(),!e||0!=this._pointerPressed.indexOf(o.pointerId))return;this._offsetX=o.clientX-e.x,this._offsetY=-(o.clientY-e.y)}}}),this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,m.PointerEventTypes.POINTERDOWN|m.PointerEventTypes.POINTERUP|m.PointerEventTypes.POINTERMOVE),this._onLostFocus){let t=this.camera.getEngine().getInputElement();t&&t.addEventListener("blur",this._onLostFocus)}}detachControl(){if(this._pointerInput){if(this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null),this._onLostFocus){let t=this.camera.getEngine().getInputElement();t&&t.removeEventListener("blur",this._onLostFocus),this._onLostFocus=null}this._pointerPressed.length=0,this._offsetX=null,this._offsetY=null}}checkInputs(){if(null===this._offsetX||null===this._offsetY||0===this._offsetX&&0===this._offsetY)return;let t=this.camera,e=t.movement.input,i=e.getEntry("touch","rotate"),o=e.getEntry("touch","translate"),a=t._calculateHandednessMultiplier(),s=this.singleFingerRotate&&1===this._pointerPressed.length||!this.singleFingerRotate&&this._pointerPressed.length>1;if(i){let e=i.sensitivity??1/this.touchAngularSensibility;t.cameraRotation.y=this._offsetX*a*e,s&&(t.cameraRotation.x=-(this._offsetY*a)*e)}if(!s&&o){let e=t._computeLocalCameraSpeed(),i=o.sensitivity??(0!==this.touchMoveSensibility?1/this.touchMoveSensibility:0),a=h.TmpVectors.Vector3[0];a.copyFromFloats(0,0,e*this._offsetY*i),h.Matrix.RotationYawPitchRollToRef(t.rotation.y,t.rotation.x,0,t._cameraRotationMatrix),h.Vector3.TransformCoordinatesToRef(a,t._cameraRotationMatrix,a),t.cameraDirection.addInPlace(a)}}getClassName(){return"FreeCameraTouchInput"}getSimpleName(){return"touch"}}(0,r.__decorate)([(0,n.serialize)()],g.prototype,"touchAngularSensibility",void 0),(0,r.__decorate)([(0,n.serialize)()],g.prototype,"touchMoveSensibility",void 0),c.CameraInputTypes.FreeCameraTouchInput=g;var M=t.i(75405);class C extends c.CameraInputsManager{constructor(t){super(t),this._mouseInput=null,this._mouseWheelInput=null}addKeyboard(){return this.add(new p),this}addMouse(t=!0){return this._mouseInput||(this._mouseInput=new y(t),this.add(this._mouseInput)),this}removeMouse(){return this._mouseInput&&this.remove(this._mouseInput),this}addMouseWheel(){return this._mouseWheelInput||(this._mouseWheelInput=new R,this.add(this._mouseWheelInput)),this}removeMouseWheel(){return this._mouseWheelInput&&this.remove(this._mouseWheelInput),this}addTouch(){return this.add(new g),this}clear(){super.clear(),this._mouseInput=null}}(o=C.prototype).addDeviceOrientation??(o.addDeviceOrientation=(0,M._MissingSideEffect)("FreeCameraInputsManager","addDeviceOrientation")),(a=C.prototype).addVirtualJoystick??(a.addVirtualJoystick=(0,M._MissingSideEffect)("FreeCameraInputsManager","addVirtualJoystick")),(s=C.prototype).addGamepad??(s.addGamepad=(0,M._MissingSideEffect)("FreeCameraInputsManager","addGamepad"));var P=t.i(76535);class k extends l.TargetCamera{get angularSensibility(){let t=this.inputs.attached.mouse;return t?t.angularSensibility:0}set angularSensibility(t){let e=this.inputs.attached.mouse;e&&(e.angularSensibility=t)}get keysUp(){let t=this.inputs.attached.keyboard;return t?t.keysUp:[]}set keysUp(t){let e=this.inputs.attached.keyboard;e&&(e.keysUp=t)}get keysUpward(){let t=this.inputs.attached.keyboard;return t?t.keysUpward:[]}set keysUpward(t){let e=this.inputs.attached.keyboard;e&&(e.keysUpward=t)}get keysDown(){let t=this.inputs.attached.keyboard;return t?t.keysDown:[]}set keysDown(t){let e=this.inputs.attached.keyboard;e&&(e.keysDown=t)}get keysDownward(){let t=this.inputs.attached.keyboard;return t?t.keysDownward:[]}set keysDownward(t){let e=this.inputs.attached.keyboard;e&&(e.keysDownward=t)}get keysLeft(){let t=this.inputs.attached.keyboard;return t?t.keysLeft:[]}set keysLeft(t){let e=this.inputs.attached.keyboard;e&&(e.keysLeft=t)}get keysRight(){let t=this.inputs.attached.keyboard;return t?t.keysRight:[]}set keysRight(t){let e=this.inputs.attached.keyboard;e&&(e.keysRight=t)}get keysRotateLeft(){let t=this.inputs.attached.keyboard;return t?t.keysRotateLeft:[]}set keysRotateLeft(t){let e=this.inputs.attached.keyboard;e&&(e.keysRotateLeft=t)}get keysRotateRight(){let t=this.inputs.attached.keyboard;return t?t.keysRotateRight:[]}set keysRotateRight(t){let e=this.inputs.attached.keyboard;e&&(e.keysRotateRight=t)}get keysRotateUp(){let t=this.inputs.attached.keyboard;return t?t.keysRotateUp:[]}set keysRotateUp(t){let e=this.inputs.attached.keyboard;e&&(e.keysRotateUp=t)}get keysRotateDown(){let t=this.inputs.attached.keyboard;return t?t.keysRotateDown:[]}set keysRotateDown(t){let e=this.inputs.attached.keyboard;e&&(e.keysRotateDown=t)}constructor(t,e,i,o=!0){super(t,e,i,o),this.ellipsoid=new h.Vector3(.5,1,.5),this.ellipsoidOffset=new h.Vector3(0,0,0),this.checkCollisions=!1,this.applyGravity=!1,this._needMoveForGravity=!1,this._oldPosition=h.Vector3.Zero(),this._diffPosition=h.Vector3.Zero(),this._newPosition=h.Vector3.Zero(),this._collisionMask=-1,this._onCollisionPositionChange=(t,e,i=null)=>{this._newPosition.copyFrom(e),this._newPosition.subtractToRef(this._oldPosition,this._diffPosition),this._diffPosition.length()>P.AbstractEngine.CollisionsEpsilon&&(this.position.addToRef(this._diffPosition,this._deferredPositionUpdate),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate),this.onCollide&&i&&this.onCollide(i))},this.inputs=new C(this),this.inputs.addKeyboard().addMouse()}attachControl(t,e){e=u.Tools.BackCompatCameraNoPreventDefault(arguments),this.inputs.attachElement(e)}detachControl(){this.inputs.detachElement(),this.cameraDirection=new h.Vector3(0,0,0),this.cameraRotation=new h.Vector2(0,0)}get collisionMask(){return this._collisionMask}set collisionMask(t){this._collisionMask=isNaN(t)?-1:t}_collideWithWorld(t){(this.parent?h.Vector3.TransformCoordinates(this.position,this.parent.getWorldMatrix()):this.position).subtractFromFloatsToRef(0,this.ellipsoid.y,0,this._oldPosition),this._oldPosition.addInPlace(this.ellipsoidOffset);let e=this.getScene().collisionCoordinator;this._collider||(this._collider=e.createCollider()),this._collider._radius=this.ellipsoid,this._collider.collisionMask=this._collisionMask;let i=t;this.applyGravity&&(i=t.add(this.getScene().gravity)),e.getNewPosition(this._oldPosition,i,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}_checkInputs(){this._localDirection||(this._localDirection=h.Vector3.Zero(),this._transformedDirection=h.Vector3.Zero()),this.inputs.checkInputs(),super._checkInputs()}set needMoveForGravity(t){this._needMoveForGravity=t}get needMoveForGravity(){return this._needMoveForGravity}_decideIfNeedsToMove(){return this._needMoveForGravity||Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){this.checkCollisions&&this.getScene().collisionsEnabled?this._collideWithWorld(this.cameraDirection):super._updatePosition()}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"FreeCamera"}}(0,r.__decorate)([(0,n.serializeAsVector3)()],k.prototype,"ellipsoid",void 0),(0,r.__decorate)([(0,n.serializeAsVector3)()],k.prototype,"ellipsoidOffset",void 0),(0,r.__decorate)([(0,n.serialize)()],k.prototype,"checkCollisions",void 0),(0,r.__decorate)([(0,n.serialize)()],k.prototype,"applyGravity",void 0);class w extends k{get touchAngularSensibility(){let t=this.inputs.attached.touch;return t?t.touchAngularSensibility:0}set touchAngularSensibility(t){let e=this.inputs.attached.touch;e&&(e.touchAngularSensibility=t)}get touchMoveSensibility(){let t=this.inputs.attached.touch;return t?t.touchMoveSensibility:0}set touchMoveSensibility(t){let e=this.inputs.attached.touch;e&&(e.touchMoveSensibility=t)}constructor(t,e,i){super(t,e,i),this.inputs.addTouch(),this._setupInputs()}getClassName(){return"TouchCamera"}_setupInputs(){let t=this.inputs.attached.touch,e=this.inputs.attached.mouse;e?e.touchEnabled=!t:t&&(t.allowMouse=!e)}}var T=t.i(34548),I=t.i(59576);class b extends w{get gamepadAngularSensibility(){let t=this.inputs.attached.gamepad;return t?t.gamepadAngularSensibility:0}set gamepadAngularSensibility(t){let e=this.inputs.attached.gamepad;e&&(e.gamepadAngularSensibility=t)}get gamepadMoveSensibility(){let t=this.inputs.attached.gamepad;return t?t.gamepadMoveSensibility:0}set gamepadMoveSensibility(t){let e=this.inputs.attached.gamepad;e&&(e.gamepadMoveSensibility=t)}constructor(t,e,i){super(t,e,i),this.inputs.addGamepad()}getClassName(){return"UniversalCamera"}}let x=!1;function D(){x||(x=!0,T.Node.AddNodeConstructor("FreeCamera",(t,e)=>()=>new b(t,h.Vector3.Zero(),e)),I.Camera._CreateDefaultParsedCamera=(t,e)=>new b(t,h.Vector3.Zero(),e))}t.s(["RegisterUniversalCamera",0,D,"UniversalCamera",0,b],36186),D(),t.s([],61208),t.i(61208),t.i(36186),t.s(["RegisterUniversalCamera",0,D,"UniversalCamera",0,b],30118)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10272,94047,37143,e=>{"use strict";e.s(["__decorate",0,function(e,t,r,i){var f,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var n=e.length-1;n>=0;n--)(f=e[n])&&(s=(a<3?f(s):a>3?f(t,r,s):f(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s}],10272);let t={},r={};function i(e){let t=e.getClassName();return r[t]||(r[t]={}),r[t]}function f(e,t){return(r,f)=>{let a=i(r);a[f]||(a[f]={type:e,sourceName:t})}}function a(e,t,r,i){let f=r.value;r.value=(...r)=>{let a=f;if("u">typeof _native&&_native[t]){let e=_native[t];a=i?(...t)=>i(...t)?e(...t):f(...t):e}return e[t]=a,a(...r)}}e.s(["GetDirectStore",0,i,"GetMergedStore",0,function(e){let i=e.getClassName();if(t[i])return t[i];t[i]={};let f=t[i],a=e,s=i;for(;s;){let e,t=r[s];for(let e in t)f[e]=t[e];let i=!1;do{if(!(e=Object.getPrototypeOf(a)).getClassName){i=!0;break}if(e.getClassName()!==s)break;a=e}while(e)if(i)break;s=e.getClassName(),a=e}return f}],94047),a.filter=function(e){return(t,r,i)=>a(t,r,i,e)},e.s(["expandToProperty",0,function(e,t=null){return function(e,t=null){return(r,i)=>{let f=t||"_"+i;Object.defineProperty(r,i,{get:function(){return this[f]},set:function(t){"function"==typeof this[f]?.equals&&this[f].equals(t)||this[f]!==t&&(this[f]=t,r[e].apply(this))},enumerable:!0,configurable:!0})}}(e,t)},"nativeOverride",0,a,"serialize",0,function(e){return f(0,e)},"serializeAsColor3",0,function(e){return f(2,e)},"serializeAsColor4",0,function(e){return f(8,e)},"serializeAsColorCurves",0,function(e){return f(7,e)},"serializeAsFresnelParameters",0,function(e){return f(3,e)},"serializeAsImageProcessingConfiguration",0,function(e){return f(9,e)},"serializeAsMeshReference",0,function(e){return f(6,e)},"serializeAsQuaternion",0,function(e){return f(10,e)},"serializeAsTexture",0,function(e){return f(1,e)},"serializeAsVector2",0,function(e){return f(4,e)},"serializeAsVector3",0,function(e){return f(5,e)}],37143)},80871,76312,e=>{"use strict";var t=e.i(75405);class r{static Eval(e,t){return"true"===(e=e.match(/\([^()]*\)/g)?e.replace(/\([^()]*\)/g,e=>(e=e.slice(1,e.length-1),r._HandleParenthesisContent(e,t))):r._HandleParenthesisContent(e,t))||"false"!==e&&r.Eval(e,t)}static _HandleParenthesisContent(e,t){let i;t=t||(e=>"true"===e);let f=e.split("||");for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let a=r._SimplifyNegation(f[e].trim()),s=a.split("&&");if(s.length>1)for(let e=0;e<s.length;++e){let f=r._SimplifyNegation(s[e].trim());if(!(i="true"!==f&&"false"!==f?"!"===f[0]?!t(f.substring(1)):t(f):"true"===f)){a="false";break}}if(i||"true"===a){i=!0;break}i="true"!==a&&"false"!==a?"!"===a[0]?!t(a.substring(1)):t(a):"true"===a}return i?"true":"false"}static _SimplifyNegation(e){return"!true"===(e=(e=e.replace(/^[\s!]+/,e=>(e=e.replace(/[\s]/g,()=>"")).length%2?"!":"")).trim())?e="false":"!false"===e&&(e="true"),e}}class i{static EnableFor(e){e._tags=e._tags||{},e.hasTags=()=>i.HasTags(e),e.addTags=t=>i.AddTagsTo(e,t),e.removeTags=t=>i.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>i.MatchesQuery(e,t)}static DisableFor(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery}static HasTags(e){if(!e._tags)return!1;let t=e._tags;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!0;return!1}static GetTags(e,t=!0){if(!e._tags)return null;if(!t)return e._tags;{let t=[];for(let r in e._tags)Object.prototype.hasOwnProperty.call(e._tags,r)&&!0===e._tags[r]&&t.push(r);return t.join(" ")}}static AddTagsTo(e,t){if(t&&"string"==typeof t)for(let r of t.split(" "))i._AddTagTo(e,r)}static _AddTagTo(e,t){""===(t=t.trim())||"true"===t||"false"===t||t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(i.EnableFor(e),e._tags[t]=!0)}static RemoveTagsFrom(e,t){if(!i.HasTags(e))return;let r=t.split(" ");for(let t in r)i._RemoveTagFrom(e,r[t])}static _RemoveTagFrom(e,t){delete e._tags[t]}static MatchesQuery(e,t){return void 0===t||(""===t?i.HasTags(e):r.Eval(t,t=>i.HasTags(e)&&e._tags[t]))}}e.s(["Tags",0,i],76312);var f=e.i(70653),a=e.i(96265),s=e.i(94047);let n=function(e,t,r,f={}){let a=e();i&&i.HasTags(t)&&i.AddTagsTo(a,i.GetTags(t,!0));let n=(0,s.GetMergedStore)(a),o={};for(let e in n){let i=n[e],s=t[e],_=i.type;if(null!=s&&("uniqueId"!==e||u.AllowLoadingUniqueId))switch(_){case 0:case 6:case 9:case 11:"function"==typeof s.slice?a[e]=s.slice():a[e]=s;break;case 1:f.cloneTexturesOnlyOnce&&o[s.uniqueId]?a[e]=o[s.uniqueId]:(a[e]=r||s.isRenderTarget?s:s.clone(),o[s.uniqueId]=a[e]);break;case 2:case 3:case 4:case 5:case 7:case 8:case 10:case 12:a[e]=r?s:s.clone()}}return a};class u{static AppendSerializedAnimations(e,t){if(e.animations){t.animations=[];for(let r=0;r<e.animations.length;r++){let i=e.animations[r];t.animations.push(i.serialize())}}}static Serialize(e,t){t||(t={}),i&&(t.tags=i.GetTags(e));let r=(0,s.GetMergedStore)(e);for(let i in r){let f=r[i],a=f.sourceName||i,s=f.type,n=e[i];if(null!=n&&("uniqueId"!==i||u.AllowLoadingUniqueId))switch(s){case 0:Array.isArray(n)?t[a]=n.slice():t[a]=n;break;case 1:case 3:case 7:case 9:t[a]=n.serialize();break;case 2:case 4:case 5:case 8:case 10:case 12:t[a]=n.asArray();break;case 6:case 11:t[a]=n.id}}return t}static ParseProperties(e,t,r,i){i||(i="");let n=(0,s.GetMergedStore)(t);for(let s in n){let o=n[s],_=e[o.sourceName||s],h=o.type;if(null!=_&&("uniqueId"!==s||u.AllowLoadingUniqueId))switch(h){case 0:t[s]=_;break;case 1:r&&(t[s]=u._TextureParser(_,r,i));break;case 2:t[s]=f.Color3.FromArray(_);break;case 3:t[s]=u._FresnelParametersParser(_);break;case 4:t[s]=a.Vector2.FromArray(_);break;case 5:t[s]=a.Vector3.FromArray(_);break;case 6:r&&(t[s]=r.getLastMeshById(_));break;case 7:t[s]=u._ColorCurvesParser(_);break;case 8:t[s]=f.Color4.FromArray(_);break;case 9:t[s]=u._ImageProcessingConfigurationParser(_);break;case 10:t[s]=a.Quaternion.FromArray(_);break;case 11:r&&(t[s]=r.getCameraById(_));break;case 12:t[s]=a.Matrix.FromArray(_)}}}static Parse(e,t,r,f=null){let a=e();return i&&i.AddTagsTo(a,t.tags),u.ParseProperties(t,a,r,f),a}static Clone(e,t,r={}){return n(e,t,!1,r)}static Instanciate(e,t){return n(e,t,!0)}}u.AllowLoadingUniqueId=!1,u._ImageProcessingConfigurationParser=e=>{throw(0,t._WarnImport)("ImageProcessingConfiguration")},u._FresnelParametersParser=e=>{throw(0,t._WarnImport)("FresnelParameters")},u._ColorCurvesParser=e=>{throw(0,t._WarnImport)("ColorCurves")},u._TextureParser=(e,r,i)=>{throw(0,t._WarnImport)("Texture")},e.s(["SerializationHelper",0,u],80871)},33855,21823,e=>{"use strict";var t=e.i(13379),r=e.i(65740);class i{constructor(e,t,r=!1,i,f=!1,a){this._uniformNames=[],this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers||f,this._dynamic=r,this._name=i??"no-name",this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._trackUBOsInFrame=!1,(void 0===a&&this._engine._features.trackUbosInFrame||!0===a)&&(this._buffers=[],this._bufferIndex=-1,this._bufferUpdatedLastFrame=!1,this._createBufferOnWrite=!1,this._currentFrameId=0,this._trackUBOsInFrame=!0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateFloatArray=this._updateFloatArrayForEffect,this.updateArray=this._updateArrayForEffect,this.updateIntArray=this._updateIntArrayForEffect,this.updateUIntArray=this._updateUIntArrayForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateMatrices=this._updateMatricesForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect,this.updateDirectColor4=this._updateDirectColor4ForEffect,this.updateInt=this._updateIntForEffect,this.updateInt2=this._updateInt2ForEffect,this.updateInt3=this._updateInt3ForEffect,this.updateInt4=this._updateInt4ForEffect,this.updateUInt=this._updateUIntForEffect,this.updateUInt2=this._updateUInt2ForEffect,this.updateUInt3=this._updateUInt3ForEffect,this.updateUInt4=this._updateUInt4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateFloatArray=this._updateFloatArrayForUniform,this.updateArray=this._updateArrayForUniform,this.updateIntArray=this._updateIntArrayForUniform,this.updateUIntArray=this._updateUIntArrayForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateMatrices=this._updateMatricesForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform,this.updateDirectColor4=this._updateDirectColor4ForUniform,this.updateInt=this._updateIntForUniform,this.updateInt2=this._updateInt2ForUniform,this.updateInt3=this._updateInt3ForUniform,this.updateInt4=this._updateInt4ForUniform,this.updateUInt=this._updateUIntForUniform,this.updateUInt2=this._updateUInt2ForUniform,this.updateUInt3=this._updateUInt3ForUniform,this.updateUInt4=this._updateUInt4ForUniform)}get useUbo(){return!this._noUBO}get isSync(){return!this._needSync}isDynamic(){return this._dynamic}getData(){return this._bufferData}getBuffer(){return this._buffer}getUniformNames(){return this._uniformNames}_fillAlignment(e){let t;if(t=e<=2?e:4,this._uniformLocationPointer%t!=0){let e=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;let r=this._uniformLocationPointer-e;for(let e=0;e<r;e++)this._data.push(0)}}addUniform(e,t,r=0){let i;if((r>0&&"number"==typeof t&&(this._uniformArraySizes[e]={strideSize:t,arraySize:r}),void 0===this._uniformLocations[e])&&(this._uniformNames.push(e),!this._noUBO)){if(r>0){if(t instanceof Array)throw"addUniform should not be use with Array in UBO: "+e;if(this._fillAlignment(4),16==t)t*=r;else{let e=4-t;t=t*r+e*r}i=[];for(let e=0;e<t;e++)i.push(0)}else{if(t instanceof Array)t=(i=t).length;else{i=[];for(let e=0;e<t;e++)i.push(0)}this._fillAlignment(t)}this._uniformSizes[e]=t,this._uniformLocations[e]=this._uniformLocationPointer,this._uniformLocationPointer+=t;for(let e=0;e<t;e++)this._data.push(i[e]);this._needSync=!0}}addMatrix(e,t){this.addUniform(e,Array.prototype.slice.call(t.asArray()))}addFloat2(e,t,r){this.addUniform(e,[t,r])}addFloat3(e,t,r,i){this.addUniform(e,[t,r,i])}addColor3(e,t){let r=[t.r,t.g,t.b];this.addUniform(e,r)}addColor4(e,t,r){let i=[t.r,t.g,t.b,r];this.addUniform(e,i)}addVector3(e,t){let r=[t.x,t.y,t.z];this.addUniform(e,r)}addMatrix3x3(e){this.addUniform(e,12)}addMatrix2x2(e){this.addUniform(e,8)}create(){this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)}_getNamesDebug(){let e=[],t=0;for(let r in this._uniformLocations)if(e.push(r),10==++t)break;return e.join(",")}_rebuild(){!this._noUBO&&this._bufferData&&(this._dynamic?this._buffer=this._engine.createDynamicUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()):this._buffer=this._engine.createUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()),this._trackUBOsInFrame&&(this._buffers.push([this._buffer,this._engine._features.checkUbosContentBeforeUpload?this._bufferData.slice():void 0]),this._bufferIndex=this._buffers.length-1,this._createBufferOnWrite=!1))}_rebuildAfterContextLost(){this._trackUBOsInFrame&&(this._buffers=[],this._currentFrameId=0),this._rebuild()}get _numBuffers(){return this._buffers.length}get _indexBuffer(){return this._bufferIndex}get name(){return this._name}set name(e){this._name=e}get currentEffect(){return this._currentEffect}_buffersEqual(e,t){for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}_copyBuffer(e,t){for(let r=0;r<e.length;++r)t[r]=e[r]}update(){if(!this._noUBO){if(this.bindUniformBuffer(),!this._buffer)return void this.create();if(!this._dynamic&&!this._needSync){this._createBufferOnWrite=this._trackUBOsInFrame;return}if(this._buffers&&this._buffers.length>1&&this._buffers[this._bufferIndex][1])if(this._buffersEqual(this._bufferData,this._buffers[this._bufferIndex][1])){this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame;return}else this._copyBuffer(this._bufferData,this._buffers[this._bufferIndex][1]);this._bufferUpdatedLastFrame=!0,this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame}}_createNewBuffer(){this._bufferIndex+1<this._buffers.length?(this._bufferIndex++,this._buffer=this._buffers[this._bufferIndex][0],this._createBufferOnWrite=!1,this._needSync=!0):this._rebuild()}_checkNewFrame(){this._trackUBOsInFrame&&this._currentFrameId!==this._engine.frameId&&(this._currentFrameId=this._engine.frameId,this._createBufferOnWrite=!1,this._buffers&&this._buffers.length>0?(1===this._buffers.length?this._needSync=!this._bufferUpdatedLastFrame:this._needSync=0!==this._bufferIndex,this._bufferIndex=0,this._buffer=this._buffers[this._bufferIndex][0]):this._bufferIndex=-1)}updateUniform(e,r,i){this._checkNewFrame();let f=this._uniformLocations[e];if(void 0===f){if(this._buffer)return void t.Logger.Error("Cannot add an uniform after UBO has been created. uniformName="+e);this.addUniform(e,i),f=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(let e=0;e<i;e++)this._bufferData[f+e]=r[e];else{let e=!1;for(let t=0;t<i;t++)(16!==i||this._engine._features.uniformBufferHardCheckMatrix)&&this._bufferData[f+t]===Math.fround(r[t])||(e=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[f+t]=r[t]);this._needSync=this._needSync||e}}updateUniformArray(e,i,f){this._checkNewFrame();let a=this._uniformLocations[e];if(void 0===a)return void t.Logger.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");this._buffer||this.create();let s=this._uniformArraySizes[e];if(this._dynamic)for(let e=0;e<f;e++)this._bufferData[a+e]=i[e];else{let e=!1,t=0,n=0;for(let u=0;u<f;u++)if(this._bufferData[a+4*n+t]!==r.Tools.FloatRound(i[u])&&(e=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[a+4*n+t]=i[u]),++t===s.strideSize){for(;t<4;t++)this._bufferData[a+4*n+t]=0;t=0,n++}this._needSync=this._needSync||e}}_cacheMatrix(e,t){this._checkNewFrame();let r=this._valueCache[e],i=t.updateFlag;return(void 0===r||r!==i)&&(this._valueCache[e]=i,!0)}_updateMatrix3x3ForUniform(e,t){for(let e=0;e<3;e++)i._TempBuffer[4*e]=t[3*e],i._TempBuffer[4*e+1]=t[3*e+1],i._TempBuffer[4*e+2]=t[3*e+2],i._TempBuffer[4*e+3]=0;this.updateUniform(e,i._TempBuffer,12)}_updateMatrix3x3ForEffect(e,t){this._currentEffect.setMatrix3x3(e,t)}_updateMatrix2x2ForEffect(e,t){this._currentEffect.setMatrix2x2(e,t)}_updateMatrix2x2ForUniform(e,t){for(let e=0;e<2;e++)i._TempBuffer[4*e]=t[2*e],i._TempBuffer[4*e+1]=t[2*e+1],i._TempBuffer[4*e+2]=0,i._TempBuffer[4*e+3]=0;this.updateUniform(e,i._TempBuffer,8)}_updateFloatForEffect(e,t,r=""){this._currentEffect.setFloat(e+r,t)}_updateFloatForUniform(e,t){i._TempBuffer[0]=t,this.updateUniform(e,i._TempBuffer,1)}_updateFloat2ForEffect(e,t,r,i=""){this._currentEffect.setFloat2(e+i,t,r)}_updateFloat2ForUniform(e,t,r){i._TempBuffer[0]=t,i._TempBuffer[1]=r,this.updateUniform(e,i._TempBuffer,2)}_updateFloat3ForEffect(e,t,r,i,f=""){this._currentEffect.setFloat3(e+f,t,r,i)}_updateFloat3ForUniform(e,t,r,f){i._TempBuffer[0]=t,i._TempBuffer[1]=r,i._TempBuffer[2]=f,this.updateUniform(e,i._TempBuffer,3)}_updateFloat4ForEffect(e,t,r,i,f,a=""){this._currentEffect.setFloat4(e+a,t,r,i,f)}_updateFloat4ForUniform(e,t,r,f,a){i._TempBuffer[0]=t,i._TempBuffer[1]=r,i._TempBuffer[2]=f,i._TempBuffer[3]=a,this.updateUniform(e,i._TempBuffer,4)}_updateFloatArrayForEffect(e,t,r=""){switch(this._uniformArraySizes[e]?.strideSize){case 2:this._currentEffect.setFloatArray2(e+r,t);break;case 3:this._currentEffect.setFloatArray3(e+r,t);break;case 4:this._currentEffect.setFloatArray4(e+r,t);break;default:this._currentEffect.setFloatArray(e+r,t)}}_updateFloatArrayForUniform(e,t){this.updateUniformArray(e,t,t.length)}_updateArrayForEffect(e,t){this._currentEffect.setArray(e,t)}_updateArrayForUniform(e,t){this.updateUniformArray(e,t,t.length)}_updateIntArrayForEffect(e,t){this._currentEffect.setIntArray(e,t)}_updateIntArrayForUniform(e,t){i._TempBufferInt32View.set(t),this.updateUniformArray(e,i._TempBuffer,t.length)}_updateUIntArrayForEffect(e,t){this._currentEffect.setUIntArray(e,t)}_updateUIntArrayForUniform(e,t){i._TempBufferUInt32View.set(t),this.updateUniformArray(e,i._TempBuffer,t.length)}_updateMatrixForEffect(e,t){this._currentEffect.setMatrix(e,t)}_updateMatrixForUniform(e,t){this._cacheMatrix(e,t)&&this.updateUniform(e,t.asArray(),16)}_updateMatricesForEffect(e,t){this._currentEffect.setMatrices(e,t)}_updateMatricesForUniform(e,t){this.updateUniform(e,t,t.length)}_updateVector3ForEffect(e,t){this._currentEffect.setVector3(e,t)}_updateVector3ForUniform(e,t){i._TempBuffer[0]=t.x,i._TempBuffer[1]=t.y,i._TempBuffer[2]=t.z,this.updateUniform(e,i._TempBuffer,3)}_updateVector4ForEffect(e,t){this._currentEffect.setVector4(e,t)}_updateVector4ForUniform(e,t){i._TempBuffer[0]=t.x,i._TempBuffer[1]=t.y,i._TempBuffer[2]=t.z,i._TempBuffer[3]=t.w,this.updateUniform(e,i._TempBuffer,4)}_updateColor3ForEffect(e,t,r=""){this._currentEffect.setColor3(e+r,t)}_updateColor3ForUniform(e,t){i._TempBuffer[0]=t.r,i._TempBuffer[1]=t.g,i._TempBuffer[2]=t.b,this.updateUniform(e,i._TempBuffer,3)}_updateColor4ForEffect(e,t,r,i=""){this._currentEffect.setColor4(e+i,t,r)}_updateDirectColor4ForEffect(e,t,r=""){this._currentEffect.setDirectColor4(e+r,t)}_updateColor4ForUniform(e,t,r){i._TempBuffer[0]=t.r,i._TempBuffer[1]=t.g,i._TempBuffer[2]=t.b,i._TempBuffer[3]=r,this.updateUniform(e,i._TempBuffer,4)}_updateDirectColor4ForUniform(e,t){i._TempBuffer[0]=t.r,i._TempBuffer[1]=t.g,i._TempBuffer[2]=t.b,i._TempBuffer[3]=t.a,this.updateUniform(e,i._TempBuffer,4)}_updateIntForEffect(e,t,r=""){this._currentEffect.setInt(e+r,t)}_updateIntForUniform(e,t){i._TempBufferInt32View[0]=t,this.updateUniform(e,i._TempBuffer,1)}_updateInt2ForEffect(e,t,r,i=""){this._currentEffect.setInt2(e+i,t,r)}_updateInt2ForUniform(e,t,r){i._TempBufferInt32View[0]=t,i._TempBufferInt32View[1]=r,this.updateUniform(e,i._TempBuffer,2)}_updateInt3ForEffect(e,t,r,i,f=""){this._currentEffect.setInt3(e+f,t,r,i)}_updateInt3ForUniform(e,t,r,f){i._TempBufferInt32View[0]=t,i._TempBufferInt32View[1]=r,i._TempBufferInt32View[2]=f,this.updateUniform(e,i._TempBuffer,3)}_updateInt4ForEffect(e,t,r,i,f,a=""){this._currentEffect.setInt4(e+a,t,r,i,f)}_updateInt4ForUniform(e,t,r,f,a){i._TempBufferInt32View[0]=t,i._TempBufferInt32View[1]=r,i._TempBufferInt32View[2]=f,i._TempBufferInt32View[3]=a,this.updateUniform(e,i._TempBuffer,4)}_updateUIntForEffect(e,t,r=""){this._currentEffect.setUInt(e+r,t)}_updateUIntForUniform(e,t){i._TempBufferUInt32View[0]=t,this.updateUniform(e,i._TempBuffer,1)}_updateUInt2ForEffect(e,t,r,i=""){this._currentEffect.setUInt2(e+i,t,r)}_updateUInt2ForUniform(e,t,r){i._TempBufferUInt32View[0]=t,i._TempBufferUInt32View[1]=r,this.updateUniform(e,i._TempBuffer,2)}_updateUInt3ForEffect(e,t,r,i,f=""){this._currentEffect.setUInt3(e+f,t,r,i)}_updateUInt3ForUniform(e,t,r,f){i._TempBufferUInt32View[0]=t,i._TempBufferUInt32View[1]=r,i._TempBufferUInt32View[2]=f,this.updateUniform(e,i._TempBuffer,3)}_updateUInt4ForEffect(e,t,r,i,f,a=""){this._currentEffect.setUInt4(e+a,t,r,i,f)}_updateUInt4ForUniform(e,t,r,f,a){i._TempBufferUInt32View[0]=t,i._TempBufferUInt32View[1]=r,i._TempBufferUInt32View[2]=f,i._TempBufferUInt32View[3]=a,this.updateUniform(e,i._TempBuffer,4)}setTexture(e,t){this._currentEffect.setTexture(e,t)}setTextureArray(e,t){this._currentEffect.setTextureArray(e,t)}bindTexture(e,t){this._currentEffect._bindTexture(e,t)}updateUniformDirectly(e,t){this.updateUniform(e,t,t.length),this.update()}bindToEffect(e,t){this._currentEffect=e,this._currentEffectName=t}bindUniformBuffer(){!this._noUBO&&this._buffer&&this._currentEffect&&this._currentEffect.bindUniformBuffer(this._buffer,this._currentEffectName)}unbindEffect(){this._currentEffect=void 0,this._currentEffectName=void 0}setDataBuffer(e){if(!this._buffers)return this._buffer===e;for(let t=0;t<this._buffers.length;++t)if(this._buffers[t][0]===e)return this._bufferIndex=t,this._buffer=e,this._createBufferOnWrite=!1,this._currentEffect=void 0,this._buffers.length>1&&this._buffers[t][1]&&this._bufferData.set(this._buffers[t][1]),this._valueCache={},this._currentFrameId=this._engine.frameId,!0;return!1}has(e){return void 0!==this._uniformLocations[e]}dispose(){if(this._noUBO)return;let e=this._engine._uniformBuffers,t=e.indexOf(this);if(-1!==t&&(e[t]=e[e.length-1],e.pop()),this._trackUBOsInFrame&&this._buffers)for(let e=0;e<this._buffers.length;++e){let t=this._buffers[e][0];this._engine._releaseBuffer(t)}else this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}}i._MAX_UNIFORM_SIZE=256,i._TempBuffer=new Float32Array(i._MAX_UNIFORM_SIZE),i._TempBufferInt32View=new Int32Array(i._TempBuffer.buffer),i._TempBufferUInt32View=new Uint32Array(i._TempBuffer.buffer),e.s(["UniformBuffer",0,i],33855);class f{static CompareLightsPriority(e,t){return e.shadowEnabled!==t.shadowEnabled?!!t.shadowEnabled-!!e.shadowEnabled:t.renderPriority-e.renderPriority}}f.FALLOFF_DEFAULT=0,f.FALLOFF_PHYSICAL=1,f.FALLOFF_GLTF=2,f.FALLOFF_STANDARD=3,f.LIGHTMAP_DEFAULT=0,f.LIGHTMAP_SPECULAR=1,f.LIGHTMAP_SHADOWSONLY=2,f.INTENSITYMODE_AUTOMATIC=0,f.INTENSITYMODE_LUMINOUSPOWER=1,f.INTENSITYMODE_LUMINOUSINTENSITY=2,f.INTENSITYMODE_ILLUMINANCE=3,f.INTENSITYMODE_LUMINANCE=4,f.LIGHTTYPEID_POINTLIGHT=0,f.LIGHTTYPEID_DIRECTIONALLIGHT=1,f.LIGHTTYPEID_SPOTLIGHT=2,f.LIGHTTYPEID_HEMISPHERICLIGHT=3,f.LIGHTTYPEID_RECT_AREALIGHT=4,f.LIGHTTYPEID_CLUSTERED_CONTAINER=5,e.s(["LightConstants",0,f],21823)}]);
@@ -1,4 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96265,89030,48657,88438,t=>{"use strict";let e=(1+Math.sqrt(5))/2;function r(t,e){let r=[];for(let i=0;i<t;++i)r.push(e());return r}function i(t,e){return r(t,e)}t.s(["Epsilon",0,.001,"PHI",0,e,"ToGammaSpace",0,1/2.2,"ToLinearSpace",0,2.2],89030);let s=["push","splice","pop","shift","unshift"];t.s(["BuildArray",0,r,"BuildTuple",0,i,"_ObserveArray",0,function(t,e){let r=s.map(r=>(function(t,e,r){let i=t[e];if("function"!=typeof i)return null;let s=function(){let i=t.length,o=s.previous.apply(t,arguments);return r(e,i),o};return i.next=s,s.previous=i,t[e]=s,()=>{let r=s.previous;if(!r)return;let i=s.next;i?(r.next=i,i.previous=r):(r.next=void 0,t[e]=r),s.next=void 0,s.previous=void 0}})(t,r,e));return()=>{for(let t of r)t?.()}}],48657);var o=t.i(86985),a=t.i(81623),n=t.i(46703);class h{}function _(t){t.updateFlag=h._UpdateFlagSeed++}function l(t,e,r,i=0){let s=t.asArray(),o=e.asArray(),a=s[0],n=s[1],h=s[2],_=s[3],y=s[4],u=s[5],m=s[6],c=s[7],x=s[8],f=s[9],R=s[10],d=s[11],z=s[12],T=s[13],w=s[14],p=s[15],F=o[0],M=o[1],g=o[2],I=o[3],A=o[4],P=o[5],D=o[6],C=o[7],V=o[8],v=o[9],L=o[10],k=o[11],O=o[12],H=o[13],U=o[14],b=o[15];r[i]=a*F+n*A+h*V+_*O,r[i+1]=a*M+n*P+h*v+_*H,r[i+2]=a*g+n*D+h*L+_*U,r[i+3]=a*I+n*C+h*k+_*b,r[i+4]=y*F+u*A+m*V+c*O,r[i+5]=y*M+u*P+m*v+c*H,r[i+6]=y*g+u*D+m*L+c*U,r[i+7]=y*I+u*C+m*k+c*b,r[i+8]=x*F+f*A+R*V+d*O,r[i+9]=x*M+f*P+R*v+d*H,r[i+10]=x*g+f*D+R*L+d*U,r[i+11]=x*I+f*C+R*k+d*b,r[i+12]=z*F+T*A+w*V+p*O,r[i+13]=z*M+T*P+w*v+p*H,r[i+14]=z*g+T*D+w*L+p*U,r[i+15]=z*I+T*C+w*k+p*b}function y(t,e,r=0){let i=t.asArray();e[r]=i[0],e[r+1]=i[1],e[r+2]=i[2],e[r+3]=i[3],e[r+4]=i[4],e[r+5]=i[5],e[r+6]=i[6],e[r+7]=i[7],e[r+8]=i[8],e[r+9]=i[9],e[r+10]=i[10],e[r+11]=i[11],e[r+12]=i[12],e[r+13]=i[13],e[r+14]=i[14],e[r+15]=i[15]}function u(t,e){let r=t.asArray(),i=r[0],s=r[1],o=r[2],a=r[3],n=r[4],h=r[5],_=r[6],l=r[7],y=r[8],u=r[9],m=r[10],c=r[11],x=r[12],f=r[13],R=r[14],d=r[15],z=m*d-R*c,T=u*d-f*c,w=u*R-f*m,p=y*d-x*c,F=y*R-m*x,M=y*f-x*u,g=+(h*z-_*T+l*w),I=-(n*z-_*p+l*F),A=+(n*T-h*p+l*M),P=-(n*w-h*F+_*M),D=i*g+s*I+o*A+a*P;if(0===D)return!1;let C=1/D,V=_*d-R*l,v=h*d-f*l,L=h*R-f*_,k=n*d-x*l,O=n*R-x*_,H=n*f-x*h,U=_*c-m*l,b=h*c-u*l,S=h*m-u*_,q=n*c-y*l,E=n*m-y*_,N=n*u-y*h;return e[0]=g*C,e[1]=-(s*z-o*T+a*w)*C,e[2]=(s*V-o*v+a*L)*C,e[3]=-(s*U-o*b+a*S)*C,e[4]=I*C,e[5]=(i*z-o*p+a*F)*C,e[6]=-(i*V-o*k+a*O)*C,e[7]=(i*U-o*q+a*E)*C,e[8]=A*C,e[9]=-(i*T-s*p+a*M)*C,e[10]=(i*v-s*k+a*H)*C,e[11]=-(i*b-s*q+a*N)*C,e[12]=P*C,e[13]=(i*w-s*F+o*M)*C,e[14]=-(i*L-s*O+o*H)*C,e[15]=(i*S-s*E+o*N)*C,!0}h._UpdateFlagSeed=0,t.s(["CopyMatrixToArray",0,y,"InvertMatrixToArray",0,u,"InvertMatrixToRef",0,function(t,e){let r=u(t,e.asArray());return r&&_(e),r},"MatrixManagement",0,h,"MultiplyMatricesToArray",0,l,"MultiplyMatricesToRef",0,function(t,e,r,i=0){l(t,e,r.asArray(),i),_(r)}],88438);var m=t.i(77052);let c=t=>parseInt(t.toString().replace(/\W/g,""));class x{constructor(t=0,e=0){this.x=t,this.y=e}toString(){return`{X: ${this.x} Y: ${this.y}}`}getClassName(){return"Vector2"}getHashCode(){let t=c(this.x),e=c(this.y),r=t;return 397*r^e}toArray(t,e=0){return t[e]=this.x,t[e+1]=this.y,this}fromArray(t,e=0){return x.FromArrayToRef(t,e,this),this}asArray(){return[this.x,this.y]}copyFrom(t){return this.x=t.x,this.y=t.y,this}copyFromFloats(t,e){return this.x=t,this.y=e,this}set(t,e){return this.copyFromFloats(t,e)}setAll(t){return this.copyFromFloats(t,t)}add(t){return new x(this.x+t.x,this.y+t.y)}addToRef(t,e){return e.x=this.x+t.x,e.y=this.y+t.y,e}addInPlace(t){return this.x+=t.x,this.y+=t.y,this}addInPlaceFromFloats(t,e){return this.x+=t,this.y+=e,this}addVector3(t){return new x(this.x+t.x,this.y+t.y)}subtract(t){return new x(this.x-t.x,this.y-t.y)}subtractToRef(t,e){return e.x=this.x-t.x,e.y=this.y-t.y,e}subtractInPlace(t){return this.x-=t.x,this.y-=t.y,this}multiplyInPlace(t){return this.x*=t.x,this.y*=t.y,this}multiply(t){return new x(this.x*t.x,this.y*t.y)}multiplyToRef(t,e){return e.x=this.x*t.x,e.y=this.y*t.y,e}multiplyByFloats(t,e){return new x(this.x*t,this.y*e)}divide(t){return new x(this.x/t.x,this.y/t.y)}divideToRef(t,e){return e.x=this.x/t.x,e.y=this.y/t.y,e}divideInPlace(t){return this.x=this.x/t.x,this.y=this.y/t.y,this}minimizeInPlace(t){return this.minimizeInPlaceFromFloats(t.x,t.y)}maximizeInPlace(t){return this.maximizeInPlaceFromFloats(t.x,t.y)}minimizeInPlaceFromFloats(t,e){return this.x=Math.min(t,this.x),this.y=Math.min(e,this.y),this}maximizeInPlaceFromFloats(t,e){return this.x=Math.max(t,this.x),this.y=Math.max(e,this.y),this}subtractFromFloats(t,e){return new x(this.x-t,this.y-e)}subtractFromFloatsToRef(t,e,r){return r.x=this.x-t,r.y=this.y-e,r}negate(){return new x(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(t){return t.x=-this.x,t.y=-this.y,t}scaleInPlace(t){return this.x*=t,this.y*=t,this}scale(t){return new x(this.x*t,this.y*t)}scaleToRef(t,e){return e.x=this.x*t,e.y=this.y*t,e}scaleAndAddToRef(t,e){return e.x+=this.x*t,e.y+=this.y*t,e}equals(t){return t&&this.x===t.x&&this.y===t.y}equalsWithEpsilon(t,e=.001){return t&&(0,n.WithinEpsilon)(this.x,t.x,e)&&(0,n.WithinEpsilon)(this.y,t.y,e)}equalsToFloats(t,e){return this.x===t&&this.y===e}floor(){return new x(Math.floor(this.x),Math.floor(this.y))}floorToRef(t){return t.x=Math.floor(this.x),t.y=Math.floor(this.y),t}fract(){return new x(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}fractToRef(t){return t.x=this.x-Math.floor(this.x),t.y=this.y-Math.floor(this.y),t}rotate(t){return this.rotateToRef(t,new x)}rotateToRef(t,e){let r=Math.cos(t),i=Math.sin(t);return e.x=r*this.x-i*this.y,e.y=i*this.x+r*this.y,e}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(t){return 0===t||1===t?this:this.scaleInPlace(1/t)}normalizeToNew(){let t=new x;return this.normalizeToRef(t),t}normalizeToRef(t){let e=this.length();return 0===e&&(t.x=this.x,t.y=this.y),this.scaleToRef(1/e,t)}clone(){return new x(this.x,this.y)}dot(t){return this.x*t.x+this.y*t.y}static Zero(){return new x(0,0)}static One(){return new x(1,1)}static Random(t=0,e=1){return new x((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.copyFromFloats((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static get ZeroReadOnly(){return x._ZeroReadOnly}static FromArray(t,e=0){return new x(t[e],t[e+1])}static FromArrayToRef(t,e,r){return r.x=t[e],r.y=t[e+1],r}static FromFloatsToRef(t,e,r){return r.copyFromFloats(t,e),r}static CatmullRom(t,e,r,i,s){let o=s*s,a=s*o;return new x(.5*(2*e.x+(-t.x+r.x)*s+(2*t.x-5*e.x+4*r.x-i.x)*o+(-t.x+3*e.x-3*r.x+i.x)*a),.5*(2*e.y+(-t.y+r.y)*s+(2*t.y-5*e.y+4*r.y-i.y)*o+(-t.y+3*e.y-3*r.y+i.y)*a))}static ClampToRef(t,e,r,i){return i.x=(0,n.Clamp)(t.x,e.x,r.x),i.y=(0,n.Clamp)(t.y,e.y,r.y),i}static Clamp(t,e,r){return new x((0,n.Clamp)(t.x,e.x,r.x),(0,n.Clamp)(t.y,e.y,r.y))}static Hermite(t,e,r,i,s){let o=s*s,a=s*o,n=2*a-3*o+1,h=-2*a+3*o,_=a-2*o+s,l=a-o;return new x(t.x*n+r.x*h+e.x*_+i.x*l,t.y*n+r.y*h+e.y*_+i.y*l)}static Hermite1stDerivative(t,e,r,i,s){return this.Hermite1stDerivativeToRef(t,e,r,i,s,new x)}static Hermite1stDerivativeToRef(t,e,r,i,s,o){let a=s*s;return o.x=(a-s)*6*t.x+(3*a-4*s+1)*e.x+(-a+s)*6*r.x+(3*a-2*s)*i.x,o.y=(a-s)*6*t.y+(3*a-4*s+1)*e.y+(-a+s)*6*r.y+(3*a-2*s)*i.y,o}static Lerp(t,e,r){return x.LerpToRef(t,e,r,new x)}static LerpToRef(t,e,r,i){return i.x=t.x+(e.x-t.x)*r,i.y=t.y+(e.y-t.y)*r,i}static Dot(t,e){return t.x*e.x+t.y*e.y}static Normalize(t){return x.NormalizeToRef(t,new x)}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Minimize(t,e){return new x(t.x<e.x?t.x:e.x,t.y<e.y?t.y:e.y)}static Maximize(t,e){return new x(t.x>e.x?t.x:e.x,t.y>e.y?t.y:e.y)}static Transform(t,e){return x.TransformToRef(t,e,new x)}static TransformToRef(t,e,r){let i=e.m,s=t.x*i[0]+t.y*i[4]+i[12],o=t.x*i[1]+t.y*i[5]+i[13];return r.x=s,r.y=o,r}static PointInTriangle(t,e,r,i){let s=.5*(-r.y*i.x+e.y*(-r.x+i.x)+e.x*(r.y-i.y)+r.x*i.y),o=s<0?-1:1,a=(e.y*i.x-e.x*i.y+(i.y-e.y)*t.x+(e.x-i.x)*t.y)*o,n=(e.x*r.y-e.y*r.x+(e.y-r.y)*t.x+(r.x-e.x)*t.y)*o;return a>0&&n>0&&a+n<2*s*o}static Distance(t,e){return Math.sqrt(x.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t.x-e.x,i=t.y-e.y;return r*r+i*i}static Center(t,e){return x.CenterToRef(t,e,new x)}static CenterToRef(t,e,r){return r.copyFromFloats((t.x+e.x)/2,(t.y+e.y)/2)}static DistanceOfPointFromSegment(t,e,r){let i=x.DistanceSquared(e,r);if(0===i)return x.Distance(t,e);let s=r.subtract(e),o=Math.max(0,Math.min(1,x.Dot(t.subtract(e),s)/i)),a=e.add(s.multiplyByFloats(o,o));return x.Distance(t,a)}}x._V8PerformanceHack=new x(.5,.5),x._ZeroReadOnly=x.Zero();class f{get x(){return this._x}set x(t){this._x=t,this._isDirty=!0}get y(){return this._y}set y(t){this._y=t,this._isDirty=!0}get z(){return this._z}set z(t){this._z=t,this._isDirty=!0}constructor(t=0,e=0,r=0){this._isDirty=!0,this._x=t,this._y=e,this._z=r}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z}}`}getClassName(){return"Vector3"}getHashCode(){let t=c(this._x),e=c(this._y),r=c(this._z),i=t;return 397*(i=397*i^e)^r}asArray(){return[this._x,this._y,this._z]}toArray(t,e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,this}fromArray(t,e=0){return f.FromArrayToRef(t,e,this),this}toQuaternion(){return d.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this._isDirty=!0,this}addInPlaceFromFloats(t,e,r){return this._x+=t,this._y+=e,this._z+=r,this._isDirty=!0,this}add(t){return new f(this._x+t._x,this._y+t._y,this._z+t._z)}addToRef(t,e){return e._x=this._x+t._x,e._y=this._y+t._y,e._z=this._z+t._z,e._isDirty=!0,e}subtractInPlace(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this._isDirty=!0,this}subtract(t){return new f(this._x-t._x,this._y-t._y,this._z-t._z)}subtractToRef(t,e){return this.subtractFromFloatsToRef(t._x,t._y,t._z,e)}subtractFromFloats(t,e,r){return new f(this._x-t,this._y-e,this._z-r)}subtractFromFloatsToRef(t,e,r,i){return i._x=this._x-t,i._y=this._y-e,i._z=this._z-r,i._isDirty=!0,i}negate(){return new f(-this._x,-this._y,-this._z)}negateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(t){return t._x=-1*this._x,t._y=-1*this._y,t._z=-1*this._z,t._isDirty=!0,t}scaleInPlace(t){return this._x*=t,this._y*=t,this._z*=t,this._isDirty=!0,this}scale(t){return new f(this._x*t,this._y*t,this._z*t)}scaleToRef(t,e){return e._x=this._x*t,e._y=this._y*t,e._z=this._z*t,e._isDirty=!0,e}getNormalToRef(t){let e=this.length(),r=Math.acos(this._y/e),i=Math.atan2(this._z,this._x);r>Math.PI/2?r-=Math.PI/2:r+=Math.PI/2;let s=e*Math.sin(r)*Math.cos(i),o=e*Math.cos(r),a=e*Math.sin(r)*Math.sin(i);return t.set(s,o,a),t}applyRotationQuaternionToRef(t,e){let r=this._x,i=this._y,s=this._z,o=t._x,a=t._y,n=t._z,h=t._w,_=2*(a*s-n*i),l=2*(n*r-o*s),y=2*(o*i-a*r);return e._x=r+h*_+a*y-n*l,e._y=i+h*l+n*_-o*y,e._z=s+h*y+o*l-a*_,e._isDirty=!0,e}applyRotationQuaternionInPlace(t){return this.applyRotationQuaternionToRef(t,this)}applyRotationQuaternion(t){return this.applyRotationQuaternionToRef(t,new f)}scaleAndAddToRef(t,e){return e._x+=this._x*t,e._y+=this._y*t,e._z+=this._z*t,e._isDirty=!0,e}projectOnPlane(t,e){return this.projectOnPlaneToRef(t,e,new f)}projectOnPlaneToRef(t,e,r){let i=t.normal,s=t.d,o=T.Vector3[0];this.subtractToRef(e,o),o.normalize();let a=f.Dot(o,i);if(1e-10>Math.abs(a))r.setAll(1/0);else{let t=-(f.Dot(e,i)+s)/a,n=o.scaleInPlace(t);e.addToRef(n,r)}return r}equals(t){return t&&this._x===t._x&&this._y===t._y&&this._z===t._z}equalsWithEpsilon(t,e=.001){return t&&(0,n.WithinEpsilon)(this._x,t._x,e)&&(0,n.WithinEpsilon)(this._y,t._y,e)&&(0,n.WithinEpsilon)(this._z,t._z,e)}equalsToFloats(t,e,r){return this._x===t&&this._y===e&&this._z===r}multiplyInPlace(t){return this._x*=t._x,this._y*=t._y,this._z*=t._z,this._isDirty=!0,this}multiply(t){return this.multiplyByFloats(t._x,t._y,t._z)}multiplyToRef(t,e){return e._x=this._x*t._x,e._y=this._y*t._y,e._z=this._z*t._z,e._isDirty=!0,e}multiplyByFloats(t,e,r){return new f(this._x*t,this._y*e,this._z*r)}divide(t){return new f(this._x/t._x,this._y/t._y,this._z/t._z)}divideToRef(t,e){return e._x=this._x/t._x,e._y=this._y/t._y,e._z=this._z/t._z,e._isDirty=!0,e}divideInPlace(t){return this._x=this._x/t._x,this._y=this._y/t._y,this._z=this._z/t._z,this._isDirty=!0,this}minimizeInPlace(t){return this.minimizeInPlaceFromFloats(t._x,t._y,t._z)}maximizeInPlace(t){return this.maximizeInPlaceFromFloats(t._x,t._y,t._z)}minimizeInPlaceFromFloats(t,e,r){return t<this._x&&(this.x=t),e<this._y&&(this.y=e),r<this._z&&(this.z=r),this}maximizeInPlaceFromFloats(t,e,r){return t>this._x&&(this.x=t),e>this._y&&(this.y=e),r>this._z&&(this.z=r),this}isNonUniformWithinEpsilon(t){let e=Math.abs(this._x),r=Math.abs(this._y);if(!(0,n.WithinEpsilon)(e,r,t))return!0;let i=Math.abs(this._z);return!((0,n.WithinEpsilon)(e,i,t)&&(0,n.WithinEpsilon)(r,i,t))}get isNonUniform(){let t=Math.abs(this._x);return t!==Math.abs(this._y)||t!==Math.abs(this._z)}floorToRef(t){return t._x=Math.floor(this._x),t._y=Math.floor(this._y),t._z=Math.floor(this._z),t._isDirty=!0,t}floor(){return new f(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))}fractToRef(t){return t._x=this._x-Math.floor(this._x),t._y=this._y-Math.floor(this._y),t._z=this._z-Math.floor(this._z),t._isDirty=!0,t}fract(){return new f(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){return this._x*this._y*this._z==0}normalize(){return this.normalizeFromLength(this.length())}reorderInPlace(t){if("xyz"===(t=t.toLowerCase()))return this;let e=T.Vector3[0].copyFrom(this);return this.x=e[t[0]],this.y=e[t[1]],this.z=e[t[2]],this}rotateByQuaternionToRef(t,e){return t.toRotationMatrix(T.Matrix[0]),f.TransformCoordinatesToRef(this,T.Matrix[0],e),e}rotateByQuaternionAroundPointToRef(t,e,r){return this.subtractToRef(e,T.Vector3[0]),T.Vector3[0].rotateByQuaternionToRef(t,T.Vector3[0]),e.addToRef(T.Vector3[0],r),r}cross(t){return f.CrossToRef(this,t,new f)}normalizeFromLength(t){return 0===t||1===t?this:this.scaleInPlace(1/t)}normalizeToNew(){return this.normalizeToRef(new f)}normalizeToRef(t){let e=this.length();return 0===e||1===e?(t._x=this._x,t._y=this._y,t._z=this._z,t._isDirty=!0,t):this.scaleToRef(1/e,t)}clone(){return new f(this._x,this._y,this._z)}copyFrom(t){return this.copyFromFloats(t._x,t._y,t._z)}copyFromFloats(t,e,r){return this._x=t,this._y=e,this._z=r,this._isDirty=!0,this}set(t,e,r){return this.copyFromFloats(t,e,r)}setAll(t){return this._x=this._y=this._z=t,this._isDirty=!0,this}static GetClipFactor(t,e,r,i){let s=f.Dot(t,r);return(s-i)/(s-f.Dot(e,r))}static GetAngleBetweenVectors(t,e,r){let i=t.normalizeToRef(T.Vector3[1]),s=e.normalizeToRef(T.Vector3[2]),o=f.Dot(i,s),a=Math.acos(o=(0,n.Clamp)(o,-1,1)),h=T.Vector3[3];return(f.CrossToRef(i,s,h),f.Dot(h,r)>0)?isNaN(a)?0:a:isNaN(a)?-Math.PI:-Math.acos(o)}static GetAngleBetweenVectorsOnPlane(t,e,r){T.Vector3[0].copyFrom(t);let i=T.Vector3[0];T.Vector3[1].copyFrom(e);let s=T.Vector3[1];T.Vector3[2].copyFrom(r);let o=T.Vector3[2],a=T.Vector3[3],h=T.Vector3[4];i.normalize(),s.normalize(),o.normalize(),f.CrossToRef(o,i,a),f.CrossToRef(a,o,h);let _=Math.atan2(f.Dot(s,a),f.Dot(s,h));return(0,n.NormalizeRadians)(_)}static PitchYawRollToMoveBetweenPointsToRef(t,e,r){let i=w.Vector3[0];return e.subtractToRef(t,i),r._y=Math.atan2(i.x,i.z)||0,r._x=Math.atan2(Math.sqrt(i.x**2+i.z**2),i.y)||0,r._z=0,r._isDirty=!0,r}static PitchYawRollToMoveBetweenPoints(t,e){let r=f.Zero();return f.PitchYawRollToMoveBetweenPointsToRef(t,e,r)}static SlerpToRef(t,e,r,i){let s,o;r=(0,n.Clamp)(r,0,1);let a=T.Vector3[0],h=T.Vector3[1];a.copyFrom(t);let _=a.length();a.normalizeFromLength(_),h.copyFrom(e);let l=h.length();h.normalizeFromLength(l);let y=f.Dot(a,h);if(y<.999){let t=Math.acos(y),e=1/Math.sin(t);s=Math.sin((1-r)*t)*e,o=Math.sin(r*t)*e}else s=1-r,o=r;return a.scaleInPlace(s),h.scaleInPlace(o),i.copyFrom(a).addInPlace(h),i.scaleInPlace((0,n.Lerp)(_,l,r)),i}static SmoothToRef(t,e,r,i,s){return f.SlerpToRef(t,e,0===i?1:r/i,s),s}static FromArray(t,e=0){return new f(t[e],t[e+1],t[e+2])}static FromFloatArray(t,e){return f.FromArray(t,e)}static FromArrayToRef(t,e,r){return r._x=t[e],r._y=t[e+1],r._z=t[e+2],r._isDirty=!0,r}static FromFloatArrayToRef(t,e,r){return f.FromArrayToRef(t,e,r)}static FromFloatsToRef(t,e,r,i){return i.copyFromFloats(t,e,r),i}static Zero(){return new f(0,0,0)}static One(){return new f(1,1,1)}static Up(){return new f(0,1,0)}static get UpReadOnly(){return f._UpReadOnly}static get DownReadOnly(){return f._DownReadOnly}static get RightReadOnly(){return f._RightReadOnly}static get LeftReadOnly(){return f._LeftReadOnly}static get LeftHandedForwardReadOnly(){return f._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return f._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return f._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return f._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return f._ZeroReadOnly}static get OneReadOnly(){return f._OneReadOnly}static Down(){return new f(0,-1,0)}static Forward(t=!1){return new f(0,0,t?-1:1)}static Backward(t=!1){return new f(0,0,t?1:-1)}static Right(){return new f(1,0,0)}static Left(){return new f(-1,0,0)}static Random(t=0,e=1){return new f((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.copyFromFloats((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static TransformCoordinates(t,e){let r=f.Zero();return f.TransformCoordinatesToRef(t,e,r),r}static TransformCoordinatesToRef(t,e,r){return f.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,e,r),r}static TransformCoordinatesFromFloatsToRef(t,e,r,i,s){let o=i.m,a=t*o[0]+e*o[4]+r*o[8]+o[12],n=t*o[1]+e*o[5]+r*o[9]+o[13],h=t*o[2]+e*o[6]+r*o[10]+o[14],_=1/(t*o[3]+e*o[7]+r*o[11]+o[15]);return s._x=a*_,s._y=n*_,s._z=h*_,s._isDirty=!0,s}static TransformNormal(t,e){let r=f.Zero();return f.TransformNormalToRef(t,e,r),r}static TransformNormalToRef(t,e,r){return this.TransformNormalFromFloatsToRef(t._x,t._y,t._z,e,r),r}static TransformNormalFromFloatsToRef(t,e,r,i,s){let o=i.m;return s._x=t*o[0]+e*o[4]+r*o[8],s._y=t*o[1]+e*o[5]+r*o[9],s._z=t*o[2]+e*o[6]+r*o[10],s._isDirty=!0,s}static CatmullRom(t,e,r,i,s){let o=s*s,a=s*o;return new f(.5*(2*e._x+(-t._x+r._x)*s+(2*t._x-5*e._x+4*r._x-i._x)*o+(-t._x+3*e._x-3*r._x+i._x)*a),.5*(2*e._y+(-t._y+r._y)*s+(2*t._y-5*e._y+4*r._y-i._y)*o+(-t._y+3*e._y-3*r._y+i._y)*a),.5*(2*e._z+(-t._z+r._z)*s+(2*t._z-5*e._z+4*r._z-i._z)*o+(-t._z+3*e._z-3*r._z+i._z)*a))}static Clamp(t,e,r){let i=new f;return f.ClampToRef(t,e,r,i),i}static ClampToRef(t,e,r,i){let s=t._x;s=(s=s>r._x?r._x:s)<e._x?e._x:s;let o=t._y;o=(o=o>r._y?r._y:o)<e._y?e._y:o;let a=t._z;return a=(a=a>r._z?r._z:a)<e._z?e._z:a,i.copyFromFloats(s,o,a),i}static CheckExtends(t,e,r){e.minimizeInPlace(t),r.maximizeInPlace(t)}static Hermite(t,e,r,i,s){let o=s*s,a=s*o,n=2*a-3*o+1,h=-2*a+3*o,_=a-2*o+s,l=a-o;return new f(t._x*n+r._x*h+e._x*_+i._x*l,t._y*n+r._y*h+e._y*_+i._y*l,t._z*n+r._z*h+e._z*_+i._z*l)}static Hermite1stDerivative(t,e,r,i,s){let o=new f;return this.Hermite1stDerivativeToRef(t,e,r,i,s,o),o}static Hermite1stDerivativeToRef(t,e,r,i,s,o){let a=s*s;return o._x=(a-s)*6*t._x+(3*a-4*s+1)*e._x+(-a+s)*6*r._x+(3*a-2*s)*i._x,o._y=(a-s)*6*t._y+(3*a-4*s+1)*e._y+(-a+s)*6*r._y+(3*a-2*s)*i._y,o._z=(a-s)*6*t._z+(3*a-4*s+1)*e._z+(-a+s)*6*r._z+(3*a-2*s)*i._z,o._isDirty=!0,o}static Lerp(t,e,r){let i=new f(0,0,0);return f.LerpToRef(t,e,r,i),i}static LerpToRef(t,e,r,i){return i._x=t._x+(e._x-t._x)*r,i._y=t._y+(e._y-t._y)*r,i._z=t._z+(e._z-t._z)*r,i._isDirty=!0,i}static Dot(t,e){return t._x*e._x+t._y*e._y+t._z*e._z}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z}static Cross(t,e){let r=new f;return f.CrossToRef(t,e,r),r}static CrossToRef(t,e,r){let i=t._y*e._z-t._z*e._y,s=t._z*e._x-t._x*e._z,o=t._x*e._y-t._y*e._x;return r.copyFromFloats(i,s,o),r}static Normalize(t){let e=f.Zero();return f.NormalizeToRef(t,e),e}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Project(t,e,r,i){let s=new f;return f.ProjectToRef(t,e,r,i,s),s}static ProjectToRef(t,e,r,i,s){let o=i.width,n=i.height,h=i.x,_=i.y,l=T.Matrix[1],y=a.EngineStore.LastCreatedEngine?.isNDCHalfZRange;z.FromValuesToRef(o/2,0,0,0,0,-n/2,0,0,0,0,y?1:.5,0,h+o/2,n/2+_,.5*!y,1,l);let u=T.Matrix[0];return e.multiplyToRef(r,u),u.multiplyToRef(l,u),f.TransformCoordinatesToRef(t,u,s),s}static Reflect(t,e){return this.ReflectToRef(t,e,new f)}static ReflectToRef(t,e,r){let i=w.Vector3[0];return i.copyFrom(e).scaleInPlace(2*f.Dot(t,e)),r.copyFrom(t).subtractInPlace(i)}static UnprojectFromTransform(t,e,r,i,s){return this.Unproject(t,e,r,i,s,z.IdentityReadOnly)}static Unproject(t,e,r,i,s,o){let a=new f;return f.UnprojectToRef(t,e,r,i,s,o,a),a}static UnprojectToRef(t,e,r,i,s,o,a){return f.UnprojectFloatsToRef(t._x,t._y,t._z,e,r,i,s,o,a),a}static UnprojectFloatsToRef(t,e,r,i,s,o,n,h,_){let l=T.Matrix[0];o.multiplyToRef(n,l),l.multiplyToRef(h,l),l.invert();let y=T.Vector3[0];return y.x=t/i*2-1,y.y=-(e/s*2-1),a.EngineStore.LastCreatedEngine?.isNDCHalfZRange?y.z=r:y.z=2*r-1,f.TransformCoordinatesToRef(y,l,_),_}static Minimize(t,e){let r=new f;return r.copyFrom(t),r.minimizeInPlace(e),r}static Maximize(t,e){let r=new f;return r.copyFrom(t),r.maximizeInPlace(e),r}static Distance(t,e){return Math.sqrt(f.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t._x-e._x,i=t._y-e._y,s=t._z-e._z;return r*r+i*i+s*s}static ProjectOnTriangleToRef(t,e,r,i,s){let o,a,h=T.Vector3[0],_=T.Vector3[1],l=T.Vector3[2],y=T.Vector3[3],u=T.Vector3[4];r.subtractToRef(e,h),i.subtractToRef(e,_),i.subtractToRef(r,l);let m=h.length(),c=_.length(),x=l.length();if(m<.001||c<.001||x<.001)return s.copyFrom(e),f.Distance(t,e);t.subtractToRef(e,u),f.CrossToRef(h,_,y);let R=y.length();if(R<.001)return s.copyFrom(e),f.Distance(t,e);y.normalizeFromLength(R);let d=u.length();if(d<.001)return s.copyFrom(e),0;u.normalizeFromLength(d);let z=f.Dot(y,u),w=T.Vector3[5],p=T.Vector3[6];w.copyFrom(y).scaleInPlace(-d*z),p.copyFrom(t).addInPlace(w);let F=T.Vector3[4],M=T.Vector3[5],g=T.Vector3[7],I=T.Vector3[8];F.copyFrom(h).scaleInPlace(1/m),I.copyFrom(_).scaleInPlace(1/c),F.addInPlace(I).scaleInPlace(-1),M.copyFrom(h).scaleInPlace(-1/m),I.copyFrom(l).scaleInPlace(1/x),M.addInPlace(I).scaleInPlace(-1),g.copyFrom(l).scaleInPlace(-1/x),I.copyFrom(_).scaleInPlace(-1/c),g.addInPlace(I).scaleInPlace(-1);let A=T.Vector3[9];A.copyFrom(p).subtractInPlace(e),f.CrossToRef(F,A,I);let P=f.Dot(I,y);A.copyFrom(p).subtractInPlace(r),f.CrossToRef(M,A,I);let D=f.Dot(I,y);A.copyFrom(p).subtractInPlace(i),f.CrossToRef(g,A,I);let C=f.Dot(I,y),V=T.Vector3[10];P>0&&D<0?(V.copyFrom(h),o=e,a=r):D>0&&C<0?(V.copyFrom(l),o=r,a=i):(V.copyFrom(_).scaleInPlace(-1),o=i,a=e);let v=T.Vector3[9],L=T.Vector3[4];if(o.subtractToRef(p,I),a.subtractToRef(p,v),f.CrossToRef(I,v,L),!(0>f.Dot(L,y)))return s.copyFrom(p),Math.abs(d*z);let k=T.Vector3[5];f.CrossToRef(V,L,k),k.normalize();let O=T.Vector3[9];O.copyFrom(o).subtractInPlace(p);let H=O.length();if(H<.001)return s.copyFrom(o),f.Distance(t,o);O.normalizeFromLength(H);let U=f.Dot(k,O),b=T.Vector3[7];b.copyFrom(p).addInPlace(k.scaleInPlace(H*U)),I.copyFrom(b).subtractInPlace(o),d=V.length(),V.normalizeFromLength(d);let S=f.Dot(I,V)/Math.max(d,.001);return S=(0,n.Clamp)(S,0,1),b.copyFrom(o).addInPlace(V.scaleInPlace(S*d)),s.copyFrom(b),f.Distance(t,b)}static Center(t,e){return f.CenterToRef(t,e,f.Zero())}static CenterToRef(t,e,r){return r.copyFromFloats((t._x+e._x)/2,(t._y+e._y)/2,(t._z+e._z)/2)}static RotationFromAxis(t,e,r){let i=new f;return f.RotationFromAxisToRef(t,e,r,i),i}static RotationFromAxisToRef(t,e,r,i){let s=T.Quaternion[0];return d.RotationQuaternionFromAxisToRef(t,e,r,s),s.toEulerAnglesToRef(i),i}}f._V8PerformanceHack=new f(.5,.5,.5),f._UpReadOnly=f.Up(),f._DownReadOnly=f.Down(),f._LeftHandedForwardReadOnly=f.Forward(!1),f._RightHandedForwardReadOnly=f.Forward(!0),f._LeftHandedBackwardReadOnly=f.Backward(!1),f._RightHandedBackwardReadOnly=f.Backward(!0),f._RightReadOnly=f.Right(),f._LeftReadOnly=f.Left(),f._ZeroReadOnly=f.Zero(),f._OneReadOnly=f.One();class R{get x(){return this._x}set x(t){this._x=t,this._isDirty=!0}get y(){return this._y}set y(t){this._y=t,this._isDirty=!0}get z(){return this._z}set z(t){this._z=t,this._isDirty=!0}get w(){return this._w}set w(t){this._w=t,this._isDirty=!0}constructor(t=0,e=0,r=0,i=0){this._isDirty=!0,this._x=t,this._y=e,this._z=r,this._w=i}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Vector4"}getHashCode(){let t=c(this._x),e=c(this._y),r=c(this._z),i=c(this._w),s=t;return 397*(s=397*(s=397*s^e)^r)^i}asArray(){return[this._x,this._y,this._z,this._w]}toArray(t,e){return void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,this}fromArray(t,e=0){return R.FromArrayToRef(t,e,this),this}addInPlace(t){return this.x+=t._x,this.y+=t._y,this.z+=t._z,this.w+=t._w,this}addInPlaceFromFloats(t,e,r,i){return this.x+=t,this.y+=e,this.z+=r,this.w+=i,this}add(t){return new R(this._x+t.x,this._y+t.y,this._z+t.z,this._w+t.w)}addToRef(t,e){return e.x=this._x+t.x,e.y=this._y+t.y,e.z=this._z+t.z,e.w=this._w+t.w,e}subtractInPlace(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subtract(t){return new R(this._x-t.x,this._y-t.y,this._z-t.z,this._w-t.w)}subtractToRef(t,e){return e.x=this._x-t.x,e.y=this._y-t.y,e.z=this._z-t.z,e.w=this._w-t.w,e}subtractFromFloats(t,e,r,i){return new R(this._x-t,this._y-e,this._z-r,this._w-i)}subtractFromFloatsToRef(t,e,r,i,s){return s.x=this._x-t,s.y=this._y-e,s.z=this._z-r,s.w=this._w-i,s}negate(){return new R(-this._x,-this._y,-this._z,-this._w)}negateInPlace(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this}negateToRef(t){return t.x=-this._x,t.y=-this._y,t.z=-this._z,t.w=-this._w,t}scaleInPlace(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}scale(t){return new R(this._x*t,this._y*t,this._z*t,this._w*t)}scaleToRef(t,e){return e.x=this._x*t,e.y=this._y*t,e.z=this._z*t,e.w=this._w*t,e}scaleAndAddToRef(t,e){return e.x+=this._x*t,e.y+=this._y*t,e.z+=this._z*t,e.w+=this._w*t,e}equals(t){return t&&this._x===t.x&&this._y===t.y&&this._z===t.z&&this._w===t.w}equalsWithEpsilon(t,e=.001){return t&&(0,n.WithinEpsilon)(this._x,t.x,e)&&(0,n.WithinEpsilon)(this._y,t.y,e)&&(0,n.WithinEpsilon)(this._z,t.z,e)&&(0,n.WithinEpsilon)(this._w,t.w,e)}equalsToFloats(t,e,r,i){return this._x===t&&this._y===e&&this._z===r&&this._w===i}multiplyInPlace(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiply(t){return new R(this._x*t.x,this._y*t.y,this._z*t.z,this._w*t.w)}multiplyToRef(t,e){return e.x=this._x*t.x,e.y=this._y*t.y,e.z=this._z*t.z,e.w=this._w*t.w,e}multiplyByFloats(t,e,r,i){return new R(this._x*t,this._y*e,this._z*r,this._w*i)}divide(t){return new R(this._x/t.x,this._y/t.y,this._z/t.z,this._w/t.w)}divideToRef(t,e){return e.x=this._x/t.x,e.y=this._y/t.y,e.z=this._z/t.z,e.w=this._w/t.w,e}divideInPlace(t){return this.divideToRef(t,this)}minimizeInPlace(t){return t.x<this._x&&(this.x=t.x),t.y<this._y&&(this.y=t.y),t.z<this._z&&(this.z=t.z),t.w<this._w&&(this.w=t.w),this}maximizeInPlace(t){return t.x>this._x&&(this.x=t.x),t.y>this._y&&(this.y=t.y),t.z>this._z&&(this.z=t.z),t.w>this._w&&(this.w=t.w),this}minimizeInPlaceFromFloats(t,e,r,i){return this.x=Math.min(t,this._x),this.y=Math.min(e,this._y),this.z=Math.min(r,this._z),this.w=Math.min(i,this._w),this}maximizeInPlaceFromFloats(t,e,r,i){return this.x=Math.max(t,this._x),this.y=Math.max(e,this._y),this.z=Math.max(r,this._z),this.w=Math.max(i,this._w),this}floorToRef(t){return t.x=Math.floor(this._x),t.y=Math.floor(this._y),t.z=Math.floor(this._z),t.w=Math.floor(this._w),t}floor(){return new R(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z),Math.floor(this._w))}fractToRef(t){return t.x=this._x-Math.floor(this._x),t.y=this._y-Math.floor(this._y),t.z=this._z-Math.floor(this._z),t.w=this._w-Math.floor(this._w),t}fract(){return new R(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z),this._w-Math.floor(this._w))}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(t){return 0===t||1===t?this:this.scaleInPlace(1/t)}normalizeToNew(){return this.normalizeToRef(new R)}normalizeToRef(t){let e=this.length();return 0===e||1===e?(t.x=this._x,t.y=this._y,t.z=this._z,t.w=this._w,t):this.scaleToRef(1/e,t)}toVector3(){return new f(this._x,this._y,this._z)}clone(){return new R(this._x,this._y,this._z,this._w)}copyFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}copyFromFloats(t,e,r,i){return this.x=t,this.y=e,this.z=r,this.w=i,this}set(t,e,r,i){return this.copyFromFloats(t,e,r,i)}setAll(t){return this.x=this.y=this.z=this.w=t,this}dot(t){return this._x*t.x+this._y*t.y+this._z*t.z+this._w*t.w}static FromArray(t,e){return e||(e=0),new R(t[e],t[e+1],t[e+2],t[e+3])}static FromArrayToRef(t,e,r){return r.x=t[e],r.y=t[e+1],r.z=t[e+2],r.w=t[e+3],r}static FromFloatArrayToRef(t,e,r){return R.FromArrayToRef(t,e,r),r}static FromFloatsToRef(t,e,r,i,s){return s.x=t,s.y=e,s.z=r,s.w=i,s}static Zero(){return new R(0,0,0,0)}static One(){return new R(1,1,1,1)}static Random(t=0,e=1){return new R((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.x=(0,n.RandomRange)(t,e),r.y=(0,n.RandomRange)(t,e),r.z=(0,n.RandomRange)(t,e),r.w=(0,n.RandomRange)(t,e),r}static Clamp(t,e,r){return R.ClampToRef(t,e,r,new R)}static ClampToRef(t,e,r,i){return i.x=(0,n.Clamp)(t.x,e.x,r.x),i.y=(0,n.Clamp)(t.y,e.y,r.y),i.z=(0,n.Clamp)(t.z,e.z,r.z),i.w=(0,n.Clamp)(t.w,e.w,r.w),i}static CheckExtends(t,e,r){e.minimizeInPlace(t),r.maximizeInPlace(t)}static get ZeroReadOnly(){return R._ZeroReadOnly}static Normalize(t){return R.NormalizeToRef(t,new R)}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Minimize(t,e){let r=new R;return r.copyFrom(t),r.minimizeInPlace(e),r}static Maximize(t,e){let r=new R;return r.copyFrom(t),r.maximizeInPlace(e),r}static Distance(t,e){return Math.sqrt(R.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t.x-e.x,i=t.y-e.y,s=t.z-e.z,o=t.w-e.w;return r*r+i*i+s*s+o*o}static Center(t,e){return R.CenterToRef(t,e,new R)}static CenterToRef(t,e,r){return r.x=(t.x+e.x)/2,r.y=(t.y+e.y)/2,r.z=(t.z+e.z)/2,r.w=(t.w+e.w)/2,r}static TransformCoordinates(t,e){return R.TransformCoordinatesToRef(t,e,new R)}static TransformCoordinatesToRef(t,e,r){return R.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,e,r),r}static TransformCoordinatesFromFloatsToRef(t,e,r,i,s){let o=i.m,a=t*o[0]+e*o[4]+r*o[8]+o[12],n=t*o[1]+e*o[5]+r*o[9]+o[13],h=t*o[2]+e*o[6]+r*o[10]+o[14],_=t*o[3]+e*o[7]+r*o[11]+o[15];return s.x=a,s.y=n,s.z=h,s.w=_,s}static TransformNormal(t,e){return R.TransformNormalToRef(t,e,new R)}static TransformNormalToRef(t,e,r){let i=e.m,s=t.x*i[0]+t.y*i[4]+t.z*i[8],o=t.x*i[1]+t.y*i[5]+t.z*i[9],a=t.x*i[2]+t.y*i[6]+t.z*i[10];return r.x=s,r.y=o,r.z=a,r.w=t.w,r}static TransformNormalFromFloatsToRef(t,e,r,i,s,o){let a=s.m;return o.x=t*a[0]+e*a[4]+r*a[8],o.y=t*a[1]+e*a[5]+r*a[9],o.z=t*a[2]+e*a[6]+r*a[10],o.w=i,o}static FromVector3(t,e=0){return new R(t._x,t._y,t._z,e)}static Dot(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w}}R._V8PerformanceHack=new R(.5,.5,.5,.5),R._ZeroReadOnly=R.Zero();class d{get x(){return this._x}set x(t){this._x=t,this._isDirty=!0}get y(){return this._y}set y(t){this._y=t,this._isDirty=!0}get z(){return this._z}set z(t){this._z=t,this._isDirty=!0}get w(){return this._w}set w(t){this._w=t,this._isDirty=!0}constructor(t=0,e=0,r=0,i=1){this._isDirty=!0,this._x=t,this._y=e,this._z=r,this._w=i}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Quaternion"}getHashCode(){let t=c(this._x),e=c(this._y),r=c(this._z),i=c(this._w),s=t;return 397*(s=397*(s=397*s^e)^r)^i}asArray(){return[this._x,this._y,this._z,this._w]}toArray(t,e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,this}fromArray(t,e=0){return d.FromArrayToRef(t,e,this)}equals(t){return t&&this._x===t._x&&this._y===t._y&&this._z===t._z&&this._w===t._w}equalsWithEpsilon(t,e=.001){return t&&(0,n.WithinEpsilon)(this._x,t._x,e)&&(0,n.WithinEpsilon)(this._y,t._y,e)&&(0,n.WithinEpsilon)(this._z,t._z,e)&&(0,n.WithinEpsilon)(this._w,t._w,e)}isApprox(t,e=.001){return t&&((0,n.WithinEpsilon)(this._x,t._x,e)&&(0,n.WithinEpsilon)(this._y,t._y,e)&&(0,n.WithinEpsilon)(this._z,t._z,e)&&(0,n.WithinEpsilon)(this._w,t._w,e)||(0,n.WithinEpsilon)(this._x,-t._x,e)&&(0,n.WithinEpsilon)(this._y,-t._y,e)&&(0,n.WithinEpsilon)(this._z,-t._z,e)&&(0,n.WithinEpsilon)(this._w,-t._w,e))}clone(){return new d(this._x,this._y,this._z,this._w)}copyFrom(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._w=t._w,this._isDirty=!0,this}copyFromFloats(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._w=i,this._isDirty=!0,this}set(t,e,r,i){return this.copyFromFloats(t,e,r,i)}setAll(t){return this.copyFromFloats(t,t,t,t)}add(t){return new d(this._x+t._x,this._y+t._y,this._z+t._z,this._w+t._w)}addInPlace(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this._w+=t._w,this._isDirty=!0,this}addToRef(t,e){return e._x=this._x+t._x,e._y=this._y+t._y,e._z=this._z+t._z,e._w=this._w+t._w,e._isDirty=!0,e}addInPlaceFromFloats(t,e,r,i){return this._x+=t,this._y+=e,this._z+=r,this._w+=i,this._isDirty=!0,this}subtractToRef(t,e){return e._x=this._x-t._x,e._y=this._y-t._y,e._z=this._z-t._z,e._w=this._w-t._w,e._isDirty=!0,e}subtractFromFloats(t,e,r,i){return this.subtractFromFloatsToRef(t,e,r,i,new d)}subtractFromFloatsToRef(t,e,r,i,s){return s._x=this._x-t,s._y=this._y-e,s._z=this._z-r,s._w=this._w-i,s._isDirty=!0,s}subtract(t){return new d(this._x-t._x,this._y-t._y,this._z-t._z,this._w-t._w)}subtractInPlace(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this._w-=t._w,this._isDirty=!0,this}scale(t){return new d(this._x*t,this._y*t,this._z*t,this._w*t)}scaleToRef(t,e){return e._x=this._x*t,e._y=this._y*t,e._z=this._z*t,e._w=this._w*t,e._isDirty=!0,e}scaleInPlace(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this._isDirty=!0,this}scaleAndAddToRef(t,e){return e._x+=this._x*t,e._y+=this._y*t,e._z+=this._z*t,e._w+=this._w*t,e._isDirty=!0,e}multiply(t){let e=new d(0,0,0,1);return this.multiplyToRef(t,e),e}multiplyToRef(t,e){let r=this._x*t._w+this._y*t._z-this._z*t._y+this._w*t._x,i=-this._x*t._z+this._y*t._w+this._z*t._x+this._w*t._y,s=this._x*t._y-this._y*t._x+this._z*t._w+this._w*t._z,o=-this._x*t._x-this._y*t._y-this._z*t._z+this._w*t._w;return e.copyFromFloats(r,i,s,o),e}multiplyInPlace(t){return this.multiplyToRef(t,this)}multiplyByFloats(t,e,r,i){return this._x*=t,this._y*=e,this._z*=r,this._w*=i,this._isDirty=!0,this}divide(t){throw ReferenceError("Can not divide a quaternion")}divideToRef(t,e){throw ReferenceError("Can not divide a quaternion")}divideInPlace(t){throw ReferenceError("Can not divide a quaternion")}minimizeInPlace(){throw ReferenceError("Can not minimize a quaternion")}minimizeInPlaceFromFloats(){throw ReferenceError("Can not minimize a quaternion")}maximizeInPlace(){throw ReferenceError("Can not maximize a quaternion")}maximizeInPlaceFromFloats(){throw ReferenceError("Can not maximize a quaternion")}negate(){return this.negateToRef(new d)}negateInPlace(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._w=-this._w,this._isDirty=!0,this}negateToRef(t){return t._x=-this._x,t._y=-this._y,t._z=-this._z,t._w=-this._w,t._isDirty=!0,t}equalsToFloats(t,e,r,i){return this._x===t&&this._y===e&&this._z===r&&this._w===i}floorToRef(t){throw ReferenceError("Can not floor a quaternion")}floor(){throw ReferenceError("Can not floor a quaternion")}fractToRef(t){throw ReferenceError("Can not fract a quaternion")}fract(){throw ReferenceError("Can not fract a quaternion")}conjugateToRef(t){return t.copyFromFloats(-this._x,-this._y,-this._z,this._w),t}conjugateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){return new d(-this._x,-this._y,-this._z,this._w)}invert(){let t=this.conjugate(),e=this.lengthSquared();return 0==e||1==e||t.scaleInPlace(1/e),t}invertInPlace(){this.conjugateInPlace();let t=this.lengthSquared();return 0==t||1==t||this.scaleInPlace(1/t),this}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this.lengthSquared())}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(t){return 0===t||1===t?this:this.scaleInPlace(1/t)}normalizeToNew(){let t=new d(0,0,0,1);return this.normalizeToRef(t),t}normalizeToRef(t){let e=this.length();return 0===e||1===e?t.copyFromFloats(this._x,this._y,this._z,this._w):this.scaleToRef(1/e,t)}toEulerAngles(){let t=f.Zero();return this.toEulerAnglesToRef(t),t}toEulerAnglesToRef(t){let e=this._z,r=this._x,i=this._y,s=this._w,o=i*e-r*s;if(o<-.4999999)t._y=2*Math.atan2(i,s),t._x=Math.PI/2,t._z=0,t._isDirty=!0;else if(o>.4999999)t._y=2*Math.atan2(i,s),t._x=-Math.PI/2,t._z=0,t._isDirty=!0;else{let a=s*s,n=e*e,h=r*r,_=i*i;t._z=Math.atan2(2*(r*i+e*s),-n-h+_+a),t._x=Math.asin(-2*o),t._y=Math.atan2(2*(e*r+i*s),n-h-_+a),t._isDirty=!0}return t}toAlphaBetaGammaToRef(t){let e=this._z,r=this._x,i=this._y,s=this._w,o=2*Math.atan2(Math.sqrt(r*r+i*i),Math.sqrt(e*e+s*s)),a=2*Math.atan2(e,s),n=2*Math.atan2(i,r);return t.set((a-n)/2,o,(a+n)/2),t}toRotationMatrix(t){return z.FromQuaternionToRef(this,t),t}fromRotationMatrix(t){return d.FromRotationMatrixToRef(t,this),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}toAxisAngle(){let t=f.Zero(),e=this.toAxisAngleToRef(t);return{axis:t,angle:e}}toAxisAngleToRef(t){let e,r=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z),i=this._w;return r>0?(e=2*Math.atan2(r,i),t.set(this._x/r,this._y/r,this._z/r)):(e=0,t.set(1,0,0)),e}static FromRotationMatrix(t){let e=new d;return d.FromRotationMatrixToRef(t,e),e}static FromRotationMatrixToRef(t,e){let r,i=t.m,s=i[0],o=i[4],a=i[8],n=i[1],h=i[5],_=i[9],l=i[2],y=i[6],u=i[10],m=s+h+u;return m>0?(e._w=.25/(r=.5/Math.sqrt(m+1)),e._x=(y-_)*r,e._y=(a-l)*r,e._z=(n-o)*r):s>h&&s>u?(e._w=(y-_)/(r=2*Math.sqrt(1+s-h-u)),e._x=.25*r,e._y=(o+n)/r,e._z=(a+l)/r):h>u?(e._w=(a-l)/(r=2*Math.sqrt(1+h-s-u)),e._x=(o+n)/r,e._y=.25*r,e._z=(_+y)/r):(e._w=(n-o)/(r=2*Math.sqrt(1+u-s-h)),e._x=(a+l)/r,e._y=(_+y)/r,e._z=.25*r),e._isDirty=!0,e}static Dot(t,e){return t._x*e._x+t._y*e._y+t._z*e._z+t._w*e._w}static AreClose(t,e,r=.1){let i=d.Dot(t,e);return 1-i*i<=r}static SmoothToRef(t,e,r,i,s){let o=0===i?1:r/i;return o=(0,n.Clamp)(o,0,1),d.SlerpToRef(t,e,o,s),s}static Zero(){return new d(0,0,0,0)}static Inverse(t){return new d(-t._x,-t._y,-t._z,t._w)}static InverseToRef(t,e){return e.set(-t._x,-t._y,-t._z,t._w),e}static Identity(){return new d(0,0,0,1)}static IsIdentity(t){return t&&0===t._x&&0===t._y&&0===t._z&&1===t._w}static RotationAxis(t,e){return d.RotationAxisToRef(t,e,new d)}static RotationAxisToRef(t,e,r){r._w=Math.cos(e/2);let i=Math.sin(e/2)/t.length();return r._x=t._x*i,r._y=t._y*i,r._z=t._z*i,r._isDirty=!0,r}static FromArray(t,e){return e||(e=0),new d(t[e],t[e+1],t[e+2],t[e+3])}static FromArrayToRef(t,e,r){return r._x=t[e],r._y=t[e+1],r._z=t[e+2],r._w=t[e+3],r._isDirty=!0,r}static FromFloatsToRef(t,e,r,i,s){return s.copyFromFloats(t,e,r,i),s}static FromEulerAngles(t,e,r){let i=new d;return d.RotationYawPitchRollToRef(e,t,r,i),i}static FromEulerAnglesToRef(t,e,r,i){return d.RotationYawPitchRollToRef(e,t,r,i),i}static FromEulerVector(t){let e=new d;return d.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e}static FromEulerVectorToRef(t,e){return d.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e}static FromUnitVectorsToRef(t,e,r,i=.001){let s=f.Dot(t,e)+1;return s<i?Math.abs(t.x)>Math.abs(t.z)?r.set(-t.y,t.x,0,0):r.set(0,-t.z,t.y,0):(f.CrossToRef(t,e,w.Vector3[0]),r.set(w.Vector3[0].x,w.Vector3[0].y,w.Vector3[0].z,s)),r.normalize()}static RotationYawPitchRoll(t,e,r){let i=new d;return d.RotationYawPitchRollToRef(t,e,r,i),i}static RotationYawPitchRollToRef(t,e,r,i){let s=.5*r,o=.5*e,a=.5*t,n=Math.sin(s),h=Math.cos(s),_=Math.sin(o),l=Math.cos(o),y=Math.sin(a),u=Math.cos(a);return i._x=u*_*h+y*l*n,i._y=y*l*h-u*_*n,i._z=u*l*n-y*_*h,i._w=u*l*h+y*_*n,i._isDirty=!0,i}static RotationAlphaBetaGamma(t,e,r){let i=new d;return d.RotationAlphaBetaGammaToRef(t,e,r,i),i}static RotationAlphaBetaGammaToRef(t,e,r,i){let s=(r+t)*.5,o=(r-t)*.5,a=.5*e;return i._x=Math.cos(o)*Math.sin(a),i._y=Math.sin(o)*Math.sin(a),i._z=Math.sin(s)*Math.cos(a),i._w=Math.cos(s)*Math.cos(a),i._isDirty=!0,i}static RotationQuaternionFromAxis(t,e,r){let i=new d(0,0,0,0);return d.RotationQuaternionFromAxisToRef(t,e,r,i),i}static RotationQuaternionFromAxisToRef(t,e,r,i){let s=T.Matrix[0];return t=t.normalizeToRef(T.Vector3[0]),e=e.normalizeToRef(T.Vector3[1]),r=r.normalizeToRef(T.Vector3[2]),z.FromXYZAxesToRef(t,e,r,s),d.FromRotationMatrixToRef(s,i),i}static FromLookDirectionLH(t,e){let r=new d;return d.FromLookDirectionLHToRef(t,e,r),r}static FromLookDirectionLHToRef(t,e,r){let i=T.Matrix[0];return z.LookDirectionLHToRef(t,e,i),d.FromRotationMatrixToRef(i,r),r}static FromLookDirectionRH(t,e){let r=new d;return d.FromLookDirectionRHToRef(t,e,r),r}static FromLookDirectionRHToRef(t,e,r){let i=T.Matrix[0];return z.LookDirectionRHToRef(t,e,i),d.FromRotationMatrixToRef(i,r)}static Slerp(t,e,r){let i=d.Identity();return d.SlerpToRef(t,e,r,i),i}static SlerpToRef(t,e,r,i){let s,o,a=t._x*e._x+t._y*e._y+t._z*e._z+t._w*e._w,n=!1;if(a<0&&(n=!0,a=-a),a>.999999)o=1-r,s=n?-r:r;else{let t=Math.acos(a),e=1/Math.sin(t);o=Math.sin((1-r)*t)*e,s=n?-Math.sin(r*t)*e:Math.sin(r*t)*e}return i._x=o*t._x+s*e._x,i._y=o*t._y+s*e._y,i._z=o*t._z+s*e._z,i._w=o*t._w+s*e._w,i._isDirty=!0,i}static Hermite(t,e,r,i,s){let o=s*s,a=s*o,n=2*a-3*o+1,h=-2*a+3*o,_=a-2*o+s,l=a-o;return new d(t._x*n+r._x*h+e._x*_+i._x*l,t._y*n+r._y*h+e._y*_+i._y*l,t._z*n+r._z*h+e._z*_+i._z*l,t._w*n+r._w*h+e._w*_+i._w*l)}static Hermite1stDerivative(t,e,r,i,s){let o=new d;return this.Hermite1stDerivativeToRef(t,e,r,i,s,o),o}static Hermite1stDerivativeToRef(t,e,r,i,s,o){let a=s*s;return o._x=(a-s)*6*t._x+(3*a-4*s+1)*e._x+(-a+s)*6*r._x+(3*a-2*s)*i._x,o._y=(a-s)*6*t._y+(3*a-4*s+1)*e._y+(-a+s)*6*r._y+(3*a-2*s)*i._y,o._z=(a-s)*6*t._z+(3*a-4*s+1)*e._z+(-a+s)*6*r._z+(3*a-2*s)*i._z,o._w=(a-s)*6*t._w+(3*a-4*s+1)*e._w+(-a+s)*6*r._w+(3*a-2*s)*i._w,o._isDirty=!0,o}static Normalize(t){let e=d.Zero();return d.NormalizeToRef(t,e),e}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Clamp(t,e,r){let i=new d;return d.ClampToRef(t,e,r,i),i}static ClampToRef(t,e,r,i){return i.copyFromFloats((0,n.Clamp)(t.x,e.x,r.x),(0,n.Clamp)(t.y,e.y,r.y),(0,n.Clamp)(t.z,e.z,r.z),(0,n.Clamp)(t.w,e.w,r.w))}static Random(t=0,e=1){return new d((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.copyFromFloats((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static Minimize(){throw ReferenceError("Quaternion.Minimize does not make sense")}static Maximize(){throw ReferenceError("Quaternion.Maximize does not make sense")}static Distance(t,e){return Math.sqrt(d.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t.x-e.x,i=t.y-e.y,s=t.z-e.z,o=t.w-e.w;return r*r+i*i+s*s+o*o}static Center(t,e){return d.CenterToRef(t,e,d.Zero())}static CenterToRef(t,e,r){return r.copyFromFloats((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2,(t.w+e.w)/2)}}d._V8PerformanceHack=new d(.5,.5,.5,.5);class z{static get Use64Bits(){return o.PerformanceConfigurator.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=h._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(t,e=!1,r=!1,i=!0){this._isIdentity=t,this._isIdentity3x2=t||r,this._isIdentityDirty=!this._isIdentity&&e,this._isIdentity3x2Dirty=!this._isIdentity3x2&&i}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,o.PerformanceConfigurator.MatrixTrackPrecisionChange&&o.PerformanceConfigurator.MatrixTrackedMatrices.push(this),this._m=new o.PerformanceConfigurator.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){if(this._isIdentityDirty){this._isIdentityDirty=!1;let t=this._m;this._isIdentity=1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]}return this._isIdentity}isIdentityAs3x2(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,1!==this._m[0]||1!==this._m[5]||1!==this._m[15]||0!==this._m[1]||0!==this._m[2]||0!==this._m[3]||0!==this._m[4]||0!==this._m[6]||0!==this._m[7]||0!==this._m[8]||0!==this._m[9]||0!==this._m[10]||0!==this._m[11]||0!==this._m[12]||0!==this._m[13]||0!==this._m[14]?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){if(!0===this._isIdentity)return 1;let t=this._m,e=t[0],r=t[1],i=t[2],s=t[3],o=t[4],a=t[5],n=t[6],h=t[7],_=t[8],l=t[9],y=t[10],u=t[11],m=t[12],c=t[13],x=t[14],f=t[15],R=y*f-x*u,d=l*f-c*u,z=l*x-c*y,T=_*f-m*u,w=_*x-y*m,p=_*c-m*l;return e*(a*R-n*d+h*z)+-(r*(o*R-n*T+h*w))+i*(o*d-a*T+h*p)+-(s*(o*z-a*w+n*p))}toString(){return`{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}
2
- ${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}
3
- ${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}
4
- ${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`}toArray(t=null,e=0){if(!t)return this._m;let r=this._m;for(let i=0;i<16;i++)t[e+i]=r[i];return this}asArray(){return this._m}fromArray(t,e=0){return z.FromArrayToRef(t,e,this)}copyFromFloats(...t){return z.FromArrayToRef(t,0,this)}set(...t){let e=this._m;for(let r=0;r<16;r++)e[r]=t[r];return this.markAsUpdated(),this}setAll(t){let e=this._m;for(let r=0;r<16;r++)e[r]=t;return this.markAsUpdated(),this}invert(){return this.invertToRef(this),this}reset(){return z.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this}add(t){let e=new z;return this.addToRef(t,e),e}addToRef(t,e){let r=this._m,i=e._m,s=t.m;for(let t=0;t<16;t++)i[t]=r[t]+s[t];return e.markAsUpdated(),e}addToSelf(t){let e=this._m,r=t.m;return e[0]+=r[0],e[1]+=r[1],e[2]+=r[2],e[3]+=r[3],e[4]+=r[4],e[5]+=r[5],e[6]+=r[6],e[7]+=r[7],e[8]+=r[8],e[9]+=r[9],e[10]+=r[10],e[11]+=r[11],e[12]+=r[12],e[13]+=r[13],e[14]+=r[14],e[15]+=r[15],this.markAsUpdated(),this}addInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]+=r[t];return this.markAsUpdated(),this}addInPlaceFromFloats(...t){let e=this._m;for(let r=0;r<16;r++)e[r]+=t[r];return this.markAsUpdated(),this}subtract(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]-=r[t];return this.markAsUpdated(),this}subtractToRef(t,e){let r=this._m,i=t.m,s=e._m;for(let t=0;t<16;t++)s[t]=r[t]-i[t];return e.markAsUpdated(),e}subtractInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]-=r[t];return this.markAsUpdated(),this}subtractFromFloats(...t){return this.subtractFromFloatsToRef(...t,new z)}subtractFromFloatsToRef(...t){let e=t.pop(),r=this._m,i=e._m;for(let e=0;e<16;e++)i[e]=r[e]-t[e];return e.markAsUpdated(),e}invertToRef(t){return!0===this._isIdentity?z.IdentityToRef(t):u(this,t.asArray())?t.markAsUpdated():t.copyFrom(this),t}addAtIndex(t,e){return this._m[t]+=e,this.markAsUpdated(),this}multiplyAtIndex(t,e){return this._m[t]*=e,this.markAsUpdated(),this}setTranslationFromFloats(t,e,r){return this._m[12]=t,this._m[13]=e,this._m[14]=r,this.markAsUpdated(),this}addTranslationFromFloats(t,e,r){return this._m[12]+=t,this._m[13]+=e,this._m[14]+=r,this.markAsUpdated(),this}setTranslation(t){return this.setTranslationFromFloats(t._x,t._y,t._z)}getTranslation(){return new f(this._m[12],this._m[13],this._m[14])}getTranslationToRef(t){return t.x=this._m[12],t.y=this._m[13],t.z=this._m[14],t}removeRotationAndScaling(){let t=this.m;return z.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t[12],t[13],t[14],t[15],this),this._updateIdentityStatus(0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]),this}copyFrom(t){return t.copyToArray(this._m),this.updateFlag=t.updateFlag,this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this}copyToArray(t,e=0){return y(this,t,e),this}multiply(t){let e=new z;return this.multiplyToRef(t,e),e}multiplyInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]*=r[t];return this.markAsUpdated(),this}multiplyByFloats(...t){let e=this._m;for(let r=0;r<16;r++)e[r]*=t[r];return this.markAsUpdated(),this}multiplyByFloatsToRef(...t){let e=t.pop(),r=this._m,i=e._m;for(let e=0;e<16;e++)i[e]=r[e]*t[e];return e.markAsUpdated(),e}multiplyToRef(t,e){return this._isIdentity?e.copyFrom(t):t._isIdentity?e.copyFrom(this):(this.multiplyToArray(t,e._m,0),e.markAsUpdated()),e}multiplyToArray(t,e,r){return l(this,t,e,r),this}divide(t){return this.divideToRef(t,new z)}divideToRef(t,e){let r=this._m,i=t.m,s=e._m;for(let t=0;t<16;t++)s[t]=r[t]/i[t];return e.markAsUpdated(),e}divideInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]/=r[t];return this.markAsUpdated(),this}minimizeInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]=Math.min(e[t],r[t]);return this.markAsUpdated(),this}minimizeInPlaceFromFloats(...t){let e=this._m;for(let r=0;r<16;r++)e[r]=Math.min(e[r],t[r]);return this.markAsUpdated(),this}maximizeInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]=Math.min(e[t],r[t]);return this.markAsUpdated(),this}maximizeInPlaceFromFloats(...t){let e=this._m;for(let r=0;r<16;r++)e[r]=Math.min(e[r],t[r]);return this.markAsUpdated(),this}negate(){return this.negateToRef(new z)}negateInPlace(){let t=this._m;for(let e=0;e<16;e++)t[e]=-t[e];return this.markAsUpdated(),this}negateToRef(t){let e=this._m,r=t._m;for(let t=0;t<16;t++)r[t]=-e[t];return t.markAsUpdated(),t}equals(t){if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;let e=this.m,r=t.m;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}equalsWithEpsilon(t,e=0){let r=this._m,i=t.m;for(let t=0;t<16;t++)if(!(0,n.WithinEpsilon)(r[t],i[t],e))return!1;return!0}equalsToFloats(...t){let e=this._m;for(let r=0;r<16;r++)if(e[r]!=t[r])return!1;return!0}floor(){return this.floorToRef(new z)}floorToRef(t){let e=this._m,r=t._m;for(let t=0;t<16;t++)r[t]=Math.floor(e[t]);return t.markAsUpdated(),t}fract(){return this.fractToRef(new z)}fractToRef(t){let e=this._m,r=t._m;for(let t=0;t<16;t++)r[t]=e[t]-Math.floor(e[t]);return t.markAsUpdated(),t}clone(){let t=new z;return t.copyFrom(this),t}getClassName(){return"Matrix"}getHashCode(){let t=c(this._m[0]);for(let e=1;e<16;e++)t=397*t^c(this._m[e]);return t}decomposeToTransformNode(t){return t.rotationQuaternion=t.rotationQuaternion||new d,this.decompose(t.scaling,t.rotationQuaternion,t.position)}decompose(t,e,r,i,s=!0){if(this._isIdentity)return r&&r.setAll(0),t&&t.setAll(1),e&&e.copyFromFloats(0,0,0,1),!0;let o=this._m;if(r&&r.copyFromFloats(o[12],o[13],o[14]),(t=t||T.Vector3[0]).x=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]),t.y=Math.sqrt(o[4]*o[4]+o[5]*o[5]+o[6]*o[6]),t.z=Math.sqrt(o[8]*o[8]+o[9]*o[9]+o[10]*o[10]),i){let e=(s?i.absoluteScaling.x:i.scaling.x)<0?-1:1,r=(s?i.absoluteScaling.y:i.scaling.y)<0?-1:1,o=(s?i.absoluteScaling.z:i.scaling.z)<0?-1:1;t.x*=e,t.y*=r,t.z*=o}else 0>=this.determinant()&&(t.y*=-1);if(0===t._x||0===t._y||0===t._z)return e&&e.copyFromFloats(0,0,0,1),!1;if(e){let r=1/t._x,i=1/t._y,s=1/t._z;z.FromValuesToRef(o[0]*r,o[1]*r,o[2]*r,0,o[4]*i,o[5]*i,o[6]*i,0,o[8]*s,o[9]*s,o[10]*s,0,0,0,0,1,T.Matrix[0]),d.FromRotationMatrixToRef(T.Matrix[0],e)}return!0}getRow(t){if(t<0||t>3)return null;let e=4*t;return new R(this._m[e+0],this._m[e+1],this._m[e+2],this._m[e+3])}getRowToRef(t,e){if(t>=0&&t<=3){let r=4*t;e.x=this._m[r+0],e.y=this._m[r+1],e.z=this._m[r+2],e.w=this._m[r+3]}return e}setRow(t,e){return this.setRowFromFloats(t,e.x,e.y,e.z,e.w)}transpose(){let t=new z;return z.TransposeToRef(this,t),t}transposeToRef(t){return z.TransposeToRef(this,t),t}setRowFromFloats(t,e,r,i,s){if(t<0||t>3)return this;let o=4*t;return this._m[o+0]=e,this._m[o+1]=r,this._m[o+2]=i,this._m[o+3]=s,this.markAsUpdated(),this}scale(t){let e=new z;return this.scaleToRef(t,e),e}scaleToRef(t,e){for(let r=0;r<16;r++)e._m[r]=this._m[r]*t;return e.markAsUpdated(),e}scaleAndAddToRef(t,e){for(let r=0;r<16;r++)e._m[r]+=this._m[r]*t;return e.markAsUpdated(),e}scaleInPlace(t){let e=this._m;for(let r=0;r<16;r++)e[r]*=t;return this.markAsUpdated(),this}toNormalMatrix(t){let e=T.Matrix[0];this.invertToRef(e),e.transposeToRef(t);let r=t._m;return z.FromValuesToRef(r[0],r[1],r[2],0,r[4],r[5],r[6],0,r[8],r[9],r[10],0,0,0,0,1,t),t}getRotationMatrix(){let t=new z;return this.getRotationMatrixToRef(t),t}getRotationMatrixToRef(t){let e=T.Vector3[0];if(!this.decompose(e))return z.IdentityToRef(t),t;let r=this._m,i=1/e._x,s=1/e._y,o=1/e._z;return z.FromValuesToRef(r[0]*i,r[1]*i,r[2]*i,0,r[4]*s,r[5]*s,r[6]*s,0,r[8]*o,r[9]*o,r[10]*o,0,0,0,0,1,t),t}toggleModelMatrixHandInPlace(){let t=this._m;return t[2]*=-1,t[6]*=-1,t[8]*=-1,t[9]*=-1,t[14]*=-1,this.markAsUpdated(),this}toggleProjectionMatrixHandInPlace(){let t=this._m;return t[8]*=-1,t[9]*=-1,t[10]*=-1,t[11]*=-1,this.markAsUpdated(),this}static FromArray(t,e=0){let r=new z;return z.FromArrayToRef(t,e,r),r}static FromArrayToRef(t,e,r){for(let i=0;i<16;i++)r._m[i]=t[i+e];return r.markAsUpdated(),r}static FromFloat32ArrayToRefScaled(t,e,r,i){return i._m[0]=t[0+e]*r,i._m[1]=t[1+e]*r,i._m[2]=t[2+e]*r,i._m[3]=t[3+e]*r,i._m[4]=t[4+e]*r,i._m[5]=t[5+e]*r,i._m[6]=t[6+e]*r,i._m[7]=t[7+e]*r,i._m[8]=t[8+e]*r,i._m[9]=t[9+e]*r,i._m[10]=t[10+e]*r,i._m[11]=t[11+e]*r,i._m[12]=t[12+e]*r,i._m[13]=t[13+e]*r,i._m[14]=t[14+e]*r,i._m[15]=t[15+e]*r,i.markAsUpdated(),i}static get IdentityReadOnly(){return z._IdentityReadOnly}static FromValuesToRef(t,e,r,i,s,o,a,n,h,_,l,y,u,m,c,x,f){let R=f._m;R[0]=t,R[1]=e,R[2]=r,R[3]=i,R[4]=s,R[5]=o,R[6]=a,R[7]=n,R[8]=h,R[9]=_,R[10]=l,R[11]=y,R[12]=u,R[13]=m,R[14]=c,R[15]=x,f.markAsUpdated()}static FromValues(t,e,r,i,s,o,a,n,h,_,l,y,u,m,c,x){let f=new z,R=f._m;return R[0]=t,R[1]=e,R[2]=r,R[3]=i,R[4]=s,R[5]=o,R[6]=a,R[7]=n,R[8]=h,R[9]=_,R[10]=l,R[11]=y,R[12]=u,R[13]=m,R[14]=c,R[15]=x,f.markAsUpdated(),f}static Compose(t,e,r){let i=new z;return z.ComposeToRef(t,e,r,i),i}static ComposeToRef(t,e,r,i){let s=i._m,o=e._x,a=e._y,n=e._z,h=e._w,_=o+o,l=a+a,y=n+n,u=o*_,m=o*l,c=o*y,x=a*l,f=a*y,R=n*y,d=h*_,z=h*l,T=h*y,w=t._x,p=t._y,F=t._z;return s[0]=(1-(x+R))*w,s[1]=(m+T)*w,s[2]=(c-z)*w,s[3]=0,s[4]=(m-T)*p,s[5]=(1-(u+R))*p,s[6]=(f+d)*p,s[7]=0,s[8]=(c+z)*F,s[9]=(f-d)*F,s[10]=(1-(u+x))*F,s[11]=0,s[12]=r._x,s[13]=r._y,s[14]=r._z,s[15]=1,i.markAsUpdated(),i}static Identity(){let t=z.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return t._updateIdentityStatus(!0),t}static IdentityToRef(t){return z.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(!0),t}static Zero(){let t=z.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return t._updateIdentityStatus(!1),t}static RotationX(t){let e=new z;return z.RotationXToRef(t,e),e}static Invert(t){let e=new z;return t.invertToRef(e),e}static RotationXToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return z.FromValuesToRef(1,0,0,0,0,i,r,0,0,-r,i,0,0,0,0,1,e),e._updateIdentityStatus(1===i&&0===r),e}static RotationY(t){let e=new z;return z.RotationYToRef(t,e),e}static RotationYToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return z.FromValuesToRef(i,0,-r,0,0,1,0,0,r,0,i,0,0,0,0,1,e),e._updateIdentityStatus(1===i&&0===r),e}static RotationZ(t){let e=new z;return z.RotationZToRef(t,e),e}static RotationZToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return z.FromValuesToRef(i,r,0,0,-r,i,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(1===i&&0===r),e}static RotationAxis(t,e){let r=new z;return z.RotationAxisToRef(t,e,r),r}static RotationAxisToRef(t,e,r){let i=Math.sin(-e),s=Math.cos(-e),o=1-s;t=t.normalizeToRef(T.Vector3[0]);let a=r._m;return a[0]=t._x*t._x*o+s,a[1]=t._x*t._y*o-t._z*i,a[2]=t._x*t._z*o+t._y*i,a[3]=0,a[4]=t._y*t._x*o+t._z*i,a[5]=t._y*t._y*o+s,a[6]=t._y*t._z*o-t._x*i,a[7]=0,a[8]=t._z*t._x*o-t._y*i,a[9]=t._z*t._y*o+t._x*i,a[10]=t._z*t._z*o+s,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,r.markAsUpdated(),r}static RotationAlignToRef(t,e,r,i=!1){let s=f.Dot(e,t),o=r._m;if(s<-.999)o[0]=-1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=i?1:-1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=i?-1:1,o[11]=0;else{let r=f.Cross(e,t),i=1/(1+s);o[0]=r._x*r._x*i+s,o[1]=r._y*r._x*i-r._z,o[2]=r._z*r._x*i+r._y,o[3]=0,o[4]=r._x*r._y*i+r._z,o[5]=r._y*r._y*i+s,o[6]=r._z*r._y*i-r._x,o[7]=0,o[8]=r._x*r._z*i-r._y,o[9]=r._y*r._z*i+r._x,o[10]=r._z*r._z*i+s,o[11]=0}return o[12]=0,o[13]=0,o[14]=0,o[15]=1,r.markAsUpdated(),r}static RotationYawPitchRoll(t,e,r){let i=new z;return z.RotationYawPitchRollToRef(t,e,r,i),i}static RotationYawPitchRollToRef(t,e,r,i){return d.RotationYawPitchRollToRef(t,e,r,T.Quaternion[0]),T.Quaternion[0].toRotationMatrix(i),i}static Scaling(t,e,r){let i=new z;return z.ScalingToRef(t,e,r,i),i}static ScalingToRef(t,e,r,i){return z.FromValuesToRef(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1,i),i._updateIdentityStatus(1===t&&1===e&&1===r),i}static Translation(t,e,r){let i=new z;return z.TranslationToRef(t,e,r,i),i}static TranslationToRef(t,e,r,i){return z.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1,i),i._updateIdentityStatus(0===t&&0===e&&0===r),i}static Lerp(t,e,r){let i=new z;return z.LerpToRef(t,e,r,i),i}static LerpToRef(t,e,r,i){let s=i._m,o=t.m,a=e.m;for(let t=0;t<16;t++)s[t]=o[t]*(1-r)+a[t]*r;return i.markAsUpdated(),i}static DecomposeLerp(t,e,r){let i=new z;return z.DecomposeLerpToRef(t,e,r,i),i}static DecomposeLerpToRef(t,e,r,i){let s=T.Vector3[0],o=T.Quaternion[0],a=T.Vector3[1];t.decompose(s,o,a);let n=T.Vector3[2],h=T.Quaternion[1],_=T.Vector3[3];e.decompose(n,h,_);let l=T.Vector3[4];f.LerpToRef(s,n,r,l);let y=T.Quaternion[2];d.SlerpToRef(o,h,r,y);let u=T.Vector3[5];return f.LerpToRef(a,_,r,u),z.ComposeToRef(l,y,u,i),i}static LookAtLH(t,e,r){let i=new z;return z.LookAtLHToRef(t,e,r,i),i}static LookAtLHToRef(t,e,r,i){let s=T.Vector3[0],o=T.Vector3[1],a=T.Vector3[2];e.subtractToRef(t,a),a.normalize(),f.CrossToRef(r,a,s);let n=s.lengthSquared();0===n?s.x=1:s.normalizeFromLength(Math.sqrt(n)),f.CrossToRef(a,s,o),o.normalize();let h=-f.Dot(s,t),_=-f.Dot(o,t),l=-f.Dot(a,t);return z.FromValuesToRef(s._x,o._x,a._x,0,s._y,o._y,a._y,0,s._z,o._z,a._z,0,h,_,l,1,i),i}static LookAtRH(t,e,r){let i=new z;return z.LookAtRHToRef(t,e,r,i),i}static LookAtRHToRef(t,e,r,i){let s=T.Vector3[0],o=T.Vector3[1],a=T.Vector3[2];t.subtractToRef(e,a),a.normalize(),f.CrossToRef(r,a,s);let n=s.lengthSquared();0===n?s.x=1:s.normalizeFromLength(Math.sqrt(n)),f.CrossToRef(a,s,o),o.normalize();let h=-f.Dot(s,t),_=-f.Dot(o,t),l=-f.Dot(a,t);return z.FromValuesToRef(s._x,o._x,a._x,0,s._y,o._y,a._y,0,s._z,o._z,a._z,0,h,_,l,1,i),i}static LookDirectionLH(t,e){let r=new z;return z.LookDirectionLHToRef(t,e,r),r}static LookDirectionLHToRef(t,e,r){let i=T.Vector3[0];i.copyFrom(t),i.scaleInPlace(-1);let s=T.Vector3[1];return f.CrossToRef(e,i,s),z.FromValuesToRef(s._x,s._y,s._z,0,e._x,e._y,e._z,0,i._x,i._y,i._z,0,0,0,0,1,r),r}static LookDirectionRH(t,e){let r=new z;return z.LookDirectionRHToRef(t,e,r),r}static LookDirectionRHToRef(t,e,r){let i=T.Vector3[2];return f.CrossToRef(e,t,i),z.FromValuesToRef(i._x,i._y,i._z,0,e._x,e._y,e._z,0,t._x,t._y,t._z,0,0,0,0,1,r),r}static OrthoLH(t,e,r,i,s){let o=new z;return z.OrthoLHToRef(t,e,r,i,o,s),o}static OrthoLHToRef(t,e,r,i,s,o){let a=2/t,n=2/e,h=2/(i-r),_=-(i+r)/(i-r);return z.FromValuesToRef(a,0,0,0,0,n,0,0,0,0,h,0,0,0,_,1,s),o&&s.multiplyToRef(p,s),s._updateIdentityStatus(1===a&&1===n&&1===h&&0===_),s}static OrthoOffCenterLH(t,e,r,i,s,o,a){let n=new z;return z.OrthoOffCenterLHToRef(t,e,r,i,s,o,n,a),n}static OrthoOffCenterLHToRef(t,e,r,i,s,o,a,n){return z.FromValuesToRef(2/(e-t),0,0,0,0,2/(i-r),0,0,0,0,2/(o-s),0,(t+e)/(t-e),(i+r)/(r-i),-(o+s)/(o-s),1,a),n&&a.multiplyToRef(p,a),a.markAsUpdated(),a}static ObliqueOffCenterLHToRef(t,e,r,i,s,o,a,n,h,_,l){let y=-a*Math.cos(n),u=-a*Math.sin(n);return z.TranslationToRef(0,0,-h,T.Matrix[1]),z.FromValuesToRef(1,0,0,0,0,1,0,0,y,u,1,0,0,0,0,1,T.Matrix[0]),T.Matrix[1].multiplyToRef(T.Matrix[0],T.Matrix[0]),z.TranslationToRef(0,0,h,T.Matrix[1]),T.Matrix[0].multiplyToRef(T.Matrix[1],T.Matrix[0]),z.OrthoOffCenterLHToRef(t,e,r,i,s,o,_,l),T.Matrix[0].multiplyToRef(_,_),_}static OrthoOffCenterRH(t,e,r,i,s,o,a){let n=new z;return z.OrthoOffCenterRHToRef(t,e,r,i,s,o,n,a),n}static OrthoOffCenterRHToRef(t,e,r,i,s,o,a,n){return z.OrthoOffCenterLHToRef(t,e,r,i,s,o,a,n),a._m[10]*=-1,a}static ObliqueOffCenterRHToRef(t,e,r,i,s,o,a,n,h,_,l){let y=a*Math.cos(n),u=a*Math.sin(n);return z.TranslationToRef(0,0,h,T.Matrix[1]),z.FromValuesToRef(1,0,0,0,0,1,0,0,y,u,1,0,0,0,0,1,T.Matrix[0]),T.Matrix[1].multiplyToRef(T.Matrix[0],T.Matrix[0]),z.TranslationToRef(0,0,-h,T.Matrix[1]),T.Matrix[0].multiplyToRef(T.Matrix[1],T.Matrix[0]),z.OrthoOffCenterRHToRef(t,e,r,i,s,o,_,l),T.Matrix[0].multiplyToRef(_,_),_}static PerspectiveLH(t,e,r,i,s,o=0){let a=new z,n=Math.tan(o);return z.FromValuesToRef(2*r/t,0,0,0,0,2*r/e,0,n,0,0,(i+r)/(i-r),1,0,0,-2*i*r/(i-r),0,a),s&&a.multiplyToRef(p,a),a._updateIdentityStatus(!1),a}static PerspectiveFovLH(t,e,r,i,s,o=0,a=!1){let n=new z;return z.PerspectiveFovLHToRef(t,e,r,i,n,!0,s,o,a),n}static PerspectiveFovLHToRef(t,e,r,i,s,o=!0,a,n=0,h=!1){let _=1/Math.tan(.5*t),l=o?_/e:_,y=o?_:_*e,u=h&&0===r?-1:0!==i?(i+r)/(i-r):1,m=h&&0===r?2*i:0!==i?-2*i*r/(i-r):-2*r,c=Math.tan(n);return z.FromValuesToRef(l,0,0,0,0,y,0,c,0,0,u,1,0,0,m,0,s),a&&s.multiplyToRef(p,s),s._updateIdentityStatus(!1),s}static PerspectiveFovReverseLHToRef(t,e,r,i,s,o=!0,a,n=0){let h=1/Math.tan(.5*t),_=o?h/e:h,l=o?h:h*e,y=Math.tan(n);return z.FromValuesToRef(_,0,0,0,0,l,0,y,0,0,-r,1,0,0,1,0,s),a&&s.multiplyToRef(p,s),s._updateIdentityStatus(!1),s}static PerspectiveFovRH(t,e,r,i,s,o=0,a=!1){let n=new z;return z.PerspectiveFovRHToRef(t,e,r,i,n,!0,s,o,a),n}static PerspectiveFovRHToRef(t,e,r,i,s,o=!0,a,n=0,h=!1){let _=1/Math.tan(.5*t),l=o?_/e:_,y=o?_:_*e,u=h&&0===r?1:0!==i?-(i+r)/(i-r):-1,m=h&&0===r?2*i:0!==i?-2*i*r/(i-r):-2*r,c=Math.tan(n);return z.FromValuesToRef(l,0,0,0,0,y,0,c,0,0,u,-1,0,0,m,0,s),a&&s.multiplyToRef(p,s),s._updateIdentityStatus(!1),s}static PerspectiveFovReverseRHToRef(t,e,r,i,s,o=!0,a,n=0){let h=1/Math.tan(.5*t),_=o?h/e:h,l=o?h:h*e,y=Math.tan(n);return z.FromValuesToRef(_,0,0,0,0,l,0,y,0,0,-r,-1,0,0,-1,0,s),a&&s.multiplyToRef(p,s),s._updateIdentityStatus(!1),s}static GetFinalMatrix(t,e,r,i,s,o){let a=t.width,n=t.height,h=t.x,_=t.y,l=z.FromValues(a/2,0,0,0,0,-n/2,0,0,0,0,o-s,0,h+a/2,n/2+_,s,1),y=new z;return e.multiplyToRef(r,y),y.multiplyToRef(i,y),y.multiplyToRef(l,y)}static GetAsMatrix2x2(t){let e=t.m,r=[e[0],e[1],e[4],e[5]];return o.PerformanceConfigurator.MatrixUse64Bits?r:new Float32Array(r)}static GetAsMatrix3x3(t){let e=t.m,r=[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]];return o.PerformanceConfigurator.MatrixUse64Bits?r:new Float32Array(r)}static Transpose(t){let e=new z;return z.TransposeToRef(t,e),e}static TransposeToRef(t,e){let r=t.m,i=r[0],s=r[4],o=r[8],a=r[12],n=r[1],h=r[5],_=r[9],l=r[13],y=r[2],u=r[6],m=r[10],c=r[14],x=r[3],f=r[7],R=r[11],d=r[15],z=e._m;return z[0]=i,z[1]=s,z[2]=o,z[3]=a,z[4]=n,z[5]=h,z[6]=_,z[7]=l,z[8]=y,z[9]=u,z[10]=m,z[11]=c,z[12]=x,z[13]=f,z[14]=R,z[15]=d,e.markAsUpdated(),e._updateIdentityStatus(t._isIdentity,t._isIdentityDirty),e}static Reflection(t){let e=new z;return z.ReflectionToRef(t,e),e}static ReflectionToRef(t,e){t.normalize();let r=t.normal.x,i=t.normal.y,s=t.normal.z,o=-2*r,a=-2*i,n=-2*s;return z.FromValuesToRef(o*r+1,a*r,n*r,0,o*i,a*i+1,n*i,0,o*s,a*s,n*s+1,0,o*t.d,a*t.d,n*t.d,1,e),e}static FromXYZAxesToRef(t,e,r,i){return z.FromValuesToRef(t._x,t._y,t._z,0,e._x,e._y,e._z,0,r._x,r._y,r._z,0,0,0,0,1,i),i}static FromQuaternionToRef(t,e){let r=t._x*t._x,i=t._y*t._y,s=t._z*t._z,o=t._x*t._y,a=t._z*t._w,n=t._z*t._x,h=t._y*t._w,_=t._y*t._z,l=t._x*t._w;return e._m[0]=1-2*(i+s),e._m[1]=2*(o+a),e._m[2]=2*(n-h),e._m[3]=0,e._m[4]=2*(o-a),e._m[5]=1-2*(s+r),e._m[6]=2*(_+l),e._m[7]=0,e._m[8]=2*(n+h),e._m[9]=2*(_-l),e._m[10]=1-2*(i+r),e._m[11]=0,e._m[12]=0,e._m[13]=0,e._m[14]=0,e._m[15]=1,e.markAsUpdated(),e}}z._IdentityReadOnly=z.Identity();class T{}T.Vector3=i(11,f.Zero),T.Matrix=i(2,z.Identity),T.Quaternion=i(3,d.Zero);class w{}w.Vector2=i(3,x.Zero),w.Vector3=i(13,f.Zero),w.Vector4=i(3,R.Zero),w.Quaternion=i(3,d.Zero),w.Matrix=i(8,z.Identity);let p=z.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1),F=!1;t.s(["Matrix",0,z,"Quaternion",0,d,"RegisterMathVector",0,function(){F||(F=!0,Object.defineProperties(x.prototype,{dimension:{value:[2]},rank:{value:1}}),Object.defineProperties(f.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(R.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(d.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(z.prototype,{dimension:{value:[4,4]},rank:{value:2}}),(0,m.RegisterClass)("BABYLON.Vector2",x),(0,m.RegisterClass)("BABYLON.Vector3",f),(0,m.RegisterClass)("BABYLON.Vector4",R),(0,m.RegisterClass)("BABYLON.Matrix",z))},"TmpVectors",0,w,"Vector2",0,x,"Vector3",0,f,"Vector4",0,R],96265)}]);