@uptimizr/dashboard 0.1.3 → 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 (235) 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/09510356f0lad.js +1 -0
  16. package/out/_next/static/chunks/0_eu72k69lxj7.js +1 -0
  17. package/out/_next/static/chunks/0beajlqy8p8b5.js +1 -0
  18. package/out/_next/static/chunks/0c83pe1mpx456.js +1 -0
  19. package/out/_next/static/chunks/0echnagbkyx79.js +1198 -0
  20. package/out/_next/static/chunks/0eh1ml86u8dh7.js +1 -0
  21. package/out/_next/static/chunks/0fh-9h9ylxskr.js +674 -0
  22. package/out/_next/static/chunks/0fzmc1up21g1i.js +1 -0
  23. package/out/_next/static/chunks/0grlb9lo8e502.js +1 -0
  24. package/out/_next/static/chunks/0h22pg-0xrxnm.js +1 -0
  25. package/out/_next/static/chunks/0j6p1pmc14t96.js +1 -0
  26. package/out/_next/static/chunks/0j_6dx-sttgsy.js +1 -0
  27. package/out/_next/static/chunks/0j__xaq_8_di1.js +1 -0
  28. package/out/_next/static/chunks/0kfd-cvj5fvtz.js +1 -0
  29. package/out/_next/static/chunks/0o_mp98xzqfyf.js +1 -0
  30. package/out/_next/static/chunks/0otsec99kdkt7.js +213 -0
  31. package/out/_next/static/chunks/0ql-s-tsmel_u.js +151 -0
  32. package/out/_next/static/chunks/0r47gs_e93cka.js +1 -0
  33. package/out/_next/static/chunks/0sqys6o2pbe1q.js +1328 -0
  34. package/out/_next/static/chunks/0titqrn1qmcsv.js +1 -0
  35. package/out/_next/static/chunks/0tnlbw78tgaxp.js +4 -0
  36. package/out/_next/static/chunks/0tw4dyl-cp-hd.js +1 -0
  37. package/out/_next/static/chunks/0vbce-8omgurc.js +1 -0
  38. package/out/_next/static/chunks/0vfsg5byzep_0.js +1 -0
  39. package/out/_next/static/chunks/{0gv7mblzv3dl3.js → 0w8_1yjvol1f0.js} +20 -20
  40. package/out/_next/static/chunks/0xh144a5fz58h.js +1 -0
  41. package/out/_next/static/chunks/0xjltg_pph0c8.js +1 -0
  42. package/out/_next/static/chunks/0yeqgh0dnas8d.js +1 -0
  43. package/out/_next/static/chunks/101-7e_7up7rk.js +1 -0
  44. package/out/_next/static/chunks/128e51hj_04r0.js +1 -0
  45. package/out/_next/static/chunks/{10fnxpln_5xfd.js → 12kv810lohbsx.js} +2 -2
  46. package/out/_next/static/chunks/137xbvd4nd41j.js +3 -0
  47. package/out/_next/static/chunks/14bws-suyy5zu.js +1 -0
  48. package/out/_next/static/chunks/14ggsmqwej_tt.js +1656 -0
  49. package/out/_next/static/chunks/17genz6pkmty_.js +1 -0
  50. package/out/_next/static/chunks/17xd8hnazzr0g.js +1454 -0
  51. package/out/_next/static/chunks/18dczy9ylt2s_.js +1 -0
  52. package/out/_next/static/chunks/18xs_kvsaolb0.js +1 -0
  53. package/out/_next/static/chunks/19016f8-ry0z6.js +1 -0
  54. package/out/_next/static/chunks/1_6oejyxj39li.js +1 -0
  55. package/out/_next/static/chunks/1_aon8nz9p1fr.js +1 -0
  56. package/out/_next/static/chunks/1_qzlkuxukhpq.js +779 -0
  57. package/out/_next/static/chunks/1akaj5rhgitn3.js +1 -0
  58. package/out/_next/static/chunks/1bvl1ws7b_3gn.js +1 -0
  59. package/out/_next/static/chunks/1cdbk6kxyr1c9.js +1 -0
  60. package/out/_next/static/chunks/1fbjkk55uu4_g.js +1 -0
  61. package/out/_next/static/chunks/1furcfsgrw_3g.js +1 -0
  62. package/out/_next/static/chunks/1g0-f1g3gn_rs.js +1 -0
  63. package/out/_next/static/chunks/1g7emwu85bifo.js +557 -0
  64. package/out/_next/static/chunks/{37vzwr3ciejf1.js → 1gs-5722l4u59.js} +1 -1
  65. package/out/_next/static/chunks/1gt4kh0_xmigy.js +1 -0
  66. package/out/_next/static/chunks/1h8xzuuhhglu9.js +1 -0
  67. package/out/_next/static/chunks/1hatz-jlztrn0.js +1 -0
  68. package/out/_next/static/chunks/1iioifo7i0t0_.js +1 -0
  69. package/out/_next/static/chunks/{0impkpmxx3ttp.js → 1iiz7jqgj20z0.js} +1 -1
  70. package/out/_next/static/chunks/1kujmd5n0j9nk.js +1 -0
  71. package/out/_next/static/chunks/{2kazjq29jeamx.js → 1ltux4lwz7muf.js} +160 -372
  72. package/out/_next/static/chunks/1m_buecgcq67j.js +740 -0
  73. package/out/_next/static/chunks/1n9sy0yt5d2vq.js +1 -0
  74. package/out/_next/static/chunks/1p1gz6dseck--.js +1 -0
  75. package/out/_next/static/chunks/1p1xtsfwvpuqo.js +1 -0
  76. package/out/_next/static/chunks/1p8f6okk2ewbz.js +1 -0
  77. package/out/_next/static/chunks/1qg_etglhvp9h.js +740 -0
  78. package/out/_next/static/chunks/1th_t5ujeqlkf.js +1 -0
  79. package/out/_next/static/chunks/1thr-mdzbu96v.js +1 -0
  80. package/out/_next/static/chunks/1tta1a064979p.js +1 -0
  81. package/out/_next/static/chunks/1u_riwm0nfww7.js +1 -0
  82. package/out/_next/static/chunks/1ua15kzid0_8p.js +2560 -0
  83. package/out/_next/static/chunks/1uu-rt_8p1edp.js +2712 -0
  84. package/out/_next/static/chunks/1uu93wuxigx4k.js +1 -0
  85. package/out/_next/static/chunks/{1flb8adpj6_2o.js → 1xpwp4m1tqugp.js} +1 -1
  86. package/out/_next/static/chunks/1ynju1jqfrcv0.js +1 -0
  87. package/out/_next/static/chunks/1zfojlgb15okk.js +1 -0
  88. package/out/_next/static/chunks/1zj8x5wbgnzz-.js +1 -0
  89. package/out/_next/static/chunks/1zl6t15gh34nn.js +1 -0
  90. package/out/_next/static/chunks/{1thjncpj7u6pq.js → 223vrr_4sfhsj.js} +1 -1
  91. package/out/_next/static/chunks/22cr2b04btguf.js +1 -0
  92. package/out/_next/static/chunks/242xhzxxetctz.js +1 -0
  93. package/out/_next/static/chunks/24essz5mmvx-6.js +1 -0
  94. package/out/_next/static/chunks/256k1jw1m--l7.js +146 -0
  95. package/out/_next/static/chunks/259obyrpxcv6r.js +1 -0
  96. package/out/_next/static/chunks/26v9yqicofqba.js +1 -0
  97. package/out/_next/static/chunks/290d93hmm_e8b.js +1 -0
  98. package/out/_next/static/chunks/2_2fk7iddrs43.js +1 -0
  99. package/out/_next/static/chunks/{00k_j_r7bv_eb.js → 2bjlls8-qe05r.js} +9 -9
  100. package/out/_next/static/chunks/2ckd7f1wbfod-.js +1 -0
  101. package/out/_next/static/chunks/{163fa70v4mgxj.js → 2d6hru4qo23tt.js} +1 -1
  102. package/out/_next/static/chunks/2ejvntxtvf5o9.js +1 -0
  103. package/out/_next/static/chunks/2f7_3tzf7xhps.js +1 -0
  104. package/out/_next/static/chunks/2gxd_o1g89_bv.js +1 -0
  105. package/out/_next/static/chunks/2hd2txb4-m9k1.js +1 -0
  106. package/out/_next/static/chunks/2hpxou_cnp4f_.js +1 -0
  107. package/out/_next/static/chunks/2izioctrfc0s5.js +1 -0
  108. package/out/_next/static/chunks/2jhnk4h4n0udv.js +1 -0
  109. package/out/_next/static/chunks/2jpkhkk9zi8-f.js +1 -0
  110. package/out/_next/static/chunks/2kpet_l1kq2sx.js +1 -0
  111. package/out/_next/static/chunks/2mdbvf1b5h00_.css +3 -0
  112. package/out/_next/static/chunks/2nck5w4c7leb7.js +1 -0
  113. package/out/_next/static/chunks/2our10fwtj87e.js +1 -0
  114. package/out/_next/static/chunks/2qq3uzsbiicw3.js +1194 -0
  115. package/out/_next/static/chunks/2qqqpu0ahfdda.js +1 -0
  116. package/out/_next/static/chunks/2u-f7mmxvk8wj.js +1 -0
  117. package/out/_next/static/chunks/2ue1wo4ryk87z.js +1 -0
  118. package/out/_next/static/chunks/2uk-vwlxe9-xr.js +1 -0
  119. package/out/_next/static/chunks/2ur5-lxdvv1jm.js +1 -0
  120. package/out/_next/static/chunks/2veqsohwfhfqc.js +1 -0
  121. package/out/_next/static/chunks/2vqlv9wnewhu9.js +1 -0
  122. package/out/_next/static/chunks/{1zvc1tv--w8nn.js → 2wzshintp5lf8.js} +1 -1
  123. package/out/_next/static/chunks/2x-00glogc485.js +1 -0
  124. package/out/_next/static/chunks/2yfxy0f5fqs4o.js +1 -0
  125. package/out/_next/static/chunks/2z88mt3ixktu3.js +1 -0
  126. package/out/_next/static/chunks/2z_jn9ud28fk7.js +1 -0
  127. package/out/_next/static/chunks/3-eswqjobiqk1.js +1 -0
  128. package/out/_next/static/chunks/30-tbi7pys6fp.js +4 -0
  129. package/out/_next/static/chunks/30c-nsedy_ce0.js +1 -0
  130. package/out/_next/static/chunks/31u5lbu1vxznh.js +1 -0
  131. package/out/_next/static/chunks/{2feca0xcipcyt.js → 32ahba5ezp467.js} +156 -156
  132. package/out/_next/static/chunks/337hn35kts7ud.js +1 -0
  133. package/out/_next/static/chunks/33dgpebv-tf73.js +1 -0
  134. package/out/_next/static/chunks/36jkdhq6kb-cf.js +1 -0
  135. package/out/_next/static/chunks/37epa8fz59vba.js +1166 -0
  136. package/out/_next/static/chunks/3833xfnz0a-ub.js +1 -0
  137. package/out/_next/static/chunks/38awrh_qxn22k.js +1 -0
  138. package/out/_next/static/chunks/{0wrm9jr-9bw0e.js → 38x3c1ra5slhe.js} +383 -913
  139. package/out/_next/static/chunks/39idqlqlcp5b9.js +1 -0
  140. package/out/_next/static/chunks/{2a3spdq-m8drh.js → 3_gku1pwluoo0.js} +1 -1
  141. package/out/_next/static/chunks/3_mu-4rdjajna.js +1450 -0
  142. package/out/_next/static/chunks/3coacc4-g-g5c.js +1 -0
  143. package/out/_next/static/chunks/3e00fzdfkclzq.js +1 -0
  144. package/out/_next/static/chunks/3e8fmlq0k5wkg.js +1 -0
  145. package/out/_next/static/chunks/3e9tzyrt4_98z.js +1 -0
  146. package/out/_next/static/chunks/3edelqkq92pil.js +1 -0
  147. package/out/_next/static/chunks/3figbil1t4ssj.js +593 -0
  148. package/out/_next/static/chunks/3gimb3z_mteou.js +1 -0
  149. package/out/_next/static/chunks/{2p2vv6cc9i-3q.js → 3idaz_s77e-j_.js} +9 -9
  150. package/out/_next/static/chunks/3j-4wuhs5weba.js +1 -0
  151. package/out/_next/static/chunks/3jjfnwvybayy7.js +1 -0
  152. package/out/_next/static/chunks/3jwm5dfk_78gc.js +1 -0
  153. package/out/_next/static/chunks/3k9d4ylc3li2t.js +1352 -0
  154. package/out/_next/static/chunks/3l3_0ack3gy4k.js +1 -0
  155. package/out/_next/static/chunks/3lwhs5ja7tun3.js +1 -0
  156. package/out/_next/static/chunks/3m6nmp2dca6un.js +1342 -0
  157. package/out/_next/static/chunks/3mbnfpufs2-7e.js +7 -0
  158. package/out/_next/static/chunks/3mcd08gmt038z.js +1 -0
  159. package/out/_next/static/chunks/3mt5th7b1i_u9.js +1 -0
  160. package/out/_next/static/chunks/3ne77mjdz2y7o.js +1 -0
  161. package/out/_next/static/chunks/3puhrqtujktyv.js +1 -0
  162. package/out/_next/static/chunks/3rdifucupcgkg.js +1 -0
  163. package/out/_next/static/chunks/3riekaxl3uxfb.js +1195 -0
  164. package/out/_next/static/chunks/3sdoskq_buttj.js +1 -0
  165. package/out/_next/static/chunks/3tg-ma9tv9xu4.js +1 -0
  166. package/out/_next/static/chunks/3tm-pqpmq_ppw.js +1 -0
  167. package/out/_next/static/chunks/3w9go565cjhq3.js +1636 -0
  168. package/out/_next/static/chunks/3wi9gzq2mtr_q.js +8 -0
  169. package/out/_next/static/chunks/3xagd_2_9zft2.js +1 -0
  170. package/out/_next/static/chunks/3xsq_anpad-fb.js +1 -0
  171. package/out/_next/static/chunks/3ycv2qq7vpbua.js +1 -0
  172. package/out/_next/static/chunks/3z84au-mitjjw.js +1 -0
  173. package/out/_next/static/chunks/4030dhur2h70-.js +1 -0
  174. package/out/_next/static/chunks/40ffffml4h_3r.js +4 -0
  175. package/out/_next/static/chunks/{3-shckrcpvbxu.js → 41wt50z9tx9cx.js} +108 -711
  176. package/out/_next/static/chunks/431slrqh0wa0g.js +1 -0
  177. package/out/_next/static/chunks/43s_lbd1i2krj.js +1 -0
  178. package/out/_next/static/chunks/{0-2y-_oomza2l.js → 44nxswtahaq4w.js} +18 -18
  179. package/out/_next/static/chunks/45bwefvdpztfs.js +1 -0
  180. package/out/_next/static/chunks/{turbopack-0sgd6pfbe1fy6.js → turbopack-19105pdhzxp1x.js} +1 -1
  181. package/out/_not-found/__next._full.txt +9 -9
  182. package/out/_not-found/__next._head.txt +4 -4
  183. package/out/_not-found/__next._index.txt +4 -4
  184. package/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
  185. package/out/_not-found/__next._not-found.txt +3 -3
  186. package/out/_not-found/__next._tree.txt +2 -2
  187. package/out/_not-found.html +1 -1
  188. package/out/_not-found.txt +9 -9
  189. package/out/index.html +1 -1
  190. package/out/index.txt +11 -11
  191. package/package.json +5 -4
  192. package/out/_next/static/chunks/068j6934u8j16.js +0 -1
  193. package/out/_next/static/chunks/09e4adtr6w0xe.js +0 -1
  194. package/out/_next/static/chunks/0_rf76jneiwal.js +0 -176
  195. package/out/_next/static/chunks/0aznt7717miff.js +0 -1
  196. package/out/_next/static/chunks/0cu-q5q3a7uf3.js +0 -1
  197. package/out/_next/static/chunks/0fskcfh9vbhtv.js +0 -1
  198. package/out/_next/static/chunks/0o_tpe5tlugtr.js +0 -3
  199. package/out/_next/static/chunks/0pj9pajm2xz97.css +0 -3
  200. package/out/_next/static/chunks/0ufbyo1x3qkmo.js +0 -1
  201. package/out/_next/static/chunks/0wwcfw8i3j_zx.js +0 -1
  202. package/out/_next/static/chunks/0ys9-ozuluawt.js +0 -1
  203. package/out/_next/static/chunks/1-61zh4waha61.js +0 -1
  204. package/out/_next/static/chunks/10r_824wzt8hj.js +0 -1
  205. package/out/_next/static/chunks/11v6j6q59u-f_.js +0 -1
  206. package/out/_next/static/chunks/123xxske5c9na.js +0 -1
  207. package/out/_next/static/chunks/13isnf0--pmx1.js +0 -1
  208. package/out/_next/static/chunks/157d9euci08yu.js +0 -1
  209. package/out/_next/static/chunks/18u58lorfahxi.js +0 -4
  210. package/out/_next/static/chunks/1_aahautsz2v_.js +0 -1
  211. package/out/_next/static/chunks/1o1d0p-v1z8ty.js +0 -1
  212. package/out/_next/static/chunks/1vdjn0pkoyypn.js +0 -1
  213. package/out/_next/static/chunks/1yehxf-fmeicg.js +0 -1
  214. package/out/_next/static/chunks/1zx2q-r32thv1.js +0 -4
  215. package/out/_next/static/chunks/2-sjjedfr0kfq.js +0 -1
  216. package/out/_next/static/chunks/25b9x-li-tvk2.js +0 -1
  217. package/out/_next/static/chunks/2aelw3far6rii.js +0 -1
  218. package/out/_next/static/chunks/2aor7m-wbis85.js +0 -1
  219. package/out/_next/static/chunks/2fh-_9b6tqhvb.js +0 -1
  220. package/out/_next/static/chunks/2g5gecypj0rqe.js +0 -1
  221. package/out/_next/static/chunks/2szdcpl41-kzv.js +0 -1
  222. package/out/_next/static/chunks/2u6shh3oeycm-.js +0 -1
  223. package/out/_next/static/chunks/2unhhuv0arlcv.js +0 -1
  224. package/out/_next/static/chunks/310uz81hnnzsu.js +0 -1
  225. package/out/_next/static/chunks/3i3gbhccmhu7j.js +0 -210
  226. package/out/_next/static/chunks/3mqy-84_ul3t2.js +0 -1
  227. package/out/_next/static/chunks/3nz-dh9d7cehk.js +0 -1
  228. package/out/_next/static/chunks/3pufs8g4ui943.js +0 -1
  229. package/out/_next/static/chunks/3t06schbtqonl.js +0 -1
  230. package/out/_next/static/chunks/3v3-7fio3nw_t.js +0 -1
  231. package/out/_next/static/chunks/3v5ha25nxo43j.js +0 -1
  232. package/out/_next/static/chunks/3zskk1hxu3-_o.js +0 -1
  233. /package/out/_next/static/{yttuijl-0Cn9k8uTCfhIM → M9ZSIaKJeBgkjz1qktYio}/_buildManifest.js +0 -0
  234. /package/out/_next/static/{yttuijl-0Cn9k8uTCfhIM → M9ZSIaKJeBgkjz1qktYio}/_clientMiddlewareManifest.js +0 -0
  235. /package/out/_next/static/{yttuijl-0Cn9k8uTCfhIM → M9ZSIaKJeBgkjz1qktYio}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66749,46862,63132,72161,5785,e=>{"use strict";var t,i,s,r,n,a,o,h,l,d,c,u,p,_,g,v,f,m,b,y,P,C,M,S,O,T,R,E,I,D,k,A,w,x,B,N,F,L,G,U,W,X,q,z,V,j,Y,H,K,Z,$,Q,J,ee,et,ei,es,er,en,ea,eo,eh,el,ed,ec,eu,ep,e_,eg,ev=e.i(65740),ef=e.i(23240),em=e.i(36395),eb=e.i(99267),ey=e.i(45707);class eP{constructor(){this._count=0,this._data={}}copyFrom(e){this.clear(),e.forEach((e,t)=>this.add(e,t))}get(e){let t=this._data[e];if(void 0!==t)return t}getOrAddWithFactory(e,t){let i=this.get(e);return void 0!==i||(i=t(e))&&this.add(e,i),i}getOrAdd(e,t){let i=this.get(e);return void 0!==i?i:(this.add(e,t),t)}contains(e){return void 0!==this._data[e]}add(e,t){return void 0===this._data[e]&&(this._data[e]=t,++this._count,!0)}set(e,t){return void 0!==this._data[e]&&(this._data[e]=t,!0)}getAndRemove(e){let t=this.get(e);return void 0!==t?(delete this._data[e],--this._count,t):null}remove(e){return!!this.contains(e)&&(delete this._data[e],--this._count,!0)}clear(){this._data={},this._count=0}get count(){return this._count}forEach(e){for(let t in this._data){let i=this._data[t];e(t,i)}}first(e){for(let t in this._data){let i=this._data[t],s=e(t,i);if(s)return s}return null}}var eC=e.i(76312),eM=e.i(96265),eS=e.i(10272),eO=e.i(37143),eT=e.i(70653),eR=e.i(80871);function eE(e){e.push("vCameraColorCurveNeutral","vCameraColorCurvePositive","vCameraColorCurveNegative")}class eI{constructor(){this._dirty=!0,this._tempColor=new eT.Color4(0,0,0,0),this._globalCurve=new eT.Color4(0,0,0,0),this._highlightsCurve=new eT.Color4(0,0,0,0),this._midtonesCurve=new eT.Color4(0,0,0,0),this._shadowsCurve=new eT.Color4(0,0,0,0),this._positiveCurve=new eT.Color4(0,0,0,0),this._negativeCurve=new eT.Color4(0,0,0,0),this._globalHue=30,this._globalDensity=0,this._globalSaturation=0,this._globalExposure=0,this._highlightsHue=30,this._highlightsDensity=0,this._highlightsSaturation=0,this._highlightsExposure=0,this._midtonesHue=30,this._midtonesDensity=0,this._midtonesSaturation=0,this._midtonesExposure=0,this._shadowsHue=30,this._shadowsDensity=0,this._shadowsSaturation=0,this._shadowsExposure=0}get globalHue(){return this._globalHue}set globalHue(e){this._globalHue=e,this._dirty=!0}get globalDensity(){return this._globalDensity}set globalDensity(e){this._globalDensity=e,this._dirty=!0}get globalSaturation(){return this._globalSaturation}set globalSaturation(e){this._globalSaturation=e,this._dirty=!0}get globalExposure(){return this._globalExposure}set globalExposure(e){this._globalExposure=e,this._dirty=!0}get highlightsHue(){return this._highlightsHue}set highlightsHue(e){this._highlightsHue=e,this._dirty=!0}get highlightsDensity(){return this._highlightsDensity}set highlightsDensity(e){this._highlightsDensity=e,this._dirty=!0}get highlightsSaturation(){return this._highlightsSaturation}set highlightsSaturation(e){this._highlightsSaturation=e,this._dirty=!0}get highlightsExposure(){return this._highlightsExposure}set highlightsExposure(e){this._highlightsExposure=e,this._dirty=!0}get midtonesHue(){return this._midtonesHue}set midtonesHue(e){this._midtonesHue=e,this._dirty=!0}get midtonesDensity(){return this._midtonesDensity}set midtonesDensity(e){this._midtonesDensity=e,this._dirty=!0}get midtonesSaturation(){return this._midtonesSaturation}set midtonesSaturation(e){this._midtonesSaturation=e,this._dirty=!0}get midtonesExposure(){return this._midtonesExposure}set midtonesExposure(e){this._midtonesExposure=e,this._dirty=!0}get shadowsHue(){return this._shadowsHue}set shadowsHue(e){this._shadowsHue=e,this._dirty=!0}get shadowsDensity(){return this._shadowsDensity}set shadowsDensity(e){this._shadowsDensity=e,this._dirty=!0}get shadowsSaturation(){return this._shadowsSaturation}set shadowsSaturation(e){this._shadowsSaturation=e,this._dirty=!0}get shadowsExposure(){return this._shadowsExposure}set shadowsExposure(e){this._shadowsExposure=e,this._dirty=!0}getClassName(){return"ColorCurves"}_getColorGradingDataToRef(e,t,i,s,r){null!=e&&(e=eI._Clamp(e,0,360),t=eI._Clamp(t,-100,100),i=eI._Clamp(i,-100,100),s=eI._Clamp(s,-100,100),t=.5*eI._ApplyColorGradingSliderNonlinear(t),s=eI._ApplyColorGradingSliderNonlinear(s),t<0&&(t*=-1,e=(e+180)%360),eI._FromHSBToRef(e,t,50+.25*s,r),r.scaleToRef(2,r),r.a=1+.01*i)}static _ApplyColorGradingSliderNonlinear(e){let t=Math.abs(e/=100);return t=Math.pow(t,2),e<0&&(t*=-1),t*=100}static _FromHSBToRef(e,t,i,s){let r=eI._Clamp(e,0,360),n=eI._Clamp(t/100,0,1),a=eI._Clamp(i/100,0,1);if(0===n)s.r=a,s.g=a,s.b=a;else{let e=Math.floor(r/=60),t=r-e,i=a*(1-n),o=a*(1-n*t),h=a*(1-n*(1-t));switch(e){case 0:s.r=a,s.g=h,s.b=i;break;case 1:s.r=o,s.g=a,s.b=i;break;case 2:s.r=i,s.g=a,s.b=h;break;case 3:s.r=i,s.g=o,s.b=a;break;case 4:s.r=h,s.g=i,s.b=a;break;default:s.r=a,s.g=i,s.b=o}}s.a=1}static _Clamp(e,t,i){return Math.min(Math.max(e,t),i)}clone(){return eR.SerializationHelper.Clone(()=>new eI,this)}serialize(){return eR.SerializationHelper.Serialize(this)}_bind(e,t="vCameraColorCurvePositive",i="vCameraColorCurveNeutral",s="vCameraColorCurveNegative"){this._dirty&&(this._dirty=!1,this._getColorGradingDataToRef(this._globalHue,this._globalDensity,this._globalSaturation,this._globalExposure,this._globalCurve),this._getColorGradingDataToRef(this._highlightsHue,this._highlightsDensity,this._highlightsSaturation,this._highlightsExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._highlightsCurve),this._getColorGradingDataToRef(this._midtonesHue,this._midtonesDensity,this._midtonesSaturation,this._midtonesExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._midtonesCurve),this._getColorGradingDataToRef(this._shadowsHue,this._shadowsDensity,this._shadowsSaturation,this._shadowsExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._shadowsCurve),this._highlightsCurve.subtractToRef(this._midtonesCurve,this._positiveCurve),this._midtonesCurve.subtractToRef(this._shadowsCurve,this._negativeCurve)),e&&(e.setFloat4(t,this._positiveCurve.r,this._positiveCurve.g,this._positiveCurve.b,this._positiveCurve.a),e.setFloat4(i,this._midtonesCurve.r,this._midtonesCurve.g,this._midtonesCurve.b,this._midtonesCurve.a),e.setFloat4(s,this._negativeCurve.r,this._negativeCurve.g,this._negativeCurve.b,this._negativeCurve.a))}}eI.PrepareUniforms=eE,(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_globalHue",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_globalDensity",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_globalSaturation",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_globalExposure",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_highlightsHue",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_highlightsDensity",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_highlightsSaturation",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_highlightsExposure",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_midtonesHue",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_midtonesDensity",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_midtonesSaturation",void 0),(0,eS.__decorate)([(0,eO.serialize)()],eI.prototype,"_midtonesExposure",void 0);var eD=e.i(68179);class ek{constructor(){this.colorCurves=new eI,this._colorCurvesEnabled=!1,this._colorGradingEnabled=!1,this._colorGradingWithGreenDepth=!0,this._colorGradingBGR=!0,this._exposure=1,this._toneMappingEnabled=!1,this._toneMappingType=ek.TONEMAPPING_STANDARD,this._contrast=1,this.vignetteStretch=0,this.vignetteCenterX=0,this.vignetteCenterY=0,this.vignetteWeight=1.5,this.vignetteColor=new eT.Color4(0,0,0,0),this.vignetteCameraFov=.5,this._vignetteBlendMode=ek.VIGNETTEMODE_MULTIPLY,this._vignetteEnabled=!1,this._ditheringEnabled=!1,this._ditheringIntensity=1/255,this._skipFinalColorClamp=!1,this._applyByPostProcess=!1,this._isEnabled=!0,this.outputTextureWidth=0,this.outputTextureHeight=0,this.onUpdateParameters=new eb.Observable}get colorCurvesEnabled(){return this._colorCurvesEnabled}set colorCurvesEnabled(e){this._colorCurvesEnabled!==e&&(this._colorCurvesEnabled=e,this._updateParameters())}get colorGradingTexture(){return this._colorGradingTexture}set colorGradingTexture(e){this._colorGradingTexture!==e&&(this._colorGradingTexture=e,this._updateParameters())}get colorGradingEnabled(){return this._colorGradingEnabled}set colorGradingEnabled(e){this._colorGradingEnabled!==e&&(this._colorGradingEnabled=e,this._updateParameters())}get colorGradingWithGreenDepth(){return this._colorGradingWithGreenDepth}set colorGradingWithGreenDepth(e){this._colorGradingWithGreenDepth!==e&&(this._colorGradingWithGreenDepth=e,this._updateParameters())}get colorGradingBGR(){return this._colorGradingBGR}set colorGradingBGR(e){this._colorGradingBGR!==e&&(this._colorGradingBGR=e,this._updateParameters())}get exposure(){return this._exposure}set exposure(e){this._exposure!==e&&(this._exposure=e,this._updateParameters())}get toneMappingEnabled(){return this._toneMappingEnabled}set toneMappingEnabled(e){this._toneMappingEnabled!==e&&(this._toneMappingEnabled=e,this._updateParameters())}get toneMappingType(){return this._toneMappingType}set toneMappingType(e){this._toneMappingType!==e&&(this._toneMappingType=e,this._updateParameters())}get contrast(){return this._contrast}set contrast(e){this._contrast!==e&&(this._contrast=e,this._updateParameters())}get vignetteCentreY(){return this.vignetteCenterY}set vignetteCentreY(e){this.vignetteCenterY=e}get vignetteCentreX(){return this.vignetteCenterX}set vignetteCentreX(e){this.vignetteCenterX=e}get vignetteBlendMode(){return this._vignetteBlendMode}set vignetteBlendMode(e){this._vignetteBlendMode!==e&&(this._vignetteBlendMode=e,this._updateParameters())}get vignetteEnabled(){return this._vignetteEnabled}set vignetteEnabled(e){this._vignetteEnabled!==e&&(this._vignetteEnabled=e,this._updateParameters())}get ditheringEnabled(){return this._ditheringEnabled}set ditheringEnabled(e){this._ditheringEnabled!==e&&(this._ditheringEnabled=e,this._updateParameters())}get ditheringIntensity(){return this._ditheringIntensity}set ditheringIntensity(e){this._ditheringIntensity!==e&&(this._ditheringIntensity=e,this._updateParameters())}get skipFinalColorClamp(){return this._skipFinalColorClamp}set skipFinalColorClamp(e){this._skipFinalColorClamp!==e&&(this._skipFinalColorClamp=e,this._updateParameters())}get applyByPostProcess(){return this._applyByPostProcess}set applyByPostProcess(e){this._applyByPostProcess!==e&&(this._applyByPostProcess=e,this._updateParameters())}get isEnabled(){return this._isEnabled}set isEnabled(e){this._isEnabled!==e&&(this._isEnabled=e,this._updateParameters())}_updateParameters(){this.onUpdateParameters.notifyObservers(this)}getClassName(){return"ImageProcessingConfiguration"}prepareDefines(e,t=!1){if(t!==this.applyByPostProcess||!this._isEnabled){e.VIGNETTE=!1,e.TONEMAPPING=0,e.CONTRAST=!1,e.EXPOSURE=!1,e.COLORCURVES=!1,e.COLORGRADING=!1,e.COLORGRADING3D=!1,e.DITHER=!1,e.IMAGEPROCESSING=!1,e.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,e.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess&&this._isEnabled;return}if(e.VIGNETTE=this.vignetteEnabled,e.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===ek._VIGNETTEMODE_MULTIPLY,e.VIGNETTEBLENDMODEOPAQUE=!e.VIGNETTEBLENDMODEMULTIPLY,this._toneMappingEnabled)switch(this._toneMappingType){case ek.TONEMAPPING_KHR_PBR_NEUTRAL:e.TONEMAPPING=3;break;case ek.TONEMAPPING_ACES:e.TONEMAPPING=2;break;default:e.TONEMAPPING=1}else e.TONEMAPPING=0;e.CONTRAST=1!==this.contrast,e.EXPOSURE=1!==this.exposure,e.COLORCURVES=this.colorCurvesEnabled&&!!this.colorCurves,e.COLORGRADING=this.colorGradingEnabled&&!!this.colorGradingTexture,e.COLORGRADING?e.COLORGRADING3D=this.colorGradingTexture.is3D:e.COLORGRADING3D=!1,e.SAMPLER3DGREENDEPTH=this.colorGradingWithGreenDepth,e.SAMPLER3DBGRMAP=this.colorGradingBGR,e.DITHER=this._ditheringEnabled,e.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess,e.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,e.IMAGEPROCESSING=e.VIGNETTE||!!e.TONEMAPPING||e.CONTRAST||e.EXPOSURE||e.COLORCURVES||e.COLORGRADING||e.DITHER}isReady(){return!this.colorGradingEnabled||!this.colorGradingTexture||this.colorGradingTexture.isReady()}bind(e,t){if(this._colorCurvesEnabled&&this.colorCurves&&function(e,t,i="vCameraColorCurvePositive",s="vCameraColorCurveNeutral",r="vCameraColorCurveNegative"){e._bind(t,i,s,r)}(this.colorCurves,e),this._vignetteEnabled||this._ditheringEnabled){let i=1/(this.outputTextureWidth||e.getEngine().getRenderWidth()),s=1/(this.outputTextureHeight||e.getEngine().getRenderHeight());if(e.setFloat2("vInverseScreenSize",i,s),this._ditheringEnabled&&e.setFloat("ditherIntensity",.5*this._ditheringIntensity),this._vignetteEnabled){let r=null!=t?t:s/i,n=Math.tan(.5*this.vignetteCameraFov),a=n*r,o=Math.sqrt(a*n);a=(0,eD.Mix)(a,o,this.vignetteStretch),n=(0,eD.Mix)(n,o,this.vignetteStretch),e.setFloat4("vignetteSettings1",a,n,-a*this.vignetteCenterX,-n*this.vignetteCenterY);let h=-2*this.vignetteWeight;e.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,h)}}if(e.setFloat("exposureLinear",this.exposure),e.setFloat("contrast",this.contrast),this.colorGradingTexture){e.setTexture("txColorTransform",this.colorGradingTexture);let t=this.colorGradingTexture.getSize().height;e.setFloat4("colorTransformSettings",(t-1)/t,.5/t,t,this.colorGradingTexture.level)}}clone(){return eR.SerializationHelper.Clone(()=>new ek,this)}serialize(){return eR.SerializationHelper.Serialize(this)}static get VIGNETTEMODE_MULTIPLY(){return this._VIGNETTEMODE_MULTIPLY}static get VIGNETTEMODE_OPAQUE(){return this._VIGNETTEMODE_OPAQUE}}ek.TONEMAPPING_STANDARD=0,ek.TONEMAPPING_ACES=1,ek.TONEMAPPING_KHR_PBR_NEUTRAL=2,ek.PrepareUniforms=function(e,t){t.EXPOSURE&&e.push("exposureLinear"),t.CONTRAST&&e.push("contrast"),t.COLORGRADING&&e.push("colorTransformSettings"),(t.VIGNETTE||t.DITHER)&&e.push("vInverseScreenSize"),t.VIGNETTE&&(e.push("vignetteSettings1"),e.push("vignetteSettings2")),t.COLORCURVES&&eE(e),t.DITHER&&e.push("ditherIntensity")},ek.PrepareSamplers=function(e,t){t.COLORGRADING&&e.push("txColorTransform")},ek._VIGNETTEMODE_MULTIPLY=0,ek._VIGNETTEMODE_OPAQUE=1,(0,eS.__decorate)([(0,eO.serializeAsColorCurves)()],ek.prototype,"colorCurves",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_colorCurvesEnabled",void 0),(0,eS.__decorate)([(0,eO.serializeAsTexture)("colorGradingTexture")],ek.prototype,"_colorGradingTexture",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_colorGradingEnabled",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_colorGradingWithGreenDepth",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_colorGradingBGR",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_exposure",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_toneMappingEnabled",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_toneMappingType",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_contrast",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"vignetteStretch",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"vignetteCenterX",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"vignetteCenterY",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"vignetteWeight",void 0),(0,eS.__decorate)([(0,eO.serializeAsColor4)()],ek.prototype,"vignetteColor",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"vignetteCameraFov",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_vignetteBlendMode",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_vignetteEnabled",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_ditheringEnabled",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_ditheringIntensity",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_skipFinalColorClamp",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_applyByPostProcess",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"_isEnabled",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"outputTextureWidth",void 0),(0,eS.__decorate)([(0,eO.serialize)()],ek.prototype,"outputTextureHeight",void 0),e.s(["ImageProcessingConfiguration",0,ek],46862);var eA=e.i(33855),ew=e.i(50107);class ex{constructor(e,t,i,s,r,n){this.source=e,this.pointerX=t,this.pointerY=i,this.meshUnderPointer=s,this.sourceEvent=r,this.additionalData=n}static CreateNew(e,t,i){let s=e.getScene();return new ex(e,s.pointerX,s.pointerY,s.meshUnderPointer||e,t,i)}static CreateNewFromSprite(e,t,i,s){return new ex(e,t.pointerX,t.pointerY,t.meshUnderPointer,i,s)}static CreateNewFromScene(e,t){return new ex(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)}static CreateNewFromPrimitive(e,t,i,s){return new ex(e,t.x,t.y,null,i,s)}}var eB=e.i(35407);class eN{constructor(e){this._vertexBuffers={},this._activePostProcesses=[],this.onBeforeRenderObservable=new eb.Observable,this._scene=e}_prepareBuffers(){if(this._vertexBuffers[eB.VertexBuffer.PositionKind])return;let e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[eB.VertexBuffer.PositionKind]=new eB.VertexBuffer(this._scene.getEngine(),e,eB.VertexBuffer.PositionKind,!1,!1,2),this._buildIndexBuffer()}_buildIndexBuffer(){let e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)}_getActivePostProcesses(e){let t=this._activePostProcesses;t.length=0;for(let i=0;i<e.length;i++){let s=e[i];s&&t.push(s)}return t}_rebuild(){let e=this._vertexBuffers[eB.VertexBuffer.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())}_prepareFrame(e=null,t=null){let i=this._scene.activeCamera;return!!i&&!!(t=t||this._getActivePostProcesses(i._postProcesses))&&0!==t.length&&!!this._scene.postProcessesEnabled&&(t[0].activate(i,e,null!=t),!0)}directRender(e,t=null,i=!1,s=0,r=0,n=!1,a=e.length){let o=this._scene.getEngine();for(let h=0;h<a;h++){h<e.length-1?e[h+1].activate(this._scene.activeCamera||this._scene,t?.texture):(t?o.bindFramebuffer(t,s,void 0,void 0,i,r):n||o.restoreDefaultFramebuffer(),o._debugInsertMarker?.(`post process ${e[h].name} output`));let a=e[h],l=a.apply();l&&(a.onBeforeRenderObservable.notifyObservers(l),this._prepareBuffers(),o.bindBuffers(this._vertexBuffers,this._indexBuffer,l),o.drawElementsType(0,0,6),a.onAfterRenderObservable.notifyObservers(l))}o.setDepthBuffer(!0),o.setDepthWrite(!0)}_finalizeFrame(e,t,i,s,r=!1){let n=this._scene.activeCamera;if(!n||(this.onBeforeRenderObservable.notifyObservers(this),0===(s=s||this._getActivePostProcesses(n._postProcesses)).length||!this._scene.postProcessesEnabled))return;let a=this._scene.getEngine();for(let o=0,h=s.length;o<h;o++){let l=s[o];if(o<h-1?l._outputTexture=s[o+1].activate(n,t?.texture):(t?(a.bindFramebuffer(t,i,void 0,void 0,r),l._outputTexture=t):(a.restoreDefaultFramebuffer(),l._outputTexture=null),a._debugInsertMarker?.(`post process ${s[o].name} output`)),e)break;let d=l.apply();d&&(l.onBeforeRenderObservable.notifyObservers(d),this._prepareBuffers(),a.bindBuffers(this._vertexBuffers,this._indexBuffer,d),a.drawElementsType(0,0,6),l.onAfterRenderObservable.notifyObservers(d))}a.setDepthBuffer(!0),a.setDepthWrite(!0),a.setAlphaMode(0)}dispose(){let e=this._vertexBuffers[eB.VertexBuffer.PositionKind];e&&(e.dispose(),this._vertexBuffers[eB.VertexBuffer.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null)}}e.s(["PostProcessManager",0,eN],63132);var eF=e.i(94160);class eL{set opaqueSortCompareFn(e){e?this._opaqueSortCompareFn=e:this._opaqueSortCompareFn=eL.PainterSortCompare,this._renderOpaque=this._renderOpaqueSorted}set alphaTestSortCompareFn(e){e?this._alphaTestSortCompareFn=e:this._alphaTestSortCompareFn=eL.PainterSortCompare,this._renderAlphaTest=this._renderAlphaTestSorted}set transparentSortCompareFn(e){e?this._transparentSortCompareFn=e:this._transparentSortCompareFn=eL.defaultTransparentSortCompare,this._renderTransparent=this._renderTransparentSorted}constructor(e,t,i=null,s=null,r=null){this.index=e,this._opaqueSubMeshes=new ey.SmartArray(256),this._transparentSubMeshes=new ey.SmartArray(256),this._alphaTestSubMeshes=new ey.SmartArray(256),this._depthOnlySubMeshes=new ey.SmartArray(256),this._particleSystems=new ey.SmartArray(256),this._spriteManagers=new ey.SmartArray(256),this._empty=!0,this._edgesRenderers=new ey.SmartArrayNoDuplicate(16),this.disableDepthPrePass=!1,this._scene=t,this.opaqueSortCompareFn=i,this.alphaTestSortCompareFn=s,this.transparentSortCompareFn=r}render(e,t,i,s,r=!0,n=!0,a=!0,o=!0,h){if(e)return void e(this._opaqueSubMeshes,this._alphaTestSubMeshes,this._transparentSubMeshes,this._depthOnlySubMeshes);let l=this._scene.getEngine();r&&0!==this._depthOnlySubMeshes.length&&(l.setColorWrite(!1),this._renderAlphaTest(this._depthOnlySubMeshes),l.setColorWrite(!0)),n&&0!==this._opaqueSubMeshes.length&&this._renderOpaque(this._opaqueSubMeshes),a&&0!==this._alphaTestSubMeshes.length&&this._renderAlphaTest(this._alphaTestSubMeshes);let d=l.getStencilBuffer();if(l.setStencilBuffer(!1),t&&this._renderSprites(),i&&this._renderParticles(s),this.onBeforeTransparentRendering&&this.onBeforeTransparentRendering(),o&&(h||0!==this._transparentSubMeshes.length||this._scene.useOrderIndependentTransparency)){if(l.setStencilBuffer(d),h)h(this._transparentSubMeshes,this);else if(this._scene.useOrderIndependentTransparency){let e=this._scene.depthPeelingRenderer.render(this._transparentSubMeshes);e.length&&this._renderTransparent(e)}else this._renderTransparent(this._transparentSubMeshes);l.setAlphaMode(0)}if(l.setStencilBuffer(!1),n&&this._edgesRenderers.length){for(let e=0;e<this._edgesRenderers.length;e++)this._edgesRenderers.data[e].render();l.setAlphaMode(0)}l.setStencilBuffer(d)}_renderOpaqueSorted(e){eL._RenderSorted(e,this._opaqueSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderAlphaTestSorted(e){eL._RenderSorted(e,this._alphaTestSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderTransparentSorted(e){eL._RenderSorted(e,this._transparentSortCompareFn,this._scene.activeCamera,!0,this.disableDepthPrePass)}static _RenderSorted(e,t,i,s,r){let n,a=0,o=i?i.globalPosition:eL._ZeroVector;if(s)for(;a<e.length;a++)(n=e.data[a])._alphaIndex=n.getMesh().alphaIndex,n._distanceToCamera=eM.Vector3.Distance(n.getBoundingInfo().boundingSphere.centerWorld,o);let h=e.length===e.data.length?e.data:e.data.slice(0,e.length);t&&h.sort(t);let l=h[0].getMesh().getScene();for(a=0;a<h.length;a++)if(n=h[a],!l._activeMeshesFrozenButKeepClipping||n.isInFrustum(l._frustumPlanes)){if(s){let e=n.getMaterial();if(e&&e.needDepthPrePass&&!r){let t=e.getScene().getEngine();t.setColorWrite(!1),t.setAlphaMode(0),n.render(!1),t.setColorWrite(!0)}}n.render(s)}}static defaultTransparentSortCompare(e,t){return e._alphaIndex>t._alphaIndex?1:e._alphaIndex<t._alphaIndex?-1:eL.backToFrontSortCompare(e,t)}static backToFrontSortCompare(e,t){return e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0}static frontToBackSortCompare(e,t){return e._distanceToCamera<t._distanceToCamera?-1:+(e._distanceToCamera>t._distanceToCamera)}static PainterSortCompare(e,t){let i=e.getMesh(),s=t.getMesh();return i.material&&s.material?i.material.uniqueId-s.material.uniqueId:i.uniqueId-s.uniqueId}prepare(){this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this.prepareSprites(),this._edgesRenderers.reset(),this._empty=!0}prepareSprites(){this._spriteManagers.reset()}dispose(){this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()}dispatch(e,t,i){void 0===t&&(t=e.getMesh()),void 0===i&&(i=e.getMaterial()),null!=i&&(i.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):i.needAlphaTestingForMesh(t)?(i.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(i.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t.isEnabled()&&t.isVisible&&t._edgesRenderer.isEnabled&&this._edgesRenderers.pushNoDuplicate(t._edgesRenderer),this._empty=!1)}dispatchSprites(e){this._spriteManagers.push(e),this._empty=!1}dispatchParticles(e){this._particleSystems.push(e),this._empty=!1}_renderParticles(e){if(0===this._particleSystems.length)return;let t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(let i=0;i<this._particleSystems.length;i++){let s=this._particleSystems.data[i];if(0===(t&&t.layerMask&s.layerMask))continue;let r=s.emitter;r.position&&e&&-1===e.indexOf(r)||this._scene._activeParticles.addCount(s.render(),!1)}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}_renderSprites(){if(!this._scene.spritesEnabled||0===this._spriteManagers.length)return;let e=this._scene.activeCamera;this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);for(let t=0;t<this._spriteManagers.length;t++){let i=this._spriteManagers.data[t];0!==(e&&e.layerMask&i.layerMask)&&i.render()}this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene)}}eL._ZeroVector=eM.Vector3.Zero();class eG{}class eU{get disableDepthPrePass(){return this._disableDepthPrePass}set disableDepthPrePass(e){for(let t of(this._disableDepthPrePass=e,this._renderingGroups))t.disableDepthPrePass=e}get maintainStateBetweenFrames(){return this._maintainStateBetweenFrames}set maintainStateBetweenFrames(e){e!==this._maintainStateBetweenFrames&&(this._maintainStateBetweenFrames=e,this._maintainStateBetweenFrames||this.restoreDispachedFlags())}restoreDispachedFlags(){for(let e of this._scene.meshes)if(e.subMeshes)for(let t of e.subMeshes)t._wasDispatched=!1;if(this._scene.spriteManagers)for(let e of this._scene.spriteManagers)e._wasDispatched=!1;for(let e of this._scene.particleSystems)e._wasDispatched=!1}constructor(e){this._useSceneAutoClearSetup=!1,this._disableDepthPrePass=!1,this._renderingGroups=[],this._autoClearDepthStencil={},this._customOpaqueSortCompareFn={},this._customAlphaTestSortCompareFn={},this._customTransparentSortCompareFn={},this._renderingGroupInfo=new eG,this._maintainStateBetweenFrames=!1,this._scene=e;for(let e=eU.MIN_RENDERINGGROUPS;e<eU.MAX_RENDERINGGROUPS;e++)this._autoClearDepthStencil[e]={autoClear:!0,depth:!0,stencil:!0}}get renderingGroups(){return this._renderingGroups}getRenderingGroup(e){let t=e||0;return this._prepareRenderingGroup(t),this._renderingGroups[t]}_clearDepthStencilBuffer(e=!0,t=!0){this._depthStencilBufferAlreadyCleaned||(this._scene.getEngine().clear(null,!1,e,t),this._depthStencilBufferAlreadyCleaned=!0)}render(e,t,i,s,r=!0,n=!0,a=!0,o=!0,h){let l=this._renderingGroupInfo;if(l.scene=this._scene,l.camera=this._scene.activeCamera,l.renderingManager=this,this._scene.spriteManagers&&s)for(let e=0;e<this._scene.spriteManagers.length;e++){let t=this._scene.spriteManagers[e];this.dispatchSprites(t)}for(let d=eU.MIN_RENDERINGGROUPS;d<eU.MAX_RENDERINGGROUPS;d++){this._depthStencilBufferAlreadyCleaned=d===eU.MIN_RENDERINGGROUPS;let c=this._renderingGroups[d];if(!c||c._empty)continue;let u=1<<d;if(l.renderingGroupId=d,this._scene.onBeforeRenderingGroupObservable.notifyObservers(l,u),eU.AUTOCLEAR){let e=this._useSceneAutoClearSetup?this._scene.getAutoClearDepthStencilSetup(d):this._autoClearDepthStencil[d];e&&e.autoClear&&this._clearDepthStencilBuffer(e.depth,e.stencil)}for(let e of this._scene._beforeRenderingGroupDrawStage)e.action(d);for(let l of(c.render(e,s,i,t,r,n,a,o,h),this._scene._afterRenderingGroupDrawStage))l.action(d);this._scene.onAfterRenderingGroupObservable.notifyObservers(l,u)}}reset(){if(!this.maintainStateBetweenFrames)for(let e=eU.MIN_RENDERINGGROUPS;e<eU.MAX_RENDERINGGROUPS;e++){let t=this._renderingGroups[e];t&&t.prepare()}}resetSprites(){if(!this.maintainStateBetweenFrames)for(let e=eU.MIN_RENDERINGGROUPS;e<eU.MAX_RENDERINGGROUPS;e++){let t=this._renderingGroups[e];t&&t.prepareSprites()}}dispose(){this.freeRenderingGroups(),this._renderingGroups.length=0,this._renderingGroupInfo=null}freeRenderingGroups(){for(let e=eU.MIN_RENDERINGGROUPS;e<eU.MAX_RENDERINGGROUPS;e++){let t=this._renderingGroups[e];t&&t.dispose()}}_prepareRenderingGroup(e){void 0===this._renderingGroups[e]&&(this._renderingGroups[e]=new eL(e,this._scene,this._customOpaqueSortCompareFn[e],this._customAlphaTestSortCompareFn[e],this._customTransparentSortCompareFn[e]),this._renderingGroups[e].disableDepthPrePass=this._disableDepthPrePass)}dispatchSprites(e){this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchSprites(e))}dispatchParticles(e){this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchParticles(e))}dispatch(e,t,i){void 0===t&&(t=e.getMesh()),this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(t.renderingGroupId).dispatch(e,t,i))}setRenderingOrder(e,t=null,i=null,s=null){if(this._customOpaqueSortCompareFn[e]=t,this._customAlphaTestSortCompareFn[e]=i,this._customTransparentSortCompareFn[e]=s,this._renderingGroups[e]){let t=this._renderingGroups[e];t.opaqueSortCompareFn=this._customOpaqueSortCompareFn[e],t.alphaTestSortCompareFn=this._customAlphaTestSortCompareFn[e],t.transparentSortCompareFn=this._customTransparentSortCompareFn[e]}}setRenderingAutoClearDepthStencil(e,t,i=!0,s=!0){this._autoClearDepthStencil[e]={autoClear:t,depth:i,stencil:s}}getAutoClearDepthStencilSetup(e){return this._autoClearDepthStencil[e]}}eU.MAX_RENDERINGGROUPS=4,eU.MIN_RENDERINGGROUPS=0,eU.AUTOCLEAR=!0,e.s(["RenderingManager",0,eU],72161);var eW=e.i(19905),eX=e.i(64545),eq=e.i(81623),ez=e.i(75405),eV=e.i(21222);class ej{constructor(){this.hoverCursor="",this.actions=[],this.isRecursive=!1,this.disposeWhenUnowned=!0}static get HasTriggers(){for(let e in ej.Triggers)if(Object.prototype.hasOwnProperty.call(ej.Triggers,e))return!0;return!1}static get HasPickTriggers(){for(let e in ej.Triggers)if(Object.prototype.hasOwnProperty.call(ej.Triggers,e)){let t=parseInt(e);if(t>=1&&t<=7)return!0}return!1}static HasSpecificTrigger(e){for(let t in ej.Triggers)if(Object.prototype.hasOwnProperty.call(ej.Triggers,t)&&parseInt(t)===e)return!0;return!1}}ej.Triggers={};var eY=e.i(36365);(t=l||(l={}))[t.Generic=0]="Generic",t[t.Keyboard=1]="Keyboard",t[t.Mouse=2]="Mouse",t[t.Touch=3]="Touch",t[t.DualShock=4]="DualShock",t[t.Xbox=5]="Xbox",t[t.Switch=6]="Switch",t[t.DualSense=7]="DualSense",(i=d||(d={}))[i.Horizontal=0]="Horizontal",i[i.Vertical=1]="Vertical",i[i.LeftClick=2]="LeftClick",i[i.MiddleClick=3]="MiddleClick",i[i.RightClick=4]="RightClick",i[i.BrowserBack=5]="BrowserBack",i[i.BrowserForward=6]="BrowserForward",i[i.MouseWheelX=7]="MouseWheelX",i[i.MouseWheelY=8]="MouseWheelY",i[i.MouseWheelZ=9]="MouseWheelZ",i[i.Move=12]="Move",(s=c||(c={}))[s.Horizontal=0]="Horizontal",s[s.Vertical=1]="Vertical",s[s.LeftClick=2]="LeftClick",s[s.MiddleClick=3]="MiddleClick",s[s.RightClick=4]="RightClick",s[s.BrowserBack=5]="BrowserBack",s[s.BrowserForward=6]="BrowserForward",s[s.MouseWheelX=7]="MouseWheelX",s[s.MouseWheelY=8]="MouseWheelY",s[s.MouseWheelZ=9]="MouseWheelZ",s[s.DeltaHorizontal=10]="DeltaHorizontal",s[s.DeltaVertical=11]="DeltaVertical",(r=u||(u={}))[r.Cross=0]="Cross",r[r.Circle=1]="Circle",r[r.Square=2]="Square",r[r.Triangle=3]="Triangle",r[r.L1=4]="L1",r[r.R1=5]="R1",r[r.L2=6]="L2",r[r.R2=7]="R2",r[r.Share=8]="Share",r[r.Options=9]="Options",r[r.L3=10]="L3",r[r.R3=11]="R3",r[r.DPadUp=12]="DPadUp",r[r.DPadDown=13]="DPadDown",r[r.DPadLeft=14]="DPadLeft",r[r.DPadRight=15]="DPadRight",r[r.Home=16]="Home",r[r.TouchPad=17]="TouchPad",r[r.LStickXAxis=18]="LStickXAxis",r[r.LStickYAxis=19]="LStickYAxis",r[r.RStickXAxis=20]="RStickXAxis",r[r.RStickYAxis=21]="RStickYAxis",(n=p||(p={}))[n.Cross=0]="Cross",n[n.Circle=1]="Circle",n[n.Square=2]="Square",n[n.Triangle=3]="Triangle",n[n.L1=4]="L1",n[n.R1=5]="R1",n[n.L2=6]="L2",n[n.R2=7]="R2",n[n.Create=8]="Create",n[n.Options=9]="Options",n[n.L3=10]="L3",n[n.R3=11]="R3",n[n.DPadUp=12]="DPadUp",n[n.DPadDown=13]="DPadDown",n[n.DPadLeft=14]="DPadLeft",n[n.DPadRight=15]="DPadRight",n[n.Home=16]="Home",n[n.TouchPad=17]="TouchPad",n[n.LStickXAxis=18]="LStickXAxis",n[n.LStickYAxis=19]="LStickYAxis",n[n.RStickXAxis=20]="RStickXAxis",n[n.RStickYAxis=21]="RStickYAxis",(a=_||(_={}))[a.A=0]="A",a[a.B=1]="B",a[a.X=2]="X",a[a.Y=3]="Y",a[a.LB=4]="LB",a[a.RB=5]="RB",a[a.LT=6]="LT",a[a.RT=7]="RT",a[a.Back=8]="Back",a[a.Start=9]="Start",a[a.LS=10]="LS",a[a.RS=11]="RS",a[a.DPadUp=12]="DPadUp",a[a.DPadDown=13]="DPadDown",a[a.DPadLeft=14]="DPadLeft",a[a.DPadRight=15]="DPadRight",a[a.Home=16]="Home",a[a.LStickXAxis=17]="LStickXAxis",a[a.LStickYAxis=18]="LStickYAxis",a[a.RStickXAxis=19]="RStickXAxis",a[a.RStickYAxis=20]="RStickYAxis",(o=g||(g={}))[o.B=0]="B",o[o.A=1]="A",o[o.Y=2]="Y",o[o.X=3]="X",o[o.L=4]="L",o[o.R=5]="R",o[o.ZL=6]="ZL",o[o.ZR=7]="ZR",o[o.Minus=8]="Minus",o[o.Plus=9]="Plus",o[o.LS=10]="LS",o[o.RS=11]="RS",o[o.DPadUp=12]="DPadUp",o[o.DPadDown=13]="DPadDown",o[o.DPadLeft=14]="DPadLeft",o[o.DPadRight=15]="DPadRight",o[o.Home=16]="Home",o[o.Capture=17]="Capture",o[o.LStickXAxis=18]="LStickXAxis",o[o.LStickYAxis=19]="LStickYAxis",o[o.RStickXAxis=20]="RStickXAxis",o[o.RStickYAxis=21]="RStickYAxis";var eH=e.i(76696);class eK{static CreateDeviceEvent(e,t,i,s,r,n,a){switch(e){case l.Keyboard:return this._CreateKeyboardEvent(i,s,r,n);case l.Mouse:if(i===d.MouseWheelX||i===d.MouseWheelY||i===d.MouseWheelZ)return this._CreateWheelEvent(e,t,i,s,r,n);case l.Touch:return this._CreatePointerEvent(e,t,i,s,r,n,a);default:throw`Unable to generate event for device ${l[e]}`}}static _CreatePointerEvent(e,t,i,s,r,n,a){let o=this._CreateMouseEvent(e,t,i,s,r,n);return e===l.Mouse?(o.deviceType=l.Mouse,o.pointerId=1,o.pointerType="mouse"):(o.deviceType=l.Touch,o.pointerId=a??t,o.pointerType="touch"),o.buttons=0+r.pollInput(e,t,d.LeftClick)+2*r.pollInput(e,t,d.RightClick)+4*r.pollInput(e,t,d.MiddleClick),i===d.Move?o.type="pointermove":i>=d.LeftClick&&i<=d.RightClick&&(o.type=1===s?"pointerdown":"pointerup",o.button=i-2),o}static _CreateWheelEvent(e,t,i,s,r,n){let a=this._CreateMouseEvent(e,t,i,s,r,n);switch(a.pointerId=1,a.type="wheel",a.deltaMode=eH.EventConstants.DOM_DELTA_PIXEL,a.deltaX=0,a.deltaY=0,a.deltaZ=0,i){case d.MouseWheelX:a.deltaX=s;break;case d.MouseWheelY:a.deltaY=s;break;case d.MouseWheelZ:a.deltaZ=s}return a}static _CreateMouseEvent(e,t,i,s,r,n){let a=this._CreateEvent(n),o=r.pollInput(e,t,d.Horizontal),h=r.pollInput(e,t,d.Vertical);return n?(a.movementX=0,a.movementY=0,a.offsetX=a.movementX-n.getBoundingClientRect().x,a.offsetY=a.movementY-n.getBoundingClientRect().y):(a.movementX=r.pollInput(e,t,10),a.movementY=r.pollInput(e,t,11),a.offsetX=0,a.offsetY=0),this._CheckNonCharacterKeys(a,r),a.clientX=o,a.clientY=h,a.x=o,a.y=h,a.deviceType=e,a.deviceSlot=t,a.inputIndex=i,a}static _CreateKeyboardEvent(e,t,i,s){let r=this._CreateEvent(s);return this._CheckNonCharacterKeys(r,i),r.deviceType=l.Keyboard,r.deviceSlot=0,r.inputIndex=e,r.type=1===t?"keydown":"keyup",r.key=String.fromCharCode(e),r.keyCode=e,r}static _CheckNonCharacterKeys(e,t){let i=t.isDeviceAvailable(l.Keyboard),s=i&&1===t.pollInput(l.Keyboard,0,18),r=i&&1===t.pollInput(l.Keyboard,0,17),n=i&&(1===t.pollInput(l.Keyboard,0,91)||1===t.pollInput(l.Keyboard,0,92)||1===t.pollInput(l.Keyboard,0,93)),a=i&&1===t.pollInput(l.Keyboard,0,16);e.altKey=s,e.ctrlKey=r,e.metaKey=n,e.shiftKey=a}static _CreateEvent(e){let t={};return t.preventDefault=()=>{},t.target=e,t}}class eZ{constructor(e,t,i){this._nativeInput=_native.DeviceInputSystem?new _native.DeviceInputSystem(e,t,(e,t,s,r)=>{let n=eK.CreateDeviceEvent(e,t,s,r,this);i(e,t,n)}):this._createDummyNativeInput()}pollInput(e,t,i){return this._nativeInput.pollInput(e,t,i)}isDeviceAvailable(e){return e===l.Mouse||e===l.Touch}dispose(){this._nativeInput.dispose()}_createDummyNativeInput(){return{pollInput:()=>0,isDeviceAvailable:()=>!1,dispose:()=>{}}}}let e$=Object.keys(d).length/2;class eQ{constructor(e,t,i,s){this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._usingSafari=ev.Tools.IsSafari(),this._usingMacOs=(0,eX.IsNavigatorAvailable)()&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),this._keyboardDownEvent=e=>{},this._keyboardUpEvent=e=>{},this._keyboardBlurEvent=e=>{},this._pointerMoveEvent=e=>{},this._pointerDownEvent=e=>{},this._pointerUpEvent=e=>{},this._pointerCancelEvent=e=>{},this._pointerCancelTouch=e=>{},this._pointerLeaveEvent=e=>{},this._pointerWheelEvent=e=>{},this._pointerBlurEvent=e=>{},this._pointerMacOsChromeOutEvent=e=>{},this._eventsAttached=!1,this._mouseId=-1,this._isUsingFirefox=(0,eX.IsNavigatorAvailable)()&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("Firefox"),this._isUsingChromium=(0,eX.IsNavigatorAvailable)()&&navigator.userAgent&&-1!==navigator.userAgent.indexOf("Chrome"),this._maxTouchPoints=0,this._pointerInputClearObserver=null,this._gamepadConnectedEvent=e=>{},this._gamepadDisconnectedEvent=e=>{},this._eventPrefix=ev.Tools.GetPointerPrefix(e),this._engine=e,this._onDeviceConnected=t,this._onDeviceDisconnected=i,this._onInputChanged=s,this._mouseId=+!this._isUsingFirefox,this._enableEvents(),this._usingMacOs&&(this._metaKeys=[]),this._engine._onEngineViewChanged||(this._engine._onEngineViewChanged=()=>{this._enableEvents()})}pollInput(e,t,i){let s=this._inputs[e][t];if(!s)throw`Unable to find device ${l[e]}`;e>=l.DualShock&&e<=l.DualSense&&this._updateDevice(e,t,i);let r=s[i];if(void 0===r)throw`Unable to find input ${i} for device ${l[e]} in slot ${t}`;return i===d.Move&&ev.Tools.Warn("Unable to provide information for PointerInput.Move. Try using PointerInput.Horizontal or PointerInput.Vertical for move data."),r}isDeviceAvailable(e){return void 0!==this._inputs[e]}dispose(){this._onDeviceConnected=()=>{},this._onDeviceDisconnected=()=>{},this._onInputChanged=()=>{},delete this._engine._onEngineViewChanged,this._elementToAttachTo&&this._disableEvents()}_enableEvents(){let e=this?._engine.getInputElement();if(e&&(!this._eventsAttached||this._elementToAttachTo!==e)){if(this._disableEvents(),this._inputs){for(let e of this._inputs)if(e)for(let t in e){let i=e[+t];if(i)for(let e=0;e<i.length;e++)i[e]=0}}this._elementToAttachTo=e,this._elementToAttachTo.tabIndex=-1!==this._elementToAttachTo.tabIndex?this._elementToAttachTo.tabIndex:this._engine.canvasTabIndex,this._handleKeyActions(),this._handlePointerActions(),this._handleGamepadActions(),this._eventsAttached=!0,this._checkForConnectedDevices()}}_disableEvents(){this._elementToAttachTo&&(this._elementToAttachTo.removeEventListener("blur",this._keyboardBlurEvent),this._elementToAttachTo.removeEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.removeEventListener("keydown",this._keyboardDownEvent),this._elementToAttachTo.removeEventListener("keyup",this._keyboardUpEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"leave",this._pointerLeaveEvent),this._elementToAttachTo.removeEventListener(this._wheelEventName,this._pointerWheelEvent),this._usingMacOs&&this._isUsingChromium&&this._elementToAttachTo.removeEventListener("lostpointercapture",this._pointerMacOsChromeOutEvent),window.removeEventListener("gamepadconnected",this._gamepadConnectedEvent),window.removeEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)),this._pointerInputClearObserver&&this._engine.onEndFrameObservable.remove(this._pointerInputClearObserver),this._eventsAttached=!1}_checkForConnectedDevices(){if(navigator.getGamepads)for(let e of navigator.getGamepads())e&&this._addGamePad(e);"function"==typeof matchMedia&&matchMedia("(pointer:fine)").matches&&this._addPointerDevice(l.Mouse,0,0,0)}_addGamePad(e){let t=this._getGamepadDeviceType(e.id),i=e.index;this._gamepads=this._gamepads||Array(e.index+1),this._registerDevice(t,i,e.buttons.length+e.axes.length),this._gamepads[i]=t}_addPointerDevice(e,t,i,s){this._pointerActive||(this._pointerActive=!0),this._registerDevice(e,t,e$);let r=this._inputs[e][t];r[0]=i,r[1]=s}_registerDevice(e,t,i){if(void 0===t)throw`Unable to register device ${l[e]} to undefined slot.`;if(this._inputs[e]||(this._inputs[e]={}),!this._inputs[e][t]){let s=Array(i);s.fill(0),this._inputs[e][t]=s,this._onDeviceConnected(e,t)}}_unregisterDevice(e,t){this._inputs[e][t]&&(delete this._inputs[e][t],this._onDeviceDisconnected(e,t))}_handleKeyActions(){this._keyboardDownEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(l.Keyboard,0,255));let t=this._inputs[l.Keyboard][0];t&&(t[e.keyCode]=1,e.inputIndex=e.keyCode,this._usingMacOs&&e.metaKey&&"Meta"!==e.key&&!this._metaKeys.includes(e.keyCode)&&this._metaKeys.push(e.keyCode),this._onInputChanged(l.Keyboard,0,e))},this._keyboardUpEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(l.Keyboard,0,255));let t=this._inputs[l.Keyboard][0];if(t){if(t[e.keyCode]=0,e.inputIndex=e.keyCode,this._usingMacOs&&"Meta"===e.key&&this._metaKeys.length>0){for(let e of this._metaKeys){let i=eK.CreateDeviceEvent(l.Keyboard,0,e,0,this,this._elementToAttachTo);t[e]=0,this._onInputChanged(l.Keyboard,0,i)}this._metaKeys.splice(0,this._metaKeys.length)}this._onInputChanged(l.Keyboard,0,e)}},this._keyboardBlurEvent=()=>{if(this._keyboardActive){let e=this._inputs[l.Keyboard][0];for(let t=0;t<e.length;t++)if(0!==e[t]){e[t]=0;let i=eK.CreateDeviceEvent(l.Keyboard,0,t,0,this,this._elementToAttachTo);this._onInputChanged(l.Keyboard,0,i)}this._usingMacOs&&this._metaKeys.splice(0,this._metaKeys.length)}},this._elementToAttachTo.addEventListener("keydown",this._keyboardDownEvent),this._elementToAttachTo.addEventListener("keyup",this._keyboardUpEvent),this._elementToAttachTo.addEventListener("blur",this._keyboardBlurEvent)}_handlePointerActions(){this._maxTouchPoints=(0,eX.IsNavigatorAvailable)()&&navigator.maxTouchPoints||2,this._activeTouchIds||(this._activeTouchIds=Array(this._maxTouchPoints));for(let e=0;e<this._maxTouchPoints;e++)this._activeTouchIds[e]=-1;this._pointerMoveEvent=e=>{let t=this._getPointerType(e),i=t===l.Mouse?0:this._activeTouchIds.indexOf(e.pointerId);if(t===l.Touch&&-1===i){let s=this._activeTouchIds.indexOf(-1);if(!(s>=0))return void ev.Tools.Warn(`Max number of touches exceeded. Ignoring touches in excess of ${this._maxTouchPoints}`);i=s,this._activeTouchIds[s]=e.pointerId,this._onDeviceConnected(t,i)}this._inputs[t]||(this._inputs[t]={}),this._inputs[t][i]||this._addPointerDevice(t,i,e.clientX,e.clientY);let s=this._inputs[t][i];s&&(e.inputIndex=d.Move,s[d.Horizontal]=e.clientX,s[d.Vertical]=e.clientY,t===l.Touch&&0===s[d.LeftClick]&&(s[d.LeftClick]=1),void 0===e.pointerId&&(e.pointerId=this._mouseId),this._onInputChanged(t,i,e),this._usingSafari||-1===e.button||(e.inputIndex=e.button+2,s[e.button+2]=+!s[e.button+2],this._onInputChanged(t,i,e)))},this._pointerDownEvent=e=>{let t=this._getPointerType(e),i=t===l.Mouse?0:e.pointerId;if(t===l.Touch){let t=this._activeTouchIds.indexOf(e.pointerId);if(-1===t&&(t=this._activeTouchIds.indexOf(-1)),!(t>=0))return void ev.Tools.Warn(`Max number of touches exceeded. Ignoring touches in excess of ${this._maxTouchPoints}`);i=t,this._activeTouchIds[t]=e.pointerId}this._inputs[t]||(this._inputs[t]={}),this._inputs[t][i]?t===l.Touch&&this._onDeviceConnected(t,i):this._addPointerDevice(t,i,e.clientX,e.clientY);let s=this._inputs[t][i];if(s){let r=s[d.Horizontal],n=s[d.Vertical];if(t===l.Mouse){if(void 0===e.pointerId&&(e.pointerId=this._mouseId),!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(this._mouseId)}catch(e){}}else if(e.pointerId&&!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(e.pointerId)}catch(e){}s[d.Horizontal]=e.clientX,s[d.Vertical]=e.clientY,s[e.button+2]=1,e.inputIndex=e.button+2,this._onInputChanged(t,i,e),(r!==e.clientX||n!==e.clientY)&&(e.inputIndex=d.Move,this._onInputChanged(t,i,e))}},this._pointerUpEvent=e=>{let t=this._getPointerType(e),i=t===l.Mouse?0:this._activeTouchIds.indexOf(e.pointerId);if(t===l.Touch)if(-1===i)return;else this._activeTouchIds[i]=-1;let s=this._inputs[t]?.[i],r=e.button,n=s&&0!==s[r+2];if(!n&&this._isUsingFirefox&&this._usingMacOs&&s&&(n=0!==s[(r=2*(2!==r))+2]),n){let n=s[d.Horizontal],a=s[d.Vertical];s[d.Horizontal]=e.clientX,s[d.Vertical]=e.clientY,s[r+2]=0,void 0===e.pointerId&&(e.pointerId=this._mouseId),(n!==e.clientX||a!==e.clientY)&&(e.inputIndex=d.Move,this._onInputChanged(t,i,e)),e.inputIndex=r+2,t===l.Mouse&&this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)?this._elementToAttachTo.releasePointerCapture(this._mouseId):e.pointerId&&this._elementToAttachTo.hasPointerCapture?.(e.pointerId)&&this._elementToAttachTo.releasePointerCapture(e.pointerId),this._onInputChanged(t,i,e),t===l.Touch&&this._onDeviceDisconnected(t,i)}},this._pointerCancelTouch=e=>{let t=this._activeTouchIds.indexOf(e);if(-1===t)return;this._elementToAttachTo.hasPointerCapture?.(e)&&this._elementToAttachTo.releasePointerCapture(e),this._inputs[l.Touch][t][d.LeftClick]=0;let i=eK.CreateDeviceEvent(l.Touch,t,d.LeftClick,0,this,this._elementToAttachTo,e);this._onInputChanged(l.Touch,t,i),this._activeTouchIds[t]=-1,this._onDeviceDisconnected(l.Touch,t)},this._pointerCancelEvent=e=>{if("mouse"===e.pointerType){let e=this._inputs[l.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let t=d.LeftClick;t<=d.BrowserForward;t++)if(1===e[t]){e[t]=0;let i=eK.CreateDeviceEvent(l.Mouse,0,t,0,this,this._elementToAttachTo);this._onInputChanged(l.Mouse,0,i)}}else this._pointerCancelTouch(e.pointerId)},this._pointerLeaveEvent=e=>{"pen"===e.pointerType&&this._pointerCancelTouch(e.pointerId)},this._wheelEventName="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";let e=!1,t=function(){};try{let i=Object.defineProperty({},"passive",{get:function(){e=!0}});this._elementToAttachTo.addEventListener("test",t,i),this._elementToAttachTo.removeEventListener("test",t,i)}catch(e){}this._pointerBlurEvent=()=>{if(this.isDeviceAvailable(l.Mouse)){let e=this._inputs[l.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let t=d.LeftClick;t<=d.BrowserForward;t++)if(1===e[t]){e[t]=0;let i=eK.CreateDeviceEvent(l.Mouse,0,t,0,this,this._elementToAttachTo);this._onInputChanged(l.Mouse,0,i)}}if(this.isDeviceAvailable(l.Touch)){let e=this._inputs[l.Touch];for(let t=0;t<this._activeTouchIds.length;t++){let i=this._activeTouchIds[t];if(this._elementToAttachTo.hasPointerCapture?.(i)&&this._elementToAttachTo.releasePointerCapture(i),-1!==i&&e[t]?.[d.LeftClick]===1){e[t][d.LeftClick]=0;let s=eK.CreateDeviceEvent(l.Touch,t,d.LeftClick,0,this,this._elementToAttachTo,i);this._onInputChanged(l.Touch,t,s),this._activeTouchIds[t]=-1,this._onDeviceDisconnected(l.Touch,t)}}}},this._pointerWheelEvent=e=>{let t=l.Mouse;this._inputs[t]||(this._inputs[t]=[]),this._inputs[t][0]||(this._pointerActive=!0,this._registerDevice(t,0,e$));let i=this._inputs[t][0];i&&(i[d.MouseWheelX]=e.deltaX||0,i[d.MouseWheelY]=e.deltaY||e.wheelDelta||0,i[d.MouseWheelZ]=e.deltaZ||0,void 0===e.pointerId&&(e.pointerId=this._mouseId),0!==i[d.MouseWheelX]&&(e.inputIndex=d.MouseWheelX,this._onInputChanged(t,0,e)),0!==i[d.MouseWheelY]&&(e.inputIndex=d.MouseWheelY,this._onInputChanged(t,0,e)),0!==i[d.MouseWheelZ]&&(e.inputIndex=d.MouseWheelZ,this._onInputChanged(t,0,e)))},this._usingMacOs&&this._isUsingChromium&&(this._pointerMacOsChromeOutEvent=e=>{e.buttons>1&&this._pointerCancelEvent(e)},this._elementToAttachTo.addEventListener("lostpointercapture",this._pointerMacOsChromeOutEvent)),this._elementToAttachTo.addEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"leave",this._pointerLeaveEvent),this._elementToAttachTo.addEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.addEventListener(this._wheelEventName,this._pointerWheelEvent,!!e&&{passive:!1}),this._pointerInputClearObserver=this._engine.onEndFrameObservable.add(()=>{if(this.isDeviceAvailable(l.Mouse)){let e=this._inputs[l.Mouse][0];e[d.MouseWheelX]=0,e[d.MouseWheelY]=0,e[d.MouseWheelZ]=0}})}_handleGamepadActions(){this._gamepadConnectedEvent=e=>{this._addGamePad(e.gamepad)},this._gamepadDisconnectedEvent=e=>{if(this._gamepads){let t=this._getGamepadDeviceType(e.gamepad.id),i=e.gamepad.index;this._unregisterDevice(t,i),delete this._gamepads[i]}},window.addEventListener("gamepadconnected",this._gamepadConnectedEvent),window.addEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)}_updateDevice(e,t,i){let s=navigator.getGamepads()[t];if(s&&e===this._gamepads[t]){let r=this._inputs[e][t];i>=s.buttons.length?r[i]=s.axes[i-s.buttons.length].valueOf():r[i]=s.buttons[i].value}}_getGamepadDeviceType(e){return -1!==e.indexOf("054c")?-1!==e.indexOf("0ce6")?l.DualSense:l.DualShock:-1!==e.indexOf("Xbox One")||-1!==e.search("Xbox 360")||-1!==e.search("xinput")||-1!==e.indexOf("045e")&&-1===e.indexOf("Surface Dock")?l.Xbox:-1!==e.indexOf("057e")?l.Switch:l.Generic}_getPointerType(e){let t=l.Mouse;return("touch"===e.pointerType||"pen"===e.pointerType||e.touches)&&(t=l.Touch),t}}class eJ{constructor(e,t,i=0){this.deviceType=t,this.deviceSlot=i,this.onInputChangedObservable=new eb.Observable,this._deviceInputSystem=e}getInput(e){return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)}}class e0{constructor(e){this._registeredManagers=[],this._refCount=0,this.registerManager=e=>{for(let t=0;t<this._devices.length;t++){let i=this._devices[t];for(let s in i){let i=+s;e._addDevice(new eJ(this._deviceInputSystem,t,i))}}this._registeredManagers.push(e)},this.unregisterManager=e=>{let t=this._registeredManagers.indexOf(e);t>-1&&this._registeredManagers.splice(t,1)};const t=Object.keys(l).length/2;this._devices=Array(t);const i=(e,t)=>{for(let i of(this._devices[e]||(this._devices[e]=[]),this._devices[e][t]||(this._devices[e][t]=t),this._registeredManagers)){let s=new eJ(this._deviceInputSystem,e,t);i._addDevice(s)}},s=(e,t)=>{for(let i of(this._devices[e]?.[t]&&delete this._devices[e][t],this._registeredManagers))i._removeDevice(e,t)},r=(e,t,i)=>{if(i)for(let s of this._registeredManagers)s._onInputChanged(e,t,i)};"u">typeof _native?this._deviceInputSystem=new eZ(i,s,r):this._deviceInputSystem=new eQ(e,i,s,r)}dispose(){this._deviceInputSystem.dispose()}}class e1{getDeviceSource(e,t){if(void 0===t){if(void 0===this._firstDevice[e])return null;t=this._firstDevice[e]}return this._devices[e]&&void 0!==this._devices[e][t]?this._devices[e][t]:null}getDeviceSources(e){return this._devices[e]?this._devices[e].filter(e=>!!e):[]}constructor(e){const t=Object.keys(l).length/2;this._devices=Array(t),this._firstDevice=Array(t),this._engine=e,this._engine._deviceSourceManager||(this._engine._deviceSourceManager=new e0(e)),this._engine._deviceSourceManager._refCount++,this.onDeviceConnectedObservable=new eb.Observable(e=>{for(let t of this._devices)if(t)for(let i of t)i&&this.onDeviceConnectedObservable.notifyObserver(e,i)}),this.onDeviceDisconnectedObservable=new eb.Observable,this._engine._deviceSourceManager.registerManager(this),this._onDisposeObserver=e.onDisposeObservable.add(()=>{this.dispose()})}dispose(){this.onDeviceConnectedObservable.clear(),this.onDeviceDisconnectedObservable.clear(),this._engine._deviceSourceManager&&(this._engine._deviceSourceManager.unregisterManager(this),--this._engine._deviceSourceManager._refCount<1&&(this._engine._deviceSourceManager.dispose(),delete this._engine._deviceSourceManager)),this._engine.onDisposeObservable.remove(this._onDisposeObserver)}_addDevice(e){this._devices[e.deviceType]||(this._devices[e.deviceType]=[]),this._devices[e.deviceType][e.deviceSlot]||(this._devices[e.deviceType][e.deviceSlot]=e,this._updateFirstDevices(e.deviceType)),this.onDeviceConnectedObservable.notifyObservers(e)}_removeDevice(e,t){let i=this._devices[e]?.[t];this.onDeviceDisconnectedObservable.notifyObservers(i),this._devices[e]?.[t]&&delete this._devices[e][t],this._updateFirstDevices(e)}_onInputChanged(e,t,i){this._devices[e]?.[t]?.onInputChangedObservable.notifyObservers(i)}_updateFirstDevices(e){switch(e){case l.Keyboard:case l.Mouse:this._firstDevice[e]=0;break;case l.Touch:case l.DualSense:case l.DualShock:case l.Xbox:case l.Switch:case l.Generic:{delete this._firstDevice[e];let t=this._devices[e];if(t){for(let i=0;i<t.length;i++)if(t[i]){this._firstDevice[e]=i;break}}}}}}class e2{}e2._IsPickingAvailable=!1,e.s(["_ImportHelper",0,e2],5785);class e3{constructor(){this._singleClick=!1,this._doubleClick=!1,this._hasSwiped=!1,this._ignore=!1}get singleClick(){return this._singleClick}get doubleClick(){return this._doubleClick}get hasSwiped(){return this._hasSwiped}get ignore(){return this._ignore}set singleClick(e){this._singleClick=e}set doubleClick(e){this._doubleClick=e}set hasSwiped(e){this._hasSwiped=e}set ignore(e){this._ignore=e}}class e6{constructor(e){if(this._alreadyAttached=!1,this._meshPickProceed=!1,this._currentPickResult=null,this._previousPickResult=null,this._activePointerIds=[],this._activePointerIdsCount=0,this._doubleClickOccured=!1,this._isSwiping=!1,this._swipeButtonPressed=-1,this._skipPointerTap=!1,this._isMultiTouchGesture=!1,this._pointerX=0,this._pointerY=0,this._startingPointerPosition=new eM.Vector2(0,0),this._previousStartingPointerPosition=new eM.Vector2(0,0),this._startingPointerTime=0,this._previousStartingPointerTime=0,this._pointerCaptures={},this._meshUnderPointerId={},this._movePointerInfo=null,this._cameraObserverCount=0,this._delayedClicks=[null,null,null,null,null],this._deviceSourceManager=null,this._scene=e||eq.EngineStore.LastCreatedScene,!this._scene)return}get meshUnderPointer(){return this._movePointerInfo&&(this._movePointerInfo._generatePickInfo(),this._movePointerInfo=null),this._pointerOverMesh}getMeshUnderPointerByPointerId(e){return this._meshUnderPointerId[e]||null}get unTranslatedPointer(){return new eM.Vector2(this._unTranslatedPointerX,this._unTranslatedPointerY)}get pointerX(){return this._pointerX}set pointerX(e){this._pointerX=e}get pointerY(){return this._pointerY}set pointerY(e){this._pointerY=e}_updatePointerPosition(e){let t=this._scene.getEngine().getInputElementClientRect();t&&(this._pointerX=e.clientX-t.left,this._pointerY=e.clientY-t.top,this._unTranslatedPointerX=this._pointerX,this._unTranslatedPointerY=this._pointerY)}_processPointerMove(e,t){let i,s=this._scene,r=s.getEngine(),n=r.getInputElement();for(let i of(n&&(n.tabIndex=r.canvasTabIndex,s.doNotHandleCursors||(n.style.cursor=s.defaultCursor)),this._setCursorAndPointerOverMesh(e,t,s),s._pointerMoveStage)){e=e||this._pickMove(t);let s=!!e?.pickedMesh;e=i.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,s,n)}let a=t.inputIndex>=d.MouseWheelX&&t.inputIndex<=d.MouseWheelZ?eV.PointerEventTypes.POINTERWHEEL:eV.PointerEventTypes.POINTERMOVE;s.onPointerMove&&(e=e||this._pickMove(t),s.onPointerMove(t,e,a)),e?(i=new eV.PointerInfo(a,t,e),this._setRayOnPointerInfo(e,t)):(i=new eV.PointerInfo(a,t,null,this),this._movePointerInfo=i),s.onPointerObservable.hasObservers()&&s.onPointerObservable.notifyObservers(i,a)}_setRayOnPointerInfo(e,t){let i=this._scene;e&&e2._IsPickingAvailable&&!e.ray&&(e.ray=i.createPickingRay(t.offsetX,t.offsetY,eM.Matrix.Identity(),i.activeCamera))}_addCameraPointerObserver(e,t){return this._cameraObserverCount++,this._scene.onPointerObservable.add(e,t)}_removeCameraPointerObserver(e){return this._cameraObserverCount--,this._scene.onPointerObservable.remove(e)}_checkForPicking(){return!!(this._scene.onPointerObservable.observers.length>this._cameraObserverCount||this._scene.onPointerPick)}_checkPrePointerObservable(e,t,i){let s=this._scene,r=new eV.PointerInfoPre(i,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(r.originalPickingInfo=e,r.ray=e.ray,"xr-near"===t.pointerType&&e.originMesh&&(r.nearInteractionPickingInfo=e)),s.onPrePointerObservable.notifyObservers(r,i),!!r.skipOnPointerObservable}_pickMove(e){let t=this._scene,i=t.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,t.pointerMovePredicate,t.pointerMoveFastCheck,t.cameraToUseForPointers,t.pointerMoveTrianglePredicate);return this._setCursorAndPointerOverMesh(i,e,t),i}_setCursorAndPointerOverMesh(e,t,i){let s=i.getEngine().getInputElement();if(e?.pickedMesh){if(this.setPointerOverMesh(e.pickedMesh,t.pointerId,e,t),!i.doNotHandleCursors&&s&&this._pointerOverMesh){let e=this._pointerOverMesh._getActionManagerForTrigger();e&&e.hasPointerTriggers&&(s.style.cursor=e.hoverCursor||i.hoverCursor)}}else this.setPointerOverMesh(null,t.pointerId,e,t)}simulatePointerMove(e,t){let i=new PointerEvent("pointermove",t);i.inputIndex=d.Move,this._checkPrePointerObservable(e,i,eV.PointerEventTypes.POINTERMOVE)||this._processPointerMove(e,i)}simulatePointerDown(e,t){let i=new PointerEvent("pointerdown",t);i.inputIndex=i.button+2,this._checkPrePointerObservable(e,i,eV.PointerEventTypes.POINTERDOWN)||this._processPointerDown(e,i)}_processPointerDown(e,t){let i,s=this._scene;if(e?.pickedMesh){this._pickedDownMesh=e.pickedMesh;let i=e.pickedMesh._getActionManagerForTrigger();if(i){if(i.hasPickTriggers)switch(i.processTrigger(5,new ex(e.pickedMesh,s.pointerX,s.pointerY,e.pickedMesh,t,e)),t.button){case 0:i.processTrigger(2,new ex(e.pickedMesh,s.pointerX,s.pointerY,e.pickedMesh,t,e));break;case 1:i.processTrigger(4,new ex(e.pickedMesh,s.pointerX,s.pointerY,e.pickedMesh,t,e));break;case 2:i.processTrigger(3,new ex(e.pickedMesh,s.pointerX,s.pointerY,e.pickedMesh,t,e))}i.hasSpecificTrigger(8)&&window.setTimeout(()=>{let e=s.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,e=>e.isPickable&&e.isVisible&&e.isReady()&&e.actionManager&&e.actionManager.hasSpecificTrigger(8)&&e===this._pickedDownMesh,!1,s.cameraToUseForPointers);e?.pickedMesh&&i&&0!==this._activePointerIdsCount&&Date.now()-this._startingPointerTime>e6.LongPressDelay&&!this._isPointerSwiping()&&(this._startingPointerTime=0,i.processTrigger(8,ex.CreateNew(e.pickedMesh,t)))},e6.LongPressDelay)}}else for(let i of s._pointerDownStage)e=i.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,!1);let r=eV.PointerEventTypes.POINTERDOWN;e?(s.onPointerDown&&s.onPointerDown(t,e,r),i=new eV.PointerInfo(r,t,e),this._setRayOnPointerInfo(e,t)):i=new eV.PointerInfo(r,t,null,this),s.onPointerObservable.hasObservers()&&s.onPointerObservable.notifyObservers(i,r)}_isPointerSwiping(){return this._isSwiping}simulatePointerUp(e,t,i){let s=new PointerEvent("pointerup",t);s.inputIndex=d.Move;let r=new e3;i?r.doubleClick=!0:r.singleClick=!0,this._checkPrePointerObservable(e,s,eV.PointerEventTypes.POINTERUP)||this._processPointerUp(e,s,r)}_processPointerUp(e,t,i){let s=this._scene;if(e?.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(s.onPointerPick&&s.onPointerPick(t,e),i.singleClick&&!i.ignore&&s.onPointerObservable.observers.length>this._cameraObserverCount)){let i=eV.PointerEventTypes.POINTERPICK,r=new eV.PointerInfo(i,t,e);this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(r,i)}let r=e.pickedMesh._getActionManagerForTrigger();if(r&&!i.ignore){r.processTrigger(7,ex.CreateNew(e.pickedMesh,t,e)),!i.hasSwiped&&i.singleClick&&r.processTrigger(1,ex.CreateNew(e.pickedMesh,t,e));let s=e.pickedMesh._getActionManagerForTrigger(6);i.doubleClick&&s&&s.processTrigger(6,ex.CreateNew(e.pickedMesh,t,e))}}else if(!i.ignore)for(let r of s._pointerUpStage)e=r.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,i.doubleClick);if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){let e=this._pickedDownMesh._getActionManagerForTrigger(16);e&&e.processTrigger(16,ex.CreateNew(this._pickedDownMesh,t))}if(!i.ignore){let r=new eV.PointerInfo(eV.PointerEventTypes.POINTERUP,t,e);if(this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(r,eV.PointerEventTypes.POINTERUP),s.onPointerUp&&s.onPointerUp(t,e,eV.PointerEventTypes.POINTERUP),!i.hasSwiped&&!this._skipPointerTap&&!this._isMultiTouchGesture){let r=0;if(i.singleClick?r=eV.PointerEventTypes.POINTERTAP:i.doubleClick&&(r=eV.PointerEventTypes.POINTERDOUBLETAP),r){let i=new eV.PointerInfo(r,t,e);s.onPointerObservable.hasObservers()&&s.onPointerObservable.hasSpecificMask(r)&&s.onPointerObservable.notifyObservers(i,r)}}}}isPointerCaptured(e=0){return this._pointerCaptures[e]}attachControl(e=!0,t=!0,i=!0,s=null){let r=this._scene,n=r.getEngine();s||(s=n.getInputElement()),this._alreadyAttached&&this.detachControl(),s&&(this._alreadyAttachedTo=s),this._deviceSourceManager=new e1(n),this._initActionManager=e=>{if(!this._meshPickProceed){let t=!r.skipPointerUpPicking&&(0!==r._registeredActions||this._checkForPicking()||r.onPointerUp)?r.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,r.pointerUpPredicate,r.pointerUpFastCheck,r.cameraToUseForPointers,r.pointerUpTrianglePredicate):null;this._currentPickResult=t,t&&(e=t.hit&&t.pickedMesh?t.pickedMesh._getActionManagerForTrigger():null),this._meshPickProceed=!0}return e},this._delayedSimpleClick=(e,t,i)=>{if((Date.now()-this._previousStartingPointerTime>e6.DoubleClickDelay&&!this._doubleClickOccured||e!==this._previousButtonPressed)&&(this._doubleClickOccured=!1,t.singleClick=!0,t.ignore=!1,this._delayedClicks[e])){let t=this._delayedClicks[e].evt,i=eV.PointerEventTypes.POINTERTAP,s=new eV.PointerInfo(i,t,this._currentPickResult);r.onPointerObservable.hasObservers()&&r.onPointerObservable.hasSpecificMask(i)&&r.onPointerObservable.notifyObservers(s,i),this._delayedClicks[e]=null}},this._initClickEvent=(e,t,i,s)=>{let r=new e3;this._currentPickResult=null;let n=null,a=e.hasSpecificMask(eV.PointerEventTypes.POINTERPICK)||t.hasSpecificMask(eV.PointerEventTypes.POINTERPICK)||e.hasSpecificMask(eV.PointerEventTypes.POINTERTAP)||t.hasSpecificMask(eV.PointerEventTypes.POINTERTAP)||e.hasSpecificMask(eV.PointerEventTypes.POINTERDOUBLETAP)||t.hasSpecificMask(eV.PointerEventTypes.POINTERDOUBLETAP);!a&&ej&&(n=this._initActionManager(n,r))&&(a=n.hasPickTriggers);let o=!1;if(a=a&&!this._isMultiTouchGesture){let a=i.button;if(r.hasSwiped=this._isPointerSwiping(),!r.hasSwiped){let h=!e6.ExclusiveDoubleClickMode;if(!h&&(h=!e.hasSpecificMask(eV.PointerEventTypes.POINTERDOUBLETAP)&&!t.hasSpecificMask(eV.PointerEventTypes.POINTERDOUBLETAP))&&!ej.HasSpecificTrigger(6)&&(n=this._initActionManager(n,r))&&(h=!n.hasSpecificTrigger(6)),h)(Date.now()-this._previousStartingPointerTime>e6.DoubleClickDelay||a!==this._previousButtonPressed)&&(r.singleClick=!0,s(r,this._currentPickResult),o=!0);else{let e={evt:i,clickInfo:r,timeoutId:window.setTimeout(this._delayedSimpleClick.bind(this,a,r,s),e6.DoubleClickDelay)};this._delayedClicks[a]=e}let l=e.hasSpecificMask(eV.PointerEventTypes.POINTERDOUBLETAP)||t.hasSpecificMask(eV.PointerEventTypes.POINTERDOUBLETAP);!l&&ej.HasSpecificTrigger(6)&&(n=this._initActionManager(n,r))&&(l=n.hasSpecificTrigger(6)),l&&(a===this._previousButtonPressed&&Date.now()-this._previousStartingPointerTime<e6.DoubleClickDelay&&!this._doubleClickOccured?(r.hasSwiped||this._isPointerSwiping()?(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=a,e6.ExclusiveDoubleClickMode?(this._delayedClicks[a]&&(clearTimeout(this._delayedClicks[a]?.timeoutId),this._delayedClicks[a]=null),s(r,this._previousPickResult)):s(r,this._currentPickResult)):(this._previousStartingPointerTime=0,this._doubleClickOccured=!0,r.doubleClick=!0,r.ignore=!1,e6.ExclusiveDoubleClickMode&&this._delayedClicks[a]&&(clearTimeout(this._delayedClicks[a]?.timeoutId),this._delayedClicks[a]=null),s(r,this._currentPickResult)),o=!0):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=a))}}o||s(r,this._currentPickResult)},this._onPointerMove=e=>{if(this._updatePointerPosition(e),this._isSwiping||-1===this._swipeButtonPressed||(this._isSwiping=Math.abs(this._startingPointerPosition.x-this._pointerX)>e6.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>e6.DragMovementThreshold),n.isPointerLock&&n._verifyPointerLock(),this._checkPrePointerObservable(null,e,e.inputIndex>=d.MouseWheelX&&e.inputIndex<=d.MouseWheelZ?eV.PointerEventTypes.POINTERWHEEL:eV.PointerEventTypes.POINTERMOVE)||!r.cameraToUseForPointers&&!r.activeCamera)return;if(r.skipPointerMovePicking)return void this._processPointerMove(new ew.PickingInfo,e);r.pointerMovePredicate||(r.pointerMovePredicate=e=>e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(e.enablePointerMoveEvents||r.constantlyUpdateMeshUnderPointer||null!==e._getActionManagerForTrigger())&&(!r.cameraToUseForPointers||(r.cameraToUseForPointers.layerMask&e.layerMask)!=0));let t=r._registeredActions>0||r.constantlyUpdateMeshUnderPointer?this._pickMove(e):null;this._processPointerMove(t,e)},this._onPointerDown=e=>{let t,i=this._activePointerIds.indexOf(-1);if(-1===i?this._activePointerIds.push(e.pointerId):this._activePointerIds[i]=e.pointerId,this._activePointerIdsCount++,this._pickedDownMesh=null,this._meshPickProceed=!1,e6.ExclusiveDoubleClickMode){for(let t=0;t<this._delayedClicks.length;t++)if(this._delayedClicks[t])if(e.button===t)clearTimeout(this._delayedClicks[t]?.timeoutId);else{let e=this._delayedClicks[t].clickInfo;this._doubleClickOccured=!1,e.singleClick=!0,e.ignore=!1;let i=this._delayedClicks[t].evt,s=eV.PointerEventTypes.POINTERTAP,n=new eV.PointerInfo(s,i,this._currentPickResult);r.onPointerObservable.hasObservers()&&r.onPointerObservable.hasSpecificMask(s)&&r.onPointerObservable.notifyObservers(n,s),this._delayedClicks[t]=null}}this._updatePointerPosition(e),-1===this._swipeButtonPressed&&(this._swipeButtonPressed=e.button),r.preventDefaultOnPointerDown&&s&&(e.preventDefault(),s.focus()),this._startingPointerPosition.x=this._pointerX,this._startingPointerPosition.y=this._pointerY,this._startingPointerTime=Date.now(),this._checkPrePointerObservable(null,e,eV.PointerEventTypes.POINTERDOWN)||(r.cameraToUseForPointers||r.activeCamera)&&(this._pointerCaptures[e.pointerId]=!0,r.pointerDownPredicate||(r.pointerDownPredicate=e=>e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(!r.cameraToUseForPointers||(r.cameraToUseForPointers.layerMask&e.layerMask)!=0)),this._pickedDownMesh=null,t=!r.skipPointerDownPicking&&(0!==r._registeredActions||this._checkForPicking()||r.onPointerDown)?r.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,r.pointerDownPredicate,r.pointerDownFastCheck,r.cameraToUseForPointers,r.pointerDownTrianglePredicate):new ew.PickingInfo,this._processPointerDown(t,e))},this._onPointerUp=e=>{let t=this._activePointerIds.indexOf(e.pointerId);-1!==t&&(this._activePointerIds[t]=-1,this._activePointerIdsCount--,this._pickedUpMesh=null,this._meshPickProceed=!1,this._updatePointerPosition(e),r.preventDefaultOnPointerUp&&s&&(e.preventDefault(),s.focus()),this._initClickEvent(r.onPrePointerObservable,r.onPointerObservable,e,(t,i)=>{if(r.onPrePointerObservable.hasObservers()&&(this._skipPointerTap=!1,!t.ignore)){if(this._checkPrePointerObservable(null,e,eV.PointerEventTypes.POINTERUP)){this._swipeButtonPressed===e.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1),0===e.buttons&&(this._pointerCaptures[e.pointerId]=!1);return}!t.hasSwiped&&(t.singleClick&&r.onPrePointerObservable.hasSpecificMask(eV.PointerEventTypes.POINTERTAP)&&this._checkPrePointerObservable(null,e,eV.PointerEventTypes.POINTERTAP)&&(this._skipPointerTap=!0),t.doubleClick&&r.onPrePointerObservable.hasSpecificMask(eV.PointerEventTypes.POINTERDOUBLETAP)&&this._checkPrePointerObservable(null,e,eV.PointerEventTypes.POINTERDOUBLETAP)&&(this._skipPointerTap=!0))}if(!this._pointerCaptures[e.pointerId]){this._swipeButtonPressed===e.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1);return}0===e.buttons&&(this._pointerCaptures[e.pointerId]=!1),(r.cameraToUseForPointers||r.activeCamera)&&(r.pointerUpPredicate||(r.pointerUpPredicate=e=>e.isPickable&&e.isVisible&&e.isReady()&&e.isEnabled()&&(!r.cameraToUseForPointers||(r.cameraToUseForPointers.layerMask&e.layerMask)!=0)),!this._meshPickProceed&&(ej&&ej.HasTriggers||this._checkForPicking()||r.onPointerUp)&&this._initActionManager(null,t),i||(i=this._currentPickResult),this._processPointerUp(i,e,t),this._previousPickResult=this._currentPickResult,this._swipeButtonPressed===e.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1))}))},this._onKeyDown=e=>{let t=eY.KeyboardEventTypes.KEYDOWN;if(r.onPreKeyboardObservable.hasObservers()){let i=new eY.KeyboardInfoPre(t,e);if(r.onPreKeyboardObservable.notifyObservers(i,t),i.skipOnKeyboardObservable)return}if(r.onKeyboardObservable.hasObservers()){let i=new eY.KeyboardInfo(t,e);r.onKeyboardObservable.notifyObservers(i,t)}r.actionManager&&r.actionManager.processTrigger(14,ex.CreateNewFromScene(r,e))},this._onKeyUp=e=>{let t=eY.KeyboardEventTypes.KEYUP;if(r.onPreKeyboardObservable.hasObservers()){let i=new eY.KeyboardInfoPre(t,e);if(r.onPreKeyboardObservable.notifyObservers(i,t),i.skipOnKeyboardObservable)return}if(r.onKeyboardObservable.hasObservers()){let i=new eY.KeyboardInfo(t,e);r.onKeyboardObservable.notifyObservers(i,t)}r.actionManager&&r.actionManager.processTrigger(15,ex.CreateNewFromScene(r,e))},this._deviceSourceManager.onDeviceConnectedObservable.add(s=>{s.deviceType===l.Mouse?s.onInputChangedObservable.add(r=>{this._originMouseEvent=r,r.inputIndex===d.LeftClick||r.inputIndex===d.MiddleClick||r.inputIndex===d.RightClick||r.inputIndex===d.BrowserBack||r.inputIndex===d.BrowserForward?t&&1===s.getInput(r.inputIndex)?this._onPointerDown(r):e&&0===s.getInput(r.inputIndex)&&this._onPointerUp(r):i&&(r.inputIndex===d.Move?this._onPointerMove(r):(r.inputIndex===d.MouseWheelX||r.inputIndex===d.MouseWheelY||r.inputIndex===d.MouseWheelZ)&&this._onPointerMove(r))}):s.deviceType===l.Touch?s.onInputChangedObservable.add(r=>{r.inputIndex===d.LeftClick&&(t&&1===s.getInput(r.inputIndex)?(this._onPointerDown(r),this._activePointerIdsCount>1&&(this._isMultiTouchGesture=!0)):e&&0===s.getInput(r.inputIndex)&&(this._onPointerUp(r),0===this._activePointerIdsCount&&(this._isMultiTouchGesture=!1))),i&&r.inputIndex===d.Move&&this._onPointerMove(r)}):s.deviceType===l.Keyboard&&s.onInputChangedObservable.add(e=>{"keydown"===e.type?this._onKeyDown(e):"keyup"===e.type&&this._onKeyUp(e)})}),this._alreadyAttached=!0}detachControl(){this._alreadyAttached&&(this._deviceSourceManager.dispose(),this._deviceSourceManager=null,this._alreadyAttachedTo&&!this._scene.doNotHandleCursors&&(this._alreadyAttachedTo.style.cursor=this._scene.defaultCursor),this._alreadyAttached=!1,this._alreadyAttachedTo=null)}setPointerOverMesh(e,t=0,i,s){let r;if(this._meshUnderPointerId[t]===e&&(!e||!e._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting))return;let n=this._meshUnderPointerId[t];n&&(r=n._getActionManagerForTrigger(10))&&r.processTrigger(10,new ex(n,this._pointerX,this._pointerY,e,s,{pointerId:t})),e?(this._meshUnderPointerId[t]=e,this._pointerOverMesh=e,(r=e._getActionManagerForTrigger(9))&&r.processTrigger(9,new ex(e,this._pointerX,this._pointerY,e,s,{pointerId:t,pickResult:i}))):(delete this._meshUnderPointerId[t],this._pointerOverMesh=null),this._scene.onMeshUnderPointerUpdatedObservable.hasObservers()&&this._scene.onMeshUnderPointerUpdatedObservable.notifyObservers({mesh:e,pointerId:t})}getPointerOverMesh(){return this.meshUnderPointer}_invalidateMesh(e){for(let t in this._pointerOverMesh===e&&(this._pointerOverMesh=null),this._pickedDownMesh===e&&(this._pickedDownMesh=null),this._pickedUpMesh===e&&(this._pickedUpMesh=null),this._meshUnderPointerId)this._meshUnderPointerId[t]===e&&delete this._meshUnderPointerId[t]}}e6.DragMovementThreshold=10,e6.LongPressDelay=500,e6.DoubleClickDelay=300,e6.ExclusiveDoubleClickMode=!1;var e5=e.i(67359),e4=e.i(85531);class e7{static get UniqueId(){let e=this._UniqueIdCounter;return this._UniqueIdCounter++,e}}e7._UniqueIdCounter=1;var e8=e.i(46712),e9=e.i(21823),te=e.i(48657);class tt{constructor(){this.pointerDownFastCheck=!1,this.pointerUpFastCheck=!1,this.pointerMoveFastCheck=!1,this.skipPointerMovePicking=!1,this.skipPointerDownPicking=!1,this.skipPointerUpPicking=!1}}var ti=e.i(13379),ts=e.i(77052);let tr=new eM.Vector4,tn=new eM.Vector4;(h=eg||(eg={}))[h.BackwardCompatible=0]="BackwardCompatible",h[h.Intermediate=1]="Intermediate",h[h.Aggressive=2]="Aggressive";class ta{static DefaultMaterialFactory(e){throw(0,ez._WarnImport)("StandardMaterial")}static CollisionCoordinatorFactory(){throw(0,ez._WarnImport)("DefaultCollisionCoordinator")}get clearColor(){return this._clearColor}set clearColor(e){e!==this._clearColor&&(this._clearColor=e,this.onClearColorChangedObservable.notifyObservers(this._clearColor))}get imageProcessingConfiguration(){return this._imageProcessingConfiguration}get performancePriority(){return this._performancePriority}set performancePriority(e){if(e!==this._performancePriority){switch(this._performancePriority=e,e){case 0:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!1,this.autoClear=!0;break;case 1:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!0,this.autoClear=!1;break;case 2:this.skipFrustumClipping=!0,this._renderingManager.maintainStateBetweenFrames=!0,this.skipPointerMovePicking=!0,this.autoClear=!1}this.onScenePerformancePriorityChangedObservable.notifyObservers(e)}}set forceWireframe(e){this._forceWireframe!==e&&(this._forceWireframe=e,this.markAllMaterialsAsDirty(16))}get forceWireframe(){return this._forceWireframe}set skipFrustumClipping(e){this._skipFrustumClipping!==e&&(this._skipFrustumClipping=e)}get skipFrustumClipping(){return this._skipFrustumClipping}set forcePointsCloud(e){this._forcePointsCloud!==e&&(this._forcePointsCloud=e,this.markAllMaterialsAsDirty(16))}get forcePointsCloud(){return this._forcePointsCloud}get environmentTexture(){return this._environmentTexture}set environmentTexture(e){this._environmentTexture!==e&&(this._environmentTexture=e,this.onEnvironmentTextureChangedObservable.notifyObservers(e),this.markAllMaterialsAsDirty(1))}getNodes(){let e=[];for(let t of(e=(e=(e=(e=e.concat(this.meshes)).concat(this.lights)).concat(this.cameras)).concat(this.transformNodes),this.skeletons))e=e.concat(t.bones);return e}get animationPropertiesOverride(){return this._animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set beforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),e&&(this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e))}set afterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),e&&(this._onAfterRenderObserver=this.onAfterRenderObservable.add(e))}set beforeCameraRender(e){this._onBeforeCameraRenderObserver&&this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=this.onBeforeCameraRenderObservable.add(e)}set afterCameraRender(e){this._onAfterCameraRenderObserver&&this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=this.onAfterCameraRenderObservable.add(e)}get pointerDownPredicate(){return this._pointerPickingConfiguration.pointerDownPredicate}set pointerDownPredicate(e){this._pointerPickingConfiguration.pointerDownPredicate=e}get pointerUpPredicate(){return this._pointerPickingConfiguration.pointerUpPredicate}set pointerUpPredicate(e){this._pointerPickingConfiguration.pointerUpPredicate=e}get pointerMovePredicate(){return this._pointerPickingConfiguration.pointerMovePredicate}set pointerMovePredicate(e){this._pointerPickingConfiguration.pointerMovePredicate=e}get pointerDownFastCheck(){return this._pointerPickingConfiguration.pointerDownFastCheck}set pointerDownFastCheck(e){this._pointerPickingConfiguration.pointerDownFastCheck=e}get pointerUpFastCheck(){return this._pointerPickingConfiguration.pointerUpFastCheck}set pointerUpFastCheck(e){this._pointerPickingConfiguration.pointerUpFastCheck=e}get pointerMoveFastCheck(){return this._pointerPickingConfiguration.pointerMoveFastCheck}set pointerMoveFastCheck(e){this._pointerPickingConfiguration.pointerMoveFastCheck=e}get skipPointerMovePicking(){return this._pointerPickingConfiguration.skipPointerMovePicking}set skipPointerMovePicking(e){this._pointerPickingConfiguration.skipPointerMovePicking=e}get skipPointerDownPicking(){return this._pointerPickingConfiguration.skipPointerDownPicking}set skipPointerDownPicking(e){this._pointerPickingConfiguration.skipPointerDownPicking=e}get skipPointerUpPicking(){return this._pointerPickingConfiguration.skipPointerUpPicking}set skipPointerUpPicking(e){this._pointerPickingConfiguration.skipPointerUpPicking=e}get unTranslatedPointer(){return this._inputManager.unTranslatedPointer}static get DragMovementThreshold(){return e6.DragMovementThreshold}static set DragMovementThreshold(e){e6.DragMovementThreshold=e}static get LongPressDelay(){return e6.LongPressDelay}static set LongPressDelay(e){e6.LongPressDelay=e}static get DoubleClickDelay(){return e6.DoubleClickDelay}static set DoubleClickDelay(e){e6.DoubleClickDelay=e}static get ExclusiveDoubleClickMode(){return e6.ExclusiveDoubleClickMode}static set ExclusiveDoubleClickMode(e){e6.ExclusiveDoubleClickMode=e}get _eyePosition(){return this._forcedViewPosition??this.activeCamera?.globalPosition??eM.Vector3.ZeroReadOnly}bindEyePosition(e,t="vEyePosition",i=!1){let s=this._eyePosition,r=this.useRightHandedSystem===(null!=this._mirroredCameraPosition),n=this.floatingOriginOffset,a=tr.set(s.x,s.y,s.z,r?-1:1),o=a.subtractFromFloatsToRef(n.x,n.y,n.z,0,tn);return e&&(i?e.setFloat3(t,o.x,o.y,o.z):e.setVector4(t,o)),a}finalizeSceneUbo(){let e=this.getSceneUniformBuffer(),t=this.bindEyePosition(null),i=this.floatingOriginOffset;return e.updateFloat4("vEyePosition",t.x-i.x,t.y-i.y,t.z-i.z,t.w),e.update(),e}set useRightHandedSystem(e){this._useRightHandedSystem!==e&&(this._useRightHandedSystem=e,this.markAllMaterialsAsDirty(16))}get useRightHandedSystem(){return this._useRightHandedSystem}setStepId(e){this._currentStepId=e}getStepId(){return this._currentStepId}getInternalStep(){return this._currentInternalStep}set fogEnabled(e){this._fogEnabled!==e&&(this._fogEnabled=e,this.markAllMaterialsAsDirty(16))}get fogEnabled(){return this._fogEnabled}set fogMode(e){this._fogMode!==e&&(this._fogMode=e,this.markAllMaterialsAsDirty(16))}get fogMode(){return this._fogMode}get prePass(){return!!this.prePassRenderer&&this.prePassRenderer.defaultRT.enabled}set shadowsEnabled(e){this._shadowsEnabled!==e&&(this._shadowsEnabled=e,this.markAllMaterialsAsDirty(2))}get shadowsEnabled(){return this._shadowsEnabled}set lightsEnabled(e){this._lightsEnabled!==e&&(this._lightsEnabled=e,this.markAllMaterialsAsDirty(2))}get lightsEnabled(){return this._lightsEnabled}get activeCameras(){return this._activeCameras}set activeCameras(e){this._unObserveActiveCameras&&(this._unObserveActiveCameras(),this._unObserveActiveCameras=null),e&&(this._unObserveActiveCameras=(0,te._ObserveArray)(e,()=>{this.onActiveCamerasChanged.notifyObservers(this)})),this._activeCameras=e}get activeCamera(){return this._activeCamera}set activeCamera(e){e!==this._activeCamera&&(this._activeCamera=e,this.onActiveCameraChanged.notifyObservers(this))}get _hasDefaultMaterial(){return ta.DefaultMaterialFactory!==ta._OriginalDefaultMaterialFactory}get defaultMaterial(){return this._defaultMaterial||(this._defaultMaterial=ta.DefaultMaterialFactory(this)),this._defaultMaterial}set defaultMaterial(e){this._defaultMaterial=e}set texturesEnabled(e){this._texturesEnabled!==e&&(this._texturesEnabled=e,this.markAllMaterialsAsDirty(1))}get texturesEnabled(){return this._texturesEnabled}get frameGraph(){return this._frameGraph}set frameGraph(e){if(this._frameGraph){this._frameGraph=e,e||(this.customRenderFunction=this._currentCustomRenderFunction);return}this._frameGraph=e,e&&(this._currentCustomRenderFunction=this.customRenderFunction,this.customRenderFunction=this._renderWithFrameGraph,this.activeCamera=null)}set skeletonsEnabled(e){this._skeletonsEnabled!==e&&(this._skeletonsEnabled=e,this.markAllMaterialsAsDirty(8))}get skeletonsEnabled(){return this._skeletonsEnabled}get collisionCoordinator(){return this._collisionCoordinator||(this._collisionCoordinator=ta.CollisionCoordinatorFactory(),this._collisionCoordinator.init(this)),this._collisionCoordinator}get renderingManager(){return this._renderingManager}get frustumPlanes(){return this._frustumPlanes}_registerTransientComponents(){if(this._transientComponents.length>0){for(let e of this._transientComponents)e.register();this._transientComponents.length=0}}_addComponent(e){this._components.push(e),this._transientComponents.push(e),e.addFromContainer&&e.serialize&&this._serializableComponents.push(e)}_getComponent(e){for(let t of this._components)if(t.name===e)return t;return null}get uniqueId(){return this._uniqueId}constructor(e,t){this._inputManager=new e6(this),this.cameraToUseForPointers=null,this._isScene=!0,this._blockEntityCollection=!1,this.autoClear=!0,this.autoClearDepthAndStencil=!0,this._clearColor=new eT.Color4(.2,.2,.3,1),this.onClearColorChangedObservable=new eb.Observable,this.ambientColor=new eT.Color3(0,0,0),this.environmentIntensity=1,this.iblIntensity=1,this._performancePriority=0,this.onScenePerformancePriorityChangedObservable=new eb.Observable,this._forceWireframe=!1,this._skipFrustumClipping=!1,this._forcePointsCloud=!1,this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.objectRenderers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[],this.effectLayers=[],this.sounds=null,this.layers=[],this.lensFlareSystems=[],this.proceduralTextures=[],this.animationsEnabled=!0,this._animationPropertiesOverride=null,this.useConstantAnimationDeltaTime=!1,this.constantlyUpdateMeshUnderPointer=!1,this.hoverCursor="pointer",this.defaultCursor="",this.doNotHandleCursors=!1,this.preventDefaultOnPointerDown=!0,this.preventDefaultOnPointerUp=!0,this.metadata=null,this.reservedDataStore=null,this.disableOfflineSupportExceptionRules=[],this.onDisposeObservable=new eb.Observable,this._onDisposeObserver=null,this.onBeforeRenderObservable=new eb.Observable,this._onBeforeRenderObserver=null,this.onAfterRenderObservable=new eb.Observable,this.onAfterRenderCameraObservable=new eb.Observable,this._onAfterRenderObserver=null,this.onBeforeAnimationsObservable=new eb.Observable,this.onAfterAnimationsObservable=new eb.Observable,this.onBeforeDrawPhaseObservable=new eb.Observable,this.onAfterDrawPhaseObservable=new eb.Observable,this.onReadyObservable=new eb.Observable,this.onBeforeCameraRenderObservable=new eb.Observable,this._onBeforeCameraRenderObserver=null,this.onAfterCameraRenderObservable=new eb.Observable,this._onAfterCameraRenderObserver=null,this.onBeforeActiveMeshesEvaluationObservable=new eb.Observable,this.onAfterActiveMeshesEvaluationObservable=new eb.Observable,this.onBeforeParticlesRenderingObservable=new eb.Observable,this.onAfterParticlesRenderingObservable=new eb.Observable,this.onDataLoadedObservable=new eb.Observable,this.onNewCameraAddedObservable=new eb.Observable,this.onCameraRemovedObservable=new eb.Observable,this.onNewLightAddedObservable=new eb.Observable,this.onLightRemovedObservable=new eb.Observable,this.onNewGeometryAddedObservable=new eb.Observable,this.onGeometryRemovedObservable=new eb.Observable,this.onNewTransformNodeAddedObservable=new eb.Observable,this.onTransformNodeRemovedObservable=new eb.Observable,this.onNewMeshAddedObservable=new eb.Observable,this.onMeshRemovedObservable=new eb.Observable,this.onNewSkeletonAddedObservable=new eb.Observable,this.onSkeletonRemovedObservable=new eb.Observable,this.onNewParticleSystemAddedObservable=new eb.Observable,this.onParticleSystemRemovedObservable=new eb.Observable,this.onNewAnimationGroupAddedObservable=new eb.Observable,this.onAnimationGroupRemovedObservable=new eb.Observable,this.onNewMaterialAddedObservable=new eb.Observable,this.onNewMultiMaterialAddedObservable=new eb.Observable,this.onMaterialRemovedObservable=new eb.Observable,this.onMultiMaterialRemovedObservable=new eb.Observable,this.onNewTextureAddedObservable=new eb.Observable,this.onTextureRemovedObservable=new eb.Observable,this.onNewFrameGraphAddedObservable=new eb.Observable,this.onFrameGraphRemovedObservable=new eb.Observable,this.onNewObjectRendererAddedObservable=new eb.Observable,this.onObjectRendererRemovedObservable=new eb.Observable,this.onNewPostProcessAddedObservable=new eb.Observable,this.onPostProcessRemovedObservable=new eb.Observable,this.onNewEffectLayerAddedObservable=new eb.Observable,this.onEffectLayerRemovedObservable=new eb.Observable,this.onBeforeRenderTargetsRenderObservable=new eb.Observable,this.onAfterRenderTargetsRenderObservable=new eb.Observable,this.onBeforeStepObservable=new eb.Observable,this.onAfterStepObservable=new eb.Observable,this.onActiveCameraChanged=new eb.Observable,this.onActiveCamerasChanged=new eb.Observable,this.onBeforeRenderingGroupObservable=new eb.Observable,this.onAfterRenderingGroupObservable=new eb.Observable,this.onMeshImportedObservable=new eb.Observable,this.onAnimationFileImportedObservable=new eb.Observable,this.onEnvironmentTextureChangedObservable=new eb.Observable,this.onMeshUnderPointerUpdatedObservable=new eb.Observable,this._registeredForLateAnimationBindings=new ey.SmartArrayNoDuplicate(256),this._pointerPickingConfiguration=new tt,this.onPrePointerObservable=new eb.Observable,this.onPointerObservable=new eb.Observable,this.onPreKeyboardObservable=new eb.Observable,this.onKeyboardObservable=new eb.Observable,this._useRightHandedSystem=!1,this._timeAccumulator=0,this._currentStepId=0,this._currentInternalStep=0,this._fogEnabled=!0,this._fogMode=ta.FOGMODE_NONE,this.fogColor=new eT.Color3(.2,.2,.3),this.fogDensity=.1,this.fogStart=0,this.fogEnd=1e3,this.needsPreviousWorldMatrices=!1,this._shadowsEnabled=!0,this._lightsEnabled=!0,this._unObserveActiveCameras=null,this._texturesEnabled=!0,this._frameGraph=null,this.frameGraphs=[],this.physicsEnabled=!0,this.particlesEnabled=!0,this.spritesEnabled=!0,this._skeletonsEnabled=!0,this.lensFlaresEnabled=!0,this.collisionsEnabled=!0,this.gravity=new eM.Vector3(0,-9.807,0),this.postProcessesEnabled=!0,this.renderTargetsEnabled=!0,this.dumpNextRenderTargets=!1,this.customRenderTargets=[],this.importedMeshesFiles=[],this.probesEnabled=!0,this._meshesForIntersections=new ey.SmartArrayNoDuplicate(256),this.proceduralTexturesEnabled=!0,this._totalVertices=new e5.PerfCounter,this._activeIndices=new e5.PerfCounter,this._activeParticles=new e5.PerfCounter,this._activeBones=new e5.PerfCounter,this._animationTime=0,this.animationTimeScale=1,this._renderId=0,this._frameId=0,this._executeWhenReadyTimeoutId=null,this._intermediateRendering=!1,this._defaultFrameBufferCleared=!1,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1,this._toBeDisposed=Array(256),this._activeRequests=[],this._delayedFileRequests=null,this._pendingData=[],this._isDisposed=!1,this._isReadyChecks=[],this.dispatchAllSubMeshesOfActiveMeshes=!1,this._activeMeshes=new ey.SmartArray(256),this._processedMaterials=new ey.SmartArray(256),this._renderTargets=new ey.SmartArrayNoDuplicate(256),this._materialsRenderTargets=new ey.SmartArrayNoDuplicate(256),this._activeParticleSystems=new ey.SmartArray(256),this._activeSkeletons=new ey.SmartArrayNoDuplicate(32),this._softwareSkinnedMeshes=new ey.SmartArrayNoDuplicate(32),this._activeAnimatables=[],this._transformMatrix=eM.Matrix.Zero(),this.requireLightSorting=!1,this._components=[],this._serializableComponents=[],this._transientComponents=[],this._beforeCameraUpdateStage=eW.Stage.Create(),this._beforeClearStage=eW.Stage.Create(),this._beforeRenderTargetClearStage=eW.Stage.Create(),this._gatherRenderTargetsStage=eW.Stage.Create(),this._gatherActiveCameraRenderTargetsStage=eW.Stage.Create(),this._isReadyForMeshStage=eW.Stage.Create(),this._beforeEvaluateActiveMeshStage=eW.Stage.Create(),this._evaluateSubMeshStage=eW.Stage.Create(),this._preActiveMeshStage=eW.Stage.Create(),this._cameraDrawRenderTargetStage=eW.Stage.Create(),this._beforeCameraDrawStage=eW.Stage.Create(),this._beforeRenderTargetDrawStage=eW.Stage.Create(),this._beforeRenderingGroupDrawStage=eW.Stage.Create(),this._beforeRenderingMeshStage=eW.Stage.Create(),this._afterRenderingMeshStage=eW.Stage.Create(),this._afterRenderingGroupDrawStage=eW.Stage.Create(),this._afterCameraDrawStage=eW.Stage.Create(),this._afterCameraPostProcessStage=eW.Stage.Create(),this._afterRenderTargetDrawStage=eW.Stage.Create(),this._afterRenderTargetPostProcessStage=eW.Stage.Create(),this._afterRenderStage=eW.Stage.Create(),this._pointerMoveStage=eW.Stage.Create(),this._pointerDownStage=eW.Stage.Create(),this._pointerUpStage=eW.Stage.Create(),this._geometriesByUniqueId=null,this._uniqueId=0,this._defaultMeshCandidates={data:[],length:0},this._defaultSubMeshCandidates={data:[],length:0},this.onReadyTimeoutObservable=new eb.Observable,this.onReadyTimeoutDuration=12e4,this._timeoutChecksStartTime=0,this._floatingOriginScene=void 0,this._preventFreeActiveMeshesAndRenderingGroups=!1,this._activeMeshesFrozen=!1,this._activeMeshesFrozenButKeepClipping=!1,this._skipEvaluateActiveMeshesCompletely=!1,this._freezeActiveMeshesCancel=null,this._useCurrentFrameBuffer=!1,this._allowPostProcessClearColor=!0,this.getDeterministicFrameTime=()=>this._engine.getTimeStep(),this._getFloatingOriginScene=()=>this._floatingOriginScene,this._registeredActions=0,this._blockMaterialDirtyMechanism=!1,this._perfCollector=null,this.activeCameras=[],this._uniqueId=this.getUniqueId();const i={useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1,defaultCameraLayerMask:0xfffffff,defaultRenderableLayerMask:0xfffffff,...t};this.defaultCameraLayerMask=i.defaultCameraLayerMask,this.defaultRenderableLayerMask=i.defaultRenderableLayerMask,e=this._engine=e||eq.EngineStore.LastCreatedEngine,i.virtual?e._virtualScenes.push(this):(eq.EngineStore._LastCreatedScene=this,e.scenes.push(this)),(e.getCreationOptions().useLargeWorldRendering||t?.useFloatingOrigin)&&((0,eF.OverrideMatrixFunctions)(),this._floatingOriginScene=this,eF.FloatingOriginCurrentScene.getScene=this._getFloatingOriginScene),this._uid=null,this._renderingManager=new eU(this),eN&&(this.postProcessManager=new eN(this)),(0,eX.IsWindowObjectExist)()&&this.attachControl(),this._createUbo(),ek&&(this._imageProcessingConfiguration=new ek),this.setDefaultCandidateProviders(),i.useGeometryUniqueIdsMap&&(this._geometriesByUniqueId={}),this.useMaterialMeshMap=i.useMaterialMeshMap,this.useClonedMeshMap=i.useClonedMeshMap,t&&t.virtual||e.onNewSceneAddedObservable.notifyObservers(this)}getClassName(){return"Scene"}_getDefaultMeshCandidates(){return this._defaultMeshCandidates.data=this.meshes,this._defaultMeshCandidates.length=this.meshes.length,this._defaultMeshCandidates}_getDefaultSubMeshCandidates(e){return this._defaultSubMeshCandidates.data=e.subMeshes,this._defaultSubMeshCandidates.length=e.subMeshes.length,this._defaultSubMeshCandidates}setDefaultCandidateProviders(){this.getActiveMeshCandidates=()=>this._getDefaultMeshCandidates(),this.getActiveSubMeshCandidates=e=>this._getDefaultSubMeshCandidates(e),this.getIntersectingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e),this.getCollidingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e)}get meshUnderPointer(){return this._inputManager.meshUnderPointer}get pointerX(){return this._inputManager.pointerX}set pointerX(e){this._inputManager.pointerX=e}get pointerY(){return this._inputManager.pointerY}set pointerY(e){this._inputManager.pointerY=e}getCachedMaterial(){return this._cachedMaterial}getCachedEffect(){return this._cachedEffect}getCachedVisibility(){return this._cachedVisibility}isCachedMaterialInvalid(e,t,i=1){return this._cachedEffect!==t||this._cachedMaterial!==e||this._cachedVisibility!==i}getEngine(){return this._engine}getTotalVertices(){return this._totalVertices.current}get totalVerticesPerfCounter(){return this._totalVertices}getActiveIndices(){return this._activeIndices.current}get totalActiveIndicesPerfCounter(){return this._activeIndices}getActiveParticles(){return this._activeParticles.current}get activeParticlesPerfCounter(){return this._activeParticles}getActiveBones(){return this._activeBones.current}get activeBonesPerfCounter(){return this._activeBones}getActiveMeshes(){return this._activeMeshes}getAnimationRatio(){return void 0!==this._animationRatio?this._animationRatio:1}getRenderId(){return this._renderId}getFrameId(){return this._frameId}incrementRenderId(){this._renderId++}_createUbo(){this.setSceneUniformBuffer(this.createSceneUniformBuffer())}simulatePointerMove(e,t){return this._inputManager.simulatePointerMove(e,t),this}simulatePointerDown(e,t){return this._inputManager.simulatePointerDown(e,t),this}simulatePointerUp(e,t,i){return this._inputManager.simulatePointerUp(e,t,i),this}isPointerCaptured(e=0){return this._inputManager.isPointerCaptured(e)}attachControl(e=!0,t=!0,i=!0){this._inputManager.attachControl(e,t,i)}detachControl(){this._inputManager.detachControl()}isReady(e=!0){let t;if(this._isDisposed)return!1;let i=this.getEngine(),s=i.currentRenderPassId;i.currentRenderPassId=this.activeCamera?.renderPassId??s;let r=!0;for(this._pendingData.length>0&&(r=!1),this.prePassRenderer?.update(),this.useOrderIndependentTransparency&&this.depthPeelingRenderer&&r&&(r=this.depthPeelingRenderer.isReady()),e&&(this._processedMaterials.reset(),this._materialsRenderTargets.reset()),t=0;t<this.meshes.length;t++){let s=this.meshes[t];if(!s.subMeshes||0===s.subMeshes.length)continue;if(!s.isReady(!0)){r=!1;continue}let n=s.hasThinInstances||"InstancedMesh"===s.getClassName()||"InstancedLinesMesh"===s.getClassName()||i.getCaps().instancedArrays&&s.instances.length>0;for(let e of this._isReadyForMeshStage)e.action(s,n)||(r=!1);if(!e)continue;let a=s.material||this.defaultMaterial;if(a)if(a._storeEffectOnSubMeshes)for(let e of s.subMeshes){let t=e.getMaterial();t&&t.hasRenderTargetTextures&&null!=t.getRenderTargetTextures&&-1===this._processedMaterials.indexOf(t)&&(this._processedMaterials.push(t),this._materialsRenderTargets.concatWithNoDuplicate(t.getRenderTargetTextures()))}else a.hasRenderTargetTextures&&null!=a.getRenderTargetTextures&&-1===this._processedMaterials.indexOf(a)&&(this._processedMaterials.push(a),this._materialsRenderTargets.concatWithNoDuplicate(a.getRenderTargetTextures()))}if(e){for(t=0;t<this._materialsRenderTargets.length;++t)this._materialsRenderTargets.data[t].isReadyForRendering()||(r=!1);for(t=0;t<this.customRenderTargets.length;++t)this.customRenderTargets[t].isReadyForRendering()||(r=!1)}for(t=0;t<this.geometries.length;t++)2===this.geometries[t].delayLoadState&&(r=!1);if(this.activeCameras&&this.activeCameras.length>0)for(let e of this.activeCameras)e.isReady(!0)||(r=!1);else this.activeCamera&&!this.activeCamera.isReady(!0)&&(r=!1);for(let e of this.particleSystems)e.isReady()||(r=!1);if(this.proceduralTexturesEnabled)for(let e of this.proceduralTextures)e.isReady()||(r=!1);if(this.layers)for(let e of this.layers)e.isReady()||(r=!1);if(this.effectLayers)for(let e of this.effectLayers)e.isLayerReady()||(r=!1);for(let e of this._isReadyChecks)e.isReady()||(r=!1);return i.areAllEffectsReady()||(r=!1),i.currentRenderPassId=s,r}resetCachedMaterial(){this._cachedMaterial=null,this._cachedEffect=null,this._cachedVisibility=null}registerBeforeRender(e){this.onBeforeRenderObservable.add(e)}unregisterBeforeRender(e){this.onBeforeRenderObservable.removeCallback(e)}registerAfterRender(e){this.onAfterRenderObservable.add(e)}unregisterAfterRender(e){this.onAfterRenderObservable.removeCallback(e)}_executeOnceBeforeRender(e){let t=()=>{e(),setTimeout(()=>{this.unregisterBeforeRender(t)})};this.registerBeforeRender(t)}executeOnceBeforeRender(e,t){void 0!==t?setTimeout(()=>{this._executeOnceBeforeRender(e)},t):this._executeOnceBeforeRender(e)}addPendingData(e){this._pendingData.push(e)}removePendingData(e){let t=this.isLoading,i=this._pendingData.indexOf(e);-1!==i&&this._pendingData.splice(i,1),t&&!this.isLoading&&this.onDataLoadedObservable.notifyObservers(this)}getWaitingItemsCount(){return this._pendingData.length}get isLoading(){return this._pendingData.length>0}addIsReadyCheck(e){-1===this._isReadyChecks.indexOf(e)&&this._isReadyChecks.push(e)}removeIsReadyCheck(e){let t=this._isReadyChecks.indexOf(e);-1!==t&&this._isReadyChecks.splice(t,1)}executeWhenReady(e,t=!1){this.onReadyObservable.addOnce(e),null===this._executeWhenReadyTimeoutId&&this._checkIsReady(t)}async whenReadyAsync(e=!1){return await new Promise(t=>{this.executeWhenReady(()=>{t()},e)})}_clearReadynessChecksData(){this._timeoutChecksStartTime=0,this.onReadyTimeoutObservable.clear(),this.onReadyObservable.clear(),this._executeWhenReadyTimeoutId=null}_checkIsReady(e=!1){if(this._registerTransientComponents(),0===this._timeoutChecksStartTime)this._timeoutChecksStartTime=em.PrecisionDate.Now;else if(this.onReadyTimeoutDuration>0&&em.PrecisionDate.Now-this._timeoutChecksStartTime>this.onReadyTimeoutDuration){this.onReadyTimeoutObservable.notifyObservers(this),this._clearReadynessChecksData();return}if(this.isReady(e)){this.onReadyObservable.notifyObservers(this),this._clearReadynessChecksData();return}this._isDisposed?this._clearReadynessChecksData():this._executeWhenReadyTimeoutId=setTimeout(()=>{this.incrementRenderId(),this._checkIsReady(e)},100)}get animatables(){return this._activeAnimatables}resetLastAnimationTimeFrame(){this._animationTimeLast=em.PrecisionDate.Now}getViewMatrix(){return this._viewMatrix}getProjectionMatrix(){return this._projectionMatrix}getInverseProjectionMatrix(){return this._inverseProjectionMatrix}getTransformMatrix(){return this._transformMatrix}setTransformMatrix(e,t,i,s){this._multiviewSceneUboIsActive=!!(i&&s&&this._multiviewSceneUbo),(this._viewUpdateFlag!==e.updateFlag||this._projectionUpdateFlag!==t.updateFlag)&&(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._inverseProjectionMatrix||(this._inverseProjectionMatrix=new eM.Matrix),this._projectionMatrix.invertToRef(this._inverseProjectionMatrix),this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?e4.Frustum.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=e4.Frustum.GetPlanes(this._transformMatrix),this._multiviewSceneUboIsActive&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(i,s):this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.updateMatrix("projection",this._projectionMatrix),this._sceneUbo.updateMatrix("inverseProjection",this._inverseProjectionMatrix)))}getSceneUniformBuffer(){return this._multiviewSceneUboIsActive&&this._multiviewSceneUbo?this._multiviewSceneUbo:this._sceneUbo}createSceneUniformBuffer(e,t){let i="boolean"==typeof t?t:t?.trackUBOsInFrame,s=new eA.UniformBuffer(this._engine,void 0,!1,e??"scene",void 0,i);return s.addUniform("viewProjection",16),s.addUniform("view",16),s.addUniform("projection",16),s.addUniform("vEyePosition",4),s.addUniform("inverseProjection",16),s}setSceneUniformBuffer(e){this._sceneUbo=e,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1}get floatingOriginMode(){return void 0!==this._floatingOriginScene}get floatingOriginOffset(){return this.floatingOriginMode?this._eyePosition:eM.Vector3.ZeroReadOnly}getUniqueId(){return e7.UniqueId}addMesh(e,t=!1){if(!this._blockEntityCollection&&(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),ef.TimingTools.SetImmediate(()=>{this.onNewMeshAddedObservable.notifyObservers(e)}),t))for(let t of e.getChildMeshes())this.addMesh(t)}removeMesh(e,t=!1){let i=this.meshes.indexOf(e);if(-1!==i&&(this.meshes.splice(i,1),e.parent||e._removeFromSceneRootNodes()),this._inputManager._invalidateMesh(e),this.onMeshRemovedObservable.notifyObservers(e),t)for(let t of e.getChildMeshes())this.removeMesh(t);return i}addTransformNode(e){this._blockEntityCollection||(e.getScene()!==this||-1===e._indexInSceneTransformNodesArray)&&(e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),e.parent||e._addToSceneRootNodes(),this.onNewTransformNodeAddedObservable.notifyObservers(e))}removeTransformNode(e){let t=e._indexInSceneTransformNodesArray;if(-1!==t){if(t!==this.transformNodes.length-1){let e=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=e,e._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop(),e.parent||e._removeFromSceneRootNodes()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t}removeSkeleton(e){let t=this.skeletons.indexOf(e);return -1!==t&&(this.skeletons.splice(t,1),this.onSkeletonRemovedObservable.notifyObservers(e),this._executeActiveContainerCleanup(this._activeSkeletons)),t}removeMorphTargetManager(e){let t=this.morphTargetManagers.indexOf(e);return -1!==t&&this.morphTargetManagers.splice(t,1),t}removeLight(e){let t=this.lights.indexOf(e);if(-1!==t){for(let t of this.meshes)t._removeLightSource(e,!1);this.lights.splice(t,1),this.sortLightsByPriority(),e.parent||e._removeFromSceneRootNodes(),this.onLightRemovedObservable.notifyObservers(e)}return t}removeCamera(e){let t=this.cameras.indexOf(e);if(-1!==t&&(this.cameras.splice(t,1),e.parent||e._removeFromSceneRootNodes()),this.activeCameras){let t=this.activeCameras.indexOf(e);-1!==t&&this.activeCameras.splice(t,1)}return this.activeCamera===e&&(this.cameras.length>0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t}removeParticleSystem(e){let t=this.particleSystems.indexOf(e);return -1!==t&&(this.particleSystems.splice(t,1),this._executeActiveContainerCleanup(this._activeParticleSystems)),this.onParticleSystemRemovedObservable.notifyObservers(e),t}removeAnimation(e){let t=this.animations.indexOf(e);return -1!==t&&this.animations.splice(t,1),t}stopAnimation(e,t,i){}removeAnimationGroup(e){let t=this.animationGroups.indexOf(e);return -1!==t&&this.animationGroups.splice(t,1),this.onAnimationGroupRemovedObservable.notifyObservers(e),t}removeMultiMaterial(e){let t=this.multiMaterials.indexOf(e);return -1!==t&&this.multiMaterials.splice(t,1),this.onMultiMaterialRemovedObservable.notifyObservers(e),t}removeMaterial(e){let t=e._indexInSceneMaterialArray;if(-1!==t&&t<this.materials.length){if(t!==this.materials.length-1){let e=this.materials[this.materials.length-1];this.materials[t]=e,e._indexInSceneMaterialArray=t}e._indexInSceneMaterialArray=-1,this.materials.pop()}return this.onMaterialRemovedObservable.notifyObservers(e),t}removeActionManager(e){let t=this.actionManagers.indexOf(e);return -1!==t&&this.actionManagers.splice(t,1),t}removeTexture(e){let t=this.textures.indexOf(e);return -1!==t&&this.textures.splice(t,1),this.onTextureRemovedObservable.notifyObservers(e),t}removeFrameGraph(e){let t=this.frameGraphs.indexOf(e);return -1!==t&&this.frameGraphs.splice(t,1),this.onFrameGraphRemovedObservable.notifyObservers(e),t}removeObjectRenderer(e){let t=this.objectRenderers.indexOf(e);return -1!==t&&this.objectRenderers.splice(t,1),this.onObjectRendererRemovedObservable.notifyObservers(e),t}removePostProcess(e){let t=this.postProcesses.indexOf(e);return -1!==t&&this.postProcesses.splice(t,1),this.onPostProcessRemovedObservable.notifyObservers(e),t}removeEffectLayer(e){let t=this.effectLayers.indexOf(e);return -1!==t&&this.effectLayers.splice(t,1),this.onEffectLayerRemovedObservable.notifyObservers(e),t}addLight(e){if(!this._blockEntityCollection){for(let t of(this.lights.push(e),this.sortLightsByPriority(),e.parent||e._addToSceneRootNodes(),this.meshes))-1===t.lightSources.indexOf(e)&&(t.lightSources.push(e),t._resyncLightSources());ef.TimingTools.SetImmediate(()=>{this.onNewLightAddedObservable.notifyObservers(e)})}}sortLightsByPriority(){this.requireLightSorting&&this.lights.sort(e9.LightConstants.CompareLightsPriority)}addCamera(e){!this._blockEntityCollection&&(this.cameras.push(e),ef.TimingTools.SetImmediate(()=>{this.onNewCameraAddedObservable.notifyObservers(e)}),e.parent||e._addToSceneRootNodes())}addSkeleton(e){this._blockEntityCollection||(this.skeletons.push(e),ef.TimingTools.SetImmediate(()=>{this.onNewSkeletonAddedObservable.notifyObservers(e)}))}addParticleSystem(e){this._blockEntityCollection||(this.particleSystems.push(e),ef.TimingTools.SetImmediate(()=>{this.onNewParticleSystemAddedObservable.notifyObservers(e)}))}addAnimation(e){this._blockEntityCollection||this.animations.push(e)}addAnimationGroup(e){this._blockEntityCollection||(this.animationGroups.push(e),ef.TimingTools.SetImmediate(()=>{this.onNewAnimationGroupAddedObservable.notifyObservers(e)}))}addMultiMaterial(e){this._blockEntityCollection||(this.multiMaterials.push(e),ef.TimingTools.SetImmediate(()=>{this.onNewMultiMaterialAddedObservable.notifyObservers(e)}))}addMaterial(e){this._blockEntityCollection||(e.getScene()!==this||-1===e._indexInSceneMaterialArray)&&(e._indexInSceneMaterialArray=this.materials.length,this.materials.push(e),ef.TimingTools.SetImmediate(()=>{this.onNewMaterialAddedObservable.notifyObservers(e)}))}addMorphTargetManager(e){this._blockEntityCollection||this.morphTargetManagers.push(e)}addGeometry(e){this._blockEntityCollection||(this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=this.geometries.length),this.geometries.push(e))}addActionManager(e){this.actionManagers.push(e)}addTexture(e){this._blockEntityCollection||(this.textures.push(e),this.onNewTextureAddedObservable.notifyObservers(e))}addFrameGraph(e){this.frameGraphs.push(e),ef.TimingTools.SetImmediate(()=>{this.onNewFrameGraphAddedObservable.notifyObservers(e)})}addObjectRenderer(e){this.objectRenderers.push(e),ef.TimingTools.SetImmediate(()=>{this.onNewObjectRendererAddedObservable.notifyObservers(e)})}addPostProcess(e){this._blockEntityCollection||(this.postProcesses.push(e),ef.TimingTools.SetImmediate(()=>{this.onNewPostProcessAddedObservable.notifyObservers(e)}))}addEffectLayer(e){this._blockEntityCollection||(this.effectLayers.push(e),ef.TimingTools.SetImmediate(()=>{this.onNewEffectLayerAddedObservable.notifyObservers(e)}))}switchActiveCamera(e,t=!0){this._engine.getInputElement()&&(this.activeCamera&&this.activeCamera.detachControl(),this.activeCamera=e,t&&e.attachControl())}setActiveCameraById(e){let t=this.getCameraById(e);return t?(this.activeCamera=t,t):null}setActiveCameraByName(e){let t=this.getCameraByName(e);return t?(this.activeCamera=t,t):null}getAnimationGroupByName(e){for(let t=0;t<this.animationGroups.length;t++)if(this.animationGroups[t].name===e)return this.animationGroups[t];return null}_getMaterial(e,t){for(let e=0;e<this.materials.length;e++){let i=this.materials[e];if(t(i))return i}if(e)for(let e=0;e<this.multiMaterials.length;e++){let i=this.multiMaterials[e];if(t(i))return i}return null}getMaterialByUniqueID(e,t=!1){return this.getMaterialByUniqueId(e,t)}getMaterialByUniqueId(e,t=!1){return this._getMaterial(t,t=>t.uniqueId===e)}getMaterialById(e,t=!1){return this._getMaterial(t,t=>t.id===e)}getMaterialByName(e,t=!1){return this._getMaterial(t,t=>t.name===e)}getLastMaterialById(e,t=!1){for(let t=this.materials.length-1;t>=0;t--)if(this.materials[t].id===e)return this.materials[t];if(t){for(let t=this.multiMaterials.length-1;t>=0;t--)if(this.multiMaterials[t].id===e)return this.multiMaterials[t]}return null}getTextureByUniqueId(e){for(let t=0;t<this.textures.length;t++)if(this.textures[t].uniqueId===e)return this.textures[t];return null}getTextureByName(e){for(let t=0;t<this.textures.length;t++)if(this.textures[t].name===e)return this.textures[t];return null}getCameraById(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].id===e)return this.cameras[t];return null}getCameraByUniqueId(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].uniqueId===e)return this.cameras[t];return null}getCameraByName(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].name===e)return this.cameras[t];return null}getBoneById(e){for(let t=0;t<this.skeletons.length;t++){let i=this.skeletons[t];for(let t=0;t<i.bones.length;t++)if(i.bones[t].id===e)return i.bones[t]}return null}getBoneByName(e){for(let t=0;t<this.skeletons.length;t++){let i=this.skeletons[t];for(let t=0;t<i.bones.length;t++)if(i.bones[t].name===e)return i.bones[t]}return null}getLightByName(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].name===e)return this.lights[t];return null}getLightById(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].id===e)return this.lights[t];return null}getLightByUniqueId(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].uniqueId===e)return this.lights[t];return null}getParticleSystemById(e){for(let t=0;t<this.particleSystems.length;t++)if(this.particleSystems[t].id===e)return this.particleSystems[t];return null}getGeometryById(e){for(let t=0;t<this.geometries.length;t++)if(this.geometries[t].id===e)return this.geometries[t];return null}_getGeometryByUniqueId(e){if(this._geometriesByUniqueId){let t=this._geometriesByUniqueId[e];if(void 0!==t)return this.geometries[t]}else for(let t=0;t<this.geometries.length;t++)if(this.geometries[t].uniqueId===e)return this.geometries[t];return null}getFrameGraphByName(e){for(let t=0;t<this.frameGraphs.length;t++)if(this.frameGraphs[t].name===e)return this.frameGraphs[t];return null}pushGeometry(e,t){return!(!t&&this._getGeometryByUniqueId(e.uniqueId))&&(this.addGeometry(e),ef.TimingTools.SetImmediate(()=>{this.onNewGeometryAddedObservable.notifyObservers(e)}),!0)}removeGeometry(e){let t;if(this._geometriesByUniqueId){if(void 0===(t=this._geometriesByUniqueId[e.uniqueId]))return!1}else if((t=this.geometries.indexOf(e))<0)return!1;if(t!==this.geometries.length-1){let e=this.geometries[this.geometries.length-1];e&&(this.geometries[t]=e,this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=t))}return this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=void 0),this.geometries.pop(),this.onGeometryRemovedObservable.notifyObservers(e),!0}getGeometries(){return this.geometries}getMeshById(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].id===e)return this.meshes[t];return null}getMeshesById(e){return this.meshes.filter(function(t){return t.id===e})}getTransformNodeById(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getTransformNodeByUniqueId(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].uniqueId===e)return this.transformNodes[t];return null}getTransformNodesById(e){return this.transformNodes.filter(function(t){return t.id===e})}getMeshByUniqueId(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].uniqueId===e)return this.meshes[t];return null}getLastMeshById(e){for(let t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];return null}getLastTransformNodeById(e){for(let t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getLastEntryById(e){let t;for(t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];for(t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];for(t=this.cameras.length-1;t>=0;t--)if(this.cameras[t].id===e)return this.cameras[t];for(t=this.lights.length-1;t>=0;t--)if(this.lights[t].id===e)return this.lights[t];for(t=this.skeletons.length-1;t>=0;t--){let i=this.skeletons[t];for(let t=i.bones.length-1;t>=0;t--)if(i.bones[t].id===e)return i.bones[t]}return null}getNodeById(e){let t=this.getMeshById(e);if(t)return t;let i=this.getTransformNodeById(e);if(i)return i;let s=this.getLightById(e);if(s)return s;let r=this.getCameraById(e);if(r)return r;let n=this.getBoneById(e);return n||null}getNodeByName(e){let t=this.getMeshByName(e);if(t)return t;let i=this.getTransformNodeByName(e);if(i)return i;let s=this.getLightByName(e);if(s)return s;let r=this.getCameraByName(e);if(r)return r;let n=this.getBoneByName(e);return n||null}getMeshByName(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].name===e)return this.meshes[t];return null}getTransformNodeByName(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].name===e)return this.transformNodes[t];return null}getLastSkeletonById(e){for(let t=this.skeletons.length-1;t>=0;t--)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByUniqueId(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].uniqueId===e)return this.skeletons[t];return null}getSkeletonById(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByName(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].name===e)return this.skeletons[t];return null}getMorphTargetManagerById(e){for(let t=0;t<this.morphTargetManagers.length;t++)if(this.morphTargetManagers[t].uniqueId===e)return this.morphTargetManagers[t];return null}getMorphTargetById(e){for(let t=0;t<this.morphTargetManagers.length;++t){let i=this.morphTargetManagers[t];for(let t=0;t<i.numTargets;++t){let s=i.getTarget(t);if(s.id===e)return s}}return null}getMorphTargetByName(e){for(let t=0;t<this.morphTargetManagers.length;++t){let i=this.morphTargetManagers[t];for(let t=0;t<i.numTargets;++t){let s=i.getTarget(t);if(s.name===e)return s}}return null}getPostProcessByName(e){for(let t=0;t<this.postProcesses.length;++t){let i=this.postProcesses[t];if(i.name===e)return i}return null}isActiveMesh(e){return -1!==this._activeMeshes.indexOf(e)}get uid(){return this._uid||(this._uid=ev.Tools.RandomId()),this._uid}addExternalData(e,t){return this._externalData||(this._externalData=new eP),this._externalData.add(e,t)}getExternalData(e){return this._externalData?this._externalData.get(e):null}getOrAddExternalDataWithFactory(e,t){return this._externalData||(this._externalData=new eP),this._externalData.getOrAddWithFactory(e,t)}removeExternalData(e){return this._externalData.remove(e)}_evaluateSubMesh(e,t,i,s){if(s||e.isInFrustum(this._frustumPlanes)){for(let i of this._evaluateSubMeshStage)i.action(t,e);let i=e.getMaterial();null!=i&&(i.hasRenderTargetTextures&&null!=i.getRenderTargetTextures&&-1===this._processedMaterials.indexOf(i)&&(this._processedMaterials.push(i),this._materialsRenderTargets.concatWithNoDuplicate(i.getRenderTargetTextures())),this._renderingManager.dispatch(e,t,i))}}freeProcessedMaterials(){this._processedMaterials.dispose()}get blockfreeActiveMeshesAndRenderingGroups(){return this._preventFreeActiveMeshesAndRenderingGroups}set blockfreeActiveMeshesAndRenderingGroups(e){this._preventFreeActiveMeshesAndRenderingGroups!==e&&(e&&(this.freeActiveMeshes(),this.freeRenderingGroups()),this._preventFreeActiveMeshesAndRenderingGroups=e)}freeActiveMeshes(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._activeMeshes.dispose(),this.activeCamera&&this.activeCamera._activeMeshes&&this.activeCamera._activeMeshes.dispose(),this.activeCameras))for(let e=0;e<this.activeCameras.length;e++){let t=this.activeCameras[e];t&&t._activeMeshes&&t._activeMeshes.dispose()}}freeRenderingGroups(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._renderingManager&&this._renderingManager.freeRenderingGroups(),this.textures))for(let e=0;e<this.textures.length;e++){let t=this.textures[e];t&&t.renderList&&t.freeRenderingGroups()}}_isInIntermediateRendering(){return this._intermediateRendering}freezeActiveMeshes(e=!1,t,i,s=!0,r=!1){if(this.frameGraph){this._renderWithFrameGraph(!0,!1,!0);let n=this.frameGraph.getTasksByClassName(["FrameGraphObjectRendererTask","FrameGraphGeometryRendererTask"]);for(let e of n)e.objectRenderer._freezeActiveMeshes(s);return this._freezeActiveMeshesCancel=(0,ef._RetryWithInterval)(()=>{let e=!0,t=!0;for(let i of n)e&&(e=i.objectRenderer._isFrozen),t&&(t=null!==i.objectRenderer._freezeActiveMeshesCancel);if(e)return!0;if(!t)throw Error("Freezing active meshes was cancelled");return!1},()=>{this._freezeActiveMeshesCancel=null,this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=r,this._skipEvaluateActiveMeshesCompletely=e,t?.()},(e,t)=>{if(this._freezeActiveMeshesCancel=null,this.unfreezeActiveMeshes(),t){let t="Scene: Timeout while waiting for meshes to be frozen.";i?i(t):(ti.Logger.Error(t),e&&ti.Logger.Error(e))}else{let t="Scene: An unexpected error occurred while trying to freeze active meshes.";i?i(t):(ti.Logger.Error(t),e&&(ti.Logger.Error(e),e.stack&&ti.Logger.Error(e.stack)))}}),this}return this.executeWhenReady(()=>{if(!this.activeCamera){i&&i("No active camera found");return}if(this._frustumPlanes||this.updateTransformMatrix(),this._evaluateActiveMeshes(),this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=r,this._skipEvaluateActiveMeshesCompletely=e,s)for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._freeze();t&&t()}),this}unfreezeActiveMeshes(){for(let e=0;e<this.meshes.length;e++){let t=this.meshes[e];t._internalAbstractMeshDataInfo&&(t._internalAbstractMeshDataInfo._isActive=!1)}if(this._freezeActiveMeshesCancel?.(),this._freezeActiveMeshesCancel=null,this.frameGraph)for(let e of this.frameGraph.getTasksByClassName(["FrameGraphObjectRendererTask","FrameGraphGeometryRendererTask"]))e.objectRenderer._unfreezeActiveMeshes();else for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._unFreeze();return this._activeMeshesFrozen=!1,this}_executeActiveContainerCleanup(e){(!this._engine.snapshotRendering||1!==this._engine.snapshotRenderingMode)&&this._activeMeshesFrozen&&this._activeMeshes.length||this.onBeforeRenderObservable.addOnce(()=>e.dispose())}_evaluateActiveMeshes(){if(this._engine.snapshotRendering&&1===this._engine.snapshotRenderingMode){this._activeMeshes.length>0&&(this.activeCamera?._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset());return}if(this._activeMeshesFrozen&&this._activeMeshes.length){if(!this._skipEvaluateActiveMeshesCompletely){let e=this._activeMeshes.length;for(let t=0;t<e;t++)this._activeMeshes.data[t].computeWorldMatrix()}if(this._activeParticleSystems){let e=this._activeParticleSystems.length;for(let t=0;t<e;t++)this._activeParticleSystems.data[t].animate()}this._renderingManager.resetSprites();return}if(!this.activeCamera)return;for(let e of(this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this),this.activeCamera._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset(),this._materialsRenderTargets.reset(),this._beforeEvaluateActiveMeshStage))e.action();let e=this.getActiveMeshCandidates(),t=e.length;for(let i=0;i<t;i++){let t=e.data[i],s=t._internalAbstractMeshDataInfo._currentLOD.get(this.activeCamera);if(s?s[1]=-1:(s=[t,-1],t._internalAbstractMeshDataInfo._currentLOD.set(this.activeCamera,s)),t.isBlocked||(this._totalVertices.addCount(t.getTotalVertices(),!1),!t.isReady()||!t.isEnabled()||t.scaling.hasAZeroComponent))continue;t.computeWorldMatrix(),t.actionManager&&t.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNoDuplicate(t);let r=this.customLODSelector?this.customLODSelector(t,this.activeCamera):t.getLOD(this.activeCamera);if(s[0]=r,s[1]=this._frameId,null!=r&&(r!==t&&0!==r.billboardMode&&r.computeWorldMatrix(),t._preActivate(),t.isVisible&&t.visibility>0&&(t.layerMask&this.activeCamera.layerMask)!=0&&(this._skipFrustumClipping||t.alwaysSelectAsActiveMesh||t.isInFrustum(this._frustumPlanes)))){for(let e of(this._activeMeshes.push(t),this.activeCamera._activeMeshes.push(t),r!==t&&r._activate(this._renderId,!1),this._preActiveMeshStage))e.action(t);t._activate(this._renderId,!1)&&(t.isAnInstance?t._internalAbstractMeshDataInfo._actAsRegularMesh&&(r=t):r._internalAbstractMeshDataInfo._onlyForInstances=!1,r._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(t,r)),t._postActivate()}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(let e=0;e<this.particleSystems.length;e++){let t=this.particleSystems[e];if(!t.isStarted()||!t.emitter)continue;let i=t.emitter;(!i.position||i.isEnabled())&&(this._activeParticleSystems.push(t),t.animate(),this._renderingManager.dispatchParticles(t))}this.onAfterParticlesRenderingObservable.notifyObservers(this)}}_prepareSkeleton(e){this._skeletonsEnabled&&e.skeleton&&(this._activeSkeletons.pushNoDuplicate(e.skeleton)&&(e.skeleton.prepare(),this._activeBones.addCount(e.skeleton.bones.length,!1)),!e.computeBonesUsingShaders&&this._softwareSkinnedMeshes.pushNoDuplicate(e)&&this.frameGraph&&e.applySkeleton(e.skeleton))}_activeMesh(e,t){this._prepareSkeleton(t);let i=e.hasInstances||e.isAnInstance||this.dispatchAllSubMeshesOfActiveMeshes||this._skipFrustumClipping||t.alwaysSelectAsActiveMesh;if(t&&t.subMeshes&&t.subMeshes.length>0){let s=this.getActiveSubMeshCandidates(t),r=s.length;i=i||1===r;for(let n=0;n<r;n++){let r=s.data[n];this._evaluateSubMesh(r,t,e,i)}}}updateTransformMatrix(e){let t=this.activeCamera;if(t)if(t._renderingMultiview){let i=t._rigCameras[0],s=t._rigCameras[1];this.setTransformMatrix(i.getViewMatrix(),i.getProjectionMatrix(e),s.getViewMatrix(),s.getProjectionMatrix(e))}else this.setTransformMatrix(t.getViewMatrix(),t.getProjectionMatrix(e))}_bindFrameBuffer(e,t=!0){!this._useCurrentFrameBuffer&&(e&&e._multiviewTexture?e._multiviewTexture._bindFrameBuffer():e&&e.outputRenderTarget?e.outputRenderTarget._bindFrameBuffer():this._engine._currentFrameBufferIsDefaultFrameBuffer()||this._engine.restoreDefaultFramebuffer()),t&&this._clearFrameBuffer(e)}_clearFrameBuffer(e){if(e&&e._multiviewTexture);else if(e&&e.outputRenderTarget&&!e._renderingMultiview){let t=e.outputRenderTarget;t.onClearObservable.hasObservers()?t.onClearObservable.notifyObservers(this._engine):t.skipInitialClear||e.isRightCamera||(this.autoClear&&this._engine.clear(t.clearColor||this._clearColor,!t._cleared,!0,!0),t._cleared=!0)}else this._defaultFrameBufferCleared?this._engine.clear(null,!1,!0,!0):(this._defaultFrameBufferCleared=!0,this._clear())}_renderForCamera(e,t,i=!0){if(e&&e._skipRendering)return;let s=this._engine;if(this._activeCamera=e,!this.activeCamera)throw Error("Active camera not set");if(s.setViewport(this.activeCamera.viewport),this.resetCachedMaterial(),this._renderId++,!this.prePass&&i){let t=!0;e._renderingMultiview&&e.outputRenderTarget&&(t=e.outputRenderTarget.skipInitialClear,this.autoClear&&(this._defaultFrameBufferCleared=!1,e.outputRenderTarget.skipInitialClear=!1)),this._bindFrameBuffer(this._activeCamera),e._renderingMultiview&&e.outputRenderTarget&&(e.outputRenderTarget.skipInitialClear=t)}this.updateTransformMatrix(),this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera),this._engine.currentRenderPassId=e.outputRenderTarget?.renderPassId??e.renderPassId??0,this._evaluateActiveMeshes();for(let e=0;e<this._softwareSkinnedMeshes.length;e++){let t=this._softwareSkinnedMeshes.data[e];t.applySkeleton(t.skeleton)}for(let i of(this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets),e.customRenderTargets&&e.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(e.customRenderTargets),t&&t.customRenderTargets&&t.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(t.customRenderTargets),this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture),this._gatherActiveCameraRenderTargetsStage))i.action(this._renderTargets);let r=!1;if(this.renderTargetsEnabled){let e;if(this._intermediateRendering=!0,this._renderTargets.length>0){ev.Tools.StartPerformanceCounter("Render targets",this._renderTargets.length>0);let t=this.getBoundingBoxRenderer?.();for(let i=0;i<this._renderTargets.length;i++){let s=this._renderTargets.data[i];if(s._shouldRender()){this._renderId++;let i=s.activeCamera&&s.activeCamera!==this.activeCamera;t&&!e&&((e=t.renderList.length>0?t.renderList.data.slice():[]).length=t.renderList.length),s.render(i,this.dumpNextRenderTargets),r=!0}}t&&e&&(t.renderList.data=e,t.renderList.length=e.length),ev.Tools.EndPerformanceCounter("Render targets",this._renderTargets.length>0),this._renderId++}if(this._cameraDrawRenderTargetStage.length>0){let t=this.getBoundingBoxRenderer?.();for(let i of(t&&!e&&((e=t.renderList.length>0?t.renderList.data.slice():[]).length=t.renderList.length),this._cameraDrawRenderTargetStage))r=i.action(this.activeCamera)||r;t&&e&&(t.renderList.data=e,t.renderList.length=e.length)}this._intermediateRendering=!1}for(let t of(r&&!this.prePass&&(this._bindFrameBuffer(this._activeCamera,!1),this.updateTransformMatrix()),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),!this.postProcessManager||e._multiviewTexture||this.prePass||this.postProcessManager._prepareFrame(),this._beforeCameraDrawStage))t.action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this);let n=s.snapshotRendering&&1===s.snapshotRenderingMode;for(let e of(n&&this.finalizeSceneUbo(),this._renderingManager.render(null,null,!0,!n),this.onAfterDrawPhaseObservable.notifyObservers(this),this._afterCameraDrawStage))e.action(this.activeCamera);if(this.postProcessManager&&!e._multiviewTexture){let t=e.outputRenderTarget?e.outputRenderTarget.renderTarget:void 0;this.postProcessManager._finalizeFrame(e.isIntermediate,t)}for(let e of this._afterCameraPostProcessStage)e.action(this.activeCamera);this._renderTargets.reset(),this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera)}_processSubCameras(e,t=!0){if(0===e.cameraRigMode||e._renderingMultiview){e._renderingMultiview&&!this._multiviewSceneUbo&&this._createMultiviewUbo(),this._renderForCamera(e,void 0,t),this.onAfterRenderCameraObservable.notifyObservers(e);return}if(e._useMultiviewToSingleView)this._renderMultiviewToSingleView(e);else{this.onBeforeCameraRenderObservable.notifyObservers(e);for(let t=0;t<e._rigCameras.length;t++)this._renderForCamera(e._rigCameras[t],e)}this._activeCamera=e,this.updateTransformMatrix(),this.onAfterRenderCameraObservable.notifyObservers(e)}_checkIntersections(){for(let e=0;e<this._meshesForIntersections.length;e++){let t=this._meshesForIntersections.data[e];if(t.actionManager)for(let e=0;t.actionManager&&e<t.actionManager.actions.length;e++){let i=t.actionManager.actions[e];if(12===i.trigger||13===i.trigger){let e=i.getTriggerParameter(),s=e.mesh?e.mesh:e,r=s.intersectsMesh(t,e.usePreciseIntersection),n=t._intersectionsInProgress.indexOf(s);r&&-1===n?12===i.trigger?(i._executeCurrent(ex.CreateNew(t,void 0,s)),t._intersectionsInProgress.push(s)):13===i.trigger&&t._intersectionsInProgress.push(s):!r&&n>-1&&(13===i.trigger&&i._executeCurrent(ex.CreateNew(t,void 0,s)),t.actionManager.hasSpecificTrigger(13,e=>s===(e.mesh?e.mesh:e))&&13!==i.trigger||t._intersectionsInProgress.splice(n,1))}}}}_advancePhysicsEngineStep(e){}_animate(e){}animate(){if(this._engine.isDeterministicLockStep()){let e=Math.max(ta.MinDeltaTime,Math.min(this._engine.getDeltaTime(),ta.MaxDeltaTime))+this._timeAccumulator,t=this._engine.getTimeStep(),i=1e3/t/1e3,s=0,r=this._engine.getLockstepMaxSteps(),n=Math.floor(e/t);for(n=Math.min(n,r);e>0&&s<n;)this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=t*i,this._animate(t),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(t),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,s++,e-=t;this._timeAccumulator=e<0?0:e}else{let e=this.useConstantAnimationDeltaTime?16:Math.max(ta.MinDeltaTime,Math.min(this._engine.getDeltaTime(),ta.MaxDeltaTime));this._animationRatio=.06*e,this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(e)}}_clear(){(this.autoClearDepthAndStencil||this.autoClear)&&this._engine.clear(this._clearColor,this.autoClear||this.forceWireframe||this.forcePointsCloud,this.autoClearDepthAndStencil,this.autoClearDepthAndStencil)}_checkCameraRenderTarget(e){if(e?.outputRenderTarget&&!e?.isRigCamera&&(e.outputRenderTarget._cleared=!1),e?.rigCameras?.length)for(let t=0;t<e.rigCameras.length;++t){let i=e.rigCameras[t].outputRenderTarget;i&&(i._cleared=!1)}}resetDrawCache(e){if(this.meshes)for(let t of this.meshes)t.resetDrawCache(e)}_renderWithFrameGraph(e=!0,t=!1,i=!1){if(this.activeCamera=null,this.activeCameras=null,e){for(let e of this.cameras)if(e.update(),0!==e.cameraRigMode)for(let t=0;t<e._rigCameras.length;t++)e._rigCameras[t].update()}this.onBeforeRenderObservable.notifyObservers(this),this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),this._renderTargets.reset();let s=this._frameGraph?.findMainCamera()??null;if(this.renderTargetsEnabled){this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture),this._renderTargets.concatWithNoDuplicate(this.customRenderTargets),ev.Tools.StartPerformanceCounter("Custom render targets",this._renderTargets.length>0);for(let e=0;e<this._renderTargets.length;e++){let t=this._renderTargets.data[e],i=t.activeCamera||s;this._renderRenderTarget(t,i,!0,this.dumpNextRenderTargets)}ev.Tools.EndPerformanceCounter("Custom render targets",this._renderTargets.length>0),this._renderId++}for(let e of(this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this._beforeClearStage))e.action();if(this._engine.snapshotRendering&&1===this._engine.snapshotRenderingMode)this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();else{let e=this.getActiveMeshCandidates(),t=e.length;if(this._activeMeshesFrozen){if(!this._skipEvaluateActiveMeshesCompletely)for(let i=0;i<t;i++){let t=e.data[i];t._internalAbstractMeshDataInfo._wasActiveLastFrame&&t.computeWorldMatrix()}if(this.particlesEnabled){let e=this._activeParticleSystems.length;for(let t=0;t<e;t++)this._activeParticleSystems.data[t].animate()}}else{this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();for(let s=0;s<t;s++){let t=e.data[s];t._internalAbstractMeshDataInfo._wasActiveLastFrame=!1,!t.isBlocked&&(this._totalVertices.addCount(t.getTotalVertices(),!1),t.isReady()&&t.isEnabled()&&!t.scaling.hasAZeroComponent&&(t.computeWorldMatrix(i),t.actionManager&&t.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNoDuplicate(t)))}if(this.particlesEnabled)for(let e=0;e<this.particleSystems.length;e++){let t=this.particleSystems[e];if(!t.isStarted()||!t.emitter)continue;let i=t.emitter;(!i.position||i.isEnabled())&&(this._activeParticleSystems.push(t),t.animate())}}}this.frameGraph?.execute()}_renderRenderTarget(e,t,i=!1,s=!1){if(this._intermediateRendering=!0,e._shouldRender()){if(this._renderId++,this.activeCamera=t,!this.activeCamera)throw Error("Active camera not set");this._engine.setViewport(this.activeCamera.viewport),this.updateTransformMatrix(),e.render(i,s)}this._intermediateRendering=!1}render(e=!0,t=!1){if(!this.isDisposed){if(this.onReadyObservable.hasObservers()&&null===this._executeWhenReadyTimeoutId&&this._checkIsReady(),eF.FloatingOriginCurrentScene.getScene=this._getFloatingOriginScene,this._frameId++,this._defaultFrameBufferCleared=!1,this._checkCameraRenderTarget(this.activeCamera),this.activeCameras?.length)for(let e of this.activeCameras)this._checkCameraRenderTarget(e);for(let e of(this._registerTransientComponents(),this._activeParticles.fetchNewFrame(),this._totalVertices.fetchNewFrame(),this._activeIndices.fetchNewFrame(),this._activeBones.fetchNewFrame(),this._meshesForIntersections.reset(),this.resetCachedMaterial(),this.onBeforeAnimationsObservable.notifyObservers(this),this.actionManager&&this.actionManager.processTrigger(11),t||this.animate(),this._beforeCameraUpdateStage))e.action();if(e){if(this.activeCameras&&this.activeCameras.length>0)for(let e=0;e<this.activeCameras.length;e++){let t=this.activeCameras[e];if(t.update(),0!==t.cameraRigMode)for(let e=0;e<t._rigCameras.length;e++)t._rigCameras[e].update()}else if(this.activeCamera&&(this.activeCamera.update(),0!==this.activeCamera.cameraRigMode))for(let e=0;e<this.activeCamera._rigCameras.length;e++)this.activeCamera._rigCameras[e].update()}if(this.customRenderFunction)this._renderId++,this._engine.currentRenderPassId=0,this.customRenderFunction(e,t);else{this.onBeforeRenderObservable.notifyObservers(this),this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);let e=this.activeCameras?.length?this.activeCameras[0]:this.activeCamera;if(this.renderTargetsEnabled){ev.Tools.StartPerformanceCounter("Custom render targets",this.customRenderTargets.length>0);for(let t=0;t<this.customRenderTargets.length;t++){let i=this.customRenderTargets[t],s=i.activeCamera||this.activeCamera;this._renderRenderTarget(i,s,e!==s,this.dumpNextRenderTargets)}ev.Tools.EndPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._renderId++}for(let t of(this._engine.currentRenderPassId=e?.renderPassId??0,this.activeCamera=e,this._activeCamera&&22!==this._activeCamera.cameraRigMode&&!this.prePass&&this._bindFrameBuffer(this._activeCamera,!1),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this._beforeClearStage))t.action();for(let e of(this._clearFrameBuffer(this.activeCamera),this._gatherRenderTargetsStage))e.action(this._renderTargets);if(this.activeCameras&&this.activeCameras.length>0)for(let e=0;e<this.activeCameras.length;e++)this._processSubCameras(this.activeCameras[e],e>0);else{if(!this.activeCamera)throw Error("No camera defined");this._processSubCameras(this.activeCamera,!!this.activeCamera.outputRenderTarget)}}for(let e of(this._checkIntersections(),this._afterRenderStage))e.action();if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(let e=0;e<this._toBeDisposed.length;e++){let t=this._toBeDisposed[e];t&&t.dispose()}this._toBeDisposed.length=0}this.dumpNextRenderTargets&&(this.dumpNextRenderTargets=!1),this._activeBones.addCount(0,!0),this._activeIndices.addCount(0,!0),this._activeParticles.addCount(0,!0),this._engine.restoreDefaultFramebuffer()}}freezeMaterials(){for(let e=0;e<this.materials.length;e++)this.materials[e].freeze()}unfreezeMaterials(){for(let e=0;e<this.materials.length;e++)this.materials[e].unfreeze()}dispose(){if(this.isDisposed)return;if(this.beforeRender=null,this.afterRender=null,this.metadata=null,this.skeletons.length=0,this.morphTargetManagers.length=0,this._transientComponents.length=0,this._isReadyForMeshStage.clear(),this._beforeEvaluateActiveMeshStage.clear(),this._evaluateSubMeshStage.clear(),this._preActiveMeshStage.clear(),this._cameraDrawRenderTargetStage.clear(),this._beforeCameraDrawStage.clear(),this._beforeRenderTargetDrawStage.clear(),this._beforeRenderingGroupDrawStage.clear(),this._beforeRenderingMeshStage.clear(),this._afterRenderingMeshStage.clear(),this._afterRenderingGroupDrawStage.clear(),this._afterCameraDrawStage.clear(),this._afterRenderTargetDrawStage.clear(),this._afterRenderStage.clear(),this._beforeCameraUpdateStage.clear(),this._beforeClearStage.clear(),this._gatherRenderTargetsStage.clear(),this._gatherActiveCameraRenderTargetsStage.clear(),this._pointerMoveStage.clear(),this._pointerDownStage.clear(),this._pointerUpStage.clear(),this._isReadyChecks.length=0,this.importedMeshesFiles=[],this._activeAnimatables&&(0,ez._IsSideEffectImplemented)(this.stopAllAnimations)){for(let e of this._activeAnimatables)e.onAnimationEndObservable.clear(),e.onAnimationEnd=null;this.stopAllAnimations()}for(let e of(this.resetCachedMaterial(),this.activeCamera&&(this.activeCamera._activeMeshes.dispose(),this.activeCamera=null),this.activeCameras=null,this._activeMeshes.dispose(),this._renderingManager.dispose(),this._processedMaterials.dispose(),this._activeParticleSystems.dispose(),this._activeSkeletons.dispose(),this._softwareSkinnedMeshes.dispose(),this._renderTargets.dispose(),this._materialsRenderTargets.dispose(),this._registeredForLateAnimationBindings.dispose(),this._meshesForIntersections.dispose(),this._toBeDisposed.length=0,this._activeRequests.slice()))e.abort();this._activeRequests.length=0;try{this.onDisposeObservable.notifyObservers(this)}catch(e){ti.Logger.Error("An error occurred while calling onDisposeObservable!",e)}if(this.detachControl(),this._engine.getInputElement?.())for(let e=0;e<this.cameras.length;e++)this.cameras[e].detachControl();this._disposeList(this.animationGroups),this._disposeList(this.lights),this._defaultMaterial&&this._defaultMaterial.dispose(),this._disposeList(this.multiMaterials),this._disposeList(this.materials),this._disposeList(this.meshes,e=>e.dispose(!0)),this._disposeList(this.transformNodes,e=>e.dispose(!0));let e=this.cameras;this._disposeList(e),this._disposeList(this.particleSystems),this._disposeList(this.postProcesses),this._disposeList(this.textures),this._disposeList(this.morphTargetManagers),this._disposeList(this.frameGraphs),this._sceneUbo.dispose(),this._multiviewSceneUbo&&this._multiviewSceneUbo.dispose(),this.postProcessManager.dispose(),this._disposeList(this._components);let t=this._engine.scenes.indexOf(this);if(t>-1&&this._engine.scenes.splice(t,1),this._floatingOriginScene=void 0,0===this._engine.scenes.length&&(0,eF.ResetMatrixFunctions)(),eq.EngineStore._LastCreatedScene===this){eq.EngineStore._LastCreatedScene=null;let e=eq.EngineStore.Instances.length-1;for(;e>=0;){let t=eq.EngineStore.Instances[e];if(t.scenes.length>0){eq.EngineStore._LastCreatedScene=t.scenes[this._engine.scenes.length-1];break}e--}}(t=this._engine._virtualScenes.indexOf(this))>-1&&this._engine._virtualScenes.splice(t,1),this._engine.wipeCaches(!0),this.onDisposeObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderTargetsRenderObservable.clear(),this.onAfterRenderTargetsRenderObservable.clear(),this.onAfterStepObservable.clear(),this.onBeforeStepObservable.clear(),this.onBeforeActiveMeshesEvaluationObservable.clear(),this.onAfterActiveMeshesEvaluationObservable.clear(),this.onBeforeParticlesRenderingObservable.clear(),this.onAfterParticlesRenderingObservable.clear(),this.onBeforeDrawPhaseObservable.clear(),this.onAfterDrawPhaseObservable.clear(),this.onBeforeAnimationsObservable.clear(),this.onAfterAnimationsObservable.clear(),this.onDataLoadedObservable.clear(),this.onBeforeRenderingGroupObservable.clear(),this.onAfterRenderingGroupObservable.clear(),this.onMeshImportedObservable.clear(),this.onBeforeCameraRenderObservable.clear(),this.onAfterCameraRenderObservable.clear(),this.onAfterRenderCameraObservable.clear(),this.onReadyObservable.clear(),this.onNewCameraAddedObservable.clear(),this.onCameraRemovedObservable.clear(),this.onNewLightAddedObservable.clear(),this.onLightRemovedObservable.clear(),this.onNewGeometryAddedObservable.clear(),this.onGeometryRemovedObservable.clear(),this.onNewTransformNodeAddedObservable.clear(),this.onTransformNodeRemovedObservable.clear(),this.onNewMeshAddedObservable.clear(),this.onMeshRemovedObservable.clear(),this.onNewSkeletonAddedObservable.clear(),this.onSkeletonRemovedObservable.clear(),this.onNewMaterialAddedObservable.clear(),this.onNewMultiMaterialAddedObservable.clear(),this.onMaterialRemovedObservable.clear(),this.onMultiMaterialRemovedObservable.clear(),this.onNewTextureAddedObservable.clear(),this.onTextureRemovedObservable.clear(),this.onNewFrameGraphAddedObservable.clear(),this.onFrameGraphRemovedObservable.clear(),this.onNewObjectRendererAddedObservable.clear(),this.onObjectRendererRemovedObservable.clear(),this.onPrePointerObservable.clear(),this.onPointerObservable.clear(),this.onPreKeyboardObservable.clear(),this.onKeyboardObservable.clear(),this.onActiveCameraChanged.clear(),this.onScenePerformancePriorityChangedObservable.clear(),this.onClearColorChangedObservable.clear(),this.onEnvironmentTextureChangedObservable.clear(),this.onMeshUnderPointerUpdatedObservable.clear(),this._isDisposed=!0}_disposeList(e,t){let i=e.slice(0);for(let e of(t=t??(e=>e.dispose()),i))t(e);e.length=0}get isDisposed(){return this._isDisposed}clearCachedVertexData(){for(let e=0;e<this.meshes.length;e++){let t=this.meshes[e].geometry;t&&t.clearCachedData()}}cleanCachedTextureBuffer(){for(let e of this.textures)e._buffer&&(e._buffer=null)}getWorldExtends(e){let t=new eM.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),i=new eM.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let s of(e=e||(()=>!0),this.meshes.filter(e))){if(s.computeWorldMatrix(!0),!s.subMeshes||0===s.subMeshes.length||s.infiniteDistance)continue;let e=s.getBoundingInfo(),r=e.boundingBox.minimumWorld,n=e.boundingBox.maximumWorld;eM.Vector3.CheckExtends(r,t,i),eM.Vector3.CheckExtends(n,t,i)}return t.x===Number.MAX_VALUE?{min:eM.Vector3.Zero(),max:eM.Vector3.Zero()}:{min:t,max:i}}createPickingRay(e,t,i,s,r=!1){throw(0,ez._WarnImport)("Ray")}createPickingRayToRef(e,t,i,s,r,n=!1,a=!1){throw(0,ez._WarnImport)("Ray")}createPickingRayInCameraSpace(e,t,i){throw(0,ez._WarnImport)("Ray")}createPickingRayInCameraSpaceToRef(e,t,i,s){throw(0,ez._WarnImport)("Ray")}pick(e,t,i,s,r,n){let a=(0,ez._WarnImport)("Ray",!0);return a&&ti.Logger.Warn(a),new ew.PickingInfo}pickWithBoundingInfo(e,t,i,s,r){let n=(0,ez._WarnImport)("Ray",!0);return n&&ti.Logger.Warn(n),new ew.PickingInfo}pickWithRay(e,t,i,s){throw(0,ez._WarnImport)("Ray")}multiPick(e,t,i,s,r){throw(0,ez._WarnImport)("Ray")}multiPickWithRay(e,t,i){throw(0,ez._WarnImport)("Ray")}setPointerOverMesh(e,t,i){this._inputManager.setPointerOverMesh(e,t,i)}getPointerOverMesh(){return this._inputManager.getPointerOverMesh()}_rebuildGeometries(){for(let e of this.geometries)e._rebuild();for(let e of this.meshes)e._rebuild();for(let e of(this.postProcessManager&&this.postProcessManager._rebuild(),this._components))e.rebuild();for(let e of this.particleSystems)e.rebuild();if(this.spriteManagers)for(let e of this.spriteManagers)e.rebuild()}_rebuildTextures(){for(let e of this.textures)e._rebuild(!0);this.markAllMaterialsAsDirty(1)}_getByTags(e,t,i){if(void 0===t)return e;let s=[];for(let r in e){let n=e[r];eC.Tags&&eC.Tags.MatchesQuery(n,t)&&(!i||i(n))&&s.push(n)}return s}getMeshesByTags(e,t){return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){return this._getByTags(this.lights,e,t)}getMaterialByTags(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){return this._getByTags(this.transformNodes,e,t)}setRenderingOrder(e,t=null,i=null,s=null){this._renderingManager.setRenderingOrder(e,t,i,s)}setRenderingAutoClearDepthStencil(e,t,i=!0,s=!0){this._renderingManager.setRenderingAutoClearDepthStencil(e,t,i,s)}getAutoClearDepthStencilSetup(e){return this._renderingManager.getAutoClearDepthStencilSetup(e)}_forceBlockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism=e}get blockMaterialDirtyMechanism(){return this._blockMaterialDirtyMechanism}set blockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism!==e&&(this._blockMaterialDirtyMechanism=e,e||this.markAllMaterialsAsDirty(127))}markAllMaterialsAsDirty(e,t){if(!this._blockMaterialDirtyMechanism)for(let i of this.materials)(!t||t(i))&&i.markAsDirty(e)}_loadFile(e,t,i,s,r,n,a){let o=(0,e8.LoadFile)(e,t,i,s?this.offlineProvider:void 0,r,n,a);return this._activeRequests.push(o),o.onCompleteObservable.add(e=>{this._activeRequests.splice(this._activeRequests.indexOf(e),1)}),o}async _loadFileAsync(e,t,i,s,r){return await new Promise((n,a)=>{this._loadFile(e,e=>{n(e)},t,i,s,(e,t)=>{a(t)},r)})}async _loadDelayedFileAsync(e,t,i){this._delayedFileRequests||(this._delayedFileRequests=new Map);let s=`${e}|${t?"binary":"string"}`,r=this._delayedFileRequests.get(s);if(!r){let n=r=t?this._loadFileAsync(e,void 0,i,!0):this._loadFileAsync(e,void 0,i,!1);(async()=>{try{await n}catch{}this._delayedFileRequests?.delete(s)})(),this._delayedFileRequests.set(s,r)}return await r}_requestFile(e,t,i,s,r,n,a){let o=(0,e8.RequestFile)(e,t,i,s?this.offlineProvider:void 0,r,n,a);return this._activeRequests.push(o),o.onCompleteObservable.add(e=>{this._activeRequests.splice(this._activeRequests.indexOf(e),1)}),o}async _requestFileAsync(e,t,i,s,r){return await new Promise((n,a)=>{this._requestFile(e,e=>{n(e)},t,i,s,e=>{a(e)},r)})}_readFile(e,t,i,s,r){let n=(0,e8.ReadFile)(e,t,i,s,r);return this._activeRequests.push(n),n.onCompleteObservable.add(e=>{this._activeRequests.splice(this._activeRequests.indexOf(e),1)}),n}async _readFileAsync(e,t,i){return await new Promise((s,r)=>{this._readFile(e,e=>{s(e)},t,i,e=>{r(e)})})}getPerfCollector(){throw(0,ez._WarnImport)("performanceViewerSceneExtension")}setActiveCameraByID(e){return this.setActiveCameraById(e)}getMaterialByID(e){return this.getMaterialById(e)}getLastMaterialByID(e){return this.getLastMaterialById(e)}getTextureByUniqueID(e){return this.getTextureByUniqueId(e)}getCameraByID(e){return this.getCameraById(e)}getCameraByUniqueID(e){return this.getCameraByUniqueId(e)}getBoneByID(e){return this.getBoneById(e)}getLightByID(e){return this.getLightById(e)}getLightByUniqueID(e){return this.getLightByUniqueId(e)}getParticleSystemByID(e){return this.getParticleSystemById(e)}getGeometryByID(e){return this.getGeometryById(e)}getMeshByID(e){return this.getMeshById(e)}getMeshByUniqueID(e){return this.getMeshByUniqueId(e)}getLastMeshByID(e){return this.getLastMeshById(e)}getMeshesByID(e){return this.getMeshesById(e)}getTransformNodeByID(e){return this.getTransformNodeById(e)}getTransformNodeByUniqueID(e){return this.getTransformNodeByUniqueId(e)}getTransformNodesByID(e){return this.getTransformNodesById(e)}getNodeByID(e){return this.getNodeById(e)}getLastEntryByID(e){return this.getLastEntryById(e)}getLastSkeletonByID(e){return this.getLastSkeletonById(e)}}ta.FOGMODE_NONE=0,ta.FOGMODE_EXP=1,ta.FOGMODE_EXP2=2,ta.FOGMODE_LINEAR=3,ta.MinDeltaTime=1,ta.MaxDeltaTime=1e3,ta._OriginalDefaultMaterialFactory=ta.DefaultMaterialFactory;let to=!1;(v=ta.prototype).sortActiveAnimatables??(v.sortActiveAnimatables=(0,ez._MissingSideEffect)("Scene","sortActiveAnimatables")),(f=ta.prototype).beginWeightedAnimation??(f.beginWeightedAnimation=(0,ez._MissingSideEffect)("Scene","beginWeightedAnimation")),(m=ta.prototype).beginAnimation??(m.beginAnimation=(0,ez._MissingSideEffect)("Scene","beginAnimation")),(b=ta.prototype).beginHierarchyAnimation??(b.beginHierarchyAnimation=(0,ez._MissingSideEffect)("Scene","beginHierarchyAnimation")),(y=ta.prototype).beginDirectAnimation??(y.beginDirectAnimation=(0,ez._MissingSideEffect)("Scene","beginDirectAnimation")),(P=ta.prototype).beginDirectHierarchyAnimation??(P.beginDirectHierarchyAnimation=(0,ez._MissingSideEffect)("Scene","beginDirectHierarchyAnimation")),(C=ta.prototype).getAnimatableByTarget??(C.getAnimatableByTarget=(0,ez._MissingSideEffect)("Scene","getAnimatableByTarget")),(M=ta.prototype).getAllAnimatablesByTarget??(M.getAllAnimatablesByTarget=(0,ez._MissingSideEffect)("Scene","getAllAnimatablesByTarget")),(S=ta.prototype).stopAllAnimations??(S.stopAllAnimations=(0,ez._MissingSideEffect)("Scene","stopAllAnimations")),(O=ta.prototype).getSoundByName??(O.getSoundByName=(0,ez._MissingSideEffect)("Scene","getSoundByName")),(T=ta.prototype).createOrUpdateSelectionOctree??(T.createOrUpdateSelectionOctree=(0,ez._MissingSideEffect)("Scene","createOrUpdateSelectionOctree")),(R=ta.prototype).createDefaultLight??(R.createDefaultLight=(0,ez._MissingSideEffect)("Scene","createDefaultLight")),(E=ta.prototype).createDefaultCamera??(E.createDefaultCamera=(0,ez._MissingSideEffect)("Scene","createDefaultCamera")),(I=ta.prototype).createDefaultCameraOrLight??(I.createDefaultCameraOrLight=(0,ez._MissingSideEffect)("Scene","createDefaultCameraOrLight")),(D=ta.prototype).createDefaultSkybox??(D.createDefaultSkybox=(0,ez._MissingSideEffect)("Scene","createDefaultSkybox")),(k=ta.prototype).createDefaultEnvironment??(k.createDefaultEnvironment=(0,ez._MissingSideEffect)("Scene","createDefaultEnvironment")),(A=ta.prototype).createDefaultVRExperience??(A.createDefaultVRExperience=(0,ez._MissingSideEffect)("Scene","createDefaultVRExperience")),(w=ta.prototype).createDefaultXRExperienceAsync??(w.createDefaultXRExperienceAsync=(0,ez._MissingSideEffect)("Scene","createDefaultXRExperienceAsync")),(x=ta.prototype).getGlowLayerByName??(x.getGlowLayerByName=(0,ez._MissingSideEffect)("Scene","getGlowLayerByName")),(B=ta.prototype).getHighlightLayerByName??(B.getHighlightLayerByName=(0,ez._MissingSideEffect)("Scene","getHighlightLayerByName")),(N=ta.prototype).getSelectionOutlineLayerByName??(N.getSelectionOutlineLayerByName=(0,ez._MissingSideEffect)("Scene","getSelectionOutlineLayerByName")),(F=ta.prototype).removeLensFlareSystem??(F.removeLensFlareSystem=(0,ez._MissingSideEffect)("Scene","removeLensFlareSystem")),(L=ta.prototype).addLensFlareSystem??(L.addLensFlareSystem=(0,ez._MissingSideEffect)("Scene","addLensFlareSystem")),(G=ta.prototype).getLensFlareSystemByName??(G.getLensFlareSystemByName=(0,ez._MissingSideEffect)("Scene","getLensFlareSystemByName")),(U=ta.prototype).getLensFlareSystemByID??(U.getLensFlareSystemByID=(0,ez._MissingSideEffect)("Scene","getLensFlareSystemByID")),(W=ta.prototype).getLensFlareSystemById??(W.getLensFlareSystemById=(0,ez._MissingSideEffect)("Scene","getLensFlareSystemById")),(X=ta.prototype).getPhysicsEngine??(X.getPhysicsEngine=(0,ez._MissingSideEffect)("Scene","getPhysicsEngine")),(q=ta.prototype).enablePhysics??(q.enablePhysics=(0,ez._MissingSideEffect)("Scene","enablePhysics")),(z=ta.prototype).disablePhysicsEngine??(z.disablePhysicsEngine=(0,ez._MissingSideEffect)("Scene","disablePhysicsEngine")),(V=ta.prototype).isPhysicsEnabled??(V.isPhysicsEnabled=(0,ez._MissingSideEffect)("Scene","isPhysicsEnabled")),(j=ta.prototype).deleteCompoundImpostor??(j.deleteCompoundImpostor=(0,ez._MissingSideEffect)("Scene","deleteCompoundImpostor")),(Y=ta.prototype).removeReflectionProbe??(Y.removeReflectionProbe=(0,ez._MissingSideEffect)("Scene","removeReflectionProbe")),(H=ta.prototype).addReflectionProbe??(H.addReflectionProbe=(0,ez._MissingSideEffect)("Scene","addReflectionProbe")),(K=ta.prototype).getBoundingBoxRenderer??(K.getBoundingBoxRenderer=(0,ez._MissingSideEffect)("Scene","getBoundingBoxRenderer")),(Z=ta.prototype).enableDepthRenderer??(Z.enableDepthRenderer=(0,ez._MissingSideEffect)("Scene","enableDepthRenderer")),($=ta.prototype).disableDepthRenderer??($.disableDepthRenderer=(0,ez._MissingSideEffect)("Scene","disableDepthRenderer")),(Q=ta.prototype).enableFluidRenderer??(Q.enableFluidRenderer=(0,ez._MissingSideEffect)("Scene","enableFluidRenderer")),(J=ta.prototype).disableFluidRenderer??(J.disableFluidRenderer=(0,ez._MissingSideEffect)("Scene","disableFluidRenderer")),(ee=ta.prototype).enableGeometryBufferRenderer??(ee.enableGeometryBufferRenderer=(0,ez._MissingSideEffect)("Scene","enableGeometryBufferRenderer")),(et=ta.prototype).disableGeometryBufferRenderer??(et.disableGeometryBufferRenderer=(0,ez._MissingSideEffect)("Scene","disableGeometryBufferRenderer")),(ei=ta.prototype).enableIblCdfGenerator??(ei.enableIblCdfGenerator=(0,ez._MissingSideEffect)("Scene","enableIblCdfGenerator")),(es=ta.prototype).disableIblCdfGenerator??(es.disableIblCdfGenerator=(0,ez._MissingSideEffect)("Scene","disableIblCdfGenerator")),(er=ta.prototype).getOutlineRenderer??(er.getOutlineRenderer=(0,ez._MissingSideEffect)("Scene","getOutlineRenderer")),(en=ta.prototype).enablePrePassRenderer??(en.enablePrePassRenderer=(0,ez._MissingSideEffect)("Scene","enablePrePassRenderer")),(ea=ta.prototype).disablePrePassRenderer??(ea.disablePrePassRenderer=(0,ez._MissingSideEffect)("Scene","disablePrePassRenderer")),(eo=ta.prototype).enableSubSurfaceForPrePass??(eo.enableSubSurfaceForPrePass=(0,ez._MissingSideEffect)("Scene","enableSubSurfaceForPrePass")),(eh=ta.prototype).disableSubSurfaceForPrePass??(eh.disableSubSurfaceForPrePass=(0,ez._MissingSideEffect)("Scene","disableSubSurfaceForPrePass")),(el=ta.prototype).pickSprite??(el.pickSprite=(0,ez._MissingSideEffect)("Scene","pickSprite")),(ed=ta.prototype).pickSpriteWithRay??(ed.pickSpriteWithRay=(0,ez._MissingSideEffect)("Scene","pickSpriteWithRay")),(ec=ta.prototype).multiPickSprite??(ec.multiPickSprite=(0,ez._MissingSideEffect)("Scene","multiPickSprite")),(eu=ta.prototype).multiPickSpriteWithRay??(eu.multiPickSpriteWithRay=(0,ez._MissingSideEffect)("Scene","multiPickSpriteWithRay")),(ep=ta.prototype).setPointerOverSprite??(ep.setPointerOverSprite=(0,ez._MissingSideEffect)("Scene","setPointerOverSprite")),(e_=ta.prototype).getPointerOverSprite??(e_.getPointerOverSprite=(0,ez._MissingSideEffect)("Scene","getPointerOverSprite")),Object.getOwnPropertyDescriptor(ta.prototype,"mainSoundTrack")||Object.defineProperty(ta.prototype,"mainSoundTrack",(0,ez._MissingSideEffectProperty)("Scene","mainSoundTrack")),Object.getOwnPropertyDescriptor(ta.prototype,"soundTracks")||Object.defineProperty(ta.prototype,"soundTracks",(0,ez._MissingSideEffectProperty)("Scene","soundTracks")),Object.getOwnPropertyDescriptor(ta.prototype,"audioEnabled")||Object.defineProperty(ta.prototype,"audioEnabled",(0,ez._MissingSideEffectProperty)("Scene","audioEnabled")),Object.getOwnPropertyDescriptor(ta.prototype,"headphone")||Object.defineProperty(ta.prototype,"headphone",(0,ez._MissingSideEffectProperty)("Scene","headphone")),Object.getOwnPropertyDescriptor(ta.prototype,"audioListenerPositionProvider")||Object.defineProperty(ta.prototype,"audioListenerPositionProvider",(0,ez._MissingSideEffectProperty)("Scene","audioListenerPositionProvider")),Object.getOwnPropertyDescriptor(ta.prototype,"audioListenerRotationProvider")||Object.defineProperty(ta.prototype,"audioListenerRotationProvider",(0,ez._MissingSideEffectProperty)("Scene","audioListenerRotationProvider")),Object.getOwnPropertyDescriptor(ta.prototype,"audioPositioningRefreshRate")||Object.defineProperty(ta.prototype,"audioPositioningRefreshRate",(0,ez._MissingSideEffectProperty)("Scene","audioPositioningRefreshRate")),Object.getOwnPropertyDescriptor(ta.prototype,"selectionOctree")||Object.defineProperty(ta.prototype,"selectionOctree",(0,ez._MissingSideEffectProperty)("Scene","selectionOctree")),Object.getOwnPropertyDescriptor(ta.prototype,"debugLayer")||Object.defineProperty(ta.prototype,"debugLayer",(0,ez._MissingSideEffectProperty)("Scene","debugLayer")),Object.getOwnPropertyDescriptor(ta.prototype,"gamepadManager")||Object.defineProperty(ta.prototype,"gamepadManager",(0,ez._MissingSideEffectProperty)("Scene","gamepadManager")),Object.getOwnPropertyDescriptor(ta.prototype,"simplificationQueue")||Object.defineProperty(ta.prototype,"simplificationQueue",(0,ez._MissingSideEffectProperty)("Scene","simplificationQueue")),Object.getOwnPropertyDescriptor(ta.prototype,"onBeforePhysicsObservable")||Object.defineProperty(ta.prototype,"onBeforePhysicsObservable",(0,ez._MissingSideEffectProperty)("Scene","onBeforePhysicsObservable")),Object.getOwnPropertyDescriptor(ta.prototype,"onAfterPhysicsObservable")||Object.defineProperty(ta.prototype,"onAfterPhysicsObservable",(0,ez._MissingSideEffectProperty)("Scene","onAfterPhysicsObservable")),Object.getOwnPropertyDescriptor(ta.prototype,"reflectionProbes")||Object.defineProperty(ta.prototype,"reflectionProbes",(0,ez._MissingSideEffectProperty)("Scene","reflectionProbes")),Object.getOwnPropertyDescriptor(ta.prototype,"forceShowBoundingBoxes")||Object.defineProperty(ta.prototype,"forceShowBoundingBoxes",(0,ez._MissingSideEffectProperty)("Scene","forceShowBoundingBoxes")),Object.getOwnPropertyDescriptor(ta.prototype,"depthPeelingRenderer")||Object.defineProperty(ta.prototype,"depthPeelingRenderer",(0,ez._MissingSideEffectProperty)("Scene","depthPeelingRenderer")),Object.getOwnPropertyDescriptor(ta.prototype,"useOrderIndependentTransparency")||Object.defineProperty(ta.prototype,"useOrderIndependentTransparency",(0,ez._MissingSideEffectProperty)("Scene","useOrderIndependentTransparency")),Object.getOwnPropertyDescriptor(ta.prototype,"fluidRenderer")||Object.defineProperty(ta.prototype,"fluidRenderer",(0,ez._MissingSideEffectProperty)("Scene","fluidRenderer")),Object.getOwnPropertyDescriptor(ta.prototype,"geometryBufferRenderer")||Object.defineProperty(ta.prototype,"geometryBufferRenderer",(0,ez._MissingSideEffectProperty)("Scene","geometryBufferRenderer")),Object.getOwnPropertyDescriptor(ta.prototype,"iblCdfGenerator")||Object.defineProperty(ta.prototype,"iblCdfGenerator",(0,ez._MissingSideEffectProperty)("Scene","iblCdfGenerator")),Object.getOwnPropertyDescriptor(ta.prototype,"prePassRenderer")||Object.defineProperty(ta.prototype,"prePassRenderer",(0,ez._MissingSideEffectProperty)("Scene","prePassRenderer")),Object.getOwnPropertyDescriptor(ta.prototype,"subSurfaceConfiguration")||Object.defineProperty(ta.prototype,"subSurfaceConfiguration",(0,ez._MissingSideEffectProperty)("Scene","subSurfaceConfiguration")),Object.getOwnPropertyDescriptor(ta.prototype,"spriteManagers")||Object.defineProperty(ta.prototype,"spriteManagers",(0,ez._MissingSideEffectProperty)("Scene","spriteManagers")),Object.getOwnPropertyDescriptor(ta.prototype,"onBeforeSpritesRenderingObservable")||Object.defineProperty(ta.prototype,"onBeforeSpritesRenderingObservable",(0,ez._MissingSideEffectProperty)("Scene","onBeforeSpritesRenderingObservable")),Object.getOwnPropertyDescriptor(ta.prototype,"onAfterSpritesRenderingObservable")||Object.defineProperty(ta.prototype,"onAfterSpritesRenderingObservable",(0,ez._MissingSideEffectProperty)("Scene","onAfterSpritesRenderingObservable")),e.s(["RegisterScene",0,function(){to||(to=!0,(0,ts.RegisterClass)("BABYLON.Scene",ta))},"Scene",0,ta,"ScenePerformancePriority",0,eg],66749)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25348,e=>{"use strict";class t{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}toGlobal(e,i){return new t(this.x*e,this.y*i,this.width*e,this.height*i)}toGlobalToRef(e,t,i){return i.x=this.x*e,i.y=this.y*t,i.width=this.width*e,i.height=this.height*t,this}clone(){return new t(this.x,this.y,this.width,this.height)}}e.s(["Viewport",0,t])},34548,e=>{"use strict";var t=e.i(10272),i=e.i(96265),s=e.i(37143),r=e.i(99267),o=e.i(81623),a=e.i(75405),n=e.i(80871);class h{constructor(){this._doNotSerialize=!1,this._isDisposed=!1,this._sceneRootNodesIndex=-1,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._onEnabledStateChangedObservable=new r.Observable,this._onClonedObservable=new r.Observable,this._inheritVisibility=!1,this._isVisible=!0}}class _{static AddNodeConstructor(e,t){this._NodeConstructors[e]=t}static Construct(e,t,i,s){let r=this._NodeConstructors[e];return r?r(t,i,s):null}set accessibilityTag(e){this._accessibilityTag=e,this.onAccessibilityTagChangedObservable.notifyObservers(e)}get accessibilityTag(){return this._accessibilityTag}get doNotSerialize(){return!!this._nodeDataStorage._doNotSerialize||!!this._parentNode&&this._parentNode.doNotSerialize}set doNotSerialize(e){this._nodeDataStorage._doNotSerialize=e}isDisposed(){return this._nodeDataStorage._isDisposed}set parent(e){if(this._parentNode===e)return;let t=this._parentNode;if(this._parentNode&&void 0!==this._parentNode._children&&null!==this._parentNode._children){let t=this._parentNode._children.indexOf(this);-1!==t&&this._parentNode._children.splice(t,1),e||this._nodeDataStorage._isDisposed||this._addToSceneRootNodes()}this._parentNode=e,this._isDirty=!0,this._parentNode&&((void 0===this._parentNode._children||null===this._parentNode._children)&&(this._parentNode._children=[]),this._parentNode._children.push(this),t||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}get parent(){return this._parentNode}get inheritVisibility(){return this._nodeDataStorage._inheritVisibility}set inheritVisibility(e){this._nodeDataStorage._inheritVisibility=e}get isVisible(){return(!this.inheritVisibility||!this._parentNode||!!this._parentNode.isVisible)&&this._nodeDataStorage._isVisible}set isVisible(e){this._nodeDataStorage._isVisible=e}_serializeAsParent(e){e.parentId=this.uniqueId}_addToSceneRootNodes(){-1===this._nodeDataStorage._sceneRootNodesIndex&&(this._nodeDataStorage._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))}_removeFromSceneRootNodes(){if(-1!==this._nodeDataStorage._sceneRootNodesIndex){let e=this._scene.rootNodes,t=e.length-1;e[this._nodeDataStorage._sceneRootNodesIndex]=e[t],e[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex=this._nodeDataStorage._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._nodeDataStorage._sceneRootNodesIndex=-1}}get animationPropertiesOverride(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}getClassName(){return"Node"}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get onEnabledStateChangedObservable(){return this._nodeDataStorage._onEnabledStateChangedObservable}get onClonedObservable(){return this._nodeDataStorage._onClonedObservable}constructor(e,t=null,s=!0){this._isDirty=!1,this._nodeDataStorage=new h,this.state="",this.metadata=null,this.reservedDataStore=null,this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new r.Observable,this._parentContainer=null,this.animations=[],this._ranges={},this.onReady=null,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._waitingParentInstanceIndex=null,this._waitingParsedUniqueId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=i.Matrix.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new r.Observable,this._onDisposeObserver=null,this._behaviors=[],this.name=e,this.id=e,this._scene=t||o.EngineStore.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache(),s&&this._addToSceneRootNodes()}getScene(){return this._scene}getEngine(){return this._scene.getEngine()}addBehavior(e,t=!1){return -1!==this._behaviors.indexOf(e)||(e.init(),this._scene.isLoading&&!t?this._scene.onDataLoadedObservable.addOnce(()=>{this._behaviors.includes(e)&&e.attach(this)}):e.attach(this),this._behaviors.push(e)),this}removeBehavior(e){let t=this._behaviors.indexOf(e);return -1===t||(this._behaviors.splice(t,1),e.detach()),this}get behaviors(){return this._behaviors}getBehaviorByName(e){for(let t of this._behaviors)if(t.name===e)return t;return null}getWorldMatrix(){return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix}_getWorldMatrixDeterminant(){return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant}get worldMatrixFromCache(){return this._worldMatrix}_initCache(){this._cache={}}updateCache(e){!e&&this.isSynchronized()||this._updateCache()}_getActionManagerForTrigger(e,t=!0){return this.parent?this.parent._getActionManagerForTrigger(e,!1):null}_updateCache(e){}_isSynchronized(){return!0}_markSyncedWithParent(){this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)}isSynchronizedWithParent(){return!this._parentNode||!this._parentNode._isDirty&&this._parentUpdateId===this._parentNode._childUpdateId&&this._parentNode.isSynchronized()}isSynchronized(){return(!this._parentNode||!!this.isSynchronizedWithParent())&&this._isSynchronized()}isReady(e=!1){return this._nodeDataStorage._isReady}markAsDirty(e){return this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this}isEnabled(e=!0){return!1===e?this._nodeDataStorage._isEnabled:!!this._nodeDataStorage._isEnabled&&this._nodeDataStorage._isParentEnabled}_syncParentEnabledState(){if(this._nodeDataStorage._isParentEnabled=!this._parentNode||this._parentNode.isEnabled(),this._children)for(let e of this._children)e._syncParentEnabledState()}setEnabled(e){this._nodeDataStorage._isEnabled!==e&&(this._nodeDataStorage._isEnabled=e,this._syncParentEnabledState(),this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(e))}isDescendantOf(e){return!!this.parent&&(this.parent===e||this.parent.isDescendantOf(e))}_getDescendants(e,t=!1,i){if(this._children)for(let s=0;s<this._children.length;s++){let r=this._children[s];(!i||i(r))&&e.push(r),t||r._getDescendants(e,!1,i)}}getDescendants(e,t){let i=[];return this._getDescendants(i,e,t),i}getChildMeshes(e,t){let i=[];return this._getDescendants(i,e,e=>(!t||t(e))&&void 0!==e.cullingStrategy),i}getChildren(e,t=!0){return this.getDescendants(t,e)}_setReady(e){if(e!==this._nodeDataStorage._isReady){if(!e){this._nodeDataStorage._isReady=!1;return}this.onReady&&this.onReady(this),this._nodeDataStorage._isReady=!0}}getAnimationByName(e){for(let t=0;t<this.animations.length;t++){let i=this.animations[t];if(i.name===e)return i}return null}createAnimationRange(e,t,i){if(!this._ranges[e]){this._ranges[e]=_._AnimationRangeFactory(e,t,i);for(let s=0,r=this.animations.length;s<r;s++)this.animations[s]&&this.animations[s].createRange(e,t,i)}}deleteAnimationRange(e,t=!0){for(let i=0,s=this.animations.length;i<s;i++)this.animations[i]&&this.animations[i].deleteRange(e,t);this._ranges[e]=null}getAnimationRange(e){return this._ranges[e]||null}clone(e,t,i){let s=n.SerializationHelper.Clone(()=>new _(e,this.getScene()),this);if(t&&(s.parent=t),!i){let t=this.getDescendants(!0);for(let i=0;i<t.length;i++){let r=t[i];r.clone(e+"."+r.name,s)}}return s}getAnimationRanges(){let e,t=[];for(e in this._ranges)t.push(this._ranges[e]);return t}beginAnimation(e,t,i,s){let r=this.getAnimationRange(e);return r?this._scene.beginAnimation(this,r.from,r.to,t,i,s):null}serializeAnimationRanges(){let e=[];for(let t in this._ranges){let i=this._ranges[t];if(!i)continue;let s={};s.name=t,s.from=i.from,s.to=i.to,e.push(s)}return e}computeWorldMatrix(e){return this._worldMatrix||(this._worldMatrix=i.Matrix.Identity()),this._worldMatrix}dispose(e,t=!1){if(this._nodeDataStorage._isDisposed=!0,!e)for(let i of this.getDescendants(!0))i.dispose(e,t);for(let e of(this.parent?this.parent=null:this._removeFromSceneRootNodes(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onEnabledStateChangedObservable.clear(),this.onClonedObservable.clear(),this._behaviors))e.detach();this._behaviors.length=0,this.metadata=null}static ParseAnimationRanges(e,t,i){if(t.ranges)for(let i=0;i<t.ranges.length;i++){let s=t.ranges[i];e.createAnimationRange(s.name,s.from,s.to)}}getHierarchyBoundingVectors(e=!0,t=null){let s,r;if(this.getScene().incrementRenderId(),this.computeWorldMatrix(!0),this.getBoundingInfo&&this.subMeshes){let e=this.getBoundingInfo();s=e.boundingBox.minimumWorld.clone(),r=e.boundingBox.maximumWorld.clone()}else s=new i.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),r=new i.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(e)for(let e of this.getDescendants(!1)){if(e.computeWorldMatrix(!0),t&&!t(e)||!e.getBoundingInfo||0===e.getTotalVertices())continue;let o=e.getBoundingInfo().boundingBox,a=o.minimumWorld,n=o.maximumWorld;i.Vector3.CheckExtends(a,s,r),i.Vector3.CheckExtends(n,s,r)}return{min:s,max:r}}}_._AnimationRangeFactory=(e,t,i)=>{throw(0,a._WarnImport)("AnimationRange")},_._NodeConstructors={},(0,t.__decorate)([(0,s.serialize)()],_.prototype,"name",void 0),(0,t.__decorate)([(0,s.serialize)()],_.prototype,"id",void 0),(0,t.__decorate)([(0,s.serialize)()],_.prototype,"uniqueId",void 0),(0,t.__decorate)([(0,s.serialize)()],_.prototype,"state",void 0),(0,t.__decorate)([(0,s.serialize)()],_.prototype,"metadata",void 0),e.s(["Node",0,_])},69938,e=>{"use strict";var t=e.i(76535);let i=!1;e.s(["RegisterAbstractEngineRenderPass",0,function(){i||(i=!0,t.AbstractEngine.prototype.getRenderPassNames=function(){return this._renderPassNames},t.AbstractEngine.prototype.getCurrentRenderPassName=function(){return this._renderPassNames[this.currentRenderPassId]},t.AbstractEngine.prototype.createRenderPassId=function(e){let i=++t.AbstractEngine._RenderPassIdCounter;return this._renderPassNames[i]=e??"NONAME",i},t.AbstractEngine.prototype.releaseRenderPassId=function(e){this._renderPassNames[e]=void 0;for(let t=0;t<this.scenes.length;++t){let i=this.scenes[t];for(let t=0;t<i.meshes.length;++t){let s=i.meshes[t];if(s._releaseRenderPassId(e),s.subMeshes)for(let t=0;t<s.subMeshes.length;++t)s.subMeshes[t]._removeDrawWrapper(e)}}})}])},59576,e=>{"use strict";var t=e.i(10272),i=e.i(37143),s=e.i(45707),r=e.i(99267),o=e.i(96265),a=e.i(34548),n=e.i(13379),h=e.i(75405),_=e.i(25348),l=e.i(85531),d=e.i(69938),c=e.i(80871);class g extends a.Node{get position(){return this._position}set position(e){this._position=e}set upVector(e){this._upVector=e}get upVector(){return this._upVector}get screenArea(){let e,t;if(this.mode===g.PERSPECTIVE_CAMERA)this.fovMode===g.FOVMODE_VERTICAL_FIXED?(t=2*this.minZ*Math.tan(this.fov/2),e=this.getEngine().getAspectRatio(this)*t):t=(e=2*this.minZ*Math.tan(this.fov/2))/this.getEngine().getAspectRatio(this);else{let i=this.getEngine().getRenderWidth()/2,s=this.getEngine().getRenderHeight()/2;e=(this.orthoRight??i)-(this.orthoLeft??-i),t=(this.orthoTop??s)-(this.orthoBottom??-s)}return e*t}set orthoLeft(e){for(let t of(this._orthoLeft=e,this._rigCameras))t.orthoLeft=e}get orthoLeft(){return this._orthoLeft}set orthoRight(e){for(let t of(this._orthoRight=e,this._rigCameras))t.orthoRight=e}get orthoRight(){return this._orthoRight}set orthoBottom(e){for(let t of(this._orthoBottom=e,this._rigCameras))t.orthoBottom=e}get orthoBottom(){return this._orthoBottom}set orthoTop(e){for(let t of(this._orthoTop=e,this._rigCameras))t.orthoTop=e}get orthoTop(){return this._orthoTop}setFocalLength(e,t=36){this.fov=2*Math.atan(t/(2*e))}get inertia(){return this._baseInertia}set inertia(e){this._baseInertia=e}set mode(e){for(let t of(this._mode=e,this._rigCameras))t.mode=e}get mode(){return this._mode}get hasMoved(){return this._hasMoved}constructor(e,t,i,a=!0){(0,d.RegisterAbstractEngineRenderPass)(),super(e,i,!1),this._position=o.Vector3.Zero(),this._upVector=o.Vector3.Up(),this.oblique=null,this._orthoLeft=null,this._orthoRight=null,this._orthoBottom=null,this._orthoTop=null,this.fov=.8,this.projectionPlaneTilt=0,this.minZ=1,this.maxZ=1e4,this._baseInertia=.9,this._mode=g.PERSPECTIVE_CAMERA,this.isIntermediate=!1,this.viewport=new _.Viewport(0,0,1,1),this.layerMask=0xfffffff,this.fovMode=g.FOVMODE_VERTICAL_FIXED,this.cameraRigMode=g.RIG_MODE_NONE,this.ignoreCameraMaxZ=!1,this.customRenderTargets=[],this.outputRenderTarget=null,this.onViewMatrixChangedObservable=new r.Observable,this.onProjectionMatrixChangedObservable=new r.Observable,this.onAfterCheckInputsObservable=new r.Observable,this.onRestoreStateObservable=new r.Observable,this.isRigCamera=!1,this._hasMoved=!1,this._rigCameras=[],this._skipRendering=!1,this._projectionMatrix=new o.Matrix,this._postProcesses=[],this._activeMeshes=new s.SmartArray(256),this._globalPosition=o.Vector3.Zero(),this._computedViewMatrix=o.Matrix.Identity(),this._doNotComputeProjectionMatrix=!1,this._transformMatrix=o.Matrix.Zero(),this._refreshFrustumPlanes=!0,this._absoluteRotation=o.Quaternion.Identity(),this._isCamera=!0,this._isLeftCamera=!1,this._isRightCamera=!1,this.layerMask=this.getScene().defaultCameraLayerMask,this.getScene().addCamera(this),a&&!this.getScene().activeCamera&&(this.getScene().activeCamera=this),this.position=t,this.renderPassId=this.getScene().getEngine().createRenderPassId(`Camera ${e}`)}storeState(){return this._stateStored=!0,this._storedFov=this.fov,this}hasStateStored(){return!!this._stateStored}_restoreStateValues(){return!!this._stateStored&&(this.fov=this._storedFov,!0)}restoreState(){return!!this._restoreStateValues()&&(this.onRestoreStateObservable.notifyObservers(this),!0)}getClassName(){return"Camera"}toString(e){let t="Name: "+this.name;if(t+=", type: "+this.getClassName(),this.animations)for(let i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);return t}applyVerticalCorrection(){let e=this.absoluteRotation.toEulerAngles();this.projectionPlaneTilt=this._scene.useRightHandedSystem?-e.x:e.x}get globalPosition(){return this._globalPosition}getActiveMeshes(){return this._activeMeshes}isActiveMesh(e){return -1!==this._activeMeshes.indexOf(e)}isReady(e=!1){if(e){for(let e of this._postProcesses)if(e&&!e.isReady())return!1}return super.isReady(e)}_initCache(){super._initCache(),this._cache.position=new o.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.upVector=new o.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.mode=void 0,this._cache.minZ=void 0,this._cache.maxZ=void 0,this._cache.fov=void 0,this._cache.fovMode=void 0,this._cache.aspectRatio=void 0,this._cache.orthoLeft=void 0,this._cache.orthoRight=void 0,this._cache.orthoBottom=void 0,this._cache.orthoTop=void 0,this._cache.obliqueAngle=void 0,this._cache.obliqueLength=void 0,this._cache.obliqueOffset=void 0,this._cache.renderWidth=void 0,this._cache.renderHeight=void 0}_updateCache(e){e||super._updateCache(),this._cache.position.copyFrom(this.position),this._cache.upVector.copyFrom(this.upVector)}_isSynchronized(){return this._isSynchronizedViewMatrix()&&this._isSynchronizedProjectionMatrix()}_isSynchronizedViewMatrix(){return!!super._isSynchronized()&&this._cache.position.equals(this.position)&&this._cache.upVector.equals(this.upVector)&&this.isSynchronizedWithParent()}_isSynchronizedProjectionMatrix(){let e=this.ignoreCameraMaxZ?0:this.maxZ,t=this._cache.mode===this.mode&&this._cache.minZ===this.minZ&&this._cache.maxZ===e;if(!t)return!1;let i=this.getEngine();return this.mode===g.PERSPECTIVE_CAMERA?t=this._cache.fov===this.fov&&this._cache.fovMode===this.fovMode&&this._cache.aspectRatio===i.getAspectRatio(this)&&this._cache.projectionPlaneTilt===this.projectionPlaneTilt:(t=this._cache.orthoLeft===this.orthoLeft&&this._cache.orthoRight===this.orthoRight&&this._cache.orthoBottom===this.orthoBottom&&this._cache.orthoTop===this.orthoTop&&this._cache.renderWidth===i.getRenderWidth()&&this._cache.renderHeight===i.getRenderHeight(),this.oblique&&(t=t&&this._cache.obliqueAngle===this.oblique.angle&&this._cache.obliqueLength===this.oblique.length&&this._cache.obliqueOffset===this.oblique.offset)),t}attachControl(e,t){}detachControl(e){}update(){this._hasMoved=!1,this._checkInputs(),this.cameraRigMode!==g.RIG_MODE_NONE&&this._updateRigCameras(),this.getViewMatrix(),this.getProjectionMatrix()}_checkInputs(){this.onAfterCheckInputsObservable.notifyObservers(this)}get rigCameras(){return this._rigCameras}get rigPostProcess(){return this._rigPostProcess}_getFirstPostProcess(){for(let e=0;e<this._postProcesses.length;e++)if(null!==this._postProcesses[e])return this._postProcesses[e];return null}_cascadePostProcessesToRigCams(){let e=this._getFirstPostProcess();e&&e.markTextureDirty();for(let e=0,t=this._rigCameras.length;e<t;e++){let t=this._rigCameras[e],i=t._rigPostProcess;i?("pass"===i.getEffectName()&&(t.isIntermediate=0===this._postProcesses.length),t._postProcesses=this._postProcesses.slice(0).concat(i),i.markTextureDirty()):t._postProcesses=this._postProcesses.slice(0)}}attachPostProcess(e,t=null){return!e.isReusable()&&this._postProcesses.indexOf(e)>-1?(n.Logger.Error("You're trying to reuse a post process not defined as reusable."),0):(null==t||t<0?this._postProcesses.push(e):null===this._postProcesses[t]?this._postProcesses[t]=e:this._postProcesses.splice(t,0,e),this._cascadePostProcessesToRigCams(),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._postProcesses.indexOf(e))}detachPostProcess(e){let t=this._postProcesses.indexOf(e);-1!==t&&(this._postProcesses[t]=null),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._cascadePostProcessesToRigCams()}getWorldMatrix(){return this._isSynchronizedViewMatrix()||this.getViewMatrix(),this._worldMatrix}_getViewMatrix(){return o.Matrix.Identity()}getViewMatrix(e){return!e&&this._isSynchronizedViewMatrix()||(this._hasMoved=!0,this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childUpdateId++,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.parent&&this.parent.onViewMatrixChangedObservable&&this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix),this._worldMatrix.getTranslationToRef(this._globalPosition)),this._computedViewMatrix}freezeProjectionMatrix(e){this._doNotComputeProjectionMatrix=!0,void 0!==e&&(this._projectionMatrix=e)}unfreezeProjectionMatrix(){this._doNotComputeProjectionMatrix=!1}getProjectionMatrix(e){if(this._doNotComputeProjectionMatrix||!e&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;let t=this.ignoreCameraMaxZ?0:this.maxZ;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=t,this._refreshFrustumPlanes=!0;let i=this.getEngine(),s=this.getScene(),r=i.useReverseDepthBuffer;if(this.mode===g.PERSPECTIVE_CAMERA)this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=i.getAspectRatio(this),this._cache.projectionPlaneTilt=this.projectionPlaneTilt,this.minZ<=0&&(this.minZ=.1),(s.useRightHandedSystem?o.Matrix.PerspectiveFovRHToRef:o.Matrix.PerspectiveFovLHToRef)(this.fov,i.getAspectRatio(this),r?t:this.minZ,r?this.minZ:t,this._projectionMatrix,this.fovMode===g.FOVMODE_VERTICAL_FIXED,i.isNDCHalfZRange,this.projectionPlaneTilt,r);else{let e=i.getRenderWidth()/2,a=i.getRenderHeight()/2;s.useRightHandedSystem?this.oblique?o.Matrix.ObliqueOffCenterRHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-a,this.orthoTop??a,r?t:this.minZ,r?this.minZ:t,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,i.isNDCHalfZRange):o.Matrix.OrthoOffCenterRHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-a,this.orthoTop??a,r?t:this.minZ,r?this.minZ:t,this._projectionMatrix,i.isNDCHalfZRange):this.oblique?o.Matrix.ObliqueOffCenterLHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-a,this.orthoTop??a,r?t:this.minZ,r?this.minZ:t,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,i.isNDCHalfZRange):o.Matrix.OrthoOffCenterLHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-a,this.orthoTop??a,r?t:this.minZ,r?this.minZ:t,this._projectionMatrix,i.isNDCHalfZRange),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.obliqueAngle=this.oblique?.angle,this._cache.obliqueLength=this.oblique?.length,this._cache.obliqueOffset=this.oblique?.offset,this._cache.renderWidth=i.getRenderWidth(),this._cache.renderHeight=i.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix}getTransformationMatrix(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix}_computeObliqueDistance(e){return(this.radius||(this.target?o.Vector3.Distance(this.position,this.target):this.position.length()))+e}_updateFrustumPlanes(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?l.Frustum.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=l.Frustum.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)}isInFrustum(e,t=!1){if(this._updateFrustumPlanes(),!t||!(this.rigCameras.length>0))return e.isInFrustum(this._frustumPlanes);{let t=!1;for(let i of this.rigCameras)i._updateFrustumPlanes(),t=t||e.isInFrustum(i._frustumPlanes);return t}}isCompletelyInFrustum(e){return this._updateFrustumPlanes(),e.isCompletelyInFrustum(this._frustumPlanes)}getForwardRay(e=100,t,i){throw(0,h._WarnImport)("Ray")}getForwardRayToRef(e,t=100,i,s){throw(0,h._WarnImport)("Ray")}dispose(e,t=!1){for(this.onViewMatrixChangedObservable.clear(),this.onProjectionMatrixChangedObservable.clear(),this.onAfterCheckInputsObservable.clear(),this.onRestoreStateObservable.clear(),this.inputs&&this.inputs.clear(),this.getScene().stopAnimation(this),this.getScene().removeCamera(this);this._rigCameras.length>0;){let e=this._rigCameras.pop();e&&e.dispose()}if(this._parentContainer){let e=this._parentContainer.cameras.indexOf(this);e>-1&&this._parentContainer.cameras.splice(e,1),this._parentContainer=null}if(this._rigPostProcess)this._rigPostProcess.dispose(this),this._rigPostProcess=null,this._postProcesses.length=0;else if(this.cameraRigMode!==g.RIG_MODE_NONE)this._rigPostProcess=null,this._postProcesses.length=0;else{let e=this._postProcesses.length;for(;--e>=0;){let t=this._postProcesses[e];t&&t.dispose(this)}}let i=this.customRenderTargets.length;for(;--i>=0;)this.customRenderTargets[i].dispose();this.customRenderTargets.length=0,this._activeMeshes.dispose(),this.getScene().getEngine().releaseRenderPassId(this.renderPassId),super.dispose(e,t)}get isLeftCamera(){return this._isLeftCamera}get isRightCamera(){return this._isRightCamera}get leftCamera(){return this._rigCameras.length<1?null:this._rigCameras[0]}get rightCamera(){return this._rigCameras.length<2?null:this._rigCameras[1]}getLeftTarget(){return this._rigCameras.length<1?null:this._rigCameras[0].getTarget()}getRightTarget(){return this._rigCameras.length<2?null:this._rigCameras[1].getTarget()}setCameraRigMode(e,t){if(this.cameraRigMode!==e){for(;this._rigCameras.length>0;){let e=this._rigCameras.pop();e&&e.dispose()}if(this.cameraRigMode=e,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=t.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=this._cameraRigParams.interaxialDistance/.0637*(Math.PI/180),this.cameraRigMode!==g.RIG_MODE_NONE){let e=this.createRigCamera(this.name+"_L",0);e&&(e._isLeftCamera=!0);let t=this.createRigCamera(this.name+"_R",1);t&&(t._isRightCamera=!0),e&&t&&(this._rigCameras.push(e),this._rigCameras.push(t))}this._setRigMode(t),this._cascadePostProcessesToRigCams(),this.update()}}_setRigMode(e){}_getVRProjectionMatrix(){return o.Matrix.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov,this._cameraRigParams.vrMetrics.aspectRatio,this.minZ,this.ignoreCameraMaxZ?0:this.maxZ,this._cameraRigParams.vrWorkMatrix,!0,this.getEngine().isNDCHalfZRange),this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix,this._projectionMatrix),this._projectionMatrix}setCameraRigParameter(e,t){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[e]=t,"interaxialDistance"===e&&(this._cameraRigParams.stereoHalfAngle=t/.0637*(Math.PI/180))}createRigCamera(e,t){return null}_updateRigCameras(){for(let e=0;e<this._rigCameras.length;e++)this._rigCameras[e].minZ=this.minZ,this._rigCameras[e].maxZ=this.ignoreCameraMaxZ?0:this.maxZ,this._rigCameras[e].fov=this.fov,this._rigCameras[e].upVector.copyFrom(this.upVector);this.cameraRigMode===g.RIG_MODE_STEREOSCOPIC_ANAGLYPH&&(this._rigCameras[0].viewport=this._rigCameras[1].viewport=this.viewport)}_setupInputs(){}serialize(){let e=c.SerializationHelper.Serialize(this);return e.uniqueId=this.uniqueId,e.type=this.getClassName(),this.parent&&this.parent._serializeAsParent(e),this.inputs&&this.inputs.serialize(e),c.SerializationHelper.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.isEnabled=this.isEnabled(),e}clone(e,t=null){let i=c.SerializationHelper.Clone(g.GetConstructorFromName(this.getClassName(),e,this.getScene(),this.interaxialDistance,this.isStereoscopicSideBySide),this);return i.name=e,i.parent=t,this.onClonedObservable.notifyObservers(i),i}getDirection(e){let t=o.Vector3.Zero();return this.getDirectionToRef(e,t),t}get absoluteRotation(){return this.getWorldMatrix().decompose(void 0,this._absoluteRotation),this._absoluteRotation}getDirectionToRef(e,t){o.Vector3.TransformNormalToRef(e,this.getWorldMatrix(),t)}static GetConstructorFromName(e,t,i,s=0,r=!0){let o=a.Node.Construct(e,t,i,{interaxial_distance:s,isStereoscopicSideBySide:r});return o||(()=>g._CreateDefaultParsedCamera(t,i))}computeWorldMatrix(){return this.getWorldMatrix()}_calculateHandednessMultiplier(){let e=this.getScene().useRightHandedSystem?-1:1;return this.parent&&0>this.parent._getWorldMatrixDeterminant()&&(e*=-1),e}}g._CreateDefaultParsedCamera=(e,t)=>{throw(0,h._WarnImport)("UniversalCamera")},g.PERSPECTIVE_CAMERA=0,g.ORTHOGRAPHIC_CAMERA=1,g.FOVMODE_VERTICAL_FIXED=0,g.FOVMODE_HORIZONTAL_FIXED=1,g.RIG_MODE_NONE=0,g.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,g.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,g.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,g.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,g.RIG_MODE_STEREOSCOPIC_INTERLACED=14,g.RIG_MODE_VR=20,g.RIG_MODE_CUSTOM=22,g.ForceAttachControlToAlwaysPreventDefault=!1,(0,t.__decorate)([(0,i.serializeAsVector3)("position")],g.prototype,"_position",void 0),(0,t.__decorate)([(0,i.serializeAsVector3)("upVector")],g.prototype,"_upVector",void 0),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"orthoLeft",null),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"orthoRight",null),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"orthoBottom",null),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"orthoTop",null),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"fov",void 0),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"projectionPlaneTilt",void 0),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"minZ",void 0),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"maxZ",void 0),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"inertia",null),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"mode",null),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"layerMask",void 0),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"fovMode",void 0),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"cameraRigMode",void 0),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"interaxialDistance",void 0),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"isStereoscopicSideBySide",void 0),(0,t.__decorate)([(0,i.serialize)()],g.prototype,"ignoreCameraMaxZ",void 0),e.s(["Camera",0,g])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33855,21823,t=>{"use strict";var e=t.i(13379),r=t.i(65740);class i{constructor(t,e,r=!1,i,s=!1,f){this._uniformNames=[],this._valueCache={},this._engine=t,this._noUBO=!t.supportsUniformBuffers||s,this._dynamic=r,this._name=i??"no-name",this._data=e||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._trackUBOsInFrame=!1,(void 0===f&&this._engine._features.trackUbosInFrame||!0===f)&&(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(t){let e;if(e=t<=2?t:4,this._uniformLocationPointer%e!=0){let t=this._uniformLocationPointer;this._uniformLocationPointer+=e-this._uniformLocationPointer%e;let r=this._uniformLocationPointer-t;for(let t=0;t<r;t++)this._data.push(0)}}addUniform(t,e,r=0){let i;if((r>0&&"number"==typeof e&&(this._uniformArraySizes[t]={strideSize:e,arraySize:r}),void 0===this._uniformLocations[t])&&(this._uniformNames.push(t),!this._noUBO)){if(r>0){if(e instanceof Array)throw"addUniform should not be use with Array in UBO: "+t;if(this._fillAlignment(4),16==e)e*=r;else{let t=4-e;e=e*r+t*r}i=[];for(let t=0;t<e;t++)i.push(0)}else{if(e instanceof Array)e=(i=e).length;else{i=[];for(let t=0;t<e;t++)i.push(0)}this._fillAlignment(e)}this._uniformSizes[t]=e,this._uniformLocations[t]=this._uniformLocationPointer,this._uniformLocationPointer+=e;for(let t=0;t<e;t++)this._data.push(i[t]);this._needSync=!0}}addMatrix(t,e){this.addUniform(t,Array.prototype.slice.call(e.asArray()))}addFloat2(t,e,r){this.addUniform(t,[e,r])}addFloat3(t,e,r,i){this.addUniform(t,[e,r,i])}addColor3(t,e){let r=[e.r,e.g,e.b];this.addUniform(t,r)}addColor4(t,e,r){let i=[e.r,e.g,e.b,r];this.addUniform(t,i)}addVector3(t,e){let r=[e.x,e.y,e.z];this.addUniform(t,r)}addMatrix3x3(t){this.addUniform(t,12)}addMatrix2x2(t){this.addUniform(t,8)}create(){this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)}_getNamesDebug(){let t=[],e=0;for(let r in this._uniformLocations)if(t.push(r),10==++e)break;return t.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(t){this._name=t}get currentEffect(){return this._currentEffect}_buffersEqual(t,e){for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}_copyBuffer(t,e){for(let r=0;r<t.length;++r)e[r]=t[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(t,r,i){this._checkNewFrame();let s=this._uniformLocations[t];if(void 0===s){if(this._buffer)return void e.Logger.Error("Cannot add an uniform after UBO has been created. uniformName="+t);this.addUniform(t,i),s=this._uniformLocations[t]}if(this._buffer||this.create(),this._dynamic)for(let t=0;t<i;t++)this._bufferData[s+t]=r[t];else{let t=!1;for(let e=0;e<i;e++)(16!==i||this._engine._features.uniformBufferHardCheckMatrix)&&this._bufferData[s+e]===Math.fround(r[e])||(t=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[s+e]=r[e]);this._needSync=this._needSync||t}}updateUniformArray(t,i,s){this._checkNewFrame();let f=this._uniformLocations[t];if(void 0===f)return void e.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 a=this._uniformArraySizes[t];if(this._dynamic)for(let t=0;t<s;t++)this._bufferData[f+t]=i[t];else{let t=!1,e=0,n=0;for(let o=0;o<s;o++)if(this._bufferData[f+4*n+e]!==r.Tools.FloatRound(i[o])&&(t=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[f+4*n+e]=i[o]),++e===a.strideSize){for(;e<4;e++)this._bufferData[f+4*n+e]=0;e=0,n++}this._needSync=this._needSync||t}}_cacheMatrix(t,e){this._checkNewFrame();let r=this._valueCache[t],i=e.updateFlag;return(void 0===r||r!==i)&&(this._valueCache[t]=i,!0)}_updateMatrix3x3ForUniform(t,e){for(let t=0;t<3;t++)i._TempBuffer[4*t]=e[3*t],i._TempBuffer[4*t+1]=e[3*t+1],i._TempBuffer[4*t+2]=e[3*t+2],i._TempBuffer[4*t+3]=0;this.updateUniform(t,i._TempBuffer,12)}_updateMatrix3x3ForEffect(t,e){this._currentEffect.setMatrix3x3(t,e)}_updateMatrix2x2ForEffect(t,e){this._currentEffect.setMatrix2x2(t,e)}_updateMatrix2x2ForUniform(t,e){for(let t=0;t<2;t++)i._TempBuffer[4*t]=e[2*t],i._TempBuffer[4*t+1]=e[2*t+1],i._TempBuffer[4*t+2]=0,i._TempBuffer[4*t+3]=0;this.updateUniform(t,i._TempBuffer,8)}_updateFloatForEffect(t,e,r=""){this._currentEffect.setFloat(t+r,e)}_updateFloatForUniform(t,e){i._TempBuffer[0]=e,this.updateUniform(t,i._TempBuffer,1)}_updateFloat2ForEffect(t,e,r,i=""){this._currentEffect.setFloat2(t+i,e,r)}_updateFloat2ForUniform(t,e,r){i._TempBuffer[0]=e,i._TempBuffer[1]=r,this.updateUniform(t,i._TempBuffer,2)}_updateFloat3ForEffect(t,e,r,i,s=""){this._currentEffect.setFloat3(t+s,e,r,i)}_updateFloat3ForUniform(t,e,r,s){i._TempBuffer[0]=e,i._TempBuffer[1]=r,i._TempBuffer[2]=s,this.updateUniform(t,i._TempBuffer,3)}_updateFloat4ForEffect(t,e,r,i,s,f=""){this._currentEffect.setFloat4(t+f,e,r,i,s)}_updateFloat4ForUniform(t,e,r,s,f){i._TempBuffer[0]=e,i._TempBuffer[1]=r,i._TempBuffer[2]=s,i._TempBuffer[3]=f,this.updateUniform(t,i._TempBuffer,4)}_updateFloatArrayForEffect(t,e,r=""){switch(this._uniformArraySizes[t]?.strideSize){case 2:this._currentEffect.setFloatArray2(t+r,e);break;case 3:this._currentEffect.setFloatArray3(t+r,e);break;case 4:this._currentEffect.setFloatArray4(t+r,e);break;default:this._currentEffect.setFloatArray(t+r,e)}}_updateFloatArrayForUniform(t,e){this.updateUniformArray(t,e,e.length)}_updateArrayForEffect(t,e){this._currentEffect.setArray(t,e)}_updateArrayForUniform(t,e){this.updateUniformArray(t,e,e.length)}_updateIntArrayForEffect(t,e){this._currentEffect.setIntArray(t,e)}_updateIntArrayForUniform(t,e){i._TempBufferInt32View.set(e),this.updateUniformArray(t,i._TempBuffer,e.length)}_updateUIntArrayForEffect(t,e){this._currentEffect.setUIntArray(t,e)}_updateUIntArrayForUniform(t,e){i._TempBufferUInt32View.set(e),this.updateUniformArray(t,i._TempBuffer,e.length)}_updateMatrixForEffect(t,e){this._currentEffect.setMatrix(t,e)}_updateMatrixForUniform(t,e){this._cacheMatrix(t,e)&&this.updateUniform(t,e.asArray(),16)}_updateMatricesForEffect(t,e){this._currentEffect.setMatrices(t,e)}_updateMatricesForUniform(t,e){this.updateUniform(t,e,e.length)}_updateVector3ForEffect(t,e){this._currentEffect.setVector3(t,e)}_updateVector3ForUniform(t,e){i._TempBuffer[0]=e.x,i._TempBuffer[1]=e.y,i._TempBuffer[2]=e.z,this.updateUniform(t,i._TempBuffer,3)}_updateVector4ForEffect(t,e){this._currentEffect.setVector4(t,e)}_updateVector4ForUniform(t,e){i._TempBuffer[0]=e.x,i._TempBuffer[1]=e.y,i._TempBuffer[2]=e.z,i._TempBuffer[3]=e.w,this.updateUniform(t,i._TempBuffer,4)}_updateColor3ForEffect(t,e,r=""){this._currentEffect.setColor3(t+r,e)}_updateColor3ForUniform(t,e){i._TempBuffer[0]=e.r,i._TempBuffer[1]=e.g,i._TempBuffer[2]=e.b,this.updateUniform(t,i._TempBuffer,3)}_updateColor4ForEffect(t,e,r,i=""){this._currentEffect.setColor4(t+i,e,r)}_updateDirectColor4ForEffect(t,e,r=""){this._currentEffect.setDirectColor4(t+r,e)}_updateColor4ForUniform(t,e,r){i._TempBuffer[0]=e.r,i._TempBuffer[1]=e.g,i._TempBuffer[2]=e.b,i._TempBuffer[3]=r,this.updateUniform(t,i._TempBuffer,4)}_updateDirectColor4ForUniform(t,e){i._TempBuffer[0]=e.r,i._TempBuffer[1]=e.g,i._TempBuffer[2]=e.b,i._TempBuffer[3]=e.a,this.updateUniform(t,i._TempBuffer,4)}_updateIntForEffect(t,e,r=""){this._currentEffect.setInt(t+r,e)}_updateIntForUniform(t,e){i._TempBufferInt32View[0]=e,this.updateUniform(t,i._TempBuffer,1)}_updateInt2ForEffect(t,e,r,i=""){this._currentEffect.setInt2(t+i,e,r)}_updateInt2ForUniform(t,e,r){i._TempBufferInt32View[0]=e,i._TempBufferInt32View[1]=r,this.updateUniform(t,i._TempBuffer,2)}_updateInt3ForEffect(t,e,r,i,s=""){this._currentEffect.setInt3(t+s,e,r,i)}_updateInt3ForUniform(t,e,r,s){i._TempBufferInt32View[0]=e,i._TempBufferInt32View[1]=r,i._TempBufferInt32View[2]=s,this.updateUniform(t,i._TempBuffer,3)}_updateInt4ForEffect(t,e,r,i,s,f=""){this._currentEffect.setInt4(t+f,e,r,i,s)}_updateInt4ForUniform(t,e,r,s,f){i._TempBufferInt32View[0]=e,i._TempBufferInt32View[1]=r,i._TempBufferInt32View[2]=s,i._TempBufferInt32View[3]=f,this.updateUniform(t,i._TempBuffer,4)}_updateUIntForEffect(t,e,r=""){this._currentEffect.setUInt(t+r,e)}_updateUIntForUniform(t,e){i._TempBufferUInt32View[0]=e,this.updateUniform(t,i._TempBuffer,1)}_updateUInt2ForEffect(t,e,r,i=""){this._currentEffect.setUInt2(t+i,e,r)}_updateUInt2ForUniform(t,e,r){i._TempBufferUInt32View[0]=e,i._TempBufferUInt32View[1]=r,this.updateUniform(t,i._TempBuffer,2)}_updateUInt3ForEffect(t,e,r,i,s=""){this._currentEffect.setUInt3(t+s,e,r,i)}_updateUInt3ForUniform(t,e,r,s){i._TempBufferUInt32View[0]=e,i._TempBufferUInt32View[1]=r,i._TempBufferUInt32View[2]=s,this.updateUniform(t,i._TempBuffer,3)}_updateUInt4ForEffect(t,e,r,i,s,f=""){this._currentEffect.setUInt4(t+f,e,r,i,s)}_updateUInt4ForUniform(t,e,r,s,f){i._TempBufferUInt32View[0]=e,i._TempBufferUInt32View[1]=r,i._TempBufferUInt32View[2]=s,i._TempBufferUInt32View[3]=f,this.updateUniform(t,i._TempBuffer,4)}setTexture(t,e){this._currentEffect.setTexture(t,e)}setTextureArray(t,e){this._currentEffect.setTextureArray(t,e)}bindTexture(t,e){this._currentEffect._bindTexture(t,e)}updateUniformDirectly(t,e){this.updateUniform(t,e,e.length),this.update()}bindToEffect(t,e){this._currentEffect=t,this._currentEffectName=e}bindUniformBuffer(){!this._noUBO&&this._buffer&&this._currentEffect&&this._currentEffect.bindUniformBuffer(this._buffer,this._currentEffectName)}unbindEffect(){this._currentEffect=void 0,this._currentEffectName=void 0}setDataBuffer(t){if(!this._buffers)return this._buffer===t;for(let e=0;e<this._buffers.length;++e)if(this._buffers[e][0]===t)return this._bufferIndex=e,this._buffer=t,this._createBufferOnWrite=!1,this._currentEffect=void 0,this._buffers.length>1&&this._buffers[e][1]&&this._bufferData.set(this._buffers[e][1]),this._valueCache={},this._currentFrameId=this._engine.frameId,!0;return!1}has(t){return void 0!==this._uniformLocations[t]}dispose(){if(this._noUBO)return;let t=this._engine._uniformBuffers,e=t.indexOf(this);if(-1!==e&&(t[e]=t[t.length-1],t.pop()),this._trackUBOsInFrame&&this._buffers)for(let t=0;t<this._buffers.length;++t){let e=this._buffers[t][0];this._engine._releaseBuffer(e)}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),t.s(["UniformBuffer",0,i],33855);class s{static CompareLightsPriority(t,e){return t.shadowEnabled!==e.shadowEnabled?!!e.shadowEnabled-!!t.shadowEnabled:e.renderPriority-t.renderPriority}}s.FALLOFF_DEFAULT=0,s.FALLOFF_PHYSICAL=1,s.FALLOFF_GLTF=2,s.FALLOFF_STANDARD=3,s.LIGHTMAP_DEFAULT=0,s.LIGHTMAP_SPECULAR=1,s.LIGHTMAP_SHADOWSONLY=2,s.INTENSITYMODE_AUTOMATIC=0,s.INTENSITYMODE_LUMINOUSPOWER=1,s.INTENSITYMODE_LUMINOUSINTENSITY=2,s.INTENSITYMODE_ILLUMINANCE=3,s.INTENSITYMODE_LUMINANCE=4,s.LIGHTTYPEID_POINTLIGHT=0,s.LIGHTTYPEID_DIRECTIONALLIGHT=1,s.LIGHTTYPEID_SPOTLIGHT=2,s.LIGHTTYPEID_HEMISPHERICLIGHT=3,s.LIGHTTYPEID_RECT_AREALIGHT=4,s.LIGHTTYPEID_CLUSTERED_CONTAINER=5,t.s(["LightConstants",0,s],21823)},55069,t=>{"use strict";var e=t.i(71379);let r=!1;t.s(["RegisterEngineDynamicBuffer",0,function(){r||(r=!0,e.ThinEngine.prototype.updateDynamicIndexBuffer=function(t,e,r=0){let i;this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(t),i=t.is32Bits?e instanceof Uint32Array?e:new Uint32Array(e):e instanceof Uint16Array?e:new Uint16Array(e),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()},e.ThinEngine.prototype.updateDynamicVertexBuffer=function(t,e,r,i){this.bindArrayBuffer(t),void 0===r&&(r=0);let s=e.byteLength||e.length;void 0===i||i>=s&&0===r?e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,new Float32Array(e)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,e):e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,new Float32Array(e).subarray(0,i/4)):(e=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,i):new Uint8Array(e,0,i),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,e)),this._resetVertexBufferBinding()})}])},35407,t=>{"use strict";var e=t.i(24574),r=t.i(13379),i=t.i(38118),s=t.i(55069),f=t.i(75405);class a{get isDisposed(){return this._isDisposed}constructor(t,r,i,f=0,a=!1,n=!1,o=!1,u,h){this._isAlreadyOwned=!1,this._isDisposed=!1,(0,s.RegisterEngineDynamicBuffer)(),t&&t.getScene?this._engine=t.getScene().getEngine():this._engine=t,this._updatable=i,this._instanced=n,this._divisor=u||1,this._label=h,r instanceof e.DataBuffer?(this._data=null,this._buffer=r):(this._data=r,this._buffer=null),this.byteStride=o?f:f*Float32Array.BYTES_PER_ELEMENT,a||this.create()}createVertexBuffer(t,e,r,i,s,f=!1,a){let o=f?e:e*Float32Array.BYTES_PER_ELEMENT,u=i?f?i:i*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new n(this._engine,this,t,this._updatable,!0,u,void 0===s?this._instanced:s,o,r,void 0,void 0,!0,this._divisor||a)}isUpdatable(){return this._updatable}getData(){return this._data}getBuffer(){return this._buffer}getStrideSize(){return this.byteStride/Float32Array.BYTES_PER_ELEMENT}create(t=null){!t&&this._buffer||(t=t||this._data)&&(this._buffer?this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,t),this._data=t):this._updatable?(this._buffer=this._engine.createDynamicVertexBuffer(t,this._label),this._data=t):this._buffer=this._engine.createVertexBuffer(t,void 0,this._label))}_rebuild(){if(this._data)this._buffer=null,this.create(this._data);else if(this._buffer){if(this._buffer.capacity>0)return void(this._updatable?this._buffer=this._engine.createDynamicVertexBuffer(this._buffer.capacity,this._label):this._buffer=this._engine.createVertexBuffer(this._buffer.capacity,void 0,this._label));r.Logger.Warn(`Missing data for buffer "${this._label}" ${this._buffer?"(uniqueId: "+this._buffer.uniqueId+")":""}. Buffer reconstruction failed.`),this._buffer=null}}update(t){this.create(t)}updateDirectly(t,e,r,i=!1){this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,t,i?e:e*Float32Array.BYTES_PER_ELEMENT,r?r*this.byteStride:void 0),0===e&&void 0===r?this._data=t:this._data=null)}_increaseReferences(){if(this._buffer){if(!this._isAlreadyOwned){this._isAlreadyOwned=!0;return}this._buffer.references++}}dispose(){this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._isDisposed=!0,this._data=null,this._buffer=null)}}class n{get isDisposed(){return this._isDisposed}get instanceDivisor(){return this._instanceDivisor}set instanceDivisor(t){let e=0!=t;this._instanceDivisor=t,e!==this._instanced&&(this._instanced=e,this._computeHashCode())}get _maxVerticesCount(){let t=this.getData();return t?Array.isArray(t)?t.length/(this.byteStride/4)-this.byteOffset/4:(t.byteLength-this.byteOffset)/this.byteStride:0}constructor(t,e,r,s,f,u,h,_,d,c,E=!1,l=!1,p=1,m=!1){let T;if(this._isDisposed=!1,this.engine=t,"object"==typeof s&&null!==s?(T=s.updatable??!1,f=s.postponeInternalCreation,u=s.stride,h=s.instanced,_=s.offset,d=s.size,c=s.type,E=s.normalized??!1,l=s.useBytes??!1,p=s.divisor??1,m=s.takeBufferOwnership??!1,this._label=s.label):T=!!s,e instanceof a?(this._buffer=e,this._ownsBuffer=m):(this._buffer=new a(t,e,T,u,f,h,l,p,this._label),this._ownsBuffer=!0),this.uniqueId=n._Counter++,this._kind=r,void 0===c){const t=this.getData();this.type=t?function(t){if(t instanceof Int8Array)return n.BYTE;if(t instanceof Uint8Array)return n.UNSIGNED_BYTE;if(t instanceof Int16Array)return n.SHORT;if(t instanceof Uint16Array)return n.UNSIGNED_SHORT;if(t instanceof Int32Array)return n.INT;else if(t instanceof Uint32Array)return n.UNSIGNED_INT;else return n.FLOAT}(t):n.FLOAT}else this.type=c;const R=(0,i.GetTypeByteLength)(this.type);l?(this._size=d||(u?u/R:o(r)),this.byteStride=u||this._buffer.byteStride||this._size*R,this.byteOffset=_||0):(this._size=d||u||o(r),this.byteStride=u?u*R:this._buffer.byteStride||this._size*R,this.byteOffset=(_||0)*R),this.normalized=E,this._instanced=void 0!==h&&h,this._instanceDivisor=h?p:0,this._alignBuffer(),this._computeHashCode()}static _GetTypeHashIndex(t){switch(t){case n.BYTE:return 0;case n.UNSIGNED_BYTE:return 1;case n.SHORT:return 2;case n.UNSIGNED_SHORT:return 3;case n.INT:return 4;case n.UNSIGNED_INT:return 5;case n.FLOAT:return 6;case n.HALF_FLOAT:return 7;default:throw Error(`Invalid vertex buffer type '${t}'`)}}_computeHashCode(){this.hashCode=(0|n._GetTypeHashIndex(this.type))+(!!this.normalized<<3)+(this._size-1<<4)+(!!this._instanced<<6)+(this.byteStride<<12)}_rebuild(){this._buffer?._rebuild()}getKind(){return this._kind}isUpdatable(){return this._buffer.isUpdatable()}getData(){return this._buffer.getData()}getFloatData(t,e){let r=this.getData();return r?(0,i.GetFloatData)(r,this._size,this.type,this.byteOffset,this.byteStride,this.normalized,t,e):null}getBuffer(){return this._buffer.getBuffer()}getWrapperBuffer(){return this._buffer}getStrideSize(){return this.byteStride/(0,i.GetTypeByteLength)(this.type)}getOffset(){return this.byteOffset/(0,i.GetTypeByteLength)(this.type)}getSize(t=!1){return t?this._size*(0,i.GetTypeByteLength)(this.type):this._size}getIsInstanced(){return this._instanced}getInstanceDivisor(){return this._instanceDivisor}create(t){this._buffer.create(t),this._alignBuffer()}update(t){this._buffer.update(t),this._alignBuffer()}updateDirectly(t,e,r=!1){this._buffer.updateDirectly(t,e,void 0,r),this._alignBuffer()}dispose(){this._ownsBuffer&&this._buffer.dispose(),this._isDisposed=!0}forEach(t,e){(0,i.EnumerateFloatValues)(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,t,this.normalized,(t,r)=>{for(let i=0;i<this._size;i++)e(t[i],r+i)})}_alignBuffer(){}}function o(t){switch(t){case n.UVKind:case n.UV2Kind:case n.UV3Kind:case n.UV4Kind:case n.UV5Kind:case n.UV6Kind:return 2;case n.NormalKind:case n.PositionKind:return 3;case n.ColorKind:case n.ColorInstanceKind:case n.MatricesIndicesKind:case n.MatricesIndicesExtraKind:case n.MatricesWeightsKind:case n.MatricesWeightsExtraKind:case n.TangentKind:return 4;default:throw Error("Invalid kind '"+t+"'")}}n._Counter=0,n.BYTE=5120,n.UNSIGNED_BYTE=5121,n.SHORT=5122,n.UNSIGNED_SHORT=5123,n.INT=5124,n.UNSIGNED_INT=5125,n.FLOAT=5126,n.HALF_FLOAT=5131,n.PositionKind="position",n.NormalKind="normal",n.TangentKind="tangent",n.UVKind="uv",n.UV2Kind="uv2",n.UV3Kind="uv3",n.UV4Kind="uv4",n.UV5Kind="uv5",n.UV6Kind="uv6",n.ColorKind="color",n.ColorInstanceKind="instanceColor",n.MatricesIndicesKind="matricesIndices",n.MatricesWeightsKind="matricesWeights",n.MatricesIndicesExtraKind="matricesIndicesExtra",n.MatricesWeightsExtraKind="matricesWeightsExtra",Object.getOwnPropertyDescriptor(n.prototype,"effectiveByteStride")||Object.defineProperty(n.prototype,"effectiveByteStride",(0,f._MissingSideEffectProperty)("VertexBuffer","effectiveByteStride")),Object.getOwnPropertyDescriptor(n.prototype,"effectiveByteOffset")||Object.defineProperty(n.prototype,"effectiveByteOffset",(0,f._MissingSideEffectProperty)("VertexBuffer","effectiveByteOffset")),Object.getOwnPropertyDescriptor(n.prototype,"effectiveBuffer")||Object.defineProperty(n.prototype,"effectiveBuffer",(0,f._MissingSideEffectProperty)("VertexBuffer","effectiveBuffer")),t.s(["Buffer",0,a,"VertexBuffer",0,n,"VertexBufferDeduceStride",0,o])},85531,t=>{"use strict";var e=t.i(65002);class r{static GetPlanes(t){let i=[];for(let t=0;t<6;t++)i.push(new e.Plane(0,0,0,0));return r.GetPlanesToRef(t,i),i}static GetNearPlaneToRef(t,e){let r=t.m;e.normal.x=r[3]+r[2],e.normal.y=r[7]+r[6],e.normal.z=r[11]+r[10],e.d=r[15]+r[14],e.normalize()}static GetFarPlaneToRef(t,e){let r=t.m;e.normal.x=r[3]-r[2],e.normal.y=r[7]-r[6],e.normal.z=r[11]-r[10],e.d=r[15]-r[14],e.normalize()}static GetLeftPlaneToRef(t,e){let r=t.m;e.normal.x=r[3]+r[0],e.normal.y=r[7]+r[4],e.normal.z=r[11]+r[8],e.d=r[15]+r[12],e.normalize()}static GetRightPlaneToRef(t,e){let r=t.m;e.normal.x=r[3]-r[0],e.normal.y=r[7]-r[4],e.normal.z=r[11]-r[8],e.d=r[15]-r[12],e.normalize()}static GetTopPlaneToRef(t,e){let r=t.m;e.normal.x=r[3]-r[1],e.normal.y=r[7]-r[5],e.normal.z=r[11]-r[9],e.d=r[15]-r[13],e.normalize()}static GetBottomPlaneToRef(t,e){let r=t.m;e.normal.x=r[3]+r[1],e.normal.y=r[7]+r[5],e.normal.z=r[11]+r[9],e.d=r[15]+r[13],e.normalize()}static GetPlanesToRef(t,e){r.GetNearPlaneToRef(t,e[0]),r.GetFarPlaneToRef(t,e[1]),r.GetLeftPlaneToRef(t,e[2]),r.GetRightPlaneToRef(t,e[3]),r.GetTopPlaneToRef(t,e[4]),r.GetBottomPlaneToRef(t,e[5])}static IsPointInFrustum(t,e){for(let r=0;r<6;r++)if(0>e[r].dotCoordinate(t))return!1;return!0}}t.s(["Frustum",0,r])},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 r=(t.data||t)[e];this.pushNoDuplicate(r)}}}}])},50107,94160,19905,t=>{"use strict";var e=t.i(96265),r=t.i(35407);t.s(["PickingInfo",0,class{constructor(){this.hit=!1,this.distance=0,this.pickedPoint=null,this.pickedMesh=null,this.bu=0,this.bv=0,this.faceId=-1,this.subMeshFaceId=-1,this.subMeshId=0,this.pickedSprite=null,this.thinInstanceIndex=-1,this.ray=null,this.originMesh=null,this.aimTransform=null,this.gripTransform=null}getNormal(t=!1,i=!0){let s;if(!this.pickedMesh||i&&!this.pickedMesh.isVerticesDataPresent(r.VertexBuffer.NormalKind))return null;let f=this.pickedMesh.getIndices();f?.length===0&&(f=null);let a=e.TmpVectors.Vector3[0],n=e.TmpVectors.Vector3[1],o=e.TmpVectors.Vector3[2];if(i){let t=this.pickedMesh.getVerticesData(r.VertexBuffer.NormalKind),i=f?e.Vector3.FromArrayToRef(t,3*f[3*this.faceId],a):a.copyFromFloats(t[3*this.faceId*3],t[3*this.faceId*3+1],t[3*this.faceId*3+2]),u=f?e.Vector3.FromArrayToRef(t,3*f[3*this.faceId+1],n):n.copyFromFloats(t[(3*this.faceId+1)*3],t[(3*this.faceId+1)*3+1],t[(3*this.faceId+1)*3+2]),h=f?e.Vector3.FromArrayToRef(t,3*f[3*this.faceId+2],o):o.copyFromFloats(t[(3*this.faceId+2)*3],t[(3*this.faceId+2)*3+1],t[(3*this.faceId+2)*3+2]);i=i.scale(this.bu),u=u.scale(this.bv),h=h.scale(1-this.bu-this.bv),s=new e.Vector3(i.x+u.x+h.x,i.y+u.y+h.y,i.z+u.z+h.z)}else{let t=this.pickedMesh.getVerticesData(r.VertexBuffer.PositionKind),i=f?e.Vector3.FromArrayToRef(t,3*f[3*this.faceId],a):a.copyFromFloats(t[3*this.faceId*3],t[3*this.faceId*3+1],t[3*this.faceId*3+2]),u=f?e.Vector3.FromArrayToRef(t,3*f[3*this.faceId+1],n):n.copyFromFloats(t[(3*this.faceId+1)*3],t[(3*this.faceId+1)*3+1],t[(3*this.faceId+1)*3+2]),h=f?e.Vector3.FromArrayToRef(t,3*f[3*this.faceId+2],o):o.copyFromFloats(t[(3*this.faceId+2)*3],t[(3*this.faceId+2)*3+1],t[(3*this.faceId+2)*3+2]),_=i.subtract(u),d=h.subtract(u);s=e.Vector3.Cross(_,d)}let u=(t,r)=>{if(-1!==this.thinInstanceIndex){let i=t._thinInstanceDataStorage.matrixData,s=this.thinInstanceIndex<<4;if(i&&i.length>s){let t=e.TmpVectors.Matrix[0];e.Matrix.FromArrayToRef(i,s,t),e.Vector3.TransformNormalToRef(r,t,r)}}let i=t.getWorldMatrix();t.nonUniformScaling&&(e.TmpVectors.Matrix[0].copyFrom(i),(i=e.TmpVectors.Matrix[0]).setTranslationFromFloats(0,0,0),i.invert(),i.transposeToRef(e.TmpVectors.Matrix[1]),i=e.TmpVectors.Matrix[1]),e.Vector3.TransformNormalToRef(r,i,r)};if(t&&u(this.pickedMesh,s),this.ray){let r=e.TmpVectors.Vector3[0].copyFrom(s);t||u(this.pickedMesh,r),e.Vector3.Dot(r,this.ray.direction)>0&&s.negateInPlace()}return s.normalize(),s}getTextureCoordinates(t=r.VertexBuffer.UVKind){if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(t))return null;let i=this.pickedMesh.getIndices();if(!i)return null;let s=this.pickedMesh.getVerticesData(t);if(!s)return null;let f=e.Vector2.FromArray(s,2*i[3*this.faceId]),a=e.Vector2.FromArray(s,2*i[3*this.faceId+1]),n=e.Vector2.FromArray(s,2*i[3*this.faceId+2]);return f=f.scale(this.bu),a=a.scale(this.bv),n=n.scale(1-this.bu-this.bv),new e.Vector2(f.x+a.x+n.x,f.y+a.y+n.y)}}],50107);var i=t.i(99904),s=t.i(88438),f=t.i(33855);let a=new e.Matrix,n=new e.Matrix,o=new e.Matrix,u={getScene:()=>void 0,eyeAtCamera:!0};function h(t,e,r){let i=r.asArray(),s=e.asArray();for(let t=0;t<16;t++)i[t]=s[t];return i[12]-=t.x,i[13]-=t.y,i[14]-=t.z,r.markAsUpdated(),r}function _(t,e,r){if(!u.eyeAtCamera)return(0,s.InvertMatrixToRef)(e,n),h(t,n,o),(0,s.InvertMatrixToRef)(o,r),r;let i=r.asArray(),f=e.asArray();for(let t=0;t<16;t++)i[t]=f[t];return i[12]=0,i[13]=0,i[14]=0,r.markAsUpdated(),r}function d(t,e,r,i){return(0,s.MultiplyMatricesToRef)(_(t,e,i),r,i),i}function c(t,e,r,i){return(0,s.InvertMatrixToRef)(r,n),(0,s.MultiplyMatricesToRef)(e,n,o),h(t,o,n),_(t,r,o),(0,s.MultiplyMatricesToRef)(n,o,i),i}function E(t,e,r,i,f,a){return(0,s.InvertMatrixToRef)(r,n),(0,s.MultiplyMatricesToRef)(e,n,o),h(t,o,n),d(t,i,f,o),(0,s.MultiplyMatricesToRef)(n,o,a),a}function l(t,e){let r=u.getScene();if(!r||a===e)return e;a.updateFlag=e.updateFlag;let i=r.floatingOriginOffset;switch(t){case"world":return h(i,e,a);case"view":return _(i,e,a);case"worldView":return c(i,e,r.getViewMatrix(),a);case"viewProjection":return d(i,r.getViewMatrix(),r.getProjectionMatrix(),a);case"worldViewProjection":return E(i,e,r.getTransformMatrix(),r.getViewMatrix(),r.getProjectionMatrix(),a);default:if(t.startsWith("u_")){let s=t.toLowerCase();if(s.startsWith("u_worldviewprojection"))return E(i,e,r.getTransformMatrix(),r.getViewMatrix(),r.getProjectionMatrix(),a);if(s.startsWith("u_viewprojection"))return d(i,r.getViewMatrix(),r.getProjectionMatrix(),a);if(s.startsWith("u_worldview"))return c(i,e,r.getViewMatrix(),a);if(s.startsWith("u_world"))return h(i,e,a);if(s.startsWith("u_view"))return _(i,e,a)}return e}}let p=f.UniformBuffer,m=i.Effect,T=p.prototype._updateMatrixForUniform,R=i.Effect.prototype.setMatrix;t.s(["FloatingOriginCurrentScene",0,u,"OverrideMatrixFunctions",0,function(){m.prototype._setMatrixOverride=R,m.prototype.setMatrix=function(t,e){return this._setMatrixOverride(t,l(t,e)),this},p.prototype._updateMatrixForUniformOverride=T,p.prototype._updateMatrixForUniform=function(t,e){this._updateMatrixForUniformOverride(t,l(t,e))}},"ResetMatrixFunctions",0,function(){i.Effect.prototype.setMatrix=R,m._setMatrixOverride=void 0,p.prototype._updateMatrixForUniform=T,p.prototype._updateMatrixForUniformOverride=void 0}],94160);class A{}A.NAME_EFFECTLAYER="EffectLayer",A.NAME_LAYER="Layer",A.NAME_LENSFLARESYSTEM="LensFlareSystem",A.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer",A.NAME_PARTICLESYSTEM="ParticleSystem",A.NAME_GAMEPAD="Gamepad",A.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue",A.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer",A.NAME_PREPASSRENDERER="PrePassRenderer",A.NAME_DEPTHRENDERER="DepthRenderer",A.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer",A.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager",A.NAME_SPRITE="Sprite",A.NAME_SUBSURFACE="SubSurface",A.NAME_OUTLINERENDERER="Outline",A.NAME_PROCEDURALTEXTURE="ProceduralTexture",A.NAME_SHADOWGENERATOR="ShadowGenerator",A.NAME_OCTREE="Octree",A.NAME_PHYSICSENGINE="PhysicsEngine",A.NAME_AUDIO="Audio",A.NAME_FLUIDRENDERER="FluidRenderer",A.NAME_IBLCDFGENERATOR="iblCDFGenerator",A.NAME_CLUSTEREDLIGHTING="ClusteredLighting",A.STEP_ISREADYFORMESH_EFFECTLAYER=0,A.STEP_ISREADYFORMESH_DEPTHRENDERER=1,A.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0,A.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0,A.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0,A.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1,A.STEP_BEFORECAMERADRAW_PREPASS=0,A.STEP_BEFORECAMERADRAW_EFFECTLAYER=1,A.STEP_BEFORECAMERADRAW_LAYER=2,A.STEP_BEFORERENDERTARGETDRAW_PREPASS=0,A.STEP_BEFORERENDERTARGETDRAW_LAYER=1,A.STEP_BEFORERENDERINGMESH_PREPASS=0,A.STEP_BEFORERENDERINGMESH_OUTLINE=1,A.STEP_AFTERRENDERINGMESH_PREPASS=0,A.STEP_AFTERRENDERINGMESH_OUTLINE=1,A.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0,A.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1,A.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0,A.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0,A.STEP_BEFORECLEAR_PREPASS=1,A.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0,A.STEP_AFTERRENDERTARGETDRAW_PREPASS=0,A.STEP_AFTERRENDERTARGETDRAW_LAYER=1,A.STEP_AFTERCAMERADRAW_PREPASS=0,A.STEP_AFTERCAMERADRAW_EFFECTLAYER=1,A.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2,A.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3,A.STEP_AFTERCAMERADRAW_LAYER=4,A.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5,A.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0,A.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0,A.STEP_AFTERRENDER_AUDIO=0,A.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0,A.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1,A.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2,A.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3,A.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0,A.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1,A.STEP_GATHERACTIVECAMERARENDERTARGETS_CLUSTEREDLIGHTING=2,A.STEP_POINTERMOVE_SPRITE=0,A.STEP_POINTERDOWN_SPRITE=0,A.STEP_POINTERUP_SPRITE=0;class I extends Array{constructor(t){super(...t)}static Create(){return Object.create(I.prototype)}registerStep(t,e,r){let i=0;for(;i<this.length&&!(t<this[i].index);i++);this.splice(i,0,{index:t,component:e,action:r.bind(e)})}clear(){this.length=0}}t.s(["SceneComponentConstants",0,A,"Stage",0,I],19905)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65002,e=>{"use strict";var t=e.i(96265);class i{constructor(e,i,s,r){this.normal=new t.Vector3(e,i,s),this.d=r}asArray(){return[this.normal.x,this.normal.y,this.normal.z,this.d]}clone(){return new i(this.normal.x,this.normal.y,this.normal.z,this.d)}getClassName(){return"Plane"}getHashCode(){let e=this.normal.getHashCode();return 397*e^this.d}normalize(){let e=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z),t=0;return 0!==e&&(t=1/e),this.normal.x*=t,this.normal.y*=t,this.normal.z*=t,this.d*=t,this}transform(e){let t=i._TmpMatrix;e.invertToRef(t);let s=t.m,r=this.normal.x,a=this.normal.y,n=this.normal.z,o=this.d;return new i(r*s[0]+a*s[1]+n*s[2]+o*s[3],r*s[4]+a*s[5]+n*s[6]+o*s[7],r*s[8]+a*s[9]+n*s[10]+o*s[11],r*s[12]+a*s[13]+n*s[14]+o*s[15])}dotCoordinate(e){return this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z+this.d}copyFromPoints(e,t,i){let s,r=t.x-e.x,a=t.y-e.y,n=t.z-e.z,o=i.x-e.x,h=i.y-e.y,l=i.z-e.z,u=a*l-n*h,c=n*o-r*l,d=r*h-a*o,_=Math.sqrt(u*u+c*c+d*d);return s=0!==_?1/_:0,this.normal.x=u*s,this.normal.y=c*s,this.normal.z=d*s,this.d=-(this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z),this}isFrontFacingTo(e,i){return t.Vector3.Dot(this.normal,e)<=i}signedDistanceTo(e){return t.Vector3.Dot(e,this.normal)+this.d}static FromArray(e){return new i(e[0],e[1],e[2],e[3])}static FromPoints(e,t,s){let r=new i(0,0,0,0);return r.copyFromPoints(e,t,s),r}static FromPositionAndNormal(e,t){let s=new i(0,0,0,0);return this.FromPositionAndNormalToRef(e,t,s)}static FromPositionAndNormalToRef(e,t,i){return i.normal.copyFrom(t),i.normal.normalize(),i.d=-e.dot(i.normal),i}static SignedDistanceToPlaneFromPositionAndNormal(e,i,s){let r=-(i.x*e.x+i.y*e.y+i.z*e.z);return t.Vector3.Dot(s,i)+r}}i._TmpMatrix=t.Matrix.Identity(),e.s(["Plane",0,i])},84201,e=>{"use strict";var t,i,s=e.i(99267);class r{get wrapU(){return this._cachedWrapU}set wrapU(e){this._cachedWrapU=e}get wrapV(){return this._cachedWrapV}set wrapV(e){this._cachedWrapV=e}get wrapR(){return this._cachedWrapR}set wrapR(e){this._cachedWrapR=e}get anisotropicFilteringLevel(){return this._cachedAnisotropicFilteringLevel}set anisotropicFilteringLevel(e){this._cachedAnisotropicFilteringLevel=e}get comparisonFunction(){return this._comparisonFunction}set comparisonFunction(e){this._comparisonFunction=e}get useMipMaps(){return this._useMipMaps}set useMipMaps(e){this._useMipMaps=e}constructor(){this.samplingMode=-1,this._useMipMaps=!0,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this._comparisonFunction=0}setParameters(e=1,t=1,i=1,s=1,r=2,a=0){return this._cachedWrapU=e,this._cachedWrapV=t,this._cachedWrapR=i,this._cachedAnisotropicFilteringLevel=s,this.samplingMode=r,this._comparisonFunction=a,this}compareSampler(e){return this._cachedWrapU===e._cachedWrapU&&this._cachedWrapV===e._cachedWrapV&&this._cachedWrapR===e._cachedWrapR&&this._cachedAnisotropicFilteringLevel===e._cachedAnisotropicFilteringLevel&&this.samplingMode===e.samplingMode&&this._comparisonFunction===e._comparisonFunction&&this._useMipMaps===e._useMipMaps}}(t=i||(i={}))[t.Unknown=0]="Unknown",t[t.Url=1]="Url",t[t.Temp=2]="Temp",t[t.Raw=3]="Raw",t[t.Dynamic=4]="Dynamic",t[t.RenderTarget=5]="RenderTarget",t[t.MultiRenderTarget=6]="MultiRenderTarget",t[t.Cube=7]="Cube",t[t.CubeRaw=8]="CubeRaw",t[t.CubePrefiltered=9]="CubePrefiltered",t[t.Raw3D=10]="Raw3D",t[t.Raw2DArray=11]="Raw2DArray",t[t.DepthStencil=12]="DepthStencil",t[t.CubeRawRGBD=13]="CubeRawRGBD",t[t.Depth=14]="Depth",t[t.External=15]="External";class a extends r{get useMipMaps(){return null===this._useMipMaps?this.generateMipMaps:this._useMipMaps}set useMipMaps(e){this._useMipMaps=e}get uniqueId(){return this._uniqueId}_setUniqueId(e){this._uniqueId=e}getEngine(){return this._engine}get source(){return this._source}constructor(e,t,i=!1){super(),this.isReady=!1,this.isCube=!1,this.is3D=!1,this.is2DArray=!1,this.isMultiview=!1,this.url="",this.generateMipMaps=!1,this._useMipMaps=null,this.mipLevelCount=1,this.samples=0,this.type=-1,this.format=-1,this.onLoadedObservable=new s.Observable,this.onErrorObservable=new s.Observable,this.onRebuildCallback=null,this.width=0,this.height=0,this.depth=0,this.baseWidth=0,this.baseHeight=0,this.baseDepth=0,this.invertY=!1,this._invertVScale=!1,this._associatedChannel=-1,this._source=0,this._buffer=null,this._bufferView=null,this._bufferViewArray=null,this._bufferViewArrayArray=null,this._size=0,this._extension="",this._files=null,this._workingCanvas=null,this._workingContext=null,this._cachedCoordinatesMode=null,this._isDisabled=!1,this._compression=null,this._sphericalPolynomial=null,this._sphericalPolynomialPromise=null,this._sphericalPolynomialComputed=!1,this._lodGenerationScale=0,this._lodGenerationOffset=0,this._useSRGBBuffer=!1,this._creationFlags=0,this._lodTextureHigh=null,this._lodTextureMid=null,this._lodTextureLow=null,this._isRGBD=!1,this._linearSpecularLOD=!1,this._irradianceTexture=null,this._hardwareTexture=null,this._maxLodLevel=null,this._references=1,this._gammaSpace=null,this._premulAlpha=!1,this._dynamicTextureSource=null,this._autoMSAAManagement=!1,this._engine=e,this._source=t,this._uniqueId=a._Counter++,i||(this._hardwareTexture=e._createHardwareTexture())}incrementReferences(){this._references++}updateSize(e,t,i=1){this._engine.updateTextureDimensions(this,e,t,i),this.width=e,this.height=t,this.depth=i,this.baseWidth=e,this.baseHeight=t,this.baseDepth=i,this._size=e*t*i}_rebuild(){let e;if(this.isReady=!1,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this.onRebuildCallback){let e=this.onRebuildCallback(this),t=t=>{t._swapAndDie(this,!1),this.isReady=e.isReady};e.isAsync?e.proxy.then(t):t(e.proxy);return}switch(this.source){case 2:case 12:case 14:break;case 1:e=this._engine.createTexture(this._originalUrl??this.url,!this.generateMipMaps,this.invertY,null,this.samplingMode,e=>{e._swapAndDie(this,!1),this.isReady=!0},null,this._buffer,void 0,this.format,this._extension,void 0,void 0,void 0,this._useSRGBBuffer);return;case 3:if((e=this._engine.createRawTexture(this._bufferView,this.baseWidth,this.baseHeight,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this._useSRGBBuffer,this.mipLevelCount))._swapAndDie(this,!1),this._bufferViewArray)for(let e=0;e<this._bufferViewArray.length;e++){let t=this._bufferViewArray[e];t&&this._engine.updateRawTexture(this,t,this.format,this.invertY,this._compression,this.type,this._useSRGBBuffer,e)}this.isReady=!0;break;case 10:(e=this._engine.createRawTexture3D(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type))._swapAndDie(this,!1),this.isReady=!0;break;case 11:if((e=this._engine.createRawTexture2DArray(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this.mipLevelCount))._swapAndDie(this,!1),this._bufferViewArray)for(let e=0;e<this._bufferViewArray.length;e++){let t=this._bufferViewArray[e];t&&this._engine.updateRawTexture2DArray(this,t,this.format,this.invertY,this._compression,this.type,e)}this.isReady=!0;break;case 4:(e=this._engine.createDynamicTexture(this.baseWidth,this.baseHeight,this.generateMipMaps,this.samplingMode))._swapAndDie(this,!1),this._dynamicTextureSource&&this._engine.updateDynamicTexture(this,this._dynamicTextureSource,this.invertY,this._premulAlpha,this.format,!0);break;case 7:e=this._engine.createCubeTexture(this.url,null,this._files,!this.generateMipMaps,()=>{e._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension,!1,0,0,null,void 0,this._useSRGBBuffer,ArrayBuffer.isView(this._buffer)?this._buffer:null);return;case 8:(e=this._engine.createRawCubeTexture(this._bufferViewArray,this.width,this._originalFormat??this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression))._swapAndDie(this,!1),this.isReady=!0;break;case 13:return;case 9:(e=this._engine.createPrefilteredCubeTexture(this.url,null,this._lodGenerationScale,this._lodGenerationOffset,e=>{e&&e._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension))._sphericalPolynomial=this._sphericalPolynomial;return}}_swapAndDie(e,t=!0){this._hardwareTexture?.setUsage(e._source,this.generateMipMaps,this.is2DArray,this.isCube,this.is3D,this.width,this.height,this.depth),e._hardwareTexture=this._hardwareTexture,e._setUniqueId(a._Counter++),t&&(e._isRGBD=this._isRGBD),this._lodTextureHigh&&(e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureHigh=this._lodTextureHigh),this._lodTextureMid&&(e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureMid=this._lodTextureMid),this._lodTextureLow&&(e._lodTextureLow&&e._lodTextureLow.dispose(),e._lodTextureLow=this._lodTextureLow),this._irradianceTexture&&(e._irradianceTexture&&e._irradianceTexture.dispose(),e._irradianceTexture=this._irradianceTexture);let i=this._engine.getLoadedTexturesCache(),s=i.indexOf(this);-1!==s&&i.splice(s,1),-1===(s=i.indexOf(e))&&i.push(e)}dispose(){this._references--,0===this._references&&(this.onLoadedObservable.clear(),this.onErrorObservable.clear(),this._engine._releaseTexture(this),this._hardwareTexture=null,this._dynamicTextureSource=null)}}a._Counter=0,e.s(["InternalTexture",0,a],84201)},10272,94047,37143,e=>{"use strict";e.s(["__decorate",0,function(e,t,i,s){var r,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(n=(a<3?r(n):a>3?r(t,i,n):r(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n}],10272);let t={},i={};function s(e){let t=e.getClassName();return i[t]||(i[t]={}),i[t]}function r(e,t){return(i,r)=>{let a=s(i);a[r]||(a[r]={type:e,sourceName:t})}}function a(e,t,i,s){let r=i.value;i.value=(...i)=>{let a=r;if("u">typeof _native&&_native[t]){let e=_native[t];a=s?(...t)=>s(...t)?e(...t):r(...t):e}return e[t]=a,a(...i)}}e.s(["GetDirectStore",0,s,"GetMergedStore",0,function(e){let s=e.getClassName();if(t[s])return t[s];t[s]={};let r=t[s],a=e,n=s;for(;n;){let e,t=i[n];for(let e in t)r[e]=t[e];let s=!1;do{if(!(e=Object.getPrototypeOf(a)).getClassName){s=!0;break}if(e.getClassName()!==n)break;a=e}while(e)if(s)break;n=e.getClassName(),a=e}return r}],94047),a.filter=function(e){return(t,i,s)=>a(t,i,s,e)},e.s(["expandToProperty",0,function(e,t=null){return function(e,t=null){return(i,s)=>{let r=t||"_"+s;Object.defineProperty(i,s,{get:function(){return this[r]},set:function(t){"function"==typeof this[r]?.equals&&this[r].equals(t)||this[r]!==t&&(this[r]=t,i[e].apply(this))},enumerable:!0,configurable:!0})}}(e,t)},"nativeOverride",0,a,"serialize",0,function(e){return r(0,e)},"serializeAsColor3",0,function(e){return r(2,e)},"serializeAsColor4",0,function(e){return r(8,e)},"serializeAsColorCurves",0,function(e){return r(7,e)},"serializeAsFresnelParameters",0,function(e){return r(3,e)},"serializeAsImageProcessingConfiguration",0,function(e){return r(9,e)},"serializeAsMeshReference",0,function(e){return r(6,e)},"serializeAsQuaternion",0,function(e){return r(10,e)},"serializeAsTexture",0,function(e){return r(1,e)},"serializeAsVector2",0,function(e){return r(4,e)},"serializeAsVector3",0,function(e){return r(5,e)}],37143)},80871,76312,e=>{"use strict";var t=e.i(75405);class i{static Eval(e,t){return"true"===(e=e.match(/\([^()]*\)/g)?e.replace(/\([^()]*\)/g,e=>(e=e.slice(1,e.length-1),i._HandleParenthesisContent(e,t))):i._HandleParenthesisContent(e,t))||"false"!==e&&i.Eval(e,t)}static _HandleParenthesisContent(e,t){let s;t=t||(e=>"true"===e);let r=e.split("||");for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e)){let a=i._SimplifyNegation(r[e].trim()),n=a.split("&&");if(n.length>1)for(let e=0;e<n.length;++e){let r=i._SimplifyNegation(n[e].trim());if(!(s="true"!==r&&"false"!==r?"!"===r[0]?!t(r.substring(1)):t(r):"true"===r)){a="false";break}}if(s||"true"===a){s=!0;break}s="true"!==a&&"false"!==a?"!"===a[0]?!t(a.substring(1)):t(a):"true"===a}return s?"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 s{static EnableFor(e){e._tags=e._tags||{},e.hasTags=()=>s.HasTags(e),e.addTags=t=>s.AddTagsTo(e,t),e.removeTags=t=>s.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>s.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 i in e._tags)Object.prototype.hasOwnProperty.call(e._tags,i)&&!0===e._tags[i]&&t.push(i);return t.join(" ")}}static AddTagsTo(e,t){if(t&&"string"==typeof t)for(let i of t.split(" "))s._AddTagTo(e,i)}static _AddTagTo(e,t){""===(t=t.trim())||"true"===t||"false"===t||t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(s.EnableFor(e),e._tags[t]=!0)}static RemoveTagsFrom(e,t){if(!s.HasTags(e))return;let i=t.split(" ");for(let t in i)s._RemoveTagFrom(e,i[t])}static _RemoveTagFrom(e,t){delete e._tags[t]}static MatchesQuery(e,t){return void 0===t||(""===t?s.HasTags(e):i.Eval(t,t=>s.HasTags(e)&&e._tags[t]))}}e.s(["Tags",0,s],76312);var r=e.i(70653),a=e.i(96265),n=e.i(94047);let o=function(e,t,i,r={}){let a=e();s&&s.HasTags(t)&&s.AddTagsTo(a,s.GetTags(t,!0));let o=(0,n.GetMergedStore)(a),l={};for(let e in o){let s=o[e],n=t[e],u=s.type;if(null!=n&&("uniqueId"!==e||h.AllowLoadingUniqueId))switch(u){case 0:case 6:case 9:case 11:"function"==typeof n.slice?a[e]=n.slice():a[e]=n;break;case 1:r.cloneTexturesOnlyOnce&&l[n.uniqueId]?a[e]=l[n.uniqueId]:(a[e]=i||n.isRenderTarget?n:n.clone(),l[n.uniqueId]=a[e]);break;case 2:case 3:case 4:case 5:case 7:case 8:case 10:case 12:a[e]=i?n:n.clone()}}return a};class h{static AppendSerializedAnimations(e,t){if(e.animations){t.animations=[];for(let i=0;i<e.animations.length;i++){let s=e.animations[i];t.animations.push(s.serialize())}}}static Serialize(e,t){t||(t={}),s&&(t.tags=s.GetTags(e));let i=(0,n.GetMergedStore)(e);for(let s in i){let r=i[s],a=r.sourceName||s,n=r.type,o=e[s];if(null!=o&&("uniqueId"!==s||h.AllowLoadingUniqueId))switch(n){case 0:Array.isArray(o)?t[a]=o.slice():t[a]=o;break;case 1:case 3:case 7:case 9:t[a]=o.serialize();break;case 2:case 4:case 5:case 8:case 10:case 12:t[a]=o.asArray();break;case 6:case 11:t[a]=o.id}}return t}static ParseProperties(e,t,i,s){s||(s="");let o=(0,n.GetMergedStore)(t);for(let n in o){let l=o[n],u=e[l.sourceName||n],c=l.type;if(null!=u&&("uniqueId"!==n||h.AllowLoadingUniqueId))switch(c){case 0:t[n]=u;break;case 1:i&&(t[n]=h._TextureParser(u,i,s));break;case 2:t[n]=r.Color3.FromArray(u);break;case 3:t[n]=h._FresnelParametersParser(u);break;case 4:t[n]=a.Vector2.FromArray(u);break;case 5:t[n]=a.Vector3.FromArray(u);break;case 6:i&&(t[n]=i.getLastMeshById(u));break;case 7:t[n]=h._ColorCurvesParser(u);break;case 8:t[n]=r.Color4.FromArray(u);break;case 9:t[n]=h._ImageProcessingConfigurationParser(u);break;case 10:t[n]=a.Quaternion.FromArray(u);break;case 11:i&&(t[n]=i.getCameraById(u));break;case 12:t[n]=a.Matrix.FromArray(u)}}}static Parse(e,t,i,r=null){let a=e();return s&&s.AddTagsTo(a,t.tags),h.ParseProperties(t,a,i,r),a}static Clone(e,t,i={}){return o(e,t,!1,i)}static Instanciate(e,t){return o(e,t,!0)}}h.AllowLoadingUniqueId=!1,h._ImageProcessingConfigurationParser=e=>{throw(0,t._WarnImport)("ImageProcessingConfiguration")},h._FresnelParametersParser=e=>{throw(0,t._WarnImport)("FresnelParameters")},h._ColorCurvesParser=e=>{throw(0,t._WarnImport)("ColorCurves")},h._TextureParser=(e,i,s)=>{throw(0,t._WarnImport)("Texture")},e.s(["SerializationHelper",0,h],80871)}]);