@uptimizr/dashboard 0.3.4 → 0.3.6
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.
- package/out/404.html +1 -1
- package/out/__next.__PAGE__.txt +4 -4
- package/out/__next._full.txt +10 -10
- package/out/__next._head.txt +4 -4
- package/out/__next._index.txt +3 -3
- package/out/__next._tree.txt +1 -1
- package/out/_next/static/chunks/{2h051-1hu4co_.js → 0-0hui1_v3h8b.js} +9 -9
- package/out/_next/static/chunks/{2dqg85hsevk3c.js → 0-tzsd_n-ywom.js} +4 -4
- package/out/_next/static/chunks/00g5suuoa-_wn.js +1 -0
- package/out/_next/static/chunks/00o9hr_3hd0r8.js +1 -0
- package/out/_next/static/chunks/{0jxklh_ayjd4b.js → 00xc-0pj7on2s.js} +12 -12
- package/out/_next/static/chunks/01fh3_bncbe5u.js +1 -0
- package/out/_next/static/chunks/01urdkl1j8o6l.js +1 -0
- package/out/_next/static/chunks/{2j-sax2xfdv7l.js → 026vw95s88gsy.js} +1 -1
- package/out/_next/static/chunks/02eui3ctddbd2.js +1 -0
- package/out/_next/static/chunks/{3kr1polwvt6o_.js → 03zip1uidm6x9.js} +1 -1
- package/out/_next/static/chunks/{3gi0f1kg72xsf.js → 04_3ri5emyfcu.js} +1 -1
- package/out/_next/static/chunks/04c4nksb5y9r-.js +1 -0
- package/out/_next/static/chunks/04g-l-_b4payc.js +1 -0
- package/out/_next/static/chunks/04j9pexbmysdy.js +1 -0
- package/out/_next/static/chunks/{1rcfy_gzean3n.js → 055baac5e-c2o.js} +1 -1
- package/out/_next/static/chunks/05bdni_jrobq1.js +1 -0
- package/out/_next/static/chunks/05o0tb8l_htmw.js +1 -0
- package/out/_next/static/chunks/{3d5yb9ybkz7hx.js → 05uqfgf-hh-p5.js} +1 -1
- package/out/_next/static/chunks/06f-0kw8s0mqo.js +3 -0
- package/out/_next/static/chunks/{18r387bj9iv0j.js → 077eo-0dhbxz-.js} +1 -1
- package/out/_next/static/chunks/{18k-0jn63_5ie.js → 07z6p262h5hgl.js} +1 -1
- package/out/_next/static/chunks/{08bm3ye5govev.js → 08m_4cihfmik8.js} +1 -1
- package/out/_next/static/chunks/08obqw64faj8j.js +1 -0
- package/out/_next/static/chunks/{2k4s5rt7-l8jr.js → 099ilz3dmm1jw.js} +1 -1
- package/out/_next/static/chunks/09ppu_k464q-n.js +1 -0
- package/out/_next/static/chunks/{1rne-b-ktit5c.js → 0av6n_6q6kzo3.js} +2 -2
- package/out/_next/static/chunks/0bgcaf2x51kms.js +1 -0
- package/out/_next/static/chunks/{0ptp4ne7j6yg6.js → 0bj_310rugcn1.js} +11 -11
- package/out/_next/static/chunks/0c5d3qn2mb3ew.js +1 -0
- package/out/_next/static/chunks/{2gtebfttq1v0o.js → 0dck67in84de0.js} +1 -1
- package/out/_next/static/chunks/0dg4wxz-6u5lo.js +1 -0
- package/out/_next/static/chunks/{2apt1vh-7rl2l.js → 0dva036n8ab62.js} +1 -1
- package/out/_next/static/chunks/{159u-hx80yfaw.js → 0erga_bzezbza.js} +1 -1
- package/out/_next/static/chunks/0f0-i105odxqd.js +1 -0
- package/out/_next/static/chunks/{1fvlbwp6r93wo.js → 0g2wngc6oe7fd.js} +24 -24
- package/out/_next/static/chunks/0gyeqz9pagssf.js +1 -0
- package/out/_next/static/chunks/0i82k-t0fbn8f.js +1 -0
- package/out/_next/static/chunks/0kzw45f61wm3j.js +1 -0
- package/out/_next/static/chunks/0l8bfa2xewq69.js +1 -0
- package/out/_next/static/chunks/{390fogn9oz13i.js → 0n-zml1gn0o1u.js} +1 -1
- package/out/_next/static/chunks/{44gsjajjdhf51.js → 0n92hec_jb_-_.js} +1 -1
- package/out/_next/static/chunks/{2s0dwzg7kq36n.js → 0okbyggxe6mx5.js} +1 -1
- package/out/_next/static/chunks/{0h-ohf4gntwtj.js → 0pv2wirx45e1m.js} +1 -1
- package/out/_next/static/chunks/0qxd_8t3nca36.js +1 -0
- package/out/_next/static/chunks/0s1jghzw8jufz.js +1 -0
- package/out/_next/static/chunks/{0ngai1_zxwsk8.js → 0s84ekz_f9ngx.js} +1 -1
- package/out/_next/static/chunks/{16d4a4iopj2if.js → 0t89-lfct-7m6.js} +5 -5
- package/out/_next/static/chunks/0ti58h622yo-_.js +2 -0
- package/out/_next/static/chunks/{29v8falcmjvev.js → 0tn-9w46cwydp.js} +32 -32
- package/out/_next/static/chunks/0u8yr4k1y6m2t.js +1 -0
- package/out/_next/static/chunks/0ubxyut5rr600.js +1 -0
- package/out/_next/static/chunks/{3_bzxvqtk1t53.js → 0uxdbfa8gv6tk.js} +12 -12
- package/out/_next/static/chunks/0vso09vdz38sr.js +1 -0
- package/out/_next/static/chunks/{0_tqu60oxaj7q.js → 0w-hm7g7trtjg.js} +1 -1
- package/out/_next/static/chunks/0wbw9h7rsis2r.js +1 -0
- package/out/_next/static/chunks/{3sbm1ak54_2ep.js → 0wq_9f98weoe3.js} +1 -1
- package/out/_next/static/chunks/0y4e49hpuucdi.js +1 -0
- package/out/_next/static/chunks/{0ioyy42h35hnd.js → 0yvevihll7sz-.js} +1 -1
- package/out/_next/static/chunks/{0zcdc17ie6lmh.js → 0zf26k6juhlzo.js} +50 -18
- package/out/_next/static/chunks/{3sg4zff4-h3t1.js → 1-b44873bjsdw.js} +1 -1
- package/out/_next/static/chunks/1-c3a1vnl8v1q.js +1 -0
- package/out/_next/static/chunks/1-xf86jgea22y.js +1 -0
- package/out/_next/static/chunks/10b0qqdnb_nox.js +1 -0
- package/out/_next/static/chunks/{2ib62lnqqaf4p.js → 11p92pnn5el0v.js} +1 -1
- package/out/_next/static/chunks/{06ljadw2-i91-.js → 12kdmh0h_mboy.js} +1 -1
- package/out/_next/static/chunks/141tngxsk32hq.js +1 -0
- package/out/_next/static/chunks/14ijcpo72av4r.js +1 -0
- package/out/_next/static/chunks/16hdip1drt8o-.js +1 -0
- package/out/_next/static/chunks/{3g5ae-38cepwm.js → 17aahvhpls1l7.js} +199 -199
- package/out/_next/static/chunks/{17d1isrw8gtnb.js → 18txc1wwwu9f9.js} +1 -1
- package/out/_next/static/chunks/{2716si10ouwu-.js → 18wa83g0qfh-b.js} +1 -1
- package/out/_next/static/chunks/19dp8nr4uygg2.js +5 -0
- package/out/_next/static/chunks/1_8acnu6_-qe-.js +1 -0
- package/out/_next/static/chunks/1__nujzr9e352.js +3 -0
- package/out/_next/static/chunks/1bmyq1b0by7ug.js +1 -0
- package/out/_next/static/chunks/{1wyr4at61q29n.js → 1ccn725by19i1.js} +1 -1
- package/out/_next/static/chunks/{0f_nv15a8q415.js → 1d1tpj9nm1nhf.js} +1 -1
- package/out/_next/static/chunks/1dfwa563iciz3.js +1 -0
- package/out/_next/static/chunks/1di5enkavl9vx.js +4 -0
- package/out/_next/static/chunks/{006nix8mv66z_.js → 1e_-_7biavwmb.js} +1 -1
- package/out/_next/static/chunks/{1y12bjsbq18_t.js → 1ephzzweysylq.js} +34 -34
- package/out/_next/static/chunks/1fwsjnd1y-lx_.js +1 -0
- package/out/_next/static/chunks/{2z9ot-w1x60fv.js → 1fyh50hjt7hi_.js} +1 -1
- package/out/_next/static/chunks/1gaexq_suxai0.js +1 -0
- package/out/_next/static/chunks/1gtj_l5ame5mw.js +1 -0
- package/out/_next/static/chunks/{1--aypw9o8yng.js → 1gvdmbr65lpud.js} +39 -39
- package/out/_next/static/chunks/{02tc9r3sc7fgc.js → 1ho02fc091nj2.js} +1 -1
- package/out/_next/static/chunks/{3v0td-ziuai2i.js → 1hsvckd0sgdgr.js} +1 -1
- package/out/_next/static/chunks/1i4f3n_2_3ery.js +1 -0
- package/out/_next/static/chunks/1j7e3qpjuj89a.js +1 -0
- package/out/_next/static/chunks/{2btqzk0tj0gz6.js → 1mrvp94tietcv.js} +1 -1
- package/out/_next/static/chunks/{3vxkkhs0vi_xa.js → 1mvadj46owrck.js} +1 -1
- package/out/_next/static/chunks/{1b2tkk7e_2o0k.js → 1n_gxvu31aofy.js} +2 -2
- package/out/_next/static/chunks/{0gblbgw7w7r9w.js → 1nasz7q3tvb53.js} +1 -1
- package/out/_next/static/chunks/{2_7dp91937mqi.js → 1ng-fqh2_n984.js} +1 -1
- package/out/_next/static/chunks/{0x4-zyy8pzmlq.js → 1nqojcig-0m3c.js} +1 -1
- package/out/_next/static/chunks/1o3ggu95lfu6i.js +1 -0
- package/out/_next/static/chunks/{2dolerz81xb52.js → 1og49_atcksim.js} +1 -1
- package/out/_next/static/chunks/{0c2k-gvwph4qs.js → 1oljzgz5jistn.js} +1 -1
- package/out/_next/static/chunks/1ozi46t8jajqh.js +1 -0
- package/out/_next/static/chunks/{1w9xu1qa9-wmv.js → 1ph0tfo-4hl-f.js} +1 -1
- package/out/_next/static/chunks/{17dmbt396_tyq.js → 1qjsgebn9m-0l.js} +1 -1
- package/out/_next/static/chunks/{168r9r65o9jnc.js → 1qsut_e3msg0l.js} +1 -1
- package/out/_next/static/chunks/{3efuvh_35yhes.js → 1qxhgauuomthl.js} +39 -39
- package/out/_next/static/chunks/{2w7yf7ouyrlkb.js → 1rb8wewjbdisv.js} +1 -1
- package/out/_next/static/chunks/1rr74xxjtckyv.js +1 -0
- package/out/_next/static/chunks/{1kl5xxohpr6-4.js → 1solqr18og2ot.js} +1 -1
- package/out/_next/static/chunks/{2rjc8yn50ducj.js → 1t2exh89lnazc.js} +34 -34
- package/out/_next/static/chunks/{0_ux41xcoea3u.js → 1t7nl8rx7mabd.js} +40 -40
- package/out/_next/static/chunks/{3fx3sriw1w3sa.js → 1tt1bbry-4f-6.js} +1 -1
- package/out/_next/static/chunks/{0ufakw529sr9d.js → 1upkv4ltuh3s5.js} +40 -40
- package/out/_next/static/chunks/{2npk7tr63h7rl.js → 1uu55ejvi7q5u.js} +1 -1
- package/out/_next/static/chunks/{2cvvxifoedn6j.js → 1ux1rpe-n1mai.js} +1 -1
- package/out/_next/static/chunks/{091ll-lp6spu3.js → 1vmpltnr0cyos.js} +1 -1
- package/out/_next/static/chunks/1x99m91nt1m3b.js +1 -0
- package/out/_next/static/chunks/1xbzxfeq9789f.js +1 -0
- package/out/_next/static/chunks/1ybiu-rkt50_1.js +1 -0
- package/out/_next/static/chunks/{3y9c26fv1poq_.js → 2-hdejef-mpka.js} +199 -199
- package/out/_next/static/chunks/{22qzld31fbhbv.js → 2-p206i_ihx09.js} +1 -1
- package/out/_next/static/chunks/{340pg0qkv5tqq.js → 20qelrstvz9_n.js} +1 -1
- package/out/_next/static/chunks/21at65obnoo8z.js +1 -0
- package/out/_next/static/chunks/21ko5mxfderw0.js +1 -0
- package/out/_next/static/chunks/21muzwu43o8xg.js +1 -0
- package/out/_next/static/chunks/{3he9bxsc67ivq.js → 22ja7c3gk0_ko.js} +1 -1
- package/out/_next/static/chunks/{0mqi0xn_c010j.js → 22rl_arnzs-ve.js} +1 -1
- package/out/_next/static/chunks/23d-hvrwpixpm.js +1 -0
- package/out/_next/static/chunks/{2yzui3v-besdu.js → 255knovck7pv2.js} +4 -4
- package/out/_next/static/chunks/2569rrrffvm2w.js +31 -0
- package/out/_next/static/chunks/{229mkx-mtfcgf.js → 25gf6xn9u1c57.js} +1 -1
- package/out/_next/static/chunks/{2vmybybb3dvia.js → 267q_eg-c6f6m.js} +1 -1
- package/out/_next/static/chunks/{0e7xuupmrw4-e.js → 28ndw4nsw2t_4.js} +1 -1
- package/out/_next/static/chunks/{0m3yjobjg36ce.js → 29gv2swsp7tzu.js} +1 -1
- package/out/_next/static/chunks/29o74k0d6hkdf.js +1 -0
- package/out/_next/static/chunks/{0kr-bd6fuqc2s.js → 2bm95r0011asw.js} +1 -1
- package/out/_next/static/chunks/2btabnibkm0db.js +1 -0
- package/out/_next/static/chunks/2c--awgkdcikq.js +1 -0
- package/out/_next/static/chunks/{2ab-99frxpah-.js → 2c2dspoukng-5.js} +1 -1
- package/out/_next/static/chunks/{0zo4x1j8ug-kb.js → 2e46-2ubc90do.js} +5 -5
- package/out/_next/static/chunks/2ep7mjbaoeou0.js +1 -0
- package/out/_next/static/chunks/{1kq86iv41cet4.js → 2ezgqm7atphi6.js} +1 -1
- package/out/_next/static/chunks/{1bv97vf67p_ri.js → 2ftp5xmq_w23j.js} +35 -35
- package/out/_next/static/chunks/{38g9jpxjoxn2x.js → 2g_1ov-0j2kwd.js} +1 -1
- package/out/_next/static/chunks/2gfjzq_vjea4w.js +1 -0
- package/out/_next/static/chunks/{1tdg_eolxlcdl.js → 2h5hase6ewoyc.js} +1 -1
- package/out/_next/static/chunks/{0m0n7kjzscx0y.js → 2h5nvlgky7fpa.js} +1 -1
- package/out/_next/static/chunks/{17dabmbnkkplu.js → 2i82rmjta9ijs.js} +1 -1
- package/out/_next/static/chunks/2ies66gmou203.js +1 -0
- package/out/_next/static/chunks/2jenu2eek9viz.js +1 -0
- package/out/_next/static/chunks/{3043pprgv9ors.js → 2khh_pmm224k5.js} +23 -23
- package/out/_next/static/chunks/2kv9_bt15v83g.js +1 -0
- package/out/_next/static/chunks/{0msckddycfy76.js → 2luaj_cf5f19-.js} +1 -1
- package/out/_next/static/chunks/2mgmvz66gh5ub.js +1 -0
- package/out/_next/static/chunks/2nwlqtv3vrzcv.js +1 -0
- package/out/_next/static/chunks/{18ss4ls60s31e.js → 2o8k8x5zcepfy.js} +1 -1
- package/out/_next/static/chunks/{1e1zozntzsx42.js → 2pbgsq7vvtk8_.js} +1 -1
- package/out/_next/static/chunks/{0b7-mrrg7ryj2.js → 2pcdnd4nzcw4c.js} +1 -1
- package/out/_next/static/chunks/2q0rz76kj6h5z.js +1 -0
- package/out/_next/static/chunks/{3w1a2o8nevap8.js → 2rjfrjhp4kjev.js} +18 -18
- package/out/_next/static/chunks/2si5cg3hl5dtf.js +4 -0
- package/out/_next/static/chunks/2uhrhq35bki6u.js +1 -0
- package/out/_next/static/chunks/{1l12hkz1g7uhf.js → 2ymtumj-hfrjo.js} +1 -1
- package/out/_next/static/chunks/{2yr9wt421xdjr.js → 2z9mdtudj8crz.js} +17 -17
- package/out/_next/static/chunks/{1iaxzjly2pap1.js → 2zdzgmacaoor9.js} +1 -1
- package/out/_next/static/chunks/{0mk8tangq9equ.js → 2zpn7010iqgsy.js} +1 -1
- package/out/_next/static/chunks/2zyjw8g4tiu51.js +1 -0
- package/out/_next/static/chunks/{2kn_dqzbyabtn.js → 3-_08i4_7yhno.js} +1 -1
- package/out/_next/static/chunks/3-irhmtm1q5qw.js +1 -0
- package/out/_next/static/chunks/3-k74vn9exnb6.js +1 -0
- package/out/_next/static/chunks/{18avgwx9nlxp9.js → 3-x7522okdy-7.js} +1 -1
- package/out/_next/static/chunks/{1ll0ta8a2qx1p.js → 309f81l5ucsb_.js} +16 -16
- package/out/_next/static/chunks/{1f1vq3goue1w4.js → 31ei992g8gqz9.js} +1 -1
- package/out/_next/static/chunks/{0i9oqg-xbq-a9.js → 32vaw89wdwv5_.js} +1 -1
- package/out/_next/static/chunks/34y7nx6qmat06.js +1 -0
- package/out/_next/static/chunks/{1f92k-xa0pl-3.js → 35aagg46wp139.js} +1 -1
- package/out/_next/static/chunks/36rqw8h6ildpl.js +1 -0
- package/out/_next/static/chunks/{0zwkmsojeuekb.js → 380ivzcfb4o_3.js} +4 -4
- package/out/_next/static/chunks/{01aeari2x_tlz.js → 3a_khw6q6pyh1.js} +1 -1
- package/out/_next/static/chunks/3c_31f20z4jrl.js +1 -0
- package/out/_next/static/chunks/3ckp70rgr63u9.js +1 -0
- package/out/_next/static/chunks/{08rk1dp1wb-gm.js → 3d76e_yd8l_0x.js} +38 -38
- package/out/_next/static/chunks/{2p8dbh81chhon.js → 3ed24zmt8qfys.js} +1 -1
- package/out/_next/static/chunks/3ez20hi1mxw0w.js +1 -0
- package/out/_next/static/chunks/3fdx-rnos5ft-.js +1 -0
- package/out/_next/static/chunks/3fgfbxxb-j_bn.js +4 -0
- package/out/_next/static/chunks/{03st_hmor6qju.js → 3go-mst7n3udd.js} +1 -1
- package/out/_next/static/chunks/{3d0ejsnhbzi-j.js → 3gyyjsot8mdav.js} +1 -1
- package/out/_next/static/chunks/{2t9zu9v_g9kr9.js → 3iwf5yeurp57i.js} +3 -3
- package/out/_next/static/chunks/{0rruvj1cyflrh.js → 3k-gz8qf-mj-p.js} +1 -1
- package/out/_next/static/chunks/{2enlv4yy0t-9j.js → 3kalvwsf11-ss.js} +12 -12
- package/out/_next/static/chunks/3lehc5pujwhsz.js +1 -0
- package/out/_next/static/chunks/{05l3dluxivcor.js → 3m0ytnc241yfz.js} +1 -1
- package/out/_next/static/chunks/3mpe7c3iyxn5h.js +1 -0
- package/out/_next/static/chunks/{0tl8j9f8lt0yf.js → 3mvaub8qjdyuc.js} +1 -1
- package/out/_next/static/chunks/{0k79ryqehst0b.js → 3n-7bcmfbh299.js} +48 -18
- package/out/_next/static/chunks/{38ea9kqlbxt86.js → 3nw7u4bie0-g6.js} +1 -1
- package/out/_next/static/chunks/3qatb38-tk_gd.js +1 -0
- package/out/_next/static/chunks/3tdcdi_utmoy_.js +1 -0
- package/out/_next/static/chunks/{3x6wpv_z5m6rz.js → 3tdzweqszru4y.js} +1 -1
- package/out/_next/static/chunks/3tt_ir_va6262.js +1 -0
- package/out/_next/static/chunks/{39lxb7c--3_2u.js → 3w4qettzp7khe.js} +32 -32
- package/out/_next/static/chunks/{2op88btas-hl8.js → 3w_umk1xtj6to.js} +1 -1
- package/out/_next/static/chunks/{1kmsg9ef5djl3.js → 3y_51bmdnc0ey.js} +1 -1
- package/out/_next/static/chunks/{1ajmblsp0wj0_.js → 3yr66ufoli71t.js} +1 -1
- package/out/_next/static/chunks/{348hdbpkkcq_2.js → 3z4suna4kq4j5.js} +20 -20
- package/out/_next/static/chunks/{1y20bv6vl4ylk.js → 41qxc142snm22.js} +1 -1
- package/out/_next/static/chunks/{404f_93w2e8ty.js → 41yy4p3-rtyz1.js} +1 -1
- package/out/_next/static/chunks/{3fz7tc-4j13uv.js → 425epvuw3yy-n.js} +21 -21
- package/out/_next/static/chunks/{1t60cososq7b0.js → 43hwl25uke0l_.js} +1 -1
- package/out/_next/static/chunks/43qmngblcab8f.js +1 -0
- package/out/_next/static/chunks/{2bn9u9r0rfhvc.js → 442e2l3jzxd-_.js} +1 -1
- package/out/_next/static/chunks/{turbopack-16ab30_1p4vhq.js → turbopack-3r8yn0j92tqw_.js} +1 -1
- package/out/_not-found/__next._full.txt +8 -8
- package/out/_not-found/__next._head.txt +4 -4
- package/out/_not-found/__next._index.txt +3 -3
- package/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/out/_not-found/__next._not-found.txt +3 -3
- package/out/_not-found/__next._tree.txt +1 -1
- package/out/_not-found.html +1 -1
- package/out/_not-found.txt +8 -8
- package/out/index.html +1 -1
- package/out/index.txt +10 -10
- package/package.json +10 -10
- package/out/_next/static/chunks/0-29qf-q72olu.js +0 -1
- package/out/_next/static/chunks/0-tk5ptli--r0.js +0 -1
- package/out/_next/static/chunks/0296l8lzd69ns.js +0 -1
- package/out/_next/static/chunks/04pk6n3z75dcy.js +0 -1
- package/out/_next/static/chunks/06m_64ysu9kn0.js +0 -1
- package/out/_next/static/chunks/09p5fltt7o3to.js +0 -1
- package/out/_next/static/chunks/0fxfsshoxnnh6.js +0 -4
- package/out/_next/static/chunks/0g6u34xkzrpjn.js +0 -1
- package/out/_next/static/chunks/0g7p8zp2kxve5.js +0 -1
- package/out/_next/static/chunks/0gwa154w_0wuh.js +0 -1
- package/out/_next/static/chunks/0h1o0cr3327tt.js +0 -1
- package/out/_next/static/chunks/0jf3n5n5yrr4o.js +0 -1
- package/out/_next/static/chunks/0k9-8s-jof_gw.js +0 -1
- package/out/_next/static/chunks/0kcbdjbdxu_wa.js +0 -1
- package/out/_next/static/chunks/0l3wwyl93sqh9.js +0 -1
- package/out/_next/static/chunks/0ngiuj5k-or6g.js +0 -1
- package/out/_next/static/chunks/0nx_t8iq-324h.js +0 -1
- package/out/_next/static/chunks/0oap0o8a8a_cl.js +0 -1
- package/out/_next/static/chunks/0ostjlqtwkhqr.js +0 -1
- package/out/_next/static/chunks/0vddljjnmozzx.js +0 -1
- package/out/_next/static/chunks/0w0sx062qmcsh.js +0 -1
- package/out/_next/static/chunks/0x6i6e6863tir.js +0 -1
- package/out/_next/static/chunks/1--kelnig7pxx.js +0 -1
- package/out/_next/static/chunks/1-ud6hztxiazp.js +0 -1
- package/out/_next/static/chunks/10v4rskkrjgd_.js +0 -1
- package/out/_next/static/chunks/117ys3lltfmcu.js +0 -1
- package/out/_next/static/chunks/13oqt2aoms4f6.js +0 -1
- package/out/_next/static/chunks/14klj_i6-l-10.js +0 -1
- package/out/_next/static/chunks/17ev44x54_jrd.js +0 -1
- package/out/_next/static/chunks/17svumd4o0qnc.js +0 -1
- package/out/_next/static/chunks/17v12p4sfraa0.js +0 -1
- package/out/_next/static/chunks/1a7cup181rjod.js +0 -1
- package/out/_next/static/chunks/1ek5rtpo6rxev.js +0 -1
- package/out/_next/static/chunks/1evp209qbr4cr.js +0 -5
- package/out/_next/static/chunks/1fa265388524p.js +0 -1
- package/out/_next/static/chunks/1g3z43o3h-024.js +0 -31
- package/out/_next/static/chunks/1g_27texazqcj.js +0 -1
- package/out/_next/static/chunks/1j--a56ji33_x.js +0 -1
- package/out/_next/static/chunks/1oara6fkfvgs3.js +0 -1
- package/out/_next/static/chunks/1par9m038tiov.js +0 -1
- package/out/_next/static/chunks/1vkww9l6lgqag.js +0 -1
- package/out/_next/static/chunks/1vpcaaf-0dn7q.js +0 -1
- package/out/_next/static/chunks/1vzmzrjhlm1q5.js +0 -1
- package/out/_next/static/chunks/1zcrrq1fx8g2y.js +0 -4
- package/out/_next/static/chunks/245h82k-g1nxr.js +0 -1
- package/out/_next/static/chunks/24cqjhy669845.js +0 -1
- package/out/_next/static/chunks/259xlbe69b9tc.js +0 -1
- package/out/_next/static/chunks/25ctnyh7njp-d.js +0 -4
- package/out/_next/static/chunks/286ggpetqnwyo.js +0 -3
- package/out/_next/static/chunks/28f1onw3nywbz.js +0 -1
- package/out/_next/static/chunks/28ycc-1519hl2.js +0 -1
- package/out/_next/static/chunks/2dhv35o59yzao.js +0 -1
- package/out/_next/static/chunks/2ey30qeaob985.js +0 -1
- package/out/_next/static/chunks/2f0r-df7tb3pu.js +0 -1
- package/out/_next/static/chunks/2gh4z57fem0_v.js +0 -1
- package/out/_next/static/chunks/2h1uw3cluvmmo.js +0 -1
- package/out/_next/static/chunks/2kje_jvmwsvwo.js +0 -1
- package/out/_next/static/chunks/2l_oqx9idxcs8.js +0 -1
- package/out/_next/static/chunks/2reukv9c7cq_9.js +0 -1
- package/out/_next/static/chunks/2vaoftqgc44cg.js +0 -1
- package/out/_next/static/chunks/2y75diyxqlhzl.js +0 -1
- package/out/_next/static/chunks/2zljunurdji0q.js +0 -1
- package/out/_next/static/chunks/34gp3hvr3j6um.js +0 -1
- package/out/_next/static/chunks/34rcp8qrbp522.js +0 -3
- package/out/_next/static/chunks/38wksra3d_k-4.js +0 -1
- package/out/_next/static/chunks/3ajhvedcs_lzb.js +0 -1
- package/out/_next/static/chunks/3bsvp8qhjqdu0.js +0 -1
- package/out/_next/static/chunks/3g4e2txsrb2p2.js +0 -1
- package/out/_next/static/chunks/3g_h_00xs9u59.js +0 -1
- package/out/_next/static/chunks/3hr-mlwi78nov.js +0 -1
- package/out/_next/static/chunks/3l6t8b3addlw7.js +0 -1
- package/out/_next/static/chunks/3mwoauxszd3mn.js +0 -1
- package/out/_next/static/chunks/3ovd8o_usay7j.js +0 -1
- package/out/_next/static/chunks/3pdpaqzwhhijn.js +0 -1
- package/out/_next/static/chunks/3pyggl13glbdc.js +0 -1
- package/out/_next/static/chunks/3rl45k759wfi1.js +0 -1
- package/out/_next/static/chunks/3urd7r018nel4.js +0 -1
- package/out/_next/static/chunks/3vaho-xrtuchd.js +0 -2
- package/out/_next/static/chunks/3wqs57qehored.js +0 -1
- package/out/_next/static/chunks/40acif2eh_unv.js +0 -1
- package/out/_next/static/chunks/413o2v11bygt5.js +0 -1
- package/out/_next/static/chunks/4227p7752rnny.js +0 -1
- package/out/_next/static/chunks/42oyfkhdvb-u3.js +0 -1
- /package/out/_next/static/{M5esRfAVlWSeBcfLV_jVr → yF_tmb8VExvESewet-_To}/_buildManifest.js +0 -0
- /package/out/_next/static/{M5esRfAVlWSeBcfLV_jVr → yF_tmb8VExvESewet-_To}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{M5esRfAVlWSeBcfLV_jVr → yF_tmb8VExvESewet-_To}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66232,e=>{"use strict";var t,r,i,n,s,a,l,u,h,o,_,c=e.i(25282);let E=!1;E=!0,c.ThinEngine.prototype.setAlphaMode=function(e,t=!1,r=0){if(this._alphaMode[r]===e){if(!t){let t=0===e;this.depthCullingState.depthMask!==t&&(this.depthCullingState.depthMask=t)}return}let i=0===e;this._alphaState.setAlphaBlend(!i,r),this._alphaState.setAlphaMode(e,r),t||(this.depthCullingState.depthMask=i),this._alphaMode[r]=e};var T=e.i(58727),f=e.i(83464),p=e.i(65679);let d=!1;function g(e,t,r,i){let n,s=1;1===i?n=new Float32Array(t*r*4):2===i?(n=new Uint16Array(t*r*4),s=15360):n=7===i?new Uint32Array(t*r*4):new Uint8Array(t*r*4);for(let i=0;i<t;i++)for(let a=0;a<r;a++){let r=(a*t+i)*3,l=(a*t+i)*4;n[l+0]=e[r+0],n[l+1]=e[r+1],n[l+2]=e[r+2],n[l+3]=s}return n}function R(e){return function(t,r,i,n,s,a,l,u,h=null,o=0){let _=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,c=new T.InternalTexture(this,e?10:11);c.baseWidth=r,c.baseHeight=i,c.baseDepth=n,c.width=r,c.height=i,c.depth=n,c.format=s,c.type=o,c.generateMipMaps=a,c.samplingMode=u,e?c.is3D=!0:c.is2DArray=!0,this._doNotHandleContextLost||(c._bufferView=t),e?this.updateRawTexture3D(c,t,s,l,h,o):this.updateRawTexture2DArray(c,t,s,l,h,o),this._bindTextureDirectly(_,c,!0);let E=this._getSamplingParameters(u,a);return this._gl.texParameteri(_,this._gl.TEXTURE_MAG_FILTER,E.mag),this._gl.texParameteri(_,this._gl.TEXTURE_MIN_FILTER,E.min),a&&this._gl.generateMipmap(_),this._bindTextureDirectly(_,null),this._internalTexturesCache.push(c),c}}function m(e){return function(t,r,i,n,s=null,a=0){let l=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,u=this._getWebGLTextureType(a),h=this._getInternalFormat(i),o=this._getRGBABufferInternalSizedFormat(a,i);this._bindTextureDirectly(l,t,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(t._bufferView=r,t.format=i,t.invertY=n,t._compression=s),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),s&&r?this._gl.compressedTexImage3D(l,0,this.getCaps().s3tc[s],t.width,t.height,t.depth,0,r):this._gl.texImage3D(l,0,o,t.width,t.height,t.depth,0,h,u,r),t.generateMipMaps&&this._gl.generateMipmap(l),this._bindTextureDirectly(l,null),t.isReady=!0}}d=!0,c.ThinEngine.prototype.updateRawTexture=function(e,t,r,i,n=null,s=0,a=!1){if(!e)return;let l=this._getRGBABufferInternalSizedFormat(s,r,a),u=this._getInternalFormat(r),h=this._getWebGLTextureType(s);this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===i||!!i),this._doNotHandleContextLost||(e._bufferView=t,e.format=r,e.type=s,e.invertY=i,e._compression=n),e.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),n&&t?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[n],e.width,e.height,0,t):this._gl.texImage2D(this._gl.TEXTURE_2D,0,l,e.width,e.height,0,u,h,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0},c.ThinEngine.prototype.createRawTexture=function(e,t,r,i,n,s,a,l=null,u=0,h=0,o=!1){let _=new T.InternalTexture(this,3);_.baseWidth=t,_.baseHeight=r,_.width=t,_.height=r,_.format=i,_.generateMipMaps=n,_.samplingMode=a,_.invertY=s,_._compression=l,_.type=u,_._useSRGBBuffer=this._getUseSRGBBuffer(o,!n),this._doNotHandleContextLost||(_._bufferView=e),this.updateRawTexture(_,e,i,s,l,u,_._useSRGBBuffer),this._bindTextureDirectly(this._gl.TEXTURE_2D,_,!0);let c=this._getSamplingParameters(a,n);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,c.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,c.min),n&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(_),_},c.ThinEngine.prototype.createRawCubeTexture=function(e,t,r,i,n,s,a,l=null){let u=this._gl,h=new T.InternalTexture(this,8);h.isCube=!0,h.format=r,h.type=i,this._doNotHandleContextLost||(h._bufferViewArray=e);let o=this._getWebGLTextureType(i),_=this._getInternalFormat(r);if(_===u.RGB&&(_=u.RGBA),o!==u.FLOAT||this._caps.textureFloatLinearFiltering?o!==this._gl.HALF_FLOAT_OES||this._caps.textureHalfFloatLinearFiltering?o!==u.FLOAT||this._caps.textureFloatRender?o!==u.HALF_FLOAT||this._caps.colorBufferFloat||(n=!1,f.Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")):(n=!1,f.Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):(n=!1,a=1,f.Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):(n=!1,a=1,f.Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")),h.width=t,h.height=t,h.invertY=s,h._compression=l,!this.needPOTTextures||(0,p.IsExponentOfTwo)(h.width)&&(0,p.IsExponentOfTwo)(h.height)||(n=!1),e)this.updateRawCubeTexture(h,e,r,i,s,l);else{let e=this._getRGBABufferInternalSizedFormat(i);this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,h,!0);for(let t=0;t<6;t++)l?u.compressedTexImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,this.getCaps().s3tc[l],h.width,h.height,0,void 0):u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,e,h.width,h.height,0,_,o,null);this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)}this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,h,!0),e&&n&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);let c=this._getSamplingParameters(a,n);return u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MAG_FILTER,c.mag),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MIN_FILTER,c.min),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,null),h.generateMipMaps=n,h.samplingMode=a,h.isReady=!0,h},c.ThinEngine.prototype.updateRawCubeTexture=function(e,t,r,i,n,s=null,a=0){e._bufferViewArray=t,e.format=r,e.type=i,e.invertY=n,e._compression=s;let l=this._gl,u=this._getWebGLTextureType(i),h=this._getInternalFormat(r),o=this._getRGBABufferInternalSizedFormat(i),_=!1;h===l.RGB&&(h=l.RGBA,_=!0),this._bindTextureDirectly(l.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(void 0===n||!!n),e.width%4!=0&&l.pixelStorei(l.UNPACK_ALIGNMENT,1);for(let r=0;r<6;r++){let n=t[r];s?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+r,a,this.getCaps().s3tc[s],e.width,e.height,0,n):(_&&(n=g(n,e.width,e.height,i)),l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+r,a,o,e.width,e.height,0,h,u,n))}(!this.needPOTTextures||(0,p.IsExponentOfTwo)(e.width)&&(0,p.IsExponentOfTwo)(e.height))&&e.generateMipMaps&&0===a&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),e.isReady=!0},c.ThinEngine.prototype.createRawCubeTextureFromUrl=function(e,t,r,i,n,s,a,l,u=null,h=null,o=3,_=!1){let c=this._gl,E=this.createRawCubeTexture(null,r,i,n,!s,_,o,null);t?.addPendingData(E),E.url=e,E.isReady=!1,this._internalTexturesCache.push(E);let T=(e,r)=>{t?.removePendingData(E),h&&h(e?e.status+" "+e.statusText:"Failed to parse texture data",r)},f=async e=>{if(!E._hardwareTexture)return;let r=a(e);if(!r)return;let s=r instanceof Promise?await r:r,h=E.width;if(l){let e=this._getWebGLTextureType(n),t=this._getInternalFormat(i),r=this._getRGBABufferInternalSizedFormat(n),a=!1;t===c.RGB&&(t=c.RGBA,a=!0),this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,E,!0),this._unpackFlipY(!1);let u=l(s);for(let i=0;i<u.length;i++){let s=h>>i;for(let l=0;l<6;l++){let h=u[i][l];a&&(h=g(h,s,s,n)),c.texImage2D(l,i,r,s,s,0,t,e,h)}}this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,null)}else this.updateRawCubeTexture(E,s,i,n,_);E.isReady=!0,t?.removePendingData(E),E.onLoadedObservable.notifyObservers(E),E.onLoadedObservable.clear(),u&&u()};return this._loadFile(e,e=>{f(e).catch(e=>{T(void 0,e)})},void 0,t?.offlineProvider,!0,T),E},c.ThinEngine.prototype.createRawTexture2DArray=R(!1),c.ThinEngine.prototype.createRawTexture3D=R(!0),c.ThinEngine.prototype.updateRawTexture2DArray=m(!1),c.ThinEngine.prototype.updateRawTexture3D=m(!0);var A=e.i(31008);let b=!1;b=!0,c.ThinEngine.prototype._readTexturePixelsSync=function(e,t,r,i=-1,n=0,s=null,a=!0,l=!1,u=0,h=0){let o=this._gl;if(!o)throw Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){let e=o.createFramebuffer();if(!e)throw Error("Unable to create dummy framebuffer");this._dummyFramebuffer=e}o.bindFramebuffer(o.FRAMEBUFFER,this._dummyFramebuffer),i>-1&&(e.is2DArray||e.is3D)?o.framebufferTextureLayer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,e._hardwareTexture?.underlyingResource,n,i):i>-1?o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+i,e._hardwareTexture?.underlyingResource,n):o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,e._hardwareTexture?.underlyingResource,n);let _=void 0!==e.type?this._getWebGLTextureType(e.type):o.UNSIGNED_BYTE;return l?s||(s=(0,A.allocateAndCopyTypedBuffer)(e.type,4*t*r)):_===o.UNSIGNED_BYTE?(s||(s=new Uint8Array(4*t*r)),_=o.UNSIGNED_BYTE):(s||(s=new Float32Array(4*t*r)),_=o.FLOAT),a&&this.flushFramebuffer(),o.readPixels(u,h,t,r,o.RGBA,_,s),o.bindFramebuffer(o.FRAMEBUFFER,this._currentFramebuffer),s},c.ThinEngine.prototype._readTexturePixels=function(e,t,r,i=-1,n=0,s=null,a=!0,l=!1,u=0,h=0){return Promise.resolve(this._readTexturePixelsSync(e,t,r,i,n,s,a,l,u,h))},(0,e.i(13794).RegisterEngineDynamicBuffer)();let S=!1;S=!0,c.ThinEngine.prototype._createDepthStencilCubeTexture=function(e,t){let r=new T.InternalTexture(this,12);if(r.isCube=!0,1===this.webGLVersion)return f.Logger.Error("Depth cube texture is not supported by WebGL 1."),r;let i={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...t},n=this._gl;this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,r,!0),this._setupDepthStencilTexture(r,e,i.bilinearFiltering,i.comparisonFunction);for(let t=0;t<6;t++)i.generateStencil?n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,n.DEPTH24_STENCIL8,e,e,0,n.DEPTH_STENCIL,n.UNSIGNED_INT_24_8,null):n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,n.DEPTH_COMPONENT24,e,e,0,n.DEPTH_COMPONENT,n.UNSIGNED_INT,null);return this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,null),this._internalTexturesCache.push(r),r},c.ThinEngine.prototype._setCubeMapTextureParams=function(e,t,r){let i=this._gl;i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,t?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),e.samplingMode=t?3:2,t&&this.getCaps().textureMaxLevel&&void 0!==r&&r>0&&(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_LEVEL,r),e._maxLodLevel=r),this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)},c.ThinEngine.prototype.createCubeTexture=function(e,t,r,i,n=null,s=null,a,l=null,u=!1,h=0,o=0,_=null,c,E=!1,T=null){let d=this._gl;return this.createCubeTextureBase(e,t,r,!!i,n,s,a,l,u,h,o,_,e=>this._bindTextureDirectly(d.TEXTURE_CUBE_MAP,e,!0),(e,t)=>{let r=this.needPOTTextures?(0,p.GetExponentOfTwo)(t[0].width,this._caps.maxCubemapTextureSize):t[0].width,s=[d.TEXTURE_CUBE_MAP_POSITIVE_X,d.TEXTURE_CUBE_MAP_POSITIVE_Y,d.TEXTURE_CUBE_MAP_POSITIVE_Z,d.TEXTURE_CUBE_MAP_NEGATIVE_X,d.TEXTURE_CUBE_MAP_NEGATIVE_Y,d.TEXTURE_CUBE_MAP_NEGATIVE_Z];this._bindTextureDirectly(d.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(!1);let l=a?this._getInternalFormat(a,e._useSRGBBuffer):e._useSRGBBuffer?this._glSRGBExtensionValues.SRGB8_ALPHA8:d.RGBA,u=a?this._getInternalFormat(a):d.RGBA;e._useSRGBBuffer&&1===this.webGLVersion&&(u=l);for(let e=0;e<s.length;e++)if(t[e].width!==r||t[e].height!==r){if(this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext)return void f.Logger.Warn("Cannot create canvas to resize texture.");this._workingCanvas.width=r,this._workingCanvas.height=r,this._workingContext.drawImage(t[e],0,0,t[e].width,t[e].height,0,0,r,r),d.texImage2D(s[e],0,l,u,d.UNSIGNED_BYTE,this._workingCanvas)}else d.texImage2D(s[e],0,l,u,d.UNSIGNED_BYTE,t[e]);i||d.generateMipmap(d.TEXTURE_CUBE_MAP),this._setCubeMapTextureParams(e,!i),e.width=r,e.height=r,e.isReady=!0,a&&(e.format=a),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear(),n&&n()},!!E,T)},c.ThinEngine.prototype.generateMipMapsForCubemap=function(e,t=!0){if(e.generateMipMaps){let r=this._gl;this._bindTextureDirectly(r.TEXTURE_CUBE_MAP,e,!0),r.generateMipmap(r.TEXTURE_CUBE_MAP),t&&this._bindTextureDirectly(r.TEXTURE_CUBE_MAP,null)}};var F=e.i(57879);class x{get depthStencilTexture(){return this._depthStencilTexture}setDepthStencilTexture(e,t=!0){t&&this._depthStencilTexture&&this._depthStencilTexture.dispose(),this._depthStencilTexture=e,this._generateDepthBuffer=this._generateStencilBuffer=this._depthStencilTextureWithStencil=!1,e&&(this._generateDepthBuffer=!0,this._generateStencilBuffer=this._depthStencilTextureWithStencil=(0,F.HasStencilAspect)(e.format))}get depthStencilTextureWithStencil(){return this._depthStencilTextureWithStencil}get isCube(){return this._isCube}get isMulti(){return this._isMulti}get is2DArray(){return this.layers>0}get is3D(){return this.depth>0}get size(){return this.width}get width(){return this._size.width??this._size}get height(){return this._size.height??this._size}get layers(){return this._size.layers||0}get depth(){return this._size.depth||0}get texture(){return this._textures?.[0]??null}get textures(){return this._textures}get faceIndices(){return this._faceIndices}get layerIndices(){return this._layerIndices}getBaseArrayLayer(e){if(!this._textures)return -1;let t=this._textures[e],r=this._layerIndices?.[e]??0,i=this._faceIndices?.[e]??0;return t.isCube?6*r+i:t.is3D?0:r}get samples(){return this._samples}setSamples(e,t=!0,r=!1){if(this.samples===e&&!r)return e;let i=this._isMulti?this._engine.updateMultipleRenderTargetTextureSampleCount(this,e,t):this._engine.updateRenderTargetTextureSampleCount(this,e);return this._samples=e,i}resolveMSAATextures(){this.isMulti?this._engine.resolveMultiFramebuffer(this):this._engine.resolveFramebuffer(this)}generateMipMaps(){this._engine._currentRenderTarget===this&&(this.isMulti?this._engine.unBindMultiColorAttachmentFramebuffer(this,!0):this._engine.unBindFramebuffer(this,!0)),this.isMulti?this._engine.generateMipMapsMultiFramebuffer(this):this._engine.generateMipMapsFramebuffer(this)}constructor(e,t,r,i,n){this._textures=null,this._faceIndices=null,this._layerIndices=null,this._samples=1,this._attachments=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._depthStencilTextureWithStencil=!1,this.disableAutomaticMSAAResolve=!1,this.resolveMSAAColors=!0,this.resolveMSAADepth=!1,this.resolveMSAAStencil=!1,this.depthReadOnly=!1,this.stencilReadOnly=!1,this._isMulti=e,this._isCube=t,this._size=r,this._engine=i,this._depthStencilTexture=null,this.label=n}setTextures(e){Array.isArray(e)?this._textures=e:e?this._textures=[e]:this._textures=null}setTexture(e,t=0,r=!0){this._textures||(this._textures=[]),this._textures[t]!==e&&(this._textures[t]&&r&&this._textures[t].dispose(),this._textures[t]=e)}setLayerAndFaceIndices(e,t){this._layerIndices=e,this._faceIndices=t}setLayerAndFaceIndex(e=0,t,r){this._layerIndices||(this._layerIndices=[]),this._faceIndices||(this._faceIndices=[]),void 0!==t&&t>=0&&(this._layerIndices[e]=t),void 0!==r&&r>=0&&(this._faceIndices[e]=r)}createDepthStencilTexture(e=0,t=!0,r=!1,i=1,n=14,s){return this._depthStencilTexture?.dispose(),this._depthStencilTextureWithStencil=r,this._depthStencilTextureLabel=s,this._depthStencilTexture=this._engine.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:r,isCube:this._isCube,samples:i,depthTextureFormat:n,label:s},this),this._depthStencilTexture}_shareDepth(e){this.shareDepth(e)}shareDepth(e){this._depthStencilTexture&&(e._depthStencilTexture&&e._depthStencilTexture.dispose(),e._depthStencilTexture=this._depthStencilTexture,e._depthStencilTextureWithStencil=this._depthStencilTextureWithStencil,this._depthStencilTexture.incrementReferences())}_swapAndDie(e){this.texture&&this.texture._swapAndDie(e),this._textures=null,this.dispose(!0)}_cloneRenderTargetWrapper(){let e=null;if(this._isMulti){let t=this.textures;if(t&&t.length>0){let r=!1,i=t.length,n=-1,s=t[t.length-1]._source;(14===s||12===s)&&(r=!0,n=t[t.length-1].format,i--);let a=[],l=[],u=[],h=[],o=[],_=[],c=[],E={};for(let e=0;e<i;++e){let r=t[e];a.push(r.samplingMode),l.push(r.type),u.push(r.format),void 0!==E[r.uniqueId]?(h.push(-1),c.push(0)):(E[r.uniqueId]=e,r.is2DArray?(h.push(35866),c.push(r.depth)):r.isCube?(h.push(34067),c.push(0)):r.is3D?(h.push(32879),c.push(r.depth)):(h.push(3553),c.push(0))),this._faceIndices&&o.push(this._faceIndices[e]??0),this._layerIndices&&_.push(this._layerIndices[e]??0)}let T={samplingModes:a,generateMipMaps:t[0].generateMipMaps,generateDepthBuffer:this._generateDepthBuffer,generateStencilBuffer:this._generateStencilBuffer,generateDepthTexture:r,depthTextureFormat:n,types:l,formats:u,textureCount:i,targetTypes:h,faceIndex:o,layerIndex:_,layerCounts:c,label:this.label},f={width:this.width,height:this.height,depth:this.depth};e=this._engine.createMultipleRenderTarget(f,T);for(let r=0;r<i;++r){if(-1!==h[r])continue;let i=E[t[r].uniqueId];e.setTexture(e.textures[i],r)}}}else{let t={};if(t.generateDepthBuffer=this._generateDepthBuffer,t.generateMipMaps=this.texture?.generateMipMaps??!1,t.generateStencilBuffer=this._generateStencilBuffer,t.samplingMode=this.texture?.samplingMode,t.type=this.texture?.type,t.format=this.texture?.format,t.noColorAttachment=!this._textures,t.label=this.label,this.isCube)e=this._engine.createRenderTargetCubeTexture(this.width,t);else{let r={width:this.width,height:this.height,layers:this.is2DArray||this.is3D?this.texture?.depth:void 0};e=this._engine.createRenderTargetTexture(r,t)}e.texture&&(e.texture.isReady=!0)}return e}_swapRenderTargetWrapper(e){if(this._textures&&e._textures)for(let t=0;t<this._textures.length;++t)this._textures[t]._swapAndDie(e._textures[t],!1),e._textures[t].isReady=!0;this._depthStencilTexture&&e._depthStencilTexture&&(this._depthStencilTexture._swapAndDie(e._depthStencilTexture),e._depthStencilTexture.isReady=!0),this._textures=null,this._depthStencilTexture=null}_rebuild(){let e=this._cloneRenderTargetWrapper();if(e){if(this._depthStencilTexture){let t=this._depthStencilTexture.samplingMode,r=this._depthStencilTexture.format;e.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction,2===t||3===t||11===t,this._depthStencilTextureWithStencil,this._depthStencilTexture.samples,r,this._depthStencilTextureLabel)}this.samples>1&&e.setSamples(this.samples),e._swapRenderTargetWrapper(this),e.dispose()}}releaseTextures(){if(this._textures)for(let e=0;e<this._textures.length;++e)this._textures[e].dispose();this._textures=null}dispose(e=!1){e||(this._depthStencilTexture?.dispose(),this._depthStencilTexture=null,this.releaseTextures()),this._engine._releaseRenderTargetWrapper(this)}}class M extends x{setDepthStencilTexture(e,t=!0){if(super.setDepthStencilTexture(e,t),!e)return;let r=this._engine,i=this._context,n=e._hardwareTexture;if(n&&e._autoMSAAManagement&&this._MSAAFramebuffer){let t=r._currentFramebuffer;r._bindUnboundFramebuffer(this._MSAAFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,(0,F.HasStencilAspect)(e.format)?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,i.RENDERBUFFER,n.getMSAARenderBuffer()),r._bindUnboundFramebuffer(t)}}constructor(e,t,r,i,n){super(e,t,r,i),this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._disposeOnlyFramebuffers=!1,this._currentLOD=0,this._context=n}_cloneRenderTargetWrapper(){let e;return this._colorTextureArray&&this._depthStencilTextureArray?(e=this._engine.createMultiviewRenderTargetTexture(this.width,this.height)).texture.isReady=!0:e=super._cloneRenderTargetWrapper(),e}_swapRenderTargetWrapper(e){super._swapRenderTargetWrapper(e),e._framebuffer=this._framebuffer,e._depthStencilBuffer=this._depthStencilBuffer,e._MSAAFramebuffer=this._MSAAFramebuffer,e._colorTextureArray=this._colorTextureArray,e._depthStencilTextureArray=this._depthStencilTextureArray,this._framebuffer=this._depthStencilBuffer=this._MSAAFramebuffer=this._colorTextureArray=this._depthStencilTextureArray=null}createDepthStencilTexture(e=0,t=!0,r=!1,i=1,n=14,s){if(this._depthStencilBuffer){let e=this._engine,t=e._currentFramebuffer,r=this._context;e._bindUnboundFramebuffer(this._framebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,null),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,null),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.STENCIL_ATTACHMENT,r.RENDERBUFFER,null),e._bindUnboundFramebuffer(t),r.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null}return super.createDepthStencilTexture(e,t,r,i,n,s)}shareDepth(e){super.shareDepth(e);let t=this._context,r=this._depthStencilBuffer,i=e._MSAAFramebuffer||e._framebuffer,n=this._engine;e._depthStencilBuffer&&e._depthStencilBuffer!==r&&t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=r;let s=e._generateStencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;n._bindUnboundFramebuffer(i),t.framebufferRenderbuffer(t.FRAMEBUFFER,s,t.RENDERBUFFER,r),n._bindUnboundFramebuffer(null)}_bindTextureRenderTarget(e,t=0,r,i=0){let n,s=e._hardwareTexture;if(!s)return;let a=this._framebuffer,l=this._engine,u=l._currentFramebuffer;if(l._bindUnboundFramebuffer(a),l.webGLVersion>1){let a=this._context;n=a["COLOR_ATTACHMENT"+t],e.is2DArray||e.is3D?(r=r??this.layerIndices?.[t]??0,a.framebufferTextureLayer(a.FRAMEBUFFER,n,s.underlyingResource,i,r)):e.isCube?(r=r??this.faceIndices?.[t]??0,a.framebufferTexture2D(a.FRAMEBUFFER,n,a.TEXTURE_CUBE_MAP_POSITIVE_X+r,s.underlyingResource,i)):a.framebufferTexture2D(a.FRAMEBUFFER,n,a.TEXTURE_2D,s.underlyingResource,i)}else{let e=this._context;n=e["COLOR_ATTACHMENT"+t+"_WEBGL"];let a=void 0!==r?e.TEXTURE_CUBE_MAP_POSITIVE_X+r:e.TEXTURE_2D;e.framebufferTexture2D(e.FRAMEBUFFER,n,a,s.underlyingResource,i)}if(e._autoMSAAManagement&&this._MSAAFramebuffer){let e=this._context;l._bindUnboundFramebuffer(this._MSAAFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,s.getMSAARenderBuffer())}l._bindUnboundFramebuffer(u)}setTexture(e,t=0,r=!0){super.setTexture(e,t,r),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){if(super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;let r=this._attachments?.length??this.textures.length;for(let e=0;e<r;e++){let t=this.textures[e];t&&(t.is2DArray||t.is3D?this._bindTextureRenderTarget(t,e,this.layerIndices[e]):t.isCube?this._bindTextureRenderTarget(t,e,this.faceIndices[e]):this._bindTextureRenderTarget(t,e))}}setLayerAndFaceIndex(e=0,t,r){if(super.setLayerAndFaceIndex(e,t,r),!this.textures||!this.layerIndices||!this.faceIndices)return;let i=this.textures[e];i.is2DArray||i.is3D?this._bindTextureRenderTarget(this.textures[e],e,this.layerIndices[e]):i.isCube&&this._bindTextureRenderTarget(this.textures[e],e,this.faceIndices[e])}resolveMSAATextures(){let e=this._engine,t=e._currentFramebuffer;e._bindUnboundFramebuffer(this._MSAAFramebuffer),super.resolveMSAATextures(),e._bindUnboundFramebuffer(t)}dispose(e=this._disposeOnlyFramebuffers){let t=this._context;!e&&(this._colorTextureArray&&(this._context.deleteTexture(this._colorTextureArray),this._colorTextureArray=null),this._depthStencilTextureArray&&(this._context.deleteTexture(this._depthStencilTextureArray),this._depthStencilTextureArray=null)),this._framebuffer&&(t.deleteFramebuffer(this._framebuffer),this._framebuffer=null),this._depthStencilBuffer&&(t.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null),this._MSAAFramebuffer&&(t.deleteFramebuffer(this._MSAAFramebuffer),this._MSAAFramebuffer=null),super.dispose(e)}}let U=!1;U=!0,c.ThinEngine.prototype._createHardwareRenderTargetWrapper=function(e,t,r){let i=new M(e,t,r,this,this._gl);return this._renderTargetWrapperCache.push(i),i},c.ThinEngine.prototype.createRenderTargetTexture=function(e,t){let r,i,n=this._createHardwareRenderTargetWrapper(!1,!1,e),s=!0,a=!1,l=!1,u=1;void 0!==t&&"object"==typeof t&&(s=t.generateDepthBuffer??!0,a=!!t.generateStencilBuffer,l=!!t.noColorAttachment,r=t.colorAttachment,u=t.samples??1,i=t.label);let h=r||(l?null:this._createInternalTexture(e,t,!0,5)),o=e.width||e,_=e.height||e,c=this._currentFramebuffer,E=this._gl,T=E.createFramebuffer();if(this._bindUnboundFramebuffer(T),n._depthStencilBuffer=this._setupFramebufferDepthAttachments(a,s,o,_),!h||h.is2DArray||h.is3D||E.framebufferTexture2D(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.TEXTURE_2D,h._hardwareTexture.underlyingResource,0),this._bindUnboundFramebuffer(c),n.label=i??"RenderTargetWrapper",n._framebuffer=T,n._generateDepthBuffer=s,n._generateStencilBuffer=a,n.setTextures(h),r){if(n._samples=r.samples,r.samples>1){let e=r._hardwareTexture.getMSAARenderBuffer(0);n._MSAAFramebuffer=E.createFramebuffer(),this._bindUnboundFramebuffer(n._MSAAFramebuffer),E.framebufferRenderbuffer(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.RENDERBUFFER,e),this._bindUnboundFramebuffer(null)}}else this.updateRenderTargetTextureSampleCount(n,u);return n},c.ThinEngine.prototype._createDepthStencilTexture=function(e,t,r){let i=this._gl,n=e.layers||0,s=e.depth||0,a=i.TEXTURE_2D;0!==n?a=i.TEXTURE_2D_ARRAY:0!==s&&(a=i.TEXTURE_3D);let l=new T.InternalTexture(this,12);if(l.label=t.label,!this._caps.depthTextureExtension)return f.Logger.Error("Depth texture is not supported by your browser or hardware."),l;let u={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...t};if(this._bindTextureDirectly(a,l,!0),this._setupDepthStencilTexture(l,e,0!==u.comparisonFunction&&u.bilinearFiltering,u.comparisonFunction,u.samples),void 0!==u.depthTextureFormat){if(15!==u.depthTextureFormat&&16!==u.depthTextureFormat&&17!==u.depthTextureFormat&&13!==u.depthTextureFormat&&14!==u.depthTextureFormat&&18!==u.depthTextureFormat)return f.Logger.Error(`Depth texture ${u.depthTextureFormat} format is not supported.`),l;l.format=u.depthTextureFormat}else l.format=u.generateStencil?13:16;let h=(0,F.HasStencilAspect)(l.format),o=this._getWebGLTextureTypeFromDepthTextureFormat(l.format),_=h?i.DEPTH_STENCIL:i.DEPTH_COMPONENT,c=this._getInternalFormatFromDepthTextureFormat(l.format,!0,h);return l.is2DArray?i.texImage3D(a,0,c,l.width,l.height,n,0,_,o,null):l.is3D?i.texImage3D(a,0,c,l.width,l.height,s,0,_,o,null):i.texImage2D(a,0,c,l.width,l.height,0,_,o,null),this._bindTextureDirectly(a,null),this._internalTexturesCache.push(l),r._depthStencilBuffer&&(i.deleteRenderbuffer(r._depthStencilBuffer),r._depthStencilBuffer=null),this._bindUnboundFramebuffer(r._MSAAFramebuffer??r._framebuffer),r._generateStencilBuffer=h,r._depthStencilTextureWithStencil=h,r._depthStencilBuffer=this._setupFramebufferDepthAttachments(r._generateStencilBuffer,r._generateDepthBuffer,r.width,r.height,r.samples,l.format),this._bindUnboundFramebuffer(null),l},c.ThinEngine.prototype.updateRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e)return 1;if(e.samples===t)return t;let r=this._gl;t=Math.min(t,this.getCaps().maxMSAASamples),e._depthStencilBuffer&&(r.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(r.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null);let i=e.texture?._hardwareTexture;if(i?.releaseMSAARenderBuffers(),e.texture&&t>1&&"function"==typeof r.renderbufferStorageMultisample){let n=r.createFramebuffer();if(!n)throw Error("Unable to create multi sampled framebuffer");e._MSAAFramebuffer=n,this._bindUnboundFramebuffer(e._MSAAFramebuffer);let s=this._createRenderBuffer(e.texture.width,e.texture.height,t,-1,this._getRGBABufferInternalSizedFormat(e.texture.type,e.texture.format,e.texture._useSRGBBuffer),r.COLOR_ATTACHMENT0,!1);if(!s)throw Error("Unable to create multi sampled framebuffer");i?.addMSAARenderBuffer(s)}this._bindUnboundFramebuffer(e._MSAAFramebuffer??e._framebuffer),e.texture&&(e.texture.samples=t),e._samples=t;let n=e._depthStencilTexture?e._depthStencilTexture.format:void 0;return e._depthStencilBuffer=this._setupFramebufferDepthAttachments(e._generateStencilBuffer,e._generateDepthBuffer,e.width,e.height,t,n),this._bindUnboundFramebuffer(null),t},c.ThinEngine.prototype._setupDepthStencilTexture=function(e,t,r,i,n=1){let s=t.width??t,a=t.height??t,l=t.layers||0,u=t.depth||0;e.baseWidth=s,e.baseHeight=a,e.width=s,e.height=a,e.is2DArray=l>0,e.depth=l||u,e.isReady=!0,e.samples=n,e.generateMipMaps=!1,e.samplingMode=r?2:1,e.type=0,e._comparisonFunction=i;let h=this._gl,o=this._getTextureTarget(e),_=this._getSamplingParameters(e.samplingMode,!1);h.texParameteri(o,h.TEXTURE_MAG_FILTER,_.mag),h.texParameteri(o,h.TEXTURE_MIN_FILTER,_.min),h.texParameteri(o,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(o,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),this.webGLVersion>1&&(0===i?(h.texParameteri(o,h.TEXTURE_COMPARE_FUNC,515),h.texParameteri(o,h.TEXTURE_COMPARE_MODE,h.NONE)):(h.texParameteri(o,h.TEXTURE_COMPARE_FUNC,i),h.texParameteri(o,h.TEXTURE_COMPARE_MODE,h.COMPARE_REF_TO_TEXTURE)))};let D=!1;D=!0,c.ThinEngine.prototype.setDepthStencilTexture=function(e,t,r,i){void 0!==e&&(t&&(this._boundUniforms[e]=t),r&&r.depthStencilTexture?this._setTexture(e,r,!1,!0,i):this._setTexture(e,null,void 0,void 0,i))};let P=!1;P=!0,c.ThinEngine.prototype.createRenderTargetCubeTexture=function(e,t){let r=this._createHardwareRenderTargetWrapper(!1,!0,e),i={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...t};i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,(1!==i.type||this._caps.textureFloatLinearFiltering)&&(2!==i.type||this._caps.textureHalfFloatLinearFiltering)||(i.samplingMode=1);let n=this._gl,s=new T.InternalTexture(this,5);this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,s,!0);let a=this._getSamplingParameters(i.samplingMode,i.generateMipMaps);1!==i.type||this._caps.textureFloat||(i.type=0,f.Logger.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,a.mag),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,a.min),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);for(let t=0;t<6;t++)n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,this._getRGBABufferInternalSizedFormat(i.type,i.format),e,e,0,this._getInternalFormat(i.format),this._getWebGLTextureType(i.type),null);let l=n.createFramebuffer();return this._bindUnboundFramebuffer(l),r._depthStencilBuffer=this._setupFramebufferDepthAttachments(i.generateStencilBuffer,i.generateDepthBuffer,e,e),i.generateMipMaps&&n.generateMipmap(n.TEXTURE_CUBE_MAP),this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),r._framebuffer=l,r._generateDepthBuffer=i.generateDepthBuffer,r._generateStencilBuffer=i.generateStencilBuffer,s.width=e,s.height=e,s.isReady=!0,s.isCube=!0,s.samples=1,s.generateMipMaps=i.generateMipMaps,s.samplingMode=i.samplingMode,s.type=i.type,s.format=i.format,this._internalTexturesCache.push(s),r.setTextures(s),r};var y=e.i(12247),C=e.i(68061);let B=!1;B=!0,c.ThinEngine.prototype.createPrefilteredCubeTexture=function(t,r,i,n,s=null,a=null,l,u=null,h=!0){let o=async t=>{if(!t){s&&s(null);return}let a=t.texture;if(h?t.info.sphericalPolynomial&&(a._sphericalPolynomial=t.info.sphericalPolynomial):a._sphericalPolynomial=a._sphericalPolynomial??new y.SphericalPolynomial,a._source=9,this.getCaps().textureLOD){s&&s(a);return}let l=this._gl,u=t.width;if(!u)return;let{DDSTools:o}=await e.A(690),_=[];for(let e=0;e<3;e++){let s=Math.log2(u)*i+n,h=Math.round(Math.min(Math.max(n+(s-n)*(1-e/2),0),s)),c=new T.InternalTexture(this,2);if(c.type=a.type,c.format=a.format,c.width=Math.pow(2,Math.max(Math.log2(u)-h,0)),c.height=c.width,c.isCube=!0,c._cachedWrapU=0,c._cachedWrapV=0,this._bindTextureDirectly(l.TEXTURE_CUBE_MAP,c,!0),c.samplingMode=2,l.texParameteri(l.TEXTURE_CUBE_MAP,l.TEXTURE_MAG_FILTER,l.LINEAR),l.texParameteri(l.TEXTURE_CUBE_MAP,l.TEXTURE_MIN_FILTER,l.LINEAR),l.texParameteri(l.TEXTURE_CUBE_MAP,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_CUBE_MAP,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),t.isDDS){let e=t.info,r=t.data;this._unpackFlipY(e.isCompressed),o.UploadDDSLevels(this,c,r,e,!0,6,h)}else f.Logger.Warn("DDS is the only prefiltered cube map supported so far.");this._bindTextureDirectly(l.TEXTURE_CUBE_MAP,null);let E=new C.BaseTexture(r);E._isCube=!0,E._texture=c,c.isReady=!0,_.push(E)}a._lodTextureHigh=_[2],a._lodTextureMid=_[1],a._lodTextureLow=_[0],s&&s(a)};return this.createCubeTexture(t,r,null,!1,o,a,l,u,h,i,n)};var I=e.i(42424);let L=!1;L=!0,c.ThinEngine.prototype.createUniformBuffer=function(e,t){let r=this._gl.createBuffer();if(!r)throw Error("Unable to create uniform buffer");let i=new I.WebGLDataBuffer(r);return this.bindUniformBuffer(i),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},c.ThinEngine.prototype.createDynamicUniformBuffer=function(e,t){let r=this._gl.createBuffer();if(!r)throw Error("Unable to create dynamic uniform buffer");let i=new I.WebGLDataBuffer(r);return this.bindUniformBuffer(i),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},c.ThinEngine.prototype.updateUniformBuffer=function(e,t,r,i){this.bindUniformBuffer(e),void 0===r&&(r=0),void 0===i?t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,r,t):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,r,new Float32Array(t)):t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,t.subarray(r,r+i)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(t).subarray(r,r+i)),this.bindUniformBuffer(null)},c.ThinEngine.prototype.bindUniformBuffer=function(e){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,e?e.underlyingResource:null)},c.ThinEngine.prototype.bindUniformBufferBase=function(e,t,r){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,t,e?e.underlyingResource:null)},c.ThinEngine.prototype.bindUniformBlock=function(e,t,r){let i=e.program,n=this._gl.getUniformBlockIndex(i,t);0xffffffff!==n&&this._gl.uniformBlockBinding(i,n,r)};var O=e.i(75865),X=e.i(20307);let N=!1;N=!0,X.AbstractEngine.prototype.displayLoadingUI=function(){if(!(0,O.IsWindowObjectExist)())return;let e=this.loadingScreen;e&&e.displayLoadingUI()},X.AbstractEngine.prototype.hideLoadingUI=function(){if(!(0,O.IsWindowObjectExist)())return;let e=this._loadingScreen;e&&e.hideLoadingUI()},Object.defineProperty(X.AbstractEngine.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=X.AbstractEngine.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(e){this._loadingScreen=e},enumerable:!0,configurable:!0}),Object.defineProperty(X.AbstractEngine.prototype,"loadingUIText",{set:function(e){this.loadingScreen.loadingUIText=e},enumerable:!0,configurable:!0}),Object.defineProperty(X.AbstractEngine.prototype,"loadingUIBackgroundColor",{set:function(e){this.loadingScreen.loadingUIBackgroundColor=e},enumerable:!0,configurable:!0});let w=!1;function v(){w||(w=!0,X.AbstractEngine.prototype.getInputElement=function(){return this._renderingCanvas},X.AbstractEngine.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},X.AbstractEngine.prototype.getInputElementClientRect=function(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null},X.AbstractEngine.prototype.getAspectRatio=function(e,t=!1){let r=e.viewport;return this.getRenderWidth(t)*r.width/(this.getRenderHeight(t)*r.height)},X.AbstractEngine.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)},X.AbstractEngine.prototype._verifyPointerLock=function(){this._onPointerLockChange?.()})}v();let G=!1;G=!0,X.AbstractEngine.prototype.getInputElement=function(){return this._renderingCanvas},X.AbstractEngine.prototype.getDepthFunction=function(){return this._depthCullingState.depthFunc},X.AbstractEngine.prototype.setDepthFunction=function(e){this._depthCullingState.depthFunc=e},X.AbstractEngine.prototype.setDepthFunctionToGreater=function(){this.setDepthFunction(516)},X.AbstractEngine.prototype.setDepthFunctionToGreaterOrEqual=function(){this.setDepthFunction(518)},X.AbstractEngine.prototype.setDepthFunctionToLess=function(){this.setDepthFunction(513)},X.AbstractEngine.prototype.setDepthFunctionToLessOrEqual=function(){this.setDepthFunction(515)},X.AbstractEngine.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask},X.AbstractEngine.prototype.setDepthWrite=function(e){this._depthCullingState.depthMask=e},X.AbstractEngine.prototype.setAlphaConstants=function(e,t,r,i){this._alphaState.setAlphaBlendConstants(e,t,r,i)},X.AbstractEngine.prototype.getAlphaMode=function(e=0){return this._alphaMode[e]},X.AbstractEngine.prototype.getAlphaEquation=function(e=0){return this._alphaEquation[e]};let k=!1;k=!0,X.AbstractEngine.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest},X.AbstractEngine.prototype.setStencilBuffer=function(e){this._stencilState.stencilTest=e},X.AbstractEngine.prototype.getStencilMask=function(){return this._stencilState.stencilMask},X.AbstractEngine.prototype.setStencilMask=function(e){this._stencilState.stencilMask=e},X.AbstractEngine.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc},X.AbstractEngine.prototype.getStencilBackFunction=function(){return this._stencilState.stencilBackFunc},X.AbstractEngine.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef},X.AbstractEngine.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask},X.AbstractEngine.prototype.setStencilFunction=function(e){this._stencilState.stencilFunc=e},X.AbstractEngine.prototype.setStencilBackFunction=function(e){this._stencilState.stencilBackFunc=e},X.AbstractEngine.prototype.setStencilFunctionReference=function(e){this._stencilState.stencilFuncRef=e},X.AbstractEngine.prototype.setStencilFunctionMask=function(e){this._stencilState.stencilFuncMask=e},X.AbstractEngine.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail},X.AbstractEngine.prototype.getStencilBackOperationFail=function(){return this._stencilState.stencilBackOpStencilFail},X.AbstractEngine.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail},X.AbstractEngine.prototype.getStencilBackOperationDepthFail=function(){return this._stencilState.stencilBackOpDepthFail},X.AbstractEngine.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass},X.AbstractEngine.prototype.getStencilBackOperationPass=function(){return this._stencilState.stencilBackOpStencilDepthPass},X.AbstractEngine.prototype.setStencilOperationFail=function(e){this._stencilState.stencilOpStencilFail=e},X.AbstractEngine.prototype.setStencilBackOperationFail=function(e){this._stencilState.stencilBackOpStencilFail=e},X.AbstractEngine.prototype.setStencilOperationDepthFail=function(e){this._stencilState.stencilOpDepthFail=e},X.AbstractEngine.prototype.setStencilBackOperationDepthFail=function(e){this._stencilState.stencilBackOpDepthFail=e},X.AbstractEngine.prototype.setStencilOperationPass=function(e){this._stencilState.stencilOpStencilDepthPass=e},X.AbstractEngine.prototype.setStencilBackOperationPass=function(e){this._stencilState.stencilBackOpStencilDepthPass=e},X.AbstractEngine.prototype.cacheStencilState=function(){this._cachedStencilBuffer=this.getStencilBuffer(),this._cachedStencilFunction=this.getStencilFunction(),this._cachedStencilMask=this.getStencilMask(),this._cachedStencilOperationPass=this.getStencilOperationPass(),this._cachedStencilOperationFail=this.getStencilOperationFail(),this._cachedStencilOperationDepthFail=this.getStencilOperationDepthFail(),this._cachedStencilReference=this.getStencilFunctionReference()},X.AbstractEngine.prototype.restoreStencilState=function(){this.setStencilFunction(this._cachedStencilFunction),this.setStencilMask(this._cachedStencilMask),this.setStencilBuffer(this._cachedStencilBuffer),this.setStencilOperationPass(this._cachedStencilOperationPass),this.setStencilOperationFail(this._cachedStencilOperationFail),this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail),this.setStencilFunctionReference(this._cachedStencilReference)};var W=e.i(9768);(0,W.RegisterAbstractEngineRenderPass)();let H=!1;H=!0,X.AbstractEngine.prototype.createDepthStencilTexture=function(e,t,r){if(!t.isCube)return this._createDepthStencilTexture(e,t,r);{let r=e.width||e;return this._createDepthStencilCubeTexture(r,t)}};let Y=!1;Y=!0,X.AbstractEngine.prototype._loadFileAsync=async function(e,t,r){return await new Promise((i,n)=>{this._loadFile(e,e=>{i(e)},void 0,t,r,(e,t)=>{n(t)})})};var V=e.i(34736);X.AbstractEngine.GetCompatibleTextureLoader=V._GetCompatibleTextureLoader;let z=!1;z=!0,c.ThinEngine.prototype.enableScissor=function(e,t,r,i){let n=this._gl;n.enable(n.SCISSOR_TEST),n.scissor(e,t,r,i)},c.ThinEngine.prototype.disableScissor=function(){let e=this._gl;e.disable(e.SCISSOR_TEST)},e.s([],99815),e.i(99815);var q=e.i(47867),K=c,j=e.i(85240);class Q{constructor(e=30){this._enabled=!0,this._rollingFrameTime=new Z(e)}sampleFrame(e=j.PrecisionDate.Now){if(this._enabled){if(null!=this._lastFrameTimeMs){let t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}}get averageFrameTime(){return this._rollingFrameTime.average}get averageFrameTimeVariance(){return this._rollingFrameTime.variance}get instantaneousFrameTime(){return this._rollingFrameTime.history(0)}get averageFPS(){return 1e3/this._rollingFrameTime.average}get instantaneousFPS(){let e=this._rollingFrameTime.history(0);return 0===e?0:1e3/e}get isSaturated(){return this._rollingFrameTime.isSaturated()}enable(){this._enabled=!0}disable(){this._enabled=!1,this._lastFrameTimeMs=null}get isEnabled(){return this._enabled}reset(){this._lastFrameTimeMs=null,this._rollingFrameTime.reset()}}class Z{constructor(e){this._samples=Array(e),this.reset()}add(e){let t;if(this.isSaturated()){let e=this._samples[this._pos];t=e-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(e-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length}history(e){if(e>=this._sampleCount||e>=this._samples.length)return 0;let t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]}isSaturated(){return this._sampleCount>=this._samples.length}reset(){this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0}_wrapPosition(e){let t=this._samples.length;return(e%t+t)%t}}var $=e.i(69178);function J(e){return Number.isFinite(e.ascent)&&Number.isFinite(e.height)&&Number.isFinite(e.descent)&&e.height>0}async function ee(e,t,r){return await new Promise((i,n)=>{let s=new Image;s.onload=()=>{s.decode().then(()=>{e.createImageBitmap(s,r).then(e=>{i(e)})})},s.onerror=()=>{n(`Error loading image ${s.src}`)},s.src=t})}function et(e){if(e.requestPointerLock){let t=e.requestPointerLock();t instanceof Promise?t.then(()=>{e.focus()}).catch(()=>{}):e.focus()}}var er=e.i(3367),ei=e.i(4775),en=e.i(54670);class es extends K.ThinEngine{static get NpmPackage(){return X.AbstractEngine.NpmPackage}static get Version(){return X.AbstractEngine.Version}static get Instances(){return q.EngineStore.Instances}static get LastCreatedEngine(){return q.EngineStore.LastCreatedEngine}static get LastCreatedScene(){return q.EngineStore.LastCreatedScene}static DefaultLoadingScreenFactory(e){return X.AbstractEngine.DefaultLoadingScreenFactory(e)}get _supportsHardwareTextureRescaling(){return!!es._RescalePostProcessFactory}_measureFps(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}get performanceMonitor(){return this._performanceMonitor}constructor(e,t,r,i=!1){if(v(),(0,W.RegisterAbstractEngineRenderPass)(),super(e,t,r,i),this._performanceMonitor=new Q,this._drawCalls=new er.PerfCounter,!e)return;this._features.supportRenderPasses=!0}_initGLContext(){super._initGLContext(),this._rescalePostProcess=null}_sharedInit(e){var t,r;let i;super._sharedInit(e),t=this,r=this._creationOptions,t._onCanvasFocus=()=>{t.onCanvasFocusObservable.notifyObservers(t)},t._onCanvasBlur=()=>{t.onCanvasBlurObservable.notifyObservers(t)},t._onCanvasContextMenu=e=>{t.disableContextMenu&&e.preventDefault()},e.addEventListener("focus",t._onCanvasFocus),e.addEventListener("blur",t._onCanvasBlur),e.addEventListener("contextmenu",t._onCanvasContextMenu),t._onBlur=()=>{t.disablePerformanceMonitorInBackground&&t.performanceMonitor.disable(),t._windowIsBackground=!0},t._onFocus=()=>{t.disablePerformanceMonitorInBackground&&t.performanceMonitor.enable(),t._windowIsBackground=!1},t._onCanvasPointerOut=r=>{document.elementFromPoint(r.clientX,r.clientY)!==e&&t.onCanvasPointerOutObservable.notifyObservers(r)},(i=t.getHostWindow())&&"function"==typeof i.addEventListener&&(i.addEventListener("blur",t._onBlur),i.addEventListener("focus",t._onFocus)),e.addEventListener("pointerout",t._onCanvasPointerOut),!r.doNotHandleTouchAction&&e&&e.setAttribute&&(e.setAttribute("touch-action","none"),e.style.touchAction="none",e.style.webkitTapHighlightColor="transparent"),!X.AbstractEngine.audioEngine&&r.audioEngine&&X.AbstractEngine.AudioEngineFactory&&(X.AbstractEngine.audioEngine=X.AbstractEngine.AudioEngineFactory(t.getRenderingCanvas(),t.getAudioContext(),t.getAudioDestination())),(0,O.IsDocumentAvailable)()&&(t._onFullscreenChange=()=>{t.isFullscreen=!!document.fullscreenElement,t.isFullscreen&&t._pointerLockRequested&&e&&et(e)},document.addEventListener("fullscreenchange",t._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",t._onFullscreenChange,!1),t._onPointerLockChange=()=>{t.isPointerLock=document.pointerLockElement===e},document.addEventListener("pointerlockchange",t._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",t._onPointerLockChange,!1)),t.enableOfflineSupport=void 0!==X.AbstractEngine.OfflineProviderFactory,t._deterministicLockstep=!!r.deterministicLockstep,t._lockstepMaxSteps=r.lockstepMaxSteps||0,t._timeStep=r.timeStep||1/60}resizeImageBitmap(e,t,r){let i=this.createCanvas(t,r).getContext("2d");if(!i)throw Error("Unable to get 2d context for resizeImageBitmap");return i.drawImage(e,0,0),i.getImageData(0,0,t,r).data}async _createImageBitmapFromSource(e,t){return await ee(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){if(!this.isFullscreen){var t;let r;this._pointerLockRequested=e,this._renderingCanvas&&(r=(t=this._renderingCanvas).requestFullscreen||t.webkitRequestFullscreen)&&r.call(t)}}exitFullscreen(){let e;this.isFullscreen&&(e=document,document.exitFullscreen?document.exitFullscreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen())}setDitheringState(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)}setRasterizerState(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)}setDirectViewport(e,t,r,i){let n=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,r,i),n}scissorClear(e,t,r,i,n){this.enableScissor(e,t,r,i),this.clear(n,!0,!0,!0),this.disableScissor()}getVertexShaderSource(e){let t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null}getFragmentShaderSource(e){let t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e,this._framebufferDimensionsObject&&this.onResizeObservable.notifyObservers(this)}_rebuildBuffers(){for(let e of this.scenes)e.resetCachedMaterial(),e._rebuildGeometries();for(let e of this._virtualScenes)e.resetCachedMaterial(),e._rebuildGeometries();super._rebuildBuffers()}getFontOffset(e){var t;let r,i,n,s,a=function(e){let t,r;if(!(0,O.IsDocumentAvailable)()||!document.body)return null;let i=document.createElement("span");i.textContent="Hg",i.style.font=e;let n=document.createElement("div");n.style.display="inline-block",n.style.width="1px",n.style.height="0px",n.style.verticalAlign="bottom";let s=document.createElement("div");s.style.whiteSpace="nowrap",s.appendChild(i),s.appendChild(n),document.body.appendChild(s);try{r=n.getBoundingClientRect().top-i.getBoundingClientRect().top,n.style.verticalAlign="baseline",t=n.getBoundingClientRect().top-i.getBoundingClientRect().top}finally{document.body.removeChild(s)}let a={ascent:t,height:r,descent:r-t};return J(a)?a:null}(e);if(a)return a;let l=function(e){let t=null;try{"u">typeof OffscreenCanvas?t=new OffscreenCanvas(64,64):(0,O.IsDocumentAvailable)()&&"function"==typeof document.createElement&&((t=document.createElement("canvas")).width=64,t.height=64);let r=t?.getContext("2d");if(!r)return null;r.font=e;let i=r.measureText("Hg"),n=Number(i.actualBoundingBoxAscent??i.fontBoundingBoxAscent),s=Number(i.actualBoundingBoxDescent??i.fontBoundingBoxDescent),a={ascent:n,height:n+s,descent:s};return J(a)?a:null}catch{return null}finally{let e=t;"function"==typeof e?.dispose&&e.dispose()}}(e);return l||(n=.8*(i=Math.max(1,(t=e,(r=/(?:^|\s)([0-9]+(?:\.[0-9]+)?)px(?:\/|\s|$)/.exec(String(t||"")))?Number(r[1]):16))),{ascent:n,height:n+(s=.2*i),descent:s})}enterPointerlock(){this._renderingCanvas&&et(this._renderingCanvas)}exitPointerlock(){document.exitPointerLock&&document.exitPointerLock()}beginFrame(){this._measureFps(),super.beginFrame()}_deletePipelineContext(e){e&&e.program&&e.transformFeedback&&(this.deleteTransformFeedback(e.transformFeedback),e.transformFeedback=null),super._deletePipelineContext(e)}createShaderProgram(e,t,r,i,n,s=null){n=n||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);let a=super.createShaderProgram(e,t,r,i,n,s);return this.onAfterShaderCompilationObservable.notifyObservers(this),a}_createShaderProgram(e,t,r,i,n=null){let s=i.createProgram();if(e.program=s,!s)throw Error("Unable to create program");if(i.attachShader(s,t),i.attachShader(s,r),this.webGLVersion>1&&n){let t=this.createTransformFeedback();this.bindTransformFeedback(t),this.setTranformFeedbackVaryings(s,n),e.transformFeedback=t}return i.linkProgram(s),this.webGLVersion>1&&n&&this.bindTransformFeedback(null),e.context=i,e.vertexShader=t,e.fragmentShader=r,e.isParallelCompiled||this._finalizePipelineContext(e),s}_releaseTexture(e){super._releaseTexture(e)}_releaseRenderTargetWrapper(e){for(let t of(super._releaseRenderTargetWrapper(e),this.scenes)){for(let r of t.postProcesses)r._outputTexture===e&&(r._outputTexture=null);for(let r of t.cameras)for(let t of r._postProcesses)t&&t._outputTexture===e&&(t._outputTexture=null)}}_rescaleTexture(e,t,r,i,n){this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);let s=this.createRenderTargetTexture({width:t.width,height:t.height},{generateMipMaps:!1,type:0,samplingMode:2,generateDepthBuffer:!1,generateStencilBuffer:!1});if(!this._rescalePostProcess&&es._RescalePostProcessFactory&&(this._rescalePostProcess=es._RescalePostProcessFactory(this)),this._rescalePostProcess){this._rescalePostProcess.externalTextureSamplerBinding=!0;let a=()=>{this._rescalePostProcess.onApply=function(t){t._bindTexture("textureSampler",e)};let a=r;a||(a=this.scenes[this.scenes.length-1]),a.postProcessManager.directRender([this._rescalePostProcess],s,!0),this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._gl.copyTexImage2D(this._gl.TEXTURE_2D,0,i,0,0,t.width,t.height,0),this.unBindFramebuffer(s),s.dispose(),n&&n()},l=this._rescalePostProcess.getEffect();l?l.executeWhenCompiled(a):this._rescalePostProcess.onEffectCreatedObservable.addOnce(e=>{e.executeWhenCompiled(a)})}}wrapWebGLTexture(e,t=!1,r=3,i=0,n=0){let s=new $.WebGLHardwareTexture(e,this._gl),a=new T.InternalTexture(this,15,!0);return a._hardwareTexture=s,a.baseWidth=i,a.baseHeight=n,a.width=i,a.height=n,a.isReady=!0,a.useMipMaps=t,this.updateTextureSamplingMode(r,a),a}updateWrappedWebGLTexture(e,t){if(15!==e.source)throw Error("updateWrappedWebGLTexture: target InternalTexture was not produced by wrapWebGLTexture.");for(let t of this._renderTargetWrapperCache)if(t.textures?.includes(e)){if(t.isMulti)throw Error("updateWrappedWebGLTexture: wrapped texture is part of a multi render-target; not supported. Dispose and re-wrap.");if(t._depthStencilTexture)throw Error("updateWrappedWebGLTexture: wrapped texture's render-target wrapper has a depth/stencil texture; not supported. Dispose and re-wrap.")}for(let r in e._hardwareTexture=new $.WebGLHardwareTexture(t,this._gl),e.isReady=!0,e._cachedCoordinatesMode=null,e._cachedWrapU=null,e._cachedWrapV=null,e._cachedWrapR=null,e._cachedAnisotropicFilteringLevel=null,this._boundTexturesCache)this._boundTexturesCache[r]===e&&(this._boundTexturesCache[r]=null);this.updateTextureSamplingMode(e.samplingMode,e);let r=this._gl;for(let i of this._renderTargetWrapperCache){if(i.texture!==e)continue;let n=i.samples,s=n>1;i._framebuffer&&r.deleteFramebuffer(i._framebuffer),!s&&i._depthStencilBuffer&&(r.deleteRenderbuffer(i._depthStencilBuffer),i._depthStencilBuffer=null);let a=this._currentFramebuffer,l=r.createFramebuffer();this._bindUnboundFramebuffer(l),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),s||(i._depthStencilBuffer=this._setupFramebufferDepthAttachments(i._generateStencilBuffer,i._generateDepthBuffer,i.width,i.height)),this._bindUnboundFramebuffer(a),i._framebuffer=l,s&&(i._samples=1,this.updateRenderTargetTextureSampleCount(i,n))}}_uploadImageToTexture(e,t,r=0,i=0){let n=this._gl,s=this._getWebGLTextureType(e.type),a=this._getInternalFormat(e.format),l=this._getRGBABufferInternalSizedFormat(e.type,a),u=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(u,e,!0),this._unpackFlipY(e.invertY);let h=n.TEXTURE_2D;e.isCube&&(h=n.TEXTURE_CUBE_MAP_POSITIVE_X+r),n.texImage2D(h,i,l,a,s,t),this._bindTextureDirectly(u,null,!0)}updateTextureComparisonFunction(e,t){if(1===this.webGLVersion)return void f.Logger.Error("WebGL 1 does not support texture comparison.");let r=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),0===t?(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,515),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,t),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),0===t?(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,515),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}createInstancesBuffer(e){let t=this._gl.createBuffer();if(!t)throw Error("Unable to create instance buffer");let r=new I.WebGLDataBuffer(t);return r.capacity=e,this.bindArrayBuffer(r),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),r.references=1,r}deleteInstancesBuffer(e){this._gl.deleteBuffer(e)}async _clientWaitAsync(e,t=0,r=10){let i=this._gl;return await new Promise((n,s)=>{(0,ei._RetryWithInterval)(()=>{let r=i.clientWaitSync(e,t,0);if(r==i.WAIT_FAILED)throw Error("clientWaitSync failed");return r!=i.TIMEOUT_EXPIRED},n,s,r)})}_readPixelsAsync(e,t,r,i,n,s,a){if(this._webGLVersion<2)throw Error("_readPixelsAsync only work on WebGL2+");let l=this._gl,u=l.createBuffer();l.bindBuffer(l.PIXEL_PACK_BUFFER,u),l.bufferData(l.PIXEL_PACK_BUFFER,a.byteLength,l.STREAM_READ),l.readPixels(e,t,r,i,n,s,0),l.bindBuffer(l.PIXEL_PACK_BUFFER,null);let h=l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE,0);return h?(l.flush(),this._clientWaitAsync(h,0,10).then(()=>(l.deleteSync(h),l.bindBuffer(l.PIXEL_PACK_BUFFER,u),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,a),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),l.deleteBuffer(u),a))):null}dispose(){var e;let t;this.hideLoadingUI(),this._rescalePostProcess&&this._rescalePostProcess.dispose(),e=this._renderingCanvas,1===q.EngineStore.Instances.length&&X.AbstractEngine.audioEngine&&(X.AbstractEngine.audioEngine.dispose(),X.AbstractEngine.audioEngine=null),(t=this.getHostWindow())&&"function"==typeof t.removeEventListener&&(t.removeEventListener("blur",this._onBlur),t.removeEventListener("focus",this._onFocus)),e&&(e.removeEventListener("focus",this._onCanvasFocus),e.removeEventListener("blur",this._onCanvasBlur),e.removeEventListener("pointerout",this._onCanvasPointerOut),e.removeEventListener("contextmenu",this._onCanvasContextMenu)),(0,O.IsDocumentAvailable)()&&(document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("mozfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("msfullscreenchange",this._onFullscreenChange),document.removeEventListener("pointerlockchange",this._onPointerLockChange),document.removeEventListener("mspointerlockchange",this._onPointerLockChange),document.removeEventListener("mozpointerlockchange",this._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",this._onPointerLockChange)),super.dispose()}}es.ALPHA_DISABLE=0,es.ALPHA_ADD=1,es.ALPHA_COMBINE=2,es.ALPHA_SUBTRACT=3,es.ALPHA_MULTIPLY=4,es.ALPHA_MAXIMIZED=5,es.ALPHA_ONEONE=6,es.ALPHA_PREMULTIPLIED=7,es.ALPHA_PREMULTIPLIED_PORTERDUFF=8,es.ALPHA_INTERPOLATE=9,es.ALPHA_SCREENMODE=10,es.DELAYLOADSTATE_NONE=0,es.DELAYLOADSTATE_LOADED=1,es.DELAYLOADSTATE_LOADING=2,es.DELAYLOADSTATE_NOTLOADED=4,es.NEVER=512,es.ALWAYS=519,es.LESS=513,es.EQUAL=514,es.LEQUAL=515,es.GREATER=516,es.GEQUAL=518,es.NOTEQUAL=517,es.KEEP=7680,es.REPLACE=7681,es.INCR=7682,es.DECR=7683,es.INVERT=5386,es.INCR_WRAP=34055,es.DECR_WRAP=34056,es.TEXTURE_CLAMP_ADDRESSMODE=0,es.TEXTURE_WRAP_ADDRESSMODE=1,es.TEXTURE_MIRROR_ADDRESSMODE=2,es.TEXTUREFORMAT_ALPHA=0,es.TEXTUREFORMAT_LUMINANCE=1,es.TEXTUREFORMAT_LUMINANCE_ALPHA=2,es.TEXTUREFORMAT_RGB=4,es.TEXTUREFORMAT_RGBA=5,es.TEXTUREFORMAT_RED=6,es.TEXTUREFORMAT_R=6,es.TEXTUREFORMAT_R16_UNORM=33322,es.TEXTUREFORMAT_RG16_UNORM=33324,es.TEXTUREFORMAT_RGB16_UNORM=32852,es.TEXTUREFORMAT_RGBA16_UNORM=32859,es.TEXTUREFORMAT_R16_SNORM=36760,es.TEXTUREFORMAT_RG16_SNORM=36761,es.TEXTUREFORMAT_RGB16_SNORM=36762,es.TEXTUREFORMAT_RGBA16_SNORM=36763,es.TEXTUREFORMAT_RG=7,es.TEXTUREFORMAT_RED_INTEGER=8,es.TEXTUREFORMAT_R_INTEGER=8,es.TEXTUREFORMAT_RG_INTEGER=9,es.TEXTUREFORMAT_RGB_INTEGER=10,es.TEXTUREFORMAT_RGBA_INTEGER=11,es.TEXTURETYPE_UNSIGNED_BYTE=0,es.TEXTURETYPE_UNSIGNED_INT=0,es.TEXTURETYPE_FLOAT=1,es.TEXTURETYPE_HALF_FLOAT=2,es.TEXTURETYPE_BYTE=3,es.TEXTURETYPE_SHORT=4,es.TEXTURETYPE_UNSIGNED_SHORT=5,es.TEXTURETYPE_INT=6,es.TEXTURETYPE_UNSIGNED_INTEGER=7,es.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8,es.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9,es.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10,es.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11,es.TEXTURETYPE_UNSIGNED_INT_24_8=12,es.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13,es.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14,es.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15,es.TEXTURE_NEAREST_SAMPLINGMODE=1,es.TEXTURE_BILINEAR_SAMPLINGMODE=2,es.TEXTURE_TRILINEAR_SAMPLINGMODE=3,es.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8,es.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11,es.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3,es.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4,es.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5,es.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6,es.TEXTURE_NEAREST_LINEAR=7,es.TEXTURE_NEAREST_NEAREST=1,es.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9,es.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10,es.TEXTURE_LINEAR_LINEAR=2,es.TEXTURE_LINEAR_NEAREST=12,es.TEXTURE_EXPLICIT_MODE=0,es.TEXTURE_SPHERICAL_MODE=1,es.TEXTURE_PLANAR_MODE=2,es.TEXTURE_CUBIC_MODE=3,es.TEXTURE_PROJECTION_MODE=4,es.TEXTURE_SKYBOX_MODE=5,es.TEXTURE_INVCUBIC_MODE=6,es.TEXTURE_EQUIRECTANGULAR_MODE=7,es.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8,es.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,es.SCALEMODE_FLOOR=1,es.SCALEMODE_NEAREST=2,es.SCALEMODE_CEILING=3,(t=es.prototype).createMultiviewRenderTargetTexture??(t.createMultiviewRenderTargetTexture=(0,en._MissingSideEffect)("Engine","createMultiviewRenderTargetTexture")),(r=es.prototype).bindMultiviewFramebuffer??(r.bindMultiviewFramebuffer=(0,en._MissingSideEffect)("Engine","bindMultiviewFramebuffer")),(i=es.prototype).bindSpaceWarpFramebuffer??(i.bindSpaceWarpFramebuffer=(0,en._MissingSideEffect)("Engine","bindSpaceWarpFramebuffer")),(n=es.prototype).createTransformFeedback??(n.createTransformFeedback=(0,en._MissingSideEffect)("Engine","createTransformFeedback")),(s=es.prototype).deleteTransformFeedback??(s.deleteTransformFeedback=(0,en._MissingSideEffect)("Engine","deleteTransformFeedback")),(a=es.prototype).bindTransformFeedback??(a.bindTransformFeedback=(0,en._MissingSideEffect)("Engine","bindTransformFeedback")),(l=es.prototype).beginTransformFeedback??(l.beginTransformFeedback=(0,en._MissingSideEffect)("Engine","beginTransformFeedback")),(u=es.prototype).endTransformFeedback??(u.endTransformFeedback=(0,en._MissingSideEffect)("Engine","endTransformFeedback")),(h=es.prototype).setTranformFeedbackVaryings??(h.setTranformFeedbackVaryings=(0,en._MissingSideEffect)("Engine","setTranformFeedbackVaryings")),(o=es.prototype).bindTransformFeedbackBuffer??(o.bindTransformFeedbackBuffer=(0,en._MissingSideEffect)("Engine","bindTransformFeedbackBuffer")),(_=es.prototype).readTransformFeedbackBuffer??(_.readTransformFeedbackBuffer=(0,en._MissingSideEffect)("Engine","readTransformFeedbackBuffer")),e.s(["Engine",0,es],50739),e.i(50739),e.s(["Engine",0,es],66232)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62619,e=>{"use strict";var t,r,i,n,s,a,l,u,h,o,_,c=e.i(35160);let E=!1;E=!0,c.ThinEngine.prototype.setAlphaMode=function(e,t=!1,r=0){if(this._alphaMode[r]===e){if(!t){let t=0===e;this.depthCullingState.depthMask!==t&&(this.depthCullingState.depthMask=t)}return}let i=0===e;this._alphaState.setAlphaBlend(!i,r),this._alphaState.setAlphaMode(e,r),t||(this.depthCullingState.depthMask=i),this._alphaMode[r]=e};var T=e.i(93298),f=e.i(80434),p=e.i(98551);let d=!1;function g(e,t,r,i){let n,s=1;1===i?n=new Float32Array(t*r*4):2===i?(n=new Uint16Array(t*r*4),s=15360):n=7===i?new Uint32Array(t*r*4):new Uint8Array(t*r*4);for(let i=0;i<t;i++)for(let a=0;a<r;a++){let r=(a*t+i)*3,l=(a*t+i)*4;n[l+0]=e[r+0],n[l+1]=e[r+1],n[l+2]=e[r+2],n[l+3]=s}return n}function R(e){return function(t,r,i,n,s,a,l,u,h=null,o=0){let _=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,c=new T.InternalTexture(this,e?10:11);c.baseWidth=r,c.baseHeight=i,c.baseDepth=n,c.width=r,c.height=i,c.depth=n,c.format=s,c.type=o,c.generateMipMaps=a,c.samplingMode=u,e?c.is3D=!0:c.is2DArray=!0,this._doNotHandleContextLost||(c._bufferView=t),e?this.updateRawTexture3D(c,t,s,l,h,o):this.updateRawTexture2DArray(c,t,s,l,h,o),this._bindTextureDirectly(_,c,!0);let E=this._getSamplingParameters(u,a);return this._gl.texParameteri(_,this._gl.TEXTURE_MAG_FILTER,E.mag),this._gl.texParameteri(_,this._gl.TEXTURE_MIN_FILTER,E.min),a&&this._gl.generateMipmap(_),this._bindTextureDirectly(_,null),this._internalTexturesCache.push(c),c}}function m(e){return function(t,r,i,n,s=null,a=0){let l=e?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,u=this._getWebGLTextureType(a),h=this._getInternalFormat(i),o=this._getRGBABufferInternalSizedFormat(a,i);this._bindTextureDirectly(l,t,!0),this._unpackFlipY(void 0===n||!!n),this._doNotHandleContextLost||(t._bufferView=r,t.format=i,t.invertY=n,t._compression=s),t.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),s&&r?this._gl.compressedTexImage3D(l,0,this.getCaps().s3tc[s],t.width,t.height,t.depth,0,r):this._gl.texImage3D(l,0,o,t.width,t.height,t.depth,0,h,u,r),t.generateMipMaps&&this._gl.generateMipmap(l),this._bindTextureDirectly(l,null),t.isReady=!0}}d=!0,c.ThinEngine.prototype.updateRawTexture=function(e,t,r,i,n=null,s=0,a=!1){if(!e)return;let l=this._getRGBABufferInternalSizedFormat(s,r,a),u=this._getInternalFormat(r),h=this._getWebGLTextureType(s);this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===i||!!i),this._doNotHandleContextLost||(e._bufferView=t,e.format=r,e.type=s,e.invertY=i,e._compression=n),e.width%4!=0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),n&&t?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[n],e.width,e.height,0,t):this._gl.texImage2D(this._gl.TEXTURE_2D,0,l,e.width,e.height,0,u,h,t),e.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),e.isReady=!0},c.ThinEngine.prototype.createRawTexture=function(e,t,r,i,n,s,a,l=null,u=0,h=0,o=!1){let _=new T.InternalTexture(this,3);_.baseWidth=t,_.baseHeight=r,_.width=t,_.height=r,_.format=i,_.generateMipMaps=n,_.samplingMode=a,_.invertY=s,_._compression=l,_.type=u,_._useSRGBBuffer=this._getUseSRGBBuffer(o,!n),this._doNotHandleContextLost||(_._bufferView=e),this.updateRawTexture(_,e,i,s,l,u,_._useSRGBBuffer),this._bindTextureDirectly(this._gl.TEXTURE_2D,_,!0);let c=this._getSamplingParameters(a,n);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,c.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,c.min),n&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(_),_},c.ThinEngine.prototype.createRawCubeTexture=function(e,t,r,i,n,s,a,l=null){let u=this._gl,h=new T.InternalTexture(this,8);h.isCube=!0,h.format=r,h.type=i,this._doNotHandleContextLost||(h._bufferViewArray=e);let o=this._getWebGLTextureType(i),_=this._getInternalFormat(r);if(_===u.RGB&&(_=u.RGBA),o!==u.FLOAT||this._caps.textureFloatLinearFiltering?o!==this._gl.HALF_FLOAT_OES||this._caps.textureHalfFloatLinearFiltering?o!==u.FLOAT||this._caps.textureFloatRender?o!==u.HALF_FLOAT||this._caps.colorBufferFloat||(n=!1,f.Logger.Warn("Render to half float textures is not supported. Mipmap generation forced to false.")):(n=!1,f.Logger.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):(n=!1,a=1,f.Logger.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):(n=!1,a=1,f.Logger.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")),h.width=t,h.height=t,h.invertY=s,h._compression=l,!this.needPOTTextures||(0,p.IsExponentOfTwo)(h.width)&&(0,p.IsExponentOfTwo)(h.height)||(n=!1),e)this.updateRawCubeTexture(h,e,r,i,s,l);else{let e=this._getRGBABufferInternalSizedFormat(i);this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,h,!0);for(let t=0;t<6;t++)l?u.compressedTexImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,this.getCaps().s3tc[l],h.width,h.height,0,void 0):u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,e,h.width,h.height,0,_,o,null);this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)}this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,h,!0),e&&n&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);let c=this._getSamplingParameters(a,n);return u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MAG_FILTER,c.mag),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_MIN_FILTER,c.min),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_CUBE_MAP,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),this._bindTextureDirectly(u.TEXTURE_CUBE_MAP,null),h.generateMipMaps=n,h.samplingMode=a,h.isReady=!0,h},c.ThinEngine.prototype.updateRawCubeTexture=function(e,t,r,i,n,s=null,a=0){e._bufferViewArray=t,e.format=r,e.type=i,e.invertY=n,e._compression=s;let l=this._gl,u=this._getWebGLTextureType(i),h=this._getInternalFormat(r),o=this._getRGBABufferInternalSizedFormat(i),_=!1;h===l.RGB&&(h=l.RGBA,_=!0),this._bindTextureDirectly(l.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(void 0===n||!!n),e.width%4!=0&&l.pixelStorei(l.UNPACK_ALIGNMENT,1);for(let r=0;r<6;r++){let n=t[r];s?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+r,a,this.getCaps().s3tc[s],e.width,e.height,0,n):(_&&(n=g(n,e.width,e.height,i)),l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+r,a,o,e.width,e.height,0,h,u,n))}(!this.needPOTTextures||(0,p.IsExponentOfTwo)(e.width)&&(0,p.IsExponentOfTwo)(e.height))&&e.generateMipMaps&&0===a&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),e.isReady=!0},c.ThinEngine.prototype.createRawCubeTextureFromUrl=function(e,t,r,i,n,s,a,l,u=null,h=null,o=3,_=!1){let c=this._gl,E=this.createRawCubeTexture(null,r,i,n,!s,_,o,null);t?.addPendingData(E),E.url=e,E.isReady=!1,this._internalTexturesCache.push(E);let T=(e,r)=>{t?.removePendingData(E),h&&h(e?e.status+" "+e.statusText:"Failed to parse texture data",r)},f=async e=>{if(!E._hardwareTexture)return;let r=a(e);if(!r)return;let s=r instanceof Promise?await r:r,h=E.width;if(l){let e=this._getWebGLTextureType(n),t=this._getInternalFormat(i),r=this._getRGBABufferInternalSizedFormat(n),a=!1;t===c.RGB&&(t=c.RGBA,a=!0),this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,E,!0),this._unpackFlipY(!1);let u=l(s);for(let i=0;i<u.length;i++){let s=h>>i;for(let l=0;l<6;l++){let h=u[i][l];a&&(h=g(h,s,s,n)),c.texImage2D(l,i,r,s,s,0,t,e,h)}}this._bindTextureDirectly(c.TEXTURE_CUBE_MAP,null)}else this.updateRawCubeTexture(E,s,i,n,_);E.isReady=!0,t?.removePendingData(E),E.onLoadedObservable.notifyObservers(E),E.onLoadedObservable.clear(),u&&u()};return this._loadFile(e,e=>{f(e).catch(e=>{T(void 0,e)})},void 0,t?.offlineProvider,!0,T),E},c.ThinEngine.prototype.createRawTexture2DArray=R(!1),c.ThinEngine.prototype.createRawTexture3D=R(!0),c.ThinEngine.prototype.updateRawTexture2DArray=m(!1),c.ThinEngine.prototype.updateRawTexture3D=m(!0);var A=e.i(61599);let b=!1;b=!0,c.ThinEngine.prototype._readTexturePixelsSync=function(e,t,r,i=-1,n=0,s=null,a=!0,l=!1,u=0,h=0){let o=this._gl;if(!o)throw Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){let e=o.createFramebuffer();if(!e)throw Error("Unable to create dummy framebuffer");this._dummyFramebuffer=e}o.bindFramebuffer(o.FRAMEBUFFER,this._dummyFramebuffer),i>-1&&(e.is2DArray||e.is3D)?o.framebufferTextureLayer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,e._hardwareTexture?.underlyingResource,n,i):i>-1?o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+i,e._hardwareTexture?.underlyingResource,n):o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,e._hardwareTexture?.underlyingResource,n);let _=void 0!==e.type?this._getWebGLTextureType(e.type):o.UNSIGNED_BYTE;return l?s||(s=(0,A.allocateAndCopyTypedBuffer)(e.type,4*t*r)):_===o.UNSIGNED_BYTE?(s||(s=new Uint8Array(4*t*r)),_=o.UNSIGNED_BYTE):(s||(s=new Float32Array(4*t*r)),_=o.FLOAT),a&&this.flushFramebuffer(),o.readPixels(u,h,t,r,o.RGBA,_,s),o.bindFramebuffer(o.FRAMEBUFFER,this._currentFramebuffer),s},c.ThinEngine.prototype._readTexturePixels=function(e,t,r,i=-1,n=0,s=null,a=!0,l=!1,u=0,h=0){return Promise.resolve(this._readTexturePixelsSync(e,t,r,i,n,s,a,l,u,h))},(0,e.i(60216).RegisterEngineDynamicBuffer)();let S=!1;S=!0,c.ThinEngine.prototype._createDepthStencilCubeTexture=function(e,t){let r=new T.InternalTexture(this,12);if(r.isCube=!0,1===this.webGLVersion)return f.Logger.Error("Depth cube texture is not supported by WebGL 1."),r;let i={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...t},n=this._gl;this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,r,!0),this._setupDepthStencilTexture(r,e,i.bilinearFiltering,i.comparisonFunction);for(let t=0;t<6;t++)i.generateStencil?n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,n.DEPTH24_STENCIL8,e,e,0,n.DEPTH_STENCIL,n.UNSIGNED_INT_24_8,null):n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,n.DEPTH_COMPONENT24,e,e,0,n.DEPTH_COMPONENT,n.UNSIGNED_INT,null);return this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,null),this._internalTexturesCache.push(r),r},c.ThinEngine.prototype._setCubeMapTextureParams=function(e,t,r){let i=this._gl;i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,t?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),e.samplingMode=t?3:2,t&&this.getCaps().textureMaxLevel&&void 0!==r&&r>0&&(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_LEVEL,r),e._maxLodLevel=r),this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)},c.ThinEngine.prototype.createCubeTexture=function(e,t,r,i,n=null,s=null,a,l=null,u=!1,h=0,o=0,_=null,c,E=!1,T=null){let d=this._gl;return this.createCubeTextureBase(e,t,r,!!i,n,s,a,l,u,h,o,_,e=>this._bindTextureDirectly(d.TEXTURE_CUBE_MAP,e,!0),(e,t)=>{let r=this.needPOTTextures?(0,p.GetExponentOfTwo)(t[0].width,this._caps.maxCubemapTextureSize):t[0].width,s=[d.TEXTURE_CUBE_MAP_POSITIVE_X,d.TEXTURE_CUBE_MAP_POSITIVE_Y,d.TEXTURE_CUBE_MAP_POSITIVE_Z,d.TEXTURE_CUBE_MAP_NEGATIVE_X,d.TEXTURE_CUBE_MAP_NEGATIVE_Y,d.TEXTURE_CUBE_MAP_NEGATIVE_Z];this._bindTextureDirectly(d.TEXTURE_CUBE_MAP,e,!0),this._unpackFlipY(!1);let l=a?this._getInternalFormat(a,e._useSRGBBuffer):e._useSRGBBuffer?this._glSRGBExtensionValues.SRGB8_ALPHA8:d.RGBA,u=a?this._getInternalFormat(a):d.RGBA;e._useSRGBBuffer&&1===this.webGLVersion&&(u=l);for(let e=0;e<s.length;e++)if(t[e].width!==r||t[e].height!==r){if(this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext)return void f.Logger.Warn("Cannot create canvas to resize texture.");this._workingCanvas.width=r,this._workingCanvas.height=r,this._workingContext.drawImage(t[e],0,0,t[e].width,t[e].height,0,0,r,r),d.texImage2D(s[e],0,l,u,d.UNSIGNED_BYTE,this._workingCanvas)}else d.texImage2D(s[e],0,l,u,d.UNSIGNED_BYTE,t[e]);i||d.generateMipmap(d.TEXTURE_CUBE_MAP),this._setCubeMapTextureParams(e,!i),e.width=r,e.height=r,e.isReady=!0,a&&(e.format=a),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear(),n&&n()},!!E,T)},c.ThinEngine.prototype.generateMipMapsForCubemap=function(e,t=!0){if(e.generateMipMaps){let r=this._gl;this._bindTextureDirectly(r.TEXTURE_CUBE_MAP,e,!0),r.generateMipmap(r.TEXTURE_CUBE_MAP),t&&this._bindTextureDirectly(r.TEXTURE_CUBE_MAP,null)}};var F=e.i(23949);class x{get depthStencilTexture(){return this._depthStencilTexture}setDepthStencilTexture(e,t=!0){t&&this._depthStencilTexture&&this._depthStencilTexture.dispose(),this._depthStencilTexture=e,this._generateDepthBuffer=this._generateStencilBuffer=this._depthStencilTextureWithStencil=!1,e&&(this._generateDepthBuffer=!0,this._generateStencilBuffer=this._depthStencilTextureWithStencil=(0,F.HasStencilAspect)(e.format))}get depthStencilTextureWithStencil(){return this._depthStencilTextureWithStencil}get isCube(){return this._isCube}get isMulti(){return this._isMulti}get is2DArray(){return this.layers>0}get is3D(){return this.depth>0}get size(){return this.width}get width(){return this._size.width??this._size}get height(){return this._size.height??this._size}get layers(){return this._size.layers||0}get depth(){return this._size.depth||0}get texture(){return this._textures?.[0]??null}get textures(){return this._textures}get faceIndices(){return this._faceIndices}get layerIndices(){return this._layerIndices}getBaseArrayLayer(e){if(!this._textures)return -1;let t=this._textures[e],r=this._layerIndices?.[e]??0,i=this._faceIndices?.[e]??0;return t.isCube?6*r+i:t.is3D?0:r}get samples(){return this._samples}setSamples(e,t=!0,r=!1){if(this.samples===e&&!r)return e;let i=this._isMulti?this._engine.updateMultipleRenderTargetTextureSampleCount(this,e,t):this._engine.updateRenderTargetTextureSampleCount(this,e);return this._samples=e,i}resolveMSAATextures(){this.isMulti?this._engine.resolveMultiFramebuffer(this):this._engine.resolveFramebuffer(this)}generateMipMaps(){this._engine._currentRenderTarget===this&&(this.isMulti?this._engine.unBindMultiColorAttachmentFramebuffer(this,!0):this._engine.unBindFramebuffer(this,!0)),this.isMulti?this._engine.generateMipMapsMultiFramebuffer(this):this._engine.generateMipMapsFramebuffer(this)}constructor(e,t,r,i,n){this._textures=null,this._faceIndices=null,this._layerIndices=null,this._samples=1,this._attachments=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._depthStencilTextureWithStencil=!1,this.disableAutomaticMSAAResolve=!1,this.resolveMSAAColors=!0,this.resolveMSAADepth=!1,this.resolveMSAAStencil=!1,this.depthReadOnly=!1,this.stencilReadOnly=!1,this._isMulti=e,this._isCube=t,this._size=r,this._engine=i,this._depthStencilTexture=null,this.label=n}setTextures(e){Array.isArray(e)?this._textures=e:e?this._textures=[e]:this._textures=null}setTexture(e,t=0,r=!0){this._textures||(this._textures=[]),this._textures[t]!==e&&(this._textures[t]&&r&&this._textures[t].dispose(),this._textures[t]=e)}setLayerAndFaceIndices(e,t){this._layerIndices=e,this._faceIndices=t}setLayerAndFaceIndex(e=0,t,r){this._layerIndices||(this._layerIndices=[]),this._faceIndices||(this._faceIndices=[]),void 0!==t&&t>=0&&(this._layerIndices[e]=t),void 0!==r&&r>=0&&(this._faceIndices[e]=r)}createDepthStencilTexture(e=0,t=!0,r=!1,i=1,n=14,s){return this._depthStencilTexture?.dispose(),this._depthStencilTextureWithStencil=r,this._depthStencilTextureLabel=s,this._depthStencilTexture=this._engine.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:r,isCube:this._isCube,samples:i,depthTextureFormat:n,label:s},this),this._depthStencilTexture}_shareDepth(e){this.shareDepth(e)}shareDepth(e){this._depthStencilTexture&&(e._depthStencilTexture&&e._depthStencilTexture.dispose(),e._depthStencilTexture=this._depthStencilTexture,e._depthStencilTextureWithStencil=this._depthStencilTextureWithStencil,this._depthStencilTexture.incrementReferences())}_swapAndDie(e){this.texture&&this.texture._swapAndDie(e),this._textures=null,this.dispose(!0)}_cloneRenderTargetWrapper(){let e=null;if(this._isMulti){let t=this.textures;if(t&&t.length>0){let r=!1,i=t.length,n=-1,s=t[t.length-1]._source;(14===s||12===s)&&(r=!0,n=t[t.length-1].format,i--);let a=[],l=[],u=[],h=[],o=[],_=[],c=[],E={};for(let e=0;e<i;++e){let r=t[e];a.push(r.samplingMode),l.push(r.type),u.push(r.format),void 0!==E[r.uniqueId]?(h.push(-1),c.push(0)):(E[r.uniqueId]=e,r.is2DArray?(h.push(35866),c.push(r.depth)):r.isCube?(h.push(34067),c.push(0)):r.is3D?(h.push(32879),c.push(r.depth)):(h.push(3553),c.push(0))),this._faceIndices&&o.push(this._faceIndices[e]??0),this._layerIndices&&_.push(this._layerIndices[e]??0)}let T={samplingModes:a,generateMipMaps:t[0].generateMipMaps,generateDepthBuffer:this._generateDepthBuffer,generateStencilBuffer:this._generateStencilBuffer,generateDepthTexture:r,depthTextureFormat:n,types:l,formats:u,textureCount:i,targetTypes:h,faceIndex:o,layerIndex:_,layerCounts:c,label:this.label},f={width:this.width,height:this.height,depth:this.depth};e=this._engine.createMultipleRenderTarget(f,T);for(let r=0;r<i;++r){if(-1!==h[r])continue;let i=E[t[r].uniqueId];e.setTexture(e.textures[i],r)}}}else{let t={};if(t.generateDepthBuffer=this._generateDepthBuffer,t.generateMipMaps=this.texture?.generateMipMaps??!1,t.generateStencilBuffer=this._generateStencilBuffer,t.samplingMode=this.texture?.samplingMode,t.type=this.texture?.type,t.format=this.texture?.format,t.noColorAttachment=!this._textures,t.label=this.label,this.isCube)e=this._engine.createRenderTargetCubeTexture(this.width,t);else{let r={width:this.width,height:this.height,layers:this.is2DArray||this.is3D?this.texture?.depth:void 0};e=this._engine.createRenderTargetTexture(r,t)}e.texture&&(e.texture.isReady=!0)}return e}_swapRenderTargetWrapper(e){if(this._textures&&e._textures)for(let t=0;t<this._textures.length;++t)this._textures[t]._swapAndDie(e._textures[t],!1),e._textures[t].isReady=!0;this._depthStencilTexture&&e._depthStencilTexture&&(this._depthStencilTexture._swapAndDie(e._depthStencilTexture),e._depthStencilTexture.isReady=!0),this._textures=null,this._depthStencilTexture=null}_rebuild(){let e=this._cloneRenderTargetWrapper();if(e){if(this._depthStencilTexture){let t=this._depthStencilTexture.samplingMode,r=this._depthStencilTexture.format;e.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction,2===t||3===t||11===t,this._depthStencilTextureWithStencil,this._depthStencilTexture.samples,r,this._depthStencilTextureLabel)}this.samples>1&&e.setSamples(this.samples),e._swapRenderTargetWrapper(this),e.dispose()}}releaseTextures(){if(this._textures)for(let e=0;e<this._textures.length;++e)this._textures[e].dispose();this._textures=null}dispose(e=!1){e||(this._depthStencilTexture?.dispose(),this._depthStencilTexture=null,this.releaseTextures()),this._engine._releaseRenderTargetWrapper(this)}}class M extends x{setDepthStencilTexture(e,t=!0){if(super.setDepthStencilTexture(e,t),!e)return;let r=this._engine,i=this._context,n=e._hardwareTexture;if(n&&e._autoMSAAManagement&&this._MSAAFramebuffer){let t=r._currentFramebuffer;r._bindUnboundFramebuffer(this._MSAAFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,(0,F.HasStencilAspect)(e.format)?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,i.RENDERBUFFER,n.getMSAARenderBuffer()),r._bindUnboundFramebuffer(t)}}constructor(e,t,r,i,n){super(e,t,r,i),this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._disposeOnlyFramebuffers=!1,this._currentLOD=0,this._context=n}_cloneRenderTargetWrapper(){let e;return this._colorTextureArray&&this._depthStencilTextureArray?(e=this._engine.createMultiviewRenderTargetTexture(this.width,this.height)).texture.isReady=!0:e=super._cloneRenderTargetWrapper(),e}_swapRenderTargetWrapper(e){super._swapRenderTargetWrapper(e),e._framebuffer=this._framebuffer,e._depthStencilBuffer=this._depthStencilBuffer,e._MSAAFramebuffer=this._MSAAFramebuffer,e._colorTextureArray=this._colorTextureArray,e._depthStencilTextureArray=this._depthStencilTextureArray,this._framebuffer=this._depthStencilBuffer=this._MSAAFramebuffer=this._colorTextureArray=this._depthStencilTextureArray=null}createDepthStencilTexture(e=0,t=!0,r=!1,i=1,n=14,s){if(this._depthStencilBuffer){let e=this._engine,t=e._currentFramebuffer,r=this._context;e._bindUnboundFramebuffer(this._framebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,null),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,null),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.STENCIL_ATTACHMENT,r.RENDERBUFFER,null),e._bindUnboundFramebuffer(t),r.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null}return super.createDepthStencilTexture(e,t,r,i,n,s)}shareDepth(e){super.shareDepth(e);let t=this._context,r=this._depthStencilBuffer,i=e._MSAAFramebuffer||e._framebuffer,n=this._engine;e._depthStencilBuffer&&e._depthStencilBuffer!==r&&t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=r;let s=e._generateStencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;n._bindUnboundFramebuffer(i),t.framebufferRenderbuffer(t.FRAMEBUFFER,s,t.RENDERBUFFER,r),n._bindUnboundFramebuffer(null)}_bindTextureRenderTarget(e,t=0,r,i=0){let n,s=e._hardwareTexture;if(!s)return;let a=this._framebuffer,l=this._engine,u=l._currentFramebuffer;if(l._bindUnboundFramebuffer(a),l.webGLVersion>1){let a=this._context;n=a["COLOR_ATTACHMENT"+t],e.is2DArray||e.is3D?(r=r??this.layerIndices?.[t]??0,a.framebufferTextureLayer(a.FRAMEBUFFER,n,s.underlyingResource,i,r)):e.isCube?(r=r??this.faceIndices?.[t]??0,a.framebufferTexture2D(a.FRAMEBUFFER,n,a.TEXTURE_CUBE_MAP_POSITIVE_X+r,s.underlyingResource,i)):a.framebufferTexture2D(a.FRAMEBUFFER,n,a.TEXTURE_2D,s.underlyingResource,i)}else{let e=this._context;n=e["COLOR_ATTACHMENT"+t+"_WEBGL"];let a=void 0!==r?e.TEXTURE_CUBE_MAP_POSITIVE_X+r:e.TEXTURE_2D;e.framebufferTexture2D(e.FRAMEBUFFER,n,a,s.underlyingResource,i)}if(e._autoMSAAManagement&&this._MSAAFramebuffer){let e=this._context;l._bindUnboundFramebuffer(this._MSAAFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,s.getMSAARenderBuffer())}l._bindUnboundFramebuffer(u)}setTexture(e,t=0,r=!0){super.setTexture(e,t,r),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){if(super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;let r=this._attachments?.length??this.textures.length;for(let e=0;e<r;e++){let t=this.textures[e];t&&(t.is2DArray||t.is3D?this._bindTextureRenderTarget(t,e,this.layerIndices[e]):t.isCube?this._bindTextureRenderTarget(t,e,this.faceIndices[e]):this._bindTextureRenderTarget(t,e))}}setLayerAndFaceIndex(e=0,t,r){if(super.setLayerAndFaceIndex(e,t,r),!this.textures||!this.layerIndices||!this.faceIndices)return;let i=this.textures[e];i.is2DArray||i.is3D?this._bindTextureRenderTarget(this.textures[e],e,this.layerIndices[e]):i.isCube&&this._bindTextureRenderTarget(this.textures[e],e,this.faceIndices[e])}resolveMSAATextures(){let e=this._engine,t=e._currentFramebuffer;e._bindUnboundFramebuffer(this._MSAAFramebuffer),super.resolveMSAATextures(),e._bindUnboundFramebuffer(t)}dispose(e=this._disposeOnlyFramebuffers){let t=this._context;!e&&(this._colorTextureArray&&(this._context.deleteTexture(this._colorTextureArray),this._colorTextureArray=null),this._depthStencilTextureArray&&(this._context.deleteTexture(this._depthStencilTextureArray),this._depthStencilTextureArray=null)),this._framebuffer&&(t.deleteFramebuffer(this._framebuffer),this._framebuffer=null),this._depthStencilBuffer&&(t.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null),this._MSAAFramebuffer&&(t.deleteFramebuffer(this._MSAAFramebuffer),this._MSAAFramebuffer=null),super.dispose(e)}}let U=!1;U=!0,c.ThinEngine.prototype._createHardwareRenderTargetWrapper=function(e,t,r){let i=new M(e,t,r,this,this._gl);return this._renderTargetWrapperCache.push(i),i},c.ThinEngine.prototype.createRenderTargetTexture=function(e,t){let r,i,n=this._createHardwareRenderTargetWrapper(!1,!1,e),s=!0,a=!1,l=!1,u=1;void 0!==t&&"object"==typeof t&&(s=t.generateDepthBuffer??!0,a=!!t.generateStencilBuffer,l=!!t.noColorAttachment,r=t.colorAttachment,u=t.samples??1,i=t.label);let h=r||(l?null:this._createInternalTexture(e,t,!0,5)),o=e.width||e,_=e.height||e,c=this._currentFramebuffer,E=this._gl,T=E.createFramebuffer();if(this._bindUnboundFramebuffer(T),n._depthStencilBuffer=this._setupFramebufferDepthAttachments(a,s,o,_),!h||h.is2DArray||h.is3D||E.framebufferTexture2D(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.TEXTURE_2D,h._hardwareTexture.underlyingResource,0),this._bindUnboundFramebuffer(c),n.label=i??"RenderTargetWrapper",n._framebuffer=T,n._generateDepthBuffer=s,n._generateStencilBuffer=a,n.setTextures(h),r){if(n._samples=r.samples,r.samples>1){let e=r._hardwareTexture.getMSAARenderBuffer(0);n._MSAAFramebuffer=E.createFramebuffer(),this._bindUnboundFramebuffer(n._MSAAFramebuffer),E.framebufferRenderbuffer(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.RENDERBUFFER,e),this._bindUnboundFramebuffer(null)}}else this.updateRenderTargetTextureSampleCount(n,u);return n},c.ThinEngine.prototype._createDepthStencilTexture=function(e,t,r){let i=this._gl,n=e.layers||0,s=e.depth||0,a=i.TEXTURE_2D;0!==n?a=i.TEXTURE_2D_ARRAY:0!==s&&(a=i.TEXTURE_3D);let l=new T.InternalTexture(this,12);if(l.label=t.label,!this._caps.depthTextureExtension)return f.Logger.Error("Depth texture is not supported by your browser or hardware."),l;let u={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...t};if(this._bindTextureDirectly(a,l,!0),this._setupDepthStencilTexture(l,e,0!==u.comparisonFunction&&u.bilinearFiltering,u.comparisonFunction,u.samples),void 0!==u.depthTextureFormat){if(15!==u.depthTextureFormat&&16!==u.depthTextureFormat&&17!==u.depthTextureFormat&&13!==u.depthTextureFormat&&14!==u.depthTextureFormat&&18!==u.depthTextureFormat)return f.Logger.Error(`Depth texture ${u.depthTextureFormat} format is not supported.`),l;l.format=u.depthTextureFormat}else l.format=u.generateStencil?13:16;let h=(0,F.HasStencilAspect)(l.format),o=this._getWebGLTextureTypeFromDepthTextureFormat(l.format),_=h?i.DEPTH_STENCIL:i.DEPTH_COMPONENT,c=this._getInternalFormatFromDepthTextureFormat(l.format,!0,h);return l.is2DArray?i.texImage3D(a,0,c,l.width,l.height,n,0,_,o,null):l.is3D?i.texImage3D(a,0,c,l.width,l.height,s,0,_,o,null):i.texImage2D(a,0,c,l.width,l.height,0,_,o,null),this._bindTextureDirectly(a,null),this._internalTexturesCache.push(l),r._depthStencilBuffer&&(i.deleteRenderbuffer(r._depthStencilBuffer),r._depthStencilBuffer=null),this._bindUnboundFramebuffer(r._MSAAFramebuffer??r._framebuffer),r._generateStencilBuffer=h,r._depthStencilTextureWithStencil=h,r._depthStencilBuffer=this._setupFramebufferDepthAttachments(r._generateStencilBuffer,r._generateDepthBuffer,r.width,r.height,r.samples,l.format),this._bindUnboundFramebuffer(null),l},c.ThinEngine.prototype.updateRenderTargetTextureSampleCount=function(e,t){if(this.webGLVersion<2||!e)return 1;if(e.samples===t)return t;let r=this._gl;t=Math.min(t,this.getCaps().maxMSAASamples),e._depthStencilBuffer&&(r.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=null),e._MSAAFramebuffer&&(r.deleteFramebuffer(e._MSAAFramebuffer),e._MSAAFramebuffer=null);let i=e.texture?._hardwareTexture;if(i?.releaseMSAARenderBuffers(),e.texture&&t>1&&"function"==typeof r.renderbufferStorageMultisample){let n=r.createFramebuffer();if(!n)throw Error("Unable to create multi sampled framebuffer");e._MSAAFramebuffer=n,this._bindUnboundFramebuffer(e._MSAAFramebuffer);let s=this._createRenderBuffer(e.texture.width,e.texture.height,t,-1,this._getRGBABufferInternalSizedFormat(e.texture.type,e.texture.format,e.texture._useSRGBBuffer),r.COLOR_ATTACHMENT0,!1);if(!s)throw Error("Unable to create multi sampled framebuffer");i?.addMSAARenderBuffer(s)}this._bindUnboundFramebuffer(e._MSAAFramebuffer??e._framebuffer),e.texture&&(e.texture.samples=t),e._samples=t;let n=e._depthStencilTexture?e._depthStencilTexture.format:void 0;return e._depthStencilBuffer=this._setupFramebufferDepthAttachments(e._generateStencilBuffer,e._generateDepthBuffer,e.width,e.height,t,n),this._bindUnboundFramebuffer(null),t},c.ThinEngine.prototype._setupDepthStencilTexture=function(e,t,r,i,n=1){let s=t.width??t,a=t.height??t,l=t.layers||0,u=t.depth||0;e.baseWidth=s,e.baseHeight=a,e.width=s,e.height=a,e.is2DArray=l>0,e.depth=l||u,e.isReady=!0,e.samples=n,e.generateMipMaps=!1,e.samplingMode=r?2:1,e.type=0,e._comparisonFunction=i;let h=this._gl,o=this._getTextureTarget(e),_=this._getSamplingParameters(e.samplingMode,!1);h.texParameteri(o,h.TEXTURE_MAG_FILTER,_.mag),h.texParameteri(o,h.TEXTURE_MIN_FILTER,_.min),h.texParameteri(o,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(o,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),this.webGLVersion>1&&(0===i?(h.texParameteri(o,h.TEXTURE_COMPARE_FUNC,515),h.texParameteri(o,h.TEXTURE_COMPARE_MODE,h.NONE)):(h.texParameteri(o,h.TEXTURE_COMPARE_FUNC,i),h.texParameteri(o,h.TEXTURE_COMPARE_MODE,h.COMPARE_REF_TO_TEXTURE)))};let D=!1;D=!0,c.ThinEngine.prototype.setDepthStencilTexture=function(e,t,r,i){void 0!==e&&(t&&(this._boundUniforms[e]=t),r&&r.depthStencilTexture?this._setTexture(e,r,!1,!0,i):this._setTexture(e,null,void 0,void 0,i))};let P=!1;P=!0,c.ThinEngine.prototype.createRenderTargetCubeTexture=function(e,t){let r=this._createHardwareRenderTargetWrapper(!1,!0,e),i={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...t};i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,(1!==i.type||this._caps.textureFloatLinearFiltering)&&(2!==i.type||this._caps.textureHalfFloatLinearFiltering)||(i.samplingMode=1);let n=this._gl,s=new T.InternalTexture(this,5);this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,s,!0);let a=this._getSamplingParameters(i.samplingMode,i.generateMipMaps);1!==i.type||this._caps.textureFloat||(i.type=0,f.Logger.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,a.mag),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,a.min),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);for(let t=0;t<6;t++)n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,this._getRGBABufferInternalSizedFormat(i.type,i.format),e,e,0,this._getInternalFormat(i.format),this._getWebGLTextureType(i.type),null);let l=n.createFramebuffer();return this._bindUnboundFramebuffer(l),r._depthStencilBuffer=this._setupFramebufferDepthAttachments(i.generateStencilBuffer,i.generateDepthBuffer,e,e),i.generateMipMaps&&n.generateMipmap(n.TEXTURE_CUBE_MAP),this._bindTextureDirectly(n.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),r._framebuffer=l,r._generateDepthBuffer=i.generateDepthBuffer,r._generateStencilBuffer=i.generateStencilBuffer,s.width=e,s.height=e,s.isReady=!0,s.isCube=!0,s.samples=1,s.generateMipMaps=i.generateMipMaps,s.samplingMode=i.samplingMode,s.type=i.type,s.format=i.format,this._internalTexturesCache.push(s),r.setTextures(s),r};var y=e.i(89991),C=e.i(88048);let B=!1;B=!0,c.ThinEngine.prototype.createPrefilteredCubeTexture=function(t,r,i,n,s=null,a=null,l,u=null,h=!0){let o=async t=>{if(!t){s&&s(null);return}let a=t.texture;if(h?t.info.sphericalPolynomial&&(a._sphericalPolynomial=t.info.sphericalPolynomial):a._sphericalPolynomial=a._sphericalPolynomial??new y.SphericalPolynomial,a._source=9,this.getCaps().textureLOD){s&&s(a);return}let l=this._gl,u=t.width;if(!u)return;let{DDSTools:o}=await e.A(25906),_=[];for(let e=0;e<3;e++){let s=Math.log2(u)*i+n,h=Math.round(Math.min(Math.max(n+(s-n)*(1-e/2),0),s)),c=new T.InternalTexture(this,2);if(c.type=a.type,c.format=a.format,c.width=Math.pow(2,Math.max(Math.log2(u)-h,0)),c.height=c.width,c.isCube=!0,c._cachedWrapU=0,c._cachedWrapV=0,this._bindTextureDirectly(l.TEXTURE_CUBE_MAP,c,!0),c.samplingMode=2,l.texParameteri(l.TEXTURE_CUBE_MAP,l.TEXTURE_MAG_FILTER,l.LINEAR),l.texParameteri(l.TEXTURE_CUBE_MAP,l.TEXTURE_MIN_FILTER,l.LINEAR),l.texParameteri(l.TEXTURE_CUBE_MAP,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_CUBE_MAP,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),t.isDDS){let e=t.info,r=t.data;this._unpackFlipY(e.isCompressed),o.UploadDDSLevels(this,c,r,e,!0,6,h)}else f.Logger.Warn("DDS is the only prefiltered cube map supported so far.");this._bindTextureDirectly(l.TEXTURE_CUBE_MAP,null);let E=new C.BaseTexture(r);E._isCube=!0,E._texture=c,c.isReady=!0,_.push(E)}a._lodTextureHigh=_[2],a._lodTextureMid=_[1],a._lodTextureLow=_[0],s&&s(a)};return this.createCubeTexture(t,r,null,!1,o,a,l,u,h,i,n)};var I=e.i(28636);let L=!1;L=!0,c.ThinEngine.prototype.createUniformBuffer=function(e,t){let r=this._gl.createBuffer();if(!r)throw Error("Unable to create uniform buffer");let i=new I.WebGLDataBuffer(r);return this.bindUniformBuffer(i),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},c.ThinEngine.prototype.createDynamicUniformBuffer=function(e,t){let r=this._gl.createBuffer();if(!r)throw Error("Unable to create dynamic uniform buffer");let i=new I.WebGLDataBuffer(r);return this.bindUniformBuffer(i),e instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,e,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(e),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},c.ThinEngine.prototype.updateUniformBuffer=function(e,t,r,i){this.bindUniformBuffer(e),void 0===r&&(r=0),void 0===i?t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,r,t):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,r,new Float32Array(t)):t instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,t.subarray(r,r+i)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(t).subarray(r,r+i)),this.bindUniformBuffer(null)},c.ThinEngine.prototype.bindUniformBuffer=function(e){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,e?e.underlyingResource:null)},c.ThinEngine.prototype.bindUniformBufferBase=function(e,t,r){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,t,e?e.underlyingResource:null)},c.ThinEngine.prototype.bindUniformBlock=function(e,t,r){let i=e.program,n=this._gl.getUniformBlockIndex(i,t);0xffffffff!==n&&this._gl.uniformBlockBinding(i,n,r)};var O=e.i(55018),X=e.i(32622);let N=!1;N=!0,X.AbstractEngine.prototype.displayLoadingUI=function(){if(!(0,O.IsWindowObjectExist)())return;let e=this.loadingScreen;e&&e.displayLoadingUI()},X.AbstractEngine.prototype.hideLoadingUI=function(){if(!(0,O.IsWindowObjectExist)())return;let e=this._loadingScreen;e&&e.hideLoadingUI()},Object.defineProperty(X.AbstractEngine.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=X.AbstractEngine.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(e){this._loadingScreen=e},enumerable:!0,configurable:!0}),Object.defineProperty(X.AbstractEngine.prototype,"loadingUIText",{set:function(e){this.loadingScreen.loadingUIText=e},enumerable:!0,configurable:!0}),Object.defineProperty(X.AbstractEngine.prototype,"loadingUIBackgroundColor",{set:function(e){this.loadingScreen.loadingUIBackgroundColor=e},enumerable:!0,configurable:!0});let w=!1;function v(){w||(w=!0,X.AbstractEngine.prototype.getInputElement=function(){return this._renderingCanvas},X.AbstractEngine.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},X.AbstractEngine.prototype.getInputElementClientRect=function(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null},X.AbstractEngine.prototype.getAspectRatio=function(e,t=!1){let r=e.viewport;return this.getRenderWidth(t)*r.width/(this.getRenderHeight(t)*r.height)},X.AbstractEngine.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)},X.AbstractEngine.prototype._verifyPointerLock=function(){this._onPointerLockChange?.()})}v();let G=!1;G=!0,X.AbstractEngine.prototype.getInputElement=function(){return this._renderingCanvas},X.AbstractEngine.prototype.getDepthFunction=function(){return this._depthCullingState.depthFunc},X.AbstractEngine.prototype.setDepthFunction=function(e){this._depthCullingState.depthFunc=e},X.AbstractEngine.prototype.setDepthFunctionToGreater=function(){this.setDepthFunction(516)},X.AbstractEngine.prototype.setDepthFunctionToGreaterOrEqual=function(){this.setDepthFunction(518)},X.AbstractEngine.prototype.setDepthFunctionToLess=function(){this.setDepthFunction(513)},X.AbstractEngine.prototype.setDepthFunctionToLessOrEqual=function(){this.setDepthFunction(515)},X.AbstractEngine.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask},X.AbstractEngine.prototype.setDepthWrite=function(e){this._depthCullingState.depthMask=e},X.AbstractEngine.prototype.setAlphaConstants=function(e,t,r,i){this._alphaState.setAlphaBlendConstants(e,t,r,i)},X.AbstractEngine.prototype.getAlphaMode=function(e=0){return this._alphaMode[e]},X.AbstractEngine.prototype.getAlphaEquation=function(e=0){return this._alphaEquation[e]};let k=!1;k=!0,X.AbstractEngine.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest},X.AbstractEngine.prototype.setStencilBuffer=function(e){this._stencilState.stencilTest=e},X.AbstractEngine.prototype.getStencilMask=function(){return this._stencilState.stencilMask},X.AbstractEngine.prototype.setStencilMask=function(e){this._stencilState.stencilMask=e},X.AbstractEngine.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc},X.AbstractEngine.prototype.getStencilBackFunction=function(){return this._stencilState.stencilBackFunc},X.AbstractEngine.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef},X.AbstractEngine.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask},X.AbstractEngine.prototype.setStencilFunction=function(e){this._stencilState.stencilFunc=e},X.AbstractEngine.prototype.setStencilBackFunction=function(e){this._stencilState.stencilBackFunc=e},X.AbstractEngine.prototype.setStencilFunctionReference=function(e){this._stencilState.stencilFuncRef=e},X.AbstractEngine.prototype.setStencilFunctionMask=function(e){this._stencilState.stencilFuncMask=e},X.AbstractEngine.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail},X.AbstractEngine.prototype.getStencilBackOperationFail=function(){return this._stencilState.stencilBackOpStencilFail},X.AbstractEngine.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail},X.AbstractEngine.prototype.getStencilBackOperationDepthFail=function(){return this._stencilState.stencilBackOpDepthFail},X.AbstractEngine.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass},X.AbstractEngine.prototype.getStencilBackOperationPass=function(){return this._stencilState.stencilBackOpStencilDepthPass},X.AbstractEngine.prototype.setStencilOperationFail=function(e){this._stencilState.stencilOpStencilFail=e},X.AbstractEngine.prototype.setStencilBackOperationFail=function(e){this._stencilState.stencilBackOpStencilFail=e},X.AbstractEngine.prototype.setStencilOperationDepthFail=function(e){this._stencilState.stencilOpDepthFail=e},X.AbstractEngine.prototype.setStencilBackOperationDepthFail=function(e){this._stencilState.stencilBackOpDepthFail=e},X.AbstractEngine.prototype.setStencilOperationPass=function(e){this._stencilState.stencilOpStencilDepthPass=e},X.AbstractEngine.prototype.setStencilBackOperationPass=function(e){this._stencilState.stencilBackOpStencilDepthPass=e},X.AbstractEngine.prototype.cacheStencilState=function(){this._cachedStencilBuffer=this.getStencilBuffer(),this._cachedStencilFunction=this.getStencilFunction(),this._cachedStencilMask=this.getStencilMask(),this._cachedStencilOperationPass=this.getStencilOperationPass(),this._cachedStencilOperationFail=this.getStencilOperationFail(),this._cachedStencilOperationDepthFail=this.getStencilOperationDepthFail(),this._cachedStencilReference=this.getStencilFunctionReference()},X.AbstractEngine.prototype.restoreStencilState=function(){this.setStencilFunction(this._cachedStencilFunction),this.setStencilMask(this._cachedStencilMask),this.setStencilBuffer(this._cachedStencilBuffer),this.setStencilOperationPass(this._cachedStencilOperationPass),this.setStencilOperationFail(this._cachedStencilOperationFail),this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail),this.setStencilFunctionReference(this._cachedStencilReference)};var W=e.i(11771);(0,W.RegisterAbstractEngineRenderPass)();let H=!1;H=!0,X.AbstractEngine.prototype.createDepthStencilTexture=function(e,t,r){if(!t.isCube)return this._createDepthStencilTexture(e,t,r);{let r=e.width||e;return this._createDepthStencilCubeTexture(r,t)}};let Y=!1;Y=!0,X.AbstractEngine.prototype._loadFileAsync=async function(e,t,r){return await new Promise((i,n)=>{this._loadFile(e,e=>{i(e)},void 0,t,r,(e,t)=>{n(t)})})};var V=e.i(58812);X.AbstractEngine.GetCompatibleTextureLoader=V._GetCompatibleTextureLoader;let z=!1;z=!0,c.ThinEngine.prototype.enableScissor=function(e,t,r,i){let n=this._gl;n.enable(n.SCISSOR_TEST),n.scissor(e,t,r,i)},c.ThinEngine.prototype.disableScissor=function(){let e=this._gl;e.disable(e.SCISSOR_TEST)},e.s([],850),e.i(850);var q=e.i(70855),K=c,j=e.i(87869);class Q{constructor(e=30){this._enabled=!0,this._rollingFrameTime=new Z(e)}sampleFrame(e=j.PrecisionDate.Now){if(this._enabled){if(null!=this._lastFrameTimeMs){let t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}}get averageFrameTime(){return this._rollingFrameTime.average}get averageFrameTimeVariance(){return this._rollingFrameTime.variance}get instantaneousFrameTime(){return this._rollingFrameTime.history(0)}get averageFPS(){return 1e3/this._rollingFrameTime.average}get instantaneousFPS(){let e=this._rollingFrameTime.history(0);return 0===e?0:1e3/e}get isSaturated(){return this._rollingFrameTime.isSaturated()}enable(){this._enabled=!0}disable(){this._enabled=!1,this._lastFrameTimeMs=null}get isEnabled(){return this._enabled}reset(){this._lastFrameTimeMs=null,this._rollingFrameTime.reset()}}class Z{constructor(e){this._samples=Array(e),this.reset()}add(e){let t;if(this.isSaturated()){let e=this._samples[this._pos];t=e-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(e-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length}history(e){if(e>=this._sampleCount||e>=this._samples.length)return 0;let t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]}isSaturated(){return this._sampleCount>=this._samples.length}reset(){this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0}_wrapPosition(e){let t=this._samples.length;return(e%t+t)%t}}var $=e.i(63613);function J(e){return Number.isFinite(e.ascent)&&Number.isFinite(e.height)&&Number.isFinite(e.descent)&&e.height>0}async function ee(e,t,r){return await new Promise((i,n)=>{let s=new Image;s.onload=()=>{s.decode().then(()=>{e.createImageBitmap(s,r).then(e=>{i(e)})})},s.onerror=()=>{n(`Error loading image ${s.src}`)},s.src=t})}function et(e){if(e.requestPointerLock){let t=e.requestPointerLock();t instanceof Promise?t.then(()=>{e.focus()}).catch(()=>{}):e.focus()}}var er=e.i(63217),ei=e.i(49097),en=e.i(33945);class es extends K.ThinEngine{static get NpmPackage(){return X.AbstractEngine.NpmPackage}static get Version(){return X.AbstractEngine.Version}static get Instances(){return q.EngineStore.Instances}static get LastCreatedEngine(){return q.EngineStore.LastCreatedEngine}static get LastCreatedScene(){return q.EngineStore.LastCreatedScene}static DefaultLoadingScreenFactory(e){return X.AbstractEngine.DefaultLoadingScreenFactory(e)}get _supportsHardwareTextureRescaling(){return!!es._RescalePostProcessFactory}_measureFps(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}get performanceMonitor(){return this._performanceMonitor}constructor(e,t,r,i=!1){if(v(),(0,W.RegisterAbstractEngineRenderPass)(),super(e,t,r,i),this._performanceMonitor=new Q,this._drawCalls=new er.PerfCounter,!e)return;this._features.supportRenderPasses=!0}_initGLContext(){super._initGLContext(),this._rescalePostProcess=null}_sharedInit(e){var t,r;let i;super._sharedInit(e),t=this,r=this._creationOptions,t._onCanvasFocus=()=>{t.onCanvasFocusObservable.notifyObservers(t)},t._onCanvasBlur=()=>{t.onCanvasBlurObservable.notifyObservers(t)},t._onCanvasContextMenu=e=>{t.disableContextMenu&&e.preventDefault()},e.addEventListener("focus",t._onCanvasFocus),e.addEventListener("blur",t._onCanvasBlur),e.addEventListener("contextmenu",t._onCanvasContextMenu),t._onBlur=()=>{t.disablePerformanceMonitorInBackground&&t.performanceMonitor.disable(),t._windowIsBackground=!0},t._onFocus=()=>{t.disablePerformanceMonitorInBackground&&t.performanceMonitor.enable(),t._windowIsBackground=!1},t._onCanvasPointerOut=r=>{document.elementFromPoint(r.clientX,r.clientY)!==e&&t.onCanvasPointerOutObservable.notifyObservers(r)},(i=t.getHostWindow())&&"function"==typeof i.addEventListener&&(i.addEventListener("blur",t._onBlur),i.addEventListener("focus",t._onFocus)),e.addEventListener("pointerout",t._onCanvasPointerOut),!r.doNotHandleTouchAction&&e&&e.setAttribute&&(e.setAttribute("touch-action","none"),e.style.touchAction="none",e.style.webkitTapHighlightColor="transparent"),!X.AbstractEngine.audioEngine&&r.audioEngine&&X.AbstractEngine.AudioEngineFactory&&(X.AbstractEngine.audioEngine=X.AbstractEngine.AudioEngineFactory(t.getRenderingCanvas(),t.getAudioContext(),t.getAudioDestination())),(0,O.IsDocumentAvailable)()&&(t._onFullscreenChange=()=>{t.isFullscreen=!!document.fullscreenElement,t.isFullscreen&&t._pointerLockRequested&&e&&et(e)},document.addEventListener("fullscreenchange",t._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",t._onFullscreenChange,!1),t._onPointerLockChange=()=>{t.isPointerLock=document.pointerLockElement===e},document.addEventListener("pointerlockchange",t._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",t._onPointerLockChange,!1)),t.enableOfflineSupport=void 0!==X.AbstractEngine.OfflineProviderFactory,t._deterministicLockstep=!!r.deterministicLockstep,t._lockstepMaxSteps=r.lockstepMaxSteps||0,t._timeStep=r.timeStep||1/60}resizeImageBitmap(e,t,r){let i=this.createCanvas(t,r).getContext("2d");if(!i)throw Error("Unable to get 2d context for resizeImageBitmap");return i.drawImage(e,0,0),i.getImageData(0,0,t,r).data}async _createImageBitmapFromSource(e,t){return await ee(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){if(!this.isFullscreen){var t;let r;this._pointerLockRequested=e,this._renderingCanvas&&(r=(t=this._renderingCanvas).requestFullscreen||t.webkitRequestFullscreen)&&r.call(t)}}exitFullscreen(){let e;this.isFullscreen&&(e=document,document.exitFullscreen?document.exitFullscreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen())}setDitheringState(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)}setRasterizerState(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)}setDirectViewport(e,t,r,i){let n=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,r,i),n}scissorClear(e,t,r,i,n){this.enableScissor(e,t,r,i),this.clear(n,!0,!0,!0),this.disableScissor()}getVertexShaderSource(e){let t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null}getFragmentShaderSource(e){let t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e,this._framebufferDimensionsObject&&this.onResizeObservable.notifyObservers(this)}_rebuildBuffers(){for(let e of this.scenes)e.resetCachedMaterial(),e._rebuildGeometries();for(let e of this._virtualScenes)e.resetCachedMaterial(),e._rebuildGeometries();super._rebuildBuffers()}getFontOffset(e){var t;let r,i,n,s,a=function(e){let t,r;if(!(0,O.IsDocumentAvailable)()||!document.body)return null;let i=document.createElement("span");i.textContent="Hg",i.style.font=e;let n=document.createElement("div");n.style.display="inline-block",n.style.width="1px",n.style.height="0px",n.style.verticalAlign="bottom";let s=document.createElement("div");s.style.whiteSpace="nowrap",s.appendChild(i),s.appendChild(n),document.body.appendChild(s);try{r=n.getBoundingClientRect().top-i.getBoundingClientRect().top,n.style.verticalAlign="baseline",t=n.getBoundingClientRect().top-i.getBoundingClientRect().top}finally{document.body.removeChild(s)}let a={ascent:t,height:r,descent:r-t};return J(a)?a:null}(e);if(a)return a;let l=function(e){let t=null;try{"u">typeof OffscreenCanvas?t=new OffscreenCanvas(64,64):(0,O.IsDocumentAvailable)()&&"function"==typeof document.createElement&&((t=document.createElement("canvas")).width=64,t.height=64);let r=t?.getContext("2d");if(!r)return null;r.font=e;let i=r.measureText("Hg"),n=Number(i.actualBoundingBoxAscent??i.fontBoundingBoxAscent),s=Number(i.actualBoundingBoxDescent??i.fontBoundingBoxDescent),a={ascent:n,height:n+s,descent:s};return J(a)?a:null}catch{return null}finally{let e=t;"function"==typeof e?.dispose&&e.dispose()}}(e);return l||(n=.8*(i=Math.max(1,(t=e,(r=/(?:^|\s)([0-9]+(?:\.[0-9]+)?)px(?:\/|\s|$)/.exec(String(t||"")))?Number(r[1]):16))),{ascent:n,height:n+(s=.2*i),descent:s})}enterPointerlock(){this._renderingCanvas&&et(this._renderingCanvas)}exitPointerlock(){document.exitPointerLock&&document.exitPointerLock()}beginFrame(){this._measureFps(),super.beginFrame()}_deletePipelineContext(e){e&&e.program&&e.transformFeedback&&(this.deleteTransformFeedback(e.transformFeedback),e.transformFeedback=null),super._deletePipelineContext(e)}createShaderProgram(e,t,r,i,n,s=null){n=n||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);let a=super.createShaderProgram(e,t,r,i,n,s);return this.onAfterShaderCompilationObservable.notifyObservers(this),a}_createShaderProgram(e,t,r,i,n=null){let s=i.createProgram();if(e.program=s,!s)throw Error("Unable to create program");if(i.attachShader(s,t),i.attachShader(s,r),this.webGLVersion>1&&n){let t=this.createTransformFeedback();this.bindTransformFeedback(t),this.setTranformFeedbackVaryings(s,n),e.transformFeedback=t}return i.linkProgram(s),this.webGLVersion>1&&n&&this.bindTransformFeedback(null),e.context=i,e.vertexShader=t,e.fragmentShader=r,e.isParallelCompiled||this._finalizePipelineContext(e),s}_releaseTexture(e){super._releaseTexture(e)}_releaseRenderTargetWrapper(e){for(let t of(super._releaseRenderTargetWrapper(e),this.scenes)){for(let r of t.postProcesses)r._outputTexture===e&&(r._outputTexture=null);for(let r of t.cameras)for(let t of r._postProcesses)t&&t._outputTexture===e&&(t._outputTexture=null)}}_rescaleTexture(e,t,r,i,n){this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);let s=this.createRenderTargetTexture({width:t.width,height:t.height},{generateMipMaps:!1,type:0,samplingMode:2,generateDepthBuffer:!1,generateStencilBuffer:!1});if(!this._rescalePostProcess&&es._RescalePostProcessFactory&&(this._rescalePostProcess=es._RescalePostProcessFactory(this)),this._rescalePostProcess){this._rescalePostProcess.externalTextureSamplerBinding=!0;let a=()=>{this._rescalePostProcess.onApply=function(t){t._bindTexture("textureSampler",e)};let a=r;a||(a=this.scenes[this.scenes.length-1]),a.postProcessManager.directRender([this._rescalePostProcess],s,!0),this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._gl.copyTexImage2D(this._gl.TEXTURE_2D,0,i,0,0,t.width,t.height,0),this.unBindFramebuffer(s),s.dispose(),n&&n()},l=this._rescalePostProcess.getEffect();l?l.executeWhenCompiled(a):this._rescalePostProcess.onEffectCreatedObservable.addOnce(e=>{e.executeWhenCompiled(a)})}}wrapWebGLTexture(e,t=!1,r=3,i=0,n=0){let s=new $.WebGLHardwareTexture(e,this._gl),a=new T.InternalTexture(this,15,!0);return a._hardwareTexture=s,a.baseWidth=i,a.baseHeight=n,a.width=i,a.height=n,a.isReady=!0,a.useMipMaps=t,this.updateTextureSamplingMode(r,a),a}updateWrappedWebGLTexture(e,t){if(15!==e.source)throw Error("updateWrappedWebGLTexture: target InternalTexture was not produced by wrapWebGLTexture.");for(let t of this._renderTargetWrapperCache)if(t.textures?.includes(e)){if(t.isMulti)throw Error("updateWrappedWebGLTexture: wrapped texture is part of a multi render-target; not supported. Dispose and re-wrap.");if(t._depthStencilTexture)throw Error("updateWrappedWebGLTexture: wrapped texture's render-target wrapper has a depth/stencil texture; not supported. Dispose and re-wrap.")}for(let r in e._hardwareTexture=new $.WebGLHardwareTexture(t,this._gl),e.isReady=!0,e._cachedCoordinatesMode=null,e._cachedWrapU=null,e._cachedWrapV=null,e._cachedWrapR=null,e._cachedAnisotropicFilteringLevel=null,this._boundTexturesCache)this._boundTexturesCache[r]===e&&(this._boundTexturesCache[r]=null);this.updateTextureSamplingMode(e.samplingMode,e);let r=this._gl;for(let i of this._renderTargetWrapperCache){if(i.texture!==e)continue;let n=i.samples,s=n>1;i._framebuffer&&r.deleteFramebuffer(i._framebuffer),!s&&i._depthStencilBuffer&&(r.deleteRenderbuffer(i._depthStencilBuffer),i._depthStencilBuffer=null);let a=this._currentFramebuffer,l=r.createFramebuffer();this._bindUnboundFramebuffer(l),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),s||(i._depthStencilBuffer=this._setupFramebufferDepthAttachments(i._generateStencilBuffer,i._generateDepthBuffer,i.width,i.height)),this._bindUnboundFramebuffer(a),i._framebuffer=l,s&&(i._samples=1,this.updateRenderTargetTextureSampleCount(i,n))}}_uploadImageToTexture(e,t,r=0,i=0){let n=this._gl,s=this._getWebGLTextureType(e.type),a=this._getInternalFormat(e.format),l=this._getRGBABufferInternalSizedFormat(e.type,a),u=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(u,e,!0),this._unpackFlipY(e.invertY);let h=n.TEXTURE_2D;e.isCube&&(h=n.TEXTURE_CUBE_MAP_POSITIVE_X+r),n.texImage2D(h,i,l,a,s,t),this._bindTextureDirectly(u,null,!0)}updateTextureComparisonFunction(e,t){if(1===this.webGLVersion)return void f.Logger.Error("WebGL 1 does not support texture comparison.");let r=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),0===t?(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,515),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_FUNC,t),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),0===t?(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,515),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.NONE)):(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_FUNC,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}createInstancesBuffer(e){let t=this._gl.createBuffer();if(!t)throw Error("Unable to create instance buffer");let r=new I.WebGLDataBuffer(t);return r.capacity=e,this.bindArrayBuffer(r),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),r.references=1,r}deleteInstancesBuffer(e){this._gl.deleteBuffer(e)}async _clientWaitAsync(e,t=0,r=10){let i=this._gl;return await new Promise((n,s)=>{(0,ei._RetryWithInterval)(()=>{let r=i.clientWaitSync(e,t,0);if(r==i.WAIT_FAILED)throw Error("clientWaitSync failed");return r!=i.TIMEOUT_EXPIRED},n,s,r)})}_readPixelsAsync(e,t,r,i,n,s,a){if(this._webGLVersion<2)throw Error("_readPixelsAsync only work on WebGL2+");let l=this._gl,u=l.createBuffer();l.bindBuffer(l.PIXEL_PACK_BUFFER,u),l.bufferData(l.PIXEL_PACK_BUFFER,a.byteLength,l.STREAM_READ),l.readPixels(e,t,r,i,n,s,0),l.bindBuffer(l.PIXEL_PACK_BUFFER,null);let h=l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE,0);return h?(l.flush(),this._clientWaitAsync(h,0,10).then(()=>(l.deleteSync(h),l.bindBuffer(l.PIXEL_PACK_BUFFER,u),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,a),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),l.deleteBuffer(u),a))):null}dispose(){var e;let t;this.hideLoadingUI(),this._rescalePostProcess&&this._rescalePostProcess.dispose(),e=this._renderingCanvas,1===q.EngineStore.Instances.length&&X.AbstractEngine.audioEngine&&(X.AbstractEngine.audioEngine.dispose(),X.AbstractEngine.audioEngine=null),(t=this.getHostWindow())&&"function"==typeof t.removeEventListener&&(t.removeEventListener("blur",this._onBlur),t.removeEventListener("focus",this._onFocus)),e&&(e.removeEventListener("focus",this._onCanvasFocus),e.removeEventListener("blur",this._onCanvasBlur),e.removeEventListener("pointerout",this._onCanvasPointerOut),e.removeEventListener("contextmenu",this._onCanvasContextMenu)),(0,O.IsDocumentAvailable)()&&(document.removeEventListener("fullscreenchange",this._onFullscreenChange),document.removeEventListener("mozfullscreenchange",this._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._onFullscreenChange),document.removeEventListener("msfullscreenchange",this._onFullscreenChange),document.removeEventListener("pointerlockchange",this._onPointerLockChange),document.removeEventListener("mspointerlockchange",this._onPointerLockChange),document.removeEventListener("mozpointerlockchange",this._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",this._onPointerLockChange)),super.dispose()}}es.ALPHA_DISABLE=0,es.ALPHA_ADD=1,es.ALPHA_COMBINE=2,es.ALPHA_SUBTRACT=3,es.ALPHA_MULTIPLY=4,es.ALPHA_MAXIMIZED=5,es.ALPHA_ONEONE=6,es.ALPHA_PREMULTIPLIED=7,es.ALPHA_PREMULTIPLIED_PORTERDUFF=8,es.ALPHA_INTERPOLATE=9,es.ALPHA_SCREENMODE=10,es.DELAYLOADSTATE_NONE=0,es.DELAYLOADSTATE_LOADED=1,es.DELAYLOADSTATE_LOADING=2,es.DELAYLOADSTATE_NOTLOADED=4,es.NEVER=512,es.ALWAYS=519,es.LESS=513,es.EQUAL=514,es.LEQUAL=515,es.GREATER=516,es.GEQUAL=518,es.NOTEQUAL=517,es.KEEP=7680,es.REPLACE=7681,es.INCR=7682,es.DECR=7683,es.INVERT=5386,es.INCR_WRAP=34055,es.DECR_WRAP=34056,es.TEXTURE_CLAMP_ADDRESSMODE=0,es.TEXTURE_WRAP_ADDRESSMODE=1,es.TEXTURE_MIRROR_ADDRESSMODE=2,es.TEXTUREFORMAT_ALPHA=0,es.TEXTUREFORMAT_LUMINANCE=1,es.TEXTUREFORMAT_LUMINANCE_ALPHA=2,es.TEXTUREFORMAT_RGB=4,es.TEXTUREFORMAT_RGBA=5,es.TEXTUREFORMAT_RED=6,es.TEXTUREFORMAT_R=6,es.TEXTUREFORMAT_R16_UNORM=33322,es.TEXTUREFORMAT_RG16_UNORM=33324,es.TEXTUREFORMAT_RGB16_UNORM=32852,es.TEXTUREFORMAT_RGBA16_UNORM=32859,es.TEXTUREFORMAT_R16_SNORM=36760,es.TEXTUREFORMAT_RG16_SNORM=36761,es.TEXTUREFORMAT_RGB16_SNORM=36762,es.TEXTUREFORMAT_RGBA16_SNORM=36763,es.TEXTUREFORMAT_RG=7,es.TEXTUREFORMAT_RED_INTEGER=8,es.TEXTUREFORMAT_R_INTEGER=8,es.TEXTUREFORMAT_RG_INTEGER=9,es.TEXTUREFORMAT_RGB_INTEGER=10,es.TEXTUREFORMAT_RGBA_INTEGER=11,es.TEXTURETYPE_UNSIGNED_BYTE=0,es.TEXTURETYPE_UNSIGNED_INT=0,es.TEXTURETYPE_FLOAT=1,es.TEXTURETYPE_HALF_FLOAT=2,es.TEXTURETYPE_BYTE=3,es.TEXTURETYPE_SHORT=4,es.TEXTURETYPE_UNSIGNED_SHORT=5,es.TEXTURETYPE_INT=6,es.TEXTURETYPE_UNSIGNED_INTEGER=7,es.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8,es.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9,es.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10,es.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11,es.TEXTURETYPE_UNSIGNED_INT_24_8=12,es.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13,es.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14,es.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15,es.TEXTURE_NEAREST_SAMPLINGMODE=1,es.TEXTURE_BILINEAR_SAMPLINGMODE=2,es.TEXTURE_TRILINEAR_SAMPLINGMODE=3,es.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8,es.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11,es.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3,es.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4,es.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5,es.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6,es.TEXTURE_NEAREST_LINEAR=7,es.TEXTURE_NEAREST_NEAREST=1,es.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9,es.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10,es.TEXTURE_LINEAR_LINEAR=2,es.TEXTURE_LINEAR_NEAREST=12,es.TEXTURE_EXPLICIT_MODE=0,es.TEXTURE_SPHERICAL_MODE=1,es.TEXTURE_PLANAR_MODE=2,es.TEXTURE_CUBIC_MODE=3,es.TEXTURE_PROJECTION_MODE=4,es.TEXTURE_SKYBOX_MODE=5,es.TEXTURE_INVCUBIC_MODE=6,es.TEXTURE_EQUIRECTANGULAR_MODE=7,es.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8,es.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,es.SCALEMODE_FLOOR=1,es.SCALEMODE_NEAREST=2,es.SCALEMODE_CEILING=3,(t=es.prototype).createMultiviewRenderTargetTexture??(t.createMultiviewRenderTargetTexture=(0,en._MissingSideEffect)("Engine","createMultiviewRenderTargetTexture")),(r=es.prototype).bindMultiviewFramebuffer??(r.bindMultiviewFramebuffer=(0,en._MissingSideEffect)("Engine","bindMultiviewFramebuffer")),(i=es.prototype).bindSpaceWarpFramebuffer??(i.bindSpaceWarpFramebuffer=(0,en._MissingSideEffect)("Engine","bindSpaceWarpFramebuffer")),(n=es.prototype).createTransformFeedback??(n.createTransformFeedback=(0,en._MissingSideEffect)("Engine","createTransformFeedback")),(s=es.prototype).deleteTransformFeedback??(s.deleteTransformFeedback=(0,en._MissingSideEffect)("Engine","deleteTransformFeedback")),(a=es.prototype).bindTransformFeedback??(a.bindTransformFeedback=(0,en._MissingSideEffect)("Engine","bindTransformFeedback")),(l=es.prototype).beginTransformFeedback??(l.beginTransformFeedback=(0,en._MissingSideEffect)("Engine","beginTransformFeedback")),(u=es.prototype).endTransformFeedback??(u.endTransformFeedback=(0,en._MissingSideEffect)("Engine","endTransformFeedback")),(h=es.prototype).setTranformFeedbackVaryings??(h.setTranformFeedbackVaryings=(0,en._MissingSideEffect)("Engine","setTranformFeedbackVaryings")),(o=es.prototype).bindTransformFeedbackBuffer??(o.bindTransformFeedbackBuffer=(0,en._MissingSideEffect)("Engine","bindTransformFeedbackBuffer")),(_=es.prototype).readTransformFeedbackBuffer??(_.readTransformFeedbackBuffer=(0,en._MissingSideEffect)("Engine","readTransformFeedbackBuffer")),e.s(["Engine",0,es],48928),e.i(48928),e.s(["Engine",0,es],62619)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18418,e=>{"use strict";var t=e.i(85595),i=e.i(95410),s=e.i(53773),r=e.i(90176),a=e.i(70855),o=e.i(33945),n=e.i(68401);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||a.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 a=e.getBoundingInfo().boundingBox,o=a.minimumWorld,n=a.maximumWorld;i.Vector3.CheckExtends(o,s,r),i.Vector3.CheckExtends(n,s,r)}return{min:s,max:r}}}_._AnimationRangeFactory=(e,t,i)=>{throw(0,o._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,_])},87409,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])},11771,e=>{"use strict";var t=e.i(32622);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)}}})}])},95603,e=>{"use strict";var t=e.i(85595),i=e.i(53773),s=e.i(70432),r=e.i(90176),a=e.i(95410),o=e.i(18418),n=e.i(80434),h=e.i(38116),_=e.i(33945),d=e.i(87409),l=e.i(46833),c=e.i(11771),g=e.i(68401);class u extends o.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===u.PERSPECTIVE_CAMERA)this.fovMode===u.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,o=!0){(0,c.RegisterAbstractEngineRenderPass)(),super(e,i,!1),this._position=a.Vector3.Zero(),this._upVector=a.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=u.PERSPECTIVE_CAMERA,this.isIntermediate=!1,this.viewport=new d.Viewport(0,0,1,1),this.layerMask=0xfffffff,this.fovMode=u.FOVMODE_VERTICAL_FIXED,this.cameraRigMode=u.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 a.Matrix,this._postProcesses=[],this._activeMeshes=new s.SmartArray(256),this._globalPosition=a.Vector3.Zero(),this._computedViewMatrix=a.Matrix.Identity(),this._doNotComputeProjectionMatrix=!1,this._transformMatrix=a.Matrix.Zero(),this._refreshFrustumPlanes=!0,this._absoluteRotation=a.Quaternion.Identity(),this._isCamera=!0,this._isLeftCamera=!1,this._isRightCamera=!1,this.layerMask=this.getScene().defaultCameraLayerMask,this.getScene().addCamera(this),o&&!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 a.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.upVector=new a.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===u.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!==u.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 a.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===u.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?a.Matrix.PerspectiveFovRHToRef:a.Matrix.PerspectiveFovLHToRef)(this.fov,i.getAspectRatio(this),r?t:this.minZ,r?this.minZ:t,this._projectionMatrix,this.fovMode===u.FOVMODE_VERTICAL_FIXED,i.isNDCHalfZRange,this.projectionPlaneTilt,r);else{let e=i.getRenderWidth()/2,o=i.getRenderHeight()/2;s.useRightHandedSystem?this.oblique?a.Matrix.ObliqueOffCenterRHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-o,this.orthoTop??o,r?t:this.minZ,r?this.minZ:t,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,i.isNDCHalfZRange):a.Matrix.OrthoOffCenterRHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-o,this.orthoTop??o,r?t:this.minZ,r?this.minZ:t,this._projectionMatrix,i.isNDCHalfZRange):this.oblique?a.Matrix.ObliqueOffCenterLHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-o,this.orthoTop??o,r?t:this.minZ,r?this.minZ:t,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,i.isNDCHalfZRange):a.Matrix.OrthoOffCenterLHToRef(this.orthoLeft??-e,this.orthoRight??e,this.orthoBottom??-o,this.orthoTop??o,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?a.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,_._WarnImport)("Ray")}getForwardRayToRef(e,t=100,i,s){throw(0,_._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!==u.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!==u.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 a.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===u.RIG_MODE_STEREOSCOPIC_ANAGLYPH&&(this._rigCameras[0].viewport=this._rigCameras[1].viewport=this.viewport)}_setupInputs(){}serialize(){let e=g.SerializationHelper.Serialize(this);return e.uniqueId=this.uniqueId,e.type=this.getClassName(),this.parent&&this.parent._serializeAsParent(e),this.inputs&&this.inputs.serialize(e),g.SerializationHelper.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.isEnabled=this.isEnabled(),e}clone(e,t=null){let i=g.SerializationHelper.Clone(u.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=a.Vector3.Zero();return this.getDirectionToRef(e,t),t}get absoluteRotation(){return this.getWorldMatrix().decompose(void 0,this._absoluteRotation),this._absoluteRotation}getDirectionToRef(e,t){a.Vector3.TransformNormalToRef(e,this.getWorldMatrix(),t)}static GetConstructorFromName(e,t,i,s=0,r=!0){let a=o.Node.Construct(e,t,i,{interaxial_distance:s,isStereoscopicSideBySide:r});return a||(()=>u._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}}function m(e,t){let i=e.type,s=u.GetConstructorFromName(i,e.name,t,e.interaxial_distance,e.isStereoscopicSideBySide),r=g.SerializationHelper.Parse(s,e,t);if(void 0!==e.parentId&&(r._waitingParentId=e.parentId),void 0!==e.parentInstanceIndex&&(r._waitingParentInstanceIndex=e.parentInstanceIndex),r.inputs&&(r.inputs.parse(e),r._setupInputs()),e.upVector&&(r.upVector=a.Vector3.FromArray(e.upVector)),r.setPosition&&(r.position.copyFromFloats(0,0,0),r.setPosition(a.Vector3.FromArray(e.position))),e.target&&r.setTarget&&r.setTarget(a.Vector3.FromArray(e.target)),e.cameraRigMode){let t=e.interaxial_distance?{interaxialDistance:e.interaxial_distance}:{};r.setCameraRigMode(e.cameraRigMode,t)}if(e.animations){for(let t=0;t<e.animations.length;t++){let i=e.animations[t],s=(0,h.GetClass)("BABYLON.Animation");s&&r.animations.push(s.Parse(i))}o.Node.ParseAnimationRanges(r,e,t)}return e.autoAnimate&&t.beginAnimation(r,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),void 0!==e.isEnabled&&r.setEnabled(e.isEnabled),r}u._CreateDefaultParsedCamera=(e,t)=>{throw(0,_._WarnImport)("UniversalCamera")},u.PERSPECTIVE_CAMERA=0,u.ORTHOGRAPHIC_CAMERA=1,u.FOVMODE_VERTICAL_FIXED=0,u.FOVMODE_HORIZONTAL_FIXED=1,u.RIG_MODE_NONE=0,u.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,u.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,u.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,u.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,u.RIG_MODE_STEREOSCOPIC_INTERLACED=14,u.RIG_MODE_VR=20,u.RIG_MODE_CUSTOM=22,u.ForceAttachControlToAlwaysPreventDefault=!1,(0,t.__decorate)([(0,i.serializeAsVector3)("position")],u.prototype,"_position",void 0),(0,t.__decorate)([(0,i.serializeAsVector3)("upVector")],u.prototype,"_upVector",void 0),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"orthoLeft",null),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"orthoRight",null),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"orthoBottom",null),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"orthoTop",null),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"fov",void 0),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"projectionPlaneTilt",void 0),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"minZ",void 0),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"maxZ",void 0),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"inertia",null),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"mode",null),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"layerMask",void 0),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"fovMode",void 0),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"cameraRigMode",void 0),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"interaxialDistance",void 0),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"isStereoscopicSideBySide",void 0),(0,t.__decorate)([(0,i.serialize)()],u.prototype,"ignoreCameraMaxZ",void 0);let p=!1;e.s(["Camera",0,u,"RegisterCamera",0,function(){p||(p=!0,u.Parse=m)}])}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42473,t=>{"use strict";var e,s,i=t.i(35270),n=t.i(10534),r=t.i(26722);(e=s||(s={}))[e.CW=0]="CW",e[e.CCW=1]="CCW";class o{constructor(t){this._radians=t,this._radians<0&&(this._radians+=2*Math.PI)}degrees(){return 180*this._radians/Math.PI}radians(){return this._radians}static BetweenTwoPoints(t,e){let s=e.subtract(t);return new o(Math.atan2(s.y,s.x))}static BetweenTwoVectors(t,e){let s=t.lengthSquared()*e.lengthSquared();if(0===s)return new o(Math.PI/2);s=Math.sqrt(s);let n=t.dot(e)/s;return new o(Math.acos(n=(0,i.Clamp)(n,-1,1)))}static FromRadians(t){return new o(t)}static FromDegrees(t){return new o(t*Math.PI/180)}}class a{constructor(t,e,s){this.startPoint=t,this.midPoint=e,this.endPoint=s;const i=Math.pow(e.x,2)+Math.pow(e.y,2),r=(Math.pow(t.x,2)+Math.pow(t.y,2)-i)/2,a=(i-Math.pow(s.x,2)-Math.pow(s.y,2))/2,h=(t.x-e.x)*(e.y-s.y)-(e.x-s.x)*(t.y-e.y);this.centerPoint=new n.Vector2((r*(e.y-s.y)-a*(t.y-e.y))/h,((t.x-e.x)*a-(e.x-s.x)*r)/h),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=o.BetweenTwoPoints(this.centerPoint,this.startPoint);const l=this.startAngle.degrees();let u=o.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),c=o.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();u-l>180&&(u-=360),u-l<-180&&(u+=360),c-u>180&&(c-=360),c-u<-180&&(c+=360),this.orientation=u-l<0?0:1,this.angle=o.FromDegrees(0===this.orientation?l-c:c-l)}}class h{constructor(t,e){this._points=[],this._length=0,this.closed=!1,this._points.push(new n.Vector2(t,e))}addLineTo(t,e){if(this.closed)return this;let s=new n.Vector2(t,e),i=this._points[this._points.length-1];return this._points.push(s),this._length+=s.subtract(i).length(),this}addArcTo(t,e,s,i,r=36){if(this.closed)return this;let o=new a(this._points[this._points.length-1],new n.Vector2(t,e),new n.Vector2(s,i)),h=o.angle.radians()/r;0===o.orientation&&(h*=-1);let l=o.startAngle.radians()+h;for(let t=0;t<r;t++){let t=Math.cos(l)*o.radius+o.centerPoint.x,e=Math.sin(l)*o.radius+o.centerPoint.y;this.addLineTo(t,e),l+=h}return this}addQuadraticCurveTo(t,e,s,i,n=36){if(this.closed)return this;let r=(t,e,s,i)=>(1-t)*(1-t)*e+2*t*(1-t)*s+t*t*i,o=this._points[this._points.length-1];for(let a=0;a<=n;a++){let h=a/n,l=r(h,o.x,t,s),u=r(h,o.y,e,i);this.addLineTo(l,u)}return this}addBezierCurveTo(t,e,s,i,n,r,o=36){if(this.closed)return this;let a=(t,e,s,i,n)=>(1-t)*(1-t)*(1-t)*e+3*t*(1-t)*(1-t)*s+3*t*t*(1-t)*i+t*t*t*n,h=this._points[this._points.length-1];for(let l=0;l<=o;l++){let u=l/o,c=a(u,h.x,t,s,n),_=a(u,h.y,e,i,r);this.addLineTo(c,_)}return this}isPointInside(t){let e=!1,s=this._points.length;for(let i=s-1,n=0;n<s;i=n++){let s=this._points[i],r=this._points[n],o=r.x-s.x,a=r.y-s.y;if(Math.abs(a)>Number.EPSILON){if(a<0&&(s=this._points[n],o=-o,r=this._points[i],a=-a),t.y<s.y||t.y>r.y)continue;if(t.y===s.y&&t.x===s.x)return!0;{let i=a*(t.x-s.x)-o*(t.y-s.y);if(0===i)return!0;if(i<0)continue;e=!e}}else{if(t.y!==s.y)continue;if(r.x<=t.x&&t.x<=s.x||s.x<=t.x&&t.x<=r.x)return!0}}return e}close(){return this.closed=!0,this}length(){let t=this._length;if(this.closed){let e=this._points[this._points.length-1];t+=this._points[0].subtract(e).length()}return t}area(){let t=this._points.length,e=0;for(let s=t-1,i=0;i<t;s=i++)e+=this._points[s].x*this._points[i].y-this._points[i].x*this._points[s].y;return .5*e}getPoints(){return this._points}getPointAtLengthPosition(t){if(t<0||t>1)return n.Vector2.Zero();let e=t*this.length(),s=0;for(let t=0;t<this._points.length;t++){let i=(t+1)%this._points.length,r=this._points[t],o=this._points[i].subtract(r),a=o.length()+s;if(e>=s&&e<=a){let t=o.normalize(),i=e-s;return new n.Vector2(r.x+t.x*i,r.y+t.y*i)}s=a}return n.Vector2.Zero()}static StartingAt(t,e){return new h(t,e)}}class l{constructor(t,e=null,s,i=!1){this.path=t,this._curve=[],this._distances=[],this._tangents=[],this._normals=[],this._binormals=[],this._pointAtData={id:0,point:n.Vector3.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:n.Matrix.Identity()};for(let e=0;e<t.length;e++)this._curve[e]=t[e].clone();this._raw=s||!1,this._alignTangentsWithPath=i,this._compute(e,i)}getCurve(){return this._curve}getPoints(){return this._curve}length(){return this._distances[this._distances.length-1]}getTangents(){return this._tangents}getNormals(){return this._normals}getBinormals(){return this._binormals}getDistances(){return this._distances}getPointAt(t){return this._updatePointAtData(t).point}getTangentAt(t,e=!1){return this._updatePointAtData(t,e),e?n.Vector3.TransformCoordinates(n.Vector3.Forward(),this._pointAtData.interpolationMatrix):this._tangents[this._pointAtData.previousPointArrayIndex]}getNormalAt(t,e=!1){return this._updatePointAtData(t,e),e?n.Vector3.TransformCoordinates(n.Vector3.Right(),this._pointAtData.interpolationMatrix):this._normals[this._pointAtData.previousPointArrayIndex]}getBinormalAt(t,e=!1){return this._updatePointAtData(t,e),e?n.Vector3.TransformCoordinates(n.Vector3.UpReadOnly,this._pointAtData.interpolationMatrix):this._binormals[this._pointAtData.previousPointArrayIndex]}getDistanceAt(t){return this.length()*t}getPreviousPointIndexAt(t){return this._updatePointAtData(t),this._pointAtData.previousPointArrayIndex}getSubPositionAt(t){return this._updatePointAtData(t),this._pointAtData.subPosition}getClosestPositionTo(t){let e=Number.MAX_VALUE,s=0;for(let i=0;i<this._curve.length-1;i++){let r=this._curve[i+0],o=this._curve[i+1].subtract(r).normalize(),a=this._distances[i+1]-this._distances[i+0],h=Math.min(Math.max(n.Vector3.Dot(o,t.subtract(r).normalize()),0)*n.Vector3.Distance(r,t)/a,1),l=n.Vector3.Distance(r.add(o.scale(h*a)),t);l<e&&(e=l,s=(this._distances[i+0]+a*h)/this.length())}return s}slice(t=0,e=1){if(t<0&&(t=1- -1*t%1),e<0&&(e=1- -1*e%1),t>e){let s=t;t=e,e=s}let s=this.getCurve(),i=this.getPointAt(t),n=this.getPreviousPointIndexAt(t),r=this.getPointAt(e),o=this.getPreviousPointIndexAt(e)+1,a=[];return 0!==t&&(n++,a.push(i)),a.push(...s.slice(n,o)),(1!==e||1===t)&&a.push(r),new l(a,this.getNormalAt(t),this._raw,this._alignTangentsWithPath)}update(t,e=null,s=!1){for(let e=0;e<t.length;e++)this._curve[e].x=t[e].x,this._curve[e].y=t[e].y,this._curve[e].z=t[e].z;return this._compute(e,s),this}_compute(t,e=!1){let s,i,r,o,a,h=this._curve.length;if(h<2)return;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[h-1]=this._curve[h-1].subtract(this._curve[h-2]),this._raw||this._tangents[h-1].normalize();let l=this._tangents[0],u=this._normalVector(l,t);this._normals[0]=u,this._raw||this._normals[0].normalize(),this._binormals[0]=n.Vector3.Cross(l,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;for(let t=1;t<h;t++)s=this._getLastNonNullVector(t),t<h-1&&(i=this._getFirstNonNullVector(t),this._tangents[t]=e?i:s.add(i),this._tangents[t].normalize()),this._distances[t]=this._distances[t-1]+this._curve[t].subtract(this._curve[t-1]).length(),r=this._tangents[t],a=this._binormals[t-1],this._normals[t]=n.Vector3.Cross(a,r),this._raw||(0===this._normals[t].length()?(o=this._normals[t-1],this._normals[t]=o.clone()):this._normals[t].normalize()),this._binormals[t]=n.Vector3.Cross(r,this._normals[t]),this._raw||this._binormals[t].normalize();this._pointAtData.id=NaN}_getFirstNonNullVector(t){let e=1,s=this._curve[t+e].subtract(this._curve[t]);for(;0===s.length()&&t+e+1<this._curve.length;)e++,s=this._curve[t+e].subtract(this._curve[t]);return s}_getLastNonNullVector(t){let e=1,s=this._curve[t].subtract(this._curve[t-e]);for(;0===s.length()&&t>e+1;)e++,s=this._curve[t].subtract(this._curve[t-e]);return s}_normalVector(t,e){let s,o=t.length();if(0===o&&(o=1),null==e){let e;e=(0,i.WithinEpsilon)(Math.abs(t.y)/o,1,r.Epsilon)?(0,i.WithinEpsilon)(Math.abs(t.x)/o,1,r.Epsilon)?(0,i.WithinEpsilon)(Math.abs(t.z)/o,1,r.Epsilon)?n.Vector3.Zero():new n.Vector3(0,0,1):new n.Vector3(1,0,0):new n.Vector3(0,-1,0),s=n.Vector3.Cross(t,e)}else s=n.Vector3.Cross(t,e),n.Vector3.CrossToRef(s,t,s);return s.normalize(),s}_updatePointAtData(t,e=!1){let s;if(this._pointAtData.id===t)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=t;let i=this.getPoints();if(t<=0)return this._setPointAtData(0,0,i[0],0,e);if(t>=1)return this._setPointAtData(1,1,i[i.length-1],i.length-1,e);let r=i[0],o=0,a=t*this.length();for(let h=1;h<i.length;h++){s=i[h];let l=n.Vector3.Distance(r,s);if((o+=l)===a)return this._setPointAtData(t,1,s,h,e);if(o>a){let i=(o-a)/l,n=r.subtract(s),u=s.add(n.scaleInPlace(i));return this._setPointAtData(t,1-i,u,h-1,e)}r=s}return this._pointAtData}_setPointAtData(t,e,s,i,n){return this._pointAtData.point=s,this._pointAtData.position=t,this._pointAtData.subPosition=e,this._pointAtData.previousPointArrayIndex=i,this._pointAtData.interpolateReady=n,n&&this._updateInterpolationMatrix(),this._pointAtData}_updateInterpolationMatrix(){this._pointAtData.interpolationMatrix=n.Matrix.Identity();let t=this._pointAtData.previousPointArrayIndex;if(t!==this._tangents.length-1){let e=t+1,s=this._tangents[t].clone(),i=this._normals[t].clone(),r=this._binormals[t].clone(),o=this._tangents[e].clone(),a=this._normals[e].clone(),h=this._binormals[e].clone(),l=n.Quaternion.RotationQuaternionFromAxis(i,r,s),u=n.Quaternion.RotationQuaternionFromAxis(a,h,o);n.Quaternion.Slerp(l,u,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class u{static CreateQuadraticBezier(t,e,s,i){i=i>2?i:3;let r=[],o=(t,e,s,i)=>(1-t)*(1-t)*e+2*t*(1-t)*s+t*t*i;for(let a=0;a<=i;a++)r.push(new n.Vector3(o(a/i,t.x,e.x,s.x),o(a/i,t.y,e.y,s.y),o(a/i,t.z,e.z,s.z)));return new u(r)}static CreateCubicBezier(t,e,s,i,r){r=r>3?r:4;let o=[],a=(t,e,s,i,n)=>(1-t)*(1-t)*(1-t)*e+3*t*(1-t)*(1-t)*s+3*t*t*(1-t)*i+t*t*t*n;for(let h=0;h<=r;h++)o.push(new n.Vector3(a(h/r,t.x,e.x,s.x,i.x),a(h/r,t.y,e.y,s.y,i.y),a(h/r,t.z,e.z,s.z,i.z)));return new u(o)}static CreateHermiteSpline(t,e,s,i,r){let o=[],a=1/r;for(let h=0;h<=r;h++)o.push(n.Vector3.Hermite(t,e,s,i,h*a));return new u(o)}static CreateCatmullRomSpline(t,e,s){let i=[],r=1/e,o=0;if(s){let s=t.length;for(let a=0;a<s;a++){o=0;for(let h=0;h<e;h++)i.push(n.Vector3.CatmullRom(t[a%s],t[(a+1)%s],t[(a+2)%s],t[(a+3)%s],o)),o+=r}i.push(i[0])}else{let s=[];s.push(t[0].clone()),s.push(...t),s.push(t[t.length-1].clone());let a=0;for(;a<s.length-3;a++){o=0;for(let t=0;t<e;t++)i.push(n.Vector3.CatmullRom(s[a],s[a+1],s[a+2],s[a+3],o)),o+=r}a--,i.push(n.Vector3.CatmullRom(s[a],s[a+1],s[a+2],s[a+3],o))}return new u(i)}static ArcThru3Points(t,e,s,i=32,r=!1,o=!1){let a=[],h=e.subtract(t),l=s.subtract(e),c=t.subtract(s),_=n.Vector3.Cross(h,l),p=_.length();if(p<1e-8)return new u(a);let g=h.lengthSquared(),d=l.lengthSquared(),x=c.lengthSquared(),m=_.lengthSquared(),A=.5*h.length()*l.length()*c.length()/p,M=n.Vector3.Dot(h,c),P=n.Vector3.Dot(h,l),w=n.Vector3.Dot(l,c),y=t.scale(-.5*d*M/m).add(e.scale(-.5*x*P/m)).add(s.scale(-.5*g*w/m)),f=t.subtract(y).normalize(),C=n.Vector3.Cross(_,f).normalize();if(o){let e=2*Math.PI/i;for(let t=0;t<=2*Math.PI;t+=e)a.push(y.add(f.scale(A*Math.cos(t)).add(C.scale(A*Math.sin(t)))));a.push(t)}else{let e,n=1/i,o=0;do e=y.add(f.scale(A*Math.cos(o)).add(C.scale(A*Math.sin(o)))),a.push(e),o+=n;while(!e.equalsWithEpsilon(s,A*n*1.1))a.push(s),r&&a.push(t)}return new u(a)}constructor(t){this._length=0,this._points=t,this._length=this._computeLength(t)}getPoints(){return this._points}length(){return this._length}continue(t){let e=this._points[this._points.length-1],s=this._points.slice(),i=t.getPoints();for(let t=1;t<i.length;t++)s.push(i[t].subtract(i[0]).add(e));return new u(s)}_computeLength(t){let e=0;for(let s=1;s<t.length;s++)e+=t[s].subtract(t[s-1]).length();return e}}t.s(["Angle",0,o,"Arc2",0,a,"BezierCurve",0,class{static Interpolate(t,e,s,i,n){if(0===t)return 0;let r=1-3*i+3*e,o=3*i-6*e,a=3*e,h=t;for(let e=0;e<5;e++){let e=h*h,s=e*h*r+o*e+a*h,i=1/(3*r*e+2*o*h+a);h-=(s-t)*i,h=Math.min(1,Math.max(0,h))}return 3*Math.pow(1-h,2)*h*s+3*(1-h)*Math.pow(h,2)*n+Math.pow(h,3)}},"Curve3",0,u,"Orientation",0,s,"Path2",0,h,"Path3D",0,l])},54149,t=>{"use strict";var e=t.i(42473);class s{constructor(){this._easingMode=s.EASINGMODE_EASEIN}setEasingMode(t){let e=Math.min(Math.max(t,0),2);this._easingMode=e}getEasingMode(){return this._easingMode}easeInCore(t){throw Error("You must implement this method")}ease(t){switch(this._easingMode){case s.EASINGMODE_EASEIN:return this.easeInCore(t);case s.EASINGMODE_EASEOUT:return 1-this.easeInCore(1-t)}return t>=.5?(1-this.easeInCore((1-t)*2))*.5+.5:.5*this.easeInCore(2*t)}}s.EASINGMODE_EASEIN=0,s.EASINGMODE_EASEOUT=1,s.EASINGMODE_EASEINOUT=2,t.s(["BackEase",0,class extends s{constructor(t=1){super(),this.amplitude=t}easeInCore(t){return Math.pow(t,3)-t*Math.max(0,this.amplitude)*Math.sin(3.141592653589793*t)}},"BezierCurveEase",0,class extends s{constructor(t=0,e=0,s=1,i=1){super(),this.x1=t,this.y1=e,this.x2=s,this.y2=i}easeInCore(t){return e.BezierCurve.Interpolate(t,this.x1,this.y1,this.x2,this.y2)}},"BounceEase",0,class extends s{constructor(t=3,e=2){super(),this.bounces=t,this.bounciness=e}easeInCore(t){let e=Math.max(0,this.bounces),s=this.bounciness;s<=1&&(s=1.001);let i=Math.pow(s,e),n=1-s,r=(1-i)/n+.5*i,o=Math.floor(Math.log(-(t*r)*(1-s)+1)/Math.log(s)),a=(1-Math.pow(s,o))/(n*r),h=(a+(1-Math.pow(s,o+1))/(n*r))*.5,l=t-h,u=h-a;return-Math.pow(1/s,e-o)/(u*u)*(l-u)*(l+u)}},"CircleEase",0,class extends s{easeInCore(t){return 1-Math.sqrt(1-(t=Math.max(0,Math.min(1,t)))*t)}},"CubicEase",0,class extends s{easeInCore(t){return t*t*t}},"EasingFunction",0,s,"ElasticEase",0,class extends s{constructor(t=3,e=3){super(),this.oscillations=t,this.springiness=e}easeInCore(t){let e=Math.max(0,this.oscillations),s=Math.max(0,this.springiness);return(0===s?t:(Math.exp(s*t)-1)/(Math.exp(s)-1))*Math.sin((6.283185307179586*e+1.5707963267948966)*t)}},"ExponentialEase",0,class extends s{constructor(t=2){super(),this.exponent=t}easeInCore(t){return this.exponent<=0?t:(Math.exp(this.exponent*t)-1)/(Math.exp(this.exponent)-1)}}])},62889,t=>{"use strict";var e=t.i(54149),s=t.i(82531),i=t.i(82350),n=t.i(48477);class r extends s.FlowGraphBlock{constructor(t){super(t),this.config=t,this._easingFunctions={},this.mode=this.registerDataInput("mode",i.RichTypeNumber,0),this.controlPoint1=this.registerDataInput("controlPoint1",i.RichTypeVector2),this.controlPoint2=this.registerDataInput("controlPoint2",i.RichTypeVector2),this.easingFunction=this.registerDataOutput("easingFunction",i.RichTypeAny)}_updateOutputs(t){let s=this.mode.getValue(t),i=this.controlPoint1.getValue(t),n=this.controlPoint2.getValue(t);if(void 0===s)return;let r=`${s}-${i.x}-${i.y}-${n.x}-${n.y}`;if(!this._easingFunctions[r]){let t=new e.BezierCurveEase(i.x,i.y,n.x,n.y);t.setEasingMode(s),this._easingFunctions[r]=t}this.easingFunction.setValue(this._easingFunctions[r],t)}getClassName(){return"FlowGraphBezierCurveEasing"}}let o=!1;function a(){o||(o=!0,(0,n.RegisterClass)("FlowGraphBezierCurveEasing",r))}t.s(["FlowGraphBezierCurveEasingBlock",0,r,"RegisterFlowGraphBezierCurveEasingBlock",0,a],96702),a(),t.s([],38264),t.i(38264),t.i(96702),t.s(["FlowGraphBezierCurveEasingBlock",0,r],62889)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87023,t=>{"use strict";var e,s,i=t.i(90629),n=t.i(95410),r=t.i(82579);(e=s||(s={}))[e.CW=0]="CW",e[e.CCW=1]="CCW";class o{constructor(t){this._radians=t,this._radians<0&&(this._radians+=2*Math.PI)}degrees(){return 180*this._radians/Math.PI}radians(){return this._radians}static BetweenTwoPoints(t,e){let s=e.subtract(t);return new o(Math.atan2(s.y,s.x))}static BetweenTwoVectors(t,e){let s=t.lengthSquared()*e.lengthSquared();if(0===s)return new o(Math.PI/2);s=Math.sqrt(s);let n=t.dot(e)/s;return new o(Math.acos(n=(0,i.Clamp)(n,-1,1)))}static FromRadians(t){return new o(t)}static FromDegrees(t){return new o(t*Math.PI/180)}}class a{constructor(t,e,s){this.startPoint=t,this.midPoint=e,this.endPoint=s;const i=Math.pow(e.x,2)+Math.pow(e.y,2),r=(Math.pow(t.x,2)+Math.pow(t.y,2)-i)/2,a=(i-Math.pow(s.x,2)-Math.pow(s.y,2))/2,h=(t.x-e.x)*(e.y-s.y)-(e.x-s.x)*(t.y-e.y);this.centerPoint=new n.Vector2((r*(e.y-s.y)-a*(t.y-e.y))/h,((t.x-e.x)*a-(e.x-s.x)*r)/h),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=o.BetweenTwoPoints(this.centerPoint,this.startPoint);const l=this.startAngle.degrees();let u=o.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),c=o.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();u-l>180&&(u-=360),u-l<-180&&(u+=360),c-u>180&&(c-=360),c-u<-180&&(c+=360),this.orientation=u-l<0?0:1,this.angle=o.FromDegrees(0===this.orientation?l-c:c-l)}}class h{constructor(t,e){this._points=[],this._length=0,this.closed=!1,this._points.push(new n.Vector2(t,e))}addLineTo(t,e){if(this.closed)return this;let s=new n.Vector2(t,e),i=this._points[this._points.length-1];return this._points.push(s),this._length+=s.subtract(i).length(),this}addArcTo(t,e,s,i,r=36){if(this.closed)return this;let o=new a(this._points[this._points.length-1],new n.Vector2(t,e),new n.Vector2(s,i)),h=o.angle.radians()/r;0===o.orientation&&(h*=-1);let l=o.startAngle.radians()+h;for(let t=0;t<r;t++){let t=Math.cos(l)*o.radius+o.centerPoint.x,e=Math.sin(l)*o.radius+o.centerPoint.y;this.addLineTo(t,e),l+=h}return this}addQuadraticCurveTo(t,e,s,i,n=36){if(this.closed)return this;let r=(t,e,s,i)=>(1-t)*(1-t)*e+2*t*(1-t)*s+t*t*i,o=this._points[this._points.length-1];for(let a=0;a<=n;a++){let h=a/n,l=r(h,o.x,t,s),u=r(h,o.y,e,i);this.addLineTo(l,u)}return this}addBezierCurveTo(t,e,s,i,n,r,o=36){if(this.closed)return this;let a=(t,e,s,i,n)=>(1-t)*(1-t)*(1-t)*e+3*t*(1-t)*(1-t)*s+3*t*t*(1-t)*i+t*t*t*n,h=this._points[this._points.length-1];for(let l=0;l<=o;l++){let u=l/o,c=a(u,h.x,t,s,n),_=a(u,h.y,e,i,r);this.addLineTo(c,_)}return this}isPointInside(t){let e=!1,s=this._points.length;for(let i=s-1,n=0;n<s;i=n++){let s=this._points[i],r=this._points[n],o=r.x-s.x,a=r.y-s.y;if(Math.abs(a)>Number.EPSILON){if(a<0&&(s=this._points[n],o=-o,r=this._points[i],a=-a),t.y<s.y||t.y>r.y)continue;if(t.y===s.y&&t.x===s.x)return!0;{let i=a*(t.x-s.x)-o*(t.y-s.y);if(0===i)return!0;if(i<0)continue;e=!e}}else{if(t.y!==s.y)continue;if(r.x<=t.x&&t.x<=s.x||s.x<=t.x&&t.x<=r.x)return!0}}return e}close(){return this.closed=!0,this}length(){let t=this._length;if(this.closed){let e=this._points[this._points.length-1];t+=this._points[0].subtract(e).length()}return t}area(){let t=this._points.length,e=0;for(let s=t-1,i=0;i<t;s=i++)e+=this._points[s].x*this._points[i].y-this._points[i].x*this._points[s].y;return .5*e}getPoints(){return this._points}getPointAtLengthPosition(t){if(t<0||t>1)return n.Vector2.Zero();let e=t*this.length(),s=0;for(let t=0;t<this._points.length;t++){let i=(t+1)%this._points.length,r=this._points[t],o=this._points[i].subtract(r),a=o.length()+s;if(e>=s&&e<=a){let t=o.normalize(),i=e-s;return new n.Vector2(r.x+t.x*i,r.y+t.y*i)}s=a}return n.Vector2.Zero()}static StartingAt(t,e){return new h(t,e)}}class l{constructor(t,e=null,s,i=!1){this.path=t,this._curve=[],this._distances=[],this._tangents=[],this._normals=[],this._binormals=[],this._pointAtData={id:0,point:n.Vector3.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:n.Matrix.Identity()};for(let e=0;e<t.length;e++)this._curve[e]=t[e].clone();this._raw=s||!1,this._alignTangentsWithPath=i,this._compute(e,i)}getCurve(){return this._curve}getPoints(){return this._curve}length(){return this._distances[this._distances.length-1]}getTangents(){return this._tangents}getNormals(){return this._normals}getBinormals(){return this._binormals}getDistances(){return this._distances}getPointAt(t){return this._updatePointAtData(t).point}getTangentAt(t,e=!1){return this._updatePointAtData(t,e),e?n.Vector3.TransformCoordinates(n.Vector3.Forward(),this._pointAtData.interpolationMatrix):this._tangents[this._pointAtData.previousPointArrayIndex]}getNormalAt(t,e=!1){return this._updatePointAtData(t,e),e?n.Vector3.TransformCoordinates(n.Vector3.Right(),this._pointAtData.interpolationMatrix):this._normals[this._pointAtData.previousPointArrayIndex]}getBinormalAt(t,e=!1){return this._updatePointAtData(t,e),e?n.Vector3.TransformCoordinates(n.Vector3.UpReadOnly,this._pointAtData.interpolationMatrix):this._binormals[this._pointAtData.previousPointArrayIndex]}getDistanceAt(t){return this.length()*t}getPreviousPointIndexAt(t){return this._updatePointAtData(t),this._pointAtData.previousPointArrayIndex}getSubPositionAt(t){return this._updatePointAtData(t),this._pointAtData.subPosition}getClosestPositionTo(t){let e=Number.MAX_VALUE,s=0;for(let i=0;i<this._curve.length-1;i++){let r=this._curve[i+0],o=this._curve[i+1].subtract(r).normalize(),a=this._distances[i+1]-this._distances[i+0],h=Math.min(Math.max(n.Vector3.Dot(o,t.subtract(r).normalize()),0)*n.Vector3.Distance(r,t)/a,1),l=n.Vector3.Distance(r.add(o.scale(h*a)),t);l<e&&(e=l,s=(this._distances[i+0]+a*h)/this.length())}return s}slice(t=0,e=1){if(t<0&&(t=1- -1*t%1),e<0&&(e=1- -1*e%1),t>e){let s=t;t=e,e=s}let s=this.getCurve(),i=this.getPointAt(t),n=this.getPreviousPointIndexAt(t),r=this.getPointAt(e),o=this.getPreviousPointIndexAt(e)+1,a=[];return 0!==t&&(n++,a.push(i)),a.push(...s.slice(n,o)),(1!==e||1===t)&&a.push(r),new l(a,this.getNormalAt(t),this._raw,this._alignTangentsWithPath)}update(t,e=null,s=!1){for(let e=0;e<t.length;e++)this._curve[e].x=t[e].x,this._curve[e].y=t[e].y,this._curve[e].z=t[e].z;return this._compute(e,s),this}_compute(t,e=!1){let s,i,r,o,a,h=this._curve.length;if(h<2)return;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[h-1]=this._curve[h-1].subtract(this._curve[h-2]),this._raw||this._tangents[h-1].normalize();let l=this._tangents[0],u=this._normalVector(l,t);this._normals[0]=u,this._raw||this._normals[0].normalize(),this._binormals[0]=n.Vector3.Cross(l,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;for(let t=1;t<h;t++)s=this._getLastNonNullVector(t),t<h-1&&(i=this._getFirstNonNullVector(t),this._tangents[t]=e?i:s.add(i),this._tangents[t].normalize()),this._distances[t]=this._distances[t-1]+this._curve[t].subtract(this._curve[t-1]).length(),r=this._tangents[t],a=this._binormals[t-1],this._normals[t]=n.Vector3.Cross(a,r),this._raw||(0===this._normals[t].length()?(o=this._normals[t-1],this._normals[t]=o.clone()):this._normals[t].normalize()),this._binormals[t]=n.Vector3.Cross(r,this._normals[t]),this._raw||this._binormals[t].normalize();this._pointAtData.id=NaN}_getFirstNonNullVector(t){let e=1,s=this._curve[t+e].subtract(this._curve[t]);for(;0===s.length()&&t+e+1<this._curve.length;)e++,s=this._curve[t+e].subtract(this._curve[t]);return s}_getLastNonNullVector(t){let e=1,s=this._curve[t].subtract(this._curve[t-e]);for(;0===s.length()&&t>e+1;)e++,s=this._curve[t].subtract(this._curve[t-e]);return s}_normalVector(t,e){let s,o=t.length();if(0===o&&(o=1),null==e){let e;e=(0,i.WithinEpsilon)(Math.abs(t.y)/o,1,r.Epsilon)?(0,i.WithinEpsilon)(Math.abs(t.x)/o,1,r.Epsilon)?(0,i.WithinEpsilon)(Math.abs(t.z)/o,1,r.Epsilon)?n.Vector3.Zero():new n.Vector3(0,0,1):new n.Vector3(1,0,0):new n.Vector3(0,-1,0),s=n.Vector3.Cross(t,e)}else s=n.Vector3.Cross(t,e),n.Vector3.CrossToRef(s,t,s);return s.normalize(),s}_updatePointAtData(t,e=!1){let s;if(this._pointAtData.id===t)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=t;let i=this.getPoints();if(t<=0)return this._setPointAtData(0,0,i[0],0,e);if(t>=1)return this._setPointAtData(1,1,i[i.length-1],i.length-1,e);let r=i[0],o=0,a=t*this.length();for(let h=1;h<i.length;h++){s=i[h];let l=n.Vector3.Distance(r,s);if((o+=l)===a)return this._setPointAtData(t,1,s,h,e);if(o>a){let i=(o-a)/l,n=r.subtract(s),u=s.add(n.scaleInPlace(i));return this._setPointAtData(t,1-i,u,h-1,e)}r=s}return this._pointAtData}_setPointAtData(t,e,s,i,n){return this._pointAtData.point=s,this._pointAtData.position=t,this._pointAtData.subPosition=e,this._pointAtData.previousPointArrayIndex=i,this._pointAtData.interpolateReady=n,n&&this._updateInterpolationMatrix(),this._pointAtData}_updateInterpolationMatrix(){this._pointAtData.interpolationMatrix=n.Matrix.Identity();let t=this._pointAtData.previousPointArrayIndex;if(t!==this._tangents.length-1){let e=t+1,s=this._tangents[t].clone(),i=this._normals[t].clone(),r=this._binormals[t].clone(),o=this._tangents[e].clone(),a=this._normals[e].clone(),h=this._binormals[e].clone(),l=n.Quaternion.RotationQuaternionFromAxis(i,r,s),u=n.Quaternion.RotationQuaternionFromAxis(a,h,o);n.Quaternion.Slerp(l,u,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class u{static CreateQuadraticBezier(t,e,s,i){i=i>2?i:3;let r=[],o=(t,e,s,i)=>(1-t)*(1-t)*e+2*t*(1-t)*s+t*t*i;for(let a=0;a<=i;a++)r.push(new n.Vector3(o(a/i,t.x,e.x,s.x),o(a/i,t.y,e.y,s.y),o(a/i,t.z,e.z,s.z)));return new u(r)}static CreateCubicBezier(t,e,s,i,r){r=r>3?r:4;let o=[],a=(t,e,s,i,n)=>(1-t)*(1-t)*(1-t)*e+3*t*(1-t)*(1-t)*s+3*t*t*(1-t)*i+t*t*t*n;for(let h=0;h<=r;h++)o.push(new n.Vector3(a(h/r,t.x,e.x,s.x,i.x),a(h/r,t.y,e.y,s.y,i.y),a(h/r,t.z,e.z,s.z,i.z)));return new u(o)}static CreateHermiteSpline(t,e,s,i,r){let o=[],a=1/r;for(let h=0;h<=r;h++)o.push(n.Vector3.Hermite(t,e,s,i,h*a));return new u(o)}static CreateCatmullRomSpline(t,e,s){let i=[],r=1/e,o=0;if(s){let s=t.length;for(let a=0;a<s;a++){o=0;for(let h=0;h<e;h++)i.push(n.Vector3.CatmullRom(t[a%s],t[(a+1)%s],t[(a+2)%s],t[(a+3)%s],o)),o+=r}i.push(i[0])}else{let s=[];s.push(t[0].clone()),s.push(...t),s.push(t[t.length-1].clone());let a=0;for(;a<s.length-3;a++){o=0;for(let t=0;t<e;t++)i.push(n.Vector3.CatmullRom(s[a],s[a+1],s[a+2],s[a+3],o)),o+=r}a--,i.push(n.Vector3.CatmullRom(s[a],s[a+1],s[a+2],s[a+3],o))}return new u(i)}static ArcThru3Points(t,e,s,i=32,r=!1,o=!1){let a=[],h=e.subtract(t),l=s.subtract(e),c=t.subtract(s),_=n.Vector3.Cross(h,l),p=_.length();if(p<1e-8)return new u(a);let g=h.lengthSquared(),d=l.lengthSquared(),x=c.lengthSquared(),m=_.lengthSquared(),A=.5*h.length()*l.length()*c.length()/p,M=n.Vector3.Dot(h,c),P=n.Vector3.Dot(h,l),w=n.Vector3.Dot(l,c),y=t.scale(-.5*d*M/m).add(e.scale(-.5*x*P/m)).add(s.scale(-.5*g*w/m)),f=t.subtract(y).normalize(),C=n.Vector3.Cross(_,f).normalize();if(o){let e=2*Math.PI/i;for(let t=0;t<=2*Math.PI;t+=e)a.push(y.add(f.scale(A*Math.cos(t)).add(C.scale(A*Math.sin(t)))));a.push(t)}else{let e,n=1/i,o=0;do e=y.add(f.scale(A*Math.cos(o)).add(C.scale(A*Math.sin(o)))),a.push(e),o+=n;while(!e.equalsWithEpsilon(s,A*n*1.1))a.push(s),r&&a.push(t)}return new u(a)}constructor(t){this._length=0,this._points=t,this._length=this._computeLength(t)}getPoints(){return this._points}length(){return this._length}continue(t){let e=this._points[this._points.length-1],s=this._points.slice(),i=t.getPoints();for(let t=1;t<i.length;t++)s.push(i[t].subtract(i[0]).add(e));return new u(s)}_computeLength(t){let e=0;for(let s=1;s<t.length;s++)e+=t[s].subtract(t[s-1]).length();return e}}t.s(["Angle",0,o,"Arc2",0,a,"BezierCurve",0,class{static Interpolate(t,e,s,i,n){if(0===t)return 0;let r=1-3*i+3*e,o=3*i-6*e,a=3*e,h=t;for(let e=0;e<5;e++){let e=h*h,s=e*h*r+o*e+a*h,i=1/(3*r*e+2*o*h+a);h-=(s-t)*i,h=Math.min(1,Math.max(0,h))}return 3*Math.pow(1-h,2)*h*s+3*(1-h)*Math.pow(h,2)*n+Math.pow(h,3)}},"Curve3",0,u,"Orientation",0,s,"Path2",0,h,"Path3D",0,l])},15205,t=>{"use strict";var e=t.i(87023);class s{constructor(){this._easingMode=s.EASINGMODE_EASEIN}setEasingMode(t){let e=Math.min(Math.max(t,0),2);this._easingMode=e}getEasingMode(){return this._easingMode}easeInCore(t){throw Error("You must implement this method")}ease(t){switch(this._easingMode){case s.EASINGMODE_EASEIN:return this.easeInCore(t);case s.EASINGMODE_EASEOUT:return 1-this.easeInCore(1-t)}return t>=.5?(1-this.easeInCore((1-t)*2))*.5+.5:.5*this.easeInCore(2*t)}}s.EASINGMODE_EASEIN=0,s.EASINGMODE_EASEOUT=1,s.EASINGMODE_EASEINOUT=2,t.s(["BackEase",0,class extends s{constructor(t=1){super(),this.amplitude=t}easeInCore(t){return Math.pow(t,3)-t*Math.max(0,this.amplitude)*Math.sin(3.141592653589793*t)}},"BezierCurveEase",0,class extends s{constructor(t=0,e=0,s=1,i=1){super(),this.x1=t,this.y1=e,this.x2=s,this.y2=i}easeInCore(t){return e.BezierCurve.Interpolate(t,this.x1,this.y1,this.x2,this.y2)}},"BounceEase",0,class extends s{constructor(t=3,e=2){super(),this.bounces=t,this.bounciness=e}easeInCore(t){let e=Math.max(0,this.bounces),s=this.bounciness;s<=1&&(s=1.001);let i=Math.pow(s,e),n=1-s,r=(1-i)/n+.5*i,o=Math.floor(Math.log(-(t*r)*(1-s)+1)/Math.log(s)),a=(1-Math.pow(s,o))/(n*r),h=(a+(1-Math.pow(s,o+1))/(n*r))*.5,l=t-h,u=h-a;return-Math.pow(1/s,e-o)/(u*u)*(l-u)*(l+u)}},"CircleEase",0,class extends s{easeInCore(t){return 1-Math.sqrt(1-(t=Math.max(0,Math.min(1,t)))*t)}},"CubicEase",0,class extends s{easeInCore(t){return t*t*t}},"EasingFunction",0,s,"ElasticEase",0,class extends s{constructor(t=3,e=3){super(),this.oscillations=t,this.springiness=e}easeInCore(t){let e=Math.max(0,this.oscillations),s=Math.max(0,this.springiness);return(0===s?t:(Math.exp(s*t)-1)/(Math.exp(s)-1))*Math.sin((6.283185307179586*e+1.5707963267948966)*t)}},"ExponentialEase",0,class extends s{constructor(t=2){super(),this.exponent=t}easeInCore(t){return this.exponent<=0?t:(Math.exp(this.exponent*t)-1)/(Math.exp(this.exponent)-1)}}])},62242,t=>{"use strict";var e=t.i(15205),s=t.i(37068),i=t.i(19434),n=t.i(38116);class r extends s.FlowGraphBlock{constructor(t){super(t),this.config=t,this._easingFunctions={},this.mode=this.registerDataInput("mode",i.RichTypeNumber,0),this.controlPoint1=this.registerDataInput("controlPoint1",i.RichTypeVector2),this.controlPoint2=this.registerDataInput("controlPoint2",i.RichTypeVector2),this.easingFunction=this.registerDataOutput("easingFunction",i.RichTypeAny)}_updateOutputs(t){let s=this.mode.getValue(t),i=this.controlPoint1.getValue(t),n=this.controlPoint2.getValue(t);if(void 0===s)return;let r=`${s}-${i.x}-${i.y}-${n.x}-${n.y}`;if(!this._easingFunctions[r]){let t=new e.BezierCurveEase(i.x,i.y,n.x,n.y);t.setEasingMode(s),this._easingFunctions[r]=t}this.easingFunction.setValue(this._easingFunctions[r],t)}getClassName(){return"FlowGraphBezierCurveEasing"}}let o=!1;function a(){o||(o=!0,(0,n.RegisterClass)("FlowGraphBezierCurveEasing",r))}t.s(["FlowGraphBezierCurveEasingBlock",0,r,"RegisterFlowGraphBezierCurveEasingBlock",0,a],45148),a(),t.s([],67079),t.i(67079),t.i(45148),t.s(["FlowGraphBezierCurveEasingBlock",0,r],62242)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,85595,98709,53773,e=>{"use strict";e.s(["__decorate",0,function(e,t,r,i){var f,a=arguments.length,s=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var n=e.length-1;n>=0;n--)(f=e[n])&&(s=(a<3?f(s):a>3?f(t,r,s):f(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s}],85595);let t="__bjs_serializable__",r=new WeakMap;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function f(){let e=Symbol.metadata;return e||Object.defineProperty(Symbol,"metadata",{configurable:!0,writable:!0,value:e=Symbol("Symbol.metadata")}),e}function a(e){return"function"==typeof e?e:e?.constructor}function s(e){let r=function(e){if(e){if(!i(e,f())){let t=Object.getPrototypeOf(e),r=t?t[f()]:null;Object.defineProperty(e,f(),{value:Object.create(r??null),configurable:!0,writable:!0,enumerable:!1})}return e[f()]}}(a(e));return r?(i(r,t)||(r[t]={}),r[t]):{}}function n(e,t){return(r,i)=>{let f=s(r);f[i]||(f[i]={type:e,sourceName:t})}}function u(e,t,r,i){let f=r.value;r.value=(...r)=>{let a=f;if("u">typeof _native&&_native[t]){let e=_native[t];a=i?(...t)=>i(...t)?e(...t):f(...t):e}return e[t]=a,a(...r)}}e.s(["GetDirectStore",0,s,"GetMergedStore",0,function(e){let s=a(e),n=s?s[f()]:void 0;if(!n)return{};let u=r.get(n);if(u)return u;let o={},_=[],h=n;for(;h;)_.push(h),h=Object.getPrototypeOf(h);for(let e of _)if(i(e,t)){let r=e[t];for(let e in r)o[e]=r[e]}return r.set(n,o),o}],98709),u.filter=function(e){return(t,r,i)=>u(t,r,i,e)},e.s(["addAccessorsForMaterialProperty",0,function(e,t=null){return(r,i)=>{Object.defineProperty(r,t||"",{get:function(){return this[i].value},set:function(t){"function"==typeof this[i]?.value?.equals&&this[i].value.equals(t)||this[i].value!==t&&(this[i].value=t,r[e].apply(this))},enumerable:!0,configurable:!0})}},"expandToProperty",0,function(e,t=null){return function(e,t=null){return(r,i)=>{let f=t||"_"+i;Object.defineProperty(r,i,{get:function(){return this[f]},set:function(t){"function"==typeof this[f]?.equals&&this[f].equals(t)||this[f]!==t&&(this[f]=t,r[e].apply(this))},enumerable:!0,configurable:!0})}}(e,t)},"nativeOverride",0,u,"serialize",0,function(e){return n(0,e)},"serializeAsColor3",0,function(e){return n(2,e)},"serializeAsColor4",0,function(e){return n(8,e)},"serializeAsColorCurves",0,function(e){return n(7,e)},"serializeAsFresnelParameters",0,function(e){return n(3,e)},"serializeAsImageProcessingConfiguration",0,function(e){return n(9,e)},"serializeAsMatrix",0,function(e){return n(12,e)},"serializeAsMeshReference",0,function(e){return n(6,e)},"serializeAsQuaternion",0,function(e){return n(10,e)},"serializeAsTexture",0,function(e){return n(1,e)},"serializeAsVector2",0,function(e){return n(4,e)},"serializeAsVector3",0,function(e){return n(5,e)}],53773)},68401,12328,e=>{"use strict";var t=e.i(33945);class r{static Eval(e,t){return"true"===(e=e.match(/\([^()]*\)/g)?e.replace(/\([^()]*\)/g,e=>(e=e.slice(1,e.length-1),r._HandleParenthesisContent(e,t))):r._HandleParenthesisContent(e,t))||"false"!==e&&r.Eval(e,t)}static _HandleParenthesisContent(e,t){let i;t=t||(e=>"true"===e);let f=e.split("||");for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let a=r._SimplifyNegation(f[e].trim()),s=a.split("&&");if(s.length>1)for(let e=0;e<s.length;++e){let f=r._SimplifyNegation(s[e].trim());if(!(i="true"!==f&&"false"!==f?"!"===f[0]?!t(f.substring(1)):t(f):"true"===f)){a="false";break}}if(i||"true"===a){i=!0;break}i="true"!==a&&"false"!==a?"!"===a[0]?!t(a.substring(1)):t(a):"true"===a}return i?"true":"false"}static _SimplifyNegation(e){return"!true"===(e=(e=e.replace(/^[\s!]+/,e=>(e=e.replace(/[\s]/g,()=>"")).length%2?"!":"")).trim())?e="false":"!false"===e&&(e="true"),e}}class i{static EnableFor(e){e._tags=e._tags||{},e.hasTags=()=>i.HasTags(e),e.addTags=t=>i.AddTagsTo(e,t),e.removeTags=t=>i.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>i.MatchesQuery(e,t)}static DisableFor(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery}static HasTags(e){if(!e._tags)return!1;let t=e._tags;for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!0;return!1}static GetTags(e,t=!0){if(!e._tags)return null;if(!t)return e._tags;{let t=[];for(let r in e._tags)Object.prototype.hasOwnProperty.call(e._tags,r)&&!0===e._tags[r]&&t.push(r);return t.join(" ")}}static AddTagsTo(e,t){if(t&&"string"==typeof t)for(let r of t.split(" "))i._AddTagTo(e,r)}static _AddTagTo(e,t){""===(t=t.trim())||"true"===t||"false"===t||t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(i.EnableFor(e),e._tags[t]=!0)}static RemoveTagsFrom(e,t){if(!i.HasTags(e))return;let r=t.split(" ");for(let t in r)i._RemoveTagFrom(e,r[t])}static _RemoveTagFrom(e,t){delete e._tags[t]}static MatchesQuery(e,t){return void 0===t||(""===t?i.HasTags(e):r.Eval(t,t=>i.HasTags(e)&&e._tags[t]))}}e.s(["Tags",0,i],12328);var f=e.i(42580),a=e.i(95410),s=e.i(98709);let n=function(e,t,r,f={}){let a=e();i&&i.HasTags(t)&&i.AddTagsTo(a,i.GetTags(t,!0));let n=(0,s.GetMergedStore)(a),o={};for(let e in n){let i=n[e],s=t[e],_=i.type;if(null!=s&&("uniqueId"!==e||u.AllowLoadingUniqueId))switch(_){case 0:case 6:case 9:case 11:"function"==typeof s.slice?a[e]=s.slice():a[e]=s;break;case 1:f.cloneTexturesOnlyOnce&&o[s.uniqueId]?a[e]=o[s.uniqueId]:(a[e]=r||s.isRenderTarget?s:s.clone(),o[s.uniqueId]=a[e]);break;case 2:case 3:case 4:case 5:case 7:case 8:case 10:case 12:a[e]=r?s:s.clone()}}return a};class u{static AppendSerializedAnimations(e,t){if(e.animations){t.animations=[];for(let r=0;r<e.animations.length;r++){let i=e.animations[r];t.animations.push(i.serialize())}}}static Serialize(e,t){t||(t={}),i&&(t.tags=i.GetTags(e));let r=(0,s.GetMergedStore)(e);for(let i in r){let f=r[i],a=f.sourceName||i,s=f.type,n=e[i];if(null!=n&&("uniqueId"!==i||u.AllowLoadingUniqueId))switch(s){case 0:Array.isArray(n)?t[a]=n.slice():t[a]=n;break;case 1:case 3:case 7:case 9:t[a]=n.serialize();break;case 2:case 4:case 5:case 8:case 10:case 12:t[a]=n.asArray();break;case 6:case 11:t[a]=n.id}}return t}static ParseProperties(e,t,r,i){i||(i="");let n=(0,s.GetMergedStore)(t);for(let s in n){let o=n[s],_=e[o.sourceName||s],h=o.type;if(null!=_&&("uniqueId"!==s||u.AllowLoadingUniqueId))switch(h){case 0:t[s]=_;break;case 1:r&&(t[s]=u._TextureParser(_,r,i));break;case 2:t[s]=f.Color3.FromArray(_);break;case 3:t[s]=u._FresnelParametersParser(_);break;case 4:t[s]=a.Vector2.FromArray(_);break;case 5:t[s]=a.Vector3.FromArray(_);break;case 6:r&&(t[s]=r.getLastMeshById(_));break;case 7:t[s]=u._ColorCurvesParser(_);break;case 8:t[s]=f.Color4.FromArray(_);break;case 9:t[s]=u._ImageProcessingConfigurationParser(_);break;case 10:t[s]=a.Quaternion.FromArray(_);break;case 11:r&&(t[s]=r.getCameraById(_));break;case 12:t[s]=a.Matrix.FromArray(_)}}}static Parse(e,t,r,f=null){let a=e();return i&&i.AddTagsTo(a,t.tags),u.ParseProperties(t,a,r,f),a}static Clone(e,t,r={}){return n(e,t,!1,r)}static Instanciate(e,t){return n(e,t,!0)}}u.AllowLoadingUniqueId=!1,u._ImageProcessingConfigurationParser=e=>{throw(0,t._WarnImport)("ImageProcessingConfiguration")},u._FresnelParametersParser=e=>{throw(0,t._WarnImport)("FresnelParameters")},u._ColorCurvesParser=e=>{throw(0,t._WarnImport)("ColorCurves")},u._TextureParser=(e,r,i)=>{throw(0,t._WarnImport)("Texture")},e.s(["SerializationHelper",0,u],68401)},39695,47283,e=>{"use strict";var t=e.i(80434),r=e.i(13856);class i{constructor(e,t,r=!1,i,f=!1,a){this._uniformNames=[],this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers||f,this._dynamic=r,this._name=i??"no-name",this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._trackUBOsInFrame=!1,(void 0===a&&this._engine._features.trackUbosInFrame||!0===a)&&(this._buffers=[],this._bufferIndex=-1,this._bufferUpdatedLastFrame=!1,this._createBufferOnWrite=!1,this._currentFrameId=0,this._trackUBOsInFrame=!0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateFloatArray=this._updateFloatArrayForEffect,this.updateArray=this._updateArrayForEffect,this.updateIntArray=this._updateIntArrayForEffect,this.updateUIntArray=this._updateUIntArrayForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateMatrices=this._updateMatricesForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect,this.updateDirectColor4=this._updateDirectColor4ForEffect,this.updateInt=this._updateIntForEffect,this.updateInt2=this._updateInt2ForEffect,this.updateInt3=this._updateInt3ForEffect,this.updateInt4=this._updateInt4ForEffect,this.updateUInt=this._updateUIntForEffect,this.updateUInt2=this._updateUInt2ForEffect,this.updateUInt3=this._updateUInt3ForEffect,this.updateUInt4=this._updateUInt4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateFloatArray=this._updateFloatArrayForUniform,this.updateArray=this._updateArrayForUniform,this.updateIntArray=this._updateIntArrayForUniform,this.updateUIntArray=this._updateUIntArrayForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateMatrices=this._updateMatricesForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform,this.updateDirectColor4=this._updateDirectColor4ForUniform,this.updateInt=this._updateIntForUniform,this.updateInt2=this._updateInt2ForUniform,this.updateInt3=this._updateInt3ForUniform,this.updateInt4=this._updateInt4ForUniform,this.updateUInt=this._updateUIntForUniform,this.updateUInt2=this._updateUInt2ForUniform,this.updateUInt3=this._updateUInt3ForUniform,this.updateUInt4=this._updateUInt4ForUniform)}get useUbo(){return!this._noUBO}get isSync(){return!this._needSync}isDynamic(){return this._dynamic}getData(){return this._bufferData}getBuffer(){return this._buffer}getUniformNames(){return this._uniformNames}_fillAlignment(e){let t;if(t=e<=2?e:4,this._uniformLocationPointer%t!=0){let e=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;let r=this._uniformLocationPointer-e;for(let e=0;e<r;e++)this._data.push(0)}}addUniform(e,t,r=0){let i;if((r>0&&"number"==typeof t&&(this._uniformArraySizes[e]={strideSize:t,arraySize:r}),void 0===this._uniformLocations[e])&&(this._uniformNames.push(e),!this._noUBO)){if(r>0){if(t instanceof Array)throw"addUniform should not be use with Array in UBO: "+e;if(this._fillAlignment(4),16==t)t*=r;else{let e=4-t;t=t*r+e*r}i=[];for(let e=0;e<t;e++)i.push(0)}else{if(t instanceof Array)t=(i=t).length;else{i=[];for(let e=0;e<t;e++)i.push(0)}this._fillAlignment(t)}this._uniformSizes[e]=t,this._uniformLocations[e]=this._uniformLocationPointer,this._uniformLocationPointer+=t;for(let e=0;e<t;e++)this._data.push(i[e]);this._needSync=!0}}addMatrix(e,t){this.addUniform(e,Array.prototype.slice.call(t.asArray()))}addFloat2(e,t,r){this.addUniform(e,[t,r])}addFloat3(e,t,r,i){this.addUniform(e,[t,r,i])}addColor3(e,t){let r=[t.r,t.g,t.b];this.addUniform(e,r)}addColor4(e,t,r){let i=[t.r,t.g,t.b,r];this.addUniform(e,i)}addVector3(e,t){let r=[t.x,t.y,t.z];this.addUniform(e,r)}addMatrix3x3(e){this.addUniform(e,12)}addMatrix2x2(e){this.addUniform(e,8)}create(){this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)}_getNamesDebug(){let e=[],t=0;for(let r in this._uniformLocations)if(e.push(r),10==++t)break;return e.join(",")}_rebuild(){!this._noUBO&&this._bufferData&&(this._dynamic?this._buffer=this._engine.createDynamicUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()):this._buffer=this._engine.createUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()),this._trackUBOsInFrame&&(this._buffers.push([this._buffer,this._engine._features.checkUbosContentBeforeUpload?this._bufferData.slice():void 0]),this._bufferIndex=this._buffers.length-1,this._createBufferOnWrite=!1))}_rebuildAfterContextLost(){this._trackUBOsInFrame&&(this._buffers=[],this._currentFrameId=0),this._rebuild()}get _numBuffers(){return this._buffers.length}get _indexBuffer(){return this._bufferIndex}get name(){return this._name}set name(e){this._name=e}get currentEffect(){return this._currentEffect}_buffersEqual(e,t){for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}_copyBuffer(e,t){for(let r=0;r<e.length;++r)t[r]=e[r]}update(){if(!this._noUBO){if(this.bindUniformBuffer(),!this._buffer)return void this.create();if(!this._dynamic&&!this._needSync){this._createBufferOnWrite=this._trackUBOsInFrame;return}if(this._buffers&&this._buffers.length>1&&this._buffers[this._bufferIndex][1])if(this._buffersEqual(this._bufferData,this._buffers[this._bufferIndex][1])){this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame;return}else this._copyBuffer(this._bufferData,this._buffers[this._bufferIndex][1]);this._bufferUpdatedLastFrame=!0,this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame}}_createNewBuffer(){this._bufferIndex+1<this._buffers.length?(this._bufferIndex++,this._buffer=this._buffers[this._bufferIndex][0],this._createBufferOnWrite=!1,this._needSync=!0):this._rebuild()}_checkNewFrame(){this._trackUBOsInFrame&&this._currentFrameId!==this._engine.frameId&&(this._currentFrameId=this._engine.frameId,this._createBufferOnWrite=!1,this._buffers&&this._buffers.length>0?(1===this._buffers.length?this._needSync=!this._bufferUpdatedLastFrame:this._needSync=0!==this._bufferIndex,this._bufferIndex=0,this._buffer=this._buffers[this._bufferIndex][0]):this._bufferIndex=-1)}updateUniform(e,r,i){this._checkNewFrame();let f=this._uniformLocations[e];if(void 0===f){if(this._buffer)return void t.Logger.Error("Cannot add an uniform after UBO has been created. uniformName="+e);this.addUniform(e,i),f=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(let e=0;e<i;e++)this._bufferData[f+e]=r[e];else{let e=!1;for(let t=0;t<i;t++)(16!==i||this._engine._features.uniformBufferHardCheckMatrix)&&this._bufferData[f+t]===Math.fround(r[t])||(e=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[f+t]=r[t]);this._needSync=this._needSync||e}}updateUniformArray(e,i,f){this._checkNewFrame();let a=this._uniformLocations[e];if(void 0===a)return void t.Logger.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");this._buffer||this.create();let s=this._uniformArraySizes[e];if(this._dynamic)for(let e=0;e<f;e++)this._bufferData[a+e]=i[e];else{let e=!1,t=0,n=0;for(let u=0;u<f;u++)if(this._bufferData[a+4*n+t]!==r.Tools.FloatRound(i[u])&&(e=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[a+4*n+t]=i[u]),++t===s.strideSize){for(;t<4;t++)this._bufferData[a+4*n+t]=0;t=0,n++}this._needSync=this._needSync||e}}_cacheMatrix(e,t){this._checkNewFrame();let r=this._valueCache[e],i=t.updateFlag;return(void 0===r||r!==i)&&(this._valueCache[e]=i,!0)}_updateMatrix3x3ForUniform(e,t){for(let e=0;e<3;e++)i._TempBuffer[4*e]=t[3*e],i._TempBuffer[4*e+1]=t[3*e+1],i._TempBuffer[4*e+2]=t[3*e+2],i._TempBuffer[4*e+3]=0;this.updateUniform(e,i._TempBuffer,12)}_updateMatrix3x3ForEffect(e,t){this._currentEffect.setMatrix3x3(e,t)}_updateMatrix2x2ForEffect(e,t){this._currentEffect.setMatrix2x2(e,t)}_updateMatrix2x2ForUniform(e,t){for(let e=0;e<2;e++)i._TempBuffer[4*e]=t[2*e],i._TempBuffer[4*e+1]=t[2*e+1],i._TempBuffer[4*e+2]=0,i._TempBuffer[4*e+3]=0;this.updateUniform(e,i._TempBuffer,8)}_updateFloatForEffect(e,t,r=""){this._currentEffect.setFloat(e+r,t)}_updateFloatForUniform(e,t){i._TempBuffer[0]=t,this.updateUniform(e,i._TempBuffer,1)}_updateFloat2ForEffect(e,t,r,i=""){this._currentEffect.setFloat2(e+i,t,r)}_updateFloat2ForUniform(e,t,r){i._TempBuffer[0]=t,i._TempBuffer[1]=r,this.updateUniform(e,i._TempBuffer,2)}_updateFloat3ForEffect(e,t,r,i,f=""){this._currentEffect.setFloat3(e+f,t,r,i)}_updateFloat3ForUniform(e,t,r,f){i._TempBuffer[0]=t,i._TempBuffer[1]=r,i._TempBuffer[2]=f,this.updateUniform(e,i._TempBuffer,3)}_updateFloat4ForEffect(e,t,r,i,f,a=""){this._currentEffect.setFloat4(e+a,t,r,i,f)}_updateFloat4ForUniform(e,t,r,f,a){i._TempBuffer[0]=t,i._TempBuffer[1]=r,i._TempBuffer[2]=f,i._TempBuffer[3]=a,this.updateUniform(e,i._TempBuffer,4)}_updateFloatArrayForEffect(e,t,r=""){switch(this._uniformArraySizes[e]?.strideSize){case 2:this._currentEffect.setFloatArray2(e+r,t);break;case 3:this._currentEffect.setFloatArray3(e+r,t);break;case 4:this._currentEffect.setFloatArray4(e+r,t);break;default:this._currentEffect.setFloatArray(e+r,t)}}_updateFloatArrayForUniform(e,t){this.updateUniformArray(e,t,t.length)}_updateArrayForEffect(e,t){this._currentEffect.setArray(e,t)}_updateArrayForUniform(e,t){this.updateUniformArray(e,t,t.length)}_updateIntArrayForEffect(e,t){this._currentEffect.setIntArray(e,t)}_updateIntArrayForUniform(e,t){i._TempBufferInt32View.set(t),this.updateUniformArray(e,i._TempBuffer,t.length)}_updateUIntArrayForEffect(e,t){this._currentEffect.setUIntArray(e,t)}_updateUIntArrayForUniform(e,t){i._TempBufferUInt32View.set(t),this.updateUniformArray(e,i._TempBuffer,t.length)}_updateMatrixForEffect(e,t){this._currentEffect.setMatrix(e,t)}_updateMatrixForUniform(e,t){this._cacheMatrix(e,t)&&this.updateUniform(e,t.asArray(),16)}_updateMatricesForEffect(e,t){this._currentEffect.setMatrices(e,t)}_updateMatricesForUniform(e,t){this.updateUniform(e,t,t.length)}_updateVector3ForEffect(e,t){this._currentEffect.setVector3(e,t)}_updateVector3ForUniform(e,t){i._TempBuffer[0]=t.x,i._TempBuffer[1]=t.y,i._TempBuffer[2]=t.z,this.updateUniform(e,i._TempBuffer,3)}_updateVector4ForEffect(e,t){this._currentEffect.setVector4(e,t)}_updateVector4ForUniform(e,t){i._TempBuffer[0]=t.x,i._TempBuffer[1]=t.y,i._TempBuffer[2]=t.z,i._TempBuffer[3]=t.w,this.updateUniform(e,i._TempBuffer,4)}_updateColor3ForEffect(e,t,r=""){this._currentEffect.setColor3(e+r,t)}_updateColor3ForUniform(e,t){i._TempBuffer[0]=t.r,i._TempBuffer[1]=t.g,i._TempBuffer[2]=t.b,this.updateUniform(e,i._TempBuffer,3)}_updateColor4ForEffect(e,t,r,i=""){this._currentEffect.setColor4(e+i,t,r)}_updateDirectColor4ForEffect(e,t,r=""){this._currentEffect.setDirectColor4(e+r,t)}_updateColor4ForUniform(e,t,r){i._TempBuffer[0]=t.r,i._TempBuffer[1]=t.g,i._TempBuffer[2]=t.b,i._TempBuffer[3]=r,this.updateUniform(e,i._TempBuffer,4)}_updateDirectColor4ForUniform(e,t){i._TempBuffer[0]=t.r,i._TempBuffer[1]=t.g,i._TempBuffer[2]=t.b,i._TempBuffer[3]=t.a,this.updateUniform(e,i._TempBuffer,4)}_updateIntForEffect(e,t,r=""){this._currentEffect.setInt(e+r,t)}_updateIntForUniform(e,t){i._TempBufferInt32View[0]=t,this.updateUniform(e,i._TempBuffer,1)}_updateInt2ForEffect(e,t,r,i=""){this._currentEffect.setInt2(e+i,t,r)}_updateInt2ForUniform(e,t,r){i._TempBufferInt32View[0]=t,i._TempBufferInt32View[1]=r,this.updateUniform(e,i._TempBuffer,2)}_updateInt3ForEffect(e,t,r,i,f=""){this._currentEffect.setInt3(e+f,t,r,i)}_updateInt3ForUniform(e,t,r,f){i._TempBufferInt32View[0]=t,i._TempBufferInt32View[1]=r,i._TempBufferInt32View[2]=f,this.updateUniform(e,i._TempBuffer,3)}_updateInt4ForEffect(e,t,r,i,f,a=""){this._currentEffect.setInt4(e+a,t,r,i,f)}_updateInt4ForUniform(e,t,r,f,a){i._TempBufferInt32View[0]=t,i._TempBufferInt32View[1]=r,i._TempBufferInt32View[2]=f,i._TempBufferInt32View[3]=a,this.updateUniform(e,i._TempBuffer,4)}_updateUIntForEffect(e,t,r=""){this._currentEffect.setUInt(e+r,t)}_updateUIntForUniform(e,t){i._TempBufferUInt32View[0]=t,this.updateUniform(e,i._TempBuffer,1)}_updateUInt2ForEffect(e,t,r,i=""){this._currentEffect.setUInt2(e+i,t,r)}_updateUInt2ForUniform(e,t,r){i._TempBufferUInt32View[0]=t,i._TempBufferUInt32View[1]=r,this.updateUniform(e,i._TempBuffer,2)}_updateUInt3ForEffect(e,t,r,i,f=""){this._currentEffect.setUInt3(e+f,t,r,i)}_updateUInt3ForUniform(e,t,r,f){i._TempBufferUInt32View[0]=t,i._TempBufferUInt32View[1]=r,i._TempBufferUInt32View[2]=f,this.updateUniform(e,i._TempBuffer,3)}_updateUInt4ForEffect(e,t,r,i,f,a=""){this._currentEffect.setUInt4(e+a,t,r,i,f)}_updateUInt4ForUniform(e,t,r,f,a){i._TempBufferUInt32View[0]=t,i._TempBufferUInt32View[1]=r,i._TempBufferUInt32View[2]=f,i._TempBufferUInt32View[3]=a,this.updateUniform(e,i._TempBuffer,4)}setTexture(e,t){this._currentEffect.setTexture(e,t)}setTextureArray(e,t){this._currentEffect.setTextureArray(e,t)}bindTexture(e,t){this._currentEffect._bindTexture(e,t)}updateUniformDirectly(e,t){this.updateUniform(e,t,t.length),this.update()}bindToEffect(e,t){this._currentEffect=e,this._currentEffectName=t}bindUniformBuffer(){!this._noUBO&&this._buffer&&this._currentEffect&&this._currentEffect.bindUniformBuffer(this._buffer,this._currentEffectName)}unbindEffect(){this._currentEffect=void 0,this._currentEffectName=void 0}setDataBuffer(e){if(!this._buffers)return this._buffer===e;for(let t=0;t<this._buffers.length;++t)if(this._buffers[t][0]===e)return this._bufferIndex=t,this._buffer=e,this._createBufferOnWrite=!1,this._currentEffect=void 0,this._buffers.length>1&&this._buffers[t][1]&&this._bufferData.set(this._buffers[t][1]),this._valueCache={},this._currentFrameId=this._engine.frameId,!0;return!1}has(e){return void 0!==this._uniformLocations[e]}dispose(){if(this._noUBO)return;let e=this._engine._uniformBuffers,t=e.indexOf(this);if(-1!==t&&(e[t]=e[e.length-1],e.pop()),this._trackUBOsInFrame&&this._buffers)for(let e=0;e<this._buffers.length;++e){let t=this._buffers[e][0];this._engine._releaseBuffer(t)}else this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}}i._MAX_UNIFORM_SIZE=256,i._TempBuffer=new Float32Array(i._MAX_UNIFORM_SIZE),i._TempBufferInt32View=new Int32Array(i._TempBuffer.buffer),i._TempBufferUInt32View=new Uint32Array(i._TempBuffer.buffer),e.s(["UniformBuffer",0,i],39695);class f{static CompareLightsPriority(e,t){return e.shadowEnabled!==t.shadowEnabled?!!t.shadowEnabled-!!e.shadowEnabled:t.renderPriority-e.renderPriority}}f.FALLOFF_DEFAULT=0,f.FALLOFF_PHYSICAL=1,f.FALLOFF_GLTF=2,f.FALLOFF_STANDARD=3,f.LIGHTMAP_DEFAULT=0,f.LIGHTMAP_SPECULAR=1,f.LIGHTMAP_SHADOWSONLY=2,f.INTENSITYMODE_AUTOMATIC=0,f.INTENSITYMODE_LUMINOUSPOWER=1,f.INTENSITYMODE_LUMINOUSINTENSITY=2,f.INTENSITYMODE_ILLUMINANCE=3,f.INTENSITYMODE_LUMINANCE=4,f.LIGHTTYPEID_POINTLIGHT=0,f.LIGHTTYPEID_DIRECTIONALLIGHT=1,f.LIGHTTYPEID_SPOTLIGHT=2,f.LIGHTTYPEID_HEMISPHERICLIGHT=3,f.LIGHTTYPEID_RECT_AREALIGHT=4,f.LIGHTTYPEID_CLUSTERED_CONTAINER=5,e.s(["LightConstants",0,f],47283)}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87027,e=>{"use strict";var r=e.i(37875);let o="helperFunctions",a=`const float PI=3.1415926535897932384626433832795;const float TWO_PI=6.283185307179586;const float HALF_PI=1.5707963267948966;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float RECIPROCAL_PI4=0.07957747154594767;const float HALF_MIN=5.96046448e-08;
|
|
2
2
|
const float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001;
|
|
3
3
|
#define saturate(x) clamp(x,0.0,1.0)
|
|
4
4
|
#define absEps(x) abs(x)+Epsilon
|
|
@@ -116,7 +116,7 @@ float uint2float(uint i) {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}
|
|
|
116
116
|
vec2 plasticSequence(const uint rstate) {return vec2(uint2float(rstate*3242174889u),
|
|
117
117
|
uint2float(rstate*2447445414u));}
|
|
118
118
|
#endif
|
|
119
|
-
`;r.ShaderStore.IncludesShadersStore[o]||(r.ShaderStore.IncludesShadersStore[o]=a),e.s(["helperFunctions",0,{name:o,shader:a}])},
|
|
119
|
+
`;r.ShaderStore.IncludesShadersStore[o]||(r.ShaderStore.IncludesShadersStore[o]=a),e.s(["helperFunctions",0,{name:o,shader:a}])},86965,e=>{"use strict";var r=e.i(37875),o=e.i(87027);let a="rgbdEncodePixelShader",t=`varying vec2 vUV;uniform sampler2D textureSampler;
|
|
120
120
|
#include<helperFunctions>
|
|
121
121
|
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
122
122
|
void main(void)
|