trillion3d 1.0.2 → 1.0.3-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pageWorker.js +1 -1
- package/dist/pageWorker.js.map +2 -2
- package/dist/sdk-browser/src/geometry/cluster/shippedBytes.d.ts +15 -4
- package/dist/sdk-browser/src/geometry/cluster/shippedBytes.js +56 -7
- package/dist/sdk-browser/src/gpu/noise/blueNoise.bin.js +1 -0
- package/dist/sdk-browser/src/gpu/noise/blueNoiseSource.js +6 -2
- package/dist/sdk-browser/src/lighting/direct/skinTable.bin.js +1 -0
- package/dist/sdk-browser/src/lighting/direct/skinTableSource.js +5 -2
- package/dist/sdk-browser/src/measurement/buildProvenance.js +1 -1
- package/dist/sdk-browser/src/wasm/kernels.wasm.js +1 -0
- package/dist/sdk-browser/src/wasm/sdkWasm.d.ts +4 -3
- package/dist/sdk-browser/src/wasm/sdkWasm.js +9 -5
- package/dist/sdk-core/src/contracts/base.js +1 -1
- package/dist/sdk-node/src/cli/cli.mjs +0 -0
- package/dist/trillion3d-aoCode-2JTKFXZ5.js +489 -0
- package/dist/trillion3d-assemblies-BENCUAG3.js +2 -0
- package/dist/trillion3d-audioCode-M3I6FF7A.js +2 -0
- package/dist/trillion3d-autoExposureCode-AQ3IV5LH.js +198 -0
- package/dist/trillion3d-avatarCode-RTIDGTIA.js +2 -0
- package/dist/trillion3d-bounceCode-GEAWSI3A.js +4675 -0
- package/dist/trillion3d-catalogueCode-KZ3X7U7G.js +2 -0
- package/dist/trillion3d-chunk-22KA6FS4.js +116 -0
- package/dist/trillion3d-chunk-25B7I4D5.js +177 -0
- package/dist/trillion3d-chunk-2D7RBB5X.js +132 -0
- package/dist/trillion3d-chunk-2EJ4CRNA.js +46 -0
- package/dist/trillion3d-chunk-2PKPG2QJ.js +519 -0
- package/dist/trillion3d-chunk-2YXWLU7F.js +2 -0
- package/dist/trillion3d-chunk-2ZIQ3EEG.js +12 -0
- package/dist/trillion3d-chunk-33J4ZHIV.js +113 -0
- package/dist/trillion3d-chunk-3CTKK6Y4.js +14 -0
- package/dist/trillion3d-chunk-3F65K5TK.js +2 -0
- package/dist/trillion3d-chunk-3IRHFCKO.js +2 -0
- package/dist/trillion3d-chunk-3OWQBLPF.js +2 -0
- package/dist/trillion3d-chunk-3QKVCESS.js +2 -0
- package/dist/trillion3d-chunk-3TG7TWTW.js +56 -0
- package/dist/trillion3d-chunk-3UAK2IRC.js +91 -0
- package/dist/trillion3d-chunk-3VO6VVHD.js +4 -0
- package/dist/trillion3d-chunk-3W3YJ4KI.js +4 -0
- package/dist/trillion3d-chunk-3XBFYA3P.js +2 -0
- package/dist/trillion3d-chunk-435NEAXB.js +2 -0
- package/dist/trillion3d-chunk-4JYI3X5D.js +2 -0
- package/dist/trillion3d-chunk-4KEDPBE4.js +2 -0
- package/dist/trillion3d-chunk-4KWKWEQL.js +26 -0
- package/dist/trillion3d-chunk-4Z6VA66T.js +303 -0
- package/dist/trillion3d-chunk-5243PXB7.js +2 -0
- package/dist/trillion3d-chunk-53CFT7G7.js +2 -0
- package/dist/trillion3d-chunk-53QFLAA3.js +16 -0
- package/dist/trillion3d-chunk-56N6ZOBE.js +2 -0
- package/dist/trillion3d-chunk-5E744XXD.js +17 -0
- package/dist/trillion3d-chunk-5KEW2ZOY.js +2 -0
- package/dist/trillion3d-chunk-5ORGGJA5.js +2 -0
- package/dist/trillion3d-chunk-5RMOZCQA.js +2 -0
- package/dist/trillion3d-chunk-5SJT7EQ3.js +2 -0
- package/dist/trillion3d-chunk-5TTX63XG.js +24 -0
- package/dist/trillion3d-chunk-5WEWDH7F.js +2 -0
- package/dist/trillion3d-chunk-64WTBYW5.js +328 -0
- package/dist/trillion3d-chunk-6I7I5ZYU.js +2 -0
- package/dist/trillion3d-chunk-6OYOGQUQ.js +172 -0
- package/dist/trillion3d-chunk-6PMAMKLI.js +2 -0
- package/dist/trillion3d-chunk-6S7S5WI5.js +2 -0
- package/dist/trillion3d-chunk-6UP3ZCNV.js +2 -0
- package/dist/trillion3d-chunk-6WOJ6TQD.js +2 -0
- package/dist/trillion3d-chunk-6WS2EEBU.js +86 -0
- package/dist/trillion3d-chunk-6WUY2OOX.js +68 -0
- package/dist/trillion3d-chunk-72FCWPUJ.js +2 -0
- package/dist/trillion3d-chunk-72IAEP44.js +2 -0
- package/dist/trillion3d-chunk-77FPYTBQ.js +2 -0
- package/dist/trillion3d-chunk-7AQANLZ3.js +2 -0
- package/dist/trillion3d-chunk-7ATTJ3AJ.js +27 -0
- package/dist/trillion3d-chunk-7G4WOX6B.js +583 -0
- package/dist/trillion3d-chunk-7LIWCQGR.js +2 -0
- package/dist/trillion3d-chunk-7N3FUKOD.js +155 -0
- package/dist/trillion3d-chunk-7QFOJHAZ.js +435 -0
- package/dist/trillion3d-chunk-7TIVZUM6.js +81 -0
- package/dist/trillion3d-chunk-7U7CHALH.js +2 -0
- package/dist/trillion3d-chunk-7UXM26LW.js +2 -0
- package/dist/trillion3d-chunk-7VTYT5MF.js +2 -0
- package/dist/trillion3d-chunk-A4ULELL5.js +2 -0
- package/dist/trillion3d-chunk-ADMXPAEH.js +592 -0
- package/dist/trillion3d-chunk-AFRFQ25D.js +9 -0
- package/dist/trillion3d-chunk-AIB6NXH4.js +2 -0
- package/dist/trillion3d-chunk-AIQAWNNP.js +11 -0
- package/dist/trillion3d-chunk-AMJ6I7P4.js +11 -0
- package/dist/trillion3d-chunk-AQAJMS5A.js +2 -0
- package/dist/trillion3d-chunk-ARDABN2G.js +165 -0
- package/dist/trillion3d-chunk-B3QB55EK.js +2 -0
- package/dist/trillion3d-chunk-B5NXEPES.js +2 -0
- package/dist/trillion3d-chunk-BARQSI5Q.js +2 -0
- package/dist/trillion3d-chunk-BCYA7LWA.js +2 -0
- package/dist/trillion3d-chunk-BIBJMHIN.js +125 -0
- package/dist/trillion3d-chunk-BIGALHRE.js +2 -0
- package/dist/trillion3d-chunk-BKON7HDQ.js +6 -0
- package/dist/trillion3d-chunk-BRHXHYWB.js +2 -0
- package/dist/trillion3d-chunk-BVXHXONN.js +2 -0
- package/dist/trillion3d-chunk-BWPZMIFY.js +4 -0
- package/dist/trillion3d-chunk-C2WWWTMZ.js +2 -0
- package/dist/trillion3d-chunk-C7DCG2NV.js +2 -0
- package/dist/trillion3d-chunk-CCZJZMRJ.js +2 -0
- package/dist/trillion3d-chunk-CFIW2PLU.js +76 -0
- package/dist/trillion3d-chunk-CH3UKBVF.js +6 -0
- package/dist/trillion3d-chunk-COAMUWUG.js +6 -0
- package/dist/trillion3d-chunk-CS3EWLHS.js +2 -0
- package/dist/trillion3d-chunk-CS6MYZM7.js +42 -0
- package/dist/trillion3d-chunk-CSVCHCKI.js +2 -0
- package/dist/trillion3d-chunk-CYW43B6C.js +1615 -0
- package/dist/trillion3d-chunk-D2UJO22L.js +2 -0
- package/dist/trillion3d-chunk-D5LNZFJU.js +2 -0
- package/dist/trillion3d-chunk-DJIWKT4L.js +217 -0
- package/dist/trillion3d-chunk-DNAAW2B5.js +2 -0
- package/dist/trillion3d-chunk-DOXBXQJU.js +2 -0
- package/dist/trillion3d-chunk-DQVEKWHY.js +46 -0
- package/dist/trillion3d-chunk-DQYIKRAI.js +77 -0
- package/dist/trillion3d-chunk-DX5UNL5O.js +2 -0
- package/dist/trillion3d-chunk-EF6DURKO.js +19 -0
- package/dist/trillion3d-chunk-EKH44M5H.js +438 -0
- package/dist/trillion3d-chunk-EKHMHUHO.js +2 -0
- package/dist/trillion3d-chunk-EKMPAWJU.js +2 -0
- package/dist/trillion3d-chunk-ELCIIOBC.js +2 -0
- package/dist/trillion3d-chunk-EME34J3O.js +2 -0
- package/dist/trillion3d-chunk-EMNL3VBH.js +17 -0
- package/dist/trillion3d-chunk-EOA6RIXX.js +2 -0
- package/dist/trillion3d-chunk-ESEYMHSX.js +2 -0
- package/dist/trillion3d-chunk-EVWXSXV3.js +2 -0
- package/dist/trillion3d-chunk-EW3266JI.js +2 -0
- package/dist/trillion3d-chunk-F5ZFHT7O.js +2 -0
- package/dist/trillion3d-chunk-FBPHTYO3.js +2 -0
- package/dist/trillion3d-chunk-FCITXHHL.js +2 -0
- package/dist/trillion3d-chunk-FG4VFY2I.js +2 -0
- package/dist/trillion3d-chunk-FJ6PAVLE.js +178 -0
- package/dist/trillion3d-chunk-FNZKGTZC.js +2 -0
- package/dist/trillion3d-chunk-FVKZE7SE.js +1953 -0
- package/dist/trillion3d-chunk-FXEJM7VG.js +2 -0
- package/dist/trillion3d-chunk-FYXZW5DA.js +13 -0
- package/dist/trillion3d-chunk-G3DRTVHN.js +988 -0
- package/dist/trillion3d-chunk-G4AJOGQ7.js +265 -0
- package/dist/trillion3d-chunk-GEI5JB66.js +20 -0
- package/dist/trillion3d-chunk-GHFAPXBM.js +2 -0
- package/dist/trillion3d-chunk-GI2T6FOU.js +184 -0
- package/dist/trillion3d-chunk-GJZNN5UJ.js +2 -0
- package/dist/trillion3d-chunk-GK2DII6G.js +27 -0
- package/dist/trillion3d-chunk-GPVAVLAF.js +2 -0
- package/dist/trillion3d-chunk-GTR23Z5K.js +2 -0
- package/dist/trillion3d-chunk-GVOSTFBW.js +59 -0
- package/dist/trillion3d-chunk-GYORYIF5.js +2 -0
- package/dist/trillion3d-chunk-H3DVML7I.js +2 -0
- package/dist/trillion3d-chunk-H7KLPWI5.js +2 -0
- package/dist/trillion3d-chunk-H7LQGPKQ.js +50 -0
- package/dist/trillion3d-chunk-HBJ6VZPO.js +10 -0
- package/dist/trillion3d-chunk-HBMBGWN2.js +19 -0
- package/dist/trillion3d-chunk-HBSLKLSZ.js +94 -0
- package/dist/trillion3d-chunk-HCG3ESSV.js +2 -0
- package/dist/trillion3d-chunk-HDQGK2TL.js +2 -0
- package/dist/trillion3d-chunk-HRCLDXIF.js +35 -0
- package/dist/trillion3d-chunk-HRIARS44.js +2 -0
- package/dist/trillion3d-chunk-HV2YN5CF.js +2 -0
- package/dist/trillion3d-chunk-I5M3F6OY.js +6 -0
- package/dist/trillion3d-chunk-I75EGJAB.js +2 -0
- package/dist/trillion3d-chunk-I7QRTDI7.js +125 -0
- package/dist/trillion3d-chunk-IAELZYJF.js +2 -0
- package/dist/trillion3d-chunk-ICJUDIVR.js +276 -0
- package/dist/trillion3d-chunk-IEYEFEDV.js +2 -0
- package/dist/trillion3d-chunk-IFLJYROA.js +2 -0
- package/dist/trillion3d-chunk-IFZHDHIG.js +104 -0
- package/dist/trillion3d-chunk-IHNPAPHM.js +74 -0
- package/dist/trillion3d-chunk-IJJXMYSL.js +2 -0
- package/dist/trillion3d-chunk-IJMFDLYO.js +2 -0
- package/dist/trillion3d-chunk-INTWD5DJ.js +35 -0
- package/dist/trillion3d-chunk-IWP6655A.js +2 -0
- package/dist/trillion3d-chunk-IZTRWVNI.js +771 -0
- package/dist/trillion3d-chunk-J2BIHJ55.js +2 -0
- package/dist/trillion3d-chunk-J3NX2PWF.js +54 -0
- package/dist/trillion3d-chunk-J6G75W5Q.js +45 -0
- package/dist/trillion3d-chunk-J7ML34IT.js +2 -0
- package/dist/trillion3d-chunk-JD25N5D6.js +59 -0
- package/dist/trillion3d-chunk-JDIIZKDU.js +2 -0
- package/dist/trillion3d-chunk-JHRQF53B.js +4 -0
- package/dist/trillion3d-chunk-JPN76QOL.js +2 -0
- package/dist/trillion3d-chunk-JRCGXELE.js +2 -0
- package/dist/trillion3d-chunk-JXIMDH6A.js +2 -0
- package/dist/trillion3d-chunk-K6R7UEQZ.js +27 -0
- package/dist/trillion3d-chunk-K72UANQN.js +2 -0
- package/dist/trillion3d-chunk-KKECIVIP.js +2 -0
- package/dist/trillion3d-chunk-KLGN5XV3.js +2 -0
- package/dist/trillion3d-chunk-KLIGAVUH.js +2 -0
- package/dist/trillion3d-chunk-KLP7IBDS.js +2 -0
- package/dist/trillion3d-chunk-KPFGILKK.js +285 -0
- package/dist/trillion3d-chunk-KR4PIU6F.js +2 -0
- package/dist/trillion3d-chunk-KRV5VQCR.js +4 -0
- package/dist/trillion3d-chunk-KUJMOLHB.js +2 -0
- package/dist/trillion3d-chunk-KUKNVBWH.js +167 -0
- package/dist/trillion3d-chunk-KXM3DYQH.js +2 -0
- package/dist/trillion3d-chunk-L2F5RZRX.js +2 -0
- package/dist/trillion3d-chunk-L2FRHLXI.js +18 -0
- package/dist/trillion3d-chunk-L3VCBYGD.js +2 -0
- package/dist/trillion3d-chunk-LAAPTFVW.js +2 -0
- package/dist/trillion3d-chunk-LANLTCBQ.js +607 -0
- package/dist/trillion3d-chunk-LE4HL44Z.js +2 -0
- package/dist/trillion3d-chunk-LEY2Q6DZ.js +188 -0
- package/dist/trillion3d-chunk-LMWJTQFR.js +2 -0
- package/dist/trillion3d-chunk-LQLIXMMD.js +400 -0
- package/dist/trillion3d-chunk-LTWG3NOL.js +2 -0
- package/dist/trillion3d-chunk-M773YMP6.js +2 -0
- package/dist/trillion3d-chunk-MAKYPLYF.js +13 -0
- package/dist/trillion3d-chunk-MCNOP7UR.js +2 -0
- package/dist/trillion3d-chunk-MCSS3F6E.js +40 -0
- package/dist/trillion3d-chunk-MF4CAU3R.js +2 -0
- package/dist/trillion3d-chunk-MJTRABFR.js +242 -0
- package/dist/trillion3d-chunk-MQBDHCB3.js +2 -0
- package/dist/trillion3d-chunk-MUMQYHCQ.js +82 -0
- package/dist/trillion3d-chunk-MXZGFCOM.js +1166 -0
- package/dist/trillion3d-chunk-N33FXDXZ.js +2 -0
- package/dist/trillion3d-chunk-N7EXMVTQ.js +756 -0
- package/dist/trillion3d-chunk-N7EXMVTQ.js.map +6 -0
- package/dist/trillion3d-chunk-N7YEU2CT.js +2 -0
- package/dist/trillion3d-chunk-NB7XML37.js +2 -0
- package/dist/trillion3d-chunk-NBFOHDNN.js +2 -0
- package/dist/trillion3d-chunk-NEVMYKGT.js +28 -0
- package/dist/trillion3d-chunk-NHC4DXYP.js +2 -0
- package/dist/trillion3d-chunk-NNF42O54.js +197 -0
- package/dist/trillion3d-chunk-NTHEHPA5.js +418 -0
- package/dist/trillion3d-chunk-NVYEQ3JS.js +40 -0
- package/dist/trillion3d-chunk-NZRMWUGY.js +3109 -0
- package/dist/trillion3d-chunk-OD3JBU6D.js +5 -0
- package/dist/trillion3d-chunk-OFCF3GAC.js +360 -0
- package/dist/trillion3d-chunk-OHFYUKAD.js +2 -0
- package/dist/trillion3d-chunk-OHTUNWUN.js +2 -0
- package/dist/trillion3d-chunk-OLDTBAXR.js +2537 -0
- package/dist/trillion3d-chunk-OYZFVYYH.js +107 -0
- package/dist/trillion3d-chunk-P35JRX3H.js +2 -0
- package/dist/trillion3d-chunk-P3HTLS2O.js +2 -0
- package/dist/trillion3d-chunk-P7UZ7W2B.js +377 -0
- package/dist/trillion3d-chunk-PDWU4CCX.js +2 -0
- package/dist/trillion3d-chunk-PFMAOUBW.js +70 -0
- package/dist/trillion3d-chunk-PHE5OKAE.js +277 -0
- package/dist/trillion3d-chunk-PJN3TXFS.js +14 -0
- package/dist/trillion3d-chunk-PJN3TXFS.js.map +6 -0
- package/dist/trillion3d-chunk-PMF6JTVJ.js +2 -0
- package/dist/trillion3d-chunk-PXYUWON5.js +2 -0
- package/dist/trillion3d-chunk-PYVXDVAE.js +79 -0
- package/dist/trillion3d-chunk-PZBXWJFT.js +139 -0
- package/dist/trillion3d-chunk-Q2T4HBTW.js +2 -0
- package/dist/trillion3d-chunk-QAHCZ4CN.js +2 -0
- package/dist/trillion3d-chunk-QFIAXDBJ.js +2 -0
- package/dist/trillion3d-chunk-QGHAYZR3.js +2 -0
- package/dist/trillion3d-chunk-QMREUFAO.js +2 -0
- package/dist/trillion3d-chunk-QN7VBGUP.js +2 -0
- package/dist/trillion3d-chunk-QVFWEZOK.js +318 -0
- package/dist/trillion3d-chunk-QW5YCJAB.js +100 -0
- package/dist/trillion3d-chunk-R2A7QWWZ.js +2 -0
- package/dist/trillion3d-chunk-R4BXG67P.js +2 -0
- package/dist/trillion3d-chunk-R56L2MST.js +2 -0
- package/dist/trillion3d-chunk-RLDDQEQJ.js +10 -0
- package/dist/trillion3d-chunk-RMFAMI5T.js +2 -0
- package/dist/trillion3d-chunk-ROHK5HT5.js +19 -0
- package/dist/trillion3d-chunk-RPMC2FKD.js +2 -0
- package/dist/trillion3d-chunk-RTBXAMIZ.js +113 -0
- package/dist/trillion3d-chunk-S2NA64OJ.js +2 -0
- package/dist/trillion3d-chunk-SPIIJAMX.js +34 -0
- package/dist/trillion3d-chunk-SSWVBSJZ.js +2 -0
- package/dist/trillion3d-chunk-SUDBSFLJ.js +2 -0
- package/dist/trillion3d-chunk-SUU45ZK7.js +2 -0
- package/dist/trillion3d-chunk-TFNOURGL.js +6 -0
- package/dist/trillion3d-chunk-TLIN2DEK.js +1505 -0
- package/dist/trillion3d-chunk-TLO4XKYG.js +2 -0
- package/dist/trillion3d-chunk-TVYIOVGI.js +2 -0
- package/dist/trillion3d-chunk-TY7RGAI4.js +210 -0
- package/dist/trillion3d-chunk-U5NZRFEN.js +4403 -0
- package/dist/trillion3d-chunk-U5NZRFEN.js.map +6 -0
- package/dist/trillion3d-chunk-UBSICE2S.js +26 -0
- package/dist/trillion3d-chunk-UCIL746V.js +2 -0
- package/dist/trillion3d-chunk-UGTFIP7T.js +2 -0
- package/dist/trillion3d-chunk-UH2X4DC7.js +2 -0
- package/dist/trillion3d-chunk-UL5AQCHN.js +2 -0
- package/dist/trillion3d-chunk-UMAIYYSB.js +28 -0
- package/dist/trillion3d-chunk-UROCVT3W.js +53 -0
- package/dist/trillion3d-chunk-US6WKM5M.js +2 -0
- package/dist/trillion3d-chunk-UT5VM3B7.js +2 -0
- package/dist/trillion3d-chunk-UXCQ7A3K.js +2 -0
- package/dist/trillion3d-chunk-UXQKO5IH.js +2 -0
- package/dist/trillion3d-chunk-UXRWIFOC.js +12 -0
- package/dist/trillion3d-chunk-V44TZZB3.js +2 -0
- package/dist/trillion3d-chunk-VFPDIIEP.js +2 -0
- package/dist/trillion3d-chunk-VL44QEQI.js +2 -0
- package/dist/trillion3d-chunk-VP3GS2OQ.js +553 -0
- package/dist/trillion3d-chunk-VWRK33DS.js +172 -0
- package/dist/trillion3d-chunk-W2AGULE7.js +55 -0
- package/dist/trillion3d-chunk-W4L4ZLLZ.js +25 -0
- package/dist/trillion3d-chunk-WAR4LFLB.js +2 -0
- package/dist/trillion3d-chunk-WCVRKGQD.js +2 -0
- package/dist/trillion3d-chunk-WEACAP55.js +2 -0
- package/dist/trillion3d-chunk-WG6NZENK.js +2 -0
- package/dist/trillion3d-chunk-WJ4XQVTQ.js +411 -0
- package/dist/trillion3d-chunk-WR43FBB3.js +2 -0
- package/dist/trillion3d-chunk-WXECWHZ5.js +2 -0
- package/dist/trillion3d-chunk-WYKIXSUS.js +22 -0
- package/dist/trillion3d-chunk-XBDQHYBL.js +2 -0
- package/dist/trillion3d-chunk-XEPOPZZY.js +2 -0
- package/dist/trillion3d-chunk-XEQBUJNB.js +2 -0
- package/dist/trillion3d-chunk-XL4F65A7.js +174 -0
- package/dist/trillion3d-chunk-XOAWZNRA.js +2 -0
- package/dist/trillion3d-chunk-XQHULSDL.js +30 -0
- package/dist/trillion3d-chunk-XQSMKVTL.js +2 -0
- package/dist/trillion3d-chunk-XQSU4SY6.js +2 -0
- package/dist/trillion3d-chunk-XWJQJK22.js +2 -0
- package/dist/trillion3d-chunk-XXOXGG47.js +2 -0
- package/dist/trillion3d-chunk-XY7DNXWL.js +2 -0
- package/dist/trillion3d-chunk-XYZRT3VR.js +223 -0
- package/dist/trillion3d-chunk-XZPUDNQA.js +2 -0
- package/dist/trillion3d-chunk-Y2RAGKRM.js +2 -0
- package/dist/trillion3d-chunk-YA4TWJRK.js +442 -0
- package/dist/trillion3d-chunk-YAFEYU2S.js +2 -0
- package/dist/trillion3d-chunk-YBKRRMOT.js +2 -0
- package/dist/trillion3d-chunk-YFSDLEIZ.js +85 -0
- package/dist/trillion3d-chunk-YIUAOG6X.js +2 -0
- package/dist/trillion3d-chunk-YKZXAXMM.js +11 -0
- package/dist/trillion3d-chunk-YMR3WF2W.js +2 -0
- package/dist/trillion3d-chunk-YNRZO4Y4.js +27 -0
- package/dist/trillion3d-chunk-YOXV4W6I.js +266 -0
- package/dist/trillion3d-chunk-YQT76FYC.js +2 -0
- package/dist/trillion3d-chunk-YRPBW7AK.js +2 -0
- package/dist/trillion3d-chunk-YULZ6QUZ.js +2 -0
- package/dist/trillion3d-chunk-YWWOBEV2.js +2 -0
- package/dist/trillion3d-chunk-YYWNNHNI.js +2 -0
- package/dist/trillion3d-chunk-ZBIQ6S5Z.js +173 -0
- package/dist/trillion3d-chunk-ZBXTCONH.js +2 -0
- package/dist/trillion3d-chunk-ZDNFJYCW.js +2 -0
- package/dist/trillion3d-chunk-ZF5EDFJS.js +523 -0
- package/dist/trillion3d-chunk-ZFAKVFKL.js +21 -0
- package/dist/trillion3d-chunk-ZIGGUJM6.js +2 -0
- package/dist/trillion3d-chunk-ZNJ4TNBW.js +47 -0
- package/dist/trillion3d-chunk-ZQPT2YFE.js +2 -0
- package/dist/trillion3d-chunk-ZUFX2HVV.js +14 -0
- package/dist/trillion3d-chunk-ZUQDRSYB.js +14 -0
- package/dist/trillion3d-chunk-ZVSX6CGW.js +14 -0
- package/dist/trillion3d-chunk-ZYS4E37Q.js +2 -0
- package/dist/trillion3d-chunk-ZZWX6Q7H.js +2 -0
- package/dist/trillion3d-cinematicsCode-2YP657C3.js +2 -0
- package/dist/trillion3d-cubeCapturesCode-BOLBDRJD.js +77 -0
- package/dist/trillion3d-debugViewsCode-F4KTKXOZ.js +973 -0
- package/dist/trillion3d-decalCode-4OSGACRW.js +79 -0
- package/dist/trillion3d-deformationCode-GJBRRE4B.js +235 -0
- package/dist/trillion3d-displacementCode-OS37YHNO.js +659 -0
- package/dist/trillion3d-effectCode-CNDEXEFI.js +1874 -0
- package/dist/trillion3d-explorer-3SU2HTGD.js +2 -0
- package/dist/trillion3d-export-3COKIWS6.js +2 -0
- package/dist/trillion3d-family-YNJWVKWC.js +280 -0
- package/dist/trillion3d-fieldsCode-JQLVIT4H.js +2 -0
- package/dist/trillion3d-fogCode-PM5UY2TW.js +582 -0
- package/dist/trillion3d-geometryPage-DVJ4N2A6.js +2 -0
- package/dist/trillion3d-graphCode-MCIPPACK.js +2 -0
- package/dist/trillion3d-graphCode-MOTJ4WBF.js +2 -0
- package/dist/trillion3d-grassCode-J7CCF63J.js +2 -0
- package/dist/trillion3d-guideCode-ONWTGY2H.js +47 -0
- package/dist/trillion3d-hairCode-PNWJMXWH.js +3215 -0
- package/dist/trillion3d-hardwareBenchmark-JD2ITGNS.js +132 -0
- package/dist/trillion3d-headlessCode-JAXG4XPK.js +2 -0
- package/dist/trillion3d-iesCode-QVSRIT37.js +2 -0
- package/dist/trillion3d-indicator-ZDOOX6EU.js +22 -0
- package/dist/trillion3d-installCode-5NOFNOTZ.js +426 -0
- package/dist/trillion3d-manifestLoad-TEO2A7XO.js +2 -0
- package/dist/trillion3d-markCode-DD7RPZ2V.js +164 -0
- package/dist/trillion3d-measurementCode-I6LN3Z4A.js +2 -0
- package/dist/trillion3d-measurementCode-I6LN3Z4A.js.map +6 -0
- package/dist/trillion3d-modelArrivalCode-AS2ZIO5I.js +2 -0
- package/dist/trillion3d-modelCapture-OZNK2KHI.js +2 -0
- package/dist/trillion3d-modelCopiesCode-X7PCUUUT.js +2 -0
- package/dist/trillion3d-modelImagesCode-7NZ3BIL5.js +2 -0
- package/dist/trillion3d-pageAudioCode-PQWNFXNH.js +2 -0
- package/dist/trillion3d-pageCompile-4KI5TP2J.js +34 -0
- package/dist/trillion3d-panel-4BMTNA6N.js +79 -0
- package/dist/trillion3d-particleCode-X7RJYMM2.js +574 -0
- package/dist/trillion3d-partitionCode-KNTGZUZG.js +2 -0
- package/dist/trillion3d-pathTracingCode-IUDUNO7P.js +3333 -0
- package/dist/trillion3d-planarReflectionsCode-22NVSPZ2.js +96 -0
- package/dist/trillion3d-previewRun-YOUFRKDJ.js +33 -0
- package/dist/trillion3d-ragdollCode-XOZ7BBU4.js +2 -0
- package/dist/trillion3d-ragdollStage-EGRNR3QB.js +2 -0
- package/dist/trillion3d-read-6L2UR4EJ.js +2 -0
- package/dist/trillion3d-reflectionsCode-3T6W62HT.js +2128 -0
- package/dist/trillion3d-sampledLightsCode-MSZ2YCSJ.js +1795 -0
- package/dist/trillion3d-scene-3LL23MZI.js +2 -0
- package/dist/trillion3d-session-S4GIQNV6.js +2 -0
- package/dist/trillion3d-shadowsCode-UZNPLVCV.js +3667 -0
- package/dist/trillion3d-skyCode-BYIIBWAM.js +2212 -0
- package/dist/trillion3d-sortedTranslucencyCode-VLSTGX5S.js +181 -0
- package/dist/trillion3d-splineMeshCode-AWDX5BIG.js +2 -0
- package/dist/trillion3d-subsurfaceCode-PROXJTLS.js +732 -0
- package/dist/trillion3d-surfaceCode-CW2NSI5O.js +2 -0
- package/dist/trillion3d-terrainCode-ZDONXR5X.js +2 -0
- package/dist/trillion3d-transformCode-SE55EUCN.js +2 -0
- package/dist/trillion3d-translucentLightVolumeCode-EQKMCGMD.js +195 -0
- package/dist/trillion3d-viewCode-52L7D5ZW.js +18 -0
- package/dist/trillion3d-volumesCode-NYAC6KYU.js +2334 -0
- package/dist/trillion3d-waterCode-CWZ5XYNU.js +102 -0
- package/dist/trillion3d-webgpuCode-2GNPUWQ4.js +1646 -0
- package/dist/trillion3d-workCode-DCC25A2D.js +2 -0
- package/dist/trillion3d-worldRootPages-P75VSIXR.js +2 -0
- package/dist/trillion3d.module.js +1 -1
- package/dist/trillion3d.module.js.modules.json +1 -1
- package/package.json +2 -2
- package/dist/trillion3d-aoCode-T2V54NAO.js +0 -489
- package/dist/trillion3d-assemblies-3DUP5X66.js +0 -2
- package/dist/trillion3d-audioCode-53XT65XV.js +0 -2
- package/dist/trillion3d-autoExposureCode-B5KISRSD.js +0 -198
- package/dist/trillion3d-avatarCode-AZDPGA73.js +0 -2
- package/dist/trillion3d-bounceCode-AZC4HMJI.js +0 -4675
- package/dist/trillion3d-catalogueCode-ZAOFZQLB.js +0 -2
- package/dist/trillion3d-chunk-2BOYJZCQ.js +0 -2
- package/dist/trillion3d-chunk-2CZ6RWTW.js +0 -607
- package/dist/trillion3d-chunk-2HSBVYCY.js +0 -2
- package/dist/trillion3d-chunk-2JAAFFQC.js +0 -438
- package/dist/trillion3d-chunk-2JCF4HLE.js +0 -132
- package/dist/trillion3d-chunk-2JM7B67K.js +0 -2
- package/dist/trillion3d-chunk-2KRIKK4D.js +0 -2
- package/dist/trillion3d-chunk-2L52NUG7.js +0 -2
- package/dist/trillion3d-chunk-2MVQXOFZ.js +0 -2
- package/dist/trillion3d-chunk-2OFUDJNU.js +0 -2
- package/dist/trillion3d-chunk-2PBJSBLO.js +0 -46
- package/dist/trillion3d-chunk-2TYAUOQ5.js +0 -2
- package/dist/trillion3d-chunk-2VZIVK5U.js +0 -2
- package/dist/trillion3d-chunk-36VHFR62.js +0 -2
- package/dist/trillion3d-chunk-3BY2FPRS.js +0 -2
- package/dist/trillion3d-chunk-3EPZT7SR.js +0 -167
- package/dist/trillion3d-chunk-3GEQFGGV.js +0 -360
- package/dist/trillion3d-chunk-3H2OZEPR.js +0 -2
- package/dist/trillion3d-chunk-3HE5HBCK.js +0 -14
- package/dist/trillion3d-chunk-3HPFLXCF.js +0 -125
- package/dist/trillion3d-chunk-42JJO5YV.js +0 -771
- package/dist/trillion3d-chunk-44GU3ERA.js +0 -756
- package/dist/trillion3d-chunk-44GU3ERA.js.map +0 -6
- package/dist/trillion3d-chunk-46P46SRG.js +0 -2
- package/dist/trillion3d-chunk-472QQ27C.js +0 -2
- package/dist/trillion3d-chunk-4BOD343S.js +0 -2
- package/dist/trillion3d-chunk-4JBRHV7G.js +0 -174
- package/dist/trillion3d-chunk-4KXFERR4.js +0 -2
- package/dist/trillion3d-chunk-5ASFLMJ6.js +0 -583
- package/dist/trillion3d-chunk-5B3ML3DL.js +0 -2
- package/dist/trillion3d-chunk-5COTXELO.js +0 -2
- package/dist/trillion3d-chunk-5GW525BI.js +0 -2
- package/dist/trillion3d-chunk-5GY24CJD.js +0 -2
- package/dist/trillion3d-chunk-5HWOHERQ.js +0 -2
- package/dist/trillion3d-chunk-5K6QSSBR.js +0 -2
- package/dist/trillion3d-chunk-5KHPSLRC.js +0 -2
- package/dist/trillion3d-chunk-5LQDA7UM.js +0 -2
- package/dist/trillion3d-chunk-5O2GDLHX.js +0 -2
- package/dist/trillion3d-chunk-5ONOJMSW.js +0 -2
- package/dist/trillion3d-chunk-5Q666YQV.js +0 -519
- package/dist/trillion3d-chunk-5ROJIVV3.js +0 -20
- package/dist/trillion3d-chunk-5VVVL3GH.js +0 -2
- package/dist/trillion3d-chunk-5VX27QFH.js +0 -2
- package/dist/trillion3d-chunk-6VDAUYE6.js +0 -2
- package/dist/trillion3d-chunk-6VPPLI5X.js +0 -46
- package/dist/trillion3d-chunk-6Y7TZO62.js +0 -523
- package/dist/trillion3d-chunk-742WGJYH.js +0 -2
- package/dist/trillion3d-chunk-74PQZHDK.js +0 -104
- package/dist/trillion3d-chunk-77T2WOXU.js +0 -2
- package/dist/trillion3d-chunk-7C5HNDEL.js +0 -2
- package/dist/trillion3d-chunk-7CGRPLOC.js +0 -188
- package/dist/trillion3d-chunk-7CSS2AWO.js +0 -94
- package/dist/trillion3d-chunk-7F2KAZFC.js +0 -2
- package/dist/trillion3d-chunk-7IZI5OZK.js +0 -2
- package/dist/trillion3d-chunk-7NZTUQYT.js +0 -592
- package/dist/trillion3d-chunk-7QYR7QUU.js +0 -13
- package/dist/trillion3d-chunk-7XEWHG3S.js +0 -223
- package/dist/trillion3d-chunk-AA2V3CRQ.js +0 -2
- package/dist/trillion3d-chunk-AA6W2SUV.js +0 -77
- package/dist/trillion3d-chunk-ABKLIRWX.js +0 -2
- package/dist/trillion3d-chunk-ADUR3TJH.js +0 -76
- package/dist/trillion3d-chunk-AEW6BD4P.js +0 -2
- package/dist/trillion3d-chunk-AU725OCC.js +0 -2
- package/dist/trillion3d-chunk-AYCFHOHV.js +0 -2
- package/dist/trillion3d-chunk-AYJO3NNO.js +0 -2
- package/dist/trillion3d-chunk-AZ6SQT7V.js +0 -1953
- package/dist/trillion3d-chunk-AZHGOCPF.js +0 -2
- package/dist/trillion3d-chunk-B3ATF6PP.js +0 -418
- package/dist/trillion3d-chunk-B3ECL3UB.js +0 -24
- package/dist/trillion3d-chunk-BDWRLDJI.js +0 -3109
- package/dist/trillion3d-chunk-BGNYLCJW.js +0 -303
- package/dist/trillion3d-chunk-BS3H5DRX.js +0 -2
- package/dist/trillion3d-chunk-BUP4DDEO.js +0 -2
- package/dist/trillion3d-chunk-BZAV5BK7.js +0 -2
- package/dist/trillion3d-chunk-C2QSQDHV.js +0 -4403
- package/dist/trillion3d-chunk-C2QSQDHV.js.map +0 -6
- package/dist/trillion3d-chunk-CBPJFYIU.js +0 -172
- package/dist/trillion3d-chunk-CD7EZNRP.js +0 -53
- package/dist/trillion3d-chunk-CJHN7L75.js +0 -2
- package/dist/trillion3d-chunk-CMHKMP7M.js +0 -6
- package/dist/trillion3d-chunk-CPLMDH47.js +0 -2
- package/dist/trillion3d-chunk-CQESL7F5.js +0 -28
- package/dist/trillion3d-chunk-CVJOTXK5.js +0 -2
- package/dist/trillion3d-chunk-D4DXAQPJ.js +0 -4
- package/dist/trillion3d-chunk-DA3S4LZH.js +0 -34
- package/dist/trillion3d-chunk-DPXM3DHU.js +0 -2
- package/dist/trillion3d-chunk-DUWMZGSW.js +0 -18
- package/dist/trillion3d-chunk-DZ5A6N23.js +0 -11
- package/dist/trillion3d-chunk-E2VRYXCO.js +0 -55
- package/dist/trillion3d-chunk-E4N7LNGP.js +0 -2
- package/dist/trillion3d-chunk-E5M5PMK3.js +0 -2
- package/dist/trillion3d-chunk-EAHDFM7D.js +0 -139
- package/dist/trillion3d-chunk-ECWU67MC.js +0 -54
- package/dist/trillion3d-chunk-EI2XZGZC.js +0 -2
- package/dist/trillion3d-chunk-EIOQWCJW.js +0 -35
- package/dist/trillion3d-chunk-EO2IHUHA.js +0 -2
- package/dist/trillion3d-chunk-ESO5KVG2.js +0 -2
- package/dist/trillion3d-chunk-ETCQFZ4S.js +0 -435
- package/dist/trillion3d-chunk-EU4OYQGR.js +0 -2
- package/dist/trillion3d-chunk-EUCLXLYS.js +0 -2
- package/dist/trillion3d-chunk-EZ2JYRNP.js +0 -70
- package/dist/trillion3d-chunk-F2BKXVDP.js +0 -59
- package/dist/trillion3d-chunk-F4TG7DXL.js +0 -2
- package/dist/trillion3d-chunk-FBPR5PIL.js +0 -2
- package/dist/trillion3d-chunk-FDP5PHNI.js +0 -17
- package/dist/trillion3d-chunk-FJRD6RXY.js +0 -4
- package/dist/trillion3d-chunk-FLJAAUWJ.js +0 -2
- package/dist/trillion3d-chunk-FPH3NDSE.js +0 -2
- package/dist/trillion3d-chunk-FYTCEF3P.js +0 -2
- package/dist/trillion3d-chunk-G4ZEQPJE.js +0 -2
- package/dist/trillion3d-chunk-G5MFUE5P.js +0 -2
- package/dist/trillion3d-chunk-G6HYU5QH.js +0 -2
- package/dist/trillion3d-chunk-GJAAOF62.js +0 -2
- package/dist/trillion3d-chunk-GOFFACVN.js +0 -210
- package/dist/trillion3d-chunk-GPKNAWFR.js +0 -2
- package/dist/trillion3d-chunk-GTJAMKXA.js +0 -2
- package/dist/trillion3d-chunk-GUWCZ2WR.js +0 -40
- package/dist/trillion3d-chunk-GXDVY3QD.js +0 -2
- package/dist/trillion3d-chunk-GXMTFTCW.js +0 -2
- package/dist/trillion3d-chunk-H5B36GHI.js +0 -2
- package/dist/trillion3d-chunk-HBFRB6UY.js +0 -79
- package/dist/trillion3d-chunk-HCXQHHY4.js +0 -2
- package/dist/trillion3d-chunk-HDA6WCOZ.js +0 -2
- package/dist/trillion3d-chunk-HTCY6CIU.js +0 -19
- package/dist/trillion3d-chunk-I2L32YAH.js +0 -10
- package/dist/trillion3d-chunk-I4HFBLVO.js +0 -2
- package/dist/trillion3d-chunk-I5PD2IYL.js +0 -2
- package/dist/trillion3d-chunk-I63LRS3P.js +0 -2
- package/dist/trillion3d-chunk-I7R4YZP2.js +0 -6
- package/dist/trillion3d-chunk-ICWUGQNV.js +0 -2
- package/dist/trillion3d-chunk-IGBD22JD.js +0 -155
- package/dist/trillion3d-chunk-IGH6C5NL.js +0 -2
- package/dist/trillion3d-chunk-IVAI2C6D.js +0 -2
- package/dist/trillion3d-chunk-IWBFD73G.js +0 -173
- package/dist/trillion3d-chunk-J2KR4G6F.js +0 -74
- package/dist/trillion3d-chunk-J2YDEAKO.js +0 -553
- package/dist/trillion3d-chunk-J5SMDUDO.js +0 -2
- package/dist/trillion3d-chunk-JCTPF4CK.js +0 -14
- package/dist/trillion3d-chunk-JFCEIZBH.js +0 -2
- package/dist/trillion3d-chunk-JH7I4RDZ.js +0 -25
- package/dist/trillion3d-chunk-JLJSXR5R.js +0 -2
- package/dist/trillion3d-chunk-JN2SWJKC.js +0 -178
- package/dist/trillion3d-chunk-JO55XZVA.js +0 -1615
- package/dist/trillion3d-chunk-JOPRGF7Z.js +0 -2
- package/dist/trillion3d-chunk-JQ2VUCTW.js +0 -2
- package/dist/trillion3d-chunk-JRLCX4ZB.js +0 -2
- package/dist/trillion3d-chunk-JRVTAQY2.js +0 -2
- package/dist/trillion3d-chunk-JVNGK4EV.js +0 -113
- package/dist/trillion3d-chunk-JXEBQPRX.js +0 -2
- package/dist/trillion3d-chunk-K3434KA7.js +0 -59
- package/dist/trillion3d-chunk-K364ZTPY.js +0 -27
- package/dist/trillion3d-chunk-K5D3PLUN.js +0 -2
- package/dist/trillion3d-chunk-KCXWBXK2.js +0 -2
- package/dist/trillion3d-chunk-KEIULYWY.js +0 -45
- package/dist/trillion3d-chunk-KEQDYXLL.js +0 -2
- package/dist/trillion3d-chunk-KITYCFGK.js +0 -2
- package/dist/trillion3d-chunk-KJXQTIKM.js +0 -2
- package/dist/trillion3d-chunk-KS3GXZPA.js +0 -184
- package/dist/trillion3d-chunk-KTGIIVAQ.js +0 -47
- package/dist/trillion3d-chunk-KU7R2CLN.js +0 -2
- package/dist/trillion3d-chunk-KWS6MEDX.js +0 -2
- package/dist/trillion3d-chunk-KYDPV56Z.js +0 -265
- package/dist/trillion3d-chunk-LB2MHAHM.js +0 -85
- package/dist/trillion3d-chunk-LE7PGKD4.js +0 -86
- package/dist/trillion3d-chunk-LHCO3J7M.js +0 -2
- package/dist/trillion3d-chunk-LHFBY6CF.js +0 -276
- package/dist/trillion3d-chunk-LHHZH3SV.js +0 -2
- package/dist/trillion3d-chunk-LV5NP2OD.js +0 -2
- package/dist/trillion3d-chunk-LZSYLDTU.js +0 -100
- package/dist/trillion3d-chunk-M2AYPZAT.js +0 -2
- package/dist/trillion3d-chunk-M2F7Q77E.js +0 -277
- package/dist/trillion3d-chunk-M63PPBDR.js +0 -2
- package/dist/trillion3d-chunk-MBN7REAP.js +0 -2
- package/dist/trillion3d-chunk-MCIY254D.js +0 -26
- package/dist/trillion3d-chunk-MEMYKAVP.js +0 -197
- package/dist/trillion3d-chunk-MH3RWDUK.js +0 -56
- package/dist/trillion3d-chunk-MLBX4WMV.js +0 -2
- package/dist/trillion3d-chunk-MQEVNNBK.js +0 -2
- package/dist/trillion3d-chunk-MUZUZS2F.js +0 -2
- package/dist/trillion3d-chunk-N45WPUNA.js +0 -2
- package/dist/trillion3d-chunk-N76JAZ32.js +0 -68
- package/dist/trillion3d-chunk-NFFLZRMN.js +0 -2
- package/dist/trillion3d-chunk-NH3GZRI7.js +0 -2
- package/dist/trillion3d-chunk-NH7JVT4M.js +0 -2
- package/dist/trillion3d-chunk-NJW7NEZW.js +0 -2
- package/dist/trillion3d-chunk-NQT36E2Z.js +0 -28
- package/dist/trillion3d-chunk-NUSOZ5NQ.js +0 -16
- package/dist/trillion3d-chunk-O3H5RZXC.js +0 -14
- package/dist/trillion3d-chunk-O3H5RZXC.js.map +0 -6
- package/dist/trillion3d-chunk-O3OYDVQH.js +0 -2
- package/dist/trillion3d-chunk-O6RA4K6A.js +0 -2
- package/dist/trillion3d-chunk-OG5M47HN.js +0 -6
- package/dist/trillion3d-chunk-OOOINENB.js +0 -2
- package/dist/trillion3d-chunk-OPFDHDV7.js +0 -2
- package/dist/trillion3d-chunk-OVVY7IKC.js +0 -2
- package/dist/trillion3d-chunk-OXKMBXZD.js +0 -2
- package/dist/trillion3d-chunk-P2RDFAA2.js +0 -1166
- package/dist/trillion3d-chunk-P4Q7TPID.js +0 -40
- package/dist/trillion3d-chunk-P74SV4JJ.js +0 -328
- package/dist/trillion3d-chunk-P75YOB5K.js +0 -27
- package/dist/trillion3d-chunk-PN2YD2PU.js +0 -27
- package/dist/trillion3d-chunk-POPUJ5RT.js +0 -4
- package/dist/trillion3d-chunk-PPUZR76B.js +0 -11
- package/dist/trillion3d-chunk-PQH6Z3ZK.js +0 -19
- package/dist/trillion3d-chunk-PSMSPY5U.js +0 -2
- package/dist/trillion3d-chunk-PU4JWKCC.js +0 -2
- package/dist/trillion3d-chunk-PUS6DQHP.js +0 -2
- package/dist/trillion3d-chunk-Q4XTYMSK.js +0 -2
- package/dist/trillion3d-chunk-QCE7DOXK.js +0 -21
- package/dist/trillion3d-chunk-QDNYR3XW.js +0 -2
- package/dist/trillion3d-chunk-QEJGU4DQ.js +0 -217
- package/dist/trillion3d-chunk-QFWHSCJS.js +0 -2
- package/dist/trillion3d-chunk-QGELETHW.js +0 -2
- package/dist/trillion3d-chunk-QHLP3RMM.js +0 -2
- package/dist/trillion3d-chunk-QJVAWFWA.js +0 -2
- package/dist/trillion3d-chunk-QLEZIRFO.js +0 -2
- package/dist/trillion3d-chunk-QNKA4ESA.js +0 -2
- package/dist/trillion3d-chunk-QOKJKCXP.js +0 -442
- package/dist/trillion3d-chunk-QPNQ6MAU.js +0 -35
- package/dist/trillion3d-chunk-QW7R4JSU.js +0 -6
- package/dist/trillion3d-chunk-QWRJTGQA.js +0 -4
- package/dist/trillion3d-chunk-QZURF55R.js +0 -2
- package/dist/trillion3d-chunk-R3HHRSA5.js +0 -82
- package/dist/trillion3d-chunk-RB22IHFT.js +0 -27
- package/dist/trillion3d-chunk-RUOI3D3D.js +0 -2
- package/dist/trillion3d-chunk-S25VCORA.js +0 -2
- package/dist/trillion3d-chunk-S2JLIIRM.js +0 -10
- package/dist/trillion3d-chunk-S47ADXWU.js +0 -30
- package/dist/trillion3d-chunk-S4NKU3YU.js +0 -14
- package/dist/trillion3d-chunk-S4P42ZHN.js +0 -2
- package/dist/trillion3d-chunk-SAYEA3NT.js +0 -2
- package/dist/trillion3d-chunk-SCJINCDV.js +0 -2
- package/dist/trillion3d-chunk-SG3C5SMX.js +0 -2
- package/dist/trillion3d-chunk-SIPUEAJ5.js +0 -266
- package/dist/trillion3d-chunk-SKH3XZ4Q.js +0 -2
- package/dist/trillion3d-chunk-SLLV2LYS.js +0 -2
- package/dist/trillion3d-chunk-SM64HJZI.js +0 -2
- package/dist/trillion3d-chunk-SYQOPTR2.js +0 -165
- package/dist/trillion3d-chunk-T43PRG7O.js +0 -2
- package/dist/trillion3d-chunk-TI3PM7XW.js +0 -2
- package/dist/trillion3d-chunk-TLVZXCTJ.js +0 -2537
- package/dist/trillion3d-chunk-TWFQBYBV.js +0 -14
- package/dist/trillion3d-chunk-TZ3XBBRE.js +0 -12
- package/dist/trillion3d-chunk-U3CLZW3E.js +0 -2
- package/dist/trillion3d-chunk-U4EL7JGK.js +0 -2
- package/dist/trillion3d-chunk-UBMIQXK3.js +0 -2
- package/dist/trillion3d-chunk-UBW2ZWPI.js +0 -26
- package/dist/trillion3d-chunk-UCGD7DGZ.js +0 -2
- package/dist/trillion3d-chunk-UH663TJS.js +0 -125
- package/dist/trillion3d-chunk-UHWPSNJD.js +0 -177
- package/dist/trillion3d-chunk-UL2YJ52J.js +0 -2
- package/dist/trillion3d-chunk-UPJHDFQP.js +0 -2
- package/dist/trillion3d-chunk-UR2BLLWY.js +0 -2
- package/dist/trillion3d-chunk-URIYQIA6.js +0 -116
- package/dist/trillion3d-chunk-URXU62XN.js +0 -2
- package/dist/trillion3d-chunk-UTTH7HS7.js +0 -2
- package/dist/trillion3d-chunk-UX44ZL4D.js +0 -2
- package/dist/trillion3d-chunk-UXRH76J5.js +0 -17
- package/dist/trillion3d-chunk-V2BAFU66.js +0 -2
- package/dist/trillion3d-chunk-V4M3HNJD.js +0 -318
- package/dist/trillion3d-chunk-V6HD2TKX.js +0 -2
- package/dist/trillion3d-chunk-V6VZ5QXG.js +0 -2
- package/dist/trillion3d-chunk-VCIRYPE7.js +0 -2
- package/dist/trillion3d-chunk-VGIJRZO5.js +0 -400
- package/dist/trillion3d-chunk-VQ7DWMHP.js +0 -2
- package/dist/trillion3d-chunk-VYQB6KF6.js +0 -2
- package/dist/trillion3d-chunk-W42TUOJC.js +0 -285
- package/dist/trillion3d-chunk-W4SMNFPI.js +0 -2
- package/dist/trillion3d-chunk-WFPJ35TV.js +0 -2
- package/dist/trillion3d-chunk-WJBLDQVZ.js +0 -19
- package/dist/trillion3d-chunk-WLOE6LQT.js +0 -42
- package/dist/trillion3d-chunk-WMW4G2T3.js +0 -12
- package/dist/trillion3d-chunk-WOE7ECLG.js +0 -172
- package/dist/trillion3d-chunk-WPZHDV22.js +0 -6
- package/dist/trillion3d-chunk-WUZB5LTJ.js +0 -50
- package/dist/trillion3d-chunk-X2FMWMUT.js +0 -988
- package/dist/trillion3d-chunk-XAWENX7C.js +0 -81
- package/dist/trillion3d-chunk-XHUSYLI3.js +0 -2
- package/dist/trillion3d-chunk-XI6O5F6V.js +0 -11
- package/dist/trillion3d-chunk-XM5IBOQ3.js +0 -2
- package/dist/trillion3d-chunk-XS7FCVOV.js +0 -2
- package/dist/trillion3d-chunk-XUD7A3GH.js +0 -2
- package/dist/trillion3d-chunk-XXCX4QIN.js +0 -377
- package/dist/trillion3d-chunk-XYMF73ZW.js +0 -107
- package/dist/trillion3d-chunk-XYP27BGE.js +0 -2
- package/dist/trillion3d-chunk-Y2DWPDRM.js +0 -5
- package/dist/trillion3d-chunk-Y322OCAR.js +0 -2
- package/dist/trillion3d-chunk-Y3SDC6TY.js +0 -2
- package/dist/trillion3d-chunk-Y42MTEVG.js +0 -2
- package/dist/trillion3d-chunk-Y4MIWQBS.js +0 -2
- package/dist/trillion3d-chunk-YI2MFQEG.js +0 -2
- package/dist/trillion3d-chunk-YIE3H5JS.js +0 -411
- package/dist/trillion3d-chunk-YON3TSAG.js +0 -4
- package/dist/trillion3d-chunk-YQC77N7M.js +0 -2
- package/dist/trillion3d-chunk-YTL2XIXN.js +0 -2
- package/dist/trillion3d-chunk-YWUEHJ6S.js +0 -2
- package/dist/trillion3d-chunk-YZARCC7T.js +0 -91
- package/dist/trillion3d-chunk-Z6ISTRN2.js +0 -2
- package/dist/trillion3d-chunk-ZDT7Z7AV.js +0 -2
- package/dist/trillion3d-chunk-ZFEJXND5.js +0 -9
- package/dist/trillion3d-chunk-ZGWEZTGI.js +0 -2
- package/dist/trillion3d-chunk-ZHRUP5WY.js +0 -2
- package/dist/trillion3d-chunk-ZHV4B2CP.js +0 -2
- package/dist/trillion3d-chunk-ZKTXPZUU.js +0 -2
- package/dist/trillion3d-chunk-ZM6OWZBZ.js +0 -1505
- package/dist/trillion3d-chunk-ZNNO6SDC.js +0 -2
- package/dist/trillion3d-chunk-ZSKD2IX5.js +0 -2
- package/dist/trillion3d-chunk-ZSTYK7WY.js +0 -2
- package/dist/trillion3d-chunk-ZTNOBS5G.js +0 -13
- package/dist/trillion3d-chunk-ZTYP3T5T.js +0 -2
- package/dist/trillion3d-chunk-ZUU5E7FO.js +0 -2
- package/dist/trillion3d-chunk-ZVO6IOK3.js +0 -22
- package/dist/trillion3d-chunk-ZWZTGI5M.js +0 -113
- package/dist/trillion3d-chunk-ZXF6BEYU.js +0 -242
- package/dist/trillion3d-chunk-ZXGUNSUQ.js +0 -2
- package/dist/trillion3d-cinematicsCode-5UPGQFVV.js +0 -2
- package/dist/trillion3d-cubeCapturesCode-LCBK47X5.js +0 -77
- package/dist/trillion3d-debugViewsCode-7GJW7RDI.js +0 -973
- package/dist/trillion3d-decalCode-ID2FWTA7.js +0 -79
- package/dist/trillion3d-deformationCode-PIIEMRNF.js +0 -235
- package/dist/trillion3d-displacementCode-ZMPJRUDW.js +0 -659
- package/dist/trillion3d-effectCode-J22OGAGG.js +0 -1874
- package/dist/trillion3d-explorer-JTT6UBU6.js +0 -2
- package/dist/trillion3d-export-H3WTWO2M.js +0 -2
- package/dist/trillion3d-family-IM6JIBGG.js +0 -280
- package/dist/trillion3d-fieldsCode-QD2TBZOM.js +0 -2
- package/dist/trillion3d-fogCode-PNHAG2DD.js +0 -582
- package/dist/trillion3d-geometryPage-3J5Q2EZN.js +0 -2
- package/dist/trillion3d-graphCode-DWZUBHZQ.js +0 -2
- package/dist/trillion3d-graphCode-HGVQ47X4.js +0 -2
- package/dist/trillion3d-grassCode-HASCTGFB.js +0 -2
- package/dist/trillion3d-guideCode-XKNU3UOB.js +0 -47
- package/dist/trillion3d-hairCode-VUMV4M33.js +0 -3215
- package/dist/trillion3d-hardwareBenchmark-H2SLAEER.js +0 -132
- package/dist/trillion3d-headlessCode-3KBNVKND.js +0 -2
- package/dist/trillion3d-iesCode-GVJDBPQY.js +0 -2
- package/dist/trillion3d-indicator-VCCCRO7K.js +0 -22
- package/dist/trillion3d-installCode-GDJ6EA73.js +0 -426
- package/dist/trillion3d-manifestLoad-Y2XKGXCD.js +0 -2
- package/dist/trillion3d-markCode-VYWQBD3K.js +0 -164
- package/dist/trillion3d-measurementCode-FGD5D2RI.js +0 -2
- package/dist/trillion3d-measurementCode-FGD5D2RI.js.map +0 -6
- package/dist/trillion3d-modelArrivalCode-ENI7UWDQ.js +0 -2
- package/dist/trillion3d-modelCapture-BMLNM2DT.js +0 -2
- package/dist/trillion3d-modelCopiesCode-7JYQXGVF.js +0 -2
- package/dist/trillion3d-modelImagesCode-C3O4XMTN.js +0 -2
- package/dist/trillion3d-pageAudioCode-JV4TWD5B.js +0 -2
- package/dist/trillion3d-pageCompile-YNZYXLLY.js +0 -34
- package/dist/trillion3d-panel-RYDJZQFJ.js +0 -79
- package/dist/trillion3d-particleCode-244NV3QC.js +0 -574
- package/dist/trillion3d-partitionCode-LJW6NXJO.js +0 -2
- package/dist/trillion3d-pathTracingCode-PY4YXX2K.js +0 -3333
- package/dist/trillion3d-planarReflectionsCode-3HPS33JS.js +0 -96
- package/dist/trillion3d-previewRun-MYYO5L7K.js +0 -33
- package/dist/trillion3d-ragdollCode-Q2F4YXCT.js +0 -2
- package/dist/trillion3d-ragdollStage-673NKNJC.js +0 -2
- package/dist/trillion3d-read-KTRGUDEK.js +0 -2
- package/dist/trillion3d-reflectionsCode-EYZ2I2RG.js +0 -2128
- package/dist/trillion3d-sampledLightsCode-44YPQANZ.js +0 -1795
- package/dist/trillion3d-scene-VDR67XPZ.js +0 -2
- package/dist/trillion3d-session-V5UGVDGM.js +0 -2
- package/dist/trillion3d-shadowsCode-IGFSPJZS.js +0 -3667
- package/dist/trillion3d-skyCode-VIAPJ6TS.js +0 -2212
- package/dist/trillion3d-sortedTranslucencyCode-ENOIPRNP.js +0 -181
- package/dist/trillion3d-splineMeshCode-X6CFRALJ.js +0 -2
- package/dist/trillion3d-subsurfaceCode-L36SYFNH.js +0 -732
- package/dist/trillion3d-surfaceCode-J3JUDHSC.js +0 -2
- package/dist/trillion3d-terrainCode-BHCQQRET.js +0 -2
- package/dist/trillion3d-transformCode-74Z7PQYM.js +0 -2
- package/dist/trillion3d-translucentLightVolumeCode-3HU4TBPQ.js +0 -195
- package/dist/trillion3d-viewCode-IXEIJJWS.js +0 -18
- package/dist/trillion3d-volumesCode-RDBBXG3U.js +0 -2334
- package/dist/trillion3d-waterCode-3ZRB2JP7.js +0 -102
- package/dist/trillion3d-webgpuCode-BQTJL2EM.js +0 -1646
- package/dist/trillion3d-workCode-V42SMDJA.js +0 -2
- package/dist/trillion3d-worldRootPages-3SFAHS63.js +0 -2
- /package/dist/{trillion3d-aoCode-T2V54NAO.js.map → trillion3d-aoCode-2JTKFXZ5.js.map} +0 -0
- /package/dist/{trillion3d-assemblies-3DUP5X66.js.map → trillion3d-assemblies-BENCUAG3.js.map} +0 -0
- /package/dist/{trillion3d-audioCode-53XT65XV.js.map → trillion3d-audioCode-M3I6FF7A.js.map} +0 -0
- /package/dist/{trillion3d-autoExposureCode-B5KISRSD.js.map → trillion3d-autoExposureCode-AQ3IV5LH.js.map} +0 -0
- /package/dist/{trillion3d-avatarCode-AZDPGA73.js.map → trillion3d-avatarCode-RTIDGTIA.js.map} +0 -0
- /package/dist/{trillion3d-bounceCode-AZC4HMJI.js.map → trillion3d-bounceCode-GEAWSI3A.js.map} +0 -0
- /package/dist/{trillion3d-catalogueCode-ZAOFZQLB.js.map → trillion3d-catalogueCode-KZ3X7U7G.js.map} +0 -0
- /package/dist/{trillion3d-chunk-URIYQIA6.js.map → trillion3d-chunk-22KA6FS4.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UHWPSNJD.js.map → trillion3d-chunk-25B7I4D5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2JCF4HLE.js.map → trillion3d-chunk-2D7RBB5X.js.map} +0 -0
- /package/dist/{trillion3d-chunk-6VPPLI5X.js.map → trillion3d-chunk-2EJ4CRNA.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5Q666YQV.js.map → trillion3d-chunk-2PKPG2QJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-AZHGOCPF.js.map → trillion3d-chunk-2YXWLU7F.js.map} +0 -0
- /package/dist/{trillion3d-chunk-WMW4G2T3.js.map → trillion3d-chunk-2ZIQ3EEG.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZWZTGI5M.js.map → trillion3d-chunk-33J4ZHIV.js.map} +0 -0
- /package/dist/{trillion3d-chunk-3HE5HBCK.js.map → trillion3d-chunk-3CTKK6Y4.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5O2GDLHX.js.map → trillion3d-chunk-3F65K5TK.js.map} +0 -0
- /package/dist/{trillion3d-chunk-BS3H5DRX.js.map → trillion3d-chunk-3IRHFCKO.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QNKA4ESA.js.map → trillion3d-chunk-3OWQBLPF.js.map} +0 -0
- /package/dist/{trillion3d-chunk-3H2OZEPR.js.map → trillion3d-chunk-3QKVCESS.js.map} +0 -0
- /package/dist/{trillion3d-chunk-MH3RWDUK.js.map → trillion3d-chunk-3TG7TWTW.js.map} +0 -0
- /package/dist/{trillion3d-chunk-YZARCC7T.js.map → trillion3d-chunk-3UAK2IRC.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QWRJTGQA.js.map → trillion3d-chunk-3VO6VVHD.js.map} +0 -0
- /package/dist/{trillion3d-chunk-YON3TSAG.js.map → trillion3d-chunk-3W3YJ4KI.js.map} +0 -0
- /package/dist/{trillion3d-chunk-I4HFBLVO.js.map → trillion3d-chunk-3XBFYA3P.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QJVAWFWA.js.map → trillion3d-chunk-435NEAXB.js.map} +0 -0
- /package/dist/{trillion3d-chunk-E4N7LNGP.js.map → trillion3d-chunk-4JYI3X5D.js.map} +0 -0
- /package/dist/{trillion3d-chunk-SG3C5SMX.js.map → trillion3d-chunk-4KEDPBE4.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UBW2ZWPI.js.map → trillion3d-chunk-4KWKWEQL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-BGNYLCJW.js.map → trillion3d-chunk-4Z6VA66T.js.map} +0 -0
- /package/dist/{trillion3d-chunk-GJAAOF62.js.map → trillion3d-chunk-5243PXB7.js.map} +0 -0
- /package/dist/{trillion3d-chunk-VQ7DWMHP.js.map → trillion3d-chunk-53CFT7G7.js.map} +0 -0
- /package/dist/{trillion3d-chunk-NUSOZ5NQ.js.map → trillion3d-chunk-53QFLAA3.js.map} +0 -0
- /package/dist/{trillion3d-chunk-I5PD2IYL.js.map → trillion3d-chunk-56N6ZOBE.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UXRH76J5.js.map → trillion3d-chunk-5E744XXD.js.map} +0 -0
- /package/dist/{trillion3d-chunk-NJW7NEZW.js.map → trillion3d-chunk-5KEW2ZOY.js.map} +0 -0
- /package/dist/{trillion3d-chunk-KCXWBXK2.js.map → trillion3d-chunk-5ORGGJA5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-XS7FCVOV.js.map → trillion3d-chunk-5RMOZCQA.js.map} +0 -0
- /package/dist/{trillion3d-chunk-AA2V3CRQ.js.map → trillion3d-chunk-5SJT7EQ3.js.map} +0 -0
- /package/dist/{trillion3d-chunk-B3ECL3UB.js.map → trillion3d-chunk-5TTX63XG.js.map} +0 -0
- /package/dist/{trillion3d-chunk-4KXFERR4.js.map → trillion3d-chunk-5WEWDH7F.js.map} +0 -0
- /package/dist/{trillion3d-chunk-P74SV4JJ.js.map → trillion3d-chunk-64WTBYW5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-77T2WOXU.js.map → trillion3d-chunk-6I7I5ZYU.js.map} +0 -0
- /package/dist/{trillion3d-chunk-CBPJFYIU.js.map → trillion3d-chunk-6OYOGQUQ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-GTJAMKXA.js.map → trillion3d-chunk-6PMAMKLI.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UX44ZL4D.js.map → trillion3d-chunk-6S7S5WI5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-OOOINENB.js.map → trillion3d-chunk-6UP3ZCNV.js.map} +0 -0
- /package/dist/{trillion3d-chunk-46P46SRG.js.map → trillion3d-chunk-6WOJ6TQD.js.map} +0 -0
- /package/dist/{trillion3d-chunk-LE7PGKD4.js.map → trillion3d-chunk-6WS2EEBU.js.map} +0 -0
- /package/dist/{trillion3d-chunk-N76JAZ32.js.map → trillion3d-chunk-6WUY2OOX.js.map} +0 -0
- /package/dist/{trillion3d-chunk-KITYCFGK.js.map → trillion3d-chunk-72FCWPUJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-FLJAAUWJ.js.map → trillion3d-chunk-72IAEP44.js.map} +0 -0
- /package/dist/{trillion3d-chunk-O3OYDVQH.js.map → trillion3d-chunk-77FPYTBQ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-SAYEA3NT.js.map → trillion3d-chunk-7AQANLZ3.js.map} +0 -0
- /package/dist/{trillion3d-chunk-K364ZTPY.js.map → trillion3d-chunk-7ATTJ3AJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5ASFLMJ6.js.map → trillion3d-chunk-7G4WOX6B.js.map} +0 -0
- /package/dist/{trillion3d-chunk-PU4JWKCC.js.map → trillion3d-chunk-7LIWCQGR.js.map} +0 -0
- /package/dist/{trillion3d-chunk-IGBD22JD.js.map → trillion3d-chunk-7N3FUKOD.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ETCQFZ4S.js.map → trillion3d-chunk-7QFOJHAZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-XAWENX7C.js.map → trillion3d-chunk-7TIVZUM6.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UL2YJ52J.js.map → trillion3d-chunk-7U7CHALH.js.map} +0 -0
- /package/dist/{trillion3d-chunk-KU7R2CLN.js.map → trillion3d-chunk-7UXM26LW.js.map} +0 -0
- /package/dist/{trillion3d-chunk-XUD7A3GH.js.map → trillion3d-chunk-7VTYT5MF.js.map} +0 -0
- /package/dist/{trillion3d-chunk-FYTCEF3P.js.map → trillion3d-chunk-A4ULELL5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-7NZTUQYT.js.map → trillion3d-chunk-ADMXPAEH.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZFEJXND5.js.map → trillion3d-chunk-AFRFQ25D.js.map} +0 -0
- /package/dist/{trillion3d-chunk-G6HYU5QH.js.map → trillion3d-chunk-AIB6NXH4.js.map} +0 -0
- /package/dist/{trillion3d-chunk-DZ5A6N23.js.map → trillion3d-chunk-AIQAWNNP.js.map} +0 -0
- /package/dist/{trillion3d-chunk-XI6O5F6V.js.map → trillion3d-chunk-AMJ6I7P4.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZNNO6SDC.js.map → trillion3d-chunk-AQAJMS5A.js.map} +0 -0
- /package/dist/{trillion3d-chunk-SYQOPTR2.js.map → trillion3d-chunk-ARDABN2G.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5HWOHERQ.js.map → trillion3d-chunk-B3QB55EK.js.map} +0 -0
- /package/dist/{trillion3d-chunk-AYJO3NNO.js.map → trillion3d-chunk-B5NXEPES.js.map} +0 -0
- /package/dist/{trillion3d-chunk-36VHFR62.js.map → trillion3d-chunk-BARQSI5Q.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ESO5KVG2.js.map → trillion3d-chunk-BCYA7LWA.js.map} +0 -0
- /package/dist/{trillion3d-chunk-3HPFLXCF.js.map → trillion3d-chunk-BIBJMHIN.js.map} +0 -0
- /package/dist/{trillion3d-chunk-H5B36GHI.js.map → trillion3d-chunk-BIGALHRE.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QW7R4JSU.js.map → trillion3d-chunk-BKON7HDQ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-IGH6C5NL.js.map → trillion3d-chunk-BRHXHYWB.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JXEBQPRX.js.map → trillion3d-chunk-BVXHXONN.js.map} +0 -0
- /package/dist/{trillion3d-chunk-POPUJ5RT.js.map → trillion3d-chunk-BWPZMIFY.js.map} +0 -0
- /package/dist/{trillion3d-chunk-CPLMDH47.js.map → trillion3d-chunk-C2WWWTMZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZDT7Z7AV.js.map → trillion3d-chunk-C7DCG2NV.js.map} +0 -0
- /package/dist/{trillion3d-chunk-IVAI2C6D.js.map → trillion3d-chunk-CCZJZMRJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ADUR3TJH.js.map → trillion3d-chunk-CFIW2PLU.js.map} +0 -0
- /package/dist/{trillion3d-chunk-WPZHDV22.js.map → trillion3d-chunk-CH3UKBVF.js.map} +0 -0
- /package/dist/{trillion3d-chunk-OG5M47HN.js.map → trillion3d-chunk-COAMUWUG.js.map} +0 -0
- /package/dist/{trillion3d-chunk-Q4XTYMSK.js.map → trillion3d-chunk-CS3EWLHS.js.map} +0 -0
- /package/dist/{trillion3d-chunk-WLOE6LQT.js.map → trillion3d-chunk-CS6MYZM7.js.map} +0 -0
- /package/dist/{trillion3d-chunk-KEQDYXLL.js.map → trillion3d-chunk-CSVCHCKI.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JO55XZVA.js.map → trillion3d-chunk-CYW43B6C.js.map} +0 -0
- /package/dist/{trillion3d-chunk-NH3GZRI7.js.map → trillion3d-chunk-D2UJO22L.js.map} +0 -0
- /package/dist/{trillion3d-chunk-Y3SDC6TY.js.map → trillion3d-chunk-D5LNZFJU.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QEJGU4DQ.js.map → trillion3d-chunk-DJIWKT4L.js.map} +0 -0
- /package/dist/{trillion3d-chunk-XM5IBOQ3.js.map → trillion3d-chunk-DNAAW2B5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-SM64HJZI.js.map → trillion3d-chunk-DOXBXQJU.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2PBJSBLO.js.map → trillion3d-chunk-DQVEKWHY.js.map} +0 -0
- /package/dist/{trillion3d-chunk-AA6W2SUV.js.map → trillion3d-chunk-DQYIKRAI.js.map} +0 -0
- /package/dist/{trillion3d-chunk-3BY2FPRS.js.map → trillion3d-chunk-DX5UNL5O.js.map} +0 -0
- /package/dist/{trillion3d-chunk-PQH6Z3ZK.js.map → trillion3d-chunk-EF6DURKO.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2JAAFFQC.js.map → trillion3d-chunk-EKH44M5H.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JRLCX4ZB.js.map → trillion3d-chunk-EKHMHUHO.js.map} +0 -0
- /package/dist/{trillion3d-chunk-CJHN7L75.js.map → trillion3d-chunk-EKMPAWJU.js.map} +0 -0
- /package/dist/{trillion3d-chunk-HDA6WCOZ.js.map → trillion3d-chunk-ELCIIOBC.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JRVTAQY2.js.map → trillion3d-chunk-EME34J3O.js.map} +0 -0
- /package/dist/{trillion3d-chunk-FDP5PHNI.js.map → trillion3d-chunk-EMNL3VBH.js.map} +0 -0
- /package/dist/{trillion3d-chunk-PUS6DQHP.js.map → trillion3d-chunk-EOA6RIXX.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZSTYK7WY.js.map → trillion3d-chunk-ESEYMHSX.js.map} +0 -0
- /package/dist/{trillion3d-chunk-KJXQTIKM.js.map → trillion3d-chunk-EVWXSXV3.js.map} +0 -0
- /package/dist/{trillion3d-chunk-T43PRG7O.js.map → trillion3d-chunk-EW3266JI.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2JM7B67K.js.map → trillion3d-chunk-F5ZFHT7O.js.map} +0 -0
- /package/dist/{trillion3d-chunk-YTL2XIXN.js.map → trillion3d-chunk-FBPHTYO3.js.map} +0 -0
- /package/dist/{trillion3d-chunk-EO2IHUHA.js.map → trillion3d-chunk-FCITXHHL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2OFUDJNU.js.map → trillion3d-chunk-FG4VFY2I.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JN2SWJKC.js.map → trillion3d-chunk-FJ6PAVLE.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UTTH7HS7.js.map → trillion3d-chunk-FNZKGTZC.js.map} +0 -0
- /package/dist/{trillion3d-chunk-AZ6SQT7V.js.map → trillion3d-chunk-FVKZE7SE.js.map} +0 -0
- /package/dist/{trillion3d-chunk-472QQ27C.js.map → trillion3d-chunk-FXEJM7VG.js.map} +0 -0
- /package/dist/{trillion3d-chunk-7QYR7QUU.js.map → trillion3d-chunk-FYXZW5DA.js.map} +0 -0
- /package/dist/{trillion3d-chunk-X2FMWMUT.js.map → trillion3d-chunk-G3DRTVHN.js.map} +0 -0
- /package/dist/{trillion3d-chunk-KYDPV56Z.js.map → trillion3d-chunk-G4AJOGQ7.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5ROJIVV3.js.map → trillion3d-chunk-GEI5JB66.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2VZIVK5U.js.map → trillion3d-chunk-GHFAPXBM.js.map} +0 -0
- /package/dist/{trillion3d-chunk-KS3GXZPA.js.map → trillion3d-chunk-GI2T6FOU.js.map} +0 -0
- /package/dist/{trillion3d-chunk-W4SMNFPI.js.map → trillion3d-chunk-GJZNN5UJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-PN2YD2PU.js.map → trillion3d-chunk-GK2DII6G.js.map} +0 -0
- /package/dist/{trillion3d-chunk-SLLV2LYS.js.map → trillion3d-chunk-GPVAVLAF.js.map} +0 -0
- /package/dist/{trillion3d-chunk-S25VCORA.js.map → trillion3d-chunk-GTR23Z5K.js.map} +0 -0
- /package/dist/{trillion3d-chunk-K3434KA7.js.map → trillion3d-chunk-GVOSTFBW.js.map} +0 -0
- /package/dist/{trillion3d-chunk-M63PPBDR.js.map → trillion3d-chunk-GYORYIF5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JLJSXR5R.js.map → trillion3d-chunk-H3DVML7I.js.map} +0 -0
- /package/dist/{trillion3d-chunk-F4TG7DXL.js.map → trillion3d-chunk-H7KLPWI5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-WUZB5LTJ.js.map → trillion3d-chunk-H7LQGPKQ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-I2L32YAH.js.map → trillion3d-chunk-HBJ6VZPO.js.map} +0 -0
- /package/dist/{trillion3d-chunk-HTCY6CIU.js.map → trillion3d-chunk-HBMBGWN2.js.map} +0 -0
- /package/dist/{trillion3d-chunk-7CSS2AWO.js.map → trillion3d-chunk-HBSLKLSZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-Y4MIWQBS.js.map → trillion3d-chunk-HCG3ESSV.js.map} +0 -0
- /package/dist/{trillion3d-chunk-YQC77N7M.js.map → trillion3d-chunk-HDQGK2TL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QPNQ6MAU.js.map → trillion3d-chunk-HRCLDXIF.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2KRIKK4D.js.map → trillion3d-chunk-HRIARS44.js.map} +0 -0
- /package/dist/{trillion3d-chunk-GPKNAWFR.js.map → trillion3d-chunk-HV2YN5CF.js.map} +0 -0
- /package/dist/{trillion3d-chunk-I7R4YZP2.js.map → trillion3d-chunk-I5M3F6OY.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZTYP3T5T.js.map → trillion3d-chunk-I75EGJAB.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UH663TJS.js.map → trillion3d-chunk-I7QRTDI7.js.map} +0 -0
- /package/dist/{trillion3d-chunk-K5D3PLUN.js.map → trillion3d-chunk-IAELZYJF.js.map} +0 -0
- /package/dist/{trillion3d-chunk-LHFBY6CF.js.map → trillion3d-chunk-ICJUDIVR.js.map} +0 -0
- /package/dist/{trillion3d-chunk-OPFDHDV7.js.map → trillion3d-chunk-IEYEFEDV.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2HSBVYCY.js.map → trillion3d-chunk-IFLJYROA.js.map} +0 -0
- /package/dist/{trillion3d-chunk-74PQZHDK.js.map → trillion3d-chunk-IFZHDHIG.js.map} +0 -0
- /package/dist/{trillion3d-chunk-J2KR4G6F.js.map → trillion3d-chunk-IHNPAPHM.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5GW525BI.js.map → trillion3d-chunk-IJJXMYSL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-XHUSYLI3.js.map → trillion3d-chunk-IJMFDLYO.js.map} +0 -0
- /package/dist/{trillion3d-chunk-EIOQWCJW.js.map → trillion3d-chunk-INTWD5DJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-SCJINCDV.js.map → trillion3d-chunk-IWP6655A.js.map} +0 -0
- /package/dist/{trillion3d-chunk-42JJO5YV.js.map → trillion3d-chunk-IZTRWVNI.js.map} +0 -0
- /package/dist/{trillion3d-chunk-GXMTFTCW.js.map → trillion3d-chunk-J2BIHJ55.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ECWU67MC.js.map → trillion3d-chunk-J3NX2PWF.js.map} +0 -0
- /package/dist/{trillion3d-chunk-KEIULYWY.js.map → trillion3d-chunk-J6G75W5Q.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QDNYR3XW.js.map → trillion3d-chunk-J7ML34IT.js.map} +0 -0
- /package/dist/{trillion3d-chunk-F2BKXVDP.js.map → trillion3d-chunk-JD25N5D6.js.map} +0 -0
- /package/dist/{trillion3d-chunk-YI2MFQEG.js.map → trillion3d-chunk-JDIIZKDU.js.map} +0 -0
- /package/dist/{trillion3d-chunk-FJRD6RXY.js.map → trillion3d-chunk-JHRQF53B.js.map} +0 -0
- /package/dist/{trillion3d-chunk-S4P42ZHN.js.map → trillion3d-chunk-JPN76QOL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-MUZUZS2F.js.map → trillion3d-chunk-JRCGXELE.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QGELETHW.js.map → trillion3d-chunk-JXIMDH6A.js.map} +0 -0
- /package/dist/{trillion3d-chunk-P75YOB5K.js.map → trillion3d-chunk-K6R7UEQZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-LV5NP2OD.js.map → trillion3d-chunk-K72UANQN.js.map} +0 -0
- /package/dist/{trillion3d-chunk-BZAV5BK7.js.map → trillion3d-chunk-KKECIVIP.js.map} +0 -0
- /package/dist/{trillion3d-chunk-XYP27BGE.js.map → trillion3d-chunk-KLGN5XV3.js.map} +0 -0
- /package/dist/{trillion3d-chunk-I63LRS3P.js.map → trillion3d-chunk-KLIGAVUH.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZHRUP5WY.js.map → trillion3d-chunk-KLP7IBDS.js.map} +0 -0
- /package/dist/{trillion3d-chunk-W42TUOJC.js.map → trillion3d-chunk-KPFGILKK.js.map} +0 -0
- /package/dist/{trillion3d-chunk-G5MFUE5P.js.map → trillion3d-chunk-KR4PIU6F.js.map} +0 -0
- /package/dist/{trillion3d-chunk-D4DXAQPJ.js.map → trillion3d-chunk-KRV5VQCR.js.map} +0 -0
- /package/dist/{trillion3d-chunk-PSMSPY5U.js.map → trillion3d-chunk-KUJMOLHB.js.map} +0 -0
- /package/dist/{trillion3d-chunk-3EPZT7SR.js.map → trillion3d-chunk-KUKNVBWH.js.map} +0 -0
- /package/dist/{trillion3d-chunk-Y322OCAR.js.map → trillion3d-chunk-KXM3DYQH.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2MVQXOFZ.js.map → trillion3d-chunk-L2F5RZRX.js.map} +0 -0
- /package/dist/{trillion3d-chunk-DUWMZGSW.js.map → trillion3d-chunk-L2FRHLXI.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2TYAUOQ5.js.map → trillion3d-chunk-L3VCBYGD.js.map} +0 -0
- /package/dist/{trillion3d-chunk-MQEVNNBK.js.map → trillion3d-chunk-LAAPTFVW.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2CZ6RWTW.js.map → trillion3d-chunk-LANLTCBQ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UCGD7DGZ.js.map → trillion3d-chunk-LE4HL44Z.js.map} +0 -0
- /package/dist/{trillion3d-chunk-7CGRPLOC.js.map → trillion3d-chunk-LEY2Q6DZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-SKH3XZ4Q.js.map → trillion3d-chunk-LMWJTQFR.js.map} +0 -0
- /package/dist/{trillion3d-chunk-VGIJRZO5.js.map → trillion3d-chunk-LQLIXMMD.js.map} +0 -0
- /package/dist/{trillion3d-chunk-Z6ISTRN2.js.map → trillion3d-chunk-LTWG3NOL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-OXKMBXZD.js.map → trillion3d-chunk-M773YMP6.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZTNOBS5G.js.map → trillion3d-chunk-MAKYPLYF.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5LQDA7UM.js.map → trillion3d-chunk-MCNOP7UR.js.map} +0 -0
- /package/dist/{trillion3d-chunk-GUWCZ2WR.js.map → trillion3d-chunk-MCSS3F6E.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZXGUNSUQ.js.map → trillion3d-chunk-MF4CAU3R.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZXF6BEYU.js.map → trillion3d-chunk-MJTRABFR.js.map} +0 -0
- /package/dist/{trillion3d-chunk-AU725OCC.js.map → trillion3d-chunk-MQBDHCB3.js.map} +0 -0
- /package/dist/{trillion3d-chunk-R3HHRSA5.js.map → trillion3d-chunk-MUMQYHCQ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-P2RDFAA2.js.map → trillion3d-chunk-MXZGFCOM.js.map} +0 -0
- /package/dist/{trillion3d-chunk-J5SMDUDO.js.map → trillion3d-chunk-N33FXDXZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-LHHZH3SV.js.map → trillion3d-chunk-N7YEU2CT.js.map} +0 -0
- /package/dist/{trillion3d-chunk-BUP4DDEO.js.map → trillion3d-chunk-NB7XML37.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5ONOJMSW.js.map → trillion3d-chunk-NBFOHDNN.js.map} +0 -0
- /package/dist/{trillion3d-chunk-CQESL7F5.js.map → trillion3d-chunk-NEVMYKGT.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ICWUGQNV.js.map → trillion3d-chunk-NHC4DXYP.js.map} +0 -0
- /package/dist/{trillion3d-chunk-MEMYKAVP.js.map → trillion3d-chunk-NNF42O54.js.map} +0 -0
- /package/dist/{trillion3d-chunk-B3ATF6PP.js.map → trillion3d-chunk-NTHEHPA5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-P4Q7TPID.js.map → trillion3d-chunk-NVYEQ3JS.js.map} +0 -0
- /package/dist/{trillion3d-chunk-BDWRLDJI.js.map → trillion3d-chunk-NZRMWUGY.js.map} +0 -0
- /package/dist/{trillion3d-chunk-Y2DWPDRM.js.map → trillion3d-chunk-OD3JBU6D.js.map} +0 -0
- /package/dist/{trillion3d-chunk-3GEQFGGV.js.map → trillion3d-chunk-OFCF3GAC.js.map} +0 -0
- /package/dist/{trillion3d-chunk-U3CLZW3E.js.map → trillion3d-chunk-OHFYUKAD.js.map} +0 -0
- /package/dist/{trillion3d-chunk-NFFLZRMN.js.map → trillion3d-chunk-OHTUNWUN.js.map} +0 -0
- /package/dist/{trillion3d-chunk-TLVZXCTJ.js.map → trillion3d-chunk-OLDTBAXR.js.map} +0 -0
- /package/dist/{trillion3d-chunk-XYMF73ZW.js.map → trillion3d-chunk-OYZFVYYH.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZUU5E7FO.js.map → trillion3d-chunk-P35JRX3H.js.map} +0 -0
- /package/dist/{trillion3d-chunk-HCXQHHY4.js.map → trillion3d-chunk-P3HTLS2O.js.map} +0 -0
- /package/dist/{trillion3d-chunk-XXCX4QIN.js.map → trillion3d-chunk-P7UZ7W2B.js.map} +0 -0
- /package/dist/{trillion3d-chunk-E5M5PMK3.js.map → trillion3d-chunk-PDWU4CCX.js.map} +0 -0
- /package/dist/{trillion3d-chunk-EZ2JYRNP.js.map → trillion3d-chunk-PFMAOUBW.js.map} +0 -0
- /package/dist/{trillion3d-chunk-M2F7Q77E.js.map → trillion3d-chunk-PHE5OKAE.js.map} +0 -0
- /package/dist/{trillion3d-chunk-7F2KAZFC.js.map → trillion3d-chunk-PMF6JTVJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-GXDVY3QD.js.map → trillion3d-chunk-PXYUWON5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-HBFRB6UY.js.map → trillion3d-chunk-PYVXDVAE.js.map} +0 -0
- /package/dist/{trillion3d-chunk-EAHDFM7D.js.map → trillion3d-chunk-PZBXWJFT.js.map} +0 -0
- /package/dist/{trillion3d-chunk-URXU62XN.js.map → trillion3d-chunk-Q2T4HBTW.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QFWHSCJS.js.map → trillion3d-chunk-QAHCZ4CN.js.map} +0 -0
- /package/dist/{trillion3d-chunk-WFPJ35TV.js.map → trillion3d-chunk-QFIAXDBJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-EU4OYQGR.js.map → trillion3d-chunk-QGHAYZR3.js.map} +0 -0
- /package/dist/{trillion3d-chunk-MBN7REAP.js.map → trillion3d-chunk-QMREUFAO.js.map} +0 -0
- /package/dist/{trillion3d-chunk-NH7JVT4M.js.map → trillion3d-chunk-QN7VBGUP.js.map} +0 -0
- /package/dist/{trillion3d-chunk-V4M3HNJD.js.map → trillion3d-chunk-QVFWEZOK.js.map} +0 -0
- /package/dist/{trillion3d-chunk-LZSYLDTU.js.map → trillion3d-chunk-QW5YCJAB.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UBMIQXK3.js.map → trillion3d-chunk-R2A7QWWZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-V6HD2TKX.js.map → trillion3d-chunk-R4BXG67P.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5KHPSLRC.js.map → trillion3d-chunk-R56L2MST.js.map} +0 -0
- /package/dist/{trillion3d-chunk-S2JLIIRM.js.map → trillion3d-chunk-RLDDQEQJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-7IZI5OZK.js.map → trillion3d-chunk-RMFAMI5T.js.map} +0 -0
- /package/dist/{trillion3d-chunk-WJBLDQVZ.js.map → trillion3d-chunk-ROHK5HT5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-YWUEHJ6S.js.map → trillion3d-chunk-RPMC2FKD.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JVNGK4EV.js.map → trillion3d-chunk-RTBXAMIZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-EUCLXLYS.js.map → trillion3d-chunk-S2NA64OJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-DA3S4LZH.js.map → trillion3d-chunk-SPIIJAMX.js.map} +0 -0
- /package/dist/{trillion3d-chunk-MLBX4WMV.js.map → trillion3d-chunk-SSWVBSJZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-AEW6BD4P.js.map → trillion3d-chunk-SUDBSFLJ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-VCIRYPE7.js.map → trillion3d-chunk-SUU45ZK7.js.map} +0 -0
- /package/dist/{trillion3d-chunk-CMHKMP7M.js.map → trillion3d-chunk-TFNOURGL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZM6OWZBZ.js.map → trillion3d-chunk-TLIN2DEK.js.map} +0 -0
- /package/dist/{trillion3d-chunk-7C5HNDEL.js.map → trillion3d-chunk-TLO4XKYG.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZKTXPZUU.js.map → trillion3d-chunk-TVYIOVGI.js.map} +0 -0
- /package/dist/{trillion3d-chunk-GOFFACVN.js.map → trillion3d-chunk-TY7RGAI4.js.map} +0 -0
- /package/dist/{trillion3d-chunk-MCIY254D.js.map → trillion3d-chunk-UBSICE2S.js.map} +0 -0
- /package/dist/{trillion3d-chunk-G4ZEQPJE.js.map → trillion3d-chunk-UCIL746V.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5VX27QFH.js.map → trillion3d-chunk-UGTFIP7T.js.map} +0 -0
- /package/dist/{trillion3d-chunk-FBPR5PIL.js.map → trillion3d-chunk-UH2X4DC7.js.map} +0 -0
- /package/dist/{trillion3d-chunk-KWS6MEDX.js.map → trillion3d-chunk-UL5AQCHN.js.map} +0 -0
- /package/dist/{trillion3d-chunk-NQT36E2Z.js.map → trillion3d-chunk-UMAIYYSB.js.map} +0 -0
- /package/dist/{trillion3d-chunk-CD7EZNRP.js.map → trillion3d-chunk-UROCVT3W.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZHV4B2CP.js.map → trillion3d-chunk-US6WKM5M.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UPJHDFQP.js.map → trillion3d-chunk-UT5VM3B7.js.map} +0 -0
- /package/dist/{trillion3d-chunk-VYQB6KF6.js.map → trillion3d-chunk-UXCQ7A3K.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QHLP3RMM.js.map → trillion3d-chunk-UXQKO5IH.js.map} +0 -0
- /package/dist/{trillion3d-chunk-TZ3XBBRE.js.map → trillion3d-chunk-UXRWIFOC.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2BOYJZCQ.js.map → trillion3d-chunk-V44TZZB3.js.map} +0 -0
- /package/dist/{trillion3d-chunk-DPXM3DHU.js.map → trillion3d-chunk-VFPDIIEP.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5GY24CJD.js.map → trillion3d-chunk-VL44QEQI.js.map} +0 -0
- /package/dist/{trillion3d-chunk-J2YDEAKO.js.map → trillion3d-chunk-VP3GS2OQ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-WOE7ECLG.js.map → trillion3d-chunk-VWRK33DS.js.map} +0 -0
- /package/dist/{trillion3d-chunk-E2VRYXCO.js.map → trillion3d-chunk-W2AGULE7.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JH7I4RDZ.js.map → trillion3d-chunk-W4L4ZLLZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-742WGJYH.js.map → trillion3d-chunk-WAR4LFLB.js.map} +0 -0
- /package/dist/{trillion3d-chunk-4BOD343S.js.map → trillion3d-chunk-WCVRKGQD.js.map} +0 -0
- /package/dist/{trillion3d-chunk-AYCFHOHV.js.map → trillion3d-chunk-WEACAP55.js.map} +0 -0
- /package/dist/{trillion3d-chunk-O6RA4K6A.js.map → trillion3d-chunk-WG6NZENK.js.map} +0 -0
- /package/dist/{trillion3d-chunk-YIE3H5JS.js.map → trillion3d-chunk-WJ4XQVTQ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JFCEIZBH.js.map → trillion3d-chunk-WR43FBB3.js.map} +0 -0
- /package/dist/{trillion3d-chunk-CVJOTXK5.js.map → trillion3d-chunk-WXECWHZ5.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZVO6IOK3.js.map → trillion3d-chunk-WYKIXSUS.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZSKD2IX5.js.map → trillion3d-chunk-XBDQHYBL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-6VDAUYE6.js.map → trillion3d-chunk-XEPOPZZY.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5COTXELO.js.map → trillion3d-chunk-XEQBUJNB.js.map} +0 -0
- /package/dist/{trillion3d-chunk-4JBRHV7G.js.map → trillion3d-chunk-XL4F65A7.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QLEZIRFO.js.map → trillion3d-chunk-XOAWZNRA.js.map} +0 -0
- /package/dist/{trillion3d-chunk-S47ADXWU.js.map → trillion3d-chunk-XQHULSDL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-FPH3NDSE.js.map → trillion3d-chunk-XQSMKVTL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-OVVY7IKC.js.map → trillion3d-chunk-XQSU4SY6.js.map} +0 -0
- /package/dist/{trillion3d-chunk-UR2BLLWY.js.map → trillion3d-chunk-XWJQJK22.js.map} +0 -0
- /package/dist/{trillion3d-chunk-RUOI3D3D.js.map → trillion3d-chunk-XXOXGG47.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5B3ML3DL.js.map → trillion3d-chunk-XY7DNXWL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-7XEWHG3S.js.map → trillion3d-chunk-XYZRT3VR.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JOPRGF7Z.js.map → trillion3d-chunk-XZPUDNQA.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QZURF55R.js.map → trillion3d-chunk-Y2RAGKRM.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QOKJKCXP.js.map → trillion3d-chunk-YA4TWJRK.js.map} +0 -0
- /package/dist/{trillion3d-chunk-2L52NUG7.js.map → trillion3d-chunk-YAFEYU2S.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ABKLIRWX.js.map → trillion3d-chunk-YBKRRMOT.js.map} +0 -0
- /package/dist/{trillion3d-chunk-LB2MHAHM.js.map → trillion3d-chunk-YFSDLEIZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-LHCO3J7M.js.map → trillion3d-chunk-YIUAOG6X.js.map} +0 -0
- /package/dist/{trillion3d-chunk-PPUZR76B.js.map → trillion3d-chunk-YKZXAXMM.js.map} +0 -0
- /package/dist/{trillion3d-chunk-U4EL7JGK.js.map → trillion3d-chunk-YMR3WF2W.js.map} +0 -0
- /package/dist/{trillion3d-chunk-RB22IHFT.js.map → trillion3d-chunk-YNRZO4Y4.js.map} +0 -0
- /package/dist/{trillion3d-chunk-SIPUEAJ5.js.map → trillion3d-chunk-YOXV4W6I.js.map} +0 -0
- /package/dist/{trillion3d-chunk-V2BAFU66.js.map → trillion3d-chunk-YQT76FYC.js.map} +0 -0
- /package/dist/{trillion3d-chunk-Y42MTEVG.js.map → trillion3d-chunk-YRPBW7AK.js.map} +0 -0
- /package/dist/{trillion3d-chunk-M2AYPZAT.js.map → trillion3d-chunk-YULZ6QUZ.js.map} +0 -0
- /package/dist/{trillion3d-chunk-N45WPUNA.js.map → trillion3d-chunk-YWWOBEV2.js.map} +0 -0
- /package/dist/{trillion3d-chunk-EI2XZGZC.js.map → trillion3d-chunk-YYWNNHNI.js.map} +0 -0
- /package/dist/{trillion3d-chunk-IWBFD73G.js.map → trillion3d-chunk-ZBIQ6S5Z.js.map} +0 -0
- /package/dist/{trillion3d-chunk-ZGWEZTGI.js.map → trillion3d-chunk-ZBXTCONH.js.map} +0 -0
- /package/dist/{trillion3d-chunk-TI3PM7XW.js.map → trillion3d-chunk-ZDNFJYCW.js.map} +0 -0
- /package/dist/{trillion3d-chunk-6Y7TZO62.js.map → trillion3d-chunk-ZF5EDFJS.js.map} +0 -0
- /package/dist/{trillion3d-chunk-QCE7DOXK.js.map → trillion3d-chunk-ZFAKVFKL.js.map} +0 -0
- /package/dist/{trillion3d-chunk-V6VZ5QXG.js.map → trillion3d-chunk-ZIGGUJM6.js.map} +0 -0
- /package/dist/{trillion3d-chunk-KTGIIVAQ.js.map → trillion3d-chunk-ZNJ4TNBW.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JQ2VUCTW.js.map → trillion3d-chunk-ZQPT2YFE.js.map} +0 -0
- /package/dist/{trillion3d-chunk-JCTPF4CK.js.map → trillion3d-chunk-ZUFX2HVV.js.map} +0 -0
- /package/dist/{trillion3d-chunk-S4NKU3YU.js.map → trillion3d-chunk-ZUQDRSYB.js.map} +0 -0
- /package/dist/{trillion3d-chunk-TWFQBYBV.js.map → trillion3d-chunk-ZVSX6CGW.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5K6QSSBR.js.map → trillion3d-chunk-ZYS4E37Q.js.map} +0 -0
- /package/dist/{trillion3d-chunk-5VVVL3GH.js.map → trillion3d-chunk-ZZWX6Q7H.js.map} +0 -0
- /package/dist/{trillion3d-cinematicsCode-5UPGQFVV.js.map → trillion3d-cinematicsCode-2YP657C3.js.map} +0 -0
- /package/dist/{trillion3d-cubeCapturesCode-LCBK47X5.js.map → trillion3d-cubeCapturesCode-BOLBDRJD.js.map} +0 -0
- /package/dist/{trillion3d-debugViewsCode-7GJW7RDI.js.map → trillion3d-debugViewsCode-F4KTKXOZ.js.map} +0 -0
- /package/dist/{trillion3d-decalCode-ID2FWTA7.js.map → trillion3d-decalCode-4OSGACRW.js.map} +0 -0
- /package/dist/{trillion3d-deformationCode-PIIEMRNF.js.map → trillion3d-deformationCode-GJBRRE4B.js.map} +0 -0
- /package/dist/{trillion3d-displacementCode-ZMPJRUDW.js.map → trillion3d-displacementCode-OS37YHNO.js.map} +0 -0
- /package/dist/{trillion3d-effectCode-J22OGAGG.js.map → trillion3d-effectCode-CNDEXEFI.js.map} +0 -0
- /package/dist/{trillion3d-explorer-JTT6UBU6.js.map → trillion3d-explorer-3SU2HTGD.js.map} +0 -0
- /package/dist/{trillion3d-export-H3WTWO2M.js.map → trillion3d-export-3COKIWS6.js.map} +0 -0
- /package/dist/{trillion3d-family-IM6JIBGG.js.map → trillion3d-family-YNJWVKWC.js.map} +0 -0
- /package/dist/{trillion3d-fieldsCode-QD2TBZOM.js.map → trillion3d-fieldsCode-JQLVIT4H.js.map} +0 -0
- /package/dist/{trillion3d-fogCode-PNHAG2DD.js.map → trillion3d-fogCode-PM5UY2TW.js.map} +0 -0
- /package/dist/{trillion3d-geometryPage-3J5Q2EZN.js.map → trillion3d-geometryPage-DVJ4N2A6.js.map} +0 -0
- /package/dist/{trillion3d-graphCode-DWZUBHZQ.js.map → trillion3d-graphCode-MCIPPACK.js.map} +0 -0
- /package/dist/{trillion3d-graphCode-HGVQ47X4.js.map → trillion3d-graphCode-MOTJ4WBF.js.map} +0 -0
- /package/dist/{trillion3d-grassCode-HASCTGFB.js.map → trillion3d-grassCode-J7CCF63J.js.map} +0 -0
- /package/dist/{trillion3d-guideCode-XKNU3UOB.js.map → trillion3d-guideCode-ONWTGY2H.js.map} +0 -0
- /package/dist/{trillion3d-hairCode-VUMV4M33.js.map → trillion3d-hairCode-PNWJMXWH.js.map} +0 -0
- /package/dist/{trillion3d-hardwareBenchmark-H2SLAEER.js.map → trillion3d-hardwareBenchmark-JD2ITGNS.js.map} +0 -0
- /package/dist/{trillion3d-headlessCode-3KBNVKND.js.map → trillion3d-headlessCode-JAXG4XPK.js.map} +0 -0
- /package/dist/{trillion3d-iesCode-GVJDBPQY.js.map → trillion3d-iesCode-QVSRIT37.js.map} +0 -0
- /package/dist/{trillion3d-indicator-VCCCRO7K.js.map → trillion3d-indicator-ZDOOX6EU.js.map} +0 -0
- /package/dist/{trillion3d-installCode-GDJ6EA73.js.map → trillion3d-installCode-5NOFNOTZ.js.map} +0 -0
- /package/dist/{trillion3d-manifestLoad-Y2XKGXCD.js.map → trillion3d-manifestLoad-TEO2A7XO.js.map} +0 -0
- /package/dist/{trillion3d-markCode-VYWQBD3K.js.map → trillion3d-markCode-DD7RPZ2V.js.map} +0 -0
- /package/dist/{trillion3d-modelArrivalCode-ENI7UWDQ.js.map → trillion3d-modelArrivalCode-AS2ZIO5I.js.map} +0 -0
- /package/dist/{trillion3d-modelCapture-BMLNM2DT.js.map → trillion3d-modelCapture-OZNK2KHI.js.map} +0 -0
- /package/dist/{trillion3d-modelCopiesCode-7JYQXGVF.js.map → trillion3d-modelCopiesCode-X7PCUUUT.js.map} +0 -0
- /package/dist/{trillion3d-modelImagesCode-C3O4XMTN.js.map → trillion3d-modelImagesCode-7NZ3BIL5.js.map} +0 -0
- /package/dist/{trillion3d-pageAudioCode-JV4TWD5B.js.map → trillion3d-pageAudioCode-PQWNFXNH.js.map} +0 -0
- /package/dist/{trillion3d-pageCompile-YNZYXLLY.js.map → trillion3d-pageCompile-4KI5TP2J.js.map} +0 -0
- /package/dist/{trillion3d-panel-RYDJZQFJ.js.map → trillion3d-panel-4BMTNA6N.js.map} +0 -0
- /package/dist/{trillion3d-particleCode-244NV3QC.js.map → trillion3d-particleCode-X7RJYMM2.js.map} +0 -0
- /package/dist/{trillion3d-partitionCode-LJW6NXJO.js.map → trillion3d-partitionCode-KNTGZUZG.js.map} +0 -0
- /package/dist/{trillion3d-pathTracingCode-PY4YXX2K.js.map → trillion3d-pathTracingCode-IUDUNO7P.js.map} +0 -0
- /package/dist/{trillion3d-planarReflectionsCode-3HPS33JS.js.map → trillion3d-planarReflectionsCode-22NVSPZ2.js.map} +0 -0
- /package/dist/{trillion3d-previewRun-MYYO5L7K.js.map → trillion3d-previewRun-YOUFRKDJ.js.map} +0 -0
- /package/dist/{trillion3d-ragdollCode-Q2F4YXCT.js.map → trillion3d-ragdollCode-XOZ7BBU4.js.map} +0 -0
- /package/dist/{trillion3d-ragdollStage-673NKNJC.js.map → trillion3d-ragdollStage-EGRNR3QB.js.map} +0 -0
- /package/dist/{trillion3d-read-KTRGUDEK.js.map → trillion3d-read-6L2UR4EJ.js.map} +0 -0
- /package/dist/{trillion3d-reflectionsCode-EYZ2I2RG.js.map → trillion3d-reflectionsCode-3T6W62HT.js.map} +0 -0
- /package/dist/{trillion3d-sampledLightsCode-44YPQANZ.js.map → trillion3d-sampledLightsCode-MSZ2YCSJ.js.map} +0 -0
- /package/dist/{trillion3d-scene-VDR67XPZ.js.map → trillion3d-scene-3LL23MZI.js.map} +0 -0
- /package/dist/{trillion3d-session-V5UGVDGM.js.map → trillion3d-session-S4GIQNV6.js.map} +0 -0
- /package/dist/{trillion3d-shadowsCode-IGFSPJZS.js.map → trillion3d-shadowsCode-UZNPLVCV.js.map} +0 -0
- /package/dist/{trillion3d-skyCode-VIAPJ6TS.js.map → trillion3d-skyCode-BYIIBWAM.js.map} +0 -0
- /package/dist/{trillion3d-sortedTranslucencyCode-ENOIPRNP.js.map → trillion3d-sortedTranslucencyCode-VLSTGX5S.js.map} +0 -0
- /package/dist/{trillion3d-splineMeshCode-X6CFRALJ.js.map → trillion3d-splineMeshCode-AWDX5BIG.js.map} +0 -0
- /package/dist/{trillion3d-subsurfaceCode-L36SYFNH.js.map → trillion3d-subsurfaceCode-PROXJTLS.js.map} +0 -0
- /package/dist/{trillion3d-surfaceCode-J3JUDHSC.js.map → trillion3d-surfaceCode-CW2NSI5O.js.map} +0 -0
- /package/dist/{trillion3d-terrainCode-BHCQQRET.js.map → trillion3d-terrainCode-ZDONXR5X.js.map} +0 -0
- /package/dist/{trillion3d-transformCode-74Z7PQYM.js.map → trillion3d-transformCode-SE55EUCN.js.map} +0 -0
- /package/dist/{trillion3d-translucentLightVolumeCode-3HU4TBPQ.js.map → trillion3d-translucentLightVolumeCode-EQKMCGMD.js.map} +0 -0
- /package/dist/{trillion3d-viewCode-IXEIJJWS.js.map → trillion3d-viewCode-52L7D5ZW.js.map} +0 -0
- /package/dist/{trillion3d-volumesCode-RDBBXG3U.js.map → trillion3d-volumesCode-NYAC6KYU.js.map} +0 -0
- /package/dist/{trillion3d-waterCode-3ZRB2JP7.js.map → trillion3d-waterCode-CWZ5XYNU.js.map} +0 -0
- /package/dist/{trillion3d-webgpuCode-BQTJL2EM.js.map → trillion3d-webgpuCode-2GNPUWQ4.js.map} +0 -0
- /package/dist/{trillion3d-workCode-V42SMDJA.js.map → trillion3d-workCode-DCC25A2D.js.map} +0 -0
- /package/dist/{trillion3d-worldRootPages-3SFAHS63.js.map → trillion3d-worldRootPages-P75VSIXR.js.map} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var hoe=Object.defineProperty;var AF=(e,t)=>{for(var r in t)hoe(e,r,{get:t[r],enumerable:!0})};var moe={version:"1.0.3-next.0"},goe=moe.version,pT=13,ia=14,hT=11,Cd=12,vo="dag-group-qem-v4",Soe="slice",mT=["slice","full"];function OF(e){return Array.isArray(e)&&e.length===4&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(e[2])&&Number.isFinite(e[3])&&e[3]>=0}function LF(e){return typeof e.lodError=="number"&&Number.isFinite(e.lodError)&&e.lodError>=0&&OF(e.sphere)}function gT(e){return e.pages.length>0&&e.pages.every(LF)}var oe=e=>t=>{throw new TypeError(`${e}: ${t}`)},Pe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),dg=(e,t)=>typeof t=="object"&&t!==null&&Object.keys(t).length===e.length&&e.every(r=>typeof t[r]=="boolean"),woe=["index","node","mesh","material","extras"],Id=(e,t)=>Object.keys(e).find(r=>!t.includes(r));function Xe(e,t,r,n){if(!Pe(e))return n(`${r} must be an object of ${t.join(", ")}`);let o=Id(e,t);return o!==void 0&&n(`${r} has no field ${o}: ${t.join(", ")}`),e}var wT=e=>typeof e=="string"||e instanceof RegExp||Pe(e)&&typeof e.regex=="string",RF="imsguy";function ST(e,t,r){let n=e instanceof RegExp?{regex:e.source,flags:e.flags}:e;if(!wT(n)||n instanceof RegExp)return r(`${t} must be a name or a regular expression`);if(typeof n=="string")return n;let o=n.flags??"",i=[...o].find(s=>!RF.includes(s));return i!==void 0&&r(`${t}: flag ${i} is not supported (${[...RF].join(", ")})`),o.includes("i")&&[...n.regex].some(s=>s.charCodeAt(0)>127)&&r(`${t}: flag i folds ASCII letters only; write both cases in /${n.regex}/`),n}function wBe(e,t,r,n,o){let i=oe(t),s=Xe(e,[...r,n],"the settings",i),a=o(s,"",i),l=s[n];return l==null?a:Array.isArray(l)?(a.objects=l.map((c,u)=>{let d=`${n}[${u}]`,f=Xe(c,[...r,"match"],d,i);return{match:vF(f.match,`${d}.match`,i),...o(f,`${d}.`,i)}}),a):i(`${n} must be an array of rules`)}function yT(e,t,r){return{fields(n){let o=r(n[e]);return o===void 0?{}:{[e]:o}},flags(n){let o=r(n[e]);return o===void 0?[]:[`${t}${JSON.stringify(o)}`]}}}var _F=e=>t=>t==null?void 0:vF(t,e,oe(e));function vF(e,t,r){if(wT(e))return{node:ST(e,t,r)};let n=Xe(e,woe,t,r),o={},i=n.index;i!=null&&((!Number.isSafeInteger(i)||i<0)&&r(`${t}.index must be a whole number from 0, got ${String(i)}`),o.index=i);for(let a of["node","mesh","material"])n[a]!=null&&(o[a]=ST(n[a],`${t}.${a}`,r));let s=n.extras;return s!=null&&(Pe(s)||r(`${t}.extras must be an object`),o.extras=Object.fromEntries(Object.entries(s).map(([a,l])=>[a,wT(l)?ST(l,`${t}.extras.${a}`,r):l]))),o}var tc=23,MF=1112360791;var fg=12,xT=64;var xBe="6a985659a781c5a196b8f34a8394b2ccf6a9e1cc";var E=class extends Error{code;details;constructor(t,r,n={}){super(r),this.name="EngineError",this.code=t,this.details=n}},DF=[hT,Cd,pT,ia];function pg(e){if(!DF.includes(e))throw new E("UNSUPPORTED_FORMAT",`Expected cache format ${DF.join(", ")}, received ${e}`,{formatVersion:e})}var PF=e=>new E("STALE_CACHE",`Cache error model ${e??"absent"} cannot be used; recompile with ${vo}`,{errorModel:e??null,expected:vo});function yoe(e,t){if(!Pe(e))throw new E("INVALID_POINTER","preparation pointer is not a JSON object",{});let r=e;if(typeof r.status!="string"||typeof r.url!="string"||!r.url)throw new E("INVALID_POINTER","preparation pointer carries no valid status/url",{status:r.status??null,url:r.url??null});if(r.status!=="ready")throw new E("CACHE_NOT_READY","The preparation pointer is not ready",{status:r.status});if(r.scope!==void 0&&r.scope!==t)throw new E("SCOPE_MISMATCH",`Requested ${t}, pointer contains ${r.scope}`,{requestedScope:t,pointerScope:r.scope});return r.formatVersion!==void 0&&pg(r.formatVersion),r.url}function CF(e,t){if(!Pe(e))throw new E("INVALID_CACHE","cache manifest is not a JSON object",{});let r=e;if(pg(r.formatVersion),r.status!=="ready")throw new E("INVALID_CACHE","Unsupported Trillion3D cache",{status:r.status??null});if(r.scope!==t)throw new E("SCOPE_MISMATCH",`Requested ${t}, cache contains ${r.scope}`,{requestedScope:t,cacheScope:r.scope})}function xoe(e,t){CF(e,t);let r=e;if(!Array.isArray(r.primitives)||!Number.isSafeInteger(r.selectedNodes)||typeof r.selectedTriangles!="number"||!Number.isFinite(r.selectedTriangles))throw new E("INVALID_CACHE","invalid cache schema",{});if(r.clusterStrategy==="dag-groups"&&r.errorModel!==vo)throw PF(r.errorModel);return r.selectedTriangles}function boe(e){if(e.binary)throw new E("INVALID_CACHE","A manifest with a binary sidecar must be decoded before its identity is checked",{});let t=e.formatVersion;if(pg(t),t!==ia&&t!==Cd&&e.primitives.some(o=>o.pass==="clustered-blend"))throw new E("UNSUPPORTED_FORMAT",`clustered-blend requires cache format ${Cd} or ${ia}`,{formatVersion:t});let r=e.primitives.findIndex(o=>!gT(o));if(r>=0){let o=e.primitives[r];throw new E("STALE_CACHE",`Cache without a cluster DAG cannot be used: primitive ${o.mesh}/${o.primitive} has no per-cluster error band; recompile with ${vo}`,{mesh:o.mesh,primitive:o.primitive,pass:o.pass,errorModel:e.errorModel??null,expected:vo})}if(e.errorModel!==vo)throw PF(e.errorModel);let{textures:n}=e;if(n&&n.version!==12)throw new E("STALE_CACHE",`Cache texture levels are version ${n.version??"absent"}, this runtime reads ${12}; recompile the cache (trillion3d-compile, or pnpm run compile:caches in the repository)`,{textureVersion:n.version??null,expected:12})}var K=e=>typeof e=="number"&&Number.isFinite(e),hg=e=>typeof e=="number"&&e>=0&&e<=1,k=(e,t,r)=>Math.min(r,Math.max(t,e)),Tr=(e,t,r)=>Math.max(t,Math.min(r,e)),qt=(e,t,r)=>e<t?t:e>r?r:e,Ar=e=>k(e,0,1),Qe=(e,t,r)=>e+(t-e)*r;function bT(e,t,r,n,o){let i=Qe(e,t,o),s=Qe(t,r,o),a=Qe(r,n,o);return Qe(Qe(i,s,o),Qe(s,a,o),o)}var LBe=(e,t,r)=>e*(1-r)+t*r,RBe=e=>e*e*(3-2*e),_Be=(e,t)=>Math.round(e/t)*t,sa=(e,t)=>(e%t+t)%t,vBe=e=>e-Math.floor(e),IF=(e,t)=>-Math.log(e)/t,MBe=(e,t)=>Math.exp(-e*t);function DBe(e,t,r,n){if(n===1)for(let o=0;o<e.length;o++)e[o]=r[o];else for(let o=0;o<e.length;o++)e[o]=Qe(t[o],r[o],n);return e}var Eoe=.04045,Toe=.0031308,FF=12.92,NF=1.055,BF=.055,UF=2.4,rc=[.2126390059,.7151686788,.0721923154],kF=e=>{let[[t,r,n],[o,i,s],[a,l,c]]=e,u=i*c-s*l,d=s*a-o*c,f=o*l-i*a,h=t*u+r*d+n*f;return[[u/h,(n*l-r*c)/h,(r*s-n*i)/h],[d/h,(t*c-n*a)/h,(n*o-t*s)/h],[f/h,(r*a-t*l)/h,(t*i-r*o)/h]]},TT=(e,t)=>[e[0]*t[0][0]+e[1]*t[1][0]+e[2]*t[2][0],e[0]*t[0][1]+e[1]*t[1][1]+e[2]*t[2][1],e[0]*t[0][2]+e[1]*t[1][2]+e[2]*t[2][2]],VF=(()=>{let e=([i,s])=>[i,s,1-i-s],t=[e([.64,.33]),e([.3,.6]),e([.15,.06])],[r,n]=[.3127,.329],o=TT([r/n,1,(1-r-n)/n],kF(t));return kF(t.map((i,s)=>i.map(a=>a*o[s])))})();function Qn(e){return e<=Eoe?e/FF:Math.pow((e+BF)/NF,UF)}function GF(e){return e<=Toe?FF*e:NF*Math.pow(Math.max(e,0),1/UF)-BF}var Aoe=e=>{let t=Math.round(e*255);return t>0?t<255?t:255:0},mg=e=>e/255;function gg(e){return Aoe(GF(e))}function ET(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*6*(2/3-r):e}function AT(e,t,r,n,o){let i=sa(r,1),s=Ar(n),a=Ar(o);if(s===0)return e[t]=e[t+1]=e[t+2]=a,e;let l=a<=.5?a*(1+s):a+s-a*s,c=2*a-l;return e[t]=ET(c,l,i+1/3),e[t+1]=ET(c,l,i),e[t+2]=ET(c,l,i-1/3),e}var ss=3.141592653589793,me=Math.PI/2,kBe=.7853981633974483,Q=6.283185307179586,ce=.017453292519943295,FBe=57.29577951308232;var NBe=34028234663852886e22,BBe=34e37,HF=1.7320508075688772;var WF=11920928955078125e-23,zF=4294967296,Mo=4294967295,Tn=1048576,UBe=2654435769,VBe=.007843137718737125,as=65504,GBe=64512,jF=11754943508222875e-54,HBe=1e30,WBe=.7548776662466927,zBe=.5698402909980532;function Ve(e,t,r){let n=t[0],o=t[4],i=t[8],s=t[12],a=t[1],l=t[5],c=t[9],u=t[13],d=t[2],f=t[6],h=t[10],m=t[14],w=t[3],x=t[7],b=t[11],T=t[15],L=r[0],_=r[1],D=r[2],C=r[3];return e[0]=n*L+o*_+i*D+s*C,e[1]=a*L+l*_+c*D+u*C,e[2]=d*L+f*_+h*D+m*C,e[3]=w*L+x*_+b*D+T*C,L=r[4],_=r[5],D=r[6],C=r[7],e[4]=n*L+o*_+i*D+s*C,e[5]=a*L+l*_+c*D+u*C,e[6]=d*L+f*_+h*D+m*C,e[7]=w*L+x*_+b*D+T*C,L=r[8],_=r[9],D=r[10],C=r[11],e[8]=n*L+o*_+i*D+s*C,e[9]=a*L+l*_+c*D+u*C,e[10]=d*L+f*_+h*D+m*C,e[11]=w*L+x*_+b*D+T*C,L=r[12],_=r[13],D=r[14],C=r[15],e[12]=n*L+o*_+i*D+s*C,e[13]=a*L+l*_+c*D+u*C,e[14]=d*L+f*_+h*D+m*C,e[15]=w*L+x*_+b*D+T*C,e}function mi(e){let t=e[0],r=e[4],n=e[8],o=e[12],i=e[1],s=e[5],a=e[9],l=e[13],c=e[2],u=e[6],d=e[10],f=e[14],h=e[3],m=e[7],w=e[11],x=e[15],b=o*a,T=n*l,L=o*s,_=r*l,D=r*a,C=t*a,j=t*l,$=o*i,q=n*i,le=t*s,ge=r*i;return h*(+b*u-T*u-L*d+_*d+n*s*f-D*f)+m*(+C*f-j*d+$*d-q*f+T*c-b*c)+w*(+j*u-le*f-$*u+ge*f+L*c-_*c)+x*(-n*s*c-C*u+le*d+q*u-ge*d+D*c)}var Ooe=1e100,$F=[0,1,2,4,5,6,8,9,10,12,13,14],kd=e=>e[3]===0&&e[7]===0&&e[11]===0&&e[15]===1;function YF(e){if(!kd(e))return mi(e)<0;for(let u=0;u<$F.length;u++)if(!(Math.abs(e[$F[u]])<=Ooe))return mi(e)<0;let t=e[0],r=e[1],n=e[2],o=e[4],i=e[5],s=e[6],a=e[8],l=e[9],c=e[10];return-a*i*n-t*l*s+t*i*c+a*r*s-o*r*c+o*l*n<0}function OT(e){return LT(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])}function LT(e,t,r,n,o,i,s,a,l){return e*(o*l-i*a)-t*(n*l-i*s)+r*(n*a-o*s)}var Or=new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function Ce(e,t,r=0,n=0){return e[r]=t[n],e[r+1]=t[n+1],e[r+2]=t[n+2],e[r+3]=t[n+3],e[r+4]=t[n+4],e[r+5]=t[n+5],e[r+6]=t[n+6],e[r+7]=t[n+7],e[r+8]=t[n+8],e[r+9]=t[n+9],e[r+10]=t[n+10],e[r+11]=t[n+11],e[r+12]=t[n+12],e[r+13]=t[n+13],e[r+14]=t[n+14],e[r+15]=t[n+15],e}function $Be(e,t,r){let n=t[0],o=t[1],i=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=t[9],h=t[10],m=t[11],w=t[12],x=t[13],b=t[14],T=t[15],L=r===0,_=r===1,D=r===2,C=r===3;return e[0]=L?-n:n,e[1]=L?-o:o,e[2]=L?-i:i,e[3]=L?-s:s,e[4]=_?-a:a,e[5]=_?-l:l,e[6]=_?-c:c,e[7]=_?-u:u,e[8]=D?-d:d,e[9]=D?-f:f,e[10]=D?-h:h,e[11]=D?-m:m,e[12]=C?-w:w,e[13]=C?-x:x,e[14]=C?-b:b,e[15]=C?-T:T,e}function YBe(e,t,r){let n=t[0],o=t[1],i=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],d=t[8],f=t[9],h=t[10],m=t[11],w=t[12],x=t[13],b=t[14],T=t[15],L=r===0,_=r===1,D=r===2,C=r===3;return e[0]=L?-n:n,e[1]=_?-o:o,e[2]=D?-i:i,e[3]=C?-s:s,e[4]=L?-a:a,e[5]=_?-l:l,e[6]=D?-c:c,e[7]=C?-u:u,e[8]=L?-d:d,e[9]=_?-f:f,e[10]=D?-h:h,e[11]=C?-m:m,e[12]=L?-w:w,e[13]=_?-x:x,e[14]=D?-b:b,e[15]=C?-T:T,e}function KF(e,t){let r=t[0],n=t[1],o=t[2],i=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=t[9],f=t[10],h=t[11],m=t[12],w=t[13],x=t[14],b=t[15];return e[0]=r,e[1]=s,e[2]=u,e[3]=m,e[4]=n,e[5]=a,e[6]=d,e[7]=w,e[8]=o,e[9]=l,e[10]=f,e[11]=x,e[12]=i,e[13]=c,e[14]=h,e[15]=b,e}function RT(e,t,r){let n=0;return e>n&&(n=e),t>n&&(n=t),r>n&&(n=r),n}function Sg(e,t){let r=Math.abs(e),n=Math.abs(t),o=RT(r,n,0);if(o===1/0)return 1/0;if(e!==e||t!==t)return NaN;if(o===0)return 0;let i=r/o,s=n/o;return Math.sqrt(i*i+s*s)*o}function Fr(e,t,r){let n=Math.abs(e),o=Math.abs(t),i=Math.abs(r),s=RT(n,o,i);if(s===1/0)return 1/0;if(e!==e||t!==t||r!==r)return NaN;if(s===0)return 0;let a=n/s,l=o/s,c=i/s,u=a*a+l*l,d=u-a*a-l*l;return Math.sqrt(u+(c*c-d))*s}function nc(e,t,r,n){let o=Math.abs(e),i=Math.abs(t),s=Math.abs(r),a=Math.abs(n),l=RT(o,i,s);return a>l&&(l=a),l===1/0?1/0:e!==e||t!==t||r!==r||n!==n?NaN:l===0?0:Math.sqrt(wg(o/l,i/l,s/l,a/l))*l}function wg(e,t,r,n){let o=e*e+t*t,i=o-e*e-t*t,s=r*r-i,a=o+s;return a+(n*n-(a-o-s))}function Ge(e,t,r=0,n=0){return e[r]*t[n]+e[r+1]*t[n+1]+e[r+2]*t[n+2]}function yg(e,t,r,n,o=0){return e[o]*t+e[o+1]*r+e[o+2]*n}function XF(e,t,r,n,o,i){return e*n+t*o+r*i}function QF(e,t=0){return Math.max(_T(e,t),_T(e,t+4),_T(e,t+8))}function vT(e,t,r,n,o,i,s,a){if(!Array.isArray(e)){e[t]=n*a-o*s,e[t+1]=o*i-r*a,e[t+2]=r*s-n*i;return}e[t]=n*a-o*s,e[t+1]=o*i-r*a,e[t+2]=r*s-n*i}function Ze(e,t,r,n=0,o=0,i=0){let s=t[o],a=t[o+1],l=t[o+2],c=r[i],u=r[i+1],d=r[i+2];return vT(e,n,s,a,l,c,u,d),e}function Do(e,t,r,n,o,i=0){return e[i]=oc(t,0,r,n,o),e[i+1]=oc(t,1,r,n,o),e[i+2]=oc(t,2,r,n,o),e}function MT(e,t,r,n,o,i=0){return Do(e,t,r,n,o,i),e[i+3]=oc(t,3,r,n,o),e}var aa=2**-969;function oc(e,t,r,n,o,i=0){return Nr(e[i+t],e[i+4+t],e[i+8+t],e[i+12+t],r,n,o)}function Nr(e,t,r,n,o,i,s){return e*o+t*i+r*s+n}function Fd(e,t,r,n,o){return Ut(e[t],e[4+t],e[8+t],r,n,o)}function Ut(e,t,r,n,o,i){return e*n+t*o+r*i}function te(e,t,r){return DT(e*e+t*t+r*r,e,t,r)}function DT(e,t,r,n){return e<aa||e===1/0?+Fr(t,r,n):Math.sqrt(e)}var ZF=(e,t=0)=>e[t]===0&&e[t+1]===0&&e[t+2]===0;function xg(e,t,r){return Math.sqrt(e*e+t*t+r*r)}function PT(e,t){return Math.sqrt(e*e+t*t)}function An(e,t,r,n=0){return e[n]=t*Math.cos(r),e[n+1]=t*Math.sin(r),e}function Je(e,t){return JF(e*e+t*t,e,t)}function JF(e,t,r){return e<aa||e===1/0?+Sg(t,r):Math.sqrt(e)}function bg(e,t,r,n){return e*n-t*r}function Eg(e,t,r=0,n=0){let o=e[r]-t[n],i=e[r+1]-t[n+1],s=e[r+2]-t[n+2];return o*o+i*i+s*s}function eN(e,t,r=0,n=0){return te(e[r]-t[n],e[r+1]-t[n+1],e[r+2]-t[n+2])}var Nd=2**1e3;function Ne(e,t=0){ic(e,t,e[t],e[t+1],e[t+2])}function Tg(e,t,r,n,o){if(!Array.isArray(e)){e[t]=r,e[t+1]=n,e[t+2]=o;return}e[t]=r,e[t+1]=n,e[t+2]=o}function ic(e,t,r,n,o){let i=r*r+n*n+o*o;if(i===1)return Tg(e,t,r,n,o);let s=1/(DT(i,r,n,o)||1);s===1/0&&(r*=Nd,n*=Nd,o*=Nd,s=1/te(r,n,o)),e[t]=r*s,e[t+1]=n*s,e[t+2]=o*s}function QBe(e,t,r,n,o){let i=r*r+n*n+o*o;if(i===1)return Tg(e,t,r,n,o);let s=DT(i,r,n,o)||1;e[t]=r/s,e[t+1]=n/s,e[t+2]=o/s}function tN(e,t,r,n,o=!1){let i=r[n],s=r[n+1],a=r[n+2];o&&(i=-i,s=-s,a=-a);let l=i*i+s*s+a*a;if(l===1){e[t]=i,e[t+1]=s,e[t+2]=a;return}let c=(l<aa||l===1/0?+Fr(i,s,a):Math.sqrt(l))||1;e[t]=i/c,e[t+1]=s/c,e[t+2]=a/c}function ZBe(e,t,r,n=0,o=0){let i=t[o],s=t[o+1],a=t[o+2],l=i*i+s*s+a*a;if(l<r)return e[n]=0,e[n+1]=0,e[n+2]=0,e;if(l===1)return e[n]=i,e[n+1]=s,e[n+2]=a,e;let c=1/Math.sqrt(l);return e[n]=i*c,e[n+1]=s*c,e[n+2]=a*c,e}var qF=new Float64Array(3);function rN(e,t,r,n=0,o=0,i=0){return Ze(qF,e,t,0,n,o),Math.atan2(Ge(qF,r,0,i),Ge(e,t,n,o))}function ls(e,t=0){let r=e[t],n=e[t+1],o=r*r+n*n;if(o===1)return;let i=1/(JF(o,r,n)||1);i===1/0&&(e[t]*=Nd,e[t+1]*=Nd,i=1/Je(e[t],e[t+1])),e[t]*=i,e[t+1]*=i}function _T(e,t=0){return te(e[t],e[t+1],e[t+2])}function sc(e,t=0){return Ge(e,e,t,t)}function CT(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Br(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function IT(e,t){return e[0]*=t,e[1]*=t,e[2]*=t,e}function kT(e,t,r,n=0,o=0){return e[n]=t[o]*r,e[n+1]=t[o+1]*r,e[n+2]=t[o+2]*r,e}function Zn(e,t,r){return e[0]+=t[0]*r,e[1]+=t[1]*r,e[2]+=t[2]*r,e}function Bd(e,t,r,n,o){return e[0]=t[0]*r+t[3]*n+t[6]*o,e[1]=t[1]*r+t[4]*n+t[7]*o,e[2]=t[2]*r+t[5]*n+t[8]*o,e}function FT(e,t,r,n,o,i=0){let s=Fd(t,0,r,n,o);e[i]=s;let a=Fd(t,1,r,n,o);e[i+1]=a;let l=Fd(t,2,r,n,o);return e[i+2]=l,ic(e,i,s,a,l),e}function nN(e,t){let r=!0;for(let n=0;n<e.length;n++)Object.is(e[n],t[n])||(r=!1),e[n]=t[n];return r}var vt=6;function gi(e,t){ca(e,t,1/0,1/0,1/0,-1/0,-1/0,-1/0)}function Ag(e,t,r,n,o,i){return n<e||o<t||i<r}function ca(e,t,r,n,o,i,s,a){e[t]=r,e[t+1]=n,e[t+2]=o,e[t+3]=i,e[t+4]=s,e[t+5]=a}function NT(e,t){return Ag(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5])}function Og(e,t,r,n,o,i,s,a){e[t]=(r+i)*.5,e[t+1]=(n+s)*.5,e[t+2]=(o+a)*.5}function rUe(e,t,r,n,o,i,s){return e[t]=(r[n]-o+(r[n+3]-o))/2,e[t+1]=(r[n+1]-i+(r[n+4]-i))/2,e[t+2]=(r[n+2]-s+(r[n+5]-s))/2,e}function Lg(e,t,r,n,o){return!(r<e[t]||r>e[t+3]||n<e[t+1]||n>e[t+4]||o<e[t+2]||o>e[t+5])}function oN(e,t,r,n){return!(r[n+3]<e[t]||r[n]>e[t+3]||r[n+4]<e[t+1]||r[n+1]>e[t+4]||r[n+5]<e[t+2]||r[n+2]>e[t+5])}function On(e,t,r,n,o){BT(e,t,r,n,o,r,n,o)}function Rg(e,t,r,n,o,i=3){let s=1/0,a=1/0,l=1/0,c=-1/0,u=-1/0,d=-1/0;for(let f=0,h=n;f<o;f++,h+=i){let m=r[h],w=r[h+1],x=r[h+2];s=Math.min(s,m),a=Math.min(a,w),l=Math.min(l,x),c=Math.max(c,m),u=Math.max(u,w),d=Math.max(d,x)}ca(e,t,s,a,l,c,u,d)}function _g(e,t,r,n,o){e[t]=r[n]-o,e[t+3]=r[n+3]+o,e[t+1]=r[n+1]-o,e[t+4]=r[n+4]+o,e[t+2]=r[n+2]-o,e[t+5]=r[n+5]+o}function BT(e,t,r,n,o,i,s,a){e[t]=Math.min(e[t],r),e[t+1]=Math.min(e[t+1],n),e[t+2]=Math.min(e[t+2],o),e[t+3]=Math.max(e[t+3],i),e[t+4]=Math.max(e[t+4],s),e[t+5]=Math.max(e[t+5],a)}function iN(e,t,r,n=0){BT(e,t,r[n],r[n+1],r[n+2],r[n+3],r[n+4],r[n+5])}function Loe(e,t,r,n,o,i){return Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(n)&&Number.isFinite(o)&&Number.isFinite(i)}function Roe(e,t,r,n,o,i,s,a,l){sN(e,t,r,n,o,i,s,a,l,!1)}function cs(e,t,r,n,o){let i=r[n],s=r[n+1],a=r[n+2],l=r[n+3],c=r[n+4],u=r[n+5];if(Ag(i,s,a,l,c,u)){ca(e,t,i,s,a,l,c,u);return}if(!kd(o))sN(e,t,i,s,a,l,c,u,o,!0);else{if(Moe(e,t,r,n,o))return;Loe(i,s,a,l,c,u)?voe(e,t,r,n,o):ca(e,t,NaN,NaN,NaN,NaN,NaN,NaN)}}var _oe=new Float64Array(18);function voe(e,t,r,n,o){let i=_oe,s=r[n],a=r[n+1],l=r[n+2],c=r[n+3],u=r[n+4],d=r[n+5];for(let D=0;D<3;D++){let C=D*6,j=o[D],$=o[D+4],q=o[D+8];i[C]=j*s,i[C+1]=j*c,i[C+2]=$*a,i[C+3]=$*u,i[C+4]=q*l,i[C+5]=q*d}let f=o[12],h=o[13],m=o[14],w=1/0,x=1/0,b=1/0,T=-1/0,L=-1/0,_=-1/0;for(let D=0;D<8;D++){let C=D&1,j=2+(D>>1&1),$=4+(D>>2),q=i[C]+i[j]+i[$]+f,le=i[6+C]+i[6+j]+i[6+$]+h,ge=i[12+C]+i[12+j]+i[12+$]+m;w=Math.min(w,q),x=Math.min(x,le),b=Math.min(b,ge),T=Math.max(T,q),L=Math.max(L,le),_=Math.max(_,ge)}ca(e,t,w,x,b,T,L,_)}function Moe(e,t,r,n,o){let i=o[0],s=o[1],a=o[2],l=o[4],c=o[5],u=o[6],d=o[8],f=o[9],h=o[10],m=r[n],w=r[n+1],x=r[n+2],b=r[n+3],T=r[n+4],L=r[n+5],_=i*m,D=i*b,C=s*m,j=s*b,$=a*m,q=a*b,le=l*w,ge=l*T,Ue=c*w,ye=c*T,Fe=u*w,Ye=u*T,Ke=d*x,ut=d*L,Ae=f*x,Kt=f*L,_e=h*x,hi=h*L,Jl=Math.min(_,D)+Math.min(le,ge)+Math.min(Ke,ut)+o[12],ec=Math.min(C,j)+Math.min(Ue,ye)+Math.min(Ae,Kt)+o[13],xF=Math.min($,q)+Math.min(Fe,Ye)+Math.min(_e,hi)+o[14],bF=Math.max(_,D)+Math.max(le,ge)+Math.max(Ke,ut)+o[12],EF=Math.max(C,j)+Math.max(Ue,ye)+Math.max(Ae,Kt)+o[13],TF=Math.max($,q)+Math.max(Fe,Ye)+Math.max(_e,hi)+o[14];return Number.isFinite(Jl+ec+xF+bF+EF+TF)?(ca(e,t,Jl,ec,xF,bF,EF,TF),!0):!1}function sN(e,t,r,n,o,i,s,a,l,c){let u=l[0],d=l[1],f=l[2],h=l[3],m=l[4],w=l[5],x=l[6],b=l[7],T=l[8],L=l[9],_=l[10],D=l[11],C=l[12],j=l[13],$=l[14],q=l[15],le=1/0,ge=1/0,Ue=1/0,ye=-1/0,Fe=-1/0,Ye=-1/0;for(let Ke=0;Ke<8;Ke++){let ut=Ke&1?i:r,Ae=Ke&2?s:n,Kt=Ke&4?a:o,_e=1/Nr(h,b,D,q,ut,Ae,Kt),hi=Nr(u,m,T,C,ut,Ae,Kt)*_e,Jl=Nr(d,w,L,j,ut,Ae,Kt)*_e,ec=Nr(f,x,_,$,ut,Ae,Kt)*_e;c?(le=Math.min(le,hi),ge=Math.min(ge,Jl),Ue=Math.min(Ue,ec),ye=Math.max(ye,hi),Fe=Math.max(Fe,Jl),Ye=Math.max(Ye,ec)):Tg(e,t+Ke*3,hi,Jl,ec)}c&&ca(e,t,le,ge,Ue,ye,Fe,Ye)}var UT=(e,t,r,n,o,i)=>te(n-e,o-t,i-r),aN=(e,t=0)=>UT(e[t],e[t+1],e[t+2],e[t+3],e[t+4],e[t+5])*.5,la=(e,t)=>Math.max(Math.abs(e[t]),Math.abs(e[t+3])),nUe=(e,t,r)=>VT(e,r,la(t,0),la(t,1),la(t,2));function VT(e,t,r,n,o){let i=Math.abs(e[12+t]);return i+=Math.abs(e[t])*r,i+=Math.abs(e[4+t])*n,i+=Math.abs(e[8+t])*o,i}function Ud(e,t,r,n=0,o=0){if(e instanceof Float32Array&&t instanceof Float32Array){for(let i=0;i<r;i++)if(e[n+i]!==t[o+i])return!1;return!0}if(e instanceof Float64Array&&t instanceof Float64Array){for(let i=0;i<r;i++)if(e[n+i]!==t[o+i])return!1;return!0}if(e instanceof Uint32Array&&t instanceof Uint32Array){for(let i=0;i<r;i++)if(e[n+i]!==t[o+i])return!1;return!0}if(e instanceof Int32Array){for(let i=0;i<r;i++)if(e[n+i]!==t[o+i])return!1;return!0}for(let i=0;i<r;i++)if(e[n+i]!==t[o+i])return!1;return!0}var ua=(e,t,r=0,n=0)=>Ud(e,t,16,r,n),aUe=(e,t,r=0,n=0)=>Ud(e,t,3,r,n)&&Ud(e,t,3,r+4,n+4)&&Ud(e,t,3,r+8,n+8);function lUe(e,t){let r=0;for(let n=0;n<11;n++)n%4!==3&&(r=Math.max(r,Math.abs(e[n])));for(let n=0;n<11;n++)if(n%4!==3&&!(Math.abs(e[n]-t[n])<=1e-6*r))return!1;return!0}function cUe(e,t,r=0){for(let n=14;n>=0;n--)if(!Object.is(e[r+n],t[n]))return!1;return Object.is(e[r+15],t[15])}function lN(e,t,r=0){for(let n=14;n>=0;n--)if(e[r+n]!==Math.fround(t[n]))return!1;return e[r+15]===Math.fround(t[15])}function uUe(e,t,r,n=0){if(ua(e,t,n))return!0;for(let c=3;c<16;c+=4)if(e[n+c]!==t[c])return!1;let o=la(r,0),i=la(r,1),s=la(r,2),a=0,l=0;for(let c=0;c<3;c++){let u=Math.abs(t[12+c]-e[n+12+c]);u+=Math.abs(t[c]-e[n+c])*o,u+=Math.abs(t[4+c]-e[n+4+c])*i,u+=Math.abs(t[8+c]-e[n+8+c])*s,a=Math.max(a,u),l=Math.max(l,VT(t,c,o,i,s))}return a<WF*l}var Be=(e,t)=>e.length===t.length&&Ud(e,t,e.length);function cN(e,t){e.length=t.length;for(let r=0;r<t.length;r++)e[r]=t[r]}var R=[-17976931348623157e292,17976931348623157e292],sn=2147483647,we=[-2147483648,sn],U=e=>[e,R[1]],da=e=>{let t=e,r=t.default;return t.default=null,t.default=r,e},p=(e,t)=>({kind:"flag",field:e,default:t}),pr=(e,t)=>da({...e,atOpen:t??!0}),vg=e=>e.atOpen;function dN(e,t,r){let n=vg(e);return!n||hN(hr(e,t),r)?void 0:n}var At=(e,t,r)=>({kind:"flag",field:e,default:t,gatedBy:r}),g=(e,t,r)=>da({kind:"float",field:e,default:t,range:r}),S=(e,t,r)=>da({kind:"int",field:e,default:t,range:r}),Mg=U(0),ac=(e,t,r,n,o,i=!1)=>da({kind:e,field:t,default:r,range:n,takes:o,...i&&{above:!0}}),Dg=(e,t,r)=>da({...ac("float",e,t,R,r),excluding:0}),us=(e,t,r,n,o=!1)=>da({...ac("float",e,t,[0,r],n,o),excluding:r}),F=(e,t,r="a finite number above 0")=>ac("float",e,t,Mg,r,!0),zT=(e,t)=>da({...ac("float",e,t,Mg,"a finite number of metres of at least 0, true or false"),distance:!0}),y=(e,t,r="a finite number of at least 0")=>ac("float",e,t,Mg,r),P=(e,t,r)=>ac("int",e,t,[r,Number.MAX_SAFE_INTEGER],`a whole number of at least ${r}`),N=(e,t,r)=>({kind:"choice",field:e,default:t,choices:r}),ze=(e,t)=>({kind:"vector",field:e,default:Object.freeze([...t])}),Mt=(e,t)=>({...ze(e,t),format:"color",range:Mg}),eo=(e,t,r)=>({...ze(e,t),format:"linear-rgb",range:r}),jT=(e,t)=>({kind:"text",field:e,default:t}),fN=e=>({kind:"text",field:e,default:"",nonEmpty:!0}),A=e=>e,lc=e=>Object.keys(e),pN=e=>e.kind==="choice"&&e.choices[0]==="off",Doe=([e,t])=>t<Number.MAX_SAFE_INTEGER?`from ${e} to ${t}`:`of at least ${e}`;function Dt(e){return e.kind==="flag"?"true or false":e.kind==="choice"?`one of ${e.choices.map(t=>`'${t}'`).join(", ")}${pN(e)?", true or false":""}`:e.kind==="text"?e.nonEmpty?"a string of at least one character":"a string":e.kind==="vector"?`an array of ${e.default.length} finite numbers${e.range?`, each ${Doe(e.range)}`:""}`:e.takes??`${e.kind==="int"?"a whole number":"a number"} from ${e.range[0]} to ${e.range[1]}`}function hr(e,t,r){return t==null?e.default:typeof t=="boolean"&&pN(e)?t?e.default:"off":typeof t=="boolean"&&e.kind==="float"&&e.distance?t?e.default:0:(et(e,t)||oe(r?`${r}.${e.field}`:e.field)(`must be ${Dt(e)}, got ${String(t)}`),Array.isArray(t)?[...t]:t)}function mUe(e,t){let r={};for(let n of Object.keys(e)){let o=t[n];o!=null&&(r[n]=hr(e[n],o))}return r}function et(e,t){if(e.kind==="flag")return typeof t=="boolean";if(e.kind==="choice")return typeof t=="string"&&e.choices.includes(t);if(e.kind==="text")return typeof t=="string"&&!(e.nonEmpty&&t==="");if(e.kind==="vector"){let o=e.range??R,i=o[0],s=o[1];return Array.isArray(t)&&t.length===e.default.length&&t.every(a=>K(a)&&a>=i&&a<=s)}let r=e.range[0],n=e.range[1];return K(t)&&(e.kind==="float"||Number.isInteger(t))&&(e.above?t>r:t>=r)&&t<=n&&t!==e.excluding}function Gd(e,t,r,n){let o=e[r];if(!et(o,n))throw new TypeError(`${t}.${r} must be ${Dt(o)}, not ${String(n)}.`);return n}function gUe(e,t,r,n){if(t!=null)return et(e,t)||n(`${r} must be ${Dt(e)}, got ${JSON.stringify(t)}`),t}function $T(e,t,r){let n=hr(e,t[e.field],r);return e.kind==="flag"&&e.gatedBy!==void 0&&t[e.gatedBy]===!1?!1:n}var an=(e,t,r)=>$T(e[r],t);function SUe(e,t,r){if(!vg(e[r]))throw new Error(`${String(r)} is read as the world opens, but its rule is not atOpen`);return an(e,t,r)}var wUe=e=>ds(e,{},Object.fromEntries(Object.keys(e).map(t=>[t,null])));function X(e){let t=new WeakMap;return(r,n)=>{let{context:o}=r,i=t.get(o);if(i?.epoch!==Jn){if(!Vd.has(o))return an(e,o,n);let s=i?.values??new Map;t.delete(o);let{names:a,rules:l}=YT(e);for(let c=0;c<a.length;c++)s.set(a[c],$T(l[c],o));t.set(o,i={epoch:Jn,values:s})}return i.values.get(n)}}function Poe(e,t,r,n){t[r]=hr(e[r],n)}var yUe=(e,t,r)=>(n,o)=>{r?.();let i=t[n];Poe(e,t,n,o),hN(i,t[n])||Coe(t)},hN=(e,t)=>Object.is(e,t)||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((r,n)=>Object.is(r,t[n])),Jn=0,Vd=new WeakMap,HT=new WeakMap;function Coe(e){Jn++;let t=Vd.get(e);t&&(t.written=Jn)}function xUe(e,t){let r=t?Vd.get(t):{written:0};return r&&Vd.set(e,r),r&&!HT.has(e)&&HT.set(e,new WeakRef(e)),e}var bUe=e=>Vd.get(e)?.written??NaN,WT=new WeakMap,Hd=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&Be(e,t),uN=new WeakMap,YT=e=>{let t=uN.get(e);return t||uN.set(e,t={names:Object.keys(e),rules:Object.values(e)}),t};function ds(e,t,r,n){let o=t,i=r,{names:s,rules:a}=YT(e);for(let l=0;l<s.length;l++)i[s[l]]=$T(a[l],o,n);return r}function mN(e,t,r){let n=WT.get(r);if(n?.rules===e&&n.options.deref()===t&&n.epoch===Jn)return!1;n&&(n.epoch=NaN),ds(e,t,r);let o=HT.get(t);return o&&(n?(n.rules=e,n.options=o,n.epoch=Jn):WT.set(r,{rules:e,options:o,epoch:Jn})),!0}function Ioe(e,t,r){return mN(e,t,r),r}function gN(e,t,r){let n=t,o=r,{names:i}=YT(e);for(let s=0;s<i.length;s++)if(!Hd(n[i[s]],o[i[s]]))return!0;return!1}var GT=new WeakMap;function EUe(e,t,r){let n=WT.get(r),o=n?.epoch===Jn,i=GT.get(t);return o&&i?.epoch===Jn&&i.options===n.options?!1:gN(e,t,r)?(GT.delete(t),!0):(o&&(i?(i.epoch=Jn,i.options=n.options):GT.set(t,{epoch:Jn,options:n.options})),!1)}var ue=(e,t,r)=>ds(e,t,{},r);function cc(e,t,r,n,o){let i=ue(e,t,o),s=t[r];return Object.freeze({...i,[r]:n(s)})}function TUe(e){let t={},r={},n,o={moved:!1,read(i){let s=mN(e,i,t);return o.moved=!n||s&&gN(e,n,t),o.moved&&(n={...t}),t},peek:i=>Ioe(e,i,r)};return o}var Wd="auto",koe=1;function Pg(e){return e==null||e===!0?Wd:e===!1?koe:e==="auto"?e:!K(e)||e<=0?oe("exposure")(`must be 'auto' or a finite number above zero, true or false, got ${String(e)}`):e}var vUe=64,MUe=.18,Foe=.78,Noe=["histogram","basic","manual"],DUe=e=>Foe/e,PUe=e=>2**-e,CUe={uniform:[1/3,1/3,1/3],ntsc:[.3,.59,.11],workingSpace:rc},Boe=["uniform","ntsc","workingSpace"],SN=A({exposureBias:g("exposureBias",1,R),exposureMinBrightness:g("exposureMinBrightness",-10,R),exposureMaxBrightness:g("exposureMaxBrightness",20,R),exposureHistogramLogMin:g("exposureHistogramLogMin",-10,R),exposureHistogramLogMax:g("exposureHistogramLogMax",20,R),exposureLowPercent:g("exposureLowPercent",10,[1,99]),exposureHighPercent:g("exposureHighPercent",90,[1,99]),exposureSpeedUp:y("exposureSpeedUp",3),exposureSpeedDown:y("exposureSpeedDown",1),exposureTransitionDistance:y("exposureTransitionDistance",1.5),exposureBlackBucketWeight:g("exposureBlackBucketWeight",0,[0,1]),exposureLuminanceMethod:N("exposureLuminanceMethod","uniform",Boe),preExposure:p("preExposure",!0),forcedPreExposure:y("forcedPreExposure",0),storedLightExposure:g("storedLightExposure",4,[-16,16]),exposureMethod:N("exposureMethod","histogram",Noe),exposureApplyPhysicalCamera:p("exposureApplyPhysicalCamera",!0),exposureCameraShutterSpeed:g("exposureCameraShutterSpeed",60,[.01,8e3]),exposureCameraIso:g("exposureCameraIso",100,U(1)),exposureLensAttenuation:g("exposureLensAttenuation",.78,U(.01)),localExposureHighlightContrast:y("localExposureHighlightContrast",.8),localExposureShadowContrast:y("localExposureShadowContrast",.8),localExposureDetailStrength:y("localExposureDetailStrength",1),localExposureBlurBlend:g("localExposureBlurBlend",.6,[0,1]),localExposureBlurSize:y("localExposureBlurSize",50),localExposureMiddleGreyBias:g("localExposureMiddleGreyBias",0,R),localExposureHighlightThreshold:y("localExposureHighlightThreshold",0),localExposureShadowThreshold:y("localExposureShadowThreshold",0),localExposureHighlightThresholdStrength:g("localExposureHighlightThresholdStrength",1,[0,1]),localExposureShadowThresholdStrength:g("localExposureShadowThresholdStrength",1,[0,1])});var Uoe=["cosineFourthLaw","oval"],Voe=["beforeDepthOfField","afterDepthOfField"],Goe=["off","high"],uc=10,KT=A({filmGrainIntensity:y("filmGrainIntensity",0),filmGrainIntensityShadows:y("filmGrainIntensityShadows",1),filmGrainIntensityMidtones:y("filmGrainIntensityMidtones",1),filmGrainIntensityHighlights:y("filmGrainIntensityHighlights",1),filmGrainShadowsMax:y("filmGrainShadowsMax",.09),filmGrainHighlightsMin:y("filmGrainHighlightsMin",.5),filmGrainHighlightsMax:y("filmGrainHighlightsMax",1),filmGrainScaleX:y("filmGrainScaleX",1),filmGrainScaleY:y("filmGrainScaleY",1),filmGrainLoopLength:P("filmGrainLoopLength",97,1),chromaticAberration:y("chromaticAberration",0),chromaticAberrationStartOffset:g("chromaticAberrationStartOffset",0,[0,1]),chromaticAberrationQuality:N("chromaticAberrationQuality","high",Goe),chromaticAberrationMax:g("chromaticAberrationMax",-1,U(-2)),vignetteType:N("vignetteType","cosineFourthLaw",Uoe),vignetteColorRed:y("vignetteColorRed",0),vignetteColorGreen:y("vignetteColorGreen",0),vignetteColorBlue:y("vignetteColorBlue",0),vignetteCenterX:g("vignetteCenterX",.5,R),vignetteCenterY:g("vignetteCenterY",.5,R),vignetteSizeX:y("vignetteSizeX",1),vignetteSizeY:y("vignetteSizeY",1),vignetteSoftness:y("vignetteSoftness",5),tonemapperQuality:S("tonemapperQuality",5,[0,5]),tonemapperSharpen:g("tonemapperSharpen",-1,R),sceneColorTintRed:y("sceneColorTintRed",1),sceneColorTintGreen:y("sceneColorTintGreen",1),sceneColorTintBlue:y("sceneColorTintBlue",1),quantizationDitheringBits:S("quantizationDitheringBits",0,we),propagateAlpha:p("propagateAlpha",!1),primitiveAlphaHoldout:p("primitiveAlphaHoldout",!1),translucentHoldoutStage:N("translucentHoldoutStage","beforeDepthOfField",Voe)}),NUe=e=>e.propagateAlpha&&e.primitiveAlphaHoldout,BUe=X(KT),zd={smooth:{tonemapperQuality:0,chromaticAberrationQuality:"off"},balanced:{tonemapperQuality:2,chromaticAberrationQuality:"off"},fine:{tonemapperQuality:5,chromaticAberrationQuality:"high"},cinematic:{tonemapperQuality:5,chromaticAberrationQuality:"high"}},UUe=(e,t)=>k(e>=0?e:t,0,uc);var qT=e=>(t,r)=>{throw new E("INVALID_SCENE_ENVIRONMENT",`${e}: ${t}`,{[e]:r})},Vt=qT("fog");function Ln(e,t,r,n=Vt){(!Array.isArray(e)||e.length!==3||!e.every(a=>K(a)&&a>=0))&&n(`${t} expects three finite numbers \u2265 0`,r);let[o,i,s]=e;return[o,i,s]}function wN(e,t,r){return typeof e=="boolean"?e:Vt(`${t} must be true or false`,r)}function XT(e,t,[r,n],o){if(K(e)&&e>=r&&e<=n)return e;let i=r===-1/0?"finite":n===1/0?`\u2265 ${r}`:`in [${r}, ${n}]`;return Vt(`${t} must be ${i}`,o)}function Po(e,t,r,n,o=""){let i=e,s=t;for(let[a,l]of Object.entries(r))i[a]!==void 0&&(s[a]=XT(i[a],o+a,l,n))}function Si(e,t,r){return Pe(e)||Vt(`${t} expects an object`,r),e}function Cg(e,t,r,n){let o={};return Po(Si(e,t,n),o,r,n,`${t}.`),o}var Hoe={tint:[1,1,1],turn:0,sharpFrom:1e3,averageUntil:10},yN=1024,xN=e=>Math.floor(Math.log2(e))+1;function bN(e){let t=Hoe;return{size:e.size,texels:e.texels,tint:e.tint??t.tint,turn:e.turn??t.turn,sharpFrom:e.sharpFrom??t.sharpFrom,averageUntil:e.averageUntil??t.averageUntil}}var Woe={turn:[0,360],sharpFrom:[0,1/0],averageUntil:[0,1/0]};var QT=new WeakMap;function ZT(e,t){let r=QT.get(t);if(r)return r;for(let o=0;o<t.length;o++){let i=t[o];if(!K(i)||i<0)return}let n={size:e,texels:t};return QT.set(t,n),n}var EN=e=>void QT.delete(e);function TN(e,t){let r=Si(e,"cubemap",t);(!Number.isInteger(r.size)||r.size<1||r.size>yN)&&Vt(`cubemap.size must be a whole number from 1 to ${yN}`,t);let n=6*r.size*r.size*3,{texels:o}=r;(!o||o.length!==n)&&Vt(`cubemap.texels expects ${n} numbers, six faces of ${r.size}\xB2 texels`,t),ZT(r.size,o)||Vt("cubemap.texels expects finite numbers \u2265 0",t);let i={size:r.size,texels:o};return r.tint!==void 0&&(i.tint=Ln(r.tint,"cubemap.tint",t)),Po(r,i,Woe,t,"cubemap."),i}function YUe(e){let t=e.size*e.size,r=new Float64Array(18);for(let n=0;n<6*t;n++)for(let o=0;o<3;o++)r[Math.floor(n/t)*3+o]+=e.texels[n*3+o];return Float32Array.from(r,n=>n/t)}var AN={baseDensity:[0,1],falloff:[0,.2]};function ON(e){let t={...e};for(let r of["baseDensity","falloff"])if(e[r]!==void 0){let[n,o]=AN[r];t[r]=k(e[r],n,o)}return t}var JT={baseDensity:0,falloff:.02,heightShift:0};function LN(e){let t=ON(e??{});return{...JT,...t}}var zoe={baseDensity:[0,1/0],falloff:[0,1/0],heightShift:[-1/0,1/0]};function RN(e,t){return Cg(e,"secondLayer",zoe,t)}var joe={sceneColorScatteringAmountScale:1,sceneColorScatteringAmountPower:1,spreadScale:.1,blurControl:.5};function _N(e){if(!e)return;let t=joe,r=e===!0?{}:e;return{sceneColorScatteringAmountScale:Math.max(r.sceneColorScatteringAmountScale??t.sceneColorScatteringAmountScale,0),sceneColorScatteringAmountPower:Math.max(r.sceneColorScatteringAmountPower??t.sceneColorScatteringAmountPower,0),spreadScale:Math.max(r.spreadScale??t.spreadScale,0),blurControl:k(r.blurControl??t.blurControl,0,1)}}var $oe={sceneColorScatteringAmountScale:[0,1/0],sceneColorScatteringAmountPower:[0,1/0],spreadScale:[0,1/0],blurControl:[0,1]};function vN(e,t){if(typeof e=="boolean")return e;let r=Si(e,"screenSpaceScattering",t),n={};return Po(r,n,$oe,t,"screenSpaceScattering."),n}var Yoe={anisotropy:.2,particleColor:[1,1,1],glow:[0,0,0],densityScale:1,reach:60,startAt:0,fadeInLength:0,useFogColors:!1,staticLightingScatteringIntensity:1},Koe=.01,MN=.99,qoe=1e8;function DN(e){if(!e)return;let t=Yoe,r=e===!0?{}:e,n=r.startAt??t.startAt,o=r.fadeInLength??t.fadeInLength,i=r.glow??t.glow;return{anisotropy:k(r.anisotropy??t.anisotropy,-MN,MN),particleColor:r.particleColor??t.particleColor,glow:[0,1,2].map(s=>Math.max(i[s]*Koe,0)),densityScale:Math.max(r.densityScale??t.densityScale,0),farEnd:Math.max(n+(r.reach??t.reach),0),startAt:n,fadeInRate:o>0?1/o:qoe,useFogColors:r.useFogColors??t.useFogColors,staticLightingScatteringIntensity:Math.max(r.staticLightingScatteringIntensity??t.staticLightingScatteringIntensity,0)}}var Xoe={densityScale:[0,1/0],reach:[0,1/0],startAt:[0,1/0],fadeInLength:[0,1/0],staticLightingScatteringIntensity:[0,1/0]};function PN(e,t){if(typeof e=="boolean")return e;let r=Si(e,"volumetric",t),n={};if(r.anisotropy!==void 0&&(K(r.anisotropy)||Vt("volumetric.anisotropy must be a finite number",t),n.anisotropy=r.anisotropy),r.particleColor!==void 0){let o=Ln(r.particleColor,"volumetric.particleColor",t);o.forEach(i=>XT(i,"volumetric.particleColor",[0,1],t)),n.particleColor=o}return r.glow!==void 0&&(n.glow=Ln(r.glow,"volumetric.glow",t)),Po(r,n,Xoe,t,"volumetric."),r.useFogColors!==void 0&&(typeof r.useFogColors!="boolean"&&Vt("volumetric.useFogColors must be a boolean",t),n.useFogColors=r.useFogColors),n}var Qoe=A({color:Mt("color",[0,0,0]),baseDensity:y("baseDensity",.002),falloff:y("falloff",.02),baseHeight:g("baseHeight",0,R),maxOpacity:g("maxOpacity",1,[0,1]),startDistance:y("startDistance",0),cutoffDistance:y("cutoffDistance",0),skyContribution:eo("skyContribution",[1,1,1],U(0)),horizontalLimit:y("horizontalLimit",0),inMainView:p("inMainView",!0),inSkyCapture:p("inSkyCapture",!0),inCubeCaptures:p("inCubeCaptures",!0),holdout:p("holdout",!1)}),Zoe=A({exponent:F("exponent",4),startDistance:y("startDistance",100),color:Mt("color",[0,0,0])}),Joe=A({strength:y("strength",0),roughness:g("roughness",.15,[0,1])}),eA={...ue(Qoe,{}),directional:ue(Zoe,{}),second:JT,skyLightScattering:ue(Joe,{})},CN={baseDensity:.00436,baseHeight:-68.5},eie=.4804530139182014,Ig=e=>"density"in e||"heightFalloff"in e;function tie(e){let t=eA.directional;return{exponent:e?.exponent??t.exponent,startDistance:e?.startDistance??t.startDistance,color:e?.color??t.color}}function rie(e){let t=eA.skyLightScattering;return{strength:e?.strength??t.strength,roughness:e?.roughness??t.roughness}}function IN(e){let t=eA;return Ig(e)?{...t,color:e.color,baseDensity:e.density/eie,falloff:(e.heightFalloff??0)/Math.LN2,baseHeight:e.baseHeight??t.baseHeight}:{color:e.color??t.color,baseDensity:e.baseDensity??t.baseDensity,falloff:e.falloff??t.falloff,baseHeight:e.baseHeight??t.baseHeight,maxOpacity:e.maxOpacity??t.maxOpacity,startDistance:e.startDistance??t.startDistance,cutoffDistance:e.cutoffDistance??t.cutoffDistance,directional:tie(e.directional),skyContribution:e.skyContribution??t.skyContribution,second:LN(e.secondLayer),horizontalLimit:e.horizontalLimit??t.horizontalLimit,cubemap:e.cubemap&&bN(e.cubemap),volumetric:DN(e.volumetric),screenSpaceScattering:_N(e.screenSpaceScattering),inMainView:e.inMainView??t.inMainView,inSkyCapture:e.inSkyCapture??t.inSkyCapture,inCubeCaptures:e.inCubeCaptures??t.inCubeCaptures,holdout:e.holdout??t.holdout,skyLightScattering:rie(e.skyLightScattering)}}var kN={none:0,linear:1,exponential:2},nA={color:0,law:1,range:2,lobe:3,sky:4,sun:5,second:6,reach:7,cubemap:8,cubeBlend:9},bVe=10,nie=40,oie=1e-9,iie=1e-5,sie=[1e-6,1e3],aie={baseDensity:[0,1/0],falloff:[0,1/0],baseHeight:[-1/0,1/0],maxOpacity:[0,1],startDistance:[0,1/0],cutoffDistance:[0,1/0],horizontalLimit:[0,1/0]},lie=["inMainView","inSkyCapture","inCubeCaptures","holdout"],cie={strength:[0,1/0],roughness:[0,1]};function uie(e,t){return Cg(e,"skyLightScattering",cie,t)}function die(e){let t={};if(e.color!==void 0&&(t.color=Ln(e.color,"color",e)),Po(e,t,aie,e),e.skyContribution!==void 0&&(t.skyContribution=Ln(e.skyContribution,"skyContribution",e)),e.directional!==void 0){let r=Si(e.directional,"directional",e),n={};r.exponent!==void 0&&((!K(r.exponent)||r.exponent<=0)&&Vt("directional.exponent must be > 0",e),n.exponent=r.exponent),Po(r,n,{startDistance:[0,1/0]},e,"directional."),r.color!==void 0&&(n.color=Ln(r.color,"directional.color",e)),t.directional=n}e.secondLayer!==void 0&&(t.secondLayer=RN(e.secondLayer,e)),e.cubemap!==void 0&&(t.cubemap=TN(e.cubemap,e)),e.volumetric!==void 0&&(t.volumetric=PN(e.volumetric,e)),e.screenSpaceScattering!==void 0&&(t.screenSpaceScattering=vN(e.screenSpaceScattering,e));for(let r of lie)e[r]!==void 0&&(t[r]=wN(e[r],r,e));return e.skyLightScattering!==void 0&&(t.skyLightScattering=uie(e.skyLightScattering,e)),t}var oA=e=>"near"in e||"far"in e,kg=e=>e&&!oA(e)?IN(e):void 0,UN=e=>e.baseDensity+e.second.baseDensity>oie&&e.maxOpacity>iie,tA=new WeakMap;function EVe(e){if(e){if(!tA.has(e)){let t=kg(e);tA.set(e,t&&UN(t)?t:void 0)}return tA.get(e)}}function Fg(e){if((typeof e!="object"||e===null)&&Vt("expects an object",e),!oA(e)&&!Ig(e))return die(e);let t=Ln(e.color,"color",e);if(Ig(e)){let{density:o,heightFalloff:i=0,baseHeight:s=0}=e;return(!K(o)||o<0)&&Vt("density must be \u2265 0",e),(!K(i)||i<0)&&Vt("heightFalloff must be \u2265 0",e),K(s)||Vt("baseHeight must be finite",e),{color:t,density:o,heightFalloff:i,baseHeight:s}}let{near:r,far:n}=e;return(!K(r)||!K(n)||r<0||n<=r)&&Vt("expects 0 \u2264 near < far",e),{color:t,near:r,far:n}}function fie(e){let t=e.cubemap;if(!t)return{};let r=t.turn*ce,n=1/Math.max(t.sharpFrom-t.averageUntil,1e-7);return{cubemap:[Math.sin(r),Math.cos(r),xN(t.size),1],cubeBlend:[n,-t.averageUntil*n]}}function FN(e){return Object.keys(nA).flatMap(t=>{let r=e[t]??[];return[0,1,2,3].map(n=>r[n]??0)})}function rA(e,t=kg(e)){if(!e)return[];if(oA(e))return FN({color:[...e.color,kN.linear],law:[e.near,e.far],sky:[1,1,1]});if(!t||!UN(t))return[];let{exponent:r,startDistance:n,color:o}=t.directional,i=t.volumetric;return FN({color:[...t.cubemap?t.cubemap.tint:t.color,kN.exponential],law:[t.baseDensity,t.falloff,t.baseHeight,t.maxOpacity],range:[t.startDistance,t.cutoffDistance,k(r,...sie),n],lobe:o,sky:t.skyContribution,second:[t.second.baseDensity,t.second.falloff,t.baseHeight+t.second.heightShift],reach:[t.horizontalLimit,i?.farEnd??0,i?.startAt??0,i&&i.farEnd>0?1:0],...fie(t)})}var NN=e=>e?[e.anisotropy,...e.particleColor,...e.glow,e.densityScale,e.fadeInRate,e.useFogColors?1:0,e.staticLightingScatteringIntensity]:[];function VN(e,t,r){return t.fill(0,r,r+nie),t.set(rA(e),r),t}var BN=e=>e?[e.inMainView?1:0,e.inSkyCapture?1:0,e.inCubeCaptures?1:0,e.holdout?1:0,e.skyLightScattering.strength,e.skyLightScattering.roughness,...e.screenSpaceScattering?Object.values(e.screenSpaceScattering):[-1]]:[];function Ng(e,t){if(e===t)return!0;let r=kg(e),n=kg(t);return Be(rA(e,r),rA(t,n))&&Be(NN(r?.volumetric),NN(n?.volumetric))&&Be(BN(r),BN(n))&&r?.cubemap?.texels===n?.cubemap?.texels}var HN=.25,dc=U(0),pie=A({planetRadius:F("planetRadius",6360),height:F("height",60),groundHeight:g("groundHeight",0,R),groundPosition:ze("groundPosition",[0,0]),groundAlbedo:Mt("groundAlbedo",[.402,.402,.402]),rayleighScattering:eo("rayleighScattering",[.005802,.013558,.0331],dc),rayleighScaleHeight:F("rayleighScaleHeight",8),mieScattering:eo("mieScattering",[.003996,.003996,.003996],dc),mieAbsorption:eo("mieAbsorption",[444e-6,444e-6,444e-6],dc),mieAnisotropy:g("mieAnisotropy",.8,[-.999,.999]),mieScaleHeight:F("mieScaleHeight",1.2),ozoneAbsorption:eo("ozoneAbsorption",[65e-5,.001881,85e-6],dc),multiScatteringFactor:g("multiScatteringFactor",1,[0,100]),skyLuminanceFactor:eo("skyLuminanceFactor",[1,1,1],dc),skyAndAerialPerspectiveLuminanceFactor:eo("skyAndAerialPerspectiveLuminanceFactor",[1,1,1],dc),aerialPerspectiveDistanceScale:y("aerialPerspectiveDistanceScale",1),aerialPerspectiveStartDepth:y("aerialPerspectiveStartDepth",.1),heightFogContribution:y("heightFogContribution",1),minSunElevation:g("minSunElevation",-90,[-90,90]),sampleCountScale:g("sampleCountScale",1,U(HN)),inMainView:p("inMainView",!0),holdout:p("holdout",!1)}),hie=A({altitude:y("altitude",25),width:y("width",15),peak:y("peak",1)}),pa=Object.freeze({...ue(pie,{}),ozoneLayer:Object.freeze(ue(hie,{}))}),Co=qT("atmosphere");function fs(e,t,r,n=1/0,o=!1){let i=e[t]??pa[t],s=o?i>r&&i<n:i>=r&&i<=n;return(!K(i)||!s)&&Co(`${t} must be in ${o?`(${r}, ${n})`:`[${r}, ${n}]`}`,e),i}var Bg=(e,t)=>fs(e,t,0,1/0,!0);function fa(e,t){return Ln(e[t]??pa[t],t,e,Co)}function mie(e){return fs(e,"sampleCountScale",HN)}function gie(e){let t={...pa.ozoneLayer,...e.ozoneLayer};return(!K(t.altitude)||t.altitude<0)&&Co("ozoneLayer.altitude must be \u2265 0",e),(!K(t.width)||t.width<0)&&Co("ozoneLayer.width must be \u2265 0",e),(!K(t.peak)||t.peak<0)&&Co("ozoneLayer.peak must be \u2265 0",e),t}function Ug(e){let t=e===!0?{}:e;(typeof t!="object"||t===null)&&Co("expects true or an object of settings",e),K(t.groundHeight??0)||Co("groundHeight must be finite",t),typeof(t.inMainView??!0)!="boolean"&&Co("inMainView must be true or false",t),typeof(t.holdout??!1)!="boolean"&&Co("holdout must be true or false",t);let r=t.groundPosition??pa.groundPosition;return(!Array.isArray(r)||r.length!==2||!r.every(K))&&Co("groundPosition must be two finite numbers, [x, z]",t),{planetRadius:Bg(t,"planetRadius"),height:Bg(t,"height"),groundHeight:t.groundHeight??pa.groundHeight,groundPosition:[r[0],r[1]],groundAlbedo:fa(t,"groundAlbedo"),rayleighScattering:fa(t,"rayleighScattering"),rayleighScaleHeight:Bg(t,"rayleighScaleHeight"),mieScattering:fa(t,"mieScattering"),mieAbsorption:fa(t,"mieAbsorption"),mieAnisotropy:fs(t,"mieAnisotropy",-1,1,!0),mieScaleHeight:Bg(t,"mieScaleHeight"),ozoneAbsorption:fa(t,"ozoneAbsorption"),ozoneLayer:gie(t),multiScatteringFactor:fs(t,"multiScatteringFactor",0,100),skyLuminanceFactor:fa(t,"skyLuminanceFactor"),skyAndAerialPerspectiveLuminanceFactor:fa(t,"skyAndAerialPerspectiveLuminanceFactor"),aerialPerspectiveDistanceScale:fs(t,"aerialPerspectiveDistanceScale",0),aerialPerspectiveStartDepth:fs(t,"aerialPerspectiveStartDepth",0),heightFogContribution:fs(t,"heightFogContribution",0),minSunElevation:fs(t,"minSunElevation",-90,90),sampleCountScale:mie(t),inMainView:t.inMainView??pa.inMainView,holdout:t.holdout??pa.holdout}}var GN=e=>[e.planetRadius,e.height,e.groundHeight,...e.groundPosition,...e.groundAlbedo,...e.rayleighScattering,e.rayleighScaleHeight,...e.mieScattering,...e.mieAbsorption,e.mieAnisotropy,e.mieScaleHeight,...e.ozoneAbsorption,e.ozoneLayer.altitude,e.ozoneLayer.width,e.ozoneLayer.peak,e.multiScatteringFactor,...e.skyLuminanceFactor,...e.skyAndAerialPerspectiveLuminanceFactor,e.aerialPerspectiveDistanceScale,e.aerialPerspectiveStartDepth,e.heightFogContribution,e.minSunElevation,e.sampleCountScale,e.inMainView?1:0,e.holdout?1:0];function fc(e,t){return e===t?!0:!!e&&!!t&&Be(GN(e),GN(t))}var jd={none:0,filmic:1},sA="filmic",kVe=e=>e?.exposure??Wd,FVe=e=>jd[e?.toneMapping??sA],aA=0,NVe=e=>e?.sharpness??aA,$d=.4,BVe=e=>e?.vignette??$d,ha=9,lA=76,iA={constant:.886226925452758,linear:1.0233267079464885,quadraticCross:.8580855308097834,quadraticZ:.2477079561003757,quadraticDifference:.4290427654048917},cA=()=>new Array(ha*3).fill(0);function uA(e,t){for(let r=0;r<3;r++)e[r]+=t[r]/iA.constant;return e}function dA(e,t,r,n){let o=[n[1],n[2],n[0]];for(let i=0;i<3;i++){e[i]+=(t[i]+r[i])/2/iA.constant;let s=(t[i]-r[i])/2/iA.linear;for(let a=0;a<3;a++)e[(a+1)*3+i]+=s*o[a]}return e}function fA(e,t,r){for(let n=0;n<ha*3;n++)e[n]+=(t[n]??0)*r;return e}function WN(e,t){t.fill(0),VN(e?.fog,t,ha*4);let r=e?.irradiance;if(!r)return t;for(let n=0;n<ha;n++)for(let o=0;o<3;o++)t[n*4+o]=r[n*3+o];return t}function pA(e){let t={},{exposure:r,toneMapping:n,sharpness:o,vignette:i,irradiance:s,fog:a}=e??{};if(r!==void 0)try{t.exposure=Pg(r)}catch{throw new E("INVALID_SCENE_ENVIRONMENT","exposure must be 'auto' or a number above zero",{exposure:r})}if(a!==void 0&&(t.fog=Fg(a)),e?.atmosphere!==void 0&&(t.atmosphere=Ug(e.atmosphere)),o!==void 0){if(!K(o)||o<0||o>uc)throw new E("INVALID_SCENE_ENVIRONMENT",`sharpness must be in [0, ${uc}]`,{sharpness:o});t.sharpness=o}if(i!==void 0){if(!K(i)||i<0)throw new E("INVALID_SCENE_ENVIRONMENT","vignette must be 0 or more",{vignette:i});t.vignette=i}if(n!==void 0){if(!(n in jd))throw new E("INVALID_SCENE_ENVIRONMENT",`unknown tone mapping ${n}`,{toneMapping:n});t.toneMapping=n}if(s!==void 0){if(s.length!==ha*3||!s.every(K))throw new E("INVALID_SCENE_ENVIRONMENT","irradiance expects 27 finite numbers",{length:s.length});t.irradiance=[...s]}return t}var Sie=e=>e===null||Number.isFinite(e)&&e>=0,hA=(e,t)=>t===0?e===0?1:1/0:e/t;function zN(e,t,r){if(e.provenance!=="measured"||t.provenance!=="measured"||e.contextKey!==t.contextKey||![e,t].every(o=>[o.cpuMs,o.gpuMs,o.latencyMs,o.memoryBytes,o.evictionsPerSecond].every(Sie)))return{veto:"Incomparable or invalid evidence"};if(r.requireGpuTiming&&(e.gpuMs===null||t.gpuMs===null))return{veto:"GPU evidence unavailable"};if(r.memoryBudgetBytes!==void 0&&t.memoryBytes===null)return{veto:"Memory evidence unavailable"};if((t.memoryBytes??0)>(r.memoryBudgetBytes??1/0))return{veto:"Circuit breaker: memory budget"};if((t.evictionsPerSecond??0)>(r.maxEvictionsPerSecond??1/0))return{veto:"Circuit breaker: thrashing"};let n=[hA(t.cpuMs,e.cpuMs),hA(t.latencyMs,e.latencyMs)];return t.gpuMs!==null&&e.gpuMs!==null&&n.push(hA(t.gpuMs,e.gpuMs)),{harmful:n.some(o=>o>r.disableRatio),beneficial:n.every(o=>o<=r.enableRatio)}}function wie(e){if(!Number.isInteger(e.minimumSamples)||e.minimumSamples<1||!Number.isInteger(e.consecutiveViolations)||e.consecutiveViolations<1||!Number.isFinite(e.minimumPeriodMs)||e.minimumPeriodMs<0||!Number.isFinite(e.enableRatio)||e.enableRatio<=0||!Number.isFinite(e.disableRatio)||e.enableRatio>=e.disableRatio||![e.memoryBudgetBytes,e.maxEvictionsPerSecond].every(t=>t===void 0||Number.isFinite(t)&&t>=0))throw new Error("INVALID_SAFETY_POLICY")}function yie(e){wie(e);let t={tier:"baseline",enabled:!1,reason:"No comparable measured evidence",changedAt:0,revision:0},r=0,n=0,o=-1/0,i=(s,a,l)=>(t.reason!==a&&(t={tier:s?"full":"baseline",enabled:s,reason:a,changedAt:l,revision:t.revision+1}),t);return{getDecision:()=>t,trip(s,a){if(!Number.isFinite(a)||a<o)throw new Error("INVALID_CLOCK");return o=a,r=n=0,i(!1,`Circuit breaker: ${s}`,a)},observe(s,a,l){if(!Number.isFinite(l)||l<o)throw new Error("INVALID_CLOCK");o=l;let c=zN(s,a,e);if("veto"in c)return r=n=0,i(!1,c.veto,l);let{harmful:u,beneficial:d}=c;return n=u?n+1:0,r=d?r+1:0,l-t.changedAt<e.minimumPeriodMs?t:t.enabled&&n>=e.consecutiveViolations?(n=r=0,i(!1,"Measured cost exceeds reference",l)):!t.enabled&&r>=e.minimumSamples?(n=r=0,i(!0,"Measured benefit within configured budgets",l)):t}}}var mA=4,Io=24,jN=new Float64Array(Io),pc=new Float64Array(4);function Yd(e,t){YN(jN,t);for(let r=0;r<Io;r+=4)$N(e,r,jN,r)}function $N(e,t,r,n){let o=r[n],i=r[n+1],s=r[n+2],a=r[n+3],l=o*o+i*i+s*s,c=o===0&&i===0&&s===0?0:l<aa||l===1/0?+Fr(o,i,s):Math.sqrt(l);if(c===0){e[t]=0,e[t+1]=0,e[t+2]=0,e[t+3]=1;return}let u=1/c;e[t]=o*u,e[t+1]=i*u,e[t+2]=s*u,e[t+3]=a*u}function YN(e,t){let r=t[0],n=t[4],o=t[8],i=t[12],s=t[1],a=t[5],l=t[9],c=t[13],u=t[2],d=t[6],f=t[10],h=t[14],m=t[3],w=t[7],x=t[11],b=t[15];e[0]=m-r,e[1]=w-n,e[2]=x-o,e[3]=b-i,e[4]=m+r,e[5]=w+n,e[6]=x+o,e[7]=b+i,e[8]=m+s,e[9]=w+a,e[10]=x+l,e[11]=b+c,e[12]=m-s,e[13]=w-a,e[14]=x-l,e[15]=b-c,e[mA*4]=u,e[17]=d,e[18]=f,e[19]=h,e[20]=m-u,e[21]=w-d,e[22]=x-f,e[23]=b-h}function xie(e,t,r,n,o){if(Number.isFinite(n)){if(pc[0]=r[2],pc[1]=r[6],pc[2]=r[10],pc[3]=r[14]+n,o){$N(e,t,pc,0);return}for(let i=0;i<4;i++)e[t+i]=pc[i]}}function hc(e,t,r,n,o){return yg(e,r,n,o,t)+e[t+3]}function KN(e,t,r,n){return!bie(e,t,r,n,0)}function bie(e,t,r,n,o){let i=-o;return hc(e,0,t,r,n)<i||hc(e,4,t,r,n)<i||hc(e,8,t,r,n)<i||hc(e,12,t,r,n)<i||hc(e,mA*4,t,r,n)<i||hc(e,20,t,r,n)<i}function mr(e,t){let r=t instanceof Float64Array?t:Eie(t),n=r[0],o=r[1],i=r[2],s=r[3],a=r[4],l=r[5],c=r[6],u=r[7],d=r[8],f=r[9],h=r[10],m=r[11],w=r[12],x=r[13],b=r[14],T=r[15],L=f*b*u-x*h*u+x*c*m-l*b*m-f*c*T+l*h*T,_=-(f*b*s)+x*h*s-x*i*m+o*b*m+f*i*T-o*h*T,D=l*b*s-x*c*s+x*i*u-o*b*u-l*i*T+o*c*T,C=-(l*h*s)+f*c*s-f*i*u+o*h*u+l*i*m-o*c*m,j=-(d*b*u)+w*h*u-w*c*m+a*b*m+d*c*T-a*h*T,$=d*b*s-w*h*s+w*i*m-n*b*m-d*i*T+n*h*T,q=-(a*b*s)+w*c*s-w*i*u+n*b*u+a*i*T-n*c*T,le=a*h*s-d*c*s+d*i*u-n*h*u-a*i*m+n*c*m,ge=d*x*u-w*f*u+w*l*m-a*x*m-d*l*T+a*f*T,Ue=-(d*x*s)+w*f*s-w*o*m+n*x*m+d*o*T-n*f*T,ye=a*x*s-w*l*s+w*o*u-n*x*u-a*o*T+n*l*T,Fe=-(a*f*s)+d*l*s-d*o*u+n*f*u+a*o*m-n*l*m,Ye=-(d*x*c)+w*f*c-w*l*h+a*x*h+d*l*b-a*f*b,Ke=d*x*i-w*f*i+w*o*h-n*x*h-d*o*b+n*f*b,ut=-(a*x*i)+w*l*i-w*o*c+n*x*c+a*o*b-n*l*b,Ae=a*f*i-d*l*i+d*o*c-n*f*c-a*o*h+n*l*h,Kt=n*L+o*j+i*ge+s*Ye;if(Kt===0)return e.fill(0,0,16);let _e=1/Kt;return e[0]=L*_e,e[1]=_*_e,e[2]=D*_e,e[3]=C*_e,e[4]=j*_e,e[5]=$*_e,e[6]=q*_e,e[7]=le*_e,e[8]=ge*_e,e[9]=Ue*_e,e[10]=ye*_e,e[11]=Fe*_e,e[12]=Ye*_e,e[13]=Ke*_e,e[14]=ut*_e,e[15]=Ae*_e,e}var qN=new Float64Array(16);function Eie(e){for(let t=0;t<16;t++)qN[t]=e[t];return qN}var Tie=ce/2,XN=.001,gA=.1,Aie=1e-8,Oie=[0,1,2,4,5,6,8,9,10],SA=e=>e>0?e:gA,wA=e=>e>=XN?e:XN,yA=(e,t)=>e/(1+qt(t,0,1)),ko=e=>yA(e.zoom,e.overscan);function Rn(e,t=1){return Math.tan(wA(e)*Tie)/t}function JVe(e,t,r=1){return Rn(e,r)*Je(1,t)}var eGe=e=>1/Math.tan(e);function tGe(e,t,r=1,n=1){return e[0]=Vg(r,t[0]),e[1]=Vg(n,t[5]),e}var Vg=(e,t)=>e*Math.abs(t)/2;function e2(e,t=1,r=1){return Math.max(Vg(t,e[0]),Vg(r,e[5]))}function Lie(e,t,r=new Float64Array(4)){return r[0]=(e.right+e.left)/2,r[1]=(e.top+e.bottom)/2,r[2]=(e.right-e.left)/(2*t),r[3]=(e.top-e.bottom)/(2*t),r}function ps(e,t,r,n=new Float64Array(4)){return Lie(e,r,n),e.fitAspect&&(n[2]=n[3]*t),n}function xA(e,t,r,n,o){let i=SA(n),s=i*Rn(t)/o,a=r*s;return e[0]=i/a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i/s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=0,e[11]=-1,e[12]=0,e[13]=0,e[14]=i,e[15]=0,e}function bA(e,t,r,n,o,i,s){let a=r-t,l=o-n,c=s-i;return e[0]=2/a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2/l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1/c,e[11]=0,e[12]=-(t+r)/a+0,e[13]=-(n+o)/l+0,e[14]=s/c,e[15]=1,e}var QN=2097152,Rie=8796093022208,ZN=1e-5,JN=.707107;function t2(e,t,{halfFloatDepth:r,scaleUnits:n,depthScale:o,shift:i}){let s=n&&r,a=s?Rie:QN,l=r?as:QN;o>0&&(l=qt(o,1,l));let c=t.width/(t.aspect===0?ZN:t.aspect),u=Math.abs(t.forwardUp),d;if(r&&c>0&&t.viewportWidth*t.viewportHeight>0){let w=Math.floor(c/t.viewportHeight);s&&(w=Math.log2(w)),d=qt(l*w,l,a)}else d=c/(u===0?ZN:u);let f=t.targetDistance*u,h=qt(1-u,JN,1),m=Math.max(t.width,c)*Math.max(qt(u,JN,1)-1/h,-.5)-f;e.near=m+i,e.far=qt(d,c,a+m)+i}function r2(e,t,r,n,o,{nearPlane:i,heightAsViewTarget:s}){let a=n.far-n.near;if(ZF(r)){let l=s?Math.abs(Math.min(e[13],o))*Math.abs(t[1]):0;for(let c=0;c<3;c++)e[12+c]+=t[c]*(l+n.near)}else for(let l=0;l<3;l++){let c=e[12+l]+r[l];e[12+l]+=r[l]+t[l]*n.near,r[l]=c-e[12+l]}n.near=i,n.far=i+a}function EA(){return{view:new Float64Array(16),viewProjection:new Float64Array(16),planes:new Float64Array(Io)}}function _ie(e,t){let r=mi(t),n=0;for(let o of Oie)n=Math.max(n,Math.abs(t[o]));return r===0||!Number.isFinite(r)||n<=Aie?e.set(Or):mr(e,t)}function TA(e,t,r){return _ie(e.view,r),AA(e.viewProjection,e.planes,t,e.view),e}function AA(e,t,r,n){Ve(e,r,n),Yd(t,e)}var n2=(e,t)=>e*t+(1-e);function Gg(e,t,r,n,o,i,s,a=1){let l=o*t,c=e*t,u=n2(a,n-l),d=u-a*c,f=a*(r+l);if(!(d>a*s))return 1/0;let h=PT(u,f);return h>=u&&h<1/0?c*i/u*(h/d):1/0}function vie(e,t,r,n,o,i,s,a,l=1){let c=PT(r,n);return o2(e,t,c,-o,i,s,a,l)}function o2(e,t,r,n,o,i,s,a=1){if(e===0)return 0;if(e===1/0)return 1/0;if(!Number.isFinite(e)||e<0||!Number.isFinite(t)||t<0||!Number.isFinite(o)||o<0||!Number.isFinite(i)||i<=0||!Number.isFinite(s)||s<=0||!(r>=0&&r<1/0)||!Number.isFinite(n)||!(a>=0&&a<=1))throw new Error("Invalid cluster parameters");return Gg(e,t,r,n,o,i,s,a)}var to=()=>{};function i2(e,t){try{let r=Object(e).dispose;typeof r=="function"&&r.call(e)}catch{}try{t(e)}catch{}}function ro(e,t){if(!t)return to;if(t.aborted)return e.abort(t.reason),to;let r=()=>e.abort(t.reason);return t.addEventListener("abort",r,{once:!0}),()=>t.removeEventListener("abort",r)}var ma=(e,t)=>t?AbortSignal.any([t,e]):e;function Mie(e,t){let r=new Set,n={eventVersion:1,id:e,status:"queued",progress:null,result:null,error:null};return{publish(o){n=Object.freeze({...n,...o});for(let i of r)try{i()}catch{}try{t(n)}catch{}},getSnapshot:()=>n,subscribe(o){return r.add(o),()=>{r.delete(o)}}}}function Die(e,t,r={}){let n=new AbortController,{signal:o,telemetry:i=to,disposeResult:s=to}=r,{publish:a,getSnapshot:l,subscribe:c}=Mie(e,i),u=ro(n,o);return{promise:Promise.resolve().then(async()=>{let f;try{return n.signal.throwIfAborted(),a({status:"running"}),f=await t({signal:n.signal,progress:h=>{n.signal.throwIfAborted(),a({progress:h})}}),n.signal.throwIfAborted(),a({status:"completed",result:f}),f}catch(h){f!==void 0&&i2(f,s);let m=String(h);throw a({status:n.signal.aborted?"cancelled":"failed",error:{code:n.signal.aborted?"CANCELLED":"JOB_FAILED",message:m}}),h}finally{u()}}),cancel:f=>n.abort(f),getSnapshot:l,subscribe:c}}function mGe(e,t,r){let n=e.rows;if(!n?.length||n[0].version>t+1)return null;r[0]=1/0,r[1]=-1/0;for(let o of n)o.version>t&&(r[0]=Math.min(r[0],o.first),r[1]=Math.max(r[1],o.last));return r}var no=e=>!!e?.isTexture,Pie=[0,1,3,4,6,7],Cie=[1,0,0,1,0,0];function gGe(e){return Pie.some((t,r)=>e[t]!==Cie[r])}function SGe(e,t){return e.magFilter==="nearest"||e.minFilter.endsWith("MipNearest")?1:k(e.anisotropy,1,t)}var Iie=(e,t)=>{let r={...e};for(let[n,o,i]of t)for(let s=1;s<=i;s++)r[`${n}${s}`]=`${o}${s}`;return r},qd={key:{acesSceneColorMultiplier:"acesSceneColourGain",allowAssemblies:"allowMeshAssemblies",allowSimpleLights:"allowCheapLights",ambientOcclusionCompute:"ambientOcclusionAsCompute",ambientOcclusionComputeSmooth:"ambientOcclusionAsComputeSoftening",ambientOcclusionLevels:"ambientOcclusionPassCount",ambientOcclusionMaxQuality:"ambientOcclusionQualityCap",ambientOcclusionMethod:"ambientOcclusionAlgorithm",ambientOcclusionMipLevelFactor:"ambientOcclusionCoarseLevelBias",ambientOcclusionRadiusScale:"ambientOcclusionRadiusFactor",ambientOcclusionStaticFraction:"ambientOcclusionStaticShare",ambientOcclusionWithScreenProbes:"ambientOcclusionWithViewProbes",bloomApplyLocalExposure:"bloomFollowsLocalExposure",bloomCacheKernel:"bloomKeptKernel",bloomScreenPercentage:"bloomResolutionShare",cachedLightingPreExposure:"storedLightExposure",capsuleDirectShadows:"bodyDirectShadows",capsuleIndirectConeAngle:"bodyIndirectConeAngle",capsuleIndirectShadows:"bodyIndirectShadows",capsuleMaxDirectOcclusionDistance:"bodyMaxDirectOcclusionDistance",capsuleMaxIndirectOcclusionDistance:"bodyMaxIndirectOcclusionDistance",capsuleMinSkyAngle:"bodyMinSkyAngle",capsuleShadowFadeAngleFromVertical:"bodyShadowFadeAngleFromVertical",capsuleShadows:"bodyShadows",capsuleShadowsFullResolution:"bodyShadowsFullResolution",capsuleSkyAngleScale:"bodySkyAngleScale",clearCoatNormal:"coatLayerNormal",closuresPerPixel:"surfaceLayersPerPixel",customDepth:"markedDepth",customDepthTemporalAAJitter:"markedDepthTemporalAAJitter",debugCursorX:"debugPixelX",debugCursorY:"debugPixelY",depthBlurAmount:"blurByDepthAmount",depthBucketing:"depthBinning",depthBucketsMaxZ:"depthBinsMaxZ",depthBucketsMinZ:"depthBinsMinZ",diffuseIndirectHalfRes:"diffuseBounceHalfResolution",directLightingMeshDistanceFieldTrace:"directLightingMeshFieldTrace",distanceFieldOcclusion:"fieldSkyOcclusion",distanceFieldOcclusionHistoryDistanceThreshold:"fieldSkyOcclusionHistoryDistanceThreshold",distanceFieldOcclusionHistoryStabilityPass:"fieldSkyOcclusionHistoryStabilityPass",distanceFieldOcclusionHistoryWeight:"fieldSkyOcclusionHistoryWeight",distanceFieldOcclusionJitterConeDirections:"fieldSkyOcclusionJitterConeDirections",distanceFieldOcclusionMaxViewDistance:"fieldSkyOcclusionMaxViewDistance",distanceFieldOcclusionObjects:"fieldSkyOcclusionObjects",distanceFieldOcclusionObjectsPerCullTile:"fieldSkyOcclusionObjectsPerCullTile",distanceFieldOcclusionQuality:"fieldSkyOcclusionQuality",distanceFieldOcclusionSampleSet:"fieldSkyOcclusionSampleSet",distanceFieldOcclusionSpecularMode:"fieldSkyOcclusionSpecularMode",distanceFieldOcclusionStepExponentScale:"fieldSkyOcclusionStepExponentScale",distanceFieldOcclusionTraverseMips:"fieldSkyOcclusionTraverseMips",distanceFieldOcclusionUseHistory:"fieldSkyOcclusionUseHistory",distanceFieldOcclusionUseJitter:"fieldSkyOcclusionUseJitter",distanceFieldOcclusionViewFadeDistanceScale:"fieldSkyOcclusionViewFadeDistanceScale",distanceFieldShadowCompactTiles:"fieldShadowCompactTiles",distanceFieldShadowFullResolution:"fieldShadowFullResolution",distanceFieldShadowObjectsPerTile:"fieldShadowObjectsPerTile",distanceFieldShadowQuality:"fieldShadowQuality",distanceFieldShadowSnapResolution:"fieldShadowSnapResolution",distanceFieldShadowTileSize:"fieldShadowTileSize",distanceFieldShadowTwoSidedBias:"fieldShadowTwoSidedBias",distanceFieldShadowing:"fieldShadowing",downsampledOcclusionQueries:"reducedOcclusionQueries",filmGrainSequenceLength:"filmGrainLoopLength",finalGatherMethod:"finalGatherAlgorithm",fogScreenSpaceScattering:"fogScatterInScreenSpace",fogSeparateComposition:"fogOwnComposite",globalDistanceField:"worldField",globalDistanceFieldAverageCulledObjectsPerCell:"worldFieldAverageCulledObjectsPerCell",globalDistanceFieldCacheMostlyStaticSeparately:"worldFieldCacheMostlyStaticSeparately",globalDistanceFieldCameraVelocityDecay:"worldFieldCameraVelocityDecay",globalDistanceFieldClipmapExponent:"worldFieldClipmapExponent",globalDistanceFieldClipmaps:"worldFieldClipmaps",globalDistanceFieldCoveredExpandSurfaceScale:"worldFieldCoveredExpandSurfaceScale",globalDistanceFieldDebugShowStats:"worldFieldDebugShowStats",globalDistanceFieldDitheredTransparencyStepThreshold:"worldFieldDitheredTransparencyStepThreshold",globalDistanceFieldDitheredTransparencyTraceThreshold:"worldFieldDitheredTransparencyTraceThreshold",globalDistanceFieldFastCameraMode:"worldFieldFastCameraMode",globalDistanceFieldForceFullUpdate:"worldFieldForceFullUpdate",globalDistanceFieldForceRecacheOnStreaming:"worldFieldForceRecacheOnStreaming",globalDistanceFieldForceUpdateOnce:"worldFieldForceUpdateOnce",globalDistanceFieldMinMeshRadius:"worldFieldMinMeshRadius",globalDistanceFieldMinMeshRadiusInVoxels:"worldFieldMinMeshRadiusInVoxels",globalDistanceFieldMipFactor:"worldFieldMipFactor",globalDistanceFieldNotCoveredExpandSurfaceScale:"worldFieldNotCoveredExpandSurfaceScale",globalDistanceFieldNotCoveredMinStepScale:"worldFieldNotCoveredMinStepScale",globalDistanceFieldOccupancyRatio:"worldFieldOccupancyRatio",globalDistanceFieldPartialUpdates:"worldFieldPartialUpdates",globalDistanceFieldRecacheOnStreaming:"worldFieldRecacheOnStreaming",globalDistanceFieldResolution:"worldFieldResolution",globalDistanceFieldSimpleCoverageBasedExpand:"worldFieldSimpleCoverageBasedExpand",globalDistanceFieldStaggeredUpdates:"worldFieldStaggeredUpdates",globalDistanceFieldStartDistance:"worldFieldStartDistance",globalDistanceFieldTraceClipmapExtent:"worldFieldTraceClipmapExtent",globalDistanceFieldTraceResolution:"worldFieldTraceResolution",globalDistanceFieldTraceViewDistance:"worldFieldTraceViewDistance",globalDistanceFieldUpdate:"worldFieldUpdate",globalDistanceFieldUpdatesPerFrame:"worldFieldUpdatesPerFrame",globalDistanceFieldViewDistance:"worldFieldViewDistance",hairCustomDepthCoverageThreshold:"hairMarkedDepthCoverageThreshold",hairLutAbsorptionCount:"hairTableAbsorptionCount",hairLutIncidentAngleCount:"hairTableIncidentAngleCount",hairLutRoughnessCount:"hairTableRoughnessCount",hairLutSampleCountScale:"hairTableSampleCountScale",hairRenderCustomDepth:"hairRenderMarkedDepth",hardwareRayTracingHitLightingAllowed:"hardwareRayTracingHitShadingAllowed",hardwareRayTracingHitLightingDirectLighting:"hardwareRayTracingHitShadingDirectLighting",hardwareRayTracingHitLightingForceOpaque:"hardwareRayTracingHitShadingForceOpaque",hardwareRayTracingHitLightingReflectionCaptures:"hardwareRayTracingHitShadingCubeCaptures",hardwareRayTracingHitLightingShadowMode:"hardwareRayTracingHitShadingShadowMode",hardwareRayTracingHitLightingShadowTranslucencyMode:"hardwareRayTracingHitShadingShadowTranslucencyMode",hardwareRayTracingHitLightingSkylight:"hardwareRayTracingHitShadingSkylight",hardwareRayTracingLightingMode:"hardwareTraceShadingMode",hardwareRayTracingPullbackBias:"hardwareTraceBackoffBias",heterogeneousVolumes:"densityVolumes",heterogeneousVolumesAllowed:"densityVolumesAllowed",heterogeneousVolumesAmbientOcclusion:"densityVolumesAmbientOcclusion",heterogeneousVolumesAmbientOcclusionDownsampleFactor:"densityVolumesAmbientOcclusionDownsampleFactor",heterogeneousVolumesAmbientOcclusionMaxStepCount:"densityVolumesAmbientOcclusionMaxStepCount",heterogeneousVolumesAmbientOcclusionMaxTraceDistance:"densityVolumesAmbientOcclusionMaxTraceDistance",heterogeneousVolumesAmbientOcclusionRayCountX:"densityVolumesAmbientOcclusionRayCountX",heterogeneousVolumesAmbientOcclusionRayCountY:"densityVolumesAmbientOcclusionRayCountY",heterogeneousVolumesBottomLevelGridHomogeneousAggregation:"densityVolumesBottomLevelGridHomogeneousAggregation",heterogeneousVolumesBottomLevelGridHomogeneousAggregationThreshold:"densityVolumesBottomLevelGridHomogeneousAggregationThreshold",heterogeneousVolumesBottomLevelGridResolution:"densityVolumesBottomLevelGridResolution",heterogeneousVolumesCLOD:"densityVolumesCLOD",heterogeneousVolumesCLODBias:"densityVolumesCLODBias",heterogeneousVolumesComposition:"densityVolumesComposition",heterogeneousVolumesDebug:"densityVolumesDebug",heterogeneousVolumesDepthSort:"densityVolumesDepthSort",heterogeneousVolumesDownsampleFactor:"densityVolumesDownsampleFactor",heterogeneousVolumesFarPlaneAutoTransition:"densityVolumesFarPlaneAutoTransition",heterogeneousVolumesFilter:"densityVolumesFilter",heterogeneousVolumesFilterWidth:"densityVolumesFilterWidth",heterogeneousVolumesFogInscattering:"densityVolumesFogInscattering",heterogeneousVolumesFrustumGrid:"densityVolumesFrustumGrid",heterogeneousVolumesFrustumGridDepthSliceCount:"densityVolumesFrustumGridDepthSliceCount",heterogeneousVolumesFrustumGridFarPlaneDistance:"densityVolumesFrustumGridFarPlaneDistance",heterogeneousVolumesFrustumGridMaxBottomLevelMemoryInMegabytes:"densityVolumesFrustumGridMaxBottomLevelMemoryInMegabytes",heterogeneousVolumesFrustumGridNearPlaneDistance:"densityVolumesFrustumGridNearPlaneDistance",heterogeneousVolumesFrustumGridShadingRate:"densityVolumesFrustumGridShadingRate",heterogeneousVolumesHardwareRayTracing:"densityVolumesHardwareRayTracing",heterogeneousVolumesHeightFog:"densityVolumesHeightFog",heterogeneousVolumesIndirectionGrid:"densityVolumesIndirectionGrid",heterogeneousVolumesIndirectionGridResolution:"densityVolumesIndirectionGridResolution",heterogeneousVolumesIndirectLighting:"densityVolumesIndirectLighting",heterogeneousVolumesIndirectLightingMode:"densityVolumesIndirectLightingMode",heterogeneousVolumesJitter:"densityVolumesJitter",heterogeneousVolumesLightDirectional:"densityVolumesLightDirectional",heterogeneousVolumesLightingCache:"densityVolumesLightingCache",heterogeneousVolumesLightingCacheDownsampleFactor:"densityVolumesLightingCacheDownsampleFactor",heterogeneousVolumesLightPoint:"densityVolumesLightPoint",heterogeneousVolumesLightRect:"densityVolumesLightRect",heterogeneousVolumesLightSpot:"densityVolumesLightSpot",heterogeneousVolumesMajorantGrid:"densityVolumesMajorantGrid",heterogeneousVolumesMajorantGridMax:"densityVolumesMajorantGridMax",heterogeneousVolumesMaxShadowTraceDistance:"densityVolumesMaxShadowTraceDistance",heterogeneousVolumesMaxStepCount:"densityVolumesMaxStepCount",heterogeneousVolumesMaxTraceDistance:"densityVolumesMaxTraceDistance",heterogeneousVolumesMinimumVoxelSizeInFrustum:"densityVolumesMinimumVoxelSizeInFrustum",heterogeneousVolumesMinimumVoxelSizeOutsideFrustum:"densityVolumesMinimumVoxelSizeOutsideFrustum",heterogeneousVolumesOrthoGrid:"densityVolumesOrthoGrid",heterogeneousVolumesOrthoGridMaxBottomLevelMemoryInMegabytes:"densityVolumesOrthoGridMaxBottomLevelMemoryInMegabytes",heterogeneousVolumesOrthoGridShadingRate:"densityVolumesOrthoGridShadingRate",heterogeneousVolumesPreshading:"densityVolumesPreshading",heterogeneousVolumesPreshadingCLOD:"densityVolumesPreshadingCLOD",heterogeneousVolumesPreshadingMipLevel:"densityVolumesPreshadingMipLevel",heterogeneousVolumesPreshadingPixelFormat:"densityVolumesPreshadingPixelFormat",heterogeneousVolumesScalability:"densityVolumesScalability",heterogeneousVolumesShadows:"densityVolumesShadows",heterogeneousVolumesShadowsAbsoluteErrorThreshold:"densityVolumesShadowsAbsoluteErrorThreshold",heterogeneousVolumesShadowsCameraDownsampleFactor:"densityVolumesShadowsCameraDownsampleFactor",heterogeneousVolumesShadowsDebugTweak:"densityVolumesShadowsDebugTweak",heterogeneousVolumesShadowsJitter:"densityVolumesShadowsJitter",heterogeneousVolumesShadowsLightDirectional:"densityVolumesShadowsLightDirectional",heterogeneousVolumesShadowsLightPoint:"densityVolumesShadowsLightPoint",heterogeneousVolumesShadowsLightRect:"densityVolumesShadowsLightRect",heterogeneousVolumesShadowsLightSpot:"densityVolumesShadowsLightSpot",heterogeneousVolumesShadowsMaxSampleCount:"densityVolumesShadowsMaxSampleCount",heterogeneousVolumesShadowsNearClippingDistance:"densityVolumesShadowsNearClippingDistance",heterogeneousVolumesShadowsOutOfFrustumShadingRate:"densityVolumesShadowsOutOfFrustumShadingRate",heterogeneousVolumesShadowsPipeline:"densityVolumesShadowsPipeline",heterogeneousVolumesShadowsPrecision:"densityVolumesShadowsPrecision",heterogeneousVolumesShadowsRelativeErrorThreshold:"densityVolumesShadowsRelativeErrorThreshold",heterogeneousVolumesShadowsResolution:"densityVolumesShadowsResolution",heterogeneousVolumesShadowsShadingRate:"densityVolumesShadowsShadingRate",heterogeneousVolumesShadowsStepSize:"densityVolumesShadowsStepSize",heterogeneousVolumesShadowStepSize:"densityVolumesShadowStepSize",heterogeneousVolumesShadowsType:"densityVolumesShadowsType",heterogeneousVolumesShadowsUseAvsmCompression:"densityVolumesShadowsUseAdaptiveVolumeShadowCompression",heterogeneousVolumesSparseVoxel:"densityVolumesSparseVoxel",heterogeneousVolumesSparseVoxelGenerationMipBias:"densityVolumesSparseVoxelGenerationMipBias",heterogeneousVolumesSparseVoxelPerTileCulling:"densityVolumesSparseVoxelPerTileCulling",heterogeneousVolumesSparseVoxelRefinement:"densityVolumesSparseVoxelRefinement",heterogeneousVolumesStepSize:"densityVolumesStepSize",heterogeneousVolumesTopLevelBitmask:"densityVolumesTopLevelBitmask",heterogeneousVolumesTranslucency:"densityVolumesTranslucency",heterogeneousVolumesUpsample:"densityVolumesUpsample",heterogeneousVolumesUseExistenceMask:"densityVolumesUseExistenceMask",heterogeneousVolumesVelocity:"densityVolumesVelocity",heterogeneousVolumesVolumeResolutionX:"densityVolumesVolumeResolutionX",heterogeneousVolumesVolumeResolutionY:"densityVolumesVolumeResolutionY",heterogeneousVolumesVolumeResolutionZ:"densityVolumesVolumeResolutionZ",heterogeneousVolumesVolumetricFog:"densityVolumesVolumetricFog",irisNormal:"eyeNormal",irradianceFieldAdaptivePlacement:"diffuseGridAdaptivePlacement",irradianceFieldAdaptivePlacementFeedbackTileSize:"diffuseGridAdaptivePlacementFeedbackTileSize",irradianceFieldClipmapDistributionBase:"diffuseGridClipmapDistributionBase",irradianceFieldClipmapWorldExtent:"diffuseGridClipmapWorldExtent",irradianceFieldGridResolution:"diffuseGridResolution",irradianceFieldInterpolateDownsampleFactor:"diffuseGridInterpolateDownsampleFactor",irradianceFieldIrradianceProbeResolution:"diffuseGridIrradianceProbeResolution",irradianceFieldMarkProbesDownsampleFactor:"diffuseGridMarkProbesDownsampleFactor",irradianceFieldMaxRoughnessToEvaluateRoughSpecular:"diffuseGridMaxRoughnessToEvaluateRoughSpecular",irradianceFieldNumClipmaps:"diffuseGridNumClipmaps",irradianceFieldNumMipmaps:"diffuseGridNumMipmaps",irradianceFieldNumProbesToTraceBudget:"diffuseGridNumProbesToTraceBudget",irradianceFieldOcclusionProbeResolution:"diffuseGridOcclusionProbeResolution",irradianceFieldProbeAtlasResolutionInProbes:"diffuseGridProbeAtlasResolutionInProbes",irradianceFieldProbeOcclusionBias:"diffuseGridProbeOcclusionBias",irradianceFieldProbeResolution:"diffuseGridProbeResolution",irradianceFieldShortRangeAORadius:"diffuseGridNearOcclusionRadius",lightGridDebug:"lightGridHeatmap",lightGridDebugMaxThreshold:"lightGridHeatmapMax",lightMaxDrawDistanceScale:"lightCutoffDistanceScale",lightShaftBlurPasses:"lightShaftSmoothPasses",lightShaftFirstPassDistance:"lightShaftFirstStepDistance",lightingDataFormat:"lightDataPacking",lutShaper:"colourTableShaper",maxMeshCards:"maxMeshImprints",meshCardMinDensity:"meshImprintMinDensity",meshCardNormalThreshold:"meshImprintNormalThreshold",lightFunctionAtlas:"lightPatternAtlas",lightFunctionAtlasSize:"lightPatternAtlasSize",lightFunctionBounce:"lightPatternBounce",lightFunctionDeferred:"lightPatternDeferred",lightFunctionFog:"lightPatternFog",lightFunctionFogSupersample:"lightPatternFogSupersample",lightFunctionFormat:"lightPatternFormat",lightFunctionMaxLights:"lightPatternMaxLights",lightFunctionSlotResolution:"lightPatternSlotResolution",lightFunctionTranslucent:"lightPatternTranslucent",localFogVolumeInVolume:"fogSphereInVolume",localFogVolumeMaxCount:"fogSphereMaxCount",localFogVolumeMaxVolumeDensity:"fogSphereMaxVolumeDensity",localFogVolumeOnTranslucent:"fogSphereOnTranslucent",localFogVolumes:"fogSpheres",localFogVolumeStartDistance:"fogSphereStartDistance",localFogVolumeSupport:"fogSphereSupport",localFogVolumeTileSize:"fogSphereTileSize",localFogVolumeUsesDepthPyramid:"fogSphereUsesDepthPyramid",meshDistanceFieldBlockBricks:"meshFieldBlockBricks",meshDistanceFieldBrickAtlasDepth:"meshFieldBrickAtlasDepth",meshDistanceFieldBrickAtlasSize:"meshFieldBrickAtlasSize",meshDistanceFieldDetailTraces:"meshFieldDetailTraces",meshDistanceFieldForceMips:"meshFieldForceMips",meshDistanceFieldMaxObjectRadius:"meshFieldMaxObjectRadius",meshDistanceFieldReverseAllocation:"meshFieldReverseAllocation",meshDistanceFieldSurfaceBiasExpand:"meshFieldSurfaceBiasExpand",meshDistanceFieldTrace:"meshFieldTrace",meshDistanceFieldTraceAllow:"meshFieldTraceAllow",meshDistanceFieldTraceAverageCulledCount:"meshFieldTraceAverageCulledCount",meshDistanceFieldTraceCullGridLogZOffset:"meshFieldTraceCullGridLogZOffset",meshDistanceFieldTraceCullGridLogZScale:"meshFieldTraceCullGridLogZScale",meshDistanceFieldTraceCullGridPixelSize:"meshFieldTraceCullGridPixelSize",meshDistanceFieldTraceCullGridZScale:"meshFieldTraceCullGridZScale",meshDistanceFieldTraceDistance:"meshFieldTraceDistance",meshDistanceFieldTraceDitheredTransparencyStepThreshold:"meshFieldTraceDitheredTransparencyStepThreshold",meshDistanceFieldTraceEndDistance:"meshFieldTraceEndDistance",meshDistanceFieldTraceNotCoveredExpandSurfaceScale:"meshFieldTraceNotCoveredExpandSurfaceScale",meshDistanceFieldTraceNotCoveredMinStepScale:"meshFieldTraceNotCoveredMinStepScale",meshDistanceFieldTraceRadiusThreshold:"meshFieldTraceRadiusThreshold",meshDistanceFieldUploadKiB:"meshFieldUploadKiB",motionBlurDirections:"motionBlurDirectionCount",motionBlurHalfResGather:"motionBlurHalfResolutionGather",motionBlurHalfResInput:"motionBlurHalfResolutionInput",motionBlurScatter:"motionBlurSplat",motionBlurSeparable:"motionBlurTwoPass",occlusionQueries:"instanceOcclusionTests",oitSortedPixels:"sortedTranslucentPixels",oitSortedPixelsEnable:"sortedTranslucentPixelsEnabled",pathTracingAdaptiveSampling:"pathTracingNoiseDrivenSampling",pathTracingAdaptiveSamplingErrorThreshold:"pathTracingNoiseDrivenSamplingTolerance",pathTracingAdaptiveSamplingVisualize:"pathTracingNoiseDrivenSamplingView",pathTracingApproximateCaustics:"pathTracingSoftCaustics",pathTracingAtmosphereOpticalDepthLUTNumSamples:"pathTracingSkyDepthTableSamples",pathTracingAtmosphereOpticalDepthLUTResolution:"pathTracingSkyDepthTableSize",pathTracingBackgroundAlpha:"pathTracingBackdropOpacity",pathTracingCloudAccelerationMapNumSamples:"pathTracingCloudSkipMapSamples",pathTracingCloudAccelerationMapResolution:"pathTracingCloudSkipMapSize",pathTracingCloudAccelerationMapVisualize:"pathTracingCloudSkipMapView",pathTracingCloudMultipleScatterMode:"pathTracingCloudBounceMode",pathTracingCloudRoughnessCutoff:"pathTracingCloudRoughnessLimit",pathTracingCompactionDepth:"pathTracingPackDepth",pathTracingDenoiser:"pathTracingDenoiseKind",pathTracingDenoiserNormalSpace:"pathTracingDenoiseNormalFrame",pathTracingDispatchSize:"pathTracingTileSize",pathTracingEnableAtmosphereGround:"pathTracingSkyGround",pathTracingEnableEmissive:"pathTracingEmissiveLight",pathTracingEnableReferenceAtmosphere:"pathTracingExactSky",pathTracingEnableReferenceClouds:"pathTracingExactClouds",pathTracingExperimental:"pathTracingUnstableFeatures",pathTracingFilterWidth:"pathTracingPixelFilterWidth",pathTracingFrameIndependentTemporalSeed:"pathTracingFixedSeed",pathTracingIndirectDispatch:"pathTracingGpuDrivenDispatch",pathTracingLightGridAxis:"pathTracingLightCellAxis",pathTracingLightGridMaxCount:"pathTracingLightCellMaxLights",pathTracingLightGridResolution:"pathTracingLightCellCount",pathTracingMISCompensation:"pathTracingWeightingCorrection",pathTracingMISMode:"pathTracingSampleWeighting",pathTracingMaxBounces:"pathTracingBounceLimit",pathTracingMaxPathIntensity:"pathTracingPathClamp",pathTracingMaxRaymarchSteps:"pathTracingMarchStepLimit",pathTracingProgressDisplay:"pathTracingProgressBar",pathTracingSamplerType:"pathTracingSequenceKind",pathTracingSamplesPerPixel:"pathTracingPixelSamples",pathTracingSkylightCaching:"pathTracingSkyLightReuse",pathTracingSpatialDenoiser:"pathTracingNeighbourDenoise",pathTracingTemporalDenoiser:"pathTracingHistoryDenoise",pathTracingTemporalDenoiserAlpha:"pathTracingHistoryDenoiseBlend",pathTracingTemporalDenoiserDeltaE:"pathTracingHistoryDenoiseColourGap",pathTracingTemporalDenoiserDeltaEHighFrequency:"pathTracingHistoryDenoiseColourGapDetail",pathTracingTemporalDenoiserDistanceMetrics:"pathTracingHistoryDenoiseMetrics",pathTracingTemporalDenoiserEta:"pathTracingHistoryDenoiseStep",pathTracingTemporalDenoiserKappa:"pathTracingHistoryDenoiseSharpness",pathTracingTemporalDenoiserMode:"pathTracingHistoryDenoiseMode",pathTracingTemporalDenoiserMotionOperation:"pathTracingHistoryDenoiseMotionStep",pathTracingTemporalDenoiserPatchCount:"pathTracingHistoryDenoiseWindowCount",pathTracingTemporalDenoiserSource:"pathTracingHistoryDenoiseInput",pathTracingTemporalDenoiserSubPixelOffsetStartMip:"pathTracingHistoryDenoiseSubPixelFirstLevel",pathTracingTemporalDenoiserTotalVariation:"pathTracingHistoryDenoiseVariationWeight",pathTracingTemporalDenoiserVisualizeMotionVector:"pathTracingHistoryDenoiseMotionView",pathTracingUseAnalyticTransmittance:"pathTracingClosedFormTransmittance",pathTracingVisibleLights:"pathTracingShownLights",pathTracingVisualize:"pathTracingDebugView",pathTracingVisualizeAmbientOcclusionMaxDistance:"pathTracingDebugViewOcclusionRange",pathTracingVisualizeIncludeTranslucent:"pathTracingDebugViewTranslucent",pathTracingVisualizeMaxCount:"pathTracingDebugViewCap",pathTracingVisualizeSamplesPerPixel:"pathTracingDebugViewSamples",pathTracingVolumeMISMode:"pathTracingVolumeSampleWeighting",pathTracingWiperMode:"pathTracingSweepMode",postProcessAllowBlendModes:"postProcessPermitBlendModes",postProcessAllowStencilTest:"postProcessPermitStencilTest",preExposureOverride:"forcedPreExposure",radianceCacheIrradianceProbeOffsetMode:"probeCacheIrradianceProbeOffsetMode",radianceCacheVisualize:"probeCacheVisualize",radianceCacheVisualizeClipmapIndex:"probeCacheVisualizeClipmapIndex",radianceCacheVisualizeRadiusScale:"probeCacheVisualizeRadiusScale",rayTracedTranslucencyDownsampleFactor:"tracedTranslucencyDownsample",rayTracedTranslucencyForceOpaque:"tracedTranslucencyAsOpaque",rayTracedTranslucencyMaxPrimaryHitEvents:"tracedTranslucencyPrimaryHitLimit",rayTracedTranslucencyMaxRayIntensity:"tracedTranslucencyRayClamp",rayTracedTranslucencyMaxSecondaryHitEvents:"tracedTranslucencySecondaryHitLimit",rayTracedTranslucencyPathThroughputThreshold:"tracedTranslucencyThroughputCutoff",rayTracedTranslucencySampleTranslucentReflectionInReflections:"tracedTranslucencyNestedReflections",rayTracingCulling:"atlasTraceCulling",rayTracingCullingAngle:"atlasTraceCullingAngle",rayTracingCullingRadius:"atlasTraceCullingRadius",rayTracingCullingUseDistanceToBox:"atlasTraceCullingBoxDistance",rayTracingCullingUseMinDrawDistance:"atlasTraceCullingNearDrawDistance",rayTracingEnable:"rayTracingAllowed",rayTracingExcludeSky:"atlasTraceSkipSky",rayTracingLightGridAxis:"hitLightCellAxis",rayTracingLightGridMaxCount:"hitLightCellMaxLights",rayTracingLightGridResolution:"hitLightCellCount",rectLightAtlasDebug:"rectLightAtlasView",rectLightAtlasDebugMipLevel:"rectLightAtlasViewLevel",rectLightAtlasFilterQuality:"rectLightAtlasSmoothing",rectLightAtlasForceUpdate:"rectLightAtlasRebuildNow",rectLightAtlasFormat:"rectLightAtlasTexelFormat",rectLightAtlasMaxResolution:"rectLightAtlasSizeLimit",rectLightAtlasMaxTextureRatio:"rectLightAtlasTextureShareLimit",rectLightAtlasResetOnChange:"rectLightAtlasClearOnChange",reflectionCaptureDiffuse:"cubeCaptureDiffuse",reflectionCaptureDiffuseReference:"cubeCaptureDiffuseReference",reflectionCaptureLightFunctions:"cubeCaptureLightPatterns",reflectionCaptureNearPlane:"cubeCaptureNearPlane",reflectionCaptureResolution:"cubeCaptureResolution",reflectionCaptures:"cubeCaptures",reflectionCaptureSupersample:"cubeCaptureSupersample",reflectionDownsampleCheckerboard:"reflectionCheckerHalf",reflectionHardwareRayTracingHitLighting:"reflectionHardwareRayTracingHitShading",reflectionMeshDistanceFieldTrace:"reflectionMeshFieldTrace",reflectionMethod:"reflectionTraceKind",reflectionRadianceCache:"reflectionProbeCache",reflectionRadianceCacheMaxRoughness:"reflectionProbeCacheMaxRoughness",reflectionRadianceCacheMaxTraceDistance:"reflectionProbeCacheMaxTraceDistance",reflectionRadianceCacheMinRoughness:"reflectionProbeCacheMinRoughness",reflectionRadianceCacheMinTraceDistance:"reflectionProbeCacheMinTraceDistance",reflectionRadianceCacheReprojectionRadiusScale:"reflectionProbeCacheReprojectionRadiusScale",reflectionRadianceCacheRoughnessFadeLength:"reflectionProbeCacheRoughnessFadeLength",reflectionRadianceCacheStochasticInterpolation:"reflectionProbeCacheStochasticInterpolation",reflectionTranslucencyRadianceCache:"reflectionTranslucencyProbeCache",renderCurve:"curveDrawing",renderCurveRasterMinCoverage:"curveDrawingMinCoverage",renderCurveRasterNumBinners:"curveDrawingBinnerCount",renderCurveRasterNumRasterizers:"curveDrawingRasterizerCount",renderCurveSwRaster:"curveDrawingSoftwareRaster",reservoirGatherBilateralFilter:"resampledGatherBilateralFilter",reservoirGatherBilateralFilterDepthWeightScale:"resampledGatherBilateralFilterDepthWeightScale",reservoirGatherBilateralFilterNormalAngleThresholdScale:"resampledGatherBilateralFilterNormalAngleThresholdScale",reservoirGatherBilateralFilterNumSamples:"resampledGatherBilateralFilterNumSamples",reservoirGatherBilateralFilterSpatialKernelRadius:"resampledGatherBilateralFilterSpatialKernelRadius",reservoirGatherBilateralFilterStrongBlurVarianceThreshold:"resampledGatherBilateralFilterStrongBlurVarianceThreshold",reservoirGatherClearHistoryEveryFrame:"resampledGatherClearHistoryEveryFrame",reservoirGatherDownsampleFactor:"resampledGatherDownsampleFactor",reservoirGatherFixedJitterIndex:"resampledGatherFixedJitterIndex",reservoirGatherMaxRayIntensity:"resampledGatherMaxRayIntensity",reservoirGatherResamplingAngleThreshold:"resampledGatherResamplingAngleThreshold",reservoirGatherResamplingDepthErrorThreshold:"resampledGatherResamplingDepthErrorThreshold",reservoirGatherShortRangeAO:"resampledGatherNearOcclusion",reservoirGatherShortRangeAOMaxScreenTraceFraction:"resampledGatherNearOcclusionMaxScreenTraceFraction",reservoirGatherSpatialResampling:"resampledGatherSpatialResampling",reservoirGatherSpatialResamplingKernelRadius:"resampledGatherSpatialResamplingKernelRadius",reservoirGatherSpatialResamplingNumPasses:"resampledGatherSpatialResamplingNumPasses",reservoirGatherSpatialResamplingNumSamples:"resampledGatherSpatialResamplingNumSamples",reservoirGatherSpatialResamplingOcclusionScreenTraceDistance:"resampledGatherSpatialResamplingOcclusionScreenTraceDistance",reservoirGatherTemporal:"resampledGatherTemporal",reservoirGatherTemporalDistanceThreshold:"resampledGatherTemporalDistanceThreshold",reservoirGatherTemporalMaxFramesAccumulated:"resampledGatherTemporalMaxFramesAccumulated",reservoirGatherTemporalResampling:"resampledGatherTemporalResampling",reservoirGatherTemporalResamplingResetHistory:"resampledGatherTemporalResamplingResetHistory",reservoirGatherUpsampleKernelSize:"resampledGatherUpsampleKernelSize",reservoirGatherUpsampleMethod:"resampledGatherUpsampleMethod",reservoirGatherUpsampleNumSamples:"resampledGatherUpsampleNumSamples",reservoirGatherValidateTemporalReservoirsEveryNFrames:"resampledGatherValidateTemporalReservoirsEveryNFrames",runtimeMeshCards:"runtimeMeshImprints",runtimeMeshDistanceFields:"runtimeMeshFields",sampledLightsLightingChannels:"sampledLightsLightGroups",sampledLightsPowerDeltaLightFunctions:"sampledLightsPowerDeltaLightPatterns",sampledLightsTranslucencyVolume:"sampledLightsTranslucentLightVolume",sampledLightsTranslucencyVolumeDownsample:"sampledLightsTranslucentLightVolumeDownsample",sampledLightsTranslucencyVolumeGuideByHistory:"sampledLightsTranslucentLightVolumeGuideByHistory",sampledLightsTranslucencyVolumeMinSampleWeight:"sampledLightsTranslucentLightVolumeMinSampleWeight",sampledLightsTranslucencyVolumeSamplesPerVoxel:"sampledLightsTranslucentLightVolumeSamplesPerVoxel",sampledLightsVsmMarkPages:"sampledLightsPagedShadowMarkPages",screenProbeAdaptiveFraction:"viewProbeAdaptiveFraction",screenProbeBentNormal:"viewProbeBentNormal",screenProbeClearHistoryEveryFrame:"viewProbeClearHistoryEveryFrame",screenProbeDebugForceTracesMoving:"viewProbeDebugForceTracesMoving",screenProbeDiffuseIntegralMethod:"viewProbeDiffuseIntegralMethod",screenProbeDisocclusionFraction:"viewProbeDisocclusionFraction",screenProbeDisocclusionMaxFrames:"viewProbeDisocclusionMaxFrames",screenProbeDownsampleFactor:"viewProbeDownsampleFactor",screenProbeExtraAmbientOcclusion:"viewProbeExtraAmbientOcclusion",screenProbeExtraAmbientOcclusionExponent:"viewProbeExtraAmbientOcclusionExponent",screenProbeExtraAmbientOcclusionMaxDistance:"viewProbeExtraAmbientOcclusionMaxDistance",screenProbeFastUpdateFraction:"viewProbeFastUpdateFraction",screenProbeFilteringWaveOps:"viewProbeFilteringWaveOps",screenProbeFixedJitterIndex:"viewProbeFixedJitterIndex",screenProbeFixedStateFrameIndex:"viewProbeFixedStateFrameIndex",screenProbeFullResolutionJitterWidth:"viewProbeFullResolutionJitterWidth",screenProbeFullSkylightLeakingDistance:"viewProbeFullSkylightLeakingDistance",screenProbeGatherDebug:"viewProbeGatherDebug",screenProbeGatherDebugProbePlacement:"viewProbeGatherDebugProbePlacement",screenProbeGatherNumMips:"viewProbeGatherNumMips",screenProbeGatherScale:"viewProbeGatherScale",screenProbeGatherVisualizeTraces:"viewProbeGatherVisualizeTraces",screenProbeGatherVisualizeTracesFreeze:"viewProbeGatherVisualizeTracesFreeze",screenProbeHardwareRayTracing:"viewProbeHardwareRayTracing",screenProbeHardwareRayTracingBias:"viewProbeHardwareRayTracingBias",screenProbeHardwareRayTracingHairBias:"viewProbeHardwareRayTracingHairBias",screenProbeHardwareRayTracingNormalBias:"viewProbeHardwareRayTracingNormalBias",screenProbeHeightFogOnGI:"viewProbeHeightFogOnGI",screenProbeHistoryDepthTestThickness:"viewProbeHistoryDepthTestThickness",screenProbeHistoryDistanceThreshold:"viewProbeHistoryDistanceThreshold",screenProbeHistoryDistanceThresholdForFoliage:"viewProbeHistoryDistanceThresholdForFoliage",screenProbeImportanceIncomingLighting:"viewProbeImportanceIncomingLighting",screenProbeImportanceSampling:"viewProbeImportanceSampling",screenProbeIntegrateDownsampleFactor:"viewProbeIntegrateDownsampleFactor",screenProbeIntegrationTileClassification:"viewProbeIntegrationTileClassification",screenProbeInterpolateDownsampleFactor:"viewProbeInterpolateDownsampleFactor",screenProbeInterpolationDepthWeight:"viewProbeInterpolationDepthWeight",screenProbeInterpolationDepthWeightFallback:"viewProbeInterpolationDepthWeightFallback",screenProbeInterpolationDepthWeightForFoliage:"viewProbeInterpolationDepthWeightForFoliage",screenProbeIrradianceFormat:"viewProbeIrradianceFormat",screenProbeMarkDownsampleFactor:"viewProbeMarkDownsampleFactor",screenProbeMaterialAO:"viewProbeMaterialAO",screenProbeMaxFastUpdate:"viewProbeMaxFastUpdate",screenProbeMaxFramesAccumulated:"viewProbeMaxFramesAccumulated",screenProbeMaxIterations:"viewProbeMaxIterations",screenProbeMaxRayDirections:"viewProbeMaxRayDirections",screenProbeMaxRayIntensity:"viewProbeMaxRayIntensity",screenProbeMaxRoughnessToEvaluateRoughSpecular:"viewProbeMaxRoughnessToEvaluateRoughSpecular",screenProbeMaxRoughnessToEvaluateRoughSpecularForFoliage:"viewProbeMaxRoughnessToEvaluateRoughSpecularForFoliage",screenProbeMaxTraceDistance:"viewProbeMaxTraceDistance",screenProbeMeshDistanceFieldTrace:"viewProbeMeshFieldTrace",screenProbeMinPdfToTrace:"viewProbeMinPdfToTrace",screenProbeMinTraceDistance:"viewProbeMinTraceDistance",screenProbeNormalThreshold:"viewProbeNormalThreshold",screenProbeNumAdaptiveProbes:"viewProbeNumAdaptiveProbes",screenProbeOcclusionClampScale:"viewProbeOcclusionClampScale",screenProbeOcclusionFoliageStrength:"viewProbeOcclusionFoliageStrength",screenProbeOcclusionForegroundFraction:"viewProbeOcclusionForegroundFraction",screenProbeOcclusionForegroundPower:"viewProbeOcclusionForegroundPower",screenProbeOcclusionHorizonSearch:"viewProbeOcclusionHorizonSearch",screenProbeOcclusionIntensity:"viewProbeOcclusionIntensity",screenProbeOcclusionMaxAlbedo:"viewProbeOcclusionMaxAlbedo",screenProbeOcclusionPyramid:"viewProbeOcclusionPyramid",screenProbeOcclusionSlices:"viewProbeOcclusionSlices",screenProbeOcclusionSlopeCompareToleranceScale:"viewProbeOcclusionSlopeCompareToleranceScale",screenProbeOcclusionSteps:"viewProbeOcclusionSteps",screenProbeOcclusionTemporal:"viewProbeOcclusionTemporal",screenProbeOcclusionVisibilityBitmask:"viewProbeOcclusionVisibilityBitmask",screenProbeProbeRadianceHistory:"viewProbeRadianceHistory",screenProbeQuality:"viewProbeQuality",screenProbeRadianceCache:"viewProbeCache",screenProbeRadianceCacheDownsampleDistance:"viewProbeCacheDownsampleDistance",screenProbeRadianceCacheFilterHitAngle:"viewProbeCacheFilterHitAngle",screenProbeRadianceCacheForceFullUpdate:"viewProbeCacheForceFullUpdate",screenProbeRadianceCacheFramesToKeepProbes:"viewProbeCacheFramesToKeepProbes",screenProbeRadianceCacheHardwareRayTracing:"viewProbeCacheHardwareRayTracing",screenProbeRadianceCacheMipmaps:"viewProbeCacheMipmaps",screenProbeRadianceCacheReprojectionRadiusScale:"viewProbeCacheReprojectionRadiusScale",screenProbeRadianceCacheSkyVisibility:"viewProbeCacheSkyVisibility",screenProbeRadianceCacheSortTraceTiles:"viewProbeCacheSortTraceTiles",screenProbeRadianceCacheSpatialFilter:"viewProbeCacheSpatialFilter",screenProbeRadianceCacheStats:"viewProbeCacheStats",screenProbeRadianceCacheSupersampleDistance:"viewProbeCacheSupersampleDistance",screenProbeRadianceCacheSupersampleTileBrdfThreshold:"viewProbeCacheSupersampleTileBrdfThreshold",screenProbeRadianceCacheTemporaryAtlasDownsampleFactor:"viewProbeCacheTemporaryAtlasDownsampleFactor",screenProbeRadianceCacheTraceTiles:"viewProbeCacheTraceTiles",screenProbeRadianceCacheUpdate:"viewProbeCacheUpdate",screenProbeReferenceMode:"viewProbeExactMode",screenProbeRelativeDepthThickness:"viewProbeRelativeDepthThickness",screenProbeRelativeSpeedThreshold:"viewProbeRelativeSpeedThreshold",screenProbes:"viewProbes",screenProbeSceneTraces:"viewProbeSceneTraces",screenProbeScreenTraces:"viewProbeScreenTraces",screenProbeScreenTracesHairBias:"viewProbeScreenTracesHairBias",screenProbeScreenTracesHZBTraversal:"viewProbeScreenTracesHZBTraversal",screenProbeScreenTracesMinimumOccupancy:"viewProbeScreenTracesMinimumOccupancy",screenProbeShortRangeAOApplyDuringIntegration:"viewProbeNearOcclusionApplyDuringIntegration",screenProbeShortRangeAODownsampleFactor:"viewProbeNearOcclusionDownsampleFactor",screenProbeShortRangeAOHardwareRayTracing:"viewProbeNearOcclusionHardwareRayTracing",screenProbeShortRangeAOHardwareRayTracingNormalBias:"viewProbeNearOcclusionHardwareRayTracingNormalBias",screenProbeShortRangeGI:"viewProbeNearBounce",screenProbeShortRangeGIHistoryDepthTestRelativeThickness:"viewProbeNearBounceHistoryDepthTestRelativeThickness",screenProbeShortRangeGIMaxRayIntensity:"viewProbeNearBounceMaxRayIntensity",screenProbeShortRangeGIMaxScreenFraction:"viewProbeNearBounceMaxScreenFraction",screenProbeShortRangeOcclusion:"viewProbeNearOcclusion",screenProbeSkipFoliageHits:"viewProbeSkipFoliageHits",screenProbeSkipHairHits:"viewProbeSkipHairHits",screenProbeSkipUnlitHits:"viewProbeSkipUnlitHits",screenProbeSkylightLeakingRoughness:"viewProbeSkylightLeakingRoughness",screenProbeSpatialFilter:"viewProbeSpatialFilter",screenProbeSpatialFilterKernel:"viewProbeSpatialFilterKernel",screenProbeSpatialFilterMaxHitAngle:"viewProbeSpatialFilterMaxHitAngle",screenProbeSpatialFilterPasses:"viewProbeSpatialFilterPasses",screenProbeSpatialFilterPositionWeightScale:"viewProbeSpatialFilterPositionWeightScale",screenProbeSurfaceBias:"viewProbeSurfaceBias",screenProbeTemporal:"viewProbeTemporal",screenProbeTemporalFilterProbes:"viewProbeTemporalFilterProbes",screenProbeTemporalFilterProbesHistoryWeight:"viewProbeTemporalFilterProbesHistoryWeight",screenProbeThicknessCertaintySteps:"viewProbeThicknessCertaintySteps",screenProbeThicknessScaleWithoutField:"viewProbeThicknessScaleWithoutField",screenProbeTileDebugMode:"viewProbeTileDebugMode",screenProbeTracingResolution:"viewProbeTracingResolution",screenProbeTranslucencyReflectionsClipmapFadeSize:"viewProbeTranslucencyReflectionsClipmapFadeSize",screenProbeTranslucencyReflectionsHizOcclusionTest:"viewProbeTranslucencyReflectionsHizOcclusionTest",screenProbeTranslucencyReflectionsMarkDownsampleFactor:"viewProbeTranslucencyReflectionsMarkDownsampleFactor",screenProbeTranslucencyReflectionsRadianceCache:"viewProbeTranslucencyReflectionsProbeCache",screenProbeTwoSidedFoliageBackfaceDiffuse:"viewProbeTwoSidedFoliageBackfaceDiffuse",screenProbeUpdateSpeed:"viewProbeUpdateSpeed",shadeBinningMode:"shadeBatchMode",shadowCacheWpoPrimitives:"shadowCacheMovedVertexPrimitives",shadowCsmCaching:"shadowCascadeCaching",shadowCsmDepthBias:"shadowCascadeDepthBias",shadowCsmMaxCascades:"shadowCascadeLimit",shadowCsmReceiverBias:"shadowCascadeReceiverBias",shadowCsmScrollingOverlapAreaThrottle:"shadowCascadeScrollOverlapLimit",shadowCsmSlopeScaleDepthBias:"shadowCascadeSlopeBias",shadowCsmSplitPenumbraScale:"shadowCascadeSplitSoftness",shadowCsmTransitionScale:"shadowCascadeBlendScale",shadowDynamicResolutionPerVsmBiasHistoryWeight:"shadowDynamicResolutionPerPagedShadowBiasHistoryWeight",shadowFadeExponent:"shadowFadeCurve",shadowFadeResolution:"shadowFadeStartSize",shadowMaxCsmResolution:"shadowCascadeMaxResolution",shadowMaxPhysicalPages:"shadowMaxPoolPages",shadowMaxSlopeScaleDepthBias:"shadowSlopeBiasCap",shadowPointLightDepthBias:"shadowPointDepthOffset",shadowPointLightSlopeScaleDepthBias:"shadowPointSlopeOffset",shadowSmrtExtrapolateMaxSlopeDirectional:"shadowMarchExtrapolateMaxSlopeDirectional",shadowSmrtExtrapolateMaxSlopeLocal:"shadowMarchExtrapolateMaxSlopeLocal",shadowSmrtMaxRayAngleFromLight:"shadowMarchMaxRayAngleFromLight",shadowSmrtMaxSlopeBiasLocal:"shadowMarchMaxSlopeBiasLocal",shadowSmrtRayLengthScaleDirectional:"shadowMarchRayLengthScaleDirectional",shadowSmrtSamplesPerRayHair:"shadowMarchSamplesPerRayHair",shadowSmrtTexelDitherScaleDirectional:"shadowMarchTexelDitherScaleDirectional",shadowSmrtTexelDitherScaleLocal:"shadowMarchTexelDitherScaleLocal",shadowSpotLightDepthBias:"shadowSpotDepthOffset",shadowSpotLightReceiverBias:"shadowSpotReceiverOffset",shadowSpotLightTransitionScale:"shadowSpotBlendScale",shadowTransitionScale:"shadowBlendScale",singleLayerWater:"thinWater",singleLayerWaterCloudShadow:"thinWaterCloudShadow",singleLayerWaterDepthPrepass:"thinWaterDepthPrepass",singleLayerWaterDistanceFieldShadow:"thinWaterFieldShadow",singleLayerWaterOptimizedClear:"thinWaterOptimizedClear",singleLayerWaterReflection:"thinWaterReflection",singleLayerWaterReflectionCheckerboard:"thinWaterReflectionCheckerboard",singleLayerWaterReflectionDenoising:"thinWaterReflectionDenoising",singleLayerWaterReflectionDownsample:"thinWaterReflectionDownsample",singleLayerWaterReflectionReconstruction:"thinWaterReflectionReconstruction",singleLayerWaterReflectionTemporal:"thinWaterReflectionTemporal",singleLayerWaterRefractionCulling:"thinWaterRefractionCulling",singleLayerWaterRefractionDepthCulling:"thinWaterRefractionDepthCulling",singleLayerWaterRefractionDepthCullingFadeRange:"thinWaterRefractionDepthCullingFadeRange",singleLayerWaterRefractionDistanceCulling:"thinWaterRefractionDistanceCulling",singleLayerWaterRefractionDistanceCullingFadeRange:"thinWaterRefractionDistanceCullingFadeRange",singleLayerWaterRefractionDownsample:"thinWaterRefractionDownsample",singleLayerWaterRefractionFresnelCulling:"thinWaterRefractionFresnelCulling",singleLayerWaterRefractionFresnelCullingFadeRange:"thinWaterRefractionFresnelCullingFadeRange",singleLayerWaterShadersSupportDistanceFieldShadow:"thinWaterShadersSupportFieldShadow",singleLayerWaterShadersSupportVsmFiltering:"thinWaterShadersSupportPagedShadowFiltering",singleLayerWaterTiledComposite:"thinWaterTiledComposite",singleLayerWaterTiledSceneColorCopy:"thinWaterTiledSceneColorCopy",singleLayerWaterUnderwaterFogWhenCameraIsAboveWater:"thinWaterUnderwaterFogWhenCameraIsAboveWater",singleLayerWaterUnderwaterPreciseTraceDistance:"thinWaterUnderwaterPreciseTraceDistance",singleLayerWaterUnderwaterTest:"thinWaterUnderwaterTest",singleLayerWaterUnderwaterTraceDistance:"thinWaterUnderwaterTraceDistance",singleLayerWaterVelocityOutputPass:"thinWaterVelocityOutputPass",singleLayerWaterVsmFiltering:"thinWaterPagedShadowFiltering",singleLayerWaterWaveOps:"thinWaterWaveOps",skyLightCaptureLodDistanceScale:"skyLightCaptureDetailDistanceScale",skyLightCubemapMaxResolution:"skyLightCubemapSizeLimit",stochasticLightingFixedStateFrameIndex:"randomLightingFrozenFrame",streamingBandwidthLimit:"streamingByteRateLimit",streamingMaxPendingPages:"streamingPendingPageLimit",streamingNumRetries:"streamingRetryCount",surfaceCacheAllowCardDownsampleFromSelf:"surfaceAtlasAllowImprintDownsampleFromSelf",surfaceCacheAllowCardSharing:"surfaceAtlasAllowImprintSharing",surfaceCacheAtlasSize:"surfaceAtlasSize",surfaceCacheCaptureLodScaleFactor:"surfaceAtlasCaptureLodScaleFactor",surfaceCacheCardCaptureEnableInvalidation:"surfaceAtlasImprintCaptureEnableInvalidation",surfaceCacheCardCaptureFactor:"surfaceAtlasImprintCaptureFactor",surfaceCacheCardCaptureMargin:"surfaceAtlasImprintCaptureMargin",surfaceCacheCardCaptureRefreshFraction:"surfaceAtlasImprintCaptureRefreshFraction",surfaceCacheCardCapturesPerFrame:"surfaceAtlasImprintCapturesPerFrame",surfaceCacheCardFixedDebugResolution:"surfaceAtlasImprintFixedDebugResolution",surfaceCacheCardMaxResolution:"surfaceAtlasImprintMaxResolution",surfaceCacheCardMaxTexelDensity:"surfaceAtlasImprintMaxTexelDensity",surfaceCacheCardMinResolution:"surfaceAtlasImprintMinResolution",surfaceCacheCardTexelDensityScale:"surfaceAtlasImprintTexelDensityScale",surfaceCacheCompress:"surfaceAtlasCompress",surfaceCacheCursorCard:"surfaceAtlasCursorImprint",surfaceCacheCursorCardLayer:"surfaceAtlasCursorImprintLayer",surfaceCacheDiffuseColorBoost:"surfaceAtlasDiffuseColorBoost",surfaceCacheDilationMode:"surfaceAtlasDilationMode",surfaceCacheDirectLighting:"surfaceAtlasDirectLighting",surfaceCacheDirectLightingBatchShadows:"surfaceAtlasDirectLightingBatchShadows",surfaceCacheDirectLightingCloudTransmittance:"surfaceAtlasDirectLightingCloudTransmittance",surfaceCacheDirectLightingCullToTileDepthRange:"surfaceAtlasDirectLightingCullToTileDepthRange",surfaceCacheDirectLightingGlobalSdfShadowRayBias:"surfaceAtlasDirectLightingGlobalSdfShadowRayBias",surfaceCacheDirectLightingHardwareRayTracing:"surfaceAtlasDirectLightingHardwareRayTracing",surfaceCacheDirectLightingHardwareRayTracingAdaptiveShadowTracing:"surfaceAtlasDirectLightingHardwareRayTracingAdaptiveShadowTracing",surfaceCacheDirectLightingHardwareRayTracingEndBias:"surfaceAtlasDirectLightingHardwareRayTracingEndBias",surfaceCacheDirectLightingHardwareRayTracingForceTwoSided:"surfaceAtlasDirectLightingHardwareRayTracingForceTwoSided",surfaceCacheDirectLightingHardwareRayTracingShadowRayBias:"surfaceAtlasDirectLightingHardwareRayTracingShadowRayBias",surfaceCacheDirectLightingMaxLightsPerTile:"surfaceAtlasDirectLightingMaxLightsPerTile",surfaceCacheDirectLightingMeshSdfShadowRayBias:"surfaceAtlasDirectLightingMeshSdfShadowRayBias",surfaceCacheDirectLightingOffscreenShadowingTraceMeshSdfs:"surfaceAtlasDirectLightingOffscreenShadowingTraceMeshSdfs",surfaceCacheDirectLightingStochastic:"surfaceAtlasDirectLightingStochastic",surfaceCacheDirectLightingStochasticMinWeight:"surfaceAtlasDirectLightingStochasticMinWeight",surfaceCacheDirectLightingStochasticSamplePerTexel:"surfaceAtlasDirectLightingStochasticSamplePerTexel",surfaceCacheDirectLightingStochasticTemporal:"surfaceAtlasDirectLightingStochasticTemporal",surfaceCacheDirectLightingStochasticTemporalMaxFramesAccumulated:"surfaceAtlasDirectLightingStochasticTemporalMaxFramesAccumulated",surfaceCacheDirectLightingStochasticTemporalNeighborhoodClampScale:"surfaceAtlasDirectLightingStochasticTemporalNeighborhoodClampScale",surfaceCacheDirectLightingUpdateFactor:"surfaceAtlasDirectLightingUpdateFactor",surfaceCacheFastCameraMode:"surfaceAtlasFastCameraMode",surfaceCacheFeedback:"surfaceAtlasFeedback",surfaceCacheFeedbackHiResLevelBias:"surfaceAtlasFeedbackHiResLevelBias",surfaceCacheFeedbackMinPageHits:"surfaceAtlasFeedbackMinPageHits",surfaceCacheFeedbackResLevelBias:"surfaceAtlasFeedbackResLevelBias",surfaceCacheFeedbackTileSize:"surfaceAtlasFeedbackTileSize",surfaceCacheFeedbackUniqueElements:"surfaceAtlasFeedbackUniqueElements",surfaceCacheForceEvictHiResPages:"surfaceAtlasForceEvictHiResPages",surfaceCacheFreeze:"surfaceAtlasFreeze",surfaceCacheFreezeUpdateFrame:"surfaceAtlasFreezeUpdateFrame",surfaceCacheGpuDrivenUpdate:"surfaceAtlasGpuDrivenUpdate",surfaceCacheHardwareRayTracingAvoidSelfIntersections:"surfaceAtlasHardwareRayTracingAvoidSelfIntersections",surfaceCacheHardwareRayTracingMaxIterations:"surfaceAtlasHardwareRayTracingMaxIterations",surfaceCacheHardwareRayTracingMeshSectionVisibilityTest:"surfaceAtlasHardwareRayTracingMeshSectionVisibilityTest",surfaceCacheHardwareRayTracingMinTraceDistanceToSampleSurfaceCache:"surfaceAtlasHardwareRayTracingMinTraceDistanceToSampleSurfaceAtlas",surfaceCacheHardwareRayTracingSkipBackFaceHitDistance:"surfaceAtlasHardwareRayTracingSkipBackFaceHitDistance",surfaceCacheHardwareRayTracingSkipTwoSidedHitDistance:"surfaceAtlasHardwareRayTracingSkipTwoSidedHitDistance",surfaceCacheHardwareRayTracingSurfaceCacheSamplingDepthBias:"surfaceAtlasHardwareRayTracingSurfaceAtlasSamplingDepthBias",surfaceCacheLightingFeedback:"surfaceAtlasLightingFeedback",surfaceCacheLightingForceFullUpdate:"surfaceAtlasLightingForceFullUpdate",surfaceCacheLightingMaxDistanceFromFrustumToPrioritize:"surfaceAtlasLightingMaxDistanceFromFrustumToPrioritize",surfaceCacheLightingQuality:"surfaceAtlasLightingQuality",surfaceCacheLightingStats:"surfaceAtlasLightingStats",surfaceCacheLightingUpdateSpeed:"surfaceAtlasLightingUpdateSpeed",surfaceCacheMeshCardsCullFaces:"surfaceAtlasMeshImprintsCullFaces",surfaceCacheMeshCardsMinSize:"surfaceAtlasMeshImprintsMinSize",surfaceCacheNumFramesToKeepUnusedPages:"surfaceAtlasNumFramesToKeepUnusedPages",surfaceCacheOrthographicCardMinResolution:"surfaceAtlasOrthographicImprintMinResolution",surfaceCachePropagateGlobalLightingChange:"surfaceAtlasPropagateGlobalLightingChange",surfaceCacheRadiosity:"surfaceAtlasRadiosity",surfaceCacheRadiosityDistanceFieldSurfaceBias:"surfaceAtlasRadiosityDistanceFieldSurfaceBias",surfaceCacheRadiosityDistanceFieldSurfaceSlopeBias:"surfaceAtlasRadiosityDistanceFieldSurfaceSlopeBias",surfaceCacheRadiosityHardwareRayTracing:"surfaceAtlasRadiosityHardwareRayTracing",surfaceCacheRadiosityHardwareRayTracingBias:"surfaceAtlasRadiosityHardwareRayTracingBias",surfaceCacheRadiosityHardwareRayTracingNormalBias:"surfaceAtlasRadiosityHardwareRayTracingNormalBias",surfaceCacheRadiosityHemisphereProbeResolution:"surfaceAtlasRadiosityHemisphereProbeResolution",surfaceCacheRadiosityMaxRayIntensity:"surfaceAtlasRadiosityMaxRayIntensity",surfaceCacheRadiosityProbeOcclusion:"surfaceAtlasRadiosityProbeOcclusion",surfaceCacheRadiosityProbeOcclusionStrength:"surfaceAtlasRadiosityProbeOcclusionStrength",surfaceCacheRadiosityProbePlaneWeighting:"surfaceAtlasRadiosityProbePlaneWeighting",surfaceCacheRadiosityProbePlaneWeightingDepthScale:"surfaceAtlasRadiosityProbePlaneWeightingDepthScale",surfaceCacheRadiosityProbeSpacing:"surfaceAtlasRadiosityProbeSpacing",surfaceCacheRadiositySpatialFilterProbes:"surfaceAtlasRadiositySpatialFilterProbes",surfaceCacheRadiositySpatialFilterProbesKernelSize:"surfaceAtlasRadiositySpatialFilterProbesKernelSize",surfaceCacheRadiosityTemporal:"surfaceAtlasRadiosityTemporal",surfaceCacheRadiosityTemporalFixedJitterIndex:"surfaceAtlasRadiosityTemporalFixedJitterIndex",surfaceCacheRadiosityTemporalMaxFramesAccumulated:"surfaceAtlasRadiosityTemporalMaxFramesAccumulated",surfaceCacheRadiosityUpdateFactor:"surfaceAtlasRadiosityUpdateFactor",surfaceCacheRadiosityVisualizeProbeRadius:"surfaceAtlasRadiosityVisualizeProbeRadius",surfaceCacheRadiosityVisualizeProbes:"surfaceAtlasRadiosityVisualizeProbes",surfaceCacheRadiosityVisualizeProbesShowInvalid:"surfaceAtlasRadiosityVisualizeProbesShowInvalid",surfaceCacheRecaptureEveryFrame:"surfaceAtlasRecaptureEveryFrame",surfaceCacheRemovesPerFrame:"surfaceAtlasRemovesPerFrame",surfaceCacheResampleLighting:"surfaceAtlasResampleLighting",surfaceCacheReset:"surfaceAtlasReset",surfaceCacheResetEveryNthFrame:"surfaceAtlasResetEveryNthFrame",surfaceCacheResolution:"surfaceAtlasResolution",surfaceCacheSceneDetail:"surfaceAtlasSceneDetail",surfaceCacheSceneStats:"surfaceAtlasSceneStats",surfaceCacheUpdateViewOrigin:"surfaceAtlasUpdateViewOrigin",surfaceCacheViewCards:"surfaceAtlasViewImprints",surfaceCacheViewOriginDistanceThreshold:"surfaceAtlasViewOriginDistanceThreshold",surfaceCacheViewTiles:"surfaceAtlasViewTiles",surfaceCacheVisualizePrimitiveGroups:"surfaceAtlasVisualizePrimitiveGroups",targetFps:"motionBlurTargetFrameRate",toonProfileResolution:"toonRampSize",toonUnifiedDiffuse:"toonSingleDiffuse",translucencyGi:"translucentBounce",translucencyGiEndDistance:"translucentBounceEndDistance",translucencyGiGridCenterOffsetFromDepthBuffer:"translucentBounceGridCenterOffsetFromDepthBuffer",translucencyGiGridDistributionLogZOffset:"translucentBounceGridDistributionLogZOffset",translucencyGiGridDistributionLogZScale:"translucentBounceGridDistributionLogZScale",translucencyGiGridDistributionZScale:"translucentBounceGridDistributionZScale",translucencyGiGridPixelSize:"translucentBounceGridPixelSize",translucencyGiHardwareRayTracing:"translucentBounceHardwareRayTracing",translucencyGiLightingDataFormat:"translucentBounceLightingDataFormat",translucencyGiMaxRayIntensity:"translucentBounceMaxRayIntensity",translucencyGiOffsetThresholdToAcceptDepthBufferOffset:"translucentBounceOffsetThresholdToAcceptDepthBufferOffset",translucencyGiRadianceCache:"translucentBounceProbeCache",translucencyGiRadianceCacheClipmapBias:"translucentBounceProbeCacheClipmapBias",translucencyGiRadianceCacheClipmapDistributionBase:"translucentBounceProbeCacheClipmapDistributionBase",translucencyGiRadianceCacheClipmapWorldExtent:"translucentBounceProbeCacheClipmapWorldExtent",translucencyGiRadianceCacheGridResolution:"translucentBounceProbeCacheGridResolution",translucencyGiRadianceCacheNumMipmaps:"translucentBounceProbeCacheNumMipmaps",translucencyGiRadianceCacheNumProbesToTraceBudget:"translucentBounceProbeCacheNumProbesToTraceBudget",translucencyGiRadianceCacheProbeAtlasResolutionInProbes:"translucentBounceProbeCacheProbeAtlasResolutionInProbes",translucencyGiRadianceCacheProbeResolution:"translucentBounceProbeCacheProbeResolution",translucencyGiRadianceCacheReprojectionRadiusScale:"translucentBounceProbeCacheReprojectionRadiusScale",translucencyGiShareRadianceCacheWithOpaque:"translucentBounceShareProbeCacheWithOpaque",translucencyGiSpatialFilter:"translucentBounceSpatialFilter",translucencyGiSpatialFilterSampleCount:"translucentBounceSpatialFilterSampleCount",translucencyGiSpatialFilterStandardDeviation:"translucentBounceSpatialFilterStandardDeviation",translucencyGiTemporalHistoryWeight:"translucentBounceTemporalHistoryWeight",translucencyGiTemporalJitter:"translucentBounceTemporalJitter",translucencyGiTemporalMaxRayDirections:"translucentBounceTemporalMaxRayDirections",translucencyGiTemporalReprojection:"translucentBounceTemporalReprojection",translucencyGiTraceFromVolume:"translucentBounceTraceFromVolume",translucencyGiTracingResolution:"translucentBounceTracingResolution",translucencyHoldoutLocation:"translucentHoldoutStage",translucencyRefraction:"translucentRefractionTrace",translucencyScreenPercentageBasis:"translucencyResolutionBasis",translucencyVolume:"translucentLightVolume",translucencyVolumeAdaptToPerspective:"translucentLightVolumeAdaptToPerspective",translucencyVolumeBlur:"translucentLightVolumeBlur",translucencyVolumeDebug:"translucentLightVolumeDebug",translucencyVolumeDebugFreezePosition:"translucentLightVolumeDebugFreezePosition",translucencyVolumeDim:"translucentLightVolumeDim",translucencyVolumeFovSnap:"translucentLightVolumeFovSnap",translucencyVolumeHistoryWeight:"translucentLightVolumeHistoryWeight",translucencyVolumeInnerDistance:"translucentLightVolumeInnerDistance",translucencyVolumeMarkVoxels:"translucentLightVolumeMarkVoxels",translucencyVolumeMinFov:"translucentLightVolumeMinFov",translucencyVolumeOuterDistance:"translucentLightVolumeOuterDistance",translucencyVolumePositionOffsetRadius:"translucentLightVolumePositionOffsetRadius",translucencyVolumeTemporal:"translucentLightVolumeTemporal",translucencyVolumeVisualize:"translucentLightVolumeVisualize",translucencyVolumeVisualizeCascadeIndex:"translucentLightVolumeVisualizeCascadeIndex",translucencyVolumeVisualizeRadiusScale:"translucentLightVolumeVisualizeRadiusScale",visualizeCullingMode:"showCullingMode",visualizeHiResSurface:"showFineSurface",visualizeLightShapeFadeDuration:"lightShapeViewFadeTime",visualizeLightShapeMaxDelay:"lightShapeViewMaxWait",visualizeLightShapeMaxDelayDistance:"lightShapeViewMaxWaitDistance",visualizeLightShapeMaxOpacity:"lightShapeViewMaxOpacity",visualizeMaxTraceDistance:"showTraceDistanceMax",visualizeMinTraceDistance:"showTraceDistanceMin",visualizeSceneTraceRadianceCache:"visualizeSceneTraceProbeCache",visualizeSurfaceCacheFeedback:"visualizeSurfaceAtlasFeedback",visualizeToneMap:"showToneMapped",visualizeUseShaderPrintForTraces:"showTracesInText",volumetricFogInjectRaytracedLights:"volumetricFogTracedLightInjection",volumetricFogRectLightTexture:"volumetricFogAreaLightTexture",volumetricLightmap:"bakedLightVolume",volumetricLightmapBrickMemory:"bakedLightVolumeBrickMemory",volumetricLightmapLoadingRange:"bakedLightVolumeLoadingRange",volumetricLightmapVisualize:"bakedLightVolumeVisualize",volumetricLightmapVisualizeMinScreenFraction:"bakedLightVolumeVisualizeMinScreenFraction",volumetricLightmapVisualizeRadiusScale:"bakedLightVolumeVisualizeRadiusScale",contactShadowBendSurfaceThickness:"contactShadowSurfaceThickness",contactShadowBendMaxLights:"contactShadowMaxLights",translucencyLighting:"litFrom",lightingChannels:"lightGroups",lightFunction:"lightPattern",lightFunctionScale:"lightPatternScale",lightFunctionFadeDistance:"lightPatternFadeDistance",lightFunctionDisabledBrightness:"lightPatternDisabledBrightness",lightFunctionConeAngle:"lightPatternConeAngle",distanceFieldShadows:"fieldShadowCascade",distanceFieldShadowDistance:"fieldShadowDistance",distanceFieldShadowTraceDistance:"fieldShadowTraceDistance",distanceFieldShadowRayStartOffsetDepthScale:"fieldShadowRayStartOffsetDepthScale",renderCustomDepth:"renderMarkedDepth",customDepthStencilValue:"markedDepthStencilValue",customDepthStencilWriteMask:"markedDepthStencilWriteMask",inReflectionCaptures:"inCubeCaptures"},family:{customDepth:"markedDepth",distanceFieldOcclusion:"fieldSkyOcclusion",globalDistanceField:"worldField",heterogeneousVolumeRendering:"densityVolumeRendering",lightFunction:"lightPattern",meshDistanceFieldTrace:"meshFieldTrace",reflectionCapture:"cubeCapture",singleLayerWater:"thinWater",surfaceCache:"surfaceAtlas",translucencyGi:"translucentBounce",translucencyVolume:"translucentLightVolume",volumetricLightmap:"bakedLightVolume"},module:{lightFunctions:"lightPatterns",pawn:"avatar",reflectionCaptures:"cubeCaptures",translucencyVolume:"translucentLightVolume",worldPartition:"worldGrid"},diagnosticMode:{"heterogeneous-volumes-dda-marching":"density-volumes-dda-marching","heterogeneous-volumes-delta-tracking":"density-volumes-delta-tracking","heterogeneous-volumes-ratio-tracking":"density-volumes-ratio-tracking","heterogeneous-volumes-sample-majorant":"density-volumes-sample-majorant","heterogeneous-volumes-sample-majorant-dda":"density-volumes-sample-majorant-dda","heterogeneous-volumes-sample-marching":"density-volumes-sample-marching","heterogeneous-volumes-sample-max-majorant":"density-volumes-sample-max-majorant","heterogeneous-volumes-spectral-ratio-tracking":"density-volumes-spectral-ratio-tracking","heterogeneous-volumes-tracking-majorant-dda":"density-volumes-tracking-majorant-dda","radiance-cache-probes":"probe-cache-probes","radiance-cache-stats":"probe-cache-stats","sampled-lights-complexity-translucency-volume":"sampled-lights-complexity-translucent-light-volume","screen-probe-gather-debug":"view-probe-gather-debug","screen-probe-history-frames":"view-probe-history-frames","screen-probe-placement":"view-probe-placement","screen-probe-tile-stats":"view-probe-tile-stats","screen-probe-traces":"view-probe-traces","surface-cache-age":"surface-atlas-age","surface-cache-albedo":"surface-atlas-albedo","surface-cache-cards":"surface-atlas-imprints","surface-cache-depth":"surface-atlas-depth","surface-cache-direct-lighting-stats":"surface-atlas-direct-lighting-stats","surface-cache-direct-stats":"surface-atlas-direct-stats","surface-cache-fill":"surface-atlas-fill","surface-cache-indirect-stats":"surface-atlas-indirect-stats","surface-cache-normal":"surface-atlas-normal","surface-cache-primitive-groups":"surface-atlas-primitive-groups","surface-cache-scene-stats":"surface-atlas-scene-stats","virtual-shadow-map-cached-page":"paged-shadow-map-cached-page","virtual-shadow-map-clipmap-or-mip":"paged-shadow-map-clipmap-or-mip","virtual-shadow-map-clipmap-virtual-space":"paged-shadow-map-clipmap-virtual-space","virtual-shadow-map-dirty-page":"paged-shadow-map-dirty-page","virtual-shadow-map-general-debug":"paged-shadow-map-general-debug","virtual-shadow-map-gpu-invalidated-page":"paged-shadow-map-gpu-invalidated-page","virtual-shadow-map-merged-page":"paged-shadow-map-merged-page","virtual-shadow-map-overdraw":"paged-shadow-map-overdraw","virtual-shadow-map-ray-count":"paged-shadow-map-ray-count","virtual-shadow-map-shadow-casters":"paged-shadow-map-shadow-casters","virtual-shadow-map-shadow-factor":"paged-shadow-map-shadow-factor","virtual-shadow-map-virtual-page":"paged-shadow-map-virtual-page"},materialDomain:{lightFunction:"lightPattern"},sceneTexture:{customDepth:"markedDepth"},collisionProfile:{Pawn:"avatar",IgnoreOnlyPawn:"walkThrough",OverlapOnlyPawn:"avatarZone",NoCollision:"ghost",BlockAll:"solid",OverlapAll:"zone",BlockAllDynamic:"movingSolid",OverlapAllDynamic:"movingZone",IgnoreOnlyAvatar:"walkThrough",OverlapOnlyAvatar:"avatarZone",Avatar:"avatar",Spectator:"observer",CharacterMesh:"avatarSkin",PhysicsActor:"prop",Destructible:"breakable",InvisibleWall:"clearWall",InvisibleWallDynamic:"movingClearWall",Trigger:"trigger",Ragdoll:"ragdoll",Vehicle:"vehicle",UI:"interface"},collisionChannel:Iie({pawn:"avatar",worldStatic:"scenery",worldDynamic:"mover",visibility:"sight",physicsBody:"prop",destructible:"breakable"},[["engineTrace","reserved",6],["gameTrace","custom",50]]),collisionEnabled:{noCollision:"off",queryOnly:"queries",physicsOnly:"simulation",queryAndPhysics:"both"},collisionResponse:{overlap:"sense",block:"stop"},collisionField:{objectType:"channel"},queryField:{channel:"collision",objectTypes:"channels"},overlapMode:{blocking:"stopping"}},s2={meshCards:"meshImprints",volumetricLightmap:"bakedLightVolume"},yGe=e=>Object.keys(s2).find(t=>s2[t]===e),a2={litFrom:{forward:"lights",volume:"volumeSurface",volumetric:"volumeMedium",volumetricNonDirectional:"volumeAmbient"},shadingModel:{singleLayerWater:"thinWater"},finalGatherAlgorithm:{screenProbes:"viewProbes",irradianceField:"diffuseGrid"},hardwareTraceShadingMode:{surfaceCache:"surfaceAtlas",hitLighting:"hitShading",hitLightingForReflections:"hitShadingForReflections"},probeCacheIrradianceProbeOffsetMode:{globalDistanceField:"worldField"},sampledLightsShadowMethod:{virtualShadowMap:"pagedShadowMap"},pathTracingDebugView:{LightingChannelMask:"LightGroupMask"}},kie=new Map,Fie=new Map;function Kd(e,t,r,n=!1){let o=n?Fie:kie,i=o.get(e);i||o.set(e,i=new Set),!i.has(t)&&(i.add(t),console.warn(n?`[trillion3d] "${t}" is now "${r}", given too: "${r}" holds and "${t}" is left out`:`[trillion3d] "${t}" is now "${r}": read as "${r}"`))}function l2(e,t,r){return typeof r!="string"||!Object.hasOwn(e,r)?r:(Kd(t,r,e[r]),e[r])}function dt(e,t){return l2(qd[e],e,t)}function Hg(e,t){return Object.hasOwn(a2,e)?l2(a2[e],e,t):t}function mc(e,t=r=>Reflect.has(e,r)){for(let[r,n]of Object.entries(qd.key))!t(n)||r in e||Object.defineProperty(e,r,{configurable:!0,get(){return Kd("key",r,n),this[n]},set(o){Kd("key",r,n),this[n]=Hg(n,o)}})}var OA=(e,t="key")=>{let r=qd[t];return Object.hasOwn(r,e)?r[e]:e};function Gt(e,t="key"){let r,n=e;for(let o in n){if(!Object.hasOwn(n,o))continue;let i=OA(o,t);if(i!==o&&Object.hasOwn(n,i)){r??={...n},delete r[o],Kd(t,o,i,!0);continue}let s=n[o],a=Hg(i,s);i===o&&a===s||(r??={...n},i!==o&&(delete r[o],Kd(t,o,i)),r[i]=a)}return r??e}var oo=["viewDistance","edgeSmoothing","imageEffects","shadows","textures","effects","indirectLight","foliage"],gc=["editor","page","quality","scene"];function Nie(e,t,r,n){if(t.editorOnly&&n!=="editor")throw new Error(`RENDER_SETTING_EDITOR_ONLY: ${e} is the editor's`);if(!et({...t,field:e},r))throw new Error(`RENDER_SETTING_VALUE: ${e} does not take ${String(r)}`)}function Bie(e){let t={scene:new Map,quality:new Map,page:new Map,editor:new Map},r=o=>{let i=e[o];if(!i)throw new Error(`RENDER_SETTING_UNKNOWN: ${o}`);return i};return{layers:t,entryOf:r,resolve:o=>{for(let i of gc){let s=t[i].get(o);if(s!==void 0)return s}return r(o).default}}}function Uie(e){let t=new Map;return{hooks:t,write:(n,o)=>{let i=e(n);o();let s=e(n);if(s!==i)for(let a of t.get(n)??[])a(s)}}}function c2(e){let{layers:t,entryOf:r,resolve:n}=Bie(e),{hooks:o,write:i}=Uie(n);return{table:e,get:s=>n(s),source(s){return r(s),gc.find(a=>t[a].has(s))??"default"},holds(s,a){return r(s),t[a].has(s)},set(s,a,l){Nie(s,r(s),a,l),i(s,()=>t[l].set(s,a))},clear(s,a){r(s),i(s,()=>t[a].delete(s))},watch(s,a){r(s);let l=o.get(s)??new Set;return o.set(s,l.add(a)),()=>void l.delete(a)}}}function G(e){let{name:t,summary:r,parts:n,requires:o,data:i=[],switches:s={},views:a=[]}=e;if(typeof r!="string"||!r.trim())throw new TypeError(`Module ${t} has no summary: one sentence saying what it is`);if(new Set(n).size!==n.length)throw new TypeError(`Module ${t} declares a part name twice: ${n.join(", ")}`);if(o.includes(t))throw new TypeError(`Module ${t} requires itself`);for(let l of i)if(!n.includes(l.split(".")[0])||!l.includes("."))throw new TypeError(`Module ${t} declares data in no field of its parts: ${l}`);return Object.freeze({...e,requires:Object.freeze([...o]),parts:Object.freeze([...n]),data:Object.freeze([...i]),switches:Object.freeze({...s}),views:Object.freeze([...a])})}function LA(e,t,r){return new E("INVALID_MODULE_OPTION",`Module ${e}: ${t} ${JSON.stringify(r)??String(r)}; a module takes true, false, or an object of its parts, each true, false or an object of that part's fields`,{module:e,value:r})}function Xd(e,t){if(t!=null){if(typeof t=="boolean")return t?{parts:{}}:!1;if(!Pe(t))throw LA(e.name,"unexpected option",t);for(let[r,n]of Object.entries(t)){if(!e.parts.includes(r))throw LA(e.name,`unknown part "${r}" in`,t);if(typeof n!="boolean"&&!Pe(n))throw LA(e.name,`part "${r}" takes neither a boolean nor an object, got`,n)}return{parts:Vie(t)}}}function Vie(e){if(!Pe(e))return e;let t=e;for(let[r,n]of Object.entries(t)){if(!Pe(n))continue;let o=Gt(n);o!==n&&(t={...t,[r]:o})}return t}function Qd(e,t){let r={};for(let n of e.parts){let o={},i=!1,s=!1;for(let{parts:a}of t){if(!Object.hasOwn(a,n))continue;let l=a[n];if(l===!1?s||=!i:(i=!0,l!==!0&&(o={...l,...o})),s)break}r[n]=s?!1:o}return r}function u2(e,t,r){let[n,...o]=t;if(!Pe(e)||!Object.hasOwn(e,n))return e;let i=e[n];return{...e,[n]:o.length?u2(i,o,r):r(i)}}function Gie(e,t,r){let n=t;for(let o of e.data??[])n=u2(n,o.split("."),r);return n}var h2=e=>new E("MODULE_MISSING",`Module ${e.at(-1)} is not registered: ${e.join(" \u2192 ")}`,{chain:e}),m2=(e,t)=>gc.find(r=>e[r].has(t));function d2(e,t,r){let n=new Map,o=[];for(let{name:i,enabledByDefault:s}of e){let a=m2(r,i);(a?r[a].get(i)!==!1:s)&&(n.set(i,a??"default"),o.push({name:i,chain:[i]}))}for(let{name:i,chain:s}of o)for(let a of t.get(i).requires){let l=[...s,a];if(!t.has(a))throw h2(l);n.has(a)||(n.set(a,{requiredBy:i}),o.push({name:a,chain:l}))}return n}function Hie(e,t,r){let n=[],o=new Set,i=s=>{if(!o.has(s)){o.add(s);for(let a of t.get(s).requires)i(a);n.push(s)}};for(let{name:s}of e)r.has(s)&&i(s);return n}var f2=new WeakMap,Wie=0;function zie(e){let t=f2.get(e);return t===void 0&&f2.set(e,t=++Wie),`data ${t}`}function jie(e,t){let r=e.data??[],n=new Map;return JSON.stringify(t,function(o,i){if(!i||typeof i!="object")return i;let s=n.get(this),a=s?`${s}.${o}`:o;if(r.includes(a))return zie(i);if(no(i))return`texture ${i.id}`;let l=Array.isArray(i)?i:Object.fromEntries(Object.entries(i).sort(([c],[u])=>c<u?-1:c>u?1:0));return n.set(l,a),l})}function p2(e,t,r){for(let n of[...r].reverse()){let o=e.get(n);e.delete(n),t[n].stop(o.instance)}}function $ie(e,t,r,n,o,i){let s=e.get(r);if(!s)return e.set(r,{instance:t.start(n,o),parts:i}),!0;if(s.parts===i)return!1;if(t.update)t.update(s.instance,o);else try{t.stop(s.instance),s.instance=t.start(n,o)}catch(a){throw e.delete(r),a}return s.parts=i,!0}function RA(e,t){let r=new Map(e.map(d=>[d.name,d])),n=Object.fromEntries(gc.map(d=>[d,new Map])),o=new Map,i=new Set,s=!1,a=d=>r.get(d)??h2([d]),l=d=>Qd(a(d),gc.flatMap(f=>n[f].get(d)||[])),c=d=>dt("module",d),u={set(d,f,h){let m=c(f),w=Xd(a(m),h);w===void 0?n[d].delete(m):n[d].set(m,w),i.add(m)},clear:(d,f)=>u.set(d,f,null),word:(d,f)=>n[d].get(c(f)),runs:d=>o.has(c(d)),state(d){let f=c(d);a(f);let h=s?void 0:d2(e,r,n).get(f),m=m2(n,f)??"default";return{enabled:h!==void 0,by:h??m,parts:l(f)}},apply(d){if(s)return[];let f=d2(e,r,n),h=[...o.keys()].filter(m=>!f.has(m));p2(o,t,h);for(let m of Hie(e,r,f)){if(o.has(m)&&!i.has(m))continue;let w=l(m),x=jie(a(m),w);$ie(o,t[m],m,d,w,x)&&h.push(m),i.delete(m)}return h},dispose(){s=!0,p2(o,t,[...o.keys()])}};return u}var wi=1;function Wg(e,t,r){if(e.parent[t]=r,e.nextSibling[t]=-1,jg(e,t),r<0)return void(e.previousSibling[t]=-1);vA(e,t,r,!1)}function zg(e,t){let r=e.parent[t];r<0||(_A(e,t,r,(e.flags[t]&64)!==0),e.flags[t]&=-65,e.parent[t]=-1)}function _A(e,t,r,n){let[o,i]=n?[e.firstLazy,e.lastLazy]:[e.firstChild,e.lastChild],s=e.previousSibling[t],a=e.nextSibling[t];s<0?o[r]=a:e.nextSibling[s]=a,a<0?i[r]=s:e.previousSibling[a]=s}function vA(e,t,r,n){let[o,i]=n?[e.firstLazy,e.lastLazy]:[e.firstChild,e.lastChild],s=i[r];e.previousSibling[t]=s,e.nextSibling[t]=-1,s<0?o[r]=t:e.nextSibling[s]=t,i[r]=t}function yi(e,t,r){let n=e.firstChild[t];if(n>=0)return n;for(;t!==r;){let o=e.nextSibling[t];if(o>=0)return o;t=e.parent[t]}return-1}function jg(e,t){let{depth:r,parent:n}=e;r[t]=n[t]<0?0:r[n[t]]+1;for(let o=yi(e,t,t);o>=0;o=yi(e,o,t))r[o]=r[n[o]]+1}var Lr=(e,t)=>Math.max(t,e*2);function tt(e,t,r=0){if(e.length>=t)return e;let n=new e.constructor(Lr(e.length,t));return n.set(e),r!==0&&n.fill(r,e.length),n}var Xt=(e,t,r)=>tt(e??new t(0),r);function g2(e,t,r){let n=new Float64Array((r-t)*16);for(let o=t;o<r;o++)e.push(n.subarray((o-t)*16,(o-t)*16+16))}function MA(e,t){let{position:r,quaternion:n,scale:o}=e,i=e.capacity;e.capacity=t,e.parent=Xt(e.parent,Int32Array,t),e.flags=Xt(e.flags,Uint8Array,t),e.position=Xt(e.position,Float64Array,t*3),e.quaternion=Xt(e.quaternion,Float64Array,t*4),e.scale=Xt(e.scale,Float64Array,t*3),g2(e.localViews,i,t),g2(e.worldViews,i,t),e.version=Xt(e.version,Uint32Array,t),e.seen=Xt(e.seen,Uint32Array,t),e.free=Xt(e.free,Int32Array,t),e.firstChild=Xt(e.firstChild,Int32Array,t),e.lastChild=Xt(e.lastChild,Int32Array,t),e.firstLazy=Xt(e.firstLazy,Int32Array,t),e.lastLazy=Xt(e.lastLazy,Int32Array,t),e.nextSibling=Xt(e.nextSibling,Int32Array,t),e.previousSibling=Xt(e.previousSibling,Int32Array,t),e.depth=Xt(e.depth,Int32Array,t),e.listed=Xt(e.listed,Int32Array,t),e.order=new Int32Array(t),e.chain=new Int32Array(t),e.stamp=Xt(e.stamp,Uint32Array,t),r&&e.grew?.(r,n,o)}function PA(e=64){let t={capacity:0,end:0,freeCount:0,listedCount:0,call:0};return t.localViews=[],t.worldViews=[],t.buckets=new Int32Array(16),MA(t,Math.max(1,e)),t}function Sa(e,t){if(!(t>=0&&t<e.end&&e.flags[t]&16))throw new E("UNKNOWN_TRANSFORM_NODE",`node ${t} absent from the hierarchy`,{node:t})}function Ur(e,t,r=0){let n=e.flags[t];if(n&32)return void(e.flags[t]=n|r);e.flags[t]=n|r|32,e.listed[e.listedCount++]=t}function $g(e,t=-1){t!==-1&&Sa(e,t);let r;return e.freeCount?r=e.free[--e.freeCount]:(e.end===e.capacity&&MA(e,Lr(e.capacity,e.end+1)),r=e.end++),e.parent[r]=-1,e.firstChild[r]=e.lastChild[r]=e.firstLazy[r]=e.lastLazy[r]=-1,Wg(e,r,t),e.flags[r]&=32,Ur(e,r,21),Sc(e,r,0,0,0),ms(e,r,0,0,0,1),wc(e,r,1,1,1),e.localViews[r].set(Or),e.worldViews[r].set(Or),e.version[r]=0,e.seen[r]=0,r}function Sc(e,t,r,n,o){let i=e.position,s=t*3;i[s]=r,i[s+1]=n,i[s+2]=o,Ur(e,t,2)}function ms(e,t,r,n,o,i){let s=e.quaternion,a=t*4;s[a]=r,s[a+1]=n,s[a+2]=o,s[a+3]=i,Ur(e,t,2)}function wc(e,t,r,n,o){let i=e.scale,s=t*3;i[s]=r,i[s+1]=n,i[s+2]=o,Ur(e,t,2)}function S2(e,t,r){Ce(e.localViews[t],r),Ur(e,t,6)}function w2(e,t,r){Ur(e,t),r?e.flags[t]|=1:e.flags[t]&=-2}function Yg(e){return e.call=e.call+1&2147483647,e.call===0&&(e.stamp.fill(0),e.call=1),e.call}function CA(e,t,r){let n=0;for(let o=t;o>=0;o=yi(e,o,t),n++)r(e,o);return n}function x2(e,t,r){Sa(e,t);let n=e.parent[t],o=(e.flags[t]&64)!==0;return o===r?!0:n<0||r&&(e.firstChild[t]>=0||e.firstLazy[t]>=0)?!1:(_A(e,t,n,o),vA(e,t,n,r),r?e.flags[t]|=64:(e.flags[t]&=-65,jg(e,t),Ur(e,t,4)),!0)}function b2(e,t){Sa(e,t),zg(e,t),CA(e,t,T2)}function E2(e,t){Sa(e,t),zg(e,t),y2(e,e.firstChild[t],0),y2(e,e.firstLazy[t],64),e.firstLazy[t]=e.lastLazy[t]=-1,T2(e,t)}function y2(e,t,r){for(let n=t;n>=0;n=e.nextSibling[n])e.parent[n]=-1,e.flags[n]&=~r,Ur(e,n,4),jg(e,n)}function T2(e,t){for(let r=e.firstLazy[t];r>=0;r=e.nextSibling[r])e.flags[r]&=32,e.free[e.freeCount++]=r;e.flags[t]&=32,e.free[e.freeCount++]=t}function A2(e,t,r){Sa(e,t),r!==-1&&Sa(e,r);for(let n=r;n>=0;n=e.parent[n])if(n===t)throw new E("TRANSFORM_CYCLE",`node ${r} under ${t}: cycle`,{node:t,parent:r});e.parent[t]!==r&&(zg(e,t),Wg(e,t,r),Ur(e,t,4))}var O2=0,Kg=4096,L2=new Int32Array(Kg),qg=0,wa=()=>O2,Xg=()=>void O2++,XGe=()=>qg,Qt=e=>Jd(e.index),R2=0,QGe=()=>R2,_2=()=>void R2++,IA=!1;function Jd(e){IA||(L2[qg++&Kg-1]=e)}function ZGe(e){IA=!0;try{e()}finally{IA=!1}}function JGe(e,t,r=qg){for(let n=e;n<r;n++){if(qg-n>Kg)return!1;t(L2[n&Kg-1])}return!0}function Qg(e,t,r){A2(e,t,r),Xg(),Jd(t)}function kA(e,t){b2(e,t),Xg(),Jd(t)}function ef(e,t,r){S2(e,t,r),Jd(t)}function tf(e,t,r){let n=(e.flags[t]&1)!==0;w2(e,t,r),n!==r&&Jd(t)}var xe=16,ya=3,FA=4,v2=4;function yc(e,t,r,n,o,i,s,a){let l=o[i],c=o[i+1],u=o[i+2],d=o[i+3],f=l+l,h=c+c,m=u+u,w=l*f,x=c*h,b=u*m,T=l*h,L=l*m,_=c*m,D=d*f,C=d*h,j=d*m,$=s[a],q=s[a+1],le=s[a+2];e[t]=(1-(x+b))*$,e[t+1]=(T+j)*$,e[t+2]=(L-C)*$,e[t+3]=0,e[t+4]=(T-j)*q,e[t+5]=(1-(w+b))*q,e[t+6]=(_+D)*q,e[t+7]=0,e[t+8]=(L+C)*le,e[t+9]=(_-D)*le,e[t+10]=(1-(w+x))*le,e[t+11]=0,e[t+12]=r[n],e[t+13]=r[n+1],e[t+14]=r[n+2],e[t+15]=1}function NA(e,t,r,n){return yc(e,0,t,0,r,0,n,0),e}var Yie=[0,0,0],Kie=[1,1,1];function xa(e,t){return yc(e,0,Yie,0,t,0,Kie,0),e}function BA(e,t,r,n,o){if(Array.isArray(e)&&typeof t[0]=="object"){let c=e,u=t,d=r,f=n;for(let h=0;h<o;h++)yc(c[h],0,u[h],0,d[h],0,f[h],0);return}let i=e,s=t,a=r,l=n;for(let c=0;c<o;c++){let u=c*3;yc(i,c*16,s,u,a,c*4,l,u)}}function qie(e,t){e.flags[t]|=8}function Xie(e,t){let{position:r,quaternion:n,scale:o}=e;yc(e.localViews[t],0,r,t*3,n,t*4,o,t*3)}function ba(e,t,r){let n=e.flags[t],o=(n&1)!==0,i=o&&(n&2)!==0;i&&Xie(e,t);let s=i?n&-3:n;r?o&&(s|=8):s&=-9;let a=e.parent[t],l=e.version,c=i||(n&4)!==0;if(a<0)c&&(Ce(e.worldViews[t],e.localViews[t]),e.seen[t]=0,l[t]=l[t]+1>>>0);else{let u=l[a];(c||e.seen[t]!==u)&&(Ve(e.worldViews[t],e.worldViews[a],e.localViews[t]),e.seen[t]=u,l[t]=l[t]+1>>>0)}e.flags[t]=s&-5}var Qie=(e,t)=>ba(e,t,!0);function UA(e,t,r=!1){let{parent:n,stamp:o,flags:i}=e,s=Yg(e)*2,a=9,l=r||(i[t]&a)!==0;l&&ba(e,t,!1),o[t]=l?s|1:s;let c=1;for(let u=yi(e,t,t);u>=0;u=yi(e,u,t))c++,o[n[u]]!==s||(i[u]&a)!==0?(ba(e,u,!1),o[u]=s|1):o[u]=s;return c}function ln(e,t,r,n){if(r){let{chain:o,parent:i}=e,s=0;for(let a=i[t];a>=0;a=i[a])o[s++]=a;for(;s>0;)ba(e,o[--s],!0)}n?CA(e,t,Qie):ba(e,t,!0)}var Zg=new Float64Array(9),de=new Float64Array(9);function Zie(e,t,r){let n=[e,t,r],o=+e+ +t+ +r;if(o===3){de.fill(0),de[0]=de[4]=de[8]=1;return}if(o===2){let i=n.indexOf(!1),s=(i+1)%3*3,a=i*3;for(let l=0;l<2;l++){de[s]=de[s+1]=de[s+2]=0,de[s+(i+1+l)%3]=1;let c=de[s]*de[a]+de[s+1]*de[a+1]+de[s+2]*de[a+2];de[s]-=c*de[a],de[s+1]-=c*de[a+1],de[s+2]-=c*de[a+2];let u=te(de[s],de[s+1],de[s+2]);if(u>1e-6){de[s]/=u,de[s+1]/=u,de[s+2]/=u;break}}n[(i+1)%3]=!1}for(let i=0;i<3;i++)n[i]&&Ze(de,de,de,i*3,(i+1)%3*3,(i+2)%3*3)}function rf(e,t){let r=t[0],n=t[1],o=t[2],i=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],d=r+s+u;if(d>0){let f=.5/Math.sqrt(d+1);e[3]=.25/f,e[0]=(c-a)*f,e[1]=(o-l)*f,e[2]=(i-n)*f}else if(r>s&&r>u){let f=2*Math.sqrt(1+r-s-u);e[3]=(c-a)/f,e[0]=.25*f,e[1]=(n+i)/f,e[2]=(o+l)/f}else if(s>u){let f=2*Math.sqrt(1+s-r-u);e[3]=(o-l)/f,e[0]=(n+i)/f,e[1]=.25*f,e[2]=(a+c)/f}else{let f=2*Math.sqrt(1+u-r-s);e[3]=(i-n)/f,e[0]=(o+l)/f,e[1]=(a+c)/f,e[2]=.25*f}}function Rr(e,t,r,n){let o=te(e[0],e[1],e[2]),i=te(e[4],e[5],e[6]),s=te(e[8],e[9],e[10]);YF(e)&&(o=-o),t[0]=e[12],t[1]=e[13],t[2]=e[14];let a=o!==0?1/o:0,l=i!==0?1/i:0,c=s!==0?1/s:0;de[0]=e[0]*a,de[1]=e[1]*a,de[2]=e[2]*a,de[3]=e[4]*l,de[4]=e[5]*l,de[5]=e[6]*l,de[6]=e[8]*c,de[7]=e[9]*c,de[8]=e[10]*c;let u=o===0,d=i===0,f=s===0;(u||d||f)&&Zie(u,d,f);for(let h=0;h<3;h++)Zg[h]=de[h*3],Zg[3+h]=de[h*3+1],Zg[6+h]=de[h*3+2];rf(r,Zg),n[0]=o,n[1]=i,n[2]=s}function Jie(e,t,r,n,o,i=0){return e[i]=t[0],e[i+1]=t[1],e[i+2]=t[2],e[i+3]=0,e[i+4]=r[0],e[i+5]=r[1],e[i+6]=r[2],e[i+7]=0,e[i+8]=n[0],e[i+9]=n[1],e[i+10]=n[2],e[i+11]=0,e[i+12]=o[0],e[i+13]=o[1],e[i+14]=o[2],e[i+15]=1,e}function ese(e,t,r,n=0){return e[n]=t,e[n+1]=0,e[n+2]=0,e[n+3]=0,e[n+4]=0,e[n+5]=t,e[n+6]=0,e[n+7]=0,e[n+8]=0,e[n+9]=0,e[n+10]=t,e[n+11]=0,e[n+12]=r[0],e[n+13]=r[1],e[n+14]=r[2],e[n+15]=1,e}var Ea=new Float64Array(16),Jg=new Float64Array(3),nf=new Float64Array(4),eS=new Float64Array(3);function M2(e,t){mr(Ea,e.updateWorldMatrix(!0,!1).worldMatrix);let r=t.updateWorldMatrix(!0,!1).parent;return r&&Ve(Ea,Ea,r.worldMatrix),Ve(Ea,Ea,t.localMatrix),e.add(t),t.parent!==e||(Rr(Ea,Jg,nf,eS),t.setPosition(Jg[0],Jg[1],Jg[2]),t.setQuaternion(nf[0],nf[1],nf[2],nf[3]),t.setScale(eS[0],eS[1],eS[2]).setLocalMatrix(Ea).updateWorldMatrix(!1,!0)),e}function io(e,t,r){throw new E(e,t,r)}function of(e,t=!0){return(!t||e!==void 0)&&typeof e!="boolean"&&io("INVALID_SCENE_NODE_VISIBILITY","Scene node visibility must be boolean",{visible:e}),e??!0}function tS(e,t,r="reparented"){t===e.root?.index&&io(r==="destroyed"?"SCENE_ROOT_DESTROY":"SCENE_ROOT_PARENT",`A scene root cannot be ${r}`,{})}function P2(e,t,r,n){if(n)for(let i=t.parent;i;i=i.parent)i===r&&io("SCENE_COPY_OVERLAP","A recursive copy cannot copy an ancestor into its descendant",{source:r.id,target:t.id});if(D2(e,t,r),!n)return;let o=[];for(let i=r.children.length-1;i>=0;i--)o.push([t,r.children[i]]);for(;o.length;){let[i,s]=o.pop(),a=t.root.createNode();D2(e,a,s),i.add(a);for(let l=s.children.length-1;l>=0;l--)o.push([a,s.children[l]])}}function D2(e,t,r){t.visible=r.visible;let n=r.index*3,o=r.index*4;Sc(e.tree,t.index,e.tree.position[n],e.tree.position[n+1],e.tree.position[n+2]),ms(e.tree,t.index,e.tree.quaternion[o],e.tree.quaternion[o+1],e.tree.quaternion[o+2],e.tree.quaternion[o+3]),wc(e.tree,t.index,e.tree.scale[n],e.tree.scale[n+1],e.tree.scale[n+2]),tf(e.tree,t.index,!!(e.tree.flags[r.index]&1)),ef(e.tree,t.index,r.localMatrix)}var gs=class{childNodes=[];childView=null;parentNode=null;state;id;index;visibleState;#e=!0;constructor(t,r,n,o=!0){this.state=t,this.id=r,this.index=n,this.visibleState=o}get _alive(){return this.#e}get root(){return this.state.root}get visible(){return this.assertAlive(),this.visibleState}set visible(t){this.assertAlive();let r=of(t,!1);r!==this.visibleState&&Qt(this),this.visibleState=r}get parent(){return this.assertAlive(),this.parentNode}get children(){return this.assertAlive(),this.childView??=Object.freeze(this.childNodes.slice())}get localMatrix(){return this.assertAlive(),this.state.tree.localViews[this.index]}get worldMatrix(){this.assertAlive();let{tree:t}=this.state;return t.flags[this.index]&64&&ln(t,this.index,!0,!1),t.worldViews[this.index]}_setWorldLazy(t){this.assertAlive();let{tree:r}=this.state;return!t&&r.flags[this.index]&64&&ln(r,this.index,!0,!1),x2(r,this.index,t)}add(t){return this.assertCompatible(t),tS(this.state,t.index),Qg(this.state.tree,t.index,this.index),t.parentNode?.detachChild(t),this.childNodes.push(t),this.childView=null,t.parentNode=this,this}remove(t){return this.assertCompatible(t),t.parent!==this?this:(Qg(this.state.tree,t.index,-1),this.detachChild(t),this)}clear(){this.assertAlive();for(let t=this.childNodes.length-1;t>=0;t--)this.remove(this.childNodes[t]);return this}reparent(t){return this.assertAlive(),tS(this.state,this.index),t?t.add(this):this.parent?.remove(this),this}attach(t){return M2(this,t)}clone(t=!0,r={}){this.assertAlive();let n=this.root.createNode(r);return n.copy(this,t),n}copy(t,r=!0){return this.assertCompatible(t),t===this?this:(P2(this.state,this,t,r),this)}setPosition(t,r,n){return this.assertAlive(),Sc(this.state.tree,this.index,t,r,n),this}setQuaternion(t,r,n,o){return this.assertAlive(),ms(this.state.tree,this.index,t,r,n,o),this}setScale(t,r,n){return this.assertAlive(),wc(this.state.tree,this.index,t,r,n),this}setLocalMatrix(t){return this.assertAlive(),ef(this.state.tree,this.index,t),this}setAutoUpdate(t){return this.assertAlive(),tf(this.state.tree,this.index,t),this}updateWorldMatrix(t=!0,r=!0){return this.assertAlive(),ln(this.state.tree,this.index,t,r),this}destroy(){this.assertAlive(),tS(this.state,this.index,"destroyed"),this.parent?.detachChild(this),this.invalidate(),kA(this.state.tree,this.index)}assertAlive(){(!this.#e||!(this.state.tree.flags[this.index]&16))&&io("STALE_SCENE_NODE",`Scene node ${this.id} was destroyed`,{id:this.id})}assertCompatible(t){this.assertAlive(),t.assertAlive(),this.state!==t.state&&io("SCENE_ROOT_MISMATCH","Scene nodes belong to different roots",{node:t.id,parent:this.id})}detachChild(t){this.childNodes.splice(this.childNodes.lastIndexOf(t)>>>0,1),this.childView=t.parentNode=null}invalidate(){let t=[this];for(;t.length;){let r=t.pop();for(let n of r.childNodes)t.push(n);r.childNodes=[],r.#e=!1,this.state.ids.delete(r.id)}}};var C2=1;var rS=class extends gs{version=1;createNode(t={}){let r=this.reserve(t);return this.register(new gs(r.state,r.id,r.index,r.visible))}reserve(t={}){this.assertAlive();let r=of(t.visible),n=t.id;if(n===void 0)do n=`node-${this.state.nextId++}`;while(this.state.ids.has(n));return(typeof n!="string"||!n)&&io("INVALID_SCENE_NODE_ID","A scene node id must be a non-empty string",{id:n}),this.state.ids.has(n)&&io("DUPLICATE_SCENE_NODE_ID",`Scene node id ${n} already exists`,{id:n}),{state:this.state,id:n,index:$g(this.state.tree),visible:r}}register(t){return this.state.ids.set(t.id,t),t}node(t){return this.state.ids.get(t)}};function VA(e={}){let t=e.id??"root";(typeof t!="string"||!t)&&io("INVALID_SCENE_NODE_ID","A scene root id must be a non-empty string",{id:t});let r=of(e.visible),n=PA(),o={tree:n,ids:new Map,nextId:1},i=new rS(o,t,$g(n),r);return o.root=i,o.ids.set(t,i),i}function tse(e){let{primitives:t,worstStalls:r=[]}=e,n=t.flatMap((o,i)=>(o.dag?.warnings??[]).map(s=>({...s,index:i,mesh:o.mesh,primitive:o.primitive})));return!n.length&&!r.length?null:{phase:"dag-warnings",message:`${n.length} primitive(s) without unique root: flagged by compiler; ${r.length} in the compiler's stall table`,context:{count:n.length,primitives:n,stalled:r}}}var rse=16;var nse=1,ose=15;function k3e(e){let t=0;for(let r of e)r.depthLayer>t&&(t=r.depthLayer);return 1+Math.min(t,15)}function ise(e){return!e||!Number.isFinite(e)||e<=0?0:Math.min(Math.floor(e),15)*16}var GA=(e,t)=>`${e}#${t}`,HA=(e,t,r)=>`${e}#${t}+${r}`,WA=(e,t)=>`${e}#bundle-${t}`;var I2={source:{id:"source",label:"Maximum source detail",pixelError:0,anisotropy:"source"},high:{id:"high",label:"High quality",pixelError:1,anisotropy:"maximum"},balanced:{id:"balanced",label:"Balanced quality",pixelError:4,anisotropy:"source"}};function sse(e){let t=I2[e];if(!t)throw new Error(`Unknown LOD quality: ${e}`);return t}var zA=["map","metalnessMap","roughnessMap","normalMap","aoMap","emissiveMap"],ase=["metalness","roughness","alphaTest","normalScale","normalScaleY","aoIntensity","transmission","ior","thickness","attenuationDistance"],lse=["baseColor","emissive","attenuationColor"],cse=["lit","doubleSided","backSide","hasIor"],use={nearest:"nearest",linear:"linear","nearest-mip-nearest":"nearestMipNearest","linear-mip-nearest":"linearMipNearest","nearest-mip-linear":"nearestMipLinear","linear-mip-linear":"linearMipLinear"};var dse=()=>new Uint8Array(Uint32Array.of(255).buffer)[0]===255?4278190080:255,k2=e=>e instanceof Uint8Array?e:Uint8Array.from(e);function fse(e,t,{alpha:r=!0}={}){let[n,o]=[k2(e),k2(t)];if(!n.length||n.length!==o.length||n.length%4!==0)throw new Error("Invalid RGBA images");let i=r?4:3,s=0,a=0,l=0,c=(n.byteOffset&3)===0,u=(o.byteOffset&3)===0;if(c&&u){let d=new Uint32Array(n.buffer,n.byteOffset,n.length>>>2),f=new Uint32Array(o.buffer,o.byteOffset,o.length>>>2),h=r?4294967295:~dse(),m=d.length;for(let w=0;w<m;w++)if(((d[w]^f[w])&h)!==0){s++;let x=w<<2,b=Math.abs(n[x]-o[x]),T=Math.abs(n[x+1]-o[x+1]),L=Math.abs(n[x+2]-o[x+2]),_=r?Math.abs(n[x+3]-o[x+3]):0;l+=b*b+T*T+L*L+_*_,a=Math.max(a,b,T,L,_)}}else for(let d=0;d<n.length;d+=4){let f=!1;for(let h=0;h<i;h++){let m=Math.abs(n[d+h]-o[d+h]);l+=m*m,a=Math.max(a,m),f||=m!==0}f&&s++}return{differentPixels:s,maxChannelError:a,rmse:Math.sqrt(l/(n.length/4*i))}}var pse={"density-volumes-dda-marching":1,"density-volumes-sample-marching":2,"density-volumes-sample-majorant":3,"density-volumes-sample-max-majorant":4,"density-volumes-sample-majorant-dda":5,"density-volumes-delta-tracking":6,"density-volumes-ratio-tracking":7,"density-volumes-spectral-ratio-tracking":8,"density-volumes-tracking-majorant-dda":9},hse={"paged-shadow-map-shadow-factor":1,"paged-shadow-map-clipmap-or-mip":2,"paged-shadow-map-virtual-page":4,"paged-shadow-map-cached-page":8,"paged-shadow-map-ray-count":16,"paged-shadow-map-general-debug":64,"paged-shadow-map-dirty-page":128,"paged-shadow-map-gpu-invalidated-page":256,"paged-shadow-map-merged-page":512,"paged-shadow-map-overdraw":1024},sf={beauty:{group:"render",available:!0,reason:"glTF materials"},xray:{group:"geometry",available:!0,reason:"The edges of every triangle the cut submitted, opaque and transparent, drawn with no depth test and added: what the culling dropped is absent, what it kept shows even behind a wall"},wireframe:{group:"geometry",available:!0,reason:"The edges of every visible triangle in its surface colour, over the background: what a nearer surface hides is left out"},triangles:{group:"geometry",available:!0,reason:"A filled unique colour per submitted triangle"},clusters:{group:"geometry",available:!0,reason:"Stable primitive/page ID"},lod:{group:"geometry",available:!0,reason:"The DAG level each drawn cluster was selected at this frame, level 0 the full detail, voxels by their level"},hlod:{group:"geometry",available:!0,reason:"HLOD coloration: white for an object within the main loading range, blue for HLOD level 0 (the object's own instanced meshes, out to HLOD 0's range), yellow onwards for the world DAG's merged levels"},voxels:{group:"geometry",available:!0,reason:"The pixels drawn as voxels in their level's colour \u2014 an object's far levels, a voxel HLOD cell's \u2014, the triangles in grey by their brightness"},"screen-error":{group:"geometry",available:!0,reason:"Per-cluster screen error projected at each pixel's depth, against the cut's threshold"},materials:{group:"materials",available:!0,reason:"One colour per material class, the class pass that resolved the pixel"},visibility:{group:"geometry",available:!0,reason:"Selected visible pages; rejected hierarchy nodes are counted, not drawn"},"texture-mip":{group:"materials",available:!1,reason:"Texture mip residency not instrumented"},overdraw:{group:"geometry",available:!1,reason:"No fragment counter"},"frame-difference":{group:"temporal",available:!0,reason:"The final displayed image against the one before, the luminance of their difference amplified eight times: still pixels black, any change from one image to the next lit"},reflections:{group:"lighting",available:!0,reason:"The reflection term the lighting adds \u2014 the screen trace and the probes behind it \u2014 alone, black where nothing is reflected"},shadows:{group:"lighting",available:!0,reason:"The visibility of the shadowed lights at each surface, weighed by their energy, raw grey: white in full light, black in full shadow, no material colour"},lighting:{group:"lighting",available:!0,reason:"The whole lighting \u2014 declared lights, reflection, bounce and environment \u2014 on a white surface, no material colour and no emission"},"indirect-diffuse":{group:"lighting",available:!0,reason:"Only the indirect light \u2014 the probes\u2019 bounce, the environment, the sky light, the ambient cubemap \u2014 on a surface whose diffuse colour is a grey of 0.18, black elsewhere; needs the indirect light"},"no-temporal-aa":{group:"temporal",available:!0,reason:"The beauty image with the temporal accumulation bypassed: the raw image of the frame"},"taa-input":{group:"temporal",available:!0,reason:"The image the temporal resolve receives, jitter on and nothing accumulated: each display pixel shows the render pixel it falls in"},"taa-rejection":{group:"temporal",available:!0,reason:"The share of its history each pixel keeps, raw: red against the shading's change, green against the history's stretch by the motion (a magnified history holds fewer samples a pixel), blue the share the update applies, the least; white the history kept, off screen black"},"taa-validity":{group:"temporal",available:!0,reason:"The history validity each pixel holds after the update, raw grey: white a full history, black one that restarts"},"taa-flicker":{group:"temporal",available:!0,reason:"The flicker measure at each pixel, raw: red its error amplified eight times, green its flicker count against its most, blue the transparents' coverage that discounts it"},"taa-shading":{group:"temporal",available:!0,reason:"The shading rejection at each pixel, raw, white the history kept: red without the flicker error's widening, green with it, blue spread over the 3\xD73 \u2014 the factor the update applies"},"taa-reprojection":{group:"temporal",available:!0,reason:"The reprojection's restarts at each pixel, raw: red disoccluded by parallax, green hole-filled with the occluder's motion, blue off the last screen"},"taa-motion":{group:"temporal",available:!0,reason:"The motion the temporal analysis follows at each pixel, raw: red how far the vector its history follows moves it, in full from 16 render pixels an image, green a pixel animation, blue the reprojection edge, white where the motion is flat"},"taa-thin":{group:"temporal",available:!0,reason:"The thin geometry detection at each pixel, raw: red the relaxation weight of its history clamp, green a cluster hole region, blue the coverage history"},"taa-material-history":{group:"temporal",available:!0,reason:"The responsiveness each pixel carries into the temporal analysis, by its material, opaque or transparent, raw: black none, a third grey a pixel animation, white a pixel animation whose history restarts"},"surface-atlas-albedo":{group:"surfaceAtlas",available:!0,reason:"The whole atlas of the imprints of the meshes, its albedo layer as stored, black where no surface was captured; needs a raster of the imprints plugged in to show a capture"},"surface-atlas-normal":{group:"surfaceAtlas",available:!0,reason:"The whole atlas, each texel's normal in its imprint's frame (x and y, z recovered), black where no surface was captured"},"surface-atlas-depth":{group:"surfaceAtlas",available:!0,reason:"The whole atlas, each texel's depth in its imprint's box as grey (white the inner face), magenta where no surface was captured"},"surface-atlas-imprints":{group:"surfaceAtlas",available:!0,reason:"The whole atlas, one colour for each imprint, black where no page of the atlas is held"},"surface-atlas-fill":{group:"surfaceAtlas",available:!0,reason:"The whole atlas, green where a texel is of an imprint's coarsest level (always kept), blue of a finer page, black free"},"surface-atlas-age":{group:"surfaceAtlas",available:!0,reason:"The whole atlas, the images since each page was captured: white under one, red to blue as it ages, black where no page is held"},"hair-light-bounds":{group:"hair",available:!0,reason:"The strands' components, voxelization and deep shadow atlas listed over the image, with the macro groups' boxes and the deep shadows' frusta the settings ask for; needs hairStrands and a scene that carries strands"},"hair-deep-opacity-maps":{group:"hair",available:!0,reason:"The depth and the layers of the deep shadow hairDeepShadowDebugIndex side by side over the image, the layers divided by hairDeepShadowDebugScale; needs a light that casts hair deep shadows"},"hair-macro-group-screen-rect":{group:"hair",available:!0,reason:"A green frame around the pixels each macro group of strands covers, and one around all of them; needs hairStrands and a scene that carries strands"},"hair-voxels-density":{group:"hair",available:!0,reason:"The strands' count along each pixel's ray through the voxels, green to red, or the first page that holds voxels; needs hairVoxelization"},"density-volumes-dda-marching":{group:"volumes",available:!0,reason:"The transmittance through the ortho and frustum voxel grids, walked cell by cell (DDA) from the camera to the opaque surface; needs a density volume and densityVolumesShadowsPipeline 1"},"density-volumes-sample-marching":{group:"volumes",available:!0,reason:"The transmittance through the ortho grid by samples, steps of a voxel along the ray of each pixel; needs a density volume and densityVolumesShadowsPipeline 1"},"density-volumes-sample-majorant":{group:"volumes",available:!0,reason:"The transmittance through the ortho grid by samples of the majorant of the cell under each step; needs a density volume and densityVolumesShadowsPipeline 1"},"density-volumes-sample-max-majorant":{group:"volumes",available:!0,reason:"The transmittance through the ortho grid by samples of the greatest majorant of the grid; needs a density volume and densityVolumesShadowsPipeline 1"},"density-volumes-sample-majorant-dda":{group:"volumes",available:!0,reason:"The transmittance through the ortho grid by samples, the cells of the majorant grid walked in turn; needs a density volume and densityVolumesShadowsPipeline 1"},"density-volumes-delta-tracking":{group:"volumes",available:!0,reason:"The transmittance through the ortho grid by spectral weighted delta tracking, one random walk a pixel; needs a density volume and densityVolumesShadowsPipeline 1"},"density-volumes-ratio-tracking":{group:"volumes",available:!0,reason:"The transmittance through the ortho grid by ratio tracking, one random walk a pixel; needs a density volume and densityVolumesShadowsPipeline 1"},"density-volumes-spectral-ratio-tracking":{group:"volumes",available:!0,reason:"The transmittance through the ortho grid by spectral ratio tracking, one random walk a pixel; needs a density volume and densityVolumesShadowsPipeline 1"},"density-volumes-tracking-majorant-dda":{group:"volumes",available:!0,reason:"The transmittance through the ortho grid by delta tracking, the cells of the majorant grid walked in turn; needs a density volume and densityVolumesShadowsPipeline 1"},"sampled-lights-overview":{group:"sampledLights",available:!0,reason:"The shadow casters view and the quality view side by side, over the normal image; needs sampledLights"},"sampled-lights-shadow-casters":{group:"sampledLights",available:!0,reason:"The surface the shadow rays meet at each pixel, one colour per object, lit by a fixed light, the sky where none; needs sampledLights"},"sampled-lights-shadow-caster-quality":{group:"sampledLights",available:!0,reason:"Where the surface the rays meet lies behind the drawn one (orange to red, a caster missing) or in front of it (blue, mismatching), by the distances sampledLightsVisualizeShadowCasterMissingDistance and PoorDistance; needs sampledLights"},"sampled-lights-complexity-opaque":{group:"sampledLights",available:!0,reason:"The lights of the cell under the cursor on the surfaces, sorted by weight with their kind and name and drawn to the pixel, and a heat map of the cost of sampling every pixel; needs sampledLights"},"sampled-lights-complexity-hair-strands":{group:"sampledLights",available:!1,reason:"The light complexity of the hair strands is not drawn yet: only the surfaces and the nearest translucent layer are"},"sampled-lights-complexity-front-layer":{group:"sampledLights",available:!0,reason:"The lights of the cell under the cursor on the nearest translucent layer, sorted by weight, and a heat map of the cost of sampling; needs sampledLights and sampledLightsFrontLayer"},"sampled-lights-complexity-volume":{group:"sampledLights",available:!1,reason:"The light complexity of the fog volume is not drawn yet: only the surfaces and the nearest translucent layer are"},"sampled-lights-complexity-translucent-light-volume":{group:"sampledLights",available:!1,reason:"The light complexity of the translucent light volume is not drawn yet: only the surfaces and the nearest translucent layer are"},"subsurface-profiles":{group:"materials",available:!0,reason:"The profile of each subsurface pixel over the middle of the image, one colour and one character per profile, faded where the scattering is narrower than a pixel, with the title and the profile list; needs subsurfaceScattering"},"paged-shadow-map-shadow-casters":{group:"shadowMaps",available:!0,reason:"The box of every placement whose casters invalidate the shadow pages, in the colour of its class, with the legend; needs shadows"},"paged-shadow-map-clipmap-virtual-space":{group:"shadowMaps",available:!0,reason:"The first sun's shadow clipmap in the virtual space of its levels, over the image in grey; needs shadows and paged shadow maps"},"paged-shadow-map-shadow-factor":{group:"shadowMaps",available:!0,reason:"The share of light that reaches the surface, yellow lit and dark blue in shadow, over the image in grey; needs shadows and paged shadow maps"},"paged-shadow-map-clipmap-or-mip":{group:"shadowMaps",available:!0,reason:"The clipmap or mip level each pixel reads, one colour a level, over the image in grey; needs shadows and paged shadow maps"},"paged-shadow-map-virtual-page":{group:"shadowMaps",available:!0,reason:"The virtual page each pixel reads, one colour a page, over the image in grey; needs shadows and paged shadow maps"},"paged-shadow-map-cached-page":{group:"shadowMaps",available:!0,reason:"The cached or invalidated state of the page each pixel reads, over the image in grey, with the legend; needs shadows and paged shadow maps"},"paged-shadow-map-ray-count":{group:"shadowMaps",available:!0,reason:"The rays traced at each pixel against the most, from green to red, over the image; needs shadows and paged shadow maps"},"paged-shadow-map-general-debug":{group:"shadowMaps",available:!0,reason:"The distance to the occluder of each pixel as a grey, over the image; needs shadows and paged shadow maps"},"paged-shadow-map-dirty-page":{group:"shadowMaps",available:!0,reason:"The pages drawn this image, over the image in grey; needs shadows and paged shadow maps"},"paged-shadow-map-gpu-invalidated-page":{group:"shadowMaps",available:!0,reason:"The pages the casters invalidated, over the image in grey; needs shadows and paged shadow maps"},"paged-shadow-map-merged-page":{group:"shadowMaps",available:!0,reason:"The pages whose static layer was merged, over the image in grey; needs shadows and paged shadow maps"},"paged-shadow-map-overdraw":{group:"shadowMaps",available:!0,reason:"The times the shadow raster drew each texel, over the image in grey; needs shadows and paged shadow maps"},"rect-light-atlas":{group:"lighting",available:!0,reason:"The atlas of the rectangle lights\u2019 pictures over the image, with its slots, horizon lines, free rectangles and figures; needs a rectangle that names a sourceTexture"},"light-profile-atlas":{group:"lighting",available:!0,reason:"The atlas of the light profiles over the image, with its slices and figures; needs a light that names an iesProfile"},"surface-atlas-direct-stats":{group:"surfaceAtlas",available:!0,reason:"The table of the surface atlas\u2019s direct light update over the image (histogram of the tiles by priority bucket, budget, pages and tiles lit); needs a scene whose meshes carry imprints"},"surface-atlas-indirect-stats":{group:"surfaceAtlas",available:!0,reason:"The table of the surface atlas\u2019s indirect light update over the image; needs a scene whose meshes carry imprints"},"surface-atlas-direct-lighting-stats":{group:"surfaceAtlas",available:!0,reason:"The lights the surface atlas\u2019s direct light update gathers, its atlas and update sizes, trace method and count, and the imprints and tiles it lights, over the image; needs a scene whose meshes carry imprints"},"surface-atlas-scene-stats":{group:"surfaceAtlas",available:!0,reason:"The counts of the placements, mesh imprints and imprints of the surface atlas over the image; needs a scene whose meshes carry imprints"},"surface-atlas-primitive-groups":{group:"surfaceAtlas",available:!0,reason:"The box of every placement that has mesh imprints, in white; needs a scene whose meshes carry imprints"},"probe-cache-stats":{group:"probes",available:!0,reason:"The update statistics of the world\u2019s probes over the image (probes in the atlas, unfilled, refreshing, refused, queued, cells marked); needs view probes with the probe cache"},"view-probe-gather-debug":{group:"probes",available:!0,reason:"The count of the view probes, uniform and adaptive, over the image; needs view probes"},"view-probe-placement":{group:"probes",available:!0,reason:"Where the view probes stand, a quad at the pixel of each, over the image; needs view probes"},"view-probe-traces":{group:"probes",available:!0,reason:"The rays of the view probe nearest to the cursor, lines coloured by their radiance, over the image; needs view probes"},"view-probe-history-frames":{group:"probes",available:!0,reason:"The images each pixel\u2019s view probe history holds, its light\u2019s in red and its occlusion\u2019s in green, blue where the young history\u2019s filter stands in, raw; needs view probes"},"reflection-traces":{group:"probes",available:!0,reason:"The reflection ray of the pixel under the cursor (debugPixelX, debugPixelY), a line coloured by its radiance and a cross at its end, with the distance and radiance as text, over the image; needs reflections"},"reflection-stages":{group:"probes",available:!0,reason:"Which stage answered each reflection ray \u2014 screen red, meshes green, scene blue, probe cache cyan, screen past the field white, nothing met yellow, unsettled magenta \u2014, raw, over the image; needs traced reflections"},"reflection-history":{group:"probes",available:!0,reason:"Each pixel\u2019s reflection history \u2014 restarted red, mover-marked magenta, handed on blue, settled green, else grey by its images \u2014, raw, over the image; needs traced reflections"},"probe-cache-probes":{group:"probes",available:!0,reason:"A sphere at every probe of the world\u2019s probes, coloured by the light it holds, over the image; needs the world\u2019s probes"},"scene-visualization":{group:"surfaceAtlas",available:!0,reason:"The scene traced from the camera and lit by what the surface atlas holds at the hit, over the image; needs the surface atlas"},"material-properties":{group:"materials",available:!0,reason:"The material of the pixel under the cursor (debugPixelX, debugPixelY), a table of text over the image; needs the lit surfaces"},"view-probe-tile-stats":{group:"probes",available:!0,reason:"The tiles of each mode of the view probes\u2019 integration over the image, with the legend; needs view probes with the integration\u2019s tile classification"}};var af=["drawn","still","heldOnAnswer","targetsAwaited","swapped","noiseFinal","withheld"],lf=new Set(["still","heldOnAnswer","targetsAwaited"]),jA=new Set(["drawn","swapped","noiseFinal"]),$A=new Set(["heldOnAnswer","targetsAwaited"]),YA=["device refusal","targets in flight","lit program","sorted translucency buffers","translucent object shadow table","pipelines","targets refused"];function F2(e){return Array.from(e).sort((t,r)=>t-r)}function nS(e,t){return e[Math.ceil(t*e.length)-1]}function iHe(e,t){return nS(F2(e),t)}function _n(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t}function KA(e){return _n(e)/e.length}function oS(e){if(!e.length)return null;let t=F2(e);return{n:t.length,mean:KA(t),min:t[0],max:t[t.length-1],p50:nS(t,.5),p95:nS(t,.95),p99:nS(t,.99)}}function sHe(e){let t=oS(e);return t&&{p50:t.p50,p95:t.p95}}var qA=50,XA=2,mse=e=>1e3/e,gse=(e,t)=>e.filter(r=>r>qA&&r>XA*t).length;function cf(e){if(e.some(r=>!Number.isFinite(r)||r<0))return null;let t=oS(e);return t&&{mean:t.mean,p50:t.p50,p95:t.p95,p99:t.p99,max:t.max}}function uf(e){let t=e.filter(o=>Number.isFinite(o)&&o>0).sort((o,i)=>o-i),r=oS(t);if(!r)return{fps:null,p50Ms:null,p95Ms:null,p99Ms:null,onePercentLowFps:null,stutters:null};let n=t.slice(-Math.max(1,Math.ceil(t.length*.01)));return{fps:mse(r.mean),p50Ms:r.p50,p95Ms:r.p95,p99Ms:r.p99,onePercentLowFps:1e3/KA(n),stutters:gse(t,r.p50)}}var N2=Object.freeze({physics:"Physics and particles",animations:"Animations and transforms",lights:"Lighting: preparing lists and shadows",cutAdoption:"Cut adoption",selection:"Selection and visibility",transparents:"Transparents",residency:"Admission and residency queue",hostPages:"Page lists handed to the host",uploads:"Uploads",textures:"Textures: order and transfers into the atlases",encode:"Pass encoding",submit:"Submit",hiZ:"Hi-Z (occlusion)",geometry:"Geometry",coplanar:"Coplanar layers",surfaceAtlas:"Surface atlas (imprint captures)",shadows:"Shadows",lightLists:"Light lists",bounce:"Bounce (irradiance probes)",reflections:"Screen reflections",lighting:"Lighting (resolve)",antialiasing:"Temporal antialiasing",effects:"Image effects (bloom, outline)",present:"Present",outside:"Work outside the images",diagnostic:"Instruments"}),Sse=e=>N2[e]??e;function wse(e){let t=cf(Array.from(e));return t?{p50:t.p50,p95:t.p95}:null}var yse="per-stage profile not requested by the host";function xse(e){return{version:1,enabled:!1,backend:e,cpuFrames:0,gpuSamples:0,windowFrames:0,gpuMethod:null,gpuReason:yse,gpuImageMs:null,overheadMs:null,stages:[]}}function bse(e){return e.type==="fatal"&&e.audience==="blocking"&&!e.recovered?{messageKey:"scene-unavailable",action:"retry"}:null}var B2=128;var QA=["channel0","channel1","channel2"],U2=3,V2=7,bc=1,G2=Array.from({length:V2+1},(e,t)=>Object.freeze(Object.fromEntries(QA.map((r,n)=>[r,(t&1<<n)!==0])))),iS=G2[bc],sS=e=>QA.reduce((t,r,n)=>t|(e[r]?1<<n:0),0),Ese=e=>G2[e&V2],ZA=e=>e^bc,AHe=e=>ZA(sS(e)),JA=e=>dg(QA,e),eO="{ channel0, channel1, channel2 }, each true or false",H2=(e,t)=>JA(t)?void 0:`${e} is ${eO}`,aS=e=>Ese(sS(e));var Ec=[0,1],ff=["static","stationary","movable"],Ta="stationary",Tse=4,Ase={sunAngularRadius:.5357*ce/2,tileLights:64,tileSize:64,gridSlices:32,gridDepthDistribution:4.05,gridFarFloor:10,gridFarMax:2097.152},Ose={shadowPage:128,lampFaceSize:4096,shadowRequestCap:4096,sunLevels:16,sunLevelPages:64,shadowNearFraction:1/200,shadowNearMin:.05,shadowNormalOffsetTexels:.5},Lse={spotConeLimit:88.9*ce,spotConeGap:.001,radialExponent:8,lampDistanceBias:1e-4},Ot={...Ase,...Ose,...Lse},Rse=64,_se=6,bi=32,pf=4,W2=1,hf={point:0,spot:1,directional:2,rect:3},df=4,lS={castsShadow:df,shadowsFog:2*df,transmission:4*df},mf={none:0,static:1,dynamic:3},tO=5,z2=2,_He=2**z2-1,rO=tO+U2,gf=rO+z2,cS=6,j2=2**(cS-1),Tc=gf+cS,Sf=Tc+1,$2=23,nO=2**$2,vHe=nO-1,oO=$2-Sf,MHe=2**oO;var St=(e,t)=>Math.ceil(e/t),PHe=(e,t)=>Math.max(1,St(e,t)),Vr=(e,t)=>St(e,t)*t,uS=(e,t)=>Math.floor(e/t)*t,iO=e=>32-Math.clz32(e),CHe=(e,t)=>Vr(e,2**Math.max(iO(e-1)-t,0)),vse=e=>iO(e-1);function Ei(e){if(e<=1)return 1;if(e<=2**32){let t=vse(Math.ceil(e));return t<=30?1<<t:t===31?2**31:2**32}if(e!==e)return NaN;throw new RangeError(`nextPow2: ${e} is past 2^32`)}var IHe=e=>Ei(2*Math.max(1,e)),Y2=e=>2**sO(Math.max(1,Math.floor(e))),Aa=(e,t)=>Math.max(1,e>>>Math.min(t,31)),sO=e=>iO(e)-1,vn=(e,t)=>Number.isSafeInteger(e)&&Number.isSafeInteger(t)&&e>=1&&t>=1,K2=e=>e>0&&(e&e-1)===0,q2=e=>Math.ceil(e/32)||0;function kHe(e,t){for(;t;){let r=e%t;e=t,t=r}return e}function FHe(e){Array.isArray(e)?e.sort((r,n)=>r-n):e.sort();let t=0;for(let r=0;r<e.length;r++)(r===0||e[r]!==e[r-1])&&(e[t++]=e[r]);return Array.isArray(e)&&(e.length=t),t}function NHe(e){let t=Math.imul(e,2654435761);return t^=t>>>15,t=Math.imul(t,2246822519),t^=t>>>13,t>>>0}var BHe=(e,t,r,n)=>(e-t&n)>=(e-r&n);var Ac={cascadeLevels:4,cascadeSize:48,cascadeHalfExtentMetres:25,cascadeBase:2,probePool:16384},dS=6,Mse=255,aO=e=>Ei(Math.ceil(Math.sqrt(e)));function Dse(e){let t=k(Math.trunc(e),1,Mse),r=Ei(t);return r*St(t*t,r)}function lO(e,t,r=Ac.probePool){let n=Math.max(St(r,t),4*e),o=Math.floor(Math.sqrt(n)),i=aO(r),s=Math.min(Ei(o),i);return{row:s,probes:s*Math.min(St(o*o,s),St(r,i))}}var Pse=(e,t,r)=>lO(e,t,r).probes,Cse=(e,t,r,n=Ac.probePool)=>r?{row:aO(n),probes:n}:lO(e,t,n);function Q2(e,t=Ac){let{cascadeHalfExtentMetres:r,cascadeSize:n,cascadeBase:o}=t;return 2*r/n*o**e}function X2(e,t,r){let n=Math.floor(r/2);return[0,1,2].map(o=>Math.floor(t[o]/e)-n)}function Ise(e,t=Ac){let{cascadeLevels:r,cascadeSize:n,probePool:o}=t,i=[0,1,2].map(l=>(e[l]+e[3+l])/2),s=Array.from({length:r},(l,c)=>{let u=Q2(c,t);return{spacing:u,base:X2(u,i,n)}});return{size:n,cells:n**3,probes:o,levels:s,follow(l){let c=!1;for(let u of s){let d=X2(u.spacing,l,n);Be(d,u.base)||(c=!0),u.base=d}return c},holds(l,c,u,d){let{base:f}=s[l];return c>=f[0]&&c<f[0]+n&&u>=f[1]&&u<f[1]+n&&d>=f[2]&&d<f[2]+n}}}function kse(e){let t={};for(let[n,o]of Object.entries(e))o!==void 0&&(t[n]=o);let r={...t,color:[...e.color]};return e.position&&(r.position=[...e.position]),e.direction&&(r.direction=[...e.direction]),e.right&&(r.right=[...e.right]),e.emitterAxis&&(r.emitterAxis=[...e.emitterAxis]),e.size&&(r.size=[...e.size]),e.sourceTextureScale&&(r.sourceTextureScale=[...e.sourceTextureScale]),e.sourceTextureOffset&&(r.sourceTextureOffset=[...e.sourceTextureOffset]),e.sunDiskTint&&(r.sunDiskTint=[...e.sunDiskTint]),e.shaftOverrideDirection&&(r.shaftOverrideDirection=[...e.shaftOverrideDirection]),e.shaftBloomTint&&(r.shaftBloomTint=[...e.shaftBloomTint]),e.cloudScatteredLuminanceScale&&(r.cloudScatteredLuminanceScale=[...e.cloudScatteredLuminanceScale]),e.lightPatternScale&&(r.lightPatternScale=[...e.lightPatternScale]),r}function Z2(e){let t=(.860117757+.000154118254*e+128641212e-15*e*e)/(1+.000842420235*e+708145163e-15*e*e),r=(.317398726+422806245e-13*e+420481691e-16*e*e)/(1-289741816e-13*e+161456053e-15*e*e);return[t,r]}function J2(e,t){let r=2*e-8*t+4;return[3*e/r,2*t/r]}var Fse=1e3,Nse=15e3;function eB(e){let t=k(e,Fse,Nse),[r,n]=J2(...Z2(t)),o=1-r-n,[i,s,a]=TT([r/n,1,o/n],VF);return[Math.max(0,i),Math.max(0,s),Math.max(0,a)]}function tB(e,{useTemperature:t,temperatureKelvin:r}){if(!t)return e;let n=eB(r);return[e[0]*n[0],e[1]*n[1],e[2]*n[2]]}var uO=["unitless","candelas","lumens","nits","ev"],Ti="unitless",cO=1e4,nB=16,Bse=1e-4;function rB(e,t){return e==="nits"?1:e==="candelas"||e==="ev"?cO:e==="lumens"?cO/2/Math.PI/(1-t):nB}function dO(e,t,r){if(e===t)return 1;let n=k(r,-1,1-Bse);return rB(e,n)/rB(t,n)}function oB(e,t,r,n){return t==="candelas"?e:t==="nits"?e*r:t==="lumens"?e/n:t==="ev"?2**e:e*nB/cO}var iB=A({rayTracedShadows:p("rayTracedShadows",!1),rayTracedShadowsDirectionalLights:p("rayTracedShadowsDirectionalLights",!0),rayTracedShadowsPointLights:p("rayTracedShadowsPointLights",!0),rayTracedShadowsSpotLights:p("rayTracedShadowsSpotLights",!0),rayTracedShadowsRectLights:p("rayTracedShadowsRectLights",!0),rayTracedShadowsSamplesPerPixel:S("rayTracedShadowsSamplesPerPixel",-1,[-1,sn]),rayTracedShadowsNormalBias:y("rayTracedShadowsNormalBias",.1),rayTracedShadowsAvoidSelfIntersectionTraceDistance:y("rayTracedShadowsAvoidSelfIntersectionTraceDistance",1),rayTracedShadowsTwoSidedGeometry:p("rayTracedShadowsTwoSidedGeometry",!0),rayTracedShadowsAcceptFirstHit:p("rayTracedShadowsAcceptFirstHit",!0),rayTracedShadowsLODTransitionStart:y("rayTracedShadowsLODTransitionStart",4e3),rayTracedShadowsLODTransitionEnd:y("rayTracedShadowsLODTransitionEnd",5e3),rayTracedShadowsDirectionalLightTraceDistance:g("rayTracedShadowsDirectionalLightTraceDistance",1e4,[1e3,1e6]),rayTracedShadowsDenoiser:p("rayTracedShadowsDenoiser",!0),rayTracedShadowsDenoiserReconstructionSamples:S("rayTracedShadowsDenoiserReconstructionSamples",8,[1,56]),rayTracedShadowsDenoiserPreConvolution:S("rayTracedShadowsDenoiserPreConvolution",1,[0,4]),rayTracedShadowsDenoiserTemporalAccumulation:p("rayTracedShadowsDenoiserTemporalAccumulation",!0),rayTracedShadowsDenoiserHistoryConvolutionSamples:S("rayTracedShadowsDenoiserHistoryConvolutionSamples",1,[1,56])}),fS=["disabled","useProjectSetting","enabled"];function nWe(e,t,r){return(t==="directional"?e.rayTracedShadowsDirectionalLights:t==="point"?e.rayTracedShadowsPointLights:t==="spot"?e.rayTracedShadowsSpotLights:e.rayTracedShadowsRectLights)&&(r==="enabled"||r==="useProjectSetting"&&e.rayTracedShadows)}var Ai=A({contactShadowLength:y("contactShadowLength",0),contactShadowLengthInWorldSpace:p("contactShadowLengthInWorldSpace",!1),contactShadowCastingIntensity:g("contactShadowCastingIntensity",1,[0,1]),contactShadowNonCastingIntensity:g("contactShadowNonCastingIntensity",0,[0,1]),indirectLightingIntensity:y("indirectLightingIntensity",1),castRayTracedShadow:N("castRayTracedShadow","useProjectSetting",fS),rayTracedShadowSamplesPerPixel:S("rayTracedShadowSamplesPerPixel",1,[1,sn])}),Use=Object.keys(Ai),sB=e=>ue(Ai,Xe(e,Use,"the contact shadows of a light",oe("light contact shadow")));function fO(e,t,r){if(et(e,t))return t;let n=`${r}: ${e.field} must be ${Dt(e)}`;throw new E("INVALID_SCENE_LIGHT",n,{[e.field]:t})}function Ie(e,t,r){let n=e[r.field],o=t;n!==void 0&&(o[r.field]=fO(r,n,e.id))}var aB=new WeakMap;function Vse(e,t){if(Object.keys(t).length)return e(t);let r=aB.get(e);if(!r){let n=e({});for(let o of Object.values(n))Array.isArray(o)&&Object.freeze(o);aB.set(e,r=Object.freeze(n))}return r}function pO(e,t,r,n){let o;try{o=n(r)}catch(s){throw new E("INVALID_SCENE_LIGHT",`${e.id}: ${s.message}`,r)}let i=t;for(let s of Object.keys(r)){let a=o[s];i[s]=Array.isArray(a)?[...a]:a}}function Gse(e,t,r,n,o){if(e.kind!=="directional"){let i=o.find(s=>r[s]!==void 0);if(i!==void 0)throw new E("INVALID_SCENE_LIGHT",`${e.id}: ${i} expects a directional light: it exists only for one`,r)}Object.keys(r).length&&pO(e,t,r,n)}function Oc(e,t,r){let n=lc(e),o=l=>{let c=l,u={};for(let d of n)c[d]!==void 0&&(u[d]=c[d]);return u},i=new WeakMap;function s(l){let c=i.get(l);return c||i.set(l,c=Vse(t,o(l))),c}function a(l,c){let u=s(l),d=s(c);return n.every(f=>Hd(u[f],d[f]))}return{validate:(l,c)=>Gse(l,c,o(l),t,r??n),of:s,same:a}}var hO=Oc(Ai,sB,[]),lB=(e,t)=>hO.validate(e,t),Oa=e=>hO.of(e),pS=(e,t)=>hO.same(e,t);var cB=Object.freeze({contactShadows:!0,contactShadowOverrideLength:-1,contactShadowOverrideLengthInWorldSpace:!1,contactShadowOverrideCastingIntensity:-1,contactShadowOverrideNonCastingIntensity:-1,contactShadowMethod:0,contactShadowSurfaceThickness:.005,contactShadowMaxLights:8,contactShadowIntensityMode:0,contactShadowIntensityFadeStart:1600,contactShadowIntensityFadeLength:800}),uB=(e,t)=>e>=0?Math.min(1,e):t,dB=(e,t)=>uB(t.contactShadowOverrideCastingIntensity,e.contactShadowCastingIntensity),fB=(e,t)=>uB(t.contactShadowOverrideNonCastingIntensity,e.contactShadowNonCastingIntensity);function pB(e,t){return t.contactShadows?(t.contactShadowOverrideLength>=0?t.contactShadowOverrideLength:e.contactShadowLength)>0&&(dB(e,t)>0||fB(e,t)>0):!1}function hB(e,t,r,n){let o=!n.contactShadows,i=n.contactShadowOverrideLength>=0,s=i?n.contactShadowOverrideLength:r.contactShadowLength,a=i?n.contactShadowOverrideLengthInWorldSpace:r.contactShadowLengthInWorldSpace;e[t]=pB(r,n)?a?0-s:2*s:0,e[t+1]=o?1:dB(r,n),e[t+2]=o?0:fB(r,n)}var mO=(e,t,r)=>e.castsShadow&&r.dynamicShadows&&pB(Oa(e),t);var mB=Object.freeze({dynamicShadows:!0}),gB=(e,t,r)=>e.castsShadow?r?mf.dynamic:mf.static:e.lightPattern!==void 0&&!t?mf.static:mf.none;function gO(e,t){let r=[0,0];return SO(e,t,r),r}function SO(e,t,r){let{spotConeLimit:n,spotConeGap:o}=Ot,i=k(e,0,n);r[0]=i,r[1]=k(t,i+o,n+o)}var _r={scale:[10.24,10.24,10.24],fadeDistance:1e3,disabledBrightness:.5,coneAngle:0},wf=A({lightPatternFadeDistance:F("lightPatternFadeDistance",_r.fadeDistance),lightPatternDisabledBrightness:y("lightPatternDisabledBrightness",_r.disabledBrightness),lightPatternConeAngle:y("lightPatternConeAngle",_r.coneAngle)}),Hse=89,Wse=["lightPatternScale","lightPatternFadeDistance","lightPatternDisabledBrightness","lightPatternConeAngle"],wO=e=>e.lightPatternScale??_r.scale,yO=e=>e.lightPatternFadeDistance??_r.fadeDistance,xO=e=>e.lightPatternDisabledBrightness??_r.disabledBrightness,RWe=e=>{let t=e.lightPatternConeAngle??_r.coneAngle;return t>0?Math.tan(Math.min(t,Hse)*ce):0},Gr=(e,t,r)=>new E("INVALID_SCENE_LIGHT",`${e}: ${t}`,{value:r});function zse(e,t){let{id:r}=e,{lightPatternScale:n}=e;if(n!==void 0){if(!Array.isArray(n)||n.length!==3||!n.every(o=>K(o)&&o>0))throw Gr(r,"lightPatternScale expects three numbers above 0",n);t.lightPatternScale=[n[0],n[1],n[2]]}Ie(e,t,wf.lightPatternFadeDistance),Ie(e,t,wf.lightPatternDisabledBrightness)}function SB(e,t){let{id:r}=e;if(e.lightPattern===void 0){for(let o of Wse)if(e[o]!==void 0)throw Gr(r,`${o} exists only beside a lightPattern`,e[o]);return}if(typeof e.lightPattern!="string"||!e.lightPattern)throw Gr(r,"lightPattern expects a material id",e.lightPattern);t.lightPattern=e.lightPattern,zse(e,t);let n=e.lightPatternConeAngle;if(n!==void 0){if(e.kind!=="rect")throw Gr(r,"lightPatternConeAngle exists only for a rect",n);Ie(e,t,wf.lightPatternConeAngle)}}function Lc(e,t,r){if(!Array.isArray(e)||e.length!==3||!e.every(K))throw new E("INVALID_SCENE_LIGHT",`${r}: ${t} expects three finite numbers`,{field:t,value:e});return[e[0],e[1],e[2]]}function bO(e,t){let r=Fr(e[0],e[1],e[2]);if(!(r>1e-6))throw new E("INVALID_SCENE_LIGHT",`${t}: zero-length direction`,{value:e});return[e[0]/r,e[1]/r,e[2]/r]}function yf(e,t){return bO(Lc(e,"direction",t),t)}function hS(e,t,r){if(e===void 0)throw new E("INVALID_SCENE_LIGHT",`${t}: ${r}`,{});return yf(e,t)}function rt(e,t,r){if(e[t]!==void 0)throw new E("INVALID_SCENE_LIGHT",`${e.id}: ${t} ${r}`,{field:t})}var mS={useBrightness:!1,brightnessScale:1},gS=e=>e.useIesBrightness??mS.useBrightness,SS=e=>e.iesBrightnessScale??mS.brightnessScale;var EO=A({iesBrightnessScale:y("iesBrightnessScale",mS.brightnessScale),iesProfile:fN("iesProfile")}),jse=["useIesBrightness","iesBrightnessScale","iesBrightness"],$se=["iesProfile","useIesBrightness","iesBrightnessScale","iesBrightness"];function wB(e,t){let{iesProfile:r,iesBrightness:n}=e;if(r===void 0||!gS(e)||n===void 0)return t;let o=n*SS(e);return e.intensityUnits==="ev"?Math.log2(Math.max(o,Number.MIN_VALUE)):o}function TO(e){for(let t of $se)rt(e,t,"exists only for a point or a spot")}function AO(e,t){let{id:r,iesProfile:n}=e;if(n===void 0){for(let c of jse)rt(e,c,"exists only beside an iesProfile");return}if(typeof n!="string"||!n)throw Gr(r,"iesProfile expects a profile id",n);t.iesProfile=n;let{useIesBrightness:o,iesBrightness:i}=e;if(o!==void 0){if(typeof o!="boolean")throw Gr(r,"useIesBrightness expects a boolean",o);t.useIesBrightness=o}if(Ie(e,t,EO.iesBrightnessScale),i!==void 0){if(!K(i)||i<=0)throw Gr(r,"iesBrightness must be a finite number above 0",i);t.iesBrightness=i}let{direction:s,emitterAxis:a}=t;if(s===void 0)throw Gr(r,"an iesProfile requires the light direction",s);if(a===void 0)throw Gr(r,"an iesProfile requires an emitterAxis, the axis its horizontal angle runs round",a);let l=[...a];if(Zn(l,s,-Ge(l,s)),!(Fr(l[0],l[1],l[2])>1e-6))throw Gr(r,"emitterAxis must not be parallel to the direction",a)}var yB=(e,t)=>e.iesProfile===t.iesProfile&&gS(e)===gS(t)&&SS(e)===SS(t)&&e.iesBrightness===t.iesBrightness,xB=e=>e+1,bB=e=>e-1;var La=88,Yse=90,Rc=.2,wS=A({barnDoorAngle:g("barnDoorAngle",La,[0,Yse]),barnDoorLength:y("barnDoorLength",Rc)}),OO=e=>e.barnDoorAngle??La,xf=e=>e.barnDoorLength??Rc;function EB(e){let t=OO(e);return e.kind==="rect"&&t<La&&xf(e)>0?Math.cos(t*ce):0}var Kse=["barnDoorAngle","barnDoorLength"];function LO(e){for(let t of Kse)rt(e,t,"exists only for a rect")}function TB(e,t){Ie(e,t,wS.barnDoorAngle),Ie(e,t,wS.barnDoorLength)}var AB=(e,t)=>OO(e)===OO(t)&&xf(e)===xf(t);var yS=16,qWe=8,qse=A({shadowClipmapFirstLevel:S("shadowClipmapFirstLevel",3,[0,30]),shadowClipmapLastLevel:S("shadowClipmapLastLevel",22,[0,30]),shadowFirstPersonClipmap:p("shadowFirstPersonClipmap",!0),shadowFirstPersonClipmapFirstLevel:S("shadowFirstPersonClipmapFirstLevel",8,[0,30]),shadowFirstPersonClipmapLastLevel:S("shadowFirstPersonClipmapLastLevel",18,[0,30]),shadowFirstPersonPixelRequestBias:g("shadowFirstPersonPixelRequestBias",2,[-16,16]),shadowFirstPersonRequestMinLevelClamp:S("shadowFirstPersonRequestMinLevelClamp",8,[0,30]),shadowFirstPersonSelfShadow:p("shadowFirstPersonSelfShadow",!1),shadowFirstPersonSelfShadowLightTypes:S("shadowFirstPersonSelfShadowLightTypes",0,[0,2]),shadowFirstPersonSelfShadowDownsampleCheckerboardMode:S("shadowFirstPersonSelfShadowDownsampleCheckerboardMode",0,[0,2]),shadowFirstPersonSelfShadowMaxTraceDistance:y("shadowFirstPersonSelfShadowMaxTraceDistance",1),shadowFirstPersonSelfShadowMaxHzbTraceIterations:S("shadowFirstPersonSelfShadowMaxHzbTraceIterations",512,[1,4096]),shadowFirstPersonSelfShadowRelativeDepthThickness:F("shadowFirstPersonSelfShadowRelativeDepthThickness",.2),shadowFirstPersonSelfShadowMinimumHzbTraceOccupancy:P("shadowFirstPersonSelfShadowMinimumHzbTraceOccupancy",0,0),shadowFirstPersonSelfShadowBilateralFilterDepthThreshold:F("shadowFirstPersonSelfShadowBilateralFilterDepthThreshold",1),shadowFirstPersonSelfShadowRawFullResolution:p("shadowFirstPersonSelfShadowRawFullResolution",!1),shadowClipmapFirstCoarseLevel:S("shadowClipmapFirstCoarseLevel",15,[0,30]),shadowClipmapLastCoarseLevel:S("shadowClipmapLastCoarseLevel",18,[0,30]),shadowClipmapMinCameraViewportWidth:S("shadowClipmapMinCameraViewportWidth",0,[0,16384]),shadowOrthoEstimateClipmapLevels:p("shadowOrthoEstimateClipmapLevels",!0),shadowOrthoClipmapLodBias:S("shadowOrthoClipmapLodBias",0,[-30,30]),shadowOrthoProjectViewOrigin:p("shadowOrthoProjectViewOrigin",!0),shadowOrthoRayCastViewOrigin:p("shadowOrthoRayCastViewOrigin",!0),shadowClipmapZRangeScale:F("shadowClipmapZRangeScale",1e3),shadowClipmapWpoDisableDistance:p("shadowClipmapWpoDisableDistance",!0),shadowClipmapWpoDisableDistanceLodBias:S("shadowClipmapWpoDisableDistanceLodBias",3,[0,30]),shadowClipmapWpoDisableDistanceInvalidateOnScaleChange:p("shadowClipmapWpoDisableDistanceInvalidateOnScaleChange",!1),shadowClipmapCullDynamicTightly:p("shadowClipmapCullDynamicTightly",!0),shadowForceInvalidateDirectional:p("shadowForceInvalidateDirectional",!1),shadowPrefilteredDistant:p("shadowPrefilteredDistant",!1),shadowPrefilteredDistantHistoryBlendFactor:g("shadowPrefilteredDistantHistoryBlendFactor",.87,[0,1]),shadowUseReceiverMaskDirectional:p("shadowUseReceiverMaskDirectional",!0),shadowUseReceiverMaskLocal:p("shadowUseReceiverMaskLocal",!1),shadowMarkCoarsePagesDirectional:S("shadowMarkCoarsePagesDirectional",2,[0,2]),shadowMarkCoarsePagesLocal:S("shadowMarkCoarsePagesLocal",1,[0,2]),shadowCoarsePagePixelThresholdStatic:y("shadowCoarsePagePixelThresholdStatic",1),shadowCoarsePagePixelThresholdDynamicClusters:y("shadowCoarsePagePixelThresholdDynamicClusters",4),shadowCoarsePagesIncludeNonClusterCasters:p("shadowCoarsePagesIncludeNonClusterCasters",!0),shadowMarkPixelPagesMipModeLocal:S("shadowMarkPixelPagesMipModeLocal",0,[0,2]),shadowPageDilationBorderSizeDirectional:y("shadowPageDilationBorderSizeDirectional",.05),shadowPageDilationBorderSizeLocal:y("shadowPageDilationBorderSizeLocal",.05),shadowMarkPixelPages:p("shadowMarkPixelPages",!0),shadowMarkPagesUseFroxels:p("shadowMarkPagesUseFroxels",!1),shadowCullBackfacingPixels:p("shadowCullBackfacingPixels",!0),shadowPageMarkingPixelStrideX:S("shadowPageMarkingPixelStrideX",2,[1,128]),shadowPageMarkingPixelStrideY:S("shadowPageMarkingPixelStrideY",2,[1,128])}),Xse=A({shadowRasterIndirectionMultiplier:y("shadowRasterIndirectionMultiplier",1.5),shadowNormalBias:y("shadowNormalBias",.5),shadowMaxDofResolutionBias:y("shadowMaxDofResolutionBias",1),shadowScreenRayLength:y("shadowScreenRayLength",.015),shadowSubsurfaceMinSourceAngle:y("shadowSubsurfaceMinSourceAngle",5),shadowOnePassProjection:p("shadowOnePassProjection",!0),clusteredDeferredShading:p("clusteredDeferredShading",!1),shadowForcePerLightMaskClear:p("shadowForcePerLightMaskClear",!1),shadowOnePassProjectionMaxLightsPerPixel:S("shadowOnePassProjectionMaxLightsPerPixel",16,[1,32]),shadowAllowScreenOverflowMessages:p("shadowAllowScreenOverflowMessages",!0),shadowCache:p("shadowCache",!0),shadowAccumulateStats:S("shadowAccumulateStats",0,we),shadowCacheAllocateViaLru:p("shadowCacheAllocateViaLru",!0),shadowCacheMovedVertexPrimitives:p("shadowCacheMovedVertexPrimitives",!1),shadowForceInvalidateLocal:S("shadowForceInvalidateLocal",0,[0,2]),shadowForceFullPageClears:p("shadowForceFullPageClears",!1),shadowCacheDebugSkipDynamicPageInvalidation:p("shadowCacheDebugSkipDynamicPageInvalidation",!1),shadowDynamicDeallocationMode:S("shadowDynamicDeallocationMode",0,[0,2]),shadowCacheInvalidateUseHzb:p("shadowCacheInvalidateUseHzb",!0),shadowDeferredInvalidationBudget:S("shadowDeferredInvalidationBudget",-1,[-1,we[1]]),shadowInvalidateOnLodDelta:p("shadowInvalidateOnLodDelta",!1),shadowCacheFramesStaticThreshold:P("shadowCacheFramesStaticThreshold",100,0),shadowCacheMaxPageAgeSinceLastRequest:P("shadowCacheMaxPageAgeSinceLastRequest",1e3,0),shadowCacheMaxLightAgeSinceLastRequest:P("shadowCacheMaxLightAgeSinceLastRequest",10,0),shadowDynamicResolutionMaxResolutionLodBias:y("shadowDynamicResolutionMaxResolutionLodBias",2),shadowDynamicResolutionMaxPagePoolLoadFactor:y("shadowDynamicResolutionMaxPagePoolLoadFactor",.85),shadowDynamicResolutionTimeBudgetMs:y("shadowDynamicResolutionTimeBudgetMs",0),shadowDynamicResolutionLoadBudget:y("shadowDynamicResolutionLoadBudget",0),shadowDynamicResolutionPerPagedShadowBiasHistoryWeight:g("shadowDynamicResolutionPerPagedShadowBiasHistoryWeight",.9,R),shadowDynamicResolutionMaxComputeResolutionLodBiasDirectional:y("shadowDynamicResolutionMaxComputeResolutionLodBiasDirectional",99999),shadowDynamicResolutionMaxComputeResolutionLodBiasLocal:y("shadowDynamicResolutionMaxComputeResolutionLodBiasLocal",99999)}),Qse=A({shadowMarchMaxRayAngleFromLight:F("shadowMarchMaxRayAngleFromLight",.03),shadowMarchExtrapolateMaxSlopeLocal:y("shadowMarchExtrapolateMaxSlopeLocal",.05),shadowMarchExtrapolateMaxSlopeDirectional:y("shadowMarchExtrapolateMaxSlopeDirectional",5),shadowMarchTexelDitherScaleLocal:y("shadowMarchTexelDitherScaleLocal",2),shadowMarchTexelDitherScaleDirectional:y("shadowMarchTexelDitherScaleDirectional",2),shadowMarchMaxSlopeBiasLocal:y("shadowMarchMaxSlopeBiasLocal",50),shadowMarchRayLengthScaleDirectional:F("shadowMarchRayLengthScaleDirectional",1.5),shadowResolutionLodBiasDirectional:g("shadowResolutionLodBiasDirectional",-1.5,[-16,16]),shadowResolutionLodBiasDirectionalMoving:g("shadowResolutionLodBiasDirectionalMoving",-1.5,[-16,16]),shadowResolutionLodBiasLocal:g("shadowResolutionLodBiasLocal",-1,[-16,16]),shadowResolutionLodBiasLocalMoving:g("shadowResolutionLodBiasLocalMoving",1,[-16,16]),shadowLightActiveFrameCount:P("shadowLightActiveFrameCount",10,1),shadowDenoise:p("shadowDenoise",!0),shadowDenoiseIterations:S("shadowDenoiseIterations",2,[0,4]),shadowDenoiseIterationsDirectional:S("shadowDenoiseIterationsDirectional",1,[0,4])}),Zse=A({shadowRayCountDirectional:S("shadowRayCountDirectional",0,[0,yS]),shadowSamplesPerRayDirectional:S("shadowSamplesPerRayDirectional",4,[0,64]),shadowRayCountLocal:S("shadowRayCountLocal",0,[0,yS]),shadowSamplesPerRayLocal:S("shadowSamplesPerRayLocal",4,[0,64]),shadowMaxPoolPages:P("shadowMaxPoolPages",4096,1),shadowDistantLightMode:S("shadowDistantLightMode",1,[0,2]),shadowMaxDistantUpdatePerFrame:S("shadowMaxDistantUpdatePerFrame",1,[-1,we[1]]),shadowVirtualEnable:pr(p("shadowVirtualEnable",!0),"the translucent surfaces"),shadowCascadeLimit:S("shadowCascadeLimit",10,[0,10]),shadowCascadeBlendScale:g("shadowCascadeBlendScale",1,[0,2]),shadowCascadeMaxResolution:S("shadowCascadeMaxResolution",2048,[1,8192]),shadowCascadeDepthBias:y("shadowCascadeDepthBias",10),shadowCascadeSlopeBias:y("shadowCascadeSlopeBias",3),shadowCascadeReceiverBias:g("shadowCascadeReceiverBias",.9,[0,1]),shadowCascadeSplitSoftness:y("shadowCascadeSplitSoftness",.5),shadowBlendScale:y("shadowBlendScale",60),shadowPointDepthOffset:y("shadowPointDepthOffset",.02),shadowPointSlopeOffset:y("shadowPointSlopeOffset",3),shadowSpotDepthOffset:y("shadowSpotDepthOffset",3),shadowSpotLightSlopeScaleDepthBias:y("shadowSpotLightSlopeScaleDepthBias",3),shadowSlopeBiasCap:y("shadowSlopeBiasCap",1),shadowShowClipmapStats:S("shadowShowClipmapStats",-1,[-1,we[1]]),shadowShowStats:jT("shadowShowStats",""),shadowVisualizeLayout:S("shadowVisualizeLayout",0,[0,2]),shadowVisualizeCachedPagesOnly:p("shadowVisualizeCachedPagesOnly",!1),shadowVisualizeLightName:jT("shadowVisualizeLightName",""),shadowVisualizeOverdrawScale:g("shadowVisualizeOverdrawScale",15,[0,100]),shadowCascadeCaching:p("shadowCascadeCaching",!1),shadowCascadeScrollOverlapLimit:g("shadowCascadeScrollOverlapLimit",.75,[0,1]),shadowMaxCsmScrollingStaticSubjects:S("shadowMaxCsmScrollingStaticSubjects",5,[0,we[1]]),shadowCacheWholeScene:p("shadowCacheWholeScene",!0),shadowMaxPointCacheUpdatesPerFrame:S("shadowMaxPointCacheUpdatesPerFrame",-1,[-1,we[1]]),shadowMaxSpotCacheUpdatesPerFrame:S("shadowMaxSpotCacheUpdatesPerFrame",-1,[-1,we[1]]),shadowWholeSceneCacheMb:P("shadowWholeSceneCacheMb",150,0),shadowCachedCastFromMovable:p("shadowCachedCastFromMovable",!0),shadowSpotBlendScale:y("shadowSpotBlendScale",60),shadowSpotReceiverOffset:g("shadowSpotReceiverOffset",.5,[0,1]),shadowPointLightShadows:p("shadowPointLightShadows",!0),shadowPointLightCubemaps:p("shadowPointLightCubemaps",!0),shadowResolutionScaleZeroDisables:p("shadowResolutionScaleZeroDisables",!0),shadowMaxResolution:S("shadowMaxResolution",2048,[1,8192]),shadowFadeStartSize:P("shadowFadeStartSize",64,0),shadowMinResolution:P("shadowMinResolution",32,0),shadowFadeCurve:g("shadowFadeCurve",.25,R),shadowFadeUsesResolutionScale:p("shadowFadeUsesResolutionScale",!0),shadowTexelsPerPixelPoint:y("shadowTexelsPerPixelPoint",1.27324),shadowTexelsPerPixelSpot:y("shadowTexelsPerPixelSpot",2.54648),shadowTexelsPerPixelRect:y("shadowTexelsPerPixelRect",1.27324),shadowQuality:S("shadowQuality",5,[0,5]),shadowTranslucentQuality:pr(S("shadowTranslucentQuality",0,[0,1])),shadowTranslucentLocalLights:pr(p("shadowTranslucentLocalLights",!1)),translucentRectLights:pr(p("translucentRectLights",!1)),lightMinScreenRadius:y("lightMinScreenRadius",.03),lightCutoffDistanceScale:y("lightCutoffDistanceScale",1),lightDrawRangeFollowsFieldOfView:p("lightDrawRangeFollowsFieldOfView",!0)}),OB=A({...qse,...Xse,...Qse,...Zse}),Jse={shadowMarkCoarsePagesLocal:2,shadowResolutionLodBiasDirectional:0,shadowResolutionLodBiasDirectionalMoving:0,shadowResolutionLodBiasLocal:1,shadowResolutionLodBiasLocalMoving:2,shadowRayCountDirectional:0,shadowSamplesPerRayDirectional:2,shadowRayCountLocal:0,shadowSamplesPerRayLocal:2,shadowMaxPoolPages:512,shadowMaxResolution:512,shadowQuality:0},eae={shadowMarkCoarsePagesLocal:2,shadowResolutionLodBiasDirectional:0,shadowResolutionLodBiasDirectionalMoving:0,shadowResolutionLodBiasLocal:-1,shadowResolutionLodBiasLocalMoving:2,shadowRayCountDirectional:0,shadowSamplesPerRayDirectional:2,shadowRayCountLocal:0,shadowSamplesPerRayLocal:2,shadowMaxPoolPages:512,shadowMaxResolution:1024,shadowQuality:3},tae={shadowMarkCoarsePagesLocal:2,shadowResolutionLodBiasDirectional:-1.5,shadowResolutionLodBiasDirectionalMoving:0,shadowResolutionLodBiasLocal:-1,shadowResolutionLodBiasLocalMoving:1,shadowRayCountDirectional:0,shadowSamplesPerRayDirectional:4,shadowRayCountLocal:0,shadowSamplesPerRayLocal:4,shadowMaxPoolPages:2048,shadowMaxResolution:1024,shadowQuality:5},rae={shadowMarkCoarsePagesLocal:1,shadowResolutionLodBiasDirectional:-1.5,shadowResolutionLodBiasDirectionalMoving:-1.5,shadowResolutionLodBiasLocal:-1,shadowResolutionLodBiasLocalMoving:0,shadowRayCountDirectional:0,shadowSamplesPerRayDirectional:8,shadowRayCountLocal:0,shadowSamplesPerRayLocal:8,shadowMaxPoolPages:8192,shadowMaxResolution:4096,shadowQuality:5},bf={smooth:Jse,balanced:eae,fine:tae,cinematic:rae};var LB=A({distanceFieldDistanceScale:g("distanceFieldDistanceScale",1,[1e-4,1e4]),fieldShadowing:p("fieldShadowing",!0),fieldShadowQuality:S("fieldShadowQuality",3,[0,3]),fieldShadowTileSize:F("fieldShadowTileSize",2,"a finite number of metres above 0"),fieldShadowTwoSidedBias:y("fieldShadowTwoSidedBias",1),fieldShadowObjectsPerTile:P("fieldShadowObjectsPerTile",128,1),fieldShadowCompactTiles:p("fieldShadowCompactTiles",!0),fieldShadowSnapResolution:S("fieldShadowSnapResolution",2048,[32,sn]),fieldShadowFullResolution:p("fieldShadowFullResolution",!1),distanceFieldFarTransitionScale:g("distanceFieldFarTransitionScale",1,[0,1])});var RB=A({contactShadows:p("contactShadows",!0),contactShadowOverrideLength:g("contactShadowOverrideLength",-1,R),contactShadowOverrideLengthInWorldSpace:p("contactShadowOverrideLengthInWorldSpace",!1),contactShadowOverrideCastingIntensity:g("contactShadowOverrideCastingIntensity",-1,R),contactShadowOverrideNonCastingIntensity:g("contactShadowOverrideNonCastingIntensity",-1,R),contactShadowMethod:S("contactShadowMethod",0,[0,1]),contactShadowSurfaceThickness:g("contactShadowSurfaceThickness",.005,[1e-5,1]),contactShadowMaxLights:S("contactShadowMaxLights",8,[1,16]),contactShadowIntensityMode:S("contactShadowIntensityMode",0,[0,2]),contactShadowIntensityFadeStart:g("contactShadowIntensityFadeStart",1600,[0,1e9]),contactShadowIntensityFadeLength:g("contactShadowIntensityFadeLength",800,[1e-4,1e9])});var vB=A({bodyShadows:p("bodyShadows",!0),bodyDirectShadows:p("bodyDirectShadows",!0),bodyIndirectShadows:p("bodyIndirectShadows",!0),bodyShadowsFullResolution:p("bodyShadowsFullResolution",!1),bodyMaxDirectOcclusionDistance:F("bodyMaxDirectOcclusionDistance",4),bodyMaxIndirectOcclusionDistance:F("bodyMaxIndirectOcclusionDistance",2),bodyShadowFadeAngleFromVertical:g("bodyShadowFadeAngleFromVertical",60*ce,[0,Math.PI]),bodyIndirectConeAngle:F("bodyIndirectConeAngle",22.5*ce),bodySkyAngleScale:y("bodySkyAngleScale",.6),bodyMinSkyAngle:F("bodyMinSkyAngle",15),capsuleIndirectSelfShadowingIntensity:g("capsuleIndirectSelfShadowingIntensity",.8,[0,1])}),n4e=e=>e.bodyShadows&&e.bodyDirectShadows,o4e=e=>e.bodyShadows&&e.bodyIndirectShadows,Ra=A({castCapsuleDirectShadow:p("castCapsuleDirectShadow",!1),castCapsuleIndirectShadow:p("castCapsuleIndirectShadow",!1),capsuleIndirectShadowMinVisibility:g("capsuleIndirectShadowMinVisibility",.1,[0,1])}),_B=(e,t)=>Array.isArray(e)&&e.length===t&&e.every(Number.isFinite);function nae(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.bone!="string"||!t.bone||!_B(t.center,3)||typeof t.radius!="number"||!(t.radius>0)?!1:t.kind==="sphere"?!0:t.kind==="capsule"&&typeof t.length=="number"&&t.length>=0&&_B(t.rotation,4)}var MB=e=>Array.isArray(e)&&e.every(nae),DB="a list of { bone, kind: sphere | capsule, center: [x, y, z], radius above 0 } and, for a capsule, a length of at least 0 and a rotation [x, y, z, w]",RO=Object.freeze([]);var PB=A({translucentObjectShadows:p("translucentObjectShadows",!1)}),xS=A({castVolumetricTranslucentShadow:p("castVolumetricTranslucentShadow",!1)});var Oi=A({translucentShadowDensityScale:y("translucentShadowDensityScale",.5),translucentShadowStartOffset:y("translucentShadowStartOffset",100),translucentSelfShadowDensityScale:y("translucentSelfShadowDensityScale",2),translucentSelfShadowSecondDensityScale:y("translucentSelfShadowSecondDensityScale",10),translucentSelfShadowSecondOpacity:y("translucentSelfShadowSecondOpacity",0),translucentBackscatteringExponent:y("translucentBackscatteringExponent",30)}),CB=[1,.833,.588];var IB=A({rayTracedSkyLight:p("rayTracedSkyLight",!1),rayTracedSkyLightAllowed:At("rayTracedSkyLightAllowed",!0,"rayTracingAllowed"),rayTracedSkyLightSamplesPerPixel:S("rayTracedSkyLightSamplesPerPixel",-1,[-1,sn]),rayTracedSkyLightMaxRayDistance:y("rayTracedSkyLightMaxRayDistance",1e7),rayTracedSkyLightMaxShadowThickness:y("rayTracedSkyLightMaxShadowThickness",1e3),rayTracedSkyLightDenoiser:p("rayTracedSkyLightDenoiser",!0),rayTracedSkyLightDenoiserReconstructionSamples:S("rayTracedSkyLightDenoiserReconstructionSamples",16,[1,56]),rayTracedSkyLightDenoiserPreConvolution:S("rayTracedSkyLightDenoiserPreConvolution",1,[0,4]),rayTracedSkyLightDenoiserTemporalAccumulation:p("rayTracedSkyLightDenoiserTemporalAccumulation",!0),rayTracedSkyLightDenoiserHistoryConvolutionSamples:S("rayTracedSkyLightDenoiserHistoryConvolutionSamples",1,[1,56]),rayTracedSkyLightDenoiserHistoryConvolutionKernelSpreadFactor:g("rayTracedSkyLightDenoiserHistoryConvolutionKernelSpreadFactor",3,[0,64]),rayTracedSkyLightTwoSidedGeometry:p("rayTracedSkyLightTwoSidedGeometry",!0),rayTracedSkyLightMaterials:p("rayTracedSkyLightMaterials",!0),rayTracedSkyLightDecoupleSampleGeneration:p("rayTracedSkyLightDecoupleSampleGeneration",!0),rayTracedSkyLightHairVoxel:p("rayTracedSkyLightHairVoxel",!0),rayTracedSkyLightHairOcclusionThreshold:y("rayTracedSkyLightHairOcclusionThreshold",1),rayTracedSkyLightScreenPercentage:g("rayTracedSkyLightScreenPercentage",100,U(0))}),oae=(e,t)=>e.rayTracedSkyLightSamplesPerPixel>=0?e.rayTracedSkyLightSamplesPerPixel:Math.max(t.samplesPerPixel,2),u4e=(e,t)=>e.rayTracedSkyLightAllowed&&(t.castRayTracedShadow==="enabled"||t.castRayTracedShadow==="useProjectSetting"&&e.rayTracedSkyLight)&&oae(e,t)>0,d4e=e=>e.rayTracedSkyLightDenoiser?Math.trunc(1/k(e.rayTracedSkyLightScreenPercentage/100,.25,1)):1;var kB=100,_a=A({shadowDistanceScale:g("shadowDistanceScale",1,[0,2]),farShadowCulling:p("farShadowCulling",!0),shadowNearLevels:S("shadowNearLevels",10,[0,10]),shadowOverlapScale:g("shadowOverlapScale",1,[0,2]),shadowFarField:p("shadowFarField",!0),shadowMultipassViews:p("shadowMultipassViews",!0),shadowGeometryLodBias:g("shadowGeometryLodBias",.5,[-kB,kB]),shadowOcclusionCulling:p("shadowOcclusionCulling",!0),shadowDynamicHzb:p("shadowDynamicHzb",!1),shadowOcclusionFullUpdate:p("shadowOcclusionFullUpdate",!1),...LB,...RB,...vB,...PB,...iB,...IB,...OB}),Ef={smooth:{shadowDistanceScale:.6,shadowNearLevels:1,shadowOverlapScale:0,shadowFarField:!1,...bf.smooth},balanced:{shadowDistanceScale:.7,shadowNearLevels:1,shadowOverlapScale:.25,shadowFarField:!1,...bf.balanced},fine:{shadowDistanceScale:.85,shadowNearLevels:4,shadowOverlapScale:.8,shadowFarField:!0,...bf.fine},cinematic:{shadowDistanceScale:1,shadowNearLevels:10,shadowOverlapScale:1,shadowFarField:!0,...bf.cinematic}},b4e=X(_a);var FB=.02,NB=Math.SQRT1_2,L4e=(e,t)=>t<NB?e*t:e/(2*t),BB=(e,t)=>t<NB?e*Math.sqrt(1-t*t):e/(2*t),UB=Object.freeze({lightMinScreenRadius:_a.lightMinScreenRadius.default,lightCutoffDistanceScale:_a.lightCutoffDistanceScale.default});function VB(e,t){return t.lightMinScreenRadius>0?e>0?Math.min(FB,t.lightMinScreenRadius/e):FB:0}var GB=(e,t)=>e>0?Math.max(e*t.lightCutoffDistanceScale,jF):0;function R4e(e,t,r,n){let o=t*n;return o*o*e<1&&(!(r>0)||e<Math.fround(r*r))}function _4e(e,t,r){return!(t>0)||!(r>0)?1:Ar((t-Math.sqrt(e))/r)}var wt=e=>pf+e*bi,J={position:0,range:3,color:4,intensity:7,direction:8,cosCone:11,kind:12,shadowSlice:13,fogScattering:14,cosInner:15,halfWidth:16,halfHeight:19,emitterRadius:16,radialExponent:17,shares:18,rectShares:22,angularRadius:16,emitterAxis:20,softRadius:23,contactGi:24,exposureBlend:28,tubeHalfLength:29,sourceTerm:30,barnDoorCosine:29,barnDoorLength:30,rectAtlasOriginX:20,rectAtlasOriginY:21,rectAtlasWidth:15,rectAtlasHeight:31,simpleWord:31},bS={classic:1,sampledShadow:2,translucency:4},j4e={hair:1,classicShift:1},ES={x:0,y:0,width:0,height:0},jB=(e,t)=>({x:e[t+J.rectAtlasOriginX],y:e[t+J.rectAtlasOriginY],width:e[t+J.rectAtlasWidth],height:e[t+J.rectAtlasHeight]});function vO(e,t,r){e[t+J.rectAtlasOriginX]=r.x,e[t+J.rectAtlasOriginY]=r.y,e[t+J.rectAtlasWidth]=r.width,e[t+J.rectAtlasHeight]=r.height}var HB=-2,iae=.01,_O=(e,t)=>Math.max(iae,e.size[t]),MO=e=>[_O(e,0),_O(e,1)];function $4e(e,t){e.kind==="rect"?t.sourceRadius=_O(e,0)/2:t.sourceRadius=e.emitterRadius??0}var Fo=6500,va=e=>tB(e.color,{useTemperature:e.useTemperature===!0,temperatureKelvin:e.temperatureKelvin??Fo}),TS=e=>e.diffuseShare??1,AS=e=>e.inverseExposureBlend??0,Hr=.5,OS=e=>e.maxDrawDistance??0,LS=e=>e.maxDistanceFadeRange??0,RS=e=>e.specularShare??1,_S=e=>e.inverseSquared??!0,vS=e=>e.radialExponent??Ot.radialExponent,Af=44*ce,Ma=0,_c=e=>e.innerConeAngle??Ma,$B=e=>gO(_c(e),e.outerConeAngle),Y4e=(e,t)=>SO(_c(e),e.outerConeAngle,t),sae=10,WB=5e3,Of=e=>e.intensityUnits??Ti;function YB(e){return e.kind==="rect"?.5:e.kind!=="spot"?-1:Math.cos(gO(_c(e),e.outerConeAngle??Af)[1])}function MS(e){if(e.kind==="rect"){let[r,n]=MO(e);return r*n}let t=e.emitterRadius??0;return 2*Q*t*(t+.5*(e.emitterLength??0))}var Da=e=>e.kind==="rect"||e.kind!=="directional"&&e.inverseSquared!==!1;function DO(e){if(e.kind==="directional")return sae;let t=Of(e),r=YB(e);if(t!=="ev"&&t!=="nits")return WB*dO("unitless",t,r);let n=WB*dO("unitless","candelas",r);return Da(e)?t==="ev"?Math.log2(n):n/MS(e):n}var DS=e=>e.intensity??DO(e);function Ss(e){let t=wB(e,DS(e));if(!Da(e))return t;let r=oB(t,Of(e),MS(e),Q*(1-YB(e)));if(e.kind!=="rect")return r;let[n,o]=MO(e);return r/(.5*n*o)}var vc=e=>Ss(e)*Ge(rc,va(e)),Mc=e=>e.sunDiskTint??[1,1,1],PS=e=>e.fogScattering??1,CS=e=>e.shadowsFog??e.kind==="directional",IS=e=>e.transmission===!0&&e.castsShadow&&kS(e)!=="static",kS=e=>e.mobility??Ta,PO=e=>e.shadowResolutionScale??1,Dc=e=>e.lightGroups?sS(e.lightGroups):bc,CO=(e,t,r,n=0)=>hf[e.kind]+(e.castsShadow?lS.castsShadow:0)+(CS(e)?lS.shadowsFog:0)+(IS(e)?lS.transmission:0)+(ZA(Dc(e))<<tO)+(gB(e,r>0,t.dynamicShadows)<<rO)+(n<<gf)+r*2**Sf+nO>>>0,Pa=e=>e.atmosphereSunIndex??0,Lf=e=>e.forwardShadingPriority??0;function Tf(e,t,r){e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2]}var aae=.2,lae=e=>{let t=Math.max(e.emitterRadius??0,e.emitterLength??0);return Ar(1-t*(1/aae))},cae=e=>e.kind==="directional"?Math.sin(Math.fround(e.angularRadius??Ot.sunAngularRadius)):lae(e);function uae(e){let t=e.range??0;return e.kind!=="spot"?t:BB(t,Math.cos($B(e)[1]))}var Pc=4,dae=0,fae=1,pae=2,IO=3;function kO(e,t,r,n){let o=r.kind==="directional",i=t*Pc;e[i+dae]=o?0:VB(uae(r),n),e[i+fae]=o?0:GB(OS(r),n),e[i+pae]=o?0:LS(r)*n.lightCutoffDistanceScale,e[i+IO]=Ss(r)}function FS(e,t,r,n=0,o=0,i=ES){let{packed:s}=e;Tf(s,t+J.position,r.position??[0,0,0]),s[t+J.range]=r.range??0,Tf(s,t+J.color,va(r)),s[t+J.intensity]=Ss(r),Tf(s,t+J.direction,r.direction??[0,-1,0]);let a=r.kind==="spot",[l,c]=a?$B(r):[0,0];s[t+J.cosCone]=a?Math.cos(c):HB,e.words[t+J.kind]=CO(r,e.shadowView,n,o),s[t+J.fogScattering]=PS(r),s[t+J.cosInner]=a?Math.cos(l):HB;let[u,d]=r.size?MO(r):[0,0];Tf(s,t+J.halfWidth,(r.right??[0,0,0]).map(h=>h*u/2)),s[t+J.halfHeight]=d/2,r.kind==="directional"&&(s[t+J.angularRadius]=r.angularRadius??Ot.sunAngularRadius),r.kind!=="rect"&&(s[t+J.sourceTerm]=cae(r)),r.kind==="point"||a?(s[t+J.emitterRadius]=r.emitterRadius??0,s[t+J.radialExponent]=_S(r)?0:vS(r),zB(s,t,r)):zB(s,t,{}),r.kind==="directional"&&(s[t+J.softRadius]=Math.sin(.5*(r.softAngle??0)*ce));let f=t+(r.kind==="rect"?J.rectShares:J.shares);if(s[f]=TS(r),s[f+1]=RS(r),s[t+J.exposureBlend]=AS(r),r.kind==="rect"){vO(s,t,i);let h=EB(r);s[t+J.barnDoorCosine]=h,s[t+J.barnDoorLength]=h>0?xf(r):0}else s[t+J.rectAtlasHeight]=0;NS(s,t,r,e.contactView)}function NS(e,t,r,n){let o=t+J.contactGi,i=Oa(r);hB(e,o,i,n),e[o+3]=i.indirectLightingIntensity}function zB(e,t,r){let n=r.emitterLength!==void 0||r.iesProfile!==void 0;Tf(e,t+J.emitterAxis,n?r.emitterAxis??[0,1,0]:[0,0,0]),e[t+J.tubeHalfLength]=(r.emitterLength??0)/2,e[t+J.softRadius]=r.emitterSoftRadius??0}var KB=new WeakSet;function W(e,...t){class r{}KB.add(r.prototype);for(let n of[e,...t]){let o=Object.getPrototypeOf(n);if(KB.has(o)){let{constructor:i,...s}=Object.getOwnPropertyDescriptors(o);Object.defineProperties(r.prototype,s)}Object.defineProperties(r.prototype,Object.getOwnPropertyDescriptors(n))}return new r}var hae=1e-6,mae=1e-4,gae=-1,qB=1,Sae=8,wae={channel0:!0,channel1:!0,channel2:!0},XB=e=>Number.isInteger(e)&&e>=0,QB=e=>e.lightId&&`${e.lightId.sourcePrimitiveId}:${e.lightId.localId}`;function yae(e,t){let r=s=>{throw new E("INVALID_SCENE_LIGHT",`simple light ${t}: invalid ${s}`,{field:s,value:e?.[s]})};(e===null||typeof e!="object")&&r("entry");let n=(s,a)=>Array.isArray(s)&&s.length===3&&s.every(l=>K(l)&&(!a||l>=0));n(e.position,!1)||r("position"),n(e.color,!0)||r("color"),(!K(e.radius)||e.radius<0)&&r("radius");for(let s of["exponent","volumetricScatteringIntensity","specularScale","diffuseScale"]){let a=e[s];a!==void 0&&!(K(a)&&a>=0)&&r(s)}for(let s of["affectsTranslucency","allowSampledLighting","sampledCastsShadow"])e[s]!==void 0&&typeof e[s]!="boolean"&&r(s);let o=e.lightId;o!==void 0&&!(XB(o?.localId)&&XB(o?.sourcePrimitiveId))&&r("lightId");let i=e.inverseExposureBlend;i!==void 0&&!(K(i)&&i>=0&&i<=1)&&r("inverseExposureBlend")}var xae=(e,t)=>Be(e.position,t.position)&&Be(e.color,t.color)&&e.radius===t.radius&&e.exponent===t.exponent&&e.inverseExposureBlend===t.inverseExposureBlend&&e.volumetricScatteringIntensity===t.volumetricScatteringIntensity&&e.specularScale===t.specularScale&&e.diffuseScale===t.diffuseScale&&e.affectsTranslucency===t.affectsTranslucency&&e.allowSampledLighting===t.allowSampledLighting&&e.sampledCastsShadow===t.sampledCastsShadow&&e.lightId?.localId===t.lightId?.localId&&e.lightId?.sourcePrimitiveId===t.lightId?.sourcePrimitiveId,bae=e=>({...e,position:[...e.position],color:[...e.color],...e.lightId&&{lightId:{...e.lightId}}});function Eae(e){let t=e.exponent??0,r=t===0;return{id:"simple",kind:"point",position:e.position,range:Math.max(e.radius,hae),color:e.color,intensity:r?mae:1,intensityUnits:"candelas",inverseSquared:r,...r?{}:{radialExponent:t},diffuseShare:e.diffuseScale??1,specularShare:e.specularScale??1,inverseExposureBlend:e.inverseExposureBlend??0,fogScattering:e.volumetricScatteringIntensity??0,lightGroups:wae,castsShadow:!1,mobility:"movable",indirectLightingIntensity:0}}var Tae=e=>e.radius>1e-4||Math.max(e.color[0],e.color[1],e.color[2])>1e-4;function ZB(e,t){for(let r in e){let n=r;if(e[n]!==t[n])return!1}return!0}function JB(e){let t=new Float32Array(0),r=new Uint32Array(t.buffer),n=[],o=0,i=[],s=new Uint8Array(0),a=new Uint8Array(0),l=new Uint8Array(0),c=[],u=0,d=0,f=!0,h=!0,m=qB,w={contactView:{...e.contactView},shadowView:{...e.shadowView}};function x(){let b={packed:t,words:r,contactView:e.contactView,shadowView:e.shadowView};u=0,n.forEach((T,L)=>{let _=L*bi;FS(b,_,T),t[_+J.shadowSlice]=gae;let D=m===2||m===1&&a[L]===1;D||u++,t[_+J.simpleWord]=(D?0:bS.classic)|(D&&l[L]===1?bS.sampledShadow:0)|(s[L]===1?bS.translucency:0)}),Object.assign(w.contactView,e.contactView),Object.assign(w.shadowView,e.shadowView)}return W({set(b){b.forEach(yae);let T=new Set;for(let[_,D]of b.entries()){let C=QB(D);if(C!==void 0){if(T.has(C))throw new E("INVALID_SCENE_LIGHT",`simple light ${_}: lightId ${C} is already given to another light`,{field:"lightId",value:D.lightId});T.add(C)}}let L=b.filter(Tae);return L.length===i.length&&L.every((_,D)=>xae(_,i[D]))?!1:(i=L.map(bae),L.length*bi>t.length&&(t=new Float32Array(Lr(t.length,Math.max(L.length,Sae)*bi)),r=new Uint32Array(t.buffer),s=new Uint8Array(t.length/bi),a=new Uint8Array(s.length),l=new Uint8Array(s.length)),n=L.map(Eae),c=L.map(QB),L.forEach((_,D)=>{s[D]=_.affectsTranslucency?1:0,a[D]=_.allowSampledLighting?1:0,l[D]=_.sampledCastsShadow?1:0}),o=L.length,x(),d++,!0)},configure(b,T,L=qB){f===b&&h===T&&m===L||(f=b,h=T,m=L,x(),d++)},fold(){ZB(w.contactView,e.contactView)&&ZB(w.shadowView,e.shadowView)||(x(),d++)},get count(){return f?o:0},get classicCount(){return f?u:0},identityOf:b=>c[b],get capacity(){return t.length/bi},get packed(){return t},get hairLit(){return h},affectsTranslucency:b=>s[b]===1,get epoch(){return d}})}var s5e=12,a5e=8796093022208e-2,Li=A({shaftOcclusion:p("shaftOcclusion",!1),shaftOcclusionDarkness:g("shaftOcclusionDarkness",.05,R),shaftOcclusionDepthRange:g("shaftOcclusionDepthRange",1e3,R),shaftOverrideDirection:ze("shaftOverrideDirection",[0,0,0]),shaftBloom:p("shaftBloom",!1),shaftBloomScale:g("shaftBloomScale",.2,R),shaftBloomThreshold:g("shaftBloomThreshold",0,R),shaftBloomMaxBrightness:g("shaftBloomMaxBrightness",100,R),shaftBloomTint:Mt("shaftBloomTint",[1,1,1])}),BS=e=>ue(Li,Xe(e,Object.keys(Li),"the light shafts of a light",oe("light shafts")));function l5e(e,t,r){let n=e.shaftOverrideDirection,o=n[0],i=n[1],s=n[2],a=o*o+i*i+s*s;if(!(a>0))return r[0]=t[0],r[1]=t[1],r[2]=t[2],r;let l=Math.sqrt(a);return r[0]=o/l,r[1]=i/l,r[2]=s/l,r}var FO=Oc(Li,BS,["shaftOcclusion","shaftOcclusionDarkness","shaftOcclusionDepthRange","shaftOverrideDirection"]);function eU(e,t){FO.validate(e,t);let r=t.shaftBloomTint;if(r?.some(n=>n<0))throw new E("INVALID_SCENE_LIGHT",`${e.id}: shaftBloomTint expects channels of at least 0`,{shaftBloomTint:r})}var p5e=e=>FO.of(e),tU=(e,t)=>FO.same(e,t);var rU=A({intensity:y("intensity",1),rotation:g("rotation",0,R),visible:p("visible",!0)}),Aae=["2d","data"];function nU(e){let t=oe("backdrop"),r=Xe(e,[...Object.keys(rU),"map"],"the backdrop part",t),n=ue(rU,r),o=r.map;if(o!=null)return!no(o)||!Aae.includes(o.layout)?t("map takes the texture of an equirectangular picture, or of raw texels"):{settings:n,map:o}}var y5e=e=>!!e?.settings.visible,x5e=e=>e.settings.rotation*ce;var NO=A({layoutRepeatKm:F("layoutRepeatKm",256,"a finite number of kilometres above 0"),placement:ze("placement",[0,0,0,0]),typeWeights:ze("typeWeights",[1,1,1,2]),typePatternScale:ze("typePatternScale",[1,1,1,1]),maskTypeWeights:ze("maskTypeWeights",[0,0,0,1]),coverageBias:g("coverageBias",-.2,R),wind:ze("wind",[1,1,.5,.333333]),erosionNoise:ze("erosionNoise",[4.167,4.444,9.091,7]),distortionNoise:ze("distortionNoise",[60,60,75,-6]),detailNoise:ze("detailNoise",[30,40,25,8]),detailNoiseMultiplier:ze("detailNoiseMultiplier",[0,0,1,.4]),thirdNoise:p("thirdNoise",!1),noiseBias:ze("noiseBias",[.5,.8,.5]),noiseStrength:ze("noiseStrength",[.8,.08,.03,2.5]),densityPerMetre:g("densityPerMetre",.008,R),albedo:Mt("albedo",[.98,.98,.98]),ambientOcclusion:g("ambientOcclusion",.5,R),stormAmount:g("stormAmount",0,R),stormAlbedo:Mt("stormAlbedo",[.3,.3375,.375]),stormOcclusionFactor:g("stormOcclusionFactor",.333333,R),lightningTextureScale:g("lightningTextureScale",6,R),lightningColor:ze("lightningColor",[2,1.8,2,10]),lightningSource:ze("lightningSource",[6,.05,.175,2.5]),lightningMasks:ze("lightningMasks",[10,5,.5,1]),lightningAnimation:ze("lightningAnimation",[0,.1,0,1]),phaseForwardAnisotropy:g("phaseForwardAnisotropy",.8,[-.999,.999]),phaseSecondAnisotropy:g("phaseSecondAnisotropy",.166667,[-.999,.999]),phaseBlend:g("phaseBlend",.575,[0,1]),multiScatterContribution:g("multiScatterContribution",.666667,[0,1]),multiScatterOcclusion:g("multiScatterOcclusion",.25,[0,1]),multiScatterEccentricity:g("multiScatterEccentricity",.18,[0,1]),multiScatterOctaves:S("multiScatterOctaves",2,[0,2]),groundContribution:p("groundContribution",!1),rayMarchVolumeShadow:p("rayMarchVolumeShadow",!0)}),T5e=({wind:e,stormAmount:t})=>(e[0]!==0||e[1]!==0||e[2]!==0)&&e[3]!==0||t!==0;var No=[-2147483648,2147483647],Rf=[0,2147483647],Ri=[4,2147483647];var US=A({lightShafts:p("lightShafts",!0),lightShaftDownsample:S("lightShaftDownsample",2,[1,8]),lightShaftTemporalFilter:p("lightShaftTemporalFilter",!0),lightShaftSmoothPasses:S("lightShaftSmoothPasses",3,Rf),lightShaftFirstStepDistance:g("lightShaftFirstStepDistance",.1,R)}),BO=A({skyLightRealTimeCapture:p("skyLightRealTimeCapture",!0),skyLightTimeSlicing:p("skyLightTimeSlicing",!0),skyLightFacesPerFrame:S("skyLightFacesPerFrame",2,[1,6]),skyLightCloudDivider:S("skyLightCloudDivider",2,[1,8]),skyLightIntensityScale:g("skyLightIntensityScale",1,R),skyLightShadowFromOpaque:p("skyLightShadowFromOpaque",!1),skyLightAlwaysClear:p("skyLightAlwaysClear",!1),skyLightDepthBuffer:p("skyLightDepthBuffer",!0),skyLightResolutionOverride:S("skyLightResolutionOverride",0,No),skyLightCubemapSizeLimit:S("skyLightCubemapSizeLimit",-1,No),skyLightCaptureSupersample:S("skyLightCaptureSupersample",1,[1,8]),skyLightCaptureDetailDistanceScale:g("skyLightCaptureDetailDistanceScale",1,R)});var Oae=["quarterToHalf","half","quarterToFull","full"],Lae=["bilinear","bilinearJitter","nearestDepth","bilinearJitterClosest","bilateral"],Rae=["none","conservativeDensity","emptySpaceSkipping"],Ca=1e5,_ae=A({atmosphereOn:p("atmosphereOn",!0),cloudsOn:p("cloudsOn",!0),skyTableFast:p("skyTableFast",!0),aerialFastOnOpaque:p("aerialFastOnOpaque",!0),atmosphereSamplesMin:g("atmosphereSamplesMin",4,U(1)),atmosphereSamplesMax:g("atmosphereSamplesMax",128,U(1)),atmosphereDistanceToMaxSamplesKm:g("atmosphereDistanceToMaxSamplesKm",150,U(1e-4)),atmosphereSampleLightShadowMap:p("atmosphereSampleLightShadowMap",!0),skyTableSamplesMin:g("skyTableSamplesMin",4,U(1)),skyTableSamplesMax:g("skyTableSamplesMax",128,U(1)),skyTableDistanceToMaxSamplesKm:g("skyTableDistanceToMaxSamplesKm",150,U(1e-4)),aerialSamplesPerSlice:g("aerialSamplesPerSlice",4,U(1)),aerialDepthSlices:S("aerialDepthSlices",16,Ri),aerialDepthKm:g("aerialDepthKm",96,U(1)),aerialWidth:S("aerialWidth",32,Ri),aerialDepthTest:p("aerialDepthTest",!0),transmittanceSamples:g("transmittanceSamples",10,U(1)),multiScatterSamples:g("multiScatterSamples",15,U(1)),transmittanceSmallFormat:p("transmittanceSmallFormat",!1),transmittanceTable:p("transmittanceTable",!0),distantSkyLightTable:p("distantSkyLightTable",!0),multiScatterHighQuality:p("multiScatterHighQuality",!1),distantSkyLightAltitudeKm:g("distantSkyLightAltitudeKm",6,R),skyTablesFullPrecision:p("skyTablesFullPrecision",!1),transmittanceWidth:S("transmittanceWidth",256,Ri),transmittanceHeight:S("transmittanceHeight",64,Ri),multiScatterWidth:S("multiScatterWidth",32,Ri),multiScatterHeight:S("multiScatterHeight",32,Ri),skyTableWidth:S("skyTableWidth",192,Ri),skyTableHeight:S("skyTableHeight",104,Ri)}),vae=A({cloudViewSamplesMax:g("cloudViewSamplesMax",768,R),cloudReflectionSamplesMax:g("cloudReflectionSamplesMax",80,R),cloudShadowSamplesMax:g("cloudShadowSamplesMax",80,R),cloudReflectionShadowSamplesMax:g("cloudReflectionShadowSamplesMax",24,R),cloudSamplesMin:S("cloudSamplesMin",2,Rf),cloudSamplesClamp:S("cloudSamplesClamp",No[1],Rf),cloudDistanceToMaxSamplesKm:g("cloudDistanceToMaxSamplesKm",15,U(1/Ca)),cloudStepOnEmpty:S("cloudStepOnEmpty",1,[1,No[1]]),cloudSampleLightShadowMap:p("cloudSampleLightShadowMap",!0),cloudAerialPerspective:p("cloudAerialPerspective",!0),cloudAtmosphericLights:p("cloudAtmosphericLights",!0),cloudDistantSkyLight:p("cloudDistantSkyLight",!0),cloudHighQualityAerial:p("cloudHighQualityAerial",!1),cloudFogOnAllPixels:p("cloudFogOnAllPixels",!1),cloudLocalLights:p("cloudLocalLights",!1),cloudLocalLightShadowSamples:g("cloudLocalLightShadowSamples",12,R)}),Mae=A({cloudShadowMap:p("cloudShadowMap",!0),cloudShadowOnTranslucent:pr(p("cloudShadowOnTranslucent",!1)),cloudShadowMapResolutionMax:S("cloudShadowMapResolutionMax",2048,No),cloudShadowMapSamplesMax:g("cloudShadowMapSamplesMax",128,R),cloudShadowMapHorizonMultiplier:g("cloudShadowMapHorizonMultiplier",2,U(1)),cloudShadowMapSpatialFiltering:S("cloudShadowMapSpatialFiltering",1,No),cloudShadowMapNewFrameWeight:g("cloudShadowMapNewFrameWeight",1,R),cloudShadowMapLightRotationCutDegrees:g("cloudShadowMapLightRotationCutDegrees",10,R),cloudShadowMapSnapKm:g("cloudShadowMapSnapKm",20,R),cloudShadowMapSnapToPixelGrid:p("cloudShadowMapSnapToPixelGrid",!0),cloudShadowMapDebug:p("cloudShadowMapDebug",!1),cloudShadowMapLightDistanceOverrideKm:g("cloudShadowMapLightDistanceOverrideKm",0,R),cloudSkyAO:p("cloudSkyAO",!0),cloudSkyAOResolutionMax:S("cloudSkyAOResolutionMax",2048,No),cloudSkyAOTraceSamples:S("cloudSkyAOTraceSamples",10,No),cloudSkyAOFiltering:p("cloudSkyAOFiltering",!0),cloudSkyAOSnapKm:g("cloudSkyAOSnapKm",20,R),cloudSkyAODebug:p("cloudSkyAODebug",!1)}),Dae=A({cloudEmptySpaceSkipping:p("cloudEmptySpaceSkipping",!1),cloudEmptySpaceSkippingDepthKm:g("cloudEmptySpaceSkippingDepthKm",40,R),cloudEmptySpaceSkippingSliceBias:g("cloudEmptySpaceSkippingSliceBias",0,R),cloudEmptySpaceSkippingCorners:p("cloudEmptySpaceSkippingCorners",!0),cloudDebugView:N("cloudDebugView","none",Rae),cloudTraceSize:N("cloudTraceSize","quarterToHalf",Oae),cloudRenderTarget:p("cloudRenderTarget",!0),cloudUpsampling:N("cloudUpsampling","bilateral",Lae),cloudRenderTargetScale:g("cloudRenderTargetScale",1,R),cloudReprojectionBoxConstraint:p("cloudReprojectionBoxConstraint",!1),cloudReprojectionMinDistanceKm:y("cloudReprojectionMinDistanceKm",0),cloudDisocclusionMaxDistanceKm:y("cloudDisocclusionMaxDistanceKm",5),cloudFogLate:p("cloudFogLate",!0),cloudFogLateOnTranslucent:p("cloudFogLateOnTranslucent",!1),cloudSoftBlendingDistanceOnTranslucent:g("cloudSoftBlendingDistanceOnTranslucent",.5,R)}),oU={..._ae,...vae,...Mae,...Dae},UO={effects:oU,imageEffects:US,indirectLight:BO},VS={...oU,...US,...BO},_f=ue(VS,{});var cU=["layerEntry","eye"],iU=A({baseAltitudeKm:g("baseAltitudeKm",5,R),thicknessKm:g("thicknessKm",10,U(.1)),farthestEntryKm:g("farthestEntryKm",350,U(1)),nearestStartKm:y("nearestStartKm",0),marchLengthFrom:N("marchLengthFrom","layerEntry",cU),marchLengthKm:g("marchLengthKm",50,U(.1)),planetRadiusKm:g("planetRadiusKm",6360,[.1,1e4]),groundAlbedo:Mt("groundAlbedo",[.4019778,.4019778,.4019778]),sunTintPerSample:p("sunTintPerSample",!1),viewSamplesScale:g("viewSamplesScale",1,U(.05)),reflectionSamplesScale:g("reflectionSamplesScale",1,U(.05)),shadowSamplesScale:g("shadowSamplesScale",1,U(.05)),reflectionShadowSamplesScale:g("reflectionShadowSamplesScale",1,U(.05)),shadowRayLengthKm:g("shadowRayLengthKm",15,U(.01)),opaqueBelow:g("opaqueBelow",.005,[0,1]),hazeRayleighStartKm:y("hazeRayleighStartKm",0),hazeRayleighFadeKm:y("hazeRayleighFadeKm",0),hazeMieStartKm:y("hazeMieStartKm",0),hazeMieFadeKm:y("hazeMieFadeKm",0),alphaHole:p("alphaHole",!1),inMainView:p("inMainView",!0),inSkyCapture:p("inSkyCapture",!0)}),sU=96,aU=10,Pae=2,lU=1e-5,Cae=.1,GS=(e,t,r)=>Tr(t*e,Pae,r);function uU(e,t){return{farthestEntryCm:Math.max(0,Ca*e.farthestEntryKm),nearestStartCm:Math.max(0,Ca*e.nearestStartKm),nearestStartKm:Math.max(0,e.nearestStartKm),marchLengthCm:Math.max(0,Ca*e.marchLengthKm),marchLengthFrom:cU.indexOf(e.marchLengthFrom),viewSamplesMost:GS(e.viewSamplesScale,sU,t.cloudViewSamplesMax),shadowSamplesMost:GS(e.shadowSamplesScale,aU,t.cloudShadowSamplesMax),shadowRayLengthCm:Ca*Math.max(Cae,e.shadowRayLengthKm),reflectionSamplesMost:GS(e.reflectionSamplesScale,sU,t.cloudReflectionSamplesMax),reflectionShadowSamplesMost:GS(e.reflectionShadowSamplesScale,aU,t.cloudReflectionShadowSamplesMax),samplesMin:Math.max(0,t.cloudSamplesMin),samplesClamp:Math.max(0,t.cloudSamplesClamp),samplesDistanceInverse:1/Math.max(1,Ca*t.cloudDistanceToMaxSamplesKm),stepOnEmpty:Math.max(t.cloudStepOnEmpty,1),hazeRayleighFadeInverse:1/Math.max(e.hazeRayleighFadeKm,lU),hazeMieFadeInverse:1/Math.max(e.hazeMieFadeKm,lU)}}var B5e=e=>e.hazeRayleighStartKm>0||e.hazeMieStartKm>0;function dU(e,t){let r=[...Object.keys(iU),...Object.keys(NO)],n=Xe(e,r,"the clouds part",oe("clouds")),o=ue(iU,n);return{settings:o,material:ue(NO,n),quality:t,gpu:uU(o,t)}}var fU=(e,t)=>({...e,quality:t,gpu:uU(e.settings,t)});var Bo=A({shadowsClouds:p("shadowsClouds",!1),castCloudShadows:p("castCloudShadows",!1),cloudShadowStrength:y("cloudShadowStrength",1),cloudShadowOnAtmosphereStrength:y("cloudShadowOnAtmosphereStrength",1),cloudShadowOnSurfaceStrength:y("cloudShadowOnSurfaceStrength",1),cloudShadowDepthBiasKm:g("cloudShadowDepthBiasKm",0,R),cloudShadowExtentKm:g("cloudShadowExtentKm",150,U(1)),cloudShadowResolutionScale:g("cloudShadowResolutionScale",1,U(.25)),cloudShadowRaySamplesScale:g("cloudShadowRaySamplesScale",1,U(.25)),cloudScatteredLuminanceScale:eo("cloudScatteredLuminanceScale",[1,1,1],U(0))}),vf=e=>ue(Bo,Xe(e,Object.keys(Bo),"the cloud shadow of a light",oe("cloud shadow"))),W5e=(e,t)=>e.shadowsClouds&&t===0,z5e=(e,t)=>e.cloudShadowMap&&t!==void 0&&t.castCloudShadows&&t.cloudShadowStrength>0,Iae=32,kae=512,Fae=16,Nae=4,Bae=(e,t)=>Tr(Math.trunc(kae*e),1,t),j5e=(e,t)=>e===void 0?Iae:Bae(e.cloudShadowResolutionScale,t),$5e=(e,t)=>Tr(Fae*e.cloudShadowRaySamplesScale,Nae,t);var pU=1024,hU=["cubemap","cubemapBlend"];function Cc(e,t,r){if(!Pe(e))return r(`${t} must be an object of size, texels`);let{size:n,texels:o}=e;if(!Number.isInteger(n)||n<1||n>pU)return r(`${t}.size must be a whole number from 1 to ${pU}`);let i=6*n**2*3,s=o;return!s||s.length!==i?r(`${t}.texels expects ${i} numbers, six faces of ${n}\xB2 texels`):ZT(n,s)??r(`${t}.texels expects finite numbers \u2265 0`)}var VO=e=>EN(e.texels);function mU(e,t){if(!Pe(e))return t("cubemapBlend must be an object of destination, fraction");let{destination:r,fraction:n}=e;return typeof n!="number"||!Number.isFinite(n)?t("cubemapBlend.fraction must be a finite number"):{destination:Cc(r,"cubemapBlend.destination",t),fraction:n}}var Uae=["capturedScene","specifiedCubemap"],Vae=["minimum","multiply"],GO=A({realTimeCapture:p("realTimeCapture",!0),mobility:N("mobility","movable",ff),intensity:g("intensity",1,R),color:Mt("color",[1,1,1]),volumetricScatteringIntensity:g("volumetricScatteringIntensity",1,R),cubemapResolution:S("cubemapResolution",128,U(1)),lowerHemisphereIsSolidColor:p("lowerHemisphereIsSolidColor",!1),lowerHemisphereColor:Mt("lowerHemisphereColor",[0,0,0]),lowerHemisphereCoverage:g("lowerHemisphereCoverage",1,[0,1]),sourceType:N("sourceType","capturedScene",Uae),sourceCubemapAngle:g("sourceCubemapAngle",0,R),skyDistanceThreshold:g("skyDistanceThreshold",15e4,R),captureEmissiveOnly:p("captureEmissiveOnly",!1),occlusionMaxDistance:g("occlusionMaxDistance",1e3,R),contrast:g("contrast",0,R),occlusionExponent:g("occlusionExponent",1,R),minOcclusion:g("minOcclusion",0,R),occlusionTint:Mt("occlusionTint",[0,0,0]),occlusionCombineMode:N("occlusionCombineMode","minimum",Vae),cloudAmbientOcclusion:p("cloudAmbientOcclusion",!1),cloudAmbientOcclusionStrength:y("cloudAmbientOcclusionStrength",1),cloudAmbientOcclusionExtentKm:g("cloudAmbientOcclusionExtentKm",150,U(1)),cloudAmbientOcclusionMapResolutionScale:g("cloudAmbientOcclusionMapResolutionScale",1,U(.25)),cloudAmbientOcclusionApertureScale:g("cloudAmbientOcclusionApertureScale",.05,[0,1]),affectsWorld:p("affectsWorld",!0),castShadows:p("castShadows",!0),castVolumetricShadow:p("castVolumetricShadow",!0),castRayTracedShadow:N("castRayTracedShadow","useProjectSetting",fS),samplesPerPixel:S("samplesPerPixel",4,U(1)),transmission:p("transmission",!1)});function SU(e,t){let r=oe("skyLight"),n=Xe(e,[...Object.keys(GO),...hU],"the sky light part",r);return{light:ue(GO,n),quality:t,...n.cubemap!==void 0&&{cubemap:Cc(n.cubemap,"cubemap",r)},...n.cubemapBlend!==void 0&&{cubemapBlend:mU(n.cubemapBlend,r)}}}var wU=(e,t)=>({...e,quality:t}),i6e=e=>({maxDistance:k(e.light.occlusionMaxDistance,2,3e3),contrast:k(e.light.contrast,.01,2),exponent:k(e.light.occlusionExponent,.1,10),minOcclusion:k(e.light.minOcclusion,0,1),tint:e.light.occlusionTint,combineMode:e.light.occlusionCombineMode});function s6e(e){let t=1/(1+Math.exp(-e*-5)),r=1/(1+Math.exp(-e*5));return{mul:1/(r-t),add:-t/(r-t)}}var Gae=e=>[...e.lowerHemisphereColor,e.lowerHemisphereCoverage],Hae=e=>Mf(e)==="capturedScene"&&e.light.affectsWorld&&e.light.mobility!=="static";function Wae(e,t=!1){let r=Mf(e);return r==="realTime"?!0:r==="specifiedCubemap"?!!e.cubemap||t:Hae(e)}var zae=e=>e.light.realTimeCapture&&(e.light.mobility==="movable"||e.light.mobility==="stationary")&&e.quality.skyLightRealTimeCapture,Mf=e=>zae(e)?"realTime":e.light.sourceType,a6e=e=>e.light.sourceCubemapAngle*ce,l6e=e=>e>as?{cube:as/e,light:e/as}:{cube:1,light:1},gU=8,jae=16;function c6e(e,t){let{skyLightCubemapSizeLimit:r,skyLightResolutionOverride:n}=e.quality;if(Mf(e)==="realTime"&&n>=jae)return Math.min(Math.trunc(n),t);let o=r>0?k(r,gU,t):t;return k(Ei(e.light.cubemapResolution),gU,o)}var u6e=e=>Math.ceil(Math.log2(e))+1,d6e=(e,t)=>Math.floor(e/t.quality.skyLightCloudDivider),yU=({light:e,quality:t})=>e.intensity*t.skyLightIntensityScale,$ae=e=>yU(e)>0&&e.light.color.some(t=>t>0);function Yae(e,t,r=1,n=1){let{color:o}=e.light,i=Mf(e)==="realTime"?n:1,s=t?yU(e)*r/i:0;return[o[0]*s,o[1]*s,o[2]*s]}var xU=.64,ve=A({shadowBias:g("shadowBias",Hr,[0,4]),shadowSlopeBias:g("shadowSlopeBias",Hr,[0,4]),shadowSharpen:g("shadowSharpen",0,[0,1]),hairDeepShadowLayerDistribution:g("hairDeepShadowLayerDistribution",.5,[0,1]),diffuseShare:g("diffuseShare",1,[0,1]),specularShare:g("specularShare",1,[0,1]),inverseExposureBlend:g("inverseExposureBlend",0,[0,1]),maxDrawDistance:y("maxDrawDistance",0),maxDistanceFadeRange:y("maxDistanceFadeRange",0),fogScattering:y("fogScattering",1),shadowResolutionScale:y("shadowResolutionScale",1),radialExponent:F("radialExponent",Ot.radialExponent),forwardShadingPriority:P("forwardShadingPriority",0,0),atmosphereSunIndex:S("atmosphereSunIndex",0,[0,Ec.length-1]),angularRadius:us("angularRadius",Ot.sunAngularRadius,me,"radians from 0 below \u03C0/2"),softAngle:us("softAngle",0,180,"degrees from 0 below 180"),innerConeAngle:us("innerConeAngle",Ma,me,"radians from 0 below \u03C0/2"),outerConeAngle:us("outerConeAngle",Af,me,"radians above 0 below \u03C0/2",!0),width:F("width",xU),height:F("height",xU)});var bU=A({intensity:y("intensity",6),color:Mt("color",[1,1,1]),useTemperature:p("useTemperature",!0),temperatureKelvin:g("temperatureKelvin",Fo,R),angle:g("angle",.7357,[0,180]),rotation:ze("rotation",[-16.2856,43.7319,112.3607]),shadowDistance:y("shadowDistance",200),castShadow:p("castShadow",!0),fieldShadowCascade:p("fieldShadowCascade",!1),fieldShadowDistance:y("fieldShadowDistance",300),shadowsAir:p("shadowsAir",!0),shadowsFog:p("shadowsFog",!0),fogScattering:ve.fogScattering,atmosphereSunIndex:ve.atmosphereSunIndex,forwardShadingPriority:ve.forwardShadingPriority,transmittancePerPixel:p("transmittancePerPixel",!1),sunDiskTint:Mt("sunDiskTint",[1,1,1])}),Kae={shaftOcclusion:!0,shadowsClouds:!0};function qae(e){let t=e[0]*ce,r=e[1]*ce,n=Math.cos(t);return[n*Math.cos(r),Math.sin(t),-n*Math.sin(r)]}function EU(e){let t=[...Object.keys(bU),...Object.keys(Li),...Object.keys(Bo)],r={...Kae,...Xe(e,t,"the sun part",oe("sun"))},n=ue(bU,r);return{light:n,shafts:ue(Li,r),cloudShadow:ue(Bo,r),direction:qae(n.rotation)}}var Xae=["atmosphere","sun","skyLight","heightFog","clouds","backdrop"],Df=G({name:"sky",summary:"The air, the sun, the sky light, the height fog, the clouds and a backdrop of a world, each a part switched alone.",enabledByDefault:!1,requires:[],parts:Xae,data:["skyLight.cubemap.texels","skyLight.cubemapBlend.destination.texels","heightFog.cubemap.texels"]}),Qae=["near","far","density","heightFalloff"],TU=e=>Qae.some(t=>Object.hasOwn(e,t));function Zae(e){let t=TU(e)?{}:CN;return Fg({...t,...e})}function HS(e,t){let r=u=>e[u]||void 0,n=r("atmosphere"),o=r("sun"),i=r("skyLight"),s=r("heightFog"),a=r("clouds"),l=r("backdrop"),c=l&&nU(l);return{...n&&{atmosphere:Ug(n)},...o&&{sun:EU(o)},...i&&{skyLight:SU(i,t)},...s&&{fog:Zae(s)},...a&&{clouds:dU(a,t)},...c&&{backdrop:c}}}function k6e(e,t){let{skyLight:r,clouds:n,...o}=e;return{...o,...r&&{skyLight:wU(r,t)},...n&&t.cloudsOn&&{clouds:fU(n,t)}}}function Pf(e){let t=Xd(Df,e);return t?(HS(Qd(Df,[t]),_f),typeof e=="object"?t.parts:e):e}var HO={aerialFastOnOpaque:!0,skyTableFast:!0,transmittanceSamples:10,multiScatterSamples:15},Wr={effects:{smooth:{...HO,aerialSamplesPerSlice:1,aerialDepthSlices:8,skyTableSamplesMin:2,skyTableSamplesMax:16,atmosphereSamplesMin:2,atmosphereSamplesMax:16,transmittanceSmallFormat:!0},balanced:{...HO,aerialSamplesPerSlice:1,aerialDepthSlices:16,skyTableSamplesMin:4,skyTableSamplesMax:32,atmosphereSamplesMin:4,atmosphereSamplesMax:32,transmittanceSmallFormat:!1},fine:{...HO,aerialSamplesPerSlice:2,aerialDepthSlices:16,skyTableSamplesMin:4,skyTableSamplesMax:64,atmosphereSamplesMin:4,atmosphereSamplesMax:64,transmittanceSmallFormat:!1},cinematic:{aerialFastOnOpaque:!1,skyTableFast:!1,transmittanceSamples:30,multiScatterSamples:20,aerialSamplesPerSlice:8,aerialDepthSlices:32,skyTableSamplesMin:4,skyTableSamplesMax:256,atmosphereSamplesMin:8,atmosphereSamplesMax:256,transmittanceSmallFormat:!1}},imageEffects:{smooth:{lightShafts:!1},balanced:{lightShafts:!1},fine:{lightShafts:!0},cinematic:{lightShafts:!0}},indirectLight:{smooth:{skyLightIntensityScale:.8},balanced:{skyLightIntensityScale:1},fine:{skyLightIntensityScale:1},cinematic:{skyLightIntensityScale:1}}};var WO=Oc(Bo,vf),AU=(e,t)=>WO.validate(e,t),K6e=e=>WO.of(e),OU=(e,t)=>WO.same(e,t);var Uo=A({shadowDistance:zT("shadowDistance",400),shadowCascades:P("shadowCascades",4,0),shadowCascadeExponent:{...g("shadowCascadeExponent",3,U(1)),takes:"a finite number of at least 1"},shadowCascadeTransition:g("shadowCascadeTransition",.1,[0,1]),fieldShadowCascade:p("fieldShadowCascade",!0),fieldShadowDistance:zT("fieldShadowDistance",512),fieldShadowTraceDistance:F("fieldShadowTraceDistance",100,"a finite number of metres above 0"),fieldShadowRayStartOffsetDepthScale:y("fieldShadowRayStartOffsetDepthScale",.003),shadowDistanceFadeoutFraction:g("shadowDistanceFadeoutFraction",.1,[0,1])}),WS=Object.keys(Uo),Jae=Uo.shadowDistance.default,zO=e=>ue(Uo,Xe(e,WS,"the shadows of a light",oe("light shadow")));function _U(e){let t=e,r={};for(let n of WS)t[n]!==void 0&&(r[n]=t[n]);return r}function vU(e,t){let r=_U(e),n=Object.keys(r)[0];if(n!==void 0){if(e.kind!=="directional")throw new E("INVALID_SCENE_LIGHT",`${e.id}: ${n} exists only for a directional light`,{field:n});for(let[o,i]of Object.entries(r))if(i===null)throw new E("INVALID_SCENE_LIGHT",`${e.id}: ${o}: must be ${Dt(Uo[o])}, got null`,{field:o});pO(e,t,r,zO)}}var LU=new WeakMap;function RU(e){let t=LU.get(e);return t||LU.set(e,t=zO(_U(e))),t}function MU(e,t){let r=RU(e),n=RU(t);return WS.every(o=>r[o]===n[o])}var DU=e=>e.sourceTextureScale??[1,1],PU=e=>e.sourceTextureOffset??[0,0],ele=["sourceTexture","sourceTextureScale","sourceTextureOffset"];function CU(e,t,r){let n=e[t];if(n===void 0)return;let o=i=>K(i)&&i<=1&&(r?i>0:i>=0);if(!Array.isArray(n)||n.length!==2||!n.every(o))throw Gr(e.id,`${t} expects two numbers ${r?"above 0 up to 1":"from 0 to 1"}`,n);return[n[0],n[1]]}function zS(e){for(let t of ele)rt(e,t,"exists only for a rect")}function IU(e,t){let{id:r,sourceTexture:n}=e;if(n===void 0){rt(e,"sourceTextureScale","exists only beside a sourceTexture"),rt(e,"sourceTextureOffset","exists only beside a sourceTexture");return}if(typeof n!="string"||!n)throw Gr(r,"sourceTexture expects a picture id",n);t.sourceTexture=n;let o=CU(e,"sourceTextureScale",!0);o&&(t.sourceTextureScale=o);let i=CU(e,"sourceTextureOffset",!1);i&&(t.sourceTextureOffset=i)}var jS=(e,t)=>e.sourceTexture===t.sourceTexture&&Be(DU(e),DU(t))&&Be(PU(e),PU(t));var _i=(e,t)=>e===t||!!e&&!!t&&Be(e,t);function tle(e,t){return e.useTemperature===!0==(t.useTemperature===!0)&&(e.temperatureKelvin??Fo)===(t.temperatureKelvin??Fo)&&e.shadowsAir===!0==(t.shadowsAir===!0)&&e.transmittancePerPixel===!0==(t.transmittancePerPixel===!0)&&_i(Mc(e),Mc(t))}function jO(e,t){return rle(e,t)&&ile(e,t)&&sle(e,t)&&yB(e,t)&&jS(e,t)}var kU=(e,t)=>jO(e,t)&&pS(e,t);function rle(e,t){return nle(e,t)&&ole(e,t)}function nle(e,t){return e.kind===t.kind&&DS(e)===DS(t)&&Of(e)===Of(t)&&PS(e)===PS(t)&&IS(e)===IS(t)&&Dc(e)===Dc(t)&&kS(e)===kS(t)&&TS(e)===TS(t)&&RS(e)===RS(t)&&AS(e)===AS(t)&&OS(e)===OS(t)&&LS(e)===LS(t)&&_i(e.color,t.color)}function ole(e,t){return e.castsShadow===t.castsShadow&&CS(e)===CS(t)&&PO(e)===PO(t)&&MU(e,t)&&(e.softAngle??0)===(t.softAngle??0)&&(e.castHairDeepShadow??!1)===(t.castHairDeepShadow??!1)&&(e.castTranslucentShadows??!0)===(t.castTranslucentShadows??!0)&&(e.hairDeepShadowLayerDistribution??.5)===(t.hairDeepShadowLayerDistribution??.5)&&(e.shadowBias??Hr)===(t.shadowBias??Hr)&&(e.shadowSlopeBias??Hr)===(t.shadowSlopeBias??Hr)&&(e.shadowSharpen??0)===(t.shadowSharpen??0)}function ile(e,t){return e.atmosphereSun===t.atmosphereSun&&tle(e,t)&&tU(e,t)&&OU(e,t)&&Pa(e)===Pa(t)&&Lf(e)===Lf(t)&&e.lightPattern===t.lightPattern&&yO(e)===yO(t)&&xO(e)===xO(t)&&(e.lightPatternConeAngle??0)===(t.lightPatternConeAngle??0)&&_i(wO(e),wO(t))}function sle(e,t){return e.range===t.range&&e.outerConeAngle===t.outerConeAngle&&_c(e)===_c(t)&&e.angularRadius===t.angularRadius&&e.emitterRadius===t.emitterRadius&&e.emitterLength===t.emitterLength&&e.emitterSoftRadius===t.emitterSoftRadius&&_S(e)===_S(t)&&vS(e)===vS(t)&&_i(e.position,t.position)&&_i(e.direction,t.direction)&&_i(e.right,t.right)&&_i(e.emitterAxis,t.emitterAxis)&&_i(e.size,t.size)&&AB(e,t)}function $O(e,t){return e.exposure===t.exposure&&e.toneMapping===t.toneMapping&&e.sharpness===t.sharpness&&e.vignette===t.vignette&&_i(e.irradiance,t.irradiance)&&Ng(e.fog,t.fog)&&fc(e.atmosphere,t.atmosphere)}var ale=.1,lle=e=>e.planetRadius+Math.max(ale,e.height),cle=(e,t)=>[e[0]+t[0],e[1]+t[1],e[2]+t[2]];function ule({altitude:e,width:t,peak:r}){if(!(t>0&&r>0))return{below:[0,0],above:[0,0]};let n=r/t;return{below:[n,r-e*n],above:[-n,r+e*n]}}function KO(e){let t=ule(e.ozoneLayer);return{bottomRadius:e.planetRadius,topRadius:lle(e),rayleigh:e.rayleighScattering,rayleighExp:-1/e.rayleighScaleHeight,mieScattering:e.mieScattering,mieExtinction:cle(e.mieScattering,e.mieAbsorption),mieExp:-1/e.mieScaleHeight,mieAnisotropy:e.mieAnisotropy,ozone:e.ozoneAbsorption,ozoneAltitude:e.ozoneLayer.altitude,ozoneBelow:t.below,ozoneAbove:t.above}}function dle(e,t,r){let n=2*Ge(e,t),o=e[0]**2+e[1]**2+e[2]**2-r*r,i=n*n-4*o;if(i<0)return-1;let s=Math.sqrt(i),a=(-n-s)/2,l=(-n+s)/2;return a<0&&l<0?-1:a<0?Math.max(0,l):l<0?Math.max(0,a):Tr(l,0,a)}var fle=.5,YO=15;function FU(e,t){let r=KO(e),n=Math.max(e.minSunElevation*ce,Math.asin(k(t,-1,1))),o=[Math.cos(n),0,Math.sin(n)],i=[0,0,r.bottomRadius+fle],s=dle(i,o,r.topRadius),a=[0,0,0];if(s>0){let l=s/YO;for(let c=0;c<YO;c++){let u=s*c/YO,d=i[0]+o[0]*u,f=i[2]+o[2]*u,h=Je(d,f)-r.bottomRadius,m=Math.max(0,Math.exp(r.mieExp*h)),w=Math.max(0,Math.exp(r.rayleighExp*h)),[x,b]=h<r.ozoneAltitude?r.ozoneBelow:r.ozoneAbove,T=k(x*h+b,0,1);for(let L=0;L<3;L++)a[L]+=l*(m*r.mieExtinction[L]+w*r.rayleigh[L]+T*r.ozone[L])}}return[Math.exp(-a[0]),Math.exp(-a[1]),Math.exp(-a[2])]}var NU=e=>Q*(1-Math.cos(e));var st={planet:0,rayleigh:1,mieScattering:2,mieExtinction:3,ozone:4,ozoneLines:5,ground:6,skyFactor:7,scatteredFactor:8,sunDirection:9,sunIlluminance:10,sunDisk:11,sunTransmittance:12,secondDirection:13,secondIlluminance:14,secondDisk:15,secondTransmittance:16,lightFlags:17,lightSlots:18,planetPlace:19},Rze=20,qO=80,ple=[1,1,1],BU=[{direction:st.sunDirection,illuminance:st.sunIlluminance,disk:st.sunDisk,transmittance:st.sunTransmittance},{direction:st.secondDirection,illuminance:st.secondIlluminance,disk:st.secondDisk,transmittance:st.secondTransmittance}],Vo=(e,t,...r)=>e.set(r,t*4);function hle(e,t,r){let n=NU(r.angularRadius),o=r.diskTint??ple,i=r.illuminance.map((s,a)=>n>0?s*o[a]/n:0);Vo(e,t.direction,...r.direction.map(s=>-s),Math.cos(r.angularRadius)),Vo(e,t.illuminance,...r.illuminance),Vo(e,t.disk,...i,1),Vo(e,t.transmittance,...r.transmittance)}function mle(e,t){let r=[-1,-1,0,0];e.forEach((n,o)=>{if(!n)return;let i=BU[o];Vo(t,i.direction,...n.direction.map(s=>-s),1),Vo(t,i.illuminance,...n.illuminance),Vo(t,i.disk,0,0,0,1),Vo(t,i.transmittance,1,1,1,0),r[o]=n.lightSlot??-1}),Vo(t,st.lightSlots,...r)}function UU(e,t,r){if(r.fill(0,0,qO),!e)return mle(t,r),r;let n=KO(e),o=(a,...l)=>Vo(r,a,...l);o(st.planet,1,n.bottomRadius,n.topRadius,e.groundHeight),o(st.planetPlace,...e.groundPosition),o(st.rayleigh,...n.rayleigh,n.rayleighExp),o(st.mieScattering,...n.mieScattering,n.mieExp),o(st.mieExtinction,...n.mieExtinction,n.mieAnisotropy),o(st.ozone,...n.ozone,n.ozoneAltitude),o(st.ozoneLines,...n.ozoneBelow,...n.ozoneAbove),o(st.ground,...e.groundAlbedo,e.multiScatteringFactor),o(st.skyFactor,...e.skyLuminanceFactor,e.aerialPerspectiveDistanceScale),o(st.scatteredFactor,...e.skyAndAerialPerspectiveLuminanceFactor,e.aerialPerspectiveStartDepth),o(st.sunTransmittance,1,1,1,e.heightFogContribution),o(st.sunIlluminance,0,0,0,e.sampleCountScale);let i=[0,0,0,0],s=[-1,-1,0,0];return t.forEach((a,l)=>{a&&(hle(r,BU[l],a),i[l]=a.shadowsAir?1:0,i[2+l]=a.perPixel?1:0,s[l]=a.lightSlot??-1)}),o(st.lightFlags,...i),o(st.lightSlots,...s),r}var QO=e=>e.kind==="directional"&&e.atmosphereSun!==!1;function gle(e,t,r,n,o){let i,s=-1,a=1/0;for(let l of e){let c=t.get(l);if(l===o||!QO(c)||Pa(c)!==n)continue;let u=vc(c),d=r(l);(u>s||u===s&&d<a)&&(i=l,s=u,a=d)}return i}var Sle=(e,t,r)=>r===void 0||vc(t)>vc(e.get(r));function VU(e,t,r){let n=Ec.map(()=>{}),o,i=new Map,s=l=>{if(l.kind!=="directional")return;o??=l.id;let c=QO(l)?Pa(l):void 0;i.set(l.id,c),c!==void 0&&Sle(t,l,n[c])&&(n[c]=l.id)},a=(l,c)=>{i.delete(l),o===l&&(o=void 0);let u=n.indexOf(l);u>=0&&(n[u]=gle(e,t,r,u,c))};return{get suns(){return n},get fogSun(){return n[0]??o},added:s,removed:a,changed(l){let c=QO(l)?Pa(l):void 0;i.has(l.id)===(l.kind==="directional")&&i.get(l.id)===c||(a(l.id,l.id),s(l))}}}var wle=(e,t)=>e?[1,...e.direction,...va(e),Ss(e),e.angularRadius??Ot.sunAngularRadius,...Mc(e),e.shadowsAir?1:0,e.transmittancePerPixel?1:0,t??-1]:[0],XO=[1,1,1],yle=(e,t,r)=>{let n=va(e),o=Ss(e);return{direction:e.direction,illuminance:[n[0]*o,n[1]*o,n[2]*o],angularRadius:e.angularRadius??Ot.sunAngularRadius,transmittance:t,diskTint:Mc(e),shadowsAir:e.shadowsAir===!0,perPixel:e.transmittancePerPixel===!0,lightSlot:r}};function GU(){let e=new Float32Array(qO),t,r=[],n=Ec.map(()=>XO),o=0;return{packed:e,get atmosphere(){return t},get version(){return o},get tints(){return n},update(i,s,a=[]){let l=!fc(t,i),c=s.flatMap((d,f)=>wle(d,a[f]));if(!l&&Be(c,r))return!1;l&&o++,t=i,r=c;let u=s.map(d=>i&&d?FU(i,-d.direction[1]):XO);return n=u.map((d,f)=>s[f]?.transmittancePerPixel?XO:d),UU(i,s.map((d,f)=>d?yle(d,u[f],a[f]):void 0),e),!0}}}function xle(e){let[t,r,n]=va(e),o=Ss(e);return(t*t+r*r+n*n)*o*o}function HU(e,t){let{id:r,kind:n,forwardShadingPriority:o}=e;if(o!==void 0){if(n!=="directional")throw new E("INVALID_SCENE_LIGHT",`${r}: forwardShadingPriority exists only for a directional light`,{forwardShadingPriority:o});Ie(e,t,ve.forwardShadingPriority)}}function ble(e,t,r){let n,o=-1,i=0,s=1/0;for(let a of e){let l=t.get(a);if(l.kind!=="directional")continue;let c=Lf(l),u=xle(l),d=r(a);(c>o||c===o&&(u>i||u===i&&d<s))&&(n=a,o=c,i=u,s=d)}return n}function Ele(e,t,r){let n,o=!0;return{get id(){return o&&(n=ble(e,t,r),o=!1),n},changed(){o=!0}}}function WU(e){let t=Ele(e.ids,e.records,e.rankOf),r=()=>(t.id===void 0?void 0:e.indexOf.get(t.id))??-1,n=()=>{e.header()[W2]=r()+1};return{get slot(){return r()},changed(){t.changed(),n()},moved:n}}function zU(e,t){let r=ha*4+nA.sun*4;if(t.fill(0,r,r+4),!e?.direction)return t;for(let n=0;n<3;n++)t[r+n]=-e.direction[n];return t[r+3]=vc(e),t}var Ia=(e,t)=>t===void 0?void 0:e.get(t);function Tle(e,t,r){let n=wt(t)+J.color;for(let o=0;o<3;o++)e[n+o]*=r[o]}function Ale(e,t,r,n){let{records:o,indexOf:i,write:s}=e,a=[];return{get any(){return a.some(l=>l!==void 0)},apply(){let l=e.atmosphere();for(let d of a){let f=Ia(i,d);f!==void 0&&s(f,Ia(o,d))}a=l?[...r.suns]:[];let c=!!l||n();t.update(l,r.suns.map(d=>c?Ia(o,d):void 0),r.suns.map(d=>c?Ia(i,d):void 0));let u=e.packed();a.forEach((d,f)=>{let h=Ia(i,d);h!==void 0&&Tle(u,h,t.tints[f])})}}}function jU(e){let{records:t}=e,r=GU(),n=VU(e.ids,t,e.rankOf),o=!1,i=Ale(e,r,n,()=>o),s=WU(e),a=()=>{i.apply(),e.environment()?.fog&&zU(Ia(t,n.fogSun),e.environmentPacked)},l=c=>n.suns.includes(c)||n.fogSun===c&&!!e.environment()?.fog;return{air:r,held:c=>Ia(t,n.suns[c]),get forwardSlot(){return s.slot},setAirless(c){return c===o?!1:(o=c,i.apply(),!0)},reads:l,...Ole(n,s,i,a,l),environmentChanged:a}}function Ole(e,t,r,n,o){return{added(i){return e.added(i),i.kind==="directional"&&(t.changed(),n()),o(i.id)},changed(i,s){let a=o(s.id);return e.changed(s),(i.kind==="directional"||s.kind==="directional")&&(t.changed(),n()),a||o(s.id)},removed(i){let s=o(i.id);return e.removed(i.id),i.kind==="directional"?t.changed():t.moved(),(i.kind==="directional"||r.any)&&n(),s}}}var Lle=["emitterRadius","emitterLength","emitterSoftRadius","emitterAxis"],Rle=["inverseSquared","radialExponent"],ZO=[...Lle,...Rle],$S=(e,t,r,n,o)=>new E("INVALID_SCENE_LIGHT",`${e}: ${t}`,{[r]:n,...o===void 0?{}:{range:o}});function _le(e,t,r){if(!K(e)||e<=0||e>=t)throw $S(r,"emitter radius expected in (0, range)","emitterRadius",e,t);return e}function vle(e,t,r){let{id:n}=e;if(e.emitterSoftRadius!==void 0){let o=e.emitterSoftRadius;if(!K(o)||o<=0||o>=r)throw $S(n,"emitter soft radius expected in (0, range)","emitterSoftRadius",o,r);t.emitterSoftRadius=o}if(e.emitterLength!==void 0){if(!K(e.emitterLength)||e.emitterLength<=0)throw $S(n,"emitter length must be > 0","emitterLength",e.emitterLength,r);t.emitterLength=e.emitterLength}else if(e.iesProfile===void 0)return rt(e,"emitterAxis","exists only with an emitterLength or an iesProfile");e.emitterAxis!==void 0&&(t.emitterAxis=yf(e.emitterAxis,n))}function Mle(e,t){let{id:r,inverseSquared:n}=e;if(n!==void 0){if(typeof n!="boolean")throw $S(r,"inverseSquared expects a boolean","inverseSquared",n);t.inverseSquared=n}Ie(e,t,ve.radialExponent)}function $U(e,t,r){e.emitterRadius!==void 0&&(t.emitterRadius=_le(e.emitterRadius,r,e.id)),vle(e,t,r),Mle(e,t)}var Ic=["inverseExposureBlend","maxDrawDistance","maxDistanceFadeRange"];function YU(e,t){for(let r of Ic)e.kind==="directional"&&rt(e,r,"exists only for a point, a spot or a rect"),Ie(e,t,ve[r])}function KU(e,t){Ie(e,t,ve.diffuseShare),Ie(e,t,ve.specularShare)}function qU(e,t){let{id:r,shadowsFog:n}=e;if(Ie(e,t,ve.fogScattering),n!==void 0){if(typeof n!="boolean")throw new E("INVALID_SCENE_LIGHT",`${r}: shadowsFog expects a boolean`,{shadowsFog:n});t.shadowsFog=n}}function XU(e,t){let{id:r,mobility:n}=e;if(n!==void 0){if(!ff.includes(n))throw new E("INVALID_SCENE_LIGHT",`${r}: mobility expects ${ff.join(", ")}`,{mobility:n});t.mobility=n}}function Dle(e,t){let{id:r,kind:n,shadowResolutionScale:o}=e;if(o!==void 0){if(n==="directional")throw new E("INVALID_SCENE_LIGHT",`${r}: shadowResolutionScale exists only for a point, a spot or a rect`,{shadowResolutionScale:o});Ie(e,t,ve.shadowResolutionScale)}}function QU(e,t){Dle(e,t),KU(e,t),YU(e,t),HU(e,t),eU(e,t),AU(e,t),lB(e,t)}var JO=["innerConeAngle","outerConeAngle"];function Ple(e,t){if(!K(e)||e<=0)throw new E("INVALID_SCENE_LIGHT",`${t}: range must be > 0`,{range:e});return e}function Cle(e,t){let{id:r,intensity:n,intensityUnits:o}=e;if(o!==void 0){if(e.kind==="directional"&&rt(e,"intensityUnits","exists only for a lamp"),!uO.includes(o))throw new E("INVALID_SCENE_LIGHT",`${r}: unknown intensityUnits`,{units:o});if(o==="nits"&&e.kind!=="rect"&&Da(e)&&!(MS(e)>0))throw new E("INVALID_SCENE_LIGHT",`${r}: a lamp in nits needs an emitterRadius`,{units:o});t.intensityUnits=o}if(n===void 0)return;let i=o==="ev"&&Da(e);if(!K(n)||!i&&n<0)throw new E("INVALID_SCENE_LIGHT",`${r}: intensity must be >= 0`,{intensity:n});t.intensity=n}function kc(e,t,r){let n=e[r];if(n!==void 0){if(typeof n!="boolean")throw new E("INVALID_SCENE_LIGHT",`${e.id}: ${r} expects a boolean`,{[r]:n});t[r]=n}}function Ile(e,t){Ie(e,t,ve.shadowBias),Ie(e,t,ve.shadowSlopeBias),Ie(e,t,ve.shadowSharpen)}function kle(e,t){let{id:r,lightGroups:n}=e;if(n===void 0)return;let o=H2("lightGroups",n);if(o)throw new E("INVALID_SCENE_LIGHT",`${r}: ${o}`,{lightGroups:n});t.lightGroups=aS(n)}function Fle(e,t){if(kc(e,t,"useTemperature"),e.temperatureKelvin!==void 0){if(!K(e.temperatureKelvin))throw new E("INVALID_SCENE_LIGHT",`${e.id}: temperatureKelvin expects a number`,{temperatureKelvin:e.temperatureKelvin});t.temperatureKelvin=e.temperatureKelvin}}function Nle(e,t){if(kc(e,t,"shadowsAir"),kc(e,t,"transmittancePerPixel"),e.sunDiskTint===void 0)return;let r=Lc(e.sunDiskTint,"sunDiskTint",e.id);if(r.some(n=>n<0))throw new E("INVALID_SCENE_LIGHT",`${e.id}: negative sunDiskTint`,{tint:r});t.sunDiskTint=r}function Ble(e,t){let{id:r}=e;if(e.atmosphereSun!==void 0){if(typeof e.atmosphereSun!="boolean")throw new E("INVALID_SCENE_LIGHT",`${r}: atmosphereSun expects a boolean`,{atmosphereSun:e.atmosphereSun});t.atmosphereSun=e.atmosphereSun}Ie(e,t,ve.atmosphereSunIndex),Nle(e,t),Ie(e,t,ve.angularRadius),Ie(e,t,ve.softAngle),rt(e,"position","does not exist for a directional light"),rt(e,"range","does not exist for a directional light: it carries everywhere");for(let n of JO)rt(e,n,"exists only for a spot");for(let n of ZO)rt(e,n,"does not exist for a directional light: it has no position");return TO(e),zS(e),LO(e),t.direction=hS(e.direction,r,"a directional requires its direction"),t}var Ule=["softAngle","atmosphereSun","atmosphereSunIndex","sunDiskTint","shadowsAir","transmittancePerPixel"];function YS(e){let t=e?.id;if(typeof t!="string"||!t.length)throw new E("INVALID_SCENE_LIGHT","empty light identifier",{id:t});if(!Object.hasOwn(hf,e.kind))throw new E("INVALID_SCENE_LIGHT",`${t}: unknown type ${String(e.kind)}`,{kind:e.kind});let r=Lc(e.color,"color",t);if(r.some(o=>o<0))throw new E("INVALID_SCENE_LIGHT",`${t}: negative colour`,{color:r});let n={id:t,kind:e.kind,color:r,castsShadow:!!e.castsShadow};if(Cle(e,n),Fle(e,n),kc(e,n,"transmission"),kc(e,n,"castHairDeepShadow"),kc(e,n,"castTranslucentShadows"),Ie(e,n,ve.hairDeepShadowLayerDistribution),Ile(e,n),kle(e,n),qU(e,n),XU(e,n),SB(e,n),QU(e,n),vU(e,n),e.kind!=="rect")for(let o of["right","size"])rt(e,o,"exists only for a rect");if(e.kind!=="directional")for(let o of Ule)rt(e,o,"exists only for a directional light");if(e.kind==="directional")return Ble(e,n);if(rt(e,"angularRadius","exists only for a directional light"),n.position=Lc(e.position,"position",t),n.range=Ple(e.range,t),e.kind==="rect")return Vle(e,n);if($U(e,n,n.range),LO(e),e.kind==="spot")return n.direction=hS(e.direction,t,"a spot requires a direction"),n.outerConeAngle=fO(ve.outerConeAngle,e.outerConeAngle,t),zS(e),Ie(e,n,ve.innerConeAngle),AO(e,n),n;for(let o of JO)rt(e,o,"exists only for a spot");return zS(e),e.direction!==void 0&&(n.direction=yf(e.direction,t)),AO(e,n),n}function Vle(e,t){let{id:r}=e;for(let l of JO)rt(e,l,"exists only for a spot");for(let l of ZO)rt(e,l,"exists only for a point or a spot");TO(e);let n=hS(e.direction,r,"a rect requires the normal of its face"),o=Lc(e.right,"right",r);Zn(o,n,-Ge(o,n)),t.direction=n,t.right=bO(o,r);let i=e.size,{width:s,height:a}=ve;if(!Array.isArray(i)||i.length!==2||!et(s,i[0])||!et(a,i[1]))throw new E("INVALID_SCENE_LIGHT",`${r}: size expects two sides, each ${Dt(s)}`,{size:i});return t.size=[i[0],i[1]],IU(e,t),TB(e,t),t}var ZU={id:void 0,kind:void 0,position:void 0,direction:void 0,color:void 0,intensity:void 0,intensityUnits:void 0,range:void 0,innerConeAngle:void 0,outerConeAngle:void 0,angularRadius:void 0,softAngle:void 0,atmosphereSun:void 0,atmosphereSunIndex:void 0,forwardShadingPriority:void 0,right:void 0,size:void 0,lightGroups:void 0,castsShadow:void 0,fogScattering:void 0,mobility:void 0,shadowsFog:void 0,transmission:void 0,castHairDeepShadow:void 0,castTranslucentShadows:void 0,hairDeepShadowLayerDistribution:void 0,shadowBias:void 0,shadowSlopeBias:void 0,shadowSharpen:void 0,shadowResolutionScale:void 0,useTemperature:void 0,temperatureKelvin:void 0,sunDiskTint:void 0,shadowsAir:void 0,transmittancePerPixel:void 0,lightPattern:void 0,lightPatternScale:void 0,lightPatternFadeDistance:void 0,lightPatternDisabledBrightness:void 0,lightPatternConeAngle:void 0,shaftOcclusion:void 0,shaftOcclusionDarkness:void 0,shaftOcclusionDepthRange:void 0,shaftOverrideDirection:void 0,shaftBloom:void 0,shaftBloomScale:void 0,shaftBloomThreshold:void 0,shaftBloomMaxBrightness:void 0,shaftBloomTint:void 0,shadowsClouds:void 0,castCloudShadows:void 0,cloudShadowStrength:void 0,cloudShadowOnAtmosphereStrength:void 0,cloudShadowOnSurfaceStrength:void 0,cloudShadowDepthBiasKm:void 0,cloudShadowExtentKm:void 0,cloudShadowResolutionScale:void 0,cloudShadowRaySamplesScale:void 0,cloudScatteredLuminanceScale:void 0,contactShadowLength:void 0,contactShadowLengthInWorldSpace:void 0,contactShadowCastingIntensity:void 0,contactShadowNonCastingIntensity:void 0,indirectLightingIntensity:void 0,castRayTracedShadow:void 0,rayTracedShadowSamplesPerPixel:void 0,shadowDistance:void 0,shadowCascades:void 0,shadowCascadeExponent:void 0,shadowCascadeTransition:void 0,fieldShadowCascade:void 0,fieldShadowDistance:void 0,fieldShadowTraceDistance:void 0,fieldShadowRayStartOffsetDepthScale:void 0,shadowDistanceFadeoutFraction:void 0,barnDoorAngle:void 0,barnDoorLength:void 0,emitterRadius:void 0,emitterLength:void 0,emitterSoftRadius:void 0,emitterAxis:void 0,inverseSquared:void 0,radialExponent:void 0,diffuseShare:void 0,specularShare:void 0,inverseExposureBlend:void 0,maxDrawDistance:void 0,maxDistanceFadeRange:void 0,sourceTexture:void 0,sourceTextureScale:void 0,sourceTextureOffset:void 0,iesProfile:void 0,useIesBrightness:void 0,iesBrightnessScale:void 0,iesBrightness:void 0},Gle=Object.keys(ZU);function eL(e){let t={...ZU};for(let r of Gle)t[r]=e[r];return t}var Hle=e=>({get suns(){return e.suns},get locals(){return e.locals},get shadowedSuns(){return e.shadowedSuns},get shadowedLocals(){return e.shadowedLocals},get rects(){return e.rects},get contacts(){return e.contacts},get channelled(){return e.channelled},get profiled(){return e.profiled},get sourceTextured(){return e.sourceTextured}});function JU(e,t){let r={suns:0,locals:0,shadowedSuns:0,shadowedLocals:0,rects:0,contacts:0,channelled:0,profiled:0,sourceTextured:0};return{counts:Hle(r),tally(n,o){let i=n.kind==="directional";i?r.suns+=o:r.locals+=o,n.castsShadow&&(i?r.shadowedSuns+=o:r.shadowedLocals+=o),n.kind==="rect"&&(r.rects+=o),mO(n,e,t)&&(r.contacts+=o),Dc(n)!==bc&&(r.channelled+=o),n.iesProfile!==void 0&&(r.profiled+=o),n.sourceTexture!==void 0&&(r.sourceTextured+=o)},recountContacts(n){r.contacts=0;for(let o of n)mO(o,e,t)&&r.contacts++}}}function eV(){let e=new Map,t=[],r=0;return{of:n=>e.get(n),take(n){e.set(n,t.pop()??r++)},free(n){t.push(e.get(n)),e.delete(n)}}}var tV=e=>({...e,fog:void 0,sharpness:void 0,vignette:void 0}),rV=(e,t)=>!e||!Ng(e.fog,t.fog)||!fc(e.atmosphere,t.atmosphere);function nV(){let e=new Float32Array(lA),t;return W({packed:e,get current(){return t},set(r){if(t&&$O(t,r))return"same";let n=t&&$O(tV(t),tV(r));return t=r,WN(t,e),n?"untransported":"transported"}})}function oV(e){e.capacity=Lr(e.capacity,32),e.packed=tt(e.packed,wt(e.capacity)),e.words=new Uint32Array(e.packed.buffer),e.header=new Uint32Array(e.packed.buffer,0,pf),e.revision=tt(e.revision,e.capacity),e.draw=tt(e.draw,e.capacity*Pc)}var qS=(e,t)=>e.packed[wt(t)+J.shadowSlice];function tL(e,t,r){e.packed[wt(t)+J.shadowSlice]=r}var Fc=(e,t)=>(e.words[wt(t)+J.kind]>>>Sf)%2**oO;function iV(e,t,r){let n=wt(t)+J.kind,o=e.words[n];return(o>>>Tc&1)===(r?0:1)?!1:(e.words[n]=(o^1<<Tc)>>>0,!0)}function sV(e,t,r){let n=wt(t)+J.intensity,o=Math.fround(e.draw[t*Pc+IO]*r);return e.packed[n]===o?!1:(e.packed[n]=o,!0)}var XS=(e,t)=>(e.words[wt(t)+J.kind]>>>gf)%2**cS,rL=(e,t)=>bB(XS(e,t)),Cf=(e,t)=>jB(e.packed,wt(t)),KS=e=>e?.lightPattern===void 0?0:1;function nL(e,t,r,n=Fc(e,t),o=XS(e,t)){e.words[wt(t)+J.kind]=CO(r,e.shadowView,n,o)}function QS(e,t,r,n=Fc(e,t),o=XS(e,t),i=Cf(e,t)){FS(e,wt(t),r,n,o,i),kO(e.draw,t,r,e.rangeView)}function Go(e,t){e.epoch++,t||e.notSky++}var ZS=(e,t)=>e.suns.reads(e.ids[t]);function aV(){let e={...cB},t={...mB},r={capacity:0,packed:new Float32Array(0),words:new Uint32Array(0),header:new Uint32Array(0),revision:new Uint32Array(0),draw:new Float32Array(0),ids:[],indexOf:new Map,records:new Map,environment:nV(),kinds:JU(e,t),ranks:eV(),suns:void 0,view:"auto",epoch:1,membersEpoch:0,airOn:!0,notTransport:0,notSky:0,wearing:0,contactView:e,shadowView:t,rangeView:{...UB},profileEpoch:0,rectAtlasEpoch:0};return oV(r),r.suns=jU({ids:r.ids,records:r.records,indexOf:r.indexOf,rankOf:r.ranks.of,packed:()=>r.packed,header:()=>r.header,environment:()=>r.environment.current,atmosphere:()=>r.airOn?r.environment.current?.atmosphere:void 0,environmentPacked:r.environment.packed,write:(n,o)=>QS(r,n,o)}),r}function lV(e,t){let r=eL(YS(t));if(e.indexOf.has(r.id))throw new E("DUPLICATE_SCENE_LIGHT",`light ${r.id} already present`,{id:r.id});let n=e.ids.length;return n>=e.capacity&&oV(e),e.ids.push(r.id),e.indexOf.set(r.id,n),e.records.set(r.id,r),e.wearing+=KS(r),r.iesProfile!==void 0&&e.profileEpoch++,e.ranks.take(r.id),e.kinds.tally(r,1),e.revision[n]++,r.sourceTexture!==void 0&&e.rectAtlasEpoch++,QS(e,n,r,0,0,ES),tL(e,n,-1),e.header[0]=e.ids.length,Go(e,e.suns.added(r)),e.membersEpoch++,n}function Wle(e,t,r,n){e.kinds.tally(r,-1),e.kinds.tally(n,1),e.records.set(n.id,n),NS(e.packed,wt(t),n,e.contactView),Go(e,e.suns.changed(r,n)),Oa(r).indirectLightingIntensity===Oa(n).indirectLightingIntensity&&e.notTransport++}function cV(e,t,r){let n=e.indexOf.get(t),o=e.records.get(t);if(n===void 0||!o)throw new E("UNKNOWN_SCENE_LIGHT",`unknown light ${t}`,{id:t});let i=eL(YS({...o,...r,id:t}));if(jO(o,i))return pS(o,i)?!1:(Wle(e,n,o,i),!0);e.kinds.tally(o,-1),e.kinds.tally(i,1),e.records.set(t,i),e.wearing+=KS(i)-KS(o),e.revision[n]++;let s=i.iesProfile!==o.iesProfile;s&&e.profileEpoch++;let a=!jS(i,o),l=a||i.kind!==o.kind;return a&&e.rectAtlasEpoch++,QS(e,n,i,void 0,s?0:void 0,l?ES:void 0),Go(e,e.suns.changed(o,i)),!0}function uV(e,t){let{ids:r,indexOf:n,records:o,revision:i}=e,s=n.get(t);if(s===void 0)throw new E("UNKNOWN_SCENE_LIGHT",`unknown light ${t}`,{id:t});let a=r.length-1;if(s!==a){let c=r[a];r[s]=c,n.set(c,s),i[s]=i[a]+1,QS(e,s,o.get(c),Fc(e,a),XS(e,a),Cf(e,a)),tL(e,s,qS(e,a))}let l=o.get(t);e.wearing-=KS(l),l.iesProfile!==void 0&&e.profileEpoch++,l.sourceTexture!==void 0&&e.rectAtlasEpoch++,r.length=a,n.delete(t),e.kinds.tally(l,-1),o.delete(t),e.ranks.free(t),i[a]=0,e.packed.fill(0,wt(a),wt(a+1)),e.draw.fill(0,a*Pc,(a+1)*Pc),e.header[0]=r.length,Go(e,e.suns.removed(l)),e.membersEpoch++}function dV(e,t){let r=e.environment.current,n=e.environment.set(pA(t));return n==="same"?!1:(n==="untransported"&&e.notTransport++,e.suns.environmentChanged(),Go(e,rV(r,e.environment.current)),!0)}function fV(e,t){t!==e.airOn&&(e.airOn=t,e.suns.environmentChanged(),e.epoch++)}function oL(e,t,r,n,o,i){let s=Object.keys(t);if(!s.every(a=>t[a]===r[a])){for(let a of s)t[a]=r[a];for(let[a,l]of e.ids.entries())o(a,e.records.get(l));i?.(),Go(e,n&&e.ids.some(e.suns.reads)),e.notTransport++}}function pV(e,t){oL(e,e.contactView,t,!0,(r,n)=>NS(e.packed,wt(r),n,e.contactView),()=>e.kinds.recountContacts(e.records.values()))}function hV(e,t){oL(e,e.shadowView,t,!0,(r,n)=>nL(e,r,n),()=>e.kinds.recountContacts(e.records.values()))}function mV(e,t){oL(e,e.rangeView,t,!1,(r,n)=>kO(e.draw,r,n,e.rangeView))}function gV(e,t,r){Fc(e,t)!==r&&(nL(e,t,e.records.get(e.ids[t]),r),Go(e,ZS(e,t)),e.notTransport++)}function SV(e,t,r){rL(e,t)!==r&&(nL(e,t,e.records.get(e.ids[t]),void 0,xB(r)),Go(e,ZS(e,t)),e.notTransport++)}function wV(e,t,r){qS(e,t)!==r&&(tL(e,t,r),Go(e,ZS(e,t)),e.notTransport++)}function yV(e,t,r){let n=Cf(e,t);n.x===r.x&&n.y===r.y&&n.width===r.width&&n.height===r.height||(vO(e.packed,wt(t),r),Go(e,ZS(e,t)),e.notTransport++)}var zle=e=>({atmospherePacked:e.packed,get atmosphereVersion(){return e.version}});function jle(e){return{settings:Ot,get packed(){return e.packed},environmentPacked:e.environment.packed,get draw(){return e.draw},get revision(){return e.revision},get capacity(){return e.capacity},sliceOf:t=>qS(e,t),lightPatternOf:t=>Fc(e,t),lightProfileSliceOf:t=>rL(e,t),get profileEpoch(){return e.profileEpoch},rectAtlasSlotOf:t=>Cf(e,t),get rectAtlasEpoch(){return e.rectAtlasEpoch},get lightPatternCount(){return e.wearing},kindOf:t=>e.words[wt(t)+J.kind]%df,drawnOf:t=>(e.words[wt(t)+J.kind]>>>Tc&1)===0}}function $le(e){return{ids:e.ids,get count(){return e.ids.length},get epoch(){return e.epoch},get membersEpoch(){return e.membersEpoch},get transportEpoch(){return e.epoch-e.notTransport},get skyInputsEpoch(){return e.epoch-e.notSky}}}function Yle(e,t){let{suns:r,records:n,indexOf:o,ids:i}=e,s=()=>e.view==="unlit";return{get environment(){return e.environment.current},atmosphereLight:a=>r.held(a),get forwardDirectionalSlot(){return r.forwardSlot},get lightingView(){return e.view},get unlitAsked(){return s()},get unlit(){return s()||e.view==="auto"&&i.length===0&&t.count===0},light:a=>n.get(a),slotOf:a=>o.get(a)??-1}}function Kle(e,t){return{setView(r){return e.view===r?!1:(e.view=r,e.epoch++,e.notSky++,!0)},add:r=>lV(e,r),set:(r,n)=>cV(e,r,n),remove:r=>uV(e,r),setEnvironment:r=>dV(e,r),setAirOn:r=>fV(e,r),setAirlessSuns(r){e.suns.setAirless(r)&&e.epoch++},setContactShadowView(r){pV(e,r),t.fold()},setShadowView(r){hV(e,r),t.fold()},setRangeView:r=>mV(e,r),assignDrawn:(r,n)=>iV(e,r,n),assignFade:(r,n)=>sV(e,r,n),assignLightPattern:(r,n)=>gV(e,r,n),assignLightProfile:(r,n)=>SV(e,r,n),assignRectAtlasSlot:(r,n)=>yV(e,r,n),assignSlice:(r,n)=>wV(e,r,n)}}function qle(){let e=aV(),t=JB(e);return W(jle(e),$le(e),Yle(e,t),{simple:t,setSimpleLights:t.set},Kle(e,t),e.kinds.counts,zle(e.suns.air))}var iL=new Float32Array(1),bV=new Uint32Array(iL.buffer),sL=e=>(iL[0]=e,bV[0]),xV=e=>(bV[0]=e,iL[0]);function M$e(e){let t=Math.fround(e);if(!(t<e))return t;if(t===0)return xV(1);let r=sL(t);return xV(t>0?r+1:r-1)}var JS=new Float64Array(1),If=new Uint32Array(JS.buffer),Nc=e=>(JS[0]=e,If[1]);function D$e(e,t,r){JS[0]=r,e[t]=If[1],e[t+1]=If[0]}var ew=(e,t)=>(If[1]=e,If[0]=t,JS[0]);var so=e=>ew(e,0),aL=e=>Nc(e)>>>20&2047,LV=-.16666666666666632,Xle=.00833333333332249,Qle=-.0001984126982985795,Zle=27557313707070068e-22,Jle=-25050760253406863e-24,ece=158969099521155e-24,tce=.0416666666666666,rce=-.001388888888887411,nce=2480158728947673e-20,oce=-27557314351390663e-23,ice=2087572321298175e-24,sce=-11359647557788195e-27;function EV(e,t){let r=e*e,n=RV(r),o=r*e;return e-(r*(.5*t-o*n)-t-o*LV)}function RV(e){let t=e*e;return Xle+e*(Qle+e*Zle)+e*t*(Jle+e*ece)}function uL(e,t){let r=e*e,n=r*r,o=r*(tce+r*(rce+r*nce))+n*n*(oce+r*(ice+r*sce)),i=.5*r,s=1-i;return s+(1-s-i+(r*o-e*t))}var TV=1.5/2220446049250313e-31,ace=.6366197723675814,nw=1.5707963267341256,kf=6077100506506192e-26,lce=6077100506303966e-26,cce=20222662487959506e-37,uce=20222662487111665e-37,dce=84784276603689e-45,fce=so(1045430272),pce=so(1072243196),_V=so(1073928573),hce=so(1074752123),mce=so(1075183037),gce=so(1075594812),Sce=so(1094263291),Bc=new Float64Array(2);function tw(e){let t=aL(e),r=e*ace+TV-TV,n=e-r*nw,o=r*kf,i=n-o;if(t-aL(i)>16){let s=n;o=r*lce,n=s-o,o=r*cce-(s-n-o),i=n-o,t-aL(i)>49&&(s=n,o=r*uce,n=s-o,o=r*dce-(s-n-o),i=n-o)}return Bc[0]=i,Bc[1]=n-i-o,r}function lL(e,t){let r=e<0?-t:t,n=e-r*nw,o=n-r*kf;return Bc[0]=o,Bc[1]=n-o-r*kf,r}var wce=e=>(Nc(e)&1048575)===598523,yce=so(1073291771),xce=so(1073291772);function ws(e){let t=Math.abs(e);return t<pce?t<fce?e:bce(e):t<_V&&(t<yce||!(t<xce))?e>0?AV(e-nw,kf):-AV(e+nw,-kf):Ece(e,t)}function bce(e){let t=e*e,r=t*e;return e+r*(LV+t*RV(t))}function AV(e,t){let r=e-t;return uL(r,e-r-t)}function Ece(e,t){if(!(t<1/0))return e-e;let r;if(t<hce)wce(t)?r=tw(e):r=lL(e,t<_V?1:2);else if(t<gce)t<mce?r=Nc(t)===1074977148?tw(e):lL(e,3):r=Nc(t)===1075388923?tw(e):lL(e,4);else if(t<Sce)r=tw(e);else return Math.sin(e);let n=Bc[0],o=Bc[1];switch(r&3){case 0:return EV(n,o);case 1:return uL(n,o);case 2:return-EV(n,o);default:return-uL(n,o)}}var rw=1.5707963267948966,OV=6123233995736766e-32,Tce=.16666666666666666,Ace=-.3255658186224009,Oce=.20121253213486293,Lce=-.04005553450067941,Rce=.0007915349942898145,_ce=3479331075960212e-20,vce=-2.403394911734414,Mce=2.0209457602335057,Dce=-.6882839716054533,Pce=.07703815055590194,Cce=so(1012924417);function cL(e){let t=e*(Tce+e*(Ace+e*(Oce+e*(Lce+e*(Rce+e*_ce))))),r=1+e*(vce+e*(Mce+e*(Dce+e*Pce)));return t/r}function vV(e){let t=Math.abs(e);if(!(t<1))return e===1?0:e===-1?2*rw:NaN;if(t<.5)return t<Cce?rw:rw-(e-(OV-e*cL(e*e)));if(e<0){let a=(1+e)*.5,l=Math.sqrt(a),c=cL(a)*l-OV;return 2*(rw-(l+c))}let r=(1-e)*.5,n=Math.sqrt(r),o=so(Nc(n)),i=(r-o*o)/(n+o),s=cL(r)*n+i;return 2*(o+s)}function MV(e,t,r,n=0){let o=r[n],i=r[n+1],s=r[n+2],a=2*(t[1]*s-t[2]*i),l=2*(t[2]*o-t[0]*s),c=2*(t[0]*i-t[1]*o);return e[0]=o+t[3]*a+t[1]*c-t[2]*l,e[1]=i+t[3]*l+t[2]*a-t[0]*c,e[2]=s+t[3]*c+t[0]*l-t[1]*a,e}function ao(e,t,r){let n=Math.sin(r/2);return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=Math.cos(r/2),e}function PV(e,t,r){let n=t/2,o=r/2,i=Math.sin(n),s=Math.cos(n),a=Math.sin(o),l=Math.cos(o);return e[0]=s*a,e[1]=i*l,e[2]=-i*a,e[3]=s*l,e}function nt(e,t,r){let n=t[0],o=t[1],i=t[2],s=t[3],a=r[0],l=r[1],c=r[2],u=r[3];return e[0]=s*a+n*u+o*c-i*l,e[1]=s*l-n*c+o*u+i*a,e[2]=s*c+n*l-o*a+i*u,e[3]=s*u-n*a-o*l-i*c,e}function ka(e,t,r=0,n=0){return e[r]*t[n]+e[r+1]*t[n+1]+e[r+2]*t[n+2]+e[r+3]*t[n+3]}function dL(e,t,r=0,n=0){let o=e[r]-t[n],i=e[r+1]-t[n+1],s=e[r+2]-t[n+2],a=e[r+3]-t[n+3];return o*o+i*i+s*s+a*a}function vi(e,t=0){let r=ka(e,e,t,t);return r<aa||r===1/0?nc(e[t],e[t+1],e[t+2],e[t+3]):Math.sqrt(r)}function zr(e,t,r=0,n=0){let o=t[n],i=t[n+1],s=t[n+2],a=t[n+3];return e[r]=-o,e[r+1]=-i,e[r+2]=-s,e[r+3]=a,e}function CV(e,t,r=0,n=0){return 2*Math.acos(Math.min(1,Math.abs(ka(e,t,r,n))))}var IV=2**-900,kV=2**900;function jr(e){return FV(e,0,e[0],e[1],e[2],e[3])}function FV(e,t,r,n,o,i){let s=wg(r,n,o,i);if(s===1)return e[t]=r,e[t+1]=n,e[t+2]=o,e[t+3]=i,e;let a=s>=IV&&s<=kV?Math.sqrt(s):nc(r,n,o,i)||1;return e[t]=r/a,e[t+1]=n/a,e[t+2]=o/a,e[t+3]=i/a,e}var Ice=2**-27;function G$e(e,t,r,n,o,i,s){let a=o[i],l=o[i+1],c=o[i+2],u=r[n],d=r[n+1],f=r[n+2],h=r[n+3],m=xg(a,l,c),w=m*Math.abs(s),x=!(w>=Ice),b=x?s:Math.sign(s)*ws(w)/m,T=x?1:ws(me-w);return FV(e,t,T*u+b*(a*h+l*f-c*d),T*d+b*(l*h+c*u-a*f),T*f+b*(c*h+a*d-l*u),T*h-b*(a*u+l*d+c*f))}var kce=new Float64Array(3);function NV(e,t,r,n,o,i){return Fce(e,0,t,r,n,o,i,Ff(kce,0,t,r,n,o),0)}function Ff(e,t,r,n,o,i){let s=ka(r,o,n,i),a=s<0?-1:1;s*=a;let l=vV(Math.min(1,s));return e[t]=a,e[t+1]=l,e[t+2]=ws(l),e}var BV=1e-6;function Fce(e,t,r,n,o,i,s,a,l){let c=r[n],u=r[n+1],d=r[n+2],f=r[n+3],h=o[i],m=o[i+1],w=o[i+2],x=o[i+3],b=a[l],T=a[l+1],L=a[l+2],_=L<BV,D=_?1-s:ws((1-s)*T)/L,C=_?s*b:ws(s*T)/L*b;return e[t]=c*D+h*C,e[t+1]=u*D+m*C,e[t+2]=d*D+w*C,e[t+3]=f*D+x*C,_}function UV(e,t,r,n,o,i,s,a,l){let c=a[l],u=a[l+1],d=a[l+2],f=d<BV,h=f?1-s:ws((1-s)*u)/d,m=f?s*c:ws(s*u)/d*c,w=r[n]*h+o[i]*m,x=r[n+1]*h+o[i+1]*m,b=r[n+2]*h+o[i+2]*m,T=r[n+3]*h+o[i+3]*m,L=wg(w,x,b,T),_=L>=IV&&L<=kV?Math.sqrt(L):nc(w,x,b,T)||1;return e[t]=w/_,e[t+1]=x/_,e[t+2]=b/_,e[t+3]=T/_,e}var ow=new Float64Array(3);function yt(e,t,r,n,o){return ow[0]=r,ow[1]=n,ow[2]=o,MV(e,t,ow)}var DV={XYZ:[1,-1,1,-1],YXZ:[1,-1,-1,1],ZXY:[-1,1,1,-1],ZYX:[-1,1,-1,1],YZX:[1,1,-1,-1],XZY:[-1,-1,1,1]};function iw(e,t,r,n,o="XYZ"){let i=DV[o]??DV.XYZ,s=i[0],a=i[1],l=i[2],c=i[3],u=Math.cos(t/2),d=Math.sin(t/2),f=Math.cos(r/2),h=Math.sin(r/2),m=Math.cos(n/2),w=Math.sin(n/2);return e[0]=d*f*m+s*u*h*w,e[1]=u*h*m+a*d*f*w,e[2]=u*f*w+l*d*h*m,e[3]=u*f*m+c*d*h*w,e}function fL(e,t,r){let n=e[0],o=e[1],i=e[2],s=e[3],a=e[4],l=e[5];for(let c=0;c<r;c++){let u=c*vt;n=Math.min(n,t[u]),o=Math.min(o,t[u+1]),i=Math.min(i,t[u+2]),s=Math.max(s,t[u+3]),a=Math.max(a,t[u+4]),l=Math.max(l,t[u+5])}e[0]=n,e[1]=o,e[2]=i,e[3]=s,e[4]=a,e[5]=l}function pL(e,t,r,n,o,i,s,a){let l=e[t],c=e[t+1],u=e[t+2],d=e[t+3];return l*(l>0?i:r)+c*(c>0?s:n)+u*(u>0?a:o)+d}function hL(e,t,r,n,o,i,s){for(let a=0;a<Io;a+=4)if(pL(e,a,t,r,n,o,i,s)<0)return!0;return!1}function Nce(e,t,r,n,o,i,s){let a=!1;for(let l=0;l<Io;l+=4){if(pL(e,l,t,r,n,o,i,s)<0)return 0;!a&&pL(e,l,o,i,s,t,r,n)<0&&(a=!0)}return a?1:2}function Nf(e,t,r,n,o,i,s,a){if(Ag(r,n,o,i,s,a))return mL(e,t,0,0,0,-1);Og(e,t,r,n,o,i,s,a),e[t+3]=UT(r,n,o,i,s,a)*.5}function q$e(e,t,r){let n=.5*(r[0]+r[3]),o=.5*(r[1]+r[4]),i=.5*(r[2]+r[5]);for(let s=0;s<3;s++)e[s]=oc(t,s,n,o,i);return e[3]=aN(r)*QF(t),e}function mL(e,t,r,n,o,i){e[t]=r,e[t+1]=n,e[t+2]=o,e[t+3]=i}function X$e(e,t,r,n){let o=r[n+3];if(!(o>=0))return;let i=r[n],s=r[n+1],a=r[n+2],l=e[t+3];if(!(l>=0)){mL(e,t,i,s,a,o);return}let c=i-e[t],u=s-e[t+1],d=a-e[t+2],f=xg(c,u,d);if(f+o<=l)return;if(f+l<=o){mL(e,t,i,s,a,o);return}let h=(f+l+o)*.5,m=(h-l)/f;e[t]+=c*m,e[t+1]+=u*m,e[t+2]+=d*m,e[t+3]=h}function Q$e(e,t,r,n,o,i){let s=e[3],a=e[0]-t[0],l=e[1]-t[1],c=e[2]-t[2],u=te(a,l,c),d=s/o/n,f=a+d*r[0],h=l+d*r[1],m=c+d*r[2],w=(r[0]*f+r[1]*h+r[2]*m)/n;if(!(w>0&&w*w>=(f*f+h*h+m*m)*i*i))return!1;let x=-(r[0]*a+r[1]*l+r[2]*c)/n;return x>0&&x*x>=u*u*o*o?u*u<=s*s:!0}function Uc(e,t,r,n,o,i,s,a,l,c){return e*(e>0?a:o)+t*(t>0?l:i)+r*(r>0?c:s)+n<0}function gL(e,t,r,n){let o=t[0],i=t[1],s=t[2],a=t[3],l=t[4],c=t[5],u=t[6],d=t[7],f=t[8],h=t[9],m=t[10],w=t[11],x=t[12],b=t[13],T=t[14],L=t[15],_=t[16],D=t[17],C=t[18],j=t[19],$=t[20],q=t[21],le=t[22],ge=t[23],Ue=0;for(let ye=0;ye<n;ye++){let Fe=ye*vt,Ye=r[Fe],Ke=r[Fe+1],ut=r[Fe+2],Ae=r[Fe+3],Kt=r[Fe+4],_e=r[Fe+5],hi=Uc(o,i,s,a,Ye,Ke,ut,Ae,Kt,_e)||Uc(l,c,u,d,Ye,Ke,ut,Ae,Kt,_e)||Uc(f,h,m,w,Ye,Ke,ut,Ae,Kt,_e)||Uc(x,b,T,L,Ye,Ke,ut,Ae,Kt,_e)||Uc(_,D,C,j,Ye,Ke,ut,Ae,Kt,_e)||Uc($,q,le,ge,Ye,Ke,ut,Ae,Kt,_e);e[ye]=hi?0:1,hi||Ue++}return Ue}function ys(e,t,r){for(let n=0;n<r;n++){let o=n*vt;Nf(e,n*4,t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5])}}var VV=1e-20;function GV(e){return Math.abs(e[0])+Math.abs(e[1])+Math.abs(e[2])+Math.abs(e[4])+Math.abs(e[5])+Math.abs(e[6])+Math.abs(e[8])+Math.abs(e[9])+Math.abs(e[10])}function HV(e,t=0){let r=e[t],n=e[t+1],o=e[t+2],i=e[t+4],s=e[t+5],a=e[t+6],l=e[t+8],c=e[t+9],u=e[t+10];return(r-1)**2+n**2+o**2+(i**2+(s-1)**2+a**2)+(l**2+c**2+(u-1)**2)}function WV(e){let t=GV(e);return!(t>0)||!Number.isFinite(t)?NaN:LT(e[0]/t,e[1]/t,e[2]/t,e[4]/t,e[5]/t,e[6]/t,e[8]/t,e[9]/t,e[10]/t)}function SL(e,t){let r=WV(e);return Number.isNaN(r)?null:t===0||!(Math.abs(r)>VV)?1:1/t}function xs(e,t,r,n){return zV(e,t,r,n,!1)}function o8e(e,t,r,n){return zV(e,t,r,n,!0)}function zV(e,t,r,n,o){let i=n>=0?1:-1,s=-1/(i+n),a=t*r*s;return e[0]=1+i*s*t*t,e[1]=i*a,e[2]=-i*t,o&&(e[3]=a,e[4]=i+s*r*r,e[5]=-r),e}var Ho=new Float64Array(9),Zt=new Float64Array(3),bs=new Float64Array(3),sw=new Float64Array(3),Bf=new Float64Array(4),Bce=new Float64Array(3),aw=new Float64Array(4),jV=new Float64Array(3);function Uce(e,t,r,n,o,i){i?(Zt[0]=e[12]-t,Zt[1]=e[13]-r,Zt[2]=e[14]-n):(Zt[0]=t-e[12],Zt[1]=r-e[13],Zt[2]=n-e[14]),sc(Zt)===0?Zt[2]=1:Ne(Zt),Ze(bs,o,Zt),sc(bs)===0&&xs(bs,Zt[0],Zt[1],Zt[2]),Ne(bs),Ze(sw,Zt,bs),Ho[0]=bs[0],Ho[1]=sw[0],Ho[2]=Zt[0],Ho[3]=bs[1],Ho[4]=sw[1],Ho[5]=Zt[1],Ho[6]=bs[2],Ho[7]=sw[2],Ho[8]=Zt[2]}function Vce(e,t,r,n,o,i,s,a){return Uce(t,r,n,o,i,s),rf(e,Ho),a&&(Rr(a,Bce,aw,jV),zr(aw,aw),nt(e,aw,e),jV[0]<0&&(e[1]=-e[1],e[2]=-e[2])),e}function wL(e,t,r,n,o,i,s){ln(e,t,!0,!1);let a=e.parent[t];Vce(Bf,e.worldViews[t],r,n,o,i,s,a>=0?e.worldViews[a]:null),ms(e,t,Bf[0],Bf[1],Bf[2],Bf[3])}function Gce(e,t,r,n=0){return Ce(e,t,n),e[n+12]=t[12]-r[0],e[n+13]=t[13]-r[1],e[n+14]=t[14]-r[2],e}function $V(e,t,r,n=0){Ce(e,t,n);let o=r[0],i=r[1],s=r[2];for(let a=0;a<4;a++)e[n+12+a]=t[a]*o+t[4+a]*i+t[8+a]*s+t[12+a];return e}function m8e(e,t,r,n){return $V(t,r,n),mr(e,t)}function yL(e,t){return Ce(e,t),e[12]=0,e[13]=0,e[14]=0,e}function Hce(e){return OT(e)<0}function Fa(e,t=0){if(e.length<t+11)return NaN;let r=e[t],n=e[t+4],o=e[t+8],i=e[t+1],s=e[t+5],a=e[t+9],l=e[t+2],c=e[t+6],u=e[t+10];if(!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(s)||!Number.isFinite(a)||!Number.isFinite(l)||!Number.isFinite(c)||!Number.isFinite(u))return NaN;let d=r*r+i*i+l*l,f=n*n+s*s+c*c,h=o*o+a*a+u*u,m=r*n+i*s+l*c,w=r*o+i*a+l*u,x=n*o+s*a+c*u,b=m*m+w*w+x*x;if(b<=0)return Math.sqrt(Math.max(d,f,h,0));let T=(d+f+h)/3,L=Math.sqrt(((d-T)**2+(f-T)**2+(h-T)**2+2*b)/6);if(!(L>0))return Math.sqrt(Math.max(T,0));let _=(d-T)/L,D=(f-T)/L,C=(h-T)/L,j=m/L,$=w/L,q=x/L,le=_*(D*C-q*q)-j*(j*C-q*$)+$*(j*q-D*$),ge=Math.acos(k(le/2,-1,1))/3;return Math.sqrt(Math.max(T+2*L*Math.cos(ge),0))}var Wce=new Float64Array(3),zce=new Float64Array(3),Na=new Float64Array(3);function xL(e,t,r){ln(t,r,!0,!1);let n=t.worldViews[r];return e[0]=n[12],e[1]=n[13],e[2]=n[14],e}function bL(e,t,r){return ln(t,r,!0,!1),Rr(t.worldViews[r],Wce,e,zce),e}function EL(e,t,r,n){ln(t,r,!0,!1);let o=t.worldViews[r];Na[0]=o[8],Na[1]=o[9],Na[2]=o[10],Ne(Na);let i=n?-1:1;return e[0]=i*Na[0],e[1]=i*Na[1],e[2]=i*Na[2],e}function Vc(e,t,r=0){let n=t[0],o=t[1],i=t[2],s=t[4],a=t[5],l=t[6],c=t[8],u=t[9],d=t[10],f=d*a-l*u,h=l*c-d*s,m=u*s-a*c,w=n*f+o*h+i*m,x=SL(t,w);if(x===null){for(let b=0;b<9;b++)e[r+b]=0;return e}return e[r]=f*x,e[r+3]=(i*u-d*o)*x,e[r+6]=(l*o-i*a)*x,e[r+1]=h*x,e[r+4]=(d*n-i*c)*x,e[r+7]=(i*s-l*n)*x,e[r+2]=m*x,e[r+5]=(o*c-u*n)*x,e[r+8]=(a*n-o*s)*x,e}function O8e(e){let t=Vc(new Array(9),[e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0]);return[t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]]}var L8e=(e,t)=>[e[0]*t[0]+e[3]*t[1]+e[6]*t[2],e[1]*t[0]+e[4]*t[1]+e[7]*t[2],e[2]*t[0]+e[5]*t[1]+e[8]*t[2],e[0]*t[3]+e[3]*t[4]+e[6]*t[5],e[1]*t[3]+e[4]*t[4]+e[7]*t[5],e[2]*t[3]+e[5]*t[4]+e[8]*t[5],e[0]*t[6]+e[3]*t[7]+e[6]*t[8],e[1]*t[6]+e[4]*t[7]+e[7]*t[8],e[2]*t[6]+e[5]*t[7]+e[8]*t[8]];function TL(e,t,r,n,o=!1){let[i,s,a,l]=[t.x,t.y,r.x,r.y],[c,u]=[Math.cos(n),Math.sin(n)];return e[0]=a*c,e[1]=-(o?a:l)*u,e[2]=0,e[3]=(o?l:a)*u,e[4]=l*c,e[5]=0,e[6]=i+0,e[7]=s+0,e[8]=1,e}function Uf(e,t,r,n){let o=t[0],i=t[1],s=t[2],a=t[4],l=t[5],c=t[6],u=t[8],d=t[9],f=t[10],h=t[12],m=t[13],w=t[14];for(let x=0;x<n;x++){let b=x*3,T=r[b],L=r[b+1],_=r[b+2];e[b]=Nr(o,a,u,h,T,L,_),e[b+1]=Nr(i,l,d,m,T,L,_),e[b+2]=Nr(s,c,f,w,T,L,_)}}function jce(e,t,r,n){for(let o=0;o<n;o++){let i=o*3;Do(e,t[o],r[i],r[i+1],r[i+2],i)}}function $ce(e,t,r,n){let o=t[0],i=t[1],s=t[2],a=t[4],l=t[5],c=t[6],u=t[8],d=t[9],f=t[10];for(let h=0;h<n;h++){let m=h*3,w=r[m],x=r[m+1],b=r[m+2];ic(e,m,Ut(o,a,u,w,x,b),Ut(i,l,d,w,x,b),Ut(s,c,f,w,x,b))}}var Vf=1e-9,Gc=1e-6;function lw(e,t){let r=te(t[0],t[1],t[2]);return e[0]=r,r<=Vf||(e[1]=Math.atan2(t[0],t[2]),e[2]=Math.acos(k(t[1]/r,-1,1))),e}function Hc(e,t){let r=Math.sin(t[2]);return e[0]=t[0]*r*Math.sin(t[1]),e[1]=t[0]*Math.cos(t[2]),e[2]=t[0]*r*Math.cos(t[1]),e}function KV(e,t,r,n){return e[0]=Math.atan2(-t,-n),e[1]=Math.atan2(r,Je(t,n)),e}var AL=class{#e=null;#t=null;get size(){return this.#e?.size??0}subscribe(t){let r=this.#e??=new Set,n=r.size;return r.add(t).size!==n&&(this.#t=null),()=>this.unsubscribe(t)}unsubscribe(t){this.#e?.delete(t)&&(this.#t=null)}emit(...t){let r=this.#e;if(r){if(r.size===1)for(let n of r)n(...t);else if(r.size)for(let n of this.#t??=[...r])n(...t)}}tell(t,...r){let n=this.#e;if(n?.size)for(let o of this.#t??=[...n])try{o(...r)}catch(i){t(i)}}clear(){this.#e?.clear(),this.#t=null}};function fe(){return new AL}var cn=class{_changes=null;_changed(){return this._changes?.emit(),this}},Wc=class extends cn{elements;constructor(t){super(),this.elements=t}_share(t){t.set(this.elements),this.elements=t}get x(){return this.elements[0]}set x(t){this.elements[0]=t,this._changed()}get y(){return this.elements[1]}set y(t){this.elements[1]=t,this._changed()}get z(){return this.elements[2]}set z(t){this.elements[2]=t,this._changed()}};function Se(e,t){(e._changes??=fe()).subscribe(t)}function Es(e,t){e._changes?.unsubscribe(t)}var Gf=new Float64Array(2),Me=class e extends cn{isVector2=!0;_x;_y;constructor(t=0,r=0){super(),this._x=t,this._y=r}get x(){return this._x}set x(t){this._x=t,this._changed()}get y(){return this._y}set y(t){this._y=t,this._changed()}set(t,r){return this._x=t,this._y=r,this._changed()}copy(t){return this.set(t.x,t.y)}clone(){return new e(this._x,this._y)}add(t){return this.set(this._x+t.x,this._y+t.y)}sub(t){return this.set(this._x-t.x,this._y-t.y)}multiplyScalar(t){return this.set(this._x*t,this._y*t)}length(){return Je(this._x,this._y)}normalize(){return Gf[0]=this._x,Gf[1]=this._y,ls(Gf),this.set(Gf[0],Gf[1])}distanceTo(t){return Je(this._x-t.x,this._y-t.y)}fromArray(t,r=0){return this.set(t[r],t[r+1])}toArray(){return[this._x,this._y]}},Hf=class e{isVector4=!0;x;y;z;w;constructor(t=0,r=0,n=0,o=1){this.x=t,this.y=r,this.z=n,this.w=o}set(t,r,n,o){return this.x=t,this.y=r,this.z=n,this.w=o,this}copy(t){return this.set(t.x,t.y,t.z,t.w)}clone(){return new e(this.x,this.y,this.z,this.w)}toArray(){return[this.x,this.y,this.z,this.w]}},cw=new Float64Array(3),uw=new Float64Array(3),Wf=class e{radius;phi;theta;constructor(t=1,r=0,n=0){this.radius=t,this.phi=r,this.theta=n}set(t,r,n){return this.radius=t,this.phi=r,this.theta=n,this}setFromVector3(t){cw[0]=t.x,cw[1]=t.y,cw[2]=t.z,uw[0]=0,uw[1]=this.theta,uw[2]=this.phi;let[r,n,o]=lw(uw,cw);return this.set(r,r===0?0:o,r===0?0:n)}clone(){return new e(this.radius,this.phi,this.theta)}};var dw=21,zc=Array.from({length:23-dw+1},(e,t)=>23-t);function OL(e){return zc.includes(e)}var Yce={texturePreviews:"texture preview count",texturePreviewBytes:"texture preview byte length",texturePreviewBc7Bytes:"texture preview BC block byte length",texturePreviewAstcBytes:"texture preview ASTC block byte length",texturePreviewEtc2Bytes:"texture preview ETC2 block byte length",bytes:"byte length"};function zf(e){if(!e||typeof e!="object"||Array.isArray(e))throw new E("UNSUPPORTED_FORMAT","Manifest binary descriptor is not an object",{});let t=e;if(!OL(t.version))throw new E("UNSUPPORTED_FORMAT",`Expected manifest binary version ${zc.join(", ")}, received ${String(t.version)}`,{version:t.version??null,expected:23});for(let n of["url","sha256"])if(typeof t[n]!="string"||!t[n])throw new E("UNSUPPORTED_FORMAT",`Manifest binary descriptor misses ${n}`,{key:n});for(let[n,o]of Object.entries(Yce)){let i=t[n];if(!Number.isSafeInteger(i)||i<0)throw new E("UNSUPPORTED_FORMAT",`Manifest binary descriptor has no ${o}`,{[n]:i??null})}let r=t.texturePreviewPixels;if(t.version===dw&&r!==void 0)throw new E("INVALID_CACHE",`Manifest binary version ${dw} keeps its previews' pixels inline`,{version:t.version});if(t.version!==dw&&t.texturePreviewBytes!==0)throw new E("INVALID_CACHE",`Manifest binary version ${String(t.version)} keeps no preview pixel in its sidecar`,{version:t.version,texturePreviewBytes:t.texturePreviewBytes});if(r!==void 0&&(!r||typeof r!="object"||typeof r.url!="string"||!r.url||!Number.isSafeInteger(r.bytes)||r.bytes<=0||typeof r.sha256!="string"||!/^[0-9a-f]{64}$/.test(r.sha256)))throw new E("UNSUPPORTED_FORMAT","Manifest binary descriptor has a bad pixel file",{texturePreviewPixels:r??null})}var Kce=0,qce=1,LL=2,qV=["srgb","linear","hdr"];function fw(e){return Number.isInteger(e)?qV[e]:void 0}var XV=e=>e===2?0:e,Xce=8,RL=e=>e===2?Xce:4,wYe="rgba16f",Ba=["bc7","astc","etc2"],Qce="bc7",Zce=["lossless","rgba","two-channel"],QV=["lossless","rgba","two-channel","hdr","one-channel","gray","displacement","float32","single-float","half-single"],ZV={bc7:{rgba:"bc7","two-channel":"bc5",hdr:"bc6h","one-channel":"bc4",gray:"g8",displacement:"a8",float32:"rgba32f","single-float":"r32f","half-single":"r16f"},astc:{rgba:"astc","two-channel":"astc-la"},etc2:{rgba:"etc2","two-channel":"eac-rg"}},JV=e=>Jce[e]??jc,Jce={"one-channel":8,float32:256,"single-float":64,"half-single":32},_L=4,jc=16;function ML(e,t,r){return[Aa(e,r),Aa(t,r)]}function eG(e,t){let r=0;for(;r<31;){let[n,o]=ML(e,t,r);if(n<=64&&o<=64)break;r++}return r}function tG(e,t){return sO(Math.max(1,e,t))}var vL=e=>St(e,_L);function pw(e,t,r=jc){return vL(e)*vL(t)*r}function hw(e,t,r=4){let n=eG(e,t),o=tG(e,t),i=[],s=0,a=0;for(let l=n;l<=o;l++){let c=ML(e,t,l);i.push(c),s+=c[0]*c[1]*r,a+=pw(...c)}return{firstLevel:n,levelCount:o-n+1,sizes:i,pixelBytes:s,blockBytes:a}}function eue(e,t){return hw(e,t).blockBytes}function tue(e){return e.bakedLevels===e.firstLevel}var rue=1,DL=3,rG=0,nG=1,oG=2,PL=3,iG=0,sG=1,aG=2,nue=["PAGE_INTEGRATION_UNKNOWN","PAGE_INTEGRATION_WORKER"];var oue=64;function lG(e,t){if(t>oue){e.subarray(0,t).sort();return}for(let r=1;r<t;r++){let n=e[r],o=r-1;for(;o>=0&&e[o]>n;)e[o+1]=e[o],o--;e[o+1]=n}}function iue(e,t,r){let n=e.length/3|0,{slices:o,pages:i}=r,s=0,a=!0,l=-1;for(let c=0;c<n;c++){let u=c*3,d=e[u+0],f=e[u+2],h=c*3,m=d<0;o[h+0]=m?0:d/4,o[h+1]=m?t:e[u+1]*3,o[h+2]=f,!(f<0)&&(f<=l&&(a=!1),l=f,i[s++]=f)}return a||lG(i,s),r.count=n,r.pageCount=s,r}function sue(e){let t=Math.max(1,e);return{slices:new Int32Array(t*3),count:0,pages:new Int32Array(t),pageCount:0}}var CL="quantized",$c=["pageBounds","pageSphere","pageParentSphere","pageError","pageInt","pageU32","geometryU32","cullingNodes","groupLevel","groupError","groupSphere","groupChildCount","groupChild","groupOutputCount","groupOutput","structureRoot","bundleU32","bundleSha","pageDepthLayer","texturePreviewU32","texturePreviewSha","texturePreviewPixels","texturePreviewBc7","texturePreviewAstc","texturePreviewEtc2","bundleDependencyCount","bundleDependency","bundleDecodedBytes"],lue=23,uG=e=>e>=lue?$c.length:$c.length-1,mw={pageBounds:"f64",pageSphere:"f64",pageParentSphere:"f64",pageError:"f64",pageInt:"i32",pageU32:"u32",geometryU32:"u32",cullingNodes:"f64",groupLevel:"i32",groupError:"f64",groupSphere:"f64",groupChildCount:"i32",groupChild:"i32",groupOutputCount:"i32",groupOutput:"i32",structureRoot:"i32",bundleU32:"u32",bundleSha:"u8",pageDepthLayer:"u32",texturePreviewU32:"u32",texturePreviewSha:"u8",texturePreviewPixels:"u8",texturePreviewBc7:"u8",texturePreviewAstc:"u8",texturePreviewEtc2:"u8",bundleDependencyCount:"u32",bundleDependency:"u32",bundleDecodedBytes:"u32"},gw={pageBounds:6,pageSphere:4,pageParentSphere:4,pageError:2,pageInt:8,pageU32:1,geometryU32:7,cullingNodes:16,groupLevel:1,groupError:1,groupSphere:4,groupChildCount:1,groupChild:1,groupOutputCount:1,groupOutput:1,structureRoot:1,bundleU32:4,bundleSha:64,pageDepthLayer:1,texturePreviewU32:15,texturePreviewSha:64,texturePreviewPixels:1,texturePreviewBc7:1,texturePreviewAstc:1,texturePreviewEtc2:1,bundleDependencyCount:1,bundleDependency:1,bundleDecodedBytes:1},IL={f64:8,i32:4,u32:4,u8:1},dG=0,kL=1,FL=2,NL=3,fG=4,pG=5,hG=6,BL=7,mG=0,gG=1,SG=2,wG=3,yG=4,xG=5,bG=6,EG=0,TG=1,AG=2,OG=3;function RG(e,t,r){if(e.culling===void 0)return;if(e.culling===null)return null;let{stride:n,count:o}=e.culling;if(n!==16)throw new E("UNSUPPORTED_FORMAT","Manifest binary culling stride differs from this version",{stride:n});let i={stride:n,count:o,nodes:Array.from(t.subarray(r.node*n,(r.node+o)*n))};return r.node+=o,i}function _G(e,t,r){if(e.structure===void 0)return;if(e.structure===null)return null;let n=new Array(e.structure.groups);for(let i=0;i<e.structure.groups;i++,r.group++){let s=r.group,a=Array.from(t.groupChild.subarray(r.child,r.child+t.groupChildCount[s]));r.child+=t.groupChildCount[s];let l=Array.from(t.groupOutput.subarray(r.output,r.output+t.groupOutputCount[s]));r.output+=t.groupOutputCount[s],n[i]={level:t.groupLevel[s],error:t.groupError[s],sphere:[t.groupSphere[s*4],t.groupSphere[s*4+1],t.groupSphere[s*4+2],t.groupSphere[s*4+3]],children:a,outputs:l}}let o=Array.from(t.structureRoot.subarray(r.root,r.root+e.structure.roots));return r.root+=e.structure.roots,{version:e.structure.version,roots:o,groups:n}}var cue=e=>e?{decodedBytes:e}:{};function vG(e,{bundleWords:t,bundleShaText:r,bundleDecodedBytes:n,...o},i,s){if(!e.streams)return;let a=new Array(e.streams.pages);for(let l=0;l<e.streams.pages;l++,s.bundle++){let c=s.bundle*4,u=i[t[c+EG]];if(!u)throw new E("INVALID_CACHE","A bundle lies in a geometry file the manifest lacks",{bundle:l});let d=t[c+TG],f=o.bundleDependencyCount[s.bundle];a[l]={url:WA(u.url,d),range:{file:u.url,offset:d},sha256:r.substring(s.bundle*64,s.bundle*64+64),bytes:t[c+AG],...cue(n?.[s.bundle]),count:t[c+OG],dependencies:Array.from(o.bundleDependency.subarray(s.dependency,s.dependency+=f))}}return{version:e.streams.version,pinned:e.streams.pinned,bundleBytes:e.streams.bundleBytes,dependencyBound:e.streams.dependencyBound,maxDependencies:e.streams.maxDependencies,pages:a}}function UL(e,t=4,r=jc){return{rgba:e.sizes.map(([n,o])=>n*o*t),blocks:e.sizes.map(([n,o])=>pw(n,o,r))}}function MG(e,t,r,n){let{texture:o,atlas:i,width:s,height:a,bakedLevels:l}=t;if(fw(i)===void 0)throw new E("INVALID_CACHE","A texture preview names an unknown atlas",{entry:e,atlas:i});let c=o*2+XV(i);if(!Number.isInteger(o)||c<=r)throw new E("INVALID_CACHE","Texture previews are not ordered by texture and atlas",{entry:e,texture:o,atlas:i});if(!(s>0)||!(a>0))throw new E("INVALID_CACHE","A texture preview declares an empty source image",{entry:e,width:s,height:a});if(!Number.isInteger(l)||l<0||l>n)throw new E("INVALID_CACHE","A texture preview bakes more levels than lie above its tail",{entry:e,bakedLevels:l});return c}function Aue(e,t,r){let n=QV[r];if(n===void 0)throw new E("INVALID_CACHE","A texture preview names an unknown block layout",{entry:e,format:t,word:r});return n}function VL(e,t,r){return{views:r.map(o=>{let i=e.subarray(t,t+o);return t+=o,i}),end:t}}function DG({atlas:e,width:t,height:r}){let n=RL(e);return UL(hw(t,r,n),n).rgba}function PG(e,t){if(e!==t)throw new E("INVALID_CACHE",`A texture preview pixel file is too ${e<t?"short":"long"}`,{file:e,expected:t})}function Oue(e,{width:t,height:r},n,o){if(n.firstLevel!==o.firstLevel||n.levelCount!==o.levelCount||n.pixelBytes!==o.pixelBytes)throw new E("INVALID_CACHE","A texture preview level geometry is not the one its dimensions imply",{entry:e,width:t,height:r,declared:n,expected:o})}function Lue(e,t,r,n,o){if(t!==r||t+n>o)throw new E("INVALID_CACHE","A texture preview pixel range is not contiguous",{entry:e,offset:t,expected:r,bytes:n,column:o})}function Rue(e,t){for(let r of Ba)if(e[r]!==t[r].length)throw new E("INVALID_CACHE","A texture preview block column is too long",{format:r,column:t[r].length,expected:e[r]})}function _ue(e,t,r,n,{previewBlocks:o,blocksAt:i,expected:s,texelBytes:a}){let l={},c={};return Ba.forEach((u,d)=>{if(l[u]=Aue(e,u,t[r+12+d]),n===2!=(l[u]==="hdr"||l[u]==="float32")&&l[u]!=="lossless")throw new E("INVALID_CACHE","A texture preview names a block layout its atlas cannot hold",{entry:e,format:u});if(l[u]==="lossless"){c[u]=[];return}let f=o[u],h=UL(s,a,JV(l[u]));if(i[u]+_n(h.blocks)>f.length)throw new E("INVALID_CACHE","A texture preview block column is too short",{entry:e,format:u,column:f.length});let m=VL(f,i[u],h.blocks);c[u]=m.views,i[u]=m.end}),{layouts:l,blocks:c}}function CG(e){let{count:t,previewWords:r,previewShaText:n,previewPixels:o,previewBlocks:i}=e,s=e.externalPixelBytes!==void 0;if(s&&o.length>0)throw new E("INVALID_CACHE","A texture preview pixel file leaves the sidecar column filled",{column:o.length});let a=e.externalPixelBytes??o.length,l=new Array(t),c=-1,u=0,d=Object.fromEntries(Ba.map(f=>[f,0]));for(let f=0;f<t;f++){let h=f*15,m=r[h+0],w=r[h+2],x=r[h+3],b=r[h+10],T=r[h+11],L=RL(b),_=hw(w,x,L);c=MG(f,{texture:m,atlas:b,width:w,height:x,bakedLevels:T},c,_.firstLevel);let C=r[h+6],j={firstLevel:C,levelCount:r[h+7],pixelBytes:r[h+9]},$=r[h+8];Oue(f,{width:w,height:x},j,_),Lue(f,$,u,j.pixelBytes,a);let q=DG({atlas:b,width:w,height:x}),le=s?q.map(()=>new Uint8Array(0)):VL(o,$,q).views;u=$+_n(q);let{layouts:ge,blocks:Ue}=_ue(f,r,h,b,{previewBlocks:i,blocksAt:d,expected:_,texelBytes:L}),ye=r[h+4];l[f]={texture:m,image:r[h+1],width:w,height:x,sourceKind:ye,sourceBufferView:ye===0?-1:r[h+5],sha256:n.substring(f*64,f*64+64),atlas:b,firstLevel:C,bakedLevels:T,levels:le,layouts:ge,blocks:Ue}}return Rue(d,i),s&&PG(a,u),l}function NYe(e,t){let r=e.map(DG);PG(t.length,_n(r.map(_n)));let n=0;e.forEach((o,i)=>{let s=VL(t,n,r[i]);s.views.forEach((a,l)=>o.levels[l]=a),n=s.end})}var vue={pageBounds:"pages",pageSphere:"pages",pageParentSphere:"pages",pageError:"pages",pageInt:"pages",pageU32:"pages",geometryU32:"pages",pageDepthLayer:"pages",cullingNodes:"cullingNodes",groupLevel:"groups",groupError:"groups",groupSphere:"groups",groupChildCount:"groups",groupOutputCount:"groups",groupChild:"children",groupOutput:"outputs",structureRoot:"roots",bundleU32:"bundles",bundleSha:"bundles",texturePreviewU32:"previews",texturePreviewSha:"previews",texturePreviewPixels:"previewBytes",texturePreviewBc7:"bc7",texturePreviewAstc:"astc",texturePreviewEtc2:"etc2",bundleDependencyCount:"bundles",bundleDependency:"bundleDependencies",bundleDecodedBytes:"bundles"},Mue=e=>Ba.includes(e);function IG(e,t){let r=vue[e];return Mue(r)?t.previewBlockBytes[r]:t[r]}function Due(e){let t=o=>{if(e.byteLength<o*4)throw new E("INVALID_CACHE","Manifest binary is shorter than its header",{bytes:e.byteLength})};t(4);let r=new Uint32Array(e,0,4);if(r[0]!==1112360791)throw new E("INVALID_CACHE","Manifest binary has no WGMB signature",{magic:r[0]});if(!OL(r[1]))throw new E("UNSUPPORTED_FORMAT",`Expected manifest binary version ${zc.join(", ")}, received ${r[1]}`,{version:r[1]});let n=uG(r[1]);if(t(4+n*2),r[2]!==n)throw new E("UNSUPPORTED_FORMAT","Manifest binary column count differs from this version",{columns:r[2],expected:n});return{header:new Uint32Array(e,0,4+n*2),names:$c.slice(0,n)}}function Pue(e){let t={pages:0,cullingNodes:0,groups:0,children:0,outputs:0,roots:0,bundles:0,bundleDependencies:0,previews:e.binary.texturePreviews,previewBytes:e.binary.texturePreviewBytes,previewBlockBytes:{bc7:e.binary.texturePreviewBc7Bytes,astc:e.binary.texturePreviewAstcBytes,etc2:e.binary.texturePreviewEtc2Bytes}};for(let r of e.primitives){let n=r.binary;if(!n||!Number.isSafeInteger(n.pages)||n.pages<0)throw new E("INVALID_CACHE","A primitive has no binary page count",{mesh:r.mesh,primitive:r.primitive});t.pages+=n.pages,t.cullingNodes+=n.culling?.count??0,t.groups+=n.structure?.groups??0,t.roots+=n.structure?.roots??0,t.bundles+=n.streams?.pages??0}return t}function Cue(e,t){let r=i=>({offset:t[4+i*2],length:t[4+i*2+1]});return{column:(i,s)=>{let a=$c.indexOf(i),{offset:l,length:c}=r(a),u=IL[mw[i]];if(l%8!==0||c%u!==0||l+c>e.byteLength)throw new E("INVALID_CACHE",`Manifest binary column ${i} is out of bounds`,{column:i,offset:l,length:c,bytes:e.byteLength});return s(e,l,c/u)},expect:(i,s)=>{let{length:a}=r($c.indexOf(i)),l=s*gw[i]*IL[mw[i]];if(a!==l)throw new E("INVALID_CACHE",`Manifest binary column ${i} does not match the declared counts`,{column:i,length:a,expected:l})}}}function Iue(e,t,r){for(let n=0;n<e.groups;n++){if(t[n]<0||r[n]<0)throw new E("INVALID_CACHE","A group declares a negative member count",{group:n});e.children+=t[n],e.outputs+=r[n]}}function kue(e){return{bounds:e("pageBounds",(t,r,n)=>new Float64Array(t,r,n)),sphere:e("pageSphere",(t,r,n)=>new Float64Array(t,r,n)),parentSphere:e("pageParentSphere",(t,r,n)=>new Float64Array(t,r,n)),error:e("pageError",(t,r,n)=>new Float64Array(t,r,n)),ints:e("pageInt",(t,r,n)=>new Int32Array(t,r,n)),words:e("pageU32",(t,r,n)=>new Uint32Array(t,r,n)),geometryWords:e("geometryU32",(t,r,n)=>new Uint32Array(t,r,n)),pageDepthLayer:e("pageDepthLayer",(t,r,n)=>new Uint32Array(t,r,n))}}function Fue(e,t,r){return{groupLevel:e("groupLevel",(n,o,i)=>new Int32Array(n,o,i)),groupError:e("groupError",(n,o,i)=>new Float64Array(n,o,i)),groupSphere:e("groupSphere",(n,o,i)=>new Float64Array(n,o,i)),groupChildCount:t,groupOutputCount:r,groupChild:e("groupChild",(n,o,i)=>new Int32Array(n,o,i)),groupOutput:e("groupOutput",(n,o,i)=>new Int32Array(n,o,i)),structureRoot:e("structureRoot",(n,o,i)=>new Int32Array(n,o,i))}}function Nue(e,t,r){let n=new TextDecoder("latin1");return{bundleWords:e("bundleU32",(o,i,s)=>new Uint32Array(o,i,s)),bundleShaText:n.decode(e("bundleSha",(o,i,s)=>new Uint8Array(o,i,s))),bundleDependencyCount:t,bundleDependency:e("bundleDependency",(o,i,s)=>new Uint32Array(o,i,s)),bundleDecodedBytes:r?e("bundleDecodedBytes",(o,i,s)=>new Uint32Array(o,i,s)):void 0}}function Bue(e,t){let r=n=>e(n,(o,i,s)=>new Uint8Array(o,i,s));return{count:t,previewWords:e("texturePreviewU32",(n,o,i)=>new Uint32Array(n,o,i)),previewShaText:new TextDecoder("latin1").decode(r("texturePreviewSha")),previewPixels:r("texturePreviewPixels"),previewBlocks:{bc7:r("texturePreviewBc7"),astc:r("texturePreviewAstc"),etc2:r("texturePreviewEtc2")}}}function kG(e,t){zf(e.binary);let{header:r,names:n}=Due(t),o=Pue(e),{column:i,expect:s}=Cue(t,r);s("groupChildCount",o.groups),s("groupOutputCount",o.groups);let a=i("groupChildCount",(u,d,f)=>new Int32Array(u,d,f)),l=i("groupOutputCount",(u,d,f)=>new Int32Array(u,d,f));Iue(o,a,l),s("bundleDependencyCount",o.bundles);let c=i("bundleDependencyCount",(u,d,f)=>new Uint32Array(u,d,f));for(let u=0;u<o.bundles;u++)o.bundleDependencies+=c[u];for(let u of n)s(u,IG(u,o));return{pages:kue(i),groups:Fue(i,a,l),bundles:Nue(i,c,n.includes("bundleDecodedBytes")),previews:Bue(i,o.previews),cullingNodes:i("cullingNodes",(u,d,f)=>new Float64Array(u,d,f))}}function Uue(e,t,r,n){let{sphere:o,parentSphere:i,error:s,ints:a,pageDepthLayer:l}=n,c=t*8;r&1&&(e.role=r&2?"coarse":"exact"),a[c+BL]>=0&&(e.start=a[c+BL]),a[c+kL]>=0&&(e.level=a[c+kL]),r&8&&(e.lodError=s[t*2],e.sphere=[o[t*4],o[t*4+1],o[t*4+2],o[t*4+3]]),r&16&&(e.parentError=r&32?s[t*2+1]:null),r&64&&(e.parentSphere=r&128?[i[t*4],i[t*4+1],i[t*4+2],i[t*4+3]]:null),r&256&&(e.group=a[c+FL]>=0?a[c+FL]:null),r&512&&(e.source=a[c+NL]>=0?a[c+NL]:null),l[t]>0&&(e.depthLayer=l[t])}function Vue(e,t,r){let{bounds:n,ints:o,words:i,geometryWords:s}=t,a=i[e],l=e*8,c=e*gw.geometryU32,u=o[l+fG],d=r?.pages[u];if(!d)throw new E("INVALID_CACHE","A page lies in no bundle of its primitive",{page:e,stream:u});let f=o[l+pG],{file:h,offset:m}=d.range,w={url:d.decodedBytes===void 0?GA(h,m+f):HA(h,m,f),bundle:{url:d.url,offset:f},sha256:d.sha256,bytes:s[c+mG],residentBytes:s[c+xG],residentOffset:s[c+bG],vertexCount:s[c+gG],indexCount:s[c+SG],flags:s[c+wG],uncompressedBytes:s[c+yG]},x={id:o[l+dG],url:w.url,sha256:w.sha256,bytes:w.bytes,count:o[l+hG],min:[n[e*6],n[e*6+1],n[e*6+2]],max:[n[e*6+3],n[e*6+4],n[e*6+5]],geometry:w,stream:u,streamOffset:f};return Uue(x,e,a,t),x}function GL(e,t){let{pages:r,groups:n,bundles:o,previews:i,cullingNodes:s}=kG(e,t),a=e.geometryFiles??[],l={node:0,group:0,child:0,output:0,root:0,bundle:0,dependency:0},c=0,u=e.primitives.map(x=>{let b=x.binary,T=vG(b,o,a,l),L=new Array(b.pages);for(let q=0;q<b.pages;q++,c++)L[q]=Vue(c,r,T);let _=RG(b,s,l),D=_G(b,n,l),{binary:C,...j}=x,$={...j,pages:L};return _!==void 0&&($.culling=_),D!==void 0&&($.structure=D),T!==void 0&&($.streams=T),$}),{binary:d,primitives:f,geometryFiles:h,...m}=e,w=e.binary.texturePreviewPixels;return{...m,primitives:u,texturePreviews:CG({...i,externalPixelBytes:w?.bytes}),...w&&{texturePreviewPixels:w}}}var HL=12;var aKe=[["normal",3,1],["uv",2,2],["uv1",2,4],["uv2",2,512],["uv3",2,1024],["uv4",2,2048],["uv5",2,4096],["uv6",2,8192],["uv7",2,16384],["color",4,8],["tangent",4,128]];function Gue(e,t,r){let n=t;if(!n||n.version!==e.version&&!e.alsoVersions?.includes(n.version))throw new E(e.unsupported,`${r} version ${String(n?.version)} is not the ${e.version} this runtime reads`,{version:n?.version??null});return n}var uKe=(e,t)=>Array.isArray(e)&&e.every(r=>typeof r=="string"&&r.length===t&&/^[0-9a-f]+$/.test(r)),dKe=(e,t)=>Array.isArray(e)&&e.length===t&&e.every(r=>typeof r=="string"&&/^([0-9a-f]{8})*$/.test(r)),FG=new DataView(new ArrayBuffer(8)),Hue=new TextDecoder,Wue=e=>JSON.parse(Hue.decode(e)),zue=e=>(FG.setBigUint64(0,BigInt(`0x${e}`)),FG.getFloat64(0)),jue=e=>[0,1,2,3,4,5].map(t=>zue(e.slice(16*t,16*(t+1)))),$ue=e=>typeof e=="string"&&/^[0-9a-f]{168}$/.test(e),Yue=(e,t,r)=>parseInt(e.slice(t,r),16),Kue=e=>Array.from({length:e.length/8},(t,r)=>Yue(e,8*r,8*r+8));function que(e,t,r=""){if(!$ue(t))throw new E(e.invalid,"a page slot is not fixed-width hex",{});let n=parseInt(t.slice(64,72),16);if(n===0)return null;let o=t.slice(0,64),i=jue(t.slice(72));return{page:{url:`${e.prefix}${o}.json`,bytes:n,sha256:o},bounds:i,parents:Kue(r)}}async function Xue(e,t,r){return Gue(e,Wue(await r(t)),t.url)}var $f=(e,t,r)=>t.map((n,o)=>que(e,n,r?.[o])).filter(n=>n!==null);async function WL(e,t,r){return(await Promise.all(t.map(async({page:o})=>{let i=await Xue(e,o,r);if(Array.isArray(i.pages))return WL(e,$f(e,i.pages),r);if(Array.isArray(i[e.records]))return[i];throw new E(e.invalid,`${o.url} lists neither pages nor records`,{})}))).flat()}var NG=e=>e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.slice().buffer,pKe=(e,t=0,r=(e.byteLength-t)/4)=>(e.byteOffset+t)%4===0?new Uint32Array(e.buffer,e.byteOffset+t,r):new Uint32Array(e.slice(t,t+r*4).buffer);var Sw={prefix:"manifest-page-",version:23,alsoVersions:zc.filter(e=>e!==23),records:"primitives",unsupported:"UNSUPPORTED_FORMAT",invalid:"INVALID_CACHE"};function Que(e){let{head:t,pages:r,...n}=e;if(!Array.isArray(r)||!$f(Sw,[t]).length)throw new E("INVALID_CACHE","the manifest root names no head page or no pages",{});return{head:$f(Sw,[t]),pages:$f(Sw,r),fixed:n}}async function Zue(e,t){return zf(e.binary),{body:e,bytes:NG(await t(e.binary))}}function Jue(e,t){let{version:r,binary:n,primitives:o,...i}=t.body,s=({body:{primitives:a,binary:l},bytes:c})=>GL({...e,...i,primitives:a,binary:l},c);return{metadata:{...s(t),primitives:[]},decode:s}}async function ede(e,t){let{head:r,pages:n,fixed:o}=Que(e),i=await WL(Sw,[...r,...n],t),[s,...a]=await Promise.all(i.map(u=>Zue(u,t))),{metadata:l,decode:c}=Jue(o,s);return{...l,primitives:a.flatMap(u=>c(u).primitives)}}function tde(e,t){let n=ZV[e][t];if(!n)throw new E("INVALID_CACHE","A texture level names a family that holds no chain",{family:e,layout:t});return n}function rde(e,t,r,n,o){let i=fw(r);if(i===void 0)throw new E("INVALID_CACHE","A texture level names an unknown atlas",{atlas:r});if(!/^[0-9a-f]{64}$/.test(t)||!Number.isInteger(n)||n<0)throw new E("INVALID_CACHE","A texture level has an invalid address",{sha256:t,level:n});for(let s of["{sha}","{kind}","{level}","{format}"])if(!e.includes(s))throw new E("INVALID_CACHE","The texture level template lacks a field",{template:e,field:s});return e.replace("{sha}",t).replace("{kind}",i).replace("{level}",String(n)).replace("{format}",o)}var nde={kept:0,missing:1},GKe=1<<18,HKe=16384;function Wo(e){let t=!1,r=()=>{t=!1,e()};return{schedule(){t||(t=!0,queueMicrotask(r))},reset(){t=!1}}}var ode=0,ide=()=>Date.now(),sde=()=>`diagnostics-${Date.now().toString(36)}-${(++ode).toString(36)}`,ade=e=>e.phase==="frame"||e.context?.kind==="frame";function lde(e,t,r){let n=0,o=0,i,s;return{unreported:()=>n,total:()=>o,drop(a){n++,o++,i??=a,s=a},take(){if(!n||i===void 0||s===void 0)return;let a=r(),l={phase:"diagnostic-loss",message:"Diagnostics were dropped because the bounded buffer was full",context:{kind:"loss",dropped:!0,lostCount:n,firstSequence:i,lastSequence:s,bufferCapacity:t},sequence:s,sessionId:e,queuedAt:a,createdAt:a};return n=0,i=void 0,s=void 0,l}}}var cde=(e,t,r,n)=>({...t,sequence:r,sessionId:e,queuedAt:n,createdAt:t.createdAt??(typeof t.context.createdAt=="number"?t.context.createdAt:n)});function ude(e,t,r,n,o){let i=[],s=0,a=lde(n,r,o),l=c=>{try{e?.(c)}catch{}};return{pending:()=>i.length,unreported:a.unreported,total:a.total,push(c){let u=++s,d=cde(n,c,u,o());i.length>=r?a.drop(u):i.push(d)},drain(){if(!t)return;let c=i.splice(0,i.length);for(let d of c)l(d);let u=a.take();u&&l(u)}}}function dde(e,t){return{enabled:t.enabled??e!==void 0,detail:t.detail??"trace",maxBuffer:Number.isSafeInteger(t.maxBuffer)&&t.maxBuffer>0?t.maxBuffer:65536,now:t.now??ide,sessionId:t.sessionId??sde()}}function Yf(e,t={}){let{enabled:r,detail:n,maxBuffer:o,now:i,sessionId:s}=dde(e,t),a=ude(e,r,o,s,i),l=!1,c,u=Wo(()=>void f.flush()),d=()=>{!c&&r&&u.schedule()},f={enabled:r,detail:n,sessionId:s,emit(h){l||!r||n==="summary"&&ade(h)||(a.push(h),d())},flush(){return!r||l&&a.pending()===0&&!a.unreported()?Promise.resolve():c||(c=Promise.resolve().then(a.drain).finally(()=>{c=void 0,(a.pending()||a.unreported())&&d()}),c)},flushSync(){r&&(u.reset(),a.drain())},close(){l||(l=!0,d())},pending:a.pending,dropped:a.total};return f}var BG=[];for(let e=0;e<256;e++)BG.push(e.toString(16).padStart(2,"0"));function ww(e){let t="";for(let r=0;r<e.length;r++)t+=BG[e[r]];return t}function UG(e){return{r:mg(e>>16&255),g:mg(e>>8&255),b:mg(e&255),a:1}}var yw=(e,t,r)=>`#${ww([e,t,r])}`;function fde(e,t,r,n,o="top-left"){let i=(c,u)=>{let d=((o==="bottom-left"?r-1-u:u)*t+c)*4;return yw(e[d]??0,e[d+1]??0,e[d+2]??0)},s=`#${n.toString(16).padStart(6,"0")}`,a=i(0,0),l=i(Math.floor(t/2),Math.floor(r/2));return{clearColor:s,topLeft:a,center:l,matchesClearAtTopLeft:a===s}}function zL(e,t,r,n){return{...fde(e,t,r,n,"bottom-left"),surface:"webgpu-color-target"}}function VG(e,t){if(!(e instanceof E)||e.code!=="PAGE_STREAM_FAILED")return e;let{key:r}=e.details;if(typeof r!="string")return e;let n;for(let s of t){let{base:a}=s.record;r.startsWith(a)&&a.length>(n?.record.base.length??-1)&&(n=s)}if(!n)return e;let o=n.record.manifestUrl,i=new E("PAGE_STREAM_FAILED",`${o}: ${e.message}`,{...e.details,model:o});return Object.assign(i,{cause:e})}var Mi=new WeakMap,xw=new WeakMap,GG=(e,t)=>{Mi.set(e,t);let r=e.scene;r&&xw.set(r,e)},HG=e=>xw.get(e),Kf=e=>xw.get(e)?.modules,WG=e=>void xw.delete(e);function $L(e,t){if(t)throw t.refusal();if(!e)throw new Error("This world draws nothing yet: add an object or load a model first");return e}function Ua(e){let t=Mi.get(e);return $L(t?.session(),t?.parts?.headless)}async function jL(e){return await Mi.get(e)?.awaitPages(),Ua(e)}async function YL(e,t){let r=Mi.get(e),n=r?.parts,o=n?.leases.take();try{let i=()=>n?.state.disposed?null:r?.session()??null;return await t({now:i,first:async()=>i()??(n?.runtime.holdsSession?jL(e):Ua(e)),ready:()=>jL(e),closedBy:s=>n?.runtime.closedBy(s)??[],get gone(){return n?.state.disposed??!1}})}finally{o?.()}}var pde=3;function bw(e,t,r=jL){return YL(e,async n=>{let o;for(let i=0;i<pde;i++){let s;try{if(n.gone)break;return s=await(i?n.ready():r(e)),await t(s)}catch(a){if(n.gone)break;if(!(s&&n.now()!==s&&n.closedBy(s).length))throw a;o=a}}throw n.gone?new E("WORLD_DISPOSED","The world was disposed before the operation ended"):o})}var nqe=(e,t)=>Mi.get(e)?.drawnFrom?.(t),hde=[],oqe=e=>Mi.get(e)?.views?.()??hde,iqe=e=>Mi.get(e)?.mainRect?.(),zG=e=>Mi.get(e)?.parts,KL=e=>Mi.get(e)?.last()??null;async function jG(e,t,r){r?.({phase:"session",completed:0,total:1,message:"The view opens"});let n={};for(;;){await e.drawable();let o=t();if(!o)return;let i=o.awaitPages({image:!1,onProgress:r});i.catch(()=>{});try{await e.untilEnded(o,i)}catch(s){if(t()===o)throw VG(s,e.models)}if(t()===o&&!e.handing(n))return}}var Tw={slots:0,bytes:0},Xf=(e,t,r,n=Tw)=>{let o=(t-n.slots)*e+n.slots*n.bytes;return r!==void 0&&r<=o?r:o};function Ew(e){let t=e.values().next();return t.done?-1:(e.delete(t.value),t.value)}var zo=(e,t)=>e.units?.(t)??{unit:t,offset:0},qf=(e,t)=>e.roots.slots>0&&!!e.rootUrls?.has(t),Yc=(e,t,r,n,o)=>{let i={start:r,keys:new Set(o===void 0?[]:[o]),root:n};return e.placed.set(t,i),i},YG=(e,t,r,n)=>r<0?-1:Yc(e,t,e.rootStart+r*e.grain,!0,n).start,$G=(e,t,r)=>e.placed.get(t)?.root??(r!==void 0&&qf(e,r))?e.grain:e.widest,mde=(e,t,r)=>{let{unit:n,offset:o}=zo(e,t),i=e.placed.get(n);if(i)return i.keys.add(t),{offset:i.start+o,start:i.start,victims:[]};if(e.held){let u=e.held.homes.get(n);if(!u)throw new Error("PAGE_HOME_MISSING");let{start:d}=Yc(e,n,u.offset,!1,t);return{offset:d+o,start:d,victims:[]}}if(qf(e,t)){let u=YG(e,n,Ew(e.freeRoots),t);return u<0?"no-free-slot":{offset:u+o,start:u,victims:[]}}let s=r&&zo(e,r.key).unit,a=s===void 0?void 0:e.placed.get(s);if(s!==void 0&&a&&!a.root){e.placed.delete(s);let u=[...a.keys].flatMap(f=>e.resident.get(f)??[]),{start:d}=Yc(e,n,a.start,!1,t);return{offset:d+o,start:d,victims:u}}let l=Ew(e.free);if(l<0)return"no-free-slot";let{start:c}=Yc(e,n,l*e.widest,!1,t);return{offset:c+o,start:c,victims:[]}},gde=(e,t,r,n)=>{if(e.held){let a=e.held.homes.get(t);return a?Yc(e,t,a.offset,!1).start:-1}if(qf(e,n)){let a=(r-e.rootStart)/e.grain,l=r>=e.rootStart&&Number.isInteger(a)&&e.freeRoots.delete(a);return YG(e,t,l?a:Ew(e.freeRoots))}let o=r/e.widest,s=r<e.rootStart&&Number.isInteger(o)&&e.free.delete(o)?o:Ew(e.free);return s<0?-1:Yc(e,t,s*e.widest,!1).start},Sde=(e,t)=>{let{unit:r}=zo(e,t.key),n=e.placed.get(r);!n?.keys.delete(t.key)||n.keys.size||(e.placed.delete(r),!e.held&&(n.root?e.freeRoots.add((n.start-e.rootStart)/e.grain):e.free.add(n.start/e.widest)))};function wde(e,t){return{room(r){let{unit:n,offset:o}=zo(e,r);return(t?.homes.get(n)?.bytes??$G(e,n,r))-o},startOf:r=>e.placed.get(zo(e,r).unit)?.start,offsetIn:r=>zo(e,r).offset,sameUnit:(r,n)=>zo(e,r).unit===zo(e,n).unit,holds:r=>e.placed.has(zo(e,r).unit),rooted:r=>qf(e,r),placed:e.placed,widthOf:r=>e.held?.homes.get(r)?.bytes??$G(e,r),freeFor(r){return e.held?e.held.homes.size-e.placed.size:r!==void 0&&qf(e,r)?e.freeRoots.size:e.free.size}}}function yde(e){return{place:(t,r)=>mde(e,t,r),keep:(t,r,n)=>gde(e,t,r,n),hold(t){e.placed.get(zo(e,t).unit)?.keys.add(t)},freed:t=>Sde(e,t)}}function Aw(e){let{homes:t,widest:r,units:n,rootUrls:o,resident:i}=e,s=t&&e.bytes>=t.bytes?t:void 0,a=!s&&e.roots||Tw,l=a.bytes,c=e.bytes-a.slots*l,u=new Set,d=new Set;if(!s){for(let h=0;h<Math.floor(c/r);h++)u.add(h);for(let h=0;h<a.slots;h++)d.add(h)}let f={held:s,widest:r,units:n,rootUrls:o,resident:i,roots:a,grain:l,rootStart:c,placed:new Map,free:u,freeRoots:d};return W({...wde(f,t),...yde(f),get rootFree(){return f.freeRoots.size}})}var Ow=e=>Math.min(e?.maxBufferSize??1/0,e?.maxStorageBufferBindingSize??1/0),KG=e=>Math.max(256,e?.minUniformBufferOffsetAlignment??256),dqe=(e,t)=>KG(e)*t;function fqe(e,t,r,n=!1){let o=KG(e);if(r*4>o)throw new Error(`UNIFORM_SLOT_WORDS: ${r} words past ${o} bytes`);let i=Array.from({length:t},(s,a)=>[a*o]);return{count:t,words:r,stride:o,strideWords:o/4,bytes:o*t,offset:s=>{if(s>=t&&!n)throw new Error(`UNIFORM_SLOT_PAST_COUNT: slot ${s} of ${t} slots of ${r} words`);return i[s]??=[s*o]}}}var Di=(e,t)=>{if(!Number.isSafeInteger(e)||e<1)throw new Error(t)},pqe=e=>Di(e,"INVALID_TEXTURE_POOL_BUDGET"),xde=e=>Di(e,"INVALID_GEOMETRY_POOL_BUDGET");function hqe(e){let{budgetBytes:t,pageBytes:r,uniquePages:n,maxResidentPages:o,limits:i}=e;xde(t);let s={slots:e.rootPages,bytes:e.rootBytes||r},a=Math.max(1,s.slots),l=Math.max(0,Math.floor(t/r)),c=null;o!==void 0&&o<l&&(l=o,c="page-cap"),l===0&&(c="root-cover");let u=a+l;n<u&&(u=Math.max(n,a),c="scene");let{homeBytes:d}=e,f=s.slots*s.bytes,h=b=>d!==void 0&&b>=n?d:Xf(r,b,void 0,s),m=Ow(i),w=m<f?0:s.slots+Math.floor((m-f)/r);if(h(u)>m){if(w>=a)u=w;else if(h(n)<=m)u=n;else throw new Error(`GEOMETRY_POOL_DEVICE_LIMIT: ${a} root pages of ${s.bytes} bytes, device allows ${m}`);c="device-limit"}let x=Tr(a+l,u,w);return{budgetBytes:t,slots:u,budgetSlots:x,pageBytes:r,roots:s,allocatedBytes:h(u),clamp:c}}function mqe(e,t){let{budgetSlots:r,roots:n,pageBytes:o}=e,i=Xf(o,r,void 0,n);return Tr(i,e.allocatedBytes,Ow(t))}var bde=["off","on"],Ede=["low","high","cinematic"],Tde=["none","median","max"],Ade=["off","additive"],Ode=["off","additive","occlusion"],Lde=["off","low","high"],Rde=["low","high"],Lw=A({depthOfFieldQuality:N("depthOfFieldQuality","on",bde),depthOfFieldGatherDivisor:S("depthOfFieldGatherDivisor",2,[1,2]),depthOfFieldAccumulator:N("depthOfFieldAccumulator","high",Ede),depthOfFieldDistinctionLimit:y("depthOfFieldDistinctionLimit",0),depthOfFieldGatherBokeh:p("depthOfFieldGatherBokeh",!1),depthOfFieldPostfilter:N("depthOfFieldPostfilter","median",Tde),depthOfFieldRingCount:S("depthOfFieldRingCount",4,[3,5]),depthOfFieldMaxMips:P("depthOfFieldMaxMips",4,1),depthOfFieldForegroundScatter:N("depthOfFieldForegroundScatter","additive",Ade),depthOfFieldBackgroundScatter:N("depthOfFieldBackgroundScatter","occlusion",Ode),depthOfFieldScatterBokeh:p("depthOfFieldScatterBokeh",!0),depthOfFieldScatterMinRadius:g("depthOfFieldScatterMinRadius",3,U(3)),depthOfFieldScatterMaxRatio:g("depthOfFieldScatterMaxRatio",.1,[0,1]),depthOfFieldScatterNeighborColor:y("depthOfFieldScatterNeighborColor",10),depthOfFieldRecombine:N("depthOfFieldRecombine","low",Lde),depthOfFieldRecombineBokeh:p("depthOfFieldRecombineBokeh",!1),depthOfFieldRecombineMinBlur:y("depthOfFieldRecombineMinBlur",.1),depthOfFieldMaxForegroundRadius:y("depthOfFieldMaxForegroundRadius",.025),depthOfFieldMaxBackgroundRadius:y("depthOfFieldMaxBackgroundRadius",.025),depthOfFieldSlightFocusRejection:g("depthOfFieldSlightFocusRejection",0,[0,.125]),depthOfFieldTemporalQuality:N("depthOfFieldTemporalQuality","high",Rde),depthOfFieldBilateralStrength:g("depthOfFieldBilateralStrength",0,[0,1]),depthOfFieldTemporalCurrentWeight:g("depthOfFieldTemporalCurrentWeight",.04,[0,1])}),Qf={smooth:{depthOfFieldQuality:"off"},balanced:{depthOfFieldGatherDivisor:2,depthOfFieldAccumulator:"low",depthOfFieldPostfilter:"max",depthOfFieldGatherBokeh:!1,depthOfFieldRingCount:3,depthOfFieldForegroundScatter:"off",depthOfFieldBackgroundScatter:"off",depthOfFieldRecombine:"off",depthOfFieldTemporalQuality:"low",depthOfFieldMaxForegroundRadius:.006,depthOfFieldMaxBackgroundRadius:.006},fine:{depthOfFieldGatherDivisor:2,depthOfFieldAccumulator:"low",depthOfFieldPostfilter:"max",depthOfFieldGatherBokeh:!1,depthOfFieldRingCount:4,depthOfFieldForegroundScatter:"additive",depthOfFieldBackgroundScatter:"additive",depthOfFieldScatterBokeh:!1,depthOfFieldScatterMaxRatio:.04,depthOfFieldRecombine:"off",depthOfFieldTemporalQuality:"low",depthOfFieldMaxForegroundRadius:.012,depthOfFieldMaxBackgroundRadius:.012},cinematic:{depthOfFieldQuality:"on",depthOfFieldGatherDivisor:1,depthOfFieldAccumulator:"high",depthOfFieldPostfilter:"median",depthOfFieldGatherBokeh:!0,depthOfFieldRingCount:5,depthOfFieldForegroundScatter:"additive",depthOfFieldBackgroundScatter:"occlusion",depthOfFieldScatterBokeh:!0,depthOfFieldScatterMaxRatio:.25,depthOfFieldRecombine:"high",depthOfFieldRecombineBokeh:!0,depthOfFieldTemporalQuality:"high",depthOfFieldMaxForegroundRadius:.025,depthOfFieldMaxBackgroundRadius:.025}};var _de=["off","lowest","low","medium","high","highest"],xqe={lowest:3,low:3,medium:4,high:5,highest:6},Rw=A({bloomQuality:N("bloomQuality","highest",_de),bloomCross:g("bloomCross",0,R),bloomResolutionShare:y("bloomResolutionShare",50),bloomFollowsLocalExposure:p("bloomFollowsLocalExposure",!0),bloomKeptKernel:p("bloomKeptKernel",!0)}),Zf={smooth:{bloomQuality:"high",bloomResolutionShare:25},balanced:{bloomQuality:"high",bloomResolutionShare:35.355},fine:{bloomQuality:"highest",bloomResolutionShare:50},cinematic:{bloomQuality:"highest",bloomResolutionShare:100}};var _w=A({gaussianFastBlurThreshold:y("gaussianFastBlurThreshold",100),gaussianSampleScale:y("gaussianSampleScale",1),gaussianLoopMode:S("gaussianLoopMode",0,[0,2])}),Jf={smooth:{gaussianFastBlurThreshold:0,gaussianSampleScale:.6},balanced:{gaussianFastBlurThreshold:2,gaussianSampleScale:.7},fine:{gaussianFastBlurThreshold:3,gaussianSampleScale:.8},cinematic:{gaussianFastBlurThreshold:100,gaussianSampleScale:1}};var vde=["off","low","medium","high","veryHigh"],Oqe={low:4,medium:8,high:12,veryHigh:16},vw=A({motionBlurQuality:N("motionBlurQuality","veryHigh",vde),motionBlurHalfResolutionGather:p("motionBlurHalfResolutionGather",!1),motionBlurHalfResolutionInput:p("motionBlurHalfResolutionInput",!0),motionBlurTwoPass:p("motionBlurTwoPass",!1),motionBlurSplat:p("motionBlurSplat",!1),motionBlurDirectionCount:S("motionBlurDirectionCount",1,[1,2]),motionBlurScale:g("motionBlurScale",1,[0,50]),motionBlurAmountOverride:g("motionBlurAmountOverride",-1,U(-1)),motionBlurMaxOverride:g("motionBlurMaxOverride",-1,U(-1)),motionBlurTargetFpsOverride:S("motionBlurTargetFpsOverride",-1,[-1,120])}),tp={smooth:{motionBlurQuality:"off",motionBlurHalfResolutionGather:!0},balanced:{motionBlurQuality:"high",motionBlurHalfResolutionGather:!0},fine:{motionBlurQuality:"high",motionBlurHalfResolutionGather:!1},cinematic:{motionBlurQuality:"veryHigh",motionBlurHalfResolutionGather:!1}},qL=A({amount:g("amount",.05,[0,1]),max:g("max",5,[0,100]),motionBlurTargetFrameRate:S("motionBlurTargetFrameRate",30,[0,120]),cameraMotion:p("cameraMotion",!0)}),ep=.001,Mde=(e,t)=>t.motionBlurAmountOverride>=0?t.motionBlurAmountOverride:e.amount*t.motionBlurScale,Dde=(e,t)=>t.motionBlurMaxOverride>=0?t.motionBlurMaxOverride:e.max,Lqe=(e,t)=>t.motionBlurTargetFpsOverride>=0?t.motionBlurTargetFpsOverride:e.motionBlurTargetFrameRate,qG=(e,t)=>!(Mde(e,t)>ep)||!(Dde(e,t)>ep),XG=(e={})=>Object.freeze(ue(qL,e));var Mw={depthOfField:{settings:Lw,off:e=>e.depthOfFieldQuality==="off"},motionBlur:{settings:vw,off:e=>e.motionBlurQuality==="off",idle:qG},bloom:{settings:{...Rw,..._w},off:e=>e.bloomQuality==="off"},outline:{}};function QG(e,t){let{idle:r,off:n}=Mw[e.kind];return(r?r(e,t(e.kind)):e.idle)?!1:!n?.(t(e.kind))}function Pde(e){let t={};for(let r of Object.keys(Mw)){let n=Mw[r].settings;if(!n)continue;let o={};for(let i of Object.keys(n))Object.defineProperty(o,i,{get:()=>e(i),enumerable:!0});t[r]=o}return t}function XL(e){let t=Pde(e);return{kinds:{bloom:!0,depthOfField:!0,motionBlur:!0,outline:!0},values:r=>t[r]}}function Cde(e,t){for(let r of e)if(t.kinds[r.kind]&&QG(r,t.values))return!0;return!1}var Dw=["bloom","depthOfField","motionBlur","outline"],QL=G({name:"effects",summary:"The passes of a world's effect chain \u2014 the bloom, the depth of field, the motion blur and the outline \u2014, each a part switched alone.",enabledByDefault:!0,requires:[],parts:Dw});function ZL(e,t,r){let n=[];return{switch(o){n.length=0;let i=!1;for(let s of Dw){let a=!!o&&o[s]!==!1;e.kinds[s]!==a&&(e.kinds[s]=a,i=!0,a||n.push(s))}n.length&&r(n),i&&t._touch()},opened(){let o=Dw.filter(i=>!e.kinds[i]);o.length&&r(o)}}}function ZG(e){if(Array.isArray(e))return[e[0]??1,e[1]??1,e[2]??1];let t=e;return[t.width,t.height??1,t.depthOrArrayLayers??1]}var JL={r8unorm:1,r8uint:1,stencil8:1,r16float:2,r16uint:2,rg8unorm:2,rg8uint:2,depth16unorm:2,r32float:4,r32uint:4,rg16float:4,rg16uint:4,rgba8unorm:4,"rgba8unorm-srgb":4,bgra8unorm:4,"bgra8unorm-srgb":4,rgba8uint:4,rgb10a2unorm:4,rg11b10ufloat:4,depth24plus:4,"depth24plus-stencil8":4,depth32float:4,"depth32float-stencil8":5,rg32float:8,rg32uint:8,rgba16float:8,rgba16uint:8,rgba32float:16,rgba32uint:16},JG={"bc1-rgba-unorm":8,"bc1-rgba-unorm-srgb":8,"bc4-r-unorm":8,"bc3-rgba-unorm":16,"bc3-rgba-unorm-srgb":16,"bc5-rg-unorm":16,"bc6h-rgb-ufloat":16,"bc7-rgba-unorm":16,"bc7-rgba-unorm-srgb":16,"astc-4x4-unorm":16,"astc-4x4-unorm-srgb":16,"etc2-rgba8unorm":16,"etc2-rgba8unorm-srgb":16,"eac-rg11unorm":16},Hqe=e=>JL[e]??0,Wqe=e=>JL[e]??(JG[e]??0)/16;function $r(e){let t=JL[e.format],r=JG[e.format];if(t===void 0&&r===void 0)return null;let[n,o,i]=ZG(e.size),s=e.mipLevelCount??1,a=e.dimension==="3d",l=0;for(let c=0;c<s;c++){let u=Aa(n,c),d=Aa(o,c),f=a?Aa(i,c):i;l+=t!==void 0?u*d*f*t:St(u,4)*St(d,4)*f*r}return l*(e.sampleCount??1)}var zqe=(e,t,r,n)=>(r?e*t:1)*n,Ide=e=>$r({size:[e.width,e.height,e.depthOrArrayLayers],format:e.format,mipLevelCount:e.mipLevelCount,sampleCount:e.sampleCount,dimension:e.dimension})??0,jqe=e=>{let t=0;for(let r of e)t+="width"in r?Ide(r):r.size;return t};var Ts="rgba16float",Yqe="rgba16float",kde=()=>GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.COPY_DST,Kqe="depth32float",qqe="rgba8unorm",Xqe="r32uint",Qqe=(e,t)=>({label:"Trillion3D HDR lighting",size:[e,t],format:Ts,usage:kde()});var eR=(e,t,r)=>{if(!K(e)||e<t)throw new RangeError(`${r}:${String(e)}`);return e};function Pw(e,t,r){if(e===void 0)return t;let n=typeof e=="number"?[e,e,e]:[...e];if(n.length!==3)throw new RangeError(r);let[o,i,s]=n.map(a=>eR(a,0,r));return Object.freeze([o,i,s])}var Fde=A({intensity:y("intensity",1),scatterDispersion:y("scatterDispersion",1),size:y("size",1),preFilterMin:g("preFilterMin",7,R),preFilterMax:g("preFilterMax",15e3,R),preFilterMult:g("preFilterMult",15,R),bufferScale:y("bufferScale",.133)});function Nde(e){if(e==null)return;let{width:t,height:r,pixels:n}=e;return!vn(t,r)||!(n instanceof Float32Array)||n.length!==4*t*r?oe("bloom")("convolution.kernel must be { width, height, pixels }, pixels a Float32Array of 4 \xD7 width \xD7 height values"):e}function Cw(e={}){return cc(Fde,e,"kernel",Nde,"bloom.convolution")}function e3(e,t,r){if(e==null)return;let{width:n,height:o}=e;return vn(n,o)?e:t(`${r} must be an image with a width and a height`)}var Bde=A({intensity:y("intensity",0)}),Ude=Object.freeze([.5,.5,.5]);function Iw(e={}){let{image:t,tint:r,...n}=e;return Object.freeze({...ue(Bde,n,"bloom.dirtMask"),image:e3(t,oe("bloom"),"dirtMask.image"),tint:Pw(r,Ude,"BLOOM_DIRT_TINT")})}var Vde=["gaussian","convolution"],Gde=(e,t)=>Object.freeze({size:e,tint:Object.freeze([t,t,t])}),As=6,tR=A({method:N("method","gaussian",Vde),intensity:y("intensity",.675),gaussianIntensity:y("gaussianIntensity",1),threshold:{...g("threshold",-1,U(-1)),takes:"a finite number of at least -1"},sizeScale:y("sizeScale",4)}),Hde=Object.freeze([[.3,.3465],[1,.138],[2,.1176],[10,.066],[30,.066],[64,.061]].map(([e,t])=>Gde(e,t)));function t3(e={}){let t=rR(e.levels),r=ue(tR,e,"bloom"),n=Cw(e.convolution);return nR({method:r.method,convolution:n}),Object.freeze({...r,levels:t,convolution:n,dirtMask:Iw(e.dirtMask)})}function rR(e=[]){return!Array.isArray(e)||e.length>As?oe("bloom")(`levels must list at most ${As} levels`):Object.freeze(Hde.map((t,r)=>Object.freeze({size:eR(e[r]?.size??t.size,0,`BLOOM_SIZE:${r}`),tint:Pw(e[r]?.tint,t.tint,`BLOOM_TINT:${r}`)})))}function nR(e){e.method==="convolution"&&!e.convolution.kernel&&oe("bloom")("method 'convolution' needs convolution.kernel, a picture { width, height, pixels } the host gives: the engine draws none")}var r3=e=>Math.max(1,St(e,2));function kw(e,t,r=[0,0]){return r[0]=r3(e),r[1]=r3(t),r}var n3=Ts;function oR(e,t,r){let n=[kw(e,t)];for(;n.length<r;)n.push(kw(...n[n.length-1]));return n}function Fw(e,t){let r=0;for(let[n,o]of oR(e,t,As))r+=$r({size:{width:n,height:o},format:Ts})??0;return r}function o3(e,t){let r=oR(e,t,As),[n,o]=r[0].map(c=>St(c,64)),[i,s]=r[4],a=$r({size:{width:n,height:o,depthOrArrayLayers:32},dimension:"3d",format:"rgba16float"}),l=$r({size:{width:i,height:s},format:"r16float"});return Fw(e,t)+(a??0)+3*(l??0)+65536}var I9e=1e-8,k9e=e=>e/As,i3=(e,t)=>3*Fw(e,t);var Wde={f32:[1,1],u32:[1,1],i32:[1,1],vec2f:[2,2],vec2u:[2,2],vec2i:[2,2],vec3f:[3,4],vec4f:[4,4],vec4u:[4,4],vec4i:[4,4],mat4x4f:[16,4],"array<vec4f,6>":[24,4],"array<vec4u,2>":[8,4],"array<vec4f,3>":[12,4]};function rp(e,t,r=""){let n=[],o=0,i=1;for(let[l,c]of t){let[u,d]=typeof c=="string"?Wde[c]:[c.words,c.align];o=Vr(o,d),n.push([l,o]),o+=u,i=Math.max(i,d)}let s=`struct ${e}{${t.map(([l,c])=>`${l}:${typeof c=="string"?c:c.wgsl},`).join("")}${r}}`,a=Object.fromEntries(n);return{name:e,at:a,words:Vr(o,i),align:i,wgsl:s}}var B9e=e=>({wgsl:`array<vec4f,${e}>`,words:4*e,align:4});function U9e(e,t,r,n=0,o=0,i=0){e[t]=r,e[t+1]=n,e[t+2]=o,e[t+3]=i}var V9e=e=>({wgsl:`array<u32,${e}>`,words:e,align:1}),G9e=e=>({wgsl:`array<vec2u,${e}>`,words:2*e,align:2});function H9e(e,t){return{wgsl:`array<${e.name},${t}>`,words:e.words*t,align:e.align}}var s3=(e,t)=>(4+e*t)*4;var zde=16,Q9e=3,jde=16,$de={packed:{format:"r32uint",value:"u32",sample:"uint"},float:{format:"rgba32float",value:"f32",sample:"unfilterable-float"}},Z9e=e=>e?"packed":"float",Yde={directions:1,flat:"packed"},J9e=(e,t)=>e.directions===t.directions&&e.flat===t.flat,Kde="rgba16float",qde="depth32float",Xde=Ts,e7e=15,t7e=12,iR=["gatherHalf","gatherFull","weighHalf","weighFull"],Qde="weighTwo",Zde=[...iR,Qde],r7e=e=>e>1?Zde:iR,n7e=e=>e==="gatherHalf"||e==="weighHalf",Jde=rp("MotionBlurParams",[["color","vec4f"],["scale","vec4f"],["tiles","vec4u"],["knobs","vec4f"],["grid","vec2f"],["outputs","vec2f"],["layers","vec4f"]]),efe=Jde.words*4,a3=e=>St(e,zde),l3=e=>St(e,jde),tfe=(e,t)=>l3(e)*l3(t);function c3(e,t){let r=[a3(e),a3(t)],n=(o,i)=>$r({size:o,format:i})??0;return n([e,t],Xde)+n(kw(e,t),n3)+n([e,t],$de[Yde.flat].format)+2*n(r,Kde)+n(r,qde)+iR.length*s3(tfe(e,t),1)+efe}var rfe="rg8unorm",u3=(e,t)=>$r({size:[e,t],format:rfe})??0;var d3=2,p7e=e=>Math.min(e,d3),nfe=(e,t,r)=>($r({size:[e,t],format:Ts})??0)*r;function np(e,t){return nfe(e,t,d3)+o3(e,t)+c3(e,t)+i3(e,t)+u3(e,t)}function f3(e){for(let[t,r]of Object.entries(e))if(!Number.isSafeInteger(r)||r<0)throw new Error(`INVALID_GPU_RESERVATION: ${t}=${r}`)}function p3(e,t,r,n,o,i=0){let s=t+r;if(e<s)throw new Error(`GPU_BUDGET_UNDER_MINIMUM: available=${e}, required=${s}`);let a=Math.max(1,t)+Math.max(1,r);e=k(e-i,a,e);let l=t+n,c=Math.max(r,o),u=k(Math.floor(e/2),t,l),d=k(e-u,r,c);return u=Math.min(l,e-d),d=Math.min(c,e-u),{geometryPool:Math.max(1,u-t),texturePool:d}}var sR=912*Tn,aR=1769472;var Nw=({width:e,height:t})=>np(e,t);var Bw=Object.freeze({width:3840,height:2160}),h3=(e,t,r)=>Math.max(0,np(e,t)-Nw(r)),m3=Object.freeze({frameTargets:0,frameShare:0,shadowPool:0,shadowReserve:0,bounceProbes:0,effectTargets:0,geometryMinimum:0,textureMinimum:0});function g3(e=Bw,t=m3){return Math.max(sR,t.shadowPool+t.shadowReserve)+aR+(t.cutTables??0)+Math.max(Nw(e),t.effectTargets)+Math.max(t.frameShare,t.frameTargets)+536870912+t.geometryMinimum+Math.max(536870912,t.textureMinimum)}function S3(e,t,r=Bw,n){Di(e,"INVALID_GPU_BUDGET"),Di(t,"INVALID_CPU_BUDGET"),Di(r.width,"INVALID_BUDGET_CANVAS"),Di(r.height,"INVALID_BUDGET_CANVAS"),n&&f3(n);let{held:o,...i}=ofe(r,n);if(e<i.fixed)throw new Error("GPU_BUDGET_UNDER_SHADOW_POOL");return{...i,...p3(e-i.fixed,o.geometryMinimum,o.textureMinimum,536870912,536870912,o.shadowReserve),pageCache:t}}function ofe(e,t){let r=t??{...m3,shadowPool:sR,bounceProbes:aR,effectTargets:Nw(e)},n=r.cutTables??0,{shadowPool:o,bounceProbes:i,effectTargets:s,frameTargets:a}=r,l=o+i+n+s+a;return{held:r,shadowPool:o,bounceProbes:i,cutTables:n,effectTargets:s,frameTargets:a,fixed:l}}var dR={points:1,lineSegments:2,lineStrip:2,lineLoop:2,triangles:3,sprite:3},op={start:0,count:1/0},Uw=new WeakMap,w3=(e,t)=>e>=0&&e<t&&Number.isInteger(e);function ife(e,t,r){for(let n=r,o=e.length;n<o;n++)if(!(e[n]<t))return n;return e.length}function sfe(e,t,r){for(let n=r,o=e.length;n<o;n++)if(!(e[n]<t))return n;return e.length}function afe(e,t,r){for(let n=r,o=e.length;n<o;n++)if(!w3(e[n],t))return n;return e.length}function uR(e,t,r){return e instanceof Uint32Array?ife(e,t,r):e instanceof Uint16Array?sfe(e,t,r):afe(e,t,r)}function lfe(e,t){let r=0;for(let n=uR(e,t,0);n<e.length;n++)w3(e[n],t)||r++;return r}function y3(e,t,r){let n=uR(e,t,0);if(n===e.length)return e;let o=new Uint32Array(e.length),i=0;for(let s=0;s+r<=e.length;s+=r)if(n<s&&(n=uR(e,t,s)),n>=s+r)for(let a=s;a<s+r;a++)o[i++]=e[a];return o.slice(0,i)}var x3=e=>e==="lineStrip"||e==="lineLoop";function Vw(e,t){return x3(e)?2*(Math.max(0,t-1)+(e==="lineLoop"&&t>2?1:0)):uS(t,dR[e])}function cfe(e,t){let r=e.length,n=Vw(t,r)/2,o=[];for(let i=0;i<n;i++)o.push(e[i],e[(i+1)%r]);return o}var ufe=e=>e.attributes.position?.count??1/0;function dfe(e){let t=e.index;if(!t)return;let r=ufe(e),n=Uw.get(e);if(n?.index===t&&n.version===t.version&&n.vertices===r)return n;let o=lfe(t.array,r);if(!n||n.missing===0&&o>0){let i={index:t,version:t.version,vertices:r,missing:o,kept:void 0};return Uw.set(e,i),i}return n.index=t,n.version=t.version,n.vertices=r,n.missing=o,n.kept=void 0,n}function b3(e,t){let r=Uw.get(e);r&&(t?r.index!==t&&(r.index=null,r.kept=void 0):Uw.delete(e))}function ip(e){let t=dfe(e);return t?.missing?t:void 0}function E3(e,t=e.drawRange){return pR(fR(e,e.index?.array),t)}var fR=(e,t)=>t?t.length:e.attributes.position?.count??0;function pR(e,{start:t,count:r}){let n=Math.floor(t),o=Number.isNaN(n)?e:Tr(n,0,e);return{from:o,to:Tr(Math.floor(o+r)||0,o,e)}}var C7e=(e,t)=>pR(Vw("triangles",fR(e,e.index?.array)),t);function hR(e,t,r){let n=e.index?.array,{from:o,to:i}=pR(fR(e,n),r),s=x3(t),a=s?i-o:Vw(t,i-o),l;if(n)l=a===n.length?n:n.subarray(o,o+a);else{l=new Uint32Array(a);for(let c=0;c<a;c++)l[c]=o+c}return s?cfe(l,t):l}function mR(e,t,r,n){let o=r==="sprite"?"triangles":r,i=E3(e,n),s=t.kept;if(s&&s.reading===o&&s.from===i.from&&s.to===i.to)return s;let a=hR(e,o,n),l=dR[o],c=y3(a,t.vertices,l),u=(a.length-c.length)/l;return t.kept={reading:o,...i,groups:c,leftOut:u}}function Os(e,t,r=e.drawRange){let n=ip(e);return n?mR(e,n,t,r).groups:hR(e,t,r)}function I7e(e,t,r){let n=ip(e);if(n)return mR(e,n,t,r).groups.length;let{from:o,to:i}=E3(e,r);return Vw(t,i-o)}function T3(e,t,r=e.drawRange){let n=ip(e);return n?mR(e,n,t,r).leftOut:0}var A3=ip;function Gw(e,t,r,n){let o=hR(e,t,r),i=ip(e);if(!i)return o;let s=dR[t],a=y3(o,i.vertices,s);if(a.length===o.length)return a;let l=t==="points"?"corners":"triangles";throw new TypeError(`${n} names no vertex of its ${e.attributes.position?.count??0} positions in ${(o.length-a.length)/s} of its ${o.length/s} ${l}`)}var ffe=e=>Os(e,"triangles",op),O3=e=>e.index&&ffe(e);var gR=fe(),pfe=256,sp=e=>e.name||`(unnamed ${e.type})`;function L3(){let e=Yf(i=>gR.emit(i),{enabled:!0,detail:"summary"}),t=new Set,r=new WeakSet,n=[],o=(i,s,a={})=>{i==="content-refused"&&n.length<pfe&&n.push({what:String(a.what),reason:String(a.reason)}),e.emit({phase:i,message:s,context:a})};return{say:o,refused:n,once(i,s,a={}){t.has(i)||(t.add(i),o(i,s,a))},onceOf(i){return r.has(i)?!1:(r.add(i),!0)},close:()=>e.close()}}function R3(e,t){for(let[r,n]of Object.entries(t))n>0&&e.once(`world-duplicate-${r}`,`${n} ${r} were created with the content of another \u2014 share one: create it once and give it to every mesh that wears it`,{kind:r,count:n})}function Hw(e,t,r=t.geometry){let n=A3(r);if(!n||!e.onceOf(n))return;let o=sp(t),i=n.missing,s=r.attributes.position?.count??0;e.say("geometry-missing-vertices",`Mesh "${o}": ${i} corners of its index name no vertex of its ${s} positions: the points, segments or triangles holding one are left out`,{kind:"warning",mesh:o,leftOut:i})}function _3(e,t,r,n){let o=sp(t);e.say("skin-joint-unknown",`Mesh "${o}": its vertices weigh joints up to ${n.joint}, past the ${r} of its skeleton: those ${n.weights} weights are left out`,{kind:"warning",code:"SKIN_JOINT_UNKNOWN",mesh:o,joints:r,...n})}function Ww(e,t,r){let n=r instanceof Error?r.message:String(r);Mn(e,`the geometry of mesh "${sp(t)}"`,`its cut failed: ${n}`)}function Mn(e,t,r){e.say("content-refused",`The session did not take ${t}: ${r}`,{kind:"error",what:t,reason:r})}function v3(e,t,r){e.say("material-not-drawn",`A material holds ${t}, which no surface draws (${r}): drawn without it`,{kind:"warning",parameter:t,reason:r})}function M3(e,t,r){e.say("material-domain-not-drawn",`A material of the ${t} domain is worn by a mesh's surface, which draws the surface domain alone (${r}): drawn as the default material`,{kind:"warning",domain:t,reason:r})}function D3(e,t){let{material:r,message:n,reason:o,node:i,output:s}=t;o===null?e.say("material-graph-compiled",n,{kind:"info",material:r}):e.say("material-graph-refused",n,{kind:"error",material:r,node:i,reason:o,output:s})}function P3(e,t,r){e.say("material-override-not-drawn",`${t} is not worn where ${r}: drawn there in the file's material`,{kind:"warning",what:t,reason:r})}function C3(e,t,r,n){let o=0,i;return()=>{let{canvas:s}=e,{width:a,height:l}=t;(i?.width!==a||i.height!==l||i.canvas!==s)&&(i={width:a,height:l,canvas:s,excess:h3(a,l,s)});let c=r.size?i.excess:0;if(c<=o){c||(o=0);return}o=c,n.say("effect-targets-over-budget",`effect targets over budget: ${c} bytes past the reserve of the declared ${s.width} \xD7 ${s.height} canvas, drawn at ${a} \xD7 ${l}`,{excess:c,width:a,height:l,declared:s})}}var hfe={createChannel(e={}){let t=fe(),r=Yf(i=>t.emit(i),{detail:e.detail==="full"?"trace":"summary"}),n=gR.subscribe(i=>r.emit(i)),o=r.close.bind(r);return Object.assign(r,{close(){n(),o()},observe(i){return t.subscribe(s=>i({...s,kind:s.phase}))}})},async presentationColor(e){let r=e.scene.background?.getHex?.()??1514792;return bw(e,async n=>{let{width:o,height:i}=n.canvas;return zL(await n.capture(),o,i,r)},Ua)},transparentOcclusion:e=>Ua(e).transparentOcclusionAudit()};var Pi=1e3,I3=Pi/60,q7e=16,X7e=8,SR=8,mfe=e=>Math.ceil(e*SR-1e-9)/SR;function gfe(e){let t=globalThis.screen,r=t?t.width:0,n=t?t.height:0,o=t?globalThis.devicePixelRatio:0;return r===e.width&&n===e.height&&o===e.ratio?!1:(e.width=r,e.height=n,e.ratio=o,!0)}function Q7e(){let e={width:0,height:0,ratio:0};return gfe(e),e}function Z7e(e){let t={made:e,cap:1/0,view:""};return W({allocated(n,o){return t.made=Math.min(n,o===t.view?t.cap:1/0),t.made},lower(n,o){let i=t.made-1/SR;return i<mfe(n)-1e-9?Number.NaN:(t.cap=t.made=i,t.view=o,i)},lift(){t.cap=1/0},reset(n){t.made=n,t.cap=1/0},get capped(){return t.cap!==1/0}})}var lo=e=>e!=null&&Number.isFinite(e)?e:null;function Sfe(e,t){let r=lo(e),n=lo(t);return r!==null&&n!==null&&n>0?Math.max(1,Math.round(r/n)):null}function wfe(e,t,r){let n=lo(e),o=Math.max(lo(t)??-1/0,lo(r)??-1/0);return n!==null&&o>-1/0?n-o:null}function yfe(e,t,r){return t!==null&&t>r&&(e===null||t>=e)?"gpu":e!==null&&e>r&&(t===null||e>t)?"cpu":e!==null&&t!==null?"pacing":null}function xfe(e,t,r,n){let o=lo(t);if(o===null)return{bound:null,toNextRefreshMs:null};if(e===1)return{bound:"pacing",toNextRefreshMs:null};let i=e===null?o:(e-1)*o,s=lo(r),a=lo(n),l=yfe(s,a,i),c=l==="gpu"?a:l==="cpu"?s:null;return{bound:l,toNextRefreshMs:c===null||e===null?null:c-i}}function k3(e){let{intervalMs:t,refreshMs:r,cpuMs:n,gpuMs:o}=e,i=Sfe(t,r);return e.held?{refreshes:i,bound:null,waitMs:null,toNextRefreshMs:null}:{refreshes:i,waitMs:wfe(t,n,o),...xfe(i,r,n,o)}}var F3="unclassified";var ap=128,bfe=128,Efe=70,Tfe=85,Afe=.3,wR=3,Ofe=65536,Lfe=1048576,Rfe=-1,_fe=we,N3=[4096,1048576],B3=A({streamingPendingPageLimit:P("streamingPendingPageLimit",ap,1),streamingMaxInstallsPerFrame:P("streamingMaxInstallsPerFrame",bfe,1),streamingQualityMinPoolPercent:g("streamingQualityMinPoolPercent",Efe,[10,100]),streamingQualityMaxPoolPercent:g("streamingQualityMaxPoolPercent",Tfe,[10,100]),streamingQualityMinScale:g("streamingQualityMinScale",Afe,[.1,1]),streamingRetryCount:S("streamingRetryCount",wR,_fe),streamingMinRequests:S("streamingMinRequests",Ofe,N3),streamingMaxRequests:S("streamingMaxRequests",Lfe,N3),streamingByteRateLimit:g("streamingByteRateLimit",Rfe,R)});var zw=(e,t)=>e.pixelRatio??t?.devicePixelRatio??U3,iXe=55,U3=1,sXe=960,aXe=540,Ci=ap,V3=ap*131072,lXe=2048,vfe=ap,cXe=vfe,jw=2,Ii=(e,t)=>Math.floor(e*(t??U3)),G3={maxTextureDimension2D:1/0,maxTextureArrayLayers:1/0,maxStorageBufferBindingSize:1/0,maxBufferSize:1/0,maxStorageBuffersPerShaderStage:1/0,maxStorageBuffersInVertexStage:1/0,maxStorageBuffersInFragmentStage:1/0,maxColorAttachmentBytesPerSample:1/0,maxComputeWorkgroupStorageSize:1/0,maxComputeInvocationsPerWorkgroup:1/0,maxComputeWorkgroupSizeX:1/0,maxStorageTexturesPerShaderStage:1/0,maxSampledTexturesPerShaderStage:1/0},H3=["readonly_and_readwrite_storage_textures"],uXe=e=>e?.aborted===!0;function Mfe(e){let{stutters:t,bound:r,cpuSubmitMs:n,pagesLoading:o,refreshMs:i}=e;return t>0?{bottleneck:"memory_pressure",bottleneckMessage:`\u26A0\uFE0F Stutters detected (${t} frame(s) > ${qA}ms and over ${XA}x the median)`}:r==="gpu"?{bottleneck:"gpu_bound",bottleneckMessage:`\u26A0\uFE0F GPU choke (${(e.gpuMs??0).toFixed(1)} ms)`}:r==="cpu"?{bottleneck:"cpu_bound",bottleneckMessage:`\u26A0\uFE0F Main CPU thread choke (${(e.cpuMs??0).toFixed(1)} ms)`}:n!=null&&n>i/2?{bottleneck:"gpu_submit_bound",bottleneckMessage:`\u26A0\uFE0F WebGPU submit choke (${n.toFixed(1)} ms)`}:o>Ci?{bottleneck:"streaming_bound",bottleneckMessage:`\u26A0\uFE0F Network / streaming choke (${o} pages in flight)`}:{bottleneck:"healthy",bottleneckMessage:`\u2705 Smooth pipeline (${Math.round(Pi/i)}+ FPS)`}}function Dfe(e,t){let r=t||e?.totalSubmittedTriangles||0,n=e?.submittedTriangles??e?.totalSubmittedTriangles??null,o=r>0&&n!=null?k((1-n/r)*100,0,100):null;return{source:r,selected:e?.selectedTriangles??null,submitted:n,cullingRatePercent:o!=null?Math.round(o*10)/10:null}}function Pfe(e){let t=e?.cacheHits??0,r=e?.cacheMisses??0,n=t+r>0?t/(t+r)*100:null;return{residentPages:e?.residentPages??null,pageLoads:e?.pageLoads??0,pageBytesReadMb:e?.pageBytesRead?Math.round(e.pageBytesRead/Tn*10)/10:0,pagesRequested:e?.pagesRequested??null,pagesLoading:e?.pagesLoading??null,cacheHitRate:n!=null?Math.round(n*10)/10:null}}function W3(e,t,r,n){let o=uf(e),i=t?.cpuFrameMs??0,s=t?.cpuSubmitMs??null,a=t?.displayRefreshMs??I3,l=t?.frameHeld?null:t?.gpuFrameMs??null,{bound:c}=k3({intervalMs:o.p50Ms,refreshMs:a,cpuMs:i,gpuMs:l,held:!1}),{bottleneck:u,bottleneckMessage:d}=Mfe({stutters:o.stutters??0,bound:c,cpuMs:i,gpuMs:l,cpuSubmitMs:s,pagesLoading:t?.pagesLoading??0,refreshMs:a});return{timestamp:Date.now(),fps:o.fps?Math.round(o.fps*10)/10:null,p50Ms:o.p50Ms?Math.round(o.p50Ms*100)/100:null,p95Ms:o.p95Ms?Math.round(o.p95Ms*100)/100:null,p99Ms:o.p99Ms?Math.round(o.p99Ms*100)/100:null,stutters:o.stutters,cpuFrameMs:Math.round(i*100)/100,cpuSubmitMs:s!=null?Math.round(s*100)/100:null,vramMb:t?.vramBytes?Math.round(t.vramBytes/Tn*10)/10:null,triangles:Dfe(t,r),clusters:{total:n||t?.clusters||0,visible:t?.clusters??null,frustumCulled:t?.frustumRejected??null},streaming:Pfe(t),bottleneck:u,bottleneckMessage:d}}function z3(e){let t=e.fps!=null?`${e.fps} FPS`:"Waiting...",r=e.p50Ms!=null?`${e.p50Ms} ms`:"-",n=e.p95Ms!=null?`${e.p95Ms} ms`:"-",o=e.p99Ms!=null?`${e.p99Ms} ms`:"-",i=e.vramMb!=null?`${e.vramMb} MB`:"-",s=e.triangles.cullingRatePercent!=null?`${e.triangles.cullingRatePercent}% culled`:"-",a=e.triangles.source.toLocaleString(),l=e.triangles.selected!=null?e.triangles.selected.toLocaleString():"-",c=e.triangles.submitted!=null?e.triangles.submitted.toLocaleString():"-",u=e.clusters.visible??"-",d=e.clusters.total||"-",f=e.clusters.frustumCulled??0;return["\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550",` \u{1F680} TRILLION3D ENGINE TELEMETRY REPORT \u2014 ${t}`,"\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550",` \u23F1\uFE0F FRAME PACE : P50: ${r} | P95: ${n} | P99: ${o} | Stutters: ${e.stutters??0}`,` \u{1F4BB} CPU FRAME : ${e.cpuFrameMs} ms | WebGPU submit: ${e.cpuSubmitMs!=null?e.cpuSubmitMs+" ms":"-"}`,` \u{1F53A} GEOMETRY : ${a} source \u2192 ${l} LOD \u2192 ${c} submitted (${s})`,` \u{1F4E6} CLUSTERS : ${u} visible / ${d} total (Frustum: ${f})`,` \u{1F4BE} VRAM & PAGES : ${i} VRAM | Resident pages: ${e.streaming.residentPages??"-"}`,` \u{1F310} STREAMING : ${e.streaming.pageLoads} pages loaded (${e.streaming.pageBytesReadMb} MB) | In flight: ${e.streaming.pagesLoading??0} | Hit: ${e.streaming.cacheHitRate!=null?e.streaming.cacheHitRate+"%":"-"}`,` \u{1F3AF} SYSTEM STATE : ${e.bottleneckMessage}`,"\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"].join(`
|
|
2
|
+
`)}function yR(e,t){let r,n=t;return()=>{let o=typeof location>"u"?void 0:location.search;return o!==r&&(r=o,n=o===void 0?t:e(new URLSearchParams(o))),n}}var j3=e=>yR(e,!1);var $3=new WeakMap;function Cfe(e,t){let r=$3.get(e);if(!r){let n=r=new Set;$3.set(e,r),e.addEventListener("abort",()=>n.forEach(o=>o()),{once:!0})}return r.add(t),()=>void r.delete(t)}function Jt(e,t,r){return t?new Promise((n,o)=>{let i=()=>(r?.(),o(t.reason));if(t.aborted)return i();let s=Cfe(t,i);e.then(a=>(s(),n(a)),a=>(s(),o(a)))}):e}function Kc(e,t,r){return e.askers++,Jt(e.promise,t,()=>{--e.askers===0&&r()})}var Z=()=>performance.now(),er=e=>performance.now()-e,bXe=()=>globalThis.crossOriginIsolated?.005:.1;var $w=3e4,lp=new Set,xR=1/0;function K3(){if(xR<1/0)return;let e=lp.values().next().value;if(!e)return;let t=xR=e.due;AbortSignal.timeout(Math.max(0,Math.ceil(t-Z()))).addEventListener("abort",()=>Ife(t),{once:!0})}function Ife(e){let t=Math.max(Z(),e);try{for(let r of lp){if(r.due>t)break;r.quiet()}}finally{xR=1/0,K3()}}function Y3(e){e.seen=e.landed,e.due=Z()+$w,lp.add(e),K3()}function bR(e){let t=new AbortController,r=ro(t,e),n={landed:0,failBody:to,due:0,seen:0,end(){n.failBody=to,r(),lp.delete(n)},quiet(){if(lp.delete(n),n.landed!==n.seen)return Y3(n);let o=new DOMException(`No byte came for ${$w/1e3} s`,"TimeoutError"),i=n.failBody;n.end(),t.abort(o),i(o)}};return Y3(n),{signal:t.signal,end:n.end,body:o=>kfe(o,n)}}var jo=e=>void e.body?.cancel().catch(()=>{});function kfe(e,t){if(!e.body)return t.end(),e;t.landed++;let r=e.body.getReader(),n=new ReadableStream({start(a){t.failBody=l=>{a.error(l),r.cancel(l).catch(()=>{})}},async pull(a){try{let{done:l,value:c}=await r.read();if(l)return t.end(),a.close();t.landed++,a.enqueue(c)}catch(l){throw t.end(),l}},cancel(a){return t.end(),r.cancel(a)}}),{status:o,statusText:i,headers:s}=e;return new Response(n,{status:o,statusText:i,headers:s})}var Yw="held://",Kw=new Map,Ffe=0,Nfe={json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp",svg:"image/svg+xml",ktx2:"image/ktx2"};function Bfe(e,t,r){let o={"content-type":Nfe[e.slice(e.lastIndexOf(".")+1).toLowerCase()]??"application/octet-stream"},i=t.byteLength,s=r&&/^bytes=(\d+)-(\d*)$/.exec(r.trim());if(!s)return o["content-length"]=String(i),new Response(t,{status:200,headers:o});let a=Number(s[1]),l=Math.min(s[2]?Number(s[2]):i-1,i-1);if(a>=i||l<a)return new Response(null,{status:416,headers:{"content-range":`bytes */${i}`}});o["content-range"]=`bytes ${a}-${l}/${i}`,o["content-length"]=String(l-a+1);let c=t.subarray(a,l+1);return new Response(c,{status:206,headers:o})}function Ufe(e){try{return decodeURIComponent(e)}catch{return}}var co={hold(e){let t=`${Yw}${++Ffe}/`;return Kw.set(t,e),t},release(e){Kw.delete(e)},get size(){return Kw.size},holds:e=>e.startsWith(Yw),answer(e,t){if(!e.startsWith(Yw))return null;let r=e.indexOf("/",Yw.length)+1,n=r>0?Kw.get(e.slice(0,r)):void 0,o=e.slice(r).split(/[?#]/)[0],i=o,s=n?.get(o);return n&&!s&&(i=Ufe(o))!==void 0&&(s=n.get(i)),s?Bfe(i,s,new Headers(t).get("range")):new Response(null,{status:404})}};function uo(){let e,t;return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}var ki=e=>e.size?Promise.allSettled(e):void 0;var qc=(e,t,r,n=Math.random())=>Math.min(Math.min(e*2**(r-1),t)*(1+.25*(2*n-1)),t),vXe=(e,t=Math.random())=>qc(4e3,256e3,e,t);var ER=6,Vfe=250,Gfe=4e3,TR=(e,t=0)=>t+Math.random()*Math.min(Gfe,Vfe*2**(e-1));var X3="trillion3d-link",CXe=e=>e?.protocol===X3,q3=globalThis.DedicatedWorkerGlobalScope,Hfe="trillion3d",Wfe=e=>e.name===Hfe,Q3=q3&&globalThis instanceof q3&&Wfe(globalThis)?e=>globalThis.postMessage(e):void 0,Z3=()=>Q3!==void 0,cp=e=>Q3?.({protocol:X3,...e});var fp=(e,{blocked:t,directive:r,written:n=r},o,i={})=>new E("RESOURCE_BLOCKED_BY_POLICY",o,{url:e,status:null,contentType:null,cutOff:!0,directive:r,written:n,blocked:t,...i}),Xc=({directive:e,written:t})=>t??e,Xw=new Map,J3=new URL(new URL(import.meta.url).pathname.endsWith(".ts")?"../../../../":".",import.meta.url),zfe=e=>e.startsWith(J3.href)||e===J3.origin,up=new Map,rH=0,Qw=0,eH,nH=fe(),oH=e=>nH.subscribe(e),dp=e=>e.split("#")[0],AR,OR=new Set,pp=({effectiveDirective:e,violatedDirective:t})=>e||t||"";function jfe(e){let{violatedDirective:t,originalPolicy:r}=e,n=pp(e);if(t&&t!==n)return t;if(!r||!n)return;let o=r.split(";").map(s=>s.trim().split(/\s+/)[0]?.toLowerCase());return o.includes(n)?void 0:(n==="script-src-elem"?["script-src","default-src"]:["default-src"]).find(s=>o.includes(s))}function qw(e){let t=jfe(e);return{blocked:e.blockedURI,directive:pp(e),...t&&{written:t}}}var tH=e=>pp(e)==="connect-src"||!e.effectiveDirective&&e.violatedDirective==="default-src",$fe=e=>e.blockedURI==="wasm-eval"&&iH(e),iH=e=>/^(?:script-src|default-src)$/.test(pp(e)),Yfe=e=>/^script-src(?:-elem)?$/.test(pp(e)),Kfe=e=>/[?&]t3d-probe=/.test(e),Va=new Map,qfe=256;function sH(e){let t=new URL(e);return t.searchParams.delete("t3d-probe"),t.hash="",t.href}function Xfe(e,t){Va.delete(e),Va.set(e,t),Va.size>qfe&&Va.delete(Va.keys().next().value)}var Zw=e=>Va.size>0&&URL.canParse(e)?Va.get(sH(e)):void 0;function Qfe(e){let t=e,{blockedURI:r,disposition:n}=t;if(!(n==="report"||!r)){if(r==="eval"&&iH(t)){let o=qw(t);return OR.forEach(i=>i(o))}if(Yfe(t)&&zfe(dp(r))){let o={...qw(t),blocked:dp(r)};up.delete(o.blocked),up.set(o.blocked,{refusal:o,heard:++rH});return}tH(t)&&Kfe(r)?URL.canParse(r)&&Xfe(sH(r),qw(t)):($fe(t)||tH(t))&&Zfe(qw(t))}}function Zfe(e){if(e.blocked==="wasm-eval")AR=e,OR.forEach(t=>t(e));else{if(!URL.canParse(e.blocked))return;let t=dp(e.blocked);Xw.set(t,{...e,blocked:t}),nH.tell(r=>console.error("[trillion3d]",r),new URL(t).origin)}cp({refused:e})}function Qc(){let t=globalThis.addEventListener;!t||t===eH||(eH=t,t.call(globalThis,"securitypolicyviolation",Qfe))}function LR(e,t){if(Xw.size)return Xw.get(dp(e))??Xw.get(t)}var aH=100;function Jfe(e,t=()=>!0,r=()=>{}){return new Promise(n=>{let o=a=>{clearTimeout(s),e.delete(i),n(a??r())},i=a=>t(a)&&o(a),s=setTimeout(()=>o(),aH);e.add(i)})}function epe(e){let t=String(e?.message??e);return/content.security.policy|unsafe-eval|\bCSP\b/i.test(t)?{blocked:"wasm-eval",directive:/directive:?\s*"((?:script|default)-src)\b/i.exec(t)?.[1]?.toLowerCase()??"script-src"}:void 0}function tpe(e){return Qc(),AR?Promise.resolve(AR):Jfe(OR,void 0,()=>epe(e))}function lH(){return Qw++,rH}var cH=()=>void(Qw=Math.max(0,Qw-1));async function uH(e,t){Qc();let r=()=>e===void 0?void 0:up.get(dp(e))??up.get(new URL(e).origin),n=r();if(n)return n.refusal;await new Promise(i=>setTimeout(i,aH));let o=r();if(o)return o.refusal;if(Qw===1){for(let{refusal:i,heard:s}of up.values())if(s>t)return i}}async function dH(e,t,r){try{return await r()}catch(n){if(n instanceof E)throw n;let o=await tpe(n);throw o?fp(t,o,`${e} may not be compiled: the page's Content-Security-Policy (${o.directive}) refuses WebAssembly (${o.blocked}); add 'wasm-unsafe-eval' to ${Xc(o)}`):n}}var rpe=0,npe=globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2);function ope(e){if(!URL.canParse(e))return e;let t=new URL(e);return t.searchParams.set("t3d-probe",`${npe}-${++rpe}`),t.href}async function RR(e,t,r,n=!1){let o=ma(AbortSignal.timeout($w),r);try{return jo(await fetch(n?e:ope(e),{...t,cache:"no-store",signal:o})),!0}catch{return r?.throwIfAborted(),!1}}async function Jw(e,t){let r={method:"GET",headers:{Range:"bytes=0-0"},mode:"cors"};return await RR(e,r,t)||await RR(e,{method:"HEAD",mode:"no-cors"},t)||globalThis.crossOriginIsolated===!0&&URL.canParse(e)&&!!new URL(e).search&&await RR(e,r,t,!0)?"answered":Zw(e)?"unprobeable":"silent"}var ipe=3,spe=1e3,hH=500,_R=8e3,MR=Math.log2(_R/hH)+1,ape=8e3,lpe=3e3,Zc=()=>globalThis.navigator?.onLine===!1,Ga=new Map,mH=0,DR=0,e0=new Map,PR=fe(),Jc=()=>PR.tell(e=>console.error("[trillion3d]",e)),t0=null,fH=!1;PR.subscribe(()=>{if(!Z3())return;let e=Pt.waits()??null;e!==t0&&(t0=e,e!==null&&cpe(),cp({waits:e}))});function cpe(){let e=globalThis,t=e.close;fH||typeof t!="function"||(fH=!0,e.close=()=>{t0!==null&&cp({waits:t0=null}),t.call(globalThis)})}function hp(e){let t=Ga.get(e);return t||Ga.set(e,t={origin:e,failedAt:new Map,answered:void 0,failedUrl:void 0,reachedAt:0,closedUntil:0,openedAt:-1/0,closings:0,probing:!1,asking:void 0,waiting:0,wake:uo(),armedAt:1/0}),t}var gH=()=>Ga.forEach(e=>CR(e)),upe=()=>globalThis.document?.visibilityState==="visible"&&gH(),pH=!1;function SH(){let e=globalThis,t=DR>0&&!!e.addEventListener;if(t===pH)return;pH=t;let r=t?"addEventListener":"removeEventListener";e[r]?.("online",gH),e[r]?.("offline",Jc),globalThis.document?.[r]("visibilitychange",upe)}function wH(e){let{wake:t}=e;e.wake=uo(),t.resolve()}function yH(e,t){let r=Z();if(e.armedAt<=t&&e.armedAt>r)return;e.armedAt=t,setTimeout(()=>{e.armedAt===t&&(e.armedAt=1/0),wH(e),IR(e)},Math.max(0,t-r))}function xH(e){e.closedUntil=0,DR--,SH(),Jc()}function CR(e){e.failedAt.clear(),e.closedUntil&&(e.openedAt=Z(),xH(e),wH(e))}function vR(e,t){e.closedUntil||(t-e.openedAt>=_R&&(e.closings=0),DR++,SH(),Jc());let r=Zc()?ape:qc(hH,_R,++e.closings);e.closedUntil=t+r,e.failedAt.clear(),yH(e,e.closedUntil)}function IR(e){e.closedUntil&&!e.waiting&&!e.probing&&xH(e)}var dpe=e=>e.answered??e.failedUrl??`${e.origin}/`;async function fpe(e){let t=await Jw(dpe(e));if(t==="answered"||e.answered||e.failedUrl===void 0)return t;let r=await Jw(`${e.origin}/`);return r==="answered"?r:t==="silent"?t:r}var kR=e=>e.asking??=fpe(e).finally(()=>e.asking=void 0);async function ppe(e){if(e.probing)return;e.probing=!0;let t=await kR(e);e.probing=!1,t==="answered"&&(e.reachedAt=++mH),t==="answered"||t==="unprobeable"&&!Zc()?CR(e):e.closedUntil&&vR(e,Z()),IR(e)}function hpe(e,t,r,n){let o=new AbortController;return new Promise((i,s)=>{let a=t===void 0?"unprobeable":void 0,l,c,u=h=>(clearTimeout(c),o.abort(),i(h)),d=h=>(clearTimeout(c),o.abort(),s(h)),f=()=>{a==="answered"?u("address"):l==="answered"&&(n||a!==void 0)?u("origin"):l==="answered"?c??=setTimeout(()=>u("origin"),lpe):a!==void 0&&l!==void 0&&u(a==="silent"||l==="silent"?void 0:"untellable")};t!==void 0&&Jw(t,ma(o.signal,r)).then(h=>(a=h,f()),d),Jt(kR(e),r).then(h=>(l=h,f()),d)})}oH(e=>{let t=Ga.get(e);t&&CR(t)});async function mpe(e,t){e.waiting++||Jc();try{for(;e.closedUntil;)Z()>=e.closedUntil?ppe(e):yH(e,e.closedUntil),await Jt(e.wake.promise,t)}finally{--e.waiting||Jc(),IR(e)}}var Pt={ready(e,t){let r=Ga.get(e);return r?.closedUntil?mpe(r,t):void 0},answered(e,t){let r=hp(e);r.reachedAt=++mH,r.answered=t,r.failedAt.clear()},reached:e=>Ga.get(e)?.reachedAt??0,failed(e,t){let r=hp(e),n=Z(),{failedAt:o}=r;if(r.failedUrl??=t,!r.closedUntil){o.set(t,n);for(let[i,s]of o)n-s>spe&&o.delete(i);(o.size>=ipe||Zc())&&vR(r,n)}},probe:async(e,t)=>await Jt(kR(hp(e)),t)==="answered",async judge(e,t,r,n=!1,o=!1){let i=Zc()?void 0:await hpe(hp(e),t,r,n);return(i===void 0||i==="untellable"&&!o)&&Pt.close(e,n?void 0:t),i},close(e,t){let r=hp(e);r.failedUrl??=t,r.closedUntil||vR(r,Z())},waits(){for(let[e,t]of Ga)if(t.closedUntil||t.waiting)return URL.canParse(e)?new URL(e).host:e;for(let e of e0.values())return e},heard(e,t){t!==(e0.get(e)??null)&&(t===null?e0.delete(e):e0.set(e,t),Jc())},listen:e=>PR.subscribe(e)};var FR="the file changed while it was read",gpe="the server does not resume a body",bH="cannot resume: headers not exposed",Spe="cannot resume an encoded body";function r0(e){let t=/^bytes (\d+)-(\d+)\/(\d+|\*)$/.exec(e.headers.get("content-range")??"");return t?{from:Number(t[1]),to:Number(t[2]),size:t[3]}:void 0}function wpe(e){let t=e.headers.get("content-length");return t!==null&&!e.headers.has("content-encoding")?t:void 0}function EH(e){let t=e.headers.get("etag");return t&&!t.startsWith("W/")?t:e.headers.get("last-modified")}function ype(e,t,r){let n=r0(e),o=EH(e);if(!t){let l=c=>c.status!==e.status||r0(c)?.from!==n?.from?FR:void 0;return{headers:r.headers,wrong:l}}if(!o||e.status===206&&!n)throw r.refuse(void 0,bH);if(e.headers.has("content-encoding"))throw r.refuse(void 0,Spe);let i={},s=(n?.from??0)+t;new Headers(r.headers).forEach((l,c)=>i[c]=l),i.range=`bytes=${s}-${n?.to??""}`,r.sameOrigin&&(i["if-range"]=o);let a=n?.size??(r.sameOrigin?wpe(e):void 0);return{headers:i,wrong:l=>xpe(l,o,s,a)}}function xpe(e,t,r,n){let o=r0(e);if(EH(e)!==t)return FR;if(e.status!==206)return gpe;if(!o)return bH;let i=/^\d+$/.test(n??"")&&/^\d+$/.test(o.size);return o.from===r&&(!i||o.size===n)?void 0:FR}async function bpe(e,t,r,n,o){if(await n.cut(r,o),o.aborted)return;let i=ype(e,t,n),s=await n.again(i.headers,o),a=!s.response.ok,l=a?void 0:i.wrong(s.response);if((o.aborted||a||l)&&(jo(s.response),s.watch.end()),!o.aborted){if(a)throw n.refuse(s.response);if(l)throw n.refuse(void 0,l);return s.watch.body(s.response).body?.getReader()}}function TH(e,t,r){let n=t.body(e);if(!n.body||!(e.headers instanceof Headers))return n;let{status:o,statusText:i,headers:s}=e,a=r0(e),l=o===206&&a&&!s.has("content-encoding")?a.to-a.from+1:0,c=n.body.getReader(),u=new AbortController,d=0,f=!0,h=async x=>{let b=await bpe(e,d,x,r,u.signal).catch(T=>{if(!u.signal.aborted)throw T});b&&(c=b,f=!0)},m=async()=>{for(;!u.signal.aborted;)try{let{done:x,value:b}=await c.read();if(u.signal.aborted||x&&d>=l)return;if(x)throw new TypeError(`the body ended at byte ${d} of ${l}`);return d+=b.byteLength,f&&r.progressed(),f=!1,b}catch(x){if(l>0&&d>=l)return;u.signal.aborted||await h(x)}},w=new ReadableStream({async pull(x){let b=await m();u.signal.aborted||(b?x.enqueue(b):x.close())},cancel(x){return u.abort(x),c.cancel(x).catch(()=>{})}});return new Response(w,{status:o,statusText:i,headers:s})}var Epe=e=>e==="localhost"||e.endsWith(".localhost")||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="[::1]";function AH(e,t,r){if(t!==void 0&&!(t instanceof AbortSignal))return new E("INVALID_OPTIONS",`${e}: signal is no AbortSignal: ${String(t)}`,{url:e});try{new Request(e,r);return}catch(n){return new E("INVALID_OPTIONS",`${e}: ${String(n)}`,{url:e})}}var NR=e=>URL.canParse(e,globalThis.location?.href)?new URL(e,globalThis.location?.href):void 0;function OH(e){if(globalThis.location?.protocol!=="https:")return;let t=NR(e);if(t?.protocol==="http:"&&!Epe(t.hostname))return"blocked: an http address on an https page (mixed content)"}var LH=e=>NR(e)?.origin??"",RH=e=>NR(e)?.href??e,_H=e=>/^(?:file|data|blob|[a-z][a-z\d+.-]*-extension):/i.test(e)?"no network serves this address":void 0;var Tpe=new Set([408,425,429]),PH=e=>e===null||e>=500||Tpe.has(e),CH=e=>{let t=e.headers.get("retry-after")??"",r=/^\d+$/.test(t)?Number(t)*1e3:Date.parse(t)-Date.now();return r>0?Math.min(r,1e4):0},mp=(e,t)=>{let r,n=new Promise(o=>r=setTimeout(o,e));return Jt(n,t,()=>clearTimeout(r))},BR=e=>e instanceof E&&(e.code==="RESOURCE_HTTP_ERROR"||e.code==="RESOURCE_BLOCKED_BY_POLICY"),eu=e=>{let t=BR(e)?e.details.status:null;return typeof t=="number"?t:null},UR=e=>BR(e)&&e.details.cutOff===!0,VR=e=>!UR(e)&&PH(eu(e)),IH=e=>BR(e)&&VR(e);var Ape=new Set([403,404]),Ope=2,Lpe=1e3;function Ls(e,t,r,n=!1){let{named:o,failures:i}=e;if(!t){let l=i?i===1?" (one request)":` (${i} requests)`:"";return new E("RESOURCE_HTTP_ERROR",`${o}: ${String(r)}${l}`,{url:o,status:null,contentType:null,...n&&{cutOff:n}})}let s=t.headers.get("content-type"),a=CH(t);return new E("RESOURCE_HTTP_ERROR",`${o}: HTTP ${t.status}, type ${s??"absent"}`,{url:o,status:t.status,contentType:s,...a>0&&{retryAfter:a}})}var vH=({named:e},t)=>fp(e,t,`${e}: refused by the page's Content-Security-Policy (${t.directive} blocks ${t.blocked}): allow that origin in ${Xc(t)}, or serve the engine from an origin it allows`);async function Rpe(e,t=e.request.headers){let{url:r,origin:n,signal:o,request:i}=e;o?.throwIfAborted();let s=co.answer(r,t);if(s)return{response:s,watch:bR(o)};let a=Pt.ready(n,o);a&&await a,o?.throwIfAborted();let l=LR(r,n);if(l)throw vH(e,l);let c=bR(o);try{let u=await fetch(r,{...i,headers:t,signal:c.signal});return Pt.answered(n,r),{response:u,watch:c}}catch(u){c.end(),o?.throwIfAborted();let d=c.signal.aborted,f=u instanceof DOMException&&u.name==="AbortError";if(!d&&!f&&!(u instanceof TypeError))throw Ls(e,void 0,u);let h=d?void 0:LR(r,n);if(h)throw vH(e,h);return{cause:u,network:!d}}}async function _pe(e){if(e.failures=0,!(Pt.reached(e.origin)>e.reachedAt))return Pt.close(e.origin,e.url);let t=await kH(e);t&&(e.suspect={left:Ope,why:t})}var vpe={address:"CORS or refused",origin:"blocked or refused"};async function kH({origin:e,url:t,signal:r}){let n=await Pt.judge(e,t,r);return n==="address"||n==="origin"?vpe[n]:void 0}async function Mpe(e,t){if(--e.suspect.left>0)return mp(Lpe,e.signal);let r=await kH(e);if(e.suspect=void 0,e.signal?.throwIfAborted(),r)throw Ls(e,void 0,`cannot read ${e.named}: ${r} (${String(t)})`,!0)}async function MH(e,t){if(e.reachedAt<0&&(e.reachedAt=Pt.reached(e.origin)),++e.failures<ER)return mp(TR(e.failures,t?CH(t):0),e.signal);if(t)throw Ls(e,t);await _pe(e)}async function FH(e,t){for(;;){let r=await Rpe(e,t);if(!r.response){let i=_H(e.url);if(i)throw Ls(e,void 0,`${i} (${String(r.cause)})`,!0);e.suspect&&r.network?await Mpe(e,r.cause):(Pt.failed(e.origin,e.url),await MH(e));continue}e.suspect=void 0,e.reachedAt=-1;let{response:n,watch:o}=r;if(!PH(n.status))return r;jo(n),o.end(),await MH(e,n)}}var Dpe=e=>({headers:e.request.headers,sameOrigin:!globalThis.location||e.origin===globalThis.location.origin,async cut(t,r){let{origin:n,url:o,signal:i}=e;i?.throwIfAborted(),Pt.failed(n,o);let s=ma(r,i);if(++e.cuts<ER)return mp(TR(e.cuts),s);e.cuts=0;let a=!Zc()&&await Pt.probe(n,s);if(i?.throwIfAborted(),a)throw Ls(e,void 0,t);Pt.close(n,o)},progressed(){e.failures=e.cuts=0,e.suspect=void 0,e.reachedAt=-1},async again(t,r){let n=e.signal;e.signal=ma(r,n);try{return await FH(e,t)}finally{e.signal=n}},refuse:(t,r)=>Ls(e,t,r)});async function vr(e,t,r={}){Qc();let n=e;co.holds(e)||(e=RH(e));let o={url:e,named:n,origin:LH(e),signal:t,request:r,failures:0,cuts:0,reachedAt:-1,suspect:void 0},i=AH(e,t,r);if(i)throw i;let s=OH(e);if(s)throw Ls(o,void 0,s,!0);let{response:a,watch:l}=await FH(o);if(a.ok)return TH(a,l,Dpe(o));throw jo(a),l.end(),Ls(o,a)}var NH=e=>{let t=e instanceof E?e.details.retryAfter:void 0;return typeof t=="number"?t:0},pQe=(e,t)=>vr(e,t).catch(r=>{if(Ape.has(eu(r)??0))return null;throw r});var gp="T3D-E090";function Sp(e){return e?.throwIfAborted(),new Promise((t,r)=>{let n=()=>{cancelAnimationFrame(o),r(e.reason)},o=requestAnimationFrame(i=>{e?.removeEventListener("abort",n),t(i)});e?.addEventListener("abort",n,{once:!0})})}function wp(){let e=globalThis.document?.timeline?.currentTime;return typeof e=="number"?e:Z()}function BH(e){let t=globalThis.document?.timeline;if(t){let r=t.currentTime;if(typeof r=="number"){e[0]=r;return}}e[0]=Z()}function gr(e,t){let r=setTimeout(e,t);return Object(r).unref?.(),r}var Ppe=1e3;function UH(e=Ppe){let t;return{restart(r,n=e){clearTimeout(t),t=gr(r,n)},stop:()=>clearTimeout(t)}}function Cpe(e){let t;return{post(){t||(t=new MessageChannel,t.port1.onmessage=e),t.port2.postMessage(void 0)},close(){t&&(t.port1.onmessage=null,t.port1.close(),t.port2.close(),t=void 0)}}}var Ha=()=>new Promise(e=>{let t=Cpe(()=>{t.close(),e()});t.post()}),Ipe=1;async function VH(e){let t=Z();for(;!e.next().done;)Z()-t>=Ipe&&(await Ha(),t=Z())}var kpe=new URL(import.meta.url).origin,HH=(e,t)=>new E("FAMILY_LOAD_FAILED",`${gp} FAMILY_LOAD_FAILED: the ${e} family did not load: ${String(t)}`,{id:gp,family:e,cause:t});function Fpe(e,t,r){let n=Zw(r)??{blocked:r,directive:"connect-src"},o=Xc(n);return new E("FAMILY_LOAD_FAILED",`${gp} FAMILY_LOAD_FAILED: the ${e} family did not load: the page's Content-Security-Policy (${n.directive}) lets no probe of ${new URL(r).origin} tell a network outage from a missing file, and its code still fails (${String(t)}); allow that origin in ${o}`,{id:gp,family:e,cause:t,directive:n.directive,written:o})}var Npe=/dynamically imported module(?:: (\S+))?$|^Importing a module script failed\.?$/;function WH(e){let t=e instanceof TypeError?Npe.exec(e.message):null;if(!t)return;let r=t[1];return{url:r!==void 0&&URL.canParse(r)?r:void 0}}async function Bpe(e,t,{url:r,origin:n,since:o,kept:i,last:s}){if(!WH(t))return HH(e,t);let a=await uH(r,o);if(a){let c=r??a.blocked;return fp(c,a,`the ${e} family's code ${c} may not be loaded: the page's Content-Security-Policy (${a.directive}) refuses it; allow that origin in ${Xc(a)}, or serve the engine from an origin it allows`,{family:e})}if(i?.code==="RESOURCE_BLOCKED_BY_POLICY")return i;let l=await Pt.judge(n,r,void 0,!0,s);return l==="address"||l==="origin"?"reached":l==="untellable"?l:"network"}var GH=e=>1e4-er(e);function Upe(){let e=[],t=()=>void(e=e.filter(({holder:r})=>r.deref()));return{prune:t,add(r,n,o){t(),e.push({holder:new WeakRef(r),tell:n,paused:o})},pauseEnded(){t();for(let{holder:r,paused:n}of e){let o=r.deref();o&&n&&n(o)}},tell(r){let n=e;e=[];for(let{holder:o,tell:i}of n){let s=o.deref();s&&i(s,r)}}}}function Vpe(e,t){let r,n=-1/0,o=!1,i=()=>{let s=GH(n);if(s>0)return void gr(i,s);o=!1,t()};return{get refusal(){return r},pauseLeft:()=>GH(n),refuse(s){n=Z(),r=s,o||gr(i,1e4),o=!0,e(r)},forget:()=>void(r=void 0)}}async function Gpe(e,t,r){let n=kpe,o=!1,i=0;for(Qc();;){let s=Pt.ready(n);s&&await s;let a=lH();try{return{landed:!0,module:await t()}}catch(l){let c=WH(l)?.url;c&&(n=new URL(c).origin);let d=await Bpe(e,l,{url:c,origin:n,since:a,kept:r,last:i===MR});if(d instanceof E)return{landed:!1,refusal:d};if(d==="reached"&&o)return{landed:!1,refusal:HH(e,l)};if(o=d==="reached",i=d==="untellable"?i+1:0,i>MR)return{landed:!1,refusal:Fpe(e,l,c??`${n}/`)}}finally{cH()}}}function zH(e,t,r){let n,o,i=Upe(),s=Vpe(r,()=>i.pauseEnded()),a=async()=>{i.prune();let u=s.pauseLeft();u>0&&await mp(u);let d=await Gpe(e,t,s.refusal);if(d.landed){n=d.module,c.arrived=!0,s.forget(),i.tell(n);return}o=void 0,s.refuse(d.refusal)},l=()=>o??=a(),c={get(){return n===void 0&&l(),n},held:()=>n,waitArrival(u,d,f){n===void 0?i.add(u,d,f):d(u,n)},resting:()=>n===void 0&&s.pauseLeft()>0,arrived:!1,settled:()=>o??Promise.resolve(),async load(){if(n===void 0&&await l(),n===void 0)throw s.refusal;return n}};return c}var Hpe=function(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,o,i,s){return n?t?".jsx":".js":o&&(!i||!s)?r:o+i+"."+s.toLowerCase()+"js"}):e};async function jH(e,{priority:t,copy:r}={}){try{return await(await vr(e,void 0,{priority:t})).arrayBuffer()}catch(n){if(r===void 0||!(n instanceof E)||n.code!=="RESOURCE_BLOCKED_BY_POLICY")throw n;return Wpe(e,r,n)}}async function Wpe(e,t,r){let n;try{n=(await import(Hpe(t))).default}catch(o){throw new E("RESOURCE_HTTP_ERROR",`${r.message}; its copy as code (${t}) did not load either: ${String(o)}`,{url:e,status:null,contentType:null,copy:t})}if(typeof n!="string")throw new E("INTERNAL",`${t}: no copy of ${e} as its default export`,{url:e});return zpe(n)}function zpe(e){let t=Uint8Array.fromBase64;if(t)return t(e);let r=atob(e),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n}async function $H(e){let t=typeof e=="function"?await e():e;return ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)}var jpe={};AF(jpe,{sha256Hex:()=>Wa});async function Wa(e){return ww(new Uint8Array(await crypto.subtle.digest("SHA-256",e)))}var YH=zF,$pe=(e,t,r)=>new E("MEMORY_REFUSED",`${e}: the browser refused its ${t} bytes; close the engine's other pages and frames, or reload this one`,{door:e,bytes:t,cause:r}),Ype=e=>e instanceof RangeError||!(e instanceof Error);function KH(e,t,r,n){let o=t*r;if(!Number.isSafeInteger(t)||t<0||!Number.isSafeInteger(r)||r<=0||o>YH)throw new E("INTERNAL",`${e} asked ${o} bytes (${t} of ${r}), which no store of the engine may ask (at most ${YH}): a defect of the engine, to be reported`,{door:e,bytes:o});let i=s=>Ype(s)?$pe(e,o,s):s;try{let s=n();return s instanceof Promise?s.catch(a=>{throw i(a)}):s}catch(s){throw i(s)}}function za(e){let t=0,r=1;for(;;){let n=e.bytes[e.at++];if(n===void 0)throw new Error("the module ends inside a number");if(t+=(n&127)*r,!(n&128))return t;r*=128}}function GR(e){let t=e.bytes[e.at++];return{initial:za(e),maximum:t&1?za(e):void 0}}function Kpe(e,t){if(t===0||t===4)t===4&&e.at++,za(e);else if(t===1)e.at++,GR(e);else if(t===3)e.at+=2;else throw new Error(`an import of unknown kind ${t}`)}function qH(e,t){let r={bytes:e,at:8};for(;r.at<e.length;){let n=e[r.at++],o=za(r);if(n===t)return r;r.at+=o}return null}function CQe(e){let t=qH(new Uint8Array(e),2);if(t)for(let r=za(t);r>0;r--){for(let i=0;i<2;i++){let s=za(t);t.at+=s}let n=t.bytes[t.at++];if(n!==2){Kpe(t,n);continue}let o=GR(t);if(o.maximum===void 0)throw new Error("the module imports a memory of no maximum");return{initial:o.initial,maximum:o.maximum}}throw new Error("the module imports no memory")}function XH(e){let t=qH(e,5);return t&&za(t)>0?GR(t).initial:0}var QH=null,HR=null,ZH=null,JH=null;function WR(e,t){return e.catch(r=>{throw VR(r)&&t(),r})}var eW=()=>jH(new URL("./sdk-browser/src/wasm/kernels.wasm",import.meta.url).href,{copy:new URL("./sdk-browser/src/wasm/kernels.wasm.js",import.meta.url).href}),tW=e=>ZH??=WR($H(e),()=>{ZH=null});async function Xpe(e){if(typeof WebAssembly>"u")return null;let t=await tW(e);try{let r="The memory of the SDK module (kernels.wasm)",{instance:n}=await KH(r,XH(t),65536,()=>dH("The SDK module (kernels.wasm)","kernels.wasm",()=>WebAssembly.instantiate(t,{})));return HR=n.exports}catch(r){if(r instanceof E)throw r;return null}}async function n0(e=eW){let t=await(QH??=WR(Xpe(e),()=>{QH=null}));if(!t||typeof t.encode_page!="function")throw new Error("SDK_WASM_UNAVAILABLE");return t}function HQe(){return JH??=WR(tW(eW).then(Wa),()=>{JH=null})}function o0(){if(!HR)throw new Error("SDK_WASM_UNAVAILABLE");return HR}var i0=fe(),s0=fe(),Y=(e,t,r=!1)=>zH(e,t,n=>(r?s0:i0).emit(n)),M={webgpu:Y("WebGPU renderer",()=>import("./trillion3d-webgpuCode-2GNPUWQ4.js")),session:Y("session",()=>import("./trillion3d-explorer-3SU2HTGD.js")),physics:Y("physics",()=>import("./trillion3d-session-S4GIQNV6.js")),ragdoll:Y("ragdoll",()=>import("./trillion3d-ragdollCode-XOZ7BBU4.js")),ragdollCatalogue:Y("ragdoll catalogue",()=>import("./trillion3d-catalogueCode-KZ3X7U7G.js")),ragdollStage:Y("ragdoll staging",()=>import("./trillion3d-ragdollStage-EGRNR3QB.js")),animationGraph:Y("animation graph",()=>import("./trillion3d-graphCode-MCIPPACK.js")),terrain:Y("terrain",()=>import("./trillion3d-terrainCode-ZDONXR5X.js")),terrainGrass:Y("terrain grass",()=>import("./trillion3d-grassCode-J7CCF63J.js")),particles:Y("particles",()=>import("./trillion3d-particleCode-X7RJYMM2.js")),transmission:Y("transmission",()=>import("./trillion3d-family-YNJWVKWC.js")),deformation:Y("deformation",()=>import("./trillion3d-deformationCode-GJBRRE4B.js")),effects:Y("effects",()=>import("./trillion3d-effectCode-CNDEXEFI.js")),guides:Y("guides",()=>import("./trillion3d-guideCode-ONWTGY2H.js")),transformControls:Y("transform control",()=>import("./trillion3d-transformCode-SE55EUCN.js")),diagnostics:Y("diagnostics",()=>import("./trillion3d-viewCode-52L7D5ZW.js")),measurement:Y("measurement",()=>import("./trillion3d-measurementCode-I6LN3Z4A.js")),benchmark:Y("hardware benchmark",()=>import("./trillion3d-hardwareBenchmark-JD2ITGNS.js")),worldStream:Y("world stream",()=>import("./trillion3d-worldRootPages-P75VSIXR.js")),statsPanel:Y("stats panel",()=>import("./trillion3d-panel-4BMTNA6N.js")),loadingIndicator:Y("loading indicator",()=>import("./trillion3d-indicator-ZDOOX6EU.js"),!0),sceneDrive:Y("scene load",()=>import("./trillion3d-scene-3LL23MZI.js")),pageWork:Y("page tasks",()=>import("./trillion3d-workCode-DCC25A2D.js")),pageCodec:Y("page decoder",async()=>(await n0(),import("./trillion3d-geometryPage-DVJ4N2A6.js"))),manifestLoad:Y("manifest load",()=>import("./trillion3d-manifestLoad-TEO2A7XO.js")),sceneRead:Y("saved scene read",()=>import("./trillion3d-read-6L2UR4EJ.js")),gltfExport:Y("glTF export",()=>import("./trillion3d-export-3COKIWS6.js")),materialGraph:Y("material graph",()=>import("./trillion3d-graphCode-MOTJ4WBF.js")),graphPreview:Y("graph preview",()=>import("./trillion3d-previewRun-YOUFRKDJ.js")),cinematics:Y("cinematics",()=>import("./trillion3d-cinematicsCode-2YP657C3.js")),audio:Y("audio",()=>import("./trillion3d-audioCode-M3I6FF7A.js")),pageAudio:Y("page audio",()=>import("./trillion3d-pageAudioCode-PQWNFXNH.js")),modelCopies:Y("model copies",()=>import("./trillion3d-modelCopiesCode-X7PCUUUT.js")),avatar:Y("avatar",()=>import("./trillion3d-avatarCode-RTIDGTIA.js")),modelImages:Y("model images",()=>import("./trillion3d-modelImagesCode-7NZ3BIL5.js")),modelArrival:Y("model arrival",()=>import("./trillion3d-modelArrivalCode-AS2ZIO5I.js")),assemblies:Y("run-time assemblies",()=>import("./trillion3d-assemblies-BENCUAG3.js"),!0),modelSurface:Y("model surface",()=>import("./trillion3d-surfaceCode-CW2NSI5O.js")),modelCapture:Y("model capture",()=>import("./trillion3d-modelCapture-OZNK2KHI.js")),browserCompiler:Y("compiler",()=>import("./trillion3d-pageCompile-4KI5TP2J.js")),lightProfile:Y("light profile",()=>import("./trillion3d-iesCode-QVSRIT37.js")),ambientOcclusion:Y("ambient occlusion",()=>import("./trillion3d-aoCode-2JTKFXZ5.js")),pathTracing:Y("path tracing",()=>import("./trillion3d-pathTracingCode-IUDUNO7P.js")),volumes:Y("density volumes",()=>import("./trillion3d-volumesCode-NYAC6KYU.js")),decals:Y("decals",()=>import("./trillion3d-decalCode-4OSGACRW.js")),marks:Y("tyre marks",()=>import("./trillion3d-markCode-DD7RPZ2V.js")),subsurface:Y("subsurface scattering",()=>import("./trillion3d-subsurfaceCode-PROXJTLS.js")),sampledLights:Y("sampled lights",()=>import("./trillion3d-sampledLightsCode-MSZ2YCSJ.js")),water:Y("thin water",()=>import("./trillion3d-waterCode-CWZ5XYNU.js")),fog:Y("fog",()=>import("./trillion3d-fogCode-PM5UY2TW.js")),translucentLightVolume:Y("translucent light volume",()=>import("./trillion3d-translucentLightVolumeCode-EQKMCGMD.js")),cubeCaptures:Y("cube captures",()=>import("./trillion3d-cubeCapturesCode-BOLBDRJD.js")),sortedTranslucency:Y("sorted translucency",()=>import("./trillion3d-sortedTranslucencyCode-VLSTGX5S.js")),planarReflections:Y("planar reflections",()=>import("./trillion3d-planarReflectionsCode-22NVSPZ2.js")),reflections:Y("traced reflections",()=>import("./trillion3d-reflectionsCode-3T6W62HT.js")),bounce:Y("bounce",()=>import("./trillion3d-bounceCode-GEAWSI3A.js")),shadows:Y("shadows",()=>import("./trillion3d-shadowsCode-UZNPLVCV.js")),sky:Y("sky",()=>import("./trillion3d-skyCode-BYIIBWAM.js")),hair:Y("hair strands",()=>import("./trillion3d-hairCode-PNWJMXWH.js")),autoExposure:Y("automatic exposure",()=>import("./trillion3d-autoExposureCode-AQ3IV5LH.js")),displacement:Y("displacement",()=>import("./trillion3d-displacementCode-OS37YHNO.js")),debugViews:Y("debug views",()=>import("./trillion3d-debugViewsCode-F4KTKXOZ.js")),splineMesh:Y("spline meshes",()=>import("./trillion3d-splineMeshCode-AWDX5BIG.js")),fields:Y("fields",()=>import("./trillion3d-fieldsCode-JQLVIT4H.js")),headless:Y("headless worlds",()=>import("./trillion3d-headlessCode-JAXG4XPK.js")),partition:Y("partition",()=>import("./trillion3d-partitionCode-KNTGZUZG.js")),pageInstall:Y("page install",()=>import("./trillion3d-installCode-5NOFNOTZ.js"))};function KQe(e,t){let r;for(let o of e){let i=M[o];t&&i.resting()||(i.get(),i.arrived||(r??=[]).push(i.settled()))}let n=r&&Promise.all(r).then(()=>{});return n&&Jt(n,t?.signal)}var zR=1/0,QQe=e=>e.every!==zR,rW=12;function yp(e=[]){let t=[],r=new Set,n=zR,o=()=>{let s=zR;for(let a of t)s=Math.min(s,a.every);for(let a of e)s=Math.min(s,a.every);if(s!==n){n=s;for(let a of r)a()}},i=e.map(s=>s.follow(o));return o(),W({get every(){return n},ask(s){let a={every:Number.isFinite(s)?Math.max(1,Math.floor(s)):1};t.push(a),o();let l=!1;return()=>{l||(l=!0,t.splice(t.indexOf(a),1),o())}},follow(s){return r.add(s),()=>void r.delete(s)},detach(){for(let s of i)s()}})}var nW=!1,xp=j3(e=>e.has("profile"));function oW(){return nW||xp()}var Qpe=yp(),jR;function bp(e){nW=e,e?(M.measurement.get(),jR??=Qpe.ask(rW)):(jR?.(),jR=void 0)}var Zpe="[trillion3d]",$R=e=>(t,...r)=>console[e](`${Zpe} ${t}`,...r),tr={info:$R("info"),warn:$R("warn"),error:$R("error")};function iW(e,t){let r=new Float64Array(e*t),n=new Uint32Array(e),o=new Uint32Array(e);return{push(i,s){r[i*t+n[i]]=s,n[i]=(n[i]+1)%t,o[i]<t&&o[i]++},values:i=>r.subarray(i*t,i*t+o[i]),ordered(i){let s=o[i],a=new Array(s),l=s===t?n[i]:0;for(let c=0;c<s;c++)a[c]=r[i*t+(l+c)%t];return a},clear(){n.fill(0),o.fill(0)}}}var YR=class{intervals;lastMetrics=null;sourceTriangles=0;totalClusters=0;autoLogTimer=null;constructor(t=120){this.intervals=iW(1,Math.max(1,t))}orderedIntervals(){return this.intervals.ordered(0)}setMetadata(t){this.sourceTriangles=t.sourceTriangles||0,this.totalClusters=t.totalNodes||0}record(t){let r=t.rafIntervalMs;r!=null&&r>0&&this.intervals.push(0,r),this.lastMetrics=t}getReport(){let{lastMetrics:t,sourceTriangles:r,totalClusters:n}=this;return W3(this.orderedIntervals(),t,r,n)}formatReport(){return z3(this.getReport())}printReport(){tr.info(this.formatReport())}startAutoLog(t=2){return bp(!0),this.stopAutoLog(),this.autoLogTimer=setInterval(()=>this.printReport(),Math.max(.5,t)*1e3),()=>this.stopAutoLog()}stopAutoLog(){this.autoLogTimer!=null&&(clearInterval(this.autoLogTimer),this.autoLogTimer=null)}dispose(){this.stopAutoLog(),this.intervals.clear(),this.lastMetrics=null}};var Jpe={physics:"scene",animations:"scene",lights:"scene",cutAdoption:"cut",selection:"cut",transparents:"surfaces",residency:"cut",hostPages:"cut",uploads:"cut",textures:"cut",encode:"commands",submit:"commands",hiZ:"surfaces",geometry:"surfaces",coplanar:"surfaces",surfaceAtlas:"light",shadows:"light",lightLists:"light",bounce:"light",reflections:"light",lighting:"light",antialiasing:"image",effects:"image",present:"image",outside:"apart",diagnostic:"apart"},Yr=Object.keys(Jpe),v=e=>Object.freeze(e),Ep=e=>Object.freeze(e);var Tp="pagedShadow.",ehe=`${Tp}denoise`,fZe=`${ehe}.tiles`,pZe=`${Tp}projection`,hZe=`${Tp}render`,mZe={label:`${Tp}occlusion.build`},the="Trillion3D compose roots",rhe="Trillion3D root boxes",nhe="Trillion3D compose rows",ohe="Trillion3D placement tree leaves",ihe="Trillion3D placement tree refit",she="Trillion3D light pattern atlas",ahe="Trillion3D fog sun light pattern",lhe="Trillion3D toon profile bake",che="Trillion3D rect light atlas add",uhe="Trillion3D rect light atlas copy",dhe="Trillion3D rect light atlas filter",fhe="Trillion3D rect light atlas clear",phe="Trillion3D rect light atlas debug",hhe="Trillion3D rect light atlas blit",mhe="Trillion3D light profile atlas debug",ghe="Trillion3D light profile atlas blit",She="Trillion3D light shapes",whe="Trillion3D DAG selection",yhe="Trillion3D cluster measure",xhe="Trillion3D HiZ",bhe="Trillion3D visibility primary",Ehe="Trillion3D visibility secondary",The="Trillion3D raster binning",Ahe="Trillion3D raster occluder depth",Ohe="Trillion3D raster tested depth",Lhe="Trillion3D raster identifiers",Rhe="Trillion3D raster occluder hiz",_he="Trillion3D raster resolve",vhe="Trillion3D raster depth export",Mhe="Trillion3D empty surfaces",Dhe="Trillion3D material surfaces v1",Phe="Trillion3D material bins and shading",Che="Trillion3D material bins",Ihe="Trillion3D material shading ",khe="Trillion3D texture feedback reduce",Fhe="Trillion3D texture eviction queue",Nhe="Trillion3D transparents",Bhe="Trillion3D blend responsiveness",Uhe="Trillion3D blend layers motion",Vhe="Trillion3D sky surfaces",Ghe="Trillion3D alpha holdout start",Hhe="Trillion3D blend alpha holdout",Whe="Trillion3D translucent radiance mark",zhe="Trillion3D alpha holdout apply",jhe="Trillion3D sorted translucency collect",$he="Trillion3D sorted translucency combine",Yhe="Trillion3D translucency modulation",Khe="Trillion3D translucency compose",qhe="Trillion3D distortion",Xhe="Trillion3D distortion apply",Qhe="Trillion3D water scene copy",Zhe="Trillion3D water depth",Jhe="Trillion3D water refraction mask",eme="Trillion3D water",tme="Trillion3D water tiles",rme="Trillion3D water velocity",nme="Trillion3D water sun shadow",ome="Trillion3D water composite",ime="Trillion3D blend order and expansion",sme="Trillion3D display mask",ame="Trillion3D display filter",lme="Trillion3D transparent front",cme="Trillion3D transparent compaction",ume="Trillion3D transparent occlusion",dme="Trillion3D hzb occlusion roots",fme="Trillion3D hardware occlusion boxes",pme="Trillion3D hardware occlusion small depth",hme="Trillion3D hardware occlusion verdicts",mme="Trillion3D particles",gme="Trillion3D particle draw",Sme="Trillion3D light tiles v1",wme="Trillion3D bounce v1",yme="Trillion3D view probes",xme="Trillion3D reflections",bme="Trillion3D reflection trace",Eme="Trillion3D reflection scene",Tme="Trillion3D reflection hit shading",Ame="Trillion3D reflection clear",Ome="Trillion3D reflection own rays",Lme="Trillion3D reflection resolve",Rme="Trillion3D reflection temporal",_me="Trillion3D reflection bilateral",vme="Trillion3D reflection keep depth",Mme="Trillion3D tile classification",Dme="Trillion3D surface colour",Pme="Trillion3D height fog",Cme="Trillion3D fog separate composition",Ime="Trillion3D fog blur",kme="Trillion3D fog upsample",Fme="Trillion3D fog temporal",Nme="Trillion3D baked light volume light",Bme="Trillion3D baked light volume visualize",Ume="Trillion3D fog volume",Vme="Trillion3D translucent light volume",Gme="Trillion3D translucent light volume spheres",Hme="Trillion3D translucency global illumination",Wme="Trillion3D traced translucency trace",zme="Trillion3D traced translucency denoise",jme="Trillion3D traced translucency compose",$me="Trillion3D ambient occlusion",Yme="Trillion3D subsurface scattering",Kme="Trillion3D responsiveness clear",qme="Trillion3D velocity",Xme="Trillion3D temporal dilate velocity",Qme="Trillion3D temporal decimate history",Zme="Trillion3D temporal measure flickering luma",Jme="Trillion3D temporal measure thin geometry coverage",ege="Trillion3D temporal detect thin geometry",tge="Trillion3D temporal thin geometry weight relaxation",rge="Trillion3D temporal reject shading",nge="Trillion3D temporal spatial anti-aliasing",oge="Trillion3D temporal update history",ige="Trillion3D temporal resolve history",sge="Trillion3D temporal resolve display layers",age="Trillion3D exposure",lge="Trillion3D scene downsample",cge="Trillion3D local exposure",uge="Trillion3D tone table",dge="Trillion3D motion blur",fge="Trillion3D depth of field",pge="Trillion3D bloom",hge="Trillion3D outline",mge="Trillion3D post-process material",gge="Trillion3D marked depth",Sge="Trillion3D HDR composition",wge="Trillion3D HDR composition + present",yge="Trillion3D direct present",xge="Trillion3D view present",bge="Trillion3D guides",Ege="Trillion3D x-ray",Tge="Trillion3D mesh edges",Age="Trillion3D frame difference",Oge="Trillion3D see-through background",Lge="Trillion3D capture emission and occlusion",Rge="Trillion3D hair strands ",_ge=Ep({prefix:Rge,stage:"geometry",block:"other"}),vge="Trillion3D surface atlas",Mge="Trillion3D surface atlas lighting",gZe="Trillion3D surface atlas",sW=Ep({prefix:Tp,stage:"shadows",block:"other"}),ja=(e,...t)=>t.map(r=>Ep({prefix:r,stage:e,block:"other"})),aW=[...ja("residency","Trillion3D page install"),...ja("selection","Trillion3D ray query"),_ge,...ja("shadows","Trillion3D sun field shadow"),...ja("lighting","Trillion3D field-sky occlusion","Trillion3D world field","Trillion3D mesh field"),...ja("lighting","Trillion3D path tracer","Trillion3D air","Trillion3D sky","Trillion3D opaque haze","Trillion3D cloud","Trillion3D light shafts","Trillion3D fog local volumes","Trillion3D surface rewrite","Trillion3D debug lines appended"),...ja("surfaceAtlas","Trillion3D imprint capture","Trillion3D surface atlas "),...ja("diagnostic","Trillion3D inspection reflection")],lW=[Ep({prefix:Ihe,stage:"geometry",block:"materials"})],cW=[v({label:the,stage:"animations",block:"other"}),v({label:nhe,stage:"animations",block:"other"}),v({label:rhe,stage:"animations",block:"other"}),v({label:ohe,stage:"selection",block:"visibility"}),v({label:ihe,stage:"selection",block:"visibility"}),v({label:whe,stage:"selection",block:"visibility"}),v({label:yhe,stage:"selection",block:"visibility"}),v({label:xhe,stage:"hiZ",block:"visibility"}),v({label:bhe,stage:"geometry",block:"visibility"}),v({label:Ehe,stage:"geometry",block:"visibility"}),v({label:The,stage:"geometry",block:"visibility"}),v({label:Ahe,stage:"geometry",block:"visibility"}),v({label:Ohe,stage:"geometry",block:"visibility"}),v({label:Lhe,stage:"geometry",block:"visibility"}),v({label:Rhe,stage:"hiZ",block:"visibility"}),v({label:_he,stage:"geometry",block:"visibility"}),v({label:vhe,stage:"geometry",block:"visibility"}),v({label:Mhe,stage:"geometry",block:"materials"}),v({label:Phe,stage:"geometry",block:"materials"}),v({label:Che,stage:"geometry",block:"materials"}),v({label:Dhe,stage:"geometry",block:"materials"}),v({label:khe,stage:"textures",block:"other"}),v({label:Fhe,stage:"textures",block:"other"}),v({label:Nhe,stage:"transparents",block:"other"}),v({label:Bhe,stage:"transparents",block:"other"}),v({label:Uhe,stage:"transparents",block:"other"}),v({label:Ghe,stage:"transparents",block:"other"}),v({label:Hhe,stage:"transparents",block:"other"}),v({label:Whe,stage:"transparents",block:"other"}),v({label:zhe,stage:"transparents",block:"other"}),v({label:jhe,stage:"transparents",block:"other"}),v({label:$he,stage:"transparents",block:"other"}),v({label:Yhe,stage:"transparents",block:"other"}),v({label:Khe,stage:"transparents",block:"other"}),v({label:qhe,stage:"transparents",block:"other"}),v({label:Xhe,stage:"transparents",block:"other"}),v({label:Qhe,stage:"transparents",block:"other"}),v({label:Zhe,stage:"transparents",block:"other"}),v({label:Jhe,stage:"transparents",block:"other"}),v({label:eme,stage:"transparents",block:"other"}),v({label:tme,stage:"transparents",block:"other"}),v({label:rme,stage:"transparents",block:"other"}),v({label:nme,stage:"transparents",block:"other"}),v({label:ome,stage:"transparents",block:"other"}),v({label:cme,stage:"transparents",block:"other"}),v({label:ume,stage:"transparents",block:"other"}),v({label:dme,stage:"hiZ",block:"visibility"}),v({label:fme,stage:"hiZ",block:"visibility"}),v({label:pme,stage:"hiZ",block:"visibility"}),v({label:hme,stage:"hiZ",block:"visibility"}),v({label:ime,stage:"transparents",block:"other"}),v({label:sme,stage:"transparents",block:"other"}),v({label:ame,stage:"transparents",block:"other"}),v({label:lme,stage:"transparents",block:"other"}),v({label:gme,stage:"transparents",block:"other"}),v({label:vge,stage:"surfaceAtlas",block:"other"}),v({label:Mge,stage:"surfaceAtlas",block:"other"}),v({label:Sme,stage:"lightLists",block:"other"}),v({label:wme,stage:"bounce",block:"other"}),v({label:yme,stage:"bounce",block:"other"}),v({label:xme,stage:"reflections",block:"other"}),v({label:bme,stage:"reflections",block:"other"}),v({label:Eme,stage:"reflections",block:"other"}),v({label:Tme,stage:"reflections",block:"other"}),v({label:Ame,stage:"reflections",block:"other"}),v({label:Ome,stage:"reflections",block:"other"}),v({label:Lme,stage:"reflections",block:"other"}),v({label:Rme,stage:"reflections",block:"other"}),v({label:_me,stage:"reflections",block:"other"}),v({label:vme,stage:"reflections",block:"other"}),v({label:mme,stage:"physics",block:"other"}),v({label:Mme,stage:"lighting",block:"other"}),v({label:Dme,stage:"lighting",block:"other"}),v({label:Pme,stage:"lighting",block:"other"}),v({label:Vhe,stage:"lighting",block:"other"}),v({label:Cme,stage:"lighting",block:"other"}),v({label:Ime,stage:"lighting",block:"other"}),v({label:kme,stage:"lighting",block:"other"}),v({label:Fme,stage:"lighting",block:"other"}),v({label:she,stage:"lighting",block:"other"}),v({label:ahe,stage:"lighting",block:"other"}),v({label:lhe,stage:"lighting",block:"other"}),v({label:che,stage:"lighting",block:"other"}),v({label:uhe,stage:"lighting",block:"other"}),v({label:dhe,stage:"lighting",block:"other"}),v({label:fhe,stage:"lighting",block:"other"}),v({label:phe,stage:"lighting",block:"other"}),v({label:hhe,stage:"lighting",block:"other"}),v({label:mhe,stage:"lighting",block:"other"}),v({label:ghe,stage:"lighting",block:"other"}),v({label:She,stage:"lighting",block:"other"}),v({label:Nme,stage:"lighting",block:"other"}),v({label:Bme,stage:"lighting",block:"other"}),v({label:Ume,stage:"lighting",block:"other"}),v({label:Vme,stage:"lighting",block:"other"}),v({label:Gme,stage:"lighting",block:"other"}),v({label:Hme,stage:"lighting",block:"other"}),v({label:Wme,stage:"transparents",block:"other"}),v({label:zme,stage:"transparents",block:"other"}),v({label:jme,stage:"transparents",block:"other"}),v({label:$me,stage:"lighting",block:"other"}),v({label:Yme,stage:"lighting",block:"other"}),v({label:Kme,stage:"antialiasing",block:"other"}),v({label:qme,stage:"antialiasing",block:"other"}),v({label:Xme,stage:"antialiasing",block:"other"}),v({label:Qme,stage:"antialiasing",block:"other"}),v({label:Zme,stage:"antialiasing",block:"other"}),v({label:Jme,stage:"antialiasing",block:"other"}),v({label:ege,stage:"antialiasing",block:"other"}),v({label:tge,stage:"antialiasing",block:"other"}),v({label:rge,stage:"antialiasing",block:"other"}),v({label:nge,stage:"antialiasing",block:"other"}),v({label:oge,stage:"antialiasing",block:"other"}),v({label:ige,stage:"antialiasing",block:"other"}),v({label:sge,stage:"antialiasing",block:"other"}),v({label:age,stage:"effects",block:"other"}),v({label:lge,stage:"effects",block:"other"}),v({label:cge,stage:"effects",block:"other"}),v({label:uge,stage:"effects",block:"other"}),v({label:dge,stage:"effects",block:"other"}),v({label:fge,stage:"effects",block:"other"}),v({label:pge,stage:"effects",block:"other"}),v({label:hge,stage:"effects",block:"other"}),v({label:mge,stage:"effects",block:"other"}),v({label:gge,stage:"geometry",block:"visibility"}),v({label:Sge,stage:"present",block:"other"}),v({label:wge,stage:"present",block:"other"}),v({label:yge,stage:"present",block:"other"}),v({label:xge,stage:"present",block:"other"}),v({label:bge,stage:"present",block:"other"}),v({label:Ege,stage:"diagnostic",block:"other"}),v({label:Tge,stage:"diagnostic",block:"other"}),v({label:Age,stage:"diagnostic",block:"other"}),v({label:Oge,stage:"present",block:"other"}),v({label:Lge,stage:"present",block:"other"})];var Dge="Trillion3D texture mips",uW=[v({label:Dge,stage:"textures",block:"other"})];var dW="Trillion3D deformation",Pge="Trillion3D animation banks",KR=[v({label:dW,stage:"animations",block:"other"}),v({label:Pge,stage:"animations",block:"other"})];var Cge=[...cW,...uW,...KR],fW=({stage:e,block:t})=>Object.freeze({stage:e,at:Yr.indexOf(e),block:t}),Ige=new Map(Cge.map(e=>[e.label,fW(e)])),kge=[sW,...lW,...aW].map(e=>({prefix:e.prefix,row:fW(e)})),a0=new Map,Fge=1024;function l0(e){let t=Ige.get(e)??a0.get(e);if(t!==void 0)return t??void 0;let r=kge.find(({prefix:n})=>e.startsWith(n))?.row??null;return a0.size===Fge&&a0.clear(),a0.set(e,r),r??void 0}var Nge=e=>l0(e)?.stage,c0=e=>l0(e)?.block,Bge="unwritten-timestamps",Uge=e=>e.gpuMs!==null?e.ownMs??e.gpuMs:e.reason===Bge?0:null;function u0(e,t){return e?Vge(e.passes,t):new Map}function Vge(e,t){let r=new Map;for(let n of e){let o=t(n.name);if(o===void 0)continue;let i=r.get(o);if(i===null)continue;let s=Uge(n);r.set(o,s===null?null:(i??0)+s)}return r}var Gge=e=>l0(e)?.at,pW,qR,hW,XR;function QR(e){return qR&&e===pW?qR:(pW=e,qR=u0(e,Gge))}var Hge=Yr.indexOf("bounce"),Wge=Yr.indexOf("lightLists"),zge=Yr.indexOf("shadows"),jge=Yr.indexOf("lighting");function DZe(e,t){for(let[r,n]of QR(e))n!==null&&t(r,n)}function PZe(e){return QR(e).get(Hge)??null}function CZe(e){if(XR&&e===hW)return XR;let t=QR(e);return hW=e,XR={gpuLightListsMs:t.get(Wge)??null,gpuShadowsMs:t.get(zge)??null,gpuLightingMs:t.get(jge)??null}}function $a(e){let t=new WeakMap,r=[];return{get size(){return r.length},add(n){let o=e(n),i=t.get(o);i||t.set(o,i=new Set),!i.has(n)&&(i.add(n),r.push(new WeakRef(n)))},delete(n){if(!t.get(e(n))?.delete(n))return;let o=r.findIndex(i=>i.deref()===n);r.copyWithin(o,o+1),r.pop()},has:n=>!!t.get(e(n))?.has(n),on:n=>t.get(n),some(n){for(let o=0;o<r.length;o++){let i=r[o].deref();if(i&&n(i))return!0}return!1},copyInto(n,o){let i=0;for(let s=0;s<r.length;s++){let a=r[s].deref();a&&(r[i++]=r[s],n[o++]=a)}return r.length=i,o}}}var $ge="aliceblue f0f8ff antiquewhite faebd7 aqua 00ffff aquamarine 7fffd4 azure f0ffff beige f5f5dc bisque ffe4c4 black 000000 blanchedalmond ffebcd blue 0000ff blueviolet 8a2be2 brown a52a2a burlywood deb887 cadetblue 5f9ea0 chartreuse 7fff00 chocolate d2691e coral ff7f50 cornflowerblue 6495ed cornsilk fff8dc crimson dc143c cyan 00ffff darkblue 00008b darkcyan 008b8b darkgoldenrod b8860b darkgray a9a9a9 darkgreen 006400 darkgrey a9a9a9 darkkhaki bdb76b darkmagenta 8b008b darkolivegreen 556b2f darkorange ff8c00 darkorchid 9932cc darkred 8b0000 darksalmon e9967a darkseagreen 8fbc8f darkslateblue 483d8b darkslategray 2f4f4f darkslategrey 2f4f4f darkturquoise 00ced1 darkviolet 9400d3 deeppink ff1493 deepskyblue 00bfff dimgray 696969 dimgrey 696969 dodgerblue 1e90ff firebrick b22222 floralwhite fffaf0 forestgreen 228b22 fuchsia ff00ff gainsboro dcdcdc ghostwhite f8f8ff gold ffd700 goldenrod daa520 gray 808080 green 008000 greenyellow adff2f grey 808080 honeydew f0fff0 hotpink ff69b4 indianred cd5c5c indigo 4b0082 ivory fffff0 khaki f0e68c lavender e6e6fa lavenderblush fff0f5 lawngreen 7cfc00 lemonchiffon fffacd lightblue add8e6 lightcoral f08080 lightcyan e0ffff lightgoldenrodyellow fafad2 lightgray d3d3d3 lightgreen 90ee90 lightgrey d3d3d3 lightpink ffb6c1 lightsalmon ffa07a lightseagreen 20b2aa lightskyblue 87cefa lightslategray 778899 lightslategrey 778899 lightsteelblue b0c4de lightyellow ffffe0 lime 00ff00 limegreen 32cd32 linen faf0e6 magenta ff00ff maroon 800000 mediumaquamarine 66cdaa mediumblue 0000cd mediumorchid ba55d3 mediumpurple 9370db mediumseagreen 3cb371 mediumslateblue 7b68ee mediumspringgreen 00fa9a mediumturquoise 48d1cc mediumvioletred c71585 midnightblue 191970 mintcream f5fffa mistyrose ffe4e1 moccasin ffe4b5 navajowhite ffdead navy 000080 oldlace fdf5e6 olive 808000 olivedrab 6b8e23 orange ffa500 orangered ff4500 orchid da70d6 palegoldenrod eee8aa palegreen 98fb98 paleturquoise afeeee palevioletred db7093 papayawhip ffefd5 peachpuff ffdab9 peru cd853f pink ffc0cb plum dda0dd powderblue b0e0e6 purple 800080 rebeccapurple 663399 red ff0000 rosybrown bc8f8f royalblue 4169e1 saddlebrown 8b4513 salmon fa8072 sandybrown f4a460 seagreen 2e8b57 seashell fff5ee sienna a0522d silver c0c0c0 skyblue 87ceeb slateblue 6a5acd slategray 708090 slategrey 708090 snow fffafa springgreen 00ff7f steelblue 4682b4 tan d2b48c teal 008080 thistle d8bfd8 tomato ff6347 turquoise 40e0d0 violet ee82ee wheat f5deb3 white ffffff whitesmoke f5f5f5 yellow ffff00 yellowgreen 9acd32",d0;function mW(e){if(!d0){d0=new Map;let t=$ge.split(" ");for(let r=0;r<t.length;r+=2)d0.set(t[r],parseInt(t[r+1],16))}return d0.get(e.toLowerCase())}var f0=new Float64Array(3),pe=class e extends cn{isColor=!0;r=1;g=1;b=1;constructor(t){super(),t!==void 0&&this.set(t)}set(t){if(typeof t=="string")return this.setStyle(t);if(typeof t=="number"){if(t>=0&&t<=16777215&&t%1===0)return this.setHex(t)}else{let r=Array.isArray(t),n=t,o=r?t[0]:n.r,i=r?t[1]:n.g,s=r?t[2]:n.b;if(Number.isFinite(o+i+s))return this.setRGB(o,i,s)}throw new TypeError(`${String(t)} is no colour`)}setRGB(t,r,n){return this.r=t,this.g=r,this.b=n,this._changed()}setScalar(t){return this.setRGB(t,t,t)}setHex(t){let{r,g:n,b:o}=UG(Math.floor(t));return this.setRGB(Qn(r),Qn(n),Qn(o))}setHSL(t,r,n){return AT(f0,0,t,r,n),this.setRGB(Qn(f0[0]),Qn(f0[1]),Qn(f0[2]))}setStyle(t){let r=t.trim(),n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(r);if(n){let s=n[1].length===3?[...n[1]].map(a=>a+a).join(""):n[1];return this.setHex(parseInt(s,16))}let o=/^(rgba?|hsla?)\(([^)]*)\)$/i.exec(r);if(o){let s=o[2].split(/[\s,/]+/).filter(Boolean),a=(l,c)=>s[l].endsWith("%")?parseFloat(s[l])/100:parseFloat(s[l])/c;return o[1].toLowerCase().startsWith("rgb")?this.setRGB(Qn(a(0,255)),Qn(a(1,255)),Qn(a(2,255))):this.setHSL(parseFloat(s[0])/360,a(1,100),a(2,100))}let i=mW(r);if(i===void 0)throw new Error(`Unknown colour: ${t}`);return this.setHex(i)}copy(t){return this.setRGB(t.r,t.g,t.b)}clone(){return new e().copy(this)}getHex(){return gg(this.r)<<16|gg(this.g)<<8|gg(this.b)}getHexString(){return this.getStyle().slice(1)}getStyle(){let t=this.getHex();return yw(t>>16&255,t>>8&255,t&255)}lerp(t,r){return this.setRGB(Qe(this.r,t.r,r),Qe(this.g,t.g,r),Qe(this.b,t.b,r))}multiplyScalar(t){return this.setRGB(this.r*t,this.g*t,this.b*t)}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b}fromArray(t,r=0){return this.setRGB(t[r],t[r+1],t[r+2])}toArray(){return[this.r,this.g,this.b]}};var wW=["surface","volume","lightPattern","postProcess","deferredDecal"],yW="volume",Yge=65e3,JZe=.6,JR=A({extinction:y("extinction",0)}),Kge={albedo:[0,0,0],extinction:0,emissive:[0,0,0],emissiveOnly:!1};function ZR(e){throw new E("INVALID_MATERIAL",`volume material: ${e}`,{})}function gW(e,t){return(!Array.isArray(e)||e.length!==3||!e.every(r=>Number.isFinite(r)&&r>=0))&&ZR(`${t} expects three finite numbers \u2265 0`),[e[0],e[1],e[2]]}var SW=e=>k(e,0,Yge);function xW(e={}){let t=Kge,{extinction:r=t.extinction,emissiveOnly:n=t.emissiveOnly}=e;et(JR.extinction,r)||ZR("extinction expects a finite number \u2265 0"),typeof n!="boolean"&&ZR("emissiveOnly expects a boolean");let o=gW(e.albedo??t.albedo,"albedo"),i=gW(e.emissive??t.emissive,"emissive");return{albedo:n?[0,0,0]:o.map(s=>Math.min(s,1)),extinction:n?0:SW(r),emissive:i.map(SW),emissiveOnly:n}}var tJe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mP4DwQACfsD/Wj6HMwAAAAASUVORK5CYII=";var bW="hlodInstance",EW="hlodInclude";var rJe="--hlod=";var qge=["default",255,1,2,4,8,16,32,64,128],Xge=255,Qge=8,Zge=65536,Jge=255,TW=S("markedDepthStencilValue",0,[0,Xge]),AW=e=>qge.some(t=>t===e),iJe=(e,t,r)=>e?Zge|(r==="default"?0:r)<<Qge|t&Jge:0;var uJe="objectSettings",dJe="--object-settings=",fJe="objects",eSe="spatiallyLoaded",tSe="skinnedInstance",rSe="drawDistance",nSe="runtimeGrid",oSe="farField",iSe=EW,sSe=bW,pJe=[eSe,tSe,rSe,nSe,oSe,iSe,sSe],hJe=["min","max","perInstance"],mJe=0,gJe=0;var SJe=["clip","looping","playRate","position","boundsScale","animationMinScreenSize","mobility"];var e_=["static","stationary","movable"];var tu=A({worldPositionOffsetDisableDistance:y("worldPositionOffsetDisableDistance",0),markedDepthStencilValue:TW,maxDrawDistance:y("maxDrawDistance",0)});var h0=A({enabled:p("enabled",!0),focusDistance:g("focusDistance",0,U(0)),aperture:g("aperture",4,[1,32]),minAperture:g("minAperture",1.2,[0,32]),bladeCount:S("bladeCount",5,[4,16]),sensorWidth:g("sensorWidth",24.576,U(.1)),squeezeFactor:g("squeezeFactor",1,[.1,10]),aspectRatioScalar:y("aspectRatioScalar",1),blurByDepthAmount:g("blurByDepthAmount",1,[1e-6,100]),depthBlurRadius:y("depthBlurRadius",0),petzvalBokeh:g("petzvalBokeh",0,[-10,10]),petzvalFalloff:g("petzvalFalloff",1,[0,100]),petzvalExclusionBoxWidth:g("petzvalExclusionBoxWidth",0,[0,1]),petzvalExclusionBoxHeight:g("petzvalExclusionBoxHeight",0,[0,1]),petzvalExclusionRadius:g("petzvalExclusionRadius",0,[0,1]),barrelRadius:y("barrelRadius",5),barrelLength:y("barrelLength",0)}),OW=(()=>{let{petzvalExclusionBoxWidth:e,petzvalExclusionBoxHeight:t}=h0;return{...ze("petzvalExclusionBox",[e.default,t.default]),range:e.range}})(),p0=3,aSe=Object.freeze(Array.from({length:p0},()=>Object.freeze({pitch:0,roll:0,length:0}))),lSe=Array.from({length:p0},(e,t)=>({pitch:g(`matteBox[${t}].pitch`,0,[-90,90]),roll:g(`matteBox[${t}].roll`,0,[0,360]),length:y(`matteBox[${t}].length`,0)}));function t_(e){return e===void 0?aSe:!Array.isArray(e)||e.length>p0?oe("depthOfField")(`matteBox must list at most ${p0} flags`):Object.freeze(lSe.map((t,r)=>{let n=e[r]??{};return Object.freeze({pitch:hr(t.pitch,n.pitch),roll:hr(t.roll,n.roll),length:hr(t.length,n.length)})}))}function LW(e={}){return cc(h0,e,"matteBox",t_)}var RW=e=>!e.enabled||!(e.focusDistance>0||e.depthBlurRadius>0);var vW=16752412,_W=32,m0=A({thickness:{...F("thickness",2,`a number above 0, at most ${_W}`),range:[0,_W]}});var Ya=A({rubber:g("rubber",1,[0,1]),print:g("print",0,[0,1])});var MW=[tu,Ra,xS],cSe=(()=>{let{outerConeAngle:e,innerConeAngle:t,...r}=ve;return{...r,outerConeAngle:F("outerConeAngle",e.default)}})(),DW={Material:[Oi,JR,Ya],Light:[cSe,wf,wS,EO,Uo,Ai,Li,Bo,...MW],Mesh:MW,Bloom:[tR],DepthOfField:[h0,{petzvalExclusionBox:OW}],MotionBlur:[qL],Outline:[m0]};function PW(e){let t={};for(let r of e)for(let n of Object.keys(r))t[n]??=r[n];return t}var un={Material:{color:"color",emissive:"color",emissiveIntensity:"number",subsurfaceColor:"color",metalness:"number",roughness:"number",opacity:"number",transparent:"boolean",side:["front","back","double"],blending:["normal","additive","subtractive","multiply","alphaComposite","alphaHoldout"],alphaTest:"number",vertexColors:"boolean",allowNegativeEmissive:"boolean",opacityMaskClipValue:"number",ditherOpacityMask:"boolean",transparentShadow:"boolean",translucentShadowDensityScale:"number",translucentShadowStartOffset:"number",translucentSelfShadowDensityScale:"number",translucentSelfShadowSecondDensityScale:"number",translucentSelfShadowSecondOpacity:"number",translucentBackscatteringExponent:"number",translucentMultipleScatteringExtinction:{numbers:3},twoSidedPasses:"boolean",normalCurvatureToRoughness:"boolean",maxWorldPositionOffset:"number",alwaysEvaluateWorldPositionOffset:"boolean",displacementMagnitude:"number",displacementCenter:"number",displacementFadeStart:"number",displacementFadeEnd:"number",sky:"boolean",cloudFog:"boolean",computeFogPerPixel:"boolean",contactShadows:"boolean",litFrom:["lights","volumeSurface","volumeMedium","volumeAmbient"],translucencyPass:["beforeDepthOfField","afterDepthOfField","afterMotionBlur"],translucentLocalLightShadow:"boolean",translucentLocalLightShadowQuality:"number",translucentDirectionalLightShadowQuality:"number",physics:["wood","metal","rubber","ice","stone","glass","asphalt","sand","snow","grass","mud"],density:"number",friction:"number",restitution:"number",rubber:"number",print:"number",albedo:"color",extinction:"number",emissiveOnly:"boolean",blendableLocation:["sceneColorBeforeDof","sceneColorAfterDof","translucencyAfterDof","ssrInput","sceneColorBeforeBloom","replacingTonemapper","sceneColorAfterTonemapping"],blendablePriority:"number",blendableOutputAlpha:"boolean",isBlendable:"boolean",disablePreExposureScale:"boolean",enableStencilTest:"boolean",stencilCompare:["less","lessEqual","greater","greaterEqual","equal","notEqual","never","always"],stencilRefValue:"number",shininess:"number",shadingModel:["unlit","defaultLit","subsurface","preintegratedSkin","clearCoat","subsurfaceProfile","twoSidedFoliage","hair","cloth","eye","thinWater","thinTranslucent","toon","fromMaterialExpression"],subsurfaceOpacity:"number",irisMask:"number",irisDistance:"number",transmission:"number",ior:"number",thickness:"number",anisotropy:"number",anisotropyRotation:"number",clearcoat:"number",clearcoatRoughness:"number",sheen:"number",sheenColor:"color",sheenRoughness:"number",specularIntensity:"number",iridescence:"number",aoMapIntensity:"number",wireframe:"boolean",flatShading:"boolean",size:"number",sizeAttenuation:"boolean",rotation:"number",linewidth:"number",dashSize:"number",gapSize:"number",scale:"number"},Light:{castShadow:"boolean",color:"color",groundColor:"color",intensity:"number",intensityUnits:["unitless","candelas","lumens","nits","ev"],distance:"number",innerConeAngle:"number",outerConeAngle:"number",width:"number",height:"number",radius:"number",tubeLength:"number",softRadius:"number",radialExponent:"number",diffuseShare:"number",specularShare:"number",inverseExposureBlend:"number",maxDrawDistance:"number",inverseSquared:"boolean",angularRadius:"number",softAngle:"number",hairDeepShadowLayerDistribution:"number",fogScattering:"number",shadowResolutionScale:"number",temperatureKelvin:"number",forwardShadingPriority:"number",useTemperature:"boolean",shadowsAir:"boolean",transmittancePerPixel:"boolean",transmission:"boolean",castHairDeepShadow:"boolean",shadowBias:"number",shadowSlopeBias:"number",shadowSharpen:"number",barnDoorAngle:"number",barnDoorLength:"number",maxDistanceFadeRange:"number",lightGroups:{switches:["channel0","channel1","channel2"]},iesProfile:{brand:"isLightProfile"},useIesBrightness:"boolean",iesBrightnessScale:"number",iesBrightness:"number",mobility:["static","stationary","movable"],atmosphereSun:"boolean",castTranslucentShadows:"boolean",atmosphereSunIndex:"number",sunDiskTint:"color",shadowsFog:"boolean",lightPatternFadeDistance:"number",lightPatternDisabledBrightness:"number",lightPatternConeAngle:"number",shaftOcclusion:"boolean",shaftOcclusionDarkness:"number",shaftOcclusionDepthRange:"number",shaftBloom:"boolean",shaftBloomScale:"number",shaftBloomThreshold:"number",shaftBloomMaxBrightness:"number",shaftBloomTint:"color",shadowsClouds:"boolean",castCloudShadows:"boolean",cloudShadowStrength:"number",cloudShadowOnAtmosphereStrength:"number",cloudShadowOnSurfaceStrength:"number",cloudShadowDepthBiasKm:"number",cloudShadowExtentKm:"number",cloudShadowResolutionScale:"number",cloudShadowRaySamplesScale:"number",cloudScatteredLuminanceScale:"color",shadowDistance:{switchOr:"number"},shadowCascades:"number",shadowCascadeExponent:"number",shadowCascadeTransition:"number",fieldShadowCascade:"boolean",fieldShadowDistance:{switchOr:"number"},fieldShadowTraceDistance:"number",fieldShadowRayStartOffsetDepthScale:"number",shadowDistanceFadeoutFraction:"number",contactShadowLength:"number",contactShadowLengthInWorldSpace:"boolean",contactShadowCastingIntensity:"number",contactShadowNonCastingIntensity:"number",indirectLightingIntensity:"number",castRayTracedShadow:["disabled","useProjectSetting","enabled"],rayTracedShadowSamplesPerPixel:"number",renderOrder:"number",visible:"boolean",castsShadowMaps:"boolean",farField:"boolean",evaluateWorldPositionOffset:"boolean",worldPositionOffsetDisableDistance:"number",worldPositionOffsetWritesVelocity:"boolean",shadowCacheInvalidation:["auto","always","rigid","static"],firstPerson:"boolean",firstPersonWorldSpaceRepresentation:"boolean",castHiddenShadow:"boolean",holdout:"boolean",castContactShadow:"boolean",affectDistanceFieldLighting:"boolean",castCapsuleDirectShadow:"boolean",castVolumetricTranslucentShadow:"boolean",castCapsuleIndirectShadow:"boolean",capsuleIndirectShadowMinVisibility:"number",ownerNoSee:"boolean",onlyOwnerSee:"boolean",renderMarkedDepth:"boolean",markedDepthStencilValue:"number",visibleInReflections:"boolean",visibleInRayTracing:"boolean",affectIndirectLighting:"boolean",editorHelper:"boolean",name:"string"},Mesh:{castShadow:"boolean",renderOrder:"number",visible:"boolean",castsShadowMaps:"boolean",farField:"boolean",evaluateWorldPositionOffset:"boolean",worldPositionOffsetDisableDistance:"number",worldPositionOffsetWritesVelocity:"boolean",shadowCacheInvalidation:["auto","always","rigid","static"],mobility:["static","stationary","movable"],firstPerson:"boolean",firstPersonWorldSpaceRepresentation:"boolean",castHiddenShadow:"boolean",holdout:"boolean",castContactShadow:"boolean",affectDistanceFieldLighting:"boolean",castCapsuleDirectShadow:"boolean",castVolumetricTranslucentShadow:"boolean",castCapsuleIndirectShadow:"boolean",capsuleIndirectShadowMinVisibility:"number",lightGroups:{switches:["channel0","channel1","channel2"]},ownerNoSee:"boolean",onlyOwnerSee:"boolean",renderMarkedDepth:"boolean",markedDepthStencilValue:"number",visibleInReflections:"boolean",visibleInRayTracing:"boolean",affectIndirectLighting:"boolean",maxDrawDistance:"number",editorHelper:"boolean",name:"string"},Bloom:{method:["gaussian","convolution"],intensity:"number",gaussianIntensity:"number",threshold:"number",sizeScale:"number"},DepthOfField:{enabled:"boolean",focusDistance:"number",aperture:"number",minAperture:"number",bladeCount:"number",sensorWidth:"number",squeezeFactor:"number",aspectRatioScalar:"number",blurByDepthAmount:"number",depthBlurRadius:"number",petzvalBokeh:"number",petzvalFalloff:"number",petzvalExclusionBox:{numbers:2},petzvalExclusionRadius:"number",barrelRadius:"number",barrelLength:"number"},MotionBlur:{amount:"number",max:"number",motionBlurTargetFrameRate:"number",cameraMotion:"boolean"},Outline:{color:"color",thickness:"number"}},CW={Material:["opacityMaskClipValue","translucentShadowDensityScale","translucentShadowStartOffset","translucentSelfShadowDensityScale","translucentSelfShadowSecondDensityScale","translucentSelfShadowSecondOpacity","translucentBackscatteringExponent","displacementFadeStart","displacementFadeEnd","translucentDirectionalLightShadowQuality","physics","density","friction","restitution","rubber","print","albedo","extinction","emissiveOnly","blendableLocation","blendablePriority","blendableOutputAlpha","isBlendable","disablePreExposureScale","enableStencilTest","stencilCompare","stencilRefValue","shininess","shadingModel","subsurfaceOpacity","irisMask","irisDistance","transmission","ior","thickness","anisotropy","anisotropyRotation","clearcoat","clearcoatRoughness","sheen","sheenColor","sheenRoughness","specularIntensity","iridescence","aoMapIntensity","wireframe","flatShading","size","sizeAttenuation","rotation","linewidth","dashSize","gapSize","scale"],Light:["iesProfile"],Mesh:["mobility"],Bloom:[],DepthOfField:[],MotionBlur:[],Outline:[]};var uSe={},dSe=e=>uSe[e]??=PW(DW[e]),n_=new pe,Ka=n_,g0=[0,0,0],r_=e=>Number.isFinite(e)&&e>=0;function fSe(e){let t=typeof e;if(e===null||t!=="number"&&t!=="string"&&t!=="object")return!1;try{Ka.set(e)}catch{return!1}return g0[0]=Ka.r,g0[1]=Ka.g,g0[2]=Ka.b,r_(Ka.r)&&r_(Ka.g)&&r_(Ka.b)}function IW(e,t){return e==="color"?fSe(t):typeof e=="string"?typeof t===e&&(e!=="number"||Number.isFinite(t)):"numbers"in e?Array.isArray(t)&&t.length===e.numbers&&t.every(Number.isFinite):"switches"in e?dg(e.switches,t):"brand"in e?typeof t=="string"||Pe(t)&&t[e.brand]===!0:"switchOr"in e?typeof t=="boolean"||IW(e.switchOr,t):e.includes(t)}function kW(e){return e==="color"?"a colour: 0xRRGGBB, a CSS colour or linear [r, g, b] of at least 0":typeof e=="string"?`a${e==="number"?" finite":""} ${e}`:"numbers"in e?`${e.numbers} finite numbers`:"switches"in e?`{ ${e.switches.join(", ")} }, each true or false`:"brand"in e?`a string, or the object its ${e.brand} tells`:"switchOr"in e?`${kW(e.switchOr)}, true or false`:`one of ${e.map(t=>`'${t}'`).join(", ")}`}var pSe=e=>e[0].toLowerCase()+e.slice(1);function hSe(e){try{return Pe(e)&&!ArrayBuffer.isView(e)?JSON.stringify(e):String(e)}catch{return String(e)}}var Op=(e,t,r,n=pSe(e))=>oe(`${n}.${t}`)(r);function Fi(e,t,r,n,o){if(r==="boolean"&&typeof n=="boolean")return n;if(n==null){CW[e].includes(t)||Op(e,t,"is never unset: write a value",o);return}IW(r,n)||Op(e,t,`must be ${kW(r)}, got ${hSe(n)}`,o);let i=dSe(e)[t];return typeof r=="object"&&"brand"in r&&typeof n!="string"?n:typeof r=="object"&&"switchOr"in r&&typeof n=="boolean"?hr(i,n):(i&&!et(i,r==="color"?g0:n)&&Op(e,t,`must be ${r==="color"?"a colour whose linear channels are ":""}${Dt(i)}, got ${String(n)}`,o),Array.isArray(n)&&r!=="color"?n.slice():n)}var dn=(e,t)=>Object.hasOwn(un[e],t)?un[e][t]:void 0;function S0(e,t){let r=Gt(t),n=r;for(let o in r){let i=r[o],s=dn(e,o);if(i===null)n===r&&(n={...r}),delete n[o];else if(s!==void 0&&i!==void 0){let a=Fi(e,o,s,i);if(a===i)continue;n===r&&(n={...r}),n[o]=a}}return n}function qa(e,t,r){let n=dn(e,t);return n===void 0?o=>o:o=>Fi(e,t,n,o,r)}var ru=e=>e.isLight?"Light":e.isMesh?"Mesh":void 0;function Xa(e){let t=qa("Light",e),r=qa("Mesh",e),n=qa("Mesh",e,"object");return(o,i)=>{let s=ru(o);return s==="Light"?t(i):s==="Mesh"?r(i):n(i)}}function nu(e){let t=Xa(e);return(r,n)=>typeof n=="boolean"?n:t(r,n)}var mSe=e=>e.isMaterial?"Material":ru(e)??(e.isObject3D?"Mesh":e.fieldType);function FW(e,t,r,n=0,o=1){let i=mSe(e),s=i===void 0?void 0:dn(i,t),a=i==="Mesh"&&ru(e)===void 0?"object":void 0;if(s!==void 0)for(let l=n;l<r.length;l+=o)Fi(i,t,s,r[l],a)}var Ap=Symbol("stores"),NW=Symbol("backing");function gSe(e){let t=e;return Object.hasOwn(e,Ap)||Object.defineProperty(e,Ap,{value:Object.create(t[Ap]??null)}),t[Ap]}function xt(e,t,r){gSe(e)[t]=r}function BW(e,t,r){xt(e,t,Object.assign(function(o){this[r]=o},{[NW]:r}))}var UW=e=>e?.[NW],Ni=(e,t)=>e[Ap]?.[t];function VW(e,t,r,n,o){let i=dn(t,r);xt(e,r,o),Object.defineProperty(e,r,{get:n,set:i===void 0?o:function(s){o.call(this,Fi(t,r,i,s))}})}var ie=new Float64Array(9),Ct=0,Sr=1,Rs=2,o_=3,Lp=4,JJe=5,eet=6,tet=7,ou=8;var SSe={position:3,quaternion:4,scale:3},w0=new Float64Array(4),i_=new WeakMap;function wSe(e,t){t?i_.set(e,t):i_.delete(e)}var s_=class{owner;field;rotation;rest;sum;weight=0;added;adds=!1;filled=!1;single=!1;_over=null;touchedAt=0;pose;size;store;backing;constructor(t,r,n,o){this.owner=t,this.field=r,this.rotation=n,this.rest=new Float64Array(o),this.sum=new Float64Array(o),this.added=new Float64Array(o),this.size=o,this.pose=t.isObject3D===!0&&o===SSe[r];let i=t[r],s=i_.get(t)?.(r),a=typeof i=="number"?Ni(t,r):void 0;if(this.backing=UW(a),this.store=this.backing===void 0?a:void 0,s)for(let l=0;l<o;l++)this.rest[l]=s[l];else if(typeof i=="number")this.rest[0]=i;else if(Array.isArray(i))this.rest.set(i.slice(0,o));else{let l=i.setRGB?["r","g","b"]:["x","y","z","w"];for(let c=0;c<o;c++)this.rest[c]=i[l[c]]}}clear(){this.weight=0,this.filled=!1,this.single=!1,this.adds=!1}add(t){let r=ie[Sr];if(this.single=!this.filled,!this.filled){this.filled=!0;for(let o=0;o<this.sum.length;o++)this.sum[o]=r*t[o]+0;this.weight+=r;return}let n=1;this.rotation&&(n=ka(this.sum,t)<0?-1:1);for(let o=0;o<this.sum.length;o++)this.sum[o]+=n*r*t[o];this.weight+=r}addDifference(t){let r=ie[Sr];if(this.adds||(this.added.fill(0),this.rotation&&(this.added[3]=1)),this.adds=!0,!this.rotation){for(let o=0;o<this.added.length;o++)this.added[o]+=r*t[o];return}let n=t[3]<0?-1:1;for(let o=0;o<4;o++)w0[o]=n*r*t[o];w0[3]+=1-r,jr(w0),nt(this.added,this.added,w0)}write(){let t=this.rotation&&this.single&&this.weight===1&&!this.adds;this.weight<1&&(ie[Sr]=1-this.weight,this.add(this.rest));let r=this.sum;if(this.weight!==1)for(let n=0;n<r.length;n++)r[n]/=this.weight;if(this.adds&&this.rotation)nt(r,r,this.added);else if(this.adds)for(let n=0;n<r.length;n++)r[n]+=this.added[n];this.rotation&&!t&&jr(r),this.publish(r)}writeAlone(t,r=0){let n=this.sum;for(let o=0;o<n.length;o++)n[o]=t[r+o]+0;this.publish(n)}publish(t){if(this.backing!==void 0&&!Object.hasOwn(this.owner,this.field)){this.owner[this.backing]=t[0];return}let r=this.owner[this.field];if(typeof r=="number")this.store?this.store.call(this.owner,t[0]):this.owner[this.field]=t[0];else if(Array.isArray(r))for(let n=0;n<t.length;n++)r[n]=t[n];else if(r.setRGB)r.setRGB(t[0],t[1],t[2]);else if(r.set)t.length===4?r.set(t[0],t[1],t[2],t[3]):t.length===3?r.set(t[0],t[1],t[2]):r.set(...t);else return}},y0=class{byOwner=new Map;byTarget=new Map;touched=[];count=0;update=1;of(t,r){let n=this.byTarget.get(t);if(n)return n;let{owner:o,field:i,value:s}=t,a=this.byOwner.get(o);return a||this.byOwner.set(o,a=new Map),n=a.get(i),n||a.set(i,n=new s_(o,i,r,s.length)),this.byTarget.set(t,n),n}touch(t){return t.touchedAt!==this.update&&(t.touchedAt=this.update,this.touched[this.count++]=t,t.clear()),t}add(t,r){ie[Sr]=Math.max(0,ie[Sr]),this.touch(t).add(r)}addDifference(t,r){ie[Sr]=Math.max(0,ie[Sr]),this.touch(t).addDifference(r)}write(){let t=this.touched;for(let r=0;r<this.count;r++)t[r].write();this.count=0,this.update++}};var ySe=e=>(e.duration??0)>0;function Qa(e){return e.values.length/e.times.length/(e.interpolation==="cubic"?3:1)}function x0(e,t){let r=ie[Ct],n=e.duration||1;if(t==="once")ie[Ct]=Math.min(r,n);else if(t==="repeat")ie[Ct]=(r%n+n)%n;else{let o=2*n,i=(r%o+o)%o;ie[Ct]=i>n?o-i:i}}function b0(e,t,r,n,o,i,s){let a=(r-e)*.5,l=(n-t)*.5,c=2*t-2*r+a+l,u=3*r-3*t-2*a-l;return c*s+u*i+a*o+t}function GW(e,t){let r=t*t,n=r*t;return e[0]=2*n-3*r+1,e[1]=n-2*r+t,e[2]=-2*n+3*r,e[3]=n-r,e}function uet(e,t){let r=t*t;return e[0]=6*r-6*t,e[1]=3*r-4*t+1,e[2]=6*t-6*r,e[3]=3*r-2*t,e}var Rp=new Float64Array(4);function a_(e,t,r){return ie[Ct]=t,_p(e,r)}function _p(e,t){let r=ie[Ct],{times:n,values:o}=e,i=t.value,s=i.length,a=e.interpolation==="cubic",l=a?s*3:s,c=a?s:0,u=t.key>0&&n[t.key]<r?t.key:0;for(;u<n.length-1&&n[u+1]<=r;)u++;t.key=u;let d=Math.min(u+1,n.length-1),f=n[d]-n[u],h=f>0?Math.min(1,Math.max(0,(r-n[u])/f)):0;if(e.interpolation==="step"||h===0)for(let m=0;m<s;m++)i[m]=o[u*l+c+m];else if(a){GW(Rp,h);let m=Rp[0],w=Rp[1],x=Rp[2],b=Rp[3];for(let T=0;T<s;T++)i[T]=m*o[u*l+s+T]+w*f*o[u*l+2*s+T]+x*o[d*l+s+T]+b*f*o[d*l+T]}else if(e.kind==="quaternion"){let m=t.arc??=new Float64Array(3);return t.arcKey!==u&&Ff(m,0,o,u*s,o,d*s),t.arcKey=u,UV(i,0,o,u*s,o,d*s,h,m,0)}else for(let m=0;m<s;m++)i[m]=o[u*s+m]*(1-h)+o[d*s+m]*h;return e.kind==="quaternion"&&jr(i),i}function HW(e,t,r){if(e.kind!=="quaternion"){for(let n=0;n<t.length;n++)t[n]-=r[n];return t}return nt(t,zr(xSe,r),t)}var xSe=new Float64Array(4);function Dn(e,t){for(let r=e;r;r=r.parent)if(r===t)return!0;return!1}function fn(e){let t=e;for(;t.parent;)t=t.parent;return t}function E0(){let e=new WeakMap;return{hold:(t,r)=>void e.set(t,r),of:t=>e.get(fn(t))}}var Lt=e=>Array.isArray(e)?[e[0],e[1],e[2]]:[e.x,e.y,e.z];function De(e,t){return e[0]=t.x,e[1]=t.y,e[2]=t.z,e}function bt(e,t){return e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w,e}var wr=new Float64Array(3),Bi=new Float64Array(3),Ui=new Float64Array(4),bSe=new Float64Array(4),T0=new Float64Array(3),I=class e extends Wc{isVector3=!0;constructor(t=0,r=0,n=0){super(new Float64Array([t,r,n]))}set(t,r,n){let o=this.elements;return o[0]===t&&o[1]===r&&o[2]===n?this:(this.elements[0]=t,this.elements[1]=r,this.elements[2]=n,this._changed())}written(t){return this.set(t[0],t[1],t[2])}setScalar(t){return this.set(t,t,t)}copy(t){return this.set(t.x,t.y,t.z)}clone(){return new e(this.x,this.y,this.z)}add(t){return this.written(CT(wr,this.elements,De(Bi,t)))}addScalar(t){return this.set(this.x+t,this.y+t,this.z+t)}addVectors(t,r){return this.written(CT(wr,De(wr,t),De(Bi,r)))}addScaledVector(t,r){return this.written(Zn(De(wr,this),De(Bi,t),r))}sub(t){return this.written(Br(wr,this.elements,De(Bi,t)))}subVectors(t,r){return this.copy(t).written(Br(wr,this.elements,De(Bi,r)))}multiply(t){return this.set(this.x*t.x,this.y*t.y,this.z*t.z)}multiplyScalar(t){return this.written(IT(De(wr,this),t))}divideScalar(t){return this.multiplyScalar(1/t)}negate(){return this.multiplyScalar(-1)}min(t){return this.set(Math.min(this.x,t.x),Math.min(this.y,t.y),Math.min(this.z,t.z))}max(t){return this.set(Math.max(this.x,t.x),Math.max(this.y,t.y),Math.max(this.z,t.z))}dot(t){return Ge(this.elements,De(Bi,t))}cross(t){return this.crossVectors(this,t)}crossVectors(t,r){return this.written(Ze(wr,De(wr,t),De(Bi,r)))}lengthSq(){return sc(this.elements)}length(){return te(this.x,this.y,this.z)}setLength(t){return this.normalize().multiplyScalar(t)}normalize(){return De(wr,this),Ne(wr),this.written(wr)}distanceToSquared(t){return Eg(this.elements,De(Bi,t))}distanceTo(t){return eN(this.elements,De(Bi,t))}lerp(t,r){return this.lerpVectors(this,t,r)}lerpVectors(t,r,n){return this.set(Qe(t.x,r.x,n),Qe(t.y,r.y,n),Qe(t.z,r.z,n))}equals(t){return this.x===t.x&&this.y===t.y&&this.z===t.z}applyMatrix4(t){let r=t.elements;if(kd(r))return Do(Ui,r,this.x,this.y,this.z),this.set(Ui[0],Ui[1],Ui[2]);MT(Ui,r,this.x,this.y,this.z);let n=1/(Ui[3]||1);return this.set(Ui[0]*n,Ui[1]*n,Ui[2]*n)}applyMatrix3(t){return this.written(Bd(wr,t.elements,this.x,this.y,this.z))}transformDirection(t){return this.written(FT(wr,t.elements,this.x,this.y,this.z))}applyQuaternion(t){return this.written(yt(wr,bt(bSe,t),this.x,this.y,this.z))}setFromMatrixPosition(t){let r=t.elements;return this.set(r[12],r[13],r[14])}setFromSpherical(t){return T0[0]=t.radius,T0[1]=t.theta,T0[2]=t.phi,this.written(Hc(wr,T0))}fromArray(t,r=0){return this.set(t[r],t[r+1],t[r+2])}toArray(){return[this.x,this.y,this.z]}};var l_=e=>Math.min(e.count??e.instanceMatrix.count,e.instanceMatrix.count),WW=new Float64Array(16),He=new Float64Array(6),$o=new Float64Array(6),Za=new Float64Array(6),rr=class e{isBox3=!0;min;max;constructor(t=new I(1/0,1/0,1/0),r=new I(-1/0,-1/0,-1/0)){this.min=t,this.max=r}set(t,r){return this.min.copy(t),this.max.copy(r),this}makeEmpty(){return this.min.set(1/0,1/0,1/0),this.max.set(-1/0,-1/0,-1/0),this}isEmpty(){return NT(pn(this,He),0)}copy(t){return this.set(t.min,t.max)}clone(){return new e().copy(this)}expandByPoint(t){return On(pn(this,He),0,t.x,t.y,t.z),Pn(this,He)}expandByScalar(t){return _g(He,0,pn(this,He),0,t),Pn(this,He)}union(t){return this.unionFlat(pn(t,$o))}unionFlat(t){return iN(pn(this,He),0,t),Pn(this,He)}setFromArray(t,r=3){let n=t.length<3?0:Math.floor((t.length-3)/r)+1;return Rg(He,0,t,0,n,r),Pn(this,He)}setFromPoints(t){gi(He,0);for(let r of t)On(He,0,r.x,r.y,r.z);return Pn(this,He)}setFromObject(t){return this.makeEmpty(),t.updateMatrixWorld(!0),t.traverse(r=>{let n=r.localBounds?.();if(n&&!n.isEmpty()){let{instanceMatrix:o}=r;if(o){let s=l_({count:r.count,instanceMatrix:o}),a=o.array;for(let l=0;l<s;l++)Ce(WW,a,0,16*l),cs($o,0,pn(n,$o),0,WW),cs($o,0,$o,0,r.matrixWorld.elements),this.unionFlat($o)}else cs($o,0,pn(n,$o),0,r.matrixWorld.elements),this.unionFlat($o);let i=r.isMesh?r.skeleton:void 0;for(let s of i?.bones??[]){let a=s.matrixWorld.elements;Za[0]=Za[3]=a[12],Za[1]=Za[4]=a[13],Za[2]=Za[5]=a[14],this.unionFlat(Za)}}}),this}applyMatrix4(t){return cs(He,0,pn(this,He),0,t.elements),Pn(this,He)}getCenter(t=new I){if(this.isEmpty())return t.set(0,0,0);let{min:r,max:n}=this;return Og(He,0,r.x,r.y,r.z,n.x,n.y,n.z),t.set(He[0],He[1],He[2])}getSize(t=new I){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}containsPoint(t){return Lg(pn(this,He),0,t.x,t.y,t.z)}intersectsBox(t){return oN(pn(this,He),0,pn(t,$o),0)}getBoundingSphere(t){let{min:r,max:n}=this;return Nf(He,0,r.x,r.y,r.z,n.x,n.y,n.z),t.center.set(He[0],He[1],He[2]),t.radius=He[3],t}equals(t){return this.min.equals(t.min)&&this.max.equals(t.max)}};function pn(e,t){return t[0]=e.min.x,t[1]=e.min.y,t[2]=e.min.z,t[3]=e.max.x,t[4]=e.max.y,t[5]=e.max.z,t}function Pn(e,t){return e.min.set(t[0],t[1],t[2]),e.max.set(t[3],t[4],t[5]),e}var c_=new Float64Array(6),ESe=new rr,zW=new I,A0=[0,0,0],jW=[0,0,0];function Mr(e,t,r=[0,0,0]){for(let n=0;n<3;n++)r[n]=e.getComponent(t,n);return r}function $W(e,t,r,n,o){if(Mr(t,r,o),n){Mr(e,r,jW);for(let i=0;i<3;i++)o[i]+=jW[i]}return o}var O0=e=>e?.kind==="attribute"&&e.itemSize===3&&!e.normalized?e:null,YW=(e,t,r)=>On(e,0,t[r],t[r+1],t[r+2]);function TSe(e,t){gi(e,0);for(let r=0;r<t.count;r++)YW(e,Mr(t,r,A0),0)}function ASe({attributes:e,morphAttributes:t,morphTargetsRelative:r}){let n=e.position;if(!n)return!1;TSe(c_,n);for(let o of t.position??[])for(let i=0;i<o.count;i++)YW(c_,$W(n,o,i,r,A0),0);return!0}var KW=({attributes:e,morphAttributes:t})=>t.position?.length?null:O0(e.position);function u_(e,t){let r=KW(t);return r?e.setFromArray(r.array,r.itemSize):ASe(t)?Pn(e,c_):e.makeEmpty()}function qW(e,t){let r=t.attributes.position,n=KW(t);if(!r)return e;let{x:o,y:i,z:s}=u_(ESe,t).getCenter(zW),a=0,l=(c,u=0)=>{a=Math.max(a,Eg(zW.elements,c,0,u))};if(n)for(let c=0,u=n.array;c+2<u.length;c+=3)l(u,c);else{for(let c=0;c<r.count;c++)l(Mr(r,c,A0));for(let c of t.morphAttributes.position??[])for(let u=0;u<c.count;u++)l($W(r,c,u,t.morphTargetsRelative,A0))}return e.center.set(o,i,s),e.radius=Math.sqrt(a),e}var vp=(e,t)=>e._owner==="world"&&t.kind==="attribute",Ja=(e,t,r,n)=>vp(e,t)?t.stored(r,n):t.getComponent(r,n);function L0(e){if(!e)return[];let t=O0(e);if(t)return t.array;let r=e.count;return e.readInto(new Float32Array(r*3),0,3,0,r,3,0)}var d_=e=>/^skinIndex\d*$/.test(e);function R0(e){let r=Object.keys(e.attributes).filter(d_).sort((o,i)=>Number(o.slice(9))-Number(i.slice(9))).map(o=>{let i=e.attributes[o],s=e.attributes[o.replace("Index","Weight")];if(!i||!s||s.itemSize!==i.itemSize||s.count!==i.count)throw new Error("Invalid paired skin attributes");return{joints:i,weights:s}});return{width:r.reduce((o,i)=>o+i.joints.itemSize,0),read(o,i,s){for(let a of r){if(i<a.joints.itemSize)return Ja(e,s?a.weights:a.joints,o,i);i-=a.joints.itemSize}return 0}}}var f_=e=>typeof e.length=="number";function Ht(e,t){if(f_(t))for(let r=0,n=t.length;r<n;r++)e.push(t[r]);else for(let r of t)e.push(r);return e.length}function Get(e){for(let t=0;t<e.length;t++)e[t]=void 0}function XW(e,t,r,n){let o=e.splice(t),i=o.splice(0,r);return Ht(e,n),Ht(e,o),i}function It(e){let t=-1/0;if(f_(e))for(let r=0,n=e.length;r<n;r++)t=Math.max(t,e[r]);else for(let r of e)t=Math.max(t,r);return t}function iu(e){let t=1/0;if(f_(e))for(let r=0,n=e.length;r<n;r++)t=Math.min(t,e[r]);else for(let r of e)t=Math.min(t,r);return t}function QW(e,t){let r=new Map;e.traverse(c=>r.set(c,OSe(c))),e.traverse(c=>LSe(c,r));let n=[];for(let c of t)for(let u of c.tracks){let[d,...f]=u.name.split("."),h=d?e.getObjectByName(d):e;!h||!r.has(h)||(n.push({tr:u,node:h,field:f.join(".")}),RSe(r.get(h),f,u))}let o=new Map,i=c=>{let d=r.get(c).reach;for(let f of c.children){let h=r.get(f);d=Math.max(d,te(h.move[0],h.move[1],h.move[2])+It(h.grow)*i(f))}return o.set(c,d),d},s=It(r.get(e).grow)*i(e),a=new Map,l=new Map;for(let{tr:c,node:u,field:d}of n){l.set(c.name,u);let f=1;for(let x=u.parent;x&&x!==e.parent;x=x.parent)f*=It(r.get(x).grow);let h=o.get(u),m=d.split(".")[0],w=m==="position"?f:m==="quaternion"||m==="rotation"?f*It(r.get(u).grow)*h:m==="scale"?f*h:1/0;a.set(c.name,Math.max(a.get(c.name)??0,w))}return{levers:a,radius:s,owners:l}}function OSe(e){let{position:t,scale:r}=e,n=0,o=e;if(o.isMesh&&!o.skeleton){let i=e.localBounds();if(i&&i.min.x<=i.max.x)for(let s of[i.min.x,i.max.x])for(let a of[i.min.y,i.max.y])for(let l of[i.min.z,i.max.z])n=Math.max(n,te(s,a,l))}return{move:Float64Array.of(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z)),grow:Float64Array.of(Math.abs(r.x),Math.abs(r.y),Math.abs(r.z)),reach:n}}var _0=[0,0,0],v0=new Float64Array(3);function LSe(e,t){let r=e,n=r.skeleton,o=r.isMesh?r.geometry.attributes.position:void 0;if(!n||!o)return;let i=R0(r.geometry),s=n.inverses;for(let a=0;a<o.count;a++){Mr(o,a,_0);for(let l=0;l<i.width;l++){if(!(i.read(a,l,!0)>0))continue;let c=i.read(a,l,!1),u=t.get(n.bones[c]);u&&(Do(v0,s[c],_0[0],_0[1],_0[2]),u.reach=Math.max(u.reach,te(v0[0],v0[1],v0[2])))}}}function RSe(e,t,r){let n=t[0]==="position"?e.move:t[0]==="scale"?e.grow:null;if(!n||t.length>1&&!"xyz".includes(t[1]))return;let o=t.length>1?"xyz".indexOf(t[1]):0,{times:i,values:s}=r,a=r.interpolation==="cubic",l=Qa(r);for(let c=0;c<i.length;c++)for(let u=0;u<l&&o+u<3;u++){let d=a?c*l*3+l+u:c*l+u,f=a&&c>0?(i[c]-i[c-1])/3:0,h=a&&c+1<i.length?(i[c+1]-i[c])/3:0,m=Math.max(Math.abs(s[d]),Math.abs(s[d]-f*(a?s[d-l]:0)),Math.abs(s[d]+h*(a?s[d+l]:0)));n[o+u]=Math.max(n[o+u],m)}}var h_=-1;function ZW(e,t,r,n){let{values:o}=e,i=e.interpolation==="cubic"?n*3:n,s=e.interpolation==="cubic"?n:0;if(e.interpolation==="step"||r<=0){for(let l=0;l<n;l++)if(o[t*i+s+l]!==o[(t+1)*i+s+l])return h_;return 0}if(e.interpolation==="cubic"){let{bend:l,speed:c}=vSe(o,t,r,n);if(e.kind!=="quaternion")return c;for(let u=0;u<4;u++)[_s[u],Vi[u]]=[o[t*12+4+u],o[t*12+16+u]];return p_(_s,Vi,r,l,c)}if(e.kind==="quaternion")return _Se(o,t,r);let a=0;for(let l=0;l<n;l++){let c=(o[(t+1)*n+l]-o[t*n+l])/r;a+=c*c}return Math.sqrt(a)}function _Se(e,t,r){for(let d=0;d<4;d++)[_s[d],Vi[d]]=[e[t*4+d],e[t*4+4+d]];let n=vi(_s),o=vi(Vi);Ff(M0,0,_s,0,Vi,0);let i=M0[0],s=M0[1],a=M0[2],l=s/r;if(Math.abs(n-1)<1e-6&&Math.abs(o-1)<1e-6&&a>=1e-6)return l;for(let d=0;d<4;d++)Vi[d]*=i;let c=dL(Vi,_s);if(a<1e-6)return p_(_s,Vi,r,0,Math.sqrt(c)/r);let u=Math.max(n,o);return p_(_s,Vi,r,l*l*u/Math.cos(s/2),l*Math.sqrt(c)/a+l*s*u)}var _s=new Float64Array(4),Vi=new Float64Array(4),M0=new Float64Array(3);function vSe(e,t,r,n){let o=n*3,i=t*o+n,s=t*o+2*n,a=(t+1)*o,l=(t+1)*o+n,c=0,u=0,d=0,f=0,h=0;for(let m=0;m<n;m++){let w=e[l+m]-e[i+m];c+=((6*w-4*r*e[s+m]-2*r*e[a+m])/r**2)**2,u+=((-6*w+2*r*e[s+m]+4*r*e[a+m])/r**2)**2,d+=(3*w/r-e[s+m]-e[a+m])**2,f+=e[s+m]**2,h+=e[a+m]**2}return{bend:Math.sqrt(Math.max(c,u)),speed:Math.sqrt(Math.max(d,f,h))}}function p_(e,t,r,n,o){let i=dL(e,t),s=0;for(let u=0;u<4;u++)s-=e[u]*(t[u]-e[u]);let a=i>0?Ar(s/i):0,l=0;for(let u=0;u<4;u++)l+=Qe(e[u],t[u],a)**2;let c=Math.sqrt(l)-n*r*r/8;return c>0&&vi(e)>0&&vi(t)>0?o/c:1/0}var JW=new WeakMap;function t4(e){let t=JW.get(e);if(!t){let r=new Set([e.duration]);for(let n of e.tracks)for(let o of n.times)r.add(o);JW.set(e,t=Float64Array.from(r).sort())}return t}var e4=new WeakMap;function m_(e){let t=e4.get(e);return t||e4.set(e,t=e.tracks.map(MSe)),t}function MSe(e){let{times:t}=e,r=t.length,n=Qa(e),o=new Float64Array(Math.max(0,r-1)),i=[];for(let s=0;s+1<r;s++){let a=ZW(e,s,t[s+1]-t[s],n);a===h_?i.push(t[s+1]):o[s]=a}return{speeds:o,leapsAt:Float64Array.from(i)}}function ttt(e,t,r){let n=e,o=t;for(;n<o;){let i=n+Math.ceil((o-n)/2);r(i)?n=i:o=i-1}return n}function Mp(e,t){let r=0,n=e.length-1;for(;r<n;){let o=r+Math.ceil((n-r)/2);e[o]<=t?r=o:n=o-1}return r}function rtt(e,t,r){let n=new Int32Array(Math.ceil(t/2**r));for(let o=0,i=0;o<n.length;o++){let s=o*2**r;for(;i+1<e.length&&e[i+1]<=s;)i++;n[o]=i}return n}function ntt(e,t,r,n){let o=t[n>>r];for(;o+1<e.length&&e[o+1]<=n;)o++;return o}var D0=.5,DSe=Math.asin(D0)/D0;function o4(e,t,r){if(r.some(o=>o.additive))return null;let n=CSe(e,t,r);return r.map(({clip:o,weight:i})=>kSe(o,Math.max(0,i),n))}var r4=new WeakMap,n4=new WeakMap;function PSe(e,t){let r=r4.get(t);if(!r){let n=new Map,o=[];e.traverse(i=>{o.push(i===e?-1:n.get(i.parent)??-1),n.set(i,n.size)}),r4.set(t,r={nodes:n,parents:o,own:new Float64Array(o.length),chain:new Float64Array(o.length)})}return r}function CSe(e,t,r){let n=new Map;for(let{clip:o,weight:i}of r)for(let s of o.tracks){let a=Math.max(0,i),l=n.get(s.name)??{sum:0,squares:0,count:0};l.sum+=a,l.squares+=a*a,l.count++,n.set(s.name,l)}return{...PSe(e,t),reach:t,blends:n}}function ISe(e,t){let r=n4.get(t.reach);r||n4.set(t.reach,r=new WeakMap);let n=r.get(e);if(!n){let o=i4(e),i=m_(e),s=e.tracks.length;n={node:new Int32Array(s),lever:new Float64Array(s),speeds:new Float64Array(Math.max(0,o.length-1)*s)},e.tracks.forEach((a,l)=>{let c=t.reach.owners.get(a.name),u=t.reach.levers.get(a.name)??0;n.node[l]=c&&u>0?t.nodes.get(c):-1,n.lever[l]=u});for(let a=0;a+1<o.length;a++)for(let l=0;l<s;l++)n.speeds[a*s+l]=BSe(e.tracks[l],i[l],(o[a]+o[a+1])/2);r.set(e,n)}return n}function kSe(e,t,r){let n=i4(e),o=n.length,i=m_(e),s=ISe(e,r),a=e.tracks.map(c=>r.blends.get(c.name)),l={times:n,moved:new Float64Array(o),rate:new Float64Array(o),turned:new Float64Array(o),turn:new Float64Array(o),leaps:new Float64Array(o)};for(let c=0;c+1<o;c++){let u=FSe(e,s,c,a,t,r),d=n[c+1]-n[c],f=0;for(let h=0;h<r.parents.length;h++)r.chain[h]=(r.parents[h]<0?0:r.chain[r.parents[h]])+r.own[h],f=Math.max(f,r.chain[h]);l.rate[c]=f,l.turn[c]=u,l.moved[c+1]=l.moved[c]+(f>0?f*d:0),l.turned[c+1]=l.turned[c]+(u>0?u*d:0)}for(let c of i)for(let u of c.leapsAt)l.leaps[Mp(n,u)]++;for(let c=1;c<o;c++)l.leaps[c]+=l.leaps[c-1];return l}function FSe(e,t,r,n,o,i){i.own.fill(0);let s=0,a=e.tracks.length;for(let l=0;l<a;l++){let c=t.speeds[r*a+l],u=t.node[l];if(!(c>0)||u<0||!(o>0))continue;let d=e.tracks[l],f=t.lever[l],{sum:h,squares:m,count:w}=n[l],x;if(d.kind!=="quaternion")x=o/Math.max(1,h)*(NSe(d)?HF:1);else if(w===1&&h===1)x=2;else{let b=Math.sqrt(m+Math.max(0,1-h)**2);s=Math.max(s,o*c/b),x=2*DSe*o/b}i.own[u]+=f*x*c}return s}function i4(e){let t=t4(e);return t[0]>0?Float64Array.from([0,...t]):t}function NSe(e){return e.kind==="vector"&&e.name.split(".")[1]==="rotation"}function BSe(e,t,r){let{times:n}=e;return!(r>=n[0])||!(r<n[n.length-1])?0:t.speeds[Mp(n,r)]??0}var g_=.5,C0=new WeakMap;function S_(e,t){t?C0.set(e,t):C0.delete(e)}var c4=!1,Dp=0,s4=new WeakMap;function w_(e){c4=e,e&&(Dp=Dp+1&1073741823)}function USe(e){let t=fn(e);if(!c4)return C0.get(t)?.()??null;let r=s4.get(t);if(r?.walk===Dp)return r.view;let n=C0.get(t)?.()??null;return r?(r.walk=Dp,r.view=n):s4.set(t,{walk:Dp,view:n}),n}var a4=()=>({lap:[],moved:[],turned:[],leaps:[],hint:[]}),I0=new WeakMap,su=0,y_=1,k0=2,VSe=30;function u4(e,t,r){let n=I0.get(e);if(n&&n.wait>0)return n.wait--,k0;let o=e.root,i=USe(o);if(!i)return k0;if(!n||(n.steady=n.ready=!1,!HSe(n,t,o)))return su;n.tables===void 0&&(n.tables=jSe(n,o));let s=n.tables;if(!s||!(n.count>0))return su;n.placed||$Se(n,s),n.steady=!0,YSe(n,s,o,i,n.at,r,n.next);let a=Kr.pixels;if(n.ready=a!==g4,a<g_){n.steady=n.ready=!1;for(let c=0;c<n.count;c++){let u=n.played[c],d=u.action;u.time=ie[Rs]=d._time+r*d._timeScale,d._timeTo()}return n.held++,y_}let l=a/(n.held+1);return l>g_&&a<Number.MAX_VALUE&&(n.wait=Math.min(VSe,Math.floor(2*Math.log2(l/g_)))),su}function d4(e,t){let r=I0.get(e);r||I0.set(e,r=GSe());let n=r.steady;for(let a=0;n&&a<r.count;a++)n=r.played[a].action.playingNow;if(n){for(let l=0;l<r.count;l++)r.played[l].time=r.played[l].action._time;let a=r.at;r.at=r.next,r.next=a,r.placed=r.ready,r.steady=r.ready=!1,r.held=0;return}let o=0,i=!0;for(let a=0;a<t.length;a++){let l=t[a];if(!l.playingNow)continue;let c=o++,u=r.played[c];i&&=u?.action===l&&u.weight===l._weight&&u.mode===l.blendMode;let d=r.played[c]??={action:l,weight:0,scale:0,loop:l.loop,mode:l.blendMode,time:0};d.action=l,d.weight=l._weight,d.scale=l._timeScale,d.loop=l.loop,d.mode=l.blendMode,d.time=l._time}let s=e.root.parent;(s!==r.parent||!p4(r,e.root))&&(r.reach=null),(!i||o!==r.count||!r.reach)&&(r.tables=void 0),r.count=o,r.parent=s,r.edits=wa(),r.placed=r.steady=r.ready=!1,r.held=0}function f4(e){let t=I0.get(e);t&&(t.count=-1)}function GSe(){return{count:-1,played:[],parent:null,edits:-1,clips:[],reach:null,rig:null,tables:void 0,at:a4(),placed:!1,next:a4(),ready:!1,steady:!1,held:0,wait:0}}function HSe(e,t,r){let n=0;for(let o=0;o<t.length;o++){let i=t[o];if(!i.playingNow)continue;let s=e.played[n];if(n>=e.count||s.action!==i||i._weight!==s.weight||i._timeScale!==s.scale||i.loop!==s.loop||i.blendMode!==s.mode||i._time!==s.time)return!1;n++}return n===e.count&&r.parent===e.parent&&p4(e,r)}function WSe(e){let t={nodes:[],names:[],parents:[]};return e.traverse(r=>{t.nodes.push(r),t.names.push(r.name),t.parents.push(r.parent)}),t}function zSe(e,t){let r=0,n=!0;return e.traverse(o=>{n&&=r<t.nodes.length&&t.nodes[r]===o&&t.names[r]===o.name&&t.parents[r]===o.parent,r++}),n&&r===t.nodes.length}function p4(e,t){let r=wa();return r===e.edits?!0:!e.rig||!zSe(t,e.rig)?!1:(e.edits=r,!0)}function jSe(e,t){let r=e.played.slice(0,e.count).map(n=>n.action.clip);return(r.length!==e.clips.length||r.some((n,o)=>n!==e.clips[o]))&&(e.reach=null),e.clips=r,e.reach||(e.reach=QW(t,r),e.rig=WSe(t)),o4(t,e.reach,r.map((n,o)=>({clip:n,weight:e.played[o].weight,additive:e.played[o].mode==="additive"})))}function h4(e){let t=Gi.at;Gi.lap=Math.floor(t/(e.clip.duration||1)),ie[Ct]=t,x0(e.clip,e.loop),Gi.at=ie[Ct]}var Gi={lap:0,at:0};function m4(e,t,r){let n=Gi.at,{times:o}=e,i=o.length-1,s=t.hint[r]??0;s<=i&&o[s]<=n&&(s===i||n<o[s+1])||(s++,s<i&&o[s]<=n&&n<o[s+1]||(s=Mp(o,n)));let a=Math.min(n,o[i])-o[s];t.hint[r]=s,t.moved[r]=a>0?e.moved[s]+e.rate[s]*a:e.moved[s],t.turned[r]=a>0?e.turned[s]+e.turn[s]*a:e.turned[s],t.leaps[r]=e.leaps[s]}function $Se(e,t){for(let r=0;r<e.count;r++)Gi.at=e.played[r].time,h4(e.played[r].action),e.at.lap[r]=Gi.lap,m4(t[r],e.at,r);e.placed=!0}var g4=1/0,Kr={moved:0,turned:0,leaped:!1,pixels:0};function YSe(e,t,r,n,o,i,s){Kr.moved=Kr.turned=0,Kr.leaped=!1;for(let a=0;a<e.count;a++){let l=e.played[a].action;if(Gi.at=l._time+i*l._timeScale,h4(l),Gi.lap!==o.lap[a]){Kr.pixels=g4;return}s.lap[a]=Gi.lap,s.hint[a]=o.hint[a],m4(t[a],s,a),Kr.leaped||=s.leaps[a]!==o.leaps[a],Kr.moved+=Math.abs(s.moved[a]-o.moved[a]),Kr.turned+=Math.abs(s.turned[a]-o.turned[a])}KSe(e,r,n)}function KSe(e,t,r){Kr.leaped||!(Kr.turned<=D0)?Kr.pixels=Number.MAX_VALUE:XSe(e,t,r)}var P0=[0,1,2,4,5,6,8,9,10],l4=new WeakMap;function qSe(e){let t=e.matrixWorld.elements,r=l4.get(e);if(r){let n=!0;for(let o=0;n&&o<P0.length;o++)n=Object.is(r.linear[o],t[P0[o]]);if(n)return r}else l4.set(e,r={linear:new Float64Array(9),stretch:0});for(let n=0;n<P0.length;n++)r.linear[n]=t[P0[n]];return r.stretch=Fa(t),r}function XSe(e,t,r){let n=Kr.moved;if(!(n>0)){Kr.pixels=n===0?0:Number.MAX_VALUE;return}let o=t.matrixWorld.elements,i=o[12]-r.eye[0],s=o[13]-r.eye[1],a=o[14]-r.eye[2],l=yg(r.forward,i,s,a),c=Math.sqrt(Math.max(0,XF(i,s,a,i,s,a)-l*l)),u=Gg(n,t.parent?qSe(t.parent).stretch:1,c,l,e.reach.radius,r.focal,r.near,r.perspective);Kr.pixels=u<1/0?u:Number.MAX_VALUE}var F0=$a(e=>e.clock),x_=[];function QSe(e,t,r,n){let o=e[r],i=t[r];if(!n)e[r]=Math.min(i,Math.max(0,o));else if(i===0)e[r]=0;else{let s=o%i;e[r]=s<0?s+i:s}}function ZSe(e){let t=e.items.length,r=Float64Array.from(e.items,a=>{let{frames:l,rate:c}=e.bakes[a.bake];return(l-1)/c}),n=Float64Array.from(e.items,a=>a.position),o=n.slice(),i={time:n.slice(),previous:n.slice(),timeScale:1,own(a){s.owners.push(new WeakRef(a)),F0.add(s)}},s={clock:i,owners:[],step(a){let l=!1;for(let c=0;c<t;c++){let{playRate:u,looping:d}=e.items[c];i.previous[c]=i.time[c],i.time[c]=o[c],o[c]+=u*a*i.timeScale,QSe(o,r,c,d),l||=o[c]!==i.time[c]||i.previous[c]!==i.time[c]}return l}};return i}function N0(e,t){if(F0.size===0)return!1;let r=!1,n=F0.copyInto(x_,0);for(let o=0;o<n;o++){let i=x_[o],s=i.owners,a=!1,l=0;for(let c=0;c<s.length;c++){let u=s[c],d=u.deref();!d||d._alive===!1||(s[l++]=u,a||=Dn(d,e))}l!==s.length&&(s.length=l),l?a&&(r=i.step(t)||r):F0.delete(i)}return x_.fill(void 0,0,n),r}function S4(e,t){let r={widths:new Uint8Array(t),values:[],blends:[]};for(let n=0;n<t;n++){let{binding:o,blend:i,pose:s}=e[n];r.widths[n]=o.value.length,r.values.push(s?o.owner[o.field]:void 0),r.blends.push(i)}return r}var el=new WeakMap;function JSe(e){let t=el.get(e);return t||el.set(e,t={slots:[]}),t}function ewe(e,t,r,n){let o=e.clip.tracks[r],i=t.slots,s=i[r];if(s?.track===o)return s;let a=e.bindingOf(o,r);if(!a)return;let l=n.of(a,o.kind==="quaternion");return i[r]=s={track:o,binding:a,node:e._nodeOf(o),blend:l,pose:a.value.length===l.size&&l.pose},t.alone=void 0,t.writes=void 0,e._mask=void 0,s}function w4(e,t){if(!twe(e,t))return!1;let{slots:r}=e;if(e.alone===void 0){let n=new Set;for(let o=0;o<t.length;o++)n.add(r[o].blend);e.alone=n.size===t.length}return e.alone}function twe(e,t){for(let r=0;r<t.length;r++)if(e.slots[r]?.track!==t[r])return!1;return!0}function B0(e){ie[Ct]=e._time,x0(e.clip,e.loop)}var rwe=(e,t,r,n)=>e!==null&&(t===e.position||t===e.quaternion)?n.reference:_p(r,n);function b_(e,t,r){let n=ie[Sr];B0(e);let o=ie[Ct],i=e.blendMode==="additive",s=e.clip.tracks,a=JSe(e);for(let l=0;l<s.length;l++){let c=ewe(e,a,l,t);if(!c)continue;let{binding:u,blend:d}=c;ie[Ct]=o;let f=rwe(r,l,s[l],u);ie[Sr]=n,i?t.addDifference(d,HW(s[l],f,u.reference)):t.add(d,f)}}function U0(e,t=e.mixer.rootBone,r=e.rootMotion&&e.blendMode!=="additive"){if(!r||t===null)return null;let n=e._root;if(n?.bone!==t){let o=i=>e.clip.tracks.findIndex(s=>s.name===`${t}.${i}`);e._root=n={bone:t,position:o("position"),quaternion:o("quaternion"),stretch:void 0}}return n.position<0&&n.quaternion<0?null:n}var A_=e=>e.onEvent||e.onEventEnd||e.onLoop||e.rootMotion||e._opened;function T4(e,t){ie[t]=e._weight*e._fade}function nwe(e){let t=ie[o_],r=ie[Lp];return e.loop==="once"&&r>t&&r>=e.clip.duration}function owe(e){e.playingNow=!1,e._endFade()}function V0(e,t){let r=e._time,n=r+t*e._timeScale;ie[Rs]=n,e._timeTo(),ie[o_]=r,ie[Lp]=n;let o=nwe(e);return o&&owe(e),o}var je={calls:[],count:0,held:0},A4=0,G0=1,H0=2;function iwe(e,t,r=null){let{calls:n}=je;n[je.count++]=e,n[je.count++]=t,n[je.count++]=r}function Mtt(e,t){let{calls:r}=je;r[je.count++]=e,r[je.count++]=H0,r[je.count++]=t}var swe=1e-6;function awe(e){if(!(e._blendOut>=0)||e._fadeRate<0||e.loop!=="once")return;let t=(e.clip.duration-e._time)/e._timeScale;e._timeScale>0&&t<=Math.max(e._blendOut,swe)&&(ie[ou]=Math.max(t,0),e._fadeOut())}function lwe(e,t){let r=e._fadeRate,n=e._fade+r*t,o=r>0?1:r<0?0:e._fade;return(r>0?n<o:n>o)?(e._fade=n,!1):(e._fade=o,e._fadeRate=0,e._fade!==0?!1:(e.stop(),!0))}function O4(e,t,r,n){let o=!1,i=!1;for(let s=0;s<t.length;s++){let a=t[s];a.playingNow&&(awe(a),a._fadeRate!==0&&lwe(a,r)&&a.onFinished&&(n?W0(n,a,0,0,0,a._layer,T_,0):iwe(a,G0)),o||=a._fadeRate!==0,i||=a._fade!==1)}return(o||i)&&(e._pending=!0),o}var Wt=7,vs=0,Cn=1,E_=2,y4=3,tl=4,x4=5,b4=6,Pp=1,O_=2,cwe=3,T_=4,Dtt=1,Ptt=2,uwe=4,dwe=8,fwe=16,pwe=32,hwe=["once","repeat","pingpong"],mwe=e=>hwe.indexOf(e.loop)|(e.onEvent?uwe:0)|(e.onLoop?dwe:0)|(e.onEventEnd?pwe:0),gwe=(e,t,r,n)=>t+n===0?r:(e*t+r*n)/(t+n),Swe=256,wwe=4096,L_=e=>e._log,L4=e=>L_(e)??(e._log={actions:[],numbers:[],groups:0,seeks:!1,bones:[],last:-1,tells:!1}),ywe=({numbers:e},t,r)=>e[t*Wt+r];function W0(e,t,r,n,o,i,s,a){e.actions.push(t),e.numbers.push(r,n,o,i,s,a,1),e.tells||=r!==n||s!==O_}function R4(e,{rootBone:t,applyRootMotion:r}){let n=e.actions.length,o=e.bones;return o.at(-1)!==t&&o.push(t),W0(e,null,o.length-1,+r,0,0,0,0),e.tells=!1,n}function _4(e,t,r){let n=t._time,o=V0(t,r)&&t.onFinished;(A_(t)||o)&&W0(e,t,n,t._time,t._weight*t._fade,t._layer,o?cwe:O_,mwe(t)|(U0(t)?fwe:0))}var v4=(e,t)=>W0(e,t,0,t._time,0,t._layer,Pp,0);function M4(e,t,r){let n=e.numbers,o=t*Wt,i=e.last*Wt;if(e.actions.length>t+1&&(r?!xwe(e,t):e.tells)){e.seeks||=r,r&&(n[o+tl]=Pp),e.groups<Swe||n[i+vs]!==n[o+vs]||n[i+Cn]!==n[o+Cn]?(e.groups++,e.last=t):bwe(e,t);return}e.actions.length=t,n.length=o}function xwe(e,t){let{actions:r,numbers:n}=e,o=e.last,i=r.length-t;if(t-o!==i)return!1;for(let s=1;s<i;s++)if(r[o+s]!==r[t+s]||ywe(e,o+s,tl)!==Pp)return!1;for(let s=1;s<i;s++)n[(o+s)*Wt+Cn]=n[(t+s)*Wt+Cn];return!0}var E4=new Float64Array(Wt);function bwe(e,t){let{actions:r,numbers:n}=e,o=e.last;n[o*Wt+tl]||=n[t*Wt+tl];for(let i=t+1;i<r.length;i++){let s=Ewe(e,o,t,i),a=r[i];if(!(s<0)){for(let l=0;l<Wt;l++)E4[l]=n[i*Wt+l];r.copyWithin(s+1,s,i),n.copyWithin((s+1)*Wt,s*Wt,i*Wt),r[s]=a;for(let l=0;l<Wt;l++)n[s*Wt+l]=E4[l];t++}}r.length=t,n.length=t*Wt}function Ewe(e,t,r,n){let o=e.actions,i=-1;for(let s=r-1;s>t;s--){if(o[s]!==o[n]){if(i>=0)break;continue}if(Twe(e,s,n))return-1;i<0&&(i=s+1)}return i<0?r:i}function Twe(e,t,r){let n=e.numbers,o=t*Wt,i=r*Wt,s=n[o+tl],a=n[i+tl];if(s===Pp||a===Pp)return s===a&&(n[o+Cn]=n[i+Cn]),s===a;let l=n[o+Cn]-n[o+vs],c=n[i+Cn]-n[i+vs],u=e.actions.length>=wwe;if(n[o+x4]!==n[i+x4]||n[o+y4]!==n[i+y4]||l*c<0)return!1;if(s===T_||a===T_)return u&&s===a;if(!u&&(s!==O_||n[o+Cn]!==n[i+vs]))return!1;let d=l+c>=0;return n[o+E_]=gwe(n[o+E_],Math.abs(l),n[i+E_],Math.abs(c)),n[o+vs]=(d?Math.min:Math.max)(n[o+vs],n[i+vs]),n[o+Cn]=(d?Math.max:Math.min)(n[o+Cn],n[i+Cn]),n[o+tl]=Math.max(s,a),n[o+b4]+=n[i+b4],!0}var R_=!1;function rl(e){let t=R_;return R_=e,t}function __(e){R_||Owe(e)}var D4=3*4096,Awe=.999;function z0(e){je.calls.fill(null,e,je.count),je.held=Math.max(je.held,je.count),je.count=e}function j0(){let{calls:e}=je;je.count===0&&e.length>D4&&e.length>4*je.held&&(e.length=Math.max(D4,2*Math.ceil(je.held))),je.held*=Awe}function Owe(e){let t=rl(!0),{calls:r}=je;try{for(let n=e,o=je.count;n<o;n=o,o=je.count)for(let i=0;i<3;i++)for(let s=n;s<o;s+=3){let a=r[s+1];if((a===G0?2:a===H0?1:0)!==i)continue;if(a===H0){r[s]._entered(r[s+2]);continue}let l=r[s];a===G0?l.onFinished?.(l):a===A4?l.onLoop?.(l):typeof a=="string"?l.onEvent?.(a,l):(r[s+2]??l.onEventEnd)?.(a.name,l)}}finally{z0(e),rl(t)}}var zt=new Float64Array(4),$0=new Float64Array(3),P4=new Float64Array(3),au=new Float64Array(4),Y0=new Float64Array(9),Et=class e extends Wc{isQuaternion=!0;constructor(t=0,r=0,n=0,o=1){super(new Float64Array([t,r,n,o]))}get w(){return this.elements[3]}set w(t){this.elements[3]=t,this._changed()}set(t,r,n,o,i=!1){let s=this.elements;return s[0]===t&&s[1]===r&&s[2]===n&&s[3]===o?this:(this.elements[0]=t,this.elements[1]=r,this.elements[2]=n,this.elements[3]=o,i?this:this._changed())}written(t,r=!1){return this.set(t[0],t[1],t[2],t[3],r)}copy(t){return this.set(t.x,t.y,t.z,t.w)}clone(){return new e(this.x,this.y,this.z,this.w)}identity(){return this.set(0,0,0,1)}setFromAxisAngle(t,r){return Ne(De($0,t)),this.written(ao(zt,$0,r))}setFromEuler(t,r=!1){return this.written(iw(zt,t.x,t.y,t.z,t.order),r)}setFromRotationMatrix(t){let r=t.elements;for(let n=0;n<3;n++)Y0[n*3]=r[n],Y0[n*3+1]=r[n+4],Y0[n*3+2]=r[n+8];return rf(zt,Y0),this.written(zt)}setFromUnitVectors(t,r){let n=Ge(De($0,t),De(P4,r))+1;return n<1e-8?(xs(zt,t.x,t.y,t.z)[3]=0,this.written(zt).normalize()):(Ze(zt,$0,P4),zt[3]=n,this.written(zt).normalize())}multiply(t){return this.written(nt(zt,this.elements,bt(au,t)))}premultiply(t){return this.written(nt(zt,bt(au,t),this.elements))}multiplyQuaternions(t,r){return this.written(nt(zt,bt(zt,t),bt(au,r)))}invert(){return this.written(zr(zt,this.elements))}conjugate(){return this.invert()}dot(t){return ka(this.elements,bt(au,t))}length(){return vi(this.elements)}normalize(){return zt.set(this.elements),this.written(jr(zt))}angleTo(t){return CV(this.elements,bt(au,t))}slerp(t,r){let n=NV(zt,this.elements,0,bt(au,t),0,r);return this.written(zt),n?this.normalize():this}equals(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w}fromArray(t,r=0){return this.set(t[r],t[r+1],t[r+2],t[r+3])}toArray(){return[this.x,this.y,this.z,this.w]}};var ol=$a(e=>e.root);function M_(e){e._playing||(e._playing=!0,ol.add(e))}function K0(e){e._playing&&(e._playing=!1,ol.delete(e))}var v_=[],Ms=0,q0,C4,Dr={write:null,fetch:null,asked:!1,held:null,leave:null};function I4(){Dr.asked=!0,Dr.fetch?.()}function nl(e){Dr.write||Dr.asked||Dr.held?.(e)||I4()}var k4=e=>e._layer!==0||!!e.bones||!!e.trackWeights,F4=e=>k4(e)||A_(e)||e.onFinished||e._blendOut>=0;function D_(e,t=NaN,r=!1){e._opened&&(ie[Lp]=t,Dr.leave(e,r))}function N4(e,t){let[r,...n]=t.split("."),o=r?e.getObjectByName(r):e;if(!o)return;let i=o;for(let s of n.slice(0,-1))i=i?.[s];return i?{owner:i,field:n[n.length-1],target:o}:null}var Cp=class{loop="repeat";playingNow=!1;startTime=0;onEvent=null;onEventEnd=null;onLoop=null;onFinished=null;mixer;clip;_fade=1;_fadeRate=0;_blendOut=-1;_mask=void 0;_root=void 0;_open=void 0;_opened=0;_marks=void 0;_layer=0;_weight=1;_timeScale=1;_time=0;#e="normal";#t=null;#n=null;#r=!1;bindings=new Map;targets=[];#o;constructor(t,r){this.mixer=t,this.clip=r}get layer(){return this._layer}set layer(t){if(!(t>=0))throw new RangeError(`A layer is a number from 0 up: ${t}.`);t!==this._layer&&(this._layer=t,t&&nl(this.mixer),this.mixer._wake())}get blendMode(){return this.#e}set blendMode(t){t!==this.#e&&(this.#e=t,this.mixer._wake())}get bones(){return this.#t}set bones(t){t!==this.#t&&(this.#t=t,t&&nl(this.mixer),this.mixer._wake())}get trackWeights(){return this.#n}set trackWeights(t){t!==this.#n&&(this.#n=t,t&&nl(this.mixer),this.mixer._wake())}get rootMotion(){return this.#r}set rootMotion(t){t!==this.#r&&(this.#r=t,t&&nl(this.mixer),this.mixer._wake())}get weight(){return this._weight}set weight(t){ie[Sr]=t,this._weightTo()}_weightTo(){let t=ie[Sr];t!==this._weight&&(this._weight=t,this.mixer._wake())}get timeScale(){return this._timeScale}set timeScale(t){t!==this._timeScale&&(this._timeScale=t,this.mixer._wake())}get time(){return this._time}set time(t){ie[Rs]=t,this._timeTo()}_timeTo(){let t=ie[Rs];t!==this._time&&(this._time=t,this.mixer._wake())}fadeIn(t){return this.playingNow||(this._fade=0,this.play()),ie[ou]=t,this.#i(1)}fadeOut(t){return ie[ou]=t,this._fadeOut()}_fadeOut(){return this.playingNow?this.#i(0):this}crossFadeTo(t,r){return this.fadeOut(r),t.fadeIn(r),this}#i(t){let r=ie[ou];return this._fadeRate=(t-this._fade)/(r>0?r:0),this.mixer._wake(),nl(this.mixer),this.mixer._pending=!0,this}unbindStale(){let{targets:t}=this,r=this.mixer.root;for(let n=t.length-1;n>=0;n--){let{track:o,node:i,at:s}=t[n];if(i._alive&&(i===r||i.parent))continue;t[n]=t[t.length-1],t.length--,this.bindings.delete(o);let a=el.get(this);a&&(a.slots[s]?.track===o&&(a.slots[s]=void 0),a.alone=a.writes=void 0)}}_nodeOf(t){for(let r of this.targets)if(r.track===t)return r.node}bindingOf(t,r){let n=this.bindings.get(t);if(n)return n;let o=wa();if(this.#o?.get(t)===o)return null;let i=N4(this.mixer.root,t.name);if(i===void 0&&(this.#o??=new Map).set(t,o),!i)return null;this.#o?.delete(t);let{target:s,...a}=i,l=Qa(t),c=t.interpolation==="cubic";l===1&&FW(a.owner,a.field,t.values,c?1:0,c?3:1);let u=new Float64Array(l);return this.bindings.set(t,n={...a,key:0,value:u}),this.targets.push({track:t,node:s,at:r??this.clip.tracks.indexOf(t)}),n.reference=Float64Array.from(a_(t,t.times[0]??0,n)),n}play(){return this.playingNow?this:(this.playingNow=!0,M_(this.mixer),this.mixer.root._link?.pose(this.mixer.root),F4(this)&&nl(this.mixer),this)}stop(){return this.playingNow=!1,this._time=0,this._endFade(),D_(this),this}_endFade(){this._fade=1,this._fadeRate=0,this._blendOut=-1}seek(t){let r=this.playingNow;return this.time=t,this.playingNow=!0,q0(this.mixer,0,!0),this.playingNow=r&&this.playingNow,D_(this,t,this._timeScale<0),this}clipTime(){return B0(this),ie[Ct]}},lu=class{#e=[];#t=new Map;#n=new Map;#r=new y0;#o=!0;_rich=void 0;_log=void 0;_playing=!1;_pending=!1;root;#i=null;get rootBone(){return this.#i}set rootBone(t){t!==this.#i&&(this.#i=t,this._wake())}rootMotion={position:new I,quaternion:new Et};applyRootMotion=!1;_drivers=[];constructor(t){this.root=t}clipAction(t,r){let n=this.#t.get(t);n||this.#t.set(t,n=new Map);let o=n.get(r?.instance);return o||(n.set(r?.instance,o=new Cp(this,t)),this.#e.push(o)),o}play(t){return this.clipAction(t).play()}playMontage(t,r={}){let n=this.clipAction(t,r),o=r.layer??1,i=r.blendIn??.25,s=r.blendOut??.25;for(let a of this.#e)a.playingNow&&!(a._fadeRate<0)&&(a===n||a._blendOut>=0&&a._layer===o)&&a.fadeOut(i);return n.playingNow&&this.#s(n),n.stop(),n.layer=o,n.bones=r.bones??null,n.loop="once",n.timeScale=r.timeScale??1,n._blendOut=s>0?s:0,i>0?n.fadeIn(i):n.play()}#s(t){let r=this.#n.get(t);r||this.#n.set(t,r=[]);let n=r.find(o=>!o.playingNow);n||(r.push(n=new Cp(this,t.clip)),this.#e.push(n)),n.layer=t.layer,n.bones=t.bones,n.trackWeights=t.trackWeights,n.blendMode=t.blendMode,n.rootMotion=t.rootMotion,n.loop=t.loop,n.timeScale=t.timeScale,n.weight=t.weight,n.time=t.time,n._fade=t._fade,n._fadeRate=t._fadeRate,n._blendOut=t._blendOut,n.play()}_forget(t){t.stop();let r=this.#e.indexOf(t);r>=0&&this.#e.splice(r,1);let n=this.#t.get(t.clip);if(n)for(let[o,i]of n)i===t&&n.delete(o);n?.size===0&&this.#t.delete(t.clip),el.delete(t)}stopAll(){let t=this.#e,r=je.count,n=rl(!0);try{for(let o=0;o<t.length;o++)t[o].stop()}catch(o){throw z0(r),o}finally{rl(n)}this._drivers.length===0&&!this._pending&&(K0(this),this.#o=!0),__(r)}update(t){let r=q0(this,t,!1);return Ms===0&&j0(),r}evaluate(t){let r=this.#e,n=je.count,o=rl(!0);try{for(let i=0;i<r.length;i++){let s=r[i];!s.playingNow||s._timeScale===0||(D_(s),ie[Rs]=(t-s.startTime)*s._timeScale,s._timeTo())}q0(this,0,!0)}catch(i){throw z0(n),i}finally{rl(o)}return __(n),this}_wake(){this.#o&&(this.#o=!1,M_(this),this.root._link?.pose(this.root))}static{q0=(t,r,n)=>t.#h(r,n),C4=t=>t.#c()}#h(t,r){this.#o=!1;let n;if(this.#c())f4(this),n=this.#a(t,r);else{let o=r?su:u4(this,this.#e,t);o!==y_&&(this.#l(t),o!==k0&&d4(this,this.#e)),n=this.#d()}return this.#o=!n,n}#c(){if(this._drivers.length>0||this._rich?.moved||this._pending)return!0;let t=this.#e;for(let r=0;r<t.length;r++){let n=t[r];if(n._opened||n.playingNow&&F4(n))return!0}return!1}#a(t,r){let n=Dr.write;if(n)return n(this,this.#e,this.#r,t,r);nl(this),M_(this),this.root._link?.pose(this.root);let o=this.#e,i=this.#u(),s=r&&i&&!L_(this)?.seeks?null:L4(this),a=s?R4(s,this):-1;r||(this._pending=!1,O4(this,o,t,s));for(let l=0;l<o.length;l++){let c=o[l];c.playingNow&&(s&&r?v4(s,c):s&&_4(s,c,t),i&&(c.unbindStale(),T4(c,Sr),b_(c,this.#r,U0(c))))}return s&&M4(s,a,r),s&&s.actions.length>0&&(this._pending=!0),i&&this.#r.write(),!0}#u(){let t=this.#e;for(let r=0;r<t.length;r++)if(t[r].playingNow&&k4(t[r]))return!1;return!0}#d(){let t=this.#e;for(let r=0;r<t.length;r++)if(t[r].playingNow&&t[r]._timeScale!==0)return!0;return!1}#l(t){let r=this.#e,n=!1,o,i=0;for(let a=0;a<r.length;a++)r[a].playingNow&&(r[a].unbindStale(),i++===0&&(o=r[a]));if(i===1&&o._weight===1&&o.blendMode==="normal"&&this.#f(o))return this.#p(o,t);let s=this.#r;for(let a=0;a<r.length;a++){let l=r[a];l.playingNow&&(V0(l,t),n||=l.playingNow,ie[Sr]=l._weight,b_(l,s,null))}s.write(),n||K0(this)}#f(t){let r=el.get(t);return r!==void 0&&w4(r,t.clip.tracks)}#p(t,r){V0(t,r),B0(t);let n=t.playingNow,o=ie[Ct],i=t.clip.tracks,s=el.get(t),a=s.slots,{widths:l,values:c,blends:u}=s.writes??=S4(a,i.length);for(let d=0;d<i.length;d++){ie[Ct]=o;let f=_p(i[d],a[d].binding),h=c[d];if(!h){u[d].writeAlone(f,0);continue}for(let m=0;m<l[d];m++)f[m]+=0;l[d]===4?h.set(f[0],f[1],f[2],f[3]):h.set(f[0],f[1],f[2])}n||K0(this)}};function Lwe(e,t=null){for(let r of ol.on(e)??[])if(r!==t)return r;return null}function B4(e){Dr.write||Dr.asked||ol.some(t=>Dn(t.root,e)&&C4(t))&&I4()}var U4=e=>ol.some(t=>Dn(t.root,e));function P_(e,t){let r=N0(e,t);if(ol.size===0)return Ms===0&&j0(),r;let n=Ms,o=n===0;o&&w_(!0);try{Ms=ol.copyInto(v_,Ms);let i=Ms;for(let s=n;s<i;s++){let a=v_[s];a.root._alive===!1?(a.stopAll(),K0(a)):Dn(a.root,e)&&(r=a.update(t)||r)}}finally{v_.fill(void 0,n,Ms),Ms=n,o&&(w_(!1),j0())}return r}var X0=12,Rwe=new Float64Array(16),kt=new Float64Array(16),Ds=class{isSkeleton=!0;bones;boneInverses;inverses;ranks;constructor(t,r,n){this.bones=t,this.ranks=n?Array.from(n):null,this.boneInverses=new Float64Array(t.length*16),r?this.boneInverses.set(Array.from(r).slice(0,t.length*16)):t.forEach((o,i)=>{o.updateMatrixWorld(!0),mr(kt,o.matrixWorld.elements),this.boneInverses.set(kt,i*16)}),this.inverses=t.map((o,i)=>this.boneInverses.subarray(i*16,i*16+16))}palette(t,r,n=0){let o=mr(Rwe,t),i=o[0],s=o[1],a=o[2],l=o[4],c=o[5],u=o[6],d=o[8],f=o[9],h=o[10],m=o[12],w=o[13],x=o[14];for(let b=0;b<this.bones.length;b++){Ve(kt,this.bones[b].matrixWorld.elements,this.inverses[b]);let T=kt[0],L=kt[1],_=kt[2],D=kt[3],C=kt[4],j=kt[5],$=kt[6],q=kt[7],le=kt[8],ge=kt[9],Ue=kt[10],ye=kt[11],Fe=kt[12],Ye=kt[13],Ke=kt[14],ut=kt[15],Ae=n+b*X0;r[Ae]=Ut(i,l,d,T,L,_)+m*D,r[Ae+4]=Ut(s,c,f,T,L,_)+w*D,r[Ae+8]=Ut(a,u,h,T,L,_)+x*D,r[Ae+1]=Ut(i,l,d,C,j,$)+m*q,r[Ae+5]=Ut(s,c,f,C,j,$)+w*q,r[Ae+9]=Ut(a,u,h,C,j,$)+x*q,r[Ae+2]=Ut(i,l,d,le,ge,Ue)+m*ye,r[Ae+6]=Ut(s,c,f,le,ge,Ue)+w*ye,r[Ae+10]=Ut(a,u,h,le,ge,Ue)+x*ye,r[Ae+3]=Ut(i,l,d,Fe,Ye,Ke)+m*ut,r[Ae+7]=Ut(s,c,f,Fe,Ye,Ke)+w*ut,r[Ae+11]=Ut(a,u,h,Fe,Ye,Ke)+x*ut}return r}};function _we(e,t,r,n){let o=0;for(let i=0;i<r&&i*4+3<n.length;i++){let s=t+i*X0,a=i*4,l=n[a],c=n[a+1],u=n[a+2],d=te(Nr(e[s],e[s+1],e[s+2],e[s+3],l,c,u)-l,Nr(e[s+4],e[s+5],e[s+6],e[s+7],l,c,u)-c,Nr(e[s+8],e[s+9],e[s+10],e[s+11],l,c,u)-u),f=HV(e,s);o=Math.max(o,d+Math.sqrt(f)*n[a+3])}return o}function vwe(e,t,r){let n=1;for(let o=0;o<r;o++)n=Math.max(n,Fa(e,t+o*X0));return n}var In={a:new Float64Array(3),b:new Float64Array(3),c:new Float64Array(3),t:new Float64Array(3),ab:new Float64Array(3),cb:new Float64Array(3),ac:new Float64Array(3),at:new Float64Array(3),ba:new Float64Array(3),toPole:new Float64Array(3),across:new Float64Array(3),plane:new Float64Array(3),axis:new Float64Array(3),q:new Float64Array(4),turn:new Float64Array(4),global:new Float64Array(4),inverse:new Float64Array(4),local:new Float64Array(4),point:new I,world:new Et,keptRoot:new Et,keptMid:new Et},Rt=e=>Fr(e[0],e[1],e[2]),C_=e=>Math.acos(k(e,-1,1)),I_=(e,t)=>C_(Ge(e,t)/(Rt(e)*Rt(t)||1));function V4(e,t){let r=Rt(t);return xs(e,t[0]/r,t[1]/r,t[2]/r)}function cu(e,t){return De(t,e.getWorldPosition(In.point))}function Q0(e,t,r){let{q:n,turn:o,global:i,inverse:s,local:a}=In,l=Rt(t);if(!(l>0)||!r)return;let c=In.axis;c[0]=t[0]/l,c[1]=t[1]/l,c[2]=t[2]/l,ao(o,c,r),bt(i,e.getWorldQuaternion(In.world)),zr(s,i),nt(n,s,o),nt(n,n,i),bt(a,e.quaternion),nt(n,a,n),jr(n),e.quaternion.set(n[0],n[1],n[2],n[3])}function G4(e,t,r,n){let o=In.across,i=Math.atan2(Ge(t,Ze(o,r,n))/Rt(t),Ge(r,n));Q0(e,t,i)}function Mwe(e,t,r,n){let{a:o,b:i,c:s,at:a,ab:l,ac:c,plane:u}=In;cu(r,s),Br(c,s,o),Ze(u,c,a),!(Rt(u)>1e-9*Rt(c)*Rt(a))&&Ge(c,a)<0&&(Ze(u,c,Br(l,cu(t,i),o)),Rt(u)>n||V4(u,c)),Q0(e,u,I_(c,a))}function Dwe(e,t){let{a:r,b:n,ab:o,ba:i,at:s,plane:a,toPole:l}=In;cu(t,n),Ze(i,s,Br(o,n,r)),Ze(a,s,l),Rt(i)&&Rt(a)&&G4(e,s,i,a)}function H4(e,t,r,n,o,i=1){let{a:s,b:a,c:l,t:c,ab:u,cb:d,ac:f,at:h,ba:m,toPole:w,plane:x}=In;e.updateMatrixWorld(!0);let b=!(i>=1);b&&(In.keptRoot.copy(e.quaternion),In.keptMid.copy(t.quaternion)),cu(e,s),cu(t,a),cu(r,l),De(c,n),Br(u,a,s),Br(d,l,a),Br(f,l,s),Br(h,c,s);let T=Rt(u),L=Rt(d),_=k(Rt(h),1e-6,(T+L)*(1-1e-6)),D=I_(f,u),C=I_(Br(m,s,a),d),j=C_((L*L-T*T-_*_)/(-2*T*_)),$=C_((_*_-T*T-L*L)/(-2*T*L));o&&(w[0]=o.x-s[0],w[1]=o.y-s[1],w[2]=o.z-s[2]);let q=Rt(f)?f:u,le=1e-9*T*L;Ze(x,q,o?w:u),Rt(x)>le||Ze(x,q,h),Rt(x)>le||V4(x,q),o&&Rt(f)&&Rt(Ze(m,f,u))>le&&G4(e,f,m,x),Q0(e,x,j-D),Q0(t,x,$-C),Mwe(e,t,r,le),o&&Rt(h)&&Dwe(e,t),b&&(e.quaternion.slerp(In.keptRoot,1-Math.max(0,i)),t.quaternion.slerp(In.keptMid,1-Math.max(0,i))),e.updateMatrixWorld(!0)}var W4=24;function z4(e,t={}){let[r,n]=t.direction??[1,0],o=[n,0,-r],i=t.angle??.1,s=1/(t.frequency??.5),a=Array.from({length:W4+1},(f,h)=>h/W4*s);Ne(o);let l=new Float64Array(4),c=new Float64Array(4),u=new Float64Array(4),d=e.map((f,h)=>{let m=(h+1)/e.length,w=[f.quaternion.x,f.quaternion.y,f.quaternion.z,f.quaternion.w],x=f.parent?.getWorldQuaternion(),b=new Float64Array(3);x?zr(u,x.toArray()):u.set([0,0,0,1]),yt(b,u,o[0],o[1],o[2]);let T=a.flatMap(L=>{let _=Q*L/s-m*me;return ao(l,b,i*m*(.6+.4*Math.sin(_))),Array.from(nt(c,l,w))});return{name:`${f.name}.quaternion`,kind:"quaternion",times:new Float32Array(a),values:new Float32Array(T)}});return{name:"wind",duration:s,tracks:d}}var uu=e=>(t,r,n)=>({name:t,kind:e,times:new Float32Array(r),values:new Float32Array(n)}),k_={createMixer:e=>new lu(e),clip:(e,t,r,n)=>({name:e,duration:t,tracks:r,...n}),track:uu("number"),numberTrack:uu("number"),vectorTrack:uu("vector"),quaternionTrack:uu("quaternion"),colorTrack:uu("color"),weightsTrack:uu("weights"),skeleton:(e,t,r)=>new Ds(e,t,r),twoBoneIK:H4,windClip:z4};Dr.fetch=()=>void M.animationGraph.get();var Pwe={...k_,graph:async(e,t)=>(await M.animationGraph.load()).createGraph(e,t),sequence:async(e,t)=>(await M.cinematics.load()).createSequence(e,t),curve:async e=>(await M.cinematics.load()).createCurve(e)};var Cwe={transformPoints(e,t,r,n){Uf(e,"elements"in r?r.elements:r,t,n)},composeMatrix4(e,t,r,n,o){BA(e,t,r,n,o)},frustumKeepsBox(e,t,r,n){gL(e,t.planes,r,n)}};var Iwe={geometryPool:e=>({geometryPool:e}),texturePool:e=>({texturePool:e})};var il=new Float64Array(3),Ps=new Float64Array(4),Ip=new Float64Array(3),j4=new Float64Array(16),kwe=Object.freeze({x:1,y:0,z:0}),Fwe=Object.freeze({x:0,y:1,z:0}),Nwe=Object.freeze({x:0,y:0,z:1}),ft=class e{isMatrix4=!0;elements=new Float64Array(Or);set(t,r,n,o,i,s,a,l,c,u,d,f,h,m,w,x){let b=this.elements;return b[0]=t,b[1]=i,b[2]=c,b[3]=h,b[4]=r,b[5]=s,b[6]=u,b[7]=m,b[8]=n,b[9]=a,b[10]=d,b[11]=w,b[12]=o,b[13]=l,b[14]=f,b[15]=x,this}identity(){return this.elements.set(Or),this}copy(t){return Ce(this.elements,t.elements),this}clone(){return new e().copy(this)}fromArray(t,r=0){return Ce(this.elements,t,0,r),this}toArray(){return Array.from(this.elements)}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,r){let n=this.elements,o=t.elements,i=r.elements;return n!==o&&n.buffer===o.buffer||n!==i&&n.buffer===i.buffer?(Ve(j4,o,i),n.set(j4)):Ve(n,o,i),this}compose(t,r,n){return NA(this.elements,De(il,t),bt(Ps,r),De(Ip,n)),this}decompose(t,r,n){return Rr(this.elements,il,Ps,Ip),t.set(il[0],il[1],il[2]),r.set(Ps[0],Ps[1],Ps[2],Ps[3]),n.set(Ip[0],Ip[1],Ip[2]),this}invert(){return mr(this.elements,this.elements),this}determinant(){return mi(this.elements)}transpose(){return KF(this.elements,this.elements),this}makeTranslation(t,r,n){return this.set(1,0,0,t,0,1,0,r,0,0,1,n,0,0,0,1)}makeScale(t,r,n){return this.set(t,0,0,0,0,r,0,0,0,0,n,0,0,0,0,1)}makeRotationFromQuaternion(t){return xa(this.elements,bt(Ps,t)),this}makeRotationAxis(t,r){return Ne(De(il,t)),xa(this.elements,ao(Ps,il,r)),this}makeRotationX(t){return this.makeRotationAxis(kwe,t)}makeRotationY(t){return this.makeRotationAxis(Fwe,t)}makeRotationZ(t){return this.makeRotationAxis(Nwe,t)}setPosition(t,r,n){return this.elements[12]=t,this.elements[13]=r,this.elements[14]=n,this}getMaxScaleOnAxis(){return Fa(this.elements)}equals(t){return ua(this.elements,t.elements)}};var Bwe=new WeakMap,Uwe=Xa("name"),Vwe=new ft,$4=new Float64Array(4),kp=class e extends gs{#e="";get name(){return this.#e}set name(t){this.holdName(Uwe(this,t))}holdName(t){t!==this.#e&&Xg(),this.#e=t}static{xt(e.prototype,"name",function(t){this.holdName(t)})}local=this.owned(new ft);world=this.owned(new ft);localView=null;get matrix(){return Ur(this.state.tree,this.index,6),Qt(this),this.adopted||(this.local.elements=this.localView=this.localMatrix),this.local}get _matrixElements(){return this.adopted??this.localMatrix}_matrixMoved(){this.takeStorage(),this.matrixWorldNeedsUpdate=!0}setLocalMatrix(t){super.setLocalMatrix(t);let r=this.adopted;return r&&r!==t&&Ce(r,t),this}setAutoUpdate(t){return super.setAutoUpdate(t),t||this.takeStorage(),this}get adopted(){return this.localView&&this.local.elements!==this.localView?this.local.elements:null}get matrixWorld(){return this.adopted&&(this.takeStorage(),ln(this.state.tree,this.index,!1,!1)),this.world.elements=this.worldMatrix,this.world}get _worldVersion(){return this.localView&&this.matrixWorld,this.state.tree.version[this.index]}get matrixAutoUpdate(){return(this.state.tree.flags[this.index]&1)!==0}set matrixAutoUpdate(t){this.setAutoUpdate(t)}get matrixWorldNeedsUpdate(){return(this.state.tree.flags[this.index]&8)!==0}set matrixWorldNeedsUpdate(t){if(!t){this.state.tree.flags[this.index]&=-9;return}Ur(this.state.tree,this.index,12),Qt(this)}owned(t){return Bwe.set(t,this),t}takeChainStorage(){this.takeStorage();for(let t=this.parent;t instanceof e;t=t.parent)t.takeStorage()}takeStorage(){let t=this.adopted;t&&(this.assertAlive(),!this.matrixAutoUpdate&&(nN(this.localMatrix,t)||(Ur(this.state.tree,this.index,6),Qt(this))))}updateWorldMatrix(t=!0,r=!0){return t&&this.takeChainStorage(),super.updateWorldMatrix(t,r)}updateMatrixWorld(t=!1){this.assertAlive(),UA(this.state.tree,this.index,t)}getWorldPosition(t=new I){return this.takeChainStorage(),t.fromArray(xL($4,this.state.tree,this.index))}getWorldQuaternion(t=new Et){return this.takeChainStorage(),t.fromArray(bL($4,this.state.tree,this.index))}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Vwe.copy(this.matrixWorld).invert())}};var Gwe=VA({id:"world-objects"}),Y4=new FinalizationRegistry(([e,t])=>E2(e,t)),K4=()=>Gwe.reserve();function q4(e,t){Y4.register(e,[t.state.tree,t.index],e)}function X4(e){Y4.unregister(e)}var du=e=>JSON.parse(JSON.stringify(e));var Z4=["auto","always","rigid","static"],F_={evaluate:!0,disableDistance:0,writesVelocity:!0,shadowCache:"auto",mobility:void 0,firstPerson:!1,worldSpaceRepresentation:!1,castHiddenShadow:!1,holdout:!1,castContactShadow:!0,affectDistanceFieldLighting:!0,castCapsuleDirectShadow:Ra.castCapsuleDirectShadow.default,castVolumetricTranslucentShadow:xS.castVolumetricTranslucentShadow.default,castCapsuleIndirectShadow:Ra.castCapsuleIndirectShadow.default,capsuleIndirectShadowMinVisibility:Ra.capsuleIndirectShadowMinVisibility.default,shadowCapsules:RO,lightGroups:iS,ownerNoSee:!1,onlyOwnerSee:!1,renderMarkedDepth:!1,markedDepthStencilValue:0,markedDepthStencilWriteMask:"default",visibleInReflections:!0,visibleInRayTracing:!0,affectIndirectLighting:!0,maxDrawDistance:0,revision:0},Cs=new WeakMap,N_=0,_nt=()=>N_;function B_(e){Qt(e),N_++}var pt=e=>Cs.get(e)??F_,Hwe=["shadowCache","mobility","firstPerson","worldSpaceRepresentation","castHiddenShadow","affectDistanceFieldLighting","visibleInRayTracing","affectIndirectLighting","maxDrawDistance"];function at(e,t,r,n=o=>o){return{refusal:(o,i)=>t(i)?void 0:`${o} is ${r}`,held:o=>n(o),write(o,i){o[e]=n(i)},read:o=>o[e],isDefault:o=>o[e]===F_[e]}}var Z0=(e,t)=>at(e,r=>et(t,r),Dt(t)),nr=e=>typeof e=="boolean",Wwe=e=>Z4.some(t=>t===e),zwe=e=>e===void 0||e_.some(t=>t===e),jwe={evaluateWorldPositionOffset:at("evaluate",nr,"true or false"),worldPositionOffsetDisableDistance:Z0("disableDistance",tu.worldPositionOffsetDisableDistance),worldPositionOffsetWritesVelocity:at("writesVelocity",nr,"true or false"),shadowCacheInvalidation:at("shadowCache",Wwe,`one of ${Z4.join(", ")}`),mobility:at("mobility",zwe,`one of ${e_.join(", ")}, or undefined for the object's own`),firstPerson:at("firstPerson",nr,"true or false"),firstPersonWorldSpaceRepresentation:at("worldSpaceRepresentation",nr,"true or false"),castHiddenShadow:at("castHiddenShadow",nr,"true or false"),holdout:at("holdout",nr,"true or false"),castContactShadow:at("castContactShadow",nr,"true or false"),affectDistanceFieldLighting:at("affectDistanceFieldLighting",nr,"true or false"),castCapsuleDirectShadow:at("castCapsuleDirectShadow",nr,"true or false"),castVolumetricTranslucentShadow:at("castVolumetricTranslucentShadow",nr,"true or false"),castCapsuleIndirectShadow:at("castCapsuleIndirectShadow",nr,"true or false"),capsuleIndirectShadowMinVisibility:Z0("capsuleIndirectShadowMinVisibility",Ra.capsuleIndirectShadowMinVisibility),shadowCapsules:at("shadowCapsules",MB,DB,e=>e.length?Object.freeze([...e]):RO),lightGroups:at("lightGroups",JA,eO,aS),ownerNoSee:at("ownerNoSee",nr,"true or false"),onlyOwnerSee:at("onlyOwnerSee",nr,"true or false"),renderMarkedDepth:at("renderMarkedDepth",nr,"true or false"),markedDepthStencilValue:Z0("markedDepthStencilValue",tu.markedDepthStencilValue),markedDepthStencilWriteMask:at("markedDepthStencilWriteMask",AW,"'default', 255, or one bit: 1, 2, 4, 8, 16, 32, 64 or 128"),visibleInReflections:at("visibleInReflections",nr,"true or false"),visibleInRayTracing:at("visibleInRayTracing",nr,"true or false"),affectIndirectLighting:at("affectIndirectLighting",nr,"true or false"),maxDrawDistance:Z0("maxDrawDistance",tu.maxDrawDistance)},fu=Object.entries(jwe),$we=new Map(fu),Ywe="firstPerson and firstPersonWorldSpaceRepresentation exclude each other";function J4(e,t){if(t.firstPerson&&t.worldSpaceRepresentation)throw new RangeError(Ywe);let r=!Cs.has(e)&&e._rowsReadSwitches===!0,n=pt(e);Qt(e),t.revision++,Cs.set(e,t),N_++,(r||Hwe.some(o=>n[o]!==t[o]))&&e._link?.shadow?.(e)}function e5(e,t,r){let n=t.refusal(e,r);if(n)throw new RangeError(n)}function Q4(e,t,r){let n=pt(e);if(t.read(n)===t.held(r))return;let o={...n};t.write(o,r),J4(e,o)}function t5(e,t){for(let[o,i,s]of t)e5(o,i,s);let r=pt(e),n;for(let[,o,i]of t)o.read(n??r)!==o.held(i)&&o.write(n??={...r},i);n&&J4(e,n)}function vnt(e,t){t5(e,Object.entries(t).flatMap(([r,n])=>{let o=$we.get(r);return o?[[r,o,n]]:[]}))}var Fp=e=>Cs.has(e);function r5(e){let t=Cs.get(e);return t?Object.fromEntries(fu.filter(([,r])=>!r.isDefault(t)).map(([r,n])=>[r,n.read(t)])):{}}function Mnt(e,t){let r=new Map(Object.entries(Gt(t)));if(!(!Cs.has(e)&&fu.every(([n])=>!r.has(n))))return Object.fromEntries(fu.map(([n,o])=>[n,r.get(n)??o.read(F_)]))}function n5(e){for(let[t,r]of fu){let n=dn("Mesh",t)===void 0?void 0:Xa(t);xt(e,t,function(o){Q4(this,r,o)}),Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return r.read(pt(this))},set(o){n===void 0&&e5(t,r,o),Q4(this,r,n===void 0?o:n(this,o))}})}}function J0(e,t){if(!Cs.has(t)&&!Cs.has(e))return;let r=pt(t);t5(e,fu.map(([n,o])=>[n,o,o.read(r)]))}var o5=new WeakSet;function Pnt(e){return o5.add(e),e}var ey=e=>o5.has(e);var Kwe=["name"],qwe=["visible","castShadow","castsShadowMaps","farField"],Xwe=["renderOrder"];function U_(e,t,r){let n=t;for(let o of r)Ni(e,o).call(e,n[o])}function i5(e,t,r){if(t===e)return e;if(U_(e,t,Kwe),e.up.copy(t.up),e.position.copy(t.position),e.rotation.order=t.rotation.order,e.quaternion.copy(t.quaternion),e.scale.copy(t.scale),e.matrix.copy(t.matrix),e.matrixWorld.copy(t.matrixWorld),e.matrixAutoUpdate=t.matrixAutoUpdate,e.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,U_(e,t,qwe),J0(e,t),U_(e,t,Xwe),e.userData=du(t.userData),r)for(let n of t.children)ey(n)||e.add(n.clone());return e}function s5(e,t){if(e.name===t)return e;for(let r of e.children){let n=r.getObjectByName(t);if(n)return n}}var V_=new WeakMap;function Qwe(e,t){let r=e.index*3,n=e.index*4;e.position._share(t.position.subarray(r,r+3)),e.quaternion._share(t.quaternion.subarray(n,n+4)),e.scale._share(t.scale.subarray(r,r+3))}function Zwe(e,t,r,n,o){for(let i=0;i<t.length;i++){let s=t[i]?.deref();if(!s)continue;let a=i*3,l=i*4;s.position.elements.buffer===r.buffer&&s.position._share(e.position.subarray(a,a+3)),s.quaternion.elements.buffer===n.buffer&&s.quaternion._share(e.quaternion.subarray(l,l+4)),s.scale.elements.buffer===o.buffer&&s.scale._share(e.scale.subarray(a,a+3))}}function a5(e,t){let{position:r,quaternion:n,rotation:o,scale:i}=e;Se(r,()=>{let a=r.elements;e.setPosition(a[0],a[1],a[2]),e._link?.pose(e)}),Se(i,()=>{let a=i.elements;e.setScale(a[0],a[1],a[2]),e._link?.pose(e)});let s=a=>{let l=a?n.setFromEuler(o,!0):n,c=l.elements;e.setQuaternion(c[0],c[1],c[2],c[3]),a&&o._follow(l),e._link?.pose(e)};o._follow(n),Se(n,()=>s(!1)),Se(o,()=>s(!0)),Qwe(e,t),Jwe(t)[e.index]=new WeakRef(e)}function Jwe(e){let t=V_.get(e);if(!t){let r=t=[];V_.set(e,r),e.grew=(n,o,i)=>Zwe(e,r,n,o,i)}return t}function l5(e,t){let r=V_.get(t);r?.[e.index]?.deref()===e&&(r[e.index]=void 0);let{position:n,quaternion:o,scale:i}=e;n.elements.buffer===t.position.buffer&&n._share(new Float64Array(3)),o.elements.buffer===t.quaternion.buffer&&o._share(new Float64Array(4)),i.elements.buffer===t.scale.buffer&&i._share(new Float64Array(3))}function G_(e,t){let{position:r,quaternion:n,scale:o}=t,i=e.index*3,s=e.index*4;for(let a=0;a<3;a++)e.position.elements[a]=r[i+a],e.scale.elements[a]=o[i+a];e.quaternion.set(n[s],n[s+1],n[s+2],n[s+3],!0),e._link?.pose(e)}var pu=.9999999;function d5(e,t,r="XYZ"){switch(r){case"YXZ":c5(e,t,!0);break;case"ZXY":u5(e,t,!0);break;case"ZYX":u5(e,t,!1);break;case"YZX":c5(e,t,!1);break;case"XZY":e0e(e,t);break;default:t0e(e,t)}return e}function hu(e,t,r,n){e[0]=t,e[1]=r,e[2]=n}function c5(e,t,r){let n=t[0],o=t[8],i=t[1],s=t[5],a=t[9],l=t[2],c=t[10];if(r){let u,d=0,f=Math.asin(-k(a,-1,1));Math.abs(a)<pu?(u=Math.atan2(o,c),d=Math.atan2(i,s)):u=Math.atan2(-l,n),hu(e,f,u,d)}else{let u=0,d,f=Math.asin(k(i,-1,1));Math.abs(i)<pu?(u=Math.atan2(-a,s),d=Math.atan2(-l,n)):d=Math.atan2(o,c),hu(e,u,d,f)}}function u5(e,t,r){let n=t[0],o=t[4],i=t[1],s=t[5],a=t[2],l=t[6],c=t[10];if(r){let u=0,d,f=Math.asin(k(l,-1,1));Math.abs(l)<pu?(u=Math.atan2(-a,c),d=Math.atan2(-o,s)):d=Math.atan2(i,n),hu(e,f,u,d)}else{let u=0,d,f=Math.asin(-k(a,-1,1));Math.abs(a)<pu?(u=Math.atan2(l,c),d=Math.atan2(i,n)):d=Math.atan2(-o,s),hu(e,u,f,d)}}function f5(e,t,r){let n=t[0],o=t[4],i=t[8],s=t[5],a=t[9],l=t[6],c=t[10];if(r){let u,d=0,f=Math.asin(-k(o,-1,1));Math.abs(o)<pu?(u=Math.atan2(l,s),d=Math.atan2(i,n)):u=Math.atan2(-a,c),hu(e,u,d,f)}else{let u,d=0,f=Math.asin(k(i,-1,1));Math.abs(i)<pu?(u=Math.atan2(-a,c),d=Math.atan2(-o,n)):u=Math.atan2(l,s),hu(e,u,f,d)}}function e0e(e,t){f5(e,t,!0)}function t0e(e,t){f5(e,t,!1)}var p5=new Float64Array(16),r0e=new Float64Array(4),ty=new Float64Array(3),sl=class e extends cn{isEuler=!0;_x;_y;_z;_order;_source=null;_seen=new Float64Array(4);constructor(t=0,r=0,n=0,o="XYZ"){super(),this._x=t,this._y=r,this._z=n,this._order=o}get x(){return this._source&&this.resolve(),this._x}set x(t){this._source&&this.resolve(),this._x=t,this._changed()}get y(){return this._source&&this.resolve(),this._y}set y(t){this._source&&this.resolve(),this._y=t,this._changed()}get z(){return this._source&&this.resolve(),this._z}set z(t){this._source&&this.resolve(),this._z=t,this._changed()}get order(){return this._order}set order(t){this._source&&this.resolve(),this._order=t,this._changed()}set(t,r,n,o=this._order,i=!1){return this._source&&this._follow(this._source),this._x=t,this._y=r,this._z=n,this._order=o,i?this:this._changed()}copy(t){return this.set(t.x,t.y,t.z,t.order)}clone(){return new e(this.x,this.y,this.z,this._order)}setFromRotationMatrix(t,r=this._order,n=!1){return this.fromElements(t.elements,r,n)}setFromQuaternion(t,r=this._order,n=!1){return xa(p5,bt(r0e,t)),this.fromElements(p5,r,n)}fromElements(t,r,n){return d5(ty,t,r),this.set(ty[0],ty[1],ty[2],r,n)}toArray(){return[this.x,this.y,this.z,this._order]}_follow(t){this._source=t,bt(this._seen,t)}resolve(){let t=this._source,r=this._seen;t.x===r[0]&&t.y===r[1]&&t.z===r[2]&&t.w===r[3]||(this._follow(t),this.setFromQuaternion(t,this._order,!0))}};var qnt=39,n0e={add:1,remove:2,teleport:3,moveKinematic:4,velocity:5,impulse:6,wake:7,gravity:8,gravityScale:9,view:10,flags:11,material:12,character:13,characterMove:14,restore:15,release:16,buoyancy:17,joint:18,unjoint:19,motor:20,vehicle:21,unvehicle:22,drive:23,soft:24,filter:25,angularVelocity:26,angularImpulse:27,impulseAt:28,ragdoll:29,ragdollDrive:30,ragdollPose:31,heightFieldWrite:32,ragdollTarget:33,ragdollWeapon:34,ragdollShot:35,ragdollTune:36,ragdollLimits:37,ragdollAct:38,ragdollJointPose:39,ragdollCollision:40,vehicleTune:41},Xnt=7,Qnt={heights:0,materials:1},ry=255,Znt={static:0,kinematic:1,dynamic:2},Jnt=8,eot={op:0,id:1,channel:2,switches:3,stop:4,sense:6},tot={static:0,moving:1,decorative:2,avatar:3},rot=65536,not={query:1,physics:2,still:4},oot={box:0,sphere:1,capsule:2,cylinder:3,triangles:4,hull:5,cooked:6,compound:7,heightField:8},iot=11,Hi=20,kn={kind:0,origin:1,travel:4,extents:7,ignored:10,channel:11,sought:16,stop:18,ignoredSet:19},ny={channel:0,sought:1},oy=8,Fn={body:0,fraction:1,point:2,normal:5};var al={ray:0,sphere:1,box:2,capsule:3},h5=20,Wi={mode:0,shape:1,extents:2,position:5,rotation:8,channel:12,stop:13,sense:15,sought:17,ignored:19},m5=3,mu={multi:0,any:1,stopping:2,multiSought:3,anySought:4},g5={stops:1},sot={fixed:0,point:1,hinge:2,slider:3,distance:4,cone:5,swingTwist:6,sixDof:7,path:8,pulley:9,gear:10,rackAndPinion:11},aot={off:0,velocity:1,position:2},lot=35;var cot={sensor:1,ccd:2,events:4,hidden:8,asleep:16,decorative:32},S5=16777215,uot=2147483648,o0e=24,dot=128,fot=(e,t)=>e|t<<o0e,pot=32,hot={maxAngularVelocity:25,centerOfMassOffset:26,inertiaScale:29},w5=10*Q,y5=.01,x5=0,mot=9;var b5=14,E5=2147483648,T5=7,got={begin:1,end:2,overlap:3,struck:4};var Yo={earth:9.8,moon:1.62,mars:3.71,none:0},A5={wood:{density:600,friction:.5,restitution:.3,rubber:.6,print:0},metal:{density:7800,friction:.4,restitution:.2,rubber:.7,print:0},rubber:{density:1100,friction:.9,restitution:.8,rubber:.5,print:0},ice:{density:917,friction:.03,restitution:.05,rubber:.15,print:0},stone:{density:2600,friction:.7,restitution:.1,rubber:1,print:0},glass:{density:2500,friction:.4,restitution:.4,rubber:.5,print:0},asphalt:{density:2300,friction:.9,restitution:.05,rubber:1,print:0},sand:{density:1600,friction:.6,restitution:.02,rubber:.05,print:.5},snow:{density:300,friction:.3,restitution:.02,rubber:.05,print:.6},grass:{density:1200,friction:.55,restitution:.1,rubber:.1,print:.3},mud:{density:1700,friction:.35,restitution:.01,rubber:0,print:.8}};var i0e=1e3,s0e={density:i0e,friction:.7,restitution:.3,rubber:Ya.rubber.default,print:Ya.print.default},Tot=e=>e?.physics&&A5[e.physics]||s0e,a0e=32*Tn,qr=Object.freeze({bodies:16384,decorative:1024,ragdolls:8,memoryBytes:128*Tn,bodyPairs:65536,contactConstraints:32768,contactEvents:4096,threads:8,softVertices:16384}),O5=A({bodies:S("bodies",qr.bodies,[1,S5]),decorative:P("decorative",qr.decorative,0),ragdolls:P("ragdolls",qr.ragdolls,0),memoryBytes:S("memoryBytes",qr.memoryBytes,[a0e,2**32]),bodyPairs:P("bodyPairs",qr.bodyPairs,1),contactConstraints:P("contactConstraints",qr.contactConstraints,1),contactEvents:P("contactEvents",qr.contactEvents,1),threads:P("threads",qr.threads,1),softVertices:P("softVertices",qr.softVertices,0)});function H_(e,t){if(typeof t!="number")throw new TypeError(`Physics budget "${e}" must be a number, not ${String(t)}.`);let r=O5[e];if(!et(r,t))throw new RangeError(`Physics budget "${e}" must be ${Dt(r)}, not ${t}.`);return t}function L5(e={}){for(let[t,r]of Object.entries(e)){if(!(t in qr))throw new E("PHYSICS_BUDGET",`Physics budget "${t}" does not exist (world.budget.physics.${t}).`,{budget:t});H_(t,r)}return Object.seal({...qr,...e})}var l0e=.5,Aot=16,c0e=e=>Math.floor(e.memoryBytes*l0e),Np=1/60,W_=10,z_=.005,R5=.1,iy=4;function u0e(e,t,r){return new E("PHYSICS_BUDGET",`Physics budget "${e}" exceeded: ${r} asked, ${t} allowed (world.budget.physics.${e}).`,{budget:e,limit:t,requested:r})}function Oot(e,t,r){let n=t==="collisionBytes",o=n?c0e(e):e[t];if(r>o)throw u0e(n?"memoryBytes":t,o,r)}function _5(e){let t=e;for(let a of["shape","sensor","ccd","decorative"])if(t[a]!==void 0)throw new RangeError(`A soft body takes no ${a}.`);if(t.damping?.angular!==void 0)throw new RangeError("A soft body takes no angular damping: its vertices do not turn.");let{pins:r=[],mass:n,stretch:o=0,bend:i=1/0}=e,s=e.type==="volume"?e.pressure:0;for(let[a,l]of Object.entries({stretch:o,bend:i,mass:n,pressure:s}))if(l!==void 0&&!(l>=0))throw new RangeError(`A soft body's ${a} is 0 and up: ${l}.`);return{type:e.type,pins:[...r],mass:n,stretch:o,bend:i,pressure:s}}var d0e=.2,f0e=.065,p0e=.25,h0e=.01,v5=IF(1-h0e,Np),Dot=.1,Pot=5,m0e=["cloth","rope","volume"],j_=e=>m0e.includes(e),$_=e=>e==="cloth",M5=e=>typeof e=="object"&&j_(e.type)?_5(e):null;var g0e=Object.freeze({maxAngularVelocity:w5,centerOfMassOffset:Object.freeze([0,0,0]),inertiaScale:Object.freeze([1,1,1]),startAwake:!0}),D5=(e,t)=>e.length===3&&e.every(r=>Number.isFinite(r)&&(!t||r>0));function P5(e){let t=g0e,{maxAngularVelocity:r=t.maxAngularVelocity,centerOfMassOffset:n=t.centerOfMassOffset,inertiaScale:o=t.inertiaScale,startAwake:i=t.startAwake}=e;if(!(r>0&&r<1/0))throw new RangeError(`A body's maxAngularVelocity is above 0 rad/s, not ${r}.`);if(!D5(n,!1))throw new RangeError(`A body's centerOfMassOffset is three finite numbers: ${n}.`);if(!D5(o,!0))throw new RangeError(`A body's inertiaScale is three numbers above 0: ${o}.`);return Object.freeze({maxAngularVelocity:r,centerOfMassOffset:Object.freeze([...n]),inertiaScale:Object.freeze([...o]),startAwake:i!==!1})}var k5={box:0,sphere:0,capsule:0,cylinder:0},S0e={...k5,compound:0,heightField:0,hull:0,triangles:0},C5=Object.keys(k5),w0e=Object.keys(S0e);function I5(e,t,r){if(typeof e!="object"||e===null)throw new TypeError(`${r} is { type, \u2026 } of type ${t.join(", ")}: not ${JSON.stringify(e)}.`);let{type:n}=e;if(!t.includes(n))throw new TypeError(`${r} "${String(n)}" is none of ${t.join(", ")}.`)}function F5(e){if(!e||(I5(e,w0e,"A body's shape"),e.type!=="compound"))return e;if(!Array.isArray(e.parts)||e.parts.length===0){let t=C5.join(", ");throw new TypeError(`A compound's parts are a list of one or more { type, \u2026 } of type ${t}.`)}for(let t of e.parts)I5(t,C5,"A compound's part");return e}function Y_(e,t,r,n){if(!(Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(n)))throw new RangeError(`A body's ${e} is three finite numbers: ${t}, ${r}, ${n}.`)}var gu=(e,{x:t,y:r,z:n})=>Y_(e,t,r,n),Bp=new WeakMap;function N5(e,t,r,n){if(t===0&&r===0&&n===0)return;let o=Bp.get(e);if(!o)return void Bp.set(e,[t,r,n]);o[0]+=t,o[1]+=r,o[2]+=n}var Not=e=>Bp.has(e);function Bot(e){let t=Bp.get(e);return Bp.delete(e),t}var y0e=e=>Number.isFinite(Math.fround(e)),x0e=(e,t)=>Number.isInteger(e)&&e>=0&&(e<t||e===ry),b0e=e=>e.materials?.length??1;function B5(e,t,r){let n=t==="heights"?e.sampleCount:e.sampleCount-1,{x:o,z:i,width:s,depth:a}=r;if(!(Number.isInteger(o)&&Number.isInteger(i)&&Number.isInteger(s)&&Number.isInteger(a)&&o>=0&&i>=0&&s>=1&&a>=1))throw new RangeError(`A height field region is of whole numbers, sizes 1 and up: ${o}, ${i}, ${s}, ${a}.`);if(o+s>n||i+a>n)throw new RangeError(`A height field region of ${t} lies within its ${n} a side: ${o}, ${i}, ${s}, ${a}.`);let c=t==="heights",u=c?e.heights:e.quadMaterials,d=b0e(e);if(u)for(let f=i;f<i+a;f++)for(let h=o;h<o+s;h++){let m=u[f*n+h];if(!(c?y0e(m):x0e(m,d)))throw new RangeError(c?`A height field's heights are finite: ${m} at (${h}, ${f}).`:`A height field's quad ranks name one of its ${d} materials or the hole (${ry}): ${m} at (${h}, ${f}).`)}}function sy(e,t){if(t!==void 0&&!et(Ya[e],t))throw new RangeError(`A body's ${e} is a number from 0 to 1: ${String(t)}.`);return t}var hn=class{type;soft;shape;sensor;collision;decorative;damping;maxAngularVelocity;centerOfMassOffset;inertiaScale;startAwake;_velocity=new I;_spin=new I;_asleep=!1;_seen=0;_ccd;_mass;_gravityScale;_friction;_restitution;_rubber;_print;handlers=new Map;handled=0;leasts=new Map;_contactLeast=0;_host=null;_index=-1;_state=null;vertices=null;constructor(t){this.soft=M5(t);let r=typeof t=="string"?{type:t}:t;this.type=this.soft?.type??r.type??"dynamic",this.shape=F5(r.shape),this.sensor=r.sensor??!1,this.collision=r.collision,this._ccd=r.ccd??!1,this.decorative=r.decorative??!1;let n=this.soft?v5:y5,{linear:o=n,angular:i=x5}=r.damping??{};if(!(o>=0&&i>=0))throw new RangeError(`A body's damping is 0 and up: ${o} linear, ${i} angular.`);this.damping={linear:o,angular:i};let s=P5(r);this.maxAngularVelocity=s.maxAngularVelocity,this.centerOfMassOffset=s.centerOfMassOffset,this.inertiaScale=s.inertiaScale,this.startAwake=s.startAwake,this._mass=r.mass,this._gravityScale=r.gravityScale??1,this._friction=r.friction,this._restitution=r.restitution,this._rubber=sy("rubber",r.rubber),this._print=sy("print",r.print),Se(this._velocity,()=>{gu("velocity",this._velocity),this._host?.velocity(this)}),Se(this._spin,()=>{gu("angularVelocity",this._spin),this._host?.angularVelocity(this)})}get velocity(){return this.read(),this._velocity}get angularVelocity(){return this.read(),this._spin}read(){let t=this._state,r=this._index;if(!t||t.stamp[r]===this._seen)return;this._seen=t.stamp[r];let n=this._velocity.elements,o=this._spin.elements;for(let i=0;i<3;i++)n[i]=t.velocity[r*6+i],o[i]=t.velocity[r*6+3+i]}get asleep(){return this._state?this._state.asleep[this._index]===1:this._asleep}_attach(t,r,n){this._host=t,this._index=r,this._state=n,this._seen=n.stamp[r]}_detach(){this._asleep=this.asleep,this.read(),this._host=this._state=null,this._index=-1}get ccd(){return this._ccd}set ccd(t){if(t!==this._ccd){if(this.soft)throw new RangeError("A soft body has no continuous collision (its vertices do not turn).");this._ccd=t,this._host?.flagged(this)}}get mass(){return this._mass}set mass(t){this._mass=t,this._host?.rebuild(this)}get gravityScale(){return this._gravityScale}set gravityScale(t){this._gravityScale=t,this._host?.tune(this)}get friction(){return this._friction}set friction(t){this._friction=t,this._host?.tune(this)}get restitution(){return this._restitution}set restitution(t){this._restitution=t,this._host?.tune(this)}get rubber(){return this._rubber}set rubber(t){this._rubber=sy("rubber",t)}get print(){return this._print}set print(t){this._print=sy("print",t)}applyImpulse(t,r=0,n=0){if(typeof t!="number")return this.applyImpulse(t.x,t.y,t.z);Y_("impulse",t,r,n),this._host?this._host.impulse(this,t,r,n):N5(this,t,r,n)}applyForce(t,r){gu("force",t),r&&gu("force point",r),this._host?.force(this,t,r??null)}applyTorque(t){gu("torque",t),this._host?.torque(this,t)}wake(){this._host?.wake(this)}writeHeightField(t,r){if(this.shape?.type!=="heightField")throw new TypeError("Only a height field body writes a region of its height field.");B5(this.shape,t,r),this._host?.heightField?.(this,t,r)}on(t,r,n){let o=t==="contact"?n?.leastImpulse??0:0;if(!(Number.isFinite(o)&&o>=0))throw new RangeError(`leastImpulse is a finite number of 0 or more: ${String(o)}.`);let i=o>0?l=>{l.impulse>=o&&r(l)}:r,s=this.listens,a=this.handlers.get(t);return a||this.handlers.set(t,a=fe()),this.handled-=a.size,a.subscribe(i),this.handled+=a.size,o>0&&this.leasts.set(i,o),this.contactLeastNow(),s||this._host?.flagged(this),()=>{this.handled-=a.size,a.unsubscribe(i),this.handled+=a.size,this.leasts.delete(i),this.contactLeastNow(),this.listens||this._host?.flagged(this)}}contactLeastNow(){let t=this.handlers.get("contact")?.size??0,r=1/0;for(let n of this.leasts.values())r=Math.min(r,n);this._contactLeast=t>this.leasts.size||r===1/0?0:r}get listens(){return this.handled>0}_hears(t){return(this.handlers.get(t)?.size??0)>0}_emit(t,r,n){this.handlers.get(t)?.tell(n,r)}},K_=e=>{let t=e.physics;return t instanceof hn?t:null};var E0e="a box, sphere, capsule or cylinder, { type: 'compound', parts } or a height field",T0e=e=>e.isSplineMesh?{kind:"spline mesh",solid:"leave its segments to its own collision (`collision`)"}:e.isTerrain?{kind:"terrain",solid:"leave its components to its own collision (`collision`)"}:{kind:"group",solid:"set physics on a mesh"},q_=(e,t,r)=>{let{kind:n,solid:o}=T0e(e),i=`The ${n} "${e.name}" ${t}: ${r(o)}.`;return new E("PHYSICS_FAILED",i,{name:e.name})},U5=e=>`declare its body's shape (${E0e}), or ${e}`;function X_(e,t){if(e===null)return null;if(typeof e=="object"&&j_(e.type))throw q_(t,`cannot be a ${e.type}, whose vertices are a mesh's`,()=>"set it on a mesh");let r=e instanceof hn?e:new hn(e),n=r.shape?.type;if(!n)throw q_(t,"has no geometry to take a shape from",U5);if(n==="hull"||n==="triangles")throw q_(t,`cannot take a ${n} shape, read from vertices it has none of`,U5);return r}var A0e={body:0,rank:1,rubber:2,print:3},O0e=4;var ll=["scenery","mover","avatar","sight","camera","prop","vehicle","breakable",...Array.from({length:6},(e,t)=>`reserved${t+1}`),...Array.from({length:50},(e,t)=>`custom${t+1}`)],Vp=ll.length,L0e=new Map(ll.map((e,t)=>[e,t])),R0e=Array.from({length:Vp},(e,t)=>1n<<BigInt(t)),J_=e=>R0e[e],Z_=e=>[Number(e&0xffffffffn),Number(e>>32n)],Is={ignore:0,sense:1,stop:2},ly=["ignore","sense","stop"],e1=ll.slice(0,8),Up=e=>Object.fromEntries(e1.map(t=>[t,e])),ay={ghost:{enabled:"off",channel:"scenery",responses:{sight:"ignore",camera:"ignore"}},solid:{enabled:"both",channel:"scenery"},zone:{enabled:"queries",channel:"scenery",responses:Up("sense")},movingSolid:{enabled:"both",channel:"mover"},movingZone:{enabled:"queries",channel:"mover",responses:Up("sense")},walkThrough:{enabled:"queries",channel:"mover",responses:{avatar:"ignore",vehicle:"ignore"}},avatarZone:{enabled:"queries",channel:"mover",responses:{avatar:"sense",vehicle:"sense",camera:"ignore"}},avatar:{enabled:"both",channel:"avatar",responses:{sight:"ignore"}},observer:{enabled:"queries",channel:"avatar",responses:{...Up("ignore"),scenery:"stop"}},avatarSkin:{enabled:"queries",channel:"avatar",responses:{avatar:"ignore",vehicle:"ignore",sight:"ignore"}},prop:{enabled:"both",channel:"prop"},breakable:{enabled:"both",channel:"breakable"},clearWall:{enabled:"both",channel:"scenery",responses:{sight:"ignore"}},movingClearWall:{enabled:"both",channel:"mover",responses:{sight:"ignore"}},trigger:{enabled:"queries",channel:"mover",responses:{...Up("sense"),sight:"ignore"}},ragdoll:{enabled:"both",channel:"prop",responses:{avatar:"ignore",sight:"ignore"}},vehicle:{enabled:"both",channel:"vehicle"},interface:{enabled:"queries",channel:"mover",responses:{...Up("sense"),sight:"stop"}}};function cl(e){let t=typeof e=="number"?e:L0e.get(dt("collisionChannel",e))??-1;if(!Number.isInteger(t)||t<0||t>=Vp)throw new E("COLLISION_CHANNEL",`Collision channel ${JSON.stringify(e)} does not exist: one of ${Vp} channels, by name or from 0 to ${Vp-1}.`,{channel:e});return t}var _0e=e=>e.reduce((t,r)=>t|J_(cl(r)),0n),Su=e=>Z_(e?_0e(e):0n),W5=(e,t=!1)=>t?"movingZone":v0e[e],v0e={static:"solid",dynamic:"prop",kinematic:"movingSolid"},Q_={off:{query:!1,physics:!1},queries:{query:!0,physics:!1},simulation:{query:!1,physics:!0},both:{query:!0,physics:!0}};function M0e(e){let t=dt("collisionEnabled",e);if(!Object.hasOwn(Q_,t))throw new E("COLLISION_ENABLED",`Collision enabled ${JSON.stringify(e)} does not exist: ${Object.keys(Q_).join(", ")}.`,{enabled:e});return Q_[t]}function D0e(e,t){let r=dt("collisionResponse",e);if(!Object.hasOwn(Is,r))throw new E("COLLISION_RESPONSE",`Collision response ${JSON.stringify(e)} for channel ${JSON.stringify(t)} does not exist: ${ly.join(", ")}.`,{channel:t,response:e});return Is[r]}function V5(e,t){let{stop:r,sense:n}=t;for(let[o,i]of Object.entries(e??{})){let s=J_(cl(/^\d+$/.test(o)?Number(o):o)),a=D0e(i,o);r=a===Is.stop?r|s:r&~s,n=a===Is.sense?n|s:n&~s}return{stop:r,sense:n}}var G5=new Map;function zi(e,t,r){let n=e&&Gt(e,"collisionField"),o=dt("collisionProfile",n?.profile??t);if(!Object.hasOwn(ay,o))throw new E("COLLISION_PROFILE",`Collision profile ${JSON.stringify(o)} does not exist: one of ${Object.keys(ay).join(", ")}.`,{profile:o});let i=ay[o],s=G5.get(o);s||G5.set(o,s=V5(i.responses,{stop:(1n<<BigInt(Vp))-1n,sense:0n}));let{stop:a,sense:l}=V5(n?.responses,s),{query:c,physics:u}=M0e(n?.enabled??i.enabled);return{channel:cl(n?.channel??r??i.channel),stop:a,sense:l,query:c,physics:u}}function P0e(e,t){let r=(o,i)=>{let s=J_(i.channel);return o.stop&s?Is.stop:o.sense&s?Is.sense:Is.ignore},n=Math.min(r(e,t),r(t,e));return ly[n]}var wu=e=>[e.channel,...Z_(e.stop),...Z_(e.sense)],H5=new WeakMap;function ait(e,t){let r=H5.get(e);return r===void 0&&H5.set(e,r=`${e.channel}/${e.stop.toString(16)}/${e.sense.toString(16)}/${+e.query}${+e.physics}`),r+ +t}var C0e=Object.fromEntries(ll.map(e=>[e,e==="scenery"?"stop":"ignore"])),I0e={responses:C0e},k0e=new Map,F0e=new Map;function lit(e){let t=W5(e.type,e.sensor);if(e.collision)return zi(e.collision,t);let r=e.decorative?F0e:k0e,n=r.get(t);return n||r.set(t,n=zi(e.decorative?I0e:void 0,t)),n}var N0e=Xa("renderOrder"),B0e=nu("visible"),U0e=nu("castShadow"),V0e=nu("castsShadowMaps"),G0e=nu("farField"),H0e=nu("editorHelper"),Gp=new I,W0e=new Et,z5=new I,z0e=new ft,j0e=new Float64Array(4),he=class e extends kp{isObject3D=!0;type="Object3D";position=new I;rotation=new sl;quaternion=new Et;scale=new I(1,1,1);up=new I(0,1,0);_renderOrder=0;get renderOrder(){return this._renderOrder}set renderOrder(t){let r=N0e(this,t);r!==this._renderOrder&&(this._renderOrder=r,B_(this))}userData={};_linkedTo=null;constructor(){let t=K4();super(t.state,t.id,t.index,t.visible),q4(this,t),a5(this,t.state.tree)}get _link(){return this._linkedTo}set _link(t){!this._linkedTo!=!t&&this.linked(!!t),this._linkedTo=t}linked(t){}static _treeOf(t){return t.state.tree}get visible(){return super.visible}set visible(t){this.holdVisible(B0e(this,t))}holdVisible(t){let r=super.visible;super.visible=t,super.visible!==r&&this._link?.pose(this)}_castShadow=!1;get castShadow(){return this._castShadow}set castShadow(t){this.holdCastShadow(U0e(this,t))}holdCastShadow(t){t!==this._castShadow&&(Qt(this),this._castShadow=t,this._link?.shadow?.(this))}_castsShadowMaps=!0;get castsShadowMaps(){return this._castsShadowMaps}set castsShadowMaps(t){this.holdCastsShadowMaps(V0e(this,t))}holdCastsShadowMaps(t){t!==this._castsShadowMaps&&(Qt(this),this._castsShadowMaps=t,this._link?.shadow?.(this))}_farField=!1;get farField(){return this._farField}set farField(t){this.holdFarField(G0e(this,t))}holdFarField(t){t!==this._farField&&(Qt(this),_2(),this._farField=t)}get parent(){return super.parent}get children(){return super.children}get looksDownNegativeZ(){return!1}add(...t){let r=this._link;try{for(let n of t){if(n===this)continue;let o=n.parent;if(super.add(n),o&&o!==this){let i=o._link;i!==r&&n.traverse(s=>s._link=null),i?.structure(o)}n.traverse(i=>{i._link!==r&&(i._link=r,r?.entered?.(i))})}}finally{r?.structure(this)}return this}remove(...t){try{for(let r of t)r.parent===this&&(super.remove(r),r.traverse(n=>n._link=null))}finally{this._link?.structure(this)}return this}attach(t){return t===this?this:(super.attach(t),G_(t,this.state.tree),this)}destroy(){this.assertAlive(),this.traverse(t=>t._destroying()),this.removeFromParent(),this.traverse(t=>{X4(t),l5(t,this.state.tree)}),super.destroy()}_destroying(){}removeFromParent(){return this.parent?.remove(this),this}clone(t=!0){return this.blank().copy(this,t)}blank(){return new this.constructor}copy(t,r=!0){return i5(this,t,r)}clear(){for(let t of this.children.slice())this.remove(t);return this}traverse(t){t(this);let r=this.children;for(let n=0;n<r.length;n++)r[n].traverse(t)}traverseVisible(t){if(!this.visible)return;t(this);let r=this.children;for(let n=0;n<r.length;n++)r[n].traverseVisible(t)}getObjectByName(t){return s5(this,t)}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(z0e.fromArray(t.elements)),this.matrix.decompose(this.position,this.quaternion,this.scale)}lookAt(t,r=0,n=0){typeof t=="number"?Gp.set(t,r,n):Gp.copy(t);let o=this.state.tree;this.takeChainStorage(),wL(o,this.index,Gp.x,Gp.y,Gp.z,this.up.elements,this.looksDownNegativeZ),G_(this,o)}rotateOnAxis(t,r){return this.quaternion.multiply(W0e.setFromAxisAngle(t,r)),this}rotateX(t){return this.rotateOnAxis({x:1,y:0,z:0},t)}rotateY(t){return this.rotateOnAxis({x:0,y:1,z:0},t)}rotateZ(t){return this.rotateOnAxis({x:0,y:0,z:1},t)}translateOnAxis(t,r){return z5.set(t.x,t.y,t.z).applyQuaternion(this.quaternion),this.position.addScaledVector(z5,r),this}getWorldDirection(t=new I){this.takeChainStorage();let r=EL(j0e,this.state.tree,this.index,this.looksDownNegativeZ);return t.set(r[0],r[1],r[2])}localBounds(){return null}get editorHelper(){return(ru(this)==="Light"||!this.castShadow)&&!this.affectIndirectLighting&&!this.visibleInReflections&&!this.visibleInRayTracing&&!this.affectDistanceFieldLighting}set editorHelper(t){let r=H0e(this,t);this.traverse(n=>{let o=ru(n);o!=="Light"&&(n.castShadow=!r&&o==="Mesh"),n.affectIndirectLighting=!r,n.visibleInReflections=!r,n.visibleInRayTracing=!r,n.affectDistanceFieldLighting=!r})}static{let t=e.prototype;BW(t,"renderOrder","_renderOrder"),xt(t,"visible",function(r){this.holdVisible(r)}),xt(t,"castShadow",function(r){this.holdCastShadow(r)}),xt(t,"castsShadowMaps",function(r){this.holdCastsShadowMaps(r)}),xt(t,"farField",function(r){this.holdFarField(r)})}};n5(he.prototype);mc(he.prototype);var j5=e=>!!e&&e.type!=="static";function t1(e,t,r){j5(r)!==j5(t)&&B_(e)}var or=class extends he{isGroup=!0;type="Group";get physics(){return this._physics??null}set physics(t){let r=this._physics;this._physics=X_(t,this),this._link?.collision?.(this),t1(this,r,this._physics)}};function ks(e,t,r,n,o,i){let s=r[n],a=r[n+1],l=r[n+2];return vT(e,t,r[o]-s,r[o+1]-a,r[o+2]-l,r[i]-s,r[i+1]-a,r[i+2]-l),e}function $5(e,t,r,n,o,i){let s=(r[n]+r[o]+r[i])/3,a=(r[n+1]+r[o+1]+r[i+1])/3,l=(r[n+2]+r[o+2]+r[i+2])/3;return e[t]=s,e[t+1]=a,e[t+2]=l,e}function Y5(e,t,r,n,o,i,s){let a=e[0],l=e[1];for(let c=0;c<3;c++){let u=t[r+c],d=n[o+c];if(s[c]===0){if(i[c]<u||i[c]>d)return!1;continue}let f=(u-i[c])/s[c],h=(d-i[c])/s[c];if(f>h){let m=f;f=h,h=m}if(f>a&&(a=f),h<l&&(l=h),a>l)return!1}return e[0]=a,e[1]=l,!0}var dl=class e{isSphere=!0;center;radius;constructor(t=new I,r=-1){this.center=t,this.radius=r}set(t,r){return this.center.copy(t),this.radius=r,this}isEmpty(){return this.radius<0}containsPoint(t){return this.center.distanceToSquared(t)<=this.radius*this.radius}distanceToPoint(t){return this.center.distanceTo(t)-this.radius}clone(){return new e(this.center.clone(),this.radius)}},Wp=class e{isPlane=!0;normal;constant;constructor(t=new I(1,0,0),r=0){this.normal=t,this.constant=r}set(t,r){return this.normal.copy(t),this.constant=r,this}setFromNormalAndCoplanarPoint(t,r){return this.normal.copy(t),this.constant=-this.normal.dot(r),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}projectPoint(t,r=new I){return r.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}clone(){return new e(this.normal.clone(),this.constant)}},ul=new Float64Array(2),po=class e{isRay=!0;origin;direction;constructor(t=new I,r=new I(0,0,-1)){this.origin=t,this.direction=r}set(t,r){return this.origin.copy(t),this.direction.copy(r),this}at(t,r=new I){return r.copy(this.origin).addScaledVector(this.direction,t)}distanceToPlane(t){let r=t.normal.dot(this.direction);if(r===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-t.distanceToPoint(this.origin)/r;return n>=0?n:null}intersectBox(t,r=new I){let n=this.origin.elements,o=this.direction.elements;return ul[0]=-1/0,ul[1]=1/0,!Y5(ul,t.min.elements,0,t.max.elements,0,n,o)||ul[1]<0?null:this.at(ul[0]>=0?ul[0]:ul[1],r)}clone(){return new e(this.origin.clone(),this.direction.clone())}},fo=new Float64Array(9),Hp=new Float64Array(3);function q5({a:e,b:t,c:r}){fo[0]=e.x,fo[1]=e.y,fo[2]=e.z,fo[3]=t.x,fo[4]=t.y,fo[5]=t.z,fo[6]=r.x,fo[7]=r.y,fo[8]=r.z}function K5(e){return q5(e),ks(Hp,0,fo,0,3,6)}var zp=class{isTriangle=!0;a;b;c;constructor(t=new I,r=new I,n=new I){this.a=t,this.b=r,this.c=n}set(t,r,n){return this.a.copy(t),this.b.copy(r),this.c.copy(n),this}getNormal(t=new I){let r=K5(this);return t.set(r[0],r[1],r[2]).normalize()}getArea(){let t=K5(this);return te(t[0],t[1],t[2])*.5}getMidpoint(t=new I){return q5(this),$5(Hp,0,fo,0,3,6),t.set(Hp[0],Hp[1],Hp[2])}},jp=class{isFrustum=!0;planes=new Float64Array(24);setFromProjectionMatrix(t){return Yd(this.planes,t.elements),this}intersectsBox(t){return!hL(this.planes,t.min.x,t.min.y,t.min.z,t.max.x,t.max.y,t.max.z)}containsPoint(t){return KN(this.planes,t.x,t.y,t.z)}};var $0e=new Float64Array(4);function r1(e,t,r,n,o,i,s){if(s){let[a,l,c,u]=ps(s,r,i,$0e);bA(e,a-c,a+c,l-u,l+u,n,o)}else xA(e,t,r,n,i);return e}function n1(e,t){let{fov:r,aspect:n,near:o,far:i}=t,s=t.projection==="orthographic"?t:null;return r1(e.elements,r,n,o,i,ko(t),s),e}var cy=Object.freeze([0,0,0,0]),Y0e=[0,0,0],K0e=[0,1,0];function X5(e,t,r){let n=Lt(e);return n.every(K)?n:r(`${t} must be three finite numbers, got ${JSON.stringify(e)}`)}function Q5(e){if(e==null||e===!1)return cy;let t=oe("clipPlane");if(typeof e!="object")return t(`must be false, null or { base, normal }, got ${String(e)}`);let r=X5(e.base??Y0e,"base",t),n=X5(e.normal??K0e,"normal",t),o=[0,0,0];return ic(o,0,n[0],n[1],n[2]),o[0]===0&&o[1]===0&&o[2]===0?cy:[o[0],o[1],o[2],Ge(o,r)]}var Z5=e=>e[0]!==0||e[1]!==0||e[2]!==0;function o1(e,t){let r=oe(t);if(typeof e!="object"||e===null||!(Symbol.iterator in e))return r("must be a list of objects");let n=[...e];return n.some(o=>typeof o!="object"||o===null)?r("must hold objects only"):Object.freeze(n)}function J5(e){return e===null?null:typeof e!="object"||e.isObject3D!==!0?oe("owner")("must be a node of the scene or null"):e}var yu=Object.freeze({clipPlane:cy,hidden:Object.freeze([]),showOnly:null,owner:null});var i1=A({animationMinScreenSize:y("animationMinScreenSize",.1),animationBankInterpolation:p("animationBankInterpolation",!0),animationBankTimeScale:g("animationBankTimeScale",1,R)}),Xit=X(i1);var e6=A({foliageDensityScale:g("foliageDensityScale",1,[0,1]),grassDensityScale:y("grassDensityScale",1)}),t6={smooth:{foliageDensityScale:0,grassDensityScale:0},balanced:{foliageDensityScale:.4,grassDensityScale:.4},fine:{foliageDensityScale:.8,grassDensityScale:.8},max:{},cinematic:{}};var r6=100,q0e=["disc","horizon"],n6=A({ambientOcclusionAlgorithm:N("ambientOcclusionAlgorithm","disc",q0e),ambientOcclusionHorizonNormals:p("ambientOcclusionHorizonNormals",!1),ambientOcclusionHorizonFilterWidth:g("ambientOcclusionHorizonFilterWidth",5,R),ambientOcclusionHorizonThickness:g("ambientOcclusionHorizonThickness",.5,R),ambientOcclusionHorizonRadius:y("ambientOcclusionHorizonRadius",200/r6),ambientOcclusionHorizonAngles:g("ambientOcclusionHorizonAngles",2,[1,16]),ambientOcclusionHorizonPauseJitter:p("ambientOcclusionHorizonPauseJitter",!1),ambientOcclusionHorizonDownsample:p("ambientOcclusionHorizonDownsample",!1),ambientOcclusionHorizonTemporal:p("ambientOcclusionHorizonTemporal",!0),ambientOcclusionHorizonSpatial:p("ambientOcclusionHorizonSpatial",!0),ambientOcclusionHorizonBlend:y("ambientOcclusionHorizonBlend",.1)}),X0e=e=>e===3?[-1,1]:e===4?[-1,2]:[-2,2];function o6(e){let[t,r]=X0e(e.ambientOcclusionHorizonFilterWidth),n=e.ambientOcclusionHorizonThickness;return{normals:e.ambientOcclusionHorizonNormals,filterFirst:t,filterLast:r,thickness:k(1-n*n,0,.99),radiusCm:e.ambientOcclusionHorizonRadius*r6,angles:e.ambientOcclusionHorizonAngles,pauseJitter:e.ambientOcclusionHorizonPauseJitter,downscale:e.ambientOcclusionHorizonDownsample?2:1,temporal:e.ambientOcclusionHorizonTemporal,spatial:e.ambientOcclusionHorizonSpatial,blend:e.ambientOcclusionHorizonBlend}}var i6=100,Q0e=["auto","off","on"],s6=A({rayTracedAmbientOcclusion:N("rayTracedAmbientOcclusion","auto",Q0e),rayTracedAmbientOcclusionAllowed:At("rayTracedAmbientOcclusionAllowed",!0,"rayTracingAllowed"),rayTracedAmbientOcclusionEnabled:p("rayTracedAmbientOcclusionEnabled",!1),rayTracedAmbientOcclusionSamplesPerPixel:S("rayTracedAmbientOcclusionSamplesPerPixel",-1,[-1,sn]),rayTracedAmbientOcclusionPostProcessSamplesPerPixel:S("rayTracedAmbientOcclusionPostProcessSamplesPerPixel",1,[1,65536]),rayTracedAmbientOcclusionRadius:g("rayTracedAmbientOcclusionRadius",200/i6,[0,1e4/i6]),rayTracedAmbientOcclusionIntensity:g("rayTracedAmbientOcclusionIntensity",1,[0,1]),rayTracedAmbientOcclusionTwoSidedGeometry:p("rayTracedAmbientOcclusionTwoSidedGeometry",!1),rayTracedAmbientOcclusionMaterials:p("rayTracedAmbientOcclusionMaterials",!1),rayTracedAmbientOcclusionDenoiser:p("rayTracedAmbientOcclusionDenoiser",!0),rayTracedAmbientOcclusionDenoiserReconstructionSamples:S("rayTracedAmbientOcclusionDenoiserReconstructionSamples",16,[1,56]),rayTracedAmbientOcclusionDenoiserPreConvolution:S("rayTracedAmbientOcclusionDenoiserPreConvolution",2,[0,4]),rayTracedAmbientOcclusionDenoiserKernelSpreadFactor:g("rayTracedAmbientOcclusionDenoiserKernelSpreadFactor",4,[0,64]),rayTracedAmbientOcclusionDenoiserTemporalAccumulation:p("rayTracedAmbientOcclusionDenoiserTemporalAccumulation",!0),rayTracedAmbientOcclusionDenoiserHistoryConvolutionSamples:S("rayTracedAmbientOcclusionDenoiserHistoryConvolutionSamples",1,[1,56]),rayTracedAmbientOcclusionDenoiserHistoryConvolutionKernelSpreadFactor:g("rayTracedAmbientOcclusionDenoiserHistoryConvolutionKernelSpreadFactor",7,[0,64])});function a6(e,t={}){let r=e.rayTracedAmbientOcclusion,n=r==="auto"?e.rayTracedAmbientOcclusionEnabled:r==="on";return t.wanted=e.rayTracedAmbientOcclusionAllowed&&n&&e.rayTracedAmbientOcclusionIntensity>0,t.samples=e.rayTracedAmbientOcclusionSamplesPerPixel>=0?e.rayTracedAmbientOcclusionSamplesPerPixel:e.rayTracedAmbientOcclusionPostProcessSamplesPerPixel,t.radius=e.rayTracedAmbientOcclusionRadius,t.intensity=e.rayTracedAmbientOcclusionIntensity,t.twoSided=e.rayTracedAmbientOcclusionTwoSidedGeometry,t.materials=e.rayTracedAmbientOcclusionMaterials,t.denoiser=e.rayTracedAmbientOcclusionDenoiser,t.reconstructionSamples=e.rayTracedAmbientOcclusionDenoiserReconstructionSamples,t.preConvolution=e.rayTracedAmbientOcclusionDenoiserPreConvolution,t.kernelSpread=e.rayTracedAmbientOcclusionDenoiserKernelSpreadFactor,t.temporalAccumulation=e.rayTracedAmbientOcclusionDenoiserTemporalAccumulation,t.historyConvolutionSamples=e.rayTracedAmbientOcclusionDenoiserHistoryConvolutionSamples,t.historyConvolutionSpread=e.rayTracedAmbientOcclusionDenoiserHistoryConvolutionKernelSpreadFactor,t}var fl=100,l6=A({ambientOcclusion:p("ambientOcclusion",!0),ambientOcclusionIntensity:g("ambientOcclusionIntensity",.5,[0,1]),ambientOcclusionStaticShare:g("ambientOcclusionStaticShare",1,[0,1]),ambientOcclusionRadius:g("ambientOcclusionRadius",200/fl,U(.1/fl)),ambientOcclusionRadiusInWorldSpace:p("ambientOcclusionRadiusInWorldSpace",!1),ambientOcclusionFadeDistance:y("ambientOcclusionFadeDistance",8e3/fl),ambientOcclusionFadeRadius:y("ambientOcclusionFadeRadius",5e3/fl),ambientOcclusionPower:g("ambientOcclusionPower",2,U(.1)),ambientOcclusionBias:y("ambientOcclusionBias",3),ambientOcclusionQuality:g("ambientOcclusionQuality",50,U(0)),ambientOcclusionMipBlend:g("ambientOcclusionMipBlend",.6,U(.1)),ambientOcclusionMipScale:g("ambientOcclusionMipScale",1.7,U(.5)),ambientOcclusionMipThreshold:y("ambientOcclusionMipThreshold",.01),ambientOcclusionPassCount:S("ambientOcclusionPassCount",-1,[-1,3]),ambientOcclusionQualityCap:g("ambientOcclusionQualityCap",100,[-100,100]),ambientOcclusionCoarseLevelBias:g("ambientOcclusionCoarseLevelBias",.4,[0,100]),ambientOcclusionRadiusFactor:g("ambientOcclusionRadiusFactor",1,[.1,15]),ambientOcclusionWithViewProbes:p("ambientOcclusionWithViewProbes",!1),ambientOcclusionAsCompute:S("ambientOcclusionAsCompute",0,[0,3]),ambientOcclusionAsComputeSoftening:p("ambientOcclusionAsComputeSoftening",!0),...n6,...s6}),$p={smooth:{ambientOcclusionPassCount:0,ambientOcclusionQualityCap:0,ambientOcclusionCoarseLevelBias:1,ambientOcclusionRadiusFactor:1.2},balanced:{ambientOcclusionPassCount:-1,ambientOcclusionQualityCap:60,ambientOcclusionCoarseLevelBias:1,ambientOcclusionRadiusFactor:1.5},fine:{ambientOcclusionPassCount:-1,ambientOcclusionQualityCap:100,ambientOcclusionCoarseLevelBias:.6,ambientOcclusionRadiusFactor:1.5},cinematic:{ambientOcclusionPassCount:-1,ambientOcclusionQualityCap:100,ambientOcclusionCoarseLevelBias:.4,ambientOcclusionRadiusFactor:1,ambientOcclusionHorizonAngles:4}},Z0e=.1,J0e=(e,t)=>t<0?-t:Math.min(t,e),eye=(e,t,r)=>r?Math.min(e<0?1:e,1):e>=0?e:1+ +(t>70)+ +(t>35),tye=e=>+(e>75)+ +(e>55)+ +(e>25)+ +(e>5);function lst(e){let t=J0e(e.ambientOcclusionQuality,e.ambientOcclusionQualityCap),r=e.ambientOcclusionAsCompute>0,n=eye(e.ambientOcclusionPassCount,t,r),o=e.ambientOcclusionRadius*fl*e.ambientOcclusionRadiusFactor,i=e.ambientOcclusionFadeDistance*fl,s=Math.max(1,e.ambientOcclusionFadeRadius*fl),a=1/s;return{enabled:e.ambientOcclusion&&e.ambientOcclusionIntensity>0&&o>=Z0e&&n>0,intensity:e.ambientOcclusionIntensity,staticFraction:e.ambientOcclusionStaticShare,radiusCm:o,radiusInWorldSpace:e.ambientOcclusionRadiusInWorldSpace,fadeDistanceCm:i,fadeMultiplier:a,fadeAddend:-(i-s)*a,power:e.ambientOcclusionPower,bias:e.ambientOcclusionBias,mipBlend:e.ambientOcclusionMipBlend,mipScale:e.ambientOcclusionMipScale,mipThreshold:e.ambientOcclusionMipThreshold,mipLevelFactor:e.ambientOcclusionCoarseLevelBias,quality:t,levels:n,shaderQuality:tye(t),withViewProbes:e.ambientOcclusionWithViewProbes,method:e.ambientOcclusionAlgorithm,horizon:o6(e),rayTraced:a6(e),compute:r,computeSmooth:e.ambientOcclusionAsComputeSoftening}}function cst(e,{bounce:t,nearOcclusion:r}){return e.rayTraced?.wanted?t?"none":"scene":e.enabled?t?e.withViewProbes&&!r?"probes":"none":"scene":"none"}var uy=A({ambientCubemapTintRed:y("ambientCubemapTintRed",1),ambientCubemapTintGreen:y("ambientCubemapTintGreen",1),ambientCubemapTintBlue:y("ambientCubemapTintBlue",1),ambientCubemapIntensity:y("ambientCubemapIntensity",1)}),c6=16,mst=X(uy);function u6(e={}){return cc(uy,e,"ambientCubemap",rye)}function rye(e){if(e==null)return;let t=oe("ambientCubemap"),r=Cc(e,"ambientCubemap",t);return(!K2(r.size)||r.size<c6)&&t(`size must be a power of two of at least ${c6}, got ${r.size}`),r}var nye=e=>[e.ambientCubemapTintRed*e.ambientCubemapIntensity,e.ambientCubemapTintGreen*e.ambientCubemapIntensity,e.ambientCubemapTintBlue*e.ambientCubemapIntensity],oye=1e-5,gst=e=>e.ambientCubemap?nye(e).some(r=>r*r>=oye):!1;var dy=A({cubeCaptures:p("cubeCaptures",!0),cubeCaptureResolution:S("cubeCaptureResolution",128,[16,1024]),cubeCaptureSupersample:S("cubeCaptureSupersample",1,[1,8]),cubeCaptureNearPlane:F("cubeCaptureNearPlane",.05),cubeCaptureLightPatterns:p("cubeCaptureLightPatterns",!1),cubeCaptureDiffuse:p("cubeCaptureDiffuse",!1),cubeCaptureDiffuseReference:p("cubeCaptureDiffuseReference",!0)}),xst=e=>Y2(e.cubeCaptureResolution),iye=X(dy),bst=e=>Object.fromEntries(Object.keys(dy).map(t=>[t,iye(e,t)]));var sye=["whiteBalance","colorTemperature"],aye=["filmic","standardAces"],lye=["default","srgb","bt1886"],cye=["log","pq"],uye=["Saturation","Contrast","Gamma","Gain","Offset"],dye=["","Shadows","Midtones","Highlights"],fye=["Red","Green","Blue","Master"],s1=dye.flatMap(e=>uye.flatMap(t=>fye.map(r=>({operation:t,zone:e,channel:r,field:`color${t}${e}${r}`})))),pye=e=>e==="Offset"?0:1,hye=Object.fromEntries(s1.map(({operation:e,field:t})=>[t,g(t,pye(e),R)])),d6={...A({tonemappingMethod:N("tonemappingMethod","filmic",aye),acesSceneColourGain:y("acesSceneColourGain",1.5),acesVersion:S("acesVersion",2,[1,2]),acesGamutCompression:g("acesGamutCompression",0,[0,1]),filmSlope:Dg("filmSlope",.88,"a number but 0"),filmToe:g("filmToe",.55,R),filmShoulder:g("filmShoulder",.26,R),filmBlackClip:g("filmBlackClip",0,R),filmWhiteClip:g("filmWhiteClip",.04,R),blueCorrection:g("blueCorrection",.6,[0,1]),expandGamut:y("expandGamut",1),toneCurveAmount:y("toneCurveAmount",1),temperatureType:N("temperatureType","whiteBalance",sye),whiteTemperature:g("whiteTemperature",6500,R),whiteTint:g("whiteTint",0,R),colorCorrectionShadowsMax:g("colorCorrectionShadowsMax",.09,R),colorCorrectionHighlightsMin:g("colorCorrectionHighlightsMin",.5,R),colorCorrectionHighlightsMax:g("colorCorrectionHighlightsMax",1,R),colorMin:g("colorMin",0,[-10,10]),colorMid:g("colorMid",.5,[-10,10]),colorMax:g("colorMax",1,[-10,10]),applyColorGrading:p("applyColorGrading",!0),displayGamma:F("displayGamma",2.2,"a number above 0"),tonemapperGamma:y("tonemapperGamma",0),sdrInverseEotf:N("sdrInverseEotf","default",lye),lutSize:S("lutSize",32,[2,we[1]]),colourTableShaper:N("colourTableShaper","log",cye)}),...hye},f6={cinematic:{lutSize:64,colourTableShaper:"pq"}};var a1=[1,sn],mye=0,gye=30,Sye=[1,100],p6=[0,360],Nn=A({cutTwoPassOcclusion:p("cutTwoPassOcclusion",!0),cutOcclusionCulling:p("cutOcclusionCulling",!0),cutFrustumCulling:p("cutFrustumCulling",!0),cutMinLodCulling:p("cutMinLodCulling",!0),cutDrawDistanceCulling:p("cutDrawDistanceCulling",!0),cutDistanceCullToSphereEdge:p("cutDistanceCullToSphereEdge",!0),cutViewDistanceScale:y("cutViewDistanceScale",1),cutViewDistanceApplySecondaryScale:p("cutViewDistanceApplySecondaryScale",!1),cutViewDistanceSecondaryScale:y("cutViewDistanceSecondaryScale",1),cutViewDistanceFovMinAngle:g("cutViewDistanceFovMinAngle",45,p6),cutViewDistanceFovMinAngleScale:y("cutViewDistanceFovMinAngleScale",1),cutViewDistanceFovMaxAngle:g("cutViewDistanceFovMaxAngle",90,p6),cutViewDistanceFovMaxAngleScale:y("cutViewDistanceFovMaxAngleScale",1),cutClipPlane:pr(p("cutClipPlane",!1)),cutClipPlaneCulling:p("cutClipPlaneCulling",!0),cutViewFiltering:p("cutViewFiltering",!0),cutViewOrthoAutoPlanes:p("cutViewOrthoAutoPlanes",!0),cutViewOrthoAutoPlanesHalfFloat:p("cutViewOrthoAutoPlanesHalfFloat",!0),cutViewOrthoAutoPlanesScaleUnits:p("cutViewOrthoAutoPlanesScaleUnits",!0),cutViewOrthoAutoPlanesDepthScale:g("cutViewOrthoAutoPlanesDepthScale",-1,R),cutViewOrthoAutoPlanesShift:g("cutViewOrthoAutoPlanesShift",0,R),cutViewOrthoNearPlaneCorrection:p("cutViewOrthoNearPlaneCorrection",!0),cutViewOrthoCameraHeightAsViewTarget:p("cutViewOrthoCameraHeightAsViewTarget",!0),cutViewOrthoNearPlane:g("cutViewOrthoNearPlane",0,R),cutViewCaptureDelay:S("cutViewCaptureDelay",4,we),cutLodBiasFollowsUpscale:p("cutLodBiasFollowsUpscale",!0),cutLodBiasOffset:g("cutLodBiasOffset",0,R),cutLodBiasMin:g("cutLodBiasMin",-2,R),cutEdgeScaleBudgetMs:g("cutEdgeScaleBudgetMs",mye,R),cutEdgeScaleMinPercent:g("cutEdgeScaleMinPercent",gye,Sye),cutMaxNodes:S("cutMaxNodes",2*1048576,a1),cutMaxCandidateClusters:S("cutMaxCandidateClusters",16*1048576,a1),cutMaxVisibleClusters:S("cutMaxVisibleClusters",4*1048576,a1)}),fy={smooth:.4,balanced:.6,fine:.8},pl=X(Nn),wye=e=>pl(e,"cutViewDistanceScale")*(pl(e,"cutViewDistanceApplySecondaryScale")?pl(e,"cutViewDistanceSecondaryScale"):1),yye=1e-8;function xye(e,{minAngle:t,minScale:r,maxAngle:n,maxScale:o}){if(Math.abs(r-o)<=yye)return o;let i=n>t?(k(e,t,n)-t)/(n-t):e>=n?1:0;return Qe(r,o,i)}var Rst=(e,t)=>wye(e)*xye(t,{minAngle:pl(e,"cutViewDistanceFovMinAngle"),minScale:pl(e,"cutViewDistanceFovMinAngleScale"),maxAngle:pl(e,"cutViewDistanceFovMaxAngle"),maxScale:pl(e,"cutViewDistanceFovMaxAngleScale")});var h6=A({fieldSkyOcclusion:p("fieldSkyOcclusion",!0),fieldSkyOcclusionQuality:S("fieldSkyOcclusionQuality",2,[0,2]),fieldSkyOcclusionObjects:p("fieldSkyOcclusionObjects",!0),fieldSkyOcclusionStepExponentScale:y("fieldSkyOcclusionStepExponentScale",.5),fieldSkyOcclusionMaxViewDistance:y("fieldSkyOcclusionMaxViewDistance",2e4),fieldSkyOcclusionViewFadeDistanceScale:g("fieldSkyOcclusionViewFadeDistanceScale",.7,[0,.999999]),fieldSkyOcclusionSampleSet:S("fieldSkyOcclusionSampleSet",1,[0,1]),fieldSkyOcclusionJitterConeDirections:p("fieldSkyOcclusionJitterConeDirections",!1),fieldSkyOcclusionUseJitter:p("fieldSkyOcclusionUseJitter",!0),fieldSkyOcclusionTraverseMips:p("fieldSkyOcclusionTraverseMips",!0),fieldSkyOcclusionUseHistory:p("fieldSkyOcclusionUseHistory",!0),fieldSkyOcclusionHistoryStabilityPass:p("fieldSkyOcclusionHistoryStabilityPass",!0),fieldSkyOcclusionHistoryWeight:y("fieldSkyOcclusionHistoryWeight",.85),fieldSkyOcclusionHistoryDistanceThreshold:y("fieldSkyOcclusionHistoryDistanceThreshold",30),fieldSkyOcclusionSpecularMode:S("fieldSkyOcclusionSpecularMode",1,[0,1]),skyLightSpecularOcclusionStrength:y("skyLightSpecularOcclusionStrength",1),fieldSkyOcclusionObjectsPerCullTile:P("fieldSkyOcclusionObjectsPerCullTile",512,1)}),bye=65e3;function Mst(e,t={}){let r=e.fieldSkyOcclusionQuality;return t.allowed=e.fieldSkyOcclusion&&r>=1,t.objects=e.fieldSkyOcclusionObjects&&r>=2,t.stabilityPass=e.fieldSkyOcclusionHistoryStabilityPass&&r>=2,t.stepExponentScale=e.fieldSkyOcclusionStepExponentScale,t.maxViewDistance=Math.min(e.fieldSkyOcclusionMaxViewDistance,bye),t.viewFadeDistanceScale=e.fieldSkyOcclusionViewFadeDistanceScale,t.relaxedSampleSet=e.fieldSkyOcclusionSampleSet!==0,t.jitterConeDirections=e.fieldSkyOcclusionJitterConeDirections,t.useJitter=e.fieldSkyOcclusionUseJitter,t.traverseMips=e.fieldSkyOcclusionTraverseMips,t.useHistory=e.fieldSkyOcclusionUseHistory,t.historyWeight=e.fieldSkyOcclusionHistoryWeight,t.historyDistanceThreshold=e.fieldSkyOcclusionHistoryDistanceThreshold,t.specularMode=e.fieldSkyOcclusionSpecularMode,t.specularStrength=Math.max(e.skyLightSpecularOcclusionStrength,.1),t.objectsPerCullTile=e.fieldSkyOcclusionObjectsPerCullTile,t}var m6=[0,100],Eye=[0,1],Tye=[1,4096],g6=A({dynamicResolutionFrameTimeBudgetMs:y("dynamicResolutionFrameTimeBudgetMs",0),dynamicResolutionThrottlingMaxPercent:g("dynamicResolutionThrottlingMaxPercent",0,m6),dynamicResolutionHeadroomPercent:g("dynamicResolutionHeadroomPercent",10,[0,99]),dynamicResolutionOverBudgetHeadroomPercent:g("dynamicResolutionOverBudgetHeadroomPercent",0,[0,99]),dynamicResolutionHistorySize:S("dynamicResolutionHistorySize",16,Tye),dynamicResolutionFrameWeightExponent:y("dynamicResolutionFrameWeightExponent",.9),dynamicResolutionChangePeriod:P("dynamicResolutionChangePeriod",8,0),dynamicResolutionIncreaseAmortization:g("dynamicResolutionIncreaseAmortization",.9,Eye),dynamicResolutionChangePercentThreshold:g("dynamicResolutionChangePercentThreshold",2,m6),dynamicResolutionMaxOverBudgetFrames:P("dynamicResolutionMaxOverBudgetFrames",2,0),dynamicResolutionUseCpuTimeLogic:p("dynamicResolutionUseCpuTimeLogic",!1)});var S6=A({worldField:p("worldField",!0),worldFieldUpdate:p("worldFieldUpdate",!0),worldFieldClipmaps:S("worldFieldClipmaps",4,[0,6]),worldFieldViewDistance:F("worldFieldViewDistance",2e4),worldFieldClipmapExponent:g("worldFieldClipmapExponent",2,U(1)),worldFieldResolution:P("worldFieldResolution",128,1),worldFieldMipFactor:S("worldFieldMipFactor",4,[1,8]),worldFieldOccupancyRatio:g("worldFieldOccupancyRatio",.3,[.1,1]),worldFieldCacheMostlyStaticSeparately:p("worldFieldCacheMostlyStaticSeparately",!0),worldFieldPartialUpdates:p("worldFieldPartialUpdates",!0),worldFieldStaggeredUpdates:p("worldFieldStaggeredUpdates",!0),worldFieldUpdatesPerFrame:P("worldFieldUpdatesPerFrame",2,1),worldFieldForceFullUpdate:p("worldFieldForceFullUpdate",!1),worldFieldForceUpdateOnce:p("worldFieldForceUpdateOnce",!1),worldFieldFastCameraMode:p("worldFieldFastCameraMode",!1),worldFieldCameraVelocityDecay:y("worldFieldCameraVelocityDecay",.7),worldFieldAverageCulledObjectsPerCell:S("worldFieldAverageCulledObjectsPerCell",512,[1,8192]),worldFieldRecacheOnStreaming:p("worldFieldRecacheOnStreaming",!0),worldFieldForceRecacheOnStreaming:p("worldFieldForceRecacheOnStreaming",!1),worldFieldDebugShowStats:p("worldFieldDebugShowStats",!1),worldFieldStartDistance:y("worldFieldStartDistance",100),worldFieldMinMeshRadius:y("worldFieldMinMeshRadius",20),worldFieldMinMeshRadiusInVoxels:y("worldFieldMinMeshRadiusInVoxels",.5),worldFieldTraceResolution:P("worldFieldTraceResolution",252,1),worldFieldTraceClipmapExtent:F("worldFieldTraceClipmapExtent",2500),worldFieldTraceViewDistance:F("worldFieldTraceViewDistance",8e4),worldFieldCoveredExpandSurfaceScale:y("worldFieldCoveredExpandSurfaceScale",1),worldFieldNotCoveredExpandSurfaceScale:y("worldFieldNotCoveredExpandSurfaceScale",.6),worldFieldSimpleCoverageBasedExpand:p("worldFieldSimpleCoverageBasedExpand",!1),worldFieldNotCoveredMinStepScale:y("worldFieldNotCoveredMinStepScale",4),worldFieldDitheredTransparencyStepThreshold:y("worldFieldDitheredTransparencyStepThreshold",.5),worldFieldDitheredTransparencyTraceThreshold:y("worldFieldDitheredTransparencyTraceThreshold",.9),meshFieldMaxObjectRadius:y("meshFieldMaxObjectRadius",1e5),meshFieldSurfaceBiasExpand:y("meshFieldSurfaceBiasExpand",.25),meshFieldBrickAtlasSize:P("meshFieldBrickAtlasSize",128,1),meshFieldBrickAtlasDepth:P("meshFieldBrickAtlasDepth",32,1),meshFieldUploadKiB:P("meshFieldUploadKiB",8192,1),meshFieldBlockBricks:P("meshFieldBlockBricks",16,1),meshFieldForceMips:S("meshFieldForceMips",0,[0,3]),meshFieldReverseAllocation:p("meshFieldReverseAllocation",!1),runtimeMeshFields:p("runtimeMeshFields",!0)});var Aye=["sh","adhoc","uniform"],Oye=["afterTranslucent","beforeTranslucent","afterSeparateTranslucent","afterTranslucentBeforeDepthOfField"],Lye=["closest","average","max"],Rye=["randomized","none","constant"],_ye=()=>A({hairStrands:p("hairStrands",!1),hairVisibilitySamplesPerPixel:S("hairVisibilitySamplesPerPixel",8,[2,8]),hairVisibilityMeanSamplesPerPixel:g("hairVisibilityMeanSamplesPerPixel",.75,[0,1]),hairVisibilityFullCoverageThreshold:g("hairVisibilityFullCoverageThreshold",.98,[.1,1]),hairVisibilitySortByDepth:p("hairVisibilitySortByDepth",!1),hairVisibilityResolutionScaleAware:p("hairVisibilityResolutionScaleAware",!0),hairVisibilityComputeRaster:p("hairVisibilityComputeRaster",!1),hairVisibilityComputeRasterForward:p("hairVisibilityComputeRasterForward",!1),hairVisibilityComputeRasterNumBinners:S("hairVisibilityComputeRasterNumBinners",32,[1,256]),hairVisibilityComputeRasterNumRasterizers:S("hairVisibilityComputeRasterNumRasterizers",256,[1,1024]),hairVisibilityComputeRasterMaxTiles:S("hairVisibilityComputeRasterMaxTiles",65536,[1024,262144]),hairVisibilityNaiveRaster:p("hairVisibilityNaiveRaster",!1),hairVisibilityTileCompaction:p("hairVisibilityTileCompaction",!1),hairVisibilityClassification:p("hairVisibilityClassification",!1),hairVisibilityComputeRasterTileSize:S("hairVisibilityComputeRasterTileSize",32,[8,32]),hairVisibilityNumClassifiers:S("hairVisibilityNumClassifiers",32,[1,256]),hairVisibilityComputeRasterNumRasterizersNaive:S("hairVisibilityComputeRasterNumRasterizersNaive",256,[1,1024]),hairVisibilityCoverageMapping:p("hairVisibilityCoverageMapping",!1),hairVelocityType:N("hairVelocityType","closest",Lye),hairVelocityThreshold:S("hairVelocityThreshold",1,[0,512]),hairVisibilityWriteVelocityCoverageThreshold:g("hairVisibilityWriteVelocityCoverageThreshold",0,[0,1]),hairStableRasterization:p("hairStableRasterization",!1),hairScatterSceneLighting:p("hairScatterSceneLighting",!1),hairStrandsComposition:N("hairStrandsComposition","afterTranslucent",Oye),hairCastContactShadow:p("hairCastContactShadow",!0),hairRenderMarkedDepth:p("hairRenderMarkedDepth",!1),curveDrawing:p("curveDrawing",!1),curveDrawingSoftwareRaster:p("curveDrawingSoftwareRaster",!0),curveDrawingBinnerCount:S("curveDrawingBinnerCount",32,[1,256]),curveDrawingRasterizerCount:S("curveDrawingRasterizerCount",256,[1,1024]),curveDrawingMinCoverage:g("curveDrawingMinCoverage",.05,[0,1]),hairMarkedDepthCoverageThreshold:g("hairMarkedDepthCoverageThreshold",0,[0,1]),hairRasterizationScale:y("hairRasterizationScale",.5),hairShadowRasterizationScale:y("hairShadowRasterizationScale",1),hairStableRasterizationScale:g("hairStableRasterizationScale",1,U(1)),hairCastShadowWhenOutOfView:p("hairCastShadowWhenOutOfView",!0),hairOutOfViewShadowDistance:y("hairOutOfViewShadowDistance",20)}),vye=()=>A({hairVoxelization:p("hairVoxelization",!0),hairVoxelizationAabbScale:g("hairVoxelizationAabbScale",1,[.01,10]),hairVoxelDensityScale:y("hairVoxelDensityScale",2),hairVoxelDensityScaleShadow:g("hairVoxelDensityScaleShadow",-1,R),hairVoxelDepthBiasScaleShadow:y("hairVoxelDepthBiasScaleShadow",2),hairVoxelSteppingScale:g("hairVoxelSteppingScale",1.15,[1,10]),hairVoxelSteppingScaleShadow:g("hairVoxelSteppingScaleShadow",-1,R),hairVoxelDensityScaleTransmittance:g("hairVoxelDensityScaleTransmittance",-1,R),hairVoxelDepthBiasScaleTransmittance:y("hairVoxelDepthBiasScaleTransmittance",3),hairVoxelSteppingScaleTransmittance:g("hairVoxelSteppingScaleTransmittance",-1,R),hairVoxelDensityScaleAO:g("hairVoxelDensityScaleAO",-1,R),hairVoxelDensityScaleRaytracing:g("hairVoxelDensityScaleRaytracing",-1,R),hairVoxelSteppingScaleRaytracing:g("hairVoxelSteppingScaleRaytracing",-1,R),hairVoxelDepthBiasScaleEnvironment:y("hairVoxelDepthBiasScaleEnvironment",1.8),hairVoxelSteppingScaleEnvironment:g("hairVoxelSteppingScaleEnvironment",-1,R),hairEnvironmentIntegration:N("hairEnvironmentIntegration","sh",Aye),hairSkyLightingSampleCount:S("hairSkyLightingSampleCount",16,[1,256]),hairSkyLightingDistanceThreshold:g("hairSkyLightingDistanceThreshold",10,U(1)),hairSkyLightingScreenTraceOcclusion:p("hairSkyLightingScreenTraceOcclusion",!1),hairVoxelDensityScaleEnvironment:g("hairVoxelDensityScaleEnvironment",-1,R)}),Mye=()=>A({hairSkyAO:p("hairSkyAO",!0),hairSkyAOSampleCount:S("hairSkyAOSampleCount",4,[1,256]),hairSkyAODistanceThreshold:g("hairSkyAODistanceThreshold",10,U(1)),hairTransmittanceSuperSampling:p("hairTransmittanceSuperSampling",!1),hairTransmittanceMipTraversal:p("hairTransmittanceMipTraversal",!0),hairVoxelForceTransmittanceAndShadow:p("hairVoxelForceTransmittanceAndShadow",!1),hairTableIncidentAngleCount:P("hairTableIncidentAngleCount",64,1),hairTableRoughnessCount:P("hairTableRoughnessCount",64,1),hairTableAbsorptionCount:P("hairTableAbsorptionCount",16,1),hairTableSampleCountScale:P("hairTableSampleCountScale",1,1),hairComponentR:p("hairComponentR",!0),hairComponentTT:p("hairComponentTT",!0),hairComponentTRT:p("hairComponentTRT",!0),hairComponentLocalScattering:p("hairComponentLocalScattering",!0),hairComponentGlobalScattering:p("hairComponentGlobalScattering",!0),hairComponentTTModel:p("hairComponentTTModel",!1),hairDeepShadowResolution:S("hairDeepShadowResolution",2048,[64,8192]),hairDeepShadowMinResolution:S("hairDeepShadowMinResolution",64,[16,8192]),hairDeepShadowMaxFrustumAngle:g("hairDeepShadowMaxFrustumAngle",90,[10,170]),hairDeepShadowAabbScale:y("hairDeepShadowAabbScale",1),hairDeepShadowKernelType:S("hairDeepShadowKernelType",2,[0,4]),hairDeepShadowMaskKernelType:S("hairDeepShadowMaskKernelType",4,[0,4]),hairDeepShadowRandomType:S("hairDeepShadowRandomType",2,[0,2]),hairDeepShadowKernelAperture:g("hairDeepShadowKernelAperture",1,R),hairDeepShadowDensityScale:y("hairDeepShadowDensityScale",2),hairDeepShadowDepthBiasScale:y("hairDeepShadowDepthBiasScale",.05),hairVoxelWorldSize:g("hairVoxelWorldSize",.3,[.01,100]),hairVoxelPageResolution:S("hairVoxelPageResolution",32,[2,256]),hairVoxelPageCountPerDim:P("hairVoxelPageCountPerDim",14,1),hairVoxelSizeInPixel:S("hairVoxelSizeInPixel",1,[1,50]),hairVoxelAdaptive:p("hairVoxelAdaptive",!0),hairVoxelAdaptiveCorrectionSpeed:g("hairVoxelAdaptiveCorrectionSpeed",.1,[0,1]),hairVoxelAdaptiveCorrectionThreshold:g("hairVoxelAdaptiveCorrectionThreshold",.9,[0,1]),hairVoxelGpuDriven:p("hairVoxelGpuDriven",!0),hairVoxelGpuDrivenMinPageIndexResolution:P("hairVoxelGpuDrivenMinPageIndexResolution",32,1),hairVoxelGpuDrivenMaxPageIndexResolution:P("hairVoxelGpuDrivenMaxPageIndexResolution",64,1),hairVoxelInvalidateEmptyPageIndex:p("hairVoxelInvalidateEmptyPageIndex",!0),hairVoxelInjectOpaqueDepth:p("hairVoxelInjectOpaqueDepth",!0),hairVoxelInjectOpaqueBiasCount:P("hairVoxelInjectOpaqueBiasCount",3,0),hairVoxelInjectOpaqueMarkCount:P("hairVoxelInjectOpaqueMarkCount",6,0),hairVoxelJitter:N("hairVoxelJitter","randomized",Rye),shadowMarchSamplesPerRayHair:S("shadowMarchSamplesPerRayHair",1,[1,yS])}),Dye=["linear","mip"],Pye=()=>A({hairWriteGBufferData:S("hairWriteGBufferData",1,[0,3]),hairCastShadowWhenOutOfViewDebug:p("hairCastShadowWhenOutOfViewDebug",!1),hairDeepShadowDebugIndex:P("hairDeepShadowDebugIndex",0,0),hairDeepShadowDebugScale:y("hairDeepShadowDebugScale",20),hairDeepShadowDebugMacroBounds:p("hairDeepShadowDebugMacroBounds",!1),hairDeepShadowDebugShadowBounds:p("hairDeepShadowDebugShadowBounds",!1),hairVoxelDebugTraversal:N("hairVoxelDebugTraversal","linear",Dye),hairVoxelDebugDrawVoxels:p("hairVoxelDebugDrawVoxels",!0),hairVoxelDebugDrawPages:p("hairVoxelDebugDrawPages",!1),hairVoxelDebugForcedMip:S("hairVoxelDebugForcedMip",-1,[-1,8])}),l1=A({..._ye(),...vye(),...Mye(),...Pye()}),Bst=X(l1);var c1=A({markedDepth:S("markedDepth",1,[0,3]),markedDepthTemporalAAJitter:p("markedDepthTemporalAAJitter",!0)}),Gst=X(c1),Hst=e=>e===3;var Cye=1<<21,w6="an angle in radians above 0 and below \u03C0/2",hl=A({marksCapacity:S("marksCapacity",2e4,[1,Cye]),marksLifetime:F("marksLifetime",300),marksFadeTime:y("marksFadeTime",60),marksRubberColor:g("marksRubberColor",.02,[0,1]),marksRubberRoughness:g("marksRubberRoughness",.55,[0,1]),marksMaxOpacity:g("marksMaxOpacity",.85,[0,1]),marksThickness:F("marksThickness",.15),marksMaxSurfaceAngle:us("marksMaxSurfaceAngle",60*ce,me,w6,!0),marksSegmentLength:F("marksSegmentLength",.25),marksTurnAngle:us("marksTurnAngle",8*ce,me,w6,!0)}),$st=X(hl);var xu=A({vehicleSoundsEngineVolume:y("vehicleSoundsEngineVolume",1),vehicleSoundsTyreVolume:y("vehicleSoundsTyreVolume",1),vehicleSoundsImpactVolume:y("vehicleSoundsImpactVolume",1),vehicleSoundsImpactMinSpeed:F("vehicleSoundsImpactMinSpeed",.15),vehicleSoundsImpactFullSpeed:F("vehicleSoundsImpactFullSpeed",15.6),vehicleSoundsDistance:F("vehicleSoundsDistance",240),vehicleSoundsDoppler:y("vehicleSoundsDoppler",1)});var u1=A({postProcessMaterials:p("postProcessMaterials",!0),postProcessDisableMaterials:p("postProcessDisableMaterials",!1),postProcessPermitStencilTest:p("postProcessPermitStencilTest",!0),postProcessPermitBlendModes:p("postProcessPermitBlendModes",!0)}),Qst=X(u1);var d1=A({densityVolumes:p("densityVolumes",!0),densityVolumesAllowed:p("densityVolumesAllowed",!0),densityVolumesShadows:p("densityVolumesShadows",!1),densityVolumesTranslucency:p("densityVolumesTranslucency",!1),densityVolumesVelocity:p("densityVolumesVelocity",!1),densityVolumesComposition:S("densityVolumesComposition",0,[0,1]),densityVolumesShadowsResolution:S("densityVolumesShadowsResolution",512,[1,4096]),densityVolumesShadowsPrecision:S("densityVolumesShadowsPrecision",0,[0,1]),densityVolumesShadowsNearClippingDistance:g("densityVolumesShadowsNearClippingDistance",1,[0,1e6]),densityVolumesShadowsStepSize:g("densityVolumesShadowsStepSize",2,[.001,1e6]),densityVolumesDownsampleFactor:S("densityVolumesDownsampleFactor",1,[1,8]),densityVolumesJitter:p("densityVolumesJitter",!0),densityVolumesMaxStepCount:S("densityVolumesMaxStepCount",512,[1,65536]),densityVolumesStepSize:g("densityVolumesStepSize",-1,R),densityVolumesShadowStepSize:g("densityVolumesShadowStepSize",-1,R),densityVolumesMaxTraceDistance:g("densityVolumesMaxTraceDistance",3e4,[0,1e9]),densityVolumesMaxShadowTraceDistance:g("densityVolumesMaxShadowTraceDistance",3e4,[0,1e9]),densityVolumesLightingCache:S("densityVolumesLightingCache",2,[0,2]),densityVolumesLightingCacheDownsampleFactor:S("densityVolumesLightingCacheDownsampleFactor",0,[0,64]),densityVolumesDepthSort:p("densityVolumesDepthSort",!0),densityVolumesHeightFog:p("densityVolumesHeightFog",!0),densityVolumesVolumetricFog:p("densityVolumesVolumetricFog",!0),densityVolumesFogInscattering:S("densityVolumesFogInscattering",2,[0,2]),densityVolumesIndirectLightingMode:S("densityVolumesIndirectLightingMode",0,[0,2]),densityVolumesIndirectLighting:g("densityVolumesIndirectLighting",0,[0,1e6]),densityVolumesScalability:S("densityVolumesScalability",3,[0,3]),densityVolumesUseExistenceMask:p("densityVolumesUseExistenceMask",!0),densityVolumesAmbientOcclusion:p("densityVolumesAmbientOcclusion",!1),densityVolumesAmbientOcclusionDownsampleFactor:g("densityVolumesAmbientOcclusionDownsampleFactor",4,[.125,32]),densityVolumesAmbientOcclusionRayCountX:S("densityVolumesAmbientOcclusionRayCountX",4,[1,8]),densityVolumesAmbientOcclusionRayCountY:S("densityVolumesAmbientOcclusionRayCountY",4,[1,8]),densityVolumesAmbientOcclusionMaxTraceDistance:g("densityVolumesAmbientOcclusionMaxTraceDistance",1e3,[0,1e9]),densityVolumesAmbientOcclusionMaxStepCount:S("densityVolumesAmbientOcclusionMaxStepCount",64,[1,65536]),densityVolumesPreshading:p("densityVolumesPreshading",!1),densityVolumesPreshadingMipLevel:S("densityVolumesPreshadingMipLevel",0,[0,10]),densityVolumesPreshadingPixelFormat:S("densityVolumesPreshadingPixelFormat",2,[0,3]),densityVolumesPreshadingCLOD:S("densityVolumesPreshadingCLOD",1,[0,2]),densityVolumesCLOD:p("densityVolumesCLOD",!0),densityVolumesCLODBias:g("densityVolumesCLODBias",0,R),densityVolumesVolumeResolutionX:S("densityVolumesVolumeResolutionX",0,[0,1024]),densityVolumesVolumeResolutionY:S("densityVolumesVolumeResolutionY",0,[0,1024]),densityVolumesVolumeResolutionZ:S("densityVolumesVolumeResolutionZ",0,[0,1024]),densityVolumesLightDirectional:p("densityVolumesLightDirectional",!0),densityVolumesLightPoint:p("densityVolumesLightPoint",!0),densityVolumesLightSpot:p("densityVolumesLightSpot",!0),densityVolumesLightRect:p("densityVolumesLightRect",!0),densityVolumesUpsample:S("densityVolumesUpsample",2,[0,2]),densityVolumesFilter:S("densityVolumesFilter",2,[0,3]),densityVolumesFilterWidth:S("densityVolumesFilterWidth",3,[0,11]),densityVolumesShadowsPipeline:S("densityVolumesShadowsPipeline",0,[0,1]),densityVolumesFrustumGrid:p("densityVolumesFrustumGrid",!0),densityVolumesFrustumGridShadingRate:g("densityVolumesFrustumGridShadingRate",4,[.1,1e6]),densityVolumesFrustumGridNearPlaneDistance:g("densityVolumesFrustumGridNearPlaneDistance",1,R),densityVolumesFrustumGridFarPlaneDistance:g("densityVolumesFrustumGridFarPlaneDistance",-1,R),densityVolumesFrustumGridDepthSliceCount:S("densityVolumesFrustumGridDepthSliceCount",512,[1,65536]),densityVolumesOrthoGrid:p("densityVolumesOrthoGrid",!0),densityVolumesOrthoGridShadingRate:g("densityVolumesOrthoGridShadingRate",4,[.1,1e6]),densityVolumesBottomLevelGridResolution:S("densityVolumesBottomLevelGridResolution",4,[1,4]),densityVolumesIndirectionGrid:p("densityVolumesIndirectionGrid",!0),densityVolumesIndirectionGridResolution:S("densityVolumesIndirectionGridResolution",4,[1,4]),densityVolumesMinimumVoxelSizeInFrustum:g("densityVolumesMinimumVoxelSizeInFrustum",.1,[.01,1e9]),densityVolumesMinimumVoxelSizeOutsideFrustum:g("densityVolumesMinimumVoxelSizeOutsideFrustum",100,[.01,1e9]),densityVolumesFarPlaneAutoTransition:p("densityVolumesFarPlaneAutoTransition",!0),densityVolumesTopLevelBitmask:p("densityVolumesTopLevelBitmask",!1),densityVolumesMajorantGrid:p("densityVolumesMajorantGrid",!0),densityVolumesMajorantGridMax:p("densityVolumesMajorantGridMax",!1),densityVolumesSparseVoxel:p("densityVolumesSparseVoxel",!1),densityVolumesSparseVoxelGenerationMipBias:S("densityVolumesSparseVoxelGenerationMipBias",0,[0,10]),densityVolumesSparseVoxelPerTileCulling:p("densityVolumesSparseVoxelPerTileCulling",!1),densityVolumesSparseVoxelRefinement:p("densityVolumesSparseVoxelRefinement",!1),densityVolumesShadowsCameraDownsampleFactor:S("densityVolumesShadowsCameraDownsampleFactor",2,[1,16]),densityVolumesShadowsMaxSampleCount:S("densityVolumesShadowsMaxSampleCount",8,[1,64]),densityVolumesShadowsAbsoluteErrorThreshold:g("densityVolumesShadowsAbsoluteErrorThreshold",0,[0,1e6]),densityVolumesShadowsRelativeErrorThreshold:g("densityVolumesShadowsRelativeErrorThreshold",.05,[0,1e6]),densityVolumesShadowsUseAdaptiveVolumeShadowCompression:p("densityVolumesShadowsUseAdaptiveVolumeShadowCompression",!0),densityVolumesShadowsDebugTweak:S("densityVolumesShadowsDebugTweak",0,[0,1024]),densityVolumesShadowsShadingRate:g("densityVolumesShadowsShadingRate",1,[.1,1e6]),densityVolumesShadowsOutOfFrustumShadingRate:g("densityVolumesShadowsOutOfFrustumShadingRate",2,[.1,1e6]),densityVolumesShadowsJitter:p("densityVolumesShadowsJitter",!1),densityVolumesOrthoGridMaxBottomLevelMemoryInMegabytes:S("densityVolumesOrthoGridMaxBottomLevelMemoryInMegabytes",128,[1,4096]),densityVolumesFrustumGridMaxBottomLevelMemoryInMegabytes:S("densityVolumesFrustumGridMaxBottomLevelMemoryInMegabytes",128,[1,4096]),densityVolumesBottomLevelGridHomogeneousAggregation:p("densityVolumesBottomLevelGridHomogeneousAggregation",!0),densityVolumesBottomLevelGridHomogeneousAggregationThreshold:g("densityVolumesBottomLevelGridHomogeneousAggregationThreshold",.001,[0,1e6]),densityVolumesShadowsLightDirectional:p("densityVolumesShadowsLightDirectional",!0),densityVolumesShadowsLightPoint:p("densityVolumesShadowsLightPoint",!0),densityVolumesShadowsLightSpot:p("densityVolumesShadowsLightSpot",!0),densityVolumesShadowsLightRect:p("densityVolumesShadowsLightRect",!0),densityVolumesDebug:S("densityVolumesDebug",0,[0,9]),densityVolumesShadowsType:S("densityVolumesShadowsType",1,[0,1]),densityVolumesHardwareRayTracing:At("densityVolumesHardwareRayTracing",!1,"rayTracingAllowed")}),eat=X(d1);var Iye=["reference","planes"],kye=["finer","reference"],Fye=["whenMissing","always","off"],Nye=[0,2],Bye=[0,30],Uye=[1,1024],f1=A({hizTrace:N("hizTrace","reference",Iye),hizFoldTransparents:p("hizFoldTransparents",!1),hizTransparentTest:N("hizTransparentTest","finer",kye),hizFullResDepth:p("hizFullResDepth",!0),lightGridHizCull:p("lightGridHizCull",!0),lightGridLinkedLists:p("lightGridLinkedLists",!0),lightGridMaxCulledLightsPerCell:S("lightGridMaxCulledLightsPerCell",32,Uye),lightGridHeatmap:S("lightGridHeatmap",0,[0,3]),lightGridHeatmapMax:S("lightGridHeatmapMax",8,[1,1024]),lightGridHeatmapSlice:S("lightGridHeatmapSlice",-1,[-1,1023]),hizPrime:N("hizPrime","off",Fye),hizPrimeSizeBias:S("hizPrimeSizeBias",2,Bye),hizPrimeDepthBias:g("hizPrimeDepthBias",1.5,R),hizPrimeErrorScale:g("hizPrimeErrorScale",32,R),hizPrimeFarFieldOnly:p("hizPrimeFarFieldOnly",!0),instanceOcclusionTests:p("instanceOcclusionTests",!1),reducedOcclusionQueries:p("reducedOcclusionQueries",!1),hzbOcclusion:S("hzbOcclusion",0,Nye),hzbOcclusionNeverTestDistance:y("hzbOcclusionNeverTestDistance",0),hzbOcclusionExpandAmount:y("hzbOcclusionExpandAmount",0),hzbOcclusionExpandNewlyAmount:y("hzbOcclusionExpandNewlyAmount",0),hzbOcclusionExpandScreenSpace:y("hzbOcclusionExpandScreenSpace",0),hzbOcclusionExpandNewlyScreenSpace:y("hzbOcclusionExpandNewlyScreenSpace",0),hzbOcclusionFramesNotTestedToExpand:S("hzbOcclusionFramesNotTestedToExpand",5,[0,1e6]),hzbOcclusionFramesToExpandNewly:S("hzbOcclusionFramesToExpandNewly",2,[0,1e6])}),nat=X(f1);var Vye=["grey","colour"],Gye=32,Hye=[2,16],p1=A({lightPatternAtlas:p("lightPatternAtlas",!0),lightPatternSlotResolution:S("lightPatternSlotResolution",128,[Gye,32768]),lightPatternAtlasSize:S("lightPatternAtlasSize",4,Hye),lightPatternMaxLights:S("lightPatternMaxLights",-1,[-1,we[1]]),lightPatternFormat:N("lightPatternFormat","grey",Vye),lightPatternDeferred:p("lightPatternDeferred",!0),lightPatternFog:p("lightPatternFog",!0),lightPatternFogSupersample:F("lightPatternFogSupersample",2),lightPatternBounce:p("lightPatternBounce",!0),lightPatternTranslucent:p("lightPatternTranslucent",!1)});function sat(e,t){let r=e.lightPatternAtlasSize,n=e.lightPatternSlotResolution;return r*n>t&&(n=Math.floor(t/r)),{edge:r,slot:n,side:r*n}}var aat=X(p1);var h1=A({lightProfileAtlasResolution:S("lightProfileAtlasResolution",256,[16,4096]),lightProfileAtlasMaxProfiles:S("lightProfileAtlasMaxProfiles",32,[1,j2]),lightProfileAtlasForceUpdate:p("lightProfileAtlasForceUpdate",!1),lightProfileAtlasDebug:p("lightProfileAtlasDebug",!1)}),dat=X(h1);var m1=A({visualizeLightShape:p("visualizeLightShape",!1),lightShapeViewFadeTime:g("lightShapeViewFadeTime",.5,R),lightShapeViewMaxWaitDistance:g("lightShapeViewMaxWaitDistance",4e3,R),lightShapeViewMaxWait:g("lightShapeViewMaxWait",2.5,R),lightShapeViewMaxOpacity:g("lightShapeViewMaxOpacity",.1,R)}),mat=X(m1),gat=e=>({fadeDuration:Math.max(e("lightShapeViewFadeTime"),0),maxDelayDistance:Math.max(e("lightShapeViewMaxWaitDistance"),100),maxDelay:Math.max(e("lightShapeViewMaxWait"),0),maxOpacity:k(e("lightShapeViewMaxOpacity"),0,1)});var g1=A({rectLightAtlasSizeLimit:S("rectLightAtlasSizeLimit",4096,[64,16384]),rectLightAtlasView:p("rectLightAtlasView",!1),rectLightAtlasViewLevel:S("rectLightAtlasViewLevel",0,[0,15]),rectLightAtlasRebuildNow:p("rectLightAtlasRebuildNow",!1),rectLightAtlasClearOnChange:p("rectLightAtlasClearOnChange",!1),rectLightAtlasClear:p("rectLightAtlasClear",!1),rectLightAtlasViewClear:p("rectLightAtlasViewClear",!1),rectLightAtlasSmoothing:S("rectLightAtlasSmoothing",0,[0,1]),rectLightAtlasTextureShareLimit:S("rectLightAtlasTextureShareLimit",2,[1,16]),rectLightAtlasTexelFormat:S("rectLightAtlasTexelFormat",0,[0,1]),sampledLightsTexturedRectLights:p("sampledLightsTexturedRectLights",!0)}),yat=X(g1);var S1=A({allowCheapLights:p("allowCheapLights",!0),hairSimpleLights:p("hairSimpleLights",!0),sampledSimpleLights:S("sampledSimpleLights",1,[0,2])}),Eat=X(S1);var Wye=!0,zye=32,jye=!0,$ye=10,Yye=1e3,w1=A({softwareRaster:p("softwareRaster",Wye),hardwareRasterEdgePixels:F("hardwareRasterEdgePixels",zye,"a finite number of pixels above zero"),depthBinning:p("depthBinning",jye),depthBinsMinZ:F("depthBinsMinZ",$ye,"a finite number of metres above zero"),depthBinsMaxZ:F("depthBinsMaxZ",Yye,"a finite number of metres above zero")}),Oat=X(w1);var y6=64,Kye=["surfaceAtlas","hitShading","hitShadingForReflections"],x6=["off","hard","soft"],qye=["off","on","standalone"],b6=["opaque","masked","fractional"],Xye=2048,Qye=65536,E6=A({reflectionHardwareRayTracingHitShading:p("reflectionHardwareRayTracingHitShading",!1),reflectionHardwareRayTracingBucketMaterials:p("reflectionHardwareRayTracingBucketMaterials",!0),hardwareTraceShadingMode:N("hardwareTraceShadingMode","surfaceAtlas",Kye),hardwareRayTracingHitShadingAllowed:p("hardwareRayTracingHitShadingAllowed",!0),hardwareRayTracingHitShadingDirectLighting:p("hardwareRayTracingHitShadingDirectLighting",!0),hardwareRayTracingHitShadingShadowMode:N("hardwareRayTracingHitShadingShadowMode","soft",x6),hardwareRayTracingHitShadingSkylight:N("hardwareRayTracingHitShadingSkylight","standalone",qye),hardwareRayTracingHitShadingCubeCaptures:p("hardwareRayTracingHitShadingCubeCaptures",!1),hardwareRayTracingHitShadingForceOpaque:p("hardwareRayTracingHitShadingForceOpaque",!1),hardwareRayTracingHitShadingShadowTranslucencyMode:N("hardwareRayTracingHitShadingShadowTranslucencyMode","masked",b6),reflectionMaxBounces:S("reflectionMaxBounces",1,[1,y6]),reflectionRayTracedTranslucentRefractions:p("reflectionRayTracedTranslucentRefractions",!0),reflectionMaxRefractionBounces:S("reflectionMaxRefractionBounces",0,[0,y6-1]),hitLightCellCount:S("hitLightCellCount",256,[1,Xye]),hitLightCellMaxLights:S("hitLightCellMaxLights",128,[1,Qye]),hitLightCellAxis:S("hitLightCellAxis",-1,[-1,3])});function _at(e){let t=e.hardwareRayTracingHitShadingAllowed,r=t&&e.hardwareTraceShadingMode!=="surfaceAtlas",n=e.hardwareRayTracingHitShadingSkylight,o=e.reflectionRayTracedTranslucentRefractions?e.reflectionMaxRefractionBounces:0;return{on:r||t&&e.reflectionHardwareRayTracingHitShading,forced:r,probes:t&&e.hardwareTraceShadingMode==="hitShading",bucket:e.reflectionHardwareRayTracingBucketMaterials,direct:e.hardwareRayTracingHitShadingDirectLighting,shadowMode:x6.indexOf(e.hardwareRayTracingHitShadingShadowMode),skylight:n==="on",captures:e.hardwareRayTracingHitShadingCubeCaptures,forceOpaque:e.hardwareRayTracingHitShadingForceOpaque,translucencyMode:b6.indexOf(e.hardwareRayTracingHitShadingShadowTranslucencyMode),bounces:e.reflectionMaxBounces,refractions:o,vertices:e.reflectionMaxBounces*(1+o),lightGrid:{resolution:e.hitLightCellCount,maxCount:e.hitLightCellMaxLights,axis:e.hitLightCellAxis<0?3:e.hitLightCellAxis}}}var vat=e=>e.on&&(e.direct||e.skylight),Mat=e=>e.probes&&(e.direct||e.skylight);var Zye=["raster","rayTraced"],T6=e=>[e,"off","on"],A6=A({translucencyType:N("translucencyType","raster",Zye),rayTracedTranslucency:N("rayTracedTranslucency","translucencyType",T6("translucencyType")),tracedTranslucencyAsOpaque:p("tracedTranslucencyAsOpaque",!1),rayTracedTranslucencyRefraction:N("rayTracedTranslucencyRefraction","translucentRefractionTrace",T6("translucentRefractionTrace")),translucentRefractionTrace:p("translucentRefractionTrace",!1),tracedTranslucencyNestedReflections:p("tracedTranslucencyNestedReflections",!0),tracedTranslucencyThroughputCutoff:y("tracedTranslucencyThroughputCutoff",.001),tracedTranslucencyDownsample:S("tracedTranslucencyDownsample",1,[1,2]),tracedTranslucencyPrimaryHitLimit:S("tracedTranslucencyPrimaryHitLimit",-1,[-1,64]),translucencyMaxPrimaryHitEvents:S("translucencyMaxPrimaryHitEvents",4,[1,64]),tracedTranslucencySecondaryHitLimit:S("tracedTranslucencySecondaryHitLimit",-1,[-1,64]),translucencyMaxSecondaryHitEvents:S("translucencyMaxSecondaryHitEvents",2,[0,64]),tracedTranslucencyRayClamp:y("tracedTranslucencyRayClamp",1e3)}),Iat=e=>e.rayTracedTranslucency==="translucencyType"?e.translucencyType==="rayTraced":e.rayTracedTranslucency==="on",Jye=e=>e.rayTracedTranslucencyRefraction==="translucentRefractionTrace"?e.translucentRefractionTrace:e.rayTracedTranslucencyRefraction==="on",kat=e=>Jye(e)?1:e.tracedTranslucencyDownsample,Fat=e=>k(e.tracedTranslucencyPrimaryHitLimit<0?e.translucencyMaxPrimaryHitEvents:e.tracedTranslucencyPrimaryHitLimit,1,64),Nat=e=>k(e.tracedTranslucencySecondaryHitLimit<0?e.translucencyMaxSecondaryHitEvents:e.tracedTranslucencySecondaryHitLimit,0,64);var O6=["off","medium","high","ultra","cinematic"],L6="ultra",Uat={medium:{downsample:2,reconstructionSamples:3,reconstructionMinWeight:1,maxRoughnessFoliage:.2,maxRoughnessEvaluateFoliage:.4,frontLayerAllowed:!1,frontLayerTraced:!1,sceneTraces:!1},high:{downsample:2,reconstructionSamples:3,reconstructionMinWeight:1,maxRoughnessFoliage:.2,maxRoughnessEvaluateFoliage:.4,frontLayerAllowed:!0,frontLayerTraced:!1,sceneTraces:!0},ultra:{downsample:1,reconstructionSamples:5,reconstructionMinWeight:0,maxRoughnessFoliage:.4,maxRoughnessEvaluateFoliage:.8,frontLayerAllowed:!0,frontLayerTraced:!1,sceneTraces:!0},cinematic:{downsample:1,reconstructionSamples:5,reconstructionMinWeight:0,maxRoughnessFoliage:.4,maxRoughnessEvaluateFoliage:.8,frontLayerAllowed:!0,frontLayerTraced:!0,sceneTraces:!0}},Yp={smooth:{reflectionQuality:"off"},balanced:{reflectionQuality:"high"},fine:{reflectionQuality:"high"},cinematic:{reflectionQuality:"cinematic"}};var y1="a finite number of metres above 0",Kp="a finite number of centimetres of at least 0",R6=A({reflectionQuality:N("reflectionQuality",L6,O6),reflectionScreenTraces:p("reflectionScreenTraces",!0),reflectionScreenFieldlessOnly:p("reflectionScreenFieldlessOnly",!0),reflectionScreenSteps:P("reflectionScreenSteps",50,1),reflectionScreenMinimumOccupancy:P("reflectionScreenMinimumOccupancy",0,0),reflectionRelativeDepthThickness:F("reflectionRelativeDepthThickness",.005),reflectionHistoryDepthTestRelativeThickness:F("reflectionHistoryDepthTestRelativeThickness",.005),reflectionDistantScreenTraces:p("reflectionDistantScreenTraces",!0),reflectionDistantScreenSteps:P("reflectionDistantScreenSteps",16,1),reflectionDistantScreenDistance:F("reflectionDistantScreenDistance",2e3,y1),reflectionMaxTraceDistance:F("reflectionMaxTraceDistance",2e3,y1),reflectionDistantScreenDepthThreshold:F("reflectionDistantScreenDepthThreshold",2),reflectionDistantScreenOffsetBias:g("reflectionDistantScreenOffsetBias",0,R),reflectionProbeCache:p("reflectionProbeCache",!0),reflectionProbeCacheStochasticInterpolation:p("reflectionProbeCacheStochasticInterpolation",!0),reflectionProbeCacheMinRoughness:g("reflectionProbeCacheMinRoughness",.2,[0,1]),reflectionProbeCacheMaxRoughness:g("reflectionProbeCacheMaxRoughness",.35,[0,1]),reflectionProbeCacheMinTraceDistance:y("reflectionProbeCacheMinTraceDistance",1e3,Kp),reflectionProbeCacheMaxTraceDistance:y("reflectionProbeCacheMaxTraceDistance",5e3,Kp),reflectionProbeCacheRoughnessFadeLength:g("reflectionProbeCacheRoughnessFadeLength",.05,[0,1]),reflectionProbeCacheReprojectionRadiusScale:g("reflectionProbeCacheReprojectionRadiusScale",10,[1,1e5]),reflectionSampleSceneColor:S("reflectionSampleSceneColor",0,[0,2]),reflectionSampleSceneColorDepthThickness:F("reflectionSampleSceneColorDepthThickness",.01),reflectionSampleSceneColorNormalThreshold:g("reflectionSampleSceneColorNormalThreshold",85,[0,180]),reflectionHeightFog:p("reflectionHeightFog",!0),reflectionHiResSurface:p("reflectionHiResSurface",!0),reflectionHardwareRayTracing:At("reflectionHardwareRayTracing",!1,"rayTracingAllowed"),reflectionHardwareRayTracingBias:y("reflectionHardwareRayTracingBias",.1,Kp),reflectionHardwareRayTracingNormalBias:y("reflectionHardwareRayTracingNormalBias",.1,Kp),reflectionHardwareRayTracingFirstPersonMinimumHitDistance:y("reflectionHardwareRayTracingFirstPersonMinimumHitDistance",4,Kp),reflectionMinDistanceForFoggingSky:F("reflectionMinDistanceForFoggingSky",1e3,y1),reflectionMaxRayIntensity:F("reflectionMaxRayIntensity",40),reflectionTemporal:p("reflectionTemporal",!0),reflectionMaxFramesAccumulated:P("reflectionMaxFramesAccumulated",12,1),reflectionNeighborhoodClampScale:g("reflectionNeighborhoodClampScale",1,R),reflectionMaxRayDirections:P("reflectionMaxRayDirections",1024,1),reflectionFixedStateFrameIndex:S("reflectionFixedStateFrameIndex",-1,[-1,we[1]]),reflectionHistoryDistanceThreshold:F("reflectionHistoryDistanceThreshold",.03),reflectionDenoiserTonemapRange:y("reflectionDenoiserTonemapRange",10),reflectionCheckerHalf:p("reflectionCheckerHalf",!1),reflectionQualityScale:g("reflectionQualityScale",1,U(.25)),reflectionSmoothBias:y("reflectionSmoothBias",.1),reflectionReconstruction:p("reflectionReconstruction",!0),reflectionReconstructionRadius:F("reflectionReconstructionRadius",8,"a finite number of pixels above 0"),reflectionReconstructionRoughnessScale:F("reflectionReconstructionRoughnessScale",1),reflectionBilateralFilter:p("reflectionBilateralFilter",!0),reflectionBilateralRadius:F("reflectionBilateralRadius",8,"a finite number of pixels above 0"),reflectionBilateralSamples:P("reflectionBilateralSamples",4,0),reflectionBilateralDisocclusionFrames:P("reflectionBilateralDisocclusionFrames",2,0),reflectionBilateralDepthWeightScale:y("reflectionBilateralDepthWeightScale",1e4),reflectionMaxRoughnessToTrace:g("reflectionMaxRoughnessToTrace",.4,[0,1]),reflectionMaxRoughnessToTraceForFoliage:g("reflectionMaxRoughnessToTraceForFoliage",-1,[-1,1]),reflectionRoughnessFadeLength:F("reflectionRoughnessFadeLength",.1),reflectionGGXSamplingBias:g("reflectionGGXSamplingBias",.1,[0,1]),reflectionContrast:g("reflectionContrast",1,[.001,1]),reflectionSpecularScale:y("reflectionSpecularScale",1),reflectionFrontLayer:p("reflectionFrontLayer",!0),reflectionFrontLayerDownsample:S("reflectionFrontLayerDownsample",1,[1,4]),reflectionTranslucencyProbeCache:p("reflectionTranslucencyProbeCache",!0),reflectionTranslucencyScreenQuality:S("reflectionTranslucencyScreenQuality",0,[0,4]),reflectionSkylightLeaking:g("reflectionSkylightLeaking",0,[0,1]),reflectionSkylightLeakingTintRed:y("reflectionSkylightLeakingTintRed",1),reflectionSkylightLeakingTintGreen:y("reflectionSkylightLeakingTintGreen",1),reflectionSkylightLeakingTintBlue:y("reflectionSkylightLeakingTintBlue",1),reflectionSkylightLeakingAverageAlbedo:y("reflectionSkylightLeakingAverageAlbedo",.25),reflectionStatistics:pr(p("reflectionStatistics",!1)),...A6,...E6});var exe=["r11g11b10","rgba16","rgba32"],_6=A({lightDataPacking:N("lightDataPacking","r11g11b10",exe)}),Yat=(e,t)=>e==="global"?t:e;var v6=A({rayTracingAllowed:p("rayTracingAllowed",!0)});var txe=8,x1=A({surfaceLayersPerPixel:S("surfaceLayersPerPixel",4,[1,txe]),closureCountFromMaterial:p("closureCountFromMaterial",!0),stochasticClosureLighting:p("stochasticClosureLighting",!1)}),Zat=X(x1);var M6=A({meshFieldTrace:p("meshFieldTrace",!0),meshFieldTraceAllow:p("meshFieldTraceAllow",!0),meshFieldDetailTraces:p("meshFieldDetailTraces",!0),viewProbeMeshFieldTrace:p("viewProbeMeshFieldTrace",!0),reflectionMeshFieldTrace:p("reflectionMeshFieldTrace",!0),directLightingMeshFieldTrace:p("directLightingMeshFieldTrace",!0),meshFieldTraceDistance:y("meshFieldTraceDistance",180),meshFieldTraceEndDistance:y("meshFieldTraceEndDistance",4e3),meshFieldTraceAverageCulledCount:P("meshFieldTraceAverageCulledCount",512,1),meshFieldTraceRadiusThreshold:y("meshFieldTraceRadiusThreshold",30),meshFieldTraceNotCoveredExpandSurfaceScale:y("meshFieldTraceNotCoveredExpandSurfaceScale",.6),meshFieldTraceNotCoveredMinStepScale:y("meshFieldTraceNotCoveredMinStepScale",32),meshFieldTraceDitheredTransparencyStepThreshold:y("meshFieldTraceDitheredTransparencyStepThreshold",.1),meshFieldTraceCullGridPixelSize:P("meshFieldTraceCullGridPixelSize",64,1),meshFieldTraceCullGridLogZScale:F("meshFieldTraceCullGridLogZScale",.01),meshFieldTraceCullGridLogZOffset:y("meshFieldTraceCullGridLogZOffset",1),meshFieldTraceCullGridZScale:y("meshFieldTraceCullGridZScale",4)}),rxe=e=>2**Math.floor(Math.log2(e));function tlt(e){return{enabled:e.meshFieldTrace&&e.meshFieldTraceAllow&&e.meshFieldDetailTraces,viewProbes:e.viewProbeMeshFieldTrace,reflections:e.reflectionMeshFieldTrace,directLighting:e.directLightingMeshFieldTrace,traceDistance:e.meshFieldTraceDistance,endDistance:e.meshFieldTraceEndDistance,averageCulledCount:e.meshFieldTraceAverageCulledCount,radiusThreshold:e.meshFieldTraceRadiusThreshold,notCoveredExpandSurfaceScale:e.meshFieldTraceNotCoveredExpandSurfaceScale,notCoveredMinStepScale:e.meshFieldTraceNotCoveredMinStepScale,ditheredTransparencyStepThreshold:e.meshFieldTraceDitheredTransparencyStepThreshold,cullGridPixelSize:rxe(e.meshFieldTraceCullGridPixelSize),cullGridLogZScale:e.meshFieldTraceCullGridLogZScale,cullGridLogZOffset:e.meshFieldTraceCullGridLogZOffset,cullGridZScale:e.meshFieldTraceCullGridZScale}}var D6=["off","scene","screen"],P6=A({reflectionTraceKind:N("reflectionTraceKind","scene",D6),globalIlluminationMethod:N("globalIlluminationMethod","scene",D6),screenReflectionLevel:S("screenReflectionLevel",3,[0,4]),screenReflectionQuality:g("screenReflectionQuality",50,[0,100]),screenReflectionIntensity:g("screenReflectionIntensity",100,[0,100]),screenReflectionMaxRoughness:g("screenReflectionMaxRoughness",.6,[.01,1]),visualizeScreenReflections:p("visualizeScreenReflections",!1),screenReflectionHalfResColor:p("screenReflectionHalfResColor",!1),screenReflectionTemporal:p("screenReflectionTemporal",!1),screenReflectionFilterSize:g("screenReflectionFilterSize",1,[.01,100]),screenReflectionCatmullRom:p("screenReflectionCatmullRom",!1),screenReflectionDenoiser:p("screenReflectionDenoiser",!1),screenReflectionDenoiserSamples:S("screenReflectionDenoiserSamples",8,[1,56]),screenReflectionDenoiserPreConvolution:S("screenReflectionDenoiserPreConvolution",1,[0,4]),screenReflectionDenoiserTemporal:p("screenReflectionDenoiserTemporal",!0),screenReflectionStencil:p("screenReflectionStencil",!1),screenReflectionCompute:p("screenReflectionCompute",!1),screenReflectionTiles:p("screenReflectionTiles",!1),screenReflectionTilesMaxRoughness:g("screenReflectionTilesMaxRoughness",-1,R),screenReflectionTilesMinSpecular:g("screenReflectionTilesMinSpecular",0,[-.001,1.001]),screenReflectionTilesShow:p("screenReflectionTilesShow",!1),screenGiLevel:S("screenGiLevel",4,we),screenGiSkyDistance:g("screenGiSkyDistance",1e5,[0,R[1]]),diffuseBounceHalfResolution:p("diffuseBounceHalfResolution",!0),screenGiDenoiser:p("screenGiDenoiser",!0),screenGiDenoiserSamples:S("screenGiDenoiserSamples",8,[1,56]),screenGiDenoiserTemporal:p("screenGiDenoiserTemporal",!0)}),nxe=["visualize","low","medium","high","veryHigh"];function ilt(e,t,r){let n=k(t,0,nxe.length-1);return r?"visualize":e>=80&&n>=4?"veryHigh":e>=60&&n>=3?"high":e>=40&&n>=2?"medium":"low"}function slt(e,t,r,n){return e==="scene"&&t?"scene":(e==="screen"||n&&e!=="off")&&r?"screen":"off"}var alt=(e,t)=>e.reflectionTraceKind!=="off"&&t&&e.screenReflectionLevel>0&&e.screenReflectionIntensity>=1,llt=(e,t)=>e.globalIlluminationMethod==="screen"&&e.screenGiLevel>0&&t;var oxe=["enabled","disabled","captures","screenSpace"],ixe=["depthPrepass","none","basePass"],b1=A({thinWater:p("thinWater",!0),thinWaterReflection:N("thinWaterReflection","enabled",oxe),thinWaterReflectionDownsample:S("thinWaterReflectionDownsample",1,[1,2]),thinWaterReflectionCheckerboard:p("thinWaterReflectionCheckerboard",!1),thinWaterReflectionReconstruction:p("thinWaterReflectionReconstruction",!1),thinWaterReflectionDenoising:p("thinWaterReflectionDenoising",!1),thinWaterReflectionTemporal:p("thinWaterReflectionTemporal",!0),thinWaterTiledComposite:p("thinWaterTiledComposite",!0),thinWaterTiledSceneColorCopy:p("thinWaterTiledSceneColorCopy",!0),thinWaterWaveOps:p("thinWaterWaveOps",!0),thinWaterDepthPrepass:p("thinWaterDepthPrepass",!0),thinWaterOptimizedClear:p("thinWaterOptimizedClear",!0),thinWaterUnderwaterFogWhenCameraIsAboveWater:p("thinWaterUnderwaterFogWhenCameraIsAboveWater",!1),thinWaterUnderwaterTest:p("thinWaterUnderwaterTest",!0),thinWaterUnderwaterTraceDistance:y("thinWaterUnderwaterTraceDistance",1),thinWaterUnderwaterPreciseTraceDistance:y("thinWaterUnderwaterPreciseTraceDistance",.1),thinWaterVelocityOutputPass:N("thinWaterVelocityOutputPass","depthPrepass",ixe),thinWaterShadersSupportFieldShadow:pr(p("thinWaterShadersSupportFieldShadow",!0)),thinWaterFieldShadow:p("thinWaterFieldShadow",!0),thinWaterShadersSupportPagedShadowFiltering:pr(p("thinWaterShadersSupportPagedShadowFiltering",!1)),thinWaterPagedShadowFiltering:p("thinWaterPagedShadowFiltering",!1),thinWaterCloudShadow:p("thinWaterCloudShadow",!1),thinWaterRefractionDownsample:S("thinWaterRefractionDownsample",1,[1,2]),thinWaterRefractionCulling:p("thinWaterRefractionCulling",!1),thinWaterRefractionDistanceCulling:y("thinWaterRefractionDistanceCulling",0),thinWaterRefractionDistanceCullingFadeRange:y("thinWaterRefractionDistanceCullingFadeRange",4),thinWaterRefractionFresnelCulling:g("thinWaterRefractionFresnelCulling",0,[0,1]),thinWaterRefractionFresnelCullingFadeRange:y("thinWaterRefractionFresnelCullingFadeRange",.2),thinWaterRefractionDepthCulling:y("thinWaterRefractionDepthCulling",0),thinWaterRefractionDepthCullingFadeRange:y("thinWaterRefractionDepthCullingFadeRange",1)}),dlt=X(b1);function sxe(e){let t=e>>10&31,r=e&1023;if(t===0){let n=r*5960464477539063e-23;return e&32768?-n:n}return ew((e&32768)<<16|t+1008<<20|r<<10,0)}var py=31744,mlt=15360;function ml(e){let t=sL(e),r=t>>>16&32768,n=t&2147483647;if(n>=1199570944)return r|(n>2139095040?32256:py);let o=Math.fround(e);return C6(r,n,o===e?void 0:Math.abs(e)>Math.abs(o))}function C6(e,t,r){let n=t>>>23,o=n>112,i=o?13:126-n;if(i>24)return e;let s=o?t-939524096:t&8388607|8388608,a=1<<i-1,l=s&2*a-1,c=l>a||l===a&&(r??(s>>>i&1)===1);return e|(s>>>i)+(c?1:0)}var I6=31743,axe=1199566848;function glt(e){let t=e>>>16&32768,r=e&2147483647;return r>2139095040?0:r>=axe?t|I6:C6(t,r)}var k6=e=>(e&py)!==py;function Slt(e){return k6(e)?e:e&1023?0:e&32768|I6}function qp(e){return k6(e)?sxe(e):e&1023?NaN:e&32768?-1/0:1/0}var wlt=e=>qp(ml(e)),ylt=e=>qp(ml(Math.fround(e)));function xlt(e){let t=Math.fround(e),r=ml(t);for(;qp(r)>t&&r!==65535;)r=r===0?32768:r&32768?r+1:r-1;return qp(r)}function blt(e){if(!(e>0))return 0;if(e>as)return py;let t=ml(e);for(;qp(t)<e;)t++;return t}var Tlt=[0,.3333,.6666,1],Alt=.3333;var lxe={diffuseRamp:[[0,0],[.25,0],[.26,.25],[.5,.25],[.51,.5],[.75,.5],[.76,.75],[.99,.75],[1,1]],diffuseRampOffsetTexture:null,diffuseRampOffsetStrength:0,diffuseRampOffsetSize:1,specularRamp:[[0,0],[.5,0],[.51,1],[1,1]],specularRampOffsetTexture:null,specularRampOffsetStrength:0,specularRampOffsetSize:1,shadowHatchingPatternDistributionRamp:[[0,0],[1,1]],shadowHatchingPatternTexture:null,shadowHatchingPatternSize:1,shadowHatchingPatternStrength:1,shadowExtinctionCoefficient:10,diffuseIndirectScale:1,specularIndirectScale:1,specularIndirectRamp:[[0,0],[1,1]],specularIndirectRampRepetition:0,diffuseRampIncludesShadow:!1},cxe={diffuseRampOffsetStrength:[0,1/0],diffuseRampOffsetSize:[1,1/0],specularRampOffsetStrength:[0,1/0],specularRampOffsetSize:[1,1/0],shadowHatchingPatternSize:[1,1/0],shadowHatchingPatternStrength:[0,1/0],shadowExtinctionCoefficient:[0,100],diffuseIndirectScale:[0,1/0],specularIndirectScale:[0,1/0],specularIndirectRampRepetition:[0,1/0]},uxe=(e,t)=>Array.isArray(e)&&e.length===2&&Number.isFinite(e[0])&&(t&&Array.isArray(e[1])?e[1].length===3&&e[1].every(Number.isFinite):Number.isFinite(e[1]));function dxe(e,t){if(!(!Array.isArray(e)||e.length===0||!e.every(r=>uxe(r,t))))return e.map(r=>[r[0],r[1]]).sort((r,n)=>r[0]-n[0])}function E1(e){let t=e,r={};for(let[n,o]of Object.entries(lxe)){let i=t[n],s=cxe[n];s?r[n]=Number.isFinite(i)?k(i,s[0],s[1]):o:n.endsWith("Texture")?r[n]=no(i)?i:null:typeof o=="boolean"?r[n]=typeof i=="boolean"?i:o:r[n]=dxe(i,n==="diffuseRamp"||n==="specularRamp")??structuredClone(o)}return r}function B6(e,t){let r=e[0],n=e[e.length-1];if(t<=r[0])return r[1];if(t>=n[0])return n[1];let o=1;for(;e[o][0]<t;)o++;let[i,s]=e[o-1],[a,l]=e[o];return a>i?s+(l-s)*(t-i)/(a-i):l}function F6(e,t){let r=n=>B6(e.map(([o,i])=>[o,typeof i=="number"?i:i[n]]),t);return[r(0),r(1),r(2)]}var N6=(e,t)=>B6(e,t);function U6(e,t){let r=new Float32Array(t*3),n=new Float32Array(t*3),o=new Float32Array(t),i=new Float32Array(t);for(let s=0;s<t;s++){let a=(s+.5)/t;r.set(F6(e.diffuseRamp,a),s*3),n.set(F6(e.specularRamp,a),s*3),o[s]=N6(e.shadowHatchingPatternDistributionRamp,a),i[s]=N6(e.specularIndirectRamp,a)}return{diffuse:r,specular:n,shadow:o,indirect:i}}var T1=e=>e.shadowExtinctionCoefficient/100,my=64,A1=256,O1=16,Plt=e=>Math.max(my,Vr(e,8)),Bn={diffuseOffsetStrength:0,diffuseOffsetSize:1,specularOffsetStrength:2,specularOffsetSize:3,rampIncludesShadow:4,patternSlot:5,shadowHatchSize:6,shadowHatchStrength:7,diffuseIndirectScale:8,specularIndirectScale:9,specularIndirectRampRepetition:10,length:12};function Clt(e){let t=e*5;return{texels:e,bakeTexels:e-2,row:{diffuse:0,specular:e*2,shadow:e*4,specularIndirect:e*4+e/2,params:t},rowWords:t+Bn.length,patternWords:2*e*e}}var V6=4,pxe=V6+1024*2,hxe=(e,t)=>pxe+t*e.rowWords,Ilt=(e,t,r)=>t===0?V6:hxe(e,t)+r*e.patternWords,klt=e=>e<=0?0:Ei(e),hy=(e,t)=>(ml(e)|ml(t)<<16)>>>0;function Flt(e,t,r){let{texels:n,row:o}=r,i=new Uint32Array(r.rowWords),s=new Float32Array(i.buffer),{diffuse:a,specular:l,shadow:c,indirect:u}=U6(e,n);for(let f=0;f<n;f++){for(let[h,m]of[[a,o.diffuse],[l,o.specular]])i[m+f*2]=hy(h[f*3],h[f*3+1]),i[m+f*2+1]=hy(h[f*3+2],0);f%2===0&&(i[o.shadow+f/2]=hy(c[f],c[f+1]),i[o.specularIndirect+f/2]=hy(u[f],u[f+1]))}let d=o.params;return s[d+Bn.diffuseOffsetStrength]=e.diffuseRampOffsetTexture?e.diffuseRampOffsetStrength:0,s[d+Bn.diffuseOffsetSize]=e.diffuseRampOffsetSize,s[d+Bn.specularOffsetStrength]=e.specularRampOffsetTexture?e.specularRampOffsetStrength:0,s[d+Bn.specularOffsetSize]=e.specularRampOffsetSize,s[d+Bn.rampIncludesShadow]=e.diffuseRampIncludesShadow?1:0,i[d+Bn.patternSlot]=t+1,s[d+Bn.shadowHatchSize]=e.shadowHatchingPatternSize,s[d+Bn.shadowHatchStrength]=e.shadowHatchingPatternTexture?e.shadowHatchingPatternStrength:0,s[d+Bn.diffuseIndirectScale]=e.diffuseIndirectScale,s[d+Bn.specularIndirectScale]=e.specularIndirectScale,s[d+Bn.specularIndirectRampRepetition]=e.specularIndirectRampRepetition,i}var mxe=["auto","pixel","quad"],L1=A({shadeBatchMode:N("shadeBatchMode","auto",mxe),eyeNormal:p("eyeNormal",!1),coatLayerNormal:p("coatLayerNormal",!1),shadingRoughDiffuse:p("shadingRoughDiffuse",!0),shadingAccurate:p("shadingAccurate",!0),shadingFurnaceTest:p("shadingFurnaceTest",!1),shadingFurnaceTestEnableForProject:p("shadingFurnaceTestEnableForProject",!1),shadingFurnaceTestSampleCount:S("shadingFurnaceTestSampleCount",64,[16,2048]),toonSingleDiffuse:p("toonSingleDiffuse",!1),toonReflectionQuantization:p("toonReflectionQuantization",!1),toonRampSize:S("toonRampSize",my,[my,512]),gpuTimingDetail:p("gpuTimingDetail",!1),gpuShadeStage:S("gpuShadeStage",0,[0,7]),normalCurvatureScale:g("normalCurvatureScale",1,R),normalCurvatureBias:g("normalCurvatureBias",0,R),normalCurvatureExponent:g("normalCurvatureExponent",.333,R)}),Ko=X(L1),gxe={scale:[0,2],bias:[-1,1],exponent:[.05,20]};function G6(e,t,r,n,o=0){let{scale:i,bias:s,exponent:a}=gxe;return n[o]=k(e,i[0],i[1]),n[o+1]=k(t,s[0],s[1]),n[o+2]=k(r,a[0],a[1]),n}var Sxe=["rayTracing","pagedShadowMap"],H6=A({sampledLights:p("sampledLights",!1),sampledLightsHairStrands:p("sampledLightsHairStrands",!0),sampledLightsHairVoxelTraces:p("sampledLightsHairVoxelTraces",!0),sampledLightsDirectional:p("sampledLightsDirectional",!1),sampledLightsShadowMethod:N("sampledLightsShadowMethod","rayTracing",Sxe),sampledLightsDownsample:S("sampledLightsDownsample",2,[0,2]),sampledLightsHairDownsample:S("sampledLightsHairDownsample",0,[0,2]),sampledLightsSamplesPerPixel:P("sampledLightsSamplesPerPixel",4,1),sampledLightsHairSamplesPerPixel:P("sampledLightsHairSamplesPerPixel",4,1),sampledLightsMinSampleWeight:y("sampledLightsMinSampleWeight",.001),sampledLightsAttenuationFalloff:y("sampledLightsAttenuationFalloff",.18),sampledLightsGuideByHistory:p("sampledLightsGuideByHistory",!0),sampledLightsGuideByHistoryFilter:p("sampledLightsGuideByHistoryFilter",!0),sampledLightsHiddenWeight:g("sampledLightsHiddenWeight",.1,[0,1]),sampledLightsHiddenWeightOnHistoryMiss:g("sampledLightsHiddenWeightOnHistoryMiss",.4,[0,1]),sampledLightsDirectionalFraction:g("sampledLightsDirectionalFraction",.5,[0,1]),sampledLightsDirectionalMinClampWeight:y("sampledLightsDirectionalMinClampWeight",.01),sampledLightsMergeRays:p("sampledLightsMergeRays",!0),sampledLightsPagedShadowMarkPages:p("sampledLightsPagedShadowMarkPages",!0),sampledLightsShadingConfidence:p("sampledLightsShadingConfidence",!0),sampledLightsMaxShadingWeight:y("sampledLightsMaxShadingWeight",20),sampledLightsMaxShadingWeightHidden:y("sampledLightsMaxShadingWeightHidden",5),sampledLightsScreenTraces:p("sampledLightsScreenTraces",!0),sampledLightsScreenTraceIterations:P("sampledLightsScreenTraceIterations",50,1),sampledLightsScreenTraceDistance:y("sampledLightsScreenTraceDistance",1),sampledLightsScreenTraceThickness:y("sampledLightsScreenTraceThickness",.005),sampledLightsScreenTraceNormalBias:y("sampledLightsScreenTraceNormalBias",5e-4),sampledLightsScreenTraceHair:p("sampledLightsScreenTraceHair",!0),sampledLightsScreenTraceHairBias:y("sampledLightsScreenTraceHairBias",.01),sampledLightsHairUnshadowedDistance:y("sampledLightsHairUnshadowedDistance",.2),sampledLightsFirstPersonMinimumHit:y("sampledLightsFirstPersonMinimumHit",.04),sampledLightsTransmission:p("sampledLightsTransmission",!0),sampledLightsTransmissionSampleWeight:g("sampledLightsTransmissionSampleWeight",.1,[0,1]),sampledLightsLightGroups:p("sampledLightsLightGroups",!0),sampledLightsFastClear:p("sampledLightsFastClear",!1),sampledLightsHairFastClear:p("sampledLightsHairFastClear",!0),sampledLightsFrontLayerFastClear:p("sampledLightsFrontLayerFastClear",!0),sampledLightsFrontLayer:p("sampledLightsFrontLayer",!1),sampledLightsFrontLayerSpecularOnly:p("sampledLightsFrontLayerSpecularOnly",!1),sampledLightsFrontLayerSoftShadows:p("sampledLightsFrontLayerSoftShadows",!0),sampledLightsFrontLayerScreenTraces:p("sampledLightsFrontLayerScreenTraces",!1),sampledLightsFrontLayerTemporal:p("sampledLightsFrontLayerTemporal",!0),sampledLightsFrontLayerSpatial:p("sampledLightsFrontLayerSpatial",!0),sampledLightsTemporal:p("sampledLightsTemporal",!0),sampledLightsTemporalHistoryDistance:y("sampledLightsTemporalHistoryDistance",.03),sampledLightsTemporalMinFrames:P("sampledLightsTemporalMinFrames",4,1),sampledLightsTemporalMaxFrames:P("sampledLightsTemporalMaxFrames",12,1),sampledLightsTemporalClampScale:y("sampledLightsTemporalClampScale",1),sampledLightsPowerDelta:p("sampledLightsPowerDelta",!0),sampledLightsPowerDeltaLightPatterns:p("sampledLightsPowerDeltaLightPatterns",!1),sampledLightsSpatial:p("sampledLightsSpatial",!0),sampledLightsSpatialDepthWeight:y("sampledLightsSpatialDepthWeight",1e4),sampledLightsSpatialRadius:y("sampledLightsSpatialRadius",8),sampledLightsSpatialSamples:P("sampledLightsSpatialSamples",4,1),sampledLightsSpatialDisocclusionFrames:y("sampledLightsSpatialDisocclusionFrames",2),sampledLightsSpatialDisocclusionDiffuseVariance:y("sampledLightsSpatialDisocclusionDiffuseVariance",2),sampledLightsSpatialDisocclusionSpecularVariance:y("sampledLightsSpatialDisocclusionSpecularVariance",1),sampledLightsSpatialHistoryVariance:p("sampledLightsSpatialHistoryVariance",!0),sampledLightsSpatialHistoryDeviation:g("sampledLightsSpatialHistoryDeviation",.15,[0,1]),sampledLightsVolumeDownsample:S("sampledLightsVolumeDownsample",2,[0,2]),sampledLightsVolumeWorldSpaceTraces:p("sampledLightsVolumeWorldSpaceTraces",!0),sampledLightsVolumeGuideByHistory:p("sampledLightsVolumeGuideByHistory",!0),sampledLightsVolumeGridPixelSize:P("sampledLightsVolumeGridPixelSize",8,1),sampledLightsVolumeGridSizeZ:P("sampledLightsVolumeGridSizeZ",128,1),sampledLightsVolumeDepthDistributionScale:y("sampledLightsVolumeDepthDistributionScale",32),sampledLightsVolumeHzbOcclusionTest:p("sampledLightsVolumeHzbOcclusionTest",!0),sampledLightsVolumeUnified:p("sampledLightsVolumeUnified",!0),sampledLightsTranslucentLightVolume:p("sampledLightsTranslucentLightVolume",!0),sampledLightsTranslucentLightVolumeDownsample:S("sampledLightsTranslucentLightVolumeDownsample",2,[1,2]),sampledLightsTranslucentLightVolumeSamplesPerVoxel:P("sampledLightsTranslucentLightVolumeSamplesPerVoxel",2,1),sampledLightsTranslucentLightVolumeMinSampleWeight:y("sampledLightsTranslucentLightVolumeMinSampleWeight",.1),sampledLightsTranslucentLightVolumeGuideByHistory:p("sampledLightsTranslucentLightVolumeGuideByHistory",!0),sampledLightsVolume:p("sampledLightsVolume",!0),sampledLightsVolumeSamplesPerVoxel:P("sampledLightsVolumeSamplesPerVoxel",2,1),sampledLightsVolumeMinSampleWeight:y("sampledLightsVolumeMinSampleWeight",.1),sampledLightsVisualize:S("sampledLightsVisualize",0,[0,16]),sampledLightsVisualizeShadowCasterMissingDistance:y("sampledLightsVisualizeShadowCasterMissingDistance",.5),sampledLightsVisualizeShadowCasterPoorDistance:y("sampledLightsVisualizeShadowCasterPoorDistance",.25),sampledLightsHardwareRayTracing:At("sampledLightsHardwareRayTracing",!0,"rayTracingAllowed"),sampledLightsEvaluateMaterialMode:S("sampledLightsEvaluateMaterialMode",0,[0,2]),sampledLightsForceTwoSided:p("sampledLightsForceTwoSided",!0),sampledLightsVisualizeTileClassification:S("sampledLightsVisualizeTileClassification",0,[0,6]),sampledLightsVisualizeLightComplexity:S("sampledLightsVisualizeLightComplexity",0,[0,5]),sampledLightsVisualizeLightComplexityMaxLights:P("sampledLightsVisualizeLightComplexityMaxLights",32,0),sampledLightsVisualizeLightComplexityMaxCost:y("sampledLightsVisualizeLightComplexityMaxCost",32),sampledLightsVisualizeLightComplexityFreeze:p("sampledLightsVisualizeLightComplexityFreeze",!1),sampledLightsVisualizeLightComplexityDump:p("sampledLightsVisualizeLightComplexityDump",!1),sampledLightsVisualizeLightComplexityHeatmap:p("sampledLightsVisualizeLightComplexityHeatmap",!0),sampledLightsVisualizeLightComplexityLightColor:p("sampledLightsVisualizeLightComplexityLightColor",!0),sampledLightsDebug:S("sampledLightsDebug",0,[0,5]),sampledLightsDebugTraceStats:p("sampledLightsDebugTraceStats",!1),sampledLightsDebugCursorX:S("sampledLightsDebugCursorX",-1,[-1,65535]),sampledLightsDebugCursorY:S("sampledLightsDebugCursorY",-1,[-1,65535])});var wxe=["none","Radiance","WorldNormal","WorldSmoothNormal","WorldGeoNormal","BaseColor","DiffuseColor","SpecularColor","TransparencyColor","Metallic","Specular","Roughness","Anisotropy","IOR","ShadingModel","LightGroupMask","WorldPosition","PrimaryRays","WorldTangent","LightGridCount","LightGridAxis","LightGridListHash","LightGridSingular","VolumeLightCount","HitKind","TransparencyCount","SSSColor","SSSRadius","SSSWeight","SSSPhase","FuzzColor","FuzzRoughness","FuzzAmount","BSDFOpacity","BackfacingNormal","TriangleID","InstanceID","ClusterID"],R1=A({pathTracing:p("pathTracing",!1),pathTracingUnstableFeatures:p("pathTracingUnstableFeatures",!1),pathTracingPixelSamples:P("pathTracingPixelSamples",2048,1),pathTracingBounceLimit:P("pathTracingBounceLimit",32,0),pathTracingPackDepth:S("pathTracingPackDepth",6,we),pathTracingGpuDrivenDispatch:p("pathTracingGpuDrivenDispatch",!1),pathTracingTileSize:P("pathTracingTileSize",2048,1),pathTracingNoiseDrivenSampling:p("pathTracingNoiseDrivenSampling",!1),pathTracingNoiseDrivenSamplingTolerance:y("pathTracingNoiseDrivenSamplingTolerance",.001),pathTracingNoiseDrivenSamplingView:S("pathTracingNoiseDrivenSamplingView",0,[0,7]),pathTracingProgressBar:p("pathTracingProgressBar",!0),pathTracingSweepMode:p("pathTracingSweepMode",!1),pathTracingDenoiseKind:p("pathTracingDenoiseKind",!0),pathTracingDenoiseNormalFrame:S("pathTracingDenoiseNormalFrame",0,[0,1]),pathTracingNeighbourDenoise:p("pathTracingNeighbourDenoise",!0),pathTracingHistoryDenoise:p("pathTracingHistoryDenoise",!1),pathTracingHistoryDenoiseMode:S("pathTracingHistoryDenoiseMode",1,[0,2]),pathTracingDenoiseKindVarianceType:S("pathTracingDenoiseKindVarianceType",1,[0,1]),pathTracingDenoiseKindOutputVarianceTexture:p("pathTracingDenoiseKindOutputVarianceTexture",!1),pathTracingDenoiseKindRankedLuminanceVariance:p("pathTracingDenoiseKindRankedLuminanceVariance",!1),pathTracingHistoryDenoiseMotionView:p("pathTracingHistoryDenoiseMotionView",!1),pathTracingHistoryDenoiseSubPixelOffset:p("pathTracingHistoryDenoiseSubPixelOffset",!0),pathTracingHistoryDenoiseSharpness:g("pathTracingHistoryDenoiseSharpness",-1,[-1,1e6]),pathTracingHistoryDenoiseStep:g("pathTracingHistoryDenoiseStep",1,[-1,1e6]),pathTracingHistoryDenoiseColourGap:g("pathTracingHistoryDenoiseColourGap",5,[0,1e6]),pathTracingHistoryDenoiseColourGapDetail:g("pathTracingHistoryDenoiseColourGapDetail",2.1,[0,1e6]),pathTracingHistoryDenoiseBlend:g("pathTracingHistoryDenoiseBlend",1,[0,1e6]),pathTracingHistoryDenoiseInput:S("pathTracingHistoryDenoiseInput",0,we),pathTracingHistoryDenoiseSubPixelFirstLevel:S("pathTracingHistoryDenoiseSubPixelFirstLevel",8,[0,64]),pathTracingHistoryDenoiseMotionStep:S("pathTracingHistoryDenoiseMotionStep",1,[0,1]),pathTracingHistoryDenoiseVisualizeWarp:S("pathTracingHistoryDenoiseVisualizeWarp",0,[0,2]),pathTracingHistoryDenoiseMetrics:S("pathTracingHistoryDenoiseMetrics",2,[0,2]),pathTracingHistoryDenoiseVariationWeight:p("pathTracingHistoryDenoiseVariationWeight",!0),pathTracingHistoryDenoiseWindowCount:S("pathTracingHistoryDenoiseWindowCount",1,[1,16]),pathTracingDebugView:N("pathTracingDebugView","none",wxe),pathTracingDebugViewTranslucent:p("pathTracingDebugViewTranslucent",!0),pathTracingDebugViewSamples:P("pathTracingDebugViewSamples",1,1),pathTracingDebugViewCap:P("pathTracingDebugViewCap",16,1),pathTracingDebugViewOcclusionRange:g("pathTracingDebugViewOcclusionRange",2,[-1e6,1e6]),pathTracingSampleWeighting:S("pathTracingSampleWeighting",2,[0,2]),pathTracingWeightingCorrection:p("pathTracingWeightingCorrection",!0),pathTracingPathClamp:g("pathTracingPathClamp",24,[1,65504]),pathTracingSoftCaustics:p("pathTracingSoftCaustics",!0),pathTracingEmissiveLight:p("pathTracingEmissiveLight",!0),pathTracingBackdropOpacity:g("pathTracingBackdropOpacity",0,[0,1]),pathTracingSequenceKind:S("pathTracingSequenceKind",0,[0,1]),pathTracingFixedSeed:p("pathTracingFixedSeed",!0),pathTracingSkyLightReuse:p("pathTracingSkyLightReuse",!0),pathTracingPixelFilterWidth:g("pathTracingPixelFilterWidth",3,[0,64]),pathTracingShownLights:S("pathTracingShownLights",0,[0,2]),pathTracingLightCellCount:P("pathTracingLightCellCount",256,1),pathTracingLightCellMaxLights:S("pathTracingLightCellMaxLights",128,[1,256]),pathTracingLightCellAxis:S("pathTracingLightCellAxis",-1,[-1,2]),pathTracingExactSky:S("pathTracingExactSky",-1,[-1,1]),pathTracingSkyDepthTableSize:P("pathTracingSkyDepthTableSize",512,1),pathTracingSkyDepthTableSamples:P("pathTracingSkyDepthTableSamples",16384,1),pathTracingSkyGround:p("pathTracingSkyGround",!1),pathTracingClosedFormTransmittance:p("pathTracingClosedFormTransmittance",!0),pathTracingMarchStepLimit:P("pathTracingMarchStepLimit",768,1),pathTracingVolumeSampleWeighting:S("pathTracingVolumeSampleWeighting",1,[0,1]),pathTracingExactClouds:p("pathTracingExactClouds",!0),pathTracingCloudSkipMapSize:S("pathTracingCloudSkipMapSize",512,[1,4096]),pathTracingCloudSkipMapSamples:S("pathTracingCloudSkipMapSamples",64,[1,65536]),pathTracingCloudSkipMapView:p("pathTracingCloudSkipMapView",!1),pathTracingCloudBounceMode:S("pathTracingCloudBounceMode",1,[0,2]),pathTracingCloudRoughnessLimit:g("pathTracingCloudRoughnessLimit",.05,[0,1])}),jlt=X(R1);var _1=A({translucencyScreenPercentage:g("translucencyScreenPercentage",100,[0,100]),translucencyResolutionBasis:S("translucencyResolutionBasis",0,[0,1]),translucencyUpsampleMode:S("translucencyUpsampleMode",1,[0,1])}),Klt=X(_1);var W6=A({subsurfaceScattering:p("subsurfaceScattering",!0),subsurfaceScale:g("subsurfaceScale",1,U(0)),subsurfaceHalfResolution:p("subsurfaceHalfResolution",!1),subsurfaceHalfResolutionSeparable:p("subsurfaceHalfResolutionSeparable",!0),subsurfaceRecombineQuality:S("subsurfaceRecombineQuality",1,[-1,1]),subsurfaceFilter:p("subsurfaceFilter",!0),subsurfaceSampleSet:S("subsurfaceSampleSet",2,[0,2]),subsurfaceCheckerboard:S("subsurfaceCheckerboard",2,[0,2]),subsurfaceCheckerboardNeighborValidation:p("subsurfaceCheckerboardNeighborValidation",!1),subsurfaceBurleyQuality:S("subsurfaceBurleyQuality",1,[0,1]),subsurfaceBurleySamples:S("subsurfaceBurleySamples",0,U(0)),subsurfaceBurleyProfileIdCache:p("subsurfaceBurleyProfileIdCache",!0),subsurfaceBurleyBilateralKernel:S("subsurfaceBurleyBilateralKernel",1,[0,1]),subsurfaceBurleyMipsMinTileCount:S("subsurfaceBurleyMipsMinTileCount",4e3,U(0)),subsurfaceSubpixelThreshold:g("subsurfaceSubpixelThreshold",1,U(0)),subsurfaceSamplingChannel:S("subsurfaceSamplingChannel",1,[0,1]),subsurfaceColorTransmittanceDistance:g("subsurfaceColorTransmittanceDistance",.15,[.05,1]),subsurfaceDebugPixel:p("subsurfaceDebugPixel",!1)}),Xp={smooth:{subsurfaceScale:0,subsurfaceSampleSet:0,subsurfaceRecombineQuality:0,subsurfaceHalfResolution:!0},balanced:{subsurfaceScale:.75,subsurfaceSampleSet:0,subsurfaceRecombineQuality:0,subsurfaceHalfResolution:!0},fine:{subsurfaceScale:1,subsurfaceSampleSet:1,subsurfaceRecombineQuality:-1,subsurfaceHalfResolution:!0},cinematic:{subsurfaceScale:1,subsurfaceSampleSet:2,subsurfaceRecombineQuality:1,subsurfaceHalfResolution:!1}},z6=3,Qlt=1024;function Zlt(e){let t=Math.max(0,e.subsurfaceScale),r=e.subsurfaceHalfResolution;return{enabled:e.subsurfaceScattering&&t>0,half:r,scale:t,forceSeparable:e.subsurfaceBurleyQuality===0||r&&e.subsurfaceHalfResolutionSeparable,recombineQuality:e.subsurfaceRecombineQuality,filter:e.subsurfaceFilter,sampleSet:e.subsurfaceSampleSet,checkerboard:e.subsurfaceCheckerboard,neighborValidation:e.subsurfaceCheckerboardNeighborValidation,burleySamples:e.subsurfaceBurleySamples,profileIdCache:e.subsurfaceBurleyProfileIdCache,bilateralKernel:e.subsurfaceBurleyBilateralKernel,mipsMinTileCount:e.subsurfaceBurleyMipsMinTileCount,subpixelThreshold:e.subsurfaceSubpixelThreshold,samplingChannel:e.subsurfaceSamplingChannel,colorTransmittanceDistance:e.subsurfaceColorTransmittanceDistance,debugPixel:e.subsurfaceDebugPixel}}var Jlt=e=>e.checkerboard===1,ect=(e,t)=>t||e.recombineQuality!==0;var yxe=32,xxe=A({surfaceAtlasSize:P("surfaceAtlasSize",4096,1),surfaceAtlasResolution:g("surfaceAtlasResolution",1,[.5,1]),surfaceAtlasSceneDetail:g("surfaceAtlasSceneDetail",1,[.125,8]),surfaceAtlasImprintTexelDensityScale:y("surfaceAtlasImprintTexelDensityScale",100),surfaceAtlasImprintMinResolution:P("surfaceAtlasImprintMinResolution",2,0),surfaceAtlasOrthographicImprintMinResolution:P("surfaceAtlasOrthographicImprintMinResolution",1,0),surfaceAtlasImprintMaxResolution:S("surfaceAtlasImprintMaxResolution",512,[1,2048]),surfaceAtlasImprintMaxTexelDensity:y("surfaceAtlasImprintMaxTexelDensity",.2),surfaceAtlasImprintFixedDebugResolution:g("surfaceAtlasImprintFixedDebugResolution",-1,R),surfaceAtlasMeshImprintsMinSize:y("surfaceAtlasMeshImprintsMinSize",10),surfaceAtlasMeshImprintsCullFaces:p("surfaceAtlasMeshImprintsCullFaces",!0),runtimeMeshImprints:p("runtimeMeshImprints",!0)}),bxe=A({surfaceAtlasImprintCaptureMargin:g("surfaceAtlasImprintCaptureMargin",0,R),surfaceAtlasCaptureLodScaleFactor:F("surfaceAtlasCaptureLodScaleFactor",1),surfaceAtlasNumFramesToKeepUnusedPages:P("surfaceAtlasNumFramesToKeepUnusedPages",256,0),surfaceAtlasCompress:S("surfaceAtlasCompress",1,[0,2]),surfaceAtlasImprintCapturesPerFrame:P("surfaceAtlasImprintCapturesPerFrame",300,0),surfaceAtlasImprintCaptureFactor:S("surfaceAtlasImprintCaptureFactor",64,[1,1024]),surfaceAtlasRemovesPerFrame:P("surfaceAtlasRemovesPerFrame",512,0),surfaceAtlasGpuDrivenUpdate:p("surfaceAtlasGpuDrivenUpdate",!1),surfaceAtlasViewOriginDistanceThreshold:P("surfaceAtlasViewOriginDistanceThreshold",100,0),surfaceAtlasUpdateViewOrigin:p("surfaceAtlasUpdateViewOrigin",!0),surfaceAtlasImprintCaptureRefreshFraction:g("surfaceAtlasImprintCaptureRefreshFraction",.125,[0,1]),surfaceAtlasImprintCaptureEnableInvalidation:p("surfaceAtlasImprintCaptureEnableInvalidation",!0),surfaceAtlasAllowImprintSharing:p("surfaceAtlasAllowImprintSharing",!0),surfaceAtlasAllowImprintDownsampleFromSelf:p("surfaceAtlasAllowImprintDownsampleFromSelf",!0),surfaceAtlasResampleLighting:p("surfaceAtlasResampleLighting",!0),surfaceAtlasDilationMode:S("surfaceAtlasDilationMode",0,[0,2]),surfaceAtlasDiffuseColorBoost:g("surfaceAtlasDiffuseColorBoost",1,[1,4]),surfaceAtlasFastCameraMode:p("surfaceAtlasFastCameraMode",!1),surfaceAtlasRecaptureEveryFrame:p("surfaceAtlasRecaptureEveryFrame",!1),surfaceAtlasReset:p("surfaceAtlasReset",!1),surfaceAtlasResetEveryNthFrame:P("surfaceAtlasResetEveryNthFrame",0,0),surfaceAtlasForceEvictHiResPages:p("surfaceAtlasForceEvictHiResPages",!1)}),Exe=A({surfaceAtlasFeedback:p("surfaceAtlasFeedback",!0),surfaceAtlasFeedbackTileSize:S("surfaceAtlasFeedbackTileSize",16,[1,256]),surfaceAtlasFeedbackMinPageHits:y("surfaceAtlasFeedbackMinPageHits",1),surfaceAtlasFeedbackUniqueElements:S("surfaceAtlasFeedbackUniqueElements",1024,[1,16384]),surfaceAtlasFeedbackResLevelBias:g("surfaceAtlasFeedbackResLevelBias",-.5,R),surfaceAtlasFeedbackHiResLevelBias:g("surfaceAtlasFeedbackHiResLevelBias",1,R)}),Txe=A({surfaceAtlasDirectLightingUpdateFactor:S("surfaceAtlasDirectLightingUpdateFactor",32,[1,1024]),surfaceAtlasRadiosityUpdateFactor:S("surfaceAtlasRadiosityUpdateFactor",64,[1,1024]),surfaceAtlasLightingUpdateSpeed:g("surfaceAtlasLightingUpdateSpeed",1,[.5,16]),surfaceAtlasLightingQuality:g("surfaceAtlasLightingQuality",1,[.5,6]),surfaceAtlasLightingForceFullUpdate:p("surfaceAtlasLightingForceFullUpdate",!1),surfaceAtlasFreeze:p("surfaceAtlasFreeze",!1),surfaceAtlasFreezeUpdateFrame:S("surfaceAtlasFreezeUpdateFrame",0,we),surfaceAtlasLightingMaxDistanceFromFrustumToPrioritize:g("surfaceAtlasLightingMaxDistanceFromFrustumToPrioritize",500,R),surfaceAtlasLightingFeedback:p("surfaceAtlasLightingFeedback",!0),surfaceAtlasPropagateGlobalLightingChange:p("surfaceAtlasPropagateGlobalLightingChange",!0)}),Axe=A({surfaceAtlasDirectLighting:p("surfaceAtlasDirectLighting",!0),surfaceAtlasDirectLightingMaxLightsPerTile:S("surfaceAtlasDirectLightingMaxLightsPerTile",8,[1,yxe]),surfaceAtlasDirectLightingCullToTileDepthRange:p("surfaceAtlasDirectLightingCullToTileDepthRange",!0),surfaceAtlasDirectLightingBatchShadows:S("surfaceAtlasDirectLightingBatchShadows",2,[0,2]),surfaceAtlasDirectLightingGlobalSdfShadowRayBias:y("surfaceAtlasDirectLightingGlobalSdfShadowRayBias",1),surfaceAtlasDirectLightingOffscreenShadowingTraceMeshSdfs:p("surfaceAtlasDirectLightingOffscreenShadowingTraceMeshSdfs",!1),surfaceAtlasDirectLightingMeshSdfShadowRayBias:y("surfaceAtlasDirectLightingMeshSdfShadowRayBias",2),surfaceAtlasDirectLightingCloudTransmittance:p("surfaceAtlasDirectLightingCloudTransmittance",!0),surfaceAtlasDirectLightingHardwareRayTracing:At("surfaceAtlasDirectLightingHardwareRayTracing",!1,"rayTracingAllowed"),surfaceAtlasDirectLightingHardwareRayTracingShadowRayBias:y("surfaceAtlasDirectLightingHardwareRayTracingShadowRayBias",1),surfaceAtlasDirectLightingHardwareRayTracingEndBias:y("surfaceAtlasDirectLightingHardwareRayTracingEndBias",1),surfaceAtlasDirectLightingHardwareRayTracingAdaptiveShadowTracing:p("surfaceAtlasDirectLightingHardwareRayTracingAdaptiveShadowTracing",!0),surfaceAtlasDirectLightingHardwareRayTracingForceTwoSided:p("surfaceAtlasDirectLightingHardwareRayTracingForceTwoSided",!1),surfaceAtlasDirectLightingStochastic:p("surfaceAtlasDirectLightingStochastic",!1),surfaceAtlasDirectLightingStochasticTemporal:p("surfaceAtlasDirectLightingStochasticTemporal",!0),surfaceAtlasDirectLightingStochasticTemporalMaxFramesAccumulated:y("surfaceAtlasDirectLightingStochasticTemporalMaxFramesAccumulated",12),surfaceAtlasDirectLightingStochasticTemporalNeighborhoodClampScale:y("surfaceAtlasDirectLightingStochasticTemporalNeighborhoodClampScale",2),surfaceAtlasDirectLightingStochasticSamplePerTexel:S("surfaceAtlasDirectLightingStochasticSamplePerTexel",1,[1,4]),surfaceAtlasDirectLightingStochasticMinWeight:y("surfaceAtlasDirectLightingStochasticMinWeight",.001),surfaceAtlasHardwareRayTracingMaxIterations:P("surfaceAtlasHardwareRayTracingMaxIterations",8192,1)}),Oxe=A({atlasTraceCulling:S("atlasTraceCulling",3,[0,3]),atlasTraceCullingRadius:y("atlasTraceCullingRadius",3e4),atlasTraceCullingAngle:y("atlasTraceCullingAngle",1),atlasTraceCullingNearDrawDistance:p("atlasTraceCullingNearDrawDistance",!0),atlasTraceCullingBoxDistance:p("atlasTraceCullingBoxDistance",!0),atlasTraceSkipSky:p("atlasTraceSkipSky",!0)}),Lxe=A({surfaceAtlasRadiosity:p("surfaceAtlasRadiosity",!0),surfaceAtlasRadiosityProbeSpacing:S("surfaceAtlasRadiosityProbeSpacing",4,[1,8]),surfaceAtlasRadiosityHemisphereProbeResolution:S("surfaceAtlasRadiosityHemisphereProbeResolution",4,[1,16]),surfaceAtlasRadiositySpatialFilterProbes:p("surfaceAtlasRadiositySpatialFilterProbes",!0),surfaceAtlasRadiositySpatialFilterProbesKernelSize:S("surfaceAtlasRadiositySpatialFilterProbesKernelSize",1,[0,2]),surfaceAtlasRadiosityProbePlaneWeighting:p("surfaceAtlasRadiosityProbePlaneWeighting",!0),surfaceAtlasRadiosityProbePlaneWeightingDepthScale:g("surfaceAtlasRadiosityProbePlaneWeightingDepthScale",-100,R),surfaceAtlasRadiosityProbeOcclusion:p("surfaceAtlasRadiosityProbeOcclusion",!1),surfaceAtlasRadiosityProbeOcclusionStrength:g("surfaceAtlasRadiosityProbeOcclusionStrength",.5,R),surfaceAtlasRadiosityMaxRayIntensity:g("surfaceAtlasRadiosityMaxRayIntensity",40,[0,1e6]),surfaceAtlasRadiosityDistanceFieldSurfaceBias:g("surfaceAtlasRadiosityDistanceFieldSurfaceBias",10,[0,1e3]),surfaceAtlasRadiosityDistanceFieldSurfaceSlopeBias:g("surfaceAtlasRadiosityDistanceFieldSurfaceSlopeBias",5,[0,1e3]),surfaceAtlasRadiosityHardwareRayTracing:At("surfaceAtlasRadiosityHardwareRayTracing",!1,"rayTracingAllowed"),surfaceAtlasRadiosityHardwareRayTracingBias:y("surfaceAtlasRadiosityHardwareRayTracingBias",.1),surfaceAtlasRadiosityHardwareRayTracingNormalBias:y("surfaceAtlasRadiosityHardwareRayTracingNormalBias",.1),surfaceAtlasHardwareRayTracingAvoidSelfIntersections:S("surfaceAtlasHardwareRayTracingAvoidSelfIntersections",3,[0,3]),surfaceAtlasHardwareRayTracingSkipBackFaceHitDistance:y("surfaceAtlasHardwareRayTracingSkipBackFaceHitDistance",5),surfaceAtlasHardwareRayTracingSkipTwoSidedHitDistance:y("surfaceAtlasHardwareRayTracingSkipTwoSidedHitDistance",1),surfaceAtlasHardwareRayTracingMeshSectionVisibilityTest:p("surfaceAtlasHardwareRayTracingMeshSectionVisibilityTest",!0),surfaceAtlasHardwareRayTracingMinTraceDistanceToSampleSurfaceAtlas:y("surfaceAtlasHardwareRayTracingMinTraceDistanceToSampleSurfaceAtlas",10),surfaceAtlasHardwareRayTracingSurfaceAtlasSamplingDepthBias:y("surfaceAtlasHardwareRayTracingSurfaceAtlasSamplingDepthBias",10),surfaceAtlasRadiosityTemporal:p("surfaceAtlasRadiosityTemporal",!0),surfaceAtlasRadiosityTemporalMaxFramesAccumulated:S("surfaceAtlasRadiosityTemporalMaxFramesAccumulated",4,[1,255]),surfaceAtlasRadiosityTemporalFixedJitterIndex:S("surfaceAtlasRadiosityTemporalFixedJitterIndex",-1,[-1,we[1]])}),Rxe=A({surfaceAtlasLightingStats:S("surfaceAtlasLightingStats",0,[0,3]),surfaceAtlasSceneStats:p("surfaceAtlasSceneStats",!1),surfaceAtlasVisualizePrimitiveGroups:p("surfaceAtlasVisualizePrimitiveGroups",!1),surfaceAtlasViewImprints:p("surfaceAtlasViewImprints",!1),surfaceAtlasViewTiles:p("surfaceAtlasViewTiles",!1),surfaceAtlasCursorImprint:p("surfaceAtlasCursorImprint",!1),surfaceAtlasCursorImprintLayer:S("surfaceAtlasCursorImprintLayer",3,[0,4]),surfaceAtlasRadiosityVisualizeProbes:p("surfaceAtlasRadiosityVisualizeProbes",!1),surfaceAtlasRadiosityVisualizeProbeRadius:y("surfaceAtlasRadiosityVisualizeProbeRadius",10),surfaceAtlasRadiosityVisualizeProbesShowInvalid:p("surfaceAtlasRadiosityVisualizeProbesShowInvalid",!1)}),v1={...xxe,...bxe,...Exe,...Txe,...Axe,...Oxe,...Lxe,...Rxe},nct=X(v1);var M1=["level","on","off"],_xe=["responsive","stability"],vxe=["foliage","foliageAndHair","all","varying"],gy=A({temporalResurrection:N("temporalResurrection","level",M1),temporalReprojectionField:N("temporalReprojectionField","level",M1),temporalShadingRejectionFlickering:N("temporalShadingRejectionFlickering","level",M1),temporalShadingRejectionMode:N("temporalShadingRejectionMode","stability",_xe),temporalThinGeometry:p("temporalThinGeometry",!1),temporalResurrectionFrames:P("temporalResurrectionFrames",2,1),temporalResurrectionInterval:P("temporalResurrectionInterval",31,1),temporalReprojectionFieldSpeed:y("temporalReprojectionFieldSpeed",.125),temporalWaveOps:p("temporalWaveOps",!0),temporalWaveSize:S("temporalWaveSize",0,[0,64]),temporalHalfPrecision:p("temporalHalfPrecision",!0),temporalHistoryPacked:p("temporalHistoryPacked",!0),temporalHistorySampleCount:g("temporalHistorySampleCount",16,[8,32]),temporalShadingRejectionSampleCount:y("temporalShadingRejectionSampleCount",2),temporalVelocityWeightClampingSampleCount:y("temporalVelocityWeightClampingSampleCount",4),temporalVelocityWeightClampingPixelSpeed:F("temporalVelocityWeightClampingPixelSpeed",1,"a finite number of half display pixels an image above 0"),temporalFlickeringPeriod:y("temporalFlickeringPeriod",2),temporalFlickeringAdjustToFrameRate:p("temporalFlickeringAdjustToFrameRate",!0),temporalFlickeringFrameRateCap:F("temporalFlickeringFrameRateCap",60,"a finite number of hertz above 0"),temporalFlickeringMaxParallaxVelocity:F("temporalFlickeringMaxParallaxVelocity",10,"a finite number of 1080p pixels an image above 0"),temporalShadingExposureOffset:g("temporalShadingExposureOffset",0,[-20,20]),temporalThinGeometryErrorMultiplier:y("temporalThinGeometryErrorMultiplier",200),temporalThinGeometryMinKeepLineContrast:g("temporalThinGeometryMinKeepLineContrast",.3,[0,1]),temporalThinGeometryLineFadeRate:g("temporalThinGeometryLineFadeRate",.1,[0,1]),temporalThinGeometryLineFadeRateInsideRegion:g("temporalThinGeometryLineFadeRateInsideRegion",.03,[0,1]),temporalThinGeometryLineWeight:g("temporalThinGeometryLineWeight",.6,[0,1]),temporalThinGeometryMaxRelaxationWeight:g("temporalThinGeometryMaxRelaxationWeight",.037,[0,1]),temporalThinGeometryRejectTranslucency:g("temporalThinGeometryRejectTranslucency",.6,[0,1]),temporalThinGeometryShadingRange:N("temporalThinGeometryShadingRange","varying",vxe),temporalThinGeometryAntiFlickering:p("temporalThinGeometryAntiFlickering",!0),temporalDownsampleQuality:N("temporalDownsampleQuality","low",["low","high"])}),sct=X(gy),act=ue(gy,{});var j6=[1,16],D1=A({textureMaxAnisotropy:S("textureMaxAnisotropy",8,j6),virtualTextureMaxAnisotropy:S("virtualTextureMaxAnisotropy",8,j6),virtualTextureAnisotropicFiltering:p("virtualTextureAnisotropicFiltering",!1)}),uct=X(D1),Qp={smooth:{textureMaxAnisotropy:1,virtualTextureMaxAnisotropy:4},balanced:{textureMaxAnisotropy:2,virtualTextureMaxAnisotropy:4},fine:{textureMaxAnisotropy:4,virtualTextureMaxAnisotropy:8},cinematic:{}},dct=e=>1<<31-Math.clz32(Math.max(1,Math.floor(e)));var $6=[1,134217727],Y6=2097152,P1=A({tessellation:p("tessellation",!0),tessellationDicingRate:F("tessellationDicingRate",2,"a finite number of pixels above zero"),tessellationMaxPatchesPerGroup:P("tessellationMaxPatchesPerGroup",5,1),tessellationMaxCandidatePatches:S("tessellationMaxCandidatePatches",Y6,$6),tessellationMaxVisiblePatches:S("tessellationMaxVisiblePatches",Y6,$6),tessellationShadowsDirectional:p("tessellationShadowsDirectional",!0),tessellationShadowsLocal:p("tessellationShadowsLocal",!0)}),hct=X(P1);var C1=A({sortedTranslucentPixels:p("sortedTranslucentPixels",!1),sortedTranslucentPixelsEnabled:p("sortedTranslucentPixelsEnabled",!0),oitPassType:S("oitPassType",3,[0,3]),oitMaxSampleCount:S("oitMaxSampleCount",4,[1,16]),oitMethod:S("oitMethod",1,[0,1]),oitTransmittanceThreshold:g("oitTransmittanceThreshold",.05,[0,1]),oitDebug:S("oitDebug",0,[0,3]),oitDebugCursorX:S("oitDebugCursorX",-1,[-1,65535]),oitDebugCursorY:S("oitDebugCursorY",-1,[-1,65535])}),Sy=X(C1),wct=1,K6=2,yct=e=>{let t=Math.floor(Math.sqrt(k(Math.trunc(e),1,16)));return t*t};var Mxe=1,wy=A({translucentLightVolume:p("translucentLightVolume",!0),translucentLightVolumeDim:S("translucentLightVolumeDim",64,[4,2048]),translucentLightVolumeInnerDistance:y("translucentLightVolumeInnerDistance",15),translucentLightVolumeOuterDistance:y("translucentLightVolumeOuterDistance",50),translucentLightVolumeBlur:p("translucentLightVolumeBlur",!0),translucentLightVolumeTemporal:p("translucentLightVolumeTemporal",!1),translucentLightVolumeHistoryWeight:g("translucentLightVolumeHistoryWeight",.9,[0,1]),translucentLightVolumePositionOffsetRadius:y("translucentLightVolumePositionOffsetRadius",0),translucentLightVolumeAdaptToPerspective:p("translucentLightVolumeAdaptToPerspective",!1),translucentLightVolumeMinFov:g("translucentLightVolumeMinFov",45,U(0)),translucentLightVolumeFovSnap:g("translucentLightVolumeFovSnap",10,U(.001)),translucentLightVolumeMarkVoxels:p("translucentLightVolumeMarkVoxels",!1),translucentLightVolumeVisualize:p("translucentLightVolumeVisualize",!1),translucentLightVolumeVisualizeRadiusScale:y("translucentLightVolumeVisualizeRadiusScale",2),translucentLightVolumeVisualizeCascadeIndex:S("translucentLightVolumeVisualizeCascadeIndex",-1,[-1,Mxe]),translucentLightVolumeDebug:p("translucentLightVolumeDebug",!1),translucentLightVolumeDebugFreezePosition:p("translucentLightVolumeDebugFreezePosition",!1)}),Zp={smooth:{translucentLightVolumeDim:24,translucentLightVolumeBlur:!1},balanced:{translucentLightVolumeDim:32,translucentLightVolumeBlur:!1},fine:{},cinematic:{}};var Dxe=["global","r11g11b10","rgba16","rgba32"],q6=A({translucentBounce:p("translucentBounce",!0),translucentBounceTraceFromVolume:p("translucentBounceTraceFromVolume",!0),translucentBounceHardwareRayTracing:At("translucentBounceHardwareRayTracing",!0,"rayTracingAllowed"),translucentBounceProbeCache:p("translucentBounceProbeCache",!0),translucentBounceShareProbeCacheWithOpaque:p("translucentBounceShareProbeCacheWithOpaque",!1),translucentBounceProbeCacheClipmapBias:P("translucentBounceProbeCacheClipmapBias",3,0),translucentBounceProbeCacheClipmapWorldExtent:F("translucentBounceProbeCacheClipmapWorldExtent",25),translucentBounceProbeCacheClipmapDistributionBase:g("translucentBounceProbeCacheClipmapDistributionBase",2,U(1)),translucentBounceProbeCacheGridResolution:S("translucentBounceProbeCacheGridResolution",24,[1,256]),translucentBounceProbeCacheProbeResolution:S("translucentBounceProbeCacheProbeResolution",8,[8,64]),translucentBounceProbeCacheNumMipmaps:S("translucentBounceProbeCacheNumMipmaps",3,[1,3]),translucentBounceProbeCacheNumProbesToTraceBudget:P("translucentBounceProbeCacheNumProbesToTraceBudget",100,1),translucentBounceProbeCacheProbeAtlasResolutionInProbes:S("translucentBounceProbeCacheProbeAtlasResolutionInProbes",128,[1,255]),translucentBounceProbeCacheReprojectionRadiusScale:y("translucentBounceProbeCacheReprojectionRadiusScale",10),translucentBounceLightingDataFormat:N("translucentBounceLightingDataFormat","rgba16",Dxe),translucentBounceGridPixelSize:S("translucentBounceGridPixelSize",32,[1,1024]),translucentBounceGridDistributionLogZScale:g("translucentBounceGridDistributionLogZScale",1,U(1e-6)),translucentBounceGridDistributionLogZOffset:y("translucentBounceGridDistributionLogZOffset",1),translucentBounceGridDistributionZScale:g("translucentBounceGridDistributionZScale",4,U(.01)),translucentBounceEndDistance:g("translucentBounceEndDistance",80,[.01,1e3]),translucentBounceTracingResolution:S("translucentBounceTracingResolution",3,[1,16]),translucentBounceMaxRayIntensity:y("translucentBounceMaxRayIntensity",20),translucentBounceGridCenterOffsetFromDepthBuffer:g("translucentBounceGridCenterOffsetFromDepthBuffer",.5,U(-1)),translucentBounceOffsetThresholdToAcceptDepthBufferOffset:y("translucentBounceOffsetThresholdToAcceptDepthBufferOffset",1),translucentBounceSpatialFilter:p("translucentBounceSpatialFilter",!0),translucentBounceSpatialFilterSampleCount:P("translucentBounceSpatialFilterSampleCount",3,1),translucentBounceSpatialFilterStandardDeviation:g("translucentBounceSpatialFilterStandardDeviation",5,U(.1)),translucentBounceTemporalReprojection:p("translucentBounceTemporalReprojection",!0),translucentBounceTemporalJitter:p("translucentBounceTemporalJitter",!0),translucentBounceTemporalHistoryWeight:g("translucentBounceTemporalHistoryWeight",.9,[0,1]),translucentBounceTemporalMaxRayDirections:P("translucentBounceTemporalMaxRayDirections",8,1)}),Jp={smooth:{},balanced:{translucentBounceGridPixelSize:128,translucentBounceTraceFromVolume:!1,translucentBounceShareProbeCacheWithOpaque:!0,translucentBounceSpatialFilter:!1,translucentBounceProbeCacheGridResolution:12,translucentBounceProbeCacheNumProbesToTraceBudget:30},fine:{translucentBounceGridPixelSize:64,translucentBounceTraceFromVolume:!1,translucentBounceProbeCacheNumProbesToTraceBudget:70},cinematic:{translucentBounceTracingResolution:4,translucentBounceProbeCacheProbeResolution:16,translucentBounceProbeCacheNumProbesToTraceBudget:350}};var Pxe=["off","low","high","ultra"],Cxe="high",Ixe={low:{cellSize:16,sliceCount:64,rebuildSamples:4},high:{cellSize:8,sliceCount:128,rebuildSamples:4},ultra:{cellSize:4,sliceCount:128,rebuildSamples:16}},Rct=e=>e==="off"?void 0:Ixe[e],kxe=["auto","off","on"],Fxe=["trilinear","bicubic","tricubic"],Q6=A({volumetricFogQuality:N("volumetricFogQuality",Cxe,Pxe),volumetricFogReadFilter:N("volumetricFogReadFilter","tricubic",Fxe),volumetricFogUsesHistory:p("volumetricFogUsesHistory",!0),volumetricFogMovesSamples:p("volumetricFogMovesSamples",!0),volumetricFogHistoryShare:g("volumetricFogHistoryShare",.9,R),volumetricFogSliceSpread:Dg("volumetricFogSliceSpread",32,"a finite number but 0, which the slices divide by"),volumetricFogGlow:p("volumetricFogGlow",!0),volumetricFogSkipHidden:p("volumetricFogSkipHidden",!0),volumetricFogLampSoftening:g("volumetricFogLampSoftening",1,R),volumetricFogSampleScatter:g("volumetricFogSampleScatter",0,R),volumetricFogSurfaceLift:g("volumetricFogSurfaceLift",.5,R),volumetricFogLiftRange:g("volumetricFogLiftRange",1,R),volumetricFogVoxelizationSlicesPerPass:P("volumetricFogVoxelizationSlicesPerPass",8,1),volumetricFogVoxelizationShowOnlyPass:S("volumetricFogVoxelizationShowOnlyPass",-1,[-1,Number.MAX_SAFE_INTEGER]),volumetricFogEdgeFade:g("volumetricFogEdgeFade",0,R),volumetricFogReadJitter:g("volumetricFogReadJitter",0,R),volumetricFogLocalShadows:p("volumetricFogLocalShadows",!0),volumetricFogAreaLightTexture:p("volumetricFogAreaLightTexture",!1),volumetricFogTracedLightInjection:p("volumetricFogTracedLightInjection",!1),fogSphereSupport:pr(p("fogSphereSupport",!0)),fogSpheres:p("fogSpheres",!0),fogSphereInVolume:p("fogSphereInVolume",!0),fogSphereMaxVolumeDensity:g("fogSphereMaxVolumeDensity",1,R),fogSphereStartDistance:g("fogSphereStartDistance",10,R),fogSphereMaxCount:P("fogSphereMaxCount",32,0),fogSphereTileSize:P("fogSphereTileSize",128,0),fogSphereUsesDepthPyramid:p("fogSphereUsesDepthPyramid",!0),fogSphereOnTranslucent:p("fogSphereOnTranslucent",!1),fogEnabled:p("fogEnabled",!0),fogReadsAtmosphere:p("fogReadsAtmosphere",!0),fogMatchesVolume:p("fogMatchesVolume",!1),fogOrthoHeightAdjustment:p("fogOrthoHeightAdjustment",!0),fogReadsSkyLight:p("fogReadsSkyLight",!1),fogOwnComposite:N("fogOwnComposite","auto",kxe),fogScatterInScreenSpace:p("fogScatterInScreenSpace",!0),fogScatterInScreenSpaceMaxLuminance:F("fogScatterInScreenSpaceMaxLuminance",10),fogScatterInScreenSpaceTemporal:p("fogScatterInScreenSpaceTemporal",!0),fogScatterInScreenSpaceTemporalWeight:g("fogScatterInScreenSpaceTemporalWeight",.04,[0,1])}),Nxe=.1,Bxe=256,X6={least:8,most:512};function _ct(e,t={}){let r=t;return r.startDistance=Math.max(Nxe,e.fogSphereStartDistance),r.maxVolumeDensity=Math.max(0,e.fogSphereMaxVolumeDensity),r.maxCount=k(e.fogSphereMaxCount,1,Bxe),r.tileSize=k(e.fogSphereTileSize,X6.least,X6.most),r}var eh={smooth:{volumetricFogQuality:"off"},balanced:{volumetricFogQuality:"off"},fine:{volumetricFogQuality:"low"},cinematic:{volumetricFogQuality:"ultra"}};var Z6=A({bakedLightVolume:p("bakedLightVolume",!0),bakedLightVolumeLoadingRange:g("bakedLightVolumeLoadingRange",64,[1,1e5]),bakedLightVolumeBrickMemory:g("bakedLightVolumeBrickMemory",30,[1,65536]),bakedLightVolumeVisualize:p("bakedLightVolumeVisualize",!1),bakedLightVolumeVisualizeRadiusScale:y("bakedLightVolumeVisualizeRadiusScale",.01),bakedLightVolumeVisualizeMinScreenFraction:y("bakedLightVolumeVisualizeMinScreenFraction",.001)});var Uxe=we,be=A({worldStreamingMaxLoadingCells:S("worldStreamingMaxLoadingCells",4,Uxe),worldStreamingAngleWeight:g("worldStreamingAngleWeight",.4,[0,1]),worldStreamingSortByExtent:p("worldStreamingSortByExtent",!0),worldStreamingSortByPriority:p("worldStreamingSortByPriority",!0),worldStreamingUseGridRange:p("worldStreamingUseGridRange",!0),worldStreamingRangeScale:y("worldStreamingRangeScale",1),worldStreamingRadius:y("worldStreamingRadius",100),worldStreamingSector:p("worldStreamingSector",!1),worldStreamingSectorAngle:g("worldStreamingSectorAngle",360,[0,360]),worldStreamingZCulling:p("worldStreamingZCulling",!1),worldStreamingBlockOnSlowStreaming:p("worldStreamingBlockOnSlowStreaming",!0),worldStreamingBlockOnSlowStreamingRatio:y("worldStreamingBlockOnSlowStreamingRatio",.25),hlodEnabled:p("hlodEnabled",!0),worldStreamingUpdateOptimization:p("worldStreamingUpdateOptimization",!0),worldStreamingLocationQuantization:y("worldStreamingLocationQuantization",4),worldStreamingRotationQuantization:y("worldStreamingRotationQuantization",10),worldStreamingForceUpdateFrameCount:P("worldStreamingForceUpdateFrameCount",0,0),worldStreamingForce2D:p("worldStreamingForce2D",!1),worldStreamingExtraRadius:y("worldStreamingExtraRadius",0),worldStreamingExtraAngle:y("worldStreamingExtraAngle",0),worldStreamingTargetState:N("worldStreamingTargetState","activated",["activated","loaded"]),worldStreamingPriority:S("worldStreamingPriority",128,[0,255]),worldStreamingUseVelocity:p("worldStreamingUseVelocity",!1),hlodForcedLevel:S("hlodForcedLevel",-1,[-1,255]),worldStreamingCameraSource:p("worldStreamingCameraSource",!0),hlodWarmup:p("hlodWarmup",!0),hlodWarmupFrames:P("hlodWarmupFrames",5,0),hlodWarmupGeometry:p("hlodWarmupGeometry",!0),hlodWarmupTextures:p("hlodWarmupTextures",!0),hlodWarmupTextureScale:y("hlodWarmupTextureScale",2),hlodWarmupTextureClamp:P("hlodWarmupTextureClamp",2048,1)}),Vxe={maxLoadingCells:be.worldStreamingMaxLoadingCells,angleWeight:be.worldStreamingAngleWeight,sortByExtent:be.worldStreamingSortByExtent,sortByPriority:be.worldStreamingSortByPriority,useGridRange:be.worldStreamingUseGridRange,rangeScale:be.worldStreamingRangeScale,radius:be.worldStreamingRadius,sector:be.worldStreamingSector,sectorAngle:be.worldStreamingSectorAngle,zCulling:be.worldStreamingZCulling,blockOnSlowStreaming:be.worldStreamingBlockOnSlowStreaming,blockOnSlowStreamingRatio:be.worldStreamingBlockOnSlowStreamingRatio,hlod:be.hlodEnabled,updateOptimization:be.worldStreamingUpdateOptimization,locationQuantization:be.worldStreamingLocationQuantization,rotationQuantization:be.worldStreamingRotationQuantization,forceUpdateFrames:be.worldStreamingForceUpdateFrameCount,force2D:be.worldStreamingForce2D,extraRadius:be.worldStreamingExtraRadius,extraAngle:be.worldStreamingExtraAngle,targetState:be.worldStreamingTargetState,priority:be.worldStreamingPriority,useVelocity:be.worldStreamingUseVelocity,forcedLevel:be.hlodForcedLevel,cameraSource:be.worldStreamingCameraSource},Cct=e=>e.targetState==="activated",Gxe={enabled:be.hlodWarmup,frames:be.hlodWarmupFrames,geometry:be.hlodWarmupGeometry,textures:be.hlodWarmupTextures,textureScale:be.hlodWarmupTextureScale,textureClamp:be.hlodWarmupTextureClamp},J6=(e={},t={})=>ds(Vxe,e,t),Ict=(e={},t={})=>ds(Gxe,e,t);var ez=["off","high","ultra","cinematic"],tz="ultra",th={smooth:{viewProbes:"off",bounce:!1},balanced:{viewProbes:"high",finalGatherAlgorithm:"diffuseGrid",viewProbeNearOcclusionDownsampleFactor:1,viewProbeOcclusionSlices:1,viewProbeOcclusionFoliageStrength:1,surfaceAtlasSize:2048,surfaceAtlasImprintTexelDensityScale:50,surfaceAtlasImprintMinResolution:2,surfaceAtlasImprintMaxResolution:256,surfaceAtlasDirectLightingMaxLightsPerTile:4,surfaceAtlasDirectLightingUpdateFactor:128,surfaceAtlasRadiosityUpdateFactor:128,surfaceAtlasRadiosityProbeSpacing:4,surfaceAtlasRadiosityHemisphereProbeResolution:3},fine:{viewProbes:"high"},cinematic:{viewProbes:"cinematic"}},Fct=6,Nct={high:{downsampleFactor:32,adaptiveProbes:16,tracingResolution:8,irradianceFormat:"octahedral",occlusionDownsample:2,occlusionPyramid:!0,occlusionForegroundPower:1.5,occlusionSlices:2,occlusionFoliageStrength:.7,bentNormal:!1,radianceProbeResolution:16,radianceProbeBudget:100,backfaceDiffuse:!1},ultra:{downsampleFactor:16,adaptiveProbes:8,tracingResolution:8,irradianceFormat:"sh3",occlusionDownsample:1,occlusionPyramid:!1,occlusionForegroundPower:1,occlusionSlices:2,occlusionFoliageStrength:.7,bentNormal:!0,radianceProbeResolution:32,radianceProbeBudget:150,backfaceDiffuse:!0},cinematic:{downsampleFactor:8,adaptiveProbes:4,tracingResolution:16,irradianceFormat:"sh3",occlusionDownsample:1,occlusionPyramid:!1,occlusionForegroundPower:1,occlusionSlices:2,occlusionFoliageStrength:.7,bentNormal:!0,radianceProbeResolution:32,radianceProbeBudget:350,backfaceDiffuse:!0}},Bct={off:{},high:{surfaceAtlasSize:3584,surfaceAtlasImprintTexelDensityScale:100,surfaceAtlasImprintMinResolution:4,surfaceAtlasImprintMaxResolution:512,surfaceAtlasDirectLightingMaxLightsPerTile:4,surfaceAtlasDirectLightingUpdateFactor:64,surfaceAtlasRadiosityUpdateFactor:128,surfaceAtlasRadiosityProbeSpacing:8,surfaceAtlasRadiosityHemisphereProbeResolution:3},ultra:{},cinematic:{}},Uct=e=>e!=="off",yy={adaptiveFractionDefault:.5,minInterpolationWeight:.01,depthWeightScale:-1e4,importanceHistoryMinWeight:.1,historyMinWeight:.01,importanceLevels:1,rayDirections:8,tileJitters:8,radianceProbeMinTraceScale:1,radianceInvLevelFadeSize:1,radianceMaxHitDistance:655.04,probeCacheMaxHitDistance:655.03,maxFramesAccumulated:10,maxFramesCoded:15,pixelPlaneWeightScale:-5e3,youngFrames:8,youngTaps:16};var Hxe=200,Wxe=["automatic","half","full","supersampled"],zxe=["none","gbuffer","worldField"],jxe=4,$xe=["level","sh3","octahedral"],Yxe=[4,64],Kxe=["viewProbes","diffuseGrid","reservoirs"],qxe=["jitteredBilinear","spiral","passthrough"],Xxe=[4,16],Qxe=12,zct={preintegrated:0,sampled:1,numerical:2},Zxe=A({viewProbes:N("viewProbes",tz,ez),viewProbeQuality:F("viewProbeQuality",1),viewProbeUpdateSpeed:F("viewProbeUpdateSpeed",1),viewProbeAdaptiveFraction:y("viewProbeAdaptiveFraction",yy.adaptiveFractionDefault),viewProbeGatherScale:g("viewProbeGatherScale",1,[.1,jxe]),viewProbeScreenTraces:p("viewProbeScreenTraces",!0),viewProbeImportanceSampling:p("viewProbeImportanceSampling",!0),viewProbeSpatialFilter:p("viewProbeSpatialFilter",!0),viewProbeSpatialFilterPasses:P("viewProbeSpatialFilterPasses",3,0),viewProbeSpatialFilterKernel:P("viewProbeSpatialFilterKernel",1,0),viewProbeMaxRayIntensity:F("viewProbeMaxRayIntensity",10),viewProbeTemporal:p("viewProbeTemporal",!0),viewProbeClearHistoryEveryFrame:p("viewProbeClearHistoryEveryFrame",!1),viewProbeExactMode:p("viewProbeExactMode",!1),viewProbeDebugForceTracesMoving:p("viewProbeDebugForceTracesMoving",!1),viewProbeGatherDebug:p("viewProbeGatherDebug",!1),viewProbeTileDebugMode:p("viewProbeTileDebugMode",!1),viewProbeGatherDebugProbePlacement:S("viewProbeGatherDebugProbePlacement",0,[0,3]),viewProbeGatherVisualizeTraces:p("viewProbeGatherVisualizeTraces",!1),viewProbeGatherVisualizeTracesFreeze:p("viewProbeGatherVisualizeTracesFreeze",!1),showTracesInText:p("showTracesInText",!0),showToneMapped:p("showToneMapped",!0),visualizeMode:S("visualizeMode",0,[0,24]),visualizeSurfaceAtlasFeedback:p("visualizeSurfaceAtlasFeedback",!1),reflectionVisualizeTraces:p("reflectionVisualizeTraces",!1),probeCacheVisualize:S("probeCacheVisualize",0,[0,2]),probeCacheVisualizeRadiusScale:g("probeCacheVisualizeRadiusScale",1,[0,100]),probeCacheVisualizeClipmapIndex:S("probeCacheVisualizeClipmapIndex",-1,[-1,dS-1]),visualizeSceneTraceProbeCache:p("visualizeSceneTraceProbeCache",!1),showFineSurface:p("showFineSurface",!0),showTraceDistanceMin:g("showTraceDistanceMin",0,[0,1e3]),showTraceDistanceMax:g("showTraceDistanceMax",1e5,[.01,1048576]),visualizeHardwareRayTracing:At("visualizeHardwareRayTracing",!0,"rayTracingAllowed"),showCullingMode:S("showCullingMode",0,[0,2]),debugPixelX:S("debugPixelX",-1,[-1,16384]),debugPixelY:S("debugPixelY",-1,[-1,16384]),viewProbeDownsampleFactor:S("viewProbeDownsampleFactor",-1,[-1,Yxe[1]]),viewProbeTracingResolution:S("viewProbeTracingResolution",-1,[-1,Xxe[1]]),viewProbeNumAdaptiveProbes:S("viewProbeNumAdaptiveProbes",-1,[-1,64]),viewProbeOcclusionSlices:S("viewProbeOcclusionSlices",-1,[-1,16]),viewProbeOcclusionForegroundPower:g("viewProbeOcclusionForegroundPower",-1,[-1,10]),viewProbeOcclusionPyramid:S("viewProbeOcclusionPyramid",-1,[-1,1]),viewProbeIrradianceFormat:N("viewProbeIrradianceFormat","level",$xe),viewProbeMaxFramesAccumulated:P("viewProbeMaxFramesAccumulated",yy.maxFramesAccumulated,1),viewProbeMaxRayDirections:P("viewProbeMaxRayDirections",yy.rayDirections,1),viewProbeExtraAmbientOcclusion:p("viewProbeExtraAmbientOcclusion",!1),viewProbeExtraAmbientOcclusionMaxDistance:g("viewProbeExtraAmbientOcclusionMaxDistance",5,[1e-6,1e4]),viewProbeExtraAmbientOcclusionExponent:g("viewProbeExtraAmbientOcclusionExponent",.5,[.01,100]),viewProbeGatherNumMips:S("viewProbeGatherNumMips",1,[1,Qxe]),viewProbeMaterialAO:p("viewProbeMaterialAO",!0),viewProbeNearOcclusion:p("viewProbeNearOcclusion",!0),viewProbeOcclusionIntensity:g("viewProbeOcclusionIntensity",1,[0,1]),viewProbeOcclusionTemporal:p("viewProbeOcclusionTemporal",!0),viewProbeBentNormal:p("viewProbeBentNormal",!0),viewProbeOcclusionVisibilityBitmask:p("viewProbeOcclusionVisibilityBitmask",!1),viewProbeOcclusionHorizonSearch:p("viewProbeOcclusionHorizonSearch",!0),viewProbeNearBounce:p("viewProbeNearBounce",!1),viewProbeNearBounceMaxScreenFraction:g("viewProbeNearBounceMaxScreenFraction",.1,R),viewProbeNearBounceMaxRayIntensity:F("viewProbeNearBounceMaxRayIntensity",5),viewProbeNearBounceHistoryDepthTestRelativeThickness:F("viewProbeNearBounceHistoryDepthTestRelativeThickness",5e-4),viewProbeOcclusionSlopeCompareToleranceScale:y("viewProbeOcclusionSlopeCompareToleranceScale",.5),viewProbeOcclusionSteps:P("viewProbeOcclusionSteps",3,1),viewProbeOcclusionForegroundFraction:y("viewProbeOcclusionForegroundFraction",.3),viewProbeOcclusionMaxAlbedo:y("viewProbeOcclusionMaxAlbedo",.5),viewProbeOcclusionClampScale:g("viewProbeOcclusionClampScale",1,R),viewProbeOcclusionFoliageStrength:g("viewProbeOcclusionFoliageStrength",-1,[-1,1]),viewProbeNearOcclusionApplyDuringIntegration:p("viewProbeNearOcclusionApplyDuringIntegration",!1),viewProbeNearOcclusionDownsampleFactor:S("viewProbeNearOcclusionDownsampleFactor",-1,[-1,2]),viewProbeIntegrateDownsampleFactor:S("viewProbeIntegrateDownsampleFactor",1,[1,2]),viewProbeIntegrationTileClassification:p("viewProbeIntegrationTileClassification",!0),viewProbeScreenTracesMinimumOccupancy:P("viewProbeScreenTracesMinimumOccupancy",0,0),viewProbeScreenTracesHZBTraversal:p("viewProbeScreenTracesHZBTraversal",!0),viewProbeFilteringWaveOps:p("viewProbeFilteringWaveOps",!0),viewProbeDiffuseIntegralMethod:S("viewProbeDiffuseIntegralMethod",0,[0,2])}),Jxe=A({viewProbeSceneTraces:p("viewProbeSceneTraces",!0),viewProbeMaxTraceDistance:g("viewProbeMaxTraceDistance",Hxe,[1e-4,10485.76]),viewProbeSurfaceBias:g("viewProbeSurfaceBias",.05,[1e-4,1]),viewProbeMinTraceDistance:g("viewProbeMinTraceDistance",1e-4,[1e-4,10]),viewProbeInterpolationDepthWeight:g("viewProbeInterpolationDepthWeight",1,R),viewProbeInterpolationDepthWeightForFoliage:g("viewProbeInterpolationDepthWeightForFoliage",.25,R),viewProbeInterpolationDepthWeightFallback:g("viewProbeInterpolationDepthWeightFallback",.1,R),viewProbeHistoryDistanceThreshold:F("viewProbeHistoryDistanceThreshold",.01),viewProbeHistoryDistanceThresholdForFoliage:F("viewProbeHistoryDistanceThresholdForFoliage",.03),viewProbeNormalThreshold:g("viewProbeNormalThreshold",45,[0,180]),viewProbeRelativeSpeedThreshold:F("viewProbeRelativeSpeedThreshold",.005),viewProbeFastUpdateFraction:F("viewProbeFastUpdateFraction",.1),viewProbeMaxFastUpdate:g("viewProbeMaxFastUpdate",.9,[0,1]),viewProbeImportanceIncomingLighting:p("viewProbeImportanceIncomingLighting",!0),viewProbeRadianceHistory:p("viewProbeRadianceHistory",!0),viewProbeMinPdfToTrace:g("viewProbeMinPdfToTrace",.005,[0,1]),viewProbeSpatialFilterPositionWeightScale:y("viewProbeSpatialFilterPositionWeightScale",1e3),viewProbeSpatialFilterMaxHitAngle:g("viewProbeSpatialFilterMaxHitAngle",10,[.01,180]),viewProbeDisocclusionMaxFrames:P("viewProbeDisocclusionMaxFrames",4,0),viewProbeDisocclusionFraction:g("viewProbeDisocclusionFraction",.4,[0,1]),viewProbeHistoryDepthTestThickness:F("viewProbeHistoryDepthTestThickness",.005),viewProbeRelativeDepthThickness:F("viewProbeRelativeDepthThickness",.02),viewProbeMaxIterations:P("viewProbeMaxIterations",50,0),viewProbeCache:p("viewProbeCache",!0),viewProbeCacheUpdate:p("viewProbeCacheUpdate",!0),viewProbeCacheForceFullUpdate:p("viewProbeCacheForceFullUpdate",!1),viewProbeCacheStats:p("viewProbeCacheStats",!1),viewProbeCacheReprojectionRadiusScale:y("viewProbeCacheReprojectionRadiusScale",1.5),viewProbeCacheFramesToKeepProbes:P("viewProbeCacheFramesToKeepProbes",8,0),viewProbeCacheTemporaryAtlasDownsampleFactor:S("viewProbeCacheTemporaryAtlasDownsampleFactor",6,[1,1024]),viewProbeMarkDownsampleFactor:S("viewProbeMarkDownsampleFactor",2,[1,8]),viewProbeInterpolateDownsampleFactor:S("viewProbeInterpolateDownsampleFactor",2,[1,2])}),ebe=A({viewProbeTranslucencyReflectionsProbeCache:p("viewProbeTranslucencyReflectionsProbeCache",!0),viewProbeTranslucencyReflectionsMarkDownsampleFactor:S("viewProbeTranslucencyReflectionsMarkDownsampleFactor",4,[1,64]),viewProbeTranslucencyReflectionsHizOcclusionTest:p("viewProbeTranslucencyReflectionsHizOcclusionTest",!0),viewProbeTranslucencyReflectionsClipmapFadeSize:g("viewProbeTranslucencyReflectionsClipmapFadeSize",4,[.001,16]),viewProbeCacheSpatialFilter:p("viewProbeCacheSpatialFilter",!0),viewProbeCacheSortTraceTiles:p("viewProbeCacheSortTraceTiles",!1),viewProbeCacheFilterHitAngle:F("viewProbeCacheFilterHitAngle",.2,"a finite number of radians above 0"),viewProbeCacheTraceTiles:N("viewProbeCacheTraceTiles","automatic",Wxe),viewProbeCacheSupersampleTileBrdfThreshold:y("viewProbeCacheSupersampleTileBrdfThreshold",.1),viewProbeCacheDownsampleDistance:y("viewProbeCacheDownsampleDistance",40),viewProbeCacheSupersampleDistance:g("viewProbeCacheSupersampleDistance",-1,R),viewProbeCacheMipmaps:S("viewProbeCacheMipmaps",1,[1,3]),viewProbeCacheSkyVisibility:p("viewProbeCacheSkyVisibility",!1),viewProbeCacheHardwareRayTracing:At("viewProbeCacheHardwareRayTracing",!0,"rayTracingAllowed"),hardwareTraceBackoffBias:y("hardwareTraceBackoffBias",.08),viewProbeHardwareRayTracing:At("viewProbeHardwareRayTracing",!0,"rayTracingAllowed"),viewProbeHardwareRayTracingBias:y("viewProbeHardwareRayTracingBias",.001),viewProbeHardwareRayTracingNormalBias:y("viewProbeHardwareRayTracingNormalBias",.001),viewProbeNearOcclusionHardwareRayTracing:At("viewProbeNearOcclusionHardwareRayTracing",!1,"rayTracingAllowed"),viewProbeNearOcclusionHardwareRayTracingNormalBias:y("viewProbeNearOcclusionHardwareRayTracingNormalBias",.001),viewProbeHardwareRayTracingHairBias:y("viewProbeHardwareRayTracingHairBias",.02),viewProbeSkipFoliageHits:p("viewProbeSkipFoliageHits",!0),viewProbeSkipHairHits:p("viewProbeSkipHairHits",!1),viewProbeSkipUnlitHits:p("viewProbeSkipUnlitHits",!1),viewProbeScreenTracesHairBias:y("viewProbeScreenTracesHairBias",.02),viewProbeThicknessScaleWithoutField:F("viewProbeThicknessScaleWithoutField",2),viewProbeThicknessCertaintySteps:S("viewProbeThicknessCertaintySteps",4,[0,64]),viewProbeTwoSidedFoliageBackfaceDiffuse:p("viewProbeTwoSidedFoliageBackfaceDiffuse",!0),viewProbeSkylightLeakingRoughness:g("viewProbeSkylightLeakingRoughness",.3,R),viewProbeFullSkylightLeakingDistance:g("viewProbeFullSkylightLeakingDistance",10,[.001,10485.76]),viewProbeHeightFogOnGI:p("viewProbeHeightFogOnGI",!1),viewProbeMaxRoughnessToEvaluateRoughSpecular:g("viewProbeMaxRoughnessToEvaluateRoughSpecular",.8,R),viewProbeMaxRoughnessToEvaluateRoughSpecularForFoliage:g("viewProbeMaxRoughnessToEvaluateRoughSpecularForFoliage",-1,R),viewProbeFixedJitterIndex:S("viewProbeFixedJitterIndex",-1,[-1,we[1]]),viewProbeFixedStateFrameIndex:S("viewProbeFixedStateFrameIndex",-1,[-1,we[1]]),randomLightingFrozenFrame:S("randomLightingFrozenFrame",-1,[-1,we[1]])}),tbe=A({finalGatherAlgorithm:N("finalGatherAlgorithm","viewProbes",Kxe),diffuseGridNumClipmaps:S("diffuseGridNumClipmaps",4,[1,dS]),diffuseGridClipmapWorldExtent:g("diffuseGridClipmapWorldExtent",50,[.01,1e6]),diffuseGridClipmapDistributionBase:g("diffuseGridClipmapDistributionBase",2,[1,16]),diffuseGridNumProbesToTraceBudget:P("diffuseGridNumProbesToTraceBudget",100,0),diffuseGridResolution:S("diffuseGridResolution",64,[1,256]),diffuseGridProbeResolution:S("diffuseGridProbeResolution",16,[8,64]),diffuseGridIrradianceProbeResolution:S("diffuseGridIrradianceProbeResolution",6,[1,32]),diffuseGridOcclusionProbeResolution:S("diffuseGridOcclusionProbeResolution",16,[1,64]),diffuseGridNumMipmaps:S("diffuseGridNumMipmaps",3,[1,3]),diffuseGridProbeAtlasResolutionInProbes:S("diffuseGridProbeAtlasResolutionInProbes",128,[1,255]),diffuseGridProbeOcclusionBias:g("diffuseGridProbeOcclusionBias",.8,[0,100]),diffuseGridNearOcclusionRadius:g("diffuseGridNearOcclusionRadius",32,[0,4096]),diffuseGridInterpolateDownsampleFactor:S("diffuseGridInterpolateDownsampleFactor",2,[1,2]),diffuseGridMarkProbesDownsampleFactor:S("diffuseGridMarkProbesDownsampleFactor",2,[1,8]),diffuseGridAdaptivePlacement:p("diffuseGridAdaptivePlacement",!1),diffuseGridAdaptivePlacementFeedbackTileSize:S("diffuseGridAdaptivePlacementFeedbackTileSize",8,[1,256]),probeCacheIrradianceProbeOffsetMode:N("probeCacheIrradianceProbeOffsetMode","gbuffer",zxe),diffuseGridMaxRoughnessToEvaluateRoughSpecular:g("diffuseGridMaxRoughnessToEvaluateRoughSpecular",.8,R)}),rbe=A({resampledGatherDownsampleFactor:S("resampledGatherDownsampleFactor",2,[1,8]),resampledGatherFixedJitterIndex:S("resampledGatherFixedJitterIndex",-1,[-1,we[1]]),resampledGatherTemporalResampling:p("resampledGatherTemporalResampling",!0),resampledGatherValidateTemporalReservoirsEveryNFrames:S("resampledGatherValidateTemporalReservoirsEveryNFrames",0,[0,we[1]]),resampledGatherTemporalResamplingResetHistory:p("resampledGatherTemporalResamplingResetHistory",!1),resampledGatherSpatialResampling:p("resampledGatherSpatialResampling",!0),resampledGatherSpatialResamplingNumPasses:S("resampledGatherSpatialResamplingNumPasses",2,[0,16]),resampledGatherSpatialResamplingNumSamples:S("resampledGatherSpatialResamplingNumSamples",4,[0,64]),resampledGatherSpatialResamplingKernelRadius:y("resampledGatherSpatialResamplingKernelRadius",.05),resampledGatherResamplingAngleThreshold:g("resampledGatherResamplingAngleThreshold",25,[0,180]),resampledGatherResamplingDepthErrorThreshold:y("resampledGatherResamplingDepthErrorThreshold",.01),resampledGatherSpatialResamplingOcclusionScreenTraceDistance:y("resampledGatherSpatialResamplingOcclusionScreenTraceDistance",.2),resampledGatherMaxRayIntensity:y("resampledGatherMaxRayIntensity",100),resampledGatherUpsampleMethod:N("resampledGatherUpsampleMethod","spiral",qxe),resampledGatherUpsampleKernelSize:y("resampledGatherUpsampleKernelSize",3),resampledGatherUpsampleNumSamples:S("resampledGatherUpsampleNumSamples",16,[1,64]),resampledGatherTemporal:p("resampledGatherTemporal",!0),resampledGatherClearHistoryEveryFrame:p("resampledGatherClearHistoryEveryFrame",!1),resampledGatherTemporalDistanceThreshold:y("resampledGatherTemporalDistanceThreshold",.005),resampledGatherTemporalMaxFramesAccumulated:F("resampledGatherTemporalMaxFramesAccumulated",10),resampledGatherBilateralFilter:p("resampledGatherBilateralFilter",!0),resampledGatherBilateralFilterSpatialKernelRadius:y("resampledGatherBilateralFilterSpatialKernelRadius",.002),resampledGatherBilateralFilterNumSamples:S("resampledGatherBilateralFilterNumSamples",8,[1,16]),resampledGatherBilateralFilterDepthWeightScale:y("resampledGatherBilateralFilterDepthWeightScale",1e4),resampledGatherBilateralFilterNormalAngleThresholdScale:F("resampledGatherBilateralFilterNormalAngleThresholdScale",.2),resampledGatherBilateralFilterStrongBlurVarianceThreshold:y("resampledGatherBilateralFilterStrongBlurVarianceThreshold",.5),resampledGatherNearOcclusion:p("resampledGatherNearOcclusion",!0),resampledGatherNearOcclusionMaxScreenTraceFraction:g("resampledGatherNearOcclusionMaxScreenTraceFraction",.02,[0,1])}),I1=A({...Zxe,...Jxe,...ebe,...tbe,...rbe}),rz=X(I1),jct=e=>rz(e,"viewProbeNearOcclusion")&&!rz(e,"viewProbeExactMode");var yr={raster:{rules:w1,group:"viewDistance",named:!0},streaming:{rules:B3,group:"viewDistance"},worldStreaming:{rules:be,group:"viewDistance",world:"scene"},cut:{rules:Nn,group:"viewDistance",world:"scene"},dynamicResolution:{rules:g6,group:"viewDistance",world:"scene"},animation:{rules:i1,group:"viewDistance",world:"scene"},foliage:{rules:e6,group:"foliage",world:"scene"},marks:{rules:hl,group:"effects",world:"scene"},vehicleSounds:{rules:xu,group:"effects",world:"scene"},shading:{rules:L1,group:"viewDistance",world:"image"},exposure:{rules:SN,group:"viewDistance",member:"exposureSettings",world:"image"},temporal:{rules:gy,group:"edgeSmoothing",world:"image"},hiz:{rules:f1,group:"viewDistance",world:"image"},lightPattern:{rules:p1,group:"viewDistance",world:"image"},lightProfile:{rules:h1,group:"shadows",world:"image"},lightShape:{rules:m1,group:"shadows",world:"image"},rectLightAtlas:{rules:g1,group:"shadows",world:"image"},simpleLight:{rules:S1,group:"shadows",world:"image"},bakedLightVolume:{rules:Z6,group:"viewDistance",world:"image"},worldField:{rules:S6,group:"viewDistance",world:"image"},fieldSkyOcclusion:{rules:h6,group:"viewDistance",world:"image"},shadows:{rules:_a,group:"shadows",world:"image"},sampledLights:{rules:H6,group:"shadows",world:"image"},pathTracing:{rules:R1,group:"indirectLight",world:"image"},indirectLight:{rules:I1,group:"indirectLight",world:"image"},reflections:{rules:R6,group:"indirectLight",world:"image"},screenSpaceTracing:{rules:P6,group:"indirectLight",world:"image"},lightDataPacking:{rules:_6,group:"indirectLight",world:"image"},rayTracing:{rules:v6,group:"indirectLight",world:"image"},closures:{rules:x1,group:"effects",world:"image"},meshFieldTrace:{rules:M6,group:"indirectLight",world:"image"},surfaceAtlas:{rules:v1,group:"indirectLight",world:"image"},volumetricFog:{rules:Q6,group:"shadows",world:"image"},subsurfaceScattering:{rules:W6,group:"effects",world:"image"},translucentLightVolume:{rules:wy,group:"effects",world:"image"},orderIndependentTranslucency:{rules:C1,group:"effects",world:"image"},separateTranslucency:{rules:_1,group:"effects",world:"image"},translucentBounce:{rules:q6,group:"indirectLight",world:"image"},thinWater:{rules:b1,group:"effects",world:"image"},hairStrands:{rules:l1,group:"effects",world:"image"},markedDepth:{rules:c1,group:"effects",world:"image"},postProcessMaterial:{rules:u1,group:"effects",world:"image"},densityVolumeRendering:{rules:d1,group:"effects",world:"image"},tessellation:{rules:P1,group:"viewDistance",world:"image"},textureFiltering:{rules:D1,group:"textures",world:"image"},motionBlur:{rules:vw,group:"imageEffects",world:"image"},depthOfField:{rules:Lw,group:"imageEffects",world:"image"},bloom:{rules:Rw,group:"imageEffects",world:"image"},gaussianBlur:{rules:_w,group:"imageEffects",world:"image"},film:{rules:KT,group:"imageEffects",world:"image"},colorGrading:{rules:d6,group:"imageEffects",world:"image"},ambientOcclusion:{rules:l6,group:"imageEffects",world:"image"},ambientCubemap:{rules:uy,group:"indirectLight",world:"image"},cubeCapture:{rules:dy,group:"indirectLight",world:"image"},skyQuality:{rules:VS,group:null,groups:UO,world:"image"}},Ns={pixelError:{family:"cut",group:"viewDistance"},antialiasing:{family:"temporal",group:"edgeSmoothing"},bounce:{family:"indirectLight",group:"indirectLight"}};function nz(e){for(let[t,{rules:r}]of Object.entries(yr))if(Object.hasOwn(r,e))return t;return Object.hasOwn(Ns,e)?Ns[e].family:void 0}var gl=(e,t=yr)=>t[e].member??e,oz=e=>`set${e.charAt(0).toUpperCase()}${e.slice(1)}`;var nbe={exposure:["exposureBias","exposureMinBrightness","exposureMaxBrightness","exposureHistogramLogMin","exposureHistogramLogMax","exposureLowPercent","exposureHighPercent","exposureSpeedUp","exposureSpeedDown","exposureMethod","exposureApplyPhysicalCamera","exposureCameraShutterSpeed","exposureCameraIso","localExposureHighlightContrast","localExposureShadowContrast","localExposureDetailStrength","localExposureBlurBlend","localExposureBlurSize","localExposureMiddleGreyBias","localExposureHighlightThreshold","localExposureShadowThreshold","localExposureHighlightThresholdStrength","localExposureShadowThresholdStrength"],film:["filmGrainIntensity","filmGrainIntensityShadows","filmGrainIntensityMidtones","filmGrainIntensityHighlights","filmGrainShadowsMax","filmGrainHighlightsMin","filmGrainHighlightsMax","filmGrainScaleX","filmGrainScaleY","chromaticAberration","chromaticAberrationStartOffset","vignetteType","vignetteColorRed","vignetteColorGreen","vignetteColorBlue","vignetteCenterX","vignetteCenterY","vignetteSizeX","vignetteSizeY","vignetteSoftness","sceneColorTintRed","sceneColorTintGreen","sceneColorTintBlue"],colorGrading:["tonemappingMethod","filmSlope","filmToe","filmShoulder","filmBlackClip","filmWhiteClip","blueCorrection","expandGamut","toneCurveAmount","temperatureType","whiteTemperature","whiteTint","colorCorrectionShadowsMax","colorCorrectionHighlightsMin","colorCorrectionHighlightsMax"],ambientOcclusion:["ambientOcclusionIntensity","ambientOcclusionStaticShare","ambientOcclusionRadius","ambientOcclusionRadiusInWorldSpace","ambientOcclusionFadeDistance","ambientOcclusionFadeRadius","ambientOcclusionPower","ambientOcclusionBias","ambientOcclusionQuality","ambientOcclusionMipBlend","ambientOcclusionMipScale","ambientOcclusionMipThreshold","rayTracedAmbientOcclusionEnabled","rayTracedAmbientOcclusionPostProcessSamplesPerPixel","rayTracedAmbientOcclusionRadius","rayTracedAmbientOcclusionIntensity"],screenSpaceTracing:["screenReflectionQuality","screenReflectionIntensity","screenReflectionMaxRoughness"]},obe={vignette:y("vignette",$d),sharpness:g("sharpness",0,[0,uc])},ibe=(e,t)=>e==="colorGrading"?[...t,...s1.map(r=>r.field)]:t,k1;function sz(){if(k1)return k1;let e={...obe};for(let[t,r]of Object.entries(nbe)){let n=yr[t].rules;for(let o of ibe(t,r))e[o]=n[o]}return k1=e}var sbe=new Set(["rayTracedAmbientOcclusionRadius","rayTracedAmbientOcclusionIntensity"]),tdt=(e,t)=>t.kind!=="float"||sbe.has(e),iz=oe("postProcessSettings");function az(e,t){if(e===t)return!0;if(t===null||typeof t!="object")return!1;let r=sz(),n=t,o=0;for(let i in n){if(!Object.hasOwn(n,i))continue;if(!Object.hasOwn(r,i))return!1;let s=n[i];if(s!=null){if(!e||!Object.hasOwn(e,i)||!Hd(e[i],s))return!1;o++}}for(let i in e)o--;return o===0}function lz(e){if(e===null)return null;if(typeof e!="object")return iz(`must be an object or null, got ${String(e)}`);let t=sz(),r={};for(let[n,o]of Object.entries(e))Object.hasOwn(t,n)||iz(`${n} is no setting a camera's post-process holds`),o!=null&&(r[n]=hr(t[n],o));return Object.keys(r).length?Object.freeze(r):null}var abe=new Float64Array(4),xy=new Float64Array(3),cz=new Float64Array(4),lbe=new I,cbe=["fov","near","far","aspect","zoom","left","right","top","bottom","overscan"],rh=50,F1={perspective:"PerspectiveCamera",orthographic:"OrthographicCamera"};function uz(e){if(e==="perspective"||e==="orthographic")return e;throw new TypeError(`projection: must be 'perspective' or 'orthographic', got ${String(e)}`)}var jt=class e extends he{isCamera=!0;_optics;_fitAspect;_constrainAspectRatio;_post=null;_postWeight=1;_set=yu;viewTarget=new I;_projection;constructor(t,r={}){super(),this._projection=uz(t),this.type=F1[t],this._optics={fov:r.fov??rh,near:r.near??gA,far:r.far??2e3,aspect:r.aspect??1,zoom:r.zoom??1,left:r.left??-1,right:r.right??1,top:r.top??1,bottom:r.bottom??-1,overscan:r.overscan??0},this._fitAspect=r.fitAspect??!0,this._constrainAspectRatio=r.constrainAspectRatio??!1,Se(this.viewTarget,()=>this._link?.pose(this))}get projection(){return this._projection}set projection(t){t!==this._projection&&(this._projection=uz(t),this.type=F1[t],this.updateProjectionMatrix())}get fitAspect(){return this._fitAspect}set fitAspect(t){t!==this._fitAspect&&(this._fitAspect=t,this.updateProjectionMatrix())}get constrainAspectRatio(){return this._constrainAspectRatio}set constrainAspectRatio(t){t!==this._constrainAspectRatio&&(this._constrainAspectRatio=t,this._link?.pose(this))}get postProcessSettings(){return this._post}set postProcessSettings(t){az(this._post,t)||(this._post=lz(t),this._link?.pose(this))}get postProcessBlendWeight(){return this._postWeight}set postProcessBlendWeight(t){if(!Number.isFinite(t))throw new TypeError(`postProcessBlendWeight: must be a finite number, got ${String(t)}`);t!==this._postWeight&&(this._postWeight=t,this._link?.pose(this))}get clipPlane(){let[t,r,n,o]=this._set.clipPlane;return Z5(this._set.clipPlane)?{base:[t*o,r*o,n*o],normal:[t,r,n]}:null}set clipPlane(t){this.write({clipPlane:Q5(t)})}get hidden(){return this._set.hidden}set hidden(t){this.write({hidden:o1(t,"hidden")})}get showOnly(){return this._set.showOnly}set showOnly(t){this.write({showOnly:t===null?null:o1(t,"showOnly")})}get owner(){return this._set.owner}set owner(t){this.write({owner:J5(t)})}get _viewSet(){return this._set}set _viewSet(t){this._set=t}write(t){this._set=Object.freeze({...this._set,...t}),this._link?.pose(this)}get looksDownNegativeZ(){return!0}blank(){return new e(this.projection)}copy(t,r=!0){return super.copy(t,r),t instanceof e?(this._projection=t._projection,this.type=F1[t._projection],this._optics={...t._optics},this._fitAspect=t.fitAspect,this._constrainAspectRatio=t.constrainAspectRatio,this._post=t._post,this._postWeight=t._postWeight,this._set=t._set,this.viewTarget.copy(t.viewTarget),this.updateProjectionMatrix(),this):this}updateProjectionMatrix(){this._projectionMatrix&&n1(this._projectionMatrix,this),this._link?.pose(this)}get projectionMatrix(){return this._projectionMatrix??=n1(new ft,this)}get matrixWorldInverse(){return(this._matrixWorldInverse??=new ft).copy(this.matrixWorld).invert()}rayThrough(t,r,n,o=new po){this.updateWorldMatrix(!0,!1);let i=this.matrixWorld,s=ko(this);if(this.projection==="perspective"){let a=Rn(this.fov,s);o.origin.setFromMatrixPosition(i),o.direction.set(t*a*n,r*a,-1)}else{let[a,l,c,u]=ps(this,n,s,abe);o.origin.set(a+t*c,l+r*u,0).applyMatrix4(i),o.direction.set(0,0,-1)}return o.direction.transformDirection(i),o}set(t){t.fov!==void 0&&(this.fov=t.fov),this.position.set(...Lt(t.position));let r=Lt(t.target);this.lookAt(...r),this.setViewTarget(this.parent?this.parent.worldToLocal(lbe.set(...r)):r)}setViewTarget(t){if(!t)return this.viewTarget.set(0,0,0),this;let[r,n,o]=Lt(t),{position:i,quaternion:s,scale:a}=this;return zr(cz,s.elements),yt(xy,cz,r-i.x,n-i.y,o-i.z),this.viewTarget.set(xy[0]/a.x,xy[1]/a.y,xy[2]/a.z),this}};for(let e of cbe)Object.defineProperty(jt.prototype,e,{get(){return this._optics[e]},set(t){t!==this._optics[e]&&(this._optics[e]=t,this.updateProjectionMatrix())}});var dz={perspective:e=>new jt("perspective",e),orthographic:e=>new jt("orthographic",e),cube(e={}){let t=new jt("perspective",{fov:90,near:e.near,far:e.far});for(let[r,n,o]of[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]]){let i=new jt("perspective",{fov:90,near:e.near,far:e.far});t.add(i),i.up.set(0,n===0?-1:0,n===0?0:o===0?n:1),i.lookAt(r,n,o)}return t},stereo(){let t=new jt("perspective"),r=new jt("perspective");return t.position.x=-.064/2,r.position.x=.064/2,{left:t,right:r,eyeSep:.064}},array(e){let t=new jt("perspective");for(let r of e)t.add(r);return t}};var ube={...dz,cine:async e=>new(await M.cinematics.load()).FilmCamera(e)};var N1=G({name:"benchmark",summary:"The engine's measure of the machine, which gives each quality group its level under the preset 'auto' and is kept for the adapter, its code fetched by the first run.",enabledByDefault:!0,requires:[],parts:[]});var Un=["smooth","balanced","fine","max","cinematic"],Sl={native:1,sharp:1/1.5,mixed:1/1.7,fast:1/2,turbo:1/3},B1=Object.keys(Sl),Tdt=iu(Object.values(Sl)),fz={mode:"native",standard:!0},pz={mode:"native",standard:!0,dynamic:!0};var dbe={smooth:{},balanced:{},fine:{},max:{},cinematic:{}},fbe=10,by={...Object.fromEntries(oo.map(e=>[e,dbe])),edgeSmoothing:{smooth:{antialiasing:"low"},balanced:{antialiasing:"medium"},fine:{antialiasing:"high"},max:{},cinematic:{antialiasing:"max",temporalHistoryPacked:!1}},effects:{smooth:{...Wr.effects.smooth,...Zp.smooth,...Xp.smooth},balanced:{...Wr.effects.balanced,...Zp.balanced,...Xp.balanced},fine:{...Wr.effects.fine,...Zp.fine,...Xp.fine},max:{},cinematic:{...Wr.effects.cinematic,...Zp.cinematic,...Xp.cinematic}},viewDistance:{smooth:{cutViewDistanceScale:fy.smooth},balanced:{cutViewDistanceScale:fy.balanced},fine:{cutViewDistanceScale:fy.fine},max:{},cinematic:{cutViewDistanceScale:fbe}},imageEffects:{smooth:{...tp.smooth,...Zf.smooth,...Jf.smooth,...Qf.smooth,...zd.smooth,...$p.smooth,...Wr.imageEffects.smooth},balanced:{...tp.balanced,...Zf.balanced,...Jf.balanced,...Qf.balanced,...zd.balanced,...$p.balanced,...Wr.imageEffects.balanced},fine:{...tp.fine,...Zf.fine,...Jf.fine,...Qf.fine,...zd.fine,...$p.fine,...Wr.imageEffects.fine},max:{},cinematic:{...tp.cinematic,...Zf.cinematic,...Jf.cinematic,...Qf.cinematic,...zd.cinematic,...$p.cinematic,...f6.cinematic,...Wr.imageEffects.cinematic}},shadows:{smooth:{...Ef.smooth,...eh.smooth},balanced:{...Ef.balanced,...eh.balanced},fine:{...Ef.fine,...eh.fine},max:{},cinematic:{...Ef.cinematic,...eh.cinematic}},indirectLight:{smooth:{...th.smooth,...Wr.indirectLight.smooth,...Yp.smooth,...Jp.smooth},balanced:{...th.balanced,...Wr.indirectLight.balanced,...Yp.balanced,...Jp.balanced},fine:{...th.fine,...Wr.indirectLight.fine,...Yp.fine,...Jp.fine},max:{},cinematic:{...th.cinematic,...Wr.indirectLight.cinematic,...Yp.cinematic,...Jp.cinematic}},foliage:t6,textures:{smooth:Qp.smooth,balanced:Qp.balanced,fine:Qp.fine,max:{},cinematic:Qp.cinematic}};var nh={kind:"gpu",thresholds:[18,42,115]},U1={kind:"min",thresholds:[18,42,105]},hz={viewDistance:U1,edgeSmoothing:nh,shadows:U1,indirectLight:nh,imageEffects:nh,textures:nh,effects:U1,foliage:nh};function pbe(e,t,r){let n=e.kind==="min"&&r!==null?Math.min(r,t):t,o=0;for(let i of e.thresholds){if(n<i)break;o++}return o}function hbe(e,t){return{groups:Object.fromEntries(Object.keys(hz).map(n=>[n,Un[pbe(hz[n],e,t)]]))}}var V1=e=>e.gpuIndex===null?null:hbe(e.gpuIndex,e.cpuIndex),mz=3,G1=e=>[e.vendor,e.architecture,e.device,e.description].join("|");function gz(e,t){if(!e||typeof e!="object")return null;let r=e;if(r.version!==mz||r.adapter!==t)return null;let n=r.result??{},o=a=>a===null||typeof a=="number"&&Number.isFinite(a)&&a>0,i=a=>Array.isArray(a)&&a.every(l=>typeof l=="number"),s=a=>Number.isInteger(a)&&a>=1;return!o(n.cpuIndex)||!o(n.gpuIndex)||!i(n.cpuSteps)||!i(n.gpuSteps)||!s(n.workScale)||!s(n.gpuWorkScale)||!(Number(n.gpuMultiplier)>0)?null:r.result}var Sz=(e,t)=>({version:mz,adapter:t,result:e});var Xr=e=>e,ir={indirectFirstInstance:Xr("indirect-first-instance"),timestamp:Xr("timestamp-query"),subgroups:Xr("subgroups"),subgroupSizeControl:Xr("subgroup-size-control"),f16:Xr("shader-f16"),depthClipControl:Xr("depth-clip-control"),clipDistances:Xr("clip-distances"),dualSource:Xr("dual-source-blending"),float32Filterable:Xr("float32-filterable"),float32Blendable:Xr("float32-blendable"),textureTier1:Xr("texture-formats-tier1"),wideAtomics:Xr("atomic-vec2u-min-max"),textureTier2:Xr("texture-formats-tier2"),rg11b10Renderable:Xr("rg11b10ufloat-renderable")},Ey={bc7:"texture-compression-bc",astc:"texture-compression-astc",etc2:"texture-compression-etc2"},H1=[...Object.values(ir),...Object.values(Ey)],wz={[ir.subgroupSizeControl]:ir.subgroups,[ir.textureTier2]:ir.textureTier1},mbe=e=>e.get("trillion3dGpuFeaturesOff")?.split(",")??[],W1=yR(mbe,[]);function z1(e,t){let r=n=>e.some(o=>o.trim()===n);return r(t)||t in wz&&r(wz[t])}function gbe(e,t,r){let n=i=>e.has(i)&&!z1(r,i),o=n(ir.textureTier2)?2:n(ir.textureTier1)?1:0;return Object.freeze({subgroups:Object.freeze({present:n(ir.subgroups),minLanes:t?.subgroupMinSize??0,maxLanes:t?.subgroupMaxSize??0,sizeControl:n(ir.subgroupSizeControl)}),f16:n(ir.f16),float32Filterable:n(ir.float32Filterable),float32Blendable:n(ir.float32Blendable),wideAtomics:n(ir.wideAtomics),rg11b10Renderable:n(ir.rg11b10Renderable),textureTier:o,blockFormats:Object.freeze({bc7:n(Ey.bc7),astc:n(Ey.astc),etc2:n(Ey.etc2)}),timestamp:n(ir.timestamp),dualSource:n(ir.dualSource),clipDistances:n(ir.clipDistances),adapter:t?G1({vendor:t.vendor??"",architecture:t.architecture??"",device:t.device??"",description:t.description??""}):void 0})}var Sbe={has:()=>!1},wbe=new WeakMap,ybe=new WeakMap;function yz(e,t,r,n){let o=e.get(t);return o||e.set(t,o=gbe(r??Sbe,n,W1())),o}var j1=e=>yz(wbe,e,e.features,e.adapterInfo),$1=e=>yz(ybe,e,e,void 0),Jdt=e=>H1.filter(t=>e.features?.has(t)),eft=e=>$1(e).float32Filterable,xz={subgroups:e=>e.subgroups.present,f16:e=>e.f16,float32Filterable:e=>e.float32Filterable,float32Blendable:e=>e.float32Blendable,wideAtomics:e=>e.wideAtomics,textureTier1:e=>e.textureTier>=1,textureTier2:e=>e.textureTier>=2,clipDistances:e=>e.clipDistances,dualSource:e=>e.dualSource};function xbe(e,t){let r=xz[t](e);return{native:r,tag:`${t} ${r?"native":"polyfill"}`}}var tft=e=>Object.keys(xz).map(t=>xbe(e,t).tag).join(", ");var bz=e=>new E("WEBGPU_UNAVAILABLE",`Trillion3D draws with WebGPU only, and this browser grants none: ${e}. Open the page in a browser with WebGPU enabled.`),Ez=(e,t)=>new E("WEBGPU_LOST",`The GPU lost Trillion3D's device ${e} times in a row (${t}): it has no room for this page now. Close other pages that draw with the GPU, then reload.`,{final:!0,losses:e,message:t}),Tz=e=>new E("WEBGPU_LOST",`The page's WebGPU device was lost (${e}): ask for another and create the worlds that drew on it again.`,{final:!0,losses:1,message:e}),Y1=e=>({tier:"unavailable",extensions:[],reason:e,adapter:null});function bbe(e){let t=e.wgslLanguageFeatures,r=H3.filter(n=>!t?.has(n));return r.length?`its WGSL lacks ${r.join(", ")}`:void 0}var Ebe=e=>e.gpu??(typeof navigator>"u"?void 0:navigator.gpu),Az=e=>$1(e).timestamp?"full":"degraded";async function oh(e={}){let t=Ebe(e);if(!t)return Y1("the browser exposes no navigator.gpu");let r=bbe(t);if(r)return Y1(r);let n=await t.requestAdapter();return n?{tier:Az(n.features),extensions:[...n.features],reason:"WebGPU adapter available",adapter:n}:Y1("no WebGPU adapter")}var sft=(e,t=null)=>({tier:Az(e.features),extensions:[...e.features],reason:t?"WebGPU device granted":"WebGPU device handed in by the host",adapter:t});async function Oz(e,t=W1()){let r=H1.filter(i=>e.features.has(i)&&!z1(t,i)),n=e.limits,o={};for(let[i,s]of Object.entries(G3)){let a=n[i];typeof a=="number"&&Number.isFinite(a)&&(o[i]=Math.min(a,s))}return e.requestDevice({requiredFeatures:r,requiredLimits:o})}async function Tbe(e){if(!e.adapter)return e.reason;try{return await Oz(e.adapter)}catch(t){return`its adapter refused a device (${String(t)})`}}async function K1(){let e=await Tbe(await oh());if(typeof e=="string")throw bz(e);return e}var Abe={async detect(){let e=await oh();return{webgpu:e.tier!=="unavailable",tier:e.tier,features:e.extensions,reason:e.reason}},lighting:e=>Ua(e).lightingCapabilities()};function Obe(e,t,r){let n=new Uint8Array(t*r*4);for(let o=0;o<r;o++)n.set(e.subarray((r-1-o)*t*4,(r-o)*t*4),o*t*4);return n}function Lbe(e,t){for(let[r,n]of[["width",e],["height",t]])if(!Number.isInteger(n)||n<1)throw new E("INVALID_CAPTURE",`A capture's ${r} is a whole number of pixels, 1 or more`,{[r]:n})}async function Lz(e,t,r,n){Lbe(t,r);let o=await bw(e,async i=>(await i.frameWaits(),n(i)));return{width:t,height:r,data:Obe(o,t,r)}}var Rz=(e,t)=>Lz(e,t.width,t.height,r=>r.reference?r.capture(t):r.captureView(t.width,t.height)),Rbe={buffer:Rz,async surface(e,t){let{width:r,height:n,data:o}=await Rz(e,t),i=new OffscreenCanvas(r,n);return i.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(o.buffer),r,n),0,0),i.convertToBlob({type:t.type??"image/png"})},async model(e,t,r){return(await M.modelCapture.load()).captureModel(e,t,r)},async graphNode(e,t,r){return(await M.graphPreview.load()).previewGraphNode(e,t,r)}};async function _be(){return(await M.fields.load()).fields}var ih=e=>e.transparent?"blend":e.alphaTest>0?"mask":"opaque",Qr=e=>Array.isArray(e)?e[0]:e;var vbe=Object.freeze({front:"front",back:"back",double:"double"}),Mbe=Object.freeze({repeat:"repeat",clamp:"clamp",mirror:"mirror"}),Dbe=Object.freeze({nearest:"nearest",linear:"linear",nearestMipNearest:"nearestMipNearest",linearMipNearest:"linearMipNearest",nearestMipLinear:"nearestMipLinear",linearMipLinear:"linearMipLinear"}),Pbe=Object.freeze({normal:"normal",additive:"additive",subtractive:"subtractive",multiply:"multiply",alphaComposite:"alphaComposite",alphaHoldout:"alphaHoldout"}),sh=e=>e==="additive"||e==="subtractive"||e==="multiply"||e==="alphaHoldout",Ty=Object.freeze({lights:"lights",volumeSurface:"volumeSurface",volumeMedium:"volumeMedium",volumeAmbient:"volumeAmbient"}),ah=Ty.volumeAmbient,q1=e=>e?Ty.lights:Ty.volumeSurface,Cbe=Object.freeze({beforeDepthOfField:"beforeDepthOfField",afterDepthOfField:"afterDepthOfField",afterMotionBlur:"afterMotionBlur"}),Ibe=Object.freeze({srgb:"srgb",linear:"linear",none:"none"}),kbe=Object.freeze(Object.fromEntries(Object.keys(jd).map(e=>[e,e])));function Ay(){let e=new Map,t=new FinalizationRegistry(n=>{e.get(n)?.deref()||e.delete(n)}),r=n=>{let o=e.get(n);return o&&t.unregister(o),e.delete(n)};return{set(n,o){r(n);let i=new WeakRef(o);e.set(n,i),t.register(o,n,i)},get:n=>e.get(n)?.deref(),delete:r}}var X1="lightPattern",Q1=Ay(),Oy=new WeakMap,Fbe=0,_z=0,Nbe=e=>e.kind===X1;function Z1(e){if(!Nbe(e))throw new TypeError("a light pattern is a material made by material.lightPattern");let t=Oy.get(e);return t===void 0&&(Oy.set(e,t=`lightPattern${++Fbe}`),Q1.set(t,e)),t}function vz(e){let t=Oy.get(e);t!==void 0&&(Q1.delete(t),Oy.delete(e),_z++)}var Mft=()=>_z,Dft=e=>Q1.get(e);var wl="postProcess",J1=["sceneColorBeforeDof","sceneColorAfterDof","translucencyAfterDof","ssrInput","sceneColorBeforeBloom","replacingTonemapper","sceneColorAfterTonemapping"],Bbe=["less","lessEqual","greater","greaterEqual","equal","notEqual","never","always"],Ube=["sceneColor","sceneDepth","markedDepth","customStencil","postProcessInput0"],Ift=e=>Ube.includes(e),ev={blendableLocation:"sceneColorAfterTonemapping",blendablePriority:0,blendableOutputAlpha:!1,isBlendable:!0,disablePreExposureScale:!1,enableStencilTest:!1,stencilCompare:"less",stencilRefValue:0},Dz=e=>e.kind===wl,Mz=(e,t,r)=>e.includes(t)?t:r;function Pz(e){let t=ev,r=e.blendablePriority,n=e.stencilRefValue;return{location:Mz(J1,e.blendableLocation,t.blendableLocation),priority:Number.isInteger(r)?r:t.blendablePriority,outputAlpha:e.blendableOutputAlpha===!0,isBlendable:e.isBlendable!==!1,disablePreExposureScale:e.disablePreExposureScale===!0,stencilTest:e.enableStencilTest===!0,stencilCompare:Mz(Bbe,e.stencilCompare,t.stencilCompare),stencilRef:typeof n=="number"&&Number.isInteger(n)?k(n,0,255):0}}var bu="deferredDecal",Fft=["normal","alphaComposite"],Cz=e=>e.blending==="alphaComposite"?"alphaComposite":"normal";var se=(e,t,r={},n=[""])=>({inputs:e,required:t,props:r,outputs:n}),Zr=se(["input"],["input"]),Eu=(e,t)=>se(["a","b"],[],{constA:e,constB:t}),Ly=se(["a","b"],["a","b"]),lh=["rgb","r","g","b","a","rgba"],Iz=[...lh,"rg"],Uft=["none","level","bias","derivative"],Vft=["clamp","wrap","mirror"],Gft=["simplex","gradient","fastGradient","gradientAlu","valueAlu","voronoi"],Hft=["cellnoise","voronoi"],ch={constant:se([],[],{value:[0]}),scalarParameter:se([],[],{name:"",value:0}),vectorParameter:se([],[],{name:"",value:[0,0,0,1]},Iz),textureObject:se([],[]),textureParameter:se([],[],{name:""}),textureSample:se(["uv","texture","mip"],[],{name:"",mipMode:"none",constMip:-1,constCoordinate:0},lh),sparseVolumeTextureObject:se([],[],{source:-1}),sparseVolumeTextureParameter:se([],[],{name:"",source:-1}),sparseVolumeTextureSample:se(["uvw","texture","mip","ddx","ddy"],[],{source:-1,name:"",mipMode:"none",constMip:0,address:"clamp",attributes:0},lh),texCoord:se([],[],{index:0,uTiling:1,vTiling:1}),time:se([],[],{ignorePause:!1,overridePeriod:!1,period:0}),panner:se(["coordinate","time","speed"],[],{speedX:0,speedY:0,constCoordinate:0,fractionalPart:!1}),rotator:se(["coordinate","time"],[],{centerX:.5,centerY:.5,speed:.25,constCoordinate:0}),worldPosition:se([],[],{cameraRelative:!1},["rgb","rg","b"]),cameraPosition:se([],[]),objectPosition:se([],[],{cameraRelative:!1}),perInstanceRandom:se([],[]),perInstanceFadeAmount:se([],[]),vertexNormal:se([],[]),pixelNormal:se([],[]),vertexColor:se([],[],{},["rgb","r","g","b","a"]),cameraVector:se([],[]),sceneTexture:se(["uv"],[],{id:"postProcessInput0",filtered:!1},lh),sceneTextureSize:se([],[],{id:"postProcessInput0",inverse:!1}),noise:se(["position","filterWidth"],[],{constFilterWidth:0,relativeToCamera:!1,scale:1,quality:1,noiseFunction:"simplex",turbulence:!0,levels:6,outputMin:-1,outputMax:1,levelScale:2,tiling:!1,repeatSize:512}),vectorNoise:se(["position"],[],{noiseFunction:"cellnoise",quality:1,tiling:!1,tileSize:300}),add:Eu(0,1),subtract:Eu(1,1),multiply:Eu(0,1),divide:Eu(1,2),power:se(["base","exponent"],["base"],{constExponent:2}),abs:Zr,min:Eu(0,1),max:Eu(0,1),clamp:se(["input","min","max"],["input"],{mode:"clamp",constMin:0,constMax:1}),saturate:Zr,lerp:se(["a","b","alpha"],[],{constA:0,constB:1,constAlpha:.5}),oneMinus:Zr,frac:Zr,floor:Zr,ceil:Zr,sine:se(["input"],["input"],{period:1}),cosine:se(["input"],["input"],{period:1}),tangent:se(["input"],["input"],{period:1}),arctangent2:se(["y","x"],["y","x"]),fmod:Ly,sqrt:Zr,exp:Zr,exp2:Zr,log:Zr,log2:se(["x"],["x"]),log10:se(["x"],["x"]),sign:Zr,round:Zr,dot:Ly,cross:Ly,normalize:Zr,length:Zr,appendVector:Ly,componentMask:se(["input"],["input"],{r:!1,g:!1,b:!1,a:!1}),if:se(["a","b","aGreaterThanB","aEqualsB","aLessThanB"],["a","aGreaterThanB","aLessThanB"],{constB:0,equalsThreshold:1e-5}),fresnel:se(["exponent","baseReflectFraction","normal"],[],{constExponent:5,constBaseReflectFraction:.04}),desaturation:se(["input","fraction"],["input"],{luminance:[...rc]}),contrast:se(["input","amount","pivot"],["input"],{constAmount:1,constPivot:.5}),call:se([],[],{function:"",outputs:1}),functionInput:se(["preview"],[],{name:"",type:"f3",value:[0,0,0,0],usePreviewValueAsDefault:!1,called:!1}),collectionParameter:se([],[],{collection:"",name:"",value:[0]})},Vbe=256,Gbe=e=>Number.isInteger(e)&&e>=0&&e<=Vbe?e:0;function uh(e,t){if(e==="call")return Array.from({length:Gbe(t.outputs)},()=>"");if(e==="collectionParameter")return t.value.length===1?[""]:lh;if(e!=="constant")return ch[e].outputs;let r=t.value.length,n="rgba".slice(0,Math.max(r,1));return r===1?[""]:[n,..."rgba".slice(0,r),...r===4?["rgb"]:[]]}var Ry=(e,t)=>e==="vectorParameter"?t.value.length:void 0,kz=e=>Iz.indexOf("rgba".slice(0,e));var z=(e,t={})=>new E("INVALID_MATERIAL",`Material graph: ${e}`,t),jft=e=>e==="flex"||e==="f1"?1:Fz(e)?0:Number(e[1]),Fz=e=>e==="texture"||e==="sparseVolume",_y=e=>`f${e}`,tv=e=>!Fz(e),Tu=e=>e==="flex"?"scalar constant":e==="texture"?"texture":e==="sparseVolume"?"sparse volume texture":`float${e[1]}`;function vy(e,t){for(let r of e)if("rgba".indexOf(r)>=t)return!1;return!0}var My=(e,t,r={})=>z(`Not enough components in ${Tu(e)} for component mask ${t}`,r);function $ft(e,t){if(!tv(e))throw z(`${t} of a ${Tu(e)}`)}function Yft(e,t){if(!tv(e)||!tv(t))throw z(`arithmetic on a non-numeric value (${Tu(e)} and ${Tu(t)})`);if(e===t)return e;if(e==="flex"||e==="f1")return t;if(t==="flex"||t==="f1")return e;throw z(`arithmetic between ${Tu(e)} and ${Tu(t)} is undefined`)}var rv=["baseColor","metallic","roughness","normal","emissive","opacity"],Nz=(e,t)=>rv.includes(e)&&!(e==="normal"&&t==="alphaComposite");var Uz={baseColor:{type:"f3",fallback:[0,0,0]},metallic:{type:"f1",fallback:[0]},specular:{type:"f1",fallback:[.5]},roughness:{type:"f1",fallback:[.5]},emissive:{type:"f3",fallback:[0,0,0]},opacity:{type:"f1",fallback:[1]},opacityMask:{type:"f1",fallback:[1]},normal:{type:"f3",fallback:[0,0,1]},ambientOcclusion:{type:"f1",fallback:[1]},subsurfaceColor:{type:"f3",fallback:[1,1,1]},anisotropy:{type:"f1",fallback:[0]},tangent:{type:"f3",fallback:[1,0,0]},clearCoat:{type:"f1",fallback:[1]},clearCoatRoughness:{type:"f1",fallback:[.1]},refraction:{type:"f1",fallback:[1]},worldPositionOffset:{type:"f3",fallback:[0,0,0]},shadingModel:{type:"f1",fallback:[1]},pixelDepthOffset:{type:"f1",fallback:[0]},cloth:{type:"f1",fallback:[0]},displacement:{type:"f1",fallback:[.5]},clearCoatBottomNormal:{type:"f3",fallback:[0,0,1]},scatteringCoefficients:{type:"f3",fallback:[0,0,0]},absorptionCoefficients:{type:"f3",fallback:[0,0,0]},phaseG:{type:"f1",fallback:[0]},colorScaleBehindWater:{type:"f3",fallback:[1,1,1]},transmittanceColor:{type:"f3",fallback:[.5,.5,.5]},surfaceCoverage:{type:"f1",fallback:[1]}},Vn={unlit:0,defaultLit:1,subsurface:2,preintegratedSkin:3,clearCoat:4,subsurfaceProfile:5,twoSidedFoliage:6,hair:7,cloth:8,eye:9,thinWater:10,thinTranslucent:11},Vz={surface:Object.keys(Uz),lightPattern:["emissive"],volume:["baseColor","subsurfaceColor","emissive"],postProcess:["emissive","opacity"],deferredDecal:rv},Gz=e=>wW.includes(e),Hbe=e=>typeof e=="string"&&Object.hasOwn(Uz,e);function Hz(e,t){if(!Hbe(t))throw z(`'${t}' is not an output`,{output:t});if(!Vz[e].includes(t))throw z(`the ${e} domain does not read '${t}'`,{domain:e,output:t})}var Wbe=["emissive","opacity","opacityMask","worldPositionOffset","pixelDepthOffset","displacement"],Wz=["scatteringCoefficients","absorptionCoefficients","phaseG","colorScaleBehindWater"],zz=e=>!!e&&Wz.some(t=>e[t]!==void 0),jz=["transmittanceColor","surfaceCoverage"],$z=e=>!!e&&jz.some(t=>e[t]!==void 0),zbe=["opacity","worldPositionOffset","pixelDepthOffset"],jbe=["cloth","displacement","clearCoatBottomNormal"];function Jft(e,t,r){return Vz[e].includes(t)?e==="deferredDecal"?Nz(t,r.blend):e!=="surface"?!0:r.blend==="alphaHoldout"?zbe.includes(t):r.blend!=="alphaComposite"?Bz(t,r):Bz(t,{...r,blend:"blend"}):!1}function Bz(e,{blend:t,lit:r=!0,translucent:n=!0,models:o=!1,water:i=!1,thin:s=!1}){return Wz.includes(e)?i&&r:jz.includes(e)?s&&r:!r&&!Wbe.includes(e)?!1:e==="pixelDepthOffset"?!0:jbe.includes(e)?!n&&t!=="blend":e==="shadingModel"?n||t!=="blend":e==="refraction"?n||i:e==="opacity"?t==="blend"||i||s||o&&r&&!n:e!=="opacityMask"||t==="mask"}var Kz=8,nv=15,$be=["baseColor","metallic","specular","roughness","emissive","normal","ambientOcclusion","subsurfaceColor","anisotropy","tangent","clearCoat","clearCoatRoughness","cloth","clearCoatBottomNormal"],Ybe=["slab","horizontal","vertical","add","weight"];function Kbe(e,t){let r=e[t];for(;r.kind!=="slab";)r=e[fh(r)[0]];return r}function rpt(e){return e.closureRoot===void 0?e.outputs:{...e.outputs,...Kbe(e.closureNodes,e.closureRoot).attributes}}function qz(e,t){return e.outputs[t]?!0:e.closureRoot!==void 0&&qbe(e.closureNodes,e.closureRoot).some(r=>r.attributes[t])}var ov=(e,t)=>e.kind==="vertical"&&t===1;function dh(e,t,r,n=0){let o=e[t];r(o,n,n>0),fh(o).forEach((i,s)=>dh(e,i,r,n+(ov(o,s)?1:0)))}function qbe(e,t){let r=[];return dh(e,t,n=>{n.kind==="slab"&&r.push(n)}),r}function fh(e){switch(e.kind){case"slab":return[];case"horizontal":return[e.background,e.foreground];case"vertical":return[e.top,e.base];case"add":return[e.a,e.b];case"weight":return[e.input]}}var Xz=e=>e.kind==="horizontal"?e.mix:e.kind==="weight"?e.weight:void 0;function Qz(e){let t=Xz(e);return typeof t=="object"?[t]:[]}var Yz=e=>!!e&&typeof e=="object"&&Number.isInteger(e.node)&&Number.isInteger(e.output);function Zz(e,t){let r=e?.kind;if(!Ybe.includes(r))throw z("a closure node is of a kind that does not exist",{kind:r});let n={...e,id:t};if(n.kind==="slab"){if(!n.attributes||typeof n.attributes!="object"||Array.isArray(n.attributes))throw z("a slab lists its attributes as wires by output");for(let[i,s]of Object.entries(n.attributes)){if(!$be.includes(i))throw z(`'${i}' is not an output a closure owns`,{output:i});if(!Yz(s))throw z(`the ${i} attribute of a slab is not a wire`)}}if("blend"in n&&typeof n.blend!="boolean")throw z("a closure operator says whether it blends with a boolean");for(let i of fh(n))if(!Number.isInteger(i)||i<0||i>=t)throw z("a closure operator names a closure that does not exist",{child:i});let o=Xz(n);if(o!==void 0&&(typeof o=="number"?!Number.isFinite(o):!Yz(o)))throw z("a closure operand is neither a number nor a wire")}function Jz(e,t){if(!e[t])throw z("the closure root does not exist",{root:t});let r=new Set;dh(e,t,n=>{if(r.has(n.id))throw z("a closure node is used more than once in the tree",{node:n.id});r.add(n.id)})}var Xbe=0,Au=e=>typeof e=="object"&&e!==null&&!e.isTexture,Ou=e=>Au(e)?Array.from(e):e,mn=Symbol("hold value"),Qbe=(e,t)=>Array.isArray(t)?Array.isArray(e)&&e.every(r=>Number.isFinite(r)):typeof e==typeof t&&(typeof e!="number"||Number.isFinite(e)),Dy=class{isMaterialGraph=!0;id=++Xbe;domain;nodes=[];outputs={};closureNodes=[];closureRoot;textures=new Map;values=new Map;version=0;shape=0;signed;valued;_listeners=fe();heard=()=>this.changed();constructor(t){let r=dt("materialDomain",t);if(!Gz(r))throw z(`unknown domain '${String(r)}'`);this.domain=r}changed(t=!1){this.version++,this._listeners.emit(t)}addNode(t,r={},n={},o){let i=this.nodes.length,s=ch[t];if(!s)throw z(`unknown node '${String(t)}'`,{node:i});for(let[l,c]of Object.entries(r))if(!(l in s.props)||!Qbe(c,s.props[l]))throw z(`${t} has no property '${l}' of that kind`,{node:i,kind:t,name:l});for(let[l,c]of Object.entries(n)){if(t!=="call"&&!s.inputs.includes(l))throw z(`${t} has no input '${l}'`,{node:i,kind:t,name:l});this.assertPin(c,i)}let a={...s.props,...r};return(t==="sceneTexture"||t==="sceneTextureSize")&&(a.id=dt("sceneTexture",a.id)),this.nodes.push({id:i,kind:t,props:a,inputs:{...n}}),o&&this.holdTexture(i,o),this.shape++,this.changed(),{node:i,output:0}}addClosureNode(t){if(this.domain!=="surface")throw z("only a surface has closures");Zz(t,this.closureNodes.length);let r={...t,id:this.closureNodes.length};for(let n of t.kind==="slab"?Object.values(t.attributes):Qz(r))this.assertPin(n);return this.closureNodes.push(r),this.shape++,this.changed(),r.id}setClosureRoot(t){if(!this.closureNodes[t])throw z("the closure root does not exist",{root:t});this.closureRoot=t,this.shape++,this.changed()}assertPin(t,r){let n=this.nodes[t?.node];if(!n||!Number.isInteger(t.output)||t.output<0||t.output>=uh(n.kind,n.props).length)throw z("a wire names a node or output that does not exist",{pin:t,...r!==void 0&&{node:r}})}holdTexture(t,r){if(!r.isTexture)throw z("a texture node needs a texture",{node:t});this.textures.set(t,r),r._listeners?.subscribe(this.heard)}signature(){return this.signed?.shape!==this.shape&&(this.signed={shape:this.shape,text:this.signatureText()}),this.signed.text}signatureText(){let t=this.nodes.map(({kind:o,props:i,inputs:s})=>[o,i,s]),r=[...this.textures].map(([o,i])=>`${o}:${i.id}`),n=this.closureRoot===void 0?[]:[this.closureNodes,this.closureRoot];return JSON.stringify([this.domain,t,this.outputs,r,...n])}signedAs(t){this.signed={shape:this.shape,text:t.signature()}}valuesSignature(){if(this.valued?.version===this.version)return this.valued.text;let t=[...this.values].map(([n,o])=>[n,o.isTexture?`texture:${o.id}`:o]),r=JSON.stringify(t);return this.valued={version:this.version,text:r},r}readTextures(){let t=[...this.values.values()].filter(r=>!!r.isTexture);return[...new Set([...this.textures.values(),...t])]}output(t,r){Hz(this.domain,t),this.assertPin(r),this.outputs[t]=r,this.shape++,this.changed()}reads(t){return[...this.textures.values(),...this.values.values()].includes(t)}set(t,r){this[mn](t,r)}[mn](t,r){let n=this.values.get(t);r.isTexture&&r._listeners?.subscribe(this.heard),this.values.set(t,r),n?.isTexture&&n!==r&&!this.reads(n)&&n._listeners?.unsubscribe(this.heard),this.changed(!0)}};var Zbe=e=>e[0].toUpperCase()+e.slice(1),yl=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),Py=class extends Dy{wire(t,r,n={}){let o={};for(let[i,s]of Object.entries(r)){if(s===void 0)continue;let a=`const${Zbe(i)}`;typeof s!="number"?o[i]=s:a in ch[t].props?n[a]=s:o[i]=this.constant(s)}return this.addNode(t,n,o)}constant(...t){if(t.length<1||t.length>4)throw z("a constant holds one to four numbers",{node:this.nodes.length});return this.addNode("constant",{value:t})}channel(t,r){let n=this.nodes[t.node],o=uh(n.kind,n.props).indexOf(r);if(o<0)throw z(`${n.kind} has no '${r}' output`,{node:t.node});let i=Ry(n.kind,n.props);if(i!==void 0&&!vy(r,i))throw My(_y(i),r,{node:t.node});return{node:t.node,output:o}}widthAt(t){let r=this.nodes[t?.node],n=r?uh(r.kind,r.props)[t.output]:void 0;return n&&n.length>1?n.length:void 0}};var Cy=class extends Py{add(t,r){return this.wire("add",{a:t,b:r})}subtract(t,r){return this.wire("subtract",{a:t,b:r})}multiply(t,r){return this.wire("multiply",{a:t,b:r})}divide(t,r){return this.wire("divide",{a:t,b:r})}min(t,r){return this.wire("min",{a:t,b:r})}max(t,r){return this.wire("max",{a:t,b:r})}lerp(t,r,n){return this.wire("lerp",{a:t,b:r,alpha:n})}power(t,r){return this.wire("power",{base:t,exponent:r})}clamp(t,r,n,o="clamp"){return this.wire("clamp",{input:t,min:r,max:n},{mode:o})}if(t,r,n,o,i,s=1e-5){return this.wire("if",{a:t,b:r,aGreaterThanB:n,aEqualsB:o,aLessThanB:i},{equalsThreshold:s})}sine(t,r=1){return this.trig("sine",t,r)}cosine(t,r=1){return this.trig("cosine",t,r)}tangent(t,r=1){return this.trig("tangent",t,r)}trig(t,r,n){return this.addNode(t,{period:n},{input:r})}arctangent2(t,r){return this.addNode("arctangent2",{},{y:t,x:r})}fmod(t,r){return this.addNode("fmod",{},{a:t,b:r})}sqrt(t){return this.addNode("sqrt",{},{input:t})}exp(t){return this.addNode("exp",{},{input:t})}exp2(t){return this.addNode("exp2",{},{input:t})}log(t){return this.addNode("log",{},{input:t})}log2(t){return this.addNode("log2",{},{x:t})}log10(t){return this.addNode("log10",{},{x:t})}sign(t){return this.addNode("sign",{},{input:t})}round(t){return this.addNode("round",{},{input:t})}fresnel(t={}){return this.wire("fresnel",t)}desaturation(t,r,n){return this.wire("desaturation",{input:t,fraction:r},n?{luminance:n}:{})}contrast(t,r,n){return this.wire("contrast",{input:t,amount:r,pivot:n})}abs(t){return this.addNode("abs",{},{input:t})}saturate(t){return this.addNode("saturate",{},{input:t})}oneMinus(t){return this.addNode("oneMinus",{},{input:t})}frac(t){return this.addNode("frac",{},{input:t})}floor(t){return this.addNode("floor",{},{input:t})}ceil(t){return this.addNode("ceil",{},{input:t})}normalize(t){return this.addNode("normalize",{},{input:t})}length(t){return this.addNode("length",{},{input:t})}dot(t,r){return this.addNode("dot",{},{a:t,b:r})}cross(t,r){return this.addNode("cross",{},{a:t,b:r})}appendVector(t,r){return this.addNode("appendVector",{},{a:t,b:r})}componentMask(t,r){let n=this.widthAt(t);if(n!==void 0&&!vy(r,n))throw My(_y(n),r,{node:this.nodes.length});let o=Object.fromEntries([..."rgba"].map(i=>[i,r.includes(i)]));return this.addNode("componentMask",o,{input:t})}};var Iy=class extends Cy{scalarParameter(t,r=0){return this.addNode("scalarParameter",{name:t,value:r})}vectorParameter(t,r=[0,0,0,1]){if(!(r.length>=2&&r.length<=4))throw z("a vector parameter holds two to four numbers",{node:this.nodes.length});let{node:n}=this.addNode("vectorParameter",{name:t,value:[...r]});return{node:n,output:kz(r.length)}}textureObject(t){return this.addNode("textureObject",{},{},t)}textureParameter(t,r){return this.addNode("textureParameter",{name:t},{},r)}textureSample(t,r={}){let{uv:n,texture:o,mip:i,...s}=r,a={};n&&(a.uv=n),o&&(a.texture=o);let l=yl(s);return typeof i=="number"?l.constMip=i:i&&(a.mip=i),this.addNode("textureSample",l,a,t)}sparseVolumeTextureObject(t){return this.addNode("sparseVolumeTextureObject",{source:t})}sparseVolumeTextureParameter(t,r){return this.addNode("sparseVolumeTextureParameter",{name:t,source:r})}sparseVolumeTextureSample(t,r={}){let{uvw:n,texture:o,mip:i,ddx:s,ddy:a,...l}=r,c={};for(let[d,f]of Object.entries({uvw:n,texture:o,ddx:s,ddy:a}))f&&(c[d]=f);let u=yl(l);return t!==void 0&&(u.source=t),typeof i=="number"?u.constMip=i:i&&(c.mip=i),this.addNode("sparseVolumeTextureSample",u,c)}texCoord(t=0,r=1,n=1){return this.addNode("texCoord",{index:t,uTiling:r,vTiling:n})}time(t,r=!1){let n=t===void 0?{}:{overridePeriod:!0,period:t};return this.addNode("time",{ignorePause:r,...n})}panner(t={}){let{speed:r,coordinate:n,time:o,...i}=t,s=Array.isArray(r)?r:void 0,a=yl({...i,speedX:s?.[0],speedY:s?.[1]});return this.wire("panner",{coordinate:n,time:o,speed:s?void 0:r},a)}rotator(t={}){let{coordinate:r,time:n,...o}=t;return this.wire("rotator",{coordinate:r,time:n},yl(o))}worldPosition(t=!1){return this.addNode("worldPosition",{cameraRelative:t})}cameraPosition(){return this.addNode("cameraPosition")}objectPosition(t=!1){return this.addNode("objectPosition",{cameraRelative:t})}perInstanceRandom(){return this.addNode("perInstanceRandom")}perInstanceFadeAmount(){return this.addNode("perInstanceFadeAmount")}vertexNormal(){return this.addNode("vertexNormal")}pixelNormal(){return this.addNode("pixelNormal")}vertexColor(){return this.addNode("vertexColor")}cameraVector(){return this.addNode("cameraVector")}sceneTexture(t="postProcessInput0",r,n=!1){return this.wire("sceneTexture",{uv:r},{id:t,filtered:n})}sceneTextureSize(t="postProcessInput0",r=!1){return this.addNode("sceneTextureSize",{id:t,inverse:r})}noise(t={}){let{position:r,filterWidth:n,...o}=t;return this.wire("noise",{position:r,filterWidth:n},yl(o))}vectorNoise(t={}){let{position:r,...n}=t;return this.wire("vectorNoise",{position:r},yl(n))}};var ky=new Map,ej=new WeakMap,Jbe=new FinalizationRegistry(({channel:e,reader:t})=>e.readers.delete(t)),eEe=(e,t)=>`@${e}/${t}`;var iv=e=>{let t=ky.get(e);return t||ky.set(e,t={readers:new Set}),t};function tj(e,t,r){if(typeof r=="number"&&Number.isFinite(r))return r;let n=r;if(Array.isArray(n)&&n.length>=2&&n.length<=4&&n.every(o=>typeof o=="number"&&Number.isFinite(o)))return Object.freeze([...n]);throw z(`parameter '${t}' of collection '${e}' is a number or two to four numbers`,{collection:e,name:t})}function sv(e,t,r){let n=e.graph.deref(),o=t.get(r);if(!n||o===void 0)return;let i=eEe(t.name,r);n.values.get(i)!==o&&n.set(i,o)}var ph=class{isParameterCollection=!0;name;held=new Map;version=0;constructor(t,r={}){if(typeof t!="string"||!t)throw z("a parameter collection needs a name");let n=iv(t);if(n.collection)throw z(`a parameter collection named '${t}' exists: dispose it first`,{collection:t});this.name=t;for(let[o,i]of Object.entries(r))this.held.set(o,tj(t,o,i));n.collection=this,this.tell()}get(t){return this.held.get(t)}names(){return[...this.held.keys()]}set(t,r){let n=this.held.get(t);if(n===void 0)throw z(`parameter collection '${this.name}' has no parameter '${t}'`,{collection:this.name,name:t});let o=tj(this.name,t,r);if(typeof o!=typeof n)throw z(`parameter '${t}' of collection '${this.name}' keeps its kind`,{collection:this.name,name:t});this.held.set(t,o),this.version++,this.tell(t)}dispose(){let t=ky.get(this.name);t?.collection===this&&(t.collection=void 0)}tell(t){for(let r of iv(this.name).readers)if(t===void 0)for(let n of r.names)sv(r,this,n);else r.names.has(t)&&sv(r,this,t)}};function rj(e,t,r){let n=ej.get(e);n||ej.set(e,n=new Map);let o=n.get(t);if(!o){let s=iv(t);n.set(t,o={graph:new WeakRef(e),names:new Set}),s.readers.add(o),Jbe.register(e,{channel:s,reader:o})}o.names.add(r);let i=ky.get(t)?.collection;i&&sv(o,i,r)}var tEe=/^(scalar|vector|texture|sparseVolumeTexture)(Parameter|Sample)$/;function av(e,t,r){for(let n of e.nodes){let o=n.kind==="call"&&e.functions.get(n.props.function),i=o?av(o,t,r):(t===void 0||n.props.name===t)&&tEe.test(n.kind)?r(n,e):void 0;if(i!==void 0)return i}}var rEe=({props:e,id:t},r)=>e.value??r.textures.get(t)??e.source,nj=new WeakMap;function nEe(e){let t=nj.get(e);if(t&&t.shape===e.shape)return t.counts;let r=new Map;return av(e,void 0,({kind:n,props:o})=>{let i=Ry(n,o),s=o.name;i!==void 0&&!r.has(s)&&r.set(s,i)}),nj.set(e,{shape:e.shape,counts:r}),r}var oEe=e=>typeof e=="number"?"one number":Array.isArray(e)?`${e.length}`:"a texture";function Fy(e,t,r){let n=nEe(e).get(t);if(!(n===void 0||Array.isArray(r)&&r.length===n))throw z(`parameter '${t}' takes ${n} numbers, not ${oEe(r)}`,{name:t})}var Rpt=(e,t)=>e.values.get(t)??av(e,t,rEe);function oj(e,t=[]){for(let r of e.nodes)r.kind==="collectionParameter"&&t.push([r.props.collection,r.props.name]);for(let r of e.functions.values())oj(r,t);return t}var Lu=class extends Iy{functions=new Map;reshaped=()=>{this.shape++,this.changed(),this.followCollections()};call(t,r={}){let n=this.nodes.length;if(!t?.isMaterialPart)throw z("a call runs a material part",{node:n});let o=t.inputNames();for(let a of Object.keys(r))if(!o.includes(a))throw z(`function '${t.name}' has no input '${a}'`,{node:n,input:a});let i=t.outputNames();if(!i.length)throw z(`function '${t.name}' has no output`,{node:n});this.assertHoldable(t);let s=this.addNode("call",{function:t.name,outputs:i.length},r);return this.holdFunction(t),Object.fromEntries(i.map((a,l)=>[a,{node:s.node,output:l}]))}collectionParameter(t,r){let n=t?.get(r);if(n===void 0)throw z(`parameter collection '${t?.name}' has no parameter '${r}'`,{node:this.nodes.length});let o=typeof n=="number"?[n]:[...n],i=this.addNode("collectionParameter",{collection:t.name,name:r,value:o});return this.followCollections(),i}set(t,r){Fy(this,t,r),this[mn](t,r)}reaches(t){for(let r of this.functions.values())if(r===t||r.reaches(t))return!0;return!1}assertHoldable(t){let r=this.functions.get(t.name);if(r&&r!==t)throw z(`the graph holds another function named '${t.name}'`,{node:this.nodes.length,function:t.name});if(t===this||t.reaches(this))throw z(`function '${t.name}' would call itself`,{node:this.nodes.length,function:t.name})}holdFunction(t,r=!0){this.assertHoldable(t),this.functions.get(t.name)!==t&&(this.functions.set(t.name,t),t._listeners.subscribe(this.reshaped),r&&this.followCollections())}followCollections(){for(let[t,r]of oj(this))rj(this,t,r)}signatureText(){let t=super.signatureText();if(!this.functions.size)return t;let r=[...this.functions].map(([n,o])=>[n,o.signature()]);return`${t}|${JSON.stringify(r)}`}replay(t,r,n){for(let i of t)this.holdFunction(i,!n);let o=this.isMaterialPart?"function":"graph";for(let i of r){if(i.id!==this.nodes.length)throw z(`a saved ${o} lists its nodes out of order`,{node:this.nodes.length});this.addNode(i.kind,i.props,i.inputs,n?.get(i.id))}}};function Ny(e,t,r=[]){if(e.textures.size||r.some(n=>n.isTexture))throw new E("SCENE_NOT_SAVABLE","A saved scene cannot store a texture",{parameter:t})}var iEe=(e,t)=>e.nodes.some(r=>r.kind===t)||[...e.functions.values()].some(r=>iEe(r,t));var sEe=["f1","f2","f3","f4","texture"],Ru=class e extends Lu{isMaterialPart=!0;name;results=[];constructor(t){if(super("surface"),typeof t!="string"||!t)throw z("a material part needs a name");this.name=t}functionInput(t,r={}){let n=this.nodes.length;if(typeof t!="string"||!t)throw z("a function input needs a name",{node:n});if(this.inputNames().includes(t))throw z(`function '${this.name}' has two inputs named '${t}'`,{node:n,input:t});let o=r.type??"f3";if(!sEe.includes(o))throw z(`a function input has no type '${String(o)}'`,{node:n,input:t});let i=r.value??[];if(i.length>4)throw z("a function input holds up to four numbers",{node:n});let s=[0,1,2,3].map(c=>i[c]??0),a=r.usePreviewValueAsDefault===!0,l=r.preview?{preview:r.preview}:{};return this.addNode("functionInput",{name:t,type:o,value:s,usePreviewValueAsDefault:a},l)}output(t,r){if(typeof t!="string"||!t)throw z("a function output needs a name");this.assertPin(r);let n={name:t,pin:{node:r.node,output:r.output}},o=this.results.findIndex(i=>i.name===t);o<0?this.results.push(n):this.results[o]=n,this.shape++,this.changed()}inputNames(){return this.nodes.filter(t=>t.kind==="functionInput").map(t=>t.props.name)}outputNames(){return this.results.map(t=>t.name)}followCollections(){}signatureText(){return`${super.signatureText()}|${JSON.stringify([this.name,this.results])}`}toJSON(){return Ny(this,"function"),{name:this.name,nodes:this.nodes.map(t=>structuredClone(t)),outputs:this.results.map(({name:t,pin:r})=>[t,{...r}]),...this.functions.size&&{functions:lv(this.functions)}}}static fromJSON(t){if(!t||typeof t!="object"||!Array.isArray(t.nodes))throw z("not a saved material part");let r=new e(t.name);r.replay(cv(t.functions),t.nodes);for(let[n,o]of t.outputs??[])r.output(n,o);return r}clone(){let t=new e(this.name);t.replay([...this.functions.values()].map(r=>r.clone()),this.nodes,this.textures);for(let{name:r,pin:n}of this.results)t.output(r,n);return t.signedAs(this),t}},lv=e=>Object.fromEntries([...e].map(([t,r])=>[t,r.toJSON()]));function cv(e){if(e===void 0)return[];if(!e||typeof e!="object")throw z("saved functions are listed by name");return Object.entries(e).map(([t,r])=>{let n=Ru.fromJSON(r);if(n.name!==t)throw z("a saved function is listed under another name");return n})}var Gpt=e=>e.terms.some(t=>!(t.kind==="weight"&&t.value===1));function aj(e,t,r){let n=new Set(e.filter(a=>"blend"in a&&a.blend).map(a=>a.id)),o=[];dh(e,t,({id:a,kind:l},c)=>{(l==="vertical"||l==="horizontal"||l==="add")&&o.push({id:a,depth:c})}),o.sort((a,l)=>a.depth-l.depth||a.id-l.id);let i=()=>aEe(e,t,n),s=i();for(;s.closures.length>r&&o.length;)n.add(o.pop().id),s=i();if(s.operators>nv)throw z(`the closure tree holds ${s.operators} operators, at most ${nv}`);return{closures:s.closures,operators:s.operators}}function aEe(e,t,r){let n=[],o=0,i=(a,l,c,u)=>{let d=e[a];if(d.kind==="slab")return void u.push({slab:a,terms:l,under:c});for(let[f,[h,m]]of sj(d).entries())i(h,ij(l,m),c||ov(d,f),u)},s=(a,l,c)=>{let u=e[a];if(o++,u.kind==="slab"||r.has(a)){let d=[];return i(a,[],!1,d),n.push({root:a,terms:l,members:d,layers:c}),[n.length-1]}if(u.kind==="vertical"){let d=s(u.top,l,c);return[...d,...s(u.base,l,[...c,{tops:d,outside:l.length}])]}return sj(u).flatMap(([d,f])=>s(d,ij(l,f),c))};return s(t,[],[]),{closures:n,operators:o}}var ij=(e,t)=>t?[...e,t]:e;function sj(e){switch(e.kind){case"weight":return[[e.input,{kind:"weight",value:e.weight}]];case"horizontal":return[[e.background,{kind:"unmix",value:e.mix}],[e.foreground,{kind:"mix",value:e.mix}]];default:return fh(e).map(t=>[t,void 0])}}var gn=class e extends Lu{slab(t){return this.addClosureNode({kind:"slab",attributes:{...t}})}horizontalMix(t,r,n=.5,o=!1){return this.addClosureNode({kind:"horizontal",background:t,foreground:r,mix:n,blend:o})}verticalLayer(t,r,n=!1){return this.addClosureNode({kind:"vertical",top:t,base:r,blend:n})}addClosures(t,r,n=!1){return this.addClosureNode({kind:"add",a:t,b:r,blend:n})}weightClosure(t,r){return this.addClosureNode({kind:"weight",input:t,weight:r})}closures(t){Jz(this.closureNodes,t),aj(this.closureNodes,t,Kz),this.setClosureRoot(t)}toJSON(){let t=[...this.values];return Ny(this,"graph",[...this.values.values()]),{domain:this.domain,nodes:this.nodes.map(r=>structuredClone(r)),outputs:structuredClone(this.outputs),...this.closureRoot!==void 0&&{closures:{nodes:structuredClone(this.closureNodes),root:this.closureRoot}},...this.functions.size&&{functions:lv(this.functions)},...t.length&&{values:Object.fromEntries(t)}}}static fromJSON(t){if(!t||!Array.isArray(t.nodes))throw z("not a saved graph");let r=new e(t.domain);r.replay(cv(t.functions),t.nodes);for(let[n,o]of Object.entries(t.outputs??{}))r.output(n,o);t.closures&&r.restoreClosures(t.closures);for(let[n,o]of Object.entries(t.values??{}))r[mn](n,o);return r.followCollections(),r}clone(){let t=new e(this.domain);t.replay([...this.functions.values()].map(r=>r.clone()),this.nodes,this.textures);for(let[r,n]of Object.entries(this.outputs))t.output(r,n);this.closureRoot!==void 0&&t.restoreClosures({nodes:this.closureNodes,root:this.closureRoot});for(let[r,n]of this.values)t[mn](r,Ou(n));return t.signedAs(this),t}restoreClosures(t){if(!t||typeof t!="object"||!Array.isArray(t.nodes))throw z("a saved graph lists its closure nodes as an array");for(let r of t.nodes){if(!r||typeof r!="object")throw z("a saved closure node is not an object");let{id:n,...o}=r;if(n!==this.closureNodes.length)throw z("a saved graph lists its closure nodes out of order");this.addClosureNode(o)}this.closures(t.root)}};var By={meshBasic:"basic",line:"basic",lineDashed:"basic",points:"basic",sprite:"basic",shadow:"shadow",meshLambert:"lambert",meshPhong:"phong",meshNormal:"normal",meshMatcap:"matcap",meshDepth:"depth"};var uv=e=>e==="standard"||e==="physical",dv=e=>e==="lambert"||uv(e)||e==="phong"||e==="shadow",Uy=new Set(["basic","standard","physical","lambert","phong"]),fv=["gradientMap","map","normalMap"];function Vy(e,t){let r=n=>`material ${e} declares a ${n} its surface model never reads`;if(t.gradientMap)return r("gradientMap");if(e==="matcap"&&t.map)return r("map");if(t.normalMap&&!dv(e))return r("normalMap")}var lj={meshPhysical:{ior:1.5,thickness:0,transmission:0},meshPhong:{shininess:30},meshToon:{shadingModel:"toon"},points:{size:1,sizeAttenuation:!0},line:{linewidth:1},lineDashed:{linewidth:1,dashSize:3,gapSize:1,scale:1},sprite:{rotation:0,sizeAttenuation:!0,transparent:!0},volume:{albedo:16777215,extinction:0,emissiveOnly:!1},lightPattern:{emissive:16777215},[wl]:{...ev},[bu]:{transparent:!0},shadow:{color:0,transparent:!0,opacity:.5}},dj=e=>Object.hasOwn(lj,e)?lj[e]:void 0;var lEe=e=>By[e]??"standard",hj=new WeakMap,pv=(e,t)=>void hj.set(e,t),Gy=e=>hj.get(e),hh=new Set(["color","emissive","albedo","specular","sheenColor","specularColor","attenuationColor","subsurfaceColor"]),cEe=new Set(["albedo","sheenColor"]),mj=new Set(["map","emissiveMap","matcap","subsurfaceMap","sheenColorMap","specularColorMap"]),mh=e=>e instanceof pe||e instanceof Me||e instanceof gn?e.clone():e,Hy=new Set(["isMaterial","version","_listeners","heard"]);function uEe(e,t){if(Object.hasOwn(e,t))return!0;for(let r=Object.getPrototypeOf(e);r;r=Object.getPrototypeOf(r)){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return!n.get||!!n.set}return!0}var fj,pj=Symbol("material"),gh=Symbol("hold");function*hv(e){for(let t of Object.keys(e))t!=="kind"&&!Hy.has(t)&&(yield[t,e[t]])}function*Wy(e){for(let t of Object.keys(e)){let r=e[t];r!=null&&t!=="kind"&&!Hy.has(t)&&(yield[t,r])}}var qe=class{isMaterial=!0;color=new pe(16777215);emissive=new pe(0);emissiveIntensity=1;subsurfaceColor=new pe(0);metalness=0;roughness=1;opacity=1;transparent=!1;side="front";blending="normal";alphaTest=0;vertexColors=!1;allowNegativeEmissive=!1;ditherOpacityMask=!1;transparentShadow=!1;translucentShadowDensityScale=Oi.translucentShadowDensityScale.default;translucentShadowStartOffset=Oi.translucentShadowStartOffset.default;translucentSelfShadowDensityScale=Oi.translucentSelfShadowDensityScale.default;translucentSelfShadowSecondDensityScale=Oi.translucentSelfShadowSecondDensityScale.default;translucentSelfShadowSecondOpacity=Oi.translucentSelfShadowSecondOpacity.default;translucentBackscatteringExponent=Oi.translucentBackscatteringExponent.default;translucentMultipleScatteringExtinction=[...CB];twoSidedPasses=!1;normalCurvatureToRoughness=!1;maxWorldPositionOffset=0;alwaysEvaluateWorldPositionOffset=!1;displacementMagnitude=4;displacementCenter=.5;sky=!1;cloudFog=!1;computeFogPerPixel=!1;contactShadows=!1;litFrom=ah;translucencyPass="afterDepthOfField";translucentLocalLightShadow=!1;translucentLocalLightShadowQuality=0;version=0;_listeners=fe();heard=(t=!1)=>{this.version++,this._listeners.emit(t)};[pj]=this;kind;constructor(t,r={}){this.kind=dt("materialDomain",t),fj??=Object.keys(un.Material).filter(a=>!(a in this));for(let a of fj)this[a]=void 0;let n=this.heard;Se(this.color,n),Se(this.emissive,n),Se(this.subsurfaceColor,n);let o=Gt(r),i=dj(this.kind);if(i)for(let a of Object.keys(i))o[a]==null&&this.assign(a,i[a]);let s=this.checked(o);for(let a of Object.keys(s))this.assign(a,s[a]);return new Proxy(this,{set(a,l,c){let u=typeof l=="string"?dt("key",l):l,d=typeof u=="string"?Hg(u,c):c;return(d===null||typeof d!="object")&&Object.is(Reflect.get(a,u),d)&&uEe(a,u)||(typeof u=="string"&&u!=="version"?a.write(u,d):Reflect.set(a,u,d),u!=="version"&&n()),!0}})}checked(t){for(let n of fv)this.refuseUnread(n,t[n]);let r={};for(let n of Object.keys(t)){let o=t[n];if(o==null)continue;let i=dn("Material",n);if(i===void 0)r[n]=o;else{let s=Fi("Material",n,i,o);i==="color"&&!(o instanceof pe)?this.assign(n,o,!0):r[n]=s}}return r}refuseUnread(t,r){let n=r?Vy(lEe(this.kind),{[t]:r}):void 0;if(n)throw new E("INVALID_MATERIAL",n,{kind:this.kind,parameter:t})}write(t,r){let n=dn("Material",t),o=r;n!==void 0?o=Fi("Material",t,n,r):fv.includes(t)&&this.refuseUnread(t,r),this.assign(t,o,n==="color")}[gh](t,r,n=!0){let o=this[pj];o.assign(t,r),n&&o.heard()}assign(t,r,n=!1){if(t==="graph")return this.assignGraph(r);let o=this[t];if(hh.has(t)&&!(r instanceof pe)&&(r!=null||!cEe.has(t))){let s=n?n_:r;o instanceof pe?o.set(s):Se(this[t]=new pe(s),this.heard);return}o!==r&&this.release(t,o),this[t]=r,r instanceof cn&&Se(r,this.heard);let i=r;i?.isTexture&&i._listeners?.subscribe(this.heard)}assignGraph(t){let r=t==null?void 0:t instanceof gn?t:gn.fromJSON(t);if(r&&r.domain!==this.domain)throw z(`a ${r.domain} graph cannot be worn by a ${this.domain} material`);this.graph?._listeners.unsubscribe(this.heard),r?._listeners.subscribe(this.heard),r?(pv(r,this),this.graph=r):delete this.graph}release(t,r){let n=r?.isTexture;if(!(!(r instanceof cn)&&!n)){for(let o in this)if(o!==t&&this[o]===r)return;r instanceof cn?Es(r,this.heard):r._listeners?.unsubscribe(this.heard)}}set needsUpdate(t){}get needsUpdate(){return!1}get domain(){return this.kind===X1?"lightPattern":this.kind===wl?"postProcess":this.kind===bu?"deferredDecal":this.kind===yW?"volume":"surface"}emitted(){return this.emissive.toArray().map(t=>t*this.emissiveIntensity)}volumeOutputs(){let t=this.emitted();return xW({albedo:this.albedo?.toArray(),extinction:this.extinction,emissive:t,emissiveOnly:this.emissiveOnly})}surface(){let t=this.emitted();return{baseColor:this.color.toArray(),emissive:t,opacity:this.opacity,metalness:this.metalness,roughness:this.roughness,side:this.side,alphaMode:ih(this),alphaCutoff:this.alphaTest}}clone(){return mv(this)}dispose(){vz(this),this.graph?._listeners.unsubscribe(this.heard),this._listeners.clear()}};for(let e of Object.keys(un.Material))xt(qe.prototype,e,function(t){this[gh](e,t)});mc(qe.prototype,e=>Object.hasOwn(un.Material,e));function mv(e,t=mh){let r=new qe(e.kind),n=r[gh];for(let[o,i]of hv(e))n.call(r,o,t(i),!1);return r}var zy=e=>z("an instance changes only its parameters: its nodes are its parent graph\u2019s",e===void 0?{}:{node:e}),gj=e=>!!e?.isTexture,ho=class extends gn{parent;overrides=new Map;writes=0;merged;retold=()=>this.changed();constructor(t,r={}){if(!t?.isMaterialGraph)throw z("an instance needs a parent graph");super(t.domain),this.parent=t;for(let n of["nodes","outputs","closureNodes","textures","functions"])Object.defineProperty(this,n,{value:t[n]});Object.defineProperty(this,"shape",{get:()=>t.shape}),Object.defineProperty(this,"closureRoot",{get:()=>t.closureRoot}),Object.defineProperty(this,"version",{get:()=>this.writes+t.version}),Object.defineProperty(this,"values",{get:()=>this.mergedValues()});for(let[n,o]of Object.entries(r))this[mn](n,o)}changed(t=!1){this.writes++,this._listeners.emit(t)}mergedValues(){let t=this.version;if(this.merged?.version!==t){let r=new Map(this.parent.values);for(let[n,o]of this.overrides)r.set(n,o);this.merged={version:t,values:r}}return this.merged.values}[mn](t,r){let n=this.overrides.get(t);gj(r)&&r._listeners?.subscribe(this.retold),this.overrides.set(t,r),this.release(n,r),this.changed(!0)}unset(t){let r=this.overrides.get(t);this.overrides.delete(t)&&(this.release(r),this.changed(!0))}release(t,r){!gj(t)||t===r||[...this.overrides.values()].includes(t)||t._listeners?.unsubscribe(this.retold)}signature(){return this.parent.signature()}addNode(){throw zy(this.nodes.length)}addClosureNode(){throw zy()}setClosureRoot(){throw zy()}output(){throw zy()}followCollections(){}},Sj=new WeakMap;function wj(e){if(!(e instanceof ho))return e.clone();let{parent:t}=e,r=Sj.get(t);r?.version!==t.version&&Sj.set(t,r={version:t.version,copy:t.clone()});let n=[...e.overrides].map(([o,i])=>[o,Ou(i)]);return new ho(r.copy,Object.fromEntries(n))}function dEe(e){let t=fe(),r=o=>t.emit(o),n={get size(){return t.size},subscribe(o){let i=t.size===0;return t.subscribe(o),i&&e().subscribe(r),()=>n.unsubscribe(o)},unsubscribe(o){t.unsubscribe(o),t.size===0&&e().unsubscribe(r)},emit:o=>t.emit(o),tell:(o,i)=>t.tell(o,i),clear(){t.clear(),e().unsubscribe(r)}};return n}var gv=e=>z(`an instance changes only its parameters (instance.graph.set): '${e}' is its parent\u2019s`,{field:e});function yj(e,t={}){if(!e?.isMaterial)throw z("an instance needs a parent material");if(!e.graph&&Object.keys(t).length)throw z("an instance writes the parameters of its parent\u2019s graph: it wears none");for(let[u,d]of Object.entries(t))Fy(e.graph,u,d);let r,n=0,o=`${e.name||e.kind}_Inst`,i=dEe(()=>e._listeners),s=u=>{n++,i.emit(u)},a=()=>{let u=e.graph;if(r?.parent===u)return r;let d=r?Object.fromEntries(r.overrides):t;return r?._listeners.unsubscribe(s),r=u?new ho(u,d):void 0,r?._listeners.subscribe(s),r};a();let l={graph:a,version:()=>n+e.version,_listeners:()=>i,parent:()=>e,name:()=>o,isMaterialInstance:()=>!0,dispose:()=>()=>{r?._listeners.unsubscribe(s),i.clear()}},c=u=>{if(typeof u!="string")throw z("an instance\u2019s name is a string",{name:u});o=u};return new Proxy(e,fEe(l,c))}function fEe(e,t){let r=n=>typeof n=="string"&&Object.hasOwn(e,n);return{get:(n,o,i)=>r(o)?e[o]():Reflect.get(n,o,i),set:(n,o,i)=>{if(o==="name")t(i);else if(o!=="needsUpdate")throw gv(String(o));return!0},defineProperty:(n,o)=>{throw gv(String(o))},deleteProperty:(n,o)=>{throw gv(String(o))},ownKeys:n=>{let o=Reflect.ownKeys(n);return e.graph()&&!o.includes("graph")&&o.push("graph"),o.includes("name")||o.push("name"),o},getOwnPropertyDescriptor:(n,o)=>{if(o!=="graph"&&o!=="version"&&o!=="name")return Reflect.getOwnPropertyDescriptor(n,o);let i=e[o]();if(i!==void 0)return{value:i,writable:!0,enumerable:!0,configurable:!0}}}}function xj(e){let t=mv(e,r=>r instanceof gn?wj(r):mh(r));return t.graph&&pv(t.graph,e),t}var $t=e=>t=>new qe(e,t),_u={meshStandard:$t("meshStandard"),meshPhysical:$t("meshPhysical"),meshBasic:$t("meshBasic"),meshPhong:$t("meshPhong"),meshLambert:$t("meshLambert"),meshToon:$t("meshToon"),meshNormal:$t("meshNormal"),meshMatcap:$t("meshMatcap"),meshDepth:$t("meshDepth"),points:$t("points"),line:$t("line"),lineDashed:$t("lineDashed"),sprite:$t("sprite"),volume:$t("volume"),lightPattern:$t("lightPattern"),postProcess:$t(wl),deferredDecal:$t(bu),graph:e=>new gn(e),instance:(e,t)=>yj(e,t),function:e=>new Ru(e),parameterCollection:(e,t)=>new ph(e,t),shadow:$t("shadow"),createShader:e=>new qe("shader",{...e})};var pEe={..._u,check:async(e,t={})=>(await M.materialGraph.load()).checkGraph(e,t),cost:async(e,t={})=>(await M.materialGraph.load()).costOfGraph(e,t),parameterValue:async(e,t)=>(await M.materialGraph.load()).parameterValue(e,t)};async function hEe(){return(await M.headless.load()).headless}var Sv=new Map([[Uint32Array,[4294967295,!1]],[Uint16Array,[65535,!1]],[Uint8Array,[255,!1]],[Int32Array,[2147483647,!0]],[Int16Array,[32767,!0]],[Int8Array,[127,!0]]]),zht=e=>1/(Sv.get(e)?.[0]??1);function bj(e,t){let r=Sv.get(t.constructor);return r?r[1]?Math.max(e/r[0],-1):e/r[0]:e}function mEe(e,t){let r=Sv.get(t.constructor);return r?Math.round(e*r[0]):e}var vu=class{name="";itemSize;normalized;constructor(t,r){this.itemSize=t,this.normalized=r}stored(t,r){return this.array[this.at(t)+r]}getComponent(t,r){if(r>=this.itemSize)return 0;let n=this.stored(t,r);return this.normalized?bj(n,this.array):n}readInto(t,r,n,o,i,s,a,l=!1){let c=this.array,u=this.itemSize,d=l||!this.normalized,f=this.at(o);if(d&&u===s&&n===s&&this.at(o+1)-f===u)return t.set(c.subarray(f,f+i*s),r),t;for(let h=0;h<i;h++){let m=this.at(o+h),w=r+h*n;for(let x=0;x<s;x++)t[w+x]=x>=u?a:d?c[m+x]:bj(c[m+x],c)}return t}setComponent(t,r,n){return this.array[this.at(t)+r]=this.normalized?mEe(n,this.array):n,this}getX(t){return this.getComponent(t,0)}getY(t){return this.getComponent(t,1)}getZ(t){return this.getComponent(t,2)}getW(t){return this.getComponent(t,3)}setX(t,r){return this.setComponent(t,0,r)}setY(t,r){return this.setComponent(t,1,r)}setZ(t,r){return this.setComponent(t,2,r)}setW(t,r){return this.setComponent(t,3,r)}setXY(t,r,n){return this.setX(t,r).setY(t,n)}setXYZ(t,r,n,o){return this.setX(t,r).setY(t,n).setZ(t,o)}};function wv(){throw new E("VERTICES_NOT_LOADED","A loaded mesh's vertices are read after `await geometry.loadVertices()`.")}async function yv(e){e._numbers??=await e._pending.read(),e._pending=null}function gEe(e){let t;return()=>t??=e().catch(r=>{throw t=void 0,r})}function xv(e,t){return e._numbers=null,e._pending={length:t.length,read:gEe(()=>t.read())},e}function bv(e,t){let r=t?t.length:e.count,n=e.itemSize,o=new e.array.constructor(r*n);for(let s=0;s<r;s++)for(let a=0;a<n;a++)o[s*n+a]=e.stored(t?t[s]:s,a);let i=new Oe(o,n,e.normalized);return i.name=e.name,i}var Ej=new Float32Array(0);function Tj(e){let t=Array.from(e),r=t.reduce((n,o)=>Math.max(n,o),0)>65535?Uint32Array:Uint16Array;return new Oe(new r(t),1)}var Oe=class e extends vu{isBufferAttribute=!0;kind="attribute";type;version=0;_onChange=null;updateRanges=[];_numbers;_pending=null;constructor(t,r,n=!1,o=t.constructor.name){super(r,n),this._numbers=t,this.type=o}get array(){return this._numbers??wv()}_load(){return yv(this)}get count(){return Math.floor((this._numbers??this._pending).length/this.itemSize)}at(t){return t*this.itemSize}set needsUpdate(t){t&&(this.version++,this._onChange?.())}get needsUpdate(){return!1}addUpdateRange(t,r){this.updateRanges.push({start:t,count:r})}clearUpdateRanges(){this.updateRanges.length=0}clone(){let t=new e(this.array.slice(),this.itemSize,this.normalized,this.type);return t.name=this.name,t}},Mu=class{isInterleavedBuffer=!0;kind="interleavedBuffer";version=0;_numbers;_pending=null;stride;constructor(t,r){this._numbers=t,this.stride=r}get array(){return this._numbers??wv()}_load(){return yv(this)}get count(){return Math.floor((this._numbers??this._pending).length/this.stride)}set needsUpdate(t){t&&this.version++}get needsUpdate(){return!1}attribute(t,r){return new jy(this,t,r).clone()}},jy=class extends vu{isInterleavedBufferAttribute=!0;kind="interleavedAttribute";data;offset;constructor(t,r,n,o=!1){super(r,o),this.data=t,this.offset=n}get array(){return this.data.array}_load(){return this.data._load()}get count(){return this.data.count}at(t){return t*this.data.stride+this.offset}set needsUpdate(t){this.data.needsUpdate=t}get needsUpdate(){return!1}clone(){return bv(this)}},Xht=(e,t,r)=>xv(new Oe(Ej,t,r,e.type),e),Qht=(e,t)=>xv(new Mu(Ej,t),e);function Ev(e){for(let t of e)t();e.clear()}function Aj(e){if(e.length)for(let t of e.splice(0))t()}var Bs=class{released=new Set;dispose(){Ev(this.released)}};var $y=new Float64Array(3);function qo(e,t,r=new Float32Array(Math.floor(e.length/3)*3)){let n=Math.floor(e.length/3);r.fill(0);let o=t?t.length:n;for(let i=0;i+2<o;i+=3){let s=(t?t[i]:i)*3,a=(t?t[i+1]:i+1)*3,l=(t?t[i+2]:i+2)*3;ks($y,0,e,s,a,l);let c=$y[0],u=$y[1],d=$y[2];r[s]+=c,r[s+1]+=u,r[s+2]+=d,r[a]+=c,r[a+1]+=u,r[a+2]+=d,r[l]+=c,r[l+1]+=u,r[l+2]+=d}for(let i=0;i<r.length;i+=3)Ne(r,i);return r}function Oj(e,t){let{position:r,normal:n}=e.attributes,o=O0(r);if(o){let i=o.array;Uf(i,t.elements,i,o.count)}else if(r){let i=new I,s=[0,0,0],a=Math.min(3,r.itemSize);for(let l=0;l<r.count;l++){let{elements:c}=i.fromArray(Mr(r,l,s)).applyMatrix4(t);for(let u=0;u<a;u++)r.setComponent(l,u,c[u])}}if(n){let i=Vc(new Float64Array(9),t.elements),s=new Float64Array(3),a=vp(e,n),l=(c,u)=>Ja(e,n,c,u);for(let c=0;c<n.count;c++)if(Bd(s,i,l(c,0),l(c,1),l(c,2)),Ne(s),a)for(let u=0;u<3;u++)n.array[c*n.itemSize+u]=s[u];else n.setXYZ(c,s[0],s[1],s[2])}}var Pr=class e extends Bs{isGeometry=!0;kind="geometry";type="Geometry";name="";attributes={};morphAttributes={};morphTargetsRelative=!1;index=null;groups=[];range=SEe(()=>this._changed(!1));get drawRange(){return this.range}set drawRange({start:t,count:r}){this.setDrawRange(t,r)}userData={};boundingBox=null;boundingSphere=null;recipe=null;version=0;usage="static";maxBounds=null;_listeners=fe();_owner="world";_changed(t=!0){return this.version++,t&&(this.boundingBox=this.boundingSphere=null),this.recipe=null,this._listeners.size&&this._listeners.emit(),this}setAttribute(t,r){this.attributes[t]=r;let n=t==="position";return r.kind==="attribute"&&(r._onChange=()=>this._changed(n)),this._changed(n)}getAttribute(t){return this.attributes[t]}deleteAttribute(t){return delete this.attributes[t],this._changed(t==="position")}getIndex(){return this.index}hasAttribute(t){return t in this.attributes}setIndex(t){let r=t===null||t instanceof Oe?t:Tj(t);return b3(this,r),this.index=r,this.index&&(this.index._onChange=()=>this._changed(!1)),this._changed(!1)}addGroup(t,r,n=0){return this.groups.push({start:t,count:r,materialIndex:n}),this._changed(!1)}setDrawRange(t,r){return this.range.start=t,this.range.count=r,this}clearGroups(){return this.groups.length=0,this._changed(!1)}computeVertexNormals(){let t=this.attributes.position;if(!t)return this;let r=qo(L0(t),O3(this));return this.setAttribute("normal",new Oe(r,3))}computeBoundingBox(){return this.boundingBox=u_(this.boundingBox??new rr,this)}computeBoundingSphere(){return this.boundingSphere=qW(this.boundingSphere??new dl,this)}applyMatrix4(t){return Oj(this,t),this._changed()}translate(t,r,n){return this.applyMatrix4(new ft().makeTranslation(t,r,n))}rotateX(t){return this.applyMatrix4(new ft().makeRotationX(t))}rotateY(t){return this.applyMatrix4(new ft().makeRotationY(t))}rotateZ(t){return this.applyMatrix4(new ft().makeRotationZ(t))}scale(t,r,n){return this.applyMatrix4(new ft().makeScale(t,r,n))}center(){let t=this.computeBoundingBox().getCenter();return this.translate(-t.x,-t.y,-t.z)}async loadVertices(){let t=Object.values(this.morphAttributes).flat(),r=[this.index,...Object.values(this.attributes),...t];return await Promise.all(r.map(n=>n?._load())),this}clone(){let t=this.shaped(r=>r.clone());return this.index&&t.setIndex(this.index.clone()),t.boundingBox=this.boundingBox?.clone()??null,t.boundingSphere=this.boundingSphere?.clone()??null,t.recipe=this.recipe&&{type:this.recipe.type,args:[...this.recipe.args]},t}toNonIndexed(){if(!this.index)return this.clone();let t=Gw(this,"points",op,"A geometry copied without its index"),r=this.shaped(n=>bv(n,t));return r.groups.length=0,r}shaped(t){let r=new e;r._owner=this._owner,r.name=this.name;for(let[n,o]of Object.entries(this.attributes))r.setAttribute(n,t(o));for(let[n,o]of Object.entries(this.morphAttributes))r.morphAttributes[n]=o.map(t);r.morphTargetsRelative=this.morphTargetsRelative;for(let n of this.groups)r.groups.push({...n});return r.drawRange={...this.drawRange},r.userData=du(this.userData),r}dispose(){super.dispose(),this._listeners.clear()}};function SEe(e){let t={start:0,count:1/0},r=n=>({enumerable:!0,get:()=>t[n],set:o=>{t[n]!==o&&(t[n]=o,e())}});return Object.defineProperties({},{start:r("start"),count:r("count")})}var Ft=class{positions=[];normals=[];uvs=[];indices=[];get vertexCount(){return this.positions.length/3}vertex(t,r,n){return this.positions.push(t[0],t[1],t[2]),this.normals.push(r[0],r[1],r[2]),this.uvs.push(n[0],n[1]),this.vertexCount-1}triangle(t,r,n){this.indices.push(t,r,n)}grid(t,r,n){let o=this.vertexCount;for(let s=0;s<=r;s++)for(let a=0;a<=t;a++){let l=n(a/t,s/r);this.vertex(l.p,l.n,l.uv)}let i=(s,a)=>o+a*(t+1)+s;for(let s=0;s<r;s++)for(let a=0;a<t;a++){let[l,c,u,d]=[i(a,s),i(a+1,s),i(a+1,s+1),i(a,s+1)];this.facesDeclared(l,c,u,d)?(this.triangle(l,c,u),this.triangle(l,u,d)):(this.triangle(l,u,c),this.triangle(l,d,u))}}facesDeclared(t,r,n,o){let i=this.positions,s=this.normals,a=[0,1,2].map(d=>i[n*3+d]-i[t*3+d]),l=[0,1,2].map(d=>i[o*3+d]-i[r*3+d]),c=Ze([0,0,0],a,l),u=0;for(let d of[t,r,n,o])for(let f=0;f<3;f++)u+=c[f]*s[d*3+f];return u>=0}build(t={}){let r=new Pr;r.setAttribute("position",new Oe(new Float64Array(this.positions),3));let n=t.computeNormals?qo(this.positions,this.indices):new Float64Array(this.normals);return r.setAttribute("normal",new Oe(n,3)),r.setAttribute("uv",new Oe(new Float64Array(this.uvs),2)),r.setIndex(this.indices),r}};function Du(e,t,r,n){let o=new Ft,i=[o.positions,o.normals,o.uvs,o.indices];return[e,t,r,n].forEach((s,a)=>{for(let l of s)i[a].push(l)}),o.build()}var lt=(e,t)=>Math.max(t,Math.floor(e));function Gn(e,t,r){return e.recipe={type:t,args:Array.from(r)},e}var Tv=(e,t)=>Br([0,0,0],e,t),Lj=(e,t)=>Ze([0,0,0],e,t),Xo=e=>(Ne(e),e);var wEe=[[1,0],[0,1],[-1,0],[0,-1]];function Us(e,t=0,r=Q){if(t===0&&r===Q&&Number.isInteger(4*e))return wEe[sa(4*e,4)];let n=t+e*r;return[Math.cos(n),Math.sin(n)]}function Rj(e,t,r=64,n=32,o={}){let i=[],s=[],a=[],l=[],c=Math.max(3,Math.floor(r)),u=Math.max(2,Math.floor(n)),{phiStart:d=0,phiLength:f=Q,thetaStart:h=0,thetaLength:m=Math.PI}=o,w=h===0&&m===Math.PI,x=L=>w?Us(L/u/2):Us(L/u,h,m);for(let L=0;L<=u;L++)for(let _=0;_<=c;_++){let[D,C]=x(L),[j,$]=Us(_/c,d,f),q=C*j,le=D,ge=C*$;i.push(e[0]+q*t,e[1]+le*t,e[2]+ge*t),s.push(q,le,ge),a.push(_/c,1-L/u)}let b=h<=0,T=h+m>=Math.PI;for(let L=0;L<u;L++)for(let _=0;_<c;_++){let D=L*(c+1)+_,C=D+c+1,j=C+1,$=D+1;(L<u-1||!T)&&l.push(D,j,C),(L>0||!b)&&l.push(D,$,j)}return{positions:i,normals:s,uv:a,indices:l}}function _j(e,t,r){let n=Math.round(e*t);return n===0?-r/2:n===t?r/2:(2*n-t)*r/(2*t)}function xl(e,t,r,n,o,i){let[s,a,l]=o;e.grid(i[0],i[1],(c,u)=>{let d=_j(c,i[0],s),f=_j(u,i[1],a);return{p:[0,1,2].map(h=>t[h]*l+r[h]*d+n[h]*f),n:t,uv:[c,u]}})}function vj(e=1,t=1,r=1,n=1,o=1,i=1){[n,o,i]=[lt(n,1),lt(o,1),lt(i,1)];let s=new Ft,a=e/2,l=t/2,c=r/2;return xl(s,[1,0,0],[0,0,-1],[0,1,0],[r,t,a],[i,o]),xl(s,[-1,0,0],[0,0,1],[0,1,0],[r,t,a],[i,o]),xl(s,[0,1,0],[1,0,0],[0,0,-1],[e,r,l],[n,i]),xl(s,[0,-1,0],[1,0,0],[0,0,1],[e,r,l],[n,i]),xl(s,[0,0,1],[1,0,0],[0,1,0],[e,t,c],[n,o]),xl(s,[0,0,-1],[-1,0,0],[0,1,0],[e,t,c],[n,o]),Gn(s.build(),"box",[e,t,r,n,o,i])}function Yy(e=1,t=1,r=1,n=1){[r,n]=[lt(r,1),lt(n,1)];let o=new Ft;return xl(o,[0,0,1],[1,0,0],[0,1,0],[e,t,0],[r,n]),Gn(o.build(),"plane",[e,t,r,n])}function Mj(e=1,t=32,r=16,n=0,o=Q,i=0,s=Math.PI){[t,r]=[lt(t,3),lt(r,2)];let l=Rj([0,0,0],e,t,r,{phiStart:n,phiLength:o,thetaStart:i,thetaLength:s}),c=Du(l.positions,l.normals,l.uv,l.indices);return Gn(c,"sphere",[e,t,r,...n===0&&o===Q&&i===0&&s===Math.PI?[]:[n,o,i,s]])}function Dj(e=1,t=32,r=0,n=Q){let o=new Ft,i=t=lt(t,3),s=o.vertex([0,0,0],[0,0,1],[.5,.5]);for(let a=0;a<=i;a++){let[l,c]=Us(a/i,r,n);o.vertex([e*l,e*c,0],[0,0,1],[(l+1)/2,(c+1)/2]),a>0&&o.triangle(s,s+a,s+a+1)}return Gn(o.build(),"circle",[e,t,r,n])}function Pj(e=.5,t=1,r=32,n=1){let o=new Ft;return[r,n]=[lt(r,3),lt(n,1)],o.grid(r,n,(i,s)=>{let[a,l]=Us(i),c=Qe(e,t,s),u=c*a,d=c*l;return{p:[u,d,0],n:[0,0,1],uv:[(u/t+1)/2,(d/t+1)/2]}}),Gn(o.build(),"ring",[e,t,r,n])}function Av(e=1,t=1,r=1,n=32,o=1,i=!1){let s=new Ft,a=n=lt(n,3),l=(t-e)/r;if(s.grid(a,o=lt(o,1),(c,u)=>{let[d,f]=Us(c),h=Qe(e,t,u);return{p:[h*f,r/2-u*r,h*d],n:Xo([f,l,d]),uv:[c,1-u]}}),!i)for(let[c,u,d]of[[e,r/2,1],[t,-r/2,-1]]){if(c<=0)continue;let f=s.vertex([0,u,0],[0,d,0],[.5,.5]);for(let h=0;h<=a;h++){let[m,w]=Us(h/a);s.vertex([c*w,u,c*m],[0,d,0],[m*.5+.5,w*.5*d+.5]),h>0&&(d>0?s.triangle(f,f+h,f+h+1):s.triangle(f,f+h+1,f+h))}}return Gn(s.build(),"cylinder",[e,t,r,n,o,i])}function Ky(e=1,t=1,r=32,n=1,o=!1){let i=Av(0,e,t,r,n,o),[,,,s,a]=i.recipe.args;return Gn(i,"cone",[e,t,s,a,o])}var ot=class e extends he{get isMesh(){return!0}get castShadow(){return super.castShadow}set castShadow(t){super.castShadow=t}_geometry;_material;primitive;constructor(t=new Pr,r=new qe("meshBasic"),n="triangles"){super(),this.castShadow=!0,this.primitive=n,this.type=n==="triangles"?"Mesh":n,this._geometry=t,this._material=r,this.updateMorphTargets()}heard(t=!1){let r=this._link;t&&r?.values?r.values(this):r?.content(this)}hear(t){let r=this._heard??=o=>this.heard(o),n=Array.isArray(this._material)?this._material:[this._material];for(let o of[this._geometry,...n])t?o._listeners?.subscribe(r):o._listeners?.unsubscribe(r)}linked(t){this.hear(t)}updateMorphTargets(){let t=this._geometry.morphAttributes,r=Object.keys(t)[0];if(r===void 0)return;let n=this.morphTargetInfluences=[],o=this.morphTargetDictionary={};t[r].forEach((i,s)=>{n.push(0),o[i.name||String(s)]=s})}get geometry(){return this._geometry}set geometry(t){t!==this._geometry&&this.wear(()=>this._geometry=t)}get material(){return this._material}set material(t){this.wear(()=>this._material=t)}wear(t){let r=!!this._link;r&&this.hear(!1),t(),r&&this.hear(!0),this.heard()}get physics(){return this._physics??null}set physics(t){let r=this._physics;this._physics=t===null||t instanceof hn?t:new hn(t),this.heard(),t1(this,r,this._physics)}blank(){return new e(this.geometry,this.material,this.primitive)}copy(t,r=!0){if(super.copy(t,r),!(t instanceof e))return this;let n=t;n.morphTargetInfluences&&(this.morphTargetInfluences=n.morphTargetInfluences.slice()),n.morphTargetDictionary&&(this.morphTargetDictionary={...n.morphTargetDictionary}),n.skeleton&&(this.skeleton=n.skeleton),n.bank&&(this.bank=n.bank),n.waves&&(this.waves=n.waves),n.waterBody&&(this.waterBody={...n.waterBody});let o=n.material;return(Array.isArray(o)||o!==this._material)&&(this.material=Array.isArray(o)?o.slice():o),n.geometry!==this._geometry&&(this.geometry=n.geometry),this}localBounds(){return this._geometry.boundingBox??this._geometry.computeBoundingBox()}};var Ov=new WeakSet,Lv=new Set,yEe=new FinalizationRegistry(e=>Lv.delete(e)),Cj=new WeakMap;function Ij(e){let t={};for(let[r,n]of Object.entries(e))t[r]=(...o)=>xEe(n(...o));return t}function xEe(e){if(!Ov.has(e)){let t=new WeakRef(e);Lv.add(t),yEe.register(e,t)}return Ov.add(e),e}function kj(){let e=[];for(let t of Lv){let r=t.deref();r&&e.push(r)}return e}var Fj=e=>Ov.has(e);function Nj(e,t){Cj.set(e,t)}var Bj=e=>Cj.get(e)??e;function sr(e,t){let r=new Pr;return r.setAttribute("position",new Oe(new Float32Array(e),3)),new ot(r,new qe("line",{color:t}),"lineSegments")}function bl(e,t,r="xz"){let n=[],o=[0,0];for(let i=0;i<t;i++)for(let s of[i,i+1]){let a=s/t*Q,[l,c]=An(o,e,a);Ht(n,r==="xz"?[l,0,c]:[l,c,0])}return n}var Uj=e=>[-e,-e,0,e,-e,0,e,-e,0,e,e,0,e,e,0,-e,e,0,-e,e,0,-e,-e,0];function bEe(e,t){let r=o=>[o&1?t.x:e.x,o&2?t.y:e.y,o&4?t.z:e.z];return[0,1,2,3,4,5,6,7,0,2,1,3,4,6,5,7,0,4,1,5,2,6,3,7].flatMap(r)}function Pu(e,t){let r=Object.assign(new or,{update(){e.updateWorldMatrix(!0,!1),e.matrixWorld.decompose(r.position,r.quaternion,r.scale)}});for(let n of t)r.add(n);return r.update(),Nj(r,e),r}var EEe=1e-9,TEe={x:0,y:0,z:1};function AEe(e,t){let r,n=()=>r?new ot(r.geometry,r.material,"lineSegments"):r=sr([0,0,0,0,0,1],t);return e.skeleton.bones.flatMap(({index:o,parent:i})=>{let[s,a]=[e.bone(i),e.bone(o)];return s&&a?[{from:s,to:a,mark:n()}]:[]})}function OEe(e,t=65535){let r=AEe(e,t),n=new ft,[o,i,s]=[new I,new I,new I],a=new Et,l=(d,f)=>f.setFromMatrixPosition(d.matrixWorld).applyMatrix4(n),c=Pu(e,r.map(({mark:d})=>d)),u=c.update;return c.update=()=>{e.updateWorldMatrix(!0,!0),u(),n.copy(e.matrixWorld).invert();for(let{from:d,to:f,mark:h}of r){s.subVectors(l(f,i),l(d,o));let m=s.length(),w=m>EEe;if(h.visible!==w&&(h.visible=w),!w)continue;let{position:x,quaternion:b,scale:T}=h;(x.x!==o.x||x.y!==o.y||x.z!==o.z)&&x.copy(o),a.setFromUnitVectors(TEe,s.divideScalar(m)),b.equals(a)||b.copy(a),(T.x!==1||T.y!==1||T.z!==m)&&T.set(1,1,m)}},c.update(),c}var LEe=Ij({axes(e=1){let t=new or;return t.add(sr([0,0,0,e,0,0],16711680),sr([0,0,0,0,e,0],65280)),t.add(sr([0,0,0,0,0,e],255)),t},grid(e=10,t=10,r=4473924,n=8947848){let o=e/2,i=e/t,s=[],a=[];for(let c=0;c<=t;c++){let u=-o+c*i;(Math.abs(u)<i/2?s:a).push(-o,0,u,o,0,u,u,0,-o,u,0,o)}let l=new or;return l.add(sr(s,r),sr(a,n)),l},polarGrid(e=10,t=16,r=8,n=8947848){let o=[],i=[0,0];for(let s=0;s<t;s++){let a=s/t*Q,[l,c]=An(i,e,a);o.push(0,0,0,l,0,c)}for(let s=1;s<=r;s++)Ht(o,bl(e*s/r,64));return sr(o,n)},box(e,t=16776960){let r=e.isBox3?e:new rr().setFromObject(e);return sr(bEe(r.min,r.max),t)},plane(e,t=1,r=16776960){let n=sr(Uj(t/2),r);return n.quaternion.setFromUnitVectors({x:0,y:0,z:1},e.normal),n.position.copy(e.normal.clone().multiplyScalar(-e.constant)),n},arrow(e,t=new I,r=1,n=16776960){let o=Math.min(r*.2,r),i=sr([0,0,0,0,r-o,0],n),s=new ot(Ky(o*.5,o,12),new qe("meshBasic",{color:n}));s.position.set(0,r-o/2,0);let a=new or;return a.add(i,s),a.position.copy(t),a.quaternion.copy(new Et().setFromUnitVectors({x:0,y:1,z:0},e.clone().normalize())),a},camera(e){let t=Rn(e.fov,ko(e)),r=[e.near,e.far].flatMap(o=>[[-1,-1],[1,-1],[1,1],[-1,1]].map(([i,s])=>[i*o*t*e.aspect,s*o*t,-o])),n=[];for(let o=0;o<4;o++)for(let[i,s]of[[o,(o+1)%4],[o+4,(o+1)%4+4],[o,o+4]])Ht(n,r[i]),Ht(n,r[s]);return Pu(e,[sr(n,16755200)])},directionalLight(e,t=1){return Pu(e,[sr([...Uj(t/2),0,0,0,0,0,-t*2],e.color)])},pointLight(e,t=1){return Pu(e,[sr([...bl(t,32,"xz"),...bl(t,32,"xy")],e.color)])},spotLight(e){let t=e.distance||1,r=Math.tan(e.outerConeAngle)*t,o=[...bl(r,32,"xy").map((i,s)=>s%3===2?-t:i)];for(let[i,s]of[[r,0],[-r,0],[0,r],[0,-r]])o.push(0,0,0,i,s,-t);return Pu(e,[sr(o,e.color)])},skeleton:(e,t)=>OEe(e,t),ragdoll(e,t){let r={selected:null,hovered:null},n=Object.assign(new or,{update(){},pick:()=>null,select:o=>void(r.selected=o),hover:o=>void(r.hovered=o)});return M.ragdoll.load().then(({fillRagdollHelper:o})=>o(n,e,t,r)),n},hemisphereLight(e,t=1){return Pu(e,[sr(bl(t,32,"xz"),e.color),sr(bl(t,32,"xy"),e.groundColor)])}});var qy={plan(){},read:e=>e,settle(){}};function hgt(e){let t=0,r=0,n=null,o=new Set,i=()=>{n&&e(t,r)};return{plan(s){if(s.size){n=new Map([...s].filter(([a])=>!o.has(a)));for(let a of n.values())r+=a;i()}},read(s,a){if(!s.body)return s;o.add(a);let l=n?.get(a)??0,c=0;n?.delete(a);let u=s.body.pipeThrough(new TransformStream({transform(m,w){let x=k(l-c,0,m.byteLength);c+=m.byteLength,t+=m.byteLength,r+=m.byteLength-x,i(),w.enqueue(m)},flush(){c>=l||(r-=l-c,i())}})),{status:d,statusText:f,headers:h}=s;return new Response(u,{status:d,statusText:f,headers:h})},settle(){for(let s of n?.values()??[])r-=s;n=new Map,i()}}}var Vj={premultiplyAlpha:"none",colorSpaceConversion:"none"};async function REe(e){if(!e.type.startsWith("image/svg+xml"))return createImageBitmap(e,Vj);let t=URL.createObjectURL(e);try{let r=new Image;return r.src=t,await r.decode(),await createImageBitmap(r,Vj)}finally{URL.revokeObjectURL(t)}}async function Gj(e,t,r=qy){let n=await vr(e,t);return REe(await r.read(n,e).blob())}function Sh(){let e=new Set,t=new WeakMap;return{written(r){for(let n of e){let o=n.deref();o?o.add(r):e.delete(n)}t.get(r)?.emit()},hear(r,n){let o=t.get(r);return o||t.set(r,o=fe()),o.subscribe(n),()=>{o.unsubscribe(n),o.size||t.delete(r)}},open(){let r=new Set;return e.add(new WeakRef(r)),r},close(r){for(let n of e)if(n.deref()===r){e.delete(n);return}}}}var Xy=Sh(),Hj=Sh();var _Ee=1,vEe=8,MEe={wrap:"sampling",wrapS:"sampling",wrapT:"sampling",minFilter:"sampling",magFilter:"sampling",anisotropy:"sampling",repeat:"placement",offset:"placement",rotation:"placement",repeatFirst:"placement"},DEe=new Set(["version","sampling","placement","needsUpdate","rows"]),PEe=16,Cu=class e{isTexture=!0;id=`texture-${_Ee++}`;name="";wrapS="repeat";wrapT="repeat";repeat=new Me(1,1);offset=new Me(0,0);rotation=0;repeatFirst=!1;minFilter="linearMipLinear";magFilter="linear";colorSpace="srgb";flipY=!0;premultiplyAlpha=!1;anisotropy=vEe;channel=0;version=0;sampling=0;placement=0;rows=[];transform=new Float64Array(9);_listeners=fe();record=this;image;layout;format;constructor(t=null,r="2d",n="rgba"){this.image=t,this.layout=r,this.format=n,TL(this.transform,this.offset,this.repeat,this.rotation,this.repeatFirst);let o=()=>this.touch("placement");return Se(this.repeat,o),Se(this.offset,o),this.record=new Proxy(this,{set(i,s,a){let l=s==="repeat"||s==="offset";return l&&i[s]===a||(l&&Es(i[s],o),Reflect.set(i,s,a),typeof s!="string"||DEe.has(s))||(l&&Se(a,o),i.touch(MEe[s]??"version")),!0}})}get wrap(){return this.wrapS}set wrap(t){this.wrapS=this.wrapT=t}get width(){return this.image?.width??0}get height(){return this.image?.height??0}set needsUpdate(t){t&&this.touch()}get needsUpdate(){return!1}writeRows(t,r){if(!(Number.isInteger(t)&&Number.isInteger(r)&&t>=0&&t<=r))throw new RangeError(`Texture rows ${t} to ${r}: whole numbers from 0, in order`);let{rows:n}=this;n.length===PEe&&n.shift(),n.push({version:this.version+1,first:t,last:r}),this.touch("version",!0)}touch(t="version",r=!1){t==="placement"&&TL(this.transform,this.offset,this.repeat,this.rotation,this.repeatFirst),t==="version"&&!r&&(this.rows.length=0),this[t]++,Xy.written(this.record),this._listeners.emit()}clone(){let t=new e(this.image,this.layout,this.format),{name:r,wrapS:n,wrapT:o,rotation:i,minFilter:s,magFilter:a,colorSpace:l,flipY:c}=this;return Object.assign(t,{name:r,wrapS:n,wrapT:o,rotation:i,minFilter:s,magFilter:a,colorSpace:l,flipY:c}),t.repeatFirst=this.repeatFirst,t.premultiplyAlpha=this.premultiplyAlpha,t.anisotropy=this.anisotropy,t.channel=this.channel,t.repeat.copy(this.repeat),t.offset.copy(this.offset),t}dispose(){this._listeners.clear(),Hj.written(this.record)}};var Jr=new DOMException("Abandoned: its owner let it go","AbortError"),vgt=new DOMException("The session closed","AbortError"),El=new DOMException("Page request cancelled","AbortError");var Qy=new WeakMap;function Wj(e,t,r=n=>void Sp().then(n)){let n=new WeakRef(e),o=Qy.get(t);if(o)return void o.push(n);CEe(t,n,r)}function CEe(e,t,r){let n=!1,o=[t],i=new AbortController,s=()=>{let u=0;for(let d=0;d<o.length;d++){let f=o[d].deref();f&&(f.needsUpdate=!0,o[u++]=o[d])}return u!==o.length&&(o.length=u),u?!0:(Qy.get(e)===o&&Qy.delete(e),i.abort(Jr),!1)},a=()=>{n=!1,s()&&l()},l=()=>{n||(e.requestVideoFrameCallback?(n=!0,e.requestVideoFrameCallback(a)):!e.paused&&!e.ended&&(n=!0,r(a)))};Qy.set(e,o);let{signal:c}=i;e.addEventListener("play",l,{signal:c}),e.addEventListener("loadeddata",()=>void s(),{signal:c}),l()}function kgt(e){let[t,r]=IEe(e);return[Math.max(1,t),Math.max(1,r)]}function IEe(e){let t=e,r=t?.videoWidth??t?.displayWidth??t?.naturalWidth??t?.width??0,n=t?.videoHeight??t?.displayHeight??t?.naturalHeight??t?.height??0;return[r,n]}var kEe=2;function FEe(e){let t=e,r=t?.readyState;return r!==void 0&&!(r>=kEe&&(t?.videoWidth??0)>0)}function NEe(e){let t=e;return t?t.readyState!==void 0?FEe(t)?"loading":"decoded":t.complete!==void 0?t.complete?(t.naturalWidth??0)>0?"decoded":t.src||t.currentSrc?"failed":"absent":"loading":(t.width??0)>0?"decoded":"failed":"absent"}var BEe=["load","loadeddata","error"],Rv=new WeakMap;function zj(e){let t=e.image;if(NEe(t)!=="loading"||typeof t?.addEventListener!="function")return;let r=Rv.get(t);if(!r){let n=new Set;Rv.set(t,r=n);let o=new AbortController,i=()=>{o.abort(Jr),Rv.delete(t);for(let s of n){let a=s.deref();a&&(a.needsUpdate=!0)}};for(let s of BEe)t.addEventListener(s,i,{signal:o.signal})}for(let n of r)if(n.deref()===e)return;r.add(new WeakRef(e))}var Vs=(e,t,r)=>new Cu(e,t,r),wh={image(e){let t=Vs(e);return zj(t),t},data(e,t,r,n="rgba"){let o=Vs({data:e,width:t,height:r},"data",n);return o.colorSpace="linear",o.flipY=!1,o},canvas:e=>Vs(e),video(e){let t=Vs(e);return Wj(t,e),t},depth:(e,t)=>Vs({data:null,width:e,height:t},"depth","depth"),cube:e=>Vs(e,"cube"),array:(e,t,r,n)=>Vs({data:e,width:t,height:r,depth:n},"array"),compressed:(e,t,r,n)=>Vs({mipmaps:e,width:t,height:r},"compressed",n)};function yh(e,t,r=e){if(t instanceof AbortSignal)throw new E("INVALID_OPTIONS",`${e}: options is an AbortSignal, no options object: write { signal }`,r===null?{}:{url:r});return typeof t=="object"&&!Array.isArray(t)?t?.signal:void 0}var Zy=async(e,t)=>Gj(e,yh(e,t)),UEe={texture:async(e,t)=>wh.image(await Zy(e,t)),cubeTexture:async(e,t)=>wh.cube(await Promise.all(e.map(r=>Zy(r,t)))),imageBitmap:Zy,async file(e,t="text",r){if(typeof t=="object"&&t!==null)throw new E("INVALID_OPTIONS",`${e}: options stand where how to read the file goes: write { signal } after 'text', 'arraybuffer' or 'json'`,{url:e});let n=await vr(e,yh(e,r));return t==="json"?n.json():t==="arraybuffer"?n.arrayBuffer():n.text()},async sound(e,t){let r=await(await vr(e,yh(e,t))).arrayBuffer();return(await M.pageAudio.load()).decodeSound(r)},async lightProfile(e,t){let r=typeof e=="string"?yh(e,t):yh("a light profile\u2019s bytes",t,null),[n,o]=await Promise.all([typeof e=="string"?vr(e,r):e,M.lightProfile.load()]);return o.lightProfileOf(n)},async data(e,t){let r=wh.image(await Zy(e,t));return r.colorSpace="linear",r}};var Kgt=(e,t)=>u0(e,c0).get(t)??null;function _v(e){let t=u0(e,c0);return{visibilityMs:t.get("visibility")??null,materialsMs:t.get("materials")??null,otherMs:t.get("other")??null}}var ex=$a(e=>e.root),Jy=[];function jj(e,t){if(ex.size===0)return!1;let r=Jy.length,n=!1;try{let o=ex.copyInto(Jy,r);for(let i=r;i<o;i++){let s=Jy[i];s.root._alive===!1?s.pause():Dn(s.root,e)&&(n=s.update(t)||n)}}finally{Jy.length=r}return n}var tx=new WeakMap,VEe=e=>tx.get(e)?.clips??!0;function GEe(e){return tx.get(fn(e.root))?.clips===!1}var HEe=e=>Dr.asked&&e?.clips!==!1;function vv(e,t,r){let n=e?.sequences!==!1&&jj(t,r);return(e?.clips===!1?N0(t,r):P_(t,r))||n}function Mv(e,t){let r={clips:!1,sequences:!1},n=!1,o=!0,i=a=>Dn(a.root,t);tx.set(t,r),Dr.held=GEe;let s=()=>{r.clips=r.sequences=!1};return{runs:r,run(a){if(!o)return;let l=n&&(!r.clips&&U4(t)||a&&!r.sequences&&ex.some(i));r.clips=!0,r.sequences=a,n=!0,B4(t),l&&e()},stop:s,dispose(){o&&(s(),o=!1,tx.delete(t))}}}function $j(){let e={interval:Number.NaN},t={gap:0,span:0,paused:!1,read(){t.paused=t.gap>4*e.interval,t.span=t.paused?e.interval:t.gap},ran(){t.gap>0&&(e.interval=t.paused?4*e.interval:t.gap)}};return t}var xh=120,Kj=100,mo=.1,WEe=2,Dv=1,zEe=4,Pv=3,jEe=.9,$Ee=500,qj=(e,t)=>Math.max(mo*e,t),Cv=(e,t)=>e%1!==0?0:t,YEe=(e,t,r)=>Math.abs(e-Math.max(1,Math.round(e/t))*t)<=r,Yj=(e,t)=>Math.abs(e-t)<=mo*t;function KEe(e,t,r,n){let o=qj(r,n),i=(1-jEe)*t,s=0,a=0;for(let l=0;l<t;l++)if(YEe(e[l],r,o))s+=e[l],a+=Math.max(1,Math.round(e[l]/r));else if(--i<0)return Number.NaN;return s/a}function qEe(e,t,r,n){let{resolution:o,floor:i}=r,s=Math.max(WEe,zEe*o),a=Math.max(s,i);for(let l=0,c=0;l<t;l=c){for(;c<t&&e[c]<=e[l]+qj(e[l],o);)c++;if(c-l<Pv)continue;let u=e[l+c-1>>1];for(let d=1;u/d>=(d===1?s:a);d++){let f=KEe(e,t,u/d,o);if(!Number.isNaN(f))return n.cadence=f,d}}return 0}function XEe(e,t,r,n,o){let{last:i}=n,{gap:s}=o,a=0,l=-1;for(let u=0;u<r;u++)t[u]>i-Pi&&(e[a]=e[u],t[a]=t[u],(l<0||t[a]<t[l])&&(l=a),a++);a===xh&&(a--,e.copyWithin(l,l+1,xh),t.copyWithin(l,l+1,xh));let c=a;for(;c>0&&e[c-1]>s;c--)e[c]=e[c-1],t[c]=t[c-1];return e[c]=s,t[c]=i,a+1}function QEe(e,t,r,n){r.floor=r.seen?(1-mo)*n.display:0;let o=qEe(e,t,r,n);o!==0&&((!n.settled||n.cadence<=(1+mo)*n.display)&&(n.display=n.cadence,r.seen||=o===1,n.display>(1+mo)*n.vsync||(n.vsync=Number.NaN)),n.settled=!0)}function ZEe(e,t,r,n){let o=r-e.last,{display:i}=t;return r<=e.last||(e.last=r),!(o>0)||!t.settled?!1:o>=Kj||Yj(o,i)||o>i&&n>o-i?(e.count=0,!1):(e.count>0&&!Yj(o,e.sum/e.count)&&(e.count=0),e.count===0&&(e.from=r-o,e.sum=0),e.sum+=o,e.count++,!(r-e.from<$Ee))}function JEe(e,t,r){let n=e.sum/e.count,o=t.vsync<t.display?t.vsync:t.display;t.vsync=n>(1+mo)*o?o:Number.NaN,t.display=n,t.cadence=Number.NaN,r.seen=!1,e.count=0}function lSt(e){let t=new Float64Array(xh),r=new Float64Array(xh),n={last:Number.NaN,resolution:Dv,floor:0,seen:!1},o={last:Number.NaN,from:0,sum:0,count:0},i=0,s={display:e,cadence:Number.NaN,vsync:Number.NaN,gap:Number.NaN,settled:!1,reset(){n.last=o.last=Number.NaN,n.seen=!1,i=o.count=0,s.cadence=s.vsync=Number.NaN,s.settled=!1},given(a,l){ZEe(o,s,a,l)&&(JEe(o,s,n),i=0)},tick(a){let l=s.gap=a-n.last;n.last=a,n.resolution=Cv(a,n.resolution),l>0&&l<Kj&&(i=XEe(t,r,i,n,s),QEe(t,i,n,s))}};return s}function Xj(){let e={period:Number.NaN,refresh:Number.NaN,start:Number.NaN,steps:0,seen:Number.NaN,run:0,resolution:Dv,stamp:new Float64Array(1)},t={time:Number.NaN,delta:0,snapped:!1,refreshed(r){eTe(e,r)},frame(){tTe(e,t)},restart(){e.run=0,Number.isNaN(e.seen)||Iv(e,t)}};return t}function Iv(e,t){e.start=t.time=e.seen,e.steps=0,t.snapped=!1,e.refresh>0&&(e.period=e.refresh)}function eTe(e,t){e.refresh=t!=null&&t>0?t:Number.NaN,e.refresh>0?(!(e.period>0)||!(Math.abs(e.refresh-e.period)<=mo*e.period))&&(e.period=e.refresh,e.run=0):(e.period=Number.NaN,e.run=0)}function tTe(e,t){BH(e.stamp);let r=e.stamp[0],n=t.time,o=e.period;if(e.resolution!==0&&(e.resolution=Cv(r,e.resolution)),Number.isNaN(n)){e.seen=r,Iv(e,t),t.delta=0;return}if(o>0){let i=Math.max(mo*o,e.resolution),s=r-e.seen;if(Math.abs(s)<=i){t.delta=0;return}let a=Math.max(1,Math.round(s/o));if(e.run=Math.abs(s-a*o)<=i?e.run+1:0,e.seen=r,e.run>=Pv){let l=Math.round((r-e.start)/o),c=e.start+l*o;if(l>e.steps&&Math.abs(r-c)<=i){t.delta=(l-e.steps)*o,e.steps=l,t.time=c,t.snapped=!0;return}}}t.delta=r-n,e.seen=r,Iv(e,t)}var rTe=1e-4,nTe=20,Fv=A({paused:p("paused",!1),timeDilation:g("timeDilation",1,[rTe,nTe])}),Qj=(e,t)=>Gd(Fv,"world.clock",e,t),kv=new Float64Array(1),rx=class{#e=Fv.paused.default;#t=Fv.timeDilation.default;#n=0;#r=0;#o;#i=fe();constructor(t){this.#o=t}get time(){return kv[0]=this.#o(),this._worldTime(kv,0),kv[0]}get paused(){return this.#e}set paused(t){Qj("paused",t)!==this.#e&&(this.#s(),this.#e=t,this.#i.emit(this))}get timeDilation(){return this.#t}set timeDilation(t){Qj("timeDilation",t)!==this.#t&&(this.#s(),this.#t=t,this.#i.emit(this))}onChange(t){return this.#i.subscribe(t)}_worldSeconds(t,r){t[r]=this.#e?0:t[r]*this.#t}_worldTime(t,r){t[r]=this.#e?this.#n:this.#n+(t[r]-this.#r)*this.#t}_dispose(){this.#i.clear()}#s(){this.#n=this.time,this.#r=this.#o()}};var Zj={rafIntervalMs:null,displayRefreshMs:null,cpuFrameMs:0,cpuSelectNodesTested:null,cpuSubmitMs:null,drawCalls:null,clusters:null,selectedTriangles:null,residentPages:null,geometryAllocationBytes:null,vramBytes:null,pageLoads:0,pageBytesRead:0,pagesDetached:null,cacheEvictions:null,occluded:null,postHidden:null,residencyRequestsWalked:null,residencyUnitsWalked:null,voxelStepsMean:null,voxelStepsMax:null,gpuPassMs:null,gpuFrameMs:null,gpuHostGapMs:null,gpuIdleMs:null,gpuTimer:null,tessellationLoss:null,gpuDeviceLost:null,uncoveredTriangles:null,drawnTriangles:null,lightsActive:null,tyreMarks:null,shadowPagedMapLights:null,shadowPagedMapCount:null,shadowPagedMapPagesRequested:null,shadowPagedMapPagesAllocated:null,shadowPagedMapPagesCached:null,shadowPagedMapPagesRendered:null,shadowPagedMapPagesEmpty:null,shadowPagedMapPagesWpoConsidered:null,shadowPagedMapFreePages:null,shadowPagedMapLodBias:null,shadowPagedMapRootsNoted:null,shadowPagedMapRootsBoxed:null,shadowPagedMapProjectionPasses:null,shadowPagedMapOverflowFlags:null,shadowPagedMapInvalidationMs:null,shadowPagedMapMarkingMs:null,shadowPagedMapPageManagementMs:null,shadowPagedMapRenderMs:null,shadowPagedMapProjectionMs:null,shadowPoolBytes:null,shadowResolutionBias:null,tileLightPoolReserved:null,tileLightPoolCapacity:null,tileLightPoolOverflowed:null,gpuLightListsMs:null,gpuShadowsMs:null,gpuLightingMs:null,bounce:null,reflections:null,surfaceAtlas:null,ambientOcclusion:null,toneTable:null,texturePoolBytes:null,texturePoolFormat:null,textureResidentBytes:null,textureBytesLastFrame:null,pagesChecked:null,pageCheckMs:null};var Hn=e=>Object.fromEntries(e.map((t,r)=>[t,r]));var oTe=Hn(af),xSt=new Set([...lf].map(e=>oTe[e])),nx=["lost","capturing","capturePending","frameEncoder","metricsPending","cutMoving","overBudget","noOccluderHistory","deferredDrops","bootstrap","residencyBusy","clustersOwed","texturesPending","shadowsPending","cutPending","coplanarPending","bounceProbes","deforming","reflections","hlodWarming","exposure","finishing","fogVolume","translucentLightVolume","translucentBounce","viewProbes","occlusion","casterSettling","noisePhase","fieldsBuilding"],ox=["taaConverging","frameDifference","surfaceAtlas","pathTracing","guides","hairDebug","effects","postProcessMaterialsAnimated","particles","lightPatterns","fogSunLightPattern","lightProfiles","ambientCubemap","lightShapes","graphsAnimated","blendGraphsAnimated","fogVolumeAnimated","densityVolumesPlaying","decals","tyreMarks","clouds","skyCubemaps","skyCaptureOwed","finishAnimated"];var bSt=Hn(YA),iTe=["scene","view","resources"],sTe=[...ox,...nx,"firstImage",...iTe,"confirming","unstable","noiseClock","swapped","forced"],ESt=Hn(sTe),Jj={taaConverging:!1,frameDifference:!1,surfaceAtlas:!1,pathTracing:!1,guides:!1,hairDebug:!1,effects:!1,postProcessMaterialsAnimated:!0,particles:!0,lightPatterns:!1,fogSunLightPattern:!1,lightProfiles:!1,ambientCubemap:!1,lightShapes:!0,graphsAnimated:!0,blendGraphsAnimated:!0,fogVolumeAnimated:!0,densityVolumesPlaying:!0,decals:!1,tyreMarks:!0,clouds:!1,skyCubemaps:!1,skyCaptureOwed:!1,finishAnimated:!0,lost:!1,capturing:!1,capturePending:!1,frameEncoder:!1,metricsPending:!1,cutMoving:!1,overBudget:!1,noOccluderHistory:!1,deferredDrops:!1,bootstrap:!1,residencyBusy:!1,clustersOwed:!1,texturesPending:!1,shadowsPending:!1,cutPending:!1,coplanarPending:!1,bounceProbes:!1,deforming:!1,reflections:!1,hlodWarming:!1,exposure:!0,finishing:!1,fogVolume:!1,translucentLightVolume:!1,translucentBounce:!1,viewProbes:!1,occlusion:!1,casterSettling:!1,noisePhase:!1,fieldsBuilding:!1,firstImage:!1,scene:!1,view:!1,resources:!1,confirming:!1,unstable:!1,noiseClock:!1,swapped:!1,forced:!0},e$=e=>({terms:ox.flatMap((t,r)=>e&&Jj[t]?[]:[r]),reasons:nx.reduce((t,r,n)=>e&&Jj[r]?t:t|1<<n,0)}),TSt=e=>e.run.gate?.hold?.asks===aTe,ASt=e$(!1),aTe=e$(!0),bh=["sceneWritten","sceneReshaped","diagnosticView","materialChanged","shadingModels","sceneLights","lightPictures","fogVolumes","posesMoved","verticesRewritten","placementsMoved","placementsGrown","placementsComposed","cameraCut","viewMoved","viewQuality","simpleLights","skyFaceWaiting","reflectionDrawn","reflectionChanged","markedDepthMoved","referenceReleased","shadowOrigin","captureAccumulation","targetsMade","cameraPost","reflectionRecapture","skyQuality","skyModule","skyCubeLanded","blueNoiseLanded","taaLevel","taaRigged","vertexPoolGrown","inspection","litProgram","reflectionPrograms","cubeCaptured","captureDue","cloudPrograms","feedbackVariant","catalogueCover","worldCover","materialGraphs","targetsResized","textureColor","tilesServed","layersGrown","bounceSwitched","viewProbes","bounceProbes","memoryBudget","texturePoolGrown","cutReleased","residentSynced","clearColor","textureAppended","textureReleased","pageLanded","pageDropped","pageResidence","cutAdopted","cutFrozen","deviceGone","coverPending","renderScale","worldCells","blendPipelines","sortedBuffers","settingsWritten","shadowSetLost","shadowNodes","skinTable","volumePrograms","volumeGrid","hairStrands","rayTracing","distanceFieldBuilt","bakedLightVolume","programLanded","animation","physics","invalidate"],Gs=Hn(bh),Nv=["main","pageView","planarReflection","markedDepth","skyFace","aside"],OSt=Hn(Nv);var Iu=(e,t,r)=>({rows:null,width:t,capacity:r,filed:0,starts:[],make:e}),lTe=(e,t)=>t%e.capacity*e.width,ix=e=>new Float64Array(e).fill(Number.NaN);function RSt(e){return e.rows??=e.make(e.width*e.capacity),lTe(e,e.filed++)}var r$=512,cTe=q2(bh.length),uTe=Hn(["frame","image","atMs","view","role","verdict","because","unsettled","answer","retry","causes"]),Bv=uTe.causes+cTe;function dTe(e){let t=0;return e.map(([r,n])=>{let o={name:r,names:n,at:t};return t+=n.length,o})}var fTe=dTe([["verdicts",af],["reasons",nx],["terms",ox],["causes",bh]]),[CSt,ISt,kSt,t$]=fTe,pTe=t$.at+t$.names.length,n$=()=>({ring:Iu(e=>new Int32Array(e),Bv,r$),counts:new Uint32Array(Nv.length*pTe),bumps:0,stamps:new Float64Array(bh.length),progress:{sinceChange:NaN,forgetting:NaN,images:NaN,needed:NaN},progressAt:-1,compiles:null});function FSt(e,t,r){(e.compiles??=new Array(r$).fill(null))[t/Bv]=r}var NSt=(e,t)=>e.compiles?.[t/Bv]??null;function ku(e,t){e?.ring.starts.length&&(e.stamps[t]=++e.bumps)}function BSt(e,t,r){e?.ring.starts.length&&t.cause(r)}var Eh=Object.freeze({...Zj}),Tl=0;function o$(e,t){return e.add(t),()=>{e.delete(t)}}function i$(e,t){let r=hTe(e,t),{hooks:n,early:o}=r;return W({get last(){return r.last},worldClock:r.clock,clock:r.time,real:r.lived,quietClock:t===void 0?void 0:r.quiet,add:i=>o$(n,i),before:i=>o$(o,i),step:(i,s,a=null,l)=>STe(r,i,s,a,l),dispatch:i=>wTe(r,i),clear(){n.clear(),o.clear(),r.clock._dispose()}})}function hTe(e,t){let r={clock:new rx(()=>r.lived[0]),hooks:new Set,early:new Set,grid:Xj(),lived:new Float64Array(1),quiet:new Float64Array(1),time:new Float64Array(1),mapped:new Float64Array(1),handed:{box:null,value:Number.NaN},handedReal:{box:null,value:Number.NaN},frame:0,last:null,pace:$j(),info:{delta:0,realDelta:0,time:0,frame:0,metrics:Eh},ahead:{delta:0,realDelta:0,time:0},steps:{first:!0,taken:!1,since:0,world:0,real:0},why:e,fixedStep:t,fixedSteps:0};return r}function s$(e){let{grid:t,pace:r,steps:n,mapped:o,lived:i,time:s}=e;t.frame(),mTe(e),!n.first&&r.paused&&t.restart();let a=o[Tl];n.first=!1,n.taken=!0,n.since+=a,n.real=a,e.fixedStep===void 0?i[0]+=a:a>0&&(i[0]=++e.fixedSteps*e.fixedStep/1e3,e.quiet[0]=i[0]*1e3),e.clock._worldSeconds(o,Tl),n.world+=o[Tl],s[0]=i[0],e.clock._worldTime(s,0)}function mTe({steps:e,fixedStep:t,grid:r,pace:n,mapped:o}){e.first?o[Tl]=0:t!==void 0?o[Tl]=t/1e3:(n.gap=r.delta/1e3,n.read(),o[Tl]=n.span)}function gTe(e,t){let{ahead:r,early:n}=e;r.delta=t,r.realDelta=e.steps.real,r.time=e.time[0];for(let o of n)o(r)}function STe(e,t,r,n,o){s$(e);let{handed:i,handedReal:s,steps:a}=e,l=e.mapped[Tl];i.value!==l&&(i.box=i.value=l);let c=i.box;n?.time(c);let u=t?.autoUpdate?t:null;u&&a.real!==l&&u.realTime?(s.value!==a.real&&(s.box=s.value=a.real),u.update(s.box)):u?.update(c);let d=vv(o,r,c)&&!e.clock.paused,f=n?.frame(t?.eyes)??!1;return u?.place?.(),d&&ku(e.why,Gs.animation),f&&ku(e.why,Gs.physics),gTe(e,c),d||f}function wTe(e,t){let{info:r,steps:n,pace:o,grid:i}=e;n.taken||s$(e),r.delta=n.world,r.realDelta=n.since,o.gap=n.since,o.ran(),n.taken=!1,n.since=n.world=0,r.time=e.time[0],r.frame=e.frame++,r.metrics=e.last=t,i.refreshed(t.displayRefreshMs);for(let s of e.hooks)s(r)}var yTe=e=>_v(KL(e)?.gpuPassMs??null),xTe={frame:e=>KL(e)??Eh,gpuPasses:yTe};var Sn=(e,t,r)=>new E("INVALID_INSTANCES",`${e} ${t}`,r),Fu=class{matrices;#e;#t;#n;#r=null;constructor(t,r,n){if(!Number.isInteger(t)||t<0)throw Sn(r,"capacity is a whole number of placements",{capacity:t});let o=new Float32Array(t*16);for(let i=0;i<t*16;i+=16)o[i]=o[i+5]=o[i+10]=o[i+15]=1;this.matrices=new Oe(o,16),this.matrices._onChange=()=>this.#i(),this.#e=r,this.#t=n,this.#n=t}get count(){return this.#n}set count(t){let r=this.#n;if(t!==r){if(!Number.isInteger(t)||t<0||t>this.matrices.count)throw Sn(this.#e,`count is a whole number up to ${this.matrices.count}`,{count:t});this.#n=t,this.#t(Math.min(r,t),Math.max(r,t)-1)}}setMatrixAt(t,r){this.setMatrices(r.elements,t)}getMatrixAt(t,r){return this.#o(t,1),r.fromArray(this.matrices.array,t*16)}visibleAt(t){return this.#o(t,1),this.#r?.[t]!==1}setVisibleAt(t,r){if(typeof r!="boolean")throw Sn(this.#e,"visibility is true or false",{visible:r});this.visibleAt(t)!==r&&((this.#r??=new Uint8Array(this.matrices.count))[t]=r?0:1,this.#t(t,t))}visibleAs(t){let r=t.#r;if(!r&&!this.#r)return;let n=this.#r??=new Uint8Array(this.matrices.count);n.fill(0),r&&n.set(r.subarray(0,n.length))}setMatrices(t,r=0){let n=t.length/16;if(!Number.isInteger(n))throw Sn(this.#e,"matrices are sixteen numbers each",{length:t.length});this.#o(r,n),n&&(this.matrices.array.set(t,r*16),this.matrices.version++,this.#t(r,r+n-1))}#o(t,r){let{count:n}=this.matrices;if(!(Number.isInteger(t)&&t>=0&&t+r<=n))throw Sn(this.#e,`placements lie from 0 to ${n-1}`,{start:t,placements:r})}#i(){let{updateRanges:t,count:r}=this.matrices;!t.length&&r&&this.#t(0,r-1);for(let{start:n,count:o}of t)if(o>0){let i=Math.min(r-1,Math.floor((n+o-1)/16));this.#t(Math.max(0,Math.floor(n/16)),i)}this.matrices.clearUpdateRanges()}};function sx(e){let t=r=>({configurable:!0,writable:!0,value:r});Object.defineProperties(e,{instanceMatrix:{configurable:!0,get(){return this._placements.matrices}},count:{configurable:!0,get(){return this._placements.count},set(r){this._placements.count=r}},setMatrixAt:t(function(r,n){this._placements.setMatrixAt(r,n)}),getMatrixAt:t(function(r,n){return this._placements.getMatrixAt(r,n)}),setMatrices:t(function(r,n){this._placements.setMatrices(r,n)})})}var Qo=class e extends ot{get isInstancedMesh(){return!0}_placements;constructor(t,r,n){super(t,r),this._placements=new Fu(n,"An instanced mesh's",(o,i)=>this._link?.instances?.(this,o,i))}getVisibleAt(t){return this._placements.visibleAt(t)}setVisibleAt(t,r){this._placements.setVisibleAt(t,r)}blank(){return new e(this.geometry,this.material,this.instanceMatrix.count)}copy(t,r=!0){if(super.copy(t,r),!(t instanceof e))return this;let n=t,o=n.instanceMatrix.array;return this.instanceMatrix.array.set(o.subarray(0,this.instanceMatrix.array.length)),this._placements.visibleAs(n._placements),this.instanceMatrix.needsUpdate=!0,this.count=l_({count:n.count,instanceMatrix:this.instanceMatrix}),this}released=new Set;dispose(){Ev(this.released)}};sx(Qo.prototype);function a$(e){let t=[];for(let r=0;r<e.count;r++)e.getVisibleAt(r)&&t.push(r);return t}var go=class e extends ot{isSprite=!0;center=new Me(.5,.5);constructor(t){super(Yy(1,1),l$(t??_u.sprite()),"sprite"),Se(this.center,()=>this._link?.content(this))}get material(){return super.material}set material(t){super.material=l$(t)}blank(){let t=new e(this.material);return t.geometry=this.geometry,t.center.copy(this.center),t}};function l$(e){if(!Array.isArray(e)&&e.kind==="sprite")return e;let t=Array.isArray(e)?"a material list":`material.${e.kind}`;throw new TypeError(`A sprite wears a material.sprite, not ${t}.`)}var ax=new WeakMap,Uv=new WeakMap,Th=new I,c$=new Float64Array([-.5,-.5,-.5,.5,.5,.5]),Al=class e extends he{isWaterExclusionVolume=!0;type="WaterExclusionVolume";mode="allExceptListed";bodies=[];get _link(){return super._link}set _link(t){let r=Uv.get(this);if(r&&ax.get(r)?.delete(this),Uv.delete(this),super._link=t,!t)return;let n=ax.get(t);n||ax.set(t,n=new Set),n.add(this),Uv.set(this,t)}excludes(t){let r=!!t&&this.bodies.includes(t);return this.mode==="onlyListed"?r:!r}encompasses(t,r,n){return this.updateWorldMatrix(!0,!1),Th.set(t,r,n),this.worldToLocal(Th),Lg(c$,0,Th.x,Th.y,Th.z)}worldBounds(t){return this.updateWorldMatrix(!0,!1),cs(t,0,c$,0,this.matrixWorld.elements),t}blank(){return new e}copy(t,r=!0){super.copy(t,r);let n=t;return n.isWaterExclusionVolume&&(this.mode=n.mode,this.bodies=n.bodies.slice()),this}},gwt=e=>{let t=e?._link;return t?ax.get(t):void 0};var bTe=["shadowBias","shadowSlopeBias","shadowSharpen"],ETe=["barnDoorAngle","barnDoorLength","iesBrightness","iesBrightnessScale"],d$=["intensity","distance","innerConeAngle","outerConeAngle","width","height","radius","tubeLength","softRadius","angularRadius","softAngle","hairDeepShadowLayerDistribution","fogScattering","shadowResolutionScale","temperatureKelvin","forwardShadingPriority","radialExponent","diffuseShare","specularShare",...bTe,...ETe,...Ic],TTe={point:"point",spot:"spot",directional:"directional",rectArea:"rect"},Vv=e=>TTe[e],lx=ve.width.default;function ATe(e,t){let r=Vv(e);return r?DO({kind:r,intensityUnits:t.intensityUnits,outerConeAngle:t.outerConeAngle,innerConeAngle:t.innerConeAngle,inverseSquared:t.inverseSquared,emitterRadius:t.radius,emitterLength:t.tubeLength,size:[t.width??lx,t.height??lx]}):1}var u$={distance:()=>0,innerConeAngle:()=>Ma,outerConeAngle:()=>Af,width:()=>lx,height:()=>lx,radius:()=>0,tubeLength:()=>0,softRadius:()=>0,angularRadius:e=>e==="directional"?Ot.sunAngularRadius:0,softAngle:()=>0,hairDeepShadowLayerDistribution:()=>.5,fogScattering:()=>1,shadowResolutionScale:()=>1,temperatureKelvin:()=>Fo,forwardShadingPriority:()=>0,radialExponent:()=>Ot.radialExponent,diffuseShare:()=>1,specularShare:()=>1,inverseExposureBlend:()=>0,maxDrawDistance:()=>0,maxDistanceFadeRange:()=>0,shadowBias:()=>Hr,shadowSlopeBias:()=>Hr,shadowSharpen:()=>0,barnDoorAngle:()=>La,barnDoorLength:()=>Rc,iesBrightness:()=>0,iesBrightnessScale:()=>1};function f$(e,t){let r={intensity:t.intensity??ATe(e,t)};for(let n of Object.keys(u$))r[n]=t[n]??u$[n](e);return r}function Tt(e){Qt(e),e._link?.content(e)}function Zo(e,t,r,n){VW(e,"Light",t,function(){return r(this)},function(o){n(this,o),Tt(this)})}function Nu(e,t,r){for(let n of t)Zo(e,n,o=>r(o)[n],(o,i)=>r(o)[n]=i)}function cx(e,t){for(let[r,n]of Object.entries(t))Object.defineProperty(e,r,{get(){return n(this)}})}function Ah(e,t){return{fresh:()=>Object.fromEntries(e.map(r=>[r,t[r]])),take(r,n){let o=n;for(let i of e){let s=o[i];s!==void 0&&(r[i]=s)}},differing(r,n){let o={};for(let i of e)r[i]!==t[i]&&!n?.(i)&&(o[i]=r[i]);return o},fromRecord(r){let n=r;return Object.fromEntries(e.map(o=>[o,n[o]]))}}}function Oh(e,t){let r=new WeakMap;return{peek:n=>r.get(n),of:n=>{let o=r.get(n);if(!o){o=e(),r.set(n,o);for(let i of t(o))Se(i,()=>Tt(n))}return o}}}function ux(e,t=()=>!0){let r=Object.keys(e),n=Object.freeze(ue(e,{})),o=Ah(r,n),i=Oh(o.fresh,()=>[]),s=Object.fromEntries(r.map(a=>[a,dn("Light",a)===void 0?l=>hr(e[a],l):l=>l]));return{take(a,l){if(!t(a))return;let c=l;for(let u of r)c[u]!==void 0&&(i.of(a)[u]=s[u](c[u]))},copy(a,l){let c=i.peek(l),u=c?i.of(a):i.peek(a);u&&Object.assign(u,c??o.fresh())},settingsSet(a){let l=i.peek(a);return l&&t(a)?o.differing(l):{}},fromRecord:a=>o.fromRecord(a),define(a){for(let l of r)Zo(a,l,c=>i.of(c)[l],(c,u)=>i.of(c)[l]=s[l](u))}}}function ji(e,t){let r=new WeakSet;return{take(n,o){(t?o===!1:o)&&r.add(n)},copy(n,o){r.has(o)?r.add(n):r.delete(n)},define(n){Zo(n,e,o=>r.has(o)!==t,(o,i)=>{!!i===t?r.delete(o):r.add(o)})}}}var fx=["useTemperature","shadowsAir","transmittancePerPixel","transmission","castHairDeepShadow"],Gv=Object.fromEntries(fx.map(e=>[e,ji(e,!1)]));function p$(e,t){for(let r of fx)Gv[r].take(e,t[r])}function h$(e,t){for(let r of fx)Gv[r].copy(e,t)}function m$(e){for(let t of fx)Gv[t].define(e)}var dx=new WeakMap;function Lh(e){let t=dx.get(e);return t||(t=new pe([1,1,1]),dx.set(e,t),Se(t,()=>Tt(e))),t}function Rh(e){let t=dx.get(e);return t&&!(t.r===1&&t.g===1&&t.b===1)?t:void 0}function g$(e,t){t!==void 0&&Lh(e).set(t)}function S$(e,t){let r=Rh(t);r?Lh(e).copy(r):dx.has(e)&&Lh(e).set([1,1,1])}function w$(e,t){if(e.useTemperature&&(t.useTemperature=!0),e.transmission&&(t.transmission=!0),e.castHairDeepShadow&&(t.castHairDeepShadow=!0),e.hairDeepShadowLayerDistribution!==.5&&(t.hairDeepShadowLayerDistribution=e.hairDeepShadowLayerDistribution),e.temperatureKelvin!==Fo&&(t.temperatureKelvin=e.temperatureKelvin),t.kind!=="directional")return;e.shadowsAir&&(t.shadowsAir=!0),e.transmittancePerPixel&&(t.transmittancePerPixel=!0);let r=Rh(e);r&&(t.sunDiskTint=r.toArray())}var _h=new WeakMap;function So(e){let t=_h.get(e);if(!t){let[r,n,o]=_r.scale;t={material:null,scale:new I(r,n,o),fadeDistance:_r.fadeDistance,disabledBrightness:_r.disabledBrightness,coneAngle:_r.coneAngle},_h.set(e,t),Se(t.scale,()=>Tt(e))}return t}function x$(e,t){let r=_h.get(e);if(!r?.material)return;let{scale:n,fadeDistance:o,coneAngle:i,disabledBrightness:s}=_r;t.lightPattern=Z1(r.material),r.scale.equals({x:n[0],y:n[1],z:n[2]})||(t.lightPatternScale=r.scale.toArray()),r.fadeDistance!==o&&(t.lightPatternFadeDistance=r.fadeDistance),r.disabledBrightness!==s&&(t.lightPatternDisabledBrightness=r.disabledBrightness),e.kind==="rectArea"&&r.coneAngle!==i&&(t.lightPatternConeAngle=r.coneAngle)}function Hv(e,t){let r=_h.get(e);r&&(r.stop?.(),r.stop=t?r.material?._listeners.subscribe(()=>Tt(e)):void 0)}function Wv(e,t){let r=So(e);t&&Z1(t),r.material!==t&&(r.material=t,Hv(e,!!e._link))}function b$(e,t){t.lightPattern&&Wv(e,t.lightPattern),t.lightPatternScale&&So(e).scale.set(...t.lightPatternScale),t.lightPatternFadeDistance!==void 0&&(So(e).fadeDistance=t.lightPatternFadeDistance),t.lightPatternDisabledBrightness!==void 0&&(So(e).disabledBrightness=t.lightPatternDisabledBrightness),t.lightPatternConeAngle!==void 0&&(So(e).coneAngle=t.lightPatternConeAngle)}function E$(e,t){let r=So(t);Wv(e,r.material),So(e).scale.copy(r.scale),Object.assign(So(e),{fadeDistance:r.fadeDistance,disabledBrightness:r.disabledBrightness,coneAngle:r.coneAngle})}var OTe=["lightPatternFadeDistance","lightPatternDisabledBrightness","lightPatternConeAngle"],y$={lightPatternFadeDistance:"fadeDistance",lightPatternDisabledBrightness:"disabledBrightness",lightPatternConeAngle:"coneAngle"};function T$(e){Object.defineProperty(e,"lightPattern",{get(){return _h.get(this)?.material??null},set(t){Wv(this,t??null),Tt(this)}}),Object.defineProperty(e,"lightPatternScale",{get(){return So(this).scale}});for(let t of OTe)Zo(e,t,r=>So(r)[y$[t]],(r,n)=>So(r)[y$[t]]=n)}var vh=BS({}),O$=["shaftOcclusion","shaftOcclusionDarkness","shaftOcclusionDepthRange","shaftBloom","shaftBloomScale","shaftBloomThreshold","shaftBloomMaxBrightness"],LTe=new Set(["shaftOcclusion","shaftOcclusionDarkness","shaftOcclusionDepthRange"]),px=Ah(O$,vh),L$=Oh(()=>{let[e,t,r]=vh.shaftOverrideDirection;return{values:px.fresh(),direction:new I(e,t,r),tint:new pe(vh.shaftBloomTint)}},e=>[e.direction,e.tint]),Hs=L$.of;function R$(e,t){px.take(Hs(e).values,t),t.shaftOverrideDirection&&Hs(e).direction.set(...Lt(t.shaftOverrideDirection)),t.shaftBloomTint!==void 0&&Hs(e).tint.set(t.shaftBloomTint)}function _$(e,t){let r=Hs(t),n=Hs(e);n.values={...r.values},n.direction.copy(r.direction),n.tint.copy(r.tint)}function hx(e){let t=L$.peek(e);if(!t)return{};let r=e.kind==="directional",n=px.differing(t.values,a=>!r&<e.has(a)),o=(a,l)=>a.some((c,u)=>c!==l[u]),i=t.direction.toArray();r&&o(i,vh.shaftOverrideDirection)&&(n.shaftOverrideDirection=i);let s=t.tint.toArray();return o(s,vh.shaftBloomTint)&&(n.shaftBloomTint=s),n}function v$(e){let{shaftOverrideDirection:t,shaftBloomTint:r}=e;return{shaftOverrideDirection:t,shaftBloomTint:r,...px.fromRecord(e)}}function M$(e){Nu(e,O$,t=>Hs(t).values),cx(e,{shaftOverrideDirection:t=>Hs(t).direction,shaftBloomTint:t=>Hs(t).tint})}var zv=vf({}),P$=["shadowsClouds","castCloudShadows","cloudShadowStrength","cloudShadowOnAtmosphereStrength","cloudShadowOnSurfaceStrength","cloudShadowDepthBiasKm","cloudShadowExtentKm","cloudShadowResolutionScale","cloudShadowRaySamplesScale"],mx=Ah(P$,zv),C$=Oh(()=>({values:mx.fresh(),scale:new pe(zv.cloudScatteredLuminanceScale)}),e=>[e.scale]),Bu=C$.of;function I$(e,t){mx.take(Bu(e).values,t),t.cloudScatteredLuminanceScale!==void 0&&Bu(e).scale.set(t.cloudScatteredLuminanceScale)}function k$(e,t){let r=Bu(t),n=Bu(e);n.values={...r.values},n.scale.copy(r.scale)}function gx(e){let t=C$.peek(e);if(!t||e.kind!=="directional")return{};let r=mx.differing(t.values),n=t.scale.toArray();return n.some((o,i)=>o!==zv.cloudScatteredLuminanceScale[i])&&(r.cloudScatteredLuminanceScale=n),r}function F$(e){return{cloudScatteredLuminanceScale:e.cloudScatteredLuminanceScale,...mx.fromRecord(e)}}function N$(e){Nu(e,P$,t=>Bu(t).values),cx(e,{cloudScatteredLuminanceScale:t=>Bu(t).scale})}var{take:U$,copy:V$,settingsSet:Sx,fromRecord:G$,define:H$}=ux(Uo,e=>e.kind==="directional");var{take:z$,copy:j$,settingsSet:wx,fromRecord:$$,define:Y$}=ux(Ai);var $v=ji("inverseSquared",!0),jv=new WeakMap;function Yv(e,t){t===Ti?jv.delete(e):jv.set(e,t)}function q$(e,t){$v.take(e,t.inverseSquared),t.intensityUnits!==void 0&&Yv(e,t.intensityUnits)}function X$(e,t){$v.copy(e,t),Yv(e,t.intensityUnits)}function Q$(e){$v.define(e),Zo(e,"intensityUnits",t=>jv.get(t)??Ti,Yv)}function Z$(e,t){t.kind!=="directional"&&e.intensityUnits!==Ti&&(t.intensityUnits=e.intensityUnits)}function J$(e,t){e.inverseSquared||(t.inverseSquared=!1),e.radialExponent!==Ot.radialExponent&&(t.radialExponent=e.radialExponent)}function e8(e,t){if(t.kind!=="directional")for(let r of Ic)e[r]!==0&&(t[r]=e[r])}var t8=e=>Object.fromEntries(Ic.map(t=>[t,e[t]]));function r8(e,t){e.diffuseShare!==1&&(t.diffuseShare=e.diffuseShare),e.specularShare!==1&&(t.specularShare=e.specularShare)}var qv=new WeakMap;function Kv(e,t){t===Ta?qv.delete(e):qv.set(e,t)}var yx={take(e,t){t!==void 0&&Kv(e,t)},copy(e,t){Kv(e,t.mobility)},define(e){Zo(e,"mobility",t=>qv.get(t)??Ta,Kv)}};function n8(e){let t=Object.getOwnPropertyDescriptor(he.prototype,"lightGroups"),r=Ni(he.prototype,"lightGroups");Object.defineProperty(e,"lightGroups",{configurable:!0,enumerable:!0,get:t.get,set(n){t.set.call(this,n),Tt(this)}}),xt(e,"lightGroups",function(n){r.call(this,n),Tt(this)})}var o8=Ay(),f0t=e=>o8.set(e.id,e),i8=e=>o8.get(e);var Vu=new WeakMap,Ol=new WeakMap,Xv=new WeakMap,Qv=ji("useIesBrightness",!1);function s8(e){if(e!=null)return e.isLightProfile===!0?e:i8(e)??e}function Zv(e,t){t===void 0?Vu.delete(e):Vu.set(e,t)}function Jv(e,t){if(t&&t.isTexture!==!0)throw new E("INVALID_SCENE_LIGHT",`${e.name||"light"}: sourceTexture expects a texture`,{sourceTexture:t});t?Ol.set(e,t):Ol.delete(e),eM(e,!!e._link)}function RTe(e){let t=e._link;t?.picture?t.picture(e):Tt(e)}function eM(e,t){Xv.get(e)?.();let r=t?Ol.get(e):void 0;r?Xv.set(e,r._listeners.subscribe(()=>RTe(e))):Xv.delete(e)}function a8(e,t){Zv(e,s8(t.iesProfile)),Qv.take(e,t.useIesBrightness),Jv(e,t.sourceTexture)}function l8(e,t){Zv(e,Vu.get(t)),Qv.copy(e,t),Jv(e,Ol.get(t))}var c8=e=>Ol.get(e),u8=e=>e?.id??e,d8=e=>u8(Vu.get(e))??null;function tM(e,t){let r=s8(t);r!==Vu.get(e)&&(Zv(e,r),Tt(e))}function f8(e){Qv.define(e),Object.defineProperty(e,"sourceTexture",{get(){return Ol.get(this)??null},set(t){Jv(this,t),Tt(this)}})}var Mh=new I,Uu=new I,_Te=new I;function vTe(e,t){let r=e.matrixWorld.elements;return Uu.set(t[0],t[1],t[2]),Mh.set(r[4],r[5],r[6]).normalize(),_Te.crossVectors(Mh,Uu).lengthSq()<1e-6&&Mh.set(r[0],r[1],r[2]).normalize(),Mh.toArray()}function MTe(e,t){let r=Vu.get(e);if(r===void 0||t.kind!=="point"&&t.kind!=="spot")return;t.iesProfile=u8(r),e.useIesBrightness&&(t.useIesBrightness=!0),e.iesBrightnessScale!==1&&(t.iesBrightnessScale=e.iesBrightnessScale);let n=r.brightness??e.iesBrightness;n>0&&(t.iesBrightness=n),t.direction||(e.target.getWorldPosition(Uu).sub(e.getWorldPosition(Mh)),t.direction=(Uu.lengthSq()>0?Uu.normalize():Uu.set(0,-1,0)).toArray()),t.emitterAxis??=vTe(e,t.direction)}function DTe(e,t){if(t.kind!=="rect")return;e.barnDoorAngle!==La&&(t.barnDoorAngle=e.barnDoorAngle),e.barnDoorLength!==Rc&&(t.barnDoorLength=e.barnDoorLength);let r=Ol.get(e);r?.image&&(t.sourceTexture=r.id)}function p8(e,t){e.shadowBias!==Hr&&(t.shadowBias=e.shadowBias),e.shadowSlopeBias!==Hr&&(t.shadowSlopeBias=e.shadowSlopeBias),e.shadowSharpen!==0&&(t.shadowSharpen=e.shadowSharpen),MTe(e,t),DTe(e,t)}var h8=e=>({iesProfile:e.iesProfile,useIesBrightness:e.useIesBrightness,iesBrightnessScale:e.iesBrightnessScale,iesBrightness:e.iesBrightness,barnDoorAngle:e.barnDoorAngle,barnDoorLength:e.barnDoorLength,shadowBias:e.shadowBias,shadowSlopeBias:e.shadowSlopeBias,shadowSharpen:e.shadowSharpen});var PTe=qa("Light","iesProfile"),CTe=qa("Light","atmosphereSunIndex"),ITe=qa("Light","shadowsFog"),kTe=new Set(["directional","spot","hemisphere"]),xx=new I,oM=ji("atmosphereSun",!0),iM=ji("castTranslucentShadows",!0),rM=new WeakMap,nM=new WeakMap,$e=class e extends he{get isLight(){return!0}get castShadow(){return super.castShadow}set castShadow(t){super.castShadow=t}color;groundColor;target=new he;sh=null;_values;get iesProfile(){return d8(this)}set iesProfile(t){tM(this,PTe(t))}kind;constructor(t,r={}){let n=S0("Light",r);super(),this.kind=t,this.type=`${t}Light`,this.color=new pe(n.color??16777215),this.groundColor=new pe(n.groundColor??0);let o=()=>Qt(this);Se(this.color,o),Se(this.groundColor,o),this._values=f$(t,n),p$(this,n),q$(this,n),g$(this,n.sunDiskTint),b$(this,n),R$(this,n),I$(this,n),U$(this,n),z$(this,n),a8(this,n),n.shadowsFog!==void 0&&this.setFogShadow(n.shadowsFog),oM.take(this,n.atmosphereSun),iM.take(this,n.castTranslucentShadows),yx.take(this,n.mobility),n.lightGroups&&Ni(this,"lightGroups").call(this,n.lightGroups),n.atmosphereSunIndex!==void 0&&this.setSunIndex(n.atmosphereSunIndex),n.position?this.position.set(...Lt(n.position)):kTe.has(t)&&this.position.set(0,1,0),n.sh&&(this.sh=Array.from(n.sh)),n.target&&this.target.position.set(...Lt(n.target)),Ni(this,"castShadow").call(this,n.castShadow??!0)}get atmosphereSunIndex(){return rM.get(this)??0}set atmosphereSunIndex(t){this.setSunIndex(CTe(t)),Tt(this)}get sunDiskTint(){return Lh(this)}get shadowsFog(){return nM.get(this)??this.kind==="directional"}set shadowsFog(t){this.setFogShadow(ITe(t)),Tt(this)}setFogShadow(t){t===(this.kind==="directional")?nM.delete(this):nM.set(this,t)}setSunIndex(t){t===0?rM.delete(this):rM.set(this,t)}static{let t=e.prototype;xt(t,"iesProfile",function(r){tM(this,r)}),xt(t,"atmosphereSunIndex",function(r){this.setSunIndex(r),Tt(this)}),xt(t,"shadowsFog",function(r){this.setFogShadow(r),Tt(this)})}linked(t){let r=this._heard??=()=>this._link?.content(this);Hv(this,t),eM(this,t);for(let n of[this.color,this.groundColor,this.target.position])t?Se(n,r):Es(n,r)}get looksDownNegativeZ(){return!0}blank(){return new e(this.kind)}copy(t,r=!0){return super.copy(t,r),t instanceof e?(this._values={...t._values},oM.copy(this,t),iM.copy(this,t),yx.copy(this,t),this.setSunIndex(t.atmosphereSunIndex),this.setFogShadow(t.shadowsFog),h$(this,t),X$(this,t),S$(this,t),E$(this,t),_$(this,t),k$(this,t),V$(this,t),j$(this,t),l8(this,t),this.color.copy(t.color),this.groundColor.copy(t.groundColor),this.sh=t.sh&&[...t.sh],this.target.position.copy(t.target.position),this._link?.content(this),this):this}set needsUpdate(t){Tt(this)}get needsUpdate(){return!1}lookAt(t,r=0,n=0){super.lookAt(t,r,n),typeof t=="number"?xx.set(t,r,n):xx.set(t.x,t.y,t.z),this.target.parent?.worldToLocal(xx),this.target.position.copy(xx)}};m$($e.prototype);Q$($e.prototype);oM.define($e.prototype);iM.define($e.prototype);yx.define($e.prototype);n8($e.prototype);T$($e.prototype);M$($e.prototype);N$($e.prototype);H$($e.prototype);Y$($e.prototype);f8($e.prototype);Nu($e.prototype,d$,e=>e._values);mc($e.prototype);var Ll=e=>t=>new $e(e,t),sM={ambient:Ll("ambient"),directional:Ll("directional"),point:Ll("point"),spot:Ll("spot"),hemisphere:Ll("hemisphere"),rectArea:Ll("rectArea"),probe:Ll("probe")};var FTe=new Set([he,or,ot,go,$e,Al]);function m8(e){let t=new Map,r=g8(e,t);for(let n of t.values())n instanceof Al&&(n.bodies=n.bodies.map(o=>t.get(o)??o));return r}function g8(e,t){if(!FTe.has(e.constructor))return null;let r=e.clone(!1);if(t.set(e,r),r.rotation.copy(e.rotation),r instanceof ot){let n=r.material;r.geometry=r.geometry.clone(),r.material=Array.isArray(n)?n.map(o=>o.clone()):n.clone()}for(let n of e.children){let o=g8(n,t);o&&r.add(o)}return r}var aM={},Wn=e=>e.isLoadedModel===!0;function S8(e,{capacity:t}){if(!Wn(e))return new Qo(e.geometry,e.material,t);let r=aM.place;if(!r)throw Sn("A model","is drawn at many placements by the world that read it",{model:e.name});return r(e,t)}var lM=G({name:"audio",summary:"The sounds of a world, its audio volumes and its listener, mixed on the page's one audio context, their code fetched by the first sound played.",enabledByDefault:!0,requires:[],parts:[]});var w8=new WeakMap;function cM(e,t){w8.set(e,t)}function uM(e,t){let r=e._player,n=(t&&w8.get(t))??null;n!==r&&(e._player=n,r?.left(e),n?.entered(e))}var bx={autoplay:!0,loop:!1,volume:1,pitch:1,paused:!1,ui:!1,priority:1,doppler:0,soundClass:"",occlusionInterval:.1},NTe={level:[0,1/0],volume:[0,1/0],pitch:[0,1/0],priority:[0,100],doppler:[0,1/0],occlusionInterval:[0,1/0]};function Ws(e,t){let r=NTe[e];if(!r)return t;let n=r[0],o=r[1];if(typeof t=="number"&&Number.isFinite(t)&&t>=n&&t<=o)return t;let i=o===1/0?`\u2265 ${n}`:`from ${n} to ${o}`;throw new RangeError(`sound.${e} must be a finite number ${i}, not ${String(t)}.`)}var Rl=class e extends he{isSound=!0;type="Sound";_values={};_volume=bx.volume;_pitch=bx.pitch;_attenuation={};_buffer;concurrency=null;_player=null;_start=null;_voice=null;constructor(t=null,r={}){super(),this._buffer=t;let{attenuation:n,concurrency:o,volume:i,pitch:s,...a}=r;for(let l of Object.keys(a))Ws(l,a[l]);i!==void 0&&(this._volume=Ws("volume",i)),s!==void 0&&(this._pitch=Ws("pitch",s)),Object.assign(this._values,a),n!==void 0&&(this._attenuation=n),o!==void 0&&(this.concurrency=o)}get volume(){return this._volume}set volume(t){t!==this._volume&&(this._volume=Ws("volume",t),this._player?.changed(this))}get pitch(){return this._pitch}set pitch(t){t!==this._pitch&&(this._pitch=Ws("pitch",t),this._player?.changed(this))}_written(){this._player?.changed(this)}get buffer(){return this._buffer}set buffer(t){t!==this._buffer&&(this._buffer=t,this._player?.changed(this))}get attenuation(){return this._attenuation}set attenuation(t){this._attenuation=t,this._player?.changed(this)}get _link(){return super._link}set _link(t){super._link=t,uM(this,t)}get playing(){return this._voice!==null||this._start!==null}get time(){return this._voice?.time()??this._start?.offset??0}get clock(){return this._player?.clock()??0}play(t=0){this.fadeIn(0,1,t)}fadeIn(t,r=1,n=0){Ws("level",r),this._start={offset:Math.max(0,n),fade:Math.max(0,t),level:r},this._player?.asked(this)}stop(){this._start=null,this._player?.stop(this)}fadeOut(t,r=0){this._player?.fade(this,Math.max(0,t),r,!0)||this.stop()}adjustVolume(t,r){Ws("level",r);let n=Math.max(0,t),o=this._start;if(this._player?.fade(this,n,r,!1)||!o)return;let i=o.fade>0?o.from??0:o.level;this._start={...o,fade:n,level:r,from:i}}seek(t){this._player?.seek(this,Math.max(0,t))||this._start&&(this._start.offset=Math.max(0,t))}get looksDownNegativeZ(){return!0}blank(){return new e(this._buffer)}copy(t,r=!0){return super.copy(t,r),t instanceof e?(this._buffer=t._buffer,this._values={...t._values},this._volume=t._volume,this._pitch=t._pitch,this._attenuation=t._attenuation,this.concurrency=t.concurrency,this):this}};for(let e of Object.keys(bx))e!=="volume"&&e!=="pitch"&&Object.defineProperty(Rl.prototype,e,{get(){return this._values[e]??bx[e]},set(t){this._values[e]!==t&&(this._values[e]=Ws(e,t),this._player?.changed(this))}});var Gu=class e extends he{isAudioVolume=!0;type="AudioVolume";_priority=0;_enabled=!0;_reverb={};_zone={};_player=null;get priority(){return this._priority}set priority(t){this._priority=t,this._player?.changed(this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._player?.changed(this)}get reverb(){return this._reverb}set reverb(t){this._reverb=t,this._player?.changed(this)}get zone(){return this._zone}set zone(t){this._zone=t,this._player?.changed(this)}get _link(){return super._link}set _link(t){super._link=t,uM(this,t)}blank(){return new e}copy(t,r=!0){return super.copy(t,r),t instanceof e?(this._priority=t._priority,this._enabled=t._enabled,this._reverb=t._reverb,this._zone=t._zone,this):this}};var zs=class e extends he{settings;constructor(t={}){super(),this.settings=t}copy(t,r=!0){return super.copy(t,r),t instanceof e&&(this.settings={...t.settings}),this}},Dh=class extends zs{type="PlanarReflection"},Ph=class extends zs{type="CubeCapture"},Ch=class extends zs{type="FogSphere"};var Ex=(e,t)=>(r,n=new qe(t))=>new ot(r,n,e),Tx={mesh:(e,t)=>new ot(e,t??new qe("meshBasic")),instanced:(e,t,r)=>new Qo(e,t??new qe("meshBasic"),r),instances:S8,group:()=>new or,clone:m8,points:Ex("points","points"),line:Ex("lineStrip","line"),lineSegments:Ex("lineSegments","line"),lineLoop:Ex("lineLoop","line"),sprite:e=>new go(e),waterExclusion:(e="allExceptListed",t=[])=>{let r=new Al;return r.mode=e,r.bodies=t.slice(),r},sound:(e,t)=>new Rl(e,t),audioVolume:(e={},t={})=>{let r=new Gu;return r.reverb=e,r.zone=t,r},planarReflection:(e={})=>new Dh(e),cubeCapture:(e={})=>new Ph(e),fogSphere:(e={})=>new Ch(e)};var BTe={...Tx,splineMesh:async(e,t)=>(await M.splineMesh.load()).laySplineMesh(e,t)};var dM=te(.85,.65,1);function UTe(e,t,r){let n=Rn(r)*Math.min(1,t);return e*Je(1,n)/n}function y8(e,t,r=rh){if(!Number.isFinite(e)||e<=0)throw new Error("Empty scene bounds");if(!Number.isFinite(t)||t<=0)throw new Error("Invalid aspect");let n=UTe(e,t,r),o=e/1e4,i=Math.max(e*20,n+e*2);return{near:o,far:i,offset:[.85*n/dM,.65*n/dM,1*n/dM]}}function x8(e,t,r,n){let o=new Float64Array(4);ys(o,e,1),o[3]>0||(e.set([-1,-1,-1,1,1,1]),ys(o,e,1));let i=o[3],s=y8(i,t,r),[a,l,c]=s.offset,u=n??s.offset,d=te(a,l,c)/te(u[0],u[1],u[2]),f=[o[0],o[1],o[2]];return{centre:f,radius:i,near:s.near,far:s.far,position:[0,1,2].map(h=>f[h]+u[h]*d)}}async function b8(e,t){if(e.gone)return null;try{return await t()}catch(r){if(e.gone)return null;throw r}}async function E8(e,t){let r=await b8(e,e.ready);return r?(t.reopens.push({frame:t.frames.length,causes:e.closedBy(t.session)}),t.session=r,t.previous=null,!0):!1}async function fM(e,t,r,n,o){if(t.session.diagnostic!=="beauty")throw new Error("A path run draws the beauty view");for(let i=0;i<n;i++){if(await Sp(o),e.now()!==t.session)return await E8(e,t)&&fM(e,t,r,n,o);t.session.render(r[i%r.length])}return!0}function Ax(e,t){let{frames:r,reopens:n}=e,o=r.flatMap(i=>i.rafIntervalMs===null?[]:[i.rafIntervalMs]);return{frames:r,cpu:cf(r.map(i=>i.cpuFrameMs)),cadence:uf(o),reopens:n,outcome:t}}async function T8(e,t,r={}){if(!t.length||t.length>6e3)throw new Error("Path must contain 1..6000 poses");let n=r.warmup??4;if(!Number.isInteger(n)||n<0||n>600)throw new Error("Invalid warmup");let o=r.signal??new AbortController().signal,i=await b8(e,e.first);if(!i)return Ax({frames:[],reopens:[]},"world-disposed");let s={session:i,frames:[],reopens:[],previous:null};if(!await fM(e,s,t,n,o))return Ax(s,"world-disposed");for(let a=0;a<t.length;){let l=await Sp(o);if(e.now()!==s.session){if(!(await E8(e,s)&&await fM(e,s,t,n,o)))return Ax(s,"world-disposed");continue}let c={...s.session.render(t[a++])};c.rafIntervalMs=s.previous===null?null:l-s.previous,s.previous=l,s.frames.push(c)}return Ax(s,"complete")}var VTe={fromBounds(e,t={}){let{min:r,max:n}=e,o=Float64Array.of(r.x,r.y,r.z,n.x,n.y,n.z),i=x8(o,t.aspect??1,t.fov??rh,t.direction&&Lt(t.direction));return{position:i.position,target:i.centre,fov:t.fov}},pointOfInterest:(e,t)=>({...t,name:e}),async runPath(e,t,r={}){let n=Math.max(t.length,r.images??t.length),{camera:o}=e,i=a=>{let l=a*(t.length-1),c=Math.min(t.length-2,Math.floor(l)),u=t.length<2?0:l-c,d=t[Math.max(0,c)],f=t[Math.min(t.length-1,c+1)],h=(m,w)=>new I(...Lt(m)).lerp(new I(...Lt(w)),u).toArray();return{position:h(d.position,f.position),target:h(d.target,f.target),fov:d.fov??o.fov,near:o.near,far:o.far}},s=Array.from({length:n},(a,l)=>i(n===1?0:l/(n-1)));return YL(e,a=>T8(a,s))}};var GTe=[["CANVAS_NOT_FOUND","CANVAS_DOCUMENT_UNAVAILABLE","CANVAS_WINDOW_UNAVAILABLE","INVALID_CANVAS"],["INVALID_CANVAS_LAYOUT","INVALID_VIEWPORT","INVALID_PIXEL_RATIO"],["WEBGPU_UNAVAILABLE"],["RESOURCE_HTTP_ERROR","RESOURCE_BLOCKED_BY_POLICY","INVALID_JSON_RESPONSE"],["INVALID_POINTER","CACHE_NOT_READY","SCOPE_MISMATCH"],["INVALID_CACHE","UNSUPPORTED_FORMAT","STALE_CACHE","UNSUPPORTED_MODEL_FORMAT"],["INVALID_SCENE_TABLES","UNSUPPORTED_SCENE_TABLES","PREPARED_SCENE_MISMATCH"],["PAGE_BUDGET","PAGE_TASK_FAILED","PAGE_STREAM_FAILED"],["INVALID_SCENE_LIGHT","DUPLICATE_SCENE_LIGHT","UNKNOWN_SCENE_LIGHT","SCENE_LIGHTS_UNAVAILABLE"],["INVALID_SCENE_ENVIRONMENT"],["INVALID_SCENE_FOG_VOLUME","DUPLICATE_SCENE_FOG_VOLUME","UNKNOWN_SCENE_FOG_VOLUME"],["INVALID_SCENE_DECAL","DUPLICATE_SCENE_DECAL","UNKNOWN_SCENE_DECAL"],["INVALID_SCENE_DENSITY_VOLUME","DUPLICATE_SCENE_DENSITY_VOLUME","UNKNOWN_SCENE_DENSITY_VOLUME"],["INVALID_SCENE_FOG_SPHERE","DUPLICATE_SCENE_FOG_SPHERE","UNKNOWN_SCENE_FOG_SPHERE"],["INVALID_SCENE_PLANAR_REFLECTION","DUPLICATE_SCENE_PLANAR_REFLECTION","UNKNOWN_SCENE_PLANAR_REFLECTION"],["INVALID_SCENE_CUBE_CAPTURE","DUPLICATE_SCENE_CUBE_CAPTURE","UNKNOWN_SCENE_CUBE_CAPTURE"],["INVALID_MATERIAL","UNKNOWN_MATERIAL","MATERIAL_CLASS_CHANGE","MATERIAL_TEXTURE_SHARED"],["MATERIAL_CEILING"],["TEXTURE_BUDGET"],["UNKNOWN_IMAGE","INVALID_IMAGE"],["INVALID_TRANSFORM","NON_FINITE_TRANSFORM","SINGULAR_PARENT_TRANSFORM","TRANSFORM_CYCLE"],["UNKNOWN_SCENE_NODE","UNKNOWN_TRANSFORM_NODE","STALE_SCENE_NODE","INVALID_SCENE_NODE_ID","DUPLICATE_SCENE_NODE_ID","INVALID_SCENE_NODE_VISIBILITY"],["SCENE_ROOT_PARENT","SCENE_ROOT_DESTROY","SCENE_ROOT_MISMATCH","SCENE_COPY_OVERLAP"],["UNSUPPORTED_SCENE_UPDATE","BATCHED_WORLD_VIEW"],["RAYCAST_NO_VIEW","INVALID_RAYCAST_REACH","INVALID_RAYCAST"],["INVALID_TRANSFORM_HANDLES"],["INVALID_INSTANCES"],["MODEL_SURFACE","SURFACE_FORMAT","INVALID_OVERLAP"],["INVALID_CAPTURE"],["INVALID_TERRAIN","TERRAIN_GRAIN","INVALID_GRASS"],["VERTICES_NOT_LOADED"],["WEBGPU_LOST"],["HEADLESS_WORLD"],["WORLD_DISPOSED"],["SESSION_OPEN_FAILED"],["FAMILY_LOAD_FAILED"],["MEMORY_REFUSED"],["UNSUPPORTED_SCENE_FORMAT","SCENE_NOT_SAVABLE"],["PHYSICS_BUDGET","PHYSICS_NESTED","PHYSICS_FAILED","PHYSICS_DIVERGED"],["PHYSICS_FORMAT","PHYSICS_OFF"],["NO_VEHICLE","NO_AVATAR","INVALID_AVATAR"],["GUIDE_CEILING"],["REFERENCE_SHADOWS_REDUCED","REFERENCE_NOT_HELD","REFERENCE_SAMPLE_NOT_DRAWN","REFERENCE_CANVAS_RESIZED","REFERENCE_CAPTURE_BUSY","REFERENCE_TOO_LARGE","REFERENCE_PLANAR_MIRROR","INVALID_REFERENCE","CAPTURE_SIZE"],["INVALID_MODULE_OPTION","MODULE_MISSING","MODULE_OFF"],["INVALID_FIXED_TIME_STEP","SEQUENCES_NOT_FIXED"],["INVALID_SEQUENCE"],["PARTICLE_BURST"],["INVALID_VIEW"],["COLLISION_CHANNEL","COLLISION_RESPONSE","COLLISION_PROFILE","COLLISION_ENABLED","OVERLAP_MODE"],["PHYSICS_FILTERS"],["INTERNAL"],["CANCELLED","COMPILER_EXECUTABLE_MISSING","COMPILER_EXECUTABLE_NOT_EXECUTABLE","COMPILER_PLATFORM_UNSUPPORTED","COMPILER_EXIT","COMPILER_NO_POINTER","COMPILER_LINE_LIMIT","COMPILER_NOT_READY","COMPILER_MEMORY","INVALID_OPTIONS"]],HTe=new Set(GTe.flat()),A8=e=>HTe.has(e);function WTe(e){if(typeof e!="object"||e===null)return String(e);try{return JSON.stringify(e)??typeof e}catch{return`${e.constructor?.name??"Object"} (cannot be written out)`}}function Ih(e,t,r){let{name:n,code:o,details:i,message:s}=Object(e),a=A8(o)?o:void 0,l=e instanceof E||n==="EngineError"&&typeof o=="string";if(l&&a)return e instanceof E?e:new E(a,String(s),{...i,cause:e});let c=e instanceof Error?e.message:a??(typeof s=="string"?s:typeof o=="string"?o:WTe(e)),u=a??(!l&&A8(c)?c:t);return new E(u,`${r}: ${c}`,{cause:e})}function zTe(e,t){return e==="editor"?"the editor hosting the world switched it off for its project: it is switched on in the editor, which no word of the page holds over":e==="quality"?`the quality preset switches it off: the page's word holds over it (${t})`:e==="scene"?`the scene switches it off: the page's word holds over it (${t})`:`turn it on first (${t})`}function Jo(e,t,r,n){let o=n?`the ${t} module's part ${n}`:`the ${t} module`,i=n?`{ ${n}: true }`:"true";return new E("MODULE_OFF",`${e} asks ${o}: ${zTe(r,`world.modules.set('${t}', ${i})`)}.`,n?{module:t,part:n}:{module:t})}var O8=(e,t)=>new E("MODULE_OFF",`${e} asks the ${t} module of a world disposed: its modules are off for good, no word switches them on again.`,{module:t});var L8=new WeakSet,R8=e=>void L8.add(e);function en(e,t,r,n=!1,o){if(n||!r)return;if(L8.has(r))throw O8(e,t);let i=r.state(t);if(!i.enabled)throw Jo(e,t,i.by);if(o!==void 0&&i.parts[o]===!1)throw Jo(e,t,i.by,o)}async function Cr(e,t){t();let r=await e.load();return t(),r}var _8="A ragdoll's fit",v8=e=>HG(fn(e)),kh=e=>en(_8,"compiler",v8(e)?.modules);function pM(e,t){let r=new AbortController;return{start(){r=new AbortController},stop(){t()||r.abort({by:e().by})},signal:()=>r.signal}}async function jTe(e){let t=()=>kh(e),{fitRagdollInPage:r}=await Cr(M.browserCompiler,t),n=v8(e),o=n&&zG(n)?.modules.compiler.signal();return{async fitRagdollInPage(i,s,a){if(!o)return r(i,s,a);let l=new AbortController,c=[ro(l,s.signal),ro(l,o)],u=new Promise((d,f)=>{let h=()=>{l.signal.reason===o.reason&&f(Jo(_8,"compiler",o.reason.by))};l.signal.aborted?h():(l.signal.addEventListener("abort",h,{once:!0}),c.push(()=>l.signal.removeEventListener("abort",h)))});try{let d=r(i,{...s,signal:l.signal},a);return await Promise.race([d,u])}finally{for(let d of c)d()}}}}var $Te={make:async(e,t,r)=>(await M.ragdoll.load()).makeRagdoll(e,t,r),check:async(e,t)=>(await M.ragdoll.load()).checkRagdoll(e,t),refit:async(e,t)=>(await Cr(M.ragdoll,()=>kh(e))).refitRagdoll(e,t),fitPart:async(e,t,r)=>(await Cr(M.ragdoll,()=>kh(e))).fitRagdollPart(e,t,r),catalogue:()=>M.ragdollCatalogue.load()};var M8=(e,t,r=!1)=>()=>en(t,"terrain",e.modules,!1,r?"grass":void 0),YTe={async create(e,t){return(await Cr(M.terrain,M8(e,"A terrain"))).createTerrain(e,t)},async grass(e,t,r){let n=M8(e,"Terrain grass",!0);return(await Cr(M.terrainGrass,n)).createGrass(e,t,r)}};var KTe=3072;async function qTe(e,t){return(await M.browserCompiler.load()).prepareInPage(e,t)}async function XTe(e,t={}){return(await M.browserCompiler.load()).listNodesInPage(e,t)}function Ox(e,t){return tN(e,0,t,8,!0),e}var hM=[],D8=new WeakSet;function Hu(e){return P8(e),e}function Ext(){for(let e of hM)e()}var QTe=e=>typeof e=="object"&&e!==null||typeof e=="function",ZTe=e=>typeof e=="object"&&e!==null&&!Object.isFrozen(e)&&(Array.isArray(e)||Object.getPrototypeOf(e)===Object.prototype);function P8(e){if(D8.has(e))return;if(D8.add(e),e instanceof Map||e instanceof Set){hM.push(()=>e.clear());return}let t=Array.isArray(e)?e:Object.values(e);hM.push(JTe(e));for(let r of t)ZTe(r)&&P8(r)}function JTe(e){if(Array.isArray(e)){let n=e.slice();return()=>{e.length=n.length;for(let o=0;o<n.length;o++)e[o]=n[o]}}let t=e,r={...t};return()=>{for(let n in t)!(n in r)&&QTe(t[n])&&(t[n]=void 0);Object.assign(t,r)}}function C8(){return{viewRelative:new Float64Array(16),viewProjectionRelative:new Float64Array(16),planesRelative:new Float64Array(Io)}}function I8(e,t,r){return yL(e.viewRelative,t),AA(e.viewProjectionRelative,e.planesRelative,r,e.viewRelative),e}function k8(e,t){return e.viewRelative.set(t.viewRelative),e.viewProjectionRelative.set(t.viewProjectionRelative),e.planesRelative.set(t.planesRelative),e}var eAe={fov:50,aspect:1,near:.1,far:2e3,zoom:1};function F8(){return{...EA(),...C8(),world:new Float64Array(16),projection:new Float64Array(16),eye:new Float64Array(3),viewTarget:new Float64Array(3),near:0,far:0,fov:0,aspect:1,perspective:1,viewPoint:new Float64Array(4),viewSet:yu}}function Lx(e,t){let{aspect:r,far:n,zoom:o,orthographic:i}=t,s=i?t.near:SA(t.near),a=wA(t.fov);return e.near=s,e.far=n,e.fov=a,e.aspect=r,r1(e.projection,a,r,s,n,o,i),TA(e,e.projection,e.world),I8(e,e.view,e.projection),e.eye[0]=e.world[12],e.eye[1]=e.world[13],e.eye[2]=e.world[14],tAe(e,i?0:1),e}function tAe(e,t){let r=e.world,n=te(r[8],r[9],r[10])||1,o=(1-t)/n;e.perspective=t;for(let i=0;i<3;i++)e.viewPoint[i]=e.eye[i]*t+r[8+i]*o;e.viewPoint[3]=t}var Fh;function rAe(){return Fh||(Fh=F8(),Fh.world.set(Or),Lx(Fh,eAe)),Fh}function nAe(e,t){return e.world.set(t.world),e.projection.set(t.projection),e.view.set(t.view),e.viewProjection.set(t.viewProjection),e.planes.set(t.planes),k8(e,t),e.eye.set(t.eye),e.viewTarget.set(t.viewTarget),e.near=t.near,e.far=t.far,e.fov=t.fov,e.aspect=t.aspect,e.perspective=t.perspective,e.viewPoint.set(t.viewPoint),e}function ti(e){return e.updateWorldMatrix(!0,!1),e}var ei=Hu({fov:0,aspect:1,near:0,far:0,zoom:1,orthographic:null}),mM=new Float64Array(3),oAe=new Float64Array(4),gM={near:0,far:0},_l={forwardUp:0,width:0,aspect:1,targetDistance:0,viewportWidth:0,viewportHeight:0},Nh={halfFloatDepth:!0,scaleUnits:!0,depthScale:-1,shift:0},SM={nearPlane:0,heightAsViewTarget:!1};function iAe(e,t,r,n,o){let i=ps(t.orthographic,r,t.zoom,oAe)[2];if(Ox(mM,e.world),an(Nn,n,"cutViewOrthoAutoPlanes")){let{x:s,y:a,z:l}=t.viewTarget;for(let c=0;c<3;c++)e.viewTarget[c]=Fd(e.world,c,s,a,l);_l.forwardUp=mM[1],_l.width=2*i*100,_l.aspect=r,_l.targetDistance=te(e.viewTarget[0],e.viewTarget[1],e.viewTarget[2])*100,_l.viewportWidth=o?.[0]??0,_l.viewportHeight=o?.[1]??0,Nh.halfFloatDepth=an(Nn,n,"cutViewOrthoAutoPlanesHalfFloat"),Nh.scaleUnits=an(Nn,n,"cutViewOrthoAutoPlanesScaleUnits"),Nh.depthScale=an(Nn,n,"cutViewOrthoAutoPlanesDepthScale")*100,Nh.shift=an(Nn,n,"cutViewOrthoAutoPlanesShift")*100,t2(gM,_l,Nh),ei.near=gM.near/100,ei.far=gM.far/100}an(Nn,n,"cutViewOrthoNearPlaneCorrection")&&(SM.nearPlane=an(Nn,n,"cutViewOrthoNearPlane"),SM.heightAsViewTarget=an(Nn,n,"cutViewOrthoCameraHeightAsViewTarget"),r2(e.world,mM,e.viewTarget,ei,i,SM))}function sAe(e,t,r=t.aspect,n,o){return ti(t),Ce(e.world,t.matrixWorld.elements),ei.fov=t.fov,ei.aspect=r,ei.near=t.near,ei.far=t.far,ei.zoom=t.zoom,ei.orthographic=t.orthographic,e.viewSet=t._viewSet??yu,e.viewTarget.fill(0),n&&t.orthographic&&iAe(e,t,r,n,o),Lx(e,ei)}var aAe=new Float64Array(3),Bh=new Float64Array(4),lAe=new Float64Array(3);function cAe(e){return Rr(e.world,aAe,Bh,lAe),{position:[e.eye[0],e.eye[1],e.eye[2]],quaternion:[Bh[0],Bh[1],Bh[2],Bh[3]]}}var N8=new Float64Array(16),wM=new Float64Array(16),uAe=[0,0,0];function B8(e,t,r){let n=e.geometry.attributes.position,o=new Float64Array(t.length*3);for(let i=0;i<t.length;i++){let[s,a,l]=Mr(n,t[i],uAe);Do(o,r,s,a,l,i*3)}return o}function dAe(e,t){return B8(e,Os(e.geometry,"triangles"),t)}function fAe(e,t,r,n){let o=e.primitive==="triangles";if(e.primitive==="sprite"||o&&!n||!e.geometry.attributes.position?.count)return;if(o){let d=dAe(e,wM),f=Qr(e.material),h=f.transparent?f.opacity:1;return{ends:d,color:f.color.getHex(),width:0,vertices:d.length/3,faces:!0,opacity:h,node:e}}let s=Os(e.geometry,e.primitive),a=e.primitive==="points",l=a?Array.from({length:s.length*2},(d,f)=>s[f>>1]):s,c=B8(e,l,wM),u=Qr(e.material).color.getHex();return{ends:c,color:u,width:a?r:t,vertices:l.length,node:e}}function U8(e,t,r,n=!1){mr(N8,e.matrixWorld.elements);let o=[],i=s=>{let a=s;if(!a.isMesh)return;Ve(wM,N8,a.matrixWorld.elements);let l=fAe(a,t,r,n);l&&o.push(l)};i(e);for(let s of e.children)s.traverseVisible(i);return o}function yM(e,t){return ua(e.matrix,t)?!1:(Ce(e.matrix,t),!0)}function xM(e){let{node:t}=e;if(!t)return!1;try{ti(t)}catch(r){if(!(r instanceof E)||r.code!=="STALE_SCENE_NODE")throw r;return e.node=void 0,!1}return yM(e,t.matrixWorld.elements)}var bM=e=>new pe(e??16777215).getHex();function V8(e,t){if(e.length!==t.length)throw new TypeError(`guide colors: ${e.length} numbers for ${t.length/3} vertices, three a vertex expected`);return Float32Array.from(e)}function EM({dots:e,width:t},r,n,o){let i=Float64Array.from(r).subarray(0,r.length-r.length%(e?3:6)),s={ends:i,color:n,width:t,vertices:2*i.length/(e?3:6),dots:e};return o&&(s.colors=V8(o,i)),s}function G8(e,t,r,n){let o=e,i=(s,a)=>(n({...s,colors:a,words:void 0}),o);return Object.assign(o,{setPositions(s){let{color:a,colors:l}=t(),c=EM(r,s,a);return i(c,l?.length===c.ends.length?l:void 0)},setColors:s=>i(t(),s?V8(s,t().ends):void 0),setColor:s=>i({...t(),color:bM(s)})})}function TM(){let e=new Set,t=0,r=()=>{for(let n of e)n.deref()||e.delete(n);t=e.size};return{add(n){let o=new WeakRef(n);return e.add(o),e.size>2*t&&r(),o},delete:n=>void e.delete(n),each(n){for(let o of e){let i=o.deref();i?n(i):e.delete(o)}t=e.size}}}var Uh=14913080;function H8(e,t){if(e+t>Uh)throw new E("GUIDE_CEILING",`Guides would hold ${e+t} vertices, above the ceiling of ${Uh}`,{held:e,asked:t,ceiling:Uh})}var AM=new WeakMap,Rx=new WeakMap,pbt=e=>AM.get(e),hbt=e=>Rx.get(e)?.entries,_x=e=>!!Rx.get(e)?.shown(),Vh=e=>Rx.get(e)?.gate;function pAe(e){let t=AM.get(e);return t&&(t.engine=!0),e}function W8(e,t,r){let n={get visible(){return e.visible},setVisible(o){return e.visible===o||!t.has(e)||(e.visible=o,r.turned(e)),n},setTransform(o){e.node=void 0;let i="elements"in o?o.elements:o;return yM(e,i)&&t.has(e)&&r.changed(e),n},remove(){t.delete(e)&&(r.left(e),r.changed(e))}};return e.handle=n,AM.set(n,e),n}var z8=e=>({entries:new Set,stamp:0,shaped:0,patched:new Set,drawn:0,counted:0,camera:e});function j8(e){if(!e)return 0;if(e.counted!==e.shaped){e.counted=e.shaped,e.drawn=0;for(let t of e.entries)if(t.visible)for(let r of t.pieces)e.drawn+=r.ends.length/(r.faces||r.dots?3:6)}return e.drawn}var $8=e=>[z8(e),z8(e)];function hAe(e,t,r,n){return{pieces:e,vertices:e.reduce((o,i)=>o+i.vertices,0),matrix:Float64Array.from(Or),visible:!0,foreground:t,node:n,group:r,handle:void 0,engine:!1}}function mAe(){let e=$8(),t=new WeakMap,r=TM(),n=(o,i=!1)=>{if(!o)return e;let s=t.get(o);return!s&&i&&(t.set(o,s=$8(o)),r.add(s)),s};return{of:n,drop(){for(let o of e)o.packing=void 0;r.each(o=>{for(let i of o)i.packing=void 0})},revisionFor(o){let i=n(o),s=Math.max(e[0].stamp,e[1].stamp);return i&&i!==e?Math.max(s,i[0].stamp,i[1].stamp):s},pack(o=!1,i){return M.guides.get().packGroup(n(i)?.[Number(o)])},drawn:(o,i)=>j8(e[Number(o)])+(i?j8(n(i)?.[Number(o)]):0)}}function gAe(e){let t={vertices:0,shown:0,revision:0},r=i=>void(i.group.stamp=i.group.shaped=++t.revision),n=i=>{r(i),e()};return{count:t,stamp:r,changed:n,on:{changed:n,turned(i){t.shown+=i.visible?1:-1,n(i)},left(i){t.vertices-=i.vertices,i.visible&&t.shown--,i.group.entries.delete(i)}}}}function SAe(e,t){let r=new Set,{count:n,stamp:o,changed:i,on:s}=gAe(t);return{entries:r,vertices:()=>n.vertices,shown:()=>n.shown,revision:()=>n.revision,turn:()=>++n.revision,stamp:o,on:s,admit:(c,u,d)=>{let f=u.foreground===!0,h=e.of(u.camera,!0)[Number(f)],m=hAe(c,f,h,d);return H8(n.vertices,m.vertices),r.add(m),h.entries.add(m),n.vertices+=m.vertices,n.shown++,xM(m),i(m),m},rewrite:(c,u)=>{if(!r.has(c))return;H8(n.vertices-c.vertices,u.vertices);let d=u.vertices===c.vertices;if(n.vertices+=u.vertices-c.vertices,c.vertices=u.vertices,c.pieces[0]=u,!!c.visible){if(!d)return i(c);c.group.patched.add(c),c.group.stamp=++n.revision,t()}}}}function wAe(e){let t=mAe(),{entries:r,vertices:n,shown:o,revision:i,turn:s,stamp:a,on:l,admit:c,rewrite:u}=SAe(t,e);return{entries:r,vertices:n,shown:o,revision:i,turn:s,drop:t.drop,revisionFor:t.revisionFor,open(d,f,h){return W8(c(d,f,h),r,l)},openShape(d,f,h){let m=EM(d,h,bM(f.color),f.colors),w=c([m],f),x=W8(w,r,l);return G8(x,()=>w.pieces[0],d,b=>u(w,b))},follow(){for(let d of r)d.visible&&xM(d)&&a(d)},pack:t.pack,drawn:t.drawn}}function yAe(e,t){let r=!0,n=!0,o=0,i=TM(),s=new Set,a=c=>{n=c,i.each(u=>{c?u.start():u.stop()&&s.add(u)}),c&&s.clear()};return{gate:{get drawn(){return r},get transform(){return n},controls:i,kept:s,switch(c,u){if(n&&!u&&a(!1),r!==c){r=c,r||e.drop();let d=e.entries.size>0;o=d?e.turn():e.revision(),d&&t()}!n&&u&&a(!0)}},revisionFor:c=>r?Math.max(e.revisionFor(c),o):o}}function OM(e=()=>{}){let t=wAe(()=>void(r.drawn&&e())),{gate:r,revisionFor:n}=yAe(t,e),{open:o,openShape:i}=t,s=W({ceiling:Uh,get vertexCount(){return t.vertices()},get revision(){return t.revision()},follow:()=>void(r.drawn&&t.follow()),lines:a=>i({dots:!1,width:a.width??1},a,a.positions),points:a=>i({dots:!0,width:a.size??4},a,a.positions),add(a,l={}){a.updateWorldMatrix(!0,!0);let{width:c=1,size:u=4,faces:d=!1}=l,f=U8(a,c,u,d);return o(f,l,Bj(a))},clear(){for(let a of t.entries)a.engine||a.handle.remove()},revisionFor:n,visibleInstances:a=>r.drawn?t.drawn(!1,a)+t.drawn(!0,a):0,pack:t.pack});return Rx.set(s,{entries:t.entries,shown:()=>r.drawn?t.shown():0,gate:r}),s}var xAe=.04,Y8=.2,bAe=.25,EAe=5,vx=(e,t,r)=>new E("INVALID_TRANSFORM_HANDLES",`The handles' ${e} is ${r}`,{[e]:t});function $i(e,t,r=1/0){if(t===void 0)return 1;if(t>0&&t<r&&Number.isFinite(t))return t;let n=r<1/0?` and below ${Number(r.toPrecision(6))}`:"";throw vx(e,t,`a share above 0${n}`)}function K8(e,t){if(t===void 0)return 1;if(t>0&&t<=1)return t;throw vx(e,t,"above 0, 1 at most")}function Gh(e,t){if(t===void 0||typeof t=="boolean")return t===!0;throw vx(e,t,"true or false")}function q8(e){let t=K8("planeOpacity",e.planeOpacity),r=K8("centerOpacity",e.centerOpacity),n=xAe*$i("thickness",e.thickness),o=Y8*$i("tipScale",e.tipScale,1/Y8),i=o*$i("cubeScale",e.cubeScale,1/o),s=bAe*$i("squareScale",e.squareScale),a=e.stemWidth===void 0?void 0:$i("stemWidth",e.stemWidth),l=$i("tipWidth",e.tipWidth),c={bothSides:Gh("bothSides",e.bothSides),scalePlanes:Gh("scalePlanes",e.scalePlanes),screenRings:Gh("screenRings",e.screenRings),halfRings:Gh("halfRings",e.halfRings),centerMove:Gh("centerMove",e.centerMove)},u=e.pickTolerance;if(u!==void 0&&!(u>=0&&Number.isFinite(u)))throw vx("pickTolerance",u,"0 pixels or more");return{planeOpacity:t,centreOpacity:r,radius:n,tip:o,cube:i,side:s,stemWidth:a,tipWidth:l,...c,pickTolerance:u??EAe}}function TAe(){let e={change:fe(),dragStart:fe(),dragEnd:fe()};return{emit:t=>e[t].emit(),tell:(t,r)=>e[t].tell(r),addEventListener:(t,r)=>void e[t].subscribe(r),removeEventListener:(t,r)=>void e[t].unsubscribe(r),clear(){for(let t of Object.values(e))t.clear()}}}function AAe(e){let{state:t,root:r}=e,n=Vh(e.host.guides),o,i=!1,s=!1,a=()=>!s&&n?.transform!==!1,l=h=>{!o&&a()&&(o=h.startTransformControl(e))},c=()=>{if(o||i||!a())return;let h=M.transformControls.get();if(h)return l(h);i=!0;let m=()=>void(i=!1);M.transformControls.load().then(w=>(m(),l(w)),m)},u={attach:h=>void(t.object=h),detach:()=>void(t.object=null),setMode:h=>void(t.mode=h),setSpace:h=>void(t.space=h),setSize:h=>void(t.size=h)},d={start:c,actions:()=>(c(),o?.actions??u),dragging:()=>o?.dragging()??!1,dispose(){o?.dispose(),s=!0,f&&n?.controls.delete(f),n?.kept.delete(d)},stop(){let h=o;return o=void 0,h?.dispose(),r.clear(),h!==void 0||i}},f=n?.controls.add(d);return d}function X8(e,t={}){let r=q8(t),n={object:null,mode:t.mode??"translate",space:t.space??"world",size:t.size===void 0?1/4:$i("size",t.size)},o=TAe(),i=new or,s={snap:{...t.snap},handles:i,get object(){return n.object},get dragging(){return c.dragging()},get mode(){return n.mode},get space(){return n.space},get size(){return n.size},attach:u=>(c.actions().attach(u),s),detach:()=>(c.actions().detach(),s),setMode:u=>(c.actions().setMode(u),s),setSpace:u=>(c.actions().setSpace(u),s),setSize:u=>(c.actions().setSize($i("size",u)),s),addEventListener:o.addEventListener,removeEventListener:o.removeEventListener,dispose(){s.detach(),c.dispose(),o.clear()}},{emit:a,tell:l}=o,c=AAe({host:e,options:t,look:r,root:i,state:n,emit:a,tell:l,controls:s});return c.start(),s}var OAe={transform:X8};var Q8=10;function Rbt(e,t,r,n){if(n<=0)return 0;let o=1/r,i=-(e/n)/o;return t*Math.max((Math.exp(i)+Math.exp(i/3))/(o*n)/(4*Q),0)}function _bt(e,t,r,n){return n<=0?0:.25*t*(Math.exp(-r*e/n)+3*Math.exp(-r*e/(3*n)))}var Z8=e=>3.5+100*(e-.33)**4,J8=e=>1.85-e+7*Math.abs(e-.8)**3,eY=.6,tY=(e,t)=>t*J8(e)/Z8(e)*eY,vbt=(e,t)=>t*Z8(e)/(J8(e)*eY);function rY(e){let t=e,r=t*t,n=r*r;return[.906*t+4e-5,10.39*n*t-15.18*n+8.332*r*t-2.039*r+.7279*t-.0014]}var kbt=.1,nY={scatterRadius:1.2,subsurfaceColor:[.48,.41,.28],falloffColor:[1,.37,.3],boundaryColorBleed:[1,1,1],extinctionScale:1,scatteringDistribution:.93,normalScale:.08,ior:1.55,roughness0:.75,roughness1:1.3,lobeMix:.85,burley:!1,surfaceAlbedo:[.91058,.338275,.2718],meanFreePathColor:[1,.1983/2.229,.1607/2.229],meanFreePathDistance:1.2*2.229,worldUnitScale:.1,transmissionTintColor:[1,1,1],tint:[1,1,1],implementation:"importanceSampling",meanFreePath:!1,distanceScale:1},LAe=e=>Array.isArray(e)&&e.length===3&&e.every(t=>Number.isFinite(t));function LM(e){let t={};for(let[r,n]of Object.entries(nY)){let o=e[r],i=Array.isArray(n)?LAe(o):typeof n=="number"?Number.isFinite(o):typeof n=="boolean"?typeof o=="boolean":o==="importanceSampling"||o==="separable";t[r]=i?Array.isArray(o)?[...o]:o:structuredClone(n)}return t}function RAe(e){let t=structuredClone(e);if(!t.burley){let r=[],n=[];for(let i of t.falloffColor){let[s,a]=rY(i);r.push(s),n.push(a)}t.surfaceAlbedo=r,t.meanFreePathColor=n;let o=It(n);o>1&&(t.meanFreePathColor=n.map(i=>i/o),t.meanFreePathDistance=k(t.scatterRadius*o,.1,50)),t.meanFreePathDistance/=2.229*2.229,t.tint=[...t.subsurfaceColor],t.burley=!0}if(!t.meanFreePath){let r=t.meanFreePathColor.map(i=>i*t.meanFreePathDistance),n=r.map((i,s)=>tY(t.surfaceAlbedo[s],i)),o=It(n);t.meanFreePathDistance=o,t.meanFreePathColor=n.map(i=>i/o),o<.1&&(t.meanFreePathColor=t.meanFreePathColor.map(i=>i*(o/.1)),t.meanFreePathDistance=.1),t.meanFreePath=!0,t.worldUnitScale/=z6/Q8}return t}function Fbt(){let e=RAe(nY);return e.extinctionScale*=3.1,e.distanceScale*=10,e.transmissionTintColor=e.transmissionTintColor.map((t,r)=>t*e.surfaceAlbedo[r]),e}function Mx(e,t,r,n,{admit:o,freed:i}={}){let s=[],a=new Map,l=new Map,c=[],u={rows:s,revision:0,take(d){let f=n(d),h=a.get(f);if(h)return++h.count,h.row;if(a.size>=t)throw new RangeError(`at most ${t} ${e} profiles`);o?.(d);let m=c.pop()??s.length+1;s[m-1]=d;let w={profile:d,row:m,key:f,count:1};return a.set(f,w),l.set(m,w),u.revision++,m},release(d){let f=l.get(d);if(!(!f||--f.count>0)){for(a.delete(f.key),l.delete(d),i?.(f.profile),s[d-1]=r,c.push(d);s.length>0&&!l.has(s.length);)c.splice(c.indexOf(s.length),1),s.pop();u.revision++}}};return u}function Dx(e){let t=new WeakMap,r=new FinalizationRegistry(n=>e(n.held));return{holds:n=>t.has(n),hold(n,o){let i=t.get(n);if(i){e(i.cell.held),i.cell.held=o;return}let s={held:o},a=()=>{t.delete(n)&&(r.unregister(n),e(s.held))};t.set(n,{cell:s,hook:a}),r.register(n,s,n),n.released.add(a)}}}var _Ae=255,vAe=LM({}),Hh=Mx("subsurface",_Ae,vAe,e=>JSON.stringify(e)),oY=Dx(e=>Hh.release(e));function sY(e,t){if(!t&&!oY.holds(e))return 0;let r=t?Hh.take(LM(t)):0;return oY.hold(e,r),r}var iY={profiles:Hh.rows,revision:Hh.revision};function Gbt(){return iY.revision=Hh.revision,iY}var MAe=A1-1,Px=0,RM=0,aY=e=>{let t={diffuseOffset:e.diffuseRampOffsetTexture,specularOffset:e.specularRampOffsetTexture,hatching:e.shadowHatchingPatternTexture};return t.diffuseOffset||t.specularOffset||t.hatching?t:void 0},Yi=Mx("toon",MAe,void 0,e=>JSON.stringify(e,(t,r)=>no(r)?r.id:r),{admit(e){if(aY(e)){if(RM===O1)throw new RangeError(`at most ${O1} toon profiles wear images`);RM++}},freed(e){aY(e)&&RM--}}),DAe=e=>e?Yi.take(E1(e)):0;var lY=Dx(({row:e,toon:t})=>{Yi.release(e),t&&--Px===0&&Yi.revision++});function uY(e,t,r){if(!r&&!lY.holds(e))return 0;let n=r?DAe(t):0;return r&&Px++===0&&Yi.revision++,lY.hold(e,{row:n,toon:r}),n}var _M=new Float32Array(A1),cY=-1,PAe=T1(E1({}));function Ybt(){if(Px!==0)return cY!==Yi.revision&&(_M.fill(PAe),Yi.rows.forEach((e,t)=>{e&&(_M[t+1]=T1(e))}),cY=Yi.revision),_M}var Kbt=()=>({profiles:Yi.rows,revision:Yi.revision,users:Px});var CAe=Object.freeze({toString(){throw new Error(`WGSL '${this.name}' spliced as text: list it as a dependency`)}}),Cx=(e,t,r,n,o)=>Object.freeze(Object.assign(Object.create(CAe),{name:t,kind:e,deps:Object.freeze([...r]),text:n,...o&&{weak:o}})),ar=(e,t,r,n={})=>Cx("fn",e,t,r,n.weak),Xbt=(e,t,r)=>Cx("const",e,t,r),Qbt=(e,t,r)=>Cx("struct",e,t,r),Zbt=(e,t,r,n={})=>Cx("block",e,t,r,n.weak),Jbt=e=>{let t=e(!1),r=e(!0);return n=>n?r:t};var wo={standard:0,diffuse:1,normal:3,matcap:4,depth:5,shadow:6},fY=17,vM={physical:2,diffuse:4,shadow:6},nEt=3,oEt=1,IAe=7,iEt=ar("modelFlag",[],`fn modelFlag(flags:u32)->u32{
|
|
3
|
+
let model=(flags>>${fY}u)&7u;
|
|
4
|
+
if(model==${wo.diffuse}u){return ${vM.diffuse}u;}
|
|
5
|
+
if(model==${wo.shadow}u){return ${vM.shadow}u;}
|
|
6
|
+
return ${vM.physical}u;
|
|
7
|
+
}`),ri={lane:{shift:0,bits:5},dither:{shift:5,bits:1},translucentShadow:{shift:6,bits:3},litFrom:{shift:9,bits:2},normalCurvature:{shift:11,bits:1},subsurfaceOpacity:{shift:12,bits:8},subsurfaceProfile:{shift:20,bits:8},shadingModel:{shift:29,bits:3},masked:{shift:28,bits:1}},dY=0;for(let{shift:e,bits:t}of Object.values(ri)){let r=(1<<t)-1<<e;if(dY&r)throw new Error("SURFACE_MODEL: two fields of the model word overlap");dY|=r}var sEt=1<<ri.masked.shift,MM=8,pY=16,kAe=MM<<fY,aEt=e=>`(${e}&${kAe}u)!=0u`,lEt=e=>`(${e}&${MM}u)!=0u`,cEt=e=>`(${e}&${pY}u)!=0u`,uEt=1<<ri.dither.shift,FAe=IAe|MM|pY;if(FAe!==(1<<ri.lane.bits)-1)throw new Error("SURFACE_MODEL: the lane bits are not the lane field");var dEt=ri.translucentShadow.shift,fEt=22,pEt={local:1,localTrace:2,directionalTrace:4},hEt=ri.litFrom.shift,mEt=16,gEt=29,NAe=1<<ri.normalCurvature.shift,BAe=2147483648,UAe=e=>`((${e}&${NAe}u)!=0u)`,SEt=ar("normalCurvatureFlag",[],`fn normalCurvatureFlag(model:u32)->u32{return select(0u,${BAe}u,${UAe("model")});}`),VAe=ri.subsurfaceOpacity.shift,wEt=e=>Math.round(k(e,0,1)*255),yEt=ar("subsurfaceOpacityOfModel",[],`fn subsurfaceOpacityOfModel(model:u32)->f32{return f32((model>>${VAe}u)&255u)/255.0;}`),GAe=ri.subsurfaceProfile.shift,xEt=ar("subsurfaceProfileOfModel",[],`fn subsurfaceProfileOfModel(model:u32)->f32{return f32((model>>${GAe}u)&255u);}`),bEt=ri.shadingModel.shift;function hY(e){return e==="lambert"?wo.diffuse:e==="normal"?wo.normal:e==="matcap"?wo.matcap:e==="depth"?wo.depth:e==="shadow"?wo.shadow:wo.standard}var mY=e=>Math.sqrt(Math.sqrt(2/(Math.max(0,e)+2)));var DM=8,gY=(1<<DM)-1,HAe=ar("visPageIndex",[],`fn visPageIndex(id:u32)->u32{return (id>>${DM}u)-1u;}`),LEt=ar("visRowIn",[HAe],"fn visRowIn(id:u32,rows:u32)->bool{return visPageIndex(id)<rows;}"),REt=ar("visTriangle",[],`fn visTriangle(id:u32)->u32{return id&${gY}u;}`),PM=gY+1,SY=2**(32-DM)-1;var wY=[["world","mat4x4f"],["flags","u32"],["pageOffset","u32"],["indexCount","u32"],["vertexBase","u32"],["packedBase","u32"],["clusterHash","u32"],["selectionIndex","u32"],["diagnosticWord","u32"],["depthBias","u32"],["placement","u32"],["materialClass","u32"],["deform","u32"],["deformCount","u32"],["deformOutput","u32"],["material","u32"],["wpo","u32"],["wpoCentre","vec3f"],["wpoDisableSq","f32"],["wpoMost","f32"],["marks","u32"]],WAe=[["random","f32"],["fade","u32"]],CM=rp("PageInfo",[...wY,...WAe]),MEt=rp("PageInfo",wY),DEt=e=>e.level??(e.role==="coarse"?1:0);var FEt=SY,zAe=e=>!Number.isInteger(e)||e<0||e>PM;function NEt(e,t){if(zAe(e))throw new Error(`VISIBILITY_PAGE_TRIANGLES: ${e} triangles exceed the ${PM} a visibility identifier addresses${t?` (${t})`:""}`);return e}var BEt=CM.words,UEt=CM.words*4,VEt=2147483648,GEt=2147483647,HEt=1,WEt=2,zEt=4,jEt=1073741823,$Et=1073741824,xY=1,YEt=2,KEt=4,qEt=8,XEt=16,QEt=32,ZEt=64,JEt=128,eTt=256,tTt=512,rTt=1024,nTt=2048,oTt=4096,iTt=8192,sTt=16384,aTt=32768,lTt=2147483648,cTt=1073741824,uTt=1073741824,dTt=25,fTt=15,pTt=1<<20,hTt=1<<21,mTt=1<<22,gTt=1<<27,STt=1<<23,wTt=1<<28,yTt=1<<24,xTt=1<<29,bTt=65536,ETt=25,jAe=2,IM=(1<<jAe)-1,yY=1,$Ae=2,YAe={off:0,medium:yY,full:yY|$Ae},TTt=(e="off")=>YAe[e],ATt=ar("responsiveMark",[],`fn responsiveMark(code:u32)->f32{return f32(code&${IM}u)/${IM}.0;}`),OTt=ar("markedResponsive",[],`fn markedResponsive(mark:f32)->u32{return u32(round(mark*${IM}.0));}`);var bY=25,EY=15,KAe=12,lr={subsurface:Vn.subsurface,skin:Vn.preintegratedSkin,profile:Vn.subsurfaceProfile,hair:Vn.hair,eye:Vn.eye,toon:KAe},DTt=e=>`(${e}==${lr.profile}||${e}==${lr.eye})`,qAe=ar("isPixelModel",[],`fn isPixelModel(model:u32)->bool{return ${Object.values(lr).map(e=>`model==${e}u`).join("||")};}`),PTt=ar("pixelModelOf",[],`fn pixelModelOf(flags:u32)->u32{return (flags>>${bY}u)&${EY}u;}`),XAe=ar("pixelModelFlag",[],`fn pixelModelFlag(model:u32)->u32{return (model&${EY}u)<<${bY}u;}`),CTt=ar("shadingFlagsOfNumber",[qAe,XAe],`fn shadingFlagsOfNumber(flags:u32,number:u32)->u32{
|
|
8
|
+
if(number==${Vn.unlit}u){return flags&~${xY}u;}
|
|
9
|
+
if(isPixelModel(number)){return flags|pixelModelFlag(number);}
|
|
10
|
+
return flags;
|
|
11
|
+
}`),ITt=e=>e.modelFromGraph!==!1&&!!e.graph?.outputs.shadingModel||e.shadingModel!==void 0&&e.shadingModel!==Vn.unlit,kTt=e=>e!==lr.hair&&e!==Vn.unlit,QAe=new Map([["subsurface",lr.subsurface],["preintegratedSkin",lr.skin],["subsurfaceProfile",lr.profile],["eye",lr.eye],["hair",lr.hair],["toon",lr.toon],["unlit",Vn.unlit]]),TY=e=>QAe.get(e),vl={eyeNormal:1,coatLayerNormal:2,subsurfaceScattering:4,subsurfaceCheckerboard:8,roughDiffuse:16,accurate:32,toonUnified:64,toonQuantize:128},ZAe=e=>(Ko(e,"eyeNormal")?vl.eyeNormal:0)|(Ko(e,"coatLayerNormal")?vl.coatLayerNormal:0)|(Ko(e,"shadingRoughDiffuse")?vl.roughDiffuse:0)|(Ko(e,"shadingAccurate")?vl.accurate:0)|(Ko(e,"toonSingleDiffuse")?vl.toonUnified:0)|(Ko(e,"toonReflectionQuantization")?vl.toonQuantize:0),FTt=(e,t)=>(e&vl[t])!==0?1:0,Wh={curve:0,switches:3,length:4};function NTt(e,t){G6(Ko(e,"normalCurvatureScale"),Ko(e,"normalCurvatureBias"),Ko(e,"normalCurvatureExponent"),t,Wh.curve),t[Wh.switches]=ZAe(e)}function BTt(e,t,r){for(let n=0;n<3;n++)t[r+n]=e[Wh.curve+n]}function UTt(e,t){for(let r=0;r<Wh.length;r++)if(!Object.is(e[r],t[r]))return!0;return!1}function VTt(e){(e.shadingDrawn??=new Float64Array(Wh.length)).set(e.shading)}var JAe=Sh(),AY=0,WTt=()=>AY;function OY(e){e.version++,AY++,JAe.written(e)}var LY={r:1,g:1,b:1},eOe=new pe(1118481),tOe=new Set(["normal","depth"]),Ix=e=>[e.r,e.g,e.b],xr=(e,t)=>e?t??void 0:void 0,ni=(e,t,r,n=0)=>e?t??r:n,kM=(e,t,r)=>e&&t?Ix(t):[r,r,r];function rOe(e){let{family:t}=e,r=e.sky!==!0,n=dv(t)&&r,o=e.side??"front";return{model:hY(t),lit:n,emits:n||!r,side:o,standard:uv(t)&&r,physical:t==="physical"&&r,sheet:n&&o==="double"}}var nOe=(e,t,r)=>t&&e.graph&&qz(e.graph,"subsurfaceColor")?[1,1,1]:kM(t||r,e.subsurfaceColor,0),oOe=e=>e===lr.skin||e===lr.subsurface,RY=(e,{lit:t,standard:r})=>{let n=e.shadingModel==="fromMaterialExpression"?void 0:TY(e.shadingModel);return t&&(r||n===Vn.unlit)?n:void 0},iOe=(e,t)=>Ar(t===lr.eye?1-(e.irisMask??1):e.subsurfaceOpacity??1),sOe=(e,t,r,n)=>{let o=n&&r===lr.toon,i=uY(e,t.toonProfile,o),s=sY(e,n&&!o?t.subsurfaceProfile:void 0);return o?i:s},aOe=e=>({fog:e.fog!==!1,cloudFog:e.fog!==!1&&e.cloudFog===!0,computeFogPerPixel:e.computeFogPerPixel===!0,contactShadows:e.contactShadows===!0,translucentLocalLightShadow:e.translucentLocalLightShadow===!0,translucentLocalLightShadowQuality:e.translucentLocalLightShadowQuality??0,litFrom:e.litFrom??ah,translucencyPass:e.translucencyPass??"afterDepthOfField",allowNegativeEmissive:e.allowNegativeEmissive===!0,opacityMaskClipValue:e.opacityMaskClipValue,ditherOpacityMask:e.ditherOpacityMask===!0,transparentShadow:e.transparentShadow===!0,translucentShadowDensityScale:e.translucentShadowDensityScale,translucentShadowStartOffset:e.translucentShadowStartOffset,translucentSelfShadowDensityScale:e.translucentSelfShadowDensityScale,translucentSelfShadowSecondDensityScale:e.translucentSelfShadowSecondDensityScale,translucentSelfShadowSecondOpacity:e.translucentSelfShadowSecondOpacity,translucentBackscatteringExponent:e.translucentBackscatteringExponent,translucentMultipleScatteringExtinction:e.translucentMultipleScatteringExtinction,normalCurvatureToRoughness:e.normalCurvatureToRoughness===!0,maxWorldPositionOffset:e.maxWorldPositionOffset??0,alwaysEvaluateWorldPositionOffset:e.alwaysEvaluateWorldPositionOffset===!0});function lOe(e,t,r){let{lit:n,emits:o,side:i,standard:s,sheet:a}=r,l=RY(t,r),c=o?t.emissive:void 0,u=c?t.emissiveIntensity??1:0;return{baseColor:Ix(tOe.has(t.family)?LY:t.color??LY),metalness:ni(s,t.metalness,0),roughness:s?t.roughness??1:t.family==="phong"?mY(t.shininess??30):1,lit:n,...aOe(t),responsive:t.responsive,sky:t.sky===!0,side:i,alphaTest:t.alphaTest??0,emissive:c?Ix(c).map(d=>d*u):[0,0,0],subsurfaceColor:nOe(t,a,oOe(l)),subsurfaceOpacity:a||l!==void 0?iOe(t,l):1,shadingModel:l,irisDistance:l===lr.eye?Ar(t.irisDistance??.1):0,modelFromGraph:t.shadingModel==="fromMaterialExpression",subsurfaceProfile:sOe(e,t,l,n),vertexColors:t.vertexColors===!0}}function cOe(e,t){let{model:r,lit:n,emits:o,standard:i,physical:s,sheet:a}=t;return{map:r===wo.matcap?xr(!0,e.matcap):xr(e.family!=="normal",e.map),metalnessMap:xr(i,e.metalnessMap),roughnessMap:xr(i,e.roughnessMap),normalMap:xr(n,e.normalMap),aoMap:xr(n,e.aoMap),emissiveMap:xr(o,e.emissiveMap),subsurfaceMap:xr(a||RY(e,t)===lr.subsurface,e.subsurfaceMap),anisotropyMap:xr(s,e.anisotropyMap),clearcoatMap:xr(s,e.clearcoatMap),clearcoatRoughnessMap:xr(s,e.clearcoatRoughnessMap),clearcoatNormalMap:xr(s,e.clearcoatNormalMap),specularIntensityMap:xr(s&&e.specularIntensity!==void 0,e.specularIntensityMap),displacementMap:xr(e.displacement!==void 0,e.displacementMap)}}var uOe=e=>({displacement:e.displacement&&(e.displacementMap||e.graph?.outputs.displacement)?e.displacement:void 0});function dOe(e,{lit:t}){let r=t&&e.normalScale||void 0,n=e.forVertexTangents,o=e.clearcoatNormalScale,i=u=>[n?-u:u,n===!1?-u:u],[s,a]=i(r?r.y:1),[l,c]=i(o?.y??1);return{normalScale:r?r.x:1,normalScaleY:s,tangentNormalScaleY:a,aoIntensity:ni(t,e.aoMapIntensity,1,1),clearcoatNormalScale:[o?.x??1,l],clearcoatTangentNormalScaleY:c}}var fOe=(e,t)=>t&&Uy.has(e.family)&&$z(e.graph?.outputs);function pOe(e,{physical:t,lit:r}){let n=fOe(e,r)?1:ni(t,e.transmission,0);return{anisotropy:ni(t,e.anisotropy,0),anisotropyRotation:ni(t,e.anisotropyRotation,0),clearcoat:ni(t,e.clearcoat,0),clearcoatRoughness:ni(t,e.clearcoatRoughness,0),specularIntensity:t?e.specularIntensity:void 0,transmission:n,translucentDirectionalLightShadowQuality:e.translucentDirectionalLightShadowQuality??(n>0?1:0),ior:ni(t,e.ior,1.5,1.5),refracts:t&&(e.ior!==void 0||!!e.graph?.outputs.refraction),thickness:ni(t,e.thickness,0),attenuationDistance:t&&Number.isFinite(e.attenuationDistance)?e.attenuationDistance:0,attenuationColor:kM(t,e.attenuationColor,1)}}function hOe(e,{physical:t}){let r=t&&(e.sheen??0)>0&&!((e.transmission??0)>0)&&!((e.clearcoat??0)>0);return{sheen:r?1:0,sheenColor:kM(r,e.sheenColor,0),sheenRoughness:ni(r,e.sheenRoughness,0),sheenColorMap:xr(r,e.sheenColorMap),sheenRoughnessMap:xr(r,e.sheenRoughnessMap)}}var mOe=e=>({lineWidth:e.lineWidth??0,...typeof e.dashSize=="number"?{dashSize:e.dashSize,gapSize:e.gapSize??0}:{},...e.sprite===!0?{sprite:{rotation:e.rotation??0,sizeAttenuation:e.sizeAttenuation!==!1}}:{}}),gOe=e=>({name:e.name??"",family:e.family,opacity:e.sky===!0?1:e.opacity??1,transparent:e.transparent===!0||e.family==="shadow"||e.sky===!0,blending:e.sky===!0?"normal":e.blending??"normal",twoSidedPasses:e.twoSidedPasses===!0,flatShading:e.flatShading===!0,forVertexTangents:e.forVertexTangents,shininess:e.family==="phong"?e.shininess??30:void 0,specular:e.family==="phong"?Ix(e.specular??eOe):void 0}),SOe=e=>({graph:Uy.has(e.family)?e.graph:void 0}),wOe=(e,{lit:t})=>({water:t&&Uy.has(e.family)&&zz(e.graph?.outputs)});function _Y(e,t){let r=Vy(t.family,t);if(r)throw new Error(r);let n=rOe(t);return Object.assign({},lOe(e,t,n),cOe(t,n),dOe(t,n),pOe(t,n),hOe(t,n),uOe(t),{model:n.model},SOe(t),wOe(t,n),mOe(t),gOe(t))}function Ki(e){let t=new Bs,r=Object.assign({version:0},_Y(t,e));return Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))}function vY(e,t){Object.assign(e,_Y(e,t)),OY(e)}var yOe=Ki({family:"basic"}),kx=e=>Array.isArray(e)?e[0]??yOe:e;var xOe=e=>kx(e.declaration),sAt=(e,t)=>t.includes(xOe(e)),aAt=(e,t)=>e.filter(r=>!!r.drawSource&&t.has(r.drawSource));function lAt(e,t){e.material=kx(t)}var bOe=e=>kx(e).side;var MY=(e,t,r)=>e.slice(t,Math.min(t+r,e.byteLength)),EOe=(e,t,r)=>{let n={promise:t.arrayBuffer(),askers:0,stop:r},o=()=>void(e.download===n&&(e.download=void 0));r.signal.addEventListener("abort",o,{once:!0}),n.promise.catch(o),e.download=n},TOe=async(e,t,r,n,o,i,{meter:s=qy,signal:a})=>{let l=new AbortController;a?.throwIfAborted();let c=ro(l,a),u=vr(r,l.signal,{headers:{Range:`bytes=${o}-${o+i-1}`}});e.has(n)||(t.asking=u);try{let d=s.read(await u,r);if(l.signal.aborted)throw jo(d),l.signal.reason;if(d.status===206)return e.add(n),await d.arrayBuffer();t.download?jo(d):EOe(t,d,l)}finally{t.asking===u&&(t.asking=void 0),c()}},AOe=async(e,t,r,n,o,i,s)=>{let a=await Kc(r,s.signal,()=>r.stop.abort(s.signal?.reason));return t.download===r&&(t.download=void 0,e.keepFile(n,a)),MY(a,o,i)},OOe=async(e,t,r,n,o,i,s)=>{let a=new URL(n).origin;for(;!e.has(a)&&r.asking;)await Jt(r.asking.catch(()=>{}),s.signal);for(;;){let l=t.file(n);if(l)return MY(l,o,i);let c=r.download;if(c)return AOe(t,r,c,n,o,i,s);let u=await TOe(e,r,n,a,o,i,s);if(u)return u}};function DY(e){let t=new Set,r=new Map;return async(o,i,s,a={})=>{let l=r.get(o);l||r.set(o,l={asking:void 0,download:void 0,reads:0}),l.reads++;try{return await OOe(t,e,l,o,i,s,a)}finally{--l.reads===0&&r.delete(o)}}}function PY({items:e,before:t,put:r},n){let o=e[n];for(let i=n-1>>1;n>0&&t(o,e[i]);i=n-1>>1)r(e[i],n),n=i;r(o,n)}function LOe({items:e,before:t,put:r},n){let o=e[n],i=e.length;for(let s=2*n+1;s<i&&(s+1<i&&t(e[s+1],e[s])&&s++,!!t(e[s],o));s=2*n+1)r(e[s],n),n=s;r(o,n)}function Ml(e,t=()=>{}){let r=[],n={items:r,before:e,put(s,a){r[a]=s,t(s,a)}},o=s=>{s>0&&e(r[s],r[s-1>>1])?PY(n,s):LOe(n,s)},i={items:r,size:0,push(s){i.size=r.push(s),PY(n,r.length-1)},take(s=0){if(s>=r.length)return;let a=r[s],l=r.pop();return i.size=r.length,s<r.length&&(n.put(l,s),o(s)),a},settle:o,clear(){r.length=i.size=0}};return i}var ROe=(e,t)=>e.stamp<t.stamp;function CY(e,t){t.slot<0||(e.heap.take(t.slot),t.slot=-1)}function IY(e,t){let r=t.value;e.bytes-=t.bytes,t.holds>0&&(e.heldBytes-=t.bytes),e.size--,t.value=void 0,t.bytes=0,e.left(r,t.key)}function kY(e,t){e.entries.delete(t.key),CY(e,t),t.value!==void 0&&IY(e,t)}function FY(e,t){let r=e.entries.get(t);return r||(r={key:t,value:void 0,bytes:0,holds:0,stamp:-1,slot:-1},e.entries.set(t,r)),r}function _Oe(e,t){let r=e.entries.get(t);if(r?.value!==void 0)return r.stamp!==e.next-1&&(r.stamp=e.next++,r.slot>=0&&e.heap.settle(r.slot)),r.value}function vOe(e,t,r,n){let o=FY(e,t);o.value!==void 0&&IY(e,o),o.value=r,o.bytes=n,o.stamp=e.next++,e.bytes+=n,e.size++,o.holds>0?e.heldBytes+=n:o.slot>=0?e.heap.settle(o.slot):e.heap.push(o)}function MOe(e,t,r){let n=e.entries.get(t);n?.value!==void 0&&(e.bytes+=r-n.bytes,n.holds>0&&(e.heldBytes+=r-n.bytes),n.bytes=r)}function DOe(e,t){let r=e.entries.get(t);r&&kY(e,r)}function POe(e){for(let{key:t,value:r}of e.entries.values())r!==void 0&&e.left(r,t);e.entries.clear(),e.heap.clear(),e.bytes=e.heldBytes=e.size=0}function COe(e,t){let r=FY(e,t);r.holds++>0||r.value===void 0||(CY(e,r),e.heldBytes+=r.bytes)}function IOe(e,t){let r=e.entries.get(t);if(!(!r||r.holds===0||--r.holds>0)){if(r.value===void 0)return void e.entries.delete(t);e.heldBytes-=r.bytes,e.heap.push(r)}}function kOe(e,t,r){let n=0;for(let o=e.heap.items[0];o&&t(o.value);o=e.heap.items[0]){let i=o.value;kY(e,o),r?.(o.key,i),n++}return n}function NY(e=()=>{}){let t={entries:new Map,heap:Ml(ROe,(r,n)=>r.slot=n),left:e,next:0,bytes:0,heldBytes:0,size:0};return W({get size(){return t.size},get bytes(){return t.bytes},get heldBytes(){return t.heldBytes},get heldCount(){return t.size-t.heap.size},get first(){return t.heap.items[0]},entry:r=>t.entries.get(r),touch:r=>_Oe(t,r),set:(r,n,o)=>vOe(t,r,n,o),resize:(r,n)=>MOe(t,r,n),acquire:r=>COe(t,r),release:r=>IOe(t,r),drop:r=>DOe(t,r),evict:(r,n)=>kOe(t,r,n),clear:()=>POe(t)})}var zh=256*Tn,BY=e=>{if(!Number.isSafeInteger(e)||e<1)throw new Error("INVALID_PAGE_CACHE_BUDGET")};function FOe(e,t){t.kind==="page"?e.pages--:t.kind==="level"&&(e.levelBytes-=t.level.byteLength)}function NOe(e){let t={get bytes(){return e.entries.bytes},get heldBytes(){return e.entries.heldBytes},get pageCount(){return e.pages},get levelBytes(){return e.levelBytes},get cpuBytes(){return e.total},get reservedBytes(){return e.reserved},get budgetBytes(){return Math.max(0,e.total-t.reservedBytes)},get roomBytes(){return Math.max(0,t.budgetBytes-e.entries.heldBytes)}};return t}function BOe(e,t){let r=t.budgetBytes;if(!(e.entries.bytes<=r)&&!e.entries.evict(()=>e.entries.bytes>r,e.told))for(let n of e.sessions)n.blocked?.()}function UOe(e,t,r){let{entries:n}=e;return{page(o){let i=n.entry(o)?.value;return i?.kind==="page"?i.array:void 0},touch(o){let i=n.touch(o);return i?.kind==="page"?i.array:void 0},put(o,i,s){n.set(o,{kind:"page",array:i,sha256:s},i.byteLength),e.pages++},drop:n.drop,foreign({url:o,bytes:i,decodedBytes:s,sha256:a}){let l=n.entry(o)?.value;return l?.kind==="page"&&(l.sha256!==a||l.array.byteLength!==(s??i))},acquire:n.acquire,release:n.release,fit:r,file(o){let i=n.touch(o);return i?.kind==="file"?i.buffer:void 0},keepFile(o,i){i.byteLength>t.roomBytes||(n.set(o,{kind:"file",buffer:i},i.byteLength),r())}}}function VOe(e,t){let{entries:r}=e,n={weight:o=>r.entry(o)?.bytes??0,weigh(o,i){r.resize(o,i),t()},level(o){let i=r.touch(o);return i?.kind==="level"?i.level:void 0},keepLevel(o,i){if(n.level(o))return;let s=i.byteLength;r.set(o,{kind:"level",level:i},s),e.levelBytes+=s,t()}};return n}function GOe(e,t,r,n){e.sessions.add(r);let o=0,i={reserve(s){e.reserved+=s-o,o=s,t()},leave(){e.sessions.delete(r)&&(e.reserved-=o,o=0)}};return i.reserve(n),i}function HOe(e,t){return{resize(r){BY(r),e.total=r,t()},open:(r,n)=>GOe(e,t,r,n),clear(){e.entries.clear(),e.pages=e.levelBytes=0}}}function FM(e=zh){BY(e);let t={sessions:new Set,total:e,reserved:0,pages:0,levelBytes:0,entries:NY(i=>FOe(t,i)),told:(i,s)=>{if(s.kind==="page")for(let a of t.sessions)a.evicted?.(i)}},r=NOe(t),n=()=>BOe(t,r),o=W(r,UOe(t,r,n),VOe(t,n),HOe(t,n));return Object.assign(o,{readRange:DY(o)})}function WOe(e,t,r,n){try{e?.({phase:t,message:r,context:{pipelineVersion:1,...n}})}catch{}}var FAt=(e,t,r,n,o)=>({version:1,limited:e,requiredSlots:t,slots:r,fallbackRetained:n,pixelError:o}),NAt=(e,t)=>WOe(e,"coverage-budget","Admission of the requested cut",t),Fx=e=>e&&((t,r,n)=>{try{e({phase:t,message:r,context:n()})}catch{}});function zOe(e,t,r,n){try{return Promise.resolve(e.read(t,r,n))}catch(o){return Promise.reject(o)}}function UY(e,t,r){let n=typeof r=="function"?r:void 0,o=Fx(n),i=()=>n?Z():0;return{report:n,emit:o,now:i,read:(a,l,c)=>{let u=i();o?.("gpu-page-read-start","GPU page read started",()=>({version:1,key:a}));let d=zOe(e,a,l,c).then(f=>{let h=i()-u;return o?.("gpu-page-read-end","GPU page read finished",()=>({version:1,key:a,status:null,expectedBytes:t,actualBytes:f.byteLength,durationMs:h})),f},f=>{let h=i()-u;throw o?.("gpu-page-read-end","GPU page read failed",()=>({version:1,key:a,status:eu(f),error:String(f),durationMs:h})),f});return d.catch(()=>{}),d}}}function jh(e,t){let r=e.pending.catch(()=>{}).then(t);return e.pending=r,r}var VY=(e,t)=>e.byteLength>=4&&new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)===t;var Dl=e=>VY(e,860899159);function GY(e,t){let r,n,o=!1,i=l=>r??={code:l,stages:l.installStages(e)},s=l=>{o||i(l)};M.pageInstall.load().then(s,()=>{});let a=async()=>{let l=await M.pageInstall.load();o||await i(l).stages.prepare()};return{prepare:a,ready:()=>r?.stages.ready?void 0:a(),add(l){if(!o){if(!r?.stages.ready)throw new Error("INSTALL_PASSES_NOT_READY");n??=r.code.createPageInstaller(e,t,r.stages),n.add(l)}},flush:()=>n?.flush(),flushAt:(l,c)=>n?.flushAt(l,c),dispose:()=>{o=!0,n?.dispose(),n=void 0}}}var NM=new Uint8Array(4);function Wu(e,t,r){let{resident:n,state:o}=e;e.install.flushAt(t.offset,t.offset-e.placement.offsetIn(t.key)),n.delete(t.key),e.eviction.isPinned(t.key)&&e.changes.unpinned(t.key),e.eviction.left(t.key),e.changes.left(t.key),o.evictions++,e.reader.emit?.("gpu-page-eviction","Page removed from GPU residency",()=>({version:1,key:t.key,offset:t.offset,generation:t.generation,bytes:t.bytes,reason:r,drawDetached:!1}))}function jOe(e,t,r,{offset:n,start:o},i,s){if(Dl(r)){e.install.add({bytes:r,offset:n,room:e.placement.room(t),unit:o,named:s,dependencies:()=>i.map(d=>e.placement.startOf(d))});return}let{device:a,buffer:l}=e,c=r.byteLength,u=uS(c,4);u>0&&a.queue.writeBuffer(l,n,r,0,u),Vr(c,4)!==u&&(NM.fill(0),NM.set(r.subarray(u)),a.queue.writeBuffer(l,n+u,NM,0,4))}function $Oe(e,t,r,n,o){let{emit:i,report:s}=e.reader,{key:a,offset:l,bytes:c}=t;i?.("gpu-page-upload","Page written or staged for its GPU slot",()=>({version:1,key:a,offset:l,generation:t.generation,actualDataBytes:c,uploadedBytes:r,uploadDurationMs:n,gpuMs:null,drawDetached:!1})),i?.("gpu-page-load-end","GPU load finished",()=>({version:1,key:a,offset:l,generation:t.generation,actualDataBytes:c,uploadedBytes:r,durationMs:s?er(o):null}))}function HY(e,t,r,n,o,i=[],s){let{state:a,resident:l,reader:c}=e;a.bytesRead+=r.byteLength;let u=c.now();jOe(e,t,r,n,i,s);let d=c.report?er(u):null,f=Vr(r.byteLength,4);a.uploadedBytes+=f;let h={key:t,offset:n.offset,bytes:r.byteLength,generation:++a.generation};return l.set(t,h),e.changes.placed(t,n.offset),e.changes.arrived(t),$Oe(e,h,f,d,o),h}function WY(e){if(e.byteLength<92)return;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getUint32(84,!0)>>6&255,n=0;for(let l=t.getUint32(16,!0)&30720;l;l&=l-1)n++;let o=(23+9*r+2*n)*4;if(e.byteLength<o+48||t.getUint32(o,!0)===0)return;let i=[],s=t.getUint32(o+4,!0),a=t.getUint32(o+20,!0);for(let l=0;l<s&&a+(l+1)*4<=e.byteLength;l++){let c=t.getUint32(a+l*4,!0)>>>24;c&&i[i.length-1]!==c&&i.push(c)}return i}var BM="POOL_FULL",sOt=e=>String(e).includes(BM);var KOe=[];function zY(e,t,r){if(Dl(r))return;let n=e.placement.room(t);if(r.byteLength<=n&&r.byteLength!==0)return;let{emit:o}=e.reader;throw o?.("gpu-page-corruption","Unexpected GPU page size",()=>({version:1,key:t,reason:"page-size-mismatch",expectedBytes:n,actualBytes:r.byteLength})),o?.("gpu-page-admission-blocked","Page refused by a GPU slot capacity",()=>({version:1,key:t,reason:"page-size-mismatch",expectedBytes:n,actualBytes:r.byteLength})),new Error("PAGE_SIZE_MISMATCH")}function jY(e,t,r,n=KOe){if(!Dl(r))return;let o=WY(r),i=o?.find(a=>a>n.length);if(i!==void 0)throw new Error(`PAGE_DEPENDENCY_UNLISTED: ${t} names ${i} of ${n.length}`);let s=n.find(a=>!e.resident.has(a)&&!e.placement.sameUnit(a,t));if(s!==void 0)throw Bx(e,t,`dependency-absent:${s}`);return o}function $Y(e,t,r){let n=e.placement.place(t,r);if(typeof n=="string")throw Bx(e,t,n);for(let o of n.victims)Wu(e,o,"capacity");return n}var Nx=(e,t)=>t!==void 0&&e.placement.holds(t)?1:e.placement.freeFor(t);function Bx(e,t,r){let{resident:n,slots:o,eviction:i}=e;return e.reader.emit?.("gpu-page-admission-blocked","No free GPU slot",()=>({version:1,key:t,reason:r,resident:n.size,slots:o,pinned:i.pinnedCount})),new Error(BM)}function KY(e,t){let{resident:r,state:n,reader:o}=e,{emit:i,now:s}=o;return function(l,c,u,d,f,h){let m=i&&c?()=>i("gpu-page-abort","GPU load cancelled",()=>({version:1,key:l,reason:String(c.reason??"aborted")})):void 0;m&&c.addEventListener("abort",m,{once:!0});let w=s();if(i?.("gpu-page-request","GPU page request received",()=>({version:1,key:l,resident:r.has(l),loading:n.loading})),!r.has(l)&&f===void 0&&Nx(e,l)<=0)return m&&c.removeEventListener("abort",m),Promise.reject(Bx(e,l,"no-free-slot"));let x={key:l,signal:c,pinned:u,priority:d,victim:f,dependencies:h,abortListener:m,requestStarted:w,fetched:r.has(l)?void 0:qY(e,l,c,d)};return n.loading++,jh(n,()=>QOe(e,t,x))}}var YY=new WeakMap;function qOe(e,t){let r=YY.get(e);r||YY.set(e,r=new WeakMap);let n=r.get(t);return n||r.set(t,n=AbortSignal.any([e,t])),n}var qY=({abort:e,reader:t},r,n,o)=>t.read(r,n?qOe(n,e.signal):e.signal,o);function XOe(e,t,r){let{key:n,dependencies:o}=t;zY(e,n,r);let i=jY(e,n,r,o),s=t.victim===void 0?void 0:e.resident.get(t.victim),a=s&&!e.eviction.isPinned(s.key)?s:void 0,l=$Y(e,n,a);return HY(e,n,r,l,t.requestStarted,o,i)}async function QOe(e,t,r){let{resident:n,state:o,check:i,eviction:s}=e,{report:a,emit:l,now:c}=e.reader,{key:u,pinned:d,signal:f,abortListener:h}=r,m=c();try{i(f),l?.("gpu-page-queue-wait","GPU load CPU queue wait finished",()=>({version:1,key:u,durationMs:a?m-r.requestStarted:null}));let w=ZOe(e,u);if(w)return d&&t(u),w;l?.("gpu-page-cache-miss","Page absent from GPU residency",()=>({version:1,key:u,source:"page-source"}));let x=await(r.fetched??qY(e,u,f,r.priority));i(f);let b=Dl(x)?e.install.ready():void 0;b&&(await b,i(f));let T=XOe(e,r,x);return d&&t(u),T}catch(w){throw l?.("gpu-page-error","GPU load failed",()=>({version:1,key:u,status:eu(w),aborted:f?.aborted===!0||e.abort.signal.aborted,error:String(w),resident:n.size,pinned:s.pinnedCount})),w}finally{h&&f.removeEventListener("abort",h),o.loading--}}function ZOe({resident:e,reader:t},r){let n=e.get(r);if(n)return t.emit?.("gpu-page-cache-hit","GPU page already resident",()=>({version:1,key:r,offset:n.offset,generation:n.generation,source:"resident-cache"})),n}function XY(e){let{resident:t,eviction:r,check:n,reader:o}=e,{emit:i}=o;return{pin(s){n();let a=t.get(s);if(!a)throw i?.("gpu-page-pin-refused","GPU pin refused",()=>({version:1,key:s,reason:"not-resident"})),new Error("PAGE_NOT_RESIDENT");r.pin(s)&&i?.("gpu-page-pin","GPU page pinned",()=>({version:1,key:s,offset:a.offset,generation:a.generation,changed:!0,pinned:r.pinnedCount}))},room:()=>Nx(e),rooted:s=>e.placement.rooted(s),rootRoom:()=>e.placement.rootFree,isPinned:r.isPinned,holds:s=>t.has(s),unpin(s){return r.unpin(s)?(i?.("gpu-page-unpin","GPU pin removed",()=>({version:1,key:s,changed:!0,pinned:r.pinnedCount})),!0):!1}}}var QY="unlabeled",Ux="GPU_BUDGET_EXCEEDED",UM=class extends Error{code=Ux;shortfall;requested;constructor(t,r=1/0,n=1/0){super(t),this.shortfall=r,this.requested=n}};function $h(e,t,r,n=!1){let o=n||e.tentative>0,i=e.liveBytes+(e.base?.bytes??0)+t-e.replacing-e.retiring,s=e.limit?.();if(s!==void 0&&(!Number.isFinite(s)||i>s)){let a=new UM(`${Ux}: requested=${t}, label=${r}, held=${i-t}, limit=${s}; heaviest: ${tLe(e)}`,Number.isFinite(s)?i-s:1/0,t);throw o||(e.refusal=a),a}try{for(let a of e.admissions)a(t,r,o)}catch(a){throw o||(e.refusal=a),a}}var JOe=8,eLe=e=>Object.entries(e.byLabel).slice(0,JOe),tLe=e=>eLe(VM(e)).map(([t,r])=>`${t}=${r}`).join(", ");function ZY(e,t,r,n){e.live.set(t,{label:r,bytes:n}),e.liveBytes+=n;for(let i of e.transactions)i.add(t);e.held=void 0;let o=t.destroy;return t.destroy=function(){return e.live.delete(t)&&(e.liveBytes-=n,e.held=void 0),o.call(this)},t}function eK(e,t){let{counts:r,limit:n}=t,o=e.createTexture.bind(e),i=e.createBuffer.bind(e);e.createTexture=s=>{if(r&&!r(s.label))return o(s);let a=$r(s),l=s.label??QY;if(a===null&&(n||t.admissions.size))throw $h(t,1/0,l),t.refusal=new Error("GPU_BUDGET_UNKNOWN_FORMAT"),t.refusal;return $h(t,a??0,l),a===null&&t.unknownFormats++,ZY(t,o(s),l,a??0)},e.createBuffer=s=>{if(r&&!r(s.label))return i(s);let a=s.label??QY;return $h(t,s.size,a),ZY(t,i(s),a,s.size)}}function rLe(e,t){for(let r of[...t])e.live.has(r)&&r.destroy()}function tK(e,t,r=!0){let n=e.live.get(t);n&&(n.held=r)}var JY=(e,t,r)=>e.set(t,(e.get(t)??0)+r);function rK(e,t){let r=[];for(let[n,{label:o,bytes:i,held:s}]of[...e.live])s||(r.push({label:o,bytes:i}),JY(e.forgotten,o,i),t&&JY(t.forgotten,o,i)),n.destroy();return r}function nK(e){let t=new Set,r=!0;return e.transactions.add(t),{commit(){r=!1,e.transactions.delete(t)},rollback(){r&&(r=!1,e.transactions.delete(t),rLe(e,t))}}}function VM(e){let t=e.base?.snapshot();if(e.held&&e.heldBase===t)return e.held;e.heldBase=t;let r=new Map(t?Object.entries(t.byLabel):[]),n=t?.bytes??0;for(let i of e.live.values())n+=i.bytes,r.set(i.label,(r.get(i.label)??0)+i.bytes);let o=Object.fromEntries([...r].sort((i,s)=>s[1]-i[1]));return e.held={bytes:n,byLabel:o,unknownFormats:e.unknownFormats+(t?.unknownFormats??0),live:e.live.size+(t?.live??0)}}var GM=new WeakMap,oK=new WeakMap;function OOt(e,t={}){let r=GM.get(e);if(r)return r;let{base:n,limit:o}=t,i={...t,live:new Map,forgotten:new Map,unknownFormats:0,liveBytes:0,refusal:void 0,tentative:0,replacing:0,retiring:0,admissions:new Set,transactions:new Set,held:void 0,heldBase:void 0},s=(c,u,d=!1)=>$h(i,c,u,d),a=o?n?.observeAdmission(s):void 0;eK(e,i);let l=nLe(i,n,a);return GM.set(e,l),oK.set(l,i),l}function nLe(e,t,r){let{limit:n,admissions:o}=e,i=W({get bytes(){return e.liveBytes+(t?.bytes??0)},get room(){let s=n?.();return s===void 0?1/0:Number.isFinite(s)?s-i.bytes+e.replacing+e.retiring:0},get refusal(){return e.refusal??t?.refusal},observeAdmission(s){return o.add(s),()=>{o.delete(s),!o.size&&!n&&(e.refusal=void 0)}},releaseAdmission(){r?.()},tentative(s){e.tentative++;try{return t?t.tentative(s):s()}finally{e.tentative--}},replacing(s,a){e.replacing+=s;try{return a()}finally{e.replacing-=s}},retiring(s,a=0){let l=e.live.get(s)?.bytes??a;return e.retiring+=l,l},retired(s){e.retiring-=s},transaction:()=>nK(e),declareHeld:(s,a)=>tK(e,s,a),sweep:()=>rK(e,t&&oK.get(t)),get forgotten(){return e.forgotten},snapshot:()=>VM(e)});return i}var zu=e=>e?GM.get(e):void 0,oLe=e=>zu(e)?.room??1/0,HM=(e,t,r)=>{let n=zu(e);return n?n.replacing(t,r):r()},iLe=e=>e?.code===Ux,sLe=(e,t)=>{let r=zu(e);return r?r.tentative(t):t()};function aLe(e,t){let r=zu(e)?.transaction();try{return t()}catch(n){throw r?.rollback(),n}finally{r?.commit()}}function LOt(e,{held:t,asked:r,what:n,make:o}){try{if(r-(t?.bytes??0)>oLe(e))return{why:`the memory budget leaves no room for ${n}`};try{return{value:sLe(e,()=>HM(e,t?.bytes??0,()=>aLe(e,o)))}}catch(i){if(iLe(i))return{why:`the memory budget refused ${n}`};throw i}}finally{t?.dispose()}}function wn(e){let t=new WeakMap;return Object.assign(n=>{let o=t.get(n);return o!==void 0||(o=e(n),t.set(n,o),iK(t,n,o)),o},{known:n=>t.get(n),forget:n=>void t.delete(n)})}function iK(e,t,r){if(!(r instanceof Promise))return;let n=()=>e.get(t)===r&&e.delete(t);r.then(o=>o===void 0&&n(),n)}function lLe(){let e=new Map,t=new WeakMap,r=n=>typeof n=="object"&&n!==null||typeof n=="function";return{get:n=>r(n)?t.get(n):e.get(n),set:(n,o)=>void(r(n)?t.set(n,o):e.set(n,o)),delete:n=>void(r(n)?t.delete(n):e.delete(n))}}function sK(e){let t=new WeakMap;return Object.assign((r,n)=>{let o=t.get(r);o||t.set(r,o=lLe());let i=o.get(n);return i!==void 0||(i=e(r,n),o.set(n,i),iK(o,n,i)),i},{forget:(r,n)=>void t.get(r)?.delete(n),forgetDevice:r=>void t.delete(r)})}function ju(e,t,r=globalThis){tr.error(e,t),r?.reportError?.(t)}var aK=(e,t)=>Math.imul(e^t,16777619);function DOt(e){let t=2166136261;for(let r=0;r<e.length;r++)t=aK(t,e.charCodeAt(r));return t>>>0}function lK(e){let t=2166136261,r=2538058380;for(let o=0;o<e.length;o++){let i=e.charCodeAt(o);t=aK(t,i),r=Math.imul(r^i,1540483477),r^=r>>>13}let n=o=>(o>>>0).toString(36).padStart(7,"0");return`${n(t)}${n(r)}`}var cLe=(e="")=>`MgValues${e}`,cK=`struct ${cLe()}`;function uK(e,t,r,n,o){if(e.delete(t),e.set(t,r),e.size>n){let[i,s]=e.entries().next().value;e.delete(i),o?.(i,s)}return r}function $u(e,t,r){let n=(e.get(t)??0)+r;return n>0?e.set(t,n):e.delete(t),n}function yo(e,t,r){let n=e.get(t);return n===void 0&&e.set(t,n=r(t)),n}var uLe=()=>[];function kOt(e,t,r){let n=yo(e,t,uLe);return n.push(r),n}var WM=new WeakMap,Pl=new WeakMap,Vx=new WeakMap,dK=new WeakMap,dLe=new FinalizationRegistry(e=>KM(e)),fLe=256,$M=1e4,zM=new WeakMap,pLe=e=>{let t=WM.get(e);return t||WM.set(e,t=new Map),t};function hLe(e){let t=[];for(let r of e){let n=r?Pl.get(r)?.text:"null";if(n===void 0)return;t.push(n)}return t.join(`
|
|
12
|
+
`)}var mLe={createShaderModule:e=>e.code,createBindGroupLayout:e=>JSON.stringify(e.entries),createPipelineLayout:e=>hLe(e.bindGroupLayouts)},gLe={createShaderModule:"m",createBindGroupLayout:"b",createPipelineLayout:"p"},SLe=new WeakMap,wLe=new FinalizationRegistry(e=>void e.live--),yLe=()=>({live:0});function fK(e,t,r,n){let o=mLe[t];if(!o||typeof n!="object"||n===null||!r||Pl.has(n))return;let i=o(r);if(i===void 0)return;let s=t==="createShaderModule"&&i.includes(cK);if(Pl.set(n,{word:`${gLe[t]}${lK(i)}`,text:i,program:s}),!s)return;let a=yo(SLe,e,yLe);a.live++,wLe.register(n,a)}function xLe(e){let{layout:t,vertex:r,fragment:n,compute:o}=e;if(t!=="auto"&&!(typeof t=="object"&&t&&Pl.has(t)))return;for(let l of[r,n,o])if(l&&!Pl.has(l.module))return;let i=[],s=!0,a=JSON.stringify(e,(l,c)=>{if(l==="label")return;if(l!=="layout"&&l!=="module"||typeof c!="object"||!c)return c;let u=Pl.get(c);return u?(i.push(u.text),u.word):void(s=!1)});return s?{key:a,texts:i}:void 0}function bLe(e){let t=dK.get(e);return t||(dK.set(e,t={}),dLe.register(e,t)),t}var ELe=e=>Pl.get(e)?.program===!0,TLe=[];function ALe(e){let{vertex:t,fragment:r,compute:n}=e,o;for(let i of[t,r,n])i&&ELe(i.module)&&(o??=[]).push(bLe(i.module));return o??TLe}var OLe=(e,t)=>e.texts.length===t.length&&e.texts.every((r,n)=>r===t[n]);function jM(e,t){!e.owners&&!e.pinned&&zM.get(e.pipelines)?.entries.delete(e),t.length||(e.pinned=!0);for(let r of t){let n=Vx.get(r);n||Vx.set(r,n=new Set),!n.has(e)&&(n.add(e),e.owners++)}}function HOt(e,t,r,n){let o=xLe(t);if(o===void 0)return r();let{key:i,texts:s}=o,a=n?[n]:ALe(t),l=pLe(e),c=l.get(i);if(c)return OLe(c,s)?(jM(c,a),c.building):r();let u=r().catch(f=>{throw l.get(i)===d&&l.delete(i),f}),d={pipelines:l,key:i,building:u,texts:s,owners:0,pinned:!1};return l.set(i,d),jM(d,a),u}function pK(e,t){for(let r of WM.get(e)?.values()??[])r.pinned||jM(r,[t])}function YM(e){!e.owners&&!e.pinned&&e.pipelines.get(e.key)===e&&e.pipelines.delete(e.key)}function LLe(e){let t=zM.get(e);if(t)return t;let r=new Map,n=()=>{for(let o of r.keys())YM(o);r.clear()};return zM.set(e,t={entries:r,idle:UH($M),drain:n}),t}function RLe(e){if(e.pipelines.get(e.key)!==e)return;let t=LLe(e.pipelines);uK(t.entries,e,!0,fLe,YM),t.idle.restart(t.drain)}function hK(e,t){for(let r of Vx.get(e)??[])!--r.owners&&!r.pinned&&t(r);Vx.delete(e)}function WOt(e){hK(e,YM)}function KM(e){hK(e,RLe)}var _Le=/@t3d:(\d+)/g,vLe=/@t3d:\d+$/,mK=e=>`@t3d:${e}`,gK=e=>Array.from(e.matchAll(_Le),t=>Number(t[1])),KOt=e=>!e||!vLe.test(e),SK=["createBuffer","createTexture","createSampler","createBindGroupLayout","createPipelineLayout","createBindGroup","createShaderModule","createComputePipeline","createRenderPipeline","createComputePipelineAsync","createRenderPipelineAsync","createCommandEncoder","createRenderBundleEncoder","createQuerySet"],XM=e=>e?.queue?.submits,QM=new WeakMap,ZM=new WeakSet,wK=e=>ZM.has(e),Ir=e=>QM.get(e)??e,MLe=["pushErrorScope","popErrorScope"];function yK(e,t){let r=e,n={limits:e.limits,features:e.features,lost:e.lost,queue:e.queue};for(let o of SK)typeof r[o]=="function"&&(n[o]=t[o]??r[o].bind(e));for(let o of MLe)typeof r[o]=="function"&&(n[o]=r[o].bind(e));return QM.set(n,Ir(e)),n}var Yu=new WeakMap;function qOt(e,t){let r=Yu.get(e);return r&&(r.hook=t),r!==void 0}function XOt(e,t){let r=Yu.get(e);return r?r.raw(t):e.createCommandEncoder(t)}function QOt(e,t){let r=Yu.get(e);return r?.armed.add(t),r!==void 0}function ZOt(e,t){Yu.get(e)?.armed.delete(t)}function qM(e){if(e.armed.size===0)return;let t=[...e.armed];e.armed.clear();for(let r of t)try{r()}catch(n){ju("Work held back for the queue failed; the submits went on",n)}}function JOt(e){let t=Yu.get(e);t&&!ZM.has(e)&&qM(t)}function DLe(e,t,r){let n=0;return W({get submits(){return n},writeBuffer(o,i,s,a,l){t()||e.queue.writeBuffer(o,i,s,a,l)},writeTexture(o,i,s,a){t()||e.queue.writeTexture(o,i,s,a)},copyExternalImageToTexture(o,i,s){t()||e.queue.copyExternalImageToTexture(o,i,s)},submit(o){t()||(qM(r),n++,r.hook!==null&&r.hook.submitted(o),e.queue.submit(o))},onSubmittedWorkDone(){return t()||qM(r),e.queue.onSubmittedWorkDone()}})}function PLe(e){let t=e.createCommandEncoder,r={hook:null,raw:t,armed:new Set};return e.createCommandEncoder=n=>r.hook===null?t(n):r.hook.encoder(n),Yu.set(e,r),r}function CLe(e){let t=new Map,r=` ${e}`;return n=>{let o=t.get(n);return o===void 0&&t.set(n,o=n.endsWith(r)?n:`${n}${r}`),o}}function xK(e,t){let r=!1,n={label:t},o=CLe(t),i=e,s={limits:e.limits,features:e.features,lost:e.lost};for(let l of SK)typeof i[l]=="function"&&(s[l]=c=>{if(r)throw new DOMException(`Session ${t} released the device`,"AbortError");if(!c)return i[l](n);let u=c.label;c.label=u?o(u):t;try{let d=i[l](c);return fK(e,l,c,d),d}finally{u===void 0?delete c.label:c.label=u}});let a=0;return e.pushErrorScope&&(s.pushErrorScope=l=>{r||(a++,e.pushErrorScope(l))}),e.popErrorScope&&(s.popErrorScope=()=>a?(a--,e.popErrorScope()):Promise.resolve(null)),s.queue=DLe(e,()=>r,PLe(s)),QM.set(s,e),{device:s,release(){r=!0,ZM.add(s)}}}var eD=wn(()=>[]),Cl=wn(()=>new Set),EK=wn(()=>({next:0})),Hx=wn(()=>({count:0})),ILe=240,bK=new WeakSet,Yh=new WeakMap,Wx=new WeakSet,TK=new WeakSet;function oLt(e,t){let r=t(),n=Ir(e),o=Cl(n);return o.add(r),Yh.set(r,{open:o,session:e,sequence:EK(n).next++,submits:Hx(n).count}),r}var iLt=e=>Yh.has(e),sLt=e=>Wx.has(e),aLt=e=>TK.has(e);function zx(e,t,r=!1){if(r)t.destroy();else{let n=Ir(e),o=zu(e),i=o?o.retiring(t,t.retiredBytes):0;eD(n).push({resource:t,session:e,before:EK(n).next,ledger:o,bytes:i})}}function lLt(e,t){t&&(e?zx(e,t):t.destroy())}function cLt(e,t,r=!1){if(!t)return;let n={destroy:()=>t.dispose(),retiredBytes:t.bytes};e?zx(e,n,r):n.destroy()}var AK=wn(()=>({count:0}));function tD(e,t){let r=Yh.get(t);if(r&&!wK(r.session))return r;Cl(e).delete(t)&&AK(e).count++}function uLt(e,t){let r=Ir(e);t&&(Hx(r).count++,Cl(r).delete(t)),OK(r)}function OK(e,t){let r=eD(e);if(!r.length)return;let n=1/0;for(let i of Cl(e)){let s=tD(e,i);if(s){n=s.sequence;break}}let o=0;for(let i of r)i.session!==t&&n<i.before?r[o++]=i:(i.resource.destroy(),i.ledger?.retired(i.bytes));r.length=o}function dLt(e){let t=Ir(e),r=[...Cl(t)].flatMap(n=>tD(t,n)??[]);return{retired:eD(t).length,open:r.length,oldestOpenSubmits:r.length?Hx(t).count-r[0].submits:null,orphaned:AK(t).count}}function fLt(e){let t=Ir(e),r=Hx(t).count;for(let n of Cl(t)){let o=tD(t,n);if(o){if(r-o.submits<=ILe)return!1;if(!bK.has(n))return bK.add(n),!0}}return!1}function pLt(e){let t=Ir(e),r=[];for(let n of Cl(t))Yh.get(n)?.session===e&&r.push(()=>_K(n));r.push(()=>OK(t,e)),FLe(r)}var Gx=new WeakMap,JM=new WeakMap;function LK(e,t,r){let n=e.get(t);n?n.push(r):e.set(t,[r])}function hLt(e,t){LK(Gx,e,t)}function mLt(e,t){Wx.has(e)?t():LK(JM,e,t)}function kLe(e){try{e()}catch(t){return{error:t}}}function rD(e){let t;for(let r of e){let n=kLe(r);t??=n}return t}function FLe(e){let t=rD(e);if(t)throw t.error}function RK(e){Wx.add(e),Yh.get(e)?.open.delete(e);let t=JM.get(e);return JM.delete(e),t&&rD(t)}function gLt(e){TK.add(e);let t=Gx.get(e);Gx.delete(e);let r=t&&rD(t),n=RK(e),o=r??n;if(o)throw o.error}function _K(e){Gx.delete(e);let t=RK(e);if(t)throw t.error}function SLt(e,t,r){if(Wx.has(t))return r?.(),!1;let n=XM(e),o=!1;try{e.queue.submit([t.finish()]),o=n===void 0||XM(e)!==n}finally{o||_K(t)}return o}function NLe(e,t,r,n){return{bytes:r,commit:()=>jx(e,n()),destroy:()=>t.forEach(o=>o?.destroy())}}function jx(e,t,r,n){if(r){let o=e.createCommandEncoder({label:n});r(o),e.queue.submit([o.finish()])}for(let o of t)o&&zx(e,o)}var BLe=(e,t)=>e.createBuffer({label:t.label,size:t.size,usage:t.usage});function xLt(e,t,r,n){let o=t.map(i=>i&&BLe(e,i));return jx(e,t,i=>t.forEach((s,a)=>s&&r(i,s,o[a],a)),n),o}var ULe=e=>e.reduce((t,r)=>t+r.size,0),bLt=(e,t,r)=>NLe(e,t,ULe(t),r);function vK(e){let t={homes:new Map,bytes:0};return oD(t,e),t.bytes>0?t:void 0}function oD(e,t){let r=e.homes;nD(e,t,n=>r.get(n),(n,o)=>r.set(n,o))}function nD(e,t,r,n){for(let[o,i]of t){if(!Number.isSafeInteger(i)||i<0||i%4)throw new Error("INVALID_PAGE_HOME");let s=r(o);if(s){if(i>s.bytes)throw new Error("PAGE_HOME_OUTGROWN");continue}let a=VLe(e,i);n?.(o,{offset:a,bytes:i})}}function VLe(e,t){let r=e.holes??[],n=r.findIndex(s=>s.bytes>=t);if(n<0)return e.bytes+=t,e.bytes-t;let o=r[n],i=o.offset;return o.offset+=t,o.bytes-=t,o.bytes||r.splice(n,1),i}function MK(e,t){let r=e.homes,n=e.holes??=[];for(let o of t){let i=r.get(o);i&&(r.delete(o),i.bytes&&n.push({offset:i.offset,bytes:i.bytes}))}DK(e,n)}function DK(e,t){t.sort((o,i)=>o.offset-i.offset);let r=0;for(let o of t){let i=t[r-1];i&&i.offset+i.bytes===o.offset?i.bytes+=o.bytes:t[r++]=o}t.length=r;let n=t[r-1];n&&n.offset+n.bytes===e.bytes&&(e.bytes=n.offset,t.length=r-1)}function PK(e,t,r){if(!e){let s={bytes:0};return r&&nD(s,r,()=>{}),s.bytes}let n=e.holes?.map(s=>({...s}))??[];for(let s of t){let a=e.homes.get(s);a?.bytes&&n.push({offset:a.offset,bytes:a.bytes})}let o={bytes:e.bytes,holes:n};DK(o,n);let i=e.homes;return r&&nD(o,r,s=>t.has(s)?void 0:i.get(s)),o.bytes}var CK=e=>({homes:new Map(e.homes),bytes:e.bytes,holes:e.holes?.map(t=>({...t}))});var iD=(e,t,r,n,o)=>{if(Di(r,"INVALID_PAGE_BUDGET"),o&&!GLe(o,r))throw new Error("INVALID_PAGE_BUDGET");let i=Xf(t,r,n,o);if(i>Ow(e.limits))throw new Error("INVALID_PAGE_BUDGET");return i},GLe=({slots:e,bytes:t},r)=>Number.isSafeInteger(e)&&e>=0&&e<=r&&(e===0||Number.isSafeInteger(t)&&t>=4&&t%4===0),sD=(e,t,r="Trillion3D geometry page cache")=>e.createBuffer({label:r,size:t,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});function HLe(e,t,r){let{resident:n,eviction:o,cover:i}=e,s=[];for(let[a,{start:l,keys:c}]of t.placed){let u=[...c].flatMap(m=>n.get(m)??[]),d=iu(u.map(m=>i.has(m.key)?0:o.isPinned(m.key)?1:2)),f=It(u.map(m=>m.generation)),[h]=c;s.push({unit:a,start:l,key:h,pages:u,rank:d,latest:f})}return r||s.sort((a,l)=>a.rank-l.rank||l.latest-a.latest),s}function WLe(e,t,r=t){if(t<=e&&e<=r&&4*t>e)return e;let n=t>e?Lr(e,t):2*t;return Math.max(t,Math.floor(Math.min(n,r)/4)*4)}function IK(e,t,r,n,o,i){let s=Math.max(e.pageBytes,r?.pageBytes??e.pageBytes),a=iD(e.device,s,t,i,n);return{pageBytes:s,bytes:WLe(e.buffer.size,a,o)}}var kK=(e,t,r,n=e.roots,o)=>IK(e,t,r,n,o,aD(e,r?.widths)).bytes;function zLe(e,t,r,n){let o=0;for(let a of t.placed.keys())o+=r.widthOf(a);let i=[],s=!1;for(let a of HLe(e,t,o<=n)){let l=r.keep(a.unit,a.start,a.key);for(let u of a.pages)l>=0&&r.hold(u.key);let c=Math.min(t.widthOf(a.unit),r.widthOf(a.unit));i.push({held:a,start:l,bytes:c}),l!==a.start&&(s=!0)}return{plan:i,moved:s}}function jLe(e,t,r){let n=[];for(let{held:o,start:i,bytes:s}of t.sort((a,l)=>a.held.start-l.held.start)){if(i<0){for(let l of o.pages)Wu(e,l,"resize"),n.push(l.key);continue}let a=r.length-3;if(a>=0&&r[a]+r[a+2]===o.start&&r[a+1]+r[a+2]===i?r[a+2]+=s:r.push(o.start,i,s),i!==o.start)for(let l of o.pages)l.offset+=i-o.start,e.changes.placed(l.key,l.offset)}return n}function FK(e,t,r,n=e.roots,o){let{device:i,resident:s}=e;e.install.flush();let a=$Le(e.homes,r?.widths,e.released),{pageBytes:l,bytes:c}=IK(e,t,r,n,o,a?.bytes),u=e.placement,{units:d,rootUrls:f}=e,h=Aw({bytes:c,widest:l,homes:a,units:d,roots:n,rootUrls:f,resident:s}),{plan:m,moved:w}=zLe(e,u,h,c),x=w||c!==e.buffer.size?HM(i,e.buffer.size,()=>sD(i,c)):e.buffer,b=[],T=jLe(e,m,b);if(x!==e.buffer){let L=e.buffer;e.buffer=x,jx(i,[L],_=>{for(let D=0;D<b.length;D+=3)_.copyBufferToBuffer(L,b[D],x,b[D+1],b[D+2])},"Trillion3D geometry page cache resize")}return e.homes=a,e.released.clear(),e.placement=h,e.slots=t,e.roots=n,e.pageBytes=l,T}function $Le(e,t,r){if(!t?.size&&!r.size)return e;if(!e)return t&&vK(t);let n=CK(e);return MK(n,r),t&&oD(n,t),n.bytes>0?n:void 0}function aD(e,t){let{homes:r,released:n}=e;if(!t?.size&&!n.size)return r?.bytes;let o=PK(r,n,t);return o>0?o:void 0}function NK(e,t,r,n,o){let{state:i}=e;return jh(i,()=>(e.check(),FK(e,t,r,n,o)))}function BK(e,t){let{emit:r}=e.reader,n=e.resident.get(t);return n?e.eviction.isPinned(t)?(r?.("gpu-page-unload-refused","GPU unload refused",()=>({version:1,key:t,offset:n.offset,generation:n.generation,reason:"pinned"})),!1):(Wu(e,n,"explicit-unload"),e.placement.freed(n),!0):(r?.("gpu-page-unload-refused","GPU unload refused",()=>({version:1,key:t,reason:"not-resident"})),!1)}var UK=()=>({allocatedBytes:0,slots:0,rootSlots:0,residentPages:0,loading:0,bytesRead:0,uploadedBytes:0,evictions:0,pinned:0});function VK(e,t){let{state:r,roots:n}=e;return t.allocatedBytes=e.buffer.size,t.slots=e.slots,t.rootSlots=n.slots,t.residentPages=e.resident.size,t.loading=r.loading,t.bytesRead=r.bytesRead,t.uploadedBytes=r.uploadedBytes,t.evictions=r.evictions,t.pinned=e.eviction.pinnedCount,t}function GK(e){let{state:t,resident:r}=e;return t.disposed?t.pending.then(()=>{}):(e.reader.emit?.("gpu-page-dispose","GPU cache released",()=>({version:1,resident:r.size,loading:t.loading,evictions:t.evictions})),t.disposed=!0,e.abort.abort(Jr),r.clear(),e.eviction.clear(),jh(t,()=>{e.install.dispose(),e.buffer.destroy()}))}function YLe(e,t){if(!e.mapped&&e.order){e.mapped=!0;for(let r=0;r<e.order.count;r++)e.ranks.set(e.keys[r]=e.order.keyAt(r),r)}return e.ranks.get(t)}function HK(e,t,r){let n=e.resident.get(t);return!n||n.generation>e.order.arrivals?null:e.pins.has(t)||!r(n)?void 0:n}function KLe(e,t){let{order:r,held:n}=e;if(!r)return"eviction-queue-spent";for(let o=0;o<n.length;o++){let i=HK(e,n[o].key,t);if(i!==void 0&&(n.splice(o--,1),i))return i}for(;e.at<r.count;){let o=e.at++,i=e.mapped?e.keys[o]:r.keyAt(o),s=HK(e,i,t);if(s)return s;s===void 0&&n.push({key:i,rank:o})}return"eviction-queue-spent"}function WK(e){e.held.length=0,e.ranks.clear(),e.keys.length=0,e.mapped=!1}function zK(e){let t={resident:e,pins:new Set,order:void 0,at:0,ranks:new Map,keys:[],mapped:!1,held:[]},{pins:r}=t;return W({victim:(n=()=>!0)=>KLe(t,n),victims(){return t.order?Math.max(0,t.order.count-t.at)+t.held.length:0},rankOf:n=>YLe(t,n),follow(n){t.order=n,t.at=0,WK(t)},pin(n){return r.has(n)?!1:(r.add(n),!0)},unpin:n=>r.delete(n),isPinned:n=>r.has(n),get pinnedCount(){return r.size},left(n){r.delete(n)},clear(){r.clear(),t.order=void 0,WK(t)}})}function jK(){let e=new Map,t=new Set,r,n,o=new Set;return{placed(i,s){e.set(i,s/4)},arrived(i){r?.push(i)},takeArrivals(i){r??=[];for(let s=0;s<r.length;s++)i(r[s]);r.length=0},unpinned(i){o.add(i)},takeUnpinned(i){for(let s of o)i(s);o.clear()},left(i){t.has(i)?e.set(i,-1):e.delete(i),n?.push(i)},takeDepartures(i){n??=[];for(let s=0;s<n.length;s++)i(n[s]);n.length=0},drain(i,s){for(let[a,l]of e)i.push(a),s.push(l),l<0?t.delete(a):t.add(a);e.clear()}}}function lD(e,t,r){let{pageBytes:n}=r;if(!Number.isSafeInteger(n)||n<4||n%4)throw new Error("INVALID_PAGE_BUDGET");let o=ZLe(e,t,r),i=XY(o),s=KY(o,i.pin),a=UK();return W({get buffer(){return o.buffer},prepare:()=>o.install.prepare(),load:s},qLe(o),XLe(o),i,{unload:l=>BK(o,l),stats:()=>VK(o,a),dispose:()=>GK(o)})}function qLe(e){return{resize:(t,r,n,o)=>NK(e,t,r,n,o),resizedBytes:(t,r,n,o)=>kK(e,t,r,n??e.roots,o),letGo(t){for(let r of t)e.released.add(r)},joinedHomeBytes:t=>aD(e,t)}}function XLe(e){let{resident:t,state:r}=e;return{get(n){return t.get(n)},slotWords(n){let o=t.get(n);return o?o.offset/4:-1},get residentPages(){return t.size},get residencyRevision(){return r.generation+r.evictions},takeArrivals:n=>e.changes.takeArrivals(n),takeUnpinned:n=>e.changes.takeUnpinned(n),takeDepartures:n=>e.changes.takeDepartures(n),drainResidencyChanges:(n,o)=>e.changes.drain(n,o)}}function QLe(e,t,r){if(e.disposed)throw t.emit?.("gpu-page-error","Operation refused after dispose",()=>({version:1,error:"PAGE_CACHE_DISPOSED"})),new Error("PAGE_CACHE_DISPOSED");r?.throwIfAborted()}function ZLe(e,t,r){let{pageBytes:n,slots:o,homes:i,units:s}=r,a=r.roots??Tw,l=r.cover??new Set,c=r.rootUrls??new Set,u=iD(e,n,o,i?.bytes,a),d=sD(e,u),f={pending:Promise.resolve(),disposed:!1,loading:0,generation:0,bytesRead:0,uploadedBytes:0,evictions:0},h=UY(t,n,r.onDiagnostic);h.emit?.("gpu-page-catalogue","GPU cache configured",()=>({version:1,pageBytes:n,slots:o,rootSlots:a.slots,rootBytes:a.bytes,allocatedBytes:u,source:"host-page-source",drawDetached:!1}));let m=new Map,w=zK(m),x=Aw({bytes:u,widest:n,homes:i,units:s,roots:a,rootUrls:c,resident:m}),b={device:e,pageBytes:n,slots:o,roots:a,homes:i,released:new Set,units:s,buffer:d,install:GY(e,()=>b.buffer),resident:m,cover:l,rootUrls:c,abort:new AbortController,state:f,eviction:w,placement:x,changes:jK(),reader:h,check:T=>QLe(f,h,T)};return b}var qi={checked:0,checkMs:0},$K=Ci;function rRt(e){$K=e}async function cD(){let e=await M.pageWork.load();return e.admit($K),e}var Kh=()=>M.pageWork.arrived?M.pageWork.get():void 0,JLe=()=>Kh()?.poolEpoch();async function Ku(e){let t=JLe();return await e(await cD(),t)}async function YK(e){let t=Z(),r=await Wa(e);return qi.checked++,qi.checkMs+=er(t),r}async function nRt(e,t,r,n,o){return Ku((i,s)=>i.patientTask(e,t,{name:r,blocks:n,field:o},s))}async function oRt(e,t){return Ku((r,n)=>r.decodeBlocksOffThread(e,t,n))}async function qh(e,t,r=!1){return Ku((n,o)=>n.cutPagesOffThread(e,t,r,o))}async function iRt(e,t){let r=Z(),n=await Ku((o,i)=>o.rayTracingOffThread(e,t,i));return qi.checked++,qi.checkMs+=er(r),n}var sRt={plan:(e,t,r)=>Ku((n,o)=>n.fieldTasks.plan(e,t,o,r)),finish:(e,t,r,n,o)=>Ku((i,s)=>i.fieldTasks.finish(e,t,r,n,s,o)),waiting:()=>Kh()?.poolWaiting()??0,cpuRoom(){let e=Kh()?.poolWorkers();return e?Math.max(1,e-1):0}};function aRt(){let e=Kh()?.poolWorkers()??null;return qi.checked?{checked:qi.checked,checkMs:qi.checkMs,workers:e}:{checked:null,checkMs:null,workers:e}}function lRt(){Kh()?.closePool(),qi.checked=0,qi.checkMs=0}var $x=(e,t,r,n)=>new E("INVALID_CACHE",n!==void 0?`Corrupt cache object: SHA-256 ${n}, ${t.sha256} announced`:`Corrupt cache object: ${r} bytes received, ${t.bytes} announced`,{url:e,bytes:r,expected:t.bytes,sha256:n??null,expectedSha256:t.sha256});async function KK(e,t){let r=e[0].offset,n=[];for(let{offset:s,bytes:a}of e)n.push(s-r,s-r+a);if(t.byteLength!==n[n.length-1])return e.map(s=>({refused:$x(s.url,s,t.byteLength,void 0),found:void 0}));let o=e.map((s,a)=>new Uint8Array(t,n[2*a],s.bytes)),i=await Promise.all(o.map(s=>YK(s)));return e.map((s,a)=>{let l=i[a];return l!==s.sha256?{refused:$x(s.url,s,s.bytes,l),found:l}:{bytes:o[a],found:l}})}async function qK(e,t=1/0){let r=e,n=new Response(r).body.pipeThrough(new DecompressionStream("deflate-raw")).getReader(),o=[],i=0;for(let a=await n.read();!a.done;a=await n.read()){if(i+=a.value.byteLength,i>t)throw await n.cancel(),new RangeError(`inflates past ${t} bytes`);o.push(a.value)}let s=new Uint8Array(i);return o.reduce((a,l)=>(s.set(l,a),a+l.byteLength),0),s}async function XK({emit:e},t,r){let n=r.byteLength,o=t.map(({url:s,bytes:a,sha256:l,range:c})=>({url:s,bytes:a,sha256:l,offset:c?.offset??0})),i=await KK(o,r);return i.forEach(({bytes:s,found:a},l)=>{let{url:c,bytes:u,sha256:d}=t[l],f=s!==void 0;e?.("page-hash-check",f?"Page hash and size verified":"Page verification failed",()=>({version:1,url:c,expectedBytes:u,actualBytes:n,expectedHash:d,actualHash:a??null,sizeMatches:f||a!==void 0,hashMatches:f})),f||uD(e,c)}),i}var uD=(e,t)=>e?.("page-corruption","Corrupt page or unexpected size",()=>({version:1,url:t}));function eRe(e){let t=0,r=0,n=!1;return{open(){return r=0,n=!0,t=e()},pause:()=>{n&&(r+=e()-t,n=!1)},resume:()=>{n||(t=e(),n=!0)},elapsed:()=>r+(n?e()-t:0)}}function dD(e,{now:t=Z,cost:r=t}={}){let n=0,o=e,i=0,s=1/0,a=eRe(t),{elapsed:l,resume:c}=a;return{open(){return n=i=0,s=1/0,a.open()},pause:a.pause,resume:c,stage(u=1/0){n=0,c(),i=l(),s=u},stageMs:()=>l()-i,admits(){if(n===0)return!0;let u=l();return u<o&&u-i<s},spend:()=>void n++,widen:u=>void(o=Math.max(e,u)),narrow:()=>void(o=e),cost:r}}var tRe=()=>0,xRt=e=>dD(jw,e===void 0?{}:{now:tRe,cost:Z}),rRe=100,nRe=()=>typeof document<"u"&&document.visibilityState==="visible"&&typeof requestAnimationFrame=="function";function bRt(e=!1){let t=0,r=[],n=()=>{t++;for(let o of r.splice(0))o()};return W({get count(){return t},frame:n,next(){return e?(n(),Promise.resolve()):new Promise(o=>{let i=t,s;r.push(()=>{clearTimeout(s),o()});let a=()=>{t===i&&n()};nRe()?s=setTimeout(a,rRe):Ha().then(a)})}})}function QK(e,t=Ha){e.open();let r,n=()=>r??=t().then(()=>{r=void 0,e.open()});return async()=>{for(;!e.admits();)await n();e.spend()}}var ZK="held:",fD=new Map,oRe=0,iRe=new FinalizationRegistry(e=>xo.release(e)),pD=0,JK=QK(dD(jw,{now:()=>pD?0:Z()}));function MRt(e){e.aborted||(pD++,e.addEventListener("abort",()=>pD--,{once:!0}))}var xo={page(e,t,r){let n=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e),o=`${ZK}${++oRe}`;return fD.set(o,n),r.push(o),{url:o,sha256:t,bytes:n.byteLength}},release(e){for(let t of e)fD.delete(t)},releaseWith(e,t){t.length&&iRe.register(e,t)},holds:e=>e.startsWith(ZK)&&!co.holds(e),turn:()=>JK(),async read(e,t){await JK(),t?.throwIfAborted();let r=e.indexOf("#"),n=fD.get(r<0?e:e.slice(0,r));if(!n)throw new Error(`HELD_PAGE_RELEASED: ${e}`);return n}};async function sRe({base:e,store:t},r,n){let[o]=r,i=r[r.length-1];if(!o.range)return(await vr(new URL(o.url,e).href,n)).arrayBuffer();let{offset:s}=o.range,a=i.range.offset+i.bytes-s,l=new URL(o.range.file,e).href;return t.readRange(l,s,a,{signal:n})}async function aRe({emit:e},t,r){let{url:n,decodedBytes:o}=t;if(o===void 0)return r;let i=await qK(r,o).catch(()=>{});if(i?.byteLength===o)return i;throw uD(e,n),i?$x(n,{...t,bytes:o},i.byteLength,void 0):new E("INVALID_CACHE",`Corrupt cache object: its raw DEFLATE does not inflate to the ${o} bytes announced`,{url:n,bytes:r.byteLength,expected:o,sha256:t.sha256})}async function lRe({state:e,store:t},r,n){try{let o=await xo.read(r.url,n);return r.kept!==!1&&t.put(r.url,o,r.sha256),e.bytesRead+=o.byteLength,e.loaded++,{bytes:o}}catch(o){return{cause:o}}}function eq(e){let{catalog:t,emit:r,state:n,store:o}=e;return{read:async(s,a)=>{let l=s.map(f=>t.get(f.url));if(xo.holds(l[0].url))return Promise.all(l.map(f=>lRe(e,f,a)));for(let{url:f,bytes:h}of l)r?.("page-read-start","Page read started",()=>({version:1,url:f,expectedBytes:h}));let c=Z(),u;try{u=await sRe(e,l,a)}catch(f){return s.map(()=>({cause:f}))}if(r?.("page-read-end","Page read finished",()=>({version:1,url:s[0].url,pages:s.length,actualBytes:u.byteLength,durationMs:er(c)})),a.aborted)return s.map(()=>({cause:a.reason}));let d=await XK(e,l,u);return Promise.all(d.map(async(f,h)=>{if(!f.bytes)return{cause:f.refused};let m=l[h],w;try{w=await aRe(e,m,f.bytes)}catch(x){return{cause:x}}return a.aborted?{cause:a.reason}:(m.kept!==!1&&o.put(m.url,w,m.sha256),n.bytesRead+=f.bytes.byteLength,n.loaded++,{bytes:w})}))}}}var VRt=e=>1-1/(2+e);function tq(e,t,r,n){let{failures:o,abort:i,emit:s,queue:a}=e,{url:l}=t;if(r.bytes)return o.passed(l),n.end(l,t),t.resolve(r.bytes);let c=i.signal.aborted?void 0:o.record(l,r.cause),u=String(r.cause);if(c?.again&&t.askers>0&&!n.forgotten(l))return c.waits?(t.state="waiting",s?.("page-retry","A read that failed waits its turn",()=>({version:1,url:l,error:u}))):(t.state="queued",a.push(t));n.end(l,t),t.reject(c?.error??r.cause),c&&s?.("page-error","Persistent page-load failure",()=>({version:1,url:l,error:u,sticky:!c.again}))}function cRe(e,t,r,n){let{state:o,maxTransferBytes:i,emit:s,abort:a}=e,l=0;for(let u of t)u.state="active",l+=u.bytes;o.active++,o.activeBytes+=l;let c=t[0].url;s?.("page-transfer-start","Page transfer admitted",()=>({version:1,url:c,pages:t.length,active:o.active,transferInFlightBytes:o.activeBytes,maxTransferBytes:i})),r.read(t,a.signal).then(u=>u.forEach((d,f)=>tq(e,t[f],d,r)),u=>t.forEach(d=>tq(e,d,{cause:u},r))).finally(()=>{o.active--,o.activeBytes-=l,s?.("page-transfer-end","Page transfer finished",()=>({version:1,url:c,active:o.active,transferInFlightBytes:o.activeBytes})),r.evict(),n()})}function rq(e,t){let{state:r,abort:n,limit:o,queue:i,maxTransferBytes:s}=e,a=()=>{if(!(r.disposed||n.signal.aborted))for(;r.active<o;){let l=i.take(r.active,r.activeBytes,s);if(!l)break;cRe(e,l,t,a)}};return a}var Xh=e=>2*(e.length+64)+128,nq=e=>{let t=0;for(let r of e)t+=Xh(r.url);return t};function oq(e,t){let{jobs:r,state:n,catalog:o,failures:i,store:s}=e,a=new Set,l=u=>{o.delete(u)&&(i.leaves(u),t.drop(u),t.tables(-Xh(u)))},c=(u,d)=>{r.get(u)===d&&(r.delete(u),s.release(u)),!r.has(u)&&a.delete(u)&&!n.disposed&&l(u)};return{forget(u){let d=r.get(u);if(!d)return l(u);a.add(u),d.state==="waiting"&&(c(u,d),d.reject(El))},keep:u=>a.delete(u),forgotten:u=>a.has(u),end:c}}function iq(e,t,r){let{promise:n,resolve:o,reject:i}=uo();n.catch(()=>{});let{url:s,bytes:a,range:l}=e;return{url:s,priority:t,order:r,bytes:a,slot:-1,range:l,state:"queued",askers:0,promise:n,resolve:o,reject:i}}function sq(e,t){let{state:r,store:n,emit:o}=e,i=n.touch(t);if(i)return r.hits++,o?.("page-cache-hit","Page already resident",()=>({version:1,url:t,resident:n.pageCount})),i;r.misses++,o?.("page-cache-miss","Page missing from the cache",()=>({version:1,url:t,resident:n.pageCount}))}function aq(e,t,r){let{state:n,queue:o,jobs:i,emit:s,catalog:a,failures:l,store:c}=e,u=i.get(t);return u?(r<u.priority&&(u.priority=r,o.raise(u)),s?.("page-request-coalesced","Request joined to a read in progress",()=>({version:1,url:t,loading:i.size})),u):(u=iq(a.get(t),r,n.order++),i.set(t,u),c.acquire(t),l.blocked(t)?u.state="waiting":o.push(u),u)}function lq(e,t,r,n){let{jobs:o,queue:i,emit:s}=e;o.get(t)!==r||r.state==="active"||(n(t,r),s?.("page-stream-abort","Pending request cancelled",()=>({version:1,url:t})),i.remove(r))}function uq(e,t,r){let{state:n,abort:o,catalog:i,emit:s,failures:a,queue:l}=e,{evict:c}=r,{end:u,forget:d,keep:f,forgotten:h}=oq(e,r),m=rq(e,{read:t,end:u,evict:c,forgotten:h}),{schedule:w}=Wo(m);return{subscribe:(T,L,_=1)=>{if(s?.("page-request","Page request received",()=>({version:1,url:T,priority:_})),n.disposed||o.signal.aborted)return Promise.reject(o.signal.reason??El);if(L.aborted)return Promise.reject(L.reason??El);if(!i.has(T))return Promise.reject(new Error("Unknown page "+T));let D=a.blocked(T);if(D?.state==="refused")return Promise.reject(D.error);let C=sq(e,T);if(C)return Promise.resolve(C);let j=aq(e,T,_),$=Kc(j,L,()=>lq(e,T,j,u));return w(),$},forget:d,keep:f,requeue:T=>{T.state="queued",l.push(T),w()}}}var dq=(e,t)=>e.priority<t.priority||e.priority===t.priority&&e.order<t.order;function fq(){let e=Ml(dq,(s,a)=>s.slot=a),t=e.items,r=Ml((s,a)=>dq(t[s],t[a])),n=1/0,o=s=>t[s.slot]===s,i=s=>{let a=2*s+1;a<t.length&&r.push(a),a+1<t.length&&r.push(a+1)};return W({get size(){return t.length},push(s){e.push(s),n=Math.min(n,s.bytes)},remove(s){return o(s)?(e.take(s.slot),s.slot=-1,t.length||(n=1/0),!0):!1},first(s){if(!t.length||t[0].bytes<=s)return t[0];r.clear();let a=t[0].bytes;for(let l=0;;){if(i(l),!r.size)return void(n=a);if(l=r.take(),t[l].bytes<=s)return t[l];a=Math.min(a,t[l].bytes)}},least:()=>n,raise(s){o(s)&&e.settle(s.slot)},clear(){for(let s of t)s.slot=-1;e.clear(),n=1/0}})}function pq(e,t,r,n){let o=t===0?1/0:n-r;if(e.least()>o)return;let i=e.first(o);return i&&e.remove(i),i}var uRe=()=>new Map,Yx=e=>e.range.offset+e.bytes;function hq(e,t,r,n){yo(e,t,uRe).set(r,n)}function mq(e,t,r,n){let o=e.get(t);o?.get(r)===n&&(o.delete(r),o.size||e.delete(t))}function dRe(e,t,r,n){let{file:o,offset:i}=r.range,s=[],a=[],l=t.get(o),c=e.get(o);for(let u=i,d=l?.get(u);d&&d.bytes<=n;d=l?.get(u))s.push(d),n-=d.bytes,u=d.range.offset;for(let u=Yx(r),d=c?.get(u);d&&d.bytes<=n;d=c?.get(u))a.push(d),n-=d.bytes,u=Yx(d);return{before:s,after:a}}function gq(){let e=fq(),t=new Map,r=new Map,n=i=>{i.range&&(mq(t,i.range.file,i.range.offset,i),mq(r,i.range.file,Yx(i),i))},o=i=>e.remove(i)&&(n(i),!0);return W({get size(){return e.size},push(i){e.push(i),i.range&&(hq(t,i.range.file,i.range.offset,i),hq(r,i.range.file,Yx(i),i))},remove:o,raise:e.raise,take(i,s,a){let l=pq(e,i,s,a);if(!l?.range)return l&&[l];n(l);let c=Math.max(l.bytes,a-s)-l.bytes,{before:u,after:d}=dRe(t,r,l,c),f=[...u.reverse(),l,...d];for(let h of f)h!==l&&o(h);return f},clear(){e.clear(),t.clear(),r.clear()}})}function Sq(e){let t=Ml((a,l)=>a.due<l.due,(a,l)=>a.slot=l),r,n=1/0,o=()=>{let a=t.items[0]?.due??1/0;a!==n&&(clearTimeout(r),n=a,a<1/0&&(r=setTimeout(i,Math.max(0,a-Z()))))},i=()=>{n=1/0;let a=Z();for(;t.size&&t.items[0].due<=a;)e(s(t.items[0]));o()},s=a=>(t.take(a.slot),a.slot=-1,a);return{wait(a){a.slot>=0?t.settle(a.slot):t.push(a),o()},leave(a){a.slot<0||(s(a),o())},clear(){t.clear(),o()}}}var fRe=3e4,pRe=12e4;function hRe(e,t,r){let n=t===1?"one attempt":`${t} attempts`,o=`PAGE_STREAM_FAILED: ${e} after ${n}: ${String(r)}`;return Object.assign(new E("PAGE_STREAM_FAILED",o,{key:e,attempts:t}),{cause:r})}var mRe=e=>({key:e,error:new Error,tries:0,refusals:0,passing:0,state:"over",said:!1,due:0,slot:-1});function gRe(e,t,r){let n=NH(t);if(IH(t))return{again:!0,endless:!0,wait:Math.max(n,qc(fRe,pRe,++r.passing))};let o=UR(t),i=o?0:e.retries?.()??wR,s=i<0,a=s||++r.refusals<=i;return{again:a,endless:s,wait:a?n:1/0}}function SRe(){let e={waiting:0,over:0,refused:0};return{add:()=>void e.over++,move(t,r){e[t.state]--,e[r]++,t.state=r},drop:t=>void e[t.state]--,stalled:()=>e.waiting+e.refused,reset(){e.waiting=e.over=e.refused=0}}}function wRe(e){let t=new Map;return{giveUp(r,n){let o=e?.(r);o!==void 0&&!t.has(o)&&t.set(o,{error:n,state:"refused"})},of(r){let n=e?.(r);return n===void 0?void 0:t.get(n)},clear:()=>t.clear()}}function yRe({policy:e,failures:t,objects:r,counts:n,waits:o},i,s){let a=t.get(i);a||(t.set(i,a=mRe(i)),n.add());let l=++a.tries,{again:c,endless:u,wait:d}=gRe(e,s,a),f=c&&d>0;return a.error=hRe(i,l,s),a.due=Z()+d,n.move(a,f?"waiting":c?"over":"refused"),f?o.wait(a):o.leave(a),c||r.giveUp(i,a.error),(!c||u&&!a.said)&&(a.said=!0,e.onStalled?.({key:i,cause:s,givenUp:!c})),{error:a.error,again:c,waits:f,first:l===1}}function wq(e){let t=new Map,r=wRe(e.objectOf),n=SRe(),o=Sq(a=>{n.move(a,"over"),e.ended?.(a.key)}),i={policy:e,failures:t,objects:r,counts:n,waits:o},s=(a,l)=>{let c=t.get(a);!c||l&&c.state==="waiting"||(o.leave(c),n.drop(c),t.delete(a))};return{record:(a,l)=>yRe(i,a,l),passed:a=>s(a,!1),blocked(a){let l=r.of(a);if(l)return l;let c=t.get(a);return c?.state==="over"?void 0:c},leaves:a=>s(a,!0),count:n.stalled,clear(){o.clear(),t.clear(),r.clear(),n.reset()}}}function yq(e,t,r,n){let o=0;for(let i=0;i<r;i++){let s=e[t[i]];s!==void 0&&(n(s),o++)}return o}function xq(e,t){let{pinned:r,emit:n,store:o}=e,i=u=>{$u(r,u,1),o.acquire(u)},s=u=>{r.get(u)&&($u(r,u,-1),o.release(u))},a=u=>{s(u),t()},l=(u,d,f)=>n?.("page-retain","Page pins updated",()=>({version:1,requested:u,retained:r.size,changed:!0,added:d,removed:f}));return{pin:i,unpin:a,retainRanks:u=>{if(!u.enteredCount&&!u.exitedCount)return!1;let{urls:d,entered:f,exited:h}=u,m=yq(d,h,u.exitedCount,s),w=yq(d,f,u.enteredCount,i);return t(),l(u.heldCount,w,m),!0}}}var bq=e=>({resident:e.pageCount,residentBytes:e.bytes,maxCachedBytes:e.budgetBytes});function xRe(e){let{store:t,state:r,pinned:n,emit:o,onEvict:i}=e;return{evicted(s){r.evictions++,o?.("page-cache-eviction","Page evicted from the LRU cache",()=>({version:1,url:s,reason:"capacity",drawDetached:!1,...bq(t)})),i?.(s)},blocked(){r.admissionBlocked++,o?.("page-cache-admission-blocked","No evictable page to meet the budget",()=>({version:1,...bq(t),pinned:n.size,loading:r.active}))}}}function Eq(e){let{store:t,state:r,pinned:n,jobs:o,maxTransferBytes:i}=e,s=L=>{t.drop(L);for(let _=(n.get(L)??0)+(o.has(L)?1:0);_>0;_--)t.acquire(L)},a=t.fit,l=()=>r.tableBytes+i+r.engineBytes,c=xRe(e),u,d=()=>u?.reserve(l()),f=L=>{r.tableBytes+=L,d()},h=L=>{L!==r.engineBytes&&(r.engineBytes=L,d())},m=()=>void(u=t.open(c,l())),w=()=>{for(let[L,_]of n)for(let D=_;D>0;D--)t.release(L);for(let L of o.keys())t.release(L);n.clear(),u?.leave(),u=void 0},{pin:x,unpin:b,retainRanks:T}=xq(e,a);return{evict:a,drop:s,tables:f,open:m,close:w,pin:x,unpin:b,retainRanks:T,reserve:h}}var Tq=new WeakMap;function hD(e){if(e.byteLength%4!==0)throw new Error("INVALID_INDEX_PAGE_SIZE");let t=Tq.get(e);return t||(t=new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4),Tq.set(e,t)),t}function Aq(e){let t=new Set,{schedule:r}=Wo(()=>t.forEach(i=>i.heard()));return{read:(i,s,a)=>{let l=e(i,s,a);if(!t.size||(a??1)>1)return l;let c;for(let d of t)d.landed.has(i)||((c??=[]).push(d),$u(d.reading,i,1));if(!c)return l;r();let u=d=>{for(let f of c)d?(f.landed.add(i),f.reading.delete(i)):$u(f.reading,i,-1);r()};return l.then(()=>u(!0),()=>u(!1)),l},watch:i=>{let s={reading:new Map,landed:new Set,heard:i};return t.add(s),{reads:()=>({landed:s.landed.size,asked:s.landed.size+s.reading.size}),hold:a=>(s.reading.delete(a),void s.landed.add(a)),stop:()=>void t.delete(s)}}}}var Lq=e=>!(e.range&&e.bytes===0);function bRe(e,t){e.signal.addEventListener("abort",()=>{for(let r of t.values())r.reject(e.signal.reason)},{once:!0})}function ERe(e,t,r,n){let{cache:o,signal:i,onEvict:s,onDiagnostic:a}=r,{workerCount:l=Ci,maxTransferBytes:c=V3}=r,u=new Map(e.filter(Lq).map(L=>[L.url,L])),d=new Map,f=gq(),h=new Map,m=new AbortController,w=wq({retries:r.numRetries,objectOf:r.objectOf,onStalled:r.onStalled,ended(L){let _=d.get(L);_?.state==="waiting"?n(_):u.has(L)||w.leaves(L)}});ro(m,i),bRe(m,d);let x=Number.isSafeInteger(l)?Math.max(1,l):1;if(!Number.isSafeInteger(c)||c<1)throw new Error("INVALID_PAGE_TRANSFER_BUDGET");let b={tableBytes:nq(e),order:0,active:0,activeBytes:0,requested:0,hits:0,misses:0,bytesRead:0,loaded:0,evictions:0,admissionBlocked:0,disposed:!1,engineBytes:0},T=Fx(a);return{base:t,catalog:u,store:o,jobs:d,queue:f,pinned:h,failures:w,abort:m,limit:x,maxTransferBytes:c,onEvict:s,onDiagnostic:a,state:b,emit:T}}function TRe(e,t){let{catalog:r,store:n,state:o}=e,i=a=>{let l=r.get(a);return l?.bundle&&l},s=(a,{bundle:l,bytes:c})=>a.subarray(l.offset,l.offset+c);return{inBundle:i,cachedBytes(a){let l=i(a);if(!l)return n.touch(a);let c=n.touch(l.bundle.url);return c&&s(c,l)},readBytes(a,l,c){let u=i(a);return o.requested++,u?t(u.bundle.url,l,c).then(d=>s(d,u)):t(a,l,c)}}}function Oq(e,t,r){for(let n of r)e.store.foreign(n)&&t.drop(n.url)}function ARe(e,t){let{catalog:r,store:n,emit:o}=e;o?.("page-catalogue","Streamer catalogue and configuration ready",()=>({version:1,pages:r.size,workerCount:e.limit,maxTransferBytes:e.maxTransferBytes,maxCachedBytes:n.budgetBytes,cpuBudgetBytes:n.cpuBytes,totalBytes:t.reduce((i,s)=>i+s.bytes,0)}))}function ORe(e,t,r){let{catalog:n}=e,o=0;for(let i of t)Lq(i)&&(r(i.url),n.has(i.url)||(o+=Xh(i.url)),n.set(i.url,i));return o}async function LRe(e,t,r,n){let o=[...new Set(r.filter(c=>e.catalog.has(c)))];e.emit?.("page-request-batch","Batched page request received",()=>({version:1,requested:r.length,unique:o.length}));let{signal:i,priority:s,onPage:a}=n,l=await Promise.allSettled(o.map(c=>t(c,i,s).then(u=>a?.(c,u))));for(let c of l)if(c.status==="rejected")throw c.reason}var RRe=()=>({requested:0,loaded:0,hits:0,misses:0,bytesRead:0,loading:0,queued:0,transferInFlightBytes:0,resident:0,residentBytes:0,maxCachedBytes:0,cpuBytes:0,cpuBudgetBytes:0,evictions:0,failed:0,admissionBlocked:0});function _Re(e,t){let{state:r,queue:n,store:o,failures:i}=e;return t.requested=r.requested,t.loaded=r.loaded,t.hits=r.hits,t.misses=r.misses,t.bytesRead=r.bytesRead,t.loading=r.active,t.queued=n.size,t.transferInFlightBytes=r.activeBytes,t.resident=o.pageCount,t.residentBytes=o.bytes,t.maxCachedBytes=o.budgetBytes,t.cpuBytes=r.tableBytes+r.activeBytes+r.engineBytes+o.bytes,t.cpuBudgetBytes=o.cpuBytes,t.evictions=r.evictions,t.failed=i.count(),t.admissionBlocked=r.admissionBlocked,t}function vRe(e,t){let{state:r,emit:n,store:o,failures:i,abort:s,jobs:a,queue:l}=e;r.disposed||(r.disposed=!0,n?.("page-stream-dispose","Page streamer released",()=>({version:1,resident:o.pageCount,loading:r.active,failed:i.count()})),s.abort(El),t.close(),a.clear(),l.clear(),i.clear())}function mD(e,t,r){let n=ERe(e,t,r,C=>h.requeue(C)),{catalog:o,store:i,abort:s}=n,{read:a}=eq(n),l=Eq(n),{pin:c,unpin:u,retainRanks:d,reserve:f}=l;Oq(n,l,e),l.open(),ARe(n,e);let h=uq(n,a,l),{forget:m,keep:w}=h,{read:x,watch:b}=Aq(h.subscribe),{inBundle:T,cachedBytes:L,readBytes:_}=TRe(n,x),D=RRe();return{numRetries:r.numRetries,admit(C){Oq(n,l,C);let j=ORe(n,C,w);j&&l.tables(j)},forget:C=>C.forEach(m),get(C){let j=L(C);return j?hD(j):void 0},getBytes:L,has:C=>i.page(T(C)?.bundle.url??C)!==void 0,catalogued:C=>o.has(C),loading:C=>n.jobs.has(C),failed:C=>n.failures.blocked(C)?.state==="refused",read:(C,j)=>_(C,j).then(hD),readBytes:_,readRange:i.readRange,signal:s.signal,reserve:f,pin:c,unpin:u,retainRanks:d,watch:b,request:(C,j)=>LRe(n,_,C,j),stats:()=>_Re(n,D),dispose:()=>vRe(n,l)}}var MRe={httpSource:(e,t)=>{let r=mD(t.pages,e,{cache:t.cache,workerCount:Ci});return{baseUrl:e,async read(n,o=r.signal,i){let[s,a]=await Promise.all([M.pageCodec.load(),r.readBytes(n,o,i)]);return s.checkGeometryPage(o0(),a),a},dispose:r.dispose}},createStreamer:e=>({source:e.source,workers:e.workers??Ci}),createCache:lD,decode:async e=>(await M.pageCodec.load()).decodeGeometryPage(e instanceof Uint8Array?e:new Uint8Array(e))};var e1t={animated:0,active:1,limp:2,asleep:3},t1t=256,Rq={pelvis:0,spine:1,chest:2,neck:3,head:4,upperArm:5,lowerArm:6,hand:7,thigh:8,calf:9,foot:10,tail:11,wing:12,foreLeg:13,hindLeg:14,other:15},r1t=5,n1t=62,o1t={engine:0,parent:1,mass:2,capsule:3,jointOnParent:12,jointOnPart:21,limits:30,rest:34,now:41,target:48,role:55,side:56,soft:57,was:60,flesh:61},DRe=16,PRe={balance:4,brace:5,protectHead:6,writhe:7,stagger:8,teeter:9,overWall:10,windmill:11},i1t=12,s1t=DRe-PRe.balance,a1t=3,l1t=5,c1t=-1/0,u1t=7,d1t=5,f1t={asleep:1,fallen:2,stumbling:4,lost:8,braced:16,rested:32,faceDown:64,teetering:128,overWall:256,gripping:512,kneeling:1024,leftGripping:2048,rightGripping:4096,reaching:8192,acting:16384,floating:32768,hanging:65536,pulled:131072,broken:262144,passive:524288,carried:1048576,seated:2097152,torn:4194304},p1t=10,h1t={look:0,aim:1,grab:2},m1t={left:1,right:2,on:4,local:8},g1t=14,S1t=15,_q={none:0,wound:1,brace:2,windmill:3,aim:4};var w1t=7,y1t=11,vq={lean:0,hipsLean:1,forceLean:2,crouch:3,curl:4,pedal:5,circleArms:6,shiver:7,spasm:8,flail:9,sway:10,flinch:11,dodge:12,force:13,yank:14,drag:15,lift:16,blast:17,stream:18,weightless:19,recoil:20,health:21,avoid:22,injuredArm:23,injuredLeg:24,fatigue:25,giveWay:26,friction:27,afloat:28,guard:29,clutch:30,strike:31,oneLeg:32,hop:33,staggerWalk:34,beam:35,dangle:36,mantle:37,ladder:38,wallSlide:39,wallPush:40,rise:41,crawl:42,carry:43,pushPull:44,throwObject:45,catchObject:46,swing:47,carried:48,holdHands:49,carryBody:50,grabAndThrow:51,crowd:52,swim:53,bounce:54,ride:55,belt:56},x1t={on:1,left:2,right:4,point:8,random:16,twin:32},b1t=6,E1t=6,T1t={self:1,struck:2};var bo=Object.keys(Rq),L1t=e=>bo.includes(e),Kx=["animated","active","limp"],yn={strength:{default:1,minimum:0,maximum:4},hold:{default:1,minimum:0,maximum:1},partStrength:{default:1,minimum:0,maximum:4},blend:{default:1,minimum:0,maximum:1},recover:{default:.5,minimum:0,maximum:60},pose:{default:0,minimum:-Math.PI,maximum:Math.PI}},Qh={balance:{default:1,minimum:0,maximum:1},brace:{default:1,minimum:0,maximum:1},protectHead:{default:1,minimum:0,maximum:1},writhe:{default:.5,minimum:0,maximum:1},getUp:{default:1,minimum:0,maximum:1},stagger:{default:1,minimum:0,maximum:1},teeter:{default:1,minimum:0,maximum:1},overWall:{default:1,minimum:0,maximum:1},windmill:{default:1,minimum:0,maximum:1}},Il={linear:{default:.05,minimum:0,maximum:100},angular:{default:.05,minimum:0,maximum:100},tumble:{default:0,minimum:0,maximum:100},tumbleAbove:{default:0,minimum:0,maximum:100}},qx={snap:{default:1,minimum:0,maximum:1},spin:{default:.5,minimum:0,maximum:1},guts:{default:1,minimum:0,maximum:1},knees:{default:0,minimum:0,maximum:1},look:{default:1,minimum:0,maximum:1}},gD=Object.keys(_q),Mq="wound",Zh={strength:{default:0,minimum:0,maximum:5e3},pull:{default:0,minimum:0,maximum:1}},CRe=["stumbled","lostBalance","braced","fallen","settled","gotUp","teetering","overWall","grabbed","released","kneeled","torn","struck"];var R1t={capsule:"#ff8800",joint:"#00ccff",selected:"#18a0fb",hovered:"#ffff00"},_1t={radius:{exclusiveMinimum:0},halfHeight:{minimum:0},mass:{exclusiveMinimum:0},normalHalfCone:{minimum:0,maximum:Math.PI},planeHalfCone:{minimum:0,maximum:Math.PI},twistMin:{minimum:-Math.PI,maximum:Math.PI},twistMax:{minimum:-Math.PI,maximum:Math.PI}},v1t={planeCentre:{minimum:-Math.PI,maximum:Math.PI},normalCentre:{minimum:-Math.PI,maximum:Math.PI}},M1t={margin:{exclusiveMinimum:0,maximum:Math.PI},frequency:{exclusiveMinimum:0,maximum:30},damping:{minimum:0,maximum:4}},D1t={default:1,minimum:0,maximum:1};function kl(e,t,r,n="",o=""){let{minimum:i,maximum:s}=e;if(!Number.isFinite(t)||t<i||t>s)throw new RangeError(`A ragdoll's ${n}${r}${o} is a number from ${i} to ${s}, not ${t}.`);return t}var P1t=(e,t)=>kl(yn[e],t,e),C1t=(e,t)=>kl(Qh[e],t,e,""," reflex"),I1t=(e,t)=>kl(Il[e],t,e,""," damping"),k1t=(e,t)=>kl(qx[e],t,e,"shot's "),F1t=(e,t)=>kl(Zh[e],t,e,"grip's ");var Le={height:1.75,leg:.93,arm:.77},IRe={leg:.53,arm:.44},Yt=e=>(t,r,n)=>({default:t,minimum:r,maximum:n,unit:e}),O=Yt("ratio"),Xx=Yt("count"),V=Yt("seconds"),qu=Yt("hertz"),Dq=Yt("kilogramsPerCubicMetre"),Pq=Yt("megapascals"),B=Yt("radians"),cr=Yt("radiansPerSecond"),kRe=Yt("radiansPerSecondSquared"),re=Yt("legs"),ct=Yt("arms"),Cq=Yt("heights"),tn=Yt("legsPerSecond"),js={body:{reaction:V(.15,0,2),ease:V(.25,.02,5),easeShare:O(.25,.05,.5),teleport:re(1/Le.leg,.1,100),touchGap:re(.03/Le.leg,.001,.2)},balance:{hipSpeed:cr(3,.5,20),legReach:O(.98,.9,.999),hipSide:O(.4,0,1),hipBack:O(.6,0,1),hipBend:B(.5,.05,1.5),straighten:O(.5,.05,2),leanWithin:O(.5,0,1),aloft:V(.15,0,1),letGo:V(.05,0,.5),hang:V(.1,.01,1),dropLost:O(.35,.05,1),steadySpeed:tn(.15/Le.leg,0,1/Le.leg),steadyTime:V(.5,.05,5),upright:O(.5,-.5,.99),liftOff:re(.06/Le.leg,0,.5)},teeter:{drop:re(.45,.1,10),lean:re(.12,0,.5),reach:re(.15,0,1),back:V(.3,0,3),circle:V(.2,.02,2),aside:O(.15,.02,1),turn:B(.6,.1,1.5),least:O(.1,0,1)},overWall:{reach:re(.6,.1,2),low:re(.5,.1,1),bend:B(.9,0,1.6),spin:cr(3,0,10),push:O(.3,0,2),time:V(1.2,.1,5),level:O(.5,0,1),speed:tn(.3/Le.leg,0,3/Le.leg),behind:O(.15,.01,1),tuck:B(1,0,2),tone:O(1.5,0,10),rise:V(.25,.01,2)},windmill:{gain:O(2,0,10),slow:cr(6.3,0,30),fast:cr(14,0,30),reach:ct(.85,.2,1),phase:B(.5,0,3.14),spread:B(.35,0,1.5),right:O(0,0,20),legs:O(0,0,2),tuck:B(0,0,1.6),trunkTwist:B(0,0,1.2),twistTime:V(.25,.1,1),apart:B(.5,0,1),follow:Xx(0,0,1),topple:O(1.15,0,5),still:cr(.2,0,5),accel:kRe(40,1,200),lagRate:cr(1,.1,10),arm:O(2,0,10),elbow:O(1.5,0,10),within:O(.364,0,5),tuckTilt:B(me,.1,3.14),bend:O(.3,0,1)},look:{most:B(1.2,0,3.14),speed:cr(6,.1,30),neck:O(.4,0,1),pitch:O(.7,0,1.5),behind:B(.35,0,1.5)},aim:{reach:ct(.98,.2,1),speed:cr(5,.1,30),shouldered:ct(.55,.2,1),rise:V(.35,.02,2),arm:O(2.5,0,40),elbow:O(2,0,40),wrist:O(2.5,0,40),supportArm:O(2,0,40),supportElbow:O(1.5,0,40),cone:B(1.45,.3,3.14),nearest:O(.3,.05,1),elbowBent:O(.05,0,.5),hingeFrom:B(.5,0,.9),hingeFull:B(1,1,3),farthest:O(.95,.5,1),straight:O(.98,.5,1)},grab:{reach:ct(1,.2,1.5),near:ct(.08,.01,.5),apart:ct(.12,0,1),hang:O(8,0,40),hover:O(1,0,5),letDown:O(2,.1,20),landTime:V(.25,.02,2),pullShare:O(.8,0,1),elbowOut:O(.5,0,2),parted:O(2,1,10)},shot:{snapAngle:B(.2,0,.8),snapTime:V(.05,.02,.5),spinGain:O(1,0,4),spinMost:cr(4,0,20),spinTime:V(.15,.02,2),gutsBend:B(.8,0,1.6),gutsTime:V(1.2,.1,10),kneesAfter:V(.5,0,5),kneelFold:V(.45,.1,5),kneelTime:V(1.5,0,20),kneelSit:B(.3,0,1.2),kneelStoop:B(.12,0,.6),holdWound:V(3,0,60),lookWound:V(.7,0,10),turnBack:cr(1.5,.1,20),snapFade:O(.6,0,1),snapTone:O(2,0,10),spinFooted:O(.5,0,1),gutsOnset:V(.15,.01,2),gutsFade:O(.3,.01,1),gutsSink:O(.08,0,.5),frontShot:O(.3,-1,1),armsIn:V(.2,.01,2),armsOut:V(.3,.01,2),armsYield:V(.3,.01,2),woundTone:V(4/60,0,1),backDepth:O(.5,0,2),outArm:O(2.5,0,10),outElbow:O(1,0,10),outSpeed:tn(.3/Le.leg,0,2/Le.leg),kneelTone:V(4/60,0,1),kneelAhead:B(.35,0,1.2),kneelSag:B(.15,0,1),foldSeen:O(.5,0,1),kneelPushHz:qu(1.5,.1,10),kneelPush:O(.4,0,2),kneelTilt:O(.5,-1,1),kneelLanded:tn(.5/Le.leg,0,3/Le.leg),kneelLate:V(.8,0,5),kneelKnee:O(2.5,.5,10)},getUp:{wait:V(2,0,60),blend:V(yn.recover.default,0,5),retry:O(2,1,8)},writhe:{time:V(3,0,30),angle:B(.35,0,1),period:V(2.5,.2,20),tone:O(.5,0,1),relax:O(.05,0,1),spread:O(.37,0,2),phase:B(1.7,0,6.28),restSpeed:tn(.08/Le.leg,.01/Le.leg,1/Le.leg),restSpin:cr(.8,.05,10),restTime:V(.5,.05,5),stir:O(3,1,20)},stagger:{time:V(.4,.05,5),speed:tn(2/Le.leg,.1,20),struck:O(.25,0,1),muscle:O(.8,0,1)},fall:{landStill:tn(.05/Le.leg,.01/Le.leg,.5/Le.leg),land:re(.5,0,3),reactions:O(1,0,1),tone:O(.35,0,2),braceArm:O(2.5,0,10),braceElbow:O(1,0,10),elbowSoft:O(.3,0,2),braceSoon:V(.1,0,1),protectTime:V(.8,0,3),headFirst:V(.03,0,.5),chin:B(.6,0,1.2),guardAhead:re(.12/Le.leg,0,.5),guardSide:O(.5,0,2),touch:re(.03/Le.leg,0,.2),braceLost:V(.3,0,3),guardRise:V(.15,.01,2),landSpeed:tn(.5/Le.leg,.05/Le.leg,3/Le.leg),landTime:V(.25,.02,3),longest:V(3,.5,30),fallen:O(.5,.05,1),risen:O(.25,0,1),headGuard:V(.8,.05,10)},muscle:{frequency:qu(4,.5,30),damping:O(1,0,4),hold:qu(3,.1,30),loads:O(3,.5,20),friction:O(.02,0,1),velocitySteps:Xx(20,0,64),positionSteps:Xx(4,0,64),give:B(.25,.02,2)},step:{reach:O(.8,.2,1.2),time:O(.9,.3,3),shortest:V(.2,.05,1),longest:V(.45,.1,2),lift:O(.08,0,.5),most:Xx(4,0,20),slack:re(.01/Le.leg,0,.1),hold:O(2,0,10),retarget:O(.6,0,1),climb:O(.4,.05,.5),aside:O(.25,0,2),even:O(.1,0,1),onto:O(0,0,1),sameLevel:re(.01/Le.leg,0,.1),groundSpan:re(.01/Le.leg,.001,.1)},lean:{reach:re(.12,0,.5),bend:B(.25,0,1),force:O(.06,0,1),period:V(1.5,.2,20),into:re(.3,0,.6)},crouch:{depth:re(.3,0,.6),fold:B(.35,0,1.2)},curl:{spine:B(.9,0,1.6),neck:B(.5,0,1),hips:B(1.9,0,2.4),knees:B(2.2,0,2.6),tone:O(1.5,0,4),off:re(.04/Le.leg,0,.2),apart:O(.5,0,2)},pedal:{rate:cr(8,.5,30),hip:B(.9,0,1.6),knee:B(1.3,0,2.2),tone:O(1.5,0,4),lead:B(Q/6,0,Math.PI)},circle:{rate:cr(9,.5,30),reach:ct(.85,.2,1),spread:B(.35,0,1.5),phase:B(3.14,0,3.14),arm:O(2,0,4),elbow:O(1.5,0,4)},shiver:{angle:B(.08,0,.3),rate:cr(60,10,200),tone:O(3,0,4),spread:O(.23,0,1),phase:B(1.7,0,Q)},spasm:{angle:B(.35,0,1.2),rate:cr(90,10,300),tone:O(3,0,4),arch:B(.3,0,1),spread:O(.31,0,1),phase:B(2.3,0,Q)},flail:{beat:V(.22,.05,2),tone:O(2.5,0,4),run:O(.1,0,1),roll:B(.6,0,1.2),off:re(.04/Le.leg,0,.2),apart:O(.5,0,1)},sway:{reach:re(.07,0,.3),period:V(2.6,.5,20),droop:B(.45,0,1),slack:O(.6,0,1),slow:O(2,1,10),across:O(.62,.1,3),phase:B(1.3,0,Q)},flinch:{time:V(.7,.1,5),bend:B(.3,0,1),duck:re(.08,0,.4)},dodge:{time:V(.7,.1,3),speed:tn(1.1,0,5),push:V(.18,.02,1),bend:B(.45,0,1.2),duck:re(.15,0,.5)},pull:{force:O(1.6,0,10),time:V(.25,.02,2),give:O(.7,0,1),lift:Cq(.25,0,5),hertz:qu(6,1,60),ease:O(.25,.01,1)},blast:{reach:Cq(2,.1,50),lift:O(.35,0,1),stun:V(1.2,0,20),weak:O(.8,0,1)},stream:{density:Dq(1.2,0,2e3)},weightless:{tone:O(.35,0,1),arms:B(.6,0,1.5),knees:B(.5,0,1.5),floats:O(.5,.05,1),reach:O(.7,.2,1),hips:O(.5,0,1),apart:O(.2,0,1),elbows:O(.3,0,1)},recoil:{give:O(.6,0,1),climb:O(.3,0,2),time:V(.3,.05,2),far:O(.4,0,1)},health:{floor:O(.35,0,1),slow:O(3,1,10),sag:re(.1,0,.4)},avoid:{margin:ct(.08,0,.5)},injured:{weak:O(.85,0,1),lean:re(.06,0,.3),spared:O(.5,0,1)},fatigue:{weak:O(.6,0,1),sag:re(.12,0,.4),stoop:B(.3,0,1)},water:{pull:O(.5,0,2),wade:re(0,0,.5)},strike:{time:V(.4,.1,3),tone:O(6,0,40),lean:re(.06,0,.5)},fracture:{strength:Pq(0,0,1e3),give:B(1,0,Math.PI),time:V(.05,0,1),density:Dq(0,0,3e3)},pose:{speed:cr(3,.1,30)},oneLeg:{hip:B(.35,0,1.6),knee:B(1.4,0,2.4),arms:B(.9,0,1.6),within:O(.5,0,2)},hop:{height:re(.08,0,.5),reach:re(.15,0,1.5),crouch:V(.2,.05,1),depth:re(.1,0,.4),tuck:re(.12,0,.5)},gait:{lead:re(.5,0,1.5),swing:O(1.3,.5,3),lift:O(.8,0,2),base:O(1.6,0,3),sway:re(.15,0,.5),irregular:O(.4,0,1),slow:O(2,1,10),bow:B(.1,0,1),limp:O(.5,0,1)},beam:{arms:B(1.4,0,1.6)},slip:{crouch:re(.06,0,.3),arms:B(.8,0,1.6),quick:O(.7,.3,1),lift:O(.5,0,1),calm:V(2,.1,20),sweep:O(0,0,1),felt:O(0,0,1),slope:O(0,0,1)},trip:{lag:re(.1,.02,.5),lower:V(.1,.03,.5),quick:O(.75,.3,1),lift:O(1.8,1,4),felt:O(0,0,1)},dangle:{tone:O(1,0,4),hips:B(1.4,0,2),knees:B(1.5,0,2.4),swing:B(.05,.02,1.5),sharp:O(.25,.05,1)},mantle:{pull:V(1.2,.3,5),press:V(.8,.2,5),lean:B(.6,0,1.4),reach:re(.25,.05,1),give:V(1.5,.2,20),under:O(.3,0,1),elbow:O(.3,0,1),rises:O(.0125,.001,.2),top:O(.3,.05,1)},grip:{load:O(0,0,10),tire:qu(0,0,1),light:O(.15,0,.45),rest:V(60,1,600)},ladder:{pace:V(.5,.15,5),reach:ct(.6,0,1),apart:ct(.5,0,1.5),stance:re(.25,0,1),stand:O(.92,.5,1),close:re(.3,.05,1),lift:re(.08,0,.5),strength:O(.8,0,4),ball:O(.5,0,1),over:O(.7,.1,.9),paces:O(3,1,10),reactions:O(6,0,20)},roll:{skill:O(0,0,1),absorb:re(.45,.1,.8),brake:O(3.5,1.5,8),run:tn(1.6,0,10),upright:B(.5,0,1.05),up:tn(9,0,30),ready:V(.3,.05,1),twist:B(.4,0,1),time:V(1.5,.3,5),rise:V(.5,.1,3),way:tn(.2/Le.leg,0,2/Le.leg)},wallSlide:{reach:re(.5,.1,2),give:O(.25,0,1),time:V(1.2,.2,5),hips:B(1.4,0,2),knees:B(1.6,0,2.4),tone:O(1.5,0,4),chin:B(.3,0,1),driven:tn(.35,.05,2)},wallPush:{reach:ct(1.5,.5,4),strength:O(.3,0,1),give:ct(.35,.05,.8),turn:B(1,0,1.4)},rise:{strength:O(.4,0,1.5),pace:V(.5,.15,3),give:V(1.5,.3,10),twist:B(.6,0,1.2),kneel:B(1.6,.8,2.2),lunge:B(1.9,1,2.4),prone:B(1.05,.3,1.5),arms:ct(.6,.3,1),hips:re(.35,.15,.7),foot:re(.12,0,.4),upright:B(.6,.2,1),hand:ct(.15,0,.5)},crawl:{reach:O(.7,.2,1),cadence:V(.9,.3,3),strength:O(.5,0,2),knee:B(1.2,0,2),reaching:O(.4,.1,.9),out:B(.6,0,1.2)},carry:{lift:V(1,.2,5),heavy:O(.1,.01,1),squat:re(.4,0,.6),stoop:B(1.1,0,1.6),reach:ct(.8,.3,1),gap:ct(.03,0,.5),strain:V(1.5,0,10),lag:ct(.065,.01,.3),hold:O(.25,0,.5),strainShare:O(.9,.1,1),setDown:O(.25,0,1),setLongest:O(2,.5,10),walk:O(1,.3,3),near:O(.5,0,.95)},pushPull:{strength:O(.6,0,2)},throwing:{windUp:V(.4,.1,2),follow:V(.4,.1,2),arc:B(.6,0,1.4),twist:B(.6,0,1.2),lean:re(.08,0,.3),oneHand:O(.04,0,.3),tone:O(4,1,20),draw:ct(1.2,.3,2),overAhead:O(.3,0,1),overUp:O(.4,-.5,1),passAhead:O(.6,0,1),passDown:O(.1,-.5,.5),passDraw:O(.5,.1,1),arcOver:B(.15,0,.6),followOn:O(.3,0,1),followDown:O(.6,0,1.5),twistLead:O(.8,.3,1),elbowFrom:O(.3,0,.9),wristFrom:O(.6,0,.95),driveMost:V(.5,.1,2)},catching:{reach:ct(.95,.5,1),give:ct(.4,0,1),absorb:V(.25,.05,1),tone:O(3,1,20),inside:O(.5,0,2),ahead:V(1.5,.3,5),speed:cr(10,.1,40),rise:V(.15,.02,2)},swing:{windUp:V(.35,.1,2),back:B(1.8,.5,3),through:B(1.5,0,3),tilt:B(.4,0,1.6),twist:B(.7,0,1.2),give:O(.5,0,1),recover:V(.4,.1,2),struck:O(.5,.1,.9),blowFrom:O(.5,0,1),ahead:B(me,.3,3)},carried:{limp:O(.05,0,.5),tone:O(1,0,4),hips:B(.9,0,2),knees:B(1.2,0,2.4),hug:O(.3,0,1),moving:tn(.1,0,2),stand:O(.5,0,1),heldUp:O(.5,.1,1),standsOver:O(.5,0,1)},holdHands:{reach:O(.8,.3,1),tone:O(1,0,4)},carryBody:{lift:O(.8,0,2),pull:O(.6,0,1),bow:B(.4,0,1.2)},grabThrow:{seize:V(1.5,.3,5),pull:O(.5,0,1),drive:V(.45,.15,2),along:B(.5,.1,1.5),releaseFrom:O(.5,0,1)},crowd:{guard:O(.45,.2,.9),turn:B(.6,0,1.2),felt:re(.05,.005,.5),shuffle:O(.7,.3,1.5),lift:O(.5,0,1.5),press:re(.3,0,1)},bullet:{give:O(0,0,1),weak:V(1,0,30),recover:V(2,.05,30),bone:O(1,.25,2),adds:O(0,0,1),wear:O(0,0,1),flinch:O(0,0,1)},bump:{felt:O(1,0,4),share:O(0,0,1)},swim:{skill:O(0,0,1),stroke:V(1.4,.4,4),power:O(.3,.1,.5),reach:ct(.85,.2,1),pull:ct(.35,0,1),sweep:ct(.3,0,1),hips:B(1,0,2),knees:B(1.6,0,2.4),strength:O(.25,0,1),climb:B(.35,0,1.2),lag:O(.5,0,1)},bounce:{pump:B(.6,0,1.4),strength:O(1.5,0,4),tone:O(1.5,0,4),arms:B(1.2,0,2.6),hips:O(.5,0,2)},ride:{seat:re(.35,.05,2),sit:V(2,.2,10),relaxed:O(.4,0,1),tense:O(2,1,4),hips:B(1.4,0,2.2),knees:B(1.4,0,2.4)},belt:{slack:re(.03,0,.3),hertz:qu(6,.5,30),damping:O(.5,0,2),strength:O(10,.5,100)},tear:{strength:Pq(0,0,100)},giveWay:{fall:O(.5,0,1)}},Jh=js,SD=Object.entries(Jh).flatMap(([e,t])=>Object.entries(t).map(([r,{unit:n}])=>({group:e,name:r,unit:n}))),Iq=SD.map(({group:e,name:t})=>`${e}.${t}`),FRe=Iq.length;function NRe(e){let t=e.indexOf(".");return Jh[e.slice(0,t)][e.slice(t+1)]}function BRe(){let e={};for(let[t,r]of Object.entries(Jh)){let n=e[t]={};for(let[o,i]of Object.entries(r))n[o]=i.default}return e}function*URe(e){for(let[t,r]of Object.entries(e)){let n=Object.hasOwn(Jh,t)?Jh[t]:null;if(!n||!r||typeof r!="object"){yield{group:t,name:null,value:r,spec:null};continue}for(let[o,i]of Object.entries(r))yield{group:t,name:o,value:i,spec:Object.hasOwn(n,o)?n[o]:null}}}function VRe(e,t){let r=e,n=!1;for(let{group:o,name:i,value:s,spec:a}of URe(t)){if(!a||typeof s!="number"||!Number.isFinite(s))continue;let l=k(s,a.minimum,a.maximum);r[o][i]!==l&&(r[o][i]=l,n=!0)}return n}function kq(e,t){return e==="legs"||e==="legsPerSecond"?t.leg:e==="arms"?t.arm:e==="heights"?t.height:1}function GRe(e,t,r=new Float32Array(FRe)){let n=e;for(let o=0;o<SD.length;o++){let{group:i,name:s,unit:a}=SD[o];r[o]=n[i][s]*kq(a,t)}return r}var W1t=e=>"_engine"in e,Fq=["limits","spring","motor"],Bq={fixed:[],point:[],hinge:Fq,slider:Fq,distance:["limits","spring"],cone:["limits"],swingTwist:["limits","motor"],sixDof:["axes","spring","motor"],path:["path","loop","follow","motor"],pulley:["over","ratio","limits"],gear:["axisB","ratio"],rackAndPinion:["axisB","ratio"]},HRe=[...new Set(Object.values(Bq).flat())],Nq=(e,t)=>{if(!Bq[e].includes(t))throw new RangeError(`A ${e} joint has no ${t}.`)};function WRe(e,t,r){if(!t&&(e==="pulley"||e==="gear"||e==="rackAndPinion"))throw new RangeError(`A ${e} joint connects two bodies.`);if(e==="path"&&(r.path?.length??0)<2)throw new RangeError("A path joint needs a path of two points or more.");if(e==="pulley"&&!r.over)throw new RangeError("A pulley joint needs its wheels.")}var Qx=class{_motor;_broken=!1;handlers=fe();_host=null;_id=-1;_frames=null;kind;a;b;options;constructor(t,r,n,o={}){if(this.kind=t,this.a=r,this.b=n,this.options=o,r===n)throw new RangeError("A joint connects two different bodies.");for(let i of HRe)o[i]!=null&&Nq(t,i);WRe(t,n,o),this._motor=o.motor??null}get motor(){return this._motor}set motor(t){t&&Nq(this.kind,"motor"),this._motor=t,this._host?.motor(this)}get broken(){return this._broken}on(t,r){return this.handlers.subscribe(r)}_break(t){this._broken||(this._broken=!0,this.handlers.tell(t))}},zn=e=>(t,r,n)=>new Qx(e,t,r,n),zRe={fixed:zn("fixed"),point:zn("point"),hinge:zn("hinge"),slider:zn("slider"),distance:zn("distance"),cone:zn("cone"),swingTwist:zn("swingTwist"),sixDof:zn("sixDof"),path:zn("path"),pulley:zn("pulley"),gear:zn("gear"),rackAndPinion:zn("rackAndPinion")};var $1t={way:["toward","at","object","random"],point:["at","object"],push:["toward","at","object"],up:["toward","at","object"],object:["object"],ragdoll:["object"],part:["part"],twin:["twin"],side:["side"]};var ur=(e,[t,r,n],o="ratio")=>({means:e,default:t,minimum:r,maximum:n,unit:o}),Xu=(e,t,r)=>ur(e,[t,0,r],"legsPerSecond"),wD={lean:{summary:"Leans its weight and bends its trunk a way while it keeps its feet: toward a point, an object, along a way, or a way of its own that wanders.",lasts:"held",takes:["way"]},hipsLean:{summary:"Pushes its hips a way while its trunk bends back over its feet: a hip check, a sway of the pelvis.",lasts:"held",takes:["way"]},forceLean:{summary:"Pushes its trunk a way by a share of its weight, which its ankles and hips hold or its steps follow: a body leaned on, drawn along.",lasts:"held",takes:["way"]},crouch:{summary:"Lowers its pelvis and folds its trunk over its knees, on its feet.",lasts:"held",takes:[]},curl:{summary:"Curls up off its feet \u2014 spine, neck, hips and knees folded \u2014, letting itself down first when it stands.",lasts:"held",takes:[],value:ur("how far its hands leave its chest for its knees",[0,0,1])},pedal:{summary:"Pedals its legs while it is off its feet, a half turn apart.",lasts:"held",takes:["side"],value:ur("its rate, in multiples of `pedal.rate`",[1,-4,4])},circleArms:{summary:"Circles its free arms about its shoulders, whatever else it does.",lasts:"held",takes:["side"],value:ur("its rate, in multiples of `circle.rate`: negative, the other way",[1,-4,4])},shiver:{summary:"Trembles in every joint, its muscles tense: cold, fear.",lasts:"held",takes:[]},spasm:{summary:"Seizes every joint in hard, fast jerks, its back arched, and falls where it stands: a shock.",lasts:"held",takes:[]},flail:{summary:"Beats its own body with its hands, driven about on its feet, rolling once it lies: on fire.",lasts:"held",takes:[]},sway:{summary:"Wanders on its feet, its head hanging, its arms slack and its answers slow: dazed, drunk.",lasts:"held",takes:[]},flinch:{summary:"Raises its guard toward what comes at it, bends away and ducks, for a moment.",lasts:"once",takes:["push"]},dodge:{summary:"Throws itself the way asked off its planted feet, bent that way and ducked, its steps catching it.",lasts:"once",takes:["push"]},force:{summary:"Pushes a part \u2014 its twin too, when asked \u2014 by a share of its weight, along a way or toward a point: on its feet, it leans into the push.",lasts:"held",takes:["push","part","twin"],value:ur("the force, in multiples of its weight",[.3,0,20])},yank:{summary:"Jerks a part \u2014 its twin too, when asked \u2014 toward a point or along a way for a moment, the limb giving.",lasts:"once",takes:["push","part","twin"],value:Xu("the speed the part is drawn at",1,40)},drag:{summary:"Draws a part \u2014 its twin too, when asked: both wrists, both ankles \u2014 toward a point or along a way by a rope it reels in: the body follows, on its feet or along the ground.",lasts:"held",takes:["push","part","twin"],value:Xu("the speed the part is drawn at",1.5,40)},lift:{summary:"Lifts it by a part \u2014 its twin too, when asked \u2014 toward a point or along a way, up by `pull.lift` with neither: off its feet it hangs, neither landed nor braced; at no speed its rope holds the part where it is, a body pinned.",lasts:"held",takes:["up","part","twin"],value:Xu("the speed the part is lifted at",1,40)},blast:{summary:"Throws every part away from a point, upward too, weaker the farther, its muscles stunned and its head guarded.",lasts:"once",takes:["point"],value:Xu("the speed a part at the point is thrown at",6,60)},stream:{summary:"Pushes each part as a stream of air or water flowing past it does: by its side\u2019s area and the square of the flow\u2019s speed.",lasts:"held",takes:["push"],value:Xu("the flow\u2019s speed",12,200)},weightless:{summary:"Takes its weight off by its weight\u2019s share: from half, it floats \u2014 no balance, no landing \u2014, its limbs in the posture nothing weighs on.",lasts:"held",takes:[]},recoil:{summary:"Kicks what a hand fires \u2014 its weapon at the muzzle, else the hand \u2014 back along the line of fire and up: an aiming arm gives, its line climbs, and both come back.",lasts:"once",takes:["side"],value:Xu("the speed the kick would give the whole body",.15,6)},health:{summary:"Weakens every muscle and hold, slows its answers and sags its stance as its health ebbs.",lasts:"held",takes:[],value:ur("its health, 1 whole",[.5,0,1])},avoid:{summary:"Keeps its reaching hands out of its own trunk and head.",lasts:"held",takes:[]},injuredArm:{summary:"Spares an arm: its muscles weak, no reflex posing it.",lasts:"held",takes:["side"]},injuredLeg:{summary:"Spares a leg: its muscles weak, its weight on the other.",lasts:"held",takes:["side"]},fatigue:{summary:"Wears it out over a time: weaker, lower, stooped.",lasts:"held",takes:[],value:ur("how long it takes to be worn out",[4,0,600],"seconds")},giveWay:{summary:"Lets every muscle go over a time: its legs give, it falls and neither braces nor writhes \u2014 knocked out, dead.",lasts:"held",takes:[],value:ur("how long its muscles take to go",[.4,0,60],"seconds")},friction:{summary:"Scales the friction of every part, its share of what it rubs against: a greased body, one caked in mud.",lasts:"held",takes:[],value:ur("the scale of its parts\u2019 friction",[.2,0,10])},afloat:{summary:"Behaves as a body in the world\u2019s water (`world.physics.water`), which alone bears each part up by the water it displaces, slows it and, mud, holds it: enough of it under (`weightless.floats` of its mass), it floats, no balance and no landing; on its feet in it, it wades (`water.wade`). With no water there, nothing bears it.",lasts:"held",takes:[]},guard:{summary:"Holds its guard up toward a point, an object or a way, its forearms between its head and what comes: a block, a parry.",lasts:"held",takes:["push"]},clutch:{summary:"Brings its free hands to the front of a part of its own body \u2014 its chest with none named \u2014 and holds them there: its heart, its throat, a wound.",lasts:"held",takes:["part","side"]},strike:{summary:"Throws its free hands \u2014 one, when a side is asked \u2014 at a point, an object or along a way, its weight behind them, and brings them back: a punch, a shove with both hands.",lasts:"once",takes:["push","side"]},oneLeg:{summary:"Stands on one leg \u2014 the side named, else the one its weight is over \u2014, the other held up: its weight brought over the foot first, its arms spread; a shove past what its ankle and hips hold puts the foot down, lifted again once it is steady; let go of, it stands on both again.",lasts:"held",takes:["side"]},hop:{summary:"Hops again and again, in place or along a way, on both feet or on the side named, the other held up: crouched, pushed off by its legs, its legs gathered in the air, landed on giving knees.",lasts:"held",takes:["side","way"]},staggerWalk:{summary:"Walks along a way with no clip, its gait its tuning\u2019s (`gait`): its weight led ahead and its steps catching it \u2014 a drunk\u2019s, a worn-out body\u2019s; on a leg weaker than the other (`injuredLeg`), a limp.",lasts:"held",takes:["way"]},beam:{summary:"Balances as on a narrow beam: its feet brought in line, heel to toe, its steps landing in line, its arms spread, its support what stands under its soles.",lasts:"held",takes:[]},dangle:{summary:"Hanging by its hands from what holds them \u2014 a bar, a hook, what carries them \u2014, stills its swing as a person does: its legs drawn up while it swings down, let down while it swings up, its body as tense as `dangle.tone`; just off its feet, its legs kick.",lasts:"held",takes:[],value:ur("how long its legs kick once its feet have left the ground",[0,0,5],"seconds")},mantle:{summary:"Hanging by both hands from a ledge, pulls itself up \u2014 its arms pulling its chest to its hands as strongly as `grab.hang` gives, then pressing over them \u2014, sets a leg on the top \u2014 the side named, else the right \u2014, then the other, and stands up there; too weak for its weight, it rises short, gives up and hangs.",lasts:"held",takes:["side"]},ladder:{summary:"Climbs the ladder whose foot is the point given \u2014 a point under its lowest rung\u2019s middle \u2014, its rungs found as it goes: one limb at a time onto the next rung, three on the rungs, its trunk close; up it stops at the top, down it steps off onto the ground.",lasts:"held",takes:["point"],value:ur("how fast it climbs, a multiple of `ladder.pace`\u2019s: negative, down; 0 holds on",[1,-2,2])},wallSlide:{summary:"Driven back against a wall, takes it with its back and lets its legs give under it: it slides down the wall \u2014 its back on it, its head kept off it \u2014 and sits there, its knees up, or its legs out where its feet slip.",lasts:"held",takes:[]},wallPush:{summary:"Staggering toward a wall, puts its hands on it a reaction later, its elbows giving, stops itself on them and pushes back onto its feet; met faster than its arms take, it takes the wall on its forearms, its head turned away.",lasts:"held",takes:[]},rise:{summary:"Lying, gets up with no clip by its own muscles against the ground \u2014 over onto its front, toward the side named, else the side it lies lower on, up on its arms, its knees under it, then up off all fours by its balance, its trunk coming up with its hips \u2014 on feet: with none it stays on all fours till it lies back \u2014, and stands, as `getUp` does with no clip for the side it lies on; too weak for it, it lies back, and tries no more while it lies.",lasts:"held",takes:["side"]},crawl:{summary:"Lying, a limp or active body crawls along a way on its front \u2014 turned onto it first \u2014: an arm reaching and pulling on the ground as the other side\u2019s knee pushes, its trunk low; a hurt limb drags.",lasts:"held",takes:["way"]},carry:{summary:"Takes up the object given in both hands \u2014 walked to, come down to from a crouch for a heavy one or stooped for a light one \u2014, lifts it with its legs and back and holds it before its chest at the height asked, carried as it walks; at a height of none it sets it down and lets go; too heavy, it strains, then lets go; let go of, it drops it; thrown (`throwObject`), the throw takes it over, the carry held on with nothing to carry until let go of.",lasts:"held",takes:["object"],value:ur("how high it holds the object over its soles: 0 sets it down",[.5,0,.8],"heights")},pushPull:{summary:"Puts both hands on the object given \u2014 on its near face to push, at its top to pull \u2014 and walks it along, away from itself or back toward itself, leaning into what it takes: a crate that will not move, it strains on, its feet sliding only past their grip.",lasts:"held",takes:["object"],value:ur("how fast it walks the object, its legs a second: positive pushes it away, negative pulls it",[.3,-1,1],"legsPerSecond")},throwObject:{summary:"Throws what its hands hold at a point, an object or along a way \u2014 one hand for a light thing, both for a heavy one \u2014: drawn back, its trunk turned and its weight back, driven through by its joints alone, let go once what it throws goes as fast as the point asks \u2014 or at its release point, as fast as its arm gave it \u2014, and followed through.",lasts:"once",takes:["push","side"]},catchObject:{summary:"Watches the object given come and, a reaction later, brings its hands to where it comes within reach, closes them on it as it strikes them and gives with it toward its chest; too fast or too heavy, it is knocked back or drops it.",lasts:"held",takes:["object"]},swing:{summary:"Swings what a hand holds \u2014 a bat, a sword \u2014 at a point, an object or along a way: drawn back, its trunk and hips leading, its arm driven through the blow by its joints alone and on through; a blow that lands stops it and jars its arm \u2014 held by its grip, its grip past what it holds.",lasts:"once",takes:["push","side"]},carried:{summary:"Borne by what carries it \u2014 another\u2019s arms, a strap, a stretcher that moves \u2014 as awake as its value: limp, its head and limbs hang and swing with each step, damped; awake, it holds its head, gathers its limbs and holds on round what carries it. It fights for no balance off its feet and is not fallen while borne; set down, it lies, or, awake and set on its feet, stands.",lasts:"held",takes:[],value:ur("how awake it is: 0 limp, 1 holding on",[1,0,1])},holdHands:{summary:"Takes the part given of another ragdoll \u2014 its hand, its wrist, an arm, a shoulder \u2014 with the hand named, else the nearer, and keeps hold: both bodies feel the pull through the joined hands, its arm giving as an arm does; a partner falling hangs on it as far as its footing holds, and past what its hand holds (`RAGDOLL_TUNING.grip`, as the page sets it) it lets go.",lasts:"held",takes:["ragdoll","point","side"]},carryBody:{summary:"Takes another ragdoll that is down by the part given \u2014 a hand or forearm: its wrists; a foot or calf: its ankles; its pelvis or a thigh: up in its arms when its strength allows; else under its arms \u2014 and walks with it: lifted, ahead; dragged, backwards, leaning away from it; too heavy, it strains on.",lasts:"held",takes:["ragdoll"],value:ur("how fast it walks with it, its legs a second",[.3,0,1],"legsPerSecond")},grabAndThrow:{summary:"Seizes another ragdoll by its collar and belt, pulls it off its feet as its hips turn back, then turns through with a step toward the side named \u2014 else its right \u2014 and lets go as the other\u2019s momentum goes that way: a heavier or braced body is only shoved, or drags it down.",lasts:"once",takes:["ragdoll","side"]},crowd:{summary:"Pressed in a crowd: its forearms held before its chest, a shoulder \u2014 the side named, else the nearer \u2014 turned into the press, small quick steps with the flow \u2014 along a way asked, it presses itself \u2014; down, it guards its head.",lasts:"held",takes:["side","way"]},swim:{summary:"Afloat in the world\u2019s water (`world.physics.water`) \u2014 enough of it under, it floats \u2014, swims along a way \u2014 up with none: it treads water, its head up to breathe \u2014: its arms pulling and its legs kicking, the water\u2019s drag on its own limbs carrying it, as well as it has learnt (`swim.skill`); one that cannot swim, or too weak or worn out, pushes nothing on: it struggles where the water leaves it, and in water it is heavier than it sinks, where a trained swimmer\u2019s strokes hold it up.",lasts:"held",takes:["up"]},bounce:{summary:"Bounces on what gives under its feet \u2014 a trampoline\u2019s bed \u2014 as well as it has learnt to land (`roll.skill`): upright, its arms out, its legs driving the bed at the bottom to go higher, giving to it to come lower, landed on its feet by the landing law; a landing missed, it falls; at a height of none, it lands and stands on it.",lasts:"held",takes:[],value:ur("how high it bounces, its centre\u2019s rise over where it leaves the bed: 0 lands and stands",[.15,0,1],"heights")},ride:{summary:"Rides seated in what it is about \u2014 a vehicle, any body \u2014, its seat the point given on it (its origin with none): it lets itself down into it, its hips and knees bent and its hands on its thighs, borne off its feet \u2014 no balance, never fallen while seated \u2014, shaken by what moves its seat, as relaxed or braced as its value; thrown out of its seat past `ride.seat`, its fall\u2019s own reflexes take it.",lasts:"held",takes:["point","object"],value:ur("how braced it rides: 0 unaware, its muscles relaxed; 1 braced, tense",[0,0,1])},belt:{summary:"Straps its pelvis and its chest to what it is about \u2014 the seat it rides in, a stretcher; the world at the point given \u2014, as a lap and a shoulder belt hold a passenger: each strap as long as it lies plus its slack, stretching past it as webbing does and paying out past its strength, holding the body back and never pushing it.",lasts:"held",takes:["point","object"]}},jRe=Object.keys(vq);var $Re=["pose","balance","fall","reaction","shot","arms","attach","force","condition","config"],YRe=["standing","stumbling","teetering","lostBalance","braced","kneeling","overWall","fallen","faceDown","settled","gripping","gripLeft","gripRight","acting","floating","hanging","pulled","broken","passive","carried","seated","torn","animated"],KRe=["standing","lying","gripping","aiming","falling","hanging","carrying","riding","any"],Zu=["front","back","left","right"],qRe=["fall","recover","hit","shot","lookAt","aim","weapon","grab","release","resetTuning"],XRe=["mode","strength","hold","blend","partStrength","damping","limits","softLimits","pose","collision"],QRe=["reflex","shot","call","setting","joint","act","tuning"],ZRe=["floor","ledge","wall","anchor","object","weapon","drop","stairs","bar","water","beam","creature","ice","mover","slope","step","platform","ladder","crate","character","mud","trampoline","vehicle"],JRe=["none","shove","tip","hit","shot","throw"],ht=(e,t="ratio")=>({...e,unit:t}),ae=(e,t)=>({default:e,options:t}),Er=(e,t,r)=>({default:{right:e,up:t,front:r},unit:"heights"}),tb=e=>ht({default:e,minimum:0,maximum:6},"legsPerSecond"),rn=e=>({weight:ht(Qh[e])}),rb=(e,t="back")=>({role:ae(e,bo),side:ae(1,[-1,1]),toward:ae(t,Zu),speed:tb(.13)}),em=(e,t)=>({weight:ht({...qx[e],default:1}),...rb(t)}),e_e=[{kind:"floor"}],t_e={kind:"none"},tm=Object.fromEntries(Object.keys(Qh).map(e=>[e,0])),r_e=.166,Zx={kind:"tip",toward:"front",past:r_e},yD={kind:"shove",toward:"front",speed:.65},Eo={kind:"shove",toward:"front",speed:2.9},Ee={weight:ht({default:1,minimum:0,maximum:1})},br=e=>({...Ee,toward:ae(e,Zu)}),xD={...Ee,at:Er(0,.6,1)},To=(e,t=1)=>({role:ae(e,bo),side:ae(t,[-1,1])});function Wq(e,t){let{default:r,minimum:n,maximum:o,unit:i}=wD[e].value;return{default:t??r,minimum:n,maximum:o,unit:i}}var ke={getUp:0},Uq={load:.9},Vq={hands:ae(0,[-1,0,1]),strength:ht(Zh.strength,"newtons"),pull:ht(Zh.pull)};function _t(e,t){let r=js[e],n=t;return Object.fromEntries(Object.entries(r).map(([o,i])=>[o,{...i,default:n[o]??i.default}]))}function ne(e,t,r,n,o={}){return{id:e,family:t,summary:r,trigger:n,params:{},tuning:[],from:"standing",needs:e_e,reflexes:{},stimulus:t_e,events:[],ends:"standing",within:2,...o}}function kr(e,t,r,n,{tuning:o=[],...i}={}){return ne(e,t,n,{kind:"tuning",group:r},{params:js[r],tuning:[r,...o],...i})}function H(e,t,r,n,{value:o,random:i,object:s,with:a,params:l=Ee,...c}={}){let u={...o&&{value:o.param},...i&&{random:i},...s&&{object:s},...a&&{with:a}},d=o?{[o.param]:Wq(r,o.initial)}:{};return ne(e,t,n,{kind:"act",act:r,...u},{params:{...l,...d},...c})}var Jx=[{kind:"floor"},{kind:"object"}],bD=[{kind:"floor"},{kind:"drop",height:1}],eb=_t("roll",{skill:1}),ED=_t("windmill",{right:4,legs:.5,tuck:.6,trunkTwist:.7,follow:1}),Gq=[{kind:"floor"},{kind:"bar",up:1.12,front:.1}],Qu=(e,t,r,n=0)=>[{kind:"floor"},{kind:"crate",mass:e,size:t,ahead:r,high:n}],Hq=[{kind:"floor"},{kind:"vehicle",speed:12,ahead:40}],zq=[ne("activePose","pose","Drives every part toward the animation by its muscles: it looks animated, gives under what strikes it and comes back.",{kind:"setting",path:"mode"},{params:{mode:ae("active",Kx)},from:"any",reflexes:tm,stimulus:{kind:"hit",role:"lowerArm",side:-1,toward:"front",speed:.33}}),ne("animPose","pose","Puts the parts of a role, and those hanging from them, exactly on the animation while the rest is simulated: animated legs under a body that flinches.",{kind:"setting",path:"blend"},{params:{role:ae("thigh",bo),blend:ht({...yn.blend,default:0})},reflexes:tm,stimulus:{kind:"hit",role:"chest",toward:"back",speed:.5}}),ne("relax","pose","Lets go of every muscle: it drops as a plain ragdoll, its fall\u2019s reflexes still its own.",{kind:"call",method:"fall"},{events:["lostBalance","fallen","settled"],ends:"settled",within:6}),ne("recover","pose","Blends the pose it lies in back into the animation over a time, where its model stands.",{kind:"call",method:"recover"},{params:{seconds:ht(yn.recover,"seconds")},from:"lying",ends:"animated",within:1}),ne("stop","pose","Gives the body back to the animation at once: every part on its pose, still, nothing simulated.",{kind:"setting",path:"mode"},{params:{mode:ae("animated",Kx)},from:"any",ends:"animated",within:.5}),ne("strength","config","Scales every muscle at once: weak, it sags and sways under a hit; strong, it barely gives.",{kind:"setting",path:"strength"},{params:{strength:ht(yn.strength)},reflexes:tm,stimulus:{kind:"hit",role:"chest",toward:"back",speed:.5},within:3}),ne("stayUpright","balance","Holds every part at the animation\u2019s place in the world: pushed, it is drawn back to where it stood.",{kind:"setting",path:"hold"},{params:{hold:ht(yn.hold)},reflexes:tm,stimulus:yD,within:3}),ne("damping","config","Slows each part\u2019s speed and spin, and the whole body\u2019s tumbling past a rate: a fall that neither whips nor cartwheels on.",{kind:"setting",path:"damping"},{params:{linear:ht(Il.linear),angular:ht(Il.angular),tumble:ht({...Il.tumble,default:2}),tumbleAbove:ht({...Il.tumbleAbove,default:2})},reflexes:ke,stimulus:Eo,events:["lostBalance","fallen"],ends:"fallen",within:3}),ne("limits","config","How far each joint swings and twists is its asset\u2019s \u2014 its cones, their middles, its twist range \u2014; scaled for a role, its joints are tighter or looser.",{kind:"setting",path:"limits"},{params:{role:ae("calf",bo),scale:ht({default:.5,minimum:0,maximum:2})},reflexes:ke,stimulus:Eo,events:["lostBalance","fallen"],ends:"fallen",within:3}),ne("softLimits","config","Springs every joint back before its limit: a limb slows into the end of its range where it struck it; with no margin, each joint\u2019s own soft limit again, as its asset has it.",{kind:"setting",path:"softLimits"},{params:{margin:ht({default:.3,minimum:0,maximum:Math.PI},"radians"),frequency:ht({default:4,minimum:.1,maximum:30},"hertz"),damping:ht({default:1,minimum:0,maximum:4})},reflexes:ke,stimulus:Eo,events:["lostBalance","fallen"],ends:"fallen",within:3}),ne("balance","balance","Keeps its weight over its feet \u2014 ankles, hips, then a step to where the push carries it \u2014 and stands again.",{kind:"reflex",key:"balance"},{params:rn("balance"),tuning:["balance","body"],stimulus:Zx,events:["stumbled"],within:4}),ne("stagger","balance","Gives where it is struck \u2014 the part and what hangs from it \u2014, steps to catch the blow and gathers itself.",{kind:"reflex",key:"stagger"},{params:rn("stagger"),tuning:["body","stagger"],stimulus:{kind:"hit",role:"chest",toward:"back",speed:.65},events:["stumbled"],within:4}),ne("teeter","balance","Pushed toward a drop at its toes, steps no foot past the edge: held back there, leaning away, arms circling, until it steadies.",{kind:"reflex",key:"teeter"},{tuned:"windmill",params:{...rn("teeter"),..._t("windmill",{follow:1})},tuning:["teeter","balance","body","windmill"],needs:[{kind:"ledge",height:1.1,ahead:.02}],stimulus:{kind:"tip",toward:"front",past:.04},events:["teetering"],within:3}),ne("getUp","fall","At rest after a fall of its own, gets up by the clip of the side it lies on \u2014 with none, by its own muscles (riseUnaided) \u2014 and stands, active again.",{kind:"reflex",key:"getUp"},{params:rn("getUp"),tuning:["getUp","rise"],stimulus:Eo,events:["lostBalance","fallen","settled","gotUp"],within:12}),ne("brace","fall","Falling, reaches its hands for where it will strike, elbows giving as they land.",{kind:"reflex",key:"brace"},{params:rn("brace"),tuning:["body","fall"],reflexes:ke,stimulus:Eo,events:["lostBalance","braced"],ends:"fallen",within:3}),ne("protectHead","reaction","Struck on the head, or falling head first, brings its arms up beside it and drops its chin.",{kind:"reflex",key:"protectHead"},{params:rn("protectHead"),tuning:["body"],stimulus:{kind:"hit",role:"head",toward:"back",speed:.16}}),ne("overWall","fall","Its balance lost against a rail or a low wall, folds over the top and is carried across, legs after.",{kind:"reflex",key:"overWall"},{params:rn("overWall"),tuning:["overWall","fall"],needs:[{kind:"floor"},{kind:"wall",height:.5,ahead:.55}],reflexes:ke,stimulus:Eo,events:["lostBalance","overWall","fallen"],ends:"fallen",within:2.5}),ne("windmill","fall","In a long fall, or held back at an edge, its arms circle in the plane it tips in, the way it turns \u2014 at an edge, the way it would tip over it, to its front or to its side \u2014, taking its spin, and in the air its legs pedal with them and its trunk is turned upright, until they reach for the ground.",{kind:"reflex",key:"windmill"},{params:rn("windmill"),tuning:["windmill"],needs:[{kind:"ledge",height:1.7,ahead:.28}],reflexes:ke,stimulus:{kind:"shove",toward:"front",speed:2.45},events:["lostBalance","fallen"],ends:"fallen",within:4}),ne("rollDownStairs","fall","Shoved at the top of a flight of stairs, it goes down them step after step, its arms about its head, to the ground below.",{kind:"reflex",key:"protectHead"},{params:rn("protectHead"),tuning:["fall"],needs:[{kind:"stairs",steps:8,rise:.1,run:.3,ahead:.3}],reflexes:ke,stimulus:Eo,events:["lostBalance","fallen"],ends:"fallen",within:6}),ne("writhe","fall","Lying after its fall, moves weakly about where it fell for a few seconds, then lets go.",{kind:"reflex",key:"writhe"},{params:rn("writhe"),tuning:["writhe","fall"],reflexes:ke,stimulus:Eo,events:["lostBalance","fallen","settled"],ends:"settled",within:8}),ne("hit","reaction","Pushes the part struck at a point: a punch, a thrown object, a bullet\u2019s plain push.",{kind:"call",method:"hit"},{params:{role:ae("chest",bo),side:ae(1,[-1,1]),toward:ae("back",Zu),speed:tb(.33)},within:3}),ne("punch","reaction","A blow to the head: it goes with it, its neck giving and its trunk after it, and it comes back on its feet.",{kind:"call",method:"hit"},{params:{role:ae("head",bo),side:ae(1,[-1,1]),toward:ae("left",Zu),speed:tb(.2)},tuning:["stagger"],within:3}),ne("shot","shot","A bullet: its push, and the body answers as a shot one \u2014 flinch, turn, a hand to the wound, its head to it.",{kind:"call",method:"shot"},{params:rb("chest"),tuning:["shot","body"],within:3}),ne("shotFromBehind","shot","A bullet in the back: it is thrown forward and arches over it, no hand reaching a wound behind it.",{kind:"call",method:"shot"},{params:rb("chest","front"),tuning:["shot","body"],within:3}),ne("shotSnap","shot","The flinch as the bullet lands: the struck joint twitches away some ten degrees and back, each joint up to the pelvis less.",{kind:"shot",key:"snap"},{params:em("snap","upperArm"),tuning:["shot"],within:1}),ne("shotSpin","shot","A bullet off the body\u2019s axis turns it about its height, more the farther off, less with both feet down.",{kind:"shot",key:"spin"},{params:em("spin","upperArm"),tuning:["shot"]}),ne("shotGuts","shot","Struck in the belly from the front, doubles over: spine and neck bent forward, knees giving.",{kind:"shot",key:"guts"},{params:em("guts","spine"),tuning:["shot"],within:3}),ne("shotKnees","shot","Shot, drops to its knees \u2014 shins folded under it, hips over its knees, trunk sagging \u2014 and stays a moment before it falls on.",{kind:"shot",key:"knees"},{params:em("knees","chest"),tuning:["shot"],reflexes:ke,events:["lostBalance","kneeled","fallen"],ends:"fallen",within:6}),ne("shotLook","shot","Its head turns to the wound, then to where the shot came from.",{kind:"shot",key:"look"},{params:em("look","upperArm"),tuning:["shot","look","body"]}),ne("shotArms","shot","What a shot body\u2019s arms do: a hand pressed on the wound, both out as for a fall, circling, or kept on their aim.",{kind:"shot",key:"arms"},{params:{arms:ae(Mq,gD),...rb("spine")},tuning:["shot","body"]}),ne("lookAt","arms","Turns its head toward a point, as far and as fast as a neck does, and follows it.",{kind:"call",method:"lookAt"},{params:{at:Er(1,.9,1)},tuning:["look"],within:1}),ne("aim","arms","Points an arm at a point \u2014 its hand, or the line of fire of what it holds, the other hand on its support.",{kind:"call",method:"aim"},{params:{at:Er(.4,.8,2),side:ae(1,[-1,0,1])},tuning:["aim"],within:1.5}),kr("aimSettings","config","aim","Sets how an arm aims: how far out its hand is held, alone or with the other hand on what it holds, how fast it sweeps there and how soon it is up to that speed.",{from:"aiming",within:1.5}),ne("weapon","arms","Names what a hand holds and its line of fire \u2014 one hand, both hands on one, one in each \u2014, which its aim then points.",{kind:"call",method:"weapon"},{params:{at:Er(.2,.8,2),side:ae(1,[-1,1])},tuning:["aim"],needs:[{kind:"floor"},{kind:"weapon"}],within:1.5}),ne("grab","arms","Reaches for a point with its hands and grips it once one touches: held there until released or pulled past its grip.",{kind:"call",method:"grab"},{params:{at:Er(0,.75,.22),...Vq},tuning:["grab"],needs:[{kind:"floor"},{kind:"anchor"}],events:["grabbed"],ends:"gripping"}),ne("holdBar","arms","Takes hold of a bar over its head with both hands, each laid on it where its arm meets it, and grips: a pull-up bar, a bus\u2019s rail, a branch.",{kind:"call",method:"grab"},{params:{at:Er(0,1.01,.148),...Vq},tuning:["grab","aim"],needs:[{kind:"floor"},{kind:"bar",up:1.01,front:.148}],events:["grabbed"],ends:"gripping"}),ne("release","arms","Lets go of what a hand grips or reaches for.",{kind:"call",method:"release"},{params:{side:ae(0,[-1,0,1])},from:"gripping",needs:[{kind:"floor"},{kind:"anchor"}],events:["released"],within:1}),ne("attach","attach","Holds an object to a part by a joint of the world: a prop in a hand, a hat on a head, cuffs between two wrists, a body hung from a hook.",{kind:"joint"},{needs:[{kind:"floor"},{kind:"object"}]}),H("lean","balance","lean","Leans its weight and bends its trunk a way while it keeps its feet.",{params:br("front"),tuning:["lean"]}),H("leanRandom","balance","lean","Leans a way of its own that wanders, as a body that cannot keep still.",{random:!0,tuning:["lean"]}),H("leanToPoint","balance","lean","Leans toward a point of the world, wherever it stands from it.",{params:xD,tuning:["lean"]}),H("leanToObject","balance","lean","Leans toward an object and follows it as it moves.",{object:!0,needs:Jx,tuning:["lean"]}),H("hipsLean","balance","hipsLean","Pushes its hips a way while its trunk bends back over its feet.",{params:br("right"),tuning:["lean"]}),H("hipsLeanRandom","balance","hipsLean","Pushes its hips a way of its own that wanders, its trunk kept over its feet.",{random:!0,tuning:["lean"]}),H("hipsLeanToPoint","balance","hipsLean","Pushes its hips toward a point of the world, its trunk kept over its feet.",{params:xD,tuning:["lean"]}),H("hipsLeanToObject","balance","hipsLean","Pushes its hips toward an object and follows it as it moves.",{object:!0,needs:Jx,tuning:["lean"]}),H("forceLean","balance","forceLean","Pushes its trunk a way by a share of its weight, which its ankles and hips hold or its steps follow.",{params:br("front"),tuning:["lean"]}),H("forceLeanRandom","balance","forceLean","Pushes its trunk a way that wanders, as a body jostled in a crowd.",{random:!0,tuning:["lean"]}),H("forceLeanToPoint","balance","forceLean","Pushes its trunk toward a point of the world, as a body drawn there.",{params:xD,tuning:["lean"]}),H("forceLeanToObject","balance","forceLean","Pushes its trunk toward an object and follows it as it moves.",{object:!0,needs:Jx,tuning:["lean"]}),H("crouch","pose","crouch","Lowers its pelvis and folds its trunk over its knees, on its feet.",{tuning:["crouch"]}),H("foetal","pose","curl","Curls up where it lies, its knees to its chest and its hands by them.",{value:{param:"hug"},tuning:["curl"],from:"lying",reflexes:ke,ends:"fallen",within:3}),H("rollUp","pose","curl","Lets itself down from its feet and rolls up into a ball, its arms round its knees.",{value:{param:"hug",initial:1},tuning:["curl"],reflexes:ke,ends:"fallen",within:4}),H("tuck","fall","curl","Tucks into a ball in the air and lands so, rolling.",{value:{param:"hug",initial:1},tuning:["curl"],from:"falling",needs:bD,reflexes:ke,events:["fallen"],ends:"fallen",within:4}),H("pedalLegs","fall","pedal","Pedals its legs in the air as it falls, a half turn apart.",{value:{param:"rate"},params:{...Ee,side:ae(0,[-1,0,1])},tuning:["pedal"],from:"falling",needs:bD,reflexes:ke,events:["fallen"],ends:"fallen",within:4}),H("circleArms","arms","circleArms","Circles its free arms about its shoulders, whatever else it does.",{value:{param:"rate"},params:{...Ee,side:ae(0,[-1,0,1])},tuning:["circle"]}),H("shiver","reaction","shiver","Trembles in every joint, its muscles tense, as in cold or fear.",{tuning:["shiver"]}),H("electrocute","reaction","spasm","Seizes every joint in hard, fast jerks, its back arched, and falls where it stands.",{tuning:["spasm"],reflexes:ke,events:["lostBalance","fallen"],ends:"fallen",within:4}),H("onFire","reaction","flail","Beats its own body with its hands, driven about on its feet, and rolls once it lies.",{tuning:["flail"],ends:"acting",within:3}),H("dazed","reaction","sway","Wanders on its feet, its head hanging, its arms slack and its answers slow.",{tuning:["sway"],within:4}),H("flinch","reaction","flinch","Raises its guard toward what comes at it, bends away and ducks, for a moment.",{params:br("front"),tuning:["flinch"]}),H("dodge","reaction","dodge","Throws itself aside off its planted feet, bent and ducked, its steps catching it.",{params:br("left"),tuning:["dodge"],within:3}),H("parry","reaction","guard","Holds its forearms up between its head and what comes at it, for as long as it is asked: a block, a parry.",{params:br("front")}),H("clutch","reaction","clutch","Brings its free hands to a part of its own body and holds them there: its heart, its throat.",{params:{...Ee,...To("chest")}}),H("braceForImpact","reaction","guard","Holds its guard toward an object and follows it as it comes: braced for what is thrown at it.",{object:!0,needs:Jx}),H("injuredOnGround","reaction","clutch","Lying wounded, brings its hands to its wound and holds them there.",{params:{...Ee,...To("chest")},from:"lying",reflexes:ke,ends:"fallen"}),H("force","force","force","Pushes a part by a share of its weight for as long as it is held, along a way or toward a point.",{value:{param:"force",initial:.1},params:{...br("back"),...To("chest")}}),H("yanked","force","yank","Jerks a part a way for a moment, the limb giving and the body after it.",{value:{param:"speed"},params:{...br("front"),...To("hand")},tuning:["pull"]}),H("dragged","force","drag","Draws a part along by a rope it reels in, the body following along the ground.",{value:{param:"speed"},params:{...br("front"),...To("hand")},tuning:["pull"],from:"lying",reflexes:ke,ends:"fallen",within:3}),H("lifted","force","lift","Lifts it off its feet by a part: it hangs from it, neither landed nor braced.",{value:{param:"speed"},params:{...Ee,...To("chest")},tuning:["pull"],ends:"hanging",within:3}),H("hangFoot","attach","lift","Hauls it up by a leg to a point above: it goes over and hangs head down, a body in a snare.",{value:{param:"speed"},params:{...Ee,...To("calf"),at:Er(0,1.6,0)},tuning:["pull"],events:["lostBalance"],ends:"hanging",within:5}),H("hangWrists","attach","lift","Hauls it up by both wrists to a point above: it hangs at arm\u2019s length, its feet off the ground.",{value:{param:"speed"},params:{...Ee,...To("hand"),twin:ae(1,[0,1]),at:Er(0,1.5,0)},tuning:["pull"],events:["lostBalance"],ends:"hanging",within:5}),H("bound","attach","drag","Ties both wrists to a point: its hands drawn together there and held; thrown, it goes no further than its arms let it.",{value:{param:"speed"},params:{...Ee,...To("hand"),twin:ae(1,[0,1]),at:Er(0,.6,.2)},tuning:["pull"],within:3}),H("pinned","attach","lift","Pins a part where it is, a rope to a point reeled at no speed \u2014 an arrow through it, a nail, a hook \u2014: thrown, the body goes nowhere and hangs from it.",{value:{param:"speed",initial:0},params:{...Ee,...To("chest"),at:Er(0,.73,0)},tuning:["pull"],stimulus:Eo,events:["lostBalance"],ends:"hanging",within:3}),H("blast","force","blast","Throws every part away from a point, upward too, weaker the farther, its muscles stunned and its head guarded.",{value:{param:"speed"},params:{...Ee,at:Er(0,.2,.6)},tuning:["blast"],reflexes:ke,events:["fallen"],ends:"fallen",within:4}),H("pushStream","force","stream","Pushes each part as a stream of air or water flowing past it does, by its side\u2019s area and the square of the flow\u2019s speed.",{value:{param:"speed"},params:br("back"),tuning:["stream"],ends:"acting",within:3}),H("zeroG","force","weightless","Takes its weight off: it floats, no balance and no landing, its limbs in the posture nothing weighs on.",{tuning:["weightless"],ends:"floating"}),H("buoyancy","force","afloat","In water over its head that bears it up \u2014 the world\u2019s, lifting each part by the water it displaces and slowing what moves through it \u2014, floats up off its feet as one nothing weighs on, no balance and no landing, its hands held out about it, where the same body left alone in it is borne up off its feet all the same, its balance lost and its fall\u2019s reflexes taking it \u2014 its hands to its head.",{tuning:["weightless"],needs:[{kind:"floor"},{kind:"water",up:1.2,lift:1.03}],ends:"floating",within:3}),H("underwater","force","afloat","Sinks through deep water it is heavier than \u2014 the world\u2019s, slowing it all the way down \u2014, its limbs afloat.",{tuning:["weightless"],from:"falling",needs:[...bD,{kind:"water",up:3,lift:.9}],ends:"floating"}),H("strike","arms","strike","Throws a fist at a point, its weight behind it, and brings it back: a punch; with both hands, a shove.",{params:{...Ee,at:Er(0,.7,.3),side:ae(1,[-1,0,1])},tuning:["strike"]}),H("shoveOther","arms","strike","Shoves what stands before it with both hands, its weight behind them: another body, a door.",{params:{...Ee,at:Er(0,.68,.3),side:ae(0,[-1,0,1])},tuning:["strike"]}),H("carryTwoHands","arms","carry","Takes up a crate in both hands \u2014 come down to it from a crouch, its trunk upright, for a heavy one, stooped for a light one \u2014, lifts it with its legs and back and holds it against its front, its weight in its balance; too heavy, it strains and lets go.",{object:!0,value:{param:"height"},tuning:["carry","grab","gait"],needs:Qu(.1,.3,.1),events:["grabbed"],ends:"gripping",within:5}),H("pushPull","arms","pushPull","Puts both hands on a crate on the ground and walks it away \u2014 or, at a negative speed, back toward itself \u2014, leaning into what it takes, in shorter steps the heavier and rougher it is; one it cannot move, it strains on without sliding its feet.",{object:!0,value:{param:"speed"},tuning:["pushPull","carry","grab","lean","gait"],needs:Qu(.3,.3,.2),events:["grabbed"],ends:"gripping",within:6}),H("throwObject","arms","throwObject","Throws what it carries at a point \u2014 one-handed and overarm for a light thing, a two-handed heave for a heavy one \u2014: drawn back, its trunk turned and its weight back, driven through by its joints alone, its hips and trunk leading its shoulder, its elbow and its wrist, let go once what it throws goes as fast as the point asks, and followed through.",{params:{...Ee,at:Er(0,0,3),side:ae(1,[-1,1])},tuning:["throwing","carry","grab"],from:"carrying",needs:Qu(.02,.08,.1,.3),events:["released"],within:3}),H("catchObject","arms","catchObject","Catches a crate thrown at it: a reaction after it is asked, its hands go to where the crate comes within reach, close on it as it strikes them and give with it toward its chest \u2014 too fast or too heavy, it is knocked back or drops it.",{object:!0,tuned:"grip",params:{...Ee,..._t("grip",Uq)},tuning:["catching","grip","aim","body"],needs:Qu(.03,.1,1.5,.4),stimulus:{kind:"throw",speed:2.5},events:["grabbed"],ends:"gripping",within:3}),H("swing","arms","swing","Swings what its hand holds \u2014 a bat, a sword \u2014 at a point by its joints alone, its hips and trunk leading its shoulder, its elbow and its wrist through the blow and on through; a blow that lands stops it and jars its arm.",{params:{...Ee,at:Er(0,.55,.45),side:ae(1,[-1,1])},tuning:["swing","strike"],needs:[{kind:"floor"},{kind:"weapon"}],within:3}),H("recoil","arms","recoil","Kicks what an aiming hand fires back along its line of fire and up: its arm gives, its line climbs, and both come back.",{value:{param:"speed"},params:{...Ee,side:ae(1,[-1,1])},tuning:["recoil"],from:"aiming"}),H("health","condition","health","Weakens every muscle and hold, slows its answers and sags its stance as its health ebbs.",{value:{param:"health"},tuning:["health"]}),H("selfAvoidance","arms","avoid","Keeps its reaching hands out of its own trunk and head.",{tuning:["avoid"]}),H("injuredArm","condition","injuredArm","Spares an arm: its muscles weak, no reflex posing it.",{params:{...Ee,side:ae(1,[-1,1])},tuning:["injured"]}),H("injuredLeg","condition","injuredLeg","Spares a leg: its muscles weak, its weight on the other.",{params:{...Ee,side:ae(1,[-1,1])},tuning:["injured"]}),H("fatigue","condition","fatigue","Wears it out over a time: weaker, lower, stooped.",{value:{param:"seconds"},tuning:["fatigue"],within:6}),H("knockout","condition","giveWay","Lets every muscle go at once: its legs give and it drops, neither braced nor writhing.",{value:{param:"seconds"},tuning:["giveWay"],reflexes:ke,events:["lostBalance","fallen"],ends:"fallen",within:4}),H("headShot","shot","giveWay","Drops dead at a bullet in the head: every muscle gone at once, thrown the way it struck.",{value:{param:"seconds",initial:0},reflexes:ke,stimulus:{kind:"hit",role:"head",toward:"back",speed:.13},events:["lostBalance","fallen"],ends:"fallen",within:4}),H("shotRelax","shot","giveWay","Goes slack over a time after a bullet: its muscles ebb, its legs give and it sinks.",{value:{param:"seconds",initial:1.5},reflexes:ke,stimulus:{kind:"hit",role:"chest",toward:"back",speed:.13},events:["lostBalance","fallen"],ends:"fallen",within:6}),H("friction","config","friction","Scales the friction of every part, its share of what it rubs against: a greased body slides on, one caked in mud stops short.",{value:{param:"scale"},from:"lying",reflexes:ke,stimulus:{kind:"shove",toward:"front",speed:2},ends:"fallen",within:3}),kr("landJump","fall","fall","Lands on its feet from a drop its legs take \u2014 a step down, a kerb, a low wall jumped off \u2014, its knees giving, and keeps its balance; from higher, its balance is lost in the air and it falls.",{tuning:["step"],from:"falling",needs:[{kind:"floor"},{kind:"drop",height:.15}]}),kr("fracture","reaction","fracture","Forced past its limits harder than its bone stands, a joint breaks: it turns loose beyond them and all that hangs below it hangs limp, its body standing on if it can \u2014 a leg or its back broken, it falls \u2014, until it is made whole again.",{params:_t("fracture",{strength:.25,density:1e3}),stimulus:{kind:"hit",role:"hand",side:1,toward:"back",speed:.45},ends:"broken",within:1}),kr("stiffness","config","muscle","Sets its muscles\u2019 own spring, their rate and their damping: a loose body that gives, a stiff one that barely does.",{reflexes:tm,stimulus:{kind:"hit",role:"lowerArm",side:-1,toward:"front",speed:.33}}),ne("partStrength","config","Sets the muscle of a role\u2019s parts and of those hanging from them: a limp arm on a body that stands.",{kind:"setting",path:"partStrength"},{params:{role:ae("upperArm",bo),strength:ht({...yn.partStrength,default:.1})}}),kr("balanceSettings","config","step","Sets how it steps to catch its balance: how far, how fast, how high its foot, how many steps in a row.",{stimulus:Zx,events:["stumbled"],within:3}),ne("balanceReset","config","Gives back its tuning as its asset holds it, every value the page set forgotten: shoved, it steps as its asset has it step.",{kind:"call",method:"resetTuning"},{stimulus:Zx,events:["stumbled"],within:3}),ne("jointPose","pose","Turns one part about its own joint over what drives it \u2014 an elbow bent, a head turned aside \u2014, no faster than a limb and no further than the joint goes, the body kept on its feet.",{kind:"setting",path:"pose"},{params:{...To("lowerArm"),plane:ht({...yn.pose,default:1},"radians"),normal:ht(yn.pose,"radians"),twist:ht(yn.pose,"radians")},tuning:["pose"]}),H("oneLeg","balance","oneLeg","Stands on one leg, the other held up: its weight over that foot before the other lifts, its arms spread; a light shove is taken by its ankle and hips, a harder one puts the foot down, and let go of it stands on both again.",{params:{...Ee,side:ae(-1,[-1,0,1])},tuning:["oneLeg","balance","body"],within:3}),H("hop","balance","hop","Hops again and again in place, on both feet or on one with the other held up: crouched, pushed off by its legs, its legs gathered in the air, landed on giving knees and steady before the next.",{params:{...Ee,side:ae(0,[-1,0,1])},tuning:["hop","oneLeg","fall","roll"],within:3}),H("staggerWalk","balance","staggerWalk","Walks ahead as a drunk does, with no clip: a wide base, its weight swaying across its way, its steps uneven in length and time, its corrections late.",{tuned:"gait",params:{...br("front"),...js.gait},tuning:["gait","step","sway"],within:6}),H("exhaustedWalk","balance","staggerWalk","Walks ahead worn out, with no clip: short slow steps, its feet dragging, weaker, lower and stooped as its fatigue leaves it.",{tuned:"gait",with:[{act:"fatigue",value:"seconds"}],params:{...br("front"),seconds:Wq("fatigue",1),..._t("gait",{lead:.25,swing:1.8,lift:.3,base:1,sway:.03,irregular:.1,slow:1.5})},tuning:["gait","step","sway","fatigue"],within:6}),H("limpWalk","balance","staggerWalk","Walks ahead sparing a leg, with no clip: that leg weaker and its stance on it short, the other quick to take its weight.",{tuned:"gait",with:[{act:"injuredLeg",takes:["side"]}],params:{...br("front"),side:ae(1,[-1,1]),..._t("gait",{lead:.45,lift:1,base:1.1,sway:0,irregular:.05,slow:1,bow:.05})},tuning:["gait","step","injured"],within:6}),H("beam","balance","beam","Balances on a narrow beam: its feet brought in line on it heel to toe, its arms spread, its support what stands under its soles; a light shove across is taken on the beam, and past what it holds it goes over the side.",{tuning:["beam","oneLeg","teeter","windmill"],needs:[{kind:"beam",width:.36,height:.3}],within:4}),ne("otherSkeletons","fall","A body that is no person \u2014 four legs and a tail, a bird\u2019s wings \u2014 falls as its own kind: its knees, hocks and elbows bend the way they do, its tail hangs and whips, its wings fold, and it runs none of a person\u2019s reflexes.",{kind:"call",method:"fall"},{needs:[{kind:"floor"},{kind:"creature"}],events:["fallen","settled"],ends:"settled",within:6}),kr("iceSlip","balance","slip","On ice its planted feet slide where the ground cannot hold them: shoved, it fights for its balance, lower, its arms out, in small quick steps its grip can stand on, and falls once they cannot catch it.",{params:_t("slip",{felt:1}),tuning:["step","balance","body"],needs:[{kind:"ice",friction:.03}],stimulus:yD,events:["stumbled"],within:4}),kr("tripLow","balance","trip","A step caught on a low lip it did not look for is stopped, the foot set down behind it as the body pitches over, and its other leg answers with a quick high step over the lip \u2014 a lip too high for it, and it falls forward onto its hands.",{params:_t("trip",{felt:1}),tuning:["step","balance","body"],needs:[{kind:"step",rise:.055,run:.03,ahead:.03}],stimulus:Zx,events:["stumbled"],within:4}),ne("movingFloor","balance","Keeps its feet on a floor that sets off under it \u2014 a bus, a deck, a platform \u2014: its soles ride it, it leans into the floor\u2019s gathering speed and steps when that carries its weight past them, and the floor\u2019s steady speed asks nothing of it.",{kind:"reflex",key:"balance"},{params:rn("balance"),tuning:["balance","lean","body","step"],needs:[{kind:"mover",toward:"front",accel:1.2,speed:2}],within:4}),ne("slopeAndStep","balance","Stands on a slope, its trunk upright and its feet laid on the ground at their ankles, and shoved up it steps onto the slope and stands again \u2014 on a slope steeper than its soles\u2019 grip, it slides.",{kind:"reflex",key:"balance"},{tuned:"slip",params:{...rn("balance"),..._t("slip",{felt:1,slope:1})},tuning:["slip","balance","step"],needs:[{kind:"slope",angle:.26}],stimulus:yD,events:["stumbled"],within:4}),ne("stepUp","balance","Shoved toward a kerb in its way, lifts its foot over the riser onto the top, a step up its sole stands on, and stands with a foot on each level.",{kind:"reflex",key:"balance"},{tuned:"step",params:{...rn("balance"),..._t("step",{onto:1})},tuning:["step","teeter","balance"],needs:[{kind:"step",rise:.06,run:1,ahead:.05}],stimulus:{kind:"shove",toward:"front",speed:1},events:["stumbled"],within:3}),H("dangle","arms","dangle","Hangs by its hands from what holds them \u2014 a bar, a hook, a carrier that moves \u2014, swings as a pendulum under a shove or what carries it, and stills its swing as a person does: its legs drawn up as it swings down, let down as it swings up.",{value:{param:"kick"},tuning:["dangle","pedal","grab"],from:"hanging",needs:Gq,stimulus:{kind:"shove",toward:"front",speed:1},ends:"hanging",within:6}),H("ledgeHang","arms","mantle","Hanging from a ledge by its hands, pulls itself up by its arms, presses over its hands, sets a foot on the top, then the other, and stands up there; too weak for its weight, it rises short, gives up and hangs.",{tuned:"grab",params:{...Ee,side:ae(1,[-1,1]),..._t("grab",{hang:12})},tuning:["mantle","grab"],from:"hanging",needs:[{kind:"floor"},{kind:"platform",height:1.12,ahead:.2}],events:["released"],within:8}),kr("gripFatigue","condition","grip","Its grips tire under what they bear and let go, as a weak or tired person\u2019s do: hanging, each hand drains as its share of its weight passes a light hold, the first spent opens, the other then bears it all and gives at once, and it falls.",{params:_t("grip",{...Uq,tire:.2}),tuning:["grab"],from:"hanging",needs:Gq,events:["released","fallen"],ends:"fallen",within:14}),H("ladder","arms","ladder","Climbs a ladder one limb at a time, three on the rungs and its trunk close to them, each hand and each foot to the rung over the other at its pace: up, it stops at the top; down, it steps off onto the ground.",{value:{param:"speed"},params:{...Ee,at:Er(0,0,.2)},tuning:["ladder","grab","aim"],needs:[{kind:"floor"},{kind:"ladder",rungs:9,spacing:.16,width:.25,front:.2}],ends:"gripping",within:10}),kr("landRoll","fall","roll","Dropped from higher than its legs take standing, lands feet first, its knees and hips giving, then tucks and rolls over a shoulder along its way \u2014 never over its head \u2014 and comes up on its feet; past what a person comes up from, it stays down.",{params:eb,tuning:["fall","curl","step","balance"],from:"falling",needs:[{kind:"floor"},{kind:"drop",height:1,run:1}],events:["lostBalance"],within:4}),kr("catRight","fall","roll","Let go on its side from a height a trained landing takes, turns itself feet down in the air by its own limbs alone \u2014 first twisting about its length as a falling cat does, its upper body turned against its hips, its hands in and its legs apart, then back, its arms out and its legs together; then its arms circling and its hips folding in the plane it must turn in \u2014, its whole turning unchanged; lands on its feet, rolls out of it and stands.",{tuned:"windmill",params:{...eb,...ED},tuning:["windmill"],from:"falling",needs:[{kind:"floor"},{kind:"drop",height:1.5,tilt:1.57,toward:"right"}],events:["fallen"],within:5}),kr("fallReaction","fall","fall","How strongly it reacts as it falls, every reflex of its fall at once \u2014 its arms bracing, its head guarded, its arms circling in the air, its writhing once down \u2014, from a dead fall, slack, to each as strong as its own.",{tuning:["writhe","windmill","body"],reflexes:ke,stimulus:Eo,events:["lostBalance","fallen"],ends:"fallen",within:4}),kr("smartFall","fall","roll","A long fall taken as a trained person takes it: reading how far the ground is and how fast it comes, it rights itself in the air, lands on its feet from low, lands and rolls from higher, and past what a roll takes meets the ground with its arms and legs, its chin tucked, and rolls with the impact.",{tuned:"windmill",params:{...eb,...ED},tuning:["windmill","curl","fall"],from:"falling",needs:[{kind:"floor"},{kind:"drop",height:1.5,tilt:.6,run:1}],events:["fallen"],within:5}),ne("highFall","fall","Falling from several times its height, alive in the air \u2014 its arms circling and its legs pedalling against the turn it fell with, its trunk kept nearer upright than a body left to tumble \u2014, then braced before the impact and writhing after.",{kind:"reflex",key:"windmill"},{tuned:"windmill",params:{...rn("windmill"),...ED},tuning:["windmill","pedal","fall","writhe"],from:"falling",needs:[{kind:"floor"},{kind:"drop",height:4,spin:1.2}],reflexes:ke,events:["fallen"],ends:"fallen",within:5}),H("wallSlide","fall","wallSlide","Shoved back against a wall, takes it with its back and lets its legs give: it slides down the wall \u2014 its back on it, its head kept off it \u2014 and sits there, its knees up, or its legs out where its feet slip.",{tuning:["wallSlide","fall"],needs:[{kind:"floor"},{kind:"wall",height:1.2,ahead:-.35}],reflexes:ke,stimulus:{kind:"shove",toward:"back",speed:1.2},events:["lostBalance","fallen"],ends:"fallen",within:4}),H("wallPush","balance","wallPush","Staggering toward a wall, puts its hands on it a reaction later, its elbows giving, stops itself on them and pushes back onto its feet; met faster than its arms take, it takes the wall on its forearms, its head turned away.",{tuning:["wallPush","wallSlide","body","step"],needs:[{kind:"floor"},{kind:"wall",height:1.2,ahead:.75}],stimulus:{kind:"shove",toward:"front",speed:1.2},within:3}),H("riseUnaided","fall","rise","Knocked down, gets up with no clip by its own muscles against the ground \u2014 over onto its front, up on its arms, its knees under it, then, a body on feet, up off all fours by its balance, its trunk coming up with its hips, in 2 to 4 s, as getUp does with no clip \u2014; with no feet it stays on all fours till it lies back; too weak for it, it lies back.",{params:{...Ee,side:ae(1,[-1,1])},tuning:["rise","roll","body"],reflexes:ke,stimulus:Eo,events:["lostBalance","fallen"],within:10}),H("crawl","condition","crawl","Wounded on the ground, crawls slowly on its front along its way, turned onto it first: an arm reaching and pulling as the other side\u2019s knee pushes, its trunk low; a hurt limb drags.",{params:br("front"),tuning:["crawl","injured"],from:"lying",reflexes:ke,ends:"fallen",within:6}),H("carried","force","carried","Carried lying on what moves \u2014 a stretcher, a cart \u2014, awake: it holds its head, gathers its knees and keeps its hands on its chest, never fighting for a balance off its feet nor fallen while borne; limp, its head and limbs swing; set down, it lies, or, awake and set on its feet, stands.",{value:{param:"awake"},tuning:["carried"],from:"lying",needs:[{kind:"floor"},{kind:"mover",toward:"front",accel:1.2,speed:2}],reflexes:ke,ends:"carried",within:4}),H("holdHands","arms","holdHands","Takes the hand of another standing at its side and keeps hold, both on their feet: both feel the pull through the joined hands, each arm giving as an arm does, its balance leaning against what pulls it.",{object:!0,params:{...Ee,side:ae(1,[-1,1])},tuning:["holdHands","grab","grip","body"],needs:[{kind:"floor"},{kind:"character",count:1,ahead:-.28,aside:1.33,around:0,faces:"ahead",from:"standing",about:"hand",side:-1}],events:["grabbed"],ends:"gripping",within:3}),H("carryBody","arms","carryBody","Takes another lying before it by the wrists and drags it, walking backwards and leaning away from its weight on the ground; by its pelvis, up in its arms when its strength allows, carried ahead \u2014 a body too heavy is dragged under the arms, or strained on.",{object:!0,value:{param:"speed"},tuned:"carry",params:{...Ee,..._t("carry",{squat:.55,stoop:1.3})},tuning:["carryBody","carry","pushPull","grab","grip","gait"],needs:[{kind:"floor"},{kind:"character",count:1,ahead:1.8,aside:0,around:0,faces:"ahead",from:"lying",about:"hand",side:1}],events:["grabbed"],ends:"gripping",within:8}),H("grabAndThrow","arms","grabAndThrow","Seizes another standing before it by the collar and the belt, pulls it off its feet as its hips turn back, then turns through with a step and lets go as the other\u2019s momentum goes its way: thrown a metre or two, the other falls as a thrown body does; a heavier or braced one is only shoved.",{object:!0,params:{...Ee,side:ae(1,[-1,1])},tuning:["grabThrow","throwing","grab","grip","body"],needs:[{kind:"floor"},{kind:"character",count:1,ahead:.5,aside:0,around:0,faces:"body",from:"standing",about:"chest"}],events:["grabbed","released"],within:4}),H("crowd","force","crowd","Pressed in a crowd from all sides: its forearms before its chest to keep room to breathe, a shoulder turned into the press, small quick steps with the flow, upright while the pushes balance \u2014 carried along, or down guarding its head, when they do not.",{params:{...Ee,side:ae(0,[-1,0,1])},tuning:["crowd","step","balance","lean"],needs:[{kind:"floor"},{kind:"character",count:4,ahead:1.2,aside:0,around:1.5708,faces:"body",from:"standing",asked:"crowd"}],within:5}),ne("collisions","config","Chooses while it lives what its parts collide with, by the engine\u2019s collision channels and their answers: set to ignore what a thrown crate is, the crate passes through it; set to stop it again, the crate strikes it.",{kind:"setting",path:"collision"},{params:{channel:ae("prop",e1),response:ae("ignore",ly)},needs:Qu(.03,.1,1.5,.4),stimulus:{kind:"throw",speed:2.5},within:3}),kr("bullets","shot","bullet","Each bullet\u2019s own reaction past its small push: the struck part and what hangs from it give and gather again over seconds, a bone jerks its muscles harder than flesh, it flinches from where the bullet came \u2014 guard up, trunk bent away, knees dipped \u2014, and a burst adds up, each hit landing on a body already yielding, until its legs give.",{params:_t("bullet",{give:.7,bone:1.5,adds:1,wear:.15,flinch:1}),tuning:["shot","stagger","flinch"],stimulus:{kind:"shot",role:"lowerArm",side:1,toward:"back",speed:.06},within:3}),kr("bump","reaction","bump","A body striking it is a hit by the share of the blow that body brings \u2014 a crate thrown at it, a car \u2014, the part it meets giving and its feet catching it, each blow it answers told with that part and what struck it; a wall, a table or a crate it walks into never is: a page chooses which kinds of body count (struckBy) and how strongly it feels them.",{params:_t("bump",{share:1}),tuning:["stagger"],needs:Qu(.15,.15,1.5,.4),stimulus:{kind:"throw",speed:3},events:["struck"],within:3}),ne("legSweep","reaction","A blow low across a leg it stands on, on its shin, takes its sole off its plant past what its friction holds \u2014 a person whose sole a kick sweeps \u2014: its support gone from under it, it falls to that side, its hands going out \u2014 the same blow on its trunk only staggers it, and on ground that holds the sole it only stumbles.",{kind:"call",method:"hit"},{tuned:"slip",params:{role:ae("calf",bo),side:ae(1,[-1,1]),toward:ae("left",Zu),speed:tb(.65),..._t("slip",{sweep:1})},tuning:["slip","stagger","body"],reflexes:ke,events:["lostBalance","fallen"],ends:"fallen",within:3}),H("swim","force","swim","Swims in the world\u2019s water deeper than it stands, afloat in it, a head-up breaststroke along its way \u2014 its arms pulling back and its legs kicking, the water\u2019s drag on its own limbs carrying it, its head up to breathe \u2014, some body lengths where the same body afloat and asked nothing floats in place; one that never learnt, or too weak or worn out, pushes nothing on: it struggles where the water leaves it, and in water it is heavier than it sinks, where a trained swimmer\u2019s strokes hold it up.",{tuned:"swim",params:{...br("front"),..._t("swim",{skill:1})},tuning:["swim","weightless"],needs:[{kind:"floor"},{kind:"water",up:1.2,lift:1.03}],ends:"floating",within:15}),H("mud","balance","afloat","Walks into mud as deep as its shins, with no clip \u2014 the world\u2019s water a medium that yields: its feet sink into it and are held there \u2014, each step slow and lifted high out of it, leaning into what holds its legs, its arms out for its balance: its feet rise higher than the same walk\u2019s through the same mud unwading, and held past what its legs pull, it stays there.",{tuned:"water",with:[{act:"staggerWalk",takes:["toward"]}],params:{...br("front"),..._t("water",{wade:.15})},tuning:["water","gait","step","slip"],needs:[{kind:"floor"},{kind:"mud",height:.18,ahead:.3,density:1700,yield:4e3,suction:8e3}],within:6}),H("trampoline","fall","bounce","Dropped onto a trampoline, bounces on it as trained as its landing \u2014 upright, its arms out, its feet under it, its legs driving the bed down at the bottom to rise as high as asked \u2014, where an untrained body flops over at its first bounce; a landing missed, it falls as any fall does.",{value:{param:"height"},tuned:"roll",params:{...Ee,...eb},tuning:["bounce","roll","fall"],from:"falling",needs:[{kind:"floor"},{kind:"drop",height:.6},{kind:"trampoline",height:.3,give:.08,bounce:.9}],ends:"acting",within:6}),H("seatBelt","attach","belt","Strapped into the seat it rides in by a lap and a shoulder belt: its car stopped dead by a wall, its straps take up their slack and stretch, holding its pelvis and chest in the seat while its head and arms whip forward as far as its neck and joints let them \u2014 relaxed or braced as it rides \u2014, where the same body unstrapped is thrown on over the dashboard; past their strength they pay out.",{object:!0,tuned:"belt",params:{...Ee,...js.belt},tuning:["belt","ride"],from:"riding",needs:Hq,ends:"seated",within:8}),H("ejected","fall","ride","Riding unstrapped in a car stopped dead by a wall, goes on as it moved \u2014 no push of its own \u2014: its knees strike the dashboard, its trunk pitches over it and it is thrown out of its seat over the front, flies and comes down beyond, its fall\u2019s own reflexes taking it as it leaves its seat \u2014 its hands out, its head guarded, a roll if trained.",{object:!0,value:{param:"braced"},tuned:"ride",params:{...Ee,...js.ride},tuning:["ride","fall","roll"],from:"riding",needs:Hq,reflexes:ke,events:["fallen"],ends:"fallen",within:9}),kr("breakable","reaction","tear","Struck past what a person\u2019s flesh stands \u2014 some 2 MPa over its wrist, several kilonewtons \u2014, a limb is torn off for good: a crash\u2019s blow on its hand, as a car\u2019s bumper meets it, tears it from its wrist \u2014 a body of its own that flies off and falls, told by its part \u2014, and the body flung by the blow goes on without it, a hand less, where the same blow on flesh that never tears leaves it whole.",{params:_t("tear",{strength:2}),tuning:["fracture"],stimulus:{kind:"hit",role:"hand",side:1,toward:"back",speed:12},events:["torn"],ends:"torn",within:1})],n_e=new Map(zq.map(e=>[e.id,e]));function o_e(e){let t=n_e.get(e);if(!t)throw new RangeError(`A ragdoll has no behaviour '${e}'.`);return t}var oi=Yt("seconds"),nb=Yt("ratio"),ee=Yt("legs"),ob=Yt("heights"),$q={wait:{place:oi(.03,0,1),settle:oi(.5,0,10),weapon:oi(.17,0,5),make:oi(2,.1,60),turned:oi(.03,0,1),lie:oi(10,.1,60),grip:oi(3,.1,30),hang:oi(2,.1,30),carry:oi(6,.1,60),seat:oi(3,.1,30)},start:{hangDrop:ob(1/3,.05,1),lift:ee(.11,.01,1),throwAt:ob(.72,0,2)},ground:{span:ee(3.3,.5,30),ice:ee(.011,.001,.5),deck:ee(.11,.01,1),landing:ee(4.4,.5,30),wallWide:ee(3.3,.2,30),wallThick:ee(.22,.01,2),barLong:ee(1.33,.2,10),barSide:ee(.033,.005,.5),rung:ee(.056,.005,.5),platform:ee(3.3,.2,30),onto:ee(.022,0,.5),standWide:ee(1,.1,10),standBehind:ee(.5,.05,10)},things:{objectSide:ee(.22,.01,2),objectMass:nb(.03,.001,2),objectRight:ob(.33,-2,2),objectUp:ob(.56,0,3),weaponLong:ee(.33,.02,2),weaponWide:ee(.044,.005,.5),weaponHigh:ee(.067,.005,.5),weaponMass:nb(.015,.001,1)},bed:{mass:nb(.072,.001,5),side:ee(3.3,.2,30),thick:ee(.044,.005,1),post:ee(.056,.005,.5)},car:{mass:nb(21,1,500),wheel:ee(.367,.05,3),wheelWide:ee(.278,.02,2),under:ee(.022,0,1),track:ee(.889,.1,5),frontAxle:ee(2,.2,10),rearAxle:ee(.667,.1,10),nose:ee(2.444,.2,10),tail:ee(1.111,.1,10),floor:ee(.56,.1,2),cushion:ee(.22,0,1),back:ee(.15,0,1),edge:ee(.4,.05,2),shoulders:ee(.6,.1,2),dash:ee(.72,.2,3),dashTop:ee(.17,-1,2),sill:ee(.5,.1,2),sillTop:ee(.11,-1,2),wide:ee(.55,.2,3),thigh:ee(.5,0,2),floorThick:ee(.111,.01,1),backThick:ee(.111,.01,1),dashThick:ee(.222,.01,1),sillThick:ee(.111,.01,1),bonnet:ee(.333,.01,2),roadWide:ee(6.67,1,100),roadLong:ee(111,5,1e3),roadBehind:ee(5.56,0,100),roadThick:ee(1.11,.05,10),wallHigh:ee(.667,.05,5),wallDeep:ee(1.11,.05,10)}},jq=$q;function i_e(e={}){let t=e;for(let n of Object.keys(t))if(!Object.hasOwn(jq,n))throw new RangeError(`A staging has no group '${n}'.`);let r={};for(let[n,o]of Object.entries(jq)){let i=t[n]??{};for(let s of Object.keys(i))if(!Object.hasOwn(o,s))throw new RangeError(`A staging's group '${n}' has no '${s}'.`);r[n]={};for(let[s,a]of Object.entries(o))r[n][s]=kl(a,i[s]??a.default,`${n}.${s}`,"staging ")}return r}var ib=(e,t)=>Object.fromEntries(t.map(r=>[r,e])),Yq=ib("it does not lean",["maxLean","leanFrequency","leanDamping","leanStiffness","leanDampingRate","leanIntegral","leanIntegralDecay","leanSmoothing","leanControl","leanSteerLimit"]),Kq=ib("it has no tracks",["trackTurn","trackGrip","trackSlide","sprockets","trackInertia","trackDamping","trackBrakeTorque"]),s_e=ib("it rolls on tracks, not tyres",["brakeTorque","handbrakeTorque","wheelInertia","wheelDamping","longitudinalGrip","lateralGrip"]),a_e=ib("its engine drives its tracks, through no differential",["differentials","limitedSlip","centreLimitedSlip"]),rm=Object.freeze({car:Object.freeze({...Kq,...Yq}),motorcycle:Object.freeze({drive:"its rear wheel drives",steerGrip:"its lean holds its steering to what its speed allows (leanSteerLimit)",...Kq,antiRoll:"its two wheels are in line, on no shared axle",antiRollBars:"its two wheels are in line, on no shared axle"}),tracked:Object.freeze({clutch:"its engine drives its tracks",drive:"the rearmost wheel of each track drives",turnRadius:"it has no steered wheels, it steers by its tracks",maxSteerAngle:"it has no steered wheels, it steers by its tracks",steerGrip:"it has no steered wheels, it steers by its tracks",tractionLimit:"its tracks grip by their own friction, through no tyre",antiLock:"its tracks brake whole, through no tyre",antiRoll:"its wheels carry no anti-roll bars",antiRollBars:"its wheels carry no anti-roll bars",...a_e,...s_e,...Yq})});var l_e=Object.freeze(["suspensionFrequency","suspensionDamping","suspensionStiffness","suspensionDampingRate","suspensionTravel","suspensionPreload","suspensionDirection","suspensionForcePoint","steeringAxis","camber","toe","wheelRadius","wheelWidth","maxSteerAngle","brakeTorque","handbrakeTorque","wheelInertia","wheelDamping","longitudinalGrip","lateralGrip","grip","trackGrip","trackSlide"]);function sb(e,t){let r=e.wheelSpecs[t],n={};for(let o of l_e){let i=r?.[o];n[o]=i!==void 0?i:e[o]}return n}var ab=e=>Number.isFinite(e),Nt=(e,t)=>e>=t&&e<1/0,jn=(e,t)=>e>t&&e<1/0,lb=(e,t)=>Number.isInteger(e)&&e>=0&&e<=t,TD=(e,t)=>lb(e,t-1),$n=(e,t)=>e===null||t(e);function cb(e,t,r,n){for(let[o,i]of e)t[o]!==null&&r[i]!==void 0&&n(`${String(i)} or ${String(o)}, not both`)}var AD=[["suspensionStiffness","suspensionFrequency"],["suspensionStiffness","suspensionDamping"]],u_e=e=>e.length>=1&&e.length<=8&&e.every(([t,r],n)=>Nt(t,0)&&(n===0||t>e[n-1][0])&&Nt(r,0));function d_e(e,t){let{suspensionStiffness:r,suspensionDampingRate:n,suspensionTravel:o}=e;if(t(jn(o,0),"a suspensionTravel above 0"),t(Nt(e.suspensionPreload,0),"a suspensionPreload of 0 or above"),t(r===null==(n===null),"suspensionStiffness and suspensionDampingRate together"),r!==null)return t(jn(r,0)&&Nt(n??-1,0),"a suspensionStiffness above 0, a suspensionDampingRate of 0 or above");t(Nt(e.suspensionDamping,0),"a suspensionDamping of 0 or above");let i=Yo.earth/(Q*e.suspensionFrequency)**2;t(i-e.suspensionPreload<o,`a suspensionTravel longer than its sag, g / (2\u03C0 suspensionFrequency)\xB2 = ${i.toFixed(3)} m`)}function qq(e,t){d_e(e,t);let r=i=>i.every(ab),[,n]=e.suspensionDirection,[,o]=e.steeringAxis;t(r(e.suspensionDirection)&&n<0,"a suspensionDirection pointing down"),t(r(e.steeringAxis)&&o>0,"a steeringAxis pointing up"),t(e.suspensionForcePoint?.every(ab)??!0,"a finite suspensionForcePoint, or null");for(let i of["camber","toe"])t(Math.abs(e[i])<me,`a ${i} in (\u2212\u03C0/2, \u03C0/2) radians`);for(let i of["wheelRadius","wheelWidth"])t($n(e[i],s=>jn(s,0)),`a ${i} above 0, or null`);for(let i of["brakeTorque","handbrakeTorque"])t($n(e[i],s=>Nt(s,0)),`a ${i} of 0 or above, or null`);t(jn(e.wheelInertia,0),"a wheelInertia above 0");for(let i of["wheelDamping","grip","trackGrip","trackSlide"])t(Nt(e[i],0),`a ${i} of 0 or above`);for(let i of["longitudinalGrip","lateralGrip"])t(u_e(e[i]),`a ${i} of 1 to ${8} points, slips from 0 rising, frictions of 0 or above`)}function Xq({kind:e,wheels:t,spec:r},n,o){n(r.wheelSpecs.length<=t.length,"no more wheelSpecs than wheels"),qq(r,n),r.wheelSpecs.forEach((i,s)=>{let a=d=>o(`wheel ${s}: ${d}`),l=(d,f)=>d||a(f);for(let[d,f]of Object.entries(rm[e]))l(i[d]===void 0,`no ${d}: ${f}`);let c=i.maxSteerAngle??0;l(Math.abs(c)<=me,"a maxSteerAngle in [\u2212\u03C0/2, \u03C0/2] radians");let u=sb(r,s);cb(AD,u,i,a),qq(u,l)})}var ii={x:0,y:1,z:2,normalX:3,normalY:4,normalZ:5,halfWidth:6,rubber:7,print:8,birth:9,tread:10,previous:11},OD=12,Qq=-1,cvt=4096,uvt=1/16;var LD={last:0,lastSeq:1,x:2,y:3,z:4,dirX:5,dirY:6,dirZ:7,tread:8,marking:9,owed:10,sample:11,body:21},Zq=LD.body+1,f_e={normal:ii.normalX,halfWidth:ii.halfWidth,rubber:ii.rubber,print:ii.print,tread:ii.birth},mvt=10,RD=class{on=!0;get drawn(){return this.on}set drawn(t){this.on=t,t||r9(this)}clock=void 0;capacity=hl.marksCapacity.default;segmentLength=hl.marksSegmentLength.default;turnCos=Math.cos(hl.marksTurnAngle.default);nodes=void 0;laid=0;count=0;revision=0;tracks=[];byOwner=new WeakMap},Jq=()=>new RD,e9=E0(),t9=e9.hold,gvt=e9.of;function p_e(e,t){e.fill(0,t,t+Zq),e[t+LD.last]=Qq,e[t+LD.body]=-1}function ub(e){e.laid=e.count=0,e.revision++;for(let{state:t}of e.tracks)for(let r=0;r<t.length;r+=Zq)p_e(t,r)}function r9(e){ub(e),e.nodes=void 0,e.tracks=[],e.byOwner=new WeakMap}function n9(e,t,r,n){t!==e.capacity&&(r9(e),e.capacity=t),e.segmentLength=r,e.turnCos=Math.cos(n)}var h_e=e=>e?.drawn?e.count:0,Svt=e=>e.clock?.[0]??0,wvt=(e,t)=>t>=0&&t<e.laid&&e.laid-t<=e.capacity;function yvt(e,t,r,n){let{capacity:o}=e,i=e.nodes??=new Float32Array(o*OD),s=e.laid%o,a=s*OD;for(let u=0;u<ii.birth;u++)i[a+u]=t[r+u];let{clock:l}=e,c=l?l[0]:0;return i[a+ii.birth]=c,i[a+ii.tread]=t[r+f_e.tread],i[a+ii.previous]=n,e.laid++,e.count=Math.min(e.count+1,o),s}var db={enabled:!0,slideStart:1.5,slideFull:6,loadRest:null,contactWidth:.85},m_e=[...Object.keys(db),"treadPitch"],_D=e=>K(e)&&e>0;function vD(e){if(e===void 0)return;if(!Pe(e))return"marks is an object";let t=Id(e,m_e);if(t!==void 0)return`marks has no field ${t}`;let{enabled:r,slideStart:n,slideFull:o,loadRest:i,contactWidth:s,treadPitch:a}=e;if(r!==void 0&&typeof r!="boolean")return"marks.enabled is a boolean";let l=n??db.slideStart,c=o??db.slideFull;if(!(K(l)&&l>=0&&_D(c)&&c>l))return"marks.slideStart is at least 0 and below marks.slideFull, a finite number";if(i!=null&&!_D(i))return"marks.loadRest is above 0, or null";let u=s??db.contactWidth;if(!(hg(u)&&u>0))return"marks.contactWidth lies in (0, 1]";if(a!=null&&!_D(a))return"marks.treadPitch is above 0, or null"}var g_e={strokes:4,timbre:.5,volume:1},S_e=[...Object.keys(g_e),"cylinders","enabled"],o9=16;function MD(e){if(e===void 0)return;if(!Pe(e))return"sound is an object";let t=Id(e,S_e);if(t!==void 0)return`sound has no field ${t}`;let{enabled:r,cylinders:n,strokes:o,timbre:i,volume:s}=e;if(r!==void 0&&typeof r!="boolean")return"sound.enabled is a boolean";if(n!=null&&!(K(n)&&Number.isInteger(n)&&n>=0&&n<=o9))return`sound.cylinders is a whole number from 0 to ${o9}, or null`;if(o!==void 0&&o!==2&&o!==4)return"sound.strokes is 2 or 4";if(i!==void 0&&!hg(i))return"sound.timbre lies in [0, 1]";if(s!==void 0&&!(K(s)&&s>=0))return"sound.volume is a finite number of at least 0"}var b_e=[["maxTorque","torquePerKg"],["maxSteerAngle","turnRadius"],["reverseGears","reverse"],["antiRollBars","antiRoll"],["differentials","drive"],["differentials","limitedSlip"],["differentials","finalDrive"],["leanStiffness","leanFrequency"],["leanStiffness","leanDamping"]],i9=e=>jn(e,1);function E_e(e,t){let r=i=>jn(i,0);t(e.gears.length>=1&&e.gears.length<=16,`1 to ${16} gears`),t(e.gears.every(r),"gears above 0 and finite"),t(r(e.reverse),"a reverse above 0 and finite (its sign is the module's)");let n=e.reverseGears??[e.reverse];t(n.length>=1&&n.length<=16,`1 to ${16} reverseGears`),t(n.every(r),"reverseGears above 0 and finite"),t(r(e.finalDrive),"a finalDrive above 0 and finite"),t(r(e.clutch),"a clutch above 0 and finite"),t(r(e.maxRPM),"a maxRPM above 0 and finite"),t(e.idleRPM>=0&&e.idleRPM<=e.maxRPM,"an idleRPM of 0 or above, up to maxRPM"),t(e.shiftDownRPM>0&&e.shiftDownRPM<e.shiftUpRPM,"a shiftDownRPM above 0, below shiftUpRPM"),t(e.shiftUpRPM<e.maxRPM,"a shiftUpRPM below maxRPM");for(let i of["switchTime","clutchReleaseTime","switchLatency"])t(Nt(e[i],0),`a ${i} of 0 or above`);let o=e.torqueCurve.length;t(o>=1&&o<=16,`1 to ${16} torque curve points`),t($n(e.engineInertia,r),"an engineInertia above 0, or null"),t(Nt(e.engineDamping,0),"an engineDamping of 0 or above"),t(e.maxTorque===null||Nt(e.maxTorque,0),"a maxTorque of 0 or above, or null")}function T_e(e,t){t(e.maxPitchRollAngle>0&&e.maxPitchRollAngle<=Math.PI,"a maxPitchRollAngle in (0, \u03C0] radians"),t(lb(e.solverPriority,2**24),"a solverPriority, a whole number from 0 to 2\xB2\u2074");for(let r of["velocitySteps","positionSteps","wheelTestInterval"])t(lb(e[r],255),`a ${r}, a whole number from 0 to 255`);t(e.wheelCastRounding>=0&&e.wheelCastRounding<=1,"a wheelCastRounding in [0, 1]"),t(e.maxWheelSlope>0&&e.maxWheelSlope<=me,"a maxWheelSlope in (0, \u03C0/2] radians"),t(e.gravity?.every(ab)??!0,"a finite gravity, or null");for(let r of["limitedSlip","centreLimitedSlip"])t($n(e[r],i9),`a ${r} above 1 and finite, null for none`)}var A_e=["rollingResistance","airDrag","engineBraking","coastBrake","pedalTime","centreTime","steerGrip"];function O_e(e,t){for(let r of A_e)t(Nt(e[r],0),`a ${r} of 0 or above`);t($n(e.tractionLimit,r=>jn(r,0)),"a tractionLimit above 0 and finite, null for none"),t($n(e.antiLock,r=>Nt(r,0)),"an antiLock of 0 or above and finite, null for none")}function L_e({wheels:e,spec:t},r){r(t.maxLean>0&&t.maxLean<me,"a maxLean in (0, \u03C0/2) radians"),r(jn(t.leanFrequency,0),"a leanFrequency above 0"),r(Nt(t.leanDamping,0),"a leanDamping of 0 or above"),r(t.leanStiffness===null==(t.leanDampingRate===null),"leanStiffness and leanDampingRate together"),r($n(t.leanStiffness,o=>jn(o,0)),"a leanStiffness above 0, or null"),r($n(t.leanDampingRate,o=>Nt(o,0)),"a leanDampingRate of 0 or above");for(let o of["leanIntegral","leanIntegralDecay","trackDamping"])r(Nt(t[o],0),`a ${o} of 0 or above`);r(t.leanSmoothing>=0&&t.leanSmoothing<1,"a leanSmoothing in [0, 1)"),r($n(t.trackInertia,o=>jn(o,0)),"a trackInertia above 0, or null"),r($n(t.trackBrakeTorque,o=>Nt(o,0)),"a trackBrakeTorque of 0 or above");let n=t.sprockets??[];r(n.every((o,i)=>TD(o,e.length)&&e[o].position.x<0==!i),"sprockets, a left wheel then a right one, or null")}function R_e({wheels:e,spec:t},r){let n=e.length,o=c=>TD(c,n),i=t.differentials??[];r(i.length<=8,`up to ${8} differentials`);let s=new Set;for(let{left:c,right:u,ratio:d,split:f,limitedSlip:h,torqueShare:m}of i){let w=x=>x===-1||o(x);r(w(c)&&w(u)&&c+u>-2&&c!==u,"a differential on a wheel or two, not on one wheel twice");for(let x of[c,u].filter(b=>b>=0))r(!s.has(x),`wheel ${x} in one differential, not two`),s.add(x);r(jn(d,0)&&f>=0&&f<=1,"a differential's ratio above 0, its split in [0, 1]"),r($n(h,i9)&&Nt(m,0),"a differential's limitedSlip above 1 and finite, null for none, its torqueShare of 0 or above")}let a=i.reduce((c,{torqueShare:u})=>c+u,0);r(!i.length||Math.abs(a-1)<1e-6,"differentials' torqueShare summing to 1");let l=t.antiRollBars??[];r(l.length<=8,`up to ${8} antiRollBars`);for(let{left:c,right:u,stiffness:d}of l)r(o(c)&&o(u)&&c!==u&&Nt(d,0),"antiRollBars on two wheels, a stiffness of 0 or above")}function PD(e,t){let{kind:r,body:n,wheels:o,spec:i}=e,s=h=>{throw new RangeError(`A ${r}: ${h}.`)},a=(h,m)=>h||s(m);a(o.every(h=>h.parent===n),"its wheels are children of its body");let{maxSteerAngle:l}=i;a(l===null||l>0&&l<me,"a maxSteerAngle in (0, \u03C0/2) radians, or null"),cb(b_e,i,t,s),cb(AD,i,t,s);let c=o.some((h,m)=>{let{wheelRadius:w,wheelWidth:x}=sb(i,m);return(w===null||x===null)&&(h.localBounds()?.isEmpty()??!0)});a(!c,"a wheel has no bounds: give wheelRadius and wheelWidth, or a wheel with a geometry");let u=h=>o.filter(m=>m.position.x<0===h).length;r==="tracked"&&a(u(!0)>=2&&u(!1)>=2,"two wheels or more on each side"),r==="car"&&a(o.length>=3,"three wheels or more"),r==="motorcycle"&&a(o.length===2,"two wheels");for(let[h,m]of Object.entries(rm[r]))a(t[h]===void 0,`no ${h}: ${m}`);let d=i.wheelCast==="cylinder";a(d||t.wheelCastRounding===void 0,"no wheelCastRounding: its wheels are not cast as cylinders"),a(!d||t.maxWheelSlope===void 0,"no maxWheelSlope: a cylinder cast stands on any slope"),E_e(i,a),T_e(i,a),O_e(i,a),L_e(e,a),R_e(e,a),Xq(e,a,s);let f=vD(i.marks)??MD(i.sound);f&&s(f)}var fb={maxPitchRollAngle:Math.PI,enabled:!0,solverPriority:0,velocitySteps:0,positionSteps:0,wheelTestInterval:1,wheelCast:"cylinder",wheelCastRounding:.1,maxWheelSlope:80*ce,gravity:null,engineInertia:null,engineDamping:.2,gearbox:"automatic",reverseGears:null,differentials:null,limitedSlip:1.4,centreLimitedSlip:1.4,antiRollBars:null,suspensionStiffness:null,suspensionDampingRate:null,suspensionPreload:0,suspensionDirection:[0,-1,0],suspensionForcePoint:null,steeringAxis:[0,1,0],camber:0,toe:0,brakeTorque:null,handbrakeTorque:null,wheelInertia:.9,wheelDamping:.2,longitudinalGrip:[[0,0],[.06,1.2],[.2,1]],lateralGrip:[[0,0],[3*ce,1.2],[20*ce,1]],grip:1,leanIntegral:0,leanIntegralDecay:4,leanSmoothing:.8,leanControl:!0,leanSteerLimit:!0,sprockets:null,trackInertia:null,trackDamping:.5,trackBrakeTorque:null,wheelSpecs:[]};function CD(e,t,r){let n=e<t?e:.9*t,o=iu(r.slice(1).map((i,s)=>i/r[s]));return{shiftUpRPM:n,shiftDownRPM:n*o*.9}}var __e=1.2,ID=(e,t)=>.5*__e*e/t,kD={...fb,switchTime:.5,clutchReleaseTime:.3,switchLatency:.5,suspensionDamping:.5,antiRoll:1,turnRadius:5.5,maxSteerAngle:null,steerTime:.25,brakeGrip:1,drive:"rear",trackTurn:.6,maxLean:45*ce,leanFrequency:12.5/Q,leanDamping:1.25,leanStiffness:null,leanDampingRate:null,trackGrip:1,trackSlide:.5,clutch:2e3,maxTorque:null,wheelRadius:null,wheelWidth:null,engineDamping:0,wheelDamping:.04,rollingResistance:.01,engineBraking:.4,coastBrake:1,pedalTime:.2,centreTime:.15,steerGrip:.8,tractionLimit:.8,antiLock:.04},Ju=Object.freeze({car:1470,motorcycle:319,tracked:61300}),v_e=e=>Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView),Fl=e=>t=>v_e(t)?Object.freeze(Array.from(t,r=>e(r))):t,si=Fl(e=>e),pb=(e={})=>t=>Pe(t)?Nl(t,e):t,s9=(e,t)=>pb(Pe(t)?t:{})(e),d9=3.42,M_e={ratio:d9,split:.5,limitedSlip:fb.limitedSlip,torqueShare:1},D_e={stiffness:32600},a9={gears:si,reverseGears:si,sprockets:si,gravity:si,suspensionDirection:si,suspensionForcePoint:si,steeringAxis:si,torqueCurve:Fl(si),longitudinalGrip:Fl(si),lateralGrip:Fl(si),differentials:Fl(pb(M_e)),antiRollBars:Fl(pb(D_e)),wheelSpecs:Fl(pb()),marks:s9,sound:s9};function Nl(e,t={}){let n={...t};for(let o of Object.keys(e)){let i=e[o];n[o]=Object.hasOwn(a9,o)?a9[o](i,n[o]):i}return Object.freeze(n)}var l9=[2.66,1.78,1.3,1,.74,.5],c9=[2.27,1.63,1.3,1.09,.96,.88],u9=[4,3,2,1],FD=Object.freeze({car:Nl({...kD,torquePerKg:475/Ju.car,idleRPM:700,maxRPM:6e3,torqueCurve:[[0,.8],[.25,.86],[4400/6e3,1],[1,.91]],gears:l9,reverse:2.9,finalDrive:d9,...CD(5600,6e3,l9),suspensionFrequency:1.5,suspensionTravel:.2,airDrag:ID(.29*1.95,Ju.car)}),motorcycle:Nl({...kD,torquePerKg:84/Ju.motorcycle,idleRPM:1100,maxRPM:9500,torqueCurve:[[0,.6],[7e3/9500,1],[1,.9]],gears:c9,reverse:4,finalDrive:1.93*40/16,...CD(9e3,9500,c9),clutch:500,tractionLimit:.9,wheelCastRounding:1,wheelInertia:.6,rollingResistance:.015,engineBraking:.36,suspensionFrequency:2,suspensionTravel:.13,airDrag:ID(.5,Ju.motorcycle)}),tracked:Nl({...kD,torquePerKg:5090/Ju.tracked,idleRPM:500,maxRPM:4e3,torqueCurve:[[0,1],[1,.5]],gears:u9,reverse:4,finalDrive:6,...CD(4e3,4e3,u9),wheelCast:"ray",suspensionFrequency:1,suspensionTravel:.3,airDrag:ID(8.5,Ju.tracked),engineDamping:fb.engineDamping,rollingResistance:.015,engineBraking:.1})});function f9(e){e.onGround=!1,e.compression=e.longitudinalSlip=e.lateralSlip=e.angularVelocity=0,e.load=e.slideAlong=e.slideAcross=0,e.groundMaterial=-1,e.contactPoint.set(0,0,0),e.contactNormal.set(0,0,0),e.contactBody=null}var P_e=()=>{let e={contactPoint:new I,contactNormal:new I};return f9(e),e},C_e=new Set(["marks","sound"]),nm=(e,t,r)=>k(Number.isFinite(e)?e:0,t,r),ed=class{_input={throttle:0,brake:0,steer:0,handbrake:!1,gear:1,clutch:1};_host=null;_id=-1;_speed=0;_rpm=0;_throttle=0;_mass=0;_limiting=!1;_gear=0;kind;body;wheels;_spec;_tyres;_tyreWords;_tyreFloats;_tyresOwed=!1;constructor(t,r,n){let{wheels:o,...i}=n;this.kind=t,this.body=r,this.wheels=[...o],this._spec=Nl(i,FD[t]),PD(this,i),this._tyres=this.wheels.map(P_e),this._tyreWords=new Uint32Array(this.wheels.length*16),this._tyreFloats=new Float32Array(this._tyreWords.buffer)}get spec(){return this._spec}set(t){let r=this._spec,n=Nl(t,r);PD({kind:this.kind,body:this.body,wheels:this.wheels,spec:n},t),this._spec=n;let o=Object.keys(t);(o.length===0||o.some(i=>!C_e.has(i)))&&this._host?.tune(this,r)}get grip(){return this._spec.grip}set grip(t){this.set({grip:t})}get wheelStates(){return this._tyresOwed&&this._host&&(this._host.readTyres(this._tyres,this._tyreWords,this._tyreFloats),this._tyresOwed=!1),this._tyres}get input(){return this._input}get speed(){return this._speed}get rpm(){return this._rpm}get gear(){return this._gear}get throttle(){return this._throttle}get mass(){return this._mass}drive(t){let r=this._input;r.throttle=nm(t.throttle,0,1),r.brake=nm(t.brake,0,1),r.steer=nm(t.steer,-1,1),r.handbrake=!!t.handbrake;let{gears:n,reverseGears:o}=this.spec;t.gear!==void 0&&(r.gear=Math.trunc(nm(t.gear,-(o?.length??1),n.length))),t.clutch!==void 0&&(r.clutch=nm(t.clutch,0,1)),this._host?.drive(this)}_state(t,r,n,o,i,s){this._speed=t,this._rpm=r,this._gear=n,this._limiting=s===1,this._throttle=o,this._mass=i}_noteTyres(t,r){this._tyreWords.set(t.subarray(r,r+this._tyreWords.length)),this._tyresOwed=!0}_rest(){this._state(0,0,0,0,0,0),this._tyresOwed=!1;for(let t of this._tyres)f9(t)}},ND=e=>(t,r)=>new ed(e,t,r),I_e={car:ND("car"),motorcycle:ND("motorcycle"),tracked:ND("tracked")};function BD(e,t){let r=Vh(e);return{switch(n){let o=r.drawn;r.switch(n!==void 0,n!==void 0&&n.transform!==!1),o&&!r.drawn&&t()},opened(){r.drawn||t()}}}var hb=new WeakMap,UD=new WeakSet,xn=e=>hb.get(e)??e;function mb(e,t,r){let n=hb.get(e);n||hb.set(e,n={width:t,height:r}),n.width=t,n.height=r,!UD.has(e)&&(e.width=t,e.height=r)}function k_e(e,t,r){e.width!==t&&(e.width=t),e.height!==r&&(e.height=r)}var SMt=e=>void UD.add(e);function wMt(e){UD.delete(e);let t=hb.get(e);t&&k_e(e,t.width,t.height)}function td(e,t,r){let n=xn(e),o=n.width/Math.max(1,e.clientWidth),i=n.height/Math.max(1,e.clientHeight);return r.x=t.x*o,r.y=t.y*i,r.width=t.width*o,r.height=t.height*i,r}var F_e={x:0,y:0,width:0,height:0},N_e=[1,1];function om(e,t,r){let n=td(e,t,F_e);return r[0]=Math.max(1,Math.round(n.width)),r[1]=Math.max(1,Math.round(n.height)),r}function gb(e,t){let[r,n]=om(e,t,N_e);return r/n}function Sb(e,t,r){let{x:n,y:o,width:i,height:s}=e;r.x=n,r.y=o,r.width=i,r.height=s;let a=t-i/s;return t>0&&Math.abs(a)>.01&&(a>0?(r.height=Math.max(1,Math.round(i/t)),r.y=o+Math.round((s-r.height)/2)):(r.width=Math.max(1,Math.round(s*t)),r.x=n+Math.round((i-r.width)/2))),r}function VD(e,t,r){if(t)td(e,t,r);else{let n=xn(e);r.x=r.y=0,r.width=n.width,r.height=n.height}return r.x=Math.round(r.x),r.y=Math.round(r.y),r.width=Math.max(1,Math.round(r.width)),r.height=Math.max(1,Math.round(r.height)),r}function Xi(e,t,r,n){if(!r.constrainAspectRatio)return t;let o=xn(e),i=o.width/Math.max(1,e.clientWidth),s=o.height/Math.max(1,e.clientHeight);return Sb(VD(e,t,n),r.aspect,n),n.x/=i,n.y/=s,n.width/=i,n.height/=s,n}var B_e={x:0,y:0,width:0,height:0};function U_e({entry:e,piece:t,index:r,point:n,distance:o}){return{guide:e.handle,object:t.node??null,index:r,point:new I(n[0],n[1],n[2]),distance:o}}async function p9(e,t,r,n,o){if(!_x(e))return null;let i=M.guides.get()??await M.guides.load();if(!_x(e))return null;let{camera:s,canvas:a,viewport:l}=t,c={camera:s,aspect:1,width:0,height:0,x:0,y:0};i.readPickView(c,s,a,Xi(a,l,s,B_e),r);let u=i.pickGuides(e,n,c,{only:typeof o.guides=="object"?o.guides:void 0,tolerance:o.linePixels??0,far:o.reach??1/0});return u&&{hit:U_e(u),foreground:u.foreground}}var V_e=new Set(["point","spot","directional","rectArea"]),h9=me-1e-9,wb=new I,ai=new I,g9=new I,G_e=new I(0,1,0),m9=(e,t)=>[e.r*t,e.g*t,e.b*t],H_e=e=>e.intensityUnits==="ev"&&Da({kind:Vv(e.kind),inverseSquared:e.inverseSquared})?Number.isFinite(e.intensity):e.intensity>0;function S9(e,t,r){if(!V_e.has(e.kind)||!H_e(e))return null;let n=e.kind==="rectArea",o=n?"rect":e.kind;e.getWorldPosition(wb);let i={id:t,kind:o,color:e.color.toArray(),intensity:e.intensity,castsShadow:e.castShadow};return e.fogScattering!==1&&(i.fogScattering=e.fogScattering),o!=="directional"&&e.shadowResolutionScale!==1&&(i.shadowResolutionScale=e.shadowResolutionScale),r8(e,i),e8(e,i),Z$(e,i),w$(e,i),e.castTranslucentShadows||(i.castTranslucentShadows=!1),e.shadowsFog!==(o==="directional")&&(i.shadowsFog=e.shadowsFog),e.mobility!==Ta&&(i.mobility=e.mobility),e.lightGroups!==iS&&(i.lightGroups=e.lightGroups),x$(e,i),Object.assign(i,hx(e),gx(e),Sx(e),wx(e)),W_e(e,i,o,n),p8(e,i),o==="directional"?(z_e(e,i),i):(i.position=wb.toArray(),i.range=e.distance>0?e.distance:r(wb),o==="spot"&&j_e(e,i),n||$_e(i,e,i.range),i)}function W_e(e,t,r,n){if(n){e.getWorldDirection(ai);let o=e.matrixWorld.elements;t.right=g9.set(o[0],o[1],o[2]).normalize().toArray(),t.size=[e.width,e.height]}r!=="point"&&(n||e.target.getWorldPosition(ai).sub(wb),t.direction=(ai.lengthSq()>0?ai.normalize():ai.set(0,-1,0)).toArray())}function z_e(e,t){e.angularRadius>0&&(t.angularRadius=e.angularRadius),e.softAngle>0&&(t.softAngle=e.softAngle),e.atmosphereSun||(t.atmosphereSun=!1),e.atmosphereSunIndex!==0&&(t.atmosphereSunIndex=e.atmosphereSunIndex),e.forwardShadingPriority!==0&&(t.forwardShadingPriority=e.forwardShadingPriority)}function j_e(e,t){t.outerConeAngle=Math.min(e.outerConeAngle,h9),e.innerConeAngle!==Ma&&(t.innerConeAngle=k(e.innerConeAngle,0,h9))}function $_e(e,t,r){if(J$(t,e),t.radius>0&&t.radius<r&&(e.emitterRadius=t.radius),t.softRadius>0&&t.softRadius<r&&(e.emitterSoftRadius=t.softRadius),!(t.tubeLength>0))return;let n=t.matrixWorld.elements;e.emitterLength=t.tubeLength,e.emitterAxis=g9.set(n[4],n[5],n[6]).normalize().toArray()}function w9(e,t){if(!(e.intensity>0))return!1;let r=e.intensity;if(e.kind==="probe"&&e.sh)fA(t,e.sh,r);else if(e.kind==="ambient"||e.kind==="probe")uA(t,m9(e.color,r));else if(e.kind==="hemisphere"){e.getWorldPosition(ai),ai.lengthSq()>0||ai.set(0,1,0);let n=e.groundColor.toArray().map(o=>o*r);dA(t,m9(e.color,r),n,ai.normalize().toArray())}else return!1;return!0}var Y_e=e=>e==="rect"?"rectArea":e;function y9(e){let t=e.direction??[0,-1,0],r=e.position??[-t[0],-t[1],-t[2]],n=new $e(Y_e(e.kind),{width:e.size?.[0],height:e.size?.[1],color:e.color,intensity:e.intensity,intensityUnits:e.intensityUnits,castShadow:e.castsShadow,position:r,target:[r[0]+t[0],r[1]+t[1],r[2]+t[2]],distance:e.range,innerConeAngle:e.innerConeAngle,outerConeAngle:e.outerConeAngle,radius:e.emitterRadius,angularRadius:e.angularRadius,softAngle:e.softAngle,hairDeepShadowLayerDistribution:e.hairDeepShadowLayerDistribution,castHairDeepShadow:e.castHairDeepShadow,castTranslucentShadows:e.castTranslucentShadows,atmosphereSun:e.atmosphereSun,atmosphereSunIndex:e.atmosphereSunIndex,forwardShadingPriority:e.forwardShadingPriority,useTemperature:e.useTemperature,temperatureKelvin:e.temperatureKelvin,shadowsAir:e.shadowsAir,transmittancePerPixel:e.transmittancePerPixel,transmission:e.transmission,sunDiskTint:e.sunDiskTint,fogScattering:e.fogScattering,shadowResolutionScale:e.shadowResolutionScale,shadowsFog:e.shadowsFog,mobility:e.mobility,lightGroups:e.lightGroups,softRadius:e.emitterSoftRadius,tubeLength:e.emitterLength,inverseSquared:e.inverseSquared,radialExponent:e.radialExponent,diffuseShare:e.diffuseShare,specularShare:e.specularShare,...t8(e),...h8(e),...v$(e),...F$(e),...G$(e),...$$(e)});return n.name=e.id,e.emitterAxis&&n.quaternion.setFromUnitVectors(G_e,ai.set(...e.emitterAxis)),n}var x9=2,K_e=8,q_e={f64:8,f32:4,u32:4,i32:4},X_e={f64:Float64Array,f32:Float32Array,u32:Uint32Array,i32:Int32Array};function HMt(e,t=[e.held_length()]){let r=e.held_at(),n=e.held_length();try{if(_n(t)!==n)throw new Error("WASM_HELD_LAYOUT");let o=r;return t.map(i=>{let s=e.memory.buffer.slice(o,o+i);return o+=i,s})}finally{e.held_free()}}function GD(e,t){let r=[],n=0;for(let u of t)r.push({request:u,start:n}),n+=Vr(u.length*q_e[u.type],K_e);let o=e.arena_alloc(n);if(!o)return null;let i=()=>r.map(({request:u,start:d})=>({type:u.type,offset:o+d,view:new X_e[u.type](e.memory.buffer,o+d,u.length)})),s=i(),a=e.memory.buffer,l=!1,c=()=>(!l&&e.memory.buffer!==a&&(a=e.memory.buffer,s=i()),s);return{blocks:c,bytes:n,list:(u,d)=>c()[u].view.subarray(0,d),freed:()=>{l||(l=!0,s=[],e.arena_free(o,n))}}}function WMt(e,t,r,n){let o=GD(e,t);if(!o)throw new Error(r);try{return n(o)}finally{o.freed()}}var jMt={VERSION:0,PAGES:1,GROUPS:2,NODES:3,LISTS:4,CORNERS:5,GEOMETRY:6,PARENTS:7,COVER_VERTICES:8,COVER_CORNERS:9,BALLS:10,TARGETS:11,STILL:12,UNKNOWN_JOINT:13,UNKNOWN_WEIGHTS:14},$Mt={CORNER_COUNT:0,CORNER_FIRST:1,GEOMETRY_OFFSET:2,GEOMETRY_BYTES:3,START:4,VERTEX_COUNT:5,FLAGS:6,DECODED_BYTES:7,RESIDENT_BYTES:8,LEVEL:9,GROUP:10,SOURCE:11},YMt={LOD_ERROR:0,PARENT_ERROR:1,MIN:2,MAX:5,SPHERE:8,PARENT_SPHERE:12},KMt={LEVEL:0,CHILDREN_FIRST:1,CHILDREN_COUNT:2,OUTPUTS_FIRST:3,OUTPUTS_COUNT:4},qMt={ERROR:0,SPHERE:1};var QMt={INDICES:0,INDEX_COUNT:1,POSITIONS:2,VERTEX_COUNT:3,NORMALS:4,UV0:5,UV1:6,UV2:7,UV3:8,COLORS:9,COLOR_WIDTH:10,POSITION_PRECISION:11,JOINTS:12,WEIGHTS:13,INFLUENCES:14,TARGET_COUNT:15,TARGETS:16,UV4:17,UV5:18,UV6:19,UV7:20,SKIN_JOINTS:21},ZMt={VERTEX_COUNT:0,INDEX_COUNT:1,FLAGS:2,DECODED_BYTES:3,MORPH_TARGETS:4,SKIN_INFLUENCES:5,LOW_X:6,HIGH_Z:11,RESIDENT_BYTES:12};function Q_e(e){let t=r=>typeof r=="function"?r():0;return[["computation contract",t(e.math_contract),x9],["cut answer version",t(e.cut_version),5],["request words",t(e.request_words),22],["page format version",t(e.page_version),12]]}function b9(e){let t=Q_e(e).filter(([,r,n])=>r!==n);if(t.length){let r=t.map(([n,o,i])=>`${n} ${o}; this loader expects ${i}`);throw new Error(`SDK_WASM_CONTRACT: ${r.join(", ")} \u2014 kernels.wasm is not the build of this engine's sources: build it again (pnpm run build:wasm)`)}return e}var HD=()=>n0().then(b9),E9=()=>b9(o0());function T9(e){let t=E9(),r=GD(t,e);return r&&{wasm:t,blocks:r.blocks,release:r.freed}}var A9=e=>e.view,O9=(e,t)=>e[t]?.view.length??0;function L9(e,t,r,n){let o=T9(t.map(u=>({type:"f64",length:e*u})));if(!o)return null;let{wasm:i,blocks:s,release:a}=o,l=s().map(u=>u.offset),c={n:e,holds:u=>u>0&&O9(s(),0)===u*t[0],run:(u=e)=>n(i,l,Math.min(u,e)),release:a};return r.forEach((u,d)=>Object.defineProperty(c,u,{get:()=>A9(s()[d]),enumerable:!0})),c}var WD=e=>L9(e,[vt,16,vt],["boxes","mats","out"],(t,[r,n,o],i)=>t.math_box_transform_batch(o,r,n,i));async function R9(e){return await HD(),WD(e)}var Z_e=e=>L9(e,[16,16,16],["a","b","out"],(t,[r,n,o],i)=>t.math_multiply_matrix4_batch(o,r,n,i));async function dDt(e){return await HD(),Z_e(e)}function _9(e,t){if(!e)throw new Error(`MATH_LOT_REFUSED: the module refused a lot of ${t} elements`);return e}var J_e=new Float64Array(0);function v9(e,t,r){let n=r>0&&!t?.holds(r)?_9(WD(r),r):null,o=n??(r>0?t:null),i=0;return{get boxes(){return o?o.boxes:J_e},get at(){return i*vt},pose(s){o?.mats.set(s,i++*16)},close(){return o&&i&&(o.run(i),fL(e,o.out,i)),n?.release(),e}}}function e1e(e){let{listed:t,depth:r,order:n}=e,o=e.listedCount,i=0;for(let a=0;a<o;a++)i=Math.max(i,r[t[a]]);e.buckets.length<i+2&&(e.buckets=new Int32Array(2*(i+2)));let s=e.buckets;s.fill(0,0,i+2);for(let a=0;a<o;a++)s[r[t[a]]+1]++;for(let a=1;a<=i;a++)s[a]+=s[a-1];for(let a=0;a<o;a++)n[s[r[t[a]]]++]=t[a];return e.listedCount=0,o}function li(e){if(!e.listedCount)return 0;let t=e1e(e),{order:r,flags:n,stamp:o}=e,i=Yg(e)*2+1,s=0;for(let a=0;a<t;a++){let l=r[a],c=n[l];if(n[l]=c&-33,!(!(c&16)||c&64||o[l]===i))for(let u=l;u>=0;u=yi(e,u,l),s++)ba(e,u,!0),o[u]=i}return s}function M9(e){let t=he._treeOf(e);return li(t),{of:r=>r.matrixWorld,refresh:()=>void li(t)}}function im(){let e=new Float64Array(vt);return gi(e,0),e}function D9(e){if(e.boundingBox!==void 0)return e.boundingBox===null&&e.computeBoundingBox?.(),e.boundingBox??void 0;let t=e.geometry;if(t)return t.boundingBox===null&&t.computeBoundingBox(),t.boundingBox??void 0}function P9(e){let t=0;return e.traverse(r=>{D9(r)&&t++}),t}async function _Dt(e){let t=P9(e);return t?await R9(t):null}function t1e(e,t,r){t[r]=e.min.x,t[r+1]=e.min.y,t[r+2]=e.min.z,t[r+3]=e.max.x,t[r+4]=e.max.y,t[r+5]=e.max.z}function yb(e,t=im(),r){let n=M9(e),o=v9(t,r,P9(e));return e.traverse(i=>{let s=D9(i);s&&(t1e(s,o.boxes,o.at),o.pose(n.of(i).elements))}),o.close()}var C9=new WeakMap,xb=new WeakMap;function r1e(e){let t=C9.get(e);if(t)return t;let r=[],n=[],o=[e.scene.source],i=[-1];for(;o.length;){let c=o.pop(),u=r.length;r.push(c),n.push(i.pop());let{children:d}=c;for(let f=d.length-1;f>=0;f--)o.push(d[f]),i.push(u)}let s=Int32Array.from(n),a=new Int32Array(r.length);for(let c=r.length-1;c>=0;c--)a[c]+=1,s[c]>=0&&(a[s[c]]+=a[c]);for(let c=0;c<r.length;c++)a[c]+=c;let l={objects:r,parent:s,end:a,slotOf:new Map(r.map((c,u)=>[c,u]))};return C9.set(e,l),l}function I9(e,t){let r=0,n=e.length-1;for(;r<=n;){let o=r+n>>1,i=e[o];if(t<i.top)n=o-1;else if(t>=i.end)r=o+1;else return i}}function n1e(e,t){let r=e.order.end[t],n=r-t,o=new Float64Array(n*16),i={top:t,end:r,nodes:new Array(n),views:Array.from({length:n},(a,l)=>o.subarray(l*16,(l+1)*16)),composed:new Uint32Array(n),written:new Uint8Array(n).fill(1)},s=[];for(let a of e.blocks)a.top<t||a.top>=r?s.push(a):a.nodes.forEach((l,c)=>i.nodes[a.top-t+c]=l);return s.push(i),e.blocks=s.sort((a,l)=>a.top-l.top),e.layout++,i}function o1e(e,t){let{objects:r,parent:n}=e.order,{top:o,end:i,nodes:s,views:a,composed:l,written:c}=t;for(let u=o;u<i;u++){let d=u-o,f=n[u];if(!c[d]){if(f<o||!c[f-o])continue;c[d]=1}let h=(s[d]??r[u])._matrixElements;if(f<0)Ce(a[d],h);else{let m=f<o?r[f].matrixWorld.elements:a[f-o];Ve(a[d],m,h)}l[d]=++e.clock}c.fill(0)}function i1e(e){e.stale=!1,li(he._treeOf(e.order.objects[0]));for(let t of e.blocks)o1e(e,t)}function k9(e,t,r,n,o){let i=xb.get(e);if(!i){if(!o(r,n))return;let c=r1e(t),u={readers:new Map,skeletons:new Map};xb.set(e,i={order:c,blocks:[],layout:0,clock:0,stale:!1,...u})}let s=i.order.slotOf.get(n);if(s===void 0)return;let a=I9(i.blocks,s);if(!a?.nodes[s-a.top]&&!o(r,n))return;let l=a??n1e(i,s);l.nodes[s-l.top]=r,l.written[s-l.top]=1,i.stale=!0}var bb=class{#e;#t;#n=-1;#r;#o;#i=0;constructor(t,r){this.#e=t,this.#t=t.order.slotOf.get(r)??-1}#s(){let t=this.#e;if(t.stale&&i1e(t),this.#n===t.layout)return;this.#n=t.layout;let r=this.#t<0?void 0:I9(t.blocks,this.#t);this.#i=r?this.#t-r.top:0,this.#r=r?.views[this.#i],this.#o=r?.composed}matrix(){return this.#s(),this.#r}clock(){return this.#s(),this.#o?this.#o[this.#i]:0}};function jD(e,t){let r=xb.get(e);if(!r)return;let n=r.readers.get(t);return n||r.readers.set(t,n=new bb(r,t)),n}var Eb=(e,t)=>jD(e,t)?.matrix(),zD=class extends bb{#e;constructor(t,r){super(t,r),this.#e=r}get matrixWorld(){return this}get elements(){return this.matrix()??this.#e.matrixWorld.elements}get name(){return this.#e.name}get _worldVersion(){return this.clock()}};function F9(e,t){let r=xb.get(e);if(!r)return t;let n=r.skeletons.get(t);if(!n){let o=t.bones.map(a=>new zD(r,a)),{boneInverses:i,inverses:s}=t;n=Object.assign(Object.create(Ds.prototype),{isSkeleton:!0,bones:o,boneInverses:i,inverses:s}),r.skeletons.set(t,n)}return n}var KD=new WeakMap,qD=new WeakMap,$D=new WeakMap,YD=class extends he{linked(t){t&&XD(this)}get visible(){return super.visible}set visible(t){let r=super.visible;super.visible=t;let n=qD.get(this);n&&super.visible!==r&&$D.set(n,($D.get(n)??0)+1)}},U9=e=>$D.get(e)??0,sm=10,s1e=new Float64Array(sm),Ab=new Float64Array(sm),a1e=Ab.subarray(0,3),l1e=Ab.subarray(3,7),c1e=Ab.subarray(7,10);function Ob(e,t,r=0){if(!e.matrixAutoUpdate)return Rr(e._matrixElements,a1e,l1e,c1e),t.set(Ab,r),t;let{position:n,quaternion:o,scale:i}=e;return t[r]=n.x,t[r+1]=n.y,t[r+2]=n.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z,t[r+6]=o.w,t[r+7]=i.x,t[r+8]=i.y,t[r+9]=i.z,t}function V9(e,t){let r=new YD;r.name=e.name;let n=Ob(e,s1e);r.position.set(n[0],n[1],n[2]),r.quaternion.set(n[3],n[4],n[5],n[6]),r.scale.set(n[7],n[8],n[9]),r.visible=e.visible,r.castShadow=e.castShadow,r.castsShadowMaps=e.castsShadowMaps,r.farField=e.farField,J0(r,e);let o=e.morphTargetInfluences;return o&&(r.morphTargetInfluences=o.slice()),KD.set(r,e),qD.set(r,t),r}var Tb=new Float64Array(sm);function u1e(e,t){if(!e.matrixAutoUpdate)return!0;Ob(t,Tb);let r=e.position.elements,n=e.quaternion.elements,o=e.scale.elements;for(let i=0;i<3;i++)if(r[i]!==Tb[i]||o[i]!==Tb[7+i])return!0;for(let i=0;i<4;i++)if(n[i]!==Tb[3+i])return!0;return!1}function XD(e){let t=KD.get(e),r=qD.get(e);t&&r&&k9(r,r.record,e,t,u1e)}var G9=e=>KD.get(e),N9=new WeakMap,B9=new Float64Array(4);function am(e){let t=N9.get(e);return t||N9.set(e,t=new Map(e.flatMap((r,n)=>[[r,n]]))),t}function H9(e,t){let r=am(e),n=[];e[t].traverse(i=>{let s=r.get(i);s!==void 0&&n.push(s)});let o=yb(e[t],im());return ys(B9,o,1),{indices:n,radius:Math.max(0,B9[3])}}var W9=new WeakMap;function Lb(e,t){let r=wa(),n=W9.get(e);if(n?.edits!==r){let o=new Map;e.traverse(i=>void(o.has(i.name)||o.set(i.name,i))),W9.set(e,n={edits:r,names:o})}return n.names.get(t)}var Rb=e=>e instanceof ot,_b=e=>{if(!(e instanceof ot))return!1;let t=Qr(e.material);return t instanceof qe&&t.domain==="volume"},vb=e=>{if(!(e instanceof ot))return!1;let t=Qr(e.material);return t instanceof qe&&t.domain==="deferredDecal"},We=e=>e instanceof Qo,Ao=e=>e instanceof $e,qDt=e=>e.kind==="directional"||e.kind==="spot"?e.target:void 0;var Mb=sm,QD=new WeakMap,z9=new WeakMap,j9=new WeakMap;function d1e(e){if(QD.has(e))return;let t=e.scene.nodes??[],r=am(t),n=new Int32Array([...r.values()].sort((s,a)=>s-a)),o=new Int32Array(n.length),i=new Float64Array(n.length*Mb);n.forEach((s,a)=>{let l=t[s];o[a]=l.parent?r.get(l.parent)??-1:-1,Ob(l,i,a*Mb)}),QD.set(e,{ranks:n,parents:o,poses:i})}function f1e({ranks:e,parents:t,poses:r},n){return Array.from(e,(o,i)=>{let s=r.subarray(i*Mb,(i+1)*Mb);return Object.freeze({index:o,name:n[o].name,parent:t[i],position:Object.freeze([s[0],s[1],s[2]]),quaternion:Object.freeze([s[3],s[4],s[5],s[6]]),scale:Object.freeze([s[7],s[8],s[9]])})})}function ZD(e,t,r){let n=Rb(e)?e.skeleton:void 0;n&&r(n);for(let o of e.children)t.has(o)||ZD(o,t,r)}function $9(e,t){let r=e[t],n=!1;return r&&ZD(r,am(e),()=>n=!0),n}function p1e(e){let t=am(e),r=new Map;for(let[n,o]of t)ZD(n,t,i=>{let s=r.get(i);if(!s){let a=i.bones.map(l=>t.get(l)??-1);r.set(i,s={joints:a,inverses:i.boneInverses,nodes:[]})}s.nodes.includes(o)||s.nodes.push(o)});return[...r.values()].map(({joints:n,inverses:o,nodes:i})=>Object.freeze({joints:Object.freeze(n),inverseBindMatrices:Float64Array.from(o),nodes:Object.freeze(i.sort((s,a)=>s-a))}))}function JD(e){let t=z9.get(e);if(t)return t;d1e(e);let r=e.scene.nodes??[];return t=Object.freeze({bones:Object.freeze(f1e(QD.get(e),r)),skins:Object.freeze(p1e(r)),ragdoll:e.ragdoll??null}),z9.set(e,t),t}function lm(e,t){let r=j9.get(e);if(!r){let n=new Map;for(let{name:o,index:i}of JD(e).bones)n.has(o)||n.set(o,i);j9.set(e,r=n)}return r.get(t)??-1}function eP(e,t){let r=typeof t=="string"?lm(e,t):t;if(Number.isInteger(r)&&r>=0)return r;throw new RangeError(typeof t=="string"?`A model: no node of its file is named "${t}".`:`A model's node is a whole number from 0, or a name: not ${String(t)}.`)}var h1e=({vertexColors:e,flatShading:t,twoSided:r})=>`${e}:${t}:${r}`,tPt=(e,t)=>({vertexColors:e.attributes.color!==void 0,flatShading:e.attributes.normal===void 0,twoSided:t}),Y9=new WeakMap,rPt=e=>Y9.get(e)??e;function m1e(e,{vertexColors:t,flatShading:r,twoSided:n}){let{released:o,version:i,...s}=e,a=Object.assign(new Bs,s,{version:0});return Y9.set(a,e),t&&(a.vertexColors=!0),r&&(a.flatShading=!0),n&&(a.side="double"),a}function Db(e,t,r){if(!r.vertexColors&&!r.flatShading&&!r.twoSided)return e;let n=h1e(r),o=t.get(n);return o||t.set(n,o=m1e(e,r)),o}var tP=(e,t)=>({transparent:e==="blend",alphaTest:e==="mask"?t:0}),g1e=e=>typeof e=="object"&&e!==null&&"texture"in e;function S1e(e,t,r){for(let[n,o]of Object.entries(e.extensions))g1e(o)?r(n,o):n==="clearcoatNormalScale"?t[n]=new Me(o,o):hh.has(n)?t[n]=new pe(o):t[n]=Array.isArray(o)?[...o]:o;if(e.kind==="physical"&&e.derivativeTangents){let n=t.clearcoatNormalScale??new Me(1,1);t.clearcoatNormalScale=n.set(n.x,-n.y)}}var K9=new WeakMap,rd=e=>K9.get(e);async function w1e(e,t,r){let n=e[t],o={color:new pe(n.baseColor),opacity:n.opacity},i=[],s=(l,c)=>{c&&i.push(r(c,mj.has(l)).then(u=>{u&&(o[l]=u)}))};s("map",n.map);let a=n.sky===!0;if(a&&(o.sky=!0),n.kind!=="unlit"&&!a&&(o.metalness=n.metalness,o.roughness=n.roughness,s("metalnessMap",n.metalnessMap),s("roughnessMap",n.roughnessMap),s("normalMap",n.normalMap),o.normalScale=new Me(n.normalScale,n.normalScaleY),s("aoMap",n.aoMap),o.aoMapIntensity=n.aoIntensity,S1e(n,o,s)),(a||n.kind!=="unlit")&&(o.emissive=new pe(n.emissive),s("emissiveMap",n.emissiveMap)),n.kind==="physical"&&!a&&(o.transmission=n.transmission,n.hasIor&&(o.ior=n.ior),o.thickness=n.thickness,o.attenuationDistance=n.attenuationDistance||1/0,o.attenuationColor=new pe(n.attenuationColor)),o.forVertexTangents=!n.derivativeTangents,o.litFrom=q1(n.kind==="physical"&&n.transmission>0),n.doubleSided&&(o.side="double"),n.responsive!==void 0&&(o.responsive=n.responsive),n.displacement){let{map:l,...c}=n.displacement;s("displacementMap",l),o.displacement=c}return Object.assign(o,tP(n.alphaMode.toLowerCase(),n.alphaTest)),await Promise.all(i),o.family=n.kind==="unlit"||a?"basic":n.kind==="physical"?"physical":"standard",n.name&&(o.name=n.name),Ki(o)}function uPt(e,t){let r=new Map,n=new Map;return async(o,i)=>{let s=r.get(o);s||r.set(o,s=w1e(e,o,t));let a=n.get(o);a||n.set(o,a=new Map);let l=Db(await s,a,i);return K9.set(l,o),l}}function nd(e){let t=[];return e.traverse(r=>{Rb(r)&&t.push(r)}),t}function*pPt(e){for(let t of Object.values(e))t?.isTexture&&(yield t)}var q9=new WeakMap;function rP(e){let t=q9.get(e);if(t)return t;let r=new Map;for(let n of nd(e.scene.source)){let o=[n.material].flat()[0],i=o&&rd(o);i!==void 0&&!r.has(i)&&r.set(i,o.name)}return t=[...r].sort(([n],[o])=>n-o).map(([n,o])=>({index:n,name:o})),q9.set(e,t),t}function X9(e,t){let r=rP(e).find(({index:n,name:o})=>typeof t=="number"?n===t:o===t);if(!r)throw new E("UNKNOWN_MATERIAL",`the model ${e.manifestUrl} has no material slot ${String(t)}`,{slot:t,manifestUrl:e.manifestUrl});return r.index}var Pb=class{worn=new Map;tell;hearing=!1;constructor(t){this.tell=t}set(t,r){if(this.worn.get(t)===(r??void 0))return;let n=this.hearing;this.hear(!1),r?this.worn.set(t,r):this.worn.delete(t),this.hear(n),this.tell()}hear(t){if(t!==this.hearing){this.hearing=t;for(let r of this.worn.values())t?r._listeners.subscribe(this.tell):r._listeners.unsubscribe(this.tell)}}};function Q9(e,t,r){for(let n=r;n<e.length;n++)if(e[n].length>=t)return n;return-1}function Z9(e){let{free:t,given:r}=e;if(r.length===0&&e.first===0)return;r.sort((l,c)=>l.start-c.start);let n=[],o=-1,i=0,s=0;for(;i<t.length||s<r.length;){let l=s<r.length&&(i>=t.length||r[s].start<t[i].start)?r[s++]:t[i++];if(l.length<=0)continue;o===l.start?n[n.length-1].length+=l.length:n.push({start:l.start,length:l.length});let c=n[n.length-1];o=c.start+c.length}let a=n[n.length-1];a&&a.start+a.length===e.extent&&(e.extent-=a.length,n.pop()),e.free=n,r.length=0,e.first=0}function y1e(e,t){let r=Q9(e.free,t,e.first);if(r<0&&e.given.length>0&&(Z9(e),r=Q9(e.free,t,e.first)),r>=0){let o=e.free[r];return e.free[r]={start:o.start+t,length:o.length-t},o.length===t&&e.first===r&&(e.first=r+1),o.start}let n=e.extent;return e.extent+=t,e.peak=Math.max(e.peak,e.extent),n}function J9(e=!1){let t={extent:0,peak:0,free:[],given:[],first:0},r=()=>n.extent=e?t.peak:t.extent,n={allocate(o){let i=y1e(t,o);return r(),i},release(o,i){t.given.push({start:o,length:i})},consolidate(){Z9(t),r()},extent:0};return n}var nP=new WeakSet,x1e=e=>!nP.has(e),oP=(e,t)=>void(t?nP.delete(e):nP.add(e));function iP(e){let t=fn(e);return()=>Kf(t)}var Bl,b1e,Bt,dr,Oo,Cb,e7,lP,Ib,um,cP,uP,kb,sP,dP,od,aP=new WeakMap,E1e="model.surface()";function t7(e,t){if(!e.metadata.texturePreviews?.some(({image:r})=>r===t))throw new E("UNKNOWN_IMAGE",`the model ${e.manifestUrl} has no image ${t}`,{index:t,manifestUrl:e.manifestUrl})}var cm=class e extends he{isLoadedModel=!0;_rowsReadSwitches=!0;bounds;get lights(){return this.children.filter(t=>t.isLight===!0)}get animations(){return this.record.scene.clips??[]}get skeleton(){return JD(this.record)}bone(t){let r=typeof t=="number"?t:lm(this.record,t),n=Number.isInteger(r)&&r>=0?this._graphNodeAt(r):null;return n?this.nodeOf(n):null}ragdoll(t,r){return M.ragdoll.load().then(({makeRagdoll:n})=>n(this,t,r))}async surface(){let t=iP(this),r=()=>en(E1e,"foliage",t()),{modelSurface:n,releaseSurface:o}=await Cr(M.modelSurface,r),i;try{i=await n(this)}catch(s){throw r(),s}try{r()}catch(s){throw o(this),s}return i}get materials(){let{worn:t}=this.#m;return rP(this.record).map(r=>({...r,material:t.get(r.index)??null}))}setMaterial(t,r){return this.#m.set(X9(this.record,t),r),this}async setImage(t,r){t7(this.record,t),(await M.modelImages.load()).setModelImage(this,t,r)}async resetImage(t){t7(this.record,t),(await M.modelImages.load()).resetModelImage(this,t)}record;carried=new WeakSet;#e=[];#t;#n;#r;#o=0;#i;#s;#h=[];#c;#a=0;#u=1;#d=new Set;#l=0;#f;#p=!0;get collision(){return this.#p}set collision(t){t!==this.#p&&(this.#p=t,this._link?.collision?.(this))}nodeCollision(t){let r=eP(this.record,t);return!this.#r?.has(r)}setNodeCollision(t,r){if(typeof r!="boolean")throw new TypeError(`setNodeCollision takes true or false, not ${String(r)}.`);let n=eP(this.record,t);return r===!this.#r?.has(n)?this:(r?this.#r.delete(n):(this.#r??=new Set).add(n),this.#o++,this._link?.collision?.(this),this)}#m=new Pb(()=>this._link?.content(this));static{kb=t=>t.#m,sP=t=>aP.get(t)??0,od=t=>t.looked,dP=t=>#r in t?[...t.#r??[]]:[],Bl=t=>t.#e,b1e=(t,r)=>{t.#e=r},Bt=t=>t.#t??t.record.scene.partitions,dr=t=>t.#a,Oo=t=>t.#u,e7=(t,r)=>{t.#h=r;for(let n of r){let o=y9(n);t._addFromFile(o,o.target)}},lP=t=>{let r=t.#s??t,n=new e(r.record);return Cb(r,n,1),n.#t=r.record.scene.partitions.map(o=>o.placement()),e7(n,r.#h),n},Cb=(t,r,n)=>{let o=t.#s??t;r.#s=o,r.#u=n,r.#a=(o.#c??=J9(!0)).allocate(n)+1,r.#e=o.#e,r.#t=[]},Ib=t=>{let r=t.#s;!t.#f||--t.#l>0||!r||t.#a<=0||(r.#c?.release(t.#a-1,t.#u),t.#a=-1)},um=(t,r)=>void t.#d.add(r),cP=t=>t.#f??ti(t).worldMatrix,uP=(t,r,n)=>{let o=n===void 0?r:t._graphNodeAt(n);return o?t.nodeOf(o):t}}_fromFile(t){return this.carried.has(t)}_addFromFile(...t){for(let r of t)this.carried.add(r),this.add(r);return this}looked=new Map;nodeOf(t){let r=this.looked.get(t);if(r)return r;let n=!this.looked.size;return r=V9(t,this),this.looked.set(t,r),t===this.record.scene.source||!t.parent?this._addFromFile(r):this.nodeOf(t.parent).add(r),n&&r._link?.pose(r),r}getObjectByName(t){if(this.name===t)return this;let r=Lb(this.record.scene.source,t);return r?this.nodeOf(r):super.getObjectByName(t)}_nodeAt(t){let r=this._graphNodeAt(t);return r?{node:this.nodeOf(r),...H9(this.record.scene.nodes,t)}:null}_graphNodeAt(t){return this.record.scene.nodes?.[t]??null}_skinned(t){return $9(this.record.scene.nodes??[],t)}_collides(){return this.#n===void 0&&(this.#n=this.#S()),this.#r?this.#i??=this.#g(this.#n,this.#r):this.#n}#g(t,r){let n=()=>this.#o;return{get changes(){return(t?.changes??0)+n()},holds:o=>!r.has(o)&&(t?.holds(o)??!0)}}#S(){let t=Bt(this);if(!t.length)return null;let{streams:r}=this.record.scene,n=o=>!this._graphNodeAt(o)||r.has(o);return{get changes(){let o=0;for(let i=0;i<t.length;i++)o+=t[i].draws.changes;return o},holds(o){if(!n(o))return!0;for(let i=0;i<t.length;i++)if(t[i].draws.drawn(o))return!0;return!1}}}constructor(t){super(),this.record=t,this.type="LoadedModel";let r=yb(t.scene.source,im());this.bounds=Pn(new rr,r),t.scene.banks?.clock.own(this),aP.set(t,sP(t)+1)}_destroying(){let t=sP(this.record)-1;aP.set(this.record,t),!t&&M.modelImages.arrived&&M.modelImages.get().releaseModelImages(this),!t&&M.modelSurface.arrived&&M.modelSurface.get().releaseSurface(this),this.#f=Float64Array.from(ti(this).worldMatrix),this.#l=0;for(let r of this.#d)r(this)&&this.#l++;if(this.#d.clear(),!this.#l){for(let r of Bt(this))r.show(!1);Ib(this)}}linked(t){this.#m.hear(t)}blank(){throw new E("UNSUPPORTED_SCENE_UPDATE","A LoadedModel cannot be cloned")}get metadata(){let t=this.record.metadata,r=t.primitives.reduce((n,{pages:o})=>n+o.length,0);return{...t,clusters:r}}localBounds(){return this.bounds}};var r7=new WeakMap,fP=new WeakMap;function o7(e){let{cell:t}=e;if(!(!t||!("page"in t)))return yo(r7,e,()=>M.modelCopies.load().then(r=>r.readModelCell(t.page)).then(r=>void(e.cell=r),r=>{e.cell={unread:String(r)},fP.set(e,t.page)}).finally(()=>r7.delete(e)))}var pP=({cell:e})=>!!e&&"page"in e;function i7(e){let t=fP.get(e);t&&(fP.delete(e),e.cell={page:t})}var n7="compile it with `partitionGrid: false` to draw copies of it, or place it again with scene.load";function Fb({cell:e}){if(!e)return`source streams by cells (its cells are not read): ${n7}`;if("streams"in e)return`source streams by cells (${e.streams}): ${n7}`;if("unread"in e)return`source's one cell did not read: ${e.unread}`}var id="A model's instances'";function hP(e,t){if(!(t>=0)||!Number.isFinite(t))throw Sn(id,`${e} is a distance in metres, 0 or more`,{[e]:t});return t}function T1e(e,t){if(!Number.isInteger(t)||t<0)throw Sn(id,"capacity is a whole number of copies",{capacity:t});let{record:r}=e;i7(r);let n=r.scene.partitions.length?Fb(r):void 0;if(n)throw Sn(id,n,{model:r.manifestUrl});return r}var dm=class extends cm{get isModelInstances(){return!0}_placements;#e=0;#t=0;#n=!1;constructor(t,r){super(T1e(t,r)),Cb(t,this,r);let n=(o,i)=>{this._link?.instances?.(this,o,i),this._copiesMoved?.(o,i)};this._placements=new Fu(r,id,n),this.castShadow=!0,o7(this.record)?.then(()=>this._link?.content(this)),M.modelCopies.arrived||M.modelCopies.load().then(()=>this.#r(),()=>{})}_copiesMoved;get instancingRandomSeed(){return this.#e}set instancingRandomSeed(t){if(t!==(t|0))throw Sn(id,"seed is a whole 32-bit number",{seed:t});t!==this.#e&&(this.#e=t,this.#r())}get instanceStartCullDistance(){return this.#t}set instanceStartCullDistance(t){hP("instanceStartCullDistance",t),t!==this.#t&&(this.#t=t,this.#r())}setCullDistances(t,r){hP("start",t),hP("end",r),this.instanceStartCullDistance=t,this.maxDrawDistance=r}get enableDensityScaling(){return this.#n}set enableDensityScaling(t){t!==this.#n&&(this.#n=t,this.#r())}#r(){this.count>0&&this._link?.instances?.(this,0,this.count-1)}get collision(){return!1}set collision(t){if(t)throw Sn(id,"copies collide with nothing",{collision:t})}};sx(dm.prototype);var nn=e=>e.isModelInstances===!0;function s7(){aM.place=(e,t)=>new dm(e,t)}var mP=0,Nb=65536,a7=new Int32Array(Nb),l7=-1;function c7(e=l7){a7[mP++&Nb-1]=e}var qPt=()=>mP,XPt=e=>mP-e>Nb?l7:a7[e&Nb-1];var ci={sprite:1,spriteNeverCulled:2,shadowless:4,drawDistance:8,worldRoot:16,noDistanceField:32,noIndirect:64,noRayTracing:128,rootParent:256,drawInstance:512,cacheStatic:1024,worldSpaceRepresentation:2048,hiddenShadow:4096,movable:8192,immovable:16384,shadowMapless:32768},sd=ci.shadowless,u7=ci.shadowMapless,d7=ci.cacheStatic,f7=ci.worldSpaceRepresentation,p7=ci.movable,h7=ci.immovable,m7=ci.hiddenShadow,g7=ci.noDistanceField,S7=ci.noIndirect,w7=ci.noRayTracing,A1e=sd|g7|S7|w7|u7|d7|f7|m7|p7|h7,gP=new WeakSet,eCt=e=>void gP.add(e),tCt=e=>gP.has(e),O1e=e=>e.castsShadowMaps!==!1||!!e.parent&&gP.has(e.parent)&&e.parent.children.some(t=>t.castsShadowMaps!==!1),bn=(e,t=pt(e))=>{let r=O1e(e),{worldSpaceRepresentation:n,mobility:o}=t;return(e.castShadow&&!t.firstPerson&&r?0:sd)|(e.castsShadowMaps===!1&&r?u7:0)|(t.affectDistanceFieldLighting===!1?g7:0)|(t.affectIndirectLighting===!1?S7:0)|(t.visibleInRayTracing===!1?w7:0)|(n?f7:0)|(t.castHiddenShadow&&!n?m7:0)|(t.shadowCache==="static"?d7:0)|(o==="movable"?p7:o?h7:0)},L1e=(e,t)=>e&~A1e|t;function rCt(e,t,r){let n=e.mark??0,o=L1e(n,t);return e.mark=o||void 0,o===n?!1:(c7(r),!0)}var SP=pt({}),y7=new WeakMap;function R1e(e,t){if(t===SP)return e;if(e===SP)return t;let r=y7.get(e);r||y7.set(e,r=new WeakMap);let n=r.get(t);if(!n){let o={...e};for(let[i,s]of Object.entries(e))s===SP[i]&&(o[i]=t[i]);o.revision=e.revision+t.revision,r.set(t,n=o)}return n}var fm=class{model;drawn;#e;#t;constructor(t,r){this.model=t,this.drawn=r}get matrixWorld(){return this}get elements(){return this.#e??=jD(this.model,this.drawn),this.#e?.matrix()??this.drawn.matrixWorld.elements}get node(){return od(this.model).get(this.drawn)??this.drawn}get switches(){return R1e(pt(this.node),pt(this.model))}get placedSwitches(){return Fp(this.node)||Fp(this.model)?this.switches:void 0}get castShadow(){return this.node.castShadow}get castsShadowMaps(){return this.node.castsShadowMaps}get farField(){return this.node.farField}get parent(){return this.drawn.parent}get name(){return this.drawn.name}get skeleton(){if(this.#t)return this.#t;let{skeleton:t}=this.drawn,r=t&&F9(this.model,t);return r!==t&&(this.#t=r),r}get morphTargetInfluences(){return this.node.morphTargetInfluences}get waves(){return this.drawn.waves}get softSource(){return this.drawn.softSource}get bank(){return this.drawn.bank}},x7=new WeakMap;function b7(e,t){let r=x7.get(e);r||x7.set(e,r=new Map);let n=r.get(t);return n||r.set(t,n=new fm(e,t)),n}function wP(e,t){return!od(e).size&&!Fp(e)?t:b7(e,t)}var E7=e=>({object:t=>b7(e,t),mesh:t=>pm(t)}),Bb=e=>e instanceof fm?e.switches:pt(e),yP=(e,t=Bb(e))=>bn(e,t),pm=e=>e instanceof fm?e.drawn:e,_1e={castShadow:!0,castsShadowMaps:!0},v1e=65536;function xP(e){let r=Fp(e)?bn(_1e,pt(e))|v1e:0;return nn(e)&&!e.castShadow?r|sd:r}function M1e(e,t){let{placement:r,source:n,point:o,normal:i,distance:s,face:a}=t,l=t.hlod&&{hlod:t.hlod},c=pm(t.object),u=fn(c),d=!1;for(let h of e){if(h.record.scene.source!==u)continue;let m=r-dr(h);if(m>=0&&m<Oo(h))return nn(h)?{object:h,point:o,normal:i,distance:s,face:a,instanceId:m,...l}:{object:uP(h,c,n),point:o,normal:i,distance:s,face:a,...l};d=!0}if(d)return null;let f=We(t.object)?{instanceId:r}:{};return{object:t.object,point:o,normal:i,distance:s,face:a,...f,...l}}async function T7(e,t,r,{objects:n,skip:o=[],helpers:i},s){let a=i?o:kj().concat(o),l=t.leftBehind(),c={objects:n,skip:l?a.concat(l):a},u=await e.castRay(r,c,s);return u?M1e(t.models(),u):null}var bCt=(e,t,r,n)=>new jt("perspective",{fov:e,aspect:t,near:r,far:n}),A7=(e,t,r)=>new I(e,t,r),ECt=e=>Pn(new rr,e),TCt=e=>new ot(e.geometry,e.material);function bP(e,t,r){e.drawnFrom=void 0,e.position.fromArray(t.position),e.fov=t.fov,e.near=t.near,e.far=t.far,e.lookAt(r.fromArray(t.target)),e.updateProjectionMatrix(),e.setViewTarget(r),e.updateMatrixWorld()}function OCt(e,t,r){let{camera:n,center:o}=e,{loaded:i,bytesRead:s}=e.pageSources.streamer.stats(),a={disposed:!1,diagnostic:"beauty",hlodCell:null,frame:0,drawing:t,loaded:i,pageBytesRead:s},l=[],c=o.clone();return{state:a,ownedControls:l,lookAtTarget:c,check:()=>{if(a.disposed)throw new Error("MeasuredWorld disposed");r?.throwIfAborted()},setPose:f=>bP(n,f,c)}}function hm(e){let{width:t,height:r}=xn(e);return t/Math.max(1,r)}function D1e(e,t,r,n){mb(e,Ii(t,n),Ii(r,n))}function CCt(e){let{check:t,engine:r,camera:n,canvas:o,viewport:i,options:s}=e,a,l=()=>{if(a)om(o,a,i),r.placeMain(td(o,a,{x:0,y:0,width:0,height:0})),n.aspect=i[0]/i[1];else{let c=xn(o);i[0]=c.width,i[1]=c.height,n.aspect=hm(o)}n.updateProjectionMatrix()};return{async captureSurfaceView(c,u){t();let d=n.clone();return d.aspect=u.width/u.height,bP(d,c,A7(0,0,0)),r.captureSurfaceView(d,u)},resize(c,u){if(t(),!vn(c,u))throw new Error("Invalid viewport size");D1e(o,c,u,s.pixelRatio),l()},placeMain(c){t(),a=c&&{...c},a||r.placeMain(void 0),l()}}}function P1e(e,t){let r=e[0],n=e[1],o=St(r,me),i=Math.min(Math.floor(n/me),o+3);if(i===o+3){t[0]=-1,t[1]=1,t[2]=-1,t[3]=1;return}let s=Math.cos(r),a=Math.cos(n),l=Math.sin(r),c=Math.sin(n);t[0]=Math.min(s,a),t[1]=Math.max(s,a),t[2]=Math.min(l,c),t[3]=Math.max(l,c);for(let u=o;u<=i;u++){let d=u&3;d===0?t[1]=1:d===1?t[3]=1:d===2?t[0]=-1:t[2]=-1}}var EP=new Float64Array(2),Lo=new Float64Array(4);function C1e(e,t,r,n,o){let i=t[r],s=t[r+2],a=t[r+3],l=t[r+5];n.fill(0,0,6);for(let c=0;c<Math.min(o,e.count);c++){let u=e.dirX[c],d=e.dirZ[c],f=e.k[c],h=e.lateral[c],m=Math.min(u*i,u*a)+Math.min(d*s,d*l),w=Math.max(u*i,u*a)+Math.max(d*s,d*l);EP[0]=f*m-e.phase[c],EP[1]=f*w-e.phase[c],P1e(EP,Lo);let x=h*u,b=h*d,T=e.amplitude[c];n[0]+=Math.min(x*Lo[0],x*Lo[1]),n[3]+=Math.max(x*Lo[0],x*Lo[1]),n[2]+=Math.min(b*Lo[0],b*Lo[1]),n[5]+=Math.max(b*Lo[0],b*Lo[1]),n[1]+=T*Lo[2],n[4]+=T*Lo[3]}return n}var mm=new Float64Array(6),I1e=["dirX","dirZ","k","amplitude","lateral","phase"],$Ct=I1e.length,Gb=0,TP=2,AP=4,k1e=1,L7=3,R7=5,OP=R7+1;function LP(e,t,r,n,o){let i=e.dirX[t],s=e.dirZ[t],a=e.k[t],l=e.amplitude[t],c=e.lateral[t],u=a*(i*r+s*n)-e.phase[t],d=Math.cos(u),f=Math.sin(u);o[Gb]=c*i*d,o[k1e]=l*f,o[TP]=c*s*d,o[L7]=i*a*l*d,o[AP]=a*c*f,o[R7]=s*a*l*d}var Ub=new Float64Array(OP);function O7(e,t,r,n,o,i,s){let a=0,l=i,c=0;for(let u=0;u<e.count;u++)LP(e,u,t,r,Ub),a+=o*Ub[n],l+=o*Ub[n+1],c+=o*Ub[n+2];return s[0]=a,s[1]=l,s[2]=c,s}var Vb=class{count;dirX;dirZ;k;amplitude;lateral;omega;phase0;phase;crest;constructor(t){let r=this.count=t.length;[this.dirX,this.dirZ,this.k,this.amplitude,this.lateral,this.omega,this.phase0]=Array.from({length:7},()=>new Float64Array(r)),this.phase=new Float64Array(r);let n=0;for(let s of t){let a=Je(s.direction[0],s.direction[1]);if(!(s.wavelength>0)||!(s.amplitude>=0)||!(a>0))throw new RangeError("Waves: a wave needs a direction, a wavelength and an amplitude.");if(!(s.steepness>=0&&s.steepness<=1))throw new RangeError("Waves: steepness is between 0 and 1.");n+=s.amplitude>0?s.steepness:0}let o=n>1?1/n:1,i=new Float64Array(2);t.forEach((s,a)=>{i[0]=s.direction[0],i[1]=s.direction[1],ls(i),this.dirX[a]=i[0],this.dirZ[a]=i[1],this.k[a]=Q/s.wavelength,this.amplitude[a]=s.amplitude,this.lateral[a]=s.amplitude>0?s.steepness*o/this.k[a]:0,this.omega[a]=Math.sqrt(Yo.earth*this.k[a]),this.phase0[a]=s.phase??0}),this.crest=_n(this.amplitude),this.setTime(0)}setTime(t){for(let r=0;r<this.count;r++){let n=(this.omega[r]*t+this.phase0[r])%Q;this.phase[r]=n<0?n+Q:n}}offset(t,r,n){return O7(this,t,r,Gb,1,0,n)}displacementBox(t,r,n,o,i,s=this.count){return mm[0]=t,mm[2]=r,mm[3]=n,mm[5]=o,C1e(this,mm,0,i,s)}normal(t,r,n){return Ne(O7(this,t,r,L7,-1,1,n)),n}};var F1e=3,Hb=new Float64Array(OP);function _7(e,t,r,n){let o=t,i=r;for(let s=0;s<F1e;s++){let a=o-t,l=i-r,c=0,u=0,d=0;for(let w=0;w<e.count;w++){LP(e,w,o,i,Hb);let x=e.dirX[w],b=e.dirZ[w],T=Hb[AP];a+=Hb[Gb],l+=Hb[TP],c+=T*x*x,u+=T*x*b,d+=T*b*b}let f=1-c,h=1-d,m=f*h-u*u;if(!(m>1e-6)){o-=a,i-=l;continue}o-=(h*a+u*l)/m,i-=(u*a+f*l)/m}return n[0]=o,n[2]=i,n}var Wb=new Float64Array(3);function v7(e,t,r){return _7(e,t,r,Wb),e.offset(Wb[0],Wb[2],Wb)[1]}var zb=class{waves;declared;rest=0;time=0;constructor(t){this._declare(t)}_declare(t){let r=new Vb(t.waves);return this.declared=t.waves,this.waves=r,this.rest=t.level,this.time=0,this}get level(){return this.rest}get crest(){return this.waves.crest}setTime(t){return this.time=t,this.waves.setTime(t),this}height(t,r){return this.level+v7(this.waves,t,r)}point(t,r,n){return this.waves.offset(t,r,n),n[0]+=t,n[1]+=this.level,n[2]+=r,n}wavesNow(){return this.declared.map((t,r)=>({...t,phase:this.waves.phase[r]}))}get waveModel(){return this.waves}normal(t,r,n){return this.waves.normal(t,r,n),n}};function M7(e,t){return{...e,pose(r){e?.pose(r),t.pose(r)},posed(r){e?.posed(r),t.posed?.(r)},structure(r){e?.structure(r),t.structure(r)},entered(r){e?.entered?.(r),t.entered?.(r)},content(r){e?.content(r),t.content(r)},collision(r){e?.collision?.(r),t.collision?.(r)}}}var RP=e=>!!e&&typeof e=="object"&&("exact"in e||"shape"in e);function gm(e,t){let r=t?e.engineIdOf(t):Mo;return r<0?Mo:r}function _P(e){if(e==null)return;if(typeof e=="string"||typeof e=="number")return{channel:e};if(typeof e=="object"&&!Array.isArray(e))return e;let t=Array.isArray(e)?"a list":typeof e=="function"?"a function":String(e);throw new E("COLLISION_CHANNEL",`A query's collision is a channel, by name or by number, or a collision ({ channel, responses }), not ${t}.`,{collision:e})}function vP(e,t,r){r.type==="sphere"?e[t]=r.radius:r.type==="box"?e.set([r.halfExtents.x,r.halfExtents.y,r.halfExtents.z],t):e.set([r.halfHeight,r.radius],t)}function ad(e,t,r,n,o,i,s=N1e(e)){e[kn.kind]=i?al[i.type]:al.ray;for(let a=0;a<3;a++)s[kn.origin+a]=t[a],s[kn.travel+a]=r[a]*n;i&&vP(s,kn.extents,i),e[kn.ignored]=o}var N1e=e=>new Float32Array(e.buffer,e.byteOffset,e.length),P7=new Uint32Array(1),B1e=new Float32Array(P7.buffer);function Qi(e,t){return P7[0]=e[t],B1e[0]}var D7=(e,t)=>new I(Qi(e,t),Qi(e,t+1),Qi(e,t+2));async function MP(e,t,r,n){if(!e)throw new E("PHYSICS_OFF","An exact raycast asks the physics: turn it on first.");let o=Gt(r,"queryField"),i=_P(o.collision),s=o.maxDistance??n,a=new Uint32Array(Hi),l=gm(e,o.ignore),{origin:c,direction:u}=t;ad(a,c.elements,u.elements,s,l,o.shape);let d=o.channels&&Su(o.channels);d&&d[0]|d[1]?(a.set(d,kn.sought),a[kn.stop]=ny.sought):jb(a,i);let f=await e.cast(a),h=f[Fn.body],m=h===Mo?null:e.objectOf(h);if(!m)return null;let w=e.partOf(h);return{object:m,point:D7(f,Fn.point),normal:D7(f,Fn.normal),distance:Qi(f,Fn.fraction)*s,face:-1,material:e.materialOf(h),...w&&{part:w}}}var U1e=wu(zi(void 0,"solid","sight"));function jb(e,t){let r=t?wu(zi(t,"solid","sight")):U1e;e.set(r,kn.channel)}var V1e=wu(zi(void 0,"solid")),G1e={sphere:al.sphere,box:al.box,capsule:al.capsule},DP={multi:mu.multi,any:mu.any,stopping:mu.stopping};function H1e(e){let t=dt("overlapMode",e??"multi");if(typeof t=="string"&&Object.hasOwn(DP,t))return t;throw new E("OVERLAP_MODE",`Overlap mode ${JSON.stringify(e)} does not exist: ${Object.keys(DP).join(", ")}.`,{mode:e})}async function C7(e,t,r){if(!e)throw new E("PHYSICS_OFF","An overlap query asks the physics: turn it on first.");let n=Gt(r,"queryField"),o=_P(n.collision),i=new Uint32Array(h5),s=new Float32Array(i.buffer),a=!!n.channels,l=H1e(n.mode);i[Wi.mode]=a?l==="multi"?mu.multiSought:mu.anySought:DP[l],i[Wi.shape]=G1e[t.type],vP(s,Wi.extents,t),s.set([n.at.x,n.at.y,n.at.z],Wi.position),s.set(n.rotation??[0,0,0,1],Wi.rotation),i.set(o?wu(zi(o,"solid")):V1e,Wi.channel),i.set(Su(n.channels),Wi.sought),i[Wi.ignored]=gm(e,n.ignore);let c=await e.overlap(i),u=[];for(let d=0;d<c.length;d+=m5){let f=e.objectOf(c[d]);if(!f)continue;let h=e.partOf(c[d]);u.push({object:f,stops:(c[d+1]&g5.stops)!==0,material:e.materialOf(c[d]),...h&&{part:h}})}return{hits:u,stops:u.some(d=>d.stops)}}var W1e=Uint32Array.of(Mo),$b=new Uint32Array(Hi);$b.set(Su(ll),kn.sought);$b[kn.stop]=ny.sought;function z1e(e,t){return e[Fn.body]===Mo?null:Qi(e,Fn.fraction)*t}function I7(e){let t=null,r=0,n=0,o=0,i=()=>{let s=e();return s!==t&&(t=s,r=n+1,o++),s};return{revision(){let s=i();return n=r+(s?.revision()??0)},epoch(){return i(),o},post(s,a,l,c,u){let d=i();if(!d)return u(W1e);ad($b,s,a,l,gm(d,c)),d.castTo($b,u)}}}var j1e=iy+1,k7=()=>fe(),F7=(e,t)=>({onStep(r){if(typeof r!="function")throw new TypeError(`physics.onStep takes a function, not ${String(r)}.`);let n=e.subscribe(r);return t(),n},get stepDelay(){return j1e}});var $1e=e=>e.bodies*b5,OIt=(e,t)=>((e^t)&~E5)===0,Y1e=e=>2*$1e(e),N7=e=>e.contactEvents*iy,K1e=e=>Y1e(e)+N7(e)*T5,LIt=e=>K1e(e)+N7(e),B7=()=>({bodies:0,active:0,stepMs:0,stepMaxMs:0,mainMs:0,poses:0,events:0,droppedEvents:0});var q1e=A({step:F("step",Np),restitutionThreshold:y("restitutionThreshold",W_),penetrationSlop:g("penetrationSlop",z_,[0,R5]),timeScale:y("timeScale",1),simulationRange:F("simulationRange",2e3)});function Sm(e,t){let r=q1e[e];if(!et(r,t))throw new RangeError(`physics.${e} must be ${Dt(r)}, not ${t}.`);return t}var PP=e=>Sm("step",e),CP=e=>Sm("restitutionThreshold",e),IP=e=>Sm("penetrationSlop",e),U7=e=>Sm("timeScale",e),Yb=e=>e===null?null:Sm("simulationRange",e),V7=e=>({step:PP(e.step??Np),restitutionThreshold:CP(e.restitutionThreshold??W_),penetrationSlop:IP(e.penetrationSlop??z_)});function G7(e){let t=new Set,r=new Set,n=o=>o instanceof ed?r:t;return{joints:t,vehicles:r,methods:{add(o){n(o).add(o),e()},remove(o){n(o).delete(o),e()}}}}function H7(e){let t=null,r=-1,n=new Set,o=new Set,i=s=>{let a=s;a.isMesh&&(t&&a._link===e._link&&a.waves===t?n.add(a):n.delete(a))};return{heard(s){o.add(s)},water(){o.clear(),o.add(e)},frame(s){t=s??t;let a=s?.waveModel.count??r;if(r>=0&&a!==r)for(let l of n)l._link?.content(l);r=a;for(let l of o)l.traverse(i);o.clear();for(let l of n)l._link!==e._link&&n.delete(l);return!!s&&n.size>0}}}function W7(e,t,r,n=!0){let o=Z1e(()=>Q1e(i),L5(r.budget)),i={root:t,invalidate:e,budget:o.live,writeBudget:o.write,retired:new WeakSet,gravity:new I,carry:H7(t),joints:G7(()=>{i.session?.structure(),e()}),hooks:k7(),session:null,wanted:!1,paused:!1,held:!1,stepping:0,timeScale:1,range:Yb(r.simulationRange??null),timing:V7(r),water:null,surface:null,error:null,watcher:null,starts:n};return i}var FP=e=>e.water?e.surface.setTime(e.session?.waterTime()??0):null,NP=e=>e.paused||e.held;function ld(e){e.session?.setClock(NP(e),e.timeScale),e.session&&e.stepping&&e.session.step(e.stepping),e.session&&(e.stepping=0),e.invalidate()}var BP=({gravity:e},t)=>typeof t=="string"?e.set(0,-Yo[t],0):e.set(t.x,t.y,t.z);function kP(e,t,r=!1){e.error=t,tr.error("physics failed",t),r&&Kb(e,!1)}function z7(e,{createPhysicsSession:t},r=0,n=null){if(!e.wanted||e.session)return void n?.release();try{let o=t(e.root,Object.freeze({...e.budget}),e.invalidate,(i,s)=>kP(e,i,s),e.joints,e.gravity,Object.freeze({...e.timing}),e.retired,n,e.hooks);e.session=o,o.writer.gravity(e.gravity.elements),e.water&&o.setWater(e.water,r),ld(e),e.watcher?.()}catch(o){n?.release();let i=o instanceof E?o:new E("PHYSICS_FAILED",String(o));kP(e,i,!0)}}var X1e=e=>M.physics.load().then(t=>z7(e,t),t=>kP(e,t,!0));function j7(e,t){let r=e.session;e.session=null,r?.dispose(t),e.watcher?.()}function Kb(e,t){t!==e.wanted&&(e.wanted=t,t?e.starts&&X1e(e):j7(e),e.invalidate())}function Q1e(e){let t=e.session;if(!t)return;e.stepping+=t.asked();let r=t.waterRun(),n=t.carry();j7(e,()=>e.session),z7(e,M.physics.get(),r,n),e.invalidate()}function $7(e,t){let r=PP(t);r!==e.timing.step&&(e.timing.step=r,e.session?.setStep(r))}function Y7(e,t){let r=CP(t);r!==e.timing.restitutionThreshold&&(e.timing.restitutionThreshold=r,e.session?.setRestitutionThreshold(r))}function K7(e,t){let r=IP(t);r!==e.timing.penetrationSlop&&(e.timing.penetrationSlop=r,e.session?.setPenetrationSlop(r))}function Z1e(e,t){let r=o=>{let i=Object.entries(o).map(([a,l])=>{let c=a;if(!(c in t))throw new TypeError(`Physics budget "${c}" does not exist (world.budget.physics.${c}).`);return[c,H_(c,l)]}),s=!1;for(let[a,l]of i)t[a]!==l&&([t[a],s]=[l,!0]);s&&e()},n={};for(let o of Object.keys(qr))Object.defineProperty(n,o,{enumerable:!0,get:()=>t[o],set:i=>r({[o]:i})});return{live:Object.seal(n),write:r}}function q7(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`physics.budget must be an object of budgets, not ${String(t)}.`);e.writeBudget(t)}var J1e=(e,t)=>({get enabled(){return e.wanted},set enabled(r){t(r)},get gravity(){return e.gravity},set gravity(r){BP(e,r)},get paused(){return e.paused},set paused(r){e.paused=r,ld(e)},step(r=1){if(!(Number.isInteger(r)&&r>=1))throw new RangeError(`physics.step takes a whole number of steps from 1, not ${r}.`);e.paused=!0,e.stepping+=r,ld(e)},get timeScale(){return e.timeScale},set timeScale(r){e.timeScale=U7(r),ld(e)}}),eve=e=>({get fixedStep(){return e.timing.step},set fixedStep(t){$7(e,t)},get restitutionThreshold(){return e.timing.restitutionThreshold},set restitutionThreshold(t){Y7(e,t)},get penetrationSlop(){return e.timing.penetrationSlop},set penetrationSlop(t){K7(e,t)},get budget(){return e.budget},set budget(t){q7(e,t)}});function tve(e){let t=B7();return{get simulationRange(){return e.range},set simulationRange(r){e.range=Yb(r),e.invalidate()},get water(){return e.water},set water(r){r&&(e.surface=e.surface?._declare(r)??new zb(r)),e.water=r,e.carry.water(),e.session?.setWater(r),e.invalidate()},get waterSurface(){return FP(e)},get stats(){return e.session?.stats??t},get error(){return e.error}}}function rve(e){let t=r=>e.water&&e.carry.heard(r);e.root._link=M7(e.root._link,{structure:r=>(t(r),e.session?.structure(r)),entered:r=>e.session?.entered(r),content:r=>(t(r),e.session?.content(r)),pose:r=>(t(r),e.session?.pose(r)),collision:r=>e.session&&(e.session.collision(r),e.invalidate())})}function nve(e,t,r,n,o){let{session:i}=e,s=!1;if(r?.setViewOriginCast(i?n:null),i){let c=Z();s=i.frame(t,e.range,r?.drawnCamera(),o),i.stats.mainMs+=er(c),r?.cpuStep("physicsMs",i.stats.mainMs)}let a=FP(e),l=e.carry.frame(a);return s||l&&!!i&&!NP(e)&&e.timeScale>0&&a.crest>0}var ove=(e,t)=>t?()=>{throw t.refusal()}:()=>e.session,ive=(e,t,r)=>W({...e.joints.methods},J1e(e,t),eve(e),tve(e),F7(e.hooks,e.invalidate),{overlap:async(n,o)=>C7(r(),n,o)});function UP(e,t,r,n,o,i){let s=typeof n=="object"?n:{},a=W7(()=>e.invalidate(),t,s,!o),l=ove(a,o);Se(a.gravity,()=>{a.session?.writer.gravity(a.gravity.elements),a.invalidate()});let c={start:()=>Kb(a,!0),stop:()=>Kb(a,!1)},u=ive(a,i(c),l);BP(a,s.gravity??"earth");let d=I7(()=>a.session);return n&&(u.enabled=!0),rve(a),{handle:u,budget:a.budget,time:f=>void a.session?.time(f),hold(f){a.held=f,ld(a)},frame:f=>nve(a,r(),e.explorer?.engine,d,f),character:sve(a),dispose(){a.hooks.clear(),c.stop()},session:()=>a.session,queried:l}}var sve=e=>({body:()=>e.session?.characterBody??null,probe:t=>e.session?.armProbe(t)??null,unprobe:t=>e.session?.unprobe(t),watch(t){e.watcher=t}});var X7={x:0,y:0,width:0,height:0};function Q7(e,t,r,n,o){let i=Xi(t,o,e,X7),s=i?i.width:t.clientWidth,a=i?i.height:t.clientHeight;if(!(s>0&&a>0))throw new E("RAYCAST_NO_VIEW","The canvas has no size to aim through",{width:s,height:a});let l=i?.x??0,c=i?.y??0,[u,d]=[(r.x-l)/s*2-1,1-(r.y-c)/a*2];return e.rayThrough(u,d,Z7(t,i),n)}var Z7=(e,t)=>t?gb(e,t):hm(e);function ave(e,t,r,n){let o=Xi(t,r,e,X7),i=o?o.height:t.clientHeight;if(!(n>0&&i>0))return{reach:0,slope:0};let s=ko(e);if(e.projection==="perspective")return{reach:0,slope:n*2*Rn(e.fov,s)/i};let a=ps(e,Z7(t,o),s);return{reach:n*2*a[3]/i,slope:0}}function lve(e,t,r,n){let o=r.isRay?r:Q7(e,t,r,void 0,n);return new po(o.origin.clone(),o.direction.clone().normalize())}var J7=(e,t,r,n,o=()=>[],i,s=()=>{},a=()=>{},l)=>{let c={eye:()=>({camera:e(),canvas:t,viewport:s()}),physics:r,engine:n,models:o,opened:i,leftBehind:a,guides:l};return((u,d={})=>dve(c,u,d))};function cve({view:e},t){return e?{camera:e.camera,canvas:e.canvas,viewport:e.viewport}:t()}function uve(e,t){let{reach:r,lineThreshold:n=1,linePixels:o=0}=t;for(let[s,a]of[["reach",r??0],["linePixels",o]])if(!(typeof a=="number"&&a>=0))throw new E("INVALID_RAYCAST_REACH",`A raycast ${s} is 0 or more`,{[s]:a});let i=ave(e.camera,e.canvas,e.viewport,o);return{reach:r,lineReach:n+i.reach,lineSlope:i.slope}}async function dve(e,t,r){let n=r,o=cve(n,e.eye),i=lve(o.camera,o.canvas,t,o.viewport);if(RP(r))return MP(e.physics(),i,r,o.camera.far);let s=uve(o,n),a=n.guides&&e.guides&&!t.isRay?await p9(e.guides,o,t,i,n):null;if(!e.engine()&&!await e.opened())return null;if(a?.foreground)return a.hit;let l=e.engine(),c=l?await T7(l,e,i,n,s):null;return a&&!(c&&c.distance<a.hit.distance)?a.hit:c}var eX=(e,t)=>e.scene.nodes?.[t]?.name??"",tX=e=>dP(e).map(t=>({rank:t,name:eX(e.record,t)}));function fve(e,t){let{rank:r,name:n}=t??{};return!Number.isInteger(r)||r<0||typeof n!="string"?-1:eX(e.record,r)===n?r:n?lm(e.record,n):-1}function wkt(e,t){if(t!==void 0){if(!Array.isArray(t))return tr.warn("scene: a model\u2019s nodes set aside are no list, left out",{entries:t});for(let r of t){let n=fve(e,r);n>=0?e.setNodeCollision(n,!1):tr.warn("scene: a model node set aside does not read, left out",{entry:r})}}}var VP=e=>K_(e)!==null;function Ekt(e,t){let r=e.physics.type;if(r!=="static"&&r!=="kinematic"&&e.parent!==t)throw new E("PHYSICS_NESTED","A dynamic or soft body must be a direct child of the scene: the simulation owns its world pose.",{name:e.name})}var GP="trillion3d-scene",HP=7,rX=[2,3,4,5,6,HP],nX=e=>!!(e.isTerrain||e.isDeclaredTerrain);function Rkt(e){let t=e;if(t?.format!==GP||!rX.includes(t.formatVersion))throw new E("UNSUPPORTED_SCENE_FORMAT",`Not a saved scene of version ${rX.join(" or ")}`,{format:t?.format,formatVersion:t?.formatVersion})}function $s(e,t={}){throw new E("SCENE_NOT_SAVABLE",`A saved scene cannot store ${e}`,t)}var Yn=(e,t)=>e===t?void 0:e,oX=new Map,pve=e=>{let t=oX.get(e);return t||oX.set(e,t=new hn({type:e})),t};function iX(e,t){if(typeof e=="number"&&!Number.isFinite(e)&&$s(`a body's ${t} of ${e}`,{[t]:e}),e&&typeof e=="object")for(let[r,n]of Object.entries(e))iX(n,`${t}.${r}`)}function sX(e){let{type:t,soft:r,damping:n}=e,o=pve(t),i=o.damping,s={mass:Yn(e.mass,o.mass),gravityScale:Yn(e.gravityScale,o.gravityScale),friction:Yn(e.friction,o.friction),restitution:Yn(e.restitution,o.restitution)},a;if(r){let{stretch:l,bend:c,pressure:u}=o.soft;a={type:r.type,pins:r.pins.length?r.pins:void 0,stretch:Yn(r.stretch,l),bend:Yn(r.bend,c),pressure:Yn(r.pressure,u),damping:n.linear===i.linear?void 0:{linear:n.linear},...s}}else a={type:t,shape:e.shape,sensor:Yn(e.sensor,o.sensor),ccd:Yn(e.ccd,o.ccd),decorative:Yn(e.decorative,o.decorative),rubber:Yn(e.rubber,o.rubber),print:Yn(e.print,o.print),damping:n.linear===i.linear&&n.angular===i.angular?void 0:n,...s};for(let[l,c]of Object.entries(a))iX(c,l);return a}var wm=e=>[e.r,e.g,e.b],qb=e=>e===void 0?e:du(e);function hve(e){let t=new Map;return JSON.parse(JSON.stringify(e,function(r,n){let o=t.get(this),i=o?`${o}.${r}`:r;return no(n)&&$s("a texture",{sky:i}),ArrayBuffer.isView(n)?Array.from(n):(n&&typeof n=="object"&&t.set(n,i),n)}))}function mve(e){if(e.recipe)return{recipe:qb(e.recipe)};let t={};for(let[o,i]of Object.entries(e.attributes)){let s=i.kind==="attribute"?i:i.clone();t[o]={itemSize:s.itemSize,array:Array.from(s.array),type:s.array.constructor.name,normalized:s.normalized}}let r=e.index?Array.from(e.index.array):void 0,n=e.groups.map(o=>({...o}));return{attributes:t,index:r,groups:n,owner:e._owner==="host"?"host":void 0}}function gve(e){e.kind==="shader"&&$s("a shader material");let t={};for(let[r,n]of Wy(e))no(n)&&$s("a texture",{parameter:r}),t[r]=n?.isColor?wm(n):qb(n);return{kind:e.kind,parameters:t}}function aX(e){return{position:e.position.toArray(),quaternion:e.quaternion.toArray(),...e.rotation.order==="XYZ"?{}:{rotationOrder:e.rotation.order},...e.up.x===0&&e.up.y===1&&e.up.z===0?{}:{up:e.up.toArray()}}}function Sve(e){return{projection:e.projection,...aX(e),optics:{...e._optics},...e.fitAspect&&{fitAspect:!0}}}function lX(e,t){let r=e.background;e.environment&&$s("a picture environment");let n={geometries:new Map,materials:new Map,ranks:new Map,volumes:[]},o=cX(e).map(i=>uX(i,n));for(let[i,s]of n.volumes)i.waterExclusion.bodies=s.bodies.map(a=>wve(a,n.ranks));return{format:GP,formatVersion:HP,background:r&&wm(r),...e.sky!=null&&{sky:hve(e.sky)},camera:t?Sve(t):null,geometries:[...n.geometries.keys()].map(mve),materials:[...n.materials.keys()].map(gve),children:o}}function wve(e,t){let r=t.get(e);if(r!==void 0)return r;for(let n=e.parent;n;n=n.parent){let o=t.get(n);if(o===void 0)continue;let i=n;return i.isLoadedModel&&i.getObjectByName(e.name)===e?{model:o,name:e.name}:null}return null}var ym=(e,t)=>(e.has(t)||e.set(t,e.size),e.get(t));function cX(e){let t=e;return e.children.filter(r=>!Fj(r)&&!ey(r)&&!(t.isLoadedModel&&t._fromFile(r)))}function yve(e){return e.isMesh?"mesh":e.isLight?"light":e.isLoadedModel?"model":e.isWaterExclusionVolume?"waterExclusion":nX(e)?"terrain":e.isGroup?"group":"object"}function uX(e,t){let r=e,n=e,o=e,i=e,s=e;t.ranks.set(e,t.ranks.size);let a={kind:yve(e),name:e.name,...aX(e),scale:e.scale.toArray(),visible:e.visible,castShadow:e.castShadow,...e.castsShadowMaps?{}:{castsShadowMaps:!1},...e.farField?{farField:!0}:{},...r5(e),renderOrder:e.renderOrder,userData:qb(e.userData),children:cX(e).map(l=>uX(l,t))};if(a.kind==="terrain"){let{material:l,...c}=s._saved();a.terrain={...c,material:ym(t.materials,l)}}return r.isMesh&&Tve(a,r,t),VP(e)&&(a.physics=qb(sX(e.physics))),n.isLight&&(a.light=bve(n,t)),o.isLoadedModel&&(a.model=xve(o)),i.isWaterExclusionVolume&&(a.waterExclusion={mode:i.mode,bodies:[]},t.volumes.push([a,i])),a}function xve(e){let t=e.record.manifestUrl;co.holds(t)&&$s("a model compiled in the page: its files live in this page alone; serve them and load the model by their address to save it",{name:e.name});let r=tX(e);return{url:t,...e.collision===!1&&{collision:!1},...r.length>0&&{noCollision:r}}}function bve(e,{materials:t}){let r=hx(e),n=gx(e),o=wx(e),i=Sx(e);return{kind:e.kind,color:wm(e.color),groundColor:wm(e.groundColor),values:{...e._values},target:e.target.position.toArray(),sh:e.sh?[...e.sh]:null,...e.atmosphereSun?{}:{atmosphereSun:!1},...e.atmosphereSunIndex?{atmosphereSunIndex:e.atmosphereSunIndex}:{},...e.shadowsFog===(e.kind==="directional")?{}:{shadowsFog:e.shadowsFog},...e.mobility==="stationary"?{}:{mobility:e.mobility},...e.inverseSquared?{}:{inverseSquared:!1},...e.intensityUnits===Ti?{}:{intensityUnits:e.intensityUnits},...e.useTemperature?{useTemperature:!0}:{},...e.transmission?{transmission:!0}:{},...e.castHairDeepShadow?{castHairDeepShadow:!0}:{},...e.shadowsAir?{shadowsAir:!0}:{},...e.transmittancePerPixel?{transmittancePerPixel:!0}:{},...Rh(e)?{sunDiskTint:wm(Rh(e))}:{},...Object.keys(r).length?{shafts:r}:{},...Object.keys(n).length?{cloudShadows:n}:{},...Object.keys(o).length?{contactShadows:o}:{},...Object.keys(i).length?{shadows:i}:{},...e.lightPattern?{lightPattern:Eve(e,t)}:{}}}function Eve(e,t){let{scale:r,fadeDistance:n,disabledBrightness:o,coneAngle:i}=_r,s=e.lightPatternScale;return{material:ym(t,e.lightPattern),...s.x===r[0]&&s.y===r[1]&&s.z===r[2]?{}:{lightPatternScale:s.toArray()},...e.lightPatternFadeDistance===n?{}:{lightPatternFadeDistance:e.lightPatternFadeDistance},...e.lightPatternDisabledBrightness===o?{}:{lightPatternDisabledBrightness:e.lightPatternDisabledBrightness},...e.lightPatternConeAngle===i?{}:{lightPatternConeAngle:e.lightPatternConeAngle}}}function Tve(e,t,{geometries:r,materials:n}){let o=t.material;e.mesh={geometry:ym(r,t.geometry),material:Array.isArray(o)?o.map(s=>ym(n,s)):ym(n,o),primitive:t.primitive};let i=t instanceof go?t.center:void 0;i&&(e.mesh.center=[i.x,i.y]),t.waterBody&&(e.mesh.waterBody={...t.waterBody})}function Xb(e,t,r){en(e,"gltfExport",Kf(t));let n=fn(r);n!==t&&en(e,"gltfExport",Kf(n))}function Ave(e){let{files:t,scope:r}=e??{};if(!(t instanceof Map&&mT.includes(r)))throw new E("INVALID_OPTIONS",`scene.load takes a manifest address (a string or a URL) or a model compiled in the page, { files, scope } as prepareInBrowser answers it: its files a Map, its scope 'full' or 'slice'; it was handed ${e===null?"null":typeof e}`)}var xm=class extends he{get isScene(){return!0}_background=null;recoloured=()=>this._link?.background?.();environment=null;_sky=void 0;constructor(t){super(),t&&(this.loader=t),this.type="Scene"}blank(){throw new E("UNSUPPORTED_SCENE_UPDATE","A Scene cannot be cloned: a world has one")}get background(){return this._background}set background(t){if(t!=null&&typeof t.getHex!="function")throw new E("UNSUPPORTED_SCENE_UPDATE","scene.background takes a colour or null: a picture background is not drawn");this._background&&Es(this._background,this.recoloured),this._background=t??null,t&&Se(t,this.recoloured),this.recoloured()}get sky(){return this._sky}set sky(t){let r=Pf(t);this._sky=r,this._link?.sky?.(r)}async load(t,r={}){let n=this.loader;if(!n)throw new E("UNSUPPORTED_SCENE_UPDATE","This scene loads no model: it has no world");let o=t instanceof URL?t.href:t,i;if(typeof o=="string")i=await n(o,r);else{if(Ave(o),!n.compiled)throw new E("UNSUPPORTED_SCENE_UPDATE","This scene loads no model compiled in the page: its loader reads models by address alone");i=await n.compiled(o,r)}try{let s=r.position;s&&(Array.isArray(s)?i.position.set(s[0],s[1],s[2]):i.position.copy(s)),r.collision===!1&&(i.collision=!1),this.add(i)}catch(s){throw i.destroy(),s}finally{n.added?.(i)}return i}toJSON(t){return lX(this,t)}async exportGlb(t=this,r){let n=()=>Xb("scene.exportGlb",this,t);return(await Cr(M.gltfExport,n)).exportGlb(t,r)}async exportGltf(t=this,r){let n=()=>Xb("scene.exportGltf",this,t);return(await Cr(M.gltfExport,n)).exportGltf(t,r)}fromJSON(t,r){let n=async()=>(await M.sceneRead.load()).readScene(this,t,r),o=(this.reading??Promise.resolve()).then(n,n);return this.reading=o.catch(()=>{}),o}};var bm=()=>new E("NO_VEHICLE","world.controls: 'vehicle' drives world.controls.vehicle, which is null \u2014 set it first.");function dX(e,t,r,n){let o=null,i=null;return{accessors:{get vehicle(){return o},set vehicle(a){if(!a&&r())throw bm();a!==o&&(i=a&&{drive(l){try{a.drive(l)}catch(c){n(c)}}}),o=a,t()}},bind(a){if(!a||("vehicle"in a&&a.vehicle!==i&&(a.vehicle=i),!("physics"in a)))return;let l=e?.body()??null;a.physics!==l&&(a.physics=l)}}}var Ul=Object.freeze({armLength:0,armOffset:Object.freeze([0,0,0]),armTargetOffset:Object.freeze([0,0,0]),armPivot:null,armParent:null,armPitch:null,armFollowsLook:!0,armInheritPitch:!0,armInheritYaw:!0,armInheritRoll:!0,armCollision:!0,armProbeRadius:.12,armProbeChannel:"camera",armLag:!1,armLagSpeed:10,armLagMaxDistance:0,armRotationLag:!1,armRotationLagSpeed:10,armLagSubstepping:!0,armLagMaxTimeStep:.016666666666666666,armDrawLagMarkers:!1});var WP=Object.freeze({...Ul,armLength:3,armFollowsLook:!1}),Ove=1/200,fX=(()=>{let e=WP;return A({armLength:y("armLength",e.armLength),armProbeRadius:y("armProbeRadius",e.armProbeRadius),armLagSpeed:y("armLagSpeed",e.armLagSpeed),armLagMaxDistance:y("armLagMaxDistance",e.armLagMaxDistance),armRotationLagSpeed:y("armRotationLagSpeed",e.armRotationLagSpeed),armLagMaxTimeStep:{...g("armLagMaxTimeStep",e.armLagMaxTimeStep,U(Ove)),takes:"a finite number of seconds of at least 1/200"}})})();var pX={armOffset:!1,armTargetOffset:!1,armPivot:!0};function zP(e,t,r){if(t===null&&pX[e])return;let n=t;typeof n=="object"&&n!==null&&n.length===3&&Number.isFinite(n[0])&&Number.isFinite(n[1])&&Number.isFinite(n[2])||r(`${e} must be three finite numbers [x, y, z], got ${String(t)}`)}var Lve=e=>(t,r)=>{et(e,t)||r(`${e.field} must be ${Dt(e)}, got ${String(t)}`)},Rve=Object.fromEntries(Object.values(fX).map(e=>[e.field,Lve(e)])),jP={...Rve,armOffset:(e,t)=>zP("armOffset",e,t),armTargetOffset:(e,t)=>zP("armTargetOffset",e,t),armPivot:(e,t)=>zP("armPivot",e,t),armParent(e,t){let r=e;r!==null&&typeof r?.updateWorldMatrix!="function"&&t(`armParent must be a node of the scene or null, got ${String(e)}`)},armProbeChannel:e=>void cl(e)},Qb=(e,t)=>e in pX&&t!==null?Object.freeze(Array.from(t)):t,_ve=oe("world.controls.possess"),Em=()=>new E("NO_AVATAR","world.controls: 'avatar' follows the avatar world.controls.possess(avatar) takes \u2014 possess one.");function hX(e){if(e==="character")return;let t=e;if(typeof t?.body?.updateWorldMatrix!="function")throw new E("INVALID_AVATAR",`world.controls.possess takes 'character' or an avatar whose body is a node of the scene, got ${String(e)}`);for(let[r,n]of Object.entries(t.arm??{}))n!==void 0&&jP[r]?.(n,_ve)}var vve={interactive:!1,bounce:!0,importedLights:!0,stageProfile:!1},mX=["manifestUrl","scope","importedLights","replicaCount","clearColor"];var gX=(e,t)=>{let r=e[t];return vve[t]?r!==!1:t==="interactive"?!!r:r===!0};var SX=(e,t)=>e??Math.floor(t);function Mve(e,t){let r=SX(t.width,e.clientWidth),n=SX(t.height,e.clientHeight),o=zw(t,e.ownerDocument.defaultView);if(!vn(r,n))throw new E("INVALID_VIEWPORT","Give the canvas a positive CSS size or explicit dimensions");if(!Number.isFinite(o)||o<=0)throw new E("INVALID_PIXEL_RATIO","Pixel ratio must be finite and positive");if(Ii(r,o)<1||Ii(n,o)<1)throw new E("INVALID_VIEWPORT","Canvas drawing buffer must contain at least one pixel");return{width:r,height:n,pixelRatio:o}}function DFt(e,t){if(!gX(t,"interactive"))return{...t};if(!e.ownerDocument.defaultView)throw new E("CANVAS_WINDOW_UNAVAILABLE","Interactive rendering requires a window");return{...t,...Mve(e,t)}}function wX(e){if(e!==void 0&&!(Number.isFinite(e)&&e>0))throw new E("INVALID_FIXED_TIME_STEP","A fixed time step is a finite number of milliseconds above zero")}var yX="temporalAntialiasing",xX="--temporal-antialiasing=",Zb=["off","low","medium","high","max"];var bX="responsive",EX="--responsive=",TX=["off","medium","full"],AX="full",CFt="voxelize",IFt="--voxelize=";var OX="materials",LX="--materials=";var Dve="graph",RX=["responsive","sky",Dve];var Jb=(e,t=!1)=>({group:e,editorOnly:t}),Pve=(e,t)=>({kind:"flag",default:e,...Jb(t)});function Cve(e,t="viewDistance"){let r=Jb(t);if(e.kind==="flag")return{kind:e.kind,default:e.default,...r};if(e.kind==="text")return{kind:e.kind,default:e.default,...r};if(e.kind==="choice")return{kind:e.kind,default:e.default,choices:e.choices,...r};let n=e.above?[Number.MIN_VALUE,e.range[1]]:e.range;return{kind:e.kind,default:e.default,range:n,...r}}var Ive=(e,t)=>Object.fromEntries(Object.entries(e).map(([r,n])=>[r,Cve(n,t)]));function vX(e){let t={};for(let{group:r,groups:n,rules:o}of Object.values(e))for(let[i,s]of Object.entries(n??{[r]:o}))Object.assign(t,Ive(s,i));return t}var _X={pixelError:{kind:"float",default:1,range:[0,Number.MAX_VALUE],...Jb(Ns.pixelError.group)},antialiasing:{kind:"choice",default:"max",choices:Zb,...Jb(Ns.antialiasing.group)},bounce:Pve(!0,Ns.bounce.group),...vX(yr)},MX=new Set(Object.values(yr).flatMap(e=>Object.keys(e.rules))),DX=(e=yr)=>c2(e===yr?_X:{..._X,...vX(e)});var PX={saved:()=>Promise.resolve(null),run:()=>{throw new Error("HARDWARE_BENCHMARK_UNAVAILABLE: this world runs none")}},kve="balanced";function Fve(){let e;return t=>(e?.of!==t&&(e={of:t,levels:V1(t)}),e.levels)}function Nve(e,t){if(!e)return null;let r=t()?.groups;return{...e,cpuSteps:[...e.cpuSteps],gpuSteps:[...e.gpuSteps],groups:r?{...r}:null}}function Bve(e){if(e.result)return!1;let t=e.benchmark.run(void 0,!0);return e.measured=!0,e.found(),t.then(r=>{e.result=r,e.found()},()=>{}).finally(()=>void(e.looking=!1)),!0}async function Uve(e){let t=!1;try{let r=await e.benchmark.saved();if(e.result)return;if(r)return e.result=r,e.found();t=Bve(e)}catch{}finally{t||(e.looking=!1)}}function Vve(e,t){let r=()=>Nve(e.result,e.levels);return{get hardware(){return r()},async benchmark(n){return e.result=await e.benchmark.run(n),t(),r()}}}function CX(e,t){let r=Fve(),n={benchmark:e,found:t,levels:()=>n.result?r(n.result):null,result:null,looking:!1,measured:!1},o;return{level:i=>n.result?n.levels()?.groups[i]??"max":n.measured?kve:"max",look(){if(n.result||n.looking)return;n.looking=!0;let i=Uve(n);o??=i},settled:()=>o??Promise.resolve(),accessors:i=>Vve(n,i)}}function $P(e){let{mode:t,scale:r,dynamic:n=!1}=e;if(e.standard)return n?"auto":void 0;if(!B1.includes(t))throw new Error(`QUALITY_RESOLUTION: no mode ${String(t)}`);let o=r??Sl[t];return n?{min:o/2,max:o}:o}var IX=e=>Object.defineProperty(e,"standard",{value:!0});function Gve(e){if(e===void 0||Number.isNaN(e))return IX({mode:fz.mode});if(e==="auto")return IX({mode:pz.mode,dynamic:!0});let t=typeof e=="object",r=t?e.max??1:e,n=B1.find(o=>Sl[o]===r);return n?{mode:n,dynamic:t}:{mode:"native",scale:r,dynamic:t}}var cd=(e,t,r)=>{if(!t.includes(e))throw new Error(`QUALITY_${r}: no ${r.toLowerCase()} ${e}`);return e},FX=e=>typeof e=="object"&&e!==null,Tm=e=>Un.indexOf(e),kX=e=>e.min===void 0?{max:e.max}:{min:e.min,...e.max&&{max:e.max}};function Hve(e,t){if(!t)return e;let r=t.min?Tm(t.min):0,n=t.max?Tm(t.max):Un.length-1;return Un[k(Tm(e),r,n)]}var NX=e=>cd(e,[...Un,"auto"],"PRESET"),Wve=e=>{let t=Object.keys(e).join(",");return Array.isArray(e)?`[${t}]`:`{${t}}`};function zve(e){let{min:t,max:r}=e;if(Array.isArray(e)||t===void 0&&r===void 0||Object.keys(e).some(o=>o!=="min"&&o!=="max"))throw new Error(`QUALITY_LEVEL: no level ${Wve(e)}`);for(let o of[t,r])o!==void 0&&cd(o,Un,"LEVEL");if(t&&r&&Tm(t)>Tm(r))throw new Error(`QUALITY_LEVEL: no level from ${t} to ${r}`)}function BX(e,t){cd(e,oo,"GROUP"),FX(t)?zve(t):t!=="preset"&&cd(t,Un,"LEVEL")}function UX({preset:e="auto",groups:t={}}={}){NX(e);for(let[r,n]of Object.entries(t))BX(r,n)}function jve(e,t){let{table:r}=e,n=Object.keys(r),o=new Map(oo.map(s=>{let a=new Set(Object.values(t[s]).flatMap(c=>Object.keys(c))),l=c=>r[c].group===s&&!r[c].editorOnly&&(!MX.has(c)||a.has(c));return[s,n.filter(l)]})),i=new Map;return{write(s,a,l){let c=t[s][a];for(let u of o.get(s)){let d=c[u];l==="quality"&&d===void 0?e.clear(u,l):e.set(u,d??r[u].default,l)}l==="quality"&&i.set(s,a)},holds:(s,a)=>i.get(s)===a,release(s){for(let a of o.get(s))e.clear(a,"page")},full:(s,a)=>Object.fromEntries(o.get(s).map(l=>[l,t[s][a][l]??r[l].default]))}}function $ve(e,t){return{get resolution(){return Gve(e.asked())},set resolution(r){e.ask($P(r))},get renderSize(){let r=e.drawn();return r?.renderWidth&&r.renderHeight?{width:r.renderWidth,height:r.renderHeight}:null},levels(){let r=oo.map(o=>[o,Object.fromEntries(Un.map(i=>[i,t.full(o,i)]))]),n=new Set(oo.flatMap(o=>Object.keys(t.full(o,"max"))));return{presets:[...Un],groups:Object.fromEntries(r),families:Object.fromEntries([...n].map(o=>[o,nz(o)])),resolution:{...Sl}}}}}function Yve(e,t,r){let n=o=>Hve(r(o),e.bounds.get(o));return{preset:r,drawn:o=>e.page.get(o)??n(o),settle(o,i=!1){let s=n(o);(i||!t.holds(o,s))&&t.write(o,s,"quality")}}}function Kve(e,t,r){return{get preset(){for(let n of oo)if(t.drawn(n)!==t.preset(n))return"custom";return e.preset},set preset(n){e.preset=NX(n),r()},get:n=>t.drawn(cd(n,oo,"GROUP"))}}function qve(e,t,r){let n=(o,i,s)=>{i!=="preset"&&e.bounds.set(o,kX(i)),r.settle(o),(s||i==="preset")&&t.release(o)};return{asked(o){let i=e.bounds.get(cd(o,oo,"GROUP"));return e.page.get(o)??(i?kX(i):"preset")},set(o,i){BX(o,i);let s=e.page.delete(o);if(e.bounds.delete(o),i==="preset"||FX(i))return n(o,i,s);e.page.set(o,i),t.write(o,i,"page")}}}function VX(e,t,r={},n=by,o=PX){let i=jve(e,n),s={preset:r.preset??"auto",page:new Map,bounds:new Map},a=()=>s.preset==="auto",l=CX(o,()=>a()&&d()),u=Yve(s,i,m=>a()?l.level(m):s.preset),d=()=>{for(let m of oo)u.settle(m,!s.bounds.has(m));a()&&l.look()},f=()=>{s.preset="auto",d()},h=W(Kve(s,u,d),qve(s,i,u),$ve(t,i),l.accessors(f));d();for(let[m,w]of Object.entries(r.groups??{}))h.set(m,w);return{quality:h,decided:l.settled}}function GX(e){let{contents:t,lights:r,schedule:n}=e,o=()=>(r.boundsMoved(),e.invalidate());return{pose(i){t.moved(i),(!Ao(i)||i.children.length)&&r.boundsMoved(),r.held&&r.holds(i)?e.relight():e.invalidate()},frame:()=>e.invalidate(),posed(i){let s=!1;for(let a of i)t.moved(a),s||=!!r.held&&r.holds(a);r.boundsMoved(),s?e.relight():e.invalidate()},structure(i){t.changed(i),t.poses.structure(i),r.structure(),n()},entered:i=>t.entered(i),shadow(i){if(Ao(i))return e.relight();t.moved(i),e.invalidate()},instances(i,s,a){t.instances(i,s,a),o()},content:i=>HX(e,i),picture:()=>e.repicture(),values:i=>Qve(e,i),seat:i=>Zve(t,i),seatEpoch:()=>t.seatEpoch,placed(i,s,a){t.poses.touchRange(i,s,a),o()},background(){e.relight(),e.invalidate()},sky:e.sky,image:i=>Xve(e,i)}}function Xve(e,t){t&&e.notices.say(t.kind,t.message,t.context),e.invalidate()}function HX(e,t){let{contents:r,lights:n,schedule:o}=e;if(Ao(t))return e.relight();t.isLoadedModel?r.restyle(t):(r.stale(t),n.boundsMoved()),o()}function Qve(e,t){t.isMesh&&e.contents.writeValues(t)?e.invalidate():HX(e,t)}function Zve(e,t){if(We(t))return null;let r=e.seats.get(t);return r&&r.batch.rows&&r.row>=0?r:null}var Jve=e=>({pose:e,posed:e,structure:()=>{},content:()=>{}});function tE(e){let t=Jve(e);return r=>(r._link||(r._link=t),r)}function YP(e){let t=e;if(typeof e=="string"){if(!e.length)throw new E("INVALID_CANVAS","Canvas ID must not be empty");if(typeof document>"u")throw new E("CANVAS_DOCUMENT_UNAVAILABLE","Canvas ID lookup requires a document");if(t=document.getElementById(e),!t)throw new E("CANVAS_NOT_FOUND",`No canvas with ID "${e}"`)}let r=t;if(!r||r.nodeName!=="CANVAS"||typeof r.getContext!="function")throw new E("INVALID_CANVAS","MeasuredWorld target must be a canvas element or its ID");return r}function rE(e){let t=typeof e=="string"&&typeof document<"u"?document.getElementById(e):e;if(!t||typeof t=="string")return{canvas:YP(e),release(){}};if(t.nodeName==="CANVAS")return{canvas:YP(t),release(){}};if(typeof t.appendChild!="function"||!t.ownerDocument)throw new E("INVALID_CANVAS","World target must be an element, a canvas or its ID");let r=t.ownerDocument.createElement("canvas");return r.style.width="100%",r.style.height="100%",r.style.display="block",t.appendChild(r),{canvas:r,release:()=>r.remove()}}var Am=new WeakMap;function WX(e){let t=Am.get(e);return t||Am.set(e,t={holds:0,made:new Set,device:void 0}),t}var eMe=(e,t)=>t.device??=tMe(e,t);function tMe(e,t){let r=n=>o=>{let i=n.call(e,o),s=i.destroy;return t.made.add(i),i.destroy=()=>{t.made.delete(i),s.call(i)},i};return yK(e,{createBuffer:r(e.createBuffer),createTexture:r(e.createTexture)})}function zX(e){let t=Ir(e);return eMe(t,WX(t))}function Vl(e){let t=Ir(e),r=WX(t);r.holds++;let n=!0;return()=>{if(!n||(n=!1,--r.holds>0))return;Am.get(t)===r&&Am.delete(t);let o=[...r.made];r.made.clear();for(let i of o)i.destroy()}}function aNt(e){let t=wn(e);return Object.assign(n=>t(zX(n)),{known:n=>{let o=Am.get(Ir(n))?.device;return o&&t.known(o)}})}function lNt(e){let t=sK(e);return(r,n)=>t(zX(r),n)}var rMe=[1e3,4e3,16e3],nMe=6e4,oMe={now:Z,wait:(e,t)=>new Promise(r=>{let n=gr(r,e);t.addEventListener("abort",()=>clearTimeout(n),{once:!0})})};function iMe(e,t,r){let n=rMe[e-1];return n===void 0?(tr.warn("World GPU device lost again, not asked for again:",t),Promise.reject(Ez(e,t))):(tr.warn(`World GPU device lost, asking for another in ${n/1e3} s:`,t),r(n))}var KP=e=>e.disposal.signal.aborted;function jX(e){return e.probe().then(t=>{if(KP(e))return t.destroy();e.gpuDevice=t,e.tenure=e.resting?void 0:Vl(t),e.since=e.clock.now(),t.lost.then(r=>{if(!(KP(e)||r.reason==="destroyed"||e.gpuDevice!==t)){if(e.resting)return e.resting();sMe(e,t,r.message)}})})}function sMe(e,t,r){let n=e.clock.now();e.gpuDevice=void 0,e.tenure?.(),t.destroy(),e.losses=n-e.since<nMe?e.losses+1:1;let o=i=>e.clock.wait(i,e.disposal.signal);e.pending=iMe(e.losses,r,o).then(()=>jX(e)),e.pending.catch(()=>{}),gr(()=>KP(e)||e.regranted(n),0)}function qP(e,t=K1,r=oMe){let n={regranted:e,probe:t,clock:r,disposal:new AbortController,gpuDevice:void 0,losses:0,since:0,tenure:void 0,pending:void 0,resting:void 0};return n.pending=jX(n),n.pending.catch(()=>{}),{ready:n.pending,get pending(){return n.pending},get gpuDevice(){return n.gpuDevice},opened(){n.since=r.now()},rest(o){n.resting=o,n.tenure?.(),n.tenure=void 0},resume(){n.resting=void 0,n.losses=0,n.gpuDevice&&(n.tenure??=Vl(n.gpuDevice))},dispose(){n.disposal.abort(Jr),n.tenure?.(),n.gpuDevice?.destroy()}}}var aMe=1e4,lMe=6e4;function $X(){let e=0,t=new Set;return{get held(){return e>0},take(){e++;let r=!1;return()=>{if(!r){r=!0,e--;for(let n of[...t])n()}}},listen(r){return t.add(r),()=>void t.delete(r)}}}var fr=()=>globalThis.document?.visibilityState==="hidden";function ud(e){let t=globalThis.document;if(!fr())return Promise.resolve();let{promise:r,resolve:n}=uo(),o=()=>{fr()||(t.removeEventListener("visibilitychange",o),n())};return t.addEventListener("visibilitychange",o),Jt(r,e,()=>t.removeEventListener("visibilitychange",o))}function YX(e){let t=globalThis.document,r=globalThis;if(!t||!r.addEventListener||!r.removeEventListener)return()=>{};let{loading:n,leases:o}=e,i,s,a,l=!1,c=()=>n.read().waiting||o.held&&!l,u=()=>{clearTimeout(i),a?.(),a=void 0},d=()=>i=setTimeout(h,aMe),f=()=>{c()||(u(),d())},h=()=>{if(!c())return e.release();let b=n.listen(f),T=o.listen(f);a=()=>(b(),T())},m=()=>{l=!0,!(!a||c())&&(u(),e.release())},w=()=>{u(),clearTimeout(s),l=!1,fr()&&(d(),s=setTimeout(m,lMe))},x=b=>b.persisted?e.release():e.dispose();return t.addEventListener("visibilitychange",w),r.addEventListener("pagehide",x),w(),()=>{u(),clearTimeout(s),t.removeEventListener("visibilitychange",w),r.removeEventListener("pagehide",x)}}var cMe=$M,Gl,KX=(e,t)=>void t.catch(()=>void(e.refused=!0)),qX=()=>Gl&&!Gl.refused?Gl:void 0;function XX(e){let t=qX();if(t)return uMe(t);let r=new Set,n={worlds:r,refused:!1,wake:void 0,kept:!1,preparing:0,held:e(o=>{KX(n,n.held.pending);for(let i of[...r])i.regranted(o)})};return KX(n,n.held.ready),Gl=n}function nE(e){e.wake?.(),e.held.dispose(),Gl===e&&(Gl=void 0)}function QX(e,t=!1){e.wake?.();let r=globalThis.document,n=()=>fr()&&nE(e),o=t?void 0:gr(()=>nE(e),cMe);r?.addEventListener("visibilitychange",n),e.kept=t,e.wake=()=>{e.wake=void 0,e.kept=!1,clearTimeout(o),r?.removeEventListener("visibilitychange",n)},e.held.rest(()=>nE(e))}function uMe(e){return e.wake&&(e.wake(),e.held.resume()),e}function ZX(e=qP){let t=qX();if(fr()||t&&t.worlds.size>0)return;let r=t??XX(e);r.kept||QX(r,!0);let{held:n}=r;return{key:n,ready:n.ready,get gpuDevice(){return n.gpuDevice},preparing(o){r.preparing++,o.finally(()=>void r.preparing--)}}}var XP=wn(()=>[]);function JX(e,t){XP(e).push(t)}function eQ(e){let t=e&&XP.known(e);if(t){XP.forget(e);for(let r of t)r()}}function dMe(e,t=qP){let r=XX(t),{held:n}=r,o={regranted:e};return r.worlds.add(o),{ready:n.ready,get pending(){return n.pending},get gpuDevice(){return n.gpuDevice},opened(){n.opened(),eQ(n.gpuDevice)},dispose(){!r.worlds.delete(o)||r.worlds.size>0||(n.gpuDevice&&!fr()&&Gl===r?QX(r,r.preparing>0):nE(r))}}}function fMe(e,t,r=Z,n=!1){let o=e,i=Promise.resolve(),s=t,a=i,l=tQ(e),{hearers:c}=l,u=f=>{c.delete(u);let h=r();o=void 0,i=Promise.reject(Tz(f.message)),i.catch(()=>{}),gr(()=>s?.(h),0)};l.lost?u(l.lost):c.add(u);let d=Vl(e);return{ready:a,get pending(){return i},get gpuDevice(){return o},opened:()=>void(n||eQ(e)),dispose(){s=void 0,c.delete(u),d()}}}var tQ=wn(e=>{let t={hearers:new Set,lost:void 0};return e.lost.then(r=>{t.lost=r;for(let n of[...t.hearers])n(r)}),t}),rQ=e=>!!tQ.known(e)?.hearers.size,nQ=(e,t,r=!1)=>e?fMe(e,t,Z,r):dMe(t);var pMe=/^(?:v|vn|vt|f|o|g|s|l|p|mtllib|usemtl)\s/;function hMe(e,t){let r=e.replace(/^\uFEFF/,"").trimStart();if(!r)return t?"unknown":null;if(r.startsWith("{"))return/"asset"\s*:/.test(r)?"gltf":/"status"\s*:/.test(r)?"manifest":t?"unknown":null;for(let n of r.split(`
|
|
13
|
+
`)){let o=n.trim();if(!(!o||o.startsWith("#")))return pMe.test(`${o} `)?"obj":"unknown"}return t?"unknown":null}async function mMe(e,t){let r=(await vr(e,t)).body?.getReader();if(!r)return"unknown";let n=new TextDecoder,o="",i=!0;try{for(;;){let{done:s,value:a}=await r.read();if(a&&i&&a.length>=4){if(a[0]===103&&a[1]===108&&a[2]===84&&a[3]===70)return"glb";i=!1}a&&(o+=n.decode(a,{stream:!s}));let l=hMe(o,s);if(l)return l}}finally{r.cancel().catch(()=>{})}}async function oQ(e,t,r){let n=await mMe(e,t.signal),o=r[n];if(!o)throw new E("UNSUPPORTED_MODEL_FORMAT",`${e}: ${n} models cannot be loaded yet; the runtime compiler will read them`,{url:e,format:n});return o(e,t)}var iQ=({scope:e})=>e===void 0?void 0:e==="full"?"full":"slice",sQ=e=>new URL(e,globalThis.document?.baseURI??"http://localhost/").href;function gMe(e,t){let r=iQ(t);return{scope:r,key:`${r??""} ${sQ(e)}`}}var SMe=async(e,t)=>(await M.manifestLoad.load()).loadModel(e,t);function wMe(){let e=new Set,t=new Set,r=new Map;return{fly(n,o,i){let{promise:s,resolve:a}=uo(),l=s.then(()=>(e.delete(l),t.delete(l),void i?.()));t.add(l),o&&e.add(l),n.then(c=>void r.set(c,a),a)},waited:()=>ki(e),flying:()=>ki(t),added(n){r.get(n)?.(),r.delete(n)}}}function yMe(e,t,r,n){let o=new Map;return{modelAt(i,s){let{scope:a,key:l}=gMe(i,s),c=o.get(l);if(c)return c.then(lP);let u={scope:a,signal:s.signal??t,onProgress:s.onProgress,pageCache:r,onManifest:n.foreseen,deforms:n.deforms},d=e.then(()=>oQ(i,u,{manifest:SMe}));return o.set(l,d),d.catch(()=>o.get(l)===d&&o.delete(l)),d},forget(i){for(let s of o.keys())s.slice(s.indexOf(" ")+1).startsWith(i)&&o.delete(s)}}}function aQ(e,t,r,n=()=>!1,o={}){s7();let i=yMe(e,t,r,o),s=wMe(),a=async(u,d)=>{let f=!n(),h=o.started?.(),m=x=>(h?.progress(x),d.onProgress?.(x)),w=i.modelAt(u,h?{...d,onProgress:m}:d);return s.fly(w,f,h?.ended),w},l=async(u,d)=>(xMe(u),a(u,d)),c=bMe(a,i.forget);return Object.assign(l,{compiled:c.load,dispose:c.dispose,loading:s.waited,flying:s.flying,added(u){o.added?.(u),s.added(u)}})}function xMe(e){if(co.holds(sQ(e)))throw new E("INVALID_OPTIONS",`${e} is the engine's own address of a model compiled in the page, never loaded by its address: load the compilation itself, scene.load(compiled), or serve its files and load them by their address`)}function bMe(e,t){let r=new Map,n=!1,o=(s,a)=>{r.get(s)===a&&(r.delete(s),co.release(a.base),t(a.base))},i=(s,a)=>{(n||!a.models&&!a.loads)&&o(s,a)};return{async load({files:s,scope:a},l){let c=iQ(l);if(c!==void 0&&c!==a)throw new E("SCOPE_MISMATCH",`The model was compiled in the page at the ${a} scope, and ${l.scope} was asked: leave the scope out, or compile it at the scope asked`);let u=r.get(s)??{base:co.hold(s),models:0,loads:0};r.set(s,u),u.loads++;try{let d=await e(`${u.base}native/${a}/manifest.json`,{...l,scope:a==="full"?"full":"progressive"});return u.models++,um(d,()=>(u.models--,i(s,u),!1)),d}finally{u.loads--,i(s,u)}},dispose(){n=!0;for(let[s,a]of r)o(s,a)}}}function Ys(){let e=[],t=fe(),r=[],n=!1,o=!1,i=s=>{e.push(s)};return{listen(s,a,l,c){let u=(d=>o||l(d));s.addEventListener(a,u,c),i(()=>s.removeEventListener(a,u,c))},undo:i,onPause:s=>void r.push(s),emit(){t.emit()},api:{addEventListener(s,a){s==="change"&&t.subscribe(a)},removeEventListener(s,a){s==="change"&&t.unsubscribe(a)},pause(s){if(o!==s&&(o=s,s))for(let a of r)a()},dispose(){n||(n=!0,Aj(e),t.clear())}}}}function dd(e,t){let r=new Float64Array(t),n=!1;return o=>{let i=!n;for(let s=0;s<t;s++)i=i||r[s]!==o[s];if(!i)return!1;for(let s=0;s<t;s++)r[s]=o[s];return n=!0,e.emit(),!0}}var Om=e=>e.clientHeight||1;function lQ(){let e=Symbol();return{of:t=>t[e],bind(t,r){Object.defineProperty(t,e,{value:r})}}}var WNt=e=>({get:e,enumerable:!0,configurable:!0});function QP(e,t,r){if(!(r&&e.ownerDocument?.pointerLockElement))try{r?e.setPointerCapture?.(t):e.releasePointerCapture?.(t)}catch{}}function EMe(e){let t=0,r=0;for(let n of e.values())t+=n.x,r+=n.y;return{x:t/e.size,y:r/e.size}}function TMe(e){let[t,r]=[...e.values()];return Je(t.x-r.x,t.y-r.y)}function oE(e,t,r){let n=new Map,o=0,i=0,s=()=>EMe(n),a=()=>TMe(n),l=e.style.touchAction;e.style.touchAction="none";let c=()=>{for(let d of n.keys())QP(e,d,!1);n.size&&r.up?.(),n.clear(),i=0};t.undo(()=>{e.style.touchAction=l,c()}),t.onPause(c),t.listen(e,"pointerdown",d=>{n.size===0&&(o=d.button),n.set(d.pointerId,{x:d.clientX,y:d.clientY}),n.size===2&&(i=a()),QP(e,d.pointerId,!0),d.preventDefault(),r.down?.(d,n.size===1)}),t.listen(e,"pointermove",d=>{let f=n.get(d.pointerId);if(!f)return;let h=n.size>1?s():f,m=h.x,w=h.y;f.x=d.clientX,f.y=d.clientY;let x=d.clientX-m,b=d.clientY-w;if(n.size===1&&(x||b))r.drag(x,b,o,d);else if(n.size===2){let T=s(),L=a();r.pinch?.(i>0?L/i:1,T.x-m,T.y-w),i=L}});let u=d=>{n.delete(d.pointerId)&&(QP(e,d.pointerId,!1),n.size<2&&(i=0),n.size===0&&r.up?.())};return t.listen(e,"pointerup",u),t.listen(e,"pointercancel",u),t.listen(e,"contextmenu",d=>d.preventDefault()),n}function cQ(e,t,r){t.listen(e,"wheel",n=>{n.preventDefault();let o=n.deltaMode===0?n.deltaY/100:n.deltaY;o&&r(o)},{passive:!1})}var AMe=/^(text|search|email|url|tel|password|number|date|datetime-local|month|time|week)$/;function OMe(e){let t=e,r=t?.tagName??"";return r==="INPUT"?AMe.test(t?.type||"text"):/^(TEXTAREA|SELECT)$/.test(r)||!!t?.isContentEditable}function ui(e,t,r,n,o){let i=new Set,s=new Set(n.flat(2)),a=e.ownerDocument;t.listen(a,"keydown",c=>{c.metaKey||c.ctrlKey||OMe(c.target)||(s.has(c.code)&&c.preventDefault(),o?.(c.code),!i.has(c.code)&&(i.add(c.code),r()))}),t.listen(a,"keyup",c=>{i.delete(c.code)&&r()});let l=()=>{i.size&&(i.clear(),r())};return t.listen(a.defaultView??a,"blur",l),t.onPause(l),i}var fd=[["KeyW"],["KeyS"]],pd=[["KeyD"],["KeyA"]],Hl=[["KeyW","ArrowUp"],["KeyS","ArrowDown"]],hd=[["KeyD","ArrowRight"],["KeyA","ArrowLeft"]];function Lm(e,t){for(let r=0;r<t.length;r++)if(e.has(t[r]))return!0;return!1}var on=(e,t,r)=>Number(Lm(e,t))-Number(Lm(e,r));function Rm(e,t){return PV(e,t[1],t[2]-me)}function uQ(e,t,r){let n=Q,o=r-t;if(!Number.isFinite(o)||o>=n)return e;let i=sa(o,n),s=sa(e-t,n);return s<=i?e:s-i<n-s?r:t}function dQ(e,t,r){let n=yA(e.zoom??1,e.overscan??0);return e.projection==="orthographic"?(e.top-e.bottom)/n*r:2*t*Rn(e.fov,n)*r}function fQ(e,t,r,n,o){let i=yt(ZP,t,1,0,0);e[0]=-i[0]*r*o,e[1]=-i[1]*r*o,e[2]=-i[2]*r*o;let s=yt(ZP,t,0,1,0);return e[0]+=s[0]*n*o,e[1]+=s[1]*n*o,e[2]+=s[2]*n*o,e}var ZP=new Float64Array(3),JP=.95;function iE(e,t,r){return e*Math.pow(JP,t*r)}function pQ(e,t,r,n,o){if(!r&&!n&&!o)return;let i=yt(ZP,t,r,n,-o);e[0]+=i[0],e[1]+=i[1],e[2]+=i[2]}function md(e,t,r,n,o=!1){let i=Math.sin(t),s=Math.cos(t),a=o?1:Je(r,n)||1;return e[0]=(s*r-i*n)/a,e[1]=(-i*r-s*n)/a,e}function eC(e,t,r,n){let o=0,i=0,s=(a,l)=>{o+=a,i+=l,t.emit()};return oE(e,t,{down:n.down,up:n.up,drag:(a,l)=>void(n.drag()&&s(a,l))}),t.listen(e,"pointermove",a=>{n.move(a)&&s(a.movementX,a.movementY)}),{take(a){let l=r.lookSpeed??ss/Om(e);return a[0]=-o*l,a[1]=-i*l,o=i=0,a},clear(){o=i=0}}}var sE={lookSpeed:null,minPitch:Gc-me,maxPitch:me-Gc};function aE(e){let t=e.ownerDocument;t?.pointerLockElement===e&&t.exitPointerLock?.()}var hQ=e=>({locked:()=>e().locked(),lock:()=>e().lock(),unlock:()=>e().unlock()});function LMe(e,t){let r=new Float64Array(4),n=new Float64Array(4),o=new Float64Array(3),i=new Float64Array(2),s=new Float64Array(3),a=0,l=0;return{sample(){e.readOrientation(r),!Be(r,n)&&(yt(o,r,0,0,-1),KV(i,o[0],o[1],o[2]),l=i[0],a=i[1])},turn(c,u){return l+=c[0],a=qt(a+c[1],t.minPitch,t.maxPitch),s[1]=l,s[2]=me+a,Rm(u,s),n.set(u),l},wrote(c){n.set(c)}}}function mQ(e,t,r,n){let o=t.ownerDocument,i=new Float64Array(2),s=LMe(e,n),a={locked:()=>o.pointerLockElement===t,lock:()=>void Promise.resolve(t.requestPointerLock?.()).catch(()=>{}),unlock:()=>aE(t),turn(u){return s.sample(),c.take(i),s.turn(i,u)},wrote:s.wrote},l=!1,c=eC(t,r,n,{down:()=>a.lock(),drag:()=>!a.locked(),move:()=>a.locked()?l?(l=!1,!1):!0:!1});return r.listen(o,"pointerlockchange",()=>{l=a.locked(),r.emit()}),r.onPause(c.clear),a}function Ks(e){return{object:e,vector:()=>e.position.clone().set(0,0,0),worldLength:(t,r)=>dQ(e,t,r),readPosition:t=>De(t,e.position),readOrientation:t=>bt(t,e.quaternion),write(t,r,n){e.position.set(t[0],t[1],t[2]),e.quaternion.set(r[0],r[1],r[2],r[3]),e.updateMatrixWorld(),e.setViewTarget(n?[n[0],n[1],n[2]]:null)}}}function gQ(e,t){return e.set(t[0],t[1],t[2]),e}var wQ=[["ArrowUp"],["ArrowDown"]],yQ=[["ArrowLeft"],["ArrowRight"]],xQ=[["KeyQ"],["KeyE"]],SQ=[["KeyR"],["KeyF"]],nC={rollSpeed:.4,lookSpeed:null,pitchSpeed:null,yawSpeed:null,inputResponse:0,pitchInput:0,yawInput:0,rollInput:0,pointerLook:!0,autoForward:!1},tC=(e,t,r,n)=>e[t]+=qt(r-e[t],-n,n),rC=(e,t,r)=>k(on(e,...t)+r,-1,1);function RMe(e,t,r,n,o,i,s){let a=e.inputResponse>0?s/e.inputResponse:1/0,l=tC(r,0,rC(t,wQ,e.pitchInput),a),c=tC(r,1,rC(t,yQ,e.yawInput),a),u=tC(r,2,rC(t,xQ,e.rollInput),a),d=n[1]+l*(e.pitchSpeed??e.rollSpeed)*s,f=n[0]+c*(e.yawSpeed??e.rollSpeed)*s,h=u*e.rollSpeed*s;(d||f||h)&&jr(nt(o,o,iw(i,d,f,h)))}function bQ(e,t){let r=Ks(e),n=Ys(),o=new Float64Array(3),i=new Float64Array(4),s=new Float64Array(4),a=new Float64Array(3),l=new Float64Array(7),c=new Float64Array(2),u=dd(n,7),d=!1,f={...n.api,object:r.object,movementSpeed:1,...nC,dragToLook:!0,update(w=0){let x=w>0?w:0;r.readPosition(o),r.readOrientation(i),m.take(c),RMe(f,h,a,c,i,s,x);let b=f.movementSpeed*x,T=on(h,...fd);return pQ(o,i,on(h,...pd)*b,on(h,...SQ)*b,(f.autoForward?Math.max(0,1+T):T)*b),r.write(o,i),l.set(o),l.set(i,3),u(l)}},h=ui(t,n,()=>n.emit(),[wQ,yQ,xQ,pd,SQ,fd]),m=eC(t,n,f,{down:()=>void(d=!0),up:()=>void(d=!1),drag:()=>f.dragToLook&&f.pointerLook,move:()=>!f.dragToLook&&!d&&f.pointerLook});return f}var EQ=["dolly","fly","rotate","pan"],lE=(e,t)=>e===void 0||e===t,_Me=(e,t)=>(e.button===void 0||e.button===t.button)&&lE(e.alt,t.altKey)&&lE(e.shift,t.shiftKey)&&lE(e.ctrl,t.ctrlKey)&&lE(e.meta,t.metaKey),vMe=[],MMe=e=>+(e.button!==void 0)+ +(e.alt!==void 0)+ +(e.shift!==void 0)+ +(e.ctrl!==void 0)+ +(e.meta!==void 0);function AQ(e,t){let r=null,n=-1;for(let o=0;o<EQ.length;o++){let i=EQ[o],s=e[i]??vMe;for(let a=0;a<s.length;a++){let l=s[a],c=MMe(l);c>n&&_Me(l,t)&&(r=i,n=c)}}return r}var TQ=["rotate","pan","dolly","fly"],OQ=["alt","shift","ctrl","meta"],DMe=["button",...OQ];function PMe(e,t,r){let n=Xe(e,DMe,t,r),{button:o}=n;o!==void 0&&!(Number.isInteger(o)&&o>=0)&&r(`${t}.button must be a whole number of 0 or more (PointerEvent.button), got ${String(o)}`);for(let i of OQ)n[i]!==void 0&&typeof n[i]!="boolean"&&r(`${t}.${i} must be true or false, got ${String(n[i])}`)}function LQ(e,t){if(e==null)return;let r=Xe(e,TQ,"gestures",t);for(let n of TQ){let o=r[n];if(o!==void 0){Array.isArray(o)||t(`gestures.${n} must be a list of chords`);for(let i=0;i<o.length;i++)PMe(o[i],`gestures.${n}[${i}]`,t)}}}var cE=Object.freeze({rotate:Object.freeze([{button:0,shift:!1}]),pan:Object.freeze([{}])}),RQ=Object.freeze({pan:Object.freeze([{}])}),_Q=20;function CMe(e,t){let{position:r,center:n,offset:o,orientation:i}=t,s=te(o[0],o[1],o[2]);s<Vf&&(yt(o,i,0,0,1),s=1);let a=iC(e,s);for(let l=0;l<3;l++)r[l]=n[l]+o[l]*a/s}function IMe(e,t,r){let{api:n,center:o,orientation:i,pose:s,offset:a}=e;n.enablePan&&(e.sample(),oC(o,i,s,te(a[0],a[1],a[2]),e.height(),t,r),e.apply())}function kMe(e,t){let{api:r,offset:n}=e;if(!r.enableZoom)return;e.sample();let o=te(n[0],n[1],n[2])||1,i=iE(o,t,r.zoomSpeed);for(let s=0;s<3;s++)n[s]=n[s]*i/o;e.apply()}function gd(e,t){let r=Ks(e),n=Ys();n.undo(()=>e.setViewTarget(null));let o=new Float64Array(3),i=new Float64Array(3),s=new Float64Array(3),a=new Float64Array(4),l=new Float64Array(10),c={position:o,center:i,offset:s,orientation:a},u=dd(n,10),d=()=>Om(t),f=()=>{r.readPosition(o),r.readOrientation(a),De(i,m.target);for(let x=0;x<3;x++)s[x]=o[x]-i[x]},h=()=>(CMe(m,c),r.write(o,a,i),gQ(m.target,i),l.set(o),l.set(i,3),l.set(a,6),u(l)),m=FMe(n,r,()=>(f(),h())),w={base:n,pose:r,api:m,...c,height:d,sample:f,apply:h,panBy:(x,b)=>IMe(w,x,b),dolly:x=>kMe(w,x)};return w}var vQ=new Float64Array(3);function oC(e,t,r,n,o,i,s){fQ(vQ,t,i,s,r.worldLength(n,1/Math.max(1,o)));for(let a=0;a<3;a++)e[a]+=vQ[a]}function iC(e,t){let r=Math.max(e.maxDistance,e.minDistance,Vf);return qt(t,Math.max(e.minDistance,Vf),r)}var sC={minDistance:0,maxDistance:1/0,rotateSpeed:1,zoomSpeed:1,enableZoom:!0,enablePan:!0,gestures:null};function FMe(e,t,r){return{...e.api,object:t.object,target:t.vector(),...sC,update:r}}function Sd(e,t,r,n,o){let i=null,s={rotate:(a,l)=>o.rotate?.(a,l),pan:(a,l)=>o.pan(a,l),dolly:(a,l)=>o.dolly((a-l)*_Q/Om(e)),fly:(a,l)=>o.fly?.drag(a,l)};oE(e,t,{down:(a,l)=>{l&&(i=AQ(r.gestures??n,a),i==="fly"&&o.fly?.press())},drag:(a,l)=>{i&&s[i](a,l)},up:()=>{i==="fly"&&o.fly?.release(),i=null},pinch:(a,l,c)=>{o.pan(l,c),o.dolly(NMe(a))}}),cQ(e,t,a=>o.dolly(-a))}function NMe(e){return e>0?-Math.log(e)/Math.log(JP):0}var MQ={KeyW:[0,0,1],KeyS:[0,0,-1],KeyD:[1,0,0],KeyA:[-1,0,0],KeyE:[0,1,0],KeyQ:[0,-1,0]};function aC(e,t,r){let n=Math.sin(t),o=Math.cos(t),i=Math.sin(r),s=Math.cos(r);return e[0]=i*n,e[1]=s,e[2]=i*o,e[3]=s*n,e[4]=-i,e[5]=s*o,e[6]=o,e[7]=0,e[8]=-n,e}var uE=new Float64Array(9),dE=new Float64Array(9),fE=new Float64Array(3);function DQ(e,t,r,n,o){aC(uE,n,o),aC(dE,r[1],r[2]);let i=e[0]-t.x,s=e[1]-t.y,a=e[2]-t.z;for(let l=0;l<3;l++)fE[l]=i*uE[3*l]+s*uE[3*l+1]+a*uE[3*l+2];e[0]=t.x,e[1]=t.y,e[2]=t.z;for(let l=0;l<3;l++)e[l]+=fE[0]*dE[l]+fE[1]*dE[3+l]+fE[2]*dE[6+l]}function PQ(e){let{base:t,center:r,position:n,offset:o,spherical:i,api:s}=e,a=new Set,l=new Float64Array(9),c=!1,u=e.surface.ownerDocument;t.listen(u,"keydown",f=>{!c||f.ctrlKey||f.metaKey||!MQ[f.code]||(f.preventDefault(),!a.has(f.code)&&(a.add(f.code),t.emit()))}),t.listen(u,"keyup",f=>{a.delete(f.code)&&t.emit()});let d=()=>{c=!1,a.clear()};return t.onPause(d),{actions:{press:()=>void(c=!0),release:d,drag(f,h){e.sample();let m=Q*s.rotateSpeed/e.height();i[1]-=f*m,i[2]-=h*m,e.clamp(),Hc(o,i);for(let w=0;w<3;w++)r[w]=n[w]-o[w];e.apply()}},move(f){if(!c||!a.size||!(f>0))return;aC(l,i[1],i[2]);let h=s.movementSpeed*f;for(let m of a){let[w,x,b]=MQ[m];for(let T=0;T<3;T++)r[T]+=(w*l[6+T]-b*l[T]+(T===1?x:0))*h}}}}var lC={minPolarAngle:0,maxPolarAngle:ss,minAzimuthAngle:-1/0,maxAzimuthAngle:1/0,autoRotate:0,pivot:null};function BMe(e){let{position:t,center:r,offset:n,orientation:o}=e,i=new Float64Array(3),s=new Float64Array(10),a=new Float64Array(10),l=!1,c=()=>{e.sample(),a.set(t),a.set(r,3),a.set(o,6),(!l||!Be(a,s))&&lw(i,n)},u=()=>{let f=e.api;i[1]=uQ(i[1],f.minAzimuthAngle,f.maxAzimuthAngle),i[2]=qt(i[2],Math.max(f.minPolarAngle,Gc),Math.min(f.maxPolarAngle,ss-Gc))};return{spherical:i,sample:c,clamp:u,apply:()=>{i[0]=iC(e.api,i[0]),u(),Hc(n,i),Rm(o,i);let f=e.apply();return s.set(t),s.set(r,3),s.set(o,6),l=!0,f}}}function CQ(e,t){let r=gd(e,t),{base:n,pose:o,center:i,orientation:s}=r,{spherical:a,sample:l,clamp:c,apply:u}=BMe(r),d=(L,_)=>{l();let D=a[1],C=a[2];a[1]-=Q*L*x.rotateSpeed/r.height(),a[2]-=Q*_*x.rotateSpeed/r.height(),x.pivot&&(c(),DQ(i,x.pivot,a,D,C)),u()},f=(L,_)=>{x.enablePan&&(l(),Rm(s,a),oC(i,s,o,a[0],r.height(),L,_),u())},h=L=>{x.enableZoom&&(l(),a[0]=iE(a[0],L,x.zoomSpeed),u())},m=!0,w=(L=0)=>(l(),m&&(a[1]+=x.autoRotate*Math.max(0,L)),b.move(L),u()),x=Object.assign(r.api,{...lC,movementSpeed:1,update:w}),b=PQ({...r,surface:t,spherical:a,api:x,sample:l,clamp:c,apply:u}),T=()=>void(m=!1);return n.listen(t,"pointerdown",T),n.listen(t,"wheel",T),Sd(t,n,x,cE,{rotate:d,pan:f,dolly:h,fly:b.actions}),x}var IQ=Object.freeze({groundFriction:8,brakingDecelerationWalking:20.48,brakingDecelerationFalling:0,fallingLateralFriction:0,brakingFrictionFactor:2,brakingSubStepTime:.030303030303030304,airControlBoostMultiplier:2,airControlBoostVelocityThreshold:.25,terminalVelocity:40,maxSimulationTimeStep:.05,maxSimulationIterations:8,maxJumpApexAttemptsPerSimulation:2,minAnalogWalkSpeed:0,jumpMaxCount:1,jumpMaxHoldTime:0,applyGravityWhileJumping:!0,dontFallBelowJumpZVelocityDuringJump:!0});var $2t=170/60,Y2t=(e,t)=>Math.max(0,-e*t);var kQ=6,FQ=.88,UMe=.64,NQ=Object.freeze({...IQ,walkSpeed:kQ,jumpSpeed:4.2,gravityScale:1,airControl:.05,capsuleRadius:.34,capsuleHeight:2*FQ,eyeHeight:FQ+UMe,stepHeight:.45,maxSlope:Math.acos(.71),headBob:.035,landingDip:.06,mass:100,pushStrength:250,canCrouch:!1,crouchedHeight:.8,crouchedSpeed:.5*kQ,crouchKeepsBase:!1,canSwim:!0,swimSpeed:3,flySpeed:6,flying:!1,buoyancy:1,fluidFriction:.3,maxAcceleration:20.48,swimBraking:0,flyBraking:0});var pE={...sC,...lC,movementSpeed:1,...sE,...nC,...NQ,...Ul,pivotAtPointer:!1,realTime:null,onLand:null,onJump:null,input:null};function VMe(e,t){e!==null&&typeof e!="boolean"&&t(`realTime must be true, false or null, got ${String(e)}`)}function GMe(e,t){if(e==null)return;let r=e;(!Number.isFinite(r.x)||!Number.isFinite(r.y)||!Number.isFinite(r.z))&&t(`pivot must be a point of finite x, y and z, or null, got ${String(e)}`)}var HMe={gestures:LQ,pivot:GMe,realTime:VMe,...jP},WMe=oe("world.controls");function BQ(e,t){let r={};for(let n of Object.keys(pE)){let o=HMe[n];Object.defineProperty(r,n,{get:()=>e(n),set:i=>{o?.(i,WMe),t(n,Qb(n,i))},enumerable:!0,configurable:!0})}return r}var Ro=e=>e==="character"||e==="avatar",cC=()=>(M.avatar.get(),M.avatar.settled());function UQ(e){let t=e.avatar?.body;return t?(t._link&&(e.seen=!0),!t._link&&e.seen):!1}var VQ=[["Space"],["ShiftLeft"]];function GQ(e,t){let r=Ks(e),n=Ys(),o=new Float64Array(3),i=new Float64Array(4),s=new Float64Array(2),a=new Float64Array(7),l=dd(n,7),c={...n.api,object:r.object,movementSpeed:1,...sE,...hQ(()=>u),update(f=0){let h=f>0?f:0;r.readPosition(o);let m=c.movementSpeed*h;return md(s,u.turn(i),on(d,...pd),on(d,...fd)),o[0]+=s[0]*m,o[1]+=on(d,...VQ)*m,o[2]+=s[1]*m,r.write(o,i),a.set(o),a.set(i,3),l(a)}},u=mQ(r,t,n,c),d=ui(t,n,()=>n.emit(),[pd,VQ,fd]);return c}var HQ="Space",WQ={throttle:0,brake:0,steer:0,handbrake:!1},uC=lQ();function zQ({vehicle:e,input:t}){(t.throttle||t.brake||t.steer||t.handbrake)&&e?.drive({...WQ})}var zMe={vehicle:{get(){return uC.of(this).vehicle},set(e){let t=uC.of(this);e!==t.vehicle&&(zQ(t),t.vehicle=e,e?.drive(t.input))},enumerable:!0,configurable:!0}};function jQ(e,t){let r=Ys(),n={...WQ},o={vehicle:null,input:n},i={...r.api,object:Ks(e).object},s=Object.defineProperties(i,zMe);uC.bind(s,o),r.undo(()=>zQ(o));let a=ui(t,r,()=>{n.throttle=Lm(a,Hl[0])?1:0,n.brake=Lm(a,Hl[1])?1:0,n.steer=on(a,...hd),n.handbrake=a.has(HQ),o.vehicle?.drive(n)},[hd,Hl,[HQ]]);return s}function $Q(e,t){let r=gd(e,t),n=new Float64Array(4),o=new Float64Array(3),i=c=>{c&&(ao(n,o,c),jr(nt(r.orientation,n,r.orientation)),yt(r.offset,n,r.offset[0],r.offset[1],r.offset[2]))},s=(c,u,d,f)=>{yt(o,r.orientation,c,u,d),i(f)},a=(c,u)=>{r.sample();let d=Q*l.rotateSpeed/r.height();l.turntable?(o.set([0,1,0]),i(-c*d)):s(0,1,0,-c*d),s(1,0,0,-u*d),r.apply()},l=Object.assign(r.api,{turntable:!1});return Sd(t,r.base,l,cE,{rotate:a,pan:r.panBy,dolly:r.dolly}),l}var YQ={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]};function KQ(e,t){let r=gd(e,t),n=Object.assign(r.api,{keyPanPixels:24});return Sd(t,r.base,n,RQ,{pan:r.panBy,dolly:r.dolly}),ui(t,r.base,()=>{},[Object.keys(YQ)],o=>{let i=YQ[o];i&&r.panBy(-i[0]*n.keyPanPixels,-i[1]*n.keyPanPixels)}),n}var hE=new I,_m=new Et,mE=new I;function dC(e,t,r){e.updateWorldMatrix(!0,!1),e.matrixWorld.decompose(hE,_m,mE),t.position.set(hE.x,hE.y,hE.z),t.quaternion.set(_m.x,_m.y,_m.z,_m.w);let{x:n,y:o,z:i}=e.viewTarget;t.viewTarget.set(n*mE.x,o*mE.y,i*mE.z),t.fov=e.fov,t.near=e.near,t.far=e.far,t.zoom=ko(e),t.aspect=r;let{left:s,right:a,top:l,bottom:c,fitAspect:u}=e,d=e.projection==="orthographic"?{left:s,right:a,top:l,bottom:c,fitAspect:u}:null;t.orthographic=d,t._viewSet=e._viewSet,t.drawnFrom=e,t.updateProjectionMatrix(),t.updateMatrixWorld()}var jMe={x:0,y:0,width:0,height:0},qQ=(e,t,r)=>n=>{let o=e(),i=Xi(t,r(),o,jMe);dC(o,n,i?gb(t,i):hm(t))};function XQ(e,t,r){switch(e){case"orbit":return CQ(t,r);case"fly":return bQ(t,r);case"firstPerson":return GQ(t,r);case"character":case"avatar":return M.avatar.get()?.avatarCameraControls(e,t,r)??null;case"vehicle":return jQ(t,r);case"trackball":return $Q(t,r);case"panZoom":return KQ(t,r);default:return null}}function QQ(){let e=new Float64Array(3);return{feet:e,velocity:new Float64Array(3),onGround:!1,place:(t,r,n)=>void e.set([t,r,n]),pressJump(){},advance:()=>e}}var vm="Space",ZQ=["KeyC"],XBt=()=>({body:QQ(),physics:null});function fC(e){let t=te(e.wishX,e.wishY,e.wishZ);t>1&&(e.wishX/=t,e.wishY/=t,e.wishZ/=t)}var pC=e=>e==="swimming"||e==="flying",hC=([e,t,r,n])=>2*(n*e-t*r);function QBt(e,t,r,n,o,i){let s=on(r,...hd),a=on(r,...Hl);md(t,i,s,a),e.wishX=t[0],e.wishZ=t[1],e.wishY=0,e.jump=r.has(vm),e.crouch=ZQ.some(l=>r.has(l)),pC(o)&&(e.wishY=a*hC(n)+(r.has(vm)?1:0)-(e.crouch?1:0),fC(e))}function ZBt(e,t,r,n){let o=!1,i=ui(e,t,()=>{i.has(vm)&&!o&&n()&&r.body.pressJump(),o=i.has(vm),t.emit()},[hd,Hl,[vm],ZQ]);return i}var di=e=>Number.isFinite(e)?e:0,JQ=e=>!!e&&(!!di(e.right)||!!di(e.forward)||!!di(e.wishX)||!!di(e.wishZ)||!!di(e.up)||e.jump===!0||e.crouch===!0);function rUt(e,t,r,n,o,i){let s=di(r.forward);if(md(t,i,di(r.right),s,!0),e.wishX=t[0]+di(r.wishX),e.wishZ=t[1]+di(r.wishZ),e.jump=r.jump===!0,e.crouch=r.crouch===!0,e.wishY=0,pC(o)){let a=r.up===void 0?+e.jump-+e.crouch:di(r.up);e.wishY=s*hC(n)+a}fC(e)}var eZ=new WeakMap;function nZ(e){let t=eZ.get(e);if(t)return t;let r={...WP};for(let[n,o]of Object.entries(e.arm??{}))o!==void 0&&(r[n]=Qb(n,o));return eZ.set(e,t=r),t}var $Me=e=>t=>{let r=e==="character"?null:e,n=r?"avatar":"character";return n===t.kind&&r===t.avatar?null:{kind:n,avatar:r,before:t.before??t.kind,remake:!0,written:!1}},tZ=(e,t)=>r=>{let n=r.before;if(n===null)return null;let o=e(n,null);if(o&&!t)throw o;return o&&(n="none"),{kind:n,avatar:null,before:null,remake:n!==r.kind,written:!1}},YMe=(e,t)=>r=>{let n=e(t,r.avatar);if(n)throw n;return t==="avatar"?null:{kind:t,avatar:null,before:null,remake:!0,written:!0}},rZ=(e,t)=>{try{t()}catch(r){e(r)}};function KMe(e,t,r,n,o){let i=null,s=null,a=[],l=()=>{let d=e.avatar;!d||d===s||(s=d,n(d),rZ(o,()=>d.onUnpossessed?.()),s=null,e.avatar=null)},c=d=>{let f=r(d.kind,d.avatar);if(f)return o(f);let h=d.avatar!==e.avatar?d.avatar:null;if(d.avatar!==e.avatar&&l(),e.disposed)return;let m=r(d.kind,d.avatar);m&&o(m),e.avatar=d.avatar,e.before=d.before,h&&(e.seen=!1),d.remake&&t(m?"none":d.kind,d.written),h&&rZ(o,()=>h.onPossessed?.())};return{ask:d=>{let f=d(i??e);if(f){if(i)return void a.push(i=f);i=f;try{for(let h=f;h;h=a.shift()??null)c(h)}finally{i=null,a.length=0}}},letGo:l}}function oZ(e,t,r,n,o){let{ask:i,letGo:s}=KMe(e,t,r,n,o);return{possess(a){hX(a),i($Me(a))},unpossess:()=>i(tZ(r,!1)),kind:a=>i(YMe(r,a)),lost:()=>i(tZ(r,!0)),end(){e.disposed=!0,s(),e.kind="none",e.before=null}}}var sZ=e=>({kind:e,enabled:!0,current:null,waiting:!1,round:null,disposed:!1,hands:null,avatar:null,before:null,seen:!1,avatarsOff:!1}),qMe=new Set(Object.keys(Ul)),iZ=(e,t,r,n)=>{let o=r.autoForward===!0||r.pitchInput||r.yawInput||r.rollInput,i=JQ(r.input);e.enabled&&(o||i||r.autoRotate||n)&&t()};function XMe(e){let t=e.current;e.current=null,e.hands?.park(t)||t?.dispose()}function QMe(e,t,r){let n=e.hands?.resume()??null,o=e.avatarsOff&&Ro(e.kind);return e.current=n??(o?null:t()),e.waiting=!e.current&&!o&&Ro(e.kind),e.waiting&&ZMe(e,r),n}function ZMe(e,t){let r=cC();r!==e.round&&(e.round=r,r.then(()=>e.waiting&&M.avatar.arrived&&t()))}function aZ(e,t,r,n,o,i,s,a){let l=m=>e.avatar&&qMe.has(m)?nZ(e.avatar):s,c=m=>{let w=m;for(let x of Object.keys(s))x in w&&(w[x]=s[x]);o(w),m.armChanged?.(),iZ(e,n,w)},u=(m,w)=>{let x=l(m),b=x[m]!==w;x[m]=w;let T=e.current;if(T&&(m in T||x!==s)){x===s&&(T[m]=w);let L=e.hands?.heard(m);iZ(e,n,T,b&&L)}e.enabled&&e.current?.target&&e.current.update?.()},d=()=>XQ(e.kind,t(),r),f=(m,w)=>{m.pause(!e.enabled),c(m),w?.resume?.(),m.target&&(m.target.copy(i),e.enabled&&m.update?.()),w||m.addEventListener("change",n)};return{setting:u,rebuild:()=>{if(e.disposed)return;i.copy(e.current?.target??i),XMe(e);let m=QMe(e,d,n);e.current&&f(e.current,m),a()},read:m=>l(m)[m]}}function lZ(e,t,r){let n=s=>{e.enabled&&e.current?.update?.(s)},o=s=>{M.avatar.arrived&&(t(),e.waiting||i.update(s))},i={autoUpdate:!0,get realTime(){return JMe(r.realTime,e.kind)},update:n,place:void 0,eyes:void 0,fit(){i.update=e.waiting?o:n,i.place=i.eyes=void 0,e.hands?.fit(i)},get waiting(){return e.waiting}};return i}var JMe=(e,t)=>e??!(Ro(t)||t==="vehicle");function mC(){let e;return{start:()=>e?.start(),stop:()=>e?.stop(),bind(t){e=t}}}function gC(e,t,r,n,o){return{stop(){if(e.avatarsOff)return;e.avatarsOff=!0;let{hands:i,avatar:s}=e;e.hands=null,s&&i?.release(s),i?.end(),Ro(e.kind)&&(e.current?.dispose(),e.current=null,e.waiting=!1,r())},start(){if(e.avatarsOff&&(e.avatarsOff=!1,!!Ro(e.kind))){if(UQ(e))return o();t(),e.enabled&&n()}}}}function eDe(e,t,r,n,o){return oZ(e,(a,l)=>{e.kind=a,t(),!l&&e.enabled&&r()},(a,l)=>a==="vehicle"&&!n()?bm():a==="avatar"&&!l?Em():null,a=>e.hands?.release(a),o)}function tDe(e,t,r,n,o){return{get kind(){return e.kind},set kind(i){n.kind(i)},get enabled(){return e.enabled},set enabled(i){i!==e.enabled&&(e.enabled=i,e.current?.pause(!i),i?r():aE(o))},get target(){return e.current?.target??t}}}function rDe(e,t,r,n,o,i){return{get autoUpdate(){return t.autoUpdate},set autoUpdate(s){t.autoUpdate=s},update(s=0){t.update(s),t.place?.()},follow(){e.hands?.follow(n())||r()},dispose(){e.waiting=!1,aE(i),o(),e.hands?.end(),e.current?.dispose(),e.current=null,t.fit()}}}var nDe=e=>{let t=()=>e.hands?.parked??e.current,r=n=>t()?.[n];return{get velocity(){let n=r("velocity");return n?new I(n[0],n[1],n[2]):new I},get onGround(){return t()?.onGround===!0},get stride(){return t()?.stride??0},get feet(){let n=r("feet");return n?new I(n[0],n[1],n[2]):new I}}},oDe=(e,t)=>({possess:t.possess,unpossess:t.unpossess,get avatar(){return e.kind==="character"?"character":e.avatar}}),iDe=(e,t,r)=>n=>{t().bind(n),!(!n||!Ro(e.kind))&&(e.hands??=M.avatar.get().createAvatarHands(e,r),e.hands.bind(n))},cZ=new WeakMap,uZ=e=>cZ.get(e),dZ=new WeakMap,fZ=e=>dZ.get(e);function pZ(e,t,r,n,o=null,i=()=>null,s=a=>console.error("[trillion3d] world.controls",a)){if(e==="avatar")throw Em();let a=sZ(e),l=new I,c={...pE},u={lost:()=>L.lost(),physics:o,guides:i,report:s},d=iDe(a,()=>b,u),{setting:f,rebuild:h,read:m}=aZ(a,t,r,n,d,l,c,()=>w.fit()),w=lZ(a,h,c),x=()=>{d(a.current),n()},b=dX(o,x,()=>a.kind==="vehicle",s);o?.watch(x);let L=eDe(a,h,n,()=>!!b.accessors.vehicle,s);h();let _=W(tDe(a,l,n,L,r),rDe(a,w,h,t,L.end,r)),D=W(_,BQ(m,f),b.accessors,nDe(a),oDe(a,L));return cZ.set(D,w),dZ.set(D,gC(a,h,w.fit,n,u.lost)),D}var hZ=e=>e instanceof Error?e.message:String(e);var gE=new Map,yZ=new WeakMap,xZ=new WeakMap,sDe=[];function bZ(e,t){return gE.set(e,{hear:t,told:new WeakMap}),()=>void gE.delete(e)}var EZ=(e,t)=>void yZ.set(e,t);function TZ(e){let t=yZ.get(e);if(t===void 0)return gE.values();let r=gE.get(t);return r?[r]:sDe}function mZ(e,t,r,n){let o=e.get(t);return(!o||o.program!==r)&&(o={program:r,reasons:new Set},e.set(t,o)),o.reasons.has(n)?!1:(o.reasons.add(n),!0)}function gZ(e,t,r){let n=e.get(t);return!n||n.program===r?!1:(e.delete(t),!0)}function AZ(e){let t=Gy(e);return t?t.name||`(unnamed ${t.kind})`:"(a graph no material wears)"}function SZ(e,t,r,n){let o=AZ(e),i=r===null?"":` at node ${r}`,s=n===null?`Material "${o}" is drawn from its parameters: its graph was refused${i}: ${t}`:`Material "${o}" is drawn without its ${n} output, refused${i}: ${t}`;return{material:o,message:s,reason:t,node:r,output:n}}var wZ=e=>e instanceof E&&typeof e.details.node=="number"?e.details.node:null;function VUt(e,t,r=null){let n=Gy(e)??e,o=e.signature(),i=hZ(t),s=r===null?i:`${r}: ${i}`,a;mZ(xZ,n,o,s)&&(a=SZ(e,i,wZ(t),r),tr.warn(a.message));for(let l of TZ(e))mZ(l.told,n,o,s)&&(a??=SZ(e,i,wZ(t),r),l.hear(a))}function GUt(e){let t=Gy(e)??e,r=e.signature();gZ(xZ,t,r);let n;for(let o of TZ(e))if(gZ(o.told,t,r)){if(!n){let i=AZ(e),s=`Material "${i}": its graph compiles again`;n={material:i,message:s,reason:null,node:null,output:null}}o.hear(n)}}var OZ=(e,t)=>Number.isInteger(e)&&e>=t;function SE(e){if(e==null)return null;let{cell:t,level:r,over:n}=e,o=OZ(t,0)?r!==void 0&&!OZ(r,-1)?["level","a whole number from -1"]:n!==void 0&&typeof n!="boolean"?["over","a boolean"]:void 0:["cell","a whole number from 0"];if(o)throw new TypeError(`world.diagnostic.hlodCell.${o[0]}: ${o[1]}`);return{cell:t,...r!==void 0&&{level:r},...n!==void 0&&{over:n}}}var LZ=e=>Object.hasOwn(sf,e)?sf[e]:void 0;function SC(e){let t=LZ(e);if(t)return t.available?null:`'${e}' unavailable: ${t.reason}`;let r=Object.keys(sf).filter(n=>LZ(n)?.available);return`unknown mode ${JSON.stringify(e)}; one of ${r.join(", ")}`}function YUt(e){let{check:t,engine:r,setMode:n,setHlodCell:o}=e;return{setDiagnostic(i){let s=dt("diagnosticMode",i);t();let a=SC(s);if(a)throw new Error(a);r.setDiagnostic(s),n(s)},setMeshEdges(i){t(),r.setMeshEdges(i)},freezeCut(i){t(),r.freezeCut(i)},imageSequences(){return t(),r.imageSequences()},restartSequences(){t(),r.restartSequences()},showHlodCell(i){t(),o(SE(i))}}}function aDe(e){return{names:e.map(([t])=>t),stages:e.map(([,t])=>t),at:Object.fromEntries(e.map(([t],r)=>[t,r]))}}var Mm=aDe([["physicsMs","physics"],["gateMs","animations"],["tilesPumpMs","textures"],["worldMs","animations"],["blendWorldMs","transparents"],["adoptCutMs","cutAdoption"],["transparentPrepareMs","transparents"],["transparentDrawMs","transparents"],["transparentEncodeMs",null],["admissionMs","residency"],["residencyQueueMs","residency"],["syncClustersMs","uploads"],["residencyUploadMs","uploads"],["selectionDispatchMs","selection"],["encodeRestMs","encode"],["queueSubmitMs","submit"],["arrivalsMs","residency"],["pendingMs","hostPages"],["retainMs","hostPages"],["submitMs","submit"],["encodeSubmitMs",null],["totalMs",null]]),RZ=Mm.names,XUt=Mm.at,QUt=Mm.stages,ZUt=Int32Array.from(Mm.stages,e=>e===null?-1:Yr.indexOf(e)),JUt=Yr.filter(e=>Mm.stages.includes(e));var _Z=()=>({images:0,startMs:wp()}),rVt=e=>Math.round(wp()-e.startMs);var lDe=512,cDe=512,uDe=65536,dVt=4096,vZ="other passes",dDe=[...Yr,F3],fDe=Yr.length,fVt=Yr.indexOf("outside"),pVt=-1,pDe=Hn(["session","frame","image","atMs","round","verdict","profiled","intervalMs","refreshMs","cpuMs","instrumentMs","instrumentSteps","sampledFrames","droppedSamples","gpuMs","outsideMs","idleMs","idleSpans"]),hDe=pDe.idleSpans+1,hVt={none:0,row:1,bounds:2,profiled:3},mDe=Hn(["row","view","submittedMs","submissions","passFirst","passCount"]),gDe=mDe.passCount+1,SDe=Hn(["name","ownMs"]),MZ=()=>({frames:Iu(ix,hDe+RZ.length,lDe),samples:Iu(ix,gDe+dDe.length,cDe),passes:Iu(ix,SDe.ownMs+1,uDe),names:[vZ],ids:new Map([[vZ,0]]),stages:[fDe],seen:{names:[],ids:[]},sessions:0,clock:_Z(),timers:new Map,readers:yp(),drawStill:yp(),quantumNs:0,selfMs:0,selfSteps:0});function DZ(e){if(!e)return null;let{color:t,opacity:r=1}=e===!0?{}:e;if(typeof r!="number"||!(r>=0&&r<=1))throw new TypeError(`meshEdges.opacity must be a number from 0 to 1, got ${String(r)}`);return{color:t==null?null:new pe(t).toArray(),opacity:r}}function PZ(e,t,r=()=>{},n=()=>ADe,o=()=>{}){t&&bp(!0);let i=ODe(e,r,n),s=L3(),a=wDe(i,s),l=bDe(s);return{handle:W(LDe(i),vDe(i),xDe(s)),notices:s,why:i.why,time:i.time,close(){a(),l(),s.close();for(let c of i.awaiting??[])c(null);i.awaiting=null},apply:c=>TDe(i,c),failed:yDe(i,o),report:EDe(i),opening(){i.error=null}}}function wDe(e,t){let r=o=>{e.error=o,console.error("[trillion3d] An optional family did not load",o)},n=o=>t.say("family-load-failed",o.message,{kind:"warning",code:o.code,family:o.details.family});return i0.subscribe(r),s0.subscribe(n),()=>{i0.unsubscribe(r),s0.unsubscribe(n)}}var yDe=(e,t)=>r=>{e.error=Ih(r,"SESSION_OPEN_FAILED","The world's session failed to open"),t(e.error),console.error("World session failed",r)},xDe=e=>({get refused(){return e.refused.slice()}}),bDe=e=>bZ(e,t=>D3(e,t)),EDe=e=>t=>{e.error=Ih(t,"INTERNAL","An avatar's callback threw"),console.error("[trillion3d] An avatar's callback threw",t)};function TDe(e,t){e.sessions++,e.mode!=="beauty"&&!IZ(e,t,e.mode)&&(e.mode="beauty"),e.freeze&&t.freezeCut(!0),e.meshEdges&&t.setMeshEdges(e.meshEdges),e.hlodCell&&t.showHlodCell(e.hlodCell);for(let r of e.awaiting?.splice(0)??[])r(t.inspectFrame())}var ADe={models:[],chain:()=>{}},ODe=(e,t,r)=>({explorer:e,invalidate:t,world:r,hlodCell:null,why:n$(),time:MZ(),mode:"beauty",meshEdges:null,freeze:!1,awaiting:[],sessions:0,error:null,said:new Set});function CZ({said:e},t){e.has(t)||(e.add(t),console.warn(`[trillion3d] world.diagnostic.mode: ${t}`))}function IZ(e,t,r){try{return t.setDiagnostic(r),!0}catch(n){return CZ(e,`'${r}' refused by this session (${n.message})`),!1}}function LDe(e){return W(RDe(e),_De(e),PDe(e))}var RDe=e=>({get mode(){return e.mode},set mode(t){let r=dt("diagnosticMode",t),n=SC(r);if(n){CZ(e,n);return}let o=e.explorer();(!o||IZ(e,o,r))&&(e.mode=r)},get meshEdges(){return e.meshEdges},set meshEdges(t){e.meshEdges=DZ(t),e.explorer()?.setMeshEdges(e.meshEdges),e.invalidate()},get debug(){return oW()},set debug(t){bp(t)}}),_De=e=>({get freeze(){return e.freeze},set freeze(t){e.freeze=t,e.explorer()?.freezeCut(t),e.invalidate()},sequences(){return e.explorer()?.imageSequences()??null},restartSequences(){let t=e.explorer();if(!t)throw new Error("SEQUENCES_NO_SESSION: the world has no session open");t.restartSequences()},inspect(){let t=e.explorer(),{awaiting:r}=e,n=t?t.inspectFrame():r?new Promise(o=>r.push(o)):Promise.resolve(null);return e.invalidate(),n},why:MDe(e.why),time:DDe(e.time)}),vDe=e=>({get hlodCell(){return e.hlodCell},set hlodCell(t){e.hlodCell=SE(t),e.explorer()?.showHlodCell(e.hlodCell),e.invalidate()},async hlodCellInfo(t){let{models:r,chain:n}=e.world(),o=n();return o?.table?(await M.diagnostics.load()).hlodCellInfo(o,r,t):null},async hlodCellsOf(t,r){let n=e.world().chain();return n?.table?(await M.diagnostics.load()).hlodCellsOf(n,t,r):[]},get hlodChain(){return!!e.world().chain()?.table}}),kZ=e=>async t=>e(await M.diagnostics.load(),t),MDe=e=>({open:kZ(t=>t.openWhy(e))}),DDe=e=>({open:kZ((t,r)=>t.openTime(e,r))}),PDe=e=>({get sessions(){return e.sessions},get error(){return e.error},get modes(){let t=e.explorer();return t?Object.keys(t.diagnostics):["beauty"]}});var FZ=({geometryPoolBytes:e,texturePoolBytes:t}={})=>({...e!==void 0&&{geometryPool:e},...t!==void 0&&{texturePool:t},pageCache:FM(zh)}),wE=(e,t=e.canvas,r=e.activeGpu)=>e.gpu??g3(t,r),yE=(e,t={})=>{let{canvas:r=e.canvas,active:n=e.activeGpu}=t,o=t.gpu??wE(e,r,n);return S3(o,t.cpu??e.cpu??zh,r,n)};function NZ(e){let t;return e.activeGpu=void 0,{geometryPoolBytes:e.geometryPool,texturePoolBytes:e.texturePool,pageCache:e.pageCache,admitGpuMemory:Object.assign(r=>{let n=yE(e,{active:r});e.activeGpu={...r};let o=(s,a,l,c)=>Math.min(s??Math.max(a??l,c),l),i={geometryPoolBytes:o(e.geometryPool,t?.geometryPoolBytes,n.geometryPool,1),texturePoolBytes:o(e.texturePool,t?.texturePoolBytes,n.texturePool,r.textureMinimum)};return e.gpu!==void 0&&(t??=i),i},{limit:()=>e.gpu})}}function CDe(e,t,r){return W({physics:t,get gpu(){return wE(e)},set gpu(n){r(n),e.gpu=n},get canvas(){return e.canvas??Bw},set canvas({width:n,height:o}){let i=Object.freeze({width:n,height:o});r(wE(e,i),i),e.canvas=i},get cpu(){return e.cpu??zh},set cpu(n){let{pageCache:o}=yE(e,{cpu:n});e.cpu=n,e.pageCache.resize(o)}})}function IDe(e,t,r,n,o){let i=s=>t.last?.[s];return{get split(){return n()},get geometryPoolCeiling(){return 536870912},get texturePoolCeiling(){return 536870912},get geometryPool(){return i("geometryPoolBytes")??e.geometryPool??n().geometryPool},set geometryPool(s){e.geometryPool=Math.min(s,o("texturePool",536870912)),r()},get texturePool(){return i("texturePoolBytes")??e.texturePool??n().texturePool},set texturePool(s){e.texturePool=Math.min(s,o("geometryPool",536870912)),r()}}}function BZ(e,t,r,n){let{schedule:o}=Wo(()=>void t.explorer?.setMemoryBudgets({geometryPoolBytes:e.geometryPool,texturePoolBytes:e.texturePool})),i=()=>yE(e),s=(l,c)=>{let u=i();return k(wE(e)-u.fixed-(e[l]??u[l]),1,c)};return W(CDe(e,n,(l,c=e.canvas)=>{let u=yE(e,{gpu:l,canvas:c});e.geometryPool=u.geometryPool,e.texturePool=u.texturePool,o()}),IDe(e,r,o,i,s))}function HZ(e,t,r,n){return e===!0?r:e===!1?t[0]:t.includes(e)?e:oe(n)(`must be one of ${t.join(", ")}, true or false, got ${String(e)}`)}function wC(e){if(e!=null)return HZ(e,Zb,"max","temporalAntialiasing")}function Wl(e){return wC(e)??"max"}function FDe(e,t="responsive"){return HZ(e,TX,AX,t)}var NDe=_F("responsive");function BDe(e){if(e==null)return;let t=oe("materials");return Pe(e)||t("must be an object of settings by material name"),Object.fromEntries(Object.entries(e).map(([r,n])=>{let o=`materials.${r}`,i=Xe(n,RX,o,t),s={};return i.responsive!=null&&(s.responsive=FDe(i.responsive,`${o}.responsive`)),i.sky!=null&&(typeof i.sky!="boolean"&&t(`${o}.${"sky"} must be true or false`),s.sky=i.sky),i.graph!=null&&(s.graph=i.graph),[r,s]}))}var UZ={fields(e){let t=wC(e.temporalAntialiasing);return t?{[yX]:t}:{}},flags(e){let t=wC(e.temporalAntialiasing);return t?[`${xX}${t}`]:[]}},VZ=yT(bX,EX,NDe),GZ=yT(OX,LX,BDe),UVt={fields:e=>({...UZ.fields(e),...VZ.fields(e),...GZ.fields(e)}),flags:e=>[...UZ.flags(e),...VZ.flags(e),...GZ.flags(e)]};var WZ=new WeakMap;function zZ(e,t,r,n,o){let i=dN(r,n,o);if(i===void 0)return!0;let s=WZ.get(e);return s||WZ.set(e,s=new Set),s.has(t)||(s.add(t),console.warn(i===!0?`[trillion3d] ${t}: decided when the world opens; the write is refused, the value stays ${String(o)}`:`[trillion3d] ${t}: applied, but ${i} keep the verdict the world opened with`)),i!==!0}var UDe={antialiasing:"temporalAntialiasing"},jZ=(()=>{let e=UDe,t={};for(let[r,{family:n}]of Object.entries(Ns))(t[n]??=[]).push(e[r]??r);return t})();function VDe(e,t,r,n){let o=t===r?`"${r}"`:`"${t}" (now "${r}")`;return n.includes(r)?`[trillion3d] ${o} is not a setting of ${e}: it is written through world.${r}; the object's other settings are taken`:`[trillion3d] unknown setting ${o} in ${e}; the object's other settings are taken`}function GDe(e,t,r,n,o){for(let i in e){let s=OA(i);!Object.hasOwn(t,s)&&!r.has(i)&&(r.add(i),console.warn(VDe(n,i,s,o)))}}function HDe(e,t,r,n){return o=>{let i=t();i&&r(i,e,o),n()}}function WDe(e,t,r,n,o=[]){let i=Object.keys(t),s=new Set,a=e,l=(d,f)=>a.set(d,hr(t[d],f),"page"),c=()=>!1,u=(d,f)=>{let h=t[d];c()&&vg(h)===!0&&!zZ(e,`${n}.${d}`,h,f,a.get(d))||(f==null?a.clear(d,"page"):l(d,f))};return{page(d){for(let f of i)d[f]!=null&&l(f,d[f])},get:d=>a.get(d),values:()=>Object.fromEntries(i.map(d=>[d,a.get(d)])),watch(d,f,h=()=>!1){c=h;for(let m of i)a.watch(m,HDe(m,d,r,f))},apply(d,f){for(let h of i)a.get(h)!==f[h]&&r(d,h,a.get(h))},setOne:u,set(d){let f=Gt(d);for(let h of i)h in f&&u(h,f[h]);GDe(d,t,s,n,o)}}}var zDe={raster:(e,t,r)=>{switch(t){case"softwareRaster":return e.setSoftwareRaster(r);case"hardwareRasterEdgePixels":return e.setHardwareRasterEdgePixels(r);case"depthBinning":return e.setDepthBinning(r);case"depthBinsMinZ":return e.setDepthBinsMinZ(r);default:return e.setDepthBinsMaxZ(r)}}},jDe=e=>zDe[e]??((t,r,n)=>t[oz(e)](r,n)),$Z=(e,t=yr)=>Object.fromEntries(Object.entries(t).map(([r,n])=>[r,WDe(e,n.rules,jDe(r),`world.${gl(r,t)}`,jZ[r])]));function YZ(e){return{get softwareRaster(){return e.raster.get("softwareRaster")},set softwareRaster(t){e.raster.setOne("softwareRaster",t)},get hardwareRasterEdgePixels(){return e.raster.get("hardwareRasterEdgePixels")},set hardwareRasterEdgePixels(t){e.raster.setOne("hardwareRasterEdgePixels",t)},get depthBinning(){return e.raster.get("depthBinning")},set depthBinning(t){e.raster.setOne("depthBinning",t)},get depthBinsMinZ(){return e.raster.get("depthBinsMinZ")},set depthBinsMinZ(t){e.raster.setOne("depthBinsMinZ",t)},get depthBinsMaxZ(){return e.raster.get("depthBinsMaxZ")},set depthBinsMaxZ(t){e.raster.setOne("depthBinsMaxZ",t)},get raster(){return e.raster.values()},get streaming(){return e.streaming.values()}}}function KZ(e,t=yr){let r=e,n={};for(let[o,i]of Object.entries(t))i.world&&Object.defineProperty(n,gl(o,t),{enumerable:!0,configurable:!0,get:()=>r[o].values(),set:s=>r[o].set(s)});return n}var yC=()=>({drawn:!1});var xC=()=>({drawn:!0});var bC=()=>({drawn:!0});var EC=()=>Jq();var $De=["marksCapacity","marksSegmentLength","marksTurnAngle"];function TC(e,t,r,n){e.clock=n,t9(t,e);let o=()=>n9(e,r.get("marksCapacity"),r.get("marksSegmentLength"),r.get("marksTurnAngle"));o();for(let i of $De)r.watch(i,o)}var AC=()=>({drawn:!0});var OC=()=>({drawn:!0});function LC(e,t){let r=!1,n=()=>void(r=!t()),o=i=>{e.drawn!==i&&(e.drawn=i,n())};return{start:()=>o(!0),stop:()=>o(!1),opened(){r&&n()}}}var RC=()=>({drawn:!1});var _C=()=>({drawn:!0});var vC=()=>({drawn:!0});var MC=()=>({drawn:!0});var mt=e=>e?.drawn!==!1,CGt=e=>({effectsGate:e.effectsGate,pathTracingGate:e.pathTracingGate,volumesGate:e.volumesGate,decalsGate:e.decalsGate,marksGate:e.marksGate,subsurfaceGate:e.subsurfaceGate,deformationGate:e.deformationGate,sampledLightsGate:e.sampledLightsGate,waterGate:e.waterGate,ambientOcclusionGate:e.ambientOcclusionGate,hairGate:e.hairGate,fogGate:e.fogGate,translucentLightVolumeGate:e.translucentLightVolumeGate,cubeCapturesGate:e.cubeCapturesGate,planarReflectionsGate:e.planarReflectionsGate,lightProfilesGate:e.lightProfilesGate,lightPatternsGate:e.lightPatternsGate,rectLightPicturesGate:e.rectLightPicturesGate,autoExposureGate:e.autoExposureGate,displacementGate:e.displacementGate,virtualTexturesGate:e.virtualTexturesGate,bakedLightGate:e.bakedLightGate,instrumentsGate:e.instrumentsGate,sortedTranslucencyGate:e.sortedTranslucencyGate,reflectionsGate:e.reflectionsGate,bounceGate:e.bounceGate,shadowsGate:e.shadowsGate,skyGate:e.skyGate});var DC=()=>({drawn:!0}),YDe=e=>mt(e.fogGate);var PC=()=>({drawn:!0}),KDe=e=>mt(e.translucentLightVolumeGate),qDe=e=>KDe(e)&&an(wy,e,"translucentLightVolume");var CC=()=>({drawn:!0}),$Gt=e=>mt(e.cubeCapturesGate);var IC=()=>({drawn:!0}),QGt=e=>mt(e.planarReflectionsGate);var kC=()=>({drawn:!0}),qZ=e=>mt(e.sortedTranslucencyGate),XDe=e=>qZ(e.context)&&Sy(e,"sortedTranslucentPixels")&&Sy(e,"sortedTranslucentPixelsEnabled")&&(Sy(e,"oitPassType")&K6)!==0;var FC=()=>({drawn:!0}),QDe=e=>mt(e.reflectionsGate);var NC=()=>({drawn:!0}),ZDe=e=>mt(e.bounceGate);var BC=()=>({drawn:!0}),JDe=e=>mt(e.shadowsGate);var UC=()=>({drawn:!1}),w3t=e=>e.skyGate?.drawn!==!1,VC=e=>!!e.skyLight||!!e.clouds||!!e.backdrop;function ePe({light:e,shafts:t,cloudShadow:r,direction:n}){return new $e("directional",{color:e.color,intensity:e.intensity,castShadow:e.castShadow,angularRadius:e.angle*ce/2,shadowDistance:e.shadowDistance,fieldShadowCascade:e.fieldShadowCascade,fieldShadowDistance:e.fieldShadowDistance,fogScattering:e.fogScattering,shadowsFog:e.shadowsFog,useTemperature:e.useTemperature,temperatureKelvin:e.temperatureKelvin,shadowsAir:e.shadowsAir,transmittancePerPixel:e.transmittancePerPixel,sunDiskTint:e.sunDiskTint,atmosphereSunIndex:e.atmosphereSunIndex,forwardShadingPriority:e.forwardShadingPriority,...t,shaftOverrideDirection:t.shaftOverrideDirection,shaftBloomTint:t.shaftBloomTint,...r,cloudScatteredLuminanceScale:r.cloudScatteredLuminanceScale,position:[-n[0],-n[1],-n[2]],target:[0,0,0]})}function GC({sun:e}){return e?[ePe(e)]:[]}var HC=()=>({drawn:!0});var WC=()=>({drawn:!0});var zC=()=>({drawn:!0});var jC=()=>({drawn:!0}),F3t=e=>mt(e?.displacementGate);var $C=()=>({drawn:!0});var YC=()=>({drawn:!0});var KC=()=>({drawn:!0}),Y3t=e=>mt(e.bakedLightGate);var qC=()=>({drawn:!0}),tPe=e=>mt(e.context.instrumentsGate);var Dm={pathTracing:{gate:yC,family:"pathTracing"},volumes:{gate:xC,family:"volumes"},decals:{gate:bC,family:"decals"},marks:{gate:EC,family:"marks"},subsurface:{gate:AC,family:"subsurface"},sampledLights:{gate:RC,family:"sampledLights"},water:{gate:_C,family:"water"},ambientOcclusion:{gate:vC,family:"ambientOcclusion"},hair:{gate:MC,family:"hair"},fog:{gate:DC,family:"fog"},translucentLightVolume:{gate:PC,family:"translucentLightVolume"},cubeCaptures:{gate:CC,family:"cubeCaptures"},planarReflections:{gate:IC,family:"planarReflections"},sortedTranslucency:{gate:kC,family:"sortedTranslucency"},reflections:{gate:FC,family:"reflections"},bounce:{gate:NC,family:"bounce"},shadows:{gate:BC,family:"shadows"},sky:{gate:UC,family:"sky"},autoExposure:{gate:zC,family:"autoExposure"},displacement:{gate:jC,family:"displacement"},instruments:{gate:qC,family:"debugViews"},lightProfiles:{gate:HC,follow:!0},lightPatterns:{gate:WC,follow:!0},rectLightPictures:{gate:$C,follow:!0},virtualTextures:{gate:YC,follow:!0},bakedLight:{gate:KC,follow:!0}},xE=Object.keys(Dm),rPe=e=>"follow"in Dm[e],XZ=xE.filter(rPe),QZ=()=>{let e={deformationGate:OC()};for(let t of xE)e[`${t}Gate`]=Dm[t].gate();return e};function nPe(e){if(typeof e!="number"||!(e>0&&e<=1))throw new RangeError(`BLENDABLE_WEIGHT:${String(e)}`);return e}var Pm=class{list=[];touched;chains=new Map;heard=()=>{this.changed()};constructor(t=()=>{}){this.touched=t}get entries(){return this.list}get size(){return this.list.length}add(t,r=1){if(!Dz(t))throw new TypeError("a blendable is a material made by material.postProcess");return this.list.push({material:t,weight:nPe(r)}),t._listeners.subscribe(this.heard),this.changed()}remove(t){let r=this.list.findIndex(n=>n.material===t);return r<0?!1:(this.list.splice(r,1),this.list.some(n=>n.material===t)||t._listeners.unsubscribe(this.heard),this.changed(),!0)}clear(){if(this.list.length){for(let{material:t}of this.list)t._listeners.unsubscribe(this.heard);this.list.length=0,this.changed()}}chainAt(t){return this.chains.size||this.rebuild(),this.chains.get(t)}changed(){return this.chains.clear(),this.touched(),this}rebuild(){let t=new Map,r=new Map;for(let{material:n,weight:o}of this.list){let i=Pz(n),s=i.isBlendable?r.get(n):void 0;if(s!==void 0){let c=t.get(i.location).find(u=>u.entry.material===n);c.entry={material:n,weight:c.entry.weight+(1-c.entry.weight)*o},r.set(n,s+1);continue}i.isBlendable&&r.set(n,1);let a=t.get(i.location)??[];a.push({entry:{material:n,weight:o},priority:i.priority}),t.set(i.location,a)}this.chains.clear();for(let n of J1)this.chains.set(n,(t.get(n)??[]).sort((o,i)=>o.priority-i.priority).map(o=>o.entry))}};var Kn=class{_chain=null;get idle(){return!1}changed(){this._chain?._touch()}checked(t){return S0(this.fieldType,t)}written(t){let r=this.fieldType,n=t;for(let o in n){let i=n[o],s=dn(r,o);s!==void 0?n[o]=Fi(r,o,s,i):i==null&&Op(r,o,"is never unset: write a value")}return t}};function qs(e,t,r){for(let n of t)xt(e,n,function(o){r.call(this,{[n]:o})})}var Cm=class{list=[];byStage=new Map;count=0;notify;blendables=new Pm(()=>this._touch());constructor(t=()=>{},r=[]){this.notify=t,Ht(this.list,r);for(let n of r)n._chain=this}get revision(){return this.count}get passes(){return this.list}get size(){return this.list.length}add(t,r=this.list.length){if(!(t instanceof Kn))throw new TypeError("EFFECT_UNKNOWN");if(t._chain)throw new Error("EFFECT_IN_A_CHAIN");if(!Number.isInteger(r)||r<0||r>this.list.length)throw new RangeError(`EFFECT_INDEX:${r}`);return this.list.splice(r,0,t),t._chain=this,this.reordered(),this}remove(t){let r=this.list.indexOf(t);return r<0?!1:(this.list.splice(r,1),t._chain=null,this.reordered(),!0)}clear(){if(this.list.length){for(let t of this.list)t._chain=null;this.list.length=0,this.reordered()}}stage(t){let r=this.byStage.get(t);return r||this.byStage.set(t,r=this.list.filter(n=>n.stage===t)),r}reordered(){this.byStage.clear(),this._touch()}_touch(){this.count++,this.notify()}};var zl=class e extends Kn{kind="bloom";fieldType="Bloom";stage="before-tone-mapping";held;constructor(t={}){super(),this.held=t3(this.checked(t))}put(t){let r={...this.held,...t};nR(r),this.held=Object.freeze(r),this.changed()}static{qs(e.prototype,Object.keys(un.Bloom),function(t){this.put(t)})}get method(){return this.held.method}set method(t){this.put(this.written({method:t}))}get intensity(){return this.held.intensity}set intensity(t){this.put(this.written({intensity:t}))}get gaussianIntensity(){return this.held.gaussianIntensity}set gaussianIntensity(t){this.put(this.written({gaussianIntensity:t}))}get threshold(){return this.held.threshold}set threshold(t){this.put(this.written({threshold:t}))}get sizeScale(){return this.held.sizeScale}set sizeScale(t){this.put(this.written({sizeScale:t}))}get levels(){return this.held.levels}set levels(t){this.put({levels:rR(this.held.levels.map((r,n)=>({...r,...t[n]})))})}get convolution(){return this.held.convolution}set convolution(t){this.put({convolution:Cw({...this.held.convolution,...t})})}get dirtMask(){return this.held.dirtMask}set dirtMask(t){this.put({dirtMask:Iw({...this.held.dirtMask,...t})})}get idle(){let{intensity:t,method:r,gaussianIntensity:n,convolution:o}=this.held;return t<=0||(r==="convolution"?o.intensity:n)<=0}};var jl=class e extends Kn{kind="motionBlur";fieldType="MotionBlur";stage="after-resolve";held;constructor(t={}){super(),this.held=XG(this.checked(t))}put(t){this.held=Object.freeze({...this.held,...t}),this.changed()}static{qs(e.prototype,Object.keys(un.MotionBlur),function(t){this.put(t)})}get amount(){return this.held.amount}set amount(t){this.put(this.written({amount:t}))}get max(){return this.held.max}set max(t){this.put(this.written({max:t}))}get motionBlurTargetFrameRate(){return this.held.motionBlurTargetFrameRate}set motionBlurTargetFrameRate(t){this.put(this.written({motionBlurTargetFrameRate:t}))}get cameraMotion(){return this.held.cameraMotion}set cameraMotion(t){this.put(this.written({cameraMotion:t}))}get idle(){let{amount:t,max:r}=this.held;return!(t>ep)||!(r>ep)}};var ZZ=e=>new Cm(e,[new jl,new zl]);function JZ(e,t,r){let n=e.quality?.resolution;return{get bounce(){return t.get("bounce")},get temporalAntialiasing(){return t.get("antialiasing")},get pixelError(){return t.get("pixelError")},renderScale:e.renderScale??(n?$P(n):void 0),maxFrameRate:e.maxFrameRate??1/0,drawing:!0,effects:ZZ(r),effectsGate:XL(o=>t.get(o)),...QZ(),guides:OM(r),ambientCubemap:e.ambientCubemap??void 0,particles:[]}}function eJ(e,t){return{get bounce(){return e.bounce},set bounce(r){t.set("bounce",r,"page")},get temporalAntialiasing(){return e.temporalAntialiasing},set temporalAntialiasing(r){r==null?t.clear("antialiasing","page"):t.set("antialiasing",Wl(r),"page")},sceneTemporalAntialiasing(r){t.holds("antialiasing","scene")||t.set("antialiasing",r,"scene")},get pixelError(){return e.pixelError},set pixelError(r){t.set("pixelError",r,"page")}}}function tJ(e,t,r,n){n!==e.renderScale&&(e.renderScale=n,t().explorer?.setRenderScale(n),r())}function rJ(e,t,r,n){return{asked:()=>e.renderScale,ask:o=>tJ(e,t,r,o),drawn:()=>n.last}}function nJ(e,t,r,n){return{get ambientCubemap(){return{...t.ambientCubemap.values(),ambientCubemap:e.ambientCubemap??null}},set ambientCubemap({ambientCubemap:o,...i}){o&&o===e.ambientCubemap&&VO(o),u6({ambientCubemap:o}),t.ambientCubemap.set(i),!(o===void 0||o===null&&!e.ambientCubemap)&&(e.ambientCubemap=o??void 0,r().explorer?.setAmbientCubemapCube(e.ambientCubemap),n())}}}function oJ(e,t,r,n){return{get renderScale(){return t().explorer?.renderScale()??1},set renderScale(o){tJ(e,t,r,o)},get reference(){return t().explorer?.reference??null},get maxFrameRate(){return e.maxFrameRate},set maxFrameRate(o){o!==e.maxFrameRate&&(e.maxFrameRate=o,t().explorer?.setMaxFrameRate(o))},get drawing(){return e.drawing},set drawing(o){o!==e.drawing&&(e.drawing=o,t().explorer?.setDrawing(o),n())}}}function oPe(e,t,r){e.watch("bounce",n=>{t().explorer?.setBounce(n),r()}),e.watch("antialiasing",n=>{t().explorer?.setTemporalAntialiasing(n),r()}),e.watch("pixelError",n=>{t().explorer?.setPixelError(n),r()})}function iPe(e,t,r,n){e.bounce!==n.bounce&&r.setBounce(e.bounce),e.temporalAntialiasing!==n.temporalAntialiasing&&r.setTemporalAntialiasing(e.temporalAntialiasing),e.pixelError!==n.pixelError&&r.setPixelError(e.pixelError);for(let o of Object.values(t))o.apply(r,n);e.ambientCubemap!==n.ambientCubemap&&r.setAmbientCubemapCube(e.ambientCubemap),e.renderScale!==n.renderScale&&r.setRenderScale(e.renderScale),e.maxFrameRate!==n.maxFrameRate&&r.setMaxFrameRate(e.maxFrameRate),e.drawing!==n.drawing&&r.setDrawing(e.drawing)}var sPe=(e,...t)=>W(e,...t);function iJ(e,t,r,n,o=to){let i=()=>t().invalidate(),s=DX();e.temporalAntialiasing!=null&&s.set("antialiasing",Wl(e.temporalAntialiasing),"page");let a=$Z(s);for(let w of Object.values(a))w.page(e);let l=JZ(e,s,i),c=rJ(l,t,i,r),u=new AbortController,d=n?.(u.signal),{quality:f,decided:h}=VX(s,c,e.quality,by,d);oPe(s,t,i);for(let w of Object.values(a))w.watch(()=>t().explorer,i,()=>!!t().settingsRead);let m={held:l,settings:s,families:a,quality:f,decided:h,apply(w,x){iPe(l,a,w,x)},ruled:()=>Object.assign({},...Object.values(a).map(w=>w.values())),guides:l.guides,dispose:()=>u.abort(Jr)};return sPe(m,eJ(l,s),YZ(a),KZ(a),nJ(l,a,t,i),oJ(l,t,i,o))}var aJ="trillion3d.hardwareBenchmark";function aPe(){let e=new Map,t={getItem(r){try{let n=globalThis.localStorage?.getItem(r);if(n!=null)return n}catch{}return e.get(r)??null},setItem(r,n){e.set(r,n);try{globalThis.localStorage?.setItem(r,n)}catch{}}};return()=>t}var lJ=aPe(),cJ=()=>M.benchmark.load().then(e=>e.runHardwareBenchmark),bE=new Map,EE=new Map;async function lPe({drawing:e,store:t,load:r,found:n},o,i,s){let a=await s;if(i.throwIfAborted(),n&&a)return a;await e?.queue.onSubmittedWorkDone(),i.throwIfAborted();let l=await Jt(r(),i);i.throwIfAborted();let{result:c,adapter:u}=await l(o,i,void 0,e);if(i.throwIfAborted(),u===void 0)return c;try{t()?.setItem(aJ,JSON.stringify(Sz(c,u)))}catch{}return c}function cPe(e,t,r){let{drawing:n}=t,o=bE.get(n);if(o)return o;let i=new AbortController,s=lPe(t,r,i.signal,EE.get(e)),a={promise:s,askers:0,stop:i},l=()=>void(bE.get(n)===a&&bE.delete(n));i.signal.addEventListener("abort",l,{once:!0});let c=s.then(u=>(l(),u),()=>void l());return c.then(()=>void(EE.get(e)===c&&EE.delete(e))),EE.set(e,c),bE.set(n,a),a}var sJ="world.quality.benchmark()";function XC(e,t){let r=new AbortController;return{signal(){let{enabled:n,by:o}=e();if(!n)throw Jo(sJ,"benchmark",o);return r.signal},stop(){t()||(r.abort(Jo(sJ,"benchmark",e().by)),r=new AbortController)}}}function uPe(e,t,r,n,o=lJ,i=cJ){return{async saved(){let s=await e();if(!s||t.aborted)return null;let{adapter:a}=j1(s);if(a===void 0)return null;try{return gz(JSON.parse(o()?.getItem(aJ)??"null"),a)}catch{return null}},run(s,a){t.throwIfAborted();let l=AbortSignal.any([t,r.signal()]);return(async()=>{let c=await Jt(e(),l);a&&(await Jt(n(),l),await ud(l));let u=c&&j1(c).adapter||"",f=cPe(u,{drawing:c,store:o,load:i,found:!!a&&u!==""},s);return Kc(f,l,()=>f.stop.abort(Jr))})()}}}var QC=(e,t,r,n=lJ,o=cJ)=>i=>uPe(()=>e.pending.then(()=>e.gpuDevice,()=>{}),i,t,r,n,o);function uJ(e,t,r){let n=[0,0,0],o=[0,0,-1],i={eye:n,forward:o,focal:0,near:0,perspective:1};S_(e,()=>{let s=ti(r()),a=s.matrixWorld.elements;if(!(te(a[8],a[9],a[10])>0))return null;n[0]=a[12],n[1]=a[13],n[2]=a[14],Ox(o,a);let c=xn(t);return i.focal=e2(s.projectionMatrix.elements,c.width,c.height),i.near=s.near,i.perspective=s.projection==="perspective"?1:0,i})}var dPe=(e,t)=>e>0&&Number.isFinite(e)?Math.max(1,Math.ceil(Pi/e/t-mo)):1,fPe=(e,t,r)=>e>1&&r<(e-.5)*t,dJ=(e,t,r)=>t!==null&&fPe(dPe(e,t),t,r);var ZC=e=>e.constrainAspectRatio?e.aspect:Number.NaN,fJ=(e,t)=>e===t||!!e&&!!t&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,TE={x:0,y:0,width:0,height:0};function pPe(e,t,r){let n=zw(e,e.canvas.ownerDocument?.defaultView),o=Math.max(1,Ii(t.canvas.clientWidth,n)),i=Math.max(1,Ii(t.canvas.clientHeight,n)),s=!Number.isNaN(r);(s||t.asksSize)&&(t.asksSize=!0,mb(t.canvas,o,i));let a=Sb({x:0,y:0,width:o,height:i},r,{...TE});t.size[0]=a.width,t.size[1]=a.height,s?t.handle?.resize(a.width,a.height,a):t.handle?.resize(...t.size)}function hPe(e,t,r){let n=xn(e),o=t.viewport;if(t.measuredOver[0]=n.width,t.measuredOver[1]=n.height,Number.isNaN(r)){let a=td(e,o,{...TE});return om(e,o,t.size),t.handle?.resize(t.size[0],t.size[1],a),a}let i=VD(e,o,{...TE}),s=Sb(i,r,{...TE});return t.size[0]=s.width,t.size[1]=s.height,t.handle?.resize(s.width,s.height,s,i),s}function pJ(e,t){let r=t.shapedAt=ZC(t.camera);return t.viewport?hPe(e.canvas,t,r):pPe(e,t,r)}var Im=({world:e},t)=>pJ(e,t);function JC(e){let{world:t}=e,r=Xi(t.canvas,e.main,t.camera(),e.drawnMain);fJ(r,e.placed)||(e.placed=r&&{x:r.x,y:r.y,width:r.width,height:r.height},e.explorer?.placeMain(e.placed))}async function mPe(e,t,r){let n=Im(e,t),{renderScale:o,temporalAntialiasing:i}=t.options,s=await r.engine.addView({...n?{rect:n}:{canvas:t.canvas},renderScale:o,temporalAntialiasing:i});if(e.explorer!==r||t.disposed)return void s.release();t.handle=s,t.host=r.camera.clone(),Im(e,t),e.world.invalidate()}var hJ=(e,t,r)=>mPe(e,t,r).catch(n=>{e.explorer===r&&!t.disposed&&console.error("[trillion3d] A view could not be made",n)}),gPe=(e,t,r)=>!dJ(e.options.maxFrameRate,r,t-e.drawnAt);function SPe({world:e,adopt:t},r){let n=r.canvas?rE(r.canvas):void 0;return{options:{renderScale:r.renderScale??"auto",temporalAntialiasing:Wl(r.temporalAntialiasing),maxFrameRate:r.maxFrameRate??1/0},canvas:n?.canvas??e.canvas,release:n?.release??(()=>{}),viewport:r.viewport&&{...r.viewport},camera:t(r.camera??new jt("perspective")),handle:void 0,host:void 0,size:[1,1],measuredOver:[0,0],shapedAt:Number.NaN,asksSize:!1,drawnAt:-1/0,hooks:new Set,info:void 0,observer:void 0,disposed:!1,view:void 0}}function wPe(e,t){if(!t.canvas==!t.viewport)throw new E("INVALID_VIEW","A view draws into a canvas or over a viewport, one of them");let{world:r,records:n}=e,o=SPe(e,t);return t.canvas&&typeof ResizeObserver<"u"&&(o.observer=new ResizeObserver(()=>(Im(e,o),r.invalidate())),o.observer.observe(o.canvas)),n.push(o),e.explorer&&hJ(e,o,e.explorer),o.view=bPe(e,o)}function yPe(e,t){let{world:r,adopt:n}=e;return{canvas:t.canvas,get guides(){return r.guides()},get camera(){return t.camera},set camera(o){t.camera=n(o),r.invalidate()},get viewport(){return t.viewport&&{...t.viewport}},set viewport(o){!t.viewport||!o||(t.viewport={...o},Im(e,t),r.invalidate())}}}function xPe({world:e,records:t},r){return{get renderScale(){return r.info?.metrics.renderScale??1},set renderScale(n){r.options.renderScale=n,r.handle?.setRenderScale(n),e.invalidate()},get temporalAntialiasing(){return r.options.temporalAntialiasing},set temporalAntialiasing(n){let o=Wl(n);r.options.temporalAntialiasing=o,r.handle?.setTemporalAntialiasing(o),e.invalidate()},get maxFrameRate(){return r.options.maxFrameRate},set maxFrameRate(n){r.options.maxFrameRate=n},onFrame(n){return r.hooks.add(n),()=>void r.hooks.delete(n)},dispose(){r.disposed||(r.disposed=!0,t.splice(t.indexOf(r),1),r.observer?.disconnect(),r.handle?.release(),r.handle=void 0,r.release(),e.invalidate())}}}var bPe=(e,t)=>W(yPe(e,t),xPe(e,t)),EPe=(e,t)=>e.width!==t[0]||e.height!==t[1];function TPe(e,t){let{records:r,drawn:n,drawnRecords:o}=e,i=0,s=wp(),a;for(let l=0;l<r.length;l++){let c=r[l];if(!c.handle||!c.host||!gPe(c,s,t))continue;(c.viewport&&EPe(a??=xn(e.world.canvas),c.measuredOver)||!Object.is(ZC(c.camera),c.shapedAt))&&Im(e,c),dC(c.camera,c.host,c.size[0]/c.size[1]);let u=c.handle.render(c.host,l),d=c.info??={delta:0,metrics:u};d.delta=c.drawnAt===-1/0?0:(s-c.drawnAt)/Pi,d.metrics=u,c.drawnAt=s,n[i]=u,o[i++]=c}n.length!==i&&(n.length=o.length=i)}var APe=e=>({world:e,records:[],adopt:tE(e.invalidate),explorer:null,drawn:[],drawnRecords:[],main:void 0,placed:void 0,drawnMain:{x:0,y:0,width:0,height:0}});function mJ(e){let t=APe(e),{records:r,drawn:n,drawnRecords:o}=t;return W({addView:i=>wPe(t,i),get list(){return r.map(i=>i.view)},mainRect:()=>t.main,sights:()=>r,get viewport(){return t.main&&{...t.main}},set viewport(i){t.main=i&&{x:i.x,y:i.y,width:i.width,height:i.height},JC(t),e.invalidate()},follow:()=>JC(t),attach(i){t.explorer=i,t.placed=void 0,JC(t);for(let s of r)s.handle=void 0,i&&hJ(t,s,i)},draw:i=>TPe(t,i),drawnIn(i){i.views=n},dispatch(){for(let i of o)if(!i.disposed)for(let s of i.hooks)s(i.info)},dispose(){for(let i of[...r])i.view.dispose()}})}var gJ=e=>{if(!Array.isArray(e))throw new TypeError("OUTLINE_OBJECTS");return Object.freeze([...e])},$l=class e extends Kn{kind="outline";fieldType="Outline";stage="after-tone-mapping";color;chosen;width;constructor(t={}){super();let r=this.checked(t);this.chosen=gJ(r.objects??[]),this.width=r.thickness??m0.thickness.default,this.color=new pe(r.color??vW),Se(this.color,()=>this.changed())}get objects(){return this.chosen}set objects(t){this.chosen=gJ(t),this.changed()}get thickness(){return this.width}set thickness(t){this.put(this.written({thickness:t}))}put({thickness:t}){this.width=t,this.changed()}static{qs(e.prototype,["thickness"],function(t){this.put(t)})}get idle(){return!this.chosen.length}};function eI(e){let t=!1,r=null,n=async()=>{try{for(;t;)t=!1,await e()}finally{r=null}};return{request(){t=!0,r??=n()},get running(){return r}}}function SJ(e,t){let r=e.get(t);return r&&r.row>=0?r.batch.cut:void 0}function tI(e,t,r){let n=e.attributes.position,o=n?.count??0,i=new Map,s=new Int32Array(o).fill(-1),a=c=>{let u=s[c];if(u<0){let[d,f,h]=Mr(n,c),m=`${d},${f},${h}`,w=i.get(m);u=w??i.size,w===void 0&&i.set(m,u),s[c]=u}return u},l=new Map;for(let c=0;c+2<t.length;c+=3){let u;r&&(u=ks([0,0,0],0,[t[c],t[c+1],t[c+2]].flatMap(d=>Mr(n,d)),0,3,6),Ne(u));for(let d=0;d<3;d++){let f=t[c+d],h=t[c+(d+1)%3],[m,w]=[a(f),a(h)],x=Math.min(m,w)*o+Math.max(m,w),b=l.get(x)??{a:f,b:h,normals:[]};u&&b.normals.push(u),l.set(x,b)}}return l}function wJ(e,t){let r=Gw(e,"triangles",op,"A geometry read as its edges"),n=e.attributes.position,o=[...tI(e,r,!!t).values()].filter(({normals:a})=>!t||t(a)),i=new Float32Array(o.length*6);o.forEach(({a,b:l},c)=>{i.set(Mr(n,a),c*6),i.set(Mr(n,l),c*6+3)});let s=new Pr;return s.setAttribute("position",new Oe(i,3)),s}function yJ(e,t=1){let r=Math.cos(t*ce);return wJ(e,n=>n.length<2||Ge(n[0],n[1])<=r)}function xJ(e){return wJ(e)}function bJ(e,t=[.5,.5]){if(!e)return null;let r=e.positions.slice(),n=0;for(let o=0;o+2<r.length;o+=3)r[o]+=.5-t[0],r[o+1]+=.5-t[1],n=Math.max(n,Je(r[o],r[o+1]));return{...e,positions:r,spriteRadius:n}}var EJ=24;function TJ(e,t){let r=new Ft,n=[[1,0,0],[0,1,0],[0,0,1],[-1,0,0],[0,-1,0],[0,0,-1]];for(let o=0;o+2<e.length;o+=3)for(let[i,s,a]of[[0,1,2],[1,3,2],[3,4,2],[4,0,2],[1,0,5],[3,1,5],[4,3,5],[0,4,5]])OPe(r,[n[i],n[s],n[a]].map(l=>[e[o]+l[0]*t,e[o+1]+l[1]*t,e[o+2]+l[2]*t]));return r}function OPe(e,[t,r,n]){let o=ks([0,0,0],0,[...t,...r,...n],0,3,6);Ne(o);let i=e.vertex(t,o,[0,0]);e.vertex(r,o,[1,0]),e.vertex(n,o,[0,1]),e.triangle(i,i+1,i+2)}function rI(e,t=!1){let r=(i,s)=>{if(!i)return null;let a=new Float32Array(e.indices.length*s);return e.indices.forEach((l,c)=>a.set(i.subarray(l*s,l*s+s),c*s)),a},n=r(e.positions,3),o=new Uint32Array(e.indices.length).map((i,s)=>s);return{...t&&{sourceVertices:e.indices.map(i=>e.sourceVertices?.[i]??i)},positions:n,normals:qo(n,null),uvs:r(e.uvs,2),colors:r(e.colors,4),indices:o}}function AE(e){let t=rI({positions:new Float32Array(e.positions),uvs:new Float32Array(e.uvs),colors:null,indices:new Uint32Array(e.indices)}),r=n=>Array.from(n);return Du(r(t.positions),r(t.normals),r(t.uvs),r(t.indices))}var OJ=e=>!!e.morphAttributes.position?.length||Object.keys(e.attributes).some(d_);function AJ(e,t,r,n,o){let i=e.morphAttributes[t]?.[r];if(!i)return 0;let s=e.attributes[t],a=e.morphTargetsRelative||!s?0:Ja(e,s,n,o);return Ja(e,i,n,o)-a}function LJ(e,t,r){if(!t)return null;let n=t.positions.length/3,o=d=>t.sourceVertices?.[d]??d,i=R0(e),s=d=>{if(!i.width)return;let f=new Float32Array(n*i.width);for(let h=0;h<n;h++)for(let m=0;m<i.width;m++)f[h*i.width+m]=i.read(o(h),m,d);return f},a=(e.morphAttributes.position??[]).map((d,f)=>{let h=new Float32Array(n*3),m=new Float32Array(n*3);for(let w=0;w<n;w++){let x=o(w);for(let b=0;b<3;b++)h[w*3+b]=AJ(e,"position",f,x,b),m[w*3+b]=AJ(e,"normal",f,x,b)}return{positions:h,normals:m}}),l=s(!1),c=s(!0),u=!!l&&!!c&&r!==void 0;return(l&&c||a.length)&&(t.deformation={joints:l,weights:c,targets:a,influences:i.width,...u&&{skinJoints:r}}),t}function LPe(e,t,r={}){if(t==="sprite")return bJ(km(e,"triangles"),r.center);let n=OJ(e),o=e.attributes.position;if(!o||o.count===0)return null;let i=RPe(L0(o));if(t==="points"){let l=Os(e,"points"),c=vPe(TJ(RJ(i,3,l),(r.size??1)/2));if(!c)return null;let u=Uint32Array.from({length:c.positions.length/3},(d,f)=>l[Math.floor(f/EJ)]);return nI(c,u,e,o.count,n)}if(t==="lineStrip"||t==="lineLoop"||t==="lineSegments"){let l=_Pe(i,e,t,r.dashed);return l&&nI(l.drawn,l.sources,e,o.count,n)}let s=Os(e,"triangles");if(!s.length)return null;if(r.wireframe){let l=[...tI(e,s,!1).values()].flatMap(({a:u,b:d})=>[u,d]),c=_J(i,l,r.dashed);return c&&nI(c.drawn,c.sources,e,o.count,n)}let a={positions:new Float32Array(i),normals:wd(e,"normal",3,o.count),uvs:wd(e,"uv",2,o.count),colors:wd(e,"color",4,o.count),indices:new Uint32Array(s)};return r.flat?rI(a,n):{...a,normals:a.normals??qo(a.positions,a.indices)}}function km(e,t,r={}){return LJ(e,LPe(e,t,r),r.skinJoints)}function wd(e,t,r,n,o){let i=e.attributes[t];return!i||i.count<n?null:(o??=new Float32Array(n*r),i.readInto(o,0,r,0,n,r,1,vp(e,i)))}function RPe(e){for(let t=0;t<e.length;t++)if(Number.isNaN(e[t]))return Array.from(e);return e}function RJ(e,t,r){let n=[];for(let o=0;o<r.length;o++)for(let i=0;i<t;i++)n.push(e[r[o]*t+i]);return n}function nI(e,t,r,n,o){let i=wd(r,"color",4,n);return i&&(e.colors=new Float32Array(RJ(i,4,t))),o&&(e.sourceVertices=t),e}function _Pe(e,t,r,n){let o=Os(t,r),i=r==="lineLoop"&&o.length>2&&!T3(t,r);return _J(e,o,n,i)}function _J(e,t,r=!1,n=!1){let o=[],i=[],s=[],a=[],l=[],c=0;for(let d=0;d+1<t.length;d+=2){let f=t[d]*3,h=t[d+1]*3,m=[e[h]-e[f],e[h+1]-e[f+1],e[h+2]-e[f+2]],w=te(m[0],m[1],m[2]);if(w===0)continue;Ne(m);let x=o.length/3,b=n&&d+2===t.length?0:c+w;for(let[T,L]of[[f,1],[f,-1],[h,1],[h,-1]])l.push(T/3),o.push(e[T],e[T+1],e[T+2]),i.push(m[0]*L,m[1]*L,m[2]*L),r&&s.push(T===f?c:b,0);c+=w,a.push(x,x+1,x+3,x,x+3,x+2)}return a.length?{drawn:{positions:new Float32Array(o),normals:new Float32Array(i),uvs:r?new Float32Array(s):null,colors:null,indices:new Uint32Array(a),lines:!0},sources:new Uint32Array(l)}:null}function vPe(e){return e.indices.length?{positions:new Float32Array(e.positions),normals:new Float32Array(e.normals),uvs:null,colors:null,indices:new Uint32Array(e.indices)}:null}function OE(e){let t=new Pr;t.setAttribute("position",new Oe(e.positions,3)),t.setAttribute("normal",new Oe(e.normals,3)),e.uvs&&t.setAttribute("uv",new Oe(e.uvs,2)),e.colors&&t.setAttribute("color",new Oe(e.colors,4));let r=e.deformation;r?.joints&&r.weights&&(t.setAttribute("skinIndex",new Oe(r.joints,r.influences??4)),t.setAttribute("skinWeight",new Oe(r.weights,r.influences??4))),t.morphTargetsRelative=!0,t.morphAttributes.position=r?.targets.map(o=>new Oe(o.positions,3))??[],t.morphAttributes.normal=r?.targets.map(o=>new Oe(o.normals,3))??[],t.setIndex(new Oe(e.indices,1)),t.computeBoundingBox(),t.computeBoundingSphere();let n=e.spriteRadius;return n!==void 0&&(t.boundingBox.min.set(-n,-n,-n),t.boundingBox.max.set(n,n,n),t.boundingSphere.center.set(0,0,0),t.boundingSphere.radius=n),t}var Fm=e=>e.lines?"lines":e.spriteRadius!==void 0?"sprite":"faces";function vJ(e){let t=e.spriteRadius;if(t!==void 0)return{min:[-t,-t,-t],max:[t,t,t],sphere:[0,0,0,t]}}function MPe(e,t){let r=e.subarray(t*vt,(t+1)*vt),n=new Float64Array(4);return ys(n,r,1),{min:[...r.subarray(0,3)],max:[...r.subarray(3)],sphere:[...n]}}function DPe(e,t){let r=e.nodes.slice();for(let n=0;n<r.length;n+=e.stride)for(let o=0;o<3;o++)r[n+o]=t.min[o],r[n+3+o]=t.max[o];return{...e,nodes:r}}function LE(e,t,r){let n=[],o=!!r,i=!r&&vJ(t),s=e.pages.map((l,c)=>({id:c,...xo.page(l.index,l.indexSha256,n),count:l.count,...r?MPe(r,c):i||{min:l.min,max:l.max,sphere:l.sphere},role:l.level===0?"exact":"coarse",start:l.start,level:l.level,lodError:l.lodError,parentError:l.parentError,parentSphere:l.parentSphere,group:l.group,source:l.source,...t.lines&&{depthLayer:1},...!o&&{geometry:{...xo.page(l.geometry,l.geometrySha256,n),vertexCount:l.vertexCount,indexCount:l.indexCount,flags:l.flags,uncompressedBytes:l.uncompressedBytes,residentBytes:l.residentBytes,residentOffset:0}}}));return{primitive:{mesh:0,primitive:0,pass:"exact-clusters",clusterStrategy:"dag-groups",pages:s,structure:{version:1,roots:s.filter(l=>l.parentError===null).map(l=>l.id),groups:e.groups},culling:i?DPe(e.culling,i):e.culling,runtime:!0,...!o&&e.rayTracing&&{rayTracing:e.rayTracing},...o&&{dynamic:!0}},urls:n}}async function MJ(e,t){let r=await qh("cut",e),n=LE(r,t);return r.deformation&&(n.primitive.deformation=r.deformation),{...n,...r.roots&&{roots:r.roots},...r.unknownJoints&&{unknownJoints:r.unknownJoints}}}var PPe={};async function $4t(e){let t=await qh("assemble",e);return{...LE(t,PPe),parents:t.parents??new Float64Array(0)}}var FPe={};AF(FPe,{packAssembly:()=>IPe,packDrawn:()=>Xs,unpackAssembly:()=>kPe,unpackDrawn:()=>DJ});var oI=11,CPe=e=>Fm(e)==="faces";function Xs(e,t,r){let n=[e.positions,e.normals,e.uvs,e.colors,e.indices],o=e.deformation;o?.joints&&o.weights&&n.push(o.joints,o.weights);for(let l of o?.targets??[])n.push(l.positions,l.normals);let i=n.map(l=>l?.length??0),s=new Uint32Array(oI+_n(i));s.set([...i.slice(0,5),Number(CPe(e)),Number(t)]),s[7]=o?.joints&&o.weights?o.influences??4:0,s[8]=o?.targets.length??0,s[9]=Number(r),s[10]=s[7]&&o?.skinJoints!==void 0?o.skinJoints+1:0;let a=oI;for(let l of n)l&&(s.set(new Uint32Array(l.buffer,l.byteOffset,l.length),a),a+=l.length);return s.buffer}function DJ(e){let t=new Uint32Array(e,0,oI),r=t[5]===1,n=t[6]===1,o=t[9]===1,i=t.byteLength,s=(f,h)=>{let m=t[h]?f(e,i,t[h]):null;return i+=t[h]*4,m},a=(f,h,m)=>new Float32Array(f,h,m),l=(f,h,m)=>new Uint32Array(f,h,m),c={positions:s(a,0),normals:s(a,1)??new Float32Array(0),uvs:s(a,2),colors:s(a,3),indices:s(l,4)},u=c.positions.length/3,d=f=>{let h=new Float32Array(e,i,f);return i+=f*4,h};return(t[7]||t[8])&&(c.deformation={...t[7]?{joints:d(u*t[7]),weights:d(u*t[7]),influences:t[7],...t[10]?{skinJoints:t[10]-1}:{}}:{},targets:Array.from({length:t[8]},()=>({positions:d(u*3),normals:d(u*3)}))}),{drawn:c,faces:r,blended:n,levels:o}}var Yl=4;function IPe(e,t,r){let n=Xs(e,!1,!1),o=Vr(Yl*4+n.byteLength,8),i=new ArrayBuffer(o+(t.length+r.length)*8);return new Uint32Array(i,0,Yl).set([n.byteLength,t.length,r.length]),new Uint8Array(i,Yl*4).set(new Uint8Array(n)),new Float64Array(i,o).set(t),new Float64Array(i,o+t.length*8).set(r),i}function kPe(e){let[t,r,n]=new Uint32Array(e,0,Yl),o=DJ(e.slice(Yl*4,Yl*4+t)).drawn,i=Vr(Yl*4+t,8);return{roots:o,parts:new Float64Array(e,i,r),instances:new Float64Array(e,i+r*8,n)}}var NPe=e=>({size:e.size,wireframe:e.wireframe===!0,flat:e.flatShading===!0,dashed:e.kind==="lineDashed"});function PJ(e){let t=Qr(e.material),r=e instanceof go?e.center:void 0,n={...NPe(t),center:r?[r.x,r.y]:void 0,skinJoints:e.skeleton?.bones.length},o=t.transparent===!0||sh(t.blending),i=t.side==="double",s=!!e.waves;return{key:[e.primitive,o,i,s,...Object.values(n)].join("|"),options:n,blended:o,doubleSided:i,carried:s}}var BPe=(e,t,r)=>!r&&!t&&!e.deformation&&Fm(e)==="faces";async function CJ(e,{blended:t,doubleSided:r,carried:n}){let o=BPe(e,t,n),i=Xs(e,t,o),s=Fm(e);return{key:(r?"2:":"")+(n?"waves:":"")+(s==="faces"?"":`${s}:`)+await Wa(i),drawn:e,blended:t,doubleSided:r,levels:o,packed:i}}function IJ(){let e=Promise.resolve();return t=>{let r=e.then(xo.turn).then(()=>({out:t()}));return e=r.catch(()=>{}),r.then(({out:n})=>n)}}function kJ(e,t){for(let{name:r,from:n,count:o}of t){let i=e.attributes[r],s=n*i.itemSize,a=(n+o)*i.itemSize,[l]=i.updateRanges;if(!l)i.addUpdateRange(s,a-s);else{let c=Math.min(l.start,s);l.count=Math.max(l.start+l.count,a)-c,l.start=c}i.needsUpdate=!0}}var fi=[["positions","position",3],["normals","normal",3],["uvs","uv",2],["colors","color",4]],UPe={position:0,normal:1,uv:2,color:3},FJ=fi.map(([,e])=>({name:e,from:0,count:0})),NJ=[0,1,2,3,4].map(e=>FJ.slice(0,e)),Kl={ranges:NJ[0],bytes:0,box:new Float64Array(6)};function BJ(e,t){let r=0;Kl.bytes=0,gi(Kl.box,0);for(let[n,o,i]of fi){let s=e[n],a=t[n];if(!s||!a)continue;let l=-1,c=-1;for(let d=0;d<s.length;d++)s[d]!==a[d]&&(l<0&&(l=d),c=d);if(l<0)continue;let u=FJ[r++];if(u.name=o,u.from=Math.floor(l/i),u.count=Math.floor(c/i)+1-u.from,Kl.bytes+=u.count*i*4,n==="positions")for(let d=u.from*3;d<(u.from+u.count)*3;d+=3)On(Kl.box,0,s[d],s[d+1],s[d+2]),On(Kl.box,0,a[d],a[d+1],a[d+2])}return Kl.ranges=NJ[r],Kl}function UJ(e,t,r){for(let{name:n,from:o,count:i}of r){let[s,,a]=fi[UPe[n]];e[s].set(t[s].subarray(o*a,(o+i)*a),o*a)}}var VJ=(e,t)=>{let r=null;return{renewed(){let n=e();return!n||n===r?!1:(r=n,!0)},weigh(n,o,i){return e()?.vertexBytes?.(n.geometry.attributes,o)??i},write(n,o,i,s,a){let{geometry:l}=n,c=e();return!c||!n.held?!1:(kJ(l,o),c.updateVertices(l.attributes,o,i,s,a)||t(),!0)}}};function VPe(e,t){let r=e.pages.length,n=new Int32Array(t/3).fill(-1),o=new Uint32Array(r+1),i=new Uint32Array(r).fill(4294967295),s=new Uint32Array(r),a=[];for(let l=0;l<r;l++){for(let c of e.pages[l].index)n[c]!==l&&(n[c]=l,a.push(c),i[l]=Math.min(i[l],c),s[l]=Math.max(s[l],c));o[l+1]=a.length}return{first:o,low:i,high:s,vertices:Uint32Array.from(a)}}function GJ(e,t,{first:r,vertices:n},o,i,s){let a=1/0,l=1/0,c=1/0,u=-1/0,d=-1/0,f=-1/0,h=0;for(let w=r[e],x=r[e+1];w<x;w++){let b=n[w]*3,T=t[b],L=t[b+1],_=t[b+2];a=Math.min(a,T),u=Math.max(u,T),l=Math.min(l,L),d=Math.max(d,L),c=Math.min(c,_),f=Math.max(f,_),h=Math.max(h,Math.abs(T-o[b])),h=Math.max(h,Math.abs(L-o[b+1])),h=Math.max(h,Math.abs(_-o[b+2]))}let m=e*vt;s[e]=h,i[m]=a,i[m+1]=l,i[m+2]=c,i[m+3]=u,i[m+4]=d,i[m+5]=f}function HJ(e,t){let r=e.pages.length,n=VPe(e,t.length),{low:o,high:i}=n,s=new Float64Array(r*vt),a=new Float64Array(r);for(let l=0;l<r;l++)GJ(l,t,n,t,s,a);return{boxes:s,measure(l,c){for(let{name:d,from:f,count:h}of c)if(d==="position")for(let m=0;m<r;m++)o[m]<f+h&&i[m]>=f&&GJ(m,l,n,t,s,a);let u=0;for(let d=0;d<r;d++)u=Math.max(u,a[d]);return u}}}function zJ(e,t,r){let n=new Float64Array(6),o=e.positions;Rg(n,0,o,0,Math.floor(o.length/3));for(let s of t?[t.min,t.max]:[])On(n,0,s.x,s.y,s.z);for(let s=0;r&&s<6;s+=3)On(n,0,r[s],r[s+1],r[s+2]);let i=t?0:Math.max(n[3]-n[0],n[4]-n[1],n[5]-n[2],.001)/2;return _g(n,0,n,0,i),n}function iI(e,t,r,n){if(!Be(e.indices,t.indices))return!1;for(let[o]of fi)if(e[o]?.length!==t[o]?.length)return!1;return jJ(t.positions,r,n)}function jJ(e,t,r){return r?sI(e)&&WJ(e,t,Math.min(e.length,3)):WJ(e,t)}function sI(e){for(let t=3;t<e.length;t++)if(e[t]!==e[t-3])return!1;return!0}function WJ(e,t,r=e.length){for(let n=0;n<r;n+=3){let o=e[n],i=e[n+1],s=e[n+2];if(o<t[0]||o>t[3]||i<t[1]||i>t[4]||s<t[2]||s>t[5])return!1}return!0}function $J({index:e,drawRange:t},r){let[n,o,i,s]=fi.map(([a])=>r[a]?.slice()??null);return{next:{...r,positions:n,normals:o,uvs:i,colors:s},index:e,indexVersion:e?.version??0,range:[t.start,t.count]}}function GPe(e,t,r,n){let{next:o}=n,{position:i}=e.attributes,s=e.index;if(t!=="triangles"||r.wireframe||r.flat||o.lines||s!==n.index||(s?.version??0)!==n.indexVersion)return!1;let{start:a,count:l}=e.drawRange;return a!==n.range[0]||l!==n.range[1]?!1:!!i&&i.count*3===o.positions.length}function HPe(e,t,r){for(let n=1;n<fi.length;n++){let[o,i,s]=fi[n],a=r[o];if(!a&&(e.attributes[i]?.count??-1)>=t||a&&!wd(e,i,s,t,a)&&o!=="normals")return!1}return!0}function YJ(e,t,r,n){let{next:o}=n,{position:i,normal:s}=e.attributes;return!i||!GPe(e,t,r,n)||(i.readInto(o.positions,0,3,0,i.count,3,0),!HPe(e,i.count,o))||!jJ(o.positions,n.box,n.collapsed)?!1:((!s||s.count<i.count)&&qo(o.positions,o.indices,o.normals),!0)}var qJ=4*Tn;function XJ(e,t,r){let n={notices:e,counts:t,frame:0,serial:0,sent:0,changes:new WeakMap,dynamic:new WeakSet,ways:new WeakMap,leaves:new WeakMap,dirty:new Set,reaching:new Set,clock:r,disposed:!1,stop:void 0};return{wants:o=>zPe(n,o),heard:o=>WPe(n,o),drew(o){o.dynamicUploadBytes=n.sent,n.sent=0,n.frame++},of:(o,i,s,a,l)=>$Pe(n,o,i,{options:s,blended:a,made:l}),forget(o){n.dirty.delete(o),n.reaching.delete(o),n.leaves.get(o)?.()},upload:(o,i)=>YPe(n,o,i),dispose(){n.disposed=!0,n.stop?.()}}}var Qs=e=>e.dynamic;function KJ(e,t,r){return Qs(t).version=r,e.dirty.add(t),t}function WPe(e,t){let{changes:r,dynamic:n,frame:o}=e,i=r.get(t);if(!i||i.version===t.version||n.has(t))return;let s=i.stroke||o-i.frame===1;r.set(t,{version:t.version,frame:o,stroke:s})}function zPe(e,t){let{changes:r,dynamic:n}=e,o=t.geometry,i=o.usage==="dynamic";if(n.has(o))return!0;let s=r.get(o);if(s||r.set(o,{version:o.version,frame:-1/0,stroke:!1}),!i&&!s?.stroke)return!1;n.add(o),i||cD().then(l=>l.settle(e,o),()=>{});let a=sp(t);return e.notices?.say("geometry-dynamic",`Mesh "${a}" ${i?"declares":"rewrites every frame"} its geometry: its vertices are uploaded in place`,{kind:"lifecycle",mesh:a,declared:i}),!0}async function jPe(e,t,r,n,o){let i=o&&Qs(o),s={...$J(r,t),version:r.version},a=zJ(t,r.maxBounds,i?.box),l=i&&iI(o.drawn,t,a,i.collapsed);l||e.counts.cuts++;let c=l?i.cut:await qh("cut",Xs(t,n,!1),!0);if(e.disposed)return null;let u=HJ(c,new Float32Array(t.positions)),d=LE(c,t,u.boxes),[f,h]=[`dynamic:${e.serial++}`,new Set],m=l?i.collapsed:sI(t.positions),w={...s,box:a,cut:c,motion:u,reach:0,collapsed:m},x=OE(t);return x.usage="dynamic",{key:f,drawn:t,geometry:x,runtime:d,users:h,held:!1,dynamic:w}}async function $Pe(e,t,r,n){let{options:o,blended:i,made:s}=n,a=t.geometry,l=e.ways.get(a)??new Map;e.ways.set(a,l);let c=l.get(r),u=await c;for(;l.get(r)!==c;)u=await(c=l.get(r));if(u&&Qs(u).version===a.version)return u;if(u&&YJ(a,t.primitive,o,Qs(u)))return KJ(e,u,a.version);e.notices&&Hw(e.notices,t);let d=km(a,t.primitive,o);if(!d)return null;if(u&&iI(u.drawn,d,Qs(u).box,Qs(u).collapsed)){let w=Qs(u).next;for(let[x]of fi)w[x]?.set(d[x]);return KJ(e,u,a.version)}u&&e.dirty.delete(u);let f=()=>l.get(r)===m&&l.delete(r),h=w=>(e.notices&&Ww(e.notices,t,w),f(),null),m=jPe(e,d,a,i,u??void 0).then(w=>w?(e.leaves.set(w,f),s(w),w):(f(),null),h);return l.set(r,m),m}function YPe(e,t,r){let{dirty:n,reaching:o}=e,i=0;if(r.renewed())for(let s of o)n.add(s);for(let s of n){let a=Qs(s),l=BJ(s.drawn,a.next),c=r.weigh(s,l.ranges,l.bytes);if(i&&i+c>t)break;UJ(s.drawn,a.next,l.ranges),a.reach=a.motion.measure(s.drawn.positions,l.ranges),a.reach>0?o.add(s):o.delete(s),r.write(s,l.ranges,l.box,a.reach,a.motion.boxes)&&(i+=c,n.delete(s))}return e.sent+=i,i}function QJ(e,t){let r={duplicates:0,cuts:0},n={byKey:new Map,notices:e,readings:new WeakMap,reads:IJ(),drawnBy:new Map,superseded:new Set,counts:r,dynamic:XJ(e,r,t),disposed:!1},o=i=>void n.byKey.set(i.key,Promise.resolve(i));return W({counts:r,dynamic:n.dynamic,of:i=>JPe(n,i,o),leave:i=>ZJ(n,i),hold:(i,s)=>aI(n,i,s),release:i=>qPe(n,i),dispose:()=>KPe(n)})}function KPe(e){e.disposed=!0,e.dynamic.dispose();for(let t of[...e.drawnBy.keys()])ZJ(e,t);for(let t of[...e.superseded])aI(e,t,!1);for(let t of e.byKey.values())t.then(r=>{r&&aI(e,r,!1)})}function RE(e,t){t.users.size||t.held||t.released||(t.released=!0,xo.release(t.runtime.urls),t.geometry.dispose(),e.superseded.delete(t)||e.byKey.delete(t.key),e.dynamic.forget(t))}function qPe(e,t){RE(e,t),t.released||e.superseded.add(t)}function ZJ(e,t){let r=e.drawnBy.get(t);r&&(e.drawnBy.delete(t),r.users.delete(t),RE(e,r))}function aI(e,t,r){t.held=r,RE(e,t)}var XPe=({key:e,drawn:t,doubleSided:r},n)=>({key:e,drawn:t,runtime:n,doubleSided:r,geometry:OE(t),users:new Set,held:!1});function QPe(e,t,r,n){let{byKey:o,counts:i,notices:s}=e,{key:a,drawn:l,blended:c,doubleSided:u,levels:d}=t,f=t.packed;t.packed=null;let h=o.get(a);if(h)return r&&i.duplicates++,h;i.cuts++;let m=x=>{let{unknownJoints:b}=x,T=l.deformation?.skinJoints;return s&&b&&T!==void 0&&_3(s,n,T,b),x},w=MJ(f??Xs(l,c,d),l).then(x=>XPe({key:a,drawn:l,doubleSided:u},m(x)),x=>(o.get(a)===w&&o.delete(a),s&&Ww(s,n,x),null));return o.set(a,w),w}function ZPe(e,t,r){let n=e.drawnBy.get(t);return r?(r.users.add(t),e.drawnBy.set(t,r)):e.drawnBy.delete(t),n&&n!==r&&(n.users.delete(t),RE(e,n)),r}async function JPe(e,t,r){let n;do n=await tCe(e,t,r);while(n?.released);return e.disposed?null:ZPe(e,t,n)}function eCe(e,t){return e.notices&&Mn(e.notices,"the geometry of a mesh",`its read failed: ${t}`),null}async function tCe(e,t,r){let{dynamic:n,readings:o,notices:i}=e,s=PJ(t),{key:a,options:l,blended:c}=s;if(n.wants(t))return n.of(t,a,l,c,r);let u=o.get(t.geometry)??new Map;o.set(t.geometry,u);let d=u.get(a),f=!d||!d.waiting&&d.version!==t.geometry.version;if(f){let{geometry:m,primitive:w}=t,x={version:m.version,waiting:!0},b=e.reads(()=>{if(x.version=m.version,x.waiting=!1,e.disposed)return null;i&&Hw(i,t,m);let T=km(m,w,l);return T&&CJ(T,s)}).catch(T=>(u.get(a)?.read===b&&u.delete(a),eCe(e,T)));d=Object.assign(x,{read:b}),u.set(a,d)}let h=await d.read;return h&&!e.disposed?QPe(e,h,f,t):null}function lI(e,t){let[r,n,o]=e.baseColor,[i,s,a]=e.emissive;return{family:"standard",color:{r,g:n,b:o},emissive:{r:i,g:s,b:a},metalness:e.metalness,roughness:e.roughness,opacity:e.opacity,...tP(e.alphaMode,e.alphaCutoff),side:e.side,vertexColors:t}}var G5t=(e,t)=>Ki(lI(e,t));var JJ=["transmission","ior","thickness","anisotropy","anisotropyRotation","clearcoat","clearcoatRoughness","sheen","iridescence"],rCe=["sheenRoughness","attenuationDistance"],nCe=e=>JJ.some(t=>typeof e[t]=="number"&&e[t]!==0)||typeof e.specularIntensity=="number"?"physical":"standard",cI=e=>({subsurfaceProfile:e.subsurfaceProfile,toonProfile:e.toonProfile,shadingModel:e.shadingModel,irisMask:e.irisMask,irisDistance:e.irisDistance,subsurfaceOpacity:e.subsurfaceOpacity});function eee(e,t){let r=nCe(e),n={...lI(e.surface(),t),family:r,subsurfaceColor:e.subsurfaceColor,...cI(e)};if(r!=="physical")return n;e.clearcoatNormalScale&&(n.clearcoatNormalScale=e.clearcoatNormalScale),e.sheenColor&&(n.sheenColor=e.sheenColor),e.attenuationColor&&(n.attenuationColor=e.attenuationColor),typeof e.specularIntensity=="number"&&(n.specularIntensity=e.specularIntensity);for(let o of[...JJ,...rCe])typeof e[o]=="number"&&(n[o]=e[o]);return n}var _E=["anisotropyMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","sheenRoughnessMap","sheenColorMap","specularIntensityMap"],j5t=_E.indexOf("sheenRoughnessMap"),$5t=_E.indexOf("specularIntensityMap"),Y5t=new Set(["sheenColorMap"]),oCe=["map","roughnessMap","metalnessMap","normalMap","aoMap","emissiveMap","subsurfaceMap"],K5t=oCe.indexOf("subsurfaceMap");var tee=(e,t)=>typeof e=="number"&&typeof t=="number"?{x:e,y:t}:void 0;function iCe(e){if(typeof e=="number")return{x:e,y:e};if(Array.isArray(e))return tee(e[0],e[1]);let t=e;return tee(t?.x,t?.y)}function sCe(e){let t=e.domain==="surface"&&!!e.graph?.outputs.displacement,r=e.displacementMap;if(!t&&r?.isTexture!==!0)return{};let{displacementFadeStart:n,displacementFadeEnd:o}=e,i={magnitude:e.displacementMagnitude,center:e.displacementCenter,fade:n!==void 0&&o!==void 0?{start:n,end:o}:null};return t?{displacement:i}:{displacement:i,displacementMap:r}}var ree=e=>({normalScale:iCe(e.normalScale),aoMapIntensity:typeof e.aoMapIntensity=="number"?e.aoMapIntensity:void 0,...sCe(e)});var aCe=[...zA,"alphaMap","matcap","gradientMap","subsurfaceMap",..._E];function lCe(e,t,r){let n={family:e};for(let o of hh)t[o]&&(n[o]=t[o]);return Object.assign(n,{emissiveIntensity:t.emissiveIntensity,shininess:typeof t.shininess=="number"?t.shininess:void 0,opacity:t.opacity,transparent:t.transparent,alphaTest:t.alphaTest,side:t.side,vertexColors:r,...cI(t)})}function cCe(e){let t=e.scale??1,r=!(t>0);return{dashSize:r?0:(e.dashSize??0)/t,gapSize:r?0:(e.gapSize??0)/t}}var nee={side:"double",twoSidedPasses:!1};function uCe(e,t){return t==="lines"?{lineWidth:e.linewidth??1,...e.kind==="lineDashed"?cCe(e):{},...nee}:t==="sprite"?{sprite:!0,rotation:e.rotation??0,sizeAttenuation:e.sizeAttenuation!==!1,...nee}:t==="sheet"?{side:"double"}:{}}var dCe=new qe("meshBasic");function oee(e,t,r){let n=e.domain==="surface"?e:dCe,o=By[n.kind],i=o?lCe(o,n,t):eee(n,t);for(let s of aCe){let a=n[s];a?.isTexture&&(i[s]=a)}return Object.assign(i,{flatShading:n.flatShading===!0,graph:n.domain==="surface"?n.graph:void 0,allowNegativeEmissive:n.allowNegativeEmissive===!0,opacityMaskClipValue:n.opacityMaskClipValue,ditherOpacityMask:n.ditherOpacityMask===!0,transparentShadow:n.transparentShadow===!0,translucentShadowDensityScale:n.translucentShadowDensityScale,translucentShadowStartOffset:n.translucentShadowStartOffset,translucentSelfShadowDensityScale:n.translucentSelfShadowDensityScale,translucentSelfShadowSecondDensityScale:n.translucentSelfShadowSecondDensityScale,translucentSelfShadowSecondOpacity:n.translucentSelfShadowSecondOpacity,translucentBackscatteringExponent:n.translucentBackscatteringExponent,translucentMultipleScatteringExtinction:n.translucentMultipleScatteringExtinction,twoSidedPasses:n.twoSidedPasses===!0,normalCurvatureToRoughness:n.normalCurvatureToRoughness===!0,maxWorldPositionOffset:n.maxWorldPositionOffset,...ree(n),alwaysEvaluateWorldPositionOffset:n.alwaysEvaluateWorldPositionOffset===!0,cloudFog:n.cloudFog===!0,sky:n.sky===!0,computeFogPerPixel:n.computeFogPerPixel===!0,contactShadows:n.contactShadows===!0,translucentLocalLightShadow:n.translucentLocalLightShadow===!0,translucentLocalLightShadowQuality:n.translucentLocalLightShadowQuality,translucentDirectionalLightShadowQuality:n.translucentDirectionalLightShadowQuality,litFrom:n.litFrom,translucencyPass:n.translucencyPass,blending:n.blending,...sh(n.blending)?{transparent:!0}:{},...uCe(n,r)})}var vE=["faces","lines","sprite","sheet"],iee=(e,t="faces")=>Ki(oee(e,!1,t));function see(e,t,r){let n=oee(t,e.vertexColors===!0,r),o=e.sprite?.sizeAttenuation??n.sizeAttenuation;vY(e,{...n,sizeAttenuation:o})}var s6t=e=>"meshes"in e,a6t=({from:e,to:t})=>e!==t&&(e==="blend"||t==="blend"),aee=(e,t,r)=>t!==e||t==="mask"&&r,fCe="the session is closing or its device is lost",ql=(e,t)=>t&&t!==fCe&&!e.stopped?.()?t:void 0;var pCe=new Set(["kind","transparent","blending","transmission","side","vertexColors","transparentShadow","allowNegativeEmissive","cloudFog","sky","contactShadows","litFrom","translucencyPass","translucentLocalLightShadow","translucentLocalLightShadowQuality","translucentDirectionalLightShadowQuality","sizeAttenuation","wireframe","flatShading","size","graph"]),lee=(e,t)=>!Hy.has(t)&&!pCe.has(t)&&!e[t]?.isTexture;function cee(e,t=!0,r=!0){if(e===null||typeof e!="object")return String(e);let n=e,o=e;if(o.isMaterialGraph)return`graph:${o.signature()}${r?`|${o.valuesSignature()}`:""}`;if(n.isTexture){let s=t?n.version:"";return`texture:${n.id}@${s}.${n.sampling}.${n.placement}`}return Array.isArray(e)?`[${e.map(s=>cee(s,t)).join(",")}]`:`{${Object.entries(e).filter(([,s])=>typeof s=="number").map(([s,a])=>`${s}:${a}`).join(",")}}`}function yd(e,t=!0,r=!0){let n=["kind"];for(let[o]of Wy(e))o!=="name"&&(t||!lee(e,o))&&n.push(o);return n.sort().map(o=>`${o}=${cee(e[o],r,t)}`).join(";")}function hCe({sources:e},t,r){let n=e.get(r);if(n?.size!==1||!n.has(t)||yd(t,!1)!==yd(r.material,!1)||!uI(r.material,t))return!1;let o=r.material,i=o[gh],s=!1;for(let[a,l]of hv(t)){if(!lee(t,a))continue;let c=o[a];l==null&&c==null||l===c||(l instanceof pe&&c instanceof pe||l instanceof Me&&c instanceof Me?c.copy(l):(i.call(o,a,mh(l),!1),s=!0))}return s&&(o.needsUpdate=!0),dI(o,t),!0}function uI(e,t){let r=e.graph,n=t.graph?.values;if(!r)return!0;for(let o of r.values.keys()){if(n?.has(o))continue;if(!(r instanceof ho&&r.overrides.has(o))||r.parent.values.has(o))return!1}return!0}var mCe=(e,t)=>Au(t)?Au(e)&&Be(e,t):e===t;function gCe(e,t,r){let n=e.values.get(t),o=!(e instanceof ho)||e.overrides.has(t);Au(r)&&o&&Au(n)?(cN(n,r),e[mn](t,n)):e[mn](t,Ou(r))}function dI(e,t){let r=e.graph,n=!1;if(!r)return n;let o=t.graph?.values;for(let[i,s]of o??[])mCe(r.values.get(i),s)||(gCe(r,i,s),n=!0);if(r instanceof ho)for(let i of r.overrides.keys())o?.has(i)||(r.unset(i),n=!0);return n}function uee(e,t,r,n){let{entries:o,repainted:i}=e;if(o.has(n))return!1;let s=yd(t,!0,!1)===yd(r.material,!0,!1),{alphaTest:a}=r.material,l=ih(r.material);if(!s&&!hCe(e,t,r))return!1;o.delete(r.key),o.set(r.key=n,r);let c=i.get(r),u={values:!s||!!c?.values},d=ih(r.material);return(c?.alpha||aee(l,d,r.material.alphaTest!==a))&&(u.alpha={from:c?.alpha?.from??l,to:d}),i.set(r,u),!0}function dee(e,t){let r=!1,n=!1,o=new Map;for(let{entry:a,alpha:l,values:c}of e){let u=[];if(a.surfaces.forEach((h,m)=>{if(h)for(let w of[h,...a.variants[m]?.values()??[]])c&&see(w,a.material,vE[m]),u.push(w)}),!u.length||(r=!0,n||=c,!l))continue;let d=`${l.from}>${l.to}`,f=o.get(d);f?Ht(f.surfaces,u):o.set(d,{...l,surfaces:u})}if(!t||!r)return;let[i,...s]=o.values();t(n,i);for(let a of s)t(!1,a)}var fI="the engine has no thin-film lobe",fee="a dielectric's reflectance takes no colour",pee="it is read as a factor, with no map",SCe={iridescence:fI,iridescenceMap:fI,iridescenceThicknessMap:fI,specularColor:fee,specularColorMap:fee,dispersion:"the refraction bends every colour alike",bumpMap:"a surface is bent by its normal map, never by a height",transmissionMap:`the transmission: ${pee}`,thicknessMap:`the thickness: ${pee}`,alphaMap:"the opacity is the base colour map's alpha"};function wCe(e){if(typeof e=="number")return e>0;let t=e;return t?.isTexture===!0?!0:t?.isColor===!0&&(t.r!==1||t.g!==1||t.b!==1)}var hee=Object.entries(SCe);function mee(e,t,r){if(t.size!==hee.length)for(let[n,o]of hee)!t.has(n)&&wCe(e[n])&&(t.add(n),r(n,o))}var yCe={lightPattern:"a light pattern is worn by a light (light.lightPattern)",postProcess:"a post-process material joins the image through world.effects.blendables",volume:"a volume material is voxelised from the mesh it is the first material of",deferredDecal:"a decal is projected from the box of the mesh it is the first material of"};function gee(e){let{domain:t}=e;return t==="surface"?void 0:{domain:t,reason:yCe[t]}}var See=e=>!!e?.nodes.some(t=>t.kind==="vertexColor");function xCe(e,t,r){let{material:n}=e,o=t.lines?"lines":t.spriteRadius!==void 0?"sprite":r?"sheet":"faces",i=vE.indexOf(o),s=e.surfaces[i]??=iee(n,o);return Db(s,e.variants[i]??=new Map,{vertexColors:(!!n.vertexColors||See(n.graph))&&!!t.colors,flatShading:!1,twoSided:!1})}function wee(e){for(let t of e){for(let r of t.surfaces)r?.dispose();for(let r of t.variants)for(let n of r?.values()??[])n.dispose();t.surfaces.length=0,t.variants.length=0}}function yee(e=()=>{},t=()=>{},r=()=>{}){let n={entries:new Map,sources:new Map,known:new WeakMap,repainted:new Map,counts:{duplicates:0},ids:0,said:new Set,domainsSaid:new Set,notDrawn:e,domainNotDrawn:t,copied:r},{entries:o,repainted:i}=n;return W({counts:n.counts,entryOf:s=>TCe(n,s),writeValues:s=>ACe(n,s),get repaintPending(){return i.size>0},surfaceOf:(s,a,l)=>xCe(s,a,l),repaint:(s,a)=>dee(s,a),takeRepainted(){let s=[...i].map(([a,l])=>({entry:a,...l}));return i.clear(),s},keep:s=>bCe(n,s),dispose(){wee(o.values()),o.clear()}})}function bCe(e,t){let{entries:r,sources:n,repainted:o}=e,i=[];for(let[s,a]of r)t.has(a)||(r.delete(s),n.delete(a),o.delete(a),i.push(a));wee(i)}function ECe(e,t){mee(t,e.said,e.notDrawn);let r=gee(t);r&&!e.domainsSaid.has(r.domain)&&(e.domainsSaid.add(r.domain),e.domainNotDrawn(r.domain,r.reason))}function TCe(e,t){let{entries:r,sources:n,known:o}=e,i=o.get(t),s=i&&r.get(i.entry.key)===i.entry?i.entry:null;if(s&&i.version===t.version)return s;ECe(e,t);let a=yd(t);if(s&&s.key!==a&&uee(e,t,s,a))return o.set(t,{version:t.version,entry:s}),s;let l=r.get(a);l?i?.entry!==l&&e.counts.duplicates++:(l={id:e.ids++,key:a,material:xj(t),surfaces:[],variants:[]},r.set(a,l),l.material.graph&&e.copied(l.material.graph)),i&&i.entry!==l&&n.get(i.entry)?.delete(t);let c=n.get(l)??new Set;return n.set(l,c.add(t)),o.set(t,{version:t.version,entry:l}),l}function ACe(e,t){let{entries:r,sources:n,known:o,repainted:i}=e,s=o.get(t);if(!s||r.get(s.entry.key)!==s.entry)return!1;if(s.version===t.version)return!0;let{entry:a}=s,l=n.get(a);return s.version!==t.version-1||l?.size!==1||!l.has(t)||!uI(a.material,t)?!1:(o.set(t,{version:t.version,entry:a}),dI(a.material,t)&&(r.delete(a.key),r.set(a.key=`values:${a.id}`,a),i.set(a,{...i.get(a),values:!0})),!0)}var xee=(e,t,r)=>t>0||!r&&e>0;function bee(e,t){if(!e)return;let r=3*t,n=e[r],o=e[r+1],i=e[r+2]===1;return xee(n,o,i)?{min:n,max:o,perInstance:i}:void 0}function P6t(e,t,r){if(!e)return!r;let n=3*t,o=e[n],i=e[n+1],s=e[n+2]===1;return xee(o,i,s)?!!r&&r.min===o&&r.max===i&&r.perInstance===s:!r}function Eee(e,t,r){let n=3*t;e[n]=r?.min??0,e[n+1]=r?.max??0,e[n+2]=r?.perInstance?1:0}var Nm=5,ME=5,Tee={tracks:{stride:1,make:e=>new Int32Array(e).fill(-1)},drawDistance:{stride:3,make:e=>new Float32Array(e)},farField:{stride:1,make:e=>new Uint8Array(e)},rootParent:{stride:Nm,make:e=>new Float32Array(e)},instanceData:{stride:ME,make:e=>new Float32Array(e)}},LCe=Object.keys(Tee);function DE(e,t){let r=e[t];if(r)return r;let{stride:n,make:o}=Tee[t],i=o(n*e.capacity);return Object.assign(e,{[t]:i}),i}function Bm(e,t){let r=Math.max(1,e);return{...t&&{sources:t},matrices:new Float64Array(r*16),live:new Uint8Array(r),casting:new Uint16Array(r),capacity:r}}function xd(e,t){let r=Bm(Lr(e?.capacity??0,t),e?.sources);if(e){r.sourceModels=e.sourceModels,e.local&&(r.local=!0),e.blended&&(r.blended=!0),r.matrices.set(e.matrices),r.live.set(e.live),r.casting.set(e.casting),r.cells=e.cells?.slice(),r.cellsMoved=e.cellsMoved,r.instanceMoved=e.instanceMoved,r.banks=e.banks;for(let n of LCe){let o=e[n];o&&DE(r,n).set(o)}}return r}function Zi(e,t,r,n,o){r&&e.matrices.set(r,t*16),e.live[t]=n?1:0,e.casting[t]=o}var F6t=(e,t)=>({elements:e.matrices.subarray(t*16,(t+1)*16)}),N6t=e=>!!e&&e.rows.live[e.index]===0,B6t=e=>e.rows.casting[e.index],U6t=e=>e?.rows.instanceData?.[ME*e.index]??0,V6t=e=>e?.rows.instanceData?.[ME*e.index+1]??0;function G6t(e,t){let r=e?.rows.instanceData,n=ME*(e?.index??0)+2;for(let o=0;o<3;o++)t[o]=r?.[n+o]??0;return t}var H6t=({rows:e,index:t})=>bee(e.drawDistance,t);function RCe(e,t,r){let n=r?DE(e,"drawDistance"):e.drawDistance;n&&Eee(n,t,r)}var pI={min:0,max:0,perInstance:!1};function Xl(e,t,r,n){pI.max=r,pI.perInstance=n,RCe(e,t,r>0?pI:void 0)}function W6t({rows:e,index:t}){let r=e.rootParent,n=Nm*t;if(!r||!(r[n+4]>0))return;let o=[r[n+1],r[n+2],r[n+3],r[n+4]];return{error:r[n],sphere:o}}var z6t=(e,t)=>e===t||!!e&&!!t&&e.error===t.error&&e.sphere.every((r,n)=>r===t.sphere[n]);function Aee(e,t,r){e.rootParent?.fill(0,Nm*t,Nm*r)}function j6t(e,t,r){let n=r?DE(e,"rootParent"):e.rootParent;if(!n)return;let o=Nm*t;n[o]=r?.error??0;for(let i=0;i<4;i++)n[o+1+i]=r?.sphere[i]??0}var PE=0,$6t=()=>PE;function Y6t(e,t,r){let n=r?DE(e,"farField"):e.farField;!n||n[t]===(r?1:0)||(n[t]=r?1:0,PE++)}function Zs(e,t,r,n,o){let i=t,s=Math.min(n,e.capacity),a=!1;for(let l=Math.max(r,0);l<s;l++)i[l]!==o&&(i[l]=o,a=!0);a&&PE++}function Um(e,t){e.sources!==t&&PE++,e.sources=t}var Oee=(e,t)=>Math.min(e-(t??e),100);var Js=e=>We(e)?Math.max(1,e.instanceMatrix.count):1;function mI(e,t){return e.rows?We(t)?e.rows.capacity<Js(t)?-1:(e.free.length=0,0):e.free.pop()??-1:-1}function gI(e,{batch:t,row:r}){t.rows&&Zs(t.rows,t.owners,r,r+Js(e),e)}function SI(e,t,{batch:r,row:n}){if(n<0||!r.rows)return;let o=n+Js(t);Zs(r.rows,r.owners,n,o,null),r.rows.live.fill(0,n,o),Aee(r.rows,n,o),We(t)||r.free.push(n),e.touched(r,n,o-1)}function CE(e,t){let r=e.batches.get(t.cut);r?.get(t.way)===t&&r.delete(t.way),r?.size||e.batches.delete(t.cut),e.short.delete(t)}function Lee(e,t,r){r.wearers.delete(t),!r.wearers.size&&(r.rows?e.emptied.add(r):CE(e,r))}function Ree(e,t,r){for(let n of r)Lee(e,t,n.batch),SI(e,t,n),n.row>=0&&e.released(n)}function wI(e,t){let r=e.seats.get(t);return!r||!e.seats.delete(t)||Lee(e,t,r.batch),r}var _Ce=[],Vm=(e,t)=>e.next.get(t)??_Ce,yI=(e,t,r)=>Vm(e,t).find(n=>n.batch===r)??e.seats.get(t);function _ee(e,t,r=0){let n=e.next.get(t);n&&(Ree(e,t,n.splice(r)),n.length||e.next.delete(t))}function vee(e,t,r){let n=e.next.get(t),o=n.splice(0,r+1);n.length||e.next.delete(t);let i=o.pop();Ree(e,t,o);let s=wI(e,t);return e.seats.set(t,i),s&&SI(e,t,s),s}function Mee(e,t,r){let n=e.seats.get(t),o=Vm(e,t);if((o[o.length-1]??n)?.batch===r)return!1;let i=o.findIndex(a=>a.batch===r);if(i>=0||n?.batch===r)return _ee(e,t,i+1),!1;r.wearers.add(t);let s={batch:r,row:mI(r,t),waited:0};if(s.row<0?e.short.add(r):gI(t,s),n&&n.row>=0){let a=e.next.get(t);return a?a.push(s):e.next.set(t,[s]),s.row>=0&&e.hidden(t,s),!1}return wI(e,t),e.seats.set(t,s),s.row<0?!1:(e.touched(r,s.row,s.row+Js(t)-1),!0)}function Dee(e,t){_ee(e,t);let r=wI(e,t);r&&SI(e,t,r)}var xI=(e,{batch:t,row:r})=>r>=0&&!!t.rows&&!e.refusals.has(t),bI=(e,t)=>Vm(e,t).some(r=>xI(e,r));function vCe(e,t,r,n,o){if(!xI(e,t))return!1;let i=t.batch.rows,s=o?.(i,t.row);return s==="asked"||s!=="waiting"&&(!r||r(i,t.row))?!0:(t.waited+=n)>=3e4}function Pee(e,t,r){let n=e.seats.get(t);return n?e.refusals.has(n.batch)?"whole":n.row<0||!n.batch.rows||e.joining.has(n.batch)?"coming":!r||r(n.batch.rows,n.row)?"whole":"drawn":"coming"}function Cee(e,t,r,n,o){let i=!1;for(let[s,a]of e.next){let l=a.length-1;for(;l>=0&&!vCe(e,a[l],r,n,o);)l--;l>=0&&t(s,vee(e,s,l));for(let c of a)i||=xI(e,c)}return i}function Iee(e){for(let[t,r]of e.next)vee(e,t,r.length-1);e.emptied.clear()}function kee(e,t){for(let r of e.emptied)e.joining.has(r)||(e.emptied.delete(r),!r.wearers.size&&(CE(e,r),t(r,!e.batches.has(r.cut))))}var MCe=e=>We(e)?`/instanced${e.id}`:"",DCe={growsInPlace:()=>!1,growPlacements(){}};function PCe(e,t,r){let{short:n,joining:o}=e;return[...n].filter(i=>{if(!i.rows||o.has(i))return!1;let s=AI(e,i,t,r??DCe);return s===!1&&r&&Nee(e,i,"its rows cannot grow in place"),!!s})}function CCe(e,t,r){let{short:n}=e;if(!r?.addPlacements)return[];let o=[...n].filter(i=>!i.rows);for(let i of o){AI(e,i,t);let s=l=>{let c=ql(r,l);c&&Nee(e,i,c)},a=r.addPlacements(i,e.ranks.primitive(i.cut)).then(s,l=>s(String(l)));e.flights.add(a),e.joining.add(i),a.finally(()=>{e.flights.delete(a),e.joining.delete(i),e.short.has(i)&&e.landed()})}return o}var ICe=(...[e,t,r,n,o,i,s])=>({touched:e,wear:t,ranks:r,refused:n??(()=>{}),landed:o??(()=>{}),hidden:i??(()=>{}),released:s??(()=>{}),refusals:new Set,flights:new Set,made:0,batches:new Map,seats:new Map,next:new Map,short:new Set,joining:new Set,emptied:new Set});function Fee(e,t,r,n,o,i,s){let a=ICe(e,t,r,n,o,i,s),{seats:l}=a;return W({seats:l,movesOf:c=>Vm(a,c),unseat:c=>Dee(a,c),seat:(c,u,d)=>Mee(a,c,FCe(a,u,d,c)),growHeld:(c,u)=>PCe(a,c,u),join:(c,u)=>CCe(a,c,u),handOver:(c,u,d,f)=>Cee(a,c,u,d,f),arrival:(c,u)=>Pee(a,c,u),takeEmptied:c=>kee(a,c),get emptied(){return a.emptied.size>0},get moving(){return a.next.size>0},handing:()=>[...a.next.keys()].filter(c=>bI(a,c)),waitsOnHandOver:c=>bI(a,c),get flying(){return ki(a.flights)},reopen:()=>kCe(a),entries:()=>new Set(TI(a).map(c=>c.entry))})}function kCe(e){e.refusals.clear(),Iee(e);for(let t of TI(e))t.wearers.size?AI(e,t):CE(e,t);return TI(e).sort((t,r)=>t.order-r.order)}function FCe(e,t,r,n){let o=$_(n.physics?.soft?.type),i=`${r.id}/${n.skeleton?.bones.length??0}/${n.waves?.waveModel.count??0}/${+o}${MCe(n)}`,s=`${t.key}/${i}`,a=e.batches.get(t);a||e.batches.set(t,a=new Map);let l=a.get(i);return l||a.set(i,l=new EI(e,{key:s,cut:t,way:i,entry:r,twoSided:o})),l}var EI=class{key;cut;way;entry;twoSided;surface;order;rows=null;owners=[];free=[];wearers=new Set;casting=0;primitives=0;#e;constructor(t,r){this.key=r.key,this.cut=r.cut,this.way=r.way,this.entry=r.entry,this.twoSided=r.twoSided,this.surface=t.wear(r.entry,r.cut,r.twoSided),this.order=t.made++,this.#e=t.ranks}get geometry(){return this.cut.geometry}get attributes(){return this.cut.geometry.attributes}get dynamic(){return!!this.cut.dynamic}get declaration(){return this.surface}wear=t=>{this.surface=t};get mesh(){return this.#e.cut(this.cut)}},TI=e=>[...e.batches.values()].flatMap(t=>[...t.values()]);function Nee(e,t,r){e.refusals.has(t)||(e.refusals.add(t),e.refused(`the batch of ${t.key}`,r))}function NCe(e,t){let r=0;for(let n of t.wearers)yI(e,n,t).row<0&&(r+=Js(n));return r}function BCe(e,t,r){let n=t.rows,o=n?.capacity??0,i=o-t.free.length+NCe(e,t);if(i<=o)return null;if(n&&r&&!r.growsInPlace([n],Lr(o,i)))return!1;let s=xd(n,i),{capacity:a}=s;for(let l=a-1;l>=o;l--)t.free.push(l);return Zs(s,t.owners,o,a,null),Um(s,t.owners),s.sourceModels=t.wearers,t.rows=s,n&&r&&r.growPlacements(n,s),n}function AI(e,t,r,n){let o=BCe(e,t,n);if(o===!1)return!1;for(let i of t.wearers){let s=yI(e,i,t);s.row>=0||(s.row=mI(t,i),gI(i,s),e.seats.get(i)===s?r?.(i):e.hidden(i,s))}return e.short.delete(t),o}function Bee(){let e=new WeakMap,t=new WeakMap,r=0,n=o=>{let i=e.get(o);return i||e.set(o,i={...o.runtime.primitive,...o.doubleSided&&{doubleSided:!0},mesh:r++}),i};return{cut:o=>n(o).mesh,primitive:n,model(o,i){let s=t.get(o);return s===void 0&&(t.set(o,s=r),r+=i()),s}}}var OI=class{node;ranks;constructor(t){this.node=t}get geometry(){return this.node.geometry}get attributes(){return this.node.geometry.attributes}get dynamic(){return this.node.geometry.usage==="dynamic"}get declaration(){return this.node.material}wear(t){this.node.material=t}get casting(){return bn(this.node)}get drawDistance(){return Vee.get(this.node)}get rootParent(){return Gee.get(this.node)?.[this.primitives??0]??void 0}get rows(){return this.ranks?.placements}get mesh(){return this.ranks?.meshes}get primitives(){return this.ranks?.primitives}get twoSided(){return this.ranks?.twoSided===!0}},Uee=new WeakMap,Vee=new WeakMap,Gee=new WeakMap,pzt=(e,t)=>void Gee.set(e,t.map(r=>r&&{error:r[0],sphere:[r[1],r[2],r[3],r[4]]})),hzt=(e,t)=>void Vee.set(e,t);function IE(e,t){let r=Uee.get(e);return r||Uee.set(e,r=new OI(e)),t&&(r.ranks=t),r}var mzt=(e,t)=>nd(e).map(r=>IE(r,t.get(r)));var UCe=/^(?!\.{1,2}$)[\w.-]+$/,VCe=/^\/\/|:/;function Hee(e){let t=new Map;return r=>{let n=r.lastIndexOf("/")+1,o=r.slice(0,n),i=r.slice(n),s=t.get(o);if(s===void 0){if(VCe.test(o))return new URL(r,e).href;t.set(o,s=new URL(o||".",e).href)}return UCe.test(i)?s+i:new URL(r,e).href}}function Wee(e,t){return{...e,pages:e.pages.map(r=>({...r,url:t(r.url),...r.geometry&&{geometry:{...r.geometry,url:t(r.geometry.url),...r.geometry.bundle&&{bundle:{...r.geometry.bundle,url:t(r.geometry.bundle.url)}}}}})),streams:e.streams?{...e.streams,pages:e.streams.pages.map(r=>({...r,url:t(r.url),...r.range&&{range:{...r.range,file:t(r.range.file)}}}))}:e.streams}}function zee(){let e=new Uint8Array(0),t={list:new Int32Array(8),count:0,byteLength:8*Int32Array.BYTES_PER_ELEMENT,add(r){return r>=e.length&&(e=tt(e,r+1),t.byteLength=e.byteLength+t.list.byteLength),e[r]?!1:(e[r]=1,t.count===t.list.length&&(t.list=tt(t.list,t.count+1),t.byteLength=e.byteLength+t.list.byteLength),t.list[t.count++]=r,!0)},consume(r){let{list:n,count:o}=t;for(let i=0;i<r;i++)e[n[i]]=0;r<o&&n.copyWithin(0,r,o),t.count=o-r},clear(){let{list:r,count:n}=t;for(let o=0;o<n;o++)e[r[o]]=0;t.count=0}};return t}var GCe=256,jee=64;function HCe(e){for(let t=1;t<e.length;t++)if(e[t]<e[t-1])return!1;return!0}function WCe(e,t,r){return e.steps=tt(e.steps,r),e.gap=1+Math.floor(GCe/(t*4)),e.cap=jee,e}function zCe(e,t,r,n){let{gap:o,cap:i}=n;if(t<=0)return 0;let s=o,a=0;for(let u=1;u<t;u++){let d=e[u]-e[u-1];d<=o||(n.steps[a++]=d)}a>=i&&(s=n.steps.subarray(0,a).sort()[a-i]);let l=0,c=e[0];for(let u=1;u<=t;u++)u<t&&e[u]-e[u-1]<=s||(r[l*2]=c,r[l*2+1]=e[u-1],l++,u<t&&(c=e[u]));return l}function bd(e=0){let t=zee(),r=new Int32Array(0),n=new Int32Array(0),o=0,i=!0,s={gap:1,cap:0,steps:new Int32Array(0)},a=()=>{l.count=t.count,l.byteLength=t.byteLength+r.byteLength+n.byteLength+s.steps.byteLength},l={count:0,byteLength:t.byteLength,mark(c){t.add(c)&&(i=!1,a())},runs(){if(!i){let{count:c}=t;e?WCe(s,e,c):s.steps=tt(s.steps,c),s.cap=e?Math.min(jee,c):c,n=tt(n,2*s.cap);let u=t.list.subarray(0,c);HCe(u)||u.sort(),o=zCe(u,c,n,s),i=!0,a()}return{count:o,pairs:n}},take(){let{count:c}=t;r=tt(r,c);let u=r.subarray(0,c);return u.set(t.list.subarray(0,c)),u.sort(),l.clear(),a(),u},clear(){t.clear(),o=0,i=!0,a()}};return l}function Azt(e,t,r){if(!e.cells)throw new Error("PLACEMENT_ROWS_WITHOUT_CELLS");e.cells[t]=r,e.cellsMoved??=bd(),e.cellsMoved.mark(t)}function Ozt(e,t){let r=e.cellsMoved;if(r?.count)for(let n of r.take())t(n)||r.mark(n)}var LI=(e,t)=>e.cells?.[t],jCe=e=>e&&LI(e.rows,e.index),Lzt=e=>e&&(e.cell>=0||e.actor!==void 0)?e:void 0;function Rzt(e){let t=jCe(e);return t?t.instance:e?.index??0}var _zt=e=>e?e.actor??(e.proxy?0:-1):-1;var $Ce=new Set;function YCe(e,t=new Set){return e.traverse(r=>void t.add(r)),t}function KCe(e,t){let r=LI(t.rows,t.index);if(!r)return pm(t.rows.sources?.[t.index])??void 0;for(let n of Bt(e)){let o=n.parentOf(r,t.index);if(o)return o}return M.modelCopies.get()?.copiedAnchor(e,r)}function kE(e){for(let t=e.parent;t;t=t.parent)if(Wn(t))return t}function Kee(e,t){let r=G9(t);return r&&{node:r,anchor:n=>KCe(e,n)}}function qee(e,t){let r;for(let n=[e];n.length;){let o=n.pop();if(!t(o))YCe(o,r??=new Set);else for(let i of o.children)n.push(i)}return r??$Ce}var $ee=new WeakMap;function qCe(e){let t=$ee.get(e);return t||$ee.set(e,t=qee(e.scene.source,r=>r.visible)),t}var Yee=new WeakMap,XCe=(e,t)=>{if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0};function FE(e){let t=U9(e),r=Yee.get(e);if(r?.revision===t)return r.hides;let n=od(e),o=!1;for(let[s,a]of n)if(o=a.visible!==s.visible)break;let i=o?qee(e.record.scene.source,s=>n.get(s)?.visible??s.visible):qCe(e.record);return r?(r.revision=t,XCe(r.hides,i)||(r.hides=i),r.hides):(Yee.set(e,{revision:t,hides:i}),i)}var NE=new Float64Array(16),Xee=new Float64Array(16),QCe=new Float64Array(16),ZCe=new Float64Array(16),RI=new WeakMap;function JCe(e,t,r,n,o){let{object:i,local:s,shown:a,casting:l,distance:c}=e.copied(t,r),u=t.maxDrawDistance;return{source:e,object:i,rows:e.rows,local:s,live:n&&o&&a,casting:t.castShadow?l:l|sd,max:u>0?u:c}}var eIe=(e,t,r,n)=>r<=t&&n>=e-1?t:Tr(n+1,e,t),tIe=e=>M.modelCopies.arrived?M.modelCopies.get()?.copyData(e):void 0,rIe=(e,t,r)=>e<t&&(r?.kept(e)??!0);function _I(e,t,r,n,o){let i=tIe(t),s=dr(t),a=t.count,{array:l,count:c}=t.instanceMatrix,u=t.matrixWorld.elements,d=FE(t),f=e.rowed.map(x=>JCe(x,t,d,r,n(x))),h=i&&f.map(({local:x})=>i.centreIn(x)),m=M.modelCopies.get()?.cellRowsWriter(t,d,r,o),w=e.world;return(x,b)=>{let T=RI.get(t)??0,L=Math.max(0,x),_=Math.min(b,c-1,Math.max(a,T)-1),D=f.length*16+(m?.locals??0),C=o&&new Float64Array(Math.max(0,_-L+1)*D),j=0;for(let $=L;$<=_;$++){Ce(NE,l,0,$*16),w&&!o&&Ve(Xee,u,NE);let q=s+$,le=rIe($,a,i);for(let Ue=0;Ue<f.length;Ue++){let ye=f[Ue],Fe=C?C.subarray(j,j+=16):QCe;Ve(Fe,NE,ye.local),o&&o.push({rows:ye.rows,index:q,local:Fe});let Ye=o?null:Ve(ZCe,u,Fe);ye.source.draw(q,ye.object),Zi(ye.rows,q,Ye,ye.live&&le,ye.casting),Xl(ye.rows,q,ye.max,!0),i&&i.seat(ye.rows,q,$,h[Ue])}if(m&&(j=m.write($,NE,u,le,C,j,i)),!w)continue;let ge=l.subarray($*16,($+1)*16);o&&o.push({rows:w.rows,index:q,local:ge}),w.write(q,o?null:Xee,r&&le,!o)}return RI.set(t,eIe(T,a,L,_)),_}}function Qee(e,t){let r=dr(t),n=r+Oo(t);for(let i=0;i<e.rowed.length;i++)e.rowed[i].forget(r,n);e.world?.rows.live.fill(0,r,n);let o=M.modelCopies.get();o?.forgetCopies(t,e),o?.giveCellRows(t),RI.delete(t)}var nIe=new Float64Array(16),Ed=class e{rows;mesh;primitives;slot;cloth;base;variants=new Map;drawn;surface;left=!1;constructor(t,r,n){this.drawn=t,this.mesh=r.meshes,this.primitives=r.primitives,this.cloth=r.twoSided===!0,this.base=n,this.slot=n?n.slot:rd(t.material),this.rows=Bm(n?.rows.capacity??1),this.rows.local=!0;let o=Array.from({length:this.rows.capacity},()=>t);Um(this.rows,o),this.rows.sourceModels=new Set([t])}variant(t,r){let n=this.variants.get(t);if(n)return{source:n,made:!1};let o={meshes:this.mesh,primitives:this.primitives,twoSided:this.cloth},i=new e(this.drawn,o,this);return i.surface=r,this.variants.set(t,i),{source:i,made:!0}}shows(t){let r=t?.get(this.base??this),n=r&&!r.left?r:void 0;return this.base?n===this:n===void 0}leave(){this.left=!0;for(let[t,r]of this.base?.variants??[])r===this&&this.base.variants.delete(t)}get geometry(){return this.drawn.geometry}get attributes(){return this.drawn.geometry.attributes}get dynamic(){return this.drawn.geometry.usage==="dynamic"}get declaration(){return this.surface??this.drawn.material}get casting(){return bn(this.drawn)}wear(t){this.base?this.surface=t:this.drawn.material=t}localOf(t){return Eb(t,this.drawn)??this.drawn.matrixWorld.elements}copied(t,r){let{drawn:n}=this,o=wP(t,n),i=Bb(o);return{object:o,local:this.localOf(t),shown:!r.has(n),casting:yP(o,i),distance:i.maxDrawDistance}}grown(t){let r=this.rows.sources,n=xd(this.rows,t),o=Array.from({length:n.capacity},(i,s)=>r?.[s]??this.drawn);return Um(n,o),n}draw(t,r=this.drawn){let n=this.rows.sources;Zs(this.rows,n,t,t+1,r)}forget(t,r){this.rows.live.fill(0,t,r),Zs(this.rows,this.rows.sources,t,r,this.drawn)}write(t,r,n,o=!0,i){let{rows:s,drawn:a}=this,l=i?.model,c=l?wP(l,a):a;if(this.draw(t,c),o&&r){let f=l?this.localOf(l):a.matrixWorld.elements;s.matrices.set(Ve(nIe,r,f),t*16)}let u=Bb(c),d=n&&!i?.hides.has(a);Zi(s,t,null,d,yP(c,u)),Xl(s,t,u.maxDrawDistance,!1)}};var vI=class{rows;constructor(t){this.rows=Bm(t)}grown(t){return xd(this.rows,t)}write(t,r,n,o=!0){Zi(this.rows,t,o?r:null,n,0)}};function Zee(e,t){let r={meshes:(e.meshes??0)+t,primitives:e.primitives};return e.placements&&Object.defineProperty(r,"placements",{get:()=>e.placements}),r}function oIe(e,t){let{metadata:r,scene:n}=e,o=n.associations,i=t.model(e,()=>{let c=-1;for(let{mesh:u}of r.primitives)c=Math.max(c,u);for(let u of o.values())c=Math.max(c,u.meshes??-1);return c+1}),s=[],a=[];for(let c of nd(n.source)){let u=o.get(c);if(!u)s.push(IE(c));else if(u.placements)s.push(IE(c,Zee(u,i)));else{let d=new Ed(c,{...Zee(u,i),twoSided:u.twoSided});s.push(d),a.push(d)}}let l;return{offset:i,get primitives(){if(l)return l;let c=Hee(e.base);return l=r.primitives.map(u=>({...Wee(u,c),mesh:u.mesh+i}))},draws:s,get variants(){return a.filter(c=>c.base)},rowed:a,rowsHeld:1}}var Jee=e=>[...e.rowed,...e.world?[e.world]:[]];function iIe(e,t,r,n,o){if(r.has(n))return;let{record:i}=n,s=t.get(i);s||t.set(i,s=oIe(i,e));let a=dr(n),l=a+Oo(n),c=Jee(s),u=c.map(b=>b.rows),d=u.some(b=>b.capacity<l),f=d?Lr(It(u.map(b=>b.capacity)),l):0;if(d&&o&&!o.growsInPlace(u,f))return`the session grows no row for another placement of ${i.manifestUrl}`;let h=nn(n)?M.modelCopies.get()?.takeCellRows(n,o):void 0;if(h)return h;if(d)for(let b of c){let T=b.rows;T.capacity>=l||(b.rows=b.grown(f),o?.growPlacements(T,b.rows))}r.add(n),s.rowsHeld=Math.max(s.rowsHeld,l,It(c.map(b=>b.rows.capacity)));let m=()=>cP(n),w=b=>Eb(n,b),x=E7(n);for(let b of Bt(n))b.pose(m,a,w,x)}var ete=new Set,Gm=Hu({model:void 0,hides:ete});function sIe(e,t,r,n,o){let i=e.get(t.record),s=dr(t);if(li(he._treeOf(t.record.scene.source)),nn(t))return _I(i,t,r,d=>d.shows(n))(0,t.instanceMatrix.count-1),i;let a=t.matrixWorld.elements,l=!o?.(i,s),c=Gm.hides=FE(t);Gm.model=t;for(let u of i.rowed)u.write(s,a,r&&u.shows(n),l,Gm);Gm.model=void 0,Gm.hides=ete,i.world?.write(s,a,r,l);for(let u of Bt(t))u.show(r,c);return i}function tte(e){let t=new WeakMap,r=new WeakSet,n=new WeakMap,o=s=>(i.place(s),t.get(s.record)),i={...aIe(e,t,r),drawsOf:o,rootsOf:s=>cIe(s,o(s)),pose(s,a,l){if(r.has(s))return sIe(t,s,a,n.get(s),l)},copies:(s,a,l)=>r.has(s)?lIe(t,n,s,a,l):void 0,...uIe(t,n,o)};return i}function aIe(e,t,r){let n=new Set;return{place(o,i){let s=iIe(e,t,r,o,i);return!s&&nn(o)&&pP(o.record)&&n.add(o),s},joinCells(o,i){for(let s of n){if(pP(s.record))continue;n.delete(s);let a=Fb(s.record);i(s,a??M.modelCopies.get()?.takeCellRows(s,o))}},unplace(o){let i=t.get(o.record);if(!i||!r.delete(o))return;n.delete(o);let s=dr(o);if(nn(o))Qee(i,o);else for(let a of Jee(i))a.write(s,null,!1,!1);return i}}}function lIe(e,t,r,n,o){let i=e.get(r.record),s=t.get(r);return li(he._treeOf(r.record.scene.source)),{draws:i,write:_I(i,r,n,l=>l.shows(s),o)}}function cIe(e,t){let r=Bl(e);r.some(n=>n.dag)&&!t.world&&(t.world=new vI(t.rowsHeld));for(let n of r)n.drawnAs({pose:t.world});return r}function uIe(e,t,r){return{bases:n=>r(n).rowed.filter(o=>!o.base),variant(n,o,i,s){let a=o.variant(i,s);return a.made&&r(n).rowed.push(a.source),a},dress(n,o){o?.size?t.set(n,o):t.delete(n)},drop(n,o){let i=e.get(n)?.rowed??[],s=i.indexOf(o);s>=0&&i.splice(s,1),o.leave()}}}function qn(e,t,r=!1){if(!r)return t===null||Dn(e,t);for(let n=e;n;n=n.parent){if(!n.visible)return!1;if(n===t)return!0}return t===null}function MI(e,t,r){let n=e===t||void 0,o=!0;for(let i=e.parent;i;i=i.parent){if(r?.has(i))return null;o&&=i.visible,i===t&&(n??=o)}return n}var BE=(e,t)=>(MI(e,t)??void 0)&&e.visible;var Hm=class{list=[];count=0;at=new Int32Array(0);sharing=null;has(t){let{at:r}=this,n=t.index,o=n<r.length?r[n]:0;return o?this.list[o-1]===t||this.sharing!==null&&this.sharing.has(t):!1}add(t){let r=t.index;r>=this.at.length&&(this.at=tt(this.at,r+1));let n=this.at[r];if(!n)this.at[r]=this.count+1;else{if(this.list[n-1]===t)return!1;if((this.sharing??=new Set).has(t))return!1;this.sharing.add(t)}return this.list[this.count++]=t,!0}clear(){let{at:t,list:r}=this;for(let n=0;n<this.count;n++)t[r[n].index]=0,r[n]=null;this.count=0,this.sharing?.clear()}};var Ji=[],ea=(e,t,r)=>r&&!(e.held.size&&e.held.has(t));function es(e,t,r,n){if(!t.rows)return;let o=e.ranges.get(t);if(!o||o.rows!==t.rows){let i=e.marks.get(t);i||e.marks.set(t,i=bd()),i.clear(),e.ranges.set(t,o={rows:t.rows,marks:i,whole:!1})}if(r===0&&n===t.rows.capacity-1)o.whole=!0;else if(!o.whole)for(let i=r;i<=n;i++)o.marks.mark(i)}function ts(e,t){return e.composed.delete(t)?(e.dropped.add(t),!0):!1}function Xn(e,t){e.instances.get(t)?.clear(),e.instances.delete(t)}var Wm=-1,rte=[0,5,10,12,13,14],Ql=1,UE=2,Td=4,dIe=-2,ta={pairs:new Int32Array(64),count:0},rs=new Int32Array(64),ns=new Uint8Array(64),zm=new Int32Array(64),Ad=new Int32Array(64),nte=new Int32Array(2);function fIe(e,t){let r=2;for(;r<2*t;)r*=2;let n=new Int32Array(t);for(let o=0;o<t;o++)n[o]=t-1-o;return{bits:new Uint32Array(e.buffer,e.byteOffset,t*16),words:new Uint32Array(t*16),group:new Int32Array(t).fill(-1),next:new Int32Array(t),prev:new Int32Array(t),head:new Int32Array(t),size:new Int32Array(t),hash:new Int32Array(t),counted:new Int32Array(t),leaving:new Int32Array(t),taken:new Int32Array(t),spare:n,free:t,buckets:new Int32Array(r),write:0}}function ite(e,t,r,n){for(let o=0;o<16;o++)if(e[t+o]!==r[n+o])return!1;return!0}function pIe(e,t){let r=-2128831035;for(let n=0;n<rte.length;n++)r=Math.imul(r^e[t+rte[n]],16777619);return r^r>>>16}function ste(e,t,r,n){let o=e.buckets.length-1,i=n&o;for(;e.buckets[i];){let s=e.buckets[i]-1;if(e.hash[s]===n&&ite(t,r,e.words,e.head[s]*16))return s;i=i+1&o}return-1}function hIe(e,t){let{buckets:r,hash:n}=e,o=r.length-1,i=n[t]&o;for(;r[i]!==t+1;)i=i+1&o;let s=i+1&o;for(;r[s];){let a=r[s],l=n[a-1]&o;(i<=s?l<=i||l>s:l<=i&&l>s)&&(r[i]=a,i=s),s=s+1&o}r[i]=0}function mIe(e,t){let r=e.group[t],n=e.prev[t],o=e.next[t];n>=0?e.next[n]=o:e.head[r]=o,o>=0&&(e.prev[o]=n),e.group[t]=-1,!(--e.size[r]>0)&&(hIe(e,r),e.spare[e.free++]=r)}function gIe(e,t,r){let n=ste(e,e.words,t*16,r);if(n<0){n=e.spare[--e.free],e.size[n]=0,e.hash[n]=r,e.head[n]=-1,e.counted[n]=e.taken[n]=0;let i=e.buckets.length-1,s=r&i;for(;e.buckets[s];)s=s+1&i;e.buckets[s]=n+1}let o=e.head[n];e.next[t]=o,e.prev[t]=-1,o>=0&&(e.prev[o]=t),e.head[n]=t,e.group[t]=n,e.size[n]++}function SIe(e,t,r){e.counted[t]!==r&&(e.counted[t]=r,e.leaving[t]=0),e.leaving[t]++}var wIe=(e,t,r)=>e.taken[t]===r||e.size[t]>(e.counted[t]===r?e.leaving[t]:0);function ote(e,t){let r=ta.count*2;ta.pairs=tt(ta.pairs,r+2),ta.pairs[r]=e,ta.pairs[r+1]=t,ta.count++}function yIe(e){rs.length>=e||(rs=tt(rs,e),ns=tt(ns,e),zm=tt(zm,e),Ad=tt(Ad,e))}var ate=e=>!!(e&UE)&&(!!(e&Ql)||!(e&Td)),xIe=e=>!!(e&Td)&&(!!(e&Ql)||!(e&UE));function bIe(e,t,r){let n=t*16,o=e.group[t]>=0,i=!ite(e.bits,n,e.words,n);return!i&&o===r?0:(i?Ql:0)|(o?UE:0)|(r?Td:0)}function EIe(e,t,r){let n=rs[t],o=ns[t],i=n*16;if(ate(o)&&SIe(e,e.group[n],r),Ad[t]=dIe,!(o&Td)||(zm[t]=pIe(e.bits,i),!(o&Ql)))return;let s=ste(e,e.bits,i,zm[t]);s<0||(Ad[t]=e.head[s],e.taken[s]=r)}function TIe(e,t,r,n,o){let i=e.group.length,s=0;for(let a=0;a<n;a++){let l=Math.min(r[2*a+1],i-1);for(let c=Math.max(0,r[2*a]);c<=l;c++){let u=bIe(e,c,c<t);u&&(yIe(s+1),rs[s]=c,ns[s]=u,EIe(e,s,o),s++)}}return s}function AIe(e,t,r){for(let n=0;n<t;n++){if((ns[n]&(Td|Ql))!==(Td|Ql))continue;let o=rs[n];Ad[n]>=0?ote(o,Ad[n]):(!(ns[n]&UE)||wIe(e,e.group[o],r))&&ote(o,Wm)}}function OIe(e,t){for(let r=0;r<t;r++)ate(ns[r])&&mIe(e,rs[r]);for(let r=0;r<t;r++){if(!(ns[r]&Ql))continue;let n=rs[r]*16;for(let o=0;o<16;o++)e.words[n+o]=e.bits[n+o]}for(let r=0;r<t;r++)xIe(ns[r])&&gIe(e,rs[r],zm[r])}function VE(e,t,r,n,o){ta.count=0;let i=e.get(t),s=!i;i||(i=fIe(t.instanceMatrix.array,t.instanceMatrix.count),e.set(t,i));let a=++i.write,l=TIe(i,r?t.count:0,n,o,a);return s||AIe(i,l,a),OIe(i,l),ta}function Od(e,t,r){return nte[1]=t.instanceMatrix.count-1,VE(e,t,r,nte,1)}function GE(e,t,r,n){r.count&&e.push({holder:t,pairs:r.pairs.slice(0,r.count*2),draws:n})}var _o=new Int32Array(64);function ra(e,t,r,n){let{count:o,pairs:i}=n;_o=tt(_o,o*2);for(let s=0;s<o;s++){let a=i[2*s+1];_o[2*s]=r+i[2*s],_o[2*s+1]=a===Wm?Wm:r+a}e(t,_o,o)}var lte={pairs:new Int32Array(0),count:0};function cte(e,t,r,n,o){_o=tt(_o,o*2);for(let i=0;i<o;i++)_o[2*i]=t.row+i,_o[2*i+1]=r.row+i;for(let i=0;i<n.count;i++){let s=n.pairs[2*i+1];_o[2*n.pairs[2*i]+1]=s===Wm?Wm:r.row+s}e(t.batch.rows,_o,o,r.batch.rows)}var os=new Float64Array(16);function LIe(e){let t=Fr(e[0],e[1],e[2]),r=Fr(e[4],e[5],e[6]),n=Math.max(t,r);os.fill(0),os[0]=t,os[5]=r,os[8]=n-t,os[9]=n-r,os[10]=n;for(let o=12;o<15;o++)os[o]=e[o];return os[15]=1,os}var ute=new Float64Array(16),RIe=new Float64Array(16);function jm(e,t,r){return Ce(ute,t.instanceMatrix.array,0,r*16),Ve(e,t.matrixWorld.elements,ute)}function $m(e,t,r,n,o,i){let s=r.batch.rows,a=Math.min(i,t.instanceMatrix.count-1);if(!s||r.row<0||a<o)return;let l=pt(t),c=bn(t,l),u=l.maxDrawDistance,d=t.count;for(let f=o;f<=a;f++)Zi(s,r.row+f,jm(RIe,t,f),n&&f<d&&t.getVisibleAt(f),c),Xl(s,r.row+f,u,!0);es(e,r.batch,r.row+o,r.row+a)}function Ym(e,t,r,n,o){let i=ea(e,t,n);if(We(t)){Xn(e,t);let s=Od(e.slots,t,i);o?dte(e,t,r,o,s):GE(e.heldMoves,t,s)}else o&&dte(e,t,r,o,lte);DI(e,t,r,i),HE(e,t)}function dte(e,t,r,{from:n,follow:o},i){if(!(!r.batch.rows||r.row<0||!n.batch.rows||n.row<0)&&(cte(o,r,n,i,Js(t)),!!i.count))for(let{batch:s,row:a}of e.movesOf(t))s.rows&&a>=0&&ra(o,s.rows,a,i)}var fte=(e,t,r)=>DI(e,t,r,!1);function HE(e,t,r=0,n=1/0){let o=e.movesOf(t);for(let i=0;i<o.length;i++)We(t)?$m(e,t,o[i],!1,r,n):DI(e,t,o[i],!1)}function DI(e,t,r,n){if(We(t))return $m(e,t,r,n,0,t.instanceMatrix.count-1);let o=r.batch.rows;if(!o||r.row<0)return;let i=t.matrixWorld.elements,s=t.primitive==="sprite"?LIe(i):i,a=pt(t);Zi(o,r.row,s,n,bn(t,a)),Xl(o,r.row,a.maxDrawDistance,!1),es(e,r.batch,r.row,r.row)}var hte=(e,t,r)=>e.composed.get(t)===r&&e.composedCasting.get(t)===xP(t)&&e.composedDistance.get(t)===pt(t).maxDrawDistance;function mte(e,t,r){e.composed.set(t,r),e.composedCasting.set(t,xP(t)),e.composedDistance.set(t,pt(t).maxDrawDistance)}function Ld(e,t,r,n,o){let{models:i,composer:s}=t,a=ea(e,r,n);if(nn(r))return _Ie(e,t,r,a,o);if(o&&s&&hte(e,r,a)){s.link(r,r.matrixWorld.elements,Ji,!1);return}let l=!1,c=i.pose(r,a,s&&((u,d)=>{let f=u.rowed.map(h=>({rows:h.rows,index:d,local:h.localOf(r)}));return u.world&&f.push({rows:u.world.rows,index:d,local:Or}),f.length?(l=s.link(r,r.matrixWorld.elements,f,!0)!==!1,l):!1}));Rd(e,r,c),l?mte(e,r,a):ts(e,r)}function _Ie(e,t,r,n,o){let{models:i,composer:s}=t;if(o&&s&&hte(e,r,n))return void s.link(r,r.matrixWorld.elements,Ji,!1);Xn(e,r);let a=Od(e.slots,r,n),l=s&&[],c=pte(e,i,r,n,l);if(t.follow?WE(t,r,c,a):c&&GE(e.heldMoves,r,a,c),!s||!l?.length)return void ts(e,r);if(s.link(r,r.matrixWorld.elements,l,!0)!==!1)return mte(e,r,n);pte(e,i,r,n),ts(e,r)}function pte(e,t,r,n,o){let i=t.copies(r,n,o);if(!i)return;let s=i.write(0,r.instanceMatrix.count-1);return Rd(e,r,i.draws,0,s),i.draws}var gte=Hu({send:void 0}),PI=new Int32Array(2);function vIe(e,t,r){e.rows&&(PI[0]=t,PI[1]=r,gte.send(e.rows,PI,1))}function WE(e,t,r,n){let{follow:o}=e;if(!o||!r||!n.count)return;let i=dr(t);for(let a=0;a<r.rowed.length;a++)ra(o,r.rowed[a].rows,i,n);r.world&&ra(o,r.world.rows,i,n);let s=M.modelCopies.get();if(s){gte.send=o;for(let a=0;a<n.count;a++)s.eachCellRowMoved(t,n.pairs[2*a],n.pairs[2*a+1],vIe)}}function Rd(e,t,r,n=0,o=Oo(t)-1){let i=dr(t);if(o<n)return;for(let a of r?.rowed??[])es(e,a,i+n,i+o);r?.world&&es(e,r.world,i+n,i+o),(r&&M.modelCopies.get())?.eachCellRow(t,n,o,(a,l)=>es(e,a,l,l))}function Ste(e,t,r){let n=[];for(let o of e){let i=t.get(o);if(!i||!i.batch.rows||i.row<0||o.children.length||o.primitive==="sprite"||We(o))return null;o.worldMatrix,n.push({rows:i.batch.rows,index:i.row,local:o._matrixElements}),MIe(n,r(o),o._matrixElements)}return n}function MIe(e,t,r){for(let n=0;n<t.length;n++){let{batch:o,row:i}=t[n];o.rows&&i>=0&&e.push({rows:o.rows,index:i,local:r})}}function wte(e,t,r,{seats:n,composer:o}){let i=t.children.length?Ste(t.children,n,e.movesOf):null;if(!(!i||!o||o.link(t,t.matrixWorld.elements,i,!0)===!1)){e.composed.set(t,r);for(let s of t.children)s._setWorldLazy(!0)}}function CI(e){if(e._alive)for(let t of e.children)t._setWorldLazy(!1)}function yte(e,t,r,n){let{seats:o,composer:i}=n,s=e.movedUnder.get(t)??Ji,a=e.composed.get(t)===r?Ste(s,o,e.movesOf):null;if(i&&a){i.link(t,t.matrixWorld.elements,a,!1);for(let l of s)Ym(e,l,o.get(l),r&&l.visible);return!0}return ts(e,t),!1}function II(e,t,r,n,o){let{follow:i}=t;if(!i||!o.count)return;n.batch.rows&&n.row>=0&&ra(i,n.batch.rows,n.row,o);let s=e.movesOf(r);for(let a=0;a<s.length;a++){let{batch:l,row:c}=s[a];l.rows&&c>=0&&ra(i,l.rows,c,o)}}function bte(e,t){for(let{holder:r,pairs:n,draws:o}of e.heldMoves){let i={pairs:n,count:n.length/2},s=o?void 0:t.seats.get(r);o?WE(t,r,o,i):s&&II(e,t,r,s,i)}e.heldMoves.length=0}function xte(e,t,r,n){let o=t.batch.rows,i=e.instanceMatrix.array,s=[];for(let a=r;a<=n;a++)s.push({rows:o,index:t.row+a,local:i.subarray(a*16,a*16+16)});return s}function Ete(e,t,r,n,o,i){Ht(t,xte(r,n,o,i));let s=e.movesOf(r);for(let a=0;a<s.length;a++)s[a].batch.rows&&s[a].row>=0&&Ht(t,xte(r,s[a],o,i));return t}function Tte(e,t,r,n,o){let i=r.instanceMatrix.count-1,s=r;Xn(e,s),r.instanceMatrix.clearUpdateRanges(),II(e,t,r,n,Od(e.slots,r,o)),$m(e,r,n,o,0,i),HE(e,s);let{composer:a}=t,l=r.matrixWorld.elements;if(!a||i<0||a.link(r,l,Ete(e,[],r,n,0,i),!0)===!1){ts(e,r);return}let c=pt(r);e.composed.set(r,o),e.composedCasting.set(r,bn(r,c)),e.composedDistance.set(r,c.maxDrawDistance)}function Ate(e,t,r,n,o){if(!n.batch.rows||n.row<0)return;let i=ea(e,r,o),{composer:s}=t,a=pt(r);if(!(s&&e.composed.get(r)===i&&e.composedCasting.get(r)===bn(r,a)&&e.composedDistance.get(r)===a.maxDrawDistance))return Tte(e,t,r,n,i);s.link(r,r.matrixWorld.elements,Ji,!1)}function Ote(e,t,r,n){if(!We(t)&&!nn(t))return;if(r<=0&&n>=t.instanceMatrix.count-1)return void e.instances.set(t,null);let o=e.instances.get(t);if(o!==null){o||(o=e.instanceMarks.get(t)??bd(),e.instanceMarks.set(t,o),e.instances.set(t,o));for(let i=r;i<=n;i++)o.mark(i)}}function DIe(e,t,r,n){let o=e.instances.get(r);if(o===void 0)return;if(o===null)return Ld(e,t,r,n,!1);let{composer:i}=t,s=i&&e.composed.has(r)?[]:void 0,a=t.models.copies(r,n,s),{count:l,pairs:c}=o.runs(),u=VE(e.slots,r,n,c,l);WE(t,r,a?.draws,u);for(let d=0;a&&d<l;d++){let f=c[2*d];Rd(e,r,a.draws,f,a.write(f,c[2*d+1]))}Xn(e,r),s?.length&&i.link(r,r.matrixWorld.elements,s,!1)}function PIe(e,t,r,n,o){let i=r,s=e.instances.get(i);if(s===void 0)return;if(s===null)return Tte(e,t,r,n,o);r.instanceMatrix.clearUpdateRanges();let{count:a,pairs:l}=s.runs();II(e,t,r,n,VE(e.slots,r,o,l,a));let c=[];for(let d=0;d<a;d++){let f=l[2*d],h=l[2*d+1];$m(e,r,n,o,f,h),HE(e,i,f,h),Ete(e,c,r,n,f,h)}Xn(e,i);let{composer:u}=t;u&&e.composed.has(r)&&c.length&&u.link(r,r.matrixWorld.elements,c,!1)}function Lte(e,t,r){for(let n of[...e.instances.keys()]){let o=n._alive?BE(n,t):void 0,i=r.seats.get(n);o===void 0?Xn(e,n):nn(n)?DIe(e,r,n,ea(e,n,o)):i?.batch.rows&&i.row>=0&&We(n)?PIe(e,r,n,i,ea(e,n,o)):Xn(e,n)}}var CIe=new Map,Km=Wn,IIe=[],kIe=(e,t,r)=>({moved:new Hm,posedModels:new Hm,ranges:new Map,marks:new WeakMap,composed:new Map,dropped:new Set,movedUnder:new Map,composedKey:void 0,composedEpoch:-1,instances:new Map,instanceMarks:new WeakMap,slots:new WeakMap,heldMoves:[],held:e,keeps:t,composedCasting:new WeakMap,composedDistance:new WeakMap,movesOf:r}),zE=e=>Km(e)||We(e);function Rte({held:e=new Set,keeps:t=()=>!1,movesOf:r=()=>IIe}={}){let n=kIe(e,t,r),o=(i,s,a)=>es(n,i,s,a);return W({touch:(i,s)=>o(i,s,s),...FIe(n),touchRange:o,writeSeat:(i,s,a,l)=>Ym(n,i,s,a,l),writeHidden:(i,s)=>fte(n,i,s),moved(i){n.moved.add(i)},instances:(i,s,a)=>Ote(n,i,s,a),structure:i=>NIe(n,i),get pending(){return n.moved.count>0||n.ranges.size>0||n.instances.size>0},apply(i,s,a,l,c,u){UIe(n,c);let d={seats:s,models:a,composer:c,follow:u};bte(n,d),n.moved.count&&VIe(n,i,d),Lte(n,i,d),HIe(n,l,c)},settle:()=>BIe(n)})}function FIe(e){return{writeModel(t,r,n){Ld(e,{seats:CIe,models:t,composer:void 0},r,n,!1),e.moved.add(r)},forgetModel(t,r){Rd(e,r,t.unplace(r)),ts(e,r)}}}function NIe(e,t){e.composed.delete(t)&&(e.dropped.add(t),e.moved.add(t))}function BIe(e){e.ranges.clear();for(let t of[...e.instances.keys()])Xn(e,t);e.heldMoves.length=0}function kI(e,t,r,n,o){let i=r&&t.visible,s=n.seats.get(t);s&&We(t)?Ate(e,n,t,s,i):s&&Ym(e,t,s,i),Km(t)&&Ld(e,n,t,i,!0);let a=zE(t),l=!a&&e.composed.has(t);if(l&&yte(e,t,i,n))return;let{children:c}=t;for(let u=0;u<c.length;u++)kI(e,c[u],i,n,!1);!a&&n.composer&&(o||l)&&wte(e,t,i,n)}function UIe(e,t){let{composed:r}=e,n=!!t&&t.key===e.composedKey?.deref();if(r.size&&(!n||t?.epoch!==e.composedEpoch))for(let o of r.keys())n&&Km(o)&&e.keeps(o)||(r.delete(o),e.moved.add(o),e.dropped.add(o),zE(o)||CI(o));n||(e.composedKey=t&&new WeakRef(t.key)),e.composedEpoch=t?.epoch??-1}function VIe(e,t,r){let{moved:n,movedUnder:o,composed:i}=e;li(he._treeOf(t));for(let s=0;s<n.count;s++){let a=n.list[s],l=a._alive?a.parent:null;if(!l||!i.has(l)||zE(l))continue;let c=o.get(l);c?c.push(a):o.set(l,[a])}for(let s of o.keys())n.add(s);GIe(e,t,r),n.clear(),o.clear()}function GIe(e,t,r){let{moved:n,posedModels:o}=e;o.clear();for(let i=0;i<n.count;i++){let s=n.list[i];if(!s._alive)continue;XD(s);let a=Km(s)?void 0:kE(s);a&&o.add(a);let l=MI(s,t,n);l!==null&&(l!==void 0?kI(e,s,l,r,s!==t):!Km(s)&&e.dropped.has(s)&&kI(e,s,qn(s,null,!0),r,!1))}for(let i=0;i<o.count;i++){let s=o.list[i],a=BE(s,t);a!==void 0&&Ld(e,r,s,a,!1)}o.clear()}function HIe(e,t,r){for(let n of e.dropped)e.composed.has(n)||(r?.link(n,Ji,Ji,!0),zE(n)||CI(n));e.dropped.clear();for(let[n,o]of e.ranges){if(n.rows!==o.rows)continue;if(o.whole){t(o.rows,[0,o.rows.capacity-1],1);continue}let{count:i,pairs:s}=o.marks.runs();t(o.rows,s,i)}e.ranges.clear()}var _te=()=>Promise.reject(new Error("a partition no session lends to decodes nothing")),vte={bytes:()=>{},decode:_te,decodePage:_te,failed:()=>!1,request(){},admit(){},forget(){},update(){}};var WIe=()=>({destroyed:!1,forgotten:!1,joins:0,owed:!1});function Dte(e,t,r,n){let o=Bt(e);if(!r)return void(t.owed=!zIe(e,o,n));try{r.leavePartitions?.(o)}catch{return}t.owed=!1}function zIe(e,t,r){let n=!0;for(let o of t)try{o.close(vte)}catch(i){n=!1,r(`the cells of ${e.record.manifestUrl}`,`not let go: ${String(i)}`)}return n}var Mte=(e,t)=>void(t.owed||=Bt(e).length>0);function jIe(e,t,r,n,o){return t.owed&&!t.joins&&(r||!n)&&Dte(e,t,r,o),t.joins||t.owed||t.destroyed&&!t.forgotten?!1:(t.destroyed&&Ib(e),!0)}function $Ie(e,t){for(let[r,n]of e)n.owed&&!n.joins&&Dte(r,n,void 0,t)}function Pte(e,t,r){let n=new Map,o,i=!1,s=c=>yo(n,c,WIe),a=c=>o&&t(c)?o:void 0,l=(c,u)=>jIe(c,u,a(c),i,r)&&n.delete(c);return{joined:c=>void s(c).joins++,ended(c,u){let d=s(c);d.joins--,(d.destroyed||u)&&Mte(c,d),l(c,d)},told(c){let u=s(c);u.destroyed=!0,Mte(c,u)},forget(c){c&&(o=c,i=!1);for(let[u,d]of n)d.destroyed&&!d.forgotten&&e(u),d.forgotten||=d.destroyed,l(u,d)},closed(c=!1){o=void 0,i=c,$Ie(n,r)}}}var Cte=new WeakMap,FI=new WeakMap;function jE(e){let t=Cte.get(e);if(!t){let r=KIe(e);YIe(e,r.leave),Cte.set(e,t=r.find)}return t}function YIe(e,t){let r=FI.get(e);r?r.push(t):FI.set(e,[t])}function A$t(e,t){let r=e.indexOf(t);if(r<0)return!1;e.splice(r,1);for(let n of FI.get(e)??[])n(r,t);return!0}function KIe(e){let t=new Map,r=s=>{if(Number.isNaN(s.mesh)||Number.isNaN(s.primitive))return;let a=t.get(s.mesh);a||t.set(s.mesh,a=new Map),a.has(s.primitive)||a.set(s.primitive,s)},n=0;return{find:s=>{for(;n<e.length;)r(e[n++]);let a=s?.meshes,l=s?.primitives??0;if(!(Number.isNaN(a)||Number.isNaN(l)))return t.get(a)?.get(l)},leave:(s,a)=>{if(s>=n)return;n--;let l=t.get(a.mesh);if(l?.get(a.primitive)===a){l.delete(a.primitive),l.size||t.delete(a.mesh);for(let c=0;c<n;c++){let u=e[c];if(!(u.mesh!==a.mesh||u.primitive!==a.primitive)){r(u);return}}}}}}function O$t(e){let t=e?.meshes,r=e?.primitives??0;if(!(t===void 0||Number.isNaN(t)||Number.isNaN(r)))return`${t}/${r}`}var Ite=(e,t)=>Bt(e).length&&!t.preparePartitions?"the session follows no partition added to it":void 0,qIe=(e,t)=>t.addPlacements?Ite(e,t):"the session takes no source in place";async function kte(e,t,r,n,o){let i=[t,r],s=a=>(NI(e,i,n,`the model ${t.record.manifestUrl}`,a,!0),!1);e.fates.joined(t);try{await XIe(e,t,r,n,o,s)}catch(a){s(String(a))}finally{let a=r.state==="refused"&&r.primed===!0&&e.held.get(t)===r;e.fates.ended(t,a)}}async function XIe(e,t,r,n,o,i){let{held:s,records:a,models:l,write:c,settle:u}=e,d=Bt(t),f=a.get(t.record);if(f){if(!await f)return void(t._alive&&i("the session refused the model it places again"));if(!t._alive||s.get(t)!==r)return;let x=Ite(t,n);if(x)return void i(x);let b=l.place(t,n);return b?void i(b):(c(t),d.length&&await n.preparePartitions(d,[],!0),u(t,r,n,o))}let{promise:h,resolve:m}=uo();a.set(t.record,h);let w=!1;try{w=await ZIe(e,t,r,n,o,d,i)}finally{m(w),!w&&a.get(t.record)===h&&a.delete(t.record)}}function NI(e,[t,r],n,o,i,s=!1){let a=ql(n,i);return!a||e.held.get(t)!==r?!1:(s&&(r.state="refused"),e.refused(o,a),!0)}var BI=(e,t,r)=>{let n=t({meshes:r.mesh,primitives:r.primitives});return n?e.addPlacements(r,n):`no primitive for mesh ${r.mesh}/${r.primitives??0}`};async function QIe(e,t,r,[n,o],i){let s=t[0].record.manifestUrl,a=[];for(let l of n){let c=await BI(r,o,l);if(c){if(!ql(r,c))return!1;a.push([`the mesh ${l.mesh}/${l.primitives??0} of ${s}`,c])}}return a.length&&a.length===n.length?i(a[0][1]):a.every(([l,c])=>NI(e,t,r,l,c))}async function ZIe(e,t,r,n,o,i,s){let{models:a,write:l,settle:c}=e,u=e.openings,d=[t,r];try{let f=qIe(t,n);if(f)return s(f);let{primitives:h,draws:m}=a.drawsOf(t),w=a.rootsOf(t);l(t),n.addTextureCaches?.(t.record.scene.textureCaches);let x=jE(h);if(i.length&&(await n.preparePartitions(i,w),r.primed=!0,e.openings===u&&e.primed.add(t.record)),!await QIe(e,d,n,[m,x],s))return!1;for(let b of w){let T=await n.addWorldRoots?.(b);if(!T)continue;let L=`the world DAG of ${t.record.manifestUrl}`;if(!NI(e,d,n,L,T))return!1}}catch(f){return s(String(f))}return c(t,r,n,o),!0}function $E(e,t,r,n,o){let i=Bt(t);r.state=o?"parked":"shown",e(t),i.length&&(o?n.leavePartitions?.(i):n.followPartitions?.(i))}function Fte(e){let{poses:t}=e,r=eke(e),n=new Set,{held:o,records:i,fates:s}=r;return{opened(a){s.closed(!0),s.forget(),o.clear(),i.clear(),r.primed=new WeakSet,r.openings++;for(let l of a)o.set(l,{state:"shown"}),i.set(l.record,Promise.resolve(!0))},...JIe(r,t),dispose(){s.closed(),s.forget()},get flying(){return ki(n)},reconcile:(a,l,c)=>tke(r,n,a,l,c),record:a=>i.get(a)}}function JIe(e,t){let{held:r,models:n,fates:o}=e;return{told(i){t.forgetModel(n,i);for(let s of Bt(i))s.show(!1);o.told(i)},shown:i=>r.get(i)?.state==="shown",arrival(i,s,a){let l=M.modelArrival.get(),c=r.get(i)?.state;return c!=="shown"?c==="refused"?"whole":"coming":l?.drawnWhole(n.drawsOf(i),i,s,a)?"whole":"drawn"},park(i,s){let a=r.get(i);a?.state==="shown"&&$E(e.write,i,a,s,!0)}}}function eke({scene:e,models:t,poses:r,refused:n}){let o=new Map,i=new Map,s=l=>{l.updateWorldMatrix(!0,!1),r.writeModel(t,l,qn(l,e,!0))},a={held:o,records:i,primed:new WeakSet,openings:0,models:t,refused:n,write:s,fates:Pte(l=>o.delete(l),l=>i.has(l.record)||a.primed.has(l.record),n),settle:(l,c,u,d)=>{l._alive&&o.get(l)===c&&$E(s,l,c,u,!d.has(l))}};return a}function tke(e,t,r,n,o){let{held:i,write:s,fates:a}=e;if(a.forget(n),!!n){e.models.joinCells(n,(l,c)=>{c?e.refused(`the copies of ${l.record.manifestUrl}`,c):i.get(l)?.state!=="refused"&&!o?.(l)&&s(l)});for(let l of r){let c=i.get(l);if(c)c.state==="parked"&&$E(s,l,c,n,!1);else{let u={state:"joining"};i.set(l,u);let d=kte(e,l,u,n,r).finally(()=>t.delete(d));t.add(d)}}for(let[l,c]of i)!r.has(l)&&c.state==="shown"&&!o?.(l)&&$E(s,l,c,n,!0)}}var rke=(e,t,r)=>t.traverse(n=>{if(e.known.set(n,n.children),e.lit||=Ao(n),n instanceof zs&&e.placedObjects.add(n),n.isMesh){let o=Bte(e,n);o?o.add(n):e.meshes.has(n)||(e.meshes.add(n),r.added.push(n))}n.isLoadedModel&&!e.models.has(n)&&(e.models.add(n),r.entered.push(n),e.listed(n))});function Nte(e,t,r){let n=e.known.get(t)??[];e.known.delete(t),e.lit||=Ao(t),e.meshes.delete(t)&&r.removed.push(t),e.volumes.delete(t),e.decals.delete(t),e.placedObjects.delete(t),e.retyped.delete(t),e.models.delete(t)&&r.left.push(t);for(let o of n)Nte(e,o,r)}var Bte=(e,t)=>_b(t)?e.volumes:vb(t)?e.decals:void 0;function nke(e,{added:t,removed:r}){let{meshes:n,volumes:o,decals:i,retyped:s}=e;for(let a of s){let l=Bte(e,a),c=o.delete(a),u=i.delete(a);l?(n.delete(a)&&r.push(a),l.add(a)):(c||u)&&(n.add(a),t.push(a))}s.clear()}function oke(e,t,r){for(let{before:n,now:o}of t){let i=new Set(o);for(let s of n)i.has(s)||Nte(e,s,r)}for(let{parent:n,inScene:o,before:i,now:s}of t){if(!o)continue;let a=new Set(i);for(let l of s)a.has(l)||rke(e,l,r);e.known.set(n,s)}}function ike(e,t,r){let{known:n,meshes:o,models:i}=e,s={added:[],removed:[],entered:[],left:[]};e.lit=!1;let a=[...t].map(m=>{let w=m._alive&&r(m);return{parent:m,inScene:w,before:n.get(m)??[],now:w?m.children:[]}});t.size&&e.shape++,t.clear(),oke(e,a,s),nke(e,s);let{entered:l,left:c,added:u,removed:d}=s,f=u.length&&d.length?new Set(d):void 0,h=l.length&&c.length?new Set(c):void 0;return{added:f?u.filter(m=>!f.has(m)):u,moved:f?u.filter(m=>f.has(m)):[],removed:d.filter(m=>!o.has(m)),lights:e.lit,models:{added:h?l.filter(m=>!h.has(m)):l,removed:c.length?c.filter(m=>!i.has(m)):c}}}function Ute(e,t){let r={known:new Map,meshes:new Set,models:new Set,volumes:new Set,decals:new Set,placedObjects:new Set,retyped:new Set,lit:!1,shape:0,listed:t},{known:n,meshes:o,models:i,volumes:s,decals:a,retyped:l}=r,c=new Set,u=d=>qn(d,e);return W({meshes:o,volumes:s,decals:a,placedObjects:r.placedObjects,models:i,get pending(){return c.size>0||l.size>0},get shape(){return r.shape},retype(d){(o.has(d)||s.has(d)||a.has(d))&&l.add(d)},drop(d){return i.delete(d)?(r.shape++,!0):!1},changed(d){c.add(d)},entered(d){n.has(d)&&c.add(d)},take:()=>ike(r,c,u)})}function Vte(e,t){for(let r=t;r;r=r.parent)if(e.has(r))return!0;return!1}var YE=e=>{let t=Oo(e);return{graph:e.record.scene.source,placement:dr(e),...t===1?{}:{placements:t}}};function ske(e,t){if(!t.length)return t;let r=new Set(t),n;for(let o of e)Vte(r,o)&&(n??=[...t]).push(YE(o));for(let o of t){let i=kE(o);if(!i||Vte(r,i))continue;let s=Kee(i,o);s&&(n??=[...t]).push({...YE(i),keeps:s})}return n??t}var Gte=e=>W({of:t=>ske(e.models,t),get revision(){return e.shape}});function ake(e,t){if(e.disposed)return;let r=e.made=t.createWorldAssemblies(e.parts);for(let[n,{batch:o}]of e.parts.batches.seats)r.seated(n,o)}var Hte=e=>!!e.cut.runtime.roots&&!e.cut.dynamic;function lke(e){if(!e.disposed){for(let{batch:t}of e.parts.batches.seats.values())if(Hte(t))return void e.family.get()}}function Wte(e,t=M.assemblies){let r={parts:e,family:t,made:void 0,disposed:!1};return t.waitArrival(r,ake,lke),{owns:n=>r.made?.owns(n)??!1,seated(n,o){r.made?r.made.seated(n,o):!r.disposed&&Hte(o)&&t.get()},left:n=>r.made?.left(n),reopened:()=>r.made?.reopened(),moved:n=>r.made?.moved(n),step:n=>r.made?.step(n)??!1,dispose(){r.disposed=!0,r.made?.dispose()}}}var KE={coming:0,drawn:1,whole:2},cke=5;function zte(e,t,r,n){let o=[];for(let s of r)for(let{leavers:a}of e)a.delete(s)&&r.delete(s);let i={leavers:new Set,awaited:r,warmed:0,waited:0,walks:new Map};for(let s of t){for(let a of e)a.awaited.delete(s)&&r.size&&a.leavers.size&&uke(a,i,t);r.size&&n(s)?i.leavers.add(s):o.push(s)}return i.leavers.size&&e.push(i),o.concat(qE(e,()=>"coming"))}function uke(e,t,r){for(let n of e.leavers)t.leavers.add(n);for(let n of e.awaited){if(r.has(n))continue;t.awaited.add(n);let o=e.walks.get(n);o&&t.walks.set(n,o)}t.waited=Math.max(t.waited,e.waited),e.leavers.clear()}function qE(e,t,r){let n=[],o=0;for(let i of e){let s=KE.whole;for(let l of i.awaited)s=Math.min(s,KE[t(l,i.walks)]);r!==void 0&&(i.waited+=r,s===KE.drawn&&i.warmed++);let a=s<KE.whole&&i.warmed<=cke&&i.waited<3e4;if(i.leavers.size&&a)e[o++]=i;else for(let l of i.leavers)n.push(l)}return e.length=o,n}function UI(e,t,r){for(let n=0;n<e.length;n++)if(e[n][r].has(t))return!0;return!1}var dke=500,VI=e=>e===void 0?Z():e[0],fke=e=>VI(e.parts.clock);function Z$t(e,t=dke){let r=fke(e)+t;e.timer!==void 0&&e.timerAt<=r||(clearTimeout(e.timer),e.timerAt=r,e.timer=setTimeout(()=>{e.timer=void 0,e.wake(!1)},Math.max(0,t)))}var XE=e=>e.find(t=>t.dag);var pke={colors:!0},hke={colors:null};function mke(e,t){let r=new Set;for(let n of e.drawsOf(t).draws)if(!(n instanceof Ed)){let o=rd([n.declaration].flat()[0]);o!==void 0&&r.add(o)}return r}function gke(e,t,r){let n=t.record.manifestUrl,o=[[mke(e.models,t).has(r),"a partition's cells place its meshes"],[!!XE(Bl(t)),"the compile's HLOD actors draw it far"]];for(let[i,s]of o){let a=`${n}:${r}:${s}`;!i||e.said.has(a)||(e.said.add(a),e.notDrawn(`the material of slot ${r} of ${n}`,s))}}function Ske(e,t,r){let{models:n,materials:o}=e,{worn:i}=kb(t),s=new Map;for(let a of n.bases(t)){let l=a.slot===void 0?void 0:i.get(a.slot);if(!l)continue;let c=o.entryOf(l),u=a.attributes.color?pke:hke,d=n.variant(t,a,c,o.surfaceOf(c,u,a.cloth));d.made&&r.push(d.source),e.worn.set(d.source,{entry:c,record:t.record}),s.set(a,d.source)}for(let a of i.keys())gke(e,t,a);return s}async function wke(e,t,r,n){let o=e.openings,i=t.record.manifestUrl,s=a=>{let l=ql(n,a);l&&(e.refusedBy.add(r),e.refused(`a material of a placement of ${i}`,l))};try{if(!await e.record(t.record))return void e.refusedBy.add(r);let a=jE(e.models.drawsOf(t).primitives),l=await BI(n,a,r);if(o!==e.openings)return;l?s(l):e.joined.set(r,o)}catch(a){s(String(a))}}function yke(e,t,r,n,o){let i=dr(t),s;for(let a of r.values()){if(e.refusedBy.has(a))return"refused";if(e.joined.get(a)!==e.openings)return"wait";if(!(!n.sourceResident||n.sourceResident(a.rows,i))&&(s===void 0&&e.waiting.set(t,s=e.waiting.get(t)+o),s<3e4))return"wait"}return"ready"}function xke(e,t){if(e?.size!==t.size)return!1;for(let[r,n]of t)if(e.get(r)!==n)return!1;return!0}function jte(e){let t={...e,wanted:new WeakMap,joined:new WeakMap,refusedBy:new WeakSet,joining:new Set,worn:new Map,restyled:new Set,waiting:new Map,said:new Set,openings:0};return W({restyle:r=>void t.restyled.add(r),seat:(r,n)=>bke(t,r,n),handOver:(r,n=0)=>Eke(t,n,r),get waiting(){return t.waiting.size>0},opened:r=>Tke(t,r),entries:()=>new Set([...t.worn.values()].map(({entry:r})=>r)),get flying(){return ki(t.joining)}})}function bke(e,t,r){for(let n of e.restyled){if(!t.has(n)||!kb(n).worn.size&&!e.wanted.has(n))continue;let o=[],i=Ske(e,n,o);if(!(!o.length&&xke(e.wanted.get(n),i))&&(e.wanted.set(n,i),e.waiting.set(n,0),!!r)){if(!r.addPlacements){e.waiting.delete(n),e.refused(`the materials of ${n.record.manifestUrl}`,"no source joins the session");continue}for(let s of o){let a=wke(e,n,s,r);e.joining.add(a),a.finally(()=>e.joining.delete(a))}}}e.restyled.clear()}function Eke(e,t,r){if(!r||!e.waiting.size)return!1;for(let n of e.waiting.keys()){let o=e.wanted.get(n),i=n._alive&&o?yke(e,n,o,r,t):"refused";i!=="wait"&&(e.waiting.delete(n),i!=="refused"&&(e.models.dress(n,o),e.write(n)))}return e.waiting.size>0}function Tke(e,t){let r=++e.openings,n=new Set;for(let o of t){let i=e.wanted.get(o);for(let s of i?.values()??[])n.add(s);e.models.dress(o,i)}for(let[o,{record:i}]of e.worn)n.has(o)?(e.joined.set(o,r),e.refusedBy.delete(o)):(e.worn.delete(o),e.models.drop(i,o));e.waiting.clear()}function qte(e,t,r,n={}){let o=vke(e,t,r,n),{materials:i,members:s,stale:a}=o;return W({...Ake(o),...Oke(o),moved:l=>Mke(o,l),get seatEpoch(){return o.seatEpoch},resolve:(l,c)=>Pke(o,l,c),seat:l=>Cke(o,l),handOver:l=>kke(o,l),stale(l){s.retype(l),a.add(l),o.cuts.dynamic.heard(l.geometry)},get repaintPending(){return i.repaintPending},get staleCount(){return a.size},dispose:()=>Dke(o),changed:s.changed,entered:s.entered,modelDrawn:l=>o.joins.shown(l),get joining(){return Hke(o)},plan:()=>zke(o),get shape(){return s.shape}})}function Ake(e){let{batches:t,members:r,poses:n}=e;return{cuts:e.cuts,assemblies:e.assemblies,watch:e.watch,leftBehind:()=>e.leavings.length||e.went.size?Rke(e):void 0,instances:n.instances,seats:t.seats,handing:t.handing,waitsOnHandOver:t.waitsOnHandOver,poses:n,volumes:r.volumes,decals:r.decals,placedObjects:r.placedObjects,models:e.models,loaded:r.models,placed:Gte(r)}}function Oke(e){let{materials:t,members:r}=e;return{writeValues:n=>!Array.isArray(n.material)&&!r.volumes.has(n)&&!r.decals.has(n)&&t.writeValues(n.material),restyle:n=>e.dressing.restyle(n),repainted:t.takeRepainted,repaint:t.repaint}}function Lke(){let e={state:null},t=n=>{let{state:o}=e;return o?(o.members.drop(n)&&!o.came.delete(n)&&o.went.add(n),ZE(o,n)?o.destroyed.add(n):o.joins.told(n),r.asked(),!0):!1},r={asked:()=>{},bind:n=>void(e.state=n),listed:n=>um(n,t),dispose:()=>void(e.state=null)};return r}function Rke({leavings:e,went:t}){let r=[],n=o=>void r.push(Wn(o)?YE(o):o);for(let{leavers:o}of e)o.forEach(n);return t.forEach(n),r}function _ke({poses:e,materials:t,ranks:r,letGone:n},o,i){return Fee(e.touchRange,(s,a,l)=>t.surfaceOf(s,a.drawn,l),r,o,()=>i.wake?.(!0),(s,a)=>{s.updateWorldMatrix(!0,!1),e.writeHidden(s,a)},s=>void n.push(s))}function vke(e,t,r,n){let o=QJ(t,r),i=Wke(t),s=new Set,a=Rte({held:s,keeps:b=>ZE(x,b),movesOf:b=>w.movesOf(b)}),l=Bee(),c=(b,T)=>Mn(t,b,T),u=tte(l),d=Lke(),f=Fte({scene:e,models:u,poses:a,refused:c}),h=jte({models:u,materials:i,refused:c,record:f.record,write:b=>a.writeModel(u,b,qn(b,e,!0)),notDrawn:(b,T)=>P3(t,b,T)}),m=[],w=_ke({poses:a,materials:i,ranks:l,letGone:m},c,n),x={assemblies:Wte({batches:w,shown:b=>!s.has(b)&&qn(b,e,!0),touch:a.touch,writeOwner:b=>_d(x,b),hold:(b,T)=>o.hold(b,T),release:b=>o.release(b),clock:r,...n}),scene:e,notices:t,cuts:o,materials:i,poses:a,ranks:l,letGone:m,models:u,batches:w,members:Ute(e,b=>(d.listed(b),h.restyle(b))),watch:d,joins:f,dressing:h,resolved:new Map,stale:new Set,unseated:new Set,held:new Set,seatEpoch:0,clock:r,handed:void 0,leavings:[],hidden:s,came:new Set,went:new Set,destroyed:new Set,lit:!1,read:{completed:0,total:0}};return d.bind(x),x}function Mke(e,t){e.poses.moved(t),e.assemblies.moved(t)}function GI(e,t){e.seatEpoch++,e.assemblies.left(t),e.resolved.delete(t),e.unseated.delete(t),e.stale.delete(t),e.cuts.leave(t),e.batches.unseat(t)}function Dke(e){e.materials.dispose(),e.watch.dispose();for(let t of e.destroyed)Jte(e,t);e.joins.dispose()}var Xte=(e,t)=>Wn(t)?e.joins.shown(t):(e.batches.seats.get(t)?.row??-1)>=0,ZE=(e,t)=>e.went.has(t)||e.destroyed.has(t)||UI(e.leavings,t,"leavers");function Qte(e){let{added:t,removed:r,moved:n,lights:o,models:i}=e.members.take();Nke(e,t,r,i);for(let s of[t,n])for(let a of s)e.stale.add(a);e.lit||=o}async function Pke(e,t,r){let{members:n,stale:o,cuts:i,materials:s,read:a}=e;Qte(e);let l=e.lit;e.lit=!1;let c=[...o].filter(h=>n.meshes.has(h));o.clear(),c.forEach(h=>e.unseated.delete(h));let u=new Set(c);a.total+=c.length,c.length&&r?.(a.completed,a.total);let d=(h,m)=>{if(u.delete(h)&&r?.(++a.completed,a.total),!n.meshes.has(h)){ZE(e,h)||GI(e,h);return}e.resolved.set(h,m&&{cut:m,entry:s.entryOf(Qr(h.material))}),e.unseated.add(h),t?.()};await Promise.all(c.map(async h=>d(h,await i.of(h)))).catch(h=>{throw u.forEach(m=>o.add(m)),a.total-=u.size,u.clear(),h});let f={geometries:i.counts.duplicates,materials:s.counts.duplicates};return R3(e.notices,f),l}var Zte=({scene:e,assemblies:t},r)=>t.owns(r)||qn(r,e,!0);function _d(e,t,r){t.updateWorldMatrix(!0,!1),e.poses.writeSeat(t,e.batches.seats.get(t),Zte(e,t),r)}function $te(e,t){let r=[];for(let n of e.batches.growHeld(o=>r.push(o),t))e.poses.touchRange(n,0,n.rows.capacity-1);r.forEach(n=>_d(e,n))}function Cke(e,t){let{batches:r,unseated:n}=e;e.seatEpoch++,$te(e,t);let o=[...n];n.clear();for(let i of o){let s=e.resolved.get(i);if(s!==void 0){if(!s){e.assemblies.left(i),r.unseat(i);continue}r.seat(i,s.cut,s.entry)&&_d(e,i),e.assemblies.seated(i,r.seats.get(i).batch)}}$te(e,t),Ike(e,t),e.joins.reconcile(e.members.models,t,i=>ZE(e,i)),e.dressing.seat(e.members.models,t)}function Ike(e,t){let r=[];for(let n of e.batches.join(o=>r.push(o),t))e.poses.touchRange(n,0,n.rows.capacity-1),e.cuts.hold(n.cut,!0),e.held.add(n.cut);r.forEach(n=>_d(e,n))}function kke(e,t){t?.joinLanded?.(),e.members.pending&&(Qte(e),e.watch.asked()),(e.came.size||e.went.size)&&Bke(e,t),Yte(e,t);let r=e.batches.moving||e.dressing.waiting||e.leavings.length>0,n=r?VI(e.clock):0,o=r?Oee(n,e.handed):0,i=e.batches.moving&&Gke(e,o,t),s=e.leavings.length>0&&Fke(e,o,t);Yte(e,t),(s||e.hidden.size)&&Uke(e),t?.releasePlacements&&e.batches.emptied&&Vke(e,t);let a=e.dressing.handOver(t,o);return e.handed=i||a||s?n:void 0,a||i||s}function Yte({letGone:e},t){if(!e.length)return;let r=t?.sourceLetGo;if(r)for(let n=0;n<e.length;n++){let{batch:o,row:i}=e[n];o.rows&&r(o.rows,i)}e.length=0}function Fke(e,t,r){let n=r?.sourceResident,o=(s,a)=>Wn(s)?e.joins.arrival(s,a,r):e.resolved.get(s)===null?"whole":e.batches.arrival(s,n),i=!1;for(let s of qE(e.leavings,o,t))i=QE(e,s,r)||i;return i&&e.watch.asked(),e.leavings.length>0}function Nke(e,t,r,n){let{came:o,went:i}=e;for(let s of[t,n.added])for(let a of s)i.delete(a)||o.add(a);for(let s of[r,n.removed])for(let a of s)o.delete(a)?Wn(a)||GI(e,a):i.add(a);for(let s of n.added)o.has(s)&&e.hidden.add(s)}function Bke(e,t){let{came:r,went:n,leavings:o}=e;e.came=new Set,e.went=new Set;let i=a=>!e.hidden.has(a)&&Xte(e,a),s=o.length||r.size&&n.size?zte(o,n,r,i):n;for(let a of s)QE(e,a,t)}function Uke(e){for(let t of e.hidden)UI(e.leavings,t,"awaited")||Kte(e,t,!1);for(let{awaited:t}of e.leavings)for(let r of t)Kte(e,r,!0)}function Kte(e,t,r){let{hidden:n}=e;n.has(t)!==r&&(r?n.add(t):n.delete(t),!(!t._alive||!Xte(e,t))&&(Wn(t)?e.poses.writeModel(e.models,t,qn(t,e.scene,!0)):_d(e,t),e.assemblies.moved(t)))}var QE=(e,t,r)=>Wn(t)?Jte(e,t,r):(GI(e,t),!1);function Jte(e,t,r){return e.destroyed.delete(t)?(e.joins.told(t),!0):(r?e.joins.park(t,r):e.poses.writeModel(e.models,t,!1),!1)}function Vke(e,t){let{batches:r,held:n,cuts:o}=e,i=!1;r.takeEmptied((s,a)=>{t.releasePlacements(s),i=!0,a&&(n.delete(s.cut),o.hold(s.cut,!1))}),i&&ere(e)}function ere(e){let t=e.batches.entries();for(let r of e.resolved.values())r&&t.add(r.entry);for(let r of e.dressing.entries())t.add(r);e.materials.keep(t)}function Gke(e,t,r){let{batches:n}=e,o=[],i=r?.sourceResident,s=r?.sourceAsked,a=r?.followPlacements,l=n.handOver((c,u)=>o.push([c,u]),i,t,s);o.length&&e.seatEpoch++;for(let[c,u]of o)_d(e,c,u&&a&&{from:u,follow:a}),e.assemblies.seated(c,n.seats.get(c).batch);return l}function Hke(e){let{batches:t,joins:r,dressing:n}=e,o=[t.flying,r.flying,n.flying].filter(i=>!!i);return o.length?Promise.all(o):void 0}var Wke=e=>yee((t,r)=>v3(e,t,r),(t,r)=>M3(e,t,r),t=>EZ(t,e));function zke(e){let{batches:t,scene:r,poses:n,members:o,cuts:i}=e;e.seatEpoch++;for(let c of e.went)QE(e,c);for(let c of e.came)e.hidden.delete(c);e.came.clear(),e.went.clear();for(let c of qE(e.leavings,()=>"whole"))QE(e,c);let s=t.reopen();e.assemblies.reopened(),r.updateMatrixWorld();for(let c of s)for(let u of c.wearers){let d=t.seats.get(u);d&&d.row>=0&&n.writeSeat(u,d,Zte(e,u))}e.dressing.opened(o.models);for(let c of o.models)e.models.rootsOf(c),n.writeModel(e.models,c,qn(c,r,!0));n.settle(),e.joins.opened(o.models),ere(e);let a=new Set(s.map(c=>c.cut));for(let c of a)i.hold(c,!0);let l=()=>{for(let c of e.held)a.has(c)||i.hold(c,!1);e.held=a};return{batches:s,models:[...o.models],ranks:e.ranks,worldModels:e.models,release:l}}function I8t(e,t,r,n,o){let i=Math.max(e[t]-r,0,r-e[t+3]),s=Math.max(e[t+1]-n,0,n-e[t+4]),a=Math.max(e[t+2]-o,0,o-e[t+5]);return te(i,s,a)}var k8t=(e,t,r,n)=>Je(Math.max(e[t]-r,0,r-e[t+3]),Math.max(e[t+2]-n,0,n-e[t+5]));function tre(e,t,r,n,o){let i=Math.max(Math.abs(r-e[t]),Math.abs(r-e[t+3])),s=Math.max(Math.abs(n-e[t+1]),Math.abs(n-e[t+4])),a=Math.max(Math.abs(o-e[t+2]),Math.abs(o-e[t+5]));return te(i,s,a)}var jke=["page","gpu","cpu","shadows","memory","scene","why"],rre=[...jke,"panel"],HI=G({name:"stats",summary:"The profiler overlay and the report behind it: the numbers of each tab and the panel, each a part.",enabledByDefault:!1,requires:[],parts:rre});function WI(e){let t=r=>e?.[r]!==!1;return Object.fromEntries(rre.map(r=>[r,t(r)]))}var zI=G({name:"ambientOcclusion",summary:"The screen-space ambient occlusion \u2014 the disc search, the horizon search and the ray-traced occlusion \u2014 that darkens the ambient light, its passes fetched with the first image that wants them.",enabledByDefault:!0,requires:[],parts:[],switches:{ambientOcclusion:!1,rayTracedAmbientOcclusion:"off"}});var jI=G({name:"animation",summary:"What a world's step advances of the animation: its mixers' clips, with the graphs and montages they play, and its playing sequences.",enabledByDefault:!0,requires:[],parts:["cinematics"]});var $I=G({name:"autoExposure",summary:"The automatic exposure: the image measured on the GPU each frame and the exposure adapted toward the brightness it asks, as an eye adapts; off, the exposure is held as the manual method holds it.",enabledByDefault:!0,requires:[],parts:[],switches:{exposureMethod:"manual"}});var YI=G({name:"bakedLight",summary:"The baked light: the baked light volume a compiled scene's cache carries, read by the lit image, the body shadows, the fog and the hair strands; off, every reader of it answers black.",enabledByDefault:!0,requires:[],parts:[],switches:{bakedLightVolume:!1}});var KI=G({name:"bounce",summary:"The light that bounces: the probes, the probe cache, the view probes and the diffuse grid, fetched as a session that bounces is prepared.",enabledByDefault:!0,requires:[],parts:[],switches:{bounce:!1}});var qI=G({name:"compiler",summary:"The model compiler run in the page, in WebAssembly with its workers and its GPU steps, behind prepareInBrowser, listNodesInBrowser and a ragdoll's fit, its code fetched by the first of them.",enabledByDefault:!0,requires:[],parts:[]});var XI=G({name:"decals",summary:"The decals projected on the opaque surfaces, laid before they are lit and their emissions added once they are, their code fetched with the first image that holds one.",enabledByDefault:!0,requires:[],parts:[]});var QI=G({name:"deformation",summary:"The skinned, morphed, wave-carried and soft geometry moved on the GPU, its code fetched with the first session whose models deform.",enabledByDefault:!0,requires:[],parts:[]});var ZI=G({name:"displacement",summary:"The displaced relief: a material's displacement map tessellated into micro-triangles each frame, in the image and the shadow maps; off, the displaced surfaces are drawn flat.",enabledByDefault:!0,requires:[],parts:[],switches:{tessellation:!1}});var JI=G({name:"fog",summary:"The volumetric fog and the fog spheres: the height fog's volume, lit and shadowed, and the fog volumes placed in the scene, their passes fetched with the first image that draws one.",enabledByDefault:!0,requires:[],parts:[],switches:{volumetricFogQuality:"off",fogSpheres:!1}});var ek=G({name:"foliage",summary:"The foliage: the copies of models that scale with the world's foliage density, and the surfaces and queries at once a brush places them by.",enabledByDefault:!0,requires:[],parts:[],switches:{foliageDensityScale:0}});var tk=G({name:"guides",summary:"What a host draws over a world's image to work on it \u2014 its lines, dots and helpers, and the transform controls' handles, a part switched alone.",enabledByDefault:!0,requires:[],parts:["transform"]});var rk=G({name:"hair",summary:"The hair strands: the grooms of a compiled scene drawn strand by strand, lit and shadowed, their passes fetched with the first image of a scene that carries some while the strands' setting is on.",enabledByDefault:!0,requires:[],parts:[],switches:{hairStrands:!1}});var nk=G({name:"instruments",summary:"The instruments: the debug views drawn over the image that the diagnostic mode and the debug settings ask; off, none is drawn nor its code fetched.",enabledByDefault:!0,requires:[],parts:[],views:["paged-shadow-map-shadow-casters","paged-shadow-map-clipmap-virtual-space","rect-light-atlas","light-profile-atlas","surface-atlas-direct-stats","surface-atlas-indirect-stats","surface-atlas-direct-lighting-stats","surface-atlas-scene-stats","surface-atlas-primitive-groups","probe-cache-stats","view-probe-gather-debug","view-probe-placement","view-probe-traces","reflection-traces","reflection-stages","reflection-history","probe-cache-probes","scene-visualization","material-properties","view-probe-tile-stats"]});var ok=G({name:"gltfExport",summary:"The glTF export: a world's scene, or a subtree of it, written as a .glb file or a .gltf document another tool reads back.",enabledByDefault:!0,requires:[],parts:[]});var ik=G({name:"lightPatterns",summary:"The light patterns: the materials a lamp wears to shape and colour its light, drawn into one atlas the lit passes read.",enabledByDefault:!0,requires:[],parts:[]});var sk=G({name:"lightProfiles",summary:"The light profiles: the shapes of the lamps' light as IES files measure them, kept in one atlas the lit programs read.",enabledByDefault:!0,requires:[],parts:[]});var ak=G({name:"marks",summary:"The tyre marks: the rubber a sliding tyre leaves and the print a loaded one presses into soft ground, laid by the vehicles and drawn over the surfaces before they are lit, their code fetched with the first image that holds one.",enabledByDefault:!0,requires:[],parts:[]});var lk=G({name:"particles",summary:"The particle emitters of a world, their pools stepped and drawn on the GPU, their code fetched with the first pool drawn.",enabledByDefault:!0,requires:[],parts:[]});var $ke={rate:"least",spread:"least",timeScale:"least",warmup:"least",lifetime:"above",size:"above",softness:"above",aspect:"above",stretch:"least",drag:"least","shape.radius":"above","shape.height":"above","shape.size":"least","shape.innerRadius":"least","wind.resistance":"least","curlNoise.frequency":"above","attractor.radius":"least","attractor.falloff":"least","attractor.killRadius":"least","killVolume.size":"above","killVolume.radius":"above","cull.distance":"above","cull.radius":"above","cull.outsideView":"least","collision.restitution":"least","collision.friction":"least","collision.radiusScale":"least","collision.depthBounds":"above","flipbook.rate":"least","curve.at":"least",qualityShare:"least"},qm={spread:Math.PI,"collision.friction":1,"curve.at":1},Re=(e,t)=>e===void 0||Number.isFinite(e)&&($ke[t]==="above"?e>0:e>=0);var nre=["point","box","sphere","cylinder","disc","mesh"];function gt(e,t,r){if(!e)throw new Error(`${t}: ${r}`)}var it=(e,t)=>e===void 0||(t===1?Number.isFinite(e):typeof e=="object"&&e!==null&&e.length===t&&Array.prototype.every.call(e,Number.isFinite)),Yke=["x","y","z","w"];function Xm(e,t){let r=t,n=typeof r?.length=="number";for(let o=0;o<e.length;o++){let i=n?r.length===e.length?r[o]:void 0:t?.[Yke[o]];e[o]=typeof i=="number"?i:Number.NaN}return e}var Kke=new Float64Array(3),ore=new Float64Array(4),ire="an origin and an acceleration are three finite numbers, an orientation a unit quaternion";function ck(e,t){gt((e===void 0||Xm(Kke,e).every(Number.isFinite))&&(t===void 0||Xm(ore,t).every(Number.isFinite)&&Math.abs(vi(ore)-1)<.001),"PARTICLE_PLACE",ire)}var vd=e=>it(e,1)||it(e,2);function qke(e){let t="PARTICLE_SHAPE";gt(nre.includes(e.kind),t,`a shape is one of ${nre.join(", ")}`),gt(it(e.offset,3),t,"an offset is three finite numbers");let r=e.kind==="box"?e.size??[]:[];gt(it(e.kind==="box"?e.size:void 0,3),t,"a box size is three numbers"),gt(r.every(n=>Re(n,"shape.size"))&&Re("radius"in e?e.radius:void 0,"shape.radius")&&Re("height"in e?e.height:void 0,"shape.height"),t,"a radius and a height are positive, a box size 0 or more"),e.kind==="disc"&>(Re(e.innerRadius,"shape.innerRadius")&&(e.innerRadius??0)<=(e.radius??1),t,"a disc\u2019s inner radius is from 0 to its radius"),e.kind==="mesh"&&sre(t,e.positions,e.indices)}function sre(e,t,r){let n=t?.length/3;gt(Number.isInteger(n)&&Array.prototype.every.call(t,Number.isFinite),e,"a mesh\u2019s positions are three finite numbers a vertex");let o=r?.length??t.length/3;gt(o>=3&&o%3===0,e,"a mesh has whole triangles, one at least"),r&>(Array.prototype.every.call(r,i=>Number.isInteger(i)&&i>=0&&i<n),e,"a mesh\u2019s indices name its vertices")}function Xke(e){e!==void 0&>(e.length>0&&e.every((t,r)=>Re(t.at,"curve.at")&&t.at<=qm["curve.at"]&&(r===0||t.at>=e[r-1].at)&&("color"in t?it(t.color,4):Number.isFinite(t.value))),"PARTICLE_CURVE","a curve is one key at least, its shares of the life from 0 to 1 in order, each with a finite value")}function Qke({drag:e,wind:t,curlNoise:r,attractor:n,vortex:o,killVolume:i}){let s="PARTICLE_FORCE";gt(Re(e,"drag")&&Re(t?.resistance,"wind.resistance")&&it(t?.velocity,3),s,"a drag and a resistance are 0 or more, a wind three finite numbers"),gt(it(r?.strength,1)&&Re(r?.frequency,"curlNoise.frequency")&&it(r?.pan,3)&&(r?.seed===void 0||Number.isInteger(r.seed)),s,"a curl noise has a finite strength, a positive frequency, a finite pan and a whole seed"),gt(it(n?.position,3)&&it(n?.strength,1)&&Re(n?.radius,"attractor.radius")&&Re(n?.falloff,"attractor.falloff")&&Re(n?.killRadius,"attractor.killRadius"),s,"an attractor has a finite place and strength, a radius, falloff and kill radius of 0 or more");let a=o?.axis;gt(it(a,3)&&(!a||a.some(Boolean))&&it(o?.center,3)&&it(o?.speed,1)&&it(o?.pull,1),s,"a vortex has a non-zero axis, a finite centre, speed and pull"),gt((i?.kind??"box")in{box:1,sphere:1}&&it(i?.center,3)&&it(i?.size,3)&&(i?.size??[1]).every(l=>Re(l,"killVolume.size"))&&Re(i?.radius,"killVolume.radius"),s,"a kill volume is a box of positive size or a sphere of positive radius, its centre finite")}function Zke(e){gt(Re(e?.distance,"cull.distance")&&Re(e?.radius,"cull.radius")&&Re(e?.outsideView,"cull.outsideView")&&[void 0,"asleepAndClear","asleep","pause"].includes(e?.reaction),"PARTICLE_CULL","a distance and a radius above 0, a time of 0 or more, a reaction asleepAndClear, asleep or pause")}function Jke(e){gt(Re(e?.restitution,"collision.restitution")&&Re(e?.friction,"collision.friction")&&(e?.friction??0)<=qm["collision.friction"]&&Re(e?.radiusScale,"collision.radiusScale")&&it(e?.radiusBias,1)&&Re(e?.depthBounds,"collision.depthBounds")&&[void 0,"bounce","stop","kill"].includes(e?.response),"PARTICLE_COLLISION","a response bounce, stop or kill, a restitution and a radius scale of 0 or more, a friction from 0 to 1, positive depth bounds")}function eFe(e){if(!e)return;let{image:t,grid:r=[1,1],frames:n=1}=e;gt(vn(t?.width,t?.height)&&vn(r[0],r[1])&&vn(n,r[0]*r[1]-n+1)&&Re(e.rate,"flipbook.rate")&&vd(e.startFrame)&&[void 0,"life","rate","random"].includes(e.mode),"PARTICLE_FLIPBOOK","a picture, a whole grid and frames within it, a rate of 0 or more, a start, a mode life, rate or random")}function are(e){let{acceleration:t,color:r,fade:n}=e;gt(it(t,3),"PARTICLE_PLACE",ire);let o=Array.isArray(r?.[0])?r:[r];gt(o.every(i=>it(i,4))&&it(n,4),"PARTICLE_COLOR","a colour is four finite numbers, linear RGB and opacity, or two of them"),gt([e.rotation,e.spin,e.normalSpeed].every(vd)&&Re(e.aspect,"aspect")&&it(e.inheritVelocity,1)&&Re(e.stretch,"stretch")&&[void 0,"camera","velocity"].includes(e.align)&&[void 0,"none","viewDepth","viewDistance"].includes(e.sort)&&it(e.sortPriority,1)&&it(e.sortOrderHint,1)&&it(e.emitterOrder,1)&&[void 0,"segments","age"].includes(e.ribbon&&e.ribbon.uv),"PARTICLE_LOOK","a rotation, a spin and a normal speed are finite, an aspect positive, a stretch 0 or more, an alignment camera or velocity, a sort none, viewDepth or viewDistance, a sort priority, a sort order hint and an emitter order finite, a ribbon uv segments or age"),e.shape&&qke(e.shape),e.mesh&&(sre("PARTICLE_MESH",e.mesh.positions,e.mesh.indices),gt([void 0,"tumble","velocity"].includes(e.mesh.facing),"PARTICLE_MESH","a mesh faces as tumble or velocity")),eFe(e.flipbook);for(let i of[e.colorOverLife,e.sizeOverLife,e.spinOverLife,e.speedOverLife])Xke(i);Qke(e),Zke(e.cull),Jke(e.collision)}var lre=2**31;function dk(e){let{capacity:t,emitPerFrame:r=t,space:n="world"}=e;if(!Number.isInteger(t)||t<1||t>lre)throw new Error(`PARTICLE_CAPACITY: a pool holds 1 to ${lre} particles`);if(!Number.isInteger(r)||r<1||r>t)throw new Error("PARTICLE_EMISSION: a pool takes 1 to `capacity` births a frame");if(n!=="world"&&n!=="local")throw new Error("PARTICLE_SPACE: a pool's particles live in 'world' or 'local' space");return{capacity:t,emitPerFrame:r,space:n}}var ure=()=>({turn:Float64Array.of(0,0,0,1),shift:new Float64Array(3)});function mKt(e){e.turn.set(tFe),e.shift.fill(0)}var tFe=[0,0,0,1],Qm=new Float64Array(4),uk=new Float64Array(3),cre=new Float64Array(3);function dre(e,t,r,n,o){t==="local"?(zr(Qm,n),yt(uk,Qm,o[0]-r[0],o[1]-r[1],o[2]-r[2])):(Qm.set(n),uk.fill(0)),yt(cre,Qm,e.shift[0],e.shift[1],e.shift[2]);for(let i=0;i<3;i++)e.shift[i]=cre[i]+uk[i];nt(e.turn,Qm,e.turn)}var yKt=16,rFe=1/15,fk=["additive","premultiplied"],JE=class{capacity=0;emitPerFrame=0;space;anchor;origin=new Float64Array(3);orientation=Float64Array.of(0,0,0,1);stood;span=0;spawn;revision=0;seed=1;emitted=0;dropped=0;refused=!1;staged=0;pending=0;liveFor=0;ahead=0;restarts=0;reframes=0;reframe=ure();culled=!1;alive=0;counted=!1;effects="max";held=!1;constructor({capacity:t,emitPerFrame:r,space:n},o,i,s){this.capacity=t,this.emitPerFrame=r,this.space=n,this.spawn=o,this.place(i,s),this.anchor=Float64Array.from(this.origin),this.stood=Float64Array.from(this.origin),this.ahead=o.warmup??0}reshape({capacity:t,emitPerFrame:r,space:n}){t!==this.capacity&&(this.refused=!1),this.capacity=t,this.emitPerFrame=r;let o=this.staged-r;o>0&&(this.staged=r,this.emitted-=o,this.dropped+=o),n!==this.space&&(dre(this.reframe,n,this.origin,this.orientation,this.anchor),n==="world"&&this.anchor.set(this.origin),this.space=n,this.reframes++)}respawn(t,r){this.spawn=t,r&&this.revision++}place(t,r){t&&Xm(this.origin,t),r&&Xm(this.orientation,r)}birth(t){let r=this.refused||this.cleared?0:Math.min(t,this.emitPerFrame-this.staged);return this.dropped+=t-r,r<=0?0:(this.staged+=r,this.emitted+=r,this.liveFor=Math.max(this.liveFor,this.spawn.lifetimeMost+rFe),r)}get moving(){let{active:t,rate:r=0}=this.spawn,n=t!==!1&&r>0&&!this.culled;return!this.refused&&!this.cleared&&(this.ahead>0||!this.stands&&(this.staged>0||this.liveFor>0||n))}get cleared(){return this.culled&&(this.spawn.cull?.reaction??"asleepAndClear")==="asleepAndClear"}get stands(){let{paused:t,timeScale:r,cull:n}=this.spawn;return!!t||r===0||this.held||this.culled&&n?.reaction==="pause"}advance(t){this.stood.set(this.origin),this.span=t*(this.spawn.timeScale??1),this.moving&&!this.stands&&(this.pending+=this.span)}restart(){this.restarts++,this.staged=this.pending=this.liveFor=0,this.ahead=this.spawn.warmup??0}};var pk=G({name:"pathTracing",summary:"The path tracer: a world's views drawn by tracing the scene's triangles bounce after bounce, the samples added while the view stands still, and its denoiser.",enabledByDefault:!1,requires:[],parts:[],switches:{pathTracing:!1}});var hk=G({name:"avatar",summary:"What the player drives: the character, the avatars world.controls.possess takes, and the arm camera their camera stands on.",enabledByDefault:!0,requires:[],parts:[]});var mk=G({name:"physics",summary:"The simulation of the bodies, joints, vehicles, ragdolls and water of a world, in a worker, with its scene queries.",enabledByDefault:!1,requires:[],parts:[]});var gk=G({name:"planarReflections",summary:"The planar reflections: mirrors the scene is drawn in again from the camera reflected across their plane, fetched with the first image of a scene that holds one.",enabledByDefault:!0,requires:[],parts:[]});var Sk=G({name:"rectLightPictures",summary:"The rect light pictures: the images the rectangle lights map on their faces, kept in one atlas the lit programs read.",enabledByDefault:!0,requires:[],parts:[]});var wk=G({name:"cubeCaptures",summary:"The cube captures: cubes of the scene drawn from the captures' places that the rough reflections read, fetched with the first image that makes one.",enabledByDefault:!0,requires:[],parts:[],switches:{cubeCaptures:!1}});var yk=G({name:"reflections",summary:"The traced reflections of every surface and the see-through surfaces drawn by rays, their trace fetched with the first image that traces.",enabledByDefault:!0,requires:[],parts:[],switches:{reflectionQuality:"off"}});var xk=G({name:"sampledLights",summary:"The lighting that samples a few of the many lights reaching each pixel, traces one shadow ray a sample and denoises the result, at a fixed cost.",enabledByDefault:!1,requires:[],parts:[],switches:{sampledLights:!1}});var bk=G({name:"shadows",summary:"The shadows the lights cast: the shadow maps, the field, capsule, contact, per-object and ray-traced shadows, fetched as a session whose lights cast is prepared.",enabledByDefault:!0,requires:[],parts:[],switches:{shadowQuality:0}});var Ek=G({name:"sortedTranslucency",summary:"The per-pixel sorting of the see-through layers, composed front to back where the project asks it, its passes fetched with the first image that sorts.",enabledByDefault:!0,requires:[],parts:[],switches:{sortedTranslucentPixels:!1}});var Tk=G({name:"subsurface",summary:"The screen-space scattering of the light under skin and the other subsurface-profile surfaces, its passes fetched with the first image that wants them.",enabledByDefault:!0,requires:[],parts:[],switches:{subsurfaceScattering:!1}});var Ak=G({name:"terrain",summary:"The height-field landscapes of a world, with their levels, painted layers and collision, and the grass grown on them.",enabledByDefault:!0,requires:[],parts:["grass"]});var Ok=G({name:"translucentLightVolume",summary:"The translucent light volume: the field of light around the camera the see-through surfaces lit from it read, its passes fetched with the first image that makes it.",enabledByDefault:!0,requires:[],parts:[],switches:{translucentLightVolume:!1}});var Lk=G({name:"vehicleSounds",summary:"The sounds of the world's vehicles: each engine by its revolutions and load, its tyres' squeal and roll, its body's knocks, drawn by the engine and played on the vehicle after each physics tick.",enabledByDefault:!0,requires:[],parts:[]});var Rk=G({name:"virtualTextures",summary:"The virtual textures' streaming: the tiles each image's feedback names read and copied into the texture pools; off, every texture is drawn from what its pages hold, its tail at the least.",enabledByDefault:!0,requires:[],parts:[]});var _k=G({name:"volumes",summary:"The density volumes of a world \u2014 smoke, fire, a medium a sparse volume texture holds \u2014, their shadows and their composition over the image.",enabledByDefault:!0,requires:[],parts:[],switches:{densityVolumes:!1}});var vk=G({name:"water",summary:"The thin water: the surfaces whose material is water, shaded over the scene seen through them, their passes fetched with the first image that holds one.",enabledByDefault:!0,requires:[],parts:[],switches:{thinWater:!1}});var Mk=G({name:"worldGrid",summary:"The page's control of a partitioned scene's streaming \u2014 its own streaming sources, the grids' loading ranges, the cells' events \u2014 and the HLOD actors.",enabledByDefault:!0,requires:[],parts:["hlod"],switches:{hlodEnabled:!1}});var Dk=Object.freeze([Df,HI,mk,Ak,lk,lM,jI,QL,N1,tk,pk,qI,_k,XI,ak,Tk,xk,QI,vk,zI,rk,JI,Ok,wk,gk,sk,ik,$I,Sk,ZI,Rk,YI,ek,nk,ok,hk,Mk,Ek,yk,KI,bk,Lk]);var Pk=({frameHeld:e,frameVerdict:t})=>!e&&(!t||jA.has(t)),P9t=()=>({ms:null,sinceMs:0});function C9t(e,t){let r=t.frameVerdict;return t.frameHeld||r&&lf.has(r)||(e.sinceMs+=lo(t.rafIntervalMs)??Number.NaN,!Pk(t))?!1:(e.ms=lo(e.sinceMs),e.sinceMs=0,!0)}function eT(e,t,r){let{at:n}=e;for(;e.start<n.length&&n[e.start]<t;)e.start++;if(!(e.start*2<=n.length)){n.splice(0,e.start);for(let o of r)o.splice(0,e.start);e.start=0}}var nFe=Object.freeze([]);function oFe(e,t,r,n,o){for(let i of n)e.set(i.index,o),t.at.push(o),r.push(i.index)}function fre(){let e={at:[],start:0},t=new Map,r={at:[],start:0},n=[],o={last:t,seen:r,index:n},i=[],s=[n],a=0,l=(c,u)=>{c<a&&t.delete(u)};return{push(c,u){return c.frameHeld?!1:(e.at.push(u),oFe(t,r,n,c.views??nFe,u),!0)},trim(c){a=c-1e3,eT(e,a,i),eT(r,a,s),t.size&&t.forEach(l)},idle:()=>e.at.length===e.start,views:o}}var Ck=()=>{let e=[];return{at:[],start:0,ms:e,beside:[e]}},pre=1e3;function kk(e,t){let r=performance.now();e.at.push(r),e.ms.push(t),e.at.length-e.start>pre&&(e.start=e.at.length-pre),eT(e,r-1e3,e.beside)}function Ik(e,t){let r=[];for(let n=e.start;n<e.at.length;n++)e.at[n]>=t-1e3&&r.push(e.ms[n]);return r}var iFe=()=>({frameMs:Ck(),hooksMs:Ck(),stepMs:Ck(),stamp:-1,tick:0,hooks:0,drew:!1}),Zm=new Set;function sFe(){if(typeof requestAnimationFrame>"u")return;let e=requestAnimationFrame.bind(globalThis);globalThis.requestAnimationFrame=t=>e(r=>{for(let o of Zm){let i=o.deref();i||Zm.delete(o),!(!i||r===i.stamp)&&(i.drew&&(kk(i.frameMs,i.tick),kk(i.hooksMs,i.hooks)),i.tick=i.hooks=0,i.drew=!1,i.stamp=r)}let n=Z();try{t(r)}finally{let o=er(n);for(let i of Zm){let s=i.deref();s&&(s.tick+=o)}}})}xp()&&sFe();var Fk=new WeakMap;function mre(e){return Fk.get(e)?.onFrame??e.onFrame.bind(e)}function aFe(e){let t=new Set,r=i=>(...s)=>{let a=Z();try{i(...s)}finally{let l=er(a);for(let c of t)c.hooks+=l}},n=e.onFrame.bind(e),o=e.beforeFrame?.bind(e);return e.onFrame=i=>n(r(i)),o&&(e.beforeFrame=i=>o(r(i))),{users:t,onFrame:n}}function gre(e){let t=iFe(),r=new WeakRef(t),n=Fk.get(e)??aFe(e);Fk.set(e,n);let{users:o}=n;o.add(t),Zm.add(r);let i=n.onFrame(({metrics:s})=>{if(s.frameHeld)return;t.drew=!0;let{physics:a}=e;a?.enabled&&kk(t.stepMs,a.stats.stepMaxMs)});return{taken:s=>({frameMs:Ik(t.frameMs,s),hooksMs:Ik(t.hooksMs,s),stepMs:Ik(t.stepMs,s)}),stop(){i(),Zm.delete(r),o.delete(t)}}}function Sre(e,t){let r=xp()&&t.cpu?gre(e):null,n={world:e,series:fre(),images:0,profile:r,last:null,lastShownMs:null,onFiled:null,stop(){o(),r?.stop()}},o=mre(e)(({metrics:i})=>{let s=performance.now();n.last=i,Pk(i)&&(n.lastShownMs=i.rafIntervalMs),n.series.push(i,s)&&n.images++,n.series.trim(s),n.onFiled?.(i)});return n}var lFe={stop(){},ready:Promise.resolve(),instruments:null,show(){}};function Nk(e,t){let{parts:r,parent:n}=t;if(!(e&&r.panel&&n))return lFe;let o=Sre(e,r),i=null,s=!1,a=t.tab,l=()=>{s=!0,i?.stop(),o.stop()},c=M.statsPanel.load().then(({mountStats:u})=>{s||(i=u(n,o,r,t.worlds,{corner:t.corner??"bottom-left",tab:a,words:t.words}))}).catch(u=>{throw l(),u});return{stop:l,ready:c,get instruments(){return i?.instruments??null},show(u){a=u,i?.show?.(u)}}}function X9t(e,t,r){return r>0?e/2/t/r:1/0}function cFe(e,t,r,n){let o=0;for(;o+1<e.length&&e[o+1]*r<=t;)o++;if(n<0)return o;for(;o>n&&e[o]*r*(1+.1)>t;)o--;return o}function Bk(){let e=new Set,t=new Set,r=!1,n=!1,o=i=>{if(i!==n){n=i;for(let s of[...t])i?s.grow():s.release()}};return{get on(){return r},get grass(){return n},start(i){r=!0;for(let s of[...e])s.build();o(i)},grow:o,stop(){o(!1),r=!1;for(let i of[...e])i.release()},hold(i){return e.add(i),()=>void e.delete(i)},holdGrass(i){return t.add(i),()=>void t.delete(i)}}}var Uk={resolved:void 0,lights:[]};function uFe(e){for(let t of Object.values(e))t?.opened?.()}var wre=e=>{let t=HS(e,_f);return{resolved:t,lights:GC(t)}},bre=({world:e,panel:t},r,n)=>({for:r,handle:Nk(e,{...r?.shown,parts:WI(n),parent:r?r.shown.parent:t})}),dFe=e=>({start:(t,r)=>e.run={parts:r,...bre(t,e.asked,r)},stop(t){t.handle.stop(),e.run===t&&(e.run=void 0)}}),Te=e=>({start({lives:t}){return t[e]?.start(),t[e]},stop:t=>t?.stop()}),yre=e=>({start({lives:t},r){return t[e]?.switch(r),t[e]},stop:t=>t?.switch(void 0),update:(t,r)=>t?.switch(r)}),fFe={start:()=>{},stop:()=>{}},pFe={start:({lives:e})=>e.benchmark,stop:e=>e?.stop()},hFe={start({terrains:e},t){return e.start(t.grass!==!1),e},stop:e=>e.stop(),update:(e,t)=>e.grow(t.grass!==!1)},mFe={start({lives:e},t){return e.worldGrid?.start(t.hlod!==!1),e.worldGrid},stop:e=>e?.stop(),update:(e,t)=>e?.hlod(t.hlod!==!1)},gFe={start({animation:e},t){return e?.run(t.cinematics!==!1),e},stop:e=>e?.stop(),update:(e,t)=>e?.run(t.cinematics!==!1)};function SFe(e){let t,r=()=>{t?.stop(),t=void 0};return{follow(n){let o=n.resolved.backdrop?.map;t?.map!==o&&(r(),!(!o||!e)&&(t={map:o,stop:Xy.hear(o,e)}))},stop:r}}var xre=(e,t)=>VC(t.resolved)?e.sky?.start():e.sky?.stop();function wFe(e,t,r){return{start(n,o){let i=wre(o);return t(i),e.follow(i),xre(r,i),i},stop(){e.stop(),t(void 0),r.sky?.stop()},update(n,o){let i=Object.assign(n,wre(o));e.follow(i),xre(r,i)}}}function yFe({enabled:e,by:t,parts:r}){for(let n of Object.values(r))n&&Object.freeze(n);return Object.freeze({enabled:e,by:typeof t=="object"?Object.freeze(t):t,parts:Object.freeze(r)})}var xFe={sky:!0,stats:!0,physics:!1,terrain:!1,particles:!1,audio:!1,avatar:!1,animation:!1,effects:!1,benchmark:!1,guides:!1,pathTracing:!1,compiler:!1,deformation:!1,volumes:!1,decals:!1,marks:!1,subsurface:!1,sampledLights:!1,water:!1,ambientOcclusion:!1,hair:!1,fog:!1,translucentLightVolume:!1,cubeCaptures:!1,planarReflections:!1,sortedTranslucency:!1,reflections:!1,bounce:!1,shadows:!1,lightProfiles:!1,lightPatterns:!1,autoExposure:!1,rectLightPictures:!1,displacement:!1,virtualTextures:!1,bakedLight:!1,foliage:!1,instruments:!1,gltfExport:!1,worldGrid:!1,vehicleSounds:!1},bFe=e=>Object.freeze(Dk.map(({name:t,summary:r,parts:n,requires:o,enabledByDefault:i})=>Object.freeze({name:t,summary:r,parts:n,requires:o,enabledByDefault:i,state:yFe(e.state(t))}))),Ere=(e,t)=>(r,n)=>{r==="sky"&&Pf(n),e(t,r,n)};function EFe(e){return{set:Ere(e,"editor"),clear:t=>e("editor",t,null)}}function TFe(e,t){return{set:Ere(t,"page"),clear:r=>t("page",r,null),state:r=>e.state(r),list:()=>bFe(e),editor:EFe(t)}}var AFe=({animation:e,lives:t},r)=>({world:void 0,panel:void 0,lives:{...t,avatar:mC(),compiler:r},terrains:Bk(),animation:e}),OFe=(e,t,r,n)=>({sky:wFe(e,t,r),stats:dFe(n),physics:Te("physics"),terrain:hFe,particles:Te("particles"),audio:Te("audio"),avatar:Te("avatar"),animation:gFe,effects:yre("effects"),benchmark:pFe,guides:yre("guides"),pathTracing:Te("pathTracing"),compiler:Te("compiler"),deformation:Te("deformation"),volumes:Te("volumes"),decals:Te("decals"),marks:Te("marks"),subsurface:Te("subsurface"),sampledLights:Te("sampledLights"),water:Te("water"),ambientOcclusion:Te("ambientOcclusion"),hair:Te("hair"),fog:Te("fog"),translucentLightVolume:Te("translucentLightVolume"),cubeCaptures:Te("cubeCaptures"),planarReflections:Te("planarReflections"),sortedTranslucency:Te("sortedTranslucency"),reflections:Te("reflections"),bounce:Te("bounce"),shadows:Te("shadows"),lightProfiles:Te("lightProfiles"),lightPatterns:Te("lightPatterns"),autoExposure:Te("autoExposure"),rectLightPictures:Te("rectLightPictures"),displacement:Te("displacement"),virtualTextures:Te("virtualTextures"),bakedLight:Te("bakedLight"),foliage:Te("foliage"),instruments:Te("instruments"),gltfExport:fFe,worldGrid:mFe,vehicleSounds:Te("vehicleSounds")});function Tre(e){let t,r=!1,n=pM(()=>a.state("compiler"),()=>r),o=AFe(e,n),i=SFe(e.pictured),s={asked:void 0,run:void 0},a=RA(Dk,OFe(i,f=>void(t=f),o.lives,s));a.apply(o);let l=()=>{o.panel=e.canvas.parentElement??void 0;let f=a.apply(o).some(h=>xFe[h]);(c.follow()||f)&&e.changed()},c=LFe(s,a,o,l),u=(f,h,m)=>{a.set(f,h,m),l(),h==="physics"&&a.state(h).enabled&&o.lives.physics?.start()},d=TFe(a,u);return{get sky(){return t??Uk},scene:f=>u("scene","sky",f),page:d,runs:a.runs,...RFe(o,d),terrains:o.terrains,animation:e.animation?.runs,opened:()=>uFe(o.lives),openStats:c.open,compiler:n,dispose(){r=!0,R8(d),a.dispose(),s.asked=void 0,e.animation?.dispose()}}}function LFe(e,t,r,n){let o=s=>{let a=t.word("page","stats");return!!a&&a.parts===s.word},i=s=>{e.asked===s&&(e.asked=void 0,o(s)&&t.set("page","stats",s.before&&s.before.parts),n())};return{follow(){let{asked:s,run:a}=e;if(s&&!t.runs("stats"))i(s);else if(a&&a.for!==s)return a.handle.stop(),Object.assign(a,bre(r,s,a.parts)),!0;return!1},open({parts:s,...a}){let{asked:l}=e,c={shown:a,word:{...s},before:l&&o(l)?l.before:t.word("page","stats")};e.asked=c,t.set("page","stats",c.word),n();let u=()=>e.run?.for===c?e.run.handle:void 0;return{stop:()=>i(c),ready:u()?.ready??Promise.resolve(),get instruments(){return u()?.instruments??null},show(d){c.shown.tab=d,u()?.show(d)}}}}}function RFe(e,t){return{bind(r){e.world=r},bindPhysics(r){return e.lives.physics=r,n=>t.set("physics",n)},bindAvatar:r=>e.lives.avatar.bind(r)}}var _Fe=[];function Ore(e){if(Ao(e))return!0;for(let t of e.children)if(Ore(t))return!0;return!1}var vFe=(e,t)=>{let r=Object.keys(t);return r.length===Object.keys(e).length&&r.every(n=>n in e)};function Lre(e,t=()=>Uk){let r={scene:e,moduleSky:t,stored:new Map,bounds:new rr,holders:new Set,below:new Map,shown:new Set,pictures:new Map,sh:cA(),next:1,boundsStale:!0,indexed:!1,held:0,surrounding:!1},n=o=>DFe(r,o);return W({reset(){r.stored.clear(),r.boundsStale=!0},boundsMoved(){r.boundsStale=!0},structure(){r.indexed&&(r.holders.clear(),r.below.clear(),r.indexed=!1),r.boundsStale=!0},get held(){return r.held},get pictures(){return r.pictures},holds:o=>r.indexed?r.holders.has(o):Ore(o),sync:o=>PFe(r,o,n)})}var MFe=new Float64Array(6);function DFe(e,t){let{bounds:r}=e;e.boundsStale&&r.setFromObject(e.scene),e.boundsStale=!1;let n=tre(pn(r,MFe),0,t.x,t.y,t.z);return Number.isFinite(n)&&n>0?n:1}function Rre(e,t){let r=Ao(t);for(let n of t.children){if(!Rre(e,n))continue;r=!0;let o=e.below.get(t);o?o.push(n):e.below.set(t,[n])}return r&&e.holders.add(t),r}function _re(e,t,r){for(let n of e.below.get(t)??_Fe){let o=r&&n.visible;Ao(n)&&(e.held++,o&&vre(e,n)),_re(e,n,o)}}function vre(e,t){e.shown.add(t),w9(t,e.sh)&&(e.surrounding=!0)}function Are(e,t,r,n){t.removeLight(n),e.stored.delete(r)}function PFe(e,t,r){let{scene:n,stored:o,shown:i,sh:s}=e;e.indexed||(Rre(e,n),e.indexed=!0),i.clear(),e.pictures.clear(),s.fill(0),e.surrounding=!1,e.held=0,_re(e,n,n.visible);for(let a of e.moduleSky().lights)vre(e,a);for(let[a,{id:l}]of o)i.has(a)||Are(e,t,a,l);for(let a of i){let l=o.get(a),c=l?.id??`world-light-${e.next++}`,u=S9(a,c,r);if(!u){l&&Are(e,t,a,c);continue}u.sourceTexture!==void 0&&e.pictures.set(u.sourceTexture,c8(a)),!(l&&kU(l.record,u))&&(l&&vFe(l.record,u)?t.setLight(c,u):(l&&t.removeLight(c),t.addLight(u)),o.set(a,{id:c,record:u}))}return e.surrounding?s:void 0}function Vk(e){for(let t=e;t;t=t.parent)if(!t.visible)return!1;return!0}var Jm=[],CFe=[0],Gk=e=>We(e)?a$(e):CFe,IFe=new Float64Array(16);function kFe(e,t,r,n){let o=e.geometry,i=o.boundingBox??o.computeBoundingBox();if(i.min.x>i.max.x)return[];e.updateWorldMatrix(!0,!1);try{let s=Qr(e.material),a=s.volumeOutputs(),l=We(e);return t.map((c,u)=>{let d=e.matrixWorld.elements;return l&&(d=jm(IFe,e,r[u])),{id:c,shape:"box",matrix:[...d],boundsMin:[i.min.x,i.min.y,i.min.z],boundsMax:[i.max.x,i.max.y,i.max.z],material:a,graph:s.graph}})}catch(s){return n(e,s),[]}}function Mre(e,t){let r=new Map,n=new WeakSet,o=1,i=(a,l)=>{n.has(a)||t(a,l),n.add(a)},s=(a,l,c)=>{let u=r.get(l)??[],d=c.length,f=u.length;for(;u.length<d;)u.push(`world-fog-volume-${o++}`);let h=kFe(l,u.slice(0,d),c,i),m=h.length?d:0;h.forEach((w,x)=>{x<f?a.setFogVolume(w.id,w):a.addFogVolume(w)});for(let w of u.slice(m,f))a.removeFogVolume(w);u.length=m,m?r.set(l,u):r.delete(l)};return{reset(){r.clear()},sync(a){for(let l of e)s(a,l,_b(l)&&Vk(l)?Gk(l):Jm);for(let l of[...r.keys()])e.has(l)||s(a,l,Jm)}}}var FFe=new Float64Array(16);function NFe(e){let t=e.emissive.toArray().map(r=>r*e.emissiveIntensity);return{color:e.color.toArray().map(r=>k(r,0,1)),opacity:k(e.opacity,0,1),emissive:t.map(r=>Math.max(r,0)),blend:Cz(e),graph:e.graph}}function BFe(e,t,r){let n=e.geometry,o=n.boundingBox??n.computeBoundingBox();if(o.min.x>o.max.x)return[];e.updateWorldMatrix(!0,!1);let i=NFe(Qr(e.material)),s=We(e);return t.map((a,l)=>({id:a,matrix:[...s?jm(FFe,e,r[l]):e.matrixWorld.elements],boundsMin:[o.min.x,o.min.y,o.min.z],boundsMax:[o.max.x,o.max.y,o.max.z],sortOrder:e.renderOrder,...i}))}function Dre(e,t){let r=new Map,n=new WeakSet,o=1,i=(s,a,l)=>{let c=r.get(a)??[],u=l.length,d=c.length,f=d;for(;c.length<u;)c.push(`world-decal-${o++}`);let h=u;try{let m=BFe(a,c.slice(0,u),l);m.forEach((w,x)=>{x<f?s.setDecal(w.id,w):(s.addDecal(w),d=x+1)}),m.length||(h=0)}catch(m){n.has(a)||t(a,m),n.add(a),h=0}for(let m of c.slice(h,d))s.removeDecal(m);c.length=h,h?r.set(a,c):r.delete(a)};return{reset(){r.clear()},sync(s){for(let a of e)i(s,a,vb(a)&&Vk(a)?Gk(a):Jm);for(let a of[...r.keys()])e.has(a)||i(s,a,Jm)}}}function Pre(e){let t,r=null;return{write(n){let o=e.background?.getHex();n===r&&o===t||(r=n,t=o,n.setClearColor(o))}}}var Cre=1e4;function B7t(e,t=Cre,r){let n="start",o=!0,i=gr(()=>console.warn(`[trillion3d] ${e||"world"}: the session has not opened after ${t/1e3} s; last step: ${n}`),t);return{note(s,a,l){n=`${s} (${a})`,o&&r?.(s,a,l)},done(){o=!1,clearTimeout(i)}}}function Ire(e,t=Cre){let r=gr(()=>{let n=e();n&&console.warn(`[trillion3d] no frame drawn ${t/1e3} s after the world began: ${n}`)},t);return()=>clearTimeout(r)}var rT=new WeakSet,tT=new WeakMap,kre=e=>void rT.add(e),V7t=e=>rT.has(e);function G7t(e,t){if(!rT.has(e))return t();tT.set(e,t)}var H7t=e=>void tT.delete(e);function Hk(e,t=!1){t&&rT.delete(e);let r=tT.get(e);tT.delete(e),r?.()}var UFe=()=>({over:!1,causes:[],next:null,waits:new Set}),Fre=({ends:e},t)=>yo(e,t,UFe);function Nre(e,t,r=[]){let n=Fre(e,t);n.over=!0,n.causes=r;for(let o of n.waits)o();return n.waits.clear(),n}function VFe(e,t,r){let n=Nre(e,t,r);e.last&&(e.last.next=n),e.last=n}function GFe(e,t){let r=new Set;for(let n=e.ends.get(t);n?.over;n=n.next??void 0)for(let o of n.causes)r.add(o);return[...r]}function HFe(e,t,r){let n=Fre(e,t);return n.over?Promise.resolve():new Promise((o,i)=>{let s=()=>o();n.waits.add(s),r.then(()=>(n.waits.delete(s),o()),a=>(n.waits.delete(s),i(a)))})}function WFe(e,t,r,n){let o=e.reopening;if(!o)return;e.reopening=null;let i=[...o.causes];t.say("session-reopen",`The world's session opened again (${i.join(", ")})`,{kind:"lifecycle",cause:i.join("+"),drawn:n,durationMs:er(o.start),framesWithoutImage:o.frames,keptPages:r()})}function zFe(e,t,r){let{reopening:n,frame:o}=e;if(n){for(let s of t)n.causes.add(s);n.start=Math.min(n.start,r);return}let i={causes:new Set(t),start:r,frames:0,tick(){e.reopening===i&&(i.frames++,o?.(i.tick))}};e.reopening=i,o?.(i.tick)}function Bre(e,t,r,n){kre(e);let o={wanted:new Set,ends:new WeakMap,last:null,reopening:null,since:1/0,frame:globalThis.requestAnimationFrame?.bind(globalThis)},i=a=>WFe(o,t,n,a);return{request:(a,l)=>{o.wanted.add(a),l!==void 0&&(o.since=Math.min(o.since,l)),r()},closing(a){let l=[...o.wanted],c=Math.min(Z(),o.since);o.wanted.clear(),o.since=1/0,a&&(VFe(o,a,l),zFe(o,l,c))},closedBy:a=>GFe(o,a),drew:()=>i(!0),shown(){o.reopening&&Object.assign(o.reopening,{start:Z(),frames:0})},none(){Hk(e),i(!1)},untilEnded:(a,l)=>HFe(o,a,l),dispose(a){a&&Nre(o,a),Hk(e,!0),i(!1)}}}function q7t(e){e.updateMatrixWorld(!0)}function Ure(e,t){for(let r=0;r<16;r++)if(!Number.isFinite(e[r]))throw new E("NON_FINITE_TRANSFORM",`${t}: non-finite matrix`,{nodeName:t,index:r,value:e[r]})}var Md=new Float64Array(16),Vre=new Float64Array(16),nT=new Float64Array(3),eg=new Float64Array(4),oT=new Float64Array(3);function jFe(e,t,r){if(r.length!==16)throw new E("INVALID_TRANSFORM",`${t}: sixteen floats expected`,{length:r.length});let n=Lb(e,t);if(!n)throw new E("UNKNOWN_SCENE_NODE",`node ${t} missing from the prepared scene`,{nodeName:t});return n}function $Fe(e,t){Ure(t,e.name);let r=ti(e).worldMatrix,n=e.parent,o=n?n.worldMatrix:null;if(lN(t,r))return!1;if(Ce(Md,t),n&&o){let i=mi(o);if(i===0||!Number.isFinite(i))throw new E("SINGULAR_PARENT_TRANSFORM",`${e.name}: parent world matrix not invertible`,{nodeName:e.name,parentName:n.name,determinant:i});mr(Vre,o),Ve(Md,Vre,Md)}return!e.matrixAutoUpdate&&ua(e._matrixElements,Md)?!1:(Rr(Md,nT,eg,oT),e.position.set(nT[0],nT[1],nT[2]),e.quaternion.set(eg[0],eg[1],eg[2],eg[3]),e.scale.set(oT[0],oT[1],oT[2]),Ce(e.matrix.elements,Md),e.matrixAutoUpdate=!1,!0)}function Gre(e,t,r){let n=jFe(e,t,r);return $Fe(n,r)?n:null}function tg(e){let t=e;return!!t&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.z)}var YFe=Object.freeze({});function Hre(e,t,r){if(e!==void 0&&!Array.isArray(e))throw new E(r,`${t} is a list of objects`,{[t]:e})}function Wre(e,t){let r=e??YFe;return Hre(r.objects,"objects",t),Hre(r.skip,"skip",t),r}function KFe(e){if(e===void 0)return 1/0;if(!(typeof e=="number"&&e>=0))throw new E("INVALID_RAYCAST_REACH","A raycast reach is 0 or more",{reach:e});return e}function zk(e,t){let r=Wre(t,"INVALID_RAYCAST"),{origin:n,direction:o}=e??{},i=tg(o)?te(o.x,o.y,o.z):NaN;if(!tg(n)||!tg(o)||!(i>0&&Number.isFinite(i)))throw new E("INVALID_RAYCAST","A ray has a finite origin and a direction of a finite length above 0",{origin:n,direction:o});return{origin:[n.x,n.y,n.z],direction:[o.x/i,o.y/i,o.z/i],reach:KFe(r.reach),options:r}}var Wk=(e,t)=>new E("INVALID_OVERLAP",`A box has ${e}`,t);function qFe(e){if(e===void 0)return[0,0,0,1];let{x:t,y:r,z:n,w:o}=e??{},s=Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(n)&&Number.isFinite(o)?nc(t,r,n,o):NaN;if(!(s>0&&Number.isFinite(s)))throw Wk("a turn of four finite parts, of a length above 0",{rotation:e});return[t/s,r/s,n/s,o/s]}function jk(e,t){let r=Wre(t,"INVALID_OVERLAP"),{center:n,halfExtents:o,rotation:i}=e??{};if(!tg(n))throw Wk("a finite centre",{center:n});if(!tg(o)||!(o.x>=0&&o.y>=0&&o.z>=0))throw Wk("finite half extents of 0 or more",{halfExtents:o});let s=xa(new Float64Array(16),qFe(i)),a=[s[0],s[1],s[2],s[4],s[5],s[6],s[8],s[9],s[10]],l=[n.x,n.y,n.z],c=[o.x,o.y,o.z],u=[0,1,2,3,4,5,6,7].map(d=>[0,1,2].map(f=>l[f]+(d&1?1:-1)*c[0]*a[f]+(d&2?1:-1)*c[1]*a[3+f]+(d&4?1:-1)*c[2]*a[6+f]));return{box:{centre:l,axes:a,half:c,corners:u},options:r}}var iT=M.modelSurface;function zre(e,t,r){return(n,o)=>{let i=Gre(e,n,o);i&&(t.moved(i),r())}}function jre(e,t,r,n,o,i,s,a){return{raycast:J7(e,t,r,()=>n.explorer?.engine,()=>n.models,()=>n.opened(),o,()=>n.leftBehind(),i),setTransform(l,c){n.moveNamed(l,c)},...XFe(n,s,a)}}function XFe(e,t,r){let n;return{raycastNow(o,i){let s=zk(o,i);if(en("world.raycastNow","foliage",t,r()),!iT.arrived)return null;let a=iT.get();return a.raycastNow(e.models,s,n??=a.surfaceWalk())},overlapNow(o,i){let s=jk(o,i);if(en("world.overlapNow","foliage",t,r()),!iT.arrived)return null;let a=iT.get();return a.overlapNow(e.models,s,n??=a.surfaceWalk())}}}var $k=({resolves:e},t,r)=>t.running??e.running??r();async function Yre(e,t){let{state:r,inputs:n}=e;for(;;){if(r.disposed)return!1;if(r.explorer)return!0;if(fr())return!1;let o=$k(e,t,()=>n.loading?.());if(!o)return!1;await o.catch(()=>{})}}async function Kre(e,t){let{state:r,contents:n}=e,o=()=>$k(e,t,()=>n.joining);for(let i=o();i;i=o())await i;await r.explorer?.frameWaits()}function sT({state:e},t){return!e.explorer&&!t.running&&!e.asked&&!e.disposed&&t.request(),t.running}var $re=(e,t)=>$k(e,t,()=>e.contents.joining??e.inputs.flying?.());async function qre(e,t,r){let{state:n}=e,o=!1;for(;;){if(n.disposed)return null;let i=$re(e,t);if(i){await i.catch(()=>{});continue}let s=n.explorer;if(!s){if(o)return null;o=!0,t.request();continue}if(await s.frameWaits(),n.explorer===s&&(r(),!$re(e,t)))return s}}function Xre({state:e,contents:t},r){return e.disposed||!(r.moving??=t.handing()).some(t.waitsOnHandOver)?!1:(r.since??=Z(),Z()-r.since<3e4)}function Qre({waits:e,draw:t,closed:r,failed:n}){let o=null,i=(a,l)=>{if(o)return void(o.ahead=l);let c=o={ahead:l};a.then(()=>{if(o===c&&(o=null,!r()))try{s(c.ahead)}catch(u){n(u)}})},s=a=>{let l=e();if(l)return i(l,a),null;o=null;let c=t(a),u=c===null?e():void 0;return u&&i(u,a),c};return s}function Zre(e,t){let{inputs:r,state:n,contents:o,track:i,led:s,placeCamera:a}=e,l=d=>{d?.(),t(),n.explorer&&(s&&n.explorer.followCanvas(),r.placeMain?.(),a(n.explorer.camera))},c=d=>{o.cuts.dynamic.drew(d),i.drew(),r.frame(d)};return{beforeFrame:l,afterDraw:c,draw:d=>{if(!n.explorer)return r.headless?.lived(()=>l(d),c)??null;l(d);let f=n.explorer;if(!f)return null;if(!f.drawing)return f.live(),Eh;let h=f.render();return c(h),h}}}function Jre(e,t,r){let{inputs:n,state:o}=e;return Qre({waits:()=>o.explorer?o.explorer.frameWaits():n.headless?null:e.resolves.running??t.running??sT(e,t),draw:r,closed:()=>o.disposed,failed(i){ju("A frame asked by world.render() failed",i,n.canvas.ownerDocument?.defaultView)}})}function ene(e){let{batches:t,models:r,ranks:n,worldModels:o}=e,i=new Map;for(let m of r)i.set(m.record,o.drawsOf(m));let s=[...i.values()],a=s.flatMap(({draws:m,variants:w})=>[...m,...w]),l=s.flatMap(({primitives:m})=>m),c=new Set;for(let{cut:m}of t)c.has(m)||(c.add(m),l.push(n.primitive(m)));let{first:u,metadata:d,base:f}=QFe(r,l),h=new or;return{root:h,source:{manifestUrl:u?.manifestUrl??f,metadataUrl:u?.metadataUrl??f,base:f,metadata:d,scene:{source:h,draws:[...t,...a],textureCaches:r.flatMap(m=>m.record.scene.textureCaches),framingLot:null,nodes:null,streams:new Set,ragdoll:null,clips:[],banks:null,partitions:r.flatMap(m=>Bt(m)),worldRoots:[...new Set(r.flatMap(m=>o.rootsOf(m)))]}}}}function QFe(e,t){let r=e[0]?.record,n=t.reduce((s,a)=>s+a.pages.reduce((l,c)=>l+c.count/3,0),0),o={...r?.metadata??{},formatVersion:r?.metadata.formatVersion??ia,status:"ready",key:r?.metadata.key??"world",scope:r?.metadata.scope??"full",errorModel:r?.metadata.errorModel??vo,clusterStrategy:r?.metadata.clusterStrategy??"dag-groups",geometryPages:{formatVersion:12,codec:CL},sourceTriangles:n,selectedTriangles:n,selectedNodes:0,totalNodes:0,primitives:t},i=r?.base??(typeof document>"u"?"http://localhost/":document.baseURI);return{first:r,metadata:o,base:i}}var tne=()=>({explorer:null,seatWanted:!1,lightsChanged:!0,picturesChanged:!1,ending:new AbortController,get disposed(){return this.ending.signal.aborted},closed:"the scene has not been read yet",asked:!1,settingsRead:!1});async function ZFe(e){let{inputs:t,state:r}=e;for(await t.ready().catch(()=>{});e.resolves.running&&!r.disposed;)await e.resolves.running}function JFe(e){let{inputs:t,state:r,contents:n,lights:o,volumes:i,decals:s,track:a}=e;r.closed="its session is opening",r.seatWanted&&n.seat(),r.seatWanted=!1;let l=n.plan(),c=ene(l);return a.closing(r.explorer),r.explorer?.dispose(),r.explorer=null,r.settingsRead=!1,l.release(),o.reset(),i.reset(),s.reset(),r.lightsChanged=!0,t.diagnostic.opening(),t.noted?.("opening","Opening the view"),c}function eNe({inputs:e,lights:t},r){r.setView("lit");let n={addLight:r.add,setLight:r.set,removeLight:r.remove};r.setEnvironment({...e.display(),irradiance:t.sync(n)})}async function tNe(e,t){let{inputs:r,state:n,placeCamera:o,moveNamed:i}=e,{canvas:s}=r;try{let a=t.source.metadata.scope;fr()&&(await ud(n.ending.signal),e.track.shown());let l=r.open??(await M.session.load()).openMeasuredWorld;await r.ready(),n.settingsRead=!0;let c={...r.options(),scope:a,onContentRefused:(d,f)=>Mn(r.diagnostic.notices,d,f),placedTargets:e.contents.placed,onPartitionOutgrown:()=>Mn(r.diagnostic.notices,"partition rows","the view outgrew the rows and the engine cannot grow them in place: the cells past them wait")};return{explorer:n.explorer=await l(s,c,{...t.source,placeCamera:o,moveNamed:i,lights:d=>eNe(e,d)}),options:c}}catch(a){n.settingsRead=!1,n.closed="its session failed to open",n.disposed||r.diagnostic.failed(a);return}}function rne(e,t,r=Bl){let n=NaN,o;return()=>{if(t()){if(e.shape!==n){n=e.shape,o=void 0;for(let i of e.loaded)if(o=XE(r(i)))break}return o}}}function nne(e){let{inputs:t,state:r,track:n}=e;return async()=>{if(r.disposed||(r.asked=!0,t.headless)||!r.explorer&&(await ZFe(e),r.disposed))return;let o=await tNe(e,JFe(e));if(!o)return n.none();let{explorer:i,options:s}=o;if(r.disposed)return i.dispose();i.setLightingView("lit"),r.seatWanted=!0,e.invalidate(),t.opened(i,s)}}function one(e,t,r){let{state:n,contents:o}=e;n.seatWanted=!1,o.seat(r??void 0),!r&&!t.running&&t.request(),sne(e,r)}function ine(e,t){let{state:r}=e,n=r.explorer;n&&r.seatWanted&&!t.running&&one(e,t,n)}function sne({state:e,contents:t},r){let n=t.repainted(),o=e.explorer===r?r:null;n.length&&t.repaint(n,o?.refreshMaterials.bind(o))}function ane(e,t){let{inputs:r,state:n,contents:o,lights:i,volumes:s,decals:a,background:l,invalidate:c}=e,{poses:u,cuts:d}=o,f=VJ(()=>n.explorer,()=>Mn(r.diagnostic.notices,"rewritten vertices","the engine cannot write them in place: they are not drawn"));return()=>{let h=n.explorer;n.seatWanted?one(e,t,h):o.repaintPending&&sne(e,h),o.handOver(h??void 0)&&c(),o.assemblies.step(h??void 0)&&c(),!(!h||n.explorer!==h)&&(d.dynamic.upload(qJ,f),u.pending&&u.apply(r.scene,o.seats,o.models,(m,w,x)=>h.updatePlacementRuns(m,w,x),{key:h,epoch:o.seatEpoch,link:(m,w,x,b)=>h.composePlacements(m,w,x,b)},(m,w,x,b)=>h.followPlacements(m,w,x,b)),n.lightsChanged?(h.setEnvironment({...r.display(),irradiance:i.sync(h)}),h.syncRectLightPictures(i.pictures),h.applySky(r.modules.sky.resolved)):n.picturesChanged&&h.syncRectLightPictures(i.pictures),n.lightsChanged=n.picturesChanged=!1,s.sync(h),a.sync(h),h.syncPlacedObjects(o.placedObjects,r.diagnostic.notices),l.write(h))}}function lne(e){let{canvas:t,scene:r,camera:n}=e,o=tne(),i=()=>o.explorer?.invalidate(),s=le=>{o.seatWanted||=le,i()},{contents:a,lights:l,volumes:c,decals:u,background:d}=oNe(e,{wake:s,named:e.named,camera:n}),f=qQ(n,t,e.viewport),h=Bre(t,e.diagnostic.notices,()=>L.request(),()=>e.options().pageCache?.pageCount??0),m=zre(r,a,i),w=()=>(o.lightsChanged=!0,i()),x=()=>(o.picturesChanged=!0,i()),b=e.options().interactive===!1,T={inputs:e,state:o,contents:a,lights:l,volumes:c,decals:u,background:d,track:h,led:b,placeCamera:f,moveNamed:m,resolves:eI(()=>D()),invalidate:i},L=eI(nne(T)),_=ane(T,L),D=iNe(T,L,_),C=()=>T.resolves.request();a.watch.asked=C;let j=Zre(T,_),$=rNe(e,o);r._link=GX({contents:a,lights:l,invalidate:i,relight:w,repicture:x,schedule:C,sky:e.modules.scene,notices:e.diagnostic.notices});let q=sNe(T,L,j,{relight:w,unwatch:$});return Object.assign(q,nNe(a))}function rNe(e,t){return e.headless?()=>{}:Ire(()=>e.drawn()||t.disposed||!e.scene.children.length||!e.drawing()?null:t.explorer?"its session is open and draws nothing":`no session has opened, ${t.closed}`)}var nNe=e=>({drawnFrom:t=>SJ(e.seats,t),leftBehind:e.leftBehind,modelDrawn:e.modelDrawn});function oNe(e,t){let{scene:r}=e,n=qte(r,e.diagnostic.notices,e.clock,t),o=Lre(r,()=>e.modules.sky),i=Mre(n.volumes,(l,c)=>Mn(e.diagnostic.notices,"a volume material",c instanceof Error?c.message:String(c))),s=Dre(n.decals,(l,c)=>Mn(e.diagnostic.notices,"a decal material",c instanceof Error?c.message:String(c))),a=Pre(r);return{contents:n,lights:o,volumes:i,decals:s,background:a}}function iNe(e,t,r){let{inputs:n,state:o,contents:i,invalidate:s}=e,a=(u,d)=>{!o.explorer&&!o.settingsRead&&n.noted?.("contents","Preparing the meshes",{completed:u,total:d})},l=Wo(()=>ine(e,t)),c=()=>{o.seatWanted=!0,o.explorer&&!t.running?l.schedule():t.running||r(),s()};return async()=>{if(!n.headless){await n.ready().catch(()=>{});try{for(;!o.disposed&&(await i.resolve(c,a)&&(o.lightsChanged=!0),c(),!!i.staleCount););}catch(u){o.closed="the scene could not be resolved",o.lightsChanged=!0,o.disposed||n.diagnostic.failed(new Error("World scene resolution failed",{cause:u}))}}}}function sNe(e,t,{beforeFrame:r,afterDraw:n,draw:o},{relight:i,unwatch:s}){let{state:a,contents:l,track:c}=e;return W({beforeFrame:r,afterDraw:n,invalidate:e.invalidate,ask:()=>a.explorer?a.explorer.invalidate():void sT(e,t),moveNamed:e.moveNamed,renew:c.request,get holdsSession(){return a.explorer!==null||t.running!==null},get settingsRead(){return a.settingsRead},untilEnded:c.untilEnded,closedBy:c.closedBy,displayChanged:i,get explorer(){return a.explorer},chain:rne(l,()=>a.explorer!==null),models:l.loaded,settled:()=>Kre(e,t),opened:()=>Yre(e,t),drawable:()=>qre(e,t,()=>r()),handing:u=>Xre(e,u),render:Jre(e,t,o),dispose:()=>(s(),aNe(e))})}function aNe({inputs:e,state:t,contents:r,track:n}){t.ending.abort(Jr),WG(e.scene),e.modules.dispose(),t.explorer?.dispose(),n.dispose(t.explorer),r.assemblies.dispose(),r.cuts.dispose(),r.dispose(),e.scene.traverse(o=>o._link=null)}var lNe=["controls","device","physics","quality","debug","loadingIndicator"],cNe=new Set([...mX,...lNe]),cne=(e,t)=>({...Object.fromEntries(Object.entries(e).filter(([r])=>!cNe.has(r))),manifestUrl:"",importedLights:!1,interactive:e.interactive!==!1,...t});function uNe(e,t){let r=-1,n=[];return()=>{e.revision!==r&&(r=e.revision,n=e.passes.flatMap(i=>i instanceof $l?i.objects:[]));let o=[...n];for(let i of t())Ht(o,i.hidden),Ht(o,i.showOnly??[]);return o}}var dNe=({switches:e,state:t,views:r})=>uNe(e.held.effects,()=>[t.camera,...r.list.map(n=>n.camera)]);async function fNe(e){for(let t=e.pending;!e.gpuDevice;t=e.pending)if(await t,!e.gpuDevice&&e.pending===t)throw new E("WEBGPU_LOST","The world gave its device back while it opened")}async function pNe({device:e,switches:t,loading:r}){await e.pending,await Promise.all([t.decided(),(async()=>{for(let n=r();n;n=r())await n})()]),await fNe(e)}var hNe=(e,t)=>({exposure:e.exposure,toneMapping:e.toneMapping,sharpness:e.sharpness,vignette:e.vignette,fog:t.sky.resolved?.fog,atmosphere:t.sky.resolved?.atmosphere}),mNe=e=>({get waiting(){return e().waiting}});function gNe(e,t,r){e.device.opened(),e.switches.apply(t,r),e.modules.opened(),e.diagnostic.apply(t),e.views.attach(t)}function SNe(e,t){e.views.drawnIn(t),e.frames.dispatch(t),e.views.dispatch(),e.state.animating&&e.invalidate()}function une(e){let{canvas:t,options:r,device:n,scene:o,state:i,frames:s,switches:a,pools:l,diagnostic:c}=e,{views:u,modules:d}=e,f=lne({canvas:t,ready:()=>pNe(e),loading:e.loading,flying:e.flying,scene:o,camera:()=>i.camera,viewport:u.mainRect,placeMain:u.follow,drawing:()=>a.held.drawing,options:()=>cne(r,{gpuDevice:n.gpuDevice,...a.held,...a.ruled(),...a.raster,...a.streaming,...a.worldStreaming,...a.cut,...a.animation,...a.shading,...NZ(l),avatars:mNe(e.avatars),animation:d.animation,beforeFrame:()=>f.beforeFrame(e.step),worldClock:s.clock,realClock:s.real,why:e.diagnostic.why,time:e.diagnostic.time,drawViews:u.draw,partition:e.partition,onOpeningStep:e.noted,onFrame:h=>f.afterDraw(h)}),opened:(h,m)=>gNe(e,h,m),frame:h=>SNe(e,h),drawn:()=>s.last!==null,clock:s.quietClock,named:dNe(e),display:()=>hNe(i,d),modules:d,diagnostic:c,noted:e.noted,headless:e.headless});return f}var Yk=e=>e&&[e[0],e[1],e[2]],wNe=e=>e&&[e[0],e[1],e[2],e[3]],dne=e=>e&&[e[0],e[1]],yNe=e=>typeof e=="object"?dne(e):e,xNe=[0,-Yo.earth,0],bNe=e=>({distance:e.distance,radius:e.radius,outsideView:e.outsideView,reaction:e.reaction}),ENe=e=>({velocity:Yk(e.velocity),resistance:e.resistance}),TNe=e=>({strength:e.strength,frequency:e.frequency,pan:Yk(e.pan),seed:e.seed}),ANe=e=>({image:e.image,grid:dne(e.grid),frames:e.frames,mode:e.mode,rate:e.rate,startFrame:yNe(e.startFrame),blend:e.blend}),ONe=e=>typeof e=="object"&&e!==null?{...e}:e;function fne(e,t,r){return Object.freeze({shape:e.shape,size:e.size,aspect:e.aspect,rotation:e.rotation,spin:e.spin,align:e.align,stretch:e.stretch,flipbook:e.flipbook&&ANe(e.flipbook),sort:e.sort,sortPriority:e.sortPriority,sortOrderHint:e.sortOrderHint,emitterOrder:e.emitterOrder,ribbon:e.ribbon,mesh:e.mesh,color:e.color,normalSpeed:e.normalSpeed,inheritVelocity:e.inheritVelocity,colorOverLife:e.colorOverLife,sizeOverLife:e.sizeOverLife,spinOverLife:e.spinOverLife,speedOverLife:e.speedOverLife,drag:e.drag,wind:e.wind&&ENe(e.wind),curlNoise:e.curlNoise&&TNe(e.curlNoise),attractor:e.attractor,vortex:e.vortex,rate:e.rate,lifetime:e.lifetime,speed:e.speed,direction:e.direction,spread:e.spread,active:e.active,origin:void 0,orientation:void 0,acceleration:Yk(e.acceleration)??xNe,blend:e.blend??"additive",fade:wNe(e.fade),softness:t,translucencyPass:e.translucencyPass??"afterDepthOfField",killVolume:e.killVolume,cull:e.cull&&bNe(e.cull),qualityShare:ONe(e.qualityShare),collision:e.collision,paused:e.paused,timeScale:e.timeScale,warmup:e.warmup,lifetimeMost:r})}var mne=e=>typeof e=="number"?[e,e]:[e[0],e[1]];function Kk(e,t="warmup"){if(e===void 0||!Re(e,t))throw new Error("PARTICLE_TIME: a time scale, a warm-up and an advance are finite, 0 or more")}function pne(e){let{rate:t=0,lifetime:r=1,speed:n=1,direction:o=[0,1,0],spread:i=0}=e;if(!Re(t,"rate"))throw new Error("PARTICLE_RATE: a rate is a finite count of particles a second, 0 or more");let s=vd(r)&&mne(r);if(!vd(n)||!s||!s.every(c=>Re(c,"lifetime")))throw new Error("PARTICLE_SPAWN: a lifetime is positive and a speed finite, as a number or [min, max]");if(o.length!==3||!o.every(Number.isFinite)||!o.some(Boolean))throw new Error("PARTICLE_DIRECTION: a direction is three finite numbers, not all zero");if(!(Re(i,"spread")&&i<=qm.spread))throw new Error("PARTICLE_SPREAD: a cone has a half angle from 0 to \u03C0 radians");let{timeScale:a=1,warmup:l=0}=e;if(Kk(a,"timeScale"),Kk(l),!fk.includes(e.blend??"additive"))throw new Error(`PARTICLE_BLEND: a pool blends as ${fk.join(" or ")}`);return are(e),It(s)}var aT=class{pool;spec;constructor(t){this.spec={...t},ck(t.origin,t.orientation);let r=dk(t),n=hne(this.spec,pne(this.spec));this.pool=new JE(r,n,t.origin,t.orientation),this.pool.seed=(t.seed??1)>>>0}update(t){let{origin:r,orientation:n}=t;ck(r,n);let o=!0;for(let i in t)o&&=i==="origin"||i==="orientation";if(!o){let i={...this.spec,...t},s=dk(i),a=hne(i,pne(i));this.pool.respawn(a,vNe(t,this.spec)),this.pool.reshape(s),this.spec=i}this.pool.place(r,n)}burst(t){if(!(Number.isInteger(t)&&t>=0))throw new E("PARTICLE_BURST","PARTICLE_BURST: a burst is a whole number of particles, 0 or more");let{spawn:r,effects:n}=this.pool,o=r.qualityShare?.[n]??-1;this.pool.birth(o>=0&&t>0?Math.max(Math.floor(t*o),1):t)}advance(t){Kk(t),this.pool.ahead+=t}},LNe=new Set(["capacity","emitPerFrame","space","rate","active","paused","timeScale","warmup","cull","qualityShare","acceleration","inheritVelocity","fade","softness","stretch","blend","translucencyPass","sortPriority","sortOrderHint","emitterOrder","origin","orientation"]),RNe=(e,t)=>!e==!t&&e?.resistance===t?.resistance,_Ne=(e,t)=>!e==!t&&e?.strength===t?.strength&&e?.frequency===t?.frequency&&e?.seed===t?.seed;function vNe(e,t){for(let r in e){let n=r;if(!(LNe.has(n)||e[n]===t[n])&&!(n==="wind"?RNe(e.wind,t.wind):n==="curlNoise"&&_Ne(e.curlNoise,t.curlNoise)))return!0}return!1}function hne(e,t){let r=e.size??.1,n=mne(r),o=e.softness??It(n);if(!vd(r)||!n.every(i=>Re(i,"size"))||!Re(o,"softness"))throw new Error("PARTICLE_SIZE: a particle has a finite positive size and softness");return fne(e,o,t)}function MNe(e,t,r,n){e.push(r),n||M.particles.get();let{clock:o}=t;r.held=o.paused;let i=[o.onChange(()=>void(r.held=o.paused)),t.beforeFrame(({delta:s})=>{r.spawn.qualityShare&&(r.effects=t.quality.get("effects")),r.advance(s)}),t.onFrame(()=>r.moving&&t.invalidate())];return t.invalidate(),()=>{for(let a of i)a();let s=e.indexOf(r);s>=0&&e.splice(s,1)}}var gne=(e,t,r)=>void e.attached.set(t,MNe(e.pools,r,t,e.headless));function DNe(e,t,r){let{declared:n,attached:o,world:i}=e;if(n.has(t))throw new Error("PARTICLES_ATTACH: attached already");let s=r===i.invalidate?i:{...i,invalidate:r};return n.set(t,s),e.running&&gne(e,t,s),()=>{if(!n.delete(t))return;let a=o.get(t);a&&(o.delete(t),a(),s.invalidate())}}function PNe(e){let{declared:t,attached:r,world:n}=e;return{start(){if(!e.running){e.running=!0;for(let[o,i]of t)o.restart(),o.alive=0,gne(e,o,i)}},stop(){if(e.running){e.running=!1;for(let o of r.values())o();r.clear(),n.release()}},opened(){e.running||n.release()}}}function CNe(e,t,r){let{world:n}=e,o=()=>e.running&&n.invalidate();return{update:i=>(t.update(i),o()),burst:i=>(t.burst(i),o()),advance:i=>(t.advance(i),o()),restart:()=>(t.pool.restart(),o()),get alive(){let{pool:i}=t;return i.counted=!0,e.running?i.alive:0},get restarts(){return t.pool.restarts},dispose:r}}function qk(e,t,r=!1){let n={pools:e,world:t,headless:r,declared:new Map,attached:new Map,running:!1},o=(s,a=t.invalidate)=>DNe(n,s,a);return{handle:{add(s){let a=new aT(s);return CNe(n,a,o(a.pool))}},declare:o,life:PNe(n)}}var Sne=()=>new Error("listener.trace: the world was disposed before the line was answered."),wne=4,INe=.001;function kNe(e){let t=e.isMesh?e.material:void 0,r=Array.isArray(t)?t[0]:t;return!!r&&(r.transparent||r.alphaTest>0||(r.transmission??0)>0)}function FNe(e,t){for(let r=t;r;r=r.parent){let n=e.engineIdOf(r);if(n>=0)return n}return Mo}async function NNe(e,t){let r=new Uint32Array(Hi*t.length),n=t.map(({from:i,to:s,ignore:a},l)=>{let c=r.subarray(l*Hi,(l+1)*Hi),u=te(s.x-i.x,s.y-i.y,s.z-i.z)||1,d=[(s.x-i.x)/u,(s.y-i.y)/u,(s.z-i.z)/u];return ad(c,[i.x,i.y,i.z],d,u,FNe(e,a)),jb(c),u}),o=await e.cast(r);t.forEach(({settle:i},s)=>{let a=o.subarray(s*oy,(s+1)*oy),l=a[Fn.body],c=l===Mo?null:e.objectOf(l);i(c?{object:c,distance:Qi(a,Fn.fraction)*n[s]}:null)})}async function BNe(e,{from:t,to:r,ignore:n}){let o=te(r.x-t.x,r.y-t.y,r.z-t.z);if(!e||!(o>0))return null;let i=new I(r.x-t.x,r.y-t.y,r.z-t.z).divideScalar(o),s=n?{skip:[n]}:void 0,a=0;for(let l=0;l<wne;l++){let c=new I(t.x,t.y,t.z).addScaledVector(i,a),u=await e.castRay(new po(c,i.clone()),s,{reach:o-a});if(!u)return null;if(a+=u.distance,!kNe(u.object)||l===wne-1)return{object:u.object,distance:a};if(a+=INe,a>=o)return null}return null}function yne(e,t){let r=[],n=new Set,o=!1,i=()=>{let s=r;r=[];let a=e();if(a)NNe(a,s).catch(()=>s.forEach(l=>l.settle(null)));else for(let l of s)BNe(t(),l).then(l.settle,()=>l.settle(null))};return{line(s,a,l=null){return new Promise((c,u)=>{if(o)return u(Sne());let f={from:s,to:a,ignore:l,settle:h=>{n.delete(f),c(h)},refuse:u};n.add(f),r.length||queueMicrotask(i),r.push(f)})},dispose(){o=!0,r=[];for(let s of n)s.refuse(Sne());n.clear()}}}var Xk=A({volume:y("volume",1),paused:p("paused",!1),timeScale:y("timeScale",1),maxVoices:y("maxVoices",32),occlusionTraces:y("occlusionTraces",8),hrtf:p("hrtf",!1)}),xne=A({volume:y("volume",1),pitch:y("pitch",1),fadeTime:y("fadeTime",0)}),UNe=lc(xne),Dd=(e,t)=>Gd(Xk,"world.listener",e,t),rg=class{state=ds(Xk,{},{node:null});volumes=[];classes=new Map;audio=null;asked=null;disposed=!1;clockStood=0;silent;needs;tracer;constructor(t){this.needs=t,this.silent=!!t.silent,this.tracer=yne(t.physics,t.engine)}get node(){return this.state.node}set node(t){this.write("node",t)}get volume(){return this.state.volume}set volume(t){this.write("volume",Dd("volume",t))}get paused(){return this.state.paused}set paused(t){this.write("paused",Dd("paused",t))}get timeScale(){return this.state.timeScale}set timeScale(t){this.write("timeScale",Dd("timeScale",t))}get maxVoices(){return this.state.maxVoices}set maxVoices(t){this.write("maxVoices",Math.floor(Dd("maxVoices",t)))}get occlusionTraces(){return this.state.occlusionTraces}set occlusionTraces(t){this.write("occlusionTraces",Math.floor(Dd("occlusionTraces",t)))}get hrtf(){return this.state.hrtf}set hrtf(t){this.write("hrtf",Dd("hrtf",t))}get time(){return this.audio?.time()??this.clockStood}mixClass(t,r){for(let n of UNe){let o=r[n];o!==void 0&&Gd(xne,`world.listener.mixClass('${t}')`,n,o)}this.classes.set(t,{...this.classes.get(t),...r}),this.audio?.mixClass(t,r)}trace(t,r){return this.tracer.line(t,r)}write(t,r){this.state[t]=r,this.audio?.listenerChanged(t)}sounding(t){if(this.disposed||this.silent)return;if(this.audio)return t(this.audio);if(this.asked)return void this.asked.push(t);let r=this.asked=[t];Promise.all([M.audio.load(),M.pageAudio.load()]).then(([{WorldAudio:n},{heldPageContext:o}])=>{this.asked===r&&this.arrived(new n(this.needsOf(o())),r)},()=>{this.asked===r&&(this.asked=null)})}needsOf(t){let{camera:r,frames:n,clock:o}=this.needs,{state:i,volumes:s,tracer:a}=this,l=this.clockStood;return{camera:r,frames:n,clock:o,hold:t,state:i,volumes:s,tracer:a,player:this._player,since:l}}arrived(t,r){this.audio=t;for(let[n,o]of this.classes)t.mixClass(n,o);for(let n of r)n(t);this.asked=null}release(t){this.audio&&(this.clockStood=this.audio.time(),this.audio.dispose(t),this.audio=null)}_life={start:()=>{!this.silent||this.needs.silent||(this.silent=!1,this.needs.scene.traverse(this.entersAgain))},stop:()=>{this.silent||(this.silent=!0,this.asked=null,this.audio?.keepStarts(),this.release(!0))}};entersAgain=t=>{t.isSound&&t._player===this._player&&this._player.entered(t)};_player={entered:t=>{t.isAudioVolume&&this.volumes.push(t);let r=t;(this.audio||r.isSound&&(r.autoplay||r._start))&&this.sounding(n=>n.entered(t))},left:t=>{let r=this.volumes.indexOf(t);r>=0&&this.volumes.splice(r,1),t.isSound&&(this.audio||this.silent)&&(t._start=null),this.audio?.left(t)},asked:t=>this.sounding(r=>r.play(t)),stop:t=>this.audio?.stop(t),seek:(t,r)=>!!this.audio?.seek(t,r),fade:(t,r,n,o)=>!!this.audio?.fade(t,r,n,o),changed:t=>this.audio?.changed(t),clock:()=>this.time};_dispose(){this.disposed=!0,this.asked=null,this.release(!1),this.tracer.dispose()}};function Qk(e,t,r,n){return{start(){r()||(oP(e,!0),M.modelCopies.held()?.densityTurned(e))},stop(){if(r())return;oP(e,!1),M.modelCopies.held()?.densityTurned(e);let o=M.modelSurface.held();if(!o)return;let i=Jo("model.surface()","foliage",n());for(let s of t())o.releaseSurface(s,i)}}}function Zk(e,t,r){let n=o=>{r()||e.hlod!==!1===o||(e.hlod=o,t())};return{start(o){e.running===!1&&!r()&&(e.running=!0),n(o)},stop(){e.running=!1,!r()&&(M.partition.held()?.releasePartition(e),n(!1))},hlod:n}}function Jk(e,t,r){let n=()=>{e.holds(r,"page")?t.set(r,e.get(r)):t.clear(r)};n(),e.watch(r,n)}function eF(e,t){let r=n=>{e.drawn!==n&&(e.drawn=n,t(n))};return{start:()=>r(!0),stop:()=>r(!1),opened(){e.drawn||t(!1,!0)}}}var tF={device:"Asking for the graphics device",models:"Loading the models",meshes:"Preparing the meshes",opening:"Opening the view",cache:"Reading the cache",scene:"Reading the scene",pages:"Loading the pages of the view",fields:"Building the distance fields of the meshes",textures:"Preparing the textures",blendResources:"Preparing the see-through surfaces",visibilityPrograms:"Compiling the visibility programs",transparentCompaction:"Preparing the see-through layers",lightingPrograms:"Compiling the lighting programs",directLights:"Preparing the lights",shadowPipelines:"Compiling the shadow programs",globalPasses:"Compiling the light passes",gpuCut:"Cutting the geometry for the view",coverageBootstrap:"Preparing the first cut",firstImagePrograms:"Compiling the programs of the first image",image:"Drawing the first image",network:"Waiting for the network",hidden:"Waiting for the page to be shown"},Ene=e=>`Waiting for ${e} (network, or blocked by the page's policy)`,bne={textures:"textures","blend resources":"blendResources","visibility programs":"visibilityPrograms","transparent compaction":"transparentCompaction","lighting and antialiasing programs":"lightingPrograms","direct lights":"directLights","shadow pipelines":"shadowPipelines","global passes":"globalPasses","GPU cut":"gpuCut","coverage bootstrap":"coverageBootstrap","programs of the first image":"firstImagePrograms"},VNe={manifest:"cache",scene:"scene",resources:"scene",pages:"pages",ready:"image"},lT=e=>typeof e=="number"&&Number.isFinite(e)?e:null;function Tne(e,t,r={}){return e==="contents"?{step:"meshes",completed:lT(r.completed),total:lT(r.total)}:e==="opening"?{step:"opening",completed:null,total:null}:e==="preparation"?{step:VNe[String(r.phase)]??"opening",completed:lT(r.completed),total:lT(r.total)}:e!=="engine-preparation-step"?null:{step:bne[t]??bne[t.split(":")[0]]??"opening",completed:null,total:null}}var GNe=e=>!e||e!=="withheld"&&!$A.has(e),HNe=250,rF=()=>({completed:0,total:0,told:!1,at:-1/0}),WNe=(e,t)=>(e.framed||e.noted?.step==="image")&&!t(),cT=Object.freeze({step:null,words:"",completed:null,total:null,waiting:!1,opening:!1,fault:null});function One({models:{completed:e,total:t}}){return t>0?{step:"models",completed:e,total:t}:{step:"models",completed:null,total:null}}function zNe(e){if(!e.device)return{step:"device",completed:null,total:null};if(e.loads.size)return One(e);if(!e.framed)return e.noted??{step:"opening",completed:null,total:null};if(e.pages)return{step:"pages",...e.pages};let{fields:t}=e;return t.told?{step:"fields",completed:t.completed,total:t.total}:{step:"image",completed:null,total:null}}function jNe(e,t,r){if(r-e.at<HNe)return;e.at=r;let{built:n,waited:o}=t();e.told=o>n||n>e.completed,e.completed=n,e.total=o}var $Ne=Object.freeze({...cT,opening:!0}),YNe={step:"network",completed:null,total:null},KNe={step:"hidden",completed:null,total:null};function Ane(e,t){if(e.closed)return cT;if(e.fault)return{...cT,fault:e.fault};let r=e.awaited&&!WNe(e,t);if(!r&&!e.loads.size)return e.shown?cT:$Ne;let n=r&&fr(),o=n?void 0:Pt.waits(),{step:i,completed:s,total:a}=n?KNe:o?YNe:r?zNe(e):One(e),l=o?Ene(o):tF[i];return{step:i,words:l,completed:s,total:a,waiting:!0,opening:!e.shown,fault:null}}var qNe=(e,t)=>e.step===t.step&&e.words===t.words&&e.completed===t.completed&&e.total===t.total&&e.waiting===t.waiting&&e.opening===t.opening&&e.fault===t.fault,XNe=e=>console.error("[trillion3d] A loading listener threw",e),QNe=e=>({device:!e,noted:null,framed:!1,pages:null,shown:!e,awaited:e,fault:null,closed:!1,loads:new Set,models:{completed:0,total:0},fields:rF()});function ZNe(e,t){let{held:r}=e;if(r.fault=null,r.awaited){r.framed=!0;let n=t.frameVerdict;if(GNe(n))r.shown=!0,r.awaited=!1,r.pages=null;else{let o=n==="withheld"?t.pagesLoading??0:0;r.pages=o>0?{completed:t.pageLoads,total:t.pageLoads+o}:null,e.fields&&!r.pages&&jNe(r.fields,e.fields,e.clock())}}r.awaited||e.deaf(),e.changed()}function JNe({held:e,changed:t}){let r={completed:0,total:0},{models:n}=e;return e.loads.add(r),t(),{progress({phase:o,completed:i,total:s}){if(o!=="bytes"||i===void 0||s===void 0||!e.loads.has(r))return;let a=Math.max(r.completed,i),l=Math.max(r.total,s,a);n.completed+=a-r.completed,n.total+=l-r.total,[r.completed,r.total]=[a,l],t()},ended(){e.loads.delete(r)&&(n.completed+=r.total-r.completed,e.loads.size||(n.completed=n.total=0),t())}}}function e2e(e){let{held:t}=e;t.awaited=!0,t.framed=!1,t.pages=null,e.hear()}function t2e(e,t,r,n){let{held:o}=e,i=Tne(t,r,n);if(!(!i||o.closed)){if(i.step==="opening")o.awaited||e2e(e),o.framed=!1,o.pages=null,o.fields=rF();else if(!o.awaited)return;i.step==="meshes"&&o.noted&&o.noted.step!=="meshes"||(o.noted=i,o.device&&(o.fault=null),e.changed())}}function r2e(e,t){e.held.closed||(e.held.fault=Object.freeze({code:String(t.code),message:t.message}),e.hear(),e.changed())}function n2e(e,{draws:t,drawing:r=()=>!0,onFrame:n,fields:o,now:i=()=>performance.now()}){let s=QNe(t),a=Object.freeze(Ane(s,r)),l=null,c=({metrics:f})=>ZNe(u,f),u={held:s,fields:o,clock:i,changed(){let f=Ane(s,r);qNe(f,a)||(a=Object.freeze(f),e.tell(XNe,a))},hear(){!l&&t&&n&&(l=n(c))},deaf(){l?.(),l=null}};return t&&u.hear(),{held:s,life:u,read:()=>a,drawingChanged:()=>{r()&&(s.pages=null,s.fields=rF()),u.changed()}}}function Lne(e){let t=fe(),{held:r,life:n,read:o,drawingChanged:i}=n2e(t,e),s=Pt.listen(()=>n.changed()),a=()=>n.changed();return globalThis.document?.addEventListener("visibilitychange",a),{read:o,listen:l=>t.subscribe(l),granted(){r.device=!0,n.changed()},started:()=>JNe(n),noted:(l,c,u)=>t2e(n,l,c,u),drawingChanged:i,failed:l=>r2e(n,l),close(){r.closed=!0,s(),globalThis.document?.removeEventListener("visibilitychange",a),n.deaf(),n.changed(),t.clear()},get closed(){return r.closed}}}function Rne(e){let t=({opening:r,fault:n})=>!r&&!n&&!e.closed;return t(e.read())?Promise.resolve():new Promise(r=>{let n=e.listen(o=>{t(o)&&(n(),r())})})}var _ne;function o2e(e){_ne=e?Object.freeze({...e}):void 0}var vne=(e,t)=>e?.[t]??_ne?.[t];function i2e(e,t,r){if(r===!1||!e.ownerDocument?.defaultView)return;let n=typeof r=="object"&&r!==null?r.words:void 0,o=l=>vne(n,l),i=null,s=!1,a=l=>{if(i)return i.show(l);s||!l.waiting&&!l.fault||(s=!0,M.loadingIndicator.load().then(({mountLoading:c})=>{t.closed||(i=c(e,o),i.show(t.read()))},()=>void(s=!1)))};t.listen(a),a(t.read())}function Mne({canvas:e,frames:t,device:r,fields:n,drawing:o},i,s){let a=Lne({draws:!s,drawing:o,onFrame:t.add,fields:n});return s||(r.ready.then(()=>a.granted(),l=>a.failed(Ih(l,"SESSION_OPEN_FAILED","No graphics device was granted"))),i2e(e,a,i.loadingIndicator)),a}var nF=2;function Dne(e){return Object.freeze({radius:nF,falloffDistance:Math.max(e-nF,.01),curve:"pointSource"})}var oF=class{makeBuffer;schedule;after;constructor(t,r,n){this.makeBuffer=t,this.schedule=r,this.after=n}running=!0;get on(){return this.running}set on(t){if(this.running=t,!t)for(let r of[...this.held])r.release()}clock=void 0;values=ue(xu,{});read=void 0;owed=!1;get settings(){return this.owed&&(this.owed=!1,this.write(this.read())),this.values}write(t){let r=this.values.vehicleSoundsDoppler;this.values=t;let n=this.attenuation.falloffDistance!==Math.max(t.vehicleSoundsDistance-nF,.01);n&&(this.attenuation=Dne(t.vehicleSoundsDistance)),(n||r!==t.vehicleSoundsDoppler)&&this.counted++}follow(t){this.read=t,this.owed=!0}owe=()=>void(this.owed=this.read!==void 0);attenuation=Dne(this.values.vehicleSoundsDistance);counted=0;get revision(){return this.settings,this.counted}held=new Set},Pne=(e,t,r)=>new oF(e,t,r),Cne=E0(),Ine=Cne.hold,xZt=Cne.of;var s2e=(e,t)=>{if(typeof AudioBuffer!="function")return null;let r=new AudioBuffer({numberOfChannels:1,length:e.length,sampleRate:t});return r.copyToChannel(e,0),r};function iF(){let e=Promise.resolve();return Pne(s2e,t=>{e=e.then(()=>new Promise(r=>void gr(r,0))).then(()=>VH(t)).catch(r=>ju("A vehicle's sound loops failed to draw; the others went on",r))},(t,r)=>void gr(r,t*1e3))}var sF=e=>({start:()=>void(e.on=!0),stop:()=>void(e.on=!1)});var kne=lc(xu);function aF(e,t,r,n){e.clock=n,Ine(t,e),e.follow(()=>{let o={};for(let i of kne)o[i]=r.get(i);return o});for(let o of kne)r.watch(o,e.owe)}var a2e=Object.freeze({built:0,waited:0}),l2e=()=>({camera:new jt("perspective"),toneMapping:sA,exposure:Wd,sharpness:aA,vignette:$d,animating:!1,disposed:!1}),c2e=(e,t,r,n,o)=>mJ({canvas:e,pixelRatio:t.pixelRatio,invalidate:r,guides:n,camera:o}),u2e=(e,t)=>()=>{if(e.disposed)throw new Error("World disposed");return t.explorer};function d2e(e,t,r,n,o){let i=PZ(()=>r().explorer,e.debug,t,r,s=>o().failed(s));if(n){let s=()=>Promise.reject(n.refusal());i.handle=W(i.handle,{inspect:s})}return i}function f2e({canvas:e,frames:t,device:r},n,o,i){return Mne({canvas:e,frames:t,device:r,fields:()=>n.runtime().explorer?.engine.firstImageFields()??a2e,drawing:()=>n.switches().held.drawing},o,i)}function p2e(e,t,r,{runtime:n,modules:o,loading:i},s){if(t)return{device:t.device,benchmark:void 0};let a=d=>n().renew("device-lost",d),l=nQ(e.device,a,s),c=XC(()=>o().page.state("benchmark"),()=>r.disposed);return{device:l,benchmark:{life:c,quality:QC(l,c,s?()=>new Promise(()=>{}):()=>Rne(i()))}}}function h2e({device:e,options:t,pools:r,loading:n},o,i){return aQ(e.ready,t.signal,r.pageCache,()=>o().holdsSession,{added:s=>{let a=s.metadata.temporalAntialiasing;a!==void 0&&i().sceneTemporalAntialiasing(a)},foreseen:s=>o().explorer?.foreseeManifest(s),deforms:()=>i().held.deformationGate.drawn,started:()=>n.started()})}var m2e=(e,t,r,n,o,i,s)=>pZ(e.controls??"none",()=>t.camera,r,n,o.character,i,s.report),g2e=({runtime:e,scene:t,state:r,modules:n,headless:o},i)=>UP(e,t,()=>r.camera,i.physics,o,n.bindPhysics);function S2e({switches:e,frames:t,state:r,headless:n},o){return qk(e.held.particles,{quality:e.quality,clock:t.worldClock,beforeFrame:t.before,onFrame:t.add,invalidate:()=>o().ask(),release(){if(r.disposed)return;let i=o().explorer;i?.engine.releaseParticles()&&i.invalidate()}},!!n)}var w2e=({switches:e,state:t},r)=>ZL(e.held.effectsGate,e.held.effects,n=>{if(t.disposed)return;let o=r().explorer;o?.engine.releaseEffects(n)&&o.invalidate()}),y2e=({switches:e,state:t},r)=>BD(e.held.guides,()=>{if(t.disposed)return;let n=r().explorer;n?.engine.releaseGuides()&&n.invalidate()}),x2e=({switches:e,state:t},r)=>LC(e.held.deformationGate,()=>{if(t.disposed)return!0;let n=r().explorer;return n?(n.engine.followDeformation()&&n.invalidate(),!0):!1}),b2e=(e,t,r)=>(n,o=!1)=>{if(e.disposed)return;let i=t().explorer;n&&i?.engine.passSlotStarted();let s=!n&&!!i?.engine.releasePassSlot(r,!o);(n||s||!o)&&i?.invalidate()},E2e=(e,t,r)=>()=>{if(e.disposed)return;let n=t().explorer;n?.engine.followModule(r)&&n.invalidate()},T2e=({switches:e,state:t},r)=>{let{held:n}=e,o={};for(let i of xE){let s=Dm[i];"family"in s&&(o[i]=eF(n[`${i}Gate`],b2e(t,r,s.family)))}for(let i of XZ)o[i]=eF(n[`${i}Gate`],E2e(t,r,i));return o},A2e=({scene:e,frames:t,state:r,headless:n,physics:o},i)=>new rg({scene:e,camera:()=>r.camera,frames:t,clock:t.worldClock,physics:()=>o().session(),engine:()=>i().explorer?.engine,silent:!!n});function O2e(e,t,r){let n=S2e(e,t),o=A2e(e,t),i=iF(),s={revision:0},a=Tre({canvas:e.canvas,changed:()=>t().displayChanged(),pictured:r,animation:Mv(r,e.scene),lives:{particles:n.life,audio:o._life,vehicleSounds:sF(i),effects:w2e(e,t),benchmark:e.benchmark?.life,guides:y2e(e,t),deformation:x2e(e,t),...T2e(e,t),foliage:Qk(e.switches.settings,()=>t().models,()=>e.state.disposed,()=>a.page.state("foliage").by),worldGrid:Zk(s,()=>t().invalidate(),()=>e.state.disposed)}});return{particles:n,listener:o,modules:a,partition:s,vehicleSounds:i}}function Fne(e,t,r,n=!1){let{canvas:o,release:i}=rE(e),s=[{dispose:i}];try{return _2e({canvas:o,releaseCanvas:i},t,r,s,n)}catch(a){for(let l of s.reverse())l.dispose();throw a}}function L2e({switches:e,modules:t,scene:r,frames:n,vehicleSounds:o}){Jk(e.settings,t.page,"pathTracing"),Jk(e.settings,t.page,"sampledLights"),TC(e.held.marksGate,r,e.settings,n.clock),aF(o,r,e.settings,n.clock)}function R2e(e,{frames:t,loading:r},n,o){return iJ(e,n,t,o?.quality,r.drawingChanged)}function _2e({canvas:e,releaseCanvas:t},r,n,o,i){let s=()=>ge.invalidate(),a=()=>ge,l=d2e(r,s,a,n,()=>x);o.push({dispose:()=>l.close()});let c=i$(l.why,r.fixedTimeStep),u=FZ(r),d=l2e(),f={runtime:a,modules:()=>$,loading:()=>x},h={runtime:a,switches:()=>D},{device:m,benchmark:w}=p2e(r,n,d,f,i);o.push(m);let x=f2e({canvas:e,frames:c,device:m},h,r,n);o.push({dispose:()=>x.close()});let b=h2e({device:m,options:r,pools:u,loading:x},a,()=>D),T=new xm(b),L=()=>D.guides,_=c2e(e,r,s,L,()=>d.camera),D=R2e(r,{frames:c,loading:x},a,w);o.push(D);let{particles:C,listener:j,modules:$,partition:q,vehicleSounds:le}=O2e({canvas:e,switches:D,frames:c,state:d,headless:n,scene:T,physics:()=>Ue,benchmark:w},()=>ge,s),ge=une({canvas:e,options:r,device:m,scene:T,state:d,frames:c,switches:D,pools:u,diagnostic:l,invalidate:s,views:_,modules:$,partition:q,noted:x.noted,loading:b.loading,flying:b.flying,step:()=>Ke(Fe),avatars:()=>Ye,headless:n});o.push(ge);let Ue=g2e({runtime:ge,scene:T,state:d,modules:$,headless:n},r);L2e({switches:D,modules:$,scene:T,frames:c,vehicleSounds:le});let ye=tE(s);ye(d.camera),uJ(T,e,()=>d.camera);let Fe=m2e(r,d,e,s,Ue,L,l),Ye=uZ(Fe);$.bindAvatar(fZ(Fe));let Ke=Ae=>d.animating=c.step(Ae&&Ye,T,Ue,$.animation),ut=u2e(d,ge);return{canvas:e,releaseCanvas:t,frames:c,pools:u,state:d,device:m,scene:T,invalidate:s,diagnostic:l,views:_,switches:D,modules:$,runtime:ge,physics:Ue,adopt:ye,controls:Fe,ahead:Ke,live:ut,headless:n,partition:q,particles:C,listener:j,loading:x,loader:b,leases:$X()}}function Nne(e){let{canvas:t,device:r,scene:n,controls:o,state:i,adopt:s,invalidate:a}=e;return W(v2e(e),M2e(e),{canvas:t,ready:r.ready,scene:n,controls:o,get camera(){return i.camera},set camera(l){i.camera=s(l),o.follow(),a()}})}var v2e=({loading:e})=>({get loading(){return e.read()},onLoading:t=>e.listen(t)});function M2e({state:e,runtime:t}){return{get toneMapping(){return e.toneMapping},set toneMapping(r){e.toneMapping=r,t.displayChanged()},get exposure(){return e.exposure},set exposure(r){e.exposure=Pg(r),t.displayChanged()},get sharpness(){return e.sharpness},set sharpness(r){e.sharpness=r,t.displayChanged()},get vignette(){return e.vignette},set vignette(r){e.vignette=r,t.displayChanged()}}}function Bne({views:e,live:t}){return{addView(r){return t(),e.addView(r)},get views(){return e.list},get viewport(){return e.viewport},set viewport(r){e.viewport=r}}}function D2e({switches:e,live:t}){return{get pixelError(){return e.pixelError},set pixelError(r){t(),e.pixelError=r},get softwareRaster(){return e.softwareRaster},set softwareRaster(r){t(),e.softwareRaster=r},get hardwareRasterEdgePixels(){return e.hardwareRasterEdgePixels},set hardwareRasterEdgePixels(r){t(),e.hardwareRasterEdgePixels=r}}}function P2e({switches:e,live:t}){return{get depthBinning(){return e.depthBinning},set depthBinning(r){t(),e.depthBinning=r},get depthBinsMinZ(){return e.depthBinsMinZ},set depthBinsMinZ(r){t(),e.depthBinsMinZ=r},get depthBinsMaxZ(){return e.depthBinsMaxZ},set depthBinsMaxZ(r){t(),e.depthBinsMaxZ=r}}}function C2e({switches:e}){return{get maxFrameRate(){return e.maxFrameRate},set maxFrameRate(t){e.maxFrameRate=t},get drawing(){return e.drawing},set drawing(t){e.drawing=t}}}function Une(e){let{switches:t,modules:r}=e;return W(D2e(e),P2e(e),C2e(e),{quality:t.quality,get bounce(){return t.bounce},set bounce(n){t.bounce=n},get temporalAntialiasing(){return t.temporalAntialiasing},set temporalAntialiasing(n){t.temporalAntialiasing=n},get renderScale(){return t.renderScale},set renderScale(n){t.renderScale=n},get reference(){return t.reference},modules:r.page,effects:t.held.effects})}function Vne({switches:e,live:t},r,n){let o=e,i={};for(let[s,a]of Object.entries(n)){if(a.world!==r)continue;let l=gl(s,n);i[l]={enumerable:!0,configurable:!0,get:()=>o[l],set:c=>{t(),o[l]=c}}}for(let[s,a]of Object.entries(qd.family)){if(!Object.hasOwn(n,a)||n[a].world!==r)continue;let{get:l,set:c}=i[gl(a,n)];i[s]={configurable:!0,get:()=>(dt("family",s),l()),set:u=>{dt("family",s),c(u)}}}return Object.defineProperties({},i)}var Gne=(e,t=yr)=>Vne(e,"scene",t),Hne=(e,t=yr)=>Vne(e,"image",t);function I2e(e,t){let r=null,n=null,o=!1,i=()=>{n?.close(),n=r=null},s=()=>{let a=t()?null:e();return a===r?!1:(i(),r=a,n=a?.openCpuSteps()??null,!0)};return s(),{read(){return o||s()?null:n?.read()??null},close(){o=!0,i()}}}function Wne(e,t){return{stageProfile:()=>e()?.stageProfile()??null,cpuSteps:()=>e()?.cpuSteps()??null,resetCpuSteps:()=>e()?.resetStageProfile(),openCpuSteps:()=>I2e(e,t)}}function zne(e,t,r){let n=()=>$L(e(),r);return{materials:()=>n().materials(),material:i=>n().material(i),importedMaterials:()=>n().importedMaterials(),setMaterial(i,s){n().setMaterial(i,s),t()},createMaterial:((i={})=>n().createMaterial(i)),dropMaterial:i=>n().dropMaterial(i),materialMapBytes:()=>n().materialMapBytes(),assignMaterial(i,s){n().assignMaterial(i,s),t()}}}function jne(e,t,r){let n={x:0,y:0},o=new I,i=!1,s=!1,a=!1,l=()=>{if(i)return void(s=!0);i=!0,r({x:n.x,y:n.y}).then(d=>{a=!!d,d&&o.copy(d.point)},()=>void(a=!1)).finally(()=>{i=!1,s&&(s=!1,l())})},c=d=>{!t.pivotAtPointer||d.buttons!==0||(n.x=d.offsetX,n.y=d.offsetY,l())},u=()=>{t.pivotAtPointer&&(t.pivot=a?o.clone():null)};return e.addEventListener("pointermove",c),e.addEventListener("pointerdown",u,!0),()=>{e.removeEventListener("pointermove",c),e.removeEventListener("pointerdown",u,!0)}}function lF(e,{partition:t,modules:r}){t.running===!1&&en(e,"worldGrid",r.page)}function k2e(e,t,r){let n=J6(e,r);return t?.hlod===!1&&(n.hlod=!1),n}async function $ne(e){let t=()=>lF("world.partition()",e);return(await Cr(M.partition,t)).partitionOf(e)}function F2e({scene:e,listener:t}){return cM(e._link,t._player),t}function N2e({frames:e,physics:t,diagnostic:r,invalidate:n}){let o=e.worldClock;return o.onChange(()=>{t.hold(o.paused),ku(r.why,Gs.invalidate),n()}),o}var B2e=({switches:e,invalidate:t})=>({clearMarks(){ub(e.held.marksGate),t()}});function Yne(e){let{canvas:t,frames:r,pools:n,state:o,invalidate:i,diagnostic:s,switches:a}=e,{runtime:l,physics:c,live:u}=e,{mainRect:d}=e.views,f=jre(()=>o.camera,t,c.queried,l,d,a.guides,e.modules.page,()=>e.modules.runs("foliage")),h=jne(t,e.controls,x=>f.raycast(x)),m=F2e(e),w=V2e(e,m,h);return{physics:c.handle,budget:BZ(n,l,r,c.budget),diagnostic:s.handle,particles:e.particles.handle,guides:a.guides,listener:m,partition:()=>$ne(e),clock:N2e(e),...B2e(e),...zne(u,i,e.headless),...f,...U2e(e),...Wne(u,()=>o.disposed),awaitPages:x=>jG(l,u,x?.onProgress),dispose:w}}function U2e(e){let{canvas:t,frames:r,invalidate:n,diagnostic:o,runtime:i,ahead:s,live:a}=e;return{onFrame:r.add,beforeFrame:r.before,invalidate:()=>(ku(o.why,Gs.invalidate),i.ask()),render(){a(),i.render(()=>s(e.headless?.steps?e.controls:null))},resize(l=t.clientWidth,c=t.clientHeight){a()?.resize(Math.floor(l),Math.floor(c)),n()}}}function V2e(e,t,r){let{frames:n,pools:o,state:i,diagnostic:s,runtime:a,physics:l,controls:c}=e;function u(){if(!i.disposed){i.disposed=!0,f(),t._dispose(),r();for(let h of[e.views,c,l,a,e.switches,e.loader])h.dispose();o.pageCache.clear(),s.close(),e.loading.close(),n.clear(),e.device.dispose(),e.releaseCanvas()}}let d=()=>{if(!(i.disposed||!fr())){if(a.explorer)return a.renew("hidden");a.holdsSession&&a.settled().then(d)}},f=YX({release:d,dispose:u,loading:e.loading,leases:e.leases});return u}function G2e(e,t={}){return cF(e,t)}function cF(e,t,r,n=!1){let o=Gt(t);if(o.controls==="vehicle")throw bm();if(o.controls==="avatar")throw Em();wX(o.fixedTimeStep),UX(o.quality);let i=Fne(e,o,r,n),{canvas:s,frames:a,diagnostic:l,runtime:c}=i,u=W(Nne(i),Une(i),Gne(i),Hne(i),Yne(i),Bne(i));i.modules.bind(u),a.add(C3(u.budget,s,u.effects,l.notices));let d={session:()=>c.explorer,last:()=>a.last,awaitPages:()=>u.awaitPages(),drawnFrom:c.drawnFrom,views:i.views.sights,mainRect:i.views.mainRect,parts:i};return GG(u,d),u}function Kne(e=1,t=.4,r=12,n=48,o=Q){[r,n]=[lt(r,2),lt(n,3)];let i=new Ft;return i.grid(n,r,(s,a)=>{let l=s*o,c=a*Q,u=[Math.cos(c)*Math.cos(l),Math.cos(c)*Math.sin(l),Math.sin(c)],d=An([0,0,0],e,l);return{p:Zn(d,u,t),n:u,uv:[s,a]}}),Gn(i.build(),"torus",[e,t,r,n,o])}function qne(e=1,t=.4,r=64,n=8,o=2,i=3){let s=l=>{let c=l*o*Q,u=e*(2+Math.cos(i/o*c))*.5;return An([0,0,e*Math.sin(i/o*c)*.5],u,c)};[r,n]=[lt(r,2),lt(n,3)];let a=Zne(s,r,n,()=>t,!0);return Gn(a,"torusKnot",[e,t,r,n,o,i])}function Xne(e,t=64,r=1,n=8,o=!1){return Zne(i=>e.getPoint(i).toArray(),t,n,()=>r,o)}function uF(e,t=12,r=0,n=Q){let o=e.map(a=>"x"in a?[a.x,a.y]:[a[0],a[1]]),i=o.length-1,s=new Ft;return s.grid(lt(t,1),i,(a,l)=>{let c=Math.round(l*i),u=r+a*n,[d,f]=o[c],h=o[Math.max(0,c-1)],m=o[Math.min(i,c+1)],[w,x]=[m[1]-h[1],h[0]-m[0]],b=Xo([w*Math.sin(u),x,w*Math.cos(u)]);return{p:[d*Math.sin(u),f,d*Math.cos(u)],n:b,uv:[a,l]}}),s.build()}function Qne(e=1,t=1,r=4,n=8){let o=[],i=r=lt(r,1);n=lt(n,1);let s=[0,0];for(let a=0;a<=i;a++){let l=-me+a/i*me;An(s,e,l),o.push([s[0],-t/2+s[1]])}for(let a=0;a<=i;a++){let l=a/i*me;An(s,e,l),o.push([s[0],t/2+s[1]])}return Gn(uF(o,n),"capsule",[e,t,r,n])}function Zne(e,t,r,n,o){let i=lt(t,2),s=Array.from({length:i+1},(m,w)=>e(o?w%i/i:w/i)),a=s.map((m,w)=>{let x=s[Math.max(0,w-1)],b=s[Math.min(i,w+1)];return Xo(o&&(w===0||w===i)?Tv(s[1],s[i-1]):Tv(b,x))}),l=a[0],c=[Xo(xs([0,0,0],l[0],l[1],l[2]))];for(let m=1;m<=i;m++){let w=c[m-1],x=a[m],b=Ge(w,x);c.push(Xo([w[0]-b*x[0],w[1]-b*x[1],w[2]-b*x[2]]))}let[u,d]=[c[0],c[i]],f=o?rN(u,d,l):0,h=new Ft;return h.grid(i,lt(r,3),(m,w)=>{let x=Math.round(m*i),b=w*Q-f*x/i,T=n(m),L=c[x],_=Lj(a[x],L),D=kT([0,0,0],L,Math.cos(b)),C=Xo(Zn(D,_,Math.sin(b))),j=s[x];return{p:Zn([j[0],j[1],j[2]],C,T),n:C,uv:[m,w]}}),h.build()}var Jne=e=>e.reduce((t,[r,n],o)=>{let[i,s]=e[(o+1)%e.length];return t+r*s-i*n},0),na=(e,t,r)=>bg(t[0]-e[0],t[1]-e[1],r[0]-e[0],r[1]-e[1]),Zl=(e,t)=>e[0]===t[0]&&e[1]===t[1];function H2e(e,t,r,n){if(Zl(e,r)||Zl(e,n)||Zl(t,r)||Zl(t,n))return!1;let o=na(e,t,r),i=na(e,t,n),s=na(r,n,e),a=na(r,n,t);return o*i<0&&s*a<0}function dF(e,t){Jne(e)<0&&e.reverse();for(let r of t)Jne(r)>0&&r.reverse()}function fF(e,t=[]){let r=[...e],n=t.filter(a=>a.length>=3).map(a=>[...a]);dF(r,n),n.sort((a,l)=>It(l.map(c=>c[0]))-It(a.map(c=>c[0])));for(let a of n){let l=a.reduce((m,w,x)=>w[0]>a[m][0]?x:m,0),c=a[l],u=[r,...n].flatMap(m=>m.map((w,x)=>[w,m[(x+1)%m.length]])),d=-1,f=1/0;if(r.forEach((m,w)=>{let x=(m[0]-c[0])**2+(m[1]-c[1])**2;x<f&&!u.some(([b,T])=>H2e(c,m,b,T))&&([d,f]=[w,x])}),d<0)continue;let h=[...a.slice(l),...a.slice(0,l),c];XW(r,d+1,0,[...h,r[d]])}let o=[],i=r.map((a,l)=>l),s=i.length*i.length;for(;i.length>3&&s-- >0;){let a=!1;for(let l=0;l<i.length;l++){let[c,u,d]=[i[(l+i.length-1)%i.length],i[l],i[(l+1)%i.length]],[f,h,m]=[r[c],r[u],r[d]];if(!(na(f,h,m)<=0||i.some(x=>{let b=r[x];return Zl(b,f)||Zl(b,h)||Zl(b,m)?!1:na(f,h,b)>=0&&na(h,m,b)>=0&&na(m,f,b)>=0}))){o.push(c,u,d),i.splice(l,1),a=!0;break}}if(!a)break}for(let a=1;a+1<i.length;a++)o.push(i[0],i[a],i[a+1]);return{points:r,triangles:o}}var eoe=[0,0,0];function toe(e,t){let r=e.getPoints(t).map(o=>[o.x,o.y]),n=e.holes.map(o=>o.getPoints(t).map(i=>[i.x,i.y]));return dF(r,n),{outline:r,holes:n}}function roe(e,t=12){let{outline:r,holes:n}=toe(e,t),{points:o,triangles:i}=fF(r,n);return Du(o.flatMap(([s,a])=>[s,a,0]),o.flatMap(()=>[0,0,1]),o.flatMap(([s,a])=>[s,a]),i)}function W2e(e,t){return t===0?e:e.map((r,n)=>{let o=e[(n+e.length-1)%e.length],i=e[(n+1)%e.length],s=[r[0]-o[0],r[1]-o[1]],a=[i[0]-r[0],i[1]-r[1]];ls(s),ls(a);let l=[s[1]+a[1],-(s[0]+a[0])];ls(l);let c=Math.max(.25,bg(l[0],l[1],s[0],s[1]));return[r[0]+l[0]*t/c,r[1]+l[1]*t/c]})}function z2e(e){let t=e.depth??1,r=Math.max(1,e.steps??1),n=e.bevelEnabled??!0,o=n?e.bevelThickness??.2:0,i=n?e.bevelSize??o-.1:0,s=n?Math.max(1,e.bevelSegments??3):0,a=[];for(let l=0;l<=s;l++){let c=l/Math.max(1,s)*me;n&&a.push([-o*Math.cos(c),i*Math.sin(c)])}for(let l=n?1:0;l<=r;l++)a.push([t*l/r,i]);for(let l=s-1;n&&l>=0;l--){let c=l/s*me;a.push([t+o*Math.cos(c),i*Math.sin(c)])}return a}function j2e(e,t,r,n,o){let{points:i,triangles:s}=fF(t,r);for(let a=0;a<s.length;a+=3){let[l,c,u]=[s[a],s[a+1],s[a+2]],d=(f,h)=>e.vertex([i[f][0],i[f][1],h],eoe,i[f]);e.triangle(d(l,n),d(u,n),d(c,n)),e.triangle(d(l,o),d(c,o),d(u,o))}}function $2e(e,t,r){for(let n of t){let o=r.map(([i,s])=>W2e(n,s).map(([a,l])=>[a,l,i]));for(let i=0;i+1<o.length;i++)for(let s=0;s<n.length;s++){let a=(s+1)%n.length,l=[o[i][s],o[i][a],o[i+1][a],o[i+1][s]].map((c,u)=>e.vertex(c,eoe,[u===0||u===3?0:1,u<2?0:1]));e.triangle(l[0],l[1],l[2]),e.triangle(l[0],l[2],l[3])}}}function noe(e,t={}){let r=z2e(t),{outline:n,holes:o}=toe(e,t.curveSegments??12),i=new Ft;return j2e(i,n,o,r[0][0],r[r.length-1][0]),$2e(i,[n,...o],r),AE(i)}function ooe(e,t,r=1,n=0){let o=new Ft,i=l=>[e[l*3],e[l*3+1],e[l*3+2]],s=Math.max(0,Math.floor(n))+1,a=l=>{let c=Xo([l[0],l[1],l[2]]),u=Math.atan2(c[2],-c[0])/Q+.5,d=Math.atan2(c[1],Je(c[0],c[2]))/ss+.5;return o.vertex([c[0]*r,c[1]*r,c[2]*r],c,[u,d])};for(let l=0;l+2<t.length;l+=3){let[c,u,d]=[i(t[l]),i(t[l+1]),i(t[l+2])],f=(h,m)=>[0,1,2].map(w=>c[w]+(u[w]-c[w])*h/s+(d[w]-c[w])*m/s);for(let h=0;h<s;h++)for(let m=0;h+m<s;m++)o.triangle(a(f(h,m)),a(f(h+1,m)),a(f(h,m+1))),h+m+1<s&&o.triangle(a(f(h+1,m)),a(f(h+1,m+1)),a(f(h,m+1)))}return n>0?o.build():AE(o)}var pF={box:vj,sphere:Mj,cylinder:Av,cone:Ky,torus:Kne,torusKnot:qne,plane:Yy,circle:Dj,ring:Pj,capsule:Qne,lathe:uF,extrude:noe,tube:Xne,shape:roe,polyhedron:ooe,edges:yJ,wireframe:xJ,createBuffer(e){let t=new Pr;for(let[r,n]of Object.entries(e))n&&r!=="index"&&t.setAttribute(r,n);return e.index&&t.setIndex(e.index),t}};var mF=new WeakSet,ioe=e=>typeof e.lost=="object"&&mF.has(e.lost),hF=new WeakMap,Y2e=new AbortController().signal;function Wer(e){let{lost:t}=e;if(typeof t!="object")return Y2e;let r=hF.get(t);return r||(hF.set(t,r=new AbortController),mF.has(t)&&r.abort()),r.signal}var K2e=0,q2e=e=>e instanceof GPUOutOfMemoryError;function X2e(e,t){let r=String(t.message),n=q2e(t)?"out-of-memory":"uncaptured-error",o=gK(r),i=o.filter(s=>e.owners.has(s));for(let[s,a]of e.owners)i.includes(s)&&a.error(r,n);if(!(i.length>0)){if(o.length===0){tr.warn(`WebGPU error naming no session, none abandoned: ${r}`);for(let s of e.owners.values())s.unownedError(r,n);return}tr.warn(`WebGPU error of a closed session, not the live one's: ${r}`),e.owners.size===0&&(e.pending=r);for(let s of e.owners.values())s.closedError(r)}}var Q2e=wn(e=>{let t={owners:new Map};e.addEventListener?.("uncapturederror",({error:n})=>X2e(t,n));let r=n=>{t.loss=n,mF.add(e.lost),hF.get(e.lost)?.abort();for(let o of t.owners.values())o.lost(n)};return e.lost.then(n=>r({reason:n.reason,message:n.message}),n=>r({reason:"unknown",message:String(n)})),t});function zer(e,t){let r=Q2e(e),n=++K2e,o=mK(n),i=xK(e,o),{owners:s}=r;s.set(n,t);let a=Vl(e);r.loss&&t.lost(r.loss),r.pending!==void 0&&t.closedError(r.pending),r.pending=void 0;let l=()=>{s.delete(n),i.release()};return{tag:o,device:i.device,close:l,release(){l(),a()}}}var SF=0,Pd=1,is=2,En=new WeakMap,og=e=>{let t=En.get(e);return t||En.set(e,t={compiles:new Map,held:0,heldLabel:null,landings:new Set,refusals:[],asked:0,lastAsked:null,shown:!1,landed:!1}),t},qer=e=>void(og(e).shown=!0),aoe=e=>!!En.get(e)?.shown;function Z2e(e,t){let r=aoe(e);return r?t.start():t.ask(),r}var Xer={resourcesChanged(){}};function Qer(e,t){return e.pending?(loe(e,t),!0):!1}function loe(e,t){let r=e.prepare();return r.then(()=>t(!0),()=>t(!1)),r}var gF=new WeakSet;function J2e(e,t,r,n){if(!t.pending||gF.has(t))return;let o=eBe(t,r,n);gF.add(t),dT(e,o,Pd,t.label)}var eBe=(e,t,r)=>loe(e,n=>{gF.delete(e),n&&t.resourcesChanged(r)});function tBe(e,t,r,n){return t.ready?!0:(Z2e(e,t)&&J2e(e,t,r,n),!1)}var rBe=(e,t,r)=>tBe(e,t,r,Gs.programLanded),Zer=(e,t,r)=>rBe(e,t,r)?t.get():void 0,ng=new WeakMap;function Jer(e,t,r){let n=new WeakRef(e);setTimeout(()=>(n.deref()??r)(),t).unref?.()}function etr(e,t){let{landings:r}=og(e);return r.add(t),()=>void r.delete(t)}function ttr(e){if(!ioe(e))for(let t of[...og(e).landings])t()}var rtr=(e,t)=>void og(e).refusals.push(t);function ntr(e){let t=En.get(e);return t?.refusals.length?t.refusals.splice(0):void 0}var uT="unnamed";function otr(e){let{label:t,fragment:r,vertex:n,compute:o}=e;return t||r?.module.label||n?.module.label||o?.module.label||uT}function itr(e,t,r,n=uT){dT(e,t,r?is:SF,n)}var nBe=(e,t,r)=>dT(e,t,Pd,r),oBe=(e,t,r)=>dT(e,t,aoe(e)?Pd:is,r);function str(e,t,r,n,o,i){let s=Array.isArray(t),a=s?t:[t];if((s?Promise.allSettled(a):a[0]).then(o).then(void 0,i),!e)return;let c=r==="swapped"?nBe:oBe;for(let u of a)c(e,u,n)}function dT(e,t,r,n){if(!t)return;let o=og(e),i=o.compiles.get(t);if(i===void 0)t.then(()=>soe(e,t,!0),()=>soe(e,t,!1)),r!==Pd&&(o.asked++,o.lastAsked=n??uT);else if(i.waits>=r)return;let s=n??i?.label??uT;o.compiles.set(t,{waits:r,label:s}),iBe(e,t,r,s),!(r<is)&&(o.held++,o.heldLabel=s)}function iBe(e,t,r,n){let o=Ir(e);if(o===e)return;let i=ng.get(o);i||ng.set(o,i=new Map),i.set(t,{waits:Math.max(r,i.get(t)?.waits??SF),label:n})}function soe(e,t,r){let n=En.get(e),o=n?.compiles.get(t);if(!(!n||!o)&&(n.compiles.delete(t),ng.get(Ir(e))?.delete(t),r&&o.waits>=Pd&&(n.landed=!0),!(o.waits<is)&&(n.held--,n.heldLabel=null,n.held)))for(let{waits:i,label:s}of n.compiles.values())i===is&&(n.heldLabel=s)}var atr=e=>e&&En.get(e)?.asked||0,ltr=e=>(e&&En.get(e)?.lastAsked)??null,ctr=e=>(e&&En.get(e)?.heldLabel)??null;function utr(e){let t=[];if(!e)return t;let r=En.get(e)?.compiles;for(let{waits:n,label:o}of r?.values()??[])n===is&&t.push(o);for(let[n,{waits:o,label:i}]of ng.get(e)??[])o===is&&r?.get(n)?.waits!==is&&t.push(i);return t}var dtr=e=>!!e&&(En.get(e)?.held??0)>0,wF=(e,t=!1)=>coe(e,t?is:SF),ftr=e=>coe(e,Pd),sBe=Promise.resolve();function ptr(e){let t=En.get(e);t&&(t.landed=!1)}function htr(e){let t=e&&En.get(e);if(t?.landed)return t.landed=!1,sBe}function coe(e,t){let r=e&&En.get(e)?.compiles,n=e&&ng.get(e);if(!r?.size&&!n?.size)return;let o=[];if(r)for(let[i,s]of r)s.waits>=t&&o.push(i);if(n)for(let[i,s]of n)s.waits>=t&&o.push(i);return o.length?Promise.allSettled(o).then(()=>{}):void 0}var aBe=64,yF=Object.freeze({ready:Promise.resolve(),loading:null}),uoe=new WeakMap;function foe(e={}){if(!globalThis.document)return yF;let{device:t}=e;if(t)return rQ(t)?yF:doe(t,t,e);if(fr())return lBe(e);let r=ZX();if(!r)return yF;let n=r.ready.then(()=>r.gpuDevice);return doe(r.key,n,e,r.preparing)}function lBe(e){let t;return{ready:ud().then(()=>(t=foe(e)).ready),get loading(){return t?.loading??null}}}function doe(e,t,r,n){let o=uoe.get(e);if(o)return o;let i={loading:null},s=(async()=>{await Ha();let l=await t;l&&await uBe(l,r,i)})().catch(()=>{}).finally(()=>void(i.loading=null)),a={ready:s,get loading(){return i.loading}};return n?.(s),uoe.set(e,a),a}function cBe(){let e=pF.box(1,1,1),t=_u.meshStandard();return{nodes:[Tx.mesh(e,t),sM.directional({intensity:3,position:[4,5,2],castShadow:!0})],dispose:()=>(e.dispose(),t.dispose())}}async function uBe(e,t,r){let n={},o=!1;JX(e,()=>{o=!0,KM(n)});let i=document.createElement("canvas");i.width=i.height=aBe;let s=cF(i,{...t,device:e,interactive:!1,controls:"none",physics:!1,loadingIndicator:!1,signal:void 0},void 0,!0),a=s.onLoading(c=>void(r.loading=c)),l=cBe();for(let c of l.nodes)s.scene.add(c);s.camera.position.set(0,1.5,4),s.camera.lookAt(0,.5,0);try{let c=e.lost.then(()=>!0);if(await Promise.race([s.awaitPages().then(()=>!1),c]))return;for(let u=wF(e);u;u=wF(e))await u;o||pK(e,n)}finally{a(),s.dispose(),l.dispose()}}var oa=(e,t=e.name)=>(r,n=1)=>new Oe(r instanceof e?r:new e(Array.from(r)),n,!1,t),dBe={float32:oa(Float32Array),float16:oa(Float32Array,"Float16Array"),uint32:oa(Uint32Array),uint16:oa(Uint16Array),uint8:oa(Uint8Array),int32:oa(Int32Array),int16:oa(Int16Array),int8:oa(Int8Array),interleaved:(e,t)=>new Mu(e,t)};var pi=new Float64Array(16),fBe=(e,t)=>Sg(e.x-t.x,e.y-t.y)<1e-12,ig=class{isCurve=!0;getPoints(t=5){let r=[];for(let n=0;n<=t;n++)r.push(this.getPoint(n/t));return r}getTangent(t,r=new I){let o=this.getPoint(Math.max(0,t-1e-4)),i=this.getPoint(Math.min(1,t+1e-4));return r.subVectors(i,o).normalize()}getLength(t=200){let r=0,n=this.getPoint(0),o=new I;for(let i=1;i<=t;i++){o=this.getPoint(i/t,o),r+=o.distanceTo(n);let s=n;n=o,o=s}return r}},sg=class extends ig{points;closed;constructor(t,r=!1){super(),this.points=t,this.closed=r}getPoint(t,r=new I){let{points:n,closed:o}=this,i=n.length;if(i===1)return r.copy(n[0]);let s=o?i:i-1,a=Ar(t)*s,l=Math.floor(a),c=a-l;l>=s&&(l=s-1,c=1);let u=fT(n,o,l-1),d=fT(n,o,l),f=fT(n,o,l+1),h=fT(n,o,l+2),m=c*c,w=m*c;return r.set(b0(u.x,d.x,f.x,h.x,c,m,w),b0(u.y,d.y,f.y,h.y,c,m,w),b0(u.z,d.z,f.z,h.z,c,m,w))}};function fT(e,t,r){let n=e.length;return e[t?(r+n)%n:k(r,0,n-1)]}var ag=class extends ig{points;constructor(t=[]){super(),this.points=t.map(r=>Array.isArray(r)&&r.length===2?new I(r[0],r[1],0):new I(...Lt(r)))}getPoints(){return this.points.map(t=>t.clone())}getPoint(t,r=new I){let n=this.points;if(n.length<2)return r.copy(n[0]??new I);n.length>pi.length&&(pi=new Float64Array(n.length)),pi[0]=0;for(let a=1;a<n.length;a++)pi[a]=pi[a-1]+n[a].distanceTo(n[a-1]);let o=Ar(t)*pi[n.length-1],i=1;for(;i<n.length-1&&pi[i]<o;)i++;let s=pi[i]-pi[i-1]||1;return r.lerpVectors(n[i-1],n[i],(o-pi[i-1])/s)}};function poe(e){return(t,r)=>{for(let n=1;n<=t;n++){let o=n/t;r.push(e(o,1-o))}}}var lg=class{isShape=!0;holes=[];commands=[];cursor=new Me;constructor(t){if(t?.length){this.moveTo(t[0][0],t[0][1]);for(let[r,n]of t.slice(1))this.lineTo(r,n)}}moveTo(t,r){this.cursor=new Me(t,r);let n=this.cursor.clone();return this.commands.push((o,i)=>i.push(n)),this}lineTo(t,r){let n=new Me(t,r);return this.cursor=n,this.commands.push((o,i)=>i.push(n.clone())),this}quadraticCurveTo(t,r,n,o){let i=this.cursor.clone();return this.cursor=new Me(n,o),this.commands.push(poe((s,a)=>new Me(a*a*i.x+2*a*s*t+s*s*n,a*a*i.y+2*a*s*r+s*s*o))),this}bezierCurveTo(t,r,n,o,i,s){let a=this.cursor.clone();return this.cursor=new Me(i,s),this.commands.push(poe(l=>l===1?new Me(i,s):new Me(bT(a.x,t,n,i,l),bT(a.y,r,o,s,l)))),this}absarc(t,r,n,o,i,s=!1){let a=i-o;s&&a>0&&(a-=Q),!s&&a<0&&(a+=Q);let l=An([0,0],n,i);return this.cursor=new Me(t+l[0],r+l[1]),this.commands.push((c,u)=>{let d=[0,0];for(let f=0;f<=c;f++){let h=o+a*f/c;An(d,n,h),u.push(new Me(t+d[0],r+d[1]))}}),this}getPoints(t=12){let r=[];for(let n of this.commands)n(t,r);return r.length>1&&fBe(r[0],r[r.length-1])&&r.pop(),r}};var cg=class e extends Kn{kind="depthOfField";fieldType="DepthOfField";stage="before-resolve";held;constructor(t={}){super(),this.held=LW(this.checked(t))}put(t){this.held=Object.freeze({...this.held,...t}),this.changed()}static{qs(e.prototype,Object.keys(un.DepthOfField).filter(t=>t!=="petzvalExclusionBox"),function(t){this.put(t)})}get values(){return this.held}get enabled(){return this.held.enabled}set enabled(t){this.put(this.written({enabled:t}))}get focusDistance(){return this.held.focusDistance}set focusDistance(t){this.put(this.written({focusDistance:t}))}get aperture(){return this.held.aperture}set aperture(t){this.put(this.written({aperture:t}))}get minAperture(){return this.held.minAperture}set minAperture(t){this.put(this.written({minAperture:t}))}get bladeCount(){return this.held.bladeCount}set bladeCount(t){this.put(this.written({bladeCount:t}))}get sensorWidth(){return this.held.sensorWidth}set sensorWidth(t){this.put(this.written({sensorWidth:t}))}get squeezeFactor(){return this.held.squeezeFactor}set squeezeFactor(t){this.put(this.written({squeezeFactor:t}))}get aspectRatioScalar(){return this.held.aspectRatioScalar}set aspectRatioScalar(t){this.put(this.written({aspectRatioScalar:t}))}get blurByDepthAmount(){return this.held.blurByDepthAmount}set blurByDepthAmount(t){this.put(this.written({blurByDepthAmount:t}))}get depthBlurRadius(){return this.held.depthBlurRadius}set depthBlurRadius(t){this.put(this.written({depthBlurRadius:t}))}get petzvalBokeh(){return this.held.petzvalBokeh}set petzvalBokeh(t){this.put(this.written({petzvalBokeh:t}))}get petzvalFalloff(){return this.held.petzvalFalloff}set petzvalFalloff(t){this.put(this.written({petzvalFalloff:t}))}get petzvalExclusionBox(){return[this.held.petzvalExclusionBoxWidth,this.held.petzvalExclusionBoxHeight]}set petzvalExclusionBox(t){let[r,n]=this.written({petzvalExclusionBox:t}).petzvalExclusionBox;this.put({petzvalExclusionBoxWidth:r,petzvalExclusionBoxHeight:n})}get petzvalExclusionRadius(){return this.held.petzvalExclusionRadius}set petzvalExclusionRadius(t){this.put(this.written({petzvalExclusionRadius:t}))}get barrelRadius(){return this.held.barrelRadius}set barrelRadius(t){this.put(this.written({barrelRadius:t}))}get barrelLength(){return this.held.barrelLength}set barrelLength(t){this.put(this.written({barrelLength:t}))}get matteBox(){return this.held.matteBox}set matteBox(t){this.put({matteBox:t_(this.held.matteBox.map((r,n)=>({...r,...t[n]})))})}get idle(){return RW(this.held)}};var pBe={depthOfField:e=>new cg(e),motionBlur:e=>new jl(e),bloom:e=>new zl(e),outline:e=>new $l(e)};var ug=class e{isMatrix3=!0;elements=new Float64Array([1,0,0,0,1,0,0,0,1]);set(t,r,n,o,i,s,a,l,c){let u=this.elements;return u[0]=t,u[1]=o,u[2]=a,u[3]=r,u[4]=i,u[5]=l,u[6]=n,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1)}copy(t){for(let r=0;r<9;r++)this.elements[r]=t.elements[r];return this}clone(){return new e().copy(this)}setFromMatrix4(t){let r=t.elements;return this.set(r[0],r[4],r[8],r[1],r[5],r[9],r[2],r[6],r[10])}getNormalMatrix(t){return Vc(this.elements,t.elements),this}toArray(){return Array.from(this.elements)}};var hBe={vector2:(e,t)=>new Me(e,t),vector3:(e,t,r)=>new I(e,t,r),vector4:(e,t,r,n)=>new Hf(e,t,r,n),matrix3:()=>new ug,matrix4:()=>new ft,quaternion:(e,t,r,n)=>new Et(e,t,r,n),euler:(e,t,r,n)=>new sl(e,t,r,n),box3:(e,t)=>new rr(e?.clone(),t?.clone()),sphere:(e,t)=>new dl(e?.clone(),t),plane:(e,t)=>new Wp(e?.clone(),t),ray:(e,t)=>new po(e?.clone(),t?.clone()),triangle:(e,t,r)=>new zp(e?.clone(),t?.clone(),r?.clone()),frustum:()=>new jp,color:e=>new pe(e),spherical:(e,t,r)=>new Wf(e,t,r),curve:(e,t=!1)=>new sg(e.map(r=>new I(...Lt(r))),t),path:e=>new ag(e),shape:e=>new lg(e),clamp:qt,lerp:Qe,degToRad:e=>e*ce,radToDeg:e=>e/ce};export{AF as a,goe as b,pT as c,ia as d,hT as e,Cd as f,vo as g,Soe as h,mT as i,OF as j,LF as k,gT as l,oe as m,Pe as n,Id as o,Xe as p,wBe as q,yT as r,_F as s,vF as t,tc as u,MF as v,fg as w,xT as x,xBe as y,E as z,pg as A,yoe as B,CF as C,xoe as D,boe as E,K as F,hg as G,k as H,Tr as I,qt as J,Ar as K,Qe as L,bT as M,LBe as N,RBe as O,_Be as P,sa as Q,vBe as R,MBe as S,DBe as T,Eoe as U,Toe as V,FF as W,NF as X,BF as Y,UF as Z,rc as _,Qn as $,GF as aa,Aoe as ba,mg as ca,gg as da,AT as ea,ss as fa,me as ga,kBe as ha,Q as ia,ce as ja,FBe as ka,NBe as la,BBe as ma,HF as na,WF as oa,zF as pa,Mo as qa,Tn as ra,UBe as sa,VBe as ta,as as ua,GBe as va,jF as wa,HBe as xa,WBe as ya,zBe as za,Ve as Aa,mi as Ba,YF as Ca,OT as Da,Or as Ea,Ce as Fa,$Be as Ga,YBe as Ha,KF as Ia,Sg as Ja,Fr as Ka,nc as La,Ge as Ma,XF as Na,QF as Oa,vT as Pa,Ze as Qa,Do as Ra,MT as Sa,oc as Ta,Nr as Ua,Fd as Va,te as Wa,ZF as Xa,Je as Ya,bg as Za,Eg as _a,eN as $a,Ne as ab,Tg as bb,ic as cb,QBe as db,tN as eb,ZBe as fb,rN as gb,_T as hb,sc as ib,CT as jb,Br as kb,IT as lb,kT as mb,Zn as nb,Bd as ob,FT as pb,nN as qb,vt as rb,gi as sb,NT as tb,Og as ub,rUe as vb,oN as wb,On as xb,Rg as yb,_g as zb,BT as Ab,iN as Bb,Roe as Cb,cs as Db,aN as Eb,la as Fb,nUe as Gb,Ud as Hb,ua as Ib,aUe as Jb,lUe as Kb,cUe as Lb,lN as Mb,uUe as Nb,Be as Ob,cN as Pb,R as Qb,sn as Rb,we as Sb,U as Tb,p as Ub,vg as Vb,g as Wb,S as Xb,F as Yb,y as Zb,P as _b,N as $b,ze as ac,jT as bc,A as cc,lc as dc,Dt as ec,hr as fc,mUe as gc,et as hc,gUe as ic,an as jc,SUe as kc,wUe as lc,X as mc,yUe as nc,Coe as oc,xUe as pc,bUe as qc,Hd as rc,ds as sc,Ioe as tc,gN as uc,EUe as vc,ue as wc,TUe as xc,koe as yc,vUe as zc,MUe as Ac,DUe as Bc,PUe as Cc,CUe as Dc,SN as Ec,Uoe as Fc,KT as Gc,NUe as Hc,BUe as Ic,UUe as Jc,xN as Kc,YUe as Lc,Yoe as Mc,Koe as Nc,eA as Oc,kN as Pc,nA as Qc,bVe as Rc,EVe as Sc,jd as Tc,sA as Uc,kVe as Vc,FVe as Wc,aA as Xc,NVe as Yc,BVe as Zc,ha as _c,lA as $c,iA as ad,cA as bd,uA as cd,dA as dd,fA as ed,pA as fd,yie as gd,mA as hd,Io as id,Yd as jd,YN as kd,xie as ld,bie as md,mr as nd,SA as od,ko as pd,Rn as qd,JVe as rd,eGe as sd,tGe as td,ps as ud,xA as vd,bA as wd,EA as xd,TA as yd,Gg as zd,vie as Ad,o2 as Bd,to as Cd,ma as Dd,Die as Ed,mGe as Fd,Pie as Gd,gGe as Hd,SGe as Id,qd as Jd,yGe as Kd,dt as Ld,Hg as Md,Gt as Nd,oo as Od,G as Pd,Xd as Qd,Qd as Rd,Gie as Sd,RA as Td,wi as Ud,yi as Vd,Lr as Wd,tt as Xd,PA as Yd,Ur as Zd,$g as _d,Sc as $d,ms as ae,wc as be,XGe as ce,QGe as de,ZGe as ee,JGe as fe,Qg as ge,kA as he,ef as ie,tf as je,xe as ke,ya as le,FA as me,v2 as ne,yc as oe,NA as pe,BA as qe,qie as re,UA as se,ln as te,Rr as ue,Jie as ve,ese as we,gs as xe,C2 as ye,rS as ze,VA as Ae,tse as Be,rse as Ce,nse as De,ose as Ee,k3e as Fe,ise as Ge,GA as He,HA as Ie,WA as Je,I2 as Ke,sse as Le,zA as Me,ase as Ne,lse as Oe,cse as Pe,use as Qe,fse as Re,pse as Se,hse as Te,sf as Ue,af as Ve,lf as We,jA as Xe,$A as Ye,YA as Ze,iHe as _e,_n as $e,sHe as af,mse as bf,gse as cf,cf as df,uf as ef,N2 as ff,Sse as gf,wse as hf,xse as if,bse as jf,B2 as kf,U2 as lf,V2 as mf,bc as nf,iS as of,sS as pf,ZA as qf,AHe as rf,Ec as sf,Tse as tf,Ot as uf,Rse as vf,_se as wf,bi as xf,pf as yf,hf as zf,df as Af,lS as Bf,mf as Cf,tO as Df,_He as Ef,rO as Ff,gf as Gf,cS as Hf,Tc as If,Sf as Jf,vHe as Kf,MHe as Lf,St as Mf,PHe as Nf,Vr as Of,uS as Pf,CHe as Qf,Ei as Rf,IHe as Sf,Y2 as Tf,Aa as Uf,sO as Vf,vn as Wf,K2 as Xf,q2 as Yf,kHe as Zf,FHe as _f,NHe as $f,BHe as ag,Ac as bg,dS as cg,aO as dg,Dse as eg,lO as fg,Pse as gg,Cse as hg,Q2 as ig,Ise as jg,kse as kg,Z2 as lg,J2 as mg,uO as ng,Ti as og,iB as pg,nWe as qg,Ai as rg,Oa as sg,cB as tg,hB as ug,mO as vg,mB as wg,gO as xg,wO as yg,yO as zg,xO as Ag,RWe as Bg,La as Cg,Rc as Dg,yS as Eg,qWe as Fg,RB as Gg,vB as Hg,n4e as Ig,o4e as Jg,Oi as Kg,CB as Lg,IB as Mg,oae as Ng,u4e as Og,d4e as Pg,_a as Qg,b4e as Rg,NB as Sg,L4e as Tg,BB as Ug,R4e as Vg,_4e as Wg,wt as Xg,J as Yg,bS as Zg,j4e as _g,ES as $g,HB as ah,$4e as bh,va as ch,Hr as dh,_c as eh,Y4e as fh,DS as gh,Ss as hh,CS as ih,kS as jh,PO as kh,Dc as lh,Pc as mh,dae as nh,fae as oh,pae as ph,W as qh,s5e as rh,a5e as sh,l5e as th,p5e as uh,y5e as vh,x5e as wh,T5e as xh,US as yh,Oae as zh,Lae as Ah,Rae as Bh,Ca as Ch,VS as Dh,B5e as Eh,W5e as Fh,z5e as Gh,Bae as Hh,j5e as Ih,$5e as Jh,GO as Kh,i6e as Lh,s6e as Mh,Gae as Nh,Hae as Oh,Wae as Ph,Mf as Qh,a6e as Rh,l6e as Sh,c6e as Th,u6e as Uh,d6e as Vh,$ae as Wh,Yae as Xh,Df as Yh,TU as Zh,k6e as _h,K6e as $h,Uo as ai,WS as bi,Jae as ci,zO as di,RU as ei,DU as fi,PU as gi,st as hi,Rze as ii,YS as ji,qle as ki,sL as li,M$e as mi,D$e as ni,MV as oi,ao as pi,PV as qi,nt as ri,ka as si,zr as ti,jr as ui,FV as vi,G$e as wi,NV as xi,Ff as yi,BV as zi,Fce as Ai,UV as Bi,yt as Ci,fL as Di,hL as Ei,Nce as Fi,Nf as Gi,q$e as Hi,X$e as Ii,Q$e as Ji,gL as Ki,ys as Li,VV as Mi,GV as Ni,WV as Oi,SL as Pi,xs as Qi,o8e as Ri,wL as Si,Gce as Ti,$V as Ui,m8e as Vi,yL as Wi,Hce as Xi,Fa as Yi,xL as Zi,bL as _i,EL as $i,Vc as aj,O8e as bj,L8e as cj,Uf as dj,jce as ej,$ce as fj,KV as gj,fe as hj,Se as ij,Me as jj,Hf as kj,Wf as lj,zf as mj,Kce as nj,qce as oj,LL as pj,qV as qj,XV as rj,Xce as sj,wYe as tj,Ba as uj,Qce as vj,Zce as wj,ZV as xj,JV as yj,_L as zj,jc as Aj,ML as Bj,eG as Cj,tG as Dj,vL as Ej,pw as Fj,eue as Gj,tue as Hj,rue as Ij,DL as Jj,rG as Kj,nG as Lj,oG as Mj,PL as Nj,iG as Oj,sG as Pj,aG as Qj,nue as Rj,lG as Sj,iue as Tj,sue as Uj,CL as Vj,mw as Wj,NYe as Xj,GL as Yj,HL as Zj,aKe as _j,Gue as $j,uKe as ak,dKe as bk,Wue as ck,zue as dk,jue as ek,$ue as fk,Kue as gk,$f as hk,NG as ik,pKe as jk,ede as kk,tde as lk,rde as mk,nde as nk,GKe as ok,HKe as pk,Wo as qk,Yf as rk,ww as sk,UG as tk,fde as uk,zL as vk,HG as wk,nqe as xk,oqe as yk,iqe as zk,zG as Ak,KL as Bk,Ow as Ck,KG as Dk,dqe as Ek,fqe as Fk,pqe as Gk,hqe as Hk,mqe as Ik,Tde as Jk,Lde as Kk,Lw as Lk,xqe as Mk,_w as Nk,Oqe as Ok,Mde as Pk,Dde as Qk,Lqe as Rk,Mw as Sk,QG as Tk,Cde as Uk,Hqe as Vk,Wqe as Wk,$r as Xk,zqe as Yk,Ide as Zk,jqe as _k,Ts as $k,Yqe as al,Kqe as bl,qqe as cl,Xqe as dl,Qqe as el,e3 as fl,As as gl,r3 as hl,kw as il,n3 as jl,oR as kl,I9e as ll,k9e as ml,i3 as nl,rp as ol,B9e as pl,U9e as ql,V9e as rl,G9e as sl,H9e as tl,s3 as ul,zde as vl,Q9e as wl,jde as xl,$de as yl,Z9e as zl,Yde as Al,J9e as Bl,Kde as Cl,qde as Dl,Xde as El,e7e as Fl,t7e as Gl,iR as Hl,Qde as Il,Zde as Jl,r7e as Kl,n7e as Ll,Jde as Ml,efe as Nl,a3 as Ol,l3 as Pl,tfe as Ql,c3 as Rl,rfe as Sl,u3 as Tl,p7e as Ul,nfe as Vl,op as Wl,E3 as Xl,C7e as Yl,Os as Zl,I7e as _l,T3 as $l,A3 as am,Gw as bm,ffe as cm,O3 as dm,Mn as em,hfe as fm,Pi as gm,I3 as hm,q7e as im,X7e as jm,gfe as km,Q7e as lm,Z7e as mm,lo as nm,k3 as om,F3 as pm,B3 as qm,zw as rm,iXe as sm,U3 as tm,sXe as um,aXe as vm,Ci as wm,lXe as xm,vfe as ym,cXe as zm,jw as Am,uXe as Bm,j3 as Cm,Jt as Dm,Z as Em,er as Fm,bXe as Gm,co as Hm,uo as Im,vXe as Jm,CXe as Km,Hfe as Lm,Zfe as Mm,dH as Nm,Pt as Om,VR as Pm,IH as Qm,vr as Rm,pQe as Sm,wp as Tm,gr as Um,UH as Vm,Cpe as Wm,Ha as Xm,VH as Ym,jH as Zm,$H as _m,Wa as $m,jpe as an,$pe as bn,CQe as cn,n0 as dn,HQe as en,o0 as fn,HMt as gn,WMt as hn,jMt as in,$Mt as jn,YMt as kn,KMt as ln,qMt as mn,QMt as nn,ZMt as on,HD as pn,E9 as qn,gX as rn,mt as sn,CGt as tn,ZDe as un,Hu as vn,Ext as wn,wn as xn,lLe as yn,sK as zn,tr as An,ju as Bn,aK as Cn,DOt as Dn,lK as En,cLe as Fn,uK as Gn,$u as Hn,yo as In,kOt as Jn,fK as Kn,bLe as Ln,HOt as Mn,WOt as Nn,KM as On,KOt as Pn,XM as Qn,wK as Rn,Ir as Sn,yK as Tn,qOt as Un,XOt as Vn,QOt as Wn,ZOt as Xn,JOt as Yn,aNt as Zn,lNt as _n,ar as $n,Xbt as ao,Qbt as bo,Zbt as co,Jbt as do,Hn as eo,oTe as fo,xSt as go,nx as ho,ox as io,bSt as jo,sTe as ko,ESt as lo,Jj as mo,TSt as no,ASt as oo,aTe as po,bh as qo,Gs as ro,Nv as so,OSt as to,ioe as uo,Wer as vo,zer as wo,qer as xo,aoe as yo,Z2e as zo,Xer as Ao,Qer as Bo,J2e as Co,tBe as Do,rBe as Eo,Zer as Fo,Jer as Go,etr as Ho,ttr as Io,rtr as Jo,ntr as Ko,otr as Lo,itr as Mo,nBe as No,oBe as Oo,str as Po,atr as Qo,ltr as Ro,ctr as So,utr as To,dtr as Uo,wF as Vo,ftr as Wo,sBe as Xo,ptr as Yo,htr as Zo,sxe as _o,mlt as $o,ml as ap,glt as bp,k6 as cp,Slt as dp,wlt as ep,ylt as fp,xlt as gp,blt as hp,Ux as ip,UM as jp,eLe as kp,OOt as lp,zu as mp,oLe as np,HM as op,iLe as pp,sLe as qp,aLe as rp,LOt as sp,Aj as tp,Ht as up,Get as vp,XW as wp,It as xp,iu as yp,oLt as zp,iLt as Ap,sLt as Bp,aLt as Cp,zx as Dp,lLt as Ep,cLt as Fp,uLt as Gp,dLt as Hp,fLt as Ip,pLt as Jp,hLt as Kp,mLt as Lp,kLe as Mp,FLe as Np,gLt as Op,_K as Pp,SLt as Qp,zee as Rp,jee as Sp,WCe as Tp,zCe as Up,bd as Vp,z as Wp,jft as Xp,_y as Yp,tv as Zp,Tu as _p,My as $p,$ft as aq,Yft as bq,Kz as cq,$be as dq,Kbe as eq,rpt as fq,qz as gq,dh as hq,_6 as iq,Yat as jq,ez as kq,tz as lq,Fct as mq,Nct as nq,Bct as oq,Uct as pq,yy as qq,Hxe as rq,Yxe as sq,Xxe as tq,zct as uq,I1 as vq,rz as wq,jct as xq,vxe as yq,gy as zq,sct as Aq,act as Bq,Rct as Cq,Fxe as Dq,Q6 as Eq,Bxe as Fq,_ct as Gq,Q8 as Hq,Rbt as Iq,_bt as Jq,Z8 as Kq,tY as Lq,vbt as Mq,W6 as Nq,z6 as Oq,Qlt as Pq,Zlt as Qq,Jlt as Rq,ect as Sq,kbt as Tq,RAe as Uq,Fbt as Vq,gye as Wq,Nn as Xq,pl as Yq,wye as Zq,Rst as _q,l7 as $q,c7 as ar,qPt as br,XPt as cr,bee as dr,P6t as er,Eee as fr,ME as gr,DE as hr,Bm as ir,xd as jr,Zi as kr,F6t as lr,N6t as mr,B6t as nr,U6t as or,V6t as pr,G6t as qr,H6t as rr,RCe as sr,Xl as tr,W6t as ur,z6t as vr,j6t as wr,$6t as xr,Y6t as yr,Zs as zr,Um as Ar,Qge as Br,Jge as Cr,iJe as Dr,pe as Er,Yge as Fr,JZe as Gr,xW as Hr,tJe as Ir,rJe as Jr,uJe as Kr,dJe as Lr,fJe as Mr,eSe as Nr,tSe as Or,rSe as Pr,nSe as Qr,oSe as Rr,iSe as Sr,sSe as Tr,pJe as Ur,hJe as Vr,mJe as Wr,gJe as Xr,SJe as Yr,e_ as Zr,h0 as _r,un as $r,n_ as as,pSe as bs,Fi as cs,FW as ds,Ni as es,_nt as fs,pt as gs,vnt as hs,Fp as is,r5 as js,Mnt as ks,J0 as ls,ci as ms,sd as ns,u7 as os,d7 as ps,f7 as qs,p7 as rs,h7 as ss,m7 as ts,g7 as us,S7 as vs,w7 as ws,eCt as xs,tCt as ys,bn as zs,L1e as As,rCt as Bs,Dn as Cs,fn as Ds,qn as Es,MI as Fs,ttt as Gs,Mp as Hs,rtt as Is,ntt as Js,DM as Ks,HAe as Ls,LEt as Ms,REt as Ns,PM as Os,CM as Ps,MEt as Qs,DEt as Rs,FEt as Ss,zAe as Ts,NEt as Us,BEt as Vs,UEt as Ws,VEt as Xs,GEt as Ys,HEt as Zs,WEt as _s,zEt as $s,jEt as at,$Et as bt,xY as ct,YEt as dt,KEt as et,qEt as ft,XEt as gt,QEt as ht,ZEt as it,JEt as jt,eTt as kt,tTt as lt,rTt as mt,nTt as nt,oTt as ot,iTt as pt,sTt as qt,aTt as rt,lTt as st,cTt as tt,uTt as ut,dTt as vt,fTt as wt,pTt as xt,hTt as yt,mTt as zt,gTt as At,STt as Bt,wTt as Ct,yTt as Dt,xTt as Et,bTt as Ft,ETt as Gt,jAe as Ht,IM as It,yY as Jt,$Ae as Kt,TTt as Lt,ATt as Mt,OTt as Nt,$a as Ot,ie as Pt,Ct as Qt,Sr as Rt,Rs as St,o_ as Tt,Lp as Ut,JJe as Vt,eet as Wt,tet as Xt,wSe as Yt,s_ as Zt,ySe as _t,Qa as $t,GW as au,uet as bu,a_ as cu,_p as du,HW as eu,Lt as fu,I as gu,rr as hu,Pn as iu,L0 as ju,d_ as ku,R0 as lu,ZSe as mu,el as nu,JSe as ou,ewe as pu,B0 as qu,rwe as ru,b_ as su,U0 as tu,A_ as uu,T4 as vu,nwe as wu,owe as xu,je as yu,A4 as zu,G0 as Au,iwe as Bu,Mtt as Cu,O4 as Du,vs as Eu,Cn as Fu,E_ as Gu,y4 as Hu,tl as Iu,x4 as Ju,b4 as Ku,Pp as Lu,O_ as Mu,cwe as Nu,T_ as Ou,Dtt as Pu,Ptt as Qu,uwe as Ru,dwe as Su,fwe as Tu,pwe as Uu,mwe as Vu,gwe as Wu,L_ as Xu,ywe as Yu,rl as Zu,__ as _u,z0 as $u,Owe as av,Et as bv,Dr as cv,k4 as dv,N4 as ev,Cp as fv,lu as gv,Lwe as hv,P_ as iv,X0 as jv,Ds as kv,_we as lv,vwe as mv,qnt as nv,n0e as ov,Xnt as pv,Qnt as qv,ry as rv,Znt as sv,Jnt as tv,eot as uv,tot as vv,rot as wv,not as xv,oot as yv,iot as zv,Hi as Av,kn as Bv,ny as Cv,Fn as Dv,sot as Ev,aot as Fv,lot as Gv,cot as Hv,S5 as Iv,uot as Jv,o0e as Kv,dot as Lv,fot as Mv,pot as Nv,hot as Ov,y5 as Pv,x5 as Qv,mot as Rv,b5 as Sv,E5 as Tv,T5 as Uv,got as Vv,Yo as Wv,A5 as Xv,Tot as Yv,qr as Zv,O5 as _v,Aot as $v,c0e as aw,Np as bw,iy as cw,Oot as dw,C1e as ew,I1e as fw,Ox as gw,cy as hw,Z5 as iw,F8 as jw,Lx as kw,rAe as lw,nAe as mw,ti as nw,sAe as ow,cAe as pw,ks as qw,qo as rw,Azt as sw,Ozt as tw,LI as uw,jCe as vw,Lzt as ww,Rzt as xw,_zt as yw,J9 as zw,NLe as Aw,jx as Bw,xLt as Cw,ULe as Dw,bLt as Ew,s6 as Fw,a6 as Gw,l6 as Hw,lst as Iw,cst as Jw,s1 as Kw,d6 as Lw,L6 as Mw,Uat as Nw,uct as Ow,dct as Pw,q6 as Qw,wy as Rw,Un as Sw,Sl as Tw,B1 as Uw,Tdt as Vw,fz as Ww,Ey as Xw,j1 as Yw,$1 as Zw,Jdt as _w,eft as $w,xbe as ax,tft as bx,Klt as cx,x1 as dx,Zat as ex,wo as fx,fY as gx,vM as hx,nEt as ix,oEt as jx,IAe as kx,iEt as lx,sEt as mx,MM as nx,pY as ox,aEt as px,lEt as qx,cEt as rx,uEt as sx,FAe as tx,dEt as ux,fEt as vx,pEt as wx,hEt as xx,mEt as yx,gEt as zx,NAe as Ax,BAe as Bx,UAe as Cx,SEt as Dx,VAe as Ex,wEt as Fx,yEt as Gx,GAe as Hx,xEt as Ix,bEt as Jx,_E as Kx,j5t as Lx,$5t as Mx,Y5t as Nx,oCe as Ox,K5t as Px,ih as Qx,Qr as Rx,vbe as Sx,Mbe as Tx,Dbe as Ux,Pbe as Vx,sh as Wx,Ty as Xx,ah as Yx,q1 as Zx,Cbe as _x,Ibe as $x,kbe as ay,Uz as by,Vn as cy,Vz as dy,Wz as ey,zz as fy,jz as gy,$z as hy,Jft as iy,Tlt as jy,Alt as ky,E1 as ly,A1 as my,Plt as ny,Bn as oy,Clt as py,V6 as qy,pxe as ry,hxe as sy,Ilt as ty,klt as uy,Flt as vy,Ko as wy,bY as xy,EY as yy,lr as zy,DTt as Ay,qAe as By,PTt as Cy,XAe as Dy,CTt as Ey,ITt as Fy,kTt as Gy,vl as Hy,FTt as Iy,Wh as Jy,NTt as Ky,BTt as Ly,UTt as My,VTt as Ny,VY as Oy,Ay as Py,Mft as Qy,Dft as Ry,Ift as Sy,Pz as Ty,Fft as Uy,Uft as Vy,Vft as Wy,Gft as Xy,Hft as Yy,ch as Zy,uh as _y,eEe as $y,ph as az,Rpt as bz,iEe as cz,sEe as dz,Ru as ez,Gpt as fz,aj as gz,gn as hz,By as iz,uv as jz,qe as kz,hZ as lz,VUt as mz,GUt as nz,JAe as oz,WTt as pz,OY as qz,h1e as rz,tPt as sz,rPt as tz,Db as uz,ft as vz,kp as wz,du as xz,Pnt as yz,i5 as zz,sl as Az,d0e as Bz,f0e as Cz,p0e as Dz,Dot as Ez,Pot as Fz,j_ as Gz,$_ as Hz,g0e as Iz,Not as Jz,Bot as Kz,y0e as Lz,x0e as Mz,b0e as Nz,hn as Oz,K_ as Pz,A0e as Qz,O0e as Rz,ll as Sz,Z_ as Tz,Is as Uz,ay as Vz,cl as Wz,Su as Xz,W5 as Yz,zi as Zz,P0e as _z,wu as $z,ait as aA,lit as bA,he as cA,j5 as dA,or as eA,T9 as fA,Z_e as gA,dDt as hA,_9 as iA,M9 as jA,im as kA,_Dt as lA,t1e as mA,yb as nA,Jpe as oA,Yr as pA,Tp as qA,ehe as rA,fZe as sA,pZe as tA,hZe as uA,mZe as vA,the as wA,rhe as xA,nhe as yA,ohe as zA,ihe as AA,she as BA,ahe as CA,lhe as DA,che as EA,uhe as FA,dhe as GA,fhe as HA,phe as IA,hhe as JA,mhe as KA,ghe as LA,She as MA,whe as NA,yhe as OA,xhe as PA,bhe as QA,Ehe as RA,The as SA,Ahe as TA,Ohe as UA,Lhe as VA,Rhe as WA,_he as XA,vhe as YA,Mhe as ZA,Dhe as _A,Phe as $A,Che as aB,Ihe as bB,khe as cB,Fhe as dB,Nhe as eB,Bhe as fB,Uhe as gB,Vhe as hB,Ghe as iB,Hhe as jB,Whe as kB,zhe as lB,jhe as mB,$he as nB,Yhe as oB,Khe as pB,qhe as qB,Xhe as rB,Qhe as sB,Zhe as tB,Jhe as uB,eme as vB,tme as wB,rme as xB,nme as yB,ome as zB,ime as AB,sme as BB,ame as CB,lme as DB,cme as EB,ume as FB,dme as GB,fme as HB,pme as IB,hme as JB,mme as KB,gme as LB,Sme as MB,wme as NB,yme as OB,xme as PB,bme as QB,Eme as RB,Tme as SB,Ame as TB,Ome as UB,Lme as VB,Rme as WB,_me as XB,vme as YB,Mme as ZB,Dme as _B,Pme as $B,Cme as aC,Ime as bC,kme as cC,Fme as dC,Nme as eC,Bme as fC,Ume as gC,Vme as hC,Gme as iC,Hme as jC,Wme as kC,zme as lC,jme as mC,$me as nC,Yme as oC,Kme as pC,qme as qC,Xme as rC,Qme as sC,Zme as tC,Jme as uC,ege as vC,tge as wC,rge as xC,nge as yC,oge as zC,ige as AC,sge as BC,age as CC,lge as DC,cge as EC,uge as FC,dge as GC,fge as HC,pge as IC,hge as JC,mge as KC,gge as LC,Sge as MC,wge as NC,yge as OC,xge as PC,bge as QC,Ege as RC,Tge as SC,Age as TC,Oge as UC,Lge as VC,Rge as WC,vge as XC,Mge as YC,gZe as ZC,eat as _C,Oat as $C,b1 as aD,dlt as bD,CFt as cD,IFt as dD,Dve as eD,Ml as fD,yxe as gD,v1 as hD,nct as iD,Al as jD,gwt as kD,Y5 as lD,dl as mD,Wp as nD,po as oD,zp as pD,jp as qD,xn as rD,k_e as sD,SMt as tD,wMt as uD,JDe as vD,lTe as wD,RSt as xD,cTe as yD,uTe as zD,fTe as AD,CSt as BD,ISt as CD,kSt as DD,t$ as ED,pTe as FD,FSt as GD,NSt as HD,ku as ID,BSt as JD,zht as KD,vu as LD,gEe as MD,bv as ND,Oe as OD,Mu as PD,jy as QD,Xht as RD,Qht as SD,Pr as TD,ot as UD,Qo as VD,a$ as WD,f0t as XD,i8 as YD,$e as ZD,sM as _D,Rb as $D,We as aE,Ao as bE,qDt as cE,Hm as dE,sOt as eE,dD as fE,xRt as gE,bRt as hE,WOe as iE,FAt as jE,NAt as kE,vK as lE,yq as mE,Gbt as nE,aY as oE,Ybt as pE,Kbt as qE,mY as rE,Ki as sE,kx as tE,xOe as uE,sAt as vE,aAt as wE,lAt as xE,jE as yE,YIe as zE,A$t as AE,O$t as BE,S6 as CE,rRt as DE,nRt as EE,oRt as FE,iRt as GE,sRt as HE,aRt as IE,lRt as JE,$x as KE,KK as LE,qy as ME,hgt as NE,Jr as OE,vgt as PE,_at as QE,vat as RE,Mat as SE,Iat as TE,Jye as UE,kat as VE,Fat as WE,Nat as XE,R6 as YE,Kj as ZE,mo as _E,Yj as $E,lSt as aF,dPe as bF,fPe as cF,g6 as dF,zR as eF,QQe as fF,rW as gF,yp as hF,RZ as iF,XUt as jF,QUt as kF,ZUt as lF,JUt as mF,iW as nF,rVt as oF,dVt as pF,dDe as qF,fDe as rF,fVt as sF,pVt as tF,pDe as uF,hDe as vF,hVt as wF,mDe as xF,gDe as yF,SDe as zF,MZ as AF,P6 as BF,ilt as CF,slt as DF,alt as EF,llt as FF,hct as GF,F3t as HF,Sy as IF,wct as JF,K6 as KF,yct as LF,qZ as MF,XDe as NF,H6 as OF,sat as PF,aat as QF,kgt as RF,IEe as SF,FEe as TF,NEe as UF,zj as VF,sD as WF,zK as XF,dat as YF,yat as ZF,mst as _F,u6 as $F,nye as aG,gst as bG,h6 as cG,Mst as dG,Z6 as eG,Y3t as fG,QDe as gG,wxe as hG,R1 as iG,jlt as jG,YDe as kG,KDe as lG,qDe as mG,l1 as nG,Bst as oG,nat as pG,tPe as qG,dy as rG,xst as sG,iye as tG,bst as uG,$Gt as vG,QGt as wG,w3t as xG,Wl as yG,UVt as zG,Dge as AG,dW as BG,Pge as CG,Nge as DG,c0 as EG,Uge as FG,u0 as GG,Vge as HG,DZe as IG,PZe as JG,CZe as KG,M6 as LG,tlt as MG,Tv as NG,Lj as OG,Xo as PG,NY as QG,jh as RG,Kgt as SG,_v as TG,Xit as UG,Gst as VG,Hst as WG,$st as XG,Qst as YG,mat as ZG,gat as _G,Eat as $G,Cct as aH,J6 as bH,Ict as cH,yr as dH,oz as eH,sz as fH,tdt as gH,jt as hH,I8t as iH,k8t as jH,ii as kH,OD as lH,Qq as mH,cvt as nH,uvt as oH,LD as pH,Zq as qH,f_e as rH,mvt as sH,gvt as tH,p_e as uH,h_e as vH,Svt as wH,wvt as xH,yvt as yH,db as zH,s6t as AH,a6t as BH,aee as CH,fCe as DH,xEe as EH,Fj as FH,Uh as GH,pbt as HH,hbt as IH,Vh as JH,pAe as KH,V7t as LH,G7t as MH,H7t as NH,qK as OH,wq as PH,Xy as QH,Hj as RH,lD as SH,q7t as TH,Ure as UH,jFe as VH,$Fe as WH,ad as XH,N1e as YH,Qi as ZH,z1e as _H,j1e as $H,k7 as aI,$1e as bI,OIt as cI,Y1e as dI,K1e as eI,LIt as fI,B7 as gI,rm as hI,sb as iI,g_e as jI,FD as kI,ed as lI,I_e as mI,YP as nI,SX as oI,Mve as pI,DFt as qI,wX as rI,B7t as sI,nd as tI,pPt as uI,e1t as vI,t1t as wI,Rq as xI,r1t as yI,n1t as zI,o1t as AI,PRe as BI,i1t as CI,s1t as DI,a1t as EI,l1t as FI,c1t as GI,u1t as HI,d1t as II,f1t as JI,p1t as KI,h1t as LI,m1t as MI,g1t as NI,S1t as OI,_q as PI,w1t as QI,y1t as RI,vq as SI,x1t as TI,b1t as UI,E1t as VI,T1t as WI,bo as XI,L1t as YI,Kx as ZI,yn as _I,Qh as $I,Il as aJ,qx as bJ,gD as cJ,Mq as dJ,Zh as eJ,CRe as fJ,R1t as gJ,_1t as hJ,v1t as iJ,M1t as jJ,D1t as kJ,kl as lJ,P1t as mJ,C1t as nJ,I1t as oJ,k1t as pJ,F1t as qJ,Le as rJ,IRe as sJ,js as tJ,Iq as uJ,FRe as vJ,NRe as wJ,BRe as xJ,URe as yJ,VRe as zJ,kq as AJ,GRe as BJ,bCt as CJ,A7 as DJ,ECt as EJ,TCt as FJ,OCt as GJ,VD as HJ,Xi as IJ,hm as JJ,D1e as KJ,CCt as LJ,bz as MJ,bbe as NJ,Ebe as OJ,oh as PJ,sft as QJ,Tbe as RJ,K1 as SJ,XE as TJ,y8 as UJ,x8 as VJ,MRt as WJ,xo as XJ,VRt as YJ,hD as ZJ,mD as _J,FM as $J,Ih as aK,lF as bK,k2e as cK,ex as dK,VEe as eK,HEe as fK,Zj as gK,LZ as hK,YUt as iK,zZ as jK,Oee as kK,Vk as lK,tP as mK,rd as nK,uPt as oK,G5t as pK,Cu as qK,VP as rK,Ekt as sK,W1t as tK,Qx as uK,zRe as vK,Wn as wK,xZt as xK,Rl as yK,Gu as zK,$2t as AK,Y2t as BK,NQ as CK,$1t as DK,wD as EK,jRe as FK,$Re as GK,YRe as HK,KRe as IK,Zu as JK,qRe as KK,XRe as LK,QRe as MK,ZRe as NK,JRe as OK,zq as PK,o_e as QK,$q as RK,i_e as SK,sr as TK,bl as UK,jTe as VK,vj as WK,Yy as XK,Mj as YK,Dj as ZK,Pj as _K,Av as $K,Ky as aL,X9t as bL,cFe as cL,ho as dL,yj as eL,S9 as fL,Eb as gL,x1e as hL,Bl as iL,b1e as jL,Bt as kL,dr as lL,Oo as mL,e7 as nL,um as oL,uP as pL,sP as qL,cm as rL,T1e as sL,dm as tL,nn as uL,mKt as vL,yKt as wL,rFe as xL,fk as yL,mne as zL,Q7 as AL,Z7 as BL,Ys as CL,dd as DL,lQ as EL,WNt as FL,Kne as GL,qne as HL,Qne as IL,ooe as JL,q8 as KL,dQ as LL,jke as ML,P9t as NL,C9t as OL,fre as PL,mre as QL,Sre as RL,pzt as SL,hzt as TL,mzt as UL,REe as VL,Gj as WL,vte as XL,IPe as YL,FPe as ZL,dke as _L,fke as $L,Z$t as aM,go as bM,nX as cM,Rkt as dM,$s as eM,wkt as fM,ree as gM,AJ as hM,cX as iM,Ks as jM,ui as kM,Hl as lM,hd as mM,Lm as nM,on as oM,sE as pM,hQ as qM,mQ as rM,QQ as sM,XBt as tM,QBt as uM,ZBt as vM,di as wM,rUt as xM,Ul as yM,Ro as zM,UQ as AM,nZ as BM,qMe as CM,Ed as DM,$4t as EM,XPe as FM,rIe as GM,Lz as HM,KTe as IM,qTe as JM,XTe as KM,Pm as LM,Kn as MM,Cm as NM,zl as OM,cg as PM,jl as QM,$l as RM,jZ as SM,Fv as TM,rx as UM,Xk as VM,rg as WM,xm as XM,zs as YM,Dh as ZM,Ph as _M,Ch as $M,tF as aN,o2e as bN,G2e as cN,cF as dN,M as eN,KQe as fN,xp as gN,oW as hN,Qpe as iN,YR as jN,Pwe as kN,Cwe as lN,Iwe as mN,ube as nN,Abe as oN,Rbe as pN,_be as qN,pEe as rN,hEe as sN,LEe as tN,wh as uN,UEe as vN,xTe as wN,BTe as xN,VTe as yN,$Te as zN,YTe as AN,OAe as BN,bOe as CN,MRe as DN,pF as EN,foe as FN,dBe as GN,ig as HN,sg as IN,ag as JN,lg as KN,pBe as LN,ug as MN,hBe as NN};
|
|
14
|
+
//# sourceMappingURL=trillion3d-chunk-PJN3TXFS.js.map
|