From d3e777d74ace8e6b90b648dc5e9cb0bb1596e6d1 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 21 Aug 2026 13:27:38 +0200 Subject: [PATCH] Automate frontend builds for releases; stop committing the build The bundled compas_threejs_ts frontend was previously built by hand and committed to this repo. Instead: - FRONTEND_VERSION pins the compas_threejs_ts release to build. - `invoke pre-build` clones that tag, builds it, and vendors dist/ into src/compas_threejs/viewer/frontend/. It's the hook compas-dev/compas-actions/prepare-release@v1 runs (via run-prebuild) before `python -m build`, now wired up in release.yml alongside a Node.js setup step. - `invoke sync-frontend` stays for local iteration against a sibling compas_threejs_ts checkout. - src/compas_threejs/viewer/frontend/ is now gitignored; setuptools still bundles it into sdists/wheels from disk via MANIFEST.in, so `pip install compas_threejs` still needs no Node.js. - scripts/sync-frontend.py and sync-frontend.bat removed (duplicated the invoke task, and the former broke on Windows console encoding). Pinning the version explicitly, rather than always building whatever compas_threejs_ts is newest, is deliberate: the two repos share a wire format contract via compas-pb/compas-pb-ts, and an unreviewed frontend bump could silently break it. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/release.yml | 4 + .gitignore | 7 +- CHANGELOG.md | 3 + CONTRIBUTING.md | 16 +- FRONTEND_VERSION | 1 + FRONTEND_WORKFLOW.md | 140 +- docs/installation.md | 5 + scripts/sync-frontend.py | 28 - .../frontend/assets/compas_icon_white.png | Bin 5093 -> 0 bytes .../viewer/frontend/assets/index.css | 2 - .../viewer/frontend/assets/index.js | 4170 ----------------- src/compas_threejs/viewer/frontend/index.html | 25 - sync-frontend.bat | 3 - tasks.py | 90 +- 14 files changed, 164 insertions(+), 4330 deletions(-) create mode 100644 FRONTEND_VERSION delete mode 100644 scripts/sync-frontend.py delete mode 100644 src/compas_threejs/viewer/frontend/assets/compas_icon_white.png delete mode 100644 src/compas_threejs/viewer/frontend/assets/index.css delete mode 100644 src/compas_threejs/viewer/frontend/assets/index.js delete mode 100644 src/compas_threejs/viewer/frontend/index.html delete mode 100644 sync-frontend.bat diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f58c423..ffaa456 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,10 +36,14 @@ jobs: if: needs.release.outputs.is-release == 'true' runs-on: ubuntu-latest steps: + - uses: actions/setup-node@v4 + with: + node-version: "22" - uses: compas-dev/compas-actions/prepare-release@v1 with: python-version: "3.11" management-tool: uv + run-prebuild: "true" publish: needs: [release, prepare] diff --git a/.gitignore b/.gitignore index 226cf32..87add99 100644 --- a/.gitignore +++ b/.gitignore @@ -334,6 +334,7 @@ storybook-static/ temp/ -# Frontend is built from external repo and committed to this repo -# Uncomment the line below if you want to gitignore the frontend build: -# src/compas_threejs/viewer/frontend/ +# Frontend is built from the compas_threejs_ts release pinned in FRONTEND_VERSION. +# Run `invoke pre-build` (CI/release) or `invoke sync-frontend` (local dev against +# a sibling checkout) to populate it -- see FRONTEND_WORKFLOW.md. +src/compas_threejs/viewer/frontend/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 08c047f..d5b1c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- The bundled frontend is no longer committed to the repository. It's now built automatically at release time from the `compas_threejs_ts` version pinned in `FRONTEND_VERSION`, via a new `invoke pre-build` task wired into the release pipeline (`run-prebuild` on `prepare-release@v1`). `pip install compas_threejs` still requires no Node.js. See `FRONTEND_WORKFLOW.md`. + ### Removed +- `scripts/sync-frontend.py` and `sync-frontend.bat`, superseded by the `invoke sync-frontend` task. ## [1.0.1] - 2026-08-13 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae1f681..3d0035a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,8 +82,12 @@ If you modify the sibling `compas_threejs_ts` repository: cd ../compas_threejs invoke sync-frontend ``` -3. Commit the TypeScript source in its repository and the generated files under - `src/compas_threejs/viewer/frontend/` in this repository. +3. Commit and release the TypeScript source in its own repository. The build + `invoke sync-frontend` copied in is only for local testing here -- it is **not** + committed to this repository (see [FRONTEND_WORKFLOW.md](FRONTEND_WORKFLOW.md)). +4. Once `compas_threejs_ts` has a new tagged release, bump + [`FRONTEND_VERSION`](FRONTEND_VERSION) in this repository to that version, verify + with `invoke pre-build`, and commit the bump as its own reviewable PR. ## Releasing (maintainers) @@ -91,6 +95,7 @@ Start from a clean, up-to-date `main` branch with all changes listed under `Unreleased` in `CHANGELOG.md`, then run: ```bash +invoke pre-build invoke release --release-type=minor ``` @@ -99,6 +104,13 @@ version and changelog, commits and tags the release, builds the distributions, prepares the next `Unreleased` section, and asks before pushing. Pushing the tag triggers the Trusted Publishing workflow. +`invoke pre-build` builds the `compas_threejs_ts` release pinned in +[`FRONTEND_VERSION`](FRONTEND_VERSION) and vendors it into +`src/compas_threejs/viewer/frontend/` so the distributions built by `invoke release` +bundle it -- `invoke release` does not do this on its own. The automated GitHub +Actions release pipeline runs the equivalent step itself, so this manual step is only +needed for local releases. + ## Submitting Changes 1. **Push your branch** to your fork: diff --git a/FRONTEND_VERSION b/FRONTEND_VERSION new file mode 100644 index 0000000..26aaba0 --- /dev/null +++ b/FRONTEND_VERSION @@ -0,0 +1 @@ +1.2.0 diff --git a/FRONTEND_WORKFLOW.md b/FRONTEND_WORKFLOW.md index ec29bc4..3e0c814 100644 --- a/FRONTEND_WORKFLOW.md +++ b/FRONTEND_WORKFLOW.md @@ -7,117 +7,89 @@ The frontend for `compas_threejs` has been moved to a separate repository for in - **Backend (this repo)**: `compas_threejs` - Python package with FastAPI server - **Frontend (separate repo)**: `compas_threejs_ts` - Vue.js + Three.js viewer application -## Development Workflow +The built frontend (`src/compas_threejs/viewer/frontend/`) is **not** committed to this +repo. It's generated on demand by one of two invoke tasks, and it's `.gitignore`d. +That means a fresh clone has no working viewer until you run one of them once. -### 1. Frontend Development +## Two ways to get a built frontend -Work in the separate frontend repository: +### `invoke pre-build` — reproduces a release build -```bash -cd ../compas_threejs_ts -npm run dev # Start development server -``` - -Make your changes, commit them to the frontend repo. +Clones `compas_threejs_ts` at the tag recorded in [`FRONTEND_VERSION`](FRONTEND_VERSION), +builds it, and copies `dist/` into `src/compas_threejs/viewer/frontend/`. This is +exactly what the release pipeline runs (see "Releasing" below), so it's the way to +reproduce locally what a `pip install compas_threejs` will actually ship. No sibling +checkout needed — it clones a throwaway copy into a temp directory. -### 2. Sync Frontend Build to Backend - -After making frontend changes, sync the build to this Python package: - -**Windows:** ```bash -sync-frontend.bat +invoke pre-build ``` -**Linux/Mac or from Python:** -```bash -python scripts/sync-frontend.py -``` - -**Or with invoke (if installed):** -```bash -invoke sync-frontend -``` +Use this when you just want a working viewer, or when verifying a `FRONTEND_VERSION` +bump before committing it. -This will: -1. Build the frontend from `../compas_threejs_ts` -2. Clear the old build from `src/compas_threejs/viewer/frontend/` -3. Copy the new build files +### `invoke sync-frontend` — fast loop against a local frontend checkout -### 3. Test the Integration +Builds whatever is currently checked out in a sibling `../compas_threejs_ts` directory +and copies its `dist/` in. Ignores `FRONTEND_VERSION` entirely — it always reflects +your local working tree, including uncommitted changes. ```bash -# Run your Python examples to test the viewer -python examples/your_example.py +cd ../compas_threejs_ts +npm run dev # iterate here first if you like +cd ../compas_threejs +invoke sync-frontend +python examples/your_example.py # test the integration ``` -The viewer should open in your browser with the updated frontend. +Use this while actively developing `compas_threejs_ts` itself. -### 4. Commit Both Repos +Both tasks need Node.js available on `PATH` (see `compas_threejs_ts`'s `package.json` +`engines` field for the minimum version) and, for `sync-frontend`, expect the Python +and TypeScript repositories to be sibling directories. -**Frontend repo:** -```bash -cd ../compas_threejs_ts -git add . -git commit -m "Your frontend changes" -git push -``` +## Picking up a new compas_threejs_ts release -**Backend repo (after syncing):** -```bash -cd ../compas_threejs -git add src/compas_threejs/viewer/frontend/ -git commit -m "Update frontend build" -git push -``` - -The frontend build **is committed** to the backend repo so users can install via pip without needing Node.js. +1. Finish and release the change in `compas_threejs_ts` (tagged `vX.Y.Z`, published to npm). +2. In `compas_threejs`, edit [`FRONTEND_VERSION`](FRONTEND_VERSION) to `X.Y.Z`. +3. Run `invoke pre-build` and test (`pytest`, `python examples/your_example.py`). +4. Commit the `FRONTEND_VERSION` bump. Do **not** commit the generated + `src/compas_threejs/viewer/frontend/` directory — it's gitignored on purpose. -## Important Notes +Pinning the version this way (rather than always building whatever is newest) is +deliberate: `compas_threejs_ts` and this package share a wire-format contract via +`compas-pb`/`compas-pb-ts`, and an unreviewed frontend bump could silently break that +contract. Bumping `FRONTEND_VERSION` is a normal, reviewable PR. -### Current Setup -- Frontend build **is committed** in this repo for easier pip installation -- You must run `sync-frontend.bat` or `python scripts/sync-frontend.py` to update the viewer -- The Python and TypeScript repositories must be sibling directories -- Users installing via pip don't need Node.js +## Releasing (maintainers) -### Path Configuration -The sync script expects: -- Frontend repo: `../compas_threejs_ts/` (relative to this repo) -- Output location: `src/compas_threejs/viewer/frontend/` +The GitHub Actions release pipeline (`.github/workflows/release.yml`) builds the +frontend automatically: the `prepare` job sets up Node.js and calls +`compas-dev/compas-actions/prepare-release@v1` with `run-prebuild: "true"`, which runs +`invoke pre-build` before building the sdist/wheel. So published distributions always +bundle the frontend pinned in `FRONTEND_VERSION` at release time, and `pip install +compas_threejs` never needs Node.js on the end user's machine. -If you move repositories, update the path in `scripts/sync-frontend.py`. +If you release locally instead (e.g. via `invoke release`), run `invoke pre-build` +first — that path does not run it for you. ## Troubleshooting -### "FileNotFoundError" when running sync script -- Ensure `../compas_threejs_ts` exists and contains `package.json` -- Check that npm is installed and available +### "npm was not found on PATH" -### "PlaneHelpers" import warnings during build -- These are non-fatal warnings from Three.js imports -- The build will still succeed +Install Node.js (matching `compas_threejs_ts`'s `engines.node` requirement) and make +sure `npm` is on `PATH`. -### Large bundle size warning -- Consider code-splitting in the frontend if bundle grows too large -- See: https://rollupjs.org/configuration-options/#output-manualchunks +### `invoke pre-build` fails to clone -## Future Improvements +Check that `FRONTEND_VERSION` names a tag that actually exists on +`compas_threejs_ts` (tags are `vX.Y.Z`, e.g. `v1.2.0`). -### Option A: Publish Frontend to npm -1. Publish `compas_threejs_ts` as an npm package -2. Backend downloads it during Python package build -3. Most decoupled approach +### "PlaneHelpers" import warnings during build -### Option B: Git Submodule -1. Add frontend as a git submodule -2. Build during Python package installation -3. Users need Node.js installed +These are non-fatal warnings from Three.js imports. The build will still succeed. -### Option C: Commit Built Frontend ✅ **CURRENT** -1. Run sync script before commits -2. Commit built files to backend repo -3. No Node.js required for users -4. Larger git history due to binary files +### Large bundle size warning -**Current strategy**: Option C. This keeps installation simple for end users. +Consider code-splitting in the frontend if the bundle grows too large. See: +https://rollupjs.org/configuration-options/#output-manualchunks diff --git a/docs/installation.md b/docs/installation.md index 30d7251..1cf1c4b 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -25,6 +25,11 @@ cd compas_threejs pip install -e ".[dev]" ``` +The built frontend isn't committed to this repo, so the viewer won't render yet. +Run `invoke pre-build` to fetch and build the pinned `compas_threejs_ts` release (no +extra clone needed), or see below to build against a local frontend checkout instead. +See [FRONTEND_WORKFLOW.md](../FRONTEND_WORKFLOW.md) for details. + ### Typescript Frontend The TypeScript viewer lives in a separate repository. Clone it next to the diff --git a/scripts/sync-frontend.py b/scripts/sync-frontend.py deleted file mode 100644 index 3e6daa0..0000000 --- a/scripts/sync-frontend.py +++ /dev/null @@ -1,28 +0,0 @@ -import shutil -import subprocess -from pathlib import Path - -FRONTEND_REPO = Path("../compas_threejs_ts/") # Adjust path -BACKEND_DEST = Path("src/compas_threejs/viewer/frontend") - - -def sync_frontend(): - """Build frontend from external repo and copy into Python package.""" - - # 1. Build the frontend - print("🔨 Building frontend...") - subprocess.run(["npm", "run", "build"], cwd=FRONTEND_REPO, check=True) - - # 2. Clear old frontend files - if BACKEND_DEST.exists(): - shutil.rmtree(BACKEND_DEST) - - # 3. Copy new build - print("📦 Copying frontend build...") - shutil.copytree(FRONTEND_REPO / "dist", BACKEND_DEST) - - print("✅ Frontend synced successfully!") - - -if __name__ == "__main__": - sync_frontend() diff --git a/src/compas_threejs/viewer/frontend/assets/compas_icon_white.png b/src/compas_threejs/viewer/frontend/assets/compas_icon_white.png deleted file mode 100644 index 2c905bff94efbe31e531480ac97d9f437b5fe780..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5093 zcmV|JeWme(0RzJ69|lErE_Yr5E2x0w2!%nUBMKYp7`z#kgxS`}Oxi82CQX`E>ui!*tF!8!>+wAD`sO+J z`FOt0`*FiVGH{7&zX1Y)-6`3R@HSP?fj_bN1bz2@MD9<$BaA282@+1 zIi{Us2*#Lbp{M!7uhV?+rZ&R?0dU|l=6F~9;6kHp$ILEF$X64h)(ajlTx&#VyFaQYc z&hho2pH;v5ws+aIy3GAqws--nUAav7`pKDVY-0AR`|sgTK4-JnZa6a#mHggsm=H9O^j^OwO?33!k$Q2Q2va z&my(8y!0n)+U%5>3!g69?>z8X|s4>z!T<0`hJcBOSd z5ZN(@IeHy{9RJ{wj^=1}fYDQQpx~~eO_de)Jif|x5&3G+9lgWn+5S^gs_cP$M@tee zC3aA7cEBi*W*nQ>uVni+Js7%BOwyn~_P;Zw3XU1BHM$EH6sqh1X6Q&iR8U|D2#&*? zHKq#&6gswuUxi>ZCiI=?B{`S7T`ecLt=ZQb|;a7f`^*jRNeuZ#;(SPV|Nvx z?XH0dcckXp{M0=5SYM) zGhE2q2?`k?+8Wll7n)Qy@>g$;8@&%ef*?)8nrm0GqdV(dcN-TlQgHwR7X-v7p&zoN z42*hHd-biU#LgY8dVJ?b*X_muj8q(efQkp=leE8`yA>`ruaaSRm&*P2SC8~Y+S|W1$cjYO+~&jMw|1Tn&M;%VJ)Mh;UVh) z;n`EG&Da8I@0T}MTkA@Q5Ml!r(<%AoA$->qTu4CrF#V_&seW9;Ad zh$xRy&IfRGpx`>fcRmC%l}Y9yRO~OK7nw;`|KvxrR$mvG8AU~r@YK~8x=hjI_e*ac zgw2NOa7c5T*a)A9YqK@hEO+Ox68fSpbWm`#ZSWJ8Nv5t<4JB#O3@3P$dl$`T3sYj> z($;_0x6E#nVPF!%vnNzgP;LX|Z(D_>XPCf3RU3c3IsaarqkBwS+op5b%ky~Cr#fCn< zEP7cvQ^^-)9M1VA@`@!_<3@yr;|5 z?M9%;>i*U;JcND6N8OW6azx=KQ4?UH9Vj~EGLQW`N2a|D?aM3Osj|67pc2iIU7kbXgL;T=k z;tWBlhF*lxDtQ&K1r?%FQB4%r1l^{n8v?OKiikMou*8a`i;TV<7lDhxML`rrp2W$V z6aEcaLA5>u-~d3voWQ9m*RMzI2H}dqx~7b~bYV)1EmAr!KJvn2?p#aL#vNP~L=i4B zs+$R4PxVXarsHKHDh0rxx&fb!fixIEo9(TyVkdw2r05zN{PGqlAC^e_MH~p<@WB{m z$9C4aUq;L@mg)_NB;mNB?b_3=+b^HBloAA!v}I z9Z{NgzdMMK#`}>KhHe-!bgKY8=CgnuL|yxWXsVoRNFh`BPTwL*vUf%jTnhAtsY}6) z!A)s46jW6D8Q=x81u<`FC83sa0IBN=z0@=YgvRnmzRzdS0fQ{e-cftM=ub`BpxB|P z)A8P_pVx2E*voH%x8crYbT-)o~-x4PI(Gh;Bgl7_Lu+1p#bD|cK3M39Nzz(aUQFh9UuH;NFKyCwAvnB%*ixo{C~9rLR&24QjIUqo(f3LS%d{ zLj0(DXz=|4U33>H>ip<8>Iu0JO9MQF&1D42_sXW&b%rc1DJG*d3st`NOQyjkWv8a2 zGy(fGkf4ZjElV$D?q%Glw6d(e;Wx!DDw9=Fk&qIFsM%?Ej9TahWQXHgB~UcrAtgLG zZcu$wlyr;{4$53xxm5T%_-ZNyrF?x9hV$(m5i=Lu99)4YqNs3y^-N7Ai`&+VXW`eS zL=!Ed(i1AQwqof*v4A5&P`IHamTsn^99ef+5`d5l`f9k3YF`>DTf%HJs>=&>Oo>ah zBLubUH*N`mOikUhwYyBMLUQjJ*Q%R|O=`NFjLixpUTaYd< zoh~kb?)N7@QZ8xB&dcWRGL^72rQ>Vjwjf3rHC{-CJL#Rw3F&CD>zU@(d7kJk#)7*B-T<4QqqpQyR0BV z5mlF0c2^r!r^wX}K}*^y-DS3kPOCr>b(fbHwYVjE1z><(!kC*O>n^ix)jeNOOwJ^e zqmR1FEBEu_GTGF<{g%~5d_gfWdo}hGfp4{8id|GjO+vn%j{h+Ba}og&pcuE|rpXo> z$@i_U!{{yx+eCvOpcu>jW!&*|++AKtS*AnzX>b7qx6C^~nVPW`5f1x=f1jX=$XvL=PLh6NPLAuMr(sBaejV+kiyLq~* z>ja+8T`}KCgb|1hU0z6pg_#U92~pu5G1JS>yza87?gJ5F4tWk6Y|#*<`#AFNi|ozu zX?AY<3--z9*RAUEN-{*Hy31br^S{{I%6r_6cCoMOo{izTQ&HsMkVM7x9%nG>mD8_n*(x+NpDN4{RD~_(YiyW`LH1+EwVa$X+ZvOY!;#5m3Rr*cD~=jY z0D;TU1qAF*?_OZVXs&zJ+%OfdZs~j13>0Dy;DRE1SoY=W3M5jXQgvrK^&0L)f$wVX zKg-G%6&G8ey}&ezgB#hl?mkUD;p+iTBNFukMVDVbp;jYjfRj|!5Po*xo&T_sX#naU zlUks_z!OA%J>EZ3S)s@n^C_eEj-1yEJ>R=ndQvgkgl6XRfH;MonFESkv}C&woyny$ z*RGeIl*J~{iEtf5%Aj!BV)#PoZWe$+3J8jwcRlyJK*3$e>D+f9<*HhsXZlcZXZma_+M=%h|lrvx?1BYa_%?2ZuQs+_41$)BqUexq=fDUS!Fo z2l&FBCR6(G*~2eARdf#)c^zbabq(#2uROC>*>wnPj%1j_6g*b-6`ZPUf#w;Uu#Vx? zJxz}kCsOlBH)o_C)V6r>AL-2Db@@!MzDDZ3H8?swn+277W< z87o#hzO#-kS)ksV^}?g~D_2d4_JMZ4U;6ib-1adCgRlh>D(Jtgu2>><832TCR<6(t z11YoXacTA#4BVDpqwF>amYB&En0E&0EkVwm?^ije83UC}bYAPw9SS$EoET?kKfTJX zetFaV-TDcY!i8OoaeI< z3%|6A03ihhw1vYK9nL@7=AeaGh&&$*Eps+4Ul_I#U3Z8$dZ_oR$lY#EH+LB(_9oF3 zTQa#JM?|dN*CKnr6cn6hTK)cpFSd2vreZe2Z5$TOveRV>#_6VCbOJUn|5t1Vw=QVU zm=O(bBT!_~j;|ZBdHKI$GE8wGRsw3zt#Jef1^+E$NGd4DK6SPzdHq%&3Su7R)aj*o8WDLR{+g}L`v+|ovKReLkstzz(MEQ#nFro#7XbA(Z_nN5MMx>zN21K4N z0V6(_Apt}>d%AuipvV%QC1AuLDhZbXYYhsBu$V##7}%_>l*b5`hme%|UzAlpV+Dl@ zFp$4M9>d113~aXB_w5Y1OH!DC2o)46z(5{j&yn{^wGu_c0K(p=L}F?tY(Rt#3Kd|$ zP_%(NDP=#!hJk|tM67A*iOQa^zdMrsKC*yuQ1lw0AEUswy)KfrVXnWZeNXs+ONSvU zV*`Z;44%j65WU9Rf1KK4x|j?z*{~>@WVy=zC;<^ED6+uO?)-R;35sYiOhE^06zlZ9 z0lvjHwE-?S)H2dR5>r-yf&&9ZnL0{mfHiPaaC3@fZiW|G?2t1h2Gnz=wG1mk!GSU6 z9CegC@op3{cJQl(I@{X4#$%)I08rRU8}6dcq}pj}WHV4yR@HR^;DBo0AbYL5cUb*{ z%6oz8_-`3qI}ajsH=)vRlEn_~Iy0v78WdUJfZhNlmaBjRooPF2?+;}~-Z()4AW+LK z`xs`owdzieDF{$-U{tf)y(QaK--89+x7I9YjcY577h{bY6bLP`=or?R(%3%*CGQrM zY4`;ViY#y-uL0(0(0QK+kWE$PS_~2eD3F1~!liH%nj!WKXNDddo`p55nDWt))&&P@ z0$yDJE9juV747`%S1!|D6jsMjqyigYHGC|7K4>P2XE;lCM;&J7B`AV|1BRqeZsG^q zSE7v{EK=(L1@1=GyqRB&+MNL$Dtc?X2N2ZbPV@s5UsK#=hc z8+Ag_fx-tQ$e7}&=0E|nYzX0_ArLY0hrFLj=ML diff --git a/src/compas_threejs/viewer/frontend/assets/index.css b/src/compas_threejs/viewer/frontend/assets/index.css deleted file mode 100644 index af16ca7..0000000 --- a/src/compas_threejs/viewer/frontend/assets/index.css +++ /dev/null @@ -1,2 +0,0 @@ -/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-sm:calc(var(--radius) - 4px);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}html,body{margin:0;padding:0;overflow:hidden}body{background-color:var(--background);color:var(--foreground);font-family:Inter,sans-serif}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.top-1\/2{top:50%}.right-0{right:0}.right-2{right:calc(var(--spacing) * 2)}.left-0{left:0}.z-50{z-index:50}.z-1000{z-index:1000}.z-\[4000\]{z-index:4000}.z-\[4100\]{z-index:4100}.z-\[5000\]{z-index:5000}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.my-1{margin-block:var(--spacing)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.h-\(--reka-select-trigger-height\){height:var(--reka-select-trigger-height)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:calc(var(--spacing) * 96)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-8{width:calc(var(--spacing) * 8)}.w-72{width:calc(var(--spacing) * 72)}.w-84{width:calc(var(--spacing) * 84)}.w-\[80\%\]{width:80%}.w-fit{width:fit-content}.w-full{width:100%}.min-w-\(--reka-select-trigger-width\){min-width:var(--reka-select-trigger-width)}.min-w-0{min-width:0}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-32{min-width:calc(var(--spacing) * 32)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.cursor-default{cursor:default}.touch-none{touch-action:none}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.place-content-center{place-content:center}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-input{border-color:var(--input)}.border-primary{border-color:var(--primary)}.bg-background{background-color:var(--background)}.bg-destructive{background-color:var(--destructive)}.bg-muted{background-color:var(--muted)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-secondary-foreground{background-color:var(--secondary-foreground)}.bg-transparent{background-color:#0000}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-5{padding:calc(var(--spacing) * 5)}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pl-2{padding-left:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-start{text-align:start}.font-sans{font-family:var(--font-sans)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-nowrap{white-space:nowrap}.text-current{color:currentColor}.text-foreground{color:var(--foreground)}.text-input{color:var(--input)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ring\/50{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.ring-ring\/50{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,color\,box-shadow\]{transition-property:background-color,color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:ring-4:hover{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-20:disabled{opacity:.2}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[orientation\=horizontal\]\:h-1\.5[data-orientation=horizontal]{height:calc(var(--spacing) * 1.5)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing) * 44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing) * 1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab, var(--destructive) 60%, transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\\\'size-\\\'\]\)\]\:size-3 svg:not([class*="'size-'"]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>\[data-slot\=input\]\]\:has-\[\[data-slot\=decrement\]\]\:pl-5>[data-slot=input]:has([data-slot=decrement]){padding-left:calc(var(--spacing) * 5)}.\[\&\>\[data-slot\=input\]\]\:has-\[\[data-slot\=increment\]\]\:pr-5>[data-slot=input]:has([data-slot=increment]){padding-right:calc(var(--spacing) * 5)}.\[\&\>span\]\:truncate>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:color-mix(in oklab, var(--background) 20%, transparent)}}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:text-background{color:var(--background)}[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:color-mix(in oklab, var(--background) 10%, transparent)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0/.88);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0/.92);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0/.72);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--button-hover:oklch(100% 0 0/0);--toolbar-button-hover-shadow:3px 3px 10px 0px var(--foreground)}@supports (color:color-mix(in lab, red, red)){:root{--toolbar-button-hover-shadow:3px 3px 10px 0px color-mix(in oklab, var(--foreground) 30%, transparent)}}:root{--toolbar-button-active-shadow:3px 3px 2px 1px var(--foreground) inset, -3px -3px 2px 2px var(--background) inset}@supports (color:color-mix(in lab, red, red)){:root{--toolbar-button-active-shadow:3px 3px 2px 1px color-mix(in oklab, var(--foreground) 55%, transparent) inset, -3px -3px 2px 2px color-mix(in oklab, var(--background) 70%, transparent) inset}}:root{font-feature-settings:"liga" 1, "calt" 1;--theme-bg-start:#ffffff1f;--theme-bg-end:#ffffff24;--theme-border-color:#ffffff24;--theme-box-shadow:0 6px 20px #0000001f, inset 2px 2px 6px #fff9, inset -2px -2px 6px #0000000a;--theme-inset-highlight:#fff9;--theme-inset-shadow:#0000000a;font-family:Inter,sans-serif}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0/.88);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0/.92);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0/.72);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0);--theme-bg-start:#1118271f;--theme-bg-end:#1118272e;--theme-border-color:#ffffff1f;--theme-box-shadow:0 6px 22px 0 #00000047, inset 0 0 8px #ffffff0f;--toolbar-button-hover-shadow:3px 3px 10px 0px var(--foreground)}@supports (color:color-mix(in lab, red, red)){.dark{--toolbar-button-hover-shadow:3px 3px 10px 0px color-mix(in oklab, var(--foreground) 40%, transparent)}}.dark{--toolbar-button-active-shadow:3px 3px 2px 1px var(--foreground) inset, -2px -2px 2px 1px var(--background) inset}@supports (color:color-mix(in lab, red, red)){.dark{--toolbar-button-active-shadow:3px 3px 2px 1px color-mix(in oklab, var(--foreground) 70%, transparent) inset, -2px -2px 2px 1px color-mix(in oklab, var(--background) 40%, transparent) inset}}@supports (font-variation-settings:normal){:root{font-family:InterVariable,sans-serif}}div#app{margin:0;padding:0}.theme{background:linear-gradient(135deg, var(--theme-bg-start) 0%, var(--theme-bg-end) 100%);-webkit-backdrop-filter:blur(25px)saturate(180%);backdrop-filter:blur(25px)saturate(180%);border:1px solid var(--theme-border-color);box-shadow:var(--theme-box-shadow)}*{scrollbar-width:thin;scrollbar-color:#888 transparent}.text-tag{color:var(--popover-foreground);background:var(--popover);border:1px solid var(--border);border-radius:var(--radius-sm);white-space:nowrap;pointer-events:none;-webkit-user-select:none;user-select:none;padding:2px 6px;font-family:Inter,sans-serif;font-size:12px}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}div.right-bar[data-v-2390ba1f]{pointer-events:none;flex-direction:column;width:30vw;min-width:250px;max-width:300px;height:100%;padding:20px;display:flex;position:absolute;top:0;right:0}div.object-info[data-v-2390ba1f]{z-index:1000;max-width:400px;height:100%;color:var(--foreground);pointer-events:auto;border-radius:10px;flex-direction:column;margin:0;padding:20px;transition:transform .4s cubic-bezier(.4,0,.2,1);display:flex;right:0%}div.is-hidden[data-v-2390ba1f]{pointer-events:none;transform:translate(150%)}div#data-container[data-v-2390ba1f]{flex-direction:column;gap:30px;display:flex;position:relative;overflow-y:auto}div.item[data-v-2390ba1f]{align-items:left;flex-direction:column;display:flex}h1.section-title[data-v-2390ba1f]{color:var(--foreground);background:color-mix(in oklab, var(--background) 25%, transparent);-webkit-backdrop-filter:blur(10px);box-shadow:1px 1px 3px 0px color-mix(in oklab, var(--foreground) 35%, transparent) inset, -1px -1px 3px 0px color-mix(in oklab, var(--background) 70%, transparent) inset;border-radius:10px;margin-bottom:10px;padding:5px 5px 5px 10px}div.data-entry[data-v-2390ba1f]{margin-bottom:8px;padding:0 0 0 10px}Button#closeObjectBar[data-v-2390ba1f]{align-self:flex-end;margin-top:auto;position:relative}Button#openObjectBar[data-v-2390ba1f]{z-index:1;visibility:hidden;pointer-events:auto;transition:visibility 1s;display:flex;position:absolute;bottom:40px;right:40px}Button#openObjectBar.is-hidden[data-v-2390ba1f]{opacity:1;visibility:visible}.save-view-icon[data-v-c0eebdad]{justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex;position:relative}.save-view-overlay[data-v-c0eebdad]{background:color-mix(in srgb, var(--secondary-foreground) 92%, white);width:11px;height:11px;color:var(--secondary);border:1px solid color-mix(in srgb, var(--secondary) 65%, white);border-radius:999px;justify-content:center;align-items:center;display:inline-flex;position:absolute;bottom:-2px;right:-4px;overflow:hidden}.save-view-overlay-icon[data-v-c0eebdad]{stroke-width:5px;width:5px;min-width:5px;height:5px;min-height:5px;display:inline-flex;transform:translateY(-.1px)}.saved-view-delete-pressed[data-v-1562f39a]{color:#fff;background:color-mix(in srgb, var(--destructive) 85%, black);box-shadow:inset 2px 2px 2px #00000059,inset -1px -1px 1px #fff3}select option[data-v-1562f39a]{background:var(--secondary);color:var(--secondary-foreground)}.error-pill[data-v-ed1ef026]{width:16px;height:16px;color:var(--destructive-foreground,#fff);background:color-mix(in srgb, var(--destructive) 80%, transparent);cursor:default;-webkit-user-select:none;user-select:none;border-radius:9999px;justify-content:center;align-items:center;font-size:11px;font-weight:700;line-height:1;display:inline-flex}.themed-number[data-v-ed1ef026]{color:var(--foreground);caret-color:var(--foreground);accent-color:var(--foreground);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}.dark .themed-number[data-v-ed1ef026]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}.themed-number[data-v-ed1ef026]::-webkit-inner-spin-button{color:inherit}.themed-number[data-v-ed1ef026]::-webkit-outer-spin-button{color:inherit}.toolbar[data-v-7f20b0a6]{z-index:1001;pointer-events:auto;border-radius:10px;flex-direction:column;gap:12px;width:100%;height:auto;margin:0;padding:12px;display:flex;position:relative}[data-v-7f20b0a6] .toolbar-group{grid-auto-columns:max-content;grid-auto-flow:column;gap:6px;padding-right:6px;display:grid}[data-v-7f20b0a6] .button-icon{transform-origin:50%;justify-content:center;align-items:center;line-height:1;display:inline-flex}[data-v-7f20b0a6] .button-icon.front-icon{transform:scale(.75)}[data-v-7f20b0a6] .display-tools-wrapper{display:contents}[data-v-7f20b0a6] Button:hover{box-shadow:var(--toolbar-button-hover-shadow)}[data-v-7f20b0a6] Button.active{box-shadow:var(--toolbar-button-active-shadow)}h1[data-v-7f20b0a6]{color:var(--foreground)}div#openbar[data-v-a83066fb]{z-index:1000;gap:15px;align-items:left;pointer-events:auto;will-change:transform;border-radius:10px;flex-direction:column;width:100%;height:100%;margin:0;padding:20px;transition:transform .4s cubic-bezier(.4,0,.2,1);display:flex;position:relative;overflow-y:auto}div#openbar.is-hidden[data-v-a83066fb]{pointer-events:none;transform:translate(-150%)}.slider-container[data-v-a83066fb]{align-items:center;gap:10px;display:flex}.dynamic-item[data-v-a83066fb]{align-items:left;flex-direction:column;gap:8px;width:100%;display:flex}.dynamic-label[data-v-a83066fb]{color:var(--foreground);padding:0;font-size:15px;font-weight:500}.slider-value[data-v-a83066fb]{color:var(--foreground)}.checkbox-ui-component[data-v-a83066fb]{align-items:center;gap:8px;display:flex}.select-container[data-v-a83066fb]{align-items:center;width:100%;display:flex}Button.mb-4[data-v-a83066fb]{margin:auto 0 0;position:relative}Button.mb-5[data-v-a83066fb]{z-index:1;opacity:0;visibility:hidden;margin:0;transition:visibility 1s;display:flex;position:absolute;bottom:40px;left:40px}Button.mb-5.is-hidden[data-v-a83066fb]{opacity:1;visibility:visible}div#sidebar[data-v-1cbddba3]{z-index:1000;pointer-events:none;flex-direction:column;row-gap:30px;width:30vw;min-width:250px;max-width:300px;height:100%;padding:20px;display:flex;position:absolute;top:0;left:0}[data-v-1cbddba3] .toolbar,[data-v-1cbddba3] #openbar{pointer-events:auto}.theme-indicator[data-v-ebb8d4d4]{z-index:1105;pointer-events:none;background:color-mix(in oklab, var(--background) 78%, transparent);border:1px solid color-mix(in oklab, var(--foreground) 14%, transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:9999px;justify-content:center;align-items:center;width:44px;height:44px;transition:transform .4s cubic-bezier(.4,0,.2,1),opacity .4s cubic-bezier(.4,0,.2,1);display:flex;position:absolute;top:18px;right:18px;box-shadow:0 10px 28px #0000002e}.dark .theme-indicator[data-v-ebb8d4d4]{border-color:color-mix(in oklab, var(--foreground) 14%, transparent);background:oklch(26.9% 0 0);box-shadow:0 8px 24px #00000080,inset 0 0 10px #ffffff0f}.theme-indicator-icon[data-v-ebb8d4d4]{width:20px;height:20px;color:var(--foreground)}.theme-indicator-enter-active[data-v-ebb8d4d4],.theme-indicator-leave-active[data-v-ebb8d4d4]{transition:transform .4s cubic-bezier(.4,0,.2,1),opacity .4s cubic-bezier(.4,0,.2,1)}.theme-indicator-enter-from[data-v-ebb8d4d4],.theme-indicator-leave-to[data-v-ebb8d4d4]{opacity:0;transform:translate(150%)}.theme-indicator-enter-to[data-v-ebb8d4d4],.theme-indicator-leave-from[data-v-ebb8d4d4]{opacity:1;transform:translate(0)}div.app-container[data-v-dc8ca966]{width:100%;height:100%;margin:0;padding:0;display:inline-flex;position:relative;overflow:hidden}div.three-container[data-v-dc8ca966]{flex:1;position:relative;overflow:hidden} diff --git a/src/compas_threejs/viewer/frontend/assets/index.js b/src/compas_threejs/viewer/frontend/assets/index.js deleted file mode 100644 index 4080d78..0000000 --- a/src/compas_threejs/viewer/frontend/assets/index.js +++ /dev/null @@ -1,4170 +0,0 @@ -var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r={},i=[],a=()=>{},o=()=>!1,s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith(`onUpdate:`),l=Object.assign,u=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,f=(e,t)=>d.call(e,t),p=Array.isArray,m=e=>w(e)===`[object Map]`,h=e=>w(e)===`[object Set]`,g=e=>w(e)===`[object Date]`,_=e=>w(e)===`[object RegExp]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,S=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),C=Object.prototype.toString,w=e=>C.call(e),T=e=>w(e).slice(8,-1),E=e=>w(e)===`[object Object]`,D=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,O=n(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},k=/-\w/g,A=ee(e=>e.replace(k,e=>e.slice(1).toUpperCase())),te=/\B([A-Z])/g,j=ee(e=>e.replace(te,`-$1`).toLowerCase()),ne=ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),M=ee(e=>e?`on${ne(e)}`:``),N=(e,t)=>!Object.is(e,t),re=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ae=e=>{let t=parseFloat(e);return isNaN(t)?e:t},oe=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},se,ce=()=>se||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},le=n(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function ue(e){if(p(e)){let t={};for(let n=0;n{if(e){let n=e.split(fe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function he(e){let t=``;if(y(e))t=e;else if(p(e))for(let n=0;nbe(e,t))}var Se=e=>!!(e&&e.__v_isRef===!0),Ce=e=>y(e)?e:e==null?``:p(e)||x(e)&&(e.toString===C||!v(e.toString))?Se(e)?Ce(e.value):JSON.stringify(e,we,2):String(e),we=(e,t)=>Se(t)?we(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Te(t,r)+` =>`]=n,e),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Te(e))}:b(t)?Te(t):x(t)&&!p(t)&&!E(t)?String(t):t,Te=(e,t=``)=>b(e)?`Symbol(${e.description??t})`:e;function Ee(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var De,Oe=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&De&&(De.active?(this.parent=De,this.index=(De.scopes||(De.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e0&&--this._on===0){if(De===this)De=this.prevScope;else{let e=De;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t0)return;if(Le){let e=Le;for(Le=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ie;){let t=Ie;for(Ie=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Ve(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function He(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Ge(r),Ke(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Ue(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(We(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function We(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===et)||(e.globalVersion=et,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ue(e))))return;e.flags|=2;let t=e.dep,n=Me,r=Ye;Me=e,Ye=!0;try{Ve(e);let n=e.fn(e._value);(t.version===0||N(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Me=n,Ye=r,He(e),e.flags&=-3}}function Ge(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Ge(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ke(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function qe(e,t){e.effect instanceof Pe&&(e=e.effect.fn);let n=new Pe(e);t&&l(n,t);try{n.run()}catch(e){throw n.stop(),e}let r=n.run.bind(n);return r.effect=n,r}function Je(e){e.effect.stop()}var Ye=!0,Xe=[];function Ze(){Xe.push(Ye),Ye=!1}function Qe(){let e=Xe.pop();Ye=e===void 0||e}function $e(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=Me;Me=void 0;try{t()}finally{Me=e}}}var et=0,tt=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},nt=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Me||!Ye||Me===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Me)t=this.activeLink=new tt(Me,this),Me.deps?(t.prevDep=Me.depsTail,Me.depsTail.nextDep=t,Me.depsTail=t):Me.deps=Me.depsTail=t,rt(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Me.depsTail,t.nextDep=void 0,Me.depsTail.nextDep=t,Me.depsTail=t,Me.deps===t&&(Me.deps=e)}return t}trigger(e){this.version++,et++,this.notify(e)}notify(e){ze();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Be()}}};function rt(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)rt(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var it=new WeakMap,at=Symbol(``),ot=Symbol(``),st=Symbol(``);function ct(e,t,n){if(Ye&&Me){let t=it.get(e);t||it.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new nt),r.map=t,r.key=n),r.track()}}function lt(e,t,n,r,i,a){let o=it.get(e);if(!o){et++;return}let s=e=>{e&&e.trigger()};if(ze(),t===`clear`)o.forEach(s);else{let i=p(e),a=i&&D(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===st||!b(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(st)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(at)),m(e)&&s(o.get(ot)));break;case`delete`:i||(s(o.get(at)),m(e)&&s(o.get(ot)));break;case`set`:m(e)&&s(o.get(at))}}Be()}function ut(e,t){let n=it.get(e);return n&&n.get(t)}function dt(e){let t=tn(e);return t===e?t:(ct(t,`iterate`,st),$t(e)?t:t.map(rn))}function ft(e){return ct(e=tn(e),`iterate`,st),e}function pt(e,t){return Qt(e)?an(Zt(e)?rn(t):t):rn(t)}var mt={__proto__:null,[Symbol.iterator](){return ht(this,Symbol.iterator,e=>pt(this,e))},concat(...e){return dt(this).concat(...e.map(e=>p(e)?dt(e):e))},entries(){return ht(this,`entries`,e=>(e[1]=pt(this,e[1]),e))},every(e,t){return _t(this,`every`,e,t,void 0,arguments)},filter(e,t){return _t(this,`filter`,e,t,e=>e.map(e=>pt(this,e)),arguments)},find(e,t){return _t(this,`find`,e,t,e=>pt(this,e),arguments)},findIndex(e,t){return _t(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return _t(this,`findLast`,e,t,e=>pt(this,e),arguments)},findLastIndex(e,t){return _t(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return _t(this,`forEach`,e,t,void 0,arguments)},includes(...e){return yt(this,`includes`,e)},indexOf(...e){return yt(this,`indexOf`,e)},join(e){return dt(this).join(e)},lastIndexOf(...e){return yt(this,`lastIndexOf`,e)},map(e,t){return _t(this,`map`,e,t,void 0,arguments)},pop(){return bt(this,`pop`)},push(...e){return bt(this,`push`,e)},reduce(e,...t){return vt(this,`reduce`,e,t)},reduceRight(e,...t){return vt(this,`reduceRight`,e,t)},shift(){return bt(this,`shift`)},some(e,t){return _t(this,`some`,e,t,void 0,arguments)},splice(...e){return bt(this,`splice`,e)},toReversed(){return dt(this).toReversed()},toSorted(e){return dt(this).toSorted(e)},toSpliced(...e){return dt(this).toSpliced(...e)},unshift(...e){return bt(this,`unshift`,e)},values(){return ht(this,`values`,e=>pt(this,e))}};function ht(e,t,n){let r=ft(e),i=r[t]();return r!==e&&!$t(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var gt=Array.prototype;function _t(e,t,n,r,i,a){let o=ft(e),s=o!==e&&!$t(e),c=o[t];if(c!==gt[t]){let t=c.apply(e,a);return s?rn(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,pt(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function vt(e,t,n,r){let i=ft(e),a=i!==e&&!$t(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=pt(e,t)),n.call(this,t,pt(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?pt(e,c):c}function yt(e,t,n){let r=tn(e);ct(r,`iterate`,st);let i=r[t](...n);return(i===-1||i===!1)&&en(n[0])?(n[0]=tn(n[0]),r[t](...n)):i}function bt(e,t,n=[]){Ze(),ze();let r=tn(e)[t].apply(e,n);return Be(),Qe(),r}var xt=n(`__proto__,__v_isRef,__isVue`),St=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(b));function Ct(e){b(e)||(e=String(e));let t=tn(this);return ct(t,`has`,e),t.hasOwnProperty(e)}var wt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Wt:Ut:i?Ht:Vt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=p(e);if(!r){let e;if(a&&(e=mt[t]))return e;if(t===`hasOwnProperty`)return Ct}let o=Reflect.get(e,t,on(e)?e:n);if((b(t)?St.has(t):xt(t))||(r||ct(e,`get`,t),i))return o;if(on(o)){let e=a&&D(t)?o:o.value;return r&&x(e)?Jt(e):e}return x(o)?r?Jt(o):Kt(o):o}},Tt=class extends wt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=p(e)&&D(t);if(!this._isShallow){let e=Qt(i);if(!$t(n)&&!Qt(n)&&(i=tn(i),n=tn(n)),!a&&on(i)&&!on(n))return e||(i.value=n),!0}let o=a?Number(t)e,Mt=e=>Reflect.getPrototypeOf(e);function Nt(e,t,n){return function(...r){let i=this.__v_raw,a=tn(i),o=m(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,u=i[e](...r),d=n?jt:t?an:rn;return!t&&ct(a,`iterate`,c?ot:at),l(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:s?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function Pt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Ft(e,t){let n={get(n){let r=this.__v_raw,i=tn(r),a=tn(n);e||(N(n,a)&&ct(i,`get`,n),ct(i,`get`,a));let{has:o}=Mt(i),s=t?jt:e?an:rn;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&ct(tn(t),`iterate`,at),t.size},has(t){let n=this.__v_raw,r=tn(n),i=tn(t);return e||(N(t,i)&&ct(r,`has`,t),ct(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=tn(a),s=t?jt:e?an:rn;return!e&&ct(o,`iterate`,at),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return l(n,e?{add:Pt(`add`),set:Pt(`set`),delete:Pt(`delete`),clear:Pt(`clear`)}:{add(e){let n=tn(this),r=Mt(n),i=tn(e),a=!t&&!$t(e)&&!Qt(e)?i:e;return r.has.call(n,a)||N(e,a)&&r.has.call(n,e)||N(i,a)&&r.has.call(n,i)||(n.add(a),lt(n,`add`,a,a)),this},set(e,n){!t&&!$t(n)&&!Qt(n)&&(n=tn(n));let r=tn(this),{has:i,get:a}=Mt(r),o=i.call(r,e);o||=(e=tn(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?N(n,s)&<(r,`set`,e,n,s):lt(r,`add`,e,n),this},delete(e){let t=tn(this),{has:n,get:r}=Mt(t),i=n.call(t,e);i||=(e=tn(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&<(t,`delete`,e,void 0,a),o},clear(){let e=tn(this),t=e.size!==0,n=e.clear();return t&<(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Nt(r,e,t)}),n}function It(e,t){let n=Ft(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(f(n,r)&&r in t?n:t,r,i)}var Lt={get:It(!1,!1)},Rt={get:It(!1,!0)},zt={get:It(!0,!1)},Bt={get:It(!0,!0)},Vt=new WeakMap,Ht=new WeakMap,Ut=new WeakMap,Wt=new WeakMap;function Gt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Kt(e){return Qt(e)?e:Xt(e,!1,Dt,Lt,Vt)}function qt(e){return Xt(e,!1,kt,Rt,Ht)}function Jt(e){return Xt(e,!0,Ot,zt,Ut)}function Yt(e){return Xt(e,!0,At,Bt,Wt)}function Xt(e,t,n,r,i){if(!x(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Gt(T(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Zt(e){return Qt(e)?Zt(e.__v_raw):!!(e&&e.__v_isReactive)}function Qt(e){return!!(e&&e.__v_isReadonly)}function $t(e){return!!(e&&e.__v_isShallow)}function en(e){return e?!!e.__v_raw:!1}function tn(e){let t=e&&e.__v_raw;return t?tn(t):e}function nn(e){return!f(e,`__v_skip`)&&Object.isExtensible(e)&&ie(e,`__v_skip`,!0),e}var rn=e=>x(e)?Kt(e):e,an=e=>x(e)?Jt(e):e;function on(e){return e?e.__v_isRef===!0:!1}function F(e){return cn(e,!1)}function sn(e){return cn(e,!0)}function cn(e,t){return on(e)?e:new ln(e,t)}var ln=class{constructor(e,t){this.dep=new nt,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:tn(e),this._value=t?e:rn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||$t(e)||Qt(e);e=n?e:tn(e),N(e,t)&&(this._rawValue=e,this._value=n?e:rn(e),this.dep.trigger())}};function un(e){e.dep&&e.dep.trigger()}function I(e){return on(e)?e.value:e}function dn(e){return v(e)?e():I(e)}var fn={get:(e,t,n)=>t===`__v_raw`?e:I(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return on(i)&&!on(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function pn(e){return Zt(e)?e:new Proxy(e,fn)}var mn=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new nt,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}};function hn(e){return new mn(e)}function gn(e){let t=p(e)?Array(e.length):{};for(let n in e)t[n]=bn(e,n);return t}var _n=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=b(t)?t:String(t),this._raw=tn(e);let r=!0,i=e;if(!p(e)||b(this._key)||!D(this._key))do r=!en(i)||$t(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=I(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&on(this._raw[this._key])){let t=this._object[this._key];if(on(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return ut(this._raw,this._key)}},vn=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function yn(e,t,n){return on(e)?e:v(e)?new vn(e):x(e)&&arguments.length>1?bn(e,t,n):F(e)}function bn(e,t,n){return new _n(e,t,n)}var xn=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new nt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=et-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Me!==this)return Re(this,!0),!0}get value(){let e=this.dep.track();return We(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function Sn(e,t,n=!1){let r,i;return v(e)?r=e:(r=e.get,i=e.set),new xn(r,i,n)}var Cn={GET:`get`,HAS:`has`,ITERATE:`iterate`},wn={SET:`set`,ADD:`add`,DELETE:`delete`,CLEAR:`clear`},Tn={},En=new WeakMap,Dn=void 0;function On(){return Dn}function kn(e,t=!1,n=Dn){if(n){let t=En.get(n);t||En.set(n,t=[]),t.push(e)}}function An(e,t,n=r){let{immediate:i,deep:o,once:s,scheduler:c,augmentJob:l,call:d}=n,f=e=>o?e:$t(e)||o===!1||o===0?jn(e,1):jn(e),m,h,g,_,y=!1,b=!1;if(on(e)?(h=()=>e.value,y=$t(e)):Zt(e)?(h=()=>f(e),y=!0):p(e)?(b=!0,y=e.some(e=>Zt(e)||$t(e)),h=()=>e.map(e=>{if(on(e))return e.value;if(Zt(e))return f(e);if(v(e))return d?d(e,2):e()})):h=v(e)?t?d?()=>d(e,2):e:()=>{if(g){Ze();try{g()}finally{Qe()}}let t=Dn;Dn=m;try{return d?d(e,3,[_]):e(_)}finally{Dn=t}}:a,t&&o){let e=h,t=o===!0?1/0:o;h=()=>jn(e(),t)}let x=Ae(),S=()=>{m.stop(),x&&x.active&&u(x.effects,m)};if(s&&t){let e=t;t=(...t)=>{let n=e(...t);return S(),n}}let C=b?Array(e.length).fill(Tn):Tn,w=e=>{if(!(!(m.flags&1)||!m.dirty&&!e)){if(t){let n=m.run();if(e||o||y||(b?n.some((e,t)=>N(e,C[t])):N(n,C))){g&&g();let e=Dn;Dn=m;try{let e=[n,C===Tn?void 0:b&&C[0]===Tn?[]:C,_];C=n,d?d(t,3,e):t(...e)}finally{Dn=e}}}else m.run()}};return l&&l(w),m=new Pe(h),m.scheduler=c?()=>c(w,!1):w,_=e=>kn(e,!1,m),g=m.onStop=()=>{let e=En.get(m);if(e){if(d)d(e,4);else for(let t of e)t();En.delete(m)}},t?i?w(!0):C=m.run():c?c(w.bind(null,!0),!0):m.run(),S.pause=m.pause.bind(m),S.resume=m.resume.bind(m),S.stop=S,S}function jn(e,t=1/0,n){if(t<=0||!x(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,on(e))jn(e.value,t,n);else if(p(e))for(let r=0;r{jn(e,t,n)});else if(E(e)){for(let r in e)jn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&jn(e[r],t,n)}return e}var Mn=[];function Nn(e){Mn.push(e)}function Pn(){Mn.pop()}function Fn(e,t){}var In={SETUP_FUNCTION:0,0:`SETUP_FUNCTION`,RENDER_FUNCTION:1,1:`RENDER_FUNCTION`,NATIVE_EVENT_HANDLER:5,5:`NATIVE_EVENT_HANDLER`,COMPONENT_EVENT_HANDLER:6,6:`COMPONENT_EVENT_HANDLER`,VNODE_HOOK:7,7:`VNODE_HOOK`,DIRECTIVE_HOOK:8,8:`DIRECTIVE_HOOK`,TRANSITION_HOOK:9,9:`TRANSITION_HOOK`,APP_ERROR_HANDLER:10,10:`APP_ERROR_HANDLER`,APP_WARN_HANDLER:11,11:`APP_WARN_HANDLER`,FUNCTION_REF:12,12:`FUNCTION_REF`,ASYNC_COMPONENT_LOADER:13,13:`ASYNC_COMPONENT_LOADER`,SCHEDULER:14,14:`SCHEDULER`,COMPONENT_UPDATE:15,15:`COMPONENT_UPDATE`,APP_UNMOUNT_CLEANUP:16,16:`APP_UNMOUNT_CLEANUP`},Ln={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`};function Rn(e,t,n,r){try{return r?e(...r):e()}catch(e){Bn(e,t,n)}}function zn(e,t,n,r){if(v(e)){let i=Rn(e,t,n,r);return i&&S(i)&&i.catch(e=>{Bn(e,t,n)}),i}if(p(e)){let i=[];for(let a=0;a>>1,i=Hn[r],a=nr(i);a=nr(n)?Hn.push(e):Hn.splice(Xn(t),0,e),e.flags|=1,Qn()}}function Qn(){Jn||=qn.then(rr)}function $n(e){if(!p(e))Gn&&e.id===-1?Gn.splice(Kn+1,0,e):e.flags&1||(Wn.push(e),e.flags|=1);else for(let t=0;tnr(e)-nr(t));if(Wn.length=0,Gn){for(let t=0;te.id==null?e.flags&2?-1:1/0:e.id;function rr(e){try{for(Un=0;Unir.emit(e,...t)),ar=[]):typeof window<`u`&&window.HTMLElement&&!(window.navigator?.userAgent)?.includes(`jsdom`)?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{or(e,t)}),setTimeout(()=>{ir||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ar=[])},3e3)):ar=[]}var sr=null,cr=null;function lr(e){let t=sr;return sr=e,cr=e&&e.type.__scopeId||null,t}function ur(e){cr=e}function dr(){cr=null}var fr=e=>L;function L(e,t=sr,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&fs(-1);let i=lr(t),a=cs.length,o;try{o=e(...n)}finally{for(let e=cs.length;e>a;e--)us();lr(i),r._d&&fs(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function pr(e,t){if(sr===null)return e;let n=Qs(sr),i=e.dirs||=[];for(let e=0;e1)return n&&v(t)?t.call(r&&r.proxy):t}}function _r(){return!!(Fs()||$a)}var vr=Symbol.for(`v-scx`),yr=()=>gr(vr);function br(e,t){return wr(e,null,t)}function xr(e,t){return wr(e,null,{flush:`post`})}function Sr(e,t){return wr(e,null,{flush:`sync`})}function Cr(e,t,n){return wr(e,t,n)}function wr(e,t,n=r){let{immediate:i,deep:o,flush:s,once:c}=n,u=l({},n),d=t&&i||!t&&s!==`post`,f;if(Vs){if(s===`sync`){let e=yr();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=a,e.resume=a,e.pause=a,e}}let p=Ps;u.call=(e,t,n)=>zn(e,p,t,n);let m=!1;s===`post`?u.scheduler=e=>{No(e,p&&p.suspense)}:s!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():Zn(e)}),u.augmentJob=e=>{t&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=An(e,t,u);return Vs&&(f?f.push(h):d&&h()),h}function Tr(e,t,n){let r=this.proxy,i=y(e)?e.includes(`.`)?Er(r,e):()=>r[e]:e.bind(r,r),a;v(t)?a=t:(a=t.handler,n=t);let o=Rs(this),s=wr(i,a.bind(r),n);return o(),s}function Er(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;ee.__isTeleport,Ar=e=>e&&(e.disabled||e.disabled===``),jr=e=>e&&(e.defer||e.defer===``),Mr=e=>typeof SVGElement<`u`&&e instanceof SVGElement,Nr=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,Pr=(e,t)=>{let n=e&&e.to;return y(n)?t?t(n):null:n},Fr={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=Ar(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=Ar(e.props),r=e.target=Pr(e.props,m),a=Br(r,e,h,p);r&&(o!==`svg`&&Mr(r)?o=`svg`:o!==`mathml`&&Nr(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),zr(e,!1)))},S=e=>{let t=()=>{if(Dr.get(e)===t){if(Dr.delete(e),Ar(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),zr(e,!0)}x(e)}};Dr.set(e,t),No(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),jr(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),zr(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=Dr.get(e);if(u){u.flags|=8,Dr.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Ar(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||Mr(p)?o=`svg`:(o===`mathml`||Nr(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),Bo(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ir(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=Pr(t.props,m);e&&(t.target=e,Ir(t,e,null,l,0))}else g&&Ir(t,p,h,l,1);zr(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=Ar(f),m=a||!p,h=Dr.get(e);if(h&&(h.flags|=8,Dr.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e{e.isMounted=!0}),Zi(()=>{e.isUnmounting=!0}),e}var Wr=[Function,Array],Gr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Wr,onEnter:Wr,onAfterEnter:Wr,onEnterCancelled:Wr,onBeforeLeave:Wr,onLeave:Wr,onAfterLeave:Wr,onLeaveCancelled:Wr,onBeforeAppear:Wr,onAppear:Wr,onAfterAppear:Wr,onAppearCancelled:Wr},Kr=e=>{let t=e.subTree;return t.component?Kr(t.component):t},qr={name:`BaseTransition`,props:Gr,setup(e,{slots:t}){let n=Fs(),r=Ur();return()=>{let i=t.default&&ti(t.default(),!0),a=i&&i.length?Jr(i):n.subTree?Ts():void 0;if(!a)return;let o=tn(e),{mode:s}=o;if(r.isLeaving)return Qr(a);let c=$r(a);if(!c)return Qr(a);let l=Zr(c,o,r,n,e=>l=e);c.type!==os&&ei(c,l);let u=n.subTree&&$r(n.subTree);if(u&&u.type!==os&&!gs(u,c)&&Kr(n).type!==os){let e=Zr(u,o,r,n);if(ei(u,e),s===`out-in`&&c.type!==os)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},Qr(a);s===`in-out`&&c.type!==os?e.delayLeave=(e,t,n)=>{let i=Xr(r,u);i[String(u.key)]=u,e[Vr]=()=>{t(),e[Vr]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function Jr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==os){t=n;break}}return t}var Yr=qr;function Xr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Zr(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:m,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:_,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,x=String(e.key),S=Xr(n,e),C=(e,t)=>{e&&zn(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),p(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted){if(a)r=_||c;else return}t[Vr]&&t[Vr](!0);let i=S[x];i&&gs(e,i)&&i.el[Vr]&&i.el[Vr](),C(r,[t])},enter(t){if(S[x]===e)return;let r=l,i=u,o=d;if(!n.isMounted){if(a)r=v||l,i=y||u,o=b||d;else return}let s=!1;t[Hr]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[Hr]=void 0)};let c=t[Hr].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[Hr]&&t[Hr](!0),n.isUnmounting)return r();C(f,[t]);let a=!1;t[Vr]=n=>{a||(a=!0,r(),C(n?g:h,[t]),t[Vr]=void 0,S[i]===e&&delete S[i])};let o=t[Vr].bind(null,!1);S[i]=e,m?w(m,[t,o]):o()},clone(e){let a=Zr(e,t,n,r,i);return i&&i(a),a}};return T}function Qr(e){if(Ii(e))return e=Ss(e),e.children=null,e}function $r(e){if(!Ii(e))return kr(e.type)&&e.children?Jr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&v(n.default))return n.default()}}function ei(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;ei(kr(n.type)&&$r(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ti(e,t=!1,n){let r=[],i=0;for(let a=0;a1)for(let e=0;en.value,set:e=>n.value=e})}return n}function ai(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var oi=new WeakMap;function si(e,t,n,i,a=!1){if(p(e)){e.forEach((e,r)=>si(e,t&&(p(t)?t[r]:t),n,i,a));return}if(Ni(i)&&!a){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&si(e,t,n,i.component.subTree);return}let s=i.shapeFlag&4?Qs(i.component):i.el,c=a?null:s,{i:l,r:d}=e,m=t&&t.r,h=l.refs===r?l.refs={}:l.refs,g=l.setupState,_=tn(g),b=g===r?o:e=>!ai(h,e)&&f(_,e),x=(e,t)=>!(t&&ai(h,t));if(m!=null&&m!==d){if(ci(t),y(m))h[m]=null,b(m)&&(g[m]=null);else if(on(m)){let e=t;x(m,e.k)&&(m.value=null),e.k&&(h[e.k]=null)}}if(v(d))Rn(d,l,12,[c,h]);else{let t=y(d),r=on(d);if(t||r){let i=()=>{if(e.f){let n=t?b(d)?g[d]:h[d]:x(d)||!e.k?d.value:h[e.k];if(a)p(n)&&u(n,s);else if(p(n))n.includes(s)||n.push(s);else if(t)h[d]=[s],b(d)&&(g[d]=h[d]);else{let t=[s];x(d,e.k)&&(d.value=t),e.k&&(h[e.k]=t)}}else t?(h[d]=c,b(d)&&(g[d]=c)):r&&(x(d,e.k)&&(d.value=c),e.k&&(h[e.k]=c))};if(c){let t=()=>{i(),oi.delete(e)};t.id=-1,oi.set(e,t),No(t,n)}else ci(e),i()}}}function ci(e){let t=oi.get(e);t&&(t.flags|=8,oi.delete(e))}var li=!1,ui=()=>{li||=(console.error(`Hydration completed but contains mismatches.`),!0)},di=e=>e.namespaceURI.includes(`svg`)&&e.tagName!==`foreignObject`,fi=e=>e.namespaceURI.includes(`MathML`),pi=e=>{if(e.nodeType===1){if(di(e))return`svg`;if(fi(e))return`mathml`}},mi=e=>e.nodeType===8;function hi(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:a,parentNode:o,remove:c,insert:l,createComment:u}}=e,d=(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),tr(),t._vnode=e;return}f(t.firstChild,e,null,null,null),tr(),t._vnode=e},f=(n,r,s,c,u,d=!1)=>{d||=!!r.dynamicChildren;let b=mi(n)&&n.data===`[`,x=()=>g(n,r,s,c,u,b),{type:S,ref:C,shapeFlag:w,patchFlag:T}=r,E=n.nodeType;r.el=n,T===-2&&(d=!1,r.dynamicChildren=null);let D=null;switch(S){case as:E===3?(n.data!==r.children&&(ui(),n.data=r.children),D=a(n)):r.children===``?(l(r.el=i(``),o(n),n),D=n):D=x();break;case os:y(n)?(D=a(n),v(r.el=n.content.firstChild,n,s)):D=E!==8||b?x():a(n);break;case ss:if(b&&(n=a(n),E=n.nodeType),E===1||E===3){D=n;let e=!r.children.length;for(let t=0;t{o||=!!t.dynamicChildren;let{type:l,dynamicProps:u,props:d,patchFlag:f,shapeFlag:p,dirs:h,transition:g}=t,_=l===`input`||l===`option`,b=!!u;if(_||b||f!==-1){h&&mr(t,null,n,`created`);let l=!1;if(y(e)){l=zo(null,g)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(l){let e=r.getAttribute(`class`);e&&(r.$cls=e),g.beforeEnter(r)}v(r,e,n),t.el=e=r}if(p&16&&!(d&&(d.innerHTML||d.textContent))){let r=m(e.firstChild,t,e,n,i,a,o);for(r&&!bi(e,1)&&ui();r;){let e=r;r=r.nextSibling,c(e)}}else if(p&8){let n=t.children;n[0]===` -`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,` -`)&&(bi(e,0)||ui(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!O(a)||a[0]===`.`||t&&!O(a)||u&&u.includes(a)){if(_i(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Zt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&As(x,n,t),h&&mr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&ts(()=>{x&&As(x,n,t),l&&g.enter(e),h&&mr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&mi(f)&&f.data===`]`?a(t.anchor=f):(ui(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(Si(e,t)||ui(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,pi(d),s),r&&(r.vnode.el=t.el,mo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&mi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var gi=new Set([`src`,`srcset`,`href`,`poster`]);function _i(e,t,n){return gi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var vi=`data-allow-mismatch`,yi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function bi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(vi);)e=e.parentElement;return xi(e&&e.getAttribute(vi),t)}function xi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(yi[t])}}function Si(e,t){return bi(e.parentElement,1)||Ci(e)||wi(t)}function Ci(e){return e.nodeType===1&&xi(e.getAttribute(vi),1)}function wi({props:e}){let t=e&&e[vi];return typeof t==`string`&&xi(t,1)}var Ti=ce().requestIdleCallback||(e=>setTimeout(e,1)),Ei=ce().cancelIdleCallback||(e=>clearTimeout(e)),Di=(e=1e4)=>t=>{let n=Ti(t,{timeout:e});return()=>Ei(n)};function Oi(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t0&&r0&&n0&&i(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Oi(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ai=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},ji=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Mi(e,t){if(mi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(mi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ni=e=>!!e.type.__asyncLoader;function Pi(e){v(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return R({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Mi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Ps;if(ri(e),u)return()=>Fi(u,e);let t=t=>{l=null,Bn(t,e,13,!r)};if(s&&e.suspense||Vs)return p().then(t=>()=>Fi(t,e)).catch(e=>(t(e),()=>r?U(r,{error:e}):null));let a=F(!1),c=F(),d=F(!!i),f,m;return Qi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ii(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Fi(u,e);if(c.value&&r)return U(r,{error:c.value});if(n&&!d.value)return Fi(n,e)}}})}function Fi(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=U(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}var Ii=e=>e.type.__isKeepAlive,Li={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=Fs(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=r,f=d(`div`);r.activate=(e,t,n,r,i)=>{let a=e.component;l(e,t,n,0,s),c(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),No(()=>{a.isDeactivated=!1,a.a&&re(a.a);let t=e.props&&e.props.onVnodeMounted;t&&As(t,a.parent,e)},s)},r.deactivate=e=>{let t=e.component;Uo(t.m),Uo(t.a),l(e,f,null,1,s),No(()=>{t.da&&re(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&As(n,t.parent,e),t.isDeactivated=!0},s)};function p(e){Ui(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=$s(Ni(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!gs(t,o))?p(t):o&&Ui(o),i.delete(e),a.delete(e)}Cr(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>Ri(e,t)),t&&m(e=>!Ri(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{g!=null&&(Go(n.subTree.type)?No(()=>{i.set(g,Wi(n.subTree))},n.subTree.suspense):i.set(g,Wi(n.subTree)))};return Ji(_),Xi(_),Zi(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=Wi(t);if(e.type===i.type&&e.key===i.key){Ui(i);let e=i.component.da;e&&No(e,r);return}p(e)})}),()=>{if(g=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!hs(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=Wi(r);if(s.type===os)return o=null,s;let c=s.type,l=$s(Ni(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!Ri(u,l))||d&&l&&Ri(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,m=i.get(p);return s.el&&(s=Ss(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&ei(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&h(a.values().next().value)),s.shapeFlag|=256,o=s,Go(r.type)?r:s}}};function Ri(e,t){return p(e)?e.some(e=>Ri(e,t)):y(e)?e.split(`,`).includes(t):_(e)?(e.lastIndex=0,e.test(t)):!1}function zi(e,t){Vi(e,`a`,t)}function Bi(e,t){Vi(e,`da`,t)}function Vi(e,t,n=Ps){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Gi(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Ii(e.parent.vnode)&&Hi(r,t,n,e),e=e.parent}}function Hi(e,t,n,r){let i=Gi(t,e,r,!0);Qi(()=>{u(r[t],i)},n)}function Ui(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Wi(e){return e.shapeFlag&128?e.ssContent:e}function Gi(e,t,n=Ps,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Ze();let i=Rs(n),a=zn(t,n,e,r);return i(),Qe(),a};return r?i.unshift(a):i.push(a),a}}var Ki=e=>(t,n=Ps)=>{(!Vs||e===`sp`)&&Gi(e,(...e)=>t(...e),n)},qi=Ki(`bm`),Ji=Ki(`m`),Yi=Ki(`bu`),Xi=Ki(`u`),Zi=Ki(`bum`),Qi=Ki(`um`),$i=Ki(`sp`),ea=Ki(`rtg`),ta=Ki(`rtc`);function na(e,t=Ps){Gi(`ec`,e,t)}var ra=`components`,ia=`directives`;function aa(e,t){return la(ra,e,!0,t)||e}var oa=Symbol.for(`v-ndc`);function sa(e){return y(e)?la(ra,e,!1)||e:e||oa}function ca(e){return la(ia,e)}function la(e,t,n=!0,r=!1){let i=sr||Ps;if(i){let n=i.type;if(e===ra){let e=$s(n,!1);if(e&&(e===t||e===A(t)||e===ne(A(t))))return n}let a=ua(i[e]||n[e],t)||ua(i.appContext[e],t);return!a&&r?n:a}}function ua(e,t){return e&&(e[t]||e[A(t)]||e[ne(A(t))])}function da(e,t,n,r){let i,a=n&&n[r],o=p(e);if(o||y(e)){let n=o&&Zt(e),r=!1,s=!1;n&&(r=!$t(e),s=Qt(e),e=ft(e)),i=Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function z(e,t,n,r,i,a){if(n??={},sr.ce||sr.parent&&Ni(sr.parent)&&sr.parent.ce){let e=a!=null&&n.key==null?l({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),B(),V(is,null,[U(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=cs.length;B();let c;try{let i=o&&pa(o(n)),s=n.key||a||i&&i.key;c=V(is,{key:(s&&!b(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=cs.length;e>s;e--)us();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function pa(e){return e.some(e=>!hs(e)||!(e.type===os||e.type===is&&!pa(e.children)))?e:null}function ma(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:M(r)]=e[r];return n}var ha=e=>e?Bs(e)?Qs(e):ha(e.parent):null,ga=l(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ha(e.parent),$root:e=>ha(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ba(e),$forceUpdate:e=>e.f||=()=>{Zn(e.update)},$nextTick:e=>e.n||=Yn.bind(e.proxy),$watch:e=>Tr.bind(e)}),_a=(e,t)=>e!==r&&!e.__isScriptSetup&&f(e,t),va={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(t[0]!==`$`){let e=s[t];if(e!==void 0)switch(e){case 1:return i[t];case 2:return a[t];case 4:return n[t];case 3:return o[t]}else if(_a(i,t))return s[t]=1,i[t];else if(a!==r&&f(a,t))return s[t]=2,a[t];else if(f(o,t))return s[t]=3,o[t];else if(n!==r&&f(n,t))return s[t]=4,n[t];else Fa&&(s[t]=0)}let u=ga[t],d,p;if(u)return t===`$attrs`&&ct(e.attrs,`get`,``),u(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(n!==r&&f(n,t))return s[t]=4,n[t];if(p=l.config.globalProperties,f(p,t))return p[t]},set({_:e},t,n){let{data:i,setupState:a,ctx:o}=e;return _a(a,t)?(a[t]=n,!0):i!==r&&f(i,t)?(i[t]=n,!0):f(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(n[c]||e!==r&&c[0]!==`$`&&f(e,c)||_a(t,c)||f(o,c)||f(i,c)||f(ga,c)||f(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?f(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},ya=l({},va,{get(e,t){if(t!==Symbol.unscopables)return va.get(e,t,e)},has(e,t){return t[0]!==`_`&&!le(t)}});function ba(){return null}function xa(){return null}function Sa(e){}function Ca(e){}function wa(){return null}function Ta(){}function Ea(e,t){return null}function Da(){return ka(`useSlots`).slots}function Oa(){return ka(`useAttrs`).attrs}function ka(e){let t=Fs();return t.setupContext||=Zs(t)}function Aa(e){return p(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function ja(e,t){let n=Aa(e);for(let e in t){if(e.startsWith(`__skip`))continue;let r=n[e];r?p(r)||v(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:r===null&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function Ma(e,t){return!e||!t?e||t:p(e)&&p(t)?e.concat(t):l({},Aa(e),Aa(t))}function Na(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function Pa(e){let t=Fs(),n=Vs,r=e();zs(),n&&Ls(!1);let i=()=>{Rs(t),n&&Ls(!0)},a=()=>{Fs()!==t&&t.scope.off(),zs(),n&&Ls(!1)};return S(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}var Fa=!0;function Ia(e){let t=Ba(e),n=e.proxy,r=e.ctx;Fa=!1,t.beforeCreate&&Ra(t.beforeCreate,e,`bc`);let{data:i,computed:o,methods:s,watch:c,provide:l,inject:u,created:d,beforeMount:f,mounted:m,beforeUpdate:h,updated:g,activated:_,deactivated:y,beforeDestroy:b,beforeUnmount:S,destroyed:C,unmounted:w,render:T,renderTracked:E,renderTriggered:D,errorCaptured:O,serverPrefetch:ee,expose:k,inheritAttrs:A,components:te,directives:j,filters:ne}=t;if(u&&La(u,r,null),s)for(let e in s){let t=s[e];v(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);x(t)&&(e.data=Kt(t))}if(Fa=!0,o)for(let e in o){let t=o[e],i=W({get:v(t)?t.bind(n,n):v(t.get)?t.get.bind(n,n):a,set:!v(t)&&v(t.set)?t.set.bind(n):a});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(c)for(let e in c)za(c[e],r,n,e);if(l){let e=v(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{hr(t,e[t])})}d&&Ra(d,e,`c`);function M(e,t){p(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(M(qi,f),M(Ji,m),M(Yi,h),M(Xi,g),M(zi,_),M(Bi,y),M(na,O),M(ta,E),M(ea,D),M(Zi,S),M(Qi,w),M($i,ee),p(k)){if(k.length){let t=e.exposed||={};k.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}T&&e.render===a&&(e.render=T),A!=null&&(e.inheritAttrs=A),te&&(e.components=te),j&&(e.directives=j),ee&&ri(e)}function La(e,t,n=a){p(e)&&(e=Ga(e));for(let n in e){let r=e[n],i;i=x(r)?`default`in r?gr(r.from||n,r.default,!0):gr(r.from||n):gr(r),on(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Ra(e,t,n){zn(p(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function za(e,t,n,r){let i=r.includes(`.`)?Er(n,r):()=>n[r];if(y(e)){let n=t[e];v(n)&&Cr(i,n)}else if(v(e))Cr(i,e.bind(n));else if(x(e)){if(p(e))e.forEach(e=>za(e,t,n,r));else{let r=v(e.handler)?e.handler.bind(n):t[e.handler];v(r)&&Cr(i,r,e)}}}function Ba(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Va(c,e,o,!0)),Va(c,t,o)),x(t)&&a.set(t,c),c}function Va(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Va(e,a,n,!0),i&&i.forEach(t=>Va(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Ha[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Ha={data:Ua,props:Ja,emits:Ja,methods:qa,computed:qa,beforeCreate:Ka,created:Ka,beforeMount:Ka,mounted:Ka,beforeUpdate:Ka,updated:Ka,beforeDestroy:Ka,beforeUnmount:Ka,destroyed:Ka,unmounted:Ka,activated:Ka,deactivated:Ka,errorCaptured:Ka,serverPrefetch:Ka,components:qa,directives:qa,watch:Ya,provide:Ua,inject:Wa};function Ua(e,t){return t?e?function(){return l(v(e)?e.call(this,this):e,v(t)?t.call(this,this):t)}:t:e}function Wa(e,t){return qa(Ga(e),Ga(t))}function Ga(e){if(p(e)){let t={};for(let n=0;n{let l,u=r,d;return Sr(()=>{let t=e[a];N(l,t)&&(l=t,c())}),{get(){return s(),n.get?n.get(l):l},set(e){let s=n.set?n.set(e):e;if(!N(s,l)&&!(u!==r&&N(e,u)))return;let f=i.vnode.props,p=!!(f&&(t in f||a in f||o in f)&&(`onUpdate:${t}`in f||`onUpdate:${a}`in f||`onUpdate:${o}`in f));p||(l=e,c()),i.emit(`update:${t}`,s),N(e,u)&&(N(e,s)&&!N(s,d)||p&&u!==r&&!N(s,l))&&c(),u=e,d=s}}});return c[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?s||r:c,done:!1}:{done:!0}}}},c}var to=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${A(t)}Modifiers`]||e[`${j(t)}Modifiers`];function no(e,t,...n){if(e.isUnmounted)return;let i=e.vnode.props||r,a=n,o=t.startsWith(`update:`),s=o&&to(i,t.slice(7));s&&(s.trim&&(a=n.map(e=>y(e)?e.trim():e)),s.number&&(a=n.map(ae)));let c,l=i[c=M(t)]||i[c=M(A(t))];!l&&o&&(l=i[c=M(j(t))]),l&&zn(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,zn(u,e,6,a)}}var ro=new WeakMap;function io(e,t,n=!1){let r=n?ro:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!v(e)){let r=e=>{let n=io(e,t,!0);n&&(s=!0,l(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(x(e)&&r.set(e,null),null):(p(a)?a.forEach(e=>o[e]=null):l(o,a),x(e)&&r.set(e,o),o)}function ao(e,t){return!e||!s(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),f(e,t[0].toLowerCase()+t.slice(1))||f(e,j(t))||f(e,t))}function oo(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=lr(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Es(u.call(t,e,d,f,m,p,h)),y=s}else{let e=t;v=Es(e.length>1?e(f,{attrs:s,slots:o,emit:l}):e(f,null)),y=t.props?s:co(s)}}catch(t){cs.length=0,Bn(t,e,1),v=U(os)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(c)&&(y=lo(y,a)),b=Ss(b,y,!1,!0))}return n.dirs&&(b=Ss(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&ei(kr(b.type)&&$r(b)||b,n.transition),v=b,lr(_),v}function so(e,t=!0){let n;for(let t=0;t{let t;for(let n in e)(n===`class`||n===`style`||s(n))&&((t||={})[n]=e[n]);return t},lo=(e,t)=>{let n={};for(let r in e)(!c(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function uo(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?fo(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;tObject.create(ho),_o=e=>Object.getPrototypeOf(e)===ho;function vo(e,t,n,r=!1){let i={},a=go();e.propsDefaults=Object.create(null),bo(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:qt(i):e.type.props?i:a,e.attrs=a}function yo(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=tn(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{d=!0;let[n,r]=Co(e,t,!0);l(c,n),r&&u.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!s&&!d)return x(e)&&a.set(e,i),i;if(p(s))for(let e=0;ee===`_`||e===`_ctx`||e===`$stable`,Eo=e=>p(e)?e.map(Es):[Es(e)],Do=(e,t,n)=>{if(t._n)return t;let r=L((...e)=>Eo(t(...e)),n);return r._c=!1,r},Oo=(e,t,n)=>{let r=e._ctx;for(let n in e){if(To(n))continue;let i=e[n];if(v(i))t[n]=Do(n,i,r);else if(i!=null){let e=Eo(i);t[n]=()=>e}}},ko=(e,t)=>{let n=Eo(t);e.slots.default=()=>n},Ao=(e,t,n)=>{for(let r in t)(n||!To(r))&&(e[r]=t[r])},jo=(e,t,n)=>{let r=e.slots=go();if(e.vnode.shapeFlag&32){let e=t._;e?(Ao(r,t,n),n&&ie(r,`_`,e,!0)):Oo(t,r)}else t&&ko(e,t)},Mo=(e,t,n)=>{let{vnode:i,slots:a}=e,o=!0,s=r;if(i.shapeFlag&32){let e=t._;e?n&&e===1?o=!1:Ao(a,t,n):(o=!t.$stable,Oo(t,a)),s=t}else t&&(ko(e,t),s={default:1});if(o)for(let e in a)!To(e)&&s[e]==null&&delete a[e]},No=ts;function Po(e){return Io(e)}function Fo(e){return Io(e,hi)}function Io(e,t){let n=ce();n.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=a,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!gs(e,t)&&(r=he(e),ue(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case as:y(e,t,n,r);break;case os:b(e,t,n,r);break;case ss:e??x(t,n,r,o);break;case is:te(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?j(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,ve)}u!=null&&i?si(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&si(e.ref,null,a,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),ee(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&D(e.children,d,null,r,i,Lo(e,a),s,u),_&&mr(e,null,r,`created`),E(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!O(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&As(f,r,e)}_&&mr(e,null,r,`beforeMount`);let v=zo(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&No(()=>{try{f&&As(f,r,e),v&&g.enter(d),_&&mr(e,null,r,`mounted`)}finally{}},i)},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let l=c;l{let l=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=e.patchFlag&16;let m=e.props||r,h=t.props||r,g;if(n&&Ro(n,!1),(g=h.onVnodeBeforeUpdate)&&As(g,n,t,e),f&&mr(t,e,n,`beforeUpdate`),n&&Ro(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?k(e.dynamicChildren,d,l,n,i,Lo(t,a),o):s||ae(e,t,l,null,n,i,Lo(t,a),o,!1),u>0){if(u&16)A(l,m,h,n,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=t.dynamicProps;for(let t=0;t{g&&As(g,n,t,e),f&&mr(t,e,n,`updated`)},i)},k=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(t!==n){if(t!==r)for(let r in t)!O(r)&&!(r in n)&&c(e,r,t[r],null,a,i);for(let r in n){if(O(r))continue;let o=n[r],s=t[r];o!==s&&r!==`value`&&c(e,r,s,o,a,i)}`value`in n&&c(e,`value`,t.value,n.value,a)}},te=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),D(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(k(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&Bo(e,t,!0)):ae(e,t,n,f,i,a,s,c,l)},j=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):ne(t,n,r,i,a,o,c):M(e,t,c)},ne=(e,t,n,r,i,a,o)=>{let s=e.component=Ns(e,r,i);if(Ii(e)&&(s.ctx.renderer=ve),Hs(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,N,o),!e.el){let r=s.subTree=U(os);b(null,r,t,n),e.placeholder=r.el}}else N(s,e,t,n,i,a,o)},M=(e,t,n)=>{let r=t.component=e.component;if(uo(e,t,n)){if(r.asyncDep&&!r.asyncResolved){ie(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},N=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Ho(e);if(n){t&&(t.el=c.el,ie(e,t,o)),n.asyncDep.then(()=>{No(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Ro(e,!1),t?(t.el=c.el,ie(e,t,o)):t=c,n&&re(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&As(d,s,t,c),Ro(e,!0);let f=oo(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),he(p),e,i,a),t.el=f.el,u===null&&mo(e,f.el),r&&No(r,i),(d=t.props&&t.props.onVnodeUpdated)&&No(()=>As(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Ni(t);if(Ro(e,!1),l&&re(l),!m&&(o=c&&c.onVnodeBeforeMount)&&As(o,d,t),Ro(e,!0),s&&ye){let t=()=>{e.subTree=oo(e),ye(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=oo(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&No(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;No(()=>As(o,d,e),i)}(t.shapeFlag&256||d&&Ni(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&No(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Pe(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Zn(u),Ro(e,!0),l()},ie=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,yo(e,t.props,r,n),Mo(e,t.children,n),Ze(),er(e),Qe()},ae=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){se(l,d,n,r,i,a,o,s,c);return}if(f&256){oe(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&me(l,i,a),d!==l&&p(n,d)):u&16?m&16?se(l,d,n,r,i,a,o,s,c):me(l,i,a,!0):(u&8&&p(n,``),m&16&&D(d,n,r,i,a,o,s,c))},oe=(e,t,n,r,a,o,s,c,l)=>{e||=i,t||=i;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;pd?me(e,a,o,!0,!1,f):D(t,n,r,a,o,s,c,l,f)},se=(e,t,n,r,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let r=e[u],i=t[u]=l?Ds(t[u]):Es(t[u]);if(gs(r,i))v(r,i,n,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let r=e[f],i=t[p]=l?Ds(t[p]):Es(t[p]);if(gs(r,i))v(r,i,n,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,i=ep)for(;u<=f;)ue(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Ds(t[u]):Es(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u=b){ue(r,a,o,!0);continue}let i;if(r.key!=null)i=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&gs(r,t[_])){i=_;break}i===void 0?ue(r,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(r,t[i],n,null,a,o,s,c,l),y++)}let w=x?Vo(C):i;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,i=t[e],f=t[e+1],p=e+1{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){le(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,ve);return}if(c===is){o(a,t,n);for(let e=0;el.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[Vr];a._isLeaving&&a[Vr](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}}else o(a,t,n)},ue=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Ze(),si(s,null,n,e,!0),Qe()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Ni(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&As(_,t,e),u&6)pe(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&mr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,ve,r):l&&!l.hasOnce&&(a!==is||d>0&&d&64)?me(l,t,n,!1,!0):(a===is&&d&384||!i&&u&16)&&me(c,t,n),r&&de(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&No(()=>{_&&As(_,t,e),h&&mr(e,null,t,`unmounted`),v&&(e.el=null)},n)},de=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===is){fe(n,r);return}if(t===ss){C(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},fe=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},pe=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Uo(c),Uo(l),r&&re(r),i.stop(),a&&(a.flags|=8,ue(o,e,t,n)),s&&No(s,t),No(()=>{e.isUnmounted=!0},t)},me=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return he(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Or];return n?h(n):t},ge=!1,_e=(e,t,n)=>{let r;e==null?t._vnode&&(ue(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ge||=(ge=!0,er(r),tr(),!1)},ve={p:v,um:ue,m:le,r:de,mt:ne,mc:D,pc:ae,pbc:k,n:he,o:e},P,ye;return t&&([P,ye]=t(ve)),{render:_e,hydrate:P,createApp:Qa(_e,P)}}function Lo({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Ro({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function zo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Bo(e,t,n=!1){let r=e.children,i=t.children;if(p(r)&&p(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Ho(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ho(t)}function Uo(e){if(e)for(let t=0;te.__isSuspense,Ko=0,qo={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)Yo(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}Xo(e,t,n,r,i,o,s,c,l)}},hydrate:Qo,normalize:$o};function Jo(e,t){let n=e.props&&e.props[t];v(n)&&n()}function Yo(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=Zo(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(Jo(e,`onPending`),Jo(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),ns(f,e.ssFallback)):f.resolve(!1,!0)}function Xo(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,gs(h,f)?(c(h,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():g&&(_||(c(m,p,n,r,i,null,a,o,s),ns(d,p)))):(d.pendingId=Ko++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():(c(m,p,n,r,i,null,a,o,s),ns(d,p))):m&&gs(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&gs(m,f))c(m,f,n,r,i,d,a,o,s),ns(d,f);else if(Jo(t,`onPending`),d.pendingBranch=f,d.pendingId=f.shapeFlag&512?f.component.suspenseId:Ko++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function Zo(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=rs(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?oe(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:Ko++,timeout:typeof y==`number`?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=!1;if(x.isHydrating)x.isHydrating=!1;else if(!e){g=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;g&&(i.transition.afterLeave=()=>{s===x.pendingId&&(f(o,u,a===b&&!e?m(i):a,0),$n(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!x.isFallbackMountPending&&(h(i.el)===u&&(a=m(i),e=!0),p(i,l,x,!0),!g&&d&&r.ssFallback&&No(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)}x.isFallbackMountPending=!1,ns(x,o),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,S=!1;for(;y;){if(y.pendingBranch){for(let e=0;e{x.isFallbackMountPending=!1,x.isInFallback&&(d(null,e,i,o,r,null,a,s,c),ns(x,e))},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{Bn(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;zs(),e.asyncResolved=!0;let{vnode:s}=e;Ws(e,a,!1),i&&(s.el=i);let c=!i&&e.subTree.el;t(e,s,h(i||e.subTree.el),i?null:m(e.subTree),x,o,n),c&&(s.placeholder=null,g(c)),mo(e,s.el),r&&--x.deps===0&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&p(x.pendingBranch,n,e,t)}};return x}function Qo(e,t,n,r,i,a,o,s,c){let l=t.suspense=Zo(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function $o(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=es(r?n.default:n),e.ssFallback=r?es(n.fallback):U(os)}function es(e){let t;if(v(e)){let n=ds&&e._c;n&&(e._d=!1,B()),e=e(),n&&(e._d=!0,t=ls,us())}return p(e)&&(e=so(e)),e=Es(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function ts(e,t){t&&t.pendingBranch?p(e)?t.effects.push(...e):t.effects.push(e):$n(e)}function ns(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,mo(r,i))}function rs(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var is=Symbol.for(`v-fgt`),as=Symbol.for(`v-txt`),os=Symbol.for(`v-cmt`),ss=Symbol.for(`v-stc`),cs=[],ls=null;function B(e=!1){cs.push(ls=e?null:[])}function us(){cs.pop(),ls=cs[cs.length-1]||null}var ds=1;function fs(e,t=!1){ds+=e,e<0&&ls&&t&&(ls.hasOnce=!0)}function ps(e){return e.dynamicChildren=ds>0?ls||i:null,us(),ds>0&&ls&&ls.push(e),e}function ms(e,t,n,r,i,a){return ps(H(e,t,n,r,i,a,!0))}function V(e,t,n,r,i){return ps(U(e,t,n,r,i,!0))}function hs(e){return e?e.__v_isVNode===!0:!1}function gs(e,t){return e.type===t.type&&e.key===t.key}function _s(e){}var vs=({key:e})=>e??null,ys=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:y(e)||on(e)||v(e)?{i:sr,r:e,k:t,f:!!n}:e);function H(e,t=null,n=null,r=0,i=null,a=e===is?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&vs(t),ref:t&&ys(t),scopeId:cr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:sr};return s?(Os(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=y(n)?8:16),ds>0&&!o&&ls&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&ls.push(c),c}var U=bs;function bs(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===oa)&&(e=os),hs(e)){let r=Ss(e,t,!0);return n&&Os(r,n),ds>0&&!a&&ls&&(r.shapeFlag&6?ls[ls.indexOf(e)]=r:ls.push(r)),r.patchFlag=-2,r}if(ec(e)&&(e=e.__vccOpts),t){t=xs(t);let{class:e,style:n}=t;e&&!y(e)&&(t.class=he(e)),x(n)&&(en(n)&&!p(n)&&(n=l({},n)),t.style=ue(n))}let o=y(e)?1:Go(e)?128:kr(e)?64:x(e)?4:v(e)?2:0;return H(e,t,n,r,i,o,a,!0)}function xs(e){return e?en(e)||_o(e)?l({},e):e:null}function Ss(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?ks(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&vs(l),ref:t&&t.ref?n&&a?p(a)?a.concat(ys(t)):[a,ys(t)]:ys(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==is?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ss(e.ssContent),ssFallback:e.ssFallback&&Ss(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&ei(u,c.clone(u)),u}function Cs(e=` `,t=0){return U(as,null,e,t)}function ws(e,t){let n=U(ss,null,e);return n.staticCount=t,n}function Ts(e=``,t=!1){return t?(B(),V(os,null,e)):U(os,null,e)}function Es(e){return e==null||typeof e==`boolean`?U(os):p(e)?U(is,null,e.slice()):hs(e)?Ds(e):U(as,null,String(e))}function Ds(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ss(e)}function Os(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(p(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Os(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!_o(t)?t._ctx=sr:r===3&&sr&&(sr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(v(t)){if(r&65){Os(e,{default:t});return}t={default:t,_ctx:sr},n=32}else t=String(t),r&64?(n=16,t=[Cs(t)]):n=8;e.children=t,e.shapeFlag|=n}function ks(...e){let t={};for(let n=0;nPs||sr,Is,Ls;{let e=ce(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Is=t(`__VUE_INSTANCE_SETTERS__`,e=>Ps=e),Ls=t(`__VUE_SSR_SETTERS__`,e=>Vs=e)}var Rs=e=>{let t=Ps;return Is(e),e.scope.on(),()=>{e.scope.off(),Is(t)}},zs=()=>{Ps&&Ps.scope.off(),Is(null)};function Bs(e){return e.vnode.shapeFlag&4}var Vs=!1;function Hs(e,t=!1,n=!1){t&&Ls(t);let{props:r,children:i}=e.vnode,a=Bs(e);vo(e,r,a,t),jo(e,i,n||t);let o=a?Us(e,t):void 0;return t&&Ls(!1),o}function Us(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,va);let{setup:r}=n;if(r){Ze();let n=e.setupContext=r.length>1?Zs(e):null,i=Rs(e),a=Rn(r,e,0,[e.props,n]),o=S(a);if(Qe(),i(),(o||e.sp)&&!Ni(e)&&ri(e),o){if(a.then(zs,zs),t)return a.then(n=>{Ls(!0);try{Ws(e,n,t)}finally{Ls(!1)}}).catch(t=>{Bn(t,e,0)});e.asyncDep=a}else Ws(e,a,t)}else Ys(e,t)}function Ws(e,t,n){v(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:x(t)&&(e.setupState=pn(t)),Ys(e,n)}var Gs,Ks;function qs(e){Gs=e,Ks=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,ya))}}var Js=()=>!Gs;function Ys(e,t,n){let r=e.type;if(!e.render){if(!t&&Gs&&!r.render){let t=r.template||Ba(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r,s=l(l({isCustomElement:n,delimiters:a},i),o);r.render=Gs(t,s)}}e.render=r.render||a,Ks&&Ks(e)}{let t=Rs(e);Ze();try{Ia(e)}finally{Qe(),t()}}}var Xs={get(e,t){return ct(e,`get`,``),e[t]}};function Zs(e){return{attrs:new Proxy(e.attrs,Xs),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Qs(e){return e.exposed?e.exposeProxy||=new Proxy(pn(nn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ga)return ga[n](e)},has(e,t){return t in e||t in ga}}):e.proxy}function $s(e,t=!0){return v(e)?e.displayName||e.name:e.name||t&&e.__name}function ec(e){return v(e)&&`__vccOpts`in e}var W=(e,t)=>Sn(e,t,Vs);function tc(e,t,n){try{fs(-1);let r=arguments.length;return r===2?x(t)&&!p(t)?hs(t)?U(e,null,[t]):U(e,t):U(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&hs(n)&&(n=[n]),U(e,t,n))}finally{fs(1)}}function nc(){}function rc(e,t,n,r){let i=n[r];if(i&&ic(i,e))return i;let a=t();return a.memo=e.slice(),a.cacheIndex=r,n[r]=a}function ic(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&ls&&ls.push(e),!0}var ac=`3.5.41`,oc=a,sc=Ln,cc=ir,lc=or,uc={createComponentInstance:Ns,setupComponent:Hs,renderComponentRoot:oo,setCurrentRenderingInstance:lr,isVNode:hs,normalizeVNode:Es,getComponentPublicInstance:Qs,ensureValidVNode:pa,pushWarningContext:Nn,popWarningContext:Pn},dc=void 0,fc=typeof window<`u`&&window.trustedTypes;if(fc)try{dc=fc.createPolicy(`vue`,{createHTML:e=>e})}catch{}var pc=dc?e=>dc.createHTML(e):e=>e,mc=`http://www.w3.org/2000/svg`,hc=`http://www.w3.org/1998/Math/MathML`,gc=typeof document<`u`?document:null,_c=gc&&gc.createElement(`template`),vc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?gc.createElementNS(mc,e):t===`mathml`?gc.createElementNS(hc,e):n?gc.createElement(e,{is:n}):gc.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>gc.createTextNode(e),createComment:e=>gc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>gc.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{_c.innerHTML=pc(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=_c.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},yc=`transition`,bc=`animation`,xc=Symbol(`_vtc`),Sc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Cc=l({},Gr,Sc),wc=(e=>(e.displayName=`Transition`,e.props=Cc,e))((e,{slots:t})=>tc(Yr,Dc(e),t)),Tc=(e,t=[])=>{p(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ec=e=>e?p(e)?e.some(e=>e.length>1):e.length>1:!1;function Dc(e){let t={};for(let n in e)n in Sc||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:u=o,appearToClass:d=s,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=Oc(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=t,E=(e,t,n,r)=>{e._enterCancelled=r,jc(e,t?d:s),jc(e,t?u:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,jc(e,f),jc(e,m),jc(e,p),t&&t()},O=e=>(t,n)=>{let i=e?w:y,o=()=>E(t,e,n);Tc(i,[t,o]),Mc(()=>{jc(t,e?c:a),Ac(t,e?d:s),Ec(i)||Pc(t,r,g,o)})};return l(t,{onBeforeEnter(e){Tc(v,[e]),Ac(e,a),Ac(e,o)},onBeforeAppear(e){Tc(C,[e]),Ac(e,c),Ac(e,u)},onEnter:O(!1),onAppear:O(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);Ac(e,f),e._enterCancelled?(Ac(e,p),Rc(e)):(Rc(e),Ac(e,p)),Mc(()=>{e._isLeaving&&(jc(e,f),Ac(e,m),Ec(x)||Pc(e,r,_,n))}),Tc(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),Tc(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),Tc(T,[e])},onLeaveCancelled(e){D(e),Tc(S,[e])}})}function Oc(e){if(e==null)return null;if(x(e))return[kc(e.enter),kc(e.leave)];{let t=kc(e);return[t,t]}}function kc(e){return oe(e)}function Ac(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[xc]||(e[xc]=new Set)).add(t)}function jc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[xc];n&&(n.delete(t),n.size||(e[xc]=void 0))}function Mc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Nc=0;function Pc(e,t,n,r){let i=e._endId=++Nc,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Fc(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u(n[e]||``).split(`, `),i=r(`${yc}Delay`),a=r(`${yc}Duration`),o=Ic(i,a),s=r(`${bc}Delay`),c=r(`${bc}Duration`),l=Ic(s,c),u=null,d=0,f=0;t===yc?o>0&&(u=yc,d=o,f=a.length):t===bc?l>0&&(u=bc,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?yc:bc:null,f=u?u===yc?a.length:c.length:0);let p=u===yc&&/\b(?:transform|all)(?:,|$)/.test(r(`${yc}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Ic(e,t){for(;e.lengthLc(t)+Lc(e[n])))}function Lc(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Rc(e){return(e?e.ownerDocument:document).body.offsetHeight}function zc(e,t,n){let r=e[xc];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Bc=Symbol(`_vod`),Vc=Symbol(`_vsh`),Hc={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Bc]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Uc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Uc(e,!0),r.enter(e)):r.leave(e,()=>{Uc(e,!1)}):Uc(e,t))},beforeUnmount(e,{value:t}){Uc(e,t)}};function Uc(e,t){e.style.display=t?e[Bc]:`none`,e[Vc]=!t}function Wc(){Hc.getSSRProps=({value:e})=>{if(!e)return{style:{display:`none`}}}}var Gc=Symbol(``);function Kc(e){let t=Fs();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Jc(e,n))},r=()=>{let r=e(t.proxy);t.ce?Jc(t.ce,r):qc(t.subTree,r),n(r)};Yi(()=>{$n(r)}),Ji(()=>{Cr(r,a,{flush:`post`});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),Qi(()=>e.disconnect())})}function qc(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{qc(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Jc(e.el,t);else if(e.type===is)e.children.forEach(e=>qc(e,t));else if(e.type===ss){let{el:n,anchor:r}=e;for(;n&&(Jc(n,t),n!==r);)n=n.nextSibling}}function Jc(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t){let i=Ee(t[e]);n.setProperty(`--${e}`,i),r+=`--${e}: ${i};`}n[Gc]=r}}var Yc=/(?:^|;)\s*display\s*:/;function Xc(e,t,n){let r=e.style,i=y(n),a=!1;if(n&&!i){if(t){if(y(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Qc(r,t,``)}else for(let e in t)n[e]??Qc(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Qc(r,i,``):nl(e,i,!y(t)&&t?t[i]:void 0,o)||Qc(r,i,o)}}else if(i){if(t!==n){let e=r[Gc];e&&(n+=`;`+e),r.cssText=n,a=Yc.test(n)}}else t&&e.removeAttribute(`style`);Bc in e&&(e[Bc]=a?r.display:``,e[Vc]&&(r.display=`none`))}var Zc=/\s*!important$/;function Qc(e,t,n){if(p(n))n.forEach(n=>Qc(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=tl(e,t);Zc.test(n)?e.setProperty(j(r),n.replace(Zc,``),`important`):e[r]=n}}var $c=[`Webkit`,`Moz`,`ms`],el={};function tl(e,t){let n=el[t];if(n)return n;let r=A(t);if(r!==`filter`&&r in e)return el[t]=r;r=ne(r);for(let n=0;n<$c.length;n++){let i=$c[n]+r;if(i in e)return el[t]=i}return t}function nl(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&y(r)&&n===r}var rl=`http://www.w3.org/1999/xlink`;function il(e,t,n,r,i,a=ve(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(rl,t.slice(6,t.length)):e.setAttributeNS(rl,t,n):n==null||a&&!P(n)?e.removeAttribute(t):e.setAttribute(t,a?``:b(n)?String(n):n)}function al(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?pc(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=P(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function ol(e,t,n,r){e.addEventListener(t,n,r)}function sl(e,t,n,r){e.removeEventListener(t,n,r)}var cl=Symbol(`_vei`);function ll(e,t,n,r,i=null){let a=e[cl]||(e[cl]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=fl(t);r?ol(e,n,a[t]=gl(r,i),s):o&&(sl(e,n,o,s),a[t]=void 0)}}var ul=/(Once|Passive|Capture)$/,dl=/^on:?(?:Once|Passive|Capture)$/;function fl(e){let t,n;for(;(n=e.match(ul))&&!dl.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):j(e.slice(2)),t]}var pl=0,ml=Promise.resolve(),hl=()=>pl||=(ml.then(()=>pl=0),Date.now());function gl(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(p(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;ne.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,vl=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?zc(e,r,o):t===`style`?Xc(e,n,r):s(t)?c(t)||ll(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):yl(e,t,r,o))?(al(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&il(e,t,r,o,a,t!==`value`)):e._isVueCE&&(bl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!y(r)))?al(e,A(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),il(e,t,r,o))};function yl(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&_l(t)&&v(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return _l(t)&&y(n)?!1:t in e}function bl(e,t){let n=e._def.props;if(!n)return!1;let r=A(t);return Array.isArray(n)?n.some(e=>A(e)===r):Object.keys(n).some(e=>A(e)===r)}var xl={};function Sl(e,t,n){let r=R(e,t);E(r)&&(r=l({},r,t));class i extends Tl{constructor(e){super(r,e,n)}}return i.def=r,i}var Cl=((e,t)=>Sl(e,t,gu)),wl=typeof HTMLElement<`u`?HTMLElement:class{},Tl=class e extends wl{constructor(e,t={},n=hu){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==hu?this._root=this.shadowRoot:e.shadowRoot===!1?this._root=this:(this.attachShadow(l({},e.shadowRootOptions,{mode:`open`})),this._root=this.shadowRoot)}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t&&=t.assignedSlot||t.parentNode||t.host;)if(t instanceof e){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{if(this._pendingResolve=void 0,this.isConnected)return this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,Yn(()=>{this._connected||(this._ob&&=(this._ob.disconnect(),null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&=(this._teleportTargets.clear(),void 0))})}_processMutations(e){for(let t of e)this._setAttr(t.attributeName)}_resolveDef(){if(this._pendingResolve)return this._pendingResolve;for(let e=0;e{this._resolved=!0,this._pendingResolve=void 0;let{props:n,styles:r}=e,i;if(n&&!p(n))for(let e in n){let t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=oe(this._props[e])),(i||=Object.create(null))[A(e)]=!0)}this._numberProps=i,this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;if(t)return this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}),this._pendingResolve;e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)f(this,e)||Object.defineProperty(this,e,{get:()=>I(t[e])})}_resolveProps(e){let{props:t}=e,n=p(t)?t:Object.keys(t||{});for(let e of Object.keys(this))e[0]!==`_`&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(A))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!this._patching)}})}_setAttr(e){if(e.startsWith(`data-v-`))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):xl,r=A(e);t&&this._numberProps&&this._numberProps[r]&&(n=oe(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(this._dirty=!0,t===xl?delete this._props[e]:(this._props[e]=t,e===`key`&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&(this._processMutations(n.takeRecords()),n.disconnect()),t===!0?this.setAttribute(j(e),``):typeof t==`string`||typeof t==`number`?this.setAttribute(j(e),t+``):t||this.removeAttribute(j(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),pu(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=U(this._def,l(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,E(t[0])?l({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),j(e)!==e&&t(j(e),n)},this._setParent()}),t}_applyStyles(e,t,n){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let r=this._nonce,i=this.shadowRoot,a=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i),o=null;for(let s=e.length-1;s>=0;s--){let c=document.createElement(`style`);r&&c.setAttribute(`nonce`,r),c.textContent=e[s],i.insertBefore(c,o||a),o=c,s===0&&(n||this._styleAnchors.set(this._def,c),t&&this._styleAnchors.set(t,c))}}_getStyleAnchor(e){if(!e)return null;let t=this._styleAnchors.get(e);return t&&t.parentNode===this.shadowRoot?t:(t&&this._styleAnchors.delete(e),null)}_getRootStyleInsertionAnchor(e){for(let t=0;t(delete e.props.mode,e))({name:`TransitionGroup`,props:l({},Cc,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Fs(),r=Ur(),i,a;return Xi(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!Rl(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(Pl),i.forEach(Fl);let r=i.filter(Il);Rc(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;Ac(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[jl]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[jl]=null,jc(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=tn(e),s=Dc(o),c=o.tag||is;if(i=[],a)for(let e=0;e{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Fc(r);return a.removeChild(r),o}var zl=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return p(t)?e=>re(t,e):t};function Bl(e){e.target.composing=!0}function Vl(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var Hl=Symbol(`_assign`),Ul=Symbol(`_initialValue`);function Wl(e,t,n){return t&&(e=e.trim()),n&&(e=ae(e)),e}var Gl={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[Ul]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[Ul]=e.defaultValue.replace(/\r\n?/g,` -`))),e[Hl]=zl(i);let a=r||i.props&&i.props.type===`number`;ol(e,t?`change`:`input`,t=>{t.target.composing||e[Hl](Wl(e.value,n,a))}),(n||a)&&ol(e,`change`,()=>{e.value=Wl(e.value,n,a)}),t||(ol(e,`compositionstart`,Bl),ol(e,`compositionend`,Vl),ol(e,`change`,Vl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Ul];delete e[Ul],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Hl](Wl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Hl]=zl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ae(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Kl={deep:!0,created(e,t,n){e[Hl]=zl(n),ol(e,`change`,()=>{let t=e._modelValue,n=Zl(e),r=e.checked,i=e[Hl];if(p(t)){let e=xe(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Ql(e,r))})},mounted:ql,beforeUpdate(e,t,n){e[Hl]=zl(n),ql(e,t,n)}};function ql(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=xe(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=be(t,Ql(e,!0))}e.checked!==i&&(e.checked=i)}var Jl={created(e,{value:t},n){e.checked=be(t,n.props.value),e[Hl]=zl(n),ol(e,`change`,()=>{e[Hl](Zl(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Hl]=zl(r),t!==n&&(e.checked=be(t,r.props.value))}},Yl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ol(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ae(Zl(e)):Zl(e));e[Hl](e.multiple?h(e._modelValue)?new Set(t):t:t[0]),e._assigning=!0,Yn(()=>{e._assigning=!1})}),e[Hl]=zl(r)},mounted(e,{value:t}){Xl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Hl]=zl(n)},updated(e,{value:t}){e._assigning||Xl(e,t)}};function Xl(e,t){let n=e.multiple,r=p(t);if(!(n&&!r&&!h(t))){for(let i=0,a=e.options.length;iString(e)===String(o)):xe(t,o)>-1}else a.selected=t.has(o)}else if(be(Zl(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Zl(e){return`_value`in e?e._value:e.value}function Ql(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var $l={created(e,t,n){tu(e,t,n,null,`created`)},mounted(e,t,n){tu(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){tu(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){tu(e,t,n,r,`updated`)}};function eu(e,t){switch(e){case`SELECT`:return Yl;case`TEXTAREA`:return Gl;default:switch(t){case`checkbox`:return Kl;case`radio`:return Jl;default:return Gl}}}function tu(e,t,n,r,i){let a=eu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function nu(){Gl.getSSRProps=({value:e})=>({value:e}),Jl.getSSRProps=({value:e},t)=>{if(t.props&&be(t.props.value,e))return{checked:!0}},Kl.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&xe(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},$l.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=eu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var ru=[`ctrl`,`shift`,`alt`,`meta`],iu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>ru.some(n=>e[`${n}Key`]&&!t.includes(n))},au=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=j(n.key);if(t.some(e=>e===r||ou[e]===r))return e(n)}))},cu=l({patchProp:vl},vc),lu,uu=!1;function du(){return lu||=Po(cu)}function fu(){return lu=uu?lu:Fo(cu),uu=!0,lu}var pu=((...e)=>{du().render(...e)}),mu=((...e)=>{fu().hydrate(...e)}),hu=((...e)=>{let t=du().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=vu(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,_u(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),gu=((...e)=>{let t=fu().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=vu(e);if(t)return n(t,!0,_u(t))},t});function _u(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function vu(e){return y(e)?document.querySelector(e):e}var yu=!1,bu=()=>{yu||(yu=!0,nu(),Wc())},xu=t({BaseTransition:()=>Yr,BaseTransitionPropsValidators:()=>Gr,Comment:()=>os,DeprecationTypes:()=>null,EffectScope:()=>Oe,ErrorCodes:()=>In,ErrorTypeStrings:()=>sc,Fragment:()=>is,KeepAlive:()=>Li,ReactiveEffect:()=>Pe,Static:()=>ss,Suspense:()=>qo,Teleport:()=>Rr,Text:()=>as,TrackOpTypes:()=>Cn,Transition:()=>wc,TransitionGroup:()=>Nl,TriggerOpTypes:()=>wn,VueElement:()=>Tl,assertNumber:()=>Fn,callWithAsyncErrorHandling:()=>zn,callWithErrorHandling:()=>Rn,camelize:()=>A,capitalize:()=>ne,cloneVNode:()=>Ss,compatUtils:()=>null,compile:()=>Su,computed:()=>W,createApp:()=>hu,createBlock:()=>V,createCommentVNode:()=>Ts,createElementBlock:()=>ms,createElementVNode:()=>H,createHydrationRenderer:()=>Fo,createPropsRestProxy:()=>Na,createRenderer:()=>Po,createSSRApp:()=>gu,createSlots:()=>fa,createStaticVNode:()=>ws,createTextVNode:()=>Cs,createVNode:()=>U,customRef:()=>hn,defineAsyncComponent:()=>Pi,defineComponent:()=>R,defineCustomElement:()=>Sl,defineEmits:()=>xa,defineExpose:()=>Sa,defineModel:()=>Ta,defineOptions:()=>Ca,defineProps:()=>ba,defineSSRCustomElement:()=>Cl,defineSlots:()=>wa,devtools:()=>cc,effect:()=>qe,effectScope:()=>ke,getCurrentInstance:()=>Fs,getCurrentScope:()=>Ae,getCurrentWatcher:()=>On,getTransitionRawChildren:()=>ti,guardReactiveProps:()=>xs,h:()=>tc,handleError:()=>Bn,hasInjectionContext:()=>_r,hydrate:()=>mu,hydrateOnIdle:()=>Di,hydrateOnInteraction:()=>ji,hydrateOnMediaQuery:()=>Ai,hydrateOnVisible:()=>ki,initCustomFormatter:()=>nc,initDirectivesForSSR:()=>bu,inject:()=>gr,isMemoSame:()=>ic,isProxy:()=>en,isReactive:()=>Zt,isReadonly:()=>Qt,isRef:()=>on,isRuntimeOnly:()=>Js,isShallow:()=>$t,isVNode:()=>hs,markRaw:()=>nn,mergeDefaults:()=>ja,mergeModels:()=>Ma,mergeProps:()=>ks,nextTick:()=>Yn,nodeOps:()=>vc,normalizeClass:()=>he,normalizeProps:()=>ge,normalizeStyle:()=>ue,onActivated:()=>zi,onBeforeMount:()=>qi,onBeforeUnmount:()=>Zi,onBeforeUpdate:()=>Yi,onDeactivated:()=>Bi,onErrorCaptured:()=>na,onMounted:()=>Ji,onRenderTracked:()=>ta,onRenderTriggered:()=>ea,onScopeDispose:()=>je,onServerPrefetch:()=>$i,onUnmounted:()=>Qi,onUpdated:()=>Xi,onWatcherCleanup:()=>kn,openBlock:()=>B,patchProp:()=>vl,popScopeId:()=>dr,provide:()=>hr,proxyRefs:()=>pn,pushScopeId:()=>ur,queuePostFlushCb:()=>$n,reactive:()=>Kt,readonly:()=>Jt,ref:()=>F,registerRuntimeCompiler:()=>qs,render:()=>pu,renderList:()=>da,renderSlot:()=>z,resolveComponent:()=>aa,resolveDirective:()=>ca,resolveDynamicComponent:()=>sa,resolveFilter:()=>null,resolveTransitionHooks:()=>Zr,setBlockTracking:()=>fs,setDevtoolsHook:()=>lc,setTransitionHooks:()=>ei,shallowReactive:()=>qt,shallowReadonly:()=>Yt,shallowRef:()=>sn,ssrContextKey:()=>vr,ssrUtils:()=>uc,stop:()=>Je,toDisplayString:()=>Ce,toHandlerKey:()=>M,toHandlers:()=>ma,toRaw:()=>tn,toRef:()=>yn,toRefs:()=>gn,toValue:()=>dn,transformVNodeArgs:()=>_s,triggerRef:()=>un,unref:()=>I,useAttrs:()=>Oa,useCssModule:()=>Ol,useCssVars:()=>Kc,useHost:()=>El,useId:()=>ni,useModel:()=>eo,useSSRContext:()=>yr,useShadowRoot:()=>Dl,useSlots:()=>Da,useTemplateRef:()=>ii,useTransitionState:()=>Ur,vModelCheckbox:()=>Kl,vModelDynamic:()=>$l,vModelRadio:()=>Jl,vModelSelect:()=>Yl,vModelText:()=>Gl,vShow:()=>Hc,version:()=>ac,warn:()=>oc,watch:()=>Cr,watchEffect:()=>br,watchPostEffect:()=>xr,watchSyncEffect:()=>Sr,withAsyncContext:()=>Pa,withCtx:()=>L,withDefaults:()=>Ea,withDirectives:()=>pr,withKeys:()=>su,withMemo:()=>rc,withModifiers:()=>au,withScopeId:()=>fr}),Su=()=>{};function Cu(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e==`boolean`?`${e}`:e===0?`0`:e,Eu=wu,Du=(e,t)=>n=>{if(t?.variants==null)return Eu(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Tu(t)||Tu(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Eu(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Ou(e){return typeof e==`string`?`'${e}'`:new ku().serialize(e)}var ku=function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?e.localeCompare(t):n===`number`&&r===`number`?e-t:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}return this.serializeObjectEntries(r,Object.entries(e))}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t?.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;ethis.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e}();function Au(e,t){return e===t||Ou(e)===Ou(t)}function ju(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function Mu(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function Nu(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(Number.isNaN(t)?0:t))%r,a=Mu(Math.abs(i)*2>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return Number.isNaN(t)?!Number.isNaN(n)&&a>n&&(a=Math.floor(Mu(n/r,r))*r):an&&(a=t+Math.floor(Mu((n-t)/r,r))*r),a=Mu(a,r),a}function Pu(e,t){let n=typeof e==`string`&&!t?`${e}Context`:t,r=Symbol(n);return[t=>{let n=gr(r,t);if(n||n===null)return n;throw Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(`, `)}`:`\`${e}\``}`)},e=>(hr(r,e),e)]}function Fu(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Iu(e,t,n){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function Lu(e){return e==null}function Ru(e,t){return Lu(e)?!1:Array.isArray(e)?e.some(e=>Au(e,t)):Au(e,t)}function zu(e,t){return Ae()?(je(e,t),!0):!1}function Bu(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return zu(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}function Vu(e){let t=!1,n,r=ke(!0);return((...i)=>(t||=(n=r.run(()=>e(...i)),!0),n))}var Hu=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Uu=e=>e!==void 0,Wu=Object.prototype.toString,Gu=e=>Wu.call(e)===`[object Object]`,Ku=qu();function qu(){var e,t;return Hu&&!!((e=window)!=null&&(e=e.navigator)!=null&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)==null||(t=t.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Ju(e){return Array.isArray(e)?e:[e]}function Yu(e){return e||Fs()}function Xu(e){if(!Hu)return e;let t=0,n,r,i=()=>{--t,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return((...a)=>(t+=1,r||(r=ke(!0),n=r.run(()=>e(...a))),zu(i),n))}function Zu(e){return Kt(on(e)?new Proxy({},{get(t,n,r){return I(Reflect.get(e.value,n,r))},set(t,n,r){return on(e.value[n])&&!on(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):e)}function Qu(e){return Zu(W(e))}function $u(e,...t){let n=t.flat(),r=n[0];return Qu(()=>Object.fromEntries(typeof r==`function`?Object.entries(gn(e)).filter(([e,t])=>!r(dn(t),e)):Object.entries(gn(e)).filter(e=>!n.includes(e[0]))))}function ed(e,t=1e4){return hn((n,r)=>{let i=dn(e),a,o=()=>setTimeout(()=>{i=dn(e),r()},dn(t));return zu(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function td(e,t){Yu(t)&&Zi(e,t)}function nd(e,t,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=sn(!1),o;function s(){o&&=(clearTimeout(o),void 0)}function c(){a.value=!1,s()}function l(...n){i&&e(),s(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=void 0,e(...n)},dn(t))}return r&&(a.value=!0,Hu&&l()),zu(c),{isPending:Yt(a),start:l,stop:c}}function rd(e,t,n){return Cr(e,t,{...n,immediate:!0})}var id=Hu?window:void 0;Hu&&window.document,Hu&&window.navigator,Hu&&window.location;function ad(e){let t=dn(e);return t?.$el??t}function od(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=W(()=>{let t=Ju(dn(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return rd(()=>[n.value?.map(e=>ad(e))??[id].filter(e=>e!=null),Ju(dn(n.value?e[1]:e[0])),Ju(I(n.value?e[2]:e[1])),dn(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=Gu(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function sd(){let e=sn(!1),t=Fs();return t&&Ji(()=>{e.value=!0},t),e}function cd(e){let t=sd();return W(()=>(t.value,!!e()))}function ld(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function ud(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=id,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=ld(t);return od(i,a,e=>{e.repeat&&dn(s)||c(e)&&n(e)},o)}function dd(e){return JSON.parse(JSON.stringify(e))}function fd(e,t,n={}){let{window:r=id,...i}=n,a,o=cd(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=Cr(W(()=>{let t=dn(e);return Array.isArray(t)?t.map(e=>ad(e)):[ad(t)]}),e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return zu(l),{isSupported:o,stop:l}}function pd(e,t,n,r={}){var i,a;let{clone:o=!1,passive:s=!1,eventName:c,deep:l=!1,defaultValue:u,shouldEmit:d}=r,f=Fs(),p=n||f?.emit||(f==null||(i=f.$emit)==null?void 0:i.bind(f))||(f==null||(a=f.proxy)==null||(a=a.$emit)==null?void 0:a.bind(f?.proxy)),m=c;t||=`modelValue`,m||=`update:${t.toString()}`;let h=e=>o?typeof o==`function`?o(e):dd(e):e,g=()=>Uu(e[t])?h(e[t]):u,_=e=>{d?d(e)&&p(m,e):p(m,e)};if(s){let n=F(g()),r=!1;return Cr(()=>e[t],e=>{r||(r=!0,n.value=h(e),Yn(()=>r=!1))}),Cr(n,n=>{!r&&(n!==e[t]||l)&&_(n)},{deep:l}),n}return W({get(){return g()},set(e){_(e)}})}function md(e){return e?e.flatMap(e=>e.type===is?md(e.children):[e]):[]}var[hd,gd]=Pu(`ConfigProvider`),_d=Kt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});function vd(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function yd(e,t,n=`.`,r){if(!vd(t))return yd(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:vd(a)&&vd(i[t])?yd(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function bd(e){return(...t)=>t.reduce((t,n)=>yd(t,n,``,e),{})}var xd=bd(),Sd=Xu(()=>{let e=F(new Map),t=F(),n=W(()=>{for(let t of e.value.values())if(t)return!0;return!1}),r=hd({scrollBody:F(!0)}),i=null,a=()=>{document.body.style.paddingRight=``,document.body.style.marginRight=``,_d.layersWithOutsidePointerEventsDisabled.size===0&&(document.body.style.pointerEvents=``),document.documentElement.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=t.value??``,Ku&&i?.(),t.value=void 0};return Cr(n,(e,o)=>{if(!Hu)return;if(!e){o&&a();return}t.value===void 0&&(t.value=document.body.style.overflow);let s=window.innerWidth-document.documentElement.clientWidth,c={padding:s,margin:0},l=r.scrollBody?.value?typeof r.scrollBody.value==`object`?xd({padding:r.scrollBody.value.padding===!0?s:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?s:r.scrollBody.value.margin},c):c:{padding:0,margin:0};s>0&&(document.body.style.paddingRight=typeof l.padding==`number`?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin==`number`?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty(`--scrollbar-width`,`${s}px`),document.body.style.overflow=`hidden`),Ku&&(i=od(document,`touchmove`,e=>Td(e),{passive:!1})),Yn(()=>{n.value&&(document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`)})},{immediate:!0,flush:`sync`}),e});function Cd(e){let t=Math.random().toString(36).substring(2,7),n=Sd();n.value.set(t,e??!1);let r=W({get:()=>n.value.get(t)??!1,set:e=>n.value.set(t,e)});return td(()=>{n.value.delete(t)}),r}function wd(e){let t=window.getComputedStyle(e);if(t.overflowX===`scroll`||t.overflowY===`scroll`||t.overflowX===`auto`&&e.clientWidth1||(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}var Ed=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}]/u,Dd=/android/i;function Od(){return typeof navigator<`u`&&Dd.test(navigator.userAgent)}function kd(e){let t=F(!1),n=F(!0),r=F(!1),i=W(()=>t.value&&n.value);function a(){t.value=!0,n.value=!0,r.value=!1}function o(e){e.data&&(Ed.test(e.data)?(n.value=!0,r.value=!0):Od()&&!r.value&&(n.value=!1))}function s(n){Yn(()=>{t.value=!1,e?.(n)})}return{isComposing:t,shouldDeferInput:i,handleCompositionStart:a,handleCompositionUpdate:o,handleCompositionEnd:s}}function Ad(e){let t=hd({dir:F(`ltr`)});return W(()=>e?.value||t.dir?.value||`ltr`)}function jd(e){let t=Fs(),n=t?.type.emits,r={};return n?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(t=>{r[M(A(t))]=(...n)=>e(t,...n)}),r}var Md=0;function Nd(){br(e=>{if(!Hu)return;let t=document.querySelectorAll(`[data-reka-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??Pd()),document.body.insertAdjacentElement(`beforeend`,t[1]??Pd()),Md++,e(()=>{Md===1&&document.querySelectorAll(`[data-reka-focus-guard]`).forEach(e=>e.remove()),Md--})})}function Pd(){let e=document.createElement(`span`);return e.setAttribute(`data-reka-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function Fd(e){return W(()=>!dn(e)||!!ad(e)?.closest(`form`))}function Id(){let e=Fs(),t=F(),n=W(()=>r());Xi(()=>{n.value!==r()&&un(t)});function r(){return t.value&&`$el`in t.value&&[`#text`,`#comment`].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:ad(t)}let i=Object.assign({},e.exposed),a={};for(let t in e.props)Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:()=>e.props[t]});if(Object.keys(i).length>0)for(let e in i)Object.defineProperty(a,e,{enumerable:!0,configurable:!0,get:()=>i[e]});Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=a;function o(n){if(t.value=n,n&&(Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),!(n instanceof Element)&&!Object.hasOwn(n,`$el`))){let t=n.$.exposed,r=Object.assign({},a);for(let e in t)Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>t[e]});e.exposed=r}}return{forwardRef:o,currentRef:t,currentElement:n}}function Ld(e){let t=Fs(),n=Object.keys(t?.type.props??{}).reduce((e,n)=>{let r=(t?.type.props[n]).default;return r!==void 0&&(e[n]=r),e},{}),r=yn(e);return W(()=>{let e={},i=t?.vnode.props??{};return Object.keys(i).forEach(t=>{e[A(t)]=i[t]}),Object.keys({...n,...e}).reduce((e,t)=>(r.value[t]!==void 0&&(e[t]=r.value[t]),e),{})})}function Rd(e,t){let n=Ld(e),r=t?jd(t):{};return W(()=>({...n.value,...r}))}function zd(){let e=Fs()?.vnode?.scopeId;return e?{[e]:``}:{}}function Bd(e,t){let n=ed(!1,300);zu(()=>{n.value=!1});let r=F(null),i=Bu();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=Hd(a,Vd(a,i.getBoundingClientRect()),1),s=Ud(t.getBoundingClientRect()),c=Gd([...o,...s]);r.value=c,n.value=!0}return br(n=>{if(e.value&&t.value){let r=e=>o(e,t.value),i=t=>o(t,e.value);e.value.addEventListener(`pointerleave`,r),t.value.addEventListener(`pointerleave`,i),n(()=>{e.value?.removeEventListener(`pointerleave`,r),t.value?.removeEventListener(`pointerleave`,i)})}}),br(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!Wd(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())};e.value?.ownerDocument.addEventListener(`pointermove`,o),n(()=>e.value?.ownerDocument.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function Vd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Hd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function Ud(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Wd(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Gd(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y)),Kd(t)}function Kd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t.at(-1),n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n.at(-1),t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var qd=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Jd=new WeakMap,Yd=new WeakMap,Xd={},Zd=0,Qd=function(e){return e&&(e.host||Qd(e.parentNode))},$d=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Qd(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ef=function(e,t,n,r){var i=$d(t,Array.isArray(e)?e:[e]);Xd[n]||(Xd[n]=new WeakMap);var a=Xd[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Jd.get(e)||0)+1,l=(a.get(e)||0)+1;Jd.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Yd.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Zd++,function(){o.forEach(function(e){var t=Jd.get(e)-1,i=a.get(e)-1;Jd.set(e,t),a.set(e,i),t||(Yd.has(e)||e.removeAttribute(r),Yd.delete(e)),i||e.removeAttribute(n)}),Zd--,Zd||(Jd=new WeakMap,Jd=new WeakMap,Yd=new WeakMap,Xd={})}},tf=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||qd(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ef(r,i,n,`aria-hidden`)):function(){return null}};function nf(e){let t;Cr(()=>ad(e),e=>{let n=!1;try{n=!!e?.closest(`[popover]:not(:popover-open)`)}catch{}e&&!n?t=tf(e):t&&t()}),Qi(()=>{t&&t()})}var rf=0;function af(e,t=`reka`){if(e)return e;let n,r=hd({useId:void 0});return n=r.useId?r.useId():`useId`in xu?ni?.():`${++rf}`,t?`${t}-${n}`:n}function of(){return{ALT:`Alt`,ARROW_DOWN:`ArrowDown`,ARROW_LEFT:`ArrowLeft`,ARROW_RIGHT:`ArrowRight`,ARROW_UP:`ArrowUp`,BACKSPACE:`Backspace`,CAPS_LOCK:`CapsLock`,CONTROL:`Control`,DELETE:`Delete`,END:`End`,ENTER:`Enter`,ESCAPE:`Escape`,F1:`F1`,F10:`F10`,F11:`F11`,F12:`F12`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,HOME:`Home`,META:`Meta`,PAGE_DOWN:`PageDown`,PAGE_UP:`PageUp`,SHIFT:`Shift`,SPACE:` `,TAB:`Tab`,CTRL:`Control`,ASTERISK:`*`,SPACE_CODE:`Space`}}function sf(e){let t=hd({locale:F(`en`)});return W(()=>e?.value||t.locale?.value||`en`)}function cf(e){let t=F(),n=W(()=>t.value?.width??0),r=W(()=>t.value?.height??0),i;return Ji(()=>{let n=ad(e);n?(t.value={width:n.offsetWidth,height:n.offsetHeight},i=new ResizeObserver(e=>{if(!Array.isArray(e)||!e.length)return;let r=e[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=n.offsetWidth,a=n.offsetHeight;t.value={width:i,height:a}}),i.observe(n,{box:`border-box`})):t.value=void 0}),Qi(()=>{i?.disconnect(),i=void 0}),{width:n,height:r}}function lf(e,t){let n=F(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}function uf(e){let t=ed(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=Fu(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=ff(n.map(e=>e.textValue),t.value,i?.textValue),o=n.find(e=>e.textValue===a);return o&&o.ref.focus(),o?.ref}},resetTypeahead:()=>{t.value=``}}}function df(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ff(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=df(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function pf(e,t){let n=F({}),r=F(`none`),i=F(e),a=e.value?`mounted`:`unmounted`,o,s=t.value?.ownerDocument.defaultView??id,{state:c,dispatch:l}=lf(a,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),u=e=>{if(Hu){let n=new CustomEvent(e,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(n)}};Cr(e,async(e,i)=>{let a=i!==e;if(await Yn(),a){let a=r.value,o=mf(t.value);e?(l(`MOUNT`),u(`enter`),o===`none`&&u(`after-enter`)):o===`none`||o===`undefined`||n.value?.display===`none`?(l(`UNMOUNT`),u(`leave`),u(`after-leave`)):i&&a!==o?(l(`ANIMATION_OUT`),u(`leave`)):(l(`UNMOUNT`),u(`after-leave`))}},{immediate:!0});let d=e=>{if(e.target!==t.value)return;let n=mf(t.value),r=n.includes(CSS.escape(e.animationName)),a=c.value===`mounted`?`enter`:`leave`;if(r&&(u(`after-${a}`),l(`ANIMATION_END`),!i.value)){let e=t.value.style.animationFillMode;t.value.style.animationFillMode=`forwards`,o=s?.setTimeout(()=>{t.value?.style.animationFillMode===`forwards`&&(t.value.style.animationFillMode=e)})}n===`none`&&l(`ANIMATION_END`)},f=e=>{e.target===t.value&&(r.value=mf(t.value))},p=Cr(t,(e,t)=>{e?(n.value=getComputedStyle(e),e.addEventListener(`animationstart`,f),e.addEventListener(`animationcancel`,d),e.addEventListener(`animationend`,d)):(l(`ANIMATION_END`),o!==void 0&&s?.clearTimeout(o),t?.removeEventListener(`animationstart`,f),t?.removeEventListener(`animationcancel`,d),t?.removeEventListener(`animationend`,d))},{immediate:!0}),m=Cr(c,()=>{let e=mf(t.value);r.value=c.value===`mounted`?e:`none`});return Qi(()=>{p(),m(),t.value&&(t.value.removeEventListener(`animationstart`,f),t.value.removeEventListener(`animationcancel`,d),t.value.removeEventListener(`animationend`,d)),o!==void 0&&s?.clearTimeout(o)}),{isPresent:W(()=>[`mounted`,`unmountSuspended`].includes(c.value))}}function mf(e){return e&&getComputedStyle(e).animationName||`none`}var hf=R({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){let{present:r,forceMount:i}=gn(e),a=F(),{isPresent:o}=pf(r,a);n({present:o});let s=t.default({present:o.value});s=md(s||[]);let c=Fs();if(s&&s?.length>1){let e=c?.parent?.type.name?`<${c.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${e}\` for \`Presence\` component.`,``,"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",`You can apply a few solutions:`,["Provide a single child element so that `presence` directive attach correctly.",`Ensure the first child is an actual element instead of a raw text node or comment node.`].map(e=>` - ${e}`).join(` -`)].join(` -`))}return()=>i.value||r.value||o.value?tc(t.default({present:o.value})[0],{ref:e=>{let t=ad(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),gf=R({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=md(n.default()),r=e.findIndex(e=>e.type!==os);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?ks(t,i.props):t,o=Ss({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),_f=[`area`,`img`,`input`],vf=R({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&_f.includes(r)?()=>tc(r,t):r===`template`?()=>tc(gf,t,{default:n.default}):()=>tc(e.as,t,{default:n.default})}});function yf(){let e=F();return{primitiveElement:e,currentElement:W(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:ad(e))}}var bf=`dismissableLayer.pointerDownOutside`,xf=`dismissableLayer.focusOutside`;function Sf(e,t){if(!(t instanceof Element))return!1;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r){});return br(o=>{if(!Hu||!dn(n))return;let s=async n=>{let o=n.target;if(!(!t?.value||!o)){if(Sf(t.value,o)){i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){Iu(bf,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{dn(n)&&(i.value=!0)}}}function wf(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=F(!1);return br(a=>{if(!Hu||!dn(n))return;let o=async n=>{if(!t?.value)return;await Yn(),await Yn();let r=n.target;!t.value||!r||Sf(t.value,r)||n.target&&!i.value&&Iu(xf,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{dn(n)&&(i.value=!0)},onBlurCapture:()=>{dn(n)&&(i.value=!1)}}}var Tf=R({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Id(),o=W(()=>a.value?.ownerDocument??globalThis.document),s=W(()=>_d.layersRoot),c=W(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=W(()=>_d.layersWithOutsidePointerEventsDisabled.size>0),u=W(()=>{let e=Array.from(s.value),[t]=[..._d.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Cf(async e=>{let t=[..._d.branches].some(t=>t?.contains(e.target));!n.present||!u.value||t||(r(`pointerDownOutside`,e),r(`interactOutside`,e),await Yn(),e.defaultPrevented||r(`dismiss`))},a),f=wf(e=>{let t=[..._d.branches].some(t=>t?.contains(e.target));!n.present||t||(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ud(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),Cr([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{!e||!n||t&&(_d.layersWithOutsidePointerEventsDisabled.size===0&&(_d.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),_d.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{_d.layersWithOutsidePointerEventsDisabled.delete(e),_d.layersWithOutsidePointerEventsDisabled.size===0&&!Lu(_d.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=_d.originalBodyPointerEvents)}))},{immediate:!0}),Cr([a,()=>n.present],([e,t],n,r)=>{!e||!t||(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),br(e=>{e(()=>{a.value&&(s.value.delete(a.value),_d.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(B(),V(I(vf),{ref:I(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:ue({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:I(f).onFocusCapture,onBlurCapture:I(f).onBlurCapture,onPointerdownCapture:I(d).onPointerDownCapture},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),Ef=Vu(()=>F([]));function Df(){let e=Ef();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=Of(e.value,t),e.value.unshift(t)},remove(t){e.value=Of(e.value,t),e.value[0]?.resume()}}}function Of(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var kf=`focusScope.autoFocusOnMount`,Af=`focusScope.autoFocusOnUnmount`,jf={bubbles:!1,cancelable:!0};function Mf(e,{select:t=!1}={}){let n=Fu();for(let r of e)if(Rf(r,{select:t}),Fu()!==n)return!0}function Nf(e){let t=Pf(e);return[Ff(t,e),Ff(t.reverse(),e)]}function Pf(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ff(e,t){for(let n of e)if(!If(n,{upTo:t}))return n}function If(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Lf(e){return e instanceof HTMLInputElement&&`select`in e}function Rf(e,{select:t=!1}={}){if(e&&e.focus){let n=Fu();e.focus({preventScroll:!0}),e!==n&&Lf(e)&&t&&e.select()}}var zf=R({__name:`FocusScope`,props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},present:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`mountAutoFocus`,`unmountAutoFocus`],setup(e,{emit:t}){let n=e,r=t,{currentRef:i,currentElement:a}=Id(),o=F(null),s=Df(),c=Kt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});br(e=>{if(!Hu)return;let t=a.value;if(!n.trapped)return;function r(e){if(c.paused||!t)return;let n=e.target;t.contains(n)?o.value=n:Rf(o.value,{select:!0})}function i(e){if(c.paused||!t)return;let n=e.relatedTarget;n!==null&&(t.contains(n)||Rf(o.value,{select:!0}))}function s(e){let n=o.value;n!==null&&e.some(e=>e.removedNodes.length>0)&&(t.contains(n)||Rf(t))}document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,i);let l=new MutationObserver(s);t&&l.observe(t,{childList:!0,subtree:!0}),e(()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,i),l.disconnect()})});function l(e,t){let n=new CustomEvent(kf,jf),i=e=>r(`mountAutoFocus`,e);e.addEventListener(kf,i),e.dispatchEvent(n),e.removeEventListener(kf,i),n.defaultPrevented||(Mf(Pf(e),{select:!0}),Fu()===t&&Rf(e))}br(async e=>{let t=a.value;if(await Yn(),!t)return;n.present!==!1&&s.add(c);let i=Fu();!t.contains(i)&&n.present!==!1&&l(t,i),e(()=>{let e=new CustomEvent(Af,jf),n=e=>{r(`unmountAutoFocus`,e)};t.addEventListener(Af,n),t.dispatchEvent(e),t.setAttribute(`data-focus-scope-unmounting`,``),setTimeout(()=>{e.defaultPrevented||Rf(i??document.body,{select:!0}),t.removeEventListener(Af,n),s.remove(c),t.removeAttribute(`data-focus-scope-unmounting`)},0)})}),Cr(()=>n.present,async(e,t)=>{if(!Hu)return;if(e===!1&&t===!0){s.remove(c);return}if(e!==!0||t!==!1)return;s.add(c),await Yn();let n=a.value;if(!n)return;let r=Fu();n.contains(r)||l(n,r)});function u(e){if(!n.loop&&!n.trapped||c.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=Fu();if(t&&r){let t=e.currentTarget,[i,a]=Nf(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n.loop&&Rf(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n.loop&&Rf(a,{select:!0})):r===t&&e.preventDefault()}}return(e,t)=>(B(),V(I(vf),{ref_key:`currentRef`,ref:i,tabindex:`-1`,"as-child":e.asChild,as:e.as,onKeydown:u},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),Bf=[`Enter`,` `],Vf=[`ArrowDown`,`PageUp`,`Home`],Hf=[`ArrowUp`,`PageDown`,`End`];[...Vf,...Hf],[...Bf],[...Bf];function Uf(e){let t=Fu();for(let n of e)if(n===t||(n.focus(),Fu()!==t))return}var Wf=R({__name:`Teleport`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e,n=hd({}),r=W(()=>t.to??n.teleportTo?.value??`body`),i=sd();return(e,t)=>I(i)||e.forceMount?(B(),V(Rr,{key:0,to:r.value,disabled:e.disabled,defer:e.defer},[z(e.$slots,`default`)],8,[`to`,`disabled`,`defer`])):Ts(`v-if`,!0)}}),Gf=`data-reka-collection-item`;function Kf(e={}){let{key:t=``,isProvider:n=!1}=e,r=`${t}CollectionProvider`,i;n?(i={collectionRef:F(),itemMap:F(new Map)},hr(r,i)):i=gr(r);let a=(e=!1)=>{let t=i.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${Gf}]`)),r=new Map(n.map((e,t)=>[e,t])),a=Array.from(i.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?a:a.filter(e=>e.ref.dataset.disabled!==``)},o=R({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=yf();return Cr(a,()=>{i.collectionRef.value=a.value}),()=>tc(gf,{ref:r,...n},t)}}),s=R({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=yf();return br(t=>{if(a.value){let n=nn(a.value);i.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>i.itemMap.value.delete(n))}}),()=>tc(gf,{...n,[Gf]:``,ref:r},t)}});return{getItems:a,reactiveItems:W(()=>Array.from(i.itemMap.value.values())),itemMapSize:W(()=>i.itemMap.value.size),CollectionSlot:o,CollectionItem:s}}var qf=R({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(B(),V(I(vf),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`focusable`||e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),Jf=R({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=yf();return Cr(W(()=>t.checked??t.value),(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`).set;if(a&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});a.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(B(),V(qf,ks({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),Yf=R({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,n=W(()=>typeof t.value==`object`&&Array.isArray(t.value)&&t.value.length===0&&t.required),r=W(()=>typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value==`object`&&Array.isArray(t.value)?t.value.flatMap((e,n)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`${t.name}[${n}][${e}]`,value:r})):{name:`${t.name}[${n}]`,value:e}):t.value!==null&&typeof t.value==`object`&&!Array.isArray(t.value)?Object.entries(t.value).map(([e,n])=>({name:`${t.name}[${e}]`,value:n})):[]);return(e,i)=>(B(),ms(is,null,[Ts(` We render single input if it's required `),n.value?(B(),V(Jf,ks({key:e.name},{...t,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(B(!0),ms(is,{key:1},da(r.value,n=>(B(),V(Jf,ks({key:n.name},{ref_for:!0},{...t,...e.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`]))),128))],2112))}}),Xf={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Zf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Qf(e,t,n){let r=Zf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Xf[r]}function $f(e,t=!1){let n=Fu();for(let r of e)if(r===n||(r.focus({preventScroll:t}),Fu()!==n))return}function ep(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[tp,np]=Pu(`PopperRoot`),rp=R({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=F();return np({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>z(e.$slots,`default`)}}),ip=R({__name:`PopperAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n,currentElement:r}=Id(),i=tp();return xr(()=>{i.onAnchorChange(t.reference??r.value)}),(e,t)=>(B(),V(I(vf),{ref:I(n),as:e.as,"as-child":e.asChild},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}});function ap(e){return e!==null}function op(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=sp(n),u={start:e.dir===`rtl`?`100%`:`0%`,center:`50%`,end:e.dir===`rtl`?`0%`:`100%`}[l],d={start:`0%`,center:`50%`,end:`100%`}[l],f=(i.arrow?.x??0)+o/2,p=(i.arrow?.y??0)+s/2,m=``,h=``;return c===`bottom`?(m=a?u:`${f}px`,h=`${-s}px`):c===`top`?(m=a?u:`${f}px`,h=`${r.floating.height+s}px`):c===`right`?(m=`${-s}px`,h=a?d:`${p}px`):c===`left`&&(m=`${r.floating.width+s}px`,h=a?d:`${p}px`),{data:{x:m,y:h}}}}}function sp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var cp=[`top`,`right`,`bottom`,`left`],lp=Math.min,up=Math.max,dp=Math.round,fp=Math.floor,pp=e=>({x:e,y:e}),mp={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function hp(e,t,n){return up(e,lp(t,n))}function gp(e,t){return typeof e==`function`?e(t):e}function _p(e){return e.split(`-`)[0]}function vp(e){return e.split(`-`)[1]}function yp(e){return e===`x`?`y`:`x`}function bp(e){return e===`y`?`height`:`width`}function xp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Sp(e){return yp(xp(e))}function Cp(e,t,n){n===void 0&&(n=!1);let r=vp(e),i=Sp(e),a=bp(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Mp(o)),[o,Mp(o)]}function wp(e){let t=Mp(e);return[Tp(e),t,Tp(t)]}function Tp(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ep=[`left`,`right`],Dp=[`right`,`left`],Op=[`top`,`bottom`],kp=[`bottom`,`top`];function Ap(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Dp:Ep:t?Ep:Dp;case`left`:case`right`:return t?Op:kp;default:return[]}}function jp(e,t,n,r){let i=vp(e),a=Ap(_p(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Tp)))),a}function Mp(e){let t=_p(e);return mp[t]+e.slice(t.length)}function Np(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pp(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Np(e)}function Fp(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ip(e,t,n){let{reference:r,floating:i}=e,a=xp(t),o=Sp(t),s=bp(o),c=_p(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(vp(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function Lp(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=gp(t,e),p=Pp(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Fp(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Fp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Rp=50,zp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Lp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ip(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=gp(e,t)||{};if(l==null)return{};let d=Pp(u),f={x:n,y:r},p=Sp(i),m=bp(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=lp(d[_],T),D=lp(d[v],T),O=E,ee=C-h[m]-D,k=C/2-h[m]/2+w,A=hp(O,k,ee),te=!c.arrow&&vp(i)!=null&&k!==A&&a.reference[m]/2-(ke<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===xp(t)||T.every(e=>xp(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=xp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Hp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Up(e){return cp.some(t=>e[t]>=0)}var Wp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=gp(e,t);switch(i){case`referenceHidden`:{let e=Hp(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Up(e)}}}case`escaped`:{let e=Hp(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Up(e)}}}default:return{}}}}},Gp=new Set([`left`,`top`]);async function Kp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=_p(n),s=vp(n),c=xp(n)===`y`,l=Gp.has(o)?-1:1,u=a&&c?-1:1,d=gp(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var qp=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Kp(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Jp=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=gp(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=xp(_p(i)),p=yp(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=hp(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=hp(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Yp=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=gp(e,t),u={x:n,y:r},d=xp(i),f=yp(d),p=u[f],m=u[d],h=gp(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Gp.has(_p(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},Xp=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=gp(e,t),u=await o.detectOverflow(t,l),d=_p(i),f=vp(i),p=xp(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=lp(h-u[g],v),x=lp(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=up(u.left,0),t=up(u.right,0),n=up(u.top,0),r=up(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:up(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:up(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Zp(){return typeof window<`u`}function Qp(e){return tm(e)?(e.nodeName||``).toLowerCase():`#document`}function $p(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function em(e){return((tm(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function tm(e){return Zp()?e instanceof Node||e instanceof $p(e).Node:!1}function nm(e){return Zp()?e instanceof Element||e instanceof $p(e).Element:!1}function rm(e){return Zp()?e instanceof HTMLElement||e instanceof $p(e).HTMLElement:!1}function im(e){return!Zp()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof $p(e).ShadowRoot}function am(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=gm(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function om(e){return/^(table|td|th)$/.test(Qp(e))}function sm(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var cm=/transform|translate|scale|rotate|perspective|filter/,lm=/paint|layout|strict|content/,um=e=>!!e&&e!==`none`,dm;function fm(e){let t=nm(e)?gm(e):e;return um(t.transform)||um(t.translate)||um(t.scale)||um(t.rotate)||um(t.perspective)||!mm()&&(um(t.backdropFilter)||um(t.filter))||cm.test(t.willChange||``)||lm.test(t.contain||``)}function pm(e){let t=vm(e);for(;rm(t)&&!hm(t);){if(fm(t))return t;if(sm(t))return null;t=vm(t)}return null}function mm(){return dm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),dm}function hm(e){return/^(html|body|#document)$/.test(Qp(e))}function gm(e){return $p(e).getComputedStyle(e)}function _m(e){return nm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vm(e){if(Qp(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||im(e)&&e.host||em(e);return im(t)?t.host:t}function ym(e){let t=vm(e);return hm(t)?e.ownerDocument?e.ownerDocument.body:e.body:rm(t)&&am(t)?t:ym(t)}function bm(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ym(e),i=r===e.ownerDocument?.body,a=$p(r);if(i){let e=xm(a);return t.concat(a,a.visualViewport||[],am(r)?r:[],e&&n?bm(e):[])}return t.concat(r,bm(r,[],n))}function xm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sm(e){let t=gm(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=rm(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=dp(n)!==a||dp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Cm(e){return nm(e)?e:e.contextElement}function wm(e){let t=Cm(e);if(!rm(t))return pp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Sm(t),o=(a?dp(n.width):n.width)/r,s=(a?dp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Tm=pp(0);function Em(e){let t=$p(e);return!mm()||!t.visualViewport?Tm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dm(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==$p(e)?!1:t}function Om(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Cm(e),o=pp(1);t&&(r?nm(r)&&(o=wm(r)):o=wm(e));let s=Dm(a,n,r)?Em(a):pp(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=$p(a),t=r&&nm(r)?$p(r):r,n=e,i=xm(n);for(;i&&r&&t!==n;){let e=wm(i),t=i.getBoundingClientRect(),r=gm(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=$p(i),i=xm(n)}}return Fp({width:u,height:d,x:c,y:l})}function km(e,t){let n=_m(e).scrollLeft;return t?t.left+n:Om(em(e)).left+n}function Am(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-km(e,n),y:n.top+t.scrollTop}}function jm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=em(r),s=t?sm(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=pp(1),u=pp(0),d=rm(r);if((d||!d&&!a)&&((Qp(r)!==`body`||am(o))&&(c=_m(r)),d)){let e=Om(r);l=wm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Am(o,c):pp(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Mm(e){return Array.from(e.getClientRects())}function Nm(e){let t=em(e),n=_m(e),r=e.ownerDocument.body,i=up(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=up(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+km(e),s=-n.scrollTop;return gm(r).direction===`rtl`&&(o+=up(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Pm=25;function Fm(e,t){let n=$p(e),r=em(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=mm();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=km(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Pm&&(a-=o)}else l<=Pm&&(a+=l);return{width:a,height:o,x:s,y:c}}function Im(e,t){let n=Om(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=rm(e)?wm(e):pp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Lm(e,t,n){let r;if(t===`viewport`)r=Fm(e,n);else if(t===`document`)r=Nm(em(e));else if(nm(t))r=Im(t,n);else{let n=Em(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Fp(r)}function Rm(e,t){let n=vm(e);return n===t||!nm(n)||hm(n)?!1:gm(n).position===`fixed`||Rm(n,t)}function zm(e,t){let n=t.get(e);if(n)return n;let r=bm(e,[],!1).filter(e=>nm(e)&&Qp(e)!==`body`),i=null,a=gm(e).position===`fixed`,o=a?vm(e):e;for(;nm(o)&&!hm(o);){let t=gm(o),n=fm(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||am(o)&&!n&&Rm(e,o))?r=r.filter(e=>e!==o):i=t,o=vm(o)}return t.set(e,r),r}function Bm(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?sm(t)?[]:zm(t,this._c):[].concat(n),r],o=Lm(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{o(!1,1e-7)},1e3)}n===1&&!Ym(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Zm(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Cm(e),u=i||a?[...l?bm(l):[],...t?bm(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Xm(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Om(e):null;c&&g();function g(){let t=Om(e);h&&!Ym(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Qm=qp,$m=Jp,eh=Vp,th=Xp,nh=Wp,rh=Bp,ih=Yp,ah=(e,t,n)=>{let r=new Map,i={platform:Jm,...n},a={...i.platform,_c:r};return zp(e,t,{...i,platform:a})};function oh(e){return typeof e==`object`&&!!e&&`$el`in e}function sh(e){if(oh(e)){let t=e.$el;return tm(t)&&Qp(t)===`#comment`?null:t}return e}function ch(e){return typeof e==`function`?e():I(e)}function lh(e){return{name:`arrow`,options:e,fn(t){let n=sh(ch(e.element));return n==null?{}:rh({element:n,padding:e.padding}).fn(t)}}}function uh(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dh(e,t){let n=uh(e);return Math.round(t*n)/n}function fh(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=W(()=>ch(n.open)??!0),a=W(()=>ch(n.middleware)),o=W(()=>ch(n.placement)??`bottom`),s=W(()=>ch(n.strategy)??`absolute`),c=W(()=>ch(n.transform)??!0),l=W(()=>sh(e.value)),u=W(()=>sh(t.value)),d=F(0),f=F(0),p=F(s.value),m=F(o.value),h=sn({}),g=F(!1),_=W(()=>{let e={position:p.value,left:`0`,top:`0`};if(!u.value)return e;let t=dh(u.value,d.value),n=dh(u.value,f.value);return c.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...uh(u.value)>=1.5&&{willChange:`transform`}}:{position:p.value,left:t+`px`,top:n+`px`}}),v;function y(){if(l.value==null||u.value==null)return;let e=i.value;ah(l.value,u.value,{middleware:a.value,placement:o.value,strategy:s.value}).then(t=>{d.value=t.x,f.value=t.y,p.value=t.strategy,m.value=t.placement,h.value=t.middlewareData,g.value=e!==!1})}function b(){typeof v==`function`&&(v(),v=void 0)}function x(){if(b(),r===void 0){y();return}if(l.value!=null&&u.value!=null){v=r(l.value,u.value,y);return}}function S(){i.value||(g.value=!1)}return Cr([a,o,s,i],y,{flush:`sync`}),Cr([l,u],x,{flush:`sync`}),Cr(i,S,{flush:`sync`}),Ae()&&je(b),{x:Yt(d),y:Yt(f),strategy:Yt(p),placement:Yt(m),middlewareData:Yt(h),isPositioned:Yt(g),floatingStyles:_,update:y}}var ph=[`dir`],mh={side:`bottom`,sideOffset:0,sideFlip:!0,align:`center`,alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,positionStrategy:`fixed`,updatePositionStrategy:`optimized`,prioritizePosition:!1},[hh,gh]=Pu(`PopperContent`),_h=R({inheritAttrs:!1,__name:`PopperContent`,props:ja({memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...mh}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=tp(),{forwardRef:a,currentElement:o}=Id(),s=Ad(W(()=>n.dir)),c=F(),l=F(),{width:u,height:d}=cf(l),f=W(()=>n.side+(n.align===`center`?``:`-${n.align}`)),p=W(()=>typeof n.collisionPadding==`number`?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),m=W(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=W(()=>({padding:p.value,boundary:m.value.filter(ap),altBoundary:m.value.length>0})),g=W(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),_=W(()=>[Qm({mainAxis:n.sideOffset+d.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&eh({...h.value,...g.value}),n.avoidCollisions&&$m({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?ih():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&eh({...h.value,...g.value}),th({...h.value,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--reka-popper-available-width`,`${n}px`),o.setProperty(`--reka-popper-available-height`,`${r}px`),o.setProperty(`--reka-popper-anchor-width`,`${i}px`),o.setProperty(`--reka-popper-anchor-height`,`${a}px`)}}),l.value&&lh({element:l.value,padding:n.arrowPadding}),op({arrowWidth:u.value,arrowHeight:d.value,dir:s.value}),n.hideWhenDetached&&nh({strategy:`referenceHidden`,...h.value})]),{floatingStyles:v,placement:y,isPositioned:b,middlewareData:x,update:S}=fh(W(()=>n.reference??i.anchor.value),c,{strategy:n.positionStrategy,placement:f,whileElementsMounted:(...e)=>Zm(...e,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy===`always`}),middleware:_}),C=W(()=>sp(y.value)[0]),w=W(()=>sp(y.value)[1]);xr(()=>{b.value&&r(`placed`)});let T=W(()=>{let e=x.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&e}),E=F(``);return br(()=>{o.value&&(E.value=window.getComputedStyle(o.value).zIndex)}),gh({placedSide:C,onArrowChange:e=>l.value=e,arrowX:W(()=>x.value.arrow?.x??0),arrowY:W(()=>x.value.arrow?.y??0),shouldHideArrow:T}),(e,t)=>(B(),ms(`div`,{ref_key:`floatingRef`,ref:c,"data-reka-popper-content-wrapper":``,dir:I(s),style:ue({...I(v),transform:I(b)?I(v).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:E.value,"--reka-popper-transform-origin":[I(x).transformOrigin?.x,I(x).transformOrigin?.y].join(` `),...I(x).hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[n.memoDependencies?rc([n.asChild,n.as,C.value,w.value,I(b),...Object.values(e.$attrs),...n.memoDependencies],()=>(B(),V(I(vf),ks({key:0,ref:I(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,style:{animation:I(b)?void 0:`none`}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])),t,0):(B(),V(I(vf),ks({key:1,ref:I(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,dir:I(s),style:{animation:I(b)?void 0:`none`}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`dir`,`style`]))],12,ph))}});function vh(e){let t=hd({nonce:F()});return W(()=>e?.value||t.nonce?.value)}var[yh,bh]=Pu(`RovingFocusGroup`),xh=R({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=yh(),r=af(),i=W(()=>t.tabStopId||r),a=W(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:s}=Kf();Ji(()=>{t.focusable&&n.onFocusableItemAdd()}),Qi(()=>{t.focusable&&n.onFocusableItemRemove()}),Cr(()=>t.focusable,(e,t)=>{e!==t&&(e?n.onFocusableItemAdd():n.onFocusableItemRemove())});function c(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=Qf(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...o().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?ep(i,t+1):i.slice(t+1)}Yn(()=>$f(i))}}return(e,t)=>(B(),V(I(s),null,{default:L(()=>[U(I(vf),{tabindex:a.value?0:-1,"data-orientation":I(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?I(n).onItemFocus(i.value):t.preventDefault()},onFocus:t[1]||=e=>I(n).onItemFocus(i.value),onKeydown:c},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[Sh,Ch]=Pu(`CheckboxGroupRoot`);function wh(e){return e===`indeterminate`}function Th(e){return wh(e)?`indeterminate`:e?`checked`:`unchecked`}var[Eh,Dh]=Pu(`CheckboxRoot`),Oh=R({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Id(),o=Sh(null),s=pd(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),c=W(()=>o?.disabled.value||n.disabled),l=W(()=>Au(s.value,n.trueValue)),u=W(()=>Lu(o?.modelValue.value)?s.value===`indeterminate`?`indeterminate`:l.value:Ru(o.modelValue.value,n.value));function d(){if(Lu(o?.modelValue.value))s.value===`indeterminate`?s.value=n.trueValue:s.value=l.value?n.falseValue:n.trueValue;else{let e=[...o.modelValue.value||[]];if(Ru(e,n.value)){let t=e.findIndex(e=>Au(e,n.value));e.splice(t,1)}else e.push(n.value);o.modelValue.value=e}}let f=Fd(a),p=zd(),m=Oa(),h=W(()=>{if(!m[`aria-label`])return n.id&&a.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0});return Dh({disabled:c,state:u}),(e,t)=>(B(),ms(is,null,[(B(),V(sa(I(o)?.rovingFocus.value?I(xh):I(vf)),ks({...e.$attrs,...I(p)},{id:e.id,ref:I(i),role:`checkbox`,"as-child":e.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":I(wh)(u.value)?`mixed`:u.value,"aria-required":e.required,"aria-label":e.$attrs[`aria-label`]||h.value,"data-state":I(Th)(u.value),"data-disabled":c.value?``:void 0,disabled:c.value,focusable:I(o)?.rovingFocus.value?!c.value:void 0,onKeydown:su(au(()=>{},[`prevent`]),[`enter`]),onClick:d}),{default:L(()=>[z(e.$slots,`default`,{modelValue:I(s),state:u.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),I(f)&&e.name&&!I(o)?(B(),V(I(Yf),ks({key:0,type:`checkbox`,checked:!!u.value,name:e.name,value:e.value,disabled:c.value,required:e.required},I(p)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):Ts(`v-if`,!0)],64))}}),kh=R({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=Id(),n=Eh();return(e,r)=>(B(),V(I(hf),{present:e.forceMount||I(wh)(I(n).state.value)||I(n).state.value===!0},{default:L(()=>[U(I(vf),ks({ref:I(t),"data-state":I(Th)(I(n).state.value),"data-disabled":I(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}});function Ah(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function jh(e,t,n){return ju(100/(n-t)*(e-t),0,100)}function Mh(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function Nh(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function Ph(e,t,n){let r=e/2;return(r-Lh([0,50],[0,r])(t)*n)*n}function Fh(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Ih(e,t){if(t>0){let n=Fh(e);return Math.min(...n)>=t}return!0}function Lh(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Rh(e){return(String(e).split(`.`)[1]||``).length}function zh(e,t){let n=10**t;return Math.round(e*n)/n}var Bh=[`PageUp`,`PageDown`],Vh=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Hh={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageUp`,`ArrowUp`,`ArrowLeft`]},[Uh,Wh]=Pu([`SliderVertical`,`SliderHorizontal`]),Gh=R({__name:`SliderHorizontal`,props:{dir:{type:String,required:!1},min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:[`slideEnd`,`slideStart`,`slideMove`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,{max:i,min:a,dir:o,inverted:s}=gn(n),{forwardRef:c,currentElement:l}=Id(),u=qh(),d=F(),f=F(),p=W(()=>o?.value!==`rtl`&&!s.value||o?.value!==`ltr`&&s.value);function m(e,t){let n=f.value||l.value.getBoundingClientRect(),r=[...u.thumbElements.value][u.valueIndexToChangeRef.value],o=u.thumbAlignment.value===`contain`?r.clientWidth:0;!d.value&&!t&&u.thumbAlignment.value===`contain`&&(d.value=e.clientX-r.getBoundingClientRect().left);let s=Lh([0,n.width-o],p.value?[a.value,i.value]:[i.value,a.value]);return f.value=n,s(t?e.clientX-n.left-o/2:e.clientX-n.left-(d.value??0))}return Wh({startEdge:W(()=>p.value?`left`:`right`),endEdge:W(()=>p.value?`right`:`left`),direction:W(()=>p.value?1:-1),size:`width`}),(e,t)=>(B(),V(Xh,{ref:I(c),dir:I(o),"data-orientation":`horizontal`,style:ue({"--reka-slider-thumb-transform":!p.value&&I(u).thumbAlignment.value===`overflow`?`translateX(50%)`:`translateX(-50%)`}),onSlideStart:t[0]||=e=>{let t=m(e,!0);r(`slideStart`,t)},onSlideMove:t[1]||=e=>{let t=m(e);r(`slideMove`,t)},onSlideEnd:t[2]||=()=>{f.value=void 0,d.value=void 0,r(`slideEnd`)},onStepKeyDown:t[3]||=e=>{let t=p.value?`from-left`:`from-right`,n=I(Hh)[t].includes(e.key);r(`stepKeyDown`,e,n?-1:1)},onEndKeyDown:t[4]||=e=>r(`endKeyDown`,e),onHomeKeyDown:t[5]||=e=>r(`homeKeyDown`,e)},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`dir`,`style`]))}}),Kh=R({__name:`SliderVertical`,props:{min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:[`slideEnd`,`slideStart`,`slideMove`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,{max:i,min:a,inverted:o}=gn(n),s=qh(),{forwardRef:c,currentElement:l}=Id(),u=F(),d=F(),f=W(()=>!o.value);function p(e,t){let n=d.value||l.value.getBoundingClientRect(),r=[...s.thumbElements.value][s.valueIndexToChangeRef.value],o=s.thumbAlignment.value===`contain`?r.clientHeight:0;!u.value&&!t&&s.thumbAlignment.value===`contain`&&(u.value=e.clientY-r.getBoundingClientRect().top);let c=Lh([0,n.height-o],f.value?[i.value,a.value]:[a.value,i.value]),p=t?e.clientY-n.top-o/2:e.clientY-n.top-(u.value??0);return d.value=n,c(p)}return Wh({startEdge:W(()=>f.value?`bottom`:`top`),endEdge:W(()=>f.value?`top`:`bottom`),direction:W(()=>f.value?1:-1),size:`height`}),(e,t)=>(B(),V(Xh,{ref:I(c),"data-orientation":`vertical`,style:ue({"--reka-slider-thumb-transform":!f.value&&I(s).thumbAlignment.value===`overflow`?`translateY(-50%)`:`translateY(50%)`}),onSlideStart:t[0]||=e=>{let t=p(e,!0);r(`slideStart`,t)},onSlideMove:t[1]||=e=>{let t=p(e);r(`slideMove`,t)},onSlideEnd:t[2]||=()=>{d.value=void 0,u.value=void 0,r(`slideEnd`)},onStepKeyDown:t[3]||=e=>{let t=f.value?`from-bottom`:`from-top`,n=I(Hh)[t].includes(e.key);r(`stepKeyDown`,e,n?-1:1)},onEndKeyDown:t[4]||=e=>r(`endKeyDown`,e),onHomeKeyDown:t[5]||=e=>r(`homeKeyDown`,e)},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`style`]))}}),[qh,Jh]=Pu(`SliderRoot`),Yh=R({inheritAttrs:!1,__name:`SliderRoot`,props:{defaultValue:{type:Array,required:!1,default:()=>[0]},modelValue:{type:[Array,null],required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},inverted:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},minStepsBetweenThumbs:{type:Number,required:!1,default:0},thumbAlignment:{type:String,required:!1,default:`contain`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`valueCommit`],setup(e,{emit:t}){let n=e,r=t,{min:i,max:a,step:o,minStepsBetweenThumbs:s,orientation:c,disabled:l,thumbAlignment:u,dir:d}=gn(n),f=Ad(d),{forwardRef:p,currentElement:m}=Id(),h=Fd(m),{CollectionSlot:g}=Kf({isProvider:!0}),_=pd(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),v=W(()=>Array.isArray(_.value)?[..._.value]:[]),y=F(0),b=F(v.value);function x(e){w(e,Nh(v.value,e))}function S(e){w(e,y.value)}function C(){let e=b.value[y.value];v.value[y.value]!==e&&r(`valueCommit`,tn(v.value))}function w(e,t,{commit:n}={commit:!1}){let c=Rh(o.value),l=ju(zh(Math.round((e-i.value)/o.value)*o.value+i.value,c),i.value,a.value),u=Ah(v.value,l,t);if(Ih(u,s.value*o.value)){y.value=u.indexOf(l);let e=String(u)!==String(_.value);e&&n&&r(`valueCommit`,u),e&&(T.value[y.value]?.focus(),_.value=u)}}let T=F([]);return Jh({modelValue:_,currentModelValue:v,valueIndexToChangeRef:y,thumbElements:T,orientation:c,min:i,max:a,disabled:l,thumbAlignment:u}),(e,t)=>(B(),V(I(g),null,{default:L(()=>[(B(),V(sa(I(c)===`horizontal`?Gh:Kh),ks(e.$attrs,{ref:I(p),"as-child":e.asChild,as:e.as,min:I(i),max:I(a),dir:I(f),inverted:e.inverted,"aria-disabled":I(l),"data-disabled":I(l)?``:void 0,onPointerdown:t[0]||=()=>{I(l)||(b.value=v.value)},onSlideStart:t[1]||=e=>!I(l)&&x(e),onSlideMove:t[2]||=e=>!I(l)&&S(e),onSlideEnd:t[3]||=e=>!I(l)&&C(),onHomeKeyDown:t[4]||=e=>!I(l)&&w(I(i),0,{commit:!0}),onEndKeyDown:t[5]||=e=>!I(l)&&w(I(a),v.value.length-1,{commit:!0}),onStepKeyDown:t[6]||=(e,t)=>{if(!I(l)){let n=I(Bh).includes(e.key)||e.shiftKey&&I(Vh).includes(e.key)?10:1,r=y.value,i=v.value[r];w(i+I(o)*n*t,r,{commit:!0})}}}),{default:L(()=>[z(e.$slots,`default`,{modelValue:I(_)}),I(h)&&e.name?(B(),V(I(Yf),{key:0,type:`number`,value:I(_),name:e.name,required:e.required,disabled:I(l),step:I(o)},null,8,[`value`,`name`,`required`,`disabled`,`step`])):Ts(`v-if`,!0)]),_:3},16,[`as-child`,`as`,`min`,`max`,`dir`,`inverted`,`aria-disabled`,`data-disabled`]))]),_:3}))}}),Xh=R({__name:`SliderImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},emits:[`slideStart`,`slideMove`,`slideEnd`,`homeKeyDown`,`endKeyDown`,`stepKeyDown`],setup(e,{emit:t}){let n=e,r=t,i=qh();return(e,t)=>(B(),V(I(vf),ks({"data-slider-impl":``},n,{onKeydown:t[0]||=e=>{e.key===`Home`?(r(`homeKeyDown`,e),e.preventDefault()):e.key===`End`?(r(`endKeyDown`,e),e.preventDefault()):I(Bh).concat(I(Vh)).includes(e.key)&&(r(`stepKeyDown`,e),e.preventDefault())},onPointerdown:t[1]||=e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),I(i).thumbElements.value.includes(t)?t.focus():r(`slideStart`,e)},onPointermove:t[2]||=e=>{e.target.hasPointerCapture(e.pointerId)&&r(`slideMove`,e)},onPointerup:t[3]||=e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),r(`slideEnd`,e))}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),Zh=R({__name:`SliderRange`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=qh(),n=Uh();Id();let r=W(()=>t.currentModelValue.value.map(e=>jh(e,t.min.value,t.max.value))),i=W(()=>t.currentModelValue.value.length>1?Math.min(...r.value):0),a=W(()=>100-Math.max(...r.value,0));return(e,r)=>(B(),V(I(vf),{"data-disabled":I(t).disabled.value?``:void 0,"data-orientation":I(t).orientation.value,"as-child":e.asChild,as:e.as,style:ue({[I(n).startEdge.value]:`${i.value}%`,[I(n).endEdge.value]:`${a.value}%`})},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`data-disabled`,`data-orientation`,`as-child`,`as`,`style`]))}}),Qh=R({inheritAttrs:!1,__name:`SliderThumbImpl`,props:{index:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=qh(),r=Uh(),{forwardRef:i,currentElement:a}=Id(),{CollectionItem:o}=Kf(),s=W(()=>n.modelValue?.value?.[t.index]),c=W(()=>s.value===void 0?0:jh(s.value,n.min.value??0,n.max.value??100)),l=W(()=>Mh(t.index,n.modelValue?.value?.length??0)),u=cf(a),d=W(()=>u[r.size].value),f=W(()=>n.thumbAlignment.value===`overflow`||!d.value?0:Ph(d.value,c.value,r.direction.value)),p=sd();return Ji(()=>{n.thumbElements.value.push(a.value)}),Qi(()=>{let e=n.thumbElements.value.findIndex(e=>e===a.value)??-1;n.thumbElements.value.splice(e,1)}),(e,t)=>(B(),V(I(o),null,{default:L(()=>[U(I(vf),ks(e.$attrs,{ref:I(i),role:`slider`,tabindex:I(n).disabled.value?void 0:0,"aria-label":e.$attrs[`aria-label`]||l.value,"data-disabled":I(n).disabled.value?``:void 0,"data-orientation":I(n).orientation.value,"aria-valuenow":s.value,"aria-valuemin":I(n).min.value,"aria-valuemax":I(n).max.value,"aria-orientation":I(n).orientation.value,"as-child":e.asChild,as:e.as,style:{transform:`var(--reka-slider-thumb-transform)`,position:`absolute`,[I(r).startEdge.value]:`calc(${c.value}% + ${f.value}px)`,display:!I(p)&&s.value===void 0?`none`:void 0},onFocus:t[0]||=()=>{I(n).valueIndexToChangeRef.value=e.index}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`tabindex`,`aria-label`,`data-disabled`,`data-orientation`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`aria-orientation`,`as-child`,`as`,`style`])]),_:3}))}}),$h=R({__name:`SliderThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,{getItems:n}=Kf(),{forwardRef:r,currentElement:i}=Id(),a=W(()=>i.value?n(!0).findIndex(e=>e.ref===i.value):-1);return(e,n)=>(B(),V(Qh,ks({ref:I(r)},t,{index:a.value}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`index`]))}}),eg=R({__name:`SliderTrack`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=qh();return Id(),(e,n)=>(B(),V(I(vf),{"as-child":e.asChild,as:e.as,"data-disabled":I(t).disabled.value?``:void 0,"data-orientation":I(t).orientation.value},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`data-disabled`,`data-orientation`]))}}),[tg,ng]=Pu(`PopoverRoot`),rg=R({__name:`PopoverRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i}=gn(n),a=pd(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return ng({contentId:``,triggerId:``,modal:i,open:a,onOpenChange:e=>{a.value=e},onOpenToggle:()=>{a.value=!a.value},triggerElement:F(),hasCustomAnchor:F(!1)}),(e,t)=>(B(),V(I(rp),null,{default:L(()=>[z(e.$slots,`default`,{open:I(a),close:()=>a.value=!1})]),_:3}))}}),ig=R({__name:`PopoverContentImpl`,props:{trapFocus:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Ld($u(n,`trapFocus`,`disableOutsidePointerEvents`)),{forwardRef:a}=Id(),o=tg();return Nd(),(e,t)=>(B(),V(I(zf),{"as-child":``,loop:``,trapped:e.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:L(()=>[U(I(Tf),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onPointerDownOutside:t[0]||=e=>r(`pointerDownOutside`,e),onInteractOutside:t[1]||=e=>r(`interactOutside`,e),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[3]||=e=>r(`focusOutside`,e),onDismiss:t[4]||=e=>I(o).onOpenChange(!1)},{default:L(()=>[U(I(_h),ks(I(i),{id:I(o).contentId,ref:I(a),"data-state":I(o).open.value?`open`:`closed`,"aria-labelledby":I(o).triggerId,style:{"--reka-popover-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-popover-content-available-width":`var(--reka-popper-available-width)`,"--reka-popover-content-available-height":`var(--reka-popper-available-height)`,"--reka-popover-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-popover-trigger-height":`var(--reka-popper-anchor-height)`},role:`dialog`}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`aria-labelledby`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),ag=R({__name:`PopoverContentModal`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=tg(),a=F(!1);Cd(!0);let o=Rd(n,r),{forwardRef:s,currentElement:c}=Id();return nf(c),(e,t)=>(B(),V(ig,ks(I(o),{ref:I(s),"trap-focus":I(i).open.value,"disable-outside-pointer-events":``,onCloseAutoFocus:t[0]||=au(e=>{r(`closeAutoFocus`,e),a.value||I(i).triggerElement.value?.focus()},[`prevent`]),onPointerDownOutside:t[1]||=e=>{r(`pointerDownOutside`,e);let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,i=t.button===2||n;a.value=i},onFocusOutside:t[2]||=au(()=>{},[`prevent`])}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),og=R({__name:`PopoverContentNonModal`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=tg(),a=F(!1),o=F(!1),s=Rd(n,r);return(e,t)=>(B(),V(ig,ks(I(s),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{r(`closeAutoFocus`,e),e.defaultPrevented||(a.value||I(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=async e=>{r(`interactOutside`,e),e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;I(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),sg=R({__name:`PopoverContent`,props:{forceMount:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=tg(),a=Rd(n,r),{forwardRef:o}=Id();return i.contentId||=af(void 0,`reka-popover-content`),(e,t)=>(B(),V(I(hf),{present:e.forceMount||I(i).open.value},{default:L(()=>[I(i).modal.value?(B(),V(ag,ks({key:0},I(a),{ref:I(o)}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)):(B(),V(og,ks({key:1},I(a),{ref:I(o)}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),cg=R({__name:`PopoverPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),V(I(Wf),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),lg=R({__name:`PopoverTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=tg(),{forwardRef:r,currentElement:i}=Id();return n.triggerId||=af(void 0,`reka-popover-trigger`),Ji(()=>{n.triggerElement.value=i.value}),(e,i)=>(B(),V(sa(I(n).hasCustomAnchor.value?I(vf):I(ip)),{"as-child":``},{default:L(()=>[U(I(vf),{id:I(n).triggerId,ref:I(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":I(n).open.value,"aria-controls":I(n).contentId,"data-state":I(n).open.value?`open`:`closed`,as:e.as,"as-child":t.asChild,onClick:I(n).onOpenToggle},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`id`,`type`,`aria-expanded`,`aria-controls`,`data-state`,`as`,`as-child`,`onClick`])]),_:3}))}}),ug=new Map,dg=!1;try{dg=new Intl.NumberFormat(`de-DE`,{signDisplay:`exceptZero`}).resolvedOptions().signDisplay===`exceptZero`}catch{}var fg=!1;try{fg=new Intl.NumberFormat(`de-DE`,{style:`unit`,unit:`degree`}).resolvedOptions().style===`unit`}catch{}var pg={degree:{narrow:{default:`°`,"ja-JP":` 度`,"zh-TW":`度`,"sl-SI":` °`}}},mg=class{format(e){let t=``;if(t=!dg&&this.options.signDisplay!=null?gg(this.numberFormatter,this.options.signDisplay,e):this.numberFormatter.format(e),this.options.style===`unit`&&!fg){let{unit:e,unitDisplay:n=`short`,locale:r}=this.resolvedOptions();if(!e)return t;let i=pg[e]?.[n];t+=i[r]||i.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if(typeof this.numberFormatter.formatRange==`function`)return this.numberFormatter.formatRange(e,t);if(t= start date`);return`${this.format(e)} \u{2013} ${this.format(t)}`}formatRangeToParts(e,t){if(typeof this.numberFormatter.formatRangeToParts==`function`)return this.numberFormatter.formatRangeToParts(e,t);if(t= start date`);let n=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!dg&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!fg&&this.options.style===`unit`&&(e={...e,style:`unit`,unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=hg(e,t),this.options=t}};function hg(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes(`-nu-`)&&(e.includes(`-u-`)||(e+=`-u-`),e+=`-nu-${n}`),t.style===`unit`&&!fg){let{unit:e,unitDisplay:n=`short`}=t;if(!e)throw Error(`unit option must be provided with style: "unit"`);if(!pg[e]?.[n])throw Error(`Unsupported unit ${e} with unitDisplay = ${n}`);t={...t,style:`decimal`}}let r=e+(t?Object.entries(t).sort((e,t)=>e[0]0||Object.is(n,0):t===`exceptZero`&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let t=e.format(-n),r=e.format(n),i=t.replace(r,``).replace(/\u200e|\u061C/,``);return[...i].length!==1&&console.warn(`@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case`),t.replace(r,`!!!`).replace(i,`+`).replace(`!!!`,r)}return e.format(n)}}var _g=RegExp(`^.*\\(.*\\).*$`),vg=[`latn`,`arab`,`hanidec`,`deva`,`beng`,`fullwide`],yg=class{parse(e){return xg(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,n){return xg(this.locale,this.options,e).isValidPartialNumber(e,t,n)}getNumberingSystem(e){return xg(this.locale,this.options,e).options.numberingSystem}constructor(e,t={}){this.locale=e,this.options=t}},bg=new Map;function xg(e,t,n){let r=Sg(e,t);if(!e.includes(`-nu-`)&&!r.isValidPartialNumber(n)){for(let i of vg)if(i!==r.options.numberingSystem){let r=Sg(e+(e.includes(`-u-`)?`-nu-`:`-u-nu-`)+i,t);if(r.isValidPartialNumber(n))return r}}return r}function Sg(e,t){let n=e+(t?Object.entries(t).sort((e,t)=>e[0]-1&&(t=`-${t}`)}let n=t?+t:NaN;if(isNaN(n))return NaN;if(this.options.style===`percent`){let e={...this.options,style:`decimal`,minimumFractionDigits:Math.min((this.options.minimumFractionDigits??0)+2,20),maximumFractionDigits:Math.min((this.options.maximumFractionDigits??0)+2,20)};return new yg(this.locale,e).parse(new mg(this.locale,e).format(n))}return this.options.currencySign===`accounting`&&_g.test(e)&&(n=-1*n),n}sanitize(e){return e=e.replace(this.symbols.literals,``),this.symbols.minusSign&&(e=e.replace(`-`,this.symbols.minusSign)),this.options.numberingSystem===`arab`&&(this.symbols.decimal&&(e=e.replace(`,`,this.symbols.decimal),e=e.replace(`،`,this.symbols.decimal)),this.symbols.group&&(e=Dg(e,`.`,this.symbols.group))),this.symbols.group===`’`&&e.includes(`'`)&&(e=Dg(e,`'`,this.symbols.group)),this.options.locale===`fr-FR`&&this.symbols.group&&(e=Dg(e,` `,this.symbols.group),e=Dg(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,t=-1/0,n=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&t<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&n>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=Dg(e,this.symbols.group,``)),e=e.replace(this.symbols.numeral,``),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,``)),e.length===0)}constructor(e,t={}){this.locale=e,t.roundingIncrement!==1&&t.roundingIncrement!=null&&(t.maximumFractionDigits==null&&t.minimumFractionDigits==null?(t.maximumFractionDigits=0,t.minimumFractionDigits=0):t.maximumFractionDigits==null?t.maximumFractionDigits=t.minimumFractionDigits:t.minimumFractionDigits??=t.maximumFractionDigits),this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=Eg(e,this.formatter,this.options,t),this.options.style===`percent`&&((this.options.minimumFractionDigits??0)>18||(this.options.maximumFractionDigits??0)>18)&&console.warn(`NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.`)}},wg=new Set([`decimal`,`fraction`,`integer`,`minusSign`,`plusSign`,`group`]),Tg=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function Eg(e,t,n,r){let i=new Intl.NumberFormat(e,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:`auto`,roundingMode:`halfExpand`}),a=i.formatToParts(-10000.111),o=i.formatToParts(10000.111),s=Tg.map(e=>i.formatToParts(e)),c=a.find(e=>e.type===`minusSign`)?.value??`-`,l=o.find(e=>e.type===`plusSign`)?.value;!l&&(r?.signDisplay===`exceptZero`||r?.signDisplay===`always`)&&(l=`+`);let u=new Intl.NumberFormat(e,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(e=>e.type===`decimal`)?.value,d=a.find(e=>e.type===`group`)?.value,f=a.filter(e=>!wg.has(e.type)).map(e=>Og(e.value)),p=s.flatMap(e=>e.filter(e=>!wg.has(e.type)).map(e=>Og(e.value))),m=[...new Set([...f,...p])].sort((e,t)=>t.length-e.length),h=m.length===0?RegExp(`[\\p{White_Space}]`,`gu`):RegExp(`${m.join(`|`)}|[\\p{White_Space}]`,`gu`),g=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),_=new Map(g.map((e,t)=>[e,t])),v=RegExp(`[${g.join(``)}]`,`g`);return{minusSign:c,plusSign:l,decimal:u,group:d,literals:h,numeral:v,index:e=>String(_.get(e))}}function Dg(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function Og(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function kg(e){let{disabled:t}=e,n=F(),r=Bu(),i=()=>window.clearTimeout(n.value),a=e=>{i(),!t.value&&(r.trigger(),n.value=window.setTimeout(()=>{a(60)},e))},o=()=>{a(400)},s=()=>{i()},c=F(!1),l=W(()=>ad(e.target)),u=e=>{e.button!==0||c.value||(e.preventDefault(),c.value=!0,o())},d=()=>{c.value=!1,s()};return Hu&&(od(l||window,`pointerdown`,u),od(window,`pointerup`,d),od(window,`pointercancel`,d)),{isPressed:c,onTrigger:r.on}}function Ag(e,t=F({})){return Qu(()=>new mg(e.value,t.value))}function jg(e,t=F({})){return Qu(()=>new yg(e.value,t.value))}function Mg(e,t,n){let r=e===`+`?t+n:t-n;if(t%1!=0||n%1!=0){let i=t.toString().split(`.`),a=n.toString().split(`.`),o=i[1]&&i[1].length||0,s=a[1]&&a[1].length||0,c=10**Math.max(o,s);t=Math.round(t*c),n=Math.round(n*c),r=e===`+`?t+n:t-n,r/=c}return r}var[Ng,Pg]=Pu(`NumberFieldRoot`),Fg=R({inheritAttrs:!1,__name:`NumberFieldRoot`,props:{defaultValue:{type:Number,required:!1,default:void 0},modelValue:{type:[Number,null],required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1,default:1},stepSnapping:{type:Boolean,required:!1,default:!0},focusOnChange:{type:Boolean,required:!1,default:!0},formatOptions:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{disabled:i,readonly:a,disableWheelChange:o,invertWheelChange:s,min:c,max:l,step:u,stepSnapping:d,formatOptions:f,id:p,locale:m}=gn(n),h=pd(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{primitiveElement:g,currentElement:_}=yf(),v=sf(m),y=Fd(_),b=F(),x=W(()=>Lu(h.value)||isNaN(h.value)?!1:C(`decrease`,h.value)>=h.value),S=W(()=>Lu(h.value)||isNaN(h.value)?!1:C(`increase`,h.value)<=h.value);function C(e,t,n=1){let r=u.value??1,i=e===`increase`?`+`:`-`,a;if(d.value&&!isNaN(r)){let o=Nu(t,c.value,l.value,r);if(o===t)a=Mg(i,t,r*n);else{let s=e===`increase`?o>t?o:Mg(`+`,o,r):o1?Mg(i,s,r*(n-1)):s}}else a=Mg(i,t,r*n);return M(a)}function w(e,t=1){if(n.focusOnChange&&b.value?.focus(),n.disabled||n.readonly)return;let r=ee.parse(b.value?.value??``);if(isNaN(r)){h.value=M(c.value??0);return}h.value=C(e,r,t)}function T(e=1){w(`increase`,e)}function E(e=1){w(`decrease`,e)}function D(e){e===`min`&&c.value!==void 0?h.value=M(c.value):e===`max`&&l.value!==void 0&&(h.value=M(l.value))}let O=Ag(v,f),ee=jg(v,f),k=W(()=>O.resolvedOptions().maximumFractionDigits>0?`decimal`:`numeric`),A=Ag(v,f),te=W(()=>Lu(h.value)||isNaN(h.value)?``:A.format(h.value));function j(e){return ee.isValidPartialNumber(e,c.value,l.value)}function ne(e){b.value&&(b.value.value=e)}function M(e){let t;return t=u.value===void 0||isNaN(u.value)||!d.value?ju(e,c.value,l.value):Nu(e,c.value,l.value,u.value),t=ee.parse(O.format(t)),t}function N(e){let t=ee.parse(e);return h.value=isNaN(t)?void 0:M(t),e.length?ne(te.value):ne(e)}return Pg({modelValue:h,handleDecrease:E,handleIncrease:T,handleMinMaxValue:D,inputMode:k,inputEl:b,onInputElement:e=>b.value=e,textValue:te,readonly:a,validate:j,applyInputValue:N,disabled:i,disableWheelChange:o,invertWheelChange:s,max:l,min:c,isDecreaseDisabled:x,isIncreaseDisabled:S,id:p}),(e,t)=>(B(),V(I(vf),ks(e.$attrs,{ref_key:`primitiveElement`,ref:g,role:`group`,as:e.as,"as-child":e.asChild,"data-disabled":I(i)?``:void 0,"data-readonly":I(a)?``:void 0}),{default:L(()=>[z(e.$slots,`default`,{modelValue:I(h),textValue:te.value,readonly:I(a)}),I(y)&&e.name?(B(),V(I(Yf),{key:0,type:`text`,value:I(h),name:e.name,disabled:I(i),readonly:I(a),required:e.required},null,8,[`value`,`name`,`disabled`,`readonly`,`required`])):Ts(`v-if`,!0)]),_:3},16,[`as`,`as-child`,`data-disabled`,`data-readonly`]))}}),Ig=R({__name:`NumberFieldDecrement`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Ng(),r=W(()=>n.disabled?.value||n.readonly.value||t.disabled||n.isDecreaseDisabled.value),{primitiveElement:i,currentElement:a}=yf(),{isPressed:o,onTrigger:s}=kg({target:a,disabled:r});return s(()=>{n.handleDecrease()}),(e,n)=>(B(),V(I(vf),ks(t,{ref_key:`primitiveElement`,ref:i,tabindex:`-1`,"aria-label":`Decrease`,type:e.as===`button`?`button`:void 0,style:{userSelect:I(o)?`none`:void 0},disabled:r.value?``:void 0,"data-disabled":r.value?``:void 0,"data-pressed":I(o)?`true`:void 0,onContextmenu:n[0]||=au(()=>{},[`prevent`])}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`type`,`style`,`disabled`,`data-disabled`,`data-pressed`]))}}),Lg=R({__name:`NumberFieldIncrement`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Ng(),r=W(()=>n.disabled?.value||n.readonly.value||t.disabled||n.isIncreaseDisabled.value),{primitiveElement:i,currentElement:a}=yf(),{isPressed:o,onTrigger:s}=kg({target:a,disabled:r});return s(()=>{n.handleIncrease()}),(e,n)=>(B(),V(I(vf),ks(t,{ref_key:`primitiveElement`,ref:i,tabindex:`-1`,"aria-label":`Increase`,type:e.as===`button`?`button`:void 0,style:{userSelect:I(o)?`none`:void 0},disabled:r.value?``:void 0,"data-disabled":r.value?``:void 0,"data-pressed":I(o)?`true`:void 0,onContextmenu:n[0]||=au(()=>{},[`prevent`])}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`type`,`style`,`disabled`,`data-disabled`,`data-pressed`]))}}),Rg=R({__name:`NumberFieldInput`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=yf(),i=Ng(),a=of(),{isComposing:o,handleCompositionStart:s,handleCompositionEnd:c}=kd();function l(e){if(!(o.value||e.isComposing))switch(e.key){case a.ARROW_UP:e.preventDefault(),i.handleIncrease();break;case a.ARROW_DOWN:e.preventDefault(),i.handleDecrease();break;case a.PAGE_UP:e.preventDefault(),i.handleIncrease(10);break;case a.PAGE_DOWN:e.preventDefault(),i.handleDecrease(10);break;case a.HOME:e.preventDefault(),i.handleMinMaxValue(`min`);break;case a.END:e.preventDefault(),i.handleMinMaxValue(`max`);break;case a.ENTER:i.applyInputValue(e.target?.value)}}function u(e){i.disableWheelChange.value||e.target===Fu()&&(Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.preventDefault(),e.deltaY>0?i.invertWheelChange.value?i.handleDecrease():i.handleIncrease():e.deltaY<0&&(i.invertWheelChange.value?i.handleIncrease():i.handleDecrease())))}Ji(()=>{i.onInputElement(r.value)});let d=F(i.textValue.value);Cr(()=>i.textValue.value,()=>{d.value=i.textValue.value},{immediate:!0,deep:!0});function f(){requestAnimationFrame(()=>{d.value=i.textValue.value})}return(e,r)=>(B(),V(I(vf),ks(t,{id:I(i).id.value,ref_key:`primitiveElement`,ref:n,value:d.value,role:`spinbutton`,type:`text`,tabindex:`0`,inputmode:I(i).inputMode.value,disabled:I(i).disabled.value?``:void 0,"data-disabled":I(i).disabled.value?``:void 0,readonly:I(i).readonly.value?``:void 0,"data-readonly":I(i).readonly.value?``:void 0,autocomplete:`off`,autocorrect:`off`,spellcheck:`false`,"aria-roledescription":`Number field`,"aria-valuenow":I(i).modelValue.value,"aria-valuemin":I(i).min.value,"aria-valuemax":I(i).max.value,onKeydown:l,onWheel:u,onBeforeinput:r[0]||=e=>{if(e.isComposing||e.inputType.startsWith(`delete`)||e.inputType.startsWith(`history`))return;let t=e.target,n=t.value.slice(0,t.selectionStart??void 0)+(e.data??``)+t.value.slice(t.selectionEnd??void 0);I(i).validate(n)||e.preventDefault()},onInput:r[1]||=e=>{let t=e.target;d.value=t.value},onChange:f,onBlur:r[2]||=e=>I(i).applyInputValue(e.target?.value),onCompositionstart:I(s),onCompositionend:I(c)}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`,`value`,`inputmode`,`disabled`,`data-disabled`,`readonly`,`data-readonly`,`aria-valuenow`,`aria-valuemin`,`aria-valuemax`,`onCompositionstart`,`onCompositionend`]))}}),zg=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Bg=[` `,`Enter`];function Vg(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>Hg(e,t,n)):Hg(e,t,n)}function Hg(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]===t?.[n]:Au(e,t)}function Ug(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var Wg=[`value`],[Gg,Kg]=Pu(`SelectRoot`),qg=R({inheritAttrs:!1,__name:`SelectRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},nullableValue:{type:String,required:!1,default:``},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{required:i,disabled:a,multiple:o,dir:s}=gn(n),c=pd(n,`modelValue`,r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),l=pd(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),u=F(),d=F(),f=F({x:0,y:0}),p=W(()=>o.value&&Array.isArray(c.value)?c.value?.length===0:Lu(c.value));Kf({isProvider:!0});let m=Ad(s),h=Fd(u),g=F(new Set),_=W(()=>Array.from(g.value).map(e=>e.value).join(`;`));function v(e){if(o.value){let t=Array.isArray(c.value)?[...c.value]:[],r=t.findIndex(t=>Hg(t,e,n.by));r===-1?t.push(e):t.splice(r,1),c.value=[...t]}else c.value=e}function y(e){return Array.from(g.value).find(t=>Vg(e,t.value,n.by))}return Kg({triggerElement:u,onTriggerChange:e=>{u.value=e},valueElement:d,onValueElementChange:e=>{d.value=e},contentId:``,modelValue:c,onValueChange:v,by:n.by,open:l,multiple:o,required:i,onOpenChange:e=>{l.value=e},dir:m,triggerPointerDownPosRef:f,disabled:a,isEmptyModelValue:p,optionsSet:g,onOptionAdd:e=>{let t=y(e.value);t&&g.value.delete(t),g.value.add(e)},onOptionRemove:e=>{let t=y(e.value);t&&g.value.delete(t)}}),(e,t)=>(B(),V(I(rp),null,{default:L(()=>[z(e.$slots,`default`,{modelValue:I(c),open:I(l)}),I(h)&&e.name?(B(),V(Jg,{key:_.value,"aria-hidden":`true`,tabindex:`-1`,multiple:I(o),required:I(i),name:e.name,autocomplete:e.autocomplete,disabled:I(a),value:I(c)},{default:L(()=>[I(Lu)(I(c))?(B(),ms(`option`,{key:0,value:e.nullableValue},null,8,Wg)):Ts(`v-if`,!0),(B(!0),ms(is,null,da(Array.from(g.value),e=>(B(),ms(`option`,ks({key:e.value??``},{ref_for:!0},e),null,16))),128))]),_:1},8,[`multiple`,`required`,`name`,`autocomplete`,`disabled`,`value`])):Ts(`v-if`,!0)]),_:3}))}}),Jg=R({__name:`BubbleSelect`,props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){let t=e,n=F(),r=Gg();Cr(()=>t.value,(e,t)=>{let r=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(r,`value`).set;if(e!==t&&i&&n.value){let t=new Event(`change`,{bubbles:!0});i.call(n.value,e),n.value.dispatchEvent(t)}});function i(e){r.onValueChange(e.target.value)}return(e,r)=>(B(),V(I(qf),{"as-child":``},{default:L(()=>[H(`select`,ks({ref_key:`selectElement`,ref:n},t,{onInput:i}),[z(e.$slots,`default`)],16)]),_:3}))}}),Yg=R({__name:`SelectPopperPosition`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:10},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Ld(e);return(e,n)=>(B(),V(I(_h),ks(I(t),{style:{boxSizing:`border-box`,"--reka-select-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-select-content-available-width":`var(--reka-popper-available-width)`,"--reka-select-content-available-height":`var(--reka-popper-available-height)`,"--reka-select-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-select-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),Xg={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[Zg,Qg]=Pu(`SelectContent`),$g=R({__name:`SelectContentImpl`,props:{position:{type:String,required:!1,default:`item-aligned`},bodyLock:{type:Boolean,required:!1,default:!0},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Gg();Nd(),Cd(n.bodyLock);let{CollectionSlot:a,getItems:o}=Kf(),s=F();nf(s);let{search:c,handleTypeaheadSearch:l}=uf(),u=F(),d=F(),f=F(),p=F(!1),m=F(!1),h=F(!1);function g(){d.value&&s.value&&Uf([d.value,s.value])}Cr(p,()=>{g()});let{onOpenChange:_,triggerPointerDownPosRef:v}=i;br(e=>{if(!s.value)return;let t={x:0,y:0},n=e=>{t={x:Math.abs(Math.round(e.pageX)-(v.value?.x??0)),y:Math.abs(Math.round(e.pageY)-(v.value?.y??0))}},r=e=>{e.pointerType!==`touch`&&(t.x<=10&&t.y<=10?e.preventDefault():s.value?.contains(e.target)||_(!1),document.removeEventListener(`pointermove`,n),v.value=null)};v.value!==null&&(document.addEventListener(`pointermove`,n),document.addEventListener(`pointerup`,r,{capture:!0,once:!0})),e(()=>{document.removeEventListener(`pointermove`,n),document.removeEventListener(`pointerup`,r,{capture:!0})})});function y(e){let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&l(e.key,o()),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=[...o().map(e=>e.ref)];if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>Uf(t)),e.preventDefault()}}let b=Ld(W(()=>n.position===`popper`?n:{}).value);return Qg({content:s,viewport:u,onViewportChange:e=>{u.value=e},itemRefCallback:(e,t,n)=>{let r=!m.value&&!n,a=Vg(i.modelValue.value,t,i.by);if(i.multiple.value){if(h.value)return;(a||r)&&(d.value=e,a&&(h.value=!0))}else(a||r)&&(d.value=e);r&&(m.value=!0)},selectedItem:d,selectedItemText:f,onItemLeave:()=>{s.value?.focus()},itemTextRefCallback:(e,t,n)=>{let r=!m.value&&!n;(Vg(i.modelValue.value,t,i.by)||r)&&(f.value=e)},focusSelectedItem:g,position:n.position,isPositioned:p,searchRef:c}),(e,t)=>(B(),V(I(a),null,{default:L(()=>[U(I(zf),{"as-child":``,onMountAutoFocus:t[6]||=au(()=>{},[`prevent`]),onUnmountAutoFocus:t[7]||=e=>{r(`closeAutoFocus`,e),!e.defaultPrevented&&(I(i).triggerElement.value?.focus({preventScroll:!0}),e.preventDefault())}},{default:L(()=>[U(I(Tf),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onFocusOutside:t[2]||=au(()=>{},[`prevent`]),onDismiss:t[3]||=e=>I(i).onOpenChange(!1),onEscapeKeyDown:t[4]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[5]||=e=>r(`pointerDownOutside`,e)},{default:L(()=>[(B(),V(sa(e.position===`popper`?Yg:n_),ks({...e.$attrs,...I(b)},{id:I(i).contentId,ref:e=>{if(!e)return;let t=I(ad)(e);t?.hasAttribute(`data-reka-popper-content-wrapper`)?s.value=t.firstElementChild:s.value=t},role:`listbox`,"data-state":I(i).open.value?`open`:`closed`,dir:I(i).dir.value,style:{display:`flex`,flexDirection:`column`,outline:`none`},onContextmenu:t[0]||=au(()=>{},[`prevent`]),onPlaced:t[1]||=e=>p.value=!0,onKeydown:y}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`dir`,`onKeydown`]))]),_:3},8,[`disable-outside-pointer-events`])]),_:3})]),_:3}))}}),[e_,t_]=Pu(`SelectItemAlignedPosition`),n_=R({inheritAttrs:!1,__name:`SelectItemAlignedPosition`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,{getItems:i}=Kf(),a=Gg(),o=Zg(),s=F(!1),c=F(!0),l=F(),{forwardRef:u,currentElement:d}=Id(),{viewport:f,selectedItem:p,selectedItemText:m,focusSelectedItem:h}=o;function g(){if(a.triggerElement.value&&a.valueElement.value&&l.value&&d.value&&f?.value&&p?.value&&m?.value){let e=a.triggerElement.value.getBoundingClientRect(),t=d.value.getBoundingClientRect(),n=a.valueElement.value.getBoundingClientRect(),o=m.value.getBoundingClientRect();if(a.dir.value!==`rtl`){let r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=ju(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.left=`${d}px`}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=ju(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.right=`${d}px`}let c=i().map(e=>e.ref),u=window.innerHeight-20,h=f.value.scrollHeight,g=window.getComputedStyle(d.value),_=Number.parseInt(g.borderTopWidth,10),v=Number.parseInt(g.paddingTop,10),y=Number.parseInt(g.borderBottomWidth,10),b=Number.parseInt(g.paddingBottom,10),x=_+v+h+b+y,S=Math.min(p.value.offsetHeight*5,x),C=window.getComputedStyle(f.value),w=Number.parseInt(C.paddingTop,10),T=Number.parseInt(C.paddingBottom,10),E=e.top+e.height/2-10,D=u-E,O=p.value.offsetHeight/2,ee=p.value.offsetTop+O,k=_+v+ee,A=x-k;if(k<=E){let e=p.value===c.at(-1);l.value.style.bottom=`0px`;let t=d.value.clientHeight-f.value.offsetTop-f.value.offsetHeight,n=k+Math.max(D,O+(e?T:0)+t+y);l.value.style.height=`${n}px`}else{let e=p.value===c[0];l.value.style.top=`0px`;let t=Math.max(E,_+f.value.offsetTop+(e?w:0)+O)+A;l.value.style.height=`${t}px`,f.value.scrollTop=k-E+f.value.offsetTop}l.value.style.margin=`10px 0`,l.value.style.minHeight=`${S}px`,l.value.style.maxHeight=`${u}px`,r(`placed`),requestAnimationFrame(()=>s.value=!0)}}let _=F(``);Ji(async()=>{await Yn(),g(),d.value&&(_.value=window.getComputedStyle(d.value).zIndex)});function v(e){e&&c.value===!0&&(g(),h?.(),c.value=!1)}return fd(a.triggerElement,()=>{g()}),t_({contentWrapper:l,shouldExpandOnScrollRef:s,onScrollButtonChange:v}),(e,t)=>(B(),ms(`div`,{ref_key:`contentWrapperElement`,ref:l,style:ue({display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:_.value})},[U(I(vf),ks({ref:I(u),style:{boxSizing:`border-box`,maxHeight:`100%`}},{...e.$attrs,...n}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)],4))}}),r_=R({inheritAttrs:!1,__name:`SelectProvider`,props:{context:{type:Object,required:!0}},setup(e){return Kg(e.context),Qg(Xg),(e,t)=>z(e.$slots,`default`)}}),i_={key:1},a_=R({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=Rd(n,t),i=Gg(),a=F();Ji(()=>{a.value=new DocumentFragment});let o=F(),s=W(()=>n.forceMount||i.open.value),c=F(s.value),l;function u(){l&&=(clearTimeout(l),void 0)}return Cr(s,(e,t,n)=>{u(),l=setTimeout(()=>{c.value=s.value,l=void 0}),n(u)}),Qi(u),(e,t)=>s.value||c.value||o.value?.present?(B(),V(I(hf),{key:0,ref_key:`presenceRef`,ref:o,present:s.value},{default:L(()=>[U($g,ge(xs({...I(r),...e.$attrs})),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`])):a.value?(B(),ms(`div`,i_,[(B(),V(Rr,{to:a.value},[U(r_,{context:I(i)},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`context`])],8,[`to`]))])):Ts(`v-if`,!0)}}),o_=R({__name:`SelectIcon`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(B(),V(I(vf),{"aria-hidden":`true`,as:e.as,"as-child":e.asChild},{default:L(()=>[z(e.$slots,`default`,{},()=>[t[0]||=Cs(`▼`)])]),_:3},8,[`as`,`as-child`]))}}),[s_,c_]=Pu(`SelectItem`),l_=R({__name:`SelectItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=gn(n),a=Gg(),o=Zg(),{forwardRef:s,currentElement:c}=Id(),{CollectionItem:l}=Kf(),u=W(()=>Vg(a.modelValue?.value,n.value,a.by)),d=F(!1),f=F(n.textValue??``),p=af(void 0,`reka-select-item-text`);async function m(e){e.defaultPrevented||Iu(`select.select`,h,{originalEvent:e,value:n.value})}async function h(e){await Yn(),r(`select`,e),!e.defaultPrevented&&(i.value||(a.onValueChange(n.value),a.multiple.value||a.onOpenChange(!1)))}async function g(e){await Yn(),!e.defaultPrevented&&(i.value?o.onItemLeave?.():e.currentTarget?.focus({preventScroll:!0}))}async function _(e){await Yn(),!e.defaultPrevented&&e.currentTarget===Fu()&&o.onItemLeave?.()}async function v(e){await Yn(),!e.defaultPrevented&&(o.searchRef?.value===``||e.key!==` `)&&(Bg.includes(e.key)&&m(e),e.key===` `&&e.preventDefault())}if(n.value===``)throw Error(`A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return Ji(()=>{c.value&&o.itemRefCallback(c.value,n.value,n.disabled)}),c_({value:n.value,disabled:i,textId:p,isSelected:u,onItemTextChange:e=>{f.value=((f.value||e?.textContent)??``).trim()}}),(e,t)=>(B(),V(I(l),{value:{textValue:f.value}},{default:L(()=>[U(I(vf),{ref:I(s),role:`option`,"aria-labelledby":I(p),"data-highlighted":d.value?``:void 0,"aria-selected":u.value,"data-state":u.value?`checked`:`unchecked`,"aria-disabled":I(i)||void 0,"data-disabled":I(i)?``:void 0,tabindex:I(i)?void 0:-1,as:e.as,"as-child":e.asChild,onFocus:t[0]||=e=>d.value=!0,onBlur:t[1]||=e=>d.value=!1,onPointerup:m,onPointerdown:t[2]||=e=>{e.currentTarget.focus({preventScroll:!0})},onTouchend:t[3]||=au(()=>{},[`prevent`,`stop`]),onPointermove:g,onPointerleave:_,onKeydown:v},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`aria-labelledby`,`data-highlighted`,`aria-selected`,`data-state`,`aria-disabled`,`data-disabled`,`tabindex`,`as`,`as-child`])]),_:3},8,[`value`]))}}),u_=R({__name:`SelectItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=s_();return(e,r)=>I(n).isSelected.value?(B(),V(I(vf),ks({key:0,"aria-hidden":`true`},t),{default:L(()=>[z(e.$slots,`default`)]),_:3},16)):Ts(`v-if`,!0)}}),d_=R({inheritAttrs:!1,__name:`SelectItemText`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Gg(),r=Zg(),i=s_(),{forwardRef:a,currentElement:o}=Id(),s=W(()=>({value:i.value,disabled:i.disabled.value,textContent:o.value?.textContent??i.value?.toString()??``}));return Ji(()=>{o.value&&(i.onItemTextChange(o.value),r.itemTextRefCallback(o.value,i.value,i.disabled.value),n.onOptionAdd(s.value))}),Qi(()=>{n.onOptionRemove(s.value)}),(e,n)=>(B(),V(I(vf),ks({id:I(i).textId,ref:I(a)},{...t,...e.$attrs}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`id`]))}}),f_=R({__name:`SelectPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),V(I(Wf),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),p_=R({__name:`SelectScrollButtonImpl`,emits:[`autoScroll`],setup(e,{emit:t}){let n=t,{getItems:r}=Kf(),i=Zg(),a=F(null);function o(){a.value!==null&&(window.clearInterval(a.value),a.value=null)}br(()=>{r().map(e=>e.ref).find(e=>e===Fu())?.scrollIntoView({block:`nearest`})});function s(){a.value===null&&(a.value=window.setInterval(()=>{n(`autoScroll`)},50))}function c(){i.onItemLeave?.(),a.value===null&&(a.value=window.setInterval(()=>{n(`autoScroll`)},50))}return Zi(()=>o()),(e,t)=>(B(),V(I(vf),ks({"aria-hidden":`true`,style:{flexShrink:0}},e.$parent?.$props,{onPointerdown:s,onPointermove:c,onPointerleave:t[0]||=()=>{o()}}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),m_=R({__name:`SelectScrollDownButton`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Zg(),n=t.position===`item-aligned`?e_():void 0,{forwardRef:r,currentElement:i}=Id(),a=F(!1);return br(e=>{if(t.viewport?.value&&t.isPositioned?.value){let n=t.viewport.value;function r(){let e=n.scrollHeight-n.clientHeight;a.value=Math.ceil(n.scrollTop)n.removeEventListener(`scroll`,r))}}),Cr(i,()=>{i.value&&n?.onScrollButtonChange(i.value)}),(e,n)=>a.value?(B(),V(p_,{key:0,ref:I(r),onAutoScroll:n[0]||=()=>{let{viewport:e,selectedItem:n}=I(t);e?.value&&n?.value&&(e.value.scrollTop=e.value.scrollTop+n.value.offsetHeight)}},{default:L(()=>[z(e.$slots,`default`)]),_:3},512)):Ts(`v-if`,!0)}}),h_=R({__name:`SelectScrollUpButton`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=Zg(),n=t.position===`item-aligned`?e_():void 0,{forwardRef:r,currentElement:i}=Id(),a=F(!1);return br(e=>{if(t.viewport?.value&&t.isPositioned?.value){let n=t.viewport.value;function r(){a.value=n.scrollTop>0}r(),n.addEventListener(`scroll`,r),e(()=>n.removeEventListener(`scroll`,r))}}),Cr(i,()=>{i.value&&n?.onScrollButtonChange(i.value)}),(e,n)=>a.value?(B(),V(p_,{key:0,ref:I(r),onAutoScroll:n[0]||=()=>{let{viewport:e,selectedItem:n}=I(t);e?.value&&n?.value&&(e.value.scrollTop=e.value.scrollTop-n.value.offsetHeight)}},{default:L(()=>[z(e.$slots,`default`)]),_:3},512)):Ts(`v-if`,!0)}}),g_=R({__name:`SelectTrigger`,props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Gg(),{forwardRef:r,currentElement:i}=Id(),a=W(()=>n.disabled?.value||t.disabled);n.contentId||=af(void 0,`reka-select-content`),Ji(()=>{n.onTriggerChange(i.value)});let{getItems:o}=Kf(),{search:s,handleTypeaheadSearch:c,resetTypeahead:l}=uf();function u(){a.value||(n.onOpenChange(!0),l())}function d(e){u(),n.triggerPointerDownPosRef.value={x:Math.round(e.pageX),y:Math.round(e.pageY)}}function f(e){return e.button===0&&e.ctrlKey===!1}let p=!1;function m(e){if(e.pointerType===`touch`)return e.preventDefault();let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),f(e)&&(d(e),p=!0)}function h(e){f(e)&&e.preventDefault()}function g(e){p||e.currentTarget?.focus(),p=!1}return(e,t)=>(B(),V(I(ip),{"as-child":``,reference:e.reference},{default:L(()=>[U(I(vf),{ref:I(r),role:`combobox`,type:e.as===`button`?`button`:void 0,"aria-controls":I(n).contentId,"aria-expanded":I(n).open.value||!1,"aria-required":I(n).required?.value,"aria-autocomplete":`none`,disabled:a.value,dir:I(n)?.dir.value,"data-state":I(n)?.open.value?`open`:`closed`,"data-disabled":a.value?``:void 0,"data-placeholder":I(Ug)(I(n).modelValue?.value)?``:void 0,"as-child":e.asChild,as:e.as,onClick:g,onPointerdown:m,onMousedown:h,onPointerup:t[0]||=au(e=>{e.pointerType===`touch`&&d(e)},[`prevent`]),onKeydown:t[1]||=e=>{let t=I(s)!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&t&&e.key===` `||(I(c)(e.key,I(o)()),I(zg).includes(e.key)&&(u(),e.preventDefault()))}},{default:L(()=>[z(e.$slots,`default`)]),_:3},8,[`type`,`aria-controls`,`aria-expanded`,`aria-required`,`disabled`,`dir`,`data-state`,`data-disabled`,`data-placeholder`,`as-child`,`as`])]),_:3},8,[`reference`]))}}),__=R({__name:`SelectValue`,props:{placeholder:{type:String,required:!1,default:``},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,{forwardRef:n,currentElement:r}=Id(),i=Gg();Ji(()=>{i.valueElement=r});let a=W(()=>{let e=[],t=Array.from(i.optionsSet.value),n=e=>t.find(t=>Vg(e,t.value,i.by));return e=Array.isArray(i.modelValue.value)?i.modelValue.value.map(e=>n(e)?.textContent??``):[n(i.modelValue.value)?.textContent??``],e.filter(Boolean)}),o=W(()=>a.value.length?a.value.join(`, `):t.placeholder);return(e,r)=>(B(),V(I(vf),{ref:I(n),as:e.as,"as-child":e.asChild,style:{pointerEvents:`none`},"data-placeholder":a.value.length?void 0:t.placeholder},{default:L(()=>[z(e.$slots,`default`,{selectedLabel:a.value,modelValue:I(i).modelValue.value},()=>[Cs(Ce(o.value),1)])]),_:3},8,[`as`,`as-child`,`data-placeholder`]))}}),v_=R({__name:`SelectViewport`,props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{nonce:n}=gn(t),r=vh(n),i=Zg(),a=i.position===`item-aligned`?e_():void 0,{forwardRef:o,currentElement:s}=Id();Ji(()=>{i?.onViewportChange(s.value)});let c=F(0);function l(e){let t=e.currentTarget,{shouldExpandOnScrollRef:n,contentWrapper:r}=a??{};if(n?.value&&r?.value){let e=Math.abs(c.value-t.scrollTop);if(e>0){let n=window.innerHeight-20,i=Number.parseFloat(r.value.style.minHeight),a=Number.parseFloat(r.value.style.height),o=Math.max(i,a);if(o0?s:0,r.value.style.justifyContent=`flex-end`)}}}c.value=t.scrollTop}return(e,n)=>(B(),ms(is,null,[U(I(vf),ks({ref:I(o),"data-reka-select-viewport":``,role:`presentation`},{...e.$attrs,...t},{style:{position:`relative`,flex:1,overflow:`hidden auto`},onScroll:l}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16),U(I(vf),{as:`style`,nonce:I(r)},{default:L(()=>n[0]||=[Cs(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } `)]),_:1,__:[0]},8,[`nonce`])],64))}}),[y_,b_]=Pu(`TooltipProvider`),x_=R({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(e){let{delayDuration:t,skipDelayDuration:n,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:a,disabled:o,content:s}=gn(e);Id();let c=F(!0),l=F(!1),{start:u,stop:d}=nd(()=>{c.value=!0},n,{immediate:!1});return b_({isOpenDelayed:c,delayDuration:t,onOpen(){d(),c.value=!1},onClose(){u()},isPointerInTransitRef:l,disableHoverableContent:r,disableClosingTrigger:i,disabled:o,ignoreNonKeyboardFocus:a,content:s}),(e,t)=>z(e.$slots,`default`)}}),S_=`tooltip.open`,[C_,w_]=Pu(`TooltipRoot`),T_=R({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;Id();let i=y_(),a=W(()=>n.disableHoverableContent??i.disableHoverableContent.value),o=W(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=W(()=>n.disabled??i.disabled.value),c=W(()=>n.delayDuration??i.delayDuration.value),l=W(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),u=pd(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});Cr(u,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(S_))):i.onClose())});let d=F(!1),f=F(),p=W(()=>u.value?d.value?`delayed-open`:`instant-open`:`closed`),{start:m,stop:h}=nd(()=>{d.value=!0,u.value=!0},c,{immediate:!1});function g(){h(),d.value=!1,u.value=!0}function _(){h(),u.value=!1}function v(){m()}return w_({contentId:``,open:u,stateAttribute:p,trigger:f,onTriggerChange(e){f.value=e},onTriggerEnter(){i.isOpenDelayed.value?v():g()},onTriggerLeave(){a.value?_():h()},onOpen:g,onClose:_,disableHoverableContent:a,disableClosingTrigger:o,disabled:s,ignoreNonKeyboardFocus:l}),(e,t)=>(B(),V(I(rp),null,{default:L(()=>[z(e.$slots,`default`,{open:I(u)})]),_:3}))}}),E_=R({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=C_(),a=y_(),{forwardRef:o,currentElement:s}=Id(),c=W(()=>n.ariaLabel||s.value?.textContent),l=W(()=>{let{ariaLabel:e,...t}=n;return xd(t,a.content.value??{},{side:`top`,sideOffset:0,align:`center`,avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:`partial`,hideWhenDetached:!1})});return Ji(()=>{od(window,`scroll`,e=>{e.target?.contains(i.trigger.value)&&i.onClose()},{capture:!0}),od(window,S_,i.onClose)}),(e,t)=>(B(),V(I(Tf),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{I(i).disableClosingTrigger.value&&I(i).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=au(()=>{},[`prevent`]),onDismiss:t[3]||=e=>I(i).onClose()},{default:L(()=>[U(I(_h),ks({ref:I(o),"data-state":I(i).stateAttribute.value},{...e.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:L(()=>[z(e.$slots,`default`),U(I(qf),{id:I(i).contentId,role:`tooltip`},{default:L(()=>[Cs(Ce(c.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),D_=R({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=Ld(e),{forwardRef:n,currentElement:r}=Id(),{trigger:i,onClose:a}=C_(),o=y_(),{isPointerInTransit:s,onPointerExit:c}=Bd(i,r);return o.isPointerInTransitRef=s,c(()=>{a()}),(e,r)=>(B(),V(E_,ks({ref:I(n)},I(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),O_=R({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=C_(),a=Rd(n,r),{forwardRef:o}=Id();return(e,t)=>(B(),V(I(hf),{present:e.forceMount||I(i).open.value},{default:L(()=>[(B(),V(sa(I(i).disableHoverableContent.value?E_:D_),ks({ref:I(o)},I(a)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),k_=R({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(B(),V(I(Wf),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),A_=R({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=C_(),r=y_();n.contentId||=af(void 0,`reka-tooltip-content`);let{forwardRef:i,currentElement:a}=Id(),o=F(!1),s=F(!1),c=W(()=>n.disabled.value?{}:{click:h,focus:p,pointermove:d,pointerleave:f,pointerdown:u,blur:m});Ji(()=>{n.onTriggerChange(a.value)});function l(){setTimeout(()=>{o.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),o.value=!0,document.addEventListener(`pointerup`,l,{once:!0})}function d(e){e.pointerType!==`touch`&&!s.value&&!r.isPointerInTransitRef.value&&(n.onTriggerEnter(),s.value=!0)}function f(){n.onTriggerLeave(),s.value=!1}function p(e){o.value||n.ignoreNonKeyboardFocus.value&&!e.target.matches?.(`:focus-visible`)||n.onOpen()}function m(){n.onClose()}function h(){n.disableClosingTrigger.value||n.onClose()}return(e,r)=>(B(),V(I(ip),{"as-child":``,reference:e.reference},{default:L(()=>[U(I(vf),ks({ref:I(i),"aria-describedby":I(n).open.value?I(n).contentId:void 0,"data-state":I(n).stateAttribute.value,as:e.as,"as-child":t.asChild,"data-grace-area-trigger":``},ma(c.value)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),j_=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),N_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),P_=`-`,F_=[],I_=`arbitrary..`,L_=e=>{let t=B_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return z_(e);let n=e.split(P_);return R_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?j_(i,t):t:i||F_}return n[e]||F_}}},R_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=R_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(P_):e.slice(t).join(P_),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?I_+r:void 0})(),B_=e=>{let{theme:t,classGroups:n}=e;return V_(n,t)},V_=(e,t)=>{let n=N_();for(let r in e){let i=e[r];H_(i,n,r,t)}return n},H_=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){W_(e,t,n);return}if(typeof e==`function`){G_(e,t,n,r);return}K_(e,t,n,r)},W_=(e,t,n)=>{let r=e===``?t:q_(t,e);r.classGroupId=n},G_=(e,t,n,r)=>{if(J_(e)){H_(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(M_(n,e))},K_=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(P_),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,Y_=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},X_=`!`,Z_=`:`,Q_=[],$_=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ev=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return $_(t,l,c,u)};if(t){let e=t+Z_,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):$_(Q_,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},tv=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},nv=e=>({cache:Y_(e.cacheSize),parseClassName:ev(e),sortModifiers:tv(e),postfixLookupClassGroupIds:rv(e),...L_(e)}),rv=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(iv),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+X_:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e0?` `+l:l)}return l},ov=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=nv(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=av(e,n);return i(e,a),a};return a=o,(...e)=>a(ov(...e))},lv=[],uv=e=>{let t=t=>t[e]||lv;return t.isThemeGetter=!0,t},dv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pv=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,mv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_v=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yv=e=>pv.test(e),bv=e=>!!e&&!Number.isNaN(Number(e)),xv=e=>!!e&&Number.isInteger(Number(e)),Sv=e=>e.endsWith(`%`)&&bv(e.slice(0,-1)),Cv=e=>mv.test(e),wv=()=>!0,Tv=e=>hv.test(e)&&!gv.test(e),Ev=()=>!1,Dv=e=>_v.test(e),Ov=e=>vv.test(e),kv=e=>!G(e)&&!K(e),Av=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),jv=e=>Kv(e,Xv,Ev),G=e=>dv.test(e),Mv=e=>Kv(e,Zv,Tv),Nv=e=>Kv(e,Qv,bv),Pv=e=>Kv(e,ey,wv),Fv=e=>Kv(e,$v,Ev),Iv=e=>Kv(e,Jv,Ev),Lv=e=>Kv(e,Yv,Ov),Rv=e=>Kv(e,ty,Dv),K=e=>fv.test(e),zv=e=>qv(e,Zv),Bv=e=>qv(e,$v),Vv=e=>qv(e,Jv),Hv=e=>qv(e,Xv),Uv=e=>qv(e,Yv),Wv=e=>qv(e,ty,!0),Gv=e=>qv(e,ey,!0),Kv=(e,t,n)=>{let r=dv.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qv=(e,t,n=!1)=>{let r=fv.exec(e);return r?r[1]?t(r[1]):n:!1},Jv=e=>e===`position`||e===`percentage`,Yv=e=>e===`image`||e===`url`,Xv=e=>e===`length`||e===`size`||e===`bg-size`,Zv=e=>e===`length`,Qv=e=>e===`number`,$v=e=>e===`family-name`,ey=e=>e===`number`||e===`weight`,ty=e=>e===`shadow`,ny=cv(()=>{let e=uv(`color`),t=uv(`font`),n=uv(`text`),r=uv(`font-weight`),i=uv(`tracking`),a=uv(`leading`),o=uv(`breakpoint`),s=uv(`container`),c=uv(`spacing`),l=uv(`radius`),u=uv(`shadow`),d=uv(`inset-shadow`),f=uv(`text-shadow`),p=uv(`drop-shadow`),m=uv(`blur`),h=uv(`perspective`),g=uv(`aspect`),_=uv(`ease`),v=uv(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[yv,`full`,`auto`,...w()],E=()=>[xv,`none`,`subgrid`,K,G],D=()=>[`auto`,{span:[`full`,xv,K,G]},xv,K,G],O=()=>[xv,`auto`,K,G],ee=()=>[`auto`,`min`,`max`,`fr`,K,G],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],te=()=>[`auto`,...w()],j=()=>[yv,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[yv,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],M=()=>[yv,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,K,G],re=()=>[...b(),Vv,Iv,{position:[K,G]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Hv,jv,{size:[K,G]}],oe=()=>[Sv,zv,Mv],se=()=>[``,`none`,`full`,l,K,G],ce=()=>[``,bv,zv,Mv],le=()=>[`solid`,`dashed`,`dotted`,`double`],ue=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],de=()=>[bv,Sv,Vv,Iv],fe=()=>[``,`none`,m,K,G],pe=()=>[`none`,bv,K,G],me=()=>[`none`,bv,K,G],he=()=>[bv,K,G],ge=()=>[yv,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Cv],breakpoint:[Cv],color:[wv],container:[Cv],"drop-shadow":[Cv],ease:[`in`,`out`,`in-out`],font:[kv],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Cv],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Cv],shadow:[Cv],spacing:[`px`,bv],text:[Cv],"text-shadow":[Cv],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,yv,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[Av],columns:[{columns:[bv,G,K,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[xv,`auto`,K,G]}],basis:[{basis:[yv,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[bv,yv,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,bv,K,G]}],shrink:[{shrink:[``,bv,K,G]}],order:[{order:[xv,`first`,`last`,`none`,K,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,zv,Mv]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Gv,Pv]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Sv,G]}],"font-family":[{font:[Bv,Fv,t]}],"font-features":[{"font-features":[G]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,K,G]}],"line-clamp":[{"line-clamp":[bv,`none`,K,Nv]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[bv,`from-font`,`auto`,K,Mv]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[bv,`auto`,K,G]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[xv,K,G]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},xv,K,G],radial:[``,K,G],conic:[xv,K,G]},Uv,Lv]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[bv,K,G]}],"outline-w":[{outline:[``,bv,zv,Mv]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Wv,Rv]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Wv,Rv]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ce()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[bv,Mv]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Wv,Rv]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[bv,K,G]}],"mix-blend":[{"mix-blend":[...ue(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[bv]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[bv]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:fe()}],brightness:[{brightness:[bv,K,G]}],contrast:[{contrast:[bv,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Wv,Rv]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,bv,K,G]}],"hue-rotate":[{"hue-rotate":[bv,K,G]}],invert:[{invert:[``,bv,K,G]}],saturate:[{saturate:[bv,K,G]}],sepia:[{sepia:[``,bv,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[bv,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[bv,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,bv,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[bv,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,bv,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[bv,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[bv,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,bv,K,G]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[bv,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[bv,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[xv,K,G]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,G]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,K,G]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[bv,zv,Mv,Nv]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function ry(...e){return ny(wu(e))}var iy=Symbol(`compas-viewer-runtime`);function ay(){let e=gr(iy);if(!e)throw Error(`COMPAS viewer runtime is not available in this component`);return e}var oy=R({__name:`Button`,props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e,{theme:n}=ay().store;return(r,i)=>(B(),V(I(vf),{"data-slot":`button`,as:e.as,"as-child":e.asChild,class:he(I(ry)(I(sy)({variant:e.variant,size:e.size}),t.class,{dark:I(n).value===`dark`}))},{default:L(()=>[z(r.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}}),sy=Du(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}}),cy=R({__name:`Select`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},nullableValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=Rd(e,t);return(e,t)=>(B(),V(I(qg),ge(xs(I(n))),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),ly=R({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean},position:{default:`popper`},bodyLock:{type:Boolean},memoDependencies:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(t,r)=>(B(),V(I(f_),null,{default:L(()=>[U(I(a_),ks({...I(i),...t.$attrs},{class:I(ry)(`relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e.position===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,n.class)}),{default:L(()=>[U(I(Wy)),U(I(v_),{class:he(I(ry)(`p-1`,e.position===`popper`&&`h-(--reka-select-trigger-height) w-full min-w-(--reka-select-trigger-width)`))},{default:L(()=>[z(t.$slots,`default`)]),_:3},8,[`class`]),U(I(Uy))]),_:3},16,[`class`])]),_:3}))}}),uy=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},dy=e=>e===``,fy=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),py=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),my=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),hy=e=>{let t=my(e);return t.charAt(0).toUpperCase()+t.slice(1)},gy={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},_y=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:i,"stroke-width":a,size:o=gy.width,color:s=gy.stroke,...c},{slots:l})=>tc(`svg`,{...gy,...c,width:o,height:o,stroke:s,"stroke-width":dy(n)||dy(r)||n===!0||r===!0?Number(i||a||gy[`stroke-width`])*24/Number(o):i||a||gy[`stroke-width`],class:fy(`lucide`,c.class,...e?[`lucide-${py(hy(e))}-icon`,`lucide-${py(e)}`]:[`lucide-icon`]),...!l.default&&!uy(c)&&{"aria-hidden":`true`}},[...t.map(e=>tc(...e)),...l.default?[l.default()]:[]]),vy=(e,t)=>(n,{slots:r,attrs:i})=>tc(_y,{...i,...n,iconNode:t,name:e},r),yy=vy(`arrow-big-left-dash`,[[`path`,{d:`M13 9a1 1 0 0 1-1-1V5.061a1 1 0 0 0-1.811-.75l-6.835 6.836a1.207 1.207 0 0 0 0 1.707l6.835 6.835a1 1 0 0 0 1.811-.75V16a1 1 0 0 1 1-1h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1z`,key:`p8w4w5`}],[`path`,{d:`M20 9v6`,key:`14roy0`}]]),by=vy(`arrow-big-right-dash`,[[`path`,{d:`M11 9a1 1 0 0 0 1-1V5.061a1 1 0 0 1 1.811-.75l6.836 6.836a1.207 1.207 0 0 1 0 1.707l-6.836 6.835a1 1 0 0 1-1.811-.75V16a1 1 0 0 0-1-1H9a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1z`,key:`67vhrh`}],[`path`,{d:`M4 9v6`,key:`bns7oa`}]]),xy=vy(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Sy=vy(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Cy=vy(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),wy=vy(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ty=vy(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ey=vy(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Dy=vy(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Oy=vy(`image-down`,[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19 3 3v-5.5`,key:`9ldu5r`}],[`path`,{d:`m17 22 3-3`,key:`1nkfve`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),ky=vy(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Ay=vy(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),jy=vy(`move-3d`,[[`path`,{d:`M5 3v16h16`,key:`1mqmf9`}],[`path`,{d:`m5 19 6-6`,key:`jh6hbb`}],[`path`,{d:`m2 6 3-3 3 3`,key:`tkyvxa`}],[`path`,{d:`m18 16 3 3-3 3`,key:`1d4glt`}]]),My=vy(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),Ny=vy(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Py=vy(`pointer-off`,[[`path`,{d:`M10 4.5V4a2 2 0 0 0-2.41-1.957`,key:`jsi14n`}],[`path`,{d:`M13.9 8.4a2 2 0 0 0-1.26-1.295`,key:`hirc7f`}],[`path`,{d:`M21.7 16.2A8 8 0 0 0 22 14v-3a2 2 0 1 0-4 0v-1a2 2 0 0 0-3.63-1.158`,key:`1jxb2e`}],[`path`,{d:`m7 15-1.8-1.8a2 2 0 0 0-2.79 2.86L6 19.7a7.74 7.74 0 0 0 6 2.3h2a8 8 0 0 0 5.657-2.343`,key:`10r7hm`}],[`path`,{d:`M6 6v8`,key:`tv5xkp`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Fy=vy(`pointer`,[[`path`,{d:`M22 14a8 8 0 0 1-8 8`,key:`56vcr3`}],[`path`,{d:`M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1agjmk`}],[`path`,{d:`M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1`,key:`wdbh2u`}],[`path`,{d:`M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10`,key:`1ibuk9`}],[`path`,{d:`M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`g6ys72`}]]),Iy=vy(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),Ly=vy(`rotate-3d`,[[`path`,{d:`M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2`,key:`10n0gc`}],[`path`,{d:`m15.194 13.707 3.814 1.86-1.86 3.814`,key:`16shm9`}],[`path`,{d:`M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4`,key:`1lxi77`}]]),Ry=vy(`scale-3d`,[[`path`,{d:`M5 7v11a1 1 0 0 0 1 1h11`,key:`13dt1j`}],[`path`,{d:`M5.293 18.707 11 13`,key:`ezgbsx`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`circle`,{cx:`5`,cy:`5`,r:`2`,key:`1gwv83`}]]),zy=vy(`sun-medium`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 3v1`,key:`1asbbs`}],[`path`,{d:`M12 20v1`,key:`1wcdkc`}],[`path`,{d:`M3 12h1`,key:`lp3yf2`}],[`path`,{d:`M20 12h1`,key:`1vloll`}],[`path`,{d:`m18.364 5.636-.707.707`,key:`1hakh0`}],[`path`,{d:`m6.343 17.657-.707.707`,key:`18m9nf`}],[`path`,{d:`m5.636 5.636.707.707`,key:`1xv1c5`}],[`path`,{d:`m17.657 17.657.707.707`,key:`vl76zb`}]]),By=vy(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Vy={class:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`},Hy=R({__name:`SelectItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(l_),ks(I(n),{class:I(ry)(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t.class)}),{default:L(()=>[H(`span`,Vy,[U(I(u_),null,{default:L(()=>[U(I(Cy),{class:`h-4 w-4`})]),_:1})]),U(I(d_),null,{default:L(()=>[z(e.$slots,`default`)]),_:3})]),_:3},16,[`class`]))}}),Uy=R({__name:`SelectScrollDownButton`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(m_),ks(I(n),{class:I(ry)(`flex cursor-default items-center justify-center py-1`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(wy))])]),_:3},16,[`class`]))}}),Wy=R({__name:`SelectScrollUpButton`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(h_),ks(I(n),{class:I(ry)(`flex cursor-default items-center justify-center py-1`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(Ty))])]),_:3},16,[`class`]))}}),Gy=R({__name:`SelectTrigger`,props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(g_),ks(I(n),{class:I(ry)(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start`,t.class)}),{default:L(()=>[z(e.$slots,`default`),U(I(o_),{"as-child":``},{default:L(()=>[U(I(wy),{class:`w-4 h-4 opacity-50 shrink-0`})]),_:1})]),_:3},16,[`class`]))}}),Ky=R({__name:`SelectValue`,props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(__),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}});function qy(e){let t=F(!1);function n(n){let r=e.value;t.value=r!==null&&r.matches(`:hover`)}return Ji(()=>{window.addEventListener(`mousemove`,n)}),Qi(()=>{window.removeEventListener(`mousemove`,n)}),{isHovered:t}}var Jy={class:`right-bar`},Yy={id:`data-container`},Xy={class:`metadata item`},Zy={class:`data-container`},Qy=R({__name:`ObjectInfo`,setup(e){let t=ay(),{objectActionsState:n,objectBarData:r,blockPicker:i,theme:a}=t.store,o=(e,n)=>t.handleObjectAction({...e},n),s=F(null),{isHovered:c}=qy(s);br(()=>{i.value=c.value&&r.isVisible});let l=()=>{r.isVisible=!r.isVisible};return(e,t)=>(B(),ms(`div`,Jy,[H(`div`,{class:he([`theme object-info`,{"is-hidden":!I(r).isVisible}]),id:`info-panel`,ref_key:`infoPanel`,ref:s},[H(`div`,Yy,[H(`div`,Xy,[H(`h1`,{class:he([`text-lg font-bold section-title`,{dark:I(a).value===`dark`}])},` METADATA `,2),(B(!0),ms(is,null,da(I(r).data,(e,t)=>(B(),ms(`div`,{key:t,class:`data-entry`},[H(`p`,null,[H(`strong`,null,Ce(t)+`:`,1),Cs(` `+Ce(e),1)])]))),128))])]),H(`div`,Zy,[H(`h1`,{class:he([`text-lg font-bold section-title`,{dark:I(a).value===`dark`}])},` FUNCTIONS `,2),(B(!0),ms(is,null,da(I(n),e=>(B(),ms(`div`,{key:e.guid,class:`single_data`},[e.type===`button`?(B(),V(I(oy),{key:0,variant:`outline`,onClick:t=>o(e),class:`w-full`},{default:L(()=>[Cs(Ce(e.text),1)]),_:2},1032,[`onClick`])):e.type===`select`?(B(),V(I(cy),{key:1,"model-value":typeof e.defaultValue==`string`?e.defaultValue:``,"onUpdate:modelValue":t=>{e.defaultValue=typeof t==`string`?t:``,o(e,t)}},{default:L(()=>[U(I(Gy),{class:`w-full`},{default:L(()=>[U(I(Ky),{placeholder:e.placeholder??`Select an option`},null,8,[`placeholder`])]),_:2},1024),U(I(ly),{class:`z-[4000]`},{default:L(()=>[(B(!0),ms(is,null,da(e.options,e=>(B(),V(I(Hy),{key:e,value:e},{default:L(()=>[Cs(Ce(e),1)]),_:2},1032,[`value`]))),128))]),_:2},1024)]),_:2},1032,[`model-value`,`onUpdate:modelValue`])):Ts(``,!0)]))),128))]),U(I(oy),{variant:`secondary`,size:`icon`,id:`closeObjectBar`,onClick:t[0]||=e=>l()},{default:L(()=>[U(I(by))]),_:1})],2),U(I(oy),{variant:`secondary`,size:`icon`,id:`openObjectBar`,class:he({"is-hidden":!I(r).isVisible}),onClick:t[1]||=e=>l()},{default:L(()=>[U(I(yy))]),_:1},8,[`class`])]))}}),$y=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},eb=$y(Qy,[[`__scopeId`,`data-v-2390ba1f`]]);function tb(e){if(e.ctrlKey||e.metaKey||e.altKey)return!0;let t=e.target;if(!t)return!1;let n=t.tagName;return n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable}function nb(e){let{root:t}=ay(),n=t=>{if(tb(t))return;let n=e[t.key.toLowerCase()];n&&(t.preventDefault(),n(t))};Ji(()=>{t.addEventListener(`keydown`,n)}),Zi(()=>{t.removeEventListener(`keydown`,n)})}var rb=R({__name:`Kbd`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),ms(`kbd`,{class:he(I(ry)(`bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none`,`[&_svg:not([class*='size-'])]:size-3`,`[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10`,t.class))},[z(e.$slots,`default`)],2))}}),ib=R({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Rd(e,t);return(e,t)=>(B(),V(I(T_),ge(xs(I(n))),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),ab=R({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r),{theme:a}=ay().store;return(e,t)=>(B(),V(I(k_),null,{default:L(()=>[U(I(O_),ks({...I(i),...e.$attrs},{class:I(ry)(`z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n.class,{dark:I(a).value===`dark`})}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),ob=R({__name:`TooltipProvider`,props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(x_),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),sb=R({__name:`TooltipTrigger`,props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(A_),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),cb=R({__name:`MoveButton`,setup(e){let t=ay(),{pickerEnabled:n,pickerMode:r}=t.store;function i(){t.setTransformMode(`translate`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:he({active:I(r).value==`translate`,disabled:!I(n).value}),onClick:i,disabled:!I(n).value},{default:L(()=>[U(I(jy))]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Move mode `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`W`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),lb=R({__name:`RotateButton`,setup(e){let t=ay(),{pickerEnabled:n,pickerMode:r}=t.store;function i(){t.setTransformMode(`rotate`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:he({active:I(r).value==`rotate`,disabled:!I(n).value}),onClick:i,disabled:!I(n).value},{default:L(()=>[U(I(Ly),{size:16,"stroke-width":2,"aria-hidden":`true`})]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Rotate mode `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`E`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),ub={class:`button-icon`},db=R({__name:`ScaleButton`,props:{active:{type:Boolean}},emits:[`activated`],setup(e){let t=ay(),{pickerEnabled:n,pickerMode:r}=t.store;function i(){t.setTransformMode(`scale`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:he([`toolbar-button`,{active:I(r).value==`scale`,disabled:!I(n).value}]),onClick:i,disabled:!I(n).value},{default:L(()=>[H(`span`,ub,[U(I(Ry),{size:16,"stroke-width":2,"aria-hidden":`true`})])]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Rotate mode `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`R`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),fb={key:0},pb={key:1},mb=R({__name:`EnablePicker`,setup(e){let{pickerEnabled:t}=ay().store;function n(){t.value=!t.value}return(e,r)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,onClick:n,class:he({active:!I(t).value})},{default:L(()=>[I(t).value?(B(),ms(`span`,fb,[U(I(Fy))])):(B(),ms(`span`,pb,[U(I(Py))]))]),_:1},8,[`class`])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[r[1]||=Cs(`Enable/Disable object selection `,-1),U(I(rb),null,{default:L(()=>[...r[0]||=[Cs(`P`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),hb={class:`toolbar-group`},gb=R({__name:`TransformGroup`,setup(e){let t=F(null),n=ay();function r(e){t.value=e}return nb({w:()=>{n.setTransformMode(`translate`),r(`move`)},e:()=>{n.setTransformMode(`rotate`),r(`rotate`)},r:()=>{n.setTransformMode(`scale`),r(`scale`)}}),(e,n)=>(B(),ms(`div`,hb,[U(I(mb),{active:t.value===`move`,onActivated:n[0]||=e=>r(`move`)},null,8,[`active`]),U(I(cb),{active:t.value===`move`,onActivated:n[1]||=e=>r(`move`)},null,8,[`active`]),U(I(lb),{active:t.value===`rotate`,onActivated:n[2]||=e=>r(`rotate`)},null,8,[`active`]),U(I(db),{active:t.value===`scale`,onActivated:n[3]||=e=>r(`scale`)},null,8,[`active`])]))}}),_b=R({__name:`TopViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`top`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:`toolbar-button`,onClick:n},{default:L(()=>[U(I(My))]),_:1})]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Top view `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`5`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),vb=R({__name:`FrontViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`front`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,onClick:n},{default:L(()=>[U(I(Dy))]),_:1})]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Front view `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`2`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),yb={class:`button-icon`},bb=R({__name:`RightViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`right`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:`toolbar-button`,onClick:n},{default:L(()=>[H(`span`,yb,[U(I(Iy),{size:16,"stroke-width":2,"aria-hidden":`true`})])]),_:1})]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Right view `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`6`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),xb={class:`button-icon`},Sb=R({__name:`PerspectiveViewButton`,setup(e){let t=ay();function n(){t.setCameraViewPreset(`front_right`)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,class:`toolbar-button`,onClick:n},{default:L(()=>[H(`span`,xb,[U(I(xy),{size:16,"stroke-width":2,"aria-hidden":`true`})])]),_:1})]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Perspective view `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`3`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),Cb={class:`toolbar-group`},wb=R({__name:`ViewGroup`,setup(e){let t=ay();return nb({2:()=>{t.setCameraViewPreset(`front`)},3:()=>{t.setCameraViewPreset(`front_right`)},5:()=>{t.setCameraViewPreset(`top`)},6:()=>{t.setCameraViewPreset(`right`)}}),(e,t)=>(B(),ms(`div`,Cb,[U(I(_b)),U(I(vb)),U(I(bb)),U(I(Sb))]))}}),Tb={class:`button-icon save-view-icon`},Eb={class:`save-view-overlay`,"aria-hidden":`true`},Db=$y(R({__name:`SaveViewButton`,props:{defaultName:{}},emits:[`saved`],setup(e,{emit:t}){let n=e,r=ay(),i=t;function a(){let e=window.prompt(`Name for saved view`,n.defaultName);if(e===null)return;let t=e.trim()||n.defaultName,a=r.captureCurrentView(t);i(`saved`,a)}return(e,t)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),null,{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`,onClick:a},{default:L(()=>[H(`span`,Tb,[U(I(Sy),{size:15,"stroke-width":2,"aria-hidden":`true`}),H(`span`,Eb,[U(I(Ny),{class:`save-view-overlay-icon`})])])]),_:1})]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[t[1]||=Cs(`Save Current View `,-1),U(I(rb),null,{default:L(()=>[...t[0]||=[Cs(`S`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1}))}}),[[`__scopeId`,`data-v-c0eebdad`]]),Ob=R({__name:`Popover`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Rd(e,t);return(e,t)=>(B(),V(I(rg),ge(xs(I(n))),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),kb=R({__name:`PopoverTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(B(),V(I(lg),ge(xs(t)),{default:L(()=>[z(e.$slots,`default`)]),_:3},16))}}),Ab=R({inheritAttrs:!1,__name:`PopoverContent`,props:{forceMount:{type:Boolean},memoDependencies:{},side:{},sideOffset:{default:8},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r),{theme:a}=ay().store;return(e,t)=>(B(),V(I(cg),null,{default:L(()=>[U(I(sg),ks({...I(i),...e.$attrs},{class:I(ry)(`z-50 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,n.class,{dark:I(a).value===`dark`})}),{default:L(()=>[z(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),jb={class:`inline-flex h-full w-full items-center justify-center`},Mb={class:`flex h-8 items-stretch overflow-hidden rounded-lg border border-input bg-secondary`},Nb={key:0,disabled:``,value:``},Pb=[`value`],Fb=$y(R({__name:`SavedViewsButton`,props:{views:{},selectedViewId:{}},emits:[`select`,`delete`],setup(e,{emit:t}){let n=e,r=t,i=F(!1),a=F(``),o=F(!1),s=null;Cr(()=>[n.selectedViewId,n.views],([e,t])=>{if(t.length===0){a.value=``;return}let n=t.some(t=>t.id===e);a.value=n?e:t[0]?.id??``},{immediate:!0});function c(){a.value&&r(`select`,a.value)}function l(){a.value&&(o.value=!0,s&&clearTimeout(s),s=setTimeout(()=>{o.value=!1,s=null},160),r(`delete`,a.value))}return Zi(()=>{s&&clearTimeout(s)}),(t,n)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(Ob),{open:i.value,"onUpdate:open":n[1]||=e=>i.value=e,modal:!0},{default:L(()=>[U(I(kb),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),{"as-child":``},{default:L(()=>[H(`span`,jb,[U(I(Ey))])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[...n[2]||=[H(`p`,null,`Saved views`,-1)]]),_:1})]),_:1})]),_:1})]),_:1}),U(I(Ab),{class:`theme z-[4000] w-72 rounded-xl p-2 text-secondary-foreground`,side:`bottom`,align:`start`},{default:L(()=>[H(`div`,Mb,[pr(H(`select`,{"onUpdate:modelValue":n[0]||=e=>a.value=e,class:`h-full min-w-0 flex-1 truncate border-0 bg-secondary px-3 py-1 text-sm text-secondary-foreground outline-none`,onChange:c},[e.views.length===0?(B(),ms(`option`,Nb,` No saved views `)):Ts(``,!0),(B(!0),ms(is,null,da(e.views,e=>(B(),ms(`option`,{key:e.id,value:e.id},Ce(e.name),9,Pb))),128))],544),[[Yl,a.value]]),U(I(ib),null,{default:L(()=>[U(I(sb),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon-sm`,class:he([`h-full w-8 rounded-none border-l border-input transition-[background-color,color,box-shadow]`,{"saved-view-delete-pressed":o.value}]),disabled:!a.value,onClick:au(l,[`stop`])},{default:L(()=>[U(I(By),{class:`h-3 w-3`})]),_:1},8,[`class`,`disabled`])]),_:1}),U(I(ab),{class:`z-[4100]`,side:`bottom`},{default:L(()=>[...n[3]||=[H(`p`,null,`Delete saved view`,-1)]]),_:1})]),_:1})])]),_:1})]),_:1},8,[`open`])]),_:1}))}}),[[`__scopeId`,`data-v-1562f39a`]]),Ib={class:`inline-flex h-full w-full items-center justify-center`},Lb={class:`grid gap-5`},Rb={class:`grid gap-3`},zb={class:`grid grid-cols-3 items-center gap-4`},Bb={class:`flex items-center gap-2`},Vb={class:`grid grid-cols-3 items-center gap-4`},Hb={class:`flex items-center gap-2`},Ub={class:`grid grid-cols-3 items-center gap-4`},Wb={class:`flex justify-end gap-2`},Gb=64,Kb=8192,qb=$y(R({__name:`SaveScreenshotButton`,setup(e){let t=F(!1),n=F(1920),r=F(1080),i=F(`png`),a=F(!1),o=ay(),s=W(()=>Number.isFinite(n.value)?n.valueKb?`Width must be between ${Gb} and ${Kb} px.`:``:`Width must be a number.`),c=W(()=>Number.isFinite(r.value)?r.valueKb?`Height must be between ${Gb} and ${Kb} px.`:``:`Height must be a number.`);function l(e,t){return Number.isFinite(e)?Math.min(Kb,Math.max(Gb,Math.round(e))):t}function u(){a.value=!0}function d(){n.value=l(n.value,1920)}function f(){r.value=l(r.value,1080)}function p(){let e=o.renderer.domElement;if(!e)return;let t=e.getBoundingClientRect(),i=Math.round(t.width)||e.clientWidth||e.width,a=Math.round(t.height)||e.clientHeight||e.height;n.value=l(i,n.value),r.value=l(a,r.value)}function m(){d(),f(),!(s.value||c.value)&&(o.saveCurrentCanvasImage({width:n.value,height:r.value,format:i.value}),t.value=!1)}return Cr(t,e=>{e&&!a.value&&p()}),(e,a)=>(B(),V(I(ob),{"delay-duration":600},{default:L(()=>[U(I(Ob),{open:t.value,"onUpdate:open":a[4]||=e=>t.value=e,modal:!0},{default:L(()=>[U(I(kb),{"as-child":``},{default:L(()=>[U(I(oy),{variant:`secondary`,size:`icon`},{default:L(()=>[U(I(ib),null,{default:L(()=>[U(I(sb),{"as-child":``},{default:L(()=>[H(`span`,Ib,[U(I(Oy))])]),_:1}),U(I(ab),{class:`z-1000`,side:`bottom`},{default:L(()=>[H(`p`,null,[a[6]||=Cs(`Save screenshot `,-1),U(I(rb),null,{default:L(()=>[...a[5]||=[Cs(`F`,-1)]]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1}),U(I(Ab),{class:`theme z-[4000] w-84 rounded-xl p-5 text-secondary-foreground`,side:`bottom`,align:`start`},{default:L(()=>[H(`div`,Lb,[a[15]||=H(`div`,{class:`space-y-2`},[H(`h4`,{class:`font-medium leading-none`},`Export Screenshot`),H(`p`,{class:`text-sm text-muted-foreground`},` Set width, height, and image format. `)],-1),H(`div`,Rb,[H(`div`,zb,[H(`div`,Bb,[a[8]||=H(`label`,{for:`screenshot-width`,class:`text-sm`},`Width`,-1),s.value?(B(),V(I(ib),{key:0},{default:L(()=>[U(I(sb),{"as-child":``},{default:L(()=>[...a[7]||=[H(`span`,{class:`error-pill`,"aria-label":`Width error`},`!`,-1)]]),_:1}),U(I(ab),{class:`z-[5000]`,side:`top`},{default:L(()=>[H(`p`,null,Ce(s.value),1)]),_:1})]),_:1})):Ts(``,!0)]),pr(H(`input`,{id:`screenshot-width`,"onUpdate:modelValue":a[0]||=e=>n.value=e,type:`number`,onInput:u,onBlur:d,class:`themed-number col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`},null,544),[[Gl,n.value,void 0,{number:!0}]])]),H(`div`,Vb,[H(`div`,Hb,[a[10]||=H(`label`,{for:`screenshot-height`,class:`text-sm`},`Height`,-1),c.value?(B(),V(I(ib),{key:0},{default:L(()=>[U(I(sb),{"as-child":``},{default:L(()=>[...a[9]||=[H(`span`,{class:`error-pill`,"aria-label":`Height error`},`!`,-1)]]),_:1}),U(I(ab),{class:`z-[5000]`,side:`top`},{default:L(()=>[H(`p`,null,Ce(c.value),1)]),_:1})]),_:1})):Ts(``,!0)]),pr(H(`input`,{id:`screenshot-height`,"onUpdate:modelValue":a[1]||=e=>r.value=e,type:`number`,onInput:u,onBlur:f,class:`themed-number col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`},null,544),[[Gl,r.value,void 0,{number:!0}]])]),H(`div`,Ub,[a[12]||=H(`label`,{for:`screenshot-format`,class:`text-sm`},`Format`,-1),pr(H(`select`,{id:`screenshot-format`,"onUpdate:modelValue":a[2]||=e=>i.value=e,class:`col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`},[...a[11]||=[H(`option`,{value:`png`},`PNG`,-1),H(`option`,{value:`jpg`},`JPG`,-1),H(`option`,{value:`webp`},`WEBP`,-1)]],512),[[Yl,i.value]])])]),H(`div`,Wb,[U(I(oy),{variant:`secondary`,size:`sm`,onClick:a[3]||=e=>t.value=!1},{default:L(()=>[...a[13]||=[Cs(`Cancel`,-1)]]),_:1}),U(I(oy),{variant:`secondary`,size:`sm`,onClick:m},{default:L(()=>[...a[14]||=[Cs(`Save`,-1)]]),_:1})])])]),_:1})]),_:1},8,[`open`])]),_:1}))}}),[[`__scopeId`,`data-v-ed1ef026`]]),Jb={class:`display-tools-wrapper`},Yb={class:`toolbar-group`},Xb=`compas_threejs_saved_views`,Zb=R({__name:`DisplayGroup`,setup(e){let t=ay(),n=F([]),r=F(``);function i(){localStorage.setItem(Xb,JSON.stringify(n.value))}function a(){let e=localStorage.getItem(Xb);if(e)try{let t=JSON.parse(e);Array.isArray(t)&&(n.value=t)}catch{n.value=[]}}function o(e){n.value=[...n.value,e],r.value=e.id,i()}function s(){let e=`View ${n.value.length+1}`,r=window.prompt(`Name for saved view`,e);if(r===null)return;let i=r.trim()||e;o(t.captureCurrentView(i))}function c(e){r.value=e;let i=n.value.find(t=>t.id===e);i&&t.applySavedView(i)}function l(e){let t=n.value.filter(t=>t.id!==e);n.value=t,r.value===e&&(r.value=t[0]?.id??``),i()}return Ji(()=>{a()}),nb({s:()=>{s()},f:()=>{t.saveCurrentCanvasImage({format:`png`})},d:()=>{t.toggleTheme()}}),(e,t)=>(B(),ms(`div`,Jb,[H(`div`,Yb,[U(I(Db),{"default-name":`View ${n.value.length+1}`,onSaved:o},null,8,[`default-name`]),U(I(Fb),{views:n.value,"selected-view-id":r.value,onSelect:c,onDelete:l},null,8,[`views`,`selected-view-id`]),U(I(qb))])]))}}),Qb=$y(R({__name:`Toolbar`,setup(e){let t=F(null),{isHovered:n}=qy(t),{theme:r,blockPicker:i}=ay().store;return br(()=>{i.value=n.value}),(e,n)=>(B(),ms(`div`,{ref_key:`toolbarElement`,ref:t,class:`toolbar theme`,id:`toolbar`},[H(`h1`,{class:he([`text-lg font-bold`,{dark:I(r).value===`dark`}])},` COMPAS ThreeJs `,2),U(gb),U(wb),U(Zb)],512))}}),[[`__scopeId`,`data-v-7f20b0a6`]]),$b=R({__name:`Slider`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},orientation:{},dir:{},inverted:{type:Boolean},min:{},max:{},step:{},minStepsBetweenThumbs:{},thumbAlignment:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`,`valueCommit`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(e,t)=>(B(),V(I(Yh),ks({"data-slot":`slider`,class:I(ry)(`relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,n.class)},I(i)),{default:L(({modelValue:e})=>[U(I(eg),{"data-slot":`slider-track`,class:`bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`},{default:L(()=>[U(I(Zh),{"data-slot":`slider-range`,class:`bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full`})]),_:1}),(B(!0),ms(is,null,da(e,(e,t)=>(B(),V(I($h),{key:t,"data-slot":`slider-thumb`,class:`bg-secondary-foreground border-primary ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50`}))),128))]),_:1},16,[`class`]))}}),ex=R({__name:`NumberField`,props:{defaultValue:{},modelValue:{},min:{},max:{},step:{},stepSnapping:{type:Boolean},focusOnChange:{type:Boolean},formatOptions:{},locale:{},disabled:{type:Boolean},readonly:{type:Boolean},disableWheelChange:{type:Boolean},invertWheelChange:{type:Boolean},id:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(e,t)=>(B(),V(I(Fg),ks(I(i),{class:I(ry)(`grid gap-1.5`,n.class)}),{default:L(t=>[z(e.$slots,`default`,ge(xs(t)))]),_:3},16,[`class`]))}}),tx=R({__name:`NumberFieldContent`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),ms(`div`,{class:he(I(ry)(`relative [&>[data-slot=input]]:has-[[data-slot=increment]]:pr-5 [&>[data-slot=input]]:has-[[data-slot=decrement]]:pl-5`,t.class))},[z(e.$slots,`default`)],2))}}),nx=R({__name:`NumberFieldDecrement`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(Ig),ks({"data-slot":`decrement`},I(n),{class:I(ry)(`absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:cursor-not-allowed disabled:opacity-20`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(ky),{class:`h-4 w-4`})])]),_:3},16,[`class`]))}}),rx=R({__name:`NumberFieldIncrement`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ld($u(t,`class`));return(e,r)=>(B(),V(I(Lg),ks({"data-slot":`increment`},I(n),{class:I(ry)(`absolute top-1/2 -translate-y-1/2 right-0 disabled:cursor-not-allowed disabled:opacity-20 p-3`,t.class)}),{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(Ny),{class:`h-4 w-4`})])]),_:3},16,[`class`]))}}),ix=R({__name:`NumberFieldInput`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(B(),V(I(Rg),{"data-slot":`input`,class:he(I(ry)(`flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-sm text-center text-foreground shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,t.class))},null,8,[`class`]))}}),ax=R({__name:`Checkbox`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},value:{},id:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=Rd($u(n,`class`),r);return(e,t)=>(B(),V(I(Oh),ks(I(i),{class:I(ry)(`grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,n.class)}),{default:L(()=>[U(I(kh),{class:`grid place-content-center text-current`},{default:L(()=>[z(e.$slots,`default`,{},()=>[U(I(Cy),{class:`h-4 w-4`})])]),_:3})]),_:3},16,[`class`]))}}),ox={class:`load-json-button-container inline-block`},sx=R({__name:`LoadJsonButton`,props:{text:{},action:{}},setup(e){let t=e,n=ay(),r=F(null),i=()=>{r.value?.click()},a=e=>{let r=e.target,i=r.files?.[0];if(i){let e=new FileReader;e.onload=e=>{try{let r=e.target?.result,i=JSON.parse(r);console.log(`Preparing to send JSON payload via WS for action: ${t.action}`);let a={dispatch:`loaded_json`,action:t.action,json_data:i};n.sendData(a)&&console.log(`Successfully sent JSON payload via WS for action: ${t.action}`)}catch(e){console.error(`Failed to parse or send uploaded JSON file:`,e)}},e.readAsText(i),r.value=``}};return(t,n)=>(B(),ms(`div`,ox,[H(`input`,{ref_key:`fileInput`,ref:r,type:`file`,class:`hidden`,accept:`.json`,onChange:a},null,544),U(I(oy),{type:`button`,onClick:i,variant:`secondary`},{default:L(()=>[Cs(Ce(e.text),1)]),_:1})]))}}),cx={key:1,class:`button-container`},lx={key:2,class:`slider-container`},ux={key:0,class:`slider-value`},dx={key:3,class:`number-field-container`},fx={key:4,class:`load-json-button-container`},px={key:5,class:`checkbox-ui-component`},mx={key:0},hx={key:6,class:`select-container`},gx=$y(R({__name:`Openbar`,setup(e){let t=F(!0),n=F(null),r=ay(),{sidebarComponents:i,theme:a,blockPicker:o}=r.store,s=(e,t)=>r.handleUiAction(e,t);function c(){t.value=!t.value}nb({q:c});let{isHovered:l}=qy(n),u=W(()=>t.value);return br(()=>{o.value=l.value&&u.value}),(e,r)=>(B(),ms(is,null,[H(`div`,{ref_key:`openbarElement`,ref:n,id:`openbar`,class:he([`fixed-openbar theme`,{"is-hidden":!t.value}])},[(B(!0),ms(is,null,da(I(i),e=>(B(),ms(`div`,{key:e.id,class:`dynamic-item`},[e.label?(B(),ms(`label`,{key:0,class:he([`dynamic-label`,{dark:I(a).value===`dark`}])},Ce(e.label),3)):Ts(``,!0),e.component===`Button`?(B(),ms(`div`,cx,[U(I(oy),{variant:`secondary`,onClick:t=>s(e.action)},{default:L(()=>[Cs(Ce(e.props.text),1)]),_:2},1032,[`onClick`])])):e.component===`Slider`?(B(),ms(`div`,lx,[U(I($b),{min:e.props.min,max:e.props.max,step:e.props.step,"default-value":e.props.defaultValue,modelValue:e.props.defaultValue,"onUpdate:modelValue":[t=>e.props.defaultValue=t,t=>s(e.action,t?.[0])],class:`w-[80%]`},null,8,[`min`,`max`,`step`,`default-value`,`modelValue`,`onUpdate:modelValue`]),e.props.defaultValue?(B(),ms(`span`,ux,Ce(e.props.defaultValue[0]),1)):Ts(``,!0)])):e.component===`NumberField`?(B(),ms(`div`,dx,[U(I(ex),{min:e.props.min,max:e.props.max,step:e.props.step,"default-value":e.props.value,modelValue:e.props.value,"onUpdate:modelValue":[t=>e.props.value=t,t=>s(e.action,t)],class:`w-full`},{default:L(()=>[U(I(tx),null,{default:L(()=>[U(I(nx)),U(I(ix)),U(I(rx))]),_:1})]),_:1},8,[`min`,`max`,`step`,`default-value`,`modelValue`,`onUpdate:modelValue`])])):e.component===`LoadJsonButton`?(B(),ms(`div`,fx,[U(sx,{text:e.props.text,action:e.action},null,8,[`text`,`action`])])):e.component===`Checkbox`?(B(),ms(`div`,px,[U(I(ax),{id:`checkbox-${e.id}`,"model-value":!!e.props.defaultValue,"onUpdate:modelValue":t=>{e.props.defaultValue=!!t,s(e.action,t)}},null,8,[`id`,`model-value`,`onUpdate:modelValue`]),e.props.text?(B(),ms(`span`,mx,Ce(e.props.text),1)):Ts(``,!0)])):e.component===`Select`?(B(),ms(`div`,hx,[U(I(cy),{"model-value":e.props.defaultValue??``,"onUpdate:modelValue":t=>{e.props.defaultValue=typeof t==`string`?t:``,s(e.action,t)}},{default:L(()=>[U(I(Gy),{class:`w-full`},{default:L(()=>[U(I(Ky),{placeholder:e.props.placeholder??`Select an option`},null,8,[`placeholder`])]),_:2},1024),U(I(ly),{class:`z-[4000]`},{default:L(()=>[(B(!0),ms(is,null,da(e.props.options,e=>(B(),V(I(Hy),{key:e,value:e},{default:L(()=>[Cs(Ce(e),1)]),_:2},1032,[`value`]))),128))]),_:2},1024)]),_:2},1032,[`model-value`,`onUpdate:modelValue`])])):Ts(``,!0)]))),128)),U(I(oy),{variant:`secondary`,size:`icon`,class:`mb-4`,onClick:r[0]||=e=>c()},{default:L(()=>[U(I(yy))]),_:1})],2),U(I(oy),{variant:`secondary`,size:`icon`,class:he([`mb-5`,{"is-hidden":!t.value}]),onClick:r[1]||=e=>c()},{default:L(()=>[U(I(by))]),_:1},8,[`class`])],64))}}),[[`__scopeId`,`data-v-a83066fb`]]),_x={id:`sidebar`},vx=$y(R({__name:`Sidebar`,props:{showToolbar:{type:Boolean,default:!0}},setup(e){let{sideBarInfoState:t}=ay().store;return(n,r)=>(B(),ms(`div`,_x,[e.showToolbar?(B(),V(Qb,{key:0})):Ts(``,!0),I(t).isVisible?(B(),V(gx,{key:1})):Ts(``,!0)]))}}),[[`__scopeId`,`data-v-1cbddba3`]]),yx={key:0,class:`theme-indicator`,"aria-hidden":`true`},bx=$y(R({__name:`ThemeIndicator`,setup(e){let{theme:t}=ay().store,n=F(!1),r=F(t.value),i=null,a=!0;function o(e){r.value=e,n.value=!0,i&&window.clearTimeout(i),i=window.setTimeout(()=>{n.value=!1,i=null},900)}let s=Cr(()=>t.value,e=>{if(a){r.value=e,a=!1;return}e!==r.value&&o(e)},{immediate:!0});return Zi(()=>{i&&=(window.clearTimeout(i),null),s()}),Ji(()=>{}),(e,t)=>(B(),V(wc,{name:`theme-indicator`},{default:L(()=>[n.value?(B(),ms(`div`,yx,[r.value===`dark`?(B(),V(I(Ay),{key:0,class:`theme-indicator-icon`})):(B(),V(I(zy),{key:1,class:`theme-indicator-icon`}))])):Ts(``,!0)]),_:1}))}}),[[`__scopeId`,`data-v-ebb8d4d4`]]),xx=$y(R({__name:`App`,props:{runtime:{},showToolbar:{type:Boolean,default:!0}},setup(e){let t=F(null),n=e,{theme:r}=n.runtime.store;return Ji(()=>{t.value&&n.runtime.attach(t.value)}),(e,i)=>(B(),ms(`div`,{class:he([`app-container`,{dark:I(r).value===`dark`}])},[U(vx,{"show-toolbar":n.showToolbar},null,8,[`show-toolbar`]),H(`div`,{ref_key:`threeContainer`,ref:t,class:`three-container`},null,512),U(bx),U(eb)],2))}}),[[`__scopeId`,`data-v-dc8ca966`]]);function Sx(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}var wx=4294967296;function Tx(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(t,a){let o=Number(e.slice(t,a));i*=n,r=r*n+o,r>=wx&&(i+=r/wx|0,r%=wx)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?Ax(r,i):kx(r,i)}function Ex(e,t){let n=kx(e,t),r=n.hi&2147483648;r&&(n=Ax(n.lo,n.hi));let i=Dx(n.lo,n.hi);return r?`-`+i:i}function Dx(e,t){if({lo:e,hi:t}=Ox(e,t),t<=2097151)return String(wx*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+jx(o)+jx(a)}function Ox(e,t){return{lo:e>>>0,hi:t>>>0}}function kx(e,t){return{lo:e|0,hi:t|0}}function Ax(e,t){return t=~t,e?e=~e+1:t+=1,kx(e,t)}var jx=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function Mx(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}function Nx(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var Px=Fx();function Fx(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||t>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Ux(e);e>127;)this.buf.push(e&127|128),e>>>=7;return this.buf.push(e),this}int32(e){return Hx(e),Mx(e,this.buf),this}bool(e){return this.buf.push(+!!e),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){Wx(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){Ux(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){Hx(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return Hx(e),e=(e<<1^e>>31)>>>0,Mx(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=Px.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=Px.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=Px.enc(e);return Cx(t.lo,t.hi,this.buf),this}sint64(e){let t=Px.enc(e),n=t.hi>>31;return Cx(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){let t=Px.uEnc(e);return Cx(t.lo,t.hi,this.buf),this}},q=class{constructor(e,t=zx().decodeUtf8){this.decodeUtf8=t,this.varint64=Sx,this.uint32=Nx,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case Bx.Varint:for(;this.buf[this.pos++]&128;);break;case Bx.Bit64:this.pos+=4;case Bx.Bit32:this.pos+=4;break;case Bx.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Bx.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===Bx.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Px.dec(...this.varint64())}uint64(){return Px.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,Px.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Px.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Px.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){return this.decodeUtf8(this.bytes(),e)}};function Hx(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function Ux(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function Wx(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}function Gx(){return{typeUrl:``,value:new Uint8Array}}var Kx={encode(e,t=new Vx){return e.typeUrl!==``&&t.uint32(10).string(e.typeUrl),e.value.length!==0&&t.uint32(18).bytes(e.value),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=Gx();for(;n.pos>>3){case 1:if(e!==10)break;i.typeUrl=n.string();continue;case 2:if(e!==18)break;i.value=n.bytes();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{typeUrl:Yx(e.typeUrl)?globalThis.String(e.typeUrl):Yx(e.type_url)?globalThis.String(e.type_url):``,value:Yx(e.value)?qx(e.value):new Uint8Array}},toJSON(e){let t={};return e.typeUrl!==``&&(t.typeUrl=e.typeUrl),e.value.length!==0&&(t.value=Jx(e.value)),t},create(e){return Kx.fromPartial(e??{})},fromPartial(e){let t=Gx();return t.typeUrl=e.typeUrl??``,t.value=e.value??new Uint8Array,t}};function qx(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,`base64`));{let t=globalThis.atob(e),n=new Uint8Array(t.length);for(let e=0;e{t.push(globalThis.String.fromCharCode(e))}),globalThis.btoa(t.join(``))}}function Yx(e){return e!=null}var Xx=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Zx(e){switch(e){case 0:case`NULL_VALUE`:return Xx.NULL_VALUE;default:return Xx.UNRECOGNIZED}}function Qx(e){switch(e){case Xx.NULL_VALUE:return`NULL_VALUE`;case Xx.UNRECOGNIZED:default:return`UNRECOGNIZED`}}function $x(){return{fields:{}}}var eS={encode(e,t=new Vx){return globalThis.Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&nS.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=$x();for(;n.pos>>3){case 1:{if(e!==10)break;let t=nS.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{fields:sS(e.fields)?globalThis.Object.entries(e.fields).reduce((e,[t,n])=>(e[t]=n,e),{}):{}}},toJSON(e){let t={};if(e.fields){let n=globalThis.Object.entries(e.fields);n.length>0&&(t.fields={},n.forEach(([e,n])=>{t.fields[e]=n}))}return t},create(e){return eS.fromPartial(e??{})},fromPartial(e){let t=$x();return t.fields=globalThis.Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=$x();if(e!==void 0)for(let n of globalThis.Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of globalThis.Object.keys(e.fields))t[n]=e.fields[n];return t}};function tS(){return{key:``,value:void 0}}var nS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&iS.encode(iS.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=tS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=iS.unwrap(iS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:cS(e.key)?globalThis.String(e.key):``,value:cS(e?.value)?e.value:void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return nS.fromPartial(e??{})},fromPartial(e){let t=tS();return t.key=e.key??``,t.value=e.value??void 0,t}};function rS(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var iS={encode(e,t=new Vx){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&eS.encode(eS.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&oS.encode(oS.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=rS();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=eS.unwrap(eS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=oS.unwrap(oS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{nullValue:cS(e.nullValue)?Zx(e.nullValue):cS(e.null_value)?Zx(e.null_value):void 0,numberValue:cS(e.numberValue)?globalThis.Number(e.numberValue):cS(e.number_value)?globalThis.Number(e.number_value):void 0,stringValue:cS(e.stringValue)?globalThis.String(e.stringValue):cS(e.string_value)?globalThis.String(e.string_value):void 0,boolValue:cS(e.boolValue)?globalThis.Boolean(e.boolValue):cS(e.bool_value)?globalThis.Boolean(e.bool_value):void 0,structValue:sS(e.structValue)?e.structValue:sS(e.struct_value)?e.struct_value:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:globalThis.Array.isArray(e.list_value)?[...e.list_value]:void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=Qx(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return iS.fromPartial(e??{})},fromPartial(e){let t=rS();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=rS();if(e===null)t.nullValue=Xx.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function aS(){return{values:[]}}var oS={encode(e,t=new Vx){for(let n of e.values)iS.encode(iS.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=aS();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(iS.unwrap(iS.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values),t},create(e){return oS.fromPartial(e??{})},fromPartial(e){let t=aS();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=aS();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}};function sS(e){return typeof e==`object`&&!!e}function cS(e){return e!=null}function lS(){return{message:void 0,value:void 0,fallback:void 0,intValue:void 0,doubleValue:void 0,dictValue:void 0,listValue:void 0}}var J={encode(e,t=new Vx){return e.message!==void 0&&Kx.encode(e.message,t.uint32(10).fork()).join(),e.value!==void 0&&iS.encode(iS.wrap(e.value),t.uint32(18).fork()).join(),e.fallback!==void 0&&dS.encode(e.fallback,t.uint32(26).fork()).join(),e.intValue!==void 0&&t.uint32(32).int64(e.intValue),e.doubleValue!==void 0&&t.uint32(41).double(e.doubleValue),e.dictValue!==void 0&&hS.encode(e.dictValue,t.uint32(50).fork()).join(),e.listValue!==void 0&&pS.encode(e.listValue,t.uint32(58).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=lS();for(;n.pos>>3){case 1:if(e!==10)break;i.message=Kx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.value=iS.unwrap(iS.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.fallback=dS.decode(n,n.uint32());continue;case 4:if(e!==32)break;i.intValue=bS(n.int64());continue;case 5:if(e!==41)break;i.doubleValue=n.double();continue;case 6:if(e!==50)break;i.dictValue=hS.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.listValue=pS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{message:SS(e.message)?Kx.fromJSON(e.message):void 0,value:SS(e?.value)?e.value:void 0,fallback:SS(e.fallback)?dS.fromJSON(e.fallback):void 0,intValue:SS(e.intValue)?globalThis.Number(e.intValue):SS(e.int_value)?globalThis.Number(e.int_value):void 0,doubleValue:SS(e.doubleValue)?globalThis.Number(e.doubleValue):SS(e.double_value)?globalThis.Number(e.double_value):void 0,dictValue:SS(e.dictValue)?hS.fromJSON(e.dictValue):SS(e.dict_value)?hS.fromJSON(e.dict_value):void 0,listValue:SS(e.listValue)?pS.fromJSON(e.listValue):SS(e.list_value)?pS.fromJSON(e.list_value):void 0}},toJSON(e){let t={};return e.message!==void 0&&(t.message=Kx.toJSON(e.message)),e.value!==void 0&&(t.value=e.value),e.fallback!==void 0&&(t.fallback=dS.toJSON(e.fallback)),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.dictValue!==void 0&&(t.dictValue=hS.toJSON(e.dictValue)),e.listValue!==void 0&&(t.listValue=pS.toJSON(e.listValue)),t},create(e){return J.fromPartial(e??{})},fromPartial(e){let t=lS();return t.message=e.message!==void 0&&e.message!==null?Kx.fromPartial(e.message):void 0,t.value=e.value??void 0,t.fallback=e.fallback!==void 0&&e.fallback!==null?dS.fromPartial(e.fallback):void 0,t.intValue=e.intValue??void 0,t.doubleValue=e.doubleValue??void 0,t.dictValue=e.dictValue!==void 0&&e.dictValue!==null?hS.fromPartial(e.dictValue):void 0,t.listValue=e.listValue!==void 0&&e.listValue!==null?pS.fromPartial(e.listValue):void 0,t}};function uS(){return{data:void 0}}var dS={encode(e,t=new Vx){return e.data!==void 0&&hS.encode(e.data,t.uint32(10).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=uS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=hS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{data:SS(e.data)?hS.fromJSON(e.data):void 0}},toJSON(e){let t={};return e.data!==void 0&&(t.data=hS.toJSON(e.data)),t},create(e){return dS.fromPartial(e??{})},fromPartial(e){let t=uS();return t.data=e.data!==void 0&&e.data!==null?hS.fromPartial(e.data):void 0,t}};function fS(){return{items:[]}}var pS={encode(e,t=new Vx){for(let n of e.items)J.encode(n,t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=fS();for(;n.pos>>3){case 1:if(e!==10)break;i.items.push(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{items:globalThis.Array.isArray(e?.items)?e.items.map(e=>J.fromJSON(e)):[]}},toJSON(e){let t={};return e.items?.length&&(t.items=e.items.map(e=>J.toJSON(e))),t},create(e){return pS.fromPartial(e??{})},fromPartial(e){let t=fS();return t.items=e.items?.map(e=>J.fromPartial(e))||[],t}};function mS(){return{items:{}}}var hS={encode(e,t=new Vx){return globalThis.Object.entries(e.items).forEach(([e,n])=>{_S.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=mS();for(;n.pos>>3){case 1:{if(e!==10)break;let t=_S.decode(n,n.uint32());t.value!==void 0&&(i.items[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{items:xS(e.items)?globalThis.Object.entries(e.items).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{}}},toJSON(e){let t={};if(e.items){let n=globalThis.Object.entries(e.items);n.length>0&&(t.items={},n.forEach(([e,n])=>{t.items[e]=J.toJSON(n)}))}return t},create(e){return hS.fromPartial(e??{})},fromPartial(e){let t=mS();return t.items=globalThis.Object.entries(e.items??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t}};function gS(){return{key:``,value:void 0}}var _S={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=gS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:SS(e.key)?globalThis.String(e.key):``,value:SS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return _S.fromPartial(e??{})},fromPartial(e){let t=gS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function vS(){return{data:void 0,version:void 0}}var yS={encode(e,t=new Vx){return e.data!==void 0&&J.encode(e.data,t.uint32(10).fork()).join(),e.version!==void 0&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=vS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=J.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{data:SS(e.data)?J.fromJSON(e.data):void 0,version:SS(e.version)?globalThis.String(e.version):void 0}},toJSON(e){let t={};return e.data!==void 0&&(t.data=J.toJSON(e.data)),e.version!==void 0&&(t.version=e.version),t},create(e){return yS.fromPartial(e??{})},fromPartial(e){let t=vS();return t.data=e.data!==void 0&&e.data!==null?J.fromPartial(e.data):void 0,t.version=e.version??void 0,t}};function bS(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(t>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e===16){i.indices.push(n.uint32());continue}if(e===18){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],kind:YS(e.kind)?globalThis.Number(e.kind):0,doubles:globalThis.Array.isArray(e?.doubles)?e.doubles.map(e=>globalThis.Number(e)):[],ints:globalThis.Array.isArray(e?.ints)?e.ints.map(e=>globalThis.Number(e)):[],bools:globalThis.Array.isArray(e?.bools)?e.bools.map(e=>globalThis.Boolean(e)):[],values:globalThis.Array.isArray(e?.values)?e.values.map(e=>J.fromJSON(e)):[]}},toJSON(e){let t={};return e.name!==``&&(t.name=e.name),e.indices?.length&&(t.indices=e.indices.map(e=>Math.round(e))),e.kind!==0&&(t.kind=Math.round(e.kind)),e.doubles?.length&&(t.doubles=e.doubles),e.ints?.length&&(t.ints=e.ints.map(e=>Math.round(e))),e.bools?.length&&(t.bools=e.bools),e.values?.length&&(t.values=e.values.map(e=>J.toJSON(e))),t},create(e){return wS.fromPartial(e??{})},fromPartial(e){let t=CS();return t.name=e.name??``,t.indices=e.indices?.map(e=>e)||[],t.kind=e.kind??0,t.doubles=e.doubles?.map(e=>e)||[],t.ints=e.ints?.map(e=>e)||[],t.bools=e.bools?.map(e=>e)||[],t.values=e.values?.map(e=>J.fromPartial(e))||[],t}};function TS(){return{guid:void 0,name:void 0,vertices:[],faceVertices:[],faceSizes:[],attributes:{},vertexAttributeColumns:[],faceAttributeColumns:[],edgeAttributeColumns:[],edgeKeys:[],defaultVertexAttributes:{},defaultFaceAttributes:{},defaultEdgeAttributes:{}}}var ES={encode(e,t=new Vx){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.vertices)t.double(n);t.join(),t.uint32(34).fork();for(let n of e.faceVertices)t.uint32(n);t.join(),t.uint32(98).fork();for(let n of e.faceSizes)t.uint32(n);t.join(),globalThis.Object.entries(e.attributes).forEach(([e,n])=>{OS.encode({key:e,value:n},t.uint32(42).fork()).join()});for(let n of e.vertexAttributeColumns)wS.encode(n,t.uint32(50).fork()).join();for(let n of e.faceAttributeColumns)wS.encode(n,t.uint32(58).fork()).join();for(let n of e.edgeAttributeColumns)wS.encode(n,t.uint32(66).fork()).join();for(let n of e.edgeKeys)J.encode(n,t.uint32(106).fork()).join();return globalThis.Object.entries(e.defaultVertexAttributes).forEach(([e,n])=>{AS.encode({key:e,value:n},t.uint32(74).fork()).join()}),globalThis.Object.entries(e.defaultFaceAttributes).forEach(([e,n])=>{MS.encode({key:e,value:n},t.uint32(82).fork()).join()}),globalThis.Object.entries(e.defaultEdgeAttributes).forEach(([e,n])=>{PS.encode({key:e,value:n},t.uint32(90).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=TS();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.vertices.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],faceVertices:globalThis.Array.isArray(e?.faceVertices)?e.faceVertices.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.face_vertices)?e.face_vertices.map(e=>globalThis.Number(e)):[],faceSizes:globalThis.Array.isArray(e?.faceSizes)?e.faceSizes.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.face_sizes)?e.face_sizes.map(e=>globalThis.Number(e)):[],attributes:JS(e.attributes)?globalThis.Object.entries(e.attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},vertexAttributeColumns:globalThis.Array.isArray(e?.vertexAttributeColumns)?e.vertexAttributeColumns.map(e=>wS.fromJSON(e)):globalThis.Array.isArray(e?.vertex_attribute_columns)?e.vertex_attribute_columns.map(e=>wS.fromJSON(e)):[],faceAttributeColumns:globalThis.Array.isArray(e?.faceAttributeColumns)?e.faceAttributeColumns.map(e=>wS.fromJSON(e)):globalThis.Array.isArray(e?.face_attribute_columns)?e.face_attribute_columns.map(e=>wS.fromJSON(e)):[],edgeAttributeColumns:globalThis.Array.isArray(e?.edgeAttributeColumns)?e.edgeAttributeColumns.map(e=>wS.fromJSON(e)):globalThis.Array.isArray(e?.edge_attribute_columns)?e.edge_attribute_columns.map(e=>wS.fromJSON(e)):[],edgeKeys:globalThis.Array.isArray(e?.edgeKeys)?e.edgeKeys.map(e=>J.fromJSON(e)):globalThis.Array.isArray(e?.edge_keys)?e.edge_keys.map(e=>J.fromJSON(e)):[],defaultVertexAttributes:JS(e.defaultVertexAttributes)?globalThis.Object.entries(e.defaultVertexAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):JS(e.default_vertex_attributes)?globalThis.Object.entries(e.default_vertex_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultFaceAttributes:JS(e.defaultFaceAttributes)?globalThis.Object.entries(e.defaultFaceAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):JS(e.default_face_attributes)?globalThis.Object.entries(e.default_face_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultEdgeAttributes:JS(e.defaultEdgeAttributes)?globalThis.Object.entries(e.defaultEdgeAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):JS(e.default_edge_attributes)?globalThis.Object.entries(e.default_edge_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{}}},toJSON(e){let t={};if(e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.vertices?.length&&(t.vertices=e.vertices),e.faceVertices?.length&&(t.faceVertices=e.faceVertices.map(e=>Math.round(e))),e.faceSizes?.length&&(t.faceSizes=e.faceSizes.map(e=>Math.round(e))),e.attributes){let n=globalThis.Object.entries(e.attributes);n.length>0&&(t.attributes={},n.forEach(([e,n])=>{t.attributes[e]=J.toJSON(n)}))}if(e.vertexAttributeColumns?.length&&(t.vertexAttributeColumns=e.vertexAttributeColumns.map(e=>wS.toJSON(e))),e.faceAttributeColumns?.length&&(t.faceAttributeColumns=e.faceAttributeColumns.map(e=>wS.toJSON(e))),e.edgeAttributeColumns?.length&&(t.edgeAttributeColumns=e.edgeAttributeColumns.map(e=>wS.toJSON(e))),e.edgeKeys?.length&&(t.edgeKeys=e.edgeKeys.map(e=>J.toJSON(e))),e.defaultVertexAttributes){let n=globalThis.Object.entries(e.defaultVertexAttributes);n.length>0&&(t.defaultVertexAttributes={},n.forEach(([e,n])=>{t.defaultVertexAttributes[e]=J.toJSON(n)}))}if(e.defaultFaceAttributes){let n=globalThis.Object.entries(e.defaultFaceAttributes);n.length>0&&(t.defaultFaceAttributes={},n.forEach(([e,n])=>{t.defaultFaceAttributes[e]=J.toJSON(n)}))}if(e.defaultEdgeAttributes){let n=globalThis.Object.entries(e.defaultEdgeAttributes);n.length>0&&(t.defaultEdgeAttributes={},n.forEach(([e,n])=>{t.defaultEdgeAttributes[e]=J.toJSON(n)}))}return t},create(e){return ES.fromPartial(e??{})},fromPartial(e){let t=TS();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.vertices=e.vertices?.map(e=>e)||[],t.faceVertices=e.faceVertices?.map(e=>e)||[],t.faceSizes=e.faceSizes?.map(e=>e)||[],t.attributes=globalThis.Object.entries(e.attributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.vertexAttributeColumns=e.vertexAttributeColumns?.map(e=>wS.fromPartial(e))||[],t.faceAttributeColumns=e.faceAttributeColumns?.map(e=>wS.fromPartial(e))||[],t.edgeAttributeColumns=e.edgeAttributeColumns?.map(e=>wS.fromPartial(e))||[],t.edgeKeys=e.edgeKeys?.map(e=>J.fromPartial(e))||[],t.defaultVertexAttributes=globalThis.Object.entries(e.defaultVertexAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultFaceAttributes=globalThis.Object.entries(e.defaultFaceAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultEdgeAttributes=globalThis.Object.entries(e.defaultEdgeAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t}};function DS(){return{key:``,value:void 0}}var OS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=DS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return OS.fromPartial(e??{})},fromPartial(e){let t=DS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function kS(){return{key:``,value:void 0}}var AS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=kS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return AS.fromPartial(e??{})},fromPartial(e){let t=kS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function jS(){return{key:``,value:void 0}}var MS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=jS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return MS.fromPartial(e??{})},fromPartial(e){let t=jS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function NS(){return{key:``,value:void 0}}var PS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=NS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return PS.fromPartial(e??{})},fromPartial(e){let t=NS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function FS(){return{vertexIndices:[]}}var IS={encode(e,t=new Vx){t.uint32(10).fork();for(let n of e.vertexIndices)t.int32(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=FS();for(;n.pos>>3==1){if(e===8){i.vertexIndices.push(n.int32());continue}if(e===10){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):globalThis.Array.isArray(e?.vertex_indices)?e.vertex_indices.map(e=>globalThis.Number(e)):[]}},toJSON(e){let t={};return e.vertexIndices?.length&&(t.vertexIndices=e.vertexIndices.map(e=>Math.round(e))),t},create(e){return IS.fromPartial(e??{})},fromPartial(e){let t=FS();return t.vertexIndices=e.vertexIndices?.map(e=>e)||[],t}};function LS(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}var RS={encode(e,t=new Vx){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.vertices)t.double(n);t.join();for(let n of e.faces)IS.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=LS();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.vertices.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],faces:globalThis.Array.isArray(e?.faces)?e.faces.map(e=>IS.fromJSON(e)):[]}},toJSON(e){let t={};return e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.vertices?.length&&(t.vertices=e.vertices),e.faces?.length&&(t.faces=e.faces.map(e=>IS.toJSON(e))),t},create(e){return RS.fromPartial(e??{})},fromPartial(e){let t=LS();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.vertices=e.vertices?.map(e=>e)||[],t.faces=e.faces?.map(e=>IS.fromPartial(e))||[],t}};function zS(){return{guid:void 0,name:void 0,nodeKeys:[],nodeAttributes:[],attributes:{},defaultNodeAttributes:{},defaultEdgeAttributes:{},edgeU:[],edgeV:[],edgeAttributes:[]}}var BS={encode(e,t=new Vx){e.guid!==void 0&&t.uint32(10).string(e.guid),e.name!==void 0&&t.uint32(18).string(e.name);for(let n of e.nodeKeys)J.encode(n,t.uint32(26).fork()).join();for(let n of e.nodeAttributes)wS.encode(n,t.uint32(34).fork()).join();globalThis.Object.entries(e.attributes).forEach(([e,n])=>{HS.encode({key:e,value:n},t.uint32(42).fork()).join()}),globalThis.Object.entries(e.defaultNodeAttributes).forEach(([e,n])=>{WS.encode({key:e,value:n},t.uint32(50).fork()).join()}),globalThis.Object.entries(e.defaultEdgeAttributes).forEach(([e,n])=>{KS.encode({key:e,value:n},t.uint32(58).fork()).join()}),t.uint32(66).fork();for(let n of e.edgeU)t.uint32(n);t.join(),t.uint32(74).fork();for(let n of e.edgeV)t.uint32(n);t.join();for(let n of e.edgeAttributes)wS.encode(n,t.uint32(82).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=zS();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.nodeKeys.push(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.nodeAttributes.push(wS.decode(n,n.uint32()));continue;case 5:{if(e!==42)break;let t=HS.decode(n,n.uint32());t.value!==void 0&&(i.attributes[t.key]=t.value);continue}case 6:{if(e!==50)break;let t=WS.decode(n,n.uint32());t.value!==void 0&&(i.defaultNodeAttributes[t.key]=t.value);continue}case 7:{if(e!==58)break;let t=KS.decode(n,n.uint32());t.value!==void 0&&(i.defaultEdgeAttributes[t.key]=t.value);continue}case 8:if(e===64){i.edgeU.push(n.uint32());continue}if(e===66){let e=n.uint32()+n.pos;for(;n.posJ.fromJSON(e)):globalThis.Array.isArray(e?.node_keys)?e.node_keys.map(e=>J.fromJSON(e)):[],nodeAttributes:globalThis.Array.isArray(e?.nodeAttributes)?e.nodeAttributes.map(e=>wS.fromJSON(e)):globalThis.Array.isArray(e?.node_attributes)?e.node_attributes.map(e=>wS.fromJSON(e)):[],attributes:JS(e.attributes)?globalThis.Object.entries(e.attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultNodeAttributes:JS(e.defaultNodeAttributes)?globalThis.Object.entries(e.defaultNodeAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):JS(e.default_node_attributes)?globalThis.Object.entries(e.default_node_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},defaultEdgeAttributes:JS(e.defaultEdgeAttributes)?globalThis.Object.entries(e.defaultEdgeAttributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):JS(e.default_edge_attributes)?globalThis.Object.entries(e.default_edge_attributes).reduce((e,[t,n])=>(e[t]=J.fromJSON(n),e),{}):{},edgeU:globalThis.Array.isArray(e?.edgeU)?e.edgeU.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.edge_u)?e.edge_u.map(e=>globalThis.Number(e)):[],edgeV:globalThis.Array.isArray(e?.edgeV)?e.edgeV.map(e=>globalThis.Number(e)):globalThis.Array.isArray(e?.edge_v)?e.edge_v.map(e=>globalThis.Number(e)):[],edgeAttributes:globalThis.Array.isArray(e?.edgeAttributes)?e.edgeAttributes.map(e=>wS.fromJSON(e)):globalThis.Array.isArray(e?.edge_attributes)?e.edge_attributes.map(e=>wS.fromJSON(e)):[]}},toJSON(e){let t={};if(e.guid!==void 0&&(t.guid=e.guid),e.name!==void 0&&(t.name=e.name),e.nodeKeys?.length&&(t.nodeKeys=e.nodeKeys.map(e=>J.toJSON(e))),e.nodeAttributes?.length&&(t.nodeAttributes=e.nodeAttributes.map(e=>wS.toJSON(e))),e.attributes){let n=globalThis.Object.entries(e.attributes);n.length>0&&(t.attributes={},n.forEach(([e,n])=>{t.attributes[e]=J.toJSON(n)}))}if(e.defaultNodeAttributes){let n=globalThis.Object.entries(e.defaultNodeAttributes);n.length>0&&(t.defaultNodeAttributes={},n.forEach(([e,n])=>{t.defaultNodeAttributes[e]=J.toJSON(n)}))}if(e.defaultEdgeAttributes){let n=globalThis.Object.entries(e.defaultEdgeAttributes);n.length>0&&(t.defaultEdgeAttributes={},n.forEach(([e,n])=>{t.defaultEdgeAttributes[e]=J.toJSON(n)}))}return e.edgeU?.length&&(t.edgeU=e.edgeU.map(e=>Math.round(e))),e.edgeV?.length&&(t.edgeV=e.edgeV.map(e=>Math.round(e))),e.edgeAttributes?.length&&(t.edgeAttributes=e.edgeAttributes.map(e=>wS.toJSON(e))),t},create(e){return BS.fromPartial(e??{})},fromPartial(e){let t=zS();return t.guid=e.guid??void 0,t.name=e.name??void 0,t.nodeKeys=e.nodeKeys?.map(e=>J.fromPartial(e))||[],t.nodeAttributes=e.nodeAttributes?.map(e=>wS.fromPartial(e))||[],t.attributes=globalThis.Object.entries(e.attributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultNodeAttributes=globalThis.Object.entries(e.defaultNodeAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.defaultEdgeAttributes=globalThis.Object.entries(e.defaultEdgeAttributes??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=J.fromPartial(n)),e),{}),t.edgeU=e.edgeU?.map(e=>e)||[],t.edgeV=e.edgeV?.map(e=>e)||[],t.edgeAttributes=e.edgeAttributes?.map(e=>wS.fromPartial(e))||[],t}};function VS(){return{key:``,value:void 0}}var HS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=VS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return HS.fromPartial(e??{})},fromPartial(e){let t=VS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function US(){return{key:``,value:void 0}}var WS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=US();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return WS.fromPartial(e??{})},fromPartial(e){let t=US();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function GS(){return{key:``,value:void 0}}var KS={encode(e,t=new Vx){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(e.value,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=GS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{key:YS(e.key)?globalThis.String(e.key):``,value:YS(e.value)?J.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=J.toJSON(e.value)),t},create(e){return KS.fromPartial(e??{})},fromPartial(e){let t=GS();return t.key=e.key??``,t.value=e.value!==void 0&&e.value!==null?J.fromPartial(e.value):void 0,t}};function qS(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(t>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.x=n.double();continue;case 4:if(e!==33)break;i.y=n.double();continue;case 5:if(e!==41)break;i.z=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,x:Y(e.x)?globalThis.Number(e.x):0,y:Y(e.y)?globalThis.Number(e.y):0,z:Y(e.z)?globalThis.Number(e.z):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return ZS.fromPartial(e??{})},fromPartial(e){let t=XS();return t.guid=e.guid??``,t.name=e.name??``,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function QS(){return{guid:``,name:``,x:0,y:0,z:0}}var $S={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.x!==0&&t.uint32(25).double(e.x),e.y!==0&&t.uint32(33).double(e.y),e.z!==0&&t.uint32(41).double(e.z),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=QS();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.x=n.double();continue;case 4:if(e!==33)break;i.y=n.double();continue;case 5:if(e!==41)break;i.z=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,x:Y(e.x)?globalThis.Number(e.x):0,y:Y(e.y)?globalThis.Number(e.y):0,z:Y(e.z)?globalThis.Number(e.z):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return $S.fromPartial(e??{})},fromPartial(e){let t=QS();return t.guid=e.guid??``,t.name=e.name??``,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function eC(){return{guid:``,name:``,point:void 0,xaxis:void 0,yaxis:void 0}}var tC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.point!==void 0&&ZS.encode(e.point,t.uint32(26).fork()).join(),e.xaxis!==void 0&&$S.encode(e.xaxis,t.uint32(34).fork()).join(),e.yaxis!==void 0&&$S.encode(e.yaxis,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=eC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.point=ZS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.xaxis=$S.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.yaxis=$S.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,point:Y(e.point)?ZS.fromJSON(e.point):void 0,xaxis:Y(e.xaxis)?$S.fromJSON(e.xaxis):void 0,yaxis:Y(e.yaxis)?$S.fromJSON(e.yaxis):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.point!==void 0&&(t.point=ZS.toJSON(e.point)),e.xaxis!==void 0&&(t.xaxis=$S.toJSON(e.xaxis)),e.yaxis!==void 0&&(t.yaxis=$S.toJSON(e.yaxis)),t},create(e){return tC.fromPartial(e??{})},fromPartial(e){let t=eC();return t.guid=e.guid??``,t.name=e.name??``,t.point=e.point!==void 0&&e.point!==null?ZS.fromPartial(e.point):void 0,t.xaxis=e.xaxis!==void 0&&e.xaxis!==null?$S.fromPartial(e.xaxis):void 0,t.yaxis=e.yaxis!==void 0&&e.yaxis!==null?$S.fromPartial(e.yaxis):void 0,t}};function nC(){return{guid:``,name:``,point:void 0,normal:void 0}}var rC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.point!==void 0&&ZS.encode(e.point,t.uint32(26).fork()).join(),e.normal!==void 0&&$S.encode(e.normal,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=nC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.point=ZS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.normal=$S.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,point:Y(e.point)?ZS.fromJSON(e.point):void 0,normal:Y(e.normal)?$S.fromJSON(e.normal):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.point!==void 0&&(t.point=ZS.toJSON(e.point)),e.normal!==void 0&&(t.normal=$S.toJSON(e.normal)),t},create(e){return rC.fromPartial(e??{})},fromPartial(e){let t=nC();return t.guid=e.guid??``,t.name=e.name??``,t.point=e.point!==void 0&&e.point!==null?ZS.fromPartial(e.point):void 0,t.normal=e.normal!==void 0&&e.normal!==null?$S.fromPartial(e.normal):void 0,t}};function iC(){return{guid:``,name:``,w:0,x:0,y:0,z:0}}var aC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.w!==0&&t.uint32(25).double(e.w),e.x!==0&&t.uint32(33).double(e.x),e.y!==0&&t.uint32(41).double(e.y),e.z!==0&&t.uint32(49).double(e.z),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=iC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.w=n.double();continue;case 4:if(e!==33)break;i.x=n.double();continue;case 5:if(e!==41)break;i.y=n.double();continue;case 6:if(e!==49)break;i.z=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,w:Y(e.w)?globalThis.Number(e.w):0,x:Y(e.x)?globalThis.Number(e.x):0,y:Y(e.y)?globalThis.Number(e.y):0,z:Y(e.z)?globalThis.Number(e.z):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.w!==0&&(t.w=e.w),e.x!==0&&(t.x=e.x),e.y!==0&&(t.y=e.y),e.z!==0&&(t.z=e.z),t},create(e){return aC.fromPartial(e??{})},fromPartial(e){let t=iC();return t.guid=e.guid??``,t.name=e.name??``,t.w=e.w??0,t.x=e.x??0,t.y=e.y??0,t.z=e.z??0,t}};function oC(){return{guid:``,name:``,start:void 0,end:void 0}}var sC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.start!==void 0&&ZS.encode(e.start,t.uint32(26).fork()).join(),e.end!==void 0&&ZS.encode(e.end,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=oC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.start=ZS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.end=ZS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,start:Y(e.start)?ZS.fromJSON(e.start):void 0,end:Y(e.end)?ZS.fromJSON(e.end):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.start!==void 0&&(t.start=ZS.toJSON(e.start)),e.end!==void 0&&(t.end=ZS.toJSON(e.end)),t},create(e){return sC.fromPartial(e??{})},fromPartial(e){let t=oC();return t.guid=e.guid??``,t.name=e.name??``,t.start=e.start!==void 0&&e.start!==null?ZS.fromPartial(e.start):void 0,t.end=e.end!==void 0&&e.end!==null?ZS.fromPartial(e.end):void 0,t}};function cC(){return{guid:``,name:``,radius:0,frame:void 0}}var lC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.frame!==void 0&&tC.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=cC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==34)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return lC.fromPartial(e??{})},fromPartial(e){let t=cC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function uC(){return{guid:``,name:``,circle:void 0,startAngle:0,endAngle:0}}var dC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.circle!==void 0&&lC.encode(e.circle,t.uint32(26).fork()).join(),e.startAngle!==0&&t.uint32(33).double(e.startAngle),e.endAngle!==0&&t.uint32(41).double(e.endAngle),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=uC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.circle=lC.decode(n,n.uint32());continue;case 4:if(e!==33)break;i.startAngle=n.double();continue;case 5:if(e!==41)break;i.endAngle=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,circle:Y(e.circle)?lC.fromJSON(e.circle):void 0,startAngle:Y(e.startAngle)?globalThis.Number(e.startAngle):Y(e.start_angle)?globalThis.Number(e.start_angle):0,endAngle:Y(e.endAngle)?globalThis.Number(e.endAngle):Y(e.end_angle)?globalThis.Number(e.end_angle):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.circle!==void 0&&(t.circle=lC.toJSON(e.circle)),e.startAngle!==0&&(t.startAngle=e.startAngle),e.endAngle!==0&&(t.endAngle=e.endAngle),t},create(e){return dC.fromPartial(e??{})},fromPartial(e){let t=uC();return t.guid=e.guid??``,t.name=e.name??``,t.circle=e.circle!==void 0&&e.circle!==null?lC.fromPartial(e.circle):void 0,t.startAngle=e.startAngle??0,t.endAngle=e.endAngle??0,t}};function fC(){return{guid:``,name:``,major:0,minor:0,frame:void 0}}var pC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.major!==0&&t.uint32(25).double(e.major),e.minor!==0&&t.uint32(33).double(e.minor),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=fC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.major=n.double();continue;case 4:if(e!==33)break;i.minor=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,major:Y(e.major)?globalThis.Number(e.major):0,minor:Y(e.minor)?globalThis.Number(e.minor):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.major!==0&&(t.major=e.major),e.minor!==0&&(t.minor=e.minor),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return pC.fromPartial(e??{})},fromPartial(e){let t=fC();return t.guid=e.guid??``,t.name=e.name??``,t.major=e.major??0,t.minor=e.minor??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function mC(){return{guid:``,name:``,focal:0,frame:void 0}}var hC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.focal!==0&&t.uint32(25).double(e.focal),e.frame!==void 0&&tC.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=mC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.focal=n.double();continue;case 4:if(e!==34)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,focal:Y(e.focal)?globalThis.Number(e.focal):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.focal!==0&&(t.focal=e.focal),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return hC.fromPartial(e??{})},fromPartial(e){let t=mC();return t.guid=e.guid??``,t.name=e.name??``,t.focal=e.focal??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function gC(){return{guid:``,name:``,major:0,minor:0,frame:void 0}}var _C={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.major!==0&&t.uint32(25).double(e.major),e.minor!==0&&t.uint32(33).double(e.minor),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=gC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.major=n.double();continue;case 4:if(e!==33)break;i.minor=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,major:Y(e.major)?globalThis.Number(e.major):0,minor:Y(e.minor)?globalThis.Number(e.minor):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.major!==0&&(t.major=e.major),e.minor!==0&&(t.minor=e.minor),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return _C.fromPartial(e??{})},fromPartial(e){let t=gC();return t.guid=e.guid??``,t.name=e.name??``,t.major=e.major??0,t.minor=e.minor??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function vC(){return{guid:``,name:``,points:[],degree:0}}var yC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),e.degree!==0&&t.uint32(32).int32(e.degree),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=vC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[],degree:Y(e.degree)?globalThis.Number(e.degree):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),e.degree!==0&&(t.degree=Math.round(e.degree)),t},create(e){return yC.fromPartial(e??{})},fromPartial(e){let t=vC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t.degree=e.degree??0,t}};function bC(){return{guid:``,name:``,points:[]}}var xC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=bC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),t},create(e){return xC.fromPartial(e??{})},fromPartial(e){let t=bC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t}};function SC(){return{guid:``,name:``,points:[]}}var CC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=SC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),t},create(e){return CC.fromPartial(e??{})},fromPartial(e){let t=SC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t}};function wC(){return{guid:``,name:``,frame:void 0,xsize:0,ysize:0,zsize:0}}var TC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.frame!==void 0&&tC.encode(e.frame,t.uint32(26).fork()).join(),e.xsize!==0&&t.uint32(33).double(e.xsize),e.ysize!==0&&t.uint32(41).double(e.ysize),e.zsize!==0&&t.uint32(49).double(e.zsize),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=wC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.frame=tC.decode(n,n.uint32());continue;case 4:if(e!==33)break;i.xsize=n.double();continue;case 5:if(e!==41)break;i.ysize=n.double();continue;case 6:if(e!==49)break;i.zsize=n.double();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0,xsize:Y(e.xsize)?globalThis.Number(e.xsize):0,ysize:Y(e.ysize)?globalThis.Number(e.ysize):0,zsize:Y(e.zsize)?globalThis.Number(e.zsize):0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),e.xsize!==0&&(t.xsize=e.xsize),e.ysize!==0&&(t.ysize=e.ysize),e.zsize!==0&&(t.zsize=e.zsize),t},create(e){return TC.fromPartial(e??{})},fromPartial(e){let t=wC();return t.guid=e.guid??``,t.name=e.name??``,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t.xsize=e.xsize??0,t.ysize=e.ysize??0,t.zsize=e.zsize??0,t}};function EC(){return{guid:``,name:``,radius:0,frame:void 0}}var DC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.frame!==void 0&&tC.encode(e.frame,t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=EC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==34)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return DC.fromPartial(e??{})},fromPartial(e){let t=EC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function OC(){return{guid:``,name:``,radius:0,height:0,frame:void 0}}var kC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.height!==0&&t.uint32(33).double(e.height),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=OC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==33)break;i.height=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,height:Y(e.height)?globalThis.Number(e.height):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return kC.fromPartial(e??{})},fromPartial(e){let t=OC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function AC(){return{guid:``,name:``,radius:0,height:0,frame:void 0}}var jC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.height!==0&&t.uint32(33).double(e.height),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=AC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==33)break;i.height=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,height:Y(e.height)?globalThis.Number(e.height):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return jC.fromPartial(e??{})},fromPartial(e){let t=AC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function MC(){return{guid:``,name:``,radius:0,height:0,frame:void 0}}var NC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radius!==0&&t.uint32(25).double(e.radius),e.height!==0&&t.uint32(33).double(e.height),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=MC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radius=n.double();continue;case 4:if(e!==33)break;i.height=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radius:Y(e.radius)?globalThis.Number(e.radius):0,height:Y(e.height)?globalThis.Number(e.height):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radius!==0&&(t.radius=e.radius),e.height!==0&&(t.height=e.height),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return NC.fromPartial(e??{})},fromPartial(e){let t=MC();return t.guid=e.guid??``,t.name=e.name??``,t.radius=e.radius??0,t.height=e.height??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function PC(){return{guid:``,name:``,radiusAxis:0,radiusPipe:0,frame:void 0}}var FC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.radiusAxis!==0&&t.uint32(25).double(e.radiusAxis),e.radiusPipe!==0&&t.uint32(33).double(e.radiusPipe),e.frame!==void 0&&tC.encode(e.frame,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=PC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==25)break;i.radiusAxis=n.double();continue;case 4:if(e!==33)break;i.radiusPipe=n.double();continue;case 5:if(e!==42)break;i.frame=tC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,radiusAxis:Y(e.radiusAxis)?globalThis.Number(e.radiusAxis):Y(e.radius_axis)?globalThis.Number(e.radius_axis):0,radiusPipe:Y(e.radiusPipe)?globalThis.Number(e.radiusPipe):Y(e.radius_pipe)?globalThis.Number(e.radius_pipe):0,frame:Y(e.frame)?tC.fromJSON(e.frame):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.radiusAxis!==0&&(t.radiusAxis=e.radiusAxis),e.radiusPipe!==0&&(t.radiusPipe=e.radiusPipe),e.frame!==void 0&&(t.frame=tC.toJSON(e.frame)),t},create(e){return FC.fromPartial(e??{})},fromPartial(e){let t=PC();return t.guid=e.guid??``,t.name=e.name??``,t.radiusAxis=e.radiusAxis??0,t.radiusPipe=e.radiusPipe??0,t.frame=e.frame!==void 0&&e.frame!==null?tC.fromPartial(e.frame):void 0,t}};function IC(){return{guid:``,name:``,points:[]}}var LC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.points)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=IC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.points.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.points?.length&&(t.points=e.points),t},create(e){return LC.fromPartial(e??{})},fromPartial(e){let t=IC();return t.guid=e.guid??``,t.name=e.name??``,t.points=e.points?.map(e=>e)||[],t}};function RC(){return{guid:``,name:``,matrix:[]}}var zC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=RC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return zC.fromPartial(e??{})},fromPartial(e){let t=RC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function BC(){return{guid:``,name:``,translationVector:void 0}}var VC={encode(e,t=new Vx){return e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),e.translationVector!==void 0&&$S.encode(e.translationVector,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=BC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.translationVector=$S.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},fromJSON(e){return{guid:Y(e.guid)?globalThis.String(e.guid):``,name:Y(e.name)?globalThis.String(e.name):``,translationVector:Y(e.translationVector)?$S.fromJSON(e.translationVector):Y(e.translation_vector)?$S.fromJSON(e.translation_vector):void 0}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.translationVector!==void 0&&(t.translationVector=$S.toJSON(e.translationVector)),t},create(e){return VC.fromPartial(e??{})},fromPartial(e){let t=BC();return t.guid=e.guid??``,t.name=e.name??``,t.translationVector=e.translationVector!==void 0&&e.translationVector!==null?$S.fromPartial(e.translationVector):void 0,t}};function HC(){return{guid:``,name:``,matrix:[]}}var UC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=HC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return UC.fromPartial(e??{})},fromPartial(e){let t=HC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function WC(){return{guid:``,name:``,matrix:[]}}var GC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=WC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return GC.fromPartial(e??{})},fromPartial(e){let t=WC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function KC(){return{guid:``,name:``,matrix:[]}}var qC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=KC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return qC.fromPartial(e??{})},fromPartial(e){let t=KC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function JC(){return{guid:``,name:``,matrix:[]}}var YC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=JC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return YC.fromPartial(e??{})},fromPartial(e){let t=JC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function XC(){return{guid:``,name:``,matrix:[]}}var ZC={encode(e,t=new Vx){e.guid!==``&&t.uint32(10).string(e.guid),e.name!==``&&t.uint32(18).string(e.name),t.uint32(26).fork();for(let n of e.matrix)t.double(n);return t.join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=XC();for(;n.pos>>3){case 1:if(e!==10)break;i.guid=n.string();continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e===25){i.matrix.push(n.double());continue}if(e===26){let e=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(e){let t={};return e.guid!==``&&(t.guid=e.guid),e.name!==``&&(t.name=e.name),e.matrix?.length&&(t.matrix=e.matrix),t},create(e){return ZC.fromPartial(e??{})},fromPartial(e){let t=XC();return t.guid=e.guid??``,t.name=e.name??``,t.matrix=e.matrix?.map(e=>e)||[],t}};function Y(e){return e!=null}var QC=class{data;constructor(e){let t;if(t=`bytes`in e?$C(e.bytes):e.data,t.x===void 0||t.y===void 0||t.z===void 0)throw Error(`Invalid PointData: Missing required properties (x, y, or z).`);this.data=t}get bytes(){return ew(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}};function $C(e){return ZS.decode(e)}function ew(e){return ZS.encode(e).finish()}function tw(e){if(e.length%3!=0)throw Error(`Invalid coordinate array: expected x, y, z triplets.`);let t=[];for(let n=0;ne+t,0);if(t.vertices.length%3!=0||n!==t.faceVertices.length)throw Error(`Invalid MeshData: malformed vertices or face arrays.`);this.data=t}get bytes(){return pw(this.data)}get guid(){return this.data.guid?this.data.guid:``}get name(){return this.data.name?this.data.name:``}get vertices(){return this._vertices||=tw(this.data.vertices),this._vertices}get faces(){let e=[],t=0;for(let n of this.data.faceSizes){let r=this.data.faceVertices.slice(t,t+n);e.push(new cw({data:{indices:r}})),t+=n}return e}};function fw(e){return ES.decode(e)}function pw(e){return ES.encode(e).finish()}var mw=class{data;constructor(e){this.data=`bytes`in e?hw(e.bytes):e.data}get bytes(){return gw(this.data)}get guid(){return this.data.guid||``}get name(){return this.data.name||``}get nodeKeys(){return this.data.nodeKeys.map(nE)}};function hw(e){return BS.decode(e)}function gw(e){return BS.encode(e).finish()}var _w=class{data;constructor(e){let t;if(t=`bytes`in e?vw(e.bytes):e.data,t.x===void 0||t.y===void 0||t.z===void 0)throw Error(`Invalid VectorData: Missing required properties (x, y, or z).`);this.data=t}get bytes(){return yw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}};function vw(e){return $S.decode(e)}function yw(e){return $S.encode(e).finish()}var bw=class{data;_point;_xaxis;_yaxis;constructor(e){let t;if(t=`bytes`in e?xw(e.bytes):e.data,!t.point||!t.xaxis||!t.yaxis)throw Error(`Invalid FrameData: Missing required properties (point, xaxis, or yaxis).`);this.data=t}get bytes(){return Sw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get point(){return this._point||=new QC({data:this.data.point}),this._point}get xaxis(){return this._xaxis||=new _w({data:this.data.xaxis}),this._xaxis}get yaxis(){return this._yaxis||=new _w({data:this.data.yaxis}),this._yaxis}};function xw(e){return tC.decode(e)}function Sw(e){return tC.encode(e).finish()}var Cw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?ww(e.bytes):e.data,!t.radius||!t.frame)throw Error(`Invalid CircleData: Missing required properties (radius or frame).`);this.data=t}get bytes(){return Tw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function ww(e){return lC.decode(e)}function Tw(e){return lC.encode(e).finish()}var Ew=class{data;_circle;constructor(e){let t;if(t=`bytes`in e?Dw(e.bytes):e.data,!t.startAngle||!t.endAngle||!t.circle)throw Error(`Invalid ArcData: Missing required properties (startAngle, endAngle, or circle).`);this.data=t}get bytes(){return Ow(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get startAngle(){return this.data.startAngle}get endAngle(){return this.data.endAngle}get circle(){return this._circle||=new Cw({data:this.data.circle}),this._circle}};function Dw(e){return dC.decode(e)}function Ow(e){return dC.encode(e).finish()}var kw=class{data;_points;constructor(e){let t;if(t=`bytes`in e?Aw(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid BezierData: Missing required property points.`);this.data=t}get bytes(){return jw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=tw(this.data.points),this._points}};function Aw(e){return yC.decode(e)}function jw(e){return yC.encode(e).finish()}var Mw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?Nw(e.bytes):e.data,!t.xsize||!t.ysize||!t.zsize||!t.frame)throw Error(`Invalid BoxData: Missing required properties (xsize, ysize, zsize, or frame).`);this.data=t}get bytes(){return Pw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get xsize(){return this.data.xsize}get ysize(){return this.data.ysize}get zsize(){return this.data.zsize}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function Nw(e){return TC.decode(e)}function Pw(e){return TC.encode(e).finish()}var Fw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?Iw(e.bytes):e.data,!t.radius||!t.height||!t.frame)throw Error(`Invalid CapsuleData: Missing required properties (radius, height, or frame).`);this.data=t}get bytes(){return Lw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function Iw(e){return NC.decode(e)}function Lw(e){return NC.encode(e).finish()}var Rw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?zw(e.bytes):e.data,!t.radius||!t.height||!t.frame)throw Error(`Invalid ConeData: Missing required properties (radius, height, or frame).`);this.data=t}get bytes(){return Bw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function zw(e){return jC.decode(e)}function Bw(e){return jC.encode(e).finish()}var Vw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?Hw(e.bytes):e.data,!t.radius||!t.height||!t.frame)throw Error(`Invalid CylinderData: Missing required properties (radius, height, or frame).`);this.data=t}get bytes(){return Uw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function Hw(e){return kC.decode(e)}function Uw(e){return kC.encode(e).finish()}var Ww=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?Gw(e.bytes):e.data,!t.major||!t.minor||!t.frame)throw Error(`Invalid EllipseData: Missing required properties (major, minor, or frame).`);this.data=t}get bytes(){return Kw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get major(){return this.data.major}get minor(){return this.data.minor}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function Gw(e){return pC.decode(e)}function Kw(e){return pC.encode(e).finish()}var qw=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?Jw(e.bytes):e.data,!t.major||!t.minor||!t.frame)throw Error(`Invalid HyperbolaData: Missing required properties (a, b, or frame).`);this.data=t}get bytes(){return Yw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get major(){return this.data.major}get minor(){return this.data.minor}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function Jw(e){return _C.decode(e)}function Yw(e){return _C.encode(e).finish()}var Xw=class{data;_start;_end;constructor(e){let t;if(t=`bytes`in e?Zw(e.bytes):e.data,!t.start||!t.end)throw Error(`Invalid LineData: Missing required properties (start or end).`);this.data=t}get bytes(){return Qw(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get start(){return this._start||=new QC({data:this.data.start}),this._start}get end(){return this._end||=new QC({data:this.data.end}),this._end}};function Zw(e){return sC.decode(e)}function Qw(e){return sC.encode(e).finish()}var $w=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?eT(e.bytes):e.data,!t.focal||!t.frame)throw Error(`Invalid ParabolaData: Missing required properties (focal_length or frame).`);this.data=t}get bytes(){return tT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get focal(){return this.data.focal}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function eT(e){return hC.decode(e)}function tT(e){return hC.encode(e).finish()}var nT=class{data;_point;_normal;constructor(e){let t;if(t=`bytes`in e?rT(e.bytes):e.data,!t.point||!t.normal)throw Error(`Invalid PlaneData: Missing required properties (point or normal).`);this.data=t}get bytes(){return iT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get point(){return this._point||=new QC({data:this.data.point}),this._point}get normal(){return this._normal||=new _w({data:this.data.normal}),this._normal}};function rT(e){return rC.decode(e)}function iT(e){return rC.encode(e).finish()}var aT=class{data;_points;constructor(e){let t;if(t=`bytes`in e?oT(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid PointcloudData: Missing required property points.`);this.data=t}get bytes(){return sT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=tw(this.data.points),this._points}};function oT(e){return LC.decode(e)}function sT(e){return LC.encode(e).finish()}var cT=class{data;_points;constructor(e){let t;if(t=`bytes`in e?lT(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid PolygonData: Missing required property points.`);this.data=t}get bytes(){return uT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=tw(this.data.points),this._points}};function lT(e){return CC.decode(e)}function uT(e){return CC.encode(e).finish()}var dT=class{data;_points;constructor(e){let t;if(t=`bytes`in e?fT(e.bytes):e.data,!t.points||t.points.length===0)throw Error(`Invalid PolylineData: Missing required property points.`);this.data=t}get bytes(){return pT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){return this._points||=tw(this.data.points),this._points}};function fT(e){return xC.decode(e)}function pT(e){return xC.encode(e).finish()}var mT=class{data;constructor(e){let t;if(t=`bytes`in e?hT(e.bytes):e.data,!t.matrix)throw Error(`Invalid ProjectionData: Missing required properties (direction).`);this.data=t}get bytes(){return gT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function hT(e){return ZC.decode(e)}function gT(e){return ZC.encode(e).finish()}var _T=class{data;constructor(e){let t;if(t=`bytes`in e?vT(e.bytes):e.data,!t.w||!t.x||!t.y||!t.z)throw Error(`Invalid QuaternionData: Missing required properties (w, x, y, or z).`);this.data=t}get bytes(){return yT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get w(){return this.data.w}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}};function vT(e){return aC.decode(e)}function yT(e){return aC.encode(e).finish()}var bT=class{data;constructor(e){let t;if(t=`bytes`in e?xT(e.bytes):e.data,!t.matrix)throw Error(`Invalid ReflectionData: Missing required properties (frame).`);this.data=t}get bytes(){return ST(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function xT(e){return qC.decode(e)}function ST(e){return qC.encode(e).finish()}var CT=class{data;constructor(e){let t;if(t=`bytes`in e?wT(e.bytes):e.data,t.matrix.length!==16)throw Error(`Invalid RotationData: matrix must contain 16 values.`);this.data=t}get bytes(){return TT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function wT(e){return UC.decode(e)}function TT(e){return UC.encode(e).finish()}var ET=class{data;constructor(e){let t;if(t=`bytes`in e?DT(e.bytes):e.data,!t.matrix)throw Error(`Invalid ScaleData: Missing required properties (factor or frame).`);this.data=t}get bytes(){return OT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function DT(e){return GC.decode(e)}function OT(e){return GC.encode(e).finish()}var kT=class{data;constructor(e){let t;if(t=`bytes`in e?AT(e.bytes):e.data,!t.matrix)throw Error(`Invalid ShearData: Missing required properties (matrix).`);this.data=t}get bytes(){return jT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function AT(e){return YC.decode(e)}function jT(e){return YC.encode(e).finish()}var MT=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?NT(e.bytes):e.data,!t.radius||!t.frame)throw Error(`Invalid SphereData: Missing required properties (radius or frame).`);this.data=t}get bytes(){return PT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function NT(e){return DC.decode(e)}function PT(e){return DC.encode(e).finish()}var FT=class{data;_frame;constructor(e){let t;if(t=`bytes`in e?IT(e.bytes):e.data,!t.radiusAxis||!t.radiusPipe||!t.frame)throw Error(`Invalid TorusData: Missing required properties (major, minor, or frame).`);this.data=t}get bytes(){return LT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radiusAxis(){return this.data.radiusAxis}get radiusPipe(){return this.data.radiusPipe}get frame(){return this._frame||=new bw({data:this.data.frame}),this._frame}};function IT(e){return FC.decode(e)}function LT(e){return FC.encode(e).finish()}var RT=class{data;constructor(e){let t;t=`bytes`in e?zT(e.bytes):e.data,this.data=t}get bytes(){return BT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}};function zT(e){return zC.decode(e)}function BT(e){return zC.encode(e).finish()}var VT=class{data;_translationVector;constructor(e){let t;if(t=`bytes`in e?HT(e.bytes):e.data,!t.translationVector)throw Error(`Invalid TranslationData: Missing required properties (vector or frame).`);this.data=t}get bytes(){return UT(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get translationVector(){return this._translationVector||=new _w({data:this.data.translationVector}),this._translationVector}};function HT(e){return VC.decode(e)}function UT(e){return VC.encode(e).finish()}var WT=class{data;constructor(e){let t;t=`bytes`in e?GT(e.bytes):e.data,this.data=t}get bytes(){return KT(this.data)}get asDict(){return oE(this.data)}};function GT(e){return hS.decode(e)}function KT(e){return hS.encode(e).finish()}var qT=class{data;constructor(e){let t;t=`bytes`in e?JT(e.bytes):e.data,this.data=t}get bytes(){return YT(this.data)}get asList(){return aE(this.data)}};function JT(e){return pS.decode(e)}function YT(e){return pS.encode(e).finish()}var XT=new Map([[`ArcData`,Ew],[`BezierData`,kw],[`BoxData`,Mw],[`CapsuleData`,Fw],[`CircleData`,Cw],[`ConeData`,Rw],[`CylinderData`,Vw],[`EllipseData`,Ww],[`FrameData`,bw],[`HyperbolaData`,qw],[`LineData`,Xw],[`ParabolaData`,$w],[`PlaneData`,nT],[`PointData`,QC],[`PointcloudData`,aT],[`PolygonData`,cT],[`PolylineData`,dT],[`ProjectionData`,mT],[`QuaternionData`,_T],[`ReflectionData`,bT],[`RotationData`,CT],[`ScaleData`,ET],[`ShearData`,kT],[`SphereData`,MT],[`TorusData`,FT],[`TransformationData`,RT],[`TranslationData`,VT],[`VectorData`,_w],[`MeshData`,dw],[`PolyhedronData`,aw],[`GraphData`,mw],[`DictData`,WT],[`ListData`,qT]]),ZT=`1.0.0`;function QT(e){return nE($T(e))}function $T(e){if(e.length===0)throw Error(`Binary data is empty.`);let t=yS.decode(e);if(tE(t.version),!t.data)throw Error(`Message contains no data.`);return t.data}function eE(e){let t=e.split(`.`);return t[0]===`0`&&t.length>=2?`${t[0]}.${t[1]}`:t[0]}function tE(e){if(!e)throw Error(`No version tag in the message; cannot verify compas_pb wire-format compatibility (reader is ${ZT}).`);if(eE(e)!==eE(`1.0.0`))throw Error(`Incompatible compas_pb wire format: message was written by version ${e} but this reader is ${ZT}.`)}function nE(e){if(e.value!==void 0)return rE(e.value);if(e.intValue!==void 0)return e.intValue;if(e.doubleValue!==void 0)return e.doubleValue;if(e.dictValue!==void 0)return oE(e.dictValue);if(e.listValue!==void 0)return aE(e.listValue);if(e.message!==void 0)return iE(e.message);if(e.fallback?.data!==void 0)return oE(e.fallback.data)}function rE(e){if(typeof e!=`string`||!e.startsWith(`base64:`))return e;let t=globalThis.atob(e.slice(7));return Uint8Array.from(t,e=>e.charCodeAt(0))}function iE(e){let t=e.typeUrl.split(`.`).slice(-1)[0];if(t===`ListData`)return aE(pS.decode(e.value));if(t===`DictData`)return oE(hS.decode(e.value));let n=XT.get(t);return n?new n({bytes:e.value}):null}function aE(e){return e.items.map(nE)}function oE(e){let t={};for(let n of Object.keys(e.items))t[n]=nE(e.items[n]);return t}function sE(e){return QT(e)}var cE=class{options;socket=null;retryTimer=null;stopped=!0;constructor(e){this.options=e}start(){this.stopped&&(this.stopped=!1,this.connect())}send(e){return this.socket?.readyState===WebSocket.OPEN?(this.socket.send(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e==`string`?e:JSON.stringify(e)),!0):this.options.send?.(e)!==!1&&this.options.send!==void 0}dispose(){this.stopped=!0,this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null);let e=this.socket;this.socket=null,e&&(e.onclose=null,e.close())}connect(){if(this.stopped)return;let e=new WebSocket(this.buildUrl());this.socket=e,e.binaryType=`arraybuffer`,e.onmessage=e=>{e.data instanceof ArrayBuffer&&this.options.dispatch(new Uint8Array(e.data))},e.onerror=()=>{this.options.onError(Error(`WebSocket connection failed: ${this.buildUrl()}`))},e.onclose=()=>{this.stopped||(this.retryTimer=setTimeout(()=>this.connect(),1e3))}}buildUrl(){let e=new URLSearchParams(window.location.search),t=this.options.host??e.get(`ws_host`)??`127.0.0.1`,n=this.options.port??Number(e.get(`ws_port`)??9001),r=this.options.workspace??e.get(`workspace`)??`main`;return`${this.options.secure??window.location.protocol===`https:`?`wss`:`ws`}://${t}:${n}/ws?workspace=${encodeURIComponent(r)}`}},lE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},uE={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},dE=1e3,fE=1001,pE=1002,mE=1003,hE=1004,gE=1005,_E=1006,vE=1007,yE=1008,bE=1009,xE=1010,SE=1011,CE=1012,wE=1013,TE=1014,EE=1015,DE=1016,OE=1017,kE=1018,AE=1020,jE=35902,ME=35899,NE=1021,PE=1022,FE=1023,IE=1026,LE=1027,RE=1028,zE=1029,BE=1030,VE=1031,HE=1033,UE=33776,WE=33777,GE=33778,KE=33779,qE=35840,JE=35841,YE=35842,XE=35843,ZE=36196,QE=37492,$E=37496,eD=37488,tD=37489,nD=37490,rD=37491,iD=37808,aD=37809,oD=37810,sD=37811,cD=37812,lD=37813,uD=37814,dD=37815,fD=37816,pD=37817,mD=37818,hD=37819,gD=37820,_D=37821,vD=36492,yD=36494,bD=36495,xD=36283,SD=36284,CD=36285,wD=36286,TD=2300,ED=2301,DD=2302,OD=2400,kD=2401,AD=2402,jD=3200,MD=`srgb`,ND=`srgb-linear`,PD=`linear`,FD=`srgb`,ID=7680,LD=35044,RD=2e3;function zD(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function BD(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function VD(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function HD(){let e=VD(`canvas`);return e.style.display=`block`,e}var UD={};function WD(...e){let t=`THREE.`+e.shift();console.log(t,...e)}function GD(...e){let t=`THREE.`+e.shift();console.warn(t,...e)}function KD(...e){let t=`THREE.`+e.shift();console.error(t,...e)}function qD(...e){let t=e.join(` `);t in UD||(UD[t]=!0,GD(...e))}function JD(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var YD=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+XD[e>>16&255]+XD[e>>24&255]+`-`+XD[t&255]+XD[t>>8&255]+`-`+XD[t>>16&15|64]+XD[t>>24&255]+`-`+XD[n&63|128]+XD[n>>8&255]+`-`+XD[n>>16&255]+XD[n>>24&255]+XD[r&255]+XD[r>>8&255]+XD[r>>16&255]+XD[r>>24&255]).toLowerCase()}function tO(e,t,n){return Math.max(t,Math.min(n,e))}function nO(e,t){return(e%t+t)%t}function rO(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function iO(e,t,n){return e===t?0:(n-e)/(t-e)}function aO(e,t,n){return(1-n)*e+n*t}function oO(e,t,n,r){return aO(e,t,1-Math.exp(-n*r))}function sO(e,t=1){return t-Math.abs(nO(e,t*2)-t)}function cO(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function lO(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function uO(e,t){return e+Math.floor(Math.random()*(t-e+1))}function dO(e,t){return e+Math.random()*(t-e)}function fO(e){return e*(.5-Math.random())}function pO(e){e!==void 0&&(ZD=e);let t=ZD+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function mO(e){return e*QD}function hO(e){return e*$D}function gO(e){return!(e&e-1)&&e!==0}function _O(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function vO(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function yO(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:GD(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function bO(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function xO(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`Invalid component type.`)}}var SO={DEG2RAD:QD,RAD2DEG:$D,generateUUID:eO,clamp:tO,euclideanModulo:nO,mapLinear:rO,inverseLerp:iO,lerp:aO,damp:oO,pingpong:sO,smoothstep:cO,smootherstep:lO,randInt:uO,randFloat:dO,randFloatSpread:fO,seededRandom:pO,degToRad:mO,radToDeg:hO,isPowerOfTwo:gO,ceilPowerOfTwo:_O,floorPowerOfTwo:vO,setQuaternionFromProperEuler:yO,normalize:xO,denormalize:bO},X=class e{constructor(t=0,n=0){e.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=tO(this.x,e.x,t.x),this.y=tO(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=tO(this.x,e,t),this.y=tO(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(tO(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(tO(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},CO=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(o<=0){e[t+0]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u;return}if(o>=1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=m;return}if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:GD(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(tO(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},Z=class e{constructor(t=0,n=0,r=0){e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(TO.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(TO.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=tO(this.x,e.x,t.x),this.y=tO(this.y,e.y,t.y),this.z=tO(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=tO(this.x,e,t),this.y=tO(this.y,e,t),this.z=tO(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(tO(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return wO.copy(this).projectOnVector(e),this.sub(wO)}reflect(e){return this.sub(wO.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(tO(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},wO=new Z,TO=new CO,EO=class e{constructor(t,n,r,i,a,o,s,c,l){e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(DO.makeScale(e,t)),this}rotate(e){return this.premultiply(DO.makeRotation(-e)),this}translate(e,t){return this.premultiply(DO.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},DO=new EO,OO=new EO().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),kO=new EO().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function AO(){let e={enabled:!0,workingColorSpace:ND,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=MO(e.r),e.g=MO(e.g),e.b=MO(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=NO(e.r),e.g=NO(e.g),e.b=NO(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?PD:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return qD(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return qD(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[ND]:{primaries:t,whitePoint:r,transfer:PD,toXYZ:OO,fromXYZ:kO,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:MD},outputColorSpaceConfig:{drawingBufferColorSpace:MD}},[MD]:{primaries:t,whitePoint:r,transfer:FD,toXYZ:OO,fromXYZ:kO,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:MD}}}),e}var jO=AO();function MO(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function NO(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var PO,FO=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{PO===void 0&&(PO=VD(`canvas`)),PO.width=e.width,PO.height=e.height;let t=PO.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=PO}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=VD(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e1),this.pmremVersion=0}get width(){return this.source.getSize(BO).x}get height(){return this.source.getSize(BO).y}get depth(){return this.source.getSize(BO).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){GD(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){GD(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case dE:e.x-=Math.floor(e.x);break;case fE:e.x=e.x<0?0:1;break;case pE:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case dE:e.y-=Math.floor(e.y);break;case fE:e.y=e.y<0?0:1;break;case pE:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};VO.DEFAULT_IMAGE=null,VO.DEFAULT_MAPPING=300,VO.DEFAULT_ANISOTROPY=1;var HO=class e{constructor(t=0,n=0,r=0,i=1){e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)s&&e>_?e_?s1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,YO),YO.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(rk),ik.subVectors(this.max,rk),ZO.subVectors(e.a,rk),QO.subVectors(e.b,rk),$O.subVectors(e.c,rk),ek.subVectors(QO,ZO),tk.subVectors($O,QO),nk.subVectors(ZO,$O);let t=[0,-ek.z,ek.y,0,-tk.z,tk.y,0,-nk.z,nk.y,ek.z,0,-ek.x,tk.z,0,-tk.x,nk.z,0,-nk.x,-ek.y,ek.x,0,-tk.y,tk.x,0,-nk.y,nk.x,0];return!sk(t,ZO,QO,$O,ik)||(t=[1,0,0,0,1,0,0,0,1],!sk(t,ZO,QO,$O,ik))?!1:(ak.crossVectors(ek,tk),t=[ak.x,ak.y,ak.z],sk(t,ZO,QO,$O,ik))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,YO).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(YO).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(JO[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),JO[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),JO[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),JO[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),JO[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),JO[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),JO[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),JO[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(JO),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},JO=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],YO=new Z,XO=new qO,ZO=new Z,QO=new Z,$O=new Z,ek=new Z,tk=new Z,nk=new Z,rk=new Z,ik=new Z,ak=new Z,ok=new Z;function sk(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){ok.fromArray(e,a);let o=i.x*Math.abs(ok.x)+i.y*Math.abs(ok.y)+i.z*Math.abs(ok.z),s=t.dot(ok),c=n.dot(ok),l=r.dot(ok);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var ck=new qO,lk=new Z,uk=new Z,dk=class{constructor(e=new Z,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?ck.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;lk.subVectors(e,this.center);let t=lk.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(lk,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(uk.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(lk.copy(e.center).add(uk)),this.expandByPoint(lk.copy(e.center).sub(uk))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},fk=new Z,pk=new Z,mk=new Z,hk=new Z,gk=new Z,_k=new Z,vk=new Z,yk=class{constructor(e=new Z,t=new Z(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,fk)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=fk.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(fk.copy(this.origin).addScaledVector(this.direction,t),fk.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){pk.copy(e).add(t).multiplyScalar(.5),mk.copy(t).sub(e).normalize(),hk.copy(this.origin).sub(pk);let i=e.distanceTo(t)*.5,a=-this.direction.dot(mk),o=hk.dot(this.direction),s=-hk.dot(mk),c=hk.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0){if(u=a*s-o,d=a*o-s,p=i*l,u>=0){if(d>=-p){if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c}else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c)}else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(pk).addScaledVector(mk,d),f}intersectSphere(e,t){fk.subVectors(e.center,this.origin);let n=fk.dot(this.direction),r=fk.dot(fk)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,fk)!==null}intersectTriangle(e,t,n,r,i){gk.subVectors(t,e),_k.subVectors(n,e),vk.crossVectors(gk,_k);let a=this.direction.dot(vk),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;hk.subVectors(this.origin,e);let s=o*this.direction.dot(_k.crossVectors(hk,_k));if(s<0)return null;let c=o*this.direction.dot(gk.cross(hk));if(c<0||s+c>a)return null;let l=-o*hk.dot(vk);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},bk=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();let t=this.elements,n=e.elements,r=1/xk.setFromMatrixColumn(e,0).length(),i=1/xk.setFromMatrixColumn(e,1).length(),a=1/xk.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Ck,e,wk)}lookAt(e,t,n){let r=this.elements;return Dk.subVectors(e,t),Dk.lengthSq()===0&&(Dk.z=1),Dk.normalize(),Tk.crossVectors(n,Dk),Tk.lengthSq()===0&&(Math.abs(n.z)===1?Dk.x+=1e-4:Dk.z+=1e-4,Dk.normalize(),Tk.crossVectors(n,Dk)),Tk.normalize(),Ek.crossVectors(Dk,Tk),r[0]=Tk.x,r[4]=Ek.x,r[8]=Dk.x,r[1]=Tk.y,r[5]=Ek.y,r[9]=Dk.y,r[2]=Tk.z,r[6]=Ek.z,r[10]=Dk.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],ee=r[2],k=r[6],A=r[10],te=r[14],j=r[3],ne=r[7],M=r[11],N=r[15];return i[0]=a*x+o*T+s*ee+c*j,i[4]=a*S+o*E+s*k+c*ne,i[8]=a*C+o*D+s*A+c*M,i[12]=a*w+o*O+s*te+c*N,i[1]=l*x+u*T+d*ee+f*j,i[5]=l*S+u*E+d*k+f*ne,i[9]=l*C+u*D+d*A+f*M,i[13]=l*w+u*O+d*te+f*N,i[2]=p*x+m*T+h*ee+g*j,i[6]=p*S+m*E+h*k+g*ne,i[10]=p*C+m*D+h*A+g*M,i[14]=p*w+m*O+h*te+g*N,i[3]=_*x+v*T+y*ee+b*j,i[7]=_*S+v*E+y*k+b*ne,i[11]=_*C+v*D+y*A+b*M,i[15]=_*w+v*O+y*te+b*N,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=u*h*c-m*d*c+m*s*f-o*h*f-u*s*g+o*d*g,v=p*d*c-l*h*c-p*s*f+a*h*f+l*s*g-a*d*g,y=l*m*c-p*u*c+p*o*f-a*m*f-l*o*g+a*u*g,b=p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h,x=t*_+n*v+r*y+i*b;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/x;return e[0]=_*S,e[1]=(m*d*i-u*h*i-m*r*f+n*h*f+u*r*g-n*d*g)*S,e[2]=(o*h*i-m*s*i+m*r*c-n*h*c-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*d*i-u*r*c+n*d*c+o*r*f-n*s*f)*S,e[4]=v*S,e[5]=(l*h*i-p*d*i+p*r*f-t*h*f-l*r*g+t*d*g)*S,e[6]=(p*s*i-a*h*i-p*r*c+t*h*c+a*r*g-t*s*g)*S,e[7]=(a*d*i-l*s*i+l*r*c-t*d*c-a*r*f+t*s*f)*S,e[8]=y*S,e[9]=(p*u*i-l*m*i-p*n*f+t*m*f+l*n*g-t*u*g)*S,e[10]=(a*m*i-p*o*i+p*n*c-t*m*c-a*n*g+t*o*g)*S,e[11]=(l*o*i-a*u*i-l*n*c+t*u*c+a*n*f-t*o*f)*S,e[12]=b*S,e[13]=(l*m*r-p*u*r+p*n*d-t*m*d-l*n*h+t*u*h)*S,e[14]=(p*o*r-a*m*r-p*n*s+t*m*s+a*n*h-t*o*h)*S,e[15]=(a*u*r-l*o*r+l*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return n.set(1,1,1),t.identity(),this;let i=xk.set(r[0],r[1],r[2]).length(),a=xk.set(r[4],r[5],r[6]).length(),o=xk.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),Sk.copy(this);let s=1/i,c=1/a,l=1/o;return Sk.elements[0]*=s,Sk.elements[1]*=s,Sk.elements[2]*=s,Sk.elements[4]*=c,Sk.elements[5]*=c,Sk.elements[6]*=c,Sk.elements[8]*=l,Sk.elements[9]*=l,Sk.elements[10]*=l,t.setFromRotationMatrix(Sk),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=RD,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=RD,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},xk=new Z,Sk=new bk,Ck=new Z(0,0,0),wk=new Z(1,1,1),Tk=new Z,Ek=new Z,Dk=new Z,Ok=new bk,kk=new CO,Ak=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(tO(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-tO(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(tO(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-tO(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(tO(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-tO(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:GD(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Ok.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ok,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return kk.setFromEuler(this),this.setFromQuaternion(kk,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Ak.DEFAULT_ORDER=`XYZ`;var jk=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Jk.subVectors(r,t),Yk.subVectors(n,t),Xk.subVectors(e,t);let a=Jk.dot(Jk),o=Jk.dot(Yk),s=Jk.dot(Xk),c=Yk.dot(Yk),l=Yk.dot(Xk),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Zk)!==null&&Zk.x>=0&&Zk.y>=0&&Zk.x+Zk.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Zk)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Zk.x),s.addScaledVector(a,Zk.y),s.addScaledVector(o,Zk.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return iA.setScalar(0),aA.setScalar(0),oA.setScalar(0),iA.fromBufferAttribute(e,t),aA.fromBufferAttribute(e,n),oA.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(iA,i.x),a.addScaledVector(aA,i.y),a.addScaledVector(oA,i.z),a}static isFrontFacing(e,t,n,r){return Jk.subVectors(n,t),Yk.subVectors(e,t),Jk.cross(Yk).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Jk.subVectors(this.c,this.b),Yk.subVectors(this.a,this.b),Jk.cross(Yk).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Qk.subVectors(r,n),$k.subVectors(i,n),tA.subVectors(e,n);let s=Qk.dot(tA),c=$k.dot(tA);if(s<=0&&c<=0)return t.copy(n);nA.subVectors(e,r);let l=Qk.dot(nA),u=$k.dot(nA);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Qk,a);rA.subVectors(e,i);let f=Qk.dot(rA),p=$k.dot(rA);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector($k,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return eA.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(eA,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Qk,a).addScaledVector($k,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},cA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},lA={h:0,s:0,l:0},uA={h:0,s:0,l:0};function dA(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var fA=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=MD){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,jO.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=jO.workingColorSpace){return this.r=e,this.g=t,this.b=n,jO.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=jO.workingColorSpace){if(e=nO(e,1),t=tO(t,0,1),n=tO(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=dA(i,r,e+1/3),this.g=dA(i,r,e),this.b=dA(i,r,e-1/3)}return jO.colorSpaceToWorking(this,r),this}setStyle(e,t=MD){function n(t){t!==void 0&&parseFloat(t)<1&&GD(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:GD(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);GD(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=MD){let n=cA[e.toLowerCase()];return n===void 0?GD(`Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=MO(e.r),this.g=MO(e.g),this.b=MO(e.b),this}copyLinearToSRGB(e){return this.r=NO(e.r),this.g=NO(e.g),this.b=NO(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=MD){return jO.workingToColorSpace(pA.copy(this),e),Math.round(tO(pA.r*255,0,255))*65536+Math.round(tO(pA.g*255,0,255))*256+Math.round(tO(pA.b*255,0,255))}getHexString(e=MD){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=jO.workingColorSpace){jO.workingToColorSpace(pA.copy(this),t);let n=pA.r,r=pA.g,i=pA.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){GD(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){GD(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){e===!0&&this.version++}},gA=class extends hA{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new fA(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ak,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},_A=new Z,vA=new X,yA=0,bA=class{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:yA++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=LD,this.updateRanges=[],this.gpuType=EE,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;rt.count&&GD(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new qO);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){KD(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),this.parameters!==void 0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2))&&(MA.copy(i).invert(),NA.copy(e.ray).applyMatrix4(MA),(n.boundingBox===null||NA.intersectsBox(n.boundingBox)!==!1)&&this._computeIntersections(e,t,NA)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null){if(Array.isArray(a))for(let i=0,s=d.length;in.far?null:{distance:l,point:HA.clone(),object:e}}function WA(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,IA),e.getVertexPosition(c,LA),e.getVertexPosition(l,RA);let u=UA(e,t,n,r,IA,LA,RA,VA);if(u){let e=new Z;sA.getBarycoord(VA,IA,LA,RA,e),i&&(u.uv=sA.getInterpolatedAttribute(i,s,c,l,e,new X)),a&&(u.uv1=sA.getInterpolatedAttribute(a,s,c,l,e,new X)),o&&(u.normal=sA.getInterpolatedAttribute(o,s,c,l,e,new Z),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new Z,materialIndex:0};sA.getNormal(IA,LA,RA,t.normal),u.face=t,u.barycoord=e}return u}var GA=class e extends jA{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new CA(c,3)),this.setAttribute(`normal`,new CA(l,3)),this.setAttribute(`uv`,new CA(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new Z;for(let a=0;a0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}},ej=class extends qk{constructor(){super(),this.isCamera=!0,this.type=`Camera`,this.matrixWorldInverse=new bk,this.projectionMatrix=new bk,this.projectionMatrixInverse=new bk,this.coordinateSystem=RD,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},tj=new Z,nj=new X,rj=new X,ij=class extends ej{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type=`PerspectiveCamera`,this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=$D*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(QD*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $D*2*Math.atan(Math.tan(QD*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){tj.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(tj.x,tj.y).multiplyScalar(-e/tj.z),tj.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(tj.x,tj.y).multiplyScalar(-e/tj.z)}getViewSize(e,t){return this.getViewBounds(e,nj,rj),t.subVectors(rj,nj)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(QD*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(this.view!==null&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;o!==0&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},aj=-90,oj=1,sj=class extends qk{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new ij(aj,oj,e,t);r.layers=this.layers,this.add(r);let i=new ij(aj,oj,e,t);i.layers=this.layers,this.add(i);let a=new ij(aj,oj,e,t);a.layers=this.layers,this.add(a);let o=new ij(aj,oj,e,t);o.layers=this.layers,this.add(o);let s=new ij(aj,oj,e,t);s.layers=this.layers,this.add(s);let c=new ij(aj,oj,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,a),e.setRenderTarget(n,2,r),e.render(t,o),e.setRenderTarget(n,3,r),e.render(t,s),e.setRenderTarget(n,4,r),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},cj=class extends VO{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},lj=class extends WO{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new cj(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},r=new GA(5,5,5),i=new $A({name:`CubemapFromEquirect`,uniforms:KA(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new Q(r,i),o=t.minFilter;return t.minFilter===1008&&(t.minFilter=_E),new sj(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}},uj=class extends qk{constructor(){super(),this.isGroup=!0,this.type=`Group`}},dj={type:`move`},fj=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new uj,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new uj,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new uj,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Z),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:`connected`,data:e}),this}disconnect(e){return this.dispatchEvent({type:`disconnected`,data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(dj)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new uj;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},pj=class extends qk{constructor(){super(),this.isScene=!0,this.type=`Scene`,this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ak,this.environmentIntensity=1,this.environmentRotation=new Ak,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},mj=class extends VO{constructor(e=null,t=1,n=1,r,i,a,o,s,c=mE,l=mE,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},hj=new Z,gj=new Z,_j=new EO,vj=class{constructor(e=new Z(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=hj.subVectors(n,t).cross(gj.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let n=e.delta(hj),r=this.normal.dot(n);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||_j.getNormalMatrix(e),r=this.coplanarPoint(hj).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}},yj=new dk,bj=new X(.5,.5),xj=new Z,Sj=class{constructor(e=new vj,t=new vj,n=new vj,r=new vj,i=new vj,a=new vj){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=RD,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),yj.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),yj.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(yj)}intersectsSprite(e){return yj.center.set(0,0,0),yj.radius=.7071067811865476+bj.distanceTo(e.center),yj.applyMatrix4(e.matrixWorld),this.intersectsSphere(yj)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,xj.y=r.normal.y>0?e.max.y:e.min.y,xj.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(xj)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},Cj=class extends hA{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new fA(16777215),this.map=null,this.linewidth=1,this.linecap=`round`,this.linejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},wj=new Z,Tj=new Z,Ej=new bk,Dj=new yk,Oj=new dk,kj=new Z,Aj=new Z,jj=class extends qk{constructor(e=new jA,t=new Cj){super(),this.isLine=!0,this.type=`Line`,this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;er)return;kj.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(kj);if(!(ct.far))return{distance:c,point:Aj.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var Nj=new Z,Pj=new Z,Fj=class extends jj{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type=`LineSegments`}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;ei.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var Uj=class extends VO{constructor(e,t,n=TE,r,i,a,o=mE,s=mE,c,l=IE,u=1){if(l!==1026&&l!==1027)throw Error(`DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new LO(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Wj=class extends Uj{constructor(e,t=TE,n=301,r,i,a=mE,o=mE,s,c=IE){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},Gj=class extends VO{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},Kj=class e extends jA{constructor(e=1,t=1,n=4,r=8,i=1){super(),this.type=`CapsuleGeometry`,this.parameters={radius:e,height:t,capSegments:n,radialSegments:r,heightSegments:i},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),r=Math.max(3,Math.floor(r)),i=Math.max(1,Math.floor(i));let a=[],o=[],s=[],c=[],l=t/2,u=Math.PI/2*e,d=t,f=2*u+d,p=n*2+i,m=r+1,h=new Z,g=new Z;for(let _=0;_<=p;_++){let v=0,y=0,b=0,x=0;if(_<=n){let t=_/n,r=t*Math.PI/2;y=-l-e*Math.cos(r),b=e*Math.sin(r),x=-e*Math.cos(r),v=t*u}else if(_<=n+i){let r=(_-n)/i;y=-l+r*t,b=e,x=0,v=u+r*d}else{let t=(_-n-i)/n,r=t*Math.PI/2;y=l+e*Math.sin(r),b=e*Math.cos(r),x=e*Math.sin(r),v=u+d+t*u}let S=Math.max(0,Math.min(1,v/f)),C=0;_===0?C=.5/r:_===p&&(C=-.5/r);for(let e=0;e<=r;e++){let t=e/r,n=t*Math.PI*2,i=Math.sin(n),a=Math.cos(n);g.x=-b*a,g.y=y,g.z=b*i,o.push(g.x,g.y,g.z),h.set(-b*a,x,b*i),h.normalize(),s.push(h.x,h.y,h.z),c.push(t+C,S)}if(_>0){let e=(_-1)*m;for(let t=0;t0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new CA(u,3)),this.setAttribute(`normal`,new CA(d,3)),this.setAttribute(`uv`,new CA(f,2));function _(){let a=new Z,_=new Z,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new X,m=new Z,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e.9&&Math.min(t,n,r)<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}function d(e){i.push(e.x,e.y,e.z)}function f(t,n){let r=t*3;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function p(){let e=new Z,t=new Z,n=new Z,r=new Z,o=new X,s=new X,c=new X;for(let l=0,u=0;l0)s=r-1;else{s=r;break}if(r=s,n[r]===a)return r/(i-1);let l=n[r],u=n[r+1]-l,d=(a-l)/u;return(r+d)/(i-1)}getTangent(e,t){let n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);let a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new X:new Z);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new Z,r=[],i=[],a=[],o=new Z,s=new bk;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new Z)}i[0]=new Z,a[0]=new Z;let c=Number.MAX_VALUE,l=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);l<=c&&(c=l,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>2**-52){o.normalize();let e=Math.acos(tO(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(t===!0){let t=Math.acos(tO(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:`Curve`,generator:`Curve.toJSON`}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},rM=class extends nM{constructor(e=0,t=0,n=1,r=1,i=0,a=Math.PI*2,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type=`EllipseCurve`,this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e,t=new X){let n=t,r=Math.PI*2,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<2**-52;for(;i<0;)i+=r;for(;i>r;)i-=r;i<2**-52&&(i=a?0:r),this.aClockwise===!0&&!a&&(i===r?i=-r:i-=r);let o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,r=c-this.aY;s=n*e-r*t+this.aX,c=n*t+r*e+this.aY}return n.set(s,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},iM=class extends rM{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.isArcCurve=!0,this.type=`ArcCurve`}};function aM(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;c*=o,l*=o,i(t,n,c,l)},calc:function(i){let a=i*i,o=a*i;return e+t*i+n*a+r*o}}}var oM=new Z,sM=new aM,cM=new aM,lM=new aM,uM=class extends nM{constructor(e=[],t=!1,n=`centripetal`,r=.5){super(),this.isCatmullRomCurve3=!0,this.type=`CatmullRomCurve3`,this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new Z){let n=t,r=this.points,i=r.length,a=(i-+!this.closed)*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:s===0&&o===i-1&&(o=i-2,s=1);let c,l;this.closed||o>0?c=r[(o-1)%i]:(oM.subVectors(r[0],r[1]).add(r[0]),c=oM);let u=r[o%i],d=r[(o+1)%i];if(this.closed||o+2r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(dM(o,s.x,c.x,l.x,u.x),dM(o,s.y,c.y,l.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){let e=r[i]-n,a=this.curves[i],o=a.getLength(),s=o===0?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,r=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let e=c.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(c);let l=c.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},jM=class extends AM{constructor(e){super(e),this.uuid=eO(),this.type=`Shape`,this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;at&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return FM(a,o,n,s,c,l,0),o}function NM(e,t,n,r,i){let a;if(i===uN(e,t,n,r)>0)for(let i=t;i=t;i-=r)a=sN(i/r|0,e[i],e[i+1],a);return a&&$M(a,a.next)&&(cN(a),a=a.next),a}function PM(e,t){if(!e)return e;t||=e;let n=e,r;do if(r=!1,!n.steiner&&($M(n,n.next)||QM(n.prev,n,n.next)===0)){if(cN(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function FM(e,t,n,r,i,a,o){if(!e)return;!o&&a&&GM(e,r,i,a);let s=e;for(;e.prev!==e.next;){let c=e.prev,l=e.next;if(a?LM(e,r,i,a):IM(e)){t.push(c.i,e.i,l.i),cN(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=RM(PM(e),t),FM(e,t,n,r,i,a,2)):o===2&&zM(e,t,n,r,i,a):FM(PM(e),t,n,r,i,a,1);break}}}function IM(e){let t=e.prev,n=e,r=e.next;if(QM(t,n,r)>=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&XM(i,s,a,c,o,l,m.x,m.y)&&QM(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function LM(e,t,n,r){let i=e.prev,a=e,o=e.next;if(QM(i,a,o)>=0)return!1;let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=qM(p,m,t,n,r),v=qM(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&XM(s,u,c,d,l,f,y.x,y.y)&&QM(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&XM(s,u,c,d,l,f,b.x,b.y)&&QM(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&XM(s,u,c,d,l,f,y.x,y.y)&&QM(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&XM(s,u,c,d,l,f,b.x,b.y)&&QM(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function RM(e,t){let n=e;do{let r=n.prev,i=n.next.next;!$M(r,i)&&eN(r,n,n.next,i)&&iN(r,i)&&iN(i,r)&&(t.push(r.i,n.i,i.i),cN(n),cN(n.next),n=e=i),n=n.next}while(n!==e);return PM(n)}function zM(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&ZM(o,e)){let s=oN(o,e);o=PM(o,o.next),s=PM(s,s.next),FM(o,t,n,r,i,a,0),FM(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function BM(e,t,n,r){let i=[];for(let n=0,a=t.length;n=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x=n.x&&n.x>=c&&r!==n.x&&YM(io.x||n.x===o.x&&WM(o,n)))&&(o=n,u=t)}n=n.next}while(n!==s);return o}function WM(e,t){return QM(e.prev,e,t.prev)<0&&QM(t.next,e,e.next)<0}function GM(e,t,n,r){let i=e;do i.z===0&&(i.z=qM(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,KM(i)}function KM(e){let t,n=1;do{let r=e,i;e=null;let a=null;for(t=0;r;){t++;let o=r,s=0;for(let e=0;e0||c>0&&o;)s!==0&&(c===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,s--):(i=o,o=o.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=o}a.nextZ=null,n*=2}while(t>1);return e}function qM(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function JM(e){let t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function XM(e,t,n,r,i,a,o,s){return(e!==o||t!==s)&&YM(e,t,n,r,i,a,o,s)}function ZM(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!rN(e,t)&&(iN(e,t)&&iN(t,e)&&aN(e,t)&&(QM(e.prev,e,t.prev)||QM(e,t.prev,t))||$M(e,t)&&QM(e.prev,e,e.next)>0&&QM(t.prev,t,t.next)>0)}function QM(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function $M(e,t){return e.x===t.x&&e.y===t.y}function eN(e,t,n,r){let i=nN(QM(e,t,n)),a=nN(QM(e,t,r)),o=nN(QM(n,r,e)),s=nN(QM(n,r,t));return!!(i!==a&&o!==s||i===0&&tN(e,n,t)||a===0&&tN(e,r,t)||o===0&&tN(n,e,r)||s===0&&tN(n,t,r))}function tN(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function nN(e){return e>0?1:e<0?-1:0}function rN(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&eN(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function iN(e,t){return QM(e.prev,e,e.next)<0?QM(e,t,e.next)>=0&&QM(e,e.prev,t)>=0:QM(e,t,e.prev)<0||QM(e,e.next,t)<0}function aN(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function oN(e,t){let n=lN(e.i,e.x,e.y),r=lN(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function sN(e,t,n,r){let i=lN(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function cN(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function lN(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function uN(e,t,n,r){let i=0;for(let a=t,o=n-r;a2&&e[t-1].equals(e[0])&&e.pop()}function mN(e,t){for(let n=0;n2**-52){let d=Math.sqrt(u),f=Math.sqrt(c*c+l*l),p=t.x-s/d,m=t.y+o/d,h=n.x-l/f,g=n.y+c/f,_=((h-p)*l-(g-m)*c)/(o*l-s*c);r=p+o*_-e.x,i=m+s*_-e.y;let v=r*r+i*i;if(v<=2)return new X(r,i);a=Math.sqrt(v/2)}else{let e=!1;o>2**-52?c>2**-52&&(e=!0):o<-(2**-52)?c<-(2**-52)&&(e=!0):Math.sign(s)===Math.sign(l)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new X(r/a,i/a)}let A=[];for(let e=0,t=D.length,n=t-1,r=e+1;e=0;e--){let t=e/p,n=u*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+f;for(let e=0,t=D.length;e=0;){let r=n,i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+p*2;e0)&&f.push(t,i,c),(e!==n-1||s0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:``,PHYSICAL:``},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},TN=class extends hA{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=jD,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},EN=class extends hA{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type=`MeshDistanceMaterial`,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};function DN(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}var ON=class{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r===void 0?new t.constructor(n):r,this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];validate_interval:{seek:{let a;linear_scan:{forward_scan:if(!(e=i)){let o=t[1];e=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n>>1;et;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(KD(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(KD(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){KD(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){KD(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&BD(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){KD(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===DD,i=e.length-1,a=1;for(let o=1;o0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};MN.prototype.ValueTypeName=``,MN.prototype.TimeBufferType=Float32Array,MN.prototype.ValueBufferType=Float32Array,MN.prototype.DefaultInterpolation=ED;var NN=class extends MN{constructor(e,t,n){super(e,t,n)}};NN.prototype.ValueTypeName=`bool`,NN.prototype.ValueBufferType=Array,NN.prototype.DefaultInterpolation=TD,NN.prototype.InterpolantFactoryMethodLinear=void 0,NN.prototype.InterpolantFactoryMethodSmooth=void 0;var PN=class extends MN{constructor(e,t,n,r){super(e,t,n,r)}};PN.prototype.ValueTypeName=`color`;var FN=class extends MN{constructor(e,t,n,r){super(e,t,n,r)}};FN.prototype.ValueTypeName=`number`;var IN=class extends ON{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;c+=4)CO.slerpFlat(i,0,a,c-o,a,c,s);return i}},LN=class extends MN{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new IN(this.times,this.values,this.getValueSize(),e)}};LN.prototype.ValueTypeName=`quaternion`,LN.prototype.InterpolantFactoryMethodSmooth=void 0;var RN=class extends MN{constructor(e,t,n){super(e,t,n)}};RN.prototype.ValueTypeName=`string`,RN.prototype.ValueBufferType=Array,RN.prototype.DefaultInterpolation=TD,RN.prototype.InterpolantFactoryMethodLinear=void 0,RN.prototype.InterpolantFactoryMethodSmooth=void 0;var zN=class extends MN{constructor(e,t,n,r){super(e,t,n,r)}};zN.prototype.ValueTypeName=`vector`;var BN={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},VN=new class{constructor(e,t,n){let r=this,i=!1,a=0,o=0,s,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,i===!1&&r.onStart!==void 0&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,r.onProgress!==void 0&&r.onProgress(e,a,o),a===o&&(i=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(e){r.onError!==void 0&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){let t=c.indexOf(e);return t!==-1&&c.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=c.length;t{t&&t(i),this.manager.itemEnd(e)},0),i;if(UN[e]!==void 0){UN[e].push({onLoad:t,onProgress:n,onError:r});return}UN[e]=[],UN[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`,signal:typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&GD(`FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=UN[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){t();function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e{e.error(t)})}}});return new Response(c)}throw new WN(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>new DOMParser().parseFromString(e,o));case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{BN.add(`file:${e}`,t);let n=UN[e];delete UN[e];for(let e=0,r=n.length;e{let n=UN[e];if(n===void 0)throw this.manager.itemError(e),t;delete UN[e];for(let e=0,r=n.length;e{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},KN=class extends qk{constructor(e,t=1){super(),this.isLight=!0,this.type=`Light`,this.color=new fA(e),this.intensity=t}dispose(){this.dispatchEvent({type:`dispose`})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}},qN=new bk,JN=new Z,YN=new Z,XN=class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new X(512,512),this.mapType=bE,this.map=null,this.mapPass=null,this.matrix=new bk,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Sj,this._frameExtents=new X(1,1),this._viewportCount=1,this._viewports=[new HO(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;JN.setFromMatrixPosition(e.matrixWorld),t.position.copy(JN),YN.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(YN),t.updateMatrixWorld(),qN.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(qN,t.coordinateSystem,t.reversedDepth),t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(qN)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},ZN=class extends XN{constructor(){super(new ij(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){let t=this.camera,n=$D*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,i=e.distance||t.far;(n!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},QN=class extends KN{constructor(e,t,n=0,r=Math.PI/3,i=0,a=2){super(e,t),this.isSpotLight=!0,this.type=`SpotLight`,this.position.copy(qk.DEFAULT_UP),this.updateMatrix(),this.target=new qk,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new ZN}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}},$N=class extends XN{constructor(){super(new ij(90,1,.5,500)),this.isPointLightShadow=!0}},eP=class extends KN{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type=`PointLight`,this.distance=n,this.decay=r,this.shadow=new $N}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}},tP=class extends ej{constructor(e=-1,t=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type=`OrthographicCamera`,this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(this.view!==null&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},nP=class extends XN{constructor(){super(new tP(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},rP=class extends KN{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type=`DirectionalLight`,this.position.copy(qk.DEFAULT_UP),this.updateMatrix(),this.target=new qk,this.shadow=new nP}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){let t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}},iP=class extends KN{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type=`AmbientLight`}},aP=class extends KN{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type=`RectAreaLight`,this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}},oP=class extends ij{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},sP=`\\[\\]\\.:\\/`,cP=RegExp(`[\\[\\]\\.:\\/]`,`g`),lP=`[^\\[\\]\\.:\\/]`,uP=`[^`+sP.replace(`\\.`,``)+`]`,dP=`((?:WC+[\\/:])*)`.replace(`WC`,lP),fP=`(WCOD+)?`.replace(`WCOD`,uP),pP=`(?:\\.(WC+)(?:\\[(.+)\\])?)?`.replace(`WC`,lP),mP=`\\.(WC+)(?:\\[(.+)\\])?`.replace(`WC`,lP),hP=RegExp(`^`+dP+fP+pP+mP+`$`),gP=[`material`,`materials`,`bones`,`map`],_P=class{constructor(e,t,n){let r=n||vP.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},vP=class e{constructor(t,n,r){this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(cP,``)}static parseTrackName(e){let t=hP.exec(e);if(t===null)throw Error(`PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);gP.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(e){for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{wP.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(wP,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},OP=class extends Fj{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new jA;r.setAttribute(`position`,new CA(t,3)),r.setAttribute(`color`,new CA(n,3));let i=new Cj({vertexColors:!0,toneMapped:!1});super(r,i),this.type=`AxesHelper`}setColors(e,t,n){let r=new fA,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},kP=class{constructor(){this.type=`ShapePath`,this.color=new fA,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new AM,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e){let t=[];for(let n=0,r=e.length;n2**-52){if(c<0&&(n=t[a],s=-s,o=t[i],c=-c),e.yo.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{let t=c*(e.x-n.x)-s*(e.y-n.y);if(t===0)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}let r=fN.isClockWise,i=this.subPaths;if(i.length===0)return[];let a,o,s,c=[];if(i.length===1)return o=i[0],s=new jM,s.curves=o.curves,c.push(s),c;let l=!r(i[0].getPoints());l=e?!l:l;let u=[],d=[],f=[],p=0,m;d[p]=void 0,f[p]=[];for(let t=0,n=i.length;t1){let e=!1,t=0;for(let e=0,t=d.length;e0&&e===!1&&(f=u)}let h;for(let e=0,t=d.length;ee.start-t.start);let t=0;for(let e=1;e 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif - #endif -#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,color_fragment:`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,color_pars_fragment:`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,color_pars_vertex:`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - varying vec3 vColor; -#endif`,color_vertex:`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif -#ifdef USE_BATCHING_COLOR - vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); - vColor.xyz *= batchingColor.xyz; -#endif`,common:`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -#ifdef USE_ALPHAHASH - varying vec3 vPosition; -#endif -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} -float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal; -#ifdef USE_TANGENT - vec3 transformedTangent = objectTangent; -#endif -#ifdef USE_BATCHING - mat3 bm = mat3( batchingMatrix ); - transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); - transformedNormal = bm * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = bm * transformedTangent; - #endif -#endif -#ifdef USE_INSTANCING - mat3 im = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); - transformedNormal = im * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = im * transformedTangent; - #endif -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE - emissiveColor = sRGBTransferEOTF( emissiveColor ); - #endif - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,colorspace_fragment:`gl_FragColor = linearToOutputTexel( gl_FragColor );`,colorspace_pars_fragment:`vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferEOTF( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 sRGBTransferOETF( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,envmap_fragment:`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform mat3 envMapRotation; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif -#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,envmap_physical_pars_fragment:`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,envmap_vertex:`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,fog_vertex:`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,fog_pars_vertex:`#ifdef USE_FOG - varying float vFogDepth; -#endif`,fog_fragment:`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,fog_pars_fragment:`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return vec3( texture2D( gradientMap, coord ).r ); - #else - vec2 fw = fwidth( coord ) * 0.5; - return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); - #endif -}`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,lights_lambert_fragment:`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,lights_lambert_pars_fragment:`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,lights_pars_begin:`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -#if defined( USE_LIGHT_PROBES ) - uniform vec3 lightProbe[ 9 ]; -#endif -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometryPosition; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometryPosition; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,lights_toon_fragment:`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,lights_toon_pars_fragment:`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,lights_phong_fragment:`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,lights_physical_fragment:`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -material.metalness = metalnessFactor; -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef USE_SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULAR_COLORMAP - specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor; - material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = vec3( 0.04 ); - material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_DISPERSION - material.dispersion = dispersion; -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - if( material.anisotropy == 0.0 ) { - anisotropyV = vec2( 1.0, 0.0 ); - } else { - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - } - material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); - material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; - material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,lights_physical_pars_fragment:`uniform sampler2D dfgLUT; -struct PhysicalMaterial { - vec3 diffuseColor; - vec3 diffuseContribution; - vec3 specularColor; - vec3 specularColorBlended; - float roughness; - float metalness; - float specularF90; - float dispersion; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - vec3 iridescenceFresnelDielectric; - vec3 iridescenceFresnelMetallic; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 clearcoatSpecularDirect = vec3( 0.0 ); -vec3 clearcoatSpecularIndirect = vec3( 0.0 ); -vec3 sheenSpecularDirect = vec3( 0.0 ); -vec3 sheenSpecularIndirect = vec3(0.0 ); -vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { - float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); - float x2 = x * x; - float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); - return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); -} -float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -#ifdef USE_ANISOTROPY - float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { - float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); - float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); - float v = 0.5 / ( gv + gl ); - return v; - } - float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { - float a2 = alphaT * alphaB; - highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); - highp float v2 = dot( v, v ); - float w2 = a2 / v2; - return RECIPROCAL_PI * a2 * pow2 ( w2 ); - } -#endif -#ifdef USE_CLEARCOAT - vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { - vec3 f0 = material.clearcoatF0; - float f90 = material.clearcoatF90; - float roughness = material.clearcoatRoughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( V * D ); - } -#endif -vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 f0 = material.specularColorBlended; - float f90 = material.specularF90; - float roughness = material.roughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - #ifdef USE_IRIDESCENCE - F = mix( F, material.iridescenceFresnel, material.iridescence ); - #endif - #ifdef USE_ANISOTROPY - float dotTL = dot( material.anisotropyT, lightDir ); - float dotTV = dot( material.anisotropyT, viewDir ); - float dotTH = dot( material.anisotropyT, halfDir ); - float dotBL = dot( material.anisotropyB, lightDir ); - float dotBV = dot( material.anisotropyB, viewDir ); - float dotBH = dot( material.anisotropyB, halfDir ); - float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); - float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); - #else - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - #endif - return F * ( V * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float rInv = 1.0 / ( roughness + 0.1 ); - float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv; - float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv; - float DG = exp( a * dotNV + b ); - return saturate( DG ); -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg; - vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg; - vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y; - vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y; - float Ess_V = dfgV.x + dfgV.y; - float Ess_L = dfgL.x + dfgL.y; - float Ems_V = 1.0 - Ess_V; - float Ems_L = 1.0 - Ess_L; - vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619; - vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON ); - float compensationFactor = Ems_V * Ems_L; - vec3 multiScatter = Fms * compensationFactor; - return singleScatter + multiScatter; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometryNormal; - vec3 viewDir = geometryViewDir; - vec3 position = geometryPosition; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColorBlended * t2.x + ( vec3( 1.0 ) - material.specularColorBlended ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - - sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); - - float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness ); - - float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL ); - - irradiance *= sheenEnergyComp; - - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution ); - #ifdef USE_SHEEN - float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; - diffuse *= sheenEnergyComp; - #endif - reflectedLight.indirectDiffuse += diffuse; -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI; - #endif - vec3 singleScatteringDielectric = vec3( 0.0 ); - vec3 multiScatteringDielectric = vec3( 0.0 ); - vec3 singleScatteringMetallic = vec3( 0.0 ); - vec3 multiScatteringMetallic = vec3( 0.0 ); - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); - computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); - #endif - vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness ); - vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness ); - vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric; - vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - vec3 indirectSpecular = radiance * singleScattering; - indirectSpecular += multiScattering * cosineWeightedIrradiance; - vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance; - #ifdef USE_SHEEN - float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; - indirectSpecular *= sheenEnergyComp; - indirectDiffuse *= sheenEnergyComp; - #endif - reflectedLight.indirectSpecular += indirectSpecular; - reflectedLight.indirectDiffuse += indirectDiffuse; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,lights_fragment_begin:` -vec3 geometryPosition = - vViewPosition; -vec3 geometryNormal = normal; -vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -vec3 geometryClearcoatNormal = vec3( 0.0 ); -#ifdef USE_CLEARCOAT - geometryClearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometryViewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor ); - material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometryPosition, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - #ifdef USE_ANISOTROPY - radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); - #else - radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); - #endif - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,logdepthbuf_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) - gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER - varying float vFragDepth; - varying float vIsPerspective; -#endif`,logdepthbuf_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,map_fragment:`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,map_pars_fragment:`#ifdef USE_MAP - uniform sampler2D map; -#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - #if defined( USE_POINTS_UV ) - vec2 uv = vUv; - #else - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; - #endif -#endif -#ifdef USE_MAP - diffuseColor *= texture2D( map, uv ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,map_particle_pars_fragment:`#if defined( USE_POINTS_UV ) - varying vec2 vUv; -#else - #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; - #endif -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,metalnessmap_fragment:`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,morphinstance_vertex:`#ifdef USE_INSTANCING_MORPH - float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; - } -#endif`,morphcolor_vertex:`#if defined( USE_MORPHCOLORS ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS - #ifndef USE_INSTANCING_MORPH - uniform float morphTargetBaseInfluence; - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - #endif - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } -#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,normal_fragment_begin:`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal *= faceDirection; - #endif -#endif -#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, - #if defined( USE_NORMALMAP ) - vNormalMapUv - #elif defined( USE_CLEARCOAT_NORMALMAP ) - vClearcoatNormalMapUv - #else - vUv - #endif - ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - #endif -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - #ifdef USE_TANGENT - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - #endif -#endif -vec3 nonPerturbedNormal = normal;`,normal_fragment_maps:`#ifdef USE_NORMALMAP_OBJECTSPACE - normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( USE_NORMALMAP_TANGENTSPACE ) - vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - normal = normalize( tbn * mapN ); -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,normal_pars_fragment:`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,normal_pars_vertex:`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,normal_vertex:`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef USE_NORMALMAP_OBJECTSPACE - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) - mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); - return mat3( T * scale, B * scale, N ); - } -#endif`,clearcoat_normal_fragment_begin:`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,clearcoat_pars_fragment:`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif`,iridescence_pars_fragment:`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,opaque_fragment:`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,packing:`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; -const float Inv255 = 1. / 255.; -const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); -const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); -const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); -const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); -vec4 packDepthToRGBA( const in float v ) { - if( v <= 0.0 ) - return vec4( 0., 0., 0., 0. ); - if( v >= 1.0 ) - return vec4( 1., 1., 1., 1. ); - float vuf; - float af = modf( v * PackFactors.a, vuf ); - float bf = modf( vuf * ShiftRight8, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); -} -vec3 packDepthToRGB( const in float v ) { - if( v <= 0.0 ) - return vec3( 0., 0., 0. ); - if( v >= 1.0 ) - return vec3( 1., 1., 1. ); - float vuf; - float bf = modf( v * PackFactors.b, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec3( vuf * Inv255, gf * PackUpscale, bf ); -} -vec2 packDepthToRG( const in float v ) { - if( v <= 0.0 ) - return vec2( 0., 0. ); - if( v >= 1.0 ) - return vec2( 1., 1. ); - float vuf; - float gf = modf( v * 256., vuf ); - return vec2( vuf * Inv255, gf ); -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors4 ); -} -float unpackRGBToDepth( const in vec3 v ) { - return dot( v, UnpackFactors3 ); -} -float unpackRGToDepth( const in vec2 v ) { - return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; -} -vec4 pack2HalfToRGBA( const in vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( const in vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - return depth * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_BATCHING - mvPosition = batchingMatrix * mvPosition; -#endif -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,dithering_pars_fragment:`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,roughnessmap_fragment:`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,shadowmap_pars_fragment:`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - #if defined( SHADOWMAP_TYPE_PCF ) - uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - #else - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - #if defined( SHADOWMAP_TYPE_PCF ) - uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - #else - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #if defined( SHADOWMAP_TYPE_PCF ) - uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - #elif defined( SHADOWMAP_TYPE_BASIC ) - uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - #if defined( SHADOWMAP_TYPE_PCF ) - float interleavedGradientNoise( vec2 position ) { - return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) ); - } - vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) { - const float goldenAngle = 2.399963229728653; - float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) ); - float theta = float( sampleIndex ) * goldenAngle + phi; - return vec2( cos( theta ), sin( theta ) ) * r; - } - #endif - #if defined( SHADOWMAP_TYPE_PCF ) - float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float radius = shadowRadius * texelSize.x; - float phi = interleavedGradientNoise( gl_FragCoord.xy ) * 6.28318530718; - shadow = ( - texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) + - texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) + - texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) + - texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) + - texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) ) - ) * 0.2; - } - return mix( 1.0, shadow, shadowIntensity ); - } - #elif defined( SHADOWMAP_TYPE_VSM ) - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg; - float mean = distribution.x; - float variance = distribution.y * distribution.y; - #ifdef USE_REVERSED_DEPTH_BUFFER - float hard_shadow = step( mean, shadowCoord.z ); - #else - float hard_shadow = step( shadowCoord.z, mean ); - #endif - if ( hard_shadow == 1.0 ) { - shadow = 1.0; - } else { - variance = max( variance, 0.0000001 ); - float d = shadowCoord.z - mean; - float p_max = variance / ( variance + d * d ); - p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 ); - shadow = max( hard_shadow, p_max ); - } - } - return mix( 1.0, shadow, shadowIntensity ); - } - #else - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - float depth = texture2D( shadowMap, shadowCoord.xy ).r; - #ifdef USE_REVERSED_DEPTH_BUFFER - shadow = step( depth, shadowCoord.z ); - #else - shadow = step( shadowCoord.z, depth ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #if defined( SHADOWMAP_TYPE_PCF ) - float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - float shadow = 1.0; - vec3 lightToPosition = shadowCoord.xyz; - vec3 bd3D = normalize( lightToPosition ); - vec3 absVec = abs( lightToPosition ); - float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); - if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { - float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); - dp += shadowBias; - float texelSize = shadowRadius / shadowMapSize.x; - vec3 absDir = abs( bd3D ); - vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 ); - tangent = normalize( cross( bd3D, tangent ) ); - vec3 bitangent = cross( bd3D, tangent ); - float phi = interleavedGradientNoise( gl_FragCoord.xy ) * 6.28318530718; - shadow = ( - texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 0, 5, phi ).x + bitangent * vogelDiskSample( 0, 5, phi ).y ) * texelSize, dp ) ) + - texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 1, 5, phi ).x + bitangent * vogelDiskSample( 1, 5, phi ).y ) * texelSize, dp ) ) + - texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 2, 5, phi ).x + bitangent * vogelDiskSample( 2, 5, phi ).y ) * texelSize, dp ) ) + - texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 3, 5, phi ).x + bitangent * vogelDiskSample( 3, 5, phi ).y ) * texelSize, dp ) ) + - texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 4, 5, phi ).x + bitangent * vogelDiskSample( 4, 5, phi ).y ) * texelSize, dp ) ) - ) * 0.2; - } - return mix( 1.0, shadow, shadowIntensity ); - } - #elif defined( SHADOWMAP_TYPE_BASIC ) - float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - float shadow = 1.0; - vec3 lightToPosition = shadowCoord.xyz; - vec3 bd3D = normalize( lightToPosition ); - vec3 absVec = abs( lightToPosition ); - float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); - if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { - float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); - dp += shadowBias; - float depth = textureCube( shadowMap, bd3D ).r; - #ifdef USE_REVERSED_DEPTH_BUFFER - shadow = step( depth, dp ); - #else - shadow = step( dp, depth ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } - #endif - #endif -#endif`,shadowmap_pars_vertex:`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,shadowmap_vertex:`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; -#endif -#if defined( USE_SHADOWMAP ) - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif -#if NUM_SPOT_LIGHT_COORDS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { - shadowWorldPosition = worldPosition; - #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; - #endif - vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end -#endif`,shadowmask_pars_fragment:`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,skinbase_vertex:`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - mat4 getBoneMatrix( const in float i ) { - int size = textureSize( boneTexture, 0 ).x; - int j = int( i ) * 4; - int x = j % size; - int y = j / size; - vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); - vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); - vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); - vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); - return mat4( v1, v2, v3, v4 ); - } -#endif`,skinning_vertex:`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,skinnormal_vertex:`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,specularmap_fragment:`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,tonemapping_pars_fragment:`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 CineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 NeutralToneMapping( vec3 color ) { - const float StartCompression = 0.8 - 0.04; - const float Desaturation = 0.15; - color *= toneMappingExposure; - float x = min( color.r, min( color.g, color.b ) ); - float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; - color -= offset; - float peak = max( color.r, max( color.g, color.b ) ); - if ( peak < StartCompression ) return color; - float d = 1. - StartCompression; - float newPeak = 1. - d * d / ( peak + d - StartCompression ); - color *= newPeak / peak; - float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); - return mix( color, vec3( newPeak ), g ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,transmission_fragment:`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,transmission_pars_fragment:`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec4 transmittedLight; - vec3 transmittance; - #ifdef USE_DISPERSION - float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; - vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); - for ( int i = 0; i < 3; i ++ ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); - transmittedLight[ i ] = transmissionSample[ i ]; - transmittedLight.a += transmissionSample.a; - transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; - } - transmittedLight.a /= 3.0; - #else - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - #endif - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,uv_pars_fragment:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - varying vec2 vNormalMapUv; -#endif -#ifdef USE_EMISSIVEMAP - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_SPECULARMAP - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,uv_pars_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - uniform mat3 mapTransform; - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - uniform mat3 alphaMapTransform; - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - uniform mat3 lightMapTransform; - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - uniform mat3 aoMapTransform; - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - uniform mat3 bumpMapTransform; - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - uniform mat3 normalMapTransform; - varying vec2 vNormalMapUv; -#endif -#ifdef USE_DISPLACEMENTMAP - uniform mat3 displacementMapTransform; - varying vec2 vDisplacementMapUv; -#endif -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapTransform; - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - uniform mat3 metalnessMapTransform; - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - uniform mat3 roughnessMapTransform; - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - uniform mat3 anisotropyMapTransform; - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - uniform mat3 clearcoatMapTransform; - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform mat3 clearcoatNormalMapTransform; - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform mat3 clearcoatRoughnessMapTransform; - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - uniform mat3 sheenColorMapTransform; - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - uniform mat3 sheenRoughnessMapTransform; - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - uniform mat3 iridescenceMapTransform; - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform mat3 iridescenceThicknessMapTransform; - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SPECULARMAP - uniform mat3 specularMapTransform; - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - uniform mat3 specularColorMapTransform; - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - uniform mat3 specularIntensityMapTransform; - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,uv_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - vUv = vec3( uv, 1 ).xy; -#endif -#ifdef USE_MAP - vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ALPHAMAP - vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_LIGHTMAP - vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_AOMAP - vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_BUMPMAP - vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_NORMALMAP - vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_DISPLACEMENTMAP - vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_EMISSIVEMAP - vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_METALNESSMAP - vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ROUGHNESSMAP - vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ANISOTROPYMAP - vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOATMAP - vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCEMAP - vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_COLORMAP - vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULARMAP - vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_COLORMAP - vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_TRANSMISSIONMAP - vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_THICKNESSMAP - vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_BATCHING - worldPosition = batchingMatrix * worldPosition; - #endif - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`,background_vert:`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,background_frag:`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,backgroundCube_vert:`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,backgroundCube_frag:`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -uniform mat3 backgroundRotation; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,cube_vert:`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,cube_frag:`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,depth_vert:`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,depth_frag:`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - #ifdef USE_REVERSED_DEPTH_BUFFER - float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; - #else - float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; - #endif - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #elif DEPTH_PACKING == 3202 - gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); - #elif DEPTH_PACKING == 3203 - gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); - #endif -}`,distance_vert:`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,distance_frag:`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 ); -}`,equirect_vert:`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,equirect_frag:`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,linedashed_vert:`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,linedashed_frag:`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,meshbasic_vert:`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,meshbasic_frag:`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,meshlambert_vert:`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,meshlambert_frag:`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,meshmatcap_vert:`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,meshmatcap_frag:`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,meshnormal_vert:`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,meshnormal_frag:`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,meshphong_vert:`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,meshphong_frag:`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,meshphysical_vert:`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,meshphysical_frag:`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_DISPERSION - uniform float dispersion; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - - outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect; - - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,meshtoon_vert:`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,meshtoon_frag:`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,points_vert:`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -#ifdef USE_POINTS_UV - varying vec2 vUv; - uniform mat3 uvTransform; -#endif -void main() { - #ifdef USE_POINTS_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #include - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,points_frag:`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,shadow_vert:`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,shadow_frag:`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,sprite_vert:`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix[ 3 ]; - vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,sprite_frag:`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`},$={common:{diffuse:{value:new fA(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new EO},alphaMap:{value:null},alphaMapTransform:{value:new EO},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new EO}},envmap:{envMap:{value:null},envMapRotation:{value:new EO},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new EO}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new EO}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new EO},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new EO},normalScale:{value:new X(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new EO},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new EO}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new EO}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new EO}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fA(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fA(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new EO},alphaTest:{value:0},uvTransform:{value:new EO}},sprite:{diffuse:{value:new fA(16777215)},opacity:{value:1},center:{value:new X(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new EO},alphaMap:{value:null},alphaMapTransform:{value:new EO},alphaTest:{value:0}}},IP={basic:{uniforms:qA([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.fog]),vertexShader:FP.meshbasic_vert,fragmentShader:FP.meshbasic_frag},lambert:{uniforms:qA([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.fog,$.lights,{emissive:{value:new fA(0)}}]),vertexShader:FP.meshlambert_vert,fragmentShader:FP.meshlambert_frag},phong:{uniforms:qA([$.common,$.specularmap,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.fog,$.lights,{emissive:{value:new fA(0)},specular:{value:new fA(1118481)},shininess:{value:30}}]),vertexShader:FP.meshphong_vert,fragmentShader:FP.meshphong_frag},standard:{uniforms:qA([$.common,$.envmap,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.roughnessmap,$.metalnessmap,$.fog,$.lights,{emissive:{value:new fA(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:FP.meshphysical_vert,fragmentShader:FP.meshphysical_frag},toon:{uniforms:qA([$.common,$.aomap,$.lightmap,$.emissivemap,$.bumpmap,$.normalmap,$.displacementmap,$.gradientmap,$.fog,$.lights,{emissive:{value:new fA(0)}}]),vertexShader:FP.meshtoon_vert,fragmentShader:FP.meshtoon_frag},matcap:{uniforms:qA([$.common,$.bumpmap,$.normalmap,$.displacementmap,$.fog,{matcap:{value:null}}]),vertexShader:FP.meshmatcap_vert,fragmentShader:FP.meshmatcap_frag},points:{uniforms:qA([$.points,$.fog]),vertexShader:FP.points_vert,fragmentShader:FP.points_frag},dashed:{uniforms:qA([$.common,$.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:FP.linedashed_vert,fragmentShader:FP.linedashed_frag},depth:{uniforms:qA([$.common,$.displacementmap]),vertexShader:FP.depth_vert,fragmentShader:FP.depth_frag},normal:{uniforms:qA([$.common,$.bumpmap,$.normalmap,$.displacementmap,{opacity:{value:1}}]),vertexShader:FP.meshnormal_vert,fragmentShader:FP.meshnormal_frag},sprite:{uniforms:qA([$.sprite,$.fog]),vertexShader:FP.sprite_vert,fragmentShader:FP.sprite_frag},background:{uniforms:{uvTransform:{value:new EO},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:FP.background_vert,fragmentShader:FP.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new EO}},vertexShader:FP.backgroundCube_vert,fragmentShader:FP.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:FP.cube_vert,fragmentShader:FP.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:FP.equirect_vert,fragmentShader:FP.equirect_frag},distance:{uniforms:qA([$.common,$.displacementmap,{referencePosition:{value:new Z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:FP.distance_vert,fragmentShader:FP.distance_frag},shadow:{uniforms:qA([$.lights,$.fog,{color:{value:new fA(0)},opacity:{value:1}}]),vertexShader:FP.shadow_vert,fragmentShader:FP.shadow_frag}};IP.physical={uniforms:qA([IP.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new EO},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new EO},clearcoatNormalScale:{value:new X(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new EO},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new EO},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new EO},sheen:{value:0},sheenColor:{value:new fA(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new EO},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new EO},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new EO},transmissionSamplerSize:{value:new X},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new EO},attenuationDistance:{value:0},attenuationColor:{value:new fA(0)},specularColor:{value:new fA(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new EO},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new EO},anisotropyVector:{value:new X},anisotropyMap:{value:null},anisotropyMapTransform:{value:new EO}}]),vertexShader:FP.meshphysical_vert,fragmentShader:FP.meshphysical_frag};var LP={r:0,b:0,g:0},RP=new Ak,zP=new bk;function BP(e,t,n,r,i,a,o){let s=new fA(0),c=a===!0?0:1,l,u,d=null,f=0,p=null;function m(e){let r=e.isScene===!0?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?n:t).get(r)),r}function h(t){let n=!1,i=m(t);i===null?_(s,c):i&&i.isColor&&(_(i,1),n=!0);let a=e.xr.getEnvironmentBlendMode();a===`additive`?r.buffers.color.setClear(0,0,0,1,o):a===`alpha-blend`&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function g(t,n){let r=m(n);r&&(r.isCubeTexture||r.mapping===306)?(u===void 0&&(u=new Q(new GA(1,1,1),new $A({name:`BackgroundCubeMaterial`,uniforms:KA(IP.backgroundCube.uniforms),vertexShader:IP.backgroundCube.vertexShader,fragmentShader:IP.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute(`normal`),u.geometry.deleteAttribute(`uv`),u.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),RP.copy(n.backgroundRotation),RP.x*=-1,RP.y*=-1,RP.z*=-1,r.isCubeTexture&&r.isRenderTargetTexture===!1&&(RP.y*=-1,RP.z*=-1),u.material.uniforms.envMap.value=r,u.material.uniforms.flipEnvMap.value=r.isCubeTexture&&r.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(zP.makeRotationFromEuler(RP)),u.material.toneMapped=jO.getTransfer(r.colorSpace)!==FD,(d!==r||f!==r.version||p!==e.toneMapping)&&(u.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),u.layers.enableAll(),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(l===void 0&&(l=new Q(new yN(2,2),new $A({name:`BackgroundMaterial`,uniforms:KA(IP.background.uniforms),vertexShader:IP.background.vertexShader,fragmentShader:IP.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=r,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=jO.getTransfer(r.colorSpace)!==FD,r.matrixAutoUpdate===!0&&r.updateMatrix(),l.material.uniforms.uvTransform.value.copy(r.matrix),(d!==r||f!==r.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,d=r,f=r.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))}function _(t,n){t.getRGB(LP,YA(e)),r.buffers.color.setClear(LP.r,LP.g,LP.b,n,o)}function v(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return s},setClearColor:function(e,t=1){s.set(e),c=t,_(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,_(s,c)},render:h,addToRenderList:g,dispose:v}}function VP(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=f(null),a=i,o=!1;function s(n,r,i,s,c){let u=!1,f=d(s,i,r);a!==f&&(a=f,l(a.object)),u=p(n,s,i,c),u&&m(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(u||o)&&(o=!1,b(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function c(){return e.createVertexArray()}function l(t){return e.bindVertexArray(t)}function u(t){return e.deleteVertexArray(t)}function d(e,t,n){let i=n.wireframe===!0,a=r[e.id];a===void 0&&(a={},r[e.id]=a);let o=a[t.id];o===void 0&&(o={},a[t.id]=o);let s=o[i];return s===void 0&&(s=f(c()),o[i]=s),s}function f(e){let t=[],r=[],i=[];for(let e=0;e=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function m(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function h(){let e=a.newAttributes;for(let t=0,n=e.length;t=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let l=n.precision===void 0?`highp`:n.precision,u=c(l);u!==l&&(GD(`WebGLRenderer:`,l,`not supported, using`,u,`instead.`),l=u);let d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`),p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),m=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),g=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),_=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),y=e.getParameter(e.MAX_VARYING_VECTORS),b=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=e.getParameter(e.MAX_SAMPLES),S=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:s,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:v,maxVaryings:y,maxFragmentUniforms:b,maxSamples:x,samples:S}}function WP(e){let t=this,n=null,r=0,i=!1,a=!1,o=new vj,s=new EO,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(t,o,s){let d=t.clippingPlanes,f=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!i||d===null||d.length===0||a&&!p)a?u(null):l();else{let e=a?0:r,t=e*4,i=m.clippingState||null;c.value=i,i=u(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length0){let o=new lj(a.height);return o.fromEquirectangularTexture(e,r),t.set(r,o),r.addEventListener(`dispose`,i),n(o.texture,r.mapping)}return null}}}return r}function i(e){let n=e.target;n.removeEventListener(`dispose`,i);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function a(){t=new WeakMap}return{get:r,dispose:a}}var KP=4,qP=[.125,.215,.35,.446,.526,.582],JP=20,YP=256,XP=new tP,ZP=new fA,QP=null,$P=0,eF=0,tF=!1,nF=new Z,rF=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,i={}){let{size:a=256,position:o=nF}=i;QP=this._renderer.getRenderTarget(),$P=this._renderer.getActiveCubeFace(),eF=this._renderer.getActiveMipmapLevel(),tF=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,r,s,o),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=uF(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=lF(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=uF()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=lF());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;oF(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,XP)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;td-KP?n-d+KP:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,oF(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,XP),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,oF(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,XP)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&KD(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/39,p=i/f,m=isFinite(i)?1+Math.floor(3*p):JP;m>JP&&GD(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${JP}`);let h=[],g=0;for(let e=0;e_-KP?r-_+KP:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,XP)}};function iF(e){let t=[],n=[],r=[],i=e,a=e-KP+1+qP.length;for(let o=0;oe-KP?s=qP[o-e+KP-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new jA;h.setAttribute(`position`,new bA(f,3)),h.setAttribute(`uv`,new bA(p,2)),h.setAttribute(`faceIndex`,new bA(m,1)),r.push(new Q(h,null)),i>KP&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function aF(e,t,n){let r=new WO(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function oF(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function sF(e,t,n){return new $A({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:YP,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:dF(),fragmentShader:` - - precision highp float; - precision highp int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform float roughness; - uniform float mipInt; - - #define ENVMAP_TYPE_CUBE_UV - #include - - #define PI 3.14159265359 - - // Van der Corput radical inverse - float radicalInverse_VdC(uint bits) { - bits = (bits << 16u) | (bits >> 16u); - bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); - bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); - bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); - bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); - return float(bits) * 2.3283064365386963e-10; // / 0x100000000 - } - - // Hammersley sequence - vec2 hammersley(uint i, uint N) { - return vec2(float(i) / float(N), radicalInverse_VdC(i)); - } - - // GGX VNDF importance sampling (Eric Heitz 2018) - // "Sampling the GGX Distribution of Visible Normals" - // https://jcgt.org/published/0007/04/01/ - vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { - float alpha = roughness * roughness; - - // Section 3.2: Transform view direction to hemisphere configuration - vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z)); - - // Section 4.1: Orthonormal basis - float lensq = Vh.x * Vh.x + Vh.y * Vh.y; - vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0); - vec3 T2 = cross(Vh, T1); - - // Section 4.2: Parameterization of projected area - float r = sqrt(Xi.x); - float phi = 2.0 * PI * Xi.y; - float t1 = r * cos(phi); - float t2 = r * sin(phi); - float s = 0.5 * (1.0 + Vh.z); - t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; - - // Section 4.3: Reprojection onto hemisphere - vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh; - - // Section 3.4: Transform back to ellipsoid configuration - return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); - } - - void main() { - vec3 N = normalize(vOutputDirection); - vec3 V = N; // Assume view direction equals normal for pre-filtering - - vec3 prefilteredColor = vec3(0.0); - float totalWeight = 0.0; - - // For very low roughness, just sample the environment directly - if (roughness < 0.001) { - gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); - return; - } - - // Tangent space basis for VNDF sampling - vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); - vec3 tangent = normalize(cross(up, N)); - vec3 bitangent = cross(N, tangent); - - for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { - vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); - - // For PMREM, V = N, so in tangent space V is always (0, 0, 1) - vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); - - // Transform H back to world space - vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); - vec3 L = normalize(2.0 * dot(V, H) * H - V); - - float NdotL = max(dot(N, L), 0.0); - - if(NdotL > 0.0) { - // Sample environment at fixed mip level - // VNDF importance sampling handles the distribution filtering - vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); - - // Weight by NdotL for the split-sum approximation - // VNDF PDF naturally accounts for the visible microfacet distribution - prefilteredColor += sampleColor * NdotL; - totalWeight += NdotL; - } - } - - if (totalWeight > 0.0) { - prefilteredColor = prefilteredColor / totalWeight; - } - - gl_FragColor = vec4(prefilteredColor, 1.0); - } - `,blending:0,depthTest:!1,depthWrite:!1})}function cF(e,t,n){let r=new Float32Array(JP),i=new Z(0,1,0);return new $A({name:`SphericalGaussianBlur`,defines:{n:JP,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:dF(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:0,depthTest:!1,depthWrite:!1})}function lF(){return new $A({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:dF(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:0,depthTest:!1,depthWrite:!1})}function uF(){return new $A({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:dF(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:0,depthTest:!1,depthWrite:!1})}function dF(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function fF(e){let t=new WeakMap,n=null;function r(r){if(r&&r.isTexture){let o=r.mapping,s=o===303||o===304,c=o===301||o===302;if(s||c){let o=t.get(r),l=o===void 0?0:o.texture.pmremVersion;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return n===null&&(n=new rF(e)),o=s?n.fromEquirectangular(r,o):n.fromCubemap(r,o),o.texture.pmremVersion=r.pmremVersion,t.set(r,o),o.texture;if(o!==void 0)return o.texture;{let l=r.image;return s&&l&&l.height>0||c&&l&&i(l)?(n===null&&(n=new rF(e)),o=s?n.fromEquirectangular(r):n.fromCubemap(r),o.texture.pmremVersion=r.pmremVersion,t.set(r,o),r.addEventListener(`dispose`,a),o.texture):null}}}return r}function i(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}function a(e){let n=e.target;n.removeEventListener(`dispose`,a);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function o(){t=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:r,dispose:o}}function pF(e){let t={};function n(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return n(e)!==null},init:function(){n(`EXT_color_buffer_float`),n(`WEBGL_clip_cull_distance`),n(`OES_texture_float_linear`),n(`EXT_color_buffer_half_float`),n(`WEBGL_multisampled_render_to_texture`),n(`WEBGL_render_shared_exponent`)},get:function(e){let t=n(e);return t===null&&qD(`WebGLRenderer: `+e+` extension not supported.`),t}}}function mF(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;s.index!==null&&t.remove(s.index);for(let e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener(`dispose`,o),delete i[s.id];let c=a.get(s);c&&(t.remove(c),a.delete(s)),r.releaseStatesOfGeometry(s),s.isInstancedBufferGeometry===!0&&delete s._maxInstanceCount,n.memory.geometries--}function s(e,t){return i[t.id]===!0?t:(t.addEventListener(`dispose`,o),i[t.id]=!0,n.memory.geometries++,t)}function c(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER)}function l(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;tt.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new GO(h,p,m,u);g.type=EE,g.needsUpdate=!0;let _=f*4;for(let t=0;t - #include - - void main() { - gl_FragColor = texture2D( tDiffuse, vUv ); - - #ifdef LINEAR_TONE_MAPPING - gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); - #elif defined( REINHARD_TONE_MAPPING ) - gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); - #elif defined( CINEON_TONE_MAPPING ) - gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); - #elif defined( ACES_FILMIC_TONE_MAPPING ) - gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); - #elif defined( AGX_TONE_MAPPING ) - gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); - #elif defined( NEUTRAL_TONE_MAPPING ) - gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); - #elif defined( CUSTOM_TONE_MAPPING ) - gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); - #endif - - #ifdef SRGB_TRANSFER - gl_FragColor = sRGBTransferOETF( gl_FragColor ); - #endif - }`,depthTest:!1,depthWrite:!1}),l=new Q(s,c),u=new tP(-1,1,1,-1,0,1),d=null,f=null,p=!1,m,h=null,g=[],_=!1;this.setSize=function(e,t){a.setSize(e,t),o.setSize(e,t);for(let n=0;n0&&g[0].isRenderPass===!0;let t=a.width,n=a.height;for(let e=0;e0)return e;let i=t*n,a=EF[i];if(a===void 0&&(a=new Float32Array(i),EF[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function MF(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}};function OI(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}var kI=37297,AI=0;function jI(e,t){let n=e.split(` -`),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e`:` `} ${i}: ${n[e]}`)}return r.join(` -`)}var MI=new EO;function NI(e){jO._getMatrix(MI,jO.workingColorSpace,e);let t=`mat3( ${MI.elements.map(e=>e.toFixed(4))} )`;switch(jO.getTransfer(e)){case PD:return[t,`LinearTransferOETF`];case FD:return[t,`sRGBTransferOETF`];default:return GD(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function PI(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||``).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+` - -`+i+` - -`+jI(e.getShaderSource(t),r)}return i}function FI(e,t){let n=NI(t);return[`vec4 ${e}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(` -`)}var II={1:`Linear`,2:`Reinhard`,3:`Cineon`,4:`ACESFilmic`,6:`AgX`,7:`Neutral`,5:`Custom`};function LI(e,t){let n=II[t];return n===void 0?(GD(`WebGLProgram: Unsupported toneMapping:`,t),`vec3 `+e+`( vec3 color ) { return LinearToneMapping( color ); }`):`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}var RI=new Z;function zI(){return jO.getLuminanceCoefficients(RI),[`float luminance( const in vec3 rgb ) {`,` const vec3 weights = vec3( ${RI.x.toFixed(4)}, ${RI.y.toFixed(4)}, ${RI.z.toFixed(4)} );`,` return dot( weights, rgb );`,`}`].join(` -`)}function BI(e){return[e.extensionClipCullDistance?`#extension GL_ANGLE_clip_cull_distance : require`:``,e.extensionMultiDraw?`#extension GL_ANGLE_multi_draw : require`:``].filter(UI).join(` -`)}function VI(e){let t=[];for(let n in e){let r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(` -`)}function HI(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function qI(e){return e.replace(KI,YI)}var JI=new Map;function YI(e,t){let n=FP[t];if(n===void 0){let e=JI.get(t);if(e!==void 0)n=FP[e],GD(`WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e);else throw Error(`Can not resolve #include <`+t+`>`)}return qI(n)}var XI=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ZI(e){return e.replace(XI,QI)}function QI(e,t,n,r){let i=``;for(let e=parseInt(t);e0&&(g+=` -`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(UI).join(` -`),_.length>0&&(_+=` -`)):(g=[$I(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.extensionClipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&n.flatShading===!1?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,` attribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,` attribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,` uniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,` attribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,` attribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,` attribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,` attribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,` attribute vec4 color;`,`#elif defined( USE_COLOR )`,` attribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,` attribute vec4 skinIndex;`,` attribute vec4 skinWeight;`,`#endif`,` -`].filter(UI).join(` -`),_=[$I(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matcap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+d:``,f?`#define CUBEUV_TEXEL_WIDTH `+f.texelWidth:``,f?`#define CUBEUV_TEXEL_HEIGHT `+f.texelHeight:``,f?`#define CUBEUV_MAX_MIP `+f.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor||n.batchingColor?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:FP.tonemapping_pars_fragment,n.toneMapping===0?``:LI(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,FP.colorspace_pars_fragment,FI(`linearToOutputTexel`,n.outputColorSpace),zI(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,` -`].filter(UI).join(` -`)),o=qI(o),o=WI(o,n),o=GI(o,n),s=qI(s),s=WI(s,n),s=GI(s,n),o=ZI(o),s=ZI(s),n.isRawShaderMaterial!==!0&&(v=`#version 300 es -`,g=[p,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(` -`)+` -`+g,_=[`#define varying in`,n.glslVersion===`300 es`?``:`layout(location = 0) out highp vec4 pc_fragColor;`,n.glslVersion===`300 es`?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(` -`)+` -`+_);let y=v+g+o,b=v+_+s,x=OI(i,i.VERTEX_SHADER,y),S=OI(i,i.FRAGMENT_SHADER,b);i.attachShader(h,x),i.attachShader(h,S),n.index0AttributeName===void 0?n.morphTargets===!0&&i.bindAttribLocation(h,0,`position`):i.bindAttribLocation(h,0,n.index0AttributeName),i.linkProgram(h);function C(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(h)||``,r=i.getShaderInfoLog(x)||``,a=i.getShaderInfoLog(S)||``,o=n.trim(),s=r.trim(),c=a.trim(),l=!0,u=!0;if(i.getProgramParameter(h,i.LINK_STATUS)===!1){if(l=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,h,x,S);else{let e=PI(i,x,`vertex`),n=PI(i,S,`fragment`);KD(`THREE.WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(h,i.VALIDATE_STATUS)+` - -Material Name: `+t.name+` -Material Type: `+t.type+` - -Program Info Log: `+o+` -`+e+` -`+n)}}else o===``?(s===``||c===``)&&(u=!1):GD(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),w=new DI(i,h),T=HI(i,h)}let w;this.getUniforms=function(){return w===void 0&&C(this),w};let T;this.getAttributes=function(){return T===void 0&&C(this),T};let E=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=i.getProgramParameter(h,kI)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=AI++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}var uL=0,dL=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(i)===!1&&(a.add(i),i.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new fL(e),t.set(e,n)),n}},fL=class{constructor(e){this.id=uL++,this.code=e,this.usedTimes=0}};function pL(e,t,n,r,i,a,o){let s=new jk,c=new dL,l=new Set,u=[],d=new Map,f=i.logarithmicDepthBuffer,p=i.precision,m={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,MeshNormalMaterial:`normal`,MeshBasicMaterial:`basic`,MeshLambertMaterial:`lambert`,MeshPhongMaterial:`phong`,MeshToonMaterial:`toon`,MeshStandardMaterial:`physical`,MeshPhysicalMaterial:`physical`,MeshMatcapMaterial:`matcap`,LineBasicMaterial:`basic`,LineDashedMaterial:`dashed`,PointsMaterial:`points`,ShadowMaterial:`shadow`,SpriteMaterial:`sprite`};function h(e){return l.add(e),e===0?`uv`:`uv${e}`}function g(a,s,u,d,g){let _=d.fog,v=g.geometry,y=a.isMeshStandardMaterial?d.environment:null,b=(a.isMeshStandardMaterial?n:t).get(a.envMap||y),x=b&&b.mapping===306?b.image.height:null,S=m[a.type];a.precision!==null&&(p=i.getMaxPrecision(a.precision),p!==a.precision&&GD(`WebGLProgram.getParameters:`,a.precision,`not supported, using`,p,`instead.`));let C=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,w=C===void 0?0:C.length,T=0;v.morphAttributes.position!==void 0&&(T=1),v.morphAttributes.normal!==void 0&&(T=2),v.morphAttributes.color!==void 0&&(T=3);let E,D,O,ee;if(S){let e=IP[S];E=e.vertexShader,D=e.fragmentShader}else E=a.vertexShader,D=a.fragmentShader,c.update(a),O=c.getVertexShaderID(a),ee=c.getFragmentShaderID(a);let k=e.getRenderTarget(),A=e.state.buffers.depth.getReversed(),te=g.isInstancedMesh===!0,j=g.isBatchedMesh===!0,ne=!!a.map,M=!!a.matcap,N=!!b,re=!!a.aoMap,ie=!!a.lightMap,ae=!!a.bumpMap,oe=!!a.normalMap,se=!!a.displacementMap,ce=!!a.emissiveMap,le=!!a.metalnessMap,ue=!!a.roughnessMap,de=a.anisotropy>0,fe=a.clearcoat>0,pe=a.dispersion>0,me=a.iridescence>0,he=a.sheen>0,ge=a.transmission>0,_e=de&&!!a.anisotropyMap,ve=fe&&!!a.clearcoatMap,P=fe&&!!a.clearcoatNormalMap,ye=fe&&!!a.clearcoatRoughnessMap,be=me&&!!a.iridescenceMap,xe=me&&!!a.iridescenceThicknessMap,Se=he&&!!a.sheenColorMap,Ce=he&&!!a.sheenRoughnessMap,we=!!a.specularMap,Te=!!a.specularColorMap,Ee=!!a.specularIntensityMap,De=ge&&!!a.transmissionMap,Oe=ge&&!!a.thicknessMap,ke=!!a.gradientMap,Ae=!!a.alphaMap,je=a.alphaTest>0,Me=!!a.alphaHash,Ne=!!a.extensions,Pe=0;a.toneMapped&&(k===null||k.isXRRenderTarget===!0)&&(Pe=e.toneMapping);let Fe={shaderID:S,shaderType:a.type,shaderName:a.name,vertexShader:E,fragmentShader:D,defines:a.defines,customVertexShaderID:O,customFragmentShaderID:ee,isRawShaderMaterial:a.isRawShaderMaterial===!0,glslVersion:a.glslVersion,precision:p,batching:j,batchingColor:j&&g._colorsTexture!==null,instancing:te,instancingColor:te&&g.instanceColor!==null,instancingMorph:te&&g.morphTexture!==null,outputColorSpace:k===null?e.outputColorSpace:k.isXRRenderTarget===!0?k.texture.colorSpace:ND,alphaToCoverage:!!a.alphaToCoverage,map:ne,matcap:M,envMap:N,envMapMode:N&&b.mapping,envMapCubeUVHeight:x,aoMap:re,lightMap:ie,bumpMap:ae,normalMap:oe,displacementMap:se,emissiveMap:ce,normalMapObjectSpace:oe&&a.normalMapType===1,normalMapTangentSpace:oe&&a.normalMapType===0,metalnessMap:le,roughnessMap:ue,anisotropy:de,anisotropyMap:_e,clearcoat:fe,clearcoatMap:ve,clearcoatNormalMap:P,clearcoatRoughnessMap:ye,dispersion:pe,iridescence:me,iridescenceMap:be,iridescenceThicknessMap:xe,sheen:he,sheenColorMap:Se,sheenRoughnessMap:Ce,specularMap:we,specularColorMap:Te,specularIntensityMap:Ee,transmission:ge,transmissionMap:De,thicknessMap:Oe,gradientMap:ke,opaque:a.transparent===!1&&a.blending===1&&a.alphaToCoverage===!1,alphaMap:Ae,alphaTest:je,alphaHash:Me,combine:a.combine,mapUv:ne&&h(a.map.channel),aoMapUv:re&&h(a.aoMap.channel),lightMapUv:ie&&h(a.lightMap.channel),bumpMapUv:ae&&h(a.bumpMap.channel),normalMapUv:oe&&h(a.normalMap.channel),displacementMapUv:se&&h(a.displacementMap.channel),emissiveMapUv:ce&&h(a.emissiveMap.channel),metalnessMapUv:le&&h(a.metalnessMap.channel),roughnessMapUv:ue&&h(a.roughnessMap.channel),anisotropyMapUv:_e&&h(a.anisotropyMap.channel),clearcoatMapUv:ve&&h(a.clearcoatMap.channel),clearcoatNormalMapUv:P&&h(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ye&&h(a.clearcoatRoughnessMap.channel),iridescenceMapUv:be&&h(a.iridescenceMap.channel),iridescenceThicknessMapUv:xe&&h(a.iridescenceThicknessMap.channel),sheenColorMapUv:Se&&h(a.sheenColorMap.channel),sheenRoughnessMapUv:Ce&&h(a.sheenRoughnessMap.channel),specularMapUv:we&&h(a.specularMap.channel),specularColorMapUv:Te&&h(a.specularColorMap.channel),specularIntensityMapUv:Ee&&h(a.specularIntensityMap.channel),transmissionMapUv:De&&h(a.transmissionMap.channel),thicknessMapUv:Oe&&h(a.thicknessMap.channel),alphaMapUv:Ae&&h(a.alphaMap.channel),vertexTangents:!!v.attributes.tangent&&(oe||de),vertexColors:a.vertexColors,vertexAlphas:a.vertexColors===!0&&!!v.attributes.color&&v.attributes.color.itemSize===4,pointsUvs:g.isPoints===!0&&!!v.attributes.uv&&(ne||Ae),fog:!!_,useFog:a.fog===!0,fogExp2:!!_&&_.isFogExp2,flatShading:a.flatShading===!0&&a.wireframe===!1,sizeAttenuation:a.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:A,skinning:g.isSkinnedMesh===!0,morphTargets:v.morphAttributes.position!==void 0,morphNormals:v.morphAttributes.normal!==void 0,morphColors:v.morphAttributes.color!==void 0,morphTargetsCount:w,morphTextureStride:T,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&u.length>0,shadowMapType:e.shadowMap.type,toneMapping:Pe,decodeVideoTexture:ne&&a.map.isVideoTexture===!0&&jO.getTransfer(a.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:ce&&a.emissiveMap.isVideoTexture===!0&&jO.getTransfer(a.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===2,flipSided:a.side===1,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:Ne&&a.extensions.clipCullDistance===!0&&r.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(Ne&&a.extensions.multiDraw===!0||j)&&r.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:r.has(`KHR_parallel_shader_compile`),customProgramCacheKey:a.customProgramCacheKey()};return Fe.vertexUv1s=l.has(1),Fe.vertexUv2s=l.has(2),Fe.vertexUv3s=l.has(3),l.clear(),Fe}function _(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(v(n,t),y(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function v(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function y(e,t){s.disableAll(),t.instancing&&s.enable(0),t.instancingColor&&s.enable(1),t.instancingMorph&&s.enable(2),t.matcap&&s.enable(3),t.envMap&&s.enable(4),t.normalMapObjectSpace&&s.enable(5),t.normalMapTangentSpace&&s.enable(6),t.clearcoat&&s.enable(7),t.iridescence&&s.enable(8),t.alphaTest&&s.enable(9),t.vertexColors&&s.enable(10),t.vertexAlphas&&s.enable(11),t.vertexUv1s&&s.enable(12),t.vertexUv2s&&s.enable(13),t.vertexUv3s&&s.enable(14),t.vertexTangents&&s.enable(15),t.anisotropy&&s.enable(16),t.alphaHash&&s.enable(17),t.batching&&s.enable(18),t.dispersion&&s.enable(19),t.batchingColor&&s.enable(20),t.gradientMap&&s.enable(21),e.push(s.mask),s.disableAll(),t.fog&&s.enable(0),t.useFog&&s.enable(1),t.flatShading&&s.enable(2),t.logarithmicDepthBuffer&&s.enable(3),t.reversedDepthBuffer&&s.enable(4),t.skinning&&s.enable(5),t.morphTargets&&s.enable(6),t.morphNormals&&s.enable(7),t.morphColors&&s.enable(8),t.premultipliedAlpha&&s.enable(9),t.shadowMapEnabled&&s.enable(10),t.doubleSided&&s.enable(11),t.flipSided&&s.enable(12),t.useDepthPacking&&s.enable(13),t.dithering&&s.enable(14),t.transmission&&s.enable(15),t.sheen&&s.enable(16),t.opaque&&s.enable(17),t.pointsUvs&&s.enable(18),t.decodeVideoTexture&&s.enable(19),t.decodeVideoTextureEmissive&&s.enable(20),t.alphaToCoverage&&s.enable(21),e.push(s.mask)}function b(e){let t=m[e.type],n;if(t){let e=IP[t];n=XA.clone(e.uniforms)}else n=e.uniforms;return n}function x(t,n){let r=d.get(n);return r===void 0?(r=new lL(e,n,t,a),u.push(r),d.set(n,r)):++r.usedTimes,r}function S(e){if(--e.usedTimes===0){let t=u.indexOf(e);u[t]=u[u.length-1],u.pop(),d.delete(e.cacheKey),e.destroy()}}function C(e){c.remove(e)}function w(){c.dispose()}return{getParameters:g,getProgramCacheKey:_,getUniforms:b,acquireProgram:x,releaseProgram:S,releaseShaderCache:C,programs:u,dispose:w}}function mL(){let e=new WeakMap;function t(t){return e.has(t)}function n(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function r(t){e.delete(t)}function i(t,n,r){e.get(t)[n]=r}function a(){e=new WeakMap}return{has:t,get:n,remove:r,update:i,dispose:a}}function hL(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.z===t.z?e.id-t.id:e.z-t.z:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function gL(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function _L(){let e=[],t=0,n=[],r=[],i=[];function a(){t=0,n.length=0,r.length=0,i.length=0}function o(n,r,i,a,o,s){let c=e[t];return c===void 0?(c={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=i,c.groupOrder=a,c.renderOrder=n.renderOrder,c.z=o,c.group=s),t++,c}function s(e,t,a,s,c,l){let u=o(e,t,a,s,c,l);a.transmission>0?r.push(u):a.transparent===!0?i.push(u):n.push(u)}function c(e,t,a,s,c,l){let u=o(e,t,a,s,c,l);a.transmission>0?r.unshift(u):a.transparent===!0?i.unshift(u):n.unshift(u)}function l(e,t){n.length>1&&n.sort(e||hL),r.length>1&&r.sort(t||gL),i.length>1&&i.sort(t||gL)}function u(){for(let n=t,r=e.length;n=r.length?(i=new _L,r.push(i)):i=r[n],i}function n(){e=new WeakMap}return{get:t,dispose:n}}function yL(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new Z,color:new fA};break;case`SpotLight`:n={position:new Z,direction:new Z,color:new fA,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new Z,color:new fA,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new Z,skyColor:new fA,groundColor:new fA};break;case`RectAreaLight`:n={color:new fA,position:new Z,halfWidth:new Z,halfHeight:new Z}}return e[t.id]=n,n}}}function bL(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new X};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new X};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new X,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}var xL=0;function SL(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+ +!!t.map-!!e.map}function CL(e){let t=new yL,n=bL(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new Z);let i=new Z,a=new bk,o=new bk;function s(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(SL);for(let e=0,y=i.length;e0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=$.LTC_FLOAT_1,r.rectAreaLTC2=$.LTC_FLOAT_2):(r.rectAreaLTC1=$.LTC_HALF_1,r.rectAreaLTC2=$.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=xL++)}function c(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t=i.length?(a=new wL(e),i.push(a)):a=i[r],a}function r(){t=new WeakMap}return{get:n,dispose:r}}var EL=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,DL=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg; - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r; - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); - gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); -}`,OL=[new Z(1,0,0),new Z(-1,0,0),new Z(0,1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1)],kL=[new Z(0,-1,0),new Z(0,-1,0),new Z(0,0,1),new Z(0,0,-1),new Z(0,-1,0),new Z(0,-1,0)],AL=new bk,jL=new Z,ML=new Z;function NL(e,t,n){let r=new Sj,i=new X,a=new X,o=new HO,s=new TN,c=new EN,l={},u=n.maxTextureSize,d={0:1,1:0,2:2},f=new $A({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new X},radius:{value:4}},vertexShader:EL,fragmentShader:DL}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new jA;m.setAttribute(`position`,new bA(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new Q(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;t.type===2&&(GD(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),t.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.depth.getReversed()===!0?f.buffers.color.setClear(0,0,0,0):f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==this.type;p&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;cu||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/m.x),i.x=a.x*m.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/m.y),i.y=a.y*m.y,d.mapSize.y=a.y)),d.map===null||p===!0){if(d.map!==null&&(d.map.depthTexture!==null&&(d.map.depthTexture.dispose(),d.map.depthTexture=null),d.map.dispose()),this.type===3){if(l.isPointLight){GD(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}d.map=new WO(i.x,i.y,{format:BE,type:DE,minFilter:_E,magFilter:_E,generateMipmaps:!1}),d.map.texture.name=l.name+`.shadowMap`,d.map.depthTexture=new Uj(i.x,i.y,EE),d.map.depthTexture.name=l.name+`.shadowMapDepth`,d.map.depthTexture.format=IE,d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=mE,d.map.depthTexture.magFilter=mE}else{l.isPointLight?(d.map=new lj(i.x),d.map.depthTexture=new Wj(i.x,TE)):(d.map=new WO(i.x,i.y),d.map.depthTexture=new Uj(i.x,i.y,TE)),d.map.depthTexture.name=l.name+`.shadowMap`,d.map.depthTexture.format=IE;let t=e.state.buffers.depth.getReversed();this.type===1?(d.map.depthTexture.compareFunction=t?518:515,d.map.depthTexture.minFilter=_E,d.map.depthTexture.magFilter=_E):(d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=mE,d.map.depthTexture.magFilter=mE)}d.camera.updateProjectionMatrix()}let h=d.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,x)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function b(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l=2):(j=parseFloat(/^WebGL (\d)/.exec(ne)[1]),te=j>=1);let M=null,N={},re=e.getParameter(e.SCISSOR_BOX),ie=e.getParameter(e.VIEWPORT),ae=new HO().fromArray(re),oe=new HO().fromArray(ie);function se(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new X,u=new WeakMap,d,f=new WeakMap,p=!1;try{p=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function m(e,t){return p?new OffscreenCanvas(e,t):VD(`canvas`)}function h(e,t,n){let r=1,i=Ce(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);d===void 0&&(d=m(n,a));let o=t?m(n,a):d;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),GD(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}return`data`in e&&GD(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e}return e}function g(e){return e.generateMipmaps}function _(t){e.generateMipmap(t)}function v(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function y(n,r,i,a,o=!1){if(n!==null){if(e[n]!==void 0)return e[n];GD(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let s=r;if(r===e.RED&&(i===e.FLOAT&&(s=e.R32F),i===e.HALF_FLOAT&&(s=e.R16F),i===e.UNSIGNED_BYTE&&(s=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.R8UI),i===e.UNSIGNED_SHORT&&(s=e.R16UI),i===e.UNSIGNED_INT&&(s=e.R32UI),i===e.BYTE&&(s=e.R8I),i===e.SHORT&&(s=e.R16I),i===e.INT&&(s=e.R32I)),r===e.RG&&(i===e.FLOAT&&(s=e.RG32F),i===e.HALF_FLOAT&&(s=e.RG16F),i===e.UNSIGNED_BYTE&&(s=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RG8UI),i===e.UNSIGNED_SHORT&&(s=e.RG16UI),i===e.UNSIGNED_INT&&(s=e.RG32UI),i===e.BYTE&&(s=e.RG8I),i===e.SHORT&&(s=e.RG16I),i===e.INT&&(s=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGB8UI),i===e.UNSIGNED_SHORT&&(s=e.RGB16UI),i===e.UNSIGNED_INT&&(s=e.RGB32UI),i===e.BYTE&&(s=e.RGB8I),i===e.SHORT&&(s=e.RGB16I),i===e.INT&&(s=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(s=e.RGBA16UI),i===e.UNSIGNED_INT&&(s=e.RGBA32UI),i===e.BYTE&&(s=e.RGBA8I),i===e.SHORT&&(s=e.RGBA16I),i===e.INT&&(s=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(s=e.R11F_G11F_B10F)),r===e.RGBA){let t=o?PD:jO.getTransfer(a);i===e.FLOAT&&(s=e.RGBA32F),i===e.HALF_FLOAT&&(s=e.RGBA16F),i===e.UNSIGNED_BYTE&&(s=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return(s===e.R16F||s===e.R32F||s===e.RG16F||s===e.RG32F||s===e.RGBA16F||s===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),s}function b(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,GD(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return g(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function S(e){let t=e.target;t.removeEventListener(`dispose`,S),w(t),t.isVideoTexture&&u.delete(t)}function C(e){let t=e.target;t.removeEventListener(`dispose`,C),E(t)}function w(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=f.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&T(e),Object.keys(i).length===0&&f.delete(n)}r.remove(e)}function T(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=f.get(i);delete a[n.__cacheKey],o.memory.textures--}function E(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r=i.maxTextures&&GD(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),D+=1,e}function k(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function A(t,i){let a=r.get(t);if(t.isVideoTexture&&xe(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)GD(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)GD(`WebGLRenderer: Texture marked for update but image is incomplete`);else{ce(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function te(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ce(a,t,i);return}t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function j(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ce(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function ne(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){le(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let M={[dE]:e.REPEAT,[fE]:e.CLAMP_TO_EDGE,[pE]:e.MIRRORED_REPEAT},N={[mE]:e.NEAREST,[hE]:e.NEAREST_MIPMAP_NEAREST,[gE]:e.NEAREST_MIPMAP_LINEAR,[_E]:e.LINEAR,[vE]:e.LINEAR_MIPMAP_NEAREST,[yE]:e.LINEAR_MIPMAP_LINEAR},re={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function ie(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&GD(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,M[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,M[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,M[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,N[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,N[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,re[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function ae(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,S));let i=n.source,a=f.get(i);a===void 0&&(a={},f.set(i,a));let s=k(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&T(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function oe(e,t,n){return Math.floor(Math.floor(e/n)/t)}function se(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e0){T&&E&&n.texStorage2D(e.TEXTURE_2D,O,S,w[0].width,w[0].height);for(let t=0,r=w.length;t0){let r=jP(C.width,C.height,o.format,o.type);for(let i of o.layerUpdates){let a=C.data.subarray(i*r/C.data.BYTES_PER_ELEMENT,(i+1)*r/C.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,C.width,C.height,1,m,a)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,C.width,C.height,p.depth,m,C.data)}}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,S,C.width,C.height,p.depth,0,C.data,0,0)}else GD(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`)}else T?D&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,C.width,C.height,p.depth,m,v,C.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,S,C.width,C.height,p.depth,0,m,v,C.data)}else{T&&E&&n.texStorage2D(e.TEXTURE_2D,O,S,w[0].width,w[0].height);for(let t=0,r=w.length;t0){let t=jP(p.width,p.height,o.format,o.type);for(let r of o.layerUpdates){let i=p.data.subarray(r*t/p.data.BYTES_PER_ELEMENT,(r+1)*t/p.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,p.width,p.height,1,m,v,i)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)}}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,S,p.width,p.height,p.depth,0,m,v,p.data)}else if(o.isData3DTexture)T?(E&&n.texStorage3D(e.TEXTURE_3D,O,S,p.width,p.height,p.depth),D&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,m,v,p.data)):n.texImage3D(e.TEXTURE_3D,0,S,p.width,p.height,p.depth,0,m,v,p.data);else if(o.isFramebufferTexture){if(E){if(T)n.texStorage2D(e.TEXTURE_2D,O,S,p.width,p.height);else{let t=p.width,r=p.height;for(let i=0;i>=1,r>>=1}}}else if(w.length>0){if(T&&E){let t=Ce(w[0]);n.texStorage2D(e.TEXTURE_2D,O,S,t.width,t.height)}for(let t=0,r=w.length;t0&&D++;let t=Ce(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,t.width,t.height)}for(let t=0;t<6;t++)if(p){w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,b,S,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,m[t].width,m[t].height,0,b,S,m[t].data);for(let r=0;r>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),be(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,ye(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function de(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=b(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;be(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,ye(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,ye(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)for(let e=0;e<6;e++)fe(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?fe(i.__webglFramebuffer[0],t,0):fe(i.__webglFramebuffer,t,0)}}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),de(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),de(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function me(t,n,i){let a=r.get(t);n!==void 0&&ue(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&pe(t)}function he(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,C);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n0){s.__webglFramebuffer=[];for(let t=0;t0&&be(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0){if(be(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function xe(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function Se(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(jO.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&GD(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):KD(`WebGLTextures: Unsupported texture color space:`,n)),t}function Ce(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=ee,this.resetTextureUnits=O,this.setTexture2D=A,this.setTexture2DArray=te,this.setTexture3D=j,this.setTextureCube=ne,this.rebindTextures=me,this.setupRenderTarget=he,this.updateRenderTargetMipmap=ge,this.updateMultisampleRenderTarget=P,this.setupDepthRenderbuffer=pe,this.setupFrameBufferTexture=ue,this.useMultisampledRTT=be,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function LL(e,t){function n(n,r=``){let i,a=jO.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779){if(a===`srgb`){if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null}else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null}if(n===35840||n===35841||n===35842||n===35843){if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null}if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491){if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null}if(n===37808||n===37809||n===37810||n===37811||n===37812||n===37813||n===37814||n===37815||n===37816||n===37817||n===37818||n===37819||n===37820||n===37821){if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null}if(n===36492||n===36494||n===36495){if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null}if(n===36283||n===36284||n===36285||n===36286){if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null}return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert:n}}var RL=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,zL=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`,BL=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new Gj(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new $A({vertexShader:RL,fragmentShader:zL,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Q(new yN(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},VL=class extends YD{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new BL,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new X,C=null,w=new ij;w.viewport=new HO;let T=new ij;T.viewport=new HO;let E=[w,T],D=new oP,O=null,ee=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new fj,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new fj,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new fj,b[e]=t),t.getHandSpace()};function k(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function A(){r.removeEventListener(`select`,k),r.removeEventListener(`selectstart`,k),r.removeEventListener(`selectend`,k),r.removeEventListener(`squeeze`,k),r.removeEventListener(`squeezestart`,k),r.removeEventListener(`squeezeend`,k),r.removeEventListener(`end`,A),r.removeEventListener(`inputsourceschange`,te);for(let e=0;e=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t=x.length){x.push(n),r=e;break}else if(x[e]===null){x[e]=n,r=e;break}if(r===-1)break}let i=b[r];i&&i.connect(n)}}let j=new Z,ne=new Z;function M(e,t,n){j.setFromMatrixPosition(t.matrixWorld),ne.setFromMatrixPosition(n.matrixWorld);let r=j.distanceTo(ne),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function N(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,(O!==D.near||ee!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,ee=D.far),D.layers.mask=e.layers.mask|6,w.layers.mask=D.layers.mask&3,T.layers.mask=D.layers.mask&5;let i=e.parent,a=D.cameras;N(D,i);for(let e=0;e0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,HL.copy(o),HL.x*=-1,HL.y*=-1,HL.z*=-1,a.isCubeTexture&&a.isRenderTargetTexture===!1&&(HL.y*=-1,HL.z*=-1),e.envMapRotation.value.setFromMatrix4(UL.makeRotationFromEuler(HL)),e.flipEnvMap.value=a.isCubeTexture&&a.isRenderTargetTexture===!1?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}function o(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}function s(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function c(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=i*.5,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function l(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function d(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function f(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function p(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}function m(e,t){t.matcap&&(e.matcap.value=t.matcap)}function h(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function GL(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function l(e,n){let o=i[e.id];o===void 0&&(m(e),o=u(e),i[e.id]=o,e.addEventListener(`dispose`,g));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(f(e),a[e.id]=c)}function u(t){let n=d();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function d(){for(let e=0;e0&&(n+=16-r),e.__size=n,e.__cache={},this}function h(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?GD(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):GD(`WebGLRenderer: Unsupported uniform value type.`,e),t}function g(t){let n=t.target;n.removeEventListener(`dispose`,g);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function _(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind:c,update:l,dispose:_}}var KL=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),qL=null;function JL(){return qL===null&&(qL=new mj(KL,16,16,BE,DE),qL.name=`DFG_LUT`,qL.minFilter=_E,qL.magFilter=_E,qL.wrapS=fE,qL.wrapT=fE,qL.generateMipmaps=!1,qL.needsUpdate=!0),qL}var YL=class{constructor(e={}){let{canvas:t=HD(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=bE}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);p=n.getContextAttributes().alpha}else p=a;let m=f,h=new Set([HE,VE,zE]),g=new Set([bE,TE,CE,AE,OE,kE]),_=new Uint32Array(4),v=new Int32Array(4),y=null,b=null,x=[],S=[],C=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let w=this,T=!1;this._outputColorSpace=MD;let E=0,D=0,O=null,ee=-1,k=null,A=new HO,te=new HO,j=null,ne=new fA(0),M=0,N=t.width,re=t.height,ie=1,ae=null,oe=null,se=new HO(0,0,N,re),ce=new HO(0,0,N,re),le=!1,ue=new Sj,de=!1,fe=!1,pe=new bk,me=new Z,he=new HO,ge={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},_e=!1;function ve(){return O===null?ie:1}let P=n;function ye(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r182`),t.addEventListener(`webglcontextlost`,Ke,!1),t.addEventListener(`webglcontextrestored`,qe,!1),t.addEventListener(`webglcontextcreationerror`,Je,!1),P===null){let t=`webgl2`;if(P=ye(t,e),P===null)throw ye(t)?Error(`Error creating WebGL context with your selected attributes.`):Error(`Error creating WebGL context.`)}}catch(e){throw KD(`WebGLRenderer: `+e.message),e}let be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue;function We(){be=new pF(P),be.init(),Ve=new LL(P,be),xe=new UP(P,be,e,Ve),Se=new FL(P,be),xe.reversedDepthBuffer&&d&&Se.buffers.depth.setReversed(!0),Ce=new gF(P),we=new mL,Te=new IL(P,be,Se,we,xe,Ve,Ce),Ee=new GP(w),De=new fF(w),Oe=new PP(P),He=new VP(P,Oe),ke=new mF(P,Oe,Ce,He),Ae=new vF(P,ke,Oe,Ce),Re=new _F(P,xe,Te),Fe=new WP(we),je=new pL(w,Ee,De,be,xe,He,Fe),Me=new WL(w,we),Ne=new vL,Pe=new TL(be),Le=new BP(w,Ee,De,Se,Ae,p,s),Ie=new NL(w,Ae,xe),Ue=new GL(P,Ce,xe,Se),ze=new HP(P,be,Ce),Be=new hF(P,be,Ce),Ce.programs=je.programs,w.capabilities=xe,w.extensions=be,w.properties=we,w.renderLists=Ne,w.shadowMap=Ie,w.state=Se,w.info=Ce}We(),m!==1009&&(C=new bF(m,t.width,t.height,r,i));let Ge=new VL(w,P);this.xr=Ge,this.getContext=function(){return P},this.getContextAttributes=function(){return P.getContextAttributes()},this.forceContextLoss=function(){let e=be.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=be.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return ie},this.setPixelRatio=function(e){e!==void 0&&(ie=e,this.setSize(N,re,!1))},this.getSize=function(e){return e.set(N,re)},this.setSize=function(e,n,r=!0){if(Ge.isPresenting){GD(`WebGLRenderer: Can't change size while VR device is presenting.`);return}N=e,re=n,t.width=Math.floor(e*ie),t.height=Math.floor(n*ie),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),C!==null&&C.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(N*ie,re*ie).floor()},this.setDrawingBufferSize=function(e,n,r){N=e,re=n,ie=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(m===1009){console.error(`THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t{function n(){if(r.forEach(function(e){we.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(n,10)}be.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let $e=null;function et(e){$e&&$e(e)}function tt(){rt.stop()}function nt(){rt.start()}let rt=new NP;rt.setAnimationLoop(et),typeof self<`u`&&rt.setContext(self),this.setAnimationLoop=function(e){$e=e,Ge.setAnimationLoop(e),e===null?rt.stop():rt.start()},Ge.addEventListener(`sessionstart`,tt),Ge.addEventListener(`sessionend`,nt),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){KD(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(T===!0)return;let n=Ge.enabled===!0&&Ge.isPresenting===!0,r=C!==null&&(O===null||n)&&C.begin(w,O);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),Ge.enabled===!0&&Ge.isPresenting===!0&&(C===null||C.isCompositing()===!1)&&(Ge.cameraAutoUpdate===!0&&Ge.updateCamera(t),t=Ge.getCamera()),e.isScene===!0&&e.onBeforeRender(w,e,t,O),b=Pe.get(e,S.length),b.init(t),S.push(b),pe.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ue.setFromProjectionMatrix(pe,RD,t.reversedDepth),fe=this.localClippingEnabled,de=Fe.init(this.clippingPlanes,fe),y=Ne.get(e,x.length),y.init(),x.push(y),Ge.enabled===!0&&Ge.isPresenting===!0){let e=w.xr.getDepthSensingMesh();e!==null&&it(e,t,-1/0,w.sortObjects)}it(e,t,0,w.sortObjects),y.finish(),w.sortObjects===!0&&y.sort(ae,oe),_e=Ge.enabled===!1||Ge.isPresenting===!1||Ge.hasDepthSensing()===!1,_e&&Le.addToRenderList(y,e),this.info.render.frame++,de===!0&&Fe.beginShadows();let i=b.state.shadowsArray;if(Ie.render(i,e,t),de===!0&&Fe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(r&&C.hasRenderPass())===!1){let n=y.opaque,r=y.transmissive;if(b.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t0&&ot(n,r,e,t),_e&&Le.render(e),at(y,e,t)}O!==null&&D===0&&(Te.updateMultisampleRenderTarget(O),Te.updateRenderTargetMipmap(O)),r&&C.end(w),e.isScene===!0&&e.onAfterRender(w,e,t),He.resetDefaultState(),ee=-1,k=null,S.pop(),S.length>0?(b=S[S.length-1],de===!0&&Fe.setGlobalState(w.clippingPlanes,b.state.camera)):b=null,x.pop(),y=x.length>0?x[x.length-1]:null};function it(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLight)b.pushLight(e),e.castShadow&&b.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ue.intersectsSprite(e)){r&&he.setFromMatrixPosition(e.matrixWorld).applyMatrix4(pe);let t=Ae.update(e),i=e.material;i.visible&&y.push(e,t,i,n,he.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ue.intersectsObject(e))){let t=Ae.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),he.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),he.copy(e.boundingSphere.center)),he.applyMatrix4(e.matrixWorld).applyMatrix4(pe)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a0&&st(i,t,n),a.length>0&&st(a,t,n),o.length>0&&st(o,t,n),Se.buffers.depth.setTest(!0),Se.buffers.depth.setMask(!0),Se.buffers.color.setMask(!0),Se.setPolygonOffset(!1)}function ot(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(b.state.transmissionRenderTarget[r.id]===void 0){let e=be.has(`EXT_color_buffer_half_float`)||be.has(`EXT_color_buffer_float`);b.state.transmissionRenderTarget[r.id]=new WO(1,1,{generateMipmaps:!0,type:e?DE:bE,minFilter:yE,samples:xe.samples,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:jO.workingColorSpace})}let a=b.state.transmissionRenderTarget[r.id],o=r.viewport||A;a.setSize(o.z*w.transmissionResolutionScale,o.w*w.transmissionResolutionScale);let s=w.getRenderTarget(),c=w.getActiveCubeFace(),l=w.getActiveMipmapLevel();w.setRenderTarget(a),w.getClearColor(ne),M=w.getClearAlpha(),M<1&&w.setClearColor(16777215,.5),w.clear(),_e&&Le.render(n);let u=w.toneMapping;w.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),b.setupLightsView(r),de===!0&&Fe.setGlobalState(w.clippingPlanes,r),st(e,n,r),Te.updateMultisampleRenderTarget(a),Te.updateRenderTargetMipmap(a),be.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i0),d=!!n.morphAttributes.position,f=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,m=0;r.toneMapped&&(O===null||O.isXRRenderTarget===!0)&&(m=w.toneMapping);let h=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=h===void 0?0:h.length,_=we.get(r),v=b.state.lights;if(de===!0&&(fe===!0||e!==k)){let t=e===k&&r.id===ee;Fe.setState(r,e,t)}let y=!1;r.version===_.__version?_.needsLights&&_.lightsStateVersion!==v.state.version?y=!0:_.outputColorSpace===s?i.isBatchedMesh&&_.batching===!1||!i.isBatchedMesh&&_.batching===!0||i.isBatchedMesh&&_.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&_.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&_.instancing===!1||!i.isInstancedMesh&&_.instancing===!0||i.isSkinnedMesh&&_.skinning===!1||!i.isSkinnedMesh&&_.skinning===!0||i.isInstancedMesh&&_.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&_.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&_.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&_.instancingMorph===!1&&i.morphTexture!==null?y=!0:_.envMap===c?r.fog===!0&&_.fog!==a||_.numClippingPlanes!==void 0&&(_.numClippingPlanes!==Fe.numPlanes||_.numIntersection!==Fe.numIntersection)?y=!0:_.vertexAlphas===l&&_.vertexTangents===u&&_.morphTargets===d&&_.morphNormals===f&&_.morphColors===p&&_.toneMapping===m?_.morphTargetsCount!==g&&(y=!0):y=!0:y=!0:y=!0:(y=!0,_.__version=r.version);let x=_.currentProgram;y===!0&&(x=lt(r,t,i));let S=!1,C=!1,T=!1,E=x.getUniforms(),D=_.uniforms;if(Se.useProgram(x.program)&&(S=!0,C=!0,T=!0),r.id!==ee&&(ee=r.id,C=!0),S||k!==e){Se.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),E.setValue(P,`projectionMatrix`,e.projectionMatrix),E.setValue(P,`viewMatrix`,e.matrixWorldInverse);let t=E.map.cameraPosition;t!==void 0&&t.setValue(P,me.setFromMatrixPosition(e.matrixWorld)),xe.logarithmicDepthBuffer&&E.setValue(P,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&E.setValue(P,`isOrthographic`,e.isOrthographicCamera===!0),k!==e&&(k=e,C=!0,T=!0)}if(_.needsLights&&(v.state.directionalShadowMap.length>0&&E.setValue(P,`directionalShadowMap`,v.state.directionalShadowMap,Te),v.state.spotShadowMap.length>0&&E.setValue(P,`spotShadowMap`,v.state.spotShadowMap,Te),v.state.pointShadowMap.length>0&&E.setValue(P,`pointShadowMap`,v.state.pointShadowMap,Te)),i.isSkinnedMesh){E.setOptional(P,i,`bindMatrix`),E.setOptional(P,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),E.setValue(P,`boneTexture`,e.boneTexture,Te))}i.isBatchedMesh&&(E.setOptional(P,i,`batchingTexture`),E.setValue(P,`batchingTexture`,i._matricesTexture,Te),E.setOptional(P,i,`batchingIdTexture`),E.setValue(P,`batchingIdTexture`,i._indirectTexture,Te),E.setOptional(P,i,`batchingColorTexture`),i._colorsTexture!==null&&E.setValue(P,`batchingColorTexture`,i._colorsTexture,Te));let A=n.morphAttributes;if((A.position!==void 0||A.normal!==void 0||A.color!==void 0)&&Re.update(i,n,x),(C||_.receiveShadow!==i.receiveShadow)&&(_.receiveShadow=i.receiveShadow,E.setValue(P,`receiveShadow`,i.receiveShadow)),r.isMeshGouraudMaterial&&r.envMap!==null&&(D.envMap.value=c,D.flipEnvMap.value=c.isCubeTexture&&c.isRenderTargetTexture===!1?-1:1),r.isMeshStandardMaterial&&r.envMap===null&&t.environment!==null&&(D.envMapIntensity.value=t.environmentIntensity),D.dfgLUT!==void 0&&(D.dfgLUT.value=JL()),C&&(E.setValue(P,`toneMappingExposure`,w.toneMappingExposure),_.needsLights&&pt(D,T),a&&r.fog===!0&&Me.refreshFogUniforms(D,a),Me.refreshMaterialUniforms(D,r,ie,re,b.state.transmissionRenderTarget[e.id]),DI.upload(P,ut(_),D,Te)),r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&(DI.upload(P,ut(_),D,Te),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&E.setValue(P,`center`,i.center),E.setValue(P,`modelViewMatrix`,i.modelViewMatrix),E.setValue(P,`normalMatrix`,i.normalMatrix),E.setValue(P,`modelMatrix`,i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){let e=r.uniformsGroups;for(let t=0,n=e.length;t0&&Te.useMultisampledRTT(e)===!1?we.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,A.copy(e.viewport),te.copy(e.scissor),j=e.scissorTest}else A.copy(se).multiplyScalar(ie).floor(),te.copy(ce).multiplyScalar(ie).floor(),j=le;if(n!==0&&(r=ht),Se.bindFramebuffer(P.FRAMEBUFFER,r)&&Se.drawBuffers(e,r),Se.viewport(A),Se.scissor(te),Se.setScissorTest(j),i){let r=we.get(e.texture);P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&(e.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+s),P.readPixels(t,n,r,i,Ve.convert(c),Ve.convert(l),a))}finally{let e=O===null?null:we.get(O).__webglFramebuffer;Se.bindFramebuffer(P.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=we.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c){if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){Se.bindFramebuffer(P.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(!xe.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!xe.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=P.createBuffer();P.bindBuffer(P.PIXEL_PACK_BUFFER,d),P.bufferData(P.PIXEL_PACK_BUFFER,a.byteLength,P.STREAM_READ),e.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+s),P.readPixels(t,n,r,i,Ve.convert(l),Ve.convert(u),0);let f=O===null?null:we.get(O).__webglFramebuffer;Se.bindFramebuffer(P.FRAMEBUFFER,f);let p=P.fenceSync(P.SYNC_GPU_COMMANDS_COMPLETE,0);return P.flush(),await JD(P,p,4),P.bindBuffer(P.PIXEL_PACK_BUFFER,d),P.getBufferSubData(P.PIXEL_PACK_BUFFER,0,a),P.deleteBuffer(d),P.deleteSync(p),a}throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)}},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;Te.setTexture2D(e,0),P.copyTexSubImage2D(P.TEXTURE_2D,n,0,0,o,s,i,a),Se.unbindTexture()};let gt=P.createFramebuffer(),_t=P.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=null){a===null&&(i===0?a=0:(qD(`WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.`),a=i,i=0));let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=Ve.convert(t.format),_=Ve.convert(t.type),v;t.isData3DTexture?(Te.setTexture3D(t,0),v=P.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(Te.setTexture2DArray(t,0),v=P.TEXTURE_2D_ARRAY):(Te.setTexture2D(t,0),v=P.TEXTURE_2D),P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,t.flipY),P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),P.pixelStorei(P.UNPACK_ALIGNMENT,t.unpackAlignment);let y=P.getParameter(P.UNPACK_ROW_LENGTH),b=P.getParameter(P.UNPACK_IMAGE_HEIGHT),x=P.getParameter(P.UNPACK_SKIP_PIXELS),S=P.getParameter(P.UNPACK_SKIP_ROWS),C=P.getParameter(P.UNPACK_SKIP_IMAGES);P.pixelStorei(P.UNPACK_ROW_LENGTH,h.width),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,h.height),P.pixelStorei(P.UNPACK_SKIP_PIXELS,l),P.pixelStorei(P.UNPACK_SKIP_ROWS,u),P.pixelStorei(P.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=we.get(e),r=we.get(t),h=we.get(n.__renderTarget),g=we.get(r.__renderTarget);Se.bindFramebuffer(P.READ_FRAMEBUFFER,h.__webglFramebuffer),Se.bindFramebuffer(P.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n{t[n*3]=e.x,t[n*3+1]=e.y,t[n*3+2]=e.z}),t}function ZL(e,t){let n=[];return e.forEach((e,r)=>{let i=n=>{let i=e[n];if(i===void 0||!Number.isInteger(i)||i<0||i>=t)throw RangeError(`Face ${r} references vertex ${String(i)}, which is outside the ${t} available vertices`);return i};for(let t=1;te.indices),e.vertices.length);return t.setIndex(r),t.setAttribute(`position`,new bA(n,3)),t.computeVertexNormals(),new Q(t,new CN({color:30719,flatShading:!0,side:2}))}function $L(e){let t=new jA,n=XL(e.vertices),r=ZL(e.faces.map(e=>e.vertexIndices),e.vertices.length);return t.setIndex(r),t.setAttribute(`position`,new bA(n,3)),t.computeVertexNormals(),new Q(t,new CN({color:52292,side:2}))}function eR(e){let t=new Z(e.point.x,e.point.y,e.point.z),n=new Z(e.xaxis.x,e.xaxis.y,e.xaxis.z),r=new Z(e.yaxis.x,e.yaxis.y,e.yaxis.z),i=new Z().crossVectors(n,r),a=new bk;return a.makeBasis(n,r,i),a.setPosition(t),a}function tR(e){let t=new Float32Array(e.length*3);return e.forEach((e,n)=>{t[n*3]=e.x,t[n*3+1]=e.y,t[n*3+2]=e.z}),t}function nR(e){let t=new GA(e.xsize,e.ysize,e.zsize),n=eR(e.frame),r=new Q(t);return r.applyMatrix4(n),r}function rR(e,t,n){let r=new Q(new Kj(e.radius,e.height,t,n)),i=eR(e.frame);return r.applyMatrix4(i),r}function iR(e,t){let n=new qj(e.radius,t),r=eR(e.frame),i=new Q(n);return i.applyMatrix4(r),i}function aR(e,t){let n=new Q(new Yj(e.radius,e.height,t)),r=eR(e.frame);return n.applyMatrix4(r),n}function oR(e,t){let n=new Q(new Jj(e.radius,e.radius,e.height,t)),r=eR(e.frame);return n.applyMatrix4(r),n}function sR(e){let t=new OP(1);t.setColors(new fA(16711680),new fA(65280),new fA(255));let n=eR(e);return t.applyMatrix4(n),t}function cR(e){let t=new Z(e.start.x,e.start.y,e.start.z),n=new Z(e.end.x,e.end.y,e.end.z);return new jj(new jA().setFromPoints([t,n]),new Cj({color:255}))}function lR(e){let t=new Z(e.point.x,e.point.y,e.point.z),n=new Z(e.normal.x,e.normal.y,e.normal.z),r=new Q(new yN(1,1),new gA({color:16711935,side:2}));r.position.copy(t);let i=new CO;return i.setFromUnitVectors(new Z(0,0,1),n),r.quaternion.copy(i),r}function uR(e){let t=new jA,n=new Float32Array([e.x,e.y,e.z]);return t.setAttribute(`position`,new bA(n,3)),new Vj(t,new Ij({size:.2,color:255}))}function dR(e){let t=new jA,n=tR(e.points);return t.setAttribute(`position`,new bA(n,3)),new Vj(t,new Ij({size:.2,color:16711935}))}function fR(e){let t=new jA,n=tR(e.points);return t.setAttribute(`position`,new bA(n,3)),new jj(t,new Cj({color:0}))}function pR(e,t=64,n=64){let r=new Q(new bN(e.radius,t,n)),i=eR(e.frame);return r.applyMatrix4(i),r}function mR(e,t=64,n=64){let r=new Q(new xN(e.radiusAxis,e.radiusPipe,t,n)),i=eR(e.frame);return r.applyMatrix4(i),r}function hR(e,t){let n=new Z(e.x,e.y,e.z),r=n.length();n.normalize();let i;i=t?new Z(t.x,t.y,t.z):new Z(0,0,0);let a=new DP(n,i,r,16711680);return a.setDirection(n),a}var gR=[Ew,kw,Ww,mw,qw,$w,cT],_R=[mT,_T,bT,CT,ET,kT,RT,VT];function vR(e){return e===null?`null`:e===void 0?`undefined`:typeof e==`object`?e.constructor?.name||`object`:typeof e}var yR=class extends TypeError{objectType;constructor(e,t=`is not supported by the viewer`){let n=vR(e);super(`${n} ${t}`),this.name=`UnsupportedCompasObjectError`,this.objectType=n}};function bR(e){if(gR.some(t=>e instanceof t))throw new yR(e,`does not have an implemented renderer`);if(_R.some(t=>e instanceof t))throw new yR(e,`is data, not renderable scene geometry`);switch(!0){case e instanceof Mw:return nR(e);case e instanceof Fw:return rR(e,32,32);case e instanceof Cw:return iR(e,64);case e instanceof Rw:return aR(e,64);case e instanceof Vw:return oR(e,64);case e instanceof bw:return sR(e);case e instanceof Xw:return cR(e);case e instanceof nT:return lR(e);case e instanceof QC:return uR(e);case e instanceof aT:return dR(e);case e instanceof dT:return fR(e);case e instanceof MT:return pR(e);case e instanceof FT:return mR(e);case e instanceof _w:return hR(e);case e instanceof dw:return QL(e);case e instanceof aw:return $L(e)}throw new yR(e)}function xR(e){switch(e.type){case`standard_material`:return CR(e);case`line_material`:return wR(e);case`point_material`:return TR(e);case`physical_material`:return ER(e)}}function SR(e){let t=e.replace(`#`,`0x`);return parseInt(t)}function CR(e){return new CN({color:SR(e.color),metalness:e.metalness,roughness:e.roughness,emissive:SR(e.emissive),emissiveIntensity:e.emissive_intensity,flatShading:e.flat_shading,wireframe:e.wireframe,side:2,transparent:e.transparent,opacity:e.opacity})}function wR(e){return new Cj({color:SR(e.color)})}function TR(e){return new Ij({color:SR(e.color),size:e.size})}function ER(e){return new wN({color:SR(e.color),metalness:e.metalness,roughness:e.roughness,emissive:SR(e.emissive),emissiveIntensity:e.emissive_intensity,flatShading:e.flat_shading,wireframe:e.wireframe,side:2,anisotropy:e.anisotropy,anisotropyRotation:e.anisotropy_rotation,attenuationColor:SR(e.attenuation_color),...e.attenuation_distance===void 0?{}:{attenuationDistance:e.attenuation_distance},clearcoat:e.clearcoat,clearcoatRoughness:e.clearcoat_roughness,dispersion:e.dispersion,ior:e.ior,iridescence:e.iridescence,iridescenceIOR:e.iridescence_ior,iridescenceThicknessRange:[e.iridescence_thickness_start,e.iridescence_thickness_end],reflectivity:e.reflectivity,sheen:e.sheen,sheenColor:SR(e.sheen_color),specularColor:SR(e.specular_color),sheenRoughness:e.sheen_roughness,specularIntensity:e.specular_intensity,thickness:e.thickness,transmission:e.transmission})}var DR=class e extends Q{constructor(){let t=e.SkyShader,n=new $A({name:t.name,uniforms:XA.clone(t.uniforms),vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,side:1,depthWrite:!1});super(new GA(1,1,1),n),this.isSky=!0}};DR.SkyShader={name:`SkyShader`,uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new Z},up:{value:new Z(0,1,0)}},vertexShader:` - uniform vec3 sunPosition; - uniform float rayleigh; - uniform float turbidity; - uniform float mieCoefficient; - uniform vec3 up; - - varying vec3 vWorldPosition; - varying vec3 vSunDirection; - varying float vSunfade; - varying vec3 vBetaR; - varying vec3 vBetaM; - varying float vSunE; - - // constants for atmospheric scattering - const float e = 2.71828182845904523536028747135266249775724709369995957; - const float pi = 3.141592653589793238462643383279502884197169; - - // wavelength of used primaries, according to preetham - const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 ); - // this pre-calculation replaces older TotalRayleigh(vec3 lambda) function: - // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn)) - const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 ); - - // mie stuff - // K coefficient for the primaries - const float v = 4.0; - const vec3 K = vec3( 0.686, 0.678, 0.666 ); - // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K - const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 ); - - // earth shadow hack - // cutoffAngle = pi / 1.95; - const float cutoffAngle = 1.6110731556870734; - const float steepness = 1.5; - const float EE = 1000.0; - - float sunIntensity( float zenithAngleCos ) { - zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 ); - return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) ); - } - - vec3 totalMie( float T ) { - float c = ( 0.2 * T ) * 10E-18; - return 0.434 * c * MieConst; - } - - void main() { - - vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); - vWorldPosition = worldPosition.xyz; - - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - gl_Position.z = gl_Position.w; // set z to camera.far - - vSunDirection = normalize( sunPosition ); - - vSunE = sunIntensity( dot( vSunDirection, up ) ); - - vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 ); - - float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) ); - - // extinction (absorption + out scattering) - // rayleigh coefficients - vBetaR = totalRayleigh * rayleighCoefficient; - - // mie coefficients - vBetaM = totalMie( turbidity ) * mieCoefficient; - - }`,fragmentShader:` - varying vec3 vWorldPosition; - varying vec3 vSunDirection; - varying float vSunfade; - varying vec3 vBetaR; - varying vec3 vBetaM; - varying float vSunE; - - uniform float mieDirectionalG; - uniform vec3 up; - - // constants for atmospheric scattering - const float pi = 3.141592653589793238462643383279502884197169; - - const float n = 1.0003; // refractive index of air - const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius) - - // optical length at zenith for molecules - const float rayleighZenithLength = 8.4E3; - const float mieZenithLength = 1.25E3; - // 66 arc seconds -> degrees, and the cosine of that - const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324; - - // 3.0 / ( 16.0 * pi ) - const float THREE_OVER_SIXTEENPI = 0.05968310365946075; - // 1.0 / ( 4.0 * pi ) - const float ONE_OVER_FOURPI = 0.07957747154594767; - - float rayleighPhase( float cosTheta ) { - return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) ); - } - - float hgPhase( float cosTheta, float g ) { - float g2 = pow( g, 2.0 ); - float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 ); - return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse ); - } - - void main() { - - vec3 direction = normalize( vWorldPosition - cameraPosition ); - - // optical length - // cutoff angle at 90 to avoid singularity in next formula. - float zenithAngle = acos( max( 0.0, dot( up, direction ) ) ); - float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) ); - float sR = rayleighZenithLength * inverse; - float sM = mieZenithLength * inverse; - - // combined extinction factor - vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) ); - - // in scattering - float cosTheta = dot( direction, vSunDirection ); - - float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 ); - vec3 betaRTheta = vBetaR * rPhase; - - float mPhase = hgPhase( cosTheta, mieDirectionalG ); - vec3 betaMTheta = vBetaM * mPhase; - - vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) ); - Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) ); - - // nightsky - float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2] - float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2] - vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 ); - vec3 L0 = vec3( 0.1 ) * Fex; - - // composition + solar disc - float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta ); - L0 += ( vSunE * 19000.0 * Fex ) * sundisk; - - vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 ); - - vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) ); - - gl_FragColor = vec4( retColor, 1.0 ); - - #include - #include - - }`};function OR(e){switch(e.type){case`point_light`:return AR(e);case`spot_light`:return jR(e);case`rect_light`:return MR(e);case`sunlight`:return NR(e);case`sky`:return PR(e);case`ambient_light`:return IR(e)}}function kR(e){let t=e.replace(`#`,`0x`);return parseInt(t)}function AR(e){let t=new eP;return t.color.setHex(kR(e.color)),t.intensity=e.intensity,t.distance=e.distance,t.decay=e.decay,t.position.set(e.x,e.y,e.z),t.castShadow=!0,t.shadow.bias=-.002,t.shadow.normalBias=.02,t}function jR(e){let t=new QN;t.color.setHex(kR(e.color)),t.intensity=e.intensity,t.distance=e.distance,t.angle=e.angle,t.penumbra=e.penumbra,t.decay=e.decay,t.position.set(e.x,e.y,e.z),t.castShadow=!0,t.shadow.bias=-.002,t.shadow.normalBias=.02;let n=new qk;return n.position.set(e.tx,e.ty,e.tz),t.target=n,t}function MR(e){let t=new aP;return t.color.setHex(kR(e.color)),t.intensity=e.intensity,t.width=e.width,t.height=e.height,t.position.set(e.x,e.y,e.z),t.lookAt(e.tx,e.ty,e.tz),t}function NR(e){let t=new rP;return t.color.setHex(kR(e.color)),t.intensity=e.intensity,t.position.set(e.x,e.y,e.z),t.target.position.set(e.tx,e.ty,e.tz),t.castShadow=!0,t}function PR(e){let t=new DR;t.scale.setScalar(1e3),FR(t,`up`,new Z(0,0,1)),FR(t,`turbidity`,e.turbidity),FR(t,`rayleigh`,e.rayleigh),FR(t,`mieCoefficient`,e.mie_coefficient),FR(t,`mieDirectionalG`,e.mie_directional_g);let n=new Z,r=SO.degToRad(90-e.elevation),i=SO.degToRad(e.azimuth);return n.setFromSphericalCoords(1,r,i),FR(t,`sunPosition`,n),t}function FR(e,t,n){let r=e.material.uniforms[t];if(!r)throw Error(`The Three.js Sky shader has no "${t}" uniform`);r.value=n}function IR(e){let t=new iP;return t.color.setHex(kR(e.color)),t.intensity=e.intensity,t}var LR=class extends Error{code;details;constructor(e,t,n={}){super(t,{cause:n.cause}),this.name=`CompasViewerError`,this.code=e,this.details=n.details}};function RR(e,t,n,r){return e instanceof LR?e:new LR(t,n,{cause:e,...r===void 0?{}:{details:r}})}var zR=new Set([`background_color`,`controls_damping`,`world_axis`,`picker`,`camera_fov`,`camera_zoom`,`camera_position`,`camera_target`,`camera_view`,`show_edges`]),BR=new Set([`button`,`load_json_button`,`slider`,`number_field`,`checkbox`,`select`]),VR=new Set([`remove`,`set_visibility`,`toggle_visibility`]),HR=new Set([`standard_material`,`line_material`,`point_material`,`physical_material`]),UR=new Set([`point_light`,`spot_light`,`rect_light`,`sunlight`,`sky`,`ambient_light`]),WR=new Set([`top`,`bottom`,`front`,`back`,`left`,`right`,`front_left`,`front_right`,`back_left`,`back_right`]);function GR(e){let t=qR(e,`dispatch`);switch(t){case`material`:return ez(e),e;case`light`:return tz(e),e;case`object_action`:return oz(e),e;case`scene`:return nz(e),e;case`theme`:return $R(e,`mode`,new Set([`light`,`dark`])),e;case`ui`:return rz(e),e;case`text`:return $R(e,`type`,new Set([`text_geometry`])),iz(e),e;case`text_tag`:return az(e),e;case`object_infos`:return e;case`handle_geometry`:return sz(e),e;default:throw new LR(`unsupported_message`,`Unsupported viewer dispatch: ${t}`,{details:{dispatch:t}})}}function KR(e){let t=e.geometry_guid??e.geometryBackendGuid;return(typeof t!=`string`||t.length===0)&&uz(e,`geometry_guid`,`a non-empty geometry GUID (geometry_guid or geometryBackendGuid)`),t}function qR(e,t){let n=e[t];return typeof n!=`string`&&uz(e,t,`a string`),n}function JR(e,t){let n=qR(e,t);return n.length===0&&uz(e,t,`a non-empty string`),n}function YR(e,t){let n=e[t];if(n!=null)return typeof n!=`string`&&uz(e,t,`a string`),n}function XR(e,t){let n=e[t];return(typeof n!=`number`||!Number.isFinite(n))&&uz(e,t,`a finite number`),n}function ZR(e,t){let n=e[t];return typeof n!=`boolean`&&uz(e,t,`a boolean`),n}function QR(e,t){let n=e[t];return(!Array.isArray(n)||!n.every(e=>typeof e==`string`))&&uz(e,t,`an array of strings`),n}function $R(e,t,n){let r=qR(e,t);if(!n.has(r))throw new LR(`unsupported_message`,`Unsupported ${dz(e)} ${t}: ${r}`,{details:{dispatch:e.dispatch,field:t,value:r}});return r}function ez(e){let t=$R(e,`type`,HR);if(JR(e,`guid`),KR(e),qR(e,`color`),t!==`line_material`){if(t===`point_material`){XR(e,`size`);return}if(cz(e,[`metalness`,`roughness`,`emissive_intensity`]),qR(e,`emissive`),lz(e,[`flat_shading`,`wireframe`]),t===`standard_material`){ZR(e,`transparent`),XR(e,`opacity`);return}cz(e,[`anisotropy`,`anisotropy_rotation`,`clearcoat`,`clearcoat_roughness`,`dispersion`,`ior`,`iridescence`,`iridescence_ior`,`iridescence_thickness_start`,`iridescence_thickness_end`,`reflectivity`,`sheen`,`sheen_roughness`,`specular_intensity`,`thickness`,`transmission`]),e.attenuation_distance!==void 0&&XR(e,`attenuation_distance`);for(let t of[`attenuation_color`,`sheen_color`,`specular_color`])qR(e,t)}}function tz(e){let t=$R(e,`type`,UR);if(JR(e,`guid`),t===`sky`){cz(e,[`turbidity`,`rayleigh`,`mie_coefficient`,`mie_directional_g`,`elevation`,`azimuth`]);return}qR(e,`color`),XR(e,`intensity`),t!==`ambient_light`&&(cz(e,[`x`,`y`,`z`]),t===`point_light`?cz(e,[`distance`,`decay`]):t===`spot_light`?cz(e,[`distance`,`decay`,`angle`,`penumbra`,`tx`,`ty`,`tz`]):(cz(e,[`tx`,`ty`,`tz`]),t===`rect_light`&&cz(e,[`width`,`height`])))}function nz(e){switch($R(e,`type`,zR)){case`background_color`:qR(e,`color`);break;case`controls_damping`:ZR(e,`damping`);break;case`world_axis`:case`show_edges`:ZR(e,`show`);break;case`picker`:ZR(e,`enabled`);break;case`camera_fov`:XR(e,`fov`);break;case`camera_zoom`:XR(e,`zoom`);break;case`camera_position`:case`camera_target`:cz(e,[`x`,`y`,`z`]);break;case`camera_view`:$R(e,`preset`,WR)}}function rz(e){let t=$R(e,`type`,BR);switch(JR(e,`guid`),YR(e,`label`),t){case`button`:case`load_json_button`:qR(e,`text`),qR(e,`variant`);break;case`slider`:cz(e,[`min`,`max`,`step`,`default_value`]);break;case`number_field`:cz(e,[`min`,`max`,`step`,`value`]);break;case`checkbox`:qR(e,`text`),ZR(e,`default_value`);break;case`select`:QR(e,`options`),YR(e,`placeholder`),YR(e,`default_value`)}}function iz(e){JR(e,`guid`),qR(e,`text`),YR(e,`font`),YR(e,`weight`),cz(e,[`size`,`depth`,`direction_x`,`direction_y`,`direction_z`,`up_x`,`up_y`,`up_z`,`point_x`,`point_y`,`point_z`]),ZR(e,`centered`)}function az(e){JR(e,`guid`),qR(e,`text`),YR(e,`color`),cz(e,[`x`,`y`,`z`])}function oz(e){JR(e,`guid`),qR(e,`type`),JR(e,`object_guid`),YR(e,`label`),YR(e,`text`),YR(e,`placeholder`),e.options!==void 0&&QR(e,`options`)}function sz(e){let t=$R(e,`type`,VR);JR(e,`guid`),t===`set_visibility`&&ZR(e,`visible`)}function cz(e,t){for(let n of t)XR(e,n)}function lz(e,t){for(let n of t)ZR(e,n)}function uz(e,t,n){throw new LR(`invalid_message`,`Invalid ${dz(e)} command: ${t} must be ${n}`,{details:{dispatch:e.dispatch,field:t,value:e[t]}})}function dz(e){return typeof e.dispatch==`string`?e.dispatch:`viewer`}function fz(){return{objectBarData:Kt({title:`Object Infos`,isVisible:!1,data:null}),objectActionsState:Kt([]),sideBarInfoState:Kt({title:`Sidebar Infos`,isVisible:!1,data:null}),sidebarComponents:Kt([]),pickerEnabled:Kt({value:!0}),pickerMode:Kt({value:`translate`}),blockPicker:Kt({value:!1}),showEdges:Kt({value:!1}),theme:Kt({value:`light`})}}var pz={type:`change`},mz={type:`start`},hz={type:`end`},gz=new yk,_z=new vj,vz=Math.cos(70*SO.DEG2RAD),yz=new Z,bz=2*Math.PI,xz={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Sz=1e-6,Cz=class extends AP{constructor(e,t=null){super(e,t),this.state=xz.NONE,this.target=new Z,this.cursor=new Z,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:lE.ROTATE,MIDDLE:lE.DOLLY,RIGHT:lE.PAN},this.touches={ONE:uE.ROTATE,TWO:uE.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new Z,this._lastQuaternion=new CO,this._lastTargetPosition=new Z,this._quat=new CO().setFromUnitVectors(e.up,new Z(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new CP,this._sphericalDelta=new CP,this._scale=1,this._panOffset=new Z,this._rotateStart=new X,this._rotateEnd=new X,this._rotateDelta=new X,this._panStart=new X,this._panEnd=new X,this._panDelta=new X,this._dollyStart=new X,this._dollyEnd=new X,this._dollyDelta=new X,this._dollyDirection=new Z,this._mouse=new X,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Tz.bind(this),this._onPointerDown=wz.bind(this),this._onPointerUp=Ez.bind(this),this._onContextMenu=Nz.bind(this),this._onMouseWheel=kz.bind(this),this._onKeyDown=Az.bind(this),this._onTouchStart=jz.bind(this),this._onTouchMove=Mz.bind(this),this._onMouseDown=Dz.bind(this),this._onMouseMove=Oz.bind(this),this._interceptControlDown=Pz.bind(this),this._interceptControlUp=Fz.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.ownerDocument.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.ownerDocument.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=`auto`}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(pz),this.update(),this.state=xz.NONE}update(e=null){let t=this.object.position;yz.copy(t).sub(this.target),yz.applyQuaternion(this._quat),this._spherical.setFromVector3(yz),this.autoRotate&&this.state===xz.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=bz:n>Math.PI&&(n-=bz),r<-Math.PI?r+=bz:r>Math.PI&&(r-=bz),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(yz.setFromSpherical(this._spherical),yz.applyQuaternion(this._quatInverse),t.copy(this.target).add(yz),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=yz.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new Z(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new Z(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=yz.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(gz.origin.copy(this.object.position),gz.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(gz.direction))Sz||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Sz||this._lastTargetPosition.distanceToSquared(this.target)>Sz?(this.dispatchEvent(pz),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?bz/60/60*this.autoRotateSpeed:bz/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){yz.setFromMatrixColumn(t,0),yz.multiplyScalar(-e),this._panOffset.add(yz)}_panUp(e,t){this.screenSpacePanning===!0?yz.setFromMatrixColumn(t,1):(yz.setFromMatrixColumn(t,0),yz.crossVectors(this.object.up,yz)),yz.multiplyScalar(e),this._panOffset.add(yz)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;yz.copy(r).sub(this.target);let i=yz.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(bz*this._rotateDelta.x/t.clientHeight),this._rotateUp(bz*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(bz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-bz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(bz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-bz*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(bz*this._rotateDelta.x/t.clientHeight),this._rotateUp(bz*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t.9&&(r.visible=!1)),this.axis===`Y`&&(zz.setFromEuler(Qz.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(zz),Math.abs($z.copy(sB).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(zz.setFromEuler(Qz.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(zz),Math.abs($z.copy(cB).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(zz.setFromEuler(Qz.set(0,Math.PI/2,0)),$z.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(tB.lookAt(eB,$z,sB)),r.quaternion.multiply(zz),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),Lz.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Lz.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(Lz),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}if(r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`){let e=.99,n=.2;r.name===`X`&&Math.abs($z.copy(oB).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Y`&&Math.abs($z.copy(sB).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Z`&&Math.abs($z.copy(cB).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs($z.copy(cB).applyQuaternion(t).dot(this.eye))=-1&&xB.z<=1&&e.layers.test(r.layers)===!0,l=e.element;l.style.display=c===!0?``:`none`,c===!0&&(e.onBeforeRender(t,n,r),l.style.transform=`translate(`+-100*e.center.x+`%,`+-100*e.center.y+`%)translate(`+(xB.x*i+i)+`px,`+(-xB.y*a+a)+`px)`,l.parentNode!==s&&s.appendChild(l),e.onAfterRender(t,n,r));let d={distanceToCameraSquared:u(r,e)};o.objects.set(e,d)}for(let t=0,i=e.children.length;tthis.resize();onPointerDown=e=>this.pickFromPointer(e);onKeyDown=e=>this.handleKeyDown(e);animationFrame=null;attachedContainer=null;componentId=0;disposed=!1;pickedObject=null;pickedMaterial=null;highlightMaterial=new CN({color:`orange`,emissive:`yellow`,emissiveIntensity:.1});constructor(e,t){this.root=e,this.options=t;let{width:n,height:r}=this.getDimensions();this.camera=new ij(60,n/r,.1,1e3),this.camera.up.set(0,0,1),this.camera.position.set(8,-15,15),this.camera.layers.enable(1),this.renderer=new YL({antialias:!0}),this.renderer.domElement.tabIndex=0,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.toneMapping=4,this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=2,this.renderer.toneMappingExposure=2.5,this.renderer.outputColorSpace=MD,this.controls=new Cz(this.camera,this.renderer.domElement),this.controls.enableDamping=!0,this.controls.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:lE.ROTATE},this.transformControls=new Gz(this.camera,this.renderer.domElement),this.transformHelper=this.transformControls.getHelper(),this.transformControls.addEventListener(`dragging-changed`,e=>{this.controls.enabled=!e.value}),this.scene.add(this.transformHelper),this.labelRenderer.domElement.style.position=`absolute`,this.labelRenderer.domElement.style.inset=`0`,this.labelRenderer.domElement.style.pointerEvents=`none`,this.scene.add(this.axesHelper),this.applyTheme(`light`),this.resize(),this.connection=new cE({...t.websocket,...t.send===void 0?{}:{send:t.send},dispatch:e=>this.dispatch(e),onError:e=>this.reportAsyncError(RR(e,`connection_error`,`The viewer WebSocket connection failed`))})}attach(e){if(this.assertUsable(),this.attachedContainer!==e){if(this.attachedContainer=e,e.append(this.renderer.domElement,this.labelRenderer.domElement),window.addEventListener(`resize`,this.onResize),this.renderer.domElement.addEventListener(`mousedown`,this.onPointerDown),this.root.addEventListener(`keydown`,this.onKeyDown),this.options.defaultLighting&&this.addDefaultLighting(),(this.options.mode??`embedded`)===`websocket`)try{this.connection.start()}catch(e){this.reportOrThrow(RR(e,`connection_error`,`Unable to start the viewer WebSocket connection`))}this.startAnimation(),this.resize()}}dispatch(e){this.assertUsable();let t;try{t=sE(e)}catch(e){this.reportOrThrow(RR(e,`decode_error`,`Unable to decode the COMPAS Protobuf message`));return}try{this.dispatchObject(t)}catch(e){let t=e instanceof yR?new LR(`unsupported_message`,e.message,{cause:e,details:{objectType:e.objectType}}):RR(e,`render_error`,`Unable to apply the viewer message`);this.reportOrThrow(t)}}send(e){return this.connection.send(e)}sendData(e){return this.send(e)}handleUiAction(e,t){this.sendData({dispatch:`ui_callback`,action:e,value:t??null})}handleObjectAction(e,t){this.sendData({dispatch:`object_action_callback`,action_guid:e.guid,object_guid:e.objectGuid,value:t??null})}hideObjectInfo(){this.store.objectBarData.isVisible=!1}setTransformMode(e){this.store.pickerMode.value=e,this.transformControls.setMode(e)}toggleTheme(){this.applyTheme(this.store.theme.value===`dark`?`light`:`dark`)}setCameraViewPreset(e){let t=DB[e].clone().normalize(),n=this.camera.position.distanceTo(this.controls.target);this.camera.position.copy(this.controls.target.clone().add(t.multiplyScalar(n))),this.controls.update()}captureCurrentView(e){return{id:`view-${Date.now()}`,name:e,cameraPosition:this.vectorData(this.camera.position),target:this.vectorData(this.controls.target),zoom:this.camera.zoom,fov:this.camera.fov}}applySavedView(e){this.camera.position.set(e.cameraPosition.x,e.cameraPosition.y,e.cameraPosition.z),this.controls.target.set(e.target.x,e.target.y,e.target.z),this.camera.zoom=e.zoom,this.camera.fov=e.fov,this.camera.updateProjectionMatrix(),this.controls.update()}saveCurrentCanvasImage(e={}){let t=e.format??`png`,n=t===`jpg`?`image/jpeg`:`image/${t}`,r=t,i=Math.max(16,Math.round(e.width??this.renderer.domElement.width)),a=Math.max(16,Math.round(e.height??this.renderer.domElement.height));this.controls.update(),this.renderer.render(this.scene,this.camera);let o=document.createElement(`canvas`);o.width=i,o.height=a;let s=o.getContext(`2d`);if(!s)throw Error(`Unable to create screenshot canvas context`);t===`jpg`&&(s.fillStyle=`#ffffff`,s.fillRect(0,0,i,a)),s.drawImage(this.renderer.domElement,0,0,i,a);let c=document.createElement(`a`);c.download=e.fileName??`compas-view-${Date.now()}.${r}`,c.href=o.toDataURL(n,e.quality),c.click()}reset(){this.clearPickedObject();for(let e of this.geometries.values())this.scene.remove(e),this.disposeObject(e);this.geometries.clear(),this.clearLights();for(let e of this.materials.values())e.material.dispose();this.materials.clear(),this.geometryMaterials.clear(),this.store.sidebarComponents.splice(0),this.store.objectActionsState.splice(0),this.store.objectBarData.data=null,this.store.objectBarData.isVisible=!1,this.store.sideBarInfoState.data=null,this.store.sideBarInfoState.isVisible=!1}resize(){if(this.disposed)return;let{width:e,height:t}=this.getDimensions();this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t),this.labelRenderer.setSize(e,t)}dispose(){this.disposed||(this.disposed=!0,this.connection.dispose(),window.removeEventListener(`resize`,this.onResize),this.root.removeEventListener(`keydown`,this.onKeyDown),this.renderer.domElement.removeEventListener(`mousedown`,this.onPointerDown),this.animationFrame!==null&&cancelAnimationFrame(this.animationFrame),this.animationFrame=null,this.clearPickedObject(),this.resetAfterDispose(),this.controls.dispose(),this.transformControls.detach(),this.scene.remove(this.transformHelper),this.highlightMaterial.dispose(),this.renderer.dispose(),this.renderer.domElement.remove(),this.labelRenderer.domElement.remove(),this.attachedContainer=null)}dispatchObject(e){if(Array.isArray(e)){e.forEach(e=>this.dispatchObject(e));return}if(!e||typeof e!=`object`)return;let t=e;typeof t.dispatch==`string`?this.dispatchCommand(GR(t)):t.bytes instanceof Uint8Array?this.manageGeometry(t):Object.values(t).forEach(e=>this.dispatchObject(e))}dispatchCommand(e){switch(e.dispatch){case`material`:this.manageMaterial(e);break;case`light`:this.manageLight(e);break;case`scene`:this.manageScene(e);break;case`theme`:this.applyTheme(e.mode);break;case`ui`:this.manageUi(e);break;case`text`:this.manageText(e).catch(t=>this.reportAsyncError(RR(t,`render_error`,`Unable to create text geometry`,{dispatch:e.dispatch,guid:e.guid})));break;case`text_tag`:this.manageTextTag(e);break;case`object_infos`:this.store.objectBarData.data=this.withoutDispatch(e);break;case`object_action`:this.manageObjectAction(e);break;case`handle_geometry`:this.handleGeometry(e)}}manageGeometry(e){let t=JR(e,`guid`),n=bR(e),r=this.geometries.get(t);if(r&&(this.scene.remove(r),this.disposeObject(r)),this.applyGeometryMaterial(t,n),this.scene.add(n),this.geometries.set(t,n),this.store.showEdges.value&&n instanceof Q){let e=new Fj(new tM(n.geometry),new Cj({color:0}));e.layers.set(1),n.add(e)}}manageMaterial(e){let t=e.guid,n=KR(e),r=xR(e);this.materials.get(t)?.material.dispose(),this.materials.set(t,{material:r,materialType:e.type}),this.geometryMaterials.set(n,t);let i=this.geometries.get(n);i&&this.assignMaterial(i,r)}manageLight(e){let t=e.guid,n=OR(e);this.removeLight(t);let r=[n];n instanceof DR?r.push(new rP(16777215,1),new iP(16777215,.6)):n instanceof QN&&r.push(n.target),r.forEach(e=>this.scene.add(e)),this.lights.set(t,{objects:r})}manageScene(e){switch(e.type){case`background_color`:this.scene.background=new fA(e.color);break;case`controls_damping`:this.controls.enableDamping=e.damping;break;case`world_axis`:this.axesHelper.visible=e.show;break;case`picker`:this.store.pickerEnabled.value=e.enabled;break;case`camera_fov`:this.camera.fov=e.fov,this.camera.updateProjectionMatrix();break;case`camera_zoom`:this.camera.zoom=e.zoom,this.camera.updateProjectionMatrix();break;case`camera_position`:this.camera.position.set(e.x,e.y,e.z),this.controls.update();break;case`camera_target`:this.controls.target.set(e.x,e.y,e.z),this.controls.update();break;case`camera_view`:this.setCameraViewPreset(e.preset);break;case`show_edges`:this.store.showEdges.value=e.show}}manageUi(e){let t={id:++this.componentId,action:e.guid,...e.label===void 0?{}:{label:e.label}},n;switch(e.type){case`button`:case`load_json_button`:n={...t,component:e.type===`button`?`Button`:`LoadJsonButton`,props:{text:e.text,variant:e.variant}};break;case`slider`:n={...t,component:`Slider`,props:{min:e.min,max:e.max,step:e.step,defaultValue:[e.default_value]}};break;case`number_field`:n={...t,component:`NumberField`,props:{min:e.min,max:e.max,step:e.step,value:e.value}};break;case`checkbox`:n={...t,component:`Checkbox`,props:{text:e.text,defaultValue:e.default_value}};break;case`select`:n={...t,component:`Select`,props:{options:e.options,...e.placeholder===void 0?{}:{placeholder:e.placeholder},...e.default_value===void 0?{}:{defaultValue:e.default_value}}}}this.store.sidebarComponents.push(n),this.store.sideBarInfoState.isVisible=!0}manageObjectAction(e){this.store.objectActionsState.push({guid:e.guid,type:e.type,objectGuid:e.object_guid,...e.label===void 0?{}:{label:e.label},...e.text===void 0?{}:{text:e.text},...e.options===void 0?{}:{options:e.options},...e.placeholder===void 0?{}:{placeholder:e.placeholder},...e.default_value===void 0?{}:{defaultValue:e.default_value}})}pickFromPointer(e){if(this.renderer.domElement.focus({preventScroll:!0}),e.button!==0||!this.store.pickerEnabled.value||this.store.blockPicker.value||this.transformControls.dragging)return;let t=this.renderer.domElement.getBoundingClientRect();if(!t.width||!t.height)return;let n=new X((e.clientX-t.left)/t.width*2-1,-((e.clientY-t.top)/t.height)*2+1);this.raycaster.layers.set(0),this.raycaster.setFromCamera(n,this.camera);let r=Array.from(this.geometries.values()).filter(e=>e.visible),i=this.raycaster.intersectObjects(r,!0)[0]?.object??null;if(!i){this.clearPickedObject();return}if(this.clearPickedObject(),this.pickedObject=i,`material`in i){let e=i;this.pickedMaterial=e.material??null,e.material=this.highlightMaterial}this.transformControls.attach(i);let a=this.findGeometryGuid(i);a&&this.sendData({dispatch:`object_picked`,guid:a})}clearPickedObject(){this.pickedObject&&this.pickedMaterial&&`material`in this.pickedObject&&(this.pickedObject.material=this.pickedMaterial),this.pickedObject=null,this.pickedMaterial=null,this.transformControls.detach(),this.store.objectBarData.data=null,this.store.objectActionsState.splice(0)}findGeometryGuid(e){let t=e;for(;t;){for(let[e,n]of this.geometries)if(n===t)return e;t=t.parent}}handleKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||(e.key===`Escape`?this.clearPickedObject():e.key.toLowerCase()===`p`?this.store.pickerEnabled.value=!this.store.pickerEnabled.value:e.key.toLowerCase()===`i`&&(this.store.objectBarData.isVisible=!this.store.objectBarData.isVisible))}manageTextTag(e){let t=e.guid,n=document.createElement(`div`);n.className=`text-tag`,n.textContent=e.text,e.color&&(n.style.color=e.color);let r=new bB(n);r.position.set(e.x,e.y,e.z);let i=this.geometries.get(t);i&&this.scene.remove(i),this.scene.add(r),this.geometries.set(t,r)}async manageText(e){let t=`${e.font??`helvetiker`}_${e.weight??`regular`}`,n=this.fonts.get(t);n||(n=await new gB().loadAsync(`/fonts/${t}.typeface.json`),this.fonts.set(t,n));let r=new hB(e.text,{font:n,size:e.size,depth:e.depth});if(e.centered){r.computeBoundingBox();let e=r.boundingBox;e&&r.translate(-.5*(e.max.x-e.min.x),0,0)}let i=new Z(e.direction_x,e.direction_y,e.direction_z).normalize(),a=new Z(e.up_x,e.up_y,e.up_z).normalize(),o=new Z().crossVectors(i,a).normalize(),s=new bk().makeBasis(i,a,o);s.setPosition(e.point_x,e.point_y,e.point_z);let c=e.guid,l=this.geometryMaterials.get(c),u=new Q(r,l?this.materials.get(l)?.material:new CN({color:65535,side:2}));u.applyMatrix4(s);let d=this.geometries.get(c);d&&(this.scene.remove(d),this.disposeObject(d)),this.scene.add(u),this.geometries.set(c,u)}handleGeometry(e){let t=e.guid,n=this.geometries.get(t);n&&(e.type===`remove`?(this.scene.remove(n),this.disposeObject(n),this.geometries.delete(t),this.geometryMaterials.delete(t)):e.type===`set_visibility`?n.visible=e.visible:e.type===`toggle_visibility`&&(n.visible=!n.visible))}applyGeometryMaterial(e,t){let n=this.geometryMaterials.get(e),r=n?this.materials.get(n)?.material:void 0;r?this.assignMaterial(t,r):t instanceof Q?t.material=new CN({color:37586,roughness:.7,metalness:.05}):t instanceof jj?t.material=new Cj({color:37586}):t instanceof Vj?t.material=new Ij({color:37586,size:.5}):t instanceof DP&&t.setColor(37586)}assignMaterial(e,t){e instanceof Q?e.material=t:e instanceof jj?e.material=t instanceof Cj?t:new Cj({color:this.materialColor(t)}):e instanceof Vj?e.material=t instanceof Ij?t:new Ij({color:this.materialColor(t),size:.5}):e instanceof DP&&e.setColor(this.materialColor(t))}materialColor(e){return`color`in e&&e.color instanceof fA?e.color:new fA(37586)}applyTheme(e){this.store.theme.value=e,this.scene.background=new fA(e===`dark`?0:15132390)}addDefaultLighting(){if(this.defaultLights.length)return;let e=new rP(16777215,1);e.position.set(30,-10,30);let t=new rP(16777215,.5);t.position.set(-30,-20,30);let n=new rP(16777215,.5);n.position.set(-30,20,10);let r=[e,t,n,new iP(16777215,.5)];r.forEach(e=>this.scene.add(e)),this.defaultLights.push(...r)}removeLight(e){let t=this.lights.get(e);t&&(t.objects.forEach(e=>this.scene.remove(e)),this.lights.delete(e))}clearLights(){for(let e of this.lights.keys())this.removeLight(e)}startAnimation(){if(this.animationFrame!==null)return;let e=()=>{this.disposed||(this.animationFrame=requestAnimationFrame(e),this.controls.update(),this.renderer.render(this.scene,this.camera),this.labelRenderer.render(this.scene,this.camera))};e()}getDimensions(){let e=this.root.getBoundingClientRect();return{width:Math.max(1,Math.round(e.width||this.root.clientWidth||window.innerWidth)),height:Math.max(1,Math.round(e.height||this.root.clientHeight||window.innerHeight))}}disposeObject(e){e.traverse(e=>{let t=e;t.geometry?.dispose(),Array.isArray(t.material)?t.material.forEach(e=>this.disposeUnregisteredMaterial(e)):this.disposeUnregisteredMaterial(t.material)})}disposeUnregisteredMaterial(e){e&&!Array.from(this.materials.values()).some(t=>t.material===e)&&e!==this.highlightMaterial&&e.dispose()}resetAfterDispose(){for(let e of this.geometries.values())this.disposeObject(e);this.geometries.clear(),this.clearLights(),this.materials.clear(),this.geometryMaterials.clear()}vectorData(e){return{x:e.x,y:e.y,z:e.z}}withoutDispatch(e){let{dispatch:t,...n}=e;return n}reportOrThrow(e){if(this.options.onError)this.options.onError(e);else throw e}reportAsyncError(e){this.options.onError?this.options.onError(e):console.error(e)}assertUsable(){if(this.disposed)throw new LR(`lifecycle_error`,`The COMPAS viewer has been disposed`)}};function kB(e,t={}){if(typeof HTMLElement>`u`||!(e instanceof HTMLElement))throw new LR(`lifecycle_error`,`createViewer requires an HTMLElement container`);let n=nn(new OB(e,t)),r=hu(xx,{runtime:n,showToolbar:t.showToolbar??!0});r.provide(iy,n),r.mount(e);let i=!1;return{dispatch(e){n.dispatch(e)},reset(){n.reset()},resize(){n.resize()},dispose(){i||(i=!0,r.unmount(),n.dispose())}}}var AB=document.querySelector(`#app`);if(!AB)throw Error(`Standalone viewer requires an #app container`);kB(AB,{mode:`websocket`,showToolbar:!0}); \ No newline at end of file diff --git a/src/compas_threejs/viewer/frontend/index.html b/src/compas_threejs/viewer/frontend/index.html deleted file mode 100644 index 2c0a358..0000000 --- a/src/compas_threejs/viewer/frontend/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - COMPAS ThreeJS - - - - - - - -
- - diff --git a/sync-frontend.bat b/sync-frontend.bat deleted file mode 100644 index d431ba2..0000000 --- a/sync-frontend.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -REM Sync frontend build from external repo to Python package -python scripts\sync-frontend.py diff --git a/tasks.py b/tasks.py index 8ab7119..4bec767 100644 --- a/tasks.py +++ b/tasks.py @@ -3,36 +3,100 @@ import os import shutil import subprocess +import tempfile from pathlib import Path from compas_invocations2 import build, docs, mkdocs, style, tests from invoke.collection import Collection from invoke.tasks import task +FRONTEND_REPO_URL = "https://github.com/compas-dev/compas_threejs_ts.git" +FRONTEND_DEST = Path("src/compas_threejs/viewer/frontend") + + +def _npm_executable(): + npm = shutil.which("npm") + if not npm: + raise FileNotFoundError( + "npm was not found on PATH. Install Node.js (see compas_threejs_ts's " + "package.json 'engines' for the required version) before running this task." + ) + return npm + @task def sync_frontend(c): - """Build frontend from external repo and copy into Python package.""" - FRONTEND_REPO = Path("../compas_threejs_ts/") - BACKEND_DEST = Path("src/compas_threejs/viewer/frontend") + """Build the frontend from a sibling ../compas_threejs_ts checkout and copy it in. + + For local iteration when developing both repos side by side: always builds + whatever is currently checked out there, ignoring FRONTEND_VERSION. Use + `invoke pre-build` to reproduce exactly what a release build will bundle. + """ + frontend_repo = Path("../compas_threejs_ts/") + npm = _npm_executable() + + print("Building frontend...") + subprocess.run([npm, "run", "build"], cwd=frontend_repo, check=True) + + if FRONTEND_DEST.exists(): + shutil.rmtree(FRONTEND_DEST) + + print("Copying frontend build...") + shutil.copytree(frontend_repo / "dist", FRONTEND_DEST) + + print("Frontend synced successfully.") + + +@task +def pre_build(c): + """Build the pinned compas_threejs_ts release and vendor it into the package. + + This is the pre-build hook the release pipeline runs (via `run-prebuild` on + compas-dev/compas-actions/prepare-release) so that published wheels/sdists + bundle a prebuilt frontend and `pip install` never needs Node.js. It clones + compas_threejs_ts at the tag recorded in FRONTEND_VERSION, so bumping that + file is a deliberate, reviewable step rather than always picking up whatever + is newest. + """ + version = Path("FRONTEND_VERSION").read_text().strip() + npm = _npm_executable() + + with tempfile.TemporaryDirectory(prefix="compas_threejs_ts-") as tmp: + clone_dir = Path(tmp) / "compas_threejs_ts" + + print(f"Cloning compas_threejs_ts@v{version}...") + subprocess.run( + [ + "git", + "clone", + "--branch", + f"v{version}", + "--depth", + "1", + FRONTEND_REPO_URL, + str(clone_dir), + ], + check=True, + ) + + print("Installing frontend dependencies...") + subprocess.run([npm, "ci"], cwd=clone_dir, check=True) - # 1. Build the frontend - print("🔨 Building frontend...") - subprocess.run(["npm", "run", "build"], cwd=FRONTEND_REPO, check=True) + print("Building frontend...") + subprocess.run([npm, "run", "build"], cwd=clone_dir, check=True) - # 2. Clear old frontend files - if BACKEND_DEST.exists(): - shutil.rmtree(BACKEND_DEST) + if FRONTEND_DEST.exists(): + shutil.rmtree(FRONTEND_DEST) - # 3. Copy new build - print("📦 Copying frontend build...") - shutil.copytree(FRONTEND_REPO / "dist", BACKEND_DEST) + print("Copying frontend build...") + shutil.copytree(clone_dir / "dist", FRONTEND_DEST) - print("✅ Frontend synced successfully!") + print(f"Frontend v{version} vendored into {FRONTEND_DEST}") ns = Collection( sync_frontend, + pre_build, docs.help, style.check, style.lint,